@tscircuit/3d-viewer 0.0.575 → 0.0.577

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/index.js +1142 -805
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -638,13 +638,13 @@ var require_fromVec2 = __commonJS({
638
638
  var require_length = __commonJS({
639
639
  "node_modules/@jscad/modeling/src/maths/vec3/length.js"(exports, module) {
640
640
  "use strict";
641
- var length63 = (vector) => {
641
+ var length64 = (vector) => {
642
642
  const x = vector[0];
643
643
  const y = vector[1];
644
644
  const z21 = vector[2];
645
645
  return Math.sqrt(x * x + y * y + z21 * z21);
646
646
  };
647
- module.exports = length63;
647
+ module.exports = length64;
648
648
  }
649
649
  });
650
650
 
@@ -1781,8 +1781,8 @@ var require_fromValues3 = __commonJS({
1781
1781
  var require_length2 = __commonJS({
1782
1782
  "node_modules/@jscad/modeling/src/maths/vec2/length.js"(exports, module) {
1783
1783
  "use strict";
1784
- var length63 = (vector) => Math.sqrt(vector[0] * vector[0] + vector[1] * vector[1]);
1785
- module.exports = length63;
1784
+ var length64 = (vector) => Math.sqrt(vector[0] * vector[0] + vector[1] * vector[1]);
1785
+ module.exports = length64;
1786
1786
  }
1787
1787
  });
1788
1788
 
@@ -2042,14 +2042,14 @@ var require_fromPoints = __commonJS({
2042
2042
  if (!Array.isArray(points)) {
2043
2043
  throw new Error("the given points must be an array");
2044
2044
  }
2045
- let length63 = points.length;
2046
- if (length63 < 3) {
2045
+ let length64 = points.length;
2046
+ if (length64 < 3) {
2047
2047
  throw new Error("the given points must define a closed geometry with three or more points");
2048
2048
  }
2049
- if (vec2.equals(points[0], points[length63 - 1])) --length63;
2049
+ if (vec2.equals(points[0], points[length64 - 1])) --length64;
2050
2050
  const sides2 = [];
2051
- let prevpoint = points[length63 - 1];
2052
- for (let i = 0; i < length63; i++) {
2051
+ let prevpoint = points[length64 - 1];
2052
+ for (let i = 0; i < length64; i++) {
2053
2053
  const point = points[i];
2054
2054
  sides2.push([vec2.clone(prevpoint), vec2.clone(point)]);
2055
2055
  prevpoint = point;
@@ -2664,7 +2664,7 @@ var require_Face = __commonJS({
2664
2664
  var copy = require_copy2();
2665
2665
  var cross = require_cross();
2666
2666
  var dot = require_dot();
2667
- var length63 = require_length();
2667
+ var length64 = require_length();
2668
2668
  var normalize = require_normalize();
2669
2669
  var scale2 = require_scale();
2670
2670
  var subtract4 = require_subtract();
@@ -2713,7 +2713,7 @@ var require_Face = __commonJS({
2713
2713
  e2 = e2.next;
2714
2714
  this.nVertices += 1;
2715
2715
  }
2716
- this.area = length63(this.normal);
2716
+ this.area = length64(this.normal);
2717
2717
  this.normal = scale2(this.normal, this.normal, 1 / this.area);
2718
2718
  }
2719
2719
  computeNormalMinArea(minArea) {
@@ -4984,12 +4984,12 @@ var require_equals5 = __commonJS({
4984
4984
  }
4985
4985
  const apoints = toPoints(a);
4986
4986
  const bpoints = toPoints(b);
4987
- const length63 = apoints.length;
4987
+ const length64 = apoints.length;
4988
4988
  let offset4 = 0;
4989
4989
  do {
4990
4990
  let unequal = false;
4991
- for (let i = 0; i < length63; i++) {
4992
- if (!vec2.equals(apoints[i], bpoints[(i + offset4) % length63])) {
4991
+ for (let i = 0; i < length64; i++) {
4992
+ if (!vec2.equals(apoints[i], bpoints[(i + offset4) % length64])) {
4993
4993
  unequal = true;
4994
4994
  break;
4995
4995
  }
@@ -5000,7 +5000,7 @@ var require_equals5 = __commonJS({
5000
5000
  if (!a.isClosed) {
5001
5001
  return false;
5002
5002
  }
5003
- } while (++offset4 < length63);
5003
+ } while (++offset4 < length64);
5004
5004
  return false;
5005
5005
  };
5006
5006
  module.exports = equals;
@@ -5853,8 +5853,8 @@ var require_length3 = __commonJS({
5853
5853
  "node_modules/@jscad/modeling/src/curves/bezier/length.js"(exports, module) {
5854
5854
  "use strict";
5855
5855
  var lengths = require_lengths();
5856
- var length63 = (segments, bezier) => lengths(segments, bezier)[segments];
5857
- module.exports = length63;
5856
+ var length64 = (segments, bezier) => lengths(segments, bezier)[segments];
5857
+ module.exports = length64;
5858
5858
  }
5859
5859
  });
5860
5860
 
@@ -6515,12 +6515,12 @@ var require_fromPlanes = __commonJS({
6515
6515
  var fromPointAndDirection = require_fromPointAndDirection();
6516
6516
  var fromPlanes = (out, plane1, plane2) => {
6517
6517
  let direction = vec3.cross(vec3.create(), plane1, plane2);
6518
- let length63 = vec3.length(direction);
6519
- if (length63 < EPS) {
6518
+ let length64 = vec3.length(direction);
6519
+ if (length64 < EPS) {
6520
6520
  throw new Error("parallel planes do not intersect");
6521
6521
  }
6522
- length63 = 1 / length63;
6523
- direction = vec3.scale(direction, direction, length63);
6522
+ length64 = 1 / length64;
6523
+ direction = vec3.scale(direction, direction, length64);
6524
6524
  const absx = Math.abs(direction[0]);
6525
6525
  const absy = Math.abs(direction[1]);
6526
6526
  const absz = Math.abs(direction[2]);
@@ -8105,8 +8105,8 @@ var require_roundedCylinder = __commonJS({
8105
8105
  const start = [0, 0, -(height10 / 2)];
8106
8106
  const end = [0, 0, height10 / 2];
8107
8107
  const direction = vec3.subtract(vec3.create(), end, start);
8108
- const length63 = vec3.length(direction);
8109
- if (2 * roundRadius > length63 - EPS) throw new Error("height must be larger than twice roundRadius");
8108
+ const length64 = vec3.length(direction);
8109
+ if (2 * roundRadius > length64 - EPS) throw new Error("height must be larger than twice roundRadius");
8110
8110
  let defaultnormal;
8111
8111
  if (Math.abs(direction[0]) > Math.abs(direction[1])) {
8112
8112
  defaultnormal = vec3.fromValues(0, 1, 0);
@@ -14432,7 +14432,7 @@ var require_browser = __commonJS({
14432
14432
  });
14433
14433
 
14434
14434
  // src/CadViewer.tsx
14435
- import { useState as useState38, useCallback as useCallback24, useRef as useRef29, useEffect as useEffect47 } from "react";
14435
+ import { useState as useState39, useCallback as useCallback25, useRef as useRef28, useEffect as useEffect48 } from "react";
14436
14436
  import * as THREE46 from "three";
14437
14437
 
14438
14438
  // src/CadViewerJscad.tsx
@@ -14669,124 +14669,127 @@ import {
14669
14669
  } from "circuit-json";
14670
14670
  import { z as z25 } from "zod";
14671
14671
  import { z as z26 } from "zod";
14672
- import { length as length18 } from "circuit-json";
14672
+ import { length as length19 } from "circuit-json";
14673
14673
  import {
14674
- length as length19
14674
+ length as length18
14675
14675
  } from "circuit-json";
14676
- import { z as z27 } from "zod";
14677
14676
  import {
14678
14677
  length as length20
14679
14678
  } from "circuit-json";
14680
- import { z as z28 } from "zod";
14679
+ import { z as z27 } from "zod";
14681
14680
  import {
14682
14681
  length as length21
14683
14682
  } from "circuit-json";
14684
- import { z as z29 } from "zod";
14683
+ import { z as z28 } from "zod";
14685
14684
  import {
14686
14685
  length as length22
14687
14686
  } from "circuit-json";
14688
- import { z as z30 } from "zod";
14687
+ import { z as z29 } from "zod";
14689
14688
  import {
14690
14689
  length as length23
14691
14690
  } from "circuit-json";
14692
- import { z as z31 } from "zod";
14691
+ import { z as z30 } from "zod";
14693
14692
  import {
14694
14693
  length as length24
14695
14694
  } from "circuit-json";
14696
- import { z as z32 } from "zod";
14695
+ import { z as z31 } from "zod";
14697
14696
  import {
14698
14697
  length as length25
14699
14698
  } from "circuit-json";
14699
+ import { z as z32 } from "zod";
14700
+ import {
14701
+ length as length26
14702
+ } from "circuit-json";
14700
14703
  import { z as z33 } from "zod";
14701
14704
  import "zod";
14702
- import { length as length26 } from "circuit-json";
14705
+ import { length as length27 } from "circuit-json";
14703
14706
  import { z as z35 } from "zod";
14704
14707
  import { z as z36 } from "zod";
14705
- import { length as length27 } from "circuit-json";
14706
- import { z as z37 } from "zod";
14707
14708
  import { length as length28 } from "circuit-json";
14708
- import { z as z38 } from "zod";
14709
+ import { z as z37 } from "zod";
14709
14710
  import { length as length29 } from "circuit-json";
14710
- import { z as z39 } from "zod";
14711
+ import { z as z38 } from "zod";
14711
14712
  import { length as length30 } from "circuit-json";
14712
- import { z as z40 } from "zod";
14713
+ import { z as z39 } from "zod";
14713
14714
  import { length as length31 } from "circuit-json";
14714
- import { z as z41 } from "zod";
14715
+ import { z as z40 } from "zod";
14715
14716
  import { length as length32 } from "circuit-json";
14716
- import { z as z42 } from "zod";
14717
+ import { z as z41 } from "zod";
14717
14718
  import { length as length33 } from "circuit-json";
14718
- import { z as z43 } from "zod";
14719
+ import { z as z42 } from "zod";
14719
14720
  import { length as length34 } from "circuit-json";
14720
- import { z as z44 } from "zod";
14721
+ import { z as z43 } from "zod";
14721
14722
  import { length as length35 } from "circuit-json";
14722
- import { z as z45 } from "zod";
14723
+ import { z as z44 } from "zod";
14723
14724
  import { length as length36 } from "circuit-json";
14724
- import { z as z46 } from "zod";
14725
+ import { z as z45 } from "zod";
14725
14726
  import { length as length37 } from "circuit-json";
14727
+ import { z as z46 } from "zod";
14728
+ import { length as length38 } from "circuit-json";
14726
14729
  import { z as z47 } from "zod";
14727
14730
  import {
14728
- length as length38
14731
+ length as length39
14729
14732
  } from "circuit-json";
14730
14733
  import { z as z48 } from "zod";
14731
- import { length as length39 } from "circuit-json";
14734
+ import { length as length40 } from "circuit-json";
14732
14735
  import { z as z49 } from "zod";
14733
14736
  import { z as z50 } from "zod";
14734
- import { length as length40 } from "circuit-json";
14735
- import { z as z51 } from "zod";
14736
14737
  import { length as length41 } from "circuit-json";
14737
- import { z as z52 } from "zod";
14738
+ import { z as z51 } from "zod";
14738
14739
  import { length as length42 } from "circuit-json";
14739
- import { z as z53 } from "zod";
14740
+ import { z as z52 } from "zod";
14740
14741
  import { length as length43 } from "circuit-json";
14741
- import { z as z54 } from "zod";
14742
+ import { z as z53 } from "zod";
14742
14743
  import { length as length44 } from "circuit-json";
14743
- import { z as z55 } from "zod";
14744
+ import { z as z54 } from "zod";
14744
14745
  import { length as length45 } from "circuit-json";
14745
- import { z as z56 } from "zod";
14746
+ import { z as z55 } from "zod";
14746
14747
  import { length as length46 } from "circuit-json";
14747
- import { z as z57 } from "zod";
14748
+ import { z as z56 } from "zod";
14748
14749
  import { length as length47 } from "circuit-json";
14750
+ import { z as z57 } from "zod";
14751
+ import { length as length48 } from "circuit-json";
14749
14752
  import { z as z58 } from "zod";
14750
14753
  import { z as z59 } from "zod";
14751
14754
  import { z as z60 } from "zod";
14752
14755
  import {
14753
- length as length48
14756
+ length as length49
14754
14757
  } from "circuit-json";
14755
14758
  import { z as z61 } from "zod";
14756
14759
  import { z as z62 } from "zod";
14757
- import { length as length49 } from "circuit-json";
14758
- import { z as z63 } from "zod";
14759
14760
  import { length as length50 } from "circuit-json";
14760
- import { z as z64 } from "zod";
14761
+ import { z as z63 } from "zod";
14761
14762
  import { length as length51 } from "circuit-json";
14762
- import { z as z65 } from "zod";
14763
+ import { z as z64 } from "zod";
14763
14764
  import { length as length52 } from "circuit-json";
14764
- import { z as z66 } from "zod";
14765
+ import { z as z65 } from "zod";
14765
14766
  import { length as length53 } from "circuit-json";
14766
- import { z as z67 } from "zod";
14767
+ import { z as z66 } from "zod";
14767
14768
  import { length as length54 } from "circuit-json";
14769
+ import { z as z67 } from "zod";
14770
+ import { length as length55 } from "circuit-json";
14768
14771
  import { z as z68 } from "zod";
14769
- import { length as length55, distance as distance3 } from "circuit-json";
14770
- import { length as length56 } from "circuit-json";
14772
+ import { length as length56, distance as distance3 } from "circuit-json";
14773
+ import { length as length57 } from "circuit-json";
14771
14774
  import { z as z69 } from "zod";
14772
14775
  import { z as z70 } from "zod";
14773
- import { length as length57 } from "circuit-json";
14776
+ import { length as length58 } from "circuit-json";
14774
14777
  import { z as z71 } from "zod";
14775
14778
  import {
14776
- length as length58
14779
+ length as length59
14777
14780
  } from "circuit-json";
14778
14781
  import { z as z72 } from "zod";
14779
14782
  import { z as z73 } from "zod";
14780
- import { length as length59 } from "circuit-json";
14783
+ import { length as length60 } from "circuit-json";
14781
14784
  import { z as z74 } from "zod";
14782
14785
  import { z as z75 } from "zod";
14783
- import { length as length60 } from "circuit-json";
14784
- import { z as z76 } from "zod";
14785
14786
  import { length as length61 } from "circuit-json";
14787
+ import { z as z76 } from "zod";
14788
+ import { length as length62 } from "circuit-json";
14786
14789
  import { z as z77 } from "zod";
14787
14790
  import { z as z78 } from "zod";
14788
14791
  import { z as z79 } from "zod";
14789
- import { length as length62 } from "circuit-json";
14792
+ import { length as length63 } from "circuit-json";
14790
14793
  import { z as z80 } from "zod";
14791
14794
  import { z as z81 } from "zod";
14792
14795
  var __defProp2 = Object.defineProperty;
@@ -15217,7 +15220,7 @@ var dip = (raw_params) => {
15217
15220
  parameters
15218
15221
  };
15219
15222
  };
15220
- var rectpad = (pn, x, y, w, h2) => {
15223
+ var rectpad = (pn, x, y, w, h2, cornerRadius) => {
15221
15224
  return {
15222
15225
  type: "pcb_smtpad",
15223
15226
  x,
@@ -15226,6 +15229,9 @@ var rectpad = (pn, x, y, w, h2) => {
15226
15229
  height: h2,
15227
15230
  layer: "top",
15228
15231
  shape: "rect",
15232
+ ...cornerRadius !== void 0 && {
15233
+ corner_radius: cornerRadius
15234
+ },
15229
15235
  pcb_smtpad_id: "",
15230
15236
  port_hints: Array.isArray(pn) ? pn.map((item) => item.toString()) : [pn.toString()]
15231
15237
  };
@@ -15260,7 +15266,12 @@ var footprintSizes = [
15260
15266
  w_mm_min: 5.4,
15261
15267
  h_mm_min: 3.4,
15262
15268
  courtyard_width_mm: 5.9,
15263
- courtyard_height_mm: 3.9
15269
+ courtyard_height_mm: 3.9,
15270
+ nonpolarizedSilkscreen: {
15271
+ line_half_length_mm: 1.386252,
15272
+ line_y_mm: 1.71,
15273
+ stroke_width_mm: 0.12
15274
+ }
15264
15275
  },
15265
15276
  {
15266
15277
  imperial: "0201",
@@ -15282,7 +15293,12 @@ var footprintSizes = [
15282
15293
  w_mm_min: 1.56,
15283
15294
  h_mm_min: 0.64,
15284
15295
  courtyard_width_mm: 1.86,
15285
- courtyard_height_mm: 0.94
15296
+ courtyard_height_mm: 0.94,
15297
+ nonpolarizedSilkscreen: {
15298
+ line_half_length_mm: 0.153641,
15299
+ line_y_mm: 0.38,
15300
+ stroke_width_mm: 0.12
15301
+ }
15286
15302
  },
15287
15303
  {
15288
15304
  imperial: "0603",
@@ -15293,7 +15309,12 @@ var footprintSizes = [
15293
15309
  w_mm_min: 2.45,
15294
15310
  h_mm_min: 0.95,
15295
15311
  courtyard_width_mm: 2.96,
15296
- courtyard_height_mm: 1.46
15312
+ courtyard_height_mm: 1.46,
15313
+ nonpolarizedSilkscreen: {
15314
+ line_half_length_mm: 0.237258,
15315
+ line_y_mm: 0.5225,
15316
+ stroke_width_mm: 0.12
15317
+ }
15297
15318
  },
15298
15319
  {
15299
15320
  imperial: "0805",
@@ -15304,7 +15325,12 @@ var footprintSizes = [
15304
15325
  w_mm_min: 2.8499999999999996,
15305
15326
  h_mm_min: 1.4,
15306
15327
  courtyard_width_mm: 3.36,
15307
- courtyard_height_mm: 1.9
15328
+ courtyard_height_mm: 1.9,
15329
+ nonpolarizedSilkscreen: {
15330
+ line_half_length_mm: 0.227064,
15331
+ line_y_mm: 0.735,
15332
+ stroke_width_mm: 0.12
15333
+ }
15308
15334
  },
15309
15335
  {
15310
15336
  imperial: "1206",
@@ -15315,7 +15341,12 @@ var footprintSizes = [
15315
15341
  w_mm_min: 4.05,
15316
15342
  h_mm_min: 1.75,
15317
15343
  courtyard_width_mm: 4.56,
15318
- courtyard_height_mm: 2.26
15344
+ courtyard_height_mm: 2.26,
15345
+ nonpolarizedSilkscreen: {
15346
+ line_half_length_mm: 0.727064,
15347
+ line_y_mm: 0.91,
15348
+ stroke_width_mm: 0.12
15349
+ }
15319
15350
  },
15320
15351
  {
15321
15352
  imperial: "1210",
@@ -15326,7 +15357,12 @@ var footprintSizes = [
15326
15357
  w_mm_min: 4.05,
15327
15358
  h_mm_min: 2.65,
15328
15359
  courtyard_width_mm: 4.56,
15329
- courtyard_height_mm: 3.16
15360
+ courtyard_height_mm: 3.16,
15361
+ nonpolarizedSilkscreen: {
15362
+ line_half_length_mm: 0.723737,
15363
+ line_y_mm: 1.355,
15364
+ stroke_width_mm: 0.12
15365
+ }
15330
15366
  },
15331
15367
  {
15332
15368
  imperial: "2010",
@@ -15337,7 +15373,12 @@ var footprintSizes = [
15337
15373
  w_mm_min: 5.85,
15338
15374
  h_mm_min: 2.65,
15339
15375
  courtyard_width_mm: 6.36,
15340
- courtyard_height_mm: 3.16
15376
+ courtyard_height_mm: 3.16,
15377
+ nonpolarizedSilkscreen: {
15378
+ line_half_length_mm: 1.527064,
15379
+ line_y_mm: 1.36,
15380
+ stroke_width_mm: 0.12
15381
+ }
15341
15382
  },
15342
15383
  {
15343
15384
  imperial: "2512",
@@ -15348,7 +15389,12 @@ var footprintSizes = [
15348
15389
  w_mm_min: 7.15,
15349
15390
  h_mm_min: 3.35,
15350
15391
  courtyard_width_mm: 7.66,
15351
- courtyard_height_mm: 3.86
15392
+ courtyard_height_mm: 3.86,
15393
+ nonpolarizedSilkscreen: {
15394
+ line_half_length_mm: 2.177064,
15395
+ line_y_mm: 1.71,
15396
+ stroke_width_mm: 0.12
15397
+ }
15352
15398
  }
15353
15399
  ];
15354
15400
  var metricMap = Object.fromEntries(footprintSizes.map((s) => [s.metric, s]));
@@ -15365,6 +15411,8 @@ var createCourtyardRect = (width10, height10) => ({
15365
15411
  layer: "top"
15366
15412
  });
15367
15413
  var passive_def = base_def.extend({
15414
+ fn: z3.string().optional(),
15415
+ string: z3.string().optional(),
15368
15416
  tht: z3.boolean(),
15369
15417
  p: length.optional(),
15370
15418
  pw: length.optional(),
@@ -15373,10 +15421,26 @@ var passive_def = base_def.extend({
15373
15421
  imperial: distance.optional(),
15374
15422
  w: length.optional(),
15375
15423
  h: length.optional(),
15376
- textbottom: z3.boolean().optional()
15424
+ nonpolarized: z3.boolean().optional(),
15425
+ textbottom: z3.boolean().optional(),
15426
+ roundedPads: z3.boolean().optional()
15377
15427
  });
15378
15428
  var passive = (params) => {
15379
- let { tht, p, pw, ph, metric, imperial, w, h: h2, textbottom } = params;
15429
+ let {
15430
+ fn,
15431
+ tht,
15432
+ p,
15433
+ pw,
15434
+ ph,
15435
+ metric,
15436
+ imperial,
15437
+ w,
15438
+ h: h2,
15439
+ nonpolarized,
15440
+ textbottom,
15441
+ roundedPads,
15442
+ string: footprintString
15443
+ } = params;
15380
15444
  if (typeof w === "string") w = mm_default(w);
15381
15445
  if (typeof h2 === "string") h2 = mm_default(h2);
15382
15446
  if (typeof p === "string") p = mm_default(p);
@@ -15400,47 +15464,94 @@ var passive = (params) => {
15400
15464
  if (p === void 0 || pw === void 0 || ph === void 0) {
15401
15465
  throw new Error("Could not determine required pad dimensions (p, pw, ph)");
15402
15466
  }
15403
- const silkscreenLine = {
15404
- type: "pcb_silkscreen_path",
15405
- layer: "top",
15406
- pcb_component_id: "",
15407
- route: [
15408
- { x: p / 2, y: ph / 2 + 0.4 },
15409
- { x: -p / 2 - pw / 2 - 0.2, y: ph / 2 + 0.4 },
15410
- { x: -p / 2 - pw / 2 - 0.2, y: -ph / 2 - 0.4 },
15411
- { x: p / 2, y: -ph / 2 - 0.4 }
15412
- ],
15413
- stroke_width: 0.1,
15414
- pcb_silkscreen_path_id: ""
15415
- };
15467
+ let silkscreenLines = [];
15468
+ const nonpolarizedSilkscreen = fn === "res" && (nonpolarized === true || typeof footprintString !== "string" || /^res(?:\d{4}|\d{5})(?:_|$)/i.test(footprintString)) ? sz?.nonpolarizedSilkscreen : void 0;
15469
+ if (nonpolarizedSilkscreen?.stroke_width_mm) {
15470
+ const {
15471
+ line_half_length_mm = 0,
15472
+ line_y_mm = 0,
15473
+ stroke_width_mm
15474
+ } = nonpolarizedSilkscreen;
15475
+ silkscreenLines = [
15476
+ {
15477
+ type: "pcb_silkscreen_path",
15478
+ layer: "top",
15479
+ pcb_component_id: "",
15480
+ route: [
15481
+ { x: -line_half_length_mm, y: line_y_mm },
15482
+ { x: line_half_length_mm, y: line_y_mm }
15483
+ ],
15484
+ stroke_width: stroke_width_mm,
15485
+ pcb_silkscreen_path_id: ""
15486
+ },
15487
+ {
15488
+ type: "pcb_silkscreen_path",
15489
+ layer: "top",
15490
+ pcb_component_id: "",
15491
+ route: [
15492
+ { x: -line_half_length_mm, y: -line_y_mm },
15493
+ { x: line_half_length_mm, y: -line_y_mm }
15494
+ ],
15495
+ stroke_width: stroke_width_mm,
15496
+ pcb_silkscreen_path_id: ""
15497
+ }
15498
+ ];
15499
+ } else {
15500
+ silkscreenLines = [
15501
+ {
15502
+ type: "pcb_silkscreen_path",
15503
+ layer: "top",
15504
+ pcb_component_id: "",
15505
+ route: [
15506
+ { x: p / 2, y: ph / 2 + 0.4 },
15507
+ { x: -p / 2 - pw / 2 - 0.2, y: ph / 2 + 0.4 },
15508
+ { x: -p / 2 - pw / 2 - 0.2, y: -ph / 2 - 0.4 },
15509
+ { x: p / 2, y: -ph / 2 - 0.4 }
15510
+ ],
15511
+ stroke_width: 0.1,
15512
+ pcb_silkscreen_path_id: ""
15513
+ }
15514
+ ];
15515
+ }
15416
15516
  const textY = textbottom ? -ph / 2 - 0.9 : ph / 2 + 0.9;
15417
15517
  const silkscreenRefText = silkscreenRef(0, textY, 0.2);
15418
15518
  const courtyard = sz?.courtyard_width_mm && sz.courtyard_height_mm ? createCourtyardRect(sz.courtyard_width_mm, sz.courtyard_height_mm) : null;
15519
+ const cornerRadius = roundedPads ? Math.min(0.125, Math.min(pw, ph) / 8) : void 0;
15419
15520
  if (tht) {
15420
15521
  return [
15421
15522
  platedhole(1, -p / 2, 0, pw, pw * 1 / 0.8),
15422
15523
  platedhole(2, p / 2, 0, pw, pw * 1 / 0.8),
15423
- silkscreenLine,
15524
+ ...silkscreenLines,
15424
15525
  silkscreenRefText,
15425
15526
  ...courtyard ? [courtyard] : []
15426
15527
  ];
15427
15528
  }
15428
15529
  return [
15429
- rectpad(["1", "left"], -p / 2, 0, pw, ph),
15430
- rectpad(["2", "right"], p / 2, 0, pw, ph),
15431
- silkscreenLine,
15530
+ rectpad(["1", "left"], -p / 2, 0, pw, ph, cornerRadius),
15531
+ rectpad(["2", "right"], p / 2, 0, pw, ph, cornerRadius),
15532
+ ...silkscreenLines,
15432
15533
  silkscreenRefText,
15433
15534
  ...courtyard ? [courtyard] : []
15434
15535
  ];
15435
15536
  };
15436
15537
  var diode = (parameters) => {
15437
- return { circuitJson: passive(parameters), parameters };
15538
+ return {
15539
+ circuitJson: passive({ ...parameters, roundedPads: true }),
15540
+ parameters
15541
+ };
15438
15542
  };
15439
15543
  var cap = (parameters) => {
15440
15544
  return { circuitJson: passive(parameters), parameters };
15441
15545
  };
15442
15546
  var led = (parameters) => {
15443
- return { circuitJson: passive(parameters), parameters };
15547
+ const circuitJson = passive(parameters).map((element) => {
15548
+ if (element.type !== "pcb_silkscreen_path") return element;
15549
+ return {
15550
+ ...element,
15551
+ route: element.route.map((point) => ({ ...point, x: -point.x }))
15552
+ };
15553
+ });
15554
+ return { circuitJson, parameters };
15444
15555
  };
15445
15556
  var chipArray = (params) => {
15446
15557
  const {
@@ -17985,6 +18096,116 @@ var sot723WithoutParsing = (parameters) => {
17985
18096
  }
17986
18097
  return pads;
17987
18098
  };
18099
+ var createFabricationNoteDiodeFromCopperPads = (parameters) => {
18100
+ const pitch = parameters.p ?? parameters.pad_spacing;
18101
+ if (pitch === void 0 || parameters.pl === void 0 || parameters.pw === void 0) {
18102
+ throw new Error(
18103
+ "Diode fabrication note requires p or pad_spacing, pl, and pw"
18104
+ );
18105
+ }
18106
+ const padPitch = length18.parse(pitch);
18107
+ const padLength = length18.parse(parameters.pl);
18108
+ const padWidth = length18.parse(parameters.pw);
18109
+ return createFabricationNoteDiode({
18110
+ minX: -padPitch / 2 - padLength / 2,
18111
+ maxX: padPitch / 2 + padLength / 2,
18112
+ minY: -padWidth / 2,
18113
+ maxY: padWidth / 2
18114
+ });
18115
+ };
18116
+ var createFabricationNoteDiode = (bounds) => {
18117
+ const elms = [];
18118
+ const width10 = bounds.maxX - bounds.minX;
18119
+ const height10 = bounds.maxY - bounds.minY;
18120
+ const centerX = (bounds.minX + bounds.maxX) / 2;
18121
+ const centerY = (bounds.minY + bounds.maxY) / 2;
18122
+ const symbolHalfHeight = height10 * 0.28;
18123
+ const symbolHeight = symbolHalfHeight * 2;
18124
+ const maxSymbolWidth = width10 * 0.2;
18125
+ const maxSymbolWidthToHeightRatio = 1.25;
18126
+ const symbolWidth = Math.min(
18127
+ maxSymbolWidth,
18128
+ symbolHeight * maxSymbolWidthToHeightRatio
18129
+ );
18130
+ const symbolMinX = centerX - symbolWidth / 2;
18131
+ const symbolMaxX = centerX + symbolWidth / 2;
18132
+ const legLength = symbolWidth * 0.18;
18133
+ const triangleBaseX = symbolMinX + legLength;
18134
+ const cathodeX = symbolMaxX - legLength;
18135
+ const strokeWidth = Math.max(Math.min(width10, height10) * 0.035, 0.01);
18136
+ const fontSize = Math.max(Math.min(width10, height10) * 0.25, 0.1);
18137
+ elms.push(
18138
+ {
18139
+ type: "pcb_fabrication_note_path",
18140
+ pcb_fabrication_note_path_id: "diode_fabrication_note_anode_leg",
18141
+ pcb_component_id: "",
18142
+ layer: "top",
18143
+ stroke_width: strokeWidth,
18144
+ route: [
18145
+ { x: symbolMinX, y: centerY },
18146
+ { x: triangleBaseX, y: centerY }
18147
+ ]
18148
+ },
18149
+ {
18150
+ type: "pcb_fabrication_note_path",
18151
+ pcb_fabrication_note_path_id: "diode_fabrication_note_triangle",
18152
+ pcb_component_id: "",
18153
+ layer: "top",
18154
+ stroke_width: strokeWidth,
18155
+ route: [
18156
+ { x: triangleBaseX, y: centerY + symbolHalfHeight },
18157
+ { x: cathodeX, y: centerY },
18158
+ { x: triangleBaseX, y: centerY - symbolHalfHeight },
18159
+ { x: triangleBaseX, y: centerY + symbolHalfHeight }
18160
+ ]
18161
+ },
18162
+ {
18163
+ type: "pcb_fabrication_note_path",
18164
+ pcb_fabrication_note_path_id: "diode_fabrication_note_cathode",
18165
+ pcb_component_id: "",
18166
+ layer: "top",
18167
+ stroke_width: strokeWidth,
18168
+ route: [
18169
+ { x: cathodeX, y: centerY + symbolHalfHeight },
18170
+ { x: cathodeX, y: centerY - symbolHalfHeight }
18171
+ ]
18172
+ },
18173
+ {
18174
+ type: "pcb_fabrication_note_path",
18175
+ pcb_fabrication_note_path_id: "diode_fabrication_note_cathode_leg",
18176
+ pcb_component_id: "",
18177
+ layer: "top",
18178
+ stroke_width: strokeWidth,
18179
+ route: [
18180
+ { x: cathodeX, y: centerY },
18181
+ { x: symbolMaxX, y: centerY }
18182
+ ]
18183
+ },
18184
+ {
18185
+ type: "pcb_fabrication_note_text",
18186
+ pcb_fabrication_note_text_id: "diode_fabrication_note_positive",
18187
+ pcb_component_id: "",
18188
+ layer: "top",
18189
+ font: "tscircuit2024",
18190
+ font_size: fontSize,
18191
+ text: "+",
18192
+ anchor_position: { x: bounds.minX + width10 * 0.125, y: centerY },
18193
+ anchor_alignment: "center"
18194
+ },
18195
+ {
18196
+ type: "pcb_fabrication_note_text",
18197
+ pcb_fabrication_note_text_id: "diode_fabrication_note_negative",
18198
+ pcb_component_id: "",
18199
+ layer: "top",
18200
+ font: "tscircuit2024",
18201
+ font_size: fontSize,
18202
+ text: "-",
18203
+ anchor_position: { x: bounds.maxX - width10 * 0.125, y: centerY },
18204
+ anchor_alignment: "center"
18205
+ }
18206
+ );
18207
+ return elms;
18208
+ };
17988
18209
  var sod_def = base_def.extend({
17989
18210
  fn: z26.string(),
17990
18211
  num_pins: z26.literal(2).default(2),
@@ -17996,9 +18217,10 @@ var sod_def = base_def.extend({
17996
18217
  });
17997
18218
  var sod123 = (raw_params) => {
17998
18219
  const parameters = sod_def.parse(raw_params);
18220
+ const bodyHeight = length19.parse(parameters.h);
17999
18221
  const silkscreenRefText = silkscreenRef(
18000
18222
  0,
18001
- length18.parse(parameters.h) / 4 + 0.4,
18223
+ bodyHeight / 4 + 0.4,
18002
18224
  0.3
18003
18225
  );
18004
18226
  const courtyardWidthMm = 4.7;
@@ -18014,6 +18236,7 @@ var sod123 = (raw_params) => {
18014
18236
  };
18015
18237
  return {
18016
18238
  circuitJson: sodWithoutParsing(parameters).concat(
18239
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
18017
18240
  silkscreenRefText,
18018
18241
  courtyard
18019
18242
  ),
@@ -18041,7 +18264,8 @@ var sodWithoutParsing = (parameters) => {
18041
18264
  x,
18042
18265
  y,
18043
18266
  Number.parseFloat(parameters.pl),
18044
- Number.parseFloat(parameters.pw)
18267
+ Number.parseFloat(parameters.pw),
18268
+ 0.1125
18045
18269
  )
18046
18270
  );
18047
18271
  }
@@ -18049,9 +18273,9 @@ var sodWithoutParsing = (parameters) => {
18049
18273
  };
18050
18274
  var axial_def = base_def.extend({
18051
18275
  fn: z27.string(),
18052
- p: length19.optional().default("2.54mm"),
18053
- id: length19.optional().default("0.7mm"),
18054
- od: length19.optional().default("1.4mm")
18276
+ p: length20.optional().default("2.54mm"),
18277
+ id: length20.optional().default("0.7mm"),
18278
+ od: length20.optional().default("1.4mm")
18055
18279
  });
18056
18280
  var axial = (raw_params) => {
18057
18281
  const parameters = axial_def.parse(raw_params);
@@ -18139,9 +18363,9 @@ var generateCircleArcs = (centerX, centerY, radius, cut, cutHeight, segmentLengt
18139
18363
  };
18140
18364
  var radial_def = base_def.extend({
18141
18365
  fn: z28.string(),
18142
- p: length20.optional().default("5mm"),
18143
- id: length20.optional().default("0.8mm"),
18144
- od: length20.optional().default("1.6mm"),
18366
+ p: length21.optional().default("5mm"),
18367
+ id: length21.optional().default("0.8mm"),
18368
+ od: length21.optional().default("1.6mm"),
18145
18369
  ceramic: z28.boolean().optional(),
18146
18370
  electrolytic: z28.boolean().optional(),
18147
18371
  polarized: z28.boolean().optional()
@@ -18261,10 +18485,10 @@ var silkscreenpath = (route, options = {}) => {
18261
18485
  };
18262
18486
  var pushbutton_def = base_def.extend({
18263
18487
  fn: z29.literal("pushbutton"),
18264
- w: length21.default(4.5),
18265
- h: length21.default(6.5),
18266
- id: length21.default(1),
18267
- od: length21.default(1.2)
18488
+ w: length22.default(4.5),
18489
+ h: length22.default(6.5),
18490
+ id: length22.default(1),
18491
+ od: length22.default(1.2)
18268
18492
  });
18269
18493
  var pushbutton = (raw_params) => {
18270
18494
  const parameters = pushbutton_def.parse(raw_params);
@@ -18326,19 +18550,19 @@ var pushbutton = (raw_params) => {
18326
18550
  };
18327
18551
  var stampboard_def = base_def.extend({
18328
18552
  fn: z30.string(),
18329
- w: length22.default("22.58mm"),
18330
- h: length22.optional(),
18331
- left: length22.optional().default(20),
18332
- right: length22.optional().default(20),
18333
- top: length22.optional().default(2),
18334
- bottom: length22.optional().default(2),
18335
- p: length22.default(length22.parse("2.54mm")),
18336
- pw: length22.default(length22.parse("1.6mm")),
18337
- pl: length22.default(length22.parse("2.4mm")),
18553
+ w: length23.default("22.58mm"),
18554
+ h: length23.optional(),
18555
+ left: length23.optional().default(20),
18556
+ right: length23.optional().default(20),
18557
+ top: length23.optional().default(2),
18558
+ bottom: length23.optional().default(2),
18559
+ p: length23.default(length23.parse("2.54mm")),
18560
+ pw: length23.default(length23.parse("1.6mm")),
18561
+ pl: length23.default(length23.parse("2.4mm")),
18338
18562
  innerhole: z30.boolean().default(false),
18339
- innerholeedgedistance: length22.default(length22.parse("1.61mm")),
18563
+ innerholeedgedistance: length23.default(length23.parse("1.61mm")),
18340
18564
  silkscreenlabels: z30.boolean().default(false),
18341
- silkscreenlabelmargin: length22.default(length22.parse("0.1mm"))
18565
+ silkscreenlabelmargin: length23.default(length23.parse("0.1mm"))
18342
18566
  });
18343
18567
  var getHeight = (parameters) => {
18344
18568
  const params = stampboard_def.parse(parameters);
@@ -18746,17 +18970,17 @@ var stampboard = (raw_params) => {
18746
18970
  };
18747
18971
  var stampreceiver_def = base_def.extend({
18748
18972
  fn: z31.string(),
18749
- w: length23.default("22.58mm"),
18750
- h: length23.optional(),
18751
- left: length23.optional().default(20),
18752
- right: length23.optional().default(20),
18753
- top: length23.optional().default(2),
18754
- bottom: length23.optional().default(2),
18755
- p: length23.default(length23.parse("2.54mm")),
18756
- pw: length23.default(length23.parse("1.6mm")),
18757
- pl: length23.default(length23.parse("3.2mm")),
18973
+ w: length24.default("22.58mm"),
18974
+ h: length24.optional(),
18975
+ left: length24.optional().default(20),
18976
+ right: length24.optional().default(20),
18977
+ top: length24.optional().default(2),
18978
+ bottom: length24.optional().default(2),
18979
+ p: length24.default(length24.parse("2.54mm")),
18980
+ pw: length24.default(length24.parse("1.6mm")),
18981
+ pl: length24.default(length24.parse("3.2mm")),
18758
18982
  innerhole: z31.boolean().default(false),
18759
- innerholeedgedistance: length23.default(length23.parse("1.61mm"))
18983
+ innerholeedgedistance: length24.default(length24.parse("1.61mm"))
18760
18984
  });
18761
18985
  var getHeight2 = (parameters) => {
18762
18986
  const params = stampreceiver_def.parse(parameters);
@@ -19054,15 +19278,15 @@ var lqfp = (parameters) => {
19054
19278
  };
19055
19279
  var breakoutheaders_def = base_def.extend({
19056
19280
  fn: z32.string(),
19057
- w: length24.default("10mm"),
19058
- h: length24.optional(),
19059
- left: length24.optional().default(20),
19060
- right: length24.optional().default(20),
19061
- top: length24.optional().default(0),
19062
- bottom: length24.optional().default(0),
19063
- p: length24.default(length24.parse("2.54mm")),
19064
- id: length24.optional().default(length24.parse("1mm")),
19065
- od: length24.optional().default(length24.parse("1.5mm"))
19281
+ w: length25.default("10mm"),
19282
+ h: length25.optional(),
19283
+ left: length25.optional().default(20),
19284
+ right: length25.optional().default(20),
19285
+ top: length25.optional().default(0),
19286
+ bottom: length25.optional().default(0),
19287
+ p: length25.default(length25.parse("2.54mm")),
19288
+ id: length25.optional().default(length25.parse("1mm")),
19289
+ od: length25.optional().default(length25.parse("1.5mm"))
19066
19290
  });
19067
19291
  var getHeight3 = (parameters) => {
19068
19292
  const params = breakoutheaders_def.parse(parameters);
@@ -19331,11 +19555,11 @@ var generate_u_curve = (centerX, centerY, radius, direction) => {
19331
19555
  };
19332
19556
  var hc49_def = base_def.extend({
19333
19557
  fn: z33.string(),
19334
- p: length25.optional().default("4.88mm"),
19335
- id: length25.optional().default("0.8mm"),
19336
- od: length25.optional().default("1.5mm"),
19337
- w: length25.optional().default("5.6mm"),
19338
- h: length25.optional().default("3.5mm")
19558
+ p: length26.optional().default("4.88mm"),
19559
+ id: length26.optional().default("0.8mm"),
19560
+ od: length26.optional().default("1.5mm"),
19561
+ w: length26.optional().default("5.6mm"),
19562
+ h: length26.optional().default("3.5mm")
19339
19563
  });
19340
19564
  var hc49 = (raw_params) => {
19341
19565
  const parameters = hc49_def.parse(raw_params);
@@ -19391,8 +19615,8 @@ var hc49 = (raw_params) => {
19391
19615
  };
19392
19616
  };
19393
19617
  var pad_def = base_def.extend({
19394
- w: length26,
19395
- h: length26
19618
+ w: length27,
19619
+ h: length27
19396
19620
  });
19397
19621
  var pad = (params) => {
19398
19622
  const { w, h: h2 } = params;
@@ -19567,7 +19791,7 @@ var sod523 = (raw_params) => {
19567
19791
  const parameters = sod_def2.parse(raw_params);
19568
19792
  const silkscreenRefText = silkscreenRef(
19569
19793
  0,
19570
- length27.parse(parameters.h),
19794
+ length28.parse(parameters.h),
19571
19795
  0.3
19572
19796
  );
19573
19797
  const silkscreenLine = {
@@ -19576,20 +19800,20 @@ var sod523 = (raw_params) => {
19576
19800
  pcb_component_id: "",
19577
19801
  route: [
19578
19802
  {
19579
- x: length27.parse(parameters.p) / 2,
19580
- y: length27.parse(parameters.h) / 2 + 0.2
19803
+ x: length28.parse(parameters.p) / 2,
19804
+ y: length28.parse(parameters.h) / 2 + 0.2
19581
19805
  },
19582
19806
  {
19583
- x: -length27.parse(parameters.w) / 2 - 0.2,
19584
- y: length27.parse(parameters.h) / 2 + 0.2
19807
+ x: -length28.parse(parameters.w) / 2 - 0.2,
19808
+ y: length28.parse(parameters.h) / 2 + 0.2
19585
19809
  },
19586
19810
  {
19587
- x: -length27.parse(parameters.w) / 2 - 0.2,
19588
- y: -length27.parse(parameters.h) / 2 - 0.2
19811
+ x: -length28.parse(parameters.w) / 2 - 0.2,
19812
+ y: -length28.parse(parameters.h) / 2 - 0.2
19589
19813
  },
19590
19814
  {
19591
- x: length27.parse(parameters.p) / 2,
19592
- y: -length27.parse(parameters.h) / 2 - 0.2
19815
+ x: length28.parse(parameters.p) / 2,
19816
+ y: -length28.parse(parameters.h) / 2 - 0.2
19593
19817
  }
19594
19818
  ],
19595
19819
  stroke_width: 0.1,
@@ -19608,6 +19832,7 @@ var sod523 = (raw_params) => {
19608
19832
  };
19609
19833
  return {
19610
19834
  circuitJson: sodWithoutParsing2(parameters).concat(
19835
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
19611
19836
  silkscreenLine,
19612
19837
  silkscreenRefText,
19613
19838
  courtyard
@@ -19625,20 +19850,16 @@ var getSodCoords2 = (parameters) => {
19625
19850
  };
19626
19851
  var sodWithoutParsing2 = (parameters) => {
19627
19852
  const pads = [];
19853
+ const p = length28.parse(parameters.p);
19854
+ const pl = length28.parse(parameters.pl);
19855
+ const pw = length28.parse(parameters.pw);
19856
+ const cornerRadius = 0.075;
19628
19857
  for (let i = 1; i <= parameters.num_pins; i++) {
19629
19858
  const { x, y } = getSodCoords2({
19630
19859
  pn: i,
19631
- p: Number.parseFloat(parameters.p)
19860
+ p
19632
19861
  });
19633
- pads.push(
19634
- rectpad(
19635
- i,
19636
- x,
19637
- y,
19638
- Number.parseFloat(parameters.pl),
19639
- Number.parseFloat(parameters.pw)
19640
- )
19641
- );
19862
+ pads.push(rectpad(i, x, y, pl, pw, cornerRadius));
19642
19863
  }
19643
19864
  return pads;
19644
19865
  };
@@ -19725,7 +19946,7 @@ var sod80 = (raw_params) => {
19725
19946
  const parameters = sod80_def.parse(raw_params);
19726
19947
  const silkscreenRefText = silkscreenRef(
19727
19948
  0,
19728
- length28.parse(parameters.h) / 2 + 1,
19949
+ length29.parse(parameters.h) / 2 + 1,
19729
19950
  0.3
19730
19951
  );
19731
19952
  const silkscreenLine = {
@@ -19734,20 +19955,20 @@ var sod80 = (raw_params) => {
19734
19955
  pcb_component_id: "",
19735
19956
  route: [
19736
19957
  {
19737
- x: length28.parse(parameters.p) / 2 + 0.5,
19738
- y: length28.parse(parameters.h) / 2 + 0.5
19958
+ x: length29.parse(parameters.p) / 2 + 0.5,
19959
+ y: length29.parse(parameters.h) / 2 + 0.5
19739
19960
  },
19740
19961
  {
19741
- x: -length28.parse(parameters.w) / 2 - 0.5,
19742
- y: length28.parse(parameters.h) / 2 + 0.5
19962
+ x: -length29.parse(parameters.w) / 2 - 0.5,
19963
+ y: length29.parse(parameters.h) / 2 + 0.5
19743
19964
  },
19744
19965
  {
19745
- x: -length28.parse(parameters.w) / 2 - 0.5,
19746
- y: -length28.parse(parameters.h) / 2 - 0.5
19966
+ x: -length29.parse(parameters.w) / 2 - 0.5,
19967
+ y: -length29.parse(parameters.h) / 2 - 0.5
19747
19968
  },
19748
19969
  {
19749
- x: length28.parse(parameters.p) / 2 + 0.5,
19750
- y: -length28.parse(parameters.h) / 2 - 0.5
19970
+ x: length29.parse(parameters.p) / 2 + 0.5,
19971
+ y: -length29.parse(parameters.h) / 2 - 0.5
19751
19972
  }
19752
19973
  ],
19753
19974
  stroke_width: 0.1,
@@ -19766,6 +19987,7 @@ var sod80 = (raw_params) => {
19766
19987
  };
19767
19988
  return {
19768
19989
  circuitJson: sod80WithoutParsing(parameters).concat(
19990
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
19769
19991
  silkscreenLine,
19770
19992
  silkscreenRefText,
19771
19993
  courtyard
@@ -19809,7 +20031,7 @@ var sod123w = (raw_params) => {
19809
20031
  const parameters = sod_def3.parse(raw_params);
19810
20032
  const silkscreenRefText = silkscreenRef(
19811
20033
  0,
19812
- length29.parse(parameters.h) - 0.5,
20034
+ length30.parse(parameters.h) - 0.5,
19813
20035
  0.3
19814
20036
  );
19815
20037
  const silkscreenLine = {
@@ -19818,20 +20040,20 @@ var sod123w = (raw_params) => {
19818
20040
  pcb_component_id: "",
19819
20041
  route: [
19820
20042
  {
19821
- x: length29.parse(parameters.p) / 2,
19822
- y: length29.parse(parameters.h) / 2
20043
+ x: length30.parse(parameters.p) / 2,
20044
+ y: length30.parse(parameters.h) / 2
19823
20045
  },
19824
20046
  {
19825
- x: -length29.parse(parameters.w) / 2 - 0.2,
19826
- y: length29.parse(parameters.h) / 2
20047
+ x: -length30.parse(parameters.w) / 2 - 0.2,
20048
+ y: length30.parse(parameters.h) / 2
19827
20049
  },
19828
20050
  {
19829
- x: -length29.parse(parameters.w) / 2 - 0.2,
19830
- y: -length29.parse(parameters.h) / 2
20051
+ x: -length30.parse(parameters.w) / 2 - 0.2,
20052
+ y: -length30.parse(parameters.h) / 2
19831
20053
  },
19832
20054
  {
19833
- x: length29.parse(parameters.p) / 2,
19834
- y: -length29.parse(parameters.h) / 2
20055
+ x: length30.parse(parameters.p) / 2,
20056
+ y: -length30.parse(parameters.h) / 2
19835
20057
  }
19836
20058
  ],
19837
20059
  stroke_width: 0.1,
@@ -19850,6 +20072,7 @@ var sod123w = (raw_params) => {
19850
20072
  };
19851
20073
  return {
19852
20074
  circuitJson: sodWithoutParsing3(parameters).concat(
20075
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
19853
20076
  silkscreenLine,
19854
20077
  silkscreenRefText,
19855
20078
  courtyard
@@ -19896,7 +20119,7 @@ var sod323 = (raw_params) => {
19896
20119
  const parameters = sod_def4.parse(raw_params);
19897
20120
  const silkscreenRefText = silkscreenRef(
19898
20121
  0,
19899
- length30.parse(parameters.h) - 0.5,
20122
+ length31.parse(parameters.h) - 0.5,
19900
20123
  0.3
19901
20124
  );
19902
20125
  const silkscreenLine = {
@@ -19905,20 +20128,20 @@ var sod323 = (raw_params) => {
19905
20128
  pcb_component_id: "",
19906
20129
  route: [
19907
20130
  {
19908
- x: length30.parse(parameters.p) / 2,
19909
- y: length30.parse(parameters.h) / 2
20131
+ x: length31.parse(parameters.p) / 2,
20132
+ y: length31.parse(parameters.h) / 2
19910
20133
  },
19911
20134
  {
19912
- x: -length30.parse(parameters.w) / 2,
19913
- y: length30.parse(parameters.h) / 2
20135
+ x: -length31.parse(parameters.w) / 2,
20136
+ y: length31.parse(parameters.h) / 2
19914
20137
  },
19915
20138
  {
19916
- x: -length30.parse(parameters.w) / 2,
19917
- y: -length30.parse(parameters.h) / 2
20139
+ x: -length31.parse(parameters.w) / 2,
20140
+ y: -length31.parse(parameters.h) / 2
19918
20141
  },
19919
20142
  {
19920
- x: length30.parse(parameters.p) / 2,
19921
- y: -length30.parse(parameters.h) / 2
20143
+ x: length31.parse(parameters.p) / 2,
20144
+ y: -length31.parse(parameters.h) / 2
19922
20145
  }
19923
20146
  ],
19924
20147
  stroke_width: 0.1,
@@ -19937,6 +20160,7 @@ var sod323 = (raw_params) => {
19937
20160
  };
19938
20161
  return {
19939
20162
  circuitJson: sodWithoutParsing4(parameters).concat(
20163
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
19940
20164
  silkscreenLine,
19941
20165
  silkscreenRefText,
19942
20166
  courtyard
@@ -19953,20 +20177,16 @@ var getSodCoords4 = (parameters) => {
19953
20177
  };
19954
20178
  var sodWithoutParsing4 = (parameters) => {
19955
20179
  const pads = [];
20180
+ const p = length31.parse(parameters.p);
20181
+ const pl = length31.parse(parameters.pl);
20182
+ const pw = length31.parse(parameters.pw);
20183
+ const cornerRadius = 0.05625;
19956
20184
  for (let i = 1; i <= parameters.num_pins; i++) {
19957
20185
  const { x, y } = getSodCoords4({
19958
20186
  pn: i,
19959
- p: Number.parseFloat(parameters.p)
20187
+ p
19960
20188
  });
19961
- pads.push(
19962
- rectpad(
19963
- i,
19964
- x,
19965
- y,
19966
- Number.parseFloat(parameters.pl),
19967
- Number.parseFloat(parameters.pw)
19968
- )
19969
- );
20189
+ pads.push(rectpad(i, x, y, pl, pw, cornerRadius));
19970
20190
  }
19971
20191
  return pads;
19972
20192
  };
@@ -19981,11 +20201,11 @@ var sod_def5 = base_def.extend({
19981
20201
  });
19982
20202
  var sod923 = (raw_params) => {
19983
20203
  const parameters = sod_def5.parse(raw_params);
19984
- const w = length31.parse(parameters.w);
19985
- const h2 = length31.parse(parameters.h);
19986
- const pl = length31.parse(parameters.pl);
19987
- const pw = length31.parse(parameters.pw);
19988
- const p = length31.parse(parameters.p);
20204
+ const w = length32.parse(parameters.w);
20205
+ const h2 = length32.parse(parameters.h);
20206
+ const pl = length32.parse(parameters.pl);
20207
+ const pw = length32.parse(parameters.pw);
20208
+ const p = length32.parse(parameters.p);
19989
20209
  const silkscreenRefText = silkscreenRef(0, h2, 0.3);
19990
20210
  const silkscreenLine = {
19991
20211
  type: "pcb_silkscreen_path",
@@ -20048,6 +20268,7 @@ var sod923 = (raw_params) => {
20048
20268
  };
20049
20269
  return {
20050
20270
  circuitJson: sodWithoutParsing5(parameters).concat(
20271
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
20051
20272
  silkscreenLine,
20052
20273
  silkscreenRefText,
20053
20274
  courtyard
@@ -20065,20 +20286,16 @@ var getSodCoords5 = (parameters) => {
20065
20286
  };
20066
20287
  var sodWithoutParsing5 = (parameters) => {
20067
20288
  const pads = [];
20289
+ const p = length32.parse(parameters.p);
20290
+ const pl = length32.parse(parameters.pl);
20291
+ const pw = length32.parse(parameters.pw);
20292
+ const cornerRadius = 0.03125;
20068
20293
  for (let i = 1; i <= parameters.num_pins; i++) {
20069
20294
  const { x, y } = getSodCoords5({
20070
20295
  pn: i,
20071
- p: Number.parseFloat(parameters.p)
20296
+ p
20072
20297
  });
20073
- pads.push(
20074
- rectpad(
20075
- i,
20076
- x,
20077
- y,
20078
- Number.parseFloat(parameters.pl),
20079
- Number.parseFloat(parameters.pw)
20080
- )
20081
- );
20298
+ pads.push(rectpad(i, x, y, pl, pw, cornerRadius));
20082
20299
  }
20083
20300
  return pads;
20084
20301
  };
@@ -20095,7 +20312,7 @@ var sod882 = (raw_params) => {
20095
20312
  const parameters = sod_def6.parse(raw_params);
20096
20313
  const silkscreenRefText = silkscreenRef(
20097
20314
  0,
20098
- length32.parse(parameters.h) + 0.1,
20315
+ length33.parse(parameters.h) + 0.1,
20099
20316
  0.3
20100
20317
  );
20101
20318
  const silkscreenLine = {
@@ -20104,20 +20321,20 @@ var sod882 = (raw_params) => {
20104
20321
  pcb_component_id: "",
20105
20322
  route: [
20106
20323
  {
20107
- x: length32.parse(parameters.p) / 2 + 0.2,
20108
- y: length32.parse(parameters.h) / 2 + 0.2
20324
+ x: length33.parse(parameters.p) / 2 + 0.2,
20325
+ y: length33.parse(parameters.h) / 2 + 0.2
20109
20326
  },
20110
20327
  {
20111
- x: -length32.parse(parameters.w) / 2 - 0.2,
20112
- y: length32.parse(parameters.h) / 2 + 0.2
20328
+ x: -length33.parse(parameters.w) / 2 - 0.2,
20329
+ y: length33.parse(parameters.h) / 2 + 0.2
20113
20330
  },
20114
20331
  {
20115
- x: -length32.parse(parameters.w) / 2 - 0.2,
20116
- y: -length32.parse(parameters.h) / 2 - 0.2
20332
+ x: -length33.parse(parameters.w) / 2 - 0.2,
20333
+ y: -length33.parse(parameters.h) / 2 - 0.2
20117
20334
  },
20118
20335
  {
20119
- x: length32.parse(parameters.p) / 2 + 0.2,
20120
- y: -length32.parse(parameters.h) / 2 - 0.2
20336
+ x: length33.parse(parameters.p) / 2 + 0.2,
20337
+ y: -length33.parse(parameters.h) / 2 - 0.2
20121
20338
  }
20122
20339
  ],
20123
20340
  stroke_width: 0.1,
@@ -20136,6 +20353,7 @@ var sod882 = (raw_params) => {
20136
20353
  };
20137
20354
  return {
20138
20355
  circuitJson: sodWithoutParsing6(parameters).concat(
20356
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
20139
20357
  silkscreenLine,
20140
20358
  silkscreenRefText,
20141
20359
  courtyard
@@ -20164,7 +20382,8 @@ var sodWithoutParsing6 = (parameters) => {
20164
20382
  x,
20165
20383
  y,
20166
20384
  Number.parseFloat(parameters.pl),
20167
- Number.parseFloat(parameters.pw)
20385
+ Number.parseFloat(parameters.pw),
20386
+ 0.025
20168
20387
  )
20169
20388
  );
20170
20389
  }
@@ -20183,7 +20402,7 @@ var sod323f = (raw_params) => {
20183
20402
  const parameters = sod_def7.parse(raw_params);
20184
20403
  const silkscreenRefText = silkscreenRef(
20185
20404
  0,
20186
- length33.parse(parameters.h),
20405
+ length34.parse(parameters.h),
20187
20406
  0.3
20188
20407
  );
20189
20408
  const silkscreenLine = {
@@ -20192,20 +20411,20 @@ var sod323f = (raw_params) => {
20192
20411
  pcb_component_id: "",
20193
20412
  route: [
20194
20413
  {
20195
- x: length33.parse(parameters.pad_spacing) / 2,
20196
- y: length33.parse(parameters.h) / 2
20414
+ x: length34.parse(parameters.pad_spacing) / 2,
20415
+ y: length34.parse(parameters.h) / 2
20197
20416
  },
20198
20417
  {
20199
- x: -length33.parse(parameters.w) / 2 - 0.2,
20200
- y: length33.parse(parameters.h) / 2
20418
+ x: -length34.parse(parameters.w) / 2 - 0.2,
20419
+ y: length34.parse(parameters.h) / 2
20201
20420
  },
20202
20421
  {
20203
- x: -length33.parse(parameters.w) / 2 - 0.2,
20204
- y: -length33.parse(parameters.h) / 2
20422
+ x: -length34.parse(parameters.w) / 2 - 0.2,
20423
+ y: -length34.parse(parameters.h) / 2
20205
20424
  },
20206
20425
  {
20207
- x: length33.parse(parameters.pad_spacing) / 2,
20208
- y: -length33.parse(parameters.h) / 2
20426
+ x: length34.parse(parameters.pad_spacing) / 2,
20427
+ y: -length34.parse(parameters.h) / 2
20209
20428
  }
20210
20429
  ],
20211
20430
  stroke_width: 0.1,
@@ -20224,6 +20443,7 @@ var sod323f = (raw_params) => {
20224
20443
  };
20225
20444
  return {
20226
20445
  circuitJson: sodWithoutParsing7(parameters).concat(
20446
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
20227
20447
  silkscreenLine,
20228
20448
  silkscreenRefText,
20229
20449
  courtyard
@@ -20252,7 +20472,8 @@ var sodWithoutParsing7 = (parameters) => {
20252
20472
  x,
20253
20473
  y,
20254
20474
  Number.parseFloat(parameters.pl),
20255
- Number.parseFloat(parameters.pw)
20475
+ Number.parseFloat(parameters.pw),
20476
+ 0.0625
20256
20477
  )
20257
20478
  );
20258
20479
  }
@@ -20271,7 +20492,7 @@ var sod123f = (raw_params) => {
20271
20492
  const parameters = sod_def8.parse(raw_params);
20272
20493
  const silkscreenRefText = silkscreenRef(
20273
20494
  0,
20274
- length34.parse(parameters.h),
20495
+ length35.parse(parameters.h),
20275
20496
  0.3
20276
20497
  );
20277
20498
  const silkscreenLine = {
@@ -20280,20 +20501,20 @@ var sod123f = (raw_params) => {
20280
20501
  pcb_component_id: "",
20281
20502
  route: [
20282
20503
  {
20283
- x: length34.parse(parameters.p) / 2,
20284
- y: length34.parse(parameters.h) / 2
20504
+ x: length35.parse(parameters.p) / 2,
20505
+ y: length35.parse(parameters.h) / 2
20285
20506
  },
20286
20507
  {
20287
- x: -length34.parse(parameters.w) / 2 - 0.2,
20288
- y: length34.parse(parameters.h) / 2
20508
+ x: -length35.parse(parameters.w) / 2 - 0.2,
20509
+ y: length35.parse(parameters.h) / 2
20289
20510
  },
20290
20511
  {
20291
- x: -length34.parse(parameters.w) / 2 - 0.2,
20292
- y: -length34.parse(parameters.h) / 2
20512
+ x: -length35.parse(parameters.w) / 2 - 0.2,
20513
+ y: -length35.parse(parameters.h) / 2
20293
20514
  },
20294
20515
  {
20295
- x: length34.parse(parameters.p) / 2,
20296
- y: -length34.parse(parameters.h) / 2
20516
+ x: length35.parse(parameters.p) / 2,
20517
+ y: -length35.parse(parameters.h) / 2
20297
20518
  }
20298
20519
  ],
20299
20520
  stroke_width: 0.1,
@@ -20312,6 +20533,7 @@ var sod123f = (raw_params) => {
20312
20533
  };
20313
20534
  return {
20314
20535
  circuitJson: sodWithoutParsing8(parameters).concat(
20536
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
20315
20537
  silkscreenLine,
20316
20538
  silkscreenRefText,
20317
20539
  courtyard
@@ -20329,20 +20551,16 @@ var getSodCoords8 = (parameters) => {
20329
20551
  };
20330
20552
  var sodWithoutParsing8 = (parameters) => {
20331
20553
  const pads = [];
20554
+ const p = length35.parse(parameters.p);
20555
+ const pl = length35.parse(parameters.pl);
20556
+ const pw = length35.parse(parameters.pw);
20557
+ const cornerRadius = 0.125;
20332
20558
  for (let i = 1; i <= parameters.num_pins; i++) {
20333
20559
  const { x, y } = getSodCoords8({
20334
20560
  pn: i,
20335
- p: Number.parseFloat(parameters.p)
20561
+ p
20336
20562
  });
20337
- pads.push(
20338
- rectpad(
20339
- i,
20340
- x,
20341
- y,
20342
- Number.parseFloat(parameters.pl),
20343
- Number.parseFloat(parameters.pw)
20344
- )
20345
- );
20563
+ pads.push(rectpad(i, x, y, pl, pw, cornerRadius));
20346
20564
  }
20347
20565
  return pads;
20348
20566
  };
@@ -20359,7 +20577,7 @@ var sod123fl = (raw_params) => {
20359
20577
  const parameters = sod123FL_def.parse(raw_params);
20360
20578
  const silkscreenRefText = silkscreenRef(
20361
20579
  0,
20362
- length35.parse(parameters.h),
20580
+ length36.parse(parameters.h),
20363
20581
  0.3
20364
20582
  );
20365
20583
  const silkscreenLine = {
@@ -20368,20 +20586,20 @@ var sod123fl = (raw_params) => {
20368
20586
  pcb_component_id: "",
20369
20587
  route: [
20370
20588
  {
20371
- x: length35.parse(parameters.p) / 2,
20372
- y: length35.parse(parameters.h) / 2
20589
+ x: length36.parse(parameters.p) / 2,
20590
+ y: length36.parse(parameters.h) / 2
20373
20591
  },
20374
20592
  {
20375
- x: -length35.parse(parameters.w) / 2 - 0.2,
20376
- y: length35.parse(parameters.h) / 2
20593
+ x: -length36.parse(parameters.w) / 2 - 0.2,
20594
+ y: length36.parse(parameters.h) / 2
20377
20595
  },
20378
20596
  {
20379
- x: -length35.parse(parameters.w) / 2 - 0.2,
20380
- y: -length35.parse(parameters.h) / 2
20597
+ x: -length36.parse(parameters.w) / 2 - 0.2,
20598
+ y: -length36.parse(parameters.h) / 2
20381
20599
  },
20382
20600
  {
20383
- x: length35.parse(parameters.p) / 2,
20384
- y: -length35.parse(parameters.h) / 2
20601
+ x: length36.parse(parameters.p) / 2,
20602
+ y: -length36.parse(parameters.h) / 2
20385
20603
  }
20386
20604
  ],
20387
20605
  stroke_width: 0.1,
@@ -20400,6 +20618,7 @@ var sod123fl = (raw_params) => {
20400
20618
  };
20401
20619
  return {
20402
20620
  circuitJson: sodWithoutParsing9(parameters).concat(
20621
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
20403
20622
  silkscreenLine,
20404
20623
  silkscreenRefText,
20405
20624
  courtyard
@@ -20447,7 +20666,7 @@ var sod723 = (raw_params) => {
20447
20666
  const parameters = sod_def9.parse(raw_params);
20448
20667
  const silkscreenRefText = silkscreenRef(
20449
20668
  0,
20450
- length36.parse(parameters.h),
20669
+ length37.parse(parameters.h),
20451
20670
  0.3
20452
20671
  );
20453
20672
  const silkscreenLine = {
@@ -20456,20 +20675,20 @@ var sod723 = (raw_params) => {
20456
20675
  pcb_component_id: "",
20457
20676
  route: [
20458
20677
  {
20459
- x: length36.parse(parameters.p) / 2,
20460
- y: length36.parse(parameters.h) / 2
20678
+ x: length37.parse(parameters.p) / 2,
20679
+ y: length37.parse(parameters.h) / 2
20461
20680
  },
20462
20681
  {
20463
- x: -length36.parse(parameters.w) / 2 - 0.1,
20464
- y: length36.parse(parameters.h) / 2
20682
+ x: -length37.parse(parameters.w) / 2 - 0.1,
20683
+ y: length37.parse(parameters.h) / 2
20465
20684
  },
20466
20685
  {
20467
- x: -length36.parse(parameters.w) / 2 - 0.1,
20468
- y: -length36.parse(parameters.h) / 2
20686
+ x: -length37.parse(parameters.w) / 2 - 0.1,
20687
+ y: -length37.parse(parameters.h) / 2
20469
20688
  },
20470
20689
  {
20471
- x: length36.parse(parameters.p) / 2,
20472
- y: -length36.parse(parameters.h) / 2
20690
+ x: length37.parse(parameters.p) / 2,
20691
+ y: -length37.parse(parameters.h) / 2
20473
20692
  }
20474
20693
  ],
20475
20694
  stroke_width: 0.1,
@@ -20488,6 +20707,7 @@ var sod723 = (raw_params) => {
20488
20707
  };
20489
20708
  return {
20490
20709
  circuitJson: sodWithoutParsing10(parameters).concat(
20710
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
20491
20711
  silkscreenLine,
20492
20712
  silkscreenRefText,
20493
20713
  courtyard
@@ -20535,7 +20755,7 @@ var sod128 = (raw_params) => {
20535
20755
  const parameters = sod_def10.parse(raw_params);
20536
20756
  const silkscreenRefText = silkscreenRef(
20537
20757
  0,
20538
- length37.parse(parameters.h) / 2 + 0.4,
20758
+ length38.parse(parameters.h) / 2 + 0.4,
20539
20759
  0.3
20540
20760
  );
20541
20761
  const silkscreenLine = {
@@ -20544,20 +20764,20 @@ var sod128 = (raw_params) => {
20544
20764
  pcb_component_id: "",
20545
20765
  route: [
20546
20766
  {
20547
- x: length37.parse(parameters.p) / 2,
20548
- y: length37.parse(parameters.h) / 2
20767
+ x: length38.parse(parameters.p) / 2,
20768
+ y: length38.parse(parameters.h) / 2
20549
20769
  },
20550
20770
  {
20551
- x: -length37.parse(parameters.w) / 2 - 0.2,
20552
- y: length37.parse(parameters.h) / 2
20771
+ x: -length38.parse(parameters.w) / 2 - 0.2,
20772
+ y: length38.parse(parameters.h) / 2
20553
20773
  },
20554
20774
  {
20555
- x: -length37.parse(parameters.w) / 2 - 0.2,
20556
- y: -length37.parse(parameters.h) / 2
20775
+ x: -length38.parse(parameters.w) / 2 - 0.2,
20776
+ y: -length38.parse(parameters.h) / 2
20557
20777
  },
20558
20778
  {
20559
- x: length37.parse(parameters.p) / 2,
20560
- y: -length37.parse(parameters.h) / 2
20779
+ x: length38.parse(parameters.p) / 2,
20780
+ y: -length38.parse(parameters.h) / 2
20561
20781
  }
20562
20782
  ],
20563
20783
  stroke_width: 0.1,
@@ -20576,6 +20796,7 @@ var sod128 = (raw_params) => {
20576
20796
  };
20577
20797
  return {
20578
20798
  circuitJson: sodWithoutParsing11(parameters).concat(
20799
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
20579
20800
  silkscreenLine,
20580
20801
  silkscreenRefText,
20581
20802
  courtyard
@@ -20604,17 +20825,28 @@ var sodWithoutParsing11 = (parameters) => {
20604
20825
  x,
20605
20826
  y,
20606
20827
  Number.parseFloat(parameters.pl),
20607
- Number.parseFloat(parameters.pw)
20828
+ Number.parseFloat(parameters.pw),
20829
+ 0.125
20608
20830
  )
20609
20831
  );
20610
20832
  }
20611
20833
  return pads;
20612
20834
  };
20835
+ var polygonpad = (pn, points) => {
20836
+ return {
20837
+ type: "pcb_smtpad",
20838
+ points,
20839
+ layer: "top",
20840
+ shape: "polygon",
20841
+ pcb_smtpad_id: "",
20842
+ port_hints: Array.isArray(pn) ? pn.map((item) => item.toString()) : [pn.toString()]
20843
+ };
20844
+ };
20613
20845
  var sot89_3CourtyardOutline = [
20614
- { x: -3.0875, y: -2.5 },
20615
- { x: -3.0875, y: 2.5 },
20616
- { x: 2.0125, y: 2.5 },
20617
- { x: 2.0125, y: -2.5 }
20846
+ { x: -2.85, y: -2.5 },
20847
+ { x: -2.85, y: 2.5 },
20848
+ { x: 2.25, y: 2.5 },
20849
+ { x: 2.25, y: -2.5 }
20618
20850
  ];
20619
20851
  var sot89_5CourtyardOutline = [
20620
20852
  { x: -2.85, y: -2.5 },
@@ -20622,6 +20854,30 @@ var sot89_5CourtyardOutline = [
20622
20854
  { x: 2.85, y: 2.5 },
20623
20855
  { x: 2.85, y: -2.5 }
20624
20856
  ];
20857
+ var sot89_5CenterPadPoints = [
20858
+ { x: 0.9, y: 0.5 },
20859
+ { x: 2.6, y: 0.5 },
20860
+ { x: 2.6, y: -0.5 },
20861
+ { x: 0.9, y: -0.5 },
20862
+ { x: 0.4, y: -1 },
20863
+ { x: -0.4, y: -1 },
20864
+ { x: -0.9, y: -0.5 },
20865
+ { x: -2.6, y: -0.5 },
20866
+ { x: -2.6, y: 0.5 },
20867
+ { x: -0.9, y: 0.5 },
20868
+ { x: -0.4, y: 1 },
20869
+ { x: 0.4, y: 1 }
20870
+ ];
20871
+ var sot89_3CenterPadPoints = [
20872
+ { x: 2, y: -0.8665 },
20873
+ { x: -1.125, y: -0.8665 },
20874
+ { x: -1.125, y: -0.45 },
20875
+ { x: -2.6, y: -0.45 },
20876
+ { x: -2.6, y: 0.45 },
20877
+ { x: -1.125, y: 0.45 },
20878
+ { x: -1.125, y: 0.8665 },
20879
+ { x: 2, y: 0.8665 }
20880
+ ];
20625
20881
  var sot89_def = base_def.extend({
20626
20882
  fn: z47.string(),
20627
20883
  num_pins: z47.union([z47.literal(3), z47.literal(5)]).default(3),
@@ -20633,21 +20889,19 @@ var sot89_def = base_def.extend({
20633
20889
  string: z47.string().optional()
20634
20890
  });
20635
20891
  var sot89_3 = (parameters) => {
20636
- const pads = [];
20637
20892
  const padGap = Number.parseFloat(parameters.p);
20638
20893
  const padWidth = Number.parseFloat(parameters.pw);
20639
- const length63 = Number.parseFloat(parameters.w);
20894
+ const length64 = Number.parseFloat(parameters.w);
20640
20895
  const padHeight = Number.parseFloat(parameters.pl);
20641
- const centerExtra = 0.175;
20642
- const outerPadXShift = (padHeight - (padHeight + centerExtra)) / 2;
20643
- pads.push(
20644
- rectpad(1, -length63 / 2 + outerPadXShift, padGap, padHeight, padWidth),
20645
- rectpad(2, -length63 / 2, 0, padHeight + centerExtra, padWidth),
20646
- rectpad(3, -length63 / 2 + outerPadXShift, -padGap, padHeight, padWidth)
20647
- );
20648
- const silkscreenRefText = silkscreenRef(0, 0, 0.3);
20649
- const width10 = Number.parseFloat(parameters.w) / 2 - 1;
20896
+ const outerPadX = -length64 / 2 + 0.15;
20897
+ const width10 = length64 / 2 - 1;
20650
20898
  const height10 = Number.parseFloat(parameters.h) / 2;
20899
+ const pads = [
20900
+ rectpad(1, outerPadX, padGap, padHeight, padWidth),
20901
+ polygonpad(2, sot89_3CenterPadPoints),
20902
+ rectpad(3, outerPadX, -padGap, padHeight, padWidth)
20903
+ ];
20904
+ const silkscreenRefText = silkscreenRef(0, height10 + 0.5, 0.3);
20651
20905
  const silkscreenPath1 = {
20652
20906
  layer: "top",
20653
20907
  pcb_component_id: "",
@@ -20688,24 +20942,16 @@ var sot89_3 = (parameters) => {
20688
20942
  ];
20689
20943
  };
20690
20944
  var sot89_5 = (parameters) => {
20691
- const pads = [];
20692
- const padGap = Number.parseFloat(parameters.p);
20693
- const padWidth = Number.parseFloat(parameters.pw);
20694
- const length63 = Number.parseFloat(parameters.w);
20695
- pads.push(
20945
+ const pads = [
20696
20946
  rectpad(1, -1.85, -1.5, 1.5, 0.7),
20697
20947
  rectpad(2, -1.85, 1.5, 1.5, 0.7),
20698
- rectpad(3, 0, 0, 0.8, 2),
20948
+ polygonpad(3, sot89_5CenterPadPoints),
20699
20949
  rectpad(4, 1.85, -1.5, 1.5, 0.7),
20700
20950
  rectpad(5, 1.85, 1.5, 1.5, 0.7)
20701
- );
20702
- const silkscreenRefText = silkscreenRef(
20703
- 0,
20704
- Number.parseFloat(parameters.h) / 2 + 0.5,
20705
- 0.3
20706
- );
20951
+ ];
20707
20952
  const width10 = Number.parseFloat(parameters.w) / 2 - 1;
20708
20953
  const height10 = Number.parseFloat(parameters.h) / 2;
20954
+ const silkscreenRefText = silkscreenRef(0, height10 + 0.5, 0.3);
20709
20955
  const silkscreenPath1 = {
20710
20956
  layer: "top",
20711
20957
  pcb_component_id: "",
@@ -20766,11 +21012,11 @@ var sot89 = (raw_params) => {
20766
21012
  };
20767
21013
  var to220_def = base_def.extend({
20768
21014
  fn: z48.string(),
20769
- p: length38.optional().default("5.0mm"),
20770
- id: length38.optional().default("1.0mm"),
20771
- od: length38.optional().default("1.9mm"),
20772
- w: length38.optional().default("13mm"),
20773
- h: length38.optional().default("7mm"),
21015
+ p: length39.optional().default("5.0mm"),
21016
+ id: length39.optional().default("1.0mm"),
21017
+ od: length39.optional().default("1.9mm"),
21018
+ w: length39.optional().default("13mm"),
21019
+ h: length39.optional().default("7mm"),
20774
21020
  num_pins: z48.number().optional(),
20775
21021
  string: z48.string().optional()
20776
21022
  });
@@ -20877,11 +21123,11 @@ var TO220F_PITCH_MM = 2.54;
20877
21123
  var to220f_def = base_def.extend({
20878
21124
  fn: z49.string(),
20879
21125
  // KiCad TO-220F-3_Vertical: hole=1.2mm, pad=1.905×2.0mm, pitch=2.54mm
20880
- id: length39.optional().default("1.2mm"),
20881
- od: length39.optional().default("1.905mm"),
20882
- ph: length39.optional().default("2mm"),
20883
- w: length39.optional().default("13mm"),
20884
- h: length39.optional().default("7mm"),
21126
+ id: length40.optional().default("1.2mm"),
21127
+ od: length40.optional().default("1.905mm"),
21128
+ ph: length40.optional().default("2mm"),
21129
+ w: length40.optional().default("13mm"),
21130
+ h: length40.optional().default("7mm"),
20885
21131
  num_pins: z49.number().optional(),
20886
21132
  string: z49.string().optional()
20887
21133
  });
@@ -20942,7 +21188,7 @@ var minimelf = (raw_params) => {
20942
21188
  const parameters = minimelf_def.parse(raw_params);
20943
21189
  const silkscreenRefText = silkscreenRef(
20944
21190
  0,
20945
- length40.parse(parameters.h) / 2 + 0.4,
21191
+ length41.parse(parameters.h) / 2 + 0.4,
20946
21192
  0.3
20947
21193
  );
20948
21194
  const silkscreenLine = {
@@ -20951,20 +21197,20 @@ var minimelf = (raw_params) => {
20951
21197
  pcb_component_id: "",
20952
21198
  route: [
20953
21199
  {
20954
- x: length40.parse(parameters.p) / 2,
20955
- y: length40.parse(parameters.h) / 2
21200
+ x: length41.parse(parameters.p) / 2,
21201
+ y: length41.parse(parameters.h) / 2
20956
21202
  },
20957
21203
  {
20958
- x: -length40.parse(parameters.w) / 2,
20959
- y: length40.parse(parameters.h) / 2
21204
+ x: -length41.parse(parameters.w) / 2,
21205
+ y: length41.parse(parameters.h) / 2
20960
21206
  },
20961
21207
  {
20962
- x: -length40.parse(parameters.w) / 2,
20963
- y: -length40.parse(parameters.h) / 2
21208
+ x: -length41.parse(parameters.w) / 2,
21209
+ y: -length41.parse(parameters.h) / 2
20964
21210
  },
20965
21211
  {
20966
- x: length40.parse(parameters.p) / 2,
20967
- y: -length40.parse(parameters.h) / 2
21212
+ x: length41.parse(parameters.p) / 2,
21213
+ y: -length41.parse(parameters.h) / 2
20968
21214
  }
20969
21215
  ],
20970
21216
  stroke_width: 0.1,
@@ -21007,7 +21253,8 @@ var miniMelfWithoutParsing = (parameters) => {
21007
21253
  x,
21008
21254
  y,
21009
21255
  Number.parseFloat(parameters.pl),
21010
- Number.parseFloat(parameters.pw)
21256
+ Number.parseFloat(parameters.pw),
21257
+ 0.125
21011
21258
  )
21012
21259
  );
21013
21260
  }
@@ -21026,7 +21273,7 @@ var sod882d = (raw_params) => {
21026
21273
  const parameters = sod_def11.parse(raw_params);
21027
21274
  const silkscreenRefText = silkscreenRef(
21028
21275
  0,
21029
- length41.parse(parameters.h) + 0.1,
21276
+ length42.parse(parameters.h) + 0.1,
21030
21277
  0.3
21031
21278
  );
21032
21279
  const silkscreenLine = {
@@ -21035,20 +21282,20 @@ var sod882d = (raw_params) => {
21035
21282
  pcb_component_id: "",
21036
21283
  route: [
21037
21284
  {
21038
- x: length41.parse(parameters.p) / 2 + 0.1,
21039
- y: length41.parse(parameters.h) / 2
21285
+ x: length42.parse(parameters.p) / 2 + 0.1,
21286
+ y: length42.parse(parameters.h) / 2
21040
21287
  },
21041
21288
  {
21042
- x: -length41.parse(parameters.w) / 2,
21043
- y: length41.parse(parameters.h) / 2
21289
+ x: -length42.parse(parameters.w) / 2,
21290
+ y: length42.parse(parameters.h) / 2
21044
21291
  },
21045
21292
  {
21046
- x: -length41.parse(parameters.w) / 2,
21047
- y: -length41.parse(parameters.h) / 2
21293
+ x: -length42.parse(parameters.w) / 2,
21294
+ y: -length42.parse(parameters.h) / 2
21048
21295
  },
21049
21296
  {
21050
- x: length41.parse(parameters.p) / 2 + 0.1,
21051
- y: -length41.parse(parameters.h) / 2
21297
+ x: length42.parse(parameters.p) / 2 + 0.1,
21298
+ y: -length42.parse(parameters.h) / 2
21052
21299
  }
21053
21300
  ],
21054
21301
  stroke_width: 0.1,
@@ -21067,6 +21314,7 @@ var sod882d = (raw_params) => {
21067
21314
  };
21068
21315
  return {
21069
21316
  circuitJson: sodWithoutParsing12(parameters).concat(
21317
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
21070
21318
  silkscreenLine,
21071
21319
  silkscreenRefText,
21072
21320
  courtyard
@@ -21095,7 +21343,8 @@ var sodWithoutParsing12 = (parameters) => {
21095
21343
  x,
21096
21344
  y,
21097
21345
  Number.parseFloat(parameters.pl),
21098
- Number.parseFloat(parameters.pw)
21346
+ Number.parseFloat(parameters.pw),
21347
+ 0.0625
21099
21348
  )
21100
21349
  );
21101
21350
  }
@@ -21114,7 +21363,7 @@ var melf = (raw_params) => {
21114
21363
  const parameters = melf_def.parse(raw_params);
21115
21364
  const silkscreenRefText = silkscreenRef(
21116
21365
  0,
21117
- length42.parse(parameters.h),
21366
+ length43.parse(parameters.h),
21118
21367
  0.3
21119
21368
  );
21120
21369
  const silkscreenLine = {
@@ -21123,20 +21372,20 @@ var melf = (raw_params) => {
21123
21372
  pcb_component_id: "",
21124
21373
  route: [
21125
21374
  {
21126
- x: length42.parse(parameters.p) / 2,
21127
- y: length42.parse(parameters.h) / 2
21375
+ x: length43.parse(parameters.p) / 2,
21376
+ y: length43.parse(parameters.h) / 2
21128
21377
  },
21129
21378
  {
21130
- x: -length42.parse(parameters.w) / 2,
21131
- y: length42.parse(parameters.h) / 2
21379
+ x: -length43.parse(parameters.w) / 2,
21380
+ y: length43.parse(parameters.h) / 2
21132
21381
  },
21133
21382
  {
21134
- x: -length42.parse(parameters.w) / 2,
21135
- y: -length42.parse(parameters.h) / 2
21383
+ x: -length43.parse(parameters.w) / 2,
21384
+ y: -length43.parse(parameters.h) / 2
21136
21385
  },
21137
21386
  {
21138
- x: length42.parse(parameters.p) / 2,
21139
- y: -length42.parse(parameters.h) / 2
21387
+ x: length43.parse(parameters.p) / 2,
21388
+ y: -length43.parse(parameters.h) / 2
21140
21389
  }
21141
21390
  ],
21142
21391
  stroke_width: 0.1,
@@ -21183,7 +21432,8 @@ var melfWithoutParsing = (parameters) => {
21183
21432
  x,
21184
21433
  y,
21185
21434
  Number.parseFloat(parameters.pl),
21186
- Number.parseFloat(parameters.pw)
21435
+ Number.parseFloat(parameters.pw),
21436
+ 0.125
21187
21437
  )
21188
21438
  );
21189
21439
  }
@@ -21202,7 +21452,7 @@ var micromelf = (raw_params) => {
21202
21452
  const parameters = micromelf_def.parse(raw_params);
21203
21453
  const silkscreenRefText = silkscreenRef(
21204
21454
  0,
21205
- length43.parse(parameters.h),
21455
+ length44.parse(parameters.h),
21206
21456
  0.3
21207
21457
  );
21208
21458
  const silkscreenLine = {
@@ -21211,20 +21461,20 @@ var micromelf = (raw_params) => {
21211
21461
  pcb_component_id: "",
21212
21462
  route: [
21213
21463
  {
21214
- x: length43.parse(parameters.p) / 2,
21215
- y: length43.parse(parameters.h) / 2
21464
+ x: length44.parse(parameters.p) / 2,
21465
+ y: length44.parse(parameters.h) / 2
21216
21466
  },
21217
21467
  {
21218
- x: -length43.parse(parameters.w) / 2 - 0.1,
21219
- y: length43.parse(parameters.h) / 2
21468
+ x: -length44.parse(parameters.w) / 2 - 0.1,
21469
+ y: length44.parse(parameters.h) / 2
21220
21470
  },
21221
21471
  {
21222
- x: -length43.parse(parameters.w) / 2 - 0.1,
21223
- y: -length43.parse(parameters.h) / 2
21472
+ x: -length44.parse(parameters.w) / 2 - 0.1,
21473
+ y: -length44.parse(parameters.h) / 2
21224
21474
  },
21225
21475
  {
21226
- x: length43.parse(parameters.p) / 2,
21227
- y: -length43.parse(parameters.h) / 2
21476
+ x: length44.parse(parameters.p) / 2,
21477
+ y: -length44.parse(parameters.h) / 2
21228
21478
  }
21229
21479
  ],
21230
21480
  stroke_width: 0.1,
@@ -21271,7 +21521,8 @@ var microMelfWithoutParsing = (parameters) => {
21271
21521
  x,
21272
21522
  y,
21273
21523
  Number.parseFloat(parameters.pl),
21274
- Number.parseFloat(parameters.pw)
21524
+ Number.parseFloat(parameters.pw),
21525
+ 0.1
21275
21526
  )
21276
21527
  );
21277
21528
  }
@@ -21290,7 +21541,7 @@ var sma = (raw_params) => {
21290
21541
  const parameters = sma_def.parse(raw_params);
21291
21542
  const silkscreenRefText = silkscreenRef(
21292
21543
  0,
21293
- length44.parse(parameters.h) / 2 + 0.5,
21544
+ length45.parse(parameters.h) / 2 + 0.5,
21294
21545
  0.3
21295
21546
  );
21296
21547
  const silkscreenLine = {
@@ -21299,20 +21550,20 @@ var sma = (raw_params) => {
21299
21550
  pcb_component_id: "",
21300
21551
  route: [
21301
21552
  {
21302
- x: length44.parse(parameters.p) / 2,
21303
- y: length44.parse(parameters.h) / 2
21553
+ x: length45.parse(parameters.p) / 2,
21554
+ y: length45.parse(parameters.h) / 2
21304
21555
  },
21305
21556
  {
21306
- x: -length44.parse(parameters.w) / 2 - 0.5,
21307
- y: length44.parse(parameters.h) / 2
21557
+ x: -length45.parse(parameters.w) / 2 - 0.5,
21558
+ y: length45.parse(parameters.h) / 2
21308
21559
  },
21309
21560
  {
21310
- x: -length44.parse(parameters.w) / 2 - 0.5,
21311
- y: -length44.parse(parameters.h) / 2
21561
+ x: -length45.parse(parameters.w) / 2 - 0.5,
21562
+ y: -length45.parse(parameters.h) / 2
21312
21563
  },
21313
21564
  {
21314
- x: length44.parse(parameters.p) / 2,
21315
- y: -length44.parse(parameters.h) / 2
21565
+ x: length45.parse(parameters.p) / 2,
21566
+ y: -length45.parse(parameters.h) / 2
21316
21567
  }
21317
21568
  ],
21318
21569
  stroke_width: 0.1,
@@ -21358,7 +21609,8 @@ var smaWithoutParsing = (parameters) => {
21358
21609
  x,
21359
21610
  y,
21360
21611
  Number.parseFloat(parameters.pl),
21361
- Number.parseFloat(parameters.pw)
21612
+ Number.parseFloat(parameters.pw),
21613
+ 0.125
21362
21614
  )
21363
21615
  );
21364
21616
  }
@@ -21377,7 +21629,7 @@ var smf = (raw_params) => {
21377
21629
  const parameters = smf_def.parse(raw_params);
21378
21630
  const silkscreenRefText = silkscreenRef(
21379
21631
  0,
21380
- length45.parse(parameters.h) - 0.5,
21632
+ length46.parse(parameters.h) - 0.5,
21381
21633
  0.3
21382
21634
  );
21383
21635
  const silkscreenLine = {
@@ -21386,20 +21638,20 @@ var smf = (raw_params) => {
21386
21638
  pcb_component_id: "",
21387
21639
  route: [
21388
21640
  {
21389
- x: length45.parse(parameters.p) / 2,
21390
- y: length45.parse(parameters.h) / 2
21641
+ x: length46.parse(parameters.p) / 2,
21642
+ y: length46.parse(parameters.h) / 2
21391
21643
  },
21392
21644
  {
21393
- x: -length45.parse(parameters.w) / 2,
21394
- y: length45.parse(parameters.h) / 2
21645
+ x: -length46.parse(parameters.w) / 2,
21646
+ y: length46.parse(parameters.h) / 2
21395
21647
  },
21396
21648
  {
21397
- x: -length45.parse(parameters.w) / 2,
21398
- y: -length45.parse(parameters.h) / 2
21649
+ x: -length46.parse(parameters.w) / 2,
21650
+ y: -length46.parse(parameters.h) / 2
21399
21651
  },
21400
21652
  {
21401
- x: length45.parse(parameters.p) / 2,
21402
- y: -length45.parse(parameters.h) / 2
21653
+ x: length46.parse(parameters.p) / 2,
21654
+ y: -length46.parse(parameters.h) / 2
21403
21655
  }
21404
21656
  ],
21405
21657
  stroke_width: 0.1,
@@ -21446,7 +21698,8 @@ var smfWithoutParsing = (parameters) => {
21446
21698
  x,
21447
21699
  y,
21448
21700
  Number.parseFloat(parameters.pl),
21449
- Number.parseFloat(parameters.pw)
21701
+ Number.parseFloat(parameters.pw),
21702
+ 0.125
21450
21703
  )
21451
21704
  );
21452
21705
  }
@@ -21465,7 +21718,7 @@ var smb = (raw_params) => {
21465
21718
  const parameters = smb_def.parse(raw_params);
21466
21719
  const silkscreenRefText = silkscreenRef(
21467
21720
  0,
21468
- length46.parse(parameters.h) / 2 + 0.5,
21721
+ length47.parse(parameters.h) / 2 + 0.5,
21469
21722
  0.3
21470
21723
  );
21471
21724
  const silkscreenLine = {
@@ -21474,20 +21727,20 @@ var smb = (raw_params) => {
21474
21727
  pcb_component_id: "",
21475
21728
  route: [
21476
21729
  {
21477
- x: length46.parse(parameters.p) / 2,
21478
- y: length46.parse(parameters.h) / 2
21730
+ x: length47.parse(parameters.p) / 2,
21731
+ y: length47.parse(parameters.h) / 2
21479
21732
  },
21480
21733
  {
21481
- x: -length46.parse(parameters.w) / 2 - 0.1,
21482
- y: length46.parse(parameters.h) / 2
21734
+ x: -length47.parse(parameters.w) / 2 - 0.1,
21735
+ y: length47.parse(parameters.h) / 2
21483
21736
  },
21484
21737
  {
21485
- x: -length46.parse(parameters.w) / 2 - 0.1,
21486
- y: -length46.parse(parameters.h) / 2
21738
+ x: -length47.parse(parameters.w) / 2 - 0.1,
21739
+ y: -length47.parse(parameters.h) / 2
21487
21740
  },
21488
21741
  {
21489
- x: length46.parse(parameters.p) / 2,
21490
- y: -length46.parse(parameters.h) / 2
21742
+ x: length47.parse(parameters.p) / 2,
21743
+ y: -length47.parse(parameters.h) / 2
21491
21744
  }
21492
21745
  ],
21493
21746
  stroke_width: 0.1,
@@ -21534,7 +21787,8 @@ var smbWithoutParsing = (parameters) => {
21534
21787
  x,
21535
21788
  y,
21536
21789
  Number.parseFloat(parameters.pl),
21537
- Number.parseFloat(parameters.pw)
21790
+ Number.parseFloat(parameters.pw),
21791
+ 0.125
21538
21792
  )
21539
21793
  );
21540
21794
  }
@@ -21558,20 +21812,20 @@ var smc = (raw_params) => {
21558
21812
  pcb_component_id: "",
21559
21813
  route: [
21560
21814
  {
21561
- x: length47.parse(parameters.p) / 2,
21562
- y: length47.parse(parameters.h) / 2 - 0.8
21815
+ x: length48.parse(parameters.p) / 2,
21816
+ y: length48.parse(parameters.h) / 2 - 0.8
21563
21817
  },
21564
21818
  {
21565
- x: -length47.parse(parameters.w) / 2 - 0.8,
21566
- y: length47.parse(parameters.h) / 2 - 0.8
21819
+ x: -length48.parse(parameters.w) / 2 - 0.8,
21820
+ y: length48.parse(parameters.h) / 2 - 0.8
21567
21821
  },
21568
21822
  {
21569
- x: -length47.parse(parameters.w) / 2 - 0.8,
21570
- y: -length47.parse(parameters.h) / 2 + 0.8
21823
+ x: -length48.parse(parameters.w) / 2 - 0.8,
21824
+ y: -length48.parse(parameters.h) / 2 + 0.8
21571
21825
  },
21572
21826
  {
21573
- x: length47.parse(parameters.p) / 2,
21574
- y: -length47.parse(parameters.h) / 2 + 0.8
21827
+ x: length48.parse(parameters.p) / 2,
21828
+ y: -length48.parse(parameters.h) / 2 + 0.8
21575
21829
  }
21576
21830
  ],
21577
21831
  stroke_width: 0.1,
@@ -21617,7 +21871,8 @@ var smcWithoutParsing = (parameters) => {
21617
21871
  x,
21618
21872
  y,
21619
21873
  Number.parseFloat(parameters.pl),
21620
- Number.parseFloat(parameters.pw)
21874
+ Number.parseFloat(parameters.pw),
21875
+ 0.125
21621
21876
  )
21622
21877
  );
21623
21878
  }
@@ -22107,9 +22362,26 @@ var to92s_2 = (parameters) => {
22107
22362
  const { p, id, od, h: h2 } = parameters;
22108
22363
  const holeY = Number.parseFloat(h2) / 2;
22109
22364
  const padSpacing7 = Number.parseFloat(p);
22365
+ const holeDiameter = Number.parseFloat(id);
22366
+ const padWidth = Number.parseFloat(od);
22367
+ const padHeight = padWidth * (1.5 / 1.05);
22110
22368
  return [
22111
- platedhole(1, -padSpacing7, holeY - padSpacing7, id, od),
22112
- platedhole(2, padSpacing7, holeY - padSpacing7, id, od)
22369
+ platedHoleWithRectPad({
22370
+ pn: 1,
22371
+ x: -padSpacing7,
22372
+ y: holeY - padSpacing7,
22373
+ holeDiameter,
22374
+ rectPadWidth: padWidth,
22375
+ rectPadHeight: padHeight
22376
+ }),
22377
+ platedHolePill(
22378
+ 2,
22379
+ padSpacing7,
22380
+ holeY - padSpacing7,
22381
+ holeDiameter,
22382
+ padWidth,
22383
+ padHeight
22384
+ )
22113
22385
  ];
22114
22386
  };
22115
22387
  var to92s = (raw_params) => {
@@ -22184,12 +22456,12 @@ var to92s = (raw_params) => {
22184
22456
  };
22185
22457
  var jst_def = base_def.extend({
22186
22458
  fn: z61.string(),
22187
- p: length48.optional(),
22188
- id: length48.optional(),
22189
- pw: length48.optional(),
22190
- pl: length48.optional(),
22191
- w: length48.optional(),
22192
- h: length48.optional(),
22459
+ p: length49.optional(),
22460
+ id: length49.optional(),
22461
+ pw: length49.optional(),
22462
+ pl: length49.optional(),
22463
+ w: length49.optional(),
22464
+ h: length49.optional(),
22193
22465
  sh: z61.boolean().optional().describe(
22194
22466
  'JST SH (Surface-mount) connector family. SH stands for "Super High-density".'
22195
22467
  ),
@@ -22223,27 +22495,27 @@ var modifyBoundsToIncludeRect = ({
22223
22495
  };
22224
22496
  var variantDefaults = {
22225
22497
  ph: {
22226
- p: length48.parse("2.2mm"),
22227
- id: length48.parse("0.70mm"),
22228
- pw: length48.parse("1.20mm"),
22229
- pl: length48.parse("1.20mm"),
22230
- w: length48.parse("6mm"),
22231
- h: length48.parse("5mm")
22498
+ p: length49.parse("2.2mm"),
22499
+ id: length49.parse("0.70mm"),
22500
+ pw: length49.parse("1.20mm"),
22501
+ pl: length49.parse("1.20mm"),
22502
+ w: length49.parse("6mm"),
22503
+ h: length49.parse("5mm")
22232
22504
  },
22233
22505
  sh: {
22234
- p: length48.parse("1mm"),
22235
- pw: length48.parse("0.6mm"),
22236
- pl: length48.parse("1.55mm"),
22237
- w: length48.parse("5.8mm"),
22238
- h: length48.parse("7.8mm")
22506
+ p: length49.parse("1mm"),
22507
+ pw: length49.parse("0.6mm"),
22508
+ pl: length49.parse("1.55mm"),
22509
+ w: length49.parse("5.8mm"),
22510
+ h: length49.parse("7.8mm")
22239
22511
  },
22240
22512
  zh: {
22241
- p: length48.parse("1.5mm"),
22242
- id: length48.parse("0.73mm"),
22243
- pw: length48.parse("1.03mm"),
22244
- pl: length48.parse("1.73mm"),
22245
- w: length48.parse("3mm"),
22246
- h: length48.parse("3.5mm")
22513
+ p: length49.parse("1.5mm"),
22514
+ id: length49.parse("0.73mm"),
22515
+ pw: length49.parse("1.03mm"),
22516
+ pl: length49.parse("1.73mm"),
22517
+ w: length49.parse("3mm"),
22518
+ h: length49.parse("3.5mm")
22247
22519
  }
22248
22520
  };
22249
22521
  function getVariant(params) {
@@ -22512,7 +22784,7 @@ var sod110 = (raw_params) => {
22512
22784
  const parameters = sod_def12.parse(raw_params);
22513
22785
  const silkscreenRefText = silkscreenRef(
22514
22786
  0,
22515
- length49.parse(parameters.h) / 2 + 0.5,
22787
+ length50.parse(parameters.h) / 2 + 0.5,
22516
22788
  0.3
22517
22789
  );
22518
22790
  const silkscreenLine = {
@@ -22521,20 +22793,20 @@ var sod110 = (raw_params) => {
22521
22793
  pcb_component_id: "",
22522
22794
  route: [
22523
22795
  {
22524
- x: length49.parse(parameters.p) / 2,
22525
- y: length49.parse(parameters.h) / 2
22796
+ x: length50.parse(parameters.p) / 2,
22797
+ y: length50.parse(parameters.h) / 2
22526
22798
  },
22527
22799
  {
22528
- x: -length49.parse(parameters.w) / 2,
22529
- y: length49.parse(parameters.h) / 2
22800
+ x: -length50.parse(parameters.w) / 2,
22801
+ y: length50.parse(parameters.h) / 2
22530
22802
  },
22531
22803
  {
22532
- x: -length49.parse(parameters.w) / 2,
22533
- y: -length49.parse(parameters.h) / 2
22804
+ x: -length50.parse(parameters.w) / 2,
22805
+ y: -length50.parse(parameters.h) / 2
22534
22806
  },
22535
22807
  {
22536
- x: length49.parse(parameters.p) / 2,
22537
- y: -length49.parse(parameters.h) / 2
22808
+ x: length50.parse(parameters.p) / 2,
22809
+ y: -length50.parse(parameters.h) / 2
22538
22810
  }
22539
22811
  ],
22540
22812
  stroke_width: 0.1,
@@ -22553,6 +22825,7 @@ var sod110 = (raw_params) => {
22553
22825
  };
22554
22826
  return {
22555
22827
  circuitJson: sodWithoutParsing13(parameters).concat(
22828
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
22556
22829
  silkscreenLine,
22557
22830
  silkscreenRefText,
22558
22831
  courtyard
@@ -22580,7 +22853,8 @@ var sodWithoutParsing13 = (parameters) => {
22580
22853
  x,
22581
22854
  y,
22582
22855
  Number.parseFloat(parameters.pl),
22583
- Number.parseFloat(parameters.pw)
22856
+ Number.parseFloat(parameters.pw),
22857
+ 0.1
22584
22858
  )
22585
22859
  );
22586
22860
  }
@@ -22627,11 +22901,11 @@ var vssop_def = base_def.extend({
22627
22901
  var vssop = (raw_params) => {
22628
22902
  const parameters = vssop_def.parse(raw_params);
22629
22903
  const defaults = getDefaultValues(parameters.num_pins);
22630
- const w = length50.parse(parameters.w || defaults.w);
22631
- const h2 = length50.parse(parameters.h || defaults.h);
22632
- const p = length50.parse(parameters.p || defaults.p);
22633
- const pl = length50.parse(parameters.pl || defaults.pl);
22634
- const pw = length50.parse(parameters.pw || defaults.pw);
22904
+ const w = length51.parse(parameters.w || defaults.w);
22905
+ const h2 = length51.parse(parameters.h || defaults.h);
22906
+ const p = length51.parse(parameters.p || defaults.p);
22907
+ const pl = length51.parse(parameters.pl || defaults.pl);
22908
+ const pw = length51.parse(parameters.pw || defaults.pw);
22635
22909
  const pads = [];
22636
22910
  const half = parameters.num_pins / 2;
22637
22911
  for (let i = 0; i < parameters.num_pins; i++) {
@@ -22784,27 +23058,28 @@ var msop_def = base_def.extend({
22784
23058
  pw: z64.string().optional(),
22785
23059
  string: z64.string().optional()
22786
23060
  });
22787
- var getMsopCoords = (pinCount, pn, w, p) => {
23061
+ var getMsopCoords = (pinCount, pn, w, p, pl) => {
22788
23062
  const half = pinCount / 2;
22789
23063
  const rowIndex = (pn - 1) % half;
22790
23064
  const col = pn <= half ? -1 : 1;
22791
23065
  const row = (half - 1) / 2 - rowIndex;
23066
+ const padBodyOverlap = length52.parse("0.2mm");
22792
23067
  return {
22793
- x: col * length51.parse("2mm"),
23068
+ x: col * (w / 2 + pl / 2 - padBodyOverlap),
22794
23069
  y: row * p
22795
23070
  };
22796
23071
  };
22797
23072
  var msop = (raw_params) => {
22798
23073
  const parameters = msop_def.parse(raw_params);
22799
23074
  const defaults = getDefaultValues2(parameters.num_pins);
22800
- const w = length51.parse(parameters.w || defaults.w);
22801
- const h2 = length51.parse(parameters.h || defaults.h);
22802
- const p = length51.parse(parameters.p || defaults.p);
22803
- const pl = length51.parse(parameters.pl || defaults.pl);
22804
- const pw = length51.parse(parameters.pw || defaults.pw);
23075
+ const w = length52.parse(parameters.w || defaults.w);
23076
+ const h2 = length52.parse(parameters.h || defaults.h);
23077
+ const p = length52.parse(parameters.p || defaults.p);
23078
+ const pl = length52.parse(parameters.pl || defaults.pl);
23079
+ const pw = length52.parse(parameters.pw || defaults.pw);
22805
23080
  const pads = [];
22806
23081
  for (let i = 0; i < parameters.num_pins; i++) {
22807
- const { x, y } = getMsopCoords(parameters.num_pins, i + 1, w, p);
23082
+ const { x, y } = getMsopCoords(parameters.num_pins, i + 1, w, p, pl);
22808
23083
  pads.push(rectpad(i + 1, x, y, pl, pw));
22809
23084
  }
22810
23085
  const silkscreenBoxWidth = w;
@@ -22835,7 +23110,8 @@ var msop = (raw_params) => {
22835
23110
  parameters.num_pins,
22836
23111
  1,
22837
23112
  silkscreenBoxWidth,
22838
- p
23113
+ p,
23114
+ pl
22839
23115
  );
22840
23116
  const pin1MarkerPosition = {
22841
23117
  x: pin1Position.x - 0.8,
@@ -22909,7 +23185,7 @@ var sod323w = (raw_params) => {
22909
23185
  const parameters = sod323w_def.parse(raw_params);
22910
23186
  const silkscreenRefText = silkscreenRef(
22911
23187
  0,
22912
- length52.parse(parameters.h),
23188
+ length53.parse(parameters.h),
22913
23189
  0.3
22914
23190
  );
22915
23191
  const silkscreenLine = {
@@ -22918,20 +23194,20 @@ var sod323w = (raw_params) => {
22918
23194
  pcb_component_id: "",
22919
23195
  route: [
22920
23196
  {
22921
- x: length52.parse(parameters.pad_spacing) / 2,
22922
- y: length52.parse(parameters.h) / 2
23197
+ x: length53.parse(parameters.pad_spacing) / 2,
23198
+ y: length53.parse(parameters.h) / 2
22923
23199
  },
22924
23200
  {
22925
- x: -length52.parse(parameters.w) / 2 - 0.2,
22926
- y: length52.parse(parameters.h) / 2
23201
+ x: -length53.parse(parameters.w) / 2 - 0.2,
23202
+ y: length53.parse(parameters.h) / 2
22927
23203
  },
22928
23204
  {
22929
- x: -length52.parse(parameters.w) / 2 - 0.2,
22930
- y: -length52.parse(parameters.h) / 2
23205
+ x: -length53.parse(parameters.w) / 2 - 0.2,
23206
+ y: -length53.parse(parameters.h) / 2
22931
23207
  },
22932
23208
  {
22933
- x: length52.parse(parameters.pad_spacing) / 2,
22934
- y: -length52.parse(parameters.h) / 2
23209
+ x: length53.parse(parameters.pad_spacing) / 2,
23210
+ y: -length53.parse(parameters.h) / 2
22935
23211
  }
22936
23212
  ],
22937
23213
  stroke_width: 0.1,
@@ -22950,6 +23226,7 @@ var sod323w = (raw_params) => {
22950
23226
  };
22951
23227
  return {
22952
23228
  circuitJson: sodWithoutParsing14(parameters).concat(
23229
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
22953
23230
  silkscreenLine,
22954
23231
  silkscreenRefText,
22955
23232
  courtyard
@@ -22997,7 +23274,7 @@ var sod323fl = (raw_params) => {
22997
23274
  const parameters = sod323FL_def.parse(raw_params);
22998
23275
  const silkscreenRefText = silkscreenRef(
22999
23276
  0,
23000
- length53.parse(parameters.h),
23277
+ length54.parse(parameters.h),
23001
23278
  0.3
23002
23279
  );
23003
23280
  const silkscreenLine = {
@@ -23006,20 +23283,20 @@ var sod323fl = (raw_params) => {
23006
23283
  pcb_component_id: "",
23007
23284
  route: [
23008
23285
  {
23009
- x: length53.parse(parameters.pad_spacing) / 2,
23010
- y: length53.parse(parameters.h) / 2
23286
+ x: length54.parse(parameters.pad_spacing) / 2,
23287
+ y: length54.parse(parameters.h) / 2
23011
23288
  },
23012
23289
  {
23013
- x: -length53.parse(parameters.w) / 2 - 0.2,
23014
- y: length53.parse(parameters.h) / 2
23290
+ x: -length54.parse(parameters.w) / 2 - 0.2,
23291
+ y: length54.parse(parameters.h) / 2
23015
23292
  },
23016
23293
  {
23017
- x: -length53.parse(parameters.w) / 2 - 0.2,
23018
- y: -length53.parse(parameters.h) / 2
23294
+ x: -length54.parse(parameters.w) / 2 - 0.2,
23295
+ y: -length54.parse(parameters.h) / 2
23019
23296
  },
23020
23297
  {
23021
- x: length53.parse(parameters.pad_spacing) / 2,
23022
- y: -length53.parse(parameters.h) / 2
23298
+ x: length54.parse(parameters.pad_spacing) / 2,
23299
+ y: -length54.parse(parameters.h) / 2
23023
23300
  }
23024
23301
  ],
23025
23302
  stroke_width: 0.1,
@@ -23038,6 +23315,7 @@ var sod323fl = (raw_params) => {
23038
23315
  };
23039
23316
  return {
23040
23317
  circuitJson: sodWithoutParsing15(parameters).concat(
23318
+ ...createFabricationNoteDiodeFromCopperPads(parameters),
23041
23319
  silkscreenLine,
23042
23320
  silkscreenRefText,
23043
23321
  courtyard
@@ -23095,13 +23373,13 @@ var son = (raw_params) => {
23095
23373
  ...raw_params,
23096
23374
  num_pins: numPins
23097
23375
  });
23098
- const w = length54.parse(parameters.w);
23099
- const h2 = length54.parse(parameters.h);
23100
- const p = length54.parse(parameters.p);
23101
- const pl = length54.parse(parameters.pl);
23102
- const pw = length54.parse(parameters.pw);
23103
- const epw = length54.parse(parameters.epw);
23104
- const eph = length54.parse(parameters.eph);
23376
+ const w = length55.parse(parameters.w);
23377
+ const h2 = length55.parse(parameters.h);
23378
+ const p = length55.parse(parameters.p);
23379
+ const pl = length55.parse(parameters.pl);
23380
+ const pw = length55.parse(parameters.pw);
23381
+ const epw = length55.parse(parameters.epw);
23382
+ const eph = length55.parse(parameters.eph);
23105
23383
  const pads = [];
23106
23384
  for (let i = 0; i < parameters.num_pins; i++) {
23107
23385
  const { x, y } = getSonPadCoord(parameters.num_pins, i + 1, w, p);
@@ -23209,7 +23487,7 @@ var getSonPadCoord = (num_pins, pn, w, p) => {
23209
23487
  const col = pn <= half ? -1 : 1;
23210
23488
  const row = (half - 1) / 2 - rowIndex;
23211
23489
  return {
23212
- x: col * length54.parse("1.4mm"),
23490
+ x: col * length55.parse("1.4mm"),
23213
23491
  y: row * p
23214
23492
  };
23215
23493
  };
@@ -23217,12 +23495,12 @@ var vson_def = base_def.extend({
23217
23495
  fn: z68.string(),
23218
23496
  num_pins: z68.number().optional().default(8),
23219
23497
  p: distance3.describe("pitch (distance between center of each pin)"),
23220
- w: length55.describe("width between vertical rows of pins"),
23498
+ w: length56.describe("width between vertical rows of pins"),
23221
23499
  grid: dim2d.describe("width and height of the border of the footprint"),
23222
23500
  ep: dim2d.default("0x0mm").describe("width and height of the central exposed thermal pad"),
23223
- epx: length55.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
23224
- pinw: length55.describe("width of the pin pads"),
23225
- pinh: length55.describe("height of the pin pads")
23501
+ epx: length56.default("0mm").describe("x offset of the center of the central exposed thermal pad"),
23502
+ pinw: length56.describe("width of the pin pads"),
23503
+ pinh: length56.describe("height of the pin pads")
23226
23504
  });
23227
23505
  var vson = (raw_params) => {
23228
23506
  const parameters = vson_def.parse(raw_params);
@@ -23370,9 +23648,9 @@ var getSilkscreenPaths = (grid2) => {
23370
23648
  };
23371
23649
  var solderjumper = (params) => {
23372
23650
  const { num_pins, bridged, p = 2.54, pw = 1.5, ph = 1.5 } = params;
23373
- const padSpacing7 = length56.parse(p);
23374
- const padWidth = length56.parse(pw);
23375
- const padHeight = length56.parse(ph);
23651
+ const padSpacing7 = length57.parse(p);
23652
+ const padWidth = length57.parse(pw);
23653
+ const padHeight = length57.parse(ph);
23376
23654
  const traceWidth = Math.min(padHeight / 4, 0.5);
23377
23655
  const pads = [];
23378
23656
  for (let i = 0; i < num_pins; i++) {
@@ -23705,11 +23983,11 @@ var sot963_def = base_def.extend({
23705
23983
  });
23706
23984
  var sot963 = (raw_params) => {
23707
23985
  const parameters = sot963_def.parse({ ...raw_params, fn: "sot963" });
23708
- const w = length57.parse(parameters.w);
23709
- const h2 = length57.parse(parameters.h);
23710
- const p = length57.parse(parameters.p);
23711
- const pl = length57.parse(parameters.pl);
23712
- const pw = length57.parse(parameters.pw);
23986
+ const w = length58.parse(parameters.w);
23987
+ const h2 = length58.parse(parameters.h);
23988
+ const p = length58.parse(parameters.p);
23989
+ const pl = length58.parse(parameters.pl);
23990
+ const pw = length58.parse(parameters.pw);
23713
23991
  const pads = [];
23714
23992
  for (let i = 0; i < 6; i++) {
23715
23993
  const { x, y } = getSot963PadCoord(i + 1, w, p, pl);
@@ -23781,7 +24059,7 @@ var getSot963PadCoord = (pn, w, p, pl) => {
23781
24059
  var potentiometer_def = base_def.extend({
23782
24060
  fn: z71.string(),
23783
24061
  num_pins: z71.union([z71.literal(3), z71.literal(2)]).default(3),
23784
- p: z71.string().default("3.8mm"),
24062
+ p: z71.string().default("5mm"),
23785
24063
  id: z71.string().default("1.25mm"),
23786
24064
  od: z71.string().default("2.35mm"),
23787
24065
  ca: z71.string().default("14mm").describe(
@@ -23792,13 +24070,13 @@ var potentiometer_def = base_def.extend({
23792
24070
  string: z71.string().optional()
23793
24071
  });
23794
24072
  var potentiometer_acp = (parameters) => {
23795
- const { p, id, od, h: h2, ca } = parameters;
23796
- const y = Number.parseFloat(h2);
23797
- const caliper = Number.parseFloat(ca);
24073
+ const { p, id, od, h: h2 } = parameters;
24074
+ const x = Number.parseFloat(h2);
24075
+ const y = Number.parseFloat(p);
23798
24076
  return [
23799
- platedhole(1, 0, caliper / 4 + 0.3, id, od),
23800
- platedhole(2, y, 0, id, od),
23801
- platedhole(3, 0, -caliper / 4 - 0.3, id, od)
24077
+ platedhole(1, 0, y, id, od),
24078
+ platedhole(2, x, 0, id, od),
24079
+ platedhole(3, 0, -y, id, od)
23802
24080
  ];
23803
24081
  };
23804
24082
  var potentiometer = (raw_params) => {
@@ -23871,10 +24149,10 @@ var potentiometer = (raw_params) => {
23871
24149
  };
23872
24150
  var electrolytic_def = base_def.extend({
23873
24151
  fn: z72.string(),
23874
- p: length58.optional().default("7.5mm"),
23875
- id: length58.optional().default("1mm"),
23876
- od: length58.optional().default("2mm"),
23877
- d: length58.optional().default("10.5mm")
24152
+ p: length59.optional().default("7.5mm"),
24153
+ id: length59.optional().default("1mm"),
24154
+ od: length59.optional().default("2mm"),
24155
+ d: length59.optional().default("10.5mm")
23878
24156
  });
23879
24157
  var generate_circle_arcs = (centerX, centerY, radius, cut, cutHeight) => {
23880
24158
  const topArc = [];
@@ -23903,7 +24181,14 @@ var electrolytic = (raw_params) => {
23903
24181
  const parameters = electrolytic_def.parse(raw_params);
23904
24182
  const { p, id, od, d } = parameters;
23905
24183
  const plated_holes = [
23906
- platedhole(1, -p / 2, 0, id, od),
24184
+ platedHoleWithRectPad({
24185
+ pn: 1,
24186
+ x: -p / 2,
24187
+ y: 0,
24188
+ holeDiameter: id,
24189
+ rectPadWidth: od,
24190
+ rectPadHeight: od
24191
+ }),
23907
24192
  platedhole(2, p / 2, 0, id, od)
23908
24193
  ];
23909
24194
  const { topArc, bottomArc } = generate_circle_arcs(
@@ -24005,7 +24290,7 @@ var smbf = (raw_params) => {
24005
24290
  const parameters = smbf_def.parse(raw_params);
24006
24291
  const silkscreenRefText = silkscreenRef(
24007
24292
  0,
24008
- length59.parse(parameters.h) - 0.5,
24293
+ length60.parse(parameters.h) - 0.5,
24009
24294
  0.3
24010
24295
  );
24011
24296
  const silkscreenLine = {
@@ -24014,20 +24299,20 @@ var smbf = (raw_params) => {
24014
24299
  pcb_component_id: "",
24015
24300
  route: [
24016
24301
  {
24017
- x: length59.parse(parameters.p) / 2,
24018
- y: length59.parse(parameters.h) / 2
24302
+ x: length60.parse(parameters.p) / 2,
24303
+ y: length60.parse(parameters.h) / 2
24019
24304
  },
24020
24305
  {
24021
- x: -length59.parse(parameters.w) / 2 - 0.3,
24022
- y: length59.parse(parameters.h) / 2
24306
+ x: -length60.parse(parameters.w) / 2 - 0.3,
24307
+ y: length60.parse(parameters.h) / 2
24023
24308
  },
24024
24309
  {
24025
- x: -length59.parse(parameters.w) / 2 - 0.3,
24026
- y: -length59.parse(parameters.h) / 2
24310
+ x: -length60.parse(parameters.w) / 2 - 0.3,
24311
+ y: -length60.parse(parameters.h) / 2
24027
24312
  },
24028
24313
  {
24029
- x: length59.parse(parameters.p) / 2,
24030
- y: -length59.parse(parameters.h) / 2
24314
+ x: length60.parse(parameters.p) / 2,
24315
+ y: -length60.parse(parameters.h) / 2
24031
24316
  }
24032
24317
  ],
24033
24318
  stroke_width: 0.1,
@@ -24062,20 +24347,16 @@ var getSmbfCoords = (parameters) => {
24062
24347
  };
24063
24348
  var smbfWithoutParsing = (parameters) => {
24064
24349
  const pads = [];
24350
+ const p = length60.parse(parameters.p);
24351
+ const pl = length60.parse(parameters.pl);
24352
+ const pw = length60.parse(parameters.pw);
24353
+ const cornerRadius = 0.125;
24065
24354
  for (let i = 1; i <= parameters.num_pins; i++) {
24066
24355
  const { x, y } = getSmbfCoords({
24067
24356
  pn: i,
24068
- p: Number.parseFloat(parameters.p)
24357
+ p
24069
24358
  });
24070
- pads.push(
24071
- rectpad(
24072
- i,
24073
- x,
24074
- y,
24075
- Number.parseFloat(parameters.pl),
24076
- Number.parseFloat(parameters.pw)
24077
- )
24078
- );
24359
+ pads.push(rectpad(i, x, y, pl, pw, cornerRadius));
24079
24360
  }
24080
24361
  return pads;
24081
24362
  };
@@ -24205,20 +24486,20 @@ var smtpad_def = base_def.extend({
24205
24486
  rect: z75.boolean().optional(),
24206
24487
  square: z75.boolean().optional(),
24207
24488
  pill: z75.boolean().optional(),
24208
- d: length60.optional(),
24209
- pd: length60.optional(),
24210
- diameter: length60.optional(),
24211
- r: length60.optional(),
24212
- pr: length60.optional(),
24213
- radius: length60.optional(),
24214
- w: length60.optional(),
24215
- pw: length60.optional(),
24216
- width: length60.optional(),
24217
- h: length60.optional(),
24218
- ph: length60.optional(),
24219
- height: length60.optional(),
24220
- s: length60.optional(),
24221
- size: length60.optional(),
24489
+ d: length61.optional(),
24490
+ pd: length61.optional(),
24491
+ diameter: length61.optional(),
24492
+ r: length61.optional(),
24493
+ pr: length61.optional(),
24494
+ radius: length61.optional(),
24495
+ w: length61.optional(),
24496
+ pw: length61.optional(),
24497
+ width: length61.optional(),
24498
+ h: length61.optional(),
24499
+ ph: length61.optional(),
24500
+ height: length61.optional(),
24501
+ s: length61.optional(),
24502
+ size: length61.optional(),
24222
24503
  string: z75.string().optional()
24223
24504
  }).transform((v) => {
24224
24505
  let shape = "rect";
@@ -24285,12 +24566,12 @@ var smtpad = (raw_params) => {
24285
24566
  };
24286
24567
  var platedhole_def = base_def.extend({
24287
24568
  fn: z76.string(),
24288
- d: length61.optional(),
24289
- hd: length61.optional(),
24290
- r: length61.optional(),
24291
- hr: length61.optional(),
24292
- pd: length61.optional(),
24293
- pr: length61.optional(),
24569
+ d: length62.optional(),
24570
+ hd: length62.optional(),
24571
+ r: length62.optional(),
24572
+ hr: length62.optional(),
24573
+ pd: length62.optional(),
24574
+ pr: length62.optional(),
24294
24575
  squarepad: z76.boolean().optional().default(false)
24295
24576
  }).transform((v) => {
24296
24577
  let holeD;
@@ -24711,9 +24992,9 @@ var mountedpcbmodule_def = base_def.extend({
24711
24992
  fn: z80.string(),
24712
24993
  numPins: z80.number().optional().default(0),
24713
24994
  rows: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional().default(1).describe("number of rows"),
24714
- p: length62.default("2.54mm").describe("pitch"),
24715
- id: length62.default("1.0mm").describe("inner diameter"),
24716
- od: length62.default("1.5mm").describe("outer diameter"),
24995
+ p: length63.default("2.54mm").describe("pitch"),
24996
+ id: length63.default("1.0mm").describe("inner diameter"),
24997
+ od: length63.default("1.5mm").describe("outer diameter"),
24717
24998
  male: z80.boolean().optional().describe("the module uses male headers"),
24718
24999
  nopin: z80.boolean().optional().default(false).describe("omit pins rendering"),
24719
25000
  female: z80.boolean().optional().describe("the module uses female headers"),
@@ -24737,9 +25018,9 @@ var mountedpcbmodule_def = base_def.extend({
24737
25018
  pinrowrightpins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
24738
25019
  pinrowtoppins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
24739
25020
  pinrowbottompins: z80.union([z80.string(), z80.number()]).transform((val) => Number(val)).optional(),
24740
- width: length62.optional(),
24741
- height: length62.optional(),
24742
- pinRowHoleEdgeToEdgeDist: length62.default("2mm"),
25021
+ width: length63.optional(),
25022
+ height: length63.optional(),
25023
+ pinRowHoleEdgeToEdgeDist: length63.default("2mm"),
24743
25024
  holes: z80.union([z80.string(), z80.array(z80.string())]).optional().transform((val) => {
24744
25025
  if (!val) return val;
24745
25026
  if (Array.isArray(val)) return val;
@@ -24748,9 +25029,9 @@ var mountedpcbmodule_def = base_def.extend({
24748
25029
  }
24749
25030
  return [val];
24750
25031
  }),
24751
- holeXDist: length62.optional(),
24752
- holeYDist: length62.optional(),
24753
- holeInset: length62.default("1mm"),
25032
+ holeXDist: length63.optional(),
25033
+ holeYDist: length63.optional(),
25034
+ holeInset: length63.default("1mm"),
24754
25035
  pinrow: z80.union([z80.string(), z80.number()]).optional(),
24755
25036
  usbposition: z80.enum(["left", "right", "top", "bottom"]).optional().default("left"),
24756
25037
  usbleft: z80.boolean().optional().default(false),
@@ -24761,10 +25042,10 @@ var mountedpcbmodule_def = base_def.extend({
24761
25042
  usbmicro: z80.boolean().optional().default(false),
24762
25043
  usbc: z80.boolean().optional().default(false),
24763
25044
  screen: z80.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
24764
- screenwidth: length62.optional(),
24765
- screenheight: length62.optional(),
24766
- screencenteroffsetx: length62.optional(),
24767
- screencenteroffsety: length62.optional()
25045
+ screenwidth: length63.optional(),
25046
+ screenheight: length63.optional(),
25047
+ screencenteroffsetx: length63.optional(),
25048
+ screencenteroffsety: length63.optional()
24768
25049
  }).transform((data) => {
24769
25050
  const pinlabelAnchorSide = determinePinlabelAnchorSide(data);
24770
25051
  let pinRowSide = data.pinRowSide;
@@ -25478,7 +25759,7 @@ var footprinter = () => {
25478
25759
  } else {
25479
25760
  target[prop] = true;
25480
25761
  target.fn = prop;
25481
- if (prop === "res" || prop === "cap") {
25762
+ if (prop === "res" || prop === "cap" || prop === "led" || prop === "diode") {
25482
25763
  if (v) {
25483
25764
  if (typeof v === "string" && v.includes("_metric")) {
25484
25765
  target.metric = v.split("_metric")[0];
@@ -25638,7 +25919,7 @@ var FootprintPlatedHole = ({
25638
25919
  var ChipBody = ({
25639
25920
  center,
25640
25921
  width: width10,
25641
- length: length63,
25922
+ length: length64,
25642
25923
  height: height10,
25643
25924
  heightAboveSurface: heightAboveSurface2 = 0.15,
25644
25925
  color = "#555",
@@ -25655,24 +25936,24 @@ var ChipBody = ({
25655
25936
  }) => {
25656
25937
  const straightHeight = height10 * straightHeightRatio;
25657
25938
  const taperHeight = height10 - straightHeight;
25658
- const taperInset = Math.min(width10, length63) * taperRatio;
25939
+ const taperInset = Math.min(width10, length64) * taperRatio;
25659
25940
  const faceWidth = Math.max(width10 - taperInset, width10 * faceRatio);
25660
- const faceLength = Math.max(length63 - taperInset, length63 * faceRatio);
25661
- const defaultNotchRadius = Math.min(width10, length63) * 0.12;
25941
+ const faceLength = Math.max(length64 - taperInset, length64 * faceRatio);
25942
+ const defaultNotchRadius = Math.min(width10, length64) * 0.12;
25662
25943
  const actualNotchRadius = notchRadius ?? defaultNotchRadius;
25663
25944
  const defaultNotchPosition = {
25664
25945
  x: 0,
25665
- y: length63 / 2 - actualNotchRadius * 0.25,
25946
+ y: length64 / 2 - actualNotchRadius * 0.25,
25666
25947
  z: height10
25667
25948
  };
25668
25949
  const actualNotchPosition = notchPosition ?? defaultNotchPosition;
25669
25950
  const body = /* @__PURE__ */ jsxs(Union, { children: [
25670
25951
  /* @__PURE__ */ jsxs(Hull, { children: [
25671
25952
  /* @__PURE__ */ jsx2(Translate, { z: 5e-3, children: /* @__PURE__ */ jsx2(Cuboid, { size: [faceWidth, faceLength, 0.01] }) }),
25672
- /* @__PURE__ */ jsx2(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [width10, length63, 0.01] }) })
25953
+ /* @__PURE__ */ jsx2(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [width10, length64, 0.01] }) })
25673
25954
  ] }),
25674
25955
  /* @__PURE__ */ jsxs(Hull, { children: [
25675
- /* @__PURE__ */ jsx2(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [width10, length63, 0.01] }) }),
25956
+ /* @__PURE__ */ jsx2(Translate, { z: straightHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [width10, length64, 0.01] }) }),
25676
25957
  /* @__PURE__ */ jsx2(Translate, { z: straightHeight + taperHeight, children: /* @__PURE__ */ jsx2(Cuboid, { size: [faceWidth, faceLength, 0.01] }) })
25677
25958
  ] })
25678
25959
  ] });
@@ -25689,7 +25970,7 @@ var ChipBody = ({
25689
25970
  let finalBody = body;
25690
25971
  if (chamferSize > 0) {
25691
25972
  const xOffset = width10 / 2;
25692
- const yOffset = length63 / 2;
25973
+ const yOffset = length64 / 2;
25693
25974
  finalBody = /* @__PURE__ */ jsxs(Subtract, { children: [
25694
25975
  body,
25695
25976
  chamferCutout(xOffset, yOffset),
@@ -25715,8 +25996,8 @@ function getExpandedStroke(strokeInput, width10) {
25715
25996
  function getNormal(p1, p2) {
25716
25997
  const dx = p2.x - p1.x;
25717
25998
  const dy = p2.y - p1.y;
25718
- const length63 = Math.sqrt(dx * dx + dy * dy);
25719
- return { x: -dy / length63, y: dx / length63 };
25999
+ const length64 = Math.sqrt(dx * dx + dy * dy);
26000
+ return { x: -dy / length64, y: dx / length64 };
25720
26001
  }
25721
26002
  function addPoint(point, normal, factor) {
25722
26003
  const newPoint = {
@@ -27048,11 +27329,11 @@ var FemaleHeaderRow = ({
27048
27329
  };
27049
27330
  var PushButton = ({
27050
27331
  width: width10,
27051
- length: length63,
27332
+ length: length64,
27052
27333
  innerDiameter = 1
27053
27334
  }) => {
27054
27335
  const bodyWidth = width10;
27055
- const bodyLength10 = length63;
27336
+ const bodyLength10 = length64;
27056
27337
  const bodyHeight = width10 * 0.7;
27057
27338
  const legWidth = innerDiameter / 2.5;
27058
27339
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
@@ -32429,7 +32710,7 @@ import * as THREE21 from "three";
32429
32710
  // package.json
32430
32711
  var package_default = {
32431
32712
  name: "@tscircuit/3d-viewer",
32432
- version: "0.0.574",
32713
+ version: "0.0.576",
32433
32714
  main: "./dist/index.js",
32434
32715
  module: "./dist/index.js",
32435
32716
  type: "module",
@@ -32458,7 +32739,7 @@ var package_default = {
32458
32739
  dependencies: {
32459
32740
  "@jscad/regl-renderer": "^2.6.12",
32460
32741
  "@jscad/stl-serializer": "^2.1.20",
32461
- "circuit-json": "^0.0.421",
32742
+ "circuit-json": "^0.0.446",
32462
32743
  "circuit-to-canvas": "^0.0.111",
32463
32744
  "react-hot-toast": "^2.6.0",
32464
32745
  three: "^0.165.0",
@@ -32497,7 +32778,7 @@ var package_default = {
32497
32778
  "react-use-gesture": "^9.1.3",
32498
32779
  semver: "^7.7.0",
32499
32780
  "strip-ansi": "^7.1.0",
32500
- tscircuit: "^0.0.1704",
32781
+ tscircuit: "^0.0.2009",
32501
32782
  tsup: "^8.3.6",
32502
32783
  typescript: "^5.7.3",
32503
32784
  vite: "^7.1.5",
@@ -34134,8 +34415,8 @@ var platedHole = (plated_hole, ctx, options = {}) => {
34134
34415
  const copperHeight = copperFillHeight;
34135
34416
  const createPillSection = (width10, height10, thickness) => {
34136
34417
  const radius = height10 / 2;
34137
- const length63 = Math.abs(width10 - height10);
34138
- if (length63 <= 1e-6) {
34418
+ const length64 = Math.abs(width10 - height10);
34419
+ if (length64 <= 1e-6) {
34139
34420
  return (0, import_primitives4.cylinder)({
34140
34421
  center: [plated_hole.x, plated_hole.y, 0],
34141
34422
  radius,
@@ -34144,15 +34425,15 @@ var platedHole = (plated_hole, ctx, options = {}) => {
34144
34425
  }
34145
34426
  const rect = (0, import_primitives4.cuboid)({
34146
34427
  center: [plated_hole.x, plated_hole.y, 0],
34147
- size: shouldRotate ? [height10, length63, thickness] : [length63, height10, thickness]
34428
+ size: shouldRotate ? [height10, length64, thickness] : [length64, height10, thickness]
34148
34429
  });
34149
34430
  const leftCap = (0, import_primitives4.cylinder)({
34150
- center: shouldRotate ? [plated_hole.x, plated_hole.y - length63 / 2, 0] : [plated_hole.x - length63 / 2, plated_hole.y, 0],
34431
+ center: shouldRotate ? [plated_hole.x, plated_hole.y - length64 / 2, 0] : [plated_hole.x - length64 / 2, plated_hole.y, 0],
34151
34432
  radius,
34152
34433
  height: thickness
34153
34434
  });
34154
34435
  const rightCap = (0, import_primitives4.cylinder)({
34155
- center: shouldRotate ? [plated_hole.x, plated_hole.y + length63 / 2, 0] : [plated_hole.x + length63 / 2, plated_hole.y, 0],
34436
+ center: shouldRotate ? [plated_hole.x, plated_hole.y + length64 / 2, 0] : [plated_hole.x + length64 / 2, plated_hole.y, 0],
34156
34437
  radius,
34157
34438
  height: thickness
34158
34439
  });
@@ -34981,18 +35262,18 @@ var BoardGeomBuilder = class {
34981
35262
  );
34982
35263
  }
34983
35264
  const radius = Math.min(w, h2) / 2;
34984
- const length63 = Math.abs(w - h2);
35265
+ const length64 = Math.abs(w - h2);
34985
35266
  if (w > h2) {
34986
35267
  return (0, import_booleans4.union)(
34987
- (0, import_primitives6.cuboid)({ center: [0, 0, 0], size: [length63, h2, depth] }),
34988
- (0, import_primitives6.cylinder)({ center: [-length63 / 2, 0, 0], radius, height: depth }),
34989
- (0, import_primitives6.cylinder)({ center: [length63 / 2, 0, 0], radius, height: depth })
35268
+ (0, import_primitives6.cuboid)({ center: [0, 0, 0], size: [length64, h2, depth] }),
35269
+ (0, import_primitives6.cylinder)({ center: [-length64 / 2, 0, 0], radius, height: depth }),
35270
+ (0, import_primitives6.cylinder)({ center: [length64 / 2, 0, 0], radius, height: depth })
34990
35271
  );
34991
35272
  }
34992
35273
  return (0, import_booleans4.union)(
34993
- (0, import_primitives6.cuboid)({ center: [0, 0, 0], size: [w, length63, depth] }),
34994
- (0, import_primitives6.cylinder)({ center: [0, -length63 / 2, 0], radius, height: depth }),
34995
- (0, import_primitives6.cylinder)({ center: [0, length63 / 2, 0], radius, height: depth })
35274
+ (0, import_primitives6.cuboid)({ center: [0, 0, 0], size: [w, length64, depth] }),
35275
+ (0, import_primitives6.cylinder)({ center: [0, -length64 / 2, 0], radius, height: depth }),
35276
+ (0, import_primitives6.cylinder)({ center: [0, length64 / 2, 0], radius, height: depth })
34996
35277
  );
34997
35278
  };
34998
35279
  let boardHole = createHoleGeom(
@@ -39092,7 +39373,6 @@ var BoardMeshes = ({
39092
39373
  const texture = typedMaterial[prop];
39093
39374
  if (texture && texture instanceof THREE45.Texture) {
39094
39375
  texture.dispose();
39095
- typedMaterial[prop] = null;
39096
39376
  }
39097
39377
  }
39098
39378
  material.dispose();
@@ -39736,7 +40016,7 @@ var ToastProvider = ({
39736
40016
  };
39737
40017
 
39738
40018
  // src/components/ContextMenu.tsx
39739
- import { useState as useState36 } from "react";
40019
+ import { useState as useState37 } from "react";
39740
40020
 
39741
40021
  // node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs
39742
40022
  import * as React44 from "react";
@@ -39746,7 +40026,7 @@ var canUseDOM = !!(typeof window !== "undefined" && window.document && window.do
39746
40026
  function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
39747
40027
  return function handleEvent(event) {
39748
40028
  originalEventHandler?.(event);
39749
- if (checkForDefaultPrevented === false || !event.defaultPrevented) {
40029
+ if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {
39750
40030
  return ourEventHandler?.(event);
39751
40031
  }
39752
40032
  };
@@ -39806,11 +40086,13 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
39806
40086
  return /* @__PURE__ */ jsx21(Context.Provider, { value, children });
39807
40087
  };
39808
40088
  Provider.displayName = rootComponentName + "Provider";
39809
- function useContext22(consumerName, scope) {
40089
+ function useContext22(consumerName, scope, options = {}) {
40090
+ const { optional = false } = options;
39810
40091
  const Context = scope?.[scopeName]?.[index2] || BaseContext;
39811
40092
  const context = React14.useContext(Context);
39812
40093
  if (context) return context;
39813
40094
  if (defaultContext !== void 0) return defaultContext;
40095
+ if (optional) return void 0;
39814
40096
  throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
39815
40097
  }
39816
40098
  return [Provider, useContext22];
@@ -39852,7 +40134,7 @@ function composeContextScopes(...scopes) {
39852
40134
  }
39853
40135
 
39854
40136
  // node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
39855
- import * as React17 from "react";
40137
+ import * as React16 from "react";
39856
40138
 
39857
40139
  // node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
39858
40140
  import * as React15 from "react";
@@ -39861,32 +40143,7 @@ var useLayoutEffect2 = globalThis?.document ? React15.useLayoutEffect : () => {
39861
40143
 
39862
40144
  // node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
39863
40145
  import * as React22 from "react";
39864
-
39865
- // node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
39866
- import * as React16 from "react";
39867
- var useReactEffectEvent = React16[" useEffectEvent ".trim().toString()];
39868
- var useReactInsertionEffect = React16[" useInsertionEffect ".trim().toString()];
39869
- function useEffectEvent(callback) {
39870
- if (typeof useReactEffectEvent === "function") {
39871
- return useReactEffectEvent(callback);
39872
- }
39873
- const ref = React16.useRef(() => {
39874
- throw new Error("Cannot call an event handler while rendering.");
39875
- });
39876
- if (typeof useReactInsertionEffect === "function") {
39877
- useReactInsertionEffect(() => {
39878
- ref.current = callback;
39879
- });
39880
- } else {
39881
- useLayoutEffect2(() => {
39882
- ref.current = callback;
39883
- });
39884
- }
39885
- return React16.useMemo(() => ((...args) => ref.current?.(...args)), []);
39886
- }
39887
-
39888
- // node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
39889
- var useInsertionEffect = React17[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
40146
+ var useInsertionEffect = React16[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
39890
40147
  function useControllableState({
39891
40148
  prop,
39892
40149
  defaultProp,
@@ -39901,8 +40158,8 @@ function useControllableState({
39901
40158
  const isControlled = prop !== void 0;
39902
40159
  const value = isControlled ? prop : uncontrolledProp;
39903
40160
  if (true) {
39904
- const isControlledRef = React17.useRef(prop !== void 0);
39905
- React17.useEffect(() => {
40161
+ const isControlledRef = React16.useRef(prop !== void 0);
40162
+ React16.useEffect(() => {
39906
40163
  const wasControlled = isControlledRef.current;
39907
40164
  if (wasControlled !== isControlled) {
39908
40165
  const from = wasControlled ? "controlled" : "uncontrolled";
@@ -39914,7 +40171,7 @@ function useControllableState({
39914
40171
  isControlledRef.current = isControlled;
39915
40172
  }, [isControlled, caller]);
39916
40173
  }
39917
- const setValue = React17.useCallback(
40174
+ const setValue = React16.useCallback(
39918
40175
  (nextValue) => {
39919
40176
  if (isControlled) {
39920
40177
  const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
@@ -39933,13 +40190,13 @@ function useUncontrolledState({
39933
40190
  defaultProp,
39934
40191
  onChange
39935
40192
  }) {
39936
- const [value, setValue] = React17.useState(defaultProp);
39937
- const prevValueRef = React17.useRef(value);
39938
- const onChangeRef = React17.useRef(onChange);
40193
+ const [value, setValue] = React16.useState(defaultProp);
40194
+ const prevValueRef = React16.useRef(value);
40195
+ const onChangeRef = React16.useRef(onChange);
39939
40196
  useInsertionEffect(() => {
39940
40197
  onChangeRef.current = onChange;
39941
40198
  }, [onChange]);
39942
- React17.useEffect(() => {
40199
+ React16.useEffect(() => {
39943
40200
  if (prevValueRef.current !== value) {
39944
40201
  onChangeRef.current?.(value);
39945
40202
  prevValueRef.current = value;
@@ -39952,14 +40209,14 @@ function isFunction(value) {
39952
40209
  }
39953
40210
 
39954
40211
  // node_modules/@radix-ui/react-primitive/dist/index.mjs
39955
- import * as React19 from "react";
40212
+ import * as React18 from "react";
39956
40213
  import * as ReactDOM2 from "react-dom";
39957
40214
 
39958
40215
  // node_modules/@radix-ui/react-slot/dist/index.mjs
39959
- import * as React18 from "react";
40216
+ import * as React17 from "react";
39960
40217
  // @__NO_SIDE_EFFECTS__
39961
40218
  function createSlot(ownerName) {
39962
- const Slot2 = React18.forwardRef((props, forwardedRef) => {
40219
+ const Slot2 = React17.forwardRef((props, forwardedRef) => {
39963
40220
  let { children, ...slotProps } = props;
39964
40221
  let slottableElement = null;
39965
40222
  let hasSlottable = false;
@@ -39967,7 +40224,7 @@ function createSlot(ownerName) {
39967
40224
  if (isLazyComponent(children) && typeof use === "function") {
39968
40225
  children = use(children._payload);
39969
40226
  }
39970
- React18.Children.forEach(children, (maybeSlottable) => {
40227
+ React17.Children.forEach(children, (maybeSlottable) => {
39971
40228
  if (isSlottable(maybeSlottable)) {
39972
40229
  hasSlottable = true;
39973
40230
  const slottable = maybeSlottable;
@@ -39982,13 +40239,13 @@ function createSlot(ownerName) {
39982
40239
  }
39983
40240
  });
39984
40241
  if (slottableElement) {
39985
- slottableElement = React18.cloneElement(slottableElement, void 0, newChildren);
40242
+ slottableElement = React17.cloneElement(slottableElement, void 0, newChildren);
39986
40243
  } else if (
39987
40244
  // A `Slottable` was found but it didn't resolve to a single element (e.g.
39988
40245
  // it wrapped multiple elements, text, or a render-prop `child` that
39989
40246
  // wasn't an element). Don't fall back to treating the `Slottable` wrapper
39990
40247
  // itself as the slot target — throw a descriptive error below instead.
39991
- !hasSlottable && React18.Children.count(children) === 1 && React18.isValidElement(children)
40248
+ !hasSlottable && React17.Children.count(children) === 1 && React17.isValidElement(children)
39992
40249
  ) {
39993
40250
  slottableElement = children;
39994
40251
  }
@@ -40003,10 +40260,10 @@ function createSlot(ownerName) {
40003
40260
  return children;
40004
40261
  }
40005
40262
  const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
40006
- if (slottableElement.type !== React18.Fragment) {
40263
+ if (slottableElement.type !== React17.Fragment) {
40007
40264
  mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;
40008
40265
  }
40009
- return React18.cloneElement(slottableElement, mergedProps);
40266
+ return React17.cloneElement(slottableElement, mergedProps);
40010
40267
  });
40011
40268
  Slot2.displayName = `${ownerName}.Slot`;
40012
40269
  return Slot2;
@@ -40015,10 +40272,10 @@ var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol.for("radix.slottable");
40015
40272
  var getSlottableElementFromSlottable = (slottable, child) => {
40016
40273
  if ("child" in slottable.props) {
40017
40274
  const child2 = slottable.props.child;
40018
- if (!React18.isValidElement(child2)) return null;
40019
- return React18.cloneElement(child2, void 0, slottable.props.children(child2.props.children));
40275
+ if (!React17.isValidElement(child2)) return null;
40276
+ return React17.cloneElement(child2, void 0, slottable.props.children(child2.props.children));
40020
40277
  }
40021
- return React18.isValidElement(child) ? child : null;
40278
+ return React17.isValidElement(child) ? child : null;
40022
40279
  };
40023
40280
  function mergeProps(slotProps, childProps) {
40024
40281
  const overrideProps = { ...childProps };
@@ -40058,7 +40315,7 @@ function getElementRef(element) {
40058
40315
  return element.props.ref || element.ref;
40059
40316
  }
40060
40317
  function isSlottable(child) {
40061
- return React18.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
40318
+ return React17.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
40062
40319
  }
40063
40320
  var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
40064
40321
  function isLazyComponent(element) {
@@ -40073,7 +40330,7 @@ var createSlotError = (ownerName) => {
40073
40330
  var createSlottableError = (ownerName) => {
40074
40331
  return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
40075
40332
  };
40076
- var use = React18[" use ".trim().toString()];
40333
+ var use = React17[" use ".trim().toString()];
40077
40334
 
40078
40335
  // node_modules/@radix-ui/react-primitive/dist/index.mjs
40079
40336
  import { jsx as jsx22 } from "react/jsx-runtime";
@@ -40098,7 +40355,7 @@ var NODES = [
40098
40355
  ];
40099
40356
  var Primitive = NODES.reduce((primitive, node) => {
40100
40357
  const Slot2 = createSlot(`Primitive.${node}`);
40101
- const Node2 = React19.forwardRef((props, forwardedRef) => {
40358
+ const Node2 = React18.forwardRef((props, forwardedRef) => {
40102
40359
  const { asChild, ...primitiveProps } = props;
40103
40360
  const Comp = asChild ? Slot2 : node;
40104
40361
  if (typeof window !== "undefined") {
@@ -40117,7 +40374,7 @@ function dispatchDiscreteCustomEvent(target, event) {
40117
40374
  import * as React43 from "react";
40118
40375
 
40119
40376
  // node_modules/@radix-ui/react-collection/dist/index.mjs
40120
- import * as React20 from "react";
40377
+ import * as React19 from "react";
40121
40378
  import { jsx as jsx23 } from "react/jsx-runtime";
40122
40379
  import * as React23 from "react";
40123
40380
  import { jsx as jsx24 } from "react/jsx-runtime";
@@ -40130,14 +40387,14 @@ function createCollection(name) {
40130
40387
  );
40131
40388
  const CollectionProvider = (props) => {
40132
40389
  const { scope, children } = props;
40133
- const ref = React20.useRef(null);
40134
- const itemMap = React20.useRef(/* @__PURE__ */ new Map()).current;
40390
+ const ref = React19.useRef(null);
40391
+ const itemMap = React19.useRef(/* @__PURE__ */ new Map()).current;
40135
40392
  return /* @__PURE__ */ jsx23(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
40136
40393
  };
40137
40394
  CollectionProvider.displayName = PROVIDER_NAME;
40138
40395
  const COLLECTION_SLOT_NAME = name + "CollectionSlot";
40139
40396
  const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
40140
- const CollectionSlot = React20.forwardRef(
40397
+ const CollectionSlot = React19.forwardRef(
40141
40398
  (props, forwardedRef) => {
40142
40399
  const { scope, children } = props;
40143
40400
  const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
@@ -40149,13 +40406,13 @@ function createCollection(name) {
40149
40406
  const ITEM_SLOT_NAME = name + "CollectionItemSlot";
40150
40407
  const ITEM_DATA_ATTR = "data-radix-collection-item";
40151
40408
  const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
40152
- const CollectionItemSlot = React20.forwardRef(
40409
+ const CollectionItemSlot = React19.forwardRef(
40153
40410
  (props, forwardedRef) => {
40154
40411
  const { scope, children, ...itemData } = props;
40155
- const ref = React20.useRef(null);
40412
+ const ref = React19.useRef(null);
40156
40413
  const composedRefs = useComposedRefs(forwardedRef, ref);
40157
40414
  const context = useCollectionContext(ITEM_SLOT_NAME, scope);
40158
- React20.useEffect(() => {
40415
+ React19.useEffect(() => {
40159
40416
  context.itemMap.set(ref, { ref, ...itemData });
40160
40417
  return () => void context.itemMap.delete(ref);
40161
40418
  });
@@ -40165,7 +40422,7 @@ function createCollection(name) {
40165
40422
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
40166
40423
  function useCollection3(scope) {
40167
40424
  const context = useCollectionContext(name + "CollectionConsumer", scope);
40168
- const getItems = React20.useCallback(() => {
40425
+ const getItems = React19.useCallback(() => {
40169
40426
  const collectionNode = context.collectionRef.current;
40170
40427
  if (!collectionNode) return [];
40171
40428
  const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
@@ -40185,25 +40442,25 @@ function createCollection(name) {
40185
40442
  }
40186
40443
 
40187
40444
  // node_modules/@radix-ui/react-direction/dist/index.mjs
40188
- import * as React21 from "react";
40445
+ import * as React20 from "react";
40189
40446
  import { jsx as jsx25 } from "react/jsx-runtime";
40190
- var DirectionContext = React21.createContext(void 0);
40447
+ var DirectionContext = React20.createContext(void 0);
40191
40448
  function useDirection(localDir) {
40192
- const globalDir = React21.useContext(DirectionContext);
40449
+ const globalDir = React20.useContext(DirectionContext);
40193
40450
  return localDir || globalDir || "ltr";
40194
40451
  }
40195
40452
 
40196
40453
  // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
40197
- import * as React25 from "react";
40454
+ import * as React24 from "react";
40198
40455
 
40199
40456
  // node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
40200
- import * as React24 from "react";
40457
+ import * as React21 from "react";
40201
40458
  function useCallbackRef(callback) {
40202
- const callbackRef = React24.useRef(callback);
40203
- React24.useEffect(() => {
40459
+ const callbackRef = React21.useRef(callback);
40460
+ React21.useEffect(() => {
40204
40461
  callbackRef.current = callback;
40205
40462
  });
40206
- return React24.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
40463
+ return React21.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
40207
40464
  }
40208
40465
 
40209
40466
  // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
@@ -40213,7 +40470,7 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
40213
40470
  var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
40214
40471
  var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
40215
40472
  var originalBodyPointerEvents;
40216
- var DismissableLayerContext = React25.createContext({
40473
+ var DismissableLayerContext = React24.createContext({
40217
40474
  layers: /* @__PURE__ */ new Set(),
40218
40475
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
40219
40476
  branches: /* @__PURE__ */ new Set(),
@@ -40224,7 +40481,7 @@ var DismissableLayerContext = React25.createContext({
40224
40481
  // See https://github.com/radix-ui/primitives/issues/3346
40225
40482
  dismissableSurfaces: /* @__PURE__ */ new Set()
40226
40483
  });
40227
- var DismissableLayer = React25.forwardRef(
40484
+ var DismissableLayer = React24.forwardRef(
40228
40485
  (props, forwardedRef) => {
40229
40486
  const {
40230
40487
  disableOutsidePointerEvents = false,
@@ -40236,28 +40493,22 @@ var DismissableLayer = React25.forwardRef(
40236
40493
  onDismiss,
40237
40494
  ...layerProps
40238
40495
  } = props;
40239
- const context = React25.useContext(DismissableLayerContext);
40240
- const [node, setNode] = React25.useState(null);
40496
+ const context = React24.useContext(DismissableLayerContext);
40497
+ const [node, setNode] = React24.useState(null);
40241
40498
  const ownerDocument = node?.ownerDocument ?? globalThis?.document;
40242
- const [, force] = React25.useState({});
40499
+ const [, force] = React24.useState({});
40243
40500
  const composedRefs = useComposedRefs(forwardedRef, setNode);
40244
40501
  const layers = Array.from(context.layers);
40245
- const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
40246
- const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
40502
+ const [highestLayerWithOutsidePointerEventsDisabled] = [
40503
+ ...context.layersWithOutsidePointerEventsDisabled
40504
+ ].slice(-1);
40505
+ const highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1;
40247
40506
  const index2 = node ? layers.indexOf(node) : -1;
40248
40507
  const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
40249
40508
  const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
40250
- const isDeferredPointerDownOutsideRef = React25.useRef(false);
40509
+ const isDeferredPointerDownOutsideRef = React24.useRef(false);
40251
40510
  const pointerDownOutside = usePointerDownOutside(
40252
40511
  (event) => {
40253
- const target = event.target;
40254
- if (!(target instanceof Node)) {
40255
- return;
40256
- }
40257
- const isPointerDownOnBranch = [...context.branches].some(
40258
- (branch) => branch.contains(target)
40259
- );
40260
- if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
40261
40512
  onPointerDownOutside?.(event);
40262
40513
  onInteractOutside?.(event);
40263
40514
  if (!event.defaultPrevented) onDismiss?.();
@@ -40266,7 +40517,19 @@ var DismissableLayer = React25.forwardRef(
40266
40517
  ownerDocument,
40267
40518
  deferPointerDownOutside,
40268
40519
  isDeferredPointerDownOutsideRef,
40269
- dismissableSurfaces: context.dismissableSurfaces
40520
+ dismissableSurfaces: context.dismissableSurfaces,
40521
+ shouldHandlePointerDownOutside: React24.useCallback(
40522
+ (target) => {
40523
+ if (!(target instanceof Node)) {
40524
+ return false;
40525
+ }
40526
+ const isPointerDownOnBranch = [...context.branches].some(
40527
+ (branch) => branch.contains(target)
40528
+ );
40529
+ return isPointerEventsEnabled && !isPointerDownOnBranch;
40530
+ },
40531
+ [context.branches, isPointerEventsEnabled]
40532
+ )
40270
40533
  }
40271
40534
  );
40272
40535
  const focusOutside = useFocusOutside((event) => {
@@ -40281,7 +40544,7 @@ var DismissableLayer = React25.forwardRef(
40281
40544
  if (!event.defaultPrevented) onDismiss?.();
40282
40545
  }, ownerDocument);
40283
40546
  const isHighestLayer = node ? index2 === layers.length - 1 : false;
40284
- const handleKeyDown = useEffectEvent((event) => {
40547
+ const handleKeyDown = useCallbackRef((event) => {
40285
40548
  if (event.key !== "Escape") {
40286
40549
  return;
40287
40550
  }
@@ -40291,14 +40554,14 @@ var DismissableLayer = React25.forwardRef(
40291
40554
  onDismiss();
40292
40555
  }
40293
40556
  });
40294
- React25.useEffect(() => {
40557
+ React24.useEffect(() => {
40295
40558
  if (!isHighestLayer) {
40296
40559
  return;
40297
40560
  }
40298
40561
  ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
40299
40562
  return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
40300
- }, [ownerDocument, isHighestLayer]);
40301
- React25.useEffect(() => {
40563
+ }, [ownerDocument, isHighestLayer, handleKeyDown]);
40564
+ React24.useEffect(() => {
40302
40565
  if (!node) return;
40303
40566
  if (disableOutsidePointerEvents) {
40304
40567
  if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
@@ -40318,7 +40581,7 @@ var DismissableLayer = React25.forwardRef(
40318
40581
  }
40319
40582
  };
40320
40583
  }, [node, ownerDocument, disableOutsidePointerEvents, context]);
40321
- React25.useEffect(() => {
40584
+ React24.useEffect(() => {
40322
40585
  return () => {
40323
40586
  if (!node) return;
40324
40587
  context.layers.delete(node);
@@ -40326,7 +40589,7 @@ var DismissableLayer = React25.forwardRef(
40326
40589
  dispatchUpdate();
40327
40590
  };
40328
40591
  }, [node, context]);
40329
- React25.useEffect(() => {
40592
+ React24.useEffect(() => {
40330
40593
  const handleUpdate = () => force({});
40331
40594
  document.addEventListener(CONTEXT_UPDATE, handleUpdate);
40332
40595
  return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
@@ -40352,11 +40615,11 @@ var DismissableLayer = React25.forwardRef(
40352
40615
  );
40353
40616
  DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
40354
40617
  var BRANCH_NAME = "DismissableLayerBranch";
40355
- var DismissableLayerBranch = React25.forwardRef((props, forwardedRef) => {
40356
- const context = React25.useContext(DismissableLayerContext);
40357
- const ref = React25.useRef(null);
40618
+ var DismissableLayerBranch = React24.forwardRef((props, forwardedRef) => {
40619
+ const context = React24.useContext(DismissableLayerContext);
40620
+ const ref = React24.useRef(null);
40358
40621
  const composedRefs = useComposedRefs(forwardedRef, ref);
40359
- React25.useEffect(() => {
40622
+ React24.useEffect(() => {
40360
40623
  const node = ref.current;
40361
40624
  if (node) {
40362
40625
  context.branches.add(node);
@@ -40368,20 +40631,22 @@ var DismissableLayerBranch = React25.forwardRef((props, forwardedRef) => {
40368
40631
  return /* @__PURE__ */ jsx26(Primitive.div, { ...props, ref: composedRefs });
40369
40632
  });
40370
40633
  DismissableLayerBranch.displayName = BRANCH_NAME;
40634
+ var IS_TRUE = () => true;
40371
40635
  function usePointerDownOutside(onPointerDownOutside, args) {
40372
40636
  const {
40373
40637
  ownerDocument = globalThis?.document,
40374
40638
  deferPointerDownOutside = false,
40375
40639
  isDeferredPointerDownOutsideRef,
40376
- dismissableSurfaces
40640
+ dismissableSurfaces,
40641
+ shouldHandlePointerDownOutside = IS_TRUE
40377
40642
  } = args;
40378
40643
  const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
40379
- const isPointerInsideReactTreeRef = React25.useRef(false);
40380
- const isPointerDownOutsideRef = React25.useRef(false);
40381
- const interceptedOutsideInteractionEventsRef = React25.useRef(/* @__PURE__ */ new Map());
40382
- const handleClickRef = React25.useRef(() => {
40644
+ const isPointerInsideReactTreeRef = React24.useRef(false);
40645
+ const isPointerDownOutsideRef = React24.useRef(false);
40646
+ const interceptedOutsideInteractionEventsRef = React24.useRef(/* @__PURE__ */ new Map());
40647
+ const handleClickRef = React24.useRef(() => {
40383
40648
  });
40384
- React25.useEffect(() => {
40649
+ React24.useEffect(() => {
40385
40650
  function resetOutsideInteraction() {
40386
40651
  isPointerDownOutsideRef.current = false;
40387
40652
  isDeferredPointerDownOutsideRef.current = false;
@@ -40428,6 +40693,12 @@ function usePointerDownOutside(onPointerDownOutside, args) {
40428
40693
  }
40429
40694
  };
40430
40695
  var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
40696
+ if (!shouldHandlePointerDownOutside(event.target)) {
40697
+ ownerDocument.removeEventListener("click", handleClickRef.current);
40698
+ resetOutsideInteraction();
40699
+ isPointerInsideReactTreeRef.current = false;
40700
+ return;
40701
+ }
40431
40702
  const eventDetail = { originalEvent: event };
40432
40703
  isPointerDownOutsideRef.current = true;
40433
40704
  isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;
@@ -40474,7 +40745,8 @@ function usePointerDownOutside(onPointerDownOutside, args) {
40474
40745
  handlePointerDownOutside,
40475
40746
  deferPointerDownOutside,
40476
40747
  isDeferredPointerDownOutsideRef,
40477
- dismissableSurfaces
40748
+ dismissableSurfaces,
40749
+ shouldHandlePointerDownOutside
40478
40750
  ]);
40479
40751
  return {
40480
40752
  // ensures we check React component tree (not just DOM tree)
@@ -40483,8 +40755,8 @@ function usePointerDownOutside(onPointerDownOutside, args) {
40483
40755
  }
40484
40756
  function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
40485
40757
  const handleFocusOutside = useCallbackRef(onFocusOutside);
40486
- const isFocusInsideReactTreeRef = React25.useRef(false);
40487
- React25.useEffect(() => {
40758
+ const isFocusInsideReactTreeRef = React24.useRef(false);
40759
+ React24.useEffect(() => {
40488
40760
  const handleFocus = (event) => {
40489
40761
  if (event.target && !isFocusInsideReactTreeRef.current) {
40490
40762
  const eventDetail = { originalEvent: event };
@@ -40517,11 +40789,11 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
40517
40789
  }
40518
40790
 
40519
40791
  // node_modules/@radix-ui/react-focus-guards/dist/index.mjs
40520
- import * as React26 from "react";
40792
+ import * as React25 from "react";
40521
40793
  var count = 0;
40522
40794
  var guards = null;
40523
40795
  function useFocusGuards() {
40524
- React26.useEffect(() => {
40796
+ React25.useEffect(() => {
40525
40797
  if (!guards) {
40526
40798
  guards = { start: createFocusGuard(), end: createFocusGuard() };
40527
40799
  }
@@ -40555,13 +40827,13 @@ function createFocusGuard() {
40555
40827
  }
40556
40828
 
40557
40829
  // node_modules/@radix-ui/react-focus-scope/dist/index.mjs
40558
- import * as React27 from "react";
40830
+ import * as React26 from "react";
40559
40831
  import { jsx as jsx27 } from "react/jsx-runtime";
40560
40832
  var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
40561
40833
  var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
40562
40834
  var EVENT_OPTIONS = { bubbles: false, cancelable: true };
40563
40835
  var FOCUS_SCOPE_NAME = "FocusScope";
40564
- var FocusScope = React27.forwardRef((props, forwardedRef) => {
40836
+ var FocusScope = React26.forwardRef((props, forwardedRef) => {
40565
40837
  const {
40566
40838
  loop = false,
40567
40839
  trapped = false,
@@ -40569,12 +40841,12 @@ var FocusScope = React27.forwardRef((props, forwardedRef) => {
40569
40841
  onUnmountAutoFocus: onUnmountAutoFocusProp,
40570
40842
  ...scopeProps
40571
40843
  } = props;
40572
- const [container, setContainer] = React27.useState(null);
40844
+ const [container, setContainer] = React26.useState(null);
40573
40845
  const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
40574
40846
  const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
40575
- const lastFocusedElementRef = React27.useRef(null);
40847
+ const lastFocusedElementRef = React26.useRef(null);
40576
40848
  const composedRefs = useComposedRefs(forwardedRef, setContainer);
40577
- const focusScope = React27.useRef({
40849
+ const focusScope = React26.useRef({
40578
40850
  paused: false,
40579
40851
  pause() {
40580
40852
  this.paused = true;
@@ -40583,7 +40855,7 @@ var FocusScope = React27.forwardRef((props, forwardedRef) => {
40583
40855
  this.paused = false;
40584
40856
  }
40585
40857
  }).current;
40586
- React27.useEffect(() => {
40858
+ React26.useEffect(() => {
40587
40859
  if (trapped) {
40588
40860
  let handleFocusIn2 = function(event) {
40589
40861
  if (focusScope.paused || !container) return;
@@ -40619,7 +40891,7 @@ var FocusScope = React27.forwardRef((props, forwardedRef) => {
40619
40891
  };
40620
40892
  }
40621
40893
  }, [trapped, container, focusScope.paused]);
40622
- React27.useEffect(() => {
40894
+ React26.useEffect(() => {
40623
40895
  if (container) {
40624
40896
  focusScopesStack.add(focusScope);
40625
40897
  const previouslyFocusedElement = document.activeElement;
@@ -40650,7 +40922,7 @@ var FocusScope = React27.forwardRef((props, forwardedRef) => {
40650
40922
  };
40651
40923
  }
40652
40924
  }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
40653
- const handleKeyDown = React27.useCallback(
40925
+ const handleKeyDown = React26.useCallback(
40654
40926
  (event) => {
40655
40927
  if (!loop && !trapped) return;
40656
40928
  if (focusScope.paused) return;
@@ -40704,8 +40976,12 @@ function getTabbableCandidates(container) {
40704
40976
  return nodes;
40705
40977
  }
40706
40978
  function findVisible(elements, container) {
40979
+ const canUseCheckVisibility = typeof container.checkVisibility === "function" && container.checkVisibility({ checkVisibilityCSS: true });
40707
40980
  for (const element of elements) {
40708
- if (!isHidden(element, { upTo: container })) return element;
40981
+ const hidden = canUseCheckVisibility ? !element.checkVisibility({ checkVisibilityCSS: true }) : isHidden(element, { upTo: container });
40982
+ if (!hidden) {
40983
+ return element;
40984
+ }
40709
40985
  }
40710
40986
  }
40711
40987
  function isHidden(node, { upTo }) {
@@ -40759,11 +41035,11 @@ function removeLinks(items) {
40759
41035
  }
40760
41036
 
40761
41037
  // node_modules/@radix-ui/react-id/dist/index.mjs
40762
- import * as React28 from "react";
40763
- var useReactId = React28[" useId ".trim().toString()] || (() => void 0);
41038
+ import * as React27 from "react";
41039
+ var useReactId = React27[" useId ".trim().toString()] || (() => void 0);
40764
41040
  var count2 = 0;
40765
41041
  function useId(deterministicId) {
40766
- const [id, setId] = React28.useState(useReactId());
41042
+ const [id, setId] = React27.useState(useReactId());
40767
41043
  useLayoutEffect2(() => {
40768
41044
  if (!deterministicId) setId((reactId) => reactId ?? String(count2++));
40769
41045
  }, [deterministicId]);
@@ -40771,7 +41047,7 @@ function useId(deterministicId) {
40771
41047
  }
40772
41048
 
40773
41049
  // node_modules/@radix-ui/react-popper/dist/index.mjs
40774
- import * as React32 from "react";
41050
+ import * as React31 from "react";
40775
41051
 
40776
41052
  // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
40777
41053
  var sides = ["top", "right", "bottom", "left"];
@@ -40820,9 +41096,9 @@ function getAlignmentSides(placement, rects, rtl) {
40820
41096
  }
40821
41097
  const alignment = getAlignment(placement);
40822
41098
  const alignmentAxis = getAlignmentAxis(placement);
40823
- const length63 = getAxisLength(alignmentAxis);
41099
+ const length64 = getAxisLength(alignmentAxis);
40824
41100
  let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
40825
- if (rects.reference[length63] > rects.floating[length63]) {
41101
+ if (rects.reference[length64] > rects.floating[length64]) {
40826
41102
  mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
40827
41103
  }
40828
41104
  return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
@@ -41128,28 +41404,28 @@ var arrow = (options) => ({
41128
41404
  y
41129
41405
  };
41130
41406
  const axis = getAlignmentAxis(placement);
41131
- const length63 = getAxisLength(axis);
41407
+ const length64 = getAxisLength(axis);
41132
41408
  const arrowDimensions = await platform2.getDimensions(element);
41133
41409
  const isYAxis = axis === "y";
41134
41410
  const minProp = isYAxis ? "top" : "left";
41135
41411
  const maxProp = isYAxis ? "bottom" : "right";
41136
41412
  const clientProp = isYAxis ? "clientHeight" : "clientWidth";
41137
- const endDiff = rects.reference[length63] + rects.reference[axis] - coords[axis] - rects.floating[length63];
41413
+ const endDiff = rects.reference[length64] + rects.reference[axis] - coords[axis] - rects.floating[length64];
41138
41414
  const startDiff = coords[axis] - rects.reference[axis];
41139
41415
  const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
41140
41416
  let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
41141
41417
  if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
41142
- clientSize = elements.floating[clientProp] || rects.floating[length63];
41418
+ clientSize = elements.floating[clientProp] || rects.floating[length64];
41143
41419
  }
41144
41420
  const centerToReference = endDiff / 2 - startDiff / 2;
41145
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length63] / 2 - 1;
41421
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length64] / 2 - 1;
41146
41422
  const minPadding = min(paddingObject[minProp], largestPossiblePadding);
41147
41423
  const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
41148
41424
  const min$1 = minPadding;
41149
- const max2 = clientSize - arrowDimensions[length63] - maxPadding;
41150
- const center = clientSize / 2 - arrowDimensions[length63] / 2 + centerToReference;
41425
+ const max2 = clientSize - arrowDimensions[length64] - maxPadding;
41426
+ const center = clientSize / 2 - arrowDimensions[length64] / 2 + centerToReference;
41151
41427
  const offset4 = clamp2(min$1, center, max2);
41152
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length63] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length63] / 2 < 0;
41428
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length64] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length64] / 2 < 0;
41153
41429
  const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
41154
41430
  return {
41155
41431
  [axis]: coords[axis] + alignmentOffset,
@@ -42391,7 +42667,7 @@ var computePosition2 = (reference, floating, options) => {
42391
42667
  };
42392
42668
 
42393
42669
  // node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
42394
- import * as React29 from "react";
42670
+ import * as React28 from "react";
42395
42671
  import { useLayoutEffect as useLayoutEffect3 } from "react";
42396
42672
  import * as ReactDOM3 from "react-dom";
42397
42673
  var isClient = typeof document !== "undefined";
@@ -42408,14 +42684,14 @@ function deepEqual(a, b) {
42408
42684
  if (typeof a === "function" && a.toString() === b.toString()) {
42409
42685
  return true;
42410
42686
  }
42411
- let length63;
42687
+ let length64;
42412
42688
  let i;
42413
42689
  let keys;
42414
42690
  if (a && b && typeof a === "object") {
42415
42691
  if (Array.isArray(a)) {
42416
- length63 = a.length;
42417
- if (length63 !== b.length) return false;
42418
- for (i = length63; i-- !== 0; ) {
42692
+ length64 = a.length;
42693
+ if (length64 !== b.length) return false;
42694
+ for (i = length64; i-- !== 0; ) {
42419
42695
  if (!deepEqual(a[i], b[i])) {
42420
42696
  return false;
42421
42697
  }
@@ -42423,16 +42699,16 @@ function deepEqual(a, b) {
42423
42699
  return true;
42424
42700
  }
42425
42701
  keys = Object.keys(a);
42426
- length63 = keys.length;
42427
- if (length63 !== Object.keys(b).length) {
42702
+ length64 = keys.length;
42703
+ if (length64 !== Object.keys(b).length) {
42428
42704
  return false;
42429
42705
  }
42430
- for (i = length63; i-- !== 0; ) {
42706
+ for (i = length64; i-- !== 0; ) {
42431
42707
  if (!{}.hasOwnProperty.call(b, keys[i])) {
42432
42708
  return false;
42433
42709
  }
42434
42710
  }
42435
- for (i = length63; i-- !== 0; ) {
42711
+ for (i = length64; i-- !== 0; ) {
42436
42712
  const key = keys[i];
42437
42713
  if (key === "_owner" && a.$$typeof) {
42438
42714
  continue;
@@ -42457,7 +42733,7 @@ function roundByDPR(element, value) {
42457
42733
  return Math.round(value * dpr) / dpr;
42458
42734
  }
42459
42735
  function useLatestRef(value) {
42460
- const ref = React29.useRef(value);
42736
+ const ref = React28.useRef(value);
42461
42737
  index(() => {
42462
42738
  ref.current = value;
42463
42739
  });
@@ -42480,7 +42756,7 @@ function useFloating(options) {
42480
42756
  whileElementsMounted,
42481
42757
  open
42482
42758
  } = options;
42483
- const [data, setData] = React29.useState({
42759
+ const [data, setData] = React28.useState({
42484
42760
  x: 0,
42485
42761
  y: 0,
42486
42762
  strategy,
@@ -42488,19 +42764,19 @@ function useFloating(options) {
42488
42764
  middlewareData: {},
42489
42765
  isPositioned: false
42490
42766
  });
42491
- const [latestMiddleware, setLatestMiddleware] = React29.useState(middleware);
42767
+ const [latestMiddleware, setLatestMiddleware] = React28.useState(middleware);
42492
42768
  if (!deepEqual(latestMiddleware, middleware)) {
42493
42769
  setLatestMiddleware(middleware);
42494
42770
  }
42495
- const [_reference, _setReference] = React29.useState(null);
42496
- const [_floating, _setFloating] = React29.useState(null);
42497
- const setReference = React29.useCallback((node) => {
42771
+ const [_reference, _setReference] = React28.useState(null);
42772
+ const [_floating, _setFloating] = React28.useState(null);
42773
+ const setReference = React28.useCallback((node) => {
42498
42774
  if (node !== referenceRef.current) {
42499
42775
  referenceRef.current = node;
42500
42776
  _setReference(node);
42501
42777
  }
42502
42778
  }, []);
42503
- const setFloating = React29.useCallback((node) => {
42779
+ const setFloating = React28.useCallback((node) => {
42504
42780
  if (node !== floatingRef.current) {
42505
42781
  floatingRef.current = node;
42506
42782
  _setFloating(node);
@@ -42508,14 +42784,14 @@ function useFloating(options) {
42508
42784
  }, []);
42509
42785
  const referenceEl = externalReference || _reference;
42510
42786
  const floatingEl = externalFloating || _floating;
42511
- const referenceRef = React29.useRef(null);
42512
- const floatingRef = React29.useRef(null);
42513
- const dataRef = React29.useRef(data);
42787
+ const referenceRef = React28.useRef(null);
42788
+ const floatingRef = React28.useRef(null);
42789
+ const dataRef = React28.useRef(data);
42514
42790
  const hasWhileElementsMounted = whileElementsMounted != null;
42515
42791
  const whileElementsMountedRef = useLatestRef(whileElementsMounted);
42516
42792
  const platformRef = useLatestRef(platform2);
42517
42793
  const openRef = useLatestRef(open);
42518
- const update = React29.useCallback(() => {
42794
+ const update = React28.useCallback(() => {
42519
42795
  if (!referenceRef.current || !floatingRef.current) {
42520
42796
  return;
42521
42797
  }
@@ -42553,7 +42829,7 @@ function useFloating(options) {
42553
42829
  }));
42554
42830
  }
42555
42831
  }, [open]);
42556
- const isMountedRef = React29.useRef(false);
42832
+ const isMountedRef = React28.useRef(false);
42557
42833
  index(() => {
42558
42834
  isMountedRef.current = true;
42559
42835
  return () => {
@@ -42570,17 +42846,17 @@ function useFloating(options) {
42570
42846
  update();
42571
42847
  }
42572
42848
  }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
42573
- const refs = React29.useMemo(() => ({
42849
+ const refs = React28.useMemo(() => ({
42574
42850
  reference: referenceRef,
42575
42851
  floating: floatingRef,
42576
42852
  setReference,
42577
42853
  setFloating
42578
42854
  }), [setReference, setFloating]);
42579
- const elements = React29.useMemo(() => ({
42855
+ const elements = React28.useMemo(() => ({
42580
42856
  reference: referenceEl,
42581
42857
  floating: floatingEl
42582
42858
  }), [referenceEl, floatingEl]);
42583
- const floatingStyles = React29.useMemo(() => {
42859
+ const floatingStyles = React28.useMemo(() => {
42584
42860
  const initialStyles = {
42585
42861
  position: strategy,
42586
42862
  left: 0,
@@ -42606,7 +42882,7 @@ function useFloating(options) {
42606
42882
  top: y
42607
42883
  };
42608
42884
  }, [strategy, transform, elements.floating, data.x, data.y]);
42609
- return React29.useMemo(() => ({
42885
+ return React28.useMemo(() => ({
42610
42886
  ...data,
42611
42887
  update,
42612
42888
  refs,
@@ -42702,10 +42978,10 @@ var arrow3 = (options, deps) => {
42702
42978
  };
42703
42979
 
42704
42980
  // node_modules/@radix-ui/react-arrow/dist/index.mjs
42705
- import * as React30 from "react";
42981
+ import * as React29 from "react";
42706
42982
  import { jsx as jsx28 } from "react/jsx-runtime";
42707
42983
  var NAME = "Arrow";
42708
- var Arrow = React30.forwardRef((props, forwardedRef) => {
42984
+ var Arrow = React29.forwardRef((props, forwardedRef) => {
42709
42985
  const { children, width: width10 = 10, height: height10 = 5, ...arrowProps } = props;
42710
42986
  return /* @__PURE__ */ jsx28(
42711
42987
  Primitive.svg,
@@ -42724,9 +43000,9 @@ Arrow.displayName = NAME;
42724
43000
  var Root = Arrow;
42725
43001
 
42726
43002
  // node_modules/@radix-ui/react-use-size/dist/index.mjs
42727
- import * as React31 from "react";
43003
+ import * as React30 from "react";
42728
43004
  function useSize(element) {
42729
- const [size4, setSize] = React31.useState(void 0);
43005
+ const [size4, setSize] = React30.useState(void 0);
42730
43006
  useLayoutEffect2(() => {
42731
43007
  if (element) {
42732
43008
  setSize({ width: element.offsetWidth, height: element.offsetHeight });
@@ -42767,8 +43043,8 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
42767
43043
  var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
42768
43044
  var Popper = (props) => {
42769
43045
  const { __scopePopper, children } = props;
42770
- const [anchor, setAnchor] = React32.useState(null);
42771
- const [placementState, setPlacementState] = React32.useState(void 0);
43046
+ const [anchor, setAnchor] = React31.useState(null);
43047
+ const [placementState, setPlacementState] = React31.useState(void 0);
42772
43048
  return /* @__PURE__ */ jsx29(
42773
43049
  PopperProvider,
42774
43050
  {
@@ -42783,13 +43059,13 @@ var Popper = (props) => {
42783
43059
  };
42784
43060
  Popper.displayName = POPPER_NAME;
42785
43061
  var ANCHOR_NAME = "PopperAnchor";
42786
- var PopperAnchor = React32.forwardRef(
43062
+ var PopperAnchor = React31.forwardRef(
42787
43063
  (props, forwardedRef) => {
42788
43064
  const { __scopePopper, virtualRef, ...anchorProps } = props;
42789
43065
  const context = usePopperContext(ANCHOR_NAME, __scopePopper);
42790
- const ref = React32.useRef(null);
43066
+ const ref = React31.useRef(null);
42791
43067
  const onAnchorChange = context.onAnchorChange;
42792
- const callbackRef = React32.useCallback(
43068
+ const callbackRef = React31.useCallback(
42793
43069
  (node) => {
42794
43070
  ref.current = node;
42795
43071
  if (node) {
@@ -42799,8 +43075,8 @@ var PopperAnchor = React32.forwardRef(
42799
43075
  [onAnchorChange]
42800
43076
  );
42801
43077
  const composedRefs = useComposedRefs(forwardedRef, callbackRef);
42802
- const anchorRef = React32.useRef(null);
42803
- React32.useEffect(() => {
43078
+ const anchorRef = React31.useRef(null);
43079
+ React31.useEffect(() => {
42804
43080
  if (!virtualRef) {
42805
43081
  return;
42806
43082
  }
@@ -42827,7 +43103,7 @@ var PopperAnchor = React32.forwardRef(
42827
43103
  PopperAnchor.displayName = ANCHOR_NAME;
42828
43104
  var CONTENT_NAME = "PopperContent";
42829
43105
  var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
42830
- var PopperContent = React32.forwardRef(
43106
+ var PopperContent = React31.forwardRef(
42831
43107
  (props, forwardedRef) => {
42832
43108
  const {
42833
43109
  __scopePopper,
@@ -42846,9 +43122,9 @@ var PopperContent = React32.forwardRef(
42846
43122
  ...contentProps
42847
43123
  } = props;
42848
43124
  const context = usePopperContext(CONTENT_NAME, __scopePopper);
42849
- const [content, setContent] = React32.useState(null);
43125
+ const [content, setContent] = React31.useState(null);
42850
43126
  const composedRefs = useComposedRefs(forwardedRef, setContent);
42851
- const [arrow4, setArrow] = React32.useState(null);
43127
+ const [arrow4, setArrow] = React31.useState(null);
42852
43128
  const arrowSize = useSize(arrow4);
42853
43129
  const arrowWidth = arrowSize?.width ?? 0;
42854
43130
  const arrowHeight = arrowSize?.height ?? 0;
@@ -42928,7 +43204,7 @@ var PopperContent = React32.forwardRef(
42928
43204
  const arrowX = middlewareData.arrow?.x;
42929
43205
  const arrowY = middlewareData.arrow?.y;
42930
43206
  const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
42931
- const [contentZIndex, setContentZIndex] = React32.useState();
43207
+ const [contentZIndex, setContentZIndex] = React31.useState();
42932
43208
  useLayoutEffect2(() => {
42933
43209
  if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
42934
43210
  }, [content]);
@@ -42995,7 +43271,7 @@ var OPPOSITE_SIDE = {
42995
43271
  bottom: "top",
42996
43272
  left: "right"
42997
43273
  };
42998
- var PopperArrow = React32.forwardRef(function PopperArrow2(props, forwardedRef) {
43274
+ var PopperArrow = React31.forwardRef(function PopperArrow2(props, forwardedRef) {
42999
43275
  const { __scopePopper, ...arrowProps } = props;
43000
43276
  const contentContext = useContentContext(ARROW_NAME, __scopePopper);
43001
43277
  const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
@@ -43087,13 +43363,13 @@ var Content = PopperContent;
43087
43363
  var Arrow2 = PopperArrow;
43088
43364
 
43089
43365
  // node_modules/@radix-ui/react-portal/dist/index.mjs
43090
- import * as React33 from "react";
43366
+ import * as React32 from "react";
43091
43367
  import * as ReactDOM4 from "react-dom";
43092
43368
  import { jsx as jsx30 } from "react/jsx-runtime";
43093
43369
  var PORTAL_NAME = "Portal";
43094
- var Portal = React33.forwardRef((props, forwardedRef) => {
43370
+ var Portal = React32.forwardRef((props, forwardedRef) => {
43095
43371
  const { container: containerProp, ...portalProps } = props;
43096
- const [mounted, setMounted] = React33.useState(false);
43372
+ const [mounted, setMounted] = React32.useState(false);
43097
43373
  useLayoutEffect2(() => setMounted(true), []);
43098
43374
  const container = containerProp || mounted && globalThis?.document?.body;
43099
43375
  return container ? ReactDOM4.createPortal(/* @__PURE__ */ jsx30(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
@@ -43102,9 +43378,9 @@ Portal.displayName = PORTAL_NAME;
43102
43378
 
43103
43379
  // node_modules/@radix-ui/react-presence/dist/index.mjs
43104
43380
  import * as React210 from "react";
43105
- import * as React34 from "react";
43381
+ import * as React33 from "react";
43106
43382
  function useStateMachine(initialState, machine) {
43107
- return React34.useReducer((state, event) => {
43383
+ return React33.useReducer((state, event) => {
43108
43384
  const nextState = machine[state][event];
43109
43385
  return nextState ?? state;
43110
43386
  }, initialState);
@@ -43123,6 +43399,7 @@ function usePresence(present) {
43123
43399
  const stylesRef = React210.useRef(null);
43124
43400
  const prevPresentRef = React210.useRef(present);
43125
43401
  const prevAnimationNameRef = React210.useRef("none");
43402
+ const mountAnimationNameRef = React210.useRef(void 0);
43126
43403
  const initialState = present ? "mounted" : "unmounted";
43127
43404
  const [state, send] = useStateMachine(initialState, {
43128
43405
  mounted: {
@@ -43138,8 +43415,12 @@ function usePresence(present) {
43138
43415
  }
43139
43416
  });
43140
43417
  React210.useEffect(() => {
43141
- const currentAnimationName = getAnimationName(stylesRef.current);
43142
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
43418
+ if (state === "mounted") {
43419
+ prevAnimationNameRef.current = mountAnimationNameRef.current ?? getAnimationName(stylesRef.current);
43420
+ mountAnimationNameRef.current = void 0;
43421
+ } else {
43422
+ prevAnimationNameRef.current = "none";
43423
+ }
43143
43424
  }, [state]);
43144
43425
  useLayoutEffect2(() => {
43145
43426
  const styles = stylesRef.current;
@@ -43149,6 +43430,7 @@ function usePresence(present) {
43149
43430
  const prevAnimationName = prevAnimationNameRef.current;
43150
43431
  const currentAnimationName = getAnimationName(styles);
43151
43432
  if (present) {
43433
+ mountAnimationNameRef.current = currentAnimationName;
43152
43434
  send("MOUNT");
43153
43435
  } else if (currentAnimationName === "none" || styles?.display === "none") {
43154
43436
  send("UNMOUNT");
@@ -43204,7 +43486,13 @@ function usePresence(present) {
43204
43486
  return {
43205
43487
  isPresent: ["mounted", "unmountSuspended"].includes(state),
43206
43488
  ref: React210.useCallback((node2) => {
43207
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
43489
+ if (node2) {
43490
+ const styles = getComputedStyle(node2);
43491
+ stylesRef.current = styles;
43492
+ mountAnimationNameRef.current = getAnimationName(styles);
43493
+ } else {
43494
+ stylesRef.current = null;
43495
+ }
43208
43496
  setNode(node2);
43209
43497
  }, [])
43210
43498
  };
@@ -43262,6 +43550,36 @@ function getElementRef2(element) {
43262
43550
 
43263
43551
  // node_modules/@radix-ui/react-roving-focus/dist/index.mjs
43264
43552
  import * as React35 from "react";
43553
+
43554
+ // node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
43555
+ import * as React211 from "react";
43556
+ import * as React34 from "react";
43557
+ var _isHydrated = false;
43558
+ function useIsHydrated() {
43559
+ const [isHydrated, setIsHydrated] = React34.useState(_isHydrated);
43560
+ React34.useEffect(() => {
43561
+ if (!_isHydrated) {
43562
+ _isHydrated = true;
43563
+ setIsHydrated(true);
43564
+ }
43565
+ }, []);
43566
+ return isHydrated;
43567
+ }
43568
+ var useReactSyncExternalStore = React211[" useSyncExternalStore ".trim().toString()];
43569
+ function subscribe() {
43570
+ return () => {
43571
+ };
43572
+ }
43573
+ function useIsHydratedModern() {
43574
+ return useReactSyncExternalStore(
43575
+ subscribe,
43576
+ () => true,
43577
+ () => false
43578
+ );
43579
+ }
43580
+ var useIsHydrated2 = typeof useReactSyncExternalStore === "function" ? useIsHydratedModern : useIsHydrated;
43581
+
43582
+ // node_modules/@radix-ui/react-roving-focus/dist/index.mjs
43265
43583
  import { jsx as jsx31 } from "react/jsx-runtime";
43266
43584
  var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
43267
43585
  var EVENT_OPTIONS2 = { bubbles: false, cancelable: true };
@@ -43385,12 +43703,21 @@ var RovingFocusGroupItem = React35.forwardRef(
43385
43703
  const isCurrentTabStop = context.currentTabStopId === id;
43386
43704
  const getItems = useCollection(__scopeRovingFocusGroup);
43387
43705
  const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
43706
+ const isHydrated = useIsHydrated2();
43707
+ useLayoutEffect2(() => {
43708
+ if (!isHydrated || !focusable) {
43709
+ return;
43710
+ }
43711
+ onFocusableItemAdd();
43712
+ return () => onFocusableItemRemove();
43713
+ }, [isHydrated, focusable, onFocusableItemAdd, onFocusableItemRemove]);
43388
43714
  React35.useEffect(() => {
43389
- if (focusable) {
43390
- onFocusableItemAdd();
43391
- return () => onFocusableItemRemove();
43715
+ if (isHydrated || !focusable) {
43716
+ return;
43392
43717
  }
43393
- }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
43718
+ onFocusableItemAdd();
43719
+ return () => onFocusableItemRemove();
43720
+ }, [isHydrated, focusable, onFocusableItemAdd, onFocusableItemRemove]);
43394
43721
  return /* @__PURE__ */ jsx31(
43395
43722
  Collection.ItemSlot,
43396
43723
  {
@@ -43649,9 +43976,9 @@ function assignRef(ref, value) {
43649
43976
  }
43650
43977
 
43651
43978
  // node_modules/use-callback-ref/dist/es2015/useRef.js
43652
- import { useState as useState31 } from "react";
43979
+ import { useState as useState32 } from "react";
43653
43980
  function useCallbackRef2(initialValue, callback) {
43654
- var ref = useState31(function() {
43981
+ var ref = useState32(function() {
43655
43982
  return {
43656
43983
  // value
43657
43984
  value: initialValue,
@@ -44700,8 +45027,13 @@ var MenuItem = React43.forwardRef(
44700
45027
  if (!isPointerDownRef.current) event.currentTarget?.click();
44701
45028
  }),
44702
45029
  onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
45030
+ if (disabled || event.target !== event.currentTarget) {
45031
+ return;
45032
+ }
44703
45033
  const isTypingAhead = contentContext.searchRef.current !== "";
44704
- if (disabled || isTypingAhead && event.key === " ") return;
45034
+ if (isTypingAhead && event.key === " ") {
45035
+ return;
45036
+ }
44705
45037
  if (SELECTION_KEYS.includes(event.key)) {
44706
45038
  event.currentTarget.click();
44707
45039
  event.preventDefault();
@@ -45004,8 +45336,13 @@ var MenuSubTrigger = React43.forwardRef(
45004
45336
  })
45005
45337
  ),
45006
45338
  onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
45339
+ if (props.disabled || event.target !== event.currentTarget) {
45340
+ return;
45341
+ }
45007
45342
  const isTypingAhead = contentContext.searchRef.current !== "";
45008
- if (props.disabled || isTypingAhead && event.key === " ") return;
45343
+ if (isTypingAhead && event.key === " ") {
45344
+ return;
45345
+ }
45009
45346
  if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
45010
45347
  context.onOpenChange(true);
45011
45348
  context.content?.focus();
@@ -45391,7 +45728,7 @@ var SubTrigger2 = DropdownMenuSubTrigger;
45391
45728
  var SubContent2 = DropdownMenuSubContent;
45392
45729
 
45393
45730
  // src/components/AppearanceMenu.tsx
45394
- import { useState as useState35 } from "react";
45731
+ import { useState as useState36 } from "react";
45395
45732
 
45396
45733
  // src/components/Icons.tsx
45397
45734
  import { jsx as jsx34 } from "react/jsx-runtime";
@@ -45498,8 +45835,8 @@ var iconContainerStyles = {
45498
45835
  var AppearanceMenu = () => {
45499
45836
  const { visibility, setLayerVisibility } = useLayerVisibility();
45500
45837
  const { lightingEnabled, setLightingEnabled } = useRenderingMode();
45501
- const [appearanceSubOpen, setAppearanceSubOpen] = useState35(false);
45502
- const [hoveredItem, setHoveredItem] = useState35(null);
45838
+ const [appearanceSubOpen, setAppearanceSubOpen] = useState36(false);
45839
+ const [hoveredItem, setHoveredItem] = useState36(null);
45503
45840
  return /* @__PURE__ */ jsxs8(Fragment11, { children: [
45504
45841
  /* @__PURE__ */ jsx35(Separator2, { style: separatorStyles }),
45505
45842
  /* @__PURE__ */ jsxs8(Sub2, { onOpenChange: setAppearanceSubOpen, children: [
@@ -45887,8 +46224,8 @@ var ContextMenu = ({
45887
46224
  onOpenKeyboardShortcuts
45888
46225
  }) => {
45889
46226
  const { cameraType, setCameraType } = useCameraController();
45890
- const [cameraSubOpen, setCameraSubOpen] = useState36(false);
45891
- const [hoveredItem, setHoveredItem] = useState36(null);
46227
+ const [cameraSubOpen, setCameraSubOpen] = useState37(false);
46228
+ const [hoveredItem, setHoveredItem] = useState37(null);
45892
46229
  return /* @__PURE__ */ jsx36(
45893
46230
  "div",
45894
46231
  {
@@ -46146,16 +46483,16 @@ var ContextMenu = ({
46146
46483
  };
46147
46484
 
46148
46485
  // src/components/KeyboardShortcutsDialog.tsx
46149
- import { useEffect as useEffect46, useMemo as useMemo31, useRef as useRef28, useState as useState37 } from "react";
46486
+ import { useEffect as useEffect47, useMemo as useMemo30, useRef as useRef27, useState as useState38 } from "react";
46150
46487
  import { jsx as jsx37, jsxs as jsxs10 } from "react/jsx-runtime";
46151
46488
  var KeyboardShortcutsDialog = ({
46152
46489
  open,
46153
46490
  onClose
46154
46491
  }) => {
46155
- const [query, setQuery] = useState37("");
46156
- const inputRef = useRef28(null);
46492
+ const [query, setQuery] = useState38("");
46493
+ const inputRef = useRef27(null);
46157
46494
  const hotkeys = useHotkeyRegistry();
46158
- useEffect46(() => {
46495
+ useEffect47(() => {
46159
46496
  if (!open) return void 0;
46160
46497
  const handleKeyDown = (event) => {
46161
46498
  if (event.key === "Escape") {
@@ -46166,14 +46503,14 @@ var KeyboardShortcutsDialog = ({
46166
46503
  window.addEventListener("keydown", handleKeyDown);
46167
46504
  return () => window.removeEventListener("keydown", handleKeyDown);
46168
46505
  }, [open, onClose]);
46169
- useEffect46(() => {
46506
+ useEffect47(() => {
46170
46507
  if (open) {
46171
46508
  setTimeout(() => {
46172
46509
  inputRef.current?.focus();
46173
46510
  }, 0);
46174
46511
  }
46175
46512
  }, [open]);
46176
- const filteredHotkeys = useMemo31(() => {
46513
+ const filteredHotkeys = useMemo30(() => {
46177
46514
  const normalizedQuery = query.trim().toLowerCase();
46178
46515
  if (!normalizedQuery) {
46179
46516
  return hotkeys;
@@ -46345,25 +46682,25 @@ var readStoredCameraType = () => {
46345
46682
  return stored === "orthographic" || stored === "perspective" ? stored : void 0;
46346
46683
  };
46347
46684
  var CadViewerInner = (props) => {
46348
- const [engine, setEngine] = useState38(() => {
46685
+ const [engine, setEngine] = useState39(() => {
46349
46686
  const stored = window.localStorage.getItem("cadViewerEngine");
46350
46687
  return stored === "jscad" || stored === "manifold" ? stored : "manifold";
46351
46688
  });
46352
- const containerRef = useRef29(null);
46353
- const [isKeyboardShortcutsDialogOpen, setIsKeyboardShortcutsDialogOpen] = useState38(false);
46354
- const [autoRotate, setAutoRotate] = useState38(() => {
46689
+ const containerRef = useRef28(null);
46690
+ const [isKeyboardShortcutsDialogOpen, setIsKeyboardShortcutsDialogOpen] = useState39(false);
46691
+ const [autoRotate, setAutoRotate] = useState39(() => {
46355
46692
  const stored = window.localStorage.getItem("cadViewerAutoRotate");
46356
46693
  return stored === "false" ? false : true;
46357
46694
  });
46358
- const [autoRotateUserToggled, setAutoRotateUserToggled] = useState38(() => {
46695
+ const [autoRotateUserToggled, setAutoRotateUserToggled] = useState39(() => {
46359
46696
  const stored = window.localStorage.getItem("cadViewerAutoRotateUserToggled");
46360
46697
  return stored === "true";
46361
46698
  });
46362
- const [cameraPreset, setCameraPreset] = useState38("Custom");
46699
+ const [cameraPreset, setCameraPreset] = useState39("Custom");
46363
46700
  const { cameraType, setCameraType } = useCameraController();
46364
46701
  const { visibility, setLayerVisibility } = useLayerVisibility();
46365
46702
  const { showToast } = useToast();
46366
- const cameraControllerRef = useRef29(null);
46703
+ const cameraControllerRef = useRef28(null);
46367
46704
  const externalCameraControllerReady = props.onCameraControllerReady;
46368
46705
  const {
46369
46706
  menuVisible,
@@ -46372,12 +46709,12 @@ var CadViewerInner = (props) => {
46372
46709
  contextMenuEventHandlers,
46373
46710
  setMenuVisible
46374
46711
  } = useContextMenu({ containerRef });
46375
- const autoRotateUserToggledRef = useRef29(autoRotateUserToggled);
46712
+ const autoRotateUserToggledRef = useRef28(autoRotateUserToggled);
46376
46713
  autoRotateUserToggledRef.current = autoRotateUserToggled;
46377
- const isAnimatingRef = useRef29(false);
46378
- const lastPresetSelectTime = useRef29(0);
46714
+ const isAnimatingRef = useRef28(false);
46715
+ const lastPresetSelectTime = useRef28(0);
46379
46716
  const PRESET_COOLDOWN = 1e3;
46380
- const handleUserInteraction = useCallback24(() => {
46717
+ const handleUserInteraction = useCallback25(() => {
46381
46718
  if (isAnimatingRef.current || Date.now() - lastPresetSelectTime.current < PRESET_COOLDOWN) {
46382
46719
  return;
46383
46720
  }
@@ -46388,15 +46725,15 @@ var CadViewerInner = (props) => {
46388
46725
  setCameraPreset("Custom");
46389
46726
  }
46390
46727
  }, [menuVisible]);
46391
- const toggleAutoRotate = useCallback24(() => {
46728
+ const toggleAutoRotate = useCallback25(() => {
46392
46729
  setAutoRotate((prev) => !prev);
46393
46730
  setAutoRotateUserToggled(true);
46394
46731
  }, []);
46395
46732
  const downloadGltf = useGlobalDownloadGltf();
46396
- const closeMenu = useCallback24(() => {
46733
+ const closeMenu = useCallback25(() => {
46397
46734
  setMenuVisible(false);
46398
46735
  }, [setMenuVisible]);
46399
- const handleCameraControllerReady = useCallback24(
46736
+ const handleCameraControllerReady = useCallback25(
46400
46737
  (controller) => {
46401
46738
  cameraControllerRef.current = controller;
46402
46739
  externalCameraControllerReady?.(controller);
@@ -46470,24 +46807,24 @@ var CadViewerInner = (props) => {
46470
46807
  description: "Toggle translucent components"
46471
46808
  }
46472
46809
  );
46473
- useEffect47(() => {
46810
+ useEffect48(() => {
46474
46811
  if (containerRef.current) {
46475
46812
  registerHotkeyViewer(containerRef.current);
46476
46813
  }
46477
46814
  }, []);
46478
- useEffect47(() => {
46815
+ useEffect48(() => {
46479
46816
  window.localStorage.setItem("cadViewerEngine", engine);
46480
46817
  }, [engine]);
46481
- useEffect47(() => {
46818
+ useEffect48(() => {
46482
46819
  window.localStorage.setItem("cadViewerAutoRotate", String(autoRotate));
46483
46820
  }, [autoRotate]);
46484
- useEffect47(() => {
46821
+ useEffect48(() => {
46485
46822
  window.localStorage.setItem(
46486
46823
  "cadViewerAutoRotateUserToggled",
46487
46824
  String(autoRotateUserToggled)
46488
46825
  );
46489
46826
  }, [autoRotateUserToggled]);
46490
- useEffect47(() => {
46827
+ useEffect48(() => {
46491
46828
  window.localStorage.setItem("cadViewerCameraType", cameraType);
46492
46829
  }, [cameraType]);
46493
46830
  const viewerKey = props.circuitJson ? JSON.stringify(props.circuitJson) : void 0;
@@ -46888,10 +47225,10 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
46888
47225
 
46889
47226
  // src/hooks/exporter/gltf.ts
46890
47227
  import { GLTFExporter as GLTFExporter3 } from "three-stdlib";
46891
- import { useEffect as useEffect48, useState as useState39, useMemo as useMemo32, useCallback as useCallback25 } from "react";
47228
+ import { useEffect as useEffect49, useState as useState40, useMemo as useMemo31, useCallback as useCallback26 } from "react";
46892
47229
  function useSaveGltfAs(options = {}) {
46893
47230
  const parse2 = useParser(options);
46894
- const link = useMemo32(() => document.createElement("a"), []);
47231
+ const link = useMemo31(() => document.createElement("a"), []);
46895
47232
  const saveAs = async (filename) => {
46896
47233
  const name = filename ?? options.filename ?? "";
46897
47234
  if (options.binary == null) options.binary = name.endsWith(".glb");
@@ -46901,7 +47238,7 @@ function useSaveGltfAs(options = {}) {
46901
47238
  link.dispatchEvent(new MouseEvent("click"));
46902
47239
  URL.revokeObjectURL(url);
46903
47240
  };
46904
- useEffect48(
47241
+ useEffect49(
46905
47242
  () => () => {
46906
47243
  link.remove();
46907
47244
  instance = null;
@@ -46909,24 +47246,24 @@ function useSaveGltfAs(options = {}) {
46909
47246
  []
46910
47247
  );
46911
47248
  let instance;
46912
- const ref = useCallback25((obj3D) => {
47249
+ const ref = useCallback26((obj3D) => {
46913
47250
  instance = obj3D;
46914
47251
  }, []);
46915
47252
  return [ref, saveAs];
46916
47253
  }
46917
47254
  function useExportGltfUrl(options = {}) {
46918
47255
  const parse2 = useParser(options);
46919
- const [url, setUrl] = useState39();
46920
- const [error, setError] = useState39();
46921
- const ref = useCallback25(
47256
+ const [url, setUrl] = useState40();
47257
+ const [error, setError] = useState40();
47258
+ const ref = useCallback26(
46922
47259
  (instance) => parse2(instance).then(setUrl).catch(setError),
46923
47260
  []
46924
47261
  );
46925
- useEffect48(() => () => URL.revokeObjectURL(url), [url]);
47262
+ useEffect49(() => () => URL.revokeObjectURL(url), [url]);
46926
47263
  return [ref, url, error];
46927
47264
  }
46928
47265
  function useParser(options = {}) {
46929
- const exporter = useMemo32(() => new GLTFExporter3(), []);
47266
+ const exporter = useMemo31(() => new GLTFExporter3(), []);
46930
47267
  return (instance) => {
46931
47268
  const { promise, resolve, reject } = Promise.withResolvers();
46932
47269
  exporter.parse(