mqtt 5.0.2 → 5.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.
- package/build/lib/connect/wx.js +1 -0
- package/build/lib/connect/wx.js.map +1 -1
- package/build/lib/is-browser.d.ts +2 -2
- package/build/lib/is-browser.js +2 -5
- package/build/lib/is-browser.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/dist/mqtt.js +4 -8
- package/dist/mqtt.min.js +1 -1
- package/package.json +1 -1
- package/src/lib/connect/wx.ts +1 -0
- package/src/lib/is-browser.ts +2 -10
package/build/lib/connect/wx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wx.js","sourceRoot":"","sources":["../../../src/lib/connect/wx.ts"],"names":[],"mappings":";;;;;AAEA,mCAA+B;AAC/B,qDAA2C;AAC3C,0DAAgD;AAIhD,IAAI,UAAe,CAAA;AACnB,IAAI,KAAgB,CAAA;AACpB,IAAI,MAAiB,CAAA;AAErB,SAAS,UAAU;IAClB,MAAM,MAAM,GAAG,IAAI,2BAAS,EAAE,CAAA;IAC9B,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QACzC,UAAU,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,KAAK,CAAC,MAAM;YAClB,OAAO;gBACN,IAAI,EAAE,CAAA;YACP,CAAC;YACD,IAAI,CAAC,MAAM;gBACV,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;YACxB,CAAC;SACD,CAAC,CAAA;IACH,CAAC,CAAA;IACD,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE;QACxB,UAAU,CAAC,KAAK,CAAC;YAChB,OAAO;gBACN,IAAI,EAAE,CAAA;YACP,CAAC;SACD,CAAC,CAAA;IACH,CAAC,CAAA;IAED,OAAO,MAAM,CAAA;AACd,CAAC;AAED,SAAS,cAAc,CAAC,IAAI;IAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QACnB,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAA;KAC3B;IACD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACf,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;KACf;IAED,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;KACnB;AACF,CAAC;AAED,SAAS,QAAQ,CAAC,IAAoB,EAAE,MAAkB;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IACvD,IAAI,GAAG,GAAG,GAAG,QAAQ,MAAM,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IACtD,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;QACvD,GAAG,GAAG,GAAG,QAAQ,MAAM,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;KAC/D;IACD,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,UAAU,EAAE;QAC9C,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;KAC5C;IACD,OAAO,GAAG,CAAA;AACX,CAAC;AAED,SAAS,gBAAgB;IACxB,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE;QACtB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QACzB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QACzB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACvB,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE;QAC5B,IAAI,EAAE,IAAI,EAAE,GAAG,GAAG,CAAA;QAElB,IAAI,IAAI,YAAY,WAAW;YAAE,IAAI,GAAG,eAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;YACpD,IAAI,GAAG,eAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACrC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE;QACvB,MAAM,CAAC,GAAG,EAAE,CAAA;QACZ,MAAM,CAAC,OAAO,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC1B,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;AACH,CAAC;AAED,MAAM,WAAW,GAAkB,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;IACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAA;IAE1C,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;KACnE;IAED,MAAM,oBAAoB,GACzB,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,IAAI,CAAC,eAAe,KAAK,CAAC;QACzD,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,MAAM,CAAA;IAEV,cAAc,CAAC,IAAI,CAAC,CAAA;IAEpB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAGlC,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC;QAC7B,GAAG;QACH,SAAS,EAAE,CAAC,oBAAoB,CAAC;KACjC,CAAC,CAAA;IAEF,KAAK,GAAG,UAAU,EAAE,CAAA;IACpB,MAAM,GAAG,mBAAS,CAAC,GAAG,EAAE,CAAA;IACxB,MAAM,CAAC,QAAQ,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QAC7B,UAAU,CAAC,KAAK,CAAC;YAChB,OAAO;gBACN,IAAI,EAAE;oBAAE,EAAE,CAAC,GAAG,CAAC,CAAA;YAChB,CAAC;SACD,CAAC,CAAA;IACH,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAA;IAGjC,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;QACrB,MAAM,CAAC,OAAO,GAAG,UAAU,CAAA;QAE3B,UAAU,CAAC,GAAG,EAAE;YACf,UAAU,CAAC,KAAK,CAAC;gBAChB,IAAI;oBAGH,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAA;gBAC7B,CAAC;aACD,CAAC,CAAA;QACH,CAAC,EAAE,CAAC,CAAC,CAAA;IACN,CAAC,CAAA;IAED,gBAAgB,EAAE,CAAA;IAElB,OAAO,MAAM,CAAA;AACd,CAAC,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"wx.js","sourceRoot":"","sources":["../../../src/lib/connect/wx.ts"],"names":[],"mappings":";;;;;AAEA,mCAA+B;AAC/B,qDAA2C;AAC3C,0DAAgD;AAIhD,IAAI,UAAe,CAAA;AACnB,IAAI,KAAgB,CAAA;AACpB,IAAI,MAAiB,CAAA;AAErB,SAAS,UAAU;IAClB,MAAM,MAAM,GAAG,IAAI,2BAAS,EAAE,CAAA;IAC9B,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QACzC,UAAU,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,KAAK,CAAC,MAAM;YAClB,OAAO;gBACN,IAAI,EAAE,CAAA;YACP,CAAC;YACD,IAAI,CAAC,MAAM;gBACV,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;YACxB,CAAC;SACD,CAAC,CAAA;IACH,CAAC,CAAA;IACD,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE;QACxB,UAAU,CAAC,KAAK,CAAC;YAChB,OAAO;gBACN,IAAI,EAAE,CAAA;YACP,CAAC;SACD,CAAC,CAAA;IACH,CAAC,CAAA;IAED,OAAO,MAAM,CAAA;AACd,CAAC;AAED,SAAS,cAAc,CAAC,IAAI;IAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QACnB,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAA;KAC3B;IACD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACf,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;KACf;IAED,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;KACnB;AACF,CAAC;AAED,SAAS,QAAQ,CAAC,IAAoB,EAAE,MAAkB;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IACvD,IAAI,GAAG,GAAG,GAAG,QAAQ,MAAM,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IACtD,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;QACvD,GAAG,GAAG,GAAG,QAAQ,MAAM,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;KAC/D;IACD,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,UAAU,EAAE;QAC9C,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;KAC5C;IACD,OAAO,GAAG,CAAA;AACX,CAAC;AAED,SAAS,gBAAgB;IACxB,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE;QACtB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QACzB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;QACzB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACvB,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE;QAC5B,IAAI,EAAE,IAAI,EAAE,GAAG,GAAG,CAAA;QAElB,IAAI,IAAI,YAAY,WAAW;YAAE,IAAI,GAAG,eAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;YACpD,IAAI,GAAG,eAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACrC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACpB,MAAM,CAAC,GAAG,EAAE,CAAA;QACZ,MAAM,CAAC,OAAO,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC1B,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;AACH,CAAC;AAED,MAAM,WAAW,GAAkB,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;IACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAA;IAE1C,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;KACnE;IAED,MAAM,oBAAoB,GACzB,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,IAAI,CAAC,eAAe,KAAK,CAAC;QACzD,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,MAAM,CAAA;IAEV,cAAc,CAAC,IAAI,CAAC,CAAA;IAEpB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAGlC,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC;QAC7B,GAAG;QACH,SAAS,EAAE,CAAC,oBAAoB,CAAC;KACjC,CAAC,CAAA;IAEF,KAAK,GAAG,UAAU,EAAE,CAAA;IACpB,MAAM,GAAG,mBAAS,CAAC,GAAG,EAAE,CAAA;IACxB,MAAM,CAAC,QAAQ,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QAC7B,UAAU,CAAC,KAAK,CAAC;YAChB,OAAO;gBACN,IAAI,EAAE;oBAAE,EAAE,CAAC,GAAG,CAAC,CAAA;YAChB,CAAC;SACD,CAAC,CAAA;IACH,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAA;IAGjC,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE;QACrB,MAAM,CAAC,OAAO,GAAG,UAAU,CAAA;QAE3B,UAAU,CAAC,GAAG,EAAE;YACf,UAAU,CAAC,KAAK,CAAC;gBAChB,IAAI;oBAGH,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC,CAAA;gBAC7B,CAAC;aACD,CAAC,CAAA;QACH,CAAC,EAAE,CAAC,CAAC,CAAA;IACN,CAAC,CAAA;IAED,gBAAgB,EAAE,CAAA;IAElB,OAAO,MAAM,CAAA;AACd,CAAC,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const isBrowser: boolean;
|
|
2
|
+
export default isBrowser;
|
package/build/lib/is-browser.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
6
|
-
const IS_BROWSER = isBrowser || legacyIsBrowser;
|
|
7
|
-
exports.default = IS_BROWSER;
|
|
3
|
+
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
4
|
+
exports.default = isBrowser;
|
|
8
5
|
//# sourceMappingURL=is-browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-browser.js","sourceRoot":"","sources":["../../src/lib/is-browser.ts"],"names":[],"mappings":";;AAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"is-browser.js","sourceRoot":"","sources":["../../src/lib/is-browser.ts"],"names":[],"mappings":";;AAAA,MAAM,SAAS,GACd,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,CAAA;AAExE,kBAAe,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../src/lib/topic-alias-recv.ts","../node_modules/mqtt-packet/types/index.d.ts","../src/lib/default-message-id-provider.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/readable-stream/node_modules/safe-buffer/index.d.ts","../node_modules/@types/readable-stream/index.d.ts","../src/lib/validations.ts","../src/lib/shared.ts","../src/lib/store.ts","../src/lib/handlers/publish.ts","../src/lib/handlers/ack.ts","../src/lib/handlers/auth.ts","../node_modules/lru-cache/index.d.ts","../node_modules/number-allocator/types/lib/number-allocator.d.ts","../node_modules/number-allocator/types/index.d.ts","../src/lib/topic-alias-send.ts","../src/lib/handlers/connack.ts","../src/lib/handlers/pubrel.ts","../src/lib/handlers/index.ts","../node_modules/@types/ws/index.d.ts","../src/lib/TypedEmitter.ts","../src/lib/client.ts","../src/lib/unique-message-id-provider.ts","../src/lib/is-browser.ts","../src/lib/connect/index.ts","../src/mqtt.ts","../node_modules/@types/minimist/index.d.ts","../src/bin/pub.ts","../src/bin/sub.ts","../src/bin/mqtt.ts","../node_modules/buffer/index.d.ts","../node_modules/@types/duplexify/index.d.ts","../src/lib/connect/ali.ts","../src/lib/connect/tcp.ts","../src/lib/connect/tls.ts","../src/lib/connect/ws.ts","../src/lib/connect/wx.ts","../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"c5c5565225fce2ede835725a92a28ece149f83542aa4866cfb10290bff7b8996","affectsGlobalScope":true},{"version":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"994c234848afc14a2586b6565777f4c0b05dc479ede0a041bfd5becf6dceb586",{"version":"74a1b1b51145ec6b12aa832439549e5fb574f55cb02d1110083d58503ffa9ddc","signature":"d9e01bc3c8435835b8fccab53fa802278abee8442a81ecc7d467516d0fb8c3a3"},"21385c60d09c0f91daa4137f5865a0652cd4fd67a257870a69acf1b71088d524",{"version":"57eaacc58f9b4bb35309912a825b3e29dd7ee179011cf97915bfb32d2eb5ae4b","signature":"fe7a0a744b32b5ece036d9964d9f13bbd49b41f1acb88ec52581855e05fb81f0"},"587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"c81c51f43e343b6d89114b17341fb9d381c4ccbb25e0ee77532376052c801ba7","affectsGlobalScope":true},"db71be322f07f769200108aa19b79a75dd19a187c9dca2a30c4537b233aa2863","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","f302f3a47d7758f67f2afc753b9375d6504dde05d2e6ecdb1df50abbb131fc89","3690133deae19c8127c5505fcb67b04bdc9eb053796008538a9b9abbb70d85aa","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"8d74c73e21579ffe9f77ce969bc0317470c63797bd4719c8895a60ce6ae6a263","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","765f9f91293be0c057d5bf2b59494e1eac70efae55ff1c27c6e47c359bc889d2","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","3122a3f1136508a27a229e0e4e2848299028300ffa11d0cdfe99df90c492fe20","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"ac0c77cd7db52b3c278bdd1452ce754014835493d05b84535f46854fdc2063b2","affectsGlobalScope":true},"b9f36877501f2ce0e276e993c93cd2cf325e78d0409ec4612b1eb9d6a537e60b","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"14a50dafe3f45713f7f27cb6320dff07c6ac31678f07959c2134260061bf91ff","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","c58642af30c06a8e250d248a747ceb045af9a92d8cab22478d80c3bef276bfd5","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270",{"version":"ffc62d73b4fa10ca8c59f8802df88efefe447025730a24ee977b60adedc5bf37","affectsGlobalScope":true},{"version":"ab294c4b7279318ee2a8fdf681305457ecc05970c94108d304933f18823eeac1","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","5bc85813bfcb6907cc3a960fec8734a29d7884e0e372515147720c5991b8bc22","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"4d06f3abc2a6aae86f1be39e397372f74fb6e7964f594d645926b4a3419cc15d","affectsGlobalScope":true},{"version":"0e08c360c9b5961ecb0537b703e253842b3ded53151ee07024148219b61a8baf","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"ebf3434b09c527078aa74139ff367fffa64fea32a01d6c06fb0a69b0ecadf43e","5e379df3d61561c2ed7789b5995b9ba2143bbba21a905e2381e16efe7d1fa424","c33c6ada92264087ca6e22eae1a9c2ab41b7c5a3cb32a7cbde4c9ef77169a443",{"version":"a304eeb4af7da6e42add80ea0d05a26f18381a77425d4ab64c68d67a4a163e4a","signature":"d362c467594726a6b77d3b909cb03461910dfd1349eb120d7bc7ea2db527029c"},{"version":"e961916b7eed640fc84ad71dd8ddd1fcbe89d9dc52c5c214ed05dd3e5b16407a","signature":"32acbdf5d2185150cb799043b3b6a45e6a535c0cc7cc779f1d708171a684da1a"},{"version":"78e1ea2cf544a7fed421464517cf18f26faf02f129fda929a0bd7d17261d9d6b","signature":"f7e5c2d8eab74862142be9976d1ea8bd9e41f5b159db0c29ef2fb021643af89f"},{"version":"77bc6034b2354d71fef5d4525d99f9dde4c8d54669cfeaaa71488c256ca5671e","signature":"fab1462b8f80ab59f8a819561c73d0a628be020b6eef0290459733ad2df48083"},{"version":"7c0afb97be886c87df27bd34f3953262f6ceb27d5ffeebad44b52eceb6c56c88","signature":"601f6fdb2ac7a40b1992f1ca626cfa9e25cd9346b07faae53e86852a57ef9c92"},{"version":"ea2bc8b49612a14dcd4cb6f0c4c426dc6134dbca946eeb228b842a9b44495b01","signature":"2fc124af69825e5fe5493144975ade76595c02b625807f080e6aebb89a3ed8aa"},"69fad132b41289d40e3d373ad0ef1065cbae26c78f11d2f1aa574a3eb9b7cb7e","6e38c29a10b721dd13135e12b36cb6ddf7235184309a4ca2ca55840ff788e801","205829fd4cf42685af09c55f45ba58fa5a58072befadb63d5f4700382a596857",{"version":"859a6800868d032d5d22f16490c60308d36ffb71342e429b1e526bf681df5161","signature":"3fa6f0bf95bc927ca8b131232aa7efbf0cad0a8009ca0f7a8771375b45dc7868"},{"version":"67e6236911082a4ca2b128942c082f7b7b856f7dbbaed6526a5977e427d89ed2","signature":"b390116b99d4511f668e82188377a80bd6866e925517b22a5336ece35117a14c"},{"version":"1a731e747e0591a729641ff3d295e7fe30e8318e3d0a34c24d6e2b3bbae46c5d","signature":"531fe22704e1df7d98d548c37cce7e112171763d210cbfd6bb57164f07a63b5c"},{"version":"5c36aae8b9ec0cf77e61ff6e837c9889af413ff3106969c1f5351b87dee86ff2","signature":"68e517185e7057ed4b04d1e5f6304d2b7277fd3f2ee663dfd3fd5c829a429913"},"2dd1d4cea14cead7a7fc9eec8f40593089dff0de8c0199458446143c9b8c4ea9",{"version":"a282fab378e7953cab1e980b22474f5443b1b80c75b91227d489391b56524b60","signature":"3bcbb2abd2775c7784d8f91f2232b5b7e2b30fbff73f05d13d2c9e2543bb437e"},{"version":"d6e1753770440f19f674120a45524affb669b6e6b46ff2f82d56bca75985d167","signature":"78bbf6afa92d197dc286ed1f7be67d4a00d6f742791ab88de7713d04842bd677"},{"version":"dca75a24fea525c9af400001408947306b4dbdc72e1059845e77d886428b734d","signature":"1aa4ababe2598a733d1ce94cca92bae9c43da13413046eb455dcc10fbf959414"},{"version":"67eadbd719a5daf8c944e2b1365ad82dd938dcd7e5ad520c2a8828c49df7f3f3","signature":"a22f9d4546a6d5400a5eac503aa2f7806a717dae85ff9079002e4ae72b18f452"},{"version":"d335e4ed3057ce819c785ab13141f7817895a6ab5902b42a8eb22294b93b4ca4","signature":"0e52db4b6080295052bd4f6224a7563d5f86b134e0e3e6e0da60f79181c64f7e"},{"version":"1b265a58e07603f9de7385bb250566bc395cc6260f767cf9fbe7f508ec5b59d8","signature":"b69eba6664b53e2c965e4b504bf06f2d752b099f85122f6e45cd2f18fb23dbc9"},"209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05",{"version":"05625025a45feda496e63076351d8621f7eeb709c585da1f61435b53b2dc356f","signature":"65a9f45dd5303d2ac9cd544e648d10e63df21adbdf0b63d1941e478ea50ddd45"},{"version":"029118852bebe63c6fd380e34e0855d4f356efdee346b4337acf54daeb4ff571","signature":"65a9f45dd5303d2ac9cd544e648d10e63df21adbdf0b63d1941e478ea50ddd45"},{"version":"d1594aae5064c6116c4ebd8091f122d9de1331eed4f5a2a4be892b54435dcfeb","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},"818f832a8e29ca7e128dcde810a9ff8cbc3754010474e29fff0a5ed95adae032","a70fd46ef73cf2d0b2d20578091d2ab7d41781866cd2ecc0ceca17a9c399c195",{"version":"6e8b204e701e028ec34bc44a7f8b9ec74bf7a3fab311e433938725e181c9a351","signature":"131f74ecc6f4866c4d5fae52c5ff2fb850d3240d9323b50dc1665910bccab607"},{"version":"99d3f6029327600c72ad8d3261096a5f4f5e3cb481732f411e4389213ecbed45","signature":"131f74ecc6f4866c4d5fae52c5ff2fb850d3240d9323b50dc1665910bccab607"},{"version":"b0d4a12e33ba9c4edc7ad162b1c35f221d4c47c2a1526c2c11f776b6f0494ff8","signature":"131f74ecc6f4866c4d5fae52c5ff2fb850d3240d9323b50dc1665910bccab607"},{"version":"fc209758c3c9ea5060f53ebb78c0b0296ab91087cb4593196d953837381f7b0d","signature":"1c1fff0ed17bd032eea18bac39ff67036d1cded872deef808b52ba2dac839d69"},{"version":"9ef54afccad7ca545a0eba2a724d0e1f80c1e155ee5f74d34e6c8631c93000b5","signature":"131f74ecc6f4866c4d5fae52c5ff2fb850d3240d9323b50dc1665910bccab607"},{"version":"677646e2620795c98a539fb12fb531f10331c217cef1492132b2518f894fa92d","affectsGlobalScope":true}],"root":[49,51,[108,113],[117,120],[122,127],[129,131],[134,138]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"target":4},"fileIdsList":[[86,98,105],[98],[52,98],[55,98],[56,61,89,98],[57,68,69,76,86,97,98],[57,58,68,76,98],[59,98],[60,61,69,77,98],[61,86,94,98],[62,64,68,76,98],[63,98],[64,65,98],[68,98],[66,68,98],[68,69,70,86,97,98],[68,69,70,83,86,89,98],[98,102],[64,68,71,76,86,97,98],[68,69,71,72,76,86,94,97,98],[71,73,86,94,97,98],[52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],[68,74,98],[75,97,98],[64,68,76,86,98],[77,98],[78,98],[55,79,98],[80,96,98,102],[81,98],[82,98],[68,83,84,98],[83,85,98,100],[56,68,86,87,88,89,98],[56,86,88,98],[86,87,98],[89,98],[90,98],[86,98],[68,92,93,98],[92,93,98],[61,76,86,94,98],[95,98],[76,96,98],[56,71,82,97,98],[61,98],[86,98,99],[98,100],[98,101],[56,61,68,70,79,86,97,98,100,102],[86,98,103],[98,105,106],[68,71,73,86,94,97,98,103,105],[98,115],[78,98,129,130],[69,78,86,98,107,123,127,128],[69,78,98,123,127,128],[68,98,109],[49,50,51,71,98,107,108,109,110,117,120,121,122],[56,98,107,109,123,133],[97,98,109,123,125],[76,98,107,109],[76,94,98,109],[56,98,107,109,121,123,125,133],[98,109],[50,98,109,112],[50,98,109,112,117],[98,109,111,112,113,118,119],[50,98,109],[50,86,98,123],[50,98,107,109],[98,114,116],[51,98,116],[51,98,109,110,112,123,124,126],[50,51,71,107,109,110,121,122],[109],[123],[50,86,123],[50,107,109],[51],[51,109,110,112,123,124,126]],"referencedMap":[[133,1],[128,2],[139,2],[52,3],[53,3],[55,4],[56,5],[57,6],[58,7],[59,8],[60,9],[61,10],[62,11],[63,12],[64,13],[65,13],[67,14],[66,15],[68,14],[69,16],[70,17],[54,18],[104,2],[71,19],[72,20],[73,21],[105,22],[74,23],[75,24],[76,25],[77,26],[78,27],[79,28],[80,29],[81,30],[82,31],[83,32],[84,32],[85,33],[86,34],[88,35],[87,36],[89,37],[90,38],[91,39],[92,40],[93,41],[94,42],[95,43],[96,44],[97,45],[98,46],[99,47],[100,48],[101,49],[102,50],[103,51],[107,52],[106,2],[121,53],[132,2],[114,2],[50,2],[116,54],[115,2],[46,2],[47,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[48,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[1,2],[45,2],[11,2],[10,2],[131,55],[129,56],[130,57],[122,58],[123,59],[134,60],[126,61],[135,62],[136,63],[137,64],[138,60],[51,2],[112,65],[113,66],[118,67],[120,68],[111,69],[119,69],[125,2],[109,70],[110,71],[49,2],[117,72],[124,73],[108,2],[127,74]],"exportedModulesMap":[[133,1],[128,2],[139,2],[52,3],[53,3],[55,4],[56,5],[57,6],[58,7],[59,8],[60,9],[61,10],[62,11],[63,12],[64,13],[65,13],[67,14],[66,15],[68,14],[69,16],[70,17],[54,18],[104,2],[71,19],[72,20],[73,21],[105,22],[74,23],[75,24],[76,25],[77,26],[78,27],[79,28],[80,29],[81,30],[82,31],[83,32],[84,32],[85,33],[86,34],[88,35],[87,36],[89,37],[90,38],[91,39],[92,40],[93,41],[94,42],[95,43],[96,44],[97,45],[98,46],[99,47],[100,48],[101,49],[102,50],[103,51],[107,52],[106,2],[121,53],[132,2],[114,2],[50,2],[116,54],[115,2],[46,2],[47,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[48,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[1,2],[45,2],[11,2],[10,2],[123,75],[134,76],[126,77],[135,76],[136,76],[137,76],[138,76],[112,76],[113,76],[118,76],[120,76],[111,76],[119,76],[109,78],[110,79],[124,80],[127,81]],"semanticDiagnosticsPerFile":[133,128,139,52,53,55,56,57,58,59,60,61,62,63,64,65,67,66,68,69,70,54,104,71,72,73,105,74,75,76,77,78,79,80,81,82,83,84,85,86,88,87,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,107,106,121,132,114,50,116,115,46,47,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,48,25,22,23,24,26,27,28,5,29,30,31,32,6,36,33,34,35,37,7,38,43,44,39,40,41,42,1,45,11,10,131,129,130,122,123,134,126,135,136,137,138,51,112,113,118,120,111,119,125,109,110,49,117,124,108,127]},"version":"5.1.6"}
|
|
1
|
+
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../src/lib/topic-alias-recv.ts","../node_modules/mqtt-packet/types/index.d.ts","../src/lib/default-message-id-provider.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/readable-stream/node_modules/safe-buffer/index.d.ts","../node_modules/@types/readable-stream/index.d.ts","../src/lib/validations.ts","../src/lib/shared.ts","../src/lib/store.ts","../src/lib/handlers/publish.ts","../src/lib/handlers/ack.ts","../src/lib/handlers/auth.ts","../node_modules/lru-cache/index.d.ts","../node_modules/number-allocator/types/lib/number-allocator.d.ts","../node_modules/number-allocator/types/index.d.ts","../src/lib/topic-alias-send.ts","../src/lib/handlers/connack.ts","../src/lib/handlers/pubrel.ts","../src/lib/handlers/index.ts","../node_modules/@types/ws/index.d.ts","../src/lib/TypedEmitter.ts","../src/lib/client.ts","../src/lib/unique-message-id-provider.ts","../src/lib/is-browser.ts","../src/lib/connect/index.ts","../src/mqtt.ts","../node_modules/@types/minimist/index.d.ts","../src/bin/pub.ts","../src/bin/sub.ts","../src/bin/mqtt.ts","../node_modules/buffer/index.d.ts","../node_modules/@types/duplexify/index.d.ts","../src/lib/connect/ali.ts","../src/lib/connect/tcp.ts","../src/lib/connect/tls.ts","../src/lib/connect/ws.ts","../src/lib/connect/wx.ts","../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"f59215c5f1d886b05395ee7aca73e0ac69ddfad2843aa88530e797879d511bad","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"3dda5344576193a4ae48b8d03f105c86f20b2f2aff0a1d1fd7935f5d68649654","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"c5c5565225fce2ede835725a92a28ece149f83542aa4866cfb10290bff7b8996","affectsGlobalScope":true},{"version":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","affectsGlobalScope":true},{"version":"9d9885c728913c1d16e0d2831b40341d6ad9a0ceecaabc55209b306ad9c736a5","affectsGlobalScope":true},{"version":"17bea081b9c0541f39dd1ae9bc8c78bdd561879a682e60e2f25f688c0ecab248","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"f06948deb2a51aae25184561c9640fb66afeddb34531a9212d011792b1d19e0a","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"994c234848afc14a2586b6565777f4c0b05dc479ede0a041bfd5becf6dceb586",{"version":"74a1b1b51145ec6b12aa832439549e5fb574f55cb02d1110083d58503ffa9ddc","signature":"d9e01bc3c8435835b8fccab53fa802278abee8442a81ecc7d467516d0fb8c3a3"},"21385c60d09c0f91daa4137f5865a0652cd4fd67a257870a69acf1b71088d524",{"version":"57eaacc58f9b4bb35309912a825b3e29dd7ee179011cf97915bfb32d2eb5ae4b","signature":"fe7a0a744b32b5ece036d9964d9f13bbd49b41f1acb88ec52581855e05fb81f0"},"587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"c81c51f43e343b6d89114b17341fb9d381c4ccbb25e0ee77532376052c801ba7","affectsGlobalScope":true},"db71be322f07f769200108aa19b79a75dd19a187c9dca2a30c4537b233aa2863","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","f302f3a47d7758f67f2afc753b9375d6504dde05d2e6ecdb1df50abbb131fc89","3690133deae19c8127c5505fcb67b04bdc9eb053796008538a9b9abbb70d85aa","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"8d74c73e21579ffe9f77ce969bc0317470c63797bd4719c8895a60ce6ae6a263","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","765f9f91293be0c057d5bf2b59494e1eac70efae55ff1c27c6e47c359bc889d2","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","3122a3f1136508a27a229e0e4e2848299028300ffa11d0cdfe99df90c492fe20","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"ac0c77cd7db52b3c278bdd1452ce754014835493d05b84535f46854fdc2063b2","affectsGlobalScope":true},"b9f36877501f2ce0e276e993c93cd2cf325e78d0409ec4612b1eb9d6a537e60b","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"14a50dafe3f45713f7f27cb6320dff07c6ac31678f07959c2134260061bf91ff","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","c58642af30c06a8e250d248a747ceb045af9a92d8cab22478d80c3bef276bfd5","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270",{"version":"ffc62d73b4fa10ca8c59f8802df88efefe447025730a24ee977b60adedc5bf37","affectsGlobalScope":true},{"version":"ab294c4b7279318ee2a8fdf681305457ecc05970c94108d304933f18823eeac1","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","5bc85813bfcb6907cc3a960fec8734a29d7884e0e372515147720c5991b8bc22","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"4d06f3abc2a6aae86f1be39e397372f74fb6e7964f594d645926b4a3419cc15d","affectsGlobalScope":true},{"version":"0e08c360c9b5961ecb0537b703e253842b3ded53151ee07024148219b61a8baf","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"ebf3434b09c527078aa74139ff367fffa64fea32a01d6c06fb0a69b0ecadf43e","5e379df3d61561c2ed7789b5995b9ba2143bbba21a905e2381e16efe7d1fa424","c33c6ada92264087ca6e22eae1a9c2ab41b7c5a3cb32a7cbde4c9ef77169a443",{"version":"a304eeb4af7da6e42add80ea0d05a26f18381a77425d4ab64c68d67a4a163e4a","signature":"d362c467594726a6b77d3b909cb03461910dfd1349eb120d7bc7ea2db527029c"},{"version":"e961916b7eed640fc84ad71dd8ddd1fcbe89d9dc52c5c214ed05dd3e5b16407a","signature":"32acbdf5d2185150cb799043b3b6a45e6a535c0cc7cc779f1d708171a684da1a"},{"version":"78e1ea2cf544a7fed421464517cf18f26faf02f129fda929a0bd7d17261d9d6b","signature":"f7e5c2d8eab74862142be9976d1ea8bd9e41f5b159db0c29ef2fb021643af89f"},{"version":"77bc6034b2354d71fef5d4525d99f9dde4c8d54669cfeaaa71488c256ca5671e","signature":"fab1462b8f80ab59f8a819561c73d0a628be020b6eef0290459733ad2df48083"},{"version":"7c0afb97be886c87df27bd34f3953262f6ceb27d5ffeebad44b52eceb6c56c88","signature":"601f6fdb2ac7a40b1992f1ca626cfa9e25cd9346b07faae53e86852a57ef9c92"},{"version":"ea2bc8b49612a14dcd4cb6f0c4c426dc6134dbca946eeb228b842a9b44495b01","signature":"2fc124af69825e5fe5493144975ade76595c02b625807f080e6aebb89a3ed8aa"},"69fad132b41289d40e3d373ad0ef1065cbae26c78f11d2f1aa574a3eb9b7cb7e","6e38c29a10b721dd13135e12b36cb6ddf7235184309a4ca2ca55840ff788e801","205829fd4cf42685af09c55f45ba58fa5a58072befadb63d5f4700382a596857",{"version":"859a6800868d032d5d22f16490c60308d36ffb71342e429b1e526bf681df5161","signature":"3fa6f0bf95bc927ca8b131232aa7efbf0cad0a8009ca0f7a8771375b45dc7868"},{"version":"67e6236911082a4ca2b128942c082f7b7b856f7dbbaed6526a5977e427d89ed2","signature":"b390116b99d4511f668e82188377a80bd6866e925517b22a5336ece35117a14c"},{"version":"1a731e747e0591a729641ff3d295e7fe30e8318e3d0a34c24d6e2b3bbae46c5d","signature":"531fe22704e1df7d98d548c37cce7e112171763d210cbfd6bb57164f07a63b5c"},{"version":"5c36aae8b9ec0cf77e61ff6e837c9889af413ff3106969c1f5351b87dee86ff2","signature":"68e517185e7057ed4b04d1e5f6304d2b7277fd3f2ee663dfd3fd5c829a429913"},"2dd1d4cea14cead7a7fc9eec8f40593089dff0de8c0199458446143c9b8c4ea9",{"version":"a282fab378e7953cab1e980b22474f5443b1b80c75b91227d489391b56524b60","signature":"3bcbb2abd2775c7784d8f91f2232b5b7e2b30fbff73f05d13d2c9e2543bb437e"},{"version":"d6e1753770440f19f674120a45524affb669b6e6b46ff2f82d56bca75985d167","signature":"78bbf6afa92d197dc286ed1f7be67d4a00d6f742791ab88de7713d04842bd677"},{"version":"dca75a24fea525c9af400001408947306b4dbdc72e1059845e77d886428b734d","signature":"1aa4ababe2598a733d1ce94cca92bae9c43da13413046eb455dcc10fbf959414"},{"version":"46e55af48e5a966386e4b0d66ddb180fc495196c1081ec4996c169941e5deddb","signature":"4b7cfe5da2cd52781aed3942adbc0b467c2549a220b45078a4df664982c62839"},{"version":"d335e4ed3057ce819c785ab13141f7817895a6ab5902b42a8eb22294b93b4ca4","signature":"0e52db4b6080295052bd4f6224a7563d5f86b134e0e3e6e0da60f79181c64f7e"},{"version":"1b265a58e07603f9de7385bb250566bc395cc6260f767cf9fbe7f508ec5b59d8","signature":"b69eba6664b53e2c965e4b504bf06f2d752b099f85122f6e45cd2f18fb23dbc9"},"209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05",{"version":"05625025a45feda496e63076351d8621f7eeb709c585da1f61435b53b2dc356f","signature":"65a9f45dd5303d2ac9cd544e648d10e63df21adbdf0b63d1941e478ea50ddd45"},{"version":"029118852bebe63c6fd380e34e0855d4f356efdee346b4337acf54daeb4ff571","signature":"65a9f45dd5303d2ac9cd544e648d10e63df21adbdf0b63d1941e478ea50ddd45"},{"version":"d1594aae5064c6116c4ebd8091f122d9de1331eed4f5a2a4be892b54435dcfeb","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},"818f832a8e29ca7e128dcde810a9ff8cbc3754010474e29fff0a5ed95adae032","a70fd46ef73cf2d0b2d20578091d2ab7d41781866cd2ecc0ceca17a9c399c195",{"version":"6e8b204e701e028ec34bc44a7f8b9ec74bf7a3fab311e433938725e181c9a351","signature":"131f74ecc6f4866c4d5fae52c5ff2fb850d3240d9323b50dc1665910bccab607"},{"version":"99d3f6029327600c72ad8d3261096a5f4f5e3cb481732f411e4389213ecbed45","signature":"131f74ecc6f4866c4d5fae52c5ff2fb850d3240d9323b50dc1665910bccab607"},{"version":"b0d4a12e33ba9c4edc7ad162b1c35f221d4c47c2a1526c2c11f776b6f0494ff8","signature":"131f74ecc6f4866c4d5fae52c5ff2fb850d3240d9323b50dc1665910bccab607"},{"version":"fc209758c3c9ea5060f53ebb78c0b0296ab91087cb4593196d953837381f7b0d","signature":"1c1fff0ed17bd032eea18bac39ff67036d1cded872deef808b52ba2dac839d69"},{"version":"d9b8c27fb5b1874fa2316d8a28f9df346688787ed40d15c28e93407c5737e2cc","signature":"131f74ecc6f4866c4d5fae52c5ff2fb850d3240d9323b50dc1665910bccab607"},{"version":"677646e2620795c98a539fb12fb531f10331c217cef1492132b2518f894fa92d","affectsGlobalScope":true}],"root":[49,51,[108,113],[117,120],[122,127],[129,131],[134,138]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"target":4},"fileIdsList":[[86,98,105],[98],[52,98],[55,98],[56,61,89,98],[57,68,69,76,86,97,98],[57,58,68,76,98],[59,98],[60,61,69,77,98],[61,86,94,98],[62,64,68,76,98],[63,98],[64,65,98],[68,98],[66,68,98],[68,69,70,86,97,98],[68,69,70,83,86,89,98],[98,102],[64,68,71,76,86,97,98],[68,69,71,72,76,86,94,97,98],[71,73,86,94,97,98],[52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],[68,74,98],[75,97,98],[64,68,76,86,98],[77,98],[78,98],[55,79,98],[80,96,98,102],[81,98],[82,98],[68,83,84,98],[83,85,98,100],[56,68,86,87,88,89,98],[56,86,88,98],[86,87,98],[89,98],[90,98],[86,98],[68,92,93,98],[92,93,98],[61,76,86,94,98],[95,98],[76,96,98],[56,71,82,97,98],[61,98],[86,98,99],[98,100],[98,101],[56,61,68,70,79,86,97,98,100,102],[86,98,103],[98,105,106],[68,71,73,86,94,97,98,103,105],[98,115],[78,98,129,130],[69,78,86,98,107,123,127,128],[69,78,98,123,127,128],[68,98,109],[49,50,51,71,98,107,108,109,110,117,120,121,122],[56,98,107,109,123,133],[97,98,109,123,125],[76,98,107,109],[76,94,98,109],[56,98,107,109,121,123,125,133],[98,109],[50,98,109,112],[50,98,109,112,117],[98,109,111,112,113,118,119],[50,98,109],[50,86,98,123],[50,98,107,109],[98,114,116],[51,98,116],[51,98,109,110,112,123,124,126],[50,51,71,107,109,110,121,122],[109],[123],[50,86,123],[50,107,109],[51],[51,109,110,112,123,124,126]],"referencedMap":[[133,1],[128,2],[139,2],[52,3],[53,3],[55,4],[56,5],[57,6],[58,7],[59,8],[60,9],[61,10],[62,11],[63,12],[64,13],[65,13],[67,14],[66,15],[68,14],[69,16],[70,17],[54,18],[104,2],[71,19],[72,20],[73,21],[105,22],[74,23],[75,24],[76,25],[77,26],[78,27],[79,28],[80,29],[81,30],[82,31],[83,32],[84,32],[85,33],[86,34],[88,35],[87,36],[89,37],[90,38],[91,39],[92,40],[93,41],[94,42],[95,43],[96,44],[97,45],[98,46],[99,47],[100,48],[101,49],[102,50],[103,51],[107,52],[106,2],[121,53],[132,2],[114,2],[50,2],[116,54],[115,2],[46,2],[47,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[48,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[1,2],[45,2],[11,2],[10,2],[131,55],[129,56],[130,57],[122,58],[123,59],[134,60],[126,61],[135,62],[136,63],[137,64],[138,60],[51,2],[112,65],[113,66],[118,67],[120,68],[111,69],[119,69],[125,2],[109,70],[110,71],[49,2],[117,72],[124,73],[108,2],[127,74]],"exportedModulesMap":[[133,1],[128,2],[139,2],[52,3],[53,3],[55,4],[56,5],[57,6],[58,7],[59,8],[60,9],[61,10],[62,11],[63,12],[64,13],[65,13],[67,14],[66,15],[68,14],[69,16],[70,17],[54,18],[104,2],[71,19],[72,20],[73,21],[105,22],[74,23],[75,24],[76,25],[77,26],[78,27],[79,28],[80,29],[81,30],[82,31],[83,32],[84,32],[85,33],[86,34],[88,35],[87,36],[89,37],[90,38],[91,39],[92,40],[93,41],[94,42],[95,43],[96,44],[97,45],[98,46],[99,47],[100,48],[101,49],[102,50],[103,51],[107,52],[106,2],[121,53],[132,2],[114,2],[50,2],[116,54],[115,2],[46,2],[47,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[48,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[1,2],[45,2],[11,2],[10,2],[123,75],[134,76],[126,77],[135,76],[136,76],[137,76],[138,76],[112,76],[113,76],[118,76],[120,76],[111,76],[119,76],[109,78],[110,79],[124,80],[127,81]],"semanticDiagnosticsPerFile":[133,128,139,52,53,55,56,57,58,59,60,61,62,63,64,65,67,66,68,69,70,54,104,71,72,73,105,74,75,76,77,78,79,80,81,82,83,84,85,86,88,87,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,107,106,121,132,114,50,116,115,46,47,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,48,25,22,23,24,26,27,28,5,29,30,31,32,6,36,33,34,35,37,7,38,43,44,39,40,41,42,1,45,11,10,131,129,130,122,123,134,126,135,136,137,138,51,112,113,118,120,111,119,125,109,110,49,117,124,108,127]},"version":"5.1.6"}
|
package/dist/mqtt.js
CHANGED
|
@@ -1845,6 +1845,7 @@ function bindEventHandler() {
|
|
|
1845
1845
|
proxy.push(data);
|
|
1846
1846
|
});
|
|
1847
1847
|
socketTask.onClose(() => {
|
|
1848
|
+
stream.emit('close');
|
|
1848
1849
|
stream.end();
|
|
1849
1850
|
stream.destroy();
|
|
1850
1851
|
});
|
|
@@ -2326,17 +2327,12 @@ const handlePubrel = (client, packet, done) => {
|
|
|
2326
2327
|
exports.default = handlePubrel;
|
|
2327
2328
|
|
|
2328
2329
|
},{}],16:[function(require,module,exports){
|
|
2329
|
-
(function (process){(function (){
|
|
2330
2330
|
"use strict";
|
|
2331
2331
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2334
|
-
const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
2335
|
-
const IS_BROWSER = isBrowser || legacyIsBrowser;
|
|
2336
|
-
exports.default = IS_BROWSER;
|
|
2332
|
+
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
2333
|
+
exports.default = isBrowser;
|
|
2337
2334
|
|
|
2338
|
-
}
|
|
2339
|
-
},{"_process":102}],17:[function(require,module,exports){
|
|
2335
|
+
},{}],17:[function(require,module,exports){
|
|
2340
2336
|
"use strict";
|
|
2341
2337
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2342
2338
|
exports.applyMixin = exports.ErrorWithReasonCode = void 0;
|
package/dist/mqtt.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).mqtt=e()}}((function(){return function e(t,r,n){function i(o,a){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.TypedEventEmitter=void 0;const i=n(e("events")),s=e("./shared");class o{}r.TypedEventEmitter=o,(0,s.applyMixin)(o,i.default)},{"./shared":17,events:49}],2:[function(e,t,r){(function(t,n){(function(){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const l=a(e("./topic-alias-recv")),u=a(e("mqtt-packet")),c=a(e("./default-message-id-provider")),h=e("readable-stream"),f=a(e("reinterval")),d=a(e("rfdc/default")),p=o(e("./validations")),b=a(e("debug")),g=a(e("./store")),m=a(e("./handlers")),y=e("./TypedEmitter"),_=t?t.nextTick:e=>{setTimeout(e,0)},w=n.setImmediate||((...e)=>{const t=e.shift();_((()=>{t(...e)}))}),v={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,writeCache:!0},S=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND","ETIMEDOUT"];class E extends y.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,t){super(),this.options=t||{};for(const e in v)void 0===this.options[e]?this.options[e]=v[e]:this.options[e]=t[e];this.log=this.options.log||(0,b.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: options.protocol",t.protocol),this.log("MqttClient :: options.protocolVersion",t.protocolVersion),this.log("MqttClient :: options.username",t.username),this.log("MqttClient :: options.keepalive",t.keepalive),this.log("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",t.properties?t.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof t.clientId?t.clientId:E.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(u.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new c.default:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new g.default,this.incomingStore=t.incomingStore||new g.default,this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.properties&&t.properties.topicAliasMaximum>0&&(t.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new l.default(t.properties.topicAliasMaximum)),this.on("connect",(()=>{const{queue:e}=this,t=()=>{const r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,(e=>{r.cb&&r.cb(e),t()})):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()})),this.on("close",(()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),null!==this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()})),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var e;const t=new h.Writable,r=u.default.parser(this.options);let n=null;const i=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",(e=>{this.log("parser :: on packet push to packets array."),i.push(e)}));const s=()=>{this.log("work :: getting next packet in queue");const e=i.shift();if(e)this.log("work :: packet pulled from queue"),(0,m.default)(this,e,o);else{this.log("work :: no packets in queue");const e=n;n=null,this.log("work :: done flag is %s",!!e),e&&e()}},o=()=>{if(i.length)_(s);else{const e=n;n=null,e()}};t._write=(e,t,i)=>{n=i,this.log("writable stream :: parsing buffer"),r.parse(e),s()};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(t),this.stream.on("error",(e=>{this.log("streamErrorHandler :: error",e.message),S.includes(e.code)?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)})),this.stream.on("close",(()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")})),this.log("connect: sending packet `connect`");const a={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(a.will=Object.assign(Object.assign({},this.options.will),{payload:null===(e=this.options.will)||void 0===e?void 0:e.payload})),this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(a),r.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end((()=>this.emit("error",new Error("Packet has no Authentication Method")))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){const e=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0)}),this.options.connectTimeout),this}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);const{options:i}=this;"function"==typeof r&&(n=r,r=null),r=r||{};r=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),r);const{qos:s,retain:o,dup:a,properties:l,cbStorePut:u}=r;if(this._checkDisconnecting(n))return this;const c=()=>{let r=0;if((1===s||2===s)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;const c={cmd:"publish",topic:e,payload:t,qos:s,retain:o,messageId:r,dup:a};switch(5===i.protocolVersion&&(c.properties=l),this.log("publish :: qos",s),s){case 1:case 2:this.outgoing[c.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,void 0,u);break;default:this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,n,u)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise(((n,i)=>{this.publish(e,t,r,(e=>{e?i(e):n()}))}))}subscribe(e,t,r){const n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,s=[];"string"==typeof e?s=e=[e]:Array.isArray(e)?s=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,s=Object.keys(e));const o=p.validateTopics(s);if(null!==o)return w(r,new Error(`Invalid topic ${o}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;const a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0);const l=(t=Object.assign(Object.assign({},a),t)).properties,u=[],c=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){const t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),u.push(t)}};if(Array.isArray(e)?e.forEach((e=>{this.log("subscribe: array topic %s",e),c(e)})):Object.keys(e).forEach((t=>{this.log("subscribe: object topic %s, %o",t,e[t]),c(t,e[t])})),!u.length)return r(null,[]),this;const h=()=>{const e=this._nextId();if(null===e)return this.log("No messageId left"),!1;const t={cmd:"subscribe",subscriptions:u,messageId:e};if(l&&(t.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");const e=[];u.forEach((t=>{if(this.options.reconnectPeriod>0){const r={qos:t.qos};5===n&&(r.nl=t.nl||!1,r.rap=t.rap||!1,r.rh=t.rh||0,r.properties=t.properties),this._resubscribeTopics[t.topic]=r,e.push(t.topic)}})),this.messageIdToTopic[t.messageId]=e}return this.outgoing[t.messageId]={volatile:!0,cb(e,t){if(!e){const{granted:e}=t;for(let t=0;t<e.length;t+=1)u[t].qos=e[t]}r(e,u)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(t),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!h())&&this._storeProcessingQueue.push({invoke:h,callback:r}),this}subscribeAsync(e,t){return new Promise(((r,n)=>{this.subscribe(e,t,((e,t)=>{e?n(e):r(t)}))}))}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;const n=p.validateTopics(e);if(null!==n)return w(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;const i=()=>{const n=this._nextId();if(null===n)return this.log("No messageId left"),!1;const i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach((e=>{delete this._resubscribeTopics[e]})),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise(((r,n)=>{this.unsubscribe(e,t,(e=>{e?n(e):r()}))}))}end(e,t,r){this.log("end :: (%s)",this.options.clientId),null!=e&&"boolean"==typeof e||(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),r&&"function"==typeof r||(r=this.noop);const n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close((e=>{this.outgoingStore.close((t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){const n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}}))})),this._deferredReconnect&&this._deferredReconnect()},i=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,(()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),_(n)}),t)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i()),this)}endAsync(e,t){return new Promise(((r,n)=>{this.end(e,t,(e=>{e?n(e):r()}))}))}removeOutgoingMessage(e){if(this.outgoing[e]){const{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,(()=>{t(new Error("Message removed"))}))}return this}reconnect(e){this.log("client reconnect");const t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach((e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])})))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach((e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])})))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(void 0===t)return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),void 0===r)return new Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end((()=>{this.connect()})),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval((()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()}),this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const e=Object.assign({cmd:"disconnect"},r);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,(()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),w((()=>{this.stream.end((()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)}))}))}))}this.disconnecting||(this.log("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,i=e;if("publish"===i.cmd&&(i=(0,d.default)(e),n=this._removeTopicAliasAndRecoverTopicName(i),n))return t&&t(n);this.outgoingStore.put(i,(n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)}))}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);const r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");const r=u.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;const i=this._applyTopicAlias(e);if(i)t(i);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,d.default)(e);const r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}const i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,(e=>{if(e)return t&&t(e);r()}))):t&&t(new Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=(0,f.default)((()=>{this._checkPing()}),1e3*this.options.keepalive))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){const r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;const t=()=>{let r=this.outgoingStore.createStream();const n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",(e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)}));const s=()=>{if(!r)return;const e=r.read(1);let t;e?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[e.messageId]?s():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(t=this.outgoing[e.messageId]?this.outgoing[e.messageId].cb:null,this.outgoing[e.messageId]={volatile:!1,cb(e,r){t&&t(e,r),s()}},this._packetIdsDuringStoreProcessing[e.messageId]=!0,this.messageIdProvider.register(e.messageId)?this._sendPacket(e,void 0,void 0,!0):this.log("messageId: %d has already used.",e.messageId))):r.once("readable",s)};r.on("end",(()=>{let r=!0;for(const e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}r?(i(),this.removeListener("close",n),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()})),s()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},((r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()}))}}r.default=E}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./TypedEmitter":1,"./default-message-id-provider":9,"./handlers":13,"./store":18,"./topic-alias-recv":19,"./validations":22,_process:102,debug:30,"mqtt-packet":75,"readable-stream":125,reinterval:131,"rfdc/default":132}],3:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=e("buffer"),s=e("readable-stream"),o=n(e("duplexify"));let a,l,u,c=!1;r.default=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const n=function(e,t){const r="alis"===e.protocol?"wss":"ws";let n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);return a=t.my,a.connectSocket({url:n,protocols:r}),l=function(){const e=new s.Transform;return e._write=(e,t,r)=>{a.sendSocketMessage({data:e.buffer,success(){r()},fail(){r(new Error)}})},e._flush=e=>{a.closeSocket({success(){e()}})},e}(),u=o.default.obj(),c||(c=!0,a.onSocketOpen((()=>{u.setReadable(l),u.setWritable(l),u.emit("connect")})),a.onSocketMessage((e=>{if("string"==typeof e.data){const t=i.Buffer.from(e.data,"base64");l.push(t)}else{const t=new FileReader;t.addEventListener("load",(()=>{let e=t.result;e=e instanceof ArrayBuffer?i.Buffer.from(e):i.Buffer.from(e,"utf8"),l.push(e)})),t.readAsArrayBuffer(e.data)}})),a.onSocketClose((()=>{u.end(),u.destroy()})),a.onSocketError((e=>{u.destroy(e)}))),u}},{buffer:29,duplexify:32,"readable-stream":125}],4:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.connectAsync=void 0;const i=n(e("debug")),s=n(e("url")),o=n(e("../client")),a=n(e("../is-browser")),l=(0,i.default)("mqttjs"),u={};function c(e,t){if(l("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=""),t=t||{},e&&"string"==typeof e){const r=s.default.parse(e,!0);if(null!=r.port&&(r.port=Number(r.port)),null===(t=Object.assign(Object.assign({},r),t)).protocol)throw new Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(function(e){let t;e.auth&&(t=e.auth.match(/^(.+):(.+)$/),t?(e.username=t[1],e.password=t[2]):e.username=e.auth)}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(!u[t.protocol]){const e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(((t,r)=>(!e||r%2!=0)&&"function"==typeof u[t]))[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);const r=new o.default((function(e){return t.servers&&(e._reconnectCount&&e._reconnectCount!==t.servers.length||(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),l("calling streambuilder for",t.protocol),u[t.protocol](e,t)}),t);return r.on("error",(()=>{})),r}a.default?(u.wx=e("./wx").default,u.wxs=e("./wx").default,u.ali=e("./ali").default,u.alis=e("./ali").default):(u.mqtt=e("./tcp").default,u.tcp=e("./tcp").default,u.ssl=e("./tls").default,u.tls=u.ssl,u.mqtts=e("./tls").default),u.ws=e("./ws").default,u.wss=e("./ws").default,r.connectAsync=function(e,t,r=!0){return new Promise(((n,i)=>{const s=c(e,t),o={connect:e=>{a(),n(s)},end:()=>{a(),n(s)},error:e=>{a(),s.end(),i(e)}};function a(){Object.keys(o).forEach((e=>{s.off(e,o[e])}))}!1===r&&(o.close=()=>{o.error(new Error("Couldn't connect to server"))}),Object.keys(o).forEach((e=>{s.on(e,o[e])}))}))},r.default=c},{"../client":2,"../is-browser":16,"./ali":3,"./tcp":5,"./tls":6,"./ws":7,"./wx":8,debug:30,url:137}],5:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(e("net")),s=(0,n(e("debug")).default)("mqttjs:tcp");r.default=(e,t)=>{t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost";const{port:r}=t,n=t.hostname;return s("port %d and host %s",r,n),i.default.createConnection(r,n)}},{debug:30,net:26}],6:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(e("tls")),s=n(e("net")),o=(0,n(e("debug")).default)("mqttjs:tls");r.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===s.default.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,o("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const r=i.default.connect(t);function n(n){t.rejectUnauthorized&&e.emit("error",n),r.end()}return r.on("secureConnect",(()=>{t.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",n)})),r.on("error",n),r}},{debug:30,net:26,tls:26}],7:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=e("buffer"),s=n(e("ws")),o=n(e("debug")),a=n(e("duplexify")),l=e("readable-stream"),u=n(e("../is-browser")),c=(0,o.default)("mqttjs:ws"),h=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function f(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function d(e){const t=e;return e.hostname||(t.hostname="localhost"),e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),u.default||"wss"!==e.protocol||h.forEach((r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])})),t}r.default=u.default?(e,t)=>{let r;c("browserStreamBuilder");const n=function(e){const t=d(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t),s=n.browserBufferSize||524288,o=t.browserBufferTimeout||1e3,u=!t.objectMode,h=function(e,t){const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",n=f(t,e),i=new WebSocket(n,[r]);return i.binaryType="arraybuffer",i}(e,t),p=function(e,t,r){const n=new l.Transform({objectMode:e.objectMode});return n._write=t,n._flush=r,n}(t,(function e(t,r,n){h.bufferedAmount>s&&setTimeout(e,o,t,r,n);u&&"string"==typeof t&&(t=i.Buffer.from(t,"utf8"));try{h.send(t)}catch(e){return n(e)}n()}),(function(e){h.close(),e()}));t.objectMode||(p._writev=w),p.on("close",(()=>{h.close()}));const b=void 0!==h.addEventListener;function g(){r.setReadable(p),r.setWritable(p),r.emit("connect")}function m(){r.end(),r.destroy()}function y(e){r.destroy(e)}function _(e){let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),p.push(t)}function w(e,t){const r=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?r[t]=i.Buffer.from(e[t],"utf8"):r[t]=e[t].chunk;this._write(i.Buffer.concat(r),"binary",t)}return h.readyState===h.OPEN?r=p:(r=(0,a.default)(void 0,void 0,t),t.objectMode||(r._writev=w),b?h.addEventListener("open",g):h.onopen=g),r.socket=h,b?(h.addEventListener("close",m),h.addEventListener("error",y),h.addEventListener("message",_)):(h.onclose=m,h.onerror=y,h.onmessage=_),r}:(e,t)=>{c("streamBuilder");const r=d(t),n=f(r,e),i=function(e,t,r){c("createWebSocket"),c(`protocol: ${r.protocolId} ${r.protocolVersion}`);const n="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return c(`creating new Websocket for url: ${t} and protocol: ${n}`),new s.default(t,[n],r.wsOptions)}(0,n,r),o=s.default.createWebSocketStream(i,r.wsOptions);return o.url=n,i.on("close",(()=>{o.destroy()})),o}},{"../is-browser":16,buffer:29,debug:30,duplexify:32,"readable-stream":125,ws:141}],8:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=e("buffer"),s=e("readable-stream"),o=n(e("duplexify"));let a,l,u;r.default=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const n=function(e,t){const r="wxs"===e.protocol?"wss":"ws";let n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);a=wx.connectSocket({url:n,protocols:[r]}),l=function(){const e=new s.Transform;return e._write=(e,t,r)=>{a.send({data:e.buffer,success(){r()},fail(e){r(new Error(e))}})},e._flush=e=>{a.close({success(){e()}})},e}(),u=o.default.obj(),u._destroy=(e,t)=>{a.close({success(){t&&t(e)}})};const c=u.destroy;return u.destroy=()=>{u.destroy=c,setTimeout((()=>{a.close({fail(){u._destroy(new Error)}})}),0)},a.onOpen((()=>{u.setReadable(l),u.setWritable(l),u.emit("connect")})),a.onMessage((e=>{let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),l.push(t)})),a.onClose((()=>{u.end(),u.destroy()})),a.onError((e=>{u.destroy(new Error(e.errMsg))})),u}},{buffer:29,duplexify:32,"readable-stream":125}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=class{constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}},{}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ReasonCodes=void 0,r.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};r.default=(e,t)=>{const{messageId:n}=t,i=t.cmd;let s=null;const o=e.outgoing[n]?e.outgoing[n].cb:null;let a;if(o){switch(e.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{const i=t.reasonCode;i&&i>0&&16!==i?(a=new Error(`Publish error: ${r.ReasonCodes[i]}`),a.code=i,e._removeOutgoingAndStoreMessage(n,(()=>{o(a,t)}))):e._removeOutgoingAndStoreMessage(n,o);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:n};const i=t.reasonCode;i&&i>0&&16!==i?(a=new Error(`Publish error: ${r.ReasonCodes[i]}`),a.code=i,e._removeOutgoingAndStoreMessage(n,(()=>{o(a,t)}))):e._sendPacket(s);break}case"suback":{delete e.outgoing[n],e.messageIdProvider.deallocate(n);const r=t.granted;for(let t=0;t<r.length;t++)if(0!=(128&r[t])){const t=e.messageIdToTopic[n];t&&t.forEach((t=>{delete e._resubscribeTopics[t]}))}delete e.messageIdToTopic[n],e._invokeStoreProcessingQueue(),o(null,t);break}case"unsuback":delete e.outgoing[n],e.messageIdProvider.deallocate(n),e._invokeStoreProcessingQueue(),o(null);break;default:e.emit("error",new Error("unrecognized packet type"))}e.disconnecting&&0===Object.keys(e.outgoing).length&&e.emit("outgoingEmpty")}else e.log("_handleAck :: Server sent an ack in error. Ignoring.")}},{}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../shared"),i=e("./ack");r.default=(e,t)=>{const{options:r}=e,s=r.protocolVersion,o=5===s?t.reasonCode:t.returnCode;if(5===s)e.handleAuth(t,((t,r)=>{if(t)e.emit("error",t);else if(24===o)e.reconnecting=!1,e._sendPacket(r);else{const t=new n.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[o]}`,o);e.emit("error",t)}}));else{const t=new n.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${s}`,o);e.emit("error",t)}}},{"../shared":17,"./ack":10}],12:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=e("./ack"),s=n(e("../topic-alias-send")),o=e("../shared");r.default=(e,t)=>{e.log("_handleConnack");const{options:r}=e,n=5===r.protocolVersion?t.reasonCode:t.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,t.properties){if(t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new s.default(t.properties.topicAliasMaximum))}t.properties.serverKeepAlive&&r.keepalive&&(r.keepalive=t.properties.serverKeepAlive,e._shiftPingInterval()),t.properties.maximumPacketSize&&(r.properties||(r.properties={}),r.properties.maximumPacketSize=t.properties.maximumPacketSize)}if(0===n)e.reconnecting=!1,e._onConnect(t);else if(n>0){const t=new o.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[n]}`,n);e.emit("error",t)}}},{"../shared":17,"../topic-alias-send":20,"./ack":10}],13:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(e("./publish")),s=n(e("./auth")),o=n(e("./connack")),a=n(e("./ack")),l=n(e("./pubrel"));r.default=(e,t,r)=>{const{options:n}=e;if(5===n.protocolVersion&&n.properties&&n.properties.maximumPacketSize&&n.properties.maximumPacketSize<t.length)return e.emit("error",new Error(`exceeding packets size ${t.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,i.default)(e,t,r);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,a.default)(e,t),r();break;case"pubrel":(0,l.default)(e,t,r);break;case"connack":(0,o.default)(e,t),r();break;case"auth":(0,s.default)(e,t),r();break;case"pingresp":e.pingResp=!0,r();break;case"disconnect":e.emit("disconnect",t),r();break;default:e.log("_handlePacket :: unknown command"),r()}}},{"./ack":10,"./auth":11,"./connack":12,"./publish":14,"./pubrel":15}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=[0,16,128,131,135,144,145,151,153];r.default=(e,t,r)=>{e.log("handlePublish: packet %o",t),r=void 0!==r?r:e.noop;let i=t.topic.toString();const s=t.payload,{qos:o}=t,{messageId:a}=t,{options:l}=e;if(5===e.options.protocolVersion){let r;if(t.properties&&(r=t.properties.topicAlias),void 0!==r)if(0===i.length){if(!(r>0&&r<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",r),void e.emit("error",new Error("Received Topic Alias is out of range"));{const t=e.topicAliasRecv.getTopicByAlias(r);if(!t)return e.log("handlePublish :: unregistered topic alias. alias: %d",r),void e.emit("error",new Error("Received unregistered Topic Alias"));i=t,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,r)}}else{if(!e.topicAliasRecv.put(i,r))return e.log("handlePublish :: topic alias out of range. alias: %d",r),void e.emit("error",new Error("Received Topic Alias is out of range"));e.log("handlePublish :: registered topic: %s - alias: %d",i,r)}}switch(e.log("handlePublish: qos %d",o),o){case 2:l.customHandleAcks(i,s,t,((i,s)=>("number"==typeof i&&(s=i,i=null),i?e.emit("error",i):-1===n.indexOf(s)?e.emit("error",new Error("Wrong reason code for pubrec")):void(s?e._sendPacket({cmd:"pubrec",messageId:a,reasonCode:s},r):e.incomingStore.put(t,(()=>{e._sendPacket({cmd:"pubrec",messageId:a},r)}))))));break;case 1:l.customHandleAcks(i,s,t,((o,l)=>("number"==typeof o&&(l=o,o=null),o?e.emit("error",o):-1===n.indexOf(l)?e.emit("error",new Error("Wrong reason code for puback")):(l||e.emit("message",i,s,t),void e.handleMessage(t,(t=>{if(t)return r&&r(t);e._sendPacket({cmd:"puback",messageId:a,reasonCode:l},r)}))))));break;case 0:e.emit("message",i,s,t),e.handleMessage(t,r);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}},{}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=(e,t,r)=>{e.log("handling pubrel packet");const n=void 0!==r?r:e.noop,{messageId:i}=t,s={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,((t,r)=>{t?e._sendPacket(s,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,(t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._sendPacket(s,n)})))}))}},{}],16:[function(e,t,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const t=void 0!==e&&"browser"===e.title||"function"==typeof __webpack_require__,n="undefined"!=typeof window&&"undefined"!=typeof document||t;r.default=n}).call(this)}).call(this,e("_process"))},{_process:102}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.applyMixin=r.ErrorWithReasonCode=void 0;class n extends Error{constructor(e,t){super(e),this.code=t,Object.setPrototypeOf(this,n.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}r.ErrorWithReasonCode=n,r.applyMixin=function(e,t,r=!1){var n;const i=[t];for(;;){const e=i[0],t=Object.getPrototypeOf(e);if(!(null==t?void 0:t.prototype))break;i.unshift(t)}for(const t of i)for(const i of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==i)&&Object.defineProperty(e.prototype,i,null!==(n=Object.getOwnPropertyDescriptor(t.prototype,i))&&void 0!==n?n:Object.create(null))}},{}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("readable-stream"),i={objectMode:!0},s={clean:!0};r.default=class{constructor(e){this.options=e||{},this.options=Object.assign(Object.assign({},s),e),this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){const e=new n.Readable(i),t=[];let r=!1,s=0;return this._inflights.forEach(((e,r)=>{t.push(e)})),e._read=()=>{!r&&s<t.length?e.push(t[s++]):e.push(null)},e.destroy=t=>{if(!r)return r=!0,setTimeout((()=>{e.emit("close")}),0),e},e}del(e,t){const r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){const r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}},{"readable-stream":125}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=class{constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max)&&(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}},{}],20:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(e("lru-cache")),s=e("number-allocator");r.default=class{constructor(e){e>0&&(this.aliasToTopic=new i.default({max:e}),this.topicToAlias={},this.numberAllocator=new s.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;const r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){const e=this.numberAllocator.firstVacant();return e||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}},{"lru-cache":72,"number-allocator":98}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("number-allocator");r.default=class{constructor(){this.numberAllocator=new n.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e)}clear(){this.numberAllocator.clear()}}},{"number-allocator":98}],22:[function(e,t,r){"use strict";function n(e){const t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}Object.defineProperty(r,"__esModule",{value:!0}),r.validateTopics=r.validateTopic=void 0,r.validateTopic=n,r.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let t=0;t<e.length;t++)if(!n(e[t]))return e[t];return null}},{}],23:[function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ReasonCodes=r.UniqueMessageIdProvider=r.DefaultMessageIdProvider=r.Store=r.MqttClient=r.connectAsync=r.connect=r.Client=void 0;const l=a(e("./lib/client"));r.MqttClient=l.default;const u=a(e("./lib/default-message-id-provider"));r.DefaultMessageIdProvider=u.default;const c=a(e("./lib/unique-message-id-provider"));r.UniqueMessageIdProvider=c.default;const h=a(e("./lib/store"));r.Store=h.default;const f=s(e("./lib/connect"));r.connect=f.default,Object.defineProperty(r,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}}),r.Client=l.default,o(e("./lib/client"),r),o(e("./lib/shared"),r);var d=e("./lib/handlers/ack");Object.defineProperty(r,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})},{"./lib/client":2,"./lib/connect":4,"./lib/default-message-id-provider":9,"./lib/handlers/ack":10,"./lib/shared":17,"./lib/store":18,"./lib/unique-message-id-provider":21}],24:[function(e,t,r){"use strict";const{AbortController:n,AbortSignal:i}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;t.exports=n,t.exports.AbortSignal=i,t.exports.default=n},{}],25:[function(e,t,r){"use strict";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),o=n[0],a=n[1],u=new s(function(e,t,r){return 3*(t+r)/4-r}(0,o,a)),c=0,h=a>0?o-4:o;for(r=0;r<h;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],o=16383,a=0,l=r-i;a<l;a+=o)s.push(u(e,a,a+o>l?l:a+o));1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,r){for(var i,s,o=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],26:[function(e,t,r){},{}],27:[function(e,t,r){var n=e("buffer"),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(s(n,r),r.Buffer=o),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:29}],28:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}r.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":27}],29:[function(e,t,r){(function(t){(function(){
|
|
1
|
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).mqtt=e()}}((function(){return function e(t,r,n){function i(o,a){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.TypedEventEmitter=void 0;const i=n(e("events")),s=e("./shared");class o{}r.TypedEventEmitter=o,(0,s.applyMixin)(o,i.default)},{"./shared":17,events:49}],2:[function(e,t,r){(function(t,n){(function(){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const l=a(e("./topic-alias-recv")),u=a(e("mqtt-packet")),c=a(e("./default-message-id-provider")),h=e("readable-stream"),f=a(e("reinterval")),d=a(e("rfdc/default")),p=o(e("./validations")),b=a(e("debug")),g=a(e("./store")),m=a(e("./handlers")),y=e("./TypedEmitter"),_=t?t.nextTick:e=>{setTimeout(e,0)},w=n.setImmediate||((...e)=>{const t=e.shift();_((()=>{t(...e)}))}),v={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,writeCache:!0},S=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND","ETIMEDOUT"];class E extends y.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,t){super(),this.options=t||{};for(const e in v)void 0===this.options[e]?this.options[e]=v[e]:this.options[e]=t[e];this.log=this.options.log||(0,b.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: options.protocol",t.protocol),this.log("MqttClient :: options.protocolVersion",t.protocolVersion),this.log("MqttClient :: options.username",t.username),this.log("MqttClient :: options.keepalive",t.keepalive),this.log("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",t.properties?t.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof t.clientId?t.clientId:E.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(u.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new c.default:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new g.default,this.incomingStore=t.incomingStore||new g.default,this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.properties&&t.properties.topicAliasMaximum>0&&(t.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new l.default(t.properties.topicAliasMaximum)),this.on("connect",(()=>{const{queue:e}=this,t=()=>{const r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,(e=>{r.cb&&r.cb(e),t()})):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()})),this.on("close",(()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),null!==this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()})),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var e;const t=new h.Writable,r=u.default.parser(this.options);let n=null;const i=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",(e=>{this.log("parser :: on packet push to packets array."),i.push(e)}));const s=()=>{this.log("work :: getting next packet in queue");const e=i.shift();if(e)this.log("work :: packet pulled from queue"),(0,m.default)(this,e,o);else{this.log("work :: no packets in queue");const e=n;n=null,this.log("work :: done flag is %s",!!e),e&&e()}},o=()=>{if(i.length)_(s);else{const e=n;n=null,e()}};t._write=(e,t,i)=>{n=i,this.log("writable stream :: parsing buffer"),r.parse(e),s()};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(t),this.stream.on("error",(e=>{this.log("streamErrorHandler :: error",e.message),S.includes(e.code)?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)})),this.stream.on("close",(()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")})),this.log("connect: sending packet `connect`");const a={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(a.will=Object.assign(Object.assign({},this.options.will),{payload:null===(e=this.options.will)||void 0===e?void 0:e.payload})),this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(a),r.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end((()=>this.emit("error",new Error("Packet has no Authentication Method")))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){const e=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0)}),this.options.connectTimeout),this}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);const{options:i}=this;"function"==typeof r&&(n=r,r=null),r=r||{};r=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),r);const{qos:s,retain:o,dup:a,properties:l,cbStorePut:u}=r;if(this._checkDisconnecting(n))return this;const c=()=>{let r=0;if((1===s||2===s)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;const c={cmd:"publish",topic:e,payload:t,qos:s,retain:o,messageId:r,dup:a};switch(5===i.protocolVersion&&(c.properties=l),this.log("publish :: qos",s),s){case 1:case 2:this.outgoing[c.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,void 0,u);break;default:this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,n,u)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise(((n,i)=>{this.publish(e,t,r,(e=>{e?i(e):n()}))}))}subscribe(e,t,r){const n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,s=[];"string"==typeof e?s=e=[e]:Array.isArray(e)?s=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,s=Object.keys(e));const o=p.validateTopics(s);if(null!==o)return w(r,new Error(`Invalid topic ${o}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;const a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0);const l=(t=Object.assign(Object.assign({},a),t)).properties,u=[],c=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){const t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),u.push(t)}};if(Array.isArray(e)?e.forEach((e=>{this.log("subscribe: array topic %s",e),c(e)})):Object.keys(e).forEach((t=>{this.log("subscribe: object topic %s, %o",t,e[t]),c(t,e[t])})),!u.length)return r(null,[]),this;const h=()=>{const e=this._nextId();if(null===e)return this.log("No messageId left"),!1;const t={cmd:"subscribe",subscriptions:u,messageId:e};if(l&&(t.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");const e=[];u.forEach((t=>{if(this.options.reconnectPeriod>0){const r={qos:t.qos};5===n&&(r.nl=t.nl||!1,r.rap=t.rap||!1,r.rh=t.rh||0,r.properties=t.properties),this._resubscribeTopics[t.topic]=r,e.push(t.topic)}})),this.messageIdToTopic[t.messageId]=e}return this.outgoing[t.messageId]={volatile:!0,cb(e,t){if(!e){const{granted:e}=t;for(let t=0;t<e.length;t+=1)u[t].qos=e[t]}r(e,u)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(t),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!h())&&this._storeProcessingQueue.push({invoke:h,callback:r}),this}subscribeAsync(e,t){return new Promise(((r,n)=>{this.subscribe(e,t,((e,t)=>{e?n(e):r(t)}))}))}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;const n=p.validateTopics(e);if(null!==n)return w(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;const i=()=>{const n=this._nextId();if(null===n)return this.log("No messageId left"),!1;const i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach((e=>{delete this._resubscribeTopics[e]})),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise(((r,n)=>{this.unsubscribe(e,t,(e=>{e?n(e):r()}))}))}end(e,t,r){this.log("end :: (%s)",this.options.clientId),null!=e&&"boolean"==typeof e||(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),r&&"function"==typeof r||(r=this.noop);const n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close((e=>{this.outgoingStore.close((t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){const n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}}))})),this._deferredReconnect&&this._deferredReconnect()},i=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,(()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),_(n)}),t)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i()),this)}endAsync(e,t){return new Promise(((r,n)=>{this.end(e,t,(e=>{e?n(e):r()}))}))}removeOutgoingMessage(e){if(this.outgoing[e]){const{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,(()=>{t(new Error("Message removed"))}))}return this}reconnect(e){this.log("client reconnect");const t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach((e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])})))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach((e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])})))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(void 0===t)return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),void 0===r)return new Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end((()=>{this.connect()})),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval((()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()}),this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const e=Object.assign({cmd:"disconnect"},r);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,(()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),w((()=>{this.stream.end((()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)}))}))}))}this.disconnecting||(this.log("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,i=e;if("publish"===i.cmd&&(i=(0,d.default)(e),n=this._removeTopicAliasAndRecoverTopicName(i),n))return t&&t(n);this.outgoingStore.put(i,(n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)}))}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);const r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties=Object.assign(Object.assign({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");const r=u.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;const i=this._applyTopicAlias(e);if(i)t(i);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,d.default)(e);const r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}const i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,(e=>{if(e)return t&&t(e);r()}))):t&&t(new Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=(0,f.default)((()=>{this._checkPing()}),1e3*this.options.keepalive))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){const r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;const t=()=>{let r=this.outgoingStore.createStream();const n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",(e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)}));const s=()=>{if(!r)return;const e=r.read(1);let t;e?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[e.messageId]?s():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(t=this.outgoing[e.messageId]?this.outgoing[e.messageId].cb:null,this.outgoing[e.messageId]={volatile:!1,cb(e,r){t&&t(e,r),s()}},this._packetIdsDuringStoreProcessing[e.messageId]=!0,this.messageIdProvider.register(e.messageId)?this._sendPacket(e,void 0,void 0,!0):this.log("messageId: %d has already used.",e.messageId))):r.once("readable",s)};r.on("end",(()=>{let r=!0;for(const e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}r?(i(),this.removeListener("close",n),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()})),s()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},((r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()}))}}r.default=E}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./TypedEmitter":1,"./default-message-id-provider":9,"./handlers":13,"./store":18,"./topic-alias-recv":19,"./validations":22,_process:102,debug:30,"mqtt-packet":75,"readable-stream":125,reinterval:131,"rfdc/default":132}],3:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=e("buffer"),s=e("readable-stream"),o=n(e("duplexify"));let a,l,u,c=!1;r.default=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const n=function(e,t){const r="alis"===e.protocol?"wss":"ws";let n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);return a=t.my,a.connectSocket({url:n,protocols:r}),l=function(){const e=new s.Transform;return e._write=(e,t,r)=>{a.sendSocketMessage({data:e.buffer,success(){r()},fail(){r(new Error)}})},e._flush=e=>{a.closeSocket({success(){e()}})},e}(),u=o.default.obj(),c||(c=!0,a.onSocketOpen((()=>{u.setReadable(l),u.setWritable(l),u.emit("connect")})),a.onSocketMessage((e=>{if("string"==typeof e.data){const t=i.Buffer.from(e.data,"base64");l.push(t)}else{const t=new FileReader;t.addEventListener("load",(()=>{let e=t.result;e=e instanceof ArrayBuffer?i.Buffer.from(e):i.Buffer.from(e,"utf8"),l.push(e)})),t.readAsArrayBuffer(e.data)}})),a.onSocketClose((()=>{u.end(),u.destroy()})),a.onSocketError((e=>{u.destroy(e)}))),u}},{buffer:29,duplexify:32,"readable-stream":125}],4:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.connectAsync=void 0;const i=n(e("debug")),s=n(e("url")),o=n(e("../client")),a=n(e("../is-browser")),l=(0,i.default)("mqttjs"),u={};function c(e,t){if(l("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=""),t=t||{},e&&"string"==typeof e){const r=s.default.parse(e,!0);if(null!=r.port&&(r.port=Number(r.port)),null===(t=Object.assign(Object.assign({},r),t)).protocol)throw new Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(function(e){let t;e.auth&&(t=e.auth.match(/^(.+):(.+)$/),t?(e.username=t[1],e.password=t[2]):e.username=e.auth)}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(!u[t.protocol]){const e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(((t,r)=>(!e||r%2!=0)&&"function"==typeof u[t]))[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);const r=new o.default((function(e){return t.servers&&(e._reconnectCount&&e._reconnectCount!==t.servers.length||(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),l("calling streambuilder for",t.protocol),u[t.protocol](e,t)}),t);return r.on("error",(()=>{})),r}a.default?(u.wx=e("./wx").default,u.wxs=e("./wx").default,u.ali=e("./ali").default,u.alis=e("./ali").default):(u.mqtt=e("./tcp").default,u.tcp=e("./tcp").default,u.ssl=e("./tls").default,u.tls=u.ssl,u.mqtts=e("./tls").default),u.ws=e("./ws").default,u.wss=e("./ws").default,r.connectAsync=function(e,t,r=!0){return new Promise(((n,i)=>{const s=c(e,t),o={connect:e=>{a(),n(s)},end:()=>{a(),n(s)},error:e=>{a(),s.end(),i(e)}};function a(){Object.keys(o).forEach((e=>{s.off(e,o[e])}))}!1===r&&(o.close=()=>{o.error(new Error("Couldn't connect to server"))}),Object.keys(o).forEach((e=>{s.on(e,o[e])}))}))},r.default=c},{"../client":2,"../is-browser":16,"./ali":3,"./tcp":5,"./tls":6,"./ws":7,"./wx":8,debug:30,url:137}],5:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(e("net")),s=(0,n(e("debug")).default)("mqttjs:tcp");r.default=(e,t)=>{t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost";const{port:r}=t,n=t.hostname;return s("port %d and host %s",r,n),i.default.createConnection(r,n)}},{debug:30,net:26}],6:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(e("tls")),s=n(e("net")),o=(0,n(e("debug")).default)("mqttjs:tls");r.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===s.default.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,o("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const r=i.default.connect(t);function n(n){t.rejectUnauthorized&&e.emit("error",n),r.end()}return r.on("secureConnect",(()=>{t.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",n)})),r.on("error",n),r}},{debug:30,net:26,tls:26}],7:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=e("buffer"),s=n(e("ws")),o=n(e("debug")),a=n(e("duplexify")),l=e("readable-stream"),u=n(e("../is-browser")),c=(0,o.default)("mqttjs:ws"),h=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function f(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function d(e){const t=e;return e.hostname||(t.hostname="localhost"),e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),u.default||"wss"!==e.protocol||h.forEach((r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])})),t}r.default=u.default?(e,t)=>{let r;c("browserStreamBuilder");const n=function(e){const t=d(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t),s=n.browserBufferSize||524288,o=t.browserBufferTimeout||1e3,u=!t.objectMode,h=function(e,t){const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",n=f(t,e),i=new WebSocket(n,[r]);return i.binaryType="arraybuffer",i}(e,t),p=function(e,t,r){const n=new l.Transform({objectMode:e.objectMode});return n._write=t,n._flush=r,n}(t,(function e(t,r,n){h.bufferedAmount>s&&setTimeout(e,o,t,r,n);u&&"string"==typeof t&&(t=i.Buffer.from(t,"utf8"));try{h.send(t)}catch(e){return n(e)}n()}),(function(e){h.close(),e()}));t.objectMode||(p._writev=w),p.on("close",(()=>{h.close()}));const b=void 0!==h.addEventListener;function g(){r.setReadable(p),r.setWritable(p),r.emit("connect")}function m(){r.end(),r.destroy()}function y(e){r.destroy(e)}function _(e){let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),p.push(t)}function w(e,t){const r=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?r[t]=i.Buffer.from(e[t],"utf8"):r[t]=e[t].chunk;this._write(i.Buffer.concat(r),"binary",t)}return h.readyState===h.OPEN?r=p:(r=(0,a.default)(void 0,void 0,t),t.objectMode||(r._writev=w),b?h.addEventListener("open",g):h.onopen=g),r.socket=h,b?(h.addEventListener("close",m),h.addEventListener("error",y),h.addEventListener("message",_)):(h.onclose=m,h.onerror=y,h.onmessage=_),r}:(e,t)=>{c("streamBuilder");const r=d(t),n=f(r,e),i=function(e,t,r){c("createWebSocket"),c(`protocol: ${r.protocolId} ${r.protocolVersion}`);const n="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return c(`creating new Websocket for url: ${t} and protocol: ${n}`),new s.default(t,[n],r.wsOptions)}(0,n,r),o=s.default.createWebSocketStream(i,r.wsOptions);return o.url=n,i.on("close",(()=>{o.destroy()})),o}},{"../is-browser":16,buffer:29,debug:30,duplexify:32,"readable-stream":125,ws:141}],8:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=e("buffer"),s=e("readable-stream"),o=n(e("duplexify"));let a,l,u;r.default=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const n=function(e,t){const r="wxs"===e.protocol?"wss":"ws";let n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);a=wx.connectSocket({url:n,protocols:[r]}),l=function(){const e=new s.Transform;return e._write=(e,t,r)=>{a.send({data:e.buffer,success(){r()},fail(e){r(new Error(e))}})},e._flush=e=>{a.close({success(){e()}})},e}(),u=o.default.obj(),u._destroy=(e,t)=>{a.close({success(){t&&t(e)}})};const c=u.destroy;return u.destroy=()=>{u.destroy=c,setTimeout((()=>{a.close({fail(){u._destroy(new Error)}})}),0)},a.onOpen((()=>{u.setReadable(l),u.setWritable(l),u.emit("connect")})),a.onMessage((e=>{let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),l.push(t)})),a.onClose((()=>{u.emit("close"),u.end(),u.destroy()})),a.onError((e=>{u.destroy(new Error(e.errMsg))})),u}},{buffer:29,duplexify:32,"readable-stream":125}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=class{constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}},{}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ReasonCodes=void 0,r.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};r.default=(e,t)=>{const{messageId:n}=t,i=t.cmd;let s=null;const o=e.outgoing[n]?e.outgoing[n].cb:null;let a;if(o){switch(e.log("_handleAck :: packet type",i),i){case"pubcomp":case"puback":{const i=t.reasonCode;i&&i>0&&16!==i?(a=new Error(`Publish error: ${r.ReasonCodes[i]}`),a.code=i,e._removeOutgoingAndStoreMessage(n,(()=>{o(a,t)}))):e._removeOutgoingAndStoreMessage(n,o);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:n};const i=t.reasonCode;i&&i>0&&16!==i?(a=new Error(`Publish error: ${r.ReasonCodes[i]}`),a.code=i,e._removeOutgoingAndStoreMessage(n,(()=>{o(a,t)}))):e._sendPacket(s);break}case"suback":{delete e.outgoing[n],e.messageIdProvider.deallocate(n);const r=t.granted;for(let t=0;t<r.length;t++)if(0!=(128&r[t])){const t=e.messageIdToTopic[n];t&&t.forEach((t=>{delete e._resubscribeTopics[t]}))}delete e.messageIdToTopic[n],e._invokeStoreProcessingQueue(),o(null,t);break}case"unsuback":delete e.outgoing[n],e.messageIdProvider.deallocate(n),e._invokeStoreProcessingQueue(),o(null);break;default:e.emit("error",new Error("unrecognized packet type"))}e.disconnecting&&0===Object.keys(e.outgoing).length&&e.emit("outgoingEmpty")}else e.log("_handleAck :: Server sent an ack in error. Ignoring.")}},{}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../shared"),i=e("./ack");r.default=(e,t)=>{const{options:r}=e,s=r.protocolVersion,o=5===s?t.reasonCode:t.returnCode;if(5===s)e.handleAuth(t,((t,r)=>{if(t)e.emit("error",t);else if(24===o)e.reconnecting=!1,e._sendPacket(r);else{const t=new n.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[o]}`,o);e.emit("error",t)}}));else{const t=new n.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${s}`,o);e.emit("error",t)}}},{"../shared":17,"./ack":10}],12:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=e("./ack"),s=n(e("../topic-alias-send")),o=e("../shared");r.default=(e,t)=>{e.log("_handleConnack");const{options:r}=e,n=5===r.protocolVersion?t.reasonCode:t.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,t.properties){if(t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new s.default(t.properties.topicAliasMaximum))}t.properties.serverKeepAlive&&r.keepalive&&(r.keepalive=t.properties.serverKeepAlive,e._shiftPingInterval()),t.properties.maximumPacketSize&&(r.properties||(r.properties={}),r.properties.maximumPacketSize=t.properties.maximumPacketSize)}if(0===n)e.reconnecting=!1,e._onConnect(t);else if(n>0){const t=new o.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[n]}`,n);e.emit("error",t)}}},{"../shared":17,"../topic-alias-send":20,"./ack":10}],13:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(e("./publish")),s=n(e("./auth")),o=n(e("./connack")),a=n(e("./ack")),l=n(e("./pubrel"));r.default=(e,t,r)=>{const{options:n}=e;if(5===n.protocolVersion&&n.properties&&n.properties.maximumPacketSize&&n.properties.maximumPacketSize<t.length)return e.emit("error",new Error(`exceeding packets size ${t.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,i.default)(e,t,r);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,a.default)(e,t),r();break;case"pubrel":(0,l.default)(e,t,r);break;case"connack":(0,o.default)(e,t),r();break;case"auth":(0,s.default)(e,t),r();break;case"pingresp":e.pingResp=!0,r();break;case"disconnect":e.emit("disconnect",t),r();break;default:e.log("_handlePacket :: unknown command"),r()}}},{"./ack":10,"./auth":11,"./connack":12,"./publish":14,"./pubrel":15}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=[0,16,128,131,135,144,145,151,153];r.default=(e,t,r)=>{e.log("handlePublish: packet %o",t),r=void 0!==r?r:e.noop;let i=t.topic.toString();const s=t.payload,{qos:o}=t,{messageId:a}=t,{options:l}=e;if(5===e.options.protocolVersion){let r;if(t.properties&&(r=t.properties.topicAlias),void 0!==r)if(0===i.length){if(!(r>0&&r<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",r),void e.emit("error",new Error("Received Topic Alias is out of range"));{const t=e.topicAliasRecv.getTopicByAlias(r);if(!t)return e.log("handlePublish :: unregistered topic alias. alias: %d",r),void e.emit("error",new Error("Received unregistered Topic Alias"));i=t,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,r)}}else{if(!e.topicAliasRecv.put(i,r))return e.log("handlePublish :: topic alias out of range. alias: %d",r),void e.emit("error",new Error("Received Topic Alias is out of range"));e.log("handlePublish :: registered topic: %s - alias: %d",i,r)}}switch(e.log("handlePublish: qos %d",o),o){case 2:l.customHandleAcks(i,s,t,((i,s)=>("number"==typeof i&&(s=i,i=null),i?e.emit("error",i):-1===n.indexOf(s)?e.emit("error",new Error("Wrong reason code for pubrec")):void(s?e._sendPacket({cmd:"pubrec",messageId:a,reasonCode:s},r):e.incomingStore.put(t,(()=>{e._sendPacket({cmd:"pubrec",messageId:a},r)}))))));break;case 1:l.customHandleAcks(i,s,t,((o,l)=>("number"==typeof o&&(l=o,o=null),o?e.emit("error",o):-1===n.indexOf(l)?e.emit("error",new Error("Wrong reason code for puback")):(l||e.emit("message",i,s,t),void e.handleMessage(t,(t=>{if(t)return r&&r(t);e._sendPacket({cmd:"puback",messageId:a,reasonCode:l},r)}))))));break;case 0:e.emit("message",i,s,t),e.handleMessage(t,r);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}},{}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=(e,t,r)=>{e.log("handling pubrel packet");const n=void 0!==r?r:e.noop,{messageId:i}=t,s={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,((t,r)=>{t?e._sendPacket(s,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,(t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._sendPacket(s,n)})))}))}},{}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n="undefined"!=typeof window&&void 0!==window.document;r.default=n},{}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.applyMixin=r.ErrorWithReasonCode=void 0;class n extends Error{constructor(e,t){super(e),this.code=t,Object.setPrototypeOf(this,n.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}r.ErrorWithReasonCode=n,r.applyMixin=function(e,t,r=!1){var n;const i=[t];for(;;){const e=i[0],t=Object.getPrototypeOf(e);if(!(null==t?void 0:t.prototype))break;i.unshift(t)}for(const t of i)for(const i of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==i)&&Object.defineProperty(e.prototype,i,null!==(n=Object.getOwnPropertyDescriptor(t.prototype,i))&&void 0!==n?n:Object.create(null))}},{}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("readable-stream"),i={objectMode:!0},s={clean:!0};r.default=class{constructor(e){this.options=e||{},this.options=Object.assign(Object.assign({},s),e),this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){const e=new n.Readable(i),t=[];let r=!1,s=0;return this._inflights.forEach(((e,r)=>{t.push(e)})),e._read=()=>{!r&&s<t.length?e.push(t[s++]):e.push(null)},e.destroy=t=>{if(!r)return r=!0,setTimeout((()=>{e.emit("close")}),0),e},e}del(e,t){const r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){const r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}},{"readable-stream":125}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default=class{constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max)&&(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}},{}],20:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(e("lru-cache")),s=e("number-allocator");r.default=class{constructor(e){e>0&&(this.aliasToTopic=new i.default({max:e}),this.topicToAlias={},this.numberAllocator=new s.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;const r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){const e=this.numberAllocator.firstVacant();return e||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}},{"lru-cache":72,"number-allocator":98}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("number-allocator");r.default=class{constructor(){this.numberAllocator=new n.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e)}clear(){this.numberAllocator.clear()}}},{"number-allocator":98}],22:[function(e,t,r){"use strict";function n(e){const t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}Object.defineProperty(r,"__esModule",{value:!0}),r.validateTopics=r.validateTopic=void 0,r.validateTopic=n,r.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let t=0;t<e.length;t++)if(!n(e[t]))return e[t];return null}},{}],23:[function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ReasonCodes=r.UniqueMessageIdProvider=r.DefaultMessageIdProvider=r.Store=r.MqttClient=r.connectAsync=r.connect=r.Client=void 0;const l=a(e("./lib/client"));r.MqttClient=l.default;const u=a(e("./lib/default-message-id-provider"));r.DefaultMessageIdProvider=u.default;const c=a(e("./lib/unique-message-id-provider"));r.UniqueMessageIdProvider=c.default;const h=a(e("./lib/store"));r.Store=h.default;const f=s(e("./lib/connect"));r.connect=f.default,Object.defineProperty(r,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}}),r.Client=l.default,o(e("./lib/client"),r),o(e("./lib/shared"),r);var d=e("./lib/handlers/ack");Object.defineProperty(r,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})},{"./lib/client":2,"./lib/connect":4,"./lib/default-message-id-provider":9,"./lib/handlers/ack":10,"./lib/shared":17,"./lib/store":18,"./lib/unique-message-id-provider":21}],24:[function(e,t,r){"use strict";const{AbortController:n,AbortSignal:i}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;t.exports=n,t.exports.AbortSignal=i,t.exports.default=n},{}],25:[function(e,t,r){"use strict";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),o=n[0],a=n[1],u=new s(function(e,t,r){return 3*(t+r)/4-r}(0,o,a)),c=0,h=a>0?o-4:o;for(r=0;r<h;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],o=16383,a=0,l=r-i;a<l;a+=o)s.push(u(e,a,a+o>l?l:a+o));1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,r){for(var i,s,o=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],26:[function(e,t,r){},{}],27:[function(e,t,r){var n=e("buffer"),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(s(n,r),r.Buffer=o),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:29}],28:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}r.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":27}],29:[function(e,t,r){(function(t){(function(){
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
package/package.json
CHANGED
package/src/lib/connect/wx.ts
CHANGED
package/src/lib/is-browser.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
const legacyIsBrowser =
|
|
2
|
-
(typeof process !== 'undefined' && process.title === 'browser') ||
|
|
3
|
-
// eslint-disable-next-line camelcase, @typescript-eslint/ban-ts-comment
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
typeof __webpack_require__ === 'function'
|
|
6
|
-
|
|
7
1
|
const isBrowser =
|
|
8
|
-
typeof window !== 'undefined' && typeof document !== 'undefined'
|
|
9
|
-
|
|
10
|
-
const IS_BROWSER = isBrowser || legacyIsBrowser
|
|
2
|
+
typeof window !== 'undefined' && typeof window.document !== 'undefined'
|
|
11
3
|
|
|
12
|
-
export default
|
|
4
|
+
export default isBrowser
|