@vxrn/utils 1.27.0 → 1.27.1-1789509973946

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.
Files changed (47) hide show
  1. package/dist/cjs/createMessageSocket.cjs +115 -121
  2. package/dist/cjs/createMessageSocket.native.cjs +166 -0
  3. package/dist/cjs/createMessageSocket.native.js +152 -166
  4. package/dist/cjs/createMessageSocket.native.js.map +1 -1
  5. package/dist/cjs/detectPackageManager.cjs +76 -72
  6. package/dist/cjs/detectPackageManager.native.cjs +106 -0
  7. package/dist/cjs/detectPackageManager.native.js +82 -77
  8. package/dist/cjs/detectPackageManager.native.js.map +1 -1
  9. package/dist/cjs/exec.cjs +43 -45
  10. package/dist/cjs/exec.native.cjs +65 -0
  11. package/dist/cjs/exec.native.js +48 -49
  12. package/dist/cjs/exec.native.js.map +1 -1
  13. package/dist/cjs/index.cjs +9 -11
  14. package/dist/cjs/index.native.cjs +25 -0
  15. package/dist/cjs/index.native.js +9 -10
  16. package/dist/cjs/index.native.js.map +1 -1
  17. package/dist/cjs/mustReplace.cjs +27 -35
  18. package/dist/cjs/mustReplace.native.cjs +60 -0
  19. package/dist/cjs/mustReplace.native.js +44 -60
  20. package/dist/cjs/mustReplace.native.js.map +1 -1
  21. package/dist/esm/createMessageSocket.mjs +103 -103
  22. package/dist/esm/createMessageSocket.mjs.map +1 -1
  23. package/dist/esm/createMessageSocket.native.js +139 -148
  24. package/dist/esm/createMessageSocket.native.js.map +1 -1
  25. package/dist/esm/detectPackageManager.mjs +65 -55
  26. package/dist/esm/detectPackageManager.mjs.map +1 -1
  27. package/dist/esm/detectPackageManager.native.js +71 -61
  28. package/dist/esm/detectPackageManager.native.js.map +1 -1
  29. package/dist/esm/exec.mjs +29 -27
  30. package/dist/esm/exec.mjs.map +1 -1
  31. package/dist/esm/exec.native.js +34 -32
  32. package/dist/esm/exec.native.js.map +1 -1
  33. package/dist/esm/index.js +11 -7
  34. package/dist/esm/index.mjs +11 -7
  35. package/dist/esm/index.native.js +11 -7
  36. package/dist/esm/mustReplace.mjs +15 -17
  37. package/dist/esm/mustReplace.mjs.map +1 -1
  38. package/dist/esm/mustReplace.native.js +32 -43
  39. package/dist/esm/mustReplace.native.js.map +1 -1
  40. package/package.json +4 -4
  41. package/types/createMessageSocket.d.ts +1 -1
  42. package/types/createMessageSocket.d.ts.map +1 -1
  43. package/types/detectPackageManager.d.ts.map +1 -1
  44. package/types/exec.d.ts.map +1 -1
  45. package/dist/esm/index.js.map +0 -1
  46. package/dist/esm/index.mjs.map +0 -1
  47. package/dist/esm/index.native.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","exec_exports","exec","execPromise","execPromiseQuiet","module","exports","import_child_process","require","cmd","options","_execSync","execSync","toString","Promise","resolve","reject","command","args","split","child","spawn","stdio","quiet","shell","process","env","DEBUG","_child_stdout","_child_stderr","stdout","pipe","stderr","on","code","Error","error"],"sources":["exec.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar exec_exports = {};\n__export(exec_exports, {\n exec: () => exec,\n execPromise: () => execPromise,\n execPromiseQuiet: () => execPromiseQuiet\n});\nmodule.exports = __toCommonJS(exec_exports);\nvar import_child_process = require(\"child_process\");\nvar exec = function(cmd, options) {\n var _execSync;\n return ((_execSync = (0, import_child_process.execSync)(cmd, options)) === null || _execSync === void 0 ? void 0 : _execSync.toString()) || \"\";\n};\nvar execPromise = function(cmd, options) {\n return new Promise(function(resolve, reject) {\n var [command, ...args] = cmd.split(\" \");\n var child = (0, import_child_process.spawn)(command, args, {\n stdio: (options === null || options === void 0 ? void 0 : options.quiet) ? \"pipe\" : \"inherit\",\n shell: true,\n ...options\n });\n if (!(options === null || options === void 0 ? void 0 : options.quiet) || process.env.DEBUG) {\n var _child_stdout, _child_stderr;\n (_child_stdout = child.stdout) === null || _child_stdout === void 0 ? void 0 : _child_stdout.pipe(process.stdout);\n (_child_stderr = child.stderr) === null || _child_stderr === void 0 ? void 0 : _child_stderr.pipe(process.stderr);\n }\n child.on(\"close\", function(code) {\n if (code !== 0) {\n reject(new Error(`Command failed with exit code ${code}: ${cmd}`));\n } else {\n resolve();\n }\n });\n child.on(\"error\", function(error) {\n reject(error);\n });\n });\n};\nvar execPromiseQuiet = function(cmd, options) {\n return execPromise(cmd, {\n ...options,\n quiet: true\n });\n};\n//# sourceMappingURL=exec.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;I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Z,KAAK,CAACa,EAAE,CAAC,OAAO,EAAE,UAASC,IAAI,EAAE;MAC/B,IAAIA,IAAI,KAAK,CAAC,EAAE;QACdlB,MAAM,CAAC,IAAImB,KAAK,CAAC,iCAAiCD,IAAI,KAAKzB,GAAG,EAAE,CAAC,CAAC;MACpE,CAAC,MAAM;QACLM,OAAO,CAAC,CAAC;MACX;IACF,CAAC,CAAC;IACFK,KAAK,CAACa,EAAE,CAAC,OAAO,EAAE,UAASG,KAAK,EAAE;MAChCpB,MAAM,CAACoB,KAAK,CAAC;IACf,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC;AACD,IAAIhC,gBAAgB,GAAG,SAAAA,CAASK,GAAG,EAAEC,OAAO,EAAE;EAC5C,OAAOP,WAAW,CAACM,GAAG,EAAE;IACtB,GAAGC,OAAO;IACVa,KAAK,EAAE;EACT,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"exec.native.js","names":[],"sources":["cjs/exec.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar exec_exports = {};\n__export(exec_exports, {\n exec: () => exec,\n execPromise: () => execPromise,\n execPromiseQuiet: () => execPromiseQuiet\n});\nmodule.exports = __toCommonJS(exec_exports);\nvar import_child_process = require(\"child_process\");\nvar exec = function(cmd, options) {\n var _execSync;\n return ((_execSync = (0, import_child_process.execSync)(cmd, options)) === null || _execSync === void 0 ? void 0 : _execSync.toString()) || \"\";\n};\nvar execPromise = function(cmd, options) {\n return new Promise(function(resolve, reject) {\n var [command, ...args] = cmd.split(\" \");\n var child = (0, import_child_process.spawn)(command, args, {\n stdio: (options === null || options === void 0 ? void 0 : options.quiet) ? \"pipe\" : \"inherit\",\n shell: true,\n ...options\n });\n if (!(options === null || options === void 0 ? void 0 : options.quiet) || process.env.DEBUG) {\n var _child_stdout, _child_stderr;\n (_child_stdout = child.stdout) === null || _child_stdout === void 0 ? void 0 : _child_stdout.pipe(process.stdout);\n (_child_stderr = child.stderr) === null || _child_stderr === void 0 ? void 0 : _child_stderr.pipe(process.stderr);\n }\n child.on(\"close\", function(code) {\n if (code !== 0) {\n reject(new Error(`Command failed with exit code ${code}: ${cmd}`));\n } else {\n resolve();\n }\n });\n child.on(\"error\", function(error) {\n reject(error);\n });\n });\n};\nvar execPromiseQuiet = function(cmd, options) {\n return execPromise(cmd, {\n ...options,\n quiet: true\n });\n};\n//# sourceMappingURL=exec.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KA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C;EACD,MAAM,GAAG,SAAS,SAAS,OAAO;GAChC,OAAO,KAAK;EACd,CAAC;CACH,CAAC;AACH;AACA,IAAI,mBAAmB,SAAS,KAAK,SAAS;CAC5C,OAAO,YAAY,KAAK;EACtB,GAAG;EACH,OAAO;CACT,CAAC;AACH"}
@@ -3,18 +3,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
+ get: () => from[key],
9
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
+ });
11
+ }
12
+ return to;
13
13
  };
14
14
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: true
17
- }), mod);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
16
  var index_exports = {};
19
17
  module.exports = __toCommonJS(index_exports);
20
18
  __reExport(index_exports, require("@vxrn/debug"), module.exports);
@@ -22,4 +20,4 @@ __reExport(index_exports, require("@vxrn/resolve"), module.exports);
22
20
  __reExport(index_exports, require("./createMessageSocket.cjs"), module.exports);
23
21
  __reExport(index_exports, require("./detectPackageManager.cjs"), module.exports);
24
22
  __reExport(index_exports, require("./exec.cjs"), module.exports);
25
- __reExport(index_exports, require("./mustReplace.cjs"), module.exports);
23
+ __reExport(index_exports, require("./mustReplace.cjs"), module.exports);
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var index_exports = {};
19
+ module.exports = __toCommonJS(index_exports);
20
+ __reExport(index_exports, require("@vxrn/debug"), module.exports);
21
+ __reExport(index_exports, require("@vxrn/resolve"), module.exports);
22
+ __reExport(index_exports, require("./createMessageSocket.native.js"), module.exports);
23
+ __reExport(index_exports, require("./detectPackageManager.native.js"), module.exports);
24
+ __reExport(index_exports, require("./exec.native.js"), module.exports);
25
+ __reExport(index_exports, require("./mustReplace.native.js"), module.exports);
@@ -5,18 +5,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
15
  };
16
16
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
18
  var index_exports = {};
21
19
  module.exports = __toCommonJS(index_exports);
22
20
  __reExport(index_exports, require("@vxrn/debug"), module.exports);
@@ -25,4 +23,5 @@ __reExport(index_exports, require("./createMessageSocket.native.js"), module.exp
25
23
  __reExport(index_exports, require("./detectPackageManager.native.js"), module.exports);
26
24
  __reExport(index_exports, require("./exec.native.js"), module.exports);
27
25
  __reExport(index_exports, require("./mustReplace.native.js"), module.exports);
26
+
28
27
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__reExport","target","mod","secondTarget","__toCommonJS","value","index_exports","module","exports","require"],"sources":["index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"@vxrn/debug\"), module.exports);\n__reExport(index_exports, require(\"@vxrn/resolve\"), module.exports);\n__reExport(index_exports, require(\"./createMessageSocket\"), module.exports);\n__reExport(index_exports, require(\"./detectPackageManager\"), module.exports);\n__reExport(index_exports, require(\"./exec\"), module.exports);\n__reExport(index_exports, require(\"./mustReplace\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,IAAIG,GAAG,IAAIV,iBAAiB,CAACO,IAAI,CAAC,EACrC,IAAI,CAACL,YAAY,CAACS,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,EAC/Cb,SAAS,CAACW,EAAE,EAAEI,GAAG,EAAE;MAAEE,GAAG,EAAEA,CAAA,KAAML,IAAI,CAACG,GAAG,CAAC;MAAEG,UAAU,EAAE,EAAEJ,IAAI,GAAGX,gBAAgB,CAACS,IAAI,EAAEG,GAAG,CAAC,CAAC,IAAID,IAAI,CAACI;IAAW,CAAC,CAAC;EACxH;EACA,OAAOP,EAAE;AACX,CAAC;AACD,IAAIQ,UAAU,GAAGA,CAACC,MAAM,EAAEC,GAAG,EAAEC,YAAY,MAAMZ,WAAW,CAACU,MAAM,EAAEC,GAAG,EAAE,SAAS,CAAC,EAAEC,YAAY,IAAIZ,WAAW,CAACY,YAAY,EAAED,GAAG,EAAE,SAAS,CAAC,CAAC;AAChJ,IAAIE,YAAY,GAAIF,GAAG,IAAKX,WAAW,CAACV,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE;EAAEwB,KAAK,EAAE;AAAK,CAAC,CAAC,EAAEH,GAAG,CAAC;AAC1F,IAAII,aAAa,GAAG,CAAC,CAAC;AACtBC,MAAM,CAACC,OAAO,GAAGJ,YAAY,CAACE,aAAa,CAAC;AAC5CN,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,aAAa,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC;AACjER,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,eAAe,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC;AACnER,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,iCAAuB,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC;AAC3ER,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,kCAAwB,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC;AAC5ER,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,kBAAQ,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC;AAC5DR,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,yBAAe,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"@vxrn/debug\"), module.exports);\n__reExport(index_exports, require(\"@vxrn/resolve\"), module.exports);\n__reExport(index_exports, require(\"./createMessageSocket\"), module.exports);\n__reExport(index_exports, require(\"./detectPackageManager\"), module.exports);\n__reExport(index_exports, require(\"./exec\"), module.exports);\n__reExport(index_exports, require(\"./mustReplace\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,aAAa,GAAG,OAAO,OAAO;AAChE,WAAW,eAAe,QAAQ,eAAe,GAAG,OAAO,OAAO;AAClE,WAAW,eAAe,QAAQ,iCAAuB,GAAG,OAAO,OAAO;AAC1E,WAAW,eAAe,QAAQ,kCAAwB,GAAG,OAAO,OAAO;AAC3E,WAAW,eAAe,QAAQ,kBAAQ,GAAG,OAAO,OAAO;AAC3D,WAAW,eAAe,QAAQ,yBAAe,GAAG,OAAO,OAAO"}
@@ -3,47 +3,39 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
19
  };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
21
  var mustReplace_exports = {};
24
- __export(mustReplace_exports, {
25
- mustReplace: () => mustReplace
26
- });
22
+ __export(mustReplace_exports, { mustReplace: () => mustReplace });
27
23
  module.exports = __toCommonJS(mustReplace_exports);
28
24
  var import_node_fs = require("node:fs");
29
25
  var import_node_os = require("node:os");
30
26
  var import_node_path = require("node:path");
31
27
  function mustReplace(source, replacements) {
32
- let sourceOut = source;
33
- for (const {
34
- find,
35
- replace,
36
- optional
37
- } of replacements) {
38
- if (!optional) {
39
- const found = find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find);
40
- if (!found) {
41
- const tmpPath = (0, import_node_path.join)((0, import_node_os.tmpdir)(), `replace-error-${Math.random()}`);
42
- (0, import_node_fs.writeFileSync)(tmpPath, sourceOut, "utf-8");
43
- throw new Error(`Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`);
44
- }
45
- }
46
- sourceOut = sourceOut.replace(find, replace);
47
- }
48
- return sourceOut;
49
- }
28
+ let sourceOut = source;
29
+ for (const { find, replace, optional } of replacements) {
30
+ if (!optional) {
31
+ const found = find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find);
32
+ if (!found) {
33
+ const tmpPath = (0, import_node_path.join)((0, import_node_os.tmpdir)(), `replace-error-${Math.random()}`);
34
+ (0, import_node_fs.writeFileSync)(tmpPath, sourceOut, "utf-8");
35
+ throw new Error(`Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`);
36
+ }
37
+ }
38
+ sourceOut = sourceOut.replace(find, replace);
39
+ }
40
+ return sourceOut;
41
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var mustReplace_exports = {};
24
+ __export(mustReplace_exports, { mustReplace: () => mustReplace });
25
+ module.exports = __toCommonJS(mustReplace_exports);
26
+ var import_fs = require("fs");
27
+ var import_os = require("os");
28
+ var import_path = require("path");
29
+ function mustReplace(source, replacements) {
30
+ var sourceOut = source;
31
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
32
+ try {
33
+ for (var _iterator = replacements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
34
+ var { find, replace, optional } = _step.value;
35
+ if (!optional) {
36
+ var found = find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find);
37
+ if (!found) {
38
+ var tmpPath = (0, import_path.join)((0, import_os.tmpdir)(), `replace-error-${Math.random()}`);
39
+ (0, import_fs.writeFileSync)(tmpPath, sourceOut, "utf-8");
40
+ throw new Error(`Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`);
41
+ }
42
+ }
43
+ sourceOut = sourceOut.replace(find, replace);
44
+ }
45
+ } catch (err) {
46
+ _didIteratorError = true;
47
+ _iteratorError = err;
48
+ } finally {
49
+ try {
50
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
51
+ _iterator.return();
52
+ }
53
+ } finally {
54
+ if (_didIteratorError) {
55
+ throw _iteratorError;
56
+ }
57
+ }
58
+ }
59
+ return sourceOut;
60
+ }
@@ -5,74 +5,58 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
21
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
23
  var mustReplace_exports = {};
26
- __export(mustReplace_exports, {
27
- mustReplace: () => mustReplace
28
- });
24
+ __export(mustReplace_exports, { mustReplace: () => mustReplace });
29
25
  module.exports = __toCommonJS(mustReplace_exports);
30
26
  var import_fs = require("fs");
31
27
  var import_os = require("os");
32
28
  var import_path = require("path");
33
- function _instanceof(left, right) {
34
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
35
- return !!right[Symbol.hasInstance](left);
36
- } else {
37
- return left instanceof right;
38
- }
39
- }
40
29
  function mustReplace(source, replacements) {
41
- var sourceOut = source;
42
- var _iteratorNormalCompletion = true,
43
- _didIteratorError = false,
44
- _iteratorError = void 0;
45
- try {
46
- for (var _iterator = replacements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
47
- var {
48
- find,
49
- replace,
50
- optional
51
- } = _step.value;
52
- if (!optional) {
53
- var found = _instanceof(find, RegExp) ? find.test(sourceOut) : sourceOut.includes(find);
54
- if (!found) {
55
- var tmpPath = (0, import_path.join)((0, import_os.tmpdir)(), `replace-error-${Math.random()}`);
56
- (0, import_fs.writeFileSync)(tmpPath, sourceOut, "utf-8");
57
- throw new Error(`Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`);
58
- }
59
- }
60
- sourceOut = sourceOut.replace(find, replace);
61
- }
62
- } catch (err) {
63
- _didIteratorError = true;
64
- _iteratorError = err;
65
- } finally {
66
- try {
67
- if (!_iteratorNormalCompletion && _iterator.return != null) {
68
- _iterator.return();
69
- }
70
- } finally {
71
- if (_didIteratorError) {
72
- throw _iteratorError;
73
- }
74
- }
75
- }
76
- return sourceOut;
30
+ var sourceOut = source;
31
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
32
+ try {
33
+ for (var _iterator = replacements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
34
+ var { find, replace, optional } = _step.value;
35
+ if (!optional) {
36
+ var found = find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find);
37
+ if (!found) {
38
+ var tmpPath = (0, import_path.join)((0, import_os.tmpdir)(), `replace-error-${Math.random()}`);
39
+ (0, import_fs.writeFileSync)(tmpPath, sourceOut, "utf-8");
40
+ throw new Error(`Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`);
41
+ }
42
+ }
43
+ sourceOut = sourceOut.replace(find, replace);
44
+ }
45
+ } catch (err) {
46
+ _didIteratorError = true;
47
+ _iteratorError = err;
48
+ } finally {
49
+ try {
50
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
51
+ _iterator.return();
52
+ }
53
+ } finally {
54
+ if (_didIteratorError) {
55
+ throw _iteratorError;
56
+ }
57
+ }
58
+ }
59
+ return sourceOut;
77
60
  }
61
+
78
62
  //# sourceMappingURL=mustReplace.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","mustReplace_exports","mustReplace","module","exports","import_fs","require","import_os","import_path","_instanceof","left","right","Symbol","hasInstance","source","replacements","sourceOut","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","iterator","_step","next","done","find","replace","optional","found","RegExp","test","includes","tmpPath","join","tmpdir","Math","random","writeFileSync","Error","err","return"],"sources":["mustReplace.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar mustReplace_exports = {};\n__export(mustReplace_exports, {\n mustReplace: () => mustReplace\n});\nmodule.exports = __toCommonJS(mustReplace_exports);\nvar import_fs = require(\"fs\");\nvar import_os = require(\"os\");\nvar import_path = require(\"path\");\nfunction _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\nfunction mustReplace(source, replacements) {\n var sourceOut = source;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = replacements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var { find, replace, optional } = _step.value;\n if (!optional) {\n var found = _instanceof(find, RegExp) ? find.test(sourceOut) : sourceOut.includes(find);\n if (!found) {\n var tmpPath = (0, import_path.join)((0, import_os.tmpdir)(), `replace-error-${Math.random()}`);\n (0, import_fs.writeFileSync)(tmpPath, sourceOut, \"utf-8\");\n throw new Error(`Substring or pattern \"${find}\" not found in the string, replacing in source: ${tmpPath}.`);\n }\n }\n sourceOut = sourceOut.replace(find, replace);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return sourceOut;\n}\n//# sourceMappingURL=mustReplace.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;IAAEE,UAAU,EAAE;EAAK,CAAC,CAAC;AACjE,CAAC;AACD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,IAAIG,GAAG,IAAIhB,iBAAiB,CAACa,IAAI,CAAC,EACrC,IAAI,CAACX,YAAY,CAACe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AE;QAC1DpB,SAAS,CAACoB,MAAM,CAAC,CAAC;MACpB;IACF,CAAC,SAAS;MACR,IAAItB,iBAAiB,EAAE;QACrB,MAAMC,cAAc;MACtB;IACF;EACF;EACA,OAAOH,SAAS;AAClB","ignoreList":[]}
1
+ {"version":3,"file":"mustReplace.native.js","names":[],"sources":["cjs/mustReplace.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar mustReplace_exports = {};\n__export(mustReplace_exports, {\n mustReplace: () => mustReplace\n});\nmodule.exports = __toCommonJS(mustReplace_exports);\nvar import_fs = require(\"fs\");\nvar import_os = require(\"os\");\nvar import_path = require(\"path\");\nfunction mustReplace(source, replacements) {\n var sourceOut = source;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = replacements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var { find, replace, optional } = _step.value;\n if (!optional) {\n var found = find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find);\n if (!found) {\n var tmpPath = (0, import_path.join)((0, import_os.tmpdir)(), `replace-error-${Math.random()}`);\n (0, import_fs.writeFileSync)(tmpPath, sourceOut, \"utf-8\");\n throw new Error(`Substring or pattern \"${find}\" not found in the string, replacing in source: ${tmpPath}.`);\n }\n }\n sourceOut = sourceOut.replace(find, replace);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return sourceOut;\n}\n//# sourceMappingURL=mustReplace.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,sBAAsB,CAAC;AAC3B,SAAS,qBAAqB,EAC5B,mBAAmB,YACrB,CAAC;AACD,OAAO,UAAU,aAAa,mBAAmB;AACjD,IAAI,YAAY,QAAQ,IAAI;AAC5B,IAAI,YAAY,QAAQ,IAAI;AAC5B,IAAI,cAAc,QAAQ,MAAM;AAChC,SAAS,YAAY,QAAQ,cAAc;CACzC,IAAI,YAAY;CAChB,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;E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