@sysce/stomp 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,236 +1,2 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["StompBoot"] = factory();
8
- else
9
- root["StompBoot"] = factory();
10
- })(self, () => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ "./src/Bootstrapper/SearchBuilder.js":
16
- /*!*******************************************!*\
17
- !*** ./src/Bootstrapper/SearchBuilder.js ***!
18
- \*******************************************/
19
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
20
-
21
- __webpack_require__.r(__webpack_exports__);
22
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23
- /* harmony export */ "default": () => (/* binding */ SearchBuilder)
24
- /* harmony export */ });
25
- const whitespace = /\s/;
26
- const http_s_protocol = /^https?:\/\//;
27
-
28
- class SearchBuilder {
29
- constructor(template) {
30
- this.template = String(template);
31
- }
32
- query(input) {
33
- input = String(input);
34
-
35
- if (input.match(http_s_protocol)) {
36
- return input;
37
- } else if (input.includes('.') && !input.match(whitespace)) {
38
- return `http://${input}`;
39
- } else {
40
- return this.template.replace('%s', encodeURIComponent(input));
41
- }
42
- }
43
- }
44
-
45
-
46
- /***/ }),
47
-
48
- /***/ "./src/LoggerConstants.js":
49
- /*!********************************!*\
50
- !*** ./src/LoggerConstants.js ***!
51
- \********************************/
52
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
53
-
54
- __webpack_require__.r(__webpack_exports__);
55
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
56
- /* harmony export */ "LOG_DEBUG": () => (/* binding */ LOG_DEBUG),
57
- /* harmony export */ "LOG_ERROR": () => (/* binding */ LOG_ERROR),
58
- /* harmony export */ "LOG_INFO": () => (/* binding */ LOG_INFO),
59
- /* harmony export */ "LOG_SILENT": () => (/* binding */ LOG_SILENT),
60
- /* harmony export */ "LOG_TRACE": () => (/* binding */ LOG_TRACE),
61
- /* harmony export */ "LOG_WARN": () => (/* binding */ LOG_WARN)
62
- /* harmony export */ });
63
- const LOG_TRACE = 0;
64
- const LOG_DEBUG = 1;
65
- const LOG_INFO = 2;
66
- const LOG_WARN = 3;
67
- const LOG_ERROR = 4;
68
- const LOG_SILENT = 5;
69
-
70
- /**
71
- * @typedef {LOG_TRACE|LOG_DEBUG|LOG_INFO|LOG_WARN|LOG_ERROR|LOG_SILENT} LOG_LEVELS
72
- */
73
-
74
-
75
- /***/ }),
76
-
77
- /***/ "./src/TOMPConstants.js":
78
- /*!******************************!*\
79
- !*** ./src/TOMPConstants.js ***!
80
- \******************************/
81
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
82
-
83
- __webpack_require__.r(__webpack_exports__);
84
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
85
- /* harmony export */ "CODEC_PLAIN": () => (/* binding */ CODEC_PLAIN),
86
- /* harmony export */ "CODEC_XOR": () => (/* binding */ CODEC_XOR)
87
- /* harmony export */ });
88
- const CODEC_PLAIN = 0;
89
- const CODEC_XOR = 1;
90
-
91
-
92
- /***/ })
93
-
94
- /******/ });
95
- /************************************************************************/
96
- /******/ // The module cache
97
- /******/ var __webpack_module_cache__ = {};
98
- /******/
99
- /******/ // The require function
100
- /******/ function __webpack_require__(moduleId) {
101
- /******/ // Check if module is in cache
102
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
103
- /******/ if (cachedModule !== undefined) {
104
- /******/ return cachedModule.exports;
105
- /******/ }
106
- /******/ // Create a new module (and put it into the cache)
107
- /******/ var module = __webpack_module_cache__[moduleId] = {
108
- /******/ // no module.id needed
109
- /******/ // no module.loaded needed
110
- /******/ exports: {}
111
- /******/ };
112
- /******/
113
- /******/ // Execute the module function
114
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
115
- /******/
116
- /******/ // Return the exports of the module
117
- /******/ return module.exports;
118
- /******/ }
119
- /******/
120
- /************************************************************************/
121
- /******/ /* webpack/runtime/define property getters */
122
- /******/ (() => {
123
- /******/ // define getter functions for harmony exports
124
- /******/ __webpack_require__.d = (exports, definition) => {
125
- /******/ for(var key in definition) {
126
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
127
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
128
- /******/ }
129
- /******/ }
130
- /******/ };
131
- /******/ })();
132
- /******/
133
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
134
- /******/ (() => {
135
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
136
- /******/ })();
137
- /******/
138
- /******/ /* webpack/runtime/make namespace object */
139
- /******/ (() => {
140
- /******/ // define __esModule on exports
141
- /******/ __webpack_require__.r = (exports) => {
142
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
143
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
144
- /******/ }
145
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
146
- /******/ };
147
- /******/ })();
148
- /******/
149
- /************************************************************************/
150
- var __webpack_exports__ = {};
151
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
152
- (() => {
153
- /*!******************************************!*\
154
- !*** ./src/Bootstrapper/Bootstrapper.js ***!
155
- \******************************************/
156
- __webpack_require__.r(__webpack_exports__);
157
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
158
- /* harmony export */ "default": () => (/* binding */ Bootstrapper)
159
- /* harmony export */ });
160
- /* harmony import */ var _SearchBuilder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchBuilder.js */ "./src/Bootstrapper/SearchBuilder.js");
161
- /* harmony import */ var _LoggerConstants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../LoggerConstants.js */ "./src/LoggerConstants.js");
162
- /* harmony import */ var _TOMPConstants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../TOMPConstants.js */ "./src/TOMPConstants.js");
163
-
164
-
165
-
166
-
167
- class Bootstrapper {
168
- static SearchBuilder = _SearchBuilder_js__WEBPACK_IMPORTED_MODULE_0__["default"];
169
- // expose constants
170
- static CODEC_XOR = _TOMPConstants_js__WEBPACK_IMPORTED_MODULE_2__.CODEC_XOR;
171
- static CODEC_PLAIN = _TOMPConstants_js__WEBPACK_IMPORTED_MODULE_2__.CODEC_PLAIN;
172
- static LOG_TRACE = _LoggerConstants_js__WEBPACK_IMPORTED_MODULE_1__.LOG_TRACE;
173
- static LOG_DEBUG = _LoggerConstants_js__WEBPACK_IMPORTED_MODULE_1__.LOG_DEBUG;
174
- static LOG_INFO = _LoggerConstants_js__WEBPACK_IMPORTED_MODULE_1__.LOG_INFO;
175
- static LOG_WARN = _LoggerConstants_js__WEBPACK_IMPORTED_MODULE_1__.LOG_WARN;
176
- static LOG_ERROR = _LoggerConstants_js__WEBPACK_IMPORTED_MODULE_1__.LOG_ERROR;
177
- static LOG_SILENT = _LoggerConstants_js__WEBPACK_IMPORTED_MODULE_1__.LOG_SILENT;
178
- constructor(config) {
179
- if (typeof config.directory !== 'string') {
180
- throw new TypeError(`Directory must be a string`);
181
- }
182
-
183
- this.config = config;
184
-
185
- this.ready = this.register();
186
- }
187
- async register() {
188
- if (!('serviceWorker' in navigator))
189
- throw new Error('Your browser does not support service workers.');
190
-
191
- /*for(let worker of await navigator.serviceWorker.getRegistrations()){
192
- await worker.unregister();
193
- }*/
194
-
195
- const url = `${this.config.directory}worker.js?config=${encodeURIComponent(
196
- JSON.stringify(this.config)
197
- )}`;
198
-
199
- this.worker = await navigator.serviceWorker.register(url, {
200
- scope: this.config.directory,
201
- updateViaCache: 'none',
202
- });
203
-
204
- await this.worker.update();
205
-
206
- if (this.config.loglevel <= _LoggerConstants_js__WEBPACK_IMPORTED_MODULE_1__.LOG_DEBUG) {
207
- console.debug('Registered the service worker.');
208
- }
209
- }
210
- #send(service, url) {
211
- return `${this.config.directory}process:${encodeURIComponent(
212
- service
213
- )}:${encodeURIComponent(url)}`;
214
- }
215
- html(url) {
216
- return this.#send('html', url);
217
- }
218
- css(url) {
219
- return this.#send('css', url);
220
- }
221
- js(url) {
222
- return this.#send('js', url);
223
- }
224
- binary(url) {
225
- return this.#send('binary', url);
226
- }
227
- }
228
-
229
- })();
230
-
231
- __webpack_exports__ = __webpack_exports__["default"];
232
- /******/ return __webpack_exports__;
233
- /******/ })()
234
- ;
235
- });
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StompBoot=e():t.StompBoot=e()}(self,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>s});const r=/\s/,o=/^https?:\/\//;class s{static SearchBuilder=class{constructor(t){this.template=String(t)}query(t){return(t=String(t)).match(o)?t:t.includes(".")&&!t.match(r)?`http://${t}`:this.template.replace("%s",encodeURIComponent(t))}};static CODEC_XOR=1;static CODEC_PLAIN=0;static LOG_TRACE=0;static LOG_DEBUG=1;static LOG_INFO=2;static LOG_WARN=3;static LOG_ERROR=4;static LOG_SILENT=5;constructor(t){if("string"!=typeof t.directory)throw new TypeError("Directory must be a string");this.config=t,this.ready=this.register()}async register(){if(!("serviceWorker"in navigator))throw new Error("Your browser does not support service workers.");const t=`${this.config.directory}worker.js?config=${encodeURIComponent(JSON.stringify(this.config))}`;this.worker=await navigator.serviceWorker.register(t,{scope:this.config.directory,updateViaCache:"none"}),await this.worker.update(),this.config.loglevel<=1&&console.debug("Registered the service worker.")}#t(t,e){return`${this.config.directory}process:${encodeURIComponent(t)}:${encodeURIComponent(e)}`}html(t){return this.#t("html",t)}css(t){return this.#t("css",t)}js(t){return this.#t("js",t)}binary(t){return this.#t("binary",t)}}return e.default})()));
236
2
  //# sourceMappingURL=bootstrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrapper.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;;;ACVA;AACA;;AAEe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ,oBAAoB,MAAM;AAC1B,IAAI;AACJ;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UClBA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACN+C;AAQhB;AAC8B;;AAE9C;AACf,wBAAwB,yDAAa;AACrC;AACA,oBAAoB,wDAAS;AAC7B,sBAAsB,0DAAW;AACjC,oBAAoB,0DAAS;AAC7B,oBAAoB,0DAAS;AAC7B,mBAAmB,yDAAQ;AAC3B,mBAAmB,yDAAQ;AAC3B,oBAAoB,0DAAS;AAC7B,qBAAqB,2DAAU;AAC/B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH,iBAAiB,sBAAsB,mBAAmB;AAC1D;AACA,IAAI;;AAEJ;AACA;AACA;AACA,GAAG;;AAEH;;AAEA,8BAA8B,0DAAS;AACvC;AACA;AACA;AACA;AACA,YAAY,sBAAsB,UAAU;AAC5C;AACA,IAAI,GAAG,wBAAwB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://StompBoot/webpack/universalModuleDefinition","webpack://StompBoot/./src/Bootstrapper/SearchBuilder.js","webpack://StompBoot/webpack/bootstrap","webpack://StompBoot/webpack/runtime/define property getters","webpack://StompBoot/webpack/runtime/hasOwnProperty shorthand","webpack://StompBoot/webpack/runtime/make namespace object","webpack://StompBoot/./src/Bootstrapper/Bootstrapper.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"StompBoot\"] = factory();\n\telse\n\t\troot[\"StompBoot\"] = factory();\n})(self, () => {\nreturn ","const whitespace = /\\s/;\nconst http_s_protocol = /^https?:\\/\\//;\n\nexport default class SearchBuilder {\n\tconstructor(template) {\n\t\tthis.template = String(template);\n\t}\n\tquery(input) {\n\t\tinput = String(input);\n\n\t\tif (input.match(http_s_protocol)) {\n\t\t\treturn input;\n\t\t} else if (input.includes('.') && !input.match(whitespace)) {\n\t\t\treturn `http://${input}`;\n\t\t} else {\n\t\t\treturn this.template.replace('%s', encodeURIComponent(input));\n\t\t}\n\t}\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import SearchBuilder from './SearchBuilder.js';\nimport {\n\tLOG_TRACE,\n\tLOG_DEBUG,\n\tLOG_INFO,\n\tLOG_WARN,\n\tLOG_ERROR,\n\tLOG_SILENT,\n} from '../LoggerConstants.js';\nimport { CODEC_PLAIN, CODEC_XOR } from '../TOMPConstants.js';\n\nexport default class Bootstrapper {\n\tstatic SearchBuilder = SearchBuilder;\n\t// expose constants\n\tstatic CODEC_XOR = CODEC_XOR;\n\tstatic CODEC_PLAIN = CODEC_PLAIN;\n\tstatic LOG_TRACE = LOG_TRACE;\n\tstatic LOG_DEBUG = LOG_DEBUG;\n\tstatic LOG_INFO = LOG_INFO;\n\tstatic LOG_WARN = LOG_WARN;\n\tstatic LOG_ERROR = LOG_ERROR;\n\tstatic LOG_SILENT = LOG_SILENT;\n\tconstructor(config) {\n\t\tif (typeof config.directory !== 'string') {\n\t\t\tthrow new TypeError(`Directory must be a string`);\n\t\t}\n\n\t\tthis.config = config;\n\n\t\tthis.ready = this.register();\n\t}\n\tasync register() {\n\t\tif (!('serviceWorker' in navigator))\n\t\t\tthrow new Error('Your browser does not support service workers.');\n\n\t\t/*for(let worker of await navigator.serviceWorker.getRegistrations()){\n\t\t\tawait worker.unregister();\n\t\t}*/\n\n\t\tconst url = `${this.config.directory}worker.js?config=${encodeURIComponent(\n\t\t\tJSON.stringify(this.config)\n\t\t)}`;\n\n\t\tthis.worker = await navigator.serviceWorker.register(url, {\n\t\t\tscope: this.config.directory,\n\t\t\tupdateViaCache: 'none',\n\t\t});\n\n\t\tawait this.worker.update();\n\n\t\tif (this.config.loglevel <= LOG_DEBUG) {\n\t\t\tconsole.debug('Registered the service worker.');\n\t\t}\n\t}\n\t#send(service, url) {\n\t\treturn `${this.config.directory}process:${encodeURIComponent(\n\t\t\tservice\n\t\t)}:${encodeURIComponent(url)}`;\n\t}\n\thtml(url) {\n\t\treturn this.#send('html', url);\n\t}\n\tcss(url) {\n\t\treturn this.#send('css', url);\n\t}\n\tjs(url) {\n\t\treturn this.#send('js', url);\n\t}\n\tbinary(url) {\n\t\treturn this.#send('binary', url);\n\t}\n}\n"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"bootstrapper.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,GACrB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,4BCAlF,MAAMI,EAAa,KACbC,EAAkB,eCUT,MAAMC,EACpBC,qBDTc,MACdC,YAAYC,GACXC,KAAKD,SAAWE,OAAOF,EACxB,CACAG,MAAMC,GAGL,OAFAA,EAAQF,OAAOE,IAELC,MAAMT,GACRQ,EACGA,EAAME,SAAS,OAASF,EAAMC,MAAMV,GACvC,UAAUS,IAEVH,KAAKD,SAASO,QAAQ,KAAMC,mBAAmBJ,GAExD,GCHAN,iBCbwB,EDcxBA,mBCf0B,EDgB1BA,iBEhBwB,EFiBxBA,iBEhBwB,EFiBxBA,gBEhBuB,EFiBvBA,gBEhBuB,EFiBvBA,iBEhBwB,EFiBxBA,kBEhByB,EFiBzBC,YAAYU,GACX,GAAgC,iBAArBA,EAAOC,UACjB,MAAM,IAAIC,UAAU,8BAGrBV,KAAKQ,OAASA,EAEdR,KAAKW,MAAQX,KAAKY,UACnB,CACAC,iBACC,KAAM,kBAAmBC,WACxB,MAAM,IAAIC,MAAM,kDAMjB,MAAMC,EAAM,GAAGhB,KAAKQ,OAAOC,6BAA6BF,mBACvDU,KAAKC,UAAUlB,KAAKQ,WAGrBR,KAAKmB,aAAeL,UAAUM,cAAcR,SAASI,EAAK,CACzDK,MAAOrB,KAAKQ,OAAOC,UACnBa,eAAgB,eAGXtB,KAAKmB,OAAOI,SAEdvB,KAAKQ,OAAOgB,UEjDO,GFkDtBC,QAAQC,MAAM,iCAEhB,CACA,GAAMC,EAASX,GACd,MAAO,GAAGhB,KAAKQ,OAAOC,oBAAoBF,mBACzCoB,MACIpB,mBAAmBS,IACzB,CACAY,KAAKZ,GACJ,OAAOhB,MAAK,EAAM,OAAQgB,EAC3B,CACAa,IAAIb,GACH,OAAOhB,MAAK,EAAM,MAAOgB,EAC1B,CACAc,GAAGd,GACF,OAAOhB,MAAK,EAAM,KAAMgB,EACzB,CACAe,OAAOf,GACN,OAAOhB,MAAK,EAAM,SAAUgB,EAC7B,E","sources":["webpack://StompBoot/webpack/universalModuleDefinition","webpack://StompBoot/webpack/bootstrap","webpack://StompBoot/webpack/runtime/define property getters","webpack://StompBoot/webpack/runtime/hasOwnProperty shorthand","webpack://StompBoot/./src/Bootstrapper/SearchBuilder.js","webpack://StompBoot/./src/Bootstrapper/Bootstrapper.js","webpack://StompBoot/./src/TOMPConstants.js","webpack://StompBoot/./src/LoggerConstants.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"StompBoot\"] = factory();\n\telse\n\t\troot[\"StompBoot\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const whitespace = /\\s/;\nconst http_s_protocol = /^https?:\\/\\//;\n\nexport default class SearchBuilder {\n\tconstructor(template) {\n\t\tthis.template = String(template);\n\t}\n\tquery(input) {\n\t\tinput = String(input);\n\n\t\tif (input.match(http_s_protocol)) {\n\t\t\treturn input;\n\t\t} else if (input.includes('.') && !input.match(whitespace)) {\n\t\t\treturn `http://${input}`;\n\t\t} else {\n\t\t\treturn this.template.replace('%s', encodeURIComponent(input));\n\t\t}\n\t}\n}\n","import SearchBuilder from './SearchBuilder.js';\nimport {\n\tLOG_TRACE,\n\tLOG_DEBUG,\n\tLOG_INFO,\n\tLOG_WARN,\n\tLOG_ERROR,\n\tLOG_SILENT,\n} from '../LoggerConstants.js';\nimport { CODEC_PLAIN, CODEC_XOR } from '../TOMPConstants.js';\n\nexport default class Bootstrapper {\n\tstatic SearchBuilder = SearchBuilder;\n\t// expose constants\n\tstatic CODEC_XOR = CODEC_XOR;\n\tstatic CODEC_PLAIN = CODEC_PLAIN;\n\tstatic LOG_TRACE = LOG_TRACE;\n\tstatic LOG_DEBUG = LOG_DEBUG;\n\tstatic LOG_INFO = LOG_INFO;\n\tstatic LOG_WARN = LOG_WARN;\n\tstatic LOG_ERROR = LOG_ERROR;\n\tstatic LOG_SILENT = LOG_SILENT;\n\tconstructor(config) {\n\t\tif (typeof config.directory !== 'string') {\n\t\t\tthrow new TypeError(`Directory must be a string`);\n\t\t}\n\n\t\tthis.config = config;\n\n\t\tthis.ready = this.register();\n\t}\n\tasync register() {\n\t\tif (!('serviceWorker' in navigator))\n\t\t\tthrow new Error('Your browser does not support service workers.');\n\n\t\t/*for(let worker of await navigator.serviceWorker.getRegistrations()){\n\t\t\tawait worker.unregister();\n\t\t}*/\n\n\t\tconst url = `${this.config.directory}worker.js?config=${encodeURIComponent(\n\t\t\tJSON.stringify(this.config)\n\t\t)}`;\n\n\t\tthis.worker = await navigator.serviceWorker.register(url, {\n\t\t\tscope: this.config.directory,\n\t\t\tupdateViaCache: 'none',\n\t\t});\n\n\t\tawait this.worker.update();\n\n\t\tif (this.config.loglevel <= LOG_DEBUG) {\n\t\t\tconsole.debug('Registered the service worker.');\n\t\t}\n\t}\n\t#send(service, url) {\n\t\treturn `${this.config.directory}process:${encodeURIComponent(\n\t\t\tservice\n\t\t)}:${encodeURIComponent(url)}`;\n\t}\n\thtml(url) {\n\t\treturn this.#send('html', url);\n\t}\n\tcss(url) {\n\t\treturn this.#send('css', url);\n\t}\n\tjs(url) {\n\t\treturn this.#send('js', url);\n\t}\n\tbinary(url) {\n\t\treturn this.#send('binary', url);\n\t}\n}\n","export const CODEC_PLAIN = 0;\nexport const CODEC_XOR = 1;\n","export const LOG_TRACE = 0;\nexport const LOG_DEBUG = 1;\nexport const LOG_INFO = 2;\nexport const LOG_WARN = 3;\nexport const LOG_ERROR = 4;\nexport const LOG_SILENT = 5;\n\n/**\n * @typedef {LOG_TRACE|LOG_DEBUG|LOG_INFO|LOG_WARN|LOG_ERROR|LOG_SILENT} LOG_LEVELS\n */\n"],"names":["root","factory","exports","module","define","amd","self","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","whitespace","http_s_protocol","Bootstrapper","static","constructor","template","this","String","query","input","match","includes","replace","encodeURIComponent","config","directory","TypeError","ready","register","async","navigator","Error","url","JSON","stringify","worker","serviceWorker","scope","updateViaCache","update","loglevel","console","debug","service","html","css","js","binary"],"sourceRoot":""}