@merkur/plugin-css-scrambler 0.31.0 → 0.33.0

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 CHANGED
@@ -17,8 +17,8 @@ This can be achieved by extending webpack config with provided drop-in function.
17
17
  module.exports = Promise.all([
18
18
  - pipe(createWebConfig, applyBabelLoader)(),
19
19
  + pipe(createWebConfig, applyBabelLoader, applyPostCssScramblePlugin)(),
20
- - pipe(createWebConfig, applyBabelLoader, applyES5Transformation)(),
21
- + pipe(createWebConfig, applyBabelLoader, applyES5Transformation, applyPostCssScramblePlugin)(),
20
+ - pipe(createWebConfig, applyBabelLoader, applyES9Transformation)(),
21
+ + pipe(createWebConfig, applyBabelLoader, applyES9Transformation, applyPostCssScramblePlugin)(),
22
22
  pipe(createNodeConfig, applyBabelLoader)(),
23
23
  ]);
24
24
  ```
@@ -90,4 +90,4 @@ export default function Counter({ counter }) {
90
90
 
91
91
  ## About Merkur
92
92
 
93
- The [Merkur](https://merkur.js.org/) is tiny extensible javascript library for front-end microservices(micro frontends). It allows by default server side rendering for loading performance boost. You can connect it with other frameworks or languages because merkur defines easy API. You can use one of six predefined template's library [React](https://reactjs.org/), [Preact](https://preactjs.com/), [hyperHTML](https://viperhtml.js.org/hyper.html), [µhtml](https://github.com/WebReflection/uhtml#readme), [Svelte](https://svelte.dev/) and [vanilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) but you can easily extend for others.
93
+ The [Merkur](https://merkur.js.org/) is tiny extensible javascript library for front-end microservices(micro frontends). It allows by default server side rendering for loading performance boost. You can connect it with other frameworks or languages because merkur defines easy API. You can use one of six predefined template's library [Preact](https://preactjs.com/), [µhtml](https://github.com/WebReflection/uhtml#readme), [Svelte](https://svelte.dev/) and [vanilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) but you can easily extend for others.
package/lib/index.cjs CHANGED
@@ -1,14 +1,8 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var core = require('@merkur/core');
6
4
  var classnames = require('classnames');
7
5
 
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
11
-
12
6
  const CLASSNAME_CHARS = (
13
7
  'abcdefghijklmnopqrstuvwxyz' +
14
8
  'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
@@ -64,7 +58,7 @@ function scramblerFactory(hashingTable) {
64
58
  }
65
59
 
66
60
  return (widget, ...args) => {
67
- const classNamesSource = classnames__default["default"](...args);
61
+ const classNamesSource = classnames(...args);
68
62
  if (!hashingTable) {
69
63
  return {
70
64
  className: classNamesSource,
@@ -82,7 +76,7 @@ function scramblerFactory(hashingTable) {
82
76
  }
83
77
 
84
78
  return `${prefixTable.get(prefix)}_${mainPartTable.get(
85
- mainPart
79
+ mainPart,
86
80
  )}_${uniqueHash}`;
87
81
  })
88
82
  .join(' ');
package/lib/index.es9.cjs CHANGED
@@ -1,16 +1,7 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- });
6
3
  var core = require('@merkur/core');
7
4
  var classnames = require('classnames');
8
- function _interopDefaultLegacy(e) {
9
- return e && typeof e === 'object' && 'default' in e ? e : {
10
- 'default': e
11
- };
12
- }
13
- var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
14
5
  const CLASSNAME_CHARS = ('abcdefghijklmnopqrstuvwxyz' + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + '-').split('');
15
6
  const EXTENDED_CLASSNAME_CHARS = (CLASSNAME_CHARS.join('') + '0123456789').split('');
16
7
  function numberToCssClass(number) {
@@ -52,7 +43,7 @@ function scramblerFactory(hashingTable) {
52
43
  }
53
44
  }
54
45
  return (widget, ...args) => {
55
- const classNamesSource = classnames__default["default"](...args);
46
+ const classNamesSource = classnames(...args);
56
47
  if (!hashingTable) {
57
48
  return {
58
49
  className: classNamesSource
package/lib/index.js CHANGED
@@ -1,14 +1,8 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var core = require('@merkur/core');
6
4
  var classnames = require('classnames');
7
5
 
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
11
-
12
6
  const CLASSNAME_CHARS = (
13
7
  'abcdefghijklmnopqrstuvwxyz' +
14
8
  'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +
@@ -64,7 +58,7 @@ function scramblerFactory(hashingTable) {
64
58
  }
65
59
 
66
60
  return (widget, ...args) => {
67
- const classNamesSource = classnames__default["default"](...args);
61
+ const classNamesSource = classnames(...args);
68
62
  if (!hashingTable) {
69
63
  return {
70
64
  className: classNamesSource,
@@ -82,7 +76,7 @@ function scramblerFactory(hashingTable) {
82
76
  }
83
77
 
84
78
  return `${prefixTable.get(prefix)}_${mainPartTable.get(
85
- mainPart
79
+ mainPart,
86
80
  )}_${uniqueHash}`;
87
81
  })
88
82
  .join(' ');
package/lib/index.mjs CHANGED
@@ -74,7 +74,7 @@ function scramblerFactory(hashingTable) {
74
74
  }
75
75
 
76
76
  return `${prefixTable.get(prefix)}_${mainPartTable.get(
77
- mainPart
77
+ mainPart,
78
78
  )}_${uniqueHash}`;
79
79
  })
80
80
  .join(' ');
package/lib/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,r){if("function"==typeof define&&define.amd)define("@merkur/plugin-css-scrambler",["exports","@merkur/core","classnames"],r);else if("undefined"!=typeof exports)r(exports,require("@merkur/core"),require("classnames"));else{var t={exports:{}};r(t.exports,e.Merkur.Core,e.classnames),e.Merkur=e.Merkur||{},e.Merkur.Plugin=e.Merkur.Plugin||{},e.Merkur.Plugin.Cssscrambler=t.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(e,r,t){var n;function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){u(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function u(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(e,r,t,n,o,a,u){try{var i=e[a](u),l=i.value}catch(e){return void t(e)}i.done?r(l):Promise.resolve(l).then(n,o)}function l(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function u(e){i(a,n,o,u,l,"next",e)}function l(e){i(a,n,o,u,l,"throw",e)}u(void 0)}))}}function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.cssScramblePlugin=function(){return{setup:function(e,r){return l((function*(){var n=r.classnameHashtable;return e.$in.classNameScrambler=function(e){var r,n,o,a=e&&new Map,u=e&&new Map;if(e){var i=function(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,o,a=[],u=!0,i=!1;try{for(t=t.call(e);!(u=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);u=!0);}catch(e){i=!0,o=e}finally{try{u||null==t.return||t.return()}finally{if(i)throw o}}return a}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return c(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,3);r=i[0],n=i[1],o=i[2];for(var l=0;l<n.length;l++)a.set(n[l],p(l));for(var s=0;s<o.length;s++)u.set(o[s],p(s))}return function(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),l=1;l<o;l++)i[l-1]=arguments[l];var c=t.default.apply(void 0,i);return e?{className:c.split(/\s+/).map((function(e){var t=e.split("-"),n=t[0],o=t.slice(1).join("-");return a.has(n)&&u.has(o)?"".concat(a.get(n),"_").concat(u.get(o),"_").concat(r):e})).join(" "),"data-class":c}:{className:c}}}(n),e.cn=function(){var r;return(r=e.$in).classNameScrambler.apply(r,arguments).className},e}))()},create:function(e){return l((function*(){return(0,r.hookMethod)(e,"info",y),e}))()}}},e.numberToCssClass=p,t=(n=t)&&n.__esModule?n:{default:n};var s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-".split(""),f=(s.join("")+"0123456789").split("");function p(e){if(e<s.length)return s[e];e+=f.length-s.length;for(var r="";e>=s.length;)r=f[e%f.length]+r,e=Math.floor(e/f.length);return r=e?s[e-1]+r:"_"+r}function y(e,r){return h.apply(this,arguments)}function h(){return h=l((function*(e,r){for(var t=arguments.length,n=new Array(t>2?t-2:0),o=2;o<t;o++)n[o-2]=arguments[o];var u=yield r.apply(void 0,n);return a({classnameHashtable:e.classnameHashtable},u)})),h.apply(this,arguments)}}));
1
+ function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},r(e)}!function(r,e){if("function"==typeof define&&define.amd)define("@merkur/plugin-css-scrambler",["exports","@merkur/core","classnames"],e);else if("undefined"!=typeof exports)e(exports,require("@merkur/core"),require("classnames"));else{var t={exports:{}};e(t.exports,r.Merkur.Core,r.classnames),r.Merkur=r.Merkur||{},r.Merkur.Plugin=r.Merkur.Plugin||{},r.Merkur.Plugin.Cssscrambler=t.exports}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(e,t,n){var o;function i(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(r,e,t,n,o,i,u){try{var a=r[i](u),l=a.value}catch(r){return void t(r)}a.done?e(l):Promise.resolve(l).then(n,o)}function l(r){return function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function u(r){a(i,n,o,u,l,"next",r)}function l(r){a(i,n,o,u,l,"throw",r)}u(void 0)}))}}function c(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}Object.defineProperty(e,"__esModule",{value:!0}),e.cssScramblePlugin=function(){return{setup:function(r,e){return l((function*(){var t=e.classnameHashtable;return r.$in.classNameScrambler=function(r){var e,t,o,i=r&&new Map,u=r&&new Map;if(r){var a=function(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,o,i,u,a=[],l=!0,c=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=i.call(t)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(r){c=!0,o=r}finally{try{if(!l&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(r,e)||function(r,e){if(!r)return;if("string"==typeof r)return c(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);"Object"===t&&r.constructor&&(t=r.constructor.name);if("Map"===t||"Set"===t)return Array.from(r);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(r,e)}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r,3);e=a[0],t=a[1],o=a[2];for(var l=0;l<t.length;l++)i.set(t[l],p(l));for(var s=0;s<o.length;s++)u.set(o[s],p(s))}return function(t){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];var c=n.default.apply(void 0,a);return r?{className:c.split(/\s+/).map((function(r){var t=r.split("-"),n=t[0],o=t.slice(1).join("-");return i.has(n)&&u.has(o)?"".concat(i.get(n),"_").concat(u.get(o),"_").concat(e):r})).join(" "),"data-class":c}:{className:c}}}(t),r.cn=function(){var e;return(e=r.$in).classNameScrambler.apply(e,arguments).className},r}))()},create:function(r){return l((function*(){return(0,t.hookMethod)(r,"info",y),r}))()}}},e.numberToCssClass=p,n=(o=n)&&o.__esModule?o:{default:o};var s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-".split(""),f=(s.join("")+"0123456789").split("");function p(r){if(r<s.length)return s[r];r+=f.length-s.length;for(var e="";r>=s.length;)e=f[r%f.length]+e,r=Math.floor(r/f.length);return e=r?s[r-1]+e:"_"+e}function y(r,e){return b.apply(this,arguments)}function b(){return b=l((function*(r,e){for(var t=arguments.length,n=new Array(t>2?t-2:0),o=2;o<t;o++)n[o-2]=arguments[o];var a=yield e.apply(void 0,n);return function(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?i(Object(t),!0).forEach((function(e){u(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}({classnameHashtable:r.classnameHashtable},a)})),b.apply(this,arguments)}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkur/plugin-css-scrambler",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "description": "Merkur plugin for scrambling CSS classes.",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",
@@ -21,16 +21,16 @@
21
21
  "./server/index.js": "./server/index.js"
22
22
  },
23
23
  "browser": {
24
- "./lib/index.js": "./lib/index.es5.js",
25
- "./lib/index.cjs": "./lib/index.es5.js",
24
+ "./lib/index.js": "./lib/index.js",
25
+ "./lib/index.cjs": "./lib/index.cjs",
26
26
  "./lib/index.mjs": "./lib/index.mjs",
27
27
  "./lib/index.es9.mjs": "./lib/index.es9.mjs"
28
28
  },
29
29
  "scripts": {
30
30
  "preversion": "npm test",
31
- "test": "../../node_modules/.bin/jest --no-watchman -c ./jest.config.js",
32
- "test:es:version": "../../node_modules/.bin/es-check es5 ./lib/index.es5.js && ../../node_modules/.bin/es-check es11 ./lib/index.mjs --module && ../../node_modules/.bin/es-check es9 ./lib/index.es9.mjs --module && ../../node_modules/.bin/es-check es9 ./lib/index.es9.cjs --module",
33
- "build": "node_modules/.bin/rollup -c",
31
+ "test": "jest --no-watchman -c ./jest.config.js",
32
+ "test:es:version": "es-check es11 ./lib/index.mjs --module && es-check es9 ./lib/index.es9.mjs --module && es-check es9 ./lib/index.es9.cjs --module",
33
+ "build": "rollup -c rollup.config.mjs",
34
34
  "prepare": "npm run build"
35
35
  },
36
36
  "repository": {
@@ -54,17 +54,16 @@
54
54
  },
55
55
  "homepage": "https://merkur.js.org/",
56
56
  "devDependencies": {
57
- "@merkur/core": "^0.23.12",
58
- "rollup": "^2.70.2"
57
+ "@merkur/core": "^0.23.12"
59
58
  },
60
59
  "peerDependencies": {
61
60
  "@merkur/core": "*",
62
- "postcss": "^8.4.12",
63
- "postcss-loader": "^6.2.1"
61
+ "postcss": "^8.4.23",
62
+ "postcss-loader": "^7.3.0"
64
63
  },
65
64
  "dependencies": {
66
- "classnames": "^2.3.1",
67
- "postcss-selector-parser": "^6.0.10"
65
+ "classnames": "^2.3.2",
66
+ "postcss-selector-parser": "^6.0.12"
68
67
  },
69
- "gitHead": "ef1b38f23e43e2fd7ef6a2bec680fb40a2de3715"
68
+ "gitHead": "3e88b57abfad267ac3f3b20b2ae6bf50f93f5375"
70
69
  }
package/postcss/index.js CHANGED
@@ -24,7 +24,7 @@ function postCssScrambler(options) {
24
24
  fs.writeFileSync(options.hashTable, JSON.stringify(tableData));
25
25
  } else {
26
26
  [prefixesTable, mainPartsTable] = JSON.parse(
27
- fs.readFileSync(options.hashTable)
27
+ fs.readFileSync(options.hashTable),
28
28
  );
29
29
  }
30
30
 
@@ -45,7 +45,7 @@ function postCssScrambler(options) {
45
45
  const mainPartIndex = mainPartsTable.indexOf(mainPart);
46
46
  if (prefixIndex === -1 || mainPartIndex === -1) {
47
47
  throw new Error(
48
- `The ${className} CSS class in not in the hash table`
48
+ `The ${className} CSS class in not in the hash table`,
49
49
  );
50
50
  }
51
51
 
@@ -124,7 +124,7 @@ function applyPostCssScramblePlugin(options) {
124
124
  generateHashTable: true,
125
125
  hashTable: path.resolve(
126
126
  process.env.WIDGET_DIRNAME,
127
- './build/static/hashtable.json'
127
+ './build/static/hashtable.json',
128
128
  ),
129
129
  ...options,
130
130
  });
@@ -137,7 +137,7 @@ function applyPostCssScramblePlugin(options) {
137
137
 
138
138
  const postCssUseEntryIndex = rule.use.findIndex(
139
139
  (useEntry) =>
140
- useEntry === 'postcss-loader' || useEntry.loader === 'postcss-loader'
140
+ useEntry === 'postcss-loader' || useEntry.loader === 'postcss-loader',
141
141
  );
142
142
 
143
143
  if (~postCssUseEntryIndex) {
@@ -173,7 +173,7 @@ function applyPostCssScramblePlugin(options) {
173
173
 
174
174
  // add postcss loader to rule matching css files
175
175
  const cssRuleIndex = config.module.rules.findIndex((rule) =>
176
- rule.test.test('.css')
176
+ rule.test.test('.css'),
177
177
  );
178
178
 
179
179
  if (~cssRuleIndex) {
@@ -0,0 +1,11 @@
1
+ import {
2
+ createRollupESConfig,
3
+ createRollupES9Config,
4
+ createRollupUMDConfig,
5
+ } from '../../createRollupConfig.mjs';
6
+
7
+ let esConfig = createRollupESConfig();
8
+ let es9Config = createRollupES9Config();
9
+ let umdConfig = createRollupUMDConfig();
10
+
11
+ export default [esConfig, es9Config, umdConfig];
package/lib/index.es5.js DELETED
@@ -1 +0,0 @@
1
- "use strict";function e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function r(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){t(r,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function t(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return e};var e={},r=Object.prototype,t=r.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{l({},"")}catch(e){l=function(e,r,t){return e[r]=t}}function f(e,r,t,n){var i=r&&r.prototype instanceof y?r:y,a=Object.create(i.prototype),s=new S(n||[]);return o(a,"_invoke",{value:q(e,t,s)}),a}function h(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var p={};function y(){}function d(){}function m(){}var v={};l(v,a,(function(){return this}));var j=Object.getPrototypeOf,g=j&&j(j(P([])));g&&g!==r&&t.call(g,a)&&(v=g);var b=m.prototype=y.prototype=Object.create(v);function w(e){["next","throw","return"].forEach((function(r){l(e,r,(function(e){return this._invoke(r,e)}))}))}function x(e,r){function n(o,i,a,s){var c=h(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==u(f)&&t.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):r.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,o){n(e,t,r,o)}))}return i=i?i.then(o,o):o()}})}function q(e,r,t){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(t.method=o,t.arg=i;;){var a=t.delegate;if(a){var s=O(a,t);if(s){if(s===p)continue;return s}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if("suspendedStart"===n)throw n="completed",t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);n="executing";var u=h(e,r,t);if("normal"===u.type){if(n=t.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:t.done}}"throw"===u.type&&(n="completed",t.method="throw",t.arg=u.arg)}}}function O(e,r){var t=e.iterator[r.method];if(void 0===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=void 0,O(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=h(t,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,p;var o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function L(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function E(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function P(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function r(){for(;++n<e.length;)if(t.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return o.next=o}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=m,o(b,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:d,configurable:!0}),d.displayName=l(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===d||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(x.prototype),l(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(r,t,n,o,i){void 0===i&&(i=Promise);var a=new x(f(r,t,n,o),i);return e.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),l(b,c,"Generator"),l(b,a,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=P,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&t.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t,n){return a.type="throw",a.arg=e,r.next=t,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=t.call(i,"catchLoc"),u=t.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&t.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),E(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;E(t)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,t){return this.delegate={iterator:P(e),resultName:r,nextLoc:t},"next"===this.method&&(this.arg=void 0),p}},e}function o(e,r,t,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void t(e)}s.done?r(u):Promise.resolve(u).then(n,o)}function i(e){return function(){var r=this,t=arguments;return new Promise((function(n,i){var a=e.apply(r,t);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)}))}}function a(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,o,i=[],a=!0,s=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(s)throw o}}return i}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return s(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}require("core-js/modules/es.object.define-property.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.map.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.split.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.iterator.js"),require("core-js/modules/es.array.is-array.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.symbol.async-iterator.js"),require("core-js/modules/es.symbol.to-string-tag.js"),require("core-js/modules/es.json.to-string-tag.js"),require("core-js/modules/es.math.to-string-tag.js"),require("core-js/modules/es.object.create.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/es.array.for-each.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.reverse.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/es.object.get-own-property-descriptors.js"),require("core-js/modules/es.object.define-properties.js"),Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@merkur/core");function l(e){return e&&"object"===u(e)&&"default"in e?e:{default:e}}var f=l(require("classnames")),h="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-".split(""),p=(h.join("")+"0123456789").split("");function y(e){if(e<h.length)return h[e];e+=p.length-h.length;for(var r="";e>=h.length;)r=p[e%p.length]+r,e=Math.floor(e/p.length);return r=e?h[e-1]+r:"_"+r}function d(e){var r,t,n,o=e&&new Map,i=e&&new Map;if(e){var s=a(e,3);r=s[0],t=s[1],n=s[2];for(var u=0;u<t.length;u++)o.set(t[u],y(u));for(var c=0;c<n.length;c++)i.set(n[c],y(c))}return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),s=1;s<n;s++)a[s-1]=arguments[s];var u=f.default.apply(f,a);if(!e)return{className:u};var c=u.split(/\s+/).map((function(e){var t=e.split("-"),n=t[0],a=t.slice(1).join("-");return o.has(n)&&i.has(a)?"".concat(o.get(n),"_").concat(i.get(a),"_").concat(r):e})).join(" ");return{className:c,"data-class":u}}}function m(e,r){return v.apply(this,arguments)}function v(){return v=i(n().mark((function e(t,o){var i,a,s,u,c=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(i=c.length,a=new Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=c[s];return e.next=3,o.apply(void 0,a);case 3:return u=e.sent,e.abrupt("return",r({classnameHashtable:t.classnameHashtable},u));case 5:case"end":return e.stop()}}),e)}))),v.apply(this,arguments)}exports.cssScramblePlugin=function(){return{setup:function(e,r){return i(n().mark((function t(){var o;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=r.classnameHashtable,e.$in.classNameScrambler=d(o),e.cn=function(){var r;return(r=e.$in).classNameScrambler.apply(r,arguments).className},t.abrupt("return",e);case 4:case"end":return t.stop()}}),t)})))()},create:function(e){return i(n().mark((function r(){return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return c.hookMethod(e,"info",m),r.abrupt("return",e);case 2:case"end":return r.stop()}}),r)})))()}}},exports.numberToCssClass=y;