vviinn-widgets 2.97.0 → 2.97.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{emitRequestFiltersMore-8b713194.js → emitRequestFiltersMore-35a9fed4.js} +1 -1
- package/dist/cjs/{index-105aee62.js → index-3035bd2b.js} +1 -1
- package/dist/cjs/{package-c4d4f888.js → package-721c5a8c.js} +1 -1
- package/dist/cjs/search-filters_19.cjs.entry.js +4 -4
- package/dist/cjs/{search.store-d2b420fd.js → search.store-4593a19d.js} +9 -0
- package/dist/cjs/vviinn-carousel_8.cjs.entry.js +4 -4
- package/dist/cjs/vviinn-preloader.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +2 -8
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +3 -3
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +2 -7
- package/dist/collection/geometry/Rectangle.js +8 -0
- package/dist/esm/{emitRequestFiltersMore-3b8ae486.js → emitRequestFiltersMore-d84828f1.js} +1 -1
- package/dist/esm/{index-279b5fe1.js → index-60812b71.js} +1 -1
- package/dist/esm/{package-4ceb52bb.js → package-40e32dab.js} +1 -1
- package/dist/esm/search-filters_19.entry.js +4 -4
- package/dist/esm/{search.store-24896fcf.js → search.store-a11affa8.js} +9 -1
- package/dist/esm/vviinn-carousel_8.entry.js +4 -4
- package/dist/esm/vviinn-preloader.entry.js +1 -1
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +2 -8
- package/dist/esm/vviinn-vpr-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-widget.entry.js +3 -3
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +1 -4
- package/dist/types/geometry/Rectangle.d.ts +5 -0
- package/dist/vviinn-widgets/{p-91937557.entry.js → p-19671ffc.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-67e72877.entry.js → p-1d31a842.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-aad518d7.js → p-25a4ca73.js} +1 -1
- package/dist/vviinn-widgets/{p-263f64ad.entry.js → p-299751a4.entry.js} +1 -1
- package/{www/build/p-e3199f82.entry.js → dist/vviinn-widgets/p-3bada1d3.entry.js} +1 -1
- package/{www/build/p-042b091b.js → dist/vviinn-widgets/p-43242068.js} +1 -1
- package/{www/build/p-707f4189.js → dist/vviinn-widgets/p-57e0dbdb.js} +1 -1
- package/dist/vviinn-widgets/{p-926b0a0f.entry.js → p-cd704fa1.entry.js} +1 -1
- package/dist/vviinn-widgets/p-df78d39a.js +1 -0
- package/{www/build/p-fb2e2d42.entry.js → dist/vviinn-widgets/p-e2f8874f.entry.js} +1 -1
- package/dist/vviinn-widgets/p-e61fa361.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-91937557.entry.js → p-19671ffc.entry.js} +1 -1
- package/www/build/{p-67e72877.entry.js → p-1d31a842.entry.js} +1 -1
- package/www/build/{p-aad518d7.js → p-25a4ca73.js} +1 -1
- package/www/build/{p-263f64ad.entry.js → p-299751a4.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-e3199f82.entry.js → www/build/p-3bada1d3.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-042b091b.js → www/build/p-43242068.js} +1 -1
- package/{dist/vviinn-widgets/p-707f4189.js → www/build/p-57e0dbdb.js} +1 -1
- package/www/build/{p-926b0a0f.entry.js → p-cd704fa1.entry.js} +1 -1
- package/www/build/p-df78d39a.js +1 -0
- package/{dist/vviinn-widgets/p-fb2e2d42.entry.js → www/build/p-e2f8874f.entry.js} +1 -1
- package/www/build/p-e61fa361.entry.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/dist/vviinn-widgets/p-6963f7bf.entry.js +0 -1
- package/dist/vviinn-widgets/p-fc276eec.js +0 -1
- package/www/build/p-6963f7bf.entry.js +0 -1
- package/www/build/p-fc276eec.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,f as r}from"./p-1c863deb.js";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(n,r,t){return n(t={path:r,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},t.exports),t.exports}var e=u((function(n,r){var u=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};function e(n){return n}function o(n){return function(){return n}}function i(n,r,t,u,e,o,i,c,f){switch(arguments.length){case 1:return n;case 2:return function(){return r(n.apply(this,arguments))};case 3:return function(){return t(r(n.apply(this,arguments)))};case 4:return function(){return u(t(r(n.apply(this,arguments))))};case 5:return function(){return e(u(t(r(n.apply(this,arguments)))))};case 6:return function(){return o(e(u(t(r(n.apply(this,arguments))))))};case 7:return function(){return i(o(e(u(t(r(n.apply(this,arguments)))))))};case 8:return function(){return c(i(o(e(u(t(r(n.apply(this,arguments))))))))};case 9:return function(){return f(c(i(o(e(u(t(r(n.apply(this,arguments)))))))))}}}function c(){throw new Error("Called `absurd` function which should be uncallable")}Object.defineProperty(r,"__esModule",{value:!0}),r.dual=r.getEndomorphismMonoid=r.not=r.SK=r.hole=r.pipe=r.untupled=r.tupled=r.absurd=r.decrement=r.increment=r.tuple=r.flow=r.flip=r.constVoid=r.constUndefined=r.constNull=r.constFalse=r.constTrue=r.constant=r.unsafeCoerce=r.identity=r.apply=r.getRing=r.getSemiring=r.getMonoid=r.getSemigroup=r.getBooleanAlgebra=void 0,r.getBooleanAlgebra=function(n){return function(){return{meet:function(r,t){return function(u){return n.meet(r(u),t(u))}},join:function(r,t){return function(u){return n.join(r(u),t(u))}},zero:function(){return n.zero},one:function(){return n.one},implies:function(r,t){return function(u){return n.implies(r(u),t(u))}},not:function(r){return function(t){return n.not(r(t))}}}}},r.getSemigroup=function(n){return function(){return{concat:function(r,t){return function(u){return n.concat(r(u),t(u))}}}}},r.getMonoid=function(n){var t=(0,r.getSemigroup)(n);return function(){return{concat:t().concat,empty:function(){return n.empty}}}},r.getSemiring=function(n){return{add:function(r,t){return function(u){return n.add(r(u),t(u))}},zero:function(){return n.zero},mul:function(r,t){return function(u){return n.mul(r(u),t(u))}},one:function(){return n.one}}},r.getRing=function(n){var t=(0,r.getSemiring)(n);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(r,t){return function(u){return n.sub(r(u),t(u))}}}},r.apply=function(n){return function(r){return r(n)}},r.identity=e,r.unsafeCoerce=e,r.constant=o,r.constTrue=o(!0),r.constFalse=o(!1),r.constNull=o(null),r.constUndefined=o(void 0),r.constVoid=r.constUndefined,r.flip=function(n){return function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return r.length>1?n(r[1],r[0]):function(t){return n(t)(r[0])}}},r.flow=i,r.tuple=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n},r.increment=function(n){return n+1},r.decrement=function(n){return n-1},r.absurd=c,r.tupled=function(n){return function(r){return n.apply(void 0,r)}},r.untupled=function(n){return function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return n(r)}},r.pipe=function(n,r,t,u,e,o,i,c,f){switch(arguments.length){case 1:return n;case 2:return r(n);case 3:return t(r(n));case 4:return u(t(r(n)));case 5:return e(u(t(r(n))));case 6:return o(e(u(t(r(n)))));case 7:return i(o(e(u(t(r(n))))));case 8:return c(i(o(e(u(t(r(n)))))));case 9:return f(c(i(o(e(u(t(r(n))))))));default:for(var a=arguments[0],v=1;v<arguments.length;v++)a=arguments[v](a);return a}},r.hole=c,r.SK=function(n,r){return r},r.not=function(n){return function(r){return!n(r)}},r.getEndomorphismMonoid=function(){return{concat:function(n,r){return i(n,r)},empty:e}},r.dual=function(n,r){var t="number"==typeof n?function(r){return r.length>=n}:n;return function(){var n=Array.from(arguments);return t(arguments)?r.apply(this,n):function(t){return r.apply(void 0,u([t],n,!1))}}}})),o=u((function(n,r){var u=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};Object.defineProperty(r,"__esModule",{value:!0}),r.flatMapReader=r.flatMapTask=r.flatMapIO=r.flatMapEither=r.flatMapOption=r.flatMapNullable=r.liftOption=r.liftNullable=r.fromReadonlyNonEmptyArray=r.has=r.emptyRecord=r.emptyReadonlyArray=r.tail=r.head=r.isNonEmpty=r.singleton=r.right=r.left=r.isRight=r.isLeft=r.some=r.none=r.isSome=r.isNone=void 0,r.isNone=function(n){return"None"===n._tag},r.isSome=function(n){return"Some"===n._tag},r.none={_tag:"None"},r.some=function(n){return{_tag:"Some",value:n}},r.isLeft=function(n){return"Left"===n._tag},r.isRight=function(n){return"Right"===n._tag},r.left=function(n){return{_tag:"Left",left:n}},r.right=function(n){return{_tag:"Right",right:n}},r.singleton=function(n){return[n]},r.isNonEmpty=function(n){return n.length>0},r.head=function(n){return n[0]},r.tail=function(n){return n.slice(1)},r.emptyReadonlyArray=[],r.emptyRecord={},r.has=Object.prototype.hasOwnProperty,r.fromReadonlyNonEmptyArray=function(n){return u([n[0]],n.slice(1),!0)},r.liftNullable=function(n){return function(t,u){return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var i=t.apply(void 0,e);return n.fromEither(null==i?(0,r.left)(u.apply(void 0,e)):(0,r.right)(i))}}},r.liftOption=function(n){return function(t,u){return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var i=t.apply(void 0,e);return n.fromEither((0,r.isNone)(i)?(0,r.left)(u.apply(void 0,e)):(0,r.right)(i.value))}}},r.flatMapNullable=function(n,t){return(0,e.dual)(3,(function(u,e,o){return t.flatMap(u,(0,r.liftNullable)(n)(e,o))}))},r.flatMapOption=function(n,t){return(0,e.dual)(3,(function(u,e,o){return t.flatMap(u,(0,r.liftOption)(n)(e,o))}))},r.flatMapEither=function(n,r){return(0,e.dual)(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromEither(u(r))}))}))},r.flatMapIO=function(n,r){return(0,e.dual)(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromIO(u(r))}))}))},r.flatMapTask=function(n,r){return(0,e.dual)(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromTask(u(r))}))}))},r.flatMapReader=function(n,r){return(0,e.dual)(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromReader(u(r))}))}))}})),i=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),i=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),c=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return i(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.sequenceS=r.sequenceT=r.getApplySemigroup=r.apS=r.apSecond=r.apFirst=r.ap=void 0;var f=c(o);function a(n,r,t){return function(u){for(var e=Array(t.length+1),o=0;o<t.length;o++)e[o]=t[o];return e[t.length]=u,0===r?n.apply(null,e):a(n,r-1,e)}}r.ap=function(n,r){return function(t){return function(u){return n.ap(n.map(u,(function(n){return function(t){return r.ap(n,t)}})),t)}}},r.apFirst=function(n){return function(r){return function(t){return n.ap(n.map(t,(function(n){return function(){return n}})),r)}}},r.apSecond=function(n){return function(r){return function(t){return n.ap(n.map(t,(function(){return function(n){return n}})),r)}}},r.apS=function(n){return function(r,t){return function(u){return n.ap(n.map(u,(function(n){return function(t){var u;return Object.assign({},n,((u={})[r]=t,u))}})),t)}}},r.getApplySemigroup=function(n){return function(r){return{concat:function(t,u){return n.ap(n.map(t,(function(n){return function(t){return r.concat(n,t)}})),u)}}}};var v={1:function(n){return[n]},2:function(n){return function(r){return[n,r]}},3:function(n){return function(r){return function(t){return[n,r,t]}}},4:function(n){return function(r){return function(t){return function(u){return[n,r,t,u]}}}},5:function(n){return function(r){return function(t){return function(u){return function(e){return[n,r,t,u,e]}}}}}};r.sequenceT=function(n){return function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var u=r.length,o=function(n){return f.has.call(v,n)||(v[n]=a(e.tuple,n-1,[])),v[n]}(u),i=n.map(r[0],o),c=1;c<u;c++)i=n.ap(i,r[c]);return i}},r.sequenceS=function(n){return function(r){for(var t=Object.keys(r),u=t.length,e=function(n){var r=n.length;switch(r){case 1:return function(r){var t;return(t={})[n[0]]=r,t};case 2:return function(r){return function(t){var u;return(u={})[n[0]]=r,u[n[1]]=t,u}};case 3:return function(r){return function(t){return function(u){var e;return(e={})[n[0]]=r,e[n[1]]=t,e[n[2]]=u,e}}};case 4:return function(r){return function(t){return function(u){return function(e){var o;return(o={})[n[0]]=r,o[n[1]]=t,o[n[2]]=u,o[n[3]]=e,o}}}};case 5:return function(r){return function(t){return function(u){return function(e){return function(o){var i;return(i={})[n[0]]=r,i[n[1]]=t,i[n[2]]=u,i[n[3]]=e,i[n[4]]=o,i}}}}};default:return a((function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];for(var e={},o=0;o<r;o++)e[n[o]]=t[o];return e}),r-1,[])}}(t),o=n.map(r[t[0]],e),i=1;i<u;i++)o=n.ap(o,r[t[i]]);return o}}})),c=u((function(n,r){function t(n){return function(r,t){return n.chain(r,(function(r){return n.map(t(r),(function(){return r}))}))}}Object.defineProperty(r,"__esModule",{value:!0}),r.bind=r.tap=r.chainFirst=void 0,r.chainFirst=function(n){var r=t(n);return function(n){return function(t){return r(t,n)}}},r.tap=t,r.bind=function(n){return function(r,t){return function(u){return n.chain(u,(function(u){return n.map(t(u),(function(n){var t;return Object.assign({},u,((t={})[r]=n,t))}))}))}}}})),f=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),i=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),f=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return i(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.tapEither=r.filterOrElse=r.chainFirstEitherK=r.chainEitherK=r.fromEitherK=r.chainOptionK=r.fromOptionK=r.fromPredicate=r.fromOption=void 0;var a=f(o);function v(n){return function(r){return function(t){return n.fromEither(a.isNone(t)?a.left(r()):a.right(t.value))}}}function d(n){var r=v(n);return function(n){var t=r(n);return function(n){return(0,e.flow)(n,t)}}}function l(n){return function(r){return(0,e.flow)(r,n.fromEither)}}function p(n,r){var t=l(n),u=(0,c.tap)(r);return function(n,r){return u(n,t(r))}}r.fromOption=v,r.fromPredicate=function(n){return function(r,t){return function(u){return n.fromEither(r(u)?a.right(u):a.left(t(u)))}}},r.fromOptionK=d,r.chainOptionK=function(n,r){var t=d(n);return function(n){var u=t(n);return function(n){return function(t){return r.chain(t,u(n))}}}},r.fromEitherK=l,r.chainEitherK=function(n,r){var t=l(n);return function(n){return function(u){return r.chain(u,t(n))}}},r.chainFirstEitherK=function(n,r){var t=p(n,r);return function(n){return function(r){return t(r,n)}}},r.filterOrElse=function(n,r){return function(t,u){return function(e){return r.chain(e,(function(r){return n.fromEither(t(r)?a.right(r):a.left(u(r)))}))}}},r.tapEither=p})),a=u((function(n,r){function t(n,r){return function(t){return function(u){return n.map(u,(function(n){return r.map(n,t)}))}}}function u(n){return function(r,t){return n.map(r,(function(){return t}))}}Object.defineProperty(r,"__esModule",{value:!0}),r.asUnit=r.as=r.getFunctorComposition=r.let=r.bindTo=r.flap=r.map=void 0,r.map=t,r.flap=function(n){return function(r){return function(t){return n.map(t,(function(n){return n(r)}))}}},r.bindTo=function(n){return function(r){return function(t){return n.map(t,(function(n){var t;return(t={})[r]=n,t}))}}},r.let=function(n){return function(r,t){return function(u){return n.map(u,(function(n){var u;return Object.assign({},n,((u={})[r]=t(n),u))}))}}},r.getFunctorComposition=function(n,r){var u=t(n,r);return{map:function(n,r){return(0,e.pipe)(n,u(r))}}},r.as=u,r.asUnit=function(n){var r=u(n);return function(n){return r(n,void 0)}}})),v=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.eqDate=r.eqNumber=r.eqString=r.eqBoolean=r.eq=r.strictEqual=r.getStructEq=r.getTupleEq=r.Contravariant=r.getMonoid=r.getSemigroup=r.eqStrict=r.URI=r.contramap=r.tuple=r.struct=r.fromEquals=void 0,r.fromEquals=function(n){return{equals:function(r,t){return r===t||n(r,t)}}},r.struct=function(n){return(0,r.fromEquals)((function(r,t){for(var u in n)if(!n[u].equals(r[u],t[u]))return!1;return!0}))},r.tuple=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0,r.fromEquals)((function(r,t){return n.every((function(n,u){return n.equals(r[u],t[u])}))}))},r.contramap=function(n){return function(t){return(0,r.fromEquals)((function(r,u){return t.equals(n(r),n(u))}))}},r.URI="Eq",r.eqStrict={equals:function(n,r){return n===r}};var t={equals:function(){return!0}};r.getSemigroup=function(){return{concat:function(n,t){return(0,r.fromEquals)((function(r,u){return n.equals(r,u)&&t.equals(r,u)}))}}},r.getMonoid=function(){return{concat:(0,r.getSemigroup)().concat,empty:t}},r.Contravariant={URI:r.URI,contramap:function(n,t){return(0,e.pipe)(n,(0,r.contramap)(t))}},r.getTupleEq=r.tuple,r.getStructEq=r.struct,r.strictEqual=r.eqStrict.equals,r.eq=r.Contravariant,r.eqBoolean=r.eqStrict,r.eqString=r.eqStrict,r.eqNumber=r.eqStrict,r.eqDate={equals:function(n,r){return n.valueOf()===r.valueOf()}}})),d=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ordDate=r.ordNumber=r.ordString=r.ordBoolean=r.ord=r.getDualOrd=r.getTupleOrd=r.between=r.clamp=r.max=r.min=r.geq=r.leq=r.gt=r.lt=r.equals=r.trivial=r.Contravariant=r.getMonoid=r.getSemigroup=r.URI=r.contramap=r.reverse=r.tuple=r.fromCompare=r.equalsDefault=void 0,r.equalsDefault=function(n){return function(r,t){return r===t||0===n(r,t)}},r.fromCompare=function(n){return{equals:(0,r.equalsDefault)(n),compare:function(r,t){return r===t?0:n(r,t)}}},r.tuple=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0,r.fromCompare)((function(r,t){for(var u=0;u<n.length-1;u++){var e=n[u].compare(r[u],t[u]);if(0!==e)return e}return n[u].compare(r[u],t[u])}))},r.reverse=function(n){return(0,r.fromCompare)((function(r,t){return n.compare(t,r)}))},r.contramap=function(n){return function(t){return(0,r.fromCompare)((function(r,u){return t.compare(n(r),n(u))}))}},r.URI="Ord",r.getSemigroup=function(){return{concat:function(n,t){return(0,r.fromCompare)((function(r,u){var e=n.compare(r,u);return 0!==e?e:t.compare(r,u)}))}}},r.getMonoid=function(){return{concat:(0,r.getSemigroup)().concat,empty:(0,r.fromCompare)((function(){return 0}))}},r.Contravariant={URI:r.URI,contramap:function(n,t){return(0,e.pipe)(n,(0,r.contramap)(t))}},r.trivial={equals:e.constTrue,compare:(0,e.constant)(0)},r.equals=function(n){return function(r){return function(t){return t===r||0===n.compare(t,r)}}},r.lt=function(n){return function(r,t){return-1===n.compare(r,t)}},r.gt=function(n){return function(r,t){return 1===n.compare(r,t)}},r.leq=function(n){return function(r,t){return 1!==n.compare(r,t)}},r.geq=function(n){return function(r,t){return-1!==n.compare(r,t)}},r.min=function(n){return function(r,t){return r===t||n.compare(r,t)<1?r:t}},r.max=function(n){return function(r,t){return r===t||n.compare(r,t)>-1?r:t}},r.clamp=function(n){var t=(0,r.min)(n),u=(0,r.max)(n);return function(n,r){return function(e){return u(t(e,r),n)}}},r.between=function(n){var t=(0,r.lt)(n),u=(0,r.gt)(n);return function(n,r){return function(e){return!t(e,n)&&!u(e,r)}}},r.getTupleOrd=r.tuple,r.getDualOrd=r.reverse,r.ord=r.Contravariant;var t={equals:v.eqStrict.equals,compare:function(n,r){return n<r?-1:n>r?1:0}};r.ordBoolean=t,r.ordString=t,r.ordNumber=t,r.ordDate=(0,e.pipe)(r.ordNumber,(0,r.contramap)((function(n){return n.valueOf()})))})),l=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.concatAll=r.endo=r.filterSecond=r.filterFirst=r.reverse=void 0,r.reverse=function(n){return{concat:function(r,t){return n.concat(t,r)}}},r.filterFirst=function(n){return function(r){return{concat:function(t,u){return n(t)?r.concat(t,u):u}}}},r.filterSecond=function(n){return function(r){return{concat:function(t,u){return n(u)?r.concat(t,u):t}}}},r.endo=function(n){return function(r){return{concat:function(t,u){return r.concat(n(t),n(u))}}}},r.concatAll=function(n){return function(r){return function(t){return t.reduce((function(r,t){return n.concat(r,t)}),r)}}}})),p=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),i=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),c=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return i(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.semigroupProduct=r.semigroupSum=r.semigroupString=r.getFunctionSemigroup=r.semigroupAny=r.semigroupAll=r.fold=r.getIntercalateSemigroup=r.getMeetSemigroup=r.getJoinSemigroup=r.getDualSemigroup=r.getStructSemigroup=r.getTupleSemigroup=r.getFirstSemigroup=r.getLastSemigroup=r.getObjectSemigroup=r.semigroupVoid=r.concatAll=r.last=r.first=r.intercalate=r.tuple=r.struct=r.reverse=r.constant=r.max=r.min=void 0;var f=c(o),a=c(l),v=c(d);r.min=function(n){return{concat:v.min(n)}},r.max=function(n){return{concat:v.max(n)}},r.constant=function(n){return{concat:function(){return n}}},r.reverse=a.reverse,r.struct=function(n){return{concat:function(r,t){var u={};for(var e in n)f.has.call(n,e)&&(u[e]=n[e].concat(r[e],t[e]));return u}}},r.tuple=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return{concat:function(r,t){return n.map((function(n,u){return n.concat(r[u],t[u])}))}}},r.intercalate=function(n){return function(r){return{concat:function(t,u){return r.concat(t,r.concat(n,u))}}}},r.first=function(){return{concat:e.identity}},r.last=function(){return{concat:function(n,r){return r}}},r.concatAll=a.concatAll,r.semigroupVoid=(0,r.constant)(void 0),r.getObjectSemigroup=function(){return{concat:function(n,r){return Object.assign({},n,r)}}},r.getLastSemigroup=r.last,r.getFirstSemigroup=r.first,r.getTupleSemigroup=r.tuple,r.getStructSemigroup=r.struct,r.getDualSemigroup=r.reverse,r.getJoinSemigroup=r.max,r.getMeetSemigroup=r.min,r.getIntercalateSemigroup=r.intercalate,r.fold=function(n){var t=(0,r.concatAll)(n);return function(n,r){return void 0===r?t(n):t(n)(r)}},r.semigroupAll={concat:function(n,r){return n&&r}},r.semigroupAny={concat:function(n,r){return n||r}},r.getFunctionSemigroup=e.getSemigroup,r.semigroupString={concat:function(n,r){return n+r}},r.semigroupSum={concat:function(n,r){return n+r}},r.semigroupProduct={concat:function(n,r){return n*r}}})),s=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),f=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),l=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return f(r,n),r},s=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};Object.defineProperty(r,"__esModule",{value:!0}),r.reduceRight=r.foldMap=r.reduce=r.mapWithIndex=r.map=r.flatten=r.duplicate=r.extend=r.flatMap=r.ap=r.alt=r.altW=r.of=r.chunksOf=r.splitAt=r.chop=r.chainWithIndex=r.intersperse=r.prependAll=r.unzip=r.zip=r.zipWith=r.modifyAt=r.updateAt=r.sort=r.groupBy=r.group=r.reverse=r.concat=r.concatW=r.fromArray=r.unappend=r.unprepend=r.range=r.replicate=r.makeBy=r.fromReadonlyArray=r.rotate=r.union=r.sortBy=r.uniq=r.unsafeUpdateAt=r.unsafeInsertAt=r.append=r.appendW=r.prepend=r.prependW=r.isOutOfBound=r.isNonEmpty=r.empty=void 0,r.groupSort=r.chain=r.intercalate=r.updateLast=r.modifyLast=r.updateHead=r.modifyHead=r.matchRight=r.matchLeft=r.concatAll=r.max=r.min=r.init=r.last=r.tail=r.head=r.apS=r.bind=r.let=r.bindTo=r.Do=r.Comonad=r.Alt=r.TraversableWithIndex=r.Traversable=r.FoldableWithIndex=r.Foldable=r.Monad=r.chainFirst=r.Chain=r.Applicative=r.apSecond=r.apFirst=r.Apply=r.FunctorWithIndex=r.Pointed=r.flap=r.Functor=r.getUnionSemigroup=r.getEq=r.getSemigroup=r.getShow=r.URI=r.extract=r.traverseWithIndex=r.sequence=r.traverse=r.reduceRightWithIndex=r.foldMapWithIndex=r.reduceWithIndex=void 0,r.readonlyNonEmptyArray=r.fold=r.prependToAll=r.insertAt=r.snoc=r.cons=r.unsnoc=r.uncons=r.filterWithIndex=r.filter=void 0;var m=l(o),h=l(p);function I(n){return function(r){return r.concat(n)}}function b(n,r){return r?n.concat(r):function(r){return r.concat(n)}}function R(n){return function(t){var u=t.length;if(0===u)return r.empty;for(var e=[],o=t[0],i=[o],c=1;c<u;c++){var f=t[c];n.equals(f,o)?i.push(f):(e.push(i),i=[o=f])}return e.push(i),e}}r.empty=m.emptyReadonlyArray,r.isNonEmpty=m.isNonEmpty,r.isOutOfBound=function(n,r){return n<0||n>=r.length},r.prependW=function(n){return function(r){return s([n],r,!0)}},r.prepend=r.prependW,r.appendW=function(n){return function(r){return s(s([],r,!0),[n],!1)}},r.append=r.appendW,r.unsafeInsertAt=function(n,t,u){if((0,r.isNonEmpty)(u)){var e=m.fromReadonlyNonEmptyArray(u);return e.splice(n,0,t),e}return[t]},r.unsafeUpdateAt=function(n,r,t){if(t[n]===r)return t;var u=m.fromReadonlyNonEmptyArray(t);return u[n]=r,u},r.uniq=function(n){return function(t){if(1===t.length)return t;for(var u=[(0,r.head)(t)],e=function(r){u.every((function(t){return!n.equals(t,r)}))&&u.push(r)},o=0,i=(0,r.tail)(t);o<i.length;o++)e(i[o]);return u}},r.sortBy=function(n){if((0,r.isNonEmpty)(n)){var t=(0,d.getMonoid)();return(0,r.sort)(n.reduce(t.concat,t.empty))}return e.identity},r.union=function(n){var t=(0,r.uniq)(n);return function(n){return function(r){return t((0,e.pipe)(r,b(n)))}}},r.rotate=function(n){return function(t){var u=t.length,o=Math.round(n)%u;if((0,r.isOutOfBound)(Math.abs(o),t)||0===o)return t;if(o<0){var i=(0,r.splitAt)(-o)(t);return(0,e.pipe)(i[1],b(i[0]))}return(0,r.rotate)(o-u)(t)}},r.fromReadonlyArray=function(n){return(0,r.isNonEmpty)(n)?m.some(n):m.none},r.makeBy=function(n){return function(r){for(var t=Math.max(0,Math.floor(r)),u=[n(0)],e=1;e<t;e++)u.push(n(e));return u}},r.replicate=function(n){return(0,r.makeBy)((function(){return n}))},r.range=function(n,t){return n<=t?(0,r.makeBy)((function(r){return n+r}))(t-n+1):[n]},r.unprepend=function(n){return[(0,r.head)(n),(0,r.tail)(n)]},r.unappend=function(n){return[(0,r.init)(n),(0,r.last)(n)]},r.fromArray=function(n){return(0,r.fromReadonlyArray)(n.slice())},r.concatW=I,r.concat=b,r.reverse=function(n){return 1===n.length?n:s([(0,r.last)(n)],n.slice(0,-1).reverse(),!0)},r.group=R,r.groupBy=function(n){return function(r){for(var t={},u=0,e=r;u<e.length;u++){var o=e[u],i=n(o);m.has.call(t,i)?t[i].push(o):t[i]=[o]}return t}},r.sort=function(n){return function(r){return 1===r.length?r:r.slice().sort(n.compare)}},r.updateAt=function(n,t){return(0,r.modifyAt)(n,(function(){return t}))},r.modifyAt=function(n,t){return function(u){return(0,r.isOutOfBound)(n,u)?m.none:m.some((0,r.unsafeUpdateAt)(n,t(u[n]),u))}},r.zipWith=function(n,r,t){for(var u=[t(n[0],r[0])],e=Math.min(n.length,r.length),o=1;o<e;o++)u[o]=t(n[o],r[o]);return u},r.zip=function n(t,u){return void 0===u?function(r){return n(r,t)}:(0,r.zipWith)(t,u,(function(n,r){return[n,r]}))},r.unzip=function(n){for(var r=[n[0][0]],t=[n[0][1]],u=1;u<n.length;u++)r[u]=n[u][0],t[u]=n[u][1];return[r,t]},r.prependAll=function(n){return function(r){for(var t=[n,r[0]],u=1;u<r.length;u++)t.push(n,r[u]);return t}},r.intersperse=function(n){return function(t){var u=(0,r.tail)(t);return(0,r.isNonEmpty)(u)?(0,e.pipe)(u,(0,r.prependAll)(n),(0,r.prepend)((0,r.head)(t))):t}},r.chainWithIndex=function(n){return function(t){for(var u=m.fromReadonlyNonEmptyArray(n(0,(0,r.head)(t))),e=1;e<t.length;e++)u.push.apply(u,n(e,t[e]));return u}},r.chop=function(n){return function(t){for(var u=n(t),e=[u[0]],o=u[1];(0,r.isNonEmpty)(o);){var i=n(o),c=i[1];e.push(i[0]),o=c}return e}},r.splitAt=function(n){return function(t){var u=Math.max(1,n);return u>=t.length?[t,r.empty]:[(0,e.pipe)(t.slice(1,u),(0,r.prepend)((0,r.head)(t))),t.slice(u)]}},r.chunksOf=function(n){return(0,r.chop)((0,r.splitAt)(n))};var U=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},O=function(n,t){return(0,e.pipe)(n,(0,r.mapWithIndex)(t))},g=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},j=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},M=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},y=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},w=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},x=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},_=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},W=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceWithIndex)(t,u))},E=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},q=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRightWithIndex)(t,u))},k=function(n){var t=(0,r.traverseWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}};r.of=m.singleton,r.altW=function(n){return function(r){return(0,e.pipe)(r,I(n()))}},r.alt=r.altW,r.ap=function(n){return(0,r.flatMap)((function(t){return(0,e.pipe)(n,(0,r.map)(t))}))},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,e.pipe)(n,(0,r.chainWithIndex)((function(n,r){return t(r,n)})))})),r.extend=function(n){return function(t){for(var u=(0,r.tail)(t),e=[n(t)];(0,r.isNonEmpty)(u);)e.push(n(u)),u=(0,r.tail)(u);return e}},r.duplicate=(0,r.extend)(e.identity),r.flatten=(0,r.flatMap)(e.identity),r.map=function(n){return(0,r.mapWithIndex)((function(r,t){return n(t)}))},r.mapWithIndex=function(n){return function(t){for(var u=[n(0,(0,r.head)(t))],e=1;e<t.length;e++)u.push(n(e,t[e]));return u}},r.reduce=function(n,t){return(0,r.reduceWithIndex)(n,(function(n,r,u){return t(r,u)}))},r.foldMap=function(n){return function(r){return function(t){return t.slice(1).reduce((function(t,u){return n.concat(t,r(u))}),r(t[0]))}}},r.reduceRight=function(n,t){return(0,r.reduceRightWithIndex)(n,(function(n,r,u){return t(r,u)}))},r.reduceWithIndex=function(n,r){return function(t){return t.reduce((function(n,t,u){return r(u,n,t)}),n)}},r.foldMapWithIndex=function(n){return function(r){return function(t){return t.slice(1).reduce((function(t,u,e){return n.concat(t,r(e+1,u))}),r(0,t[0]))}}},r.reduceRightWithIndex=function(n,r){return function(t){return t.reduceRight((function(n,t,u){return r(u,t,n)}),n)}},r.traverse=function(n){var t=(0,r.traverseWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.sequence=function(n){return(0,r.traverseWithIndex)(n)(e.SK)},r.traverseWithIndex=function(n){return function(t){return function(u){for(var o=n.map(t(0,(0,r.head)(u)),r.of),i=1;i<u.length;i++)o=n.ap(n.map(o,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),t(i,u[i]));return o}}},r.extract=m.head,r.URI="ReadonlyNonEmptyArray",r.getShow=function(n){return{show:function(r){return"[".concat(r.map(n.show).join(", "),"]")}}},r.getSemigroup=function(){return{concat:b}},r.getEq=function(n){return(0,v.fromEquals)((function(r,t){return r.length===t.length&&r.every((function(r,u){return n.equals(r,t[u])}))}))},r.getUnionSemigroup=function(n){var t=(0,r.union)(n);return{concat:function(n,r){return t(r)(n)}}},r.Functor={URI:r.URI,map:U},r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.FunctorWithIndex={URI:r.URI,map:U,mapWithIndex:O},r.Apply={URI:r.URI,map:U,ap:g},r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.Applicative={URI:r.URI,map:U,ap:g,of:r.of},r.Chain={URI:r.URI,map:U,ap:g,chain:r.flatMap},r.chainFirst=(0,c.chainFirst)(r.Chain),r.Monad={URI:r.URI,map:U,ap:g,of:r.of,chain:r.flatMap},r.Foldable={URI:r.URI,reduce:M,foldMap:y,reduceRight:w},r.FoldableWithIndex={URI:r.URI,reduce:M,foldMap:y,reduceRight:w,reduceWithIndex:W,foldMapWithIndex:E,reduceRightWithIndex:q},r.Traversable={URI:r.URI,map:U,reduce:M,foldMap:y,reduceRight:w,traverse:x,sequence:r.sequence},r.TraversableWithIndex={URI:r.URI,map:U,mapWithIndex:O,reduce:M,foldMap:y,reduceRight:w,traverse:x,sequence:r.sequence,reduceWithIndex:W,foldMapWithIndex:E,reduceRightWithIndex:q,traverseWithIndex:k},r.Alt={URI:r.URI,map:U,alt:_},r.Comonad={URI:r.URI,map:U,extend:j,extract:r.extract},r.Do=(0,r.of)(m.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=(0,c.bind)(r.Chain),r.apS=(0,i.apS)(r.Apply),r.head=r.extract,r.tail=m.tail,r.last=function(n){return n[n.length-1]},r.init=function(n){return n.slice(0,-1)},r.min=function(n){var r=h.min(n);return function(n){return n.reduce(r.concat)}},r.max=function(n){var r=h.max(n);return function(n){return n.reduce(r.concat)}},r.concatAll=function(n){return function(r){return r.reduce(n.concat)}},r.matchLeft=function(n){return function(t){return n((0,r.head)(t),(0,r.tail)(t))}},r.matchRight=function(n){return function(t){return n((0,r.init)(t),(0,r.last)(t))}},r.modifyHead=function(n){return function(t){return s([n((0,r.head)(t))],(0,r.tail)(t),!0)}},r.updateHead=function(n){return(0,r.modifyHead)((function(){return n}))},r.modifyLast=function(n){return function(t){return(0,e.pipe)((0,r.init)(t),(0,r.append)(n((0,r.last)(t))))}},r.updateLast=function(n){return(0,r.modifyLast)((function(){return n}))},r.intercalate=function(n){var t=(0,r.concatAll)(n);return function(n){return(0,e.flow)((0,r.intersperse)(n),t)}},r.chain=r.flatMap,r.groupSort=function(n){var t=(0,r.sort)(n),u=R(n);return function(n){return(0,r.isNonEmpty)(n)?u(t(n)):r.empty}},r.filter=function(n){return(0,r.filterWithIndex)((function(r,t){return n(t)}))},r.filterWithIndex=function(n){return function(t){return(0,r.fromReadonlyArray)(t.filter((function(r,t){return n(t,r)})))}},r.uncons=r.unprepend,r.unsnoc=r.unappend,r.cons=function(n,t){return void 0===t?(0,r.prepend)(n):(0,e.pipe)(t,(0,r.prepend)(n))},r.snoc=function(n,r){return(0,e.pipe)(n,b([r]))},r.insertAt=function(n,t){return function(u){return n<0||n>u.length?m.none:m.some((0,r.unsafeInsertAt)(n,t,u))}},r.prependToAll=r.prependAll,r.fold=r.concatAll,r.readonlyNonEmptyArray={URI:r.URI,of:r.of,map:U,mapWithIndex:O,ap:g,chain:r.flatMap,extend:j,extract:r.extract,reduce:M,foldMap:y,reduceRight:w,traverse:x,sequence:r.sequence,reduceWithIndex:W,foldMapWithIndex:E,reduceRightWithIndex:q,traverseWithIndex:k,alt:_}})),m=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),f=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),v=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return f(r,n),r},l=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};Object.defineProperty(r,"__esModule",{value:!0}),r.mapWithIndex=r.map=r.flatten=r.duplicate=r.extend=r.flatMap=r.ap=r.alt=r.altW=r.chunksOf=r.splitAt=r.chop=r.chainWithIndex=r.foldMap=r.foldMapWithIndex=r.intersperse=r.prependAll=r.unzip=r.zip=r.zipWith=r.of=r.copy=r.modifyAt=r.updateAt=r.insertAt=r.sort=r.groupBy=r.group=r.reverse=r.concat=r.concatW=r.unappend=r.unprepend=r.range=r.replicate=r.makeBy=r.fromArray=r.fromReadonlyNonEmptyArray=r.rotate=r.union=r.sortBy=r.uniq=r.unsafeUpdateAt=r.unsafeInsertAt=r.append=r.appendW=r.prepend=r.prependW=r.isOutOfBound=r.isNonEmpty=void 0,r.chain=r.intercalate=r.updateLast=r.modifyLast=r.updateHead=r.modifyHead=r.matchRight=r.matchLeft=r.concatAll=r.max=r.min=r.init=r.last=r.tail=r.head=r.apS=r.bind=r.let=r.bindTo=r.Do=r.Comonad=r.Alt=r.TraversableWithIndex=r.Traversable=r.FoldableWithIndex=r.Foldable=r.Monad=r.chainFirst=r.Chain=r.Applicative=r.apSecond=r.apFirst=r.Apply=r.FunctorWithIndex=r.Pointed=r.flap=r.Functor=r.getUnionSemigroup=r.getEq=r.getSemigroup=r.getShow=r.URI=r.extract=r.traverseWithIndex=r.sequence=r.traverse=r.reduceRightWithIndex=r.reduceRight=r.reduceWithIndex=r.reduce=void 0,r.nonEmptyArray=r.fold=r.prependToAll=r.snoc=r.cons=r.unsnoc=r.uncons=r.filterWithIndex=r.filter=r.groupSort=void 0;var p=v(o),m=v(s);function h(n){return function(r){return r.concat(n)}}function I(n,r){return r?n.concat(r):function(r){return r.concat(n)}}function b(n){return function(r){var t=r.length;if(0===t)return[];for(var u=[],e=r[0],o=[e],i=1;i<t;i++){var c=r[i];n.equals(c,e)?o.push(c):(u.push(o),o=[e=c])}return u.push(o),u}}r.isNonEmpty=function(n){return n.length>0},r.isOutOfBound=function(n,r){return n<0||n>=r.length},r.prependW=function(n){return function(r){return l([n],r,!0)}},r.prepend=r.prependW,r.appendW=function(n){return function(r){return l(l([],r,!0),[n],!1)}},r.append=r.appendW,r.unsafeInsertAt=function(n,t,u){if((0,r.isNonEmpty)(u)){var e=(0,r.fromReadonlyNonEmptyArray)(u);return e.splice(n,0,t),e}return[t]},r.unsafeUpdateAt=function(n,t,u){var e=(0,r.fromReadonlyNonEmptyArray)(u);return e[n]=t,e},r.uniq=function(n){return function(t){if(1===t.length)return(0,r.copy)(t);for(var u=[(0,r.head)(t)],e=function(r){u.every((function(t){return!n.equals(t,r)}))&&u.push(r)},o=0,i=(0,r.tail)(t);o<i.length;o++)e(i[o]);return u}},r.sortBy=function(n){if((0,r.isNonEmpty)(n)){var t=(0,d.getMonoid)();return(0,r.sort)(n.reduce(t.concat,t.empty))}return r.copy},r.union=function(n){var t=(0,r.uniq)(n);return function(n){return function(r){return t((0,e.pipe)(r,I(n)))}}},r.rotate=function(n){return function(t){var u=t.length,o=Math.round(n)%u;if((0,r.isOutOfBound)(Math.abs(o),t)||0===o)return(0,r.copy)(t);if(o<0){var i=(0,r.splitAt)(-o)(t);return(0,e.pipe)(i[1],I(i[0]))}return(0,r.rotate)(o-u)(t)}},r.fromReadonlyNonEmptyArray=p.fromReadonlyNonEmptyArray,r.fromArray=function(n){return(0,r.isNonEmpty)(n)?p.some(n):p.none},r.makeBy=function(n){return function(r){for(var t=Math.max(0,Math.floor(r)),u=[n(0)],e=1;e<t;e++)u.push(n(e));return u}},r.replicate=function(n){return(0,r.makeBy)((function(){return n}))},r.range=function(n,t){return n<=t?(0,r.makeBy)((function(r){return n+r}))(t-n+1):[n]},r.unprepend=function(n){return[(0,r.head)(n),(0,r.tail)(n)]},r.unappend=function(n){return[(0,r.init)(n),(0,r.last)(n)]},r.concatW=h,r.concat=I,r.reverse=function(n){return l([(0,r.last)(n)],n.slice(0,-1).reverse(),!0)},r.group=b,r.groupBy=function(n){return function(r){for(var t={},u=0,e=r;u<e.length;u++){var o=e[u],i=n(o);p.has.call(t,i)?t[i].push(o):t[i]=[o]}return t}},r.sort=function(n){return function(r){return r.slice().sort(n.compare)}},r.insertAt=function(n,t){return function(u){return n<0||n>u.length?p.none:p.some((0,r.unsafeInsertAt)(n,t,u))}},r.updateAt=function(n,t){return(0,r.modifyAt)(n,(function(){return t}))},r.modifyAt=function(n,t){return function(u){return(0,r.isOutOfBound)(n,u)?p.none:p.some((0,r.unsafeUpdateAt)(n,t(u[n]),u))}},r.copy=r.fromReadonlyNonEmptyArray,r.of=function(n){return[n]},r.zipWith=function(n,r,t){for(var u=[t(n[0],r[0])],e=Math.min(n.length,r.length),o=1;o<e;o++)u[o]=t(n[o],r[o]);return u},r.zip=function n(t,u){return void 0===u?function(r){return n(r,t)}:(0,r.zipWith)(t,u,(function(n,r){return[n,r]}))},r.unzip=function(n){for(var r=[n[0][0]],t=[n[0][1]],u=1;u<n.length;u++)r[u]=n[u][0],t[u]=n[u][1];return[r,t]},r.prependAll=function(n){return function(r){for(var t=[n,r[0]],u=1;u<r.length;u++)t.push(n,r[u]);return t}},r.intersperse=function(n){return function(t){var u=(0,r.tail)(t);return(0,r.isNonEmpty)(u)?(0,e.pipe)(u,(0,r.prependAll)(n),(0,r.prepend)((0,r.head)(t))):(0,r.copy)(t)}},r.foldMapWithIndex=m.foldMapWithIndex,r.foldMap=m.foldMap,r.chainWithIndex=function(n){return function(t){for(var u=(0,r.fromReadonlyNonEmptyArray)(n(0,(0,r.head)(t))),e=1;e<t.length;e++)u.push.apply(u,n(e,t[e]));return u}},r.chop=function(n){return function(t){for(var u=n(t),e=[u[0]],o=u[1];(0,r.isNonEmpty)(o);){var i=n(o),c=i[1];e.push(i[0]),o=c}return e}},r.splitAt=function(n){return function(t){var u=Math.max(1,n);return u>=t.length?[(0,r.copy)(t),[]]:[(0,e.pipe)(t.slice(1,u),(0,r.prepend)((0,r.head)(t))),t.slice(u)]}},r.chunksOf=function(n){return(0,r.chop)((0,r.splitAt)(n))};var R=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},U=function(n,t){return(0,e.pipe)(n,(0,r.mapWithIndex)(t))},O=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},g=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},j=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},M=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},y=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},w=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},x=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},_=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceWithIndex)(t,u))},W=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},E=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRightWithIndex)(t,u))},q=function(n){var t=(0,r.traverseWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}};r.altW=function(n){return function(r){return(0,e.pipe)(r,h(n()))}},r.alt=r.altW,r.ap=function(n){return(0,r.flatMap)((function(t){return(0,e.pipe)(n,(0,r.map)(t))}))},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,e.pipe)(n,(0,r.chainWithIndex)((function(n,r){return t(r,n)})))})),r.extend=function(n){return function(t){for(var u=(0,r.tail)(t),e=[n(t)];(0,r.isNonEmpty)(u);)e.push(n(u)),u=(0,r.tail)(u);return e}},r.duplicate=(0,r.extend)(e.identity),r.flatten=(0,r.flatMap)(e.identity),r.map=function(n){return(0,r.mapWithIndex)((function(r,t){return n(t)}))},r.mapWithIndex=function(n){return function(t){for(var u=[n(0,(0,r.head)(t))],e=1;e<t.length;e++)u.push(n(e,t[e]));return u}},r.reduce=m.reduce,r.reduceWithIndex=m.reduceWithIndex,r.reduceRight=m.reduceRight,r.reduceRightWithIndex=m.reduceRightWithIndex,r.traverse=function(n){var t=(0,r.traverseWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.sequence=function(n){return(0,r.traverseWithIndex)(n)((function(n,r){return r}))},r.traverseWithIndex=function(n){return function(t){return function(u){for(var o=n.map(t(0,(0,r.head)(u)),r.of),i=1;i<u.length;i++)o=n.ap(n.map(o,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),t(i,u[i]));return o}}},r.extract=m.head,r.URI="NonEmptyArray",r.getShow=m.getShow,r.getSemigroup=function(){return{concat:I}},r.getEq=m.getEq,r.getUnionSemigroup=function(n){var t=(0,r.union)(n);return{concat:function(n,r){return t(r)(n)}}},r.Functor={URI:r.URI,map:R},r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.FunctorWithIndex={URI:r.URI,map:R,mapWithIndex:U},r.Apply={URI:r.URI,map:R,ap:O},r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.Applicative={URI:r.URI,map:R,ap:O,of:r.of},r.Chain={URI:r.URI,map:R,ap:O,chain:r.flatMap},r.chainFirst=(0,c.chainFirst)(r.Chain),r.Monad={URI:r.URI,map:R,ap:O,of:r.of,chain:r.flatMap},r.Foldable={URI:r.URI,reduce:j,foldMap:M,reduceRight:y},r.FoldableWithIndex={URI:r.URI,reduce:j,foldMap:M,reduceRight:y,reduceWithIndex:_,foldMapWithIndex:W,reduceRightWithIndex:E},r.Traversable={URI:r.URI,map:R,reduce:j,foldMap:M,reduceRight:y,traverse:w,sequence:r.sequence},r.TraversableWithIndex={URI:r.URI,map:R,mapWithIndex:U,reduce:j,foldMap:M,reduceRight:y,traverse:w,sequence:r.sequence,reduceWithIndex:_,foldMapWithIndex:W,reduceRightWithIndex:E,traverseWithIndex:q},r.Alt={URI:r.URI,map:R,alt:x},r.Comonad={URI:r.URI,map:R,extend:g,extract:r.extract},r.Do=(0,r.of)(p.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=(0,c.bind)(r.Chain),r.apS=(0,i.apS)(r.Apply),r.head=m.head,r.tail=function(n){return n.slice(1)},r.last=m.last,r.init=function(n){return n.slice(0,-1)},r.min=m.min,r.max=m.max,r.concatAll=function(n){return function(r){return r.reduce(n.concat)}},r.matchLeft=function(n){return function(t){return n((0,r.head)(t),(0,r.tail)(t))}},r.matchRight=function(n){return function(t){return n((0,r.init)(t),(0,r.last)(t))}},r.modifyHead=function(n){return function(t){return l([n((0,r.head)(t))],(0,r.tail)(t),!0)}},r.updateHead=function(n){return(0,r.modifyHead)((function(){return n}))},r.modifyLast=function(n){return function(t){return(0,e.pipe)((0,r.init)(t),(0,r.append)(n((0,r.last)(t))))}},r.updateLast=function(n){return(0,r.modifyLast)((function(){return n}))},r.intercalate=m.intercalate,r.chain=r.flatMap,r.groupSort=function(n){var t=(0,r.sort)(n),u=b(n);return function(n){return(0,r.isNonEmpty)(n)?u(t(n)):[]}},r.filter=function(n){return(0,r.filterWithIndex)((function(r,t){return n(t)}))},r.filterWithIndex=function(n){return function(t){return(0,r.fromArray)(t.filter((function(r,t){return n(t,r)})))}},r.uncons=r.unprepend,r.unsnoc=r.unappend,r.cons=function(n,t){return void 0===t?(0,r.prepend)(n):(0,e.pipe)(t,(0,r.prepend)(n))},r.snoc=function(n,t){return(0,e.pipe)(n,(0,r.append)(t))},r.prependToAll=r.prependAll,r.fold=m.concatAll,r.nonEmptyArray={URI:r.URI,of:r.of,map:R,mapWithIndex:U,ap:O,chain:r.flatMap,extend:g,extract:r.extract,reduce:j,foldMap:M,reduceRight:y,traverse:w,sequence:r.sequence,reduceWithIndex:_,foldMapWithIndex:W,reduceRightWithIndex:E,traverseWithIndex:q,alt:x}})),h=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Field=r.MonoidProduct=r.MonoidSum=r.SemigroupProduct=r.SemigroupSum=r.MagmaSub=r.Show=r.Bounded=r.Ord=r.Eq=r.isNumber=void 0,r.isNumber=function(n){return"number"==typeof n},r.Eq={equals:function(n,r){return n===r}},r.Ord={equals:r.Eq.equals,compare:function(n,r){return n<r?-1:n>r?1:0}},r.Bounded={equals:r.Eq.equals,compare:r.Ord.compare,top:1/0,bottom:-1/0},r.Show={show:function(n){return JSON.stringify(n)}},r.MagmaSub={concat:function(n,r){return n-r}},r.SemigroupSum={concat:function(n,r){return n+r}},r.SemigroupProduct={concat:function(n,r){return n*r}},r.MonoidSum={concat:r.SemigroupSum.concat,empty:0},r.MonoidProduct={concat:r.SemigroupProduct.concat,empty:1},r.Field={add:r.SemigroupSum.concat,zero:0,mul:r.SemigroupProduct.concat,one:1,sub:r.MagmaSub.concat,degree:function(){return 1},div:function(n,r){return n/r},mod:function(n,r){return n%r}}})),I=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.right=r.left=r.flap=r.Functor=r.Bifunctor=r.URI=r.bimap=r.mapLeft=r.map=r.separated=void 0,r.separated=function(n,r){return{left:n,right:r}},r.map=function(n){return function(t){return(0,r.separated)((0,r.left)(t),n((0,r.right)(t)))}},r.mapLeft=function(n){return function(t){return(0,r.separated)(n((0,r.left)(t)),(0,r.right)(t))}},r.bimap=function(n,t){return function(u){return(0,r.separated)(n((0,r.left)(u)),t((0,r.right)(u)))}},r.URI="Separated",r.Bifunctor={URI:r.URI,mapLeft:function(n,t){return(0,e.pipe)(n,(0,r.mapLeft)(t))},bimap:function(n,t,u){return(0,e.pipe)(n,(0,r.bimap)(t,u))}},r.Functor={URI:r.URI,map:function(n,t){return(0,e.pipe)(n,(0,r.map)(t))}},r.flap=(0,a.flap)(r.Functor),r.left=function(n){return n.left},r.right=function(n){return n.right}})),b=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),e=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),i=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return e(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.filterE=r.witherDefault=r.wiltDefault=void 0;var c=i(o);r.wiltDefault=function(n,r){return function(t){var u=n.traverse(t);return function(n,e){return t.map(u(n,e),r.separate)}}},r.witherDefault=function(n,r){return function(t){var u=n.traverse(t);return function(n,e){return t.map(u(n,e),r.compact)}}},r.filterE=function(n){return function(r){var t=n.wither(r);return function(n){return function(u){return t(u,(function(t){return r.map(n(t),(function(n){return n?c.some(t):c.none}))}))}}}}})),R=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.guard=void 0,r.guard=function(n,r){return function(t){return t?r.of(void 0):n.zero()}}})),U=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),l=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),p=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return l(r,n),r},m=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};Object.defineProperty(r,"__esModule",{value:!0}),r.sort=r.lefts=r.rights=r.reverse=r.modifyAt=r.deleteAt=r.updateAt=r.insertAt=r.findLastIndex=r.findLastMap=r.findLast=r.findFirstMap=r.findFirst=r.findIndex=r.dropLeftWhile=r.dropRight=r.dropLeft=r.spanLeft=r.takeLeftWhile=r.takeRight=r.takeLeft=r.init=r.tail=r.last=r.head=r.lookup=r.isOutOfBound=r.size=r.scanRight=r.scanLeft=r.chainWithIndex=r.foldRight=r.matchRight=r.matchRightW=r.foldLeft=r.matchLeft=r.matchLeftW=r.match=r.matchW=r.fromEither=r.fromOption=r.fromPredicate=r.replicate=r.makeBy=r.appendW=r.append=r.prependW=r.prepend=r.isNonEmpty=r.isEmpty=void 0,r.sequence=r.traverse=r.reduceRightWithIndex=r.reduceRight=r.reduceWithIndex=r.foldMap=r.reduce=r.foldMapWithIndex=r.duplicate=r.extend=r.filterWithIndex=r.partitionMapWithIndex=r.partitionMap=r.partitionWithIndex=r.partition=r.compact=r.filterMap=r.filterMapWithIndex=r.filter=r.separate=r.mapWithIndex=r.map=r.flatten=r.flatMap=r.ap=r.alt=r.altW=r.zero=r.of=r._chainRecBreadthFirst=r._chainRecDepthFirst=r.difference=r.intersection=r.union=r.concat=r.concatW=r.comprehension=r.fromOptionK=r.chunksOf=r.splitAt=r.chop=r.sortBy=r.uniq=r.elem=r.rotate=r.intersperse=r.prependAll=r.unzip=r.zip=r.zipWith=void 0,r.toArray=r.unsafeDeleteAt=r.unsafeUpdateAt=r.unsafeInsertAt=r.fromEitherK=r.FromEither=r.filterE=r.Witherable=r.ChainRecBreadthFirst=r.chainRecBreadthFirst=r.ChainRecDepthFirst=r.chainRecDepthFirst=r.TraversableWithIndex=r.Traversable=r.FoldableWithIndex=r.Foldable=r.FilterableWithIndex=r.Filterable=r.Compactable=r.Extend=r.Alternative=r.guard=r.Zero=r.Alt=r.Unfoldable=r.chainFirst=r.Monad=r.Chain=r.Applicative=r.apSecond=r.apFirst=r.Apply=r.FunctorWithIndex=r.Pointed=r.flap=r.Functor=r.getDifferenceMagma=r.getIntersectionSemigroup=r.getUnionMonoid=r.getUnionSemigroup=r.getOrd=r.getEq=r.getMonoid=r.getSemigroup=r.getShow=r.URI=r.unfold=r.wilt=r.wither=r.traverseWithIndex=void 0,r.readonlyArray=r.prependToAll=r.snoc=r.cons=r.range=r.chain=r.apS=r.bind=r.let=r.bindTo=r.Do=r.intercalate=r.exists=r.some=r.every=r.empty=r.fromArray=void 0;var U=p(o),O=p(h),g=p(s);r.isEmpty=function(n){return 0===n.length},r.isNonEmpty=g.isNonEmpty,r.prepend=g.prepend,r.prependW=g.prependW,r.append=g.append,r.appendW=g.appendW,r.makeBy=function(n,t){return n<=0?r.empty:g.makeBy(t)(n)},r.replicate=function(n,t){return(0,r.makeBy)(n,(function(){return t}))},r.fromPredicate=function(n){return function(t){return n(t)?[t]:r.empty}},r.fromOption=function(n){return U.isNone(n)?r.empty:[n.value]},r.fromEither=function(n){return U.isLeft(n)?r.empty:[n.right]},r.matchW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(u):n()}},r.match=r.matchW,r.matchLeftW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(g.head(u),g.tail(u)):n()}},r.matchLeft=r.matchLeftW,r.foldLeft=r.matchLeft,r.matchRightW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(g.init(u),g.last(u)):n()}},r.matchRight=r.matchRightW,r.foldRight=r.matchRight,r.chainWithIndex=function(n){return function(t){if((0,r.isEmpty)(t))return r.empty;for(var u=[],e=0;e<t.length;e++)u.push.apply(u,n(e,t[e]));return u}},r.scanLeft=function(n,r){return function(t){var u=t.length,e=new Array(u+1);e[0]=n;for(var o=0;o<u;o++)e[o+1]=r(e[o],t[o]);return e}},r.scanRight=function(n,r){return function(t){var u=t.length,e=new Array(u+1);e[u]=n;for(var o=u-1;o>=0;o--)e[o]=r(t[o],e[o+1]);return e}},r.size=function(n){return n.length},r.isOutOfBound=g.isOutOfBound,r.lookup=function n(t,u){return void 0===u?function(r){return n(t,r)}:(0,r.isOutOfBound)(t,u)?U.none:U.some(u[t])},r.head=function(n){return(0,r.isNonEmpty)(n)?U.some(g.head(n)):U.none},r.last=function(n){return(0,r.isNonEmpty)(n)?U.some(g.last(n)):U.none},r.tail=function(n){return(0,r.isNonEmpty)(n)?U.some(g.tail(n)):U.none},r.init=function(n){return(0,r.isNonEmpty)(n)?U.some(g.init(n)):U.none},r.takeLeft=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?t:0===n?r.empty:t.slice(0,n)}},r.takeRight=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?t:0===n?r.empty:t.slice(-n)}},r.takeLeftWhile=function(n){return function(t){for(var u=[],e=0,o=t;e<o.length;e++){var i=o[e];if(!n(i))break;u.push(i)}var c=u.length;return c===t.length?t:0===c?r.empty:u}};var j=function(n,r){for(var t=n.length,u=0;u<t&&r(n[u]);u++);return u};function M(n){return function(r,t){if(void 0===t){var u=M(n);return function(n){return u(r,n)}}for(var e=0;e<t.length;e++)if(n.equals(t[e],r))return!0;return!1}}function y(n){var t=g.union(n);return function(u,e){if(void 0===e){var o=y(n);return function(n){return o(n,u)}}return(0,r.isNonEmpty)(u)&&(0,r.isNonEmpty)(e)?t(e)(u):(0,r.isNonEmpty)(u)?u:e}}function w(n){var r=M(n);return function(t,u){if(void 0===u){var e=w(n);return function(n){return e(n,t)}}return t.filter((function(n){return r(n,u)}))}}function x(n){var r=M(n);return function(t,u){if(void 0===u){var e=x(n);return function(n){return e(n,t)}}return t.filter((function(n){return!r(n,u)}))}}r.spanLeft=function(n){return function(t){var u=(0,r.splitAt)(j(t,n))(t);return{init:u[0],rest:u[1]}}},r.dropLeft=function(n){return function(t){return n<=0||(0,r.isEmpty)(t)?t:n>=t.length?r.empty:t.slice(n,t.length)}},r.dropRight=function(n){return function(t){return n<=0||(0,r.isEmpty)(t)?t:n>=t.length?r.empty:t.slice(0,t.length-n)}},r.dropLeftWhile=function(n){return function(t){var u=j(t,n);return 0===u?t:u===t.length?r.empty:t.slice(u)}},r.findIndex=function(n){return function(r){for(var t=0;t<r.length;t++)if(n(r[t]))return U.some(t);return U.none}},r.findFirst=function(n){return function(r){for(var t=0;t<r.length;t++)if(n(r[t]))return U.some(r[t]);return U.none}},r.findFirstMap=function(n){return function(r){for(var t=0;t<r.length;t++){var u=n(r[t]);if(U.isSome(u))return u}return U.none}},r.findLast=function(n){return function(r){for(var t=r.length-1;t>=0;t--)if(n(r[t]))return U.some(r[t]);return U.none}},r.findLastMap=function(n){return function(r){for(var t=r.length-1;t>=0;t--){var u=n(r[t]);if(U.isSome(u))return u}return U.none}},r.findLastIndex=function(n){return function(r){for(var t=r.length-1;t>=0;t--)if(n(r[t]))return U.some(t);return U.none}},r.insertAt=function(n,r){return function(t){return n<0||n>t.length?U.none:U.some(g.unsafeInsertAt(n,r,t))}},r.updateAt=function(n,t){return(0,r.modifyAt)(n,(function(){return t}))},r.deleteAt=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?U.none:U.some((0,r.unsafeDeleteAt)(n,t))}},r.modifyAt=function(n,t){return function(u){return(0,r.isOutOfBound)(n,u)?U.none:U.some((0,r.unsafeUpdateAt)(n,t(u[n]),u))}},r.reverse=function(n){return n.length<=1?n:n.slice().reverse()},r.rights=function(n){for(var r=[],t=0;t<n.length;t++){var u=n[t];"Right"===u._tag&&r.push(u.right)}return r},r.lefts=function(n){for(var r=[],t=0;t<n.length;t++){var u=n[t];"Left"===u._tag&&r.push(u.left)}return r},r.sort=function(n){return function(r){return r.length<=1?r:r.slice().sort(n.compare)}},r.zipWith=function(n,r,t){for(var u=[],e=Math.min(n.length,r.length),o=0;o<e;o++)u[o]=t(n[o],r[o]);return u},r.zip=function n(t,u){return void 0===u?function(r){return n(r,t)}:(0,r.zipWith)(t,u,(function(n,r){return[n,r]}))},r.unzip=function(n){for(var r=[],t=[],u=0;u<n.length;u++)r[u]=n[u][0],t[u]=n[u][1];return[r,t]},r.prependAll=function(n){var t=g.prependAll(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.intersperse=function(n){var t=g.intersperse(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.rotate=function(n){var t=g.rotate(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.elem=M,r.uniq=function(n){var t=g.uniq(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.sortBy=function(n){var t=g.sortBy(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.chop=function(n){var t=g.chop(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):r.empty}},r.splitAt=function(n){return function(t){return n>=1&&(0,r.isNonEmpty)(t)?g.splitAt(n)(t):(0,r.isEmpty)(t)?[t,r.empty]:[r.empty,t]}},r.chunksOf=function(n){var t=g.chunksOf(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):r.empty}},r.fromOptionK=function(n){return function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];return(0,r.fromOption)(n.apply(void 0,t))}},r.comprehension=function(n,t,u){void 0===u&&(u=function(){return!0});var o=function(n,i){return(0,r.isNonEmpty)(i)?(0,r.flatMap)(g.head(i),(function(t){return o((0,e.pipe)(n,(0,r.append)(t)),g.tail(i))})):u.apply(void 0,n)?[t.apply(void 0,n)]:r.empty};return o(r.empty,n)},r.concatW=function(n){return function(t){return(0,r.isEmpty)(t)?n:(0,r.isEmpty)(n)?t:t.concat(n)}},r.concat=r.concatW,r.union=y,r.intersection=w,r.difference=x;var _=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},W=function(n,t){return(0,e.pipe)(n,(0,r.mapWithIndex)(t))},E=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},q=function(n,t){return(0,e.pipe)(n,(0,r.filter)(t))},k=function(n,t){return(0,e.pipe)(n,(0,r.filterMap)(t))},A=function(n,t){return(0,e.pipe)(n,(0,r.partition)(t))},P=function(n,t){return(0,e.pipe)(n,(0,r.partitionMap)(t))},T=function(n,t){return(0,e.pipe)(n,(0,r.partitionWithIndex)(t))},L=function(n,t){return(0,e.pipe)(n,(0,r.partitionMapWithIndex)(t))},z=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},N=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},S=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},C=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},F=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceWithIndex)(t,u))},$=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},D=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRightWithIndex)(t,u))},H=function(n,t){return(0,e.pipe)(n,(0,r.filterMapWithIndex)(t))},J=function(n,t){return(0,e.pipe)(n,(0,r.filterWithIndex)(t))},G=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},B=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},K=function(n){var t=(0,r.traverseWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}};r._chainRecDepthFirst=function(n,t){return(0,e.pipe)(n,(0,r.chainRecDepthFirst)(t))},r._chainRecBreadthFirst=function(n,t){return(0,e.pipe)(n,(0,r.chainRecBreadthFirst)(t))},r.of=g.of,r.zero=function(){return r.empty},r.altW=function(n){return function(r){return r.concat(n())}},r.alt=r.altW,r.ap=function(n){return(0,r.flatMap)((function(t){return(0,e.pipe)(n,(0,r.map)(t))}))},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,e.pipe)(n,(0,r.chainWithIndex)((function(n,r){return t(r,n)})))})),r.flatten=(0,r.flatMap)(e.identity),r.map=function(n){return function(r){return r.map((function(r){return n(r)}))}},r.mapWithIndex=function(n){return function(r){return r.map((function(r,t){return n(t,r)}))}},r.separate=function(n){for(var r=[],t=[],u=0,e=n;u<e.length;u++){var o=e[u];"Left"===o._tag?r.push(o.left):t.push(o.right)}return(0,I.separated)(r,t)},r.filter=function(n){return function(r){return r.filter(n)}},r.filterMapWithIndex=function(n){return function(r){for(var t=[],u=0;u<r.length;u++){var e=n(u,r[u]);U.isSome(e)&&t.push(e.value)}return t}},r.filterMap=function(n){return(0,r.filterMapWithIndex)((function(r,t){return n(t)}))},r.compact=(0,r.filterMap)(e.identity),r.partition=function(n){return(0,r.partitionWithIndex)((function(r,t){return n(t)}))},r.partitionWithIndex=function(n){return function(r){for(var t=[],u=[],e=0;e<r.length;e++){var o=r[e];n(e,o)?u.push(o):t.push(o)}return(0,I.separated)(t,u)}},r.partitionMap=function(n){return(0,r.partitionMapWithIndex)((function(r,t){return n(t)}))},r.partitionMapWithIndex=function(n){return function(r){for(var t=[],u=[],e=0;e<r.length;e++){var o=n(e,r[e]);"Left"===o._tag?t.push(o.left):u.push(o.right)}return(0,I.separated)(t,u)}},r.filterWithIndex=function(n){return function(r){return r.filter((function(r,t){return n(t,r)}))}},r.extend=function(n){return function(r){return r.map((function(t,u){return n(r.slice(u))}))}},r.duplicate=(0,r.extend)(e.identity),r.foldMapWithIndex=function(n){return function(r){return function(t){return t.reduce((function(t,u,e){return n.concat(t,r(e,u))}),n.empty)}}},r.reduce=function(n,t){return(0,r.reduceWithIndex)(n,(function(n,r,u){return t(r,u)}))},r.foldMap=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.reduceWithIndex=function(n,r){return function(t){for(var u=t.length,e=n,o=0;o<u;o++)e=r(o,e,t[o]);return e}},r.reduceRight=function(n,t){return(0,r.reduceRightWithIndex)(n,(function(n,r,u){return t(r,u)}))},r.reduceRightWithIndex=function(n,r){return function(t){return t.reduceRight((function(n,t,u){return r(u,t,n)}),n)}},r.traverse=function(n){var t=(0,r.traverseWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.sequence=function(n){return function(t){return N(t,n.of((0,r.zero)()),(function(t,u){return n.ap(n.map(t,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),u)}))}},r.traverseWithIndex=function(n){return function(t){return(0,r.reduceWithIndex)(n.of((0,r.zero)()),(function(u,o,i){return n.ap(n.map(o,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),t(u,i))}))}},r.wither=function(n){var r=V(n);return function(n){return function(t){return r(t,n)}}},r.wilt=function(n){var r=Q(n);return function(n){return function(t){return r(t,n)}}},r.unfold=function(n,r){for(var t=[],u=n;;){var e=r(u);if(!U.isSome(e))break;var o=e.value,i=o[1];t.push(o[0]),u=i}return t},r.URI="ReadonlyArray",r.getShow=function(n){return{show:function(r){return"[".concat(r.map(n.show).join(", "),"]")}}},r.getSemigroup=function(){return{concat:function(n,t){return(0,r.isEmpty)(n)?t:(0,r.isEmpty)(t)?n:n.concat(t)}}},r.getMonoid=function(){return{concat:(0,r.getSemigroup)().concat,empty:r.empty}},r.getEq=function(n){return(0,v.fromEquals)((function(r,t){return r.length===t.length&&r.every((function(r,u){return n.equals(r,t[u])}))}))},r.getOrd=function(n){return(0,d.fromCompare)((function(r,t){for(var u=r.length,e=t.length,o=Math.min(u,e),i=0;i<o;i++){var c=n.compare(r[i],t[i]);if(0!==c)return c}return O.Ord.compare(u,e)}))},r.getUnionSemigroup=function(n){var r=y(n);return{concat:function(n,t){return r(t)(n)}}},r.getUnionMonoid=function(n){return{concat:(0,r.getUnionSemigroup)(n).concat,empty:r.empty}},r.getIntersectionSemigroup=function(n){var r=w(n);return{concat:function(n,t){return r(t)(n)}}},r.getDifferenceMagma=function(n){var r=x(n);return{concat:function(n,t){return r(t)(n)}}},r.Functor={URI:r.URI,map:_},r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.FunctorWithIndex={URI:r.URI,map:_,mapWithIndex:W},r.Apply={URI:r.URI,map:_,ap:E},r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.Applicative={URI:r.URI,map:_,ap:E,of:r.of},r.Chain={URI:r.URI,map:_,ap:E,chain:r.flatMap},r.Monad={URI:r.URI,map:_,ap:E,of:r.of,chain:r.flatMap},r.chainFirst=(0,c.chainFirst)(r.Chain),r.Unfoldable={URI:r.URI,unfold:r.unfold},r.Alt={URI:r.URI,map:_,alt:z},r.Zero={URI:r.URI,zero:r.zero},r.guard=(0,R.guard)(r.Zero,r.Pointed),r.Alternative={URI:r.URI,map:_,ap:E,of:r.of,alt:z,zero:r.zero},r.Extend={URI:r.URI,map:_,extend:G},r.Compactable={URI:r.URI,compact:r.compact,separate:r.separate},r.Filterable={URI:r.URI,map:_,compact:r.compact,separate:r.separate,filter:q,filterMap:k,partition:A,partitionMap:P},r.FilterableWithIndex={URI:r.URI,map:_,mapWithIndex:W,compact:r.compact,separate:r.separate,filter:q,filterMap:k,partition:A,partitionMap:P,partitionMapWithIndex:L,partitionWithIndex:T,filterMapWithIndex:H,filterWithIndex:J},r.Foldable={URI:r.URI,reduce:N,foldMap:S,reduceRight:C},r.FoldableWithIndex={URI:r.URI,reduce:N,foldMap:S,reduceRight:C,reduceWithIndex:F,foldMapWithIndex:$,reduceRightWithIndex:D},r.Traversable={URI:r.URI,map:_,reduce:N,foldMap:S,reduceRight:C,traverse:B,sequence:r.sequence},r.TraversableWithIndex={URI:r.URI,map:_,mapWithIndex:W,reduce:N,foldMap:S,reduceRight:C,reduceWithIndex:F,foldMapWithIndex:$,reduceRightWithIndex:D,traverse:B,sequence:r.sequence,traverseWithIndex:K},r.chainRecDepthFirst=function(n){return function(r){for(var t=m([],n(r),!0),u=[];t.length>0;){var e=t.shift();U.isLeft(e)?t.unshift.apply(t,n(e.left)):u.push(e.right)}return u}},r.ChainRecDepthFirst={URI:r.URI,map:_,ap:E,chain:r.flatMap,chainRec:r._chainRecDepthFirst},r.chainRecBreadthFirst=function(n){return function(r){var t=n(r),u=[],e=[];function o(r){U.isLeft(r)?n(r.left).forEach((function(n){return u.push(n)})):e.push(r.right)}for(var i=0,c=t;i<c.length;i++)o(c[i]);for(;u.length>0;)o(u.shift());return e}},r.ChainRecBreadthFirst={URI:r.URI,map:_,ap:E,chain:r.flatMap,chainRec:r._chainRecBreadthFirst};var V=(0,b.witherDefault)(r.Traversable,r.Compactable),Q=(0,b.wiltDefault)(r.Traversable,r.Compactable);r.Witherable={URI:r.URI,map:_,compact:r.compact,separate:r.separate,filter:q,filterMap:k,partition:A,partitionMap:P,reduce:N,foldMap:S,reduceRight:C,traverse:B,sequence:r.sequence,wither:V,wilt:Q},r.filterE=(0,b.filterE)(r.Witherable),r.FromEither={URI:r.URI,fromEither:r.fromEither},r.fromEitherK=(0,f.fromEitherK)(r.FromEither),r.unsafeInsertAt=g.unsafeInsertAt,r.unsafeUpdateAt=function(n,t,u){return(0,r.isNonEmpty)(u)?g.unsafeUpdateAt(n,t,u):u},r.unsafeDeleteAt=function(n,r){var t=r.slice();return t.splice(n,1),t},r.toArray=function(n){return n.slice()},r.fromArray=function(n){return(0,r.isEmpty)(n)?r.empty:n.slice()},r.empty=g.empty,r.every=function(n){return function(r){return r.every(n)}},r.some=function(n){return function(r){return r.some(n)}},r.exists=r.some,r.intercalate=function(n){var t=g.intercalate(n);return function(u){return(0,r.match)((function(){return n.empty}),t(u))}},r.Do=(0,r.of)(U.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=(0,c.bind)(r.Chain),r.apS=(0,i.apS)(r.Apply),r.chain=r.flatMap,r.range=g.range,r.cons=g.cons,r.snoc=g.snoc,r.prependToAll=r.prependAll,r.readonlyArray={URI:r.URI,compact:r.compact,separate:r.separate,map:_,ap:E,of:r.of,chain:r.flatMap,filter:q,filterMap:k,partition:A,partitionMap:P,mapWithIndex:W,partitionMapWithIndex:L,partitionWithIndex:T,filterMapWithIndex:H,filterWithIndex:J,alt:z,zero:r.zero,unfold:r.unfold,reduce:N,foldMap:S,reduceRight:C,traverse:B,sequence:r.sequence,reduceWithIndex:F,foldMapWithIndex:$,reduceRightWithIndex:D,traverseWithIndex:K,extend:G,wither:V,wilt:Q}})),O=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),v=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),d=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return v(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.lefts=r.rights=r.reverse=r.modifyAt=r.deleteAt=r.updateAt=r.insertAt=r.copy=r.findLastIndex=r.findLastMap=r.findLast=r.findFirstMap=r.findFirst=r.findIndex=r.dropLeftWhile=r.dropRight=r.dropLeft=r.spanLeft=r.takeLeftWhile=r.takeRight=r.takeLeft=r.init=r.tail=r.last=r.head=r.lookup=r.isOutOfBound=r.size=r.scanRight=r.scanLeft=r.chainWithIndex=r.foldRight=r.matchRight=r.matchRightW=r.foldLeft=r.matchLeft=r.matchLeftW=r.match=r.matchW=r.fromEither=r.fromOption=r.fromPredicate=r.replicate=r.makeBy=r.appendW=r.append=r.prependW=r.prepend=r.isNonEmpty=r.isEmpty=void 0,r.traverseWithIndex=r.sequence=r.traverse=r.reduceRightWithIndex=r.reduceRight=r.reduceWithIndex=r.reduce=r.foldMapWithIndex=r.foldMap=r.duplicate=r.extend=r.filterWithIndex=r.alt=r.altW=r.partitionMapWithIndex=r.partitionMap=r.partitionWithIndex=r.partition=r.filter=r.separate=r.compact=r.filterMap=r.filterMapWithIndex=r.mapWithIndex=r.flatten=r.flatMap=r.ap=r.map=r.zero=r.of=r.difference=r.intersection=r.union=r.concat=r.concatW=r.comprehension=r.fromOptionK=r.chunksOf=r.splitAt=r.chop=r.sortBy=r.uniq=r.elem=r.rotate=r.intersperse=r.prependAll=r.unzip=r.zip=r.zipWith=r.sort=void 0,r.some=r.every=r.unsafeDeleteAt=r.unsafeUpdateAt=r.unsafeInsertAt=r.fromEitherK=r.FromEither=r.filterE=r.ChainRecBreadthFirst=r.chainRecBreadthFirst=r.ChainRecDepthFirst=r.chainRecDepthFirst=r.Witherable=r.TraversableWithIndex=r.Traversable=r.FoldableWithIndex=r.Foldable=r.FilterableWithIndex=r.Filterable=r.Compactable=r.Extend=r.Alternative=r.guard=r.Zero=r.Alt=r.Unfoldable=r.Monad=r.chainFirst=r.Chain=r.Applicative=r.apSecond=r.apFirst=r.Apply=r.FunctorWithIndex=r.Pointed=r.flap=r.Functor=r.getDifferenceMagma=r.getIntersectionSemigroup=r.getUnionMonoid=r.getUnionSemigroup=r.getOrd=r.getEq=r.getMonoid=r.getSemigroup=r.getShow=r.URI=r.unfold=r.wilt=r.wither=void 0,r.array=r.prependToAll=r.snoc=r.cons=r.empty=r.range=r.chain=r.apS=r.bind=r.let=r.bindTo=r.Do=r.intercalate=r.exists=void 0;var l=d(o),p=d(m),s=d(U);r.isEmpty=function(n){return 0===n.length},r.isNonEmpty=p.isNonEmpty,r.prepend=p.prepend,r.prependW=p.prependW,r.append=p.append,r.appendW=p.appendW,r.makeBy=function(n,r){return n<=0?[]:p.makeBy(r)(n)},r.replicate=function(n,t){return(0,r.makeBy)(n,(function(){return t}))},r.fromPredicate=function(n){return function(r){return n(r)?[r]:[]}},r.fromOption=function(n){return l.isNone(n)?[]:[n.value]},r.fromEither=function(n){return l.isLeft(n)?[]:[n.right]},r.matchW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(u):n()}},r.match=r.matchW,r.matchLeftW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(p.head(u),p.tail(u)):n()}},r.matchLeft=r.matchLeftW,r.foldLeft=r.matchLeft,r.matchRightW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(p.init(u),p.last(u)):n()}},r.matchRight=r.matchRightW,r.foldRight=r.matchRight,r.chainWithIndex=function(n){return function(r){for(var t=[],u=0;u<r.length;u++)t.push.apply(t,n(u,r[u]));return t}},r.scanLeft=function(n,r){return function(t){var u=t.length,e=new Array(u+1);e[0]=n;for(var o=0;o<u;o++)e[o+1]=r(e[o],t[o]);return e}},r.scanRight=function(n,r){return function(t){var u=t.length,e=new Array(u+1);e[u]=n;for(var o=u-1;o>=0;o--)e[o]=r(t[o],e[o+1]);return e}},r.size=function(n){return n.length},r.isOutOfBound=p.isOutOfBound,r.lookup=s.lookup,r.head=s.head,r.last=s.last,r.tail=function(n){return(0,r.isNonEmpty)(n)?l.some(p.tail(n)):l.none},r.init=function(n){return(0,r.isNonEmpty)(n)?l.some(p.init(n)):l.none},r.takeLeft=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?(0,r.copy)(t):t.slice(0,n)}},r.takeRight=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?(0,r.copy)(t):0===n?[]:t.slice(-n)}},r.takeLeftWhile=function(n){return function(r){for(var t=[],u=0,e=r;u<e.length;u++){var o=e[u];if(!n(o))break;t.push(o)}return t}};var h=function(n,r){for(var t=n.length,u=0;u<t&&r(n[u]);u++);return u};function O(n){var t=p.union(n);return function(u,e){if(void 0===e){var o=O(n);return function(n){return o(n,u)}}return(0,r.isNonEmpty)(u)&&(0,r.isNonEmpty)(e)?t(e)(u):(0,r.isNonEmpty)(u)?(0,r.copy)(u):(0,r.copy)(e)}}function g(n){var t=(0,r.elem)(n);return function(r,u){if(void 0===u){var e=g(n);return function(n){return e(n,r)}}return r.filter((function(n){return t(n,u)}))}}function j(n){var t=(0,r.elem)(n);return function(r,u){if(void 0===u){var e=j(n);return function(n){return e(n,r)}}return r.filter((function(n){return!t(n,u)}))}}r.spanLeft=function(n){return function(t){var u=(0,r.splitAt)(h(t,n))(t);return{init:u[0],rest:u[1]}}},r.dropLeft=function(n){return function(t){return n<=0||(0,r.isEmpty)(t)?(0,r.copy)(t):n>=t.length?[]:t.slice(n,t.length)}},r.dropRight=function(n){return function(t){return n<=0||(0,r.isEmpty)(t)?(0,r.copy)(t):n>=t.length?[]:t.slice(0,t.length-n)}},r.dropLeftWhile=function(n){return function(r){return r.slice(h(r,n))}},r.findIndex=s.findIndex,r.findFirst=function(n){return s.findFirst(n)},r.findFirstMap=s.findFirstMap,r.findLast=function(n){return s.findLast(n)},r.findLastMap=s.findLastMap,r.findLastIndex=s.findLastIndex,r.copy=function(n){return n.slice()},r.insertAt=function(n,t){return function(u){return n<0||n>u.length?l.none:l.some((0,r.unsafeInsertAt)(n,t,u))}},r.updateAt=function(n,t){return(0,r.modifyAt)(n,(function(){return t}))},r.deleteAt=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?l.none:l.some((0,r.unsafeDeleteAt)(n,t))}},r.modifyAt=function(n,t){return function(u){return(0,r.isOutOfBound)(n,u)?l.none:l.some((0,r.unsafeUpdateAt)(n,t(u[n]),u))}},r.reverse=function(n){return(0,r.isEmpty)(n)?[]:n.slice().reverse()},r.rights=function(n){for(var r=[],t=0;t<n.length;t++){var u=n[t];"Right"===u._tag&&r.push(u.right)}return r},r.lefts=function(n){for(var r=[],t=0;t<n.length;t++){var u=n[t];"Left"===u._tag&&r.push(u.left)}return r},r.sort=function(n){return function(t){return t.length<=1?(0,r.copy)(t):t.slice().sort(n.compare)}},r.zipWith=function(n,r,t){for(var u=[],e=Math.min(n.length,r.length),o=0;o<e;o++)u[o]=t(n[o],r[o]);return u},r.zip=function n(t,u){return void 0===u?function(r){return n(r,t)}:(0,r.zipWith)(t,u,(function(n,r){return[n,r]}))},r.unzip=function(n){for(var r=[],t=[],u=0;u<n.length;u++)r[u]=n[u][0],t[u]=n[u][1];return[r,t]},r.prependAll=function(n){var t=p.prependAll(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):[]}},r.intersperse=function(n){var t=p.intersperse(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):(0,r.copy)(n)}},r.rotate=function(n){var t=p.rotate(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):(0,r.copy)(n)}},r.elem=s.elem,r.uniq=function(n){var t=p.uniq(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):(0,r.copy)(n)}},r.sortBy=function(n){var t=p.sortBy(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):(0,r.copy)(n)}},r.chop=function(n){var t=p.chop(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):[]}},r.splitAt=function(n){return function(t){return n>=1&&(0,r.isNonEmpty)(t)?p.splitAt(n)(t):(0,r.isEmpty)(t)?[(0,r.copy)(t),[]]:[[],(0,r.copy)(t)]}},r.chunksOf=function(n){var t=p.chunksOf(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):[]}},r.fromOptionK=function(n){return function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];return(0,r.fromOption)(n.apply(void 0,t))}},r.comprehension=function(n,t,u){void 0===u&&(u=function(){return!0});var o=function(n,i){return(0,r.isNonEmpty)(i)?(0,r.flatMap)(p.head(i),(function(t){return o((0,e.pipe)(n,(0,r.append)(t)),p.tail(i))})):u.apply(void 0,n)?[t.apply(void 0,n)]:[]};return o([],n)},r.concatW=function(n){return function(t){return(0,r.isEmpty)(t)?(0,r.copy)(n):(0,r.isEmpty)(n)?(0,r.copy)(t):t.concat(n)}},r.concat=r.concatW,r.union=O,r.intersection=g,r.difference=j;var M=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},y=function(n,t){return(0,e.pipe)(n,(0,r.mapWithIndex)(t))},w=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},x=function(n,t){return(0,e.pipe)(n,(0,r.filter)(t))},_=function(n,t){return(0,e.pipe)(n,(0,r.filterMap)(t))},W=function(n,t){return(0,e.pipe)(n,(0,r.partition)(t))},E=function(n,t){return(0,e.pipe)(n,(0,r.partitionMap)(t))},q=function(n,t){return(0,e.pipe)(n,(0,r.partitionWithIndex)(t))},k=function(n,t){return(0,e.pipe)(n,(0,r.partitionMapWithIndex)(t))},A=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},P=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},T=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},L=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},z=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceWithIndex)(t,u))},N=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},S=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRightWithIndex)(t,u))},C=function(n,t){return(0,e.pipe)(n,(0,r.filterMapWithIndex)(t))},F=function(n,t){return(0,e.pipe)(n,(0,r.filterWithIndex)(t))},$=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},D=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},H=function(n){var t=(0,r.traverseWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},J=s._chainRecDepthFirst,G=s._chainRecBreadthFirst;r.of=p.of,r.zero=function(){return[]},r.map=function(n){return function(r){return r.map((function(r){return n(r)}))}},r.ap=function(n){return(0,r.flatMap)((function(t){return(0,e.pipe)(n,(0,r.map)(t))}))},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,e.pipe)(n,(0,r.chainWithIndex)((function(n,r){return t(r,n)})))})),r.flatten=(0,r.flatMap)(e.identity),r.mapWithIndex=function(n){return function(r){return r.map((function(r,t){return n(t,r)}))}},r.filterMapWithIndex=function(n){return function(r){for(var t=[],u=0;u<r.length;u++){var e=n(u,r[u]);l.isSome(e)&&t.push(e.value)}return t}},r.filterMap=function(n){return(0,r.filterMapWithIndex)((function(r,t){return n(t)}))},r.compact=(0,r.filterMap)(e.identity),r.separate=function(n){for(var r=[],t=[],u=0,e=n;u<e.length;u++){var o=e[u];"Left"===o._tag?r.push(o.left):t.push(o.right)}return(0,I.separated)(r,t)},r.filter=function(n){return function(r){return r.filter(n)}},r.partition=function(n){return(0,r.partitionWithIndex)((function(r,t){return n(t)}))},r.partitionWithIndex=function(n){return function(r){for(var t=[],u=[],e=0;e<r.length;e++){var o=r[e];n(e,o)?u.push(o):t.push(o)}return(0,I.separated)(t,u)}},r.partitionMap=function(n){return(0,r.partitionMapWithIndex)((function(r,t){return n(t)}))},r.partitionMapWithIndex=function(n){return function(r){for(var t=[],u=[],e=0;e<r.length;e++){var o=n(e,r[e]);"Left"===o._tag?t.push(o.left):u.push(o.right)}return(0,I.separated)(t,u)}},r.altW=function(n){return function(r){return r.concat(n())}},r.alt=r.altW,r.filterWithIndex=function(n){return function(r){return r.filter((function(r,t){return n(t,r)}))}},r.extend=function(n){return function(r){return r.map((function(t,u){return n(r.slice(u))}))}},r.duplicate=(0,r.extend)(e.identity),r.foldMap=s.foldMap,r.foldMapWithIndex=s.foldMapWithIndex,r.reduce=s.reduce,r.reduceWithIndex=s.reduceWithIndex,r.reduceRight=s.reduceRight,r.reduceRightWithIndex=s.reduceRightWithIndex,r.traverse=function(n){var t=(0,r.traverseWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.sequence=function(n){return function(t){return P(t,n.of((0,r.zero)()),(function(t,u){return n.ap(n.map(t,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),u)}))}},r.traverseWithIndex=function(n){return function(t){return(0,r.reduceWithIndex)(n.of((0,r.zero)()),(function(u,o,i){return n.ap(n.map(o,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),t(u,i))}))}},r.wither=function(n){var r=B(n);return function(n){return function(t){return r(t,n)}}},r.wilt=function(n){var r=K(n);return function(n){return function(t){return r(t,n)}}},r.unfold=function(n,r){for(var t=[],u=n;;){var e=r(u);if(!l.isSome(e))break;var o=e.value,i=o[1];t.push(o[0]),u=i}return t},r.URI="Array",r.getShow=s.getShow,r.getSemigroup=function(){return{concat:function(n,r){return n.concat(r)}}},r.getMonoid=function(){return{concat:(0,r.getSemigroup)().concat,empty:[]}},r.getEq=s.getEq,r.getOrd=s.getOrd,r.getUnionSemigroup=function(n){var r=O(n);return{concat:function(n,t){return r(t)(n)}}},r.getUnionMonoid=function(n){return{concat:(0,r.getUnionSemigroup)(n).concat,empty:[]}},r.getIntersectionSemigroup=function(n){var r=g(n);return{concat:function(n,t){return r(t)(n)}}},r.getDifferenceMagma=function(n){var r=j(n);return{concat:function(n,t){return r(t)(n)}}},r.Functor={URI:r.URI,map:M},r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.FunctorWithIndex={URI:r.URI,map:M,mapWithIndex:y},r.Apply={URI:r.URI,map:M,ap:w},r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.Applicative={URI:r.URI,map:M,ap:w,of:r.of},r.Chain={URI:r.URI,map:M,ap:w,chain:r.flatMap},r.chainFirst=(0,c.chainFirst)(r.Chain),r.Monad={URI:r.URI,map:M,ap:w,of:r.of,chain:r.flatMap},r.Unfoldable={URI:r.URI,unfold:r.unfold},r.Alt={URI:r.URI,map:M,alt:A},r.Zero={URI:r.URI,zero:r.zero},r.guard=(0,R.guard)(r.Zero,r.Pointed),r.Alternative={URI:r.URI,map:M,ap:w,of:r.of,alt:A,zero:r.zero},r.Extend={URI:r.URI,map:M,extend:$},r.Compactable={URI:r.URI,compact:r.compact,separate:r.separate},r.Filterable={URI:r.URI,map:M,compact:r.compact,separate:r.separate,filter:x,filterMap:_,partition:W,partitionMap:E},r.FilterableWithIndex={URI:r.URI,map:M,mapWithIndex:y,compact:r.compact,separate:r.separate,filter:x,filterMap:_,partition:W,partitionMap:E,partitionMapWithIndex:k,partitionWithIndex:q,filterMapWithIndex:C,filterWithIndex:F},r.Foldable={URI:r.URI,reduce:P,foldMap:T,reduceRight:L},r.FoldableWithIndex={URI:r.URI,reduce:P,foldMap:T,reduceRight:L,reduceWithIndex:z,foldMapWithIndex:N,reduceRightWithIndex:S},r.Traversable={URI:r.URI,map:M,reduce:P,foldMap:T,reduceRight:L,traverse:D,sequence:r.sequence},r.TraversableWithIndex={URI:r.URI,map:M,mapWithIndex:y,reduce:P,foldMap:T,reduceRight:L,reduceWithIndex:z,foldMapWithIndex:N,reduceRightWithIndex:S,traverse:D,sequence:r.sequence,traverseWithIndex:H};var B=(0,b.witherDefault)(r.Traversable,r.Compactable),K=(0,b.wiltDefault)(r.Traversable,r.Compactable);r.Witherable={URI:r.URI,map:M,compact:r.compact,separate:r.separate,filter:x,filterMap:_,partition:W,partitionMap:E,reduce:P,foldMap:T,reduceRight:L,traverse:D,sequence:r.sequence,wither:B,wilt:K},r.chainRecDepthFirst=s.chainRecDepthFirst,r.ChainRecDepthFirst={URI:r.URI,map:M,ap:w,chain:r.flatMap,chainRec:J},r.chainRecBreadthFirst=s.chainRecBreadthFirst,r.ChainRecBreadthFirst={URI:r.URI,map:M,ap:w,chain:r.flatMap,chainRec:G},r.filterE=(0,b.filterE)(r.Witherable),r.FromEither={URI:r.URI,fromEither:r.fromEither},r.fromEitherK=(0,f.fromEitherK)(r.FromEither),r.unsafeInsertAt=p.unsafeInsertAt,r.unsafeUpdateAt=function(n,t,u){return(0,r.isNonEmpty)(u)?p.unsafeUpdateAt(n,t,u):[]},r.unsafeDeleteAt=function(n,r){var t=r.slice();return t.splice(n,1),t},r.every=s.every,r.some=function(n){return function(r){return r.some(n)}},r.exists=r.some,r.intercalate=s.intercalate,r.Do=(0,r.of)(l.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=(0,c.bind)(r.Chain),r.apS=(0,i.apS)(r.Apply),r.chain=r.flatMap,r.range=p.range,r.empty=[],r.cons=p.cons,r.snoc=p.snoc,r.prependToAll=r.prependAll,r.array={URI:r.URI,compact:r.compact,separate:r.separate,map:M,ap:w,of:r.of,chain:r.flatMap,filter:x,filterMap:_,partition:W,partitionMap:E,mapWithIndex:y,partitionMapWithIndex:k,partitionWithIndex:q,filterMapWithIndex:C,filterWithIndex:F,alt:A,zero:r.zero,unfold:r.unfold,reduce:P,foldMap:T,reduceRight:L,traverse:D,sequence:r.sequence,reduceWithIndex:z,foldMapWithIndex:N,reduceRightWithIndex:S,traverseWithIndex:H,extend:$,wither:B,wilt:K}}));const g=n=>!("isConnected"in n)||n.isConnected,j=(()=>{let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout((()=>{n=0,(n=>{for(let r of n.keys())n.set(r,n.get(r).filter(g))})(...r)}),2e3)}})(),M=n=>"function"==typeof n?n():n,y=(t,u)=>{const e=((n,r=((n,r)=>n!==r))=>{const t=M(n);let u=new Map(Object.entries(null!=t?t:{}));const e={dispose:[],get:[],set:[],reset:[]},o=()=>{var r;u=new Map(Object.entries(null!==(r=M(n))&&void 0!==r?r:{})),e.reset.forEach((n=>n()))},i=n=>(e.get.forEach((r=>r(n))),u.get(n)),c=(n,t)=>{const o=u.get(n);r(t,o,n)&&(u.set(n,t),e.set.forEach((r=>r(n,t,o))))},f="undefined"==typeof Proxy?{}:new Proxy(t,{get:(n,r)=>i(r),ownKeys:()=>Array.from(u.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(n,r)=>u.has(r),set:(n,r,t)=>(c(r,t),!0)}),a=(n,r)=>(e[n].push(r),()=>{((n,r)=>{const t=n.indexOf(r);t>=0&&(n[t]=n[n.length-1],n.length--)})(e[n],r)});return{state:f,get:i,set:c,on:a,onChange:(r,t)=>{const u=a("set",((n,u)=>{n===r&&t(u)})),e=a("reset",(()=>t(M(n)[r])));return()=>{u(),e()}},use:(...n)=>{const r=n.reduce(((n,r)=>(r.set&&n.push(a("set",r.set)),r.get&&n.push(a("get",r.get)),r.reset&&n.push(a("reset",r.reset)),r.dispose&&n.push(a("dispose",r.dispose)),n)),[]);return()=>r.forEach((n=>n()))},dispose:()=>{e.dispose.forEach((n=>n())),o()},reset:o,forceUpdate:n=>{const r=u.get(n);e.set.forEach((t=>t(n,r,r)))}}})(t,u);return e.use((()=>{if("function"!=typeof n)return{};const t=new Map;return{dispose:()=>t.clear(),get:r=>{const u=n();u&&((n,r,t)=>{const u=n.get(r);u?u.includes(t)||u.push(t):n.set(r,[t])})(t,r,u)},set:n=>{const u=t.get(n);u&&t.set(n,u.filter(r)),j(t)},reset:()=>{t.forEach((n=>n.forEach(r))),j(t)}}})()),e};var w=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getApplicativeComposition=r.getApplicativeMonoid=void 0,r.getApplicativeMonoid=function(n){var r=(0,i.getApplySemigroup)(n);return function(t){return{concat:r(t).concat,empty:n.of(t.empty)}}},r.getApplicativeComposition=function(n,r){var t=(0,a.getFunctorComposition)(n,r).map,u=(0,i.ap)(n,r);return{map:t,of:function(t){return n.of(r.of(t))},ap:function(n,r){return(0,e.pipe)(n,u(r))}}}})),x=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.and=r.or=r.not=r.Contravariant=r.getMonoidAll=r.getSemigroupAll=r.getMonoidAny=r.getSemigroupAny=r.URI=r.contramap=void 0,r.contramap=function(n){return function(r){return(0,e.flow)(n,r)}},r.URI="Predicate",r.getSemigroupAny=function(){return{concat:function(n,t){return(0,e.pipe)(n,(0,r.or)(t))}}},r.getMonoidAny=function(){return{concat:(0,r.getSemigroupAny)().concat,empty:e.constFalse}},r.getSemigroupAll=function(){return{concat:function(n,t){return(0,e.pipe)(n,(0,r.and)(t))}}},r.getMonoidAll=function(){return{concat:(0,r.getSemigroupAll)().concat,empty:e.constTrue}},r.Contravariant={URI:r.URI,contramap:function(n,t){return(0,e.pipe)(n,(0,r.contramap)(t))}},r.not=function(n){return function(r){return!n(r)}},r.or=function(n){return function(r){return function(t){return r(t)||n(t)}}},r.and=function(n){return function(r){return function(t){return r(t)&&n(t)}}}})),_=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),v=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),d=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return v(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.Witherable=r.wilt=r.wither=r.Traversable=r.sequence=r.traverse=r.Filterable=r.partitionMap=r.partition=r.filterMap=r.filter=r.Compactable=r.separate=r.compact=r.Extend=r.extend=r.Alternative=r.guard=r.Zero=r.zero=r.Alt=r.alt=r.altW=r.orElse=r.Foldable=r.reduceRight=r.foldMap=r.reduce=r.Monad=r.Chain=r.flatMap=r.Applicative=r.Apply=r.ap=r.Pointed=r.of=r.asUnit=r.as=r.Functor=r.map=r.getMonoid=r.getOrd=r.getEq=r.getShow=r.URI=r.getRight=r.getLeft=r.fromPredicate=r.some=r.none=void 0,r.getFirstMonoid=r.getApplyMonoid=r.getApplySemigroup=r.option=r.mapNullable=r.getRefinement=r.chainFirst=r.chain=r.sequenceArray=r.traverseArray=r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex=r.traverseReadonlyNonEmptyArrayWithIndex=r.ApT=r.apS=r.bind=r.let=r.bindTo=r.Do=r.exists=r.elem=r.toUndefined=r.toNullable=r.chainNullableK=r.fromNullableK=r.tryCatchK=r.tryCatch=r.fromNullable=r.chainFirstEitherK=r.chainEitherK=r.fromEitherK=r.duplicate=r.tapEither=r.tap=r.flatten=r.apSecond=r.apFirst=r.flap=r.getOrElse=r.getOrElseW=r.fold=r.match=r.foldW=r.matchW=r.isNone=r.isSome=r.FromEither=r.fromEither=r.MonadThrow=r.throwError=void 0,r.getLastMonoid=void 0;var l=d(c),s=d(o);r.none=s.none,r.some=s.some,r.fromPredicate=function(n){return function(t){return n(t)?(0,r.some)(t):r.none}},r.getLeft=function(n){return"Right"===n._tag?r.none:(0,r.some)(n.left)},r.getRight=function(n){return"Left"===n._tag?r.none:(0,r.some)(n.right)};var m=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},h=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},U=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},O=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},g=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},j=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},M=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},y=function(n,t){return(0,e.pipe)(n,(0,r.filter)(t))},_=function(n,t){return(0,e.pipe)(n,(0,r.filterMap)(t))},W=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},E=function(n,t){return(0,e.pipe)(n,(0,r.partition)(t))},q=function(n,t){return(0,e.pipe)(n,(0,r.partitionMap)(t))};r.URI="Option",r.getShow=function(n){return{show:function(t){return(0,r.isNone)(t)?"none":"some(".concat(n.show(t.value),")")}}},r.getEq=function(n){return{equals:function(t,u){return t===u||((0,r.isNone)(t)?(0,r.isNone)(u):!(0,r.isNone)(u)&&n.equals(t.value,u.value))}}},r.getOrd=function(n){return{equals:(0,r.getEq)(n).equals,compare:function(t,u){return t===u?0:(0,r.isSome)(t)?(0,r.isSome)(u)?n.compare(t.value,u.value):1:-1}}},r.getMonoid=function(n){return{concat:function(t,u){return(0,r.isNone)(t)?u:(0,r.isNone)(u)?t:(0,r.some)(n.concat(t.value,u.value))},empty:r.none}},r.map=function(n){return function(t){return(0,r.isNone)(t)?r.none:(0,r.some)(n(t.value))}},r.Functor={URI:r.URI,map:m},r.as=(0,e.dual)(2,(0,a.as)(r.Functor)),r.asUnit=(0,a.asUnit)(r.Functor),r.of=r.some,r.Pointed={URI:r.URI,of:r.of},r.ap=function(n){return function(t){return(0,r.isNone)(t)||(0,r.isNone)(n)?r.none:(0,r.some)(t.value(n.value))}},r.Apply={URI:r.URI,map:m,ap:h},r.Applicative={URI:r.URI,map:m,ap:h,of:r.of},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,r.isNone)(n)?r.none:t(n.value)})),r.Chain={URI:r.URI,map:m,ap:h,chain:r.flatMap},r.Monad={URI:r.URI,map:m,ap:h,of:r.of,chain:r.flatMap},r.reduce=function(n,t){return function(u){return(0,r.isNone)(u)?n:t(n,u.value)}},r.foldMap=function(n){return function(t){return function(u){return(0,r.isNone)(u)?n.empty:t(u.value)}}},r.reduceRight=function(n,t){return function(u){return(0,r.isNone)(u)?n:t(u.value,n)}},r.Foldable={URI:r.URI,reduce:U,foldMap:O,reduceRight:g},r.orElse=(0,e.dual)(2,(function(n,t){return(0,r.isNone)(n)?t():n})),r.altW=r.orElse,r.alt=r.orElse,r.Alt={URI:r.URI,map:m,alt:M},r.zero=function(){return r.none},r.Zero={URI:r.URI,zero:r.zero},r.guard=(0,R.guard)(r.Zero,r.Pointed),r.Alternative={URI:r.URI,map:m,ap:h,of:r.of,alt:M,zero:r.zero},r.extend=function(n){return function(t){return(0,r.isNone)(t)?r.none:(0,r.some)(n(t))}},r.Extend={URI:r.URI,map:m,extend:W},r.compact=(0,r.flatMap)(e.identity);var k=(0,I.separated)(r.none,r.none);r.separate=function(n){return(0,r.isNone)(n)?k:(0,I.separated)((0,r.getLeft)(n.value),(0,r.getRight)(n.value))},r.Compactable={URI:r.URI,compact:r.compact,separate:r.separate},r.filter=function(n){return function(t){return(0,r.isNone)(t)?r.none:n(t.value)?t:r.none}},r.filterMap=function(n){return function(t){return(0,r.isNone)(t)?r.none:n(t.value)}},r.partition=function(n){return function(r){return(0,I.separated)(y(r,(0,x.not)(n)),y(r,n))}},r.partitionMap=function(n){return(0,e.flow)((0,r.map)(n),r.separate)},r.Filterable={URI:r.URI,map:m,compact:r.compact,separate:r.separate,filter:y,filterMap:_,partition:E,partitionMap:q},r.traverse=function(n){return function(t){return function(u){return(0,r.isNone)(u)?n.of(r.none):n.map(t(u.value),r.some)}}},r.sequence=function(n){return function(t){return(0,r.isNone)(t)?n.of(r.none):n.map(t.value,r.some)}},r.Traversable={URI:r.URI,map:m,reduce:U,foldMap:O,reduceRight:g,traverse:j,sequence:r.sequence};var A=(0,b.witherDefault)(r.Traversable,r.Compactable),P=(0,b.wiltDefault)(r.Traversable,r.Compactable);r.wither=function(n){var r=A(n);return function(n){return function(t){return r(t,n)}}},r.wilt=function(n){var r=P(n);return function(n){return function(t){return r(t,n)}}},r.Witherable={URI:r.URI,map:m,reduce:U,foldMap:O,reduceRight:g,traverse:j,sequence:r.sequence,compact:r.compact,separate:r.separate,filter:y,filterMap:_,partition:E,partitionMap:q,wither:A,wilt:P},r.throwError=function(){return r.none},r.MonadThrow={URI:r.URI,map:m,ap:h,of:r.of,chain:r.flatMap,throwError:r.throwError},r.fromEither=r.getRight,r.FromEither={URI:r.URI,fromEither:r.fromEither},r.isSome=s.isSome,r.isNone=function(n){return"None"===n._tag},r.matchW=function(n,t){return function(u){return(0,r.isNone)(u)?n():t(u.value)}},r.foldW=r.matchW,r.match=r.matchW,r.fold=r.match,r.getOrElseW=function(n){return function(t){return(0,r.isNone)(t)?n():t.value}},r.getOrElse=r.getOrElseW,r.flap=(0,a.flap)(r.Functor),r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.flatten=r.compact,r.tap=(0,e.dual)(2,l.tap(r.Chain)),r.tapEither=(0,e.dual)(2,(0,f.tapEither)(r.FromEither,r.Chain)),r.duplicate=(0,r.extend)(e.identity),r.fromEitherK=(0,f.fromEitherK)(r.FromEither),r.chainEitherK=(0,f.chainEitherK)(r.FromEither,r.Chain),r.chainFirstEitherK=r.tapEither,r.fromNullable=function(n){return null==n?r.none:(0,r.some)(n)},r.tryCatch=function(n){try{return(0,r.some)(n())}catch(n){return r.none}},r.tryCatchK=function(n){return function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];return(0,r.tryCatch)((function(){return n.apply(void 0,t)}))}},r.fromNullableK=function(n){return(0,e.flow)(n,r.fromNullable)},r.chainNullableK=function(n){return function(t){return(0,r.isNone)(t)?r.none:(0,r.fromNullable)(n(t.value))}},r.toNullable=(0,r.match)(e.constNull,e.identity),r.toUndefined=(0,r.match)(e.constUndefined,e.identity),r.elem=function n(t){return function(u,e){if(void 0===e){var o=n(t);return function(n){return o(u,n)}}return!(0,r.isNone)(e)&&t.equals(u,e.value)}},r.exists=function(n){return function(t){return!(0,r.isNone)(t)&&n(t.value)}},r.Do=(0,r.of)(s.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=l.bind(r.Chain),r.apS=(0,i.apS)(r.Apply),r.ApT=(0,r.of)(s.emptyReadonlyArray),r.traverseReadonlyNonEmptyArrayWithIndex=function(n){return function(t){var u=n(0,s.head(t));if((0,r.isNone)(u))return r.none;for(var e=[u.value],o=1;o<t.length;o++){var i=n(o,t[o]);if((0,r.isNone)(i))return r.none;e.push(i.value)}return(0,r.some)(e)}},r.traverseReadonlyArrayWithIndex=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndex)(n);return function(n){return s.isNonEmpty(n)?t(n):r.ApT}},r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex,r.traverseArray=function(n){return(0,r.traverseReadonlyArrayWithIndex)((function(r,t){return n(t)}))},r.sequenceArray=(0,r.traverseArray)(e.identity),r.chain=r.flatMap,r.chainFirst=r.tap,r.getRefinement=function(n){return function(t){return(0,r.isSome)(n(t))}},r.mapNullable=r.chainNullableK,r.option={URI:r.URI,map:m,of:r.of,ap:h,chain:r.flatMap,reduce:U,foldMap:O,reduceRight:g,traverse:j,sequence:r.sequence,zero:r.zero,alt:M,extend:W,compact:r.compact,separate:r.separate,filter:y,filterMap:_,partition:E,partitionMap:q,wither:A,wilt:P,throwError:r.throwError},r.getApplySemigroup=(0,i.getApplySemigroup)(r.Apply),r.getApplyMonoid=(0,w.getApplicativeMonoid)(r.Applicative),r.getFirstMonoid=function(){return(0,r.getMonoid)((0,p.first)())},r.getLastMonoid=function(){return(0,r.getMonoid)((0,p.last)())}}));function W(n){return n}function E(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n}function q(n,r,t,u,e,o,i,c,f){switch(arguments.length){case 1:return n;case 2:return r(n);case 3:return t(r(n));case 4:return u(t(r(n)));case 5:return e(u(t(r(n))));case 6:return o(e(u(t(r(n)))));case 7:return i(o(e(u(t(r(n))))));case 8:return c(i(o(e(u(t(r(n)))))));case 9:return f(c(i(o(e(u(t(r(n))))))));default:for(var a=arguments[0],v=1;v<arguments.length;v++)a=arguments[v](a);return a}}var k=function(n,r){var t="number"==typeof n?function(r){return r.length>=n}:n;return function(){var n=Array.from(arguments);return t(arguments)?r.apply(this,n):function(t){return r.apply(void 0,function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))}([t],n,!1))}}},A={_tag:"None"},P=function(n){return{_tag:"Left",left:n}},T=function(n){return{_tag:"Right",right:n}},L=Object.prototype.hasOwnProperty,z=function(n,r){return k(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromTask(u(r))}))}))};function N(n){return function(r){return function(t){return n.fromEither("None"===t._tag?P(r()):T(t.value))}}}var S=P,C=T,F=k(2,(function(n,r){return V(n)?n:r(n.right)})),$=function(n,r){return q(n,H(r))},D="Either",H=function(n){return function(r){return V(r)?r:C(n(r.right))}},J={URI:D,map:$},G={URI:D,map:$,ap:function(n,r){return q(n,function(n){return function(r){return V(r)?r:V(n)?n:C(r.right(n.right))}}(r))}},B=function(n){return function(r){return V(r)?S(n(r.left)):r}},K=N({URI:D,fromEither:W}),V=function(n){return"Left"===n._tag},Q=function(n,r){return function(t){return V(t)?n(t.left):r(t.right)}},X=function(n){return function(r){return V(r)?n(r.left):r.right}},Y=F,Z=A,nn=function(n){return{_tag:"Some",value:n}},rn=function(n){return{concat:function(r,t){return un(r)?t:un(t)?r:nn(n.concat(r.value,t.value))},empty:Z}},tn=k(2,(function(n,r){return un(n)?Z:r(n.value)})),un=function(n){return"None"===n._tag},en=function(n){return function(r){return un(r)?n():r.value}},on=function(n){return null==n?Z:nn(n)},cn=tn;function fn(n){return function(r){return n.map(r,C)}}function an(n){return function(n,r){return function(t){return function(u){return n.map(u,(function(n){return r.map(n,t)}))}}}(n,J)}var vn,dn,ln=function(n,r){return q(n,pn(r))},pn=function(n){return function(r){return function(){return Promise.resolve().then(r).then(n)}}},sn=function(n){return function(){return Promise.resolve(n)}},mn="Task",hn={URI:mn,map:ln},In={URI:mn,map:ln,of:sn,ap:function(n,r){return q(n,function(n){return function(r){return function(){return Promise.all([Promise.resolve().then(r),Promise.resolve().then(n)]).then((function(n){return(0,n[0])(n[1])}))}}}(r))},chain:k(2,(function(n,r){return function(){return Promise.resolve().then(n).then((function(n){return r(n)()}))}}))},bn=fn(hn),Rn=sn,Un=an(hn),On=k(2,(vn=hn,function(n,r){return vn.map(n,B(r))})),gn=k(2,(dn=In,function(n,r){return dn.chain(n,(function(n){return V(n)?dn.of(n):r(n.right)}))})),jn=N({URI:"TaskEither",fromEither:Rn}),Mn=z({fromTask:bn},{flatMap:gn}),yn=gn,wn=gn,xn=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),o=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),i=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return o(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.getCompactableComposition=r.separate=r.compact=void 0;var c=i(I);function f(n,r){return function(t){return n.map(t,r.compact)}}function v(n,r,t){var u=f(n,r),o=(0,a.map)(n,t);return function(n){return c.separated(u((0,e.pipe)(n,o(_.getLeft))),u((0,e.pipe)(n,o(_.getRight))))}}r.compact=f,r.separate=v,r.getCompactableComposition=function(n,r){return{map:(0,a.getFunctorComposition)(n,r).map,compact:f(n,r),separate:v(n,r,r)}}})),_n=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.tailRec=void 0,r.tailRec=function(n,r){for(var t=r(n);"Left"===t._tag;)t=r(t.left);return t.right}})),Wn=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),v=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),d=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return v(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.match=r.foldW=r.matchW=r.isRight=r.isLeft=r.fromOption=r.fromPredicate=r.FromEither=r.MonadThrow=r.throwError=r.ChainRec=r.Extend=r.extend=r.Alt=r.alt=r.altW=r.Bifunctor=r.mapLeft=r.bimap=r.Traversable=r.sequence=r.traverse=r.Foldable=r.reduceRight=r.foldMap=r.reduce=r.Monad=r.Chain=r.Applicative=r.Apply=r.ap=r.apW=r.Pointed=r.of=r.asUnit=r.as=r.Functor=r.map=r.getAltValidation=r.getApplicativeValidation=r.getWitherable=r.getFilterable=r.getCompactable=r.getSemigroup=r.getEq=r.getShow=r.URI=r.flatMap=r.right=r.left=void 0,r.chainFirstW=r.chainFirst=r.chain=r.chainW=r.sequenceArray=r.traverseArray=r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex=r.traverseReadonlyNonEmptyArrayWithIndex=r.ApT=r.apSW=r.apS=r.bindW=r.bind=r.let=r.bindTo=r.Do=r.exists=r.elem=r.toError=r.toUnion=r.chainNullableK=r.fromNullableK=r.tryCatchK=r.tryCatch=r.fromNullable=r.orElse=r.orElseW=r.swap=r.filterOrElseW=r.filterOrElse=r.flatMapOption=r.flatMapNullable=r.liftOption=r.liftNullable=r.chainOptionKW=r.chainOptionK=r.fromOptionK=r.duplicate=r.flatten=r.flattenW=r.tap=r.apSecondW=r.apSecond=r.apFirstW=r.apFirst=r.flap=r.getOrElse=r.getOrElseW=r.fold=void 0,r.getValidation=r.getValidationMonoid=r.getValidationSemigroup=r.getApplyMonoid=r.getApplySemigroup=r.either=r.stringifyJSON=r.parseJSON=void 0;var l=d(c),p=d(o);r.left=p.left,r.right=p.right,r.flatMap=(0,e.dual)(2,(function(n,t){return(0,r.isLeft)(n)?n:t(n.right)}));var s=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},m=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},h=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},R=function(n){return function(t,u){var o=(0,r.foldMap)(n);return(0,e.pipe)(t,o(u))}},U=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},O=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},g=function(n,t,u){return(0,e.pipe)(n,(0,r.bimap)(t,u))},j=function(n,t){return(0,e.pipe)(n,(0,r.mapLeft)(t))},M=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},y=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},x=function(n,t){return(0,_n.tailRec)(t(n),(function(n){return(0,r.isLeft)(n)?(0,r.right)((0,r.left)(n.left)):(0,r.isLeft)(n.right)?(0,r.left)(t(n.right.left)):(0,r.right)((0,r.right)(n.right.right))}))};r.URI="Either",r.getShow=function(n,t){return{show:function(u){return(0,r.isLeft)(u)?"left(".concat(n.show(u.left),")"):"right(".concat(t.show(u.right),")")}}},r.getEq=function(n,t){return{equals:function(u,e){return u===e||((0,r.isLeft)(u)?(0,r.isLeft)(e)&&n.equals(u.left,e.left):(0,r.isRight)(e)&&t.equals(u.right,e.right))}}},r.getSemigroup=function(n){return{concat:function(t,u){return(0,r.isLeft)(u)?t:(0,r.isLeft)(t)?u:(0,r.right)(n.concat(t.right,u.right))}}},r.getCompactable=function(n){var t=(0,r.left)(n.empty);return{URI:r.URI,_E:void 0,compact:function(n){return(0,r.isLeft)(n)?n:"None"===n.right._tag?t:(0,r.right)(n.right.value)},separate:function(n){return(0,r.isLeft)(n)?(0,I.separated)(n,n):(0,r.isLeft)(n.right)?(0,I.separated)((0,r.right)(n.right.left),t):(0,I.separated)(t,(0,r.right)(n.right.right))}}},r.getFilterable=function(n){var t=(0,r.left)(n.empty),u=(0,r.getCompactable)(n);return{URI:r.URI,_E:void 0,map:s,compact:u.compact,separate:u.separate,filter:function(n,u){return(0,r.isLeft)(n)||u(n.right)?n:t},filterMap:function(n,u){if((0,r.isLeft)(n))return n;var e=u(n.right);return"None"===e._tag?t:(0,r.right)(e.value)},partition:function(n,u){return(0,r.isLeft)(n)?(0,I.separated)(n,n):u(n.right)?(0,I.separated)(t,(0,r.right)(n.right)):(0,I.separated)((0,r.right)(n.right),t)},partitionMap:function(n,u){if((0,r.isLeft)(n))return(0,I.separated)(n,n);var e=u(n.right);return(0,r.isLeft)(e)?(0,I.separated)((0,r.right)(e.left),t):(0,I.separated)(t,(0,r.right)(e.right))}}},r.getWitherable=function(n){var t=(0,r.getFilterable)(n),u=(0,r.getCompactable)(n);return{URI:r.URI,_E:void 0,map:s,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:O,sequence:r.sequence,reduce:h,foldMap:R,reduceRight:U,wither:(0,b.witherDefault)(r.Traversable,u),wilt:(0,b.wiltDefault)(r.Traversable,u)}},r.getApplicativeValidation=function(n){return{URI:r.URI,_E:void 0,map:s,ap:function(t,u){return(0,r.isLeft)(t)?(0,r.isLeft)(u)?(0,r.left)(n.concat(t.left,u.left)):t:(0,r.isLeft)(u)?u:(0,r.right)(t.right(u.right))},of:r.of}},r.getAltValidation=function(n){return{URI:r.URI,_E:void 0,map:s,alt:function(t,u){if((0,r.isRight)(t))return t;var e=u();return(0,r.isLeft)(e)?(0,r.left)(n.concat(t.left,e.left)):e}}},r.map=function(n){return function(t){return(0,r.isLeft)(t)?t:(0,r.right)(n(t.right))}},r.Functor={URI:r.URI,map:s},r.as=(0,e.dual)(2,(0,a.as)(r.Functor)),r.asUnit=(0,a.asUnit)(r.Functor),r.of=r.right,r.Pointed={URI:r.URI,of:r.of},r.apW=function(n){return function(t){return(0,r.isLeft)(t)?t:(0,r.isLeft)(n)?n:(0,r.right)(t.right(n.right))}},r.ap=r.apW,r.Apply={URI:r.URI,map:s,ap:m},r.Applicative={URI:r.URI,map:s,ap:m,of:r.of},r.Chain={URI:r.URI,map:s,ap:m,chain:r.flatMap},r.Monad={URI:r.URI,map:s,ap:m,of:r.of,chain:r.flatMap},r.reduce=function(n,t){return function(u){return(0,r.isLeft)(u)?n:t(n,u.right)}},r.foldMap=function(n){return function(t){return function(u){return(0,r.isLeft)(u)?n.empty:t(u.right)}}},r.reduceRight=function(n,t){return function(u){return(0,r.isLeft)(u)?n:t(u.right,n)}},r.Foldable={URI:r.URI,reduce:h,foldMap:R,reduceRight:U},r.traverse=function(n){return function(t){return function(u){return(0,r.isLeft)(u)?n.of((0,r.left)(u.left)):n.map(t(u.right),r.right)}}},r.sequence=function(n){return function(t){return(0,r.isLeft)(t)?n.of((0,r.left)(t.left)):n.map(t.right,r.right)}},r.Traversable={URI:r.URI,map:s,reduce:h,foldMap:R,reduceRight:U,traverse:O,sequence:r.sequence},r.bimap=function(n,t){return function(u){return(0,r.isLeft)(u)?(0,r.left)(n(u.left)):(0,r.right)(t(u.right))}},r.mapLeft=function(n){return function(t){return(0,r.isLeft)(t)?(0,r.left)(n(t.left)):t}},r.Bifunctor={URI:r.URI,bimap:g,mapLeft:j},r.altW=function(n){return function(t){return(0,r.isLeft)(t)?n():t}},r.alt=r.altW,r.Alt={URI:r.URI,map:s,alt:M},r.extend=function(n){return function(t){return(0,r.isLeft)(t)?t:(0,r.right)(n(t))}},r.Extend={URI:r.URI,map:s,extend:y},r.ChainRec={URI:r.URI,map:s,ap:m,chain:r.flatMap,chainRec:x},r.throwError=r.left,r.MonadThrow={URI:r.URI,map:s,ap:m,of:r.of,chain:r.flatMap,throwError:r.throwError},r.FromEither={URI:r.URI,fromEither:e.identity},r.fromPredicate=(0,f.fromPredicate)(r.FromEither),r.fromOption=(0,f.fromOption)(r.FromEither),r.isLeft=p.isLeft,r.isRight=p.isRight,r.matchW=function(n,t){return function(u){return(0,r.isLeft)(u)?n(u.left):t(u.right)}},r.foldW=r.matchW,r.match=r.matchW,r.fold=r.match,r.getOrElseW=function(n){return function(t){return(0,r.isLeft)(t)?n(t.left):t.right}},r.getOrElse=r.getOrElseW,r.flap=(0,a.flap)(r.Functor),r.apFirst=(0,i.apFirst)(r.Apply),r.apFirstW=r.apFirst,r.apSecond=(0,i.apSecond)(r.Apply),r.apSecondW=r.apSecond,r.tap=(0,e.dual)(2,l.tap(r.Chain)),r.flattenW=(0,r.flatMap)(e.identity),r.flatten=r.flattenW,r.duplicate=(0,r.extend)(e.identity),r.fromOptionK=(0,f.fromOptionK)(r.FromEither),r.chainOptionK=(0,f.chainOptionK)(r.FromEither,r.Chain),r.chainOptionKW=r.chainOptionK;var _={fromEither:r.FromEither.fromEither};r.liftNullable=p.liftNullable(_),r.liftOption=p.liftOption(_);var W={flatMap:r.flatMap};r.flatMapNullable=p.flatMapNullable(_,W),r.flatMapOption=p.flatMapOption(_,W),r.filterOrElse=(0,f.filterOrElse)(r.FromEither,r.Chain),r.filterOrElseW=r.filterOrElse,r.swap=function(n){return(0,r.isLeft)(n)?(0,r.right)(n.left):(0,r.left)(n.right)},r.orElseW=function(n){return function(t){return(0,r.isLeft)(t)?n(t.left):t}},r.orElse=r.orElseW,r.fromNullable=function(n){return function(t){return null==t?(0,r.left)(n):(0,r.right)(t)}},r.tryCatch=function(n,t){try{return(0,r.right)(n())}catch(n){return(0,r.left)(t(n))}},r.tryCatchK=function(n,t){return function(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];return(0,r.tryCatch)((function(){return n.apply(void 0,u)}),t)}},r.fromNullableK=function(n){var t=(0,r.fromNullable)(n);return function(n){return(0,e.flow)(n,t)}},r.chainNullableK=function(n){var t=(0,r.fromNullableK)(n);return function(n){return(0,r.flatMap)(t(n))}},r.toUnion=(0,r.foldW)(e.identity,e.identity),r.toError=function(n){return n instanceof Error?n:new Error(String(n))},r.elem=function n(t){return function(u,e){if(void 0===e){var o=n(t);return function(n){return o(u,n)}}return!(0,r.isLeft)(e)&&t.equals(u,e.right)}},r.exists=function(n){return function(t){return!(0,r.isLeft)(t)&&n(t.right)}},r.Do=(0,r.of)(p.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=l.bind(r.Chain),r.bindW=r.bind,r.apS=(0,i.apS)(r.Apply),r.apSW=r.apS,r.ApT=(0,r.of)(p.emptyReadonlyArray),r.traverseReadonlyNonEmptyArrayWithIndex=function(n){return function(t){var u=n(0,p.head(t));if((0,r.isLeft)(u))return u;for(var e=[u.right],o=1;o<t.length;o++){var i=n(o,t[o]);if((0,r.isLeft)(i))return i;e.push(i.right)}return(0,r.right)(e)}},r.traverseReadonlyArrayWithIndex=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndex)(n);return function(n){return p.isNonEmpty(n)?t(n):r.ApT}},r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex,r.traverseArray=function(n){return(0,r.traverseReadonlyArrayWithIndex)((function(r,t){return n(t)}))},r.sequenceArray=(0,r.traverseArray)(e.identity),r.chainW=r.flatMap,r.chain=r.flatMap,r.chainFirst=r.tap,r.chainFirstW=r.tap,r.parseJSON=function(n,t){return(0,r.tryCatch)((function(){return JSON.parse(n)}),t)},r.stringifyJSON=function(n,t){return(0,r.tryCatch)((function(){var r=JSON.stringify(n);if("string"!=typeof r)throw new Error("Converting unsupported structure to JSON");return r}),t)},r.either={URI:r.URI,map:s,of:r.of,ap:m,chain:r.flatMap,reduce:h,foldMap:R,reduceRight:U,traverse:O,sequence:r.sequence,bimap:g,mapLeft:j,alt:M,extend:y,chainRec:x,throwError:r.throwError},r.getApplySemigroup=(0,i.getApplySemigroup)(r.Apply),r.getApplyMonoid=(0,w.getApplicativeMonoid)(r.Applicative),r.getValidationSemigroup=function(n,t){return(0,i.getApplySemigroup)((0,r.getApplicativeValidation)(n))(t)},r.getValidationMonoid=function(n,t){return(0,w.getApplicativeMonoid)((0,r.getApplicativeValidation)(n))(t)},r.getValidation=function(n){var t=(0,r.getApplicativeValidation)(n).ap,u=(0,r.getAltValidation)(n).alt;return{URI:r.URI,_E:void 0,map:s,of:r.of,chain:r.flatMap,bimap:g,mapLeft:j,reduce:h,foldMap:R,reduceRight:U,extend:y,traverse:O,sequence:r.sequence,chainRec:x,throwError:r.throwError,ap:t,alt:u}}})),En=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),o=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),c=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return o(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.getEitherM=r.toUnion=r.swap=r.orLeft=r.tapError=r.orElseFirst=r.orElse=r.getOrElse=r.matchE=r.match=r.altValidation=r.mapError=r.mapLeft=r.mapBoth=r.bimap=r.alt=r.flatMap=r.chain=r.ap=r.map=r.chainNullableK=r.fromNullableK=r.fromNullable=r.leftF=r.rightF=r.left=r.right=void 0;var f=c(Wn);function v(n){return(0,e.flow)(f.right,n.of)}function d(n){return(0,e.flow)(f.left,n.of)}function l(n){return function(r){return n.map(r,f.right)}}function p(n){return function(r){return n.map(r,f.left)}}function s(n){return function(r){return(0,e.flow)(f.fromNullable(r),n.of)}}function m(n){var r=s(n);return function(n){var t=r(n);return function(n){return(0,e.flow)(n,t)}}}function h(n){return(0,a.map)(n,f.Functor)}function I(n){return(0,i.ap)(n,f.Apply)}function b(n){var r=R(n);return function(n){return function(t){return r(t,n)}}}function R(n){return function(r,t){return n.chain(r,(function(r){return f.isLeft(r)?n.of(r):t(r.right)}))}}function U(n){return function(r){return function(t){return n.chain(t,(function(t){return f.isLeft(t)?r():n.of(t)}))}}}function O(n){var r=g(n);return function(n,t){return function(u){return r(u,n,t)}}}function g(n){return function(r,t,u){return n.map(r,f.bimap(t,u))}}function j(n){var r=M(n);return function(n){return function(t){return r(t,n)}}}function M(n){return function(r,t){return n.map(r,f.mapLeft(t))}}function y(n){return function(r,t){return function(u){return n.chain(u,f.match(r,t))}}}function w(n){return function(r){return function(t){return n.chain(t,f.match(r,n.of))}}}function x(n){return function(r){return function(t){return n.chain(t,(function(t){return f.isLeft(t)?r(t.left):n.of(t)}))}}}function _(n){var r=x(n);return function(t,u){return(0,e.pipe)(t,r((function(r){return n.map(u(r),(function(n){return f.isLeft(n)?n:f.left(r)}))})))}}function W(n){return function(r){return n.map(r,f.swap)}}r.right=v,r.left=d,r.rightF=l,r.leftF=p,r.fromNullable=s,r.fromNullableK=m,r.chainNullableK=function(n){var r=b(n),t=m(n);return function(n){var u=t(n);return function(n){return r(u(n))}}},r.map=h,r.ap=I,r.chain=b,r.flatMap=R,r.alt=U,r.bimap=O,r.mapBoth=g,r.mapLeft=j,r.mapError=M,r.altValidation=function(n,r){return function(t){return function(u){return n.chain(u,f.match((function(u){return n.map(t(),f.mapLeft((function(n){return r.concat(u,n)})))}),v(n)))}}},r.match=function(n){return function(r,t){return function(u){return n.map(u,f.match(r,t))}}},r.matchE=y,r.getOrElse=w,r.orElse=x,r.orElseFirst=function(n){var r=_(n);return function(n){return function(t){return r(t,n)}}},r.tapError=_,r.orLeft=function(n){return function(r){return function(t){return n.chain(t,f.match((function(t){return n.map(r(t),f.left)}),(function(r){return n.of(f.right(r))})))}}},r.swap=W,r.toUnion=function(n){return function(r){return n.map(r,f.toUnion)}},r.getEitherM=function(n){var r=I(n),t=h(n),u=b(n),o=U(n),i=O(n),c=j(n),f=y(n),a=w(n),s=x(n);return{map:function(n,r){return(0,e.pipe)(n,t(r))},ap:function(n,t){return(0,e.pipe)(n,r(t))},of:v(n),chain:function(n,r){return(0,e.pipe)(n,u(r))},alt:function(n,r){return(0,e.pipe)(n,o(r))},bimap:function(n,r,t){return(0,e.pipe)(n,i(r,t))},mapLeft:function(n,r){return(0,e.pipe)(n,c(r))},fold:function(n,r,t){return(0,e.pipe)(n,f(r,t))},getOrElse:function(n,r){return(0,e.pipe)(n,a(r))},orElse:function(n,r){return(0,e.pipe)(n,s(r))},swap:W(n),rightM:l(n),leftM:p(n),left:d(n)}}})),qn=u((function(n,r){function t(n,r){return function(t){return function(u){return n.map(u,(function(n){return r.filter(n,t)}))}}}function u(n,r){return function(t){return function(u){return n.map(u,(function(n){return r.filterMap(n,t)}))}}}function o(n,r){var u=t(n,r);return function(n){var r=u((0,x.not)(n)),t=u(n);return function(n){return(0,I.separated)(r(n),t(n))}}}function i(n,r){var t=u(n,r);return function(n){return function(r){return(0,I.separated)((0,e.pipe)(r,t((function(r){return(0,_.getLeft)(n(r))}))),(0,e.pipe)(r,t((function(r){return(0,_.getRight)(n(r))}))))}}}Object.defineProperty(r,"__esModule",{value:!0}),r.getFilterableComposition=r.partitionMap=r.partition=r.filterMap=r.filter=void 0,r.filter=t,r.filterMap=u,r.partition=o,r.partitionMap=i,r.getFilterableComposition=function(n,r){var c=(0,a.getFunctorComposition)(n,r).map,f=(0,xn.compact)(n,r),v=(0,xn.separate)(n,r,r),d=t(n,r),l=u(n,r),p=o(n,r),s=i(n,r);return{map:c,compact:f,separate:v,filter:function(n,r){return(0,e.pipe)(n,d(r))},filterMap:function(n,r){return(0,e.pipe)(n,l(r))},partition:function(n,r){return(0,e.pipe)(n,p(r))},partitionMap:function(n,r){return(0,e.pipe)(n,s(r))}}}})),kn=u((function(n,r){function t(n,r){var t=(0,c.tap)(r);return function(r,u){return t(r,(0,e.flow)(u,n.fromIO))}}Object.defineProperty(r,"__esModule",{value:!0}),r.tapIO=r.chainFirstIOK=r.chainIOK=r.fromIOK=void 0,r.fromIOK=function(n){return function(r){return(0,e.flow)(r,n.fromIO)}},r.chainIOK=function(n,r){return function(t){var u=(0,e.flow)(t,n.fromIO);return function(n){return r.chain(n,u)}}},r.chainFirstIOK=function(n,r){var u=t(n,r);return function(n){return function(r){return u(r,n)}}},r.tapIO=t})),An=u((function(n,r){function t(n,r){var t=(0,c.tap)(r);return function(r,u){return t(r,(0,e.flow)(u,n.fromTask))}}Object.defineProperty(r,"__esModule",{value:!0}),r.tapTask=r.chainFirstTaskK=r.chainTaskK=r.fromTaskK=void 0,r.fromTaskK=function(n){return function(r){return(0,e.flow)(r,n.fromTask)}},r.chainTaskK=function(n,r){return function(t){var u=(0,e.flow)(t,n.fromTask);return function(n){return r.chain(n,u)}}},r.chainFirstTaskK=function(n,r){var u=t(n,r);return function(n){return function(r){return u(r,n)}}},r.tapTask=t})),Pn=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),f=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),v=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return f(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.sequenceSeqArray=r.traverseSeqArray=r.traverseSeqArrayWithIndex=r.sequenceArray=r.traverseArray=r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndexSeq=r.traverseReadonlyNonEmptyArrayWithIndexSeq=r.traverseReadonlyArrayWithIndex=r.traverseReadonlyNonEmptyArrayWithIndex=r.ApT=r.apS=r.bind=r.let=r.bindTo=r.Do=r.never=r.FromTask=r.chainFirstIOK=r.chainIOK=r.fromIOK=r.tapIO=r.tap=r.flatMapIO=r.FromIO=r.MonadTask=r.fromTask=r.MonadIO=r.Monad=r.Chain=r.ApplicativeSeq=r.ApplySeq=r.ApplicativePar=r.apSecond=r.apFirst=r.ApplyPar=r.Pointed=r.flap=r.asUnit=r.as=r.Functor=r.getRaceMonoid=r.URI=r.flatten=r.flatMap=r.of=r.ap=r.map=r.delay=r.fromIO=void 0,r.getMonoid=r.getSemigroup=r.taskSeq=r.task=r.chainFirst=r.chain=void 0;var d=v(c),l=v(o);r.fromIO=function(n){return function(){return Promise.resolve().then(n)}},r.delay=function(n){return function(r){return function(){return new Promise((function(t){setTimeout((function(){Promise.resolve().then(r).then(t)}),n)}))}}};var p=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},s=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},m=function(n,t){return(0,r.flatMap)(n,(function(n){return(0,e.pipe)(t,(0,r.map)(n))}))};r.map=function(n){return function(r){return function(){return Promise.resolve().then(r).then(n)}}},r.ap=function(n){return function(r){return function(){return Promise.all([Promise.resolve().then(r),Promise.resolve().then(n)]).then((function(n){return(0,n[0])(n[1])}))}}},r.of=function(n){return function(){return Promise.resolve(n)}},r.flatMap=(0,e.dual)(2,(function(n,r){return function(){return Promise.resolve().then(n).then((function(n){return r(n)()}))}})),r.flatten=(0,r.flatMap)(e.identity),r.URI="Task",r.getRaceMonoid=function(){return{concat:function(n,r){return function(){return Promise.race([Promise.resolve().then(n),Promise.resolve().then(r)])}},empty:r.never}},r.Functor={URI:r.URI,map:p},r.as=(0,e.dual)(2,(0,a.as)(r.Functor)),r.asUnit=(0,a.asUnit)(r.Functor),r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.ApplyPar={URI:r.URI,map:p,ap:s},r.apFirst=(0,i.apFirst)(r.ApplyPar),r.apSecond=(0,i.apSecond)(r.ApplyPar),r.ApplicativePar={URI:r.URI,map:p,ap:s,of:r.of},r.ApplySeq={URI:r.URI,map:p,ap:m},r.ApplicativeSeq={URI:r.URI,map:p,ap:m,of:r.of},r.Chain={URI:r.URI,map:p,ap:s,chain:r.flatMap},r.Monad={URI:r.URI,map:p,of:r.of,ap:s,chain:r.flatMap},r.MonadIO={URI:r.URI,map:p,of:r.of,ap:s,chain:r.flatMap,fromIO:r.fromIO},r.fromTask=e.identity,r.MonadTask={URI:r.URI,map:p,of:r.of,ap:s,chain:r.flatMap,fromIO:r.fromIO,fromTask:r.fromTask},r.FromIO={URI:r.URI,fromIO:r.fromIO},r.flatMapIO=l.flatMapIO({fromIO:r.FromIO.fromIO},{flatMap:r.flatMap}),r.tap=(0,e.dual)(2,d.tap(r.Chain)),r.tapIO=(0,e.dual)(2,(0,kn.tapIO)(r.FromIO,r.Chain)),r.fromIOK=(0,kn.fromIOK)(r.FromIO),r.chainIOK=r.flatMapIO,r.chainFirstIOK=r.tapIO,r.FromTask={URI:r.URI,fromIO:r.fromIO,fromTask:r.fromTask},r.never=function(){return new Promise((function(){}))},r.Do=(0,r.of)(l.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=d.bind(r.Chain),r.apS=(0,i.apS)(r.ApplyPar),r.ApT=(0,r.of)(l.emptyReadonlyArray),r.traverseReadonlyNonEmptyArrayWithIndex=function(n){return function(r){return function(){return Promise.all(r.map((function(r,t){return Promise.resolve().then((function(){return n(t,r)()}))})))}}},r.traverseReadonlyArrayWithIndex=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndex)(n);return function(n){return l.isNonEmpty(n)?t(n):r.ApT}},r.traverseReadonlyNonEmptyArrayWithIndexSeq=function(n){return function(r){return function(){return l.tail(r).reduce((function(r,t,u){return r.then((function(r){return Promise.resolve().then(n(u+1,t)).then((function(n){return r.push(n),r}))}))}),Promise.resolve().then(n(0,l.head(r))).then(l.singleton))}}},r.traverseReadonlyArrayWithIndexSeq=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndexSeq)(n);return function(n){return l.isNonEmpty(n)?t(n):r.ApT}},r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex,r.traverseArray=function(n){return(0,r.traverseReadonlyArrayWithIndex)((function(r,t){return n(t)}))},r.sequenceArray=(0,r.traverseArray)(e.identity),r.traverseSeqArrayWithIndex=r.traverseReadonlyArrayWithIndexSeq,r.traverseSeqArray=function(n){return(0,r.traverseReadonlyArrayWithIndexSeq)((function(r,t){return n(t)}))},r.sequenceSeqArray=(0,r.traverseSeqArray)(e.identity),r.chain=r.flatMap,r.chainFirst=r.tap,r.task={URI:r.URI,map:p,of:r.of,ap:s,chain:r.flatMap,fromIO:r.fromIO,fromTask:r.fromTask},r.taskSeq={URI:r.URI,map:p,of:r.of,ap:m,chain:r.flatMap,fromIO:r.fromIO,fromTask:r.fromTask},r.getSemigroup=(0,i.getApplySemigroup)(r.ApplySeq),r.getMonoid=(0,w.getApplicativeMonoid)(r.ApplicativeSeq)})),Tn=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),v=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),d=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return v(r,n),r},l=t&&t.__awaiter||function(n,r,t,u){return new(t||(t=Promise))((function(e,o){function i(n){try{f(u.next(n))}catch(n){o(n)}}function c(n){try{f(u.throw(n))}catch(n){o(n)}}function f(n){var r;n.done?e(n.value):(r=n.value,r instanceof t?r:new t((function(n){n(r)}))).then(i,c)}f((u=u.apply(n,r||[])).next())}))},p=t&&t.__generator||function(n,r){var t,u,e,o,i={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(f){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(t=1,u&&(e=2&c[0]?u.return:c[0]?u.throw||((e=u.return)&&e.call(u),0):u.next)&&!(e=e.call(u,c[1])).done)return e;switch(u=0,e&&(c=[2&c[0],e.value]),c[0]){case 0:case 1:e=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,u=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!((e=(e=i.trys).length>0&&e[e.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!e||c[1]>e[0]&&c[1]<e[3])){i.label=c[1];break}if(6===c[0]&&i.label<e[1]){i.label=e[1],e=c;break}if(e&&i.label<e[2]){i.label=e[2],i.ops.push(c);break}e[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(n){c=[6,n],u=0}finally{t=e=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,f])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.throwError=r.of=r.altW=r.alt=r.flatten=r.flattenW=r.flatMap=r.apW=r.ap=r.mapLeft=r.mapError=r.bimap=r.mapBoth=r.map=r.fromIOEitherK=r.chainTaskOptionK=r.chainTaskOptionKW=r.fromTaskOptionK=r.swap=r.orLeft=r.orElseFirstTaskK=r.orElseFirstIOK=r.tapError=r.orElseW=r.orElse=r.chainNullableK=r.fromNullableK=r.fromNullable=r.toUnion=r.tryCatchK=r.tryCatch=r.getOrElseW=r.getOrElse=r.foldW=r.matchEW=r.fold=r.matchE=r.matchW=r.match=r.fromTaskOption=r.fromIOEither=r.fromEither=r.fromTask=r.fromIO=r.leftIO=r.rightIO=r.leftTask=r.rightTask=r.right=r.left=void 0,r.fromPredicate=r.chainFirstEitherKW=r.chainFirstEitherK=r.chainEitherKW=r.chainEitherK=r.flatMapTaskOption=r.flatMapIOEither=r.flatMapTask=r.flatMapIO=r.flatMapEither=r.flatMapOption=r.flatMapNullable=r.liftOption=r.liftNullable=r.chainOptionKW=r.chainOptionK=r.fromOptionK=r.fromOption=r.Alt=r.Bifunctor=r.tapTask=r.tapIO=r.tapEither=r.tap=r.FromTask=r.FromIO=r.FromEither=r.MonadThrow=r.MonadTask=r.MonadIO=r.Monad=r.Chain=r.ApplicativeSeq=r.ApplySeq=r.ApplicativePar=r.apSecondW=r.apSecond=r.apFirstW=r.apFirst=r.ApplyPar=r.Pointed=r.flap=r.asUnit=r.as=r.Functor=r.getFilterable=r.getCompactable=r.getAltTaskValidation=r.getApplicativeTaskValidation=r.URI=void 0,r.getTaskValidation=r.getSemigroup=r.getApplyMonoid=r.getApplySemigroup=r.taskEitherSeq=r.taskEither=r.orElseFirstW=r.orElseFirst=r.chainFirstW=r.chainFirst=r.chainW=r.chain=r.sequenceSeqArray=r.traverseSeqArray=r.traverseSeqArrayWithIndex=r.sequenceArray=r.traverseArray=r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndexSeq=r.traverseReadonlyNonEmptyArrayWithIndexSeq=r.traverseReadonlyArrayWithIndex=r.traverseReadonlyNonEmptyArrayWithIndex=r.ApT=r.apSW=r.apS=r.bindW=r.bind=r.let=r.bindTo=r.Do=r.bracketW=r.bracket=r.taskify=r.chainIOEitherK=r.chainIOEitherKW=r.chainFirstTaskK=r.chainTaskK=r.fromTaskK=r.chainFirstIOK=r.chainIOK=r.fromIOK=r.fromEitherK=r.filterOrElseW=r.filterOrElse=void 0;var s=d(c),m=d(Wn),h=d(En),I=d(o),b=d(Pn);r.left=h.left(b.Pointed),r.right=h.right(b.Pointed),r.rightTask=h.rightF(b.Functor),r.leftTask=h.leftF(b.Functor),r.rightIO=(0,e.flow)(b.fromIO,r.rightTask),r.leftIO=(0,e.flow)(b.fromIO,r.leftTask),r.fromIO=r.rightIO,r.fromTask=r.rightTask,r.fromEither=b.of,r.fromIOEither=b.fromIO,r.fromTaskOption=function(n){return b.map(m.fromOption(n))},r.match=h.match(b.Functor),r.matchW=r.match,r.matchE=h.matchE(b.Monad),r.fold=r.matchE,r.matchEW=r.matchE,r.foldW=r.matchEW,r.getOrElse=h.getOrElse(b.Monad),r.getOrElseW=r.getOrElse,r.tryCatch=function(n,r){return function(){return l(void 0,void 0,void 0,(function(){var t;return p(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,n().then(I.right)];case 1:return[2,u.sent()];case 2:return t=u.sent(),[2,I.left(r(t))];case 3:return[2]}}))}))}},r.tryCatchK=function(n,t){return function(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];return(0,r.tryCatch)((function(){return n.apply(void 0,u)}),t)}},r.toUnion=h.toUnion(b.Functor),r.fromNullable=h.fromNullable(b.Pointed),r.fromNullableK=h.fromNullableK(b.Pointed),r.chainNullableK=h.chainNullableK(b.Monad),r.orElse=h.orElse(b.Monad),r.orElseW=r.orElse,r.tapError=(0,e.dual)(2,h.tapError(b.Monad)),r.orElseFirstIOK=function(n){return(0,r.tapError)((0,r.fromIOK)(n))},r.orElseFirstTaskK=function(n){return(0,r.tapError)((0,r.fromTaskK)(n))},r.orLeft=h.orLeft(b.Monad),r.swap=h.swap(b.Functor),r.fromTaskOptionK=function(n){var t=(0,r.fromTaskOption)(n);return function(n){return(0,e.flow)(n,t)}},r.chainTaskOptionKW=function(n){return function(t){return function(u){return(0,r.flatMap)(u,(0,r.fromTaskOptionK)(n)(t))}}},r.chainTaskOptionK=r.chainTaskOptionKW,r.fromIOEitherK=function(n){return(0,e.flow)(n,r.fromIOEither)};var R=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},U=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},O=function(n,t){return(0,r.flatMap)(n,(function(n){return(0,e.pipe)(t,(0,r.map)(n))}))},g=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))};function j(n,t){var u=(0,i.ap)(n,m.getApplicativeValidation(t));return{URI:r.URI,_E:void 0,map:R,ap:function(n,r){return(0,e.pipe)(n,u(r))},of:r.of}}function M(n){var t=h.altValidation(b.Monad,n);return{URI:r.URI,_E:void 0,map:R,alt:function(n,r){return(0,e.pipe)(n,t(r))}}}r.map=h.map(b.Functor),r.mapBoth=(0,e.dual)(3,h.mapBoth(b.Functor)),r.bimap=r.mapBoth,r.mapError=(0,e.dual)(2,h.mapError(b.Functor)),r.mapLeft=r.mapError,r.ap=h.ap(b.ApplyPar),r.apW=r.ap,r.flatMap=(0,e.dual)(2,h.flatMap(b.Monad)),r.flattenW=(0,r.flatMap)(e.identity),r.flatten=r.flattenW,r.alt=h.alt(b.Monad),r.altW=r.alt,r.of=r.right,r.throwError=r.left,r.URI="TaskEither",r.getApplicativeTaskValidation=j,r.getAltTaskValidation=M,r.getCompactable=function(n){var t=m.getCompactable(n);return{URI:r.URI,_E:void 0,compact:(0,xn.compact)(b.Functor,t),separate:(0,xn.separate)(b.Functor,t,m.Functor)}},r.getFilterable=function(n){var t=m.getFilterable(n),u=(0,r.getCompactable)(n),o=(0,qn.filter)(b.Functor,t),i=(0,qn.filterMap)(b.Functor,t),c=(0,qn.partition)(b.Functor,t),f=(0,qn.partitionMap)(b.Functor,t);return{URI:r.URI,_E:void 0,map:R,compact:u.compact,separate:u.separate,filter:function(n,r){return(0,e.pipe)(n,o(r))},filterMap:function(n,r){return(0,e.pipe)(n,i(r))},partition:function(n,r){return(0,e.pipe)(n,c(r))},partitionMap:function(n,r){return(0,e.pipe)(n,f(r))}}},r.Functor={URI:r.URI,map:R},r.as=(0,e.dual)(2,(0,a.as)(r.Functor)),r.asUnit=(0,a.asUnit)(r.Functor),r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.ApplyPar={URI:r.URI,map:R,ap:U},r.apFirst=(0,i.apFirst)(r.ApplyPar),r.apFirstW=r.apFirst,r.apSecond=(0,i.apSecond)(r.ApplyPar),r.apSecondW=r.apSecond,r.ApplicativePar={URI:r.URI,map:R,ap:U,of:r.of},r.ApplySeq={URI:r.URI,map:R,ap:O},r.ApplicativeSeq={URI:r.URI,map:R,ap:O,of:r.of},r.Chain={URI:r.URI,map:R,ap:U,chain:r.flatMap},r.Monad={URI:r.URI,map:R,ap:U,chain:r.flatMap,of:r.of},r.MonadIO={URI:r.URI,map:R,ap:U,chain:r.flatMap,of:r.of,fromIO:r.fromIO},r.MonadTask={URI:r.URI,map:R,ap:U,chain:r.flatMap,of:r.of,fromIO:r.fromIO,fromTask:r.fromTask},r.MonadThrow={URI:r.URI,map:R,ap:U,chain:r.flatMap,of:r.of,throwError:r.throwError},r.FromEither={URI:r.URI,fromEither:r.fromEither},r.FromIO={URI:r.URI,fromIO:r.fromIO},r.FromTask={URI:r.URI,fromIO:r.fromIO,fromTask:r.fromTask},r.tap=(0,e.dual)(2,s.tap(r.Chain)),r.tapEither=(0,e.dual)(2,(0,f.tapEither)(r.FromEither,r.Chain)),r.tapIO=(0,e.dual)(2,(0,kn.tapIO)(r.FromIO,r.Chain)),r.tapTask=(0,e.dual)(2,(0,An.tapTask)(r.FromTask,r.Chain)),r.Bifunctor={URI:r.URI,bimap:r.mapBoth,mapLeft:r.mapError},r.Alt={URI:r.URI,map:R,alt:g},r.fromOption=(0,f.fromOption)(r.FromEither),r.fromOptionK=(0,f.fromOptionK)(r.FromEither),r.chainOptionK=(0,f.chainOptionK)(r.FromEither,r.Chain),r.chainOptionKW=r.chainOptionK;var y={fromEither:r.FromEither.fromEither};r.liftNullable=I.liftNullable(y),r.liftOption=I.liftOption(y);var x={flatMap:r.flatMap},_={fromIO:r.FromIO.fromIO},W={fromTask:r.fromTask};r.flatMapNullable=I.flatMapNullable(y,x),r.flatMapOption=I.flatMapOption(y,x),r.flatMapEither=I.flatMapEither(y,x),r.flatMapIO=I.flatMapIO(_,x),r.flatMapTask=I.flatMapTask(W,x),r.flatMapIOEither=(0,e.dual)(2,(function(n,t){return(0,r.flatMap)(n,(0,r.fromIOEitherK)(t))})),r.flatMapTaskOption=(0,e.dual)(3,(function(n,t,u){return(0,r.flatMap)(n,(function(n){return(0,r.fromTaskOption)((function(){return u(n)}))(t(n))}))})),r.chainEitherK=r.flatMapEither,r.chainEitherKW=r.flatMapEither,r.chainFirstEitherK=r.tapEither,r.chainFirstEitherKW=r.tapEither,r.fromPredicate=(0,f.fromPredicate)(r.FromEither),r.filterOrElse=(0,f.filterOrElse)(r.FromEither,r.Chain),r.filterOrElseW=r.filterOrElse,r.fromEitherK=(0,f.fromEitherK)(r.FromEither),r.fromIOK=(0,kn.fromIOK)(r.FromIO),r.chainIOK=r.flatMapIO,r.chainFirstIOK=r.tapIO,r.fromTaskK=(0,An.fromTaskK)(r.FromTask),r.chainTaskK=r.flatMapTask,r.chainFirstTaskK=r.tapTask,r.chainIOEitherKW=r.flatMapIOEither,r.chainIOEitherK=r.flatMapIOEither,r.taskify=function(n){return function(){var r=Array.prototype.slice.call(arguments);return function(){return new Promise((function(t){n.apply(null,r.concat((function(n,r){return t(null!=n?I.left(n):I.right(r))})))}))}}},r.bracket=function(n,t,u){return(0,r.bracketW)(n,t,u)},r.bracketW=function(n,t,u){return(0,r.flatMap)(n,(function(n){return b.flatMap(t(n),(function(t){return(0,r.flatMap)(u(n,t),(function(){return b.of(t)}))}))}))},r.Do=(0,r.of)(I.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=s.bind(r.Chain),r.bindW=r.bind,r.apS=(0,i.apS)(r.ApplyPar),r.apSW=r.apS,r.ApT=(0,r.of)(I.emptyReadonlyArray),r.traverseReadonlyNonEmptyArrayWithIndex=function(n){return(0,e.flow)(b.traverseReadonlyNonEmptyArrayWithIndex(n),b.map(m.traverseReadonlyNonEmptyArrayWithIndex(e.SK)))},r.traverseReadonlyArrayWithIndex=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndex)(n);return function(n){return I.isNonEmpty(n)?t(n):r.ApT}},r.traverseReadonlyNonEmptyArrayWithIndexSeq=function(n){return function(r){return function(){return I.tail(r).reduce((function(r,t,u){return r.then((function(e){return I.isLeft(e)?r:n(u+1,t)().then((function(n){return I.isLeft(n)?n:(e.right.push(n.right),e)}))}))}),n(0,I.head(r))().then(m.map(I.singleton)))}}},r.traverseReadonlyArrayWithIndexSeq=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndexSeq)(n);return function(n){return I.isNonEmpty(n)?t(n):r.ApT}},r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex,r.traverseArray=function(n){return(0,r.traverseReadonlyArrayWithIndex)((function(r,t){return n(t)}))},r.sequenceArray=(0,r.traverseArray)(e.identity),r.traverseSeqArrayWithIndex=r.traverseReadonlyArrayWithIndexSeq,r.traverseSeqArray=function(n){return(0,r.traverseReadonlyArrayWithIndexSeq)((function(r,t){return n(t)}))},r.sequenceSeqArray=(0,r.traverseSeqArray)(e.identity),r.chain=r.flatMap,r.chainW=r.flatMap,r.chainFirst=r.tap,r.chainFirstW=r.tap,r.orElseFirst=r.tapError,r.orElseFirstW=r.tapError,r.taskEither={URI:r.URI,bimap:r.mapBoth,mapLeft:r.mapError,map:R,of:r.of,ap:U,chain:r.flatMap,alt:g,fromIO:r.fromIO,fromTask:r.fromTask,throwError:r.throwError},r.taskEitherSeq={URI:r.URI,bimap:r.mapBoth,mapLeft:r.mapError,map:R,of:r.of,ap:O,chain:r.flatMap,alt:g,fromIO:r.fromIO,fromTask:r.fromTask,throwError:r.throwError},r.getApplySemigroup=(0,i.getApplySemigroup)(r.ApplySeq),r.getApplyMonoid=(0,w.getApplicativeMonoid)(r.ApplicativeSeq),r.getSemigroup=function(n){return(0,i.getApplySemigroup)(b.ApplySeq)(m.getSemigroup(n))},r.getTaskValidation=function(n){var t=j(b.ApplicativePar,n),u=M(n);return{URI:r.URI,_E:void 0,map:R,ap:t.ap,of:r.of,chain:r.flatMap,bimap:r.mapBoth,mapLeft:r.mapError,alt:u.alt,fromIO:r.fromIO,fromTask:r.fromTask,throwError:r.throwError}}}));const{state:Ln}=y(Object.assign({fallbackStyles:"",pricePrefix:null,currencySign:null,apiPath:null,token:null,locale:"de-DE"},{trackingEnabled:!0})),zn=n=>({kind:"server",inner:n}),Nn={kind:"client",inner:"Token not exist or empty"},Sn={kind:"client",inner:"Api path empty or missing"},Cn=rn({concat:function(n,r){return n+r},empty:""}),Fn=()=>q(rn({concat:W}).concat(on(Ln.apiPath),on("https://api.vviinn.com")),K((()=>Sn))),$n=(Dn={method:{concat:(n,r)=>q(Cn.concat(on(n),on(r)),en((()=>"GET")))},body:{concat:function(n,r){return r}},headers:{concat:(n,r)=>{const t=new Headers;return void 0!==n&&n.forEach(((n,r)=>t.append(r,n))),void 0!==r&&r.forEach(((n,r)=>t.append(r,n))),t}}},{concat:function(n,r){var t={};for(var u in Dn)L.call(Dn,u)&&(t[u]=Dn[u].concat(n[u],r[u]));return t}});var Dn;const Hn=n=>({method:n}),Jn=C(Hn("POST")),Gn=H((([n,r])=>(n.set("Content-Type","application/json"),{headers:n,body:r}))),Bn=n=>n.status>=200&&n.status<300?Tn.right(n):Tn.left(n),Kn=$n,Vn=(n,r)=>([t,u])=>{const o=new URL(n,t),i=Kn.concat(u,r);return e.pipe(((n,r={})=>e.pipe(((n,r={method:"GET"})=>Tn.tryCatch((()=>fetch(n,r)),(n=>n)))(n,r),Tn.chain(Bn),Tn.chain((n=>function(n){return Tn.fromTask((()=>n.json()))}(n)))))(o.toString(),i),Tn.mapLeft(zn))},Qn=i.sequenceT(Wn.Apply),Xn=n=>(n=>0===n.length)(n)?S("entity is empty"):C(n),Yn=n=>q(n,("entity not exist",function(n){return null==n?S("entity not exist"):C(n)}),Y(Xn)),Zn=n=>n.length?`?${n.join("&")}`:"",nr=n=>n.split(";").map((n=>n?`excluded[]=${n}`:"")).join("&"),rr={equals:(n,r)=>n.class===r.class&&n.score===r.score&&n.rectangle.left===r.rectangle.left&&n.rectangle.top===r.rectangle.top&&n.rectangle.height===r.rectangle.height&&n.rectangle.width===r.rectangle.width},tr=(n,r,t,u)=>{const o="search/session",i=e.pipe(on(r),(f=()=>{const n=[];t&&n.push(t);const r=Zn(n);return`${o}${r}`},a=n=>{const r=[];n&&r.push(`campaign-id=${n}`),t&&r.push(t);const u=Zn(r);return`${o}${u}`},function(n){return un(n)?f():a(n.value)})),c=u?e.pipe(on(u),K((()=>Sn))):Fn();var f,a;return e.pipe(Qn(c,Jn),Rn,wn(Vn(i,n)))},ur=n=>e.pipe(Qn(Fn(),Jn),Rn,wn(Vn("text-search",n))),er=n=>e.pipe(Qn(Fn(),Jn),Rn,wn(Vn("product-listing-page",n)));var or;!function(n){n.eform="eform",n.etype="etype",n.form="form",n.href="href",n.method="method",n.accepts="accepts",n.produces="produces",n.rel="rel",n.type="type",n.value="value"}(or||(or={}));const ir=n=>"array"===n.type?n.value.map(ir):n.value,cr=(n,r)=>q(n.links,on,cn((n=>on(n[r])))),fr=n=>{return q(n,(r=n=>n.href,function(n){return un(n)?Z:nn(r(n.value))}),en((()=>null)));var r},ar=n=>r=>q(Qn(Fn(),C(Hn(n.method))),Rn,wn(Vn(n.href,r))),vr=n=>({x:0,y:0,width:n.width,height:n.height}),dr=n=>Object.assign({x:n.left,y:n.top},n),lr=n=>r=>({x:r.x*n.width,y:r.y*n.height,width:r.width*n.width,height:r.height*n.height}),pr=n=>({x:n.x+.5*n.width,y:n.y+.5*n.height});var sr;!function(n){n.desc="desc",n.eform="eform",n.enabled="enabled",n.etype="etype",n.form="form",n.label="label",n.max="max",n.maxlength="maxlength",n.maxsize="maxsize",n.min="min",n.minlength="minlength",n.minsize="minsize",n.mutable="mutable",n.name="name",n.options="options",n.pattern="pattern",n.placeholder="placeholder",n.required="required",n.secret="secret",n.type="type",n.value="value",n.visible="visible"}(sr||(sr={}));const mr=(n,r)=>{const t=new URLSearchParams(Object.entries(r));return[`${n.href}?${t.toString()}`,{method:"GET"}]},hr=(n,r)=>[n.href,{body:JSON.stringify(r),method:n.method,headers:new Headers({"Content-Type":"application/ion+json"})}],Ir=(n,r={})=>t=>e.pipe(Qn(Fn(),e.pipe(((n,r)=>e.pipe(((n,r)=>{const t=n.map((n=>n.name)),u=Object.keys(r),e=t.filter((n=>!u.includes(n)));return 0===e.length?C(r):S(`Data should contains fields: ${e.join(", ")}`)})(n.value,r),H((r=>n.rel.includes("query-form")?mr(n,r):hr(n,r)))))(n,r),B((n=>({kind:"app",inner:n}))))),Rn,wn((n=>{const r=n[0],[u,e]=n[1];return Vn(u,e)([r,t])}))),br=async n=>new Promise((r=>{const t=new FileReader;t.addEventListener("load",(()=>{r(t.result)})),t.readAsDataURL(n)})),Rr=i.sequenceT(_.Apply),Ur=n=>new Headers({Authorization:`Bearer ${n}`}),Or=n=>q(n,Yn,Wn.mapLeft((()=>Nn))),gr=n=>q(n,Or,Wn.map(Ur)),jr=(n,r)=>Qn(gr(n),Wn.right(JSON.stringify(r))),Mr=n=>{const r=new FormData;return r.append("image",n),r};const yr=["jpg","jpeg","png","webp"],wr={kind:"client",inner:"File format not supported"},xr=n=>{const r=n.type.split("/")[1],t=(u=t=>t===r?_.some(n):_.none,function(n){for(var r=0;r<n.length;r++){var t=u(n[r]);if("Some"===t._tag)return t}return A})(yr);var u;return e.pipe(t,Wn.fromOption((()=>wr)))},_r={kind:"app",inner:"File doesnt exist"},Wr=n=>()=>new Promise((r=>{const t=new FileReader,u=new Image;t.onload=n=>{u.src=n.target.result},u.onload=()=>r(u),t.readAsDataURL(n)}));var Er=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.copy=void 0,r.copy=(n,r,t=0,u=0,e=n.width-t,o=n.height-u,i=0,c=0)=>{if(t|=0,u|=0,o|=0,i|=0,c|=0,(e|=0)<=0||o<=0)return;const f=new Uint32Array(n.data.buffer),a=new Uint32Array(r.data.buffer);for(let v=0;v<o;v++){const o=u+v;if(o<0||o>=n.height)continue;const d=c+v;if(!(d<0||d>=r.height))for(let u=0;u<e;u++){const e=t+u;if(e<0||e>=n.width)continue;const c=i+u;c<0||c>=r.width||(a[d*r.width+c]=f[o*n.width+e])}}}})),qr=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CreateImageFactory=(n=[0,0,0,0],r=4)=>{if(r=Math.floor(r),isNaN(r)||r<1)throw TypeError("channels should be a positive non-zero number");if(!("length"in n)||n.length<r)throw TypeError(`fill should be iterable with at least ${r} members`);const t=(n=new Uint8ClampedArray(n).slice(0,r)).every((n=>0===n));return(u,e,o)=>{if(void 0===u||void 0===e)throw TypeError("Not enough arguments");if(u=Math.floor(u),e=Math.floor(e),isNaN(u)||u<1||isNaN(e)||e<1)throw TypeError("Index or size is negative or greater than the allowed amount");const i=u*e*r;if(void 0===o&&(o=new Uint8ClampedArray(i)),o instanceof Uint8ClampedArray){if(o.length!==i)throw TypeError("Index or size is negative or greater than the allowed amount");if(!t)for(let t=0;t<e;t++)for(let e=0;e<u;e++){const i=(t*u+e)*r;for(let t=0;t<r;t++)o[i+t]=n[t]}return{get width(){return u},get height(){return e},get data(){return o}}}throw TypeError("Expected data to be Uint8ClampedArray or undefined")}},r.createImage=r.CreateImageFactory()})),kr=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.filters=void 0;const t=(n,r)=>{if(n<=-r||n>=r)return 0;if(0==n)return 0;const t=n*Math.PI;return Math.sin(t)/t*Math.sin(t/r)/(t/r)},u=n=>Math.round(16383*n);r.filters=(n,r,e,o,i)=>{const c=i?2:3,f=1/e,a=Math.min(1,e),v=c/a,d=Math.floor(2*(v+1)),l=new Int16Array((d+2)*r);let p=0;for(let e=0;e<r;e++){const i=(e+.5)*f+o,d=Math.max(0,Math.floor(i-v)),s=Math.min(n-1,Math.ceil(i+v)),m=s-d+1,h=new Float32Array(m),I=new Int16Array(m);let b=0,R=0;for(let n=d;n<=s;n++){const r=t((n+.5-i)*a,c);b+=r,h[R]=r,R++}let U=0;for(let n=0;n<h.length;n++){const r=h[n]/b;U+=r,I[n]=u(r)}I[r>>1]+=u(1-U);let O=0;for(;O<I.length&&0===I[O];)O++;let g=I.length-1;for(;g>0&&0===I[g];)g--;const j=g-O+1;l[p++]=d+O,l[p++]=j,l.set(I.subarray(O,g+1),p),p+=j}return l}})),Ar=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.convolve=void 0,r.convolve=(n,r,t,u,e,o)=>{let i=0,c=0;for(let f=0;f<u;f++){let a=0;for(let t=0;t<e;t++){let t=i+4*o[a++]|0,e=0,f=0,v=0,d=0;for(let r=o[a++];r>0;r--){const r=o[a++];e=e+r*n[t]|0,f=f+r*n[t+1]|0,v=v+r*n[t+2]|0,d=d+r*n[t+3]|0,t=t+4|0}r[c]=e+8192>>14,r[c+1]=f+8192>>14,r[c+2]=v+8192>>14,r[c+3]=d+8192>>14,c=c+4*u|0}c=4*(f+1)|0,i=(f+1)*t*4|0}}})),Pr=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lanczos2=r.lanczos=void 0;const t=(n,r,t=!1)=>{const u=r.height/n.height,e=kr.filters(n.width,r.width,r.width/n.width,0,t),o=kr.filters(n.height,r.height,u,0,t),i=new Uint8ClampedArray(r.width*n.height*4);Ar.convolve(n.data,i,n.width,n.height,r.width,e),Ar.convolve(i,r.data,n.height,r.width,r.height,o)};r.lanczos=(n,r,u=0,e=0,o=n.width-u,i=n.height-e,c=0,f=0,a=r.width-c,v=r.height-f)=>{if(e|=0,i|=0,c|=0,f|=0,a|=0,v|=0,(o|=0)<=0||i<=0||a<=0||v<=0)return;if(0==(u|=0)&&0===e&&o===n.width&&i===n.height&&0===c&&0===f&&a===r.width&&v===r.height)return void t(n,r);const d=qr.createImage(o,i),l=qr.createImage(a,v);Er.copy(n,d,u,e),t(d,l),Er.copy(l,r,0,0,l.width,l.height,c,f)},r.lanczos2=(n,r,u=0,e=0,o=n.width-u,i=n.height-e,c=0,f=0,a=r.width-c,v=r.height-f)=>{if(e|=0,i|=0,c|=0,f|=0,a|=0,v|=0,(o|=0)<=0||i<=0||a<=0||v<=0)return;if(0==(u|=0)&&0===e&&o===n.width&&i===n.height&&0===c&&0===f&&a===r.width&&v===r.height)return void t(n,r,!0);const d=qr.createImage(o,i),l=qr.createImage(a,v);Er.copy(n,d,u,e),t(d,l,!0),Er.copy(l,r,0,0,l.width,l.height,c,f)}}));const Tr=n=>({kind:"height",size:n}),Lr=d.contramap((n=>n.size))(h.Ord),zr=O.sort(Lr),Nr=O.sort({equals:(n,r)=>n.kind===r.kind,compare:(n,r)=>n.kind===r.kind?0:"width"===n.kind?-1:1}),Sr=n=>r=>{const t=zr(r),u=(n=>{const[r,t]=n;return r.size/t.size})(t),e=Object.assign(Object.assign({},t[0]),{size:n*u}),o=Object.assign(Object.assign({},t[1]),{size:n});return Nr([o,e])},Cr=n=>{const{naturalWidth:r,naturalHeight:t}=n;return[(u=r,{kind:"width",size:u}),Tr(t)];var u},Fr=()=>{const n=document.createElement("canvas"),r=n.getContext("2d");return[n,r]},$r=async n=>{const r=await fetch(n),t=await r.blob();return new File([t],"image",{type:t.type,lastModified:Date.now()})},Dr=n=>()=>new Promise((async r=>{const t=await fetch(n),u=await t.blob();r(new File([u],"image",{type:u.type,lastModified:Date.now()}))})),Hr=(n,r)=>n.naturalWidth>r?((n,r)=>{const t=Sr(n),[u,e]=Fr(),o=Cr(r),[i,c]=t(o).map((n=>n.size)),f=new ImageData(i,c),a=(n=>{const{naturalWidth:r,naturalHeight:t}=n,[u,e]=Fr();return u.width=r,u.height=t,e.drawImage(n,0,0),e.getImageData(0,0,r,t)})(r);return u.width=i,u.height=c,Pr.lanczos(a,f),e.putImageData(f,0,0),u.toDataURL()})(r,n):(n=>{const r=document.createElement("canvas"),{naturalWidth:t,naturalHeight:u}=n,e=r.getContext("2d");return r.width=t,r.height=u,e.drawImage(n,0,0,t,u),r.toDataURL()})(n),Jr=n=>r=>e.pipe(r,Wr,Pn.map((r=>Hr(r,n))),Pn.chain(Dr)),Gr=n=>{const r=(new TextEncoder).encode(n);return btoa(String.fromCharCode.apply(null,r))},Br=n=>q(n,gr,H((n=>({headers:n})))),{state:Kr,onChange:Vr}=y({campaignId:"",excluded:"",selfSearchId:null,results:[],sourceProduct:null,filters:[],textSearchFilters:[],detectedObjects:[],objectDetectionInProgress:!1,resultLoaded:!1,resultViewed:!1,imageWidth:500,image:_.none,imageUrl:_.none,imageBounds:_.none,searchArea:_.none,serverError:!1,loading:!1}),Qr=Kr,Xr=async n=>{var r,t;Kr.selfSearchId=q(cr(n,"self"),fr),Kr.results=n.value,Kr.filters=(t=ir(n.filters),Object.entries(t).map((([n,r])=>({name:n,filters:r})))),Kr.rectangleSearchForm=n.searchArea,Kr.resetCategoryLink=null===(r=n.links)||void 0===r?void 0:r.clearFilters,Kr.loading=!1},Yr=n=>q(Br(Kr.token),Rn,wn(ar(n))),Zr=async()=>{Kr.loading=!0,q(Rr(Kr.imageBounds,Kr.searchArea),_.map((async([n,r])=>{const t=(u=n,n=>({x:n.x/u.width,y:n.y/u.height,width:n.width/u.width,height:n.height/u.height}))(r);var u;const e={width:t.width,height:t.height,left:t.x,top:t.y};return await q(Br(Kr.token),Rn,wn(Ir(Kr.rectangleSearchForm,e)),Un(Xr))()})))},nt=n=>{Kr.searchType="image",Kr.loading=!0;const r=Mr(n);return q(Qn(gr(Kr.token),C(r)),H((([n,r])=>({headers:n,body:r}))),Rn,yn((n=>tr(n,Kr.campaignId,Kr.excluded))),Un((n=>(Xr(n),(async n=>{Kr.objectDetectionInProgress=!0;const r={kind:"server",inner:"Can not get a link for objects detection"};await q(cr(n,"detectedObjects"),jn((()=>r)),yn(Yr),Un((n=>Kr.detectedObjects=ir(n))))(),Kr.objectDetectionInProgress=!1})(n),Kr.loading=!1,n))),On((n=>(Kr.serverError=!0,Kr.loading=!1,n))))},rt=async(n,r,t)=>{Kr.searchType="text",Kr.loading=!0;const u=Object.assign(Object.assign({query:r},t?{dynamicFilters:t}:{}),Kr.campaignId.length?{campaign:Kr.campaignId}:{});return q(jr(n,u),Gn,Rn,yn((n=>ur(n))),Un((n=>{var r,t,u,e,o;return Kr.results=null!==(t=null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.products)&&void 0!==t?t:[],Kr.textSearchFilters=null!==(o=null===(e=null===(u=null==n?void 0:n.data)||void 0===u?void 0:u.interactions)||void 0===e?void 0:e.dynamicFilters)&&void 0!==o?o:[],Kr.loading=!1,n})),On((n=>(Kr.serverError=!0,Kr.loading=!1,n))))()},tt=async(n,r,t,u)=>{const e=Object.assign(Object.assign({query:r},u?{resultsCount:u}:{}),t?{dynamicFilters:t}:{});return q(jr(n,e),Gn,Rn,yn(ur))()},ut=async(n,r)=>{return await q(Br(n),Rn,wn(ar((t=r,{href:t}))),Un((n=>n.value)))();var t},et=async(n,r,t,u)=>{const e="product_type"===r||"google_product_category"===r?q(t,(n=>n.split(" > ").join(">")),Gr,(n=>n.split("=")[0])):t,o=Object.assign(Object.assign({},u?{resultsCount:u}:{}),{staticFilters:{included:[{column:r,values:[e]}]}});return q(jr(n,o),Gn,Rn,yn(er))()};Vr("activeIonLink",(async n=>{const r=n||Kr.resetCategoryLink;r&&(Kr.loading=!0,await q(Br(Kr.token),Rn,wn(ar(r)),Un(Xr),On((n=>({kind:"network error",inner:n}))))())})),Vr("serverError",(()=>{Kr.loading=!1}));const ot=n=>{Qr.image=_.some(n),Qr.imageUrl=_.some(n.src)},it=async(n,r=!1,t,u)=>{const o=(n=>e.pipe(n,_.fromNullable,Wn.fromOption((()=>_r)),Wn.chain(xr)))(n),i=Jr(500),c=q(o,Rn,Mn(i));if(r)return await q(c,yn((()=>((n,r,t)=>{const u=Mr(n);return q(Qn(gr(r),C(u)),H((([n,r])=>({headers:n,body:r}))),Rn,yn((n=>tr(n,null,null,t))))})(n,t,u))))();const f=await q(c,yn(nt))();await q(c,Mn(Wr),Un(ot))();const a=Jr(1024),v=q(o,Rn,Mn(a)),d=await v();return q(Qn(f,d),H((([n,r])=>(async(n,r)=>{const t={image:await(async n=>({name:n.name,mediaType:n.type,value:await br(n)}))(r)},u=n.uploadHighResolutionImage;await q(Br(Kr.token),Rn,wn(Ir(u,t)))()})(n,r)))),f};export{G as A,Sr as B,ut as C,X as D,Wn as E,rt as F,tt as G,et as H,m as N,_ as O,p as S,Tn as T,e as _,O as a,Jn as b,wn as c,Ln as d,t as e,Rn as f,Fn as g,L as h,u as i,nr as j,dr as k,ir as l,Vn as m,lr as n,pr as o,q as p,Zr as q,rr as r,Qr as s,E as t,$r as u,it as v,Q as w,Rr as x,vr as y,Cr as z}
|
|
1
|
+
import{a as n,f as r}from"./p-1c863deb.js";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(n,r,t){return n(t={path:r,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},t.exports),t.exports}var e=u((function(n,r){var u=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};function e(n){return n}function o(n){return function(){return n}}function i(n,r,t,u,e,o,i,c,f){switch(arguments.length){case 1:return n;case 2:return function(){return r(n.apply(this,arguments))};case 3:return function(){return t(r(n.apply(this,arguments)))};case 4:return function(){return u(t(r(n.apply(this,arguments))))};case 5:return function(){return e(u(t(r(n.apply(this,arguments)))))};case 6:return function(){return o(e(u(t(r(n.apply(this,arguments))))))};case 7:return function(){return i(o(e(u(t(r(n.apply(this,arguments)))))))};case 8:return function(){return c(i(o(e(u(t(r(n.apply(this,arguments))))))))};case 9:return function(){return f(c(i(o(e(u(t(r(n.apply(this,arguments)))))))))}}}function c(){throw new Error("Called `absurd` function which should be uncallable")}Object.defineProperty(r,"__esModule",{value:!0}),r.dual=r.getEndomorphismMonoid=r.not=r.SK=r.hole=r.pipe=r.untupled=r.tupled=r.absurd=r.decrement=r.increment=r.tuple=r.flow=r.flip=r.constVoid=r.constUndefined=r.constNull=r.constFalse=r.constTrue=r.constant=r.unsafeCoerce=r.identity=r.apply=r.getRing=r.getSemiring=r.getMonoid=r.getSemigroup=r.getBooleanAlgebra=void 0,r.getBooleanAlgebra=function(n){return function(){return{meet:function(r,t){return function(u){return n.meet(r(u),t(u))}},join:function(r,t){return function(u){return n.join(r(u),t(u))}},zero:function(){return n.zero},one:function(){return n.one},implies:function(r,t){return function(u){return n.implies(r(u),t(u))}},not:function(r){return function(t){return n.not(r(t))}}}}},r.getSemigroup=function(n){return function(){return{concat:function(r,t){return function(u){return n.concat(r(u),t(u))}}}}},r.getMonoid=function(n){var t=(0,r.getSemigroup)(n);return function(){return{concat:t().concat,empty:function(){return n.empty}}}},r.getSemiring=function(n){return{add:function(r,t){return function(u){return n.add(r(u),t(u))}},zero:function(){return n.zero},mul:function(r,t){return function(u){return n.mul(r(u),t(u))}},one:function(){return n.one}}},r.getRing=function(n){var t=(0,r.getSemiring)(n);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(r,t){return function(u){return n.sub(r(u),t(u))}}}},r.apply=function(n){return function(r){return r(n)}},r.identity=e,r.unsafeCoerce=e,r.constant=o,r.constTrue=o(!0),r.constFalse=o(!1),r.constNull=o(null),r.constUndefined=o(void 0),r.constVoid=r.constUndefined,r.flip=function(n){return function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return r.length>1?n(r[1],r[0]):function(t){return n(t)(r[0])}}},r.flow=i,r.tuple=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n},r.increment=function(n){return n+1},r.decrement=function(n){return n-1},r.absurd=c,r.tupled=function(n){return function(r){return n.apply(void 0,r)}},r.untupled=function(n){return function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return n(r)}},r.pipe=function(n,r,t,u,e,o,i,c,f){switch(arguments.length){case 1:return n;case 2:return r(n);case 3:return t(r(n));case 4:return u(t(r(n)));case 5:return e(u(t(r(n))));case 6:return o(e(u(t(r(n)))));case 7:return i(o(e(u(t(r(n))))));case 8:return c(i(o(e(u(t(r(n)))))));case 9:return f(c(i(o(e(u(t(r(n))))))));default:for(var a=arguments[0],v=1;v<arguments.length;v++)a=arguments[v](a);return a}},r.hole=c,r.SK=function(n,r){return r},r.not=function(n){return function(r){return!n(r)}},r.getEndomorphismMonoid=function(){return{concat:function(n,r){return i(n,r)},empty:e}},r.dual=function(n,r){var t="number"==typeof n?function(r){return r.length>=n}:n;return function(){var n=Array.from(arguments);return t(arguments)?r.apply(this,n):function(t){return r.apply(void 0,u([t],n,!1))}}}})),o=u((function(n,r){var u=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};Object.defineProperty(r,"__esModule",{value:!0}),r.flatMapReader=r.flatMapTask=r.flatMapIO=r.flatMapEither=r.flatMapOption=r.flatMapNullable=r.liftOption=r.liftNullable=r.fromReadonlyNonEmptyArray=r.has=r.emptyRecord=r.emptyReadonlyArray=r.tail=r.head=r.isNonEmpty=r.singleton=r.right=r.left=r.isRight=r.isLeft=r.some=r.none=r.isSome=r.isNone=void 0,r.isNone=function(n){return"None"===n._tag},r.isSome=function(n){return"Some"===n._tag},r.none={_tag:"None"},r.some=function(n){return{_tag:"Some",value:n}},r.isLeft=function(n){return"Left"===n._tag},r.isRight=function(n){return"Right"===n._tag},r.left=function(n){return{_tag:"Left",left:n}},r.right=function(n){return{_tag:"Right",right:n}},r.singleton=function(n){return[n]},r.isNonEmpty=function(n){return n.length>0},r.head=function(n){return n[0]},r.tail=function(n){return n.slice(1)},r.emptyReadonlyArray=[],r.emptyRecord={},r.has=Object.prototype.hasOwnProperty,r.fromReadonlyNonEmptyArray=function(n){return u([n[0]],n.slice(1),!0)},r.liftNullable=function(n){return function(t,u){return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var i=t.apply(void 0,e);return n.fromEither(null==i?(0,r.left)(u.apply(void 0,e)):(0,r.right)(i))}}},r.liftOption=function(n){return function(t,u){return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var i=t.apply(void 0,e);return n.fromEither((0,r.isNone)(i)?(0,r.left)(u.apply(void 0,e)):(0,r.right)(i.value))}}},r.flatMapNullable=function(n,t){return(0,e.dual)(3,(function(u,e,o){return t.flatMap(u,(0,r.liftNullable)(n)(e,o))}))},r.flatMapOption=function(n,t){return(0,e.dual)(3,(function(u,e,o){return t.flatMap(u,(0,r.liftOption)(n)(e,o))}))},r.flatMapEither=function(n,r){return(0,e.dual)(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromEither(u(r))}))}))},r.flatMapIO=function(n,r){return(0,e.dual)(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromIO(u(r))}))}))},r.flatMapTask=function(n,r){return(0,e.dual)(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromTask(u(r))}))}))},r.flatMapReader=function(n,r){return(0,e.dual)(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromReader(u(r))}))}))}})),i=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),i=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),c=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return i(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.sequenceS=r.sequenceT=r.getApplySemigroup=r.apS=r.apSecond=r.apFirst=r.ap=void 0;var f=c(o);function a(n,r,t){return function(u){for(var e=Array(t.length+1),o=0;o<t.length;o++)e[o]=t[o];return e[t.length]=u,0===r?n.apply(null,e):a(n,r-1,e)}}r.ap=function(n,r){return function(t){return function(u){return n.ap(n.map(u,(function(n){return function(t){return r.ap(n,t)}})),t)}}},r.apFirst=function(n){return function(r){return function(t){return n.ap(n.map(t,(function(n){return function(){return n}})),r)}}},r.apSecond=function(n){return function(r){return function(t){return n.ap(n.map(t,(function(){return function(n){return n}})),r)}}},r.apS=function(n){return function(r,t){return function(u){return n.ap(n.map(u,(function(n){return function(t){var u;return Object.assign({},n,((u={})[r]=t,u))}})),t)}}},r.getApplySemigroup=function(n){return function(r){return{concat:function(t,u){return n.ap(n.map(t,(function(n){return function(t){return r.concat(n,t)}})),u)}}}};var v={1:function(n){return[n]},2:function(n){return function(r){return[n,r]}},3:function(n){return function(r){return function(t){return[n,r,t]}}},4:function(n){return function(r){return function(t){return function(u){return[n,r,t,u]}}}},5:function(n){return function(r){return function(t){return function(u){return function(e){return[n,r,t,u,e]}}}}}};r.sequenceT=function(n){return function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var u=r.length,o=function(n){return f.has.call(v,n)||(v[n]=a(e.tuple,n-1,[])),v[n]}(u),i=n.map(r[0],o),c=1;c<u;c++)i=n.ap(i,r[c]);return i}},r.sequenceS=function(n){return function(r){for(var t=Object.keys(r),u=t.length,e=function(n){var r=n.length;switch(r){case 1:return function(r){var t;return(t={})[n[0]]=r,t};case 2:return function(r){return function(t){var u;return(u={})[n[0]]=r,u[n[1]]=t,u}};case 3:return function(r){return function(t){return function(u){var e;return(e={})[n[0]]=r,e[n[1]]=t,e[n[2]]=u,e}}};case 4:return function(r){return function(t){return function(u){return function(e){var o;return(o={})[n[0]]=r,o[n[1]]=t,o[n[2]]=u,o[n[3]]=e,o}}}};case 5:return function(r){return function(t){return function(u){return function(e){return function(o){var i;return(i={})[n[0]]=r,i[n[1]]=t,i[n[2]]=u,i[n[3]]=e,i[n[4]]=o,i}}}}};default:return a((function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];for(var e={},o=0;o<r;o++)e[n[o]]=t[o];return e}),r-1,[])}}(t),o=n.map(r[t[0]],e),i=1;i<u;i++)o=n.ap(o,r[t[i]]);return o}}})),c=u((function(n,r){function t(n){return function(r,t){return n.chain(r,(function(r){return n.map(t(r),(function(){return r}))}))}}Object.defineProperty(r,"__esModule",{value:!0}),r.bind=r.tap=r.chainFirst=void 0,r.chainFirst=function(n){var r=t(n);return function(n){return function(t){return r(t,n)}}},r.tap=t,r.bind=function(n){return function(r,t){return function(u){return n.chain(u,(function(u){return n.map(t(u),(function(n){var t;return Object.assign({},u,((t={})[r]=n,t))}))}))}}}})),f=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),i=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),f=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return i(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.tapEither=r.filterOrElse=r.chainFirstEitherK=r.chainEitherK=r.fromEitherK=r.chainOptionK=r.fromOptionK=r.fromPredicate=r.fromOption=void 0;var a=f(o);function v(n){return function(r){return function(t){return n.fromEither(a.isNone(t)?a.left(r()):a.right(t.value))}}}function d(n){var r=v(n);return function(n){var t=r(n);return function(n){return(0,e.flow)(n,t)}}}function l(n){return function(r){return(0,e.flow)(r,n.fromEither)}}function p(n,r){var t=l(n),u=(0,c.tap)(r);return function(n,r){return u(n,t(r))}}r.fromOption=v,r.fromPredicate=function(n){return function(r,t){return function(u){return n.fromEither(r(u)?a.right(u):a.left(t(u)))}}},r.fromOptionK=d,r.chainOptionK=function(n,r){var t=d(n);return function(n){var u=t(n);return function(n){return function(t){return r.chain(t,u(n))}}}},r.fromEitherK=l,r.chainEitherK=function(n,r){var t=l(n);return function(n){return function(u){return r.chain(u,t(n))}}},r.chainFirstEitherK=function(n,r){var t=p(n,r);return function(n){return function(r){return t(r,n)}}},r.filterOrElse=function(n,r){return function(t,u){return function(e){return r.chain(e,(function(r){return n.fromEither(t(r)?a.right(r):a.left(u(r)))}))}}},r.tapEither=p})),a=u((function(n,r){function t(n,r){return function(t){return function(u){return n.map(u,(function(n){return r.map(n,t)}))}}}function u(n){return function(r,t){return n.map(r,(function(){return t}))}}Object.defineProperty(r,"__esModule",{value:!0}),r.asUnit=r.as=r.getFunctorComposition=r.let=r.bindTo=r.flap=r.map=void 0,r.map=t,r.flap=function(n){return function(r){return function(t){return n.map(t,(function(n){return n(r)}))}}},r.bindTo=function(n){return function(r){return function(t){return n.map(t,(function(n){var t;return(t={})[r]=n,t}))}}},r.let=function(n){return function(r,t){return function(u){return n.map(u,(function(n){var u;return Object.assign({},n,((u={})[r]=t(n),u))}))}}},r.getFunctorComposition=function(n,r){var u=t(n,r);return{map:function(n,r){return(0,e.pipe)(n,u(r))}}},r.as=u,r.asUnit=function(n){var r=u(n);return function(n){return r(n,void 0)}}})),v=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.eqDate=r.eqNumber=r.eqString=r.eqBoolean=r.eq=r.strictEqual=r.getStructEq=r.getTupleEq=r.Contravariant=r.getMonoid=r.getSemigroup=r.eqStrict=r.URI=r.contramap=r.tuple=r.struct=r.fromEquals=void 0,r.fromEquals=function(n){return{equals:function(r,t){return r===t||n(r,t)}}},r.struct=function(n){return(0,r.fromEquals)((function(r,t){for(var u in n)if(!n[u].equals(r[u],t[u]))return!1;return!0}))},r.tuple=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0,r.fromEquals)((function(r,t){return n.every((function(n,u){return n.equals(r[u],t[u])}))}))},r.contramap=function(n){return function(t){return(0,r.fromEquals)((function(r,u){return t.equals(n(r),n(u))}))}},r.URI="Eq",r.eqStrict={equals:function(n,r){return n===r}};var t={equals:function(){return!0}};r.getSemigroup=function(){return{concat:function(n,t){return(0,r.fromEquals)((function(r,u){return n.equals(r,u)&&t.equals(r,u)}))}}},r.getMonoid=function(){return{concat:(0,r.getSemigroup)().concat,empty:t}},r.Contravariant={URI:r.URI,contramap:function(n,t){return(0,e.pipe)(n,(0,r.contramap)(t))}},r.getTupleEq=r.tuple,r.getStructEq=r.struct,r.strictEqual=r.eqStrict.equals,r.eq=r.Contravariant,r.eqBoolean=r.eqStrict,r.eqString=r.eqStrict,r.eqNumber=r.eqStrict,r.eqDate={equals:function(n,r){return n.valueOf()===r.valueOf()}}})),d=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.ordDate=r.ordNumber=r.ordString=r.ordBoolean=r.ord=r.getDualOrd=r.getTupleOrd=r.between=r.clamp=r.max=r.min=r.geq=r.leq=r.gt=r.lt=r.equals=r.trivial=r.Contravariant=r.getMonoid=r.getSemigroup=r.URI=r.contramap=r.reverse=r.tuple=r.fromCompare=r.equalsDefault=void 0,r.equalsDefault=function(n){return function(r,t){return r===t||0===n(r,t)}},r.fromCompare=function(n){return{equals:(0,r.equalsDefault)(n),compare:function(r,t){return r===t?0:n(r,t)}}},r.tuple=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return(0,r.fromCompare)((function(r,t){for(var u=0;u<n.length-1;u++){var e=n[u].compare(r[u],t[u]);if(0!==e)return e}return n[u].compare(r[u],t[u])}))},r.reverse=function(n){return(0,r.fromCompare)((function(r,t){return n.compare(t,r)}))},r.contramap=function(n){return function(t){return(0,r.fromCompare)((function(r,u){return t.compare(n(r),n(u))}))}},r.URI="Ord",r.getSemigroup=function(){return{concat:function(n,t){return(0,r.fromCompare)((function(r,u){var e=n.compare(r,u);return 0!==e?e:t.compare(r,u)}))}}},r.getMonoid=function(){return{concat:(0,r.getSemigroup)().concat,empty:(0,r.fromCompare)((function(){return 0}))}},r.Contravariant={URI:r.URI,contramap:function(n,t){return(0,e.pipe)(n,(0,r.contramap)(t))}},r.trivial={equals:e.constTrue,compare:(0,e.constant)(0)},r.equals=function(n){return function(r){return function(t){return t===r||0===n.compare(t,r)}}},r.lt=function(n){return function(r,t){return-1===n.compare(r,t)}},r.gt=function(n){return function(r,t){return 1===n.compare(r,t)}},r.leq=function(n){return function(r,t){return 1!==n.compare(r,t)}},r.geq=function(n){return function(r,t){return-1!==n.compare(r,t)}},r.min=function(n){return function(r,t){return r===t||n.compare(r,t)<1?r:t}},r.max=function(n){return function(r,t){return r===t||n.compare(r,t)>-1?r:t}},r.clamp=function(n){var t=(0,r.min)(n),u=(0,r.max)(n);return function(n,r){return function(e){return u(t(e,r),n)}}},r.between=function(n){var t=(0,r.lt)(n),u=(0,r.gt)(n);return function(n,r){return function(e){return!t(e,n)&&!u(e,r)}}},r.getTupleOrd=r.tuple,r.getDualOrd=r.reverse,r.ord=r.Contravariant;var t={equals:v.eqStrict.equals,compare:function(n,r){return n<r?-1:n>r?1:0}};r.ordBoolean=t,r.ordString=t,r.ordNumber=t,r.ordDate=(0,e.pipe)(r.ordNumber,(0,r.contramap)((function(n){return n.valueOf()})))})),l=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.concatAll=r.endo=r.filterSecond=r.filterFirst=r.reverse=void 0,r.reverse=function(n){return{concat:function(r,t){return n.concat(t,r)}}},r.filterFirst=function(n){return function(r){return{concat:function(t,u){return n(t)?r.concat(t,u):u}}}},r.filterSecond=function(n){return function(r){return{concat:function(t,u){return n(u)?r.concat(t,u):t}}}},r.endo=function(n){return function(r){return{concat:function(t,u){return r.concat(n(t),n(u))}}}},r.concatAll=function(n){return function(r){return function(t){return t.reduce((function(r,t){return n.concat(r,t)}),r)}}}})),p=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),i=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),c=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return i(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.semigroupProduct=r.semigroupSum=r.semigroupString=r.getFunctionSemigroup=r.semigroupAny=r.semigroupAll=r.fold=r.getIntercalateSemigroup=r.getMeetSemigroup=r.getJoinSemigroup=r.getDualSemigroup=r.getStructSemigroup=r.getTupleSemigroup=r.getFirstSemigroup=r.getLastSemigroup=r.getObjectSemigroup=r.semigroupVoid=r.concatAll=r.last=r.first=r.intercalate=r.tuple=r.struct=r.reverse=r.constant=r.max=r.min=void 0;var f=c(o),a=c(l),v=c(d);r.min=function(n){return{concat:v.min(n)}},r.max=function(n){return{concat:v.max(n)}},r.constant=function(n){return{concat:function(){return n}}},r.reverse=a.reverse,r.struct=function(n){return{concat:function(r,t){var u={};for(var e in n)f.has.call(n,e)&&(u[e]=n[e].concat(r[e],t[e]));return u}}},r.tuple=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return{concat:function(r,t){return n.map((function(n,u){return n.concat(r[u],t[u])}))}}},r.intercalate=function(n){return function(r){return{concat:function(t,u){return r.concat(t,r.concat(n,u))}}}},r.first=function(){return{concat:e.identity}},r.last=function(){return{concat:function(n,r){return r}}},r.concatAll=a.concatAll,r.semigroupVoid=(0,r.constant)(void 0),r.getObjectSemigroup=function(){return{concat:function(n,r){return Object.assign({},n,r)}}},r.getLastSemigroup=r.last,r.getFirstSemigroup=r.first,r.getTupleSemigroup=r.tuple,r.getStructSemigroup=r.struct,r.getDualSemigroup=r.reverse,r.getJoinSemigroup=r.max,r.getMeetSemigroup=r.min,r.getIntercalateSemigroup=r.intercalate,r.fold=function(n){var t=(0,r.concatAll)(n);return function(n,r){return void 0===r?t(n):t(n)(r)}},r.semigroupAll={concat:function(n,r){return n&&r}},r.semigroupAny={concat:function(n,r){return n||r}},r.getFunctionSemigroup=e.getSemigroup,r.semigroupString={concat:function(n,r){return n+r}},r.semigroupSum={concat:function(n,r){return n+r}},r.semigroupProduct={concat:function(n,r){return n*r}}})),s=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),f=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),l=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return f(r,n),r},s=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};Object.defineProperty(r,"__esModule",{value:!0}),r.reduceRight=r.foldMap=r.reduce=r.mapWithIndex=r.map=r.flatten=r.duplicate=r.extend=r.flatMap=r.ap=r.alt=r.altW=r.of=r.chunksOf=r.splitAt=r.chop=r.chainWithIndex=r.intersperse=r.prependAll=r.unzip=r.zip=r.zipWith=r.modifyAt=r.updateAt=r.sort=r.groupBy=r.group=r.reverse=r.concat=r.concatW=r.fromArray=r.unappend=r.unprepend=r.range=r.replicate=r.makeBy=r.fromReadonlyArray=r.rotate=r.union=r.sortBy=r.uniq=r.unsafeUpdateAt=r.unsafeInsertAt=r.append=r.appendW=r.prepend=r.prependW=r.isOutOfBound=r.isNonEmpty=r.empty=void 0,r.groupSort=r.chain=r.intercalate=r.updateLast=r.modifyLast=r.updateHead=r.modifyHead=r.matchRight=r.matchLeft=r.concatAll=r.max=r.min=r.init=r.last=r.tail=r.head=r.apS=r.bind=r.let=r.bindTo=r.Do=r.Comonad=r.Alt=r.TraversableWithIndex=r.Traversable=r.FoldableWithIndex=r.Foldable=r.Monad=r.chainFirst=r.Chain=r.Applicative=r.apSecond=r.apFirst=r.Apply=r.FunctorWithIndex=r.Pointed=r.flap=r.Functor=r.getUnionSemigroup=r.getEq=r.getSemigroup=r.getShow=r.URI=r.extract=r.traverseWithIndex=r.sequence=r.traverse=r.reduceRightWithIndex=r.foldMapWithIndex=r.reduceWithIndex=void 0,r.readonlyNonEmptyArray=r.fold=r.prependToAll=r.insertAt=r.snoc=r.cons=r.unsnoc=r.uncons=r.filterWithIndex=r.filter=void 0;var m=l(o),h=l(p);function I(n){return function(r){return r.concat(n)}}function b(n,r){return r?n.concat(r):function(r){return r.concat(n)}}function R(n){return function(t){var u=t.length;if(0===u)return r.empty;for(var e=[],o=t[0],i=[o],c=1;c<u;c++){var f=t[c];n.equals(f,o)?i.push(f):(e.push(i),i=[o=f])}return e.push(i),e}}r.empty=m.emptyReadonlyArray,r.isNonEmpty=m.isNonEmpty,r.isOutOfBound=function(n,r){return n<0||n>=r.length},r.prependW=function(n){return function(r){return s([n],r,!0)}},r.prepend=r.prependW,r.appendW=function(n){return function(r){return s(s([],r,!0),[n],!1)}},r.append=r.appendW,r.unsafeInsertAt=function(n,t,u){if((0,r.isNonEmpty)(u)){var e=m.fromReadonlyNonEmptyArray(u);return e.splice(n,0,t),e}return[t]},r.unsafeUpdateAt=function(n,r,t){if(t[n]===r)return t;var u=m.fromReadonlyNonEmptyArray(t);return u[n]=r,u},r.uniq=function(n){return function(t){if(1===t.length)return t;for(var u=[(0,r.head)(t)],e=function(r){u.every((function(t){return!n.equals(t,r)}))&&u.push(r)},o=0,i=(0,r.tail)(t);o<i.length;o++)e(i[o]);return u}},r.sortBy=function(n){if((0,r.isNonEmpty)(n)){var t=(0,d.getMonoid)();return(0,r.sort)(n.reduce(t.concat,t.empty))}return e.identity},r.union=function(n){var t=(0,r.uniq)(n);return function(n){return function(r){return t((0,e.pipe)(r,b(n)))}}},r.rotate=function(n){return function(t){var u=t.length,o=Math.round(n)%u;if((0,r.isOutOfBound)(Math.abs(o),t)||0===o)return t;if(o<0){var i=(0,r.splitAt)(-o)(t);return(0,e.pipe)(i[1],b(i[0]))}return(0,r.rotate)(o-u)(t)}},r.fromReadonlyArray=function(n){return(0,r.isNonEmpty)(n)?m.some(n):m.none},r.makeBy=function(n){return function(r){for(var t=Math.max(0,Math.floor(r)),u=[n(0)],e=1;e<t;e++)u.push(n(e));return u}},r.replicate=function(n){return(0,r.makeBy)((function(){return n}))},r.range=function(n,t){return n<=t?(0,r.makeBy)((function(r){return n+r}))(t-n+1):[n]},r.unprepend=function(n){return[(0,r.head)(n),(0,r.tail)(n)]},r.unappend=function(n){return[(0,r.init)(n),(0,r.last)(n)]},r.fromArray=function(n){return(0,r.fromReadonlyArray)(n.slice())},r.concatW=I,r.concat=b,r.reverse=function(n){return 1===n.length?n:s([(0,r.last)(n)],n.slice(0,-1).reverse(),!0)},r.group=R,r.groupBy=function(n){return function(r){for(var t={},u=0,e=r;u<e.length;u++){var o=e[u],i=n(o);m.has.call(t,i)?t[i].push(o):t[i]=[o]}return t}},r.sort=function(n){return function(r){return 1===r.length?r:r.slice().sort(n.compare)}},r.updateAt=function(n,t){return(0,r.modifyAt)(n,(function(){return t}))},r.modifyAt=function(n,t){return function(u){return(0,r.isOutOfBound)(n,u)?m.none:m.some((0,r.unsafeUpdateAt)(n,t(u[n]),u))}},r.zipWith=function(n,r,t){for(var u=[t(n[0],r[0])],e=Math.min(n.length,r.length),o=1;o<e;o++)u[o]=t(n[o],r[o]);return u},r.zip=function n(t,u){return void 0===u?function(r){return n(r,t)}:(0,r.zipWith)(t,u,(function(n,r){return[n,r]}))},r.unzip=function(n){for(var r=[n[0][0]],t=[n[0][1]],u=1;u<n.length;u++)r[u]=n[u][0],t[u]=n[u][1];return[r,t]},r.prependAll=function(n){return function(r){for(var t=[n,r[0]],u=1;u<r.length;u++)t.push(n,r[u]);return t}},r.intersperse=function(n){return function(t){var u=(0,r.tail)(t);return(0,r.isNonEmpty)(u)?(0,e.pipe)(u,(0,r.prependAll)(n),(0,r.prepend)((0,r.head)(t))):t}},r.chainWithIndex=function(n){return function(t){for(var u=m.fromReadonlyNonEmptyArray(n(0,(0,r.head)(t))),e=1;e<t.length;e++)u.push.apply(u,n(e,t[e]));return u}},r.chop=function(n){return function(t){for(var u=n(t),e=[u[0]],o=u[1];(0,r.isNonEmpty)(o);){var i=n(o),c=i[1];e.push(i[0]),o=c}return e}},r.splitAt=function(n){return function(t){var u=Math.max(1,n);return u>=t.length?[t,r.empty]:[(0,e.pipe)(t.slice(1,u),(0,r.prepend)((0,r.head)(t))),t.slice(u)]}},r.chunksOf=function(n){return(0,r.chop)((0,r.splitAt)(n))};var U=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},O=function(n,t){return(0,e.pipe)(n,(0,r.mapWithIndex)(t))},g=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},j=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},M=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},y=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},w=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},x=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},_=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},W=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceWithIndex)(t,u))},E=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},q=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRightWithIndex)(t,u))},k=function(n){var t=(0,r.traverseWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}};r.of=m.singleton,r.altW=function(n){return function(r){return(0,e.pipe)(r,I(n()))}},r.alt=r.altW,r.ap=function(n){return(0,r.flatMap)((function(t){return(0,e.pipe)(n,(0,r.map)(t))}))},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,e.pipe)(n,(0,r.chainWithIndex)((function(n,r){return t(r,n)})))})),r.extend=function(n){return function(t){for(var u=(0,r.tail)(t),e=[n(t)];(0,r.isNonEmpty)(u);)e.push(n(u)),u=(0,r.tail)(u);return e}},r.duplicate=(0,r.extend)(e.identity),r.flatten=(0,r.flatMap)(e.identity),r.map=function(n){return(0,r.mapWithIndex)((function(r,t){return n(t)}))},r.mapWithIndex=function(n){return function(t){for(var u=[n(0,(0,r.head)(t))],e=1;e<t.length;e++)u.push(n(e,t[e]));return u}},r.reduce=function(n,t){return(0,r.reduceWithIndex)(n,(function(n,r,u){return t(r,u)}))},r.foldMap=function(n){return function(r){return function(t){return t.slice(1).reduce((function(t,u){return n.concat(t,r(u))}),r(t[0]))}}},r.reduceRight=function(n,t){return(0,r.reduceRightWithIndex)(n,(function(n,r,u){return t(r,u)}))},r.reduceWithIndex=function(n,r){return function(t){return t.reduce((function(n,t,u){return r(u,n,t)}),n)}},r.foldMapWithIndex=function(n){return function(r){return function(t){return t.slice(1).reduce((function(t,u,e){return n.concat(t,r(e+1,u))}),r(0,t[0]))}}},r.reduceRightWithIndex=function(n,r){return function(t){return t.reduceRight((function(n,t,u){return r(u,t,n)}),n)}},r.traverse=function(n){var t=(0,r.traverseWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.sequence=function(n){return(0,r.traverseWithIndex)(n)(e.SK)},r.traverseWithIndex=function(n){return function(t){return function(u){for(var o=n.map(t(0,(0,r.head)(u)),r.of),i=1;i<u.length;i++)o=n.ap(n.map(o,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),t(i,u[i]));return o}}},r.extract=m.head,r.URI="ReadonlyNonEmptyArray",r.getShow=function(n){return{show:function(r){return"[".concat(r.map(n.show).join(", "),"]")}}},r.getSemigroup=function(){return{concat:b}},r.getEq=function(n){return(0,v.fromEquals)((function(r,t){return r.length===t.length&&r.every((function(r,u){return n.equals(r,t[u])}))}))},r.getUnionSemigroup=function(n){var t=(0,r.union)(n);return{concat:function(n,r){return t(r)(n)}}},r.Functor={URI:r.URI,map:U},r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.FunctorWithIndex={URI:r.URI,map:U,mapWithIndex:O},r.Apply={URI:r.URI,map:U,ap:g},r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.Applicative={URI:r.URI,map:U,ap:g,of:r.of},r.Chain={URI:r.URI,map:U,ap:g,chain:r.flatMap},r.chainFirst=(0,c.chainFirst)(r.Chain),r.Monad={URI:r.URI,map:U,ap:g,of:r.of,chain:r.flatMap},r.Foldable={URI:r.URI,reduce:M,foldMap:y,reduceRight:w},r.FoldableWithIndex={URI:r.URI,reduce:M,foldMap:y,reduceRight:w,reduceWithIndex:W,foldMapWithIndex:E,reduceRightWithIndex:q},r.Traversable={URI:r.URI,map:U,reduce:M,foldMap:y,reduceRight:w,traverse:x,sequence:r.sequence},r.TraversableWithIndex={URI:r.URI,map:U,mapWithIndex:O,reduce:M,foldMap:y,reduceRight:w,traverse:x,sequence:r.sequence,reduceWithIndex:W,foldMapWithIndex:E,reduceRightWithIndex:q,traverseWithIndex:k},r.Alt={URI:r.URI,map:U,alt:_},r.Comonad={URI:r.URI,map:U,extend:j,extract:r.extract},r.Do=(0,r.of)(m.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=(0,c.bind)(r.Chain),r.apS=(0,i.apS)(r.Apply),r.head=r.extract,r.tail=m.tail,r.last=function(n){return n[n.length-1]},r.init=function(n){return n.slice(0,-1)},r.min=function(n){var r=h.min(n);return function(n){return n.reduce(r.concat)}},r.max=function(n){var r=h.max(n);return function(n){return n.reduce(r.concat)}},r.concatAll=function(n){return function(r){return r.reduce(n.concat)}},r.matchLeft=function(n){return function(t){return n((0,r.head)(t),(0,r.tail)(t))}},r.matchRight=function(n){return function(t){return n((0,r.init)(t),(0,r.last)(t))}},r.modifyHead=function(n){return function(t){return s([n((0,r.head)(t))],(0,r.tail)(t),!0)}},r.updateHead=function(n){return(0,r.modifyHead)((function(){return n}))},r.modifyLast=function(n){return function(t){return(0,e.pipe)((0,r.init)(t),(0,r.append)(n((0,r.last)(t))))}},r.updateLast=function(n){return(0,r.modifyLast)((function(){return n}))},r.intercalate=function(n){var t=(0,r.concatAll)(n);return function(n){return(0,e.flow)((0,r.intersperse)(n),t)}},r.chain=r.flatMap,r.groupSort=function(n){var t=(0,r.sort)(n),u=R(n);return function(n){return(0,r.isNonEmpty)(n)?u(t(n)):r.empty}},r.filter=function(n){return(0,r.filterWithIndex)((function(r,t){return n(t)}))},r.filterWithIndex=function(n){return function(t){return(0,r.fromReadonlyArray)(t.filter((function(r,t){return n(t,r)})))}},r.uncons=r.unprepend,r.unsnoc=r.unappend,r.cons=function(n,t){return void 0===t?(0,r.prepend)(n):(0,e.pipe)(t,(0,r.prepend)(n))},r.snoc=function(n,r){return(0,e.pipe)(n,b([r]))},r.insertAt=function(n,t){return function(u){return n<0||n>u.length?m.none:m.some((0,r.unsafeInsertAt)(n,t,u))}},r.prependToAll=r.prependAll,r.fold=r.concatAll,r.readonlyNonEmptyArray={URI:r.URI,of:r.of,map:U,mapWithIndex:O,ap:g,chain:r.flatMap,extend:j,extract:r.extract,reduce:M,foldMap:y,reduceRight:w,traverse:x,sequence:r.sequence,reduceWithIndex:W,foldMapWithIndex:E,reduceRightWithIndex:q,traverseWithIndex:k,alt:_}})),m=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),f=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),v=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return f(r,n),r},l=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};Object.defineProperty(r,"__esModule",{value:!0}),r.mapWithIndex=r.map=r.flatten=r.duplicate=r.extend=r.flatMap=r.ap=r.alt=r.altW=r.chunksOf=r.splitAt=r.chop=r.chainWithIndex=r.foldMap=r.foldMapWithIndex=r.intersperse=r.prependAll=r.unzip=r.zip=r.zipWith=r.of=r.copy=r.modifyAt=r.updateAt=r.insertAt=r.sort=r.groupBy=r.group=r.reverse=r.concat=r.concatW=r.unappend=r.unprepend=r.range=r.replicate=r.makeBy=r.fromArray=r.fromReadonlyNonEmptyArray=r.rotate=r.union=r.sortBy=r.uniq=r.unsafeUpdateAt=r.unsafeInsertAt=r.append=r.appendW=r.prepend=r.prependW=r.isOutOfBound=r.isNonEmpty=void 0,r.chain=r.intercalate=r.updateLast=r.modifyLast=r.updateHead=r.modifyHead=r.matchRight=r.matchLeft=r.concatAll=r.max=r.min=r.init=r.last=r.tail=r.head=r.apS=r.bind=r.let=r.bindTo=r.Do=r.Comonad=r.Alt=r.TraversableWithIndex=r.Traversable=r.FoldableWithIndex=r.Foldable=r.Monad=r.chainFirst=r.Chain=r.Applicative=r.apSecond=r.apFirst=r.Apply=r.FunctorWithIndex=r.Pointed=r.flap=r.Functor=r.getUnionSemigroup=r.getEq=r.getSemigroup=r.getShow=r.URI=r.extract=r.traverseWithIndex=r.sequence=r.traverse=r.reduceRightWithIndex=r.reduceRight=r.reduceWithIndex=r.reduce=void 0,r.nonEmptyArray=r.fold=r.prependToAll=r.snoc=r.cons=r.unsnoc=r.uncons=r.filterWithIndex=r.filter=r.groupSort=void 0;var p=v(o),m=v(s);function h(n){return function(r){return r.concat(n)}}function I(n,r){return r?n.concat(r):function(r){return r.concat(n)}}function b(n){return function(r){var t=r.length;if(0===t)return[];for(var u=[],e=r[0],o=[e],i=1;i<t;i++){var c=r[i];n.equals(c,e)?o.push(c):(u.push(o),o=[e=c])}return u.push(o),u}}r.isNonEmpty=function(n){return n.length>0},r.isOutOfBound=function(n,r){return n<0||n>=r.length},r.prependW=function(n){return function(r){return l([n],r,!0)}},r.prepend=r.prependW,r.appendW=function(n){return function(r){return l(l([],r,!0),[n],!1)}},r.append=r.appendW,r.unsafeInsertAt=function(n,t,u){if((0,r.isNonEmpty)(u)){var e=(0,r.fromReadonlyNonEmptyArray)(u);return e.splice(n,0,t),e}return[t]},r.unsafeUpdateAt=function(n,t,u){var e=(0,r.fromReadonlyNonEmptyArray)(u);return e[n]=t,e},r.uniq=function(n){return function(t){if(1===t.length)return(0,r.copy)(t);for(var u=[(0,r.head)(t)],e=function(r){u.every((function(t){return!n.equals(t,r)}))&&u.push(r)},o=0,i=(0,r.tail)(t);o<i.length;o++)e(i[o]);return u}},r.sortBy=function(n){if((0,r.isNonEmpty)(n)){var t=(0,d.getMonoid)();return(0,r.sort)(n.reduce(t.concat,t.empty))}return r.copy},r.union=function(n){var t=(0,r.uniq)(n);return function(n){return function(r){return t((0,e.pipe)(r,I(n)))}}},r.rotate=function(n){return function(t){var u=t.length,o=Math.round(n)%u;if((0,r.isOutOfBound)(Math.abs(o),t)||0===o)return(0,r.copy)(t);if(o<0){var i=(0,r.splitAt)(-o)(t);return(0,e.pipe)(i[1],I(i[0]))}return(0,r.rotate)(o-u)(t)}},r.fromReadonlyNonEmptyArray=p.fromReadonlyNonEmptyArray,r.fromArray=function(n){return(0,r.isNonEmpty)(n)?p.some(n):p.none},r.makeBy=function(n){return function(r){for(var t=Math.max(0,Math.floor(r)),u=[n(0)],e=1;e<t;e++)u.push(n(e));return u}},r.replicate=function(n){return(0,r.makeBy)((function(){return n}))},r.range=function(n,t){return n<=t?(0,r.makeBy)((function(r){return n+r}))(t-n+1):[n]},r.unprepend=function(n){return[(0,r.head)(n),(0,r.tail)(n)]},r.unappend=function(n){return[(0,r.init)(n),(0,r.last)(n)]},r.concatW=h,r.concat=I,r.reverse=function(n){return l([(0,r.last)(n)],n.slice(0,-1).reverse(),!0)},r.group=b,r.groupBy=function(n){return function(r){for(var t={},u=0,e=r;u<e.length;u++){var o=e[u],i=n(o);p.has.call(t,i)?t[i].push(o):t[i]=[o]}return t}},r.sort=function(n){return function(r){return r.slice().sort(n.compare)}},r.insertAt=function(n,t){return function(u){return n<0||n>u.length?p.none:p.some((0,r.unsafeInsertAt)(n,t,u))}},r.updateAt=function(n,t){return(0,r.modifyAt)(n,(function(){return t}))},r.modifyAt=function(n,t){return function(u){return(0,r.isOutOfBound)(n,u)?p.none:p.some((0,r.unsafeUpdateAt)(n,t(u[n]),u))}},r.copy=r.fromReadonlyNonEmptyArray,r.of=function(n){return[n]},r.zipWith=function(n,r,t){for(var u=[t(n[0],r[0])],e=Math.min(n.length,r.length),o=1;o<e;o++)u[o]=t(n[o],r[o]);return u},r.zip=function n(t,u){return void 0===u?function(r){return n(r,t)}:(0,r.zipWith)(t,u,(function(n,r){return[n,r]}))},r.unzip=function(n){for(var r=[n[0][0]],t=[n[0][1]],u=1;u<n.length;u++)r[u]=n[u][0],t[u]=n[u][1];return[r,t]},r.prependAll=function(n){return function(r){for(var t=[n,r[0]],u=1;u<r.length;u++)t.push(n,r[u]);return t}},r.intersperse=function(n){return function(t){var u=(0,r.tail)(t);return(0,r.isNonEmpty)(u)?(0,e.pipe)(u,(0,r.prependAll)(n),(0,r.prepend)((0,r.head)(t))):(0,r.copy)(t)}},r.foldMapWithIndex=m.foldMapWithIndex,r.foldMap=m.foldMap,r.chainWithIndex=function(n){return function(t){for(var u=(0,r.fromReadonlyNonEmptyArray)(n(0,(0,r.head)(t))),e=1;e<t.length;e++)u.push.apply(u,n(e,t[e]));return u}},r.chop=function(n){return function(t){for(var u=n(t),e=[u[0]],o=u[1];(0,r.isNonEmpty)(o);){var i=n(o),c=i[1];e.push(i[0]),o=c}return e}},r.splitAt=function(n){return function(t){var u=Math.max(1,n);return u>=t.length?[(0,r.copy)(t),[]]:[(0,e.pipe)(t.slice(1,u),(0,r.prepend)((0,r.head)(t))),t.slice(u)]}},r.chunksOf=function(n){return(0,r.chop)((0,r.splitAt)(n))};var R=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},U=function(n,t){return(0,e.pipe)(n,(0,r.mapWithIndex)(t))},O=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},g=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},j=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},M=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},y=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},w=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},x=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},_=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceWithIndex)(t,u))},W=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},E=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRightWithIndex)(t,u))},q=function(n){var t=(0,r.traverseWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}};r.altW=function(n){return function(r){return(0,e.pipe)(r,h(n()))}},r.alt=r.altW,r.ap=function(n){return(0,r.flatMap)((function(t){return(0,e.pipe)(n,(0,r.map)(t))}))},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,e.pipe)(n,(0,r.chainWithIndex)((function(n,r){return t(r,n)})))})),r.extend=function(n){return function(t){for(var u=(0,r.tail)(t),e=[n(t)];(0,r.isNonEmpty)(u);)e.push(n(u)),u=(0,r.tail)(u);return e}},r.duplicate=(0,r.extend)(e.identity),r.flatten=(0,r.flatMap)(e.identity),r.map=function(n){return(0,r.mapWithIndex)((function(r,t){return n(t)}))},r.mapWithIndex=function(n){return function(t){for(var u=[n(0,(0,r.head)(t))],e=1;e<t.length;e++)u.push(n(e,t[e]));return u}},r.reduce=m.reduce,r.reduceWithIndex=m.reduceWithIndex,r.reduceRight=m.reduceRight,r.reduceRightWithIndex=m.reduceRightWithIndex,r.traverse=function(n){var t=(0,r.traverseWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.sequence=function(n){return(0,r.traverseWithIndex)(n)((function(n,r){return r}))},r.traverseWithIndex=function(n){return function(t){return function(u){for(var o=n.map(t(0,(0,r.head)(u)),r.of),i=1;i<u.length;i++)o=n.ap(n.map(o,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),t(i,u[i]));return o}}},r.extract=m.head,r.URI="NonEmptyArray",r.getShow=m.getShow,r.getSemigroup=function(){return{concat:I}},r.getEq=m.getEq,r.getUnionSemigroup=function(n){var t=(0,r.union)(n);return{concat:function(n,r){return t(r)(n)}}},r.Functor={URI:r.URI,map:R},r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.FunctorWithIndex={URI:r.URI,map:R,mapWithIndex:U},r.Apply={URI:r.URI,map:R,ap:O},r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.Applicative={URI:r.URI,map:R,ap:O,of:r.of},r.Chain={URI:r.URI,map:R,ap:O,chain:r.flatMap},r.chainFirst=(0,c.chainFirst)(r.Chain),r.Monad={URI:r.URI,map:R,ap:O,of:r.of,chain:r.flatMap},r.Foldable={URI:r.URI,reduce:j,foldMap:M,reduceRight:y},r.FoldableWithIndex={URI:r.URI,reduce:j,foldMap:M,reduceRight:y,reduceWithIndex:_,foldMapWithIndex:W,reduceRightWithIndex:E},r.Traversable={URI:r.URI,map:R,reduce:j,foldMap:M,reduceRight:y,traverse:w,sequence:r.sequence},r.TraversableWithIndex={URI:r.URI,map:R,mapWithIndex:U,reduce:j,foldMap:M,reduceRight:y,traverse:w,sequence:r.sequence,reduceWithIndex:_,foldMapWithIndex:W,reduceRightWithIndex:E,traverseWithIndex:q},r.Alt={URI:r.URI,map:R,alt:x},r.Comonad={URI:r.URI,map:R,extend:g,extract:r.extract},r.Do=(0,r.of)(p.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=(0,c.bind)(r.Chain),r.apS=(0,i.apS)(r.Apply),r.head=m.head,r.tail=function(n){return n.slice(1)},r.last=m.last,r.init=function(n){return n.slice(0,-1)},r.min=m.min,r.max=m.max,r.concatAll=function(n){return function(r){return r.reduce(n.concat)}},r.matchLeft=function(n){return function(t){return n((0,r.head)(t),(0,r.tail)(t))}},r.matchRight=function(n){return function(t){return n((0,r.init)(t),(0,r.last)(t))}},r.modifyHead=function(n){return function(t){return l([n((0,r.head)(t))],(0,r.tail)(t),!0)}},r.updateHead=function(n){return(0,r.modifyHead)((function(){return n}))},r.modifyLast=function(n){return function(t){return(0,e.pipe)((0,r.init)(t),(0,r.append)(n((0,r.last)(t))))}},r.updateLast=function(n){return(0,r.modifyLast)((function(){return n}))},r.intercalate=m.intercalate,r.chain=r.flatMap,r.groupSort=function(n){var t=(0,r.sort)(n),u=b(n);return function(n){return(0,r.isNonEmpty)(n)?u(t(n)):[]}},r.filter=function(n){return(0,r.filterWithIndex)((function(r,t){return n(t)}))},r.filterWithIndex=function(n){return function(t){return(0,r.fromArray)(t.filter((function(r,t){return n(t,r)})))}},r.uncons=r.unprepend,r.unsnoc=r.unappend,r.cons=function(n,t){return void 0===t?(0,r.prepend)(n):(0,e.pipe)(t,(0,r.prepend)(n))},r.snoc=function(n,t){return(0,e.pipe)(n,(0,r.append)(t))},r.prependToAll=r.prependAll,r.fold=m.concatAll,r.nonEmptyArray={URI:r.URI,of:r.of,map:R,mapWithIndex:U,ap:O,chain:r.flatMap,extend:g,extract:r.extract,reduce:j,foldMap:M,reduceRight:y,traverse:w,sequence:r.sequence,reduceWithIndex:_,foldMapWithIndex:W,reduceRightWithIndex:E,traverseWithIndex:q,alt:x}})),h=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Field=r.MonoidProduct=r.MonoidSum=r.SemigroupProduct=r.SemigroupSum=r.MagmaSub=r.Show=r.Bounded=r.Ord=r.Eq=r.isNumber=void 0,r.isNumber=function(n){return"number"==typeof n},r.Eq={equals:function(n,r){return n===r}},r.Ord={equals:r.Eq.equals,compare:function(n,r){return n<r?-1:n>r?1:0}},r.Bounded={equals:r.Eq.equals,compare:r.Ord.compare,top:1/0,bottom:-1/0},r.Show={show:function(n){return JSON.stringify(n)}},r.MagmaSub={concat:function(n,r){return n-r}},r.SemigroupSum={concat:function(n,r){return n+r}},r.SemigroupProduct={concat:function(n,r){return n*r}},r.MonoidSum={concat:r.SemigroupSum.concat,empty:0},r.MonoidProduct={concat:r.SemigroupProduct.concat,empty:1},r.Field={add:r.SemigroupSum.concat,zero:0,mul:r.SemigroupProduct.concat,one:1,sub:r.MagmaSub.concat,degree:function(){return 1},div:function(n,r){return n/r},mod:function(n,r){return n%r}}})),I=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.right=r.left=r.flap=r.Functor=r.Bifunctor=r.URI=r.bimap=r.mapLeft=r.map=r.separated=void 0,r.separated=function(n,r){return{left:n,right:r}},r.map=function(n){return function(t){return(0,r.separated)((0,r.left)(t),n((0,r.right)(t)))}},r.mapLeft=function(n){return function(t){return(0,r.separated)(n((0,r.left)(t)),(0,r.right)(t))}},r.bimap=function(n,t){return function(u){return(0,r.separated)(n((0,r.left)(u)),t((0,r.right)(u)))}},r.URI="Separated",r.Bifunctor={URI:r.URI,mapLeft:function(n,t){return(0,e.pipe)(n,(0,r.mapLeft)(t))},bimap:function(n,t,u){return(0,e.pipe)(n,(0,r.bimap)(t,u))}},r.Functor={URI:r.URI,map:function(n,t){return(0,e.pipe)(n,(0,r.map)(t))}},r.flap=(0,a.flap)(r.Functor),r.left=function(n){return n.left},r.right=function(n){return n.right}})),b=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),e=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),i=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return e(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.filterE=r.witherDefault=r.wiltDefault=void 0;var c=i(o);r.wiltDefault=function(n,r){return function(t){var u=n.traverse(t);return function(n,e){return t.map(u(n,e),r.separate)}}},r.witherDefault=function(n,r){return function(t){var u=n.traverse(t);return function(n,e){return t.map(u(n,e),r.compact)}}},r.filterE=function(n){return function(r){var t=n.wither(r);return function(n){return function(u){return t(u,(function(t){return r.map(n(t),(function(n){return n?c.some(t):c.none}))}))}}}}})),R=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.guard=void 0,r.guard=function(n,r){return function(t){return t?r.of(void 0):n.zero()}}})),U=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),l=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),p=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return l(r,n),r},m=t&&t.__spreadArray||function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))};Object.defineProperty(r,"__esModule",{value:!0}),r.sort=r.lefts=r.rights=r.reverse=r.modifyAt=r.deleteAt=r.updateAt=r.insertAt=r.findLastIndex=r.findLastMap=r.findLast=r.findFirstMap=r.findFirst=r.findIndex=r.dropLeftWhile=r.dropRight=r.dropLeft=r.spanLeft=r.takeLeftWhile=r.takeRight=r.takeLeft=r.init=r.tail=r.last=r.head=r.lookup=r.isOutOfBound=r.size=r.scanRight=r.scanLeft=r.chainWithIndex=r.foldRight=r.matchRight=r.matchRightW=r.foldLeft=r.matchLeft=r.matchLeftW=r.match=r.matchW=r.fromEither=r.fromOption=r.fromPredicate=r.replicate=r.makeBy=r.appendW=r.append=r.prependW=r.prepend=r.isNonEmpty=r.isEmpty=void 0,r.sequence=r.traverse=r.reduceRightWithIndex=r.reduceRight=r.reduceWithIndex=r.foldMap=r.reduce=r.foldMapWithIndex=r.duplicate=r.extend=r.filterWithIndex=r.partitionMapWithIndex=r.partitionMap=r.partitionWithIndex=r.partition=r.compact=r.filterMap=r.filterMapWithIndex=r.filter=r.separate=r.mapWithIndex=r.map=r.flatten=r.flatMap=r.ap=r.alt=r.altW=r.zero=r.of=r._chainRecBreadthFirst=r._chainRecDepthFirst=r.difference=r.intersection=r.union=r.concat=r.concatW=r.comprehension=r.fromOptionK=r.chunksOf=r.splitAt=r.chop=r.sortBy=r.uniq=r.elem=r.rotate=r.intersperse=r.prependAll=r.unzip=r.zip=r.zipWith=void 0,r.toArray=r.unsafeDeleteAt=r.unsafeUpdateAt=r.unsafeInsertAt=r.fromEitherK=r.FromEither=r.filterE=r.Witherable=r.ChainRecBreadthFirst=r.chainRecBreadthFirst=r.ChainRecDepthFirst=r.chainRecDepthFirst=r.TraversableWithIndex=r.Traversable=r.FoldableWithIndex=r.Foldable=r.FilterableWithIndex=r.Filterable=r.Compactable=r.Extend=r.Alternative=r.guard=r.Zero=r.Alt=r.Unfoldable=r.chainFirst=r.Monad=r.Chain=r.Applicative=r.apSecond=r.apFirst=r.Apply=r.FunctorWithIndex=r.Pointed=r.flap=r.Functor=r.getDifferenceMagma=r.getIntersectionSemigroup=r.getUnionMonoid=r.getUnionSemigroup=r.getOrd=r.getEq=r.getMonoid=r.getSemigroup=r.getShow=r.URI=r.unfold=r.wilt=r.wither=r.traverseWithIndex=void 0,r.readonlyArray=r.prependToAll=r.snoc=r.cons=r.range=r.chain=r.apS=r.bind=r.let=r.bindTo=r.Do=r.intercalate=r.exists=r.some=r.every=r.empty=r.fromArray=void 0;var U=p(o),O=p(h),g=p(s);r.isEmpty=function(n){return 0===n.length},r.isNonEmpty=g.isNonEmpty,r.prepend=g.prepend,r.prependW=g.prependW,r.append=g.append,r.appendW=g.appendW,r.makeBy=function(n,t){return n<=0?r.empty:g.makeBy(t)(n)},r.replicate=function(n,t){return(0,r.makeBy)(n,(function(){return t}))},r.fromPredicate=function(n){return function(t){return n(t)?[t]:r.empty}},r.fromOption=function(n){return U.isNone(n)?r.empty:[n.value]},r.fromEither=function(n){return U.isLeft(n)?r.empty:[n.right]},r.matchW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(u):n()}},r.match=r.matchW,r.matchLeftW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(g.head(u),g.tail(u)):n()}},r.matchLeft=r.matchLeftW,r.foldLeft=r.matchLeft,r.matchRightW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(g.init(u),g.last(u)):n()}},r.matchRight=r.matchRightW,r.foldRight=r.matchRight,r.chainWithIndex=function(n){return function(t){if((0,r.isEmpty)(t))return r.empty;for(var u=[],e=0;e<t.length;e++)u.push.apply(u,n(e,t[e]));return u}},r.scanLeft=function(n,r){return function(t){var u=t.length,e=new Array(u+1);e[0]=n;for(var o=0;o<u;o++)e[o+1]=r(e[o],t[o]);return e}},r.scanRight=function(n,r){return function(t){var u=t.length,e=new Array(u+1);e[u]=n;for(var o=u-1;o>=0;o--)e[o]=r(t[o],e[o+1]);return e}},r.size=function(n){return n.length},r.isOutOfBound=g.isOutOfBound,r.lookup=function n(t,u){return void 0===u?function(r){return n(t,r)}:(0,r.isOutOfBound)(t,u)?U.none:U.some(u[t])},r.head=function(n){return(0,r.isNonEmpty)(n)?U.some(g.head(n)):U.none},r.last=function(n){return(0,r.isNonEmpty)(n)?U.some(g.last(n)):U.none},r.tail=function(n){return(0,r.isNonEmpty)(n)?U.some(g.tail(n)):U.none},r.init=function(n){return(0,r.isNonEmpty)(n)?U.some(g.init(n)):U.none},r.takeLeft=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?t:0===n?r.empty:t.slice(0,n)}},r.takeRight=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?t:0===n?r.empty:t.slice(-n)}},r.takeLeftWhile=function(n){return function(t){for(var u=[],e=0,o=t;e<o.length;e++){var i=o[e];if(!n(i))break;u.push(i)}var c=u.length;return c===t.length?t:0===c?r.empty:u}};var j=function(n,r){for(var t=n.length,u=0;u<t&&r(n[u]);u++);return u};function M(n){return function(r,t){if(void 0===t){var u=M(n);return function(n){return u(r,n)}}for(var e=0;e<t.length;e++)if(n.equals(t[e],r))return!0;return!1}}function y(n){var t=g.union(n);return function(u,e){if(void 0===e){var o=y(n);return function(n){return o(n,u)}}return(0,r.isNonEmpty)(u)&&(0,r.isNonEmpty)(e)?t(e)(u):(0,r.isNonEmpty)(u)?u:e}}function w(n){var r=M(n);return function(t,u){if(void 0===u){var e=w(n);return function(n){return e(n,t)}}return t.filter((function(n){return r(n,u)}))}}function x(n){var r=M(n);return function(t,u){if(void 0===u){var e=x(n);return function(n){return e(n,t)}}return t.filter((function(n){return!r(n,u)}))}}r.spanLeft=function(n){return function(t){var u=(0,r.splitAt)(j(t,n))(t);return{init:u[0],rest:u[1]}}},r.dropLeft=function(n){return function(t){return n<=0||(0,r.isEmpty)(t)?t:n>=t.length?r.empty:t.slice(n,t.length)}},r.dropRight=function(n){return function(t){return n<=0||(0,r.isEmpty)(t)?t:n>=t.length?r.empty:t.slice(0,t.length-n)}},r.dropLeftWhile=function(n){return function(t){var u=j(t,n);return 0===u?t:u===t.length?r.empty:t.slice(u)}},r.findIndex=function(n){return function(r){for(var t=0;t<r.length;t++)if(n(r[t]))return U.some(t);return U.none}},r.findFirst=function(n){return function(r){for(var t=0;t<r.length;t++)if(n(r[t]))return U.some(r[t]);return U.none}},r.findFirstMap=function(n){return function(r){for(var t=0;t<r.length;t++){var u=n(r[t]);if(U.isSome(u))return u}return U.none}},r.findLast=function(n){return function(r){for(var t=r.length-1;t>=0;t--)if(n(r[t]))return U.some(r[t]);return U.none}},r.findLastMap=function(n){return function(r){for(var t=r.length-1;t>=0;t--){var u=n(r[t]);if(U.isSome(u))return u}return U.none}},r.findLastIndex=function(n){return function(r){for(var t=r.length-1;t>=0;t--)if(n(r[t]))return U.some(t);return U.none}},r.insertAt=function(n,r){return function(t){return n<0||n>t.length?U.none:U.some(g.unsafeInsertAt(n,r,t))}},r.updateAt=function(n,t){return(0,r.modifyAt)(n,(function(){return t}))},r.deleteAt=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?U.none:U.some((0,r.unsafeDeleteAt)(n,t))}},r.modifyAt=function(n,t){return function(u){return(0,r.isOutOfBound)(n,u)?U.none:U.some((0,r.unsafeUpdateAt)(n,t(u[n]),u))}},r.reverse=function(n){return n.length<=1?n:n.slice().reverse()},r.rights=function(n){for(var r=[],t=0;t<n.length;t++){var u=n[t];"Right"===u._tag&&r.push(u.right)}return r},r.lefts=function(n){for(var r=[],t=0;t<n.length;t++){var u=n[t];"Left"===u._tag&&r.push(u.left)}return r},r.sort=function(n){return function(r){return r.length<=1?r:r.slice().sort(n.compare)}},r.zipWith=function(n,r,t){for(var u=[],e=Math.min(n.length,r.length),o=0;o<e;o++)u[o]=t(n[o],r[o]);return u},r.zip=function n(t,u){return void 0===u?function(r){return n(r,t)}:(0,r.zipWith)(t,u,(function(n,r){return[n,r]}))},r.unzip=function(n){for(var r=[],t=[],u=0;u<n.length;u++)r[u]=n[u][0],t[u]=n[u][1];return[r,t]},r.prependAll=function(n){var t=g.prependAll(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.intersperse=function(n){var t=g.intersperse(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.rotate=function(n){var t=g.rotate(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.elem=M,r.uniq=function(n){var t=g.uniq(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.sortBy=function(n){var t=g.sortBy(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):n}},r.chop=function(n){var t=g.chop(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):r.empty}},r.splitAt=function(n){return function(t){return n>=1&&(0,r.isNonEmpty)(t)?g.splitAt(n)(t):(0,r.isEmpty)(t)?[t,r.empty]:[r.empty,t]}},r.chunksOf=function(n){var t=g.chunksOf(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):r.empty}},r.fromOptionK=function(n){return function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];return(0,r.fromOption)(n.apply(void 0,t))}},r.comprehension=function(n,t,u){void 0===u&&(u=function(){return!0});var o=function(n,i){return(0,r.isNonEmpty)(i)?(0,r.flatMap)(g.head(i),(function(t){return o((0,e.pipe)(n,(0,r.append)(t)),g.tail(i))})):u.apply(void 0,n)?[t.apply(void 0,n)]:r.empty};return o(r.empty,n)},r.concatW=function(n){return function(t){return(0,r.isEmpty)(t)?n:(0,r.isEmpty)(n)?t:t.concat(n)}},r.concat=r.concatW,r.union=y,r.intersection=w,r.difference=x;var _=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},W=function(n,t){return(0,e.pipe)(n,(0,r.mapWithIndex)(t))},E=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},q=function(n,t){return(0,e.pipe)(n,(0,r.filter)(t))},k=function(n,t){return(0,e.pipe)(n,(0,r.filterMap)(t))},A=function(n,t){return(0,e.pipe)(n,(0,r.partition)(t))},P=function(n,t){return(0,e.pipe)(n,(0,r.partitionMap)(t))},T=function(n,t){return(0,e.pipe)(n,(0,r.partitionWithIndex)(t))},L=function(n,t){return(0,e.pipe)(n,(0,r.partitionMapWithIndex)(t))},z=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},N=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},S=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},C=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},F=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceWithIndex)(t,u))},$=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},D=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRightWithIndex)(t,u))},H=function(n,t){return(0,e.pipe)(n,(0,r.filterMapWithIndex)(t))},J=function(n,t){return(0,e.pipe)(n,(0,r.filterWithIndex)(t))},G=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},B=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},K=function(n){var t=(0,r.traverseWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}};r._chainRecDepthFirst=function(n,t){return(0,e.pipe)(n,(0,r.chainRecDepthFirst)(t))},r._chainRecBreadthFirst=function(n,t){return(0,e.pipe)(n,(0,r.chainRecBreadthFirst)(t))},r.of=g.of,r.zero=function(){return r.empty},r.altW=function(n){return function(r){return r.concat(n())}},r.alt=r.altW,r.ap=function(n){return(0,r.flatMap)((function(t){return(0,e.pipe)(n,(0,r.map)(t))}))},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,e.pipe)(n,(0,r.chainWithIndex)((function(n,r){return t(r,n)})))})),r.flatten=(0,r.flatMap)(e.identity),r.map=function(n){return function(r){return r.map((function(r){return n(r)}))}},r.mapWithIndex=function(n){return function(r){return r.map((function(r,t){return n(t,r)}))}},r.separate=function(n){for(var r=[],t=[],u=0,e=n;u<e.length;u++){var o=e[u];"Left"===o._tag?r.push(o.left):t.push(o.right)}return(0,I.separated)(r,t)},r.filter=function(n){return function(r){return r.filter(n)}},r.filterMapWithIndex=function(n){return function(r){for(var t=[],u=0;u<r.length;u++){var e=n(u,r[u]);U.isSome(e)&&t.push(e.value)}return t}},r.filterMap=function(n){return(0,r.filterMapWithIndex)((function(r,t){return n(t)}))},r.compact=(0,r.filterMap)(e.identity),r.partition=function(n){return(0,r.partitionWithIndex)((function(r,t){return n(t)}))},r.partitionWithIndex=function(n){return function(r){for(var t=[],u=[],e=0;e<r.length;e++){var o=r[e];n(e,o)?u.push(o):t.push(o)}return(0,I.separated)(t,u)}},r.partitionMap=function(n){return(0,r.partitionMapWithIndex)((function(r,t){return n(t)}))},r.partitionMapWithIndex=function(n){return function(r){for(var t=[],u=[],e=0;e<r.length;e++){var o=n(e,r[e]);"Left"===o._tag?t.push(o.left):u.push(o.right)}return(0,I.separated)(t,u)}},r.filterWithIndex=function(n){return function(r){return r.filter((function(r,t){return n(t,r)}))}},r.extend=function(n){return function(r){return r.map((function(t,u){return n(r.slice(u))}))}},r.duplicate=(0,r.extend)(e.identity),r.foldMapWithIndex=function(n){return function(r){return function(t){return t.reduce((function(t,u,e){return n.concat(t,r(e,u))}),n.empty)}}},r.reduce=function(n,t){return(0,r.reduceWithIndex)(n,(function(n,r,u){return t(r,u)}))},r.foldMap=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.reduceWithIndex=function(n,r){return function(t){for(var u=t.length,e=n,o=0;o<u;o++)e=r(o,e,t[o]);return e}},r.reduceRight=function(n,t){return(0,r.reduceRightWithIndex)(n,(function(n,r,u){return t(r,u)}))},r.reduceRightWithIndex=function(n,r){return function(t){return t.reduceRight((function(n,t,u){return r(u,t,n)}),n)}},r.traverse=function(n){var t=(0,r.traverseWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.sequence=function(n){return function(t){return N(t,n.of((0,r.zero)()),(function(t,u){return n.ap(n.map(t,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),u)}))}},r.traverseWithIndex=function(n){return function(t){return(0,r.reduceWithIndex)(n.of((0,r.zero)()),(function(u,o,i){return n.ap(n.map(o,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),t(u,i))}))}},r.wither=function(n){var r=V(n);return function(n){return function(t){return r(t,n)}}},r.wilt=function(n){var r=X(n);return function(n){return function(t){return r(t,n)}}},r.unfold=function(n,r){for(var t=[],u=n;;){var e=r(u);if(!U.isSome(e))break;var o=e.value,i=o[1];t.push(o[0]),u=i}return t},r.URI="ReadonlyArray",r.getShow=function(n){return{show:function(r){return"[".concat(r.map(n.show).join(", "),"]")}}},r.getSemigroup=function(){return{concat:function(n,t){return(0,r.isEmpty)(n)?t:(0,r.isEmpty)(t)?n:n.concat(t)}}},r.getMonoid=function(){return{concat:(0,r.getSemigroup)().concat,empty:r.empty}},r.getEq=function(n){return(0,v.fromEquals)((function(r,t){return r.length===t.length&&r.every((function(r,u){return n.equals(r,t[u])}))}))},r.getOrd=function(n){return(0,d.fromCompare)((function(r,t){for(var u=r.length,e=t.length,o=Math.min(u,e),i=0;i<o;i++){var c=n.compare(r[i],t[i]);if(0!==c)return c}return O.Ord.compare(u,e)}))},r.getUnionSemigroup=function(n){var r=y(n);return{concat:function(n,t){return r(t)(n)}}},r.getUnionMonoid=function(n){return{concat:(0,r.getUnionSemigroup)(n).concat,empty:r.empty}},r.getIntersectionSemigroup=function(n){var r=w(n);return{concat:function(n,t){return r(t)(n)}}},r.getDifferenceMagma=function(n){var r=x(n);return{concat:function(n,t){return r(t)(n)}}},r.Functor={URI:r.URI,map:_},r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.FunctorWithIndex={URI:r.URI,map:_,mapWithIndex:W},r.Apply={URI:r.URI,map:_,ap:E},r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.Applicative={URI:r.URI,map:_,ap:E,of:r.of},r.Chain={URI:r.URI,map:_,ap:E,chain:r.flatMap},r.Monad={URI:r.URI,map:_,ap:E,of:r.of,chain:r.flatMap},r.chainFirst=(0,c.chainFirst)(r.Chain),r.Unfoldable={URI:r.URI,unfold:r.unfold},r.Alt={URI:r.URI,map:_,alt:z},r.Zero={URI:r.URI,zero:r.zero},r.guard=(0,R.guard)(r.Zero,r.Pointed),r.Alternative={URI:r.URI,map:_,ap:E,of:r.of,alt:z,zero:r.zero},r.Extend={URI:r.URI,map:_,extend:G},r.Compactable={URI:r.URI,compact:r.compact,separate:r.separate},r.Filterable={URI:r.URI,map:_,compact:r.compact,separate:r.separate,filter:q,filterMap:k,partition:A,partitionMap:P},r.FilterableWithIndex={URI:r.URI,map:_,mapWithIndex:W,compact:r.compact,separate:r.separate,filter:q,filterMap:k,partition:A,partitionMap:P,partitionMapWithIndex:L,partitionWithIndex:T,filterMapWithIndex:H,filterWithIndex:J},r.Foldable={URI:r.URI,reduce:N,foldMap:S,reduceRight:C},r.FoldableWithIndex={URI:r.URI,reduce:N,foldMap:S,reduceRight:C,reduceWithIndex:F,foldMapWithIndex:$,reduceRightWithIndex:D},r.Traversable={URI:r.URI,map:_,reduce:N,foldMap:S,reduceRight:C,traverse:B,sequence:r.sequence},r.TraversableWithIndex={URI:r.URI,map:_,mapWithIndex:W,reduce:N,foldMap:S,reduceRight:C,reduceWithIndex:F,foldMapWithIndex:$,reduceRightWithIndex:D,traverse:B,sequence:r.sequence,traverseWithIndex:K},r.chainRecDepthFirst=function(n){return function(r){for(var t=m([],n(r),!0),u=[];t.length>0;){var e=t.shift();U.isLeft(e)?t.unshift.apply(t,n(e.left)):u.push(e.right)}return u}},r.ChainRecDepthFirst={URI:r.URI,map:_,ap:E,chain:r.flatMap,chainRec:r._chainRecDepthFirst},r.chainRecBreadthFirst=function(n){return function(r){var t=n(r),u=[],e=[];function o(r){U.isLeft(r)?n(r.left).forEach((function(n){return u.push(n)})):e.push(r.right)}for(var i=0,c=t;i<c.length;i++)o(c[i]);for(;u.length>0;)o(u.shift());return e}},r.ChainRecBreadthFirst={URI:r.URI,map:_,ap:E,chain:r.flatMap,chainRec:r._chainRecBreadthFirst};var V=(0,b.witherDefault)(r.Traversable,r.Compactable),X=(0,b.wiltDefault)(r.Traversable,r.Compactable);r.Witherable={URI:r.URI,map:_,compact:r.compact,separate:r.separate,filter:q,filterMap:k,partition:A,partitionMap:P,reduce:N,foldMap:S,reduceRight:C,traverse:B,sequence:r.sequence,wither:V,wilt:X},r.filterE=(0,b.filterE)(r.Witherable),r.FromEither={URI:r.URI,fromEither:r.fromEither},r.fromEitherK=(0,f.fromEitherK)(r.FromEither),r.unsafeInsertAt=g.unsafeInsertAt,r.unsafeUpdateAt=function(n,t,u){return(0,r.isNonEmpty)(u)?g.unsafeUpdateAt(n,t,u):u},r.unsafeDeleteAt=function(n,r){var t=r.slice();return t.splice(n,1),t},r.toArray=function(n){return n.slice()},r.fromArray=function(n){return(0,r.isEmpty)(n)?r.empty:n.slice()},r.empty=g.empty,r.every=function(n){return function(r){return r.every(n)}},r.some=function(n){return function(r){return r.some(n)}},r.exists=r.some,r.intercalate=function(n){var t=g.intercalate(n);return function(u){return(0,r.match)((function(){return n.empty}),t(u))}},r.Do=(0,r.of)(U.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=(0,c.bind)(r.Chain),r.apS=(0,i.apS)(r.Apply),r.chain=r.flatMap,r.range=g.range,r.cons=g.cons,r.snoc=g.snoc,r.prependToAll=r.prependAll,r.readonlyArray={URI:r.URI,compact:r.compact,separate:r.separate,map:_,ap:E,of:r.of,chain:r.flatMap,filter:q,filterMap:k,partition:A,partitionMap:P,mapWithIndex:W,partitionMapWithIndex:L,partitionWithIndex:T,filterMapWithIndex:H,filterWithIndex:J,alt:z,zero:r.zero,unfold:r.unfold,reduce:N,foldMap:S,reduceRight:C,traverse:B,sequence:r.sequence,reduceWithIndex:F,foldMapWithIndex:$,reduceRightWithIndex:D,traverseWithIndex:K,extend:G,wither:V,wilt:X}})),O=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),v=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),d=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return v(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.lefts=r.rights=r.reverse=r.modifyAt=r.deleteAt=r.updateAt=r.insertAt=r.copy=r.findLastIndex=r.findLastMap=r.findLast=r.findFirstMap=r.findFirst=r.findIndex=r.dropLeftWhile=r.dropRight=r.dropLeft=r.spanLeft=r.takeLeftWhile=r.takeRight=r.takeLeft=r.init=r.tail=r.last=r.head=r.lookup=r.isOutOfBound=r.size=r.scanRight=r.scanLeft=r.chainWithIndex=r.foldRight=r.matchRight=r.matchRightW=r.foldLeft=r.matchLeft=r.matchLeftW=r.match=r.matchW=r.fromEither=r.fromOption=r.fromPredicate=r.replicate=r.makeBy=r.appendW=r.append=r.prependW=r.prepend=r.isNonEmpty=r.isEmpty=void 0,r.traverseWithIndex=r.sequence=r.traverse=r.reduceRightWithIndex=r.reduceRight=r.reduceWithIndex=r.reduce=r.foldMapWithIndex=r.foldMap=r.duplicate=r.extend=r.filterWithIndex=r.alt=r.altW=r.partitionMapWithIndex=r.partitionMap=r.partitionWithIndex=r.partition=r.filter=r.separate=r.compact=r.filterMap=r.filterMapWithIndex=r.mapWithIndex=r.flatten=r.flatMap=r.ap=r.map=r.zero=r.of=r.difference=r.intersection=r.union=r.concat=r.concatW=r.comprehension=r.fromOptionK=r.chunksOf=r.splitAt=r.chop=r.sortBy=r.uniq=r.elem=r.rotate=r.intersperse=r.prependAll=r.unzip=r.zip=r.zipWith=r.sort=void 0,r.some=r.every=r.unsafeDeleteAt=r.unsafeUpdateAt=r.unsafeInsertAt=r.fromEitherK=r.FromEither=r.filterE=r.ChainRecBreadthFirst=r.chainRecBreadthFirst=r.ChainRecDepthFirst=r.chainRecDepthFirst=r.Witherable=r.TraversableWithIndex=r.Traversable=r.FoldableWithIndex=r.Foldable=r.FilterableWithIndex=r.Filterable=r.Compactable=r.Extend=r.Alternative=r.guard=r.Zero=r.Alt=r.Unfoldable=r.Monad=r.chainFirst=r.Chain=r.Applicative=r.apSecond=r.apFirst=r.Apply=r.FunctorWithIndex=r.Pointed=r.flap=r.Functor=r.getDifferenceMagma=r.getIntersectionSemigroup=r.getUnionMonoid=r.getUnionSemigroup=r.getOrd=r.getEq=r.getMonoid=r.getSemigroup=r.getShow=r.URI=r.unfold=r.wilt=r.wither=void 0,r.array=r.prependToAll=r.snoc=r.cons=r.empty=r.range=r.chain=r.apS=r.bind=r.let=r.bindTo=r.Do=r.intercalate=r.exists=void 0;var l=d(o),p=d(m),s=d(U);r.isEmpty=function(n){return 0===n.length},r.isNonEmpty=p.isNonEmpty,r.prepend=p.prepend,r.prependW=p.prependW,r.append=p.append,r.appendW=p.appendW,r.makeBy=function(n,r){return n<=0?[]:p.makeBy(r)(n)},r.replicate=function(n,t){return(0,r.makeBy)(n,(function(){return t}))},r.fromPredicate=function(n){return function(r){return n(r)?[r]:[]}},r.fromOption=function(n){return l.isNone(n)?[]:[n.value]},r.fromEither=function(n){return l.isLeft(n)?[]:[n.right]},r.matchW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(u):n()}},r.match=r.matchW,r.matchLeftW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(p.head(u),p.tail(u)):n()}},r.matchLeft=r.matchLeftW,r.foldLeft=r.matchLeft,r.matchRightW=function(n,t){return function(u){return(0,r.isNonEmpty)(u)?t(p.init(u),p.last(u)):n()}},r.matchRight=r.matchRightW,r.foldRight=r.matchRight,r.chainWithIndex=function(n){return function(r){for(var t=[],u=0;u<r.length;u++)t.push.apply(t,n(u,r[u]));return t}},r.scanLeft=function(n,r){return function(t){var u=t.length,e=new Array(u+1);e[0]=n;for(var o=0;o<u;o++)e[o+1]=r(e[o],t[o]);return e}},r.scanRight=function(n,r){return function(t){var u=t.length,e=new Array(u+1);e[u]=n;for(var o=u-1;o>=0;o--)e[o]=r(t[o],e[o+1]);return e}},r.size=function(n){return n.length},r.isOutOfBound=p.isOutOfBound,r.lookup=s.lookup,r.head=s.head,r.last=s.last,r.tail=function(n){return(0,r.isNonEmpty)(n)?l.some(p.tail(n)):l.none},r.init=function(n){return(0,r.isNonEmpty)(n)?l.some(p.init(n)):l.none},r.takeLeft=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?(0,r.copy)(t):t.slice(0,n)}},r.takeRight=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?(0,r.copy)(t):0===n?[]:t.slice(-n)}},r.takeLeftWhile=function(n){return function(r){for(var t=[],u=0,e=r;u<e.length;u++){var o=e[u];if(!n(o))break;t.push(o)}return t}};var h=function(n,r){for(var t=n.length,u=0;u<t&&r(n[u]);u++);return u};function O(n){var t=p.union(n);return function(u,e){if(void 0===e){var o=O(n);return function(n){return o(n,u)}}return(0,r.isNonEmpty)(u)&&(0,r.isNonEmpty)(e)?t(e)(u):(0,r.isNonEmpty)(u)?(0,r.copy)(u):(0,r.copy)(e)}}function g(n){var t=(0,r.elem)(n);return function(r,u){if(void 0===u){var e=g(n);return function(n){return e(n,r)}}return r.filter((function(n){return t(n,u)}))}}function j(n){var t=(0,r.elem)(n);return function(r,u){if(void 0===u){var e=j(n);return function(n){return e(n,r)}}return r.filter((function(n){return!t(n,u)}))}}r.spanLeft=function(n){return function(t){var u=(0,r.splitAt)(h(t,n))(t);return{init:u[0],rest:u[1]}}},r.dropLeft=function(n){return function(t){return n<=0||(0,r.isEmpty)(t)?(0,r.copy)(t):n>=t.length?[]:t.slice(n,t.length)}},r.dropRight=function(n){return function(t){return n<=0||(0,r.isEmpty)(t)?(0,r.copy)(t):n>=t.length?[]:t.slice(0,t.length-n)}},r.dropLeftWhile=function(n){return function(r){return r.slice(h(r,n))}},r.findIndex=s.findIndex,r.findFirst=function(n){return s.findFirst(n)},r.findFirstMap=s.findFirstMap,r.findLast=function(n){return s.findLast(n)},r.findLastMap=s.findLastMap,r.findLastIndex=s.findLastIndex,r.copy=function(n){return n.slice()},r.insertAt=function(n,t){return function(u){return n<0||n>u.length?l.none:l.some((0,r.unsafeInsertAt)(n,t,u))}},r.updateAt=function(n,t){return(0,r.modifyAt)(n,(function(){return t}))},r.deleteAt=function(n){return function(t){return(0,r.isOutOfBound)(n,t)?l.none:l.some((0,r.unsafeDeleteAt)(n,t))}},r.modifyAt=function(n,t){return function(u){return(0,r.isOutOfBound)(n,u)?l.none:l.some((0,r.unsafeUpdateAt)(n,t(u[n]),u))}},r.reverse=function(n){return(0,r.isEmpty)(n)?[]:n.slice().reverse()},r.rights=function(n){for(var r=[],t=0;t<n.length;t++){var u=n[t];"Right"===u._tag&&r.push(u.right)}return r},r.lefts=function(n){for(var r=[],t=0;t<n.length;t++){var u=n[t];"Left"===u._tag&&r.push(u.left)}return r},r.sort=function(n){return function(t){return t.length<=1?(0,r.copy)(t):t.slice().sort(n.compare)}},r.zipWith=function(n,r,t){for(var u=[],e=Math.min(n.length,r.length),o=0;o<e;o++)u[o]=t(n[o],r[o]);return u},r.zip=function n(t,u){return void 0===u?function(r){return n(r,t)}:(0,r.zipWith)(t,u,(function(n,r){return[n,r]}))},r.unzip=function(n){for(var r=[],t=[],u=0;u<n.length;u++)r[u]=n[u][0],t[u]=n[u][1];return[r,t]},r.prependAll=function(n){var t=p.prependAll(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):[]}},r.intersperse=function(n){var t=p.intersperse(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):(0,r.copy)(n)}},r.rotate=function(n){var t=p.rotate(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):(0,r.copy)(n)}},r.elem=s.elem,r.uniq=function(n){var t=p.uniq(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):(0,r.copy)(n)}},r.sortBy=function(n){var t=p.sortBy(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):(0,r.copy)(n)}},r.chop=function(n){var t=p.chop(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):[]}},r.splitAt=function(n){return function(t){return n>=1&&(0,r.isNonEmpty)(t)?p.splitAt(n)(t):(0,r.isEmpty)(t)?[(0,r.copy)(t),[]]:[[],(0,r.copy)(t)]}},r.chunksOf=function(n){var t=p.chunksOf(n);return function(n){return(0,r.isNonEmpty)(n)?t(n):[]}},r.fromOptionK=function(n){return function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];return(0,r.fromOption)(n.apply(void 0,t))}},r.comprehension=function(n,t,u){void 0===u&&(u=function(){return!0});var o=function(n,i){return(0,r.isNonEmpty)(i)?(0,r.flatMap)(p.head(i),(function(t){return o((0,e.pipe)(n,(0,r.append)(t)),p.tail(i))})):u.apply(void 0,n)?[t.apply(void 0,n)]:[]};return o([],n)},r.concatW=function(n){return function(t){return(0,r.isEmpty)(t)?(0,r.copy)(n):(0,r.isEmpty)(n)?(0,r.copy)(t):t.concat(n)}},r.concat=r.concatW,r.union=O,r.intersection=g,r.difference=j;var M=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},y=function(n,t){return(0,e.pipe)(n,(0,r.mapWithIndex)(t))},w=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},x=function(n,t){return(0,e.pipe)(n,(0,r.filter)(t))},_=function(n,t){return(0,e.pipe)(n,(0,r.filterMap)(t))},W=function(n,t){return(0,e.pipe)(n,(0,r.partition)(t))},E=function(n,t){return(0,e.pipe)(n,(0,r.partitionMap)(t))},q=function(n,t){return(0,e.pipe)(n,(0,r.partitionWithIndex)(t))},k=function(n,t){return(0,e.pipe)(n,(0,r.partitionMapWithIndex)(t))},A=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},P=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},T=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},L=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},z=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceWithIndex)(t,u))},N=function(n){var t=(0,r.foldMapWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},S=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRightWithIndex)(t,u))},C=function(n,t){return(0,e.pipe)(n,(0,r.filterMapWithIndex)(t))},F=function(n,t){return(0,e.pipe)(n,(0,r.filterWithIndex)(t))},$=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},D=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},H=function(n){var t=(0,r.traverseWithIndex)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},J=s._chainRecDepthFirst,G=s._chainRecBreadthFirst;r.of=p.of,r.zero=function(){return[]},r.map=function(n){return function(r){return r.map((function(r){return n(r)}))}},r.ap=function(n){return(0,r.flatMap)((function(t){return(0,e.pipe)(n,(0,r.map)(t))}))},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,e.pipe)(n,(0,r.chainWithIndex)((function(n,r){return t(r,n)})))})),r.flatten=(0,r.flatMap)(e.identity),r.mapWithIndex=function(n){return function(r){return r.map((function(r,t){return n(t,r)}))}},r.filterMapWithIndex=function(n){return function(r){for(var t=[],u=0;u<r.length;u++){var e=n(u,r[u]);l.isSome(e)&&t.push(e.value)}return t}},r.filterMap=function(n){return(0,r.filterMapWithIndex)((function(r,t){return n(t)}))},r.compact=(0,r.filterMap)(e.identity),r.separate=function(n){for(var r=[],t=[],u=0,e=n;u<e.length;u++){var o=e[u];"Left"===o._tag?r.push(o.left):t.push(o.right)}return(0,I.separated)(r,t)},r.filter=function(n){return function(r){return r.filter(n)}},r.partition=function(n){return(0,r.partitionWithIndex)((function(r,t){return n(t)}))},r.partitionWithIndex=function(n){return function(r){for(var t=[],u=[],e=0;e<r.length;e++){var o=r[e];n(e,o)?u.push(o):t.push(o)}return(0,I.separated)(t,u)}},r.partitionMap=function(n){return(0,r.partitionMapWithIndex)((function(r,t){return n(t)}))},r.partitionMapWithIndex=function(n){return function(r){for(var t=[],u=[],e=0;e<r.length;e++){var o=n(e,r[e]);"Left"===o._tag?t.push(o.left):u.push(o.right)}return(0,I.separated)(t,u)}},r.altW=function(n){return function(r){return r.concat(n())}},r.alt=r.altW,r.filterWithIndex=function(n){return function(r){return r.filter((function(r,t){return n(t,r)}))}},r.extend=function(n){return function(r){return r.map((function(t,u){return n(r.slice(u))}))}},r.duplicate=(0,r.extend)(e.identity),r.foldMap=s.foldMap,r.foldMapWithIndex=s.foldMapWithIndex,r.reduce=s.reduce,r.reduceWithIndex=s.reduceWithIndex,r.reduceRight=s.reduceRight,r.reduceRightWithIndex=s.reduceRightWithIndex,r.traverse=function(n){var t=(0,r.traverseWithIndex)(n);return function(n){return t((function(r,t){return n(t)}))}},r.sequence=function(n){return function(t){return P(t,n.of((0,r.zero)()),(function(t,u){return n.ap(n.map(t,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),u)}))}},r.traverseWithIndex=function(n){return function(t){return(0,r.reduceWithIndex)(n.of((0,r.zero)()),(function(u,o,i){return n.ap(n.map(o,(function(n){return function(t){return(0,e.pipe)(n,(0,r.append)(t))}})),t(u,i))}))}},r.wither=function(n){var r=B(n);return function(n){return function(t){return r(t,n)}}},r.wilt=function(n){var r=K(n);return function(n){return function(t){return r(t,n)}}},r.unfold=function(n,r){for(var t=[],u=n;;){var e=r(u);if(!l.isSome(e))break;var o=e.value,i=o[1];t.push(o[0]),u=i}return t},r.URI="Array",r.getShow=s.getShow,r.getSemigroup=function(){return{concat:function(n,r){return n.concat(r)}}},r.getMonoid=function(){return{concat:(0,r.getSemigroup)().concat,empty:[]}},r.getEq=s.getEq,r.getOrd=s.getOrd,r.getUnionSemigroup=function(n){var r=O(n);return{concat:function(n,t){return r(t)(n)}}},r.getUnionMonoid=function(n){return{concat:(0,r.getUnionSemigroup)(n).concat,empty:[]}},r.getIntersectionSemigroup=function(n){var r=g(n);return{concat:function(n,t){return r(t)(n)}}},r.getDifferenceMagma=function(n){var r=j(n);return{concat:function(n,t){return r(t)(n)}}},r.Functor={URI:r.URI,map:M},r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.FunctorWithIndex={URI:r.URI,map:M,mapWithIndex:y},r.Apply={URI:r.URI,map:M,ap:w},r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.Applicative={URI:r.URI,map:M,ap:w,of:r.of},r.Chain={URI:r.URI,map:M,ap:w,chain:r.flatMap},r.chainFirst=(0,c.chainFirst)(r.Chain),r.Monad={URI:r.URI,map:M,ap:w,of:r.of,chain:r.flatMap},r.Unfoldable={URI:r.URI,unfold:r.unfold},r.Alt={URI:r.URI,map:M,alt:A},r.Zero={URI:r.URI,zero:r.zero},r.guard=(0,R.guard)(r.Zero,r.Pointed),r.Alternative={URI:r.URI,map:M,ap:w,of:r.of,alt:A,zero:r.zero},r.Extend={URI:r.URI,map:M,extend:$},r.Compactable={URI:r.URI,compact:r.compact,separate:r.separate},r.Filterable={URI:r.URI,map:M,compact:r.compact,separate:r.separate,filter:x,filterMap:_,partition:W,partitionMap:E},r.FilterableWithIndex={URI:r.URI,map:M,mapWithIndex:y,compact:r.compact,separate:r.separate,filter:x,filterMap:_,partition:W,partitionMap:E,partitionMapWithIndex:k,partitionWithIndex:q,filterMapWithIndex:C,filterWithIndex:F},r.Foldable={URI:r.URI,reduce:P,foldMap:T,reduceRight:L},r.FoldableWithIndex={URI:r.URI,reduce:P,foldMap:T,reduceRight:L,reduceWithIndex:z,foldMapWithIndex:N,reduceRightWithIndex:S},r.Traversable={URI:r.URI,map:M,reduce:P,foldMap:T,reduceRight:L,traverse:D,sequence:r.sequence},r.TraversableWithIndex={URI:r.URI,map:M,mapWithIndex:y,reduce:P,foldMap:T,reduceRight:L,reduceWithIndex:z,foldMapWithIndex:N,reduceRightWithIndex:S,traverse:D,sequence:r.sequence,traverseWithIndex:H};var B=(0,b.witherDefault)(r.Traversable,r.Compactable),K=(0,b.wiltDefault)(r.Traversable,r.Compactable);r.Witherable={URI:r.URI,map:M,compact:r.compact,separate:r.separate,filter:x,filterMap:_,partition:W,partitionMap:E,reduce:P,foldMap:T,reduceRight:L,traverse:D,sequence:r.sequence,wither:B,wilt:K},r.chainRecDepthFirst=s.chainRecDepthFirst,r.ChainRecDepthFirst={URI:r.URI,map:M,ap:w,chain:r.flatMap,chainRec:J},r.chainRecBreadthFirst=s.chainRecBreadthFirst,r.ChainRecBreadthFirst={URI:r.URI,map:M,ap:w,chain:r.flatMap,chainRec:G},r.filterE=(0,b.filterE)(r.Witherable),r.FromEither={URI:r.URI,fromEither:r.fromEither},r.fromEitherK=(0,f.fromEitherK)(r.FromEither),r.unsafeInsertAt=p.unsafeInsertAt,r.unsafeUpdateAt=function(n,t,u){return(0,r.isNonEmpty)(u)?p.unsafeUpdateAt(n,t,u):[]},r.unsafeDeleteAt=function(n,r){var t=r.slice();return t.splice(n,1),t},r.every=s.every,r.some=function(n){return function(r){return r.some(n)}},r.exists=r.some,r.intercalate=s.intercalate,r.Do=(0,r.of)(l.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=(0,c.bind)(r.Chain),r.apS=(0,i.apS)(r.Apply),r.chain=r.flatMap,r.range=p.range,r.empty=[],r.cons=p.cons,r.snoc=p.snoc,r.prependToAll=r.prependAll,r.array={URI:r.URI,compact:r.compact,separate:r.separate,map:M,ap:w,of:r.of,chain:r.flatMap,filter:x,filterMap:_,partition:W,partitionMap:E,mapWithIndex:y,partitionMapWithIndex:k,partitionWithIndex:q,filterMapWithIndex:C,filterWithIndex:F,alt:A,zero:r.zero,unfold:r.unfold,reduce:P,foldMap:T,reduceRight:L,traverse:D,sequence:r.sequence,reduceWithIndex:z,foldMapWithIndex:N,reduceRightWithIndex:S,traverseWithIndex:H,extend:$,wither:B,wilt:K}}));const g=n=>!("isConnected"in n)||n.isConnected,j=(()=>{let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout((()=>{n=0,(n=>{for(let r of n.keys())n.set(r,n.get(r).filter(g))})(...r)}),2e3)}})(),M=n=>"function"==typeof n?n():n,y=(t,u)=>{const e=((n,r=((n,r)=>n!==r))=>{const t=M(n);let u=new Map(Object.entries(null!=t?t:{}));const e={dispose:[],get:[],set:[],reset:[]},o=()=>{var r;u=new Map(Object.entries(null!==(r=M(n))&&void 0!==r?r:{})),e.reset.forEach((n=>n()))},i=n=>(e.get.forEach((r=>r(n))),u.get(n)),c=(n,t)=>{const o=u.get(n);r(t,o,n)&&(u.set(n,t),e.set.forEach((r=>r(n,t,o))))},f="undefined"==typeof Proxy?{}:new Proxy(t,{get:(n,r)=>i(r),ownKeys:()=>Array.from(u.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(n,r)=>u.has(r),set:(n,r,t)=>(c(r,t),!0)}),a=(n,r)=>(e[n].push(r),()=>{((n,r)=>{const t=n.indexOf(r);t>=0&&(n[t]=n[n.length-1],n.length--)})(e[n],r)});return{state:f,get:i,set:c,on:a,onChange:(r,t)=>{const u=a("set",((n,u)=>{n===r&&t(u)})),e=a("reset",(()=>t(M(n)[r])));return()=>{u(),e()}},use:(...n)=>{const r=n.reduce(((n,r)=>(r.set&&n.push(a("set",r.set)),r.get&&n.push(a("get",r.get)),r.reset&&n.push(a("reset",r.reset)),r.dispose&&n.push(a("dispose",r.dispose)),n)),[]);return()=>r.forEach((n=>n()))},dispose:()=>{e.dispose.forEach((n=>n())),o()},reset:o,forceUpdate:n=>{const r=u.get(n);e.set.forEach((t=>t(n,r,r)))}}})(t,u);return e.use((()=>{if("function"!=typeof n)return{};const t=new Map;return{dispose:()=>t.clear(),get:r=>{const u=n();u&&((n,r,t)=>{const u=n.get(r);u?u.includes(t)||u.push(t):n.set(r,[t])})(t,r,u)},set:n=>{const u=t.get(n);u&&t.set(n,u.filter(r)),j(t)},reset:()=>{t.forEach((n=>n.forEach(r))),j(t)}}})()),e};var w=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getApplicativeComposition=r.getApplicativeMonoid=void 0,r.getApplicativeMonoid=function(n){var r=(0,i.getApplySemigroup)(n);return function(t){return{concat:r(t).concat,empty:n.of(t.empty)}}},r.getApplicativeComposition=function(n,r){var t=(0,a.getFunctorComposition)(n,r).map,u=(0,i.ap)(n,r);return{map:t,of:function(t){return n.of(r.of(t))},ap:function(n,r){return(0,e.pipe)(n,u(r))}}}})),x=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.and=r.or=r.not=r.Contravariant=r.getMonoidAll=r.getSemigroupAll=r.getMonoidAny=r.getSemigroupAny=r.URI=r.contramap=void 0,r.contramap=function(n){return function(r){return(0,e.flow)(n,r)}},r.URI="Predicate",r.getSemigroupAny=function(){return{concat:function(n,t){return(0,e.pipe)(n,(0,r.or)(t))}}},r.getMonoidAny=function(){return{concat:(0,r.getSemigroupAny)().concat,empty:e.constFalse}},r.getSemigroupAll=function(){return{concat:function(n,t){return(0,e.pipe)(n,(0,r.and)(t))}}},r.getMonoidAll=function(){return{concat:(0,r.getSemigroupAll)().concat,empty:e.constTrue}},r.Contravariant={URI:r.URI,contramap:function(n,t){return(0,e.pipe)(n,(0,r.contramap)(t))}},r.not=function(n){return function(r){return!n(r)}},r.or=function(n){return function(r){return function(t){return r(t)||n(t)}}},r.and=function(n){return function(r){return function(t){return r(t)&&n(t)}}}})),_=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),v=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),d=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return v(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.Witherable=r.wilt=r.wither=r.Traversable=r.sequence=r.traverse=r.Filterable=r.partitionMap=r.partition=r.filterMap=r.filter=r.Compactable=r.separate=r.compact=r.Extend=r.extend=r.Alternative=r.guard=r.Zero=r.zero=r.Alt=r.alt=r.altW=r.orElse=r.Foldable=r.reduceRight=r.foldMap=r.reduce=r.Monad=r.Chain=r.flatMap=r.Applicative=r.Apply=r.ap=r.Pointed=r.of=r.asUnit=r.as=r.Functor=r.map=r.getMonoid=r.getOrd=r.getEq=r.getShow=r.URI=r.getRight=r.getLeft=r.fromPredicate=r.some=r.none=void 0,r.getFirstMonoid=r.getApplyMonoid=r.getApplySemigroup=r.option=r.mapNullable=r.getRefinement=r.chainFirst=r.chain=r.sequenceArray=r.traverseArray=r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex=r.traverseReadonlyNonEmptyArrayWithIndex=r.ApT=r.apS=r.bind=r.let=r.bindTo=r.Do=r.exists=r.elem=r.toUndefined=r.toNullable=r.chainNullableK=r.fromNullableK=r.tryCatchK=r.tryCatch=r.fromNullable=r.chainFirstEitherK=r.chainEitherK=r.fromEitherK=r.duplicate=r.tapEither=r.tap=r.flatten=r.apSecond=r.apFirst=r.flap=r.getOrElse=r.getOrElseW=r.fold=r.match=r.foldW=r.matchW=r.isNone=r.isSome=r.FromEither=r.fromEither=r.MonadThrow=r.throwError=void 0,r.getLastMonoid=void 0;var l=d(c),s=d(o);r.none=s.none,r.some=s.some,r.fromPredicate=function(n){return function(t){return n(t)?(0,r.some)(t):r.none}},r.getLeft=function(n){return"Right"===n._tag?r.none:(0,r.some)(n.left)},r.getRight=function(n){return"Left"===n._tag?r.none:(0,r.some)(n.right)};var m=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},h=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},U=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},O=function(n){var t=(0,r.foldMap)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},g=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},j=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},M=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},y=function(n,t){return(0,e.pipe)(n,(0,r.filter)(t))},_=function(n,t){return(0,e.pipe)(n,(0,r.filterMap)(t))},W=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},E=function(n,t){return(0,e.pipe)(n,(0,r.partition)(t))},q=function(n,t){return(0,e.pipe)(n,(0,r.partitionMap)(t))};r.URI="Option",r.getShow=function(n){return{show:function(t){return(0,r.isNone)(t)?"none":"some(".concat(n.show(t.value),")")}}},r.getEq=function(n){return{equals:function(t,u){return t===u||((0,r.isNone)(t)?(0,r.isNone)(u):!(0,r.isNone)(u)&&n.equals(t.value,u.value))}}},r.getOrd=function(n){return{equals:(0,r.getEq)(n).equals,compare:function(t,u){return t===u?0:(0,r.isSome)(t)?(0,r.isSome)(u)?n.compare(t.value,u.value):1:-1}}},r.getMonoid=function(n){return{concat:function(t,u){return(0,r.isNone)(t)?u:(0,r.isNone)(u)?t:(0,r.some)(n.concat(t.value,u.value))},empty:r.none}},r.map=function(n){return function(t){return(0,r.isNone)(t)?r.none:(0,r.some)(n(t.value))}},r.Functor={URI:r.URI,map:m},r.as=(0,e.dual)(2,(0,a.as)(r.Functor)),r.asUnit=(0,a.asUnit)(r.Functor),r.of=r.some,r.Pointed={URI:r.URI,of:r.of},r.ap=function(n){return function(t){return(0,r.isNone)(t)||(0,r.isNone)(n)?r.none:(0,r.some)(t.value(n.value))}},r.Apply={URI:r.URI,map:m,ap:h},r.Applicative={URI:r.URI,map:m,ap:h,of:r.of},r.flatMap=(0,e.dual)(2,(function(n,t){return(0,r.isNone)(n)?r.none:t(n.value)})),r.Chain={URI:r.URI,map:m,ap:h,chain:r.flatMap},r.Monad={URI:r.URI,map:m,ap:h,of:r.of,chain:r.flatMap},r.reduce=function(n,t){return function(u){return(0,r.isNone)(u)?n:t(n,u.value)}},r.foldMap=function(n){return function(t){return function(u){return(0,r.isNone)(u)?n.empty:t(u.value)}}},r.reduceRight=function(n,t){return function(u){return(0,r.isNone)(u)?n:t(u.value,n)}},r.Foldable={URI:r.URI,reduce:U,foldMap:O,reduceRight:g},r.orElse=(0,e.dual)(2,(function(n,t){return(0,r.isNone)(n)?t():n})),r.altW=r.orElse,r.alt=r.orElse,r.Alt={URI:r.URI,map:m,alt:M},r.zero=function(){return r.none},r.Zero={URI:r.URI,zero:r.zero},r.guard=(0,R.guard)(r.Zero,r.Pointed),r.Alternative={URI:r.URI,map:m,ap:h,of:r.of,alt:M,zero:r.zero},r.extend=function(n){return function(t){return(0,r.isNone)(t)?r.none:(0,r.some)(n(t))}},r.Extend={URI:r.URI,map:m,extend:W},r.compact=(0,r.flatMap)(e.identity);var k=(0,I.separated)(r.none,r.none);r.separate=function(n){return(0,r.isNone)(n)?k:(0,I.separated)((0,r.getLeft)(n.value),(0,r.getRight)(n.value))},r.Compactable={URI:r.URI,compact:r.compact,separate:r.separate},r.filter=function(n){return function(t){return(0,r.isNone)(t)?r.none:n(t.value)?t:r.none}},r.filterMap=function(n){return function(t){return(0,r.isNone)(t)?r.none:n(t.value)}},r.partition=function(n){return function(r){return(0,I.separated)(y(r,(0,x.not)(n)),y(r,n))}},r.partitionMap=function(n){return(0,e.flow)((0,r.map)(n),r.separate)},r.Filterable={URI:r.URI,map:m,compact:r.compact,separate:r.separate,filter:y,filterMap:_,partition:E,partitionMap:q},r.traverse=function(n){return function(t){return function(u){return(0,r.isNone)(u)?n.of(r.none):n.map(t(u.value),r.some)}}},r.sequence=function(n){return function(t){return(0,r.isNone)(t)?n.of(r.none):n.map(t.value,r.some)}},r.Traversable={URI:r.URI,map:m,reduce:U,foldMap:O,reduceRight:g,traverse:j,sequence:r.sequence};var A=(0,b.witherDefault)(r.Traversable,r.Compactable),P=(0,b.wiltDefault)(r.Traversable,r.Compactable);r.wither=function(n){var r=A(n);return function(n){return function(t){return r(t,n)}}},r.wilt=function(n){var r=P(n);return function(n){return function(t){return r(t,n)}}},r.Witherable={URI:r.URI,map:m,reduce:U,foldMap:O,reduceRight:g,traverse:j,sequence:r.sequence,compact:r.compact,separate:r.separate,filter:y,filterMap:_,partition:E,partitionMap:q,wither:A,wilt:P},r.throwError=function(){return r.none},r.MonadThrow={URI:r.URI,map:m,ap:h,of:r.of,chain:r.flatMap,throwError:r.throwError},r.fromEither=r.getRight,r.FromEither={URI:r.URI,fromEither:r.fromEither},r.isSome=s.isSome,r.isNone=function(n){return"None"===n._tag},r.matchW=function(n,t){return function(u){return(0,r.isNone)(u)?n():t(u.value)}},r.foldW=r.matchW,r.match=r.matchW,r.fold=r.match,r.getOrElseW=function(n){return function(t){return(0,r.isNone)(t)?n():t.value}},r.getOrElse=r.getOrElseW,r.flap=(0,a.flap)(r.Functor),r.apFirst=(0,i.apFirst)(r.Apply),r.apSecond=(0,i.apSecond)(r.Apply),r.flatten=r.compact,r.tap=(0,e.dual)(2,l.tap(r.Chain)),r.tapEither=(0,e.dual)(2,(0,f.tapEither)(r.FromEither,r.Chain)),r.duplicate=(0,r.extend)(e.identity),r.fromEitherK=(0,f.fromEitherK)(r.FromEither),r.chainEitherK=(0,f.chainEitherK)(r.FromEither,r.Chain),r.chainFirstEitherK=r.tapEither,r.fromNullable=function(n){return null==n?r.none:(0,r.some)(n)},r.tryCatch=function(n){try{return(0,r.some)(n())}catch(n){return r.none}},r.tryCatchK=function(n){return function(){for(var t=[],u=0;u<arguments.length;u++)t[u]=arguments[u];return(0,r.tryCatch)((function(){return n.apply(void 0,t)}))}},r.fromNullableK=function(n){return(0,e.flow)(n,r.fromNullable)},r.chainNullableK=function(n){return function(t){return(0,r.isNone)(t)?r.none:(0,r.fromNullable)(n(t.value))}},r.toNullable=(0,r.match)(e.constNull,e.identity),r.toUndefined=(0,r.match)(e.constUndefined,e.identity),r.elem=function n(t){return function(u,e){if(void 0===e){var o=n(t);return function(n){return o(u,n)}}return!(0,r.isNone)(e)&&t.equals(u,e.value)}},r.exists=function(n){return function(t){return!(0,r.isNone)(t)&&n(t.value)}},r.Do=(0,r.of)(s.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=l.bind(r.Chain),r.apS=(0,i.apS)(r.Apply),r.ApT=(0,r.of)(s.emptyReadonlyArray),r.traverseReadonlyNonEmptyArrayWithIndex=function(n){return function(t){var u=n(0,s.head(t));if((0,r.isNone)(u))return r.none;for(var e=[u.value],o=1;o<t.length;o++){var i=n(o,t[o]);if((0,r.isNone)(i))return r.none;e.push(i.value)}return(0,r.some)(e)}},r.traverseReadonlyArrayWithIndex=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndex)(n);return function(n){return s.isNonEmpty(n)?t(n):r.ApT}},r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex,r.traverseArray=function(n){return(0,r.traverseReadonlyArrayWithIndex)((function(r,t){return n(t)}))},r.sequenceArray=(0,r.traverseArray)(e.identity),r.chain=r.flatMap,r.chainFirst=r.tap,r.getRefinement=function(n){return function(t){return(0,r.isSome)(n(t))}},r.mapNullable=r.chainNullableK,r.option={URI:r.URI,map:m,of:r.of,ap:h,chain:r.flatMap,reduce:U,foldMap:O,reduceRight:g,traverse:j,sequence:r.sequence,zero:r.zero,alt:M,extend:W,compact:r.compact,separate:r.separate,filter:y,filterMap:_,partition:E,partitionMap:q,wither:A,wilt:P,throwError:r.throwError},r.getApplySemigroup=(0,i.getApplySemigroup)(r.Apply),r.getApplyMonoid=(0,w.getApplicativeMonoid)(r.Applicative),r.getFirstMonoid=function(){return(0,r.getMonoid)((0,p.first)())},r.getLastMonoid=function(){return(0,r.getMonoid)((0,p.last)())}}));function W(n){return n}function E(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n}function q(n,r,t,u,e,o,i,c,f){switch(arguments.length){case 1:return n;case 2:return r(n);case 3:return t(r(n));case 4:return u(t(r(n)));case 5:return e(u(t(r(n))));case 6:return o(e(u(t(r(n)))));case 7:return i(o(e(u(t(r(n))))));case 8:return c(i(o(e(u(t(r(n)))))));case 9:return f(c(i(o(e(u(t(r(n))))))));default:for(var a=arguments[0],v=1;v<arguments.length;v++)a=arguments[v](a);return a}}var k=function(n,r){var t="number"==typeof n?function(r){return r.length>=n}:n;return function(){var n=Array.from(arguments);return t(arguments)?r.apply(this,n):function(t){return r.apply(void 0,function(n,r,t){if(t||2===arguments.length)for(var u,e=0,o=r.length;e<o;e++)!u&&e in r||(u||(u=Array.prototype.slice.call(r,0,e)),u[e]=r[e]);return n.concat(u||Array.prototype.slice.call(r))}([t],n,!1))}}},A={_tag:"None"},P=function(n){return{_tag:"Left",left:n}},T=function(n){return{_tag:"Right",right:n}},L=Object.prototype.hasOwnProperty,z=function(n,r){return k(2,(function(t,u){return r.flatMap(t,(function(r){return n.fromTask(u(r))}))}))};function N(n){return function(r){return function(t){return n.fromEither("None"===t._tag?P(r()):T(t.value))}}}var S=P,C=T,F=k(2,(function(n,r){return V(n)?n:r(n.right)})),$=function(n,r){return q(n,H(r))},D="Either",H=function(n){return function(r){return V(r)?r:C(n(r.right))}},J={URI:D,map:$},G={URI:D,map:$,ap:function(n,r){return q(n,function(n){return function(r){return V(r)?r:V(n)?n:C(r.right(n.right))}}(r))}},B=function(n){return function(r){return V(r)?S(n(r.left)):r}},K=N({URI:D,fromEither:W}),V=function(n){return"Left"===n._tag},X=function(n,r){return function(t){return V(t)?n(t.left):r(t.right)}},Y=function(n){return function(r){return V(r)?n(r.left):r.right}},Q=F,Z=A,nn=function(n){return{_tag:"Some",value:n}},rn=function(n){return{concat:function(r,t){return un(r)?t:un(t)?r:nn(n.concat(r.value,t.value))},empty:Z}},tn=k(2,(function(n,r){return un(n)?Z:r(n.value)})),un=function(n){return"None"===n._tag},en=function(n){return function(r){return un(r)?n():r.value}},on=function(n){return null==n?Z:nn(n)},cn=tn;function fn(n){return function(r){return n.map(r,C)}}function an(n){return function(n,r){return function(t){return function(u){return n.map(u,(function(n){return r.map(n,t)}))}}}(n,J)}var vn,dn,ln=function(n,r){return q(n,pn(r))},pn=function(n){return function(r){return function(){return Promise.resolve().then(r).then(n)}}},sn=function(n){return function(){return Promise.resolve(n)}},mn="Task",hn={URI:mn,map:ln},In={URI:mn,map:ln,of:sn,ap:function(n,r){return q(n,function(n){return function(r){return function(){return Promise.all([Promise.resolve().then(r),Promise.resolve().then(n)]).then((function(n){return(0,n[0])(n[1])}))}}}(r))},chain:k(2,(function(n,r){return function(){return Promise.resolve().then(n).then((function(n){return r(n)()}))}}))},bn=fn(hn),Rn=sn,Un=an(hn),On=k(2,(vn=hn,function(n,r){return vn.map(n,B(r))})),gn=k(2,(dn=In,function(n,r){return dn.chain(n,(function(n){return V(n)?dn.of(n):r(n.right)}))})),jn=N({URI:"TaskEither",fromEither:Rn}),Mn=z({fromTask:bn},{flatMap:gn}),yn=gn,wn=gn,xn=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),o=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),i=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return o(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.getCompactableComposition=r.separate=r.compact=void 0;var c=i(I);function f(n,r){return function(t){return n.map(t,r.compact)}}function v(n,r,t){var u=f(n,r),o=(0,a.map)(n,t);return function(n){return c.separated(u((0,e.pipe)(n,o(_.getLeft))),u((0,e.pipe)(n,o(_.getRight))))}}r.compact=f,r.separate=v,r.getCompactableComposition=function(n,r){return{map:(0,a.getFunctorComposition)(n,r).map,compact:f(n,r),separate:v(n,r,r)}}})),_n=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.tailRec=void 0,r.tailRec=function(n,r){for(var t=r(n);"Left"===t._tag;)t=r(t.left);return t.right}})),Wn=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),v=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),d=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return v(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.match=r.foldW=r.matchW=r.isRight=r.isLeft=r.fromOption=r.fromPredicate=r.FromEither=r.MonadThrow=r.throwError=r.ChainRec=r.Extend=r.extend=r.Alt=r.alt=r.altW=r.Bifunctor=r.mapLeft=r.bimap=r.Traversable=r.sequence=r.traverse=r.Foldable=r.reduceRight=r.foldMap=r.reduce=r.Monad=r.Chain=r.Applicative=r.Apply=r.ap=r.apW=r.Pointed=r.of=r.asUnit=r.as=r.Functor=r.map=r.getAltValidation=r.getApplicativeValidation=r.getWitherable=r.getFilterable=r.getCompactable=r.getSemigroup=r.getEq=r.getShow=r.URI=r.flatMap=r.right=r.left=void 0,r.chainFirstW=r.chainFirst=r.chain=r.chainW=r.sequenceArray=r.traverseArray=r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex=r.traverseReadonlyNonEmptyArrayWithIndex=r.ApT=r.apSW=r.apS=r.bindW=r.bind=r.let=r.bindTo=r.Do=r.exists=r.elem=r.toError=r.toUnion=r.chainNullableK=r.fromNullableK=r.tryCatchK=r.tryCatch=r.fromNullable=r.orElse=r.orElseW=r.swap=r.filterOrElseW=r.filterOrElse=r.flatMapOption=r.flatMapNullable=r.liftOption=r.liftNullable=r.chainOptionKW=r.chainOptionK=r.fromOptionK=r.duplicate=r.flatten=r.flattenW=r.tap=r.apSecondW=r.apSecond=r.apFirstW=r.apFirst=r.flap=r.getOrElse=r.getOrElseW=r.fold=void 0,r.getValidation=r.getValidationMonoid=r.getValidationSemigroup=r.getApplyMonoid=r.getApplySemigroup=r.either=r.stringifyJSON=r.parseJSON=void 0;var l=d(c),p=d(o);r.left=p.left,r.right=p.right,r.flatMap=(0,e.dual)(2,(function(n,t){return(0,r.isLeft)(n)?n:t(n.right)}));var s=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},m=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},h=function(n,t,u){return(0,e.pipe)(n,(0,r.reduce)(t,u))},R=function(n){return function(t,u){var o=(0,r.foldMap)(n);return(0,e.pipe)(t,o(u))}},U=function(n,t,u){return(0,e.pipe)(n,(0,r.reduceRight)(t,u))},O=function(n){var t=(0,r.traverse)(n);return function(n,r){return(0,e.pipe)(n,t(r))}},g=function(n,t,u){return(0,e.pipe)(n,(0,r.bimap)(t,u))},j=function(n,t){return(0,e.pipe)(n,(0,r.mapLeft)(t))},M=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))},y=function(n,t){return(0,e.pipe)(n,(0,r.extend)(t))},x=function(n,t){return(0,_n.tailRec)(t(n),(function(n){return(0,r.isLeft)(n)?(0,r.right)((0,r.left)(n.left)):(0,r.isLeft)(n.right)?(0,r.left)(t(n.right.left)):(0,r.right)((0,r.right)(n.right.right))}))};r.URI="Either",r.getShow=function(n,t){return{show:function(u){return(0,r.isLeft)(u)?"left(".concat(n.show(u.left),")"):"right(".concat(t.show(u.right),")")}}},r.getEq=function(n,t){return{equals:function(u,e){return u===e||((0,r.isLeft)(u)?(0,r.isLeft)(e)&&n.equals(u.left,e.left):(0,r.isRight)(e)&&t.equals(u.right,e.right))}}},r.getSemigroup=function(n){return{concat:function(t,u){return(0,r.isLeft)(u)?t:(0,r.isLeft)(t)?u:(0,r.right)(n.concat(t.right,u.right))}}},r.getCompactable=function(n){var t=(0,r.left)(n.empty);return{URI:r.URI,_E:void 0,compact:function(n){return(0,r.isLeft)(n)?n:"None"===n.right._tag?t:(0,r.right)(n.right.value)},separate:function(n){return(0,r.isLeft)(n)?(0,I.separated)(n,n):(0,r.isLeft)(n.right)?(0,I.separated)((0,r.right)(n.right.left),t):(0,I.separated)(t,(0,r.right)(n.right.right))}}},r.getFilterable=function(n){var t=(0,r.left)(n.empty),u=(0,r.getCompactable)(n);return{URI:r.URI,_E:void 0,map:s,compact:u.compact,separate:u.separate,filter:function(n,u){return(0,r.isLeft)(n)||u(n.right)?n:t},filterMap:function(n,u){if((0,r.isLeft)(n))return n;var e=u(n.right);return"None"===e._tag?t:(0,r.right)(e.value)},partition:function(n,u){return(0,r.isLeft)(n)?(0,I.separated)(n,n):u(n.right)?(0,I.separated)(t,(0,r.right)(n.right)):(0,I.separated)((0,r.right)(n.right),t)},partitionMap:function(n,u){if((0,r.isLeft)(n))return(0,I.separated)(n,n);var e=u(n.right);return(0,r.isLeft)(e)?(0,I.separated)((0,r.right)(e.left),t):(0,I.separated)(t,(0,r.right)(e.right))}}},r.getWitherable=function(n){var t=(0,r.getFilterable)(n),u=(0,r.getCompactable)(n);return{URI:r.URI,_E:void 0,map:s,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:O,sequence:r.sequence,reduce:h,foldMap:R,reduceRight:U,wither:(0,b.witherDefault)(r.Traversable,u),wilt:(0,b.wiltDefault)(r.Traversable,u)}},r.getApplicativeValidation=function(n){return{URI:r.URI,_E:void 0,map:s,ap:function(t,u){return(0,r.isLeft)(t)?(0,r.isLeft)(u)?(0,r.left)(n.concat(t.left,u.left)):t:(0,r.isLeft)(u)?u:(0,r.right)(t.right(u.right))},of:r.of}},r.getAltValidation=function(n){return{URI:r.URI,_E:void 0,map:s,alt:function(t,u){if((0,r.isRight)(t))return t;var e=u();return(0,r.isLeft)(e)?(0,r.left)(n.concat(t.left,e.left)):e}}},r.map=function(n){return function(t){return(0,r.isLeft)(t)?t:(0,r.right)(n(t.right))}},r.Functor={URI:r.URI,map:s},r.as=(0,e.dual)(2,(0,a.as)(r.Functor)),r.asUnit=(0,a.asUnit)(r.Functor),r.of=r.right,r.Pointed={URI:r.URI,of:r.of},r.apW=function(n){return function(t){return(0,r.isLeft)(t)?t:(0,r.isLeft)(n)?n:(0,r.right)(t.right(n.right))}},r.ap=r.apW,r.Apply={URI:r.URI,map:s,ap:m},r.Applicative={URI:r.URI,map:s,ap:m,of:r.of},r.Chain={URI:r.URI,map:s,ap:m,chain:r.flatMap},r.Monad={URI:r.URI,map:s,ap:m,of:r.of,chain:r.flatMap},r.reduce=function(n,t){return function(u){return(0,r.isLeft)(u)?n:t(n,u.right)}},r.foldMap=function(n){return function(t){return function(u){return(0,r.isLeft)(u)?n.empty:t(u.right)}}},r.reduceRight=function(n,t){return function(u){return(0,r.isLeft)(u)?n:t(u.right,n)}},r.Foldable={URI:r.URI,reduce:h,foldMap:R,reduceRight:U},r.traverse=function(n){return function(t){return function(u){return(0,r.isLeft)(u)?n.of((0,r.left)(u.left)):n.map(t(u.right),r.right)}}},r.sequence=function(n){return function(t){return(0,r.isLeft)(t)?n.of((0,r.left)(t.left)):n.map(t.right,r.right)}},r.Traversable={URI:r.URI,map:s,reduce:h,foldMap:R,reduceRight:U,traverse:O,sequence:r.sequence},r.bimap=function(n,t){return function(u){return(0,r.isLeft)(u)?(0,r.left)(n(u.left)):(0,r.right)(t(u.right))}},r.mapLeft=function(n){return function(t){return(0,r.isLeft)(t)?(0,r.left)(n(t.left)):t}},r.Bifunctor={URI:r.URI,bimap:g,mapLeft:j},r.altW=function(n){return function(t){return(0,r.isLeft)(t)?n():t}},r.alt=r.altW,r.Alt={URI:r.URI,map:s,alt:M},r.extend=function(n){return function(t){return(0,r.isLeft)(t)?t:(0,r.right)(n(t))}},r.Extend={URI:r.URI,map:s,extend:y},r.ChainRec={URI:r.URI,map:s,ap:m,chain:r.flatMap,chainRec:x},r.throwError=r.left,r.MonadThrow={URI:r.URI,map:s,ap:m,of:r.of,chain:r.flatMap,throwError:r.throwError},r.FromEither={URI:r.URI,fromEither:e.identity},r.fromPredicate=(0,f.fromPredicate)(r.FromEither),r.fromOption=(0,f.fromOption)(r.FromEither),r.isLeft=p.isLeft,r.isRight=p.isRight,r.matchW=function(n,t){return function(u){return(0,r.isLeft)(u)?n(u.left):t(u.right)}},r.foldW=r.matchW,r.match=r.matchW,r.fold=r.match,r.getOrElseW=function(n){return function(t){return(0,r.isLeft)(t)?n(t.left):t.right}},r.getOrElse=r.getOrElseW,r.flap=(0,a.flap)(r.Functor),r.apFirst=(0,i.apFirst)(r.Apply),r.apFirstW=r.apFirst,r.apSecond=(0,i.apSecond)(r.Apply),r.apSecondW=r.apSecond,r.tap=(0,e.dual)(2,l.tap(r.Chain)),r.flattenW=(0,r.flatMap)(e.identity),r.flatten=r.flattenW,r.duplicate=(0,r.extend)(e.identity),r.fromOptionK=(0,f.fromOptionK)(r.FromEither),r.chainOptionK=(0,f.chainOptionK)(r.FromEither,r.Chain),r.chainOptionKW=r.chainOptionK;var _={fromEither:r.FromEither.fromEither};r.liftNullable=p.liftNullable(_),r.liftOption=p.liftOption(_);var W={flatMap:r.flatMap};r.flatMapNullable=p.flatMapNullable(_,W),r.flatMapOption=p.flatMapOption(_,W),r.filterOrElse=(0,f.filterOrElse)(r.FromEither,r.Chain),r.filterOrElseW=r.filterOrElse,r.swap=function(n){return(0,r.isLeft)(n)?(0,r.right)(n.left):(0,r.left)(n.right)},r.orElseW=function(n){return function(t){return(0,r.isLeft)(t)?n(t.left):t}},r.orElse=r.orElseW,r.fromNullable=function(n){return function(t){return null==t?(0,r.left)(n):(0,r.right)(t)}},r.tryCatch=function(n,t){try{return(0,r.right)(n())}catch(n){return(0,r.left)(t(n))}},r.tryCatchK=function(n,t){return function(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];return(0,r.tryCatch)((function(){return n.apply(void 0,u)}),t)}},r.fromNullableK=function(n){var t=(0,r.fromNullable)(n);return function(n){return(0,e.flow)(n,t)}},r.chainNullableK=function(n){var t=(0,r.fromNullableK)(n);return function(n){return(0,r.flatMap)(t(n))}},r.toUnion=(0,r.foldW)(e.identity,e.identity),r.toError=function(n){return n instanceof Error?n:new Error(String(n))},r.elem=function n(t){return function(u,e){if(void 0===e){var o=n(t);return function(n){return o(u,n)}}return!(0,r.isLeft)(e)&&t.equals(u,e.right)}},r.exists=function(n){return function(t){return!(0,r.isLeft)(t)&&n(t.right)}},r.Do=(0,r.of)(p.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=l.bind(r.Chain),r.bindW=r.bind,r.apS=(0,i.apS)(r.Apply),r.apSW=r.apS,r.ApT=(0,r.of)(p.emptyReadonlyArray),r.traverseReadonlyNonEmptyArrayWithIndex=function(n){return function(t){var u=n(0,p.head(t));if((0,r.isLeft)(u))return u;for(var e=[u.right],o=1;o<t.length;o++){var i=n(o,t[o]);if((0,r.isLeft)(i))return i;e.push(i.right)}return(0,r.right)(e)}},r.traverseReadonlyArrayWithIndex=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndex)(n);return function(n){return p.isNonEmpty(n)?t(n):r.ApT}},r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex,r.traverseArray=function(n){return(0,r.traverseReadonlyArrayWithIndex)((function(r,t){return n(t)}))},r.sequenceArray=(0,r.traverseArray)(e.identity),r.chainW=r.flatMap,r.chain=r.flatMap,r.chainFirst=r.tap,r.chainFirstW=r.tap,r.parseJSON=function(n,t){return(0,r.tryCatch)((function(){return JSON.parse(n)}),t)},r.stringifyJSON=function(n,t){return(0,r.tryCatch)((function(){var r=JSON.stringify(n);if("string"!=typeof r)throw new Error("Converting unsupported structure to JSON");return r}),t)},r.either={URI:r.URI,map:s,of:r.of,ap:m,chain:r.flatMap,reduce:h,foldMap:R,reduceRight:U,traverse:O,sequence:r.sequence,bimap:g,mapLeft:j,alt:M,extend:y,chainRec:x,throwError:r.throwError},r.getApplySemigroup=(0,i.getApplySemigroup)(r.Apply),r.getApplyMonoid=(0,w.getApplicativeMonoid)(r.Applicative),r.getValidationSemigroup=function(n,t){return(0,i.getApplySemigroup)((0,r.getApplicativeValidation)(n))(t)},r.getValidationMonoid=function(n,t){return(0,w.getApplicativeMonoid)((0,r.getApplicativeValidation)(n))(t)},r.getValidation=function(n){var t=(0,r.getApplicativeValidation)(n).ap,u=(0,r.getAltValidation)(n).alt;return{URI:r.URI,_E:void 0,map:s,of:r.of,chain:r.flatMap,bimap:g,mapLeft:j,reduce:h,foldMap:R,reduceRight:U,extend:y,traverse:O,sequence:r.sequence,chainRec:x,throwError:r.throwError,ap:t,alt:u}}})),En=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),o=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),c=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return o(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.getEitherM=r.toUnion=r.swap=r.orLeft=r.tapError=r.orElseFirst=r.orElse=r.getOrElse=r.matchE=r.match=r.altValidation=r.mapError=r.mapLeft=r.mapBoth=r.bimap=r.alt=r.flatMap=r.chain=r.ap=r.map=r.chainNullableK=r.fromNullableK=r.fromNullable=r.leftF=r.rightF=r.left=r.right=void 0;var f=c(Wn);function v(n){return(0,e.flow)(f.right,n.of)}function d(n){return(0,e.flow)(f.left,n.of)}function l(n){return function(r){return n.map(r,f.right)}}function p(n){return function(r){return n.map(r,f.left)}}function s(n){return function(r){return(0,e.flow)(f.fromNullable(r),n.of)}}function m(n){var r=s(n);return function(n){var t=r(n);return function(n){return(0,e.flow)(n,t)}}}function h(n){return(0,a.map)(n,f.Functor)}function I(n){return(0,i.ap)(n,f.Apply)}function b(n){var r=R(n);return function(n){return function(t){return r(t,n)}}}function R(n){return function(r,t){return n.chain(r,(function(r){return f.isLeft(r)?n.of(r):t(r.right)}))}}function U(n){return function(r){return function(t){return n.chain(t,(function(t){return f.isLeft(t)?r():n.of(t)}))}}}function O(n){var r=g(n);return function(n,t){return function(u){return r(u,n,t)}}}function g(n){return function(r,t,u){return n.map(r,f.bimap(t,u))}}function j(n){var r=M(n);return function(n){return function(t){return r(t,n)}}}function M(n){return function(r,t){return n.map(r,f.mapLeft(t))}}function y(n){return function(r,t){return function(u){return n.chain(u,f.match(r,t))}}}function w(n){return function(r){return function(t){return n.chain(t,f.match(r,n.of))}}}function x(n){return function(r){return function(t){return n.chain(t,(function(t){return f.isLeft(t)?r(t.left):n.of(t)}))}}}function _(n){var r=x(n);return function(t,u){return(0,e.pipe)(t,r((function(r){return n.map(u(r),(function(n){return f.isLeft(n)?n:f.left(r)}))})))}}function W(n){return function(r){return n.map(r,f.swap)}}r.right=v,r.left=d,r.rightF=l,r.leftF=p,r.fromNullable=s,r.fromNullableK=m,r.chainNullableK=function(n){var r=b(n),t=m(n);return function(n){var u=t(n);return function(n){return r(u(n))}}},r.map=h,r.ap=I,r.chain=b,r.flatMap=R,r.alt=U,r.bimap=O,r.mapBoth=g,r.mapLeft=j,r.mapError=M,r.altValidation=function(n,r){return function(t){return function(u){return n.chain(u,f.match((function(u){return n.map(t(),f.mapLeft((function(n){return r.concat(u,n)})))}),v(n)))}}},r.match=function(n){return function(r,t){return function(u){return n.map(u,f.match(r,t))}}},r.matchE=y,r.getOrElse=w,r.orElse=x,r.orElseFirst=function(n){var r=_(n);return function(n){return function(t){return r(t,n)}}},r.tapError=_,r.orLeft=function(n){return function(r){return function(t){return n.chain(t,f.match((function(t){return n.map(r(t),f.left)}),(function(r){return n.of(f.right(r))})))}}},r.swap=W,r.toUnion=function(n){return function(r){return n.map(r,f.toUnion)}},r.getEitherM=function(n){var r=I(n),t=h(n),u=b(n),o=U(n),i=O(n),c=j(n),f=y(n),a=w(n),s=x(n);return{map:function(n,r){return(0,e.pipe)(n,t(r))},ap:function(n,t){return(0,e.pipe)(n,r(t))},of:v(n),chain:function(n,r){return(0,e.pipe)(n,u(r))},alt:function(n,r){return(0,e.pipe)(n,o(r))},bimap:function(n,r,t){return(0,e.pipe)(n,i(r,t))},mapLeft:function(n,r){return(0,e.pipe)(n,c(r))},fold:function(n,r,t){return(0,e.pipe)(n,f(r,t))},getOrElse:function(n,r){return(0,e.pipe)(n,a(r))},orElse:function(n,r){return(0,e.pipe)(n,s(r))},swap:W(n),rightM:l(n),leftM:p(n),left:d(n)}}})),qn=u((function(n,r){function t(n,r){return function(t){return function(u){return n.map(u,(function(n){return r.filter(n,t)}))}}}function u(n,r){return function(t){return function(u){return n.map(u,(function(n){return r.filterMap(n,t)}))}}}function o(n,r){var u=t(n,r);return function(n){var r=u((0,x.not)(n)),t=u(n);return function(n){return(0,I.separated)(r(n),t(n))}}}function i(n,r){var t=u(n,r);return function(n){return function(r){return(0,I.separated)((0,e.pipe)(r,t((function(r){return(0,_.getLeft)(n(r))}))),(0,e.pipe)(r,t((function(r){return(0,_.getRight)(n(r))}))))}}}Object.defineProperty(r,"__esModule",{value:!0}),r.getFilterableComposition=r.partitionMap=r.partition=r.filterMap=r.filter=void 0,r.filter=t,r.filterMap=u,r.partition=o,r.partitionMap=i,r.getFilterableComposition=function(n,r){var c=(0,a.getFunctorComposition)(n,r).map,f=(0,xn.compact)(n,r),v=(0,xn.separate)(n,r,r),d=t(n,r),l=u(n,r),p=o(n,r),s=i(n,r);return{map:c,compact:f,separate:v,filter:function(n,r){return(0,e.pipe)(n,d(r))},filterMap:function(n,r){return(0,e.pipe)(n,l(r))},partition:function(n,r){return(0,e.pipe)(n,p(r))},partitionMap:function(n,r){return(0,e.pipe)(n,s(r))}}}})),kn=u((function(n,r){function t(n,r){var t=(0,c.tap)(r);return function(r,u){return t(r,(0,e.flow)(u,n.fromIO))}}Object.defineProperty(r,"__esModule",{value:!0}),r.tapIO=r.chainFirstIOK=r.chainIOK=r.fromIOK=void 0,r.fromIOK=function(n){return function(r){return(0,e.flow)(r,n.fromIO)}},r.chainIOK=function(n,r){return function(t){var u=(0,e.flow)(t,n.fromIO);return function(n){return r.chain(n,u)}}},r.chainFirstIOK=function(n,r){var u=t(n,r);return function(n){return function(r){return u(r,n)}}},r.tapIO=t})),An=u((function(n,r){function t(n,r){var t=(0,c.tap)(r);return function(r,u){return t(r,(0,e.flow)(u,n.fromTask))}}Object.defineProperty(r,"__esModule",{value:!0}),r.tapTask=r.chainFirstTaskK=r.chainTaskK=r.fromTaskK=void 0,r.fromTaskK=function(n){return function(r){return(0,e.flow)(r,n.fromTask)}},r.chainTaskK=function(n,r){return function(t){var u=(0,e.flow)(t,n.fromTask);return function(n){return r.chain(n,u)}}},r.chainFirstTaskK=function(n,r){var u=t(n,r);return function(n){return function(r){return u(r,n)}}},r.tapTask=t})),Pn=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),f=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),v=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return f(r,n),r};Object.defineProperty(r,"__esModule",{value:!0}),r.sequenceSeqArray=r.traverseSeqArray=r.traverseSeqArrayWithIndex=r.sequenceArray=r.traverseArray=r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndexSeq=r.traverseReadonlyNonEmptyArrayWithIndexSeq=r.traverseReadonlyArrayWithIndex=r.traverseReadonlyNonEmptyArrayWithIndex=r.ApT=r.apS=r.bind=r.let=r.bindTo=r.Do=r.never=r.FromTask=r.chainFirstIOK=r.chainIOK=r.fromIOK=r.tapIO=r.tap=r.flatMapIO=r.FromIO=r.MonadTask=r.fromTask=r.MonadIO=r.Monad=r.Chain=r.ApplicativeSeq=r.ApplySeq=r.ApplicativePar=r.apSecond=r.apFirst=r.ApplyPar=r.Pointed=r.flap=r.asUnit=r.as=r.Functor=r.getRaceMonoid=r.URI=r.flatten=r.flatMap=r.of=r.ap=r.map=r.delay=r.fromIO=void 0,r.getMonoid=r.getSemigroup=r.taskSeq=r.task=r.chainFirst=r.chain=void 0;var d=v(c),l=v(o);r.fromIO=function(n){return function(){return Promise.resolve().then(n)}},r.delay=function(n){return function(r){return function(){return new Promise((function(t){setTimeout((function(){Promise.resolve().then(r).then(t)}),n)}))}}};var p=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},s=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},m=function(n,t){return(0,r.flatMap)(n,(function(n){return(0,e.pipe)(t,(0,r.map)(n))}))};r.map=function(n){return function(r){return function(){return Promise.resolve().then(r).then(n)}}},r.ap=function(n){return function(r){return function(){return Promise.all([Promise.resolve().then(r),Promise.resolve().then(n)]).then((function(n){return(0,n[0])(n[1])}))}}},r.of=function(n){return function(){return Promise.resolve(n)}},r.flatMap=(0,e.dual)(2,(function(n,r){return function(){return Promise.resolve().then(n).then((function(n){return r(n)()}))}})),r.flatten=(0,r.flatMap)(e.identity),r.URI="Task",r.getRaceMonoid=function(){return{concat:function(n,r){return function(){return Promise.race([Promise.resolve().then(n),Promise.resolve().then(r)])}},empty:r.never}},r.Functor={URI:r.URI,map:p},r.as=(0,e.dual)(2,(0,a.as)(r.Functor)),r.asUnit=(0,a.asUnit)(r.Functor),r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.ApplyPar={URI:r.URI,map:p,ap:s},r.apFirst=(0,i.apFirst)(r.ApplyPar),r.apSecond=(0,i.apSecond)(r.ApplyPar),r.ApplicativePar={URI:r.URI,map:p,ap:s,of:r.of},r.ApplySeq={URI:r.URI,map:p,ap:m},r.ApplicativeSeq={URI:r.URI,map:p,ap:m,of:r.of},r.Chain={URI:r.URI,map:p,ap:s,chain:r.flatMap},r.Monad={URI:r.URI,map:p,of:r.of,ap:s,chain:r.flatMap},r.MonadIO={URI:r.URI,map:p,of:r.of,ap:s,chain:r.flatMap,fromIO:r.fromIO},r.fromTask=e.identity,r.MonadTask={URI:r.URI,map:p,of:r.of,ap:s,chain:r.flatMap,fromIO:r.fromIO,fromTask:r.fromTask},r.FromIO={URI:r.URI,fromIO:r.fromIO},r.flatMapIO=l.flatMapIO({fromIO:r.FromIO.fromIO},{flatMap:r.flatMap}),r.tap=(0,e.dual)(2,d.tap(r.Chain)),r.tapIO=(0,e.dual)(2,(0,kn.tapIO)(r.FromIO,r.Chain)),r.fromIOK=(0,kn.fromIOK)(r.FromIO),r.chainIOK=r.flatMapIO,r.chainFirstIOK=r.tapIO,r.FromTask={URI:r.URI,fromIO:r.fromIO,fromTask:r.fromTask},r.never=function(){return new Promise((function(){}))},r.Do=(0,r.of)(l.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=d.bind(r.Chain),r.apS=(0,i.apS)(r.ApplyPar),r.ApT=(0,r.of)(l.emptyReadonlyArray),r.traverseReadonlyNonEmptyArrayWithIndex=function(n){return function(r){return function(){return Promise.all(r.map((function(r,t){return Promise.resolve().then((function(){return n(t,r)()}))})))}}},r.traverseReadonlyArrayWithIndex=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndex)(n);return function(n){return l.isNonEmpty(n)?t(n):r.ApT}},r.traverseReadonlyNonEmptyArrayWithIndexSeq=function(n){return function(r){return function(){return l.tail(r).reduce((function(r,t,u){return r.then((function(r){return Promise.resolve().then(n(u+1,t)).then((function(n){return r.push(n),r}))}))}),Promise.resolve().then(n(0,l.head(r))).then(l.singleton))}}},r.traverseReadonlyArrayWithIndexSeq=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndexSeq)(n);return function(n){return l.isNonEmpty(n)?t(n):r.ApT}},r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex,r.traverseArray=function(n){return(0,r.traverseReadonlyArrayWithIndex)((function(r,t){return n(t)}))},r.sequenceArray=(0,r.traverseArray)(e.identity),r.traverseSeqArrayWithIndex=r.traverseReadonlyArrayWithIndexSeq,r.traverseSeqArray=function(n){return(0,r.traverseReadonlyArrayWithIndexSeq)((function(r,t){return n(t)}))},r.sequenceSeqArray=(0,r.traverseSeqArray)(e.identity),r.chain=r.flatMap,r.chainFirst=r.tap,r.task={URI:r.URI,map:p,of:r.of,ap:s,chain:r.flatMap,fromIO:r.fromIO,fromTask:r.fromTask},r.taskSeq={URI:r.URI,map:p,of:r.of,ap:m,chain:r.flatMap,fromIO:r.fromIO,fromTask:r.fromTask},r.getSemigroup=(0,i.getApplySemigroup)(r.ApplySeq),r.getMonoid=(0,w.getApplicativeMonoid)(r.ApplicativeSeq)})),Tn=u((function(n,r){var u=t&&t.__createBinding||(Object.create?function(n,r,t,u){void 0===u&&(u=t);var e=Object.getOwnPropertyDescriptor(r,t);e&&!("get"in e?!r.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(n,u,e)}:function(n,r,t,u){void 0===u&&(u=t),n[u]=r[t]}),v=t&&t.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),d=t&&t.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var t in n)"default"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&u(r,n,t);return v(r,n),r},l=t&&t.__awaiter||function(n,r,t,u){return new(t||(t=Promise))((function(e,o){function i(n){try{f(u.next(n))}catch(n){o(n)}}function c(n){try{f(u.throw(n))}catch(n){o(n)}}function f(n){var r;n.done?e(n.value):(r=n.value,r instanceof t?r:new t((function(n){n(r)}))).then(i,c)}f((u=u.apply(n,r||[])).next())}))},p=t&&t.__generator||function(n,r){var t,u,e,o,i={label:0,sent:function(){if(1&e[0])throw e[1];return e[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(f){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(t=1,u&&(e=2&c[0]?u.return:c[0]?u.throw||((e=u.return)&&e.call(u),0):u.next)&&!(e=e.call(u,c[1])).done)return e;switch(u=0,e&&(c=[2&c[0],e.value]),c[0]){case 0:case 1:e=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,u=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!((e=(e=i.trys).length>0&&e[e.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!e||c[1]>e[0]&&c[1]<e[3])){i.label=c[1];break}if(6===c[0]&&i.label<e[1]){i.label=e[1],e=c;break}if(e&&i.label<e[2]){i.label=e[2],i.ops.push(c);break}e[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(n){c=[6,n],u=0}finally{t=e=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,f])}}};Object.defineProperty(r,"__esModule",{value:!0}),r.throwError=r.of=r.altW=r.alt=r.flatten=r.flattenW=r.flatMap=r.apW=r.ap=r.mapLeft=r.mapError=r.bimap=r.mapBoth=r.map=r.fromIOEitherK=r.chainTaskOptionK=r.chainTaskOptionKW=r.fromTaskOptionK=r.swap=r.orLeft=r.orElseFirstTaskK=r.orElseFirstIOK=r.tapError=r.orElseW=r.orElse=r.chainNullableK=r.fromNullableK=r.fromNullable=r.toUnion=r.tryCatchK=r.tryCatch=r.getOrElseW=r.getOrElse=r.foldW=r.matchEW=r.fold=r.matchE=r.matchW=r.match=r.fromTaskOption=r.fromIOEither=r.fromEither=r.fromTask=r.fromIO=r.leftIO=r.rightIO=r.leftTask=r.rightTask=r.right=r.left=void 0,r.fromPredicate=r.chainFirstEitherKW=r.chainFirstEitherK=r.chainEitherKW=r.chainEitherK=r.flatMapTaskOption=r.flatMapIOEither=r.flatMapTask=r.flatMapIO=r.flatMapEither=r.flatMapOption=r.flatMapNullable=r.liftOption=r.liftNullable=r.chainOptionKW=r.chainOptionK=r.fromOptionK=r.fromOption=r.Alt=r.Bifunctor=r.tapTask=r.tapIO=r.tapEither=r.tap=r.FromTask=r.FromIO=r.FromEither=r.MonadThrow=r.MonadTask=r.MonadIO=r.Monad=r.Chain=r.ApplicativeSeq=r.ApplySeq=r.ApplicativePar=r.apSecondW=r.apSecond=r.apFirstW=r.apFirst=r.ApplyPar=r.Pointed=r.flap=r.asUnit=r.as=r.Functor=r.getFilterable=r.getCompactable=r.getAltTaskValidation=r.getApplicativeTaskValidation=r.URI=void 0,r.getTaskValidation=r.getSemigroup=r.getApplyMonoid=r.getApplySemigroup=r.taskEitherSeq=r.taskEither=r.orElseFirstW=r.orElseFirst=r.chainFirstW=r.chainFirst=r.chainW=r.chain=r.sequenceSeqArray=r.traverseSeqArray=r.traverseSeqArrayWithIndex=r.sequenceArray=r.traverseArray=r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndexSeq=r.traverseReadonlyNonEmptyArrayWithIndexSeq=r.traverseReadonlyArrayWithIndex=r.traverseReadonlyNonEmptyArrayWithIndex=r.ApT=r.apSW=r.apS=r.bindW=r.bind=r.let=r.bindTo=r.Do=r.bracketW=r.bracket=r.taskify=r.chainIOEitherK=r.chainIOEitherKW=r.chainFirstTaskK=r.chainTaskK=r.fromTaskK=r.chainFirstIOK=r.chainIOK=r.fromIOK=r.fromEitherK=r.filterOrElseW=r.filterOrElse=void 0;var s=d(c),m=d(Wn),h=d(En),I=d(o),b=d(Pn);r.left=h.left(b.Pointed),r.right=h.right(b.Pointed),r.rightTask=h.rightF(b.Functor),r.leftTask=h.leftF(b.Functor),r.rightIO=(0,e.flow)(b.fromIO,r.rightTask),r.leftIO=(0,e.flow)(b.fromIO,r.leftTask),r.fromIO=r.rightIO,r.fromTask=r.rightTask,r.fromEither=b.of,r.fromIOEither=b.fromIO,r.fromTaskOption=function(n){return b.map(m.fromOption(n))},r.match=h.match(b.Functor),r.matchW=r.match,r.matchE=h.matchE(b.Monad),r.fold=r.matchE,r.matchEW=r.matchE,r.foldW=r.matchEW,r.getOrElse=h.getOrElse(b.Monad),r.getOrElseW=r.getOrElse,r.tryCatch=function(n,r){return function(){return l(void 0,void 0,void 0,(function(){var t;return p(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,n().then(I.right)];case 1:return[2,u.sent()];case 2:return t=u.sent(),[2,I.left(r(t))];case 3:return[2]}}))}))}},r.tryCatchK=function(n,t){return function(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];return(0,r.tryCatch)((function(){return n.apply(void 0,u)}),t)}},r.toUnion=h.toUnion(b.Functor),r.fromNullable=h.fromNullable(b.Pointed),r.fromNullableK=h.fromNullableK(b.Pointed),r.chainNullableK=h.chainNullableK(b.Monad),r.orElse=h.orElse(b.Monad),r.orElseW=r.orElse,r.tapError=(0,e.dual)(2,h.tapError(b.Monad)),r.orElseFirstIOK=function(n){return(0,r.tapError)((0,r.fromIOK)(n))},r.orElseFirstTaskK=function(n){return(0,r.tapError)((0,r.fromTaskK)(n))},r.orLeft=h.orLeft(b.Monad),r.swap=h.swap(b.Functor),r.fromTaskOptionK=function(n){var t=(0,r.fromTaskOption)(n);return function(n){return(0,e.flow)(n,t)}},r.chainTaskOptionKW=function(n){return function(t){return function(u){return(0,r.flatMap)(u,(0,r.fromTaskOptionK)(n)(t))}}},r.chainTaskOptionK=r.chainTaskOptionKW,r.fromIOEitherK=function(n){return(0,e.flow)(n,r.fromIOEither)};var R=function(n,t){return(0,e.pipe)(n,(0,r.map)(t))},U=function(n,t){return(0,e.pipe)(n,(0,r.ap)(t))},O=function(n,t){return(0,r.flatMap)(n,(function(n){return(0,e.pipe)(t,(0,r.map)(n))}))},g=function(n,t){return(0,e.pipe)(n,(0,r.alt)(t))};function j(n,t){var u=(0,i.ap)(n,m.getApplicativeValidation(t));return{URI:r.URI,_E:void 0,map:R,ap:function(n,r){return(0,e.pipe)(n,u(r))},of:r.of}}function M(n){var t=h.altValidation(b.Monad,n);return{URI:r.URI,_E:void 0,map:R,alt:function(n,r){return(0,e.pipe)(n,t(r))}}}r.map=h.map(b.Functor),r.mapBoth=(0,e.dual)(3,h.mapBoth(b.Functor)),r.bimap=r.mapBoth,r.mapError=(0,e.dual)(2,h.mapError(b.Functor)),r.mapLeft=r.mapError,r.ap=h.ap(b.ApplyPar),r.apW=r.ap,r.flatMap=(0,e.dual)(2,h.flatMap(b.Monad)),r.flattenW=(0,r.flatMap)(e.identity),r.flatten=r.flattenW,r.alt=h.alt(b.Monad),r.altW=r.alt,r.of=r.right,r.throwError=r.left,r.URI="TaskEither",r.getApplicativeTaskValidation=j,r.getAltTaskValidation=M,r.getCompactable=function(n){var t=m.getCompactable(n);return{URI:r.URI,_E:void 0,compact:(0,xn.compact)(b.Functor,t),separate:(0,xn.separate)(b.Functor,t,m.Functor)}},r.getFilterable=function(n){var t=m.getFilterable(n),u=(0,r.getCompactable)(n),o=(0,qn.filter)(b.Functor,t),i=(0,qn.filterMap)(b.Functor,t),c=(0,qn.partition)(b.Functor,t),f=(0,qn.partitionMap)(b.Functor,t);return{URI:r.URI,_E:void 0,map:R,compact:u.compact,separate:u.separate,filter:function(n,r){return(0,e.pipe)(n,o(r))},filterMap:function(n,r){return(0,e.pipe)(n,i(r))},partition:function(n,r){return(0,e.pipe)(n,c(r))},partitionMap:function(n,r){return(0,e.pipe)(n,f(r))}}},r.Functor={URI:r.URI,map:R},r.as=(0,e.dual)(2,(0,a.as)(r.Functor)),r.asUnit=(0,a.asUnit)(r.Functor),r.flap=(0,a.flap)(r.Functor),r.Pointed={URI:r.URI,of:r.of},r.ApplyPar={URI:r.URI,map:R,ap:U},r.apFirst=(0,i.apFirst)(r.ApplyPar),r.apFirstW=r.apFirst,r.apSecond=(0,i.apSecond)(r.ApplyPar),r.apSecondW=r.apSecond,r.ApplicativePar={URI:r.URI,map:R,ap:U,of:r.of},r.ApplySeq={URI:r.URI,map:R,ap:O},r.ApplicativeSeq={URI:r.URI,map:R,ap:O,of:r.of},r.Chain={URI:r.URI,map:R,ap:U,chain:r.flatMap},r.Monad={URI:r.URI,map:R,ap:U,chain:r.flatMap,of:r.of},r.MonadIO={URI:r.URI,map:R,ap:U,chain:r.flatMap,of:r.of,fromIO:r.fromIO},r.MonadTask={URI:r.URI,map:R,ap:U,chain:r.flatMap,of:r.of,fromIO:r.fromIO,fromTask:r.fromTask},r.MonadThrow={URI:r.URI,map:R,ap:U,chain:r.flatMap,of:r.of,throwError:r.throwError},r.FromEither={URI:r.URI,fromEither:r.fromEither},r.FromIO={URI:r.URI,fromIO:r.fromIO},r.FromTask={URI:r.URI,fromIO:r.fromIO,fromTask:r.fromTask},r.tap=(0,e.dual)(2,s.tap(r.Chain)),r.tapEither=(0,e.dual)(2,(0,f.tapEither)(r.FromEither,r.Chain)),r.tapIO=(0,e.dual)(2,(0,kn.tapIO)(r.FromIO,r.Chain)),r.tapTask=(0,e.dual)(2,(0,An.tapTask)(r.FromTask,r.Chain)),r.Bifunctor={URI:r.URI,bimap:r.mapBoth,mapLeft:r.mapError},r.Alt={URI:r.URI,map:R,alt:g},r.fromOption=(0,f.fromOption)(r.FromEither),r.fromOptionK=(0,f.fromOptionK)(r.FromEither),r.chainOptionK=(0,f.chainOptionK)(r.FromEither,r.Chain),r.chainOptionKW=r.chainOptionK;var y={fromEither:r.FromEither.fromEither};r.liftNullable=I.liftNullable(y),r.liftOption=I.liftOption(y);var x={flatMap:r.flatMap},_={fromIO:r.FromIO.fromIO},W={fromTask:r.fromTask};r.flatMapNullable=I.flatMapNullable(y,x),r.flatMapOption=I.flatMapOption(y,x),r.flatMapEither=I.flatMapEither(y,x),r.flatMapIO=I.flatMapIO(_,x),r.flatMapTask=I.flatMapTask(W,x),r.flatMapIOEither=(0,e.dual)(2,(function(n,t){return(0,r.flatMap)(n,(0,r.fromIOEitherK)(t))})),r.flatMapTaskOption=(0,e.dual)(3,(function(n,t,u){return(0,r.flatMap)(n,(function(n){return(0,r.fromTaskOption)((function(){return u(n)}))(t(n))}))})),r.chainEitherK=r.flatMapEither,r.chainEitherKW=r.flatMapEither,r.chainFirstEitherK=r.tapEither,r.chainFirstEitherKW=r.tapEither,r.fromPredicate=(0,f.fromPredicate)(r.FromEither),r.filterOrElse=(0,f.filterOrElse)(r.FromEither,r.Chain),r.filterOrElseW=r.filterOrElse,r.fromEitherK=(0,f.fromEitherK)(r.FromEither),r.fromIOK=(0,kn.fromIOK)(r.FromIO),r.chainIOK=r.flatMapIO,r.chainFirstIOK=r.tapIO,r.fromTaskK=(0,An.fromTaskK)(r.FromTask),r.chainTaskK=r.flatMapTask,r.chainFirstTaskK=r.tapTask,r.chainIOEitherKW=r.flatMapIOEither,r.chainIOEitherK=r.flatMapIOEither,r.taskify=function(n){return function(){var r=Array.prototype.slice.call(arguments);return function(){return new Promise((function(t){n.apply(null,r.concat((function(n,r){return t(null!=n?I.left(n):I.right(r))})))}))}}},r.bracket=function(n,t,u){return(0,r.bracketW)(n,t,u)},r.bracketW=function(n,t,u){return(0,r.flatMap)(n,(function(n){return b.flatMap(t(n),(function(t){return(0,r.flatMap)(u(n,t),(function(){return b.of(t)}))}))}))},r.Do=(0,r.of)(I.emptyRecord),r.bindTo=(0,a.bindTo)(r.Functor),r.let=(0,a.let)(r.Functor),r.bind=s.bind(r.Chain),r.bindW=r.bind,r.apS=(0,i.apS)(r.ApplyPar),r.apSW=r.apS,r.ApT=(0,r.of)(I.emptyReadonlyArray),r.traverseReadonlyNonEmptyArrayWithIndex=function(n){return(0,e.flow)(b.traverseReadonlyNonEmptyArrayWithIndex(n),b.map(m.traverseReadonlyNonEmptyArrayWithIndex(e.SK)))},r.traverseReadonlyArrayWithIndex=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndex)(n);return function(n){return I.isNonEmpty(n)?t(n):r.ApT}},r.traverseReadonlyNonEmptyArrayWithIndexSeq=function(n){return function(r){return function(){return I.tail(r).reduce((function(r,t,u){return r.then((function(e){return I.isLeft(e)?r:n(u+1,t)().then((function(n){return I.isLeft(n)?n:(e.right.push(n.right),e)}))}))}),n(0,I.head(r))().then(m.map(I.singleton)))}}},r.traverseReadonlyArrayWithIndexSeq=function(n){var t=(0,r.traverseReadonlyNonEmptyArrayWithIndexSeq)(n);return function(n){return I.isNonEmpty(n)?t(n):r.ApT}},r.traverseArrayWithIndex=r.traverseReadonlyArrayWithIndex,r.traverseArray=function(n){return(0,r.traverseReadonlyArrayWithIndex)((function(r,t){return n(t)}))},r.sequenceArray=(0,r.traverseArray)(e.identity),r.traverseSeqArrayWithIndex=r.traverseReadonlyArrayWithIndexSeq,r.traverseSeqArray=function(n){return(0,r.traverseReadonlyArrayWithIndexSeq)((function(r,t){return n(t)}))},r.sequenceSeqArray=(0,r.traverseSeqArray)(e.identity),r.chain=r.flatMap,r.chainW=r.flatMap,r.chainFirst=r.tap,r.chainFirstW=r.tap,r.orElseFirst=r.tapError,r.orElseFirstW=r.tapError,r.taskEither={URI:r.URI,bimap:r.mapBoth,mapLeft:r.mapError,map:R,of:r.of,ap:U,chain:r.flatMap,alt:g,fromIO:r.fromIO,fromTask:r.fromTask,throwError:r.throwError},r.taskEitherSeq={URI:r.URI,bimap:r.mapBoth,mapLeft:r.mapError,map:R,of:r.of,ap:O,chain:r.flatMap,alt:g,fromIO:r.fromIO,fromTask:r.fromTask,throwError:r.throwError},r.getApplySemigroup=(0,i.getApplySemigroup)(r.ApplySeq),r.getApplyMonoid=(0,w.getApplicativeMonoid)(r.ApplicativeSeq),r.getSemigroup=function(n){return(0,i.getApplySemigroup)(b.ApplySeq)(m.getSemigroup(n))},r.getTaskValidation=function(n){var t=j(b.ApplicativePar,n),u=M(n);return{URI:r.URI,_E:void 0,map:R,ap:t.ap,of:r.of,chain:r.flatMap,bimap:r.mapBoth,mapLeft:r.mapError,alt:u.alt,fromIO:r.fromIO,fromTask:r.fromTask,throwError:r.throwError}}}));const{state:Ln}=y(Object.assign({fallbackStyles:"",pricePrefix:null,currencySign:null,apiPath:null,token:null,locale:"de-DE"},{trackingEnabled:!0})),zn=n=>({kind:"server",inner:n}),Nn={kind:"client",inner:"Token not exist or empty"},Sn={kind:"client",inner:"Api path empty or missing"},Cn=rn({concat:function(n,r){return n+r},empty:""}),Fn=()=>q(rn({concat:W}).concat(on(Ln.apiPath),on("https://api.vviinn.com")),K((()=>Sn))),$n=(Dn={method:{concat:(n,r)=>q(Cn.concat(on(n),on(r)),en((()=>"GET")))},body:{concat:function(n,r){return r}},headers:{concat:(n,r)=>{const t=new Headers;return void 0!==n&&n.forEach(((n,r)=>t.append(r,n))),void 0!==r&&r.forEach(((n,r)=>t.append(r,n))),t}}},{concat:function(n,r){var t={};for(var u in Dn)L.call(Dn,u)&&(t[u]=Dn[u].concat(n[u],r[u]));return t}});var Dn;const Hn=n=>({method:n}),Jn=C(Hn("POST")),Gn=H((([n,r])=>(n.set("Content-Type","application/json"),{headers:n,body:r}))),Bn=n=>n.status>=200&&n.status<300?Tn.right(n):Tn.left(n),Kn=$n,Vn=(n,r)=>([t,u])=>{const o=new URL(n,t),i=Kn.concat(u,r);return e.pipe(((n,r={})=>e.pipe(((n,r={method:"GET"})=>Tn.tryCatch((()=>fetch(n,r)),(n=>n)))(n,r),Tn.chain(Bn),Tn.chain((n=>function(n){return Tn.fromTask((()=>n.json()))}(n)))))(o.toString(),i),Tn.mapLeft(zn))},Xn=i.sequenceT(Wn.Apply),Yn=n=>(n=>0===n.length)(n)?S("entity is empty"):C(n),Qn=n=>q(n,("entity not exist",function(n){return null==n?S("entity not exist"):C(n)}),Q(Yn)),Zn=n=>n.length?`?${n.join("&")}`:"",nr=n=>n.split(";").map((n=>n?`excluded[]=${n}`:"")).join("&"),rr={equals:(n,r)=>n.class===r.class&&n.score===r.score&&n.rectangle.left===r.rectangle.left&&n.rectangle.top===r.rectangle.top&&n.rectangle.height===r.rectangle.height&&n.rectangle.width===r.rectangle.width},tr=(n,r,t,u)=>{const o="search/session",i=e.pipe(on(r),(f=()=>{const n=[];t&&n.push(t);const r=Zn(n);return`${o}${r}`},a=n=>{const r=[];n&&r.push(`campaign-id=${n}`),t&&r.push(t);const u=Zn(r);return`${o}${u}`},function(n){return un(n)?f():a(n.value)})),c=u?e.pipe(on(u),K((()=>Sn))):Fn();var f,a;return e.pipe(Xn(c,Jn),Rn,wn(Vn(i,n)))},ur=n=>e.pipe(Xn(Fn(),Jn),Rn,wn(Vn("text-search",n))),er=n=>e.pipe(Xn(Fn(),Jn),Rn,wn(Vn("product-listing-page",n)));var or;!function(n){n.eform="eform",n.etype="etype",n.form="form",n.href="href",n.method="method",n.accepts="accepts",n.produces="produces",n.rel="rel",n.type="type",n.value="value"}(or||(or={}));const ir=n=>"array"===n.type?n.value.map(ir):n.value,cr=(n,r)=>q(n.links,on,cn((n=>on(n[r])))),fr=n=>{return q(n,(r=n=>n.href,function(n){return un(n)?Z:nn(r(n.value))}),en((()=>null)));var r},ar=n=>r=>q(Xn(Fn(),C(Hn(n.method))),Rn,wn(Vn(n.href,r))),vr=n=>({x:0,y:0,width:n.width,height:n.height}),dr=n=>Object.assign({x:n.left,y:n.top},n),lr=n=>r=>({x:r.x*n.width,y:r.y*n.height,width:r.width*n.width,height:r.height*n.height}),pr=n=>({x:n.x+.5*n.width,y:n.y+.5*n.height}),sr=(n,r)=>{const{clientX:t,clientY:u}=n;return t>=r.left&&t<=r.right&&u>=r.top&&u<=r.bottom};var mr;!function(n){n.desc="desc",n.eform="eform",n.enabled="enabled",n.etype="etype",n.form="form",n.label="label",n.max="max",n.maxlength="maxlength",n.maxsize="maxsize",n.min="min",n.minlength="minlength",n.minsize="minsize",n.mutable="mutable",n.name="name",n.options="options",n.pattern="pattern",n.placeholder="placeholder",n.required="required",n.secret="secret",n.type="type",n.value="value",n.visible="visible"}(mr||(mr={}));const hr=(n,r)=>{const t=new URLSearchParams(Object.entries(r));return[`${n.href}?${t.toString()}`,{method:"GET"}]},Ir=(n,r)=>[n.href,{body:JSON.stringify(r),method:n.method,headers:new Headers({"Content-Type":"application/ion+json"})}],br=(n,r={})=>t=>e.pipe(Xn(Fn(),e.pipe(((n,r)=>e.pipe(((n,r)=>{const t=n.map((n=>n.name)),u=Object.keys(r),e=t.filter((n=>!u.includes(n)));return 0===e.length?C(r):S(`Data should contains fields: ${e.join(", ")}`)})(n.value,r),H((r=>n.rel.includes("query-form")?hr(n,r):Ir(n,r)))))(n,r),B((n=>({kind:"app",inner:n}))))),Rn,wn((n=>{const r=n[0],[u,e]=n[1];return Vn(u,e)([r,t])}))),Rr=async n=>new Promise((r=>{const t=new FileReader;t.addEventListener("load",(()=>{r(t.result)})),t.readAsDataURL(n)})),Ur=i.sequenceT(_.Apply),Or=n=>new Headers({Authorization:`Bearer ${n}`}),gr=n=>q(n,Qn,Wn.mapLeft((()=>Nn))),jr=n=>q(n,gr,Wn.map(Or)),Mr=(n,r)=>Xn(jr(n),Wn.right(JSON.stringify(r))),yr=n=>{const r=new FormData;return r.append("image",n),r};const wr=["jpg","jpeg","png","webp"],xr={kind:"client",inner:"File format not supported"},_r=n=>{const r=n.type.split("/")[1],t=(u=t=>t===r?_.some(n):_.none,function(n){for(var r=0;r<n.length;r++){var t=u(n[r]);if("Some"===t._tag)return t}return A})(wr);var u;return e.pipe(t,Wn.fromOption((()=>xr)))},Wr={kind:"app",inner:"File doesnt exist"},Er=n=>()=>new Promise((r=>{const t=new FileReader,u=new Image;t.onload=n=>{u.src=n.target.result},u.onload=()=>r(u),t.readAsDataURL(n)}));var qr=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.copy=void 0,r.copy=(n,r,t=0,u=0,e=n.width-t,o=n.height-u,i=0,c=0)=>{if(t|=0,u|=0,o|=0,i|=0,c|=0,(e|=0)<=0||o<=0)return;const f=new Uint32Array(n.data.buffer),a=new Uint32Array(r.data.buffer);for(let v=0;v<o;v++){const o=u+v;if(o<0||o>=n.height)continue;const d=c+v;if(!(d<0||d>=r.height))for(let u=0;u<e;u++){const e=t+u;if(e<0||e>=n.width)continue;const c=i+u;c<0||c>=r.width||(a[d*r.width+c]=f[o*n.width+e])}}}})),kr=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CreateImageFactory=(n=[0,0,0,0],r=4)=>{if(r=Math.floor(r),isNaN(r)||r<1)throw TypeError("channels should be a positive non-zero number");if(!("length"in n)||n.length<r)throw TypeError(`fill should be iterable with at least ${r} members`);const t=(n=new Uint8ClampedArray(n).slice(0,r)).every((n=>0===n));return(u,e,o)=>{if(void 0===u||void 0===e)throw TypeError("Not enough arguments");if(u=Math.floor(u),e=Math.floor(e),isNaN(u)||u<1||isNaN(e)||e<1)throw TypeError("Index or size is negative or greater than the allowed amount");const i=u*e*r;if(void 0===o&&(o=new Uint8ClampedArray(i)),o instanceof Uint8ClampedArray){if(o.length!==i)throw TypeError("Index or size is negative or greater than the allowed amount");if(!t)for(let t=0;t<e;t++)for(let e=0;e<u;e++){const i=(t*u+e)*r;for(let t=0;t<r;t++)o[i+t]=n[t]}return{get width(){return u},get height(){return e},get data(){return o}}}throw TypeError("Expected data to be Uint8ClampedArray or undefined")}},r.createImage=r.CreateImageFactory()})),Ar=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.filters=void 0;const t=(n,r)=>{if(n<=-r||n>=r)return 0;if(0==n)return 0;const t=n*Math.PI;return Math.sin(t)/t*Math.sin(t/r)/(t/r)},u=n=>Math.round(16383*n);r.filters=(n,r,e,o,i)=>{const c=i?2:3,f=1/e,a=Math.min(1,e),v=c/a,d=Math.floor(2*(v+1)),l=new Int16Array((d+2)*r);let p=0;for(let e=0;e<r;e++){const i=(e+.5)*f+o,d=Math.max(0,Math.floor(i-v)),s=Math.min(n-1,Math.ceil(i+v)),m=s-d+1,h=new Float32Array(m),I=new Int16Array(m);let b=0,R=0;for(let n=d;n<=s;n++){const r=t((n+.5-i)*a,c);b+=r,h[R]=r,R++}let U=0;for(let n=0;n<h.length;n++){const r=h[n]/b;U+=r,I[n]=u(r)}I[r>>1]+=u(1-U);let O=0;for(;O<I.length&&0===I[O];)O++;let g=I.length-1;for(;g>0&&0===I[g];)g--;const j=g-O+1;l[p++]=d+O,l[p++]=j,l.set(I.subarray(O,g+1),p),p+=j}return l}})),Pr=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.convolve=void 0,r.convolve=(n,r,t,u,e,o)=>{let i=0,c=0;for(let f=0;f<u;f++){let a=0;for(let t=0;t<e;t++){let t=i+4*o[a++]|0,e=0,f=0,v=0,d=0;for(let r=o[a++];r>0;r--){const r=o[a++];e=e+r*n[t]|0,f=f+r*n[t+1]|0,v=v+r*n[t+2]|0,d=d+r*n[t+3]|0,t=t+4|0}r[c]=e+8192>>14,r[c+1]=f+8192>>14,r[c+2]=v+8192>>14,r[c+3]=d+8192>>14,c=c+4*u|0}c=4*(f+1)|0,i=(f+1)*t*4|0}}})),Tr=u((function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lanczos2=r.lanczos=void 0;const t=(n,r,t=!1)=>{const u=r.height/n.height,e=Ar.filters(n.width,r.width,r.width/n.width,0,t),o=Ar.filters(n.height,r.height,u,0,t),i=new Uint8ClampedArray(r.width*n.height*4);Pr.convolve(n.data,i,n.width,n.height,r.width,e),Pr.convolve(i,r.data,n.height,r.width,r.height,o)};r.lanczos=(n,r,u=0,e=0,o=n.width-u,i=n.height-e,c=0,f=0,a=r.width-c,v=r.height-f)=>{if(e|=0,i|=0,c|=0,f|=0,a|=0,v|=0,(o|=0)<=0||i<=0||a<=0||v<=0)return;if(0==(u|=0)&&0===e&&o===n.width&&i===n.height&&0===c&&0===f&&a===r.width&&v===r.height)return void t(n,r);const d=kr.createImage(o,i),l=kr.createImage(a,v);qr.copy(n,d,u,e),t(d,l),qr.copy(l,r,0,0,l.width,l.height,c,f)},r.lanczos2=(n,r,u=0,e=0,o=n.width-u,i=n.height-e,c=0,f=0,a=r.width-c,v=r.height-f)=>{if(e|=0,i|=0,c|=0,f|=0,a|=0,v|=0,(o|=0)<=0||i<=0||a<=0||v<=0)return;if(0==(u|=0)&&0===e&&o===n.width&&i===n.height&&0===c&&0===f&&a===r.width&&v===r.height)return void t(n,r,!0);const d=kr.createImage(o,i),l=kr.createImage(a,v);qr.copy(n,d,u,e),t(d,l,!0),qr.copy(l,r,0,0,l.width,l.height,c,f)}}));const Lr=n=>({kind:"height",size:n}),zr=d.contramap((n=>n.size))(h.Ord),Nr=O.sort(zr),Sr=O.sort({equals:(n,r)=>n.kind===r.kind,compare:(n,r)=>n.kind===r.kind?0:"width"===n.kind?-1:1}),Cr=n=>r=>{const t=Nr(r),u=(n=>{const[r,t]=n;return r.size/t.size})(t),e=Object.assign(Object.assign({},t[0]),{size:n*u}),o=Object.assign(Object.assign({},t[1]),{size:n});return Sr([o,e])},Fr=n=>{const{naturalWidth:r,naturalHeight:t}=n;return[(u=r,{kind:"width",size:u}),Lr(t)];var u},$r=()=>{const n=document.createElement("canvas"),r=n.getContext("2d");return[n,r]},Dr=async n=>{const r=await fetch(n),t=await r.blob();return new File([t],"image",{type:t.type,lastModified:Date.now()})},Hr=n=>()=>new Promise((async r=>{const t=await fetch(n),u=await t.blob();r(new File([u],"image",{type:u.type,lastModified:Date.now()}))})),Jr=(n,r)=>n.naturalWidth>r?((n,r)=>{const t=Cr(n),[u,e]=$r(),o=Fr(r),[i,c]=t(o).map((n=>n.size)),f=new ImageData(i,c),a=(n=>{const{naturalWidth:r,naturalHeight:t}=n,[u,e]=$r();return u.width=r,u.height=t,e.drawImage(n,0,0),e.getImageData(0,0,r,t)})(r);return u.width=i,u.height=c,Tr.lanczos(a,f),e.putImageData(f,0,0),u.toDataURL()})(r,n):(n=>{const r=document.createElement("canvas"),{naturalWidth:t,naturalHeight:u}=n,e=r.getContext("2d");return r.width=t,r.height=u,e.drawImage(n,0,0,t,u),r.toDataURL()})(n),Gr=n=>r=>e.pipe(r,Er,Pn.map((r=>Jr(r,n))),Pn.chain(Hr)),Br=n=>{const r=(new TextEncoder).encode(n);return btoa(String.fromCharCode.apply(null,r))},Kr=n=>q(n,jr,H((n=>({headers:n})))),{state:Vr,onChange:Xr}=y({campaignId:"",excluded:"",selfSearchId:null,results:[],sourceProduct:null,filters:[],textSearchFilters:[],detectedObjects:[],objectDetectionInProgress:!1,resultLoaded:!1,resultViewed:!1,imageWidth:500,image:_.none,imageUrl:_.none,imageBounds:_.none,searchArea:_.none,serverError:!1,loading:!1}),Yr=Vr,Qr=async n=>{var r,t;Vr.selfSearchId=q(cr(n,"self"),fr),Vr.results=n.value,Vr.filters=(t=ir(n.filters),Object.entries(t).map((([n,r])=>({name:n,filters:r})))),Vr.rectangleSearchForm=n.searchArea,Vr.resetCategoryLink=null===(r=n.links)||void 0===r?void 0:r.clearFilters,Vr.loading=!1},Zr=n=>q(Kr(Vr.token),Rn,wn(ar(n))),nt=async()=>{Vr.loading=!0,q(Ur(Vr.imageBounds,Vr.searchArea),_.map((async([n,r])=>{const t=(u=n,n=>({x:n.x/u.width,y:n.y/u.height,width:n.width/u.width,height:n.height/u.height}))(r);var u;const e={width:t.width,height:t.height,left:t.x,top:t.y};return await q(Kr(Vr.token),Rn,wn(br(Vr.rectangleSearchForm,e)),Un(Qr))()})))},rt=n=>{Vr.searchType="image",Vr.loading=!0;const r=yr(n);return q(Xn(jr(Vr.token),C(r)),H((([n,r])=>({headers:n,body:r}))),Rn,yn((n=>tr(n,Vr.campaignId,Vr.excluded))),Un((n=>(Qr(n),(async n=>{Vr.objectDetectionInProgress=!0;const r={kind:"server",inner:"Can not get a link for objects detection"};await q(cr(n,"detectedObjects"),jn((()=>r)),yn(Zr),Un((n=>Vr.detectedObjects=ir(n))))(),Vr.objectDetectionInProgress=!1})(n),Vr.loading=!1,n))),On((n=>(Vr.serverError=!0,Vr.loading=!1,n))))},tt=async(n,r,t)=>{Vr.searchType="text",Vr.loading=!0;const u=Object.assign(Object.assign({query:r},t?{dynamicFilters:t}:{}),Vr.campaignId.length?{campaign:Vr.campaignId}:{});return q(Mr(n,u),Gn,Rn,yn((n=>ur(n))),Un((n=>{var r,t,u,e,o;return Vr.results=null!==(t=null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.products)&&void 0!==t?t:[],Vr.textSearchFilters=null!==(o=null===(e=null===(u=null==n?void 0:n.data)||void 0===u?void 0:u.interactions)||void 0===e?void 0:e.dynamicFilters)&&void 0!==o?o:[],Vr.loading=!1,n})),On((n=>(Vr.serverError=!0,Vr.loading=!1,n))))()},ut=async(n,r,t,u)=>{const e=Object.assign(Object.assign({query:r},u?{resultsCount:u}:{}),t?{dynamicFilters:t}:{});return q(Mr(n,e),Gn,Rn,yn(ur))()},et=async(n,r)=>{return await q(Kr(n),Rn,wn(ar((t=r,{href:t}))),Un((n=>n.value)))();var t},ot=async(n,r,t,u)=>{const e="product_type"===r||"google_product_category"===r?q(t,(n=>n.split(" > ").join(">")),Br,(n=>n.split("=")[0])):t,o=Object.assign(Object.assign({},u?{resultsCount:u}:{}),{staticFilters:{included:[{column:r,values:[e]}]}});return q(Mr(n,o),Gn,Rn,yn(er))()};Xr("activeIonLink",(async n=>{const r=n||Vr.resetCategoryLink;r&&(Vr.loading=!0,await q(Kr(Vr.token),Rn,wn(ar(r)),Un(Qr),On((n=>({kind:"network error",inner:n}))))())})),Xr("serverError",(()=>{Vr.loading=!1}));const it=n=>{Yr.image=_.some(n),Yr.imageUrl=_.some(n.src)},ct=async(n,r=!1,t,u)=>{const o=(n=>e.pipe(n,_.fromNullable,Wn.fromOption((()=>Wr)),Wn.chain(_r)))(n),i=Gr(500),c=q(o,Rn,Mn(i));if(r)return await q(c,yn((()=>((n,r,t)=>{const u=yr(n);return q(Xn(jr(r),C(u)),H((([n,r])=>({headers:n,body:r}))),Rn,yn((n=>tr(n,null,null,t))))})(n,t,u))))();const f=await q(c,yn(rt))();await q(c,Mn(Er),Un(it))();const a=Gr(1024),v=q(o,Rn,Mn(a)),d=await v();return q(Xn(f,d),H((([n,r])=>(async(n,r)=>{const t={image:await(async n=>({name:n.name,mediaType:n.type,value:await Rr(n)}))(r)},u=n.uploadHighResolutionImage;await q(Kr(Vr.token),Rn,wn(br(u,t)))()})(n,r)))),f};export{G as A,Fr as B,Cr as C,et as D,Wn as E,Y as F,tt as G,ut as H,ot as I,m as N,_ as O,p as S,Tn as T,e as _,O as a,Jn as b,wn as c,Ln as d,t as e,Rn as f,Fn as g,L as h,u as i,sr as j,nr as k,dr as l,Vn as m,ir as n,lr as o,q as p,pr as q,nt as r,Yr as s,E as t,rr as u,Dr as v,ct as w,X as x,Ur as y,vr as z}
|