@patterkit/cli 0.1.1 → 0.1.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/dist/cli.js +113 -1520
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -4121,9 +4121,9 @@ var require_stream = __commonJS({
|
|
|
4121
4121
|
}
|
|
4122
4122
|
});
|
|
4123
4123
|
|
|
4124
|
-
// ../../node_modules/
|
|
4124
|
+
// ../../node_modules/safe-buffer/index.js
|
|
4125
4125
|
var require_safe_buffer = __commonJS({
|
|
4126
|
-
"../../node_modules/
|
|
4126
|
+
"../../node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
4127
4127
|
"use strict";
|
|
4128
4128
|
var buffer2 = __require("buffer");
|
|
4129
4129
|
var Buffer2 = buffer2.Buffer;
|
|
@@ -4243,7 +4243,7 @@ var require_util = __commonJS({
|
|
|
4243
4243
|
typeof arg === "undefined";
|
|
4244
4244
|
}
|
|
4245
4245
|
exports2.isPrimitive = isPrimitive2;
|
|
4246
|
-
exports2.isBuffer =
|
|
4246
|
+
exports2.isBuffer = Buffer.isBuffer;
|
|
4247
4247
|
function objectToString(o) {
|
|
4248
4248
|
return Object.prototype.toString.call(o);
|
|
4249
4249
|
}
|
|
@@ -4970,9 +4970,9 @@ var require_stream_duplex = __commonJS({
|
|
|
4970
4970
|
}
|
|
4971
4971
|
});
|
|
4972
4972
|
|
|
4973
|
-
// ../../node_modules/
|
|
4973
|
+
// ../../node_modules/string_decoder/lib/string_decoder.js
|
|
4974
4974
|
var require_string_decoder = __commonJS({
|
|
4975
|
-
"../../node_modules/
|
|
4975
|
+
"../../node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
4976
4976
|
"use strict";
|
|
4977
4977
|
var Buffer2 = require_safe_buffer().Buffer;
|
|
4978
4978
|
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
@@ -14826,303 +14826,6 @@ var require_stream_duplex2 = __commonJS({
|
|
|
14826
14826
|
}
|
|
14827
14827
|
});
|
|
14828
14828
|
|
|
14829
|
-
// ../../node_modules/safe-buffer/index.js
|
|
14830
|
-
var require_safe_buffer2 = __commonJS({
|
|
14831
|
-
"../../node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
14832
|
-
"use strict";
|
|
14833
|
-
var buffer2 = __require("buffer");
|
|
14834
|
-
var Buffer2 = buffer2.Buffer;
|
|
14835
|
-
function copyProps(src, dst) {
|
|
14836
|
-
for (var key2 in src) {
|
|
14837
|
-
dst[key2] = src[key2];
|
|
14838
|
-
}
|
|
14839
|
-
}
|
|
14840
|
-
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
14841
|
-
module2.exports = buffer2;
|
|
14842
|
-
} else {
|
|
14843
|
-
copyProps(buffer2, exports2);
|
|
14844
|
-
exports2.Buffer = SafeBuffer;
|
|
14845
|
-
}
|
|
14846
|
-
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
14847
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
14848
|
-
}
|
|
14849
|
-
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
14850
|
-
copyProps(Buffer2, SafeBuffer);
|
|
14851
|
-
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
14852
|
-
if (typeof arg === "number") {
|
|
14853
|
-
throw new TypeError("Argument must not be a number");
|
|
14854
|
-
}
|
|
14855
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
14856
|
-
};
|
|
14857
|
-
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
14858
|
-
if (typeof size !== "number") {
|
|
14859
|
-
throw new TypeError("Argument must be a number");
|
|
14860
|
-
}
|
|
14861
|
-
var buf = Buffer2(size);
|
|
14862
|
-
if (fill !== void 0) {
|
|
14863
|
-
if (typeof encoding === "string") {
|
|
14864
|
-
buf.fill(fill, encoding);
|
|
14865
|
-
} else {
|
|
14866
|
-
buf.fill(fill);
|
|
14867
|
-
}
|
|
14868
|
-
} else {
|
|
14869
|
-
buf.fill(0);
|
|
14870
|
-
}
|
|
14871
|
-
return buf;
|
|
14872
|
-
};
|
|
14873
|
-
SafeBuffer.allocUnsafe = function(size) {
|
|
14874
|
-
if (typeof size !== "number") {
|
|
14875
|
-
throw new TypeError("Argument must be a number");
|
|
14876
|
-
}
|
|
14877
|
-
return Buffer2(size);
|
|
14878
|
-
};
|
|
14879
|
-
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
14880
|
-
if (typeof size !== "number") {
|
|
14881
|
-
throw new TypeError("Argument must be a number");
|
|
14882
|
-
}
|
|
14883
|
-
return buffer2.SlowBuffer(size);
|
|
14884
|
-
};
|
|
14885
|
-
}
|
|
14886
|
-
});
|
|
14887
|
-
|
|
14888
|
-
// ../../node_modules/string_decoder/lib/string_decoder.js
|
|
14889
|
-
var require_string_decoder2 = __commonJS({
|
|
14890
|
-
"../../node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
14891
|
-
"use strict";
|
|
14892
|
-
var Buffer2 = require_safe_buffer2().Buffer;
|
|
14893
|
-
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
14894
|
-
encoding = "" + encoding;
|
|
14895
|
-
switch (encoding && encoding.toLowerCase()) {
|
|
14896
|
-
case "hex":
|
|
14897
|
-
case "utf8":
|
|
14898
|
-
case "utf-8":
|
|
14899
|
-
case "ascii":
|
|
14900
|
-
case "binary":
|
|
14901
|
-
case "base64":
|
|
14902
|
-
case "ucs2":
|
|
14903
|
-
case "ucs-2":
|
|
14904
|
-
case "utf16le":
|
|
14905
|
-
case "utf-16le":
|
|
14906
|
-
case "raw":
|
|
14907
|
-
return true;
|
|
14908
|
-
default:
|
|
14909
|
-
return false;
|
|
14910
|
-
}
|
|
14911
|
-
};
|
|
14912
|
-
function _normalizeEncoding(enc) {
|
|
14913
|
-
if (!enc) return "utf8";
|
|
14914
|
-
var retried;
|
|
14915
|
-
while (true) {
|
|
14916
|
-
switch (enc) {
|
|
14917
|
-
case "utf8":
|
|
14918
|
-
case "utf-8":
|
|
14919
|
-
return "utf8";
|
|
14920
|
-
case "ucs2":
|
|
14921
|
-
case "ucs-2":
|
|
14922
|
-
case "utf16le":
|
|
14923
|
-
case "utf-16le":
|
|
14924
|
-
return "utf16le";
|
|
14925
|
-
case "latin1":
|
|
14926
|
-
case "binary":
|
|
14927
|
-
return "latin1";
|
|
14928
|
-
case "base64":
|
|
14929
|
-
case "ascii":
|
|
14930
|
-
case "hex":
|
|
14931
|
-
return enc;
|
|
14932
|
-
default:
|
|
14933
|
-
if (retried) return;
|
|
14934
|
-
enc = ("" + enc).toLowerCase();
|
|
14935
|
-
retried = true;
|
|
14936
|
-
}
|
|
14937
|
-
}
|
|
14938
|
-
}
|
|
14939
|
-
function normalizeEncoding(enc) {
|
|
14940
|
-
var nenc = _normalizeEncoding(enc);
|
|
14941
|
-
if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
14942
|
-
return nenc || enc;
|
|
14943
|
-
}
|
|
14944
|
-
exports2.StringDecoder = StringDecoder;
|
|
14945
|
-
function StringDecoder(encoding) {
|
|
14946
|
-
this.encoding = normalizeEncoding(encoding);
|
|
14947
|
-
var nb;
|
|
14948
|
-
switch (this.encoding) {
|
|
14949
|
-
case "utf16le":
|
|
14950
|
-
this.text = utf16Text;
|
|
14951
|
-
this.end = utf16End;
|
|
14952
|
-
nb = 4;
|
|
14953
|
-
break;
|
|
14954
|
-
case "utf8":
|
|
14955
|
-
this.fillLast = utf8FillLast;
|
|
14956
|
-
nb = 4;
|
|
14957
|
-
break;
|
|
14958
|
-
case "base64":
|
|
14959
|
-
this.text = base64Text;
|
|
14960
|
-
this.end = base64End;
|
|
14961
|
-
nb = 3;
|
|
14962
|
-
break;
|
|
14963
|
-
default:
|
|
14964
|
-
this.write = simpleWrite;
|
|
14965
|
-
this.end = simpleEnd;
|
|
14966
|
-
return;
|
|
14967
|
-
}
|
|
14968
|
-
this.lastNeed = 0;
|
|
14969
|
-
this.lastTotal = 0;
|
|
14970
|
-
this.lastChar = Buffer2.allocUnsafe(nb);
|
|
14971
|
-
}
|
|
14972
|
-
StringDecoder.prototype.write = function(buf) {
|
|
14973
|
-
if (buf.length === 0) return "";
|
|
14974
|
-
var r;
|
|
14975
|
-
var i;
|
|
14976
|
-
if (this.lastNeed) {
|
|
14977
|
-
r = this.fillLast(buf);
|
|
14978
|
-
if (r === void 0) return "";
|
|
14979
|
-
i = this.lastNeed;
|
|
14980
|
-
this.lastNeed = 0;
|
|
14981
|
-
} else {
|
|
14982
|
-
i = 0;
|
|
14983
|
-
}
|
|
14984
|
-
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
14985
|
-
return r || "";
|
|
14986
|
-
};
|
|
14987
|
-
StringDecoder.prototype.end = utf8End;
|
|
14988
|
-
StringDecoder.prototype.text = utf8Text;
|
|
14989
|
-
StringDecoder.prototype.fillLast = function(buf) {
|
|
14990
|
-
if (this.lastNeed <= buf.length) {
|
|
14991
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
14992
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
14993
|
-
}
|
|
14994
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
14995
|
-
this.lastNeed -= buf.length;
|
|
14996
|
-
};
|
|
14997
|
-
function utf8CheckByte(byte) {
|
|
14998
|
-
if (byte <= 127) return 0;
|
|
14999
|
-
else if (byte >> 5 === 6) return 2;
|
|
15000
|
-
else if (byte >> 4 === 14) return 3;
|
|
15001
|
-
else if (byte >> 3 === 30) return 4;
|
|
15002
|
-
return byte >> 6 === 2 ? -1 : -2;
|
|
15003
|
-
}
|
|
15004
|
-
function utf8CheckIncomplete(self2, buf, i) {
|
|
15005
|
-
var j = buf.length - 1;
|
|
15006
|
-
if (j < i) return 0;
|
|
15007
|
-
var nb = utf8CheckByte(buf[j]);
|
|
15008
|
-
if (nb >= 0) {
|
|
15009
|
-
if (nb > 0) self2.lastNeed = nb - 1;
|
|
15010
|
-
return nb;
|
|
15011
|
-
}
|
|
15012
|
-
if (--j < i || nb === -2) return 0;
|
|
15013
|
-
nb = utf8CheckByte(buf[j]);
|
|
15014
|
-
if (nb >= 0) {
|
|
15015
|
-
if (nb > 0) self2.lastNeed = nb - 2;
|
|
15016
|
-
return nb;
|
|
15017
|
-
}
|
|
15018
|
-
if (--j < i || nb === -2) return 0;
|
|
15019
|
-
nb = utf8CheckByte(buf[j]);
|
|
15020
|
-
if (nb >= 0) {
|
|
15021
|
-
if (nb > 0) {
|
|
15022
|
-
if (nb === 2) nb = 0;
|
|
15023
|
-
else self2.lastNeed = nb - 3;
|
|
15024
|
-
}
|
|
15025
|
-
return nb;
|
|
15026
|
-
}
|
|
15027
|
-
return 0;
|
|
15028
|
-
}
|
|
15029
|
-
function utf8CheckExtraBytes(self2, buf, p) {
|
|
15030
|
-
if ((buf[0] & 192) !== 128) {
|
|
15031
|
-
self2.lastNeed = 0;
|
|
15032
|
-
return "\uFFFD";
|
|
15033
|
-
}
|
|
15034
|
-
if (self2.lastNeed > 1 && buf.length > 1) {
|
|
15035
|
-
if ((buf[1] & 192) !== 128) {
|
|
15036
|
-
self2.lastNeed = 1;
|
|
15037
|
-
return "\uFFFD";
|
|
15038
|
-
}
|
|
15039
|
-
if (self2.lastNeed > 2 && buf.length > 2) {
|
|
15040
|
-
if ((buf[2] & 192) !== 128) {
|
|
15041
|
-
self2.lastNeed = 2;
|
|
15042
|
-
return "\uFFFD";
|
|
15043
|
-
}
|
|
15044
|
-
}
|
|
15045
|
-
}
|
|
15046
|
-
}
|
|
15047
|
-
function utf8FillLast(buf) {
|
|
15048
|
-
var p = this.lastTotal - this.lastNeed;
|
|
15049
|
-
var r = utf8CheckExtraBytes(this, buf, p);
|
|
15050
|
-
if (r !== void 0) return r;
|
|
15051
|
-
if (this.lastNeed <= buf.length) {
|
|
15052
|
-
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
15053
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
15054
|
-
}
|
|
15055
|
-
buf.copy(this.lastChar, p, 0, buf.length);
|
|
15056
|
-
this.lastNeed -= buf.length;
|
|
15057
|
-
}
|
|
15058
|
-
function utf8Text(buf, i) {
|
|
15059
|
-
var total = utf8CheckIncomplete(this, buf, i);
|
|
15060
|
-
if (!this.lastNeed) return buf.toString("utf8", i);
|
|
15061
|
-
this.lastTotal = total;
|
|
15062
|
-
var end = buf.length - (total - this.lastNeed);
|
|
15063
|
-
buf.copy(this.lastChar, 0, end);
|
|
15064
|
-
return buf.toString("utf8", i, end);
|
|
15065
|
-
}
|
|
15066
|
-
function utf8End(buf) {
|
|
15067
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
15068
|
-
if (this.lastNeed) return r + "\uFFFD";
|
|
15069
|
-
return r;
|
|
15070
|
-
}
|
|
15071
|
-
function utf16Text(buf, i) {
|
|
15072
|
-
if ((buf.length - i) % 2 === 0) {
|
|
15073
|
-
var r = buf.toString("utf16le", i);
|
|
15074
|
-
if (r) {
|
|
15075
|
-
var c2 = r.charCodeAt(r.length - 1);
|
|
15076
|
-
if (c2 >= 55296 && c2 <= 56319) {
|
|
15077
|
-
this.lastNeed = 2;
|
|
15078
|
-
this.lastTotal = 4;
|
|
15079
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
15080
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
15081
|
-
return r.slice(0, -1);
|
|
15082
|
-
}
|
|
15083
|
-
}
|
|
15084
|
-
return r;
|
|
15085
|
-
}
|
|
15086
|
-
this.lastNeed = 1;
|
|
15087
|
-
this.lastTotal = 2;
|
|
15088
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
15089
|
-
return buf.toString("utf16le", i, buf.length - 1);
|
|
15090
|
-
}
|
|
15091
|
-
function utf16End(buf) {
|
|
15092
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
15093
|
-
if (this.lastNeed) {
|
|
15094
|
-
var end = this.lastTotal - this.lastNeed;
|
|
15095
|
-
return r + this.lastChar.toString("utf16le", 0, end);
|
|
15096
|
-
}
|
|
15097
|
-
return r;
|
|
15098
|
-
}
|
|
15099
|
-
function base64Text(buf, i) {
|
|
15100
|
-
var n = (buf.length - i) % 3;
|
|
15101
|
-
if (n === 0) return buf.toString("base64", i);
|
|
15102
|
-
this.lastNeed = 3 - n;
|
|
15103
|
-
this.lastTotal = 3;
|
|
15104
|
-
if (n === 1) {
|
|
15105
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
15106
|
-
} else {
|
|
15107
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
15108
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
15109
|
-
}
|
|
15110
|
-
return buf.toString("base64", i, buf.length - n);
|
|
15111
|
-
}
|
|
15112
|
-
function base64End(buf) {
|
|
15113
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
15114
|
-
if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
|
|
15115
|
-
return r;
|
|
15116
|
-
}
|
|
15117
|
-
function simpleWrite(buf) {
|
|
15118
|
-
return buf.toString(this.encoding);
|
|
15119
|
-
}
|
|
15120
|
-
function simpleEnd(buf) {
|
|
15121
|
-
return buf && buf.length ? this.write(buf) : "";
|
|
15122
|
-
}
|
|
15123
|
-
}
|
|
15124
|
-
});
|
|
15125
|
-
|
|
15126
14829
|
// ../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js
|
|
15127
14830
|
var require_end_of_stream = __commonJS({
|
|
15128
14831
|
"../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) {
|
|
@@ -15596,7 +15299,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
15596
15299
|
this.decoder = null;
|
|
15597
15300
|
this.encoding = null;
|
|
15598
15301
|
if (options.encoding) {
|
|
15599
|
-
if (!StringDecoder) StringDecoder =
|
|
15302
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
15600
15303
|
this.decoder = new StringDecoder(options.encoding);
|
|
15601
15304
|
this.encoding = options.encoding;
|
|
15602
15305
|
}
|
|
@@ -15718,7 +15421,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
15718
15421
|
return this._readableState.flowing === false;
|
|
15719
15422
|
};
|
|
15720
15423
|
Readable.prototype.setEncoding = function(enc) {
|
|
15721
|
-
if (!StringDecoder) StringDecoder =
|
|
15424
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
15722
15425
|
var decoder = new StringDecoder(enc);
|
|
15723
15426
|
this._readableState.decoder = decoder;
|
|
15724
15427
|
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
@@ -37612,64 +37315,6 @@ var require_stream3 = __commonJS({
|
|
|
37612
37315
|
}
|
|
37613
37316
|
});
|
|
37614
37317
|
|
|
37615
|
-
// ../../node_modules/lazystream/node_modules/safe-buffer/index.js
|
|
37616
|
-
var require_safe_buffer3 = __commonJS({
|
|
37617
|
-
"../../node_modules/lazystream/node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
37618
|
-
"use strict";
|
|
37619
|
-
var buffer2 = __require("buffer");
|
|
37620
|
-
var Buffer2 = buffer2.Buffer;
|
|
37621
|
-
function copyProps(src, dst) {
|
|
37622
|
-
for (var key2 in src) {
|
|
37623
|
-
dst[key2] = src[key2];
|
|
37624
|
-
}
|
|
37625
|
-
}
|
|
37626
|
-
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
37627
|
-
module2.exports = buffer2;
|
|
37628
|
-
} else {
|
|
37629
|
-
copyProps(buffer2, exports2);
|
|
37630
|
-
exports2.Buffer = SafeBuffer;
|
|
37631
|
-
}
|
|
37632
|
-
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
37633
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
37634
|
-
}
|
|
37635
|
-
copyProps(Buffer2, SafeBuffer);
|
|
37636
|
-
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
37637
|
-
if (typeof arg === "number") {
|
|
37638
|
-
throw new TypeError("Argument must not be a number");
|
|
37639
|
-
}
|
|
37640
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
37641
|
-
};
|
|
37642
|
-
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
37643
|
-
if (typeof size !== "number") {
|
|
37644
|
-
throw new TypeError("Argument must be a number");
|
|
37645
|
-
}
|
|
37646
|
-
var buf = Buffer2(size);
|
|
37647
|
-
if (fill !== void 0) {
|
|
37648
|
-
if (typeof encoding === "string") {
|
|
37649
|
-
buf.fill(fill, encoding);
|
|
37650
|
-
} else {
|
|
37651
|
-
buf.fill(fill);
|
|
37652
|
-
}
|
|
37653
|
-
} else {
|
|
37654
|
-
buf.fill(0);
|
|
37655
|
-
}
|
|
37656
|
-
return buf;
|
|
37657
|
-
};
|
|
37658
|
-
SafeBuffer.allocUnsafe = function(size) {
|
|
37659
|
-
if (typeof size !== "number") {
|
|
37660
|
-
throw new TypeError("Argument must be a number");
|
|
37661
|
-
}
|
|
37662
|
-
return Buffer2(size);
|
|
37663
|
-
};
|
|
37664
|
-
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
37665
|
-
if (typeof size !== "number") {
|
|
37666
|
-
throw new TypeError("Argument must be a number");
|
|
37667
|
-
}
|
|
37668
|
-
return buffer2.SlowBuffer(size);
|
|
37669
|
-
};
|
|
37670
|
-
}
|
|
37671
|
-
});
|
|
37672
|
-
|
|
37673
37318
|
// ../../node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/BufferList.js
|
|
37674
37319
|
var require_BufferList2 = __commonJS({
|
|
37675
37320
|
"../../node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) {
|
|
@@ -37679,7 +37324,7 @@ var require_BufferList2 = __commonJS({
|
|
|
37679
37324
|
throw new TypeError("Cannot call a class as a function");
|
|
37680
37325
|
}
|
|
37681
37326
|
}
|
|
37682
|
-
var Buffer2 =
|
|
37327
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
37683
37328
|
var util2 = __require("util");
|
|
37684
37329
|
function copyBuffer(src, target, offset) {
|
|
37685
37330
|
src.copy(target, offset);
|
|
@@ -37840,7 +37485,7 @@ var require_stream_writable3 = __commonJS({
|
|
|
37840
37485
|
deprecate: require_node()
|
|
37841
37486
|
};
|
|
37842
37487
|
var Stream = require_stream3();
|
|
37843
|
-
var Buffer2 =
|
|
37488
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
37844
37489
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
37845
37490
|
};
|
|
37846
37491
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -38334,244 +37979,6 @@ var require_stream_duplex3 = __commonJS({
|
|
|
38334
37979
|
}
|
|
38335
37980
|
});
|
|
38336
37981
|
|
|
38337
|
-
// ../../node_modules/lazystream/node_modules/string_decoder/lib/string_decoder.js
|
|
38338
|
-
var require_string_decoder3 = __commonJS({
|
|
38339
|
-
"../../node_modules/lazystream/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
38340
|
-
"use strict";
|
|
38341
|
-
var Buffer2 = require_safe_buffer3().Buffer;
|
|
38342
|
-
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
38343
|
-
encoding = "" + encoding;
|
|
38344
|
-
switch (encoding && encoding.toLowerCase()) {
|
|
38345
|
-
case "hex":
|
|
38346
|
-
case "utf8":
|
|
38347
|
-
case "utf-8":
|
|
38348
|
-
case "ascii":
|
|
38349
|
-
case "binary":
|
|
38350
|
-
case "base64":
|
|
38351
|
-
case "ucs2":
|
|
38352
|
-
case "ucs-2":
|
|
38353
|
-
case "utf16le":
|
|
38354
|
-
case "utf-16le":
|
|
38355
|
-
case "raw":
|
|
38356
|
-
return true;
|
|
38357
|
-
default:
|
|
38358
|
-
return false;
|
|
38359
|
-
}
|
|
38360
|
-
};
|
|
38361
|
-
function _normalizeEncoding(enc) {
|
|
38362
|
-
if (!enc) return "utf8";
|
|
38363
|
-
var retried;
|
|
38364
|
-
while (true) {
|
|
38365
|
-
switch (enc) {
|
|
38366
|
-
case "utf8":
|
|
38367
|
-
case "utf-8":
|
|
38368
|
-
return "utf8";
|
|
38369
|
-
case "ucs2":
|
|
38370
|
-
case "ucs-2":
|
|
38371
|
-
case "utf16le":
|
|
38372
|
-
case "utf-16le":
|
|
38373
|
-
return "utf16le";
|
|
38374
|
-
case "latin1":
|
|
38375
|
-
case "binary":
|
|
38376
|
-
return "latin1";
|
|
38377
|
-
case "base64":
|
|
38378
|
-
case "ascii":
|
|
38379
|
-
case "hex":
|
|
38380
|
-
return enc;
|
|
38381
|
-
default:
|
|
38382
|
-
if (retried) return;
|
|
38383
|
-
enc = ("" + enc).toLowerCase();
|
|
38384
|
-
retried = true;
|
|
38385
|
-
}
|
|
38386
|
-
}
|
|
38387
|
-
}
|
|
38388
|
-
function normalizeEncoding(enc) {
|
|
38389
|
-
var nenc = _normalizeEncoding(enc);
|
|
38390
|
-
if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
38391
|
-
return nenc || enc;
|
|
38392
|
-
}
|
|
38393
|
-
exports2.StringDecoder = StringDecoder;
|
|
38394
|
-
function StringDecoder(encoding) {
|
|
38395
|
-
this.encoding = normalizeEncoding(encoding);
|
|
38396
|
-
var nb;
|
|
38397
|
-
switch (this.encoding) {
|
|
38398
|
-
case "utf16le":
|
|
38399
|
-
this.text = utf16Text;
|
|
38400
|
-
this.end = utf16End;
|
|
38401
|
-
nb = 4;
|
|
38402
|
-
break;
|
|
38403
|
-
case "utf8":
|
|
38404
|
-
this.fillLast = utf8FillLast;
|
|
38405
|
-
nb = 4;
|
|
38406
|
-
break;
|
|
38407
|
-
case "base64":
|
|
38408
|
-
this.text = base64Text;
|
|
38409
|
-
this.end = base64End;
|
|
38410
|
-
nb = 3;
|
|
38411
|
-
break;
|
|
38412
|
-
default:
|
|
38413
|
-
this.write = simpleWrite;
|
|
38414
|
-
this.end = simpleEnd;
|
|
38415
|
-
return;
|
|
38416
|
-
}
|
|
38417
|
-
this.lastNeed = 0;
|
|
38418
|
-
this.lastTotal = 0;
|
|
38419
|
-
this.lastChar = Buffer2.allocUnsafe(nb);
|
|
38420
|
-
}
|
|
38421
|
-
StringDecoder.prototype.write = function(buf) {
|
|
38422
|
-
if (buf.length === 0) return "";
|
|
38423
|
-
var r;
|
|
38424
|
-
var i;
|
|
38425
|
-
if (this.lastNeed) {
|
|
38426
|
-
r = this.fillLast(buf);
|
|
38427
|
-
if (r === void 0) return "";
|
|
38428
|
-
i = this.lastNeed;
|
|
38429
|
-
this.lastNeed = 0;
|
|
38430
|
-
} else {
|
|
38431
|
-
i = 0;
|
|
38432
|
-
}
|
|
38433
|
-
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
38434
|
-
return r || "";
|
|
38435
|
-
};
|
|
38436
|
-
StringDecoder.prototype.end = utf8End;
|
|
38437
|
-
StringDecoder.prototype.text = utf8Text;
|
|
38438
|
-
StringDecoder.prototype.fillLast = function(buf) {
|
|
38439
|
-
if (this.lastNeed <= buf.length) {
|
|
38440
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
38441
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
38442
|
-
}
|
|
38443
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
38444
|
-
this.lastNeed -= buf.length;
|
|
38445
|
-
};
|
|
38446
|
-
function utf8CheckByte(byte) {
|
|
38447
|
-
if (byte <= 127) return 0;
|
|
38448
|
-
else if (byte >> 5 === 6) return 2;
|
|
38449
|
-
else if (byte >> 4 === 14) return 3;
|
|
38450
|
-
else if (byte >> 3 === 30) return 4;
|
|
38451
|
-
return byte >> 6 === 2 ? -1 : -2;
|
|
38452
|
-
}
|
|
38453
|
-
function utf8CheckIncomplete(self2, buf, i) {
|
|
38454
|
-
var j = buf.length - 1;
|
|
38455
|
-
if (j < i) return 0;
|
|
38456
|
-
var nb = utf8CheckByte(buf[j]);
|
|
38457
|
-
if (nb >= 0) {
|
|
38458
|
-
if (nb > 0) self2.lastNeed = nb - 1;
|
|
38459
|
-
return nb;
|
|
38460
|
-
}
|
|
38461
|
-
if (--j < i || nb === -2) return 0;
|
|
38462
|
-
nb = utf8CheckByte(buf[j]);
|
|
38463
|
-
if (nb >= 0) {
|
|
38464
|
-
if (nb > 0) self2.lastNeed = nb - 2;
|
|
38465
|
-
return nb;
|
|
38466
|
-
}
|
|
38467
|
-
if (--j < i || nb === -2) return 0;
|
|
38468
|
-
nb = utf8CheckByte(buf[j]);
|
|
38469
|
-
if (nb >= 0) {
|
|
38470
|
-
if (nb > 0) {
|
|
38471
|
-
if (nb === 2) nb = 0;
|
|
38472
|
-
else self2.lastNeed = nb - 3;
|
|
38473
|
-
}
|
|
38474
|
-
return nb;
|
|
38475
|
-
}
|
|
38476
|
-
return 0;
|
|
38477
|
-
}
|
|
38478
|
-
function utf8CheckExtraBytes(self2, buf, p) {
|
|
38479
|
-
if ((buf[0] & 192) !== 128) {
|
|
38480
|
-
self2.lastNeed = 0;
|
|
38481
|
-
return "\uFFFD";
|
|
38482
|
-
}
|
|
38483
|
-
if (self2.lastNeed > 1 && buf.length > 1) {
|
|
38484
|
-
if ((buf[1] & 192) !== 128) {
|
|
38485
|
-
self2.lastNeed = 1;
|
|
38486
|
-
return "\uFFFD";
|
|
38487
|
-
}
|
|
38488
|
-
if (self2.lastNeed > 2 && buf.length > 2) {
|
|
38489
|
-
if ((buf[2] & 192) !== 128) {
|
|
38490
|
-
self2.lastNeed = 2;
|
|
38491
|
-
return "\uFFFD";
|
|
38492
|
-
}
|
|
38493
|
-
}
|
|
38494
|
-
}
|
|
38495
|
-
}
|
|
38496
|
-
function utf8FillLast(buf) {
|
|
38497
|
-
var p = this.lastTotal - this.lastNeed;
|
|
38498
|
-
var r = utf8CheckExtraBytes(this, buf, p);
|
|
38499
|
-
if (r !== void 0) return r;
|
|
38500
|
-
if (this.lastNeed <= buf.length) {
|
|
38501
|
-
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
38502
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
38503
|
-
}
|
|
38504
|
-
buf.copy(this.lastChar, p, 0, buf.length);
|
|
38505
|
-
this.lastNeed -= buf.length;
|
|
38506
|
-
}
|
|
38507
|
-
function utf8Text(buf, i) {
|
|
38508
|
-
var total = utf8CheckIncomplete(this, buf, i);
|
|
38509
|
-
if (!this.lastNeed) return buf.toString("utf8", i);
|
|
38510
|
-
this.lastTotal = total;
|
|
38511
|
-
var end = buf.length - (total - this.lastNeed);
|
|
38512
|
-
buf.copy(this.lastChar, 0, end);
|
|
38513
|
-
return buf.toString("utf8", i, end);
|
|
38514
|
-
}
|
|
38515
|
-
function utf8End(buf) {
|
|
38516
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
38517
|
-
if (this.lastNeed) return r + "\uFFFD";
|
|
38518
|
-
return r;
|
|
38519
|
-
}
|
|
38520
|
-
function utf16Text(buf, i) {
|
|
38521
|
-
if ((buf.length - i) % 2 === 0) {
|
|
38522
|
-
var r = buf.toString("utf16le", i);
|
|
38523
|
-
if (r) {
|
|
38524
|
-
var c2 = r.charCodeAt(r.length - 1);
|
|
38525
|
-
if (c2 >= 55296 && c2 <= 56319) {
|
|
38526
|
-
this.lastNeed = 2;
|
|
38527
|
-
this.lastTotal = 4;
|
|
38528
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
38529
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
38530
|
-
return r.slice(0, -1);
|
|
38531
|
-
}
|
|
38532
|
-
}
|
|
38533
|
-
return r;
|
|
38534
|
-
}
|
|
38535
|
-
this.lastNeed = 1;
|
|
38536
|
-
this.lastTotal = 2;
|
|
38537
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
38538
|
-
return buf.toString("utf16le", i, buf.length - 1);
|
|
38539
|
-
}
|
|
38540
|
-
function utf16End(buf) {
|
|
38541
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
38542
|
-
if (this.lastNeed) {
|
|
38543
|
-
var end = this.lastTotal - this.lastNeed;
|
|
38544
|
-
return r + this.lastChar.toString("utf16le", 0, end);
|
|
38545
|
-
}
|
|
38546
|
-
return r;
|
|
38547
|
-
}
|
|
38548
|
-
function base64Text(buf, i) {
|
|
38549
|
-
var n = (buf.length - i) % 3;
|
|
38550
|
-
if (n === 0) return buf.toString("base64", i);
|
|
38551
|
-
this.lastNeed = 3 - n;
|
|
38552
|
-
this.lastTotal = 3;
|
|
38553
|
-
if (n === 1) {
|
|
38554
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
38555
|
-
} else {
|
|
38556
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
38557
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
38558
|
-
}
|
|
38559
|
-
return buf.toString("base64", i, buf.length - n);
|
|
38560
|
-
}
|
|
38561
|
-
function base64End(buf) {
|
|
38562
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
38563
|
-
if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
|
|
38564
|
-
return r;
|
|
38565
|
-
}
|
|
38566
|
-
function simpleWrite(buf) {
|
|
38567
|
-
return buf.toString(this.encoding);
|
|
38568
|
-
}
|
|
38569
|
-
function simpleEnd(buf) {
|
|
38570
|
-
return buf && buf.length ? this.write(buf) : "";
|
|
38571
|
-
}
|
|
38572
|
-
}
|
|
38573
|
-
});
|
|
38574
|
-
|
|
38575
37982
|
// ../../node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js
|
|
38576
37983
|
var require_stream_readable3 = __commonJS({
|
|
38577
37984
|
"../../node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
|
|
@@ -38586,7 +37993,7 @@ var require_stream_readable3 = __commonJS({
|
|
|
38586
37993
|
return emitter.listeners(type).length;
|
|
38587
37994
|
};
|
|
38588
37995
|
var Stream = require_stream3();
|
|
38589
|
-
var Buffer2 =
|
|
37996
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
38590
37997
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
38591
37998
|
};
|
|
38592
37999
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -38649,7 +38056,7 @@ var require_stream_readable3 = __commonJS({
|
|
|
38649
38056
|
this.decoder = null;
|
|
38650
38057
|
this.encoding = null;
|
|
38651
38058
|
if (options.encoding) {
|
|
38652
|
-
if (!StringDecoder) StringDecoder =
|
|
38059
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
38653
38060
|
this.decoder = new StringDecoder(options.encoding);
|
|
38654
38061
|
this.encoding = options.encoding;
|
|
38655
38062
|
}
|
|
@@ -38766,7 +38173,7 @@ var require_stream_readable3 = __commonJS({
|
|
|
38766
38173
|
return this._readableState.flowing === false;
|
|
38767
38174
|
};
|
|
38768
38175
|
Readable.prototype.setEncoding = function(enc) {
|
|
38769
|
-
if (!StringDecoder) StringDecoder =
|
|
38176
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
38770
38177
|
this._readableState.decoder = new StringDecoder(enc);
|
|
38771
38178
|
this._readableState.encoding = enc;
|
|
38772
38179
|
return this;
|
|
@@ -39673,64 +39080,6 @@ var require_stream4 = __commonJS({
|
|
|
39673
39080
|
}
|
|
39674
39081
|
});
|
|
39675
39082
|
|
|
39676
|
-
// ../../node_modules/archiver-utils/node_modules/safe-buffer/index.js
|
|
39677
|
-
var require_safe_buffer4 = __commonJS({
|
|
39678
|
-
"../../node_modules/archiver-utils/node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
39679
|
-
"use strict";
|
|
39680
|
-
var buffer2 = __require("buffer");
|
|
39681
|
-
var Buffer2 = buffer2.Buffer;
|
|
39682
|
-
function copyProps(src, dst) {
|
|
39683
|
-
for (var key2 in src) {
|
|
39684
|
-
dst[key2] = src[key2];
|
|
39685
|
-
}
|
|
39686
|
-
}
|
|
39687
|
-
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
39688
|
-
module2.exports = buffer2;
|
|
39689
|
-
} else {
|
|
39690
|
-
copyProps(buffer2, exports2);
|
|
39691
|
-
exports2.Buffer = SafeBuffer;
|
|
39692
|
-
}
|
|
39693
|
-
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
39694
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
39695
|
-
}
|
|
39696
|
-
copyProps(Buffer2, SafeBuffer);
|
|
39697
|
-
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
39698
|
-
if (typeof arg === "number") {
|
|
39699
|
-
throw new TypeError("Argument must not be a number");
|
|
39700
|
-
}
|
|
39701
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
39702
|
-
};
|
|
39703
|
-
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
39704
|
-
if (typeof size !== "number") {
|
|
39705
|
-
throw new TypeError("Argument must be a number");
|
|
39706
|
-
}
|
|
39707
|
-
var buf = Buffer2(size);
|
|
39708
|
-
if (fill !== void 0) {
|
|
39709
|
-
if (typeof encoding === "string") {
|
|
39710
|
-
buf.fill(fill, encoding);
|
|
39711
|
-
} else {
|
|
39712
|
-
buf.fill(fill);
|
|
39713
|
-
}
|
|
39714
|
-
} else {
|
|
39715
|
-
buf.fill(0);
|
|
39716
|
-
}
|
|
39717
|
-
return buf;
|
|
39718
|
-
};
|
|
39719
|
-
SafeBuffer.allocUnsafe = function(size) {
|
|
39720
|
-
if (typeof size !== "number") {
|
|
39721
|
-
throw new TypeError("Argument must be a number");
|
|
39722
|
-
}
|
|
39723
|
-
return Buffer2(size);
|
|
39724
|
-
};
|
|
39725
|
-
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
39726
|
-
if (typeof size !== "number") {
|
|
39727
|
-
throw new TypeError("Argument must be a number");
|
|
39728
|
-
}
|
|
39729
|
-
return buffer2.SlowBuffer(size);
|
|
39730
|
-
};
|
|
39731
|
-
}
|
|
39732
|
-
});
|
|
39733
|
-
|
|
39734
39083
|
// ../../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/BufferList.js
|
|
39735
39084
|
var require_BufferList3 = __commonJS({
|
|
39736
39085
|
"../../node_modules/archiver-utils/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) {
|
|
@@ -39740,7 +39089,7 @@ var require_BufferList3 = __commonJS({
|
|
|
39740
39089
|
throw new TypeError("Cannot call a class as a function");
|
|
39741
39090
|
}
|
|
39742
39091
|
}
|
|
39743
|
-
var Buffer2 =
|
|
39092
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
39744
39093
|
var util2 = __require("util");
|
|
39745
39094
|
function copyBuffer(src, target, offset) {
|
|
39746
39095
|
src.copy(target, offset);
|
|
@@ -39901,7 +39250,7 @@ var require_stream_writable4 = __commonJS({
|
|
|
39901
39250
|
deprecate: require_node()
|
|
39902
39251
|
};
|
|
39903
39252
|
var Stream = require_stream4();
|
|
39904
|
-
var Buffer2 =
|
|
39253
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
39905
39254
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
39906
39255
|
};
|
|
39907
39256
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -40395,244 +39744,6 @@ var require_stream_duplex4 = __commonJS({
|
|
|
40395
39744
|
}
|
|
40396
39745
|
});
|
|
40397
39746
|
|
|
40398
|
-
// ../../node_modules/archiver-utils/node_modules/string_decoder/lib/string_decoder.js
|
|
40399
|
-
var require_string_decoder4 = __commonJS({
|
|
40400
|
-
"../../node_modules/archiver-utils/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
40401
|
-
"use strict";
|
|
40402
|
-
var Buffer2 = require_safe_buffer4().Buffer;
|
|
40403
|
-
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
40404
|
-
encoding = "" + encoding;
|
|
40405
|
-
switch (encoding && encoding.toLowerCase()) {
|
|
40406
|
-
case "hex":
|
|
40407
|
-
case "utf8":
|
|
40408
|
-
case "utf-8":
|
|
40409
|
-
case "ascii":
|
|
40410
|
-
case "binary":
|
|
40411
|
-
case "base64":
|
|
40412
|
-
case "ucs2":
|
|
40413
|
-
case "ucs-2":
|
|
40414
|
-
case "utf16le":
|
|
40415
|
-
case "utf-16le":
|
|
40416
|
-
case "raw":
|
|
40417
|
-
return true;
|
|
40418
|
-
default:
|
|
40419
|
-
return false;
|
|
40420
|
-
}
|
|
40421
|
-
};
|
|
40422
|
-
function _normalizeEncoding(enc) {
|
|
40423
|
-
if (!enc) return "utf8";
|
|
40424
|
-
var retried;
|
|
40425
|
-
while (true) {
|
|
40426
|
-
switch (enc) {
|
|
40427
|
-
case "utf8":
|
|
40428
|
-
case "utf-8":
|
|
40429
|
-
return "utf8";
|
|
40430
|
-
case "ucs2":
|
|
40431
|
-
case "ucs-2":
|
|
40432
|
-
case "utf16le":
|
|
40433
|
-
case "utf-16le":
|
|
40434
|
-
return "utf16le";
|
|
40435
|
-
case "latin1":
|
|
40436
|
-
case "binary":
|
|
40437
|
-
return "latin1";
|
|
40438
|
-
case "base64":
|
|
40439
|
-
case "ascii":
|
|
40440
|
-
case "hex":
|
|
40441
|
-
return enc;
|
|
40442
|
-
default:
|
|
40443
|
-
if (retried) return;
|
|
40444
|
-
enc = ("" + enc).toLowerCase();
|
|
40445
|
-
retried = true;
|
|
40446
|
-
}
|
|
40447
|
-
}
|
|
40448
|
-
}
|
|
40449
|
-
function normalizeEncoding(enc) {
|
|
40450
|
-
var nenc = _normalizeEncoding(enc);
|
|
40451
|
-
if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
40452
|
-
return nenc || enc;
|
|
40453
|
-
}
|
|
40454
|
-
exports2.StringDecoder = StringDecoder;
|
|
40455
|
-
function StringDecoder(encoding) {
|
|
40456
|
-
this.encoding = normalizeEncoding(encoding);
|
|
40457
|
-
var nb;
|
|
40458
|
-
switch (this.encoding) {
|
|
40459
|
-
case "utf16le":
|
|
40460
|
-
this.text = utf16Text;
|
|
40461
|
-
this.end = utf16End;
|
|
40462
|
-
nb = 4;
|
|
40463
|
-
break;
|
|
40464
|
-
case "utf8":
|
|
40465
|
-
this.fillLast = utf8FillLast;
|
|
40466
|
-
nb = 4;
|
|
40467
|
-
break;
|
|
40468
|
-
case "base64":
|
|
40469
|
-
this.text = base64Text;
|
|
40470
|
-
this.end = base64End;
|
|
40471
|
-
nb = 3;
|
|
40472
|
-
break;
|
|
40473
|
-
default:
|
|
40474
|
-
this.write = simpleWrite;
|
|
40475
|
-
this.end = simpleEnd;
|
|
40476
|
-
return;
|
|
40477
|
-
}
|
|
40478
|
-
this.lastNeed = 0;
|
|
40479
|
-
this.lastTotal = 0;
|
|
40480
|
-
this.lastChar = Buffer2.allocUnsafe(nb);
|
|
40481
|
-
}
|
|
40482
|
-
StringDecoder.prototype.write = function(buf) {
|
|
40483
|
-
if (buf.length === 0) return "";
|
|
40484
|
-
var r;
|
|
40485
|
-
var i;
|
|
40486
|
-
if (this.lastNeed) {
|
|
40487
|
-
r = this.fillLast(buf);
|
|
40488
|
-
if (r === void 0) return "";
|
|
40489
|
-
i = this.lastNeed;
|
|
40490
|
-
this.lastNeed = 0;
|
|
40491
|
-
} else {
|
|
40492
|
-
i = 0;
|
|
40493
|
-
}
|
|
40494
|
-
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
40495
|
-
return r || "";
|
|
40496
|
-
};
|
|
40497
|
-
StringDecoder.prototype.end = utf8End;
|
|
40498
|
-
StringDecoder.prototype.text = utf8Text;
|
|
40499
|
-
StringDecoder.prototype.fillLast = function(buf) {
|
|
40500
|
-
if (this.lastNeed <= buf.length) {
|
|
40501
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
40502
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
40503
|
-
}
|
|
40504
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
40505
|
-
this.lastNeed -= buf.length;
|
|
40506
|
-
};
|
|
40507
|
-
function utf8CheckByte(byte) {
|
|
40508
|
-
if (byte <= 127) return 0;
|
|
40509
|
-
else if (byte >> 5 === 6) return 2;
|
|
40510
|
-
else if (byte >> 4 === 14) return 3;
|
|
40511
|
-
else if (byte >> 3 === 30) return 4;
|
|
40512
|
-
return byte >> 6 === 2 ? -1 : -2;
|
|
40513
|
-
}
|
|
40514
|
-
function utf8CheckIncomplete(self2, buf, i) {
|
|
40515
|
-
var j = buf.length - 1;
|
|
40516
|
-
if (j < i) return 0;
|
|
40517
|
-
var nb = utf8CheckByte(buf[j]);
|
|
40518
|
-
if (nb >= 0) {
|
|
40519
|
-
if (nb > 0) self2.lastNeed = nb - 1;
|
|
40520
|
-
return nb;
|
|
40521
|
-
}
|
|
40522
|
-
if (--j < i || nb === -2) return 0;
|
|
40523
|
-
nb = utf8CheckByte(buf[j]);
|
|
40524
|
-
if (nb >= 0) {
|
|
40525
|
-
if (nb > 0) self2.lastNeed = nb - 2;
|
|
40526
|
-
return nb;
|
|
40527
|
-
}
|
|
40528
|
-
if (--j < i || nb === -2) return 0;
|
|
40529
|
-
nb = utf8CheckByte(buf[j]);
|
|
40530
|
-
if (nb >= 0) {
|
|
40531
|
-
if (nb > 0) {
|
|
40532
|
-
if (nb === 2) nb = 0;
|
|
40533
|
-
else self2.lastNeed = nb - 3;
|
|
40534
|
-
}
|
|
40535
|
-
return nb;
|
|
40536
|
-
}
|
|
40537
|
-
return 0;
|
|
40538
|
-
}
|
|
40539
|
-
function utf8CheckExtraBytes(self2, buf, p) {
|
|
40540
|
-
if ((buf[0] & 192) !== 128) {
|
|
40541
|
-
self2.lastNeed = 0;
|
|
40542
|
-
return "\uFFFD";
|
|
40543
|
-
}
|
|
40544
|
-
if (self2.lastNeed > 1 && buf.length > 1) {
|
|
40545
|
-
if ((buf[1] & 192) !== 128) {
|
|
40546
|
-
self2.lastNeed = 1;
|
|
40547
|
-
return "\uFFFD";
|
|
40548
|
-
}
|
|
40549
|
-
if (self2.lastNeed > 2 && buf.length > 2) {
|
|
40550
|
-
if ((buf[2] & 192) !== 128) {
|
|
40551
|
-
self2.lastNeed = 2;
|
|
40552
|
-
return "\uFFFD";
|
|
40553
|
-
}
|
|
40554
|
-
}
|
|
40555
|
-
}
|
|
40556
|
-
}
|
|
40557
|
-
function utf8FillLast(buf) {
|
|
40558
|
-
var p = this.lastTotal - this.lastNeed;
|
|
40559
|
-
var r = utf8CheckExtraBytes(this, buf, p);
|
|
40560
|
-
if (r !== void 0) return r;
|
|
40561
|
-
if (this.lastNeed <= buf.length) {
|
|
40562
|
-
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
40563
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
40564
|
-
}
|
|
40565
|
-
buf.copy(this.lastChar, p, 0, buf.length);
|
|
40566
|
-
this.lastNeed -= buf.length;
|
|
40567
|
-
}
|
|
40568
|
-
function utf8Text(buf, i) {
|
|
40569
|
-
var total = utf8CheckIncomplete(this, buf, i);
|
|
40570
|
-
if (!this.lastNeed) return buf.toString("utf8", i);
|
|
40571
|
-
this.lastTotal = total;
|
|
40572
|
-
var end = buf.length - (total - this.lastNeed);
|
|
40573
|
-
buf.copy(this.lastChar, 0, end);
|
|
40574
|
-
return buf.toString("utf8", i, end);
|
|
40575
|
-
}
|
|
40576
|
-
function utf8End(buf) {
|
|
40577
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
40578
|
-
if (this.lastNeed) return r + "\uFFFD";
|
|
40579
|
-
return r;
|
|
40580
|
-
}
|
|
40581
|
-
function utf16Text(buf, i) {
|
|
40582
|
-
if ((buf.length - i) % 2 === 0) {
|
|
40583
|
-
var r = buf.toString("utf16le", i);
|
|
40584
|
-
if (r) {
|
|
40585
|
-
var c2 = r.charCodeAt(r.length - 1);
|
|
40586
|
-
if (c2 >= 55296 && c2 <= 56319) {
|
|
40587
|
-
this.lastNeed = 2;
|
|
40588
|
-
this.lastTotal = 4;
|
|
40589
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
40590
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
40591
|
-
return r.slice(0, -1);
|
|
40592
|
-
}
|
|
40593
|
-
}
|
|
40594
|
-
return r;
|
|
40595
|
-
}
|
|
40596
|
-
this.lastNeed = 1;
|
|
40597
|
-
this.lastTotal = 2;
|
|
40598
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
40599
|
-
return buf.toString("utf16le", i, buf.length - 1);
|
|
40600
|
-
}
|
|
40601
|
-
function utf16End(buf) {
|
|
40602
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
40603
|
-
if (this.lastNeed) {
|
|
40604
|
-
var end = this.lastTotal - this.lastNeed;
|
|
40605
|
-
return r + this.lastChar.toString("utf16le", 0, end);
|
|
40606
|
-
}
|
|
40607
|
-
return r;
|
|
40608
|
-
}
|
|
40609
|
-
function base64Text(buf, i) {
|
|
40610
|
-
var n = (buf.length - i) % 3;
|
|
40611
|
-
if (n === 0) return buf.toString("base64", i);
|
|
40612
|
-
this.lastNeed = 3 - n;
|
|
40613
|
-
this.lastTotal = 3;
|
|
40614
|
-
if (n === 1) {
|
|
40615
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
40616
|
-
} else {
|
|
40617
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
40618
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
40619
|
-
}
|
|
40620
|
-
return buf.toString("base64", i, buf.length - n);
|
|
40621
|
-
}
|
|
40622
|
-
function base64End(buf) {
|
|
40623
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
40624
|
-
if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
|
|
40625
|
-
return r;
|
|
40626
|
-
}
|
|
40627
|
-
function simpleWrite(buf) {
|
|
40628
|
-
return buf.toString(this.encoding);
|
|
40629
|
-
}
|
|
40630
|
-
function simpleEnd(buf) {
|
|
40631
|
-
return buf && buf.length ? this.write(buf) : "";
|
|
40632
|
-
}
|
|
40633
|
-
}
|
|
40634
|
-
});
|
|
40635
|
-
|
|
40636
39747
|
// ../../node_modules/archiver-utils/node_modules/readable-stream/lib/_stream_readable.js
|
|
40637
39748
|
var require_stream_readable4 = __commonJS({
|
|
40638
39749
|
"../../node_modules/archiver-utils/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
|
|
@@ -40647,7 +39758,7 @@ var require_stream_readable4 = __commonJS({
|
|
|
40647
39758
|
return emitter.listeners(type).length;
|
|
40648
39759
|
};
|
|
40649
39760
|
var Stream = require_stream4();
|
|
40650
|
-
var Buffer2 =
|
|
39761
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
40651
39762
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
40652
39763
|
};
|
|
40653
39764
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -40710,7 +39821,7 @@ var require_stream_readable4 = __commonJS({
|
|
|
40710
39821
|
this.decoder = null;
|
|
40711
39822
|
this.encoding = null;
|
|
40712
39823
|
if (options.encoding) {
|
|
40713
|
-
if (!StringDecoder) StringDecoder =
|
|
39824
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
40714
39825
|
this.decoder = new StringDecoder(options.encoding);
|
|
40715
39826
|
this.encoding = options.encoding;
|
|
40716
39827
|
}
|
|
@@ -40827,7 +39938,7 @@ var require_stream_readable4 = __commonJS({
|
|
|
40827
39938
|
return this._readableState.flowing === false;
|
|
40828
39939
|
};
|
|
40829
39940
|
Readable.prototype.setEncoding = function(enc) {
|
|
40830
|
-
if (!StringDecoder) StringDecoder =
|
|
39941
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
40831
39942
|
this._readableState.decoder = new StringDecoder(enc);
|
|
40832
39943
|
this._readableState.encoding = enc;
|
|
40833
39944
|
return this;
|
|
@@ -55921,64 +55032,6 @@ var require_stream5 = __commonJS({
|
|
|
55921
55032
|
}
|
|
55922
55033
|
});
|
|
55923
55034
|
|
|
55924
|
-
// ../../node_modules/unzipper/node_modules/safe-buffer/index.js
|
|
55925
|
-
var require_safe_buffer5 = __commonJS({
|
|
55926
|
-
"../../node_modules/unzipper/node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
55927
|
-
"use strict";
|
|
55928
|
-
var buffer2 = __require("buffer");
|
|
55929
|
-
var Buffer2 = buffer2.Buffer;
|
|
55930
|
-
function copyProps(src, dst) {
|
|
55931
|
-
for (var key2 in src) {
|
|
55932
|
-
dst[key2] = src[key2];
|
|
55933
|
-
}
|
|
55934
|
-
}
|
|
55935
|
-
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
55936
|
-
module2.exports = buffer2;
|
|
55937
|
-
} else {
|
|
55938
|
-
copyProps(buffer2, exports2);
|
|
55939
|
-
exports2.Buffer = SafeBuffer;
|
|
55940
|
-
}
|
|
55941
|
-
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
55942
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
55943
|
-
}
|
|
55944
|
-
copyProps(Buffer2, SafeBuffer);
|
|
55945
|
-
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
55946
|
-
if (typeof arg === "number") {
|
|
55947
|
-
throw new TypeError("Argument must not be a number");
|
|
55948
|
-
}
|
|
55949
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
55950
|
-
};
|
|
55951
|
-
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
55952
|
-
if (typeof size !== "number") {
|
|
55953
|
-
throw new TypeError("Argument must be a number");
|
|
55954
|
-
}
|
|
55955
|
-
var buf = Buffer2(size);
|
|
55956
|
-
if (fill !== void 0) {
|
|
55957
|
-
if (typeof encoding === "string") {
|
|
55958
|
-
buf.fill(fill, encoding);
|
|
55959
|
-
} else {
|
|
55960
|
-
buf.fill(fill);
|
|
55961
|
-
}
|
|
55962
|
-
} else {
|
|
55963
|
-
buf.fill(0);
|
|
55964
|
-
}
|
|
55965
|
-
return buf;
|
|
55966
|
-
};
|
|
55967
|
-
SafeBuffer.allocUnsafe = function(size) {
|
|
55968
|
-
if (typeof size !== "number") {
|
|
55969
|
-
throw new TypeError("Argument must be a number");
|
|
55970
|
-
}
|
|
55971
|
-
return Buffer2(size);
|
|
55972
|
-
};
|
|
55973
|
-
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
55974
|
-
if (typeof size !== "number") {
|
|
55975
|
-
throw new TypeError("Argument must be a number");
|
|
55976
|
-
}
|
|
55977
|
-
return buffer2.SlowBuffer(size);
|
|
55978
|
-
};
|
|
55979
|
-
}
|
|
55980
|
-
});
|
|
55981
|
-
|
|
55982
55035
|
// ../../node_modules/unzipper/node_modules/readable-stream/lib/internal/streams/BufferList.js
|
|
55983
55036
|
var require_BufferList5 = __commonJS({
|
|
55984
55037
|
"../../node_modules/unzipper/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) {
|
|
@@ -55988,7 +55041,7 @@ var require_BufferList5 = __commonJS({
|
|
|
55988
55041
|
throw new TypeError("Cannot call a class as a function");
|
|
55989
55042
|
}
|
|
55990
55043
|
}
|
|
55991
|
-
var Buffer2 =
|
|
55044
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
55992
55045
|
var util2 = __require("util");
|
|
55993
55046
|
function copyBuffer(src, target, offset) {
|
|
55994
55047
|
src.copy(target, offset);
|
|
@@ -56149,7 +55202,7 @@ var require_stream_writable5 = __commonJS({
|
|
|
56149
55202
|
deprecate: require_node()
|
|
56150
55203
|
};
|
|
56151
55204
|
var Stream = require_stream5();
|
|
56152
|
-
var Buffer2 =
|
|
55205
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
56153
55206
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
56154
55207
|
};
|
|
56155
55208
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -56643,244 +55696,6 @@ var require_stream_duplex5 = __commonJS({
|
|
|
56643
55696
|
}
|
|
56644
55697
|
});
|
|
56645
55698
|
|
|
56646
|
-
// ../../node_modules/unzipper/node_modules/string_decoder/lib/string_decoder.js
|
|
56647
|
-
var require_string_decoder5 = __commonJS({
|
|
56648
|
-
"../../node_modules/unzipper/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
56649
|
-
"use strict";
|
|
56650
|
-
var Buffer2 = require_safe_buffer5().Buffer;
|
|
56651
|
-
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
56652
|
-
encoding = "" + encoding;
|
|
56653
|
-
switch (encoding && encoding.toLowerCase()) {
|
|
56654
|
-
case "hex":
|
|
56655
|
-
case "utf8":
|
|
56656
|
-
case "utf-8":
|
|
56657
|
-
case "ascii":
|
|
56658
|
-
case "binary":
|
|
56659
|
-
case "base64":
|
|
56660
|
-
case "ucs2":
|
|
56661
|
-
case "ucs-2":
|
|
56662
|
-
case "utf16le":
|
|
56663
|
-
case "utf-16le":
|
|
56664
|
-
case "raw":
|
|
56665
|
-
return true;
|
|
56666
|
-
default:
|
|
56667
|
-
return false;
|
|
56668
|
-
}
|
|
56669
|
-
};
|
|
56670
|
-
function _normalizeEncoding(enc) {
|
|
56671
|
-
if (!enc) return "utf8";
|
|
56672
|
-
var retried;
|
|
56673
|
-
while (true) {
|
|
56674
|
-
switch (enc) {
|
|
56675
|
-
case "utf8":
|
|
56676
|
-
case "utf-8":
|
|
56677
|
-
return "utf8";
|
|
56678
|
-
case "ucs2":
|
|
56679
|
-
case "ucs-2":
|
|
56680
|
-
case "utf16le":
|
|
56681
|
-
case "utf-16le":
|
|
56682
|
-
return "utf16le";
|
|
56683
|
-
case "latin1":
|
|
56684
|
-
case "binary":
|
|
56685
|
-
return "latin1";
|
|
56686
|
-
case "base64":
|
|
56687
|
-
case "ascii":
|
|
56688
|
-
case "hex":
|
|
56689
|
-
return enc;
|
|
56690
|
-
default:
|
|
56691
|
-
if (retried) return;
|
|
56692
|
-
enc = ("" + enc).toLowerCase();
|
|
56693
|
-
retried = true;
|
|
56694
|
-
}
|
|
56695
|
-
}
|
|
56696
|
-
}
|
|
56697
|
-
function normalizeEncoding(enc) {
|
|
56698
|
-
var nenc = _normalizeEncoding(enc);
|
|
56699
|
-
if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
56700
|
-
return nenc || enc;
|
|
56701
|
-
}
|
|
56702
|
-
exports2.StringDecoder = StringDecoder;
|
|
56703
|
-
function StringDecoder(encoding) {
|
|
56704
|
-
this.encoding = normalizeEncoding(encoding);
|
|
56705
|
-
var nb;
|
|
56706
|
-
switch (this.encoding) {
|
|
56707
|
-
case "utf16le":
|
|
56708
|
-
this.text = utf16Text;
|
|
56709
|
-
this.end = utf16End;
|
|
56710
|
-
nb = 4;
|
|
56711
|
-
break;
|
|
56712
|
-
case "utf8":
|
|
56713
|
-
this.fillLast = utf8FillLast;
|
|
56714
|
-
nb = 4;
|
|
56715
|
-
break;
|
|
56716
|
-
case "base64":
|
|
56717
|
-
this.text = base64Text;
|
|
56718
|
-
this.end = base64End;
|
|
56719
|
-
nb = 3;
|
|
56720
|
-
break;
|
|
56721
|
-
default:
|
|
56722
|
-
this.write = simpleWrite;
|
|
56723
|
-
this.end = simpleEnd;
|
|
56724
|
-
return;
|
|
56725
|
-
}
|
|
56726
|
-
this.lastNeed = 0;
|
|
56727
|
-
this.lastTotal = 0;
|
|
56728
|
-
this.lastChar = Buffer2.allocUnsafe(nb);
|
|
56729
|
-
}
|
|
56730
|
-
StringDecoder.prototype.write = function(buf) {
|
|
56731
|
-
if (buf.length === 0) return "";
|
|
56732
|
-
var r;
|
|
56733
|
-
var i;
|
|
56734
|
-
if (this.lastNeed) {
|
|
56735
|
-
r = this.fillLast(buf);
|
|
56736
|
-
if (r === void 0) return "";
|
|
56737
|
-
i = this.lastNeed;
|
|
56738
|
-
this.lastNeed = 0;
|
|
56739
|
-
} else {
|
|
56740
|
-
i = 0;
|
|
56741
|
-
}
|
|
56742
|
-
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
56743
|
-
return r || "";
|
|
56744
|
-
};
|
|
56745
|
-
StringDecoder.prototype.end = utf8End;
|
|
56746
|
-
StringDecoder.prototype.text = utf8Text;
|
|
56747
|
-
StringDecoder.prototype.fillLast = function(buf) {
|
|
56748
|
-
if (this.lastNeed <= buf.length) {
|
|
56749
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
56750
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
56751
|
-
}
|
|
56752
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
56753
|
-
this.lastNeed -= buf.length;
|
|
56754
|
-
};
|
|
56755
|
-
function utf8CheckByte(byte) {
|
|
56756
|
-
if (byte <= 127) return 0;
|
|
56757
|
-
else if (byte >> 5 === 6) return 2;
|
|
56758
|
-
else if (byte >> 4 === 14) return 3;
|
|
56759
|
-
else if (byte >> 3 === 30) return 4;
|
|
56760
|
-
return byte >> 6 === 2 ? -1 : -2;
|
|
56761
|
-
}
|
|
56762
|
-
function utf8CheckIncomplete(self2, buf, i) {
|
|
56763
|
-
var j = buf.length - 1;
|
|
56764
|
-
if (j < i) return 0;
|
|
56765
|
-
var nb = utf8CheckByte(buf[j]);
|
|
56766
|
-
if (nb >= 0) {
|
|
56767
|
-
if (nb > 0) self2.lastNeed = nb - 1;
|
|
56768
|
-
return nb;
|
|
56769
|
-
}
|
|
56770
|
-
if (--j < i || nb === -2) return 0;
|
|
56771
|
-
nb = utf8CheckByte(buf[j]);
|
|
56772
|
-
if (nb >= 0) {
|
|
56773
|
-
if (nb > 0) self2.lastNeed = nb - 2;
|
|
56774
|
-
return nb;
|
|
56775
|
-
}
|
|
56776
|
-
if (--j < i || nb === -2) return 0;
|
|
56777
|
-
nb = utf8CheckByte(buf[j]);
|
|
56778
|
-
if (nb >= 0) {
|
|
56779
|
-
if (nb > 0) {
|
|
56780
|
-
if (nb === 2) nb = 0;
|
|
56781
|
-
else self2.lastNeed = nb - 3;
|
|
56782
|
-
}
|
|
56783
|
-
return nb;
|
|
56784
|
-
}
|
|
56785
|
-
return 0;
|
|
56786
|
-
}
|
|
56787
|
-
function utf8CheckExtraBytes(self2, buf, p) {
|
|
56788
|
-
if ((buf[0] & 192) !== 128) {
|
|
56789
|
-
self2.lastNeed = 0;
|
|
56790
|
-
return "\uFFFD";
|
|
56791
|
-
}
|
|
56792
|
-
if (self2.lastNeed > 1 && buf.length > 1) {
|
|
56793
|
-
if ((buf[1] & 192) !== 128) {
|
|
56794
|
-
self2.lastNeed = 1;
|
|
56795
|
-
return "\uFFFD";
|
|
56796
|
-
}
|
|
56797
|
-
if (self2.lastNeed > 2 && buf.length > 2) {
|
|
56798
|
-
if ((buf[2] & 192) !== 128) {
|
|
56799
|
-
self2.lastNeed = 2;
|
|
56800
|
-
return "\uFFFD";
|
|
56801
|
-
}
|
|
56802
|
-
}
|
|
56803
|
-
}
|
|
56804
|
-
}
|
|
56805
|
-
function utf8FillLast(buf) {
|
|
56806
|
-
var p = this.lastTotal - this.lastNeed;
|
|
56807
|
-
var r = utf8CheckExtraBytes(this, buf, p);
|
|
56808
|
-
if (r !== void 0) return r;
|
|
56809
|
-
if (this.lastNeed <= buf.length) {
|
|
56810
|
-
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
56811
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
56812
|
-
}
|
|
56813
|
-
buf.copy(this.lastChar, p, 0, buf.length);
|
|
56814
|
-
this.lastNeed -= buf.length;
|
|
56815
|
-
}
|
|
56816
|
-
function utf8Text(buf, i) {
|
|
56817
|
-
var total = utf8CheckIncomplete(this, buf, i);
|
|
56818
|
-
if (!this.lastNeed) return buf.toString("utf8", i);
|
|
56819
|
-
this.lastTotal = total;
|
|
56820
|
-
var end = buf.length - (total - this.lastNeed);
|
|
56821
|
-
buf.copy(this.lastChar, 0, end);
|
|
56822
|
-
return buf.toString("utf8", i, end);
|
|
56823
|
-
}
|
|
56824
|
-
function utf8End(buf) {
|
|
56825
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
56826
|
-
if (this.lastNeed) return r + "\uFFFD";
|
|
56827
|
-
return r;
|
|
56828
|
-
}
|
|
56829
|
-
function utf16Text(buf, i) {
|
|
56830
|
-
if ((buf.length - i) % 2 === 0) {
|
|
56831
|
-
var r = buf.toString("utf16le", i);
|
|
56832
|
-
if (r) {
|
|
56833
|
-
var c2 = r.charCodeAt(r.length - 1);
|
|
56834
|
-
if (c2 >= 55296 && c2 <= 56319) {
|
|
56835
|
-
this.lastNeed = 2;
|
|
56836
|
-
this.lastTotal = 4;
|
|
56837
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
56838
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
56839
|
-
return r.slice(0, -1);
|
|
56840
|
-
}
|
|
56841
|
-
}
|
|
56842
|
-
return r;
|
|
56843
|
-
}
|
|
56844
|
-
this.lastNeed = 1;
|
|
56845
|
-
this.lastTotal = 2;
|
|
56846
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
56847
|
-
return buf.toString("utf16le", i, buf.length - 1);
|
|
56848
|
-
}
|
|
56849
|
-
function utf16End(buf) {
|
|
56850
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
56851
|
-
if (this.lastNeed) {
|
|
56852
|
-
var end = this.lastTotal - this.lastNeed;
|
|
56853
|
-
return r + this.lastChar.toString("utf16le", 0, end);
|
|
56854
|
-
}
|
|
56855
|
-
return r;
|
|
56856
|
-
}
|
|
56857
|
-
function base64Text(buf, i) {
|
|
56858
|
-
var n = (buf.length - i) % 3;
|
|
56859
|
-
if (n === 0) return buf.toString("base64", i);
|
|
56860
|
-
this.lastNeed = 3 - n;
|
|
56861
|
-
this.lastTotal = 3;
|
|
56862
|
-
if (n === 1) {
|
|
56863
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
56864
|
-
} else {
|
|
56865
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
56866
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
56867
|
-
}
|
|
56868
|
-
return buf.toString("base64", i, buf.length - n);
|
|
56869
|
-
}
|
|
56870
|
-
function base64End(buf) {
|
|
56871
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
56872
|
-
if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
|
|
56873
|
-
return r;
|
|
56874
|
-
}
|
|
56875
|
-
function simpleWrite(buf) {
|
|
56876
|
-
return buf.toString(this.encoding);
|
|
56877
|
-
}
|
|
56878
|
-
function simpleEnd(buf) {
|
|
56879
|
-
return buf && buf.length ? this.write(buf) : "";
|
|
56880
|
-
}
|
|
56881
|
-
}
|
|
56882
|
-
});
|
|
56883
|
-
|
|
56884
55699
|
// ../../node_modules/unzipper/node_modules/readable-stream/lib/_stream_readable.js
|
|
56885
55700
|
var require_stream_readable5 = __commonJS({
|
|
56886
55701
|
"../../node_modules/unzipper/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
|
|
@@ -56895,7 +55710,7 @@ var require_stream_readable5 = __commonJS({
|
|
|
56895
55710
|
return emitter.listeners(type).length;
|
|
56896
55711
|
};
|
|
56897
55712
|
var Stream = require_stream5();
|
|
56898
|
-
var Buffer2 =
|
|
55713
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
56899
55714
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
56900
55715
|
};
|
|
56901
55716
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -56958,7 +55773,7 @@ var require_stream_readable5 = __commonJS({
|
|
|
56958
55773
|
this.decoder = null;
|
|
56959
55774
|
this.encoding = null;
|
|
56960
55775
|
if (options.encoding) {
|
|
56961
|
-
if (!StringDecoder) StringDecoder =
|
|
55776
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
56962
55777
|
this.decoder = new StringDecoder(options.encoding);
|
|
56963
55778
|
this.encoding = options.encoding;
|
|
56964
55779
|
}
|
|
@@ -57075,7 +55890,7 @@ var require_stream_readable5 = __commonJS({
|
|
|
57075
55890
|
return this._readableState.flowing === false;
|
|
57076
55891
|
};
|
|
57077
55892
|
Readable.prototype.setEncoding = function(enc) {
|
|
57078
|
-
if (!StringDecoder) StringDecoder =
|
|
55893
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
57079
55894
|
this._readableState.decoder = new StringDecoder(enc);
|
|
57080
55895
|
this._readableState.encoding = enc;
|
|
57081
55896
|
return this;
|
|
@@ -58129,64 +56944,6 @@ var require_stream6 = __commonJS({
|
|
|
58129
56944
|
}
|
|
58130
56945
|
});
|
|
58131
56946
|
|
|
58132
|
-
// ../../node_modules/duplexer2/node_modules/safe-buffer/index.js
|
|
58133
|
-
var require_safe_buffer6 = __commonJS({
|
|
58134
|
-
"../../node_modules/duplexer2/node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
58135
|
-
"use strict";
|
|
58136
|
-
var buffer2 = __require("buffer");
|
|
58137
|
-
var Buffer2 = buffer2.Buffer;
|
|
58138
|
-
function copyProps(src, dst) {
|
|
58139
|
-
for (var key2 in src) {
|
|
58140
|
-
dst[key2] = src[key2];
|
|
58141
|
-
}
|
|
58142
|
-
}
|
|
58143
|
-
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
58144
|
-
module2.exports = buffer2;
|
|
58145
|
-
} else {
|
|
58146
|
-
copyProps(buffer2, exports2);
|
|
58147
|
-
exports2.Buffer = SafeBuffer;
|
|
58148
|
-
}
|
|
58149
|
-
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
58150
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
58151
|
-
}
|
|
58152
|
-
copyProps(Buffer2, SafeBuffer);
|
|
58153
|
-
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
58154
|
-
if (typeof arg === "number") {
|
|
58155
|
-
throw new TypeError("Argument must not be a number");
|
|
58156
|
-
}
|
|
58157
|
-
return Buffer2(arg, encodingOrOffset, length);
|
|
58158
|
-
};
|
|
58159
|
-
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
58160
|
-
if (typeof size !== "number") {
|
|
58161
|
-
throw new TypeError("Argument must be a number");
|
|
58162
|
-
}
|
|
58163
|
-
var buf = Buffer2(size);
|
|
58164
|
-
if (fill !== void 0) {
|
|
58165
|
-
if (typeof encoding === "string") {
|
|
58166
|
-
buf.fill(fill, encoding);
|
|
58167
|
-
} else {
|
|
58168
|
-
buf.fill(fill);
|
|
58169
|
-
}
|
|
58170
|
-
} else {
|
|
58171
|
-
buf.fill(0);
|
|
58172
|
-
}
|
|
58173
|
-
return buf;
|
|
58174
|
-
};
|
|
58175
|
-
SafeBuffer.allocUnsafe = function(size) {
|
|
58176
|
-
if (typeof size !== "number") {
|
|
58177
|
-
throw new TypeError("Argument must be a number");
|
|
58178
|
-
}
|
|
58179
|
-
return Buffer2(size);
|
|
58180
|
-
};
|
|
58181
|
-
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
58182
|
-
if (typeof size !== "number") {
|
|
58183
|
-
throw new TypeError("Argument must be a number");
|
|
58184
|
-
}
|
|
58185
|
-
return buffer2.SlowBuffer(size);
|
|
58186
|
-
};
|
|
58187
|
-
}
|
|
58188
|
-
});
|
|
58189
|
-
|
|
58190
56947
|
// ../../node_modules/duplexer2/node_modules/readable-stream/lib/internal/streams/BufferList.js
|
|
58191
56948
|
var require_BufferList6 = __commonJS({
|
|
58192
56949
|
"../../node_modules/duplexer2/node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) {
|
|
@@ -58196,7 +56953,7 @@ var require_BufferList6 = __commonJS({
|
|
|
58196
56953
|
throw new TypeError("Cannot call a class as a function");
|
|
58197
56954
|
}
|
|
58198
56955
|
}
|
|
58199
|
-
var Buffer2 =
|
|
56956
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
58200
56957
|
var util2 = __require("util");
|
|
58201
56958
|
function copyBuffer(src, target, offset) {
|
|
58202
56959
|
src.copy(target, offset);
|
|
@@ -58357,7 +57114,7 @@ var require_stream_writable6 = __commonJS({
|
|
|
58357
57114
|
deprecate: require_node()
|
|
58358
57115
|
};
|
|
58359
57116
|
var Stream = require_stream6();
|
|
58360
|
-
var Buffer2 =
|
|
57117
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
58361
57118
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
58362
57119
|
};
|
|
58363
57120
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -58851,244 +57608,6 @@ var require_stream_duplex6 = __commonJS({
|
|
|
58851
57608
|
}
|
|
58852
57609
|
});
|
|
58853
57610
|
|
|
58854
|
-
// ../../node_modules/duplexer2/node_modules/string_decoder/lib/string_decoder.js
|
|
58855
|
-
var require_string_decoder6 = __commonJS({
|
|
58856
|
-
"../../node_modules/duplexer2/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
58857
|
-
"use strict";
|
|
58858
|
-
var Buffer2 = require_safe_buffer6().Buffer;
|
|
58859
|
-
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
58860
|
-
encoding = "" + encoding;
|
|
58861
|
-
switch (encoding && encoding.toLowerCase()) {
|
|
58862
|
-
case "hex":
|
|
58863
|
-
case "utf8":
|
|
58864
|
-
case "utf-8":
|
|
58865
|
-
case "ascii":
|
|
58866
|
-
case "binary":
|
|
58867
|
-
case "base64":
|
|
58868
|
-
case "ucs2":
|
|
58869
|
-
case "ucs-2":
|
|
58870
|
-
case "utf16le":
|
|
58871
|
-
case "utf-16le":
|
|
58872
|
-
case "raw":
|
|
58873
|
-
return true;
|
|
58874
|
-
default:
|
|
58875
|
-
return false;
|
|
58876
|
-
}
|
|
58877
|
-
};
|
|
58878
|
-
function _normalizeEncoding(enc) {
|
|
58879
|
-
if (!enc) return "utf8";
|
|
58880
|
-
var retried;
|
|
58881
|
-
while (true) {
|
|
58882
|
-
switch (enc) {
|
|
58883
|
-
case "utf8":
|
|
58884
|
-
case "utf-8":
|
|
58885
|
-
return "utf8";
|
|
58886
|
-
case "ucs2":
|
|
58887
|
-
case "ucs-2":
|
|
58888
|
-
case "utf16le":
|
|
58889
|
-
case "utf-16le":
|
|
58890
|
-
return "utf16le";
|
|
58891
|
-
case "latin1":
|
|
58892
|
-
case "binary":
|
|
58893
|
-
return "latin1";
|
|
58894
|
-
case "base64":
|
|
58895
|
-
case "ascii":
|
|
58896
|
-
case "hex":
|
|
58897
|
-
return enc;
|
|
58898
|
-
default:
|
|
58899
|
-
if (retried) return;
|
|
58900
|
-
enc = ("" + enc).toLowerCase();
|
|
58901
|
-
retried = true;
|
|
58902
|
-
}
|
|
58903
|
-
}
|
|
58904
|
-
}
|
|
58905
|
-
function normalizeEncoding(enc) {
|
|
58906
|
-
var nenc = _normalizeEncoding(enc);
|
|
58907
|
-
if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
58908
|
-
return nenc || enc;
|
|
58909
|
-
}
|
|
58910
|
-
exports2.StringDecoder = StringDecoder;
|
|
58911
|
-
function StringDecoder(encoding) {
|
|
58912
|
-
this.encoding = normalizeEncoding(encoding);
|
|
58913
|
-
var nb;
|
|
58914
|
-
switch (this.encoding) {
|
|
58915
|
-
case "utf16le":
|
|
58916
|
-
this.text = utf16Text;
|
|
58917
|
-
this.end = utf16End;
|
|
58918
|
-
nb = 4;
|
|
58919
|
-
break;
|
|
58920
|
-
case "utf8":
|
|
58921
|
-
this.fillLast = utf8FillLast;
|
|
58922
|
-
nb = 4;
|
|
58923
|
-
break;
|
|
58924
|
-
case "base64":
|
|
58925
|
-
this.text = base64Text;
|
|
58926
|
-
this.end = base64End;
|
|
58927
|
-
nb = 3;
|
|
58928
|
-
break;
|
|
58929
|
-
default:
|
|
58930
|
-
this.write = simpleWrite;
|
|
58931
|
-
this.end = simpleEnd;
|
|
58932
|
-
return;
|
|
58933
|
-
}
|
|
58934
|
-
this.lastNeed = 0;
|
|
58935
|
-
this.lastTotal = 0;
|
|
58936
|
-
this.lastChar = Buffer2.allocUnsafe(nb);
|
|
58937
|
-
}
|
|
58938
|
-
StringDecoder.prototype.write = function(buf) {
|
|
58939
|
-
if (buf.length === 0) return "";
|
|
58940
|
-
var r;
|
|
58941
|
-
var i;
|
|
58942
|
-
if (this.lastNeed) {
|
|
58943
|
-
r = this.fillLast(buf);
|
|
58944
|
-
if (r === void 0) return "";
|
|
58945
|
-
i = this.lastNeed;
|
|
58946
|
-
this.lastNeed = 0;
|
|
58947
|
-
} else {
|
|
58948
|
-
i = 0;
|
|
58949
|
-
}
|
|
58950
|
-
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
58951
|
-
return r || "";
|
|
58952
|
-
};
|
|
58953
|
-
StringDecoder.prototype.end = utf8End;
|
|
58954
|
-
StringDecoder.prototype.text = utf8Text;
|
|
58955
|
-
StringDecoder.prototype.fillLast = function(buf) {
|
|
58956
|
-
if (this.lastNeed <= buf.length) {
|
|
58957
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
58958
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
58959
|
-
}
|
|
58960
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
58961
|
-
this.lastNeed -= buf.length;
|
|
58962
|
-
};
|
|
58963
|
-
function utf8CheckByte(byte) {
|
|
58964
|
-
if (byte <= 127) return 0;
|
|
58965
|
-
else if (byte >> 5 === 6) return 2;
|
|
58966
|
-
else if (byte >> 4 === 14) return 3;
|
|
58967
|
-
else if (byte >> 3 === 30) return 4;
|
|
58968
|
-
return byte >> 6 === 2 ? -1 : -2;
|
|
58969
|
-
}
|
|
58970
|
-
function utf8CheckIncomplete(self2, buf, i) {
|
|
58971
|
-
var j = buf.length - 1;
|
|
58972
|
-
if (j < i) return 0;
|
|
58973
|
-
var nb = utf8CheckByte(buf[j]);
|
|
58974
|
-
if (nb >= 0) {
|
|
58975
|
-
if (nb > 0) self2.lastNeed = nb - 1;
|
|
58976
|
-
return nb;
|
|
58977
|
-
}
|
|
58978
|
-
if (--j < i || nb === -2) return 0;
|
|
58979
|
-
nb = utf8CheckByte(buf[j]);
|
|
58980
|
-
if (nb >= 0) {
|
|
58981
|
-
if (nb > 0) self2.lastNeed = nb - 2;
|
|
58982
|
-
return nb;
|
|
58983
|
-
}
|
|
58984
|
-
if (--j < i || nb === -2) return 0;
|
|
58985
|
-
nb = utf8CheckByte(buf[j]);
|
|
58986
|
-
if (nb >= 0) {
|
|
58987
|
-
if (nb > 0) {
|
|
58988
|
-
if (nb === 2) nb = 0;
|
|
58989
|
-
else self2.lastNeed = nb - 3;
|
|
58990
|
-
}
|
|
58991
|
-
return nb;
|
|
58992
|
-
}
|
|
58993
|
-
return 0;
|
|
58994
|
-
}
|
|
58995
|
-
function utf8CheckExtraBytes(self2, buf, p) {
|
|
58996
|
-
if ((buf[0] & 192) !== 128) {
|
|
58997
|
-
self2.lastNeed = 0;
|
|
58998
|
-
return "\uFFFD";
|
|
58999
|
-
}
|
|
59000
|
-
if (self2.lastNeed > 1 && buf.length > 1) {
|
|
59001
|
-
if ((buf[1] & 192) !== 128) {
|
|
59002
|
-
self2.lastNeed = 1;
|
|
59003
|
-
return "\uFFFD";
|
|
59004
|
-
}
|
|
59005
|
-
if (self2.lastNeed > 2 && buf.length > 2) {
|
|
59006
|
-
if ((buf[2] & 192) !== 128) {
|
|
59007
|
-
self2.lastNeed = 2;
|
|
59008
|
-
return "\uFFFD";
|
|
59009
|
-
}
|
|
59010
|
-
}
|
|
59011
|
-
}
|
|
59012
|
-
}
|
|
59013
|
-
function utf8FillLast(buf) {
|
|
59014
|
-
var p = this.lastTotal - this.lastNeed;
|
|
59015
|
-
var r = utf8CheckExtraBytes(this, buf, p);
|
|
59016
|
-
if (r !== void 0) return r;
|
|
59017
|
-
if (this.lastNeed <= buf.length) {
|
|
59018
|
-
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
59019
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
59020
|
-
}
|
|
59021
|
-
buf.copy(this.lastChar, p, 0, buf.length);
|
|
59022
|
-
this.lastNeed -= buf.length;
|
|
59023
|
-
}
|
|
59024
|
-
function utf8Text(buf, i) {
|
|
59025
|
-
var total = utf8CheckIncomplete(this, buf, i);
|
|
59026
|
-
if (!this.lastNeed) return buf.toString("utf8", i);
|
|
59027
|
-
this.lastTotal = total;
|
|
59028
|
-
var end = buf.length - (total - this.lastNeed);
|
|
59029
|
-
buf.copy(this.lastChar, 0, end);
|
|
59030
|
-
return buf.toString("utf8", i, end);
|
|
59031
|
-
}
|
|
59032
|
-
function utf8End(buf) {
|
|
59033
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
59034
|
-
if (this.lastNeed) return r + "\uFFFD";
|
|
59035
|
-
return r;
|
|
59036
|
-
}
|
|
59037
|
-
function utf16Text(buf, i) {
|
|
59038
|
-
if ((buf.length - i) % 2 === 0) {
|
|
59039
|
-
var r = buf.toString("utf16le", i);
|
|
59040
|
-
if (r) {
|
|
59041
|
-
var c2 = r.charCodeAt(r.length - 1);
|
|
59042
|
-
if (c2 >= 55296 && c2 <= 56319) {
|
|
59043
|
-
this.lastNeed = 2;
|
|
59044
|
-
this.lastTotal = 4;
|
|
59045
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
59046
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
59047
|
-
return r.slice(0, -1);
|
|
59048
|
-
}
|
|
59049
|
-
}
|
|
59050
|
-
return r;
|
|
59051
|
-
}
|
|
59052
|
-
this.lastNeed = 1;
|
|
59053
|
-
this.lastTotal = 2;
|
|
59054
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
59055
|
-
return buf.toString("utf16le", i, buf.length - 1);
|
|
59056
|
-
}
|
|
59057
|
-
function utf16End(buf) {
|
|
59058
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
59059
|
-
if (this.lastNeed) {
|
|
59060
|
-
var end = this.lastTotal - this.lastNeed;
|
|
59061
|
-
return r + this.lastChar.toString("utf16le", 0, end);
|
|
59062
|
-
}
|
|
59063
|
-
return r;
|
|
59064
|
-
}
|
|
59065
|
-
function base64Text(buf, i) {
|
|
59066
|
-
var n = (buf.length - i) % 3;
|
|
59067
|
-
if (n === 0) return buf.toString("base64", i);
|
|
59068
|
-
this.lastNeed = 3 - n;
|
|
59069
|
-
this.lastTotal = 3;
|
|
59070
|
-
if (n === 1) {
|
|
59071
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
59072
|
-
} else {
|
|
59073
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
59074
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
59075
|
-
}
|
|
59076
|
-
return buf.toString("base64", i, buf.length - n);
|
|
59077
|
-
}
|
|
59078
|
-
function base64End(buf) {
|
|
59079
|
-
var r = buf && buf.length ? this.write(buf) : "";
|
|
59080
|
-
if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
|
|
59081
|
-
return r;
|
|
59082
|
-
}
|
|
59083
|
-
function simpleWrite(buf) {
|
|
59084
|
-
return buf.toString(this.encoding);
|
|
59085
|
-
}
|
|
59086
|
-
function simpleEnd(buf) {
|
|
59087
|
-
return buf && buf.length ? this.write(buf) : "";
|
|
59088
|
-
}
|
|
59089
|
-
}
|
|
59090
|
-
});
|
|
59091
|
-
|
|
59092
57611
|
// ../../node_modules/duplexer2/node_modules/readable-stream/lib/_stream_readable.js
|
|
59093
57612
|
var require_stream_readable6 = __commonJS({
|
|
59094
57613
|
"../../node_modules/duplexer2/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
|
|
@@ -59103,7 +57622,7 @@ var require_stream_readable6 = __commonJS({
|
|
|
59103
57622
|
return emitter.listeners(type).length;
|
|
59104
57623
|
};
|
|
59105
57624
|
var Stream = require_stream6();
|
|
59106
|
-
var Buffer2 =
|
|
57625
|
+
var Buffer2 = require_safe_buffer().Buffer;
|
|
59107
57626
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
59108
57627
|
};
|
|
59109
57628
|
function _uint8ArrayToBuffer(chunk) {
|
|
@@ -59166,7 +57685,7 @@ var require_stream_readable6 = __commonJS({
|
|
|
59166
57685
|
this.decoder = null;
|
|
59167
57686
|
this.encoding = null;
|
|
59168
57687
|
if (options.encoding) {
|
|
59169
|
-
if (!StringDecoder) StringDecoder =
|
|
57688
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
59170
57689
|
this.decoder = new StringDecoder(options.encoding);
|
|
59171
57690
|
this.encoding = options.encoding;
|
|
59172
57691
|
}
|
|
@@ -59283,7 +57802,7 @@ var require_stream_readable6 = __commonJS({
|
|
|
59283
57802
|
return this._readableState.flowing === false;
|
|
59284
57803
|
};
|
|
59285
57804
|
Readable.prototype.setEncoding = function(enc) {
|
|
59286
|
-
if (!StringDecoder) StringDecoder =
|
|
57805
|
+
if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
|
|
59287
57806
|
this._readableState.decoder = new StringDecoder(enc);
|
|
59288
57807
|
this._readableState.encoding = enc;
|
|
59289
57808
|
return this;
|
|
@@ -195502,7 +194021,7 @@ function bundleOutputPath(loaded) {
|
|
|
195502
194021
|
}
|
|
195503
194022
|
|
|
195504
194023
|
// ../ops/src/playable-runtime.ts
|
|
195505
|
-
var PLAYABLE_RUNTIME_JS = '"use strict";var Patterplay=(()=>{var N=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var ce=Object.prototype.hasOwnProperty;var le=(s,e)=>{for(var t in e)N(s,t,{get:e[t],enumerable:!0})},pe=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ae(e))!ce.call(s,n)&&n!==t&&N(s,n,{get:()=>e[n],enumerable:!(r=oe(e,n))||r.enumerable});return s};var de=s=>pe(N({},"__esModule",{value:!0}),s);var xe={};le(xe,{Engine:()=>R,Flow:()=>b,buildTagIndex:()=>I,effectiveGameData:()=>ne,gameDataFields:()=>re,gameDataValue:()=>G});function m(s){switch(s[0]){case"b":return{kind:"bool",value:s[1]};case"n":return{kind:"number",value:s[1]};case"s":return{kind:"string",value:s[1]};case"sv":return{kind:"scopedvar",scope:s[1],name:s[2]};case"u":return{kind:"unary",op:s[1],operand:m(s[2])};case"bin":return{kind:"binary",op:s[1],left:m(s[2]),right:m(s[3])};case"call":{let e=s.slice(2).map(m);return{kind:"call",name:s[1],args:e}}case"fd":return{kind:"flagdelta",sign:s[1],name:s[2]}}}var c=class extends Error{constructor(e){super(e),this.name="EvalError"}};function P(s,e,t){let r=new Map(t.scopes.map(i=>[i.token,i.missing??"false"])),n=i=>{switch(i.kind){case"bool":return i.value;case"number":return i.value;case"string":return i.value;case"scopedvar":{let o=e.scopes[i.scope];if(o===void 0)return!1;let a=typeof o.get=="function"?o.get(i.name):o[i.name];if(a===void 0){if(r.get(i.scope)==="throw")throw new c(`@${i.scope}.${i.name} is not declared on the current ${i.scope}.`);return!1}return a}case"call":{let o=t.functions[i.name];if(!o)throw new c(`unknown function \'${i.name}\'`);return o.eval(i.args,{evaluate:n,ctx:e})}case"flagdelta":throw new c("flagdelta node is only valid as an argument to a flag-delta function");case"unary":{if(i.op==="not"){let a=n(i.operand);if(typeof a!="boolean")throw new c(`\'not\' requires a boolean operand, got ${typeof a}`);return!a}let o=n(i.operand);if(typeof o!="number")throw new c(`unary \'-\' requires a numeric operand, got ${typeof o}`);return-o}case"binary":{if(i.op==="and"){let p=n(i.left);if(typeof p!="boolean")throw new c(`\'and\' requires boolean operands, left is ${typeof p}`);if(!p)return!1;let d=n(i.right);if(typeof d!="boolean")throw new c(`\'and\' requires boolean operands, right is ${typeof d}`);return d}if(i.op==="or"){let p=n(i.left);if(typeof p!="boolean")throw new c(`\'or\' requires boolean operands, left is ${typeof p}`);if(p)return!0;let d=n(i.right);if(typeof d!="boolean")throw new c(`\'or\' requires boolean operands, right is ${typeof d}`);return d}let o=n(i.left),a=n(i.right);switch(i.op){case"==":return q(o,a);case"!=":return!q(o,a);case">":return S(o,a,">"),o>a;case">=":return S(o,a,">="),o>=a;case"<":return S(o,a,"<"),o<a;case"<=":return S(o,a,"<="),o<=a;case"+":if(typeof o=="number"&&typeof a=="number"||typeof o=="string"&&typeof a=="string")return o+a;throw new c(`\'+\' requires two numbers or two strings, got ${typeof o} and ${typeof a}`);case"-":return S(o,a,"-"),o-a;case"*":return S(o,a,"*"),o*a;case"/":if(S(o,a,"/"),a===0)throw new c("division by zero");return o/a}}}};return n(s)}function q(s,e){if(Array.isArray(s)||Array.isArray(e)){if(!Array.isArray(s)||!Array.isArray(e)||s.length!==e.length)return!1;for(let t=0;t<s.length;t++)if(s[t]!==e[t])return!1;return!0}return s===e}function S(s,e,t){if(typeof s!="number"||typeof e!="number")throw new c(`\'${t}\' requires numeric operands, got ${typeof s} and ${typeof e}`)}var w=class{scopes=new Map;defineOwned(e,t){this.assertFree(e);let r={},n=new Map;for(let i of t){let o=i.name.toLowerCase();n.set(o,i),r[o]=i.default??_(i)}return this.scopes.set(e,{kind:"owned",bag:r,decls:n}),this}reseedOwned(e,t){let r=this.scopes.get(e);if(!r||r.kind!=="owned")throw new Error(`\'@${e}\' is not an owned scope`);for(let n of Object.keys(r.bag))delete r.bag[n];r.decls.clear();for(let n of t){let i=n.name.toLowerCase();r.decls.set(i,n),r.bag[i]=n.default??_(n)}return this}defineForeign(e,t,r=[],n=!0){this.assertFree(e);let i=new Map;for(let o of r)i.set(o.name.toLowerCase(),o);return this.scopes.set(e,{kind:"foreign",resolver:t,decls:i,scopeWritable:n}),this}has(e){return this.scopes.has(e)}get(e,t){let r=this.scopes.get(e);if(!r)return;let n=t.toLowerCase();return r.kind==="owned"?r.bag[n]:r.resolver.get(n)}set(e,t,r){let n=this.scopes.get(e);if(!n)throw new Error(`unknown scope \'@${e}\'`);let i=t.toLowerCase();if(!this.writable(n,i))throw new Error(`\'@${e}.${t}\' is read-only`);n.kind==="owned"?n.bag[i]=r:n.resolver.set(i,r)}writable(e,t){return e.kind==="owned"?e.decls.get(t)?.writable??!0:e.resolver.set?e.decls.get(t)?.writable??e.scopeWritable:!1}toEvalContext(e){let t={};for(let[r,n]of this.scopes)t[r]=n.kind==="owned"?n.bag:n.resolver;return{scopes:t,host:e}}toSchema(){let e=new Map;for(let[t,r]of this.scopes){if(r.decls.size===0)continue;let n=new Map;for(let[i,o]of r.decls)n.set(i,{type:o.type,enumValues:o.values});e.set(t,n)}return{properties:e}}save(){let e={};for(let[t,r]of this.scopes)r.kind==="owned"&&(e[t]={...r.bag});return e}load(e){for(let[t,r]of Object.entries(e)){let n=this.scopes.get(t);n?.kind==="owned"&&Object.assign(n.bag,r)}}assertFree(e){if(this.scopes.has(e))throw new Error(`scope \'@${e}\' is already registered`)}};function _(s){if(s.default!==void 0)return s.default;switch(s.type){case"boolean":return!1;case"number":return 0;case"string":return"";case"enum":return s.values?.[0]??"";case"flags":return[]}}function x(s){return s.ctx.host??{}}var J={defaultScope:"patter",scopes:[{token:"patter"},{token:"scene"}],functions:{random:{minArgs:2,maxArgs:2,returnType:"number",eval(s,e){if(s.length!==2)throw new c("random(a, b) requires exactly 2 arguments");let t=x(e).nextRandom;if(!t)throw new c("random() called without a PRNG in context");let r=e.evaluate(s[0]),n=e.evaluate(s[1]);if(typeof r!="number"||typeof n!="number")throw new c("random(a, b) arguments must be numbers");if(!Number.isInteger(r)||!Number.isInteger(n))throw new c("random(a, b) arguments must be integers");let i=Math.min(r,n),o=Math.max(r,n);return Math.floor(t()*(o-i+1))+i}},check_flags:{minArgs:1,returnType:"boolean",flagDeltaArgs:!0,validate:W("check_flags"),eval(s,e){let t=U(s[0],e,"check_flags");for(let r=1;r<s.length;r++){let n=s[r];if(n.kind!=="flagdelta")throw new c("check_flags() flag args must be +flagName or -flagName");if(n.sign==="+"?!t.includes(n.name):t.includes(n.name))return!1}return!0}},set_flags:{minArgs:1,returnType:"flags",flagDeltaArgs:!0,validate:W("set_flags"),eval(s,e){let t=[...U(s[0],e,"set_flags")];for(let r=1;r<s.length;r++){let n=s[r];if(n.kind!=="flagdelta")throw new c("set_flags() flag args must be +flagName or -flagName");if(n.sign==="+")t.includes(n.name)||t.push(n.name);else{let i=t.indexOf(n.name);i>=0&&t.splice(i,1)}}return t}},visits:{minArgs:1,maxArgs:1,returnType:"number",validate:C("visits"),eval:(s,e)=>x(e).visits?.(E(s,e,"visits"))??0},seen:{minArgs:1,maxArgs:1,returnType:"boolean",validate:C("seen"),eval:(s,e)=>(x(e).visits?.(E(s,e,"seen"))??0)>0},patter_visits:{minArgs:1,maxArgs:1,returnType:"number",validate:C("patter_visits"),eval:(s,e)=>x(e).patterVisits?.(E(s,e,"patter_visits"))??0},patter_seen:{minArgs:1,maxArgs:1,returnType:"boolean",validate:C("patter_seen"),eval:(s,e)=>(x(e).patterVisits?.(E(s,e,"patter_seen"))??0)>0}}};function A(s,e){let t=s.replace(/^@/,"").split(".");return t.length===2&&e(t[0])?{scope:t[0],name:t[1].toLowerCase()}:{scope:"patter",name:t.join(".").toLowerCase()}}function E(s,e,t){let r=e.evaluate(s[0]);if(typeof r!="string")throw new c(`${t}(id) requires a string node id`);return r}function C(s){return(e,t)=>{let r=e[0];r&&r.kind!=="string"&&t.report({path:[...t.path,"args",0],kind:"wrong-arg-type",severity:"error",message:`${s}(id): the argument must be a string id literal (a scene / block / node id)`})}}function U(s,e,t){if(!s)throw new c(`${t}() requires at least one argument (the flags variable)`);let r=e.evaluate(s);if(Array.isArray(r))return r;if(r===!1||r===null||r===void 0)return[];throw new c(`${t}() first argument must be a flags property`)}function W(s){return(e,t)=>{if(e.length===0)return;let r=e[0];if(r.kind!=="scopedvar"){t.report({path:[...t.path,"args",0],kind:"wrong-arg-type",severity:"error",message:`${s}(): first argument must be a flags property reference (@name or @scope.name)`});return}let n=t.schema.properties.get(r.scope)?.get(r.name);if(n&&n.type!=="flags"){let i=r.scope===t.defaultScope?r.name:`${r.scope}.${r.name}`;t.report({path:[...t.path,"args",0],kind:"wrong-arg-type",severity:"error",message:`${s}(): \'@${i}\' is not a flags property (got ${n.type})`});return}for(let i=1;i<e.length;i++){let o=e[i];o.kind!=="flagdelta"?t.report({path:[...t.path,"args",i],kind:"wrong-arg-type",severity:"error",message:`${s}(): argument ${i+1} must be +flagName or -flagName`}):n?.type==="flags"&&n.enumValues&&!n.enumValues.includes(o.name)&&t.report({path:[...t.path,"args",i],kind:"unknown-flag-name",severity:"error",message:`${s}(): unknown flag \'${o.name}\'`,reference:o.name})}}}var ge=/^@[A-Za-z0-9_.]+$/;function*ue(s){let e="",t=0;for(;t<s.length;){let r=s[t];if(r==="{"&&s[t+1]==="{"){e+="{",t+=2;continue}if(r==="}"&&s[t+1]==="}"){e+="}",t+=2;continue}if(r==="{"){let n=s.indexOf("}",t+1);if(n!==-1){let i=s.slice(t,n+1),o=s.slice(t+1,n).trim();if(o.startsWith("@")){e&&(yield{kind:"text",value:e},e=""),yield{kind:"slot",raw:i,inner:o,ref:ge.test(o)?o:void 0},t=n+1;continue}e+=i,t=n+1;continue}}e+=r,t+=1}e&&(yield{kind:"text",value:e})}function fe(s){return Array.isArray(s)?s.join(", "):typeof s=="boolean"?s?"true":"false":String(s)}function he(s){return s===" "||s===" "||s===`\n`||s==="\\r"||s==="\\f"||s==="\\v"}function me(s){let e="",t=!1;for(let r of s){if(he(r)){t=!0;continue}t&&e.length>0&&(e+=" "),t=!1,e+=r}return e}function K(s,e,t){if(e.length===0||s.indexOf(e)<0)return s;let r="",n=0,i=!1;for(;n<s.length;){if(s.startsWith(e,n)){let o=s.indexOf(t,n+e.length);if(o>=0){n=o+t.length,i=!0;continue}r+=s.slice(n);break}r+=s[n],n+=1}return i?me(r):s}function z(s,e){if(s.indexOf("{")<0)return s;let t="";for(let r of ue(s)){if(r.kind==="text"){t+=r.value;continue}if(!r.ref){t+=r.raw;continue}let n=e(r.ref);t+=n===void 0?"":fe(n)}return t}function k(s,e){for(let t of s){e(t);let r=t.children;r&&k(r,e)}}function Se(s){return s.toLowerCase().replace(/[\'\u2019]/g,"").replace(/[^a-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function f(s){let e=s.gameId?.trim();return e||Se(s.name)}function V(s){return`cast:${s}`}var F={open:"[",close:"]"},X="SFX";function D(s){let e=new Set,t=[];for(let r of s)e.has(r)||(e.add(r),t.push(r));return t}function I(s){let e=new Map,t=(r,n)=>{let i=D([...n,...r.tags??[]]);if(e.set(r.id,i),r.type==="group")for(let o of r.children)t(o,i);else for(let o of r.beats??[])e.set(o.id,D([...i,...o.tags??[]]))};for(let r of Object.values(s.scenes)){let n=D(r.tags??[]);e.set(r.id,n);for(let i of r.blocks){let o=D([...n,...i.tags??[]]);e.set(i.id,o);for(let a of i.children)t(a,o)}}return e}var Z=new WeakMap,R=class s{host;defaultSeed;flowsById=new Map;allStrings;currentLocale;sourceDebug;sceneGameIdToId=new Map;blockGameIdToId=new Map;creationOptions;constructor(e,t={}){this.creationOptions=t;let r=t.locale??e.locales.default,n=e.strings;this.allStrings=n,this.currentLocale=r;let i=n[r]??{},o=n[e.locales.default]??{},a=e.localisation,p=a?.mode==="ids"&&!a.sourceDebug;this.sourceDebug=a?.mode==="ids"&&!!a.sourceDebug,this.sourceDebug&&typeof console<"u"&&console.warn("[Patterplay] source-only DEBUG build: strings are the source language for debugging, not a shippable localised build.");let d=new Map;for(let l of e.cast??[])l.displayName&&d.set(l.name,l.displayName);this.defaultSeed=(t.seed??2654435769)>>>0;let v=new Map,u=new Map,M=new Map;for(let[l,h]of Object.entries(e.scenes)){this.sceneGameIdToId.set(f(h),l);let y=new Map;for(let g of h.blocks)u.set(g.id,{sceneId:l}),M.set(g.id,g),y.set(f(g),g.id),k(g.children,H=>v.set(H.id,H));this.blockGameIdToId.set(l,y)}let j=e.properties??[],O=j.filter(l=>l.shared??!0).map(Q),se=j.filter(l=>!(l.shared??!0)).map(Q),ie=new Set(O.map(l=>l.name.toLowerCase())),B=new w().defineOwned("patter",O),L=new Set;if(t.world){let l=e.scopeRegistry?.scopes.find(y=>y.token==="world"),h=(l?.declarations??[]).map(Y);B.defineForeign("world",t.world,h,l?.writable??!0),L.add("world")}for(let l of e.scopeRegistry?.scopes??[]){if(L.has(l.token))continue;let h=(l.declarations??[]).map(Y);B.defineForeign(l.token,ve(l.declarations??[]),h,l.writable??!0)}let $=new Map;for(let[l,h]of Object.entries(e.scenes)){let y=new Set((h.sceneProps??[]).filter(g=>g.shared??!1).map(g=>g.name.toLowerCase()));$.set(l,y)}this.host={bundle:e,emitIds:p,strings:i,defaultStrings:o,castDisplay:d,nodeIndex:v,blockIndex:u,blockById:M,tagIndex:I(e),shared:B,patterSharedDecls:O,patterLocalDecls:se,patterSharedNames:ie,sceneSharedNames:$,sharedVisits:new Map,sharedSelectors:new Map,stageBags:new Map,customRng:t.rng,onDryChoice:t.onDryChoice,replayPromptOnChoose:t.replayPromptOnChoose??!1,captionsOn:t.closedCaptions??!0,captionOpen:(e.closedCaptions??F).open,captionClose:(e.closedCaptions??F).close,captionCharacter:e.closedCaptions?.character||X,refSplitCache:new Map}}get locale(){return this.currentLocale}get isSourceDebug(){return this.sourceDebug}setLocale(e){this.currentLocale=e,this.host.strings=this.allStrings[e]??{}}replaceStrings(e){this.allStrings=e.strings,this.host.strings=this.allStrings[this.currentLocale]??{},this.host.defaultStrings=this.allStrings[this.host.bundle.locales.default]??{}}hotSwap(e){let t=this.saveGame(),r=i=>(i.setLocale(this.currentLocale),i.setClosedCaptions(this.host.captionsOn),i),n=new s(e,this.creationOptions);try{return n.loadGame(t),r(n)}catch{let i=new s(e,this.creationOptions);for(let[o,a]of Object.entries(t.flows)){let p=a.cursor.currentSceneId;try{i.openFlow(o,p!==null?{scene:p}:{})}catch{}}return r(i)}}get closedCaptions(){return this.host.captionsOn}setClosedCaptions(e){this.host.captionsOn=e}openFlow(e,t={}){let r=this.resolveSceneRef(t.scene),n=this.resolveBlockRef(r,t.block),i=new b(e,this.host,t.seed??this.defaultSeed);return this.flowsById.set(e,i),i.start(r,n),i}resolveSceneRef(e){if(e!=null)return this.host.bundle.scenes[e]?e:this.sceneGameIdToId.get(e)??e}resolveBlockRef(e,t){if(t!=null){if(this.host.blockById.has(t))return t;if(e!=null){let r=this.blockGameIdToId.get(e)?.get(t);if(r)return r}return t}}sceneAddress(e){let t=this.host.bundle.scenes[e];return t?f(t):void 0}blockAddress(e){let t=this.host.blockById.get(e);return t?f(t):void 0}tagsForBeat(e){return this.host.tagIndex.get(e)??[]}tagsForScene(e){let t=this.resolveSceneRef(e);return(t!=null?this.host.tagIndex.get(t):void 0)??[]}tagsForBlock(e,t){let r=this.resolveSceneRef(e),n=this.resolveBlockRef(r,t);return(n!=null?this.host.tagIndex.get(n):void 0)??[]}getOutline(){return Object.values(this.host.bundle.scenes).map(e=>({id:e.id,...f(e)?{gameId:f(e)}:{},name:e.name,...this.tagsField(e.id),blocks:e.blocks.map(t=>({id:t.id,...f(t)?{gameId:f(t)}:{},name:t.name,...this.tagsField(t.id),children:t.children.map(r=>this.outlineNode(r))}))}))}getBeatSequence(){let e=[];for(let t of Object.values(this.host.bundle.scenes))for(let r of t.blocks)k(r.children,n=>{if(n.type==="snippet")for(let i of n.beats??[])e.push({sceneId:t.id,blockId:r.id,snippetId:n.id,beat:this.beatInfo(i)})});return e}outlineNode(e){return e.type==="group"?{type:"group",id:e.id,...this.tagsField(e.id),...e.selector?{selector:e.selector}:{},...e.prompt?{prompt:this.beatInfo(e.prompt)}:{},children:e.children.map(t=>this.outlineNode(t))}:{type:"snippet",id:e.id,...this.tagsField(e.id),beats:(e.beats??[]).map(t=>this.beatInfo(t)),...e.jump?{jumpTo:e.jump.to,...e.jump.mode?{jumpMode:e.jump.mode}:{}}:{}}}beatInfo(e){let t=this.host.tagIndex.get(e.id),r={id:e.id,kind:e.kind};if(e.kind==="line"){if(e.character!==void 0){r.character=e.character;let n=this.host.defaultStrings[V(e.character)]??this.host.castDisplay.get(e.character);n!==void 0&&(r.characterName=n)}e.direction!==void 0&&(r.direction=e.direction)}if(e.kind==="line"||e.kind==="text"){let n=this.host.defaultStrings[e.id];n!==void 0&&(r.text=n)}return e.gameData&&Object.keys(e.gameData).length&&(r.gameData=e.gameData),t&&t.length&&(r.tags=t),r}tagsField(e){let t=this.host.tagIndex.get(e);return t&&t.length?{tags:t}:{}}getFlow(e){return this.flowsById.get(e)}flows(){return[...this.flowsById.values()]}closeFlow(e){this.flowsById.delete(e)}reset(){this.flowsById.clear(),this.host.shared.reseedOwned("patter",this.host.patterSharedDecls),this.host.sharedVisits.clear(),this.host.sharedSelectors.clear(),this.host.stageBags.clear()}getProperty(e){let{scope:t,name:r}=this.splitShared(e);return this.host.shared.get(t,r)}setProperty(e,t){let{scope:r,name:n}=this.splitShared(e);this.host.shared.set(r,n,t)}listProperties(){return this.host.patterSharedDecls.map(e=>({ref:`@${e.name}`,type:e.type,values:e.values,value:this.getProperty(`@${e.name}`),default:ye(e)}))}splitShared(e){let t=this.host.refSplitCache.get(e);if(t||(t=A(e,r=>r==="scene"||this.host.shared.has(r)),this.host.refSplitCache.set(e,t)),t.scope==="scene")throw new Error(`\'${e}\': @scene properties are scene-scoped - read/write them on a Flow, not the Engine`);return t}save(){return this.host.shared.save()}load(e){this.host.shared.load(e)}saveGame(){let e={};for(let[t,r]of this.flowsById)e[t]=r.snapshot();return{version:2,shared:this.host.shared.save(),sharedVisits:Object.fromEntries(this.host.sharedVisits),sharedSelectors:ee(this.host.sharedSelectors),stageBags:Object.fromEntries([...this.host.stageBags].map(([t,r])=>[t,{...r}])),flows:e}}loadGame(e){if(e.version!==2)throw new Error(`unsupported save version: ${e.version}`);this.host.shared.load(e.shared),this.host.sharedVisits.clear();for(let[t,r]of Object.entries(e.sharedVisits??{}))this.host.sharedVisits.set(t,r);this.host.sharedSelectors.clear();for(let[t,r]of te(e.sharedSelectors))this.host.sharedSelectors.set(t,r);this.host.stageBags.clear();for(let[t,r]of Object.entries(e.stageBags??{}))this.host.stageBags.set(t,{...r});this.flowsById.clear();for(let[t,r]of Object.entries(e.flows)){let n=new b(t,this.host,this.defaultSeed);n.restore(r),this.flowsById.set(t,n)}}},b=class{id;host;local;rngState;started=!1;flowEnded=!1;currentSceneId=null;stack=[];activeSnippet=null;beatIndex=0;pendingChoice=null;pendingPromptBeat=null;pendingPromptOwnerId=null;selectors=new Map;visitCounts=new Map;sceneBags=new Map;patterResolver={get:e=>this.host.patterSharedNames.has(e)?this.host.shared.get("patter",e):this.local.get("patter",e),set:(e,t)=>{this.host.patterSharedNames.has(e)?this.host.shared.set("patter",e,t):this.local.set("patter",e,t)}};sceneResolver={get:e=>{let t=this.currentSceneId;return t===null?void 0:(this.host.sceneSharedNames.get(t)?.has(e)?this.host.stageBags.get(t):this.sceneBags.get(t))?.[e]},set:(e,t)=>{let r=this.currentSceneId;if(r===null)return;let n=this.host.sceneSharedNames.get(r)?.has(e)?this.host.stageBags.get(r):this.sceneBags.get(r);n&&(n[e]=t)}};evalCtx;constructor(e,t,r){this.id=e,this.host=t,this.rngState=r>>>0,this.local=this.freshLocal();let n={...t.shared.toEvalContext().scopes};n.patter=this.patterResolver,n.scene=this.sceneResolver,this.evalCtx={scopes:n,host:{nextRandom:this.rng,visits:i=>this.visitCounts.get(i)??0,patterVisits:i=>this.host.sharedVisits.get(i)??0}}}start(e,t){if(this.sceneBags.clear(),this.local=this.freshLocal(),this.selectors.clear(),this.visitCounts.clear(),this.stack=[],this.currentSceneId=null,this.flowEnded=!1,this.activeSnippet=null,this.beatIndex=0,this.pendingChoice=null,this.started=!0,t){let r=this.host.blockIndex.get(t);if(!r)throw new Error(`unknown block: ${t}`);this.enterSceneSetup(r.sceneId),this.stack=[{sceneId:r.sceneId,containerId:t,index:0}],this.enter(t)}else{let r=e??Object.keys(this.host.bundle.scenes)[0],n=r?this.host.bundle.scenes[r]:void 0;if(!n)throw new Error(r?`unknown scene: ${r}`:"no scenes in bundle");this.enterSceneSetup(r);let i=n.blocks[0];i&&(this.stack=[{sceneId:r,containerId:i.id,index:0}],this.enter(i.id))}this.settle()}reset(e,t){this.start(e,t)}get currentScene(){return this.currentSceneId}advance(){if(!this.started)throw new Error("flow has not been started");if(this.pendingPromptBeat){let e=this.pendingPromptBeat;return this.pendingPromptBeat=null,this.pendingPromptOwnerId=null,this.beatResult(e)}return this.settle(),this.flowEnded?{type:"end"}:this.pendingChoice?{type:"choice",groupId:this.pendingChoice.groupId,options:this.pendingChoice.options}:this.activeSnippet?this.beatResult(this.activeSnippet.beats[this.beatIndex++]):(this.flowEnded=!0,{type:"end"})}advanceToStop(){let e=[];for(;;){let t=this.advance();if(t.type==="choice"||t.type==="end")return{played:e,stop:t};e.push(t)}}settle(){let e=0;for(;;){if(++e>1e4)throw new Error("flow did not settle after 10000 transitions - likely a jump cycle with no deliverable content");if(this.flowEnded||this.pendingChoice)return;if(this.activeSnippet){if(this.beatIndex<(this.activeSnippet.beats?.length??0))return;this.runEffects(this.activeSnippet.onExit);let n=this.activeSnippet.jump;this.activeSnippet=null,this.beatIndex=0,this.resolveJump(n);continue}let t=this.stack[this.stack.length-1];if(!t){this.flowEnded=!0;return}t.sceneId!==this.currentSceneId&&(this.currentSceneId=t.sceneId);let r=this.childrenOf(t.containerId);if(!r){this.stack.pop();continue}for(;t.index<r.length&&!this.eligible(r[t.index]);)t.index++;if(t.index>=r.length){this.stack.pop();continue}this.enterChild(r[t.index++])}}getChoices(){return this.pendingChoice?.options??[]}choose(e){let t=this.pendingChoice;if(!t)throw new Error("no choice is pending");let r=t.options.find(i=>i.id===e);if(!r)throw new Error(`unknown choice option: ${e}`);if(!r.eligible)throw new Error(`choice option is not eligible: ${e}`);let n=t.byId.get(e);this.pendingChoice=null,this.pendingPromptBeat=this.host.replayPromptOnChoose?this.promptBeatOf(n)??null:null,this.pendingPromptOwnerId=this.pendingPromptBeat?n.id:null,this.enterChild(n)}isEnded(){return this.flowEnded}getProperty(e){let{scope:t,name:r}=this.splitRef(e);return t==="patter"?this.patterResolver.get(r):t==="scene"?this.sceneResolver.get(r):this.host.shared.get(t,r)}setProperty(e,t){let{scope:r,name:n}=this.splitRef(e);if(r==="patter")this.patterResolver.set(n,t);else if(r==="scene"){if(this.currentSceneId===null)throw new Error(`\'${e}\': the flow has not entered a scene yet`);this.sceneResolver.set(n,t)}else this.host.shared.set(r,n,t)}snapshot(){return{scopes:this.local.save(),sceneBags:Object.fromEntries([...this.sceneBags].map(([e,t])=>[e,{...t}])),rngState:this.rngState,visits:Object.fromEntries(this.visitCounts),cursor:{flowEnded:this.flowEnded,currentSceneId:this.currentSceneId,stack:this.stack.map(e=>{let t=this.childrenOf(e.containerId)?.[e.index];return t?{...e,nextId:t.id}:{...e}}),activeSnippetId:this.activeSnippet?.id??null,beatIndex:this.beatIndex,pendingChoice:this.pendingChoice?{groupId:this.pendingChoice.groupId,options:this.pendingChoice.options.map(e=>({...e}))}:null,pendingPromptOwnerId:this.pendingPromptOwnerId,selectors:ee(this.selectors)}}}restore(e){this.rngState=e.rngState>>>0,this.visitCounts=new Map(Object.entries(e.visits??{}));let t=e.cursor;if(this.started=!0,this.flowEnded=t.flowEnded,this.beatIndex=t.beatIndex,this.currentSceneId=t.currentSceneId,this.stack=t.stack.map(r=>{let{nextId:n,...i}=r;if(n!==void 0){let o=this.childrenOf(i.containerId)?.findIndex(a=>a.id===n)??-1;if(o>=0)return{...i,index:o}}return{...i}}),this.sceneBags=new Map(Object.entries(e.sceneBags??{}).map(([r,n])=>[r,{...n}])),this.local=this.freshLocal(),this.local.load(e.scopes),this.activeSnippet=null,t.activeSnippetId!==null){let r=this.host.nodeIndex.get(t.activeSnippetId);r&&r.type==="snippet"&&(this.activeSnippet=r)}if(this.selectors=te(t.selectors),this.pendingChoice=null,t.pendingChoice!==null){let r=new Map,n=[];for(let i of t.pendingChoice.options){let o=this.host.nodeIndex.get(i.id);o&&(r.set(i.id,o),n.push({...i}))}n.length>0&&(this.pendingChoice={groupId:t.pendingChoice.groupId,options:n,byId:r})}if(this.pendingPromptBeat=null,this.pendingPromptOwnerId=t.pendingPromptOwnerId??null,this.pendingPromptOwnerId){let r=this.host.nodeIndex.get(this.pendingPromptOwnerId);this.pendingPromptBeat=r?this.promptBeatOf(r)??null:null,this.pendingPromptBeat||(this.pendingPromptOwnerId=null)}}enterSceneSetup(e){let t=this.host.bundle.scenes[e];if(!t)throw new Error(`unknown scene: ${e}`);this.currentSceneId=e,this.enter(e),this.seedScene(t),this.runEffects(t.onEntry)}enterChild(e){if(this.enter(e.id),e.type==="snippet"){this.beginSnippet(e);return}let t=e.selector??"run";if(t==="run"){this.stack.push({sceneId:this.currentSceneId,containerId:e.id,index:0});return}if(t==="choice"){this.setupChoice(e);return}let r=this.selectChild(e);r&&this.enterChild(r)}childrenOf(e){let t=this.host.blockById.get(e);if(t)return t.children;let r=this.host.nodeIndex.get(e);if(r&&r.type==="group")return r.children}beginSnippet(e){this.runEffects(e.onEnter),this.activeSnippet=e,this.beatIndex=0}setupChoice(e){let t=[],r=new Map,n=[];for(let o of e.children){if(o.fallback===!0){n.push(o);continue}if(o.sticky!==!0&&(this.visitCounts.get(o.id)??0)>=1)continue;let a=this.eligible(o),p=o.secretUntilEligible===!0;!a&&p||(t.push({id:o.id,prompt:this.promptFor(o),eligible:a,gameData:o.gameData}),r.set(o.id,o))}if(t.length>0){this.pendingChoice={groupId:e.id,options:t,byId:r};return}let i=n.find(o=>this.eligible(o));if(i){this.enterChild(i);return}this.host.onDryChoice?.(e.id)}resolveJump(e){e&&this.enterTarget(e.to,e.mode==="call"?"call":"jump")}enterTarget(e,t){if(e==="END"){this.flowEnded=!0,this.stack=[];return}let r,n,i=this.host.bundle.scenes[e];if(i){this.enterSceneSetup(e);let a=i.blocks[0];if(!a){t==="jump"&&(this.stack=[]);return}r=e,n=a.id}else{let a=this.host.blockIndex.get(e);if(!a)throw new Error(`jump target not found: ${e}`);a.sceneId!==this.currentSceneId&&this.enterSceneSetup(a.sceneId),r=a.sceneId,n=e}this.enter(n);let o={sceneId:r,containerId:n,index:0};t==="call"?this.stack.push(o):this.stack=[o]}selectChild(e){let t=e.children.filter(n=>this.eligible(n));if(t.length===0)return null;let r=this.selectorState(e);switch(e.selector){case"branch":return t[0];case"sequence":{let n=e.options?.order??"sequential",i=e.options?.exhaust??"once";return n==="shuffle"?this.pickShuffle(t,i,r):this.pickSequential(t,i,r)}default:return null}}pickSequential(e,t,r){let n=e.length,i=r.seq??0;return r.seq=i+1,t==="repeat"?e[i%n]:i<n?e[i]:t==="stick"?e[n-1]:null}pickShuffle(e,t,r){let n=e.length,i=t==="stick",o=()=>(i?e.slice(0,n-1):e).map(u=>u.id);if(r.bag===void 0&&(r.bag=o()),r.bag.length===0){if(t==="once")return null;if(i){let u=e[n-1];return r.last=u.id,u}r.bag=o()}let a=r.bag,p=r.last!==void 0&&a.length>1?a.indexOf(r.last):-1,d=Math.floor(this.rng()*(p>=0?a.length-1:a.length));p>=0&&d>=p&&d++;let v=a[d];return a.splice(d,1),r.last=v,e.find(u=>u.id===v)}selectorState(e){let t=e.shared?this.host.sharedSelectors:this.selectors,r=t.get(e.id);return r||(r={},t.set(e.id,r)),r}runEffects(e){for(let t of e??[])this.setProperty(t.target,this.evalExpr(t.value))}eligible(e){return e.condition?we(this.evalExpr(e.condition)):!0}evalExpr(e){let t=Z.get(e);return t||(t=m(e.ast),Z.set(e,t)),P(t,this.evalCtx,J)}enter(e){this.visitCounts.set(e,(this.visitCounts.get(e)??0)+1),this.host.sharedVisits.set(e,(this.host.sharedVisits.get(e)??0)+1)}rng=()=>{if(this.host.customRng)return this.host.customRng();let e=this.rngState+1831565813|0;this.rngState=e;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296};beatResult(e){let t=this.host.tagIndex.get(e.id),r=t&&t.length?{tags:t}:{};switch(e.kind){case"gameEvent":return{type:"gameEvent",id:e.id,gameData:e.gameData,...r};case"text":return{type:"text",id:e.id,text:this.interpolate(this.resolveString(e.id)),gameData:e.gameData,...r};case"line":{let n=this.resolveString(e.id),i=!this.host.captionsOn,a=i&&e.character===this.host.captionCharacter?"":this.captionLine(this.host.bundle.voiced?n:this.interpolate(n)),p=i&&a.length===0;return{type:"line",id:e.id,text:a,character:p?void 0:e.character,characterName:p?void 0:this.resolveCharacterName(e.character),direction:p?void 0:e.direction,gameData:e.gameData,...r}}}}interpolate(e){return z(e,t=>this.getProperty(t))}stripCaptions(e){return K(e,this.host.captionOpen,this.host.captionClose)}captionLine(e){return this.host.captionsOn?e:this.stripCaptions(e)}promptFor(e){let t=this.promptBeatOf(e);if(!t)return;let r=this.interpolate(this.resolveString(t.id));return t.kind==="line"?{kind:"line",text:this.captionLine(r),character:t.character,characterName:this.resolveCharacterName(t.character),direction:t.direction}:{kind:"text",text:r}}promptBeatOf(e){return e.type==="group"&&e.prompt?e.prompt:((e.type==="snippet"?e:this.firstTextSnippetIn(e.children))?.beats??[]).find(r=>r.kind==="line"||r.kind==="text")}firstTextSnippetIn(e){let t;return k(e,r=>{!t&&r.type==="snippet"&&(r.beats??[]).some(n=>n.kind==="line"||n.kind==="text")&&(t=r)}),t}resolveString(e){if(this.host.emitIds)return e;let t=this.host.strings[e];if(t!==void 0)return t;let r=this.host.defaultStrings[e];return r!==void 0?`<Untranslated: ${e}> ${r}`:e}resolveCharacterName(e){if(e===void 0||this.host.emitIds)return;let t=V(e);return this.host.strings[t]??this.host.defaultStrings[t]??this.host.castDisplay.get(e)}splitRef(e){let t=this.host.refSplitCache.get(e);return t||(t=A(e,r=>r==="scene"||this.host.shared.has(r)),this.host.refSplitCache.set(e,t)),t}freshLocal(){return new w().defineOwned("patter",this.host.patterLocalDecls)}seedScene(e){let t=this.host.sceneSharedNames.get(e.id)??new Set;if(!this.sceneBags.has(e.id)){let r={};for(let n of e.sceneProps??[]){let i=n.name.toLowerCase();t.has(i)||(r[i]=T(n))}this.sceneBags.set(e.id,r)}if(!this.host.stageBags.has(e.id)){let r={};for(let n of e.sceneProps??[]){let i=n.name.toLowerCase();t.has(i)&&(r[i]=T(n))}this.host.stageBags.set(e.id,r)}for(let r of e.sceneProps??[]){if(!r.temporary)continue;let n=r.name.toLowerCase(),i=t.has(n)?this.host.stageBags.get(e.id):this.sceneBags.get(e.id);i&&(i[n]=T(r))}}};function ee(s){let e={};for(let[t,r]of s){let n={};r.seq!==void 0&&(n.seq=r.seq),r.bag&&(n.bag=[...r.bag]),r.last!==void 0&&(n.last=r.last),e[t]=n}return e}function te(s){let e=new Map;for(let[t,r]of Object.entries(s??{})){let n={};r.seq!==void 0&&(n.seq=r.seq),r.bag&&(n.bag=[...r.bag]),r.last!==void 0&&(n.last=r.last),e.set(t,n)}return e}function Q(s){return{name:s.name,type:s.type,values:s.values,default:s.default}}function ye(s){if(s.default!==void 0)return s.default;switch(s.type){case"number":return 0;case"string":return"";case"flags":return[];case"enum":return s.values?.[0]??"";default:return!1}}function Y(s){return{name:s.name,type:s.type,values:s.values,default:s.default,writable:s.writable}}function be(s){if(s.default!==void 0)return s.default;switch(s.type){case"boolean":return!1;case"number":return 0;case"string":return"";case"flags":return[];case"enum":return s.values?.[0]??""}}function ve(s){let e=new Map;for(let t of s)e.set(t.name,be(t));return{get:t=>e.get(t),set:(t,r)=>{e.set(t,r)}}}function T(s){if(s.default!==void 0)return s.default;switch(s.type){case"boolean":return!1;case"number":return 0;case"string":return"";case"flags":return[];case"enum":return s.values?.[0]??""}}function we(s){return typeof s=="boolean"?s:typeof s=="number"?s!==0:typeof s=="string"?s!=="":s.length>0}function re(s,e){return s.gameDataFields?.[e]??[]}function G(s,e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:s.find(r=>r.name===t)?.default}function ne(s,e){let t={};for(let r of s){let n=G(s,e,r.name);n!==void 0&&(t[r.name]=n)}for(let[r,n]of Object.entries(e??{}))r in t||(t[r]=n);return t}return de(xe);})();\n//# sourceMappingURL=patterplay.min.js.map';
|
|
194024
|
+
var PLAYABLE_RUNTIME_JS = '"use strict";var Patterplay=(()=>{var A=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var le=Object.prototype.hasOwnProperty;var pe=(s,e)=>{for(var t in e)A(s,t,{get:e[t],enumerable:!0})},de=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ce(e))!le.call(s,n)&&n!==t&&A(s,n,{get:()=>e[n],enumerable:!(r=ae(e,n))||r.enumerable});return s};var ge=s=>de(A({},"__esModule",{value:!0}),s);var xe={};pe(xe,{Engine:()=>B,Flow:()=>v,buildTagIndex:()=>O,effectiveGameData:()=>se,gameDataFields:()=>ne,gameDataValue:()=>j});function S(s){switch(s[0]){case"b":return{kind:"bool",value:s[1]};case"n":return{kind:"number",value:s[1]};case"s":return{kind:"string",value:s[1]};case"sv":return{kind:"scopedvar",scope:s[1],name:s[2]};case"u":return{kind:"unary",op:s[1],operand:S(s[2])};case"bin":return{kind:"binary",op:s[1],left:S(s[2]),right:S(s[3])};case"call":{let e=s.slice(2).map(S);return{kind:"call",name:s[1],args:e}}case"fd":return{kind:"flagdelta",sign:s[1],name:s[2]}}}var p=class extends Error{constructor(e){super(e),this.name="EvalError"}};function w(s,e,t){let r=new Map(t.scopes.map(i=>[i.token,i.missing??"false"])),n=i=>{switch(i.kind){case"bool":return i.value;case"number":return i.value;case"string":return i.value;case"scopedvar":{let o=e.scopes[i.scope];if(o===void 0)return!1;let a=typeof o.get=="function"?o.get(i.name):o[i.name];if(a===void 0){if(r.get(i.scope)==="throw")throw new p(`@${i.scope}.${i.name} is not declared on the current ${i.scope}.`);return!1}return a}case"call":{let o=t.functions[i.name];if(!o)throw new p(`unknown function \'${i.name}\'`);return o.eval(i.args,{evaluate:n,ctx:e})}case"flagdelta":throw new p("flagdelta node is only valid as an argument to a flag-delta function");case"unary":{if(i.op==="not"){let a=n(i.operand);if(typeof a!="boolean")throw new p(`\'not\' requires a boolean operand, got ${typeof a}`);return!a}let o=n(i.operand);if(typeof o!="number")throw new p(`unary \'-\' requires a numeric operand, got ${typeof o}`);return-o}case"binary":{if(i.op==="and"){let l=n(i.left);if(typeof l!="boolean")throw new p(`\'and\' requires boolean operands, left is ${typeof l}`);if(!l)return!1;let c=n(i.right);if(typeof c!="boolean")throw new p(`\'and\' requires boolean operands, right is ${typeof c}`);return c}if(i.op==="or"){let l=n(i.left);if(typeof l!="boolean")throw new p(`\'or\' requires boolean operands, left is ${typeof l}`);if(l)return!0;let c=n(i.right);if(typeof c!="boolean")throw new p(`\'or\' requires boolean operands, right is ${typeof c}`);return c}let o=n(i.left),a=n(i.right);switch(i.op){case"==":return U(o,a);case"!=":return!U(o,a);case">":return y(o,a,">"),o>a;case">=":return y(o,a,">="),o>=a;case"<":return y(o,a,"<"),o<a;case"<=":return y(o,a,"<="),o<=a;case"+":if(typeof o=="number"&&typeof a=="number"||typeof o=="string"&&typeof a=="string")return o+a;throw new p(`\'+\' requires two numbers or two strings, got ${typeof o} and ${typeof a}`);case"-":return y(o,a,"-"),o-a;case"*":return y(o,a,"*"),o*a;case"/":if(y(o,a,"/"),a===0)throw new p("division by zero");return o/a}}}};return n(s)}function U(s,e){if(Array.isArray(s)||Array.isArray(e)){if(!Array.isArray(s)||!Array.isArray(e)||s.length!==e.length)return!1;for(let t=0;t<s.length;t++)if(s[t]!==e[t])return!1;return!0}return s===e}function y(s,e,t){if(typeof s!="number"||typeof e!="number")throw new p(`\'${t}\' requires numeric operands, got ${typeof s} and ${typeof e}`)}var x=class{scopes=new Map;defineOwned(e,t){this.assertFree(e);let r={},n=new Map;for(let i of t){let o=i.name.toLowerCase();n.set(o,i),r[o]=i.default??W(i)}return this.scopes.set(e,{kind:"owned",bag:r,decls:n}),this}reseedOwned(e,t){let r=this.scopes.get(e);if(!r||r.kind!=="owned")throw new Error(`\'@${e}\' is not an owned scope`);for(let n of Object.keys(r.bag))delete r.bag[n];r.decls.clear();for(let n of t){let i=n.name.toLowerCase();r.decls.set(i,n),r.bag[i]=n.default??W(n)}return this}defineForeign(e,t,r=[],n=!0){this.assertFree(e);let i=new Map;for(let o of r)i.set(o.name.toLowerCase(),o);return this.scopes.set(e,{kind:"foreign",resolver:t,decls:i,scopeWritable:n}),this}has(e){return this.scopes.has(e)}get(e,t){let r=this.scopes.get(e);if(!r)return;let n=t.toLowerCase();return r.kind==="owned"?r.bag[n]:r.resolver.get(n)}set(e,t,r){let n=this.scopes.get(e);if(!n)throw new Error(`unknown scope \'@${e}\'`);let i=t.toLowerCase();if(!this.writable(n,i))throw new Error(`\'@${e}.${t}\' is read-only`);n.kind==="owned"?n.bag[i]=r:n.resolver.set(i,r)}writable(e,t){return e.kind==="owned"?e.decls.get(t)?.writable??!0:e.resolver.set?e.decls.get(t)?.writable??e.scopeWritable:!1}toEvalContext(e){let t={};for(let[r,n]of this.scopes)t[r]=n.kind==="owned"?n.bag:n.resolver;return{scopes:t,host:e}}toSchema(){let e=new Map;for(let[t,r]of this.scopes){if(r.decls.size===0)continue;let n=new Map;for(let[i,o]of r.decls)n.set(i,{type:o.type,enumValues:o.values});e.set(t,n)}return{properties:e}}save(){let e={};for(let[t,r]of this.scopes)r.kind==="owned"&&(e[t]={...r.bag});return e}load(e){for(let[t,r]of Object.entries(e)){let n=this.scopes.get(t);n?.kind==="owned"&&Object.assign(n.bag,r)}}assertFree(e){if(this.scopes.has(e))throw new Error(`scope \'@${e}\' is already registered`)}};function W(s){if(s.default!==void 0)return s.default;switch(s.type){case"boolean":return!1;case"number":return 0;case"string":return"";case"enum":return s.values?.[0]??"";case"flags":return[]}}function k(s){return s.ctx.host??{}}var I={defaultScope:"patter",scopes:[{token:"patter"},{token:"scene"}],functions:{random:{minArgs:2,maxArgs:2,returnType:"number",eval(s,e){if(s.length!==2)throw new p("random(a, b) requires exactly 2 arguments");let t=k(e).nextRandom;if(!t)throw new p("random() called without a PRNG in context");let r=e.evaluate(s[0]),n=e.evaluate(s[1]);if(typeof r!="number"||typeof n!="number")throw new p("random(a, b) arguments must be numbers");if(!Number.isInteger(r)||!Number.isInteger(n))throw new p("random(a, b) arguments must be integers");let i=Math.min(r,n),o=Math.max(r,n);return Math.floor(t()*(o-i+1))+i}},check_flags:{minArgs:1,returnType:"boolean",flagDeltaArgs:!0,validate:K("check_flags"),eval(s,e){let t=J(s[0],e,"check_flags");for(let r=1;r<s.length;r++){let n=s[r];if(n.kind!=="flagdelta")throw new p("check_flags() flag args must be +flagName or -flagName");if(n.sign==="+"?!t.includes(n.name):t.includes(n.name))return!1}return!0}},set_flags:{minArgs:1,returnType:"flags",flagDeltaArgs:!0,validate:K("set_flags"),eval(s,e){let t=[...J(s[0],e,"set_flags")];for(let r=1;r<s.length;r++){let n=s[r];if(n.kind!=="flagdelta")throw new p("set_flags() flag args must be +flagName or -flagName");if(n.sign==="+")t.includes(n.name)||t.push(n.name);else{let i=t.indexOf(n.name);i>=0&&t.splice(i,1)}}return t}},visits:{minArgs:1,maxArgs:1,returnType:"number",validate:D("visits"),eval:(s,e)=>k(e).visits?.(C(s,e,"visits"))??0},seen:{minArgs:1,maxArgs:1,returnType:"boolean",validate:D("seen"),eval:(s,e)=>(k(e).visits?.(C(s,e,"seen"))??0)>0},patter_visits:{minArgs:1,maxArgs:1,returnType:"number",validate:D("patter_visits"),eval:(s,e)=>k(e).patterVisits?.(C(s,e,"patter_visits"))??0},patter_seen:{minArgs:1,maxArgs:1,returnType:"boolean",validate:D("patter_seen"),eval:(s,e)=>(k(e).patterVisits?.(C(s,e,"patter_seen"))??0)>0}}};function V(s,e){let t=s.replace(/^@/,"").split(".");return t.length===2&&e(t[0])?{scope:t[0],name:t[1].toLowerCase()}:{scope:"patter",name:t.join(".").toLowerCase()}}function C(s,e,t){let r=e.evaluate(s[0]);if(typeof r!="string")throw new p(`${t}(id) requires a string node id`);return r}function D(s){return(e,t)=>{let r=e[0];r&&r.kind!=="string"&&t.report({path:[...t.path,"args",0],kind:"wrong-arg-type",severity:"error",message:`${s}(id): the argument must be a string id literal (a scene / block / node id)`})}}function J(s,e,t){if(!s)throw new p(`${t}() requires at least one argument (the flags variable)`);let r=e.evaluate(s);if(Array.isArray(r))return r;if(r===!1||r===null||r===void 0)return[];throw new p(`${t}() first argument must be a flags property`)}function K(s){return(e,t)=>{if(e.length===0)return;let r=e[0];if(r.kind!=="scopedvar"){t.report({path:[...t.path,"args",0],kind:"wrong-arg-type",severity:"error",message:`${s}(): first argument must be a flags property reference (@name or @scope.name)`});return}let n=t.schema.properties.get(r.scope)?.get(r.name);if(n&&n.type!=="flags"){let i=r.scope===t.defaultScope?r.name:`${r.scope}.${r.name}`;t.report({path:[...t.path,"args",0],kind:"wrong-arg-type",severity:"error",message:`${s}(): \'@${i}\' is not a flags property (got ${n.type})`});return}for(let i=1;i<e.length;i++){let o=e[i];o.kind!=="flagdelta"?t.report({path:[...t.path,"args",i],kind:"wrong-arg-type",severity:"error",message:`${s}(): argument ${i+1} must be +flagName or -flagName`}):n?.type==="flags"&&n.enumValues&&!n.enumValues.includes(o.name)&&t.report({path:[...t.path,"args",i],kind:"unknown-flag-name",severity:"error",message:`${s}(): unknown flag \'${o.name}\'`,reference:o.name})}}}var ue=/^@[A-Za-z0-9_.]+$/;function*fe(s){let e="",t=0;for(;t<s.length;){let r=s[t];if(r==="{"&&s[t+1]==="{"){e+="{",t+=2;continue}if(r==="}"&&s[t+1]==="}"){e+="}",t+=2;continue}if(r==="{"){let n=s.indexOf("}",t+1);if(n!==-1){let i=s.slice(t,n+1),o=s.slice(t+1,n).trim();if(o.startsWith("@")){e&&(yield{kind:"text",value:e},e=""),yield{kind:"slot",raw:i,inner:o,ref:ue.test(o)?o:void 0},t=n+1;continue}e+=i,t=n+1;continue}}e+=r,t+=1}e&&(yield{kind:"text",value:e})}function he(s){return Array.isArray(s)?s.join(", "):typeof s=="boolean"?s?"true":"false":String(s)}function me(s){return s===" "||s===" "||s===`\n`||s==="\\r"||s==="\\f"||s==="\\v"}function Se(s){let e="",t=!1;for(let r of s){if(me(r)){t=!0;continue}t&&e.length>0&&(e+=" "),t=!1,e+=r}return e}function z(s,e,t){if(e.length===0||s.indexOf(e)<0)return s;let r="",n=0,i=!1;for(;n<s.length;){if(s.startsWith(e,n)){let o=s.indexOf(t,n+e.length);if(o>=0){n=o+t.length,i=!0;continue}r+=s.slice(n);break}r+=s[n],n+=1}return i?Se(r):s}function X(s,e){if(s.indexOf("{")<0)return s;let t="";for(let r of fe(s)){if(r.kind==="text"){t+=r.value;continue}if(!r.ref){t+=r.raw;continue}let n=e(r.ref);t+=n===void 0?"":he(n)}return t}function E(s,e){for(let t of s){e(t);let r=t.children;r&&E(r,e)}}function ye(s){return s.toLowerCase().replace(/[\'\u2019]/g,"").replace(/[^a-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function h(s){let e=s.gameId?.trim();return e||ye(s.name)}function F(s){return`cast:${s}`}var T={open:"[",close:"]"},Z="SFX";function R(s){let e=new Set,t=[];for(let r of s)e.has(r)||(e.add(r),t.push(r));return t}function O(s){let e=new Map,t=(r,n)=>{let i=R([...n,...r.tags??[]]);if(e.set(r.id,i),r.type==="group")for(let o of r.children)t(o,i);else for(let o of r.beats??[])e.set(o.id,R([...i,...o.tags??[]]))};for(let r of Object.values(s.scenes)){let n=R(r.tags??[]);e.set(r.id,n);for(let i of r.blocks){let o=R([...n,...i.tags??[]]);e.set(i.id,o);for(let a of i.children)t(a,o)}}return e}var Q=new WeakMap,B=class s{host;defaultSeed;flowsById=new Map;allStrings;currentLocale;sourceDebug;sceneGameIdToId=new Map;blockGameIdToId=new Map;creationOptions;constructor(e,t={}){this.creationOptions=t;let r=t.locale??e.locales.default,n=e.strings;this.allStrings=n,this.currentLocale=r;let i=n[r]??{},o=n[e.locales.default]??{},a=e.localisation,l=a?.mode==="ids"&&!a.sourceDebug;this.sourceDebug=a?.mode==="ids"&&!!a.sourceDebug,this.sourceDebug&&typeof console<"u"&&console.warn("[Patterplay] source-only DEBUG build: strings are the source language for debugging, not a shippable localised build.");let c=new Map;for(let d of e.cast??[])d.displayName&&c.set(d.name,d.displayName);this.defaultSeed=(t.seed??2654435769)>>>0;let g=new Map,u=new Map,L=new Map;for(let[d,m]of Object.entries(e.scenes)){this.sceneGameIdToId.set(h(m),d);let b=new Map;for(let f of m.blocks)u.set(f.id,{sceneId:d}),L.set(f.id,f),b.set(h(f),f.id),E(f.children,q=>g.set(q.id,q));this.blockGameIdToId.set(d,b)}let $=e.properties??[],N=$.filter(d=>d.shared??!0).map(Y),ie=$.filter(d=>!(d.shared??!0)).map(Y),oe=new Set(N.map(d=>d.name.toLowerCase())),P=new x().defineOwned("patter",N),H=new Set;if(t.world){let d=e.scopeRegistry?.scopes.find(b=>b.token==="world"),m=(d?.declarations??[]).map(ee);P.defineForeign("world",t.world,m,d?.writable??!0),H.add("world")}for(let d of e.scopeRegistry?.scopes??[]){if(H.has(d.token))continue;let m=(d.declarations??[]).map(ee);P.defineForeign(d.token,we(d.declarations??[]),m,d.writable??!0)}let _=new Map;for(let[d,m]of Object.entries(e.scenes)){let b=new Set((m.sceneProps??[]).filter(f=>f.shared??!1).map(f=>f.name.toLowerCase()));_.set(d,b)}this.host={bundle:e,emitIds:l,strings:i,defaultStrings:o,castDisplay:c,nodeIndex:g,blockIndex:u,blockById:L,tagIndex:O(e),shared:P,patterSharedDecls:N,patterLocalDecls:ie,patterSharedNames:oe,sceneSharedNames:_,sharedVisits:new Map,sharedSelectors:new Map,stageBags:new Map,customRng:t.rng,onDryChoice:t.onDryChoice,replayPromptOnChoose:t.replayPromptOnChoose??!1,captionsOn:t.closedCaptions??!0,captionOpen:(e.closedCaptions??T).open,captionClose:(e.closedCaptions??T).close,captionCharacter:e.closedCaptions?.character||Z,refSplitCache:new Map}}get locale(){return this.currentLocale}get isSourceDebug(){return this.sourceDebug}setLocale(e){this.currentLocale=e,this.host.strings=this.allStrings[e]??{}}replaceStrings(e){this.allStrings=e.strings,this.host.strings=this.allStrings[this.currentLocale]??{},this.host.defaultStrings=this.allStrings[this.host.bundle.locales.default]??{}}hotSwap(e){let t=this.saveGame(),r=i=>(i.setLocale(this.currentLocale),i.setClosedCaptions(this.host.captionsOn),i),n=new s(e,this.creationOptions);try{return n.loadGame(t),r(n)}catch{let i=new s(e,this.creationOptions);for(let[o,a]of Object.entries(t.flows)){let l=a.cursor.currentSceneId;try{i.openFlow(o,l!==null?{scene:l}:{})}catch{}}return r(i)}}get closedCaptions(){return this.host.captionsOn}setClosedCaptions(e){this.host.captionsOn=e}openFlow(e,t={}){let r=this.resolveSceneRef(t.scene),n=this.resolveBlockRef(r,t.block),i=new v(e,this.host,t.seed??this.defaultSeed);return this.flowsById.set(e,i),i.start(r,n),i}resolveSceneRef(e){if(e!=null)return this.host.bundle.scenes[e]?e:this.sceneGameIdToId.get(e)??e}resolveBlockRef(e,t){if(t!=null){if(this.host.blockById.has(t))return t;if(e!=null){let r=this.blockGameIdToId.get(e)?.get(t);if(r)return r}return t}}sceneAddress(e){let t=this.host.bundle.scenes[e];return t?h(t):void 0}blockAddress(e){let t=this.host.blockById.get(e);return t?h(t):void 0}tagsForBeat(e){return this.host.tagIndex.get(e)??[]}tagsForScene(e){let t=this.resolveSceneRef(e);return(t!=null?this.host.tagIndex.get(t):void 0)??[]}tagsForBlock(e,t){let r=this.resolveSceneRef(e),n=this.resolveBlockRef(r,t);return(n!=null?this.host.tagIndex.get(n):void 0)??[]}getOutline(){return Object.values(this.host.bundle.scenes).map(e=>({id:e.id,...h(e)?{gameId:h(e)}:{},name:e.name,...this.tagsField(e.id),blocks:e.blocks.map(t=>({id:t.id,...h(t)?{gameId:h(t)}:{},name:t.name,...this.tagsField(t.id),children:t.children.map(r=>this.outlineNode(r))}))}))}getBeatSequence(){let e=[];for(let t of Object.values(this.host.bundle.scenes))for(let r of t.blocks)E(r.children,n=>{if(n.type==="snippet")for(let i of n.beats??[])e.push({sceneId:t.id,blockId:r.id,snippetId:n.id,beat:this.beatInfo(i)})});return e}outlineNode(e){return e.type==="group"?{type:"group",id:e.id,...this.tagsField(e.id),...e.selector?{selector:e.selector}:{},...e.prompt?{prompt:this.beatInfo(e.prompt)}:{},children:e.children.map(t=>this.outlineNode(t))}:{type:"snippet",id:e.id,...this.tagsField(e.id),beats:(e.beats??[]).map(t=>this.beatInfo(t)),...e.jump?{jumpTo:e.jump.to,...e.jump.mode?{jumpMode:e.jump.mode}:{}}:{}}}beatInfo(e){let t=this.host.tagIndex.get(e.id),r={id:e.id,kind:e.kind};if(e.kind==="line"){if(e.character!==void 0){r.character=e.character;let n=this.host.defaultStrings[F(e.character)]??this.host.castDisplay.get(e.character);n!==void 0&&(r.characterName=n)}e.direction!==void 0&&(r.direction=e.direction)}if(e.kind==="line"||e.kind==="text"){let n=this.host.defaultStrings[e.id];n!==void 0&&(r.text=n)}return e.gameData&&Object.keys(e.gameData).length&&(r.gameData=e.gameData),t&&t.length&&(r.tags=t),r}tagsField(e){let t=this.host.tagIndex.get(e);return t&&t.length?{tags:t}:{}}getFlow(e){return this.flowsById.get(e)}flows(){return[...this.flowsById.values()]}closeFlow(e){this.flowsById.delete(e)}reset(){this.flowsById.clear(),this.host.shared.reseedOwned("patter",this.host.patterSharedDecls),this.host.sharedVisits.clear(),this.host.sharedSelectors.clear(),this.host.stageBags.clear()}getProperty(e){let{scope:t,name:r}=this.splitShared(e);return this.host.shared.get(t,r)}setProperty(e,t){let{scope:r,name:n}=this.splitShared(e);this.host.shared.set(r,n,t)}listProperties(){return this.host.patterSharedDecls.map(e=>({ref:`@${e.name}`,type:e.type,values:e.values,value:this.getProperty(`@${e.name}`),default:be(e)}))}splitShared(e){let t=this.host.refSplitCache.get(e);if(t||(t=V(e,r=>r==="scene"||this.host.shared.has(r)),this.host.refSplitCache.set(e,t)),t.scope==="scene")throw new Error(`\'${e}\': @scene properties are scene-scoped - read/write them on a Flow, not the Engine`);return t}save(){return this.host.shared.save()}load(e){this.host.shared.load(e)}saveGame(){let e={};for(let[t,r]of this.flowsById)e[t]=r.snapshot();return{version:2,shared:this.host.shared.save(),sharedVisits:Object.fromEntries(this.host.sharedVisits),sharedSelectors:te(this.host.sharedSelectors),stageBags:Object.fromEntries([...this.host.stageBags].map(([t,r])=>[t,{...r}])),flows:e}}loadGame(e){if(e.version!==2)throw new Error(`unsupported save version: ${e.version}`);this.host.shared.load(e.shared),this.host.sharedVisits.clear();for(let[t,r]of Object.entries(e.sharedVisits??{}))this.host.sharedVisits.set(t,r);this.host.sharedSelectors.clear();for(let[t,r]of re(e.sharedSelectors))this.host.sharedSelectors.set(t,r);this.host.stageBags.clear();for(let[t,r]of Object.entries(e.stageBags??{}))this.host.stageBags.set(t,{...r});this.flowsById.clear();for(let[t,r]of Object.entries(e.flows)){let n=new v(t,this.host,this.defaultSeed);n.restore(r),this.flowsById.set(t,n)}}},v=class{id;host;local;rngState;started=!1;flowEnded=!1;currentSceneId=null;stack=[];activeSnippet=null;beatIndex=0;pendingChoice=null;pendingPromptBeat=null;pendingPromptOwnerId=null;selectors=new Map;visitCounts=new Map;sceneBags=new Map;patterResolver={get:e=>this.host.patterSharedNames.has(e)?this.host.shared.get("patter",e):this.local.get("patter",e),set:(e,t)=>{this.host.patterSharedNames.has(e)?this.host.shared.set("patter",e,t):this.local.set("patter",e,t)}};sceneResolver={get:e=>{let t=this.currentSceneId;return t===null?void 0:(this.host.sceneSharedNames.get(t)?.has(e)?this.host.stageBags.get(t):this.sceneBags.get(t))?.[e]},set:(e,t)=>{let r=this.currentSceneId;if(r===null)return;let n=this.host.sceneSharedNames.get(r)?.has(e)?this.host.stageBags.get(r):this.sceneBags.get(r);n&&(n[e]=t)}};evalCtx;constructor(e,t,r){this.id=e,this.host=t,this.rngState=r>>>0,this.local=this.freshLocal();let n={...t.shared.toEvalContext().scopes};n.patter=this.patterResolver,n.scene=this.sceneResolver,this.evalCtx={scopes:n,host:{nextRandom:this.rng,visits:i=>this.visitCounts.get(i)??0,patterVisits:i=>this.host.sharedVisits.get(i)??0}}}start(e,t){if(this.sceneBags.clear(),this.local=this.freshLocal(),this.selectors.clear(),this.visitCounts.clear(),this.stack=[],this.currentSceneId=null,this.flowEnded=!1,this.activeSnippet=null,this.beatIndex=0,this.pendingChoice=null,this.started=!0,t){let r=this.host.blockIndex.get(t);if(!r)throw new Error(`unknown block: ${t}`);this.enterSceneSetup(r.sceneId),this.stack=[{sceneId:r.sceneId,containerId:t,index:0}],this.enter(t)}else{let r=e??Object.keys(this.host.bundle.scenes)[0],n=r?this.host.bundle.scenes[r]:void 0;if(!n)throw new Error(r?`unknown scene: ${r}`:"no scenes in bundle");this.enterSceneSetup(r);let i=n.blocks[0];i&&(this.stack=[{sceneId:r,containerId:i.id,index:0}],this.enter(i.id))}this.settle()}reset(e,t){this.start(e,t)}get currentScene(){return this.currentSceneId}advance(){if(!this.started)throw new Error("flow has not been started");if(this.pendingPromptBeat){let e=this.pendingPromptBeat;return this.pendingPromptBeat=null,this.pendingPromptOwnerId=null,this.beatResult(e)}return this.settle(),this.flowEnded?{type:"end"}:this.pendingChoice?{type:"choice",groupId:this.pendingChoice.groupId,options:this.pendingChoice.options}:this.activeSnippet?this.beatResult(this.activeSnippet.beats[this.beatIndex++]):(this.flowEnded=!0,{type:"end"})}advanceToStop(){let e=[];for(;;){let t=this.advance();if(t.type==="choice"||t.type==="end")return{played:e,stop:t};e.push(t)}}settle(){let e=0;for(;;){if(++e>1e4)throw new Error("flow did not settle after 10000 transitions - likely a jump cycle with no deliverable content");if(this.flowEnded||this.pendingChoice)return;if(this.activeSnippet){if(this.beatIndex<(this.activeSnippet.beats?.length??0))return;this.runEffects(this.activeSnippet.onExit);let n=this.activeSnippet.jump;this.activeSnippet=null,this.beatIndex=0,this.resolveJump(n);continue}let t=this.stack[this.stack.length-1];if(!t){this.flowEnded=!0;return}t.sceneId!==this.currentSceneId&&(this.currentSceneId=t.sceneId);let r=this.childrenOf(t.containerId);if(!r){this.stack.pop();continue}for(;t.index<r.length&&!this.eligible(r[t.index]);)t.index++;if(t.index>=r.length){this.stack.pop();continue}this.enterChild(r[t.index++])}}getChoices(){return this.pendingChoice?.options??[]}choose(e){let t=this.pendingChoice;if(!t)throw new Error("no choice is pending");let r=t.options.find(i=>i.id===e);if(!r)throw new Error(`unknown choice option: ${e}`);if(!r.eligible)throw new Error(`choice option is not eligible: ${e}`);let n=t.byId.get(e);this.pendingChoice=null,this.pendingPromptBeat=this.host.replayPromptOnChoose?this.promptBeatOf(n)??null:null,this.pendingPromptOwnerId=this.pendingPromptBeat?n.id:null,this.enterChild(n)}isEnded(){return this.flowEnded}getProperty(e){let{scope:t,name:r}=this.splitRef(e);return t==="patter"?this.patterResolver.get(r):t==="scene"?this.sceneResolver.get(r):this.host.shared.get(t,r)}setProperty(e,t){let{scope:r,name:n}=this.splitRef(e);if(r==="patter")this.patterResolver.set(n,t);else if(r==="scene"){if(this.currentSceneId===null)throw new Error(`\'${e}\': the flow has not entered a scene yet`);this.sceneResolver.set(n,t)}else this.host.shared.set(r,n,t)}snapshot(){return{scopes:this.local.save(),sceneBags:Object.fromEntries([...this.sceneBags].map(([e,t])=>[e,{...t}])),rngState:this.rngState,visits:Object.fromEntries(this.visitCounts),cursor:{flowEnded:this.flowEnded,currentSceneId:this.currentSceneId,stack:this.stack.map(e=>{let t=this.childrenOf(e.containerId)?.[e.index];return t?{...e,nextId:t.id}:{...e}}),activeSnippetId:this.activeSnippet?.id??null,beatIndex:this.beatIndex,pendingChoice:this.pendingChoice?{groupId:this.pendingChoice.groupId,options:this.pendingChoice.options.map(e=>({...e}))}:null,pendingPromptOwnerId:this.pendingPromptOwnerId,selectors:te(this.selectors)}}}restore(e){this.rngState=e.rngState>>>0,this.visitCounts=new Map(Object.entries(e.visits??{}));let t=e.cursor;if(this.started=!0,this.flowEnded=t.flowEnded,this.beatIndex=t.beatIndex,this.currentSceneId=t.currentSceneId,this.stack=t.stack.map(r=>{let{nextId:n,...i}=r;if(n!==void 0){let o=this.childrenOf(i.containerId)?.findIndex(a=>a.id===n)??-1;if(o>=0)return{...i,index:o}}return{...i}}),this.sceneBags=new Map(Object.entries(e.sceneBags??{}).map(([r,n])=>[r,{...n}])),this.local=this.freshLocal(),this.local.load(e.scopes),this.activeSnippet=null,t.activeSnippetId!==null){let r=this.host.nodeIndex.get(t.activeSnippetId);r&&r.type==="snippet"&&(this.activeSnippet=r)}if(this.selectors=re(t.selectors),this.pendingChoice=null,t.pendingChoice!==null){let r=new Map,n=[];for(let i of t.pendingChoice.options){let o=this.host.nodeIndex.get(i.id);o&&(r.set(i.id,o),n.push({...i}))}n.length>0&&(this.pendingChoice={groupId:t.pendingChoice.groupId,options:n,byId:r})}if(this.pendingPromptBeat=null,this.pendingPromptOwnerId=t.pendingPromptOwnerId??null,this.pendingPromptOwnerId){let r=this.host.nodeIndex.get(this.pendingPromptOwnerId);this.pendingPromptBeat=r?this.promptBeatOf(r)??null:null,this.pendingPromptBeat||(this.pendingPromptOwnerId=null)}}enterSceneSetup(e){let t=this.host.bundle.scenes[e];if(!t)throw new Error(`unknown scene: ${e}`);this.currentSceneId=e,this.enter(e),this.seedScene(t),this.runEffects(t.onEntry)}enterChild(e){if(this.enter(e.id),e.type==="snippet"){this.beginSnippet(e);return}let t=e.selector??"run";if(t==="run"){this.stack.push({sceneId:this.currentSceneId,containerId:e.id,index:0});return}if(t==="choice"){this.setupChoice(e);return}let r=this.selectChild(e);r&&this.enterChild(r)}childrenOf(e){let t=this.host.blockById.get(e);if(t)return t.children;let r=this.host.nodeIndex.get(e);if(r&&r.type==="group")return r.children}beginSnippet(e){this.runEffects(e.onEnter),this.activeSnippet=e,this.beatIndex=0}setupChoice(e){let t=[],r=new Map,n=[];for(let o of e.children){if(o.fallback===!0){n.push(o);continue}if(o.sticky!==!0&&(this.visitCounts.get(o.id)??0)>=1)continue;let a=this.eligible(o),l=o.secretUntilEligible===!0;!a&&l||(t.push({id:o.id,prompt:this.promptFor(o),eligible:a,gameData:o.gameData}),r.set(o.id,o))}if(t.length>0){this.pendingChoice={groupId:e.id,options:t,byId:r};return}let i=n.find(o=>this.eligible(o));if(i){this.enterChild(i);return}this.host.onDryChoice?.(e.id)}resolveJump(e){e&&this.enterTarget(e.to,e.mode==="call"?"call":"jump")}enterTarget(e,t){if(e==="END"){this.flowEnded=!0,this.stack=[];return}let r,n,i=this.host.bundle.scenes[e];if(i){this.enterSceneSetup(e);let a=i.blocks[0];if(!a){t==="jump"&&(this.stack=[]);return}r=e,n=a.id}else{let a=this.host.blockIndex.get(e);if(!a)throw new Error(`jump target not found: ${e}`);a.sceneId!==this.currentSceneId&&this.enterSceneSetup(a.sceneId),r=a.sceneId,n=e}this.enter(n);let o={sceneId:r,containerId:n,index:0};t==="call"?this.stack.push(o):this.stack=[o]}selectChild(e){let t=e.children.filter(n=>this.eligible(n));if(t.length===0)return null;let r=this.selectorState(e);switch(e.selector){case"branch":return t[0];case"sequence":{let n=e.options?.order??"sequential",i=e.options?.exhaust??"once";return n==="shuffle"?this.pickShuffle(t,i,r):n==="specificity"?this.pickSpecificity(t,i,r):this.pickSequential(t,i,r)}default:return null}}pickSequential(e,t,r){let n=e.length,i=r.seq??0;return r.seq=i+1,t==="repeat"?e[i%n]:i<n?e[i]:t==="stick"?e[n-1]:null}pickShuffle(e,t,r){let n=e.length,i=t==="stick",o=()=>(i?e.slice(0,n-1):e).map(u=>u.id);if(r.bag===void 0&&(r.bag=o()),r.bag.length===0){if(t==="once")return null;if(i){let u=e[n-1];return r.last=u.id,u}r.bag=o()}let a=r.bag,l=r.last!==void 0&&a.length>1?a.indexOf(r.last):-1,c=Math.floor(this.rng()*(l>=0?a.length-1:a.length));l>=0&&c>=l&&c++;let g=a[c];return a.splice(c,1),r.last=g,e.find(u=>u.id===g)}pickSpecificity(e,t,r){let n=e;if(t!=="repeat"){r.bag===void 0&&(r.bag=e.map(g=>g.id));let c=new Set(r.bag);if(n=e.filter(g=>c.has(g.id)),n.length===0)return t==="stick"&&r.last!==void 0?e.find(g=>g.id===r.last)??null:null}let i=-1,a=n.map(c=>{let g=this.specScore(c);return g>i&&(i=g),{c,s:g}}).filter(c=>c.s===i).map(c=>c.c),l;if(a.length===1)l=a[0];else{let c=r.last!==void 0?a.findIndex(u=>u.id===r.last):-1,g=Math.floor(this.rng()*(c>=0?a.length-1:a.length));c>=0&&g>=c&&g++,l=a[g]}return t!=="repeat"&&(r.bag=r.bag.filter(c=>c!==l.id)),r.last=l.id,l}specScore(e){return e.condition?this.matchedSpec(this.conditionAst(e.condition),!0):0}matchedSpec(e,t){if(e.kind==="binary"&&(e.op==="and"||e.op==="or")){let r=e.op==="and"===t,n=this.matchedSpec(e.left,t),i=this.matchedSpec(e.right,t);return r?n>0&&i>0?n+i:0:Math.max(n,i)}if(e.kind==="unary"&&e.op==="not")return this.matchedSpec(e.operand,!t);if(e.kind==="call"&&e.name==="check_flags"){let r=Math.max(1,e.args.length-1),n=M(w(e,this.evalCtx,I));return t?n?r:0:n?0:1}return M(w(e,this.evalCtx,I))===t?1:0}selectorState(e){let t=e.shared?this.host.sharedSelectors:this.selectors,r=t.get(e.id);return r||(r={},t.set(e.id,r)),r}runEffects(e){for(let t of e??[])this.setProperty(t.target,this.evalExpr(t.value))}eligible(e){return e.condition?M(this.evalExpr(e.condition)):!0}evalExpr(e){return w(this.conditionAst(e),this.evalCtx,I)}conditionAst(e){let t=Q.get(e);return t||(t=S(e.ast),Q.set(e,t)),t}enter(e){this.visitCounts.set(e,(this.visitCounts.get(e)??0)+1),this.host.sharedVisits.set(e,(this.host.sharedVisits.get(e)??0)+1)}rng=()=>{if(this.host.customRng)return this.host.customRng();let e=this.rngState+1831565813|0;this.rngState=e;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296};beatResult(e){let t=this.host.tagIndex.get(e.id),r=t&&t.length?{tags:t}:{};switch(e.kind){case"gameEvent":return{type:"gameEvent",id:e.id,gameData:e.gameData,...r};case"text":return{type:"text",id:e.id,text:this.interpolate(this.resolveString(e.id)),gameData:e.gameData,...r};case"line":{let n=this.resolveString(e.id),i=!this.host.captionsOn,a=i&&e.character===this.host.captionCharacter?"":this.captionLine(this.host.bundle.voiced?n:this.interpolate(n)),l=i&&a.length===0;return{type:"line",id:e.id,text:a,character:l?void 0:e.character,characterName:l?void 0:this.resolveCharacterName(e.character),direction:l?void 0:e.direction,gameData:e.gameData,...r}}}}interpolate(e){return X(e,t=>this.getProperty(t))}stripCaptions(e){return z(e,this.host.captionOpen,this.host.captionClose)}captionLine(e){return this.host.captionsOn?e:this.stripCaptions(e)}promptFor(e){let t=this.promptBeatOf(e);if(!t)return;let r=this.interpolate(this.resolveString(t.id));return t.kind==="line"?{kind:"line",text:this.captionLine(r),character:t.character,characterName:this.resolveCharacterName(t.character),direction:t.direction}:{kind:"text",text:r}}promptBeatOf(e){return e.type==="group"&&e.prompt?e.prompt:((e.type==="snippet"?e:this.firstTextSnippetIn(e.children))?.beats??[]).find(r=>r.kind==="line"||r.kind==="text")}firstTextSnippetIn(e){let t;return E(e,r=>{!t&&r.type==="snippet"&&(r.beats??[]).some(n=>n.kind==="line"||n.kind==="text")&&(t=r)}),t}resolveString(e){if(this.host.emitIds)return e;let t=this.host.strings[e];if(t!==void 0)return t;let r=this.host.defaultStrings[e];return r!==void 0?`<Untranslated: ${e}> ${r}`:e}resolveCharacterName(e){if(e===void 0||this.host.emitIds)return;let t=F(e);return this.host.strings[t]??this.host.defaultStrings[t]??this.host.castDisplay.get(e)}splitRef(e){let t=this.host.refSplitCache.get(e);return t||(t=V(e,r=>r==="scene"||this.host.shared.has(r)),this.host.refSplitCache.set(e,t)),t}freshLocal(){return new x().defineOwned("patter",this.host.patterLocalDecls)}seedScene(e){let t=this.host.sceneSharedNames.get(e.id)??new Set;if(!this.sceneBags.has(e.id)){let r={};for(let n of e.sceneProps??[]){let i=n.name.toLowerCase();t.has(i)||(r[i]=G(n))}this.sceneBags.set(e.id,r)}if(!this.host.stageBags.has(e.id)){let r={};for(let n of e.sceneProps??[]){let i=n.name.toLowerCase();t.has(i)&&(r[i]=G(n))}this.host.stageBags.set(e.id,r)}for(let r of e.sceneProps??[]){if(!r.temporary)continue;let n=r.name.toLowerCase(),i=t.has(n)?this.host.stageBags.get(e.id):this.sceneBags.get(e.id);i&&(i[n]=G(r))}}};function te(s){let e={};for(let[t,r]of s){let n={};r.seq!==void 0&&(n.seq=r.seq),r.bag&&(n.bag=[...r.bag]),r.last!==void 0&&(n.last=r.last),e[t]=n}return e}function re(s){let e=new Map;for(let[t,r]of Object.entries(s??{})){let n={};r.seq!==void 0&&(n.seq=r.seq),r.bag&&(n.bag=[...r.bag]),r.last!==void 0&&(n.last=r.last),e.set(t,n)}return e}function Y(s){return{name:s.name,type:s.type,values:s.values,default:s.default}}function be(s){if(s.default!==void 0)return s.default;switch(s.type){case"number":return 0;case"string":return"";case"flags":return[];case"enum":return s.values?.[0]??"";default:return!1}}function ee(s){return{name:s.name,type:s.type,values:s.values,default:s.default,writable:s.writable}}function ve(s){if(s.default!==void 0)return s.default;switch(s.type){case"boolean":return!1;case"number":return 0;case"string":return"";case"flags":return[];case"enum":return s.values?.[0]??""}}function we(s){let e=new Map;for(let t of s)e.set(t.name,ve(t));return{get:t=>e.get(t),set:(t,r)=>{e.set(t,r)}}}function G(s){if(s.default!==void 0)return s.default;switch(s.type){case"boolean":return!1;case"number":return 0;case"string":return"";case"flags":return[];case"enum":return s.values?.[0]??""}}function M(s){return typeof s=="boolean"?s:typeof s=="number"?s!==0:typeof s=="string"?s!=="":s.length>0}function ne(s,e){return s.gameDataFields?.[e]??[]}function j(s,e,t){return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:s.find(r=>r.name===t)?.default}function se(s,e){let t={};for(let r of s){let n=j(s,e,r.name);n!==void 0&&(t[r.name]=n)}for(let[r,n]of Object.entries(e??{}))r in t||(t[r]=n);return t}return ge(xe);})();\n//# sourceMappingURL=patterplay.min.js.map';
|
|
195506
194025
|
|
|
195507
194026
|
// ../ops/src/export-html.ts
|
|
195508
194027
|
var esc = (s) => s.replace(/[&<>]/g, (c2) => ({ "&": "&", "<": "<", ">": ">" })[c2]);
|
|
@@ -196739,7 +195258,7 @@ var Flow = class {
|
|
|
196739
195258
|
case "sequence": {
|
|
196740
195259
|
const order = group.options?.order ?? "sequential";
|
|
196741
195260
|
const exhaust = group.options?.exhaust ?? "once";
|
|
196742
|
-
return order === "shuffle" ? this.pickShuffle(eligible, exhaust, st) : this.pickSequential(eligible, exhaust, st);
|
|
195261
|
+
return order === "shuffle" ? this.pickShuffle(eligible, exhaust, st) : order === "specificity" ? this.pickSpecificity(eligible, exhaust, st) : this.pickSequential(eligible, exhaust, st);
|
|
196743
195262
|
}
|
|
196744
195263
|
case "run":
|
|
196745
195264
|
case "choice":
|
|
@@ -196786,6 +195305,78 @@ var Flow = class {
|
|
|
196786
195305
|
st.last = id;
|
|
196787
195306
|
return eligible.find((c2) => c2.id === id);
|
|
196788
195307
|
}
|
|
195308
|
+
/**
|
|
195309
|
+
* `sequence` with `order: "specificity"` - **Best match**: score every eligible child by how
|
|
195310
|
+
* specifically its condition fits the CURRENT state (`matchedSpec`), keep the top-scoring tier,
|
|
195311
|
+
* and break ties with the seeded shuffle (no immediate repeat). A child with no condition scores
|
|
195312
|
+
* 0, so it is the filler that wins only when nothing more specific is eligible.
|
|
195313
|
+
*
|
|
195314
|
+
* `exhaust` composes as it does for the other orders: `repeat` re-scores the full eligible set
|
|
195315
|
+
* every draw (re-pickable - the character keeps preferring the on-topic line); `once` uses each
|
|
195316
|
+
* pick up (a bag of remaining ids), so as specific lines are consumed the group slides down to
|
|
195317
|
+
* less-specific ones and finally the filler, then yields null; `stick` degrades like `once` but
|
|
195318
|
+
* holds the final pick forever instead of drying up.
|
|
195319
|
+
*/
|
|
195320
|
+
pickSpecificity(eligible, exhaust, st) {
|
|
195321
|
+
let pool = eligible;
|
|
195322
|
+
if (exhaust !== "repeat") {
|
|
195323
|
+
if (st.bag === void 0) st.bag = eligible.map((c2) => c2.id);
|
|
195324
|
+
const remaining = new Set(st.bag);
|
|
195325
|
+
pool = eligible.filter((c2) => remaining.has(c2.id));
|
|
195326
|
+
if (pool.length === 0) {
|
|
195327
|
+
return exhaust === "stick" && st.last !== void 0 ? eligible.find((c2) => c2.id === st.last) ?? null : null;
|
|
195328
|
+
}
|
|
195329
|
+
}
|
|
195330
|
+
let best = -1;
|
|
195331
|
+
const scored = pool.map((c2) => {
|
|
195332
|
+
const s = this.specScore(c2);
|
|
195333
|
+
if (s > best) best = s;
|
|
195334
|
+
return { c: c2, s };
|
|
195335
|
+
});
|
|
195336
|
+
const tier = scored.filter((x) => x.s === best).map((x) => x.c);
|
|
195337
|
+
let pick;
|
|
195338
|
+
if (tier.length === 1) {
|
|
195339
|
+
pick = tier[0];
|
|
195340
|
+
} else {
|
|
195341
|
+
const p = st.last !== void 0 ? tier.findIndex((c2) => c2.id === st.last) : -1;
|
|
195342
|
+
let i = Math.floor(this.rng() * (p >= 0 ? tier.length - 1 : tier.length));
|
|
195343
|
+
if (p >= 0 && i >= p) i++;
|
|
195344
|
+
pick = tier[i];
|
|
195345
|
+
}
|
|
195346
|
+
if (exhaust !== "repeat") st.bag = st.bag.filter((id) => id !== pick.id);
|
|
195347
|
+
st.last = pick.id;
|
|
195348
|
+
return pick;
|
|
195349
|
+
}
|
|
195350
|
+
/** A child's Best-match score against the current state: 0 when it has no condition (the filler
|
|
195351
|
+
* tier), else the specificity of its (already-passing) condition. */
|
|
195352
|
+
specScore(node) {
|
|
195353
|
+
return node.condition ? this.matchedSpec(this.conditionAst(node.condition), true) : 0;
|
|
195354
|
+
}
|
|
195355
|
+
/**
|
|
195356
|
+
* The **matched-specificity** metric (parity contract): how many atomic constraints are actively
|
|
195357
|
+
* holding this condition TRUE against the live state. Evaluation-aware, not a static clause count -
|
|
195358
|
+
* it walks the tree with a De-Morgan polarity flag so `or` and `not` score the branch that is
|
|
195359
|
+
* actually carrying the truth. `want` = "does this subtree need to be true for the whole condition
|
|
195360
|
+
* to hold?" (true at the root). Only `and`/`or`/`not`/`check_flags` are structural; every other
|
|
195361
|
+
* node (comparisons, scoped vars, literals, other calls) is an atom, evaluated whole.
|
|
195362
|
+
*/
|
|
195363
|
+
matchedSpec(node, want) {
|
|
195364
|
+
if (node.kind === "binary" && (node.op === "and" || node.op === "or")) {
|
|
195365
|
+
const behaveAsAnd = node.op === "and" === want;
|
|
195366
|
+
const l2 = this.matchedSpec(node.left, want);
|
|
195367
|
+
const r = this.matchedSpec(node.right, want);
|
|
195368
|
+
return behaveAsAnd ? l2 > 0 && r > 0 ? l2 + r : 0 : Math.max(l2, r);
|
|
195369
|
+
}
|
|
195370
|
+
if (node.kind === "unary" && node.op === "not") {
|
|
195371
|
+
return this.matchedSpec(node.operand, !want);
|
|
195372
|
+
}
|
|
195373
|
+
if (node.kind === "call" && node.name === "check_flags") {
|
|
195374
|
+
const operands = Math.max(1, node.args.length - 1);
|
|
195375
|
+
const hit = truthy(evaluate(node, this.evalCtx, patterDialect));
|
|
195376
|
+
return want ? hit ? operands : 0 : hit ? 0 : 1;
|
|
195377
|
+
}
|
|
195378
|
+
return truthy(evaluate(node, this.evalCtx, patterDialect)) === want ? 1 : 0;
|
|
195379
|
+
}
|
|
196789
195380
|
/** A selector's cursor state - shared across flows (`group.shared`) or this flow's own. */
|
|
196790
195381
|
selectorState(group) {
|
|
196791
195382
|
const map2 = group.shared ? this.host.sharedSelectors : this.selectors;
|
|
@@ -196807,12 +195398,17 @@ var Flow = class {
|
|
|
196807
195398
|
return truthy(this.evalExpr(node.condition));
|
|
196808
195399
|
}
|
|
196809
195400
|
evalExpr(expr) {
|
|
195401
|
+
return evaluate(this.conditionAst(expr), this.evalCtx, patterDialect);
|
|
195402
|
+
}
|
|
195403
|
+
/** The deserialised (in-memory) AST for an expression, cached per Expression. Shared by the
|
|
195404
|
+
* evaluator and the Best-match specificity walker so both work off one parse. */
|
|
195405
|
+
conditionAst(expr) {
|
|
196810
195406
|
let ast = astCache.get(expr);
|
|
196811
195407
|
if (!ast) {
|
|
196812
195408
|
ast = deserialiseAst(expr.ast);
|
|
196813
195409
|
astCache.set(expr, ast);
|
|
196814
195410
|
}
|
|
196815
|
-
return
|
|
195411
|
+
return ast;
|
|
196816
195412
|
}
|
|
196817
195413
|
/** Record an entry of a node (entered-only; spec §7): bumps the flow + world counts. */
|
|
196818
195414
|
enter(id) {
|
|
@@ -202917,7 +201513,7 @@ var require__stream_duplex = /* @__PURE__ */ __commonJSMin(((exports2, module2)
|
|
|
202917
201513
|
}
|
|
202918
201514
|
});
|
|
202919
201515
|
}));
|
|
202920
|
-
var
|
|
201516
|
+
var require_safe_buffer2 = /* @__PURE__ */ __commonJSMin(((exports2, module2) => {
|
|
202921
201517
|
var buffer2 = require_buffer();
|
|
202922
201518
|
var Buffer2 = buffer2.Buffer;
|
|
202923
201519
|
function copyProps(src, dst) {
|
|
@@ -202953,8 +201549,8 @@ var require_safe_buffer7 = /* @__PURE__ */ __commonJSMin(((exports2, module2) =>
|
|
|
202953
201549
|
return buffer2.SlowBuffer(size);
|
|
202954
201550
|
};
|
|
202955
201551
|
}));
|
|
202956
|
-
var
|
|
202957
|
-
var Buffer2 =
|
|
201552
|
+
var require_string_decoder2 = /* @__PURE__ */ __commonJSMin(((exports2) => {
|
|
201553
|
+
var Buffer2 = require_safe_buffer2().Buffer;
|
|
202958
201554
|
var isEncoding = Buffer2.isEncoding || function(encoding) {
|
|
202959
201555
|
encoding = "" + encoding;
|
|
202960
201556
|
switch (encoding && encoding.toLowerCase()) {
|
|
@@ -203511,7 +202107,7 @@ var require__stream_readable = /* @__PURE__ */ __commonJSMin(((exports2, module2
|
|
|
203511
202107
|
this.decoder = null;
|
|
203512
202108
|
this.encoding = null;
|
|
203513
202109
|
if (options.encoding) {
|
|
203514
|
-
if (!StringDecoder) StringDecoder =
|
|
202110
|
+
if (!StringDecoder) StringDecoder = require_string_decoder2().StringDecoder;
|
|
203515
202111
|
this.decoder = new StringDecoder(options.encoding);
|
|
203516
202112
|
this.encoding = options.encoding;
|
|
203517
202113
|
}
|
|
@@ -203618,7 +202214,7 @@ var require__stream_readable = /* @__PURE__ */ __commonJSMin(((exports2, module2
|
|
|
203618
202214
|
return this._readableState.flowing === false;
|
|
203619
202215
|
};
|
|
203620
202216
|
Readable.prototype.setEncoding = function(enc) {
|
|
203621
|
-
if (!StringDecoder) StringDecoder =
|
|
202217
|
+
if (!StringDecoder) StringDecoder = require_string_decoder2().StringDecoder;
|
|
203622
202218
|
var decoder = new StringDecoder(enc);
|
|
203623
202219
|
this._readableState.decoder = decoder;
|
|
203624
202220
|
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
@@ -204503,7 +203099,7 @@ var require_sax = /* @__PURE__ */ __commonJSMin(((exports2) => {
|
|
|
204503
203099
|
SAXStream.prototype.write = function(data) {
|
|
204504
203100
|
if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data)) {
|
|
204505
203101
|
if (!this._decoder) {
|
|
204506
|
-
var SD =
|
|
203102
|
+
var SD = require_string_decoder2().StringDecoder;
|
|
204507
203103
|
this._decoder = new SD("utf8");
|
|
204508
203104
|
}
|
|
204509
203105
|
data = this._decoder.write(data);
|
|
@@ -241414,9 +240010,6 @@ ${writes.length} shard(s) -> ${flags.o}`);
|
|
|
241414
240010
|
process.exit(await main(process.argv.slice(2)));
|
|
241415
240011
|
/*! Bundled license information:
|
|
241416
240012
|
|
|
241417
|
-
safe-buffer/index.js:
|
|
241418
|
-
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
241419
|
-
|
|
241420
240013
|
xmlchars/xml/1.0/ed5.js:
|
|
241421
240014
|
(**
|
|
241422
240015
|
* Character classes and associated utilities for the 5th edition of XML 1.0.
|