@artisan-commerce/products 0.7.0 → 0.7.3
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/README.md +93 -93
- package/build/main.bundle.js +2 -2
- package/build/report.json +1 -0
- package/build/src/config/constants.d.ts +23 -23
- package/build/src/errors/api.errors.d.ts +7 -7
- package/build/src/index.d.ts +16 -16
- package/build/src/lib/aritmetics.d.ts +1 -1
- package/build/src/lib/common.d.ts +16 -16
- package/build/src/lib/getCategories/getCategories.d.ts +1 -1
- package/build/src/lib/getCategories/getCategories.test.d.ts +1 -1
- package/build/src/lib/getProductDetails/getProductDetails.d.ts +7 -7
- package/build/src/lib/getProductDetails/getProductDetails.test.d.ts +1 -1
- package/build/src/lib/getProductDetails/getProductDetails.types.d.ts +7 -7
- package/build/src/lib/getProducts/getProducts.d.ts +7 -7
- package/build/src/lib/getProducts/getProducts.test.d.ts +1 -1
- package/build/src/lib/getProducts/getProducts.types.d.ts +3 -3
- package/build/src/lib/getRecommendedProducts/getRecommendedProducts.d.ts +1 -1
- package/build/src/lib/getRecommendedProducts/getRecommendedProducts.test.d.ts +1 -1
- package/build/src/lib/getRelatedProducts/getRelatedProducts.d.ts +1 -1
- package/build/src/lib/getRelatedProducts/getRelatedProducts.test.d.ts +1 -1
- package/build/src/lib/getStoreDetails/getStoreDetails.d.ts +7 -7
- package/build/src/lib/getStoreDetails/getStoreDetails.test.d.ts +1 -1
- package/build/src/lib/getStoreDetails/getStoreDetails.types.d.ts +7 -7
- package/build/src/lib/initProducts/initProducts.d.ts +10 -10
- package/build/src/lib/registerModifiersForm/registerModifiersForm.d.ts +3 -3
- package/build/src/lib/registerModifiersForm/registerModifiersForm.test.d.ts +1 -1
- package/build/src/lib/registerModifiersForm/registerModifiersForm.types.d.ts +34 -34
- package/build/src/lib/validateProduct/validateProduct.d.ts +1 -1
- package/build/src/lib/validateProduct/validateProduct.test.d.ts +1 -1
- package/build/src/lib/validateProduct/validateProduct.types.d.ts +2 -2
- package/build/src/services/fetchProductDetails/fetchProductDetails.service.d.ts +2 -2
- package/build/src/services/fetchProductDetails/fetchProductDetails.service.mock.d.ts +2 -2
- package/build/src/services/fetchProductDetails/fetchProductDetails.service.types.d.ts +1 -1
- package/build/src/services/fetchProducts/fetchPRoducts.service.mock.d.ts +2 -2
- package/build/src/services/fetchProducts/fetchProducts.service.d.ts +2 -2
- package/build/src/services/fetchProducts/fetchProducts.service.types.d.ts +1 -1
- package/build/src/services/fetchStoreDetails/fetchStoreDetails.service.d.ts +2 -2
- package/build/src/services/fetchStoreDetails/fetchStoreDetails.service.types.d.ts +1 -1
- package/build/src/tests/exports.test.d.ts +1 -1
- package/build/src/types/common.types.d.ts +20 -20
- package/build/src/types/http.types.d.ts +66 -66
- package/build/src/types/modifiers.types.d.ts +57 -57
- package/build/src/utils/assertions/assertions.utils.d.ts +8 -8
- package/build/src/utils/bugsnag.d.ts +2 -2
- package/build/src/utils/caculations/calculations.utils.d.ts +17 -17
- package/build/src/utils/caculations/calculations.utils.test.d.ts +1 -1
- package/build/src/utils/caculations/calculations.utils.types.d.ts +6 -6
- package/build/src/utils/common.utils.d.ts +3 -3
- package/build/src/utils/http/cache.utils.d.ts +4 -4
- package/build/src/utils/http/http.utils.d.ts +9 -9
- package/build/src/utils/http/purge.utils.d.ts +38 -38
- package/build/src/utils/http/request.utils.d.ts +7 -7
- package/build/src/utils/modifiers/common.utils.d.ts +12 -12
- package/build/src/utils/modifiers/form.utils.d.ts +3 -3
- package/build/src/utils/modifiers/handleChange.utils.d.ts +1 -1
- package/build/src/utils/modifiers/renderer.utils.d.ts +11 -11
- package/build/src/utils/modifiers/rendererTraversal.utils.d.ts +4 -4
- package/build/src/utils/modifiers/updateRenderer.utils.d.ts +5 -5
- package/build/src/utils/transformers/api.transformer.d.ts +7 -7
- package/build/src/utils/transformers/transformers.utils.d.ts +9 -9
- package/build/src/vendors.d.ts +1 -1
- package/build/vendors.bundle.js +1 -1
- package/package.json +5 -4
- package/build/report.html +0 -53
package/README.md
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
## Node Library Boilerplate
|
|
2
|
-
|
|
3
|
-
This boilerplate was made to facilitate the creation of server-side or client-side node application. It comes with a powerful webpack & typescript configuration out of the box.
|
|
4
|
-
|
|
5
|
-
## New Project Configuration steps:
|
|
6
|
-
|
|
7
|
-
1. Change your project name and description in package.json.
|
|
8
|
-
1. Change default constants value in `src/config/constants.ts`.
|
|
9
|
-
1. In .env.[ENV] change the ENV variable to the environment you are currently developing for.
|
|
10
|
-
1. If you want to support the require syntax instead of import, change the module field in the tsconfig.json file to commonjs
|
|
11
|
-
1. Update the readme.md file
|
|
12
|
-
|
|
13
|
-
## File Structure
|
|
14
|
-
|
|
15
|
-
General representation of the building pieces
|
|
16
|
-
|
|
17
|
-
## Available Scripts
|
|
18
|
-
|
|
19
|
-
In the project directory, you can run:
|
|
20
|
-
|
|
21
|
-
### `npm start`
|
|
22
|
-
|
|
23
|
-
Runs the app in the development mode.<br>
|
|
24
|
-
|
|
25
|
-
### `npm dev`
|
|
26
|
-
|
|
27
|
-
Alias of npm start, for some developers convinience.
|
|
28
|
-
|
|
29
|
-
### `npm test`
|
|
30
|
-
|
|
31
|
-
Launches the test runner in the interactive watch mode.<br>
|
|
32
|
-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
33
|
-
|
|
34
|
-
### `npm run test:all`
|
|
35
|
-
|
|
36
|
-
Run every test in a none interactive mode and create a coverage report.
|
|
37
|
-
|
|
38
|
-
This command is perfect for pre push hooks.
|
|
39
|
-
|
|
40
|
-
### `npm run test:ci`
|
|
41
|
-
|
|
42
|
-
Simulates a CI environment before running all tests
|
|
43
|
-
|
|
44
|
-
### `npm run check-types`
|
|
45
|
-
|
|
46
|
-
Will attempt to compile the whole project including test files that are normally excluded.
|
|
47
|
-
|
|
48
|
-
This command is perfect for verifing the project's integrity before commiting changes
|
|
49
|
-
|
|
50
|
-
### `npm run lint`
|
|
51
|
-
|
|
52
|
-
Runs the configured linter to check for any lints in your code before deploying, developers must clean any lint before commiting or commints will not go through.
|
|
53
|
-
|
|
54
|
-
### `npm run prettier`
|
|
55
|
-
|
|
56
|
-
Configure prettier, the files that should be included and excluded. This command should not be used by itself.
|
|
57
|
-
|
|
58
|
-
### `npm run format`
|
|
59
|
-
|
|
60
|
-
Uses the prettier configuration to run prettier in write mode to all selected files. It will fix all format errors.
|
|
61
|
-
|
|
62
|
-
### `npm run check-format`
|
|
63
|
-
|
|
64
|
-
Uses the prettier configuration to run prettier in read mode to all selected files. If any is bad formated, it will display a warning.
|
|
65
|
-
|
|
66
|
-
### `npm run build`
|
|
67
|
-
|
|
68
|
-
Builds the app for production to the `build` folder.<br>
|
|
69
|
-
It correctly bundles the project in production mode and optimizes the build for the best performance.
|
|
70
|
-
|
|
71
|
-
### `npm run validate`
|
|
72
|
-
|
|
73
|
-
It validates the integrity of the project by running many of the static testing, unit/integration testing and e2e testing commands.
|
|
74
|
-
|
|
75
|
-
### `npm run validate:ci`
|
|
76
|
-
|
|
77
|
-
Run a different series of commands than validate, the selected commands that are run are the ones appropiate to be run on CI. This command is not met to be run locally.
|
|
78
|
-
|
|
79
|
-
## Publishing your library
|
|
80
|
-
|
|
81
|
-
To publish your library you will only need to run `npm publish`. We will take care of the rest. Things like creating a new build of your code will be done automatically. Just take into consideration to bump the project version following the semver methodology.
|
|
82
|
-
|
|
83
|
-
## Previewing your library
|
|
84
|
-
|
|
85
|
-
When you are in the middle of the development of your new library, you find your self needing to test the current features you are developing. We recommend using `npm link` and a separte project for those purposes.
|
|
86
|
-
|
|
87
|
-
If you want to test your app on a real app, then we recommend using `npm publish`. This method should be avoided during development.
|
|
88
|
-
|
|
89
|
-
> ### Hope you are enjoying this boilerplate
|
|
90
|
-
>
|
|
91
|
-
> We are happy to add/update any additional request you may have. For intering ideas, please submit a new issue and we will take care of it.
|
|
92
|
-
>
|
|
93
|
-
> Happy coding! 🚀
|
|
1
|
+
## Node Library Boilerplate
|
|
2
|
+
|
|
3
|
+
This boilerplate was made to facilitate the creation of server-side or client-side node application. It comes with a powerful webpack & typescript configuration out of the box.
|
|
4
|
+
|
|
5
|
+
## New Project Configuration steps:
|
|
6
|
+
|
|
7
|
+
1. Change your project name and description in package.json.
|
|
8
|
+
1. Change default constants value in `src/config/constants.ts`.
|
|
9
|
+
1. In .env.[ENV] change the ENV variable to the environment you are currently developing for.
|
|
10
|
+
1. If you want to support the require syntax instead of import, change the module field in the tsconfig.json file to commonjs
|
|
11
|
+
1. Update the readme.md file
|
|
12
|
+
|
|
13
|
+
## File Structure
|
|
14
|
+
|
|
15
|
+
General representation of the building pieces
|
|
16
|
+
|
|
17
|
+
## Available Scripts
|
|
18
|
+
|
|
19
|
+
In the project directory, you can run:
|
|
20
|
+
|
|
21
|
+
### `npm start`
|
|
22
|
+
|
|
23
|
+
Runs the app in the development mode.<br>
|
|
24
|
+
|
|
25
|
+
### `npm dev`
|
|
26
|
+
|
|
27
|
+
Alias of npm start, for some developers convinience.
|
|
28
|
+
|
|
29
|
+
### `npm test`
|
|
30
|
+
|
|
31
|
+
Launches the test runner in the interactive watch mode.<br>
|
|
32
|
+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
33
|
+
|
|
34
|
+
### `npm run test:all`
|
|
35
|
+
|
|
36
|
+
Run every test in a none interactive mode and create a coverage report.
|
|
37
|
+
|
|
38
|
+
This command is perfect for pre push hooks.
|
|
39
|
+
|
|
40
|
+
### `npm run test:ci`
|
|
41
|
+
|
|
42
|
+
Simulates a CI environment before running all tests
|
|
43
|
+
|
|
44
|
+
### `npm run check-types`
|
|
45
|
+
|
|
46
|
+
Will attempt to compile the whole project including test files that are normally excluded.
|
|
47
|
+
|
|
48
|
+
This command is perfect for verifing the project's integrity before commiting changes
|
|
49
|
+
|
|
50
|
+
### `npm run lint`
|
|
51
|
+
|
|
52
|
+
Runs the configured linter to check for any lints in your code before deploying, developers must clean any lint before commiting or commints will not go through.
|
|
53
|
+
|
|
54
|
+
### `npm run prettier`
|
|
55
|
+
|
|
56
|
+
Configure prettier, the files that should be included and excluded. This command should not be used by itself.
|
|
57
|
+
|
|
58
|
+
### `npm run format`
|
|
59
|
+
|
|
60
|
+
Uses the prettier configuration to run prettier in write mode to all selected files. It will fix all format errors.
|
|
61
|
+
|
|
62
|
+
### `npm run check-format`
|
|
63
|
+
|
|
64
|
+
Uses the prettier configuration to run prettier in read mode to all selected files. If any is bad formated, it will display a warning.
|
|
65
|
+
|
|
66
|
+
### `npm run build`
|
|
67
|
+
|
|
68
|
+
Builds the app for production to the `build` folder.<br>
|
|
69
|
+
It correctly bundles the project in production mode and optimizes the build for the best performance.
|
|
70
|
+
|
|
71
|
+
### `npm run validate`
|
|
72
|
+
|
|
73
|
+
It validates the integrity of the project by running many of the static testing, unit/integration testing and e2e testing commands.
|
|
74
|
+
|
|
75
|
+
### `npm run validate:ci`
|
|
76
|
+
|
|
77
|
+
Run a different series of commands than validate, the selected commands that are run are the ones appropiate to be run on CI. This command is not met to be run locally.
|
|
78
|
+
|
|
79
|
+
## Publishing your library
|
|
80
|
+
|
|
81
|
+
To publish your library you will only need to run `npm publish`. We will take care of the rest. Things like creating a new build of your code will be done automatically. Just take into consideration to bump the project version following the semver methodology.
|
|
82
|
+
|
|
83
|
+
## Previewing your library
|
|
84
|
+
|
|
85
|
+
When you are in the middle of the development of your new library, you find your self needing to test the current features you are developing. We recommend using `npm link` and a separte project for those purposes.
|
|
86
|
+
|
|
87
|
+
If you want to test your app on a real app, then we recommend using `npm publish`. This method should be avoided during development.
|
|
88
|
+
|
|
89
|
+
> ### Hope you are enjoying this boilerplate
|
|
90
|
+
>
|
|
91
|
+
> We are happy to add/update any additional request you may have. For intering ideas, please submit a new issue and we will take care of it.
|
|
92
|
+
>
|
|
93
|
+
> Happy coding! 🚀
|
package/build/main.bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("products",[],r):"object"==typeof exports?exports.products=r():t.products=r()}(this,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=
|
|
1
|
+
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("products",[],r):"object"==typeof exports?exports.products=r():t.products=r()}(this,(function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=24)}([function(t,r,e){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return r[e]}})}:function(t,r,e,n){void 0===n&&(n=e),t[n]=r[e]}),o=this&&this.__exportStar||function(t,r){for(var e in t)"default"===e||r.hasOwnProperty(e)||n(r,t,e)};Object.defineProperty(r,"__esModule",{value:!0}),o(e(3),r),o(e(4),r),o(e(5),r),o(e(6),r),o(e(7),r),o(e(8),r),o(e(9),r),o(e(10),r),o(e(11),r),o(e(12),r),o(e(13),r),o(e(14),r),o(e(15),r),o(e(16),r)},function(t,r){var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var r=[],e=0;e<t.length;e++)r.push(255&t.charCodeAt(e));return r},bytesToString:function(t){for(var r=[],e=0;e<t.length;e++)r.push(String.fromCharCode(t[e]));return r.join("")}}};t.exports=e},function(t,r,e){(function(r){var n,o,i,u;n=e(22),o=e(1).utf8,i=e(1).bin,(u=function(t,e){var u=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==r&&"function"==typeof r.isBuffer&&r.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var e=n.bytesToWords(t),i=8*t.length,u=[],a=1732584193,s=-271733879,c=-1732584194,f=271733878,l=-1009589776;e[i>>5]|=128<<24-i%32,e[15+(i+64>>>9<<4)]=i;for(var h=0;h<e.length;h+=16){for(var p=a,d=s,y=c,v=f,g=l,b=0;b<80;b++){if(b<16)u[b]=e[h+b];else{var m=u[b-3]^u[b-8]^u[b-14]^u[b-16];u[b]=m<<1|m>>>31}var w=(a<<5|a>>>27)+l+(u[b]>>>0)+(b<20?1518500249+(s&c|~s&f):b<40?1859775393+(s^c^f):b<60?(s&c|s&f|c&f)-1894007588:(s^c^f)-899497514);l=f,f=c,c=s<<30|s>>>2,s=a,a=w}a+=p,s+=d,c+=y,f+=v,l+=g}return[a,s,c,f,l]}(t));return e&&e.asBytes?u:e&&e.asString?i.bytesToString(u):n.bytesToHex(u)})._blocksize=16,u._digestsize=20,t.exports=u}).call(this,e(17).Buffer)},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.QuestionTypes=r.DayOfWeekName=r.TaxType=r.PriceCategoryType=r.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(r.ProductType||(r.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(r.PriceCategoryType||(r.PriceCategoryType={})),function(t){t.IVA="IVA"}(r.TaxType||(r.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(r.DayOfWeekName||(r.DayOfWeekName={})),function(t){t.BOOLEAN="BOOLEAN",t.RADIO="RADIO",t.CHECKBOX="CHECKBOX",t.COUNTER="COUNTER"}(r.QuestionTypes||(r.QuestionTypes={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ServiceStatus=r.Days=r.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(r.DeliveryTimeUnit||(r.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(r.Days||(r.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(r.ServiceStatus||(r.ServiceStatus={}))},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0})},function(t,r,e){"use strict";(function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
8
|
-
var n=e(18),o=e(19),i=e(20);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(u()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=s.prototype:(null===t&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,r,e)}function c(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);s.TYPED_ARRAY_SUPPORT?(t=r).__proto__=s.prototype:t=h(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(r,e),o=(t=a(t,n)).write(r,e);o!==n&&(t=t.slice(0,o));return t}(t,r,e):function(t,r){if(s.isBuffer(r)){var e=0|p(r.length);return 0===(t=a(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?a(t,0):h(t,r);if("Buffer"===r.type&&i(r.data))return h(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,r){if(f(r),t=a(t,r<0?0:0|p(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function h(t,r){var e=r.length<0?0:0|p(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function p(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function d(t,r){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return F(t).length;default:if(n)return k(t).length;r=(""+r).toLowerCase(),n=!0}}function y(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return _(this,r,e);case"utf8":case"utf-8":return I(this,r,e);case"ascii":return R(this,r,e);case"latin1":case"binary":return S(this,r,e);case"base64":return O(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function g(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:b(t,r,e,n,o);if("number"==typeof r)return r&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):b(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,r,e,n,o){var i,u=1,a=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,a/=2,s/=2,e/=2}function c(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(o){var f=-1;for(i=e;i<a;i++)if(c(t,i)===c(r,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===s)return f*u}else-1!==f&&(i-=i-f),f=-1}else for(e+s>a&&(e=a-s),i=e;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(r,h)){l=!1;break}if(l)return i}return-1}function m(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=r.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var a=parseInt(r.substr(2*u,2),16);if(isNaN(a))return u;t[e+u]=a}return u}function w(t,r,e,n){return q(k(r,t.length-e),t,e,n)}function A(t,r,e,n){return q(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function E(t,r,e,n){return A(t,r,e,n)}function T(t,r,e,n){return q(F(r),t,e,n)}function P(t,r,e,n){return q(function(t,r){for(var e,n,o,i=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,o=e%256,i.push(o),i.push(n);return i}(r,t.length-e),t,e,n)}function O(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function I(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=e)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&c)<<6|63&i)>127&&(f=s);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&(s=(15&c)<<12|(63&i)<<6|63&u)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:i=t[o+1],u=t[o+2],a=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&a)&&(s=(15&c)<<18|(63&i)<<12|(63&u)<<6|63&a)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,r,e){return c(null,t,r,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,r,e){return function(t,r,e,n){return f(r),r<=0?a(t,r):void 0!==e?"string"==typeof n?a(t,r).fill(e,n):a(t,r).fill(e):a(t,r)}(null,t,r,e)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,r){if(!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,r){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=s.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!s.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,o),o+=u.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)v(this,r,r+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)v(this,r,r+3),v(this,r+1,r+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)v(this,r,r+7),v(this,r+1,r+6),v(this,r+2,r+5),v(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?I(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,r,e,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(r,e),l=0;l<a;++l)if(c[l]!==f[l]){i=c[l],u=f[l];break}return i<u?-1:u<i?1:0},s.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},s.prototype.indexOf=function(t,r,e){return g(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return g(this,t,r,e,!1)},s.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return m(this,t,r,e);case"utf8":case"utf-8":return w(this,t,r,e);case"ascii":return A(this,t,r,e);case"latin1":case"binary":return E(this,t,r,e);case"base64":return T(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function S(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function _(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=L(t[i]);return o}function D(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function x(t,r,e,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function U(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function Y(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,e,n,i){return i||Y(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function N(t,r,e,n,i){return i||Y(t,0,e,8),o.write(t,r,e,n,52,8),e+8}s.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),s.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=s.prototype;else{var o=r-t;e=new s(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+t]}return e},s.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},s.prototype.readUInt8=function(t,r){return r||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,r){return r||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,r){return r||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,r){return r||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,r){return r||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},s.prototype.readInt8=function(t,r){return r||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,r){r||C(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(t,r){r||C(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(t,r){return r||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return r||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return r||C(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return r||C(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return r||C(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return r||C(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||x(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},s.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||x(this,t,r,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+e},s.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):U(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):U(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):B(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):B(this,t,r,!1),r+4},s.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);x(this,t,r,e,o-1,-o)}var i=0,u=1,a=0;for(this[r]=255&t;++i<e&&(u*=256);)t<0&&0===a&&0!==this[r+i-1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);x(this,t,r,e,o-1,-o)}var i=e-1,u=1,a=0;for(this[r+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):U(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):U(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):B(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):B(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return N(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return N(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,i=n-e;if(this===t&&e<r&&r<n)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},s.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var i;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var u=s.isBuffer(t)?t:k(new s(t,n).toString()),a=u.length;for(i=0;i<e-r;++i)this[i+r]=u[i%a]}return this};var M=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(M,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}}).call(this,e(17))},function(t,r){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){"use strict";r.byteLength=function(t){var r=c(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=c(t),u=n[0],a=n[1],s=new i(function(t,r,e){return 3*(r+e)/4-e}(0,u,a)),f=0,l=a>0?u-4:u;for(e=0;e<l;e+=4)r=o[t.charCodeAt(e)]<<18|o[t.charCodeAt(e+1)]<<12|o[t.charCodeAt(e+2)]<<6|o[t.charCodeAt(e+3)],s[f++]=r>>16&255,s[f++]=r>>8&255,s[f++]=255&r;2===a&&(r=o[t.charCodeAt(e)]<<2|o[t.charCodeAt(e+1)]>>4,s[f++]=255&r);1===a&&(r=o[t.charCodeAt(e)]<<10|o[t.charCodeAt(e+1)]<<4|o[t.charCodeAt(e+2)]>>2,s[f++]=r>>8&255,s[f++]=255&r);return s},r.fromByteArray=function(t){for(var r,e=t.length,o=e%3,i=[],u=0,a=e-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));1===o?(r=t[e-1],i.push(n[r>>2]+n[r<<4&63]+"==")):2===o&&(r=(t[e-2]<<8)+t[e-1],i.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=u.length;a<s;++a)n[a]=u[a],o[u.charCodeAt(a)]=a;function c(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function f(t,r,e){for(var o,i,u=[],a=r;a<e;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),u.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return u.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,r){r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=e?o-1:0,h=e?-1:1,p=t[r+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[r+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[r+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=c}return(p?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var u,a,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+l>=1?h/s:h*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=f?(a=0,u=f):u+l>=1?(a=(r*s-1)*Math.pow(2,o),u+=l):(a=r*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[e+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[e+p]=255&u,p+=d,u/=256,c-=8);t[e+p-d]|=128*y}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r){var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,r){return t<<r|t>>>32-r},rotr:function(t,r){return t<<32-r|t>>>r},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var r=0;r<t.length;r++)t[r]=n.endian(t[r]);return t},randomBytes:function(t){for(var r=[];t>0;t--)r.push(Math.floor(256*Math.random()));return r},bytesToWords:function(t){for(var r=[],e=0,n=0;e<t.length;e++,n+=8)r[n>>>5]|=t[e]<<24-n%32;return r},wordsToBytes:function(t){for(var r=[],e=0;e<32*t.length;e+=8)r.push(t[e>>>5]>>>24-e%32&255);return r},bytesToHex:function(t){for(var r=[],e=0;e<t.length;e++)r.push((t[e]>>>4).toString(16)),r.push((15&t[e]).toString(16));return r.join("")},hexToBytes:function(t){for(var r=[],e=0;e<t.length;e+=2)r.push(parseInt(t.substr(e,2),16));return r},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?r.push(e.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(n))>>>6-2*o);return r}},t.exports=n},,function(t,r,e){"use strict";e.r(r),e.d(r,"getCategories",(function(){return A})),e.d(r,"getProductDetails",(function(){return ht})),e.d(r,"getProducts",(function(){return gt})),e.d(r,"getRecommendedProducts",(function(){return bt})),e.d(r,"getRelatedProducts",(function(){return mt})),e.d(r,"getStoreDetails",(function(){return Pt})),e.d(r,"registerModifiersForm",(function(){return qt})),e.d(r,"validateProduct",(function(){return Gt})),e.d(r,"initProducts",(function(){return Wt})),e.d(r,"getProductTotals",(function(){return Xt})),e.d(r,"transformers",(function(){return o})),e.d(r,"assertions",(function(){return n}));var n={};e.r(n),e.d(n,"isBaseProduct",(function(){return a})),e.d(n,"isProductDetails",(function(){return s})),e.d(n,"isCartProduct",(function(){return c})),e.d(n,"isFormCartProduct",(function(){return f}));var o={};e.r(o),e.d(o,"toCartProduct",(function(){return d})),e.d(o,"toFormCartProduct",(function(){return g})),e.d(o,"toFormCartProductHelper",(function(){return b})),e.d(o,"toFormCartProductFromProductDetails",(function(){return m})),e.d(o,"toFormCartProductFromAnswer",(function(){return w}));var i=e(0),u=function(t){return Object.keys(t)},a=function(t){var r=t.attributes,e=t.available,n=t.description,o=t.name,a=t.images,s=t.prices,c=t.productId,f=t.sponsored,l=t.status,h=t.type;return"boolean"==typeof r.showInMenu&&("boolean"==typeof e&&("boolean"==typeof f&&("string"==typeof n&&("string"==typeof o&&("string"==typeof c&&(!("object"!=typeof s||"object"==typeof s&&Object.keys(s).length<1)&&(!!Array.isArray(a)&&((!l||"ACTIVE"===l||"INACTIVE"===l)&&!!u(i.ProductType).includes(h)))))))))},s=function(t){if(!a(t))return!1;var r=t.isPriceVip,e=t.manufacturer,n=t.maxAmountForSale,o=t.schedule,i=t.questions;return"boolean"==typeof r&&(!!Array.isArray(e)&&("number"==typeof n&&(!!Array.isArray(o)&&!!Array.isArray(i))))},c=function(t){if(!s(t))return!1;var r=t.hash,e=t.createdAt,n=t.updatedAt,o=t.alerts,a=t.amount,c=t.priceCategory,f=t.comment,l=t.questionsAndAnswers;return"string"==typeof r&&("string"==typeof e&&("string"==typeof n&&(!!Array.isArray(o)&&("number"==typeof a&&("string"==typeof f&&(!!u(i.PriceCategoryType).includes(c)&&!!Array.isArray(l)))))))},f=function(t){var r;if(!c(t))return!1;var e=t.questions;if(!Array.isArray(e))return!1;var n=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},l=function(t){var r=t.min,e=t.max,n=t.type;if(n)return n;if(0===r&&1===e)return"CHECKBOX";if(1===r&&1===e)return"RADIO";if(0===r&&(0===e||e===1/0))return"COUNTER";if(e>=r)return"COUNTER";throw new Error("Modifier group bad configured. min "+r+", max "+e+", type "+n)},h=function(t,r){var e=t.max,n=t.min;return r>e?"Amount is heigher than the maximum allowed amount "+e:r<n?"Amount is lower than the minimum allowed amount "+n:""},p=function(){return(p=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},d=function(t,r){if(void 0===r&&(r={}),c(t))return p(p({},t),r);if(s(t))return y(t,r);var e=v(t);return y(e,r)},y=function(t,r){var e;return void 0===r&&(r={}),p(p(p({},t),{questionsAndAnswers:[],amount:null!==(e=t.amount)&&void 0!==e?e:0,priceCategory:i.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},v=function(t,r){return void 0===r&&(r={}),p(p(p({},t),{hasModifiers:!1,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},g=function(t,r){if(void 0===r&&(r={}),f(t))return p(p({},t),r);if(s(t))return m(t,r);var e=v(t);return m(e,r)},b=function(t,r){void 0===r&&(r={});var e=t.priceCategory,n=t.productId,o=t.amount,i=t.questions.map((function(t){var r=t.answers,i=t.questionId,u=t.min,a=t.max,s={rootId:n,min:u,max:a,type:l(t),modifiersCount:r.length,amount:o,path:[]};return p(p({},t),{answers:r.map((function(t){var r=function(t){var r=t.min;return 1===t.modifiersCount?r:0}(s),n=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(s),o=function(t){var r=t.groupType,e=t.min,n=t.max;return"RADIO"===r||1===e&&1===n?"RADIO":0===e&&1===n?"CHECKBOX":0!==e||0!==n&&n!==1/0?n>=e?"COUNTER":r:"COUNTER"}({min:r,max:n,groupType:s.type}),u=t.questions.length;return p(p({amount:0},t),{priceCategory:e,questionId:i,min:r,max:n,renderType:o,questions:u?b(t).questions:[]})}))})}));return p(p(p({},t),{questions:i}),r)},m=function(t,r){void 0===r&&(r={});var e=y(t);return b(e,r)},w=function(t,r){return void 0===r&&(r={}),b(t,r)},A=function(){console.log("Not supported yet")},E={CLIENT_NAME:"Trade S.A.",DEFAULT_REQUEST_TIMEOUT:1e4,EXCLUDED_LOGGER_STATUS_CODES:[422],INCLUDED_LOGGER_ENVS:["staging","production"],INCLUDED_INTL_LOG_ENVS:[""],COUNTRY:{NAME:"Ecuador",CODE:"593",LANGUAGE:"es"},DEFAULT_API_TIMEOUT:3e5,HEADERS:["accountId"],FILTERS:["vendorId","storeId","catalogueId","categoryId","productId"],GROUPS:["CATEGORIES","TAGS"],ORDER_FIELDS:["type","sort"],ORDER_TYPES:["ALPHABETIC","PRICE","PREDEFINED"],ORDER_SORTS:["ASC","DESC"],PAGINATION:["page","vendor","store","catalogue","category","product"],ADDITIONAL_FILTERS:["price","query","tags","manufacturerId","weight","dimensions"]},T=function(){return(T=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},P=E.DEFAULT_API_TIMEOUT,O={artisanApp:void 0,timeout:P,apiCache:{},expiresAt:(new Date).getTime()+P,forms:{}};Object.freeze(O);var I=T({},O);Object.seal(I);var R=function(t){I=T(T({},I),t)},S=function(){return T({},I)},_=function(t,r,e){void 0===e&&(e="");var n=r.headers.accountId,o=t.filterBy,i=o.vendorId,u=o.storeId,a=o.catalogueId;!function(t,r){void 0===r&&(r="");var e=S().accountId;if(void 0===t&&void 0===e)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+r)}(n,e),function(t,r){void 0===r&&(r="");var e=S().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+r)}(i,e),function(t,r){void 0===r&&(r="");var e=S().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+r)}(u,e),function(t,r){void 0===r&&(r="");var e=S().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+r)}(a,e)},D=E.FILTERS,C=E.HEADERS,x=function(t,r,e){var n=null==r?void 0:r.message;try{n=r?JSON.parse(r.message):r}catch(t){}return{data:t,hints:U(e),config:e,error:n}},U=function(t){var r={};return Object.entries(t.query).forEach((function(t){var e=t,n=e[0],o=e[1];D.includes(n)&&(r[n]=o)})),Object.entries(t.headers).forEach((function(t){var e=t,n=e[0],o=e[1];C.includes(n)&&(r[n]=o)})),r},B=function(){return(B=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Y=function(){return(Y=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},j=E.PAGINATION,N=E.ADDITIONAL_FILTERS,M=E.ORDER_FIELDS,L=E.FILTERS,k=E.GROUPS,F=E.ORDER_SORTS,q=E.ORDER_TYPES,H=function(t){var r=S(),e=r.vendorId,n=r.storeId,o=S(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=Y(Y({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),c=X(s,L,"filter"),f=K(c);return Y(Y({},t),{filterBy:f})},G=function(t){var r=J(t,k,"groupBy");return Y({},r)},V=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=X(e,M,"orderBy"),o=Y({},n),i=e.sort,u=e.type;return u&&!q.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),q.includes(u)||(delete o.type,o.type="ALPHABETIC"),i&&!F.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order sort "+i),F.includes(i)||(delete o.sort,o.sort="ASC"),Y(Y({},t),{orderBy:o})},z=function(t){var r=t.pagination,e=X(void 0===r?{}:r,j,"pagination");return Y(Y({},t),{pagination:e})},W=function(t){var r=t.additionalFilters,e=X(void 0===r?{}:r,N,"additionalFilters");return Y(Y({},t),{additionalFilters:e})},X=function(t,r,e){var n=Y({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?r.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+t),delete n[t]):delete n[t]})),n},J=function(t,r,e){var n=Y({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},K=function(t){var r=Y({},t);return Object.entries(r).forEach((function(t){var e=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete r[e]:Array.isArray(n)&&Q(n[0])||Q(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},Q=function(t){var r=typeof t;return"number"===r||"string"===r},Z=e(2),$=e.n(Z),tt=function(){return(tt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},rt=function(t){return Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1],i=o;return Array.isArray(o)&&(i=o.reduce((function(t,r){return t+","+r}))),tt(tt({},t),"catalogueId"===n?{channelId:i}:((e={})[n]=i,e))}),{})},et=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1];return"query"===n?tt(tt({},t),((e={})[n]=o,e)):t}),{})},nt=function(t,r){for(var e=t,n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],u=i[0],a=i[1],s=new RegExp("/:"+u,"g");e=e.replace(s,"/"+a)}return e},ot=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},it=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ut=function(t,r,e,n){return ot(void 0,void 0,void 0,(function(){var o,i,u,a,s,c,f;return it(this,(function(l){switch(l.label){case 0:if(r=function(t){var r=H(t),e=G(r),n=V(e),o=z(n);return W(o)}(r),_(r,e),o=function(t,r,e){var n,o=r.filterBy,i=r.groupBy,u=r.additionalFilters,a=rt(o),s=et(u),c=tt(tt(tt({},a),{groupBy:i}),s);i||delete c.groupBy;var f=nt(t,e.params),l=(null!==(n=S().artisanApp)&&void 0!==n?n:{}).apiURL,h=Object.entries(c).reduce((function(t,r,e){var n=r[0],o=r[1];return void 0===o?t:t+(e?"&":"")+n+"="+o}),l+"/"+f+"?");return tt(tt({},e),{url:h,query:c})}(t,r,e),p=o.url,i=$()(p),u=function(t){return S().apiCache[t]}(i),h=S().expiresAt,(a=(new Date).getTime()>=h)&&function(){var t=S().timeout,r=void 0===t?0:t;R({apiCache:B({},O.apiCache),expiresAt:(new Date).getTime()+r})}(),u&&!a)return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,n(o)];case 2:return s=l.sent(),f=x(s,void 0,o),function(t,r){var e,n=S().apiCache,o=B(B({},n),((e={})[t]=r,e));R({apiCache:o})}(i,f),[2,f];case 3:return c=l.sent(),[2,f=x(void 0,c,o)];case 4:return[2,u]}var h,p}))}))},at=function(t){return ot(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return it(this,(function(a){switch(a.label){case 0:r=t.url,e=t.headers,n=t.body,"{}"===(o={headers:e,body:JSON.stringify(n)}).body&&delete o.body,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(r,o).then((function(t){return t.json()}))];case 2:return i=a.sent(),[3,4];case 3:return u=a.sent(),i={code:null,status:"failed",message:u.message,stack:u.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i.data]}}))}))},st=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},ct=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ft=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},lt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ht=function(t,r){return ft(void 0,void 0,void 0,(function(){return lt(this,(function(e){switch(e.label){case 0:return[4,ut("v1/products/:productId",r,{headers:{},params:{productId:t},query:{},body:{}},(function(t){return ft(void 0,void 0,void 0,(function(){return lt(this,(function(r){switch(r.label){case 0:return[4,(e=t,st(void 0,void 0,void 0,(function(){return ct(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,e.sent()]}}))}))},pt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},dt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},vt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},gt=function(t){return yt(void 0,void 0,void 0,(function(){return vt(this,(function(r){switch(r.label){case 0:return[4,ut("v1/products",t,{headers:{},params:{},query:{},body:{}},(function(t){return yt(void 0,void 0,void 0,(function(){return vt(this,(function(r){switch(r.label){case 0:return[4,(e=t,pt(void 0,void 0,void 0,(function(){return dt(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,r.sent()]}}))}))},bt=function(){console.log("Not implemented yet")},mt=function(){console.log("not implemented yet")},wt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},At=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Et=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Tt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Pt=function(t){return Et(void 0,void 0,void 0,(function(){return Tt(this,(function(r){switch(r.label){case 0:return[4,ut("v1/stores/details",t,{headers:{},params:{},query:{},body:{}},(function(t){return Et(void 0,void 0,void 0,(function(){return Tt(this,(function(r){switch(r.label){case 0:return[4,(e=t,wt(void 0,void 0,void 0,(function(){return At(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,r.sent()]}}))}))},Ot=function(){return(Ot=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},It=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Rt=function(t,r){for(var e=It(r),n=t,o=t[0];e.length;){o=_t(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},St=function(t,r,e){for(var n=It(r),o=t,i=_t(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=_t(o,n[0]),n=n.slice(1),o=(u=Object.prototype.hasOwnProperty.call(i,"modifiers"))?i.modifiers:i.groups;var a=n[0];if(1===r.length&&(i={groups:t},u=!1),u){var s=i.modifiers.map((function(t){return t.id===a?Ot({},e):Ot({},t)}));i.modifiers=s}else{var c=i.groups.map((function(t){return t.id===a?Ot({},e):Ot({},t)}));i.groups=c}return 1===r.length?It(i.groups):It(t)},_t=function(t,r){var e=t.find((function(t){return t.id===r}));if(!e)throw new Error("Path segment "+r+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return e},Dt=function(){return(Dt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Ct=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},xt=function(t,r,e){var n=e.slice(0,-1),o=Rt(r,n),i=Ct(o.modifiers);"RADIO"===o.type&&(i=o.modifiers.map((function(t){return"RADIO"!==t.type||t.id===e[e.length-1]?Dt({},t):Dt(Dt({},t),{amount:0,touched:!1,error:"",totals:Xt(Dt(Dt({},t.data),{amount:0})),data:Dt(Dt({},t.data),{amount:0})})}))),i=i.map((function(r){var n=w(r.data),o=Ct(e.slice(0,-1),[r.id]);return Dt(Dt({},r),{groups:Mt(n,{rootId:t,path:o})})}));var u=Dt(Dt({},o),{touched:!0,modifiers:i}),a=St(r,n,u);return n.length>1&&(a=Ut(t,a,n)),a},Ut=function(t,r,e){var n=e.slice(0,-1),o=Rt(r,n),i=o.groups.map((function(t){return Dt({},t)})),u=Dt(Dt({},o),{touched:!0,groups:i}),a=St(r,n,u);return n.length>1&&(a=xt(t,a,n)),a},Bt=function(){return(Bt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Yt=function(t,r,e){var n,o=Bt({},S().forms),i=o[t],u=Rt(i.renderer,r),a=function(t,r,e,n){var o=Dt(Dt({},e),{amount:n,touched:!0,error:h(e,n),totals:Xt(Dt(Dt({},e.data),{amount:n})),data:Dt(Dt({},e.data),{amount:n})});return St(t,r,o)}(i.renderer,r,u,e);a=xt(t,a,r);var s=Bt(Bt({},i),{renderer:a}),c=Bt(Bt({},o),((n={})[t]=s,n));R({forms:c});var f=Bt({},s);delete f.callback,i.callback(f)},jt=function(){return(jt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Nt=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Mt=function(t,r){var e=r.rootId,n=r.path;return t.questions.map((function(r){return Lt(r,{amount:t.amount,rootId:e,path:Nt(n)})}))},Lt=function(t,r){var e,n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,c=r.amount,f=r.rootId,h=r.path,p={id:n,name:o,description:null!=i?i:"",images:null!=s?s:[],data:t,error:"",touched:!1,hidden:c<1,required:a>0,type:l(t)},d={rootId:f,max:u,min:a,type:p.type,modifiersCount:t.answers.length,amount:(e=t,e.answers.reduce((function(t,r){return t+r.amount}),0)),path:Nt(h,[n])},y=t.answers.map((function(t){return kt(t,d)}));return jt(jt({},p),{modifiers:y})},kt=function(t,r){var e=t.productId,n=t.questionId,o=t.name,i=t.images,u=t.amount,a=t.renderType,s=t.min,c=t.max,f=w(t),l=r.rootId,h=r.path,p=Nt(h,[e]);return{id:e,groupId:n,name:o,images:i,amount:u,data:t,groups:Mt(f,{rootId:l,path:p}),error:"",hidden:r.amount<1,min:s,max:c,required:s>0,touched:!1,totals:Xt(jt(jt({},t),{amount:u})),type:a,handleChange:function(t){Yt(r.rootId,p,t)}}},Ft=function(){return(Ft=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},qt=function(t,r){var e,n,o=t.productId,i=S().forms;if(!!i[o])return n="Form for product with id "+o+" has already been register. Please unsuscribe if you need to register a new form.",console.error(n),function(){};var u=function(t){var r=g(t,{amount:1});return{product:r,renderer:Mt(r,{rootId:r.productId,path:[]}),validate:Gt}}(t),a=Ft(Ft({},i),((e={})[o]=Ft(Ft({},u),{callback:r}),e));return R({forms:a}),r(u),function(){return Ht(o)}},Ht=function(t){var r=S().forms,e=Ft({},r);delete e[t],R({forms:e})},Gt=function(){},Vt=function(){return(Vt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},zt=!1,Wt=function(t,r){if(void 0===r&&(r={}),zt)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(R(Vt({artisanApp:t},r)),void 0!==r.timeout){var e=(new Date).getTime()+r.timeout;R({expiresAt:e})}"undefined"==typeof window||(zt=!0)}},Xt=function(t){return{grossPrice:Kt(t),totalDiscounts:Qt(t),totalTaxes:Jt(t),netPrice:Zt(t)}},Jt=function(t){var r=d(t),e=r.prices,n=r.amount,o=r.priceCategory,i=e[o],u=i.taxes,a=i.grossPrice,s=tr(u,a);return r.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var e=r.prices,n=r.amount,i=e[o],u=i.taxes,a=i.grossPrice;return t+n*tr(u,a)}),0)}),0)+s*n},Kt=function(t){return $t(t,"grossPrice")},Qt=function(t){return 0},Zt=function(t){return $t(t,"netPrice")},$t=function(t,r){var e=d(t),n=e.prices,o=e.amount,i=e.priceCategory,u=n[i][r];return e.questionsAndAnswers.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices;return t+e.amount*n[i][r]}),0)}),0)+u*o},tr=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)}}])}));
|
|
8
|
+
var n=e(19),o=e(20),i=e(21);function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,r){if(u()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=s.prototype:(null===t&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return c(this,t,r,e)}function c(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);s.TYPED_ARRAY_SUPPORT?(t=r).__proto__=s.prototype:t=h(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(r,e),o=(t=a(t,n)).write(r,e);o!==n&&(t=t.slice(0,o));return t}(t,r,e):function(t,r){if(s.isBuffer(r)){var e=0|p(r.length);return 0===(t=a(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?a(t,0):h(t,r);if("Buffer"===r.type&&i(r.data))return h(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,r){if(f(r),t=a(t,r<0?0:0|p(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function h(t,r){var e=r.length<0?0:0|p(r.length);t=a(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function p(t){if(t>=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|t}function d(t,r){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return F(t).length;default:if(n)return k(t).length;r=(""+r).toLowerCase(),n=!0}}function y(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,r,e);case"utf8":case"utf-8":return I(this,r,e);case"ascii":return R(this,r,e);case"latin1":case"binary":return _(this,r,e);case"base64":return O(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function g(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:b(t,r,e,n,o);if("number"==typeof r)return r&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):b(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,r,e,n,o){var i,u=1,a=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,a/=2,s/=2,e/=2}function c(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(o){var f=-1;for(i=e;i<a;i++)if(c(t,i)===c(r,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===s)return f*u}else-1!==f&&(i-=i-f),f=-1}else for(e+s>a&&(e=a-s),i=e;i>=0;i--){for(var l=!0,h=0;h<s;h++)if(c(t,i+h)!==c(r,h)){l=!1;break}if(l)return i}return-1}function m(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var i=r.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var a=parseInt(r.substr(2*u,2),16);if(isNaN(a))return u;t[e+u]=a}return u}function w(t,r,e,n){return q(k(r,t.length-e),t,e,n)}function A(t,r,e,n){return q(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function E(t,r,e,n){return A(t,r,e,n)}function T(t,r,e,n){return q(F(r),t,e,n)}function P(t,r,e,n){return q(function(t,r){for(var e,n,o,i=[],u=0;u<t.length&&!((r-=2)<0);++u)e=t.charCodeAt(u),n=e>>8,o=e%256,i.push(o),i.push(n);return i}(r,t.length-e),t,e,n)}function O(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function I(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i,u,a,s,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=e)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(s=(31&c)<<6|63&i)>127&&(f=s);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&(s=(15&c)<<12|(63&i)<<6|63&u)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:i=t[o+1],u=t[o+2],a=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&a)&&(s=(15&c)<<18|(63&i)<<12|(63&u)<<6|63&a)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(t){var r=t.length;if(r<=4096)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return e}(n)}r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=u(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,r,e){return c(null,t,r,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,r,e){return function(t,r,e,n){return f(r),r<=0?a(t,r):void 0!==e?"string"==typeof n?a(t,r).fill(e,n):a(t,r).fill(e):a(t,r)}(null,t,r,e)},s.allocUnsafe=function(t){return l(null,t)},s.allocUnsafeSlow=function(t){return l(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,r){if(!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);o<i;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return e<n?-1:n<e?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,r){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=s.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!s.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,o),o+=u.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)v(this,r,r+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)v(this,r,r+3),v(this,r+1,r+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)v(this,r,r+7),v(this,r+1,r+6),v(this,r+2,r+5),v(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?I(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,r,e,n,o){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),a=Math.min(i,u),c=this.slice(n,o),f=t.slice(r,e),l=0;l<a;++l)if(c[l]!==f[l]){i=c[l],u=f[l];break}return i<u?-1:u<i?1:0},s.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},s.prototype.indexOf=function(t,r,e){return g(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return g(this,t,r,e,!1)},s.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return m(this,t,r,e);case"utf8":case"utf-8":return w(this,t,r,e);case"ascii":return A(this,t,r,e);case"latin1":case"binary":return E(this,t,r,e);case"base64":return T(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(127&t[o]);return n}function _(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function S(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=L(t[i]);return o}function D(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function C(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function x(t,r,e,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function U(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function j(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Y(t,r,e,n,i){return i||j(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function M(t,r,e,n,i){return i||j(t,0,e,8),o.write(t,r,e,n,52,8),e+8}s.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),s.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=s.prototype;else{var o=r-t;e=new s(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+t]}return e},s.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},s.prototype.readUInt8=function(t,r){return r||C(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,r){return r||C(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,r){return r||C(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,r){return r||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,r){return r||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||C(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},s.prototype.readInt8=function(t,r){return r||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,r){r||C(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(t,r){r||C(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(t,r){return r||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return r||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return r||C(t,4,this.length),o.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return r||C(t,4,this.length),o.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return r||C(t,8,this.length),o.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return r||C(t,8,this.length),o.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||x(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},s.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||x(this,t,r,e,Math.pow(2,8*e)-1,0);var o=e-1,i=1;for(this[r+o]=255&t;--o>=0&&(i*=256);)this[r+o]=t/i&255;return r+e},s.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):U(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):U(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):B(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):B(this,t,r,!1),r+4},s.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);x(this,t,r,e,o-1,-o)}var i=0,u=1,a=0;for(this[r]=255&t;++i<e&&(u*=256);)t<0&&0===a&&0!==this[r+i-1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);x(this,t,r,e,o-1,-o)}var i=e-1,u=1,a=0;for(this[r+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/u>>0)-a&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):U(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):U(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):B(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||x(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):B(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return Y(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return Y(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return M(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return M(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var o,i=n-e;if(this===t&&e<r&&r<n)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},s.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var i;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var u=s.isBuffer(t)?t:k(new s(t,n).toString()),a=u.length;for(i=0;i<e-r;++i)this[i+r]=u[i%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function k(t,r){var e;r=r||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function F(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}}).call(this,e(18))},function(t,r){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,r,e){"use strict";r.byteLength=function(t){var r=c(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,e,n=c(t),u=n[0],a=n[1],s=new i(function(t,r,e){return 3*(r+e)/4-e}(0,u,a)),f=0,l=a>0?u-4:u;for(e=0;e<l;e+=4)r=o[t.charCodeAt(e)]<<18|o[t.charCodeAt(e+1)]<<12|o[t.charCodeAt(e+2)]<<6|o[t.charCodeAt(e+3)],s[f++]=r>>16&255,s[f++]=r>>8&255,s[f++]=255&r;2===a&&(r=o[t.charCodeAt(e)]<<2|o[t.charCodeAt(e+1)]>>4,s[f++]=255&r);1===a&&(r=o[t.charCodeAt(e)]<<10|o[t.charCodeAt(e+1)]<<4|o[t.charCodeAt(e+2)]>>2,s[f++]=r>>8&255,s[f++]=255&r);return s},r.fromByteArray=function(t){for(var r,e=t.length,o=e%3,i=[],u=0,a=e-o;u<a;u+=16383)i.push(f(t,u,u+16383>a?a:u+16383));1===o?(r=t[e-1],i.push(n[r>>2]+n[r<<4&63]+"==")):2===o&&(r=(t[e-2]<<8)+t[e-1],i.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=u.length;a<s;++a)n[a]=u[a],o[u.charCodeAt(a)]=a;function c(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function f(t,r,e){for(var o,i,u=[],a=r;a<e;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),u.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return u.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,r){r.read=function(t,r,e,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=e?o-1:0,h=e?-1:1,p=t[r+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[r+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[r+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=c}return(p?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var u,a,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,u=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+l>=1?h/s:h*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=f?(a=0,u=f):u+l>=1?(a=(r*s-1)*Math.pow(2,o),u+=l):(a=r*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[e+p]=255&a,p+=d,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[e+p]=255&u,p+=d,u/=256,c-=8);t[e+p-d]|=128*y}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r){var e,n;e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,r){return t<<r|t>>>32-r},rotr:function(t,r){return t<<32-r|t>>>r},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var r=0;r<t.length;r++)t[r]=n.endian(t[r]);return t},randomBytes:function(t){for(var r=[];t>0;t--)r.push(Math.floor(256*Math.random()));return r},bytesToWords:function(t){for(var r=[],e=0,n=0;e<t.length;e++,n+=8)r[n>>>5]|=t[e]<<24-n%32;return r},wordsToBytes:function(t){for(var r=[],e=0;e<32*t.length;e+=8)r.push(t[e>>>5]>>>24-e%32&255);return r},bytesToHex:function(t){for(var r=[],e=0;e<t.length;e++)r.push((t[e]>>>4).toString(16)),r.push((15&t[e]).toString(16));return r.join("")},hexToBytes:function(t){for(var r=[],e=0;e<t.length;e+=2)r.push(parseInt(t.substr(e,2),16));return r},bytesToBase64:function(t){for(var r=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?r.push(e.charAt(o>>>6*(3-i)&63)):r.push("=");return r.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&r.push((e.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|e.indexOf(t.charAt(n))>>>6-2*o);return r}},t.exports=n},,function(t,r,e){"use strict";e.r(r),e.d(r,"getCategories",(function(){return A})),e.d(r,"getProductDetails",(function(){return ht})),e.d(r,"getProducts",(function(){return gt})),e.d(r,"getRecommendedProducts",(function(){return bt})),e.d(r,"getRelatedProducts",(function(){return mt})),e.d(r,"getStoreDetails",(function(){return Pt})),e.d(r,"registerModifiersForm",(function(){return qt})),e.d(r,"validateProduct",(function(){return Gt})),e.d(r,"initProducts",(function(){return Wt})),e.d(r,"getProductTotals",(function(){return Xt})),e.d(r,"transformers",(function(){return o})),e.d(r,"assertions",(function(){return n}));var n={};e.r(n),e.d(n,"isBaseProduct",(function(){return a})),e.d(n,"isProductDetails",(function(){return s})),e.d(n,"isCartProduct",(function(){return c})),e.d(n,"isFormCartProduct",(function(){return f}));var o={};e.r(o),e.d(o,"toCartProduct",(function(){return d})),e.d(o,"toFormCartProduct",(function(){return g})),e.d(o,"toFormCartProductHelper",(function(){return b})),e.d(o,"toFormCartProductFromProductDetails",(function(){return m})),e.d(o,"toFormCartProductFromAnswer",(function(){return w}));var i=e(0),u=function(t){return Object.keys(t)},a=function(t){var r=t.attributes,e=t.available,n=t.description,o=t.name,a=t.images,s=t.prices,c=t.productId,f=t.sponsored,l=t.status,h=t.type;return"boolean"==typeof r.showInMenu&&("boolean"==typeof e&&("boolean"==typeof f&&("string"==typeof n&&("string"==typeof o&&("string"==typeof c&&(!("object"!=typeof s||"object"==typeof s&&Object.keys(s).length<1)&&(!!Array.isArray(a)&&((!l||"ACTIVE"===l||"INACTIVE"===l)&&!!u(i.ProductType).includes(h)))))))))},s=function(t){if(!a(t))return!1;var r=t.isPriceVip,e=t.manufacturer,n=t.maxAmountForSale,o=t.schedule,i=t.questions;return"boolean"==typeof r&&(!!Array.isArray(e)&&("number"==typeof n&&(!!Array.isArray(o)&&!!Array.isArray(i))))},c=function(t){if(!s(t))return!1;var r=t.hash,e=t.createdAt,n=t.updatedAt,o=t.alerts,a=t.amount,c=t.priceCategory,f=t.comment,l=t.questionsAndAnswers;return"string"==typeof r&&("string"==typeof e&&("string"==typeof n&&(!!Array.isArray(o)&&("number"==typeof a&&("string"==typeof f&&(!!u(i.PriceCategoryType).includes(c)&&!!Array.isArray(l)))))))},f=function(t){var r;if(!c(t))return!1;var e=t.questions;if(!Array.isArray(e))return!1;var n=null===(r=null==e?void 0:e[0])||void 0===r?void 0:r.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},l=function(t){var r=t.min,e=t.max,n=t.type;if(n)return n;if(0===r&&1===e)return"CHECKBOX";if(1===r&&1===e)return"RADIO";if(0===r&&(0===e||e===1/0))return"COUNTER";if(e>=r)return"COUNTER";throw new Error("Modifier group bad configured. min "+r+", max "+e+", type "+n)},h=function(t,r){var e=t.max,n=t.min;return r>e?"Amount is heigher than the maximum allowed amount "+e:r<n?"Amount is lower than the minimum allowed amount "+n:""},p=function(){return(p=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},d=function(t,r){if(void 0===r&&(r={}),c(t))return p(p({},t),r);if(s(t))return y(t,r);var e=v(t);return y(e,r)},y=function(t,r){var e;return void 0===r&&(r={}),p(p(p({},t),{questionsAndAnswers:[],amount:null!==(e=t.amount)&&void 0!==e?e:0,priceCategory:i.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),r)},v=function(t,r){return void 0===r&&(r={}),p(p(p({},t),{hasModifiers:!1,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),r)},g=function(t,r){if(void 0===r&&(r={}),f(t))return p(p({},t),r);if(s(t))return m(t,r);var e=v(t);return m(e,r)},b=function(t,r){void 0===r&&(r={});var e=t.priceCategory,n=t.productId,o=t.amount,i=t.questions.map((function(t){var r=t.answers,i=t.questionId,u=t.min,a=t.max,s={rootId:n,min:u,max:a,type:l(t),modifiersCount:r.length,amount:o,path:[]};return p(p({},t),{answers:r.map((function(t){var r=function(t){var r=t.min;return 1===t.modifiersCount?r:0}(s),n=function(t){var r=t.max,e=t.type,n=r||1/0;return"RADIO"===e||"CHECKBOX"===e?1:n}(s),o=function(t){var r=t.groupType,e=t.min,n=t.max;return"RADIO"===r||1===e&&1===n?"RADIO":0===e&&1===n?"CHECKBOX":0!==e||0!==n&&n!==1/0?n>=e?"COUNTER":r:"COUNTER"}({min:r,max:n,groupType:s.type}),u=t.questions.length;return p(p({amount:0},t),{priceCategory:e,questionId:i,min:r,max:n,renderType:o,questions:u?b(t).questions:[]})}))})}));return p(p(p({},t),{questions:i}),r)},m=function(t,r){void 0===r&&(r={});var e=y(t);return b(e,r)},w=function(t,r){return void 0===r&&(r={}),b(t,r)},A=function(){console.log("Not supported yet")},E={CLIENT_NAME:"Trade S.A.",DEFAULT_REQUEST_TIMEOUT:1e4,EXCLUDED_LOGGER_STATUS_CODES:[422],INCLUDED_LOGGER_ENVS:["staging","production"],INCLUDED_INTL_LOG_ENVS:[""],COUNTRY:{NAME:"Ecuador",CODE:"593",LANGUAGE:"es"},DEFAULT_API_TIMEOUT:3e5,HEADERS:["accountId"],FILTERS:["vendorId","storeId","catalogueId","categoryId","productId"],GROUPS:["CATEGORIES","TAGS"],ORDER_FIELDS:["type","sort"],ORDER_TYPES:["ALPHABETIC","PRICE","PREDEFINED"],ORDER_SORTS:["ASC","DESC"],PAGINATION:["page","vendor","store","catalogue","category","product"],ADDITIONAL_FILTERS:["price","query","tags","manufacturerId","weight","dimensions"]},T=function(){return(T=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},P=E.DEFAULT_API_TIMEOUT,O={artisanApp:void 0,timeout:P,apiCache:{},expiresAt:(new Date).getTime()+P,forms:{}};Object.freeze(O);var I=T({},O);Object.seal(I);var R=function(t){I=T(T({},I),t)},_=function(){return T({},I)},S=function(t,r,e){void 0===e&&(e="");var n=r.headers.accountId,o=t.filterBy,i=o.vendorId,u=o.storeId,a=o.catalogueId;!function(t,r){void 0===r&&(r="");var e=_().accountId;if(void 0===t&&void 0===e)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+r)}(n,e),function(t,r){void 0===r&&(r="");var e=_().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+r)}(i,e),function(t,r){void 0===r&&(r="");var e=_().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+r)}(u,e),function(t,r){void 0===r&&(r="");var e=_().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==e))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+r)}(a,e)},D=E.FILTERS,C=E.HEADERS,x=function(t,r,e){var n=null==r?void 0:r.message;try{n=r?JSON.parse(r.message):r}catch(t){}return{data:t,hints:U(e),config:e,error:n}},U=function(t){var r={};return Object.entries(t.query).forEach((function(t){var e=t,n=e[0],o=e[1];D.includes(n)&&(r[n]=o)})),Object.entries(t.headers).forEach((function(t){var e=t,n=e[0],o=e[1];C.includes(n)&&(r[n]=o)})),r},B=function(){return(B=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},j=function(){return(j=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Y=E.PAGINATION,M=E.ADDITIONAL_FILTERS,N=E.ORDER_FIELDS,L=E.FILTERS,k=E.GROUPS,F=E.ORDER_SORTS,q=E.ORDER_TYPES,H=function(t){var r=_(),e=r.vendorId,n=r.storeId,o=_(),i=o.catalogueId,u=o.categoryId,a=o.productId,s=j(j({},{vendorId:e,storeId:n,catalogueId:i,categoryId:u,productId:a}),t.filterBy),c=X(s,L,"filter"),f=K(c);return j(j({},t),{filterBy:f})},G=function(t){var r=J(t,k,"groupBy");return j({},r)},V=function(t){var r=t.orderBy,e=void 0===r?{}:r,n=X(e,N,"orderBy"),o=j({},n),i=e.sort,u=e.type;return u&&!q.includes(u)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+u),q.includes(u)||(delete o.type,o.type="ALPHABETIC"),i&&!F.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order sort "+i),F.includes(i)||(delete o.sort,o.sort="ASC"),j(j({},t),{orderBy:o})},z=function(t){var r=t.pagination,e=X(void 0===r?{}:r,Y,"pagination");return j(j({},t),{pagination:e})},W=function(t){var r=t.additionalFilters,e=X(void 0===r?{}:r,M,"additionalFilters");return j(j({},t),{additionalFilters:e})},X=function(t,r,e){var n=j({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?r.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+t),delete n[t]):delete n[t]})),n},J=function(t,r,e){var n=j({},t),o=t[e];return void 0===o||r.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+e+" "+o),delete n[e]),n},K=function(t){var r=j({},t);return Object.entries(r).forEach((function(t){var e=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete r[e]:Array.isArray(n)&&Q(n[0])||Q(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+e+" = "+n),delete r[e])})),r},Q=function(t){var r=typeof t;return"number"===r||"string"===r},Z=e(2),$=e.n(Z),tt=function(){return(tt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},rt=function(t){return Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1],i=o;return Array.isArray(o)&&(i=o.reduce((function(t,r){return t+","+r}))),tt(tt({},t),"catalogueId"===n?{channelId:i}:((e={})[n]=i,e))}),{})},et=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,r){var e,n=r[0],o=r[1];return"query"===n?tt(tt({},t),((e={})[n]=o,e)):t}),{})},nt=function(t,r){for(var e=t,n=0,o=Object.entries(r);n<o.length;n++){var i=o[n],u=i[0],a=i[1],s=new RegExp("/:"+u,"g");e=e.replace(s,"/"+a)}return e},ot=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},it=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ut=function(t,r,e,n){return ot(void 0,void 0,void 0,(function(){var o,i,u,a,s,c,f;return it(this,(function(l){switch(l.label){case 0:if(r=function(t){var r=H(t),e=G(r),n=V(e),o=z(n);return W(o)}(r),S(r,e),o=function(t,r,e){var n,o=r.filterBy,i=r.groupBy,u=r.additionalFilters,a=rt(o),s=et(u),c=tt(tt(tt({},a),{groupBy:i}),s);i||delete c.groupBy;var f=nt(t,e.params),l=(null!==(n=_().artisanApp)&&void 0!==n?n:{}).apiURL,h=Object.entries(c).reduce((function(t,r,e){var n=r[0],o=r[1];return void 0===o?t:t+(e?"&":"")+n+"="+o}),l+"/"+f+"?");return tt(tt({},e),{url:h,query:c})}(t,r,e),p=o.url,i=$()(p),u=function(t){return _().apiCache[t]}(i),h=_().expiresAt,(a=(new Date).getTime()>=h)&&function(){var t=_().timeout,r=void 0===t?0:t;R({apiCache:B({},O.apiCache),expiresAt:(new Date).getTime()+r})}(),u&&!a)return[3,4];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,n(o)];case 2:return s=l.sent(),f=x(s,void 0,o),function(t,r){var e,n=_().apiCache,o=B(B({},n),((e={})[t]=r,e));R({apiCache:o})}(i,f),[2,f];case 3:return c=l.sent(),[2,f=x(void 0,c,o)];case 4:return[2,u]}var h,p}))}))},at=function(t){return ot(void 0,void 0,void 0,(function(){var r,e,n,o,i,u;return it(this,(function(a){switch(a.label){case 0:r=t.url,e=t.headers,n=t.body,"{}"===(o={headers:e,body:JSON.stringify(n)}).body&&delete o.body,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(r,o).then((function(t){return t.json()}))];case 2:return i=a.sent(),[3,4];case 3:return u=a.sent(),i={code:null,status:"failed",message:u.message,stack:u.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i.data]}}))}))},st=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},ct=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ft=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},lt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},ht=function(t,r){return ft(void 0,void 0,void 0,(function(){return lt(this,(function(e){switch(e.label){case 0:return[4,ut("v1/products/:productId",r,{headers:{},params:{productId:t},query:{},body:{}},(function(t){return ft(void 0,void 0,void 0,(function(){return lt(this,(function(r){switch(r.label){case 0:return[4,(e=t,st(void 0,void 0,void 0,(function(){return ct(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,e.sent()]}}))}))},pt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},dt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},vt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},gt=function(t){return yt(void 0,void 0,void 0,(function(){return vt(this,(function(r){switch(r.label){case 0:return[4,ut("v1/products",t,{headers:{},params:{},query:{},body:{}},(function(t){return yt(void 0,void 0,void 0,(function(){return vt(this,(function(r){switch(r.label){case 0:return[4,(e=t,pt(void 0,void 0,void 0,(function(){return dt(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,r.sent()]}}))}))},bt=function(){console.log("Not implemented yet")},mt=function(){console.log("not implemented yet")},wt=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},At=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Et=function(t,r,e,n){return new(e||(e=Promise))((function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(u,a)}s((n=n.apply(t,r||[])).next())}))},Tt=function(t,r){var e,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=r.call(t,u)}catch(t){i=[6,t],n=0}finally{e=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},Pt=function(t){return Et(void 0,void 0,void 0,(function(){return Tt(this,(function(r){switch(r.label){case 0:return[4,ut("v1/stores/details",t,{headers:{},params:{},query:{},body:{}},(function(t){return Et(void 0,void 0,void 0,(function(){return Tt(this,(function(r){switch(r.label){case 0:return[4,(e=t,wt(void 0,void 0,void 0,(function(){return At(this,(function(t){switch(t.label){case 0:return[4,at(e)];case 1:return[2,t.sent()]}}))})))];case 1:return[2,r.sent()]}var e}))}))}))];case 1:return[2,r.sent()]}}))}))},Ot=function(){return(Ot=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},It=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Rt=function(t,r){for(var e=It(r),n=t,o=t[0];e.length;){o=St(n,e[0]),e=e.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups}return o},_t=function(t,r,e){for(var n=It(r),o=t,i=St(o,n[0]),u=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=St(o,n[0]),n=n.slice(1),o=(u=Object.prototype.hasOwnProperty.call(i,"modifiers"))?i.modifiers:i.groups;var a=n[0];if(1===r.length&&(i={groups:t},u=!1),u){var s=i.modifiers.map((function(t){return t.id===a?Ot({},e):Ot({},t)}));i.modifiers=s}else{var c=i.groups.map((function(t){return t.id===a?Ot({},e):Ot({},t)}));i.groups=c}return 1===r.length?It(i.groups):It(t)},St=function(t,r){var e=t.find((function(t){return t.id===r}));if(!e)throw new Error("Path segment "+r+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return e},Dt=function(){return(Dt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Ct=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},xt=function(t,r,e){var n=e.slice(0,-1),o=Rt(r,n),i=Ct(o.modifiers);"RADIO"===o.type&&(i=o.modifiers.map((function(t){return"RADIO"!==t.type||t.id===e[e.length-1]?Dt({},t):Dt(Dt({},t),{amount:0,touched:!1,error:"",totals:Xt(Dt(Dt({},t.data),{amount:0})),data:Dt(Dt({},t.data),{amount:0})})}))),i=i.map((function(r){var n=w(r.data),o=Ct(e.slice(0,-1),[r.id]);return Dt(Dt({},r),{groups:Nt(n,{rootId:t,path:o})})}));var u=Dt(Dt({},o),{touched:!0,modifiers:i}),a=_t(r,n,u);return n.length>1&&(a=Ut(t,a,n)),a},Ut=function(t,r,e){var n=e.slice(0,-1),o=Rt(r,n),i=o.groups.map((function(t){return Dt({},t)})),u=Dt(Dt({},o),{touched:!0,groups:i}),a=_t(r,n,u);return n.length>1&&(a=xt(t,a,n)),a},Bt=function(){return(Bt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},jt=function(t,r,e){var n,o=Bt({},_().forms),i=o[t],u=Rt(i.renderer,r),a=function(t,r,e,n){var o=Dt(Dt({},e),{amount:n,touched:!0,error:h(e,n),totals:Xt(Dt(Dt({},e.data),{amount:n})),data:Dt(Dt({},e.data),{amount:n})});return _t(t,r,o)}(i.renderer,r,u,e);a=xt(t,a,r);var s=Bt(Bt({},i),{renderer:a}),c=Bt(Bt({},o),((n={})[t]=s,n));R({forms:c});var f=Bt({},s);delete f.callback,i.callback(f)},Yt=function(){return(Yt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},Mt=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n},Nt=function(t,r){var e=r.rootId,n=r.path;return t.questions.map((function(r){return Lt(r,{amount:t.amount,rootId:e,path:Mt(n)})}))},Lt=function(t,r){var e,n=t.questionId,o=t.name,i=t.description,u=t.max,a=t.min,s=t.images,c=r.amount,f=r.rootId,h=r.path,p={id:n,name:o,description:null!=i?i:"",images:null!=s?s:[],data:t,error:"",touched:!1,hidden:c<1,required:a>0,type:l(t)},d={rootId:f,max:u,min:a,type:p.type,modifiersCount:t.answers.length,amount:(e=t,e.answers.reduce((function(t,r){return t+r.amount}),0)),path:Mt(h,[n])},y=t.answers.map((function(t){return kt(t,d)}));return Yt(Yt({},p),{modifiers:y})},kt=function(t,r){var e=t.productId,n=t.questionId,o=t.name,i=t.images,u=t.amount,a=t.renderType,s=t.min,c=t.max,f=w(t),l=r.rootId,h=r.path,p=Mt(h,[e]);return{id:e,groupId:n,name:o,images:i,amount:u,data:t,groups:Nt(f,{rootId:l,path:p}),error:"",hidden:r.amount<1,min:s,max:c,required:s>0,touched:!1,totals:Xt(Yt(Yt({},t),{amount:u})),type:a,handleChange:function(t){jt(r.rootId,p,t)}}},Ft=function(){return(Ft=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},qt=function(t,r){var e,n,o=t.productId,i=_().forms;if(!!i[o])return n="Form for product with id "+o+" has already been register. Please unsuscribe if you need to register a new form.",console.error(n),function(){};var u=function(t){var r=g(t,{amount:1});return{product:r,renderer:Nt(r,{rootId:r.productId,path:[]}),validate:Gt}}(t),a=Ft(Ft({},i),((e={})[o]=Ft(Ft({},u),{callback:r}),e));return R({forms:a}),r(u),function(){return Ht(o)}},Ht=function(t){var r=_().forms,e=Ft({},r);delete e[t],R({forms:e})},Gt=function(){},Vt=function(){return(Vt=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},zt=!1,Wt=function(t,r){if(void 0===r&&(r={}),zt)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(R(Vt({artisanApp:t},r)),void 0!==r.timeout){var e=(new Date).getTime()+r.timeout;R({expiresAt:e})}"undefined"==typeof window||(zt=!0)}},Xt=function(t){return{grossPrice:Kt(t),totalDiscounts:Qt(t),totalTaxes:Jt(t),netPrice:Zt(t)}},Jt=function(t){var r=d(t),e=r.prices,n=r.amount,o=r.priceCategory,i=e[o],u=i.taxes,a=i.grossPrice,s=tr(u,a);return r.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var e=r.prices,n=r.amount,i=e[o],u=i.taxes,a=i.grossPrice;return t+n*tr(u,a)}),0)}),0)+s*n},Kt=function(t){return $t(t,"grossPrice")},Qt=function(t){return 0},Zt=function(t){return $t(t,"netPrice")},$t=function(t,r){var e=d(t),n=e.prices,o=e.amount,i=e.priceCategory,u=n[i][r];return e.questionsAndAnswers.reduce((function(t,e){return t+e.answers.reduce((function(t,e){var n=e.prices;return t+e.amount*n[i][r]}),0)}),0)+u*o},tr=function(t,r){return t.reduce((function(t,e){return t+e.percentage/100*r}),0)}}])}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"label":"main.bundle.js","isAsset":true,"statSize":142352,"parsedSize":58335,"gzipSize":14947,"groups":[{"label":"types/build","path":"./types/build","statSize":5546,"groups":[{"id":0,"label":"index.js","path":"./types/build/index.js","statSize":1432,"parsedSize":532,"gzipSize":291},{"label":"types","path":"./types/build/types","statSize":4114,"groups":[{"id":3,"label":"app.types.js","path":"./types/build/types/app.types.js","statSize":116,"parsedSize":78,"gzipSize":97},{"id":4,"label":"account.types.js","path":"./types/build/types/account.types.js","statSize":153,"parsedSize":78,"gzipSize":97},{"id":5,"label":"artisanDB.types.js","path":"./types/build/types/artisanDB.types.js","statSize":122,"parsedSize":78,"gzipSize":97},{"id":6,"label":"category.types.js","path":"./types/build/types/category.types.js","statSize":121,"parsedSize":78,"gzipSize":97},{"id":7,"label":"channel.types.js","path":"./types/build/types/channel.types.js","statSize":153,"parsedSize":78,"gzipSize":97},{"id":8,"label":"common.types.js","path":"./types/build/types/common.types.js","statSize":165,"parsedSize":78,"gzipSize":97},{"id":9,"label":"coupons.types.js","path":"./types/build/types/coupons.types.js","statSize":120,"parsedSize":78,"gzipSize":97},{"id":10,"label":"image.types.js","path":"./types/build/types/image.types.js","statSize":149,"parsedSize":78,"gzipSize":97},{"id":11,"label":"product.types.js","path":"./types/build/types/product.types.js","statSize":1526,"parsedSize":723,"gzipSize":357},{"id":12,"label":"shippingCost.types.js","path":"./types/build/types/shippingCost.types.js","statSize":163,"parsedSize":78,"gzipSize":97},{"id":13,"label":"shoppingCart.types.js","path":"./types/build/types/shoppingCart.types.js","statSize":125,"parsedSize":78,"gzipSize":97},{"id":14,"label":"store.types.js","path":"./types/build/types/store.types.js","statSize":936,"parsedSize":485,"gzipSize":270},{"id":15,"label":"vendor.types.js","path":"./types/build/types/vendor.types.js","statSize":119,"parsedSize":78,"gzipSize":97},{"id":16,"label":"http.types.js","path":"./types/build/types/http.types.js","statSize":146,"parsedSize":78,"gzipSize":97}],"parsedSize":2144,"gzipSize":460}],"parsedSize":2676,"gzipSize":659},{"label":"node_modules","path":"./node_modules","statSize":60672,"groups":[{"label":"charenc","path":"./node_modules/charenc","statSize":850,"groups":[{"id":1,"label":"charenc.js","path":"./node_modules/charenc/charenc.js","statSize":850,"parsedSize":426,"gzipSize":231}],"parsedSize":426,"gzipSize":231},{"label":"sha1","path":"./node_modules/sha1","statSize":2124,"groups":[{"id":2,"label":"sha1.js","path":"./node_modules/sha1/sha1.js","statSize":2124,"parsedSize":947,"gzipSize":625}],"parsedSize":947,"gzipSize":625},{"label":"buffer","path":"./node_modules/buffer","statSize":48590,"groups":[{"id":17,"label":"index.js","path":"./node_modules/buffer/index.js","statSize":48590,"parsedSize":19827,"gzipSize":5835}],"parsedSize":19827,"gzipSize":5835},{"label":"base64-js","path":"./node_modules/base64-js","statSize":3944,"groups":[{"id":19,"label":"index.js","path":"./node_modules/base64-js/index.js","statSize":3944,"parsedSize":1406,"gzipSize":743}],"parsedSize":1406,"gzipSize":743},{"label":"ieee754","path":"./node_modules/ieee754","statSize":2064,"groups":[{"id":20,"label":"index.js","path":"./node_modules/ieee754/index.js","statSize":2064,"parsedSize":881,"gzipSize":496}],"parsedSize":881,"gzipSize":496},{"label":"isarray","path":"./node_modules/isarray","statSize":132,"groups":[{"id":21,"label":"index.js","path":"./node_modules/isarray/index.js","statSize":132,"parsedSize":104,"gzipSize":109}],"parsedSize":104,"gzipSize":109},{"label":"crypt","path":"./node_modules/crypt","statSize":2968,"groups":[{"id":22,"label":"crypt.js","path":"./node_modules/crypt/crypt.js","statSize":2968,"parsedSize":1273,"gzipSize":646}],"parsedSize":1273,"gzipSize":646}],"parsedSize":24864,"gzipSize":7854},{"label":"buildin","path":"./buildin","statSize":472,"groups":[{"id":18,"label":"global.js","path":"./buildin/global.js","statSize":472,"parsedSize":144,"gzipSize":129}],"parsedSize":144,"gzipSize":129},{"label":"src","path":"./src","statSize":75662,"groups":[{"id":24,"label":"index.ts + 30 modules (concatenated)","path":"./src/index.ts + 30 modules (concatenated)","statSize":75662,"parsedSize":29470,"gzipSize":6431,"concatenated":true,"groups":[{"label":"src","path":"./src/index.ts + 30 modules (concatenated)/src","statSize":75652,"groups":[{"id":null,"label":"index.ts","path":"./src/index.ts + 30 modules (concatenated)/src/index.ts","statSize":958,"parsedSize":373,"gzipSize":81,"inaccurateSizes":true},{"label":"utils","path":"./src/index.ts + 30 modules (concatenated)/src/utils","statSize":45140,"groups":[{"label":"assertions","path":"./src/index.ts + 30 modules (concatenated)/src/utils/assertions","statSize":4095,"groups":[{"id":null,"label":"assertions.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/assertions/assertions.utils.ts","statSize":4095,"parsedSize":1594,"gzipSize":348,"inaccurateSizes":true}],"parsedSize":1594,"gzipSize":348,"inaccurateSizes":true},{"label":"transformers","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers","statSize":5671,"groups":[{"id":null,"label":"transformers.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers/transformers.utils.ts","statSize":4722,"parsedSize":1839,"gzipSize":401,"inaccurateSizes":true},{"id":null,"label":"api.transformer.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/transformers/api.transformer.ts","statSize":949,"parsedSize":369,"gzipSize":80,"inaccurateSizes":true}],"parsedSize":2208,"gzipSize":482,"inaccurateSizes":true},{"label":"caculations","path":"./src/index.ts + 30 modules (concatenated)/src/utils/caculations","statSize":2966,"groups":[{"id":null,"label":"calculations.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/caculations/calculations.utils.ts","statSize":2966,"parsedSize":1155,"gzipSize":252,"inaccurateSizes":true}],"parsedSize":1155,"gzipSize":252,"inaccurateSizes":true},{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/common.utils.ts","statSize":396,"parsedSize":154,"gzipSize":33,"inaccurateSizes":true},{"label":"modifiers","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers","statSize":15705,"groups":[{"id":null,"label":"common.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/common.utils.ts","statSize":2286,"parsedSize":890,"gzipSize":194,"inaccurateSizes":true},{"id":null,"label":"form.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/form.utils.ts","statSize":626,"parsedSize":243,"gzipSize":53,"inaccurateSizes":true},{"id":null,"label":"renderer.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/renderer.utils.ts","statSize":3862,"parsedSize":1504,"gzipSize":328,"inaccurateSizes":true},{"id":null,"label":"handleChange.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/handleChange.utils.ts","statSize":1667,"parsedSize":649,"gzipSize":141,"inaccurateSizes":true},{"id":null,"label":"rendererTraversal.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/rendererTraversal.utils.ts","statSize":3148,"parsedSize":1226,"gzipSize":267,"inaccurateSizes":true},{"id":null,"label":"updateRenderer.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/modifiers/updateRenderer.utils.ts","statSize":4116,"parsedSize":1603,"gzipSize":349,"inaccurateSizes":true}],"parsedSize":6117,"gzipSize":1334,"inaccurateSizes":true},{"label":"http","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http","statSize":16307,"groups":[{"id":null,"label":"http.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/http.utils.ts","statSize":6246,"parsedSize":2432,"gzipSize":530,"inaccurateSizes":true},{"id":null,"label":"cache.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/cache.utils.ts","statSize":1212,"parsedSize":472,"gzipSize":103,"inaccurateSizes":true},{"id":null,"label":"purge.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/purge.utils.ts","statSize":5834,"parsedSize":2272,"gzipSize":495,"inaccurateSizes":true},{"id":null,"label":"request.utils.ts","path":"./src/index.ts + 30 modules (concatenated)/src/utils/http/request.utils.ts","statSize":3015,"parsedSize":1174,"gzipSize":256,"inaccurateSizes":true}],"parsedSize":6351,"gzipSize":1386,"inaccurateSizes":true}],"parsedSize":17581,"gzipSize":3836,"inaccurateSizes":true},{"label":"lib","path":"./src/index.ts + 30 modules (concatenated)/src/lib","statSize":16836,"groups":[{"label":"getCategories","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getCategories","statSize":113,"groups":[{"id":null,"label":"getCategories.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getCategories/getCategories.ts","statSize":113,"parsedSize":44,"gzipSize":9,"inaccurateSizes":true}],"parsedSize":44,"gzipSize":9,"inaccurateSizes":true},{"label":"getProductDetails","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProductDetails","statSize":3795,"groups":[{"id":null,"label":"getProductDetails.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProductDetails/getProductDetails.ts","statSize":3795,"parsedSize":1478,"gzipSize":322,"inaccurateSizes":true}],"parsedSize":1478,"gzipSize":322,"inaccurateSizes":true},{"label":"getProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProducts","statSize":3669,"groups":[{"id":null,"label":"getProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getProducts/getProducts.ts","statSize":3669,"parsedSize":1429,"gzipSize":311,"inaccurateSizes":true}],"parsedSize":1429,"gzipSize":311,"inaccurateSizes":true},{"label":"getRecommendedProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRecommendedProducts","statSize":133,"groups":[{"id":null,"label":"getRecommendedProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRecommendedProducts/getRecommendedProducts.ts","statSize":133,"parsedSize":51,"gzipSize":11,"inaccurateSizes":true}],"parsedSize":51,"gzipSize":11,"inaccurateSizes":true},{"label":"getRelatedProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRelatedProducts","statSize":125,"groups":[{"id":null,"label":"getRelatedProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getRelatedProducts/getRelatedProducts.ts","statSize":125,"parsedSize":48,"gzipSize":10,"inaccurateSizes":true}],"parsedSize":48,"gzipSize":10,"inaccurateSizes":true},{"label":"getStoreDetails","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getStoreDetails","statSize":3699,"groups":[{"id":null,"label":"getStoreDetails.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/getStoreDetails/getStoreDetails.ts","statSize":3699,"parsedSize":1440,"gzipSize":314,"inaccurateSizes":true}],"parsedSize":1440,"gzipSize":314,"inaccurateSizes":true},{"label":"registerModifiersForm","path":"./src/index.ts + 30 modules (concatenated)/src/lib/registerModifiersForm","statSize":2745,"groups":[{"id":null,"label":"registerModifiersForm.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/registerModifiersForm/registerModifiersForm.ts","statSize":2745,"parsedSize":1069,"gzipSize":233,"inaccurateSizes":true}],"parsedSize":1069,"gzipSize":233,"inaccurateSizes":true},{"label":"validateProduct","path":"./src/index.ts + 30 modules (concatenated)/src/lib/validateProduct","statSize":77,"groups":[{"id":null,"label":"validateProduct.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/validateProduct/validateProduct.ts","statSize":77,"parsedSize":29,"gzipSize":6,"inaccurateSizes":true}],"parsedSize":29,"gzipSize":6,"inaccurateSizes":true},{"label":"initProducts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/initProducts","statSize":1521,"groups":[{"id":null,"label":"initProducts.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/initProducts/initProducts.ts","statSize":1521,"parsedSize":592,"gzipSize":129,"inaccurateSizes":true}],"parsedSize":592,"gzipSize":129,"inaccurateSizes":true},{"id":null,"label":"common.ts","path":"./src/index.ts + 30 modules (concatenated)/src/lib/common.ts","statSize":959,"parsedSize":373,"gzipSize":81,"inaccurateSizes":true}],"parsedSize":6557,"gzipSize":1430,"inaccurateSizes":true},{"label":"services","path":"./src/index.ts + 30 modules (concatenated)/src/services","statSize":8701,"groups":[{"label":"fetchProductDetails","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProductDetails","statSize":2903,"groups":[{"id":null,"label":"fetchProductDetails.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProductDetails/fetchProductDetails.service.tsx","statSize":2903,"parsedSize":1130,"gzipSize":246,"inaccurateSizes":true}],"parsedSize":1130,"gzipSize":246,"inaccurateSizes":true},{"label":"fetchProducts","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProducts","statSize":2897,"groups":[{"id":null,"label":"fetchProducts.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchProducts/fetchProducts.service.tsx","statSize":2897,"parsedSize":1128,"gzipSize":246,"inaccurateSizes":true}],"parsedSize":1128,"gzipSize":246,"inaccurateSizes":true},{"label":"fetchStoreDetails","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchStoreDetails","statSize":2901,"groups":[{"id":null,"label":"fetchStoreDetails.service.tsx","path":"./src/index.ts + 30 modules (concatenated)/src/services/fetchStoreDetails/fetchStoreDetails.service.tsx","statSize":2901,"parsedSize":1129,"gzipSize":246,"inaccurateSizes":true}],"parsedSize":1129,"gzipSize":246,"inaccurateSizes":true}],"parsedSize":3388,"gzipSize":739,"inaccurateSizes":true},{"label":"config","path":"./src/index.ts + 30 modules (concatenated)/src/config","statSize":1588,"groups":[{"id":null,"label":"constants.ts","path":"./src/index.ts + 30 modules (concatenated)/src/config/constants.ts","statSize":1588,"parsedSize":618,"gzipSize":134,"inaccurateSizes":true}],"parsedSize":618,"gzipSize":134,"inaccurateSizes":true},{"label":"errors","path":"./src/index.ts + 30 modules (concatenated)/src/errors","statSize":2429,"groups":[{"id":null,"label":"api.errors.ts","path":"./src/index.ts + 30 modules (concatenated)/src/errors/api.errors.ts","statSize":2429,"parsedSize":946,"gzipSize":206,"inaccurateSizes":true}],"parsedSize":946,"gzipSize":206,"inaccurateSizes":true}],"parsedSize":29466,"gzipSize":6430,"inaccurateSizes":true}]}],"parsedSize":29470,"gzipSize":6431}]},{"label":"vendors.bundle.js","isAsset":true,"statSize":20,"parsedSize":1175,"gzipSize":529,"groups":[{"label":"src","path":"./src","statSize":20,"groups":[{"id":23,"label":"vendors.ts","path":"./src/vendors.ts","statSize":20,"parsedSize":15,"gzipSize":35}],"parsedSize":15,"gzipSize":35}]}]
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { GROUPS as Groups } from "../types/http.types";
|
|
2
|
-
declare const CONSTANTS: {
|
|
3
|
-
CLIENT_NAME: string;
|
|
4
|
-
DEFAULT_REQUEST_TIMEOUT: number;
|
|
5
|
-
EXCLUDED_LOGGER_STATUS_CODES: number[];
|
|
6
|
-
INCLUDED_LOGGER_ENVS: string[];
|
|
7
|
-
INCLUDED_INTL_LOG_ENVS: string[];
|
|
8
|
-
COUNTRY: {
|
|
9
|
-
NAME: string;
|
|
10
|
-
CODE: string;
|
|
11
|
-
LANGUAGE: string;
|
|
12
|
-
};
|
|
13
|
-
DEFAULT_API_TIMEOUT: number;
|
|
14
|
-
HEADERS: string[];
|
|
15
|
-
FILTERS: ("productId" | "vendorId" | "storeId" | "catalogueId" | "categoryId")[];
|
|
16
|
-
GROUPS: Groups[];
|
|
17
|
-
ORDER_FIELDS: string[];
|
|
18
|
-
ORDER_TYPES: ("ALPHABETIC" | "PRICE" | "PREDEFINED" | undefined)[];
|
|
19
|
-
ORDER_SORTS: ("ASC" | "DESC" | undefined)[];
|
|
20
|
-
PAGINATION: string[];
|
|
21
|
-
ADDITIONAL_FILTERS: string[];
|
|
22
|
-
};
|
|
23
|
-
export default CONSTANTS;
|
|
1
|
+
import { GROUPS as Groups } from "../types/http.types";
|
|
2
|
+
declare const CONSTANTS: {
|
|
3
|
+
CLIENT_NAME: string;
|
|
4
|
+
DEFAULT_REQUEST_TIMEOUT: number;
|
|
5
|
+
EXCLUDED_LOGGER_STATUS_CODES: number[];
|
|
6
|
+
INCLUDED_LOGGER_ENVS: string[];
|
|
7
|
+
INCLUDED_INTL_LOG_ENVS: string[];
|
|
8
|
+
COUNTRY: {
|
|
9
|
+
NAME: string;
|
|
10
|
+
CODE: string;
|
|
11
|
+
LANGUAGE: string;
|
|
12
|
+
};
|
|
13
|
+
DEFAULT_API_TIMEOUT: number;
|
|
14
|
+
HEADERS: string[];
|
|
15
|
+
FILTERS: ("productId" | "vendorId" | "storeId" | "catalogueId" | "categoryId")[];
|
|
16
|
+
GROUPS: Groups[];
|
|
17
|
+
ORDER_FIELDS: string[];
|
|
18
|
+
ORDER_TYPES: ("ALPHABETIC" | "PRICE" | "PREDEFINED" | undefined)[];
|
|
19
|
+
ORDER_SORTS: ("ASC" | "DESC" | undefined)[];
|
|
20
|
+
PAGINATION: string[];
|
|
21
|
+
ADDITIONAL_FILTERS: string[];
|
|
22
|
+
};
|
|
23
|
+
export default CONSTANTS;
|