website-utilities 1.0.455 → 1.0.456

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/deploy.js CHANGED
@@ -1,2 +1,228 @@
1
1
  #!/usr/bin/env node
2
- "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}(()=>{var e,r,i,o,t,a=[(e,r,i)=>{i.a(e,(async(e,o)=>{try{i.r(r),i.d(r,{PUBLIC_REPOSITORY_PATH:()=>e,log:()=>s});var t=i(1),a=i(2),n=i(3),l=i(4);const e=process.env.PUBLIC_REPOSITORY_PATH||(0,n.resolve)("../",`${process.env.GIT_PRIVATE_AUTHOR_NAME||""}.github.io`),s=new t.Logger({name:"website-utilities.deploy",level:"info"}),u=(e,r={})=>(0,a.execSync)(e,{encoding:"utf-8",shell:"/bin/bash",...r});if(!await(0,t.isFile)((0,n.resolve)(e,"CNAME")))throw new Error(`Missing public website directory in "${e}"`);process.env.USER_NAME_GITHUB&&(s.info(`Set git user name to "${process.env.USER_NAME_GITHUB}".`),s.info(u(`git config user.name '${process.env.USER_NAME_GITHUB}'`,{cwd:e}))),process.env.USER_EMAIL_GITHUB&&(s.info(`Set git user email to "${process.env.USER_EMAIL_GITHUB}".`),s.info(u(`git config user.email '${process.env.USER_EMAIL_GITHUB}'`,{cwd:e}))),s.info("Pull latest public website state."),s.info(u("git pull",{cwd:e})),s.info("Build new web page."),s.info(u("yarn clear")),s.info(u("yarn build")),s.info(`Update page data in "${e}".`),await(0,l.rimraf)(e,{filter:r=>Promise.resolve(![e,(0,n.resolve)(e,".git"),(0,n.resolve)(e,".github"),(0,n.resolve)(e,"CNAME"),(0,n.resolve)(e,"readme.md"),(0,n.resolve)(e,"public-repository")].some((e=>r.startsWith(e))))}),await(0,t.copyDirectoryRecursive)("build",e,!0),s.info(u("yarn clear")),s.info("Upload newly build webpage"),s.info(u("git commit --all --message 'Automatic page build update.'",{cwd:e})),s.info(u("git push",{cwd:e})),o()}catch(e){o(e)}}),1)},e=>{e.exports=require("clientnode")},e=>{e.exports=require("child_process")},e=>{e.exports=require("path")},e=>{e.exports=require("rimraf")}],n={};function l(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return a[e](i,i.exports,l),i.exports}e="function"==typeof Symbol,r=e?Symbol("webpack queues"):"__webpack_queues__",i=e?Symbol("webpack exports"):"__webpack_exports__",o=e?Symbol("webpack error"):"__webpack_error__",t=e=>{e&&e.d<1&&(e.d=1,e.forEach((e=>e.r--)),e.forEach((e=>e.r--?e.r++:e())))},l.a=(e,a,n)=>{var l;n&&((l=[]).d=-1);var s,u,p,d=new Set,c=e.exports,f=new Promise(((e,r)=>{p=r,u=e}));f[i]=c,f[r]=e=>(l&&e(l),d.forEach(e),f.catch((e=>{}))),e.exports=f,a((e=>{var a;s=(e=>e.map((e=>{if(null!==e&&"object"==typeof e){if(e[r])return e;if(e.then){var a=[];a.d=0,e.then((e=>{n[i]=e,t(a)}),(e=>{n[o]=e,t(a)}));var n={};return n[r]=e=>e(a),n}}var l={};return l[r]=e=>{},l[i]=e,l})))(e);var n=()=>s.map((e=>{if(e[o])throw e[o];return e[i]})),u=new Promise((e=>{(a=()=>e(n)).r=0;var i=e=>e!==l&&!d.has(e)&&(d.add(e),e&&!e.d&&(a.r++,e.push(a)));s.map((e=>e[r](i)))}));return a.r?u:n()}),(e=>(e?p(f[o]=e):u(c),t(l)))),l&&l.d<0&&(l.d=0)},l.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return l.d(r,{a:r}),r},l.d=(e,r)=>{for(var i in r)l.o(r,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},l.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s=l(0);module.exports=s})();
2
+ // -*- coding: utf-8 -*-
3
+ import * as __WEBPACK_EXTERNAL_MODULE_child_process__ from "child_process";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_clientnode__ from "clientnode";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_rimraf__ from "rimraf";
7
+ /******/ var __webpack_modules__ = ([
8
+ /* 0 */
9
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
10
+
11
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
12
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
13
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
14
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
15
+ /* harmony import */ var rimraf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
16
+ // #!/usr/bin/env babel-node
17
+ // -*- coding: utf-8 -*-
18
+ /** @module deploy *//* !
19
+ region header
20
+ [Project page](https://torben.website/website-utilities)
21
+
22
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
23
+
24
+ License
25
+ -------
26
+
27
+ This library written by Torben Sickert stands under a creative commons
28
+ naming 3.0 unported license.
29
+ See https://creativecommons.org/licenses/by/3.0/deed.de
30
+ endregion
31
+ */// region imports
32
+ // endregion
33
+ const PUBLIC_REPOSITORY_PATH=process.env.PUBLIC_REPOSITORY_PATH||(0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)("../",`${process.env.GIT_PRIVATE_AUTHOR_NAME||""}.github.io`);const log=new clientnode__WEBPACK_IMPORTED_MODULE_0__.Logger({name:"website-utilities.deploy",level:"info"});const run=(command,options={})=>(0,child_process__WEBPACK_IMPORTED_MODULE_1__.execSync)(command,{encoding:"utf-8",shell:"/bin/bash",...options});if(!(await (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isFile)((0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)(PUBLIC_REPOSITORY_PATH,"CNAME"))))throw new Error(`Missing public website directory in "${PUBLIC_REPOSITORY_PATH}"`);if(process.env.USER_NAME_GITHUB){log.info(`Set git user name to "${process.env.USER_NAME_GITHUB}".`);log.info(run(`git config user.name '${process.env.USER_NAME_GITHUB}'`,{cwd:PUBLIC_REPOSITORY_PATH}))}if(process.env.USER_EMAIL_GITHUB){log.info(`Set git user email to "${process.env.USER_EMAIL_GITHUB}".`);log.info(run(`git config user.email '${process.env.USER_EMAIL_GITHUB}'`,{cwd:PUBLIC_REPOSITORY_PATH}))}log.info("Pull latest public website state.");log.info(run("git pull",{cwd:PUBLIC_REPOSITORY_PATH}));log.info("Build new web page.");log.info(run("yarn clear"));log.info(run("yarn build"));log.info(`Update page data in "${PUBLIC_REPOSITORY_PATH}".`);await (0,rimraf__WEBPACK_IMPORTED_MODULE_3__.rimraf)(PUBLIC_REPOSITORY_PATH,{filter:path=>Promise.resolve(![PUBLIC_REPOSITORY_PATH,(0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)(PUBLIC_REPOSITORY_PATH,".git"),(0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)(PUBLIC_REPOSITORY_PATH,".github"),(0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)(PUBLIC_REPOSITORY_PATH,"CNAME"),(0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)(PUBLIC_REPOSITORY_PATH,"readme.md"),(0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)(PUBLIC_REPOSITORY_PATH,"public-repository")].some(ignorePath=>path.startsWith(ignorePath)))});await (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.copyDirectoryRecursive)("build",PUBLIC_REPOSITORY_PATH,true);log.info(run("yarn clear"));log.info("Upload newly build webpage");log.info(run(`git commit --all --message 'Automatic page build update.'`,{cwd:PUBLIC_REPOSITORY_PATH}));log.info(run("git push",{cwd:PUBLIC_REPOSITORY_PATH}));
34
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, [
35
+ /* harmony export */ "R", 0, /* binding */ log,
36
+ /* harmony export */ "v", 0, /* binding */ PUBLIC_REPOSITORY_PATH
37
+ /* harmony export */ ]);
38
+
39
+ __webpack_async_result__();
40
+ } catch(e) { __webpack_async_result__(e); } }, 1);
41
+
42
+ /***/ }),
43
+ /* 1 */
44
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
45
+
46
+ const x = (y) => {
47
+ const x = {}; __webpack_require__.d(x, y); return x
48
+ }
49
+ const y = (x) => (() => (x))
50
+ module.exports = x({ ["Logger"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.Logger), ["copyDirectoryRecursive"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.copyDirectoryRecursive), ["isFile"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isFile) });
51
+
52
+ /***/ }),
53
+ /* 2 */
54
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
55
+
56
+ const x = (y) => {
57
+ const x = {}; __webpack_require__.d(x, y); return x
58
+ }
59
+ const y = (x) => (() => (x))
60
+ module.exports = x({ ["execSync"]: () => (__WEBPACK_EXTERNAL_MODULE_child_process__.execSync) });
61
+
62
+ /***/ }),
63
+ /* 3 */
64
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
65
+
66
+ const x = (y) => {
67
+ const x = {}; __webpack_require__.d(x, y); return x
68
+ }
69
+ const y = (x) => (() => (x))
70
+ module.exports = x({ ["resolve"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.resolve) });
71
+
72
+ /***/ }),
73
+ /* 4 */
74
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
75
+
76
+ const x = (y) => {
77
+ const x = {}; __webpack_require__.d(x, y); return x
78
+ }
79
+ const y = (x) => (() => (x))
80
+ module.exports = x({ ["rimraf"]: () => (__WEBPACK_EXTERNAL_MODULE_rimraf__.rimraf) });
81
+
82
+ /***/ })
83
+ /******/ ]);
84
+ /************************************************************************/
85
+ /******/ // The module cache
86
+ /******/ const __webpack_module_cache__ = {};
87
+ /******/
88
+ /******/ // The require function
89
+ /******/ function __webpack_require__(moduleId) {
90
+ /******/ // Check if module is in cache
91
+ /******/ const cachedModule = __webpack_module_cache__[moduleId];
92
+ /******/ if (cachedModule !== undefined) {
93
+ /******/ return cachedModule.exports;
94
+ /******/ }
95
+ /******/ // Create a new module (and put it into the cache)
96
+ /******/ const module = __webpack_module_cache__[moduleId] = {
97
+ /******/ // no module.id needed
98
+ /******/ // no module.loaded needed
99
+ /******/ exports: {}
100
+ /******/ };
101
+ /******/
102
+ /******/ // Execute the module function
103
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
104
+ /******/
105
+ /******/ // Return the exports of the module
106
+ /******/ return module.exports;
107
+ /******/ }
108
+ /******/
109
+ /************************************************************************/
110
+ /******/ /* webpack/runtime/async module */
111
+ /******/ (() => {
112
+ /******/ const webpackQueues = Symbol("webpack queues");
113
+ /******/ const webpackExports = Symbol("webpack exports");
114
+ /******/ const webpackError = Symbol("webpack error");
115
+ /******/
116
+ /******/ const resolveQueue = (queue) => {
117
+ /******/ if(queue?.d < 1) {
118
+ /******/ queue.d = 1;
119
+ /******/ queue.forEach((fn) => (fn.r--));
120
+ /******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
121
+ /******/ }
122
+ /******/ }
123
+ /******/ const wrapDeps = (deps) => (deps.map((dep) => {
124
+ /******/ if(dep !== null && typeof dep === "object") {
125
+ /******/
126
+ /******/ if(dep[webpackQueues]) return dep;
127
+ /******/ if(dep.then) {
128
+ /******/ const queue = [];
129
+ /******/ queue.d = 0;
130
+ /******/ dep.then((r) => {
131
+ /******/ obj[webpackExports] = r;
132
+ /******/ resolveQueue(queue);
133
+ /******/ }, (e) => {
134
+ /******/ obj[webpackError] = e;
135
+ /******/ resolveQueue(queue);
136
+ /******/ });
137
+ /******/ const obj = {};
138
+ /******/
139
+ /******/ obj[webpackQueues] = (fn) => (fn(queue));
140
+ /******/ return obj;
141
+ /******/ }
142
+ /******/ }
143
+ /******/ const ret = {};
144
+ /******/ ret[webpackQueues] = x => {};
145
+ /******/ ret[webpackExports] = dep;
146
+ /******/ return ret;
147
+ /******/ }));
148
+ /******/ __webpack_require__.a = (module, body, hasAwait) => {
149
+ /******/ let queue;
150
+ /******/ hasAwait && ((queue = []).d = -1);
151
+ /******/ const depQueues = new Set();
152
+ /******/ const exports = module.exports;
153
+ /******/ let currentDeps;
154
+ /******/ let outerResolve;
155
+ /******/ let reject;
156
+ /******/ const promise = new Promise((resolve, rej) => {
157
+ /******/ reject = rej;
158
+ /******/ outerResolve = resolve;
159
+ /******/ });
160
+ /******/ promise[webpackExports] = exports;
161
+ /******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
162
+ /******/ module.exports = promise;
163
+ /******/ const handle = (deps) => {
164
+ /******/ currentDeps = wrapDeps(deps);
165
+ /******/ let fn;
166
+ /******/ const getResult = () => (currentDeps.map((d) => {
167
+ /******/
168
+ /******/ if(d[webpackError]) throw d[webpackError];
169
+ /******/ return d[webpackExports];
170
+ /******/ }))
171
+ /******/ const promise = new Promise((resolve) => {
172
+ /******/ fn = () => (resolve(getResult));
173
+ /******/ fn.r = 0;
174
+ /******/ const fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
175
+ /******/ currentDeps.forEach((dep) => (dep[webpackQueues](fnQueue)));
176
+ /******/ });
177
+ /******/ return fn.r ? promise : getResult();
178
+ /******/ }
179
+ /******/ const done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
180
+ /******/
181
+ /******/ body(handle, done);
182
+ /******/ queue?.d < 0 && (queue.d = 0);
183
+ /******/ };
184
+ /******/ })();
185
+ /******/
186
+ /******/ /* webpack/runtime/define property getters */
187
+ /******/ (() => {
188
+ /******/ // define getter/value functions for harmony exports
189
+ /******/ __webpack_require__.d = (exports, definition) => {
190
+ /******/ if(Array.isArray(definition)) {
191
+ /******/ var i = 0;
192
+ /******/ while(i < definition.length) {
193
+ /******/ var key = definition[i++];
194
+ /******/ var binding = definition[i++];
195
+ /******/ if(!__webpack_require__.o(exports, key)) {
196
+ /******/ if(binding === 0) {
197
+ /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
198
+ /******/ } else {
199
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
200
+ /******/ }
201
+ /******/ } else if(binding === 0) { i++; }
202
+ /******/ }
203
+ /******/ } else {
204
+ /******/ for(var key in definition) {
205
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
206
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
207
+ /******/ }
208
+ /******/ }
209
+ /******/ }
210
+ /******/ };
211
+ /******/ })();
212
+ /******/
213
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
214
+ /******/ (() => {
215
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
216
+ /******/ })();
217
+ /******/
218
+ /************************************************************************/
219
+ /******/
220
+ /******/ // startup
221
+ /******/ // Load entry module and return exports
222
+ /******/ // This entry module used 'module' so it can't be inlined
223
+ /******/ let __webpack_exports__ = __webpack_require__(0);
224
+ /******/ __webpack_exports__ = await __webpack_exports__;
225
+ /******/ const __webpack_exports__PUBLIC_REPOSITORY_PATH = __webpack_exports__.v;
226
+ /******/ const __webpack_exports__log = __webpack_exports__.R;
227
+ /******/ export { __webpack_exports__PUBLIC_REPOSITORY_PATH as PUBLIC_REPOSITORY_PATH, __webpack_exports__log as log };
228
+ /******/
@@ -1 +1 @@
1
- @font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-light.woff2?md5=ded2efe0682deca1e711) format("woff2"),url(fonts.compiled/open-sans-light.woff?md5=5f5617ab2d7f7ae9d8a5) format("woff");font-weight:300;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-light-italic.woff2?md5=2c80dd810ca80ed7441f) format("woff2"),url(fonts.compiled/open-sans-light-italic.woff?md5=c246bd09361a014795ae) format("woff");font-weight:300;font-style:italic}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-regular.woff2?md5=6399f5b3b46842462174) format("woff2"),url(fonts.compiled/open-sans-regular.woff?md5=d02e6dd3b1bbbc101343) format("woff");font-weight:400;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-italic.woff2?md5=473eeb886be6660b9a86) format("woff2"),url(fonts.compiled/open-sans-italic.woff?md5=d78071284e62fcd478af) format("woff");font-weight:400;font-style:italic}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-semi-bold.woff2?md5=ae33326b599cfd071cfc) format("woff2"),url(fonts.compiled/open-sans-semi-bold.woff?md5=f90df377945fccdef88f) format("woff");font-weight:600;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-semi-bold-italic.woff2?md5=0f73259fcbe5b12157ce) format("woff2"),url(fonts.compiled/open-sans-semi-bold-italic.woff?md5=1e25c8a28fdf9a87ff38) format("woff");font-weight:600;font-style:italic}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-bold.woff2?md5=50cc1a94a36420ff2bcd) format("woff2"),url(fonts.compiled/open-sans-bold.woff?md5=40084899144c3b75bcdd) format("woff");font-weight:700;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-bold-italic.woff2?md5=89b1196ae05d10f50fbc) format("woff2"),url(fonts.compiled/open-sans-bold-italic.woff?md5=41c0cadf1dd0548086ae) format("woff");font-weight:700;font-style:italic}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-extra-bold.woff2?md5=6ef03d4820d032580837) format("woff2"),url(fonts.compiled/open-sans-extra-bold.woff?md5=e640a97717802cc57574) format("woff");font-weight:800;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-extra-bold-italic.woff2?md5=b3979a57edfd488799d4) format("woff2"),url(fonts.compiled/open-sans-extra-bold-italic.woff?md5=adb47ef059f0de41b7d4) format("woff");font-weight:800;font-style:italic}@font-face{font-family:open-sans-condensed;src:url(fonts.compiled/open-sans-condensed-bold.woff2?md5=317baafbc9215400181a) format("woff2"),url(fonts.compiled/open-sans-condensed-bold.woff?md5=c8139621e15d27cd8855) format("woff");font-weight:700;font-style:normal}@font-face{font-family:open-sans-condensed;src:url(fonts.compiled/open-sans-condensed-light.woff2?md5=f517762310d125f06126) format("woff2"),url(fonts.compiled/open-sans-condensed-light.woff?md5=607164d33679b5de46cf) format("woff");font-weight:300;font-style:normal}@font-face{font-family:open-sans-condensed;src:url(fonts.compiled/open-sans-condensed-light-italic.woff2?md5=796dc8ebbf7a438a6764) format("woff2"),url(fonts.compiled/open-sans-condensed-light-italic.woff?md5=f3677299a479a3de0867) format("woff");font-weight:300;font-style:italic}
1
+ @font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-light.woff2?md5=ded2efe0682deca1) format("woff2"),url(fonts.compiled/open-sans-light.woff?md5=5f5617ab2d7f7ae9) format("woff");font-weight:300;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-light-italic.woff2?md5=2c80dd810ca80ed7) format("woff2"),url(fonts.compiled/open-sans-light-italic.woff?md5=c246bd09361a0147) format("woff");font-weight:300;font-style:italic}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-regular.woff2?md5=6399f5b3b4684246) format("woff2"),url(fonts.compiled/open-sans-regular.woff?md5=d02e6dd3b1bbbc10) format("woff");font-weight:400;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-italic.woff2?md5=473eeb886be6660b) format("woff2"),url(fonts.compiled/open-sans-italic.woff?md5=d78071284e62fcd4) format("woff");font-weight:400;font-style:italic}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-semi-bold.woff2?md5=ae33326b599cfd07) format("woff2"),url(fonts.compiled/open-sans-semi-bold.woff?md5=f90df377945fccde) format("woff");font-weight:600;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-semi-bold-italic.woff2?md5=0f73259fcbe5b121) format("woff2"),url(fonts.compiled/open-sans-semi-bold-italic.woff?md5=1e25c8a28fdf9a87) format("woff");font-weight:600;font-style:italic}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-bold.woff2?md5=50cc1a94a36420ff) format("woff2"),url(fonts.compiled/open-sans-bold.woff?md5=40084899144c3b75) format("woff");font-weight:700;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-bold-italic.woff2?md5=89b1196ae05d10f5) format("woff2"),url(fonts.compiled/open-sans-bold-italic.woff?md5=41c0cadf1dd05480) format("woff");font-weight:700;font-style:italic}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-extra-bold.woff2?md5=6ef03d4820d03258) format("woff2"),url(fonts.compiled/open-sans-extra-bold.woff?md5=e640a97717802cc5) format("woff");font-weight:800;font-style:normal}@font-face{font-family:open-sans;src:url(fonts.compiled/open-sans-extra-bold-italic.woff2?md5=b3979a57edfd4887) format("woff2"),url(fonts.compiled/open-sans-extra-bold-italic.woff?md5=adb47ef059f0de41) format("woff");font-weight:800;font-style:italic}@font-face{font-family:open-sans-condensed;src:url(fonts.compiled/open-sans-condensed-bold.woff2?md5=317baafbc9215400) format("woff2"),url(fonts.compiled/open-sans-condensed-bold.woff?md5=c8139621e15d27cd) format("woff");font-weight:700;font-style:normal}@font-face{font-family:open-sans-condensed;src:url(fonts.compiled/open-sans-condensed-light.woff2?md5=f517762310d125f0) format("woff2"),url(fonts.compiled/open-sans-condensed-light.woff?md5=607164d33679b5de) format("woff");font-weight:300;font-style:normal}@font-face{font-family:open-sans-condensed;src:url(fonts.compiled/open-sans-condensed-light-italic.woff2?md5=796dc8ebbf7a438a) format("woff2"),url(fonts.compiled/open-sans-condensed-light-italic.woff?md5=f3677299a479a3de) format("woff");font-weight:300;font-style:italic}
package/index.js CHANGED
@@ -1 +1,240 @@
1
- "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types"),require("web-component-wrapper/Web"),require("web-component-wrapper/decorator"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/applyDecoratedDescriptor","@babel/runtime/helpers/initializerDefineProperty","@babel/runtime/helpers/initializerWarningHelper","clientnode","clientnode/property-types","web-component-wrapper/Web","web-component-wrapper/decorator"],t);else{var o="object"==typeof exports?t(require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types"),require("web-component-wrapper/Web"),require("web-component-wrapper/decorator")):t(e["@babel/runtime/helpers/applyDecoratedDescriptor"],e["@babel/runtime/helpers/initializerDefineProperty"],e["@babel/runtime/helpers/initializerWarningHelper"],e.clientnode,e["clientnode/property-types"],e["web-component-wrapper/Web"],e["web-component-wrapper/decorator"]);for(var i in o)("object"==typeof exports?exports:e)[i]=o[i]}}(this,((e,t,o,i,n,s,r)=>(()=>{var a=[,,,e=>{e.exports=t},t=>{t.exports=e},e=>{e.exports=o},e=>{e.exports=i},e=>{e.exports=n},e=>{e.exports=r},e=>{e.exports=s}],l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var o=l[e]={exports:{}};return a[e](o,o.exports,c),o.exports}c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return(()=>{c.r(p),c.d(p,{WebsiteUtilities:()=>P,api:()=>M,default:()=>z,log:()=>E});var e,t,o,i,n,s,r,a,l,u,d,h,m,v,w,f,g,b,y,N,S,T,C,L,D=c(3),O=c.n(D),_=c(4),x=c.n(_),k=(c(5),c(6)),I=c(7),A=c(8),q=c(9);const E=new k.Logger({name:"website-utilities"});let P=(e=(0,A.property)({type:I.object}),t=(0,A.property)({type:I.func}),o=(0,A.property)({type:I.func}),i=(0,A.property)({type:I.func}),n=(0,A.property)({type:I.func}),s=(0,A.property)({type:I.func}),r=(0,A.property)({type:I.func}),a=(0,A.property)({type:I.func}),l=(0,A.property)({type:I.func}),u=(0,A.property)({type:I.func}),d=(0,A.property)({type:I.func}),L=class e extends q.Web{constructor(){super(),this.self=e,O()(this,"options",m,this),O()(this,"onStartUpAnimationComplete",v,this),O()(this,"onSwitchSection",w,this),O()(this,"onViewportMovesAwayFromTop",f,this),O()(this,"onViewportMovesToTop",g,this),O()(this,"onUnfocusResponsiveMenu",b,this),O()(this,"onLoaded",y,this),O()(this,"onButtonClick",N,this),O()(this,"onSectionSwitch",S,this),O()(this,"onLinkClick",T,this),O()(this,"onTrack",C,this),this.currentSectionName="",this.startUpAnimationIsComplete=!1,this.viewportIsOnTop=void 0,this.observerDeregisters=[],this.windowLoadingCoverDomNode=null,this.topDomNode=null,this.priorityNavigationDomNodes=null,this.routerOutletDomNode=null,this.sectionDomNodes={},this.scrollToTopButtonDomNodes=null,this.defineGetterAndSetterInterface()}async onUpdateAttribute(e,t){await super.onUpdateAttribute(e,t),"options"===e&&this._extendOptions()}async render(e="unknown",t=!0){if(await super.render(e,!1),0===Object.keys(this.options).length&&this._extendOptions(),this.disableScrolling(),!this.self.windowLoaded){const e=()=>{this.self.windowLoaded||(this.self.windowLoaded=!0,this._removeLoadingCover().then((()=>{this.enableScrolling(),this._performStartUpEffects().then((()=>{this.addMenuHighlighterViewTransition()})),this.onLoaded()})))};(0,k.onDocumentReady)((()=>{(0,k.timeout)(e,this.options.windowLoadedTimeoutAfterDocLoadedInMSec)})),k.globalContext.window&&this.addSecureEventListener(k.globalContext.window,"load",e)}await this.waitForNestedComponentRendering(),this.grabDomNodes(),this._bindScrollEvents(),this._bindClickTracking(),await this._initializeRouting(),this.initializePriorityNavigation(),await this.resolveRenderingPromiseIfSet(e,t)}unRender(e="unknown",t){super.unRender(e,t);for(const e of this.observerDeregisters)e()}grabDomNodes(){var e,t,o;this.topDomNode=this.hostDomNode.querySelector(this.options.selectors.top),this.scrollToTopButtonDomNodes=this.hostDomNode.querySelectorAll(this.options.selectors.scrollToTopButtons),this.priorityNavigationDomNodes=this.hostDomNode.querySelectorAll(`.${this.options.selectors.priorityNavigationClassName}`),this.routerOutletDomNode=this.hostDomNode.querySelector(this.options.selectors.routerOutlet);for(const e of null!==(i=this.routerOutletDomNode?.children)&&void 0!==i?i:[]){var i;const t=e.getAttribute("data-website-utilities-section");""===t?this.sectionDomNodes.default=e:t&&this.options.sectionNames.managed.includes(t)&&(this.sectionDomNodes[t]=e)}this.windowLoadingCoverDomNode=null!==(e=null!==(t=null!==(o=this.hostDomNode.querySelector(this.options.selectors.windowLoadingCover))&&void 0!==o?o:this.hostDomNode.parentElement?.querySelector(this.options.selectors.windowLoadingCover))&&void 0!==t?t:k.globalContext.document?.body.querySelector(this.options.selectors.windowLoadingCover))&&void 0!==e?e:null}disableScrolling(){this.hostDomNode.parentElement&&(this.hostDomNode.parentElement.classList.add("wu-disable-scrolling"),this.addSecureEventListener(this.hostDomNode.parentElement,"touchmove",k.preventDefault))}enableScrolling(){this.hostDomNode.parentElement&&(this.hostDomNode.parentElement.classList.remove("wu-disable-scrolling"),this.hostDomNode.parentElement.classList.remove("touchmove"),this.hostDomNode.parentElement.removeEventListener("touchmove",k.preventDefault))}async track(e){if(k.globalContext.window?.location&&this.options.tracking){const t={context:`${k.globalContext.window.location.pathname}#`+this.currentSectionName,...e};("number"!=typeof t.value||isNaN(t.value))&&(t.value=1),E.debug('Run tracking code: "event" with arguments:'),E.debug(t);try{await this._onTrack(t)}catch(e){E.warn(`Problem in tracking "${(0,k.represent)(t)}":`,(0,k.represent)(e))}}}initializePriorityNavigation(){const{selectors:e}=this.options,t=e.priorityNavigationOverflowIndicatorClassName;if(0===this.priorityNavigationDomNodes?.length)return;for(const t of this.priorityNavigationDomNodes||[])for(const o of t.querySelectorAll(`[href="#${this.currentSectionName}"]`))o.classList.add(e.activeNavigationItemClassName);const o=()=>{for(const o of this.priorityNavigationDomNodes||[]){const i=o.querySelectorAll("ul > li"),n=Array.from(i).filter((e=>!e.classList.contains(t))),s=i[0].offsetTop;let r=[];for(const e of n){e.offsetTop!==s&&r.push(e)}n.length-r.length<this.options.minimumNumberOfMenuItems&&(r=n.slice());const a=o.querySelector(`.${t}`);if(r.length){const t=r.map((e=>{const t=e.cloneNode(!0);for(const e of t.querySelectorAll("[style]"))e.removeAttribute("style");return t}));for(const t of r)t.classList.add(e.priorityNavigationListItemHideClassName);const i=o.querySelector(e.priorityNavigationOverflowList);if(i)for(const e of t)i.append(e);if(a){const e=this.options.selectors.priorityNavigationShowOverflowIndicatorClassName;o.classList.add(e)}}else a&&o.classList.remove(this.options.selectors.priorityNavigationShowOverflowIndicatorClassName)}};for(const o of this.hostDomNode.querySelectorAll(`.${t}`)){const t=o.closest(`.${e.priorityNavigationClassName}`);this.addSecureEventListener(o,"click",(()=>{t?.classList.toggle(e.priorityNavigationOverflowOpenClassName)})),k.globalContext.document&&this.addSecureEventListener(k.globalContext.document,"click",(o=>{if(t?.classList.contains(e.priorityNavigationOverflowOpenClassName)){const i=Boolean(o.target&&(0,k.getParents)(o.target).some((e=>t===e))),n=this.onUnfocusResponsiveMenu(o,i);(!0===n||!i&&!1!==n)&&t.classList.remove(e.priorityNavigationOverflowOpenClassName)}}))}for(const t of this.priorityNavigationDomNodes||[]){const i=(0,k.trailingThrottle)((()=>{if(!t.classList.contains(e.priorityNavigationOverflowOpenClassName)){t.classList.add(e.priorityNavigationOverflowResizingClassName);for(const o of t.querySelectorAll(e.priorityNavigationOverflowList))for(;o.firstChild;)o.removeChild(o.firstChild);t.classList.remove(this.options.selectors.priorityNavigationShowOverflowIndicatorClassName);for(const o of t.querySelectorAll("ul > li"))o.classList.contains(e.priorityNavigationOverflowIndicatorClassName)||o.classList.remove(e.priorityNavigationListItemHideClassName);o(),t.classList.remove(e.priorityNavigationOverflowResizingClassName)}}),20),n=new ResizeObserver(i);this.observerDeregisters.push((()=>{n.unobserve(t)})),n.observe(t)}o()}addMenuHighlighterViewTransition(){if(!k.globalContext.document)return;const e=document.createElement("style");e.type="text/css";e.appendChild(k.globalContext.document.createTextNode("\n .wu-priority-navigation\n .wu-priority-navigation__link--active::after {\n view-transition-name: wu-menu-highlight;\n }\n ")),k.globalContext.document.getElementsByTagName("head")[0].appendChild(e)}activateNavigationItemHighlighters(e){const t=this.options.selectors.activeNavigationItemClassName;for(const o of this.priorityNavigationDomNodes||[]){for(const e of o.querySelectorAll(`.${t}`))e.classList.remove(t);for(const i of o.querySelectorAll(`[href="#${e}"]`))i.classList.add(t)}}triggerNavigationItemHighlighterSwitching(e){k.globalContext.document?.startViewTransition?k.globalContext.document.startViewTransition((()=>{this.activateNavigationItemHighlighters(e)})):this.activateNavigationItemHighlighters(e)}async _onButtonClick(e){if(!1===await this.onButtonClick(e))return;const t=e.target,o=(0,k.getText)(t).join(" ");this._onTrack({event:"buttonClick",eventType:"click",label:o,reference:t.getAttribute("action")||t.getAttribute("target")||t.getAttribute("type")||o,subject:"button",value:parseInt(t.getAttribute("website-analytics-value")||"1"),userInteraction:!0})}async _onSectionSwitch(e,t,o){!1!==await this.onSectionSwitch(e,t,o)&&k.globalContext.window?.location&&await this._onTrack({event:"sectionSwitch",eventType:"sectionSwitch",label:e,reference:`${k.globalContext.window.location.pathname}#${e}`,subject:"url",userInteraction:!1})}async _onLinkClick(e){if(!1===await this.onLinkClick(e))return;const t=e.target,o=(0,k.getText)(t).join(" ");this._onTrack({event:"linkClick",eventType:"click",label:o,reference:t.getAttribute("href")||t.getAttribute("action")||t.getAttribute("target")||t.getAttribute("type")||o,subject:"link",value:parseInt(t.getAttribute("website-analytics-value")||"1"),userInteraction:!0})}async _onTrack(e){!1!==await this.onTrack(e)&&this.options.tracking&&k.globalContext.dataLayer?.push(e)}_onViewportMovesToTop(){this._finishScrollToTopButtonTransition();for(const t of null!==(e=this.scrollToTopButtonDomNodes)&&void 0!==e?e:[]){var e;const o=()=>{t.removeEventListener("transitionend",i),t.removeEventListener("transitioncancel",o)},i=()=>{this.viewportIsOnTop&&t.classList.add(this.options.selectors.scrollToTopScrollTopSettledStateClassName),o()};t.addEventListener("transitionend",i,{once:!0}),t.addEventListener("transitioncancel",o,{once:!0}),t.classList.add(this.options.selectors.scrollToTopScrollUpStateClassName)}}async _onViewportMovesAwayFromTop(){for(const t of null!==(e=this.scrollToTopButtonDomNodes)&&void 0!==e?e:[]){var e;t.classList.remove(this.options.selectors.scrollToTopScrollTopSettledStateClassName)}await(0,k.timeout)(),this._finishScrollToTopButtonTransition();for(const e of null!==(t=this.scrollToTopButtonDomNodes)&&void 0!==t?t:[]){var t;e.classList.add(this.options.selectors.scrollToTopScrollDownStateClassName)}}async switchSection(e,t){if(k.globalContext.window&&"location"in k.globalContext.window&&(""===e||this.options.sectionNames.managed.includes(e)||this.options.sectionNames.unmanaged.includes(e))){var o,i;const n=Object.prototype.hasOwnProperty.call(this.sectionDomNodes,this.currentSectionName)?this.sectionDomNodes[this.currentSectionName]:null!==(o=this.sectionDomNodes.default)&&void 0!==o?o:null,s=Object.prototype.hasOwnProperty.call(this.sectionDomNodes,e)?this.sectionDomNodes[e]:null!==(i=this.sectionDomNodes.default)&&void 0!==i?i:null;await this.self.switchSectionLock.acquire(),this.triggerNavigationItemHighlighterSwitching(e),E.debug(`Run section switch from "${this.currentSectionName}" to`,`"${e}".`),this.currentSectionName===e?(n&&(n.classList.remove("wu-section-active"),n.classList.add("wu-section-inactive")),s&&(s.classList.remove("wu-section-inactive"),s.classList.add("wu-section-active"))):this.options.sectionNames.unmanaged.includes(e)&&this.options.sectionNames.unmanaged.includes(this.currentSectionName)||((0,k.interruptableScrollTo)(),n&&(await(0,k.fadeOut)(n),n.classList.remove("wu-section-active"),n.classList.add("wu-section-inactive")),s&&(s.classList.remove("wu-section-inactive"),s.classList.add("wu-section-active"),await(0,k.fadeIn)(s)));const r=this.currentSectionName;this.currentSectionName=e;try{await this._onSectionSwitch(this.currentSectionName,r,t)}catch(e){E.warn("Problem due to call section switch callback on section",`"${this.currentSectionName}": ${(0,k.represent)(e)}`)}await this.self.switchSectionLock.release()}}_extendOptions(){this.setPropertyValue("options",(0,k.extend)(!0,{},this.self._defaultOptions,this.options))}_initializeRouting(){""===this.currentSectionName&&(this.currentSectionName=this.options.sectionNames.default),this._bindNavigationEvents();const e=k.globalContext.location?.hash&&k.globalContext.location.hash.substring(1);e&&(this.options.sectionNames.managed.includes(e)||this.options.sectionNames.unmanaged.includes(e))&&(this.currentSectionName=e);for(const e of Object.values(this.sectionDomNodes))e.classList.add("wu-section-inactive");return this.switchSection(e||this.currentSectionName)}_finishScrollToTopButtonTransition(){for(const t of null!==(e=this.scrollToTopButtonDomNodes)&&void 0!==e?e:[]){var e;t.classList.remove(this.options.selectors.scrollToTopScrollUpStateClassName,this.options.selectors.scrollToTopScrollDownStateClassName)}}_bindScrollEvents(){if(k.globalContext.document)if(k.globalContext.window&&this.addSecureEventListener(k.globalContext.window,"scroll",(e=>{k.globalContext.window?.scrollY?this.viewportIsOnTop&&(this.viewportIsOnTop=!1,this._onViewportMovesAwayFromTop().then(this.onViewportMovesAwayFromTop.bind(this,e))):this.viewportIsOnTop||(this.viewportIsOnTop=!0,this._onViewportMovesToTop(),this.onViewportMovesToTop(e))})),k.globalContext.window?.scrollY)this.viewportIsOnTop=!1,this._onViewportMovesAwayFromTop().then((()=>{this.onViewportMovesAwayFromTop()}));else{this.viewportIsOnTop=!0;for(const t of null!==(e=this.scrollToTopButtonDomNodes)&&void 0!==e?e:[]){var e;t.classList.add(this.options.selectors.scrollToTopScrollTopSettledStateClassName)}this._onViewportMovesToTop(),this.onViewportMovesToTop()}}async _removeLoadingCover(){await(0,k.timeout)(this.options.additionalPageLoadingTimeInMilliseconds);for(const e of this.hostDomNode.querySelectorAll(`[class^="${this.options.selectors.startUpAnimationClassPrefix}"], [class*=" ${this.options.selectors.startUpAnimationClassPrefix}"]`))e.style.opacity="0";this.windowLoadingCoverDomNode&&await(0,k.fadeOut)(this.windowLoadingCoverDomNode)}async _performStartUpEffects(){const e=[];let t=1;for(;;){const o=this.hostDomNode.querySelectorAll("."+this.options.selectors.startUpAnimationClassPrefix+String(t));if(0===o.length){await Promise.all(e),this.startUpAnimationIsComplete=!0,this.onStartUpAnimationComplete();break}await(0,k.timeout)(this.options.startUpAnimationElementDelayInMilliseconds);for(const t of o){t.style.removeProperty("opacity");const o=(0,k.fadeIn)(t);e.push(o.then((()=>{o.resetStyles()})))}t+=1}}_bindNavigationEvents(){k.globalContext.window&&this.addSecureEventListener(k.globalContext.window,"hashchange",(e=>{if(this.startUpAnimationIsComplete){const t=location.hash.substring(1);this.switchSection(t,e)}})),this._bindScrollToTopButton()}_bindScrollToTopButton(){for(const e of this.scrollToTopButtonDomNodes||[])this.addSecureEventListener(e,"click",(e=>{e.preventDefault(),(0,k.interruptableScrollTo)()}))}_bindClickTracking(){if(this.options.tracking){for(const e of this.hostDomNode.querySelectorAll("a"))this.addSecureEventListener(e,"click",(e=>{this._onLinkClick(e)}));for(const e of this.hostDomNode.querySelectorAll("button"))this.addSecureEventListener(e,"click",(e=>{this._onButtonClick(e)}))}}},L._name="WebsiteUtilities",L._defaultOptions={additionalPageLoadingTimeInMilliseconds:0,startUpAnimationElementDelayInMilliseconds:100,windowLoadedTimeoutAfterDocLoadedInMSec:2e3,domain:"auto",sectionNames:{default:"",managed:["home"],unmanaged:[]},selectors:{windowLoadingCover:".wu-window-loading-cover",startUpAnimationClassPrefix:"wu-start-up-animation-number-",top:".wu-header",routerOutlet:".wu-router-outlet",scrollToTopButtons:".wu-scroll-to-top",scrollToTopScrollTopSettledStateClassName:"wu-top-settled",scrollToTopScrollUpStateClassName:"wu-scroll-up",scrollToTopScrollDownStateClassName:"wu-scroll-down",priorityNavigationClassName:"wu-priority-navigation",priorityNavigationOverflowOpenClassName:"wu-priority-navigation--overflow-open",priorityNavigationShowOverflowIndicatorClassName:"wu-priority-navigation--show-overflow-indicator",priorityNavigationOverflowResizingClassName:"wu-priority-navigation--resizing",activeNavigationItemClassName:"wu-priority-navigation__link--active",priorityNavigationListItemHideClassName:"wu-priority-navigation__list__item--hide",priorityNavigationOverflowIndicatorClassName:"wu-priority-navigation__list__overflow-indicator",priorityNavigationOverflowList:".wu-priority-navigation__overflow-list"},minimumNumberOfMenuItems:3,tracking:!1},L.windowLoaded=!1,L.switchSectionLock=new k.Lock,h=L,m=x()(h.prototype,"options",[e],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),v=x()(h.prototype,"onStartUpAnimationComplete",[t],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return k.NOOP}}),w=x()(h.prototype,"onSwitchSection",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return k.NOOP}}),f=x()(h.prototype,"onViewportMovesAwayFromTop",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return k.NOOP}}),g=x()(h.prototype,"onViewportMovesToTop",[n],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return k.NOOP}}),b=x()(h.prototype,"onUnfocusResponsiveMenu",[s],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return k.NOOP}}),y=x()(h.prototype,"onLoaded",[r],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return k.NOOP}}),N=x()(h.prototype,"onButtonClick",[a],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(e){return Promise.resolve(void 0)}}}),S=x()(h.prototype,"onSectionSwitch",[l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(e,t,o){return Promise.resolve(void 0)}}}),T=x()(h.prototype,"onLinkClick",[u],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(e){return Promise.resolve(void 0)}}}),C=x()(h.prototype,"onTrack",[d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(e){return Promise.resolve(void 0)}}}),h);const M={component:P,register:(e=(0,k.camelCaseToDelimited)(P._name))=>{customElements.define(e,P)}},z=P;k.globalContext.AUTO_DEFINE_WEBSITE_UTILITIES&&M.register()})(),p})()));
1
+ if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;import { Lock as __WEBPACK_EXTERNAL_MODULE_clientnode_Lock__, Logger as __WEBPACK_EXTERNAL_MODULE_clientnode_Logger__, NOOP as __WEBPACK_EXTERNAL_MODULE_clientnode_NOOP__, camelCaseToDelimited as __WEBPACK_EXTERNAL_MODULE_clientnode_camelCaseToDelimited__, extend as __WEBPACK_EXTERNAL_MODULE_clientnode_extend__, fadeIn as __WEBPACK_EXTERNAL_MODULE_clientnode_fadeIn__, fadeOut as __WEBPACK_EXTERNAL_MODULE_clientnode_fadeOut__, getParents as __WEBPACK_EXTERNAL_MODULE_clientnode_getParents__, getText as __WEBPACK_EXTERNAL_MODULE_clientnode_getText__, globalContext as __WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__, interruptableScrollTo as __WEBPACK_EXTERNAL_MODULE_clientnode_interruptableScrollTo__, onDocumentReady as __WEBPACK_EXTERNAL_MODULE_clientnode_onDocumentReady__, preventDefault as __WEBPACK_EXTERNAL_MODULE_clientnode_preventDefault__, represent as __WEBPACK_EXTERNAL_MODULE_clientnode_represent__, timeout as __WEBPACK_EXTERNAL_MODULE_clientnode_timeout__, trailingThrottle as __WEBPACK_EXTERNAL_MODULE_clientnode_trailingThrottle__ } from "clientnode";
2
+ import { func as __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__, object as __WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_object__ } from "clientnode/property-types";
3
+ import { property as __WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__ } from "web-component-wrapper/decorator";
4
+ import "web-component-wrapper/type";
5
+ import { Web as __WEBPACK_EXTERNAL_MODULE_web_component_wrapper_Web_aacc6608_Web__ } from "web-component-wrapper/Web";
6
+ /******/ // The require scope
7
+ /******/ const __webpack_require__ = {};
8
+ /******/
9
+ /************************************************************************/
10
+ /******/ /* webpack/runtime/define property getters */
11
+ /******/ (() => {
12
+ /******/ // define getter/value functions for harmony exports
13
+ /******/ __webpack_require__.d = (exports, definition) => {
14
+ /******/ if(Array.isArray(definition)) {
15
+ /******/ var i = 0;
16
+ /******/ while(i < definition.length) {
17
+ /******/ var key = definition[i++];
18
+ /******/ var binding = definition[i++];
19
+ /******/ if(!__webpack_require__.o(exports, key)) {
20
+ /******/ if(binding === 0) {
21
+ /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
22
+ /******/ } else {
23
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
24
+ /******/ }
25
+ /******/ } else if(binding === 0) { i++; }
26
+ /******/ }
27
+ /******/ } else {
28
+ /******/ for(var key in definition) {
29
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
30
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
31
+ /******/ }
32
+ /******/ }
33
+ /******/ }
34
+ /******/ };
35
+ /******/ })();
36
+ /******/
37
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
38
+ /******/ (() => {
39
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
40
+ /******/ })();
41
+ /******/
42
+ /************************************************************************/
43
+ // extracted by mini-css-extract-plugin
44
+
45
+
46
+ ;// external "clientnode"
47
+
48
+ ;// external "clientnode/property-types"
49
+
50
+ ;// external "web-component-wrapper/decorator"
51
+
52
+ ;// external "web-component-wrapper/type"
53
+
54
+ ;// external "web-component-wrapper/Web"
55
+
56
+ ;// ./index.ts
57
+ // #!/usr/bin/env babel-node
58
+ // -*- coding: utf-8 -*-
59
+ /** @module website-utilities *//* !
60
+ region header
61
+ [Project page](https://torben.website/website-utilities)
62
+
63
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
64
+
65
+ License
66
+ -------
67
+
68
+ This library written by Torben Sickert stands under a creative commons
69
+ naming 3.0 unported license.
70
+ See https://creativecommons.org/licenses/by/3.0/deed.de
71
+ endregion
72
+ */// region imports
73
+ var _dec,_dec2,_dec3,_dec4,_dec5,_dec6,_dec7,_dec8,_dec9,_dec0,_dec1,_class,_descriptor,_descriptor2,_descriptor3,_descriptor4,_descriptor5,_descriptor6,_descriptor7,_descriptor8,_descriptor9,_descriptor0,_descriptor1,_WebsiteUtilities;function _initializerDefineProperty(e,i,r,l){r&&Object.defineProperty(e,i,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(l):void 0})}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _applyDecoratedDescriptor(i,e,r,n,l){var a={};return Object.keys(n).forEach(function(i){a[i]=n[i]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce(function(r,n){return n(i,e,r)||r},a),l&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(l):void 0,a.initializer=void 0),void 0===a.initializer?(Object.defineProperty(i,e,a),null):a}function _initializerWarningHelper(r,e){throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.")};// endregion
74
+ const log=new __WEBPACK_EXTERNAL_MODULE_clientnode_Logger__({name:"website-utilities"});// region plugins/classes
75
+ /**
76
+ * This plugin holds common methods to extend a whole website.
77
+ * @property _defaultOptions - Options extended by the options given to the
78
+ * initializer method.
79
+ * @property _defaultOptions.additionalPageLoadingTimeInMilliseconds -
80
+ * Additional time to wait until page will be indicated as loaded.
81
+ * @property _defaultOptions.selectors - Mapping of dom node descriptions to
82
+ * their corresponding selectors.
83
+ * @property _defaultOptions.selectors.top - Selector to indicate that viewport
84
+ * is currently on top.
85
+ * @property _defaultOptions.selectors.scrollToTopButtons - Selectors for
86
+ * starting an animated scroll to top.
87
+ * @property _defaultOptions.selectors.startUpAnimationClassPrefix - Class name
88
+ * selector prefix for all dom nodes to appear during startup animations.
89
+ * @property _defaultOptions.selectors.windowLoadingCover - Selector to the full
90
+ * window loading cover dom node.
91
+ * @property _defaultOptions.startUpAnimationElementDelayInMilliseconds - Delay
92
+ * between two startup animated dom nodes in order.
93
+ * @property _defaultOptions.tracking - Indicates whether tracking should be
94
+ * used or not.
95
+ * @property _defaultOptions.windowLoadedTimeoutAfterDocLoadedInMSec - Duration
96
+ * after loading cover should be removed.
97
+ * @property options - Finally configured given options.
98
+ * @property currentSectionName - Saves current section hash name.
99
+ * @property startUpAnimationIsComplete - Indicates whether startup animations
100
+ * have finished.
101
+ * @property viewportIsOnTop - Indicates whether current viewport is on top.
102
+ * @property windowLoaded - Indicates whether the window is already loaded.
103
+ * @property onChangeMediaQueryMode - Callback to trigger if media query mode
104
+ * changes.
105
+ * @property onChangeToExtraSmallMode - Callback to trigger if media query mode
106
+ * changes to extra small mode.
107
+ * @property onChangeToLargeMode - Callback to trigger if media query mode
108
+ * changes to large mode.
109
+ * @property onChangeToMediumMode - Callback to trigger if media query mode
110
+ * changes to medium mode.
111
+ * @property onChangeToSmallMode - Callback to trigger if media query mode
112
+ * changes to small mode.
113
+ * @property onStartUpAnimationComplete - Callback to trigger if all startup
114
+ * animations have finished.
115
+ * @property onSwitchSection - Callback to trigger if the current section
116
+ * switches.
117
+ * @property onViewportMovesAwayFromTop - Callback to trigger when viewport
118
+ * moves away from top.
119
+ * @property onViewportMovesToTop - Callback to trigger when viewport arrives
120
+ * at top.
121
+ * @property onButtonClick - Function to call on button click events.
122
+ * @property onLinkClick - Function to call on link click events.
123
+ * @property onSectionSwitch - Function to call on section switches.
124
+ * @property onTrack - Tracker call itself.
125
+ */let WebsiteUtilities=(_dec=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_object__}),_dec2=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec3=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec4=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec5=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec6=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec7=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec8=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec9=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec0=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_dec1=__WEBPACK_EXTERNAL_MODULE_web_component_wrapper_decorator_a680de5c_property__({type:__WEBPACK_EXTERNAL_MODULE_clientnode_property_types_4789ebe2_func__}),_class=(_WebsiteUtilities=class WebsiteUtilities extends __WEBPACK_EXTERNAL_MODULE_web_component_wrapper_Web_aacc6608_Web__{/// endregion
126
+ // region public
127
+ /// region live-cycle
128
+ /**
129
+ * Defines dynamic getter and setter interface and resolves the
130
+ * configuration object. Initializes the map implementation.
131
+ */constructor(){super();/*
132
+ Babel's property declaration transformation overwrites defined
133
+ properties at the end of an implicit constructor. So we have to
134
+ redefine them as long as we want to declare expected component
135
+ interface properties to enable static type checks.
136
+ */_defineProperty(this,"self",WebsiteUtilities);// region api properties
137
+ _initializerDefineProperty(this,"options",_descriptor,this);_initializerDefineProperty(this,"onStartUpAnimationComplete",_descriptor2,this);_initializerDefineProperty(this,"onSwitchSection",_descriptor3,this);_initializerDefineProperty(this,"onViewportMovesAwayFromTop",_descriptor4,this);_initializerDefineProperty(this,"onViewportMovesToTop",_descriptor5,this);_initializerDefineProperty(this,"onUnfocusResponsiveMenu",_descriptor6,this);_initializerDefineProperty(this,"onLoaded",_descriptor7,this);_initializerDefineProperty(this,"onButtonClick",_descriptor8,this);_initializerDefineProperty(this,"onSectionSwitch",_descriptor9,this);_initializerDefineProperty(this,"onLinkClick",_descriptor0,this);_initializerDefineProperty(this,"onTrack",_descriptor1,this);// endregion
138
+ _defineProperty(this,"currentSectionName","");_defineProperty(this,"startUpAnimationIsComplete",false);_defineProperty(this,"viewportIsOnTop",void 0);_defineProperty(this,"observerDeregisters",[]);/// region dom nodes
139
+ _defineProperty(this,"windowLoadingCoverDomNode",null);_defineProperty(this,"topDomNode",null);_defineProperty(this,"priorityNavigationDomNodes",null);_defineProperty(this,"routerOutletDomNode",null);_defineProperty(this,"sectionDomNodes",{});_defineProperty(this,"scrollToTopButtonDomNodes",null);this.defineGetterAndSetterInterface()}/**
140
+ * Triggered when ever a given attribute has changed and triggers to update
141
+ * configured dom content.
142
+ * @param name - Attribute name which was updates.
143
+ * @param newValue - New updated value.
144
+ * @returns Promise resolving when attribute has been updated.
145
+ */async onUpdateAttribute(name,newValue){await super.onUpdateAttribute(name,newValue);if(name==="options")this._extendOptions()}/**
146
+ * Updates controlled dom elements.
147
+ * @param reason - Why an update has been triggered.
148
+ * @param resolveRendering - Indicates whether rendering should be resolved
149
+ * finally. Should be set to "false" via super calls in inherited render
150
+ * methods which do further dom manipulations afterward and resolve the
151
+ * rendering process by their own.
152
+ * @returns A promise resolving when rendering has finished. A promise may
153
+ * be needed for classes inheriting from this class.
154
+ */async render(reason="unknown",resolveRendering=true){await super.render(reason,false);if(Object.keys(this.options).length===0)this._extendOptions();this.disableScrolling();if(!this.self.windowLoaded){const onLoaded=()=>{if(!this.self.windowLoaded){this.self.windowLoaded=true;void this._removeLoadingCover().then(()=>{this.enableScrolling();void this._performStartUpEffects().then(()=>{this.addMenuHighlighterViewTransition()});this.onLoaded()})}};void __WEBPACK_EXTERNAL_MODULE_clientnode_onDocumentReady__(()=>{void __WEBPACK_EXTERNAL_MODULE_clientnode_timeout__(onLoaded,this.options.windowLoadedTimeoutAfterDocLoadedInMSec)});if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window)this.addSecureEventListener(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window,"load",onLoaded)}await this.waitForNestedComponentRendering();this.grabDomNodes();this._bindScrollEvents();this._bindClickTracking();await this._initializeRouting();this.initializePriorityNavigation();await this.resolveRenderingPromiseIfSet(reason,resolveRendering)}/**
155
+ * Should free up memory listeners related to deprecated HTML.
156
+ * @param reason - Description why rendering is necessary.
157
+ * @param reRenderReason - Description why a re-rendering is necessary.
158
+ */unRender(reason="unknown",reRenderReason){super.unRender(reason,reRenderReason);for(const deregister of this.observerDeregisters)deregister()}// endregion
159
+ grabDomNodes(){this.topDomNode=this.hostDomNode.querySelector(this.options.selectors.top);this.scrollToTopButtonDomNodes=this.hostDomNode.querySelectorAll(this.options.selectors.scrollToTopButtons);this.priorityNavigationDomNodes=this.hostDomNode.querySelectorAll(`.${this.options.selectors.priorityNavigationClassName}`);this.routerOutletDomNode=this.hostDomNode.querySelector(this.options.selectors.routerOutlet);for(const domNode of this.routerOutletDomNode?.children??[]){const name=domNode.getAttribute("data-website-utilities-section");if(name==="")this.sectionDomNodes.default=domNode;else if(name&&this.options.sectionNames.managed.includes(name))this.sectionDomNodes[name]=domNode}this.windowLoadingCoverDomNode=this.hostDomNode.querySelector(this.options.selectors.windowLoadingCover)??this.hostDomNode.parentElement?.querySelector(this.options.selectors.windowLoadingCover)??__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document?.body.querySelector(this.options.selectors.windowLoadingCover)??null}/**
160
+ * This method disables scrolling on the given web view.
161
+ */disableScrolling(){if(!this.hostDomNode.parentElement)return;this.hostDomNode.parentElement.classList.add("wu-disable-scrolling");this.addSecureEventListener(this.hostDomNode.parentElement,"touchmove",__WEBPACK_EXTERNAL_MODULE_clientnode_preventDefault__)}/**
162
+ * This method disables scrolling on the given web view.
163
+ */enableScrolling(){if(!this.hostDomNode.parentElement)return;this.hostDomNode.parentElement.classList.remove("wu-disable-scrolling");this.hostDomNode.parentElement.classList.remove("touchmove");this.hostDomNode.parentElement.removeEventListener("touchmove",__WEBPACK_EXTERNAL_MODULE_clientnode_preventDefault__)}/**
164
+ * Triggers an analytics event. All given arguments are forwarded to
165
+ * configured analytics event code to define to their environment
166
+ * variables.
167
+ * @param properties - Event tracking information.
168
+ */async track(properties){if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window?.location&&this.options.tracking){const trackingItem={context:`${__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window.location.pathname}#`+this.currentSectionName,...properties};if(typeof trackingItem.value!=="number"||isNaN(trackingItem.value))trackingItem.value=1;log.debug("Run tracking code: \"event\" with arguments:");log.debug(trackingItem);try{await this._onTrack(trackingItem)}catch(error){log.warn(`Problem in tracking "${__WEBPACK_EXTERNAL_MODULE_clientnode_represent__(trackingItem)}":`,__WEBPACK_EXTERNAL_MODULE_clientnode_represent__(error))}}}initializePriorityNavigation(){const{selectors}=this.options;const overflowIndicatorClassName=selectors.priorityNavigationOverflowIndicatorClassName;if(this.priorityNavigationDomNodes?.length===0)return;for(const domNode of this.priorityNavigationDomNodes||[])for(const item of domNode.querySelectorAll(`[href="#${this.currentSectionName}"]`))item.classList.add(selectors.activeNavigationItemClassName);const setupOverflowMenu=()=>{for(const menuDomNode of this.priorityNavigationDomNodes||[]){const allMenuItemsDomNode=menuDomNode.querySelectorAll("ul > li");const menuItemDomNodes=Array.from(allMenuItemsDomNode).filter(domNode=>!domNode.classList.contains(overflowIndicatorClassName));// Checking top position of first item (sometimes changes)
169
+ const firstTopPosition=allMenuItemsDomNode[0].offsetTop;let wrappedElements=[];for(const domNode of menuItemDomNodes){const topPosition=domNode.offsetTop;if(topPosition!==firstTopPosition)wrappedElements.push(domNode)}if(menuItemDomNodes.length-wrappedElements.length<this.options.minimumNumberOfMenuItems)wrappedElements=menuItemDomNodes.slice();const overflowMenu=menuDomNode.querySelector(`.${overflowIndicatorClassName}`);if(wrappedElements.length){// Clone set before altering
170
+ const newSet=wrappedElements.map(domNode=>{const copy=domNode.cloneNode(true);/*
171
+ NOTE: We remove all inline styles to remove running
172
+ transitions and instance-specific styling which
173
+ might not be useful in stacked menu.
174
+ */for(const domNode of copy.querySelectorAll("[style]"))domNode.removeAttribute("style");return copy});// Hide ones that we're moving
175
+ for(const domNode of wrappedElements)domNode.classList.add(selectors.priorityNavigationListItemHideClassName);// Add wrapped elements to dropdown
176
+ const overflowNavigationList=menuDomNode.querySelector(selectors.priorityNavigationOverflowList);if(overflowNavigationList)for(const domNode of newSet)overflowNavigationList.append(domNode);if(overflowMenu){const className=this.options.selectors.priorityNavigationShowOverflowIndicatorClassName;menuDomNode.classList.add(className)}}else if(overflowMenu)menuDomNode.classList.remove(this.options.selectors.priorityNavigationShowOverflowIndicatorClassName)}};for(const domNode of this.hostDomNode.querySelectorAll(`.${overflowIndicatorClassName}`)){const menuDomNode=domNode.closest(`.${selectors.priorityNavigationClassName}`);this.addSecureEventListener(domNode,"click",()=>{menuDomNode?.classList.toggle(selectors.priorityNavigationOverflowOpenClassName)});if(!__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document)continue;/*
177
+ Listen for clicks anywhere on the webpage to close overflow
178
+ menu.
179
+ */this.addSecureEventListener(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document,"click",event=>{if(menuDomNode?.classList.contains(selectors.priorityNavigationOverflowOpenClassName)){const clickWasInMenu=Boolean(event.target&&__WEBPACK_EXTERNAL_MODULE_clientnode_getParents__(event.target).some(parentDomNode=>menuDomNode===parentDomNode));const result=this.onUnfocusResponsiveMenu(event,clickWasInMenu);if(result===true||!clickWasInMenu&&result!==false)menuDomNode.classList.remove(selectors.priorityNavigationOverflowOpenClassName)}})}for(const menuDomNode of this.priorityNavigationDomNodes||[]){const update=__WEBPACK_EXTERNAL_MODULE_clientnode_trailingThrottle__(()=>{/*
180
+ NOTE: Skip update if overflow menu is currently open
181
+ to avoid interrupting CSS transitions (toggling
182
+ display:none/inline-block on the indicator kills
183
+ running transitions).
184
+ */if(menuDomNode.classList.contains(selectors.priorityNavigationOverflowOpenClassName))return;menuDomNode.classList.add(selectors.priorityNavigationOverflowResizingClassName);for(const domNode of menuDomNode.querySelectorAll(selectors.priorityNavigationOverflowList))while(domNode.firstChild)domNode.removeChild(domNode.firstChild);menuDomNode.classList.remove(this.options.selectors.priorityNavigationShowOverflowIndicatorClassName);for(const domNode of menuDomNode.querySelectorAll("ul > li"))if(!domNode.classList.contains(selectors.priorityNavigationOverflowIndicatorClassName))domNode.classList.remove(selectors.priorityNavigationListItemHideClassName);setupOverflowMenu();menuDomNode.classList.remove(selectors.priorityNavigationOverflowResizingClassName)},20);const observer=new ResizeObserver(update);this.observerDeregisters.push(()=>{observer.unobserve(menuDomNode)});observer.observe(menuDomNode)}setupOverflowMenu()}addMenuHighlighterViewTransition(){if(!__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document)return;const styleDomNode=document.createElement("style");styleDomNode.type="text/css";const styles=`
185
+ .wu-priority-navigation
186
+ .wu-priority-navigation__link--active::after {
187
+ view-transition-name: wu-menu-highlight;
188
+ }
189
+ `;styleDomNode.appendChild(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document.createTextNode(styles));__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document.getElementsByTagName("head")[0].appendChild(styleDomNode)}activateNavigationItemHighlighters(sectionName){const className=this.options.selectors.activeNavigationItemClassName;for(const domNode of this.priorityNavigationDomNodes||[]){for(const item of domNode.querySelectorAll(`.${className}`))item.classList.remove(className);for(const item of domNode.querySelectorAll(`[href="#${sectionName}"]`))item.classList.add(className)}}triggerNavigationItemHighlighterSwitching(sectionName){if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document?.startViewTransition){__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document.startViewTransition(()=>{this.activateNavigationItemHighlighters(sectionName)});return}this.activateNavigationItemHighlighters(sectionName)}// endregion
190
+ // region protected methods
191
+ /// region event
192
+ async _onButtonClick(event){if((await this.onButtonClick(event))===false)return;const button=event.target;const content=__WEBPACK_EXTERNAL_MODULE_clientnode_getText__(button).join(" ");void this._onTrack({event:"buttonClick",eventType:"click",label:content,reference:button.getAttribute("action")||button.getAttribute("target")||button.getAttribute("type")||content,subject:"button",value:parseInt(button.getAttribute("website-analytics-value")||"1"),userInteraction:true})}async _onSectionSwitch(sectionName,oldSectionName,event){if((await this.onSectionSwitch(sectionName,oldSectionName,event))===false)return;if(!__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window?.location)return;await this._onTrack({event:"sectionSwitch",eventType:"sectionSwitch",label:sectionName,reference:`${__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window.location.pathname}#${sectionName}`,subject:"url",userInteraction:false})}async _onLinkClick(event){if((await this.onLinkClick(event))===false)return;const link=event.target;const content=__WEBPACK_EXTERNAL_MODULE_clientnode_getText__(link).join(" ");void this._onTrack({event:"linkClick",eventType:"click",label:content,reference:link.getAttribute("href")||link.getAttribute("action")||link.getAttribute("target")||link.getAttribute("type")||content,subject:"link",value:parseInt(link.getAttribute("website-analytics-value")||"1"),userInteraction:true})}async _onTrack(item){if((await this.onTrack(item))===false)return;if(this.options.tracking)__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.dataLayer?.push(item)}/**
193
+ * This method triggers if the viewport moves to the top.
194
+ */_onViewportMovesToTop(){this._finishScrollToTopButtonTransition();for(const domNode of this.scrollToTopButtonDomNodes??[]){const cancel=()=>{domNode.removeEventListener("transitionend",setSettledClass);domNode.removeEventListener("transitioncancel",cancel)};const setSettledClass=()=>{if(this.viewportIsOnTop)domNode.classList.add(this.options.selectors.scrollToTopScrollTopSettledStateClassName);cancel()};domNode.addEventListener("transitionend",setSettledClass,{once:true});domNode.addEventListener("transitioncancel",cancel,{once:true});domNode.classList.add(this.options.selectors.scrollToTopScrollUpStateClassName)}}/**
195
+ * This method triggers if the viewport moves away from the top.
196
+ */async _onViewportMovesAwayFromTop(){for(const domNode of this.scrollToTopButtonDomNodes??[])domNode.classList.remove(this.options.selectors.scrollToTopScrollTopSettledStateClassName);/*
197
+ NOTE: We need to render the none-setteled state beforehand to make
198
+ sure browser will perform the transition.
199
+ */await __WEBPACK_EXTERNAL_MODULE_clientnode_timeout__();this._finishScrollToTopButtonTransition();for(const domNode of this.scrollToTopButtonDomNodes??[])domNode.classList.add(this.options.selectors.scrollToTopScrollDownStateClassName)}/**
200
+ * This method triggers if we change the current section.
201
+ * @param sectionName - Contains the new section name.
202
+ * @param event - Optional event that triggered the switch.
203
+ * @returns Promise resolving when the section switch has been finished.
204
+ */async switchSection(sectionName,event){if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window&&"location" in __WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window&&(sectionName===""||this.options.sectionNames.managed.includes(sectionName)||this.options.sectionNames.unmanaged.includes(sectionName))){const oldSectionDomNode=Object.prototype.hasOwnProperty.call(this.sectionDomNodes,this.currentSectionName)?this.sectionDomNodes[this.currentSectionName]:this.sectionDomNodes.default??null;const newSectionDomNode=Object.prototype.hasOwnProperty.call(this.sectionDomNodes,sectionName)?this.sectionDomNodes[sectionName]:this.sectionDomNodes.default??null;await this.self.switchSectionLock.acquire();this.triggerNavigationItemHighlighterSwitching(sectionName);log.debug(`Run section switch from "${this.currentSectionName}" to`,`"${sectionName}".`);if(this.currentSectionName===sectionName){if(oldSectionDomNode){oldSectionDomNode.classList.remove("wu-section-active");oldSectionDomNode.classList.add("wu-section-inactive")}if(newSectionDomNode){newSectionDomNode.classList.remove("wu-section-inactive");newSectionDomNode.classList.add("wu-section-active")}}else if(!(this.options.sectionNames.unmanaged.includes(sectionName)&&this.options.sectionNames.unmanaged.includes(this.currentSectionName))){__WEBPACK_EXTERNAL_MODULE_clientnode_interruptableScrollTo__();if(oldSectionDomNode){await __WEBPACK_EXTERNAL_MODULE_clientnode_fadeOut__(oldSectionDomNode);oldSectionDomNode.classList.remove("wu-section-active");oldSectionDomNode.classList.add("wu-section-inactive")}if(newSectionDomNode){newSectionDomNode.classList.remove("wu-section-inactive");newSectionDomNode.classList.add("wu-section-active");await __WEBPACK_EXTERNAL_MODULE_clientnode_fadeIn__(newSectionDomNode)}}const oldSectionName=this.currentSectionName;this.currentSectionName=sectionName;try{await this._onSectionSwitch(this.currentSectionName,oldSectionName,event)}catch(error){log.warn("Problem due to call section switch callback on section",`"${this.currentSectionName}": ${__WEBPACK_EXTERNAL_MODULE_clientnode_represent__(error)}`)}await this.self.switchSectionLock.release()}}// endregion
205
+ /// region helper
206
+ /**
207
+ * Extends given options by default options.
208
+ */_extendOptions(){/*
209
+ NOTE: Using the internal setter avoids triggering an additional
210
+ rendering.
211
+ */this.setPropertyValue("options",__WEBPACK_EXTERNAL_MODULE_clientnode_extend__(true,{},this.self._defaultOptions,this.options))}/**
212
+ * Handle section switches.
213
+ * @returns Promise resolving when routing initialization has been
214
+ * finished.
215
+ */_initializeRouting(){if(this.currentSectionName==="")this.currentSectionName=this.options.sectionNames.default;this._bindNavigationEvents();const sectionNameCandidate=__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.location?.hash&&__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.location.hash.substring("#".length);if(sectionNameCandidate&&(this.options.sectionNames.managed.includes(sectionNameCandidate)||this.options.sectionNames.unmanaged.includes(sectionNameCandidate)))this.currentSectionName=sectionNameCandidate;for(const domNode of Object.values(this.sectionDomNodes))domNode.classList.add("wu-section-inactive");return this.switchSection(sectionNameCandidate||this.currentSectionName)}/**
216
+ * Removes class names from scroll-to-top buttons to stop running
217
+ * transitions.
218
+ */_finishScrollToTopButtonTransition(){for(const domNode of this.scrollToTopButtonDomNodes??[])domNode.classList.remove(this.options.selectors.scrollToTopScrollUpStateClassName,this.options.selectors.scrollToTopScrollDownStateClassName)}/**
219
+ * This method triggers if the view port arrives at special areas.
220
+ */_bindScrollEvents(){if(!__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.document)return;if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window)this.addSecureEventListener(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window,"scroll",event=>{if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window?.scrollY){if(this.viewportIsOnTop){this.viewportIsOnTop=false;void this._onViewportMovesAwayFromTop().then(this.onViewportMovesAwayFromTop.bind(this,event))}}else if(!this.viewportIsOnTop){this.viewportIsOnTop=true;this._onViewportMovesToTop();this.onViewportMovesToTop(event)}});if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window?.scrollY){this.viewportIsOnTop=false;void this._onViewportMovesAwayFromTop().then(()=>{this.onViewportMovesAwayFromTop()})}else{this.viewportIsOnTop=true;for(const domNode of this.scrollToTopButtonDomNodes??[])domNode.classList.add(this.options.selectors.scrollToTopScrollTopSettledStateClassName);this._onViewportMovesToTop();this.onViewportMovesToTop()}}/**
221
+ * This method triggers after the window is loaded.
222
+ * @returns Promise resolving to nothing when loading cover has been
223
+ * removed.
224
+ */async _removeLoadingCover(){await __WEBPACK_EXTERNAL_MODULE_clientnode_timeout__(this.options.additionalPageLoadingTimeInMilliseconds);// Hide startup animation dom nodes to show them step by step.
225
+ for(const domNode of this.hostDomNode.querySelectorAll("[class^=\""+`${this.options.selectors.startUpAnimationClassPrefix}"], `+"[class*=\" "+`${this.options.selectors.startUpAnimationClassPrefix}"]`))domNode.style.opacity="0";if(this.windowLoadingCoverDomNode)await __WEBPACK_EXTERNAL_MODULE_clientnode_fadeOut__(this.windowLoadingCoverDomNode)}/**
226
+ * This method handles the given startup effect step.
227
+ * @returns Promise resolving to nothing when startup effects have been
228
+ * finished.
229
+ */async _performStartUpEffects(){const animationPromises=[];let elementNumber=1;// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
230
+ while(true){const domNodesToAnimate=this.hostDomNode.querySelectorAll("."+this.options.selectors.startUpAnimationClassPrefix+String(elementNumber));if(domNodesToAnimate.length===0){await Promise.all(animationPromises);this.startUpAnimationIsComplete=true;this.onStartUpAnimationComplete();break}await __WEBPACK_EXTERNAL_MODULE_clientnode_timeout__(this.options.startUpAnimationElementDelayInMilliseconds);for(const domNode of domNodesToAnimate){domNode.style.removeProperty("opacity");const handler=__WEBPACK_EXTERNAL_MODULE_clientnode_fadeIn__(domNode);animationPromises.push(handler.then(()=>{handler.resetStyles()}))}elementNumber+=1}}/**
231
+ * This method adds triggers to switch the section.
232
+ */_bindNavigationEvents(){if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window)this.addSecureEventListener(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.window,"hashchange",event=>{if(this.startUpAnimationIsComplete){const newSectionNameCandidate=location.hash.substring("#".length);void this.switchSection(newSectionNameCandidate,event)}});this._bindScrollToTopButton()}/**
233
+ * Adds trigger to scroll top buttons.
234
+ */_bindScrollToTopButton(){for(const domNode of this.scrollToTopButtonDomNodes||[])this.addSecureEventListener(domNode,"click",event=>{event.preventDefault();__WEBPACK_EXTERNAL_MODULE_clientnode_interruptableScrollTo__()})}/**
235
+ * Executes the page tracking code.
236
+ */_bindClickTracking(){if(this.options.tracking){for(const domNode of this.hostDomNode.querySelectorAll("a"))this.addSecureEventListener(domNode,"click",event=>{void this._onLinkClick(event)});for(const domNode of this.hostDomNode.querySelectorAll("button"))this.addSecureEventListener(domNode,"click",event=>{void this._onButtonClick(event)})}}/// endregion
237
+ // endregion
238
+ },_defineProperty(_WebsiteUtilities,"_name","WebsiteUtilities"),_defineProperty(_WebsiteUtilities,"_defaultOptions",{additionalPageLoadingTimeInMilliseconds:0,startUpAnimationElementDelayInMilliseconds:100,windowLoadedTimeoutAfterDocLoadedInMSec:2000,domain:"auto",sectionNames:{default:"",managed:["home"],unmanaged:[]},selectors:{windowLoadingCover:".wu-window-loading-cover",startUpAnimationClassPrefix:"wu-start-up-animation-number-",top:".wu-header",routerOutlet:".wu-router-outlet",scrollToTopButtons:".wu-scroll-to-top",scrollToTopScrollTopSettledStateClassName:"wu-top-settled",scrollToTopScrollUpStateClassName:"wu-scroll-up",scrollToTopScrollDownStateClassName:"wu-scroll-down",priorityNavigationClassName:"wu-priority-navigation",priorityNavigationOverflowOpenClassName:"wu-priority-navigation--overflow-open",priorityNavigationShowOverflowIndicatorClassName:"wu-priority-navigation--show-overflow-indicator",priorityNavigationOverflowResizingClassName:"wu-priority-navigation--resizing",activeNavigationItemClassName:"wu-priority-navigation__link--active",priorityNavigationListItemHideClassName:"wu-priority-navigation__list__item--hide",priorityNavigationOverflowIndicatorClassName:"wu-priority-navigation__list__overflow-indicator",priorityNavigationOverflowList:".wu-priority-navigation__overflow-list"},minimumNumberOfMenuItems:3,tracking:false}),_defineProperty(_WebsiteUtilities,"windowLoaded",false),_defineProperty(_WebsiteUtilities,"switchSectionLock",new __WEBPACK_EXTERNAL_MODULE_clientnode_Lock__),_WebsiteUtilities),_descriptor=_applyDecoratedDescriptor(_class.prototype,"options",[_dec],{configurable:true,enumerable:true,writable:true,initializer:function(){return{}}}),_descriptor2=_applyDecoratedDescriptor(_class.prototype,"onStartUpAnimationComplete",[_dec2],{configurable:true,enumerable:true,writable:true,initializer:function(){return __WEBPACK_EXTERNAL_MODULE_clientnode_NOOP__}}),_descriptor3=_applyDecoratedDescriptor(_class.prototype,"onSwitchSection",[_dec3],{configurable:true,enumerable:true,writable:true,initializer:function(){return __WEBPACK_EXTERNAL_MODULE_clientnode_NOOP__}}),_descriptor4=_applyDecoratedDescriptor(_class.prototype,"onViewportMovesAwayFromTop",[_dec4],{configurable:true,enumerable:true,writable:true,initializer:function(){return __WEBPACK_EXTERNAL_MODULE_clientnode_NOOP__}}),_descriptor5=_applyDecoratedDescriptor(_class.prototype,"onViewportMovesToTop",[_dec5],{configurable:true,enumerable:true,writable:true,initializer:function(){return __WEBPACK_EXTERNAL_MODULE_clientnode_NOOP__}}),_descriptor6=_applyDecoratedDescriptor(_class.prototype,"onUnfocusResponsiveMenu",[_dec6],{configurable:true,enumerable:true,writable:true,initializer:function(){return __WEBPACK_EXTERNAL_MODULE_clientnode_NOOP__}}),_descriptor7=_applyDecoratedDescriptor(_class.prototype,"onLoaded",[_dec7],{configurable:true,enumerable:true,writable:true,initializer:function(){return __WEBPACK_EXTERNAL_MODULE_clientnode_NOOP__}}),_descriptor8=_applyDecoratedDescriptor(_class.prototype,"onButtonClick",[_dec8],{configurable:true,enumerable:true,writable:true,initializer:function(){return function(_event){return Promise.resolve(undefined)}}}),_descriptor9=_applyDecoratedDescriptor(_class.prototype,"onSectionSwitch",[_dec9],{configurable:true,enumerable:true,writable:true,initializer:function(){return function(_sectionName,_oldSectionName,_event){return Promise.resolve(undefined)}}}),_descriptor0=_applyDecoratedDescriptor(_class.prototype,"onLinkClick",[_dec0],{configurable:true,enumerable:true,writable:true,initializer:function(){return function(_event){return Promise.resolve(undefined)}}}),_descriptor1=_applyDecoratedDescriptor(_class.prototype,"onTrack",[_dec1],{configurable:true,enumerable:true,writable:true,initializer:function(){return function(_item){return Promise.resolve(undefined)}}}),_class);// endregion
239
+ const api={component:WebsiteUtilities,register:(tagName=__WEBPACK_EXTERNAL_MODULE_clientnode_camelCaseToDelimited__(WebsiteUtilities._name))=>{customElements.define(tagName,WebsiteUtilities)}};/* harmony default export */ const index = (WebsiteUtilities);if(__WEBPACK_EXTERNAL_MODULE_clientnode_globalContext__.AUTO_DEFINE_WEBSITE_UTILITIES)api.register();
240
+ export { WebsiteUtilities, api, index as default, log };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "website-utilities",
3
- "version": "1.0.455",
3
+ "version": "1.0.456",
4
4
  "description": "extend your web app",
5
5
  "keywords": [
6
6
  "website",
@@ -32,6 +32,7 @@
32
32
  "_variables.scss"
33
33
  ],
34
34
  "bin": "deploy.js",
35
+ "type": "module",
35
36
  "repository": {
36
37
  "type": "git",
37
38
  "url": "https://github.com/thaibault/website-utilities"
@@ -60,49 +61,49 @@
60
61
  "watch": "weboptimizer build --watch"
61
62
  },
62
63
  "devDependencies": {
63
- "@babel/eslint-parser": "^7.29.7",
64
- "@babel/plugin-transform-proto-to-assign": "^7.29.7",
65
- "@babel/runtime": "^7.29.7",
64
+ "@babel/eslint-parser": "^8.0.1",
65
+ "@babel/plugin-transform-proto-to-assign": "^8.0.1",
66
+ "@babel/runtime": "^8.0.0",
66
67
  "@eslint/js": "^10.0.1",
67
68
  "@stylistic/eslint-plugin": "^5.10.0",
68
69
  "@types/ejs": "^3.1.5",
69
70
  "@types/html-minifier": "^4.0.6",
70
71
  "@types/jsdom": "^28.0.3",
71
- "@types/node": "^26.0.0",
72
+ "@types/node": "^26.1.1",
72
73
  "@types/webpack-env": "^1.18.8",
73
- "@typescript-eslint/eslint-plugin": "^8.62.0",
74
- "@typescript-eslint/parser": "^8.62.0",
74
+ "@typescript-eslint/eslint-plugin": "^8.65.0",
75
+ "@typescript-eslint/parser": "^8.65.0",
75
76
  "@webcomponents/webcomponentsjs": "^2.8.0",
76
77
  "bootstrap-icons": "^1.13.1",
77
- "clientnode": "^4.0.1427",
78
+ "clientnode": "^4.0.1469",
78
79
  "css-loader": "^7.1.4",
79
80
  "cssnano": "^8.0.2",
80
- "eslint": "^10.5.0",
81
+ "eslint": "^10.7.0",
81
82
  "eslint-config-google": "^0.14.0",
82
- "eslint-plugin-jsdoc": "^63.0.7",
83
+ "eslint-plugin-jsdoc": "^63.2.2",
83
84
  "jest": "^30.4.2",
84
85
  "jsdoc": "^4.0.5",
85
86
  "mini-css-extract-plugin": "^2.10.2",
86
- "postcss": "^8.5.15",
87
+ "postcss": "^8.5.22",
87
88
  "postcss-fontpath": "^1.0.0",
88
89
  "postcss-import": "^16.1.1",
89
90
  "postcss-loader": "^8.2.1",
90
- "postcss-preset-env": "^11.3.1",
91
+ "postcss-preset-env": "^11.3.2",
91
92
  "postcss-scss": "^4.0.9",
92
93
  "postcss-sprites": "^4.2.1",
93
94
  "postcss-url": "^10.1.4",
94
95
  "prop-types": "^15.8.1",
95
96
  "rimraf": "^6.1.3",
96
- "sass": "^1.101.0",
97
+ "sass": "^1.101.7",
97
98
  "sass-loader": "^17.0.0",
98
99
  "style-loader": "^4.0.0",
99
- "stylelint": "^17.13.0",
100
+ "stylelint": "^17.14.1",
100
101
  "stylelint-config-standard-scss": "^17.0.0",
101
- "typescript-eslint": "^8.62.0",
102
- "web-component-wrapper": "^0.0.602",
103
- "web-documentation": "^1.0.41",
104
- "weboptimizer": "^3.0.28",
105
- "webpack-dev-server": "^5.2.5"
102
+ "typescript-eslint": "^8.65.0",
103
+ "web-component-wrapper": "^0.0.605",
104
+ "web-documentation": "^1.0.42",
105
+ "weboptimizer": "^4.0.36",
106
+ "webpack-dev-server": "^6.0.0"
106
107
  },
107
108
  "peerDependencies": {
108
109
  "@babel/runtime": "*",
@@ -194,10 +195,6 @@
194
195
  }
195
196
  },
196
197
  "optimizer": {
197
- "babelMinify": {
198
- "#": "Avoids wrong this binding in some callbacks with class bound closure (e.g. in \"performStartUpEffects -> animate -> always\".",
199
- "module": null
200
- },
201
198
  "htmlMinifier": {
202
199
  "ignoreCustomComments": [
203
200
  {
@@ -250,14 +247,10 @@
250
247
  "javaScript": {
251
248
  "pattern": {
252
249
  "#": "This is how we can make our test artefact executable.",
253
- "__evaluate__": "`#!/usr/bin/env node\n// -*- coding: utf-8 -*-\n${self.generic.assetPattern.javaScript.pattern}{1}`"
250
+ "__evaluate__": "`#!/usr/bin/env node\n// -*- coding: utf-8 -*-\n{1}`"
254
251
  }
255
252
  }
256
253
  },
257
- "exportFormat": {
258
- "external": "commonjs2",
259
- "self": "commonjs2"
260
- },
261
254
  "generic": {
262
255
  "isWeb": false
263
256
  },
@@ -268,15 +261,17 @@
268
261
  },
269
262
  "module": {
270
263
  "optimizer": {
271
- "babelMinify": {
272
- "#": "To provide a logging output we need to exclude this feature.",
273
- "bundle": {
274
- "transform": {
275
- "removeConsole": false
264
+ "terser": {
265
+ "terserOptions": {
266
+ "compress": {
267
+ "#": "To provide a logging output we need to exclude this feature.",
268
+ "drop_console": {
269
+ "__evaluate__": "false"
270
+ },
271
+ "drop_debugger": {
272
+ "__evaluate__": "false"
273
+ }
276
274
  }
277
- },
278
- "module": {
279
- "removeConsole": false
280
275
  }
281
276
  }
282
277
  }