@tscircuit/cli 0.1.395 → 0.1.396

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +1414 -1304
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -57683,582 +57683,6 @@ var require_ignore = __commonJS((exports2, module2) => {
57683
57683
  define2(module2.exports, Symbol.for("setupWindows"), setupWindows);
57684
57684
  });
57685
57685
 
57686
- // node_modules/minimist/index.js
57687
- var require_minimist = __commonJS((exports2, module2) => {
57688
- function hasKey(obj, keys) {
57689
- var o = obj;
57690
- keys.slice(0, -1).forEach(function(key2) {
57691
- o = o[key2] || {};
57692
- });
57693
- var key = keys[keys.length - 1];
57694
- return key in o;
57695
- }
57696
- function isNumber(x) {
57697
- if (typeof x === "number") {
57698
- return true;
57699
- }
57700
- if (/^0x[0-9a-f]+$/i.test(x)) {
57701
- return true;
57702
- }
57703
- return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
57704
- }
57705
- function isConstructorOrProto(obj, key) {
57706
- return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
57707
- }
57708
- module2.exports = function(args, opts) {
57709
- if (!opts) {
57710
- opts = {};
57711
- }
57712
- var flags = {
57713
- bools: {},
57714
- strings: {},
57715
- unknownFn: null
57716
- };
57717
- if (typeof opts.unknown === "function") {
57718
- flags.unknownFn = opts.unknown;
57719
- }
57720
- if (typeof opts.boolean === "boolean" && opts.boolean) {
57721
- flags.allBools = true;
57722
- } else {
57723
- [].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
57724
- flags.bools[key2] = true;
57725
- });
57726
- }
57727
- var aliases = {};
57728
- function aliasIsBoolean(key2) {
57729
- return aliases[key2].some(function(x) {
57730
- return flags.bools[x];
57731
- });
57732
- }
57733
- Object.keys(opts.alias || {}).forEach(function(key2) {
57734
- aliases[key2] = [].concat(opts.alias[key2]);
57735
- aliases[key2].forEach(function(x) {
57736
- aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
57737
- return x !== y;
57738
- }));
57739
- });
57740
- });
57741
- [].concat(opts.string).filter(Boolean).forEach(function(key2) {
57742
- flags.strings[key2] = true;
57743
- if (aliases[key2]) {
57744
- [].concat(aliases[key2]).forEach(function(k) {
57745
- flags.strings[k] = true;
57746
- });
57747
- }
57748
- });
57749
- var defaults = opts.default || {};
57750
- var argv = { _: [] };
57751
- function argDefined(key2, arg2) {
57752
- return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
57753
- }
57754
- function setKey(obj, keys, value2) {
57755
- var o = obj;
57756
- for (var i2 = 0;i2 < keys.length - 1; i2++) {
57757
- var key2 = keys[i2];
57758
- if (isConstructorOrProto(o, key2)) {
57759
- return;
57760
- }
57761
- if (o[key2] === undefined) {
57762
- o[key2] = {};
57763
- }
57764
- if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) {
57765
- o[key2] = {};
57766
- }
57767
- if (o[key2] === Array.prototype) {
57768
- o[key2] = [];
57769
- }
57770
- o = o[key2];
57771
- }
57772
- var lastKey = keys[keys.length - 1];
57773
- if (isConstructorOrProto(o, lastKey)) {
57774
- return;
57775
- }
57776
- if (o === Object.prototype || o === Number.prototype || o === String.prototype) {
57777
- o = {};
57778
- }
57779
- if (o === Array.prototype) {
57780
- o = [];
57781
- }
57782
- if (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === "boolean") {
57783
- o[lastKey] = value2;
57784
- } else if (Array.isArray(o[lastKey])) {
57785
- o[lastKey].push(value2);
57786
- } else {
57787
- o[lastKey] = [o[lastKey], value2];
57788
- }
57789
- }
57790
- function setArg(key2, val, arg2) {
57791
- if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
57792
- if (flags.unknownFn(arg2) === false) {
57793
- return;
57794
- }
57795
- }
57796
- var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
57797
- setKey(argv, key2.split("."), value2);
57798
- (aliases[key2] || []).forEach(function(x) {
57799
- setKey(argv, x.split("."), value2);
57800
- });
57801
- }
57802
- Object.keys(flags.bools).forEach(function(key2) {
57803
- setArg(key2, defaults[key2] === undefined ? false : defaults[key2]);
57804
- });
57805
- var notFlags = [];
57806
- if (args.indexOf("--") !== -1) {
57807
- notFlags = args.slice(args.indexOf("--") + 1);
57808
- args = args.slice(0, args.indexOf("--"));
57809
- }
57810
- for (var i = 0;i < args.length; i++) {
57811
- var arg = args[i];
57812
- var key;
57813
- var next;
57814
- if (/^--.+=/.test(arg)) {
57815
- var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
57816
- key = m[1];
57817
- var value = m[2];
57818
- if (flags.bools[key]) {
57819
- value = value !== "false";
57820
- }
57821
- setArg(key, value, arg);
57822
- } else if (/^--no-.+/.test(arg)) {
57823
- key = arg.match(/^--no-(.+)/)[1];
57824
- setArg(key, false, arg);
57825
- } else if (/^--.+/.test(arg)) {
57826
- key = arg.match(/^--(.+)/)[1];
57827
- next = args[i + 1];
57828
- if (next !== undefined && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
57829
- setArg(key, next, arg);
57830
- i += 1;
57831
- } else if (/^(true|false)$/.test(next)) {
57832
- setArg(key, next === "true", arg);
57833
- i += 1;
57834
- } else {
57835
- setArg(key, flags.strings[key] ? "" : true, arg);
57836
- }
57837
- } else if (/^-[^-]+/.test(arg)) {
57838
- var letters = arg.slice(1, -1).split("");
57839
- var broken = false;
57840
- for (var j = 0;j < letters.length; j++) {
57841
- next = arg.slice(j + 2);
57842
- if (next === "-") {
57843
- setArg(letters[j], next, arg);
57844
- continue;
57845
- }
57846
- if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
57847
- setArg(letters[j], next.slice(1), arg);
57848
- broken = true;
57849
- break;
57850
- }
57851
- if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
57852
- setArg(letters[j], next, arg);
57853
- broken = true;
57854
- break;
57855
- }
57856
- if (letters[j + 1] && letters[j + 1].match(/\W/)) {
57857
- setArg(letters[j], arg.slice(j + 2), arg);
57858
- broken = true;
57859
- break;
57860
- } else {
57861
- setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
57862
- }
57863
- }
57864
- key = arg.slice(-1)[0];
57865
- if (!broken && key !== "-") {
57866
- if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
57867
- setArg(key, args[i + 1], arg);
57868
- i += 1;
57869
- } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
57870
- setArg(key, args[i + 1] === "true", arg);
57871
- i += 1;
57872
- } else {
57873
- setArg(key, flags.strings[key] ? "" : true, arg);
57874
- }
57875
- }
57876
- } else {
57877
- if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
57878
- argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
57879
- }
57880
- if (opts.stopEarly) {
57881
- argv._.push.apply(argv._, args.slice(i + 1));
57882
- break;
57883
- }
57884
- }
57885
- }
57886
- Object.keys(defaults).forEach(function(k) {
57887
- if (!hasKey(argv, k.split("."))) {
57888
- setKey(argv, k.split("."), defaults[k]);
57889
- (aliases[k] || []).forEach(function(x) {
57890
- setKey(argv, x.split("."), defaults[k]);
57891
- });
57892
- }
57893
- });
57894
- if (opts["--"]) {
57895
- argv["--"] = notFlags.slice();
57896
- } else {
57897
- notFlags.forEach(function(k) {
57898
- argv._.push(k);
57899
- });
57900
- }
57901
- return argv;
57902
- };
57903
- });
57904
-
57905
- // node_modules/perfect-cli/dist/index.js
57906
- var require_dist7 = __commonJS((exports2, module2) => {
57907
- var __create3 = Object.create;
57908
- var __defProp3 = Object.defineProperty;
57909
- var __defProps = Object.defineProperties;
57910
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
57911
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
57912
- var __getOwnPropNames3 = Object.getOwnPropertyNames;
57913
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
57914
- var __getProtoOf3 = Object.getPrototypeOf;
57915
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
57916
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
57917
- var __defNormalProp = (obj, key, value) => (key in obj) ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
57918
- var __spreadValues = (a, b) => {
57919
- for (var prop in b || (b = {}))
57920
- if (__hasOwnProp3.call(b, prop))
57921
- __defNormalProp(a, prop, b[prop]);
57922
- if (__getOwnPropSymbols)
57923
- for (var prop of __getOwnPropSymbols(b)) {
57924
- if (__propIsEnum.call(b, prop))
57925
- __defNormalProp(a, prop, b[prop]);
57926
- }
57927
- return a;
57928
- };
57929
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
57930
- var __objRest = (source, exclude) => {
57931
- var target = {};
57932
- for (var prop in source)
57933
- if (__hasOwnProp3.call(source, prop) && exclude.indexOf(prop) < 0)
57934
- target[prop] = source[prop];
57935
- if (source != null && __getOwnPropSymbols)
57936
- for (var prop of __getOwnPropSymbols(source)) {
57937
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
57938
- target[prop] = source[prop];
57939
- }
57940
- return target;
57941
- };
57942
- var __export2 = (target, all) => {
57943
- for (var name in all)
57944
- __defProp3(target, name, { get: all[name], enumerable: true });
57945
- };
57946
- var __copyProps2 = (to, from, except, desc) => {
57947
- if (from && typeof from === "object" || typeof from === "function") {
57948
- for (let key of __getOwnPropNames3(from))
57949
- if (!__hasOwnProp3.call(to, key) && key !== except)
57950
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
57951
- }
57952
- return to;
57953
- };
57954
- var __toESM3 = (mod, isNodeMode, target) => (target = mod != null ? __create3(__getProtoOf3(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target, mod));
57955
- var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
57956
- var __async = (__this, __arguments, generator) => {
57957
- return new Promise((resolve9, reject) => {
57958
- var fulfilled = (value) => {
57959
- try {
57960
- step(generator.next(value));
57961
- } catch (e) {
57962
- reject(e);
57963
- }
57964
- };
57965
- var rejected = (value) => {
57966
- try {
57967
- step(generator.throw(value));
57968
- } catch (e) {
57969
- reject(e);
57970
- }
57971
- };
57972
- var step = (x) => x.done ? resolve9(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
57973
- step((generator = generator.apply(__this, __arguments)).next());
57974
- });
57975
- };
57976
- var src_exports = {};
57977
- __export2(src_exports, {
57978
- getCommandFromPath: () => getCommandFromPath,
57979
- getCommandPathOnly: () => getCommandPathOnly,
57980
- perfectCli: () => perfectCli
57981
- });
57982
- module2.exports = __toCommonJS2(src_exports);
57983
- var import_minimist = __toESM3(require_minimist());
57984
- var import_prompts6 = __toESM3(require_prompts3());
57985
- var getAllLeafCommandPaths = (program3) => {
57986
- const allCommandPaths = [];
57987
- const traverse = (command, currentPath) => {
57988
- if (command.commands.length === 0) {
57989
- allCommandPaths.push(currentPath.join(" "));
57990
- }
57991
- command.commands.forEach((subcommand) => {
57992
- traverse(subcommand, [...currentPath, subcommand.name()]);
57993
- });
57994
- };
57995
- traverse(program3, []);
57996
- return allCommandPaths.filter((path22) => path22 !== "");
57997
- };
57998
- var normalizeCommandName = (s) => s.replace(/_/g, "-").toLowerCase();
57999
- var getCommandFromPath = (program3, commandPathAndPositionalArgs) => {
58000
- const commandPath = getCommandPathOnly(program3, commandPathAndPositionalArgs);
58001
- return commandPath.reduce((curr, nextCommandName) => !curr ? null : curr.commands.find((c) => normalizeCommandName(c.name()) === normalizeCommandName(nextCommandName)), program3);
58002
- };
58003
- var getCommandPathOnly = (program3, commandPathAndPositionalArgs) => {
58004
- const allLeafCommandPaths = getAllLeafCommandPaths(program3).map((path22) => normalizeCommandName(path22));
58005
- const commandPath = [];
58006
- for (const elm of commandPathAndPositionalArgs) {
58007
- if (elm.startsWith("-"))
58008
- continue;
58009
- commandPath.push(elm);
58010
- if (allLeafCommandPaths.includes(normalizeCommandName(commandPath.join(" ")))) {
58011
- break;
58012
- }
58013
- }
58014
- return commandPath;
58015
- };
58016
- var getPositionalArgsOnly = (program3, commandPathAndPositionalArgs) => {
58017
- const allLeafCommandPaths = getAllLeafCommandPaths(program3);
58018
- const commandPath = [];
58019
- let positionalArgs = [];
58020
- for (const elm of commandPathAndPositionalArgs) {
58021
- if (elm.startsWith("-"))
58022
- continue;
58023
- commandPath.push(elm);
58024
- if (allLeafCommandPaths.includes(commandPath.join(" "))) {
58025
- positionalArgs = commandPathAndPositionalArgs.slice(commandPath.length);
58026
- break;
58027
- }
58028
- }
58029
- return positionalArgs;
58030
- };
58031
- var getStrictCommandPath = (program3, commandPath) => {
58032
- const strictCommandPath = [];
58033
- for (let i = 0;i < commandPath.length; i++) {
58034
- strictCommandPath.push(getCommandFromPath(program3, commandPath.slice(0, i + 1)).name());
58035
- }
58036
- return strictCommandPath;
58037
- };
58038
- var figureOutCommandPath = (program3, commandPath) => __async(undefined, null, function* () {
58039
- const currentCommand = getCommandFromPath(program3, commandPath);
58040
- if (currentCommand.commands.length === 0) {
58041
- return commandPath;
58042
- }
58043
- const normalizeText = (text) => text.replace(/[-_ ]/g, "_").toLowerCase();
58044
- const { nextCommandName } = yield (0, import_prompts6.default)({
58045
- type: "autocomplete",
58046
- name: "nextCommandName",
58047
- message: "Choose command",
58048
- suggest: (input, choices) => __async(undefined, null, function* () {
58049
- const normalizedInput = normalizeText(input);
58050
- return choices.filter((c) => {
58051
- var _a, _b;
58052
- return normalizeText(c == null ? undefined : c.title).startsWith(normalizedInput) || ((_b = normalizeText((_a = c == null ? undefined : c.title) == null ? undefined : _a.split(" ").pop())) == null ? undefined : _b.startsWith(normalizedInput));
58053
- });
58054
- }),
58055
- choices: currentCommand.commands.map((c) => ({
58056
- title: `${[program3.name(), ...commandPath, c.name()].filter(Boolean).join(" ")}`,
58057
- value: c.name(),
58058
- description: c.description()
58059
- }))
58060
- });
58061
- return figureOutCommandPath(program3, commandPath.concat([nextCommandName]));
58062
- });
58063
- var import_prompts22 = __toESM3(require_prompts3());
58064
- var camelToKebab = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
58065
- var findOptionByKey = (command, key) => {
58066
- var _a;
58067
- return (_a = command == null ? undefined : command.options) == null ? undefined : _a.find((o) => {
58068
- var _a2, _b;
58069
- const longFlag = (_a2 = o.long) == null ? undefined : _a2.replace(/^--/, "");
58070
- const shortFlag = (_b = o.short) == null ? undefined : _b.replace(/^-/, "");
58071
- if (longFlag === key || shortFlag === key) {
58072
- return true;
58073
- }
58074
- if (longFlag === camelToKebab(key)) {
58075
- return true;
58076
- }
58077
- return false;
58078
- });
58079
- };
58080
- var getOptionFlagName = (command, key) => {
58081
- var _a, _b;
58082
- const option = findOptionByKey(command, key);
58083
- if (option) {
58084
- return ((_a = option.long) == null ? undefined : _a.replace(/^--/, "")) || ((_b = option.short) == null ? undefined : _b.replace(/^-/, "")) || "";
58085
- }
58086
- return camelToKebab(key);
58087
- };
58088
- var stringifyOptions = (options, command) => Object.entries(options).filter((opt) => opt[0] !== "_").map(([key, value]) => {
58089
- var _a;
58090
- const option = findOptionByKey(command, key);
58091
- const flagName = getOptionFlagName(command, key);
58092
- if ((_a = option == null ? undefined : option.isBoolean) == null ? undefined : _a.call(option)) {
58093
- return value ? `--${flagName}` : "";
58094
- }
58095
- return `--${flagName} ${value}`;
58096
- }).filter(Boolean).join(" ");
58097
- var getOptionKey = (o) => {
58098
- var _a;
58099
- return ((_a = o.long) != null ? _a : o.short).replace(/^--/, "");
58100
- };
58101
- var figureOutCommandArgs = (program3, commandPath, options, perfectCliOptions) => __async(undefined, null, function* () {
58102
- var _a, _b;
58103
- const command = getCommandFromPath(program3, commandPath);
58104
- const positionalArgs = (_a = options._) != null ? _a : getPositionalArgsOnly(program3, commandPath);
58105
- const hasAllPositionalArgs = command.registeredArguments.every((ra, i) => !ra.required || positionalArgs[i]);
58106
- if (!hasAllPositionalArgs) {
58107
- const nextPositionalArg = command.registeredArguments.find((ra, i) => ra.required && !positionalArgs[i]);
58108
- const { positionalArgInteractResult } = yield (0, import_prompts22.default)({
58109
- name: "positionalArgInteractResult",
58110
- type: "text",
58111
- message: `Enter ${nextPositionalArg == null ? undefined : nextPositionalArg.name()}`
58112
- });
58113
- if (positionalArgInteractResult === undefined) {
58114
- throw new Error(`${nextPositionalArg == null ? undefined : nextPositionalArg.name()} is required`);
58115
- }
58116
- return figureOutCommandArgs(program3, commandPath, __spreadProps(__spreadValues({}, options), { _: positionalArgs.concat([positionalArgInteractResult]) }), perfectCliOptions);
58117
- }
58118
- if (command.options.length === 0) {
58119
- return options;
58120
- }
58121
- console.log(`> ${[program3.name(), ...commandPath].filter(Boolean).join(" ")} ${stringifyOptions(options, command)}`);
58122
- const hasRequiredOptions = command.options.filter((o) => o.mandatory).every((o) => (getOptionKey(o) in options));
58123
- const { optionToEdit } = yield (0, import_prompts22.default)({
58124
- type: "autocomplete",
58125
- name: "optionToEdit",
58126
- message: "Choose option to edit",
58127
- suggest: (input, choices) => __async(undefined, null, function* () {
58128
- return choices.filter((c) => c.title.startsWith(input) || c.title.replace(/^--/, "").startsWith(input));
58129
- }),
58130
- choices: [
58131
- hasRequiredOptions ? {
58132
- title: "[Done]",
58133
- value: "done",
58134
- description: "Done editing options"
58135
- } : null,
58136
- ...command.options.map((o) => {
58137
- const optionName = getOptionKey(o);
58138
- return {
58139
- title: `${o.long}${o.mandatory ? "*" : ""}`,
58140
- value: optionName,
58141
- description: optionName in options ? `[${options[optionName]}]` : o.description
58142
- };
58143
- })
58144
- ].filter((elm) => Boolean(elm))
58145
- });
58146
- if (optionToEdit === "done") {
58147
- return options;
58148
- }
58149
- const option = command.options.find((o) => getOptionKey(o) === optionToEdit);
58150
- const customValue = yield (_b = perfectCliOptions == null ? undefined : perfectCliOptions.customParamHandler) == null ? undefined : _b.call(perfectCliOptions, {
58151
- commandPath,
58152
- optionName: option.name()
58153
- }, { prompts: import_prompts22.default });
58154
- if (customValue) {
58155
- options[optionToEdit] = customValue;
58156
- } else if (option.isBoolean()) {
58157
- const { newValue } = yield (0, import_prompts22.default)({
58158
- type: "toggle",
58159
- name: "newValue",
58160
- message: `Toggle ${option.name()}`,
58161
- initial: options[optionToEdit],
58162
- active: "true",
58163
- inactive: "false"
58164
- });
58165
- options[optionToEdit] = newValue;
58166
- } else {
58167
- const { newValue } = yield (0, import_prompts22.default)({
58168
- type: "text",
58169
- name: "newValue",
58170
- message: `Enter new value for ${option.long}`,
58171
- initial: options[optionToEdit]
58172
- });
58173
- options[optionToEdit] = newValue;
58174
- }
58175
- return figureOutCommandArgs(program3, commandPath, options, perfectCliOptions);
58176
- });
58177
- var stringifyCommandWithOptions = (program3, commandPath, options) => {
58178
- var _a, _b;
58179
- const command = getCommandFromPath(program3, commandPath);
58180
- return `${[program3.name(), ...commandPath].filter(Boolean).join(" ")}${((_a = options == null ? undefined : options._) == null ? undefined : _a.length) > 0 ? ` ${(_b = options == null ? undefined : options._) == null ? undefined : _b.join(" ")}` : ""} ${stringifyOptions(options, command)}`;
58181
- };
58182
- var doesProgramHaveAllRequiredArgs = (program3, _, passedArgs) => {
58183
- const command = getCommandFromPath(program3, _);
58184
- if (!command) {
58185
- throw new Error(`Could not determine command from given positional args: ${JSON.stringify(_)}`);
58186
- }
58187
- const hasRequiredOptions = command.options.filter((o) => o.mandatory).every((o) => passedArgs[getOptionKey(o)]);
58188
- const positionalArgs = getPositionalArgsOnly(program3, _);
58189
- const hasRequiredPositionalArgs = command.registeredArguments.every((ra, i) => !ra.required || positionalArgs[i]);
58190
- const hasSubcommands = command.commands.length > 0;
58191
- return !hasSubcommands && hasRequiredOptions && hasRequiredPositionalArgs;
58192
- };
58193
- var perfectCli = (program3, argv, perfectCliOptions) => __async(undefined, null, function* () {
58194
- var _b;
58195
- const booleanArgs = [];
58196
- const aliases = {};
58197
- const subcommand = getCommandFromPath(program3, argv.slice(2));
58198
- if (subcommand) {
58199
- for (const option of subcommand.options) {
58200
- if (option.long && option.short) {
58201
- aliases[option.long.replace(/^--/, "").replace(/^-/, "")] = [
58202
- option.short.replace(/^--/, "").replace(/^-/, "")
58203
- ];
58204
- }
58205
- if (option.isBoolean()) {
58206
- booleanArgs.push(...[option.long, option.short].filter(Boolean).map((r) => r.replace(/^--/, "").replace(/^-/, "")));
58207
- }
58208
- }
58209
- }
58210
- const passedArgs = (0, import_minimist.default)(argv.slice(2), {
58211
- boolean: booleanArgs,
58212
- alias: aliases,
58213
- stopEarly: false
58214
- });
58215
- const _a = passedArgs, { y, yes, i, interactive, h, help, _ } = _a, unhandledPassedArgs = __objRest(_a, ["y", "yes", "i", "interactive", "h", "help", "_"]);
58216
- const isYesMode = yes || y;
58217
- const isInteractiveMode = i || interactive;
58218
- const isHelpMode = help || h;
58219
- if (isHelpMode) {
58220
- (subcommand != null ? subcommand : program3).help();
58221
- return;
58222
- }
58223
- const hasRequiredArgsToRun = doesProgramHaveAllRequiredArgs(program3, _, passedArgs);
58224
- const argvWithoutPerfect = argv.filter((a) => !["--yes", "-y", "-i", "--interactive"].includes(a));
58225
- if (isYesMode || !isInteractiveMode && hasRequiredArgsToRun) {
58226
- const commandPath2 = getStrictCommandPath(program3, getCommandPathOnly(program3, argvWithoutPerfect.slice(2)));
58227
- const fixedArgv = [
58228
- ...argvWithoutPerfect.slice(0, 2),
58229
- ...commandPath2,
58230
- ...argvWithoutPerfect.slice(2 + commandPath2.length)
58231
- ];
58232
- yield program3.parseAsync(fixedArgv);
58233
- process.exit(0);
58234
- }
58235
- const commandPath = yield figureOutCommandPath(program3, _);
58236
- const command = getCommandFromPath(program3, commandPath);
58237
- if (!command) {
58238
- console.log(`Command not found: "${commandPath.join(" ")}"`);
58239
- process.exit(1);
58240
- }
58241
- const options = yield figureOutCommandArgs(program3, commandPath, unhandledPassedArgs, perfectCliOptions);
58242
- const fullCommandString = stringifyCommandWithOptions(program3, commandPath, options);
58243
- console.log(`> ${fullCommandString}`);
58244
- const strictCommandPath = getStrictCommandPath(program3, commandPath);
58245
- const optionArgs = Object.entries(options).filter((opt) => opt[0] !== "_").flatMap(([optKey, optVal]) => {
58246
- var _a2;
58247
- const option = findOptionByKey(command, optKey);
58248
- const flagName = getOptionFlagName(command, optKey);
58249
- if ((_a2 = option == null ? undefined : option.isBoolean) == null ? undefined : _a2.call(option)) {
58250
- return optVal ? [`--${flagName}`] : [];
58251
- }
58252
- return [`--${flagName}`, optVal];
58253
- });
58254
- yield program3.parseAsync([
58255
- ...process.argv.slice(0, 2),
58256
- ...strictCommandPath.concat((_b = options._) != null ? _b : []),
58257
- ...optionArgs
58258
- ]);
58259
- });
58260
- });
58261
-
58262
57686
  // node_modules/process-nextick-args/index.js
58263
57687
  var require_process_nextick_args = __commonJS((exports2, module2) => {
58264
57688
  if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
@@ -58393,10 +57817,10 @@ var require_util4 = __commonJS((exports2) => {
58393
57817
  return typeof arg === "string";
58394
57818
  }
58395
57819
  exports2.isString = isString2;
58396
- function isSymbol3(arg) {
57820
+ function isSymbol(arg) {
58397
57821
  return typeof arg === "symbol";
58398
57822
  }
58399
- exports2.isSymbol = isSymbol3;
57823
+ exports2.isSymbol = isSymbol;
58400
57824
  function isUndefined2(arg) {
58401
57825
  return arg === undefined;
58402
57826
  }
@@ -58533,10 +57957,10 @@ var require_BufferList = __commonJS((exports2, module2) => {
58533
57957
  }
58534
57958
  return ret;
58535
57959
  };
58536
- BufferList.prototype.concat = function concat(n2) {
57960
+ BufferList.prototype.concat = function concat(n) {
58537
57961
  if (this.length === 0)
58538
57962
  return Buffer3.alloc(0);
58539
- var ret = Buffer3.allocUnsafe(n2 >>> 0);
57963
+ var ret = Buffer3.allocUnsafe(n >>> 0);
58540
57964
  var p = this.head;
58541
57965
  var i = 0;
58542
57966
  while (p) {
@@ -59448,18 +58872,18 @@ var require_string_decoder = __commonJS((exports2) => {
59448
58872
  return r;
59449
58873
  }
59450
58874
  function base64Text(buf, i) {
59451
- var n2 = (buf.length - i) % 3;
59452
- if (n2 === 0)
58875
+ var n = (buf.length - i) % 3;
58876
+ if (n === 0)
59453
58877
  return buf.toString("base64", i);
59454
- this.lastNeed = 3 - n2;
58878
+ this.lastNeed = 3 - n;
59455
58879
  this.lastTotal = 3;
59456
- if (n2 === 1) {
58880
+ if (n === 1) {
59457
58881
  this.lastChar[0] = buf[buf.length - 1];
59458
58882
  } else {
59459
58883
  this.lastChar[0] = buf[buf.length - 2];
59460
58884
  this.lastChar[1] = buf[buf.length - 1];
59461
58885
  }
59462
- return buf.toString("base64", i, buf.length - n2);
58886
+ return buf.toString("base64", i, buf.length - n);
59463
58887
  }
59464
58888
  function base64End(buf) {
59465
58889
  var r = buf && buf.length ? this.write(buf) : "";
@@ -59498,11 +58922,11 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59498
58922
  var util = Object.create(require_util4());
59499
58923
  util.inherits = require_inherits();
59500
58924
  var debugUtil = __require("util");
59501
- var debug11 = undefined;
58925
+ var debug3 = undefined;
59502
58926
  if (debugUtil && debugUtil.debuglog) {
59503
- debug11 = debugUtil.debuglog("stream");
58927
+ debug3 = debugUtil.debuglog("stream");
59504
58928
  } else {
59505
- debug11 = function() {};
58929
+ debug3 = function() {};
59506
58930
  }
59507
58931
  var BufferList = require_BufferList();
59508
58932
  var destroyImpl = require_destroy();
@@ -59692,73 +59116,73 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59692
59116
  return this;
59693
59117
  };
59694
59118
  var MAX_HWM = 8388608;
59695
- function computeNewHighWaterMark(n2) {
59696
- if (n2 >= MAX_HWM) {
59697
- n2 = MAX_HWM;
59119
+ function computeNewHighWaterMark(n) {
59120
+ if (n >= MAX_HWM) {
59121
+ n = MAX_HWM;
59698
59122
  } else {
59699
- n2--;
59700
- n2 |= n2 >>> 1;
59701
- n2 |= n2 >>> 2;
59702
- n2 |= n2 >>> 4;
59703
- n2 |= n2 >>> 8;
59704
- n2 |= n2 >>> 16;
59705
- n2++;
59706
- }
59707
- return n2;
59708
- }
59709
- function howMuchToRead(n2, state) {
59710
- if (n2 <= 0 || state.length === 0 && state.ended)
59123
+ n--;
59124
+ n |= n >>> 1;
59125
+ n |= n >>> 2;
59126
+ n |= n >>> 4;
59127
+ n |= n >>> 8;
59128
+ n |= n >>> 16;
59129
+ n++;
59130
+ }
59131
+ return n;
59132
+ }
59133
+ function howMuchToRead(n, state) {
59134
+ if (n <= 0 || state.length === 0 && state.ended)
59711
59135
  return 0;
59712
59136
  if (state.objectMode)
59713
59137
  return 1;
59714
- if (n2 !== n2) {
59138
+ if (n !== n) {
59715
59139
  if (state.flowing && state.length)
59716
59140
  return state.buffer.head.data.length;
59717
59141
  else
59718
59142
  return state.length;
59719
59143
  }
59720
- if (n2 > state.highWaterMark)
59721
- state.highWaterMark = computeNewHighWaterMark(n2);
59722
- if (n2 <= state.length)
59723
- return n2;
59144
+ if (n > state.highWaterMark)
59145
+ state.highWaterMark = computeNewHighWaterMark(n);
59146
+ if (n <= state.length)
59147
+ return n;
59724
59148
  if (!state.ended) {
59725
59149
  state.needReadable = true;
59726
59150
  return 0;
59727
59151
  }
59728
59152
  return state.length;
59729
59153
  }
59730
- Readable2.prototype.read = function(n2) {
59731
- debug11("read", n2);
59732
- n2 = parseInt(n2, 10);
59154
+ Readable2.prototype.read = function(n) {
59155
+ debug3("read", n);
59156
+ n = parseInt(n, 10);
59733
59157
  var state = this._readableState;
59734
- var nOrig = n2;
59735
- if (n2 !== 0)
59158
+ var nOrig = n;
59159
+ if (n !== 0)
59736
59160
  state.emittedReadable = false;
59737
- if (n2 === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
59738
- debug11("read: emitReadable", state.length, state.ended);
59161
+ if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
59162
+ debug3("read: emitReadable", state.length, state.ended);
59739
59163
  if (state.length === 0 && state.ended)
59740
59164
  endReadable(this);
59741
59165
  else
59742
59166
  emitReadable(this);
59743
59167
  return null;
59744
59168
  }
59745
- n2 = howMuchToRead(n2, state);
59746
- if (n2 === 0 && state.ended) {
59169
+ n = howMuchToRead(n, state);
59170
+ if (n === 0 && state.ended) {
59747
59171
  if (state.length === 0)
59748
59172
  endReadable(this);
59749
59173
  return null;
59750
59174
  }
59751
59175
  var doRead = state.needReadable;
59752
- debug11("need readable", doRead);
59753
- if (state.length === 0 || state.length - n2 < state.highWaterMark) {
59176
+ debug3("need readable", doRead);
59177
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
59754
59178
  doRead = true;
59755
- debug11("length less than watermark", doRead);
59179
+ debug3("length less than watermark", doRead);
59756
59180
  }
59757
59181
  if (state.ended || state.reading) {
59758
59182
  doRead = false;
59759
- debug11("reading or ended", doRead);
59183
+ debug3("reading or ended", doRead);
59760
59184
  } else if (doRead) {
59761
- debug11("do read");
59185
+ debug3("do read");
59762
59186
  state.reading = true;
59763
59187
  state.sync = true;
59764
59188
  if (state.length === 0)
@@ -59766,23 +59190,23 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59766
59190
  this._read(state.highWaterMark);
59767
59191
  state.sync = false;
59768
59192
  if (!state.reading)
59769
- n2 = howMuchToRead(nOrig, state);
59193
+ n = howMuchToRead(nOrig, state);
59770
59194
  }
59771
59195
  var ret;
59772
- if (n2 > 0)
59773
- ret = fromList(n2, state);
59196
+ if (n > 0)
59197
+ ret = fromList(n, state);
59774
59198
  else
59775
59199
  ret = null;
59776
59200
  if (ret === null) {
59777
59201
  state.needReadable = true;
59778
- n2 = 0;
59202
+ n = 0;
59779
59203
  } else {
59780
- state.length -= n2;
59204
+ state.length -= n;
59781
59205
  }
59782
59206
  if (state.length === 0) {
59783
59207
  if (!state.ended)
59784
59208
  state.needReadable = true;
59785
- if (nOrig !== n2 && state.ended)
59209
+ if (nOrig !== n && state.ended)
59786
59210
  endReadable(this);
59787
59211
  }
59788
59212
  if (ret !== null)
@@ -59806,7 +59230,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59806
59230
  var state = stream._readableState;
59807
59231
  state.needReadable = false;
59808
59232
  if (!state.emittedReadable) {
59809
- debug11("emitReadable", state.flowing);
59233
+ debug3("emitReadable", state.flowing);
59810
59234
  state.emittedReadable = true;
59811
59235
  if (state.sync)
59812
59236
  pna.nextTick(emitReadable_, stream);
@@ -59815,7 +59239,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59815
59239
  }
59816
59240
  }
59817
59241
  function emitReadable_(stream) {
59818
- debug11("emit readable");
59242
+ debug3("emit readable");
59819
59243
  stream.emit("readable");
59820
59244
  flow(stream);
59821
59245
  }
@@ -59828,7 +59252,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59828
59252
  function maybeReadMore_(stream, state) {
59829
59253
  var len = state.length;
59830
59254
  while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
59831
- debug11("maybeReadMore read 0");
59255
+ debug3("maybeReadMore read 0");
59832
59256
  stream.read(0);
59833
59257
  if (len === state.length)
59834
59258
  break;
@@ -59837,7 +59261,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59837
59261
  }
59838
59262
  state.readingMore = false;
59839
59263
  }
59840
- Readable2.prototype._read = function(n2) {
59264
+ Readable2.prototype._read = function(n) {
59841
59265
  this.emit("error", new Error("_read() is not implemented"));
59842
59266
  };
59843
59267
  Readable2.prototype.pipe = function(dest, pipeOpts) {
@@ -59855,7 +59279,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59855
59279
  break;
59856
59280
  }
59857
59281
  state.pipesCount += 1;
59858
- debug11("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
59282
+ debug3("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
59859
59283
  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
59860
59284
  var endFn = doEnd ? onend : unpipe;
59861
59285
  if (state.endEmitted)
@@ -59864,7 +59288,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59864
59288
  src.once("end", endFn);
59865
59289
  dest.on("unpipe", onunpipe);
59866
59290
  function onunpipe(readable, unpipeInfo) {
59867
- debug11("onunpipe");
59291
+ debug3("onunpipe");
59868
59292
  if (readable === src) {
59869
59293
  if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
59870
59294
  unpipeInfo.hasUnpiped = true;
@@ -59873,14 +59297,14 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59873
59297
  }
59874
59298
  }
59875
59299
  function onend() {
59876
- debug11("onend");
59300
+ debug3("onend");
59877
59301
  dest.end();
59878
59302
  }
59879
59303
  var ondrain = pipeOnDrain(src);
59880
59304
  dest.on("drain", ondrain);
59881
59305
  var cleanedUp = false;
59882
59306
  function cleanup() {
59883
- debug11("cleanup");
59307
+ debug3("cleanup");
59884
59308
  dest.removeListener("close", onclose);
59885
59309
  dest.removeListener("finish", onfinish);
59886
59310
  dest.removeListener("drain", ondrain);
@@ -59896,12 +59320,12 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59896
59320
  var increasedAwaitDrain = false;
59897
59321
  src.on("data", ondata);
59898
59322
  function ondata(chunk) {
59899
- debug11("ondata");
59323
+ debug3("ondata");
59900
59324
  increasedAwaitDrain = false;
59901
59325
  var ret = dest.write(chunk);
59902
59326
  if (ret === false && !increasedAwaitDrain) {
59903
59327
  if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
59904
- debug11("false write response, pause", state.awaitDrain);
59328
+ debug3("false write response, pause", state.awaitDrain);
59905
59329
  state.awaitDrain++;
59906
59330
  increasedAwaitDrain = true;
59907
59331
  }
@@ -59909,7 +59333,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59909
59333
  }
59910
59334
  }
59911
59335
  function onerror(er) {
59912
- debug11("onerror", er);
59336
+ debug3("onerror", er);
59913
59337
  unpipe();
59914
59338
  dest.removeListener("error", onerror);
59915
59339
  if (EElistenerCount(dest, "error") === 0)
@@ -59922,18 +59346,18 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59922
59346
  }
59923
59347
  dest.once("close", onclose);
59924
59348
  function onfinish() {
59925
- debug11("onfinish");
59349
+ debug3("onfinish");
59926
59350
  dest.removeListener("close", onclose);
59927
59351
  unpipe();
59928
59352
  }
59929
59353
  dest.once("finish", onfinish);
59930
59354
  function unpipe() {
59931
- debug11("unpipe");
59355
+ debug3("unpipe");
59932
59356
  src.unpipe(dest);
59933
59357
  }
59934
59358
  dest.emit("pipe", src);
59935
59359
  if (!state.flowing) {
59936
- debug11("pipe resume");
59360
+ debug3("pipe resume");
59937
59361
  src.resume();
59938
59362
  }
59939
59363
  return dest;
@@ -59941,7 +59365,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
59941
59365
  function pipeOnDrain(src) {
59942
59366
  return function() {
59943
59367
  var state = src._readableState;
59944
- debug11("pipeOnDrain", state.awaitDrain);
59368
+ debug3("pipeOnDrain", state.awaitDrain);
59945
59369
  if (state.awaitDrain)
59946
59370
  state.awaitDrain--;
59947
59371
  if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
@@ -60009,13 +59433,13 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60009
59433
  };
60010
59434
  Readable2.prototype.addListener = Readable2.prototype.on;
60011
59435
  function nReadingNextTick(self2) {
60012
- debug11("readable nexttick read 0");
59436
+ debug3("readable nexttick read 0");
60013
59437
  self2.read(0);
60014
59438
  }
60015
59439
  Readable2.prototype.resume = function() {
60016
59440
  var state = this._readableState;
60017
59441
  if (!state.flowing) {
60018
- debug11("resume");
59442
+ debug3("resume");
60019
59443
  state.flowing = true;
60020
59444
  resume(this, state);
60021
59445
  }
@@ -60029,7 +59453,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60029
59453
  }
60030
59454
  function resume_(stream, state) {
60031
59455
  if (!state.reading) {
60032
- debug11("resume read 0");
59456
+ debug3("resume read 0");
60033
59457
  stream.read(0);
60034
59458
  }
60035
59459
  state.resumeScheduled = false;
@@ -60040,9 +59464,9 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60040
59464
  stream.read(0);
60041
59465
  }
60042
59466
  Readable2.prototype.pause = function() {
60043
- debug11("call pause flowing=%j", this._readableState.flowing);
59467
+ debug3("call pause flowing=%j", this._readableState.flowing);
60044
59468
  if (this._readableState.flowing !== false) {
60045
- debug11("pause");
59469
+ debug3("pause");
60046
59470
  this._readableState.flowing = false;
60047
59471
  this.emit("pause");
60048
59472
  }
@@ -60050,7 +59474,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60050
59474
  };
60051
59475
  function flow(stream) {
60052
59476
  var state = stream._readableState;
60053
- debug11("flow", state.flowing);
59477
+ debug3("flow", state.flowing);
60054
59478
  while (state.flowing && stream.read() !== null) {}
60055
59479
  }
60056
59480
  Readable2.prototype.wrap = function(stream) {
@@ -60058,7 +59482,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60058
59482
  var state = this._readableState;
60059
59483
  var paused = false;
60060
59484
  stream.on("end", function() {
60061
- debug11("wrapped end");
59485
+ debug3("wrapped end");
60062
59486
  if (state.decoder && !state.ended) {
60063
59487
  var chunk = state.decoder.end();
60064
59488
  if (chunk && chunk.length)
@@ -60067,7 +59491,7 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60067
59491
  _this.push(null);
60068
59492
  });
60069
59493
  stream.on("data", function(chunk) {
60070
- debug11("wrapped data");
59494
+ debug3("wrapped data");
60071
59495
  if (state.decoder)
60072
59496
  chunk = state.decoder.write(chunk);
60073
59497
  if (state.objectMode && (chunk === null || chunk === undefined))
@@ -60089,11 +59513,11 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60089
59513
  }(i);
60090
59514
  }
60091
59515
  }
60092
- for (var n2 = 0;n2 < kProxyEvents.length; n2++) {
60093
- stream.on(kProxyEvents[n2], this.emit.bind(this, kProxyEvents[n2]));
59516
+ for (var n = 0;n < kProxyEvents.length; n++) {
59517
+ stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
60094
59518
  }
60095
- this._read = function(n3) {
60096
- debug11("wrapped _read", n3);
59519
+ this._read = function(n2) {
59520
+ debug3("wrapped _read", n2);
60097
59521
  if (paused) {
60098
59522
  paused = false;
60099
59523
  stream.resume();
@@ -60108,13 +59532,13 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60108
59532
  }
60109
59533
  });
60110
59534
  Readable2._fromList = fromList;
60111
- function fromList(n2, state) {
59535
+ function fromList(n, state) {
60112
59536
  if (state.length === 0)
60113
59537
  return null;
60114
59538
  var ret;
60115
59539
  if (state.objectMode)
60116
59540
  ret = state.buffer.shift();
60117
- else if (!n2 || n2 >= state.length) {
59541
+ else if (!n || n >= state.length) {
60118
59542
  if (state.decoder)
60119
59543
  ret = state.buffer.join("");
60120
59544
  else if (state.buffer.length === 1)
@@ -60123,36 +59547,36 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60123
59547
  ret = state.buffer.concat(state.length);
60124
59548
  state.buffer.clear();
60125
59549
  } else {
60126
- ret = fromListPartial(n2, state.buffer, state.decoder);
59550
+ ret = fromListPartial(n, state.buffer, state.decoder);
60127
59551
  }
60128
59552
  return ret;
60129
59553
  }
60130
- function fromListPartial(n2, list, hasStrings) {
59554
+ function fromListPartial(n, list, hasStrings) {
60131
59555
  var ret;
60132
- if (n2 < list.head.data.length) {
60133
- ret = list.head.data.slice(0, n2);
60134
- list.head.data = list.head.data.slice(n2);
60135
- } else if (n2 === list.head.data.length) {
59556
+ if (n < list.head.data.length) {
59557
+ ret = list.head.data.slice(0, n);
59558
+ list.head.data = list.head.data.slice(n);
59559
+ } else if (n === list.head.data.length) {
60136
59560
  ret = list.shift();
60137
59561
  } else {
60138
- ret = hasStrings ? copyFromBufferString(n2, list) : copyFromBuffer(n2, list);
59562
+ ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
60139
59563
  }
60140
59564
  return ret;
60141
59565
  }
60142
- function copyFromBufferString(n2, list) {
59566
+ function copyFromBufferString(n, list) {
60143
59567
  var p = list.head;
60144
59568
  var c = 1;
60145
59569
  var ret = p.data;
60146
- n2 -= ret.length;
59570
+ n -= ret.length;
60147
59571
  while (p = p.next) {
60148
59572
  var str = p.data;
60149
- var nb = n2 > str.length ? str.length : n2;
59573
+ var nb = n > str.length ? str.length : n;
60150
59574
  if (nb === str.length)
60151
59575
  ret += str;
60152
59576
  else
60153
- ret += str.slice(0, n2);
60154
- n2 -= nb;
60155
- if (n2 === 0) {
59577
+ ret += str.slice(0, n);
59578
+ n -= nb;
59579
+ if (n === 0) {
60156
59580
  if (nb === str.length) {
60157
59581
  ++c;
60158
59582
  if (p.next)
@@ -60170,18 +59594,18 @@ var require__stream_readable = __commonJS((exports2, module2) => {
60170
59594
  list.length -= c;
60171
59595
  return ret;
60172
59596
  }
60173
- function copyFromBuffer(n2, list) {
60174
- var ret = Buffer3.allocUnsafe(n2);
59597
+ function copyFromBuffer(n, list) {
59598
+ var ret = Buffer3.allocUnsafe(n);
60175
59599
  var p = list.head;
60176
59600
  var c = 1;
60177
59601
  p.data.copy(ret);
60178
- n2 -= p.data.length;
59602
+ n -= p.data.length;
60179
59603
  while (p = p.next) {
60180
59604
  var buf = p.data;
60181
- var nb = n2 > buf.length ? buf.length : n2;
60182
- buf.copy(ret, ret.length - n2, 0, nb);
60183
- n2 -= nb;
60184
- if (n2 === 0) {
59605
+ var nb = n > buf.length ? buf.length : n;
59606
+ buf.copy(ret, ret.length - n, 0, nb);
59607
+ n -= nb;
59608
+ if (n === 0) {
60185
59609
  if (nb === buf.length) {
60186
59610
  ++c;
60187
59611
  if (p.next)
@@ -60299,7 +59723,7 @@ var require__stream_transform = __commonJS((exports2, module2) => {
60299
59723
  this._read(rs.highWaterMark);
60300
59724
  }
60301
59725
  };
60302
- Transform.prototype._read = function(n2) {
59726
+ Transform.prototype._read = function(n) {
60303
59727
  var ts3 = this._transformState;
60304
59728
  if (ts3.writechunk !== null && ts3.writecb && !ts3.transforming) {
60305
59729
  ts3.transforming = true;
@@ -60581,8 +60005,8 @@ var require_lib3 = __commonJS((exports2, module2) => {
60581
60005
  return this;
60582
60006
  }
60583
60007
  var p = this.constructor;
60584
- return this.then(resolve10, reject2);
60585
- function resolve10(value) {
60008
+ return this.then(resolve9, reject2);
60009
+ function resolve9(value) {
60586
60010
  function yes() {
60587
60011
  return value;
60588
60012
  }
@@ -60735,8 +60159,8 @@ var require_lib3 = __commonJS((exports2, module2) => {
60735
60159
  }
60736
60160
  return out;
60737
60161
  }
60738
- Promise2.resolve = resolve9;
60739
- function resolve9(value) {
60162
+ Promise2.resolve = resolve8;
60163
+ function resolve8(value) {
60740
60164
  if (value instanceof this) {
60741
60165
  return value;
60742
60166
  }
@@ -61162,8 +60586,8 @@ var require_utils6 = __commonJS((exports2) => {
61162
60586
  var result = transform[inputType][outputType](input);
61163
60587
  return result;
61164
60588
  };
61165
- exports2.resolve = function(path22) {
61166
- var parts = path22.split("/");
60589
+ exports2.resolve = function(path21) {
60590
+ var parts = path21.split("/");
61167
60591
  var result = [];
61168
60592
  for (var index = 0;index < parts.length; index++) {
61169
60593
  var part = parts[index];
@@ -61235,10 +60659,10 @@ var require_utils6 = __commonJS((exports2) => {
61235
60659
  var promise = external.Promise.resolve(inputData).then(function(data) {
61236
60660
  var isBlob = support.blob && (data instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data)) !== -1);
61237
60661
  if (isBlob && typeof FileReader !== "undefined") {
61238
- return new external.Promise(function(resolve9, reject) {
60662
+ return new external.Promise(function(resolve8, reject) {
61239
60663
  var reader = new FileReader;
61240
60664
  reader.onload = function(e) {
61241
- resolve9(e.target.result);
60665
+ resolve8(e.target.result);
61242
60666
  };
61243
60667
  reader.onerror = function(e) {
61244
60668
  reject(e.target.error);
@@ -61702,7 +61126,7 @@ var require_StreamHelper = __commonJS((exports2, module2) => {
61702
61126
  }
61703
61127
  }
61704
61128
  function accumulate(helper, updateCallback) {
61705
- return new external.Promise(function(resolve9, reject) {
61129
+ return new external.Promise(function(resolve8, reject) {
61706
61130
  var dataArray = [];
61707
61131
  var { _internalType: chunkType, _outputType: resultType, _mimeType: mimeType } = helper;
61708
61132
  helper.on("data", function(data, meta) {
@@ -61716,7 +61140,7 @@ var require_StreamHelper = __commonJS((exports2, module2) => {
61716
61140
  }).on("end", function() {
61717
61141
  try {
61718
61142
  var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);
61719
- resolve9(result);
61143
+ resolve8(result);
61720
61144
  } catch (e) {
61721
61145
  reject(e);
61722
61146
  }
@@ -61889,29 +61313,29 @@ var require_crc32 = __commonJS((exports2, module2) => {
61889
61313
  var utils = require_utils6();
61890
61314
  function makeTable() {
61891
61315
  var c, table = [];
61892
- for (var n2 = 0;n2 < 256; n2++) {
61893
- c = n2;
61316
+ for (var n = 0;n < 256; n++) {
61317
+ c = n;
61894
61318
  for (var k = 0;k < 8; k++) {
61895
61319
  c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
61896
61320
  }
61897
- table[n2] = c;
61321
+ table[n] = c;
61898
61322
  }
61899
61323
  return table;
61900
61324
  }
61901
61325
  var crcTable = makeTable();
61902
61326
  function crc32(crc, buf, len, pos) {
61903
- var t2 = crcTable, end = pos + len;
61327
+ var t = crcTable, end = pos + len;
61904
61328
  crc = crc ^ -1;
61905
61329
  for (var i = pos;i < end; i++) {
61906
- crc = crc >>> 8 ^ t2[(crc ^ buf[i]) & 255];
61330
+ crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];
61907
61331
  }
61908
61332
  return crc ^ -1;
61909
61333
  }
61910
61334
  function crc32str(crc, str, len, pos) {
61911
- var t2 = crcTable, end = pos + len;
61335
+ var t = crcTable, end = pos + len;
61912
61336
  crc = crc ^ -1;
61913
61337
  for (var i = pos;i < end; i++) {
61914
- crc = crc >>> 8 ^ t2[(crc ^ str.charCodeAt(i)) & 255];
61338
+ crc = crc >>> 8 ^ t[(crc ^ str.charCodeAt(i)) & 255];
61915
61339
  }
61916
61340
  return crc ^ -1;
61917
61341
  }
@@ -62284,7 +61708,7 @@ var require_trees = __commonJS((exports2) => {
62284
61708
  var base = desc.stat_desc.extra_base;
62285
61709
  var max_length = desc.stat_desc.max_length;
62286
61710
  var h;
62287
- var n2, m2;
61711
+ var n, m;
62288
61712
  var bits;
62289
61713
  var xbits;
62290
61714
  var f;
@@ -62294,25 +61718,25 @@ var require_trees = __commonJS((exports2) => {
62294
61718
  }
62295
61719
  tree[s.heap[s.heap_max] * 2 + 1] = 0;
62296
61720
  for (h = s.heap_max + 1;h < HEAP_SIZE; h++) {
62297
- n2 = s.heap[h];
62298
- bits = tree[tree[n2 * 2 + 1] * 2 + 1] + 1;
61721
+ n = s.heap[h];
61722
+ bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
62299
61723
  if (bits > max_length) {
62300
61724
  bits = max_length;
62301
61725
  overflow++;
62302
61726
  }
62303
- tree[n2 * 2 + 1] = bits;
62304
- if (n2 > max_code) {
61727
+ tree[n * 2 + 1] = bits;
61728
+ if (n > max_code) {
62305
61729
  continue;
62306
61730
  }
62307
61731
  s.bl_count[bits]++;
62308
61732
  xbits = 0;
62309
- if (n2 >= base) {
62310
- xbits = extra[n2 - base];
61733
+ if (n >= base) {
61734
+ xbits = extra[n - base];
62311
61735
  }
62312
- f = tree[n2 * 2];
61736
+ f = tree[n * 2];
62313
61737
  s.opt_len += f * (bits + xbits);
62314
61738
  if (has_stree) {
62315
- s.static_len += f * (stree[n2 * 2 + 1] + xbits);
61739
+ s.static_len += f * (stree[n * 2 + 1] + xbits);
62316
61740
  }
62317
61741
  }
62318
61742
  if (overflow === 0) {
@@ -62329,17 +61753,17 @@ var require_trees = __commonJS((exports2) => {
62329
61753
  overflow -= 2;
62330
61754
  } while (overflow > 0);
62331
61755
  for (bits = max_length;bits !== 0; bits--) {
62332
- n2 = s.bl_count[bits];
62333
- while (n2 !== 0) {
62334
- m2 = s.heap[--h];
62335
- if (m2 > max_code) {
61756
+ n = s.bl_count[bits];
61757
+ while (n !== 0) {
61758
+ m = s.heap[--h];
61759
+ if (m > max_code) {
62336
61760
  continue;
62337
61761
  }
62338
- if (tree[m2 * 2 + 1] !== bits) {
62339
- s.opt_len += (bits - tree[m2 * 2 + 1]) * tree[m2 * 2];
62340
- tree[m2 * 2 + 1] = bits;
61762
+ if (tree[m * 2 + 1] !== bits) {
61763
+ s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];
61764
+ tree[m * 2 + 1] = bits;
62341
61765
  }
62342
- n2--;
61766
+ n--;
62343
61767
  }
62344
61768
  }
62345
61769
  }
@@ -62347,20 +61771,20 @@ var require_trees = __commonJS((exports2) => {
62347
61771
  var next_code = new Array(MAX_BITS + 1);
62348
61772
  var code = 0;
62349
61773
  var bits;
62350
- var n2;
61774
+ var n;
62351
61775
  for (bits = 1;bits <= MAX_BITS; bits++) {
62352
61776
  next_code[bits] = code = code + bl_count[bits - 1] << 1;
62353
61777
  }
62354
- for (n2 = 0;n2 <= max_code; n2++) {
62355
- var len = tree[n2 * 2 + 1];
61778
+ for (n = 0;n <= max_code; n++) {
61779
+ var len = tree[n * 2 + 1];
62356
61780
  if (len === 0) {
62357
61781
  continue;
62358
61782
  }
62359
- tree[n2 * 2] = bi_reverse(next_code[len]++, len);
61783
+ tree[n * 2] = bi_reverse(next_code[len]++, len);
62360
61784
  }
62361
61785
  }
62362
61786
  function tr_static_init() {
62363
- var n2;
61787
+ var n;
62364
61788
  var bits;
62365
61789
  var length;
62366
61790
  var code;
@@ -62369,7 +61793,7 @@ var require_trees = __commonJS((exports2) => {
62369
61793
  length = 0;
62370
61794
  for (code = 0;code < LENGTH_CODES - 1; code++) {
62371
61795
  base_length[code] = length;
62372
- for (n2 = 0;n2 < 1 << extra_lbits[code]; n2++) {
61796
+ for (n = 0;n < 1 << extra_lbits[code]; n++) {
62373
61797
  _length_code[length++] = code;
62374
61798
  }
62375
61799
  }
@@ -62377,60 +61801,60 @@ var require_trees = __commonJS((exports2) => {
62377
61801
  dist = 0;
62378
61802
  for (code = 0;code < 16; code++) {
62379
61803
  base_dist[code] = dist;
62380
- for (n2 = 0;n2 < 1 << extra_dbits[code]; n2++) {
61804
+ for (n = 0;n < 1 << extra_dbits[code]; n++) {
62381
61805
  _dist_code[dist++] = code;
62382
61806
  }
62383
61807
  }
62384
61808
  dist >>= 7;
62385
61809
  for (;code < D_CODES; code++) {
62386
61810
  base_dist[code] = dist << 7;
62387
- for (n2 = 0;n2 < 1 << extra_dbits[code] - 7; n2++) {
61811
+ for (n = 0;n < 1 << extra_dbits[code] - 7; n++) {
62388
61812
  _dist_code[256 + dist++] = code;
62389
61813
  }
62390
61814
  }
62391
61815
  for (bits = 0;bits <= MAX_BITS; bits++) {
62392
61816
  bl_count[bits] = 0;
62393
61817
  }
62394
- n2 = 0;
62395
- while (n2 <= 143) {
62396
- static_ltree[n2 * 2 + 1] = 8;
62397
- n2++;
61818
+ n = 0;
61819
+ while (n <= 143) {
61820
+ static_ltree[n * 2 + 1] = 8;
61821
+ n++;
62398
61822
  bl_count[8]++;
62399
61823
  }
62400
- while (n2 <= 255) {
62401
- static_ltree[n2 * 2 + 1] = 9;
62402
- n2++;
61824
+ while (n <= 255) {
61825
+ static_ltree[n * 2 + 1] = 9;
61826
+ n++;
62403
61827
  bl_count[9]++;
62404
61828
  }
62405
- while (n2 <= 279) {
62406
- static_ltree[n2 * 2 + 1] = 7;
62407
- n2++;
61829
+ while (n <= 279) {
61830
+ static_ltree[n * 2 + 1] = 7;
61831
+ n++;
62408
61832
  bl_count[7]++;
62409
61833
  }
62410
- while (n2 <= 287) {
62411
- static_ltree[n2 * 2 + 1] = 8;
62412
- n2++;
61834
+ while (n <= 287) {
61835
+ static_ltree[n * 2 + 1] = 8;
61836
+ n++;
62413
61837
  bl_count[8]++;
62414
61838
  }
62415
61839
  gen_codes(static_ltree, L_CODES + 1, bl_count);
62416
- for (n2 = 0;n2 < D_CODES; n2++) {
62417
- static_dtree[n2 * 2 + 1] = 5;
62418
- static_dtree[n2 * 2] = bi_reverse(n2, 5);
61840
+ for (n = 0;n < D_CODES; n++) {
61841
+ static_dtree[n * 2 + 1] = 5;
61842
+ static_dtree[n * 2] = bi_reverse(n, 5);
62419
61843
  }
62420
61844
  static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
62421
61845
  static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
62422
61846
  static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
62423
61847
  }
62424
61848
  function init_block(s) {
62425
- var n2;
62426
- for (n2 = 0;n2 < L_CODES; n2++) {
62427
- s.dyn_ltree[n2 * 2] = 0;
61849
+ var n;
61850
+ for (n = 0;n < L_CODES; n++) {
61851
+ s.dyn_ltree[n * 2] = 0;
62428
61852
  }
62429
- for (n2 = 0;n2 < D_CODES; n2++) {
62430
- s.dyn_dtree[n2 * 2] = 0;
61853
+ for (n = 0;n < D_CODES; n++) {
61854
+ s.dyn_dtree[n * 2] = 0;
62431
61855
  }
62432
- for (n2 = 0;n2 < BL_CODES; n2++) {
62433
- s.bl_tree[n2 * 2] = 0;
61856
+ for (n = 0;n < BL_CODES; n++) {
61857
+ s.bl_tree[n * 2] = 0;
62434
61858
  }
62435
61859
  s.dyn_ltree[END_BLOCK * 2] = 1;
62436
61860
  s.opt_len = s.static_len = 0;
@@ -62454,10 +61878,10 @@ var require_trees = __commonJS((exports2) => {
62454
61878
  utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
62455
61879
  s.pending += len;
62456
61880
  }
62457
- function smaller(tree, n2, m2, depth) {
62458
- var _n2 = n2 * 2;
62459
- var _m2 = m2 * 2;
62460
- return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n2] <= depth[m2];
61881
+ function smaller(tree, n, m, depth) {
61882
+ var _n2 = n * 2;
61883
+ var _m2 = m * 2;
61884
+ return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];
62461
61885
  }
62462
61886
  function pqdownheap(s, tree, k) {
62463
61887
  var v = s.heap[k];
@@ -62514,17 +61938,17 @@ var require_trees = __commonJS((exports2) => {
62514
61938
  var stree = desc.stat_desc.static_tree;
62515
61939
  var has_stree = desc.stat_desc.has_stree;
62516
61940
  var elems = desc.stat_desc.elems;
62517
- var n2, m2;
61941
+ var n, m;
62518
61942
  var max_code = -1;
62519
61943
  var node;
62520
61944
  s.heap_len = 0;
62521
61945
  s.heap_max = HEAP_SIZE;
62522
- for (n2 = 0;n2 < elems; n2++) {
62523
- if (tree[n2 * 2] !== 0) {
62524
- s.heap[++s.heap_len] = max_code = n2;
62525
- s.depth[n2] = 0;
61946
+ for (n = 0;n < elems; n++) {
61947
+ if (tree[n * 2] !== 0) {
61948
+ s.heap[++s.heap_len] = max_code = n;
61949
+ s.depth[n] = 0;
62526
61950
  } else {
62527
- tree[n2 * 2 + 1] = 0;
61951
+ tree[n * 2 + 1] = 0;
62528
61952
  }
62529
61953
  }
62530
61954
  while (s.heap_len < 2) {
@@ -62537,20 +61961,20 @@ var require_trees = __commonJS((exports2) => {
62537
61961
  }
62538
61962
  }
62539
61963
  desc.max_code = max_code;
62540
- for (n2 = s.heap_len >> 1;n2 >= 1; n2--) {
62541
- pqdownheap(s, tree, n2);
61964
+ for (n = s.heap_len >> 1;n >= 1; n--) {
61965
+ pqdownheap(s, tree, n);
62542
61966
  }
62543
61967
  node = elems;
62544
61968
  do {
62545
- n2 = s.heap[1];
61969
+ n = s.heap[1];
62546
61970
  s.heap[1] = s.heap[s.heap_len--];
62547
61971
  pqdownheap(s, tree, 1);
62548
- m2 = s.heap[1];
62549
- s.heap[--s.heap_max] = n2;
62550
- s.heap[--s.heap_max] = m2;
62551
- tree[node * 2] = tree[n2 * 2] + tree[m2 * 2];
62552
- s.depth[node] = (s.depth[n2] >= s.depth[m2] ? s.depth[n2] : s.depth[m2]) + 1;
62553
- tree[n2 * 2 + 1] = tree[m2 * 2 + 1] = node;
61972
+ m = s.heap[1];
61973
+ s.heap[--s.heap_max] = n;
61974
+ s.heap[--s.heap_max] = m;
61975
+ tree[node * 2] = tree[n * 2] + tree[m * 2];
61976
+ s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
61977
+ tree[n * 2 + 1] = tree[m * 2 + 1] = node;
62554
61978
  s.heap[1] = node++;
62555
61979
  pqdownheap(s, tree, 1);
62556
61980
  } while (s.heap_len >= 2);
@@ -62559,7 +61983,7 @@ var require_trees = __commonJS((exports2) => {
62559
61983
  gen_codes(tree, max_code, s.bl_count);
62560
61984
  }
62561
61985
  function scan_tree(s, tree, max_code) {
62562
- var n2;
61986
+ var n;
62563
61987
  var prevlen = -1;
62564
61988
  var curlen;
62565
61989
  var nextlen = tree[0 * 2 + 1];
@@ -62571,9 +61995,9 @@ var require_trees = __commonJS((exports2) => {
62571
61995
  min_count = 3;
62572
61996
  }
62573
61997
  tree[(max_code + 1) * 2 + 1] = 65535;
62574
- for (n2 = 0;n2 <= max_code; n2++) {
61998
+ for (n = 0;n <= max_code; n++) {
62575
61999
  curlen = nextlen;
62576
- nextlen = tree[(n2 + 1) * 2 + 1];
62000
+ nextlen = tree[(n + 1) * 2 + 1];
62577
62001
  if (++count < max_count && curlen === nextlen) {
62578
62002
  continue;
62579
62003
  } else if (count < min_count) {
@@ -62603,7 +62027,7 @@ var require_trees = __commonJS((exports2) => {
62603
62027
  }
62604
62028
  }
62605
62029
  function send_tree(s, tree, max_code) {
62606
- var n2;
62030
+ var n;
62607
62031
  var prevlen = -1;
62608
62032
  var curlen;
62609
62033
  var nextlen = tree[0 * 2 + 1];
@@ -62614,9 +62038,9 @@ var require_trees = __commonJS((exports2) => {
62614
62038
  max_count = 138;
62615
62039
  min_count = 3;
62616
62040
  }
62617
- for (n2 = 0;n2 <= max_code; n2++) {
62041
+ for (n = 0;n <= max_code; n++) {
62618
62042
  curlen = nextlen;
62619
- nextlen = tree[(n2 + 1) * 2 + 1];
62043
+ nextlen = tree[(n + 1) * 2 + 1];
62620
62044
  if (++count < max_count && curlen === nextlen) {
62621
62045
  continue;
62622
62046
  } else if (count < min_count) {
@@ -62677,17 +62101,17 @@ var require_trees = __commonJS((exports2) => {
62677
62101
  }
62678
62102
  function detect_data_type(s) {
62679
62103
  var black_mask = 4093624447;
62680
- var n2;
62681
- for (n2 = 0;n2 <= 31; n2++, black_mask >>>= 1) {
62682
- if (black_mask & 1 && s.dyn_ltree[n2 * 2] !== 0) {
62104
+ var n;
62105
+ for (n = 0;n <= 31; n++, black_mask >>>= 1) {
62106
+ if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0) {
62683
62107
  return Z_BINARY;
62684
62108
  }
62685
62109
  }
62686
62110
  if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) {
62687
62111
  return Z_TEXT;
62688
62112
  }
62689
- for (n2 = 32;n2 < LITERALS; n2++) {
62690
- if (s.dyn_ltree[n2 * 2] !== 0) {
62113
+ for (n = 32;n < LITERALS; n++) {
62114
+ if (s.dyn_ltree[n * 2] !== 0) {
62691
62115
  return Z_TEXT;
62692
62116
  }
62693
62117
  }
@@ -62773,14 +62197,14 @@ var require_trees = __commonJS((exports2) => {
62773
62197
  // node_modules/pako/lib/zlib/adler32.js
62774
62198
  var require_adler32 = __commonJS((exports2, module2) => {
62775
62199
  function adler32(adler, buf, len, pos) {
62776
- var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n2 = 0;
62200
+ var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;
62777
62201
  while (len !== 0) {
62778
- n2 = len > 2000 ? 2000 : len;
62779
- len -= n2;
62202
+ n = len > 2000 ? 2000 : len;
62203
+ len -= n;
62780
62204
  do {
62781
62205
  s1 = s1 + buf[pos++] | 0;
62782
62206
  s2 = s2 + s1 | 0;
62783
- } while (--n2);
62207
+ } while (--n);
62784
62208
  s1 %= 65521;
62785
62209
  s2 %= 65521;
62786
62210
  }
@@ -62793,21 +62217,21 @@ var require_adler32 = __commonJS((exports2, module2) => {
62793
62217
  var require_crc322 = __commonJS((exports2, module2) => {
62794
62218
  function makeTable() {
62795
62219
  var c, table = [];
62796
- for (var n2 = 0;n2 < 256; n2++) {
62797
- c = n2;
62220
+ for (var n = 0;n < 256; n++) {
62221
+ c = n;
62798
62222
  for (var k = 0;k < 8; k++) {
62799
62223
  c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
62800
62224
  }
62801
- table[n2] = c;
62225
+ table[n] = c;
62802
62226
  }
62803
62227
  return table;
62804
62228
  }
62805
62229
  var crcTable = makeTable();
62806
62230
  function crc32(crc, buf, len, pos) {
62807
- var t2 = crcTable, end = pos + len;
62231
+ var t = crcTable, end = pos + len;
62808
62232
  crc ^= -1;
62809
62233
  for (var i = pos;i < end; i++) {
62810
- crc = crc >>> 8 ^ t2[(crc ^ buf[i]) & 255];
62234
+ crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];
62811
62235
  }
62812
62236
  return crc ^ -1;
62813
62237
  }
@@ -62990,7 +62414,7 @@ var require_deflate = __commonJS((exports2) => {
62990
62414
  }
62991
62415
  function fill_window(s) {
62992
62416
  var _w_size = s.w_size;
62993
- var p, n2, m2, more, str;
62417
+ var p, n, m, more, str;
62994
62418
  do {
62995
62419
  more = s.window_size - s.lookahead - s.strstart;
62996
62420
  if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
@@ -62998,25 +62422,25 @@ var require_deflate = __commonJS((exports2) => {
62998
62422
  s.match_start -= _w_size;
62999
62423
  s.strstart -= _w_size;
63000
62424
  s.block_start -= _w_size;
63001
- n2 = s.hash_size;
63002
- p = n2;
62425
+ n = s.hash_size;
62426
+ p = n;
63003
62427
  do {
63004
- m2 = s.head[--p];
63005
- s.head[p] = m2 >= _w_size ? m2 - _w_size : 0;
63006
- } while (--n2);
63007
- n2 = _w_size;
63008
- p = n2;
62428
+ m = s.head[--p];
62429
+ s.head[p] = m >= _w_size ? m - _w_size : 0;
62430
+ } while (--n);
62431
+ n = _w_size;
62432
+ p = n;
63009
62433
  do {
63010
- m2 = s.prev[--p];
63011
- s.prev[p] = m2 >= _w_size ? m2 - _w_size : 0;
63012
- } while (--n2);
62434
+ m = s.prev[--p];
62435
+ s.prev[p] = m >= _w_size ? m - _w_size : 0;
62436
+ } while (--n);
63013
62437
  more += _w_size;
63014
62438
  }
63015
62439
  if (s.strm.avail_in === 0) {
63016
62440
  break;
63017
62441
  }
63018
- n2 = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
63019
- s.lookahead += n2;
62442
+ n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
62443
+ s.lookahead += n;
63020
62444
  if (s.lookahead + s.insert >= MIN_MATCH) {
63021
62445
  str = s.strstart - s.insert;
63022
62446
  s.ins_h = s.window[str];
@@ -63786,7 +63210,7 @@ var require_deflate = __commonJS((exports2) => {
63786
63210
  function deflateSetDictionary(strm, dictionary) {
63787
63211
  var dictLength = dictionary.length;
63788
63212
  var s;
63789
- var str, n2;
63213
+ var str, n;
63790
63214
  var wrap;
63791
63215
  var avail;
63792
63216
  var next;
@@ -63825,13 +63249,13 @@ var require_deflate = __commonJS((exports2) => {
63825
63249
  fill_window(s);
63826
63250
  while (s.lookahead >= MIN_MATCH) {
63827
63251
  str = s.strstart;
63828
- n2 = s.lookahead - (MIN_MATCH - 1);
63252
+ n = s.lookahead - (MIN_MATCH - 1);
63829
63253
  do {
63830
63254
  s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
63831
63255
  s.prev[str & s.w_mask] = s.head[s.ins_h];
63832
63256
  s.head[s.ins_h] = str;
63833
63257
  str++;
63834
- } while (--n2);
63258
+ } while (--n);
63835
63259
  s.strstart = str;
63836
63260
  s.lookahead = MIN_MATCH - 1;
63837
63261
  fill_window(s);
@@ -64969,7 +64393,7 @@ var require_inflate = __commonJS((exports2) => {
64969
64393
  var ret;
64970
64394
  var hbuf = new utils.Buf8(4);
64971
64395
  var opts;
64972
- var n2;
64396
+ var n;
64973
64397
  var order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
64974
64398
  if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) {
64975
64399
  return Z_STREAM_ERROR;
@@ -65439,8 +64863,8 @@ var require_inflate = __commonJS((exports2) => {
65439
64863
  state.lens[state.have++] = here_val;
65440
64864
  } else {
65441
64865
  if (here_val === 16) {
65442
- n2 = here_bits + 2;
65443
- while (bits < n2) {
64866
+ n = here_bits + 2;
64867
+ while (bits < n) {
65444
64868
  if (have === 0) {
65445
64869
  break inf_leave;
65446
64870
  }
@@ -65460,8 +64884,8 @@ var require_inflate = __commonJS((exports2) => {
65460
64884
  hold >>>= 2;
65461
64885
  bits -= 2;
65462
64886
  } else if (here_val === 17) {
65463
- n2 = here_bits + 3;
65464
- while (bits < n2) {
64887
+ n = here_bits + 3;
64888
+ while (bits < n) {
65465
64889
  if (have === 0) {
65466
64890
  break inf_leave;
65467
64891
  }
@@ -65476,8 +64900,8 @@ var require_inflate = __commonJS((exports2) => {
65476
64900
  hold >>>= 3;
65477
64901
  bits -= 3;
65478
64902
  } else {
65479
- n2 = here_bits + 7;
65480
- while (bits < n2) {
64903
+ n = here_bits + 7;
64904
+ while (bits < n) {
65481
64905
  if (have === 0) {
65482
64906
  break inf_leave;
65483
64907
  }
@@ -65618,8 +65042,8 @@ var require_inflate = __commonJS((exports2) => {
65618
65042
  state.mode = LENEXT;
65619
65043
  case LENEXT:
65620
65044
  if (state.extra) {
65621
- n2 = state.extra;
65622
- while (bits < n2) {
65045
+ n = state.extra;
65046
+ while (bits < n) {
65623
65047
  if (have === 0) {
65624
65048
  break inf_leave;
65625
65049
  }
@@ -65686,8 +65110,8 @@ var require_inflate = __commonJS((exports2) => {
65686
65110
  state.mode = DISTEXT;
65687
65111
  case DISTEXT:
65688
65112
  if (state.extra) {
65689
- n2 = state.extra;
65690
- while (bits < n2) {
65113
+ n = state.extra;
65114
+ while (bits < n) {
65691
65115
  if (have === 0) {
65692
65116
  break inf_leave;
65693
65117
  }
@@ -66613,18 +66037,18 @@ var require_object = __commonJS((exports2, module2) => {
66613
66037
  var object = new ZipObject(name, zipObjectContent, o);
66614
66038
  this.files[name] = object;
66615
66039
  };
66616
- var parentFolder = function(path22) {
66617
- if (path22.slice(-1) === "/") {
66618
- path22 = path22.substring(0, path22.length - 1);
66040
+ var parentFolder = function(path21) {
66041
+ if (path21.slice(-1) === "/") {
66042
+ path21 = path21.substring(0, path21.length - 1);
66619
66043
  }
66620
- var lastSlash = path22.lastIndexOf("/");
66621
- return lastSlash > 0 ? path22.substring(0, lastSlash) : "";
66044
+ var lastSlash = path21.lastIndexOf("/");
66045
+ return lastSlash > 0 ? path21.substring(0, lastSlash) : "";
66622
66046
  };
66623
- var forceTrailingSlash = function(path22) {
66624
- if (path22.slice(-1) !== "/") {
66625
- path22 += "/";
66047
+ var forceTrailingSlash = function(path21) {
66048
+ if (path21.slice(-1) !== "/") {
66049
+ path21 += "/";
66626
66050
  }
66627
- return path22;
66051
+ return path21;
66628
66052
  };
66629
66053
  var folderAdd = function(name, createFolders) {
66630
66054
  createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
@@ -66795,8 +66219,8 @@ var require_DataReader = __commonJS((exports2, module2) => {
66795
66219
  this.checkIndex(newIndex);
66796
66220
  this.index = newIndex;
66797
66221
  },
66798
- skip: function(n2) {
66799
- this.setIndex(this.index + n2);
66222
+ skip: function(n) {
66223
+ this.setIndex(this.index + n);
66800
66224
  },
66801
66225
  byteAt: function() {},
66802
66226
  readInt: function(size) {
@@ -67292,7 +66716,7 @@ var require_load2 = __commonJS((exports2, module2) => {
67292
66716
  var Crc32Probe = require_Crc32Probe();
67293
66717
  var nodejsUtils = require_nodejsUtils();
67294
66718
  function checkEntryCRC32(zipEntry) {
67295
- return new external.Promise(function(resolve9, reject) {
66719
+ return new external.Promise(function(resolve8, reject) {
67296
66720
  var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe);
67297
66721
  worker.on("error", function(e) {
67298
66722
  reject(e);
@@ -67300,7 +66724,7 @@ var require_load2 = __commonJS((exports2, module2) => {
67300
66724
  if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {
67301
66725
  reject(new Error("Corrupted zip : CRC32 mismatch"));
67302
66726
  } else {
67303
- resolve9();
66727
+ resolve8();
67304
66728
  }
67305
66729
  }).resume();
67306
66730
  });
@@ -67393,6 +66817,582 @@ var require_lib4 = __commonJS((exports2, module2) => {
67393
66817
  module2.exports = JSZip;
67394
66818
  });
67395
66819
 
66820
+ // node_modules/minimist/index.js
66821
+ var require_minimist = __commonJS((exports2, module2) => {
66822
+ function hasKey(obj, keys) {
66823
+ var o = obj;
66824
+ keys.slice(0, -1).forEach(function(key2) {
66825
+ o = o[key2] || {};
66826
+ });
66827
+ var key = keys[keys.length - 1];
66828
+ return key in o;
66829
+ }
66830
+ function isNumber(x) {
66831
+ if (typeof x === "number") {
66832
+ return true;
66833
+ }
66834
+ if (/^0x[0-9a-f]+$/i.test(x)) {
66835
+ return true;
66836
+ }
66837
+ return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
66838
+ }
66839
+ function isConstructorOrProto(obj, key) {
66840
+ return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
66841
+ }
66842
+ module2.exports = function(args, opts) {
66843
+ if (!opts) {
66844
+ opts = {};
66845
+ }
66846
+ var flags = {
66847
+ bools: {},
66848
+ strings: {},
66849
+ unknownFn: null
66850
+ };
66851
+ if (typeof opts.unknown === "function") {
66852
+ flags.unknownFn = opts.unknown;
66853
+ }
66854
+ if (typeof opts.boolean === "boolean" && opts.boolean) {
66855
+ flags.allBools = true;
66856
+ } else {
66857
+ [].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
66858
+ flags.bools[key2] = true;
66859
+ });
66860
+ }
66861
+ var aliases = {};
66862
+ function aliasIsBoolean(key2) {
66863
+ return aliases[key2].some(function(x) {
66864
+ return flags.bools[x];
66865
+ });
66866
+ }
66867
+ Object.keys(opts.alias || {}).forEach(function(key2) {
66868
+ aliases[key2] = [].concat(opts.alias[key2]);
66869
+ aliases[key2].forEach(function(x) {
66870
+ aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
66871
+ return x !== y;
66872
+ }));
66873
+ });
66874
+ });
66875
+ [].concat(opts.string).filter(Boolean).forEach(function(key2) {
66876
+ flags.strings[key2] = true;
66877
+ if (aliases[key2]) {
66878
+ [].concat(aliases[key2]).forEach(function(k) {
66879
+ flags.strings[k] = true;
66880
+ });
66881
+ }
66882
+ });
66883
+ var defaults = opts.default || {};
66884
+ var argv = { _: [] };
66885
+ function argDefined(key2, arg2) {
66886
+ return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
66887
+ }
66888
+ function setKey(obj, keys, value2) {
66889
+ var o = obj;
66890
+ for (var i2 = 0;i2 < keys.length - 1; i2++) {
66891
+ var key2 = keys[i2];
66892
+ if (isConstructorOrProto(o, key2)) {
66893
+ return;
66894
+ }
66895
+ if (o[key2] === undefined) {
66896
+ o[key2] = {};
66897
+ }
66898
+ if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) {
66899
+ o[key2] = {};
66900
+ }
66901
+ if (o[key2] === Array.prototype) {
66902
+ o[key2] = [];
66903
+ }
66904
+ o = o[key2];
66905
+ }
66906
+ var lastKey = keys[keys.length - 1];
66907
+ if (isConstructorOrProto(o, lastKey)) {
66908
+ return;
66909
+ }
66910
+ if (o === Object.prototype || o === Number.prototype || o === String.prototype) {
66911
+ o = {};
66912
+ }
66913
+ if (o === Array.prototype) {
66914
+ o = [];
66915
+ }
66916
+ if (o[lastKey] === undefined || flags.bools[lastKey] || typeof o[lastKey] === "boolean") {
66917
+ o[lastKey] = value2;
66918
+ } else if (Array.isArray(o[lastKey])) {
66919
+ o[lastKey].push(value2);
66920
+ } else {
66921
+ o[lastKey] = [o[lastKey], value2];
66922
+ }
66923
+ }
66924
+ function setArg(key2, val, arg2) {
66925
+ if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
66926
+ if (flags.unknownFn(arg2) === false) {
66927
+ return;
66928
+ }
66929
+ }
66930
+ var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
66931
+ setKey(argv, key2.split("."), value2);
66932
+ (aliases[key2] || []).forEach(function(x) {
66933
+ setKey(argv, x.split("."), value2);
66934
+ });
66935
+ }
66936
+ Object.keys(flags.bools).forEach(function(key2) {
66937
+ setArg(key2, defaults[key2] === undefined ? false : defaults[key2]);
66938
+ });
66939
+ var notFlags = [];
66940
+ if (args.indexOf("--") !== -1) {
66941
+ notFlags = args.slice(args.indexOf("--") + 1);
66942
+ args = args.slice(0, args.indexOf("--"));
66943
+ }
66944
+ for (var i = 0;i < args.length; i++) {
66945
+ var arg = args[i];
66946
+ var key;
66947
+ var next;
66948
+ if (/^--.+=/.test(arg)) {
66949
+ var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
66950
+ key = m[1];
66951
+ var value = m[2];
66952
+ if (flags.bools[key]) {
66953
+ value = value !== "false";
66954
+ }
66955
+ setArg(key, value, arg);
66956
+ } else if (/^--no-.+/.test(arg)) {
66957
+ key = arg.match(/^--no-(.+)/)[1];
66958
+ setArg(key, false, arg);
66959
+ } else if (/^--.+/.test(arg)) {
66960
+ key = arg.match(/^--(.+)/)[1];
66961
+ next = args[i + 1];
66962
+ if (next !== undefined && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
66963
+ setArg(key, next, arg);
66964
+ i += 1;
66965
+ } else if (/^(true|false)$/.test(next)) {
66966
+ setArg(key, next === "true", arg);
66967
+ i += 1;
66968
+ } else {
66969
+ setArg(key, flags.strings[key] ? "" : true, arg);
66970
+ }
66971
+ } else if (/^-[^-]+/.test(arg)) {
66972
+ var letters = arg.slice(1, -1).split("");
66973
+ var broken = false;
66974
+ for (var j = 0;j < letters.length; j++) {
66975
+ next = arg.slice(j + 2);
66976
+ if (next === "-") {
66977
+ setArg(letters[j], next, arg);
66978
+ continue;
66979
+ }
66980
+ if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
66981
+ setArg(letters[j], next.slice(1), arg);
66982
+ broken = true;
66983
+ break;
66984
+ }
66985
+ if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
66986
+ setArg(letters[j], next, arg);
66987
+ broken = true;
66988
+ break;
66989
+ }
66990
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
66991
+ setArg(letters[j], arg.slice(j + 2), arg);
66992
+ broken = true;
66993
+ break;
66994
+ } else {
66995
+ setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
66996
+ }
66997
+ }
66998
+ key = arg.slice(-1)[0];
66999
+ if (!broken && key !== "-") {
67000
+ if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
67001
+ setArg(key, args[i + 1], arg);
67002
+ i += 1;
67003
+ } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
67004
+ setArg(key, args[i + 1] === "true", arg);
67005
+ i += 1;
67006
+ } else {
67007
+ setArg(key, flags.strings[key] ? "" : true, arg);
67008
+ }
67009
+ }
67010
+ } else {
67011
+ if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
67012
+ argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
67013
+ }
67014
+ if (opts.stopEarly) {
67015
+ argv._.push.apply(argv._, args.slice(i + 1));
67016
+ break;
67017
+ }
67018
+ }
67019
+ }
67020
+ Object.keys(defaults).forEach(function(k) {
67021
+ if (!hasKey(argv, k.split("."))) {
67022
+ setKey(argv, k.split("."), defaults[k]);
67023
+ (aliases[k] || []).forEach(function(x) {
67024
+ setKey(argv, x.split("."), defaults[k]);
67025
+ });
67026
+ }
67027
+ });
67028
+ if (opts["--"]) {
67029
+ argv["--"] = notFlags.slice();
67030
+ } else {
67031
+ notFlags.forEach(function(k) {
67032
+ argv._.push(k);
67033
+ });
67034
+ }
67035
+ return argv;
67036
+ };
67037
+ });
67038
+
67039
+ // node_modules/perfect-cli/dist/index.js
67040
+ var require_dist7 = __commonJS((exports2, module2) => {
67041
+ var __create3 = Object.create;
67042
+ var __defProp3 = Object.defineProperty;
67043
+ var __defProps = Object.defineProperties;
67044
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
67045
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
67046
+ var __getOwnPropNames3 = Object.getOwnPropertyNames;
67047
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
67048
+ var __getProtoOf3 = Object.getPrototypeOf;
67049
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
67050
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
67051
+ var __defNormalProp = (obj, key, value) => (key in obj) ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
67052
+ var __spreadValues = (a, b) => {
67053
+ for (var prop in b || (b = {}))
67054
+ if (__hasOwnProp3.call(b, prop))
67055
+ __defNormalProp(a, prop, b[prop]);
67056
+ if (__getOwnPropSymbols)
67057
+ for (var prop of __getOwnPropSymbols(b)) {
67058
+ if (__propIsEnum.call(b, prop))
67059
+ __defNormalProp(a, prop, b[prop]);
67060
+ }
67061
+ return a;
67062
+ };
67063
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
67064
+ var __objRest = (source, exclude) => {
67065
+ var target = {};
67066
+ for (var prop in source)
67067
+ if (__hasOwnProp3.call(source, prop) && exclude.indexOf(prop) < 0)
67068
+ target[prop] = source[prop];
67069
+ if (source != null && __getOwnPropSymbols)
67070
+ for (var prop of __getOwnPropSymbols(source)) {
67071
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
67072
+ target[prop] = source[prop];
67073
+ }
67074
+ return target;
67075
+ };
67076
+ var __export2 = (target, all) => {
67077
+ for (var name in all)
67078
+ __defProp3(target, name, { get: all[name], enumerable: true });
67079
+ };
67080
+ var __copyProps2 = (to, from, except, desc) => {
67081
+ if (from && typeof from === "object" || typeof from === "function") {
67082
+ for (let key of __getOwnPropNames3(from))
67083
+ if (!__hasOwnProp3.call(to, key) && key !== except)
67084
+ __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
67085
+ }
67086
+ return to;
67087
+ };
67088
+ var __toESM3 = (mod, isNodeMode, target) => (target = mod != null ? __create3(__getProtoOf3(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target, mod));
67089
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
67090
+ var __async = (__this, __arguments, generator) => {
67091
+ return new Promise((resolve10, reject) => {
67092
+ var fulfilled = (value) => {
67093
+ try {
67094
+ step(generator.next(value));
67095
+ } catch (e) {
67096
+ reject(e);
67097
+ }
67098
+ };
67099
+ var rejected = (value) => {
67100
+ try {
67101
+ step(generator.throw(value));
67102
+ } catch (e) {
67103
+ reject(e);
67104
+ }
67105
+ };
67106
+ var step = (x) => x.done ? resolve10(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
67107
+ step((generator = generator.apply(__this, __arguments)).next());
67108
+ });
67109
+ };
67110
+ var src_exports = {};
67111
+ __export2(src_exports, {
67112
+ getCommandFromPath: () => getCommandFromPath,
67113
+ getCommandPathOnly: () => getCommandPathOnly,
67114
+ perfectCli: () => perfectCli
67115
+ });
67116
+ module2.exports = __toCommonJS2(src_exports);
67117
+ var import_minimist = __toESM3(require_minimist());
67118
+ var import_prompts7 = __toESM3(require_prompts3());
67119
+ var getAllLeafCommandPaths = (program3) => {
67120
+ const allCommandPaths = [];
67121
+ const traverse = (command, currentPath) => {
67122
+ if (command.commands.length === 0) {
67123
+ allCommandPaths.push(currentPath.join(" "));
67124
+ }
67125
+ command.commands.forEach((subcommand) => {
67126
+ traverse(subcommand, [...currentPath, subcommand.name()]);
67127
+ });
67128
+ };
67129
+ traverse(program3, []);
67130
+ return allCommandPaths.filter((path24) => path24 !== "");
67131
+ };
67132
+ var normalizeCommandName = (s) => s.replace(/_/g, "-").toLowerCase();
67133
+ var getCommandFromPath = (program3, commandPathAndPositionalArgs) => {
67134
+ const commandPath = getCommandPathOnly(program3, commandPathAndPositionalArgs);
67135
+ return commandPath.reduce((curr, nextCommandName) => !curr ? null : curr.commands.find((c) => normalizeCommandName(c.name()) === normalizeCommandName(nextCommandName)), program3);
67136
+ };
67137
+ var getCommandPathOnly = (program3, commandPathAndPositionalArgs) => {
67138
+ const allLeafCommandPaths = getAllLeafCommandPaths(program3).map((path24) => normalizeCommandName(path24));
67139
+ const commandPath = [];
67140
+ for (const elm of commandPathAndPositionalArgs) {
67141
+ if (elm.startsWith("-"))
67142
+ continue;
67143
+ commandPath.push(elm);
67144
+ if (allLeafCommandPaths.includes(normalizeCommandName(commandPath.join(" ")))) {
67145
+ break;
67146
+ }
67147
+ }
67148
+ return commandPath;
67149
+ };
67150
+ var getPositionalArgsOnly = (program3, commandPathAndPositionalArgs) => {
67151
+ const allLeafCommandPaths = getAllLeafCommandPaths(program3);
67152
+ const commandPath = [];
67153
+ let positionalArgs = [];
67154
+ for (const elm of commandPathAndPositionalArgs) {
67155
+ if (elm.startsWith("-"))
67156
+ continue;
67157
+ commandPath.push(elm);
67158
+ if (allLeafCommandPaths.includes(commandPath.join(" "))) {
67159
+ positionalArgs = commandPathAndPositionalArgs.slice(commandPath.length);
67160
+ break;
67161
+ }
67162
+ }
67163
+ return positionalArgs;
67164
+ };
67165
+ var getStrictCommandPath = (program3, commandPath) => {
67166
+ const strictCommandPath = [];
67167
+ for (let i = 0;i < commandPath.length; i++) {
67168
+ strictCommandPath.push(getCommandFromPath(program3, commandPath.slice(0, i + 1)).name());
67169
+ }
67170
+ return strictCommandPath;
67171
+ };
67172
+ var figureOutCommandPath = (program3, commandPath) => __async(undefined, null, function* () {
67173
+ const currentCommand = getCommandFromPath(program3, commandPath);
67174
+ if (currentCommand.commands.length === 0) {
67175
+ return commandPath;
67176
+ }
67177
+ const normalizeText = (text) => text.replace(/[-_ ]/g, "_").toLowerCase();
67178
+ const { nextCommandName } = yield (0, import_prompts7.default)({
67179
+ type: "autocomplete",
67180
+ name: "nextCommandName",
67181
+ message: "Choose command",
67182
+ suggest: (input, choices) => __async(undefined, null, function* () {
67183
+ const normalizedInput = normalizeText(input);
67184
+ return choices.filter((c) => {
67185
+ var _a, _b;
67186
+ return normalizeText(c == null ? undefined : c.title).startsWith(normalizedInput) || ((_b = normalizeText((_a = c == null ? undefined : c.title) == null ? undefined : _a.split(" ").pop())) == null ? undefined : _b.startsWith(normalizedInput));
67187
+ });
67188
+ }),
67189
+ choices: currentCommand.commands.map((c) => ({
67190
+ title: `${[program3.name(), ...commandPath, c.name()].filter(Boolean).join(" ")}`,
67191
+ value: c.name(),
67192
+ description: c.description()
67193
+ }))
67194
+ });
67195
+ return figureOutCommandPath(program3, commandPath.concat([nextCommandName]));
67196
+ });
67197
+ var import_prompts22 = __toESM3(require_prompts3());
67198
+ var camelToKebab = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
67199
+ var findOptionByKey = (command, key) => {
67200
+ var _a;
67201
+ return (_a = command == null ? undefined : command.options) == null ? undefined : _a.find((o) => {
67202
+ var _a2, _b;
67203
+ const longFlag = (_a2 = o.long) == null ? undefined : _a2.replace(/^--/, "");
67204
+ const shortFlag = (_b = o.short) == null ? undefined : _b.replace(/^-/, "");
67205
+ if (longFlag === key || shortFlag === key) {
67206
+ return true;
67207
+ }
67208
+ if (longFlag === camelToKebab(key)) {
67209
+ return true;
67210
+ }
67211
+ return false;
67212
+ });
67213
+ };
67214
+ var getOptionFlagName = (command, key) => {
67215
+ var _a, _b;
67216
+ const option = findOptionByKey(command, key);
67217
+ if (option) {
67218
+ return ((_a = option.long) == null ? undefined : _a.replace(/^--/, "")) || ((_b = option.short) == null ? undefined : _b.replace(/^-/, "")) || "";
67219
+ }
67220
+ return camelToKebab(key);
67221
+ };
67222
+ var stringifyOptions = (options, command) => Object.entries(options).filter((opt) => opt[0] !== "_").map(([key, value]) => {
67223
+ var _a;
67224
+ const option = findOptionByKey(command, key);
67225
+ const flagName = getOptionFlagName(command, key);
67226
+ if ((_a = option == null ? undefined : option.isBoolean) == null ? undefined : _a.call(option)) {
67227
+ return value ? `--${flagName}` : "";
67228
+ }
67229
+ return `--${flagName} ${value}`;
67230
+ }).filter(Boolean).join(" ");
67231
+ var getOptionKey = (o) => {
67232
+ var _a;
67233
+ return ((_a = o.long) != null ? _a : o.short).replace(/^--/, "");
67234
+ };
67235
+ var figureOutCommandArgs = (program3, commandPath, options, perfectCliOptions) => __async(undefined, null, function* () {
67236
+ var _a, _b;
67237
+ const command = getCommandFromPath(program3, commandPath);
67238
+ const positionalArgs = (_a = options._) != null ? _a : getPositionalArgsOnly(program3, commandPath);
67239
+ const hasAllPositionalArgs = command.registeredArguments.every((ra, i) => !ra.required || positionalArgs[i]);
67240
+ if (!hasAllPositionalArgs) {
67241
+ const nextPositionalArg = command.registeredArguments.find((ra, i) => ra.required && !positionalArgs[i]);
67242
+ const { positionalArgInteractResult } = yield (0, import_prompts22.default)({
67243
+ name: "positionalArgInteractResult",
67244
+ type: "text",
67245
+ message: `Enter ${nextPositionalArg == null ? undefined : nextPositionalArg.name()}`
67246
+ });
67247
+ if (positionalArgInteractResult === undefined) {
67248
+ throw new Error(`${nextPositionalArg == null ? undefined : nextPositionalArg.name()} is required`);
67249
+ }
67250
+ return figureOutCommandArgs(program3, commandPath, __spreadProps(__spreadValues({}, options), { _: positionalArgs.concat([positionalArgInteractResult]) }), perfectCliOptions);
67251
+ }
67252
+ if (command.options.length === 0) {
67253
+ return options;
67254
+ }
67255
+ console.log(`> ${[program3.name(), ...commandPath].filter(Boolean).join(" ")} ${stringifyOptions(options, command)}`);
67256
+ const hasRequiredOptions = command.options.filter((o) => o.mandatory).every((o) => (getOptionKey(o) in options));
67257
+ const { optionToEdit } = yield (0, import_prompts22.default)({
67258
+ type: "autocomplete",
67259
+ name: "optionToEdit",
67260
+ message: "Choose option to edit",
67261
+ suggest: (input, choices) => __async(undefined, null, function* () {
67262
+ return choices.filter((c) => c.title.startsWith(input) || c.title.replace(/^--/, "").startsWith(input));
67263
+ }),
67264
+ choices: [
67265
+ hasRequiredOptions ? {
67266
+ title: "[Done]",
67267
+ value: "done",
67268
+ description: "Done editing options"
67269
+ } : null,
67270
+ ...command.options.map((o) => {
67271
+ const optionName = getOptionKey(o);
67272
+ return {
67273
+ title: `${o.long}${o.mandatory ? "*" : ""}`,
67274
+ value: optionName,
67275
+ description: optionName in options ? `[${options[optionName]}]` : o.description
67276
+ };
67277
+ })
67278
+ ].filter((elm) => Boolean(elm))
67279
+ });
67280
+ if (optionToEdit === "done") {
67281
+ return options;
67282
+ }
67283
+ const option = command.options.find((o) => getOptionKey(o) === optionToEdit);
67284
+ const customValue = yield (_b = perfectCliOptions == null ? undefined : perfectCliOptions.customParamHandler) == null ? undefined : _b.call(perfectCliOptions, {
67285
+ commandPath,
67286
+ optionName: option.name()
67287
+ }, { prompts: import_prompts22.default });
67288
+ if (customValue) {
67289
+ options[optionToEdit] = customValue;
67290
+ } else if (option.isBoolean()) {
67291
+ const { newValue } = yield (0, import_prompts22.default)({
67292
+ type: "toggle",
67293
+ name: "newValue",
67294
+ message: `Toggle ${option.name()}`,
67295
+ initial: options[optionToEdit],
67296
+ active: "true",
67297
+ inactive: "false"
67298
+ });
67299
+ options[optionToEdit] = newValue;
67300
+ } else {
67301
+ const { newValue } = yield (0, import_prompts22.default)({
67302
+ type: "text",
67303
+ name: "newValue",
67304
+ message: `Enter new value for ${option.long}`,
67305
+ initial: options[optionToEdit]
67306
+ });
67307
+ options[optionToEdit] = newValue;
67308
+ }
67309
+ return figureOutCommandArgs(program3, commandPath, options, perfectCliOptions);
67310
+ });
67311
+ var stringifyCommandWithOptions = (program3, commandPath, options) => {
67312
+ var _a, _b;
67313
+ const command = getCommandFromPath(program3, commandPath);
67314
+ return `${[program3.name(), ...commandPath].filter(Boolean).join(" ")}${((_a = options == null ? undefined : options._) == null ? undefined : _a.length) > 0 ? ` ${(_b = options == null ? undefined : options._) == null ? undefined : _b.join(" ")}` : ""} ${stringifyOptions(options, command)}`;
67315
+ };
67316
+ var doesProgramHaveAllRequiredArgs = (program3, _, passedArgs) => {
67317
+ const command = getCommandFromPath(program3, _);
67318
+ if (!command) {
67319
+ throw new Error(`Could not determine command from given positional args: ${JSON.stringify(_)}`);
67320
+ }
67321
+ const hasRequiredOptions = command.options.filter((o) => o.mandatory).every((o) => passedArgs[getOptionKey(o)]);
67322
+ const positionalArgs = getPositionalArgsOnly(program3, _);
67323
+ const hasRequiredPositionalArgs = command.registeredArguments.every((ra, i) => !ra.required || positionalArgs[i]);
67324
+ const hasSubcommands = command.commands.length > 0;
67325
+ return !hasSubcommands && hasRequiredOptions && hasRequiredPositionalArgs;
67326
+ };
67327
+ var perfectCli = (program3, argv, perfectCliOptions) => __async(undefined, null, function* () {
67328
+ var _b;
67329
+ const booleanArgs = [];
67330
+ const aliases = {};
67331
+ const subcommand = getCommandFromPath(program3, argv.slice(2));
67332
+ if (subcommand) {
67333
+ for (const option of subcommand.options) {
67334
+ if (option.long && option.short) {
67335
+ aliases[option.long.replace(/^--/, "").replace(/^-/, "")] = [
67336
+ option.short.replace(/^--/, "").replace(/^-/, "")
67337
+ ];
67338
+ }
67339
+ if (option.isBoolean()) {
67340
+ booleanArgs.push(...[option.long, option.short].filter(Boolean).map((r) => r.replace(/^--/, "").replace(/^-/, "")));
67341
+ }
67342
+ }
67343
+ }
67344
+ const passedArgs = (0, import_minimist.default)(argv.slice(2), {
67345
+ boolean: booleanArgs,
67346
+ alias: aliases,
67347
+ stopEarly: false
67348
+ });
67349
+ const _a = passedArgs, { y, yes, i, interactive, h, help, _ } = _a, unhandledPassedArgs = __objRest(_a, ["y", "yes", "i", "interactive", "h", "help", "_"]);
67350
+ const isYesMode = yes || y;
67351
+ const isInteractiveMode = i || interactive;
67352
+ const isHelpMode = help || h;
67353
+ if (isHelpMode) {
67354
+ (subcommand != null ? subcommand : program3).help();
67355
+ return;
67356
+ }
67357
+ const hasRequiredArgsToRun = doesProgramHaveAllRequiredArgs(program3, _, passedArgs);
67358
+ const argvWithoutPerfect = argv.filter((a) => !["--yes", "-y", "-i", "--interactive"].includes(a));
67359
+ if (isYesMode || !isInteractiveMode && hasRequiredArgsToRun) {
67360
+ const commandPath2 = getStrictCommandPath(program3, getCommandPathOnly(program3, argvWithoutPerfect.slice(2)));
67361
+ const fixedArgv = [
67362
+ ...argvWithoutPerfect.slice(0, 2),
67363
+ ...commandPath2,
67364
+ ...argvWithoutPerfect.slice(2 + commandPath2.length)
67365
+ ];
67366
+ yield program3.parseAsync(fixedArgv);
67367
+ process.exit(0);
67368
+ }
67369
+ const commandPath = yield figureOutCommandPath(program3, _);
67370
+ const command = getCommandFromPath(program3, commandPath);
67371
+ if (!command) {
67372
+ console.log(`Command not found: "${commandPath.join(" ")}"`);
67373
+ process.exit(1);
67374
+ }
67375
+ const options = yield figureOutCommandArgs(program3, commandPath, unhandledPassedArgs, perfectCliOptions);
67376
+ const fullCommandString = stringifyCommandWithOptions(program3, commandPath, options);
67377
+ console.log(`> ${fullCommandString}`);
67378
+ const strictCommandPath = getStrictCommandPath(program3, commandPath);
67379
+ const optionArgs = Object.entries(options).filter((opt) => opt[0] !== "_").flatMap(([optKey, optVal]) => {
67380
+ var _a2;
67381
+ const option = findOptionByKey(command, optKey);
67382
+ const flagName = getOptionFlagName(command, optKey);
67383
+ if ((_a2 = option == null ? undefined : option.isBoolean) == null ? undefined : _a2.call(option)) {
67384
+ return optVal ? [`--${flagName}`] : [];
67385
+ }
67386
+ return [`--${flagName}`, optVal];
67387
+ });
67388
+ yield program3.parseAsync([
67389
+ ...process.argv.slice(0, 2),
67390
+ ...strictCommandPath.concat((_b = options._) != null ? _b : []),
67391
+ ...optionArgs
67392
+ ]);
67393
+ });
67394
+ });
67395
+
67396
67396
  // node_modules/make-vfs/dist/index.js
67397
67397
  var require_dist8 = __commonJS((exports2, module2) => {
67398
67398
  var __create3 = Object.create;
@@ -67422,7 +67422,7 @@ var require_dist8 = __commonJS((exports2, module2) => {
67422
67422
  "node_modules/fs.realpath/old.js"(exports3) {
67423
67423
  var pathModule = __require("path");
67424
67424
  var isWindows2 = process.platform === "win32";
67425
- var fs22 = __require("fs");
67425
+ var fs24 = __require("fs");
67426
67426
  var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
67427
67427
  function rethrow() {
67428
67428
  var callback;
@@ -67456,7 +67456,7 @@ var require_dist8 = __commonJS((exports2, module2) => {
67456
67456
  function maybeCallback(cb) {
67457
67457
  return typeof cb === "function" ? cb : rethrow();
67458
67458
  }
67459
- var normalize2 = pathModule.normalize;
67459
+ var normalize3 = pathModule.normalize;
67460
67460
  if (isWindows2) {
67461
67461
  nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
67462
67462
  } else {
@@ -67487,7 +67487,7 @@ var require_dist8 = __commonJS((exports2, module2) => {
67487
67487
  base = m2[0];
67488
67488
  previous = "";
67489
67489
  if (isWindows2 && !knownHard[base]) {
67490
- fs22.lstatSync(base);
67490
+ fs24.lstatSync(base);
67491
67491
  knownHard[base] = true;
67492
67492
  }
67493
67493
  }
@@ -67505,7 +67505,7 @@ var require_dist8 = __commonJS((exports2, module2) => {
67505
67505
  if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
67506
67506
  resolvedLink = cache[base];
67507
67507
  } else {
67508
- var stat4 = fs22.lstatSync(base);
67508
+ var stat4 = fs24.lstatSync(base);
67509
67509
  if (!stat4.isSymbolicLink()) {
67510
67510
  knownHard[base] = true;
67511
67511
  if (cache)
@@ -67520,8 +67520,8 @@ var require_dist8 = __commonJS((exports2, module2) => {
67520
67520
  }
67521
67521
  }
67522
67522
  if (linkTarget === null) {
67523
- fs22.statSync(base);
67524
- linkTarget = fs22.readlinkSync(base);
67523
+ fs24.statSync(base);
67524
+ linkTarget = fs24.readlinkSync(base);
67525
67525
  }
67526
67526
  resolvedLink = pathModule.resolve(previous, linkTarget);
67527
67527
  if (cache)
@@ -67558,7 +67558,7 @@ var require_dist8 = __commonJS((exports2, module2) => {
67558
67558
  base = m2[0];
67559
67559
  previous = "";
67560
67560
  if (isWindows2 && !knownHard[base]) {
67561
- fs22.lstat(base, function(err) {
67561
+ fs24.lstat(base, function(err) {
67562
67562
  if (err)
67563
67563
  return cb(err);
67564
67564
  knownHard[base] = true;
@@ -67586,7 +67586,7 @@ var require_dist8 = __commonJS((exports2, module2) => {
67586
67586
  if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
67587
67587
  return gotResolvedLink(cache[base]);
67588
67588
  }
67589
- return fs22.lstat(base, gotStat);
67589
+ return fs24.lstat(base, gotStat);
67590
67590
  }
67591
67591
  function gotStat(err, stat4) {
67592
67592
  if (err)
@@ -67603,10 +67603,10 @@ var require_dist8 = __commonJS((exports2, module2) => {
67603
67603
  return gotTarget(null, seenLinks[id], base);
67604
67604
  }
67605
67605
  }
67606
- fs22.stat(base, function(err2) {
67606
+ fs24.stat(base, function(err2) {
67607
67607
  if (err2)
67608
67608
  return cb(err2);
67609
- fs22.readlink(base, function(err3, target) {
67609
+ fs24.readlink(base, function(err3, target) {
67610
67610
  if (!isWindows2)
67611
67611
  seenLinks[id] = target;
67612
67612
  gotTarget(err3, target);
@@ -67636,9 +67636,9 @@ var require_dist8 = __commonJS((exports2, module2) => {
67636
67636
  realpath2.realpathSync = realpathSync;
67637
67637
  realpath2.monkeypatch = monkeypatch;
67638
67638
  realpath2.unmonkeypatch = unmonkeypatch;
67639
- var fs22 = __require("fs");
67640
- var origRealpath = fs22.realpath;
67641
- var origRealpathSync = fs22.realpathSync;
67639
+ var fs24 = __require("fs");
67640
+ var origRealpath = fs24.realpath;
67641
+ var origRealpathSync = fs24.realpathSync;
67642
67642
  var version2 = process.version;
67643
67643
  var ok = /^v[0-5]\./.test(version2);
67644
67644
  var old = require_old();
@@ -67676,12 +67676,12 @@ var require_dist8 = __commonJS((exports2, module2) => {
67676
67676
  }
67677
67677
  }
67678
67678
  function monkeypatch() {
67679
- fs22.realpath = realpath2;
67680
- fs22.realpathSync = realpathSync;
67679
+ fs24.realpath = realpath2;
67680
+ fs24.realpathSync = realpathSync;
67681
67681
  }
67682
67682
  function unmonkeypatch() {
67683
- fs22.realpath = origRealpath;
67684
- fs22.realpathSync = origRealpathSync;
67683
+ fs24.realpath = origRealpath;
67684
+ fs24.realpathSync = origRealpathSync;
67685
67685
  }
67686
67686
  }
67687
67687
  });
@@ -67907,8 +67907,8 @@ var require_dist8 = __commonJS((exports2, module2) => {
67907
67907
  return new Minimatch(pattern, options).match(p);
67908
67908
  };
67909
67909
  module22.exports = minimatch;
67910
- var path22 = require_path2();
67911
- minimatch.sep = path22.sep;
67910
+ var path24 = require_path2();
67911
+ minimatch.sep = path24.sep;
67912
67912
  var GLOBSTAR = Symbol("globstar **");
67913
67913
  minimatch.GLOBSTAR = GLOBSTAR;
67914
67914
  var expand = require_brace_expansion();
@@ -68399,8 +68399,8 @@ globstar while`, file, fr, pattern, pr, swallowee);
68399
68399
  if (f === "/" && partial)
68400
68400
  return true;
68401
68401
  const options = this.options;
68402
- if (path22.sep !== "/") {
68403
- f = f.split(path22.sep).join("/");
68402
+ if (path24.sep !== "/") {
68403
+ f = f.split(path24.sep).join("/");
68404
68404
  }
68405
68405
  f = f.split(slashSplit);
68406
68406
  this.debug(this.pattern, "split", f);
@@ -68490,10 +68490,10 @@ globstar while`, file, fr, pattern, pr, swallowee);
68490
68490
  function ownProp(obj, field) {
68491
68491
  return Object.prototype.hasOwnProperty.call(obj, field);
68492
68492
  }
68493
- var fs22 = __require("fs");
68494
- var path22 = __require("path");
68493
+ var fs24 = __require("fs");
68494
+ var path24 = __require("path");
68495
68495
  var minimatch = require_minimatch();
68496
- var isAbsolute2 = __require("path").isAbsolute;
68496
+ var isAbsolute3 = __require("path").isAbsolute;
68497
68497
  var Minimatch = minimatch.Minimatch;
68498
68498
  function alphasort(a, b) {
68499
68499
  return a.localeCompare(b, "en");
@@ -68545,7 +68545,7 @@ globstar while`, file, fr, pattern, pr, swallowee);
68545
68545
  self2.stat = !!options.stat;
68546
68546
  self2.noprocess = !!options.noprocess;
68547
68547
  self2.absolute = !!options.absolute;
68548
- self2.fs = options.fs || fs22;
68548
+ self2.fs = options.fs || fs24;
68549
68549
  self2.maxLength = options.maxLength || Infinity;
68550
68550
  self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
68551
68551
  self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
@@ -68554,14 +68554,14 @@ globstar while`, file, fr, pattern, pr, swallowee);
68554
68554
  self2.changedCwd = false;
68555
68555
  var cwd = process.cwd();
68556
68556
  if (!ownProp(options, "cwd"))
68557
- self2.cwd = path22.resolve(cwd);
68557
+ self2.cwd = path24.resolve(cwd);
68558
68558
  else {
68559
- self2.cwd = path22.resolve(options.cwd);
68559
+ self2.cwd = path24.resolve(options.cwd);
68560
68560
  self2.changedCwd = self2.cwd !== cwd;
68561
68561
  }
68562
- self2.root = options.root || path22.resolve(self2.cwd, "/");
68563
- self2.root = path22.resolve(self2.root);
68564
- self2.cwdAbs = isAbsolute2(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
68562
+ self2.root = options.root || path24.resolve(self2.cwd, "/");
68563
+ self2.root = path24.resolve(self2.root);
68564
+ self2.cwdAbs = isAbsolute3(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
68565
68565
  self2.nomount = !!options.nomount;
68566
68566
  if (process.platform === "win32") {
68567
68567
  self2.root = self2.root.replace(/\\/g, "/");
@@ -68643,13 +68643,13 @@ globstar while`, file, fr, pattern, pr, swallowee);
68643
68643
  function makeAbs(self2, f) {
68644
68644
  var abs = f;
68645
68645
  if (f.charAt(0) === "/") {
68646
- abs = path22.join(self2.root, f);
68647
- } else if (isAbsolute2(f) || f === "") {
68646
+ abs = path24.join(self2.root, f);
68647
+ } else if (isAbsolute3(f) || f === "") {
68648
68648
  abs = f;
68649
68649
  } else if (self2.changedCwd) {
68650
- abs = path22.resolve(self2.cwd, f);
68650
+ abs = path24.resolve(self2.cwd, f);
68651
68651
  } else {
68652
- abs = path22.resolve(f);
68652
+ abs = path24.resolve(f);
68653
68653
  }
68654
68654
  if (process.platform === "win32")
68655
68655
  abs = abs.replace(/\\/g, "/");
@@ -68680,9 +68680,9 @@ globstar while`, file, fr, pattern, pr, swallowee);
68680
68680
  var Minimatch = minimatch.Minimatch;
68681
68681
  var Glob = require_glob().Glob;
68682
68682
  var util = __require("util");
68683
- var path22 = __require("path");
68683
+ var path24 = __require("path");
68684
68684
  var assert2 = __require("assert");
68685
- var isAbsolute2 = __require("path").isAbsolute;
68685
+ var isAbsolute3 = __require("path").isAbsolute;
68686
68686
  var common = require_common4();
68687
68687
  var setopts = common.setopts;
68688
68688
  var ownProp = common.ownProp;
@@ -68756,10 +68756,10 @@ See: https://github.com/isaacs/node-glob/issues/167`);
68756
68756
  var read;
68757
68757
  if (prefix === null)
68758
68758
  read = ".";
68759
- else if (isAbsolute2(prefix) || isAbsolute2(pattern.map(function(p) {
68759
+ else if (isAbsolute3(prefix) || isAbsolute3(pattern.map(function(p) {
68760
68760
  return typeof p === "string" ? p : "[*]";
68761
68761
  }).join("/"))) {
68762
- if (!prefix || !isAbsolute2(prefix))
68762
+ if (!prefix || !isAbsolute3(prefix))
68763
68763
  prefix = "/" + prefix;
68764
68764
  read = prefix;
68765
68765
  } else
@@ -68810,7 +68810,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
68810
68810
  e = prefix + e;
68811
68811
  }
68812
68812
  if (e.charAt(0) === "/" && !this.nomount) {
68813
- e = path22.join(this.root, e);
68813
+ e = path24.join(this.root, e);
68814
68814
  }
68815
68815
  this._emitMatch(index, e);
68816
68816
  }
@@ -68956,12 +68956,12 @@ See: https://github.com/isaacs/node-glob/issues/167`);
68956
68956
  this.matches[index] = /* @__PURE__ */ Object.create(null);
68957
68957
  if (!exists)
68958
68958
  return;
68959
- if (prefix && isAbsolute2(prefix) && !this.nomount) {
68959
+ if (prefix && isAbsolute3(prefix) && !this.nomount) {
68960
68960
  var trail = /[\/\\]$/.test(prefix);
68961
68961
  if (prefix.charAt(0) === "/") {
68962
- prefix = path22.join(this.root, prefix);
68962
+ prefix = path24.join(this.root, prefix);
68963
68963
  } else {
68964
- prefix = path22.resolve(this.root, prefix);
68964
+ prefix = path24.resolve(this.root, prefix);
68965
68965
  if (trail)
68966
68966
  prefix += "/";
68967
68967
  }
@@ -69148,9 +69148,9 @@ See: https://github.com/isaacs/node-glob/issues/167`);
69148
69148
  var Minimatch = minimatch.Minimatch;
69149
69149
  var inherits = require_inherits2();
69150
69150
  var EE = __require("events").EventEmitter;
69151
- var path22 = __require("path");
69151
+ var path24 = __require("path");
69152
69152
  var assert2 = __require("assert");
69153
- var isAbsolute2 = __require("path").isAbsolute;
69153
+ var isAbsolute3 = __require("path").isAbsolute;
69154
69154
  var globSync = require_sync7();
69155
69155
  var common = require_common4();
69156
69156
  var setopts = common.setopts;
@@ -69372,10 +69372,10 @@ See: https://github.com/isaacs/node-glob/issues/167`);
69372
69372
  var read;
69373
69373
  if (prefix === null)
69374
69374
  read = ".";
69375
- else if (isAbsolute2(prefix) || isAbsolute2(pattern.map(function(p) {
69375
+ else if (isAbsolute3(prefix) || isAbsolute3(pattern.map(function(p) {
69376
69376
  return typeof p === "string" ? p : "[*]";
69377
69377
  }).join("/"))) {
69378
- if (!prefix || !isAbsolute2(prefix))
69378
+ if (!prefix || !isAbsolute3(prefix))
69379
69379
  prefix = "/" + prefix;
69380
69380
  read = prefix;
69381
69381
  } else
@@ -69431,7 +69431,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
69431
69431
  e = prefix + e;
69432
69432
  }
69433
69433
  if (e.charAt(0) === "/" && !this.nomount) {
69434
- e = path22.join(this.root, e);
69434
+ e = path24.join(this.root, e);
69435
69435
  }
69436
69436
  this._emitMatch(index, e);
69437
69437
  }
@@ -69460,7 +69460,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
69460
69460
  this._emitQueue.push([index, e]);
69461
69461
  return;
69462
69462
  }
69463
- var abs = isAbsolute2(e) ? e : this._makeAbs(e);
69463
+ var abs = isAbsolute3(e) ? e : this._makeAbs(e);
69464
69464
  if (this.mark)
69465
69465
  e = this._mark(e);
69466
69466
  if (this.absolute)
@@ -69615,12 +69615,12 @@ See: https://github.com/isaacs/node-glob/issues/167`);
69615
69615
  this.matches[index] = /* @__PURE__ */ Object.create(null);
69616
69616
  if (!exists)
69617
69617
  return cb();
69618
- if (prefix && isAbsolute2(prefix) && !this.nomount) {
69618
+ if (prefix && isAbsolute3(prefix) && !this.nomount) {
69619
69619
  var trail = /[\/\\]$/.test(prefix);
69620
69620
  if (prefix.charAt(0) === "/") {
69621
- prefix = path22.join(this.root, prefix);
69621
+ prefix = path24.join(this.root, prefix);
69622
69622
  } else {
69623
- prefix = path22.resolve(this.root, prefix);
69623
+ prefix = path24.resolve(this.root, prefix);
69624
69624
  if (trail)
69625
69625
  prefix += "/";
69626
69626
  }
@@ -69697,8 +69697,8 @@ See: https://github.com/isaacs/node-glob/issues/167`);
69697
69697
  "node_modules/glob-promise/lib/index.js"(exports3, module22) {
69698
69698
  var glob2 = require_glob();
69699
69699
  var promise = function(pattern, options) {
69700
- return new Promise((resolve9, reject) => {
69701
- glob2(pattern, options, (err, files) => err === null ? resolve9(files) : reject(err));
69700
+ return new Promise((resolve10, reject) => {
69701
+ glob2(pattern, options, (err, files) => err === null ? resolve10(files) : reject(err));
69702
69702
  });
69703
69703
  };
69704
69704
  module22.exports = promise;
@@ -69804,7 +69804,7 @@ export default {
69804
69804
  }
69805
69805
  case "export-pathlist": {
69806
69806
  return `export default [
69807
- ` + Object.keys(vfs).map((path22) => ` "${path22}"`).join(`,
69807
+ ` + Object.keys(vfs).map((path24) => ` "${path24}"`).join(`,
69808
69808
  `) + `
69809
69809
  ]`;
69810
69810
  }
@@ -72198,7 +72198,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
72198
72198
  import { execSync as execSync2 } from "node:child_process";
72199
72199
  var import_semver2 = __toESM2(require_semver2(), 1);
72200
72200
  // package.json
72201
- var version = "0.1.394";
72201
+ var version = "0.1.395";
72202
72202
  var package_default = {
72203
72203
  name: "@tscircuit/cli",
72204
72204
  version,
@@ -72207,7 +72207,7 @@ var package_default = {
72207
72207
  "@babel/standalone": "^7.26.9",
72208
72208
  "@biomejs/biome": "^1.9.4",
72209
72209
  "@tscircuit/circuit-json-util": "0.0.67",
72210
- "@tscircuit/fake-snippets": "^0.0.110",
72210
+ "@tscircuit/fake-snippets": "^0.0.128",
72211
72211
  "@tscircuit/file-server": "^0.0.32",
72212
72212
  "@tscircuit/math-utils": "0.0.21",
72213
72213
  "@tscircuit/props": "^0.0.371",
@@ -77395,54 +77395,164 @@ var registerConfigPrint = (program3) => {
77395
77395
  };
77396
77396
 
77397
77397
  // cli/clone/register.ts
77398
+ import * as fs23 from "node:fs";
77399
+ import * as path23 from "node:path";
77400
+
77401
+ // cli/clone/clone-bug-report.ts
77402
+ var import_jszip = __toESM2(require_lib4(), 1);
77403
+ import * as fs22 from "node:fs";
77404
+ import * as path22 from "node:path";
77405
+
77406
+ // cli/clone/handle-existing-directory.ts
77407
+ var import_prompts6 = __toESM2(require_prompts3(), 1);
77398
77408
  import * as fs21 from "node:fs";
77399
77409
  import * as path21 from "node:path";
77410
+ var handleExistingDirectory = async (dirPath) => {
77411
+ if (!fs21.existsSync(dirPath))
77412
+ return;
77413
+ const response = await import_prompts6.default({
77414
+ type: "select",
77415
+ name: "action",
77416
+ message: `Directory "${path21.basename(dirPath)}" already exists. What would you like to do?`,
77417
+ choices: [
77418
+ { title: "Merge files into existing directory", value: "merge" },
77419
+ {
77420
+ title: "Delete existing directory and clone fresh",
77421
+ value: "delete"
77422
+ },
77423
+ { title: "Cancel", value: "cancel" }
77424
+ ]
77425
+ });
77426
+ if (!response.action || response.action === "cancel") {
77427
+ console.log("Clone cancelled.");
77428
+ process.exit(0);
77429
+ }
77430
+ if (response.action === "delete") {
77431
+ fs21.rmSync(dirPath, { recursive: true, force: true });
77432
+ console.log(`Deleted existing directory: ${dirPath}`);
77433
+ } else if (response.action === "merge") {
77434
+ console.log(`Merging files into existing directory: ${dirPath}`);
77435
+ }
77436
+ };
77437
+
77438
+ // cli/clone/clone-bug-report.ts
77439
+ var getCommonDirectoryPrefix = (paths) => {
77440
+ if (paths.length === 0)
77441
+ return "";
77442
+ const splitPaths = paths.map((p) => p.split("/").filter(Boolean));
77443
+ const minLength = Math.min(...splitPaths.map((parts) => parts.length === 0 ? 0 : parts.length));
77444
+ const commonSegments = [];
77445
+ for (let i = 0;i < Math.max(0, minLength - 1); i++) {
77446
+ const segment = splitPaths[0][i];
77447
+ if (!segment)
77448
+ break;
77449
+ const allMatch = splitPaths.every((parts) => parts[i] === segment);
77450
+ if (!allMatch)
77451
+ break;
77452
+ commonSegments.push(segment);
77453
+ }
77454
+ return commonSegments.join("/");
77455
+ };
77456
+ var sanitizeRelativePath = (relativePath) => {
77457
+ const normalizedPath = path22.normalize(relativePath);
77458
+ if (!normalizedPath)
77459
+ return null;
77460
+ if (path22.isAbsolute(normalizedPath))
77461
+ return null;
77462
+ const segments = normalizedPath.split(path22.sep);
77463
+ if (segments.some((segment) => segment === ".." || segment === "")) {
77464
+ return null;
77465
+ }
77466
+ return normalizedPath;
77467
+ };
77468
+ var cloneBugReport = async ({
77469
+ bugReportId,
77470
+ originalCwd
77471
+ }) => {
77472
+ const trimmedBugReportId = bugReportId.trim();
77473
+ if (!trimmedBugReportId) {
77474
+ console.error("Bug report ID must not be empty.");
77475
+ process.exit(1);
77476
+ }
77477
+ const dirPath = path22.resolve(`bug-report-${trimmedBugReportId}`);
77478
+ await handleExistingDirectory(dirPath);
77479
+ const ky2 = getRegistryApiKy();
77480
+ let zipBuffer;
77481
+ try {
77482
+ zipBuffer = await ky2.get("bug_reports/download_zip", {
77483
+ searchParams: {
77484
+ bug_report_id: trimmedBugReportId
77485
+ }
77486
+ }).arrayBuffer();
77487
+ } catch (error) {
77488
+ if (typeof error === "object" && error !== null && "status" in error && error.status === 404) {
77489
+ console.error(`Bug report "${trimmedBugReportId}" not found. Please check the ID and try again.`);
77490
+ } else {
77491
+ console.error("Failed to download bug report:", error instanceof Error ? error.message : error);
77492
+ }
77493
+ process.exit(1);
77494
+ }
77495
+ fs22.mkdirSync(dirPath, { recursive: true });
77496
+ const zip = await import_jszip.default.loadAsync(zipBuffer);
77497
+ const fileEntries = Object.entries(zip.files).filter(([, entry]) => !entry.dir);
77498
+ const commonPrefix = getCommonDirectoryPrefix(fileEntries.map(([fileName]) => fileName));
77499
+ for (const [fileName, entry] of fileEntries) {
77500
+ const prefixWithSlash = commonPrefix ? `${commonPrefix}/` : "";
77501
+ const withoutPrefix = fileName.startsWith(prefixWithSlash) ? fileName.slice(prefixWithSlash.length) : fileName;
77502
+ const sanitizedRelativePath = sanitizeRelativePath(withoutPrefix);
77503
+ if (!sanitizedRelativePath) {
77504
+ console.warn(`Skipping potentially unsafe path: ${fileName}`);
77505
+ continue;
77506
+ }
77507
+ const fullPath = path22.join(dirPath, sanitizedRelativePath);
77508
+ fs22.mkdirSync(path22.dirname(fullPath), { recursive: true });
77509
+ const fileContent = await entry.async("nodebuffer");
77510
+ fs22.writeFileSync(fullPath, fileContent);
77511
+ }
77512
+ fs22.writeFileSync(path22.join(dirPath, ".npmrc"), "@tsci:registry=https://npm.tscircuit.com");
77513
+ generateTsConfig(dirPath);
77514
+ await setupTsciProject(dirPath);
77515
+ const relativeDirPath = path22.relative(originalCwd, dirPath);
77516
+ console.log(kleur_default.green(`
77517
+ Successfully cloned bug report to:`));
77518
+ console.log(` ${dirPath}/
77519
+ `);
77520
+ console.log(kleur_default.bold("Start reviewing:"));
77521
+ console.log(kleur_default.cyan(` cd ${relativeDirPath}`));
77522
+ console.log(kleur_default.cyan(` tsci dev
77523
+ `));
77524
+ };
77525
+
77526
+ // cli/clone/register.ts
77400
77527
  var registerClone = (program3) => {
77401
- program3.command("clone").description("Clone a package from the registry").argument("<package>", "Package to clone (e.g. author/packageName or https://tscircuit.com/author/packageName)").option("-a, --include-author", "Include author name in the directory path").action(async (packagePath, options) => {
77402
- const urlMatch = packagePath.match(/^https:\/\/tscircuit\.com\/([^\/]+)\/([^\/]+)\/?$/i);
77403
- const originalMatch = !urlMatch && packagePath.match(/^(?:@tsci\/)?([^/.]+)[/.]([^/.]+)$/);
77528
+ program3.command("clone").description("Clone a package from the registry").argument("[package]", "Package to clone (e.g. author/packageName or https://tscircuit.com/author/packageName)").option("-a, --include-author", "Include author name in the directory path").option("--bug-report <bugReportId>", "Clone a bug report project").action(async (packagePath, options) => {
77404
77529
  const originalCwd = process.cwd();
77405
- if (!urlMatch && !originalMatch) {
77406
- console.error(`Invalid package path "${packagePath}". Accepted formats:
77407
- - author/packageName
77408
- - author.packageName
77409
- - @tsci/author.packageName
77410
- - https://tscircuit.com/author/packageName`);
77530
+ if (options.bugReport) {
77531
+ if (packagePath) {
77532
+ console.warn("Package argument is ignored when --bug-report is provided.");
77533
+ }
77534
+ await cloneBugReport({
77535
+ bugReportId: options.bugReport,
77536
+ originalCwd
77537
+ });
77538
+ return;
77539
+ }
77540
+ if (!packagePath) {
77541
+ console.error("Package argument is required unless --bug-report is provided.");
77411
77542
  process.exit(1);
77412
77543
  }
77544
+ const urlMatch = packagePath.match(/^https:\/\/tscircuit\.com\/([^\/]+)\/([^\/]+)\/?$/i);
77545
+ const originalMatch = !urlMatch && packagePath.match(/^(?:@tsci\/)?([^/.]+)[/.]([^/.]+)$/);
77413
77546
  const match = urlMatch || originalMatch;
77414
- if (!match)
77415
- throw new Error("No valid match found");
77547
+ if (!match) {
77548
+ console.error("Invalid package path. Please use author/packageName or https://tscircuit.com/author/packageName.");
77549
+ process.exit(1);
77550
+ }
77416
77551
  const [, author, packageName] = match;
77417
77552
  console.log(`Cloning ${author}/${packageName}...`);
77418
77553
  const userSettingToIncludeAuthor = options.includeAuthor || cliConfig.get("alwaysCloneWithAuthorName");
77419
- const dirPath = userSettingToIncludeAuthor ? path21.resolve(`${author}.${packageName}`) : path21.resolve(packageName);
77420
- if (fs21.existsSync(dirPath)) {
77421
- const prompts2 = await Promise.resolve().then(() => __toESM2(require_prompts3(), 1));
77422
- const response = await prompts2.default({
77423
- type: "select",
77424
- name: "action",
77425
- message: `Directory "${path21.basename(dirPath)}" already exists. What would you like to do?`,
77426
- choices: [
77427
- { title: "Merge files into existing directory", value: "merge" },
77428
- {
77429
- title: "Delete existing directory and clone fresh",
77430
- value: "delete"
77431
- },
77432
- { title: "Cancel", value: "cancel" }
77433
- ]
77434
- });
77435
- if (!response.action || response.action === "cancel") {
77436
- console.log("Clone cancelled.");
77437
- process.exit(0);
77438
- }
77439
- if (response.action === "delete") {
77440
- fs21.rmSync(dirPath, { recursive: true, force: true });
77441
- console.log(`Deleted existing directory: ${dirPath}`);
77442
- } else if (response.action === "merge") {
77443
- console.log(`Merging files into existing directory: ${dirPath}`);
77444
- }
77445
- }
77554
+ const dirPath = userSettingToIncludeAuthor ? path23.resolve(`${author}.${packageName}`) : path23.resolve(packageName);
77555
+ await handleExistingDirectory(dirPath);
77446
77556
  const ky2 = getRegistryApiKy();
77447
77557
  let packageFileList = {
77448
77558
  package_files: []
@@ -77462,13 +77572,13 @@ var registerClone = (program3) => {
77462
77572
  console.error("Failed to fetch package files:", error instanceof Error ? error.message : error);
77463
77573
  process.exit(1);
77464
77574
  }
77465
- fs21.mkdirSync(dirPath, { recursive: true });
77575
+ fs23.mkdirSync(dirPath, { recursive: true });
77466
77576
  for (const fileInfo of packageFileList.package_files) {
77467
77577
  const filePath = fileInfo.file_path.replace(/^\/|dist\//g, "");
77468
77578
  if (!filePath)
77469
77579
  continue;
77470
- const fullPath = path21.join(dirPath, filePath);
77471
- fs21.mkdirSync(path21.dirname(fullPath), { recursive: true });
77580
+ const fullPath = path23.join(dirPath, filePath);
77581
+ fs23.mkdirSync(path23.dirname(fullPath), { recursive: true });
77472
77582
  try {
77473
77583
  const fileContent = await ky2.get("package_files/get", {
77474
77584
  searchParams: {
@@ -77477,15 +77587,15 @@ var registerClone = (program3) => {
77477
77587
  file_path: fileInfo.file_path
77478
77588
  }
77479
77589
  }).json();
77480
- fs21.writeFileSync(fullPath, fileContent.package_file.content_text);
77590
+ fs23.writeFileSync(fullPath, fileContent.package_file.content_text);
77481
77591
  } catch (error) {
77482
77592
  console.warn(`Skipping ${filePath} due to error:`, error instanceof Error ? error.message : error);
77483
77593
  }
77484
77594
  }
77485
- fs21.writeFileSync(path21.join(dirPath, ".npmrc"), "@tsci:registry=https://npm.tscircuit.com");
77595
+ fs23.writeFileSync(path23.join(dirPath, ".npmrc"), "@tsci:registry=https://npm.tscircuit.com");
77486
77596
  generateTsConfig(dirPath);
77487
- setupTsciProject(dirPath);
77488
- const relativeDirPath = path21.relative(originalCwd, dirPath);
77597
+ await setupTsciProject(dirPath);
77598
+ const relativeDirPath = path23.relative(originalCwd, dirPath);
77489
77599
  console.log(kleur_default.green(`
77490
77600
  Successfully cloned to:`));
77491
77601
  console.log(` ${dirPath}/
@@ -77501,8 +77611,8 @@ Successfully cloned to:`));
77501
77611
  var import_perfect_cli = __toESM2(require_dist7(), 1);
77502
77612
 
77503
77613
  // lib/shared/export-snippet.ts
77504
- import fs23 from "node:fs";
77505
- import path23 from "node:path";
77614
+ import fs25 from "node:fs";
77615
+ import path25 from "node:path";
77506
77616
  import { promisify as promisify3 } from "node:util";
77507
77617
 
77508
77618
  // node_modules/circuit-json-to-readable-netlist/dist/index.js
@@ -78681,9 +78791,9 @@ var stringifyDsnJson = (dsnJson) => {
78681
78791
  const stringifyCoordinates = (coordinates) => {
78682
78792
  return coordinates.join(" ");
78683
78793
  };
78684
- const stringifyPath = (path22, level) => {
78794
+ const stringifyPath = (path24, level) => {
78685
78795
  const padding = indent.repeat(level);
78686
- return `${padding}(path ${path22.layer} ${path22.width} ${stringifyCoordinates(path22.coordinates)})`;
78796
+ return `${padding}(path ${path24.layer} ${path24.width} ${stringifyCoordinates(path24.coordinates)})`;
78687
78797
  };
78688
78798
  result += `(pcb ${dsnJson.filename ? dsnJson.filename : "./converted_dsn.dsn"}
78689
78799
  `;
@@ -81863,8 +81973,8 @@ var SymbolInstancesProject = class _SymbolInstancesProject extends SxClass {
81863
81973
  }
81864
81974
  getString() {
81865
81975
  const lines = [`(project ${quoteSExprString(this.name)}`];
81866
- for (const path22 of this.paths) {
81867
- lines.push(path22.getStringIndented());
81976
+ for (const path24 of this.paths) {
81977
+ lines.push(path24.getStringIndented());
81868
81978
  }
81869
81979
  lines.push(")");
81870
81980
  return lines.join(`
@@ -81886,11 +81996,11 @@ var SymbolInstancePath = class _SymbolInstancePath extends SxClass {
81886
81996
  static fromSexprPrimitives(primitiveSexprs) {
81887
81997
  const [pathPrimitive, ...rest] = primitiveSexprs;
81888
81998
  const value = toStringValue(pathPrimitive) ?? "";
81889
- const path22 = new _SymbolInstancePath(value);
81999
+ const path24 = new _SymbolInstancePath(value);
81890
82000
  const { propertyMap } = SxClass.parsePrimitivesToClassProperties(rest, this.token);
81891
- path22._sxReference = propertyMap.reference;
81892
- path22._sxUnit = propertyMap.unit;
81893
- return path22;
82001
+ path24._sxReference = propertyMap.reference;
82002
+ path24._sxUnit = propertyMap.unit;
82003
+ return path24;
81894
82004
  }
81895
82005
  get reference() {
81896
82006
  return this._sxReference?.value;
@@ -82937,8 +83047,8 @@ var SheetInstancesRootPath = class _SheetInstancesRootPath extends SxClass {
82937
83047
  if (value === undefined) {
82938
83048
  throw new Error("sheet_instances path requires a string identifier");
82939
83049
  }
82940
- const path22 = new _SheetInstancesRootPath;
82941
- path22._value = value;
83050
+ const path24 = new _SheetInstancesRootPath;
83051
+ path24._value = value;
82942
83052
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rest, "sheet_instances_path");
82943
83053
  const unsupportedSingularTokens = Object.keys(propertyMap).filter((token) => !SUPPORTED_ARRAY_TOKENS2.has(token));
82944
83054
  if (unsupportedSingularTokens.length > 0) {
@@ -82952,8 +83062,8 @@ var SheetInstancesRootPath = class _SheetInstancesRootPath extends SxClass {
82952
83062
  if (!pages.length && propertyMap.page) {
82953
83063
  pages.push(propertyMap.page);
82954
83064
  }
82955
- path22._pages = pages;
82956
- return path22;
83065
+ path24._pages = pages;
83066
+ return path24;
82957
83067
  }
82958
83068
  get value() {
82959
83069
  return this._value;
@@ -83101,8 +83211,8 @@ var SheetInstancesProject = class _SheetInstancesProject extends SxClass {
83101
83211
  }
83102
83212
  getString() {
83103
83213
  const lines = [`(project ${quoteSExprString(this.name)}`];
83104
- for (const path22 of this.paths) {
83105
- lines.push(path22.getStringIndented());
83214
+ for (const path24 of this.paths) {
83215
+ lines.push(path24.getStringIndented());
83106
83216
  }
83107
83217
  lines.push(")");
83108
83218
  return lines.join(`
@@ -83126,10 +83236,10 @@ var SheetInstancePath = class _SheetInstancePath extends SxClass {
83126
83236
  if (value === undefined) {
83127
83237
  throw new Error("sheet instance path value must be a string");
83128
83238
  }
83129
- const path22 = new _SheetInstancePath(value);
83239
+ const path24 = new _SheetInstancePath(value);
83130
83240
  const { arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rest, "sheet_path");
83131
- path22.pages = arrayPropertyMap.page ?? [];
83132
- return path22;
83241
+ path24.pages = arrayPropertyMap.page ?? [];
83242
+ return path24;
83133
83243
  }
83134
83244
  getChildren() {
83135
83245
  return [...this.pages];
@@ -88367,20 +88477,20 @@ var FootprintModel = class _FootprintModel extends SxClass {
88367
88477
  _offset;
88368
88478
  _scale;
88369
88479
  _rotate;
88370
- constructor(path22) {
88480
+ constructor(path24) {
88371
88481
  super();
88372
- this._path = path22;
88482
+ this._path = path24;
88373
88483
  }
88374
88484
  static fromSexprPrimitives(primitiveSexprs) {
88375
88485
  if (primitiveSexprs.length === 0) {
88376
88486
  throw new Error("model requires a path argument");
88377
88487
  }
88378
88488
  const [rawPath, ...rest] = primitiveSexprs;
88379
- const path22 = toStringValue(rawPath);
88380
- if (path22 === undefined) {
88489
+ const path24 = toStringValue(rawPath);
88490
+ if (path24 === undefined) {
88381
88491
  throw new Error("model path must be a string value");
88382
88492
  }
88383
- const model = new _FootprintModel(path22);
88493
+ const model = new _FootprintModel(path24);
88384
88494
  for (const primitive of rest) {
88385
88495
  if (!Array.isArray(primitive) || primitive.length === 0) {
88386
88496
  throw new Error(`model encountered invalid child expression: ${JSON.stringify(primitive)}`);
@@ -93065,10 +93175,10 @@ var AddSchematicSymbolsStage = class extends ConverterStage {
93065
93175
  }
93066
93176
  const instances = new SymbolInstances;
93067
93177
  const project = new SymbolInstancesProject("");
93068
- const path22 = new SymbolInstancePath(`/${kicadSch?.uuid?.value || ""}`);
93069
- path22.reference = reference;
93070
- path22.unit = 1;
93071
- project.paths.push(path22);
93178
+ const path24 = new SymbolInstancePath(`/${kicadSch?.uuid?.value || ""}`);
93179
+ path24.reference = reference;
93180
+ path24.unit = 1;
93181
+ project.paths.push(path24);
93072
93182
  instances.projects.push(project);
93073
93183
  symbol._sxInstances = instances;
93074
93184
  symbols3.push(symbol);
@@ -93276,11 +93386,11 @@ var AddSheetInstancesStage = class extends ConverterStage {
93276
93386
  throw new Error("KicadSch instance not initialized in context");
93277
93387
  }
93278
93388
  const sheetInstances = new SheetInstances;
93279
- const path22 = new SheetInstancesRootPath;
93280
- path22.value = "/";
93389
+ const path24 = new SheetInstancesRootPath;
93390
+ path24.value = "/";
93281
93391
  const page = new SheetInstancesRootPage("1");
93282
- path22.pages = [page];
93283
- sheetInstances.paths = [path22];
93392
+ path24.pages = [page];
93393
+ sheetInstances.paths = [path24];
93284
93394
  kicadSch.sheetInstances = sheetInstances;
93285
93395
  kicadSch.embeddedFonts = new EmbeddedFonts(false);
93286
93396
  this.finished = true;
@@ -93635,12 +93745,12 @@ var AddGraphicsStage = class extends ConverterStage {
93635
93745
  throw new Error("PCB transformation matrix not initialized in context");
93636
93746
  }
93637
93747
  const pcbSilkscreenPaths = this.ctx.db.pcb_silkscreen_path?.list() || [];
93638
- for (const path22 of pcbSilkscreenPaths) {
93639
- if (!path22.route || path22.route.length < 2)
93748
+ for (const path24 of pcbSilkscreenPaths) {
93749
+ if (!path24.route || path24.route.length < 2)
93640
93750
  continue;
93641
- for (let i = 0;i < path22.route.length - 1; i++) {
93642
- const startPoint = path22.route[i];
93643
- const endPoint = path22.route[i + 1];
93751
+ for (let i = 0;i < path24.route.length - 1; i++) {
93752
+ const startPoint = path24.route[i];
93753
+ const endPoint = path24.route[i + 1];
93644
93754
  if (!startPoint || !endPoint)
93645
93755
  continue;
93646
93756
  const transformedStart = applyToPoint62(c2kMatPcb, {
@@ -93655,12 +93765,12 @@ var AddGraphicsStage = class extends ConverterStage {
93655
93765
  top: "F.SilkS",
93656
93766
  bottom: "B.SilkS"
93657
93767
  };
93658
- const kicadLayer = layerMap[path22.layer] || path22.layer || "F.SilkS";
93768
+ const kicadLayer = layerMap[path24.layer] || path24.layer || "F.SilkS";
93659
93769
  const grLine = new GrLine({
93660
93770
  start: { x: transformedStart.x, y: transformedStart.y },
93661
93771
  end: { x: transformedEnd.x, y: transformedEnd.y },
93662
93772
  layer: kicadLayer,
93663
- width: path22.stroke_width || 0.15
93773
+ width: path24.stroke_width || 0.15
93664
93774
  });
93665
93775
  const graphicLines = kicadPcb.graphicLines;
93666
93776
  graphicLines.push(grLine);
@@ -93764,13 +93874,13 @@ var CircuitJsonToKicadPcbConverter = class {
93764
93874
  };
93765
93875
 
93766
93876
  // lib/shared/export-snippet.ts
93767
- var import_jszip = __toESM2(require_lib4(), 1);
93877
+ var import_jszip2 = __toESM2(require_lib4(), 1);
93768
93878
 
93769
93879
  // lib/shared/generate-circuit-json.tsx
93770
93880
  var import_make_vfs2 = __toESM2(require_dist8(), 1);
93771
- import path22 from "node:path/posix";
93772
- import { relative as relative8 } from "node:path";
93773
- import fs22 from "node:fs";
93881
+ import path24 from "node:path/posix";
93882
+ import { relative as relative9 } from "node:path";
93883
+ import fs24 from "node:fs";
93774
93884
  import Debug11 from "debug";
93775
93885
 
93776
93886
  // lib/utils/abbreviate-stringify-object.ts
@@ -93788,10 +93898,10 @@ var abbreviateStringifyObject = (obj) => {
93788
93898
  };
93789
93899
 
93790
93900
  // lib/shared/importFromUserLand.ts
93791
- import { resolve as resolve9 } from "node:path";
93901
+ import { resolve as resolve10 } from "node:path";
93792
93902
  async function importFromUserLand(moduleName) {
93793
93903
  try {
93794
- const resolvedPath = import.meta.resolve(moduleName, resolve9(process.cwd(), "dummy.js"));
93904
+ const resolvedPath = import.meta.resolve(moduleName, resolve10(process.cwd(), "dummy.js"));
93795
93905
  return await import(resolvedPath);
93796
93906
  } catch (error) {
93797
93907
  try {
@@ -93829,11 +93939,11 @@ async function generateCircuitJson({
93829
93939
  const runner = new userLandTscircuit.RootCircuit({
93830
93940
  platform: platformConfig
93831
93941
  });
93832
- const projectDir = path22.dirname(filePath);
93942
+ const projectDir = path24.dirname(filePath);
93833
93943
  const resolvedOutputDir = outputDir || projectDir;
93834
- const relativeComponentPath = relative8(projectDir, filePath);
93835
- const baseFileName = outputFileName || path22.basename(filePath).replace(/\.[^.]+$/, "");
93836
- const outputPath = path22.join(resolvedOutputDir, `${baseFileName}.circuit.json`);
93944
+ const relativeComponentPath = relative9(projectDir, filePath);
93945
+ const baseFileName = outputFileName || path24.basename(filePath).replace(/\.[^.]+$/, "");
93946
+ const outputPath = path24.join(resolvedOutputDir, `${baseFileName}.circuit.json`);
93837
93947
  debug11(`Project directory: ${projectDir}`);
93838
93948
  debug11(`Relative component path: ${relativeComponentPath}`);
93839
93949
  debug11(`Output path: ${outputPath}`);
@@ -93849,7 +93959,7 @@ async function generateCircuitJson({
93849
93959
  return false;
93850
93960
  if (filePath2.match(/^\.[^\/]/))
93851
93961
  return false;
93852
- if (!ALLOWED_FILE_EXTENSIONS.includes(path22.extname(filePath2)))
93962
+ if (!ALLOWED_FILE_EXTENSIONS.includes(path24.extname(filePath2)))
93853
93963
  return false;
93854
93964
  return true;
93855
93965
  },
@@ -93857,7 +93967,7 @@ async function generateCircuitJson({
93857
93967
  })
93858
93968
  };
93859
93969
  debug11(`fsMap: ${abbreviateStringifyObject(fsMap)}`);
93860
- const resolvedFilePath = path22.resolve(process.cwd(), filePath);
93970
+ const resolvedFilePath = path24.resolve(process.cwd(), filePath);
93861
93971
  const MainComponent = await import(resolvedFilePath);
93862
93972
  const Component = MainComponent.default || (Object.keys(MainComponent).find((k) => k[0] === k[0].toUpperCase()) !== undefined ? MainComponent[Object.keys(MainComponent).find((k) => k[0] === k[0].toUpperCase())] : undefined);
93863
93973
  if (!Component) {
@@ -93868,7 +93978,7 @@ async function generateCircuitJson({
93868
93978
  const circuitJson = await runner.getCircuitJson();
93869
93979
  if (saveToFile) {
93870
93980
  debug11(`Saving circuit JSON to ${outputPath}`);
93871
- fs22.writeFileSync(outputPath, JSON.stringify(circuitJson, null, 2));
93981
+ fs24.writeFileSync(outputPath, JSON.stringify(circuitJson, null, 2));
93872
93982
  }
93873
93983
  return {
93874
93984
  circuitJson,
@@ -93877,7 +93987,7 @@ async function generateCircuitJson({
93877
93987
  }
93878
93988
 
93879
93989
  // lib/shared/export-snippet.ts
93880
- var writeFileAsync = promisify3(fs23.writeFile);
93990
+ var writeFileAsync = promisify3(fs25.writeFile);
93881
93991
  var ALLOWED_FORMATS = [
93882
93992
  "json",
93883
93993
  "circuit-json",
@@ -93920,10 +94030,10 @@ var exportSnippet = async ({
93920
94030
  onError(`Invalid format: ${format}`);
93921
94031
  return onExit(1);
93922
94032
  }
93923
- const projectDir = path23.dirname(filePath);
93924
- const outputBaseName = path23.basename(filePath).replace(/\.[^.]+$/, "");
94033
+ const projectDir = path25.dirname(filePath);
94034
+ const outputBaseName = path25.basename(filePath).replace(/\.[^.]+$/, "");
93925
94035
  const outputFileName = `${outputBaseName}${OUTPUT_EXTENSIONS[format]}`;
93926
- const outputDestination = path23.join(projectDir, outputPath ?? outputFileName);
94036
+ const outputDestination = path25.join(projectDir, outputPath ?? outputFileName);
93927
94037
  const circuitData = await generateCircuitJson({
93928
94038
  filePath,
93929
94039
  saveToFile: format === "circuit-json",
@@ -93975,7 +94085,7 @@ var exportSnippet = async ({
93975
94085
  schConverter.runUntilFinished();
93976
94086
  const pcbConverter = new CircuitJsonToKicadPcbConverter(circuitData.circuitJson);
93977
94087
  pcbConverter.runUntilFinished();
93978
- const zip = new import_jszip.default;
94088
+ const zip = new import_jszip2.default;
93979
94089
  zip.file(`${outputBaseName}.kicad_sch`, schConverter.getOutputString());
93980
94090
  zip.file(`${outputBaseName}.kicad_pcb`, pcbConverter.getOutputString());
93981
94091
  outputContent = await zip.generateAsync({ type: "nodebuffer" });
@@ -94107,12 +94217,12 @@ var getSpiceWithPaddedSim = (circuitJson, options) => {
94107
94217
  };
94108
94218
 
94109
94219
  // lib/eecircuit-engine/run-simulation.ts
94110
- import { promises as fs24, existsSync as existsSync9 } from "node:fs";
94111
- import path24 from "node:path";
94220
+ import { promises as fs26, existsSync as existsSync9 } from "node:fs";
94221
+ import path26 from "node:path";
94112
94222
  import os3 from "node:os";
94113
94223
  var sim = null;
94114
94224
  var fetchSimulation = async () => {
94115
- const tempFilePath = path24.join(os3.tmpdir(), "eecircuit-engine-1.5.2.mjs");
94225
+ const tempFilePath = path26.join(os3.tmpdir(), "eecircuit-engine-1.5.2.mjs");
94116
94226
  if (!existsSync9(tempFilePath)) {
94117
94227
  const url = "https://cdn.jsdelivr.net/npm/eecircuit-engine@1.5.2/+esm";
94118
94228
  const response = await fetch(url);
@@ -94120,7 +94230,7 @@ var fetchSimulation = async () => {
94120
94230
  throw new Error(`Failed to fetch eecircuit-engine from ${url}: ${response.statusText}`);
94121
94231
  }
94122
94232
  const scriptContent = await response.text();
94123
- await fs24.writeFile(tempFilePath, scriptContent);
94233
+ await fs26.writeFile(tempFilePath, scriptContent);
94124
94234
  }
94125
94235
  const module2 = await import(tempFilePath);
94126
94236
  return module2.Simulation;
@@ -94147,7 +94257,7 @@ var initializeSimulation = async () => {
94147
94257
  }
94148
94258
  throw new Error("Simulation engine initialization timed out.");
94149
94259
  }
94150
- await new Promise((resolve10) => setTimeout(resolve10, 200));
94260
+ await new Promise((resolve11) => setTimeout(resolve11, 200));
94151
94261
  }
94152
94262
  };
94153
94263
  var runSimulation = async (spiceString) => {
@@ -94209,8 +94319,8 @@ var resultToCsv = (result) => {
94209
94319
  };
94210
94320
 
94211
94321
  // cli/export/register.ts
94212
- import path25 from "node:path";
94213
- import { promises as fs25 } from "node:fs";
94322
+ import path27 from "node:path";
94323
+ import { promises as fs27 } from "node:fs";
94214
94324
  var registerExport = (program3) => {
94215
94325
  program3.command("export").description("Export tscircuit code to various formats").argument("<file>", "Path to the package file").option("-f, --format <format>", "Output format").option("-o, --output <path>", "Output file path").option("--disable-parts-engine", "Disable the parts engine").action(async (file, options) => {
94216
94326
  const formatOption = options.format ?? "json";
@@ -94222,12 +94332,12 @@ var registerExport = (program3) => {
94222
94332
  });
94223
94333
  if (circuitJson) {
94224
94334
  const spiceString = getSpiceWithPaddedSim(circuitJson);
94225
- const outputSpicePath = options.output ?? path25.join(path25.dirname(file), `${path25.basename(file, path25.extname(file))}.spice.cir`);
94226
- await fs25.writeFile(outputSpicePath, spiceString);
94335
+ const outputSpicePath = options.output ?? path27.join(path27.dirname(file), `${path27.basename(file, path27.extname(file))}.spice.cir`);
94336
+ await fs27.writeFile(outputSpicePath, spiceString);
94227
94337
  const { result } = await runSimulation(spiceString);
94228
94338
  const csvContent = resultToCsv(result);
94229
94339
  const outputCsvPath = outputSpicePath.replace(/\.spice\.cir$/, ".csv");
94230
- await fs25.writeFile(outputCsvPath, csvContent);
94340
+ await fs27.writeFile(outputCsvPath, csvContent);
94231
94341
  console.log(`Exported to ${outputSpicePath} and ${outputCsvPath} (simulation results)!`);
94232
94342
  }
94233
94343
  return;
@@ -94459,14 +94569,14 @@ class KeyStore {
94459
94569
  }
94460
94570
  }
94461
94571
  function createKey(key) {
94462
- let path26 = null;
94572
+ let path28 = null;
94463
94573
  let id = null;
94464
94574
  let src = null;
94465
94575
  let weight = 1;
94466
94576
  let getFn = null;
94467
94577
  if (isString2(key) || isArray(key)) {
94468
94578
  src = key;
94469
- path26 = createKeyPath(key);
94579
+ path28 = createKeyPath(key);
94470
94580
  id = createKeyId(key);
94471
94581
  } else {
94472
94582
  if (!hasOwn.call(key, "name")) {
@@ -94480,11 +94590,11 @@ function createKey(key) {
94480
94590
  throw new Error(INVALID_KEY_WEIGHT_VALUE(name));
94481
94591
  }
94482
94592
  }
94483
- path26 = createKeyPath(name);
94593
+ path28 = createKeyPath(name);
94484
94594
  id = createKeyId(name);
94485
94595
  getFn = key.getFn;
94486
94596
  }
94487
- return { path: path26, id, weight, src, getFn };
94597
+ return { path: path28, id, weight, src, getFn };
94488
94598
  }
94489
94599
  function createKeyPath(key) {
94490
94600
  return isArray(key) ? key : key.split(".");
@@ -94492,34 +94602,34 @@ function createKeyPath(key) {
94492
94602
  function createKeyId(key) {
94493
94603
  return isArray(key) ? key.join(".") : key;
94494
94604
  }
94495
- function get(obj, path26) {
94605
+ function get(obj, path28) {
94496
94606
  let list = [];
94497
94607
  let arr = false;
94498
- const deepGet = (obj2, path27, index) => {
94608
+ const deepGet = (obj2, path29, index) => {
94499
94609
  if (!isDefined(obj2)) {
94500
94610
  return;
94501
94611
  }
94502
- if (!path27[index]) {
94612
+ if (!path29[index]) {
94503
94613
  list.push(obj2);
94504
94614
  } else {
94505
- let key = path27[index];
94615
+ let key = path29[index];
94506
94616
  const value = obj2[key];
94507
94617
  if (!isDefined(value)) {
94508
94618
  return;
94509
94619
  }
94510
- if (index === path27.length - 1 && (isString2(value) || isNumber(value) || isBoolean(value))) {
94620
+ if (index === path29.length - 1 && (isString2(value) || isNumber(value) || isBoolean(value))) {
94511
94621
  list.push(toString(value));
94512
94622
  } else if (isArray(value)) {
94513
94623
  arr = true;
94514
94624
  for (let i = 0, len = value.length;i < len; i += 1) {
94515
- deepGet(value[i], path27, index + 1);
94625
+ deepGet(value[i], path29, index + 1);
94516
94626
  }
94517
- } else if (path27.length) {
94518
- deepGet(value, path27, index + 1);
94627
+ } else if (path29.length) {
94628
+ deepGet(value, path29, index + 1);
94519
94629
  }
94520
94630
  }
94521
94631
  };
94522
- deepGet(obj, isString2(path26) ? path26.split(".") : path26, 0);
94632
+ deepGet(obj, isString2(path28) ? path28.split(".") : path28, 0);
94523
94633
  return arr ? list : list[0];
94524
94634
  }
94525
94635
  var MatchOptions = {
@@ -95711,8 +95821,8 @@ var registerSearch = (program3) => {
95711
95821
  }
95712
95822
  if (kicadResults.length) {
95713
95823
  console.log(kleur_default.bold().underline(`Found ${kicadResults.length} footprint(s) from KiCad:`));
95714
- kicadResults.forEach((path26, idx) => {
95715
- console.log(`${(idx + 1).toString().padStart(2, " ")}. kicad:${path26.replace(".kicad_mod", "").replace(".pretty", "")}`);
95824
+ kicadResults.forEach((path28, idx) => {
95825
+ console.log(`${(idx + 1).toString().padStart(2, " ")}. kicad:${path28.replace(".kicad_mod", "").replace(".pretty", "")}`);
95716
95826
  });
95717
95827
  }
95718
95828
  if (!onlyKicad && results.packages.length) {
@@ -96595,10 +96705,10 @@ var require_svgson_umd = __commonJS2({
96595
96705
  for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
96596
96706
  args[_key] = arguments[_key];
96597
96707
  }
96598
- return new Promise(function(resolve10, reject) {
96708
+ return new Promise(function(resolve11, reject) {
96599
96709
  try {
96600
96710
  var res = svgsonSync.apply(undefined, args);
96601
- resolve10(res);
96711
+ resolve11(res);
96602
96712
  } catch (e3) {
96603
96713
  reject(e3);
96604
96714
  }
@@ -100890,7 +101000,7 @@ var { paths: Ad, bounds: ss, refblocks: Pd } = xs;
100890
101000
  var U = e({ primitives: [...Object.values(Ad)], ports: [{ ...Pd.left1, labels: ["1"] }], center: { x: ss.centerX, y: ss.centerY } }).rotateRightFacingSymbol("right").labelPort("left1", ["1"]).build();
100891
101001
  var ms = r(U, "down");
100892
101002
  var ns = r(U, "left");
100893
- var fs26 = r(U, "up");
101003
+ var fs28 = r(U, "up");
100894
101004
  var g = { paths: { path11: { type: "path", points: [{ x: -0.39, y: 0 }, { x: 0.06, y: -0.01 }], color: "primary", fill: false }, "path40-0": { type: "path", points: [{ x: 0.07, y: 0.27 }, { x: 0.07, y: -0.28 }], color: "primary", fill: false }, "path40-0-5": { type: "path", points: [{ x: 0.28, y: 0.24 }, { x: 0.08, y: 0.11 }], color: "primary", fill: false }, "path40-0-5-0": { type: "path", points: [{ x: 0.29, y: -0.24 }, { x: 0.09, y: -0.11 }], color: "primary", fill: false }, "path12-1-5": { type: "path", points: [{ x: 0.29, y: 0.25 }, { x: 0.29, y: 0.54 }], color: "primary", fill: false }, "path12-1-5-3": { type: "path", points: [{ x: 0.29, y: -0.54 }, { x: 0.29, y: -0.25 }], color: "primary", fill: false }, path15: { type: "path", points: [{ x: 0.19, y: -0.1 }, { x: 0.12, y: -0.2 }, { x: 0.22, y: -0.2 }, { x: 0.19, y: -0.1 }], color: "primary", fill: true } }, texts: { top1: { type: "text", text: "{REF}", x: -0.08, y: 0.36 }, bottom1: { type: "text", text: "{VAL}", x: -0.07, y: -0.41 } }, refblocks: { top1: { x: 0.29, y: 0.55 }, bottom1: { x: 0.29, y: -0.55 }, left1: { x: -0.4, y: 0 } }, bounds: { minX: -0.43, maxX: 0.43, minY: -0.58, maxY: 0.58, width: 0.85, height: 1.16, centerX: 0, centerY: 0 }, circles: { "path1-0": { type: "circle", x: 0.14, y: 0, radius: 0.29, color: "primary", fill: false } } };
100895
101005
  var { paths: Fd, texts: XA, bounds: e0, refblocks: Mo, circles: Rd } = g;
100896
101006
  var hs = e({ primitives: [...Object.values(Fd), ...Object.values(Rd), { type: "text", text: "{REF}", x: -0.1, y: 0.3094553499999995 }, { type: "text", text: "{VAL}", x: -0.1, y: -0.3094553499999995 }], ports: [{ ...Mo.top1, labels: ["1", "collector"] }, { ...Mo.bottom1, labels: ["2", "emitter"] }, { ...Mo.left1, labels: ["3", "base"] }], size: { width: e0.width, height: e0.height }, center: { x: e0.centerX, y: e0.centerY } }).rotateRightFacingSymbol("right").changeTextAnchor("{REF}", "middle_right").changeTextAnchor("{VAL}", "middle_right").build();
@@ -101459,7 +101569,7 @@ var mb = Cl.primitives.find((t3) => t3.type === "text" && t3.text === "{VAL}");
101459
101569
  sb.anchor = "middle_left";
101460
101570
  mb.anchor = "middle_right";
101461
101571
  var B1 = Cl;
101462
- var q1 = { ac_voltmeter_down: Ul, ac_voltmeter_horz: Wl, ac_voltmeter_left: Zl, ac_voltmeter_right: Kl, ac_voltmeter_up: ep, ac_voltmeter_vert: op, avalanche_diode_down: lp, avalanche_diode_horz: pp, avalanche_diode_left: yp, avalanche_diode_right: xp, avalanche_diode_up: mp, avalanche_diode_vert: fp, backward_diode_down: cp, backward_diode_left: Dt, backward_diode_right: _p, backward_diode_up: gp, battery_horz: Wt, battery_vert: Ap, boxresistor_down: Fp, boxresistor_left: Ep, boxresistor_right: Lp, boxresistor_small_down: jp, boxresistor_small_left: zp, boxresistor_small_right: Jp, boxresistor_small_up: Mp, boxresistor_up: Ip, bridged_ground_down: Dp, bridged_ground_left: Wp, bridged_ground_right: te, bridged_ground_up: Qp, capacitor_down: ta, capacitor_left: ea, capacitor_polarized_down: oa, capacitor_polarized_left: ia, capacitor_polarized_right: pa, capacitor_polarized_up: ya, capacitor_right: xa, capacitor_up: ma, constant_current_diode_down: fa, constant_current_diode_horz: ha, constant_current_diode_left: da, constant_current_diode_right: ba, constant_current_diode_up: ga, constant_current_diode_vert: va, crystal_4pin_down: wa, crystal_4pin_left: Aa, crystal_4pin_right: Pa, crystal_4pin_up: Sa, crystal_down: Ra, crystal_left: Ta, crystal_right: Ea, crystal_up: Xa, darlington_pair_transistor_down: La, darlington_pair_transistor_horz: Va, darlington_pair_transistor_left: ja, darlington_pair_transistor_right: ka, darlington_pair_transistor_up: za, darlington_pair_transistor_vert: Oa, dc_ammeter_horz: wt, dc_ammeter_vert: Ca, dc_voltmeter_down: Ia, dc_voltmeter_horz: qa, dc_voltmeter_left: Ua, dc_voltmeter_right: Wa, dc_voltmeter_up: Za, dc_voltmeter_vert: Ka, diac_down: ty, diac_horz: ey, diac_left: ry, diac_right: oy, diac_up: iy, diac_vert: ly, diode_down: ay, diode_left: yy, diode_right: $2, diode_up: xy, dpdt_normally_closed_switch_down: my, dpdt_normally_closed_switch_left: ny, dpdt_normally_closed_switch_right: M, dpdt_normally_closed_switch_up: fy, dpdt_switch_down: cy, dpdt_switch_left: dy, dpdt_switch_right: C, dpdt_switch_up: by, dpst_normally_closed_switch_down: gy, dpst_normally_closed_switch_left: uy, dpst_normally_closed_switch_right: N, dpst_normally_closed_switch_up: vy, dpst_switch_down: Ay, dpst_switch_left: Py, dpst_switch_right: I, dpst_switch_up: Sy, ferrite_bead_down: Ry, ferrite_bead_left: Ty, ferrite_bead_right: Fe, ferrite_bead_up: Se, filled_diode_down: Yy, filled_diode_horz: Ly, filled_diode_left: jy, filled_diode_right: zy, filled_diode_up: Jy, filled_diode_vert: My, frequency_meter_horz: At2, frequency_meter_vert: By, fuse_horz: ke, fuse_vert: Uy, ground_down: Gy, ground_horz: Wy, ground_left: Hy, ground_right: Zy, ground_up: Qy, ground_vert: Ky2, ground2_down: ex, ground2_left: ox, ground2_right: lx, ground2_up: ax, gunn_diode_horz: yx, gunn_diode_vert: xx, icled_down: mx, icled_left: nx, icled_right: q, icled_up: fx, igbt_transistor_horz: ze, igbt_transistor_vert: dx, illuminated_push_button_normally_open_horz: Oe, illuminated_push_button_normally_open_vert: ux, inductor_down: Px, inductor_left: Sx, inductor_right: _t, inductor_up: $e, laser_diode_down: Fx, laser_diode_left: Rx, laser_diode_right: D, laser_diode_up: Tx, led_down: Lx, led_left: Vx, led_right: gt, led_up: Ce, light_dependent_resistor_horz: Ie, light_dependent_resistor_vert: $x, mosfet_depletion_normally_on_horz: qe, mosfet_depletion_normally_on_vert: Ix, mushroom_head_normally_open_momentary_horz: Ue, mushroom_head_normally_open_momentary_vert: Ux, n_channel_d_mosfet_transistor_horz: He, n_channel_d_mosfet_transistor_vert: Qx, n_channel_e_mosfet_transistor_horz: Qe, n_channel_e_mosfet_transistor_vert: os4, njfet_transistor_horz: t0, njfet_transistor_vert: ys, not_connected_down: ms, not_connected_left: ns, not_connected_right: U, not_connected_up: fs26, npn_bipolar_transistor_down: hs, npn_bipolar_transistor_horz: cs, npn_bipolar_transistor_left: ds, npn_bipolar_transistor_right: bs, npn_bipolar_transistor_up: _s, npn_bipolar_transistor_vert: gs, opamp_no_power_down: vs, opamp_no_power_left: ws, opamp_no_power_right: G, opamp_no_power_up: As, opamp_with_power_down: Ss, opamp_with_power_left: Fs, opamp_with_power_right: W, opamp_with_power_up: Rs, p_channel_d_mosfet_transistor_horz: a0, p_channel_d_mosfet_transistor_vert: Ls, p_channel_e_mosfet_transistor_horz: x0, p_channel_e_mosfet_transistor_vert: Os, photodiode_horz: s0, photodiode_vert: Cs, pjfet_transistor_horz: n0, pjfet_transistor_vert: Ds, pnp_bipolar_transistor_down: Us, pnp_bipolar_transistor_horz: Gs, pnp_bipolar_transistor_left: Ws, pnp_bipolar_transistor_right: Hs, pnp_bipolar_transistor_up: Zs, pnp_bipolar_transistor_vert: Qs, potentiometer_horz: g0, potentiometer_vert: rm, potentiometer2_down: pm, potentiometer2_left: am, potentiometer2_right: H, potentiometer2_up: ym, potentiometer3_down: xm, potentiometer3_left: sm, potentiometer3_right: mm, potentiometer3_up: nm, power_factor_meter_horz: S0, power_factor_meter_vert: dm, push_button_normally_closed_momentary_horz: R0, push_button_normally_closed_momentary_vert: um, push_button_normally_open_momentary_horz: E0, push_button_normally_open_momentary_vert: Pm, rectifier_diode_horz: L0, rectifier_diode_vert: Rm, resistor_down: Em, resistor_left: Xm, resistor_right: Vm, resistor_up: km, resonator_down: Om, resonator_horz: M0, resonator_left: Jm, resonator_right: K, resonator_up: $m, resonator_vert: Mm, schottky_diode_down: Nm, schottky_diode_left: Im, schottky_diode_right: tt, schottky_diode_up: Bm, silicon_controlled_rectifier_horz: C0, silicon_controlled_rectifier_vert: Um, solderjumper2_bridged12_down: Gm, solderjumper2_bridged12_left: Wm, solderjumper2_bridged12_right: Hm, solderjumper2_bridged12_up: Zm, solderjumper2_down: Qm, solderjumper2_left: Km, solderjumper2_right: tn, solderjumper2_up: en, solderjumper3_bridged12_down: rn, solderjumper3_bridged12_left: on2, solderjumper3_bridged12_right: ln, solderjumper3_bridged12_up: pn, solderjumper3_bridged123_down: an, solderjumper3_bridged123_left: yn, solderjumper3_bridged123_right: xn, solderjumper3_bridged123_up: sn, solderjumper3_bridged23_down: mn, solderjumper3_bridged23_left: nn, solderjumper3_bridged23_right: fn, solderjumper3_bridged23_up: hn, solderjumper3_down: cn, solderjumper3_left: dn, solderjumper3_right: bn, solderjumper3_up: _n, spdt_normally_closed_switch_down: un, spdt_normally_closed_switch_left: vn, spdt_normally_closed_switch_right: at, spdt_normally_closed_switch_up: wn, spdt_switch_down: Pn, spdt_switch_left: Sn, spdt_switch_right: yt, spdt_switch_up: Fn, spst_normally_closed_switch_down: Rn, spst_normally_closed_switch_left: Tn, spst_normally_closed_switch_right: xt, spst_normally_closed_switch_up: En, spst_switch_down: Yn, spst_switch_left: Xn, spst_switch_right: st, spst_switch_up: Ln, square_wave_down: Vn, square_wave_left: jn, square_wave_right: kn, square_wave_up: zn, step_recovery_diode_horz: N0, step_recovery_diode_vert: On, tachometer_horz: Tt, tachometer_vert: Cn, testpoint_down: Bn, testpoint_left: qn, testpoint_right: nt, testpoint_up: Gn, tilted_ground_down: Hn, tilted_ground_left: Zn, tilted_ground_right: ut, tilted_ground_up: B0, triac_horz: q0, triac_vert: t1, tunnel_diode_horz: U0, tunnel_diode_vert: i1, unijunction_transistor_horz: W0, unijunction_transistor_vert: s1, usbc: n1, var_meter_horz: Z0, var_meter_vert: c1, varactor_diode_horz: K0, varactor_diode_vert: g1, varistor_horz: er, varistor_vert: A1, varmeter_horz: Et, varmeter_vert: R1, vcc_down: T1, vcc_left: E1, vcc_right: Y1, vcc_up: X1, volt_meter_horz: or, volt_meter_vert: L1, watt_hour_meter_horz: Yt, watt_hour_meter_vert: z1, wattmeter_horz: Xt, wattmeter_vert: M1, zener_diode_horz: ar, zener_diode_vert: B1 };
101572
+ var q1 = { ac_voltmeter_down: Ul, ac_voltmeter_horz: Wl, ac_voltmeter_left: Zl, ac_voltmeter_right: Kl, ac_voltmeter_up: ep, ac_voltmeter_vert: op, avalanche_diode_down: lp, avalanche_diode_horz: pp, avalanche_diode_left: yp, avalanche_diode_right: xp, avalanche_diode_up: mp, avalanche_diode_vert: fp, backward_diode_down: cp, backward_diode_left: Dt, backward_diode_right: _p, backward_diode_up: gp, battery_horz: Wt, battery_vert: Ap, boxresistor_down: Fp, boxresistor_left: Ep, boxresistor_right: Lp, boxresistor_small_down: jp, boxresistor_small_left: zp, boxresistor_small_right: Jp, boxresistor_small_up: Mp, boxresistor_up: Ip, bridged_ground_down: Dp, bridged_ground_left: Wp, bridged_ground_right: te, bridged_ground_up: Qp, capacitor_down: ta, capacitor_left: ea, capacitor_polarized_down: oa, capacitor_polarized_left: ia, capacitor_polarized_right: pa, capacitor_polarized_up: ya, capacitor_right: xa, capacitor_up: ma, constant_current_diode_down: fa, constant_current_diode_horz: ha, constant_current_diode_left: da, constant_current_diode_right: ba, constant_current_diode_up: ga, constant_current_diode_vert: va, crystal_4pin_down: wa, crystal_4pin_left: Aa, crystal_4pin_right: Pa, crystal_4pin_up: Sa, crystal_down: Ra, crystal_left: Ta, crystal_right: Ea, crystal_up: Xa, darlington_pair_transistor_down: La, darlington_pair_transistor_horz: Va, darlington_pair_transistor_left: ja, darlington_pair_transistor_right: ka, darlington_pair_transistor_up: za, darlington_pair_transistor_vert: Oa, dc_ammeter_horz: wt, dc_ammeter_vert: Ca, dc_voltmeter_down: Ia, dc_voltmeter_horz: qa, dc_voltmeter_left: Ua, dc_voltmeter_right: Wa, dc_voltmeter_up: Za, dc_voltmeter_vert: Ka, diac_down: ty, diac_horz: ey, diac_left: ry, diac_right: oy, diac_up: iy, diac_vert: ly, diode_down: ay, diode_left: yy, diode_right: $2, diode_up: xy, dpdt_normally_closed_switch_down: my, dpdt_normally_closed_switch_left: ny, dpdt_normally_closed_switch_right: M, dpdt_normally_closed_switch_up: fy, dpdt_switch_down: cy, dpdt_switch_left: dy, dpdt_switch_right: C, dpdt_switch_up: by, dpst_normally_closed_switch_down: gy, dpst_normally_closed_switch_left: uy, dpst_normally_closed_switch_right: N, dpst_normally_closed_switch_up: vy, dpst_switch_down: Ay, dpst_switch_left: Py, dpst_switch_right: I, dpst_switch_up: Sy, ferrite_bead_down: Ry, ferrite_bead_left: Ty, ferrite_bead_right: Fe, ferrite_bead_up: Se, filled_diode_down: Yy, filled_diode_horz: Ly, filled_diode_left: jy, filled_diode_right: zy, filled_diode_up: Jy, filled_diode_vert: My, frequency_meter_horz: At2, frequency_meter_vert: By, fuse_horz: ke, fuse_vert: Uy, ground_down: Gy, ground_horz: Wy, ground_left: Hy, ground_right: Zy, ground_up: Qy, ground_vert: Ky2, ground2_down: ex, ground2_left: ox, ground2_right: lx, ground2_up: ax, gunn_diode_horz: yx, gunn_diode_vert: xx, icled_down: mx, icled_left: nx, icled_right: q, icled_up: fx, igbt_transistor_horz: ze, igbt_transistor_vert: dx, illuminated_push_button_normally_open_horz: Oe, illuminated_push_button_normally_open_vert: ux, inductor_down: Px, inductor_left: Sx, inductor_right: _t, inductor_up: $e, laser_diode_down: Fx, laser_diode_left: Rx, laser_diode_right: D, laser_diode_up: Tx, led_down: Lx, led_left: Vx, led_right: gt, led_up: Ce, light_dependent_resistor_horz: Ie, light_dependent_resistor_vert: $x, mosfet_depletion_normally_on_horz: qe, mosfet_depletion_normally_on_vert: Ix, mushroom_head_normally_open_momentary_horz: Ue, mushroom_head_normally_open_momentary_vert: Ux, n_channel_d_mosfet_transistor_horz: He, n_channel_d_mosfet_transistor_vert: Qx, n_channel_e_mosfet_transistor_horz: Qe, n_channel_e_mosfet_transistor_vert: os4, njfet_transistor_horz: t0, njfet_transistor_vert: ys, not_connected_down: ms, not_connected_left: ns, not_connected_right: U, not_connected_up: fs28, npn_bipolar_transistor_down: hs, npn_bipolar_transistor_horz: cs, npn_bipolar_transistor_left: ds, npn_bipolar_transistor_right: bs, npn_bipolar_transistor_up: _s, npn_bipolar_transistor_vert: gs, opamp_no_power_down: vs, opamp_no_power_left: ws, opamp_no_power_right: G, opamp_no_power_up: As, opamp_with_power_down: Ss, opamp_with_power_left: Fs, opamp_with_power_right: W, opamp_with_power_up: Rs, p_channel_d_mosfet_transistor_horz: a0, p_channel_d_mosfet_transistor_vert: Ls, p_channel_e_mosfet_transistor_horz: x0, p_channel_e_mosfet_transistor_vert: Os, photodiode_horz: s0, photodiode_vert: Cs, pjfet_transistor_horz: n0, pjfet_transistor_vert: Ds, pnp_bipolar_transistor_down: Us, pnp_bipolar_transistor_horz: Gs, pnp_bipolar_transistor_left: Ws, pnp_bipolar_transistor_right: Hs, pnp_bipolar_transistor_up: Zs, pnp_bipolar_transistor_vert: Qs, potentiometer_horz: g0, potentiometer_vert: rm, potentiometer2_down: pm, potentiometer2_left: am, potentiometer2_right: H, potentiometer2_up: ym, potentiometer3_down: xm, potentiometer3_left: sm, potentiometer3_right: mm, potentiometer3_up: nm, power_factor_meter_horz: S0, power_factor_meter_vert: dm, push_button_normally_closed_momentary_horz: R0, push_button_normally_closed_momentary_vert: um, push_button_normally_open_momentary_horz: E0, push_button_normally_open_momentary_vert: Pm, rectifier_diode_horz: L0, rectifier_diode_vert: Rm, resistor_down: Em, resistor_left: Xm, resistor_right: Vm, resistor_up: km, resonator_down: Om, resonator_horz: M0, resonator_left: Jm, resonator_right: K, resonator_up: $m, resonator_vert: Mm, schottky_diode_down: Nm, schottky_diode_left: Im, schottky_diode_right: tt, schottky_diode_up: Bm, silicon_controlled_rectifier_horz: C0, silicon_controlled_rectifier_vert: Um, solderjumper2_bridged12_down: Gm, solderjumper2_bridged12_left: Wm, solderjumper2_bridged12_right: Hm, solderjumper2_bridged12_up: Zm, solderjumper2_down: Qm, solderjumper2_left: Km, solderjumper2_right: tn, solderjumper2_up: en, solderjumper3_bridged12_down: rn, solderjumper3_bridged12_left: on2, solderjumper3_bridged12_right: ln, solderjumper3_bridged12_up: pn, solderjumper3_bridged123_down: an, solderjumper3_bridged123_left: yn, solderjumper3_bridged123_right: xn, solderjumper3_bridged123_up: sn, solderjumper3_bridged23_down: mn, solderjumper3_bridged23_left: nn, solderjumper3_bridged23_right: fn, solderjumper3_bridged23_up: hn, solderjumper3_down: cn, solderjumper3_left: dn, solderjumper3_right: bn, solderjumper3_up: _n, spdt_normally_closed_switch_down: un, spdt_normally_closed_switch_left: vn, spdt_normally_closed_switch_right: at, spdt_normally_closed_switch_up: wn, spdt_switch_down: Pn, spdt_switch_left: Sn, spdt_switch_right: yt, spdt_switch_up: Fn, spst_normally_closed_switch_down: Rn, spst_normally_closed_switch_left: Tn, spst_normally_closed_switch_right: xt, spst_normally_closed_switch_up: En, spst_switch_down: Yn, spst_switch_left: Xn, spst_switch_right: st, spst_switch_up: Ln, square_wave_down: Vn, square_wave_left: jn, square_wave_right: kn, square_wave_up: zn, step_recovery_diode_horz: N0, step_recovery_diode_vert: On, tachometer_horz: Tt, tachometer_vert: Cn, testpoint_down: Bn, testpoint_left: qn, testpoint_right: nt, testpoint_up: Gn, tilted_ground_down: Hn, tilted_ground_left: Zn, tilted_ground_right: ut, tilted_ground_up: B0, triac_horz: q0, triac_vert: t1, tunnel_diode_horz: U0, tunnel_diode_vert: i1, unijunction_transistor_horz: W0, unijunction_transistor_vert: s1, usbc: n1, var_meter_horz: Z0, var_meter_vert: c1, varactor_diode_horz: K0, varactor_diode_vert: g1, varistor_horz: er, varistor_vert: A1, varmeter_horz: Et, varmeter_vert: R1, vcc_down: T1, vcc_left: E1, vcc_right: Y1, vcc_up: X1, volt_meter_horz: or, volt_meter_vert: L1, watt_hour_meter_horz: Yt, watt_hour_meter_vert: z1, wattmeter_horz: Xt, wattmeter_vert: M1, zener_diode_horz: ar, zener_diode_vert: B1 };
101463
101573
  var Y$ = Object.fromEntries(Object.keys(q1).map((t3) => [t3, t3]));
101464
101574
  function doesLineIntersectLine([a12, a22], [b12, b22], {
101465
101575
  lineThickness = 0
@@ -102759,14 +102869,14 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
102759
102869
  prevActScopeDepth !== actScopeDepth - 1 && console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
102760
102870
  actScopeDepth = prevActScopeDepth;
102761
102871
  }
102762
- function recursivelyFlushAsyncActWork(returnValue, resolve10, reject) {
102872
+ function recursivelyFlushAsyncActWork(returnValue, resolve11, reject) {
102763
102873
  var queue = ReactSharedInternals.actQueue;
102764
102874
  if (queue !== null)
102765
102875
  if (queue.length !== 0)
102766
102876
  try {
102767
102877
  flushActQueue(queue);
102768
102878
  enqueueTask(function() {
102769
- return recursivelyFlushAsyncActWork(returnValue, resolve10, reject);
102879
+ return recursivelyFlushAsyncActWork(returnValue, resolve11, reject);
102770
102880
  });
102771
102881
  return;
102772
102882
  } catch (error) {
@@ -102774,7 +102884,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
102774
102884
  }
102775
102885
  else
102776
102886
  ReactSharedInternals.actQueue = null;
102777
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve10(returnValue);
102887
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve11(returnValue);
102778
102888
  }
102779
102889
  function flushActQueue(queue) {
102780
102890
  if (!isFlushing) {
@@ -102950,14 +103060,14 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
102950
103060
  didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
102951
103061
  });
102952
103062
  return {
102953
- then: function(resolve10, reject) {
103063
+ then: function(resolve11, reject) {
102954
103064
  didAwaitActCall = true;
102955
103065
  thenable.then(function(returnValue) {
102956
103066
  popActScope(prevActQueue, prevActScopeDepth);
102957
103067
  if (prevActScopeDepth === 0) {
102958
103068
  try {
102959
103069
  flushActQueue(queue), enqueueTask(function() {
102960
- return recursivelyFlushAsyncActWork(returnValue, resolve10, reject);
103070
+ return recursivelyFlushAsyncActWork(returnValue, resolve11, reject);
102961
103071
  });
102962
103072
  } catch (error$0) {
102963
103073
  ReactSharedInternals.thrownErrors.push(error$0);
@@ -102968,7 +103078,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
102968
103078
  reject(_thrownError);
102969
103079
  }
102970
103080
  } else
102971
- resolve10(returnValue);
103081
+ resolve11(returnValue);
102972
103082
  }, function(error) {
102973
103083
  popActScope(prevActQueue, prevActScopeDepth);
102974
103084
  0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
@@ -102984,11 +103094,11 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
102984
103094
  if (0 < ReactSharedInternals.thrownErrors.length)
102985
103095
  throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
102986
103096
  return {
102987
- then: function(resolve10, reject) {
103097
+ then: function(resolve11, reject) {
102988
103098
  didAwaitActCall = true;
102989
103099
  prevActScopeDepth === 0 ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
102990
- return recursivelyFlushAsyncActWork(returnValue$jscomp$0, resolve10, reject);
102991
- })) : resolve10(returnValue$jscomp$0);
103100
+ return recursivelyFlushAsyncActWork(returnValue$jscomp$0, resolve11, reject);
103101
+ })) : resolve11(returnValue$jscomp$0);
102992
103102
  }
102993
103103
  };
102994
103104
  };
@@ -103489,11 +103599,11 @@ var require_react_reconciler_development = __commonJS2({
103489
103599
  fiber = fiber.next, id2--;
103490
103600
  return fiber;
103491
103601
  }
103492
- function copyWithSetImpl(obj, path26, index, value) {
103493
- if (index >= path26.length)
103602
+ function copyWithSetImpl(obj, path28, index, value) {
103603
+ if (index >= path28.length)
103494
103604
  return value;
103495
- var key = path26[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj);
103496
- updated[key] = copyWithSetImpl(obj[key], path26, index + 1, value);
103605
+ var key = path28[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj);
103606
+ updated[key] = copyWithSetImpl(obj[key], path28, index + 1, value);
103497
103607
  return updated;
103498
103608
  }
103499
103609
  function copyWithRename(obj, oldPath, newPath) {
@@ -103513,11 +103623,11 @@ var require_react_reconciler_development = __commonJS2({
103513
103623
  index + 1 === oldPath.length ? (updated[newPath[index]] = updated[oldKey], isArrayImpl(updated) ? updated.splice(oldKey, 1) : delete updated[oldKey]) : updated[oldKey] = copyWithRenameImpl(obj[oldKey], oldPath, newPath, index + 1);
103514
103624
  return updated;
103515
103625
  }
103516
- function copyWithDeleteImpl(obj, path26, index) {
103517
- var key = path26[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj);
103518
- if (index + 1 === path26.length)
103626
+ function copyWithDeleteImpl(obj, path28, index) {
103627
+ var key = path28[index], updated = isArrayImpl(obj) ? obj.slice() : assign2({}, obj);
103628
+ if (index + 1 === path28.length)
103519
103629
  return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
103520
- updated[key] = copyWithDeleteImpl(obj[key], path26, index + 1);
103630
+ updated[key] = copyWithDeleteImpl(obj[key], path28, index + 1);
103521
103631
  return updated;
103522
103632
  }
103523
103633
  function shouldSuspendImpl() {
@@ -105229,8 +105339,8 @@ It can also happen if the client has a browser extension installed which messes
105229
105339
  currentEntangledActionThenable = {
105230
105340
  status: "pending",
105231
105341
  value: undefined,
105232
- then: function(resolve10) {
105233
- entangledListeners.push(resolve10);
105342
+ then: function(resolve11) {
105343
+ entangledListeners.push(resolve11);
105234
105344
  }
105235
105345
  };
105236
105346
  }
@@ -105254,8 +105364,8 @@ It can also happen if the client has a browser extension installed which messes
105254
105364
  status: "pending",
105255
105365
  value: null,
105256
105366
  reason: null,
105257
- then: function(resolve10) {
105258
- listeners.push(resolve10);
105367
+ then: function(resolve11) {
105368
+ listeners.push(resolve11);
105259
105369
  }
105260
105370
  };
105261
105371
  thenable.then(function() {
@@ -112548,29 +112658,29 @@ Check the top-level render call using <` + componentName2 + ">.");
112548
112658
  var didWarnAboutNestedUpdates = false;
112549
112659
  var didWarnAboutFindNodeInStrictMode = {};
112550
112660
  var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, setErrorHandler = null, setSuspenseHandler = null;
112551
- overrideHookState = function(fiber, id2, path26, value) {
112661
+ overrideHookState = function(fiber, id2, path28, value) {
112552
112662
  id2 = findHook(fiber, id2);
112553
- id2 !== null && (path26 = copyWithSetImpl(id2.memoizedState, path26, 0, value), id2.memoizedState = path26, id2.baseState = path26, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path26 = enqueueConcurrentRenderForLane(fiber, 2), path26 !== null && scheduleUpdateOnFiber(path26, fiber, 2));
112663
+ id2 !== null && (path28 = copyWithSetImpl(id2.memoizedState, path28, 0, value), id2.memoizedState = path28, id2.baseState = path28, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path28 = enqueueConcurrentRenderForLane(fiber, 2), path28 !== null && scheduleUpdateOnFiber(path28, fiber, 2));
112554
112664
  };
112555
- overrideHookStateDeletePath = function(fiber, id2, path26) {
112665
+ overrideHookStateDeletePath = function(fiber, id2, path28) {
112556
112666
  id2 = findHook(fiber, id2);
112557
- id2 !== null && (path26 = copyWithDeleteImpl(id2.memoizedState, path26, 0), id2.memoizedState = path26, id2.baseState = path26, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path26 = enqueueConcurrentRenderForLane(fiber, 2), path26 !== null && scheduleUpdateOnFiber(path26, fiber, 2));
112667
+ id2 !== null && (path28 = copyWithDeleteImpl(id2.memoizedState, path28, 0), id2.memoizedState = path28, id2.baseState = path28, fiber.memoizedProps = assign2({}, fiber.memoizedProps), path28 = enqueueConcurrentRenderForLane(fiber, 2), path28 !== null && scheduleUpdateOnFiber(path28, fiber, 2));
112558
112668
  };
112559
112669
  overrideHookStateRenamePath = function(fiber, id2, oldPath, newPath) {
112560
112670
  id2 = findHook(fiber, id2);
112561
112671
  id2 !== null && (oldPath = copyWithRename(id2.memoizedState, oldPath, newPath), id2.memoizedState = oldPath, id2.baseState = oldPath, fiber.memoizedProps = assign2({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), oldPath !== null && scheduleUpdateOnFiber(oldPath, fiber, 2));
112562
112672
  };
112563
- overrideProps = function(fiber, path26, value) {
112564
- fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path26, 0, value);
112673
+ overrideProps = function(fiber, path28, value) {
112674
+ fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path28, 0, value);
112565
112675
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
112566
- path26 = enqueueConcurrentRenderForLane(fiber, 2);
112567
- path26 !== null && scheduleUpdateOnFiber(path26, fiber, 2);
112676
+ path28 = enqueueConcurrentRenderForLane(fiber, 2);
112677
+ path28 !== null && scheduleUpdateOnFiber(path28, fiber, 2);
112568
112678
  };
112569
- overridePropsDeletePath = function(fiber, path26) {
112570
- fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path26, 0);
112679
+ overridePropsDeletePath = function(fiber, path28) {
112680
+ fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path28, 0);
112571
112681
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
112572
- path26 = enqueueConcurrentRenderForLane(fiber, 2);
112573
- path26 !== null && scheduleUpdateOnFiber(path26, fiber, 2);
112682
+ path28 = enqueueConcurrentRenderForLane(fiber, 2);
112683
+ path28 !== null && scheduleUpdateOnFiber(path28, fiber, 2);
112574
112684
  };
112575
112685
  overridePropsRenamePath = function(fiber, oldPath, newPath) {
112576
112686
  fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
@@ -127907,10 +128017,10 @@ Check the render method of %s.`, getComponentNameFromFiber(current2) || "Unknown
127907
128017
  var setErrorHandler = null;
127908
128018
  var setSuspenseHandler = null;
127909
128019
  {
127910
- var copyWithDeleteImpl = function(obj, path26, index2) {
127911
- var key = path26[index2];
128020
+ var copyWithDeleteImpl = function(obj, path28, index2) {
128021
+ var key = path28[index2];
127912
128022
  var updated = isArray2(obj) ? obj.slice() : assign2({}, obj);
127913
- if (index2 + 1 === path26.length) {
128023
+ if (index2 + 1 === path28.length) {
127914
128024
  if (isArray2(updated)) {
127915
128025
  updated.splice(key, 1);
127916
128026
  } else {
@@ -127918,11 +128028,11 @@ Check the render method of %s.`, getComponentNameFromFiber(current2) || "Unknown
127918
128028
  }
127919
128029
  return updated;
127920
128030
  }
127921
- updated[key] = copyWithDeleteImpl(obj[key], path26, index2 + 1);
128031
+ updated[key] = copyWithDeleteImpl(obj[key], path28, index2 + 1);
127922
128032
  return updated;
127923
128033
  };
127924
- var copyWithDelete = function(obj, path26) {
127925
- return copyWithDeleteImpl(obj, path26, 0);
128034
+ var copyWithDelete = function(obj, path28) {
128035
+ return copyWithDeleteImpl(obj, path28, 0);
127926
128036
  };
127927
128037
  var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
127928
128038
  var oldKey = oldPath[index2];
@@ -127954,17 +128064,17 @@ Check the render method of %s.`, getComponentNameFromFiber(current2) || "Unknown
127954
128064
  }
127955
128065
  return copyWithRenameImpl(obj, oldPath, newPath, 0);
127956
128066
  };
127957
- var copyWithSetImpl = function(obj, path26, index2, value) {
127958
- if (index2 >= path26.length) {
128067
+ var copyWithSetImpl = function(obj, path28, index2, value) {
128068
+ if (index2 >= path28.length) {
127959
128069
  return value;
127960
128070
  }
127961
- var key = path26[index2];
128071
+ var key = path28[index2];
127962
128072
  var updated = isArray2(obj) ? obj.slice() : assign2({}, obj);
127963
- updated[key] = copyWithSetImpl(obj[key], path26, index2 + 1, value);
128073
+ updated[key] = copyWithSetImpl(obj[key], path28, index2 + 1, value);
127964
128074
  return updated;
127965
128075
  };
127966
- var copyWithSet = function(obj, path26, value) {
127967
- return copyWithSetImpl(obj, path26, 0, value);
128076
+ var copyWithSet = function(obj, path28, value) {
128077
+ return copyWithSetImpl(obj, path28, 0, value);
127968
128078
  };
127969
128079
  var findHook = function(fiber, id2) {
127970
128080
  var currentHook2 = fiber.memoizedState;
@@ -127974,10 +128084,10 @@ Check the render method of %s.`, getComponentNameFromFiber(current2) || "Unknown
127974
128084
  }
127975
128085
  return currentHook2;
127976
128086
  };
127977
- overrideHookState = function(fiber, id2, path26, value) {
128087
+ overrideHookState = function(fiber, id2, path28, value) {
127978
128088
  var hook = findHook(fiber, id2);
127979
128089
  if (hook !== null) {
127980
- var newState = copyWithSet(hook.memoizedState, path26, value);
128090
+ var newState = copyWithSet(hook.memoizedState, path28, value);
127981
128091
  hook.memoizedState = newState;
127982
128092
  hook.baseState = newState;
127983
128093
  fiber.memoizedProps = assign2({}, fiber.memoizedProps);
@@ -127987,10 +128097,10 @@ Check the render method of %s.`, getComponentNameFromFiber(current2) || "Unknown
127987
128097
  }
127988
128098
  }
127989
128099
  };
127990
- overrideHookStateDeletePath = function(fiber, id2, path26) {
128100
+ overrideHookStateDeletePath = function(fiber, id2, path28) {
127991
128101
  var hook = findHook(fiber, id2);
127992
128102
  if (hook !== null) {
127993
- var newState = copyWithDelete(hook.memoizedState, path26);
128103
+ var newState = copyWithDelete(hook.memoizedState, path28);
127994
128104
  hook.memoizedState = newState;
127995
128105
  hook.baseState = newState;
127996
128106
  fiber.memoizedProps = assign2({}, fiber.memoizedProps);
@@ -128013,8 +128123,8 @@ Check the render method of %s.`, getComponentNameFromFiber(current2) || "Unknown
128013
128123
  }
128014
128124
  }
128015
128125
  };
128016
- overrideProps = function(fiber, path26, value) {
128017
- fiber.pendingProps = copyWithSet(fiber.memoizedProps, path26, value);
128126
+ overrideProps = function(fiber, path28, value) {
128127
+ fiber.pendingProps = copyWithSet(fiber.memoizedProps, path28, value);
128018
128128
  if (fiber.alternate) {
128019
128129
  fiber.alternate.pendingProps = fiber.pendingProps;
128020
128130
  }
@@ -128023,8 +128133,8 @@ Check the render method of %s.`, getComponentNameFromFiber(current2) || "Unknown
128023
128133
  scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
128024
128134
  }
128025
128135
  };
128026
- overridePropsDeletePath = function(fiber, path26) {
128027
- fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path26);
128136
+ overridePropsDeletePath = function(fiber, path28) {
128137
+ fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path28);
128028
128138
  if (fiber.alternate) {
128029
128139
  fiber.alternate.pendingProps = fiber.pendingProps;
128030
128140
  }
@@ -133370,7 +133480,7 @@ var require_condense_newlines = __commonJS2({
133370
133480
  var typeOf = require_kind_of();
133371
133481
  module2.exports = function(str, options) {
133372
133482
  var opts = extend2({}, options);
133373
- var sep = opts.sep || `
133483
+ var sep2 = opts.sep || `
133374
133484
 
133375
133485
  `;
133376
133486
  var min = opts.min;
@@ -133389,7 +133499,7 @@ var require_condense_newlines = __commonJS2({
133389
133499
  `);
133390
133500
  }
133391
133501
  str = trailingNewline(str, opts);
133392
- return str.replace(re2, sep);
133502
+ return str.replace(re2, sep2);
133393
133503
  };
133394
133504
  function trailingNewline(str, options) {
133395
133505
  var val = options.trailingNewline;
@@ -134075,7 +134185,7 @@ var parsePin = (pinString) => {
134075
134185
  const colorMatch = pinString.match(/#[0-9A-F]{6}/);
134076
134186
  const labelColor = colorMatch ? colorMatch[0] : "";
134077
134187
  const pathMatch = pinString.match(/\^\^([^~]+)/);
134078
- const path26 = pathMatch ? pathMatch[1] : "";
134188
+ const path28 = pathMatch ? pathMatch[1] : "";
134079
134189
  const arrowMatch = pinString.match(/\^\^0~(.+)$/);
134080
134190
  const arrow = arrowMatch ? arrowMatch[1] : "";
134081
134191
  const r3 = Number.parseFloat(rotation2);
@@ -134089,7 +134199,7 @@ var parsePin = (pinString) => {
134089
134199
  rotation: Number.isNaN(r3) ? 0 : r3,
134090
134200
  label,
134091
134201
  labelColor,
134092
- path: path26,
134202
+ path: path28,
134093
134203
  arrow
134094
134204
  };
134095
134205
  };
@@ -134529,15 +134639,15 @@ function generateArcFromSweep(startX, startY, endX, endY, radius, largeArcFlag,
134529
134639
  }
134530
134640
  }
134531
134641
  const numPoints = Math.max(2, Math.ceil(Math.abs(endAngle - startAngle) * radius));
134532
- const path26 = [];
134642
+ const path28 = [];
134533
134643
  for (let i = 0;i <= numPoints; i++) {
134534
134644
  const t3 = i / numPoints;
134535
134645
  const angle2 = startAngle + t3 * (endAngle - startAngle);
134536
134646
  const x = centerX + radius * Math.cos(angle2);
134537
134647
  const y = centerY + radius * Math.sin(angle2);
134538
- path26.push({ x, y });
134648
+ path28.push({ x, y });
134539
134649
  }
134540
- return path26;
134650
+ return path28;
134541
134651
  }
134542
134652
  var __defProp4 = Object.defineProperty;
134543
134653
  var __export22 = (target, all) => {
@@ -135955,7 +136065,7 @@ var platedHoleWithRectPad = (pn2, x, y, holeDiameter, rectPadWidth, rectPadHeigh
135955
136065
  };
135956
136066
  };
135957
136067
  var silkscreenPin = ({
135958
- fs: fs27,
136068
+ fs: fs29,
135959
136069
  pn: pn2,
135960
136070
  anchor_x,
135961
136071
  anchor_y,
@@ -135998,7 +136108,7 @@ var silkscreenPin = ({
135998
136108
  type: "pcb_silkscreen_text",
135999
136109
  pcb_silkscreen_text_id: "silkscreen_text_1",
136000
136110
  font: "tscircuit2024",
136001
- font_size: fs27,
136111
+ font_size: fs29,
136002
136112
  pcb_component_id: "pcb_component_1",
136003
136113
  text: `{PIN${pn2}}`,
136004
136114
  layer,
@@ -141919,10 +142029,10 @@ function compareDocumentPosition(nodeA, nodeB) {
141919
142029
  function uniqueSort(nodes) {
141920
142030
  nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));
141921
142031
  nodes.sort((a, b3) => {
141922
- const relative9 = compareDocumentPosition(a, b3);
141923
- if (relative9 & DocumentPosition.PRECEDING) {
142032
+ const relative10 = compareDocumentPosition(a, b3);
142033
+ if (relative10 & DocumentPosition.PRECEDING) {
141924
142034
  return -1;
141925
- } else if (relative9 & DocumentPosition.FOLLOWING) {
142035
+ } else if (relative10 & DocumentPosition.FOLLOWING) {
141926
142036
  return 1;
141927
142037
  }
141928
142038
  return 0;
@@ -143614,17 +143724,17 @@ var ObstacleList = class {
143614
143724
  return obstacles;
143615
143725
  }
143616
143726
  };
143617
- function removePathLoops(path26) {
143618
- if (path26.length < 4)
143619
- return path26;
143620
- const result = [{ ...path26[0] }];
143621
- let currentLayer = path26[0].layer;
143622
- for (let i = 1;i < path26.length; i++) {
143623
- const currentSegment = { start: path26[i - 1], end: path26[i] };
143624
- const isVia = path26[i].route_type === "via" || path26[i - 1].route_type === "via";
143625
- if (path26[i].layer !== currentLayer || isVia) {
143626
- result.push({ ...path26[i] });
143627
- currentLayer = path26[i].layer;
143727
+ function removePathLoops(path28) {
143728
+ if (path28.length < 4)
143729
+ return path28;
143730
+ const result = [{ ...path28[0] }];
143731
+ let currentLayer = path28[0].layer;
143732
+ for (let i = 1;i < path28.length; i++) {
143733
+ const currentSegment = { start: path28[i - 1], end: path28[i] };
143734
+ const isVia = path28[i].route_type === "via" || path28[i - 1].route_type === "via";
143735
+ if (path28[i].layer !== currentLayer || isVia) {
143736
+ result.push({ ...path28[i] });
143737
+ currentLayer = path28[i].layer;
143628
143738
  continue;
143629
143739
  }
143630
143740
  let intersectionFound = false;
@@ -143653,8 +143763,8 @@ function removePathLoops(path26) {
143653
143763
  result.push(intersectionPoint);
143654
143764
  }
143655
143765
  const lastPoint = result[result.length - 1];
143656
- if (lastPoint.x !== path26[i].x || lastPoint.y !== path26[i].y) {
143657
- result.push(path26[i]);
143766
+ if (lastPoint.x !== path28[i].x || lastPoint.y !== path28[i].y) {
143767
+ result.push(path28[i]);
143658
143768
  }
143659
143769
  }
143660
143770
  return result;
@@ -144143,10 +144253,10 @@ var GeneralizedAstarAutorouter = class {
144143
144253
  });
144144
144254
  }
144145
144255
  if (current2.parent) {
144146
- const path26 = [];
144256
+ const path28 = [];
144147
144257
  let p = current2;
144148
144258
  while (p) {
144149
- path26.unshift(p);
144259
+ path28.unshift(p);
144150
144260
  p = p.parent;
144151
144261
  }
144152
144262
  debugSolution.push({
@@ -144154,7 +144264,7 @@ var GeneralizedAstarAutorouter = class {
144154
144264
  pcb_component_id: "",
144155
144265
  pcb_fabrication_note_path_id: `note_path_${current2.x}_${current2.y}`,
144156
144266
  layer: "top",
144157
- route: path26,
144267
+ route: path28,
144158
144268
  stroke_width: 0.01
144159
144269
  });
144160
144270
  }
@@ -149076,13 +149186,13 @@ var RBush = class {
149076
149186
  return this;
149077
149187
  let node = this.data;
149078
149188
  const bbox = this.toBBox(item);
149079
- const path26 = [];
149189
+ const path28 = [];
149080
149190
  const indexes = [];
149081
149191
  let i, parent, goingUp;
149082
- while (node || path26.length) {
149192
+ while (node || path28.length) {
149083
149193
  if (!node) {
149084
- node = path26.pop();
149085
- parent = path26[path26.length - 1];
149194
+ node = path28.pop();
149195
+ parent = path28[path28.length - 1];
149086
149196
  i = indexes.pop();
149087
149197
  goingUp = true;
149088
149198
  }
@@ -149090,13 +149200,13 @@ var RBush = class {
149090
149200
  const index = findItem(item, node.children, equalsFn);
149091
149201
  if (index !== -1) {
149092
149202
  node.children.splice(index, 1);
149093
- path26.push(node);
149094
- this._condense(path26);
149203
+ path28.push(node);
149204
+ this._condense(path28);
149095
149205
  return this;
149096
149206
  }
149097
149207
  }
149098
149208
  if (!goingUp && !node.leaf && contains(node, bbox)) {
149099
- path26.push(node);
149209
+ path28.push(node);
149100
149210
  indexes.push(i);
149101
149211
  i = 0;
149102
149212
  parent = node;
@@ -149167,10 +149277,10 @@ var RBush = class {
149167
149277
  calcBBox(node, this.toBBox);
149168
149278
  return node;
149169
149279
  }
149170
- _chooseSubtree(bbox, node, level, path26) {
149280
+ _chooseSubtree(bbox, node, level, path28) {
149171
149281
  while (true) {
149172
- path26.push(node);
149173
- if (node.leaf || path26.length - 1 === level)
149282
+ path28.push(node);
149283
+ if (node.leaf || path28.length - 1 === level)
149174
149284
  break;
149175
149285
  let minArea = Infinity;
149176
149286
  let minEnlargement = Infinity;
@@ -149279,21 +149389,21 @@ var RBush = class {
149279
149389
  }
149280
149390
  return margin;
149281
149391
  }
149282
- _adjustParentBBoxes(bbox, path26, level) {
149392
+ _adjustParentBBoxes(bbox, path28, level) {
149283
149393
  for (let i = level;i >= 0; i--) {
149284
- extend(path26[i], bbox);
149394
+ extend(path28[i], bbox);
149285
149395
  }
149286
149396
  }
149287
- _condense(path26) {
149288
- for (let i = path26.length - 1, siblings;i >= 0; i--) {
149289
- if (path26[i].children.length === 0) {
149397
+ _condense(path28) {
149398
+ for (let i = path28.length - 1, siblings;i >= 0; i--) {
149399
+ if (path28[i].children.length === 0) {
149290
149400
  if (i > 0) {
149291
- siblings = path26[i - 1].children;
149292
- siblings.splice(siblings.indexOf(path26[i]), 1);
149401
+ siblings = path28[i - 1].children;
149402
+ siblings.splice(siblings.indexOf(path28[i]), 1);
149293
149403
  } else
149294
149404
  this.clear();
149295
149405
  } else
149296
- calcBBox(path26[i], this.toBBox);
149406
+ calcBBox(path28[i], this.toBBox);
149297
149407
  }
149298
149408
  }
149299
149409
  };
@@ -150438,7 +150548,7 @@ var CapacityEdgeToPortSegmentSolver = class extends BaseSolver {
150438
150548
  this.capacityPaths = capacityPaths;
150439
150549
  this.colorMap = colorMap ?? {};
150440
150550
  this.unprocessedNodeIds = [
150441
- ...new Set(capacityPaths.flatMap((path26) => path26.nodeIds))
150551
+ ...new Set(capacityPaths.flatMap((path28) => path28.nodeIds))
150442
150552
  ];
150443
150553
  this.nodePortSegments = /* @__PURE__ */ new Map;
150444
150554
  }
@@ -150449,17 +150559,17 @@ var CapacityEdgeToPortSegmentSolver = class extends BaseSolver {
150449
150559
  return;
150450
150560
  }
150451
150561
  const pathsGoingThroughNode = [];
150452
- for (const path26 of this.capacityPaths) {
150453
- const indexOfNodeInPath = path26.nodeIds.indexOf(nodeId);
150562
+ for (const path28 of this.capacityPaths) {
150563
+ const indexOfNodeInPath = path28.nodeIds.indexOf(nodeId);
150454
150564
  if (indexOfNodeInPath !== -1) {
150455
- pathsGoingThroughNode.push({ path: path26, indexOfNodeInPath });
150565
+ pathsGoingThroughNode.push({ path: path28, indexOfNodeInPath });
150456
150566
  }
150457
150567
  }
150458
150568
  const node = this.nodeMap.get(nodeId);
150459
150569
  const nodePortSegments = [];
150460
- for (const { path: path26, indexOfNodeInPath } of pathsGoingThroughNode) {
150461
- const entryNodeId = path26.nodeIds[indexOfNodeInPath - 1];
150462
- const exitNodeId = path26.nodeIds[indexOfNodeInPath + 1];
150570
+ for (const { path: path28, indexOfNodeInPath } of pathsGoingThroughNode) {
150571
+ const entryNodeId = path28.nodeIds[indexOfNodeInPath - 1];
150572
+ const exitNodeId = path28.nodeIds[indexOfNodeInPath + 1];
150463
150573
  for (const adjNodeId of [entryNodeId, exitNodeId]) {
150464
150574
  const adjNode = this.nodeMap.get(adjNodeId);
150465
150575
  if (!adjNode)
@@ -150472,7 +150582,7 @@ var CapacityEdgeToPortSegmentSolver = class extends BaseSolver {
150472
150582
  capacityMeshNodeId: nodeId,
150473
150583
  start: segment2.start,
150474
150584
  end: segment2.end,
150475
- connectionNames: [path26.connectionName],
150585
+ connectionNames: [path28.connectionName],
150476
150586
  availableZ: mutuallyAvailableZ
150477
150587
  };
150478
150588
  nodePortSegments.push(portSegment);
@@ -151278,37 +151388,37 @@ var SingleHighDensityRouteSolver = class extends BaseSolver {
151278
151388
  return neighbors;
151279
151389
  }
151280
151390
  getNodePath(node) {
151281
- const path26 = [];
151391
+ const path28 = [];
151282
151392
  while (node) {
151283
- path26.push(node);
151393
+ path28.push(node);
151284
151394
  node = node.parent;
151285
151395
  }
151286
- return path26;
151396
+ return path28;
151287
151397
  }
151288
151398
  getViasInNodePath(node) {
151289
- const path26 = this.getNodePath(node);
151399
+ const path28 = this.getNodePath(node);
151290
151400
  const vias = [];
151291
- for (let i = 0;i < path26.length - 1; i++) {
151292
- if (path26[i].z !== path26[i + 1].z) {
151293
- vias.push({ x: path26[i].x, y: path26[i].y });
151401
+ for (let i = 0;i < path28.length - 1; i++) {
151402
+ if (path28[i].z !== path28[i + 1].z) {
151403
+ vias.push({ x: path28[i].x, y: path28[i].y });
151294
151404
  }
151295
151405
  }
151296
151406
  return vias;
151297
151407
  }
151298
151408
  setSolvedPath(node) {
151299
- const path26 = this.getNodePath(node);
151300
- path26.reverse();
151409
+ const path28 = this.getNodePath(node);
151410
+ path28.reverse();
151301
151411
  const vias = [];
151302
- for (let i = 0;i < path26.length - 1; i++) {
151303
- if (path26[i].z !== path26[i + 1].z) {
151304
- vias.push({ x: path26[i].x, y: path26[i].y });
151412
+ for (let i = 0;i < path28.length - 1; i++) {
151413
+ if (path28[i].z !== path28[i + 1].z) {
151414
+ vias.push({ x: path28[i].x, y: path28[i].y });
151305
151415
  }
151306
151416
  }
151307
151417
  this.solvedPath = {
151308
151418
  connectionName: this.connectionName,
151309
151419
  traceThickness: this.traceThickness,
151310
151420
  viaDiameter: this.viaDiameter,
151311
- route: path26.map((node2) => ({ x: node2.x, y: node2.y, z: node2.z })).concat([this.B]),
151421
+ route: path28.map((node2) => ({ x: node2.x, y: node2.y, z: node2.z })).concat([this.B]),
151312
151422
  vias
151313
151423
  };
151314
151424
  }
@@ -152047,14 +152157,14 @@ function computeDumbbellPaths({
152047
152157
  const u3 = (dx2 * d1y - dy2 * d1x) / det;
152048
152158
  return t3 > 0 && t3 < 1 && u3 > 0 && u3 < 1;
152049
152159
  };
152050
- const doPathsIntersect = (path1, path26) => {
152160
+ const doPathsIntersect = (path1, path28) => {
152051
152161
  const segments1 = [];
152052
152162
  for (let i = 0;i < path1.length - 1; i++) {
152053
152163
  segments1.push({ start: path1[i], end: path1[i + 1] });
152054
152164
  }
152055
152165
  const segments2 = [];
152056
- for (let i = 0;i < path26.length - 1; i++) {
152057
- segments2.push({ start: path26[i], end: path26[i + 1] });
152166
+ for (let i = 0;i < path28.length - 1; i++) {
152167
+ segments2.push({ start: path28[i], end: path28[i + 1] });
152058
152168
  }
152059
152169
  for (const seg1 of segments1) {
152060
152170
  for (const seg2 of segments2) {
@@ -152116,12 +152226,12 @@ function computeDumbbellPaths({
152116
152226
  specialType: circleCenter === A3 ? "A" : "B"
152117
152227
  };
152118
152228
  };
152119
- const subdivideOptimalPath = (path26, numSubdivisions) => {
152120
- if (path26.length < 2)
152121
- return path26;
152122
- const result = [path26[0]];
152123
- for (let i = 0;i < path26.length - 1; i++) {
152124
- const segment2 = { start: path26[i], end: path26[i + 1] };
152229
+ const subdivideOptimalPath = (path28, numSubdivisions) => {
152230
+ if (path28.length < 2)
152231
+ return path28;
152232
+ const result = [path28[0]];
152233
+ for (let i = 0;i < path28.length - 1; i++) {
152234
+ const segment2 = { start: path28[i], end: path28[i + 1] };
152125
152235
  const segmentMidpoint = {
152126
152236
  x: (segment2.start.x + segment2.end.x) / 2,
152127
152237
  y: (segment2.start.y + segment2.end.y) / 2
@@ -152183,7 +152293,7 @@ function computeDumbbellPaths({
152183
152293
  }
152184
152294
  subdivisionPoints.forEach((p) => result.push(p));
152185
152295
  }
152186
- result.push(path26[i + 1]);
152296
+ result.push(path28[i + 1]);
152187
152297
  }
152188
152298
  if (result.length > 1) {
152189
152299
  const filteredResult = [result[0]];
@@ -152418,13 +152528,13 @@ function computeDumbbellPaths({
152418
152528
  ].map((l, index) => ({ ...l, index }));
152419
152529
  };
152420
152530
  const subdivideJLinePath = (jLine, oppositePoint, r3, m2, numSubdivisions) => {
152421
- const path26 = jLine.points;
152422
- if (path26.length < 2)
152423
- return path26;
152531
+ const path28 = jLine.points;
152532
+ if (path28.length < 2)
152533
+ return path28;
152424
152534
  const minDistThreshold = r3 + m2;
152425
- const result = [path26[0]];
152426
- for (let i = 0;i < path26.length - 1; i++) {
152427
- const segment2 = { start: path26[i], end: path26[i + 1] };
152535
+ const result = [path28[0]];
152536
+ for (let i = 0;i < path28.length - 1; i++) {
152537
+ const segment2 = { start: path28[i], end: path28[i + 1] };
152428
152538
  const distToOpposite = pointToSegmentDistance22(oppositePoint, segment2.start, segment2.end);
152429
152539
  if (distToOpposite < minDistThreshold) {
152430
152540
  const closestPt = closestPointOnSegment(segment2, oppositePoint);
@@ -152474,18 +152584,18 @@ function computeDumbbellPaths({
152474
152584
  const paths = getPaths();
152475
152585
  const validPaths = [];
152476
152586
  for (let i = 0;i < paths.length; i++) {
152477
- const path27 = paths[i];
152478
- const firstSeg = { start: path27[0], end: path27[1] };
152587
+ const path29 = paths[i];
152588
+ const firstSeg = { start: path29[0], end: path29[1] };
152479
152589
  const lastSeg = {
152480
- start: path27[path27.length - 2],
152481
- end: path27[path27.length - 1]
152590
+ start: path29[path29.length - 2],
152591
+ end: path29[path29.length - 1]
152482
152592
  };
152483
- const midSeg = { start: path27[3], end: path27[4] };
152593
+ const midSeg = { start: path29[3], end: path29[4] };
152484
152594
  if (!intersect2(firstSeg, lastSeg) && !intersect2(firstSeg, midSeg) && !intersect2(lastSeg, midSeg)) {
152485
152595
  validPaths.push({
152486
152596
  index: i + 1,
152487
- path: path27,
152488
- length: pathLength(path27)
152597
+ path: path29,
152598
+ length: pathLength(path29)
152489
152599
  });
152490
152600
  }
152491
152601
  }
@@ -152493,26 +152603,26 @@ function computeDumbbellPaths({
152493
152603
  return { index: 0, path: [] };
152494
152604
  }
152495
152605
  const optimalPath2 = validPaths.sort((a, b3) => a.length - b3.length)[0];
152496
- const path26 = [...optimalPath2.path];
152497
- const firstPoint = path26[0];
152498
- const dist3 = distance3(firstPoint, path26[2]);
152499
- const dist4 = distance3(firstPoint, path26[3]);
152606
+ const path28 = [...optimalPath2.path];
152607
+ const firstPoint = path28[0];
152608
+ const dist3 = distance3(firstPoint, path28[2]);
152609
+ const dist4 = distance3(firstPoint, path28[3]);
152500
152610
  const closerIdx = dist3 < dist4 ? 2 : 3;
152501
- if (dist3 < distance3(firstPoint, path26[1]) || dist4 < distance3(firstPoint, path26[1])) {
152502
- path26.splice(1, closerIdx - 1);
152611
+ if (dist3 < distance3(firstPoint, path28[1]) || dist4 < distance3(firstPoint, path28[1])) {
152612
+ path28.splice(1, closerIdx - 1);
152503
152613
  }
152504
- const lastPoint = path26[path26.length - 1];
152505
- const distM3 = distance3(lastPoint, path26[path26.length - 3]);
152506
- const distM4 = distance3(lastPoint, path26[path26.length - 4]);
152507
- const closerLastIdx = distM3 < distM4 ? path26.length - 3 : path26.length - 4;
152508
- if (distM3 < distance3(lastPoint, path26[path26.length - 2]) || distM4 < distance3(lastPoint, path26[path26.length - 2])) {
152509
- path26.splice(closerLastIdx + 1, path26.length - closerLastIdx - 2);
152614
+ const lastPoint = path28[path28.length - 1];
152615
+ const distM3 = distance3(lastPoint, path28[path28.length - 3]);
152616
+ const distM4 = distance3(lastPoint, path28[path28.length - 4]);
152617
+ const closerLastIdx = distM3 < distM4 ? path28.length - 3 : path28.length - 4;
152618
+ if (distM3 < distance3(lastPoint, path28[path28.length - 2]) || distM4 < distance3(lastPoint, path28[path28.length - 2])) {
152619
+ path28.splice(closerLastIdx + 1, path28.length - closerLastIdx - 2);
152510
152620
  }
152511
152621
  return {
152512
152622
  index: optimalPath2.index,
152513
- path: path26,
152514
- startsAt: path26[0] === C2 ? "C" : "D",
152515
- goesTo: path26[path26.length - 1] === C2 ? "C" : "D"
152623
+ path: path28,
152624
+ startsAt: path28[0] === C2 ? "C" : "D",
152625
+ goesTo: path28[path28.length - 1] === C2 ? "C" : "D"
152516
152626
  };
152517
152627
  };
152518
152628
  const optimalPath = findOptimalPath();
@@ -153932,9 +154042,9 @@ var ViaPossibilitiesSolver2 = class extends BaseSolver {
153932
154042
  let closestIntersection = null;
153933
154043
  let intersectedSegmentZ = null;
153934
154044
  const checkIntersectionsWithPathMap = (pathMap) => {
153935
- for (const path26 of pathMap.values()) {
153936
- for (let i = 0;i < path26.length - 1; i++) {
153937
- const segment2 = [path26[i], path26[i + 1]];
154045
+ for (const path28 of pathMap.values()) {
154046
+ for (let i = 0;i < path28.length - 1; i++) {
154047
+ const segment2 = [path28[i], path28[i + 1]];
153938
154048
  if (segment2[0].x === segment2[1].x && segment2[0].y === segment2[1].y) {
153939
154049
  continue;
153940
154050
  }
@@ -154064,11 +154174,11 @@ var ViaPossibilitiesSolver2 = class extends BaseSolver {
154064
154174
  });
154065
154175
  }
154066
154176
  const drawPath = (pathMap, labelPrefix) => {
154067
- for (const [connectionName, path26] of pathMap.entries()) {
154177
+ for (const [connectionName, path28] of pathMap.entries()) {
154068
154178
  const color = colorMap[connectionName] ?? "black";
154069
- for (let i = 0;i < path26.length - 1; i++) {
154070
- const p12 = path26[i];
154071
- const p2 = path26[i + 1];
154179
+ for (let i = 0;i < path28.length - 1; i++) {
154180
+ const p12 = path28[i];
154181
+ const p2 = path28[i + 1];
154072
154182
  if (p12.x === p2.x && p12.y === p2.y && p12.z !== p2.z) {
154073
154183
  graphics.circles.push({
154074
154184
  center: { x: p12.x, y: p12.y },
@@ -154666,10 +154776,10 @@ function detectMultiConnectionClosedFacesWithoutVias(polyLines, bounds) {
154666
154776
  const allSegments = [];
154667
154777
  const viaPoints = /* @__PURE__ */ new Map;
154668
154778
  for (const polyLine of polyLines) {
154669
- const path26 = [polyLine.start, ...polyLine.mPoints, polyLine.end];
154670
- for (let i = 0;i < path26.length - 1; i++) {
154671
- const p12 = path26[i];
154672
- const p2 = path26[i + 1];
154779
+ const path28 = [polyLine.start, ...polyLine.mPoints, polyLine.end];
154780
+ for (let i = 0;i < path28.length - 1; i++) {
154781
+ const p12 = path28[i];
154782
+ const p2 = path28[i + 1];
154673
154783
  const layer = p12.z2;
154674
154784
  allSegments.push({
154675
154785
  start: { x: p12.x, y: p12.y },
@@ -154687,7 +154797,7 @@ function detectMultiConnectionClosedFacesWithoutVias(polyLines, bounds) {
154687
154797
  }
154688
154798
  }
154689
154799
  }
154690
- const lastPoint = path26[path26.length - 1];
154800
+ const lastPoint = path28[path28.length - 1];
154691
154801
  if (lastPoint.z1 !== lastPoint.z2) {
154692
154802
  const key = pointKey2(lastPoint);
154693
154803
  if (!viaPoints.has(key)) {
@@ -154986,14 +155096,14 @@ var MultiHeadPolyLineIntraNodeSolver = class extends BaseSolver {
154986
155096
  const polyLineVias = [];
154987
155097
  for (let i = 0;i < polyLines.length; i++) {
154988
155098
  const polyLine = polyLines[i];
154989
- const path26 = [polyLine.start, ...polyLine.mPoints, polyLine.end];
155099
+ const path28 = [polyLine.start, ...polyLine.mPoints, polyLine.end];
154990
155100
  const segmentsByLayer = new Map(this.availableZ.map((z852) => [z852, []]));
154991
- for (let i22 = 0;i22 < path26.length - 1; i22++) {
154992
- const segment2 = [path26[i22], path26[i22 + 1]];
155101
+ for (let i22 = 0;i22 < path28.length - 1; i22++) {
155102
+ const segment2 = [path28[i22], path28[i22 + 1]];
154993
155103
  segmentsByLayer.get(segment2[0].z2).push(segment2);
154994
155104
  }
154995
155105
  polyLineSegmentsByLayer.push(segmentsByLayer);
154996
- polyLineVias.push(path26.filter((p) => p.z1 !== p.z2));
155106
+ polyLineVias.push(path28.filter((p) => p.z1 !== p.z2));
154997
155107
  }
154998
155108
  for (let i = 0;i < polyLines.length; i++) {
154999
155109
  const path1SegmentsByLayer = polyLineSegmentsByLayer[i];
@@ -156422,7 +156532,7 @@ var HighDensitySolver = class extends BaseSolver {
156422
156532
  if (this.failedSolvers.length > 0) {
156423
156533
  this.solved = false;
156424
156534
  this.failed = true;
156425
- this.error = `Failed to solve ${this.failedSolvers.length} nodes, ${this.failedSolvers.slice(0, 5).map((fs27) => fs27.nodeWithPortPoints.capacityMeshNodeId)}. err0: ${this.failedSolvers[0].error}.`;
156535
+ this.error = `Failed to solve ${this.failedSolvers.length} nodes, ${this.failedSolvers.slice(0, 5).map((fs29) => fs29.nodeWithPortPoints.capacityMeshNodeId)}. err0: ${this.failedSolvers[0].error}.`;
156426
156536
  return;
156427
156537
  }
156428
156538
  this.solved = true;
@@ -159203,13 +159313,13 @@ var CapacityPathingSolver = class extends BaseSolver {
159203
159313
  return this.getDistanceBetweenNodes(node, endGoal);
159204
159314
  }
159205
159315
  getBacktrackedPath(candidate) {
159206
- const path26 = [];
159316
+ const path28 = [];
159207
159317
  let currentCandidate = candidate;
159208
159318
  while (currentCandidate) {
159209
- path26.push(currentCandidate.node);
159319
+ path28.push(currentCandidate.node);
159210
159320
  currentCandidate = currentCandidate.prevCandidate;
159211
159321
  }
159212
- return path26;
159322
+ return path28;
159213
159323
  }
159214
159324
  getNeighboringNodes(node) {
159215
159325
  return this.nodeEdgeMap.get(node.capacityMeshNodeId).flatMap((edge) => edge.nodeIds.filter((n3) => n3 !== node.capacityMeshNodeId)).map((n3) => this.nodeMap.get(n3));
@@ -159217,12 +159327,12 @@ var CapacityPathingSolver = class extends BaseSolver {
159217
159327
  getCapacityPaths() {
159218
159328
  const capacityPaths = [];
159219
159329
  for (const connection of this.connectionsWithNodes) {
159220
- const path26 = connection.path;
159221
- if (path26) {
159330
+ const path28 = connection.path;
159331
+ if (path28) {
159222
159332
  capacityPaths.push({
159223
159333
  capacityPathId: connection.connection.name,
159224
159334
  connectionName: connection.connection.name,
159225
- nodeIds: path26.map((node) => node.capacityMeshNodeId)
159335
+ nodeIds: path28.map((node) => node.capacityMeshNodeId)
159226
159336
  });
159227
159337
  }
159228
159338
  }
@@ -159907,10 +160017,10 @@ var CapacityPathingSingleSectionSolver = class extends BaseSolver {
159907
160017
  return this.getDistanceBetweenNodes(node, endGoal) + this.getNodeCapacityPenalty(node);
159908
160018
  }
159909
160019
  getBacktrackedPath(candidate) {
159910
- const path26 = [];
160020
+ const path28 = [];
159911
160021
  let currentCandidate = candidate;
159912
160022
  while (currentCandidate) {
159913
- path26.push(currentCandidate.node);
160023
+ path28.push(currentCandidate.node);
159914
160024
  if (this.nodeMap.has(currentCandidate.node.capacityMeshNodeId)) {
159915
160025
  currentCandidate = currentCandidate.prevCandidate;
159916
160026
  } else {
@@ -159918,7 +160028,7 @@ var CapacityPathingSingleSectionSolver = class extends BaseSolver {
159918
160028
  break;
159919
160029
  }
159920
160030
  }
159921
- return path26.reverse();
160031
+ return path28.reverse();
159922
160032
  }
159923
160033
  getNeighboringNodes(node) {
159924
160034
  if (!this.nodeMap.has(node.capacityMeshNodeId))
@@ -159933,8 +160043,8 @@ var CapacityPathingSingleSectionSolver = class extends BaseSolver {
159933
160043
  doesNodeHaveCapacityForTrace(node, prevNode) {
159934
160044
  return true;
159935
160045
  }
159936
- reduceCapacityAlongPath(path26) {
159937
- for (const pathNode of path26) {
160046
+ reduceCapacityAlongPath(path28) {
160047
+ for (const pathNode of path28) {
159938
160048
  if (this.usedNodeCapacityMap.has(pathNode.capacityMeshNodeId)) {
159939
160049
  const nodeId = pathNode.capacityMeshNodeId;
159940
160050
  const nodeInSection = this.nodeMap.get(nodeId);
@@ -160063,9 +160173,9 @@ var CapacityPathingSingleSectionSolver = class extends BaseSolver {
160063
160173
  this.queuedNodes = null;
160064
160174
  }
160065
160175
  _handleGoalReached(currentCandidate, currentTerminal, endNode) {
160066
- const path26 = this.getBacktrackedPath(currentCandidate);
160067
- currentTerminal.path = path26;
160068
- this.reduceCapacityAlongPath(path26);
160176
+ const path28 = this.getBacktrackedPath(currentCandidate);
160177
+ currentTerminal.path = path28;
160178
+ this.reduceCapacityAlongPath(path28);
160069
160179
  this.currentConnectionIndex++;
160070
160180
  this.candidates = null;
160071
160181
  this.visitedNodes = null;
@@ -160114,10 +160224,10 @@ var CapacityPathingSingleSectionSolver = class extends BaseSolver {
160114
160224
  const connectionColor = this.colorMap[connectionName] ?? "purple";
160115
160225
  topCandidates.forEach((candidate, index) => {
160116
160226
  const opacity = 0.8 * (1 - index / 5);
160117
- const path26 = this.getBacktrackedPath(candidate);
160118
- if (path26.length > 0) {
160227
+ const path28 = this.getBacktrackedPath(candidate);
160228
+ if (path28.length > 0) {
160119
160229
  baseGraphics.lines.push({
160120
- points: path26.map(({ center: { x, y } }) => ({ x, y })),
160230
+ points: path28.map(({ center: { x, y } }) => ({ x, y })),
160121
160231
  strokeColor: safeTransparentize(connectionColor, 1 - opacity),
160122
160232
  strokeWidth: 0.05
160123
160233
  });
@@ -160806,12 +160916,12 @@ var CapacityPathingMultiSectionSolver = class extends BaseSolver {
160806
160916
  getCapacityPaths() {
160807
160917
  const capacityPaths = [];
160808
160918
  for (const connection of this.connectionsWithNodes) {
160809
- const path26 = connection.path;
160810
- if (path26) {
160919
+ const path28 = connection.path;
160920
+ if (path28) {
160811
160921
  capacityPaths.push({
160812
160922
  capacityPathId: connection.connection.name,
160813
160923
  connectionName: connection.connection.name,
160814
- nodeIds: path26.map((node) => node.capacityMeshNodeId)
160924
+ nodeIds: path28.map((node) => node.capacityMeshNodeId)
160815
160925
  });
160816
160926
  }
160817
160927
  }
@@ -161832,22 +161942,22 @@ var SingleSimplifiedPathSolver5 = class extends SingleSimplifiedPathSolver {
161832
161942
  return null;
161833
161943
  }
161834
161944
  const possiblePaths = calculate45DegreePaths({ x: start.x, y: start.y }, { x: end.x, y: end.y });
161835
- for (const path26 of possiblePaths) {
161836
- const fullPath = path26.map((p) => ({ x: p.x, y: p.y, z: start.z }));
161945
+ for (const path28 of possiblePaths) {
161946
+ const fullPath = path28.map((p) => ({ x: p.x, y: p.y, z: start.z }));
161837
161947
  if (this.isValidPath(fullPath)) {
161838
161948
  return fullPath;
161839
161949
  }
161840
161950
  }
161841
161951
  return null;
161842
161952
  }
161843
- addPathToResult(path26) {
161844
- if (path26.length === 0)
161953
+ addPathToResult(path28) {
161954
+ if (path28.length === 0)
161845
161955
  return;
161846
- for (let i = 0;i < path26.length; i++) {
161847
- if (i === 0 && this.newRoute.length > 0 && this.arePointsEqual(this.newRoute[this.newRoute.length - 1], path26[i])) {
161956
+ for (let i = 0;i < path28.length; i++) {
161957
+ if (i === 0 && this.newRoute.length > 0 && this.arePointsEqual(this.newRoute[this.newRoute.length - 1], path28[i])) {
161848
161958
  continue;
161849
161959
  }
161850
- this.newRoute.push(path26[i]);
161960
+ this.newRoute.push(path28[i]);
161851
161961
  }
161852
161962
  this.currentStepSize = this.maxStepSize;
161853
161963
  }
@@ -185176,9 +185286,9 @@ var preprocessSelector = (selector) => {
185176
185286
  const netName = match ? match[1] : "";
185177
185287
  throw new Error(`Net name "${netName}" cannot start with a number, try using a prefix like "VBUS1"`);
185178
185288
  }
185179
- return selector.replace(/ pin(?=[\d.])/g, " port").replace(/ subcircuit\./g, " group[isSubcircuit=true]").replace(/([^ ])\>([^ ])/g, "$1 > $2").replace(/(^|[ >])(?!pin\.)(?!port\.)(?!net\.)([A-Z][A-Za-z0-9_-]*)\.([A-Za-z0-9_-]+)/g, (_, sep, name, pin) => {
185289
+ return selector.replace(/ pin(?=[\d.])/g, " port").replace(/ subcircuit\./g, " group[isSubcircuit=true]").replace(/([^ ])\>([^ ])/g, "$1 > $2").replace(/(^|[ >])(?!pin\.)(?!port\.)(?!net\.)([A-Z][A-Za-z0-9_-]*)\.([A-Za-z0-9_-]+)/g, (_, sep2, name, pin) => {
185180
185290
  const pinPart = /^\d+$/.test(pin) ? `pin${pin}` : pin;
185181
- return `${sep}.${name} > .${pinPart}`;
185291
+ return `${sep2}.${name} > .${pinPart}`;
185182
185292
  }).trim();
185183
185293
  };
185184
185294
  var cssSelectOptionsInsideSubcircuit = {
@@ -189254,7 +189364,7 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
189254
189364
  for (let i = 0;i < portsWithPosition.length - 1; i++) {
189255
189365
  const start = portsWithPosition[i];
189256
189366
  const end = portsWithPosition[i + 1];
189257
- const path26 = calculateElbow({
189367
+ const path28 = calculateElbow({
189258
189368
  x: start.position.x,
189259
189369
  y: start.position.y,
189260
189370
  facingDirection: convertFacingDirectionToElbowDirection(start.facingDirection)
@@ -189263,8 +189373,8 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
189263
189373
  y: end.position.y,
189264
189374
  facingDirection: convertFacingDirectionToElbowDirection(end.facingDirection)
189265
189375
  });
189266
- for (let j4 = 0;j4 < path26.length - 1; j4++) {
189267
- elbowEdges.push({ from: path26[j4], to: path26[j4 + 1] });
189376
+ for (let j4 = 0;j4 < path28.length - 1; j4++) {
189377
+ elbowEdges.push({ from: path28[j4], to: path28[j4 + 1] });
189268
189378
  }
189269
189379
  }
189270
189380
  const doesSegmentIntersectRect = (edge, rect) => {
@@ -192124,7 +192234,7 @@ var Group = class extends NormalComponent {
192124
192234
  });
192125
192235
  throw err;
192126
192236
  }
192127
- await new Promise((resolve10) => setTimeout(resolve10, 100));
192237
+ await new Promise((resolve11) => setTimeout(resolve11, 100));
192128
192238
  }
192129
192239
  }
192130
192240
  async _runLocalAutorouting() {
@@ -192157,10 +192267,10 @@ var Group = class extends NormalComponent {
192157
192267
  targetMinCapacity: this.props.autorouter?.targetMinCapacity
192158
192268
  });
192159
192269
  }
192160
- const routingPromise = new Promise((resolve10, reject) => {
192270
+ const routingPromise = new Promise((resolve11, reject) => {
192161
192271
  autorouter.on("complete", (event) => {
192162
192272
  debug622(`[${this.getString()}] local autorouting complete`);
192163
- resolve10(event.traces);
192273
+ resolve11(event.traces);
192164
192274
  });
192165
192275
  autorouter.on("error", (event) => {
192166
192276
  debug622(`[${this.getString()}] local autorouting error: ${event.error.message}`);
@@ -195452,8 +195562,8 @@ react/cjs/react-jsx-runtime.development.js:
195452
195562
  */
195453
195563
 
195454
195564
  // lib/import/import-component-from-jlcpcb.ts
195455
- import fs27 from "node:fs/promises";
195456
- import path26 from "node:path";
195565
+ import fs29 from "node:fs/promises";
195566
+ import path28 from "node:path";
195457
195567
  var importComponentFromJlcpcb = async (jlcpcbPartNumber, projectDir = process.cwd()) => {
195458
195568
  const component = await fetchEasyEDAComponent(jlcpcbPartNumber);
195459
195569
  const tsx = await convertRawEasyToTsx(component);
@@ -195461,10 +195571,10 @@ var importComponentFromJlcpcb = async (jlcpcbPartNumber, projectDir = process.cw
195461
195571
  if (!fileName) {
195462
195572
  throw new Error("Could not determine file name of converted component");
195463
195573
  }
195464
- const importsDir = path26.join(projectDir, "imports");
195465
- await fs27.mkdir(importsDir, { recursive: true });
195466
- const filePath = path26.join(importsDir, `${fileName}.tsx`);
195467
- await fs27.writeFile(filePath, tsx);
195574
+ const importsDir = path28.join(projectDir, "imports");
195575
+ await fs29.mkdir(importsDir, { recursive: true });
195576
+ const filePath = path28.join(importsDir, `${fileName}.tsx`);
195577
+ await fs29.writeFile(filePath, tsx);
195468
195578
  return { filePath };
195469
195579
  };
195470
195580
 
@@ -195565,12 +195675,12 @@ var registerRemove = (program3) => {
195565
195675
  };
195566
195676
 
195567
195677
  // cli/build/register.ts
195568
- import path30 from "node:path";
195569
- import fs31 from "node:fs";
195678
+ import path32 from "node:path";
195679
+ import fs33 from "node:fs";
195570
195680
 
195571
195681
  // cli/build/build-file.ts
195572
- import path27 from "node:path";
195573
- import fs28 from "node:fs";
195682
+ import path29 from "node:path";
195683
+ import fs30 from "node:fs";
195574
195684
 
195575
195685
  // lib/shared/circuit-json-diagnostics.ts
195576
195686
  function analyzeCircuitJson(circuitJson) {
@@ -195602,9 +195712,9 @@ var buildFile = async (input, output, projectDir, options) => {
195602
195712
  filePath: input,
195603
195713
  platformConfig: options?.platformConfig
195604
195714
  });
195605
- fs28.mkdirSync(path27.dirname(output), { recursive: true });
195606
- fs28.writeFileSync(output, JSON.stringify(result.circuitJson, null, 2));
195607
- console.log(`Circuit JSON written to ${path27.relative(projectDir, output)}`);
195715
+ fs30.mkdirSync(path29.dirname(output), { recursive: true });
195716
+ fs30.writeFileSync(output, JSON.stringify(result.circuitJson, null, 2));
195717
+ console.log(`Circuit JSON written to ${path29.relative(projectDir, output)}`);
195608
195718
  const { errors, warnings } = analyzeCircuitJson(result.circuitJson);
195609
195719
  if (!options?.ignoreWarnings) {
195610
195720
  for (const warn of warnings) {
@@ -195632,17 +195742,17 @@ var buildFile = async (input, output, projectDir, options) => {
195632
195742
  };
195633
195743
 
195634
195744
  // cli/build/get-build-entrypoints.ts
195635
- import fs29 from "node:fs";
195636
- import path28 from "node:path";
195745
+ import fs31 from "node:fs";
195746
+ import path30 from "node:path";
195637
195747
  var isSubPath2 = (maybeChild, maybeParent) => {
195638
- const relative9 = path28.relative(maybeParent, maybeChild);
195639
- return relative9 === "" || !relative9.startsWith("..") && !path28.isAbsolute(relative9);
195748
+ const relative10 = path30.relative(maybeParent, maybeChild);
195749
+ return relative10 === "" || !relative10.startsWith("..") && !path30.isAbsolute(relative10);
195640
195750
  };
195641
195751
  async function getBuildEntrypoints({
195642
195752
  fileOrDir,
195643
195753
  rootDir = process.cwd()
195644
195754
  }) {
195645
- const resolvedRoot = path28.resolve(rootDir);
195755
+ const resolvedRoot = path30.resolve(rootDir);
195646
195756
  const includeBoardFiles = getBoardFilePatterns(resolvedRoot);
195647
195757
  const buildFromProjectDir = async () => {
195648
195758
  const files = findBoardFiles({ projectDir: resolvedRoot });
@@ -195674,8 +195784,8 @@ async function getBuildEntrypoints({
195674
195784
  };
195675
195785
  };
195676
195786
  if (fileOrDir) {
195677
- const resolved = path28.resolve(resolvedRoot, fileOrDir);
195678
- if (fs29.existsSync(resolved) && fs29.statSync(resolved).isDirectory()) {
195787
+ const resolved = path30.resolve(resolvedRoot, fileOrDir);
195788
+ if (fs31.existsSync(resolved) && fs31.statSync(resolved).isDirectory()) {
195679
195789
  const circuitFiles = findBoardFiles({
195680
195790
  projectDir: resolvedRoot,
195681
195791
  filePaths: [resolved]
@@ -195688,7 +195798,7 @@ async function getBuildEntrypoints({
195688
195798
  circuitFiles
195689
195799
  };
195690
195800
  }
195691
- return { projectDir: path28.dirname(resolved), circuitFiles: [resolved] };
195801
+ return { projectDir: path30.dirname(resolved), circuitFiles: [resolved] };
195692
195802
  }
195693
195803
  return buildFromProjectDir();
195694
195804
  }
@@ -195722,8 +195832,8 @@ ${scriptBlock} <script src="https://cdn.tailwindcss.com"></script>
195722
195832
  };
195723
195833
 
195724
195834
  // cli/build/build-preview-images.ts
195725
- import fs30 from "node:fs";
195726
- import path29 from "node:path";
195835
+ import fs32 from "node:fs";
195836
+ import path31 from "node:path";
195727
195837
  import {
195728
195838
  convertCircuitJsonToPcbSvg as convertCircuitJsonToPcbSvg2,
195729
195839
  convertCircuitJsonToSchematicSvg as convertCircuitJsonToSchematicSvg2
@@ -195768,10 +195878,10 @@ var generatePreviewAssets = async ({
195768
195878
  outputDir,
195769
195879
  distDir
195770
195880
  }) => {
195771
- const prefixRelative = path29.relative(distDir, outputDir) || ".";
195881
+ const prefixRelative = path31.relative(distDir, outputDir) || ".";
195772
195882
  const prefix = prefixRelative === "." ? "" : `[${prefixRelative}] `;
195773
195883
  try {
195774
- const circuitJsonRaw = fs30.readFileSync(build.outputPath, "utf-8");
195884
+ const circuitJsonRaw = fs32.readFileSync(build.outputPath, "utf-8");
195775
195885
  const circuitJson = JSON.parse(circuitJsonRaw);
195776
195886
  console.log(`${prefix}Generating PCB SVG...`);
195777
195887
  const pcbSvg = convertCircuitJsonToPcbSvg2(circuitJson);
@@ -195787,12 +195897,12 @@ var generatePreviewAssets = async ({
195787
195897
  camPos: [10, 10, 10],
195788
195898
  lookAt: [0, 0, 0]
195789
195899
  });
195790
- fs30.mkdirSync(outputDir, { recursive: true });
195791
- fs30.writeFileSync(path29.join(outputDir, "pcb.svg"), pcbSvg, "utf-8");
195900
+ fs32.mkdirSync(outputDir, { recursive: true });
195901
+ fs32.writeFileSync(path31.join(outputDir, "pcb.svg"), pcbSvg, "utf-8");
195792
195902
  console.log(`${prefix}Written pcb.svg`);
195793
- fs30.writeFileSync(path29.join(outputDir, "schematic.svg"), schematicSvg, "utf-8");
195903
+ fs32.writeFileSync(path31.join(outputDir, "schematic.svg"), schematicSvg, "utf-8");
195794
195904
  console.log(`${prefix}Written schematic.svg`);
195795
- fs30.writeFileSync(path29.join(outputDir, "3d.png"), Buffer.from(normalizeToUint8Array(pngBuffer)));
195905
+ fs32.writeFileSync(path31.join(outputDir, "3d.png"), Buffer.from(normalizeToUint8Array(pngBuffer)));
195796
195906
  console.log(`${prefix}Written 3d.png`);
195797
195907
  } catch (error) {
195798
195908
  console.error(`${prefix}Failed to generate preview images:`, error);
@@ -195805,14 +195915,14 @@ var buildPreviewImages = async ({
195805
195915
  allImages
195806
195916
  }) => {
195807
195917
  const successfulBuilds = builtFiles.filter((file) => file.ok);
195808
- const normalizedMainEntrypoint = mainEntrypoint ? path29.resolve(mainEntrypoint) : undefined;
195918
+ const normalizedMainEntrypoint = mainEntrypoint ? path31.resolve(mainEntrypoint) : undefined;
195809
195919
  if (allImages) {
195810
195920
  if (successfulBuilds.length === 0) {
195811
195921
  console.warn("No successful build output available for preview image generation.");
195812
195922
  return;
195813
195923
  }
195814
195924
  for (const build of successfulBuilds) {
195815
- const outputDir = path29.dirname(build.outputPath);
195925
+ const outputDir = path31.dirname(build.outputPath);
195816
195926
  await generatePreviewAssets({
195817
195927
  build,
195818
195928
  outputDir,
@@ -195823,7 +195933,7 @@ var buildPreviewImages = async ({
195823
195933
  }
195824
195934
  const previewBuild = (() => {
195825
195935
  if (normalizedMainEntrypoint) {
195826
- const match = successfulBuilds.find((built) => path29.resolve(built.sourcePath) === normalizedMainEntrypoint);
195936
+ const match = successfulBuilds.find((built) => path31.resolve(built.sourcePath) === normalizedMainEntrypoint);
195827
195937
  if (match)
195828
195938
  return match;
195829
195939
  }
@@ -195859,17 +195969,17 @@ var registerBuild = (program3) => {
195859
195969
  }
195860
195970
  return config;
195861
195971
  })();
195862
- const distDir = path30.join(projectDir, "dist");
195863
- fs31.mkdirSync(distDir, { recursive: true });
195972
+ const distDir = path32.join(projectDir, "dist");
195973
+ fs33.mkdirSync(distDir, { recursive: true });
195864
195974
  console.log(`Building ${circuitFiles.length} file(s)...`);
195865
195975
  let hasErrors = false;
195866
195976
  const staticFileReferences = [];
195867
195977
  const builtFiles = [];
195868
195978
  for (const filePath of circuitFiles) {
195869
- const relative9 = path30.relative(projectDir, filePath);
195870
- console.log(`Building ${relative9}...`);
195871
- const outputDirName = relative9.replace(/(\.board|\.circuit)?\.tsx$/, "");
195872
- const outputPath = path30.join(distDir, outputDirName, "circuit.json");
195979
+ const relative10 = path32.relative(projectDir, filePath);
195980
+ console.log(`Building ${relative10}...`);
195981
+ const outputDirName = relative10.replace(/(\.board|\.circuit)?\.tsx$/, "");
195982
+ const outputPath = path32.join(distDir, outputDirName, "circuit.json");
195873
195983
  const ok = await buildFile(filePath, outputPath, projectDir, {
195874
195984
  ignoreErrors: options?.ignoreErrors,
195875
195985
  ignoreWarnings: options?.ignoreWarnings,
@@ -195883,9 +195993,9 @@ var registerBuild = (program3) => {
195883
195993
  if (!ok) {
195884
195994
  hasErrors = true;
195885
195995
  } else if (options?.site) {
195886
- const normalizedSourcePath = relative9.split(path30.sep).join("/");
195887
- const relativeOutputPath = path30.join(outputDirName, "circuit.json");
195888
- const normalizedOutputPath = relativeOutputPath.split(path30.sep).join("/");
195996
+ const normalizedSourcePath = relative10.split(path32.sep).join("/");
195997
+ const relativeOutputPath = path32.join(outputDirName, "circuit.json");
195998
+ const normalizedOutputPath = relativeOutputPath.split(path32.sep).join("/");
195889
195999
  staticFileReferences.push({
195890
196000
  filePath: normalizedSourcePath,
195891
196001
  fileStaticAssetUrl: `./${normalizedOutputPath}`
@@ -195910,8 +196020,8 @@ var registerBuild = (program3) => {
195910
196020
  files: staticFileReferences,
195911
196021
  standaloneScriptSrc: "./standalone.min.js"
195912
196022
  });
195913
- fs31.writeFileSync(path30.join(distDir, "index.html"), indexHtml);
195914
- fs31.writeFileSync(path30.join(distDir, "standalone.min.js"), standalone_min_default);
196023
+ fs33.writeFileSync(path32.join(distDir, "index.html"), indexHtml);
196024
+ fs33.writeFileSync(path32.join(distDir, "standalone.min.js"), standalone_min_default);
195915
196025
  }
195916
196026
  console.log("Build complete!");
195917
196027
  process.exit(0);
@@ -195924,8 +196034,8 @@ var registerBuild = (program3) => {
195924
196034
  };
195925
196035
 
195926
196036
  // lib/shared/snapshot-project.ts
195927
- import fs33 from "node:fs";
195928
- import path31 from "node:path";
196037
+ import fs35 from "node:fs";
196038
+ import path33 from "node:path";
195929
196039
  import looksSame2 from "looks-same";
195930
196040
  import {
195931
196041
  convertCircuitJsonToPcbSvg as convertCircuitJsonToPcbSvg3,
@@ -195936,7 +196046,7 @@ import { renderGLTFToPNGBufferFromGLBBuffer as renderGLTFToPNGBufferFromGLBBuffe
195936
196046
 
195937
196047
  // lib/shared/compare-images.ts
195938
196048
  import looksSame from "looks-same";
195939
- import fs32 from "node:fs/promises";
196049
+ import fs34 from "node:fs/promises";
195940
196050
  var compareAndCreateDiff = async (buffer1, buffer2, diffPath) => {
195941
196051
  const { equal: equal2 } = await looksSame(buffer1, buffer2, {
195942
196052
  strict: false,
@@ -195952,7 +196062,7 @@ var compareAndCreateDiff = async (buffer1, buffer2, diffPath) => {
195952
196062
  tolerance: 2
195953
196063
  });
195954
196064
  } else {
195955
- await fs32.writeFile(diffPath, buffer2);
196065
+ await fs34.writeFile(diffPath, buffer2);
195956
196066
  }
195957
196067
  }
195958
196068
  return { equal: equal2 };
@@ -195977,7 +196087,7 @@ var snapshotProject = async ({
195977
196087
  ...DEFAULT_IGNORED_PATTERNS,
195978
196088
  ...ignored.map(normalizeIgnorePattern)
195979
196089
  ];
195980
- const resolvedPaths = filePaths.map((f) => path31.resolve(projectDir, f));
196090
+ const resolvedPaths = filePaths.map((f) => path33.resolve(projectDir, f));
195981
196091
  const boardFiles = findBoardFiles({
195982
196092
  projectDir,
195983
196093
  ignore,
@@ -195991,7 +196101,7 @@ var snapshotProject = async ({
195991
196101
  const mismatches = [];
195992
196102
  let didUpdate = false;
195993
196103
  for (const file of boardFiles) {
195994
- const relativeFilePath = path31.relative(projectDir, file);
196104
+ const relativeFilePath = path33.relative(projectDir, file);
195995
196105
  let circuitJson;
195996
196106
  let pcbSvg;
195997
196107
  let schSvg;
@@ -196045,17 +196155,17 @@ var snapshotProject = async ({
196045
196155
  } catch (error) {
196046
196156
  const errorMessage = error instanceof Error ? error.message : String(error);
196047
196157
  if (errorMessage.includes("No pcb_board found in circuit JSON")) {
196048
- const fileDir = path31.dirname(file);
196049
- const relativeDir = path31.relative(projectDir, fileDir);
196050
- const snapDir2 = snapshotsDirName ? path31.join(projectDir, snapshotsDirName, relativeDir) : path31.join(fileDir, "__snapshots__");
196051
- const base2 = path31.basename(file).replace(/\.tsx$/, "");
196052
- const snap3dPath = path31.join(snapDir2, `${base2}-3d.snap.png`);
196053
- const existing3dSnapshot = fs33.existsSync(snap3dPath);
196158
+ const fileDir = path33.dirname(file);
196159
+ const relativeDir = path33.relative(projectDir, fileDir);
196160
+ const snapDir2 = snapshotsDirName ? path33.join(projectDir, snapshotsDirName, relativeDir) : path33.join(fileDir, "__snapshots__");
196161
+ const base2 = path33.basename(file).replace(/\.tsx$/, "");
196162
+ const snap3dPath = path33.join(snapDir2, `${base2}-3d.snap.png`);
196163
+ const existing3dSnapshot = fs35.existsSync(snap3dPath);
196054
196164
  if (existing3dSnapshot) {
196055
196165
  onError(kleur_default.red(`
196056
196166
  ❌ Failed to generate 3D snapshot for ${relativeFilePath}:
196057
196167
  `) + kleur_default.red(` No pcb_board found in circuit JSON
196058
- `) + kleur_default.red(` Existing snapshot: ${path31.relative(projectDir, snap3dPath)}
196168
+ `) + kleur_default.red(` Existing snapshot: ${path33.relative(projectDir, snap3dPath)}
196059
196169
  `));
196060
196170
  return onExit(1);
196061
196171
  } else {
@@ -196071,9 +196181,9 @@ var snapshotProject = async ({
196071
196181
  }
196072
196182
  }
196073
196183
  }
196074
- const snapDir = snapshotsDirName ? path31.join(projectDir, snapshotsDirName, path31.relative(projectDir, path31.dirname(file))) : path31.join(path31.dirname(file), "__snapshots__");
196075
- fs33.mkdirSync(snapDir, { recursive: true });
196076
- const base = path31.basename(file).replace(/\.tsx$/, "");
196184
+ const snapDir = snapshotsDirName ? path33.join(projectDir, snapshotsDirName, path33.relative(projectDir, path33.dirname(file))) : path33.join(path33.dirname(file), "__snapshots__");
196185
+ fs35.mkdirSync(snapDir, { recursive: true });
196186
+ const base = path33.basename(file).replace(/\.tsx$/, "");
196077
196187
  const snapshots = [];
196078
196188
  if (pcbOnly || !schematicOnly) {
196079
196189
  snapshots.push({ type: "pcb", content: pcbSvg, isBinary: false });
@@ -196091,31 +196201,31 @@ var snapshotProject = async ({
196091
196201
  for (const snapshot of snapshots) {
196092
196202
  const { type } = snapshot;
196093
196203
  const is3d = type === "3d";
196094
- const snapPath = path31.join(snapDir, `${base}-${type}.snap.${is3d ? "png" : "svg"}`);
196095
- const existing = fs33.existsSync(snapPath);
196204
+ const snapPath = path33.join(snapDir, `${base}-${type}.snap.${is3d ? "png" : "svg"}`);
196205
+ const existing = fs35.existsSync(snapPath);
196096
196206
  const newContentBuffer = snapshot.isBinary ? snapshot.content : Buffer.from(snapshot.content, "utf8");
196097
196207
  const newContentForFile = snapshot.content;
196098
196208
  if (!existing) {
196099
- fs33.writeFileSync(snapPath, newContentForFile);
196100
- console.log("✅", kleur_default.gray(path31.relative(projectDir, snapPath)));
196209
+ fs35.writeFileSync(snapPath, newContentForFile);
196210
+ console.log("✅", kleur_default.gray(path33.relative(projectDir, snapPath)));
196101
196211
  didUpdate = true;
196102
196212
  continue;
196103
196213
  }
196104
- const oldContentBuffer = fs33.readFileSync(snapPath);
196214
+ const oldContentBuffer = fs35.readFileSync(snapPath);
196105
196215
  const diffPath = snapPath.replace(is3d ? ".snap.png" : ".snap.svg", is3d ? ".diff.png" : ".diff.svg");
196106
196216
  const { equal: equal2 } = await compareAndCreateDiff(oldContentBuffer, newContentBuffer, diffPath);
196107
196217
  if (update) {
196108
196218
  if (!forceUpdate && equal2) {
196109
- console.log("✅", kleur_default.gray(path31.relative(projectDir, snapPath)));
196219
+ console.log("✅", kleur_default.gray(path33.relative(projectDir, snapPath)));
196110
196220
  } else {
196111
- fs33.writeFileSync(snapPath, newContentForFile);
196112
- console.log("✅", kleur_default.gray(path31.relative(projectDir, snapPath)));
196221
+ fs35.writeFileSync(snapPath, newContentForFile);
196222
+ console.log("✅", kleur_default.gray(path33.relative(projectDir, snapPath)));
196113
196223
  didUpdate = true;
196114
196224
  }
196115
196225
  } else if (!equal2) {
196116
196226
  mismatches.push(`${snapPath} (diff: ${diffPath})`);
196117
196227
  } else {
196118
- console.log("✅", kleur_default.gray(path31.relative(projectDir, snapPath)));
196228
+ console.log("✅", kleur_default.gray(path33.relative(projectDir, snapPath)));
196119
196229
  }
196120
196230
  }
196121
196231
  }
@@ -196154,22 +196264,22 @@ var registerSnapshot = (program3) => {
196154
196264
  };
196155
196265
 
196156
196266
  // lib/shared/setup-github-actions.ts
196157
- import fs34 from "node:fs";
196158
- import path32 from "node:path";
196267
+ import fs36 from "node:fs";
196268
+ import path34 from "node:path";
196159
196269
  var setupGithubActions = (projectDir = process.cwd()) => {
196160
196270
  const findGitRoot = (startDir) => {
196161
- let dir = path32.resolve(startDir);
196162
- while (dir !== path32.parse(dir).root) {
196163
- if (fs34.existsSync(path32.join(dir, ".git"))) {
196271
+ let dir = path34.resolve(startDir);
196272
+ while (dir !== path34.parse(dir).root) {
196273
+ if (fs36.existsSync(path34.join(dir, ".git"))) {
196164
196274
  return dir;
196165
196275
  }
196166
- dir = path32.dirname(dir);
196276
+ dir = path34.dirname(dir);
196167
196277
  }
196168
196278
  return null;
196169
196279
  };
196170
196280
  const gitRoot = findGitRoot(projectDir) ?? projectDir;
196171
- const workflowsDir = path32.join(gitRoot, ".github", "workflows");
196172
- fs34.mkdirSync(workflowsDir, { recursive: true });
196281
+ const workflowsDir = path34.join(gitRoot, ".github", "workflows");
196282
+ fs36.mkdirSync(workflowsDir, { recursive: true });
196173
196283
  const buildWorkflow = `name: tscircuit Build
196174
196284
 
196175
196285
  on:
@@ -196208,8 +196318,8 @@ jobs:
196208
196318
  - run: bun install
196209
196319
  - run: bunx tsci snapshot
196210
196320
  `;
196211
- writeFileIfNotExists(path32.join(workflowsDir, "tscircuit-build.yml"), buildWorkflow);
196212
- writeFileIfNotExists(path32.join(workflowsDir, "tscircuit-snapshot.yml"), snapshotWorkflow);
196321
+ writeFileIfNotExists(path34.join(workflowsDir, "tscircuit-build.yml"), buildWorkflow);
196322
+ writeFileIfNotExists(path34.join(workflowsDir, "tscircuit-snapshot.yml"), snapshotWorkflow);
196213
196323
  };
196214
196324
 
196215
196325
  // cli/setup/register.ts
@@ -196235,8 +196345,8 @@ var registerSetup = (program3) => {
196235
196345
  };
196236
196346
 
196237
196347
  // cli/convert/register.ts
196238
- import fs35 from "node:fs/promises";
196239
- import path33 from "node:path";
196348
+ import fs37 from "node:fs/promises";
196349
+ import path35 from "node:path";
196240
196350
  import { parseKicadModToCircuitJson } from "kicad-component-converter";
196241
196351
 
196242
196352
  // node_modules/@tscircuit/mm/dist/index.js
@@ -196356,15 +196466,15 @@ var convertCircuitJsonToTscircuit = (circuitJson, opts) => {
196356
196466
  var registerConvert = (program3) => {
196357
196467
  program3.command("convert").description("Convert a .kicad_mod footprint to a tscircuit component").argument("<file>", "Path to the .kicad_mod file").option("-o, --output <path>", "Output TSX file path").option("-n, --name <component>", "Component name for export").action(async (file, options) => {
196358
196468
  try {
196359
- const inputPath = path33.resolve(file);
196360
- const modContent = await fs35.readFile(inputPath, "utf-8");
196469
+ const inputPath = path35.resolve(file);
196470
+ const modContent = await fs37.readFile(inputPath, "utf-8");
196361
196471
  const circuitJson = await parseKicadModToCircuitJson(modContent);
196362
- const componentName = options.name ?? path33.basename(inputPath, ".kicad_mod");
196472
+ const componentName = options.name ?? path35.basename(inputPath, ".kicad_mod");
196363
196473
  const tsx = convertCircuitJsonToTscircuit(circuitJson, {
196364
196474
  componentName
196365
196475
  });
196366
- const outputPath = options.output ? path33.resolve(options.output) : path33.join(path33.dirname(inputPath), `${componentName}.tsx`);
196367
- await fs35.writeFile(outputPath, tsx);
196476
+ const outputPath = options.output ? path35.resolve(options.output) : path35.join(path35.dirname(inputPath), `${componentName}.tsx`);
196477
+ await fs37.writeFile(outputPath, tsx);
196368
196478
  console.log(kleur_default.green(`Converted ${outputPath}`));
196369
196479
  } catch (error) {
196370
196480
  console.error(kleur_default.red("Failed to convert footprint:"), error instanceof Error ? error.message : error);