sldeditor 0.19.1 → 0.20.0

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.
@@ -1,226 +1,226 @@
1
- "use strict";var Gk=Object.defineProperty;var Vk=(e,t,n)=>t in e?Gk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var At=(e,t,n)=>Vk(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),P=require("react"),Ei=require("react-dom");function Kk(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ce=Kk(P);/**
1
+ "use strict";var Qk=Object.defineProperty;var Jk=(e,t,n)=>t in e?Qk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Et=(e,t,n)=>Jk(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),I=require("react"),zi=require("react-dom");function e2(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Ce=e2(I);/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const Uk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ni=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();/**
6
+ */const t2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Mi=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();/**
7
7
  * @license lucide-react v0.469.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */var Xk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
11
+ */var n2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12
12
  * @license lucide-react v0.469.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const Yk=P.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:i,iconNode:a,...s},l)=>P.createElement("svg",{ref:l,...Xk,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Ni("lucide",r),...s},[...a.map(([c,m])=>P.createElement(c,m)),...Array.isArray(i)?i:[i]]));/**
16
+ */const o2=I.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:i,iconNode:a,...s},l)=>I.createElement("svg",{ref:l,...n2,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Mi("lucide",r),...s},[...a.map(([c,u])=>I.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
17
17
  * @license lucide-react v0.469.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const ie=(e,t)=>{const n=P.forwardRef(({className:o,...r},i)=>P.createElement(Yk,{ref:i,iconNode:t,className:Ni(`lucide-${Uk(e)}`,o),...r}));return n.displayName=`${e}`,n};/**
21
+ */const re=(e,t)=>{const n=I.forwardRef(({className:o,...r},i)=>I.createElement(o2,{ref:i,iconNode:t,className:Mi(`lucide-${t2(e)}`,o),...r}));return n.displayName=`${e}`,n};/**
22
22
  * @license lucide-react v0.469.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const Ti=ie("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/**
26
+ */const Di=re("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/**
27
27
  * @license lucide-react v0.469.0 - ISC
28
28
  *
29
29
  * This source code is licensed under the ISC license.
30
30
  * See the LICENSE file in the root directory of this source tree.
31
- */const Zk=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
31
+ */const r2=re("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
32
32
  * @license lucide-react v0.469.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */const Qk=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
36
+ */const i2=re("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
37
37
  * @license lucide-react v0.469.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
- */const Jk=ie("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
41
+ */const a2=re("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
42
42
  * @license lucide-react v0.469.0 - ISC
43
43
  *
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
- */const Pi=ie("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
46
+ */const Ri=re("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
47
47
  * @license lucide-react v0.469.0 - ISC
48
48
  *
49
49
  * This source code is licensed under the ISC license.
50
50
  * See the LICENSE file in the root directory of this source tree.
51
- */const Ii=ie("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
51
+ */const Oi=re("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
52
52
  * @license lucide-react v0.469.0 - ISC
53
53
  *
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const e2=ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
56
+ */const s2=re("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
57
57
  * @license lucide-react v0.469.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
- */const so=ie("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
61
+ */const co=re("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
62
62
  * @license lucide-react v0.469.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
- */const t2=ie("FileBox",[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]]);/**
66
+ */const l2=re("FileBox",[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]]);/**
67
67
  * @license lucide-react v0.469.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
71
- */const n2=ie("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
71
+ */const c2=re("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
72
72
  * @license lucide-react v0.469.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
- */const o2=ie("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
76
+ */const d2=re("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
77
77
  * @license lucide-react v0.469.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
- */const r2=ie("FileType",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]]);/**
81
+ */const u2=re("FileType",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 13v-1h6v1",key:"1bb014"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M11 18h2",key:"12mj7e"}]]);/**
82
82
  * @license lucide-react v0.469.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
- */const zi=ie("FlipHorizontal",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3",key:"1i73f7"}],["path",{d:"M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3",key:"saxlbk"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 2v2",key:"tus03m"}]]);/**
86
+ */const Li=re("FlipHorizontal",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h3",key:"1i73f7"}],["path",{d:"M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3",key:"saxlbk"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 2v2",key:"tus03m"}]]);/**
87
87
  * @license lucide-react v0.469.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const dr=ie("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
91
+ */const mr=re("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
92
92
  * @license lucide-react v0.469.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const i2=ie("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/**
96
+ */const m2=re("Grid2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);/**
97
97
  * @license lucide-react v0.469.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const a2=ie("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
101
+ */const p2=re("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
102
102
  * @license lucide-react v0.469.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
- */const yn=ie("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
106
+ */const vn=re("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
107
107
  * @license lucide-react v0.469.0 - ISC
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const Mi=ie("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
111
+ */const Bi=re("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
112
112
  * @license lucide-react v0.469.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
- */const s2=ie("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
116
+ */const h2=re("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
117
117
  * @license lucide-react v0.469.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
120
120
  * See the LICENSE file in the root directory of this source tree.
121
- */const Po=ie("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
121
+ */const zo=re("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
122
122
  * @license lucide-react v0.469.0 - ISC
123
123
  *
124
124
  * This source code is licensed under the ISC license.
125
125
  * See the LICENSE file in the root directory of this source tree.
126
- */const l2=ie("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);/**
126
+ */const f2=re("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);/**
127
127
  * @license lucide-react v0.469.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
- */const c2=ie("PanelBottomClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"m15 8-3 3-3-3",key:"1oxy1z"}]]);/**
131
+ */const g2=re("PanelBottomClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"m15 8-3 3-3-3",key:"1oxy1z"}]]);/**
132
132
  * @license lucide-react v0.469.0 - ISC
133
133
  *
134
134
  * This source code is licensed under the ISC license.
135
135
  * See the LICENSE file in the root directory of this source tree.
136
- */const d2=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
136
+ */const b2=re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
137
137
  * @license lucide-react v0.469.0 - ISC
138
138
  *
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
- */const Io=ie("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
141
+ */const Mo=re("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
142
142
  * @license lucide-react v0.469.0 - ISC
143
143
  *
144
144
  * This source code is licensed under the ISC license.
145
145
  * See the LICENSE file in the root directory of this source tree.
146
- */const Di=ie("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
146
+ */const Hi=re("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
147
147
  * @license lucide-react v0.469.0 - ISC
148
148
  *
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
- */const ur=ie("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
151
+ */const pr=re("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
152
152
  * @license lucide-react v0.469.0 - ISC
153
153
  *
154
154
  * This source code is licensed under the ISC license.
155
155
  * See the LICENSE file in the root directory of this source tree.
156
- */const Ri=ie("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
156
+ */const Fi=re("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
157
157
  * @license lucide-react v0.469.0 - ISC
158
158
  *
159
159
  * This source code is licensed under the ISC license.
160
160
  * See the LICENSE file in the root directory of this source tree.
161
- */const u2=ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
161
+ */const y2=re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
162
162
  * @license lucide-react v0.469.0 - ISC
163
163
  *
164
164
  * This source code is licensed under the ISC license.
165
165
  * See the LICENSE file in the root directory of this source tree.
166
- */const Oi=ie("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
166
+ */const Wi=re("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
167
167
  * @license lucide-react v0.469.0 - ISC
168
168
  *
169
169
  * This source code is licensed under the ISC license.
170
170
  * See the LICENSE file in the root directory of this source tree.
171
- */const m2=ie("Slash",[["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
171
+ */const x2=re("Slash",[["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
172
172
  * @license lucide-react v0.469.0 - ISC
173
173
  *
174
174
  * This source code is licensed under the ISC license.
175
175
  * See the LICENSE file in the root directory of this source tree.
176
- */const p2=ie("Spline",[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]]);/**
176
+ */const w2=re("Spline",[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]]);/**
177
177
  * @license lucide-react v0.469.0 - ISC
178
178
  *
179
179
  * This source code is licensed under the ISC license.
180
180
  * See the LICENSE file in the root directory of this source tree.
181
- */const h2=ie("SquareDashed",[["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M21 19a2 2 0 0 1-2 2",key:"1j7049"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h1",key:"15o7lz"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v1",key:"mxsmne"}],["path",{d:"M3 14v1",key:"vnatye"}],["path",{d:"M21 14v1",key:"169vum"}]]);/**
181
+ */const v2=re("SquareDashed",[["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M21 19a2 2 0 0 1-2 2",key:"1j7049"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h1",key:"15o7lz"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v1",key:"mxsmne"}],["path",{d:"M3 14v1",key:"vnatye"}],["path",{d:"M21 14v1",key:"169vum"}]]);/**
182
182
  * @license lucide-react v0.469.0 - ISC
183
183
  *
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
- */const f2=ie("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
186
+ */const k2=re("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
187
187
  * @license lucide-react v0.469.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
- */const g2=ie("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
191
+ */const S2=re("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
192
192
  * @license lucide-react v0.469.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const Li=ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
196
+ */const qi=re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
197
197
  * @license lucide-react v0.469.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
- */const Bi=ie("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
201
+ */const Gi=re("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
202
202
  * @license lucide-react v0.469.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
- */const zo=ie("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
206
+ */const Do=re("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
207
207
  * @license lucide-react v0.469.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
210
210
  * See the LICENSE file in the root directory of this source tree.
211
- */const Dt=ie("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
211
+ */const Ot=re("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
212
212
  * @license lucide-react v0.469.0 - ISC
213
213
  *
214
214
  * This source code is licensed under the ISC license.
215
215
  * See the LICENSE file in the root directory of this source tree.
216
- */const jn=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Hi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Hi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Fi(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Hi(e))&&(o&&(o+=" "),o+=t);return o}const Mo="-",b2=e=>{const t=x2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const s=a.split(Mo);return s[0]===""&&s.length!==1&&s.shift(),Wi(s,t)||y2(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&o[a]?[...l,...o[a]]:l}}},Wi=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Wi(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Mo);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},mr=/^\[(.+)\]$/,y2=e=>{if(mr.test(e)){const t=mr.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},x2=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return v2(Object.entries(e.classGroups),n).forEach(([i,a])=>{lo(a,o,i,t)}),o},lo=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:pr(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(w2(r)){lo(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,a])=>{lo(a,pr(t,i),n,o)})})},pr=(e,t)=>{let n=e;return t.split(Mo).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},w2=e=>e.isThemeGetter,v2=(e,t)=>t?e.map(([n,o])=>{const r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,r]}):e,k2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=o.get(i))!==void 0)return r(i,a),a},set(i,a){n.has(i)?n.set(i,a):r(i,a)}}},qi="!",S2=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],i=t.length,a=s=>{const l=[];let c=0,m=0,u;for(let b=0;b<s.length;b++){let x=s[b];if(c===0){if(x===r&&(o||s.slice(b,b+i)===t)){l.push(s.slice(m,b)),m=b+i;continue}if(x==="/"){u=b;continue}}x==="["?c++:x==="]"&&c--}const p=l.length===0?s:s.substring(m),f=p.startsWith(qi),h=f?p.substring(1):p,g=u&&u>m?u-m:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:g}};return n?s=>n({className:s,parseClassName:a}):a},_2=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},C2=e=>({cache:k2(e.cacheSize),parseClassName:S2(e),...b2(e)}),$2=/\s+/,j2=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],a=e.trim().split($2);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:m,hasImportantModifier:u,baseClassName:p,maybePostfixModifierPosition:f}=n(c);let h=!!f,g=o(h?p.substring(0,f):p);if(!g){if(!h){s=c+(s.length>0?" "+s:s);continue}if(g=o(p),!g){s=c+(s.length>0?" "+s:s);continue}h=!1}const b=_2(m).join(":"),x=u?b+qi:b,v=x+g;if(i.includes(v))continue;i.push(v);const T=r(g,h);for(let I=0;I<T.length;++I){const H=T[I];i.push(x+H)}s=c+(s.length>0?" "+s:s)}return s};function A2(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Gi(t))&&(o&&(o+=" "),o+=n);return o}const Gi=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Gi(e[o]))&&(n&&(n+=" "),n+=t);return n};function E2(e,...t){let n,o,r,i=a;function a(l){const c=t.reduce((m,u)=>u(m),e());return n=C2(c),o=n.cache.get,r=n.cache.set,i=s,s(l)}function s(l){const c=o(l);if(c)return c;const m=j2(l,n);return r(l,m),m}return function(){return i(A2.apply(null,arguments))}}const ge=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Vi=/^\[(?:([a-z-]+):)?(.+)\]$/i,N2=/^\d+\/\d+$/,T2=new Set(["px","full","screen"]),P2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,z2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,M2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,D2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,He=e=>ft(e)||T2.has(e)||N2.test(e),Qe=e=>wt(e,"length",q2),ft=e=>!!e&&!Number.isNaN(Number(e)),Gn=e=>wt(e,"number",ft),Et=e=>!!e&&Number.isInteger(Number(e)),R2=e=>e.endsWith("%")&&ft(e.slice(0,-1)),re=e=>Vi.test(e),Je=e=>P2.test(e),O2=new Set(["length","size","percentage"]),L2=e=>wt(e,O2,Ki),B2=e=>wt(e,"position",Ki),H2=new Set(["image","url"]),F2=e=>wt(e,H2,V2),W2=e=>wt(e,"",G2),Nt=()=>!0,wt=(e,t,n)=>{const o=Vi.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},q2=e=>I2.test(e)&&!z2.test(e),Ki=()=>!1,G2=e=>M2.test(e),V2=e=>D2.test(e),K2=()=>{const e=ge("colors"),t=ge("spacing"),n=ge("blur"),o=ge("brightness"),r=ge("borderColor"),i=ge("borderRadius"),a=ge("borderSpacing"),s=ge("borderWidth"),l=ge("contrast"),c=ge("grayscale"),m=ge("hueRotate"),u=ge("invert"),p=ge("gap"),f=ge("gradientColorStops"),h=ge("gradientColorStopPositions"),g=ge("inset"),b=ge("margin"),x=ge("opacity"),v=ge("padding"),T=ge("saturate"),I=ge("scale"),H=ge("sepia"),K=ge("skew"),_=ge("space"),F=ge("translate"),W=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",re,t],B=()=>[re,t],Q=()=>["",He,Qe],ae=()=>["auto",ft,re],ue=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],xe=()=>["","0",re],$e=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Pe=()=>[ft,re];return{cacheSize:500,separator:":",theme:{colors:[Nt],spacing:[He,Qe],blur:["none","",Je,re],brightness:Pe(),borderColor:[e],borderRadius:["none","","full",Je,re],borderSpacing:B(),borderWidth:Q(),contrast:Pe(),grayscale:xe(),hueRotate:Pe(),invert:xe(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[R2,Qe],inset:z(),margin:z(),opacity:Pe(),padding:B(),saturate:Pe(),scale:Pe(),sepia:xe(),skew:Pe(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Je]}],"break-after":[{"break-after":$e()}],"break-before":[{"break-before":$e()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ue(),re]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Et,re]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:xe()}],shrink:[{shrink:xe()}],order:[{order:["first","last","none",Et,re]}],"grid-cols":[{"grid-cols":[Nt]}],"col-start-end":[{col:["auto",{span:["full",Et,re]},re]}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":[Nt]}],"row-start-end":[{row:["auto",{span:[Et,re]},re]}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[Je]},Je]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Je,Qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gn]}],"font-family":[{font:[Nt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",ft,Gn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",He,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",He,Qe]}],"underline-offset":[{"underline-offset":["auto",He,re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ue(),B2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",L2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},F2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:ee()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[He,re]}],"outline-w":[{outline:[He,Qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[He,Qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Je,W2]}],"shadow-color":[{shadow:[Nt]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Je,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[u]}],saturate:[{saturate:[T]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:Pe()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:Pe()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[I]}],"scale-x":[{"scale-x":[I]}],"scale-y":[{"scale-y":[I]}],rotate:[{rotate:[Et,re]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[K]}],"skew-y":[{"skew-y":[K]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[He,Qe,Gn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},U2=E2(K2);function ke(...e){return U2(Fi(e))}const Ui=P.createContext(null);function X2(){const e=P.useContext(Ui);if(!e)throw new Error("useContextMenu must be used inside <ContextMenuHost>");return e}const nn=8;function Y2({children:e}){const[t,n]=P.useState({open:!1,x:0,y:0,items:[]}),[o,r]=P.useState(null),i=P.useRef(null),a=P.useCallback(()=>{n(c=>c.open?{...c,open:!1}:c)},[]),s=P.useCallback((c,m,u)=>{r(null),n({open:!0,x:c,y:m,items:u})},[]),l=P.useMemo(()=>({open:s,close:a}),[s,a]);return P.useLayoutEffect(()=>{if(!t.open||!i.current)return;const c=i.current.getBoundingClientRect();let m=t.x,u=t.y;m+c.width>window.innerWidth-nn&&(m=Math.max(nn,t.x-c.width)),u+c.height>window.innerHeight-nn&&(u=Math.max(nn,t.y-c.height)),r({left:m,top:u})},[t]),P.useEffect(()=>{if(!t.open)return;const c=f=>{i.current&&!i.current.contains(f.target)&&a()},m=f=>{f.key==="Escape"&&(f.preventDefault(),a())},u=()=>a(),p=()=>a();return document.addEventListener("pointerdown",c,!0),document.addEventListener("keydown",m,!0),window.addEventListener("wheel",u,{passive:!0}),window.addEventListener("blur",p),()=>{document.removeEventListener("pointerdown",c,!0),document.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",u),window.removeEventListener("blur",p)}},[t.open,a]),d.jsxs(Ui.Provider,{value:l,children:[e,t.open&&d.jsx("div",{ref:i,role:"menu","aria-orientation":"vertical",className:"ole-glass fixed z-50 min-w-[200px] rounded-md border border-border p-1 text-sm shadow-md",style:{left:(o==null?void 0:o.left)??t.x,top:(o==null?void 0:o.top)??t.y,visibility:o?"visible":"hidden"},onContextMenu:c=>c.preventDefault(),children:t.items.map((c,m)=>{if(c.type==="separator")return d.jsx("div",{role:"separator",className:"my-1 h-px bg-border"},`sep-${m}`);const u=c.icon;return d.jsxs("button",{type:"button",role:"menuitem",disabled:c.disabled,className:ke("flex w-full items-center justify-between gap-3 rounded-sm px-2 py-1.5 text-left","hover:bg-accent hover:text-accent-foreground","focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:outline-none",c.destructive&&"text-destructive hover:bg-destructive/10 hover:text-destructive",c.disabled&&"pointer-events-none text-muted-foreground opacity-60"),onClick:()=>{a(),c.onSelect()},children:[d.jsxs("span",{className:"flex items-center gap-2",children:[u?d.jsx(u,{className:"size-4"}):null,d.jsx("span",{children:c.label})]}),c.shortcut?d.jsx("span",{className:"text-xs text-muted-foreground",children:c.shortcut}):null]},`${c.label}-${m}`)})})]})}const hr=e=>{let t;const n=new Set,o=(c,m)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const p=t;t=m??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(f=>f(t,p))}},r=()=>t,s={setState:o,getState:r,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(o,r,s);return s},Z2=(e=>e?hr(e):hr),Q2=e=>e;function J2(e,t=Q2){const n=P.useSyncExternalStore(e.subscribe,P.useCallback(()=>t(e.getState()),[e,t]),P.useCallback(()=>t(e.getInitialState()),[e,t]));return P.useDebugValue(n),n}const fr=e=>{const t=Z2(e),n=o=>J2(t,o);return Object.assign(n,t),n},An=(e=>e?fr(e):fr),eS={"common.unnamed":"Sin título","common.close":"Cerrar","common.yes":"Sí","common.no":"No","topbar.theme.toLight":"Cambiar a claro","topbar.theme.toDark":"Cambiar a oscuro","topbar.theme.currentDark":"Actual: tema oscuro","topbar.theme.currentLight":"Actual: tema claro","topbar.lang.toEnglish":"Cambiar a inglés","topbar.lang.toChinese":"Cambiar a chino","topbar.lang.currentEnglish":"Actual: inglés","topbar.lang.currentChinese":"Actual: chino","topbar.export.label":"Exportar","topbar.export.tooltip":"SVG vectorial (editable), mapa de bits PNG (2× HiDPI) o DXF (CAD)","topbar.export.pngFailed":"Error al exportar PNG: {err}","topbar.export.dxfFailed":"Error al exportar DXF: {err}","topbar.file.label":"Archivo","topbar.file.tooltip":"Abrir un diagrama .json local, guardar o guardar como","topbar.file.current":"Actual: {name}","topbar.file.new":"Nuevo","topbar.file.open":"Abrir…","topbar.file.save":"Guardar","topbar.file.saveAs":"Guardar como…","topbar.file.newConfirm":"Crear uno nuevo descartará los cambios sin guardar. ¿Continuar?","topbar.file.openFailed":"Error al abrir: {err}","topbar.file.saveFailed":"Error al guardar: {err}","topbar.file.fileDescription":"Diagrama de OneLineEditor","outline.title":"Esquema","outline.collapse":"Contraer","outline.collapseAria":"Contraer esquema","outline.empty":"(Sin elementos — arrastra desde la biblioteca para empezar)","props.title":"Propiedades","props.node":"Nodo eléctrico","props.wire":"Cable","props.bus":"Barra","props.junction":"Empalme","props.junctionPos":"Posición","props.nSelected":"{n} seleccionados","props.empty":"Nada seleccionado","props.multi":"{n} elementos seleccionados","props.name":"Nombre","props.note":"Nota","props.label":"Etiqueta","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nodo eléctrico {id} no encontrado","props.wireNotFound":"Cable {id} no encontrado","props.nodeStats":"{terminals} terminales · {elements} elementos","props.selectElement":"Seleccionar {label}","props.selectWholeNode":"Seleccionar todo el nodo eléctrico","props.annText":"Texto","props.annRect":"Rectángulo","props.annLine":"Línea","props.annTable":"Tabla","props.annNotFound":"Anotación {id} no encontrada","props.annLabel":"Etiqueta","props.annLabelPlaceholder":"ej.: Tablero n.º 1","props.annStroke":"Trazo","props.annStrokeSolid":"Sólido","props.annStrokeDashed":"Discontinuo","props.annFill":"Relleno","props.annFillNone":"Ninguno","props.annFillTint":"Tinte","props.annArrow":"Flechas","props.annArrowNone":"Ninguna","props.annArrowEnd":"Un extremo","props.annArrowBoth":"Ambos extremos","props.annFontSize":"Tamaño de fuente","props.annRows":"Filas","props.annCols":"Columnas","view.zoomOut":"Alejar","view.zoomOutHint":"Aleja un nivel; también rueda ↓ o ⌘−","view.reset":"Restablecer a 100%","view.current":"Actual {z}%","view.zoomIn":"Acercar","view.zoomInHint":"Acerca un nivel; también rueda ↑ o ⌘+","view.fit":"Ajustar vista","view.fitHint":"Ajusta el zoom y centra todos los elementos automáticamente","view.gridHide":"Ocultar cuadrícula","view.gridShow":"Mostrar cuadrícula","view.gridHotkey":"G","view.gridHideHint":"También desactiva el ajuste a cuadrícula (colocación libre)","view.gridShowHint":"También activa el ajuste a cuadrícula (ajusta a 10px al arrastrar)","view.gridHideAria":"Ocultar cuadrícula y desactivar ajuste","view.gridShowAria":"Mostrar cuadrícula y activar ajuste","view.label":"Etiquetas","view.labelOff":"Ninguna","view.labelId":"ID","view.labelAll":"ID + parámetros","view.labelHint":"Visibilidad y tamaño de las etiquetas (también en la exportación)","view.labelSize":"Tamaño","view.labelSizeSmaller":"Reducir el tamaño de las etiquetas","view.labelSizeLarger":"Aumentar el tamaño de las etiquetas","view.labelSizeReset":"Restablecer el tamaño de las etiquetas","library.title":"Biblioteca","library.empty":"No hay elementos coincidentes","library.searchPlaceholder":"Buscar elementos…","library.searchAria":"Buscar elementos","library.clearSearch":"Borrar búsqueda","library.itemHint":"Haz clic para entrar en modo de colocación, o arrastra al lienzo","tool.select":"Seleccionar","tool.selectHint":"Clic para elegir, arrastra un marco para varios, clic derecho para el menú","tool.pan":"Desplazar","tool.panHint":"Arrastra el lienzo; la barra espaciadora lo activa temporalmente","tool.wire":"Cable","tool.wireHint":"Arrastra desde un pin/barra/empalme; soltar en espacio vacío crea un empalme, soltar sobre un cable lo conecta","tool.bus":"Barra","tool.busHint":"Arrastra en el lienzo: pulsa para fijar el inicio, suelta para fijar el final","tool.junction":"Empalme","tool.junctionHint":"Haz clic en el lienzo para colocar un empalme (nodo); los cables se conectan a él libremente","tool.place":"Colocar","tool.placeHint":"Haz clic para colocar; o arrastra desde un terminal/barra para colocar y conectar","tool.text":"Texto","tool.textHint":"Haz clic en el lienzo para colocar una nota de texto; haz doble clic en una existente para editarla","tool.rect":"Rectángulo","tool.rectHint":"Arrastra para dibujar un rectángulo / marco de grupo (discontinuo por defecto); Mayús para un cuadrado","tool.line":"Línea","tool.lineHint":"Arrastra para dibujar una línea de anotación; Mayús ajusta a 45°; las flechas se configuran en el panel","tool.table":"Tabla","tool.tableHint":"Arrastra para definir columnas × filas (conteo en vivo), o haz clic para una tabla predeterminada; haz doble clic en las celdas para escribir","mode.selectWithSel":"Arrastra elementos · arrastra terminales para conectar · clic derecho para el menú","mode.selectEmpty":"Clic para elegir · arrastra para mover · marco para varios · clic derecho para el menú","mode.pan":"Arrastra el lienzo · desplaza la rueda para hacer zoom · mantén Espacio para desplazar en cualquier herramienta","mode.wireDragging":"Suelta sobre un pin/barra/empalme; soltar en espacio vacío crea un empalme","mode.wireInit":"Pulsa sobre cualquier punto de conexión o espacio vacío, arrastra hasta el destino y suelta","mode.busDragging":"Arrastrar fija la dirección de la barra; soltar fija el final","mode.busInit":"Pulsa en el lienzo para fijar el inicio, arrastra y suelta para fijar el final","mode.junction":"Haz clic en el lienzo para colocar un empalme","mode.placeNoKind":"Elige un tipo de elemento de la biblioteca a la izquierda","mode.placeFromTerm":"Suelta en el destino — el nuevo elemento se conectará al terminal de origen","mode.placeNormal":"Haz clic en un espacio vacío para colocar; o arrastra desde un terminal / barra para colocar y conectar","mode.text":"Clic para colocar texto · doble clic para editar · arrastra la selección para mover · Supr para eliminar","mode.rect":"Arrastra para dibujar un rectángulo · Mayús para cuadrado · redimensiona y etiqueta al soltar","mode.line":"Arrastra para dibujar una línea · Mayús ajusta a 45° · añade flechas en el panel al soltar","mode.table":"Arrastra para definir la cuadrícula, o haz clic para una tabla de 3×3 · doble clic en las celdas para escribir","mode.annTextSel":"Haz clic en el texto para editar · arrastra para mover · Supr para eliminar","mode.annTableSel":"Haz clic en una celda para completarla · arrastra para mover · Supr para eliminar","mode.annShapeSel":"Arrastra para mover · arrastra los controladores para redimensionar · cambia el estilo en el panel · Supr para eliminar","mode.annEditing":"Escribe · Intro para confirmar · Esc para cancelar · o los botones ✓ / ✕","mode.escSelect":"Esc borra la selección","mode.escOther":"Clic derecho / Esc para cancelar","tool.placeNoKindTooltip":"Elige un tipo en la biblioteca a la izquierda y luego haz clic en el lienzo","tool.undo":"Deshacer","tool.undoHint":"Deshace la última edición (mover / rotar / eliminar, etc.)","tool.redo":"Rehacer","tool.redoHint":"Rehace la última edición deshecha","layout.label":"Diseño","layout.hint":"Organiza automáticamente todo el diagrama o solo la selección, y rellena los huecos","layout.allAuto":"Organizar todo automáticamente","layout.selAuto":"Organizar la selección automáticamente","layout.allFill":"Rellenar sin colocar","layout.selFill":"Rellenar los no colocados en la selección","tool.more":"Más","tool.moreHint":"Deshacer / rehacer / diseño","view.menu":"Vista","view.menuHint":"Zoom, ajuste, cuadrícula","ctx.ariaNode":"Acciones del nodo","ctx.ariaWire":"Acciones del cable","ctx.ariaElement":"Acciones del elemento","ctx.ariaEdit":"Acciones de edición","ctx.done":"Listo","ctx.cancel":"Cancelar","ctx.rotate":"Rotar 90°","ctx.rotateHint":"Rota la selección en sentido horario; los cables se re-enrutan a los nuevos terminales","ctx.mirror":"Reflejar horizontalmente","ctx.mirrorTitle":"Reflejar","ctx.mirrorHint":"Invierte la selección de izquierda a derecha","ctx.delete":"Eliminar","ctx.deleteHintNode":"Desconecta todos los cables de este nodo (los elementos permanecen)","ctx.deleteHintWire":"Elimina solo este cable (los demás del mismo nodo permanecen)","ctx.deleteHintElement":"Elimina la selección y sus cables","ctx.resetWirePath":"Restablecer al enrutado automático","ctx.resetWirePathHint":"Descarta los ángulos manuales y deja que el enrutador vuelva a trazar este cable","menu.undo":"Deshacer","menu.redo":"Rehacer","menu.cut":"Cortar","menu.copy":"Copiar","menu.paste":"Pegar","menu.rotate":"Rotar 90°","menu.mirror":"Reflejar","menu.selectAll":"Seleccionar todo","menu.disconnect":"Desconectar este cable","menu.delete":"Eliminar","io.parseFailed":"Error al analizar JSON: {err}","io.notObject":"El archivo no es un objeto JSON","io.versionMismatch":'Versión incompatible: se esperaba "1", se obtuvo {actual}',"io.elementsMissing":"`elements` falta o no es un array","compile.duplicateId":'ID de elemento duplicado: "{id}"',"compile.unknownKind":'Tipo de elemento desconocido kind="{kind}"',"compile.invalidTermRef":'Referencia de terminal no válida "{ref}"',"compile.elementMissing":'Referencia a un elemento desconocido "{id}"',"compile.missingPin":'El elemento "{id}" (kind={kind}) no tiene el pin "{pin}"; disponibles: {available}',"compile.singleTerminal":"El nodo solo tiene un terminal — ignorado","compile.layoutMissingElement":'La clave de layout "{id}" hace referencia a un elemento desconocido',"compile.elementUnconnected":'El elemento "{id}" no tiene conexiones',"cat.busbar":"Barras / cableado","cat.switching":"Conmutación","cat.protection":"Protección","cat.motor-control":"Control de motores","cat.transformer":"Transformadores","cat.instrument-transformer":"Transformadores de medida","cat.measurement":"Medición","cat.source":"Fuentes","cat.load":"Cargas","cat.storage":"Almacenamiento","cat.compensation":"Compensación","cat.grounding":"Puesta a tierra","cat.renewable":"Renovables / electrónica de potencia","onboard.title":"Inicio rápido","onboard.step1.title":"Coloca un componente","onboard.step1.body":"Elige la herramienta Colocar (P) y arrastra un tipo de la biblioteca al lienzo","onboard.step2.title":"Conéctalo","onboard.step2.body":"Usa la herramienta Cable (W): arrastra de un pin a otro — arrastra a un espacio vacío para crear un empalme","onboard.step3.title":"Una barra es un riel compartido, no un cable","onboard.step3.body":"Usa la herramienta Barra (B) solo cuando varios circuitos comparten un mismo riel. No uses una barra para unir dos dispositivos — simplemente conecta los pines con un cable (W).","onboard.dismiss":"Entendido"},tS={"arc-suppression-coil.name":"Bobina de extinción de arco","arrester.name":"Descargador de sobretensiones (FBL)","async-motor.name":"Motor asíncrono","autotransformer.name":"Autotransformador","battery.name":"Almacenamiento en batería","breaker.name":"Interruptor automático (QF)","busbar.name":"Tramo de barra","converter-bidir.name":"Convertidor bidireccional (PCS)","dc-dc-converter.name":"Convertidor CC/CC","mppt.name":"Controlador MPPT","ct.name":"Transformador de corriente (CT)","disconnector.name":"Seccionador (QS)","earth.name":"Tierra","earthing-switch.name":"Seccionador de puesta a tierra (QE)","fuse.name":"Fusible (FU)","generator.name":"Generador (G)","grid-source.name":"Fuente de red","grounding-transformer.name":"Transformador de puesta a tierra (zig-zag)","inverter.name":"Inversor (CC→CA)","load-switch.name":"Interruptor de carga","load.name":"Carga","luminaire.name":"Luminaria (carga de alumbrado)","panelboard.name":"Tablero de distribución","ngr.name":"Resistencia de puesta a tierra del neutro (NGR)","pt.name":"Transformador de tensión (PT)","pv.name":"Módulo fotovoltaico","rectifier.name":"Rectificador (CA→CC)","series-reactor.name":"Reactor serie","shunt-capacitor.name":"Condensador en derivación","shunt-reactor.name":"Reactor en derivación","sync-motor.name":"Motor síncrono","transformer-2w.name":"Transformador de dos devanados","transformer-3w.name":"Transformador de tres devanados","wind-turbine.name":"Aerogenerador","gfci-breaker.name":"Interruptor GFCI (RCBO)","rcd.name":"Dispositivo de corriente residual (RCD)","recloser.name":"Reconectador","energy-meter.name":"Medidor de energía (Wh)","voltmeter.name":"Voltímetro (V)","ammeter.name":"Amperímetro (A)","wattmeter.name":"Vatímetro (W)","frequency-meter.name":"Frecuencímetro (Hz)","contactor.name":"Contactor (KM)","motor-starter.name":"Arrancador de motor","thermal-overload.name":"Relé de sobrecarga térmica","vfd.name":"Variador de frecuencia (VFD)","soft-starter.name":"Arrancador suave","transfer-switch.name":"Conmutador de transferencia (ATS)","dc-disconnector.name":"Seccionador de CC","dc-combiner.name":"Caja combinadora de CC","ev-charger.name":"Cargador de VE","arc-suppression-coil.desc":"Puesta a tierra resonante del neutro: inductor a tierra","busbar.desc":"Tramo de barra única extensible con múltiples derivaciones","converter-bidir.desc":"Convertidor de almacenamiento: CA ↔ CC bidireccional","dc-dc-converter.desc":"Convertidor CC/CC / cargador CC (IEC 60617)","mppt.desc":"Controlador de carga solar MPPT (CC/CC, seguimiento del punto de máxima potencia)","earthing-switch.desc":"Seccionador + conexión a tierra, un solo puerto","grid-source.desc":"Barra infinita / red externa","grounding-transformer.desc":"Transformador estrella-zigzag para puesta a tierra del neutro","load.desc":"Carga abstracta (flecha de salida de corriente)","luminaire.desc":"Carga de alumbrado (símbolo general de luminaria IEC 60617)","ngr.desc":"Puesta a tierra de baja resistencia: neutro del transformador a tierra","series-reactor.desc":"Mismo símbolo que el reactor en derivación; se distingue por el uso","wind-turbine.desc":"Turbina eólica: generador + marca de rotor de tres palas","gfci-breaker.desc":"Interruptor de corriente residual con protección de sobrecorriente (UL943 / IEC 61009). GFCI en Norteamérica / RCBO en Europa.","rcd.desc":"Interruptor de corriente residual sin protección de sobrecorriente (IEC 61008).","recloser.desc":"Reconectador automático de media tensión.","energy-meter.desc":"Medidor de energía activa (kWh) — acometida / submedición.","contactor.desc":"Contactor de circuito principal; se usa normalmente con un relé de sobrecarga térmica y un motor.","motor-starter.desc":"Arrancador de motor (símbolo general IEC 60617).","thermal-overload.desc":"Relé de sobrecarga térmica del motor; se ubica entre el contactor y el motor.","vfd.desc":"Variador de frecuencia para el control de velocidad de motores de inducción.","soft-starter.desc":"Arrancador suave de motor (arranque a tensión reducida basado en tiristores).","transfer-switch.desc":"Conmutador de transferencia de dos fuentes (ATS / manual). Dos entradas de fuente + una salida de carga, con enclavamiento mecánico.","dc-disconnector.desc":"Seccionador de CC — aislamiento del lado de CC de cadenas fotovoltaicas / baterías.","dc-combiner.desc":"Caja combinadora de cadenas fotovoltaicas (ejemplo de 4 entradas).","ev-charger.desc":"Estación de carga para vehículos eléctricos.","breaker.state.open":"Abierto","disconnector.state.open":"Abierto","earthing-switch.state.open":"Abierto","fuse.state.blown":"Fundido","load-switch.state.open":"Abierto","gfci-breaker.state.open":"Abierto","rcd.state.open":"Abierto","recloser.state.open":"Abierto","contactor.state.open":"Abierto","thermal-overload.state.tripped":"Disparado","transfer-switch.state.position":"Posición (normal/emergencia/apagado)","dc-disconnector.state.open":"Abierto","battery.param.E":"Capacidad","busbar.param.Un":"Tensión nominal","converter-bidir.param.S":"Capacidad","dc-dc-converter.param.P":"Potencia","mppt.param.I":"Corriente nominal","load.param.P":"Potencia activa","load.param.cosphi":"Factor de potencia","ngr.param.R":"Resistencia","shunt-capacitor.param.Q":"Potencia reactiva","shunt-capacitor.param.stages":"Etapas","transformer-2w.param.S":"Capacidad","transformer-2w.param.ratio":"Relación de transformación","gfci-breaker.param.In":"Corriente nominal","gfci-breaker.param.IDn":"Corriente diferencial de actuación","rcd.param.IDn":"Corriente diferencial de actuación","breaker.param.In":"Corriente nominal","breaker.param.poles":"Polos","breaker.param.Icu":"Poder de corte","disconnector.param.In":"Corriente nominal","fuse.param.In":"Corriente nominal","resistor.name":"Resistor (R)","capacitor.name":"Condensador (C)","diode.name":"Diodo (D)","indicator-light.name":"Luz indicadora (HL)","push-button.name":"Pulsador (SB)","relay-coil.name":"Bobina de relé (KA)","make-contact.name":"Contacto normalmente abierto (NO)","break-contact.name":"Contacto normalmente cerrado (NC)","bell.name":"Timbre (HA)","terminal.name":"Terminal / empalme (X)","fuse-switch-disconnector.name":"Seccionador-fusible","socket-outlet.name":"Toma de corriente / conector","inductor.name":"Inductor (L)","voltage-regulator.name":"Regulador de tensión (T)","dc-motor.name":"Motor de CC (M)","heater.name":"Elemento calefactor (EH)","selector-switch.name":"Conmutador selector (SA)","limit-switch.name":"Interruptor de límite (SQ)","proximity-switch.name":"Interruptor de proximidad (SQ)","time-relay.name":"Relé de tiempo (KT)","buzzer.name":"Zumbador (HA)","siren.name":"Sirena (HA)","thermocouple.name":"Termopar (BT)","thyristor.name":"Tiristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diodo Zener (D)","igbt.name":"IGBT","plc.name":"PLC / controlador","ups.name":"SAI (UPS)","power-supply.name":"Fuente de alimentación (PS)","genset.name":"Grupo electrógeno (G)","protective-relay.name":"Relé de protección","overcurrent-relay.name":"Relé de sobrecorriente (50/51)","undervoltage-relay.name":"Relé de baja tensión (27)","reverse-power-relay.name":"Relé de potencia inversa (32)","distance-relay.name":"Relé de distancia (21)","phase-failure-relay.name":"Relé de falla de fase","buchholz-relay.name":"Relé Buchholz (63)","power-factor-meter.name":"Medidor de factor de potencia (cosφ)","synchronoscope.name":"Sincronoscopio","varmeter.name":"Varímetro (var)","resistor.desc":"Resistor general / limitador de corriente / resistor de frenado.","capacitor.desc":"Condensador general / de filtro / del bus de CC. Usa el condensador en derivación para corrección del factor de potencia.","diode.desc":"Diodo rectificador / de rueda libre / de protección. t1 = ánodo (arriba), t2 = cátodo (abajo).","indicator-light.desc":"Luz indicadora de señal / estado.","push-button.desc":"Pulsador manual con retorno automático (contacto NA).","relay-coil.desc":"Bobina de accionamiento de relé / contactor (caja).","make-contact.desc":"Contacto auxiliar normalmente abierto (NA).","break-contact.desc":"Contacto auxiliar normalmente cerrado (NC).","bell.desc":"Timbre de señal / alarma.","terminal.desc":"Terminal / caja de empalme / nodo de conexión.","fuse-switch-disconnector.desc":"Seccionador-fusible bajo carga.","socket-outlet.desc":"Toma de corriente / conector multipolar.","inductor.desc":"Inductor general / bobina / choque.","voltage-regulator.desc":"Regulador de tensión de inducción / autotransformador ajustable.","dc-motor.desc":"Motor de CC (símbolo general de excitación serie).","heater.desc":"Elemento calefactor resistivo / carga de calefacción.","selector-switch.desc":"Conmutador selector / de cambio (rotativo, de posición fija).","limit-switch.desc":"Interruptor de carrera / posición (NA, accionamiento mecánico).","proximity-switch.desc":"Sensor de proximidad / interruptor de proximidad sin contacto.","time-relay.desc":"Bobina de relé de temporización (acción retardada).","buzzer.desc":"Zumbador de señal.","siren.desc":"Sirena / alarma sonora.","thermocouple.desc":"Sensor de temperatura de termopar.","thyristor.desc":"Tiristor triodo de bloqueo inverso / SCR. t1 = ánodo (arriba), t2 = cátodo (abajo).","triac.desc":"Tiristor triodo bidireccional (TRIAC).","zener-diode.desc":"Diodo Zener / regulador de tensión. t1 = ánodo (arriba), t2 = cátodo (abajo).","igbt.desc":"IGBT de canal N en modo de enriquecimiento. t1 = colector (arriba), t2 = emisor (abajo), t_g = puerta.","plc.desc":"Controlador lógico programable (PLC).","ups.desc":"Sistema de alimentación ininterrumpida en línea / en espera (UPS).","power-supply.desc":"Fuente de alimentación conmutada CA→CC / fuente de CC. t_ac arriba (~), t_dc abajo (=).","genset.desc":"Grupo electrógeno diésel / a gas.","protective-relay.desc":"Relé de medida / protección, símbolo general (IEC 60617).","overcurrent-relay.desc":"Relé de protección de sobrecorriente (ANSI 50/51).","undervoltage-relay.desc":"Relé de protección de baja tensión (ANSI 27).","reverse-power-relay.desc":"Relé de protección de potencia inversa / corriente inversa (ANSI 32).","distance-relay.desc":"Relé de protección de distancia / baja impedancia (ANSI 21).","phase-failure-relay.desc":"Relé de protección de falla de fase / pérdida de fase.","buchholz-relay.desc":"Relé Buchholz / de gas (ANSI 63).","power-factor-meter.desc":"Medidor de factor de potencia (cosφ).","synchronoscope.desc":"Indicador de sincronización / sincronoscopio.","varmeter.desc":"Medidor de potencia reactiva (var).","make-contact.state.closed":"Cerrado","break-contact.state.open":"Abierto","fuse-switch-disconnector.state.open":"Abierto","selector-switch.state.open":"Abierto","limit-switch.state.closed":"Cerrado","resistor.param.R":"Resistencia","resistor.param.P":"Potencia nominal","capacitor.param.C":"Capacitancia","capacitor.param.Un":"Tensión nominal","indicator-light.param.color":"Color","inductor.param.L":"Inductancia","inductor.param.In":"Corriente nominal","voltage-regulator.param.ratio":"Rango de regulación","heater.param.P":"Potencia","ups.param.S":"Capacidad","power-supply.param.Vdc":"Tensión de salida","genset.param.P":"Potencia"},nS={ui:eS,library:tS},oS={"common.unnamed":"Sans titre","common.close":"Fermer","common.yes":"Oui","common.no":"Non","topbar.theme.toLight":"Passer au thème clair","topbar.theme.toDark":"Passer au thème sombre","topbar.theme.currentDark":"Actuel : thème sombre","topbar.theme.currentLight":"Actuel : thème clair","topbar.lang.toEnglish":"Passer à l'anglais","topbar.lang.toChinese":"Passer au chinois","topbar.lang.currentEnglish":"Actuel : anglais","topbar.lang.currentChinese":"Actuel : chinois","topbar.export.label":"Exporter","topbar.export.tooltip":"SVG vectoriel (modifiable), PNG bitmap (2× HiDPI) ou DXF (CAO)","topbar.export.pngFailed":"Échec de l'export PNG : {err}","topbar.export.dxfFailed":"Échec de l'export DXF : {err}","topbar.file.label":"Fichier","topbar.file.tooltip":"Ouvrir un schéma .json local, enregistrer, ou enregistrer sous","topbar.file.current":"Actuel : {name}","topbar.file.new":"Nouveau","topbar.file.open":"Ouvrir…","topbar.file.save":"Enregistrer","topbar.file.saveAs":"Enregistrer sous…","topbar.file.newConfirm":"Créer un nouveau schéma effacera les modifications non enregistrées. Continuer ?","topbar.file.openFailed":"Échec de l'ouverture : {err}","topbar.file.saveFailed":"Échec de l'enregistrement : {err}","topbar.file.fileDescription":"Schéma OneLineEditor","outline.title":"Plan","outline.collapse":"Réduire","outline.collapseAria":"Réduire le plan","outline.empty":"(Aucun élément — glissez depuis la bibliothèque pour commencer)","props.title":"Propriétés","props.node":"Nœud électrique","props.wire":"Fil","props.bus":"Jeu de barres","props.junction":"Jonction","props.junctionPos":"Position","props.nSelected":"{n} sélectionné(s)","props.empty":"Aucune sélection","props.multi":"{n} éléments sélectionnés","props.name":"Nom","props.note":"Note","props.label":"Repère","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nœud électrique {id} introuvable","props.wireNotFound":"Fil {id} introuvable","props.nodeStats":"{terminals} bornes · {elements} éléments","props.selectElement":"Sélectionner {label}","props.selectWholeNode":"Sélectionner tout le nœud électrique","props.annText":"Texte","props.annRect":"Rectangle","props.annLine":"Ligne","props.annTable":"Tableau","props.annNotFound":"Annotation {id} introuvable","props.annLabel":"Étiquette","props.annLabelPlaceholder":"ex. : Tableau n°1","props.annStroke":"Trait","props.annStrokeSolid":"Continu","props.annStrokeDashed":"Pointillé","props.annFill":"Remplissage","props.annFillNone":"Aucun","props.annFillTint":"Teinte","props.annArrow":"Flèches","props.annArrowNone":"Aucune","props.annArrowEnd":"Extrémité","props.annArrowBoth":"Les deux","props.annFontSize":"Taille de police","props.annRows":"Lignes","props.annCols":"Colonnes","view.zoomOut":"Zoom arrière","view.zoomOutHint":"Zoom arrière par palier ; aussi molette ↓ ou ⌘−","view.reset":"Réinitialiser à 100 %","view.current":"Actuel {z} %","view.zoomIn":"Zoom avant","view.zoomInHint":"Zoom avant par palier ; aussi molette ↑ ou ⌘+","view.fit":"Ajuster la vue","view.fitHint":"Zoom automatique et centrage de tous les éléments","view.gridHide":"Masquer la grille","view.gridShow":"Afficher la grille","view.gridHotkey":"G","view.gridHideHint":"Désactive aussi l'aimantation à la grille (placement libre)","view.gridShowHint":"Active aussi l'aimantation à la grille (alignement sur 10 px au glisser)","view.gridHideAria":"Masquer la grille et désactiver l'aimantation","view.gridShowAria":"Afficher la grille et activer l'aimantation","view.label":"Étiquettes","view.labelOff":"Aucune","view.labelId":"ID","view.labelAll":"ID + paramètres","view.labelHint":"Visibilité et taille des étiquettes (export compris)","view.labelSize":"Taille","view.labelSizeSmaller":"Réduire la taille des étiquettes","view.labelSizeLarger":"Agrandir la taille des étiquettes","view.labelSizeReset":"Réinitialiser la taille des étiquettes","library.title":"Bibliothèque","library.empty":"Aucun élément correspondant","library.searchPlaceholder":"Rechercher des éléments…","library.searchAria":"Rechercher des éléments","library.clearSearch":"Effacer la recherche","library.itemHint":"Cliquez pour passer en mode placement, ou glissez sur le plan de travail","tool.select":"Sélection","tool.selectHint":"Cliquez pour choisir, tracez un cadre pour une sélection multiple, clic droit pour le menu","tool.pan":"Déplacement","tool.panHint":"Faites glisser le plan de travail ; Espace bascule temporairement","tool.wire":"Fil","tool.wireHint":"Glissez depuis une borne/un jeu de barres/une jonction ; vers un espace vide crée une jonction, sur un fil crée un piquage","tool.bus":"Jeu de barres","tool.busHint":"Glissez sur le plan de travail — appuyez pour définir le début, relâchez pour définir la fin","tool.junction":"Jonction","tool.junctionHint":"Cliquez sur le plan de travail pour placer une jonction (nœud) ; les fils s'y raccordent librement","tool.place":"Placer","tool.placeHint":"Cliquez pour placer ; ou glissez depuis une borne/un jeu de barres pour placer et connecter","tool.text":"Texte","tool.textHint":"Cliquez sur le plan de travail pour placer une note texte ; double-cliquez sur une note existante pour la modifier","tool.rect":"Rectangle","tool.rectHint":"Glissez pour dessiner un rectangle / cadre de groupe (pointillé par défaut) ; Maj pour un carré","tool.line":"Ligne","tool.lineHint":"Glissez pour dessiner une ligne d'annotation ; Maj aligne à 45° ; les flèches se règlent dans le panneau","tool.table":"Tableau","tool.tableHint":"Glissez pour définir colonnes × lignes (comptage en direct), ou cliquez pour un tableau par défaut ; double-cliquez sur les cellules pour saisir du texte","mode.selectWithSel":"Glissez les éléments · glissez les bornes pour câbler · clic droit pour le menu","mode.selectEmpty":"Cliquez pour choisir · glissez pour déplacer · tracez un cadre pour une sélection multiple · clic droit pour le menu","mode.pan":"Glissez le plan de travail · molette pour zoomer · maintenez Espace pour déplacer avec n'importe quel outil","mode.wireDragging":"Relâchez sur une borne/un jeu de barres/une jonction ; relâcher dans un espace vide crée une jonction","mode.wireInit":"Appuyez sur un point de connexion ou un espace vide, glissez vers une cible et relâchez","mode.busDragging":"Le glissement définit la direction du jeu de barres ; le relâchement définit la fin","mode.busInit":"Appuyez sur le plan de travail pour définir le début, glissez, relâchez pour définir la fin","mode.junction":"Cliquez sur le plan de travail pour placer une jonction","mode.placeNoKind":"Choisissez un type d'élément dans la bibliothèque à gauche","mode.placeFromTerm":"Relâchez sur la cible — le nouvel élément se connectera à la borne source","mode.placeNormal":"Cliquez sur un espace vide pour placer ; ou glissez depuis une borne / un jeu de barres pour placer et connecter","mode.text":"Cliquez pour placer du texte · double-cliquez pour modifier · glissez la sélection pour déplacer · Suppr pour retirer","mode.rect":"Glissez pour dessiner un rectangle · Maj pour un carré · redimensionnez et nommez-le après relâchement","mode.line":"Glissez pour dessiner une ligne · Maj aligne à 45° · ajoutez des flèches dans le panneau après relâchement","mode.table":"Glissez pour définir la grille, ou cliquez pour un tableau 3×3 · double-cliquez sur les cellules pour saisir du texte","mode.annTextSel":"Cliquez sur le texte pour modifier · glissez pour déplacer · Suppr pour retirer","mode.annTableSel":"Cliquez sur une cellule pour la remplir · glissez pour déplacer · Suppr pour retirer","mode.annShapeSel":"Glissez pour déplacer · glissez les poignées pour redimensionner · modifiez le style dans le panneau · Suppr pour retirer","mode.annEditing":"Saisissez · Entrée pour valider · Échap pour annuler · ou les boutons ✓ / ✕","mode.escSelect":"Échap efface la sélection","mode.escOther":"Clic droit / Échap pour annuler","tool.placeNoKindTooltip":"Choisissez un type dans la bibliothèque à gauche, puis cliquez sur le plan de travail","tool.undo":"Annuler","tool.undoHint":"Annule la dernière modification (déplacement / rotation / suppression, etc.)","tool.redo":"Rétablir","tool.redoHint":"Rétablit la dernière modification annulée","layout.label":"Disposition","layout.hint":"Disposition automatique de tout le schéma ou de la sélection, comble les espaces vides","layout.allAuto":"Tout disposer automatiquement","layout.selAuto":"Disposer la sélection automatiquement","layout.allFill":"Combler les éléments non placés","layout.selFill":"Combler les éléments non placés de la sélection","tool.more":"Plus","tool.moreHint":"Annuler / rétablir / disposition","view.menu":"Affichage","view.menuHint":"Zoom, ajustement, grille","ctx.ariaNode":"Actions sur le nœud","ctx.ariaWire":"Actions sur le fil","ctx.ariaElement":"Actions sur l'élément","ctx.ariaEdit":"Actions d'édition","ctx.done":"Terminé","ctx.cancel":"Annuler","ctx.rotate":"Pivoter de 90°","ctx.rotateHint":"Fait pivoter la sélection dans le sens horaire ; les fils se réacheminent vers les nouvelles bornes","ctx.mirror":"Miroir horizontal","ctx.mirrorTitle":"Miroir","ctx.mirrorHint":"Retourne la sélection horizontalement","ctx.delete":"Supprimer","ctx.deleteHintNode":"Déconnecte tous les fils de ce nœud (les éléments restent)","ctx.deleteHintWire":"Retire uniquement ce fil (les autres fils du même nœud restent)","ctx.deleteHintElement":"Retire la sélection et ses fils","ctx.resetWirePath":"Revenir au routage automatique","ctx.resetWirePathHint":"Supprime les coudes manuels et laisse le routeur retracer ce fil","menu.undo":"Annuler","menu.redo":"Rétablir","menu.cut":"Couper","menu.copy":"Copier","menu.paste":"Coller","menu.rotate":"Pivoter de 90°","menu.mirror":"Miroir","menu.selectAll":"Tout sélectionner","menu.disconnect":"Déconnecter ce fil","menu.delete":"Supprimer","io.parseFailed":"Échec de l'analyse JSON : {err}","io.notObject":"Le fichier n'est pas un objet JSON","io.versionMismatch":"Version incompatible : attendu « 1 », obtenu {actual}","io.elementsMissing":"`elements` est manquant ou n'est pas un tableau","compile.duplicateId":"Identifiant d'élément dupliqué : « {id} »","compile.unknownKind":"Type d'élément inconnu kind=« {kind} »","compile.invalidTermRef":"Référence de borne invalide « {ref} »","compile.elementMissing":"Référence à un élément inconnu « {id} »","compile.missingPin":"L'élément « {id} » (kind={kind}) n'a pas de broche « {pin} » ; disponibles : {available}","compile.singleTerminal":"Le nœud n'a qu'une seule borne — ignoré","compile.layoutMissingElement":"la clé de disposition « {id} » référence un élément inconnu","compile.elementUnconnected":"L'élément « {id} » n'a aucune connexion","cat.busbar":"Jeux de barres / câblage","cat.switching":"Appareillage de coupure","cat.protection":"Protection","cat.motor-control":"Commande de moteur","cat.transformer":"Transformateur","cat.instrument-transformer":"Transformateur de mesure","cat.measurement":"Mesure","cat.source":"Source","cat.load":"Charge","cat.storage":"Stockage","cat.compensation":"Compensation","cat.grounding":"Mise à la terre","cat.renewable":"Énergies renouvelables / électronique de puissance","onboard.title":"Démarrage rapide","onboard.step1.title":"Placer un composant","onboard.step1.body":"Choisissez l'outil Placer (P) et glissez un type depuis la bibliothèque sur le plan de travail","onboard.step2.title":"Câblez-le","onboard.step2.body":"Utilisez l'outil Fil (W) : glissez d'une broche à une autre — glissez vers un espace vide pour créer une jonction","onboard.step3.title":"Un jeu de barres est un rail commun, pas un fil","onboard.step3.body":"Utilisez l'outil Jeu de barres (B) uniquement lorsque plusieurs circuits partagent un même rail. N'utilisez pas un jeu de barres pour relier deux appareils — câblez simplement les broches (W).","onboard.dismiss":"Compris"},rS={"arc-suppression-coil.name":"Bobine d'extinction d'arc","arrester.name":"Parafoudre (FBL)","async-motor.name":"Moteur asynchrone","autotransformer.name":"Autotransformateur","battery.name":"Stockage par batterie","breaker.name":"Disjoncteur (QF)","busbar.name":"Segment de jeu de barres","converter-bidir.name":"Convertisseur bidirectionnel (PCS)","dc-dc-converter.name":"Convertisseur DC/DC","mppt.name":"Régulateur MPPT","ct.name":"Transformateur de courant (CT)","disconnector.name":"Sectionneur (QS)","earth.name":"Terre","earthing-switch.name":"Sectionneur de terre (QE)","fuse.name":"Fusible (FU)","generator.name":"Générateur (G)","grid-source.name":"Source réseau","grounding-transformer.name":"Transformateur de mise à la terre (zigzag)","inverter.name":"Onduleur (DC→AC)","load-switch.name":"Interrupteur de charge","load.name":"Charge","luminaire.name":"Luminaire (charge d'éclairage)","panelboard.name":"Tableau de répartition","ngr.name":"Résistance de mise à la terre du neutre (NGR)","pt.name":"Transformateur de tension (PT)","pv.name":"Module photovoltaïque","rectifier.name":"Redresseur (AC→DC)","series-reactor.name":"Réactance série","shunt-capacitor.name":"Condensateur shunt","shunt-reactor.name":"Réactance shunt","sync-motor.name":"Moteur synchrone","transformer-2w.name":"Transformateur à deux enroulements","transformer-3w.name":"Transformateur à trois enroulements","wind-turbine.name":"Éolienne","gfci-breaker.name":"Disjoncteur différentiel (RCBO)","rcd.name":"Dispositif différentiel résiduel (RCD)","recloser.name":"Réenclencheur","energy-meter.name":"Compteur d'énergie (Wh)","voltmeter.name":"Voltmètre (V)","ammeter.name":"Ampèremètre (A)","wattmeter.name":"Wattmètre (W)","frequency-meter.name":"Fréquencemètre (Hz)","contactor.name":"Contacteur (KM)","motor-starter.name":"Démarreur de moteur","thermal-overload.name":"Relais thermique de surcharge","vfd.name":"Variateur de fréquence (VFD)","soft-starter.name":"Démarreur progressif","transfer-switch.name":"Commutateur de transfert (ATS)","dc-disconnector.name":"Sectionneur DC","dc-combiner.name":"Boîtier de raccordement DC","ev-charger.name":"Borne de recharge VE","arc-suppression-coil.desc":"Mise à la terre résonante du neutre : bobine reliée à la terre","busbar.desc":"Segment de jeu de barres simple extensible avec piquages multiples","converter-bidir.desc":"Convertisseur de stockage : bidirectionnel AC ↔ DC","dc-dc-converter.desc":"Convertisseur DC/DC / chargeur DC (IEC 60617)","mppt.desc":"Régulateur de charge solaire MPPT (DC/DC, recherche du point de puissance maximale)","earthing-switch.desc":"Sectionneur + liaison à la terre, à un seul accès","grid-source.desc":"Jeu de barres infini / réseau externe","grounding-transformer.desc":"Transformateur étoile-zigzag pour mise à la terre du neutre","load.desc":"Charge abstraite (flèche de sortie de courant)","luminaire.desc":"Charge d'éclairage (symbole général de luminaire CEI 60617)","ngr.desc":"Mise à la terre à faible résistance : neutre du transformateur relié à la terre","series-reactor.desc":"Même symbole que la réactance shunt ; distingué par l'usage","wind-turbine.desc":"Éolienne : génératrice + repère de rotor tripale","gfci-breaker.desc":"Disjoncteur différentiel avec protection contre les surintensités (UL943 / IEC 61009). GFCI en Amérique du Nord / RCBO en Europe.","rcd.desc":"Disjoncteur différentiel sans protection contre les surintensités (IEC 61008).","recloser.desc":"Réenclencheur automatique moyenne tension.","energy-meter.desc":"Compteur d'énergie active (kWh) — entrée de service / sous-comptage.","contactor.desc":"Contacteur de circuit principal ; généralement utilisé avec un relais thermique et un moteur.","motor-starter.desc":"Démarreur de moteur (symbole général IEC 60617).","thermal-overload.desc":"Relais thermique de surcharge moteur ; placé entre le contacteur et le moteur.","vfd.desc":"Variateur de fréquence pour le contrôle de vitesse des moteurs asynchrones.","soft-starter.desc":"Démarreur progressif de moteur (démarrage à tension réduite à base de thyristors).","transfer-switch.desc":"Commutateur de transfert à deux sources (ATS / manuel). Deux entrées source + une sortie charge, verrouillées mécaniquement.","dc-disconnector.desc":"Sectionneur DC — isolement côté DC d'une chaîne photovoltaïque / batterie.","dc-combiner.desc":"Boîtier de raccordement de chaînes photovoltaïques (exemple à 4 entrées).","ev-charger.desc":"Borne de recharge pour véhicule électrique.","breaker.state.open":"Ouvert","disconnector.state.open":"Ouvert","earthing-switch.state.open":"Ouvert","fuse.state.blown":"Fondu","load-switch.state.open":"Ouvert","gfci-breaker.state.open":"Ouvert","rcd.state.open":"Ouvert","recloser.state.open":"Ouvert","contactor.state.open":"Ouvert","thermal-overload.state.tripped":"Déclenché","transfer-switch.state.position":"Position (normal/secours/arrêt)","dc-disconnector.state.open":"Ouvert","battery.param.E":"Capacité","busbar.param.Un":"Tension nominale","converter-bidir.param.S":"Puissance apparente","dc-dc-converter.param.P":"Puissance","mppt.param.I":"Courant nominal","load.param.P":"Puissance active","load.param.cosphi":"Facteur de puissance","ngr.param.R":"Résistance","shunt-capacitor.param.Q":"Puissance réactive","shunt-capacitor.param.stages":"Gradins","transformer-2w.param.S":"Puissance apparente","transformer-2w.param.ratio":"Rapport de transformation","gfci-breaker.param.In":"Courant nominal","gfci-breaker.param.IDn":"Courant différentiel résiduel nominal","rcd.param.IDn":"Courant différentiel résiduel nominal","breaker.param.In":"Courant nominal","breaker.param.poles":"Pôles","breaker.param.Icu":"Pouvoir de coupure","disconnector.param.In":"Courant nominal","fuse.param.In":"Courant nominal","resistor.name":"Résistance (R)","capacitor.name":"Condensateur (C)","diode.name":"Diode (D)","indicator-light.name":"Voyant lumineux (HL)","push-button.name":"Bouton-poussoir (SB)","relay-coil.name":"Bobine de relais (KA)","make-contact.name":"Contact à fermeture (NO)","break-contact.name":"Contact à ouverture (NC)","bell.name":"Sonnerie (HA)","terminal.name":"Borne / jonction (X)","fuse-switch-disconnector.name":"Interrupteur-sectionneur à fusibles","socket-outlet.name":"Prise de courant / connecteur","inductor.name":"Bobine d'inductance (L)","voltage-regulator.name":"Régulateur de tension (T)","dc-motor.name":"Moteur à courant continu (M)","heater.name":"Élément chauffant (EH)","selector-switch.name":"Commutateur sélecteur (SA)","limit-switch.name":"Interrupteur de fin de course (SQ)","proximity-switch.name":"Détecteur de proximité (SQ)","time-relay.name":"Relais temporisé (KT)","buzzer.name":"Avertisseur sonore (HA)","siren.name":"Sirène (HA)","thermocouple.name":"Thermocouple (BT)","thyristor.name":"Thyristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diode Zener (D)","igbt.name":"IGBT","plc.name":"Automate programmable (API) / contrôleur","ups.name":"ASI","power-supply.name":"Alimentation (PS)","genset.name":"Groupe électrogène (G)","protective-relay.name":"Relais de protection","overcurrent-relay.name":"Relais de surintensité (50/51)","undervoltage-relay.name":"Relais de sous-tension (27)","reverse-power-relay.name":"Relais de retour de puissance (32)","distance-relay.name":"Relais de distance (21)","phase-failure-relay.name":"Relais de manque de phase","buchholz-relay.name":"Relais Buchholz (63)","power-factor-meter.name":"Cosphimètre (cosφ)","synchronoscope.name":"Synchronoscope","varmeter.name":"Varmètre (var)","resistor.desc":"Résistance générale / de limitation de courant / de freinage.","capacitor.desc":"Condensateur général / de filtrage / de bus DC. Utilisez le condensateur shunt pour la compensation du facteur de puissance.","diode.desc":"Diode de redressement / roue libre / protection. t1 = anode (haut), t2 = cathode (bas).","indicator-light.desc":"Voyant lumineux de signalisation / d'état.","push-button.desc":"Bouton-poussoir manuel à rappel automatique (contact à fermeture NO).","relay-coil.desc":"Bobine de commande de relais / contacteur (rectangle).","make-contact.desc":"Contact auxiliaire normalement ouvert (à fermeture).","break-contact.desc":"Contact auxiliaire normalement fermé (à ouverture).","bell.desc":"Sonnerie de signalisation / d'alarme.","terminal.desc":"Borne / boîte de jonction / nœud de connexion.","fuse-switch-disconnector.desc":"Interrupteur-sectionneur à fusibles, manœuvrable en charge.","socket-outlet.desc":"Prise de courant / connecteur multipolaire.","inductor.desc":"Bobine d'inductance générale / self / self de choc.","voltage-regulator.desc":"Régulateur de tension à induction réglable / autotransformateur.","dc-motor.desc":"Moteur à courant continu (symbole général à excitation série).","heater.desc":"Élément chauffant résistif / charge de chauffage.","selector-switch.desc":"Commutateur sélecteur / à came rotatif (à position maintenue).","limit-switch.desc":"Interrupteur de fin de course / de position (NO, à commande mécanique).","proximity-switch.desc":"Capteur de proximité / détecteur de proximité sans contact.","time-relay.desc":"Bobine de relais temporisé (à fonctionnement retardé).","buzzer.desc":"Avertisseur sonore de signalisation.","siren.desc":"Sirène sonore / d'alarme.","thermocouple.desc":"Capteur de température à thermocouple.","thyristor.desc":"Thyristor triode à blocage inverse / SCR. t1 = anode (haut), t2 = cathode (bas).","triac.desc":"Thyristor triode bidirectionnel (TRIAC).","zener-diode.desc":"Diode Zener / de régulation de tension. t1 = anode (haut), t2 = cathode (bas).","igbt.desc":"IGBT à enrichissement canal N. t1 = collecteur (haut), t2 = émetteur (bas), t_g = grille.","plc.desc":"Automate programmable industriel (API).","ups.desc":"Alimentation sans interruption (ASI) online / standby.","power-supply.desc":"Alimentation à découpage AC→DC / alimentation DC. t_ac en haut (~), t_dc en bas (=).","genset.desc":"Groupe électrogène diesel / gaz.","protective-relay.desc":"Relais de mesure / protection, symbole général (IEC 60617).","overcurrent-relay.desc":"Relais de protection contre les surintensités (ANSI 50/51).","undervoltage-relay.desc":"Relais de protection contre les sous-tensions (ANSI 27).","reverse-power-relay.desc":"Relais de protection contre le retour de puissance / de courant (ANSI 32).","distance-relay.desc":"Relais de protection de distance / à minimum d'impédance (ANSI 21).","phase-failure-relay.desc":"Relais de protection contre le manque / la perte de phase.","buchholz-relay.desc":"Relais Buchholz / à gaz (ANSI 63).","power-factor-meter.desc":"Cosphimètre (cosφ).","synchronoscope.desc":"Indicateur de synchronisation / synchronoscope.","varmeter.desc":"Varmètre (mesure de puissance réactive, var).","make-contact.state.closed":"Fermé","break-contact.state.open":"Ouvert","fuse-switch-disconnector.state.open":"Ouvert","selector-switch.state.open":"Ouvert","limit-switch.state.closed":"Fermé","resistor.param.R":"Résistance","resistor.param.P":"Puissance nominale","capacitor.param.C":"Capacité","capacitor.param.Un":"Tension nominale","indicator-light.param.color":"Couleur","inductor.param.L":"Inductance","inductor.param.In":"Courant nominal","voltage-regulator.param.ratio":"Plage de régulation","heater.param.P":"Puissance","ups.param.S":"Puissance apparente","power-supply.param.Vdc":"Tension de sortie","genset.param.P":"Puissance"},iS={ui:oS,library:rS},aS={"common.unnamed":"Unbenannt","common.close":"Schließen","common.yes":"Ja","common.no":"Nein","topbar.theme.toLight":"Zu Hell wechseln","topbar.theme.toDark":"Zu Dunkel wechseln","topbar.theme.currentDark":"Aktuell: Dunkles Thema","topbar.theme.currentLight":"Aktuell: Helles Thema","topbar.lang.toEnglish":"Zu Englisch wechseln","topbar.lang.toChinese":"Zu Chinesisch wechseln","topbar.lang.currentEnglish":"Aktuell: Englisch","topbar.lang.currentChinese":"Aktuell: Chinesisch","topbar.export.label":"Exportieren","topbar.export.tooltip":"SVG-Vektor (editierbar), PNG-Bitmap (2× HiDPI) oder DXF (CAD)","topbar.export.pngFailed":"PNG-Export fehlgeschlagen: {err}","topbar.export.dxfFailed":"DXF-Export fehlgeschlagen: {err}","topbar.file.label":"Datei","topbar.file.tooltip":"Lokales .json-Diagramm öffnen, speichern oder speichern unter","topbar.file.current":"Aktuell: {name}","topbar.file.new":"Neu","topbar.file.open":"Öffnen…","topbar.file.save":"Speichern","topbar.file.saveAs":"Speichern unter…","topbar.file.newConfirm":"Bei „Neu“ gehen nicht gespeicherte Änderungen verloren. Fortfahren?","topbar.file.openFailed":"Öffnen fehlgeschlagen: {err}","topbar.file.saveFailed":"Speichern fehlgeschlagen: {err}","topbar.file.fileDescription":"OneLineEditor-Diagramm","outline.title":"Gliederung","outline.collapse":"Einklappen","outline.collapseAria":"Gliederung einklappen","outline.empty":"(Keine Elemente — aus der Bibliothek hierher ziehen, um zu starten)","props.title":"Eigenschaften","props.node":"Elektrischer Knoten","props.wire":"Leitung","props.bus":"Sammelschiene","props.junction":"Verbindungspunkt","props.junctionPos":"Position","props.nSelected":"{n} ausgewählt","props.empty":"Nichts ausgewählt","props.multi":"{n} Elemente ausgewählt","props.name":"Name","props.note":"Notiz","props.label":"Beschriftung","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Elektrischer Knoten {id} nicht gefunden","props.wireNotFound":"Leitung {id} nicht gefunden","props.nodeStats":"{terminals} Anschlüsse · {elements} Elemente","props.selectElement":"{label} auswählen","props.selectWholeNode":"Gesamten elektrischen Knoten auswählen","props.annText":"Text","props.annRect":"Rechteck","props.annLine":"Linie","props.annTable":"Tabelle","props.annNotFound":"Beschriftung {id} nicht gefunden","props.annLabel":"Bezeichnung","props.annLabelPlaceholder":"z. B. Verteiler 1","props.annStroke":"Linienart","props.annStrokeSolid":"Durchgezogen","props.annStrokeDashed":"Gestrichelt","props.annFill":"Füllung","props.annFillNone":"Keine","props.annFillTint":"Farbton","props.annArrow":"Pfeile","props.annArrowNone":"Keine","props.annArrowEnd":"Einseitig","props.annArrowBoth":"Beidseitig","props.annFontSize":"Schriftgröße","props.annRows":"Zeilen","props.annCols":"Spalten","view.zoomOut":"Verkleinern","view.zoomOutHint":"Stufenweise verkleinern; auch Mausrad ↓ oder ⌘−","view.reset":"Auf 100 % zurücksetzen","view.current":"Aktuell {z} %","view.zoomIn":"Vergrößern","view.zoomInHint":"Stufenweise vergrößern; auch Mausrad ↑ oder ⌘+","view.fit":"Ansicht einpassen","view.fitHint":"Alle Elemente automatisch zoomen und zentrieren","view.gridHide":"Raster ausblenden","view.gridShow":"Raster einblenden","view.gridHotkey":"G","view.gridHideHint":"Deaktiviert auch das Einrasten am Raster (freie Platzierung)","view.gridShowHint":"Aktiviert auch das Einrasten am Raster (rastet beim Ziehen auf 10 px ein)","view.gridHideAria":"Raster ausblenden und Einrasten deaktivieren","view.gridShowAria":"Raster einblenden und Einrasten aktivieren","view.label":"Beschriftungen","view.labelOff":"Aus","view.labelId":"ID","view.labelAll":"ID + Parameter","view.labelHint":"Sichtbarkeit und Schriftgröße der Beschriftungen (auch beim Export)","view.labelSize":"Größe","view.labelSizeSmaller":"Beschriftungen verkleinern","view.labelSizeLarger":"Beschriftungen vergrößern","view.labelSizeReset":"Schriftgröße zurücksetzen","library.title":"Bibliothek","library.empty":"Keine passenden Elemente","library.searchPlaceholder":"Elemente suchen…","library.searchAria":"Elemente suchen","library.clearSearch":"Suche löschen","library.itemHint":"Klicken für Platzierungsmodus oder auf die Zeichenfläche ziehen","tool.select":"Auswählen","tool.selectHint":"Klicken zum Auswählen, Rahmen für Mehrfachauswahl, Rechtsklick für Menü","tool.pan":"Verschieben","tool.panHint":"Zeichenfläche ziehen; Leertaste schaltet vorübergehend um","tool.wire":"Leitung","tool.wireHint":"Von einem Anschluss/einer Sammelschiene/einem Verbindungspunkt ziehen; auf freie Fläche setzt einen Verbindungspunkt, auf eine Leitung setzt einen Abzweig","tool.bus":"Sammelschiene","tool.busHint":"Auf der Zeichenfläche ziehen — drücken für Anfang, loslassen für Ende","tool.junction":"Verbindungspunkt","tool.junctionHint":"Auf die Zeichenfläche klicken, um einen Verbindungspunkt (Knoten) zu setzen; Leitungen können frei daran angeschlossen werden","tool.place":"Platzieren","tool.placeHint":"Klicken zum Platzieren; oder von einem Anschluss/einer Sammelschiene ziehen, um zu platzieren und zu verbinden","tool.text":"Text","tool.textHint":"Auf die Zeichenfläche klicken, um eine Textnotiz zu setzen; Doppelklick auf vorhandenen Text zum Bearbeiten","tool.rect":"Rechteck","tool.rectHint":"Ziehen, um ein Rechteck / einen Gruppenrahmen zu zeichnen (standardmäßig gestrichelt); Shift für ein Quadrat","tool.line":"Linie","tool.lineHint":"Ziehen, um eine Beschriftungslinie zu zeichnen; Shift rastet auf 45°; Pfeile im Panel einstellen","tool.table":"Tabelle","tool.tableHint":"Ziehen, um Spalten × Zeilen aufzuziehen (Live-Anzeige), oder klicken für eine Standardtabelle; Doppelklick auf Zellen zum Eintippen","mode.selectWithSel":"Elemente ziehen · Anschlüsse ziehen zum Verbinden · Rechtsklick für Menü","mode.selectEmpty":"Klicken zum Auswählen · Ziehen zum Verschieben · Rahmen für Mehrfachauswahl · Rechtsklick für Menü","mode.pan":"Zeichenfläche ziehen · Mausrad zum Zoomen · Leertaste gedrückt halten, um in jedem Werkzeug zu verschieben","mode.wireDragging":"Auf einem Anschluss/einer Sammelschiene/einem Verbindungspunkt loslassen; Loslassen auf freier Fläche setzt einen Verbindungspunkt","mode.wireInit":"Auf einem beliebigen Verbindungspunkt oder freier Fläche drücken, zum Ziel ziehen und loslassen","mode.busDragging":"Ziehen legt die Richtung der Sammelschiene fest; Loslassen legt das Ende fest","mode.busInit":"Auf der Zeichenfläche drücken für den Anfang, ziehen, loslassen für das Ende","mode.junction":"Auf die Zeichenfläche klicken, um einen Verbindungspunkt zu setzen","mode.placeNoKind":"Einen Elementtyp aus der Bibliothek links auswählen","mode.placeFromTerm":"Am Ziel loslassen — das neue Element wird mit dem Quellanschluss verbunden","mode.placeNormal":"Auf freie Fläche klicken zum Platzieren; oder von einem Anschluss / einer Sammelschiene ziehen, um zu platzieren und zu verbinden","mode.text":"Klicken, um Text zu setzen · Doppelklick zum Bearbeiten · Ziehen zum Verschieben der Auswahl · Entf zum Entfernen","mode.rect":"Ziehen, um ein Rechteck zu zeichnen · Shift für Quadrat · nach dem Loslassen skalieren und beschriften","mode.line":"Ziehen, um eine Linie zu zeichnen · Shift rastet auf 45° · Pfeile nach dem Loslassen im Panel hinzufügen","mode.table":"Ziehen, um das Raster aufzuziehen, oder klicken für eine 3×3-Tabelle · Doppelklick auf Zellen zum Eintippen","mode.annTextSel":"Text anklicken zum Bearbeiten · Ziehen zum Verschieben · Entf zum Entfernen","mode.annTableSel":"Zelle anklicken zum Ausfüllen · Ziehen zum Verschieben · Entf zum Entfernen","mode.annShapeSel":"Ziehen zum Verschieben · Anfasser ziehen zum Skalieren · Stil im Panel ändern · Entf zum Entfernen","mode.annEditing":"Eingeben · Enter zum Bestätigen · Esc zum Abbrechen · oder die ✓ / ✕ Schaltflächen","mode.escSelect":"Esc hebt die Auswahl auf","mode.escOther":"Rechtsklick / Esc zum Abbrechen","tool.placeNoKindTooltip":"Einen Typ in der Bibliothek links auswählen, dann auf die Zeichenfläche klicken","tool.undo":"Rückgängig","tool.undoHint":"Letzte Änderung rückgängig machen (Verschieben / Drehen / Löschen usw.)","tool.redo":"Wiederholen","tool.redoHint":"Letzte rückgängig gemachte Änderung wiederherstellen","layout.label":"Layout","layout.hint":"Gesamtes Diagramm oder nur die Auswahl automatisch anordnen, Lücken auffüllen","layout.allAuto":"Alles automatisch anordnen","layout.selAuto":"Auswahl automatisch anordnen","layout.allFill":"Nicht platzierte auffüllen","layout.selFill":"Nicht platzierte in Auswahl auffüllen","tool.more":"Mehr","tool.moreHint":"Rückgängig / Wiederholen / Layout","view.menu":"Ansicht","view.menuHint":"Zoom, Einpassen, Raster","ctx.ariaNode":"Knotenaktionen","ctx.ariaWire":"Leitungsaktionen","ctx.ariaElement":"Elementaktionen","ctx.ariaEdit":"Bearbeitungsaktionen","ctx.done":"Fertig","ctx.cancel":"Abbrechen","ctx.rotate":"Um 90° drehen","ctx.rotateHint":"Auswahl im Uhrzeigersinn drehen; Leitungen werden über neue Anschlüsse neu geführt","ctx.mirror":"Horizontal spiegeln","ctx.mirrorTitle":"Spiegeln","ctx.mirrorHint":"Auswahl links-rechts spiegeln","ctx.delete":"Löschen","ctx.deleteHintNode":"Alle Leitungen an diesem Knoten trennen (Elemente bleiben erhalten)","ctx.deleteHintWire":"Nur diese Leitung entfernen (andere Leitungen am selben Knoten bleiben erhalten)","ctx.deleteHintElement":"Auswahl und ihre Leitungen entfernen","ctx.resetWirePath":"Auf automatische Führung zurücksetzen","ctx.resetWirePathHint":"Manuelle Eckpunkte verwerfen und die Leitung automatisch neu zeichnen lassen","menu.undo":"Rückgängig","menu.redo":"Wiederholen","menu.cut":"Ausschneiden","menu.copy":"Kopieren","menu.paste":"Einfügen","menu.rotate":"Um 90° drehen","menu.mirror":"Spiegeln","menu.selectAll":"Alles auswählen","menu.disconnect":"Diese Leitung trennen","menu.delete":"Löschen","io.parseFailed":"JSON-Parsing fehlgeschlagen: {err}","io.notObject":"Datei ist kein JSON-Objekt","io.versionMismatch":"Versionskonflikt: erwartet „1“, erhalten {actual}","io.elementsMissing":"`elements` fehlt oder ist kein Array","compile.duplicateId":"Doppelte Element-ID: „{id}“","compile.unknownKind":'Unbekannter Elementtyp kind="{kind}"',"compile.invalidTermRef":"Ungültige Anschlussreferenz „{ref}“","compile.elementMissing":"Verweis auf unbekanntes Element „{id}“","compile.missingPin":"Element „{id}“ (kind={kind}) hat keinen Pin „{pin}“; verfügbar: {available}","compile.singleTerminal":"Knoten hat nur einen Anschluss — ignoriert","compile.layoutMissingElement":"layout-Schlüssel „{id}“ verweist auf ein unbekanntes Element","compile.elementUnconnected":"Element „{id}“ hat keine Verbindungen","cat.busbar":"Sammelschiene / Verdrahtung","cat.switching":"Schalten","cat.protection":"Schutz","cat.motor-control":"Motorsteuerung","cat.transformer":"Transformator","cat.instrument-transformer":"Messwandler","cat.measurement":"Messung","cat.source":"Quelle","cat.load":"Last","cat.storage":"Speicher","cat.compensation":"Kompensation","cat.grounding":"Erdung","cat.renewable":"Erneuerbare Energien / Leistungselektronik","onboard.title":"Schnellstart","onboard.step1.title":"Ein Bauteil platzieren","onboard.step1.body":"Werkzeug Platzieren (P) wählen und einen Typ aus der Bibliothek auf die Zeichenfläche ziehen","onboard.step2.title":"Verdrahten","onboard.step2.body":"Werkzeug Leitung (W) verwenden: von einem Anschluss zum anderen ziehen — auf freie Fläche ziehen setzt einen Verbindungspunkt","onboard.step3.title":"Eine Sammelschiene ist eine gemeinsame Schiene, keine Leitung","onboard.step3.body":"Das Werkzeug Sammelschiene (B) nur verwenden, wenn sich mehrere Stromkreise eine Schiene teilen. Keine Sammelschiene benutzen, um zwei Geräte zu verbinden — einfach die Anschlüsse direkt verdrahten (W).","onboard.dismiss":"Verstanden"},sS={"arc-suppression-coil.name":"Erdschlusslöschspule","arrester.name":"Überspannungsableiter (FBL)","async-motor.name":"Asynchronmotor","autotransformer.name":"Spartransformator","battery.name":"Batteriespeicher","breaker.name":"Leistungsschalter (QF)","busbar.name":"Sammelschienenabschnitt","converter-bidir.name":"Bidirektionaler Umrichter (PCS)","dc-dc-converter.name":"DC/DC-Wandler","mppt.name":"MPPT-Regler","ct.name":"Stromwandler (CT)","disconnector.name":"Trennschalter (QS)","earth.name":"Erde","earthing-switch.name":"Erdungsschalter (QE)","fuse.name":"Sicherung (FU)","generator.name":"Generator (G)","grid-source.name":"Netzeinspeisung","grounding-transformer.name":"Erdungstransformator (Zickzack)","inverter.name":"Wechselrichter (DC→AC)","load-switch.name":"Lastschalter","load.name":"Last","luminaire.name":"Leuchte (Beleuchtungslast)","panelboard.name":"Verteilerschrank / Lastzentrum","ngr.name":"Sternpunkt-Erdungswiderstand (NGR)","pt.name":"Spannungswandler (PT)","pv.name":"PV-Modul","rectifier.name":"Gleichrichter (AC→DC)","series-reactor.name":"Längsdrosselspule","shunt-capacitor.name":"Kompensationskondensator","shunt-reactor.name":"Querdrosselspule","sync-motor.name":"Synchronmotor","transformer-2w.name":"Zweiwicklungstransformator","transformer-3w.name":"Dreiwicklungstransformator","wind-turbine.name":"Windenergieanlage","gfci-breaker.name":"GFCI-Leistungsschalter (RCBO)","rcd.name":"Fehlerstrom-Schutzeinrichtung (RCD)","recloser.name":"Recloser","energy-meter.name":"Energiezähler (Wh)","voltmeter.name":"Spannungsmesser (V)","ammeter.name":"Amperemeter (A)","wattmeter.name":"Wattmeter (W)","frequency-meter.name":"Frequenzmesser (Hz)","contactor.name":"Schütz (KM)","motor-starter.name":"Motorstarter","thermal-overload.name":"Thermisches Überlastrelais","vfd.name":"Frequenzumrichter (VFD)","soft-starter.name":"Sanftstarter","transfer-switch.name":"Netzumschalter (ATS)","dc-disconnector.name":"Gleichstrom-Trennschalter","dc-combiner.name":"Generatoranschlusskasten","ev-charger.name":"EV-Ladestation","arc-suppression-coil.desc":"Resonante Sternpunkterdung: Induktivität gegen Erde","busbar.desc":"Dehnbarer Einzelsammelschienenabschnitt mit mehreren Abzweigen","converter-bidir.desc":"Speicherumrichter: bidirektional AC ↔ DC","dc-dc-converter.desc":"DC/DC-Wandler / Gleichstromladegerät (IEC 60617)","mppt.desc":"MPPT-Solarladeregler (DC/DC, Maximum-Power-Point-Tracking)","earthing-switch.desc":"Trennschalter + Erdverbindung, ein Anschluss","grid-source.desc":"Starres Netz / externes Versorgungsnetz","grounding-transformer.desc":"Stern-Zickzack-Transformator zur Sternpunkterdung","load.desc":"Abstrakte Last (Pfeil für Stromabgang)","luminaire.desc":"Beleuchtungslast (allgemeines Leuchtensymbol IEC 60617)","ngr.desc":"Niederohmige Erdung: Transformator-Sternpunkt gegen Erde","series-reactor.desc":"Gleiches Symbol wie die Querdrosselspule; Unterscheidung nach Verwendungszweck","wind-turbine.desc":"Windenergieanlage: Generator + Drei-Blatt-Rotor-Kennzeichnung","gfci-breaker.desc":"Fehlerstromschutzschalter mit Überstromschutz (UL943 / IEC 61009). In Nordamerika GFCI, in Europa RCBO.","rcd.desc":"Fehlerstromschutzschalter ohne Überstromschutz (IEC 61008).","recloser.desc":"Automatischer Mittelspannungs-Recloser.","energy-meter.desc":"Wirkarbeitszähler (kWh) — Hausanschluss / Unterzähler.","contactor.desc":"Hauptstromkreis-Schütz, meist zusammen mit einem Thermorelais und einem Motor verwendet.","motor-starter.desc":"Motorstarter (allgemeines Symbol nach IEC 60617).","thermal-overload.desc":"Thermisches Überlastschutzrelais für Motoren; sitzt zwischen Schütz und Motor.","vfd.desc":"Frequenzumrichter zur Drehzahlregelung von Asynchronmotoren.","soft-starter.desc":"Sanftstarter für Motoren (thyristorbasiertes Anlaufen mit reduzierter Spannung).","transfer-switch.desc":"Umschalter für zwei Quellen (automatisch/manuell). Zwei Quelleneingänge + ein Lastausgang, mechanisch verriegelt.","dc-disconnector.desc":"Gleichstrom-Trennschalter — Trennung auf der Gleichstromseite von PV-Strings / Batteriespeichern.","dc-combiner.desc":"PV-String-Generatoranschlusskasten (Beispiel mit 4 Eingängen).","ev-charger.desc":"Ladestation für Elektrofahrzeuge.","breaker.state.open":"Offen","disconnector.state.open":"Offen","earthing-switch.state.open":"Offen","fuse.state.blown":"Durchgebrannt","load-switch.state.open":"Offen","gfci-breaker.state.open":"Offen","rcd.state.open":"Offen","recloser.state.open":"Offen","contactor.state.open":"Offen","thermal-overload.state.tripped":"Ausgelöst","transfer-switch.state.position":"Position (normal/Notbetrieb/aus)","dc-disconnector.state.open":"Offen","battery.param.E":"Kapazität","busbar.param.Un":"Bemessungsspannung","converter-bidir.param.S":"Nennleistung","dc-dc-converter.param.P":"Leistung","mppt.param.I":"Bemessungsstrom","load.param.P":"Wirkleistung","load.param.cosphi":"Leistungsfaktor","ngr.param.R":"Widerstand","shunt-capacitor.param.Q":"Blindleistung","shunt-capacitor.param.stages":"Stufen","transformer-2w.param.S":"Nennleistung","transformer-2w.param.ratio":"Übersetzungsverhältnis","gfci-breaker.param.In":"Bemessungsstrom","gfci-breaker.param.IDn":"Bemessungsdifferenzstrom","rcd.param.IDn":"Bemessungsdifferenzstrom","breaker.param.In":"Bemessungsstrom","breaker.param.poles":"Polzahl","breaker.param.Icu":"Ausschaltvermögen","disconnector.param.In":"Bemessungsstrom","fuse.param.In":"Bemessungsstrom","resistor.name":"Widerstand (R)","capacitor.name":"Kondensator (C)","diode.name":"Diode (D)","indicator-light.name":"Meldeleuchte (HL)","push-button.name":"Taster (SB)","relay-coil.name":"Relaisspule (KA)","make-contact.name":"Schließer (NO)","break-contact.name":"Öffner (NC)","bell.name":"Klingel (HA)","terminal.name":"Klemme / Verbindungspunkt (X)","fuse-switch-disconnector.name":"Sicherungslasttrennschalter","socket-outlet.name":"Steckdose / Steckverbinder","inductor.name":"Spule (L)","voltage-regulator.name":"Spannungsregler (T)","dc-motor.name":"Gleichstrommotor (M)","heater.name":"Heizelement (EH)","selector-switch.name":"Wahlschalter (SA)","limit-switch.name":"Endschalter (SQ)","proximity-switch.name":"Näherungsschalter (SQ)","time-relay.name":"Zeitrelais (KT)","buzzer.name":"Summer (HA)","siren.name":"Sirene (HA)","thermocouple.name":"Thermoelement (BT)","thyristor.name":"Thyristor (V)","triac.name":"Triac (V)","zener-diode.name":"Z-Diode (D)","igbt.name":"IGBT","plc.name":"SPS / Steuerung","ups.name":"USV","power-supply.name":"Netzteil (PS)","genset.name":"Generatoraggregat (G)","protective-relay.name":"Schutzrelais","overcurrent-relay.name":"Überstromrelais (50/51)","undervoltage-relay.name":"Unterspannungsrelais (27)","reverse-power-relay.name":"Rückleistungsrelais (32)","distance-relay.name":"Distanzrelais (21)","phase-failure-relay.name":"Phasenausfallrelais","buchholz-relay.name":"Buchholzrelais (63)","power-factor-meter.name":"Leistungsfaktormesser (cosφ)","synchronoscope.name":"Synchronoskop","varmeter.name":"Blindleistungsmesser (var)","resistor.desc":"Allgemeiner Widerstand / Vorwiderstand / Bremswiderstand.","capacitor.desc":"Allgemeiner / Filter- / Zwischenkreiskondensator. Für Blindleistungskompensation den Kompensationskondensator verwenden.","diode.desc":"Gleichrichter- / Freilauf- / Schutzdiode. t1 = Anode (oben), t2 = Kathode (unten).","indicator-light.desc":"Signal- / Zustandsmeldeleuchte.","push-button.desc":"Handbetätigter Taster mit selbsttätiger Rückstellung (Schließer).","relay-coil.desc":"Betätigungsspule eines Relais / Schützes (Rechtecksymbol).","make-contact.desc":"Normalerweise geöffneter Hilfskontakt (Schließer).","break-contact.desc":"Normalerweise geschlossener Hilfskontakt (Öffner).","bell.desc":"Signalglocke / Alarmglocke.","terminal.desc":"Klemme / Abzweigdose / Verbindungsknoten.","fuse-switch-disconnector.desc":"Lastschaltbarer Sicherungslasttrennschalter.","socket-outlet.desc":"Steckdose / mehrpoliger Steckverbinder.","inductor.desc":"Allgemeine Spule / Induktivität / Drossel.","voltage-regulator.desc":"Regelbarer Induktions- / Spartransformator-Spannungsregler.","dc-motor.desc":"Gleichstrommotor (allgemeines Symbol, Reihenschluss).","heater.desc":"Ohmsches Heizelement / Heizlast.","selector-switch.desc":"Wahl-/Umschalter (Drehschalter, rastend).","limit-switch.desc":"Positions-/Endschalter (Schließer, mechanisch betätigt).","proximity-switch.desc":"Näherungssensor / berührungsloser Näherungsschalter.","time-relay.desc":"Zeitverzögerungsrelais (ansprechverzögert).","buzzer.desc":"Signalsummer.","siren.desc":"Akustische Sirene / Alarmsignal.","thermocouple.desc":"Thermoelement-Temperaturfühler.","thyristor.desc":"Rückwärtssperrender Thyristor. t1 = Anode (oben), t2 = Kathode (unten).","triac.desc":"Bidirektionaler Thyristor (Triac).","zener-diode.desc":"Z-Diode / Spannungsreferenzdiode. t1 = Anode (oben), t2 = Kathode (unten).","igbt.desc":"N-Kanal-Anreicherungs-IGBT. t1 = Kollektor (oben), t2 = Emitter (unten), t_g = Gate.","plc.desc":"Speicherprogrammierbare Steuerung (SPS).","ups.desc":"Online- / Standby-unterbrechungsfreie Stromversorgung.","power-supply.desc":"AC→DC-Schaltnetzteil / Gleichstromnetzteil. t_ac oben (~), t_dc unten (=).","genset.desc":"Diesel-/Gas-Generatoraggregat.","protective-relay.desc":"Mess- / Schutzrelais, allgemeines Symbol (IEC 60617).","overcurrent-relay.desc":"Überstromschutzrelais (ANSI 50/51).","undervoltage-relay.desc":"Unterspannungsschutzrelais (ANSI 27).","reverse-power-relay.desc":"Rückleistungs-/Rückstromschutzrelais (ANSI 32).","distance-relay.desc":"Distanz-/Unterimpedanzschutzrelais (ANSI 21).","phase-failure-relay.desc":"Phasenausfall-/Phasenverlustschutzrelais.","buchholz-relay.desc":"Buchholzrelais / Gasrelais (ANSI 63).","power-factor-meter.desc":"Leistungsfaktormesser (cosφ).","synchronoscope.desc":"Synchronisieranzeige / Synchronoskop.","varmeter.desc":"Blindleistungsmesser (var).","make-contact.state.closed":"Geschlossen","break-contact.state.open":"Offen","fuse-switch-disconnector.state.open":"Offen","selector-switch.state.open":"Offen","limit-switch.state.closed":"Geschlossen","resistor.param.R":"Widerstand","resistor.param.P":"Bemessungsleistung","capacitor.param.C":"Kapazität","capacitor.param.Un":"Bemessungsspannung","indicator-light.param.color":"Farbe","inductor.param.L":"Induktivität","inductor.param.In":"Bemessungsstrom","voltage-regulator.param.ratio":"Regelbereich","heater.param.P":"Leistung","ups.param.S":"Nennleistung","power-supply.param.Vdc":"Ausgangsspannung","genset.param.P":"Leistung"},lS={ui:aS,library:sS},cS={"common.unnamed":"Sem título","common.close":"Fechar","common.yes":"Sim","common.no":"Não","topbar.theme.toLight":"Mudar para claro","topbar.theme.toDark":"Mudar para escuro","topbar.theme.currentDark":"Atual: tema escuro","topbar.theme.currentLight":"Atual: tema claro","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Atual: inglês","topbar.lang.currentChinese":"Atual: chinês","topbar.export.label":"Exportar","topbar.export.tooltip":"SVG vetorial (editável), PNG bitmap (2× HiDPI) ou DXF (CAD)","topbar.export.pngFailed":"Falha ao exportar PNG: {err}","topbar.export.dxfFailed":"Falha ao exportar DXF: {err}","topbar.file.label":"Arquivo","topbar.file.tooltip":"Abrir um diagrama .json local, salvar ou salvar como","topbar.file.current":"Atual: {name}","topbar.file.new":"Novo","topbar.file.open":"Abrir…","topbar.file.save":"Salvar","topbar.file.saveAs":"Salvar como…","topbar.file.newConfirm":"Criar um novo diagrama descartará as alterações não salvas. Continuar?","topbar.file.openFailed":"Falha ao abrir: {err}","topbar.file.saveFailed":"Falha ao salvar: {err}","topbar.file.fileDescription":"Diagrama OneLineEditor","outline.title":"Estrutura","outline.collapse":"Recolher","outline.collapseAria":"Recolher estrutura","outline.empty":"(Nenhum elemento — arraste da biblioteca para começar)","props.title":"Propriedades","props.node":"Nó elétrico","props.wire":"Fio","props.bus":"Barramento","props.junction":"Junção","props.junctionPos":"Posição","props.nSelected":"{n} selecionado(s)","props.empty":"Nada selecionado","props.multi":"{n} elementos selecionados","props.name":"Nome","props.note":"Nota","props.label":"Rótulo","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nó elétrico {id} não encontrado","props.wireNotFound":"Fio {id} não encontrado","props.nodeStats":"{terminals} terminais · {elements} elementos","props.selectElement":"Selecionar {label}","props.selectWholeNode":"Selecionar todo o nó elétrico","props.annText":"Texto","props.annRect":"Retângulo","props.annLine":"Linha","props.annTable":"Tabela","props.annNotFound":"Anotação {id} não encontrada","props.annLabel":"Rótulo","props.annLabelPlaceholder":"ex.: Quadro nº 1","props.annStroke":"Traço","props.annStrokeSolid":"Sólido","props.annStrokeDashed":"Tracejado","props.annFill":"Preenchimento","props.annFillNone":"Nenhum","props.annFillTint":"Tonalidade","props.annArrow":"Setas","props.annArrowNone":"Nenhuma","props.annArrowEnd":"Simples","props.annArrowBoth":"Dupla","props.annFontSize":"Tamanho da fonte","props.annRows":"Linhas","props.annCols":"Colunas","view.zoomOut":"Reduzir zoom","view.zoomOutHint":"Reduz o zoom por etapas; também roda ↓ ou ⌘−","view.reset":"Redefinir para 100%","view.current":"Atual {z}%","view.zoomIn":"Aumentar zoom","view.zoomInHint":"Aumenta o zoom por etapas; também roda ↑ ou ⌘+","view.fit":"Ajustar à tela","view.fitHint":"Aplica zoom automático e centraliza todos os elementos","view.gridHide":"Ocultar grade","view.gridShow":"Mostrar grade","view.gridHotkey":"G","view.gridHideHint":"Também desativa o encaixe à grade (posicionamento livre)","view.gridShowHint":"Também ativa o encaixe à grade (encaixa em 10px ao arrastar)","view.gridHideAria":"Ocultar grade e desativar encaixe","view.gridShowAria":"Mostrar grade e ativar encaixe","view.label":"Rótulos","view.labelOff":"Nenhum","view.labelId":"ID","view.labelAll":"ID + parâmetros","view.labelHint":"Visibilidade e tamanho dos rótulos (também na exportação)","view.labelSize":"Tamanho","view.labelSizeSmaller":"Diminuir o tamanho dos rótulos","view.labelSizeLarger":"Aumentar o tamanho dos rótulos","view.labelSizeReset":"Redefinir o tamanho dos rótulos","library.title":"Biblioteca","library.empty":"Nenhum elemento encontrado","library.searchPlaceholder":"Buscar elementos…","library.searchAria":"Buscar elementos","library.clearSearch":"Limpar busca","library.itemHint":"Clique para entrar no modo de posicionamento ou arraste até a tela","tool.select":"Selecionar","tool.selectHint":"Clique para selecionar, arraste para selecionar vários, botão direito para o menu","tool.pan":"Panorâmica","tool.panHint":"Arraste a tela; a barra de espaço alterna temporariamente","tool.wire":"Fio","tool.wireHint":"Arraste de um pino/barramento/junção; soltar em espaço vazio cria uma junção, sobre um fio existente cria uma derivação","tool.bus":"Barramento","tool.busHint":"Arraste na tela — pressione para definir o início, solte para definir o fim","tool.junction":"Junção","tool.junctionHint":"Clique na tela para posicionar uma junção (nó); os fios se conectam livremente a ela","tool.place":"Posicionar","tool.placeHint":"Clique para posicionar; ou arraste de um terminal/barramento para posicionar e conectar","tool.text":"Texto","tool.textHint":"Clique na tela para inserir uma anotação de texto; clique duas vezes em uma existente para editar","tool.rect":"Retângulo","tool.rectHint":"Arraste para desenhar um retângulo / moldura de grupo (tracejado por padrão); Shift para um quadrado","tool.line":"Linha","tool.lineHint":"Arraste para desenhar uma linha de anotação; Shift trava em 45°; as setas ficam no painel","tool.table":"Tabela","tool.tableHint":"Arraste para definir colunas × linhas (contagem em tempo real), ou clique para uma tabela padrão; clique duas vezes nas células para digitar","mode.selectWithSel":"Arraste elementos para mover · arraste terminais para conectar · botão direito para o menu","mode.selectEmpty":"Clique para selecionar · arraste para mover · seleção múltipla por área · botão direito para o menu","mode.pan":"Arraste a tela · role para o zoom · segure Espaço para deslocar em qualquer ferramenta","mode.wireDragging":"Solte em um pino/barramento/junção; soltar em espaço vazio cria uma junção","mode.wireInit":"Pressione em qualquer ponto de conexão ou espaço vazio, arraste até o destino e solte","mode.busDragging":"O arraste define a direção do barramento; soltar define o fim","mode.busInit":"Pressione na tela para definir o início, arraste, solte para definir o fim","mode.junction":"Clique na tela para posicionar uma junção","mode.placeNoKind":"Escolha um tipo de elemento na biblioteca à esquerda","mode.placeFromTerm":"Solte no destino — o novo elemento se conectará de volta ao terminal de origem","mode.placeNormal":"Clique em um espaço vazio para posicionar; ou arraste de um terminal/barramento para posicionar e conectar","mode.text":"Clique para inserir texto · clique duas vezes para editar · arraste o selecionado para mover · Del para remover","mode.rect":"Arraste para desenhar um retângulo · Shift para quadrado · redimensione e rotule após soltar","mode.line":"Arraste para desenhar uma linha · Shift trava em 45° · adicione setas no painel após soltar","mode.table":"Arraste para definir a grade, ou clique para uma tabela 3×3 · clique duas vezes nas células para digitar","mode.annTextSel":"Clique no texto para editar · arraste para mover · Del para remover","mode.annTableSel":"Clique em uma célula para preencher · arraste para mover · Del para remover","mode.annShapeSel":"Arraste para mover · arraste as alças para redimensionar · reestilize no painel · Del para remover","mode.annEditing":"Digite · Enter para confirmar · Esc para cancelar · ou os botões ✓ / ✕","mode.escSelect":"Esc limpa a seleção","mode.escOther":"Botão direito / Esc para cancelar","tool.placeNoKindTooltip":"Escolha um tipo na biblioteca à esquerda e clique na tela","tool.undo":"Desfazer","tool.undoHint":"Desfaz a última edição (mover / girar / excluir etc.)","tool.redo":"Refazer","tool.redoHint":"Refaz a última edição desfeita","layout.label":"Layout","layout.hint":"Aplica o layout automático a todo o diagrama ou apenas à seleção, preenchendo lacunas","layout.allAuto":"Reaplicar layout automático","layout.selAuto":"Reaplicar layout automático na seleção","layout.allFill":"Preencher não posicionados","layout.selFill":"Preencher não posicionados na seleção","tool.more":"Mais","tool.moreHint":"Desfazer / refazer / layout","view.menu":"Visualização","view.menuHint":"Zoom, ajuste, grade","ctx.ariaNode":"Ações do nó","ctx.ariaWire":"Ações do fio","ctx.ariaElement":"Ações do elemento","ctx.ariaEdit":"Ações de edição","ctx.done":"Concluído","ctx.cancel":"Cancelar","ctx.rotate":"Girar 90°","ctx.rotateHint":"Gira a seleção no sentido horário; os fios se reconectam pelos novos terminais","ctx.mirror":"Espelhar horizontalmente","ctx.mirrorTitle":"Espelhar","ctx.mirrorHint":"Inverte a seleção da esquerda para a direita","ctx.delete":"Excluir","ctx.deleteHintNode":"Desconecta todos os fios deste nó (os elementos permanecem)","ctx.deleteHintWire":"Remove apenas este fio (os demais no mesmo nó permanecem)","ctx.deleteHintElement":"Remove a seleção e seus fios","ctx.resetWirePath":"Redefinir para roteamento automático","ctx.resetWirePathHint":"Remove os vértices manuais e deixa o roteador redesenhar este fio","menu.undo":"Desfazer","menu.redo":"Refazer","menu.cut":"Recortar","menu.copy":"Copiar","menu.paste":"Colar","menu.rotate":"Girar 90°","menu.mirror":"Espelhar","menu.selectAll":"Selecionar tudo","menu.disconnect":"Desconectar este fio","menu.delete":"Excluir","io.parseFailed":"Falha ao interpretar o JSON: {err}","io.notObject":"O arquivo não é um objeto JSON","io.versionMismatch":'Versão incompatível: esperado "1", recebido {actual}',"io.elementsMissing":"`elements` está ausente ou não é um array","compile.duplicateId":'ID de elemento duplicado: "{id}"',"compile.unknownKind":'Tipo de elemento desconhecido kind="{kind}"',"compile.invalidTermRef":'Referência de terminal inválida "{ref}"',"compile.elementMissing":'Referência a um elemento desconhecido "{id}"',"compile.missingPin":'O elemento "{id}" (kind={kind}) não possui o pino "{pin}"; disponíveis: {available}',"compile.singleTerminal":"O nó possui apenas um terminal — ignorado","compile.layoutMissingElement":'A chave de layout "{id}" referencia um elemento desconhecido',"compile.elementUnconnected":'O elemento "{id}" não possui nenhuma conexão',"cat.busbar":"Barramento / fiação","cat.switching":"Manobra","cat.protection":"Proteção","cat.motor-control":"Controle de motores","cat.transformer":"Transformador","cat.instrument-transformer":"Transformador de instrumento","cat.measurement":"Medição","cat.source":"Fonte","cat.load":"Carga","cat.storage":"Armazenamento","cat.compensation":"Compensação","cat.grounding":"Aterramento","cat.renewable":"Renováveis / eletrônica de potência","onboard.title":"Início rápido","onboard.step1.title":"Posicione um componente","onboard.step1.body":"Escolha a ferramenta Posicionar (P) e arraste um tipo da biblioteca até a tela","onboard.step2.title":"Conecte os fios","onboard.step2.body":"Use a ferramenta Fio (W): arraste de um pino a outro — arraste até um espaço vazio para criar uma junção","onboard.step3.title":"Um barramento é um trilho compartilhado, não um fio","onboard.step3.body":"Use a ferramenta Barramento (B) somente quando vários circuitos compartilham o mesmo trilho. Não use um barramento para ligar dois dispositivos — apenas conecte os pinos (W).","onboard.dismiss":"Entendi"},dS={"arc-suppression-coil.name":"Bobina de supressão de arco","arrester.name":"Para-raios (FBL)","async-motor.name":"Motor de indução","autotransformer.name":"Autotransformador","battery.name":"Armazenamento em bateria","breaker.name":"Disjuntor (QF)","busbar.name":"Segmento de barramento","converter-bidir.name":"Conversor bidirecional (PCS)","dc-dc-converter.name":"Conversor CC/CC","mppt.name":"Controlador MPPT","ct.name":"Transformador de corrente (CT)","disconnector.name":"Seccionador (QS)","earth.name":"Terra","earthing-switch.name":"Chave de aterramento (QE)","fuse.name":"Fusível (FU)","generator.name":"Gerador (G)","grid-source.name":"Fonte da rede","grounding-transformer.name":"Transformador de aterramento (zig-zag)","inverter.name":"Inversor (CC→CA)","load-switch.name":"Chave de carga","load.name":"Carga","luminaire.name":"Luminária (carga de iluminação)","panelboard.name":"Quadro de distribuição","ngr.name":"Resistor de aterramento de neutro (NGR)","pt.name":"Transformador de tensão (PT)","pv.name":"Módulo fotovoltaico","rectifier.name":"Retificador (CA→CC)","series-reactor.name":"Reator série","shunt-capacitor.name":"Capacitor em derivação","shunt-reactor.name":"Reator em derivação","sync-motor.name":"Motor síncrono","transformer-2w.name":"Transformador de dois enrolamentos","transformer-3w.name":"Transformador de três enrolamentos","wind-turbine.name":"Aerogerador","gfci-breaker.name":"Disjuntor GFCI (RCBO)","rcd.name":"Dispositivo de corrente residual (RCD)","recloser.name":"Religador","energy-meter.name":"Medidor de energia (Wh)","voltmeter.name":"Voltímetro (V)","ammeter.name":"Amperímetro (A)","wattmeter.name":"Wattímetro (W)","frequency-meter.name":"Frequencímetro (Hz)","contactor.name":"Contator (KM)","motor-starter.name":"Chave de partida de motor","thermal-overload.name":"Relé de sobrecarga térmica","vfd.name":"Inversor de frequência (VFD)","soft-starter.name":"Chave de partida suave","transfer-switch.name":"Chave de transferência (ATS)","dc-disconnector.name":"Seccionador CC","dc-combiner.name":"Caixa combinadora CC","ev-charger.name":"Carregador de veículo elétrico (VE)","arc-suppression-coil.desc":"Aterramento ressonante de neutro: indutor ligado à terra","busbar.desc":"Segmento de barramento único e extensível, com múltiplas derivações","converter-bidir.desc":"Conversor de armazenamento: CA ↔ CC bidirecional","dc-dc-converter.desc":"Conversor CC/CC / carregador CC (IEC 60617)","mppt.desc":"Controlador de carga solar MPPT (CC/CC, rastreamento do ponto de máxima potência)","earthing-switch.desc":"Seccionador + conexão à terra, porta única","grid-source.desc":"Barramento infinito / rede externa","grounding-transformer.desc":"Transformador estrela-zigue-zague para aterramento de neutro","load.desc":"Carga abstrata (seta de saída de corrente)","luminaire.desc":"Carga de iluminação (símbolo geral de luminária IEC 60617)","ngr.desc":"Aterramento de baixa resistência: neutro do transformador à terra","series-reactor.desc":"Mesmo símbolo do reator em derivação; diferenciado pelo uso","wind-turbine.desc":"Aerogerador: gerador + marca de rotor de três pás","gfci-breaker.desc":"Disjuntor de corrente residual com proteção contra sobrecorrente (UL943 / IEC 61009). GFCI na América do Norte / RCBO na Europa.","rcd.desc":"Disjuntor de corrente residual sem proteção contra sobrecorrente (IEC 61008).","recloser.desc":"Religador automático de média tensão.","energy-meter.desc":"Medidor de energia ativa (kWh) — entrada de serviço / submedição.","contactor.desc":"Contator de circuito principal; normalmente usado com um relé de sobrecarga térmica e um motor.","motor-starter.desc":"Chave de partida de motor (símbolo geral IEC 60617).","thermal-overload.desc":"Relé de sobrecarga térmica do motor; posicionado entre o contator e o motor.","vfd.desc":"Inversor de frequência (Variable Frequency Drive) para controle de velocidade de motores de indução.","soft-starter.desc":"Chave de partida suave do motor (partida a tensão reduzida com tiristores).","transfer-switch.desc":"Chave de transferência de duas fontes (ATS / manual). Duas entradas de fonte + uma saída de carga, com intertravamento mecânico.","dc-disconnector.desc":"Seccionador CC — isolamento do lado CC de string fotovoltaica / bateria.","dc-combiner.desc":"Caixa combinadora de strings fotovoltaicos (exemplo com 4 entradas).","ev-charger.desc":"Estação de recarga de veículos elétricos.","breaker.state.open":"Aberto","disconnector.state.open":"Aberto","earthing-switch.state.open":"Aberto","fuse.state.blown":"Queimado","load-switch.state.open":"Aberto","gfci-breaker.state.open":"Aberto","rcd.state.open":"Aberto","recloser.state.open":"Aberto","contactor.state.open":"Aberto","thermal-overload.state.tripped":"Atuado","transfer-switch.state.position":"Posição (normal/emergência/desligado)","dc-disconnector.state.open":"Aberto","battery.param.E":"Capacidade","busbar.param.Un":"Tensão nominal","converter-bidir.param.S":"Capacidade","dc-dc-converter.param.P":"Potência","mppt.param.I":"Corrente nominal","load.param.P":"Potência ativa","load.param.cosphi":"Fator de potência","ngr.param.R":"Resistência","shunt-capacitor.param.Q":"Potência reativa","shunt-capacitor.param.stages":"Estágios","transformer-2w.param.S":"Capacidade","transformer-2w.param.ratio":"Relação de transformação","gfci-breaker.param.In":"Corrente nominal","gfci-breaker.param.IDn":"Corrente residual de atuação","rcd.param.IDn":"Corrente residual de atuação","breaker.param.In":"Corrente nominal","breaker.param.poles":"Polos","breaker.param.Icu":"Capacidade de interrupção","disconnector.param.In":"Corrente nominal","fuse.param.In":"Corrente nominal","resistor.name":"Resistor (R)","capacitor.name":"Capacitor (C)","diode.name":"Diodo (D)","indicator-light.name":"Lâmpada de sinalização (HL)","push-button.name":"Botoeira (SB)","relay-coil.name":"Bobina de relé (KA)","make-contact.name":"Contato normalmente aberto (NO)","break-contact.name":"Contato normalmente fechado (NC)","bell.name":"Campainha (HA)","terminal.name":"Terminal / junção (X)","fuse-switch-disconnector.name":"Chave seccionadora-fusível","socket-outlet.name":"Tomada / conector","inductor.name":"Indutor (L)","voltage-regulator.name":"Regulador de tensão (T)","dc-motor.name":"Motor CC (M)","heater.name":"Elemento de aquecimento (EH)","selector-switch.name":"Chave seletora (SA)","limit-switch.name":"Chave fim de curso (SQ)","proximity-switch.name":"Chave de proximidade (SQ)","time-relay.name":"Relé temporizador (KT)","buzzer.name":"Zumbidor (HA)","siren.name":"Sirene (HA)","thermocouple.name":"Termopar (BT)","thyristor.name":"Tiristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diodo zener (D)","igbt.name":"IGBT","plc.name":"CLP / controlador","ups.name":"No-break (UPS)","power-supply.name":"Fonte de alimentação (PS)","genset.name":"Grupo gerador (G)","protective-relay.name":"Relé de proteção","overcurrent-relay.name":"Relé de sobrecorrente (50/51)","undervoltage-relay.name":"Relé de subtensão (27)","reverse-power-relay.name":"Relé de potência reversa (32)","distance-relay.name":"Relé de distância (21)","phase-failure-relay.name":"Relé de falta de fase","buchholz-relay.name":"Relé Buchholz (63)","power-factor-meter.name":"Medidor de fator de potência (cosφ)","synchronoscope.name":"Sincronoscópio","varmeter.name":"Varímetro (var)","resistor.desc":"Resistor geral / limitador de corrente / resistor de frenagem.","capacitor.desc":"Capacitor geral / de filtro / do barramento CC. Use o capacitor em derivação para correção do fator de potência.","diode.desc":"Diodo retificador / de roda livre / de proteção. t1 = ânodo (topo), t2 = cátodo (base).","indicator-light.desc":"Lâmpada de sinalização / indicação de status.","push-button.desc":"Botoeira manual, retorno automático (contato NA).","relay-coil.desc":"Bobina de acionamento de relé / contator (caixa).","make-contact.desc":"Contato auxiliar normalmente aberto (NA).","break-contact.desc":"Contato auxiliar normalmente fechado (NF).","bell.desc":"Campainha de sinalização / alarme.","terminal.desc":"Terminal / caixa de junção / nó de conexão.","fuse-switch-disconnector.desc":"Chave seccionadora-fusível sob carga.","socket-outlet.desc":"Tomada de energia / conector multipolar.","inductor.desc":"Indutor geral / bobina / reator.","voltage-regulator.desc":"Regulador de tensão ajustável do tipo indução / autotransformador.","dc-motor.desc":"Motor CC (símbolo geral de campo série).","heater.desc":"Elemento resistivo de aquecimento / carga térmica.","selector-switch.desc":"Chave seletora / comutadora (rotativa, com retenção de posição).","limit-switch.desc":"Chave fim de curso / de posição (NA, acionamento mecânico).","proximity-switch.desc":"Sensor de proximidade / chave de proximidade sem contato.","time-relay.desc":"Bobina de relé temporizado (de operação retardada).","buzzer.desc":"Zumbidor de sinalização.","siren.desc":"Sirene sonora / de alarme.","thermocouple.desc":"Sensor de temperatura por termopar.","thyristor.desc":"Tiristor triodo de bloqueio reverso / SCR. t1 = ânodo (topo), t2 = cátodo (base).","triac.desc":"Tiristor triodo bidirecional (TRIAC).","zener-diode.desc":"Diodo zener / regulador de tensão. t1 = ânodo (topo), t2 = cátodo (base).","igbt.desc":"IGBT de canal N, modo intensificação. t1 = coletor (topo), t2 = emissor (base), t_g = gate.","plc.desc":"Controlador lógico programável (CLP).","ups.desc":"No-break online / standby (fonte de alimentação ininterrupta).","power-supply.desc":"Fonte chaveada CA→CC / fonte CC. t_ac no topo (~), t_dc na base (=).","genset.desc":"Grupo gerador a diesel / gás.","protective-relay.desc":"Relé de medição / proteção, símbolo geral (IEC 60617).","overcurrent-relay.desc":"Relé de proteção de sobrecorrente (ANSI 50/51).","undervoltage-relay.desc":"Relé de proteção de subtensão (ANSI 27).","reverse-power-relay.desc":"Relé de proteção de potência reversa / corrente reversa (ANSI 32).","distance-relay.desc":"Relé de proteção de distância / subimpedância (ANSI 21).","phase-failure-relay.desc":"Relé de proteção de falta de fase / perda de fase.","buchholz-relay.desc":"Relé Buchholz / relé de gás (ANSI 63).","power-factor-meter.desc":"Medidor de fator de potência (cosφ).","synchronoscope.desc":"Indicador de sincronismo / sincronoscópio.","varmeter.desc":"Medidor de potência reativa (var).","make-contact.state.closed":"Fechado","break-contact.state.open":"Aberto","fuse-switch-disconnector.state.open":"Aberto","selector-switch.state.open":"Aberto","limit-switch.state.closed":"Fechado","resistor.param.R":"Resistência","resistor.param.P":"Potência nominal","capacitor.param.C":"Capacitância","capacitor.param.Un":"Tensão nominal","indicator-light.param.color":"Cor","inductor.param.L":"Indutância","inductor.param.In":"Corrente nominal","voltage-regulator.param.ratio":"Faixa de regulação","heater.param.P":"Potência","ups.param.S":"Capacidade","power-supply.param.Vdc":"Tensão de saída","genset.param.P":"Potência"},uS={ui:cS,library:dS},mS={"common.unnamed":"無題","common.close":"閉じる","common.yes":"はい","common.no":"いいえ","topbar.theme.toLight":"ライトモードに切り替え","topbar.theme.toDark":"ダークモードに切り替え","topbar.theme.currentDark":"現在:ダークテーマ","topbar.theme.currentLight":"現在:ライトテーマ","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"現在:中国語","topbar.export.label":"エクスポート","topbar.export.tooltip":"SVGベクター(編集可能)、PNGビットマップ(2倍高精細)、またはDXF(CAD用)","topbar.export.pngFailed":"PNGのエクスポートに失敗しました:{err}","topbar.export.dxfFailed":"DXFのエクスポートに失敗しました:{err}","topbar.file.label":"ファイル","topbar.file.tooltip":"ローカルの .json 図面を開く、保存、または名前を付けて保存","topbar.file.current":"現在:{name}","topbar.file.new":"新規","topbar.file.open":"開く…","topbar.file.save":"保存","topbar.file.saveAs":"名前を付けて保存…","topbar.file.newConfirm":"新規作成すると保存されていない変更は破棄されます。続行しますか?","topbar.file.openFailed":"開けませんでした:{err}","topbar.file.saveFailed":"保存に失敗しました:{err}","topbar.file.fileDescription":"OneLineEditor 図面","outline.title":"アウトライン","outline.collapse":"折りたたむ","outline.collapseAria":"アウトラインを折りたたむ","outline.empty":"(要素がありません — ライブラリからドラッグして開始)","props.title":"プロパティ","props.node":"電気ノード","props.wire":"配線","props.bus":"母線","props.junction":"接続点","props.junctionPos":"位置","props.nSelected":"{n} 個選択中","props.empty":"選択なし","props.multi":"{n} 個の要素を選択中","props.name":"名前","props.note":"メモ","props.label":"ラベル","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"電気ノード {id} が見つかりません","props.wireNotFound":"配線 {id} が見つかりません","props.nodeStats":"端子 {terminals} 個 · 要素 {elements} 個","props.selectElement":"{label} を選択","props.selectWholeNode":"電気ノード全体を選択","props.annText":"テキスト","props.annRect":"矩形","props.annLine":"線","props.annTable":"表","props.annNotFound":"注釈 {id} が見つかりません","props.annLabel":"ラベル","props.annLabelPlaceholder":"例:配電盤 1","props.annStroke":"線種","props.annStrokeSolid":"実線","props.annStrokeDashed":"破線","props.annFill":"塗りつぶし","props.annFillNone":"なし","props.annFillTint":"淡色","props.annArrow":"矢印","props.annArrowNone":"なし","props.annArrowEnd":"片側","props.annArrowBoth":"両側","props.annFontSize":"フォントサイズ","props.annRows":"行数","props.annCols":"列数","view.zoomOut":"ズームアウト","view.zoomOutHint":"段階的にズームアウト。ホイール ↓ や ⌘− でも可","view.reset":"100% にリセット","view.current":"現在 {z}%","view.zoomIn":"ズームイン","view.zoomInHint":"段階的にズームイン。ホイール ↑ や ⌘+ でも可","view.fit":"全体表示","view.fitHint":"すべての要素を自動でズームして中央に配置","view.gridHide":"グリッドを非表示","view.gridShow":"グリッドを表示","view.gridHotkey":"G","view.gridHideHint":"グリッドへのスナップも無効化(自由配置)","view.gridShowHint":"グリッドへのスナップも有効化(ドラッグ時に10pxにスナップ)","view.gridHideAria":"グリッドを非表示にしてスナップを無効化","view.gridShowAria":"グリッドを表示してスナップを有効化","view.label":"ラベル","view.labelOff":"オフ","view.labelId":"ID","view.labelAll":"ID + パラメータ","view.labelHint":"ラベルの表示と文字サイズ(書き出しにも反映)","view.labelSize":"サイズ","view.labelSizeSmaller":"ラベルを小さく","view.labelSizeLarger":"ラベルを大きく","view.labelSizeReset":"既定のサイズに戻す","library.title":"ライブラリ","library.empty":"該当する要素がありません","library.searchPlaceholder":"要素を検索…","library.searchAria":"要素を検索","library.clearSearch":"検索をクリア","library.itemHint":"クリックで配置モードに入る、またはキャンバスへドラッグ","tool.select":"選択","tool.selectHint":"クリックで選択、範囲選択で複数選択、右クリックでメニュー","tool.pan":"パン","tool.panHint":"キャンバスをドラッグ。スペースキーで一時的に切替","tool.wire":"配線","tool.wireHint":"ピン/母線/接続点からドラッグ。空白部分へドロップすると接続点を新設、配線上へドロップすると分岐点を作成","tool.bus":"母線","tool.busHint":"キャンバス上でドラッグ — 押下で始点、離すと終点を設定","tool.junction":"接続点","tool.junctionHint":"キャンバスをクリックして接続点(ノード)を配置。配線を自由に接続可能","tool.place":"配置","tool.placeHint":"クリックで配置。端子/母線からドラッグすると配置と同時に接続","tool.text":"テキスト","tool.textHint":"キャンバスをクリックしてテキスト注釈を配置。既存の注釈はダブルクリックで編集","tool.rect":"矩形","tool.rectHint":"ドラッグで矩形/グループ枠を描画(既定は破線)。Shiftで正方形","tool.line":"線","tool.lineHint":"ドラッグで注釈線を描画。Shiftで45°に固定。矢印はパネルで設定","tool.table":"表","tool.tableHint":"ドラッグで列×行を指定(リアルタイム表示)、またはクリックで既定サイズの表を配置。セルはダブルクリックで入力","mode.selectWithSel":"要素をドラッグして移動 · 端子をドラッグして配線 · 右クリックでメニュー","mode.selectEmpty":"クリックで選択 · ドラッグで移動 · 範囲選択で複数選択 · 右クリックでメニュー","mode.pan":"キャンバスをドラッグ · スクロールでズーム · どのツールでもスペース長押しでパン","mode.wireDragging":"ピン/母線/接続点上で離す。空白部分で離すと接続点を新設","mode.wireInit":"任意の接続点または空白部分を押下し、目標にドラッグして離す","mode.busDragging":"ドラッグで母線の方向を決定。離すと終点を設定","mode.busInit":"キャンバスを押下して始点を設定し、ドラッグして終点で離す","mode.junction":"キャンバスをクリックして接続点を配置","mode.placeNoKind":"左側のライブラリから要素の種類を選択してください","mode.placeFromTerm":"目標位置で離すと、新しい要素が元の端子に接続されます","mode.placeNormal":"空白部分をクリックして配置。端子/母線からドラッグすると配置と同時に接続","mode.text":"クリックでテキストを配置 · ダブルクリックで編集 · 選択してドラッグで移動 · Delで削除","mode.rect":"ドラッグで矩形を描画 · Shiftで正方形 · 離した後にサイズ変更やラベル設定が可能","mode.line":"ドラッグで線を描画 · Shiftで45°に固定 · 離した後にパネルで矢印を追加","mode.table":"ドラッグでマス目を指定、またはクリックで3×3の表を配置 · セルはダブルクリックで入力","mode.annTextSel":"テキストをクリックして編集 · ドラッグで移動 · Delで削除","mode.annTableSel":"セルをクリックして入力 · ドラッグで移動 · Delで削除","mode.annShapeSel":"ドラッグで移動 · ハンドルをドラッグしてサイズ変更 · パネルでスタイルを変更 · Delで削除","mode.annEditing":"入力 · Enterで確定 · Escでキャンセル · または ✓ / ✕ ボタン","mode.escSelect":"Escで選択を解除","mode.escOther":"右クリック/Escでキャンセル","tool.placeNoKindTooltip":"左側のライブラリで種類を選択してから、キャンバスをクリック","tool.undo":"元に戻す","tool.undoHint":"直前の編集を元に戻す(移動/回転/削除など)","tool.redo":"やり直す","tool.redoHint":"元に戻した操作をやり直す","layout.label":"レイアウト","layout.hint":"図面全体または選択部分を自動レイアウトし、空きを埋める","layout.allAuto":"すべて自動レイアウト","layout.selAuto":"選択部分を自動レイアウト","layout.allFill":"未配置を埋める","layout.selFill":"選択部分の未配置を埋める","tool.more":"その他","tool.moreHint":"元に戻す/やり直す/レイアウト","view.menu":"表示","view.menuHint":"ズーム・全体表示・グリッド","ctx.ariaNode":"ノード操作","ctx.ariaWire":"配線操作","ctx.ariaElement":"要素操作","ctx.ariaEdit":"編集操作","ctx.done":"完了","ctx.cancel":"キャンセル","ctx.rotate":"90°回転","ctx.rotateHint":"選択部分を時計回りに回転。配線は新しい端子位置に合わせて再配線","ctx.mirror":"左右反転","ctx.mirrorTitle":"反転","ctx.mirrorHint":"選択部分を左右反転","ctx.delete":"削除","ctx.deleteHintNode":"このノードのすべての配線を切断(要素は残る)","ctx.deleteHintWire":"この配線のみを削除(同じノードの他の配線は残る)","ctx.deleteHintElement":"選択部分とその配線を削除","ctx.resetWirePath":"自動配線に戻す","ctx.resetWirePathHint":"手動で調整した折れ点を破棄し、自動ルーティングで再描画","menu.undo":"元に戻す","menu.redo":"やり直す","menu.cut":"切り取り","menu.copy":"コピー","menu.paste":"貼り付け","menu.rotate":"90°回転","menu.mirror":"反転","menu.selectAll":"すべて選択","menu.disconnect":"この配線を切断","menu.delete":"削除","io.parseFailed":"JSONの解析に失敗しました:{err}","io.notObject":"ファイルがJSONオブジェクトではありません","io.versionMismatch":'バージョン不一致:"1" が必要ですが、{actual} でした',"io.elementsMissing":"`elements` が存在しないか、配列ではありません","compile.duplicateId":'要素IDが重複しています:"{id}"',"compile.unknownKind":'不明な要素種別 kind="{kind}"',"compile.invalidTermRef":'無効な端子参照 "{ref}"',"compile.elementMissing":'存在しない要素への参照 "{id}"',"compile.missingPin":'要素 "{id}"(kind={kind})にピン "{pin}" がありません。使用可能:{available}',"compile.singleTerminal":"ノードに端子が1つしかないため無視されました","compile.layoutMissingElement":'layoutキー "{id}" が存在しない要素を参照しています',"compile.elementUnconnected":'要素 "{id}" に接続がありません',"cat.busbar":"母線/配線","cat.switching":"開閉器","cat.protection":"保護","cat.motor-control":"電動機制御","cat.transformer":"変圧器","cat.instrument-transformer":"計器用変成器","cat.measurement":"計測","cat.source":"電源","cat.load":"負荷","cat.storage":"蓄電","cat.compensation":"無効電力補償","cat.grounding":"接地","cat.renewable":"再生可能エネルギー/パワーエレクトロニクス","onboard.title":"クイックスタート","onboard.step1.title":"部品を配置","onboard.step1.body":"配置ツール(P)を選び、ライブラリから種類をキャンバスへドラッグ","onboard.step2.title":"配線する","onboard.step2.body":"配線ツール(W)を使用:ピンから別のピンへドラッグ。空白部分へドラッグすると接続点を新設","onboard.step3.title":"母線は共用レールであり、配線ではありません","onboard.step3.body":"複数の回路が1本のレールを共有する場合のみ母線ツール(B)を使用してください。2つの機器をつなぐために母線を使わないでください — 配線ツール(W)でピン同士を直接つないでください。","onboard.dismiss":"了解"},pS={"arc-suppression-coil.name":"消弧コイル","arrester.name":"避雷器 (FBL)","async-motor.name":"誘導電動機","autotransformer.name":"単巻変圧器","battery.name":"蓄電池","breaker.name":"遮断器 (QF)","busbar.name":"母線区間","converter-bidir.name":"双方向コンバータ (PCS)","dc-dc-converter.name":"DC/DCコンバータ","mppt.name":"MPPTコントローラ","ct.name":"変流器 (CT)","disconnector.name":"断路器 (QS)","earth.name":"接地","earthing-switch.name":"接地開閉器 (QE)","fuse.name":"ヒューズ (FU)","generator.name":"発電機 (G)","grid-source.name":"系統電源","grounding-transformer.name":"接地変圧器(ジグザグ結線)","inverter.name":"インバータ (DC→AC)","load-switch.name":"負荷開閉器","load.name":"負荷","luminaire.name":"照明器具(照明負荷)","panelboard.name":"分電盤","ngr.name":"中性点接地抵抗器 (NGR)","pt.name":"計器用変圧器 (PT)","pv.name":"太陽電池モジュール","rectifier.name":"整流器 (AC→DC)","series-reactor.name":"直列リアクトル","shunt-capacitor.name":"並列コンデンサ","shunt-reactor.name":"並列リアクトル","sync-motor.name":"同期電動機","transformer-2w.name":"二巻線変圧器","transformer-3w.name":"三巻線変圧器","wind-turbine.name":"風力発電機","gfci-breaker.name":"漏電遮断器 (RCBO)","rcd.name":"漏電遮断器 (RCD)","recloser.name":"リクローザ","energy-meter.name":"電力量計 (Wh)","voltmeter.name":"電圧計 (V)","ammeter.name":"電流計 (A)","wattmeter.name":"電力計 (W)","frequency-meter.name":"周波数計 (Hz)","contactor.name":"電磁接触器 (KM)","motor-starter.name":"電動機始動器","thermal-overload.name":"熱動過負荷継電器","vfd.name":"可変周波数ドライブ (VFD)","soft-starter.name":"ソフトスターター","transfer-switch.name":"自動切替開閉器 (ATS)","dc-disconnector.name":"直流断路器","dc-combiner.name":"直流接続箱","ev-charger.name":"EV充電器","arc-suppression-coil.desc":"共振接地方式:中性点と大地間にリアクトルを接続","busbar.desc":"複数の分岐に対応する伸縮可能な単一母線区間","converter-bidir.desc":"蓄電用コンバータ:双方向 AC ↔ DC 変換","dc-dc-converter.desc":"DC/DCコンバータ/直流充電器(IEC 60617)","mppt.desc":"MPPT太陽光充電コントローラ(DC/DC、最大電力点追従)","earthing-switch.desc":"断路器と接地接続を兼ねる単一ポート機器","grid-source.desc":"無限大母線/外部系統","grounding-transformer.desc":"中性点接地用のスター・ジグザグ結線変圧器","load.desc":"抽象負荷(電流流出方向の矢印)","luminaire.desc":"照明負荷(IEC 60617 照明器具一般図記号)","ngr.desc":"低抵抗接地:変圧器中性点と大地間に接続","series-reactor.desc":"並列リアクトルと同一記号。用途によって区別","wind-turbine.desc":"風力発電機:発電機と三枚羽根ローターの記号","gfci-breaker.desc":"過電流保護付き漏電遮断器(UL943 / IEC 61009)。北米ではGFCI、欧州ではRCBOと呼ばれる。","rcd.desc":"過電流保護なしの漏電遮断器(IEC 61008)。","recloser.desc":"中電圧用自動再閉路装置。","energy-meter.desc":"有効電力量計(kWh)— 引込口/子メーター用。","contactor.desc":"主回路用電磁接触器。通常、熱動過負荷継電器や電動機と組み合わせて使用。","motor-starter.desc":"電動機始動器(IEC 60617 一般記号)。","thermal-overload.desc":"電動機用熱動過負荷継電器。接触器と電動機の間に設置。","vfd.desc":"誘導電動機の速度制御用可変周波数ドライブ。","soft-starter.desc":"電動機用ソフトスターター(サイリスタによる低電圧始動方式)。","transfer-switch.desc":"二電源切替開閉器(自動/手動)。2つの電源入力と1つの負荷出力を持ち、機械的にインターロックされる。","dc-disconnector.desc":"直流断路器 — 太陽光ストリングや蓄電池の直流側を切り離す。","dc-combiner.desc":"太陽光ストリング用接続箱(4入力の例)。","ev-charger.desc":"電気自動車用充電ステーション。","breaker.state.open":"開","disconnector.state.open":"開","earthing-switch.state.open":"開","fuse.state.blown":"溶断","load-switch.state.open":"開","gfci-breaker.state.open":"開","rcd.state.open":"開","recloser.state.open":"開","contactor.state.open":"開","thermal-overload.state.tripped":"動作","transfer-switch.state.position":"位置(通常/非常用/オフ)","dc-disconnector.state.open":"開","battery.param.E":"容量","busbar.param.Un":"定格電圧","converter-bidir.param.S":"容量","dc-dc-converter.param.P":"電力","mppt.param.I":"定格電流","load.param.P":"有効電力","load.param.cosphi":"力率","ngr.param.R":"抵抗","shunt-capacitor.param.Q":"無効電力容量","shunt-capacitor.param.stages":"段数","transformer-2w.param.S":"容量","transformer-2w.param.ratio":"巻数比","gfci-breaker.param.In":"定格電流","gfci-breaker.param.IDn":"定格感度電流","rcd.param.IDn":"定格感度電流","breaker.param.In":"定格電流","breaker.param.poles":"極数","breaker.param.Icu":"定格遮断容量","disconnector.param.In":"定格電流","fuse.param.In":"定格電流","resistor.name":"抵抗器 (R)","capacitor.name":"コンデンサ (C)","diode.name":"ダイオード (D)","indicator-light.name":"表示灯 (HL)","push-button.name":"押しボタンスイッチ (SB)","relay-coil.name":"リレーコイル (KA)","make-contact.name":"a接点 (NO)","break-contact.name":"b接点 (NC)","bell.name":"ベル (HA)","terminal.name":"端子台/接続点 (X)","fuse-switch-disconnector.name":"ヒューズ付断路器","socket-outlet.name":"コンセント/コネクタ","inductor.name":"インダクタ (L)","voltage-regulator.name":"電圧調整器 (T)","dc-motor.name":"直流電動機 (M)","heater.name":"発熱体 (EH)","selector-switch.name":"切替スイッチ (SA)","limit-switch.name":"リミットスイッチ (SQ)","proximity-switch.name":"近接スイッチ (SQ)","time-relay.name":"タイムリレー (KT)","buzzer.name":"ブザー (HA)","siren.name":"サイレン (HA)","thermocouple.name":"熱電対 (BT)","thyristor.name":"サイリスタ/SCR (V)","triac.name":"トライアック (V)","zener-diode.name":"ツェナーダイオード (D)","igbt.name":"IGBT","plc.name":"PLC/コントローラ","ups.name":"UPS","power-supply.name":"電源装置 (PS)","genset.name":"発電機セット (G)","protective-relay.name":"保護継電器","overcurrent-relay.name":"過電流継電器 (50/51)","undervoltage-relay.name":"不足電圧継電器 (27)","reverse-power-relay.name":"逆電力継電器 (32)","distance-relay.name":"距離継電器 (21)","phase-failure-relay.name":"欠相継電器","buchholz-relay.name":"ブッフホルツ継電器 (63)","power-factor-meter.name":"力率計 (cosφ)","synchronoscope.name":"同期検定器","varmeter.name":"無効電力計 (var)","resistor.desc":"汎用抵抗器/限流抵抗/制動抵抗。","capacitor.desc":"汎用/フィルタ/直流母線用コンデンサ。力率改善には並列コンデンサを使用。","diode.desc":"整流/還流/保護用ダイオード。t1 = アノード(上)、t2 = カソード(下)。","indicator-light.desc":"信号/状態表示灯。","push-button.desc":"手動押しボタン、自動復帰式(a接点)。","relay-coil.desc":"リレー/接触器の操作コイル(箱形記号)。","make-contact.desc":"常開補助接点(a接点)。","break-contact.desc":"常閉補助接点(b接点)。","bell.desc":"信号ベル/警報ベル。","terminal.desc":"端子台/接続箱/接続ノード。","fuse-switch-disconnector.desc":"負荷時開閉可能なヒューズ付断路器。","socket-outlet.desc":"電源コンセント/多極コネクタ。","inductor.desc":"汎用インダクタ/コイル/チョーク。","voltage-regulator.desc":"誘導形/単巻変圧器形の可変電圧調整器。","dc-motor.desc":"直流電動機(直巻界磁の一般記号)。","heater.desc":"抵抗発熱体/加熱負荷。","selector-switch.desc":"切替スイッチ(回転式、保持形)。","limit-switch.desc":"行程/位置スイッチ(a接点、機械操作式)。","proximity-switch.desc":"近接センサー/非接触式近接スイッチ。","time-relay.desc":"限時(動作遅延)リレーコイル。","buzzer.desc":"信号ブザー。","siren.desc":"音響サイレン/警報器。","thermocouple.desc":"熱電対温度センサー。","thyristor.desc":"逆阻止三端子サイリスタ/SCR。t1 = アノード(上)、t2 = カソード(下)。","triac.desc":"双方向三端子サイリスタ(トライアック)。","zener-diode.desc":"ツェナー/定電圧ダイオード。t1 = アノード(上)、t2 = カソード(下)。","igbt.desc":"Nチャネルエンハンスメント形IGBT。t1 = コレクタ(上)、t2 = エミッタ(下)、t_g = ゲート。","plc.desc":"プログラマブルロジックコントローラ(PLC)。","ups.desc":"オンライン/常時商用給電式無停電電源装置。","power-supply.desc":"AC→DCスイッチング/直流電源装置。t_ac は上(~)、t_dc は下(=)。","genset.desc":"ディーゼル/ガス発電機セット。","protective-relay.desc":"計測/保護継電器の一般記号(IEC 60617)。","overcurrent-relay.desc":"過電流保護継電器(ANSI 50/51)。","undervoltage-relay.desc":"不足電圧保護継電器(ANSI 27)。","reverse-power-relay.desc":"逆電力/逆電流保護継電器(ANSI 32)。","distance-relay.desc":"距離/低インピーダンス保護継電器(ANSI 21)。","phase-failure-relay.desc":"欠相保護継電器。","buchholz-relay.desc":"ブッフホルツ/ガス継電器(ANSI 63)。","power-factor-meter.desc":"力率計(cosφ)。","synchronoscope.desc":"同期検定器/同期指示計。","varmeter.desc":"無効電力計(var)。","make-contact.state.closed":"閉","break-contact.state.open":"開","fuse-switch-disconnector.state.open":"開","selector-switch.state.open":"開","limit-switch.state.closed":"閉","resistor.param.R":"抵抗","resistor.param.P":"定格電力","capacitor.param.C":"静電容量","capacitor.param.Un":"定格電圧","indicator-light.param.color":"色","inductor.param.L":"インダクタンス","inductor.param.In":"定格電流","voltage-regulator.param.ratio":"調整範囲","heater.param.P":"電力","ups.param.S":"容量","power-supply.param.Vdc":"出力電圧","genset.param.P":"電力"},hS={ui:mS,library:pS},fS={"common.unnamed":"Без имени","common.close":"Закрыть","common.yes":"Да","common.no":"Нет","topbar.theme.toLight":"Переключить на светлую","topbar.theme.toDark":"Переключить на тёмную","topbar.theme.currentDark":"Текущая: тёмная тема","topbar.theme.currentLight":"Текущая: светлая тема","topbar.lang.toEnglish":"Переключить на английский","topbar.lang.toChinese":"Переключить на китайский","topbar.lang.currentEnglish":"Текущий: английский","topbar.lang.currentChinese":"Текущий: китайский","topbar.export.label":"Экспорт","topbar.export.tooltip":"Векторный SVG (редактируемый), растровый PNG (2× HiDPI) или DXF (для CAD)","topbar.export.pngFailed":"Не удалось экспортировать PNG: {err}","topbar.export.dxfFailed":"Не удалось экспортировать DXF: {err}","topbar.file.label":"Файл","topbar.file.tooltip":"Открыть локальную схему .json, сохранить или сохранить как","topbar.file.current":"Текущий: {name}","topbar.file.new":"Новый","topbar.file.open":"Открыть…","topbar.file.save":"Сохранить","topbar.file.saveAs":"Сохранить как…","topbar.file.newConfirm":"Создание нового файла отменит все несохранённые изменения. Продолжить?","topbar.file.openFailed":"Не удалось открыть: {err}","topbar.file.saveFailed":"Не удалось сохранить: {err}","topbar.file.fileDescription":"Схема OneLineEditor","outline.title":"Структура","outline.collapse":"Свернуть","outline.collapseAria":"Свернуть структуру","outline.empty":"(Нет элементов — перетащите из библиотеки, чтобы начать)","props.title":"Свойства","props.node":"Электрический узел","props.wire":"Провод","props.bus":"Шина","props.junction":"Соединение","props.junctionPos":"Положение","props.nSelected":"Выбрано: {n}","props.empty":"Ничего не выбрано","props.multi":"Выбрано элементов: {n}","props.name":"Название","props.note":"Заметка","props.label":"Метка","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Электрический узел {id} не найден","props.wireNotFound":"Провод {id} не найден","props.nodeStats":"{terminals} выводов · {elements} элементов","props.selectElement":"Выбрать {label}","props.selectWholeNode":"Выбрать весь электрический узел","props.annText":"Текст","props.annRect":"Прямоугольник","props.annLine":"Линия","props.annTable":"Таблица","props.annNotFound":"Аннотация {id} не найдена","props.annLabel":"Подпись","props.annLabelPlaceholder":"например, Щит №1","props.annStroke":"Обводка","props.annStrokeSolid":"Сплошная","props.annStrokeDashed":"Пунктирная","props.annFill":"Заливка","props.annFillNone":"Нет","props.annFillTint":"Оттенок","props.annArrow":"Стрелки","props.annArrowNone":"Нет","props.annArrowEnd":"В конце","props.annArrowBoth":"С двух сторон","props.annFontSize":"Размер шрифта","props.annRows":"Строки","props.annCols":"Столбцы","view.zoomOut":"Уменьшить","view.zoomOutHint":"Уменьшение на шаг; также колесо ↓ или ⌘−","view.reset":"Сбросить на 100%","view.current":"Текущий масштаб {z}%","view.zoomIn":"Увеличить","view.zoomInHint":"Увеличение на шаг; также колесо ↑ или ⌘+","view.fit":"Вписать в экран","view.fitHint":"Автоматически масштабировать и центрировать все элементы","view.gridHide":"Скрыть сетку","view.gridShow":"Показать сетку","view.gridHotkey":"G","view.gridHideHint":"Также отключает привязку к сетке (свободное размещение)","view.gridShowHint":"Также включает привязку к сетке (шаг 10 px при перетаскивании)","view.gridHideAria":"Скрыть сетку и отключить привязку","view.gridShowAria":"Показать сетку и включить привязку","view.label":"Подписи","view.labelOff":"Выкл","view.labelId":"ID","view.labelAll":"ID + параметры","view.labelHint":"Видимость и размер подписей (в том числе при экспорте)","view.labelSize":"Размер","view.labelSizeSmaller":"Уменьшить размер подписей","view.labelSizeLarger":"Увеличить размер подписей","view.labelSizeReset":"Сбросить размер подписей","library.title":"Библиотека","library.empty":"Нет подходящих элементов","library.searchPlaceholder":"Поиск элементов…","library.searchAria":"Поиск элементов","library.clearSearch":"Очистить поиск","library.itemHint":"Нажмите, чтобы включить режим размещения, или перетащите на холст","tool.select":"Выбор","tool.selectHint":"Клик — выбрать один, рамка — несколько, правая кнопка — меню","tool.pan":"Рука","tool.panHint":"Перетаскивайте холст; пробел временно переключает инструмент","tool.wire":"Провод","tool.wireHint":"Тяните от вывода / шины / точки соединения; в пустое место — создаст точку соединения, на провод — врежется в него","tool.bus":"Шина","tool.busHint":"Тяните по холсту — нажатие задаёт начало, отпускание — конец","tool.junction":"Соединение","tool.junctionHint":"Нажмите на холст, чтобы поставить точку соединения (узел); провода свободно подключаются к ней","tool.place":"Элемент","tool.placeHint":"Нажмите, чтобы разместить; или перетащите от вывода / шины, чтобы разместить и подключить","tool.text":"Текст","tool.textHint":"Нажмите на холст, чтобы добавить текстовую заметку; дважды щёлкните существующую, чтобы изменить","tool.rect":"Прямоугольник","tool.rectHint":"Перетащите, чтобы нарисовать прямоугольник / рамку группы (по умолчанию пунктирную); Shift — квадрат","tool.line":"Линия","tool.lineHint":"Перетащите, чтобы нарисовать линию-аннотацию; Shift — привязка к 45°; стрелки настраиваются в панели","tool.table":"Таблица","tool.tableHint":"Перетащите, чтобы задать столбцы × строки (счётчик в реальном времени), или нажмите для таблицы по умолчанию; дважды щёлкните ячейку, чтобы ввести текст","mode.selectWithSel":"Перетаскивайте элементы · тяните от вывода, чтобы провести провод · правая кнопка — меню","mode.selectEmpty":"Клик — выбрать · перетаскивание — переместить · рамка — несколько · правая кнопка — меню","mode.pan":"Перетаскивайте холст · колесо — масштаб · удерживайте пробел для панорамирования в любом инструменте","mode.wireDragging":"Отпустите на выводе / шине / точке соединения; отпускание в пустом месте создаст точку соединения","mode.wireInit":"Нажмите на любой точке подключения или в пустом месте, перетащите к цели и отпустите","mode.busDragging":"Перетаскивание задаёт направление шины; отпускание — конец","mode.busInit":"Нажмите на холст, чтобы задать начало, тяните и отпустите, чтобы задать конец","mode.junction":"Нажмите на холст, чтобы поставить точку соединения","mode.placeNoKind":"Выберите тип элемента в библиотеке слева","mode.placeFromTerm":"Отпустите у цели — новый элемент подключится к исходному выводу","mode.placeNormal":"Нажмите в пустом месте, чтобы разместить; или перетащите от вывода / шины, чтобы разместить и подключить","mode.text":"Нажмите, чтобы добавить текст · двойной клик — редактировать · перетаскивание выбранного — переместить · Del — удалить","mode.rect":"Перетащите, чтобы нарисовать прямоугольник · Shift — квадрат · после отпускания измените размер и подпись","mode.line":"Перетащите, чтобы нарисовать линию · Shift — привязка к 45° · стрелки добавьте в панели после отпускания","mode.table":"Перетащите, чтобы задать сетку, или нажмите для таблицы 3×3 · дважды щёлкните ячейку, чтобы ввести текст","mode.annTextSel":"Нажмите на текст, чтобы редактировать · перетащите, чтобы переместить · Del — удалить","mode.annTableSel":"Нажмите на ячейку, чтобы заполнить её · перетащите, чтобы переместить · Del — удалить","mode.annShapeSel":"Перетащите, чтобы переместить · тяните за маркеры, чтобы изменить размер · стиль — в панели · Del — удалить","mode.annEditing":"Введите текст · Enter — подтвердить · Esc — отмена · или кнопки ✓ / ✕","mode.escSelect":"Esc — снять выделение","mode.escOther":"Правая кнопка / Esc — отмена","tool.placeNoKindTooltip":"Выберите тип в библиотеке слева, затем нажмите на холст","tool.undo":"Отменить","tool.undoHint":"Отменить последнее действие (перемещение / поворот / удаление и т. д.)","tool.redo":"Повторить","tool.redoHint":"Повторить последнее отменённое действие","layout.label":"Компоновка","layout.hint":"Автоматически расставить всю схему или только выделенное, заполнить пропуски","layout.allAuto":"Автокомпоновка всей схемы","layout.selAuto":"Автокомпоновка выделенного","layout.allFill":"Расставить неразмещённые","layout.selFill":"Расставить неразмещённые в выделении","tool.more":"Ещё","tool.moreHint":"Отмена / повтор / компоновка","view.menu":"Вид","view.menuHint":"Масштаб, вписать, сетка","ctx.ariaNode":"Действия с узлом","ctx.ariaWire":"Действия с проводом","ctx.ariaElement":"Действия с элементом","ctx.ariaEdit":"Действия редактирования","ctx.done":"Готово","ctx.cancel":"Отмена","ctx.rotate":"Повернуть на 90°","ctx.rotateHint":"Повернуть выделенное по часовой стрелке; провода перестроятся через новые выводы","ctx.mirror":"Зеркально по горизонтали","ctx.mirrorTitle":"Зеркало","ctx.mirrorHint":"Отразить выделенное слева направо","ctx.delete":"Удалить","ctx.deleteHintNode":"Отключить все провода этого узла (элементы останутся)","ctx.deleteHintWire":"Удалить только этот провод (остальные провода узла останутся)","ctx.deleteHintElement":"Удалить выделенное и его провода","ctx.resetWirePath":"Сбросить на автотрассировку","ctx.resetWirePathHint":"Убрать вручную заданные изгибы и позволить перерисовать провод автоматически","menu.undo":"Отменить","menu.redo":"Повторить","menu.cut":"Вырезать","menu.copy":"Копировать","menu.paste":"Вставить","menu.rotate":"Повернуть на 90°","menu.mirror":"Зеркально","menu.selectAll":"Выбрать всё","menu.disconnect":"Отключить этот провод","menu.delete":"Удалить","io.parseFailed":"Ошибка разбора JSON: {err}","io.notObject":"Файл не является объектом JSON","io.versionMismatch":'Несовпадение версии: ожидалась "1", получено {actual}',"io.elementsMissing":"Поле `elements` отсутствует или не является массивом","compile.duplicateId":'Повторяющийся ID элемента: "{id}"',"compile.unknownKind":'Неизвестный тип элемента kind="{kind}"',"compile.invalidTermRef":'Некорректная ссылка на вывод "{ref}"',"compile.elementMissing":'Ссылка на несуществующий элемент "{id}"',"compile.missingPin":'У элемента "{id}" (kind={kind}) нет вывода "{pin}"; доступны: {available}',"compile.singleTerminal":"Узел содержит только один вывод — проигнорирован","compile.layoutMissingElement":'Ключ layout "{id}" ссылается на несуществующий элемент',"compile.elementUnconnected":'Элемент "{id}" не имеет подключений',"cat.busbar":"Шины / проводка","cat.switching":"Коммутация","cat.protection":"Защита","cat.motor-control":"Управление двигателем","cat.transformer":"Трансформаторы","cat.instrument-transformer":"Измерительные трансформаторы","cat.measurement":"Измерения","cat.source":"Источники","cat.load":"Нагрузка","cat.storage":"Накопители","cat.compensation":"Компенсация","cat.grounding":"Заземление","cat.renewable":"Возобновляемая энергетика / силовая электроника","onboard.title":"Быстрый старт","onboard.step1.title":"Разместите элемент","onboard.step1.body":"Выберите инструмент «Элемент» (P) и перетащите элемент из библиотеки на холст","onboard.step2.title":"Соедините проводом","onboard.step2.body":"Используйте инструмент «Провод» (W): тяните от одного вывода к другому — перетаскивание в пустое место создаст точку соединения","onboard.step3.title":"Шина — это общая линия, а не провод","onboard.step3.body":"Используйте инструмент «Шина» (B), только если несколько цепей используют одну общую линию. Не используйте шину для соединения двух устройств — просто соедините выводы проводом (W).","onboard.dismiss":"Понятно"},gS={"arc-suppression-coil.name":"Дугогасящая катушка","arrester.name":"Разрядник (FBL)","async-motor.name":"Асинхронный двигатель","autotransformer.name":"Автотрансформатор","battery.name":"Аккумуляторная батарея (накопитель)","breaker.name":"Автоматический выключатель (QF)","busbar.name":"Секция шины","converter-bidir.name":"Двунаправленный преобразователь (PCS)","dc-dc-converter.name":"Преобразователь DC/DC","mppt.name":"Контроллер MPPT","ct.name":"Трансформатор тока (CT)","disconnector.name":"Разъединитель (QS)","earth.name":"Земля","earthing-switch.name":"Заземляющий разъединитель (QE)","fuse.name":"Предохранитель (FU)","generator.name":"Генератор (G)","grid-source.name":"Источник от энергосистемы","grounding-transformer.name":"Заземляющий трансформатор (зигзаг)","inverter.name":"Инвертор (DC→AC)","load-switch.name":"Выключатель нагрузки","load.name":"Нагрузка","luminaire.name":"Светильник (осветительная нагрузка)","panelboard.name":"Распределительный щит","ngr.name":"Резистор заземления нейтрали (NGR)","pt.name":"Трансформатор напряжения (PT)","pv.name":"Фотоэлектрический модуль","rectifier.name":"Выпрямитель (AC→DC)","series-reactor.name":"Последовательный реактор","shunt-capacitor.name":"Шунтирующий конденсатор","shunt-reactor.name":"Шунтирующий реактор","sync-motor.name":"Синхронный двигатель","transformer-2w.name":"Двухобмоточный трансформатор","transformer-3w.name":"Трёхобмоточный трансформатор","wind-turbine.name":"Ветрогенератор","gfci-breaker.name":"Дифференциальный автомат (RCBO)","rcd.name":"Устройство защитного отключения (RCD)","recloser.name":"Реклоузер","energy-meter.name":"Счётчик электроэнергии (Wh)","voltmeter.name":"Вольтметр (V)","ammeter.name":"Амперметр (A)","wattmeter.name":"Ваттметр (W)","frequency-meter.name":"Частотомер (Hz)","contactor.name":"Контактор (KM)","motor-starter.name":"Магнитный пускатель","thermal-overload.name":"Тепловое реле перегрузки","vfd.name":"Частотный преобразователь (VFD)","soft-starter.name":"Устройство плавного пуска","transfer-switch.name":"Устройство АВР (ATS)","dc-disconnector.name":"Разъединитель постоянного тока","dc-combiner.name":"Объединительная коробка постоянного тока","ev-charger.name":"Зарядная станция для электромобилей","arc-suppression-coil.desc":"Резонансное заземление нейтрали: катушка индуктивности на землю","busbar.desc":"Растягиваемая секция одиночной шины с несколькими отводами","converter-bidir.desc":"Преобразователь для накопителя: двунаправленный AC ↔ DC","dc-dc-converter.desc":"Преобразователь DC/DC / зарядное устройство постоянного тока (IEC 60617)","mppt.desc":"Солнечный контроллер заряда MPPT (DC/DC, отслеживание точки максимальной мощности)","earthing-switch.desc":"Разъединитель + соединение с землёй, один порт","grid-source.desc":"Шина бесконечной мощности / внешняя энергосистема","grounding-transformer.desc":"Трансформатор со схемой звезда-зигзаг для заземления нейтрали","load.desc":"Абстрактная нагрузка (стрелка исходящего тока)","luminaire.desc":"Осветительная нагрузка (общий символ светильника МЭК 60617)","ngr.desc":"Заземление через малое сопротивление: нейтраль трансформатора на землю","series-reactor.desc":"То же обозначение, что и у шунтирующего реактора; различаются по способу применения","wind-turbine.desc":"Ветрогенератор: генератор + значок трёхлопастного ротора","gfci-breaker.desc":"Дифференциальный автомат со встроенной защитой от сверхтока (UL943 / IEC 61009). В США — GFCI, в Европе — RCBO.","rcd.desc":"Устройство защитного отключения без защиты от сверхтока (IEC 61008).","recloser.desc":"Автоматический реклоузер среднего напряжения.","energy-meter.desc":"Счётчик активной энергии (кВт·ч) — на вводе / субсчётчик.","contactor.desc":"Контактор главной цепи; обычно используется совместно с тепловым реле и двигателем.","motor-starter.desc":"Пускатель двигателя (общее обозначение по IEC 60617).","thermal-overload.desc":"Тепловое реле перегрузки двигателя; устанавливается между контактором и двигателем.","vfd.desc":"Частотный преобразователь для регулирования скорости асинхронного двигателя.","soft-starter.desc":"Устройство плавного пуска двигателя (тиристорный пуск при пониженном напряжении).","transfer-switch.desc":"Переключатель между двумя источниками (АВР / ручной). Два входа источников + один выход нагрузки, механически сблокированы.","dc-disconnector.desc":"Разъединитель постоянного тока — изоляция стороны DC солнечной цепочки / батареи.","dc-combiner.desc":"Объединительная коробка солнечных цепочек (пример на 4 входа).","ev-charger.desc":"Зарядная станция для электромобилей.","breaker.state.open":"Разомкнут","disconnector.state.open":"Разомкнут","earthing-switch.state.open":"Разомкнут","fuse.state.blown":"Перегорел","load-switch.state.open":"Разомкнут","gfci-breaker.state.open":"Разомкнут","rcd.state.open":"Разомкнут","recloser.state.open":"Разомкнут","contactor.state.open":"Разомкнут","thermal-overload.state.tripped":"Сработало","transfer-switch.state.position":"Положение (нормальное/аварийное/откл.)","dc-disconnector.state.open":"Разомкнут","battery.param.E":"Ёмкость","busbar.param.Un":"Номинальное напряжение","converter-bidir.param.S":"Мощность","dc-dc-converter.param.P":"Мощность","mppt.param.I":"Номинальный ток","load.param.P":"Активная мощность","load.param.cosphi":"Коэффициент мощности","ngr.param.R":"Сопротивление","shunt-capacitor.param.Q":"Реактивная мощность","shunt-capacitor.param.stages":"Ступени","transformer-2w.param.S":"Мощность","transformer-2w.param.ratio":"Коэффициент трансформации","gfci-breaker.param.In":"Номинальный ток","gfci-breaker.param.IDn":"Номинальный отключающий дифференциальный ток","rcd.param.IDn":"Номинальный отключающий дифференциальный ток","breaker.param.In":"Номинальный ток","breaker.param.poles":"Число полюсов","breaker.param.Icu":"Отключающая способность","disconnector.param.In":"Номинальный ток","fuse.param.In":"Номинальный ток","resistor.name":"Резистор (R)","capacitor.name":"Конденсатор (C)","diode.name":"Диод (D)","indicator-light.name":"Сигнальная лампа (HL)","push-button.name":"Кнопка (SB)","relay-coil.name":"Катушка реле (KA)","make-contact.name":"Замыкающий контакт (NO)","break-contact.name":"Размыкающий контакт (NC)","bell.name":"Звонок (HA)","terminal.name":"Клемма / соединение (X)","fuse-switch-disconnector.name":"Предохранитель-разъединитель","socket-outlet.name":"Розетка / разъём","inductor.name":"Катушка индуктивности (L)","voltage-regulator.name":"Регулятор напряжения (T)","dc-motor.name":"Двигатель постоянного тока (M)","heater.name":"Нагревательный элемент (EH)","selector-switch.name":"Переключатель (SA)","limit-switch.name":"Концевой выключатель (SQ)","proximity-switch.name":"Бесконтактный выключатель (SQ)","time-relay.name":"Реле времени (KT)","buzzer.name":"Зуммер (HA)","siren.name":"Сирена (HA)","thermocouple.name":"Термопара (BT)","thyristor.name":"Тиристор / SCR (V)","triac.name":"Симистор (V)","zener-diode.name":"Стабилитрон (D)","igbt.name":"IGBT","plc.name":"ПЛК / контроллер","ups.name":"ИБП (UPS)","power-supply.name":"Источник питания (PS)","genset.name":"Генераторная установка (G)","protective-relay.name":"Защитное реле","overcurrent-relay.name":"Реле максимального тока (50/51)","undervoltage-relay.name":"Реле минимального напряжения (27)","reverse-power-relay.name":"Реле обратной мощности (32)","distance-relay.name":"Дистанционное реле (21)","phase-failure-relay.name":"Реле обрыва фазы","buchholz-relay.name":"Реле Бухгольца (63)","power-factor-meter.name":"Измеритель коэффициента мощности (cosφ)","synchronoscope.name":"Синхроноскоп","varmeter.name":"Варметр (var)","resistor.desc":"Общий резистор / токоограничивающий / тормозной резистор.","capacitor.desc":"Общий / фильтрующий конденсатор / конденсатор шины DC. Для компенсации коэффициента мощности используйте шунтирующий конденсатор.","diode.desc":"Выпрямительный / обратный / защитный диод. t1 = анод (сверху), t2 = катод (снизу).","indicator-light.desc":"Сигнальная лампа состояния.","push-button.desc":"Кнопка ручного управления с автоматическим возвратом (замыкающий контакт NO).","relay-coil.desc":"Катушка управления реле / контактора (обозначение — прямоугольник).","make-contact.desc":"Нормально разомкнутый вспомогательный контакт (замыкающий).","break-contact.desc":"Нормально замкнутый вспомогательный контакт (размыкающий).","bell.desc":"Сигнальный звонок / звонок тревоги.","terminal.desc":"Клемма / клеммная коробка / узел соединения.","fuse-switch-disconnector.desc":"Предохранитель-разъединитель, коммутируемый под нагрузкой.","socket-outlet.desc":"Силовая розетка / многополюсный разъём.","inductor.desc":"Общая катушка индуктивности / дроссель.","voltage-regulator.desc":"Регулируемый индукционный регулятор напряжения / автотрансформаторный регулятор.","dc-motor.desc":"Двигатель постоянного тока (общее обозначение с последовательным возбуждением).","heater.desc":"Резистивный нагревательный элемент / тепловая нагрузка.","selector-switch.desc":"Избирательный переключатель (поворотный, с фиксацией положений).","limit-switch.desc":"Концевой выключатель положения (NO, механическое воздействие).","proximity-switch.desc":"Датчик приближения / бесконтактный выключатель.","time-relay.desc":"Катушка реле времени (с задержкой срабатывания).","buzzer.desc":"Сигнальный зуммер.","siren.desc":"Звуковая сирена / сигнализация.","thermocouple.desc":"Термопарный датчик температуры.","thyristor.desc":"Тиристор с обратной блокировкой (SCR). t1 = анод (сверху), t2 = катод (снизу).","triac.desc":"Двунаправленный триодный тиристор (симистор).","zener-diode.desc":"Стабилитрон / регулирующий диод. t1 = анод (сверху), t2 = катод (снизу).","igbt.desc":"IGBT-транзистор с N-каналом обогащённого типа. t1 = коллектор (сверху), t2 = эмиттер (снизу), t_g = затвор.","plc.desc":"Программируемый логический контроллер (ПЛК).","ups.desc":"Источник бесперебойного питания (онлайн / резервный).","power-supply.desc":"Импульсный источник питания AC→DC / источник постоянного тока. t_ac сверху (~), t_dc снизу (=).","genset.desc":"Дизельная / газовая генераторная установка.","protective-relay.desc":"Измерительное / защитное реле, общее обозначение (IEC 60617).","overcurrent-relay.desc":"Реле максимальной токовой защиты (ANSI 50/51).","undervoltage-relay.desc":"Реле защиты минимального напряжения (ANSI 27).","reverse-power-relay.desc":"Реле защиты от обратной мощности / обратного тока (ANSI 32).","distance-relay.desc":"Дистанционное реле защиты по сопротивлению (ANSI 21).","phase-failure-relay.desc":"Реле защиты от обрыва / потери фазы.","buchholz-relay.desc":"Газовое реле Бухгольца (ANSI 63).","power-factor-meter.desc":"Измеритель коэффициента мощности (cosφ).","synchronoscope.desc":"Индикатор синхронизации / синхроноскоп.","varmeter.desc":"Измеритель реактивной мощности (var).","make-contact.state.closed":"Замкнут","break-contact.state.open":"Разомкнут","fuse-switch-disconnector.state.open":"Разомкнут","selector-switch.state.open":"Разомкнут","limit-switch.state.closed":"Замкнут","resistor.param.R":"Сопротивление","resistor.param.P":"Номинальная мощность","capacitor.param.C":"Ёмкость","capacitor.param.Un":"Номинальное напряжение","indicator-light.param.color":"Цвет","inductor.param.L":"Индуктивность","inductor.param.In":"Номинальный ток","voltage-regulator.param.ratio":"Диапазон регулирования","heater.param.P":"Мощность","ups.param.S":"Мощность","power-supply.param.Vdc":"Выходное напряжение","genset.param.P":"Мощность"},bS={ui:fS,library:gS},yS={"common.unnamed":"بدون عنوان","common.close":"بستن","common.yes":"بله","common.no":"خیر","topbar.theme.toLight":"تغییر به حالت روشن","topbar.theme.toDark":"تغییر به حالت تیره","topbar.theme.currentDark":"فعلی: پوسته تیره","topbar.theme.currentLight":"فعلی: پوسته روشن","topbar.lang.toEnglish":"تغییر به انگلیسی","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"فعلی: انگلیسی","topbar.lang.currentChinese":"فعلی: چینی","topbar.export.label":"خروجی","topbar.export.tooltip":"وکتور SVG (قابل ویرایش)، تصویر PNG (2× کیفیت بالا) یا DXF (CAD)","topbar.export.pngFailed":"خروجی PNG ناموفق بود: {err}","topbar.export.dxfFailed":"خروجی DXF ناموفق بود: {err}","topbar.file.label":"فایل","topbar.file.tooltip":"باز کردن یک نمودار .json محلی، ذخیره، یا ذخیره با نام دیگر","topbar.file.current":"فعلی: {name}","topbar.file.new":"جدید","topbar.file.open":"باز کردن…","topbar.file.save":"ذخیره","topbar.file.saveAs":"ذخیره با نام دیگر…","topbar.file.newConfirm":"ایجاد فایل جدید تغییرات ذخیره‌نشده را از بین می‌برد. ادامه می‌دهید؟","topbar.file.openFailed":"باز کردن ناموفق بود: {err}","topbar.file.saveFailed":"ذخیره ناموفق بود: {err}","topbar.file.fileDescription":"نمودار OneLineEditor","outline.title":"طرح کلی","outline.collapse":"جمع کردن","outline.collapseAria":"جمع کردن طرح کلی","outline.empty":"(هیچ عنصری نیست — برای شروع از کتابخانه بکشید)","props.title":"ویژگی‌ها","props.node":"گره الکتریکی","props.wire":"سیم","props.bus":"شینه","props.junction":"نقطه اتصال","props.junctionPos":"موقعیت","props.nSelected":"{n} مورد انتخاب‌شده","props.empty":"چیزی انتخاب نشده","props.multi":"{n} عنصر انتخاب شده","props.name":"نام","props.note":"یادداشت","props.label":"برچسب","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"گره الکتریکی {id} یافت نشد","props.wireNotFound":"سیم {id} یافت نشد","props.nodeStats":"{terminals} ترمینال · {elements} عنصر","props.selectElement":"انتخاب {label}","props.selectWholeNode":"انتخاب کل گره الکتریکی","props.annText":"متن","props.annRect":"مستطیل","props.annLine":"خط","props.annTable":"جدول","props.annNotFound":"حاشیه‌نویسی {id} یافت نشد","props.annLabel":"برچسب","props.annLabelPlaceholder":"مثلاً: تابلو شماره 1","props.annStroke":"نوع خط","props.annStrokeSolid":"ممتد","props.annStrokeDashed":"خط‌چین","props.annFill":"پرکردن","props.annFillNone":"هیچ","props.annFillTint":"ته‌رنگ","props.annArrow":"پیکان‌ها","props.annArrowNone":"هیچ‌کدام","props.annArrowEnd":"انتها","props.annArrowBoth":"دوطرفه","props.annFontSize":"اندازه فونت","props.annRows":"ردیف‌ها","props.annCols":"ستون‌ها","view.zoomOut":"کوچک‌نمایی","view.zoomOutHint":"کوچک‌نمایی پله‌ای؛ همچنین چرخ ماوس ↓ یا ⌘−","view.reset":"بازنشانی به 100%","view.current":"فعلی {z}%","view.zoomIn":"بزرگ‌نمایی","view.zoomInHint":"بزرگ‌نمایی پله‌ای؛ همچنین چرخ ماوس ↑ یا ⌘+","view.fit":"تنظیم نما","view.fitHint":"بزرگ‌نمایی خودکار و وسط‌چین کردن همه عناصر","view.gridHide":"پنهان کردن شبکه","view.gridShow":"نمایش شبکه","view.gridHotkey":"G","view.gridHideHint":"چسبیدن به شبکه را نیز غیرفعال می‌کند (جای‌گذاری آزاد)","view.gridShowHint":"چسبیدن به شبکه را نیز فعال می‌کند (چسبیدن به 10 پیکسل هنگام کشیدن)","view.gridHideAria":"پنهان کردن شبکه و غیرفعال کردن چسبیدن","view.gridShowAria":"نمایش شبکه و فعال کردن چسبیدن","view.label":"برچسب‌ها","view.labelOff":"خاموش","view.labelId":"شناسه","view.labelAll":"شناسه + پارامترها","view.labelHint":"نمایش و اندازهٔ برچسب‌ها (در خروجی هم اعمال می‌شود)","view.labelSize":"اندازه","view.labelSizeSmaller":"کوچک‌کردن برچسب‌ها","view.labelSizeLarger":"بزرگ‌کردن برچسب‌ها","view.labelSizeReset":"بازنشانی اندازهٔ برچسب‌ها","library.title":"کتابخانه","library.empty":"عنصر منطبقی یافت نشد","library.searchPlaceholder":"جستجوی عناصر…","library.searchAria":"جستجوی عناصر","library.clearSearch":"پاک کردن جستجو","library.itemHint":"کلیک کنید تا وارد حالت قرارگیری شوید، یا به بوم بکشید","tool.select":"انتخاب","tool.selectHint":"برای انتخاب کلیک کنید، برای چند مورد کادر بکشید، برای منو راست‌کلیک کنید","tool.pan":"جابجایی","tool.panHint":"بوم را بکشید؛ کلید Space به‌طور موقت این حالت را فعال می‌کند","tool.wire":"سیم‌کشی","tool.wireHint":"از یک پایه/شینه/نقطه اتصال بکشید؛ رها کردن در فضای خالی یک نقطه اتصال می‌سازد، رها کردن روی یک سیم به آن متصل می‌شود","tool.bus":"شینه","tool.busHint":"روی بوم بکشید — با فشردن نقطه شروع و با رها کردن نقطه پایان تعیین می‌شود","tool.junction":"نقطه اتصال","tool.junctionHint":"برای قرار دادن یک نقطه اتصال (گره) روی بوم کلیک کنید؛ سیم‌ها آزادانه به آن متصل می‌شوند","tool.place":"قرار دادن","tool.placeHint":"برای قرار دادن کلیک کنید؛ یا از یک ترمینال/شینه بکشید تا هم‌زمان قرار داده و متصل شود","tool.text":"متن","tool.textHint":"برای قرار دادن یادداشت متنی روی بوم کلیک کنید؛ برای ویرایش یک مورد موجود دوبار کلیک کنید","tool.rect":"مستطیل","tool.rectHint":"برای رسم یک مستطیل / قاب گروه بکشید (به‌طور پیش‌فرض خط‌چین)؛ Shift برای مربع","tool.line":"خط","tool.lineHint":"برای رسم یک خط حاشیه‌نویسی بکشید؛ Shift به 45° می‌چسبد؛ پیکان‌ها در پنل تنظیم می‌شوند","tool.table":"جدول","tool.tableHint":"برای تعیین ستون × ردیف بکشید (شمارش زنده)، یا برای جدول پیش‌فرض کلیک کنید؛ برای تایپ در سلول‌ها دوبار کلیک کنید","mode.selectWithSel":"عناصر را بکشید · ترمینال‌ها را برای سیم‌کشی بکشید · برای منو راست‌کلیک کنید","mode.selectEmpty":"برای انتخاب کلیک کنید · برای جابجایی بکشید · برای چند مورد کادر بکشید · برای منو راست‌کلیک کنید","mode.pan":"بوم را بکشید · برای بزرگ‌نمایی اسکرول کنید · برای جابجایی در هر ابزاری Space را نگه دارید","mode.wireDragging":"روی یک پایه/شینه/نقطه اتصال رها کنید؛ رها کردن در فضای خالی یک نقطه اتصال می‌سازد","mode.wireInit":"روی هر نقطه اتصال یا فضای خالی فشار دهید، به سمت مقصد بکشید و رها کنید","mode.busDragging":"کشیدن جهت شینه را تعیین می‌کند؛ رها کردن پایان را مشخص می‌کند","mode.busInit":"برای تعیین شروع روی بوم فشار دهید، بکشید، برای پایان رها کنید","mode.junction":"برای قرار دادن یک نقطه اتصال روی بوم کلیک کنید","mode.placeNoKind":"یک نوع عنصر را از کتابخانه سمت چپ انتخاب کنید","mode.placeFromTerm":"در مقصد رها کنید — عنصر جدید به ترمینال مبدأ متصل می‌شود","mode.placeNormal":"برای قرار دادن روی فضای خالی کلیک کنید؛ یا از یک ترمینال/شینه بکشید تا هم‌زمان قرار داده و متصل شود","mode.text":"برای قرار دادن متن کلیک کنید · برای ویرایش دوبار کلیک کنید · برای جابجایی انتخاب‌شده بکشید · Del برای حذف","mode.rect":"برای رسم مستطیل بکشید · Shift برای مربع · پس از رها کردن اندازه و برچسب آن را تغییر دهید","mode.line":"برای رسم خط بکشید · Shift به 45° می‌چسبد · پس از رها کردن پیکان را در پنل اضافه کنید","mode.table":"برای تعیین شبکه بکشید، یا برای جدول 3×3 کلیک کنید · برای تایپ در سلول‌ها دوبار کلیک کنید","mode.annTextSel":"برای ویرایش روی متن کلیک کنید · برای جابجایی بکشید · Del برای حذف","mode.annTableSel":"برای پر کردن روی یک سلول کلیک کنید · برای جابجایی بکشید · Del برای حذف","mode.annShapeSel":"برای جابجایی بکشید · برای تغییر اندازه دستگیره‌ها را بکشید · سبک را در پنل تغییر دهید · Del برای حذف","mode.annEditing":"تایپ کنید · Enter برای تأیید · Esc برای لغو · یا دکمه‌های ✓ / ✕","mode.escSelect":"Esc انتخاب را پاک می‌کند","mode.escOther":"راست‌کلیک / Esc برای لغو","tool.placeNoKindTooltip":"یک نوع را از کتابخانه سمت چپ انتخاب کنید، سپس روی بوم کلیک کنید","tool.undo":"واگرد","tool.undoHint":"واگرد آخرین ویرایش (جابجایی / چرخش / حذف و غیره)","tool.redo":"بازانجام","tool.redoHint":"بازانجام آخرین ویرایش واگردشده","layout.label":"چیدمان","layout.hint":"چیدمان خودکار کل نمودار یا فقط انتخاب‌شده، پر کردن فضاهای خالی","layout.allAuto":"چیدمان خودکار همه","layout.selAuto":"چیدمان خودکار انتخاب‌شده","layout.allFill":"پر کردن قرارنگرفته‌ها","layout.selFill":"پر کردن قرارنگرفته‌ها در انتخاب‌شده","tool.more":"بیشتر","tool.moreHint":"واگرد / بازانجام / چیدمان","view.menu":"نما","view.menuHint":"بزرگ‌نمایی، تنظیم نما، شبکه","ctx.ariaNode":"عملیات گره","ctx.ariaWire":"عملیات سیم","ctx.ariaElement":"عملیات عنصر","ctx.ariaEdit":"عملیات ویرایش","ctx.done":"انجام شد","ctx.cancel":"لغو","ctx.rotate":"چرخش 90°","ctx.rotateHint":"چرخش انتخاب‌شده در جهت عقربه‌های ساعت؛ سیم‌ها از ترمینال‌های جدید مسیریابی می‌شوند","ctx.mirror":"قرینه افقی","ctx.mirrorTitle":"قرینه","ctx.mirrorHint":"برگرداندن انتخاب‌شده از چپ به راست","ctx.delete":"حذف","ctx.deleteHintNode":"قطع تمام سیم‌های این گره (عناصر باقی می‌مانند)","ctx.deleteHintWire":"فقط این سیم حذف می‌شود (سیم‌های دیگر همان گره باقی می‌مانند)","ctx.deleteHintElement":"حذف انتخاب‌شده و سیم‌های آن","ctx.resetWirePath":"بازنشانی به مسیریابی خودکار","ctx.resetWirePathHint":"گوشه‌های دستی حذف می‌شود و مسیریاب این سیم را دوباره رسم می‌کند","menu.undo":"واگرد","menu.redo":"بازانجام","menu.cut":"برش","menu.copy":"کپی","menu.paste":"جای‌گذاری","menu.rotate":"چرخش 90°","menu.mirror":"قرینه","menu.selectAll":"انتخاب همه","menu.disconnect":"قطع این سیم","menu.delete":"حذف","io.parseFailed":"تجزیه JSON ناموفق بود: {err}","io.notObject":"فایل یک شیء JSON نیست","io.versionMismatch":'عدم تطابق نسخه: مقدار مورد انتظار "1"، مقدار دریافتی {actual}',"io.elementsMissing":"`elements` وجود ندارد یا آرایه نیست","compile.duplicateId":'شناسه عنصر تکراری: "{id}"',"compile.unknownKind":'نوع عنصر ناشناخته kind="{kind}"',"compile.invalidTermRef":'ارجاع ترمینال نامعتبر "{ref}"',"compile.elementMissing":'ارجاع به عنصر ناشناخته "{id}"',"compile.missingPin":'عنصر "{id}" (kind={kind}) پایه "{pin}" را ندارد؛ پایه‌های موجود: {available}',"compile.singleTerminal":"گره فقط یک ترمینال دارد — نادیده گرفته شد","compile.layoutMissingElement":'کلید layout با شناسه "{id}" به عنصری ناشناخته ارجاع می‌دهد',"compile.elementUnconnected":'عنصر "{id}" هیچ اتصالی ندارد',"cat.busbar":"شینه / سیم‌کشی","cat.switching":"کلیدزنی","cat.protection":"حفاظت","cat.motor-control":"کنترل موتور","cat.transformer":"ترانسفورماتور","cat.instrument-transformer":"ترانسفورماتور اندازه‌گیری","cat.measurement":"اندازه‌گیری","cat.source":"منبع","cat.load":"بار","cat.storage":"ذخیره‌سازی","cat.compensation":"جبران‌سازی","cat.grounding":"اتصال زمین","cat.renewable":"انرژی‌های تجدیدپذیر / الکترونیک قدرت","onboard.title":"شروع سریع","onboard.step1.title":"قرار دادن یک قطعه","onboard.step1.body":"ابزار قرار دادن (P) را انتخاب کنید و یک نوع را از کتابخانه به بوم بکشید","onboard.step2.title":"سیم‌کشی کنید","onboard.step2.body":"از ابزار سیم‌کشی (W) استفاده کنید: از یک پایه به پایه دیگر بکشید — برای ساخت یک نقطه اتصال به فضای خالی بکشید","onboard.step3.title":"شینه یک ریل مشترک است، نه یک سیم","onboard.step3.body":"ابزار شینه (B) را فقط زمانی استفاده کنید که چند مدار یک ریل مشترک دارند. از شینه برای اتصال دو دستگاه استفاده نکنید — فقط پایه‌ها را سیم‌کشی کنید (W).","onboard.dismiss":"متوجه شدم"},xS={"arc-suppression-coil.name":"سلف خاموش‌کننده قوس","arrester.name":"برقگیر (FBL)","async-motor.name":"موتور آسنکرون","autotransformer.name":"اتوترانسفورماتور","battery.name":"ذخیره‌سازی باتری","breaker.name":"کلید اتوماتیک (QF)","busbar.name":"قطعه شینه","converter-bidir.name":"مبدل دوطرفه (PCS)","dc-dc-converter.name":"مبدل DC/DC","mppt.name":"کنترلر MPPT","ct.name":"ترانسفورماتور جریان (CT)","disconnector.name":"سکسیونر (QS)","earth.name":"زمین","earthing-switch.name":"کلید ارت (QE)","fuse.name":"فیوز (FU)","generator.name":"ژنراتور (G)","grid-source.name":"منبع شبکه سراسری","grounding-transformer.name":"ترانسفورماتور زمین (زیگزاگ)","inverter.name":"اینورتر (DC→AC)","load-switch.name":"کلید قطع بار","load.name":"بار","luminaire.name":"چراغ (بار روشنایی)","panelboard.name":"تابلو برق / مرکز بار","ngr.name":"مقاومت زمین نوترال (NGR)","pt.name":"ترانسفورماتور ولتاژ (PT)","pv.name":"ماژول فتوولتائیک","rectifier.name":"یکسوکننده (AC→DC)","series-reactor.name":"راکتور سری","shunt-capacitor.name":"خازن موازی","shunt-reactor.name":"راکتور موازی","sync-motor.name":"موتور سنکرون","transformer-2w.name":"ترانسفورماتور دو سیم‌پیچ","transformer-3w.name":"ترانسفورماتور سه سیم‌پیچ","wind-turbine.name":"توربین بادی","gfci-breaker.name":"کلید GFCI (RCBO)","rcd.name":"کلید جریان نشتی (RCD)","recloser.name":"ریکلوزر","energy-meter.name":"کنتور انرژی (Wh)","voltmeter.name":"ولت‌متر (V)","ammeter.name":"آمپرمتر (A)","wattmeter.name":"وات‌متر (W)","frequency-meter.name":"فرکانس‌متر (Hz)","contactor.name":"کنتاکتور (KM)","motor-starter.name":"راه‌انداز موتور","thermal-overload.name":"رله اضافه‌بار حرارتی","vfd.name":"درایو فرکانس متغیر (VFD)","soft-starter.name":"راه‌انداز نرم","transfer-switch.name":"کلید انتقال اتوماتیک (ATS)","dc-disconnector.name":"سکسیونر DC","dc-combiner.name":"جعبه ترکیب‌کننده DC","ev-charger.name":"شارژر خودرو برقی","arc-suppression-coil.desc":"اتصال زمین تشدیدی نقطه نوترال: سلف به زمین","busbar.desc":"قطعه شینه تک با قابلیت کشش و چند انشعاب","converter-bidir.desc":"مبدل ذخیره‌ساز: دوطرفه AC ↔ DC","dc-dc-converter.desc":"مبدل DC/DC / شارژر DC (IEC 60617)","mppt.desc":"کنترلر شارژ خورشیدی MPPT (DC/DC، ردیابی نقطه توان بیشینه)","earthing-switch.desc":"سکسیونر + اتصال زمین، تک‌پورت","grid-source.desc":"شینه بی‌نهایت / شبکه خارجی","grounding-transformer.desc":"ترانسفورماتور ستاره-زیگزاگ برای اتصال زمین نقطه نوترال","load.desc":"بار انتزاعی (پیکان خروجی جریان)","luminaire.desc":"بار روشنایی (نماد عمومی چراغ IEC 60617)","ngr.desc":"اتصال زمین با مقاومت کم: نوترال ترانسفورماتور به زمین","series-reactor.desc":"نماد مشابه راکتور موازی؛ تمایز بر اساس کاربرد","wind-turbine.desc":"توربین بادی: ژنراتور + نشان روتور سه‌پره","gfci-breaker.desc":"کلید جریان نشتی با حفاظت اضافه‌جریان (UL943 / IEC 61009). GFCI در آمریکای شمالی / RCBO در اروپا.","rcd.desc":"کلید جریان نشتی بدون حفاظت اضافه‌جریان (IEC 61008).","recloser.desc":"ریکلوزر خودکار فشار متوسط.","energy-meter.desc":"کنتور انرژی اکتیو (kWh) — ورودی سرویس / زیرکنتور.","contactor.desc":"کنتاکتور مدار اصلی؛ معمولاً همراه با رله اضافه‌بار حرارتی و موتور استفاده می‌شود.","motor-starter.desc":"راه‌انداز موتور (نماد عمومی IEC 60617).","thermal-overload.desc":"رله اضافه‌بار حرارتی موتور؛ بین کنتاکتور و موتور قرار می‌گیرد.","vfd.desc":"درایو فرکانس متغیر برای کنترل سرعت موتور القایی.","soft-starter.desc":"راه‌انداز نرم موتور (راه‌اندازی با ولتاژ کاهش‌یافته بر پایه تریستور).","transfer-switch.desc":"کلید انتقال دو منبعی (ATS / دستی). دو ورودی منبع + یک خروجی بار، با قفل مکانیکی متقابل.","dc-disconnector.desc":"کلید ایزوله DC — ایزوله‌سازی سمت DC رشته فتوولتائیک / باتری.","dc-combiner.desc":"جعبه ترکیب‌کننده رشته‌های فتوولتائیک (نمونه 4 ورودی).","ev-charger.desc":"ایستگاه شارژ خودرو برقی.","breaker.state.open":"باز","disconnector.state.open":"باز","earthing-switch.state.open":"باز","fuse.state.blown":"سوخته","load-switch.state.open":"باز","gfci-breaker.state.open":"باز","rcd.state.open":"باز","recloser.state.open":"باز","contactor.state.open":"باز","thermal-overload.state.tripped":"تریپ‌کرده","transfer-switch.state.position":"موقعیت (عادی/اضطراری/خاموش)","dc-disconnector.state.open":"باز","battery.param.E":"ظرفیت","busbar.param.Un":"ولتاژ نامی","converter-bidir.param.S":"ظرفیت","dc-dc-converter.param.P":"توان","mppt.param.I":"جریان نامی","load.param.P":"توان اکتیو","load.param.cosphi":"ضریب توان","ngr.param.R":"مقاومت","shunt-capacitor.param.Q":"ظرفیت راکتیو","shunt-capacitor.param.stages":"پله‌ها","transformer-2w.param.S":"ظرفیت","transformer-2w.param.ratio":"نسبت تبدیل","gfci-breaker.param.In":"جریان نامی","gfci-breaker.param.IDn":"جریان عملکرد نشتی","rcd.param.IDn":"جریان عملکرد نشتی","breaker.param.In":"جریان نامی","breaker.param.poles":"تعداد قطب","breaker.param.Icu":"قدرت قطع","disconnector.param.In":"جریان نامی","fuse.param.In":"جریان نامی","resistor.name":"مقاومت (R)","capacitor.name":"خازن (C)","diode.name":"دیود (D)","indicator-light.name":"چراغ نشانگر (HL)","push-button.name":"کلید فشاری (SB)","relay-coil.name":"بوبین رله (KA)","make-contact.name":"کنتاکت باز (NO)","break-contact.name":"کنتاکت بسته (NC)","bell.name":"زنگ (HA)","terminal.name":"ترمینال / اتصال (X)","fuse-switch-disconnector.name":"سکسیونر-کلید فیوزدار","socket-outlet.name":"پریز / کانکتور","inductor.name":"سلف (L)","voltage-regulator.name":"تنظیم‌کننده ولتاژ (T)","dc-motor.name":"موتور DC (M)","heater.name":"المنت حرارتی (EH)","selector-switch.name":"کلید سلکتور (SA)","limit-switch.name":"کلید حد (SQ)","proximity-switch.name":"کلید مجاورتی (SQ)","time-relay.name":"رله زمانی (KT)","buzzer.name":"بازر (HA)","siren.name":"آژیر (HA)","thermocouple.name":"ترموکوپل (BT)","thyristor.name":"تریستور / SCR (V)","triac.name":"تریاک (V)","zener-diode.name":"دیود زنر (D)","igbt.name":"IGBT","plc.name":"PLC / کنترلر","ups.name":"UPS","power-supply.name":"منبع تغذیه (PS)","genset.name":"مجموعه ژنراتور (G)","protective-relay.name":"رله حفاظتی","overcurrent-relay.name":"رله اضافه‌جریان (50/51)","undervoltage-relay.name":"رله کاهش ولتاژ (27)","reverse-power-relay.name":"رله توان معکوس (32)","distance-relay.name":"رله دیستانس (21)","phase-failure-relay.name":"رله قطع فاز","buchholz-relay.name":"رله بوخهلتس (63)","power-factor-meter.name":"ضریب توان‌متر (cosφ)","synchronoscope.name":"سنکرونوسکوپ","varmeter.name":"وارمتر (var)","resistor.desc":"مقاومت عمومی / محدودکننده جریان / مقاومت ترمزی.","capacitor.desc":"خازن عمومی / فیلتر / باس DC. برای اصلاح ضریب توان از خازن موازی استفاده کنید.","diode.desc":"دیود یکسوساز / آزادگرد / حفاظتی. t1 = آند (بالا)، t2 = کاتد (پایین).","indicator-light.desc":"چراغ نشانگر سیگنال / وضعیت.","push-button.desc":"کلید فشاری دستی، بازگشت خودکار (کنتاکت باز).","relay-coil.desc":"بوبین عملکرد رله / کنتاکتور (جعبه).","make-contact.desc":"کنتاکت کمکی نرمال باز (NO).","break-contact.desc":"کنتاکت کمکی نرمال بسته (NC).","bell.desc":"زنگ سیگنال / زنگ هشدار.","terminal.desc":"ترمینال / جعبه تقسیم / گره اتصال.","fuse-switch-disconnector.desc":"سکسیونر-کلید فیوزدار قابل قطع زیر بار.","socket-outlet.desc":"پریز برق / کانکتور چندقطبی.","inductor.desc":"سلف عمومی / بوبین / خفه‌کن.","voltage-regulator.desc":"تنظیم‌کننده ولتاژ القایی / اتوترانسفورماتوری قابل تنظیم.","dc-motor.desc":"موتور DC (نماد عمومی تحریک سری).","heater.desc":"المنت حرارتی مقاومتی / بار حرارتی.","selector-switch.desc":"کلید سلکتور / تغییر وضعیت (دوار، پایدار).","limit-switch.desc":"کلید حد حرکت / موقعیت (NO، عملکرد مکانیکی).","proximity-switch.desc":"سنسور مجاورتی / کلید مجاورتی بدون تماس.","time-relay.desc":"بوبین رله با تأخیر زمانی (عملکرد کند).","buzzer.desc":"بازر سیگنال.","siren.desc":"آژیر صوتی / هشدار.","thermocouple.desc":"سنسور دمای ترموکوپل.","thyristor.desc":"تریستور سه‌پایه مسدودکننده معکوس / SCR. t1 = آند (بالا)، t2 = کاتد (پایین).","triac.desc":"تریستور سه‌پایه دوطرفه (TRIAC).","zener-diode.desc":"دیود زنر / تنظیم‌کننده ولتاژ. t1 = آند (بالا)، t2 = کاتد (پایین).","igbt.desc":"IGBT کانال N از نوع تقویتی. t1 = کلکتور (بالا)، t2 = امیتر (پایین)، t_g = گیت.","plc.desc":"کنترل‌کننده منطقی قابل برنامه‌ریزی (PLC).","ups.desc":"منبع تغذیه بی‌وقفه آنلاین / استندبای (UPS).","power-supply.desc":"منبع تغذیه سوییچینگ AC→DC / منبع تغذیه DC. t_ac بالا (~)، t_dc پایین (=).","genset.desc":"مجموعه ژنراتور دیزلی / گازی.","protective-relay.desc":"رله اندازه‌گیری / حفاظتی، نماد عمومی (IEC 60617).","overcurrent-relay.desc":"رله حفاظت اضافه‌جریان (ANSI 50/51).","undervoltage-relay.desc":"رله حفاظت کاهش ولتاژ (ANSI 27).","reverse-power-relay.desc":"رله حفاظت توان معکوس / جریان معکوس (ANSI 32).","distance-relay.desc":"رله حفاظت دیستانس / امپدانس کاهشی (ANSI 21).","phase-failure-relay.desc":"رله حفاظت قطع فاز / افت فاز.","buchholz-relay.desc":"رله بوخهلتس / گازی (ANSI 63).","power-factor-meter.desc":"ضریب توان‌متر (cosφ).","synchronoscope.desc":"نشانگر همزمان‌سازی / سنکرونوسکوپ.","varmeter.desc":"توان راکتیومتر (var).","make-contact.state.closed":"بسته","break-contact.state.open":"باز","fuse-switch-disconnector.state.open":"باز","selector-switch.state.open":"باز","limit-switch.state.closed":"بسته","resistor.param.R":"مقاومت","resistor.param.P":"توان نامی","capacitor.param.C":"ظرفیت خازنی","capacitor.param.Un":"ولتاژ نامی","indicator-light.param.color":"رنگ","inductor.param.L":"اندوکتانس","inductor.param.In":"جریان نامی","voltage-regulator.param.ratio":"محدوده تنظیم","heater.param.P":"توان","ups.param.S":"ظرفیت","power-supply.param.Vdc":"ولتاژ خروجی","genset.param.P":"توان"},wS={ui:yS,library:xS},vS={"common.unnamed":"بلا اسم","common.close":"إغلاق","common.yes":"نعم","common.no":"لا","topbar.theme.toLight":"التبديل إلى الوضع الفاتح","topbar.theme.toDark":"التبديل إلى الوضع الداكن","topbar.theme.currentDark":"الحالي: السمة الداكنة","topbar.theme.currentLight":"الحالي: السمة الفاتحة","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"الحالي: الإنجليزية","topbar.lang.currentChinese":"الحالي: الصينية","topbar.export.label":"تصدير","topbar.export.tooltip":"SVG متجهي (قابل للتحرير)، PNG نقطي (بدقة 2×)، أو DXF (لبرامج CAD)","topbar.export.pngFailed":"فشل تصدير PNG: {err}","topbar.export.dxfFailed":"فشل تصدير DXF: {err}","topbar.file.label":"ملف","topbar.file.tooltip":"افتح مخططًا محليًا بصيغة .json، احفظ، أو احفظ باسم","topbar.file.current":"الحالي: {name}","topbar.file.new":"جديد","topbar.file.open":"فتح…","topbar.file.save":"حفظ","topbar.file.saveAs":"حفظ باسم…","topbar.file.newConfirm":"سيؤدي إنشاء ملف جديد إلى فقدان أي تغييرات غير محفوظة. هل تريد المتابعة؟","topbar.file.openFailed":"فشل الفتح: {err}","topbar.file.saveFailed":"فشل الحفظ: {err}","topbar.file.fileDescription":"مخطط OneLineEditor","outline.title":"المخطط التفصيلي","outline.collapse":"طي","outline.collapseAria":"طي المخطط التفصيلي","outline.empty":"(لا توجد عناصر — اسحب من المكتبة للبدء)","props.title":"الخصائص","props.node":"العقدة الكهربائية","props.wire":"السلك","props.bus":"الشريط الناقل","props.junction":"نقطة الوصل","props.junctionPos":"الموضع","props.nSelected":"تم تحديد {n}","props.empty":"لا يوجد تحديد","props.multi":"تم تحديد {n} عنصر","props.name":"الاسم","props.note":"ملاحظة","props.label":"التسمية","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"العقدة الكهربائية {id} غير موجودة","props.wireNotFound":"السلك {id} غير موجود","props.nodeStats":"{terminals} طرف · {elements} عنصر","props.selectElement":"تحديد {label}","props.selectWholeNode":"تحديد العقدة الكهربائية بالكامل","props.annText":"نص","props.annRect":"مستطيل","props.annLine":"خط","props.annTable":"جدول","props.annNotFound":"التعليق التوضيحي {id} غير موجود","props.annLabel":"التسمية","props.annLabelPlaceholder":"مثال: لوحة رقم 1","props.annStroke":"نمط الخط","props.annStrokeSolid":"متصل","props.annStrokeDashed":"متقطع","props.annFill":"التعبئة","props.annFillNone":"بلا","props.annFillTint":"تظليل","props.annArrow":"الأسهم","props.annArrowNone":"بلا","props.annArrowEnd":"طرف واحد","props.annArrowBoth":"الطرفان","props.annFontSize":"حجم الخط","props.annRows":"الصفوف","props.annCols":"الأعمدة","view.zoomOut":"تصغير","view.zoomOutHint":"تصغير تدريجي؛ أو عجلة الفأرة ↓ أو ⌘−","view.reset":"إعادة الضبط إلى 100%","view.current":"الحالي {z}%","view.zoomIn":"تكبير","view.zoomInHint":"تكبير تدريجي؛ أو عجلة الفأرة ↑ أو ⌘+","view.fit":"احتواء العرض","view.fitHint":"تكبير/تصغير تلقائي وتوسيط كل العناصر","view.gridHide":"إخفاء الشبكة","view.gridShow":"إظهار الشبكة","view.gridHotkey":"G","view.gridHideHint":"يعطّل أيضًا الانجذاب إلى الشبكة (وضع حر)","view.gridShowHint":"يفعّل أيضًا الانجذاب إلى الشبكة (ينجذب إلى 10 بكسل عند السحب)","view.gridHideAria":"إخفاء الشبكة وتعطيل الانجذاب","view.gridShowAria":"إظهار الشبكة وتفعيل الانجذاب","view.label":"التسميات","view.labelOff":"إيقاف","view.labelId":"المعرّف","view.labelAll":"المعرّف + المعاملات","view.labelHint":"إظهار التسميات وحجم خطها (ينطبق على التصدير أيضًا)","view.labelSize":"الحجم","view.labelSizeSmaller":"تصغير خط التسميات","view.labelSizeLarger":"تكبير خط التسميات","view.labelSizeReset":"إعادة تعيين حجم التسميات","library.title":"المكتبة","library.empty":"لا توجد عناصر مطابقة","library.searchPlaceholder":"البحث في العناصر…","library.searchAria":"البحث في العناصر","library.clearSearch":"مسح البحث","library.itemHint":"انقر للدخول في وضع الإضافة، أو اسحب إلى لوحة الرسم","tool.select":"تحديد","tool.selectHint":"انقر للاختيار، حدد بالسحب لاختيار عدة عناصر، أو انقر بالزر الأيمن لفتح القائمة","tool.pan":"تحريك","tool.panHint":"اسحب لوحة الرسم؛ مفتاح المسافة يبدّل مؤقتًا","tool.wire":"سلك","tool.wireHint":"اسحب من طرف/شريط ناقل/نقطة وصل؛ السحب إلى مساحة فارغة يُنشئ نقطة وصل، وإلى سلك موجود يصل به","tool.bus":"الشريط الناقل","tool.busHint":"اسحب على لوحة الرسم — اضغط لتحديد نقطة البداية، وحرر لتحديد نقطة النهاية","tool.junction":"نقطة الوصل","tool.junctionHint":"انقر على لوحة الرسم لوضع نقطة وصل (عقدة)؛ يمكن للأسلاك الاتصال بها بحرية","tool.place":"إضافة","tool.placeHint":"انقر للوضع؛ أو اسحب من طرف/شريط ناقل للوضع والتوصيل معًا","tool.text":"نص","tool.textHint":"انقر على لوحة الرسم لوضع ملاحظة نصية؛ انقر نقرًا مزدوجًا على ملاحظة موجودة لتحريرها","tool.rect":"مستطيل","tool.rectHint":"اسحب لرسم مستطيل / إطار تجميع (متقطع افتراضيًا)؛ اضغط Shift لرسم مربع","tool.line":"خط","tool.lineHint":"اسحب لرسم خط توضيحي؛ Shift يقيّده بزاوية 45°؛ إعدادات الأسهم في لوحة الخصائص","tool.table":"جدول","tool.tableHint":"اسحب لتحديد عدد الأعمدة × الصفوف (يظهر العدد مباشرة)، أو انقر لوضع جدول افتراضي؛ انقر نقرًا مزدوجًا على الخلايا للكتابة","mode.selectWithSel":"اسحب العناصر · اسحب الأطراف للتوصيل · انقر بالزر الأيمن لفتح القائمة","mode.selectEmpty":"انقر للاختيار · اسحب للتحريك · حدد بالسحب لاختيار عدة عناصر · انقر بالزر الأيمن لفتح القائمة","mode.pan":"اسحب لوحة الرسم · مرّر للتكبير/التصغير · اضغط مطولاً على المسافة للتحريك في أي أداة","mode.wireDragging":"حرر على طرف/شريط ناقل/نقطة وصل؛ التحرير في مساحة فارغة يُنشئ نقطة وصل","mode.wireInit":"اضغط على أي نقطة اتصال أو مساحة فارغة، اسحب إلى الهدف ثم حرر","mode.busDragging":"السحب يحدد اتجاه الشريط الناقل؛ التحرير يحدد نقطة النهاية","mode.busInit":"اضغط على لوحة الرسم لتحديد البداية، اسحب، ثم حرر لتحديد النهاية","mode.junction":"انقر على لوحة الرسم لوضع نقطة وصل","mode.placeNoKind":"اختر نوع عنصر من المكتبة على اليسار","mode.placeFromTerm":"حرر عند الهدف — سيتصل العنصر الجديد بالطرف المصدر","mode.placeNormal":"انقر على مساحة فارغة للوضع؛ أو اسحب من طرف / شريط ناقل للوضع والتوصيل معًا","mode.text":"انقر لوضع نص · انقر نقرًا مزدوجًا للتحرير · اسحب العنصر المحدد للتحريك · Del للحذف","mode.rect":"اسحب لرسم مستطيل · Shift لرسم مربع · غيّر حجمه وأضف تسمية بعد التحرير","mode.line":"اسحب لرسم خط · Shift يقيّده بزاوية 45° · أضف الأسهم في اللوحة بعد التحرير","mode.table":"اسحب لتحديد شبكة الجدول، أو انقر لوضع جدول 3×3 · انقر نقرًا مزدوجًا على الخلايا للكتابة","mode.annTextSel":"انقر على النص للتحرير · اسحب للتحريك · Del للحذف","mode.annTableSel":"انقر على خلية لملئها · اسحب للتحريك · Del للحذف","mode.annShapeSel":"اسحب للتحريك · اسحب المقابض لتغيير الحجم · غيّر النمط في اللوحة · Del للحذف","mode.annEditing":"اكتب · Enter للتأكيد · Esc للإلغاء · أو زرّي ✓ / ✕","mode.escSelect":"Esc لإلغاء التحديد","mode.escOther":"انقر بالزر الأيمن / Esc للإلغاء","tool.placeNoKindTooltip":"اختر نوعًا من المكتبة على اليسار، ثم انقر على لوحة الرسم","tool.undo":"تراجع","tool.undoHint":"تراجع عن آخر تعديل (تحريك / تدوير / حذف، إلخ)","tool.redo":"إعادة","tool.redoHint":"إعادة آخر تعديل تم التراجع عنه","layout.label":"التخطيط","layout.hint":"تخطيط تلقائي للمخطط بالكامل أو للتحديد فقط، وملء الفراغات","layout.allAuto":"تخطيط تلقائي للكل","layout.selAuto":"تخطيط تلقائي للتحديد","layout.allFill":"ملء العناصر غير الموضوعة","layout.selFill":"ملء العناصر غير الموضوعة في التحديد","tool.more":"المزيد","tool.moreHint":"تراجع / إعادة / تخطيط","view.menu":"العرض","view.menuHint":"تكبير، احتواء، شبكة","ctx.ariaNode":"إجراءات العقدة","ctx.ariaWire":"إجراءات السلك","ctx.ariaElement":"إجراءات العنصر","ctx.ariaEdit":"إجراءات التحرير","ctx.done":"تم","ctx.cancel":"إلغاء","ctx.rotate":"تدوير 90°","ctx.rotateHint":"تدوير التحديد باتجاه عقارب الساعة؛ تُعاد الأسلاك توجيهها عبر الأطراف الجديدة","ctx.mirror":"عكس أفقيًا","ctx.mirrorTitle":"عكس","ctx.mirrorHint":"قلب التحديد أفقيًا","ctx.delete":"حذف","ctx.deleteHintNode":"فصل كل الأسلاك المتصلة بهذه العقدة (تبقى العناصر)","ctx.deleteHintWire":"إزالة هذا السلك فقط (تبقى الأسلاك الأخرى على نفس العقدة)","ctx.deleteHintElement":"إزالة التحديد وأسلاكه","ctx.resetWirePath":"إعادة الضبط إلى التوجيه التلقائي","ctx.resetWirePathHint":"تجاهل النقاط اليدوية ودع الموجّه يعيد رسم هذا السلك","menu.undo":"تراجع","menu.redo":"إعادة","menu.cut":"قص","menu.copy":"نسخ","menu.paste":"لصق","menu.rotate":"تدوير 90°","menu.mirror":"عكس","menu.selectAll":"تحديد الكل","menu.disconnect":"فصل هذا السلك","menu.delete":"حذف","io.parseFailed":"فشل تحليل JSON: {err}","io.notObject":"الملف ليس كائن JSON","io.versionMismatch":'عدم تطابق الإصدار: المتوقع "1"، والفعلي {actual}',"io.elementsMissing":"الحقل `elements` مفقود أو ليس مصفوفة","compile.duplicateId":'معرّف عنصر مكرر: "{id}"',"compile.unknownKind":'نوع عنصر غير معروف kind="{kind}"',"compile.invalidTermRef":'إشارة طرف غير صالحة "{ref}"',"compile.elementMissing":'إشارة إلى عنصر غير موجود "{id}"',"compile.missingPin":'العنصر "{id}" (kind={kind}) لا يحتوي على طرف "{pin}"؛ المتاح: {available}',"compile.singleTerminal":"العقدة تحتوي على طرف واحد فقط — تم تجاهلها","compile.layoutMissingElement":'مفتاح layout "{id}" يشير إلى عنصر غير موجود',"compile.elementUnconnected":'العنصر "{id}" لا يحتوي على أي اتصالات',"cat.busbar":"الشريط الناقل / التوصيلات","cat.switching":"المفاتيح والقواطع","cat.protection":"الحماية","cat.motor-control":"التحكم بالمحركات","cat.transformer":"المحولات","cat.instrument-transformer":"محولات القياس","cat.measurement":"القياس","cat.source":"المصادر","cat.load":"الأحمال","cat.storage":"التخزين","cat.compensation":"التعويض","cat.grounding":"التأريض","cat.renewable":"الطاقة المتجددة / الإلكترونيات الكهربائية","onboard.title":"البدء السريع","onboard.step1.title":"وضع عنصر","onboard.step1.body":"اختر أداة الإضافة (P) واسحب نوعًا من المكتبة إلى لوحة الرسم","onboard.step2.title":"وصّله","onboard.step2.body":"استخدم أداة السلك (W): اسحب من طرف إلى آخر — السحب إلى مساحة فارغة يضع نقطة وصل","onboard.step3.title":"الشريط الناقل قضيب مشترك، وليس سلكًا","onboard.step3.body":"استخدم أداة الشريط الناقل (B) فقط عندما تشترك عدة دوائر في قضيب واحد. لا تستخدم الشريط الناقل لربط جهازين — فقط وصّل الأطراف بسلك (W).","onboard.dismiss":"فهمت"},kS={"arc-suppression-coil.name":"ملف إخماد القوس","arrester.name":"مانع الصواعق (FBL)","async-motor.name":"محرك غير متزامن","autotransformer.name":"محول ذاتي","battery.name":"بطارية التخزين","breaker.name":"قاطع الدائرة (QF)","busbar.name":"مقطع الشريط الناقل","converter-bidir.name":"محوّل ثنائي الاتجاه (PCS)","dc-dc-converter.name":"محول DC/DC","mppt.name":"وحدة تحكم MPPT","ct.name":"محول التيار (CT)","disconnector.name":"مفتاح العزل (QS)","earth.name":"أرضي","earthing-switch.name":"مفتاح التأريض (QE)","fuse.name":"منصهر (FU)","generator.name":"مولد (G)","grid-source.name":"مصدر الشبكة","grounding-transformer.name":"محول التأريض (توصيل متعرج)","inverter.name":"عاكس (DC→AC)","load-switch.name":"مفتاح قطع الحمل","load.name":"حمل","luminaire.name":"مصباح (حمل إنارة)","panelboard.name":"لوحة توزيع / مركز أحمال","ngr.name":"مقاومة تأريض المحايد (NGR)","pt.name":"محول الجهد (PT)","pv.name":"وحدة كهروضوئية","rectifier.name":"مقوّم (AC→DC)","series-reactor.name":"مفاعل توالي","shunt-capacitor.name":"مكثف توازي","shunt-reactor.name":"مفاعل توازي","sync-motor.name":"محرك متزامن","transformer-2w.name":"محول ثنائي الملفات","transformer-3w.name":"محول ثلاثي الملفات","wind-turbine.name":"توربين رياح","gfci-breaker.name":"قاطع GFCI (RCBO)","rcd.name":"جهاز التيار المتبقي (RCD)","recloser.name":"قاطع إعادة التوصيل (Recloser)","energy-meter.name":"عداد الطاقة (Wh)","voltmeter.name":"فولتميتر (V)","ammeter.name":"أميتر (A)","wattmeter.name":"واتميتر (W)","frequency-meter.name":"مقياس التردد (Hz)","contactor.name":"كونتاكتور (KM)","motor-starter.name":"مشغّل محرك","thermal-overload.name":"مرحل الحمل الزائد الحراري","vfd.name":"مشغّل بتردد متغير (VFD)","soft-starter.name":"مشغّل ناعم","transfer-switch.name":"مفتاح تحويل (ATS)","dc-disconnector.name":"مفتاح عزل التيار المستمر","dc-combiner.name":"صندوق تجميع التيار المستمر","ev-charger.name":"شاحن السيارات الكهربائية","arc-suppression-coil.desc":"تأريض محايد رنيني: ملف حثي متصل بالأرض","busbar.desc":"مقطع شريط ناقل واحد قابل للتمديد بعدة نقاط تفريع","converter-bidir.desc":"محول تخزين: تيار متردد ↔ تيار مستمر ثنائي الاتجاه","dc-dc-converter.desc":"محول DC/DC / شاحن تيار مستمر (IEC 60617)","mppt.desc":"وحدة تحكم شمسية MPPT (DC/DC، تتبع نقطة القدرة القصوى)","earthing-switch.desc":"مفتاح عزل + اتصال أرضي، منفذ واحد","grid-source.desc":"شريط ناقل لانهائي / شبكة خارجية","grounding-transformer.desc":"محول نجمي-متعرج لتأريض المحايد","load.desc":"حمل تجريدي (سهم خروج التيار)","luminaire.desc":"حمل إنارة (رمز عام للمصباح وفق IEC 60617)","ngr.desc":"تأريض بمقاومة منخفضة: محايد المحول إلى الأرض","series-reactor.desc":"نفس رمز مفاعل التوازي؛ يُميَّز حسب الاستخدام","wind-turbine.desc":"توربين رياح: مولد + علامة دوار ثلاثي الريش","gfci-breaker.desc":"قاطع تيار متبقٍ مزود بحماية من التيار الزائد (UL943 / IEC 61009). يُعرف بـ GFCI في أمريكا الشمالية و RCBO في أوروبا.","rcd.desc":"قاطع تيار متبقٍ بدون حماية من التيار الزائد (IEC 61008).","recloser.desc":"قاطع إعادة غلق تلقائي للجهد المتوسط.","energy-meter.desc":"عداد طاقة فعالة (kWh) — عند نقطة الدخول أو كعداد فرعي.","contactor.desc":"كونتاكتور الدائرة الرئيسية؛ يُستخدم عادةً مع مرحل حمل زائد حراري ومحرك.","motor-starter.desc":"مشغّل محرك (الرمز العام IEC 60617).","thermal-overload.desc":"مرحل حمل زائد حراري للمحرك؛ يوضع بين الكونتاكتور والمحرك.","vfd.desc":"مشغّل بتردد متغير للتحكم في سرعة المحرك الحثي.","soft-starter.desc":"مشغّل ناعم للمحرك (تشغيل بجهد مخفّض باستخدام الثايرستور).","transfer-switch.desc":"مفتاح تحويل بمصدرين (ATS / يدوي). مدخلا مصدرين + مخرج حمل واحد، مع تأمين ميكانيكي متبادل.","dc-disconnector.desc":"مفتاح عزل للتيار المستمر — لعزل جانب التيار المستمر لسلسلة الألواح الكهروضوئية / البطارية.","dc-combiner.desc":"صندوق تجميع لسلاسل الألواح الكهروضوئية (مثال بأربعة مداخل).","ev-charger.desc":"محطة شحن السيارات الكهربائية.","breaker.state.open":"مفتوح","disconnector.state.open":"مفتوح","earthing-switch.state.open":"مفتوح","fuse.state.blown":"محترق","load-switch.state.open":"مفتوح","gfci-breaker.state.open":"مفتوح","rcd.state.open":"مفتوح","recloser.state.open":"مفتوح","contactor.state.open":"مفتوح","thermal-overload.state.tripped":"متعثر","transfer-switch.state.position":"الموضع (عادي/طوارئ/إيقاف)","dc-disconnector.state.open":"مفتوح","battery.param.E":"السعة","busbar.param.Un":"الجهد الاسمي","converter-bidir.param.S":"السعة","dc-dc-converter.param.P":"القدرة","mppt.param.I":"التيار الاسمي","load.param.P":"القدرة الفعالة","load.param.cosphi":"معامل القدرة","ngr.param.R":"المقاومة","shunt-capacitor.param.Q":"القدرة التفاعلية","shunt-capacitor.param.stages":"المراحل","transformer-2w.param.S":"السعة","transformer-2w.param.ratio":"نسبة التحويل","gfci-breaker.param.In":"التيار الاسمي","gfci-breaker.param.IDn":"تيار التشغيل المتبقي","rcd.param.IDn":"تيار التشغيل المتبقي","breaker.param.In":"التيار الاسمي","breaker.param.poles":"عدد الأقطاب","breaker.param.Icu":"قدرة القطع","disconnector.param.In":"التيار الاسمي","fuse.param.In":"التيار الاسمي","resistor.name":"مقاومة (R)","capacitor.name":"مكثف (C)","diode.name":"ديود (D)","indicator-light.name":"مصباح إشارة (HL)","push-button.name":"زر ضغط (SB)","relay-coil.name":"ملف مرحل (KA)","make-contact.name":"تماس مفتوح عادةً (NO)","break-contact.name":"تماس مغلق عادةً (NC)","bell.name":"جرس (HA)","terminal.name":"طرف / نقطة وصل (X)","fuse-switch-disconnector.name":"مفتاح فصل مزود بمصهر","socket-outlet.name":"مقبس / موصل","inductor.name":"ملف حثي (L)","voltage-regulator.name":"منظم الجهد (T)","dc-motor.name":"محرك تيار مستمر (M)","heater.name":"عنصر تسخين (EH)","selector-switch.name":"مفتاح اختيار (SA)","limit-switch.name":"مفتاح حدّي (SQ)","proximity-switch.name":"مفتاح تقارب (SQ)","time-relay.name":"مرحل زمني (KT)","buzzer.name":"طنّان (HA)","siren.name":"صفارة إنذار (HA)","thermocouple.name":"مزدوجة حرارية (BT)","thyristor.name":"ثايرستور / SCR (V)","triac.name":"ترياك (V)","zener-diode.name":"ديود زينر (D)","igbt.name":"IGBT","plc.name":"PLC / متحكم","ups.name":"UPS","power-supply.name":"مزود طاقة (PS)","genset.name":"مجموعة مولد (G)","protective-relay.name":"مرحل حماية","overcurrent-relay.name":"مرحل تيار زائد (50/51)","undervoltage-relay.name":"مرحل انخفاض الجهد (27)","reverse-power-relay.name":"مرحل القدرة العكسية (32)","distance-relay.name":"مرحل مسافة (21)","phase-failure-relay.name":"مرحل فقد الطور","buchholz-relay.name":"مرحل بوخهولز (63)","power-factor-meter.name":"مقياس معامل القدرة (cosφ)","synchronoscope.name":"مقياس التزامن","varmeter.name":"مقياس القدرة التفاعلية (var)","resistor.desc":"مقاومة عامة / للحد من التيار / مقاومة كبح.","capacitor.desc":"مكثف عام / للترشيح / لناقل التيار المستمر. استخدم مكثف التوازي لتصحيح معامل القدرة.","diode.desc":"ديود تقويم / تدوير حر / حماية. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","indicator-light.desc":"مصباح إشارة / حالة.","push-button.desc":"زر ضغط يدوي، رجوع تلقائي (تماس مفتوح عادةً).","relay-coil.desc":"ملف تشغيل مرحل / كونتاكتور (صندوق).","make-contact.desc":"تماس مساعد مفتوح عادةً (توصيل عند التشغيل).","break-contact.desc":"تماس مساعد مغلق عادةً (فصل عند التشغيل).","bell.desc":"جرس إشارة / جرس إنذار.","terminal.desc":"طرف / صندوق توصيل / عقدة اتصال.","fuse-switch-disconnector.desc":"مفتاح فصل مزود بمصهر يعمل تحت الحمل.","socket-outlet.desc":"مقبس كهربائي / موصل متعدد الأقطاب.","inductor.desc":"ملف حثي عام / وشيعة / خانق.","voltage-regulator.desc":"منظم جهد حثي قابل للتعديل / محول ذاتي.","dc-motor.desc":"محرك تيار مستمر (الرمز العام لملف المجال التوالي).","heater.desc":"عنصر تسخين مقاوم / حمل تسخين.","selector-switch.desc":"مفتاح اختيار / تحويل (دوّار، يثبت في وضعه).","limit-switch.desc":"مفتاح حركة / موضع (مفتوح عادةً، يعمل ميكانيكيًا).","proximity-switch.desc":"حساس تقارب / مفتاح تقارب بلا تماس.","time-relay.desc":"ملف مرحل زمني (تأخير التشغيل).","buzzer.desc":"طنّان إشارة.","siren.desc":"صفارة إنذار صوتية.","thermocouple.desc":"حساس حرارة من نوع مزدوجة حرارية.","thyristor.desc":"ثايرستور ثلاثي الأطراف حاجب عكسي / SCR. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","triac.desc":"ثايرستور ثلاثي ثنائي الاتجاه (TRIAC).","zener-diode.desc":"ديود زينر / منظم جهد. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","igbt.desc":"IGBT معزز قناة-N. t1 = المجمّع (أعلى)، t2 = الباعث (أسفل)، t_g = البوابة.","plc.desc":"متحكم منطقي قابل للبرمجة (PLC).","ups.desc":"مزود طاقة غير منقطع (UPS) خطي / احتياطي.","power-supply.desc":"مزود طاقة بتحويل مفتاح AC→DC / تيار مستمر. t_ac أعلى (~)، t_dc أسفل (=).","genset.desc":"مجموعة مولد ديزل / غاز.","protective-relay.desc":"مرحل قياس / حماية، رمز عام (IEC 60617).","overcurrent-relay.desc":"مرحل حماية من التيار الزائد (ANSI 50/51).","undervoltage-relay.desc":"مرحل حماية من انخفاض الجهد (ANSI 27).","reverse-power-relay.desc":"مرحل حماية من القدرة العكسية / التيار العكسي (ANSI 32).","distance-relay.desc":"مرحل حماية مسافة / انخفاض الممانعة (ANSI 21).","phase-failure-relay.desc":"مرحل حماية من فقد الطور.","buchholz-relay.desc":"مرحل بوخهولز / الغاز (ANSI 63).","power-factor-meter.desc":"مقياس معامل القدرة (cosφ).","synchronoscope.desc":"مؤشر التزامن / مقياس التزامن.","varmeter.desc":"مقياس القدرة التفاعلية (var).","make-contact.state.closed":"مغلق","break-contact.state.open":"مفتوح","fuse-switch-disconnector.state.open":"مفتوح","selector-switch.state.open":"مفتوح","limit-switch.state.closed":"مغلق","resistor.param.R":"المقاومة","resistor.param.P":"القدرة الاسمية","capacitor.param.C":"السعة الكهربائية","capacitor.param.Un":"الجهد الاسمي","indicator-light.param.color":"اللون","inductor.param.L":"المحاثة","inductor.param.In":"التيار الاسمي","voltage-regulator.param.ratio":"نطاق التنظيم","heater.param.P":"القدرة","ups.param.S":"السعة","power-supply.param.Vdc":"جهد الخرج","genset.param.P":"القدرة"},SS={ui:vS,library:kS},_S={"common.unnamed":"ללא שם","common.close":"סגור","common.yes":"כן","common.no":"לא","topbar.theme.toLight":"עבור למצב בהיר","topbar.theme.toDark":"עבור למצב כהה","topbar.theme.currentDark":"נוכחי: ערכת נושא כהה","topbar.theme.currentLight":"נוכחי: ערכת נושא בהירה","topbar.lang.toEnglish":"עבור לאנגלית","topbar.lang.toChinese":"עבור לסינית","topbar.lang.currentEnglish":"נוכחי: אנגלית","topbar.lang.currentChinese":"נוכחי: סינית","topbar.export.label":"ייצוא","topbar.export.tooltip":"SVG וקטורי (ניתן לעריכה), PNG (2×, רזולוציה גבוהה), או DXF (CAD)","topbar.export.pngFailed":"ייצוא PNG נכשל: {err}","topbar.export.dxfFailed":"ייצוא DXF נכשל: {err}","topbar.file.label":"קובץ","topbar.file.tooltip":"פתחו תרשים .json מקומי, שמרו, או שמרו בשם","topbar.file.current":"נוכחי: {name}","topbar.file.new":"חדש","topbar.file.open":"פתח…","topbar.file.save":"שמור","topbar.file.saveAs":"שמור בשם…","topbar.file.newConfirm":"יצירת קובץ חדש תמחק שינויים שלא נשמרו. להמשיך?","topbar.file.openFailed":"פתיחה נכשלה: {err}","topbar.file.saveFailed":"שמירה נכשלה: {err}","topbar.file.fileDescription":"תרשים OneLineEditor","outline.title":"מבנה","outline.collapse":"כווץ","outline.collapseAria":"כווץ את המבנה","outline.empty":"(אין רכיבים — גררו מהספרייה כדי להתחיל)","props.title":"מאפיינים","props.node":"צומת חשמלי","props.wire":"תיל","props.bus":"פס צבירה","props.junction":"מחבר","props.junctionPos":"מיקום","props.nSelected":"{n} נבחרו","props.empty":"לא נבחר דבר","props.multi":"{n} רכיבים נבחרו","props.name":"שם","props.note":"הערה","props.label":"תווית","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"צומת חשמלי {id} לא נמצא","props.wireNotFound":"תיל {id} לא נמצא","props.nodeStats":"{terminals} הדקים · {elements} רכיבים","props.selectElement":"בחר {label}","props.selectWholeNode":"בחר את כל הצומת החשמלי","props.annText":"טקסט","props.annRect":"מלבן","props.annLine":"קו","props.annTable":"טבלה","props.annNotFound":"סימון {id} לא נמצא","props.annLabel":"תווית","props.annLabelPlaceholder":"לדוגמה: לוח 1#","props.annStroke":"סוג קו","props.annStrokeSolid":"רציף","props.annStrokeDashed":"מקווקו","props.annFill":"מילוי","props.annFillNone":"ללא","props.annFillTint":"גוון","props.annArrow":"חיצים","props.annArrowNone":"ללא","props.annArrowEnd":"קצה אחד","props.annArrowBoth":"שני קצוות","props.annFontSize":"גודל גופן","props.annRows":"שורות","props.annCols":"עמודות","view.zoomOut":"הקטן תצוגה","view.zoomOutHint":"הקטנה מדורגת; ניתן גם עם גלגלת ↓ או ⌘−","view.reset":"אפס ל-100%","view.current":"נוכחי {z}%","view.zoomIn":"הגדל תצוגה","view.zoomInHint":"הגדלה מדורגת; ניתן גם עם גלגלת ↑ או ⌘+","view.fit":"התאם תצוגה","view.fitHint":"מתאים אוטומטית ומרכז את כל הרכיבים","view.gridHide":"הסתר רשת","view.gridShow":"הצג רשת","view.gridHotkey":"G","view.gridHideHint":"גם מבטל הצמדה לרשת (מיקום חופשי)","view.gridShowHint":"גם מפעיל הצמדה לרשת (הצמדה ל-10px בגרירה)","view.gridHideAria":"הסתר רשת ובטל הצמדה","view.gridShowAria":"הצג רשת והפעל הצמדה","view.label":"תוויות","view.labelOff":"כבוי","view.labelId":"מזהה","view.labelAll":"מזהה + פרמטרים","view.labelHint":"תצוגת תוויות וגודל הגופן (חל גם על הייצוא)","view.labelSize":"גודל","view.labelSizeSmaller":"הקטנת גופן התוויות","view.labelSizeLarger":"הגדלת גופן התוויות","view.labelSizeReset":"איפוס גודל התוויות","library.title":"ספריית רכיבים","library.empty":"לא נמצאו רכיבים תואמים","library.searchPlaceholder":"חיפוש רכיבים…","library.searchAria":"חיפוש רכיבים","library.clearSearch":"נקה חיפוש","library.itemHint":"לחצו כדי להיכנס למצב מיקום, או גררו אל הקנבס","tool.select":"בחירה","tool.selectHint":"לחיצה לבחירת רכיב, גרירת מסגרת לבחירה מרובה, קליק ימני לתפריט","tool.pan":"הזזה","tool.panHint":"גררו את הקנבס; מקש הרווח מפעיל זמנית","tool.wire":"תיל","tool.wireHint":"גררו מהדק / פס צבירה / מחבר; גרירה לשטח ריק יוצרת מחבר חדש, וגרירה על תיל קיים מתחברת אליו","tool.bus":"פס צבירה","tool.busHint":"גררו על הקנבס — לחצו לקביעת נקודת ההתחלה, שחררו לקביעת הסיום","tool.junction":"מחבר","tool.junctionHint":"לחצו על הקנבס כדי להציב מחבר (צומת); ניתן לחבר אליו תילים בחופשיות","tool.place":"הצבה","tool.placeHint":"לחצו כדי להציב; או גררו מהדק / פס צבירה כדי להציב ולחבר בו-זמנית","tool.text":"טקסט","tool.textHint":"לחצו על הקנבס כדי להוסיף הערת טקסט; לחיצה כפולה על הערה קיימת לעריכה","tool.rect":"מלבן","tool.rectHint":"גררו כדי לצייר מלבן / מסגרת קיבוץ (מקווקו כברירת מחדל); Shift לריבוע","tool.line":"קו","tool.lineHint":"גררו כדי לצייר קו סימון; Shift מצמיד ל-45°; חיצים זמינים בפאנל המאפיינים","tool.table":"טבלה","tool.tableHint":"גררו כדי לקבוע עמודות × שורות (ספירה חיה), או לחצו לטבלת ברירת מחדל; לחיצה כפולה על תא להקלדה","mode.selectWithSel":"גררו רכיבים · גררו מהדקים כדי לחווט · קליק ימני לתפריט","mode.selectEmpty":"לחצו לבחירה · גררו להזזה · מסגרת לבחירה מרובה · קליק ימני לתפריט","mode.pan":"גררו את הקנבס · גלגלת לזום · החזיקו Space כדי להזיז בכל כלי","mode.wireDragging":"שחררו על הדק / פס צבירה / מחבר; שחרור בשטח ריק יוצר מחבר חדש","mode.wireInit":"לחצו על כל נקודת חיבור או שטח ריק, גררו ליעד ושחררו","mode.busDragging":"הגרירה קובעת את כיוון הפס; השחרור קובע את הסיום","mode.busInit":"לחצו על הקנבס לקביעת ההתחלה, גררו, ושחררו לקביעת הסיום","mode.junction":"לחצו על הקנבס כדי להציב מחבר","mode.placeNoKind":"בחרו סוג רכיב מהספרייה בצד שמאל","mode.placeFromTerm":"שחררו ביעד — הרכיב החדש יתחבר בחזרה להדק המקור","mode.placeNormal":"לחצו על שטח ריק כדי להציב; או גררו מהדק / פס צבירה כדי להציב ולחבר","mode.text":"לחצו להוספת טקסט · לחיצה כפולה לעריכה · גררו רכיב נבחר להזזה · Del להסרה","mode.rect":"גררו לציור מלבן · Shift לריבוע · שנו גודל והוסיפו תווית לאחר השחרור","mode.line":"גררו לציור קו · Shift מצמיד ל-45° · הוסיפו חיצים בפאנל לאחר השחרור","mode.table":"גררו לקביעת הרשת, או לחצו לטבלת 3×3 · לחיצה כפולה על תא להקלדה","mode.annTextSel":"לחצו על הטקסט לעריכה · גררו להזזה · Del להסרה","mode.annTableSel":"לחצו על תא למילוי · גררו להזזה · Del להסרה","mode.annShapeSel":"גררו להזזה · גררו את הידיות לשינוי גודל · שנו סגנון בפאנל · Del להסרה","mode.annEditing":"הקלידו · Enter לאישור · Esc לביטול · או כפתורי ✓ / ✕","mode.escSelect":"Esc מנקה את הבחירה","mode.escOther":"קליק ימני / Esc לביטול","tool.placeNoKindTooltip":"בחרו סוג רכיב בספרייה בצד שמאל, ואז לחצו על הקנבס","tool.undo":"בטל","tool.undoHint":"בטל את הפעולה האחרונה (הזזה / סיבוב / מחיקה וכו׳)","tool.redo":"בצע שוב","tool.redoHint":"בצע שוב את הפעולה האחרונה שבוטלה","layout.label":"פריסה","layout.hint":"פריסה אוטומטית של כל התרשים או רק של הבחירה, ומילוי פערים","layout.allAuto":"פריסה אוטומטית לכל התרשים","layout.selAuto":"פריסה אוטומטית לבחירה","layout.allFill":"מלא רכיבים לא ממוקמים","layout.selFill":"מלא רכיבים לא ממוקמים בבחירה","tool.more":"עוד","tool.moreHint":"בטל / בצע שוב / פריסה","view.menu":"תצוגה","view.menuHint":"זום, התאמה, רשת","ctx.ariaNode":"פעולות על צומת","ctx.ariaWire":"פעולות על תיל","ctx.ariaElement":"פעולות על רכיב","ctx.ariaEdit":"פעולות עריכה","ctx.done":"סיום","ctx.cancel":"ביטול","ctx.rotate":"סובב 90°","ctx.rotateHint":"סובב את הבחירה בכיוון השעון; התילים ינותבו מחדש דרך ההדקים החדשים","ctx.mirror":"שקף אופקית","ctx.mirrorTitle":"שיקוף","ctx.mirrorHint":"הפוך את הבחירה מימין לשמאל","ctx.delete":"מחק","ctx.deleteHintNode":"נתק את כל התילים בצומת זה (הרכיבים נשארים)","ctx.deleteHintWire":"הסר רק את התיל הזה (תילים אחרים באותו צומת נשארים)","ctx.deleteHintElement":"הסר את הבחירה ואת התילים המחוברים אליה","ctx.resetWirePath":"אפס לניתוב אוטומטי","ctx.resetWirePathHint":"הסר פינות ידניות ותן לניתוב האוטומטי לצייר מחדש את התיל","menu.undo":"בטל","menu.redo":"בצע שוב","menu.cut":"גזור","menu.copy":"העתק","menu.paste":"הדבק","menu.rotate":"סובב 90°","menu.mirror":"שיקוף","menu.selectAll":"בחר הכל","menu.disconnect":"נתק תיל זה","menu.delete":"מחק","io.parseFailed":"ניתוח JSON נכשל: {err}","io.notObject":"הקובץ אינו אובייקט JSON","io.versionMismatch":'אי-התאמת גרסה: צפוי "1", התקבל {actual}',"io.elementsMissing":"השדה `elements` חסר או שאינו מערך","compile.duplicateId":'מזהה רכיב כפול: "{id}"',"compile.unknownKind":'סוג רכיב לא ידוע kind="{kind}"',"compile.invalidTermRef":'הפניית הדק לא תקינה "{ref}"',"compile.elementMissing":'הפניה לרכיב לא ידוע "{id}"',"compile.missingPin":'לרכיב "{id}" (kind={kind}) אין הדק "{pin}"; זמינים: {available}',"compile.singleTerminal":"לצומת יש הדק אחד בלבד — הצומת נדחה","compile.layoutMissingElement":'מפתח ה-layout "{id}" מפנה לרכיב לא ידוע',"compile.elementUnconnected":'לרכיב "{id}" אין חיבורים',"cat.busbar":"פס צבירה / חיווט","cat.switching":"מיתוג","cat.protection":"הגנה","cat.motor-control":"בקרת מנועים","cat.transformer":"שנאים","cat.instrument-transformer":"שנאי מדידה","cat.measurement":"מדידה","cat.source":"מקור","cat.load":"עומס","cat.storage":"אגירת אנרגיה","cat.compensation":"פיצוי הספק מגיב","cat.grounding":"הארקה","cat.renewable":"אנרגיה מתחדשת / אלקטרוניקת הספק","onboard.title":"התחלה מהירה","onboard.step1.title":"הציבו רכיב","onboard.step1.body":"בחרו בכלי הצבה (P) וגררו סוג רכיב מהספרייה אל הקנבס","onboard.step2.title":"חברו בתילים","onboard.step2.body":"השתמשו בכלי תיל (W): גררו מהדק אחד לאחר — גרירה לשטח ריק תיצור מחבר","onboard.step3.title":"פס צבירה הוא פס משותף, לא תיל","onboard.step3.body":"השתמשו בכלי פס צבירה (B) רק כשכמה מעגלים חולקים פס אחד. אל תשתמשו בפס צבירה כדי לחבר שני התקנים — פשוט חברו את ההדקים בתיל (W).","onboard.dismiss":"הבנתי"},CS={"arc-suppression-coil.name":"סליל דעיכת קשת","arrester.name":"מגן ברקים (FBL)","async-motor.name":"מנוע אסינכרוני","autotransformer.name":"שנאי אוטו","battery.name":"אגירת מצברים","breaker.name":"מפסק (QF)","busbar.name":"קטע פס צבירה","converter-bidir.name":"ממיר דו-כיווני (PCS)","dc-dc-converter.name":"ממיר DC/DC","mppt.name":"בקר MPPT","ct.name":"שנאי זרם (CT)","disconnector.name":"מנתק (QS)","earth.name":"הארקה","earthing-switch.name":"מפסק הארקה (QE)","fuse.name":"נתיך (FU)","generator.name":"גנרטור (G)","grid-source.name":"מקור הזנה מהרשת","grounding-transformer.name":"שנאי הארקה (זיגזג)","inverter.name":"ממיר (DC→AC)","load-switch.name":"מפסק עומס","load.name":"עומס","luminaire.name":"גוף תאורה (עומס תאורה)","panelboard.name":"לוח חשמל","ngr.name":"נגד הארקת נייטרלי (NGR)","pt.name":"שנאי מתח (PT)","pv.name":"מודול פוטו-וולטאי","rectifier.name":"מיישר (AC→DC)","series-reactor.name":"משרן טורי","shunt-capacitor.name":"קבל מקבילי","shunt-reactor.name":"משרן מקבילי","sync-motor.name":"מנוע סינכרוני","transformer-2w.name":"שנאי דו-סלילי","transformer-3w.name":"שנאי תלת-סלילי","wind-turbine.name":"טורבינת רוח","gfci-breaker.name":"מפסק GFCI (RCBO)","rcd.name":"התקן פחת (RCD)","recloser.name":"מפסק שחזור אוטומטי (Recloser)","energy-meter.name":"מונה אנרגיה (Wh)","voltmeter.name":"וולטמטר (V)","ammeter.name":"אמפרמטר (A)","wattmeter.name":"ואטמטר (W)","frequency-meter.name":"מד תדר (Hz)","contactor.name":"מגען (KM)","motor-starter.name":"מתנע מנוע","thermal-overload.name":"ממסר עומס יתר תרמי","vfd.name":"ממיר תדר (VFD)","soft-starter.name":"מתנע רך","transfer-switch.name":"מתג העברה (ATS)","dc-disconnector.name":"מנתק DC","dc-combiner.name":"תיבת ריכוז DC","ev-charger.name":"עמדת טעינה לרכב חשמלי","arc-suppression-coil.desc":"הארקת נייטרלי תהודתית: סליל לאדמה","busbar.desc":"קטע פס יחיד נמתח עם מספר הסתעפויות","converter-bidir.desc":"ממיר אגירה: דו-כיווני AC ↔ DC","dc-dc-converter.desc":"ממיר DC/DC / מטען DC (IEC 60617)","mppt.desc":"בקר טעינה סולארי MPPT (DC/DC, מעקב אחר נקודת ההספק המרבי)","earthing-switch.desc":"מנתק + חיבור הארקה, יציאה בודדת","grid-source.desc":"פס אינסופי / רשת חיצונית","grounding-transformer.desc":"שנאי כוכב-זיגזג להארקת נייטרלי","load.desc":"עומס מופשט (חץ יציאת זרם)","luminaire.desc":"עומס תאורה (סמל כללי לגוף תאורה לפי IEC 60617)","ngr.desc":"הארקה בהתנגדות נמוכה: נייטרלי השנאי לאדמה","series-reactor.desc":"אותו סמל כמו משרן מקבילי; ההבחנה לפי אופן השימוש","wind-turbine.desc":"טורבינת רוח: גנרטור + סימון רוטור תלת-להב","gfci-breaker.desc":"מפסק פחת עם הגנת זרם יתר (UL943 / IEC 61009). מכונה גם GFCI (צפון אמריקה) או RCBO (אירופה).","rcd.desc":"מפסק פחת ללא הגנת זרם יתר (IEC 61008).","recloser.desc":"מפסק שחזור אוטומטי במתח בינוני.","energy-meter.desc":"מונה אנרגיה פעילה (kWh) — כניסת שירות / מונה משנה.","contactor.desc":"מגען למעגל ראשי; משמש בדרך כלל עם ממסר תרמי ומנוע.","motor-starter.desc":"מתנע מנוע (סמל כללי לפי IEC 60617).","thermal-overload.desc":"ממסר עומס יתר תרמי למנוע; ממוקם בין המגען למנוע.","vfd.desc":"ממיר תדר לבקרת מהירות מנוע אסינכרוני.","soft-starter.desc":"מתנע רך למנוע (הפעלה במתח מופחת מבוססת תיריסטורים).","transfer-switch.desc":"מתג העברה דו-מקורי (ATS / ידני). שני מקורות כניסה ויציאת עומס אחת, עם נעילה הדדית ללא הזנה מקבילה.","dc-disconnector.desc":"מנתק DC — בידוד צד DC של מחרוזות פוטו-וולטאיות / מצברים.","dc-combiner.desc":"תיבת ריכוז מחרוזות פוטו-וולטאיות (דוגמה עם 4 כניסות).","ev-charger.desc":"עמדת טעינה לרכב חשמלי.","breaker.state.open":"פתוח","disconnector.state.open":"פתוח","earthing-switch.state.open":"פתוח","fuse.state.blown":"שרוף","load-switch.state.open":"פתוח","gfci-breaker.state.open":"פתוח","rcd.state.open":"פתוח","recloser.state.open":"פתוח","contactor.state.open":"פתוח","thermal-overload.state.tripped":"הופעל","transfer-switch.state.position":"מצב (רגיל/חירום/כבוי)","dc-disconnector.state.open":"פתוח","battery.param.E":"קיבולת","busbar.param.Un":"מתח נקוב","converter-bidir.param.S":"הספק נקוב","dc-dc-converter.param.P":"הספק","mppt.param.I":"זרם נקוב","load.param.P":"הספק פעיל","load.param.cosphi":"מקדם הספק","ngr.param.R":"התנגדות","shunt-capacitor.param.Q":"הספק מגיב","shunt-capacitor.param.stages":"מדרגות","transformer-2w.param.S":"הספק נקוב","transformer-2w.param.ratio":"יחס תמורה","gfci-breaker.param.In":"זרם נקוב","gfci-breaker.param.IDn":"זרם ניתוק פחת","rcd.param.IDn":"זרם ניתוק פחת","breaker.param.In":"זרם נקוב","breaker.param.poles":"מספר קטבים","breaker.param.Icu":"כושר ניתוק","disconnector.param.In":"זרם נקוב","fuse.param.In":"זרם נקוב","resistor.name":"נגד (R)","capacitor.name":"קבל (C)","diode.name":"דיודה (D)","indicator-light.name":"נורית חיווי (HL)","push-button.name":"לחצן (SB)","relay-coil.name":"סליל ממסר (KA)","make-contact.name":"מגע נורמלי-פתוח (NO)","break-contact.name":"מגע נורמלי-סגור (NC)","bell.name":"פעמון (HA)","terminal.name":"הדק / צומת (X)","fuse-switch-disconnector.name":"מפסק-מנתק עם נתיכים","socket-outlet.name":"שקע / מחבר","inductor.name":"משרן (L)","voltage-regulator.name":"ווסת מתח (T)","dc-motor.name":"מנוע DC (M)","heater.name":"גוף חימום (EH)","selector-switch.name":"מתג בורר (SA)","limit-switch.name":"מפסק גבול (SQ)","proximity-switch.name":"מתג קרבה (SQ)","time-relay.name":"ממסר זמן (KT)","buzzer.name":"זמזם (HA)","siren.name":"צופר (HA)","thermocouple.name":"תרמוזוג (BT)","thyristor.name":"תיריסטור / SCR (V)","triac.name":"טריאק (V)","zener-diode.name":"דיודת זנר (D)","igbt.name":"IGBT","plc.name":"בקר PLC","ups.name":"אל-פסק (UPS)","power-supply.name":"ספק כוח (PS)","genset.name":"קבוצת גנרטור (G)","protective-relay.name":"ממסר הגנה","overcurrent-relay.name":"ממסר זרם יתר (50/51)","undervoltage-relay.name":"ממסר תת-מתח (27)","reverse-power-relay.name":"ממסר הספק הפוך (32)","distance-relay.name":"ממסר מרחק (21)","phase-failure-relay.name":"ממסר כשל פאזה","buchholz-relay.name":"ממסר בוכהולץ (63)","power-factor-meter.name":"מד מקדם הספק (cosφ)","synchronoscope.name":"סינכרונוסקופ","varmeter.name":"מד הספק מגיב (var)","resistor.desc":"נגד כללי / הגבלת זרם / נגד בלימה.","capacitor.desc":"קבל כללי / סינון / פס DC. לשיפור מקדם הספק השתמשו בקבל מקבילי.","diode.desc":"דיודת יישור / דיודת חופש / דיודת הגנה. t1 = אנודה (למעלה), t2 = קתודה (למטה).","indicator-light.desc":"נורית איתות / חיווי מצב.","push-button.desc":"לחצן ידני עם החזרה אוטומטית (מגע נורמלי-פתוח).","relay-coil.desc":"סליל הפעלה של ממסר / מגען (תיבה).","make-contact.desc":"מגע עזר נורמלי-פתוח (סוגר).","break-contact.desc":"מגע עזר נורמלי-סגור (פותח).","bell.desc":"פעמון איתות / פעמון אזעקה.","terminal.desc":"הדק / תיבת חיבורים / צומת חיבור.","fuse-switch-disconnector.desc":"מפסק-מנתק עם נתיכים לניתוק בעומס.","socket-outlet.desc":"שקע חשמל / מחבר רב-קוטבי.","inductor.desc":"משרן כללי / סליל / דעכן.","voltage-regulator.desc":"ווסת מתח אינדוקטיבי / שנאי-אוטו מתכוונן.","dc-motor.desc":"מנוע DC (סמל כללי, עירור טורי).","heater.desc":"גוף חימום נגדי / עומס חימום.","selector-switch.desc":"מתג בורר / מתג החלפה (סיבובי, נשאר במצב).","limit-switch.desc":"מפסק גבול / מיקום (נורמלי-פתוח, הפעלה מכנית).","proximity-switch.desc":"חיישן קרבה / מתג קרבה ללא מגע.","time-relay.desc":"סליל ממסר השהיית זמן (פעולה מושהית).","buzzer.desc":"זמזם איתות.","siren.desc":"צופר / אזעקה קולית.","thermocouple.desc":"חיישן טמפרטורה מסוג תרמוזוג.","thyristor.desc":"תיריסטור טריודה חוסם-הפוך / SCR. t1 = אנודה (למעלה), t2 = קתודה (למטה).","triac.desc":"תיריסטור טריודה דו-כיווני (TRIAC).","zener-diode.desc":"דיודת זנר / ווסת מתח. t1 = אנודה (למעלה), t2 = קתודה (למטה).","igbt.desc":"IGBT מסוג ערוץ-N. t1 = קולקטור (למעלה), t2 = אמיטר (למטה), t_g = שער.","plc.desc":"בקר לוגי מתוכנת (PLC).","ups.desc":"אל-פסק (UPS) מסוג און-ליין / המתנה.","power-supply.desc":"ספק כוח נדסק (AC→DC) / ספק DC. t_ac למעלה (~), t_dc למטה (=).","genset.desc":"קבוצת גנרטור דיזל / גז.","protective-relay.desc":"ממסר מדידה / הגנה, סמל כללי (IEC 60617).","overcurrent-relay.desc":"ממסר הגנת זרם יתר (ANSI 50/51).","undervoltage-relay.desc":"ממסר הגנת תת-מתח (ANSI 27).","reverse-power-relay.desc":"ממסר הגנה בפני הספק הפוך / זרם הפוך (ANSI 32).","distance-relay.desc":"ממסר הגנת מרחק / תת-עכבה (ANSI 21).","phase-failure-relay.desc":"ממסר הגנה בפני כשל פאזה / אובדן פאזה.","buchholz-relay.desc":"ממסר בוכהולץ / ממסר גז (ANSI 63).","power-factor-meter.desc":"מד מקדם הספק (cosφ).","synchronoscope.desc":"מד סנכרון / סינכרונוסקופ.","varmeter.desc":"מד הספק מגיב (var).","make-contact.state.closed":"סגור","break-contact.state.open":"פתוח","fuse-switch-disconnector.state.open":"פתוח","selector-switch.state.open":"פתוח","limit-switch.state.closed":"סגור","resistor.param.R":"התנגדות","resistor.param.P":"הספק נקוב","capacitor.param.C":"קיבול","capacitor.param.Un":"מתח נקוב","indicator-light.param.color":"צבע","inductor.param.L":"השראות","inductor.param.In":"זרם נקוב","voltage-regulator.param.ratio":"טווח ויסות","heater.param.P":"הספק","ups.param.S":"הספק נקוב","power-supply.param.Vdc":"מתח יציאה","genset.param.P":"הספק"},$S={ui:_S,library:CS},ve={es:nS,fr:iS,de:lS,pt:uS,ja:hS,ru:bS,fa:wS,ar:SS,he:$S},gr={zh:{"common.unnamed":"未命名","common.close":"关闭","common.yes":"是","common.no":"否","topbar.theme.toLight":"切换到亮色","topbar.theme.toDark":"切换到暗色","topbar.theme.currentDark":"当前:暗色主题","topbar.theme.currentLight":"当前:亮色主题","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"当前:中文","topbar.export.label":"导出","topbar.export.tooltip":"SVG 矢量(可编辑)、PNG 位图(2× 高清)或 DXF(CAD)","topbar.export.pngFailed":"导出 PNG 失败:{err}","topbar.export.dxfFailed":"导出 DXF 失败:{err}","topbar.file.label":"文件","topbar.file.tooltip":"打开本地 .json 图、保存、或另存为","topbar.file.current":"当前:{name}","topbar.file.new":"新建","topbar.file.open":"打开…","topbar.file.save":"保存","topbar.file.saveAs":"另存为…","topbar.file.newConfirm":"新建会清空当前未保存的内容,是否继续?","topbar.file.openFailed":"打开失败:{err}","topbar.file.saveFailed":"保存失败:{err}","topbar.file.fileDescription":"OneLineEditor 图纸","outline.title":"大纲","outline.collapse":"折叠","outline.collapseAria":"折叠大纲","outline.empty":"(无设备 — 从元件库拖入开始)","props.title":"属性","props.node":"电气节点","props.wire":"连线","props.bus":"母线","props.junction":"接线柱","props.junctionPos":"位置","props.nSelected":"{n} 选中","props.empty":"未选中","props.multi":"已选中 {n} 个元件","props.name":"名称","props.note":"备注","props.label":"标注","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"电气节点 {id} 不存在","props.wireNotFound":"连线 {id} 不存在","props.nodeStats":"{terminals} 个端子 · {elements} 个元件","props.selectElement":"选中 {label}","props.selectWholeNode":"选中整个电气节点","props.annText":"文字","props.annRect":"矩形","props.annLine":"线条","props.annTable":"表格","props.annNotFound":"标注 {id} 不存在","props.annLabel":"标签","props.annLabelPlaceholder":"如:1#配电柜","props.annStroke":"线型","props.annStrokeSolid":"实线","props.annStrokeDashed":"虚线","props.annFill":"填充","props.annFillNone":"无","props.annFillTint":"浅色","props.annArrow":"箭头","props.annArrowNone":"无","props.annArrowEnd":"单向","props.annArrowBoth":"双向","props.annFontSize":"字号","props.annRows":"行数","props.annCols":"列数","view.zoomOut":"缩小","view.zoomOutHint":"按预设档位缩小;也可滚轮 ↓ 或 ⌘−","view.reset":"重置到 100%","view.current":"当前 {z}%","view.zoomIn":"放大","view.zoomInHint":"按预设档位放大;也可滚轮 ↑ 或 ⌘+","view.fit":"适配视图","view.fitHint":"自动缩放并居中所有元件","view.gridHide":"隐藏网格","view.gridShow":"显示网格","view.gridHotkey":"G","view.gridHideHint":"同时关闭对齐吸附(拖动可自由放置)","view.gridShowHint":"同时开启对齐吸附(拖动会贴到 10px 网格)","view.gridHideAria":"隐藏网格并关闭吸附","view.gridShowAria":"显示网格并开启吸附","view.label":"标签","view.labelOff":"关闭","view.labelId":"仅 ID","view.labelAll":"ID + 参数","view.labelHint":"标签显示方式与字号(同样影响导出与打印)","view.labelSize":"字号","view.labelSizeSmaller":"缩小标签字号","view.labelSizeLarger":"放大标签字号","view.labelSizeReset":"恢复默认字号","library.title":"元件库","library.empty":"没有匹配的元件","library.searchPlaceholder":"搜索元件…","library.searchAria":"搜索元件","library.clearSearch":"清除搜索","library.itemHint":"单击进入放置模式或拖到画布","tool.select":"选择","tool.selectHint":"点选元件,框选多个,或右键打开菜单","tool.pan":"平移","tool.panHint":"拖动画布;空格键可临时切换","tool.wire":"连线","tool.wireHint":"从端子/母线/接线柱拖出;拖到空白处会自动新建接线柱,拖到已有连线上可打接点","tool.bus":"母线","tool.busHint":"画布上拖动一段母线,按下定起点、释放定终点","tool.junction":"接线柱","tool.junctionHint":"点击画布放置一个接线柱(接点),连线可自由连到它","tool.place":"元件","tool.placeHint":"点击画布放置;或从端子/母线拖出,同时放置并连接","tool.text":"文字","tool.textHint":"点击画布放置一段文字注释;双击文字可重新编辑","tool.rect":"矩形","tool.rectHint":"拖动绘制矩形 / 分组框(默认虚线);按住 Shift 画正方形","tool.line":"线条","tool.lineHint":"拖动绘制标注线;按住 Shift 按 45° 约束;箭头在属性面板设置","tool.table":"表格","tool.tableHint":"拖动扫出行列(实时显示 列×行),或单击放置默认表格;双击单元格填写","mode.selectWithSel":"拖动元件移动 · 拖端子连线 · 右键打开菜单","mode.selectEmpty":"点选元件 · 拖动移动 · 框选多个 · 右键打开菜单","mode.pan":"拖动画布 · 滚轮缩放 · 按住空格可在其他工具下临时平移","mode.wireDragging":"拖到端子/母线/接线柱释放;空白处释放会新建接线柱","mode.wireInit":"从任意连接点或空白处按下,拖到目标释放;空白处会新建接线柱","mode.busDragging":"拖动决定母线方向,释放定终点","mode.busInit":"在画布按下定起点,拖动后释放定终点","mode.junction":"点击画布放置一个接线柱","mode.placeNoKind":"从左侧元件库选择一种元件","mode.placeFromTerm":"拖到目标位置释放,新元件将连接到起点端子","mode.placeNormal":"点击空白放置;或从已有端子 / 母线拖出,同时放置并连接","mode.text":"点击画布放置文字;双击已有文字可编辑;选中后可拖动 / 删除","mode.rect":"拖动绘制矩形;Shift 正方形;释放后可拉伸并在属性面板加标签","mode.line":"拖动绘制线条;Shift 按 45° 约束;释放后可在属性面板加箭头","mode.table":"拖动扫出表格行列,或单击放置 3×3 表格;双击单元格填写内容","mode.annTextSel":"单击文字即可编辑 · 拖动移动 · Del 删除","mode.annTableSel":"单击单元格填写内容 · 拖动移动 · Del 删除","mode.annShapeSel":"拖动移动 · 拖动手柄缩放 · 右侧面板改样式 · Del 删除","mode.annEditing":"输入内容 · Enter 确认 · Esc 取消 · 或用 ✓ / ✕ 按钮","mode.escSelect":"Esc 清除选择","mode.escOther":"右键 / Esc 取消","tool.placeNoKindTooltip":"从左侧元件库选择一个元件后点击画布放置","tool.undo":"撤销","tool.undoHint":"撤销上一次编辑(移动 / 旋转 / 删除等)","tool.redo":"重做","tool.redoHint":"重做被撤销的操作","layout.label":"布局","layout.hint":"自动排版整个图或仅选中范围,并填补空缺","layout.allAuto":"重新自动布局","layout.selAuto":"重新自动布局选区","layout.allFill":"填补未排版位置","layout.selFill":"填补未排版选区","tool.more":"更多","tool.moreHint":"撤销 / 重做 / 布局","view.menu":"视图","view.menuHint":"缩放、适配、网格","ctx.ariaNode":"选中节点操作","ctx.ariaWire":"选中连线操作","ctx.ariaElement":"选中元件操作","ctx.ariaEdit":"编辑操作","ctx.done":"完成","ctx.cancel":"取消","ctx.rotate":"旋转 90°","ctx.rotateHint":"顺时针旋转选中元件,连线随端子自动重排","ctx.mirror":"水平镜像","ctx.mirrorTitle":"镜像","ctx.mirrorHint":"左右翻转选中元件","ctx.delete":"删除","ctx.deleteHintNode":"断开此电气节点上的所有连接(保留元件)","ctx.deleteHintWire":"移除这一根连线(其它同节点连线保留)","ctx.deleteHintElement":"移除选中元件及其连接的连线","ctx.resetWirePath":"恢复自动走线","ctx.resetWirePathHint":"清除手动调整的拐点,让连线回到自动路由","menu.undo":"撤销","menu.redo":"重做","menu.cut":"剪切","menu.copy":"复制","menu.paste":"粘贴","menu.rotate":"旋转 90°","menu.mirror":"镜像","menu.selectAll":"全选","menu.disconnect":"断开此连线","menu.delete":"删除","io.parseFailed":"JSON 解析失败:{err}","io.notObject":"文件不是 JSON 对象","io.versionMismatch":'版本不兼容:期望 "1",实际 {actual}',"io.elementsMissing":"elements 字段缺失或不是数组","compile.duplicateId":'元件 ID 重复:"{id}"',"compile.unknownKind":'未知元件类型 kind="{kind}"',"compile.invalidTermRef":'非法端子引用 "{ref}"',"compile.elementMissing":'引用了不存在的元件 "{id}"',"compile.missingPin":'元件 "{id}" (kind={kind}) 没有引脚 "{pin}",可用引脚: {available}',"compile.singleTerminal":"节点只包含一个端子,已忽略","compile.layoutMissingElement":'layout 键 "{id}" 引用了不存在的元件',"compile.elementUnconnected":'元件 "{id}" 没有任何连接',"cat.busbar":"母线 / 接线","cat.switching":"开关","cat.protection":"保护","cat.motor-control":"电机控制","cat.transformer":"变压器","cat.instrument-transformer":"互感器","cat.measurement":"测量仪表","cat.source":"电源","cat.load":"负荷","cat.storage":"储能","cat.compensation":"无功补偿","cat.grounding":"中性点接地","cat.renewable":"新能源 / 电力电子","onboard.title":"上手三步","onboard.step1.title":"放一个器件","onboard.step1.body":"切到 元件 工具(P),从左侧元件库选一种拖到画布","onboard.step2.title":"拉线连接","onboard.step2.body":"用 连线 工具(W)从一个引脚拖到另一个引脚;拖到空白处会自动新建接线柱","onboard.step3.title":"母线是共用排,不是连线","onboard.step3.body":"几条回路共用一排时才用 母线 工具(B)。别拿母线连两个器件——点对点直接拉线(W)就行。","onboard.dismiss":"知道了"},en:{"common.unnamed":"Untitled","common.close":"Close","common.yes":"Yes","common.no":"No","topbar.theme.toLight":"Switch to light","topbar.theme.toDark":"Switch to dark","topbar.theme.currentDark":"Current: dark theme","topbar.theme.currentLight":"Current: light theme","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"Current: Chinese","topbar.export.label":"Export","topbar.export.tooltip":"SVG vector (editable), PNG bitmap (2× HiDPI), or DXF (CAD)","topbar.export.pngFailed":"PNG export failed: {err}","topbar.export.dxfFailed":"DXF export failed: {err}","topbar.file.label":"File","topbar.file.tooltip":"Open a local .json diagram, save, or save as","topbar.file.current":"Current: {name}","topbar.file.new":"New","topbar.file.open":"Open…","topbar.file.save":"Save","topbar.file.saveAs":"Save as…","topbar.file.newConfirm":"New will discard any unsaved changes. Continue?","topbar.file.openFailed":"Open failed: {err}","topbar.file.saveFailed":"Save failed: {err}","topbar.file.fileDescription":"OneLineEditor diagram","outline.title":"Outline","outline.collapse":"Collapse","outline.collapseAria":"Collapse outline","outline.empty":"(No elements — drag from the library to start)","props.title":"Properties","props.node":"Electrical node","props.wire":"Wire","props.bus":"Bus","props.junction":"Junction","props.junctionPos":"Position","props.nSelected":"{n} selected","props.empty":"Nothing selected","props.multi":"{n} elements selected","props.name":"Name","props.note":"Note","props.label":"Label","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Electrical node {id} not found","props.wireNotFound":"Wire {id} not found","props.nodeStats":"{terminals} terminals · {elements} elements","props.selectElement":"Select {label}","props.selectWholeNode":"Select whole electrical node","props.annText":"Text","props.annRect":"Rectangle","props.annLine":"Line","props.annTable":"Table","props.annNotFound":"Annotation {id} not found","props.annLabel":"Label","props.annLabelPlaceholder":"e.g. Panel #1","props.annStroke":"Stroke","props.annStrokeSolid":"Solid","props.annStrokeDashed":"Dashed","props.annFill":"Fill","props.annFillNone":"None","props.annFillTint":"Tint","props.annArrow":"Arrows","props.annArrowNone":"None","props.annArrowEnd":"End","props.annArrowBoth":"Both","props.annFontSize":"Font size","props.annRows":"Rows","props.annCols":"Columns","view.zoomOut":"Zoom out","view.zoomOutHint":"Step zoom out; also wheel ↓ or ⌘−","view.reset":"Reset to 100%","view.current":"Current {z}%","view.zoomIn":"Zoom in","view.zoomInHint":"Step zoom in; also wheel ↑ or ⌘+","view.fit":"Fit view","view.fitHint":"Auto-zoom and center all elements","view.gridHide":"Hide grid","view.gridShow":"Show grid","view.gridHotkey":"G","view.gridHideHint":"Also disables snap-to-grid (free placement)","view.gridShowHint":"Also enables snap-to-grid (snaps to 10px on drag)","view.gridHideAria":"Hide grid and disable snap","view.gridShowAria":"Show grid and enable snap","view.label":"Labels","view.labelOff":"Off","view.labelId":"ID","view.labelAll":"ID + params","view.labelHint":"Label visibility and type size (applies to exports too)","view.labelSize":"Size","view.labelSizeSmaller":"Smaller label type","view.labelSizeLarger":"Larger label type","view.labelSizeReset":"Reset label size","library.title":"Library","library.empty":"No matching elements","library.searchPlaceholder":"Search elements…","library.searchAria":"Search elements","library.clearSearch":"Clear search","library.itemHint":"Click to enter place mode, or drag onto the canvas","tool.select":"Select","tool.selectHint":"Click to pick, marquee for multiple, right-click for menu","tool.pan":"Pan","tool.panHint":"Drag the canvas; Space toggles temporarily","tool.wire":"Wire","tool.wireHint":"Drag from a pin/bus/junction; into empty space drops a junction, onto a wire taps it","tool.bus":"Busbar","tool.busHint":"Drag on the canvas — press to set start, release to set end","tool.junction":"Junction","tool.junctionHint":"Click the canvas to drop a junction (node); wires attach to it freely","tool.place":"Place","tool.placeHint":"Click to place; or drag from a terminal/bus to place and connect","tool.text":"Text","tool.textHint":"Click the canvas to drop a text note; double-click an existing one to edit","tool.rect":"Rectangle","tool.rectHint":"Drag to draw a rectangle / group frame (dashed by default); Shift for a square","tool.line":"Line","tool.lineHint":"Drag to draw an annotation line; Shift snaps to 45°; arrows live in the panel","tool.table":"Table","tool.tableHint":"Drag to sweep out cols × rows (live count), or click for a default table; double-click cells to type","mode.selectWithSel":"Drag elements · drag terminals to wire · right-click for menu","mode.selectEmpty":"Click to pick · drag to move · marquee for multiple · right-click for menu","mode.pan":"Drag the canvas · scroll to zoom · hold Space to pan in any tool","mode.wireDragging":"Release on a pin/bus/junction; release in empty space drops a junction","mode.wireInit":"Press on any connection point or empty space, drag to a target and release","mode.busDragging":"Drag sets bus direction; release sets the end","mode.busInit":"Press on the canvas to set start, drag, release to set end","mode.junction":"Click the canvas to drop a junction","mode.placeNoKind":"Pick an element kind from the library on the left","mode.placeFromTerm":"Release at the target — the new element will connect back to the source terminal","mode.placeNormal":"Click empty space to place; or drag from a terminal / bus to place and connect","mode.text":"Click to drop text · double-click to edit · drag selected to move · Del to remove","mode.rect":"Drag to draw a rectangle · Shift for square · resize and label it after release","mode.line":"Drag to draw a line · Shift snaps to 45° · add arrows in the panel after release","mode.table":"Drag to sweep out the grid, or click for a 3×3 table · double-click cells to type","mode.annTextSel":"Click the text to edit · drag to move · Del to remove","mode.annTableSel":"Click a cell to fill it in · drag to move · Del to remove","mode.annShapeSel":"Drag to move · drag handles to resize · restyle in the panel · Del to remove","mode.annEditing":"Type · Enter to confirm · Esc to cancel · or the ✓ / ✕ buttons","mode.escSelect":"Esc clears selection","mode.escOther":"Right-click / Esc to cancel","tool.placeNoKindTooltip":"Pick a kind in the library on the left, then click the canvas","tool.undo":"Undo","tool.undoHint":"Undo the last edit (move / rotate / delete, etc.)","tool.redo":"Redo","tool.redoHint":"Redo the last undone edit","layout.label":"Layout","layout.hint":"Auto-layout the whole diagram or just the selection, fill gaps","layout.allAuto":"Auto-layout all","layout.selAuto":"Auto-layout selection","layout.allFill":"Fill unplaced","layout.selFill":"Fill unplaced in selection","tool.more":"More","tool.moreHint":"Undo / redo / layout","view.menu":"View","view.menuHint":"Zoom, fit, grid","ctx.ariaNode":"Node actions","ctx.ariaWire":"Wire actions","ctx.ariaElement":"Element actions","ctx.ariaEdit":"Editing actions","ctx.done":"Done","ctx.cancel":"Cancel","ctx.rotate":"Rotate 90°","ctx.rotateHint":"Rotate selection clockwise; wires re-route through new terminals","ctx.mirror":"Mirror horizontally","ctx.mirrorTitle":"Mirror","ctx.mirrorHint":"Flip selection left-right","ctx.delete":"Delete","ctx.deleteHintNode":"Disconnect every wire on this node (elements stay)","ctx.deleteHintWire":"Remove only this wire (siblings on the same node stay)","ctx.deleteHintElement":"Remove the selection and its wires","ctx.resetWirePath":"Reset to auto-route","ctx.resetWirePathHint":"Drop manual corners and let the router re-draw this wire","menu.undo":"Undo","menu.redo":"Redo","menu.cut":"Cut","menu.copy":"Copy","menu.paste":"Paste","menu.rotate":"Rotate 90°","menu.mirror":"Mirror","menu.selectAll":"Select all","menu.disconnect":"Disconnect this wire","menu.delete":"Delete","io.parseFailed":"JSON parse failed: {err}","io.notObject":"File is not a JSON object","io.versionMismatch":'Version mismatch: expected "1", got {actual}',"io.elementsMissing":"`elements` is missing or not an array","compile.duplicateId":'Duplicate element id: "{id}"',"compile.unknownKind":'Unknown element kind="{kind}"',"compile.invalidTermRef":'Invalid terminal reference "{ref}"',"compile.elementMissing":'Reference to unknown element "{id}"',"compile.missingPin":'Element "{id}" (kind={kind}) has no pin "{pin}"; available: {available}',"compile.singleTerminal":"Node has only one terminal — ignored","compile.layoutMissingElement":'layout key "{id}" references an unknown element',"compile.elementUnconnected":'Element "{id}" has no connections',"cat.busbar":"Busbar / wiring","cat.switching":"Switching","cat.protection":"Protection","cat.motor-control":"Motor control","cat.transformer":"Transformer","cat.instrument-transformer":"Instrument transformer","cat.measurement":"Measurement","cat.source":"Source","cat.load":"Load","cat.storage":"Storage","cat.compensation":"Compensation","cat.grounding":"Grounding","cat.renewable":"Renewables / power electronics","onboard.title":"Quick start","onboard.step1.title":"Place a component","onboard.step1.body":"Pick the Place tool (P) and drag a kind from the library onto the canvas","onboard.step2.title":"Wire it up","onboard.step2.body":"Use the Wire tool (W): drag from one pin to another — drag into empty space to drop a junction","onboard.step3.title":"A busbar is a shared rail, not a wire","onboard.step3.body":"Use the Busbar tool (B) only when several circuits share one rail. Don't use a bus to join two devices — just wire the pins (W).","onboard.dismiss":"Got it"}},co={zh:gr.zh,en:gr.en,es:ve.es.ui,fr:ve.fr.ui,de:ve.de.ui,pt:ve.pt.ui,ja:ve.ja.ui,ru:ve.ru.ui,fa:ve.fa.ui,ar:ve.ar.ui,he:ve.he.ui},Xi="ole-locale",jS=Object.keys(co);function br(e){return jS.includes(e)}function AS(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(Xi);if(e&&br(e))return e}catch{}if(typeof navigator<"u"&&typeof navigator.language=="string"){const e=navigator.language.toLowerCase();if(e.startsWith("zh"))return"zh";const t=e.slice(0,2);if(br(t))return t}return"en"}function yr(e){try{window.localStorage.setItem(Xi,e)}catch{}}const Ut=An((e,t)=>({locale:AS(),setLocale:n=>{yr(n),e({locale:n})},toggle:()=>{const n=t().locale==="zh"?"en":"zh";yr(n),e({locale:n})}}));function Yi(e,t){return t?e.replace(/\{(\w+)\}/g,(n,o)=>t[o]!==void 0?String(t[o]):`{${o}}`):e}function Zi(e,t){return co[e][t]??co.en[t]??t}function Se(e,t){return Yi(Zi(Ut.getState().locale,e),t)}function le(){const e=Ut(t=>t.locale);return(t,n)=>Yi(Zi(e,t),n)}function Qi(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const a=l=>l===null?null:JSON.parse(l,void 0),s=(i=n.getItem(r))!=null?i:null;return s instanceof Promise?s.then(a):a(s)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const uo=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return uo(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return uo(o)(n)}}}},ES=(e,t)=>(n,o,r)=>{let i={storage:Qi(()=>window.localStorage),partialize:b=>b,version:0,merge:(b,x)=>({...x,...b}),...t},a=!1,s=0;const l=new Set,c=new Set;let m=i.storage;if(!m)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...b)},o,r);const u=()=>{const b=i.partialize({...o()});return m.setItem(i.name,{state:b,version:i.version})},p=r.setState;r.setState=(b,x)=>(p(b,x),u());const f=e((...b)=>(n(...b),u()),o,r);r.getInitialState=()=>f;let h;const g=()=>{var b,x;if(!m)return;const v=++s;a=!1,l.forEach(I=>{var H;return I((H=o())!=null?H:f)});const T=((x=i.onRehydrateStorage)==null?void 0:x.call(i,(b=o())!=null?b:f))||void 0;return uo(m.getItem.bind(m))(i.name).then(I=>{if(I)if(typeof I.version=="number"&&I.version!==i.version){if(i.migrate){const H=i.migrate(I.state,I.version);return H instanceof Promise?H.then(K=>[!0,K]):[!0,H]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,I.state];return[!1,void 0]}).then(I=>{var H;if(v!==s)return;const[K,_]=I;if(h=i.merge(_,(H=o())!=null?H:f),n(h,!0),K)return u()}).then(()=>{v===s&&(T==null||T(o(),void 0),h=o(),a=!0,c.forEach(I=>I(h)))}).catch(I=>{v===s&&(T==null||T(void 0,I))})};return r.persist={setOptions:b=>{i={...i,...b},b.storage&&(m=b.storage)},clearStorage:()=>{m==null||m.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>a,onHydrate:b=>(l.add(b),()=>{l.delete(b)}),onFinishHydration:b=>(c.add(b),()=>{c.delete(b)})},i.skipHydration||g(),h||f},NS=ES,Fe=.5;function Ji(e){if(e.length<2)return e.map(r=>[r[0],r[1]]);const t=[[e[0][0],e[0][1]]];for(let r=1;r<e.length;r++){const i=t[t.length-1];Math.abs(i[0]-e[r][0])<Fe&&Math.abs(i[1]-e[r][1])<Fe||t.push([e[r][0],e[r][1]])}if(t.length<2)return t;const n=[t[0]];for(let r=1;r<t.length;r++){const i=n[n.length-1],a=t[r],s=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]);if(s>Fe&&l>Fe){const m=(n.length>=2?Math.abs(n[n.length-2][1]-i[1])<Fe?"h":"v":null)==="h"?[a[0],i[1]]:[i[0],a[1]];n.push(m)}n.push(a)}const o=[n[0]];for(let r=1;r<n.length-1;r++){const i=o[o.length-1],a=n[r],s=n[r+1],l=Math.abs(i[0]-a[0])<Fe&&Math.abs(a[0]-s[0])<Fe,c=Math.abs(i[1]-a[1])<Fe&&Math.abs(a[1]-s[1])<Fe;l||c||o.push(a)}return o.push(n[n.length-1]),o}function ea(){return{elements:new Map,buses:new Map,junctions:new Map,terminals:new Map,nodes:new Map,layout:new Map,wireRenders:new Map,terminalToNode:new Map,elementToTerminals:new Map,diagnostics:[]}}function ta(e){return{at:(e==null?void 0:e.at)??[0,0],rot:(e==null?void 0:e.rot)??0,mirror:(e==null?void 0:e.mirror)??!1}}function mo(e){return e===90||e===270?"y":"x"}function Me(e,t){let[n,o]=e;switch(t.mirror&&(n=-n),t.rot){case 0:break;case 90:[n,o]=[-o,n];break;case 180:[n,o]=[-n,-o];break;case 270:[n,o]=[o,-n];break}return[n+t.at[0],o+t.at[1]]}const TS={n:"e",e:"s",s:"w",w:"n"},PS={n:"n",s:"s",e:"w",w:"e"};function Rt(e,t){let n=t.mirror?PS[e]:e;const o=t.rot/90|0;for(let r=0;r<o;r++)n=TS[n];return n}function po(e){switch(e){case"n":return[0,-1];case"s":return[0,1];case"e":return[1,0];case"w":return[-1,0]}}class na{constructor(){At(this,"parent",new Map);At(this,"rank",new Map)}add(t){this.parent.has(t)||(this.parent.set(t,t),this.rank.set(t,0))}find(t){this.add(t);let n=t;for(;this.parent.get(n)!==n;){const o=this.parent.get(n),r=this.parent.get(o);this.parent.set(n,r),n=r}return n}union(t,n){const o=this.find(t),r=this.find(n);if(o===r)return;const i=this.rank.get(o),a=this.rank.get(r);i<a?this.parent.set(o,r):i>a?this.parent.set(r,o):(this.parent.set(r,o),this.rank.set(o,i+1))}groups(){const t=new Map;for(const n of this.parent.keys()){const o=this.find(n),r=t.get(o);r?r.push(n):t.set(o,[n])}return t}}const xr=["n","e","s","w"],wr={n:"s",s:"n",e:"w",w:"e"};function on(e,t){const n=xr.indexOf(e),r=((xr.indexOf(t)-n)%4+4)%4;return[0,90,180,270][r]}const Vn=320,rn=220,Tt=260,Kn=720,Pt=30,vr=30,et=80,kr=10,IS=60,zS=520,MS=80,DS=80,Sr=8,_r=new Set(["source","renewable"]);function RS(e){var or,rr,ir,ar,sr,lr;const{elements:t,buses:n,junctions:o,wires:r,library:i,userLayout:a,userBusLayout:s}=e,l=new Map(a),c=new Map(s),m=new Map,u=new Set(a.keys()),p=new Set(s.keys()),f=new Map;for(const w of t)f.set(w.id,w);const h=new Map;for(const w of n)h.set(w.id,w);const g=w=>{const k=f.get(w);if(k)return i.get(k.kind)},b=new Set(n.map(w=>w.id)),x=w=>b.has(w),v=new Set(o.map(w=>w.id)),T=new Set(o.filter(w=>{var k;return(k=w.layout)==null?void 0:k.at}).map(w=>w.id)),I=new na;for(const w of r)I.add(w.ends[0]),I.add(w.ends[1]),I.union(w.ends[0],w.ends[1]);for(const w of t){const k=i.get(w.kind);if(k)for(const C of k.terminals)I.add(`${w.id}.${C.id}`)}for(const w of n)I.add(w.id);const H=[];for(const[,w]of I.groups())w.length>=2&&H.push(w);const K=new Map;for(const w of H)for(const k of w)K.set(k,[w]);const _=new Map;for(const w of H){const k=w.filter(x);if(k.length!==0)for(const C of k){const j=w.filter(S=>S!==C),$=_.get(C)??[];$.push(...j),_.set(C,$)}}{const C=N=>f.has(N)&&!!g(N),j=N=>{if(x(N))return null;if(v.has(N))return N;const A=N.indexOf(".");return A>0?N.slice(0,A):null},$=new Map,S=new Set,E=(N,A)=>{$.has(N)||$.set(N,new Set),$.has(A)||$.set(A,new Set),N!==A&&($.get(N).add(A),$.get(A).add(N))};for(const N of H){const A=[];let R=!1;for(const V of N){if(x(V)){R=!0;continue}const te=j(V);te&&A.push(te)}const O=[...new Set(A)];for(const V of O)$.has(V)||$.set(V,new Set),R&&S.add(V);const q=O.filter(V=>v.has(V)),U=O.filter(V=>!v.has(V));if(q.length>0){for(const V of q)for(const te of U)E(V,te);for(let V=0;V<q.length;V++)for(let te=V+1;te<q.length;te++)E(q[V],q[te])}else for(let V=0;V<U.length;V++)for(let te=V+1;te<U.length;te++)E(U[V],U[te])}const L=(N,A)=>{const R=g(N);if(!R)return null;for(const O of R.terminals){const q=`${N}.${O.id}`;for(const U of K.get(q)??[])for(const V of U)if(j(V)===A)return O}return null},M=N=>{const A=Z=>{var oe;return((oe=$.get(Z))==null?void 0:oe.size)??0},R=Z=>{var oe;return((oe=g(Z))==null?void 0:oe.category)??""},O=Z=>{const oe=R(Z);return oe==="source"?0:oe==="renewable"?1:2+Math.min(A(Z),9)/10},q=N.filter(C).sort((Z,oe)=>O(Z)-O(oe)||Z.localeCompare(oe))[0];if(!q)return;const U=new Map([[q,null]]),V=new Map([[q,0]]),te=new Map,ne=[],X=[q],Y=new Set([q]);for(;X.length;){const Z=X.shift();ne.push(Z);for(const oe of[...$.get(Z)??[]].sort((je,Ae)=>je.localeCompare(Ae)))Y.has(oe)||(Y.add(oe),U.set(oe,Z),V.set(oe,(V.get(Z)??0)+1),te.has(Z)||te.set(Z,[]),te.get(Z).push(oe),X.push(oe))}let J=0;const me=new Map,we=Z=>{const oe=te.get(Z)??[];if(oe.length===0){me.set(Z,J++);return}for(const Ae of oe)we(Ae);const je=oe.map(Ae=>me.get(Ae));me.set(Z,je.reduce((Ae,tn)=>Ae+tn,0)/je.length)};we(q);for(const Z of ne){const oe=ye(Vn+(me.get(Z)??0)*160),je=ye(rn+(V.get(Z)??0)*140);if(v.has(Z)){m.set(Z,[oe,je]);continue}let Ae=0;const tn=U.get(Z)??null;if(tn){const jt=L(Z,tn);jt&&(Ae=on(jt.orientation,"n"))}else{const jt=(te.get(Z)??[])[0],cr=jt?L(Z,jt):null;cr&&(Ae=on(cr.orientation,"s"))}l.set(Z,{at:[oe,je],rot:Ae,mirror:!1}),u.add(Z)}},D=new Set;for(const N of $.keys()){if(D.has(N))continue;const A=[],R=[N];for(D.add(N);R.length;){const O=R.pop();A.push(O);for(const q of $.get(O)??[])D.has(q)||(D.add(q),R.push(q))}A.length<2||A.some(O=>S.has(O))||A.some(O=>l.has(O)||T.has(O))||A.some(C)&&M(A)}}const F=new Map;for(const w of H){const k=w.filter(x);if(k.length!==0)for(const C of w){if(x(C))continue;const j=C.indexOf(".");if(j<0)continue;const $=C.slice(0,j),S=C.slice(j+1),E=F.get($)??[];for(const L of k)E.some(M=>M.busId===L&&M.pin===S)||E.push({busId:L,pin:S});F.set($,E)}}const W=[],G=new Set;for(const[w,k]of F)if(new Set(k.map(j=>j.busId)).size>=2){const j=((rr=i.get(((or=f.get(w))==null?void 0:or.kind)??""))==null?void 0:rr.category)==="transformer"?"vertical":"horizontal";W.push({elementId:w,attachments:k,orientation:j}),j==="vertical"&&G.add(w)}const z=new Map,B=(w,k)=>{w!==k&&(z.has(w)||z.set(w,new Set),z.has(k)||z.set(k,new Set),z.get(w).add(k),z.get(k).add(w))};for(const w of r)B(w.ends[0],w.ends[1]);for(const w of t){const k=i.get(w.kind);if(!k||k.terminals.length<2)continue;const C=k.terminals.map(j=>`${w.id}.${j.id}`);for(let j=0;j<C.length;j++)for(let $=j+1;$<C.length;$++)B(C[j],C[$])}for(const w of t){if(G.has(w.id))continue;const k=i.get(w.kind);if(!k||k.category!=="transformer"||k.terminals.length<2)continue;const C=k.terminals.map(S=>`${w.id}.${S.id}`),j=new Map;for(const S of C){const E=S.slice(w.id.length+1);j.set(E,new Set);const L=new Set(C.filter(N=>N!==S)),M=new Set([S]),D=[S];for(;D.length>0;){const N=D.shift();if(x(N)){j.get(E).add(N);continue}const A=z.get(N);if(A)for(const R of A)M.has(R)||L.has(R)||(M.add(R),D.push(R))}}const $=new Set;for(const S of j.values())for(const E of S)$.add(E);if($.size>=2){const S=[];for(const[E,L]of j)for(const M of L)S.push({busId:M,pin:E});W.push({elementId:w.id,attachments:S,orientation:"vertical"}),G.add(w.id)}}const Q=(w,k)=>{var L;const C=g(k),j=C?C.terminals.map(M=>`${k}.${M.id}`):[],$=w,S=new Set([$,...j]),E=[$];for(;E.length>0;){const M=E.shift(),D=M.indexOf(".");if(D>0){const A=M.slice(0,D),R=f.get(A);if(R){const O=(L=i.get(R.kind))==null?void 0:L.category;if(O&&_r.has(O))return!0}}const N=z.get(M);if(N)for(const A of N)S.has(A)||(S.add(A),E.push(A))}return!1};for(const w of W){if(w.orientation!=="horizontal")continue;const k=new Set(w.attachments.map(j=>j.busId));let C=0;for(const j of k)Q(j,w.elementId)&&C++;C===1&&(w.orientation="vertical",G.add(w.elementId))}for(const w of t){if(G.has(w.id)||w.kind!=="breaker")continue;const k=i.get(w.kind);if(!k||k.terminals.length!==2)continue;const C=k.terminals.map(S=>`${w.id}.${S.id}`),j=new Map;for(const S of C){const E=S.slice(w.id.length+1),L=new Set(C.filter(N=>N!==S)),M=new Set([S]),D=[S];for(;D.length>0;){const N=D.shift();if(x(N)){j.set(E,N);break}const A=z.get(N);if(A)for(const R of A){if(M.has(R)||L.has(R))continue;const O=R.indexOf(".");if(O>0){const q=R.slice(0,O);if(q!==w.id){const U=f.get(q),V=U?i.get(U.kind):void 0;if((V==null?void 0:V.category)==="transformer")continue}}M.add(R),D.push(R)}}}if(new Set(j.values()).size>=2){const S=[];for(const[E,L]of j)S.push({busId:L,pin:E});W.push({elementId:w.id,attachments:S,orientation:"horizontal"})}}const ae=new Map;for(const w of n)ae.set(w.id,new Map);for(const w of W){const k=Array.from(new Set(w.attachments.map(C=>C.busId)));for(const C of k)for(const j of k)C!==j&&((ir=ae.get(C))==null||ir.set(j,w))}const ue=w=>{var C;const k=(C=i.get(w))==null?void 0:C.category;return k?_r.has(k):!1},ee=[];for(const w of n){const k=_.get(w.id);if(k)for(const C of k){if(x(C))continue;const j=C.indexOf(".");if(j<0)continue;const $=C.slice(0,j),S=f.get($);if(S&&ue(S.kind)){ee.push(w.id);break}}}ee.length===0&&n.length>0&&ee.push(n[0].id);const se=new Map;for(const w of ee)se.set(w,0);{const w=[...ee];for(;w.length>0;){const k=w.shift(),C=se.get(k),j=ae.get(k);if(j)for(const[$,S]of j){if(se.has($))continue;const E=S.orientation==="horizontal"?C:C+1;se.set($,E),w.push($)}}}for(const w of n){if(se.has(w.id))continue;const k=se.size===0?-1:Math.max(...Array.from(se.values()));se.set(w.id,k+1)}const he=new Map;for(const w of n){const k=se.get(w.id),C=he.get(k)??[];C.push(w.id),he.set(k,C)}const xe=[...he.keys()].sort((w,k)=>w-k),$e=(w,k,C)=>{const j=`${w.elementId}.${C}`,$=k,S=g(w.elementId),E=new Set;if(S)for(const A of S.terminals)A.id!==C&&E.add(`${w.elementId}.${A.id}`);const L=new Set([j]),M=[{ref:j,dist:0}],D=new Map,N=(A,R,O,q)=>{L.add(A),D.set(A,R),M.push({ref:A,dist:q+O})};for(;M.length>0;){const{ref:A,dist:R}=M.shift();if(A===$){const V=D.get($);let te;if(V){const ne=V.indexOf(".");if(ne>0){const X=V.slice(0,ne);X!==w.elementId&&(te=X)}}return{extent:R,head:te}}const O=A.indexOf(".");if(O<0)continue;const q=A.slice(0,O),U=A.slice(O+1);if(!x(q)&&!G.has(q)){const V=g(q),te=V==null?void 0:V.terminals.find(ne=>ne.id===U);if(V&&te)for(const ne of V.terminals){if(ne.id===U)continue;const X=`${q}.${ne.id}`;L.has(X)||E.has(X)||N(X,A,Math.abs(te.y-ne.y),R)}}for(const V of K.get(A)??[])for(const te of V){if(te===A||L.has(te)||E.has(te))continue;const ne=x(A)||x(te);N(te,A,ne?vr:Pt,R)}}return{extent:0}},Pe=(w,k)=>{var A,R,O;const C=(A=ae.get(w))==null?void 0:A.get(k);if(!C||C.orientation==="horizontal")return Tt;const j=g(C.elementId);if(!j)return Tt;const $=(R=C.attachments.find(q=>q.busId===w))==null?void 0:R.pin,S=(O=C.attachments.find(q=>q.busId===k))==null?void 0:O.pin;if(!$||!S)return Tt;const E=j.terminals.find(q=>q.id===$),L=j.terminals.find(q=>q.id===S);if(!E||!L)return Tt;const M=Math.abs(L.y-E.y),D=$e(C,w,$).extent,N=$e(C,k,S).extent;return D+M+N},Ln=new Map;for(const w of W){if(w.orientation!=="vertical")continue;const k=w.attachments.slice().sort((L,M)=>(se.get(L.busId)??0)-(se.get(M.busId)??0));if(k.length<2)continue;const C=k[0].busId,j=k[1].busId,$=k[0].pin,E=$e(w,C,$).head??w.elementId;Ln.set(E,{lowerBusId:j})}const qo=30,Go=w=>{const k=g(w);return Math.max((k==null?void 0:k.width)??et,et)},Mk=2,Vo=(w,k,C,j=0)=>{const $=g(k);let S=Go(k);if($&&!C.has(k)&&j<Mk){C.add(k);let E=0;for(const L of $.terminals){const M=`${k}.${L.id}`;if(M!==w)for(const D of K.get(M)??[]){const N=new Set;let A=!1;for(const O of D){if(O===M)continue;if(x(O)){A=!0;continue}const q=O.indexOf(".");if(q<0)continue;const U=O.slice(0,q);U===k||C.has(U)||G.has(U)||N.add(U)}if(A||N.size===0)continue;let R=0;for(const O of N){const q=[...D].find(U=>U.indexOf(".")>0&&U.slice(0,U.indexOf("."))===O);R+=(q?Vo(q,O,C,j+1):Go(O))+qo}E=Math.max(E,R-qo)}}C.delete(k),S=Math.max(S,E)}return S},_t=320,ut=new Map,Ko=(w,k)=>{if(!G.has(w))return!1;const C=W.find(E=>E.elementId===w),j=C==null?void 0:C.attachments.find(E=>E.busId!==k);if(!j)return!1;const $=se.get(k)??0;return(se.get(j.busId)??0)<$},Ct=(w,k,C)=>{const j=Ln.get(w);if(j){const S=ut.get(j.lowerBusId);if(S!==void 0)return Math.max(k,S+et)}let $=0;return C&&($=Vo(C,w,new Set)),Math.max(k,et,$)},Uo=(w,k)=>{if(ut.has(w))return ut.get(w);if(k.has(w))return _t;k.add(w);const C=_.get(w)??[];let j=0,$=0;for(const E of C){if(x(E))continue;const L=E.indexOf(".");if(L<0)continue;const M=E.slice(0,L),D=E.slice(L+1);if(Ko(M,w))continue;const N=g(M);if(!N)continue;const A=N.terminals.find(q=>q.id===D);if(!A)continue;const R=Ln.get(M);R&&Uo(R.lowerBusId,k);const O=Ct(M,N.width,`${M}.${D}`);A.y>0?j+=O:$+=O}const S=Math.max(_t,Math.max(j,$)+et);return ut.set(w,S),k.delete(w),S};for(const w of n)Uo(w.id,new Set);const Ze=new Map,Dk=(w,k,C)=>{const j=g(k);if(!j)return;const $=`${k}.${C}`,S=j.terminals.filter(M=>M.id!==C).map(M=>`${k}.${M.id}`);if(S.length===0)return;const E=new Set([$,...S]),L=S.slice();for(;L.length>0;){const M=L.shift();if(x(M)&&M!==w){const N=c.get(M);return N?N.at[0]:void 0}for(const N of K.get(M)??[])for(const A of N)A===M||E.has(A)||(E.add(A),L.push(A));const D=M.indexOf(".");if(D>0){const N=M.slice(0,D);if(!x(N)){const A=g(N);if(A)for(const R of A.terminals){const O=`${N}.${R.id}`;E.has(O)||(E.add(O),L.push(O))}}}}},Rk=w=>{const k=_.get(w);if(!k||k.length===0)return;const C=c.get(w);if(!C)return;const j=k.flatMap(A=>{if(x(A))return[];const R=A.indexOf(".");if(R<0)return[];const O=A.slice(0,R),q=A.slice(R+1);if(l.has(O))return[];if(Ko(O,w))return[];const U=g(O);if(!U)return[];const V=U.terminals.find(te=>te.id===q);return V?[{elId:O,lib:U,localTerm:V,isLinker:G.has(O),busFacingRef:`${O}.${q}`}]:[]});if(j.length===0)return;const $=[],S=[];for(const A of j)A.localTerm.y>0?$.push(A):S.push(A);const E=A=>A.reduce((R,O)=>R+Ct(O.elId,O.lib.width,O.busFacingRef),0),L=Math.max(E($),E(S))+et,M=Math.max(C.span,L);M!==C.span&&!p.has(w)&&c.set(w,{...C,span:M});const D=c.get(w),N=(A,R)=>{if(A.length===0)return;const O=new Map;for(const Y of A){const J=Dk(w,Y.elId,Y.localTerm.id);J!==void 0&&O.set(Y.elId,J)}A.sort((Y,J)=>{const me=O.get(Y.elId)??D.at[0],we=O.get(J.elId)??D.at[0];if(me!==we)return me-we;const Z=Ct(Y.elId,Y.lib.width,Y.busFacingRef);return Ct(J.elId,J.lib.width,J.busFacingRef)-Z});const q=A.map(Y=>Ct(Y.elId,Y.lib.width,Y.busFacingRef)),U=q.reduce((Y,J)=>Y+J,0),V=Math.max(M,U),te=(V-U)/(A.length+1);let ne=D.at[0]-V/2+te;const X=D.at[1]+R*vr;for(let Y=0;Y<A.length;Y++){const J=A[Y],me=q[Y],we=ne+me/2;J.isLinker?Ze.has(J.elId)||Ze.set(J.elId,we):l.set(J.elId,{at:[ye(we-J.localTerm.x),ye(X-J.localTerm.y)],rot:0,mirror:!1}),ne+=me+te}};N($,-1),N(S,1)},Ok=w=>{if(l.has(w.elementId)||w.orientation==="horizontal")return;const k=g(w.elementId);if(!k)return;const C=w.attachments.filter(ne=>c.has(ne.busId));if(C.length<2)return;const j=C.slice().sort((ne,X)=>(se.get(ne.busId)??0)-(se.get(X.busId)??0)),$=j[0].busId,S=c.get($),E=j[0].pin,L=j[j.length-1].pin,M=k.terminals.find(ne=>ne.id===E),D=k.terminals.find(ne=>ne.id===L);if(!M||!D)return;const N=M.y<=D.y?0:180,A=se.get($)??0,R=C.filter(ne=>(se.get(ne.busId)??0)===A),O=[];let q=0;for(const ne of R){const X=$e(w,ne.busId,ne.pin);q=Math.max(q,X.extent);const Y=X.head?l.get(X.head):void 0;Y?O.push(Y.at[0]):Ze.has(w.elementId)?O.push(Ze.get(w.elementId)):O.push(c.get(ne.busId).at[0])}let U;O.length>0?U=O.reduce((ne,X)=>ne+X,0)/O.length:Ze.has(w.elementId)?U=Ze.get(w.elementId):U=S.at[0];const V=S.at[1]+q,te=N===0?[ye(U-M.x),ye(V-M.y)]:[ye(U+M.x),ye(V+M.y)];if(l.set(w.elementId,{at:te,rot:N,mirror:!1}),R.length>1){const ne=l.get(w.elementId),X=Me([M.x,M.y],ne),Y=Rt(M.orientation,ne);Lk(`${w.elementId}.${E}`,X,Y,U)}},Lk=(w,k,C,j)=>{const $=new Set([w]);let S=w,E=k,L=C;for(;;){const M=K.get(S)??[];let D,N=!1;for(const oe of M){if(oe.length>=3){N=!0;break}const je=oe.find(Ae=>Ae!==S);if(!(!je||$.has(je))){if(x(je)){N=!0;break}D=je;break}}if(N||!D)break;const A=D.indexOf(".");if(A<0)break;const R=D.slice(0,A),O=D.slice(A+1);if(x(R)||G.has(R)||l.has(R))break;const q=g(R);if(!q)break;const U=q.terminals.find(oe=>oe.id===O);if(!U)break;const V=po(L),te=[E[0]+V[0]*Pt,E[1]+V[1]*Pt],ne=wr[L],X=on(U.orientation,ne),Y=Me([U.x,U.y],{at:[0,0],rot:X,mirror:!1}),J=[ye(j-Y[0]),ye(te[1]-Y[1])];l.set(R,{at:J,rot:X,mirror:!1}),$.add(D);const me=q.terminals.find(oe=>oe.id!==O);if(!me)break;const we=`${R}.${me.id}`;$.add(we);const Z={at:J,rot:X,mirror:!1};E=Me([me.x,me.y],Z),L=Rt(me.orientation,Z),S=we}},Bk=w=>{if(l.has(w.elementId)||w.orientation!=="horizontal")return;const k=g(w.elementId);if(!k)return;const C=w.attachments.filter(R=>c.has(R.busId));if(C.length<2)return;const j=C.map(R=>{const O=$e(w,R.busId,R.pin),q=O.head?l.get(O.head):void 0,U=q?q.at[0]:c.get(R.busId).at[0];return{att:R,x:U,extent:O.extent}});j.sort((R,O)=>R.x-O.x);const $=j[0],S=j[j.length-1],E=k.terminals.find(R=>R.id===$.att.pin),L=k.terminals.find(R=>R.id===S.att.pin);if(!E||!L)return;const M=E.y<=L.y?270:90,D=($.x+S.x)/2,A=c.get($.att.busId).at[1]+Math.max($.extent,S.extent);l.set(w.elementId,{at:[ye(D),ye(A)],rot:M,mirror:!1})},Xo=100;let en=rn;for(let w=0;w<xe.length;w++){const k=xe[w],C=he.get(k);let j;if(w===0)j=rn;else{const S=he.get(xe[w-1]);let E=0;for(const L of S)for(const M of C)(ar=ae.get(L))!=null&&ar.get(M)&&(E=Math.max(E,Pe(L,M)));E===0&&(E=Tt),j=en+E}en=j;let $=Vn;for(const S of C){if(c.has(S)){en=Math.max(en,c.get(S).at[1]);continue}let E;if(w>0){const M=he.get(xe[w-1]),D=[];for(const N of M){const A=(sr=ae.get(N))==null?void 0:sr.get(S);if(!A||A.orientation!=="vertical")continue;const R=(lr=A.attachments.find(q=>q.busId===N))==null?void 0:lr.pin;if(!R)continue;const O=$e(A,N,R);O.head&&l.has(O.head)?D.push(l.get(O.head).at[0]):Ze.has(A.elementId)?D.push(Ze.get(A.elementId)):D.push(c.get(N).at[0])}D.length>0&&(E=D.reduce((N,A)=>N+A,0)/D.length)}if(E===void 0){const M=ut.get(S)??Kn;E=$+M/2,$+=M+Xo}const L=ut.get(S)??Kn;c.set(S,{at:[ye(E),ye(j)],rot:0,span:L,axis:mo(0)})}for(const S of C)Rk(S);if(w>0)for(const S of W)l.has(S.elementId)||!S.attachments.some(L=>C.includes(L.busId))||Ok(S);for(const S of W)S.orientation!=="horizontal"||l.has(S.elementId)||!S.attachments.every(L=>C.includes(L.busId))||Bk(S)}if(n.length===0&&l.size<t.length){const w=$=>{const S=new Set,E=g($);if(!E)return S;for(const L of E.terminals){const M=`${$}.${L.id}`;for(const D of K.get(M)??[])for(const N of D){if(N===M||x(N))continue;const A=N.indexOf(".");if(A<0)continue;const R=N.slice(0,A);R!==$&&S.add(R)}}return S},k=new Set,C=[];for(const $ of t){if(k.has($.id)||!g($.id))continue;const S=[],E=[$.id];for(k.add($.id);E.length>0;){const L=E.pop();S.push(L);for(const M of w(L))k.has(M)||(k.add(M),E.push(M))}S.length>=2&&C.push(S)}let j=Vn;for(const $ of C){if($.some(D=>l.has(D)))continue;$.sort((D,N)=>{var U,V;const A=ue(((U=f.get(D))==null?void 0:U.kind)??"")?0:1,R=ue(((V=f.get(N))==null?void 0:V.kind)??"")?0:1;if(A!==R)return A-R;const O=w(D).size,q=w(N).size;return O!==q?O-q:D.localeCompare(N)});const S=$[0],E=g(S);if(!E)continue;const L=E.terminals.slice().sort((D,N)=>N.y-D.y)[0],M=L?Me([L.x,L.y],{at:[0,0],rot:0,mirror:!1}):[0,0];l.set(S,{at:[ye(j-M[0]),ye(rn-M[1])],rot:0,mirror:!1}),j+=Math.max(Kn,$.length*et)+Xo}}const Hk=w=>{if(x(w))return c.has(w);const k=w.indexOf(".");return k<0?!1:l.has(w.slice(0,k))};let Bn=!0,Fk=t.length+4;for(;Bn&&Fk-- >0;){Bn=!1;for(const w of H){if(w.length<2)continue;const k=[],C=new Map;for(const X of w){if(x(X))continue;const Y=X.indexOf(".");if(Y<0)continue;const J=X.slice(0,Y),me=X.slice(Y+1);if(l.has(J)){k.push(X);continue}if(G.has(J)||C.has(J))continue;const we=g(J);if(!we)continue;const Z=we.terminals.find(oe=>oe.id===me);Z&&C.set(J,{ref:X,elId:J,lib:we,localTerm:Z})}if(C.size===0||k.length===0)continue;const j=[...C.values()],$=new Map;for(const X of j)for(const Y of K.get(X.ref)??[])for(const J of Y){if(J===X.ref||x(J)||!Hk(J))continue;const me=J;$.set(me,($.get(me)??0)+1)}let S;if($.size>0){let X=-1;for(const[Y,J]of $)(J>X||J===X&&(S===void 0||Y<S))&&(X=J,S=Y)}if(S||(S=[...k].sort()[0]),!S)continue;const E=S.indexOf("."),L=S.slice(0,E),M=S.slice(E+1),D=g(L),N=l.get(L);if(!D||!N)continue;const A=D.terminals.find(X=>X.id===M);if(!A)continue;const R=Me([A.x,A.y],N),O=Rt(A.orientation,N),q=po(O),U=[-q[1],q[0]];j.sort((X,Y)=>X.elId.localeCompare(Y.elId));const V=j.map(X=>Math.max(X.lib.width,et));let ne=-V.reduce((X,Y)=>X+Y,0)/2;for(let X=0;X<j.length;X++){const Y=j[X],J=V[X],me=ne+J/2;ne+=J;const we=wr[O],Z=on(Y.localTerm.orientation,we),oe=Me([Y.localTerm.x,Y.localTerm.y],{at:[0,0],rot:Z,mirror:!1}),je=[R[0]+q[0]*Pt+U[0]*me,R[1]+q[1]*Pt+U[1]*me],Ae=[ye(je[0]-oe[0]),ye(je[1]-oe[1])];l.set(Y.elId,{at:Ae,rot:Z,mirror:!1}),Bn=!0}}}const $t=w=>{const k=l.get(w),C=g(w);if(!k||!C)return null;const j=C.viewBox.split(/\s+/).map(Number);if(j.length<4||j.some(A=>Number.isNaN(A))){const A=C.width/2;return{min:k.at[0]-A,max:k.at[0]+A}}const[$,S,E,L]=j,M=[[$,S],[$+E,S],[$,S+L],[$+E,S+L]];let D=1/0,N=-1/0;for(const A of M){const R=Me(A,k);D=Math.min(D,R[0]),N=Math.max(N,R[0])}return{min:D,max:N}},Hn=w=>{const k=new Set,C=g(w);if(!C)return k;for(const j of C.terminals){const $=`${w}.${j.id}`;for(const S of K.get($)??[])for(const E of S){if(E===$||x(E))continue;const L=E.indexOf(".");if(L<0)continue;const M=E.slice(0,L);M!==w&&k.add(M)}}return k},Yo=40,Fn=w=>{const k=l.get(w),C=g(w);if(!k||!C)return null;const j=C.viewBox.split(/\s+/).map(Number);if(j.length<4||j.some(A=>Number.isNaN(A))){const A=C.height/2;return{min:k.at[1]-A,max:k.at[1]+A}}const[$,S,E,L]=j,M=[[$,S],[$+E,S],[$,S+L],[$+E,S+L]];let D=1/0,N=-1/0;for(const A of M){const R=Me(A,k);D=Math.min(D,R[1]),N=Math.max(N,R[1])}return{min:D,max:N}},Wk=(w,k)=>{const C=new Set,j=[];for(const $ of _.get(w)??[]){if(x($))continue;const S=$.indexOf(".");if(S<0)continue;const E=$.slice(0,S),L=l.get(E);!L||L.at[1]>=k-1||C.has(E)||(C.add(E),j.push(E))}for(;j.length>0;){const $=j.pop();for(const S of Hn($)){if(C.has(S))continue;const E=l.get(S);!E||E.at[1]>=k-1||(C.add(S),j.push(S))}}return C},Zo=(w,k,C)=>{const j=new Set([w]),$=[w];for(;$.length>0;){const S=$.pop();for(const E of Hn(S))E===k||j.has(E)||!C.has(E)||(j.add(E),$.push(E))}return j},Qo=(w,k)=>{let C=w.length*w.length+8,j=!1,$=!0;for(;$&&C-- >0;){$=!1;for(let S=0;S<w.length&&!$;S++)for(let E=S+1;E<w.length;E++){const L=w[S],M=w[E],D=$t(L),N=$t(M),A=Fn(L),R=Fn(M);if(!D||!N||!A||!R)continue;const O=Math.min(D.max,N.max)-Math.max(D.min,N.min),q=Math.min(A.max,R.max)-Math.max(A.min,R.min);if(O<=0||q<=0)continue;const U=Zo(L,M,k),V=Zo(M,L,k);if(U.has(M)||V.has(L))continue;const te=![...U].some(Z=>u.has(Z)),ne=![...V].some(Z=>u.has(Z));if(!te&&!ne)continue;const X=(D.min+D.max)/2,Y=(N.min+N.max)/2;let J,me;te&&(!ne||U.size<=V.size)?(J=U,me=X<=Y?-1:1):(J=V,me=Y<=X?-1:1);const we=ye(me*(O+Yo));if(we!==0){for(const Z of J){const oe=l.get(Z);oe&&l.set(Z,{...oe,at:[oe.at[0]+we,oe.at[1]]})}j=!0,$=!0;break}}}return j};for(const w of n){const k=c.get(w.id);if(!k)continue;const C=Wk(w.id,k.at[1]);if(C.size<2)continue;const j=[...C];if(Qo(j,C)){let S=1/0,E=-1/0;for(const L of j){const M=$t(L);M&&(S=Math.min(S,M.min),E=Math.max(E,M.max))}if(Number.isFinite(S)){const M=j.some(N=>u.has(N))?0:ye(k.at[0]-(S+E)/2);if(M!==0)for(const N of j){const A=l.get(N);A&&l.set(N,{...A,at:[A.at[0]+M,A.at[1]]})}const D=E-S+Yo;if(D>k.span&&!p.has(w.id)){const N=c.get(w.id);c.set(w.id,{...N,span:D})}}}}const Jo=()=>{const k=t.map(j=>j.id).filter(j=>l.has(j)).map(j=>({x:$t(j),y:Fn(j)})).filter(j=>j.x&&j.y);let C=0;for(let j=0;j<k.length;j++)for(let $=j+1;$<k.length;$++){const S=Math.min(k[j].x.max,k[$].x.max)-Math.max(k[j].x.min,k[$].x.min),E=Math.min(k[j].y.max,k[$].y.max)-Math.max(k[j].y.min,k[$].y.min);S>1&&E>1&&C++}return C},qk=Jo(),er=new Map;for(const[w,k]of l)er.set(w,{...k,at:[...k.at]});const tr=new Map;for(const[w,k]of c)tr.set(w,{...k,at:[...k.at]});const Wn=120,nr=new Map;{const w=new Map,k=new Map,C=[];for(const $ of n)for(const S of _.get($.id)??[]){if(x(S))continue;const E=S.indexOf(".");if(E<0)continue;const L=S.slice(0,E);l.has(L)&&C.push({el:L,bus:$.id,d:1})}C.sort(($,S)=>$.d-S.d);let j=0;for(;j<C.length;){const{el:$,bus:S,d:E}=C[j++],L=w.get($);if(L===void 0)w.set($,E),k.set($,S);else if(E===L&&k.get($)!==S){k.set($,null);continue}else continue;for(const M of Hn($))l.has(M)&&(w.has(M)||C.push({el:M,bus:S,d:E+1}))}for(const[$,S]of k)S&&nr.set($,S)}for(const w of xe){const k=(he.get(w)??[]).filter(D=>c.has(D));if(k.length<2||k.some(D=>p.has(D)))continue;const C=[];let j=0;for(const D of k){const N=c.get(D),A=[];let R=1/0,O=-1/0;for(const[q,U]of nr){if(U!==D)continue;const V=$t(q);V&&(A.push(q),R=Math.min(R,V.min),O=Math.max(O,V.max))}Number.isFinite(R)||(R=N.at[0]-_t/2,O=N.at[0]+_t/2),C.push({busId:D,min:R,max:O,members:A}),j+=O-R}if(C.some(D=>D.members.some(N=>u.has(N))))continue;let $=1/0,S=-1/0;for(const D of C)$=Math.min($,D.min),S=Math.max(S,D.max);const E=S-$,L=j+Wn*(C.length-1);if(!(E>L+Wn))continue;C.sort((D,N)=>(D.min+D.max)/2-(N.min+N.max)/2);let M=$;for(const D of C){const N=ye(M-D.min);if(N!==0){const A=c.get(D.busId);c.set(D.busId,{...A,at:[A.at[0]+N,A.at[1]]});for(const R of D.members){const O=l.get(R);O&&l.set(R,{...O,at:[O.at[0]+N,O.at[1]]})}D.min+=N,D.max+=N}M=D.max+Wn}for(const D of C){const N=c.get(D.busId),A=Math.max(_t,D.max-D.min);A<N.span&&c.set(D.busId,{...N,span:A})}}{const w=t.map(C=>C.id).filter(C=>l.has(C)),k=new Set(w);Qo(w,k)}if(Jo()>qk){l.clear();for(const[w,k]of er)l.set(w,k);c.clear();for(const[w,k]of tr)c.set(w,k)}let qn=0;for(const w of t){if(l.has(w.id))continue;const k=qn%Sr,C=Math.floor(qn/Sr);l.set(w.id,{at:[ye(IS+k*MS),ye(zS+C*DS)],rot:0,mirror:!1}),qn++}return{devices:l,buses:c,junctions:m}}function ye(e){return Math.round(e/kr)*kr}function OS(e,t){const n=e.ends[0],o=e.ends[1],r=Cr(n,t),i=Cr(o,t);if(r||i){const l=r?n:o,m=Un(r?o:n,t);if(!m)return null;const u=t.buses.get(l);if(!u)return null;const{axis:p,at:f,span:h}=u.geometry,g=h/2;let b;if(p==="x")b=[xn(m[0],f[0]-g,f[0]+g),f[1]];else{const x=xn(m[1],f[1]-g,f[1]+g);b=[f[0],x]}return{wireId:e.id,path:jr(m,b)}}const a=Un(n,t),s=Un(o,t);return!a||!s?null:{wireId:e.id,path:jr(a,s)}}function Cr(e,t){return!e.includes(".")&&t.buses.has(e)}function Un(e,t){if(!e.includes(".")){const o=t.buses.get(e);if(o)return o.geometry.at;const r=t.junctions.get(e);return r?r.world:null}const n=t.terminals.get(e);return n?n.world:null}function $r(e,t,n){if(!e.includes(".")){const r=n.buses.get(e);if(!r){const m=n.junctions.get(e);return m?[m.world[0],m.world[1]]:null}const{axis:i,at:a,span:s}=r.geometry;if(!t)return[a[0],a[1]];const l=s/2;if(i==="x")return[xn(t[0],a[0]-l,a[0]+l),a[1]];const c=xn(t[1],a[1]-l,a[1]+l);return[a[0],c]}const o=n.terminals.get(e);return o?[o.world[0],o.world[1]]:null}function jr(e,t){return e[0]===t[0]||e[1]===t[1]?[e,t]:[e,[e[0],t[1]],t]}function xn(e,t,n){return e<t?t:e>n?n:e}const oa="ammeter",ra="电流表 (A)",ia="measurement",aa="-22 -42 44 44",sa=44,la=44,ca='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-15" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">A</text>',da=[{id:"t_top",x:0,y:-40,orientation:"n"}],ua={kind:"inline"},LS={id:oa,name:ra,category:ia,viewBox:aa,width:sa,height:la,svg:ca,terminals:da,source:ua},BS=Object.freeze(Object.defineProperty({__proto__:null,category:ia,default:LS,height:la,id:oa,name:ra,source:ua,svg:ca,terminals:da,viewBox:aa,width:sa},Symbol.toStringTag,{value:"Module"})),ma="arc-suppression-coil",pa="消弧线圈",ha="grounding",fa="中性点谐振接地:电感线圈连接到地",ga="-12 -32 24 67",ba=24,ya=67,xa='<line x1="0" y1="-30" x2="0" y2="-12" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -12 A 4 4 0 0 1 0 -4 A 4 4 0 0 1 0 4 A 4 4 0 0 1 0 12" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="20" x2="10" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="24" x2="7" y2="24" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="28" x2="4" y2="28" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="32" x2="1.5" y2="32" fill="none" stroke="black" stroke-width="1"/>',wa=[{id:"t_top",x:0,y:-30,orientation:"n"}],va={kind:"inline"},HS={id:ma,name:pa,category:ha,description:fa,viewBox:ga,width:ba,height:ya,svg:xa,terminals:wa,source:va},FS=Object.freeze(Object.defineProperty({__proto__:null,category:ha,default:HS,description:fa,height:ya,id:ma,name:pa,source:va,svg:xa,terminals:wa,viewBox:ga,width:ba},Symbol.toStringTag,{value:"Module"})),ka="arrester",Sa="避雷器 (FBL)",_a="protection",Ca="-7 -22 14 44",$a=14,ja=44,Aa='<line x1="0" y1="-20" x2="0" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><polygon points="-2,-8 2,-8 0,-2" fill="black" stroke="black" stroke-width="1"/><rect x="-5" y="-10" width="10" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Ea=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Na={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_22/en_60617_07_22_03.elmt",qetEnglishName:"Surge diverter; Lightning arrester"},WS={id:ka,name:Sa,category:_a,viewBox:Ca,width:$a,height:ja,svg:Aa,terminals:Ea,source:Na},qS=Object.freeze(Object.defineProperty({__proto__:null,category:_a,default:WS,height:ja,id:ka,name:Sa,source:Na,svg:Aa,terminals:Ea,viewBox:Ca,width:$a},Symbol.toStringTag,{value:"Module"})),Ta="async-motor",Pa="异步电动机",Ia="load",za="-62 -82 64 84",Ma=64,Da=84,Ra='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">3</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-60" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-80" x2="-10" y2="-53" fill="none" stroke="black" stroke-width="1"/>',Oa=[{id:"t1",x:-50,y:-80,orientation:"n"},{id:"t2",x:-10,y:-80,orientation:"n"},{id:"t3",x:-30,y:-80,orientation:"n"}],La={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_08/en_60617_06_08_01.elmt",qetEnglishName:"Induction motor, three-phase, squirrel cage"},GS={id:Ta,name:Pa,category:Ia,viewBox:za,width:Ma,height:Da,svg:Ra,terminals:Oa,source:La},VS=Object.freeze(Object.defineProperty({__proto__:null,category:Ia,default:GS,height:Da,id:Ta,name:Pa,source:La,svg:Ra,terminals:Oa,viewBox:za,width:Ma},Symbol.toStringTag,{value:"Module"})),Ba="autotransformer",Ha="自耦变压器",Fa="transformer",Wa="-62 -112 64 144",qa=64,Ga=144,Va='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-110" x2="-30" y2="-90" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -30 A 30 60 0 0 0 -30 -90" fill="none" stroke="black" stroke-width="1"/>',Ka=[{id:"t1",x:-30,y:-110,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],Ua={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_06.elmt",qetEnglishName:"Auto-transformer, general symbol"},KS={id:Ba,name:Ha,category:Fa,viewBox:Wa,width:qa,height:Ga,svg:Va,terminals:Ka,source:Ua},US=Object.freeze(Object.defineProperty({__proto__:null,category:Fa,default:KS,height:Ga,id:Ba,name:Ha,source:Ua,svg:Va,terminals:Ka,viewBox:Wa,width:qa},Symbol.toStringTag,{value:"Module"})),Xa="battery",Ya="电池储能",Za="storage",Qa="-12 -12 29 24",Ja=29,es=24,ts='<line x1="-10" y1="0" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-5" x2="0" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-10" x2="5" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="0" x2="15" y2="0" fill="none" stroke="black" stroke-width="1"/>',ns=[{id:"t_left",x:-10,y:0,orientation:"w"},{id:"t_right",x:15,y:0,orientation:"e"}],os=[{name:"E",label:"容量",type:"number",unit:"kWh"}],rs={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_15/en_60617_06_15_01.elmt",qetEnglishName:"Battery cell"},XS={id:Xa,name:Ya,category:Za,viewBox:Qa,width:Ja,height:es,svg:ts,terminals:ns,params:os,source:rs},YS=Object.freeze(Object.defineProperty({__proto__:null,category:Za,default:XS,height:es,id:Xa,name:Ya,params:os,source:rs,svg:ts,terminals:ns,viewBox:Qa,width:Ja},Symbol.toStringTag,{value:"Module"})),is="bell",as="电铃 (HA)",ss="control",ls="信号电铃 / 警铃。",cs="-32 -32 44 44",ds=44,us=44,ms='<line x1="-30" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -10 A 20 20 0 0 0 -30 -10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/>',ps=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],hs={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_06.elmt",qetEnglishName:"Bell"},ZS={id:is,name:as,category:ss,description:ls,viewBox:cs,width:ds,height:us,svg:ms,terminals:ps,source:hs},QS=Object.freeze(Object.defineProperty({__proto__:null,category:ss,default:ZS,description:ls,height:us,id:is,name:as,source:hs,svg:ms,terminals:ps,viewBox:cs,width:ds},Symbol.toStringTag,{value:"Module"})),fs="break-contact",gs="常闭触点 (NC)",bs="control",ys="常闭辅助触点 (break contact)。",xs="-2 -42 14 64",ws=14,vs=64,ks='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/>',Ss=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],_s=[{name:"open",type:"boolean",default:!1,label:"断开"}],Cs={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_02/en_60617_07_02_03.elmt",qetEnglishName:"Break contact"},JS={id:fs,name:gs,category:bs,description:ys,viewBox:xs,width:ws,height:vs,svg:ks,terminals:Ss,state:_s,source:Cs},e_=Object.freeze(Object.defineProperty({__proto__:null,category:bs,default:JS,description:ys,height:vs,id:fs,name:gs,source:Cs,state:_s,svg:ks,terminals:Ss,viewBox:xs,width:ws},Symbol.toStringTag,{value:"Module"})),$s="breaker",js="断路器 (QF)",As="switching",Es="-7 -22 15 46",Ns=15,Ts=46,Ps='<polyline points="0,20 0,10 -5,-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-8" x2="-2" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/>',Is='<text x="2" y="-10.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">1</text><text x="3" y="21.2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">2</text>',zs=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Ms=[{name:"open",type:"boolean",default:!1,label:"断开"}],Ds=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"poles",label:"极数",type:"number",unit:"P",showOnCanvas:!0},{name:"Icu",label:"分断能力",type:"number",unit:"kA",showOnCanvas:!0}],Rs={x:6,y:-2,anchor:"start"},Os={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/11_circuit_breakers/disjoncteur1.elmt",qetEnglishName:"Circuit-breaker"},t_={id:$s,name:js,category:As,viewBox:Es,width:Ns,height:Ts,svg:Ps,terminalLabelsSvg:Is,terminals:zs,state:Ms,params:Ds,label:Rs,source:Os},n_=Object.freeze(Object.defineProperty({__proto__:null,category:As,default:t_,height:Ts,id:$s,label:Rs,name:js,params:Ds,source:Os,state:Ms,svg:Ps,terminalLabelsSvg:Is,terminals:zs,viewBox:Es,width:Ns},Symbol.toStringTag,{value:"Module"})),Ls="buchholz-relay",Bs="瓦斯继电器 (63)",Hs="protection",Fs="瓦斯 / 气体继电器 (Buchholz, ANSI 63)。",Ws="-22 -62 44 64",qs=44,Gs=64,Vs='<rect x="-20" y="-60" width="40" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-5" y="-20" width="10" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-55" x2="0" y2="-50" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -50 A 10 5 0 0 0 0 -40" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -40 A 10 5 0 0 0 0 -50" fill="none" stroke="black" stroke-width="1"/>',Ks=[{id:"t_top",x:0,y:-60,orientation:"n"}],Us={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_18/en_60617_07_18_01.elmt",qetEnglishName:"Buchholz protective device; Gas relay"},o_={id:Ls,name:Bs,category:Hs,description:Fs,viewBox:Ws,width:qs,height:Gs,svg:Vs,terminals:Ks,source:Us},r_=Object.freeze(Object.defineProperty({__proto__:null,category:Hs,default:o_,description:Fs,height:Gs,id:Ls,name:Bs,source:Us,svg:Vs,terminals:Ks,viewBox:Ws,width:qs},Symbol.toStringTag,{value:"Module"})),Xs="busbar",Ys="母线段",Zs="busbar",Qs="可拉伸单母线段,多设备挂接",Js="-42 -4 84 8",el=84,tl=8,nl='<line x1="-40" y1="0" x2="40" y2="0" stroke="black" stroke-width="3" stroke-linecap="round" fill="none"/>',ol=[{id:"tap",x:0,y:0,orientation:"n"}],rl={axis:"x",minLength:20,naturalSpan:80},il=[{name:"Un",label:"额定电压",type:"number",unit:"kV",showOnCanvas:!0}],al={x:0,y:-6,anchor:"middle"},sl={kind:"inline"},i_={id:Xs,name:Ys,category:Zs,description:Qs,viewBox:Js,width:el,height:tl,svg:nl,terminals:ol,stretchable:rl,params:il,label:al,source:sl},a_=Object.freeze(Object.defineProperty({__proto__:null,category:Zs,default:i_,description:Qs,height:tl,id:Xs,label:al,name:Ys,params:il,source:sl,stretchable:rl,svg:nl,terminals:ol,viewBox:Js,width:el},Symbol.toStringTag,{value:"Module"})),ll="buzzer",cl="蜂鸣器 (HA)",dl="control",ul="信号蜂鸣器。",ml="-32 -52 44 64",pl=44,hl=64,fl='<line x1="-30" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><path d="M -30 -30 A 20 20 0 0 0 10 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-12" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-12" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/>',gl=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],bl={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_10.elmt",qetEnglishName:"Buzzer"},s_={id:ll,name:cl,category:dl,description:ul,viewBox:ml,width:pl,height:hl,svg:fl,terminals:gl,source:bl},l_=Object.freeze(Object.defineProperty({__proto__:null,category:dl,default:s_,description:ul,height:hl,id:ll,name:cl,source:bl,svg:fl,terminals:gl,viewBox:ml,width:pl},Symbol.toStringTag,{value:"Module"})),yl="capacitor",xl="电容 (C)",wl="passive",vl="通用 / 滤波 / 直流母线电容。无功补偿请用并联电容器。",kl="-7 -23 14 27",Sl=14,_l=27,Cl='<line x1="-5" y1="2" x2="5" y2="2" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-2" x2="5" y2="-2" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-2" fill="none" stroke="black" stroke-width="1"/>',$l=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t_bottom",x:0,y:2,orientation:"s"}],jl=[{name:"C",label:"容值",type:"number",unit:"μF",showOnCanvas:!0},{name:"Un",label:"额定电压",type:"number",unit:"V"}],Al={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/20_capacitors/capacite.elmt",qetEnglishName:"Capacitor"},c_={id:yl,name:xl,category:wl,description:vl,viewBox:kl,width:Sl,height:_l,svg:Cl,terminals:$l,params:jl,source:Al},d_=Object.freeze(Object.defineProperty({__proto__:null,category:wl,default:c_,description:vl,height:_l,id:yl,name:xl,params:jl,source:Al,svg:Cl,terminals:$l,viewBox:kl,width:Sl},Symbol.toStringTag,{value:"Module"})),El="contactor",Nl="接触器 (KM)",Tl="motor-control",Pl="主回路接触器, 通常配热继电器和电机使用。",Il="-10 -42 15 64",zl=15,Ml=64,Dl='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -24.5 A 2.5 2.5 0 0 0 0 -19.5" fill="none" stroke="black" stroke-width="1"/>',Rl=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Ol=[{name:"open",type:"boolean",default:!0,label:"断开"}],Ll={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_02.elmt",qetEnglishName:"Contactor; Main make contact of a contactor"},u_={id:El,name:Nl,category:Tl,description:Pl,viewBox:Il,width:zl,height:Ml,svg:Dl,terminals:Rl,state:Ol,source:Ll},m_=Object.freeze(Object.defineProperty({__proto__:null,category:Tl,default:u_,description:Pl,height:Ml,id:El,name:Nl,source:Ll,state:Ol,svg:Dl,terminals:Rl,viewBox:Il,width:zl},Symbol.toStringTag,{value:"Module"})),Bl="converter-bidir",Hl="双向变流器 (PCS)",Fl="renewable",Wl="储能变流器:双向 AC ↔ DC",ql="-42 -42 44 48",Gl=44,Vl=48,Kl='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-6" x2="-14" y2="-6" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-6" x2="-4" y2="-6" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/><polyline points="-28,-4 -32,0 -28,4" fill="none" stroke="black" stroke-width="1"/><polyline points="-16,-4 -12,0 -16,4" fill="none" stroke="black" stroke-width="1"/>',Ul=[{id:"t_ac",x:-20,y:-40,orientation:"n"},{id:"t_dc",x:-20,y:0,orientation:"s"}],Xl=[{name:"S",label:"容量",type:"number",unit:"MVA"}],Yl={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_06.elmt",qetEnglishName:"Rectifier/inverter"},p_={id:Bl,name:Hl,category:Fl,description:Wl,viewBox:ql,width:Gl,height:Vl,svg:Kl,terminals:Ul,params:Xl,source:Yl},h_=Object.freeze(Object.defineProperty({__proto__:null,category:Fl,default:p_,description:Wl,height:Vl,id:Bl,name:Hl,params:Xl,source:Yl,svg:Kl,terminals:Ul,viewBox:ql,width:Gl},Symbol.toStringTag,{value:"Module"})),Zl="ct",Ql="电流互感器 (CT)",Jl="instrument-transformer",ec="-42 -62 54 64",tc=54,nc=64,oc='<line x1="-30" y1="-60" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-30" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-20" x2="5" y2="-40" fill="none" stroke="black" stroke-width="1"/>',rc=[{id:"t1",x:-30,y:-60,orientation:"n"},{id:"t2",x:-30,y:0,orientation:"s"}],ic={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_10.elmt",qetEnglishName:"Current transformer, general symbol"},f_={id:Zl,name:Ql,category:Jl,viewBox:ec,width:tc,height:nc,svg:oc,terminals:rc,source:ic},g_=Object.freeze(Object.defineProperty({__proto__:null,category:Jl,default:f_,height:nc,id:Zl,name:Ql,source:ic,svg:oc,terminals:rc,viewBox:ec,width:tc},Symbol.toStringTag,{value:"Module"})),ac="dc-combiner",sc="直流汇流箱",lc="renewable",cc="光伏组串汇流箱 (4 路输入示例)。",dc="-27 -32 54 64",uc=54,mc=64,pc='<rect x="-25" y="-15" width="50" height="30" fill="none" stroke="black" stroke-width="1"/><line x1="-18" y1="-30" x2="-18" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="-6" y1="-30" x2="-6" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-30" x2="6" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="18" y1="-30" x2="18" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><text x="-9" y="5" font-family="Liberation Sans, Arial, sans-serif" font-size="7" fill="#000000">DC</text>',hc=[{id:"t_s1",x:-18,y:-30,orientation:"n"},{id:"t_s2",x:-6,y:-30,orientation:"n"},{id:"t_s3",x:6,y:-30,orientation:"n"},{id:"t_s4",x:18,y:-30,orientation:"n"},{id:"t_dc",x:0,y:30,orientation:"s"}],fc={kind:"inline"},b_={id:ac,name:sc,category:lc,description:cc,viewBox:dc,width:uc,height:mc,svg:pc,terminals:hc,source:fc},y_=Object.freeze(Object.defineProperty({__proto__:null,category:lc,default:b_,description:cc,height:mc,id:ac,name:sc,source:fc,svg:pc,terminals:hc,viewBox:dc,width:uc},Symbol.toStringTag,{value:"Module"})),gc="dc-dc-converter",bc="DC/DC 变换器",yc="renewable",xc="DC/DC 变换器 / 直流充电器(IEC 60617)",wc="-42 -42 44 44",vc=44,kc=44,Sc='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/>',_c=[{id:"t_in",x:-20,y:-40,orientation:"n"},{id:"t_out",x:-20,y:0,orientation:"s"}],Cc=[{name:"P",label:"功率",type:"number",unit:"kW"}],$c={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_02.elmt",qetEnglishName:"DC/DC converter"},x_={id:gc,name:bc,category:yc,description:xc,viewBox:wc,width:vc,height:kc,svg:Sc,terminals:_c,params:Cc,source:$c},w_=Object.freeze(Object.defineProperty({__proto__:null,category:yc,default:x_,description:xc,height:kc,id:gc,name:bc,params:Cc,source:$c,svg:Sc,terminals:_c,viewBox:wc,width:vc},Symbol.toStringTag,{value:"Module"})),jc="dc-disconnector",Ac="直流隔离开关",Ec="switching",Nc="DC isolating switch — 光伏组串 / 储能 直流侧隔离。",Tc="-12 -32 30 64",Pc=30,Ic=64,zc='<line x1="0" y1="-30" x2="0" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-4" x2="14" y2="-4" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-1" x2="9" y2="-1" stroke="black" stroke-width="0.8" fill="none"/><line x1="11" y1="-1" x2="14" y2="-1" stroke="black" stroke-width="0.8" fill="none"/>',Mc=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Dc=[{name:"open",type:"boolean",default:!1,label:"断开"}],Rc={kind:"inline"},v_={id:jc,name:Ac,category:Ec,description:Nc,viewBox:Tc,width:Pc,height:Ic,svg:zc,terminals:Mc,state:Dc,source:Rc},k_=Object.freeze(Object.defineProperty({__proto__:null,category:Ec,default:v_,description:Nc,height:Ic,id:jc,name:Ac,source:Rc,state:Dc,svg:zc,terminals:Mc,viewBox:Tc,width:Pc},Symbol.toStringTag,{value:"Module"})),Oc="dc-motor",Lc="直流电机 (M)",Bc="load",Hc="直流电动机 (串励通用符号)。",Fc="-72 -82 89 84",Wc=89,qc=84,Gc='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-40" y1="-20" x2="-20" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-15" x2="-32" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-29" y1="-15" x2="-20" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-70" y1="-80" x2="-70" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-70" y1="-30" x2="-60" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="10" y1="-30" x2="10" y2="-50" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -60 A 5 5 0 0 0 10 -50" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -70 A 5 5 0 0 0 10 -60" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -80 A 5 5 0 0 0 10 -70" fill="none" stroke="black" stroke-width="1"/>',Vc=[{id:"t1",x:-70,y:-80,orientation:"n"},{id:"t2",x:10,y:-80,orientation:"n"}],Kc={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_05/en_60617_06_05_01.elmt",qetEnglishName:"Series motor, DC"},S_={id:Oc,name:Lc,category:Bc,description:Hc,viewBox:Fc,width:Wc,height:qc,svg:Gc,terminals:Vc,source:Kc},__=Object.freeze(Object.defineProperty({__proto__:null,category:Bc,default:S_,description:Hc,height:qc,id:Oc,name:Lc,source:Kc,svg:Gc,terminals:Vc,viewBox:Fc,width:Wc},Symbol.toStringTag,{value:"Module"})),Uc="diode",Xc="二极管 (D)",Yc="passive",Zc="整流 / 续流 / 保护二极管。t1=阳极(上), t2=阴极(下)。",Qc="-12 -42 24 44",Jc=24,ed=44,td='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/>',nd=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],od={x:6,y:-20,anchor:"start"},rd={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_01.elmt",qetEnglishName:"Semiconductor diode, general symbol"},C_={id:Uc,name:Xc,category:Yc,description:Zc,viewBox:Qc,width:Jc,height:ed,svg:td,terminals:nd,label:od,source:rd},$_=Object.freeze(Object.defineProperty({__proto__:null,category:Yc,default:C_,description:Zc,height:ed,id:Uc,label:od,name:Xc,source:rd,svg:td,terminals:nd,viewBox:Qc,width:Jc},Symbol.toStringTag,{value:"Module"})),id="disconnector",ad="隔离开关 (QS)",sd="switching",ld="-10 -42 15 64",cd=15,dd=64,ud='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-3" y1="-20" x2="3" y2="-20" fill="none" stroke="black" stroke-width="1"/>',md=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],pd=[{name:"open",type:"boolean",default:!1,label:"断开"}],hd=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],fd={x:6,y:-10,anchor:"start"},gd={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_06.elmt",qetEnglishName:"Disconnector; Isolator"},j_={id,name:ad,category:sd,viewBox:ld,width:cd,height:dd,svg:ud,terminals:md,state:pd,params:hd,label:fd,source:gd},A_=Object.freeze(Object.defineProperty({__proto__:null,category:sd,default:j_,height:dd,id,label:fd,name:ad,params:hd,source:gd,state:pd,svg:ud,terminals:md,viewBox:ld,width:cd},Symbol.toStringTag,{value:"Module"})),bd="distance-relay",yd="距离继电器 (21)",xd="protection",wd="距离 / 低阻抗保护继电器 (ANSI 21)。",vd="-62 -42 64 44",kd=64,Sd=44,_d='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-42" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Z &lt;</text>',Cd=[{id:"t_top",x:-30,y:-40,orientation:"n"}],$d={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_09.elmt",qetEnglishName:"Under-impedance relay"},E_={id:bd,name:yd,category:xd,description:wd,viewBox:vd,width:kd,height:Sd,svg:_d,terminals:Cd,source:$d},N_=Object.freeze(Object.defineProperty({__proto__:null,category:xd,default:E_,description:wd,height:Sd,id:bd,name:yd,source:$d,svg:_d,terminals:Cd,viewBox:vd,width:kd},Symbol.toStringTag,{value:"Module"})),jd="earth",Ad="接地",Ed="busbar",Nd="-12 -17 24 34",Td=24,Pd=34,Id='<line x1="-10" y1="0" x2="10" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-15" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="5" x2="7" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="10" x2="4" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0.5" y1="15" x2="-0.5" y2="15" fill="none" stroke="black" stroke-width="1"/>',zd=[{id:"t1",x:0,y:-15,orientation:"n"}],Md={kind:"elmt",path:"91_en_60617/en_60617_02/en_60617_02_15/en_60617_02_15_01.elmt",qetEnglishName:"Earth or ground, general symbol"},T_={id:jd,name:Ad,category:Ed,viewBox:Nd,width:Td,height:Pd,svg:Id,terminals:zd,source:Md},P_=Object.freeze(Object.defineProperty({__proto__:null,category:Ed,default:T_,height:Pd,id:jd,name:Ad,source:Md,svg:Id,terminals:zd,viewBox:Nd,width:Td},Symbol.toStringTag,{value:"Module"})),Dd="earthing-switch",Rd="接地刀闸 (QE)",Od="switching",Ld="隔离开关 + 接地连接,单端口",Bd="-12 -32 24 64",Hd=24,Fd=64,Wd='<line x1="0" y1="-30" x2="0" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="-12" x2="-9" y2="9" stroke="black" stroke-width="1" fill="none"/><line x1="-3" y1="-12" x2="3" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-10" y1="14" x2="10" y2="14" stroke="black" stroke-width="1" fill="none"/><line x1="-7" y1="19" x2="7" y2="19" stroke="black" stroke-width="1" fill="none"/><line x1="-4" y1="24" x2="4" y2="24" stroke="black" stroke-width="1" fill="none"/><line x1="-1.5" y1="29" x2="1.5" y2="29" stroke="black" stroke-width="1" fill="none"/>',qd=[{id:"t_top",x:0,y:-30,orientation:"n"}],Gd=[{name:"open",type:"boolean",default:!0,label:"断开"}],Vd={x:12,y:-8,anchor:"start"},Kd={kind:"inline"},I_={id:Dd,name:Rd,category:Od,description:Ld,viewBox:Bd,width:Hd,height:Fd,svg:Wd,terminals:qd,state:Gd,label:Vd,source:Kd},z_=Object.freeze(Object.defineProperty({__proto__:null,category:Od,default:I_,description:Ld,height:Fd,id:Dd,label:Vd,name:Rd,source:Kd,state:Gd,svg:Wd,terminals:qd,viewBox:Bd,width:Hd},Symbol.toStringTag,{value:"Module"})),Ud="energy-meter",Xd="电能表 (Wh)",Yd="measurement",Zd="有功电能表 (kWh) — 服务入口 / 子表。",Qd="-22 -36 44 72",Jd=44,eu=72,tu='<text x="-10" y="19.2" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Wh</text><rect x="-20" y="-10" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',nu=[{id:"t1",x:0,y:-34,orientation:"n"},{id:"t2",x:0,y:34,orientation:"s"}],ou={kind:"elmt",path:"11_singlepole/500_home_installation/40_meters/wattheuremetre_08-04-03_en60617.elmt",qetEnglishName:"Watt hour meter (en_60617)"},M_={id:Ud,name:Xd,category:Yd,description:Zd,viewBox:Qd,width:Jd,height:eu,svg:tu,terminals:nu,source:ou},D_=Object.freeze(Object.defineProperty({__proto__:null,category:Yd,default:M_,description:Zd,height:eu,id:Ud,name:Xd,source:ou,svg:tu,terminals:nu,viewBox:Qd,width:Jd},Symbol.toStringTag,{value:"Module"})),ru="ev-charger",iu="EV 充电桩",au="load",su="电动汽车充电站 / 充电桩。",lu="-17 -27 34 49",cu=34,du=49,uu='<line x1="0" y1="-25" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-15" y="-15" width="30" height="35" fill="none" stroke="black" stroke-width="1"/><rect x="-9" y="-8" width="14" height="6" fill="none" stroke="black" stroke-width="0.8"/><rect x="5" y="-7" width="2" height="4" fill="black"/><text x="-9" y="13" font-family="Liberation Sans, Arial, sans-serif" font-size="7" fill="#000000">EV</text>',mu=[{id:"t_top",x:0,y:-25,orientation:"n"}],pu={kind:"inline"},R_={id:ru,name:iu,category:au,description:su,viewBox:lu,width:cu,height:du,svg:uu,terminals:mu,source:pu},O_=Object.freeze(Object.defineProperty({__proto__:null,category:au,default:R_,description:su,height:du,id:ru,name:iu,source:pu,svg:uu,terminals:mu,viewBox:lu,width:cu},Symbol.toStringTag,{value:"Module"})),hu="frequency-meter",fu="频率表 (Hz)",gu="measurement",bu="-22 -42 44 44",yu=44,xu=44,wu='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Hz</text>',vu=[{id:"t_top",x:0,y:-40,orientation:"n"}],ku={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_07.elmt",qetEnglishName:"Frequency meter"},L_={id:hu,name:fu,category:gu,viewBox:bu,width:yu,height:xu,svg:wu,terminals:vu,source:ku},B_=Object.freeze(Object.defineProperty({__proto__:null,category:gu,default:L_,height:xu,id:hu,name:fu,source:ku,svg:wu,terminals:vu,viewBox:bu,width:yu},Symbol.toStringTag,{value:"Module"})),Su="fuse-switch-disconnector",_u="熔断器式隔离开关",Cu="switching",$u="负荷型熔断器隔离开关 (on-load fuse switch-disconnector)。",ju="-8 -32 12 64",Au=12,Eu=64,Nu='<line x1="0" y1="30" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="-5" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-13" x2="0" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-3" y1="6" x2="-6" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-6" x2="1" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="5" x2="-3" y2="6" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-6" x2="-6" y2="-5" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-11" rx="1" ry="1" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-13" x2="2" y2="-13" fill="none" stroke="black" stroke-width="1"/>',Tu=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Pu=[{name:"open",type:"boolean",default:!1,label:"断开"}],Iu={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_21/en_60617_07_21_09.elmt",qetEnglishName:"Fuse switch-disconnector; On-load isolating fuse switch"},H_={id:Su,name:_u,category:Cu,description:$u,viewBox:ju,width:Au,height:Eu,svg:Nu,terminals:Tu,state:Pu,source:Iu},F_=Object.freeze(Object.defineProperty({__proto__:null,category:Cu,default:H_,description:$u,height:Eu,id:Su,name:_u,source:Iu,state:Pu,svg:Nu,terminals:Tu,viewBox:ju,width:Au},Symbol.toStringTag,{value:"Module"})),zu="fuse",Mu="熔断器 (FU)",Du="switching",Ru="-7 -32 14 64",Ou=14,Lu=64,Bu='<line x1="0" y1="-30" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><rect x="-5" y="-15" width="10" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Hu=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Fu=[{name:"blown",type:"boolean",default:!1,label:"熔断"}],Wu=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],qu={x:7,y:-2,anchor:"start"},Gu={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_21/en_60617_07_21_01.elmt",qetEnglishName:"Fuse, general symbol"},W_={id:zu,name:Mu,category:Du,viewBox:Ru,width:Ou,height:Lu,svg:Bu,terminals:Hu,state:Fu,params:Wu,label:qu,source:Gu},q_=Object.freeze(Object.defineProperty({__proto__:null,category:Du,default:W_,height:Lu,id:zu,label:qu,name:Mu,params:Wu,source:Gu,state:Fu,svg:Bu,terminals:Hu,viewBox:Ru,width:Ou},Symbol.toStringTag,{value:"Module"})),Vu="generator",Ku="发电机 (G)",Uu="source",Xu="-42 -42 44 44",Yu=44,Zu=44,Qu='<rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-24" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text>',Ju=[{id:"t_bottom",x:-20,y:0,orientation:"s"}],em={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_16/en_60617_06_16_01.elmt",qetEnglishName:"Generator, general symbol"},G_={id:Vu,name:Ku,category:Uu,viewBox:Xu,width:Yu,height:Zu,svg:Qu,terminals:Ju,source:em},V_=Object.freeze(Object.defineProperty({__proto__:null,category:Uu,default:G_,height:Zu,id:Vu,name:Ku,source:em,svg:Qu,terminals:Ju,viewBox:Xu,width:Yu},Symbol.toStringTag,{value:"Module"})),tm="genset",nm="发电机组 (G)",om="source",rm="柴油 / 燃气发电机组。",im="-28 -22 56 64",am=56,sm=64,lm='<rect x="-26" y="-20" width="52" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">GEN</text><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',cm=[{id:"t_out",x:0,y:40,orientation:"s"}],dm=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],um={kind:"inline"},K_={id:tm,name:nm,category:om,description:rm,viewBox:im,width:am,height:sm,svg:lm,terminals:cm,params:dm,source:um},U_=Object.freeze(Object.defineProperty({__proto__:null,category:om,default:K_,description:rm,height:sm,id:tm,name:nm,params:dm,source:um,svg:lm,terminals:cm,viewBox:im,width:am},Symbol.toStringTag,{value:"Module"})),mm="gfci-breaker",pm="GFCI 断路器 (RCBO)",hm="protection",fm="剩余电流断路器带过流保护 (UL943 / IEC 61009)。北美 GFCI / 欧洲 RCBO。",gm="-18 -22 22 44",bm=22,ym=44,xm='<text x="-14" y="13.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">IΔ</text><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="-5,-10 0,10 0,20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-4" x2="-8" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><line x1="-8" y1="-4" x2="-8" y2="-8" fill="none" stroke="black" stroke-width="0.4"/><line x1="-13" y1="-8" x2="-8" y2="-8" fill="none" stroke="black" stroke-width="0.4"/><line x1="-13" y1="-8" x2="-13" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><line x1="-16" y1="-4" x2="-13" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><path d="M -8 1 A 2.5 3.5 0 0 0 -13 1" fill="none" stroke="black" stroke-width="0.4"/><line x1="-8" y1="1" x2="-2" y2="1" fill="none" stroke="black" stroke-width="0.4"/><line x1="-16" y1="1" x2="-13" y2="1" fill="none" stroke="black" stroke-width="0.4"/>',wm=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],vm=[{name:"open",type:"boolean",default:!1,label:"断开"}],km=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"IDn",label:"剩余动作电流",type:"number",unit:"mA",default:30,showOnCanvas:!0}],Sm={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/rcbo.elmt",qetEnglishName:"Residual Circuit Breaker with Overload"},X_={id:mm,name:pm,category:hm,description:fm,viewBox:gm,width:bm,height:ym,svg:xm,terminals:wm,state:vm,params:km,source:Sm},Y_=Object.freeze(Object.defineProperty({__proto__:null,category:hm,default:X_,description:fm,height:ym,id:mm,name:pm,params:km,source:Sm,state:vm,svg:xm,terminals:wm,viewBox:gm,width:bm},Symbol.toStringTag,{value:"Module"})),_m="grid-source",Cm="系统电源",$m="source",jm="无穷大母线 / 外部电网",Am="-16 -31 32 53",Em=32,Nm=53,Tm='<circle cx="0" cy="-15" r="14" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-12" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">~</text><line x1="0" y1="-1" x2="0" y2="20" stroke="black" stroke-width="1" fill="none"/>',Pm=[{id:"t_bottom",x:0,y:20,orientation:"s"}],Im={kind:"inline"},Z_={id:_m,name:Cm,category:$m,description:jm,viewBox:Am,width:Em,height:Nm,svg:Tm,terminals:Pm,source:Im},Q_=Object.freeze(Object.defineProperty({__proto__:null,category:$m,default:Z_,description:jm,height:Nm,id:_m,name:Cm,source:Im,svg:Tm,terminals:Pm,viewBox:Am,width:Em},Symbol.toStringTag,{value:"Module"})),zm="grounding-transformer",Mm="接地变 (Z形)",Dm="grounding",Rm="星-曲折接线变压器,中性点接地用",Om="-62 -152 64 164",Lm=64,Bm=164,Hm='<line x1="-30" y1="-40" x2="-35" y2="-35" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-25" y2="-35" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-35" x2="-40" y2="-38" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-150" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-35" x2="-25" y2="-30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-30" y2="-45" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-45" x2="-25" y2="-48" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-130" x2="-20" y2="-140" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-135" x2="-20" y2="-145" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="0" x2="-20" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="5" x2="-20" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-85" x2="-30" y2="-95" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-95" x2="-20" y2="-100" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-95" x2="-40" y2="-100" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-20" y2="-40" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-40" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/>',Fm=[{id:"t1",x:-30,y:-150,orientation:"n"},{id:"t2",x:-30,y:10,orientation:"s"}],Wm={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_10/en_60617_06_10_15.elmt",qetEnglishName:"Three-phase transformer, connection star-zigzag with the neutral brought out"},J_={id:zm,name:Mm,category:Dm,description:Rm,viewBox:Om,width:Lm,height:Bm,svg:Hm,terminals:Fm,source:Wm},eC=Object.freeze(Object.defineProperty({__proto__:null,category:Dm,default:J_,description:Rm,height:Bm,id:zm,name:Mm,source:Wm,svg:Hm,terminals:Fm,viewBox:Om,width:Lm},Symbol.toStringTag,{value:"Module"})),qm="heater",Gm="电加热器 (EH)",Vm="load",Km="电阻加热元件 / 电热负荷。",Um="-22 -7 54 14",Xm=54,Ym=14,Zm='<line x1="-20" y1="0" x2="-10" y2="0" fill="none" stroke="black" stroke-width="1"/><rect x="-10" y="-5" width="30" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="0" x2="30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-5" x2="-5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-5" x2="5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="15" y1="-5" x2="15" y2="5" fill="none" stroke="black" stroke-width="1"/>',Qm=[{id:"t1",x:-20,y:0,orientation:"w"},{id:"t2",x:30,y:0,orientation:"e"}],Jm=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],ep={kind:"elmt",path:"91_en_60617/en_60617_04/en_60617_04_01/en_60617_04_01_12.elmt",qetEnglishName:"Heating element"},tC={id:qm,name:Gm,category:Vm,description:Km,viewBox:Um,width:Xm,height:Ym,svg:Zm,terminals:Qm,params:Jm,source:ep},nC=Object.freeze(Object.defineProperty({__proto__:null,category:Vm,default:tC,description:Km,height:Ym,id:qm,name:Gm,params:Jm,source:ep,svg:Zm,terminals:Qm,viewBox:Um,width:Xm},Symbol.toStringTag,{value:"Module"})),tp="igbt",np="绝缘栅双极晶体管 (IGBT)",op="passive",rp="N 沟道增强型 IGBT。t1=集电极(上), t2=发射极(下), t_g=门极。",ip="-32 -32 54 74",ap=54,sp=74,lp='<line x1="0" y1="25" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polyline points="-30,20 -5,20 -5,-20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-15" x2="20" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="20" y2="40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="15" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-25" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-8" x2="0" y2="8" fill="none" stroke="black" stroke-width="1"/><polyline points="10,-24 8,-21 12,-22" fill="none" stroke="black" stroke-width="1"/><polyline points="10,25 11,29 8,27" fill="none" stroke="black" stroke-width="1"/>',cp=[{id:"t1",x:20,y:-30,orientation:"n"},{id:"t2",x:20,y:40,orientation:"s"},{id:"t_g",x:-30,y:20,orientation:"w"}],dp={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_05/en_60617_05_05_19.elmt",qetEnglishName:"Insulated-gate bipolar transistor (IGBT) enhancement type, N channel"},oC={id:tp,name:np,category:op,description:rp,viewBox:ip,width:ap,height:sp,svg:lp,terminals:cp,source:dp},rC=Object.freeze(Object.defineProperty({__proto__:null,category:op,default:oC,description:rp,height:sp,id:tp,name:np,source:dp,svg:lp,terminals:cp,viewBox:ip,width:ap},Symbol.toStringTag,{value:"Module"})),up="indicator-light",mp="指示灯 (HL)",pp="control",hp="信号 / 状态指示灯。",fp="-12 -22 24 24",gp=24,bp=24,yp='<ellipse cx="0" cy="-10" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-3" x2="7" y2="-17" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-17" x2="7" y2="-3" fill="none" stroke="black" stroke-width="1"/>',xp=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],wp=[{name:"color",label:"颜色",type:"string"}],vp={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_01.elmt",qetEnglishName:"Lamp, general symbol"},iC={id:up,name:mp,category:pp,description:hp,viewBox:fp,width:gp,height:bp,svg:yp,terminals:xp,params:wp,source:vp},aC=Object.freeze(Object.defineProperty({__proto__:null,category:pp,default:iC,description:hp,height:bp,id:up,name:mp,params:wp,source:vp,svg:yp,terminals:xp,viewBox:fp,width:gp},Symbol.toStringTag,{value:"Module"})),kp="inductor",Sp="电感 (L)",_p="passive",Cp="通用电感 / 线圈 / 扼流圈。",$p="-17 -32 34 64",jp=34,Ap=64,Ep='<line x1="0" y1="15" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><path d="M 0 15 A 15 15 0 1 0 -15 0" fill="none" stroke="black" stroke-width="1"/><line x1="-15" y1="0" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>',Np=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Tp=[{name:"L",label:"电感量",type:"number",unit:"mH",showOnCanvas:!0},{name:"In",label:"额定电流",type:"number",unit:"A"}],Pp={x:6,y:0,anchor:"start"},Ip={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/30_inductors/inductance.elmt",qetEnglishName:"Inductor"},sC={id:kp,name:Sp,category:_p,description:Cp,viewBox:$p,width:jp,height:Ap,svg:Ep,terminals:Np,params:Tp,label:Pp,source:Ip},lC=Object.freeze(Object.defineProperty({__proto__:null,category:_p,default:sC,description:Cp,height:Ap,id:kp,label:Pp,name:Sp,params:Tp,source:Ip,svg:Ep,terminals:Np,viewBox:$p,width:jp},Symbol.toStringTag,{value:"Module"})),zp="inverter",Mp="逆变器 (DC→AC)",Dp="renewable",Rp="-42 -42 44 44",Op=44,Lp=44,Bp='<g transform="matrix(1 0 0 -1 0 -40)"><path d="M -15 -8 A 5 2.5 0 0 0 -25 -8" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><path d="M -15 -8 A 5 2.5 0 0 0 -5 -8" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/></g>',Hp=[{id:"t_dc",x:-20,y:0,orientation:"s"},{id:"t_ac",x:-20,y:-40,orientation:"n"}],Fp={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_05.elmt",qetEnglishName:"Inverter"},cC={id:zp,name:Mp,category:Dp,viewBox:Rp,width:Op,height:Lp,svg:Bp,terminals:Hp,source:Fp},dC=Object.freeze(Object.defineProperty({__proto__:null,category:Dp,default:cC,height:Lp,id:zp,name:Mp,source:Fp,svg:Bp,terminals:Hp,viewBox:Rp,width:Op},Symbol.toStringTag,{value:"Module"})),Wp="limit-switch",qp="限位开关 (SQ)",Gp="control",Vp="行程 / 位置开关 (常开, 机械操作)。",Kp="-10 -42 12 64",Up=12,Xp=64,Yp='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-13" x2="-7" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-12" x2="-3" y2="-8" fill="none" stroke="black" stroke-width="1"/>',Zp=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Qp=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],Jp={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_08/en_60617_07_08_01.elmt",qetEnglishName:"Position switch, make contact"},uC={id:Wp,name:qp,category:Gp,description:Vp,viewBox:Kp,width:Up,height:Xp,svg:Yp,terminals:Zp,state:Qp,source:Jp},mC=Object.freeze(Object.defineProperty({__proto__:null,category:Gp,default:uC,description:Vp,height:Xp,id:Wp,name:qp,source:Jp,state:Qp,svg:Yp,terminals:Zp,viewBox:Kp,width:Up},Symbol.toStringTag,{value:"Module"})),eh="load-switch",th="负荷开关",nh="switching",oh="-10 -42 14 64",rh=14,ih=64,ah='<line x1="0" y1="-24" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-22" rx="2" ry="2" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-24" x2="2" y2="-24" fill="none" stroke="black" stroke-width="1"/>',sh=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],lh=[{name:"open",type:"boolean",default:!1,label:"断开"}],ch={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_08.elmt",qetEnglishName:"Switch-disconnector; On-load isolating switch"},pC={id:eh,name:th,category:nh,viewBox:oh,width:rh,height:ih,svg:ah,terminals:sh,state:lh,source:ch},hC=Object.freeze(Object.defineProperty({__proto__:null,category:nh,default:pC,height:ih,id:eh,name:th,source:ch,state:lh,svg:ah,terminals:sh,viewBox:oh,width:rh},Symbol.toStringTag,{value:"Module"})),dh="load",uh="负荷",mh="load",ph="抽象负荷(电流流出箭头)",hh="-8 -22 16 46",fh=16,gh=46,bh='<line x1="0" y1="-20" x2="0" y2="10" stroke="black" stroke-width="1" fill="none"/><polygon points="-6,10 6,10 0,22" fill="black" stroke="black" stroke-width="1"/>',yh=[{id:"t_top",x:0,y:-20,orientation:"n"}],xh=[{name:"P",label:"有功功率",type:"number",unit:"MW",showOnCanvas:!0},{name:"cosphi",label:"功率因数",type:"number"}],wh={x:6,y:0,anchor:"start"},vh={kind:"inline"},fC={id:dh,name:uh,category:mh,description:ph,viewBox:hh,width:fh,height:gh,svg:bh,terminals:yh,params:xh,label:wh,source:vh},gC=Object.freeze(Object.defineProperty({__proto__:null,category:mh,default:fC,description:ph,height:gh,id:dh,label:wh,name:uh,params:xh,source:vh,svg:bh,terminals:yh,viewBox:hh,width:fh},Symbol.toStringTag,{value:"Module"})),kh="luminaire",Sh="灯具 / 照明负荷",_h="load",Ch="照明负荷(IEC 60617 荧光灯具通用符号)。区别于 indicator-light:那是面板信号灯,这是回路末端的照明负荷。",$h="-27 -7 54 14",jh=54,Ah=14,Eh='<line x1="-25" y1="0" x2="25" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-5" x2="-25" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="-5" x2="25" y2="5" fill="none" stroke="black" stroke-width="1"/>',Nh=[{id:"t_top",x:0,y:0,orientation:"n"}],Th={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_15/en_60617_11_15_04.elmt",qetEnglishName:"Luminaire, general symbol; Fluorescent lamp, general symbol"},bC={id:kh,name:Sh,category:_h,description:Ch,viewBox:$h,width:jh,height:Ah,svg:Eh,terminals:Nh,source:Th},yC=Object.freeze(Object.defineProperty({__proto__:null,category:_h,default:bC,description:Ch,height:Ah,id:kh,name:Sh,source:Th,svg:Eh,terminals:Nh,viewBox:$h,width:jh},Symbol.toStringTag,{value:"Module"})),Ph="make-contact",Ih="常开触点 (NO)",zh="control",Mh="常开辅助触点 (make contact)。",Dh="-10 -42 12 64",Rh=12,Oh=64,Lh='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>',Bh=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Hh=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],Fh={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_02/en_60617_07_02_01.elmt",qetEnglishName:"Make contact, general symbol; Switch, general symbol"},xC={id:Ph,name:Ih,category:zh,description:Mh,viewBox:Dh,width:Rh,height:Oh,svg:Lh,terminals:Bh,state:Hh,source:Fh},wC=Object.freeze(Object.defineProperty({__proto__:null,category:zh,default:xC,description:Mh,height:Oh,id:Ph,name:Ih,source:Fh,state:Hh,svg:Lh,terminals:Bh,viewBox:Dh,width:Rh},Symbol.toStringTag,{value:"Module"})),Wh="motor-starter",qh="电机启动器",Gh="motor-control",Vh="电机启动器 (IEC 60617 通用符号)。",Kh="-22 -27 44 54",Uh=44,Xh=54,Yh='<rect x="-20" y="-20" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><polyline points="-20,-20 0,-10 20,-20" fill="none" stroke="black" stroke-width="1"/>',Zh=[{id:"t_top",x:0,y:-25,orientation:"n"},{id:"t_bottom",x:0,y:25,orientation:"s"}],Qh={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_14/en_60617_07_14_01.elmt",qetEnglishName:"Motor starter, general symbol"},vC={id:Wh,name:qh,category:Gh,description:Vh,viewBox:Kh,width:Uh,height:Xh,svg:Yh,terminals:Zh,source:Qh},kC=Object.freeze(Object.defineProperty({__proto__:null,category:Gh,default:vC,description:Vh,height:Xh,id:Wh,name:qh,source:Qh,svg:Yh,terminals:Zh,viewBox:Kh,width:Uh},Symbol.toStringTag,{value:"Module"})),Jh="mppt",ef="MPPT 控制器",tf="renewable",nf="MPPT 太阳能充电控制器(DC/DC,最大功率点跟踪)",of="-42 -42 44 44",rf=44,af=44,sf='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/>',lf=[{id:"t_pv",x:-20,y:-40,orientation:"n"},{id:"t_bat",x:-20,y:0,orientation:"s"}],cf=[{name:"I",label:"额定电流",type:"number",unit:"A"}],df={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_02.elmt",qetEnglishName:"DC/DC converter"},SC={id:Jh,name:ef,category:tf,description:nf,viewBox:of,width:rf,height:af,svg:sf,terminals:lf,params:cf,source:df},_C=Object.freeze(Object.defineProperty({__proto__:null,category:tf,default:SC,description:nf,height:af,id:Jh,name:ef,params:cf,source:df,svg:sf,terminals:lf,viewBox:of,width:rf},Symbol.toStringTag,{value:"Module"})),uf="ngr",mf="中性点电阻 (NGR)",pf="grounding",hf="小电阻接地:连接变压器中性点到地",ff="-12 -32 24 62",gf=24,bf=62,yf='<line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><rect x="-6" y="-15" width="12" height="22" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="7" x2="0" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="15" x2="10" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="19" x2="7" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="23" x2="4" y2="23" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="27" x2="1.5" y2="27" fill="none" stroke="black" stroke-width="1"/>',xf=[{id:"t_top",x:0,y:-30,orientation:"n"}],wf=[{name:"R",label:"电阻",type:"number",unit:"Ω"}],vf={kind:"inline"},CC={id:uf,name:mf,category:pf,description:hf,viewBox:ff,width:gf,height:bf,svg:yf,terminals:xf,params:wf,source:vf},$C=Object.freeze(Object.defineProperty({__proto__:null,category:pf,default:CC,description:hf,height:bf,id:uf,name:mf,params:wf,source:vf,svg:yf,terminals:xf,viewBox:ff,width:gf},Symbol.toStringTag,{value:"Module"})),kf="overcurrent-relay",Sf="过流继电器 (50/51)",_f="protection",Cf="过电流保护继电器 (ANSI 50/51)。",$f="-62 -62 64 64",jf=64,Af=64,Ef='<rect x="-60" y="-60" width="60" height="60" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-48" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">5...10A</text>',Nf=[{id:"t_top",x:-30,y:-60,orientation:"n"}],Tf={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_05.elmt",qetEnglishName:"Overcurrent relay"},jC={id:kf,name:Sf,category:_f,description:Cf,viewBox:$f,width:jf,height:Af,svg:Ef,terminals:Nf,source:Tf},AC=Object.freeze(Object.defineProperty({__proto__:null,category:_f,default:jC,description:Cf,height:Af,id:kf,name:Sf,source:Tf,svg:Ef,terminals:Nf,viewBox:$f,width:jf},Symbol.toStringTag,{value:"Module"})),Pf="panelboard",If="配电箱",zf="load",Mf="配电箱 / 负荷中心(IEC 60617 分配中心符号):顶部进线,底部分路示意",Df="-52 -62 54 64",Rf=54,Of=64,Lf='<g transform="matrix(1 0 0 -1 0 -60)"><rect x="-50" y="-40" width="50" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-60" x2="-40" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-60" x2="-30" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-60" x2="-20" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-60" x2="-10" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-20" x2="-25" y2="0" fill="none" stroke="black" stroke-width="1"/></g>',Bf=[{id:"t_in",x:-25,y:-60,orientation:"n"}],Hf={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_12/en_60617_11_12_07.elmt",qetEnglishName:"Distribution centre"},EC={id:Pf,name:If,category:zf,description:Mf,viewBox:Df,width:Rf,height:Of,svg:Lf,terminals:Bf,source:Hf},NC=Object.freeze(Object.defineProperty({__proto__:null,category:zf,default:EC,description:Mf,height:Of,id:Pf,name:If,source:Hf,svg:Lf,terminals:Bf,viewBox:Df,width:Rf},Symbol.toStringTag,{value:"Module"})),Ff="phase-failure-relay",Wf="断相继电器",qf="protection",Gf="断相 / 缺相保护继电器。",Vf="-62 -42 64 44",Kf=64,Uf=44,Xf='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">m &lt; 3</text>',Yf=[{id:"t_top",x:-30,y:-40,orientation:"n"}],Zf={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_12.elmt",qetEnglishName:"Phase-failure detection relay"},TC={id:Ff,name:Wf,category:qf,description:Gf,viewBox:Vf,width:Kf,height:Uf,svg:Xf,terminals:Yf,source:Zf},PC=Object.freeze(Object.defineProperty({__proto__:null,category:qf,default:TC,description:Gf,height:Uf,id:Ff,name:Wf,source:Zf,svg:Xf,terminals:Yf,viewBox:Vf,width:Kf},Symbol.toStringTag,{value:"Module"})),Qf="plc",Jf="PLC / 控制器",eg="control",tg="可编程逻辑控制器 (PLC)。",ng="-24 -42 48 84",og=48,rg=84,ig='<rect x="-22" y="-22" width="44" height="44" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">PLC</text><line x1="0" y1="-40" x2="0" y2="-22" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="22" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',ag=[{id:"t_top",x:0,y:-40,orientation:"n"},{id:"t_bottom",x:0,y:40,orientation:"s"}],sg={kind:"inline"},IC={id:Qf,name:Jf,category:eg,description:tg,viewBox:ng,width:og,height:rg,svg:ig,terminals:ag,source:sg},zC=Object.freeze(Object.defineProperty({__proto__:null,category:eg,default:IC,description:tg,height:rg,id:Qf,name:Jf,source:sg,svg:ig,terminals:ag,viewBox:ng,width:og},Symbol.toStringTag,{value:"Module"})),lg="power-factor-meter",cg="功率因数表 (cosφ)",dg="measurement",ug="功率因数表 (cosφ)。",mg="-22 -42 44 44",pg=44,hg=44,fg='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-14" y="-6.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">cos φ</text>',gg=[{id:"t_top",x:0,y:-40,orientation:"n"}],bg={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_05.elmt",qetEnglishName:"Power-factor meter"},MC={id:lg,name:cg,category:dg,description:ug,viewBox:mg,width:pg,height:hg,svg:fg,terminals:gg,source:bg},DC=Object.freeze(Object.defineProperty({__proto__:null,category:dg,default:MC,description:ug,height:hg,id:lg,name:cg,source:bg,svg:fg,terminals:gg,viewBox:mg,width:pg},Symbol.toStringTag,{value:"Module"})),yg="power-supply",xg="开关电源 (PS)",wg="source",vg="AC→DC 开关电源 / 直流电源模块。t_ac 上(~), t_dc 下(=)。",kg="-24 -42 48 84",Sg=48,_g=84,Cg='<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="8" y="15" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">=</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',$g=[{id:"t_ac",x:0,y:-40,orientation:"n"},{id:"t_dc",x:0,y:40,orientation:"s"}],jg=[{name:"Vdc",label:"输出电压",type:"number",unit:"V",showOnCanvas:!0}],Ag={kind:"inline"},RC={id:yg,name:xg,category:wg,description:vg,viewBox:kg,width:Sg,height:_g,svg:Cg,terminals:$g,params:jg,source:Ag},OC=Object.freeze(Object.defineProperty({__proto__:null,category:wg,default:RC,description:vg,height:_g,id:yg,name:xg,params:jg,source:Ag,svg:Cg,terminals:$g,viewBox:kg,width:Sg},Symbol.toStringTag,{value:"Module"})),Eg="protective-relay",Ng="保护继电器",Tg="protection",Pg="测量继电器 / 保护继电器通用符号 (IEC 60617)。",Ig="-32 -42 64 44",zg=64,Mg=44,Dg='<polygon points="-2,-22 2,-22 0,-25" fill="black" stroke="black" stroke-width="1"/><polygon points="-2,-22 -2,-19 -6,-20" fill="black" stroke="black" stroke-width="1"/><polygon points="2,-22 2,-19 6,-20" fill="black" stroke="black" stroke-width="1"/><polygon points="-2,-19 0,-17 -3,-15" fill="black" stroke="black" stroke-width="1"/><polygon points="0,-17 2,-19 4,-15" fill="black" stroke="black" stroke-width="1"/><rect x="-2" y="-22" width="4" height="4" rx="0" ry="0" fill="black" stroke="black" stroke-width="1"/><rect x="-30" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Rg=[{id:"t_top",x:0,y:-40,orientation:"n"}],Og={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_16/en_60617_07_16_01.elmt",qetEnglishName:"Measuring relay; Device related to a measuring relay"},LC={id:Eg,name:Ng,category:Tg,description:Pg,viewBox:Ig,width:zg,height:Mg,svg:Dg,terminals:Rg,source:Og},BC=Object.freeze(Object.defineProperty({__proto__:null,category:Tg,default:LC,description:Pg,height:Mg,id:Eg,name:Ng,source:Og,svg:Dg,terminals:Rg,viewBox:Ig,width:zg},Symbol.toStringTag,{value:"Module"})),Lg="proximity-switch",Bg="接近开关 (SQ)",Hg="control",Fg="接近传感器 / 无触点接近开关。",Wg="-12 -32 24 64",qg=24,Gg=64,Vg='<line x1="0" y1="-30" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="30" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="0,-10 -10,0 0,10 10,0" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-6" x2="-4" y2="6" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="-6" x2="4" y2="6" fill="none" stroke="black" stroke-width="1"/>',Kg=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Ug={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_19/en_60617_07_19_01.elmt",qetEnglishName:"Proximity sensor"},HC={id:Lg,name:Bg,category:Hg,description:Fg,viewBox:Wg,width:qg,height:Gg,svg:Vg,terminals:Kg,source:Ug},FC=Object.freeze(Object.defineProperty({__proto__:null,category:Hg,default:HC,description:Fg,height:Gg,id:Lg,name:Bg,source:Ug,svg:Vg,terminals:Kg,viewBox:Wg,width:qg},Symbol.toStringTag,{value:"Module"})),Xg="pt",Yg="电压互感器 (PT)",Zg="instrument-transformer",Qg="-22 -42 44 115",Jg=44,eb=115,tb='<ellipse cx="0" cy="1" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-40" x2="0" y2="-20" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="30" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="-0.13" y1="51" x2="-0.13" y2="71" fill="none" stroke="black" stroke-width="1"/>',nb=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:71,orientation:"s"}],ob={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_13/en_60617_06_13_01A.elmt",qetEnglishName:"Voltage transformer"},WC={id:Xg,name:Yg,category:Zg,viewBox:Qg,width:Jg,height:eb,svg:tb,terminals:nb,source:ob},qC=Object.freeze(Object.defineProperty({__proto__:null,category:Zg,default:WC,height:eb,id:Xg,name:Yg,source:ob,svg:tb,terminals:nb,viewBox:Qg,width:Jg},Symbol.toStringTag,{value:"Module"})),rb="push-button",ib="按钮 (SB)",ab="control",sb="手动按钮, 自动复位 (常开 make)。",lb="-37 -42 39 64",cb=39,db=64,ub='<line x1="-35" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-15" x2="-35" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-15" x2="-30" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-5" x2="-35" y2="-5" fill="none" stroke="black" stroke-width="1"/>',mb=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],pb={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_02.elmt",qetEnglishName:"Switch, manually operated, push-button, automatic return"},GC={id:rb,name:ib,category:ab,description:sb,viewBox:lb,width:cb,height:db,svg:ub,terminals:mb,source:pb},VC=Object.freeze(Object.defineProperty({__proto__:null,category:ab,default:GC,description:sb,height:db,id:rb,name:ib,source:pb,svg:ub,terminals:mb,viewBox:lb,width:cb},Symbol.toStringTag,{value:"Module"})),hb="pv",fb="光伏组件",gb="renewable",bb="-33 -22 85 64",yb=85,xb=64,wb='<line x1="-16" y1="24" x2="-26" y2="14" fill="none" stroke="black" stroke-width="1"/><line x1="-21" y1="29" x2="-31" y2="19" fill="none" stroke="black" stroke-width="1"/><polygon points="-20,23 -17,20 -15,25" fill="black" stroke="black" stroke-width="1"/><polygon points="-22,25 -25,28 -20,30" fill="black" stroke="black" stroke-width="1"/><rect x="-10" y="-20" width="60" height="60" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="15" y="7.2" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text><line x1="10" y1="20" x2="20" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="15" x2="20" y2="25" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="10" x2="25" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="20" x2="35" y2="20" fill="none" stroke="black" stroke-width="1"/>',vb=[{id:"t_dc",x:0,y:40,orientation:"s"}],kb={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_18/en_60617_06_18_06.elmt",qetEnglishName:"Photovoltaic generator"},KC={id:hb,name:fb,category:gb,viewBox:bb,width:yb,height:xb,svg:wb,terminals:vb,source:kb},UC=Object.freeze(Object.defineProperty({__proto__:null,category:gb,default:KC,height:xb,id:hb,name:fb,source:kb,svg:wb,terminals:vb,viewBox:bb,width:yb},Symbol.toStringTag,{value:"Module"})),Sb="rcd",_b="剩余电流装置 (RCD)",Cb="protection",$b="不带过流保护的剩余电流断路器 (IEC 61008)。",jb="-12 -22 19 44",Ab=19,Eb=44,Nb='<line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="0,20 0,10 -7,-9" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="13" rx="4.5" ry="2" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,0 -10,0 -10,13 -5,13" fill="none" stroke="black" stroke-width="0.4" stroke-dasharray="4 2"/>',Tb=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Pb=[{name:"open",type:"boolean",default:!1,label:"断开"}],Ib=[{name:"IDn",label:"剩余动作电流",type:"number",unit:"mA",default:30,showOnCanvas:!0}],zb={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/ddr1.elmt",qetEnglishName:"Residual Circuit Breaker with Overload"},XC={id:Sb,name:_b,category:Cb,description:$b,viewBox:jb,width:Ab,height:Eb,svg:Nb,terminals:Tb,state:Pb,params:Ib,source:zb},YC=Object.freeze(Object.defineProperty({__proto__:null,category:Cb,default:XC,description:$b,height:Eb,id:Sb,name:_b,params:Ib,source:zb,state:Pb,svg:Nb,terminals:Tb,viewBox:jb,width:Ab},Symbol.toStringTag,{value:"Module"})),Mb="recloser",Db="重合闸 (Recloser)",Rb="protection",Ob="中压自动重合闸开关。",Lb="-12 -32 36 64",Bb=36,Hb=64,Fb='<line x1="0" y1="-30" x2="0" y2="-10" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-13" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-8" x2="2" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-12" x2="2" y2="-8" stroke="black" stroke-width="1" fill="none"/><path d="M 13 -12 A 7 7 0 1 1 6 -5" fill="none" stroke="black" stroke-width="0.8"/><polygon points="4,-7 6,-5 8,-3" fill="black"/><text x="14" y="6" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">AR</text>',Wb=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],qb=[{name:"open",type:"boolean",default:!1,label:"断开"}],Gb={kind:"inline"},ZC={id:Mb,name:Db,category:Rb,description:Ob,viewBox:Lb,width:Bb,height:Hb,svg:Fb,terminals:Wb,state:qb,source:Gb},QC=Object.freeze(Object.defineProperty({__proto__:null,category:Rb,default:ZC,description:Ob,height:Hb,id:Mb,name:Db,source:Gb,state:qb,svg:Fb,terminals:Wb,viewBox:Lb,width:Bb},Symbol.toStringTag,{value:"Module"})),Vb="rectifier",Kb="整流器 (AC→DC)",Ub="renewable",Xb="-42 -42 44 44",Yb=44,Zb=44,Qb='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/>',Jb=[{id:"t_ac",x:-20,y:-40,orientation:"n"},{id:"t_dc",x:-20,y:0,orientation:"s"}],e0={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_03.elmt",qetEnglishName:"Rectifier"},JC={id:Vb,name:Kb,category:Ub,viewBox:Xb,width:Yb,height:Zb,svg:Qb,terminals:Jb,source:e0},e$=Object.freeze(Object.defineProperty({__proto__:null,category:Ub,default:JC,height:Zb,id:Vb,name:Kb,source:e0,svg:Qb,terminals:Jb,viewBox:Xb,width:Yb},Symbol.toStringTag,{value:"Module"})),t0="relay-coil",n0="继电器线圈 (KA)",o0="control",r0="继电器 / 接触器操作线圈 (方框)。",i0="-22 -22 44 44",a0=44,s0=44,l0='<rect x="-20" y="-10" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/>',c0=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],d0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_15/en_60617_07_15_01.elmt",qetEnglishName:"Operating device, general symbol; Relay coil, general symbol"},t$={id:t0,name:n0,category:o0,description:r0,viewBox:i0,width:a0,height:s0,svg:l0,terminals:c0,source:d0},n$=Object.freeze(Object.defineProperty({__proto__:null,category:o0,default:t$,description:r0,height:s0,id:t0,name:n0,source:d0,svg:l0,terminals:c0,viewBox:i0,width:a0},Symbol.toStringTag,{value:"Module"})),u0="resistor",m0="电阻 (R)",p0="passive",h0="通用电阻 / 限流 / 制动电阻。",f0="-6 -23 12 35",g0=12,b0=35,y0='<line x1="0" y1="-10" x2="0" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="10" x2="4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="10" x2="4" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-10" x2="-4" y2="10" fill="none" stroke="black" stroke-width="1"/>',x0=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t2",x:0,y:10,orientation:"s"}],w0=[{name:"R",label:"阻值",type:"number",unit:"Ω",showOnCanvas:!0},{name:"P",label:"额定功率",type:"number",unit:"W"}],v0={x:6,y:0,anchor:"start"},k0={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/10_resistors/resistance.elmt",qetEnglishName:"Resistor"},o$={id:u0,name:m0,category:p0,description:h0,viewBox:f0,width:g0,height:b0,svg:y0,terminals:x0,params:w0,label:v0,source:k0},r$=Object.freeze(Object.defineProperty({__proto__:null,category:p0,default:o$,description:h0,height:b0,id:u0,label:v0,name:m0,params:w0,source:k0,svg:y0,terminals:x0,viewBox:f0,width:g0},Symbol.toStringTag,{value:"Module"})),S0="reverse-power-relay",_0="逆功率继电器 (32)",C0="protection",$0="逆功率 / 逆流保护继电器 (ANSI 32)。",j0="-62 -42 64 44",A0=64,E0=44,N0='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">I</text><polygon points="-15,-20 -30,-20 -24,-22 -24,-18 -30,-20 -24,-20" fill="black" stroke="black" stroke-width="1"/>',T0=[{id:"t_top",x:-30,y:-40,orientation:"n"}],P0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_02.elmt",qetEnglishName:"Reverse current relay"},i$={id:S0,name:_0,category:C0,description:$0,viewBox:j0,width:A0,height:E0,svg:N0,terminals:T0,source:P0},a$=Object.freeze(Object.defineProperty({__proto__:null,category:C0,default:i$,description:$0,height:E0,id:S0,name:_0,source:P0,svg:N0,terminals:T0,viewBox:j0,width:A0},Symbol.toStringTag,{value:"Module"})),I0="selector-switch",z0="选择开关 (SA)",M0="switching",D0="转换 / 选择开关 (旋转操作, 保位)。",R0="-34 -42 36 64",O0=36,L0=64,B0='<line x1="-32" y1="-10" x2="-2" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-32" y1="-15" x2="-32" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>',H0=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],F0=[{name:"open",type:"boolean",default:!1,label:"断开"}],W0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_04.elmt",qetEnglishName:"Switch, manually operated, turning, stay-put"},s$={id:I0,name:z0,category:M0,description:D0,viewBox:R0,width:O0,height:L0,svg:B0,terminals:H0,state:F0,source:W0},l$=Object.freeze(Object.defineProperty({__proto__:null,category:M0,default:s$,description:D0,height:L0,id:I0,name:z0,source:W0,state:F0,svg:B0,terminals:H0,viewBox:R0,width:O0},Symbol.toStringTag,{value:"Module"})),q0="series-reactor",G0="串联电抗器",V0="compensation",K0="与并联电抗器同符号;通过用法区分。",U0="-62 -82 64 104",X0=64,Y0=104,Z0='<line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M -30 0 A 30 30 0 1 0 -60 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-60" y1="-30" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/>',Q0=[{id:"t1",x:-30,y:-80,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],J0={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_08.elmt",qetEnglishName:"Choke; Reactor, general symbol"},c$={id:q0,name:G0,category:V0,description:K0,viewBox:U0,width:X0,height:Y0,svg:Z0,terminals:Q0,source:J0},d$=Object.freeze(Object.defineProperty({__proto__:null,category:V0,default:c$,description:K0,height:Y0,id:q0,name:G0,source:J0,svg:Z0,terminals:Q0,viewBox:U0,width:X0},Symbol.toStringTag,{value:"Module"})),e1="shunt-capacitor",t1="并联电容器",n1="compensation",o1="-7 -23 14 27",r1=14,i1=27,a1='<line x1="-5" y1="2" x2="5" y2="2" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-2" x2="5" y2="-2" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-2" fill="none" stroke="black" stroke-width="1"/>',s1=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t_bottom",x:0,y:2,orientation:"s"}],l1=[{name:"Q",label:"无功容量",type:"number",unit:"Mvar"},{name:"stages",label:"分组数",type:"number"}],c1={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/20_capacitors/capacite.elmt",qetEnglishName:"Capacitor"},u$={id:e1,name:t1,category:n1,viewBox:o1,width:r1,height:i1,svg:a1,terminals:s1,params:l1,source:c1},m$=Object.freeze(Object.defineProperty({__proto__:null,category:n1,default:u$,height:i1,id:e1,name:t1,params:l1,source:c1,svg:a1,terminals:s1,viewBox:o1,width:r1},Symbol.toStringTag,{value:"Module"})),d1="shunt-reactor",u1="并联电抗器",m1="compensation",p1="-62 -82 64 104",h1=64,f1=104,g1='<line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M -30 0 A 30 30 0 1 0 -60 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-60" y1="-30" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/>',b1=[{id:"t1",x:-30,y:-80,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],y1={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_08.elmt",qetEnglishName:"Choke; Reactor, general symbol"},p$={id:d1,name:u1,category:m1,viewBox:p1,width:h1,height:f1,svg:g1,terminals:b1,source:y1},h$=Object.freeze(Object.defineProperty({__proto__:null,category:m1,default:p$,height:f1,id:d1,name:u1,source:y1,svg:g1,terminals:b1,viewBox:p1,width:h1},Symbol.toStringTag,{value:"Module"})),x1="siren",w1="警笛 (HA)",v1="control",k1="声响警笛 / 报警器。",S1="-32 -42 44 54",_1=44,C1=54,$1='<line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="10,-10 -30,-10 -10,-40" fill="none" stroke="black" stroke-width="1"/>',j1=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],A1={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_09.elmt",qetEnglishName:"Siren"},f$={id:x1,name:w1,category:v1,description:k1,viewBox:S1,width:_1,height:C1,svg:$1,terminals:j1,source:A1},g$=Object.freeze(Object.defineProperty({__proto__:null,category:v1,default:f$,description:k1,height:C1,id:x1,name:w1,source:A1,svg:$1,terminals:j1,viewBox:S1,width:_1},Symbol.toStringTag,{value:"Module"})),E1="socket-outlet",N1="插座 / 连接器",T1="load",P1="电源插座 / 多极连接器。",I1="-7 -2 13 34",z1=13,M1=34,D1='<line x1="-5" y1="13" x2="4" y2="20" fill="none" stroke="black" stroke-width="0.4"/><line x1="-1" y1="12" x2="-1" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="9" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="12" x2="1" y2="19" fill="none" stroke="black" stroke-width="1"/><path d="M 3 13 A 3 3 0 0 0 -3 13" fill="none" stroke="black" stroke-width="1"/>',R1=[{id:"t1",x:0,y:0,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],O1={kind:"elmt",path:"11_singlepole/140_connectors_plugs/prise_multipolaire_2.elmt",qetEnglishName:`Plug and multipolar representation
217
- unifilar`},b$={id:E1,name:N1,category:T1,description:P1,viewBox:I1,width:z1,height:M1,svg:D1,terminals:R1,source:O1},y$=Object.freeze(Object.defineProperty({__proto__:null,category:T1,default:b$,description:P1,height:M1,id:E1,name:N1,source:O1,svg:D1,terminals:R1,viewBox:I1,width:z1},Symbol.toStringTag,{value:"Module"})),L1="soft-starter",B1="软启动器",H1="motor-control",F1="电机软启动器 (晶闸管降压启动)。",W1="-22 -42 44 84",q1=44,G1=84,V1='<rect x="-20" y="-20" width="40" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-12" y1="-12" x2="12" y2="12" stroke="black" stroke-width="1" fill="none"/><polygon points="4,8 12,12 8,4" fill="none" stroke="black" stroke-width="1"/><text x="-12" y="-2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">SS</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',K1=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],U1={kind:"inline"},x$={id:L1,name:B1,category:H1,description:F1,viewBox:W1,width:q1,height:G1,svg:V1,terminals:K1,source:U1},w$=Object.freeze(Object.defineProperty({__proto__:null,category:H1,default:x$,description:F1,height:G1,id:L1,name:B1,source:U1,svg:V1,terminals:K1,viewBox:W1,width:q1},Symbol.toStringTag,{value:"Module"})),X1="sync-motor",Y1="同步电动机",Z1="load",Q1="-62 -82 64 114",J1=64,ey=114,ty='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-53" x2="-10" y2="-80" fill="none" stroke="black" stroke-width="1"/><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">1</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -40 10 A 5 5 0 0 0 -50 10" fill="none" stroke="black" stroke-width="1"/><path d="M -30 10 A 5 5 0 0 0 -40 10" fill="none" stroke="black" stroke-width="1"/><path d="M -20 10 A 5 5 0 0 0 -30 10" fill="none" stroke="black" stroke-width="1"/><path d="M -10 10 A 5 5 0 0 0 -20 10" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="10" x2="-50" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="10" x2="-10" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="15" x2="-20" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="20" x2="-32" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-27" y1="20" x2="-20" y2="20" fill="none" stroke="black" stroke-width="1"/>',ny=[{id:"t1",x:-10,y:-80,orientation:"n"},{id:"t2",x:-50,y:-80,orientation:"n"}],oy={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_07/en_60617_06_07_02.elmt",qetEnglishName:"Synchronous motor, single-phase"},v$={id:X1,name:Y1,category:Z1,viewBox:Q1,width:J1,height:ey,svg:ty,terminals:ny,source:oy},k$=Object.freeze(Object.defineProperty({__proto__:null,category:Z1,default:v$,height:ey,id:X1,name:Y1,source:oy,svg:ty,terminals:ny,viewBox:Q1,width:J1},Symbol.toStringTag,{value:"Module"})),ry="synchronoscope",iy="同步表",ay="measurement",sy="同步指示器 / 同步表。",ly="-22 -42 44 44",cy=44,dy=44,uy='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-5" x2="0" y2="-35" fill="none" stroke="black" stroke-width="1"/><path d="M 12.374 -30.374 A 17.5 17.5 0 0 0 -12.374 -30.374" fill="none" stroke="black" stroke-width="1"/><polygon points="-13,-30 -11,-33 -10,-31" fill="none" stroke="black" stroke-width="1"/><polygon points="11,-33 13,-30 10,-31" fill="none" stroke="black" stroke-width="1"/>',my=[{id:"t_top",x:0,y:-40,orientation:"n"}],py={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_08.elmt",qetEnglishName:"Synchronoscope"},S$={id:ry,name:iy,category:ay,description:sy,viewBox:ly,width:cy,height:dy,svg:uy,terminals:my,source:py},_$=Object.freeze(Object.defineProperty({__proto__:null,category:ay,default:S$,description:sy,height:dy,id:ry,name:iy,source:py,svg:uy,terminals:my,viewBox:ly,width:cy},Symbol.toStringTag,{value:"Module"})),hy="terminal",fy="接线端子 / 节点 (X)",gy="busbar",by="接线端子 / 接线盒 / 汇接节点。",yy="-5 -5 10 10",xy=10,wy=10,vy='<ellipse cx="0" cy="0" rx="2.5" ry="2.5" fill="black" stroke="black" stroke-width="1"/>',ky=[{id:"t_top",x:0,y:-2.5,orientation:"n"},{id:"t_bottom",x:0,y:2.5,orientation:"s"},{id:"t_left",x:-2.5,y:0,orientation:"w"},{id:"t_right",x:2.5,y:0,orientation:"e"}],Sy={kind:"elmt",path:"91_en_60617/en_60617_03/en_60617_03_02/en_60617_03_02_02.elmt",qetEnglishName:"Terminal"},C$={id:hy,name:fy,category:gy,description:by,viewBox:yy,width:xy,height:wy,svg:vy,terminals:ky,source:Sy},$$=Object.freeze(Object.defineProperty({__proto__:null,category:gy,default:C$,description:by,height:wy,id:hy,name:fy,source:Sy,svg:vy,terminals:ky,viewBox:yy,width:xy},Symbol.toStringTag,{value:"Module"})),_y="thermal-overload",Cy="热过载继电器",$y="motor-control",jy="电机热过载保护继电器, 通常串接在接触器和电机之间。",Ay="-9 -32 19 64",Ey=19,Ny=64,Ty='<line x1="0" y1="-30" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-7" y="-15" width="14" height="30" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,-10 -1,-5 -4,0 -1,5 -4,10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>',Py=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Iy=[{name:"tripped",type:"boolean",default:!1,label:"动作"}],zy={kind:"inline"},j$={id:_y,name:Cy,category:$y,description:jy,viewBox:Ay,width:Ey,height:Ny,svg:Ty,terminals:Py,state:Iy,source:zy},A$=Object.freeze(Object.defineProperty({__proto__:null,category:$y,default:j$,description:jy,height:Ny,id:_y,name:Cy,source:zy,state:Iy,svg:Ty,terminals:Py,viewBox:Ay,width:Ey},Symbol.toStringTag,{value:"Module"})),My="thermocouple",Dy="热电偶 (BT)",Ry="measurement",Oy="热电偶温度传感器。",Ly="-26 -42 52 46",By=52,Hy=46,Fy='<ellipse cx="0" cy="0" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/><polyline points="-10,-40 -10,-15 0,0 10,-15 10,-40" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-16" x2="-16" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="16" y1="-16" x2="24" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-20" x2="20" y2="-12" fill="none" stroke="black" stroke-width="1"/>',Wy=[{id:"t1",x:10,y:-40,orientation:"n"},{id:"t2",x:-10,y:-40,orientation:"n"}],qy={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_06/en_60617_08_06_01.elmt",qetEnglishName:"Thermocouple"},E$={id:My,name:Dy,category:Ry,description:Oy,viewBox:Ly,width:By,height:Hy,svg:Fy,terminals:Wy,source:qy},N$=Object.freeze(Object.defineProperty({__proto__:null,category:Ry,default:E$,description:Oy,height:Hy,id:My,name:Dy,source:qy,svg:Fy,terminals:Wy,viewBox:Ly,width:By},Symbol.toStringTag,{value:"Module"})),Gy="thyristor",Vy="晶闸管 (V)",Ky="passive",Uy="反向阻断三极晶闸管 / SCR。t1=阳极(上), t2=阴极(下)。",Xy="-22 -42 34 44",Yy=34,Zy=44,Qy='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="10" y1="-20" x2="-10" y2="-20" fill="none" stroke="black" stroke-width="1"/><polyline points="-20,0 -7,0 -4,-10" fill="none" stroke="black" stroke-width="1"/>',Jy=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],ex={x:6,y:-20,anchor:"start"},tx={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_04/en_60617_05_04_06.elmt",qetEnglishName:"Reverse blocking triode thyristor, P-gate (cathode-side controlled)"},T$={id:Gy,name:Vy,category:Ky,description:Uy,viewBox:Xy,width:Yy,height:Zy,svg:Qy,terminals:Jy,label:ex,source:tx},P$=Object.freeze(Object.defineProperty({__proto__:null,category:Ky,default:T$,description:Uy,height:Zy,id:Gy,label:ex,name:Vy,source:tx,svg:Qy,terminals:Jy,viewBox:Xy,width:Yy},Symbol.toStringTag,{value:"Module"})),nx="time-relay",ox="时间继电器 (KT)",rx="control",ix="延时 (缓动) 继电器线圈。",ax="-32 -22 54 44",sx=54,lx=44,cx='<rect x="-20" y="-10" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><rect x="-30" y="-10" width="10" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="10" x2="-20" y2="-10" fill="none" stroke="black" stroke-width="1"/>',dx=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],ux={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_15/en_60617_07_15_08.elmt",qetEnglishName:"Relay coil of a slow-operating relay"},I$={id:nx,name:ox,category:rx,description:ix,viewBox:ax,width:sx,height:lx,svg:cx,terminals:dx,source:ux},z$=Object.freeze(Object.defineProperty({__proto__:null,category:rx,default:I$,description:ix,height:lx,id:nx,name:ox,source:ux,svg:cx,terminals:dx,viewBox:ax,width:sx},Symbol.toStringTag,{value:"Module"})),mx="transfer-switch",px="切换开关 (ATS)",hx="switching",fx="双源切换开关 (Automatic / Manual Transfer Switch)。两个电源输入 + 一个负荷输出, 互锁不并联。",gx="-27 -32 51 64",bx=51,yx=64,xx='<line x1="-15" y1="-30" x2="-15" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="15" y1="-30" x2="15" y2="-12" stroke="black" stroke-width="1" fill="none"/><text x="-25" y="-20" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">N</text><text x="19" y="-20" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">E</text><circle cx="-15" cy="-10" r="1.5" fill="black"/><circle cx="15" cy="-10" r="1.5" fill="black"/><circle cx="0" cy="6" r="1.5" fill="black"/><line x1="-15" y1="-10" x2="0" y2="6" stroke="black" stroke-width="1" fill="none"/><line x1="15" y1="-10" x2="0" y2="6" stroke="black" stroke-width="0.6" fill="none" stroke-dasharray="2 1.5"/><line x1="0" y1="6" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>',wx=[{id:"t_normal",x:-15,y:-30,orientation:"n"},{id:"t_emergency",x:15,y:-30,orientation:"n"},{id:"t_load",x:0,y:30,orientation:"s"}],vx=[{name:"position",type:"string",default:"normal",label:"位置 (normal/emergency/off)"}],kx={kind:"inline"},M$={id:mx,name:px,category:hx,description:fx,viewBox:gx,width:bx,height:yx,svg:xx,terminals:wx,state:vx,source:kx},D$=Object.freeze(Object.defineProperty({__proto__:null,category:hx,default:M$,description:fx,height:yx,id:mx,name:px,source:kx,state:vx,svg:xx,terminals:wx,viewBox:gx,width:bx},Symbol.toStringTag,{value:"Module"})),Sx="transformer-2w",_x="双绕组变压器",Cx="transformer",$x="-62 -142 64 144",jx=64,Ax=144,Ex='<ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-140" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/>',Nx=[{id:"t1",x:-30,y:-140,orientation:"n"},{id:"t2",x:-30,y:0,orientation:"s"}],Tx=[{name:"S",label:"容量",type:"number",unit:"MVA",showOnCanvas:!0},{name:"ratio",label:"变比",type:"string",showOnCanvas:!0}],Px={x:4,y:-68,anchor:"start"},Ix={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_01.elmt",qetEnglishName:"Transformer with two windings, general symbol"},R$={id:Sx,name:_x,category:Cx,viewBox:$x,width:jx,height:Ax,svg:Ex,terminals:Nx,params:Tx,label:Px,source:Ix},O$=Object.freeze(Object.defineProperty({__proto__:null,category:Cx,default:R$,height:Ax,id:Sx,label:Px,name:_x,params:Tx,source:Ix,svg:Ex,terminals:Nx,viewBox:$x,width:jx},Symbol.toStringTag,{value:"Module"})),zx="transformer-3w",Mx="三绕组变压器",Dx="transformer",Rx="-82 -131 114 133",Ox=114,Lx=133,Bx='<ellipse cx="-30" cy="-80" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-31" y1="-129" x2="-31" y2="-109" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-50" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-20" x2="-50" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>',Hx=[{id:"t1",x:-31,y:-129,orientation:"n"},{id:"t_low_left",x:-50,y:0,orientation:"s"},{id:"t_low_right",x:0,y:0,orientation:"s"}],Fx={x:4,y:-64,anchor:"start"},Wx={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_04.elmt",qetEnglishName:"Transformer with three windings, general symbol"},L$={id:zx,name:Mx,category:Dx,viewBox:Rx,width:Ox,height:Lx,svg:Bx,terminals:Hx,label:Fx,source:Wx},B$=Object.freeze(Object.defineProperty({__proto__:null,category:Dx,default:L$,height:Lx,id:zx,label:Fx,name:Mx,source:Wx,svg:Bx,terminals:Hx,viewBox:Rx,width:Ox},Symbol.toStringTag,{value:"Module"})),qx="triac",Gx="双向晶闸管 (V)",Vx="passive",Kx="双向三极晶闸管 (TRIAC)。",Ux="-22 -42 44 44",Xx=44,Yx=44,Zx='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-20,-30 0,-30 -10,-10" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-30" x2="-10" y2="-30" fill="none" stroke="black" stroke-width="1"/><polygon points="0,-10 10,-30 20,-10" fill="none" stroke="black" stroke-width="1"/><polyline points="20,0 18,0 14,-10" fill="none" stroke="black" stroke-width="1"/>',Qx=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],Jx={x:6,y:-20,anchor:"start"},ew={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_04/en_60617_05_04_11.elmt",qetEnglishName:"Bidirectional triode thyristor; Triac"},H$={id:qx,name:Gx,category:Vx,description:Kx,viewBox:Ux,width:Xx,height:Yx,svg:Zx,terminals:Qx,label:Jx,source:ew},F$=Object.freeze(Object.defineProperty({__proto__:null,category:Vx,default:H$,description:Kx,height:Yx,id:qx,label:Jx,name:Gx,source:ew,svg:Zx,terminals:Qx,viewBox:Ux,width:Xx},Symbol.toStringTag,{value:"Module"})),tw="undervoltage-relay",nw="欠压继电器 (27)",ow="protection",rw="欠电压保护继电器 (ANSI 27)。",iw="-62 -82 64 84",aw=64,sw=84,lw='<rect x="-60" y="-80" width="60" height="80" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-49" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">130 %</text><text x="-55" y="-32.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">50...80 V</text><text x="-41" y="-53.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">U &lt;</text>',cw=[{id:"t_top",x:-30,y:-80,orientation:"n"}],dw={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_07.elmt",qetEnglishName:"Undervoltage relay"},W$={id:tw,name:nw,category:ow,description:rw,viewBox:iw,width:aw,height:sw,svg:lw,terminals:cw,source:dw},q$=Object.freeze(Object.defineProperty({__proto__:null,category:ow,default:W$,description:rw,height:sw,id:tw,name:nw,source:dw,svg:lw,terminals:cw,viewBox:iw,width:aw},Symbol.toStringTag,{value:"Module"})),uw="ups",mw="不间断电源 (UPS)",pw="source",hw="在线 / 后备式不间断电源。",fw="-26 -42 52 84",gw=52,bw=84,yw='<rect x="-24" y="-20" width="48" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">UPS</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',xw=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],ww=[{name:"S",label:"容量",type:"number",unit:"kVA"}],vw={kind:"inline"},G$={id:uw,name:mw,category:pw,description:hw,viewBox:fw,width:gw,height:bw,svg:yw,terminals:xw,params:ww,source:vw},V$=Object.freeze(Object.defineProperty({__proto__:null,category:pw,default:G$,description:hw,height:bw,id:uw,name:mw,params:ww,source:vw,svg:yw,terminals:xw,viewBox:fw,width:gw},Symbol.toStringTag,{value:"Module"})),kw="varmeter",Sw="无功功率表 (var)",_w="measurement",Cw="无功功率表 (var)。",$w="-22 -42 44 44",jw=44,Aw=44,Ew='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">var</text>',Nw=[{id:"t_top",x:0,y:-40,orientation:"n"}],Tw={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_04.elmt",qetEnglishName:"Varmeter"},K$={id:kw,name:Sw,category:_w,description:Cw,viewBox:$w,width:jw,height:Aw,svg:Ew,terminals:Nw,source:Tw},U$=Object.freeze(Object.defineProperty({__proto__:null,category:_w,default:K$,description:Cw,height:Aw,id:kw,name:Sw,source:Tw,svg:Ew,terminals:Nw,viewBox:$w,width:jw},Symbol.toStringTag,{value:"Module"})),Pw="vfd",Iw="变频器 (VFD)",zw="motor-control",Mw="Variable Frequency Drive — 异步电动机调速。",Dw="-24 -42 48 84",Rw=48,Ow=84,Lw='<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="6" y="14" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~f</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Bw=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],Hw={kind:"inline"},X$={id:Pw,name:Iw,category:zw,description:Mw,viewBox:Dw,width:Rw,height:Ow,svg:Lw,terminals:Bw,source:Hw},Y$=Object.freeze(Object.defineProperty({__proto__:null,category:zw,default:X$,description:Mw,height:Ow,id:Pw,name:Iw,source:Hw,svg:Lw,terminals:Bw,viewBox:Dw,width:Rw},Symbol.toStringTag,{value:"Module"})),Fw="voltage-regulator",Ww="调压器 (T)",qw="transformer",Gw="可调感应调压器 / 自耦调压器。",Vw="-17 -32 38 64",Kw=38,Uw=64,Xw='<line x1="-5" y1="21" x2="5" y2="17" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-16.05" x2="4.95" y2="-20.05" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-5" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="0" rx="15" ry="15" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-20.05" x2="4.95" y2="-24.05" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="23" x2="5" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-18.05" x2="4.95" y2="-22.05" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="25" x2="5" y2="21" fill="none" stroke="black" stroke-width="1"/><line x1="-15" y1="15" x2="15" y2="-15" fill="none" stroke="black" stroke-width="1"/><polygon points="13,-16 16,-13 19,-19" fill="black" stroke="black" stroke-width="0.4"/>',Yw=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Zw=[{name:"ratio",label:"调压范围",type:"string",showOnCanvas:!0}],Qw={kind:"elmt",path:"11_singlepole/340_converters_inverters/10_converters/regulator_ind_3f_1.elmt",qetEnglishName:"Voltage regulator"},Z$={id:Fw,name:Ww,category:qw,description:Gw,viewBox:Vw,width:Kw,height:Uw,svg:Xw,terminals:Yw,params:Zw,source:Qw},Q$=Object.freeze(Object.defineProperty({__proto__:null,category:qw,default:Z$,description:Gw,height:Uw,id:Fw,name:Ww,params:Zw,source:Qw,svg:Xw,terminals:Yw,viewBox:Vw,width:Kw},Symbol.toStringTag,{value:"Module"})),Jw="voltmeter",ev="电压表 (V)",tv="measurement",nv="-22 -42 44 44",ov=44,rv=44,iv='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-4" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">V</text>',av=[{id:"t_top",x:0,y:-40,orientation:"n"}],sv={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_01.elmt",qetEnglishName:"Voltmeter"},J$={id:Jw,name:ev,category:tv,viewBox:nv,width:ov,height:rv,svg:iv,terminals:av,source:sv},ej=Object.freeze(Object.defineProperty({__proto__:null,category:tv,default:J$,height:rv,id:Jw,name:ev,source:sv,svg:iv,terminals:av,viewBox:nv,width:ov},Symbol.toStringTag,{value:"Module"})),lv="wattmeter",cv="功率表 (W)",dv="measurement",uv="-22 -42 44 44",mv=44,pv=44,hv='<rect x="-20" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-6" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">W</text>',fv=[{id:"t_top",x:0,y:-40,orientation:"n"}],gv={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_03/en_60617_08_03_01.elmt",qetEnglishName:"Recording wattmeter"},tj={id:lv,name:cv,category:dv,viewBox:uv,width:mv,height:pv,svg:hv,terminals:fv,source:gv},nj=Object.freeze(Object.defineProperty({__proto__:null,category:dv,default:tj,height:pv,id:lv,name:cv,source:gv,svg:hv,terminals:fv,viewBox:uv,width:mv},Symbol.toStringTag,{value:"Module"})),bv="wind-turbine",yv="风力发电机",xv="renewable",wv="风机:发电机 + 三叶轮标记",vv="-22 -46 44 68",kv=44,Sv=68,_v='<circle cx="0" cy="0" r="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="16">G</text><line x1="0" y1="-20" x2="0" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-32" x2="-10" y2="-39" fill="none" stroke="black" stroke-width="1.5"/><line x1="0" y1="-32" x2="10" y2="-39" fill="none" stroke="black" stroke-width="1.5"/><line x1="0" y1="-32" x2="0" y2="-44" fill="none" stroke="black" stroke-width="1.5"/>',Cv=[{id:"t_bottom",x:0,y:20,orientation:"s"}],$v={kind:"inline"},oj={id:bv,name:yv,category:xv,description:wv,viewBox:vv,width:kv,height:Sv,svg:_v,terminals:Cv,source:$v},rj=Object.freeze(Object.defineProperty({__proto__:null,category:xv,default:oj,description:wv,height:Sv,id:bv,name:yv,source:$v,svg:_v,terminals:Cv,viewBox:vv,width:kv},Symbol.toStringTag,{value:"Module"})),jv="zener-diode",Av="稳压二极管 (D)",Ev="passive",Nv="齐纳 / 稳压二极管。t1=阳极(上), t2=阴极(下)。",Tv="-12 -42 24 44",Pv=24,Iv=44,zv='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-15" x2="-10" y2="-10" fill="none" stroke="black" stroke-width="1"/>',Mv=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],Dv={x:6,y:-20,anchor:"start"},Rv={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_06.elmt",qetEnglishName:"Breakdown diode, unidirectional; Zener diode"},ij={id:jv,name:Av,category:Ev,description:Nv,viewBox:Tv,width:Pv,height:Iv,svg:zv,terminals:Mv,label:Dv,source:Rv},aj=Object.freeze(Object.defineProperty({__proto__:null,category:Ev,default:ij,description:Nv,height:Iv,id:jv,label:Dv,name:Av,source:Rv,svg:zv,terminals:Mv,viewBox:Tv,width:Pv},Symbol.toStringTag,{value:"Module"})),sj=Object.assign({"./ammeter.json":BS,"./arc-suppression-coil.json":FS,"./arrester.json":qS,"./async-motor.json":VS,"./autotransformer.json":US,"./battery.json":YS,"./bell.json":QS,"./break-contact.json":e_,"./breaker.json":n_,"./buchholz-relay.json":r_,"./busbar.json":a_,"./buzzer.json":l_,"./capacitor.json":d_,"./contactor.json":m_,"./converter-bidir.json":h_,"./ct.json":g_,"./dc-combiner.json":y_,"./dc-dc-converter.json":w_,"./dc-disconnector.json":k_,"./dc-motor.json":__,"./diode.json":$_,"./disconnector.json":A_,"./distance-relay.json":N_,"./earth.json":P_,"./earthing-switch.json":z_,"./energy-meter.json":D_,"./ev-charger.json":O_,"./frequency-meter.json":B_,"./fuse-switch-disconnector.json":F_,"./fuse.json":q_,"./generator.json":V_,"./genset.json":U_,"./gfci-breaker.json":Y_,"./grid-source.json":Q_,"./grounding-transformer.json":eC,"./heater.json":nC,"./igbt.json":rC,"./indicator-light.json":aC,"./inductor.json":lC,"./inverter.json":dC,"./limit-switch.json":mC,"./load-switch.json":hC,"./load.json":gC,"./luminaire.json":yC,"./make-contact.json":wC,"./motor-starter.json":kC,"./mppt.json":_C,"./ngr.json":$C,"./overcurrent-relay.json":AC,"./panelboard.json":NC,"./phase-failure-relay.json":PC,"./plc.json":zC,"./power-factor-meter.json":DC,"./power-supply.json":OC,"./protective-relay.json":BC,"./proximity-switch.json":FC,"./pt.json":qC,"./push-button.json":VC,"./pv.json":UC,"./rcd.json":YC,"./recloser.json":QC,"./rectifier.json":e$,"./relay-coil.json":n$,"./resistor.json":r$,"./reverse-power-relay.json":a$,"./selector-switch.json":l$,"./series-reactor.json":d$,"./shunt-capacitor.json":m$,"./shunt-reactor.json":h$,"./siren.json":g$,"./socket-outlet.json":y$,"./soft-starter.json":w$,"./sync-motor.json":k$,"./synchronoscope.json":_$,"./terminal.json":$$,"./thermal-overload.json":A$,"./thermocouple.json":N$,"./thyristor.json":P$,"./time-relay.json":z$,"./transfer-switch.json":D$,"./transformer-2w.json":O$,"./transformer-3w.json":B$,"./triac.json":F$,"./undervoltage-relay.json":q$,"./ups.json":V$,"./varmeter.json":U$,"./vfd.json":Y$,"./voltage-regulator.json":Q$,"./voltmeter.json":ej,"./wattmeter.json":nj,"./wind-turbine.json":rj,"./zener-diode.json":aj}),Ov=Object.values(sj).map(e=>e.default),rt=Object.fromEntries(Ov.map(e=>[e.id,e])),Ar=["busbar","switching","protection","motor-control","control","transformer","instrument-transformer","measurement","source","load","storage","compensation","passive","grounding","renewable"],lj=(()=>{var t;const e={};for(const n of Ov)(e[t=n.category]??(e[t]=[])).push(n);return e})(),ho=new Map(Object.entries(rt));function Lv(e){return rt[e]}function cj(e){const n=[...e].sort().join("|");let o=2166136261;for(let r=0;r<n.length;r++)o^=n.charCodeAt(r),o=Math.imul(o,16777619);return`n_${(o>>>0).toString(36)}`}const dj=320;function tt(e){var v,T,I,H,K;const t=ea(),n=new Map;e.elements.forEach((_,F)=>{if(n.has(_.id)){t.diagnostics.push({code:"E001",severity:"error",message:Se("compile.duplicateId",{id:_.id}),pointer:`/elements/${F}`});return}n.set(_.id,_);const W=ho.get(_.kind);W||t.diagnostics.push({code:"E003",severity:"error",message:`${Se("compile.unknownKind",{kind:_.kind})} (id=${_.id})`,pointer:`/elements/${F}`}),t.elements.set(_.id,{element:_,libraryDef:W})});const o=new Map,r=new Map;(e.buses??[]).forEach((_,F)=>{if(n.has(_.id)||o.has(_.id)){t.diagnostics.push({code:"E001",severity:"error",message:Se("compile.duplicateId",{id:_.id}),pointer:`/buses/${F}`});return}if(o.set(_.id,_),_.layout){const W=_.layout.rot??0;r.set(_.id,{at:_.layout.at,span:_.layout.span,rot:W,axis:mo(W)})}});const i=new Map;(e.junctions??[]).forEach((_,F)=>{if(n.has(_.id)||o.has(_.id)||i.has(_.id)){t.diagnostics.push({code:"E001",severity:"error",message:Se("compile.duplicateId",{id:_.id}),pointer:`/junctions/${F}`});return}i.set(_.id,_)});const a=_=>!_.includes(".")&&o.has(_),s=_=>!_.includes(".")&&i.has(_),l=(_,F)=>{if(a(_)||s(_))return!0;const W=_.indexOf(".");if(W<=0)return t.diagnostics.push({code:"E003",severity:"error",message:Se("compile.invalidTermRef",{ref:_}),pointer:F}),!1;const G=_.slice(0,W),z=_.slice(W+1),B=t.elements.get(G);if(!B)return t.diagnostics.push({code:"E002",severity:"error",message:Se("compile.elementMissing",{id:G}),pointer:F}),!1;if(!B.libraryDef)return!1;if(!B.libraryDef.terminals.find(Q=>Q.id===z)){const Q=B.libraryDef.terminals.map(ae=>ae.id).join(", ");return t.diagnostics.push({code:"E003",severity:"error",message:Se("compile.missingPin",{id:G,kind:B.element.kind,pin:z,available:Q}),pointer:F}),!1}return!0},c=[];(e.wires??[]).forEach((_,F)=>{const W=`/wires/${F}`,G=l(_.ends[0],W),z=l(_.ends[1],W);G&&z&&c.push(_)});const m=new Map;if(e.layout)for(const[_,F]of Object.entries(e.layout))t.elements.has(_)?m.set(_,ta(F)):t.diagnostics.push({code:"E004",severity:"error",message:Se("compile.layoutMissingElement",{id:_}),pointer:`/layout/${_}`});const u=RS({elements:e.elements,buses:e.buses??[],junctions:e.junctions??[],wires:c,library:ho,userLayout:m,userBusLayout:r});t.layout=u.devices;for(const[_,F]of u.buses){const W=o.get(_);W&&t.buses.set(_,{bus:W,geometry:F})}for(const[_,F]of o)t.buses.has(_)||t.buses.set(_,{bus:F,geometry:{at:((v=F.layout)==null?void 0:v.at)??[0,0],span:((T=F.layout)==null?void 0:T.span)??dj,rot:((I=F.layout)==null?void 0:I.rot)??0,axis:mo(((H=F.layout)==null?void 0:H.rot)??0)}});for(const _ of t.elements.values()){if(!_.libraryDef)continue;const F=t.layout.get(_.element.id);if(!F)continue;const W=[];for(const G of _.libraryDef.terminals){const z=`${_.element.id}.${G.id}`,B=Me([G.x,G.y],F),Q=Rt(G.orientation,F);t.terminals.set(z,{ref:z,elementId:_.element.id,pin:G.id,world:B,orientation:Q}),W.push(z)}t.elementToTerminals.set(_.element.id,W)}const p=new Map,f=new Set;for(const[_,F]of i)(K=F.layout)!=null&&K.at?(p.set(_,[F.layout.at[0],F.layout.at[1]]),f.add(_)):u.junctions.has(_)&&(p.set(_,u.junctions.get(_)),f.add(_));const h=_=>{if(!_.includes(".")){const W=t.buses.get(_);return W?W.geometry.at:p.get(_)??null}const F=t.terminals.get(_);return F?F.world:null},g=new Map;for(const[_]of i)f.has(_)||g.set(_,[]);for(const _ of c){const[F,W]=_.ends;g.has(F)&&g.get(F).push(W),g.has(W)&&g.get(W).push(F)}for(let _=0;_<12;_++){let F=!1;for(const[W,G]of g){let z=0,B=0,Q=0;for(const se of G){const he=h(se);he&&(z+=he[0],B+=he[1],Q++)}if(!Q)continue;const ae=z/Q,ue=B/Q,ee=p.get(W);(!ee||Math.abs(ee[0]-ae)>.01||Math.abs(ee[1]-ue)>.01)&&(p.set(W,[ae,ue]),F=!0)}if(!F)break}const b=new Map;for(const[_]of i)b.set(_,0);for(const _ of c)for(const F of _.ends){const W=b.get(F);W!==void 0&&b.set(F,W+1)}for(const[_,F]of i)t.junctions.set(_,{junction:F,world:p.get(_)??[0,0],degree:b.get(_)??0});const x=new na;for(const _ of c)x.add(_.ends[0]),x.add(_.ends[1]),x.union(_.ends[0],_.ends[1]);for(const[,_]of x.groups()){const F=cj(_);t.nodes.set(F,{id:F,terminals:_});for(const W of _)t.terminalToNode.set(W,F)}for(const _ of t.elements.values()){const F=t.elementToTerminals.get(_.element.id)??[];if(F.length===0)continue;F.some(G=>t.terminalToNode.has(G))||t.diagnostics.push({code:"W001",severity:"warning",message:Se("compile.elementUnconnected",{id:_.element.id})})}for(const _ of t.buses.keys())t.terminalToNode.has(_)||t.diagnostics.push({code:"W001",severity:"warning",message:Se("compile.elementUnconnected",{id:_})});for(const _ of t.junctions.keys())t.terminalToNode.has(_)||t.diagnostics.push({code:"W001",severity:"warning",message:Se("compile.elementUnconnected",{id:_})});for(const _ of c){if(_.path&&_.path.length>=2){const W=_.path,G=W.length>=2?W[1]:null,z=W.length>=2?W[W.length-2]:null,B=$r(_.ends[0],G,t),Q=$r(_.ends[1],z,t);if(B&&Q){const ae=[[B[0],B[1]],...W.slice(1,-1).map(ee=>[ee[0],ee[1]]),[Q[0],Q[1]]],ue=Ji(ae);if(ue.length>=2){t.wireRenders.set(_.id,{wireId:_.id,path:ue,userEdited:!0,..._.label?{label:_.label}:{}});continue}}}const F=OS(_,t);F&&t.wireRenders.set(_.id,_.label?{...F,label:_.label}:F)}return t}const uj={earth:"GND",breaker:"QF",disconnector:"QS","earthing-switch":"QE","load-switch":"QL",fuse:"FU","transformer-2w":"T","transformer-3w":"T",autotransformer:"AT",ct:"CT",pt:"PT",generator:"G","sync-motor":"M","async-motor":"M","grid-source":"L",load:"L",battery:"BAT","shunt-reactor":"LR","series-reactor":"LR","shunt-capacitor":"C",arrester:"FBL","grounding-transformer":"TG",ngr:"NGR","arc-suppression-coil":"ASC",pv:"PV","wind-turbine":"WT",rectifier:"RT",inverter:"INV","converter-bidir":"PCS"},Er="B",Nr="J";function Do(e){return new Set([...e.elements.map(t=>t.id),...(e.buses??[]).map(t=>t.id),...(e.junctions??[]).map(t=>t.id)])}function Ft(e,t){const n=uj[t]??t,o=Do(e);let r=1;for(;o.has(`${n}${r}`);)r++;return`${n}${r}`}function fo(e){const t=Do(e);let n=1;for(;t.has(`${Er}${n}`);)n++;return`${Er}${n}`}function go(e){const t=Do(e);let n=1;for(;t.has(`${Nr}${n}`);)n++;return`${Nr}${n}`}function gn(e){const t=new Set((e.annotations??[]).map(o=>o.id));let n=1;for(;t.has(`a${n}`);)n++;return`a${n}`}function lt(e,t){const n=[e,t].sort(),o=`${n[0]}|${n[1]}`;let r=2166136261;for(let i=0;i<o.length;i++)r^=o.charCodeAt(i),r=Math.imul(r,16777619);return`w_${(r>>>0).toString(36)}`}function Xn(e,t,n){if(n.length===0)return n;const o=new Set(n.map(s=>s.id)),r=new Set(t.map(s=>s.id)),i=new Set;for(const s of e)if(!r.has(s.id))for(const l of s.ends)o.has(l)&&i.add(l);if(i.size===0)return n;const a=new Set;for(const s of t)for(const l of s.ends)i.has(l)&&a.add(l);return n.filter(s=>!i.has(s.id)||a.has(s.id))}const Tr={version:"1",elements:[]},mj=100,Yn=20;function pj(){if(typeof window>"u")return"select";try{return window.matchMedia("(pointer: coarse)").matches?"pan":"select"}catch{return"select"}}const y=An()(NS((e,t)=>({diagram:Tr,internal:tt(Tr),fileSession:null,activeTool:pj(),placeKind:null,lastPlaceKind:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,busbarDrawStart:null,cursorSvg:null,selection:[],selectedWire:null,selectedNode:null,selectedAnnotation:null,editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,editingElement:null,readOnly:!1,past:[],future:[],clipboard:null,clipboardPasteIndex:0,setDiagram:n=>e({diagram:n,internal:tt(n),past:[],future:[],selection:[],selectedWire:null,selectedNode:null,selectedAnnotation:null,editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,editingElement:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null}),setFileSession:n=>e({fileSession:n}),setReadOnly:n=>e({readOnly:n}),loadDiagramFromFile:(n,o)=>e({diagram:n,internal:tt(n),fileSession:o,past:[],future:[],selection:[],selectedWire:null,selectedNode:null,selectedAnnotation:null,editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,editingElement:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null}),dispatch:n=>{const{diagram:o,past:r}=t(),i=n(o);if(i===o)return;const a=r.length>=mj?r.slice(1):r;e({diagram:i,internal:tt(i),past:[...a,o],future:[],annotationPreview:null})},undo:()=>{const{past:n,future:o,diagram:r}=t();if(n.length===0)return;const i=n[n.length-1];e({diagram:i,internal:tt(i),past:n.slice(0,-1),future:[...o,r],wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,annotationPreview:null})},redo:()=>{const{past:n,future:o,diagram:r}=t();if(o.length===0)return;const i=o[o.length-1];e({diagram:i,internal:tt(i),past:[...n,r],future:o.slice(0,-1),wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,annotationPreview:null})},setActiveTool:(n,o)=>{const r=t();let i;(o==null?void 0:o.placeKind)!==void 0?i=o.placeKind:n==="place"?i=r.placeKind??r.lastPlaceKind:i=null,e({activeTool:n,placeKind:i,lastPlaceKind:i??r.lastPlaceKind,wireFromTerminal:n==="wire"?r.wireFromTerminal:null,wireDragFrom:n==="wire"?r.wireDragFrom:null,placeFromTerminal:n==="place"?r.placeFromTerminal:null,annotationDraft:null})},setPlaceKind:n=>e(o=>({placeKind:n,lastPlaceKind:n??o.lastPlaceKind})),setWireFromTerminal:n=>e({wireFromTerminal:n}),setWireDragFrom:n=>e({wireDragFrom:n}),setPlaceFromTerminal:n=>e({placeFromTerminal:n}),setBusbarDrawStart:n=>e({busbarDrawStart:n}),setCursorSvg:n=>e({cursorSvg:n}),setSelection:n=>e({selection:hj(n),selectedWire:null,selectedNode:null,selectedAnnotation:n.length?null:t().selectedAnnotation}),toggleInSelection:n=>{const o=t().selection;e({selection:o.includes(n)?o.filter(r=>r!==n):[...o,n],selectedWire:null,selectedNode:null,selectedAnnotation:null})},clearSelection:()=>e({selection:[],selectedWire:null,selectedNode:null,selectedAnnotation:null,editingAnnotation:null,editingCell:null,editingElement:null}),setSelectedWire:n=>e({selectedWire:n,selection:n?[]:t().selection,selectedNode:null,selectedAnnotation:n?null:t().selectedAnnotation}),setSelectedNode:n=>e({selectedNode:n,selection:n?[]:t().selection,selectedWire:null,selectedAnnotation:n?null:t().selectedAnnotation}),setSelectedAnnotation:n=>e({selectedAnnotation:n,selection:n?[]:t().selection,selectedWire:n?null:t().selectedWire,selectedNode:n?null:t().selectedNode,editingAnnotation:n?t().editingAnnotation:null,editingCell:n?t().editingCell:null}),setEditingAnnotation:n=>e({editingAnnotation:n,selectedAnnotation:n??t().selectedAnnotation,editingElement:n?null:t().editingElement,editingCell:null}),setEditingCell:n=>e({editingCell:n}),setAnnotationDraft:n=>e({annotationDraft:n}),setAnnotationPreview:n=>e({annotationPreview:n}),setEditingElement:n=>e({editingElement:n,selection:n?[n]:t().selection,editingAnnotation:n?null:t().editingAnnotation,selectedAnnotation:n?null:t().selectedAnnotation,selectedWire:n?null:t().selectedWire,selectedNode:n?null:t().selectedNode}),copySelection:()=>{var f;const{selection:n,selectedAnnotation:o,diagram:r,internal:i}=t();if(n.length===0){if(!o)return;const h=(r.annotations??[]).find(g=>g.id===o);if(!h)return;e({clipboard:{elements:[],buses:[],junctions:[],placements:{},busLayouts:{},wires:[],annotations:[structuredClone(h)]},clipboardPasteIndex:0});return}const a=new Set(n),s=r.elements.filter(h=>a.has(h.id)).map(h=>structuredClone(h)),l=(r.buses??[]).filter(h=>a.has(h.id)).map(h=>structuredClone(h)),c=(r.junctions??[]).filter(h=>a.has(h.id)).map(h=>{var b;const g=structuredClone(h);if(!g.layout){const x=(b=i.junctions.get(h.id))==null?void 0:b.world;x&&(g.layout={at:[x[0],x[1]]})}return g}),m={};for(const h of n)if(a.has(h)&&!i.buses.has(h)){const g=(f=r.layout)==null?void 0:f[h];if(g){m[h]=structuredClone(g);continue}const b=i.layout.get(h);b&&(m[h]=an(b))}const u={};for(const h of n){const g=i.buses.get(h);g&&(u[h]=mt(g.geometry))}const p=(r.wires??[]).filter(h=>h.ends.every(g=>a.has(Zn(g)))).map(h=>structuredClone(h));e({clipboard:{elements:s,buses:l,junctions:c,placements:m,busLayouts:u,wires:p,annotations:[]},clipboardPasteIndex:0})},cutSelection:()=>{const{selection:n,selectedAnnotation:o}=t();n.length===0&&!o||(t().copySelection(),n.length===0&&o?t().deleteAnnotation(o):t().deleteSelection())},pasteClipboard:()=>{const{clipboard:n,clipboardPasteIndex:o,diagram:r}=t();if(!n)return;if(n.elements.length===0&&n.buses.length===0&&n.junctions.length===0){const u=n.annotations??[];if(u.length===0)return;const p=o+1,f=Yn*p;let h=null;t().dispatch(g=>{let b=g;for(const x of u){const v=gn(b);h=v;const T={...structuredClone(x),id:v,at:[x.at[0]+f,x.at[1]+f]};b={...b,annotations:[...b.annotations??[],T]}}return b}),h&&e({selectedAnnotation:h,selection:[],selectedWire:null,selectedNode:null,clipboardPasteIndex:p});return}const i=o+1,a=Yn*i,s=Yn*i,l=new Map;let c=r;for(const u of n.elements){const p=Ft(c,u.kind);l.set(u.id,p),c={...c,elements:[...c.elements,{id:p,kind:u.kind}]}}for(const u of n.buses){const p=fo(c);l.set(u.id,p),c={...c,buses:[...c.buses??[],{id:p}]}}for(const u of n.junctions){const p=go(c);l.set(u.id,p),c={...c,junctions:[...c.junctions??[],{id:p}]}}const m=u=>{const p=u.indexOf("."),f=p<0?u:u.slice(0,p),h=l.get(f);return h?p<0?h:`${h}${u.slice(p)}`:u};t().dispatch(u=>{const p=n.elements.map(v=>{const T=structuredClone(v);return T.id=l.get(v.id),T}),f=n.buses.map(v=>{const T=structuredClone(v);T.id=l.get(v.id);const I=n.busLayouts[v.id];return I&&(T.layout={...I,at:[I.at[0]+a,I.at[1]+s]}),T}),h=n.junctions.map(v=>{const T=structuredClone(v);return T.id=l.get(v.id),T.layout&&(T.layout={at:[T.layout.at[0]+a,T.layout.at[1]+s]}),T}),g={...u.layout??{}};for(const[v,T]of l){const I=n.placements[v];I&&(g[T]={...I,at:[I.at[0]+a,I.at[1]+s]})}const b=n.wires.map(v=>{const T=[m(v.ends[0]),m(v.ends[1])];return{id:lt(T[0],T[1]),ends:T,...v.label?{label:v.label}:{}}}),x=Pr(u.wires??[],b);return{...u,elements:[...u.elements,...p],buses:f.length?[...u.buses??[],...f]:u.buses,junctions:h.length?[...u.junctions??[],...h]:u.junctions,wires:x.length?x:void 0,layout:Object.keys(g).length?g:void 0}}),e({selection:Array.from(l.values()),clipboardPasteIndex:i})},autoArrangeAll:()=>{t().dispatch(n=>{var l;const o=n.layout&&Object.keys(n.layout).length>0,r=(n.buses??[]).some(c=>c.layout);if(!o&&!r)return n;const{layout:i,...a}=n,s=(l=n.buses)==null?void 0:l.map(c=>{const{layout:m,...u}=c;return u});return{...a,buses:s}})},autoArrangeSelection:()=>{const{selection:n}=t();if(n.length===0)return;const o=new Set(n);t().dispatch(r=>{let i=!1,a=r.layout;if(a){const l={};for(const[c,m]of Object.entries(a)){if(o.has(c)){i=!0;continue}l[c]=m}i&&(a=Object.keys(l).length?l:void 0)}let s=r.buses;if(s){const l=s.map(c=>{if(o.has(c.id)&&c.layout){i=!0;const{layout:m,...u}=c;return u}return c});i&&(s=l)}return i?{...r,layout:a,buses:s}:r})},fillUnplacedAll:()=>{const n=t().internal;t().dispatch(o=>{const r=o.layout??{},i={};for(const l of o.elements){if(r[l.id])continue;const c=n.layout.get(l.id);c&&(i[l.id]=an(c))}const a=[];if((o.buses??[]).forEach((l,c)=>{l.layout||n.buses.has(l.id)&&a.push({idx:c,bus:l})}),Object.keys(i).length===0&&a.length===0)return o;let s=o.buses;return a.length>0&&s&&(s=s.map(l=>{const c=n.buses.get(l.id);return!l.layout&&c?{...l,layout:mt(c.geometry)}:l})),{...o,layout:{...r,...i},buses:s}})},fillUnplacedSelection:()=>{const{selection:n,internal:o}=t();n.length!==0&&t().dispatch(r=>{var c;const i=r.layout??{},a={},s=new Map;for(const m of n)if(o.buses.has(m)){const u=o.buses.get(m);(c=r.buses)!=null&&c.find(p=>p.id===m&&p.layout)||s.set(m,mt(u.geometry))}else{if(i[m])continue;const u=o.layout.get(m);u&&(a[m]=an(u))}if(Object.keys(a).length===0&&s.size===0)return r;let l=r.buses;return s.size>0&&l&&(l=l.map(m=>s.has(m.id)?{...m,layout:s.get(m.id)}:m)),{...r,layout:{...i,...a},buses:l}})},moveElements:n=>{if(n.size===0)return;const o=t().internal;t().dispatch(r=>{const i={...r.layout??{}},a=new Map,s=new Map;for(const[m,u]of n){if(o.buses.has(m)){a.set(m,u);continue}if(o.junctions.has(m)){s.set(m,u);continue}const p=o.layout.get(m),f=i[m]??(p?an(p):{at:[0,0]});i[m]={...f,at:[f.at[0]+u[0],f.at[1]+u[1]]}}let l=r.buses;a.size>0&&(l=(r.buses??[]).map(m=>{const u=a.get(m.id);if(!u)return m;const p=m.layout??mt(o.buses.get(m.id).geometry);return{...m,layout:{...p,at:[p.at[0]+u[0],p.at[1]+u[1]]}}}));let c=r.junctions;return s.size>0&&(c=(r.junctions??[]).map(m=>{var f,h;const u=s.get(m.id);if(!u)return m;const p=((f=m.layout)==null?void 0:f.at)??((h=o.junctions.get(m.id))==null?void 0:h.world)??[0,0];return{...m,layout:{at:[p[0]+u[0],p[1]+u[1]]}}})),{...r,layout:i,buses:l,junctions:c}})},deleteSelection:()=>{const{selection:n}=t();if(n.length===0)return;const o=new Set(n);t().dispatch(r=>{const i=r.elements.filter(u=>!o.has(u.id)),a=(r.buses??[]).filter(u=>!o.has(u.id)),s=(r.junctions??[]).filter(u=>!o.has(u.id)),l=(r.wires??[]).filter(u=>!o.has(Zn(u.ends[0]))&&!o.has(Zn(u.ends[1]))),c=Xn(r.wires??[],l,s),m=r.layout?Object.fromEntries(Object.entries(r.layout).filter(([u])=>!o.has(u))):void 0;return{...r,elements:i,buses:a.length?a:void 0,junctions:c.length?c:void 0,wires:l.length?l:void 0,layout:m&&Object.keys(m).length?m:void 0}}),e({selection:[]})},deleteSelectedWire:()=>{const{selectedWire:n,internal:o}=t();if(!n)return;const r=(t().diagram.wires??[]).find(a=>a.id===n),i=new Set;if(r)for(const a of r.ends){const s=a.indexOf(".");s>0&&i.add(a.slice(0,s))}t().dispatch(a=>{const s=a.wires??[],l=s.filter(u=>u.id!==n);if(l.length===s.length)return a;const c={...a.layout??{}};for(const u of i){if(c[u])continue;const p=o.layout.get(u);if(!p)continue;const f={at:p.at};p.rot&&(f.rot=p.rot),p.mirror&&(f.mirror=p.mirror),c[u]=f}const m=Xn(s,l,a.junctions??[]);return{...a,wires:l.length?l:void 0,junctions:m.length?m:void 0,layout:Object.keys(c).length?c:void 0}}),e({selectedWire:null})},deleteSelectedNode:()=>{const{selectedNode:n,internal:o}=t();if(!n)return;const r=o.nodes.get(n);if(!r)return;const i=new Set(r.terminals),a=new Set;for(const s of r.terminals){const l=s.indexOf(".");l>0&&a.add(s.slice(0,l))}t().dispatch(s=>{const l={...s.layout??{}};for(const p of a){if(l[p])continue;const f=o.layout.get(p);if(!f)continue;const h={at:f.at};f.rot&&(h.rot=f.rot),f.mirror&&(h.mirror=f.mirror),l[p]=h}const c=s.wires??[],m=c.filter(p=>!i.has(p.ends[0])&&!i.has(p.ends[1])),u=Xn(c,m,s.junctions??[]);return{...s,wires:m.length?m:void 0,junctions:u.length?u:void 0,layout:Object.keys(l).length?l:void 0}}),e({selectedNode:null})},rotateSelection:n=>{const{selection:o,internal:r}=t();o.length!==0&&t().dispatch(i=>{var c,m,u,p;const a={...i.layout??{}},s=new Map;for(const f of o){if(r.junctions.has(f))continue;if(r.buses.has(f)){const b=r.buses.get(f),v=(((((u=(m=(c=i.buses)==null?void 0:c.find(T=>T.id===f))==null?void 0:m.layout)==null?void 0:u.rot)??b.geometry.rot??0)+n)%360+360)%360;s.set(f,v);continue}const h=a[f]??{at:((p=r.layout.get(f))==null?void 0:p.at)??[0,0]},g=(((h.rot??0)+n)%360+360)%360;a[f]={...h,rot:g}}let l=i.buses;return s.size>0&&(l=(i.buses??[]).map(f=>{if(!s.has(f.id))return f;const h=f.layout??mt(r.buses.get(f.id).geometry);return{...f,layout:{...h,rot:s.get(f.id)}}})),{...i,layout:a,buses:l}})},mirrorSelection:()=>{const{selection:n,internal:o}=t();n.length!==0&&t().dispatch(r=>{var a;const i={...r.layout??{}};for(const s of n){if(o.buses.has(s)||o.junctions.has(s))continue;const l=i[s]??{at:((a=o.layout.get(s))==null?void 0:a.at)??[0,0]};i[s]={...l,mirror:!(l.mirror??!1)}}return{...r,layout:i}})},addElement:(n,o,r)=>{if(n==="busbar")return t().addBus(o,320);const i=Ft(t().diagram,n);return t().dispatch(a=>{const s={id:i,kind:n,...r??{}};return{...a,elements:[...a.elements,s],layout:{...a.layout??{},[i]:{at:o}}}}),e({selection:[i]}),i},addBus:(n,o,r)=>{const i=fo(t().diagram);return t().dispatch(a=>{const s={id:i,layout:r!==void 0?{at:n,span:o,rot:r}:{at:n,span:o}};return{...a,buses:[...a.buses??[],s]}}),e({selection:[i]}),i},addJunction:n=>{const o=go(t().diagram);return t().dispatch(r=>{const i={id:o,layout:{at:n}};return{...r,junctions:[...r.junctions??[],i]}}),e({selection:[o]}),o},updateJunction:(n,o)=>{t().dispatch(r=>({...r,junctions:(r.junctions??[]).map(i=>i.id===n?{...i,...o}:i)}))},addWire:(n,o)=>{if(n===o)return;const r=lt(n,o);t().dispatch(i=>{const a=i.wires??[];return a.some(s=>s.id===r)?i:{...i,wires:[...a,{id:r,ends:[n,o]}]}})},connectWire:(n,o)=>{t().dispatch(r=>{let i=r;const a=new Set([...i.elements.map(h=>h.id),...(i.buses??[]).map(h=>h.id),...(i.junctions??[]).map(h=>h.id)]),s=()=>{let h=1;for(;a.has(`J${h}`);)h++;const g=`J${h}`;return a.add(g),g},l=h=>{const g=s();return i={...i,junctions:[...i.junctions??[],{id:g,layout:{at:h}}]},g},c=h=>{if("end"in h)return h.end;if("junctionAt"in h)return l(h.junctionAt);const g=(i.wires??[]).find(T=>T.id===h.onWire),b=l(h.at);if(!g)return b;const x=(i.wires??[]).filter(T=>T.id!==h.onWire),v=(T,I)=>({id:lt(T,I),ends:[T,I],...g.label?{label:g.label}:{}});return i={...i,wires:Pr(x,[v(g.ends[0],b),v(b,g.ends[1])])},b},m=c(n),u=c(o);if(m===null||u===null||m===u)return i;const p=lt(m,u),f=i.wires??[];return f.some(h=>h.id===p)?i:{...i,wires:[...f,{id:p,ends:[m,u]}]}})},updateWirePath:(n,o)=>{t().dispatch(r=>{const i=r.wires??[];if(!i.some(c=>c.id===n))return r;const a=o&&o.length>=2?Ji(o):null,s=a&&a.length>=2?a:null,l=i.map(c=>{if(c.id!==n)return c;if(s)return{...c,path:s};const{path:m,...u}=c;return u});return{...r,wires:l}})},resetWirePath:n=>{t().updateWirePath(n,null)},updateWire:(n,o)=>{t().dispatch(r=>{const i=r.wires??[];return i.some(a=>a.id===n)?{...r,wires:i.map(a=>a.id===n?{...a,...o}:a)}:r})},updateElement:(n,o)=>{t().dispatch(r=>({...r,elements:r.elements.map(i=>i.id===n?{...i,...o}:i)}))},updatePlacement:(n,o)=>{t().dispatch(r=>{var s;const i=((s=r.layout)==null?void 0:s[n])??t().internal.layout.get(n),a={at:o.at??(i==null?void 0:i.at)??[0,0],...o.rot!==void 0?{rot:o.rot}:i!=null&&i.rot?{rot:i.rot}:{},...o.mirror!==void 0?{mirror:o.mirror}:i!=null&&i.mirror?{mirror:i.mirror}:{}};return{...r,layout:{...r.layout??{},[n]:a}}})},updateBus:(n,o)=>{t().dispatch(r=>{const i=(r.buses??[]).map(a=>{if(a.id!==n)return a;const s=t().internal,l=a.layout??(s.buses.has(n)?mt(s.buses.get(n).geometry):{at:[0,0],span:320}),c={at:o.at??l.at,span:o.span??l.span,...o.rot!==void 0?{rot:o.rot}:l.rot?{rot:l.rot}:{}};return{...a,layout:c}});return{...r,buses:i}})},addAnnotation:(n,o="")=>{const r=gn(t().diagram);return t().dispatch(i=>{const a={id:r,at:n,text:o};return{...i,annotations:[...i.annotations??[],a]}}),r},insertAnnotation:n=>{const o=gn(t().diagram);return t().dispatch(r=>({...r,annotations:[...r.annotations??[],{...n,id:o}]})),o},updateAnnotation:(n,o)=>{t().dispatch(r=>{const i=r.annotations??[];let a=!1;const s=i.map(l=>l.id!==n?l:(a=!0,{...l,...o,id:l.id}));return a?{...r,annotations:s}:r})},deleteAnnotation:n=>{var o;t().dispatch(r=>{const i=r.annotations??[],a=i.filter(s=>s.id!==n);return a.length===i.length?r:{...r,annotations:a.length?a:void 0}}),t().selectedAnnotation===n&&e({selectedAnnotation:null,editingAnnotation:null,editingCell:null}),((o=t().annotationPreview)==null?void 0:o.id)===n&&e({annotationPreview:null})}}),{name:"ole-editor",version:2,storage:Qi(()=>({getItem:e=>localStorage.getItem(e),setItem:(e,t)=>{y.getState().readOnly||localStorage.setItem(e,t)},removeItem:e=>localStorage.removeItem(e)})),partialize:e=>({diagram:e.diagram,activeTool:e.activeTool,placeKind:e.placeKind,lastPlaceKind:e.lastPlaceKind}),onRehydrateStorage:()=>e=>{e!=null&&e.diagram&&(e.internal=tt(e.diagram))}}));function hj(e){return Array.from(new Set(e))}function Zn(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}function Pr(e,t){const n=new Set(e.map(r=>r.id)),o=e.slice();for(const r of t)n.has(r.id)||(n.add(r.id),o.push(r));return o}function an(e){return{at:[e.at[0],e.at[1]],...e.rot?{rot:e.rot}:{},...e.mirror?{mirror:e.mirror}:{}}}function mt(e){return{at:[e.at[0],e.at[1]],span:e.span,...e.rot?{rot:e.rot}:{}}}let Bv=null;function Ir(e){Bv=e}function Ve(){return Bv}const wn=10;function Hv(){if(typeof document>"u")return!0;const e=document.querySelector(".ole-canvas-root");return!!e&&!e.classList.contains("hide-grid")}function de(e){return Hv()?Math.round(e/wn)*wn:e}function qe(e){return[de(e[0]),de(e[1])]}const fj=30,gj=144;function Fv(e,t){const n=rt[e],o=y.getState(),r=o.diagram;if(!n||e==="busbar")return{newElementId:o.addElement(e,t),attachedToBus:!1};const i=bj(r,t);if(!i){const g=Wv(n),b=g?[de(t[0])-g.x,de(t[1])-g.y]:[de(t[0]),de(t[1])];return{newElementId:o.addElement(e,b),attachedToBus:!1}}const{busId:a,busAt:s,axis:l}=i,c=yj(n,l),m=Ft(r,e),u=n.terminals.find(g=>g.id===c),p=l==="x"?t[0]:s[0],f=l==="y"?t[1]:s[1],h=u?[de(p)-u.x,de(f)-u.y]:[de(t[0]),de(t[1])];return o.dispatch(g=>{const b={id:m,kind:e},x={at:h},v=`${m}.${c}`,T={id:lt(a,v),ends:[a,v]};return{...g,elements:[...g.elements,b],wires:[...g.wires??[],T],layout:{...g.layout??{},[m]:x}}}),o.setSelection([m]),{newElementId:m,attachedToBus:!0}}function bj(e,t){const n=y.getState().internal;let o=null;for(const r of e.buses??[]){const i=n.buses.get(r.id);if(!i)continue;const{axis:a,at:s,span:l}=i.geometry;let c;if(a==="x"){const m=s[0]-l/2,u=s[0]+l/2,p=t[0]<m?m-t[0]:t[0]>u?t[0]-u:0,f=Math.abs(t[1]-s[1]);c=Math.sqrt(p*p+f*f)}else{const m=s[1]-l/2,u=s[1]+l/2,p=t[1]<m?m-t[1]:t[1]>u?t[1]-u:0,f=Math.abs(t[0]-s[0]);c=Math.sqrt(f*f+p*p)}c<=fj&&(!o||c<o.dist)&&(o={busId:r.id,busAt:[s[0],s[1]],axis:a,dist:c})}return o?{busId:o.busId,busAt:o.busAt,axis:o.axis}:null}function yj(e,t){return e.terminals.length===0?"t":[...e.terminals].sort((o,r)=>t==="x"?o.y-r.y:o.x-r.x)[0].id}function Wv(e){return!e||e.stretchable||e.terminals.length===0?null:[...e.terminals].sort((n,o)=>n.y-o.y)[0]}function qv(e,t){const n=y.getState().internal;if(!e.includes(".")&&n.buses.has(e)){const r=n.buses.get(e),{axis:i,at:a,span:s}=r.geometry;if(i==="x"){const f=a[0]-s/2,h=a[0]+s/2,g=Math.max(f,Math.min(h,t[0])),b=a[1],x=t[1]>=b?"s":"n";return{ref:e,world:[g,b],orientation:x,isBus:!0,busId:e}}const l=a[1]-s/2,c=a[1]+s/2,m=Math.max(l,Math.min(c,t[1])),u=a[0],p=t[0]>=u?"e":"w";return{ref:e,world:[u,m],orientation:p,isBus:!0,busId:e}}if(!e.includes(".")&&n.junctions.has(e)){const r=n.junctions.get(e),[i,a]=r.world,s=t[0]-i,l=t[1]-a,c=Math.abs(s)>=Math.abs(l)?s>=0?"e":"w":l>=0?"s":"n";return{ref:e,world:[i,a],orientation:c,isBus:!1}}const o=n.terminals.get(e);return o?{ref:e,world:o.world,orientation:o.orientation,isBus:!1}:null}const xj={n:"s",s:"n",e:"w",w:"e"};function Gv(e,t,n){if(e.terminals.length===0)return{id:"t",x:0,y:0,orientation:"n"};const o=xj[t.orientation],r=e.terminals.filter(l=>l.orientation===o),i=r.length>0?r:e.terminals;let a=i[0],s=zr(a,n,t.world);for(let l=1;l<i.length;l++){const c=i[l],m=zr(c,n,t.world);m<s&&(s=m,a=c)}return a}function zr(e,t,n){const o=t[0]+e.x-n[0],r=t[1]+e.y-n[1];return o*o+r*r}function wj(e,t,n){const o=rt[e],r=y.getState(),i=r.diagram;if(!o)return null;const a=qv(t,n);if(!a)return null;const s=n[0]-a.world[0],l=n[1]-a.world[1],c=s*s+l*l<=gj,m=[de(n[0]),de(n[1])],u=Gv(o,a,m),p=c?a.world:m,f=[de(p[0]-u.x),de(p[1]-u.y)],h=Ft(i,e);return r.dispatch(g=>{const b={id:h,kind:e},x={at:f},v=`${h}.${u.id}`,T=a.isBus&&a.busId?a.busId:t,I={id:lt(T,v),ends:[T,v]};return{...g,elements:[...g.elements,b],wires:[...g.wires??[],I],layout:{...g.layout??{},[h]:x}}}),r.setSelection([h]),{newElementId:h,attachedToBus:a.isBus}}const vj=9,Be=7,En=5,Nn=32;function vt(e){return typeof e!="number"||!Number.isFinite(e)?Be:Math.min(Nn,Math.max(En,e))}function Xt(e=Be){return e*vj/Be}function Tn(e,t){var i,a;const n=[],o=((i=e.element.name)==null?void 0:i.trim())||e.element.id;if(o&&n.push(o),t!=="all"||!((a=e.libraryDef)!=null&&a.params))return n;const r=e.element.params??{};for(const s of e.libraryDef.params){if(!s.showOnCanvas)continue;const l=r[s.name];l==null||l===""||n.push(`${l}${s.unit??""}`)}return n}function Pn(e,t=Be){const n=Vv(e.viewBox);return n?{x:n.x+n.w+2,y:n.y+n.h/2+t/3,anchor:"start"}:{x:0,y:0,anchor:"start"}}function kj(e,t){let n=e.x,o=e.y;switch(t.mirror&&(n=-n),t.rot){case 90:[n,o]=[-o,n];break;case 180:[n,o]=[-n,-o];break;case 270:[n,o]=[o,-n];break}return[n+t.at[0],o+t.at[1]]}function In(e,t,n,o,r=Be){const i=kj(e,n),a=e.anchor??"start",s=Vv(t.viewBox);let l=e.x-(s?s.x+s.w/2:0),c=e.y-(s?s.y+s.h/2:0);switch(n.mirror&&(l=-l),n.rot){case 90:[l,c]=[-c,l];break;case 180:[l,c]=[-l,-c];break;case 270:[l,c]=[c,-l];break}return Math.abs(l)<1e-6&&Math.abs(c)<1e-6?{world:i,textAnchor:a,dy:0}:Math.abs(l)>=Math.abs(c)?{world:i,textAnchor:l>=0?"start":"end",dy:0}:c>0?{world:i,textAnchor:"middle",dy:r}:{world:i,textAnchor:"middle",dy:-(o-1)*Xt(r)}}function Vv(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}const Sj=8;function zn(e,t=Be){if(e.length<2)return null;let n=-1,o=0;for(let u=0;u<e.length-1;u++){const p=Math.hypot(e[u+1][0]-e[u][0],e[u+1][1]-e[u][1]);p>o&&(o=p,n=u)}if(n<0||o<=0)return null;const[r,i]=e[n],[a,s]=e[n+1],l=(r+a)/2,c=(i+s)/2,m=Sj*t/Be;return Math.abs(a-r)>=Math.abs(s-i)?{world:[l,c-m],textAnchor:"middle"}:{world:[l+m,c+t/3],textAnchor:"start"}}function _j(){const e=y(s=>s.internal.elements),t=y(s=>s.internal.layout),n=y(s=>s.internal.wireRenders),o=y(s=>{var l;return((l=s.diagram.meta)==null?void 0:l.labelMode)??"all"}),r=y(s=>{var l;return vt((l=s.diagram.meta)==null?void 0:l.labelFontSize)}),i=y(s=>s.editingElement),a=Xt(r);return d.jsxs("g",{className:"ole-annotation-layer",pointerEvents:"none",style:{"--ole-label-font-size":`${r}px`},children:[Array.from(e.values()).map(s=>{var h;const l=t.get(s.element.id);if(!l||!s.libraryDef)return null;const c=s.libraryDef.label??Pn(s.libraryDef,r),m=Tn(s,o),{world:u,textAnchor:p,dy:f}=In(c,s.libraryDef,l,Math.max(1,m.length),r);return i===s.element.id?d.jsx($j,{elementId:s.element.id,currentName:((h=s.element.name)==null?void 0:h.trim())||s.element.id,world:u,anchor:p,fontSize:r},s.element.id):o==="off"||m.length===0?null:d.jsx("g",{className:"ole-annotation",transform:`translate(${u[0]} ${u[1]})`,children:m.map((g,b)=>d.jsx("text",{x:0,y:f+b*a,textAnchor:p,className:"ole-annotation-text",children:g},b))},s.element.id)}),o!=="off"&&Array.from(n.values()).map(s=>{var m;const l=(m=s.label)==null?void 0:m.trim();if(!l)return null;const c=zn(s.path,r);return c?d.jsx("text",{x:c.world[0],y:c.world[1],textAnchor:c.textAnchor,className:"ole-annotation-text",children:l},`wire-${s.wireId}`):null})]})}const Qn=200,Cj=9;function $j({elementId:e,currentName:t,world:n,anchor:o,fontSize:r}){const i=Math.max(Cj,r),a=P.useRef(null);P.useEffect(()=>{const m=a.current;if(!m)return;m.focus();const u=document.createRange();u.selectNodeContents(m);const p=window.getSelection();p==null||p.removeAllRanges(),p==null||p.addRange(u)},[e]);function s(){var h;const m=y.getState(),u=m.diagram.elements.find(g=>g.id===e);if(!u){m.setEditingElement(null);return}const p=(((h=a.current)==null?void 0:h.innerText)??"").replace(/\u00a0/g," ").trim(),f=p===""||p===e?void 0:p;f!==u.name&&m.updateElement(e,{name:f}),m.setEditingElement(null)}function l(m){if(m.key==="Escape"||m.key==="Enter"&&!m.shiftKey){m.preventDefault(),s();return}m.stopPropagation()}let c=n[0];return o==="middle"?c-=Qn/2:o==="end"&&(c-=Qn),d.jsx("foreignObject",{x:c,y:n[1]-i,width:Qn,height:i*2.2,className:"ole-element-name-editor",children:d.jsx("div",{ref:a,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:s,onKeyDown:l,onPointerDown:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),style:{fontSize:`${i}px`,fontFamily:"ui-sans-serif, system-ui, sans-serif",color:"var(--foreground)",background:"var(--canvas-bg)",outline:"1px dashed var(--selection)",padding:"0 2px",display:"inline-block",minWidth:"20px",lineHeight:1.1,textAlign:o==="middle"?"center":o==="end"?"right":"left",whiteSpace:"nowrap",cursor:"text"},children:t})})}function Oe(e){return e.type??"text"}function jj(e){return e.type===void 0||e.type==="text"}const Ge=8,Aj=1.25,Yt="6 4",Ej=.05,Mr=8,sn=3,bt=4,Wt=3,qt=60,Gt=20,bo=16,yo=12,vn=10,Nj=10;function Tj(e,t){const n=e===""?[""]:e.split(`
218
- `);return[Math.max(20,...n.map(r=>r.length*t*.55)),n.length*t*Aj]}function Zt(e){return e.points.map(([t,n])=>[e.at[0]+t,e.at[1]+n])}function Ro(e,t){if(!t||t==="none"||e.length<2)return[];const n=[];return(t==="end"||t==="both")&&n.push(Dr(e[e.length-2],e[e.length-1])),t==="both"&&n.push(Dr(e[1],e[0])),n}function Dr(e,t){const n=t[0]-e[0],o=t[1]-e[1],r=Math.hypot(n,o)||1,i=n/r,a=o/r,s=t[0]-i*Mr,l=t[1]-a*Mr,c=-a,m=i;return[t,[s+c*sn,l+m*sn],[s-c*sn,l-m*sn]]}function Ue(e){return[Or(e.colWidths),Or(e.rowHeights)]}function kt(e){return Kv(e.colWidths)}function St(e){return Kv(e.rowHeights)}function Pj(e,t){const n=t[0]-e.at[0],o=t[1]-e.at[1],[r,i]=Ue(e);if(n<0||o<0||n>r||o>i)return null;const a=Rr(kt(e),n),s=Rr(St(e),o);return a===null||s===null?null:[s,a]}function Rr(e,t){for(let n=0;n<e.length-1;n++)if(t>=e[n]&&t<=e[n+1])return n;return null}function Kv(e){const t=[0];let n=0;for(const o of e)n+=o,t.push(n);return t}function Or(e){return e.reduce((t,n)=>t+n,0)}function Uv(e){let t=e.current[0]-e.start[0],n=e.current[1]-e.start[1];if(e.constrain){const r=Math.max(Math.abs(t),Math.abs(n));t=Math.sign(t||1)*r,n=Math.sign(n||1)*r}return{at:[Math.min(e.start[0],e.start[0]+t),Math.min(e.start[1],e.start[1]+n)],size:[Math.abs(t),Math.abs(n)]}}function Xv(e){return e.constrain?Yv(e.start,e.current):e.current}function Yv(e,t){const n=t[0]-e[0],o=t[1]-e[1],r=Math.hypot(n,o);if(r===0)return t;const i=Math.PI/4,a=Math.round(Math.atan2(o,n)/i)*i;return[e[0]+Math.cos(a)*r,e[1]+Math.sin(a)*r]}function Zv(e){const t=Math.abs(e.current[0]-e.start[0]),n=Math.abs(e.current[1]-e.start[1]),o=Math.min(30,Math.max(1,Math.round(t/qt))),r=Math.min(60,Math.max(1,Math.round(n/Gt)));return{at:[Math.min(e.start[0],e.current[0]),Math.min(e.start[1],e.current[1])],cols:o,rows:r}}function Qv(e,t){return{colWidths:Array.from({length:e},()=>qt),rowHeights:Array.from({length:t},()=>Gt),cells:Array.from({length:t},()=>Array.from({length:e},()=>""))}}function Ij(e){switch(e.type){case"rect":{const t=e;return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+t.size[0],maxY:t.at[1]+t.size[1]}}case"line":{const t=Zt(e),n=t.map(r=>r[0]),o=t.map(r=>r[1]);return{minX:Math.min(...n),minY:Math.min(...o),maxX:Math.max(...n),maxY:Math.max(...o)}}case"table":{const t=e,[n,o]=Ue(t);return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+n,maxY:t.at[1]+o}}default:{const t=e,n=t.fontSize??Ge,[o,r]=Tj(t.text,n);return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+o,maxY:t.at[1]+r}}}}const yt=Ge,kn=1.25;function zj(){const e=y(i=>i.diagram.annotations),t=y(i=>i.selectedAnnotation),n=y(i=>i.editingAnnotation),o=y(i=>i.editingCell),r=y(i=>i.annotationPreview);return!e||e.length===0?null:d.jsx("g",{className:"ole-free-annotation-layer",children:e.map(i=>{const a=(r==null?void 0:r.id)===i.id?r:i,s=t===i.id;switch(Oe(a)){case"rect":return d.jsx(Mj,{ann:a,isSelected:s},i.id);case"line":return d.jsx(Dj,{ann:a,isSelected:s},i.id);case"table":return d.jsx(Rj,{ann:a,isSelected:s,editingCell:n===i.id?o:null},i.id);default:return n===i.id?d.jsx(Bj,{ann:a},i.id):d.jsx(Lj,{ann:a,isSelected:s},i.id)}})})}function Mj({ann:e,isSelected:t}){const[n,o]=e.at,[r,i]=e.size,a=(e.stroke??"dashed")==="dashed"?Yt:void 0;return d.jsxs("g",{"data-annotation-id":e.id,className:"ole-ann ole-ann-rect","data-selected":t?"true":void 0,children:[e.fill==="tint"&&d.jsx("rect",{className:"ole-ann-fill",x:n,y:o,width:r,height:i}),d.jsx("rect",{className:"ole-ann-shape-hit",x:n,y:o,width:r,height:i}),d.jsx("rect",{className:"ole-ann-rect-border",x:n,y:o,width:r,height:i,strokeDasharray:a}),e.label&&d.jsx("text",{className:"ole-ann-label",x:n+bt,y:o+bt+yt*.85,fontSize:yt,children:e.label})]})}function Dj({ann:e,isSelected:t}){const n=Zt(e),o=n.map(i=>`${i[0]},${i[1]}`).join(" "),r=(e.stroke??"solid")==="dashed"?Yt:void 0;return d.jsxs("g",{"data-annotation-id":e.id,className:"ole-ann ole-ann-line-group","data-selected":t?"true":void 0,children:[d.jsx("polyline",{className:"ole-ann-shape-hit",points:o}),d.jsx("polyline",{className:"ole-ann-line",points:o,strokeDasharray:r}),Ro(n,e.arrow).map((i,a)=>d.jsx("polygon",{className:"ole-ann-arrow",points:i.map(s=>`${s[0]},${s[1]}`).join(" ")},a))]})}function Rj({ann:e,isSelected:t,editingCell:n}){var f;const[o,r]=e.at,[i,a]=Ue(e),s=kt(e),l=St(e),c=e.fontSize??yt;let m="";for(let h=1;h<e.colWidths.length;h++)m+=`M${o+s[h]} ${r}V${r+a}`;for(let h=1;h<e.rowHeights.length;h++)m+=`M${o} ${r+l[h]}H${o+i}`;const u=[],p=[];for(let h=0;h<e.rowHeights.length;h++)for(let g=0;g<e.colWidths.length;g++){const b=((f=e.cells[h])==null?void 0:f[g])??"";if(b==="")continue;const x=e.colWidths[g],v=o+s[g]+Wt,T=r+l[h]+e.rowHeights[h]/2+c*.35,I=b.length*c*.55>x-2*Wt,H=`ole-ann-clip-${e.id}-${h}-${g}`;I&&p.push(d.jsx("clipPath",{id:H,children:d.jsx("rect",{x:o+s[g],y:r+l[h],width:x,height:e.rowHeights[h]})},H)),u.push(d.jsx("text",{className:"ole-ann-table-text",x:v,y:T,fontSize:c,clipPath:I?`url(#${H})`:void 0,children:b},`${h}-${g}`))}return d.jsxs("g",{"data-annotation-id":e.id,className:"ole-ann ole-ann-table","data-selected":t?"true":void 0,children:[p.length>0&&d.jsx("defs",{children:p}),d.jsx("rect",{className:"ole-ann-table-bg",x:o,y:r,width:i,height:a}),m&&d.jsx("path",{className:"ole-ann-table-grid",d:m}),d.jsx("rect",{className:"ole-ann-table-border",x:o,y:r,width:i,height:a}),u,n&&d.jsx(Oj,{ann:e,cell:n})]})}function Oj({ann:e,cell:t}){var f;const[n,o]=t,r=P.useRef(null),i=kt(e),a=St(e),s=e.fontSize??yt,l=((f=e.cells[n])==null?void 0:f[o])??"";P.useEffect(()=>{const h=r.current;h&&(h.focus(),h.select())},[n,o]);function c(){var b;const h=y.getState(),g=((b=r.current)==null?void 0:b.value)??"";if(g!==l){const x=e.cells.map(v=>[...v]);for(;x.length<=n;)x.push([]);x[n][o]=g,h.updateAnnotation(e.id,{cells:x})}}function m(){y.getState().setEditingAnnotation(null)}function u(h,g){const b=e.rowHeights.length,x=e.colWidths.length;if(g>=x?(g=0,h+=1):g<0&&(g=x-1,h-=1),h<0||h>=b){m();return}y.getState().setEditingCell([h,g])}function p(h){if(h.key==="Enter"){h.preventDefault(),c(),u(n+1,o);return}if(h.key==="Tab"){h.preventDefault(),c(),u(n,h.shiftKey?o-1:o+1);return}if(h.key==="Escape"){h.preventDefault(),r.current&&(r.current.value=l),c(),m();return}h.stopPropagation()}return d.jsx("foreignObject",{x:e.at[0]+i[o],y:e.at[1]+a[n],width:e.colWidths[o],height:e.rowHeights[n],className:"ole-ann-cell-edit-fo",children:d.jsx("input",{ref:r,defaultValue:l,onBlur:()=>{c(),m()},onKeyDown:p,onPointerDown:h=>h.stopPropagation(),onMouseDown:h=>h.stopPropagation(),style:{width:"100%",height:"100%",boxSizing:"border-box",border:"1px solid var(--selection)",outline:"none",background:"var(--canvas-bg)",color:"var(--foreground)",font:`${s}px ui-sans-serif, system-ui, sans-serif`,padding:`0 ${Wt}px`}},`${n}-${o}`)})}function Lj({ann:e,isSelected:t}){const n=e.fontSize??yt,o=e.text===""?[""]:e.text.split(`
219
- `),r=Math.max(20,...o.map(a=>a.length*n*.55)),i=o.length*n*kn;return d.jsxs("g",{"data-annotation-id":e.id,className:"ole-free-annotation","data-selected":t?"true":void 0,children:[d.jsx("rect",{x:e.at[0]-1,y:e.at[1]-1,width:r+2,height:i+2,fill:"transparent",className:"ole-free-annotation-hit"}),t&&d.jsx("rect",{x:e.at[0]-1,y:e.at[1]-1,width:r+2,height:i+2,className:"ole-free-annotation-halo"}),o.map((a,s)=>d.jsx("text",{x:e.at[0],y:e.at[1]+n*.85+s*n*kn,fontSize:n,className:"ole-free-annotation-text",children:a},s))]})}function Bj({ann:e}){const t=P.useRef(null),n=e.fontSize??yt;P.useEffect(()=>{const s=t.current;if(!s)return;s.focus();const l=document.createRange();l.selectNodeContents(s);const c=window.getSelection();c==null||c.removeAllRanges(),c==null||c.addRange(l)},[e.id]);function o(){var c;const s=y.getState(),l=(((c=t.current)==null?void 0:c.innerText)??"").replace(/\u00a0/g," ").trimEnd();l===""?s.deleteAnnotation(e.id):l!==e.text&&s.updateAnnotation(e.id,{text:l}),s.setEditingAnnotation(null),l!==""&&s.setSelectedAnnotation(e.id),s.activeTool==="text"&&s.setActiveTool("select")}function r(s){if(s.key==="Escape"){s.preventDefault(),t.current&&(t.current.innerText=e.text),o();return}if(s.key==="Enter"&&!s.shiftKey){s.preventDefault(),o();return}s.stopPropagation()}return d.jsx("foreignObject",{x:e.at[0],y:e.at[1],width:320,height:200,"data-annotation-id":e.id,className:"ole-free-annotation-edit-fo",children:d.jsx("div",{ref:t,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:o,onKeyDown:r,onPointerDown:s=>s.stopPropagation(),onMouseDown:s=>s.stopPropagation(),style:{fontSize:`${n}px`,lineHeight:kn,fontFamily:"ui-sans-serif, system-ui, sans-serif",color:"var(--foreground)",background:"var(--canvas-bg)",outline:"1px dashed var(--selection)",padding:"0 2px",minWidth:`${n}px`,minHeight:`${n*kn}px`,whiteSpace:"pre-wrap",wordBreak:"break-word",cursor:"text"},children:e.text})})}function Hj(){const e=y(s=>s.annotationDraft);if(!e)return null;if(e.kind==="rect"){const{at:s,size:l}=Uv(e);return d.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:d.jsx("rect",{x:s[0],y:s[1],width:l[0],height:l[1],strokeDasharray:Yt})})}if(e.kind==="line"){const s=Xv(e);return d.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:d.jsx("line",{x1:e.start[0],y1:e.start[1],x2:s[0],y2:s[1]})})}const{at:t,cols:n,rows:o}=Zv(e),r=n*qt,i=o*Gt,a=[];for(let s=1;s<n;s++){const l=t[0]+s*qt;a.push(d.jsx("line",{x1:l,y1:t[1],x2:l,y2:t[1]+i},`c${s}`))}for(let s=1;s<o;s++){const l=t[1]+s*Gt;a.push(d.jsx("line",{x1:t[0],y1:l,x2:t[0]+r,y2:l},`r${s}`))}return d.jsxs("g",{className:"ole-ann-draft",pointerEvents:"none",children:[d.jsx("rect",{x:t[0],y:t[1],width:r,height:i}),a,d.jsxs("text",{className:"ole-ann-draft-badge",x:e.current[0]+12,y:e.current[1]-8,children:[n," × ",o]})]})}const ln=7,Sn=3;function Fj(){const e=y(a=>a.selectedAnnotation),t=y(a=>a.diagram.annotations),n=y(a=>a.annotationPreview);if(y(a=>a.readOnly)||!e)return null;const r=(t??[]).find(a=>a.id===e);if(!r)return null;const i=(n==null?void 0:n.id)===e?n:r;switch(Oe(i)){case"rect":return d.jsx(Wj,{ann:i,model:r});case"table":return d.jsx(Gj,{ann:i,model:r});case"line":return d.jsx(Xj,{ann:i,model:r});default:return null}}function Qt(e,t,n){const o=P.useRef(null);return{onPointerDown:l=>{if(l.button!==0)return;l.stopPropagation(),l.preventDefault();const c=Ve();c&&(o.current={pointerId:l.pointerId,startSvg:c.screenToSvg(l.clientX,l.clientY),orig:structuredClone(e)},l.target.setPointerCapture(l.pointerId))},onPointerMove:l=>{const c=o.current,m=Ve();if(!c||l.pointerId!==c.pointerId||!m)return;const u=m.screenToSvg(l.clientX,l.clientY),p=de(u[0]-c.startSvg[0]),f=de(u[1]-c.startSvg[1]);y.getState().setAnnotationPreview(t(c.orig,p,f,l.nativeEvent))},onPointerUp:l=>{const c=o.current;if(!c||l.pointerId!==c.pointerId)return;o.current=null;const m=l.target;m.hasPointerCapture(l.pointerId)&&m.releasePointerCapture(l.pointerId);const u=y.getState(),p=u.annotationPreview;u.setAnnotationPreview(null),p&&p.id===e.id&&u.updateAnnotation(e.id,n(p))},onPointerCancel:l=>{const c=o.current;!c||l.pointerId!==c.pointerId||(o.current=null,y.getState().setAnnotationPreview(null))}}}function Jv(e,t,n,o,r,i,a,s){let[l,c]=e,[m,u]=t;return n===1&&(m=Math.max(a,t[0]+r)),n===-1&&(m=Math.max(a,t[0]-r),l=e[0]+t[0]-m),o===1&&(u=Math.max(s,t[1]+i)),o===-1&&(u=Math.max(s,t[1]-i),c=e[1]+t[1]-u),{at:[l,c],size:[m,u]}}const ek=[{dirX:-1,dirY:-1,cursor:"nwse-resize"},{dirX:0,dirY:-1,cursor:"ns-resize"},{dirX:1,dirY:-1,cursor:"nesw-resize"},{dirX:1,dirY:0,cursor:"ew-resize"},{dirX:1,dirY:1,cursor:"nwse-resize"},{dirX:0,dirY:1,cursor:"ns-resize"},{dirX:-1,dirY:1,cursor:"nesw-resize"},{dirX:-1,dirY:0,cursor:"ew-resize"}];function tk(e,t,n,o){const r=n===-1?e[0]:n===1?e[0]+t[0]:e[0]+t[0]/2,i=o===-1?e[1]:o===1?e[1]+t[1]:e[1]+t[1]/2;return[r,i]}function nk({pos:e,cursor:t,handlers:n}){return d.jsx("rect",{className:"ole-annotation-handle",x:e[0]-ln/2,y:e[1]-ln/2,width:ln,height:ln,style:{cursor:t},onPointerDown:n.onPointerDown,onPointerMove:n.onPointerMove,onPointerUp:n.onPointerUp,onPointerCancel:n.onPointerCancel})}function Wj({ann:e,model:t}){return d.jsx("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:ek.map((n,o)=>d.jsx(qj,{grip:n,ann:e,model:t},o))})}function qj({grip:e,ann:t,model:n}){const o=Qt(n,(r,i,a)=>{const s=Jv(r.at,r.size,e.dirX,e.dirY,i,a,vn,vn);return{...r,at:s.at,size:s.size}},r=>({at:r.at,size:r.size}));return d.jsx(nk,{pos:tk(t.at,t.size,e.dirX,e.dirY),cursor:e.cursor,handlers:o})}function Gj({ann:e,model:t}){const n=Ue(e),o=kt(e),r=St(e);return d.jsxs("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:[o.slice(1,-1).map((i,a)=>d.jsx(Kj,{index:a,x:e.at[0]+i,ann:e,model:t},`c${a}`)),r.slice(1,-1).map((i,a)=>d.jsx(Uj,{index:a,y:e.at[1]+i,ann:e,model:t},`r${a}`)),ek.map((i,a)=>d.jsx(Vj,{grip:i,ann:e,model:t,size:n},a))]})}function Vj({grip:e,ann:t,model:n,size:o}){const r=Qt(n,(i,a,s)=>{const l=Ue(i),c=Jv(i.at,l,e.dirX,e.dirY,a,s,bo*i.colWidths.length,yo*i.rowHeights.length),m=Lr(i.colWidths,c.size[0]/l[0],bo),u=Lr(i.rowHeights,c.size[1]/l[1],yo),p=m.reduce((g,b)=>g+b,0),f=u.reduce((g,b)=>g+b,0),h=[e.dirX===-1?i.at[0]+l[0]-p:i.at[0],e.dirY===-1?i.at[1]+l[1]-f:i.at[1]];return{...i,at:h,colWidths:m,rowHeights:u}},i=>({at:i.at,colWidths:i.colWidths,rowHeights:i.rowHeights}));return d.jsx(nk,{pos:tk(t.at,o,e.dirX,e.dirY),cursor:e.cursor,handlers:r})}function Lr(e,t,n){return e.map(o=>Math.max(n,Math.round(o*t)))}function Kj({index:e,x:t,ann:n,model:o}){const[,r]=Ue(n),i=Qt(o,(a,s)=>{const l=[...a.colWidths];return l[e]=Math.max(bo,a.colWidths[e]+s),{...a,colWidths:l}},a=>({colWidths:a.colWidths}));return d.jsx("rect",{className:"ole-annotation-handle ole-annotation-handle-strip",x:t-Sn,y:n.at[1],width:Sn*2,height:r,style:{cursor:"col-resize"},onPointerDown:i.onPointerDown,onPointerMove:i.onPointerMove,onPointerUp:i.onPointerUp,onPointerCancel:i.onPointerCancel})}function Uj({index:e,y:t,ann:n,model:o}){const[r]=Ue(n),i=Qt(o,(a,s,l)=>{const c=[...a.rowHeights];return c[e]=Math.max(yo,a.rowHeights[e]+l),{...a,rowHeights:c}},a=>({rowHeights:a.rowHeights}));return d.jsx("rect",{className:"ole-annotation-handle ole-annotation-handle-strip",x:n.at[0],y:t-Sn,width:r,height:Sn*2,style:{cursor:"row-resize"},onPointerDown:i.onPointerDown,onPointerMove:i.onPointerMove,onPointerUp:i.onPointerUp,onPointerCancel:i.onPointerCancel})}function Xj({ann:e,model:t}){const n=Zt(e);return d.jsx("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:n.map((o,r)=>d.jsx(Yj,{index:r,pos:o,model:t},r))})}function Yj({index:e,pos:t,model:n}){const o=Qt(n,(r,i,a,s)=>{const l=r.points.map(m=>[...m]);let c=[r.points[e][0]+i,r.points[e][1]+a];if(s.shiftKey){const m=r.points[e-1]??r.points[e+1]??[0,0];c=Yv(m,c)}return l[e]=c,{...r,points:l}},r=>({points:r.points}));return d.jsx("circle",{className:"ole-annotation-handle",cx:t[0],cy:t[1],r:4.5,style:{cursor:"move"},onPointerDown:o.onPointerDown,onPointerMove:o.onPointerMove,onPointerUp:o.onPointerUp,onPointerCancel:o.onPointerCancel})}const Zj=20;function Qj(){const e=y(m=>m.selection),t=y(m=>m.internal);if(e.length!==1)return null;const n=e[0],o=t.buses.get(n);if(!o)return null;const{axis:r,at:i,span:a}=o.geometry,s=a/2,l=r==="x"?[i[0]-s,i[1]]:[i[0],i[1]-s],c=r==="x"?[i[0]+s,i[1]]:[i[0],i[1]+s];return d.jsxs("g",{className:"ole-bus-handles",pointerEvents:"auto",children:[d.jsx(Br,{x:l[0],y:l[1],busId:n,side:"start",axis:r}),d.jsx(Br,{x:c[0],y:c[1],busId:n,side:"end",axis:r})]})}function Br({x:e,y:t,busId:n,side:o,axis:r}){const i=Ve(),a=P.useRef(null),s=m=>{if(m.button!==0||(m.stopPropagation(),m.preventDefault(),!i))return;const u=y.getState().internal.buses.get(n);u&&(a.current={pointerId:m.pointerId,startSpan:u.geometry.span,startAt:[...u.geometry.at],startSvg:i.screenToSvg(m.clientX,m.clientY)},m.target.setPointerCapture(m.pointerId))},l=m=>{const u=a.current;if(!u||m.pointerId!==u.pointerId||!i)return;const p=i.screenToSvg(m.clientX,m.clientY),f=r==="x"?p[0]-u.startSvg[0]:p[1]-u.startSvg[1],h=Hv()?Math.round(f/wn)*wn:f,g=u.startSpan+(o==="end"?h:-h);if(g<Zj)return;const b=r==="x"?[u.startAt[0]+h/2,u.startAt[1]]:[u.startAt[0],u.startAt[1]+h/2];y.getState().updateBus(n,{span:g,at:b})},c=m=>{const u=a.current;!u||m.pointerId!==u.pointerId||(m.target.hasPointerCapture(m.pointerId)&&m.target.releasePointerCapture(m.pointerId),a.current=null)};return d.jsx("circle",{className:"ole-bus-handle",cx:e,cy:t,r:5,"data-handle":o,onPointerDown:s,onPointerMove:l,onPointerUp:c,onPointerCancel:c})}const xo=.5;function Ot(e,t){return Math.abs(e[1]-t[1])<xo?"h":"v"}function Jj(){const e=y(s=>s.selectedWire),t=y(s=>s.internal.wireRenders);if(!e)return null;const n=t.get(e);if(!n||n.path.length<2)return null;const o=n.path,r=o.length,i=[];for(let s=1;s<r-1;s++){const l=Ot(o[s-1],o[s]),c=Ot(o[s],o[s+1]),m=s-1===0,u=s+1===r-1,p=m&&l==="v"||u&&c==="v",f=m&&l==="h"||u&&c==="h";p&&f||i.push(d.jsx(eA,{wireId:e,index:s,xLocked:p,yLocked:f},`v-${s}`))}const a=[];for(let s=0;s<r-1;s++){const l=o[s],c=o[s+1];Math.abs(l[0]-c[0])<xo&&Math.abs(l[1]-c[1])<xo||a.push(d.jsx(tA,{wireId:e,segIndex:s,axis:Ot(l,c)},`m-${s}`))}return d.jsxs("g",{className:"ole-wire-handles",pointerEvents:"auto",children:[a,i]})}function eA({wireId:e,index:t,xLocked:n,yLocked:o}){const r=Ve(),i=P.useRef(null),a=y(h=>{var g;return(g=h.internal.wireRenders.get(e))==null?void 0:g.path});if(!a||t<=0||t>=a.length-1)return null;const[s,l]=a[t],c=n&&!o?"ns-resize":!n&&o?"ew-resize":"move",m=h=>{if(h.button!==0||(h.stopPropagation(),h.preventDefault(),!r))return;const g=y.getState().internal.wireRenders.get(e);g&&(i.current={pointerId:h.pointerId,startPath:g.path.map(b=>[b[0],b[1]]),startSvg:r.screenToSvg(h.clientX,h.clientY),index:t,xLocked:n,yLocked:o},document.body.style.cursor=c,h.target.setPointerCapture(h.pointerId))},u=h=>{const g=i.current;if(!g||h.pointerId!==g.pointerId||!r)return;const b=r.screenToSvg(h.clientX,h.clientY),x=g.startPath,v=g.index;if(v<=0||v>=x.length-1)return;const T=x[v],I=[g.xLocked?T[0]:de(T[0]+(b[0]-g.startSvg[0])),g.yLocked?T[1]:de(T[1]+(b[1]-g.startSvg[1]))];if(I[0]===T[0]&&I[1]===T[1])return;const H=x.map(F=>[F[0],F[1]]);H[v]=I;const K=Ot(x[v-1],x[v]);v-1>0&&(K==="h"?H[v-1]=[x[v-1][0],I[1]]:H[v-1]=[I[0],x[v-1][1]]);const _=Ot(x[v],x[v+1]);v+1<x.length-1&&(_==="h"?H[v+1]=[x[v+1][0],I[1]]:H[v+1]=[I[0],x[v+1][1]]),y.getState().updateWirePath(e,H)},p=h=>{const g=i.current;!g||h.pointerId!==g.pointerId||(h.target.hasPointerCapture(h.pointerId)&&h.target.releasePointerCapture(h.pointerId),i.current=null,document.body.style.cursor="")},f=h=>{h.stopPropagation(),h.preventDefault();const g=y.getState().internal.wireRenders.get(e);if(!g||g.path.length<=2||t<=0||t>=g.path.length-1)return;const b=g.path.filter((x,v)=>v!==t);y.getState().updateWirePath(e,b)};return d.jsx("circle",{className:"ole-wire-handle ole-wire-vertex",cx:s,cy:l,r:5,style:{cursor:c},onPointerDown:m,onPointerMove:u,onPointerUp:p,onPointerCancel:p,onDoubleClick:f})}function tA({wireId:e,segIndex:t,axis:n}){const o=Ve(),r=P.useRef(null),i=y(h=>{var g;return(g=h.internal.wireRenders.get(e))==null?void 0:g.path});if(!i||t<0||t>=i.length-1)return null;const a=i[t],s=i[t+1],l=(a[0]+s[0])/2,c=(a[1]+s[1])/2,m=n==="h"?"ns-resize":"ew-resize",u=h=>{if(h.button!==0||(h.stopPropagation(),h.preventDefault(),!o))return;const g=y.getState().internal.wireRenders.get(e);g&&(r.current={pointerId:h.pointerId,startPath:g.path.map(b=>[b[0],b[1]]),startSvg:o.screenToSvg(h.clientX,h.clientY),axis:n,segIndex:t},document.body.style.cursor=m,h.currentTarget.setPointerCapture(h.pointerId))},p=h=>{const g=r.current;if(!g||h.pointerId!==g.pointerId||!o)return;const b=o.screenToSvg(h.clientX,h.clientY),x=g.startPath,v=g.segIndex;if(v>=x.length-1)return;const T=x[v],I=x[v+1],H=[];for(let K=0;K<=v;K++)H.push(x[K]);if(g.axis==="h"){const K=de(T[1]+(b[1]-g.startSvg[1]));H.push([T[0],K]),H.push([I[0],K])}else{const K=de(T[0]+(b[0]-g.startSvg[0]));H.push([K,T[1]]),H.push([K,I[1]])}for(let K=v+1;K<x.length;K++)H.push(x[K]);y.getState().updateWirePath(e,H)},f=h=>{const g=r.current;if(!g||h.pointerId!==g.pointerId)return;const b=h.currentTarget;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),r.current=null,document.body.style.cursor=""};return d.jsxs("g",{className:"ole-wire-handle ole-wire-midpoint-group",style:{cursor:m},onPointerDown:u,onPointerMove:p,onPointerUp:f,onPointerCancel:f,children:[d.jsx("circle",{className:"ole-wire-midpoint-hit",cx:l,cy:c,r:8}),d.jsx("circle",{className:"ole-wire-handle ole-wire-midpoint",cx:l,cy:c,r:3.5})]})}const nA=3,Jn=12;function oA(){const e=y(s=>s.internal.buses),t=y(s=>s.selection),n=y(s=>s.selectedNode),o=y(s=>s.internal.nodes),r=y(s=>s.internal.terminalToNode),i=new Set(t),a=new Set;if(n){const s=o.get(n);if(s)for(const l of s.terminals)!l.includes(".")&&e.has(l)&&a.add(l)}return d.jsx("g",{className:"ole-bus-layer",children:Array.from(e.values()).map(({bus:s,geometry:l})=>{const{axis:c,at:m,span:u}=l,p=u/2,f=c==="x"?m[0]-p:m[0],h=c==="x"?m[1]:m[1]-p,g=c==="x"?m[0]+p:m[0],b=c==="x"?m[1]:m[1]+p,x=i.has(s.id),v=a.has(s.id),T=r.get(s.id)??void 0,I=Jn/2,H=c==="x"?m[0]-p:m[0]-I,K=c==="x"?m[1]-I:m[1]-p,_=c==="x"?u:Jn,F=c==="x"?Jn:u;return d.jsxs("g",{"data-bus-id":s.id,"data-element-id":s.id,"data-node-id":T,"data-selected":x?"true":void 0,"data-node-related":v?"true":void 0,className:"ole-bus",children:[d.jsx("rect",{x:H,y:K,width:_,height:F,fill:"transparent",className:"ole-bus-hit"}),d.jsx("line",{x1:f,y1:h,x2:g,y2:b,stroke:"currentColor",strokeWidth:nA,strokeLinecap:"round",fill:"none"})]},s.id)})})}function rA(){const e=y(s=>s.busbarDrawStart),t=y(s=>s.cursorSvg);if(!e||!t)return null;const n=t[0]-e[0],o=t[1]-e[1],r=Math.abs(n)>=Math.abs(o),i=r?t[0]:e[0],a=r?e[1]:t[1];return d.jsxs("g",{className:"ole-busbar-preview",pointerEvents:"none",children:[d.jsx("line",{x1:e[0],y1:e[1],x2:i,y2:a,className:"ole-busbar-preview-line"}),d.jsx("circle",{cx:e[0],cy:e[1],r:3.5,className:"ole-busbar-preview-anchor"}),d.jsx("circle",{cx:i,cy:a,r:3.5,className:"ole-busbar-preview-anchor"})]})}const iA=2.5,aA=9,sA=13,lA=-13,cA=4.5,dA=8;function uA(){const e=y(s=>s.internal.junctions),t=y(s=>s.selection),n=y(s=>s.selectedNode),o=y(s=>s.internal.nodes),r=y(s=>s.internal.terminalToNode),i=new Set(t),a=new Set;if(n){const s=o.get(n);if(s)for(const l of s.terminals)a.add(l)}return d.jsx("g",{className:"ole-junction-layer",children:Array.from(e.values()).map(({junction:s,world:l,degree:c})=>{const m=r.get(s.id)??void 0,u=t.length===1&&t[0]===s.id,p=l[0]+sA,f=l[1]+lA;return d.jsxs("g",{"data-junction-id":s.id,"data-element-id":s.id,"data-node-id":m,"data-solder":c>=3?"true":void 0,"data-selected":i.has(s.id)?"true":void 0,"data-node-related":a.has(s.id)?"true":void 0,className:"ole-junction",children:[d.jsx("circle",{cx:l[0],cy:l[1],r:aA,fill:"transparent",className:"ole-junction-hit"}),d.jsx("circle",{cx:l[0],cy:l[1],r:iA,className:"ole-junction-dot"}),u&&d.jsxs("g",{className:"ole-junction-wire-handle-group",children:[d.jsx("line",{x1:l[0],y1:l[1],x2:p,y2:f,className:"ole-junction-wire-handle-stem"}),d.jsx("circle",{cx:p,cy:f,r:dA,fill:"transparent",className:"ole-junction-wire-handle"}),d.jsx("circle",{cx:p,cy:f,r:cA,className:"ole-junction-wire-handle-dot"})]})]},s.id)})})}function ot(e){const t=[`translate(${e.at[0]} ${e.at[1]})`];return e.rot&&t.push(`rotate(${e.rot})`),e.mirror&&t.push("scale(-1 1)"),t.join(" ")}function mA(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function pA({lib:e}){const t=mA(e.viewBox);return t?d.jsx("rect",{className:"ole-element-hit",x:t.x,y:t.y,width:t.w,height:t.h}):null}function hA(){const e=y(s=>s.internal.elements),t=y(s=>s.internal.layout),n=y(s=>s.selection),o=y(s=>s.selectedNode),r=y(s=>s.internal.nodes),i=new Set(n),a=new Set;if(o){const s=r.get(o);if(s)for(const l of s.terminals){const c=l.indexOf(".");c>0&&a.add(l.slice(0,c))}}return d.jsx("g",{className:"ole-element-layer",children:Array.from(e.values()).map(s=>{const l=t.get(s.element.id);if(!l)return null;const c=i.has(s.element.id),m=a.has(s.element.id);return s.libraryDef?d.jsxs("g",{"data-element-id":s.element.id,"data-selected":c?"true":void 0,"data-node-related":m?"true":void 0,transform:ot(l),className:"ole-element",children:[d.jsx(pA,{lib:s.libraryDef}),d.jsx("g",{dangerouslySetInnerHTML:{__html:s.libraryDef.svg}}),s.libraryDef.terminalLabelsSvg&&d.jsx("g",{className:"ole-terminal-labels",dangerouslySetInnerHTML:{__html:s.libraryDef.terminalLabelsSvg}})]},s.element.id):d.jsxs("g",{"data-element-id":s.element.id,"data-selected":c?"true":void 0,"data-node-related":m?"true":void 0,transform:ot(l),className:"ole-element ole-element--unknown",children:[d.jsx("rect",{x:-10,y:-10,width:20,height:20,fill:"none",stroke:"#EF4444",strokeWidth:1,strokeDasharray:"2 2"}),d.jsx("text",{x:0,y:4,fontSize:8,fill:"#EF4444",textAnchor:"middle",fontFamily:"system-ui, sans-serif",children:"?"})]},s.element.id)})})}let ok=null;const wo=new Set;function cn(e){ok=e;for(const t of wo)t(e)}function fA(){return ok}function gA(e){return wo.add(e),()=>{wo.delete(e)}}function bA(){const[e,t]=P.useState(fA());return P.useEffect(()=>gA(t),[]),!e||e.w===0&&e.h===0?null:d.jsx("rect",{className:"ole-marquee",x:e.x,y:e.y,width:e.w,height:e.h,pointerEvents:"none"})}function yA(){const e=y(c=>c.activeTool),t=y(c=>c.placeKind),n=y(c=>c.cursorSvg),o=y(c=>c.placeFromTerminal);if(e!=="place"||!t||!n)return null;const r=Lv(t);if(!r)return null;let i=null,a=null;if(o){const c=qv(o,n);c&&(i=Gv(r,c,n),a={source:c.world,pin:n})}else i=Wv(r);const s=n[0]-((i==null?void 0:i.x)??0),l=n[1]-((i==null?void 0:i.y)??0);return d.jsxs("g",{className:"ole-place-ghost-group",pointerEvents:"none",children:[a&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:a.source[0],y1:a.source[1],x2:a.pin[0],y2:a.pin[1],className:"ole-wire-preview-line"}),d.jsx("circle",{cx:a.source[0],cy:a.source[1],r:4,className:"ole-wire-preview-anchor"})]}),d.jsx("g",{className:"ole-place-ghost",transform:`translate(${s} ${l})`,opacity:.5,children:d.jsx("g",{dangerouslySetInnerHTML:{__html:r.svg}})})]})}function xA(){const e=y(r=>r.selection),t=y(r=>r.internal.elements),n=y(r=>r.internal.layout),o=y(r=>r.internal.buses);return e.length===0?null:d.jsx("g",{className:"ole-selection-overlay",pointerEvents:"none",children:e.map(r=>{const i=o.get(r);if(i){const{axis:c,at:m,span:u}=i.geometry,p=u/2,f=c==="x"?m[0]-p:m[0]-4,h=c==="x"?m[1]-4:m[1]-p,g=c==="x"?u:8,b=c==="x"?8:u;return d.jsx("rect",{x:f,y:h,width:g,height:b,fill:"none",className:"ole-selection-rect"},r)}const a=t.get(r),s=n.get(r);if(!(a!=null&&a.libraryDef)||!s)return null;const l=wA(a.libraryDef.viewBox);return l?d.jsx("rect",{x:l.x,y:l.y,width:l.w,height:l.h,fill:"none",className:"ole-selection-rect",transform:ot(s)},r):null})})}function wA(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function vA(){const e=y(i=>i.internal.terminals),t=y(i=>i.internal.terminalToNode),n=y(i=>i.wireFromTerminal),o=y(i=>i.selection),r=new Set(o);return d.jsx("g",{className:"ole-terminal-layer",children:Array.from(e.values()).map(i=>{const a=t.get(i.ref),s=a!==void 0,l=n===i.ref,c=r.has(i.elementId);return d.jsx("circle",{cx:i.world[0],cy:i.world[1],r:3,"data-element-id":i.elementId,"data-terminal-id":i.ref,"data-node-id":a,"data-connected":s?"true":"false","data-active":l?"true":void 0,"data-on-selected":c?"true":void 0,className:"ole-terminal"},i.ref)})})}const Hr=4;function kA(e,t,n,o){const r=t[0]-e[0],i=t[1]-e[1],a=o[0]-n[0],s=o[1]-n[1],l=r*s-i*a;if(Math.abs(l)<1e-9)return null;const c=((n[0]-e[0])*s-(n[1]-e[1])*a)/l,m=((n[0]-e[0])*i-(n[1]-e[1])*r)/l,u=1e-6;return c<=u||c>=1-u||m<=u||m>=1-u?null:[e[0]+c*r,e[1]+c*i]}function SA(e,t){const n=[];let o=[e[0]];for(let r=0;r<e.length-1;r++){const i=e[r],a=e[r+1],s=t.get(r);if(!s||s.length===0){o.push(a);continue}const l=a[0]-i[0],c=a[1]-i[1],m=Math.hypot(l,c)||1,u=l/m,p=c/m,f=g=>(g[0]-i[0])*u+(g[1]-i[1])*p,h=s.slice().sort((g,b)=>f(g)-f(b));for(const g of h){const b=f(g),x=Math.max(0,b-Hr),v=Math.min(m,b+Hr);o.push([i[0]+u*x,i[1]+p*x]),n.push(o),o=[[i[0]+u*v,i[1]+p*v]]}o.push(a)}return n.push(o),n.filter(r=>r.length>=2)}function _A(){const e=y(c=>c.internal.wireRenders),t=y(c=>c.internal.terminalToNode),n=y(c=>c.diagram.wires),o=y(c=>c.selectedWire),r=y(c=>c.selectedNode),i=new Map;for(const c of n??[]){const m=t.get(c.ends[0]);m&&i.set(c.id,m)}const a=Array.from(e.values()).filter(c=>c.path.length>=2),s=[];for(const c of a){const m=i.get(c.wireId);for(let u=0;u<c.path.length-1;u++)s.push({wireId:c.wireId,node:m,i:u,a:c.path[u],b:c.path[u+1]})}const l=new Map;for(let c=0;c<s.length;c++)for(let m=c+1;m<s.length;m++){const u=s[c],p=s[m];if(u.wireId===p.wireId||!(u.node&&p.node&&u.node!==p.node))continue;const f=kA(u.a,u.b,p.a,p.b);if(!f)continue;const h=u.wireId<p.wireId?u:p;let g=l.get(h.wireId);g||(g=new Map,l.set(h.wireId,g));const b=g.get(h.i)??[];b.push(f),g.set(h.i,b)}return d.jsx("g",{className:"ole-wire-layer",fill:"none",stroke:"currentColor",strokeWidth:1,children:a.flatMap(c=>{const m=c.path,u=m.map(v=>`${v[0]},${v[1]}`).join(" "),p=i.get(c.wireId),f=o===c.wireId,h=r!=null&&r===p,g=f||h?"true":void 0,b=l.get(c.wireId),x=b?SA(m,b):[m];return[d.jsx("polyline",{"data-wire-id":c.wireId,"data-node-id":p,className:"ole-wire-hit",points:u},`hit-${c.wireId}`),...x.map((v,T)=>d.jsx("polyline",{"data-wire-id":c.wireId,"data-node-id":p,"data-manual":c.userEdited?"true":void 0,"data-selected":g,className:"ole-wire",points:v.map(I=>`${I[0]},${I[1]}`).join(" ")},`${c.wireId}-${T}`))]})})}let st=null;const vo=new Set;function nt(e){if(!(e===null&&st===null||e&&st&&e.ref===st.ref&&e.world[0]===st.world[0]&&e.world[1]===st.world[1])){st=e;for(const t of vo)t(e)}}function CA(){return st}function $A(e){return vo.add(e),()=>{vo.delete(e)}}function jA(){const e=y(l=>l.wireDragFrom),t=y(l=>l.cursorSvg),[n,o]=P.useState(CA());if(P.useEffect(()=>$A(o),[]),!e||!t)return null;const r=e.world,i=(n==null?void 0:n.world[0])??t[0],a=(n==null?void 0:n.world[1])??t[1],s=(n==null?void 0:n.create)==="junction";return d.jsxs("g",{className:"ole-wire-preview",pointerEvents:"none",children:[d.jsx("line",{x1:r[0],y1:r[1],x2:i,y2:a,className:"ole-wire-preview-line"}),d.jsx("circle",{cx:r[0],cy:r[1],r:4,className:"ole-wire-preview-anchor"}),n&&d.jsxs(d.Fragment,{children:[d.jsx("circle",{cx:n.world[0],cy:n.world[1],r:n.isBus?7:8,className:"ole-wire-preview-target-ring","data-create":s?"true":void 0}),!s&&d.jsx("circle",{cx:n.world[0],cy:n.world[1],r:n.isBus?3:4,className:"ole-wire-preview-target-dot"})]})]})}function ct(e,t){return e instanceof Element?e.closest(`[${t}]`):null}function xt(e){var t;return((t=ct(e,"data-element-id"))==null?void 0:t.getAttribute("data-element-id"))??null}function AA(e){var t;return((t=ct(e,"data-bus-id"))==null?void 0:t.getAttribute("data-bus-id"))??null}function EA(e){var t;return((t=ct(e,"data-junction-id"))==null?void 0:t.getAttribute("data-junction-id"))??null}function Mn(e){var r;const t=(r=ct(e,"data-terminal-id"))==null?void 0:r.getAttribute("data-terminal-id");if(t)return t;const n=EA(e);if(n)return n;const o=AA(e);return o||null}function Dn(e){var t;return((t=ct(e,"data-node-id"))==null?void 0:t.getAttribute("data-node-id"))??null}function ko(e){var t;return((t=ct(e,"data-wire-id"))==null?void 0:t.getAttribute("data-wire-id"))??null}function Vt(e){var t;return((t=ct(e,"data-annotation-id"))==null?void 0:t.getAttribute("data-annotation-id"))??null}function rk(e,t){try{e.dispatchEvent(new PointerEvent("pointercancel",{pointerId:t,bubbles:!0,cancelable:!0,pointerType:"touch"}))}catch{}}function NA(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}function ik(){const e=y.getState(),t=e.activeTool;if(e.editingAnnotation||e.editingElement){if(typeof document<"u"){const n=document.querySelector(".ole-free-annotation-edit-fo div[contenteditable], .ole-element-name-editor div[contenteditable], .ole-ann-cell-edit-fo input");n==null||n.blur()}e.setEditingAnnotation(null),e.setEditingElement(null);return}if(t==="wire"||t==="busbar"||t==="junction"||t==="text"||t==="rect"||t==="line"||t==="table"){e.setActiveTool("select");return}if(t==="place"){e.placeFromTerminal?e.setPlaceFromTerminal(null):e.placeKind?e.setPlaceKind(null):e.setActiveTool("select");return}(e.selectedNode||e.selectedWire||e.selection.length>0||e.selectedAnnotation)&&e.clearSelection()}function TA(){P.useEffect(()=>{const e=t=>{if(NA(t.target)||y.getState().readOnly)return;const n=t.metaKey||t.ctrlKey,o=y.getState();if(n&&t.key.toLowerCase()==="z"){t.preventDefault(),t.shiftKey?o.redo():o.undo();return}if(n&&!t.shiftKey&&t.key.toLowerCase()==="y"){t.preventDefault(),o.redo();return}if(n&&t.key.toLowerCase()==="a"){t.preventDefault();const r=y.getState().diagram.elements.map(i=>i.id);o.setSelection(r);return}if(n&&!t.shiftKey&&!t.altKey){const r=t.key.toLowerCase(),i=o.selection.length>0||o.selectedAnnotation!=null;if(r==="c"){if(!i)return;t.preventDefault(),o.copySelection();return}if(r==="x"){if(!i)return;t.preventDefault(),o.cutSelection();return}if(r==="v"){if(!o.clipboard)return;t.preventDefault(),o.pasteClipboard();return}}if(!n)switch(t.key){case"v":case"V":o.setActiveTool("select");return;case"h":case"H":o.setActiveTool("pan");return;case"w":case"W":o.setActiveTool("wire");return;case"b":case"B":o.setActiveTool("busbar");return;case"j":case"J":o.setActiveTool("junction");return;case"p":case"P":o.setActiveTool("place");return;case"t":case"T":o.setActiveTool("text");return;case"f":case"F":o.setActiveTool("rect");return;case"l":case"L":o.setActiveTool("line");return;case"d":case"D":o.setActiveTool("table");return;case"r":case"R":o.selection.length>0&&(t.preventDefault(),o.rotateSelection(90));return;case"m":case"M":o.selection.length>0&&(t.preventDefault(),o.mirrorSelection());return;case"Delete":case"Backspace":o.selectedAnnotation?(t.preventDefault(),o.deleteAnnotation(o.selectedAnnotation)):o.selectedWire?(t.preventDefault(),o.deleteSelectedWire()):o.selectedNode?(t.preventDefault(),o.deleteSelectedNode()):o.selection.length>0&&(t.preventDefault(),o.deleteSelection());return;case"Escape":ik();return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[])}let So=null;const _o=new Set;function PA(e){if(e!==So){So=e;for(const t of _o)t(e)}}function IA(){return So}function zA(e){return _o.add(e),()=>{_o.delete(e)}}const Fr="ole-hover-element-host",MA="ole-hover-terminal-on",DA="ole-hover-node-on";function RA(e){P.useEffect(()=>{const t=e.current;if(!t)return;let n=null,o=null;const r=new Set,i=new Set,a=(u,p,f)=>{for(const h of u)h.classList.remove(f);u.clear();for(const h of p)h.classList.add(f),u.add(h)},s=u=>{var f,h;if(u===n)return;n&&((f=t.querySelector(`[data-element-id="${dn(n)}"]`))==null||f.classList.remove(Fr)),u&&((h=t.querySelector(`[data-element-id="${dn(u)}"]`))==null||h.classList.add(Fr));const p=u?Array.from(t.querySelectorAll(`.ole-terminal[data-element-id="${dn(u)}"]`)):[];a(r,p,MA),n=u,u?t.setAttribute("data-hover-element",""):t.removeAttribute("data-hover-element"),PA(u)},l=u=>{if(u===o)return;const p=u?Array.from(t.querySelectorAll(`[data-node-id="${dn(u)}"]`)):[];a(i,p,DA),o=u,u?t.setAttribute("data-hover-node",""):t.removeAttribute("data-hover-node")},c=u=>{s(xt(u.target));const p=Mn(u.target);let f=null;p?f=y.getState().internal.terminalToNode.get(p)??null:f=Dn(u.target),l(f)},m=()=>{s(null),l(null)};return t.addEventListener("pointermove",c),t.addEventListener("pointerleave",m),()=>{t.removeEventListener("pointermove",c),t.removeEventListener("pointerleave",m),s(null),l(null)}},[e])}function dn(e){return e.replace(/(["\\])/g,"\\$1")}function OA(e,t){const n=y.getState().internal;if(!e.includes(".")){const r=n.buses.get(e);if(r){const{axis:a,at:s,span:l}=r.geometry;if(a==="x"){const p=s[0]-l/2,f=s[0]+l/2,h=Math.max(p,Math.min(f,t[0]));return{ref:e,world:[h,s[1]],isBus:!0}}const c=s[1]-l/2,m=s[1]+l/2,u=Math.max(c,Math.min(m,t[1]));return{ref:e,world:[s[0],u],isBus:!0}}const i=n.junctions.get(e);return i?{ref:e,world:[i.world[0],i.world[1]],isBus:!1}:null}const o=n.terminals.get(e);return o?{ref:e,world:o.world,isBus:!1}:null}const Wr=10,un=e=>Math.round(e/Wr)*Wr,LA=16;function ak(e,t){let n=e[0],o=1/0;for(let r=0;r<e.length-1;r++){const[i,a]=e[r],[s,l]=e[r+1],c=s-i,m=l-a,u=c*c+m*m,p=u===0?0:Math.max(0,Math.min(1,((t[0]-i)*c+(t[1]-a)*m)/u)),f=i+p*c,h=a+p*m,g=(f-t[0])**2+(h-t[1])**2;g<o&&(o=g,n=[f,h])}return n}function _n(e,t){return typeof document<"u"?document.elementFromPoint(e,t):null}function BA(e,t){const n=y.getState().internal.wireRenders;let o=null,r=t;for(const i of n.values()){if(i.path.length<2)continue;const a=ak(i.path,e),s=Math.hypot(a[0]-e[0],a[1]-e[1]);s<=r&&(r=s,o={wireId:i.wireId,at:a})}return o}function Lt(e,t,n){const o=e?Mn(e):null;if(o){const s=OA(o,t);if(s)return{spec:{end:o},world:s.world,ref:o,isBus:s.isBus,create:!1}}let r=e?ko(e):null,i=null;if(r){const s=y.getState().internal.wireRenders.get(r);i=s?ak(s.path,t):t}else{const s=BA(t,n);s&&(r=s.wireId,i=s.at)}if(r&&i){const s=[un(i[0]),un(i[1])];return{spec:{onWire:r,at:s},world:s,ref:null,isBus:!1,create:!0}}const a=[un(t[0]),un(t[1])];return{spec:{junctionAt:a},world:a,ref:null,isBus:!1,create:!0}}function Bt(e,t,n){const o=e.viewport.screenToSvg(t,n),r=e.viewport.screenToSvg(t+LA,n);return Math.hypot(r[0]-o[0],r[1]-o[1])}function sk(e){return{ref:e.ref,world:e.world,isBus:e.isBus,...e.create?{create:"junction"}:{}}}function Cn(e,t){return e.ref&&t.ref?e.ref===t.ref:!e.ref&&!t.ref?e.world[0]===t.world[0]&&e.world[1]===t.world[1]:!1}const qr=3;let pe=null,Ie=null,Ee=null,fe=null;const HA={id:"select",cursor:"default",onPointerDown(e,t){var h,g,b,x,v,T,I,H,K,_,F,W;if(e.button!==0||e.target instanceof Element&&e.target.closest(".ole-bus-handle, .ole-wire-handle, .ole-annotation-handle"))return;const n=y.getState(),o=Vt(e.target);if(o){e.preventDefault(),e.stopPropagation();const G=(h=n.diagram.annotations)==null?void 0:h.find(B=>B.id===o);if(!G)return;const z=n.selectedAnnotation===o;n.setSelectedAnnotation(o),fe={pointerId:e.pointerId,id:o,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),origin:[G.at[0],G.at[1]],moved:!1,wasSelected:z};return}const r=e.target instanceof Element?e.target.closest(".ole-junction-wire-handle"):null;if(r){const G=(g=r.closest("[data-junction-id]"))==null?void 0:g.getAttribute("data-junction-id");if(G){e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((x=(b=e.target).hasPointerCapture)!=null&&x.call(b,e.pointerId))&&e.target.releasePointerCapture(e.pointerId),t.hostEl.classList.add("tool-wire"),n.setWireFromTerminal(G);const z=(v=n.internal.junctions.get(G))==null?void 0:v.world;z&&n.setWireDragFrom({spec:{end:G},world:z,ref:G}),n.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY)),Ee={pointerId:e.pointerId,fromRef:G};return}}const a=(e.target instanceof Element?(T=e.target.closest("[data-terminal-id]"))==null?void 0:T.getAttribute("data-terminal-id"):null)?Mn(e.target):null;if(a){const G=a.indexOf("."),z=G>0?a.slice(0,G):"";if(z&&n.selection.includes(z)){e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((H=(I=e.target).hasPointerCapture)!=null&&H.call(I,e.pointerId))&&e.target.releasePointerCapture(e.pointerId),t.hostEl.classList.add("tool-wire"),n.setWireFromTerminal(a);const B=(K=n.internal.terminals.get(a))==null?void 0:K.world;B&&n.setWireDragFrom({spec:{end:a},world:B,ref:a}),n.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY)),Ee={pointerId:e.pointerId,fromRef:a};return}}let s=xt(e.target);if(!s){const G=ko(e.target);if(G&&typeof document<"u"){const z=document.elementsFromPoint(e.clientX,e.clientY);for(const B of z){const Q=(F=(_=B.closest)==null?void 0:_.call(B,"[data-bus-id]"))==null?void 0:F.getAttribute("data-bus-id");if(!Q)continue;const ae=(W=n.diagram.wires)==null?void 0:W.find(ue=>ue.id===G);ae&&(ae.ends[0]===Q||ae.ends[1]===Q)&&(s=Q);break}}}if(!s){const G=ko(e.target);if(G){if(e.preventDefault(),e.altKey){const z=Dn(e.target);if(z){n.setSelectedNode(z);return}}n.setSelectedWire(G);return}e.shiftKey||n.clearSelection(),Ie={pointerId:e.pointerId,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),shiftKey:e.shiftKey,baseSelection:e.shiftKey?n.selection.slice():[]},t.hostEl.setPointerCapture(e.pointerId),e.preventDefault();return}const l=n.selection;e.shiftKey?n.toggleInSelection(s):l.includes(s)||n.setSelection([s]);const c=e.shiftKey?y.getState().selection:l.includes(s)?l:[s];if(c.length===0)return;const m=y.getState().internal,u=new Map,p=new Map,f=new Map;for(const G of c){const z=m.buses.get(G);if(z){p.set(G,[z.geometry.at[0],z.geometry.at[1]]);continue}const B=m.junctions.get(G);if(B){f.set(G,[B.world[0],B.world[1]]);continue}const Q=m.layout.get(G);Q&&u.set(G,{...Q})}u.size===0&&p.size===0&&f.size===0||(pe={pointerId:e.pointerId,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),originals:u,busOriginals:p,junctionOriginals:f,moved:!1},e.preventDefault())},onPointerMove(e,t){if(fe&&e.pointerId===fe.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=de(n[0]-fe.startSvg[0]),r=de(n[1]-fe.startSvg[1]);!fe.moved&&(o!==0||r!==0)&&(fe.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));const i=t.hostEl.querySelector(`[data-annotation-id="${Re(fe.id)}"]`);i&&i.setAttribute("transform",`translate(${o} ${r})`);return}if(Ee&&e.pointerId===Ee.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY);y.getState().setCursorSvg(n);const o=_n(e.clientX,e.clientY),r=Lt(o,n,Bt(t,e.clientX,e.clientY)),i={spec:{end:Ee.fromRef},world:[0,0],ref:Ee.fromRef};nt(Cn(i,r)?null:sk(r));return}if(pe&&e.pointerId===pe.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=de(n[0]-pe.startSvg[0]),r=de(n[1]-pe.startSvg[1]);!pe.moved&&(o!==0||r!==0)&&(pe.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));for(const[i,a]of pe.originals){const s=t.hostEl.querySelector(`[data-element-id="${Re(i)}"]`);if(!s)continue;const l={...a,at:[a.at[0]+o,a.at[1]+r]};s.setAttribute("transform",ot(l))}for(const i of pe.busOriginals.keys()){const a=t.hostEl.querySelector(`[data-element-id="${Re(i)}"]`);a&&a.setAttribute("transform",`translate(${o} ${r})`)}for(const i of pe.junctionOriginals.keys()){const a=t.hostEl.querySelector(`[data-element-id="${Re(i)}"]`);a&&a.setAttribute("transform",`translate(${o} ${r})`)}return}if(Ie&&e.pointerId===Ie.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY);cn(Vr(Ie.startSvg,n));return}},onPointerUp(e,t){var n;if(fe&&e.pointerId===fe.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=de(o[0]-fe.startSvg[0]),i=de(o[1]-fe.startSvg[1]),a=t.hostEl.querySelector(`[data-annotation-id="${Re(fe.id)}"]`);if(a&&a.removeAttribute("transform"),fe.moved&&(r!==0||i!==0))y.getState().updateAnnotation(fe.id,{at:[fe.origin[0]+r,fe.origin[1]+i]});else if(!fe.moved&&fe.wasSelected){const s=y.getState(),l=(n=s.diagram.annotations)==null?void 0:n.find(c=>c.id===fe.id);l&&Gr(s,l,o)}fe=null;return}if(Ee&&e.pointerId===Ee.pointerId){const o=y.getState(),r=Ee.fromRef;Ee=null,t.hostEl.classList.remove("tool-wire"),o.setWireFromTerminal(null),o.setWireDragFrom(null),o.setCursorSvg(null),nt(null);const i=t.viewport.screenToSvg(e.clientX,e.clientY),a=_n(e.clientX,e.clientY)??(e.target instanceof Element?e.target:null),s=Lt(a,i,Bt(t,e.clientX,e.clientY));if(Cn({world:[0,0],ref:r},s))return;o.connectWire({end:r},s.spec);return}if(pe&&e.pointerId===pe.pointerId){if(t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId),pe.moved){const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=de(o[0]-pe.startSvg[0]),i=de(o[1]-pe.startSvg[1]);if(r!==0||i!==0){const a=new Map;for(const s of pe.originals.keys())a.set(s,[r,i]);for(const s of pe.busOriginals.keys())a.set(s,[r,i]);for(const s of pe.junctionOriginals.keys())a.set(s,[r,i]);y.getState().moveElements(a)}for(const a of pe.busOriginals.keys()){const s=t.hostEl.querySelector(`[data-element-id="${Re(a)}"]`);s&&s.removeAttribute("transform")}for(const a of pe.junctionOriginals.keys()){const s=t.hostEl.querySelector(`[data-element-id="${Re(a)}"]`);s&&s.removeAttribute("transform")}}pe=null;return}if(Ie&&e.pointerId===Ie.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=Vr(Ie.startSvg,o);if(r.w>=qr||r.h>=qr){const i=FA(r);if(Ie.shiftKey){const a=new Set(Ie.baseSelection);for(const s of i)a.has(s)?a.delete(s):a.add(s);y.getState().setSelection([...a])}else y.getState().setSelection(i)}cn(null),Ie=null}},onPointerCancel(e,t){var n,o,r,i,a,s;if(fe&&e.pointerId===fe.pointerId){const l=t.hostEl.querySelector(`[data-annotation-id="${Re(fe.id)}"]`);if(l&&l.removeAttribute("transform"),(o=(n=t.hostEl).hasPointerCapture)!=null&&o.call(n,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}fe=null}if(pe&&e.pointerId===pe.pointerId){for(const[l,c]of pe.originals){const m=t.hostEl.querySelector(`[data-element-id="${Re(l)}"]`);m&&m.setAttribute("transform",ot(c))}for(const l of pe.busOriginals.keys()){const c=t.hostEl.querySelector(`[data-element-id="${Re(l)}"]`);c&&c.removeAttribute("transform")}for(const l of pe.junctionOriginals.keys()){const c=t.hostEl.querySelector(`[data-element-id="${Re(l)}"]`);c&&c.removeAttribute("transform")}if((i=(r=t.hostEl).hasPointerCapture)!=null&&i.call(r,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}pe=null}if(Ee&&e.pointerId===Ee.pointerId){t.hostEl.classList.remove("tool-wire");const l=y.getState();l.setWireFromTerminal(null),l.setWireDragFrom(null),l.setCursorSvg(null),nt(null),Ee=null}if(Ie&&e.pointerId===Ie.pointerId){if((s=(a=t.hostEl).hasPointerCapture)!=null&&s.call(a,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}cn(null),Ie=null}},onDoubleClick(e,t){var i;const n=y.getState(),o=Vt(e.target);if(o){e.preventDefault(),e.stopPropagation();const a=(i=n.diagram.annotations)==null?void 0:i.find(s=>s.id===o);if(!a)return;n.setSelectedAnnotation(o),Gr(n,a,t.viewport.screenToSvg(e.clientX,e.clientY));return}const r=xt(e.target);r&&(e.preventDefault(),e.stopPropagation(),n.setEditingElement(r))},onDeactivate(e){if(pe=null,Ie=null,fe=null,Ee){e.hostEl.classList.remove("tool-wire");const t=y.getState();t.setWireFromTerminal(null),t.setWireDragFrom(null),t.setCursorSvg(null),nt(null),Ee=null}cn(null)}};function Gr(e,t,n){const o=Oe(t);if(o==="table"){const r=Pj(t,n);r&&(e.setEditingAnnotation(t.id),e.setEditingCell(r))}else o==="text"&&e.setEditingAnnotation(t.id)}function Vr(e,t){const n=Math.min(e[0],t[0]),o=Math.min(e[1],t[1]),r=Math.abs(t[0]-e[0]),i=Math.abs(t[1]-e[1]);return{x:n,y:o,w:r,h:i}}function FA(e){const{internal:t}=y.getState(),n=[];for(const o of t.elements.values()){if(!o.libraryDef)continue;const r=t.layout.get(o.element.id);if(!r)continue;const i=qA(o.libraryDef.viewBox);if(!i)continue;const a=[[i.x,i.y],[i.x+i.w,i.y],[i.x,i.y+i.h],[i.x+i.w,i.y+i.h]].map(([u,p])=>WA([u,p],r));let s=1/0,l=-1/0,c=1/0,m=-1/0;for(const[u,p]of a)u<s&&(s=u),u>l&&(l=u),p<c&&(c=p),p>m&&(m=p);l>=e.x&&s<=e.x+e.w&&m>=e.y&&c<=e.y+e.h&&n.push(o.element.id)}for(const{bus:o,geometry:r}of t.buses.values()){const{axis:i,at:a,span:s}=r,l=s/2,c=i==="x"?a[0]-l:a[0],m=i==="x"?a[0]+l:a[0],u=i==="x"?a[1]:a[1]-l,p=i==="x"?a[1]:a[1]+l;m>=e.x&&c<=e.x+e.w&&p>=e.y&&u<=e.y+e.h&&n.push(o.id)}for(const{junction:o,world:r}of t.junctions.values())r[0]>=e.x&&r[0]<=e.x+e.w&&r[1]>=e.y&&r[1]<=e.y+e.h&&n.push(o.id);return n}function WA(e,t){let[n,o]=e;switch(t.mirror&&(n=-n),t.rot){case 0:break;case 90:[n,o]=[-o,n];break;case 180:[n,o]=[-n,-o];break;case 270:[n,o]=[o,-n];break}return[n+t.at[0],o+t.at[1]]}function qA(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function Re(e){return e.replace(/(["\\])/g,"\\$1")}const GA=4;let ce=null;const VA={id:"pan",cursor:"grab",onPointerDown(e,t){if(e.button!==0)return;const n=t.viewport.getViewport(),o=y.getState().readOnly?null:xt(e.target);let r=null;if(o){const i=y.getState();i.selection.includes(o)||i.setSelection([o]);const a=y.getState().selection,s=y.getState().internal,l=new Map,c=new Map;for(const m of a){const u=s.buses.get(m);if(u){c.set(m,[u.geometry.at[0],u.geometry.at[1]]);continue}const p=s.layout.get(m);p&&l.set(m,{...p})}(l.size>0||c.size>0)&&(r={startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),originals:l,busOriginals:c})}ce={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startTx:n.tx,startTy:n.ty,startTarget:e.target,moved:!1,elementDrag:r},t.hostEl.style.cursor="grabbing",e.preventDefault()},onPointerMove(e,t){if(!ce||e.pointerId!==ce.pointerId)return;const n=e.clientX-ce.startX,o=e.clientY-ce.startY;if(!ce.moved&&Math.hypot(n,o)>GA){ce.moved=!0;try{t.hostEl.setPointerCapture(e.pointerId)}catch{}}if(ce.moved){if(ce.elementDrag){const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=de(r[0]-ce.elementDrag.startSvg[0]),a=de(r[1]-ce.elementDrag.startSvg[1]);for(const[s,l]of ce.elementDrag.originals){const c=t.hostEl.querySelector(`[data-element-id="${It(s)}"]`);if(!c)continue;const m={...l,at:[l.at[0]+i,l.at[1]+a]};c.setAttribute("transform",ot(m))}for(const s of ce.elementDrag.busOriginals.keys()){const l=t.hostEl.querySelector(`[data-element-id="${It(s)}"]`);l&&l.setAttribute("transform",`translate(${i} ${a})`)}return}t.viewport.setViewport({tx:ce.startTx+n,ty:ce.startTy+o})}},onPointerUp(e,t){if(!(!ce||e.pointerId!==ce.pointerId)){if(t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId),t.hostEl.style.cursor="grab",ce.elementDrag&&ce.moved){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=de(n[0]-ce.elementDrag.startSvg[0]),r=de(n[1]-ce.elementDrag.startSvg[1]);if(o!==0||r!==0){const i=new Map;for(const a of ce.elementDrag.originals.keys())i.set(a,[o,r]);for(const a of ce.elementDrag.busOriginals.keys())i.set(a,[o,r]);y.getState().moveElements(i)}for(const i of ce.elementDrag.busOriginals.keys()){const a=t.hostEl.querySelector(`[data-element-id="${It(i)}"]`);a&&a.removeAttribute("transform")}}else!ce.moved&&!y.getState().readOnly&&KA(ce.startTarget);ce=null}},onPointerCancel(e,t){if(ce!=null&&ce.elementDrag){for(const[n,o]of ce.elementDrag.originals){const r=t.hostEl.querySelector(`[data-element-id="${It(n)}"]`);r&&r.setAttribute("transform",ot(o))}for(const n of ce.elementDrag.busOriginals.keys()){const o=t.hostEl.querySelector(`[data-element-id="${It(n)}"]`);o&&o.removeAttribute("transform")}}ce=null},onDeactivate(){ce=null}};function KA(e){if(!e)return;const t=y.getState(),n=Vt(e);if(n){t.setSelectedAnnotation(n);return}const o=xt(e);if(o){t.setSelection([o]);return}const r=Dn(e);if(r){t.setSelectedNode(r);return}t.clearSelection()}function It(e){return e.replace(/(["\\])/g,"\\$1")}const Mt={tight:1024,compact:720,dense:520,mini:380},Kr={full:0,tight:1,compact:2,dense:3,mini:4};function De(e,t){return Kr[e]>=Kr[t]}function UA(e){return e>=Mt.tight?"full":e>=Mt.compact?"tight":e>=Mt.dense?"compact":e>=Mt.mini?"dense":"mini"}const lk=P.createContext("full");function it(){return P.useContext(lk)}function XA(e){const[t,n]=P.useState(null);return P.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const a=o.clientWidth;n(s=>s===a?s:a)};if(r(),typeof ResizeObserver>"u")return;const i=new ResizeObserver(r);return i.observe(o),()=>i.disconnect()},[e]),t}function ck(){if(typeof window>"u")return!1;try{if(!window.matchMedia("(pointer: coarse)").matches)return!1}catch{return!1}return window.innerWidth<Mt.dense}function dt(){ck()&&y.getState().setActiveTool("pan")}function YA(){ck()&&y.getState().setPlaceKind(null)}const ZA={id:"wire",cursor:"crosshair",onActivate(e){e.hostEl.classList.add("tool-wire")},onDeactivate(e){e.hostEl.classList.remove("tool-wire");const t=y.getState();t.setWireFromTerminal(null),t.setWireDragFrom(null),t.setCursorSvg(null),nt(null)},onPointerDown(e,t){var a,s;if(e.button!==0)return;e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((s=(a=e.target).hasPointerCapture)!=null&&s.call(a,e.pointerId))&&e.target.releasePointerCapture(e.pointerId);const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=Bt(t,e.clientX,e.clientY),r=Lt(e.target instanceof Element?e.target:null,n,o),i=y.getState();i.setWireDragFrom({spec:r.spec,world:r.world,ref:r.ref}),i.setWireFromTerminal(r.ref),i.setCursorSvg(n)},onPointerMove(e,t){const n=y.getState(),o=n.wireDragFrom;if(!o)return;const r=t.viewport.screenToSvg(e.clientX,e.clientY);n.setCursorSvg(r);const i=_n(e.clientX,e.clientY),a=Lt(i,r,Bt(t,e.clientX,e.clientY)),s={spec:o.spec,world:o.world,ref:o.ref,create:!o.ref};nt(Cn(s,a)?null:sk(a))},onPointerUp(e,t){const n=y.getState(),o=n.wireDragFrom;if(n.setWireFromTerminal(null),n.setWireDragFrom(null),n.setCursorSvg(null),nt(null),!o)return;const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=_n(e.clientX,e.clientY)??(e.target instanceof Element?e.target:null),a=Lt(i,r,Bt(t,e.clientX,e.clientY)),s={spec:o.spec,world:o.world,ref:o.ref,create:!o.ref};Cn(s,a)||(n.connectWire(o.spec,a.spec),dt())},onPointerLeave(){const e=y.getState();e.setWireFromTerminal(null),e.setWireDragFrom(null),e.setCursorSvg(null),nt(null)}},Ur=10;let zt=!1;function Xr(){setTimeout(()=>YA(),0)}const QA={id:"place",cursor:"copy",onActivate(e){e.hostEl.classList.add("tool-place")},onDeactivate(e){e.hostEl.classList.remove("tool-place");const t=y.getState();t.setPlaceFromTerminal(null),t.setCursorSvg(null),zt=!1},onPointerDown(e,t){var i,a;if(e.button!==0)return;const{placeKind:n}=y.getState();if(!n)return;e.preventDefault();const o=Mn(e.target);if(o){e.stopPropagation(),e.target instanceof Element&&((a=(i=e.target).hasPointerCapture)!=null&&a.call(i,e.pointerId))&&e.target.releasePointerCapture(e.pointerId);const s=y.getState();s.setPlaceFromTerminal(o),s.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY));return}const r=t.viewport.screenToSvg(e.clientX,e.clientY);Fv(n,r),zt=!0},onPointerMove(e,t){const n=t.viewport.screenToSvg(e.clientX,e.clientY);y.getState().setCursorSvg([Yr(n[0]),Yr(n[1])])},onPointerUp(e,t){const n=y.getState(),o=n.placeFromTerminal;if(o){n.setPlaceFromTerminal(null);const{placeKind:r}=n;if(!r)return;const i=t.viewport.screenToSvg(e.clientX,e.clientY);wj(r,o,i),Xr();return}zt&&(zt=!1,Xr())},onPointerLeave(){const e=y.getState();e.setPlaceFromTerminal(null),e.setCursorSvg(null)},onPointerCancel(){const e=y.getState();e.setPlaceFromTerminal(null),e.setCursorSvg(null),zt=!1}};function Yr(e){return Math.round(e/Ur)*Ur}const Zr=10,Qr=20;function pt(e){return Math.round(e/Zr)*Zr}const JA={id:"busbar",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=[pt(n[0]),pt(n[1])];y.getState().setBusbarDrawStart(o),y.getState().setCursorSvg(o)},onPointerMove(e,t){const n=t.viewport.screenToSvg(e.clientX,e.clientY);y.getState().setCursorSvg([pt(n[0]),pt(n[1])])},onPointerUp(e,t){const n=y.getState().busbarDrawStart;if(y.getState().setBusbarDrawStart(null),!n)return;const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=pt(o[0]),i=pt(o[1]),a=r-n[0],s=i-n[1],l=Math.abs(a)>=Math.abs(s);let c,m,u;if(l){if(m=Math.abs(a),m<Qr)return;c=0,u=[(n[0]+r)/2,n[1]]}else{if(m=Math.abs(s),m<Qr)return;c=90,u=[n[0],(n[1]+i)/2]}y.getState().addBus(u,m,c),dt()},onPointerLeave(){const e=y.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)},onPointerCancel(){const e=y.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)},onDeactivate(){const e=y.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)}},Jr=10,ei=e=>Math.round(e/Jr)*Jr,eE={id:"junction",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault(),e.stopPropagation();const n=t.viewport.screenToSvg(e.clientX,e.clientY);y.getState().addJunction([ei(n[0]),ei(n[1])]),dt()}},tE={id:"text",cursor:"text",onPointerDown(e,t){if(e.button!==0)return;const n=y.getState(),o=Vt(e.target);if(o){e.preventDefault(),e.stopPropagation(),n.setActiveTool("select"),n.setSelectedAnnotation(o);return}e.preventDefault();const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=n.addAnnotation([r[0],r[1]],"");n.setEditingAnnotation(i),dt()}},nE={id:"rect",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=qe(t.viewport.screenToSvg(e.clientX,e.clientY));y.getState().setAnnotationDraft({kind:"rect",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=y.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:qe(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=y.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=qe(t.viewport.screenToSvg(e.clientX,e.clientY)),{at:i,size:a}=Uv({...o,current:r,constrain:e.shiftKey});if(a[0]<vn||a[1]<vn)return;const s=n.insertAnnotation({type:"rect",at:i,size:a,stroke:"dashed"});n.setSelectedAnnotation(s),n.setActiveTool("select"),dt()},onPointerLeave(){y.getState().setAnnotationDraft(null)},onPointerCancel(){y.getState().setAnnotationDraft(null)},onDeactivate(){y.getState().setAnnotationDraft(null)}},oE={id:"line",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=qe(t.viewport.screenToSvg(e.clientX,e.clientY));y.getState().setAnnotationDraft({kind:"line",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=y.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:qe(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=y.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=qe(t.viewport.screenToSvg(e.clientX,e.clientY)),i=Xv({...o,current:r,constrain:e.shiftKey}),a=i[0]-o.start[0],s=i[1]-o.start[1];if(Math.hypot(a,s)<Nj)return;const l=n.insertAnnotation({type:"line",at:o.start,points:[[0,0],[a,s]]});n.setSelectedAnnotation(l),n.setActiveTool("select"),dt()},onPointerLeave(){y.getState().setAnnotationDraft(null)},onPointerCancel(){y.getState().setAnnotationDraft(null)},onDeactivate(){y.getState().setAnnotationDraft(null)}},ti=15,rE=3,iE=3,aE={id:"table",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=qe(t.viewport.screenToSvg(e.clientX,e.clientY));y.getState().setAnnotationDraft({kind:"table",start:n,current:n,constrain:!1})},onPointerMove(e,t){const n=y.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:qe(t.viewport.screenToSvg(e.clientX,e.clientY))})},onPointerUp(e,t){const n=y.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=qe(t.viewport.screenToSvg(e.clientX,e.clientY)),i=Math.abs(r[0]-o.start[0]),a=Math.abs(r[1]-o.start[1]),s=i<ti&&a<ti,{at:l,cols:c,rows:m}=s?{at:o.start,cols:rE,rows:iE}:Zv({...o,current:r}),u=n.insertAnnotation({type:"table",at:l,...Qv(c,m)});n.setSelectedAnnotation(u),n.setActiveTool("select"),dt()},onPointerLeave(){y.getState().setAnnotationDraft(null)},onPointerCancel(){y.getState().setAnnotationDraft(null)},onDeactivate(){y.getState().setAnnotationDraft(null)}},ni={select:HA,pan:VA,wire:ZA,place:QA,busbar:JA,junction:eE,text:tE,rect:nE,line:oE,table:aE};function sE(e,t){const n=y(r=>r.activeTool),o=y(r=>r.readOnly);P.useEffect(()=>{var h;const r=e.current;if(!r)return;const i=o?"pan":n,a=o?ni.pan:ni[n],s={viewport:t,hostEl:r};r.dataset.tool=i,(h=a.onActivate)==null||h.call(a,s),a.cursor&&(r.style.cursor=a.cursor);const l=g=>{var b;return(b=a.onPointerDown)==null?void 0:b.call(a,g,s)},c=g=>{var b;return(b=a.onPointerMove)==null?void 0:b.call(a,g,s)},m=g=>{var b;return(b=a.onPointerUp)==null?void 0:b.call(a,g,s)},u=g=>{var b;return a.onPointerCancel?a.onPointerCancel(g,s):(b=a.onPointerUp)==null?void 0:b.call(a,g,s)},p=g=>{var b;return(b=a.onPointerLeave)==null?void 0:b.call(a,g,s)},f=g=>{var b;return(b=a.onDoubleClick)==null?void 0:b.call(a,g,s)};return r.addEventListener("pointerdown",l),r.addEventListener("pointermove",c),r.addEventListener("pointerup",m),r.addEventListener("pointercancel",u),r.addEventListener("pointerleave",p),r.addEventListener("dblclick",f),()=>{var g;r.removeEventListener("pointerdown",l),r.removeEventListener("pointermove",c),r.removeEventListener("pointerup",m),r.removeEventListener("pointercancel",u),r.removeEventListener("pointerleave",p),r.removeEventListener("dblclick",f),(g=a.onDeactivate)==null||g.call(a,s),r.style.cursor="",delete r.dataset.tool}},[n,o,e,t])}let Co=1;const $o=new Set;function lE(e){if(e!==Co){Co=e;for(const t of $o)t(e)}}function cE(){return Co}function dE(e){return $o.add(e),()=>{$o.delete(e)}}const eo=.1,to=8,uE=1.0015,mE=1.02;function pE(e,t,n={tx:0,ty:0,scale:1}){const o=P.useRef({...n}),r=P.useRef(new Set),i=()=>{const a=t.current,s=e.current;if(a&&a.setAttribute("transform",`translate(${o.current.tx} ${o.current.ty}) scale(${o.current.scale})`),s&&s.style.setProperty("--canvas-scale",String(o.current.scale)),lE(o.current.scale),r.current.size>0){const l={...o.current};for(const c of r.current)c(l)}};return P.useEffect(()=>{const a=e.current;if(!a)return;let s=!1,l=-1,c=0,m=0,u=0,p=0,f=!1;const h=new Map;let g=null,b=!1;const x=()=>{if(h.size<2){g=null;return}const z=[...h.values()],B=z[1].x-z[0].x,Q=z[1].y-z[0].y,ae=Math.hypot(B,Q)||1,ue=a.getBoundingClientRect();g={startDist:ae,startScale:o.current.scale,startTx:o.current.tx,startTy:o.current.ty,startMidX:(z[0].x+z[1].x)/2-ue.left,startMidY:(z[0].y+z[1].y)/2-ue.top}},v=z=>{if(z.pointerType==="touch"){if(h.set(z.pointerId,{x:z.clientX,y:z.clientY}),h.size>=2&&!b){b=!0;for(const B of h.keys())B!==z.pointerId&&rk(a,B);x()}if(b){z.stopPropagation(),z.preventDefault();try{a.setPointerCapture(z.pointerId)}catch{}}}},T=z=>{if(z.pointerType!=="touch"||!h.has(z.pointerId)||(h.set(z.pointerId,{x:z.clientX,y:z.clientY}),!b||!g))return;z.stopPropagation();const B=[...h.values()];if(B.length<2)return;const Q=B[1].x-B[0].x,ae=B[1].y-B[0].y,ue=Math.hypot(Q,ae)||1,ee=a.getBoundingClientRect(),se=(B[0].x+B[1].x)/2-ee.left,he=(B[0].y+B[1].y)/2-ee.top,xe=ue/g.startDist,$e=no(g.startScale*xe,eo,to),Pe=$e/g.startScale;o.current.tx=g.startMidX-(g.startMidX-g.startTx)*Pe+(se-g.startMidX),o.current.ty=g.startMidY-(g.startMidY-g.startTy)*Pe+(he-g.startMidY),o.current.scale=$e,i()},I=z=>{var B;if(z.pointerType==="touch"&&h.has(z.pointerId)&&(h.delete(z.pointerId),b)){if(z.stopPropagation(),(B=a.hasPointerCapture)!=null&&B.call(a,z.pointerId))try{a.releasePointerCapture(z.pointerId)}catch{}h.size>=2?x():g=null,h.size===0&&(b=!1)}},H=z=>{z.preventDefault();const B=a.getBoundingClientRect(),Q=z.clientX-B.left,ae=z.clientY-B.top,ue=z.ctrlKey||z.metaKey;if(z.deltaX===0||ue){const he=Math.pow(ue?mE:uE,-z.deltaY),xe=no(o.current.scale*he,eo,to),$e=xe/o.current.scale;o.current.tx=Q-(Q-o.current.tx)*$e,o.current.ty=ae-(ae-o.current.ty)*$e,o.current.scale=xe}else o.current.tx-=z.deltaX,o.current.ty-=z.deltaY;i()},K=z=>{const B=z.button===1,Q=f&&z.button===0;!B&&!Q||(z.preventDefault(),s=!0,l=z.pointerId,c=z.clientX,m=z.clientY,u=o.current.tx,p=o.current.ty,a.setPointerCapture(z.pointerId),a.style.cursor="grabbing")},_=z=>{!s||z.pointerId!==l||(o.current.tx=u+(z.clientX-c),o.current.ty=p+(z.clientY-m),i())},F=z=>{s&&z.pointerId===l&&(s=!1,a.releasePointerCapture(z.pointerId),a.style.cursor=f?"grab":"")},W=z=>{if(z.code==="Space"&&!f){const B=z.target;if(B&&(B.tagName==="INPUT"||B.tagName==="TEXTAREA"||B.isContentEditable))return;f=!0,a.style.cursor="grab",z.preventDefault()}},G=z=>{z.code==="Space"&&(f=!1,s||(a.style.cursor=""))};return a.addEventListener("wheel",H,{passive:!1}),a.addEventListener("pointerdown",K),a.addEventListener("pointermove",_),a.addEventListener("pointerup",F),a.addEventListener("pointercancel",F),a.addEventListener("pointerdown",v,{capture:!0}),a.addEventListener("pointermove",T,{capture:!0}),a.addEventListener("pointerup",I,{capture:!0}),a.addEventListener("pointercancel",I,{capture:!0}),window.addEventListener("keydown",W),window.addEventListener("keyup",G),i(),()=>{a.removeEventListener("wheel",H),a.removeEventListener("pointerdown",K),a.removeEventListener("pointermove",_),a.removeEventListener("pointerup",F),a.removeEventListener("pointercancel",F),a.removeEventListener("pointerdown",v,{capture:!0}),a.removeEventListener("pointermove",T,{capture:!0}),a.removeEventListener("pointerup",I,{capture:!0}),a.removeEventListener("pointercancel",I,{capture:!0}),window.removeEventListener("keydown",W),window.removeEventListener("keyup",G)}},[]),{screenToSvg(a,s){const l=e.current;if(!l)return[a,s];const c=l.getBoundingClientRect(),m=(a-c.left-o.current.tx)/o.current.scale,u=(s-c.top-o.current.ty)/o.current.scale;return[m,u]},getViewport(){return{...o.current}},setViewport(a){a.tx!==void 0&&(o.current.tx=a.tx),a.ty!==void 0&&(o.current.ty=a.ty),a.scale!==void 0&&(o.current.scale=no(a.scale,eo,to)),i()},subscribe(a){return r.current.add(a),()=>{r.current.delete(a)}}}}function no(e,t,n){return e<t?t:e>n?n:e}const dk=typeof navigator<"u"&&/Mac|iP(ad|hone|od)/.test(navigator.platform),ht=dk?"⌘":"Ctrl+",hE=dk?"⇧":"Shift+",oo=[10,20,50,100,200,500,1e3,2e3,5e3,1e4],fE=18;function gE(e){for(const t of oo)if(t*e>=fE)return t;return oo[oo.length-1]}function bE(){const e=le(),t=P.useRef(null),n=P.useRef(null),o=P.useRef(null),r=pE(t,n);sE(t,r),RA(t),P.useEffect(()=>(Ir(r),()=>Ir(null)),[r]),P.useEffect(()=>{const m=u=>{const p=o.current;if(!p)return;const h=gE(u.scale)*u.scale;p.setAttribute("width",String(h)),p.setAttribute("height",String(h)),p.setAttribute("patternTransform",`translate(${u.tx} ${u.ty})`)};return m(r.getViewport()),r.subscribe(m)},[r]);const i=X2(),a=P.useCallback((m,u,p)=>{const f=y.getState();if(f.readOnly)return;const h=f.activeTool;if(h==="wire"||h==="busbar"||h==="junction"||h==="place"){ik();return}const g=Vt(p),b=g?null:xt(p);if(g)f.selectedAnnotation!==g&&f.setSelectedAnnotation(g);else if(b)f.selection.includes(b)||f.setSelection([b]);else{const W=Dn(p);W&&f.selectedNode!==W&&f.setSelectedNode(W)}const x=y.getState(),v=x.selection.length>0,T=x.selectedAnnotation!=null,I=v||T,H=x.selectedNode!=null,K=!!x.clipboard,_=x.diagram.elements.length>0,F=[{label:e("menu.undo"),shortcut:`${ht}Z`,icon:zo,onSelect:()=>y.getState().undo(),disabled:x.past.length===0},{label:e("menu.redo"),shortcut:`${ht}${hE}Z`,icon:Io,onSelect:()=>y.getState().redo(),disabled:x.future.length===0},{type:"separator"},{label:e("menu.cut"),shortcut:`${ht}X`,icon:Ri,onSelect:()=>y.getState().cutSelection(),disabled:!I},{label:e("menu.copy"),shortcut:`${ht}C`,icon:Ii,onSelect:()=>y.getState().copySelection(),disabled:!I},{label:e("menu.paste"),shortcut:`${ht}V`,icon:Pi,onSelect:()=>y.getState().pasteClipboard(),disabled:!K},{type:"separator"},{label:e("menu.rotate"),shortcut:"R",icon:Di,onSelect:()=>y.getState().rotateSelection(90),disabled:!v},{label:e("menu.mirror"),shortcut:"M",icon:zi,onSelect:()=>y.getState().mirrorSelection(),disabled:!v},{type:"separator"},{label:e("menu.selectAll"),shortcut:`${ht}A`,icon:h2,onSelect:()=>{const W=y.getState();W.setSelection(W.diagram.elements.map(G=>G.id))},disabled:!_},{type:"separator"},{label:e(H&&!I?"menu.disconnect":"menu.delete"),shortcut:"Del",icon:Li,destructive:!0,onSelect:()=>{const W=y.getState();H&&!I?W.deleteSelectedNode():T&&W.selectedAnnotation?W.deleteAnnotation(W.selectedAnnotation):W.deleteSelection()},disabled:!I&&!H}];i.open(m,u,F)},[i,e]);P.useEffect(()=>{const m=t.current;if(!m)return;const u=700,p=4;let f,h=null;const g=()=>{f!==void 0&&window.clearTimeout(f),f=void 0,h=null},b=T=>{T.pointerType==="touch"&&(g(),h={pointerId:T.pointerId,x:T.clientX,y:T.clientY,target:T.target},f=window.setTimeout(()=>{const I=h;h=null,f=void 0,I&&(rk(m,I.pointerId),a(I.x,I.y,I.target))},u))},x=T=>{if(!h||T.pointerId!==h.pointerId)return;const I=T.clientX-h.x,H=T.clientY-h.y;Math.hypot(I,H)>p&&g()},v=T=>{!h||T.pointerId!==h.pointerId||g()};return m.addEventListener("pointerdown",b),m.addEventListener("pointermove",x),m.addEventListener("pointerup",v),m.addEventListener("pointercancel",v),()=>{g(),m.removeEventListener("pointerdown",b),m.removeEventListener("pointermove",x),m.removeEventListener("pointerup",v),m.removeEventListener("pointercancel",v)}},[a]);const s=m=>{m.dataTransfer.types.includes("application/x-oneline-kind")&&(m.preventDefault(),m.dataTransfer.dropEffect="copy")},l=m=>{if(y.getState().readOnly)return;const u=m.dataTransfer.getData("application/x-oneline-kind");if(!u)return;m.preventDefault();const p=r.screenToSvg(m.clientX,m.clientY);Fv(u,p)},c=m=>{m.preventDefault(),a(m.clientX,m.clientY,m.target)};return d.jsx("div",{ref:t,className:"ole-canvas-root absolute inset-0 overflow-hidden",onDragOver:s,onDrop:l,onContextMenu:c,children:d.jsxs("svg",{className:"ole-canvas-svg block h-full w-full",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("defs",{children:d.jsx("pattern",{ref:o,id:"ole-grid-dots",width:20,height:20,patternUnits:"userSpaceOnUse",children:d.jsx("circle",{cx:0,cy:0,r:2,fill:"var(--canvas-grid-strong)"})})}),d.jsx("rect",{width:"100%",height:"100%",fill:"url(#ole-grid-dots)"}),d.jsxs("g",{ref:n,className:"ole-viewport",children:[d.jsx(oA,{}),d.jsx(_A,{}),d.jsx(uA,{}),d.jsx(hA,{}),d.jsx(_j,{}),d.jsx(zj,{}),d.jsx(xA,{}),d.jsx(Qj,{}),d.jsx(Jj,{}),d.jsx(Fj,{}),d.jsx(vA,{}),d.jsx(jA,{}),d.jsx(rA,{}),d.jsx(Hj,{}),d.jsx(yA,{}),d.jsx(bA,{})]})]})})}const oi=60,yE=.1,xE=8,wE=8;function vE(e,t,n){return e<t?t:e>n?n:e}function kE(){return document.querySelector(".ole-canvas-root")}function Oo(){const e=Ve(),t=kE();if(!e||!t)return!1;const n=t.getBoundingClientRect();if(n.width===0||n.height===0)return!1;const o=t.querySelectorAll("[data-element-id]");if(o.length===0)return e.setViewport({tx:n.width/2,ty:n.height/2,scale:1}),!0;let r=1/0,i=1/0,a=-1/0,s=-1/0;for(const x of o){const v=x.getBoundingClientRect();v.width===0&&v.height===0||(v.left<r&&(r=v.left),v.top<i&&(i=v.top),v.right>a&&(a=v.right),v.bottom>s&&(s=v.bottom))}if(r===1/0)return!1;const[l,c]=e.screenToSvg(r,i),[m,u]=e.screenToSvg(a,s),p=Math.max(m-l,1),f=Math.max(u-c,1),h=vE(Math.min((n.width-oi*2)/p,(n.height-oi*2)/f),yE,xE),g=(l+m)/2,b=(c+u)/2;return e.setViewport({tx:n.width/2-h*g,ty:n.height/2-h*b,scale:h}),!0}function Lo(){let e=wE;const t=()=>{Oo()||--e>0&&requestAnimationFrame(t)};requestAnimationFrame(t)}const ri=10,SE=100;function _E(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(hover: none), (pointer: coarse)").matches}function ii(){const[e,t]=P.useState(IA()),[n,o]=P.useState(!1),[r,i]=P.useState(null),a=P.useRef(null),s=P.useRef(void 0),[l]=P.useState(_E);P.useEffect(()=>zA(h=>t(h)),[]),P.useEffect(()=>{if(window.clearTimeout(s.current),o(!1),i(null),!!e)return s.current=window.setTimeout(()=>o(!0),SE),()=>window.clearTimeout(s.current)},[e]);const c=y(h=>e?h.diagram.elements.find(g=>g.id===e)??null:null);if(P.useLayoutEffect(()=>{if(!n||!e)return;let h=0,g=-1,b=-1;const x=()=>{const v=document.querySelector(`[data-element-id="${CE(e)}"]`),T=a.current;if(v&&T){const I=v.getBoundingClientRect();let H=I.bottom+ri;H+T.offsetHeight>window.innerHeight-4&&(H=I.top-T.offsetHeight-ri);let K=I.left+I.width/2-T.offsetWidth/2;K=Math.max(4,Math.min(K,window.innerWidth-T.offsetWidth-4)),(H!==g||K!==b)&&(i({top:H,left:K}),g=H,b=K)}h=requestAnimationFrame(x)};return h=requestAnimationFrame(x),()=>cancelAnimationFrame(h)},[n,e]),l||!n||!e||!c)return null;const m=rt[c.kind],u=c.name??c.id,p=(m==null?void 0:m.name)??c.kind,f=c.name&&c.name!==c.id;return typeof document>"u"?null:Ei.createPortal(d.jsxs("div",{ref:a,role:"tooltip",className:"ole-root ole-glass pointer-events-none fixed z-[100] flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] leading-snug shadow-md",style:{top:(r==null?void 0:r.top)??-9999,left:(r==null?void 0:r.left)??-9999,opacity:r?1:0,transition:"opacity 80ms ease-out"},children:[d.jsx("span",{className:"font-medium text-foreground",children:u}),f&&d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:c.id}),d.jsx("span",{className:"text-muted-foreground/80",children:"·"}),d.jsx("span",{className:"text-muted-foreground",children:p})]}),document.body)}function CE(e){return e.replace(/(["\\])/g,"\\$1")}function $E({width:e,children:t}){const n=e==null?"full":UA(e);return d.jsx(lk.Provider,{value:n,children:t})}function ai(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jE(...e){return t=>{let n=!1;const o=e.map(r=>{const i=ai(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():ai(e[r],null)}}}}var AE=Symbol.for("react.lazy"),$n=Ce[" use ".trim().toString()];function EE(e){return typeof e=="object"&&e!==null&&"then"in e}function uk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===AE&&"_payload"in e&&EE(e._payload)}function NE(e){const t=PE(e),n=Ce.forwardRef((o,r)=>{let{children:i,...a}=o;uk(i)&&typeof $n=="function"&&(i=$n(i._payload));const s=Ce.Children.toArray(i),l=s.find(zE);if(l){const c=l.props.children,m=s.map(u=>u===l?Ce.Children.count(c)>1?Ce.Children.only(null):Ce.isValidElement(c)?c.props.children:null:u);return d.jsx(t,{...a,ref:r,children:Ce.isValidElement(c)?Ce.cloneElement(c,void 0,m):null})}return d.jsx(t,{...a,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var TE=NE("Slot");function PE(e){const t=Ce.forwardRef((n,o)=>{let{children:r,...i}=n;if(uk(r)&&typeof $n=="function"&&(r=$n(r._payload)),Ce.isValidElement(r)){const a=DE(r),s=ME(i,r.props);return r.type!==Ce.Fragment&&(s.ref=o?jE(o,a):a),Ce.cloneElement(r,s)}return Ce.Children.count(r)>1?Ce.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var IE=Symbol("radix.slottable");function zE(e){return Ce.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IE}function ME(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function DE(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const si=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,li=Fi,RE=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return li(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(c=>{const m=n==null?void 0:n[c],u=i==null?void 0:i[c];if(m===null)return null;const p=si(m)||si(u);return r[c][p]}),s=n&&Object.entries(n).reduce((c,m)=>{let[u,p]=m;return p===void 0||(c[u]=p),c},{}),l=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,m)=>{let{class:u,className:p,...f}=m;return Object.entries(f).every(h=>{let[g,b]=h;return Array.isArray(b)?b.includes({...i,...s}[g]):{...i,...s}[g]===b})?[...c,u,p]:c},[]);return li(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},OE=RE("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ne=Ce.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,...r},i)=>{const a=o?TE:"button";return d.jsx(a,{className:ke(OE({variant:t,size:n,className:e})),ref:i,...r})});Ne.displayName="Button";const LE=350;function Te({content:e,children:t,disabled:n,delayMs:o=LE}){const r=P.useRef(null),i=P.useRef(null),[a,s]=P.useState(!1),[l,c]=P.useState(null),m=P.useId(),u=P.useRef(void 0),p=()=>{n||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>s(!0),o))},f=()=>{window.clearTimeout(u.current),s(!1)};P.useLayoutEffect(()=>{if(!a||!r.current||!i.current)return;const x=r.current.getBoundingClientRect(),v=i.current.getBoundingClientRect(),T=8;let I="top",H=x.top-v.height-T;H<4&&(I="bottom",H=x.bottom+T);let K=x.left+x.width/2-v.width/2;K=Math.max(4,Math.min(K,window.innerWidth-v.width-4)),c({top:H,left:K,side:I})},[a,e]),P.useEffect(()=>()=>window.clearTimeout(u.current),[]),P.useEffect(()=>{if(!a)return;const x=T=>{T.key==="Escape"&&s(!1)},v=()=>s(!1);return window.addEventListener("keydown",x),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("keydown",x),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[a]);const h=t,g=h.props,b=P.cloneElement(h,{ref:x=>{r.current=x;const v=h.ref;typeof v=="function"?v(x):v&&typeof v=="object"&&(v.current=x)},onPointerEnter:x=>{var v;(v=g.onPointerEnter)==null||v.call(g,x),p()},onPointerLeave:x=>{var v;(v=g.onPointerLeave)==null||v.call(g,x),f()},onFocus:x=>{var v;(v=g.onFocus)==null||v.call(g,x),p()},onBlur:x=>{var v;(v=g.onBlur)==null||v.call(g,x),f()},"aria-describedby":a?m:g["aria-describedby"]});return d.jsxs(d.Fragment,{children:[b,a&&typeof document<"u"&&Ei.createPortal(d.jsx("div",{ref:i,id:m,role:"tooltip","data-side":(l==null?void 0:l.side)??"top",className:"ole-root ole-glass pointer-events-none fixed z-[100] max-w-[280px] rounded-md border border-border px-2 py-1 text-[11px] leading-snug text-foreground shadow-md",style:{top:(l==null?void 0:l.top)??-9999,left:(l==null?void 0:l.left)??-9999,opacity:l?1:0,transition:"opacity 80ms ease-out"},children:e}),document.body)]})}const ci=12,BE=56;function HE(){var x;const e=le(),t=y(v=>v.selection),n=y(v=>v.selectedNode),o=y(v=>v.selectedWire),r=y(v=>v.activeTool),i=y(v=>v.rotateSelection),a=y(v=>v.mirrorSelection),s=y(v=>v.deleteSelection),l=y(v=>v.deleteSelectedNode),c=y(v=>v.deleteSelectedWire),m=y(v=>v.resetWirePath),u=y(v=>v.internal.wireRenders),p=o!=null&&((x=u.get(o))==null?void 0:x.userEdited)===!0,f=P.useRef(null);P.useEffect(()=>{const v=f.current;if(!v)return;const T=t.length>0,I=!T&&o!=null,H=!T&&!I&&n!=null;if(!((T||I||H)&&(r==="select"||r==="pan"))){v.style.display="none";return}v.style.display="flex";let _=0,F="";const W=()=>{let G=1/0,z=-1/0,B=1/0,Q=-1/0,ae=!1;const ue=ee=>{ee.width===0&&ee.height===0||(ee.left<G&&(G=ee.left),ee.right>z&&(z=ee.right),ee.top<B&&(B=ee.top),ee.bottom>Q&&(Q=ee.bottom),ae=!0)};if(T)for(const ee of t){const se=document.querySelector(`[data-element-id="${CSS.escape(ee)}"]`);se&&ue(se.getBoundingClientRect())}else if(I&&o){const ee=document.querySelector(`polyline.ole-wire[data-wire-id="${CSS.escape(o)}"]`);ee&&ue(ee.getBoundingClientRect())}else if(H&&n){const ee=document.querySelectorAll(`polyline.ole-wire[data-node-id="${CSS.escape(n)}"]`);for(const se of ee)ue(se.getBoundingClientRect())}if(ae){const ee=(G+z)/2;let se=B-ci,he="-100%";se<BE&&(se=Q+ci,he="0%");const xe=`translate3d(${ee}px, ${se}px, 0) translate(-50%, ${he})`;xe!==F&&(v.style.transform=xe,F=xe)}_=requestAnimationFrame(W)};return _=requestAnimationFrame(W),()=>cancelAnimationFrame(_)},[t,n,o,r]);const h=t.length===0&&o!=null,g=t.length===0&&!h&&n!=null,b=g||h;return d.jsxs("div",{ref:f,role:"toolbar","aria-label":e(h?"ctx.ariaWire":g?"ctx.ariaNode":"ctx.ariaElement"),className:"ole-glass pointer-events-auto fixed left-0 top-0 z-30 hidden items-center gap-0.5 rounded-2xl border border-border p-1 shadow-md",children:[h&&p&&o&&d.jsxs(d.Fragment,{children:[d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{children:d.jsx("span",{className:"font-medium",children:e("ctx.resetWirePath")})}),d.jsx("div",{className:"text-muted-foreground",children:e("ctx.resetWirePathHint")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>m(o),"aria-label":e("ctx.resetWirePath"),children:d.jsx(p2,{})})}),d.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),!b&&d.jsxs(d.Fragment,{children:[d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:e("ctx.rotate")}),d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"R"})]}),d.jsx("div",{className:"text-muted-foreground",children:e("ctx.rotateHint")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>i(90),"aria-label":e("ctx.rotate"),children:d.jsx(Di,{})})}),d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:e("ctx.mirror")}),d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"M"})]}),d.jsx("div",{className:"text-muted-foreground",children:e("ctx.mirrorHint")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>a(),"aria-label":e("ctx.mirrorTitle"),children:d.jsx(zi,{})})}),d.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:e("ctx.delete")}),d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"Del"})]}),d.jsx("div",{className:"text-muted-foreground",children:e(h?"ctx.deleteHintWire":g?"ctx.deleteHintNode":"ctx.deleteHintElement")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",className:"size-7 text-destructive hover:text-destructive",onClick:()=>h?c():g?l():s(),"aria-label":e("ctx.delete"),children:d.jsx(Li,{})})})]})}const di=8,FE=56,jo=".ole-ann-cell-edit-fo",Ao=".ole-free-annotation-edit-fo";function ui(){return document.querySelector(`${jo} input`)??document.querySelector(`${Ao} [contenteditable]`)}function WE(){const e=le(),t=y(a=>a.editingAnnotation),n=y(a=>a.editingCell),o=P.useRef(null);P.useEffect(()=>{const a=o.current;if(!a)return;if(!t){a.style.display="none";return}a.style.display="flex";let s=0,l="";const c=()=>{const m=ui()??document.querySelector(jo)??document.querySelector(Ao)??document.querySelector(`[data-annotation-id="${CSS.escape(t)}"]`);if(m){const u=m.getBoundingClientRect();let p=u.top-di,f="-100%";p<FE&&(p=u.bottom+di,f="0%");const h=`translate3d(${u.left}px, ${p}px, 0) translate(0, ${f})`;h!==l&&(a.style.transform=h,l=h)}s=requestAnimationFrame(c)};return s=requestAnimationFrame(c),()=>cancelAnimationFrame(s)},[t,n]);const r=()=>{var a;(a=ui())==null||a.blur()},i=()=>{var c,m;const a=y.getState(),s=a.editingAnnotation,l=(c=a.diagram.annotations)==null?void 0:c.find(u=>u.id===s);if(!l){a.setEditingAnnotation(null);return}if(Oe(l)==="table"&&a.editingCell){const u=document.querySelector(`${jo} input`),[p,f]=a.editingCell;if(u){u.value=((m=l.cells[p])==null?void 0:m[f])??"",u.blur();return}}else{const u=document.querySelector(`${Ao} [contenteditable]`);if(u){u.innerText=l.text??"",u.blur();return}}a.setEditingAnnotation(null)};return d.jsxs("div",{ref:o,role:"toolbar","aria-label":e("ctx.ariaEdit"),className:"ole-glass pointer-events-auto fixed left-0 top-0 z-40 hidden items-center gap-0.5 rounded-2xl border border-border p-1 shadow-md",children:[d.jsx(Te,{content:d.jsxs("span",{className:"font-medium",children:[e("ctx.done")," · Enter"]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",className:"size-7 text-emerald-600 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-400",onMouseDown:a=>a.preventDefault(),onClick:r,"aria-label":e("ctx.done"),children:d.jsx(Zk,{})})}),d.jsx(Te,{content:d.jsxs("span",{className:"font-medium",children:[e("ctx.cancel")," · Esc"]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",onMouseDown:a=>a.preventDefault(),onClick:i,"aria-label":e("ctx.cancel"),children:d.jsx(jn,{})})})]})}function Rn({open:e,onOpenChange:t,trigger:n,children:o}){const r=P.useRef(null);return P.useEffect(()=>{if(!e)return;const i=s=>{r.current&&!r.current.contains(s.target)&&t(!1)},a=s=>{s.key==="Escape"&&t(!1)};return window.addEventListener("mousedown",i),window.addEventListener("keydown",a),()=>{window.removeEventListener("mousedown",i),window.removeEventListener("keydown",a)}},[e,t]),d.jsxs("div",{ref:r,className:"relative",children:[n,e&&d.jsx("div",{role:"menu",className:"ole-glass absolute bottom-full right-0 mb-1.5 min-w-52 rounded-md border border-border p-1 shadow-md",children:o})]})}const mk="ole-panel-open";function qE(){if(typeof window>"u")return{outlineOpen:!1};try{const e=window.localStorage.getItem(mk);if(!e)return{outlineOpen:!1};const t=JSON.parse(e);return typeof t!="object"||t===null?{outlineOpen:!1}:{outlineOpen:t.outline===!0}}catch{return{outlineOpen:!1}}}function mi(e){try{const t={outline:e.outlineOpen};window.localStorage.setItem(mk,JSON.stringify(t))}catch{}}const Kt=An((e,t)=>({...qE(),setOutlineOpen:n=>{e({outlineOpen:n}),mi(t())},toggleOutline:()=>{e(n=>({outlineOpen:!n.outlineOpen})),mi(t())}})),bn=[.1,.25,.5,.75,1,1.25,1.5,2,3,4,6,8],pk=.1,hk=8,fk="ole-grid";function GE(){try{const e=window.localStorage.getItem(fk);return e==null?!0:e==="1"}catch{return!0}}function VE(e){try{window.localStorage.setItem(fk,e?"1":"0")}catch{}}function KE(e,t,n){return e<t?t:e>n?n:e}function gk(){return document.querySelector(".ole-canvas-root")}function Bo(e){const t=Ve(),n=gk();if(!t||!n)return;const o=n.getBoundingClientRect(),r=o.width/2,i=o.height/2,a=t.getViewport(),s=KE(e,pk,hk),l=s/a.scale;t.setViewport({tx:r-(r-a.tx)*l,ty:i-(i-a.ty)*l,scale:s})}function UE(){const e=Ve();if(!e)return;const t=e.getViewport().scale,n=bn.find(o=>o>t+1e-6)??hk;Bo(n)}function XE(){const e=Ve();if(!e)return;const t=e.getViewport().scale;let n=pk;for(let o=bn.length-1;o>=0;o--)if(bn[o]<t-1e-6){n=bn[o];break}Bo(n)}const mn=[En,6,Be,8,9,10,12,14,16,20,24,28,Nn];function YE(e){y.getState().dispatch(t=>{const n={...t.meta??{},labelMode:e};return{...t,meta:n}})}function Eo(e){y.getState().dispatch(t=>{const n={...t.meta??{}};return e===Be?delete n.labelFontSize:n.labelFontSize=e,{...t,meta:n}})}function pi(e){var o;const t=vt((o=y.getState().diagram.meta)==null?void 0:o.labelFontSize);if(e>0){Eo(mn.find(r=>r>t)??Nn);return}let n=En;for(let r=mn.length-1;r>=0;r--)if(mn[r]<t){n=mn[r];break}Eo(n)}function bk(){const[e,t]=P.useState(()=>GE());return P.useEffect(()=>{const n=gk();n==null||n.classList.toggle("hide-grid",!e),VE(e)},[e]),P.useEffect(()=>{const n=o=>{if(o.metaKey||o.ctrlKey||o.altKey||o.key!=="g"&&o.key!=="G")return;const r=o.target;r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||(o.preventDefault(),t(i=>!i))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),[e,t]}function yk(){const e=le();return d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.zoomOut")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.zoomOutHint")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",onClick:XE,"aria-label":e("view.zoomOut"),children:d.jsx(Po,{})})})}function xk(){const e=le();return d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.zoomIn")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.zoomInHint")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",onClick:UE,"aria-label":e("view.zoomIn"),children:d.jsx(d2,{})})})}function wk(){const e=le(),[t,n]=P.useState(cE);return P.useEffect(()=>dE(n),[]),d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.reset")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.current",{z:Math.round(t*100)})})]}),children:d.jsxs("button",{type:"button",onClick:()=>Bo(1),className:"min-w-12 rounded-md px-2 py-1 text-center text-xs tabular-nums text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":e("view.reset"),children:[Math.round(t*100),"%"]})})}function vk(){const e=le();return d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.fit")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.fitHint")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",onClick:Oo,"aria-label":e("view.fit"),children:d.jsx(s2,{})})})}function kk({grid:e,setGrid:t}){const n=le();return d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:n(e?"view.gridHide":"view.gridShow")}),d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:n("view.gridHotkey")})]}),d.jsx("div",{className:"text-muted-foreground",children:n(e?"view.gridHideHint":"view.gridShowHint")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",onClick:()=>t(o=>!o),"aria-label":n(e?"view.gridHideAria":"view.gridShowAria"),"aria-pressed":e,className:ke(!e&&"text-muted-foreground/60"),children:d.jsx(i2,{})})})}function Sk(){const e=le(),t=y(r=>{var i;return((i=r.diagram.meta)==null?void 0:i.labelMode)??"all"}),n=y(r=>{var i;return vt((i=r.diagram.meta)==null?void 0:i.labelFontSize)}),o=[{value:"off",label:e("view.labelOff")},{value:"id",label:e("view.labelId")},{value:"all",label:e("view.labelAll")}];return d.jsxs("div",{className:"flex flex-col gap-1.5 px-1.5 py-1",children:[d.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:e("view.label")}),d.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:o.map(r=>d.jsx("button",{type:"button","aria-pressed":t===r.value,onClick:()=>YE(r.value),className:ke("h-7 flex-1 whitespace-nowrap px-1.5 text-[11px] transition-colors",t===r.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.label},r.value))}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"text-[11px] text-muted-foreground",children:e("view.labelSize")}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{type:"button","aria-label":e("view.labelSizeSmaller"),disabled:n<=En,onClick:()=>pi(-1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"−"}),d.jsx("button",{type:"button","aria-label":e("view.labelSizeReset"),onClick:()=>Eo(Be),className:"w-9 rounded-md py-1 text-center font-mono text-[11px] tabular-nums hover:bg-accent hover:text-accent-foreground",children:n}),d.jsx("button",{type:"button","aria-label":e("view.labelSizeLarger"),disabled:n>=Nn,onClick:()=>pi(1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"+"})]})]})]})}function ZE(){const e=le(),[t,n]=P.useState(!1),o=y(r=>{var i;return((i=r.diagram.meta)==null?void 0:i.labelMode)??"all"});return d.jsx(Rn,{open:t,onOpenChange:n,trigger:d.jsx(Te,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.label")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.labelHint")})]}),children:d.jsx(Ne,{variant:"ghost",size:"icon",onClick:()=>n(r=>!r),"aria-label":e("view.label"),"aria-expanded":t,className:ke(o==="off"&&"text-muted-foreground/60"),children:d.jsx(Bi,{})})}),children:d.jsx(Sk,{})})}function QE({stacked:e}={}){const t=le(),[n,o]=P.useState(!1),[r,i]=bk(),a=d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:t("view.menu")}),d.jsx("div",{className:"text-muted-foreground",children:t("view.menuHint")})]}),s=e?d.jsx(Te,{content:a,children:d.jsxs("button",{type:"button",onClick:()=>o(l=>!l),"aria-label":t("view.menu"),"aria-pressed":n,className:ke("flex h-12 w-12 flex-col items-center justify-center gap-0.5 rounded-md text-[10px] font-medium leading-tight transition-colors",n?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[d.jsx(so,{className:"size-4"}),d.jsx("span",{className:"max-w-full truncate",children:t("view.menu")})]})}):d.jsx(Te,{content:a,children:d.jsx(Ne,{variant:"ghost",size:"icon",onClick:()=>o(l=>!l),"aria-label":t("view.menu"),"aria-pressed":n,children:d.jsx(so,{})})});return d.jsx(Rn,{open:n,onOpenChange:o,trigger:s,children:d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(wk,{}),d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx(yk,{}),d.jsx(xk,{})]}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx(vk,{}),d.jsx(kk,{grid:r,setGrid:i})]}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsx(Sk,{})]})})}function hi(){const e=it();return!y(n=>n.readOnly)&&De(e,"dense")?null:d.jsx(JE,{tier:e})}function JE({tier:e}){const t=De(e,"tight"),n=y(i=>i.readOnly),[o,r]=bk();return d.jsx("div",{className:"absolute z-50",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))",right:"calc(0.75rem + env(safe-area-inset-right, 0px))"},children:d.jsxs("div",{className:"ole-glass flex items-center gap-0.5 rounded-2xl border border-border p-1.5 shadow-sm",children:[d.jsx(yk,{}),!t&&d.jsx(wk,{}),d.jsx(xk,{}),d.jsx("div",{"aria-hidden":!0,className:"mx-1 h-4 w-px bg-border"}),d.jsx(vk,{}),d.jsx(kk,{grid:o,setGrid:r}),!n&&d.jsx(ZE,{})]})})}const fi=[{id:"select",labelKey:"tool.select",hotkey:"V",descriptionKey:"tool.selectHint",icon:l2,switchTo:"select",iconOnly:!0},{id:"pan",labelKey:"tool.pan",hotkey:"H",descriptionKey:"tool.panHint",icon:a2,switchTo:"pan",groupBreakAfter:!0,iconOnly:!0},{id:"busbar",labelKey:"tool.bus",hotkey:"B",descriptionKey:"tool.busHint",icon:Po,switchTo:"busbar"},{id:"junction",labelKey:"tool.junction",hotkey:"J",descriptionKey:"tool.junctionHint",icon:Jk,switchTo:"junction",iconOnly:!0},{id:"place",labelKey:"tool.place",hotkey:"P",descriptionKey:"tool.placeHint",icon:Oi,switchTo:"place"},{id:"wire",labelKey:"tool.wire",hotkey:"W",descriptionKey:"tool.wireHint",icon:Ti,switchTo:"wire",groupBreakAfter:!0},{id:"text",labelKey:"tool.text",hotkey:"T",descriptionKey:"tool.textHint",icon:Bi,switchTo:"text",iconOnly:!0},{id:"rect",labelKey:"tool.rect",hotkey:"F",descriptionKey:"tool.rectHint",icon:f2,switchTo:"rect",iconOnly:!0},{id:"line",labelKey:"tool.line",hotkey:"L",descriptionKey:"tool.lineHint",icon:m2,switchTo:"line",iconOnly:!0},{id:"table",labelKey:"tool.table",hotkey:"D",descriptionKey:"tool.tableHint",icon:g2,switchTo:"table",iconOnly:!0}];function e6(){const e=le(),t=y(p=>p.activeTool),n=y(p=>p.placeKind),o=y(p=>p.placeFromTerminal),r=y(p=>p.wireDragFrom),i=y(p=>p.busbarDrawStart),a=y(p=>p.selection.length>0||p.selectedNode!=null),s=y(p=>p.editingAnnotation),l=y(p=>{var g;const f=p.selectedAnnotation;if(!f)return null;const h=(g=p.diagram.annotations)==null?void 0:g.find(b=>b.id===f);return h?Oe(h):null});if(s)return d.jsx("div",{className:"ole-glass pointer-events-none flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground shadow-sm",children:d.jsx("span",{children:e("mode.annEditing")})});let c=null,m=!1;switch(t){case"select":if(l){c=e(l==="table"?"mode.annTableSel":l==="text"?"mode.annTextSel":"mode.annShapeSel"),m=!0;break}c=e(a?"mode.selectWithSel":"mode.selectEmpty"),a&&(m=!0);break;case"pan":c=e("mode.pan");break;case"wire":c=e(r?"mode.wireDragging":"mode.wireInit"),m=!0;break;case"busbar":c=e(i?"mode.busDragging":"mode.busInit"),m=!0;break;case"junction":c=e("mode.junction"),m=!0;break;case"place":n?o?c=e("mode.placeFromTerm"):c=e("mode.placeNormal"):c=e("mode.placeNoKind"),m=!0;break;case"text":c=e("mode.text"),m=!0;break;case"rect":c=e("mode.rect"),m=!0;break;case"line":c=e("mode.line"),m=!0;break;case"table":c=e("mode.table"),m=!0;break}if(!c)return null;const u=e(t==="select"?"mode.escSelect":"mode.escOther");return d.jsxs("div",{className:"ole-glass pointer-events-none flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground shadow-sm",children:[d.jsx("span",{children:c}),m&&d.jsxs("span",{className:"text-muted-foreground/70",children:["· ",u]})]})}function t6(){const e=le(),t=y(x=>x.activeTool),n=y(x=>x.placeKind),o=y(x=>x.setActiveTool),r=y(x=>x.past.length),i=y(x=>x.future.length),a=y(x=>x.undo),s=y(x=>x.redo),l=it(),c=De(l,"tight"),m=!De(l,"dense"),u=De(l,"dense"),p=new Set(["select","text","rect","line","table"]),f=u?fi.filter(x=>!p.has(x.id)):fi,h=x=>t===x.switchTo,[g,b]=P.useState(!1);return d.jsxs("div",{className:"absolute left-1/2 z-20 flex -translate-x-1/2 flex-col items-center gap-1.5",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))"},children:[m&&d.jsx("div",{className:ke("transition-opacity duration-150",g&&"pointer-events-none opacity-0"),children:d.jsx(e6,{})}),d.jsxs("div",{onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),className:ke("ole-glass flex flex-row items-center rounded-2xl border border-border shadow-sm",u?"gap-0.5 p-1":"gap-0.5 p-1.5"),children:[u&&d.jsx(n6,{stacked:!0}),f.map(x=>{const v=x.icon,T=h(x),I=x.id==="place"&&T&&n==null?e("tool.placeNoKindTooltip"):e(x.descriptionKey);return d.jsxs(P.Fragment,{children:[d.jsx(gt,{icon:v,label:e(x.labelKey),hotkey:x.hotkey,active:T,iconOnly:!u&&(x.iconOnly||c),stacked:u,description:I,onClick:()=>{o(x.switchTo,{placeKind:x.presetPlaceKind!==void 0?x.presetPlaceKind:void 0})}}),x.groupBreakAfter&&!u&&d.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"})]},x.id)}),!u&&d.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"}),u?d.jsx(r6,{stacked:!0}):d.jsxs(d.Fragment,{children:[d.jsx(gt,{icon:zo,label:e("tool.undo"),hotkey:"⌘Z",description:e("tool.undoHint"),iconOnly:!0,disabled:r===0,onClick:a}),d.jsx(gt,{icon:Io,label:e("tool.redo"),hotkey:"⌘⇧Z",description:e("tool.redoHint"),iconOnly:!0,disabled:i===0,onClick:s}),d.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"}),d.jsx(o6,{iconOnly:c})]}),u&&d.jsx(QE,{stacked:!0})]})]})}function n6({stacked:e}){const t=le(),n=Kt(r=>r.outlineOpen),o=Kt(r=>r.toggleOutline);return d.jsx(gt,{icon:Mi,label:t("outline.title"),active:n,iconOnly:!0,stacked:e,onClick:o})}function gt({icon:e,label:t,hotkey:n,active:o,disabled:r,iconOnly:i,stacked:a,onClick:s,description:l}){const c=d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:t}),n&&d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:n})]}),l&&d.jsx("div",{className:"text-muted-foreground",children:l})]});return d.jsx(Te,{content:c,disabled:r,children:d.jsxs("button",{type:"button",onClick:s,disabled:r,"aria-label":t,"aria-pressed":o,className:ke("rounded-md font-medium transition-colors",a?"flex h-12 w-12 flex-col items-center justify-center gap-0.5 text-[10px] leading-tight":"flex h-9 items-center gap-1.5 text-xs",!a&&(i?"w-9 justify-center":"px-2.5"),o?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground",r&&"pointer-events-none opacity-40"),children:[d.jsxs("span",{className:"relative inline-flex shrink-0",children:[d.jsx(e,{className:"size-4"}),n&&!a&&d.jsx("span",{"aria-hidden":!0,className:ke("pointer-events-none absolute -right-1.5 -top-1.5 rounded-sm px-1 font-mono text-[8px] leading-[1.1]",o?"bg-primary-foreground/20 text-primary-foreground/85":"bg-foreground/10 text-muted-foreground"),children:n})]}),a?d.jsx("span",{className:"max-w-full truncate",children:t}):!i&&d.jsx("span",{children:t})]})})}function _k(){const e=y(r=>r.diagram.elements),t=y(r=>r.diagram.layout),n=y(r=>r.selection),o=t??{};return{hasAnyElement:e.length>0,hasArrangedAny:Object.keys(o).length>0,hasGapsAll:e.some(r=>!o[r.id]),hasSelection:n.length>0,selectionHasArranged:n.some(r=>!!o[r]),selectionHasGaps:n.some(r=>!o[r])}}function o6({iconOnly:e}){const t=le(),[n,o]=P.useState(!1),r=_k(),i=a=>()=>{o(!1),a()};return d.jsxs(Rn,{open:n,onOpenChange:o,trigger:d.jsx(gt,{icon:Dt,label:t("layout.label"),description:t("layout.hint"),active:n,iconOnly:e,onClick:()=>o(a=>!a)}),children:[d.jsx(ze,{onClick:i(()=>y.getState().autoArrangeAll()),icon:d.jsx(Dt,{}),disabled:!r.hasAnyElement||!r.hasArrangedAny,children:t("layout.allAuto")}),d.jsx(ze,{onClick:i(()=>y.getState().autoArrangeSelection()),icon:d.jsx(Dt,{}),disabled:!r.hasSelection||!r.selectionHasArranged,children:t("layout.selAuto")}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsx(ze,{onClick:i(()=>y.getState().fillUnplacedAll()),icon:d.jsx(yn,{}),disabled:!r.hasGapsAll,children:t("layout.allFill")}),d.jsx(ze,{onClick:i(()=>y.getState().fillUnplacedSelection()),icon:d.jsx(yn,{}),disabled:!r.hasSelection||!r.selectionHasGaps,children:t("layout.selFill")})]})}function r6({stacked:e}){const t=le(),[n,o]=P.useState(!1),r=y(p=>p.past.length),i=y(p=>p.future.length),a=y(p=>p.undo),s=y(p=>p.redo),l=y(p=>p.selection.length>0),c=y(p=>p.clipboard!=null),m=_k(),u=p=>()=>{o(!1),p()};return d.jsxs(Rn,{open:n,onOpenChange:o,trigger:d.jsx(gt,{icon:so,label:t("tool.more"),description:t("tool.moreHint"),active:n,iconOnly:!0,stacked:e,onClick:()=>o(p=>!p)}),children:[d.jsx(ze,{onClick:u(a),icon:d.jsx(zo,{}),disabled:r===0,children:t("tool.undo")}),d.jsx(ze,{onClick:u(s),icon:d.jsx(Io,{}),disabled:i===0,children:t("tool.redo")}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsx(ze,{onClick:u(()=>y.getState().cutSelection()),icon:d.jsx(Ri,{}),disabled:!l,children:t("menu.cut")}),d.jsx(ze,{onClick:u(()=>y.getState().copySelection()),icon:d.jsx(Ii,{}),disabled:!l,children:t("menu.copy")}),d.jsx(ze,{onClick:u(()=>y.getState().pasteClipboard()),icon:d.jsx(Pi,{}),disabled:!c,children:t("menu.paste")}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsx(ze,{onClick:u(()=>y.getState().autoArrangeAll()),icon:d.jsx(Dt,{}),disabled:!m.hasAnyElement||!m.hasArrangedAny,children:t("layout.allAuto")}),d.jsx(ze,{onClick:u(()=>y.getState().autoArrangeSelection()),icon:d.jsx(Dt,{}),disabled:!m.hasSelection||!m.selectionHasArranged,children:t("layout.selAuto")}),d.jsx(ze,{onClick:u(()=>y.getState().fillUnplacedAll()),icon:d.jsx(yn,{}),disabled:!m.hasGapsAll,children:t("layout.allFill")}),d.jsx(ze,{onClick:u(()=>y.getState().fillUnplacedSelection()),icon:d.jsx(yn,{}),disabled:!m.hasSelection||!m.selectionHasGaps,children:t("layout.selFill")})]})}function ze({children:e,icon:t,onClick:n,disabled:o}){return d.jsxs("button",{type:"button",role:"menuitem",disabled:o,onClick:n,className:ke("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",o&&"pointer-events-none text-muted-foreground opacity-60 hover:bg-transparent"),children:[t,d.jsx("span",{className:"flex-1",children:e})]})}function i6(){const e=Kt(r=>r.outlineOpen),t=Kt(r=>r.setOutlineOpen),n=it();return De(n,"dense")?e?d.jsx("div",{className:"absolute z-10",style:{left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",bottom:"calc(4rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px) + 0.75rem)"},children:d.jsx(gi,{onClose:()=>t(!1),sheet:!0})}):null:d.jsx("div",{className:"absolute z-10 flex flex-col items-start",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))",left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",maxHeight:"calc(100% - 1.5rem)"},children:e?d.jsx(gi,{onClose:()=>t(!1)}):d.jsx(a6,{onClick:()=>t(!0)})})}function a6({onClick:e}){const t=le(),n=it(),o=De(n,"compact");return d.jsxs("button",{type:"button",onClick:e,"aria-label":t("outline.title"),title:t("outline.title"),className:ke("ole-glass flex h-12 items-center rounded-2xl border border-border text-muted-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",o?"w-12 justify-center":"gap-2 px-3"),children:[d.jsx(Mi,{className:"size-4 shrink-0"}),!o&&d.jsx("span",{className:"text-xs font-medium",children:t("outline.title")})]})}function gi({onClose:e,sheet:t}){const n=le(),o=y(c=>c.diagram.elements),r=y(c=>c.activeTool==="place"),i=it(),a=De(i,"compact"),s=De(i,"dense"),l=t?"min(50vh, calc(100vh - 9rem))":r?"min(40vh, calc(100vh - 200px))":"min(70vh, calc(100vh - 100px))";return d.jsxs("aside",{className:ke("ole-glass flex flex-col overflow-hidden rounded-2xl border border-border shadow-sm",t?"w-full":a?"w-52":"w-64"),style:{height:l},children:[d.jsxs("button",{type:"button",onClick:e,"aria-label":n("outline.collapseAria"),title:n("outline.collapse"),className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2 text-left transition-colors hover:bg-muted/40",children:[d.jsx("span",{className:"flex-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:n("outline.title")}),!s&&d.jsx(l6,{children:o.length}),d.jsx(c2,{className:"size-3.5 text-muted-foreground"})]}),d.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:o.length===0?d.jsx("p",{className:"px-2 py-2 text-xs italic text-muted-foreground",children:n("outline.empty")}):d.jsx("ul",{className:"space-y-px",children:o.map(c=>d.jsx(s6,{element:c},c.id))})})]})}function s6({element:e}){const t=rt[e.kind],n=y(l=>l.selection.includes(e.id)),o=y(l=>l.setSelection),r=y(l=>l.toggleInSelection),i=it(),a=!De(i,"compact"),s=l=>{l.shiftKey||l.metaKey||l.ctrlKey?r(e.id):o([e.id])};return d.jsxs("li",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1 hover:bg-accent data-[selected=true]:bg-[color-mix(in_oklch,var(--selection)_18%,transparent)]",title:e.note??`${e.name??e.id} (${e.kind})`,"data-element-id":e.id,"data-selected":n?"true":void 0,onClick:s,children:[d.jsx("div",{className:"flex h-4 w-6 shrink-0 items-center justify-center",children:t&&d.jsx("svg",{viewBox:t.viewBox,className:"ole-symbol size-full",preserveAspectRatio:"xMidYMid meet",dangerouslySetInnerHTML:{__html:t.svg}})}),d.jsx("span",{className:"flex-1 truncate text-xs text-foreground/90 group-hover:text-accent-foreground",children:e.name??e.id}),a&&d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:e.id})]})}function l6({children:e}){return d.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e})}const c6={"arc-suppression-coil.name":"消弧线圈","arrester.name":"避雷器 (FBL)","async-motor.name":"异步电动机","autotransformer.name":"自耦变压器","battery.name":"电池储能","breaker.name":"断路器 (QF)","busbar.name":"母线段","converter-bidir.name":"双向变流器 (PCS)","dc-dc-converter.name":"DC/DC 变换器","mppt.name":"MPPT 控制器","ct.name":"电流互感器 (CT)","disconnector.name":"隔离开关 (QS)","earth.name":"接地","earthing-switch.name":"接地刀闸 (QE)","fuse.name":"熔断器 (FU)","generator.name":"发电机 (G)","grid-source.name":"系统电源","grounding-transformer.name":"接地变 (Z形)","inverter.name":"逆变器 (DC→AC)","load-switch.name":"负荷开关","load.name":"负荷","luminaire.name":"灯具 / 照明负荷","panelboard.name":"配电箱","ngr.name":"中性点电阻 (NGR)","pt.name":"电压互感器 (PT)","pv.name":"光伏组件","rectifier.name":"整流器 (AC→DC)","series-reactor.name":"串联电抗器","shunt-capacitor.name":"并联电容器","shunt-reactor.name":"并联电抗器","sync-motor.name":"同步电动机","transformer-2w.name":"双绕组变压器","transformer-3w.name":"三绕组变压器","wind-turbine.name":"风力发电机","gfci-breaker.name":"GFCI 断路器 (RCBO)","rcd.name":"剩余电流装置 (RCD)","recloser.name":"重合闸 (Recloser)","energy-meter.name":"电能表 (Wh)","voltmeter.name":"电压表 (V)","ammeter.name":"电流表 (A)","wattmeter.name":"功率表 (W)","frequency-meter.name":"频率表 (Hz)","contactor.name":"接触器 (KM)","motor-starter.name":"电机启动器","thermal-overload.name":"热过载继电器","vfd.name":"变频器 (VFD)","soft-starter.name":"软启动器","transfer-switch.name":"切换开关 (ATS)","dc-disconnector.name":"直流隔离开关","dc-combiner.name":"直流汇流箱","ev-charger.name":"EV 充电桩","arc-suppression-coil.desc":"中性点谐振接地:电感线圈连接到地","busbar.desc":"可拉伸单母线段,多设备挂接","converter-bidir.desc":"储能变流器:双向 AC ↔ DC","dc-dc-converter.desc":"DC/DC 变换器 / 直流充电器(IEC 60617)","mppt.desc":"MPPT 太阳能充电控制器(DC/DC,最大功率点跟踪)","earthing-switch.desc":"隔离开关 + 接地连接,单端口","grid-source.desc":"无穷大母线 / 外部电网","grounding-transformer.desc":"星-曲折接线变压器,中性点接地用","load.desc":"抽象负荷(电流流出箭头)","luminaire.desc":"照明负荷(IEC 60617 荧光灯具通用符号)","panelboard.desc":"配电箱 / 负荷中心(IEC 分配中心符号):底部进线,箱顶分路示意","ngr.desc":"小电阻接地:连接变压器中性点到地","series-reactor.desc":"与并联电抗器同符号;通过用法区分","wind-turbine.desc":"风机:发电机 + 三叶轮标记","gfci-breaker.desc":"剩余电流断路器带过流保护 (UL943 / IEC 61009)。北美 GFCI / 欧洲 RCBO。","rcd.desc":"不带过流保护的剩余电流断路器 (IEC 61008)。","recloser.desc":"中压自动重合闸开关。","energy-meter.desc":"有功电能表 (kWh) — 服务入口 / 子表。","contactor.desc":"主回路接触器, 通常配热继电器和电机使用。","motor-starter.desc":"电机启动器 (IEC 60617 通用符号)。","thermal-overload.desc":"电机热过载保护继电器, 通常串接在接触器和电机之间。","vfd.desc":"Variable Frequency Drive — 异步电动机调速。","soft-starter.desc":"电机软启动器 (晶闸管降压启动)。","transfer-switch.desc":"双源切换开关 (Automatic / Manual Transfer Switch)。两个电源输入 + 一个负荷输出, 互锁不并联。","dc-disconnector.desc":"DC 隔离开关 — 光伏组串 / 储能 直流侧隔离。","dc-combiner.desc":"光伏组串汇流箱 (4 路输入示例)。","ev-charger.desc":"电动汽车充电站 / 充电桩。","breaker.state.open":"断开","disconnector.state.open":"断开","earthing-switch.state.open":"断开","fuse.state.blown":"熔断","load-switch.state.open":"断开","gfci-breaker.state.open":"断开","rcd.state.open":"断开","recloser.state.open":"断开","contactor.state.open":"断开","thermal-overload.state.tripped":"动作","transfer-switch.state.position":"位置 (normal/emergency/off)","dc-disconnector.state.open":"断开","battery.param.E":"容量","busbar.param.Un":"额定电压","converter-bidir.param.S":"容量","dc-dc-converter.param.P":"功率","mppt.param.I":"额定电流","load.param.P":"有功功率","load.param.cosphi":"功率因数","ngr.param.R":"电阻","shunt-capacitor.param.Q":"无功容量","shunt-capacitor.param.stages":"分组数","transformer-2w.param.S":"容量","transformer-2w.param.ratio":"变比","gfci-breaker.param.In":"额定电流","gfci-breaker.param.IDn":"剩余动作电流","rcd.param.IDn":"剩余动作电流","breaker.param.In":"额定电流","breaker.param.poles":"极数","breaker.param.Icu":"分断能力","disconnector.param.In":"额定电流","fuse.param.In":"额定电流"},d6={"arc-suppression-coil.name":"Arc-suppression coil","arrester.name":"Surge arrester (FBL)","async-motor.name":"Asynchronous motor","autotransformer.name":"Autotransformer","battery.name":"Battery storage","breaker.name":"Circuit breaker (QF)","busbar.name":"Busbar segment","converter-bidir.name":"Bidirectional converter (PCS)","dc-dc-converter.name":"DC/DC converter","mppt.name":"MPPT controller","ct.name":"Current transformer (CT)","disconnector.name":"Disconnector (QS)","earth.name":"Earth","earthing-switch.name":"Earthing switch (QE)","fuse.name":"Fuse (FU)","generator.name":"Generator (G)","grid-source.name":"Grid source","grounding-transformer.name":"Grounding transformer (zig-zag)","inverter.name":"Inverter (DC→AC)","load-switch.name":"Load break switch","load.name":"Load","luminaire.name":"Luminaire (lighting load)","panelboard.name":"Panelboard / load center","ngr.name":"Neutral grounding resistor (NGR)","pt.name":"Voltage transformer (PT)","pv.name":"PV module","rectifier.name":"Rectifier (AC→DC)","series-reactor.name":"Series reactor","shunt-capacitor.name":"Shunt capacitor","shunt-reactor.name":"Shunt reactor","sync-motor.name":"Synchronous motor","transformer-2w.name":"Two-winding transformer","transformer-3w.name":"Three-winding transformer","wind-turbine.name":"Wind turbine","gfci-breaker.name":"GFCI breaker (RCBO)","rcd.name":"Residual current device (RCD)","recloser.name":"Recloser","energy-meter.name":"Energy meter (Wh)","voltmeter.name":"Voltmeter (V)","ammeter.name":"Ammeter (A)","wattmeter.name":"Wattmeter (W)","frequency-meter.name":"Frequency meter (Hz)","contactor.name":"Contactor (KM)","motor-starter.name":"Motor starter","thermal-overload.name":"Thermal overload relay","vfd.name":"Variable frequency drive (VFD)","soft-starter.name":"Soft starter","transfer-switch.name":"Transfer switch (ATS)","dc-disconnector.name":"DC disconnector","dc-combiner.name":"DC combiner box","ev-charger.name":"EV charger","arc-suppression-coil.desc":"Resonant neutral grounding: inductor to earth","busbar.desc":"Stretchable single-bus segment with multiple taps","converter-bidir.desc":"Storage converter: bidirectional AC ↔ DC","dc-dc-converter.desc":"DC/DC converter / DC charger (IEC 60617)","mppt.desc":"MPPT solar charge controller (DC/DC, maximum power point tracking)","earthing-switch.desc":"Disconnector + earth connection, single port","grid-source.desc":"Infinite bus / external grid","grounding-transformer.desc":"Wye-zigzag transformer for neutral grounding","load.desc":"Abstract load (current-out arrow)","luminaire.desc":"Lighting load (IEC 60617 general luminaire symbol)","ngr.desc":"Low-resistance grounding: transformer neutral to earth","series-reactor.desc":"Same symbol as shunt reactor; distinguished by usage","wind-turbine.desc":"Wind turbine: generator + three-blade rotor mark","gfci-breaker.desc":"Residual-current breaker with overcurrent (UL943 / IEC 61009). NA GFCI / EU RCBO.","rcd.desc":"Residual-current breaker without overcurrent (IEC 61008).","recloser.desc":"Medium-voltage automatic recloser.","energy-meter.desc":"Active energy meter (kWh) — service entrance / submeter.","contactor.desc":"Main-circuit contactor; typically used with a thermal overload and a motor.","motor-starter.desc":"Motor starter (IEC 60617 general symbol).","thermal-overload.desc":"Motor thermal-overload relay; sits between the contactor and the motor.","vfd.desc":"Variable Frequency Drive for induction motor speed control.","soft-starter.desc":"Motor soft-starter (thyristor-based reduced-voltage starting).","transfer-switch.desc":"Two-source transfer switch (ATS / manual). Two source inputs + one load output, mechanically interlocked.","dc-disconnector.desc":"DC isolating switch — PV string / battery DC-side isolation.","dc-combiner.desc":"PV string combiner box (4-input example).","ev-charger.desc":"Electric vehicle charging station.","breaker.state.open":"Open","disconnector.state.open":"Open","earthing-switch.state.open":"Open","fuse.state.blown":"Blown","load-switch.state.open":"Open","gfci-breaker.state.open":"Open","rcd.state.open":"Open","recloser.state.open":"Open","contactor.state.open":"Open","thermal-overload.state.tripped":"Tripped","transfer-switch.state.position":"Position (normal/emergency/off)","dc-disconnector.state.open":"Open","battery.param.E":"Capacity","busbar.param.Un":"Rated voltage","converter-bidir.param.S":"Capacity","dc-dc-converter.param.P":"Power","mppt.param.I":"Rated current","load.param.P":"Active power","load.param.cosphi":"Power factor","ngr.param.R":"Resistance","shunt-capacitor.param.Q":"Reactive capacity","shunt-capacitor.param.stages":"Stages","transformer-2w.param.S":"Capacity","transformer-2w.param.ratio":"Ratio","gfci-breaker.param.In":"Rated current","gfci-breaker.param.IDn":"Residual operating current","rcd.param.IDn":"Residual operating current","breaker.param.In":"Rated current","breaker.param.poles":"Poles","breaker.param.Icu":"Breaking capacity","disconnector.param.In":"Rated current","fuse.param.In":"Rated current","resistor.name":"Resistor (R)","capacitor.name":"Capacitor (C)","diode.name":"Diode (D)","indicator-light.name":"Indicator light (HL)","push-button.name":"Push-button (SB)","relay-coil.name":"Relay coil (KA)","make-contact.name":"NO contact (NO)","break-contact.name":"NC contact (NC)","bell.name":"Bell (HA)","terminal.name":"Terminal / junction (X)","fuse-switch-disconnector.name":"Fuse switch-disconnector","socket-outlet.name":"Socket outlet / connector","inductor.name":"Inductor (L)","voltage-regulator.name":"Voltage regulator (T)","dc-motor.name":"DC motor (M)","heater.name":"Heating element (EH)","selector-switch.name":"Selector switch (SA)","limit-switch.name":"Limit switch (SQ)","proximity-switch.name":"Proximity switch (SQ)","time-relay.name":"Time relay (KT)","buzzer.name":"Buzzer (HA)","siren.name":"Siren (HA)","thermocouple.name":"Thermocouple (BT)","thyristor.name":"Thyristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Zener diode (D)","igbt.name":"IGBT","plc.name":"PLC / controller","ups.name":"UPS","power-supply.name":"Power supply (PS)","genset.name":"Generator set (G)","protective-relay.name":"Protective relay","overcurrent-relay.name":"Overcurrent relay (50/51)","undervoltage-relay.name":"Undervoltage relay (27)","reverse-power-relay.name":"Reverse-power relay (32)","distance-relay.name":"Distance relay (21)","phase-failure-relay.name":"Phase-failure relay","buchholz-relay.name":"Buchholz relay (63)","power-factor-meter.name":"Power-factor meter (cosφ)","synchronoscope.name":"Synchronoscope","varmeter.name":"Varmeter (var)","resistor.desc":"General resistor / current-limiting / braking resistor.","capacitor.desc":"General / filter / DC-bus capacitor. Use shunt capacitor for PF correction.","diode.desc":"Rectifier / freewheeling / protection diode. t1 = anode (top), t2 = cathode (bottom).","indicator-light.desc":"Signal / status indicator light.","push-button.desc":"Manual push-button, automatic return (NO make).","relay-coil.desc":"Relay / contactor operating coil (box).","make-contact.desc":"Normally-open auxiliary contact (make).","break-contact.desc":"Normally-closed auxiliary contact (break).","bell.desc":"Signal bell / alarm bell.","terminal.desc":"Terminal / junction box / connection node.","fuse-switch-disconnector.desc":"On-load fuse switch-disconnector.","socket-outlet.desc":"Power socket outlet / multipole connector.","inductor.desc":"General inductor / coil / choke.","voltage-regulator.desc":"Adjustable induction / autotransformer voltage regulator.","dc-motor.desc":"DC motor (series-field general symbol).","heater.desc":"Resistive heating element / heating load.","selector-switch.desc":"Selector / changeover switch (rotary, stay-put).","limit-switch.desc":"Travel / position switch (NO, mechanically operated).","proximity-switch.desc":"Proximity sensor / contactless proximity switch.","time-relay.desc":"Time-delay (slow-operating) relay coil.","buzzer.desc":"Signal buzzer.","siren.desc":"Audible siren / alarm.","thermocouple.desc":"Thermocouple temperature sensor.","thyristor.desc":"Reverse-blocking triode thyristor / SCR. t1 = anode (top), t2 = cathode (bottom).","triac.desc":"Bidirectional triode thyristor (TRIAC).","zener-diode.desc":"Zener / voltage-regulator diode. t1 = anode (top), t2 = cathode (bottom).","igbt.desc":"N-channel enhancement IGBT. t1 = collector (top), t2 = emitter (bottom), t_g = gate.","plc.desc":"Programmable logic controller (PLC).","ups.desc":"Online / standby uninterruptible power supply.","power-supply.desc":"AC→DC switched-mode / DC power supply. t_ac top (~), t_dc bottom (=).","genset.desc":"Diesel / gas generator set.","protective-relay.desc":"Measuring / protective relay, general symbol (IEC 60617).","overcurrent-relay.desc":"Overcurrent protection relay (ANSI 50/51).","undervoltage-relay.desc":"Undervoltage protection relay (ANSI 27).","reverse-power-relay.desc":"Reverse-power / reverse-current protection relay (ANSI 32).","distance-relay.desc":"Distance / under-impedance protection relay (ANSI 21).","phase-failure-relay.desc":"Phase-failure / phase-loss protection relay.","buchholz-relay.desc":"Buchholz / gas relay (ANSI 63).","power-factor-meter.desc":"Power-factor meter (cosφ).","synchronoscope.desc":"Synchronizing indicator / synchronoscope.","varmeter.desc":"Reactive-power meter (var).","make-contact.state.closed":"Closed","break-contact.state.open":"Open","fuse-switch-disconnector.state.open":"Open","selector-switch.state.open":"Open","limit-switch.state.closed":"Closed","resistor.param.R":"Resistance","resistor.param.P":"Rated power","capacitor.param.C":"Capacitance","capacitor.param.Un":"Rated voltage","indicator-light.param.color":"Color","inductor.param.L":"Inductance","inductor.param.In":"Rated current","voltage-regulator.param.ratio":"Regulation range","heater.param.P":"Power","ups.param.S":"Capacity","power-supply.param.Vdc":"Output voltage","genset.param.P":"Power"},bi={zh:c6,en:d6,es:ve.es.library,fr:ve.fr.library,de:ve.de.library,pt:ve.pt.library,ja:ve.ja.library,ru:ve.ru.library,fa:ve.fa.library,ar:ve.ar.library,he:ve.he.library};function u6(e,t){return bi[e][t]??bi.en[t]}function Jt(){const e=Ut(t=>t.locale);return(t,n)=>u6(e,t)??n??t}const Ck="ole-palette-collapsed",m6=new Set(["busbar"]),Ht=(()=>{const e={};for(const[t,n]of Object.entries(lj)){const o=n.filter(r=>!m6.has(r.id));o.length&&(e[t]=o)}return e})(),p6=(()=>{const e=new Set(Ar),t=Object.keys(Ht).filter(n=>!e.has(n));return[...Ar.filter(n=>{var o;return(o=Ht[n])==null?void 0:o.length}),...t]})();function h6(){try{const e=window.localStorage.getItem(Ck);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(n=>typeof n=="string")):new Set}catch{return new Set}}function f6(e){try{window.localStorage.setItem(Ck,JSON.stringify([...e]))}catch{}}function g6(){const e=le(),t=y(u=>u.activeTool==="place"),n=y(u=>u.placeKind),o=y(u=>u.setActiveTool),r=Kt(u=>u.outlineOpen),i=it(),a=De(i,"dense"),s=68,c=a?void 0:`calc(100vh - ${s}px - ${r?"calc(40vh + 20px)":"68px"})`;if(!t||a&&n!=null)return null;const m=a?{top:`calc(${s}px + var(--ole-top-inset, 0px) + var(--ole-safe-top, 0px))`,left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",bottom:"calc(4rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px) + 0.75rem)"}:{top:s};return d.jsx("div",{className:a?"absolute z-20":"absolute left-3 z-20",style:m,role:"dialog","aria-label":e("library.title"),children:d.jsxs("aside",{className:a?"ole-glass flex h-full w-full flex-col overflow-hidden rounded-2xl border border-border shadow-md":"ole-glass flex w-72 flex-col overflow-hidden rounded-2xl border border-border shadow-md",style:c?{maxHeight:c}:void 0,children:[d.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2",children:[d.jsx("span",{className:"flex-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e("library.title")}),d.jsx("button",{type:"button",onClick:()=>o(a?"pan":"select"),className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":e("common.close"),title:e("common.close"),children:d.jsx(jn,{className:"size-3.5"})})]}),d.jsx(b6,{sheet:a})]})})}function b6({sheet:e}){const t=le(),n=Jt(),[o,r]=P.useState(""),[i,a]=P.useState(()=>h6()),s=P.useMemo(()=>{const u=o.trim().toLowerCase();if(!u)return Ht;const p={};for(const[f,h]of Object.entries(Ht)){const g=h.filter(b=>{const x=n(`${b.id}.name`,b.name).toLowerCase(),v=n(`${b.id}.desc`,b.description??"").toLowerCase();return x.includes(u)||b.id.toLowerCase().includes(u)||v.includes(u)});g.length&&(p[f]=g)}return p},[o,n]),l=o.trim().length>0,c=l&&Object.values(s).every(u=>!(u!=null&&u.length)),m=P.useCallback((u,p)=>{a(f=>{const h=new Set(f);return p?h.delete(u):h.add(u),f6(h),h})},[]);return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"px-2 pb-1.5 pt-2",children:d.jsx(y6,{value:o,onChange:r})}),d.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:c?d.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:t("library.empty")}):p6.map(u=>{var b;const p=s[u];if(!(p!=null&&p.length))return null;const f=((b=Ht[u])==null?void 0:b.length)??p.length,h=t(`cat.${u}`),g=l||!i.has(u);return d.jsxs("details",{open:g,className:"group mb-2 last:mb-0",onToggle:x=>{l||m(u,x.currentTarget.open)},children:[d.jsxs("summary",{className:"flex cursor-pointer select-none items-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:[d.jsx(Qk,{className:"size-3 transition-transform [details:not([open])>summary>&]:-rotate-90"}),d.jsx("span",{className:"flex-1",children:h}),d.jsx(w6,{children:l&&p.length!==f?`${p.length}/${f}`:f})]}),d.jsx("ul",{className:"mt-0.5 space-y-px",children:p.map(x=>d.jsx(x6,{entry:x,sheet:e},x.id))})]},u)})})]})}function y6({value:e,onChange:t}){const n=le();return d.jsxs("div",{className:"relative",children:[d.jsx(u2,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:e,onChange:o=>t(o.target.value),placeholder:n("library.searchPlaceholder"),className:"h-7 w-full rounded-md border border-border/60 bg-background/50 pl-7 pr-7 text-xs placeholder:text-muted-foreground focus:border-border focus:outline-none focus:ring-1 focus:ring-ring","aria-label":n("library.searchAria")}),e&&d.jsx("button",{type:"button","aria-label":n("library.clearSearch"),onClick:()=>t(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:d.jsx(jn,{className:"size-3"})})]})}function x6({entry:e,sheet:t}){const n=le(),o=Jt(),r=o(`${e.id}.name`,e.name),i=o(`${e.id}.desc`,e.description??""),a=y(u=>u.setActiveTool),s=y(u=>u.activeTool==="place"&&u.placeKind===e.id),l=y(u=>t&&u.activeTool==="place"&&u.placeKind==null&&u.lastPlaceKind===e.id),c=P.useRef(null);P.useEffect(()=>{var u;l&&((u=c.current)==null||u.scrollIntoView({block:"nearest"}))},[l]);const m=u=>{u.dataTransfer.effectAllowed="copy",u.dataTransfer.setData("application/x-oneline-kind",e.id),u.dataTransfer.setData("text/plain",e.id);const p=document.createElement("div");p.className="ole-glass",p.style.cssText=["position:absolute","top:-9999px","left:-9999px","width:64px","height:64px","display:flex","align-items:center","justify-content:center","border-radius:12px","border:1px solid var(--border)","box-shadow:0 4px 12px rgba(0,0,0,0.12)","color:var(--foreground)","padding:8px"].join(";"),p.innerHTML=`<svg class="ole-symbol" viewBox="${e.viewBox}" width="48" height="48" preserveAspectRatio="xMidYMid meet">${e.svg}</svg>`,document.body.appendChild(p),u.dataTransfer.setDragImage(p,32,32),setTimeout(()=>p.remove(),0)};return d.jsxs("li",{ref:c,className:`group flex cursor-grab items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-accent active:cursor-grabbing ${s?"bg-accent ring-1 ring-[var(--selection)]/60":l?"ring-1 ring-[var(--selection)]/30":""}`,draggable:!0,onDragStart:m,onClick:()=>a("place",{placeKind:e.id}),"data-kind":e.id,title:i?`${r} — ${i}`:`${r} — ${n("library.itemHint")}`,children:[d.jsx("div",{className:"flex h-7 w-12 shrink-0 items-center justify-center",children:d.jsx("svg",{viewBox:e.viewBox,className:"ole-symbol size-full",preserveAspectRatio:"xMidYMid meet",dangerouslySetInnerHTML:{__html:e.svg}})}),d.jsx("span",{className:"truncate text-xs text-foreground/80 group-hover:text-accent-foreground",children:r})]})}function w6({children:e}){return d.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e})}const No="ole-onboarding-dismissed";function v6(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(No)==="1"}catch{return!1}}function yi(e){try{e?window.localStorage.setItem(No,"1"):window.localStorage.removeItem(No)}catch{}}const xi=An(e=>({dismissed:v6(),dismiss:()=>{yi(!0),e({dismissed:!0})},reset:()=>{yi(!1),e({dismissed:!1})}}));function k6(){const e=le(),t=xi(o=>o.dismissed),n=xi(o=>o.dismiss);return t?null:d.jsxs("div",{role:"dialog","aria-label":e("onboard.title"),className:"ole-glass pointer-events-none absolute left-1/2 top-1/2 z-10 w-[min(420px,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-border p-5 shadow-md",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm font-semibold",children:e("onboard.title")}),d.jsx("button",{type:"button",onClick:n,"aria-label":e("onboard.dismiss"),className:"pointer-events-auto rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:d.jsx(jn,{className:"size-3.5"})})]}),d.jsxs("ol",{className:"mt-3 space-y-2.5",children:[d.jsx(ro,{n:1,icon:d.jsx(Oi,{}),title:e("onboard.step1.title"),body:e("onboard.step1.body")}),d.jsx(ro,{n:2,icon:d.jsx(Ti,{}),title:e("onboard.step2.title"),body:e("onboard.step2.body")}),d.jsx(ro,{n:3,icon:d.jsx(Po,{}),title:e("onboard.step3.title"),body:e("onboard.step3.body")})]}),d.jsx("button",{type:"button",onClick:n,className:"pointer-events-auto mt-4 w-full rounded-md bg-primary py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90",children:e("onboard.dismiss")})]})}function ro({n:e,icon:t,title:n,body:o}){return d.jsxs("li",{className:"flex items-start gap-2.5",children:[d.jsx("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_oklch,var(--selection)_18%,transparent)] font-mono text-[10px] font-semibold tabular-nums text-[var(--selection)]","aria-hidden":!0,children:e}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[d.jsx("span",{className:"text-muted-foreground [&>svg]:size-3.5",children:t}),d.jsx("span",{children:n})]}),d.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-muted-foreground",children:o})]})]})}function S6(){const e=le(),t=y(f=>f.selection),n=y(f=>f.diagram.elements),o=y(f=>f.diagram.buses),r=y(f=>f.diagram.junctions),i=y(f=>f.selectedNode),a=y(f=>f.selectedWire),s=y(f=>f.selectedAnnotation);if(a)return d.jsx(M6,{wireId:a});if(i)return d.jsx(R6,{nodeId:i});if(s)return d.jsx(E6,{annId:s});if(t.length===0)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:e("props.empty")});if(t.length>1)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:e("props.multi",{n:t.length})});const l=t[0],c=(o??[]).find(f=>f.id===l);if(c)return d.jsx(j6,{bus:c});const m=(r??[]).find(f=>f.id===l);if(m)return d.jsx(D6,{junction:m});const u=n.find(f=>f.id===l);if(!u)return null;const p=rt[u.kind];return d.jsxs("div",{className:"flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs",children:[d.jsx(Xe,{label:e("props.name"),value:u.name??"",placeholder:u.id,onCommit:f=>y.getState().updateElement(l,{name:f.trim()===""?void 0:f.trim()})}),d.jsx(Ho,{label:e("props.note"),value:u.note??"",onCommit:f=>y.getState().updateElement(l,{note:f.trim()===""?void 0:f.trim()})},l),(p==null?void 0:p.state)&&p.state.length>0&&d.jsx("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:p.state.map(f=>d.jsx(L6,{id:l,element:u,field:f},f.name))}),d.jsx(_6,{id:l,element:u,schema:(p==null?void 0:p.params)??[]})]})}function _6({id:e,element:t,schema:n}){const o=new Set(n.map(i=>i.name)),r=t.params?Object.entries(t.params).filter(([i])=>!o.has(i)):[];return n.length===0&&r.length===0?null:d.jsxs("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:[n.map(i=>d.jsx(C6,{id:e,element:t,field:i},i.name)),r.map(([i,a])=>d.jsx($6,{id:e,element:t,fieldKey:i,value:a},i))]})}function C6({id:e,element:t,field:n}){var l;const o=le(),r=Jt(),i=((l=t.params)==null?void 0:l[n.name])??n.default,a=r(`${t.kind}.param.${n.name}`,n.label??n.name),s=c=>{const m={...t.params??{}};c===void 0||c===n.default?delete m[n.name]:m[n.name]=c,y.getState().updateElement(e,{params:Object.keys(m).length>0?m:void 0})};return n.type==="boolean"?d.jsx(at,{label:a,children:d.jsx(Fo,{active:!!i,onClick:()=>s(!i),children:o(i?"common.yes":"common.no")})}):n.type==="number"?d.jsx(On,{label:a,value:typeof i=="number"?i:0,unit:n.unit,onCommit:s}):d.jsx(Xe,{label:a,value:typeof i=="string"?i:"",unit:n.unit,onCommit:c=>s(c.trim()===""?void 0:c)})}function $6({id:e,element:t,fieldKey:n,value:o}){const r=le(),i=a=>{const s={...t.params??{}};a===void 0?delete s[n]:s[n]=a,y.getState().updateElement(e,{params:Object.keys(s).length>0?s:void 0})};return typeof o=="boolean"?d.jsx(at,{label:n,children:d.jsx(Fo,{active:o,onClick:()=>i(!o),children:r(o?"common.yes":"common.no")})}):typeof o=="number"?d.jsx(On,{label:n,value:o,onCommit:i}):d.jsx(Xe,{label:n,value:o,onCommit:a=>i(a.trim()===""?void 0:a)})}function j6({bus:e}){const t=le(),n=e.id,o=r=>{const i=r.trim();To(n,{name:i===""?void 0:i})};return d.jsxs("div",{className:"flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs",children:[d.jsx(Xe,{label:t("props.name"),value:e.name??"",placeholder:e.id,onCommit:o}),d.jsx(Ho,{label:t("props.note"),value:e.note??"",onCommit:r=>To(n,{note:r.trim()===""?void 0:r.trim()})},n),d.jsx(A6,{bus:e})]})}function A6({bus:e}){const t=(o,r)=>{const i={...e.params??{}};r===void 0||r===""?delete i[o]:i[o]=r,To(e.id,{params:Object.keys(i).length>0?i:void 0})},n=e.params??{};return d.jsx("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:d.jsx(On,{label:"Un",value:typeof n.Un=="number"?n.Un:0,unit:"kV",onCommit:o=>t("Un",o)})})}function To(e,t){y.getState().dispatch(n=>{const o=(n.buses??[]).map(r=>r.id===e?{...r,...t}:r);return{...n,buses:o}})}function E6({annId:e}){const t=le(),n=y(r=>(r.diagram.annotations??[]).find(i=>i.id===e));if(!n)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.annNotFound",{id:e})});const o=r=>y.getState().updateAnnotation(e,r);switch(Oe(n)){case"rect":{const r=n;return d.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[d.jsx(Xe,{label:t("props.annLabel"),value:r.label??"",placeholder:t("props.annLabelPlaceholder"),onCommit:i=>o({label:i.trim()===""?void 0:i.trim()})}),d.jsx(pn,{label:t("props.annStroke"),value:r.stroke??"dashed",options:[{value:"solid",label:t("props.annStrokeSolid")},{value:"dashed",label:t("props.annStrokeDashed")}],onChange:i=>o({stroke:i})}),d.jsx(pn,{label:t("props.annFill"),value:r.fill??"none",options:[{value:"none",label:t("props.annFillNone")},{value:"tint",label:t("props.annFillTint")}],onChange:i=>o({fill:i==="none"?void 0:i})})]})}case"line":{const r=n;return d.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[d.jsx(pn,{label:t("props.annStroke"),value:r.stroke??"solid",options:[{value:"solid",label:t("props.annStrokeSolid")},{value:"dashed",label:t("props.annStrokeDashed")}],onChange:i=>o({stroke:i})}),d.jsx(pn,{label:t("props.annArrow"),value:r.arrow??"none",options:[{value:"none",label:t("props.annArrowNone")},{value:"end",label:t("props.annArrowEnd")},{value:"both",label:t("props.annArrowBoth")}],onChange:i=>o({arrow:i==="none"?void 0:i})})]})}case"table":{const r=n;return d.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[d.jsx(wi,{label:t("props.annRows"),value:r.rowHeights.length,min:1,onChange:i=>o(N6(r,i))}),d.jsx(wi,{label:t("props.annCols"),value:r.colWidths.length,min:1,onChange:i=>o(T6(r,i))}),d.jsx(vi,{label:t("props.annFontSize"),value:r.fontSize,onCommit:i=>o({fontSize:i})})]})}default:{const r=n;return d.jsx("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:d.jsx(vi,{label:t("props.annFontSize"),value:r.fontSize,onCommit:i=>o({fontSize:i})})})}}}function N6(e,t){const n=e.colWidths.length,o=e.rowHeights[e.rowHeights.length-1]??Gt,r=e.rowHeights.slice(0,t);for(;r.length<t;)r.push(o);const i=e.cells.slice(0,t).map(a=>[...a]);for(;i.length<t;)i.push(Qv(n,1).cells[0]);return{rowHeights:r,cells:i}}function T6(e,t){const n=e.colWidths[e.colWidths.length-1]??qt,o=e.colWidths.slice(0,t);for(;o.length<t;)o.push(n);const r=e.cells.map(i=>{const a=i.slice(0,t);for(;a.length<t;)a.push("");return a});return{colWidths:o,cells:r}}function pn({label:e,value:t,options:n,onChange:o}){return d.jsx(at,{label:e,children:d.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:n.map(r=>d.jsx("button",{type:"button","aria-pressed":t===r.value,onClick:()=>o(r.value),className:ke("h-7 flex-1 truncate px-1.5 text-[11px] transition-colors",t===r.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.label},r.value))})})}function wi({label:e,value:t,min:n,onChange:o}){return d.jsx(at,{label:e,children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{type:"button","aria-label":`${e} −`,disabled:t<=n,onClick:()=>o(t-1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"−"}),d.jsx("span",{className:"w-8 text-center font-mono text-[11px] tabular-nums",children:t}),d.jsx("button",{type:"button","aria-label":`${e} +`,onClick:()=>o(t+1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent",children:"+"})]})})}const P6=5,I6=32,z6=8;function vi({label:e,value:t,onCommit:n}){return d.jsx(Xe,{label:e,value:t!=null?String(t):"",placeholder:String(z6),unit:"px",onCommit:o=>{const r=o.trim();if(r===""){n(void 0);return}const i=Number(r);Number.isFinite(i)&&n(Math.min(I6,Math.max(P6,Math.round(i))))}})}function M6({wireId:e}){const t=le(),n=y(b=>b.diagram.wires),o=y(b=>b.diagram.elements),r=y(b=>b.diagram.buses),i=y(b=>b.diagram.junctions),a=y(b=>b.internal.terminalToNode),s=y(b=>b.setSelectedNode),l=(n??[]).find(b=>b.id===e);if(!l)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.wireNotFound",{id:e})});const c=a.get(l.ends[0]),m=new Map(o.map(b=>[b.id,b])),u=new Map((r??[]).map(b=>[b.id,b])),p=new Map((i??[]).map(b=>[b.id,b])),f=b=>{if(!b.includes(".")){const H=u.get(b);if(H)return{id:b,label:H.name??b};const K=p.get(b);return{id:b,label:(K==null?void 0:K.name)??b}}const x=b.indexOf("."),v=b.slice(0,x),T=b.slice(x+1),I=m.get(v);return{id:v,label:(I==null?void 0:I.name)??v,pin:T}},h=f(l.ends[0]),g=f(l.ends[1]);return d.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 text-xs",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.wire")}),d.jsx("div",{className:"font-mono text-[12px]",children:l.id})]}),d.jsx(Xe,{label:t("props.label"),value:l.label??"",placeholder:t("props.labelPlaceholder"),onCommit:b=>y.getState().updateWire(e,{label:b.trim()===""?void 0:b.trim()})}),d.jsx("ul",{className:"space-y-0.5 border-t border-border/40 pt-2",children:[h,g].map((b,x)=>d.jsxs("li",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 hover:bg-accent",onClick:()=>y.getState().setSelection([b.id]),children:[d.jsx("span",{className:"flex-1 truncate font-mono text-[11px]",children:b.id}),d.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:b.label}),b.pin&&d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:b.pin})]},x))}),c&&d.jsx("button",{type:"button",className:"self-start rounded-md border border-border/60 px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent",onClick:()=>s(c),children:t("props.selectWholeNode")})]})}function D6({junction:e}){var r;const t=le(),n=y(i=>{var a;return(a=i.internal.junctions.get(e.id))==null?void 0:a.world}),o=((r=e.layout)==null?void 0:r.at)??n;return d.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.junction")}),d.jsx("div",{className:"font-mono text-[12px]",children:e.id})]}),d.jsx(Xe,{label:t("props.name"),value:e.name??"",placeholder:e.id,onCommit:i=>y.getState().updateJunction(e.id,{name:i.trim()===""?void 0:i.trim()})}),d.jsx(Ho,{label:t("props.note"),value:e.note??"",onCommit:i=>y.getState().updateJunction(e.id,{note:i.trim()===""?void 0:i.trim()})},e.id),o&&d.jsxs("div",{className:"flex items-center justify-between border-t border-border/40 pt-2",children:[d.jsx("span",{className:"text-muted-foreground",children:t("props.junctionPos")}),d.jsxs("span",{className:"font-mono text-[11px]",children:[Math.round(o[0]),", ",Math.round(o[1])]})]})]})}function R6({nodeId:e}){const t=le(),n=y(s=>s.internal.nodes.get(e)),o=y(s=>s.diagram.elements),r=y(s=>s.setSelection);if(!n)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.nodeNotFound",{id:e})});const i=new Map;for(const s of n.terminals){const l=s.indexOf(".");if(l<0)continue;const c=s.slice(0,l),m=s.slice(l+1),u=i.get(c)??[];u.push(m),i.set(c,u)}const a=new Map(o.map(s=>[s.id,s]));return d.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 text-xs",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.node")}),d.jsx("div",{className:"font-mono text-[12px]",children:n.id}),d.jsx("div",{className:"text-[11px] text-muted-foreground",children:t("props.nodeStats",{terminals:n.terminals.length,elements:i.size})})]}),d.jsx("ul",{className:"space-y-0.5 border-t border-border/40 pt-2",children:[...i.entries()].map(([s,l])=>{const c=a.get(s);return d.jsxs("li",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 hover:bg-accent",onClick:()=>r([s]),title:t("props.selectElement",{label:s}),children:[d.jsx("span",{className:"flex-1 truncate font-mono text-[11px]",children:s}),d.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:(c==null?void 0:c.name)??""}),d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:l.join(", ")})]},s)})})]})}function at({label:e,children:t}){return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"w-16 shrink-0 truncate text-[11px] text-muted-foreground",children:e}),d.jsx("div",{className:"min-w-0 flex-1",children:t})]})}function Xe({label:e,value:t,placeholder:n,unit:o,onCommit:r}){const[i,a]=P.useState(t),s=P.useRef(null);return P.useEffect(()=>a(t),[t]),d.jsx(at,{label:e,children:d.jsxs("div",{className:"relative",children:[d.jsx("input",{ref:s,type:"text",value:i,placeholder:n,onChange:l=>a(l.target.value),onBlur:()=>{i!==t&&r(i)},onKeyDown:l=>{var c,m;l.key==="Enter"&&((c=s.current)==null||c.blur()),l.key==="Escape"&&(a(t),(m=s.current)==null||m.blur())},className:ke("h-7 w-full rounded-md border border-border/60 bg-background/50 px-2 text-[11px] focus:border-border focus:outline-none focus:ring-1 focus:ring-ring",o&&"pr-8")}),o&&d.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:o})]})})}const O6=350;function Ho({label:e,value:t,onCommit:n}){const[o,r]=P.useState(t),i=P.useRef(!1),a=P.useRef(null),s=P.useRef({local:o,value:t,onCommit:n});s.current={local:o,value:t,onCommit:n};const l=P.useRef(null);P.useEffect(()=>{i.current||(r(t),l.current=null)},[t]);const c=()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null);const u=s.current;u.local===u.value||u.local===l.current||(l.current=u.local,u.onCommit(u.local))},m=P.useRef(c);return m.current=c,P.useEffect(()=>()=>m.current(),[]),d.jsx(at,{label:e,children:d.jsx("textarea",{rows:2,value:o,onFocus:()=>{i.current=!0},onChange:u=>{r(u.target.value),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{a.current=null,m.current()},O6)},onBlur:()=>{i.current=!1,c()},className:"w-full resize-none rounded-md border border-border/60 bg-background/50 px-2 py-1 text-[11px] focus:border-border focus:outline-none focus:ring-1 focus:ring-ring"})})}function On({label:e,value:t,min:n,unit:o,onCommit:r}){const[i,a]=P.useState(String(t)),s=P.useRef(null);return P.useEffect(()=>a(String(t)),[t]),d.jsx(at,{label:e,children:d.jsxs("div",{className:"relative",children:[d.jsx("input",{ref:s,type:"number",value:i,onChange:l=>a(l.target.value),onBlur:()=>{const l=Number(i);Number.isFinite(l)&&l!==t?r(l):a(String(t))},onKeyDown:l=>{var c,m;l.key==="Enter"&&((c=s.current)==null||c.blur()),l.key==="Escape"&&(a(String(t)),(m=s.current)==null||m.blur())},min:n,className:ke("h-7 w-full rounded-md border border-border/60 bg-background/50 px-2 font-mono text-[11px] tabular-nums focus:border-border focus:outline-none focus:ring-1 focus:ring-ring",o&&"pr-8")}),o&&d.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:o})]})})}function Fo({active:e,onClick:t,children:n}){return d.jsx("button",{type:"button",onClick:t,className:ke("flex h-6 w-full items-center justify-center gap-1.5 rounded border text-[10px] transition-colors",e?"border-[var(--selection)] bg-[var(--selection)]/15 text-foreground":"border-border/60 text-muted-foreground hover:bg-accent"),"aria-pressed":e,children:n})}function L6({id:e,element:t,field:n}){var l;const o=le(),i=Jt()(`${t.kind}.state.${n.name}`,n.label??n.name),a=((l=t.state)==null?void 0:l[n.name])??n.default,s=c=>{const m={...t.state??{}};c===void 0||c===n.default?delete m[n.name]:m[n.name]=c,y.getState().updateElement(e,{state:Object.keys(m).length>0?m:void 0})};return n.type==="boolean"?d.jsx(at,{label:i,children:d.jsx(Fo,{active:!!a,onClick:()=>s(!a),children:o(a?"common.yes":"common.no")})}):n.type==="number"?d.jsx(On,{label:i,value:typeof a=="number"?a:0,onCommit:s}):d.jsx(Xe,{label:i,value:typeof a=="string"?a:"",onCommit:c=>s(c.trim()===""?void 0:c)})}function B6(){const e=le(),t=Jt(),n=y(f=>f.selection),o=y(f=>f.selectedNode),r=y(f=>f.selectedWire),i=y(f=>f.selectedAnnotation),a=y(f=>f.diagram.annotations),s=y(f=>f.diagram.elements),l=y(f=>f.diagram.buses),c=it(),m=De(c,"dense");if(n.length===0&&!o&&!r&&!i)return null;let u=e("props.title"),p=null;if(r)u=e("props.wire");else if(o)u=e("props.node");else if(i){const f=(a??[]).find(g=>g.id===i),h=f?Oe(f):"text";u=e(h==="rect"?"props.annRect":h==="line"?"props.annLine":h==="table"?"props.annTable":"props.annText")}else if(n.length===1){const f=n[0],h=(l??[]).find(g=>g.id===f);if(h)u=h.name??e("props.bus");else{const g=s.find(b=>b.id===f);if(g){const b=rt[g.kind];u=b?t(`${b.id}.name`,b.name):g.kind}}}else p=n.length;return d.jsxs("aside",{className:ke("ole-glass absolute z-10 flex flex-col overflow-hidden rounded-2xl border border-border shadow-sm",m?"w-48":"w-56"),style:{top:`calc(${m?"4.5rem":"0.75rem"} + var(--ole-top-inset, 0px) + var(--ole-safe-top, 0px))`,right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",maxHeight:`calc(100% - ${m?"5.25rem":"1.5rem"} - var(--ole-top-inset, 0px) - var(--ole-safe-top, 0px) - var(--ole-bottom-inset, 0px) - var(--ole-safe-bottom, 0px) - 4.5rem)`},children:[d.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2",children:[d.jsx("span",{className:"flex-1 truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:u}),p!=null&&d.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e("props.nSelected",{n:p})})]}),d.jsx(S6,{})]})}function H6(){P.useEffect(()=>{const e=n=>{const o=n.target;if(!o||o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable)return;const r=o.closest("button");r&&r.closest(".ole-glass")&&n.preventDefault()},t=n=>{const o=n.target;if(!o||!o.closest(".ole-canvas-root"))return;const r=document.activeElement;!r||r===document.body||r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable||r.blur()};return window.addEventListener("mousedown",e),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("pointerdown",t,!0)}},[])}function F6(){H6();const e=y(o=>o.readOnly),t=P.useRef(null),n=XA(t);return d.jsx(Y2,{children:d.jsx("div",{ref:t,className:"relative h-full w-full overflow-hidden bg-background text-foreground",children:d.jsxs($E,{width:n,children:[d.jsx(bE,{}),e?d.jsxs(d.Fragment,{children:[d.jsx(hi,{}),d.jsx(ii,{})]}):d.jsxs(d.Fragment,{children:[d.jsx(i6,{}),d.jsx(B6,{}),d.jsx(t6,{}),d.jsx(hi,{}),d.jsx(HE,{}),d.jsx(WE,{}),d.jsx(g6,{}),d.jsx(k6,{}),d.jsx(ii,{})]})]})})})}const W6="ole-theme";function q6(){try{const e=window.localStorage.getItem(W6);return e==="light"||e==="dark"?e:null}catch{return null}}function G6(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches}function V6(){return typeof window>"u"?"light":q6()??(G6()?"dark":"light")}function $k(e){typeof document>"u"||document.documentElement.classList.toggle("dark",e==="dark")}function K6({className:e,diagram:t,readOnly:n,locale:o,theme:r}){return P.useEffect(()=>{y.getState().setReadOnly(!!n)},[n]),P.useEffect(()=>{if(!t)return;if(n){y.getState().setDiagram(t),y.getState().setActiveTool("pan");return}y.getState().diagram.elements.length===0&&y.getState().setDiagram(t)},[t,n]),P.useEffect(()=>{o&&Ut.getState().setLocale(o)},[o]),P.useEffect(()=>{r&&$k(r)},[r]),P.useEffect(()=>{Lo()},[]),TA(),d.jsx("div",{className:`ole-root ${e??"h-full w-full"}`,children:d.jsx(F6,{})})}const jk={"application/json":[".json"]},Ak=()=>typeof window<"u"&&typeof window.showOpenFilePicker=="function",Ek=e=>e instanceof DOMException&&e.name==="AbortError";function ki(e){let t;try{t=JSON.parse(e)}catch(o){throw new Error(Se("io.parseFailed",{err:o.message}))}if(!t||typeof t!="object"||Array.isArray(t))throw new Error(Se("io.notObject"));const n=t;if(n.version!=="1")throw new Error(Se("io.versionMismatch",{actual:JSON.stringify(n.version)}));if(!Array.isArray(n.elements))throw new Error(Se("io.elementsMissing"));return n}function U6(e){return JSON.stringify(e,null,2)+`
220
- `}async function X6(){if(Ak()){let e;try{[e]=await window.showOpenFilePicker({multiple:!1,types:[{description:Se("topbar.file.fileDescription"),accept:jk}]})}catch(n){if(Ek(n))return null;throw n}const t=await e.getFile();return{diagram:ki(await t.text()),session:{handle:e,name:t.name}}}return new Promise((e,t)=>{const n=document.createElement("input");n.type="file",n.accept=".json,application/json",n.addEventListener("change",async()=>{var r;const o=(r=n.files)==null?void 0:r[0];if(!o)return e(null);try{e({diagram:ki(await o.text()),session:{name:o.name}})}catch(i){t(i)}}),n.addEventListener("cancel",()=>e(null)),n.click()})}async function Si(e,t,n={}){const o=U6(e);if(!n.saveAs&&(t!=null&&t.handle)){const a=await t.handle.createWritable();return await a.write(o),await a.close(),t}if(Ak()){let a;try{a=await window.showSaveFilePicker({suggestedName:(t==null?void 0:t.name)??"diagram.json",types:[{description:Se("topbar.file.fileDescription"),accept:jk}]})}catch(l){if(Ek(l))return null;throw l}const s=await a.createWritable();return await s.write(o),await s.close(),{handle:a,name:a.name}}const r=URL.createObjectURL(new Blob([o],{type:"application/json"})),i=document.createElement("a");return i.href=r,i.download=(t==null?void 0:t.name)??"diagram.json",i.click(),URL.revokeObjectURL(r),t??{name:"diagram.json"}}function Y6(){const e=le(),t=y(u=>u.fileSession),n=(t==null?void 0:t.name)??e("common.unnamed"),{onNew:o,onOpen:r,onSave:i,onSaveAs:a}=Z6(),[s,l]=P.useState(!1),c=P.useRef(null);P.useEffect(()=>{const u=p=>{if(!(p.metaKey||p.ctrlKey))return;const f=p.key.toLowerCase();f==="o"?(p.preventDefault(),r()):f==="s"&&(p.preventDefault(),p.shiftKey?a():i())};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[r,i,a]),P.useEffect(()=>{if(!s)return;const u=f=>{c.current&&!c.current.contains(f.target)&&l(!1)},p=f=>{f.key==="Escape"&&l(!1)};return window.addEventListener("mousedown",u),window.addEventListener("keydown",p),()=>{window.removeEventListener("mousedown",u),window.removeEventListener("keydown",p)}},[s]);const m=u=>()=>{l(!1),u()};return d.jsxs("div",{ref:c,className:"relative",children:[d.jsxs(Ne,{variant:"ghost",size:"sm",className:"gap-1.5","aria-haspopup":"menu","aria-expanded":s,onClick:()=>l(u=>!u),children:[d.jsx(dr,{}),e("topbar.file.label")]}),s&&d.jsxs("div",{role:"menu",className:"ole-glass absolute left-0 top-full mt-1.5 min-w-44 rounded-md border border-border p-1 shadow-md",children:[d.jsx("div",{className:"border-b border-border px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:n}),d.jsx(hn,{onClick:m(o),icon:d.jsx(o2,{}),children:e("topbar.file.new")}),d.jsx(hn,{onClick:m(r),icon:d.jsx(dr,{}),hint:"⌘O",children:e("topbar.file.open")}),d.jsx(hn,{onClick:m(i),icon:d.jsx(ur,{}),hint:"⌘S",children:e("topbar.file.save")}),d.jsx(hn,{onClick:m(a),icon:d.jsx(ur,{}),hint:"⌘⇧S",children:e("topbar.file.saveAs")})]})]})}function hn({children:e,icon:t,hint:n,onClick:o}){return d.jsxs("button",{type:"button",role:"menuitem",onClick:o,className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[t,d.jsx("span",{className:"flex-1",children:e}),n&&d.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:n})]})}function Z6(){const e=le(),t=y(l=>l.loadDiagramFromFile),n=y(l=>l.setFileSession),o=y(l=>l.setDiagram);return{onNew:()=>{const{diagram:l}=y.getState();l.elements.length>0&&!confirm(e("topbar.file.newConfirm"))||(o({version:"1",elements:[]}),n(null))},onOpen:async()=>{try{const l=await X6();l&&(t(l.diagram,l.session),Lo())}catch(l){alert(e("topbar.file.openFailed",{err:l.message}))}},onSave:async()=>{try{const{diagram:l,fileSession:c}=y.getState(),m=await Si(l,c);m&&n(m)}catch(l){alert(e("topbar.file.saveFailed",{err:l.message}))}},onSaveAs:async()=>{try{const{diagram:l,fileSession:c}=y.getState(),m=await Si(l,c,{saveAs:!0});m&&n(m)}catch(l){alert(e("topbar.file.saveFailed",{err:l.message}))}}}}const io="WIRES",Ye="ELEMENTS",ao="LABELS",Le="ANNOTATIONS",_i=32,Ci=64,Q6=8,J6=1.25,e4=6;function Nk(e,t={}){var a,s;const n=new p4(t.precision??6);n.header(t.title),n.tables([{name:io,color:7},{name:Ye,color:7},{name:ao,color:8},{name:Le,color:3}]),n.beginEntities();for(const l of e.wireRenders.values())l.path.length<2||n.lwpolyline(io,l.path.map(be),!1);for(const{geometry:l}of e.buses.values()){const{axis:c,at:m,span:u}=l,p=u/2,f=c==="x"?[m[0]-p,m[1]]:[m[0],m[1]-p],h=c==="x"?[m[0]+p,m[1]]:[m[0],m[1]+p];n.lwpolyline(io,[f,h].map(be),!1)}for(const l of e.elements.values()){const c=e.layout.get(l.element.id),m=l.libraryDef;!c||!m||t4(n,m.svg,c)}const o=t.labelMode??"all",r=vt(t.labelFontSize),i=Xt(r);if(o!=="off"){for(const l of e.elements.values()){const c=e.layout.get(l.element.id);if(!c||!l.libraryDef)continue;const m=Tn(l,o);if(m.length===0)continue;const u=l.libraryDef.label??Pn(l.libraryDef,r),{world:[p,f],textAnchor:h,dy:g}=In(u,l.libraryDef,c,m.length,r);for(let b=0;b<m.length;b++){const[x,v]=be([p,f+g+b*i]);n.text(ao,[x,v],m[b],r,0,!1,h)}}for(const l of e.wireRenders.values()){const c=(a=l.label)==null?void 0:a.trim();if(!c)continue;const m=zn(l.path,r);if(!m)continue;const u=be(m.world);n.text(ao,u,c,r,0,!1,m.textAnchor)}}for(const l of t.annotations??[])switch(Oe(l)){case"rect":{const c=l,[m,u]=c.at,[p,f]=c.size;if(n.lwpolyline(Le,[[m,u],[m+p,u],[m+p,u+f],[m,u+f]].map(be),!0),c.label){const h=be([m+bt,u+bt+Ge]);n.text(Le,h,c.label,Ge,0,!1)}break}case"line":{const c=l,m=Zt(c);if(m.length<2)break;n.lwpolyline(Le,m.map(be),!1);for(const u of Ro(m,c.arrow))n.lwpolyline(Le,u.map(be),!0);break}case"table":{const c=l,[m,u]=c.at,[p,f]=Ue(c),h=kt(c),g=St(c),b=c.fontSize??Ge;n.lwpolyline(Le,[[m,u],[m+p,u],[m+p,u+f],[m,u+f]].map(be),!0);for(let x=1;x<c.colWidths.length;x++)n.line(Le,be([m+h[x],u]),be([m+h[x],u+f]));for(let x=1;x<c.rowHeights.length;x++)n.line(Le,be([m,u+g[x]]),be([m+p,u+g[x]]));for(let x=0;x<c.rowHeights.length;x++)for(let v=0;v<c.colWidths.length;v++){const T=((s=c.cells[x])==null?void 0:s[v])??"";if(T==="")continue;const I=be([m+h[v]+Wt,u+g[x]+c.rowHeights[x]/2+b*.35]);n.text(Le,I,T,b,0,!1)}break}default:{const c=l;if(!c.text)break;const m=c.fontSize??Q6,u=c.text.split(`
221
- `);for(let p=0;p<u.length;p++){const[f,h]=be([c.at[0],c.at[1]+(p+1)*m*J6]);n.text(Le,[f,h],u[p],m,0,!1)}break}}return n.endEntities(),n.toString()}async function Tk(e,t="diagram.dxf",n){const o=Nk(e,n),r=URL.createObjectURL(new Blob([o],{type:"application/dxf;charset=utf-8"})),i=document.createElement("a");i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}function t4(e,t,n){const o=`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,i=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;if(!(!i||i.querySelector("parsererror")))for(const a of Array.from(i.children))switch(a.tagName.toLowerCase()){case"line":n4(e,a,n);break;case"polyline":$i(e,a,n,!1);break;case"polygon":$i(e,a,n,!0);break;case"rect":o4(e,a,n);break;case"circle":r4(e,a,n);break;case"ellipse":i4(e,a,n);break;case"path":c4(e,a,n);break;case"text":l4(e,a,n);break}}function n4(e,t,n){const o=_e(t,"x1"),r=_e(t,"y1"),i=_e(t,"x2"),a=_e(t,"y2"),s=be(Ke([o,r],n)),l=be(Ke([i,a],n));e.line(Ye,s,l)}function $i(e,t,n,o){const r=m4(t.getAttribute("points")??"");if(r.length<2)return;const i=r.map(a=>be(Ke(a,n)));e.lwpolyline(Ye,i,o)}function o4(e,t,n){const o=_e(t,"x"),r=_e(t,"y"),i=_e(t,"width"),a=_e(t,"height"),l=[[o,r],[o+i,r],[o+i,r+a],[o,r+a]].map(c=>be(Ke(c,n)));e.lwpolyline(Ye,l,!0)}function r4(e,t,n){const o=_e(t,"cx"),r=_e(t,"cy"),i=_e(t,"r"),a=be(Ke([o,r],n));e.circle(Ye,a,i)}function i4(e,t,n){const o=_e(t,"cx"),r=_e(t,"cy"),i=_e(t,"rx"),a=_e(t,"ry");if(Math.abs(i-a)<1e-6){a4(e,o,r,i,n);return}s4(e,o,r,i,a,n)}function a4(e,t,n,o,r){const i=be(Ke([t,n],r));e.circle(Ye,i,o)}function s4(e,t,n,o,r,i){const a=[];for(let s=0;s<Ci;s++){const l=s/Ci*Math.PI*2;a.push(be(Ke([t+o*Math.cos(l),n+r*Math.sin(l)],i)))}e.lwpolyline(Ye,a,!0)}function l4(e,t,n){const o=_e(t,"x"),r=_e(t,"y"),i=parseFloat(t.getAttribute("font-size")??"")||e4,a=(t.textContent??"").trim();if(!a)return;const s=be(Ke([o,r],n));e.text(Ye,s,a,i,n.rot,n.mirror)}function c4(e,t,n){const o=t.getAttribute("d")??"",r=d4(o);if(r.length===0)return;let i=null,a=[];const s=()=>{a.length>=2&&e.lwpolyline(Ye,a.map(l=>be(Ke(l,n))),!1),a=[]};for(const l of r)if(l.cmd==="M")s(),i=[l.args[0],l.args[1]],a.push(i);else if(l.cmd==="A"&&i){const[c,m,,u,p,f,h]=l.args,g=u4(i,[f,h],c,m,u!==0,p!==0);if(g)for(let b=1;b<=_i;b++){const x=g.theta1+g.delta*b/_i;a.push([g.cx+c*Math.cos(x),g.cy+m*Math.sin(x)])}else a.push([f,h]);i=[f,h]}s()}function d4(e){const t=[],n=/([MmAa])([^MmAa]*)/g;let o;for(;(o=n.exec(e))!==null;){const r=o[1].toUpperCase(),i=o[2].trim().split(/[\s,]+/).filter(a=>a.length>0).map(Number);t.push({cmd:r,args:i})}return t}function u4(e,t,n,o,r,i){if(n<=0||o<=0)return null;const[a,s]=e,[l,c]=t;if(a===l&&s===c)return null;const m=(a-l)/2,u=(s-c)/2;let p=Math.abs(n),f=Math.abs(o);const h=p*p,g=f*f,b=m*m/h+u*u/g;if(b>1){const B=Math.sqrt(b);p*=B,f*=B}const x=r===i?-1:1,v=p*p*f*f-p*p*u*u-f*f*m*m,T=p*p*u*u+f*f*m*m,I=x*Math.sqrt(Math.max(0,v/T)),H=I*(p*u)/f,K=I*-(f*m)/p,_=H+(a+l)/2,F=K+(s+c)/2,W=(B,Q,ae,ue)=>{const ee=B*ae+Q*ue,se=Math.hypot(B,Q)*Math.hypot(ae,ue);let he=Math.acos(Math.max(-1,Math.min(1,ee/se)));return B*ue-Q*ae<0&&(he=-he),he},G=W(1,0,(m-H)/p,(u-K)/f);let z=W((m-H)/p,(u-K)/f,(-m-H)/p,(-u-K)/f);return!i&&z>0?z-=2*Math.PI:i&&z<0&&(z+=2*Math.PI),{cx:_,cy:F,theta1:G,delta:z}}function Ke(e,t){return Me(e,t)}function be(e){return[e[0],-e[1]]}function _e(e,t){const n=parseFloat(e.getAttribute(t)??"");return Number.isFinite(n)?n:0}function m4(e){const t=e.trim().split(/[\s,]+/).map(Number).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o+1<t.length;o+=2)n.push([t[o],t[o+1]]);return n}class p4{constructor(t){At(this,"out",[]);At(this,"precision");this.precision=t}toString(){return this.out.join("")}g(t,n){this.out.push(`${t}
216
+ */const Nn=re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Vi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Vi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Ki(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Vi(e))&&(o&&(o+=" "),o+=t);return o}const Ro="-",_2=e=>{const t=$2(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:a=>{const s=a.split(Ro);return s[0]===""&&s.length!==1&&s.shift(),Ui(s,t)||C2(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&o[a]?[...l,...o[a]]:l}}},Ui=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Ui(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Ro);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},hr=/^\[(.+)\]$/,C2=e=>{if(hr.test(e)){const t=hr.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},$2=e=>{const{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return A2(Object.entries(e.classGroups),n).forEach(([i,a])=>{uo(a,o,i,t)}),o},uo=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:fr(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(j2(r)){uo(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,a])=>{uo(a,fr(t,i),n,o)})})},fr=(e,t)=>{let n=e;return t.split(Ro).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},j2=e=>e.isThemeGetter,A2=(e,t)=>t?e.map(([n,o])=>{const r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[n,r]}):e,E2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=o.get(i))!==void 0)return r(i,a),a},set(i,a){n.has(i)?n.set(i,a):r(i,a)}}},Xi="!",N2=e=>{const{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],i=t.length,a=s=>{const l=[];let c=0,u=0,m;for(let b=0;b<s.length;b++){let x=s[b];if(c===0){if(x===r&&(o||s.slice(b,b+i)===t)){l.push(s.slice(u,b)),u=b+i;continue}if(x==="/"){m=b;continue}}x==="["?c++:x==="]"&&c--}const h=l.length===0?s:s.substring(u),g=h.startsWith(Xi),p=g?h.substring(1):h,f=m&&m>u?m-u:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:f}};return n?s=>n({className:s,parseClassName:a}):a},T2=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o)}),t.push(...n.sort()),t},P2=e=>({cache:E2(e.cacheSize),parseClassName:N2(e),..._2(e)}),I2=/\s+/,z2=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],a=e.trim().split(I2);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:g}=n(c);let p=!!g,f=o(p?h.substring(0,g):h);if(!f){if(!p){s=c+(s.length>0?" "+s:s);continue}if(f=o(h),!f){s=c+(s.length>0?" "+s:s);continue}p=!1}const b=T2(u).join(":"),x=m?b+Xi:b,v=x+f;if(i.includes(v))continue;i.push(v);const P=r(f,p);for(let T=0;T<P.length;++T){const B=P[T];i.push(x+B)}s=c+(s.length>0?" "+s:s)}return s};function M2(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Yi(t))&&(o&&(o+=" "),o+=n);return o}const Yi=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Yi(e[o]))&&(n&&(n+=" "),n+=t);return n};function D2(e,...t){let n,o,r,i=a;function a(l){const c=t.reduce((u,m)=>m(u),e());return n=P2(c),o=n.cache.get,r=n.cache.set,i=s,s(l)}function s(l){const c=o(l);if(c)return c;const u=z2(l,n);return r(l,u),u}return function(){return i(M2.apply(null,arguments))}}const ge=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Zi=/^\[(?:([a-z-]+):)?(.+)\]$/i,R2=/^\d+\/\d+$/,O2=new Set(["px","full","screen"]),L2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,H2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,F2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,He=e=>ft(e)||O2.has(e)||R2.test(e),Qe=e=>wt(e,"length",Z2),ft=e=>!!e&&!Number.isNaN(Number(e)),Un=e=>wt(e,"number",ft),Nt=e=>!!e&&Number.isInteger(Number(e)),q2=e=>e.endsWith("%")&&ft(e.slice(0,-1)),oe=e=>Zi.test(e),Je=e=>L2.test(e),G2=new Set(["length","size","percentage"]),V2=e=>wt(e,G2,Qi),K2=e=>wt(e,"position",Qi),U2=new Set(["image","url"]),X2=e=>wt(e,U2,J2),Y2=e=>wt(e,"",Q2),Tt=()=>!0,wt=(e,t,n)=>{const o=Zi.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):!1},Z2=e=>B2.test(e)&&!H2.test(e),Qi=()=>!1,Q2=e=>F2.test(e),J2=e=>W2.test(e),eS=()=>{const e=ge("colors"),t=ge("spacing"),n=ge("blur"),o=ge("brightness"),r=ge("borderColor"),i=ge("borderRadius"),a=ge("borderSpacing"),s=ge("borderWidth"),l=ge("contrast"),c=ge("grayscale"),u=ge("hueRotate"),m=ge("invert"),h=ge("gap"),g=ge("gradientColorStops"),p=ge("gradientColorStopPositions"),f=ge("inset"),b=ge("margin"),x=ge("opacity"),v=ge("padding"),P=ge("saturate"),T=ge("scale"),B=ge("sepia"),V=ge("skew"),S=ge("space"),H=ge("translate"),F=()=>["auto","contain","none"],Z=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",oe,t],W=()=>[oe,t],ie=()=>["",He,Qe],ce=()=>["auto",ft,oe],me=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],xe=()=>["","0",oe],$e=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ie=()=>[ft,oe];return{cacheSize:500,separator:":",theme:{colors:[Tt],spacing:[He,Qe],blur:["none","",Je,oe],brightness:Ie(),borderColor:[e],borderRadius:["none","","full",Je,oe],borderSpacing:W(),borderWidth:ie(),contrast:Ie(),grayscale:xe(),hueRotate:Ie(),invert:xe(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[q2,Qe],inset:R(),margin:R(),opacity:Ie(),padding:W(),saturate:Ie(),scale:Ie(),sepia:xe(),skew:Ie(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[Je]}],"break-after":[{"break-after":$e()}],"break-before":[{"break-before":$e()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...me(),oe]}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Nt,oe]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:xe()}],shrink:[{shrink:xe()}],order:[{order:["first","last","none",Nt,oe]}],"grid-cols":[{"grid-cols":[Tt]}],"col-start-end":[{col:["auto",{span:["full",Nt,oe]},oe]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[Tt]}],"row-start-end":[{row:["auto",{span:[Nt,oe]},oe]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[Je]},Je]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Je,Qe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Un]}],"font-family":[{font:[Tt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",oe]}],"line-clamp":[{"line-clamp":["none",ft,Un]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",He,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",He,Qe]}],"underline-offset":[{"underline-offset":["auto",He,oe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...me(),K2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",V2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},X2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...J(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:J()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[He,oe]}],"outline-w":[{outline:[He,Qe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[He,Qe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Je,Y2]}],"shadow-color":[{shadow:[Tt]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...ae(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ae()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Je,oe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[m]}],saturate:[{saturate:[P]}],sepia:[{sepia:[B]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[P]}],"backdrop-sepia":[{"backdrop-sepia":[B]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:Ie()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:Ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Nt,oe]}],"translate-x":[{"translate-x":[H]}],"translate-y":[{"translate-y":[H]}],"skew-x":[{"skew-x":[V]}],"skew-y":[{"skew-y":[V]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[He,Qe,Un]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},tS=D2(eS);function ke(...e){return tS(Ki(e))}const Ji=I.createContext(null);function nS(){const e=I.useContext(Ji);if(!e)throw new Error("useContextMenu must be used inside <ContextMenuHost>");return e}const an=8;function oS({children:e}){const[t,n]=I.useState({open:!1,x:0,y:0,items:[]}),[o,r]=I.useState(null),i=I.useRef(null),a=I.useCallback(()=>{n(c=>c.open?{...c,open:!1}:c)},[]),s=I.useCallback((c,u,m)=>{r(null),n({open:!0,x:c,y:u,items:m})},[]),l=I.useMemo(()=>({open:s,close:a}),[s,a]);return I.useLayoutEffect(()=>{if(!t.open||!i.current)return;const c=i.current.getBoundingClientRect();let u=t.x,m=t.y;u+c.width>window.innerWidth-an&&(u=Math.max(an,t.x-c.width)),m+c.height>window.innerHeight-an&&(m=Math.max(an,t.y-c.height)),r({left:u,top:m})},[t]),I.useEffect(()=>{if(!t.open)return;const c=g=>{i.current&&!i.current.contains(g.target)&&a()},u=g=>{g.key==="Escape"&&(g.preventDefault(),a())},m=()=>a(),h=()=>a();return document.addEventListener("pointerdown",c,!0),document.addEventListener("keydown",u,!0),window.addEventListener("wheel",m,{passive:!0}),window.addEventListener("blur",h),()=>{document.removeEventListener("pointerdown",c,!0),document.removeEventListener("keydown",u,!0),window.removeEventListener("wheel",m),window.removeEventListener("blur",h)}},[t.open,a]),d.jsxs(Ji.Provider,{value:l,children:[e,t.open&&d.jsx("div",{ref:i,role:"menu","aria-orientation":"vertical",className:"ole-glass fixed z-50 min-w-[200px] rounded-md border border-border p-1 text-sm shadow-md",style:{left:(o==null?void 0:o.left)??t.x,top:(o==null?void 0:o.top)??t.y,visibility:o?"visible":"hidden"},onContextMenu:c=>c.preventDefault(),children:t.items.map((c,u)=>{if(c.type==="separator")return d.jsx("div",{role:"separator",className:"my-1 h-px bg-border"},`sep-${u}`);const m=c.icon;return d.jsxs("button",{type:"button",role:"menuitem",disabled:c.disabled,className:ke("flex w-full items-center justify-between gap-3 rounded-sm px-2 py-1.5 text-left","hover:bg-accent hover:text-accent-foreground","focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:outline-none",c.destructive&&"text-destructive hover:bg-destructive/10 hover:text-destructive",c.disabled&&"pointer-events-none text-muted-foreground opacity-60"),onClick:()=>{a(),c.onSelect()},children:[d.jsxs("span",{className:"flex items-center gap-2",children:[m?d.jsx(m,{className:"size-4"}):null,d.jsx("span",{children:c.label})]}),c.shortcut?d.jsx("span",{className:"text-xs text-muted-foreground",children:c.shortcut}):null]},`${c.label}-${u}`)})})]})}const gr=e=>{let t;const n=new Set,o=(c,u)=>{const m=typeof c=="function"?c(t):c;if(!Object.is(m,t)){const h=t;t=u??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(g=>g(t,h))}},r=()=>t,s={setState:o,getState:r,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(o,r,s);return s},rS=(e=>e?gr(e):gr),iS=e=>e;function aS(e,t=iS){const n=I.useSyncExternalStore(e.subscribe,I.useCallback(()=>t(e.getState()),[e,t]),I.useCallback(()=>t(e.getInitialState()),[e,t]));return I.useDebugValue(n),n}const br=e=>{const t=rS(e),n=o=>aS(t,o);return Object.assign(n,t),n},Tn=(e=>e?br(e):br),sS={"common.unnamed":"Sin título","common.close":"Cerrar","common.yes":"Sí","common.no":"No","topbar.theme.toLight":"Cambiar a claro","topbar.theme.toDark":"Cambiar a oscuro","topbar.theme.currentDark":"Actual: tema oscuro","topbar.theme.currentLight":"Actual: tema claro","topbar.lang.toEnglish":"Cambiar a inglés","topbar.lang.toChinese":"Cambiar a chino","topbar.lang.currentEnglish":"Actual: inglés","topbar.lang.currentChinese":"Actual: chino","topbar.export.label":"Exportar","topbar.export.tooltip":"SVG vectorial (editable), mapa de bits PNG (2× HiDPI) o DXF (CAD)","topbar.export.pngFailed":"Error al exportar PNG: {err}","topbar.export.dxfFailed":"Error al exportar DXF: {err}","topbar.file.label":"Archivo","topbar.file.tooltip":"Abrir un diagrama .json local, guardar o guardar como","topbar.file.current":"Actual: {name}","topbar.file.new":"Nuevo","topbar.file.open":"Abrir…","topbar.file.save":"Guardar","topbar.file.saveAs":"Guardar como…","topbar.file.newConfirm":"Crear uno nuevo descartará los cambios sin guardar. ¿Continuar?","topbar.file.openFailed":"Error al abrir: {err}","topbar.file.saveFailed":"Error al guardar: {err}","topbar.file.fileDescription":"Diagrama de OneLineEditor","outline.title":"Esquema","outline.collapse":"Contraer","outline.collapseAria":"Contraer esquema","outline.empty":"(Sin elementos — arrastra desde la biblioteca para empezar)","props.title":"Propiedades","props.node":"Nodo eléctrico","props.wire":"Cable","props.bus":"Barra","props.junction":"Empalme","props.junctionPos":"Posición","props.nSelected":"{n} seleccionados","props.empty":"Nada seleccionado","props.multi":"{n} objetos seleccionados","props.name":"Nombre","props.note":"Nota","props.label":"Etiqueta","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nodo eléctrico {id} no encontrado","props.wireNotFound":"Cable {id} no encontrado","props.nodeStats":"{terminals} terminales · {elements} elementos","props.selectElement":"Seleccionar {label}","props.selectWholeNode":"Seleccionar todo el nodo eléctrico","props.annText":"Texto","props.annRect":"Rectángulo","props.annLine":"Línea","props.annTable":"Tabla","props.annNotFound":"Anotación {id} no encontrada","props.annLabel":"Etiqueta","props.annLabelPlaceholder":"ej.: Tablero n.º 1","props.annStroke":"Trazo","props.annStrokeSolid":"Sólido","props.annStrokeDashed":"Discontinuo","props.annFill":"Relleno","props.annFillNone":"Ninguno","props.annFillTint":"Tinte","props.annArrow":"Flechas","props.annArrowNone":"Ninguna","props.annArrowEnd":"Un extremo","props.annArrowBoth":"Ambos extremos","props.annFontSize":"Tamaño de fuente","props.annRows":"Filas","props.annCols":"Columnas","view.zoomOut":"Alejar","view.zoomOutHint":"Aleja un nivel; también rueda ↓ o ⌘−","view.reset":"Restablecer a 100%","view.current":"Actual {z}%","view.zoomIn":"Acercar","view.zoomInHint":"Acerca un nivel; también rueda ↑ o ⌘+","view.fit":"Ajustar vista","view.fitHint":"Ajusta el zoom y centra todos los elementos automáticamente","view.gridHide":"Ocultar cuadrícula","view.gridShow":"Mostrar cuadrícula","view.gridHotkey":"G","view.gridHideHint":"También desactiva el ajuste a cuadrícula (colocación libre)","view.gridShowHint":"También activa el ajuste a cuadrícula (ajusta a 10px al arrastrar)","view.gridHideAria":"Ocultar cuadrícula y desactivar ajuste","view.gridShowAria":"Mostrar cuadrícula y activar ajuste","view.label":"Etiquetas","view.labelOff":"Ninguna","view.labelId":"ID","view.labelAll":"ID + parámetros","view.labelHint":"Visibilidad y tamaño de las etiquetas (también en la exportación)","view.labelSize":"Tamaño","view.labelSizeSmaller":"Reducir el tamaño de las etiquetas","view.labelSizeLarger":"Aumentar el tamaño de las etiquetas","view.labelSizeReset":"Restablecer el tamaño de las etiquetas","library.title":"Biblioteca","library.empty":"No hay elementos coincidentes","library.searchPlaceholder":"Buscar elementos…","library.searchAria":"Buscar elementos","library.clearSearch":"Borrar búsqueda","library.itemHint":"Haz clic para entrar en modo de colocación, o arrastra al lienzo","tool.select":"Seleccionar","tool.selectHint":"Clic para elegir, arrastra un marco para varios, clic derecho para el menú","tool.pan":"Desplazar","tool.panHint":"Arrastra el lienzo; la barra espaciadora lo activa temporalmente","tool.wire":"Cable","tool.wireHint":"Arrastra desde un pin/barra/empalme; soltar en espacio vacío crea un empalme, soltar sobre un cable lo conecta","tool.bus":"Barra","tool.busHint":"Arrastra en el lienzo: pulsa para fijar el inicio, suelta para fijar el final","tool.junction":"Empalme","tool.junctionHint":"Haz clic en el lienzo para colocar un empalme (nodo); los cables se conectan a él libremente","tool.place":"Colocar","tool.placeHint":"Haz clic para colocar; o arrastra desde un terminal/barra para colocar y conectar","tool.text":"Texto","tool.textHint":"Haz clic en el lienzo para colocar una nota de texto; haz doble clic en una existente para editarla","tool.rect":"Rectángulo","tool.rectHint":"Arrastra para dibujar un rectángulo / marco de grupo (discontinuo por defecto); Mayús para un cuadrado","tool.line":"Línea","tool.lineHint":"Arrastra para dibujar una línea de anotación; Mayús ajusta a 45°; las flechas se configuran en el panel","tool.table":"Tabla","tool.tableHint":"Arrastra para definir columnas × filas (conteo en vivo), o haz clic para una tabla predeterminada; haz doble clic en las celdas para escribir","mode.selectWithSel":"Arrastra elementos · arrastra terminales para conectar · clic derecho para el menú","mode.selectEmpty":"Clic para elegir · arrastra para mover · marco para varios · clic derecho para el menú","mode.pan":"Arrastra el lienzo · desplaza la rueda para hacer zoom · mantén Espacio para desplazar en cualquier herramienta","mode.wireDragging":"Suelta sobre un pin/barra/empalme; soltar en espacio vacío crea un empalme","mode.wireInit":"Pulsa sobre cualquier punto de conexión o espacio vacío, arrastra hasta el destino y suelta","mode.busDragging":"Arrastrar fija la dirección de la barra; soltar fija el final","mode.busInit":"Pulsa en el lienzo para fijar el inicio, arrastra y suelta para fijar el final","mode.junction":"Haz clic en el lienzo para colocar un empalme","mode.placeNoKind":"Elige un tipo de elemento de la biblioteca a la izquierda","mode.placeFromTerm":"Suelta en el destino — el nuevo elemento se conectará al terminal de origen","mode.placeNormal":"Haz clic en un espacio vacío para colocar; o arrastra desde un terminal / barra para colocar y conectar","mode.text":"Clic para colocar texto · doble clic para editar · arrastra la selección para mover · Supr para eliminar","mode.rect":"Arrastra para dibujar un rectángulo · Mayús para cuadrado · redimensiona y etiqueta al soltar","mode.line":"Arrastra para dibujar una línea · Mayús ajusta a 45° · añade flechas en el panel al soltar","mode.table":"Arrastra para definir la cuadrícula, o haz clic para una tabla de 3×3 · doble clic en las celdas para escribir","mode.annTextSel":"Haz clic en el texto para editar · arrastra para mover · Supr para eliminar","mode.annTableSel":"Haz clic en una celda para completarla · arrastra para mover · Supr para eliminar","mode.annShapeSel":"Arrastra para mover · arrastra los controladores para redimensionar · cambia el estilo en el panel · Supr para eliminar","mode.annEditing":"Escribe · Intro para confirmar · Esc para cancelar · o los botones ✓ / ✕","mode.escSelect":"Esc borra la selección","mode.escOther":"Clic derecho / Esc para cancelar","tool.placeNoKindTooltip":"Elige un tipo en la biblioteca a la izquierda y luego haz clic en el lienzo","tool.undo":"Deshacer","tool.undoHint":"Deshace la última edición (mover / rotar / eliminar, etc.)","tool.redo":"Rehacer","tool.redoHint":"Rehace la última edición deshecha","layout.label":"Diseño","layout.hint":"Organiza automáticamente todo el diagrama o solo la selección, y rellena los huecos","layout.allAuto":"Organizar todo automáticamente","layout.selAuto":"Organizar la selección automáticamente","layout.allFill":"Rellenar sin colocar","layout.selFill":"Rellenar los no colocados en la selección","tool.more":"Más","tool.moreHint":"Deshacer / rehacer / diseño","view.menu":"Vista","view.menuHint":"Zoom, ajuste, cuadrícula","ctx.ariaNode":"Acciones del nodo","ctx.ariaWire":"Acciones del cable","ctx.ariaElement":"Acciones del elemento","ctx.ariaEdit":"Acciones de edición","ctx.done":"Listo","ctx.cancel":"Cancelar","ctx.rotate":"Rotar 90°","ctx.rotateHint":"Rota la selección en sentido horario; los cables se re-enrutan a los nuevos terminales","ctx.mirror":"Reflejar horizontalmente","ctx.mirrorTitle":"Reflejar","ctx.mirrorHint":"Invierte la selección de izquierda a derecha","ctx.delete":"Eliminar","ctx.deleteHintNode":"Desconecta todos los cables de este nodo (los elementos permanecen)","ctx.deleteHintWire":"Elimina solo este cable (los demás del mismo nodo permanecen)","ctx.deleteHintElement":"Elimina la selección y sus cables","ctx.resetWirePath":"Restablecer al enrutado automático","ctx.resetWirePathHint":"Descarta los ángulos manuales y deja que el enrutador vuelva a trazar este cable","menu.undo":"Deshacer","menu.redo":"Rehacer","menu.cut":"Cortar","menu.copy":"Copiar","menu.paste":"Pegar","menu.rotate":"Rotar 90°","menu.mirror":"Reflejar","menu.selectAll":"Seleccionar todo","menu.disconnect":"Desconectar este cable","menu.delete":"Eliminar","io.parseFailed":"Error al analizar JSON: {err}","io.notObject":"El archivo no es un objeto JSON","io.versionMismatch":'Versión incompatible: se esperaba "1", se obtuvo {actual}',"io.elementsMissing":"`elements` falta o no es un array","compile.duplicateId":'ID de elemento duplicado: "{id}"',"compile.unknownKind":'Tipo de elemento desconocido kind="{kind}"',"compile.invalidTermRef":'Referencia de terminal no válida "{ref}"',"compile.elementMissing":'Referencia a un elemento desconocido "{id}"',"compile.missingPin":'El elemento "{id}" (kind={kind}) no tiene el pin "{pin}"; disponibles: {available}',"compile.singleTerminal":"El nodo solo tiene un terminal — ignorado","compile.layoutMissingElement":'La clave de layout "{id}" hace referencia a un elemento desconocido',"compile.elementUnconnected":'El elemento "{id}" no tiene conexiones',"cat.busbar":"Barras / cableado","cat.switching":"Conmutación","cat.protection":"Protección","cat.motor-control":"Control de motores","cat.transformer":"Transformadores","cat.instrument-transformer":"Transformadores de medida","cat.measurement":"Medición","cat.source":"Fuentes","cat.load":"Cargas","cat.storage":"Almacenamiento","cat.compensation":"Compensación","cat.grounding":"Puesta a tierra","cat.renewable":"Renovables / electrónica de potencia","onboard.title":"Inicio rápido","onboard.step1.title":"Coloca un componente","onboard.step1.body":"Elige la herramienta Colocar (P) y arrastra un tipo de la biblioteca al lienzo","onboard.step2.title":"Conéctalo","onboard.step2.body":"Usa la herramienta Cable (W): arrastra de un pin a otro — arrastra a un espacio vacío para crear un empalme","onboard.step3.title":"Una barra es un riel compartido, no un cable","onboard.step3.body":"Usa la herramienta Barra (B) solo cuando varios circuitos comparten un mismo riel. No uses una barra para unir dos dispositivos — simplemente conecta los pines con un cable (W).","onboard.dismiss":"Entendido"},lS={"arc-suppression-coil.name":"Bobina de extinción de arco","arrester.name":"Descargador de sobretensiones (FBL)","async-motor.name":"Motor asíncrono","autotransformer.name":"Autotransformador","battery.name":"Almacenamiento en batería","breaker.name":"Interruptor automático (QF)","busbar.name":"Tramo de barra","converter-bidir.name":"Convertidor bidireccional (PCS)","dc-dc-converter.name":"Convertidor CC/CC","mppt.name":"Controlador MPPT","ct.name":"Transformador de corriente (CT)","disconnector.name":"Seccionador (QS)","earth.name":"Tierra","earthing-switch.name":"Seccionador de puesta a tierra (QE)","fuse.name":"Fusible (FU)","generator.name":"Generador (G)","grid-source.name":"Fuente de red","grounding-transformer.name":"Transformador de puesta a tierra (zig-zag)","inverter.name":"Inversor (CC→CA)","load-switch.name":"Interruptor de carga","load.name":"Carga","luminaire.name":"Luminaria (carga de alumbrado)","panelboard.name":"Tablero de distribución","ngr.name":"Resistencia de puesta a tierra del neutro (NGR)","pt.name":"Transformador de tensión (PT)","pv.name":"Módulo fotovoltaico","rectifier.name":"Rectificador (CA→CC)","series-reactor.name":"Reactor serie","shunt-capacitor.name":"Condensador en derivación","shunt-reactor.name":"Reactor en derivación","sync-motor.name":"Motor síncrono","transformer-2w.name":"Transformador de dos devanados","transformer-3w.name":"Transformador de tres devanados","wind-turbine.name":"Aerogenerador","gfci-breaker.name":"Interruptor GFCI (RCBO)","rcd.name":"Dispositivo de corriente residual (RCD)","recloser.name":"Reconectador","energy-meter.name":"Medidor de energía (Wh)","voltmeter.name":"Voltímetro (V)","ammeter.name":"Amperímetro (A)","wattmeter.name":"Vatímetro (W)","frequency-meter.name":"Frecuencímetro (Hz)","contactor.name":"Contactor (KM)","motor-starter.name":"Arrancador de motor","thermal-overload.name":"Relé de sobrecarga térmica","vfd.name":"Variador de frecuencia (VFD)","soft-starter.name":"Arrancador suave","transfer-switch.name":"Conmutador de transferencia (ATS)","dc-disconnector.name":"Seccionador de CC","dc-combiner.name":"Caja combinadora de CC","ev-charger.name":"Cargador de VE","arc-suppression-coil.desc":"Puesta a tierra resonante del neutro: inductor a tierra","busbar.desc":"Tramo de barra única extensible con múltiples derivaciones","converter-bidir.desc":"Convertidor de almacenamiento: CA ↔ CC bidireccional","dc-dc-converter.desc":"Convertidor CC/CC / cargador CC (IEC 60617)","mppt.desc":"Controlador de carga solar MPPT (CC/CC, seguimiento del punto de máxima potencia)","earthing-switch.desc":"Seccionador + conexión a tierra, un solo puerto","grid-source.desc":"Barra infinita / red externa","grounding-transformer.desc":"Transformador estrella-zigzag para puesta a tierra del neutro","load.desc":"Carga abstracta (flecha de salida de corriente)","luminaire.desc":"Carga de alumbrado (símbolo general de luminaria IEC 60617)","ngr.desc":"Puesta a tierra de baja resistencia: neutro del transformador a tierra","series-reactor.desc":"Mismo símbolo que el reactor en derivación; se distingue por el uso","wind-turbine.desc":"Turbina eólica: generador + marca de rotor de tres palas","gfci-breaker.desc":"Interruptor de corriente residual con protección de sobrecorriente (UL943 / IEC 61009). GFCI en Norteamérica / RCBO en Europa.","rcd.desc":"Interruptor de corriente residual sin protección de sobrecorriente (IEC 61008).","recloser.desc":"Reconectador automático de media tensión.","energy-meter.desc":"Medidor de energía activa (kWh) — acometida / submedición.","contactor.desc":"Contactor de circuito principal; se usa normalmente con un relé de sobrecarga térmica y un motor.","motor-starter.desc":"Arrancador de motor (símbolo general IEC 60617).","thermal-overload.desc":"Relé de sobrecarga térmica del motor; se ubica entre el contactor y el motor.","vfd.desc":"Variador de frecuencia para el control de velocidad de motores de inducción.","soft-starter.desc":"Arrancador suave de motor (arranque a tensión reducida basado en tiristores).","transfer-switch.desc":"Conmutador de transferencia de dos fuentes (ATS / manual). Dos entradas de fuente + una salida de carga, con enclavamiento mecánico.","dc-disconnector.desc":"Seccionador de CC — aislamiento del lado de CC de cadenas fotovoltaicas / baterías.","dc-combiner.desc":"Caja combinadora de cadenas fotovoltaicas (ejemplo de 4 entradas).","ev-charger.desc":"Estación de carga para vehículos eléctricos.","breaker.state.open":"Abierto","disconnector.state.open":"Abierto","earthing-switch.state.open":"Abierto","fuse.state.blown":"Fundido","load-switch.state.open":"Abierto","gfci-breaker.state.open":"Abierto","rcd.state.open":"Abierto","recloser.state.open":"Abierto","contactor.state.open":"Abierto","thermal-overload.state.tripped":"Disparado","transfer-switch.state.position":"Posición (normal/emergencia/apagado)","dc-disconnector.state.open":"Abierto","battery.param.E":"Capacidad","busbar.param.Un":"Tensión nominal","converter-bidir.param.S":"Capacidad","dc-dc-converter.param.P":"Potencia","mppt.param.I":"Corriente nominal","load.param.P":"Potencia activa","load.param.cosphi":"Factor de potencia","ngr.param.R":"Resistencia","shunt-capacitor.param.Q":"Potencia reactiva","shunt-capacitor.param.stages":"Etapas","transformer-2w.param.S":"Capacidad","transformer-2w.param.ratio":"Relación de transformación","gfci-breaker.param.In":"Corriente nominal","panelboard.param.In":"Corriente nominal","gfci-breaker.param.IDn":"Corriente diferencial de actuación","rcd.param.IDn":"Corriente diferencial de actuación","breaker.param.In":"Corriente nominal","breaker.param.poles":"Polos","breaker.param.Icu":"Poder de corte","disconnector.param.In":"Corriente nominal","fuse.param.In":"Corriente nominal","resistor.name":"Resistor (R)","capacitor.name":"Condensador (C)","diode.name":"Diodo (D)","indicator-light.name":"Luz indicadora (HL)","push-button.name":"Pulsador (SB)","relay-coil.name":"Bobina de relé (KA)","make-contact.name":"Contacto normalmente abierto (NO)","break-contact.name":"Contacto normalmente cerrado (NC)","bell.name":"Timbre (HA)","terminal.name":"Terminal / empalme (X)","fuse-switch-disconnector.name":"Seccionador-fusible","socket-outlet.name":"Toma de corriente / conector","inductor.name":"Inductor (L)","voltage-regulator.name":"Regulador de tensión (T)","dc-motor.name":"Motor de CC (M)","heater.name":"Elemento calefactor (EH)","selector-switch.name":"Conmutador selector (SA)","limit-switch.name":"Interruptor de límite (SQ)","proximity-switch.name":"Interruptor de proximidad (SQ)","time-relay.name":"Relé de tiempo (KT)","buzzer.name":"Zumbador (HA)","siren.name":"Sirena (HA)","thermocouple.name":"Termopar (BT)","thyristor.name":"Tiristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diodo Zener (D)","igbt.name":"IGBT","plc.name":"PLC / controlador","ups.name":"SAI (UPS)","power-supply.name":"Fuente de alimentación (PS)","genset.name":"Grupo electrógeno (G)","protective-relay.name":"Relé de protección","overcurrent-relay.name":"Relé de sobrecorriente (50/51)","undervoltage-relay.name":"Relé de baja tensión (27)","reverse-power-relay.name":"Relé de potencia inversa (32)","distance-relay.name":"Relé de distancia (21)","phase-failure-relay.name":"Relé de falla de fase","buchholz-relay.name":"Relé Buchholz (63)","power-factor-meter.name":"Medidor de factor de potencia (cosφ)","synchronoscope.name":"Sincronoscopio","varmeter.name":"Varímetro (var)","resistor.desc":"Resistor general / limitador de corriente / resistor de frenado.","capacitor.desc":"Condensador general / de filtro / del bus de CC. Usa el condensador en derivación para corrección del factor de potencia.","diode.desc":"Diodo rectificador / de rueda libre / de protección. t1 = ánodo (arriba), t2 = cátodo (abajo).","indicator-light.desc":"Luz indicadora de señal / estado.","push-button.desc":"Pulsador manual con retorno automático (contacto NA).","relay-coil.desc":"Bobina de accionamiento de relé / contactor (caja).","make-contact.desc":"Contacto auxiliar normalmente abierto (NA).","break-contact.desc":"Contacto auxiliar normalmente cerrado (NC).","bell.desc":"Timbre de señal / alarma.","terminal.desc":"Terminal / caja de empalme / nodo de conexión.","fuse-switch-disconnector.desc":"Seccionador-fusible bajo carga.","socket-outlet.desc":"Toma de corriente / conector multipolar.","inductor.desc":"Inductor general / bobina / choque.","voltage-regulator.desc":"Regulador de tensión de inducción / autotransformador ajustable.","dc-motor.desc":"Motor de CC (símbolo general de excitación serie).","heater.desc":"Elemento calefactor resistivo / carga de calefacción.","selector-switch.desc":"Conmutador selector / de cambio (rotativo, de posición fija).","limit-switch.desc":"Interruptor de carrera / posición (NA, accionamiento mecánico).","proximity-switch.desc":"Sensor de proximidad / interruptor de proximidad sin contacto.","time-relay.desc":"Bobina de relé de temporización (acción retardada).","buzzer.desc":"Zumbador de señal.","siren.desc":"Sirena / alarma sonora.","thermocouple.desc":"Sensor de temperatura de termopar.","thyristor.desc":"Tiristor triodo de bloqueo inverso / SCR. t1 = ánodo (arriba), t2 = cátodo (abajo).","triac.desc":"Tiristor triodo bidireccional (TRIAC).","zener-diode.desc":"Diodo Zener / regulador de tensión. t1 = ánodo (arriba), t2 = cátodo (abajo).","igbt.desc":"IGBT de canal N en modo de enriquecimiento. t1 = colector (arriba), t2 = emisor (abajo), t_g = puerta.","plc.desc":"Controlador lógico programable (PLC).","ups.desc":"Sistema de alimentación ininterrumpida en línea / en espera (UPS).","power-supply.desc":"Fuente de alimentación conmutada CA→CC / fuente de CC. t_ac arriba (~), t_dc abajo (=).","genset.desc":"Grupo electrógeno diésel / a gas.","protective-relay.desc":"Relé de medida / protección, símbolo general (IEC 60617).","overcurrent-relay.desc":"Relé de protección de sobrecorriente (ANSI 50/51).","undervoltage-relay.desc":"Relé de protección de baja tensión (ANSI 27).","reverse-power-relay.desc":"Relé de protección de potencia inversa / corriente inversa (ANSI 32).","distance-relay.desc":"Relé de protección de distancia / baja impedancia (ANSI 21).","phase-failure-relay.desc":"Relé de protección de falla de fase / pérdida de fase.","buchholz-relay.desc":"Relé Buchholz / de gas (ANSI 63).","power-factor-meter.desc":"Medidor de factor de potencia (cosφ).","synchronoscope.desc":"Indicador de sincronización / sincronoscopio.","varmeter.desc":"Medidor de potencia reactiva (var).","make-contact.state.closed":"Cerrado","break-contact.state.open":"Abierto","fuse-switch-disconnector.state.open":"Abierto","selector-switch.state.open":"Abierto","limit-switch.state.closed":"Cerrado","resistor.param.R":"Resistencia","resistor.param.P":"Potencia nominal","capacitor.param.C":"Capacitancia","capacitor.param.Un":"Tensión nominal","indicator-light.param.color":"Color","inductor.param.L":"Inductancia","inductor.param.In":"Corriente nominal","voltage-regulator.param.ratio":"Rango de regulación","heater.param.P":"Potencia","ups.param.S":"Capacidad","power-supply.param.Vdc":"Tensión de salida","genset.param.P":"Potencia"},cS={ui:sS,library:lS},dS={"common.unnamed":"Sans titre","common.close":"Fermer","common.yes":"Oui","common.no":"Non","topbar.theme.toLight":"Passer au thème clair","topbar.theme.toDark":"Passer au thème sombre","topbar.theme.currentDark":"Actuel : thème sombre","topbar.theme.currentLight":"Actuel : thème clair","topbar.lang.toEnglish":"Passer à l'anglais","topbar.lang.toChinese":"Passer au chinois","topbar.lang.currentEnglish":"Actuel : anglais","topbar.lang.currentChinese":"Actuel : chinois","topbar.export.label":"Exporter","topbar.export.tooltip":"SVG vectoriel (modifiable), PNG bitmap (2× HiDPI) ou DXF (CAO)","topbar.export.pngFailed":"Échec de l'export PNG : {err}","topbar.export.dxfFailed":"Échec de l'export DXF : {err}","topbar.file.label":"Fichier","topbar.file.tooltip":"Ouvrir un schéma .json local, enregistrer, ou enregistrer sous","topbar.file.current":"Actuel : {name}","topbar.file.new":"Nouveau","topbar.file.open":"Ouvrir…","topbar.file.save":"Enregistrer","topbar.file.saveAs":"Enregistrer sous…","topbar.file.newConfirm":"Créer un nouveau schéma effacera les modifications non enregistrées. Continuer ?","topbar.file.openFailed":"Échec de l'ouverture : {err}","topbar.file.saveFailed":"Échec de l'enregistrement : {err}","topbar.file.fileDescription":"Schéma OneLineEditor","outline.title":"Plan","outline.collapse":"Réduire","outline.collapseAria":"Réduire le plan","outline.empty":"(Aucun élément — glissez depuis la bibliothèque pour commencer)","props.title":"Propriétés","props.node":"Nœud électrique","props.wire":"Fil","props.bus":"Jeu de barres","props.junction":"Jonction","props.junctionPos":"Position","props.nSelected":"{n} sélectionné(s)","props.empty":"Aucune sélection","props.multi":"{n} objets sélectionnés","props.name":"Nom","props.note":"Note","props.label":"Repère","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nœud électrique {id} introuvable","props.wireNotFound":"Fil {id} introuvable","props.nodeStats":"{terminals} bornes · {elements} éléments","props.selectElement":"Sélectionner {label}","props.selectWholeNode":"Sélectionner tout le nœud électrique","props.annText":"Texte","props.annRect":"Rectangle","props.annLine":"Ligne","props.annTable":"Tableau","props.annNotFound":"Annotation {id} introuvable","props.annLabel":"Étiquette","props.annLabelPlaceholder":"ex. : Tableau n°1","props.annStroke":"Trait","props.annStrokeSolid":"Continu","props.annStrokeDashed":"Pointillé","props.annFill":"Remplissage","props.annFillNone":"Aucun","props.annFillTint":"Teinte","props.annArrow":"Flèches","props.annArrowNone":"Aucune","props.annArrowEnd":"Extrémité","props.annArrowBoth":"Les deux","props.annFontSize":"Taille de police","props.annRows":"Lignes","props.annCols":"Colonnes","view.zoomOut":"Zoom arrière","view.zoomOutHint":"Zoom arrière par palier ; aussi molette ↓ ou ⌘−","view.reset":"Réinitialiser à 100 %","view.current":"Actuel {z} %","view.zoomIn":"Zoom avant","view.zoomInHint":"Zoom avant par palier ; aussi molette ↑ ou ⌘+","view.fit":"Ajuster la vue","view.fitHint":"Zoom automatique et centrage de tous les éléments","view.gridHide":"Masquer la grille","view.gridShow":"Afficher la grille","view.gridHotkey":"G","view.gridHideHint":"Désactive aussi l'aimantation à la grille (placement libre)","view.gridShowHint":"Active aussi l'aimantation à la grille (alignement sur 10 px au glisser)","view.gridHideAria":"Masquer la grille et désactiver l'aimantation","view.gridShowAria":"Afficher la grille et activer l'aimantation","view.label":"Étiquettes","view.labelOff":"Aucune","view.labelId":"ID","view.labelAll":"ID + paramètres","view.labelHint":"Visibilité et taille des étiquettes (export compris)","view.labelSize":"Taille","view.labelSizeSmaller":"Réduire la taille des étiquettes","view.labelSizeLarger":"Agrandir la taille des étiquettes","view.labelSizeReset":"Réinitialiser la taille des étiquettes","library.title":"Bibliothèque","library.empty":"Aucun élément correspondant","library.searchPlaceholder":"Rechercher des éléments…","library.searchAria":"Rechercher des éléments","library.clearSearch":"Effacer la recherche","library.itemHint":"Cliquez pour passer en mode placement, ou glissez sur le plan de travail","tool.select":"Sélection","tool.selectHint":"Cliquez pour choisir, tracez un cadre pour une sélection multiple, clic droit pour le menu","tool.pan":"Déplacement","tool.panHint":"Faites glisser le plan de travail ; Espace bascule temporairement","tool.wire":"Fil","tool.wireHint":"Glissez depuis une borne/un jeu de barres/une jonction ; vers un espace vide crée une jonction, sur un fil crée un piquage","tool.bus":"Jeu de barres","tool.busHint":"Glissez sur le plan de travail — appuyez pour définir le début, relâchez pour définir la fin","tool.junction":"Jonction","tool.junctionHint":"Cliquez sur le plan de travail pour placer une jonction (nœud) ; les fils s'y raccordent librement","tool.place":"Placer","tool.placeHint":"Cliquez pour placer ; ou glissez depuis une borne/un jeu de barres pour placer et connecter","tool.text":"Texte","tool.textHint":"Cliquez sur le plan de travail pour placer une note texte ; double-cliquez sur une note existante pour la modifier","tool.rect":"Rectangle","tool.rectHint":"Glissez pour dessiner un rectangle / cadre de groupe (pointillé par défaut) ; Maj pour un carré","tool.line":"Ligne","tool.lineHint":"Glissez pour dessiner une ligne d'annotation ; Maj aligne à 45° ; les flèches se règlent dans le panneau","tool.table":"Tableau","tool.tableHint":"Glissez pour définir colonnes × lignes (comptage en direct), ou cliquez pour un tableau par défaut ; double-cliquez sur les cellules pour saisir du texte","mode.selectWithSel":"Glissez les éléments · glissez les bornes pour câbler · clic droit pour le menu","mode.selectEmpty":"Cliquez pour choisir · glissez pour déplacer · tracez un cadre pour une sélection multiple · clic droit pour le menu","mode.pan":"Glissez le plan de travail · molette pour zoomer · maintenez Espace pour déplacer avec n'importe quel outil","mode.wireDragging":"Relâchez sur une borne/un jeu de barres/une jonction ; relâcher dans un espace vide crée une jonction","mode.wireInit":"Appuyez sur un point de connexion ou un espace vide, glissez vers une cible et relâchez","mode.busDragging":"Le glissement définit la direction du jeu de barres ; le relâchement définit la fin","mode.busInit":"Appuyez sur le plan de travail pour définir le début, glissez, relâchez pour définir la fin","mode.junction":"Cliquez sur le plan de travail pour placer une jonction","mode.placeNoKind":"Choisissez un type d'élément dans la bibliothèque à gauche","mode.placeFromTerm":"Relâchez sur la cible — le nouvel élément se connectera à la borne source","mode.placeNormal":"Cliquez sur un espace vide pour placer ; ou glissez depuis une borne / un jeu de barres pour placer et connecter","mode.text":"Cliquez pour placer du texte · double-cliquez pour modifier · glissez la sélection pour déplacer · Suppr pour retirer","mode.rect":"Glissez pour dessiner un rectangle · Maj pour un carré · redimensionnez et nommez-le après relâchement","mode.line":"Glissez pour dessiner une ligne · Maj aligne à 45° · ajoutez des flèches dans le panneau après relâchement","mode.table":"Glissez pour définir la grille, ou cliquez pour un tableau 3×3 · double-cliquez sur les cellules pour saisir du texte","mode.annTextSel":"Cliquez sur le texte pour modifier · glissez pour déplacer · Suppr pour retirer","mode.annTableSel":"Cliquez sur une cellule pour la remplir · glissez pour déplacer · Suppr pour retirer","mode.annShapeSel":"Glissez pour déplacer · glissez les poignées pour redimensionner · modifiez le style dans le panneau · Suppr pour retirer","mode.annEditing":"Saisissez · Entrée pour valider · Échap pour annuler · ou les boutons ✓ / ✕","mode.escSelect":"Échap efface la sélection","mode.escOther":"Clic droit / Échap pour annuler","tool.placeNoKindTooltip":"Choisissez un type dans la bibliothèque à gauche, puis cliquez sur le plan de travail","tool.undo":"Annuler","tool.undoHint":"Annule la dernière modification (déplacement / rotation / suppression, etc.)","tool.redo":"Rétablir","tool.redoHint":"Rétablit la dernière modification annulée","layout.label":"Disposition","layout.hint":"Disposition automatique de tout le schéma ou de la sélection, comble les espaces vides","layout.allAuto":"Tout disposer automatiquement","layout.selAuto":"Disposer la sélection automatiquement","layout.allFill":"Combler les éléments non placés","layout.selFill":"Combler les éléments non placés de la sélection","tool.more":"Plus","tool.moreHint":"Annuler / rétablir / disposition","view.menu":"Affichage","view.menuHint":"Zoom, ajustement, grille","ctx.ariaNode":"Actions sur le nœud","ctx.ariaWire":"Actions sur le fil","ctx.ariaElement":"Actions sur l'élément","ctx.ariaEdit":"Actions d'édition","ctx.done":"Terminé","ctx.cancel":"Annuler","ctx.rotate":"Pivoter de 90°","ctx.rotateHint":"Fait pivoter la sélection dans le sens horaire ; les fils se réacheminent vers les nouvelles bornes","ctx.mirror":"Miroir horizontal","ctx.mirrorTitle":"Miroir","ctx.mirrorHint":"Retourne la sélection horizontalement","ctx.delete":"Supprimer","ctx.deleteHintNode":"Déconnecte tous les fils de ce nœud (les éléments restent)","ctx.deleteHintWire":"Retire uniquement ce fil (les autres fils du même nœud restent)","ctx.deleteHintElement":"Retire la sélection et ses fils","ctx.resetWirePath":"Revenir au routage automatique","ctx.resetWirePathHint":"Supprime les coudes manuels et laisse le routeur retracer ce fil","menu.undo":"Annuler","menu.redo":"Rétablir","menu.cut":"Couper","menu.copy":"Copier","menu.paste":"Coller","menu.rotate":"Pivoter de 90°","menu.mirror":"Miroir","menu.selectAll":"Tout sélectionner","menu.disconnect":"Déconnecter ce fil","menu.delete":"Supprimer","io.parseFailed":"Échec de l'analyse JSON : {err}","io.notObject":"Le fichier n'est pas un objet JSON","io.versionMismatch":"Version incompatible : attendu « 1 », obtenu {actual}","io.elementsMissing":"`elements` est manquant ou n'est pas un tableau","compile.duplicateId":"Identifiant d'élément dupliqué : « {id} »","compile.unknownKind":"Type d'élément inconnu kind=« {kind} »","compile.invalidTermRef":"Référence de borne invalide « {ref} »","compile.elementMissing":"Référence à un élément inconnu « {id} »","compile.missingPin":"L'élément « {id} » (kind={kind}) n'a pas de broche « {pin} » ; disponibles : {available}","compile.singleTerminal":"Le nœud n'a qu'une seule borne — ignoré","compile.layoutMissingElement":"la clé de disposition « {id} » référence un élément inconnu","compile.elementUnconnected":"L'élément « {id} » n'a aucune connexion","cat.busbar":"Jeux de barres / câblage","cat.switching":"Appareillage de coupure","cat.protection":"Protection","cat.motor-control":"Commande de moteur","cat.transformer":"Transformateur","cat.instrument-transformer":"Transformateur de mesure","cat.measurement":"Mesure","cat.source":"Source","cat.load":"Charge","cat.storage":"Stockage","cat.compensation":"Compensation","cat.grounding":"Mise à la terre","cat.renewable":"Énergies renouvelables / électronique de puissance","onboard.title":"Démarrage rapide","onboard.step1.title":"Placer un composant","onboard.step1.body":"Choisissez l'outil Placer (P) et glissez un type depuis la bibliothèque sur le plan de travail","onboard.step2.title":"Câblez-le","onboard.step2.body":"Utilisez l'outil Fil (W) : glissez d'une broche à une autre — glissez vers un espace vide pour créer une jonction","onboard.step3.title":"Un jeu de barres est un rail commun, pas un fil","onboard.step3.body":"Utilisez l'outil Jeu de barres (B) uniquement lorsque plusieurs circuits partagent un même rail. N'utilisez pas un jeu de barres pour relier deux appareils — câblez simplement les broches (W).","onboard.dismiss":"Compris"},uS={"arc-suppression-coil.name":"Bobine d'extinction d'arc","arrester.name":"Parafoudre (FBL)","async-motor.name":"Moteur asynchrone","autotransformer.name":"Autotransformateur","battery.name":"Stockage par batterie","breaker.name":"Disjoncteur (QF)","busbar.name":"Segment de jeu de barres","converter-bidir.name":"Convertisseur bidirectionnel (PCS)","dc-dc-converter.name":"Convertisseur DC/DC","mppt.name":"Régulateur MPPT","ct.name":"Transformateur de courant (CT)","disconnector.name":"Sectionneur (QS)","earth.name":"Terre","earthing-switch.name":"Sectionneur de terre (QE)","fuse.name":"Fusible (FU)","generator.name":"Générateur (G)","grid-source.name":"Source réseau","grounding-transformer.name":"Transformateur de mise à la terre (zigzag)","inverter.name":"Onduleur (DC→AC)","load-switch.name":"Interrupteur de charge","load.name":"Charge","luminaire.name":"Luminaire (charge d'éclairage)","panelboard.name":"Tableau de répartition","ngr.name":"Résistance de mise à la terre du neutre (NGR)","pt.name":"Transformateur de tension (PT)","pv.name":"Module photovoltaïque","rectifier.name":"Redresseur (AC→DC)","series-reactor.name":"Réactance série","shunt-capacitor.name":"Condensateur shunt","shunt-reactor.name":"Réactance shunt","sync-motor.name":"Moteur synchrone","transformer-2w.name":"Transformateur à deux enroulements","transformer-3w.name":"Transformateur à trois enroulements","wind-turbine.name":"Éolienne","gfci-breaker.name":"Disjoncteur différentiel (RCBO)","rcd.name":"Dispositif différentiel résiduel (RCD)","recloser.name":"Réenclencheur","energy-meter.name":"Compteur d'énergie (Wh)","voltmeter.name":"Voltmètre (V)","ammeter.name":"Ampèremètre (A)","wattmeter.name":"Wattmètre (W)","frequency-meter.name":"Fréquencemètre (Hz)","contactor.name":"Contacteur (KM)","motor-starter.name":"Démarreur de moteur","thermal-overload.name":"Relais thermique de surcharge","vfd.name":"Variateur de fréquence (VFD)","soft-starter.name":"Démarreur progressif","transfer-switch.name":"Commutateur de transfert (ATS)","dc-disconnector.name":"Sectionneur DC","dc-combiner.name":"Boîtier de raccordement DC","ev-charger.name":"Borne de recharge VE","arc-suppression-coil.desc":"Mise à la terre résonante du neutre : bobine reliée à la terre","busbar.desc":"Segment de jeu de barres simple extensible avec piquages multiples","converter-bidir.desc":"Convertisseur de stockage : bidirectionnel AC ↔ DC","dc-dc-converter.desc":"Convertisseur DC/DC / chargeur DC (IEC 60617)","mppt.desc":"Régulateur de charge solaire MPPT (DC/DC, recherche du point de puissance maximale)","earthing-switch.desc":"Sectionneur + liaison à la terre, à un seul accès","grid-source.desc":"Jeu de barres infini / réseau externe","grounding-transformer.desc":"Transformateur étoile-zigzag pour mise à la terre du neutre","load.desc":"Charge abstraite (flèche de sortie de courant)","luminaire.desc":"Charge d'éclairage (symbole général de luminaire CEI 60617)","ngr.desc":"Mise à la terre à faible résistance : neutre du transformateur relié à la terre","series-reactor.desc":"Même symbole que la réactance shunt ; distingué par l'usage","wind-turbine.desc":"Éolienne : génératrice + repère de rotor tripale","gfci-breaker.desc":"Disjoncteur différentiel avec protection contre les surintensités (UL943 / IEC 61009). GFCI en Amérique du Nord / RCBO en Europe.","rcd.desc":"Disjoncteur différentiel sans protection contre les surintensités (IEC 61008).","recloser.desc":"Réenclencheur automatique moyenne tension.","energy-meter.desc":"Compteur d'énergie active (kWh) — entrée de service / sous-comptage.","contactor.desc":"Contacteur de circuit principal ; généralement utilisé avec un relais thermique et un moteur.","motor-starter.desc":"Démarreur de moteur (symbole général IEC 60617).","thermal-overload.desc":"Relais thermique de surcharge moteur ; placé entre le contacteur et le moteur.","vfd.desc":"Variateur de fréquence pour le contrôle de vitesse des moteurs asynchrones.","soft-starter.desc":"Démarreur progressif de moteur (démarrage à tension réduite à base de thyristors).","transfer-switch.desc":"Commutateur de transfert à deux sources (ATS / manuel). Deux entrées source + une sortie charge, verrouillées mécaniquement.","dc-disconnector.desc":"Sectionneur DC — isolement côté DC d'une chaîne photovoltaïque / batterie.","dc-combiner.desc":"Boîtier de raccordement de chaînes photovoltaïques (exemple à 4 entrées).","ev-charger.desc":"Borne de recharge pour véhicule électrique.","breaker.state.open":"Ouvert","disconnector.state.open":"Ouvert","earthing-switch.state.open":"Ouvert","fuse.state.blown":"Fondu","load-switch.state.open":"Ouvert","gfci-breaker.state.open":"Ouvert","rcd.state.open":"Ouvert","recloser.state.open":"Ouvert","contactor.state.open":"Ouvert","thermal-overload.state.tripped":"Déclenché","transfer-switch.state.position":"Position (normal/secours/arrêt)","dc-disconnector.state.open":"Ouvert","battery.param.E":"Capacité","busbar.param.Un":"Tension nominale","converter-bidir.param.S":"Puissance apparente","dc-dc-converter.param.P":"Puissance","mppt.param.I":"Courant nominal","load.param.P":"Puissance active","load.param.cosphi":"Facteur de puissance","ngr.param.R":"Résistance","shunt-capacitor.param.Q":"Puissance réactive","shunt-capacitor.param.stages":"Gradins","transformer-2w.param.S":"Puissance apparente","transformer-2w.param.ratio":"Rapport de transformation","gfci-breaker.param.In":"Courant nominal","panelboard.param.In":"Courant nominal","gfci-breaker.param.IDn":"Courant différentiel résiduel nominal","rcd.param.IDn":"Courant différentiel résiduel nominal","breaker.param.In":"Courant nominal","breaker.param.poles":"Pôles","breaker.param.Icu":"Pouvoir de coupure","disconnector.param.In":"Courant nominal","fuse.param.In":"Courant nominal","resistor.name":"Résistance (R)","capacitor.name":"Condensateur (C)","diode.name":"Diode (D)","indicator-light.name":"Voyant lumineux (HL)","push-button.name":"Bouton-poussoir (SB)","relay-coil.name":"Bobine de relais (KA)","make-contact.name":"Contact à fermeture (NO)","break-contact.name":"Contact à ouverture (NC)","bell.name":"Sonnerie (HA)","terminal.name":"Borne / jonction (X)","fuse-switch-disconnector.name":"Interrupteur-sectionneur à fusibles","socket-outlet.name":"Prise de courant / connecteur","inductor.name":"Bobine d'inductance (L)","voltage-regulator.name":"Régulateur de tension (T)","dc-motor.name":"Moteur à courant continu (M)","heater.name":"Élément chauffant (EH)","selector-switch.name":"Commutateur sélecteur (SA)","limit-switch.name":"Interrupteur de fin de course (SQ)","proximity-switch.name":"Détecteur de proximité (SQ)","time-relay.name":"Relais temporisé (KT)","buzzer.name":"Avertisseur sonore (HA)","siren.name":"Sirène (HA)","thermocouple.name":"Thermocouple (BT)","thyristor.name":"Thyristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diode Zener (D)","igbt.name":"IGBT","plc.name":"Automate programmable (API) / contrôleur","ups.name":"ASI","power-supply.name":"Alimentation (PS)","genset.name":"Groupe électrogène (G)","protective-relay.name":"Relais de protection","overcurrent-relay.name":"Relais de surintensité (50/51)","undervoltage-relay.name":"Relais de sous-tension (27)","reverse-power-relay.name":"Relais de retour de puissance (32)","distance-relay.name":"Relais de distance (21)","phase-failure-relay.name":"Relais de manque de phase","buchholz-relay.name":"Relais Buchholz (63)","power-factor-meter.name":"Cosphimètre (cosφ)","synchronoscope.name":"Synchronoscope","varmeter.name":"Varmètre (var)","resistor.desc":"Résistance générale / de limitation de courant / de freinage.","capacitor.desc":"Condensateur général / de filtrage / de bus DC. Utilisez le condensateur shunt pour la compensation du facteur de puissance.","diode.desc":"Diode de redressement / roue libre / protection. t1 = anode (haut), t2 = cathode (bas).","indicator-light.desc":"Voyant lumineux de signalisation / d'état.","push-button.desc":"Bouton-poussoir manuel à rappel automatique (contact à fermeture NO).","relay-coil.desc":"Bobine de commande de relais / contacteur (rectangle).","make-contact.desc":"Contact auxiliaire normalement ouvert (à fermeture).","break-contact.desc":"Contact auxiliaire normalement fermé (à ouverture).","bell.desc":"Sonnerie de signalisation / d'alarme.","terminal.desc":"Borne / boîte de jonction / nœud de connexion.","fuse-switch-disconnector.desc":"Interrupteur-sectionneur à fusibles, manœuvrable en charge.","socket-outlet.desc":"Prise de courant / connecteur multipolaire.","inductor.desc":"Bobine d'inductance générale / self / self de choc.","voltage-regulator.desc":"Régulateur de tension à induction réglable / autotransformateur.","dc-motor.desc":"Moteur à courant continu (symbole général à excitation série).","heater.desc":"Élément chauffant résistif / charge de chauffage.","selector-switch.desc":"Commutateur sélecteur / à came rotatif (à position maintenue).","limit-switch.desc":"Interrupteur de fin de course / de position (NO, à commande mécanique).","proximity-switch.desc":"Capteur de proximité / détecteur de proximité sans contact.","time-relay.desc":"Bobine de relais temporisé (à fonctionnement retardé).","buzzer.desc":"Avertisseur sonore de signalisation.","siren.desc":"Sirène sonore / d'alarme.","thermocouple.desc":"Capteur de température à thermocouple.","thyristor.desc":"Thyristor triode à blocage inverse / SCR. t1 = anode (haut), t2 = cathode (bas).","triac.desc":"Thyristor triode bidirectionnel (TRIAC).","zener-diode.desc":"Diode Zener / de régulation de tension. t1 = anode (haut), t2 = cathode (bas).","igbt.desc":"IGBT à enrichissement canal N. t1 = collecteur (haut), t2 = émetteur (bas), t_g = grille.","plc.desc":"Automate programmable industriel (API).","ups.desc":"Alimentation sans interruption (ASI) online / standby.","power-supply.desc":"Alimentation à découpage AC→DC / alimentation DC. t_ac en haut (~), t_dc en bas (=).","genset.desc":"Groupe électrogène diesel / gaz.","protective-relay.desc":"Relais de mesure / protection, symbole général (IEC 60617).","overcurrent-relay.desc":"Relais de protection contre les surintensités (ANSI 50/51).","undervoltage-relay.desc":"Relais de protection contre les sous-tensions (ANSI 27).","reverse-power-relay.desc":"Relais de protection contre le retour de puissance / de courant (ANSI 32).","distance-relay.desc":"Relais de protection de distance / à minimum d'impédance (ANSI 21).","phase-failure-relay.desc":"Relais de protection contre le manque / la perte de phase.","buchholz-relay.desc":"Relais Buchholz / à gaz (ANSI 63).","power-factor-meter.desc":"Cosphimètre (cosφ).","synchronoscope.desc":"Indicateur de synchronisation / synchronoscope.","varmeter.desc":"Varmètre (mesure de puissance réactive, var).","make-contact.state.closed":"Fermé","break-contact.state.open":"Ouvert","fuse-switch-disconnector.state.open":"Ouvert","selector-switch.state.open":"Ouvert","limit-switch.state.closed":"Fermé","resistor.param.R":"Résistance","resistor.param.P":"Puissance nominale","capacitor.param.C":"Capacité","capacitor.param.Un":"Tension nominale","indicator-light.param.color":"Couleur","inductor.param.L":"Inductance","inductor.param.In":"Courant nominal","voltage-regulator.param.ratio":"Plage de régulation","heater.param.P":"Puissance","ups.param.S":"Puissance apparente","power-supply.param.Vdc":"Tension de sortie","genset.param.P":"Puissance"},mS={ui:dS,library:uS},pS={"common.unnamed":"Unbenannt","common.close":"Schließen","common.yes":"Ja","common.no":"Nein","topbar.theme.toLight":"Zu Hell wechseln","topbar.theme.toDark":"Zu Dunkel wechseln","topbar.theme.currentDark":"Aktuell: Dunkles Thema","topbar.theme.currentLight":"Aktuell: Helles Thema","topbar.lang.toEnglish":"Zu Englisch wechseln","topbar.lang.toChinese":"Zu Chinesisch wechseln","topbar.lang.currentEnglish":"Aktuell: Englisch","topbar.lang.currentChinese":"Aktuell: Chinesisch","topbar.export.label":"Exportieren","topbar.export.tooltip":"SVG-Vektor (editierbar), PNG-Bitmap (2× HiDPI) oder DXF (CAD)","topbar.export.pngFailed":"PNG-Export fehlgeschlagen: {err}","topbar.export.dxfFailed":"DXF-Export fehlgeschlagen: {err}","topbar.file.label":"Datei","topbar.file.tooltip":"Lokales .json-Diagramm öffnen, speichern oder speichern unter","topbar.file.current":"Aktuell: {name}","topbar.file.new":"Neu","topbar.file.open":"Öffnen…","topbar.file.save":"Speichern","topbar.file.saveAs":"Speichern unter…","topbar.file.newConfirm":"Bei „Neu“ gehen nicht gespeicherte Änderungen verloren. Fortfahren?","topbar.file.openFailed":"Öffnen fehlgeschlagen: {err}","topbar.file.saveFailed":"Speichern fehlgeschlagen: {err}","topbar.file.fileDescription":"OneLineEditor-Diagramm","outline.title":"Gliederung","outline.collapse":"Einklappen","outline.collapseAria":"Gliederung einklappen","outline.empty":"(Keine Elemente — aus der Bibliothek hierher ziehen, um zu starten)","props.title":"Eigenschaften","props.node":"Elektrischer Knoten","props.wire":"Leitung","props.bus":"Sammelschiene","props.junction":"Verbindungspunkt","props.junctionPos":"Position","props.nSelected":"{n} ausgewählt","props.empty":"Nichts ausgewählt","props.multi":"{n} Objekte ausgewählt","props.name":"Name","props.note":"Notiz","props.label":"Beschriftung","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Elektrischer Knoten {id} nicht gefunden","props.wireNotFound":"Leitung {id} nicht gefunden","props.nodeStats":"{terminals} Anschlüsse · {elements} Elemente","props.selectElement":"{label} auswählen","props.selectWholeNode":"Gesamten elektrischen Knoten auswählen","props.annText":"Text","props.annRect":"Rechteck","props.annLine":"Linie","props.annTable":"Tabelle","props.annNotFound":"Beschriftung {id} nicht gefunden","props.annLabel":"Bezeichnung","props.annLabelPlaceholder":"z. B. Verteiler 1","props.annStroke":"Linienart","props.annStrokeSolid":"Durchgezogen","props.annStrokeDashed":"Gestrichelt","props.annFill":"Füllung","props.annFillNone":"Keine","props.annFillTint":"Farbton","props.annArrow":"Pfeile","props.annArrowNone":"Keine","props.annArrowEnd":"Einseitig","props.annArrowBoth":"Beidseitig","props.annFontSize":"Schriftgröße","props.annRows":"Zeilen","props.annCols":"Spalten","view.zoomOut":"Verkleinern","view.zoomOutHint":"Stufenweise verkleinern; auch Mausrad ↓ oder ⌘−","view.reset":"Auf 100 % zurücksetzen","view.current":"Aktuell {z} %","view.zoomIn":"Vergrößern","view.zoomInHint":"Stufenweise vergrößern; auch Mausrad ↑ oder ⌘+","view.fit":"Ansicht einpassen","view.fitHint":"Alle Elemente automatisch zoomen und zentrieren","view.gridHide":"Raster ausblenden","view.gridShow":"Raster einblenden","view.gridHotkey":"G","view.gridHideHint":"Deaktiviert auch das Einrasten am Raster (freie Platzierung)","view.gridShowHint":"Aktiviert auch das Einrasten am Raster (rastet beim Ziehen auf 10 px ein)","view.gridHideAria":"Raster ausblenden und Einrasten deaktivieren","view.gridShowAria":"Raster einblenden und Einrasten aktivieren","view.label":"Beschriftungen","view.labelOff":"Aus","view.labelId":"ID","view.labelAll":"ID + Parameter","view.labelHint":"Sichtbarkeit und Schriftgröße der Beschriftungen (auch beim Export)","view.labelSize":"Größe","view.labelSizeSmaller":"Beschriftungen verkleinern","view.labelSizeLarger":"Beschriftungen vergrößern","view.labelSizeReset":"Schriftgröße zurücksetzen","library.title":"Bibliothek","library.empty":"Keine passenden Elemente","library.searchPlaceholder":"Elemente suchen…","library.searchAria":"Elemente suchen","library.clearSearch":"Suche löschen","library.itemHint":"Klicken für Platzierungsmodus oder auf die Zeichenfläche ziehen","tool.select":"Auswählen","tool.selectHint":"Klicken zum Auswählen, Rahmen für Mehrfachauswahl, Rechtsklick für Menü","tool.pan":"Verschieben","tool.panHint":"Zeichenfläche ziehen; Leertaste schaltet vorübergehend um","tool.wire":"Leitung","tool.wireHint":"Von einem Anschluss/einer Sammelschiene/einem Verbindungspunkt ziehen; auf freie Fläche setzt einen Verbindungspunkt, auf eine Leitung setzt einen Abzweig","tool.bus":"Sammelschiene","tool.busHint":"Auf der Zeichenfläche ziehen — drücken für Anfang, loslassen für Ende","tool.junction":"Verbindungspunkt","tool.junctionHint":"Auf die Zeichenfläche klicken, um einen Verbindungspunkt (Knoten) zu setzen; Leitungen können frei daran angeschlossen werden","tool.place":"Platzieren","tool.placeHint":"Klicken zum Platzieren; oder von einem Anschluss/einer Sammelschiene ziehen, um zu platzieren und zu verbinden","tool.text":"Text","tool.textHint":"Auf die Zeichenfläche klicken, um eine Textnotiz zu setzen; Doppelklick auf vorhandenen Text zum Bearbeiten","tool.rect":"Rechteck","tool.rectHint":"Ziehen, um ein Rechteck / einen Gruppenrahmen zu zeichnen (standardmäßig gestrichelt); Shift für ein Quadrat","tool.line":"Linie","tool.lineHint":"Ziehen, um eine Beschriftungslinie zu zeichnen; Shift rastet auf 45°; Pfeile im Panel einstellen","tool.table":"Tabelle","tool.tableHint":"Ziehen, um Spalten × Zeilen aufzuziehen (Live-Anzeige), oder klicken für eine Standardtabelle; Doppelklick auf Zellen zum Eintippen","mode.selectWithSel":"Elemente ziehen · Anschlüsse ziehen zum Verbinden · Rechtsklick für Menü","mode.selectEmpty":"Klicken zum Auswählen · Ziehen zum Verschieben · Rahmen für Mehrfachauswahl · Rechtsklick für Menü","mode.pan":"Zeichenfläche ziehen · Mausrad zum Zoomen · Leertaste gedrückt halten, um in jedem Werkzeug zu verschieben","mode.wireDragging":"Auf einem Anschluss/einer Sammelschiene/einem Verbindungspunkt loslassen; Loslassen auf freier Fläche setzt einen Verbindungspunkt","mode.wireInit":"Auf einem beliebigen Verbindungspunkt oder freier Fläche drücken, zum Ziel ziehen und loslassen","mode.busDragging":"Ziehen legt die Richtung der Sammelschiene fest; Loslassen legt das Ende fest","mode.busInit":"Auf der Zeichenfläche drücken für den Anfang, ziehen, loslassen für das Ende","mode.junction":"Auf die Zeichenfläche klicken, um einen Verbindungspunkt zu setzen","mode.placeNoKind":"Einen Elementtyp aus der Bibliothek links auswählen","mode.placeFromTerm":"Am Ziel loslassen — das neue Element wird mit dem Quellanschluss verbunden","mode.placeNormal":"Auf freie Fläche klicken zum Platzieren; oder von einem Anschluss / einer Sammelschiene ziehen, um zu platzieren und zu verbinden","mode.text":"Klicken, um Text zu setzen · Doppelklick zum Bearbeiten · Ziehen zum Verschieben der Auswahl · Entf zum Entfernen","mode.rect":"Ziehen, um ein Rechteck zu zeichnen · Shift für Quadrat · nach dem Loslassen skalieren und beschriften","mode.line":"Ziehen, um eine Linie zu zeichnen · Shift rastet auf 45° · Pfeile nach dem Loslassen im Panel hinzufügen","mode.table":"Ziehen, um das Raster aufzuziehen, oder klicken für eine 3×3-Tabelle · Doppelklick auf Zellen zum Eintippen","mode.annTextSel":"Text anklicken zum Bearbeiten · Ziehen zum Verschieben · Entf zum Entfernen","mode.annTableSel":"Zelle anklicken zum Ausfüllen · Ziehen zum Verschieben · Entf zum Entfernen","mode.annShapeSel":"Ziehen zum Verschieben · Anfasser ziehen zum Skalieren · Stil im Panel ändern · Entf zum Entfernen","mode.annEditing":"Eingeben · Enter zum Bestätigen · Esc zum Abbrechen · oder die ✓ / ✕ Schaltflächen","mode.escSelect":"Esc hebt die Auswahl auf","mode.escOther":"Rechtsklick / Esc zum Abbrechen","tool.placeNoKindTooltip":"Einen Typ in der Bibliothek links auswählen, dann auf die Zeichenfläche klicken","tool.undo":"Rückgängig","tool.undoHint":"Letzte Änderung rückgängig machen (Verschieben / Drehen / Löschen usw.)","tool.redo":"Wiederholen","tool.redoHint":"Letzte rückgängig gemachte Änderung wiederherstellen","layout.label":"Layout","layout.hint":"Gesamtes Diagramm oder nur die Auswahl automatisch anordnen, Lücken auffüllen","layout.allAuto":"Alles automatisch anordnen","layout.selAuto":"Auswahl automatisch anordnen","layout.allFill":"Nicht platzierte auffüllen","layout.selFill":"Nicht platzierte in Auswahl auffüllen","tool.more":"Mehr","tool.moreHint":"Rückgängig / Wiederholen / Layout","view.menu":"Ansicht","view.menuHint":"Zoom, Einpassen, Raster","ctx.ariaNode":"Knotenaktionen","ctx.ariaWire":"Leitungsaktionen","ctx.ariaElement":"Elementaktionen","ctx.ariaEdit":"Bearbeitungsaktionen","ctx.done":"Fertig","ctx.cancel":"Abbrechen","ctx.rotate":"Um 90° drehen","ctx.rotateHint":"Auswahl im Uhrzeigersinn drehen; Leitungen werden über neue Anschlüsse neu geführt","ctx.mirror":"Horizontal spiegeln","ctx.mirrorTitle":"Spiegeln","ctx.mirrorHint":"Auswahl links-rechts spiegeln","ctx.delete":"Löschen","ctx.deleteHintNode":"Alle Leitungen an diesem Knoten trennen (Elemente bleiben erhalten)","ctx.deleteHintWire":"Nur diese Leitung entfernen (andere Leitungen am selben Knoten bleiben erhalten)","ctx.deleteHintElement":"Auswahl und ihre Leitungen entfernen","ctx.resetWirePath":"Auf automatische Führung zurücksetzen","ctx.resetWirePathHint":"Manuelle Eckpunkte verwerfen und die Leitung automatisch neu zeichnen lassen","menu.undo":"Rückgängig","menu.redo":"Wiederholen","menu.cut":"Ausschneiden","menu.copy":"Kopieren","menu.paste":"Einfügen","menu.rotate":"Um 90° drehen","menu.mirror":"Spiegeln","menu.selectAll":"Alles auswählen","menu.disconnect":"Diese Leitung trennen","menu.delete":"Löschen","io.parseFailed":"JSON-Parsing fehlgeschlagen: {err}","io.notObject":"Datei ist kein JSON-Objekt","io.versionMismatch":"Versionskonflikt: erwartet „1“, erhalten {actual}","io.elementsMissing":"`elements` fehlt oder ist kein Array","compile.duplicateId":"Doppelte Element-ID: „{id}“","compile.unknownKind":'Unbekannter Elementtyp kind="{kind}"',"compile.invalidTermRef":"Ungültige Anschlussreferenz „{ref}“","compile.elementMissing":"Verweis auf unbekanntes Element „{id}“","compile.missingPin":"Element „{id}“ (kind={kind}) hat keinen Pin „{pin}“; verfügbar: {available}","compile.singleTerminal":"Knoten hat nur einen Anschluss — ignoriert","compile.layoutMissingElement":"layout-Schlüssel „{id}“ verweist auf ein unbekanntes Element","compile.elementUnconnected":"Element „{id}“ hat keine Verbindungen","cat.busbar":"Sammelschiene / Verdrahtung","cat.switching":"Schalten","cat.protection":"Schutz","cat.motor-control":"Motorsteuerung","cat.transformer":"Transformator","cat.instrument-transformer":"Messwandler","cat.measurement":"Messung","cat.source":"Quelle","cat.load":"Last","cat.storage":"Speicher","cat.compensation":"Kompensation","cat.grounding":"Erdung","cat.renewable":"Erneuerbare Energien / Leistungselektronik","onboard.title":"Schnellstart","onboard.step1.title":"Ein Bauteil platzieren","onboard.step1.body":"Werkzeug Platzieren (P) wählen und einen Typ aus der Bibliothek auf die Zeichenfläche ziehen","onboard.step2.title":"Verdrahten","onboard.step2.body":"Werkzeug Leitung (W) verwenden: von einem Anschluss zum anderen ziehen — auf freie Fläche ziehen setzt einen Verbindungspunkt","onboard.step3.title":"Eine Sammelschiene ist eine gemeinsame Schiene, keine Leitung","onboard.step3.body":"Das Werkzeug Sammelschiene (B) nur verwenden, wenn sich mehrere Stromkreise eine Schiene teilen. Keine Sammelschiene benutzen, um zwei Geräte zu verbinden — einfach die Anschlüsse direkt verdrahten (W).","onboard.dismiss":"Verstanden"},hS={"arc-suppression-coil.name":"Erdschlusslöschspule","arrester.name":"Überspannungsableiter (FBL)","async-motor.name":"Asynchronmotor","autotransformer.name":"Spartransformator","battery.name":"Batteriespeicher","breaker.name":"Leistungsschalter (QF)","busbar.name":"Sammelschienenabschnitt","converter-bidir.name":"Bidirektionaler Umrichter (PCS)","dc-dc-converter.name":"DC/DC-Wandler","mppt.name":"MPPT-Regler","ct.name":"Stromwandler (CT)","disconnector.name":"Trennschalter (QS)","earth.name":"Erde","earthing-switch.name":"Erdungsschalter (QE)","fuse.name":"Sicherung (FU)","generator.name":"Generator (G)","grid-source.name":"Netzeinspeisung","grounding-transformer.name":"Erdungstransformator (Zickzack)","inverter.name":"Wechselrichter (DC→AC)","load-switch.name":"Lastschalter","load.name":"Last","luminaire.name":"Leuchte (Beleuchtungslast)","panelboard.name":"Verteilerschrank / Lastzentrum","ngr.name":"Sternpunkt-Erdungswiderstand (NGR)","pt.name":"Spannungswandler (PT)","pv.name":"PV-Modul","rectifier.name":"Gleichrichter (AC→DC)","series-reactor.name":"Längsdrosselspule","shunt-capacitor.name":"Kompensationskondensator","shunt-reactor.name":"Querdrosselspule","sync-motor.name":"Synchronmotor","transformer-2w.name":"Zweiwicklungstransformator","transformer-3w.name":"Dreiwicklungstransformator","wind-turbine.name":"Windenergieanlage","gfci-breaker.name":"GFCI-Leistungsschalter (RCBO)","rcd.name":"Fehlerstrom-Schutzeinrichtung (RCD)","recloser.name":"Recloser","energy-meter.name":"Energiezähler (Wh)","voltmeter.name":"Spannungsmesser (V)","ammeter.name":"Amperemeter (A)","wattmeter.name":"Wattmeter (W)","frequency-meter.name":"Frequenzmesser (Hz)","contactor.name":"Schütz (KM)","motor-starter.name":"Motorstarter","thermal-overload.name":"Thermisches Überlastrelais","vfd.name":"Frequenzumrichter (VFD)","soft-starter.name":"Sanftstarter","transfer-switch.name":"Netzumschalter (ATS)","dc-disconnector.name":"Gleichstrom-Trennschalter","dc-combiner.name":"Generatoranschlusskasten","ev-charger.name":"EV-Ladestation","arc-suppression-coil.desc":"Resonante Sternpunkterdung: Induktivität gegen Erde","busbar.desc":"Dehnbarer Einzelsammelschienenabschnitt mit mehreren Abzweigen","converter-bidir.desc":"Speicherumrichter: bidirektional AC ↔ DC","dc-dc-converter.desc":"DC/DC-Wandler / Gleichstromladegerät (IEC 60617)","mppt.desc":"MPPT-Solarladeregler (DC/DC, Maximum-Power-Point-Tracking)","earthing-switch.desc":"Trennschalter + Erdverbindung, ein Anschluss","grid-source.desc":"Starres Netz / externes Versorgungsnetz","grounding-transformer.desc":"Stern-Zickzack-Transformator zur Sternpunkterdung","load.desc":"Abstrakte Last (Pfeil für Stromabgang)","luminaire.desc":"Beleuchtungslast (allgemeines Leuchtensymbol IEC 60617)","ngr.desc":"Niederohmige Erdung: Transformator-Sternpunkt gegen Erde","series-reactor.desc":"Gleiches Symbol wie die Querdrosselspule; Unterscheidung nach Verwendungszweck","wind-turbine.desc":"Windenergieanlage: Generator + Drei-Blatt-Rotor-Kennzeichnung","gfci-breaker.desc":"Fehlerstromschutzschalter mit Überstromschutz (UL943 / IEC 61009). In Nordamerika GFCI, in Europa RCBO.","rcd.desc":"Fehlerstromschutzschalter ohne Überstromschutz (IEC 61008).","recloser.desc":"Automatischer Mittelspannungs-Recloser.","energy-meter.desc":"Wirkarbeitszähler (kWh) — Hausanschluss / Unterzähler.","contactor.desc":"Hauptstromkreis-Schütz, meist zusammen mit einem Thermorelais und einem Motor verwendet.","motor-starter.desc":"Motorstarter (allgemeines Symbol nach IEC 60617).","thermal-overload.desc":"Thermisches Überlastschutzrelais für Motoren; sitzt zwischen Schütz und Motor.","vfd.desc":"Frequenzumrichter zur Drehzahlregelung von Asynchronmotoren.","soft-starter.desc":"Sanftstarter für Motoren (thyristorbasiertes Anlaufen mit reduzierter Spannung).","transfer-switch.desc":"Umschalter für zwei Quellen (automatisch/manuell). Zwei Quelleneingänge + ein Lastausgang, mechanisch verriegelt.","dc-disconnector.desc":"Gleichstrom-Trennschalter — Trennung auf der Gleichstromseite von PV-Strings / Batteriespeichern.","dc-combiner.desc":"PV-String-Generatoranschlusskasten (Beispiel mit 4 Eingängen).","ev-charger.desc":"Ladestation für Elektrofahrzeuge.","breaker.state.open":"Offen","disconnector.state.open":"Offen","earthing-switch.state.open":"Offen","fuse.state.blown":"Durchgebrannt","load-switch.state.open":"Offen","gfci-breaker.state.open":"Offen","rcd.state.open":"Offen","recloser.state.open":"Offen","contactor.state.open":"Offen","thermal-overload.state.tripped":"Ausgelöst","transfer-switch.state.position":"Position (normal/Notbetrieb/aus)","dc-disconnector.state.open":"Offen","battery.param.E":"Kapazität","busbar.param.Un":"Bemessungsspannung","converter-bidir.param.S":"Nennleistung","dc-dc-converter.param.P":"Leistung","mppt.param.I":"Bemessungsstrom","load.param.P":"Wirkleistung","load.param.cosphi":"Leistungsfaktor","ngr.param.R":"Widerstand","shunt-capacitor.param.Q":"Blindleistung","shunt-capacitor.param.stages":"Stufen","transformer-2w.param.S":"Nennleistung","transformer-2w.param.ratio":"Übersetzungsverhältnis","gfci-breaker.param.In":"Bemessungsstrom","panelboard.param.In":"Bemessungsstrom","gfci-breaker.param.IDn":"Bemessungsdifferenzstrom","rcd.param.IDn":"Bemessungsdifferenzstrom","breaker.param.In":"Bemessungsstrom","breaker.param.poles":"Polzahl","breaker.param.Icu":"Ausschaltvermögen","disconnector.param.In":"Bemessungsstrom","fuse.param.In":"Bemessungsstrom","resistor.name":"Widerstand (R)","capacitor.name":"Kondensator (C)","diode.name":"Diode (D)","indicator-light.name":"Meldeleuchte (HL)","push-button.name":"Taster (SB)","relay-coil.name":"Relaisspule (KA)","make-contact.name":"Schließer (NO)","break-contact.name":"Öffner (NC)","bell.name":"Klingel (HA)","terminal.name":"Klemme / Verbindungspunkt (X)","fuse-switch-disconnector.name":"Sicherungslasttrennschalter","socket-outlet.name":"Steckdose / Steckverbinder","inductor.name":"Spule (L)","voltage-regulator.name":"Spannungsregler (T)","dc-motor.name":"Gleichstrommotor (M)","heater.name":"Heizelement (EH)","selector-switch.name":"Wahlschalter (SA)","limit-switch.name":"Endschalter (SQ)","proximity-switch.name":"Näherungsschalter (SQ)","time-relay.name":"Zeitrelais (KT)","buzzer.name":"Summer (HA)","siren.name":"Sirene (HA)","thermocouple.name":"Thermoelement (BT)","thyristor.name":"Thyristor (V)","triac.name":"Triac (V)","zener-diode.name":"Z-Diode (D)","igbt.name":"IGBT","plc.name":"SPS / Steuerung","ups.name":"USV","power-supply.name":"Netzteil (PS)","genset.name":"Generatoraggregat (G)","protective-relay.name":"Schutzrelais","overcurrent-relay.name":"Überstromrelais (50/51)","undervoltage-relay.name":"Unterspannungsrelais (27)","reverse-power-relay.name":"Rückleistungsrelais (32)","distance-relay.name":"Distanzrelais (21)","phase-failure-relay.name":"Phasenausfallrelais","buchholz-relay.name":"Buchholzrelais (63)","power-factor-meter.name":"Leistungsfaktormesser (cosφ)","synchronoscope.name":"Synchronoskop","varmeter.name":"Blindleistungsmesser (var)","resistor.desc":"Allgemeiner Widerstand / Vorwiderstand / Bremswiderstand.","capacitor.desc":"Allgemeiner / Filter- / Zwischenkreiskondensator. Für Blindleistungskompensation den Kompensationskondensator verwenden.","diode.desc":"Gleichrichter- / Freilauf- / Schutzdiode. t1 = Anode (oben), t2 = Kathode (unten).","indicator-light.desc":"Signal- / Zustandsmeldeleuchte.","push-button.desc":"Handbetätigter Taster mit selbsttätiger Rückstellung (Schließer).","relay-coil.desc":"Betätigungsspule eines Relais / Schützes (Rechtecksymbol).","make-contact.desc":"Normalerweise geöffneter Hilfskontakt (Schließer).","break-contact.desc":"Normalerweise geschlossener Hilfskontakt (Öffner).","bell.desc":"Signalglocke / Alarmglocke.","terminal.desc":"Klemme / Abzweigdose / Verbindungsknoten.","fuse-switch-disconnector.desc":"Lastschaltbarer Sicherungslasttrennschalter.","socket-outlet.desc":"Steckdose / mehrpoliger Steckverbinder.","inductor.desc":"Allgemeine Spule / Induktivität / Drossel.","voltage-regulator.desc":"Regelbarer Induktions- / Spartransformator-Spannungsregler.","dc-motor.desc":"Gleichstrommotor (allgemeines Symbol, Reihenschluss).","heater.desc":"Ohmsches Heizelement / Heizlast.","selector-switch.desc":"Wahl-/Umschalter (Drehschalter, rastend).","limit-switch.desc":"Positions-/Endschalter (Schließer, mechanisch betätigt).","proximity-switch.desc":"Näherungssensor / berührungsloser Näherungsschalter.","time-relay.desc":"Zeitverzögerungsrelais (ansprechverzögert).","buzzer.desc":"Signalsummer.","siren.desc":"Akustische Sirene / Alarmsignal.","thermocouple.desc":"Thermoelement-Temperaturfühler.","thyristor.desc":"Rückwärtssperrender Thyristor. t1 = Anode (oben), t2 = Kathode (unten).","triac.desc":"Bidirektionaler Thyristor (Triac).","zener-diode.desc":"Z-Diode / Spannungsreferenzdiode. t1 = Anode (oben), t2 = Kathode (unten).","igbt.desc":"N-Kanal-Anreicherungs-IGBT. t1 = Kollektor (oben), t2 = Emitter (unten), t_g = Gate.","plc.desc":"Speicherprogrammierbare Steuerung (SPS).","ups.desc":"Online- / Standby-unterbrechungsfreie Stromversorgung.","power-supply.desc":"AC→DC-Schaltnetzteil / Gleichstromnetzteil. t_ac oben (~), t_dc unten (=).","genset.desc":"Diesel-/Gas-Generatoraggregat.","protective-relay.desc":"Mess- / Schutzrelais, allgemeines Symbol (IEC 60617).","overcurrent-relay.desc":"Überstromschutzrelais (ANSI 50/51).","undervoltage-relay.desc":"Unterspannungsschutzrelais (ANSI 27).","reverse-power-relay.desc":"Rückleistungs-/Rückstromschutzrelais (ANSI 32).","distance-relay.desc":"Distanz-/Unterimpedanzschutzrelais (ANSI 21).","phase-failure-relay.desc":"Phasenausfall-/Phasenverlustschutzrelais.","buchholz-relay.desc":"Buchholzrelais / Gasrelais (ANSI 63).","power-factor-meter.desc":"Leistungsfaktormesser (cosφ).","synchronoscope.desc":"Synchronisieranzeige / Synchronoskop.","varmeter.desc":"Blindleistungsmesser (var).","make-contact.state.closed":"Geschlossen","break-contact.state.open":"Offen","fuse-switch-disconnector.state.open":"Offen","selector-switch.state.open":"Offen","limit-switch.state.closed":"Geschlossen","resistor.param.R":"Widerstand","resistor.param.P":"Bemessungsleistung","capacitor.param.C":"Kapazität","capacitor.param.Un":"Bemessungsspannung","indicator-light.param.color":"Farbe","inductor.param.L":"Induktivität","inductor.param.In":"Bemessungsstrom","voltage-regulator.param.ratio":"Regelbereich","heater.param.P":"Leistung","ups.param.S":"Nennleistung","power-supply.param.Vdc":"Ausgangsspannung","genset.param.P":"Leistung"},fS={ui:pS,library:hS},gS={"common.unnamed":"Sem título","common.close":"Fechar","common.yes":"Sim","common.no":"Não","topbar.theme.toLight":"Mudar para claro","topbar.theme.toDark":"Mudar para escuro","topbar.theme.currentDark":"Atual: tema escuro","topbar.theme.currentLight":"Atual: tema claro","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Atual: inglês","topbar.lang.currentChinese":"Atual: chinês","topbar.export.label":"Exportar","topbar.export.tooltip":"SVG vetorial (editável), PNG bitmap (2× HiDPI) ou DXF (CAD)","topbar.export.pngFailed":"Falha ao exportar PNG: {err}","topbar.export.dxfFailed":"Falha ao exportar DXF: {err}","topbar.file.label":"Arquivo","topbar.file.tooltip":"Abrir um diagrama .json local, salvar ou salvar como","topbar.file.current":"Atual: {name}","topbar.file.new":"Novo","topbar.file.open":"Abrir…","topbar.file.save":"Salvar","topbar.file.saveAs":"Salvar como…","topbar.file.newConfirm":"Criar um novo diagrama descartará as alterações não salvas. Continuar?","topbar.file.openFailed":"Falha ao abrir: {err}","topbar.file.saveFailed":"Falha ao salvar: {err}","topbar.file.fileDescription":"Diagrama OneLineEditor","outline.title":"Estrutura","outline.collapse":"Recolher","outline.collapseAria":"Recolher estrutura","outline.empty":"(Nenhum elemento — arraste da biblioteca para começar)","props.title":"Propriedades","props.node":"Nó elétrico","props.wire":"Fio","props.bus":"Barramento","props.junction":"Junção","props.junctionPos":"Posição","props.nSelected":"{n} selecionado(s)","props.empty":"Nada selecionado","props.multi":"{n} objetos selecionados","props.name":"Nome","props.note":"Nota","props.label":"Rótulo","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Nó elétrico {id} não encontrado","props.wireNotFound":"Fio {id} não encontrado","props.nodeStats":"{terminals} terminais · {elements} elementos","props.selectElement":"Selecionar {label}","props.selectWholeNode":"Selecionar todo o nó elétrico","props.annText":"Texto","props.annRect":"Retângulo","props.annLine":"Linha","props.annTable":"Tabela","props.annNotFound":"Anotação {id} não encontrada","props.annLabel":"Rótulo","props.annLabelPlaceholder":"ex.: Quadro nº 1","props.annStroke":"Traço","props.annStrokeSolid":"Sólido","props.annStrokeDashed":"Tracejado","props.annFill":"Preenchimento","props.annFillNone":"Nenhum","props.annFillTint":"Tonalidade","props.annArrow":"Setas","props.annArrowNone":"Nenhuma","props.annArrowEnd":"Simples","props.annArrowBoth":"Dupla","props.annFontSize":"Tamanho da fonte","props.annRows":"Linhas","props.annCols":"Colunas","view.zoomOut":"Reduzir zoom","view.zoomOutHint":"Reduz o zoom por etapas; também roda ↓ ou ⌘−","view.reset":"Redefinir para 100%","view.current":"Atual {z}%","view.zoomIn":"Aumentar zoom","view.zoomInHint":"Aumenta o zoom por etapas; também roda ↑ ou ⌘+","view.fit":"Ajustar à tela","view.fitHint":"Aplica zoom automático e centraliza todos os elementos","view.gridHide":"Ocultar grade","view.gridShow":"Mostrar grade","view.gridHotkey":"G","view.gridHideHint":"Também desativa o encaixe à grade (posicionamento livre)","view.gridShowHint":"Também ativa o encaixe à grade (encaixa em 10px ao arrastar)","view.gridHideAria":"Ocultar grade e desativar encaixe","view.gridShowAria":"Mostrar grade e ativar encaixe","view.label":"Rótulos","view.labelOff":"Nenhum","view.labelId":"ID","view.labelAll":"ID + parâmetros","view.labelHint":"Visibilidade e tamanho dos rótulos (também na exportação)","view.labelSize":"Tamanho","view.labelSizeSmaller":"Diminuir o tamanho dos rótulos","view.labelSizeLarger":"Aumentar o tamanho dos rótulos","view.labelSizeReset":"Redefinir o tamanho dos rótulos","library.title":"Biblioteca","library.empty":"Nenhum elemento encontrado","library.searchPlaceholder":"Buscar elementos…","library.searchAria":"Buscar elementos","library.clearSearch":"Limpar busca","library.itemHint":"Clique para entrar no modo de posicionamento ou arraste até a tela","tool.select":"Selecionar","tool.selectHint":"Clique para selecionar, arraste para selecionar vários, botão direito para o menu","tool.pan":"Panorâmica","tool.panHint":"Arraste a tela; a barra de espaço alterna temporariamente","tool.wire":"Fio","tool.wireHint":"Arraste de um pino/barramento/junção; soltar em espaço vazio cria uma junção, sobre um fio existente cria uma derivação","tool.bus":"Barramento","tool.busHint":"Arraste na tela — pressione para definir o início, solte para definir o fim","tool.junction":"Junção","tool.junctionHint":"Clique na tela para posicionar uma junção (nó); os fios se conectam livremente a ela","tool.place":"Posicionar","tool.placeHint":"Clique para posicionar; ou arraste de um terminal/barramento para posicionar e conectar","tool.text":"Texto","tool.textHint":"Clique na tela para inserir uma anotação de texto; clique duas vezes em uma existente para editar","tool.rect":"Retângulo","tool.rectHint":"Arraste para desenhar um retângulo / moldura de grupo (tracejado por padrão); Shift para um quadrado","tool.line":"Linha","tool.lineHint":"Arraste para desenhar uma linha de anotação; Shift trava em 45°; as setas ficam no painel","tool.table":"Tabela","tool.tableHint":"Arraste para definir colunas × linhas (contagem em tempo real), ou clique para uma tabela padrão; clique duas vezes nas células para digitar","mode.selectWithSel":"Arraste elementos para mover · arraste terminais para conectar · botão direito para o menu","mode.selectEmpty":"Clique para selecionar · arraste para mover · seleção múltipla por área · botão direito para o menu","mode.pan":"Arraste a tela · role para o zoom · segure Espaço para deslocar em qualquer ferramenta","mode.wireDragging":"Solte em um pino/barramento/junção; soltar em espaço vazio cria uma junção","mode.wireInit":"Pressione em qualquer ponto de conexão ou espaço vazio, arraste até o destino e solte","mode.busDragging":"O arraste define a direção do barramento; soltar define o fim","mode.busInit":"Pressione na tela para definir o início, arraste, solte para definir o fim","mode.junction":"Clique na tela para posicionar uma junção","mode.placeNoKind":"Escolha um tipo de elemento na biblioteca à esquerda","mode.placeFromTerm":"Solte no destino — o novo elemento se conectará de volta ao terminal de origem","mode.placeNormal":"Clique em um espaço vazio para posicionar; ou arraste de um terminal/barramento para posicionar e conectar","mode.text":"Clique para inserir texto · clique duas vezes para editar · arraste o selecionado para mover · Del para remover","mode.rect":"Arraste para desenhar um retângulo · Shift para quadrado · redimensione e rotule após soltar","mode.line":"Arraste para desenhar uma linha · Shift trava em 45° · adicione setas no painel após soltar","mode.table":"Arraste para definir a grade, ou clique para uma tabela 3×3 · clique duas vezes nas células para digitar","mode.annTextSel":"Clique no texto para editar · arraste para mover · Del para remover","mode.annTableSel":"Clique em uma célula para preencher · arraste para mover · Del para remover","mode.annShapeSel":"Arraste para mover · arraste as alças para redimensionar · reestilize no painel · Del para remover","mode.annEditing":"Digite · Enter para confirmar · Esc para cancelar · ou os botões ✓ / ✕","mode.escSelect":"Esc limpa a seleção","mode.escOther":"Botão direito / Esc para cancelar","tool.placeNoKindTooltip":"Escolha um tipo na biblioteca à esquerda e clique na tela","tool.undo":"Desfazer","tool.undoHint":"Desfaz a última edição (mover / girar / excluir etc.)","tool.redo":"Refazer","tool.redoHint":"Refaz a última edição desfeita","layout.label":"Layout","layout.hint":"Aplica o layout automático a todo o diagrama ou apenas à seleção, preenchendo lacunas","layout.allAuto":"Reaplicar layout automático","layout.selAuto":"Reaplicar layout automático na seleção","layout.allFill":"Preencher não posicionados","layout.selFill":"Preencher não posicionados na seleção","tool.more":"Mais","tool.moreHint":"Desfazer / refazer / layout","view.menu":"Visualização","view.menuHint":"Zoom, ajuste, grade","ctx.ariaNode":"Ações do nó","ctx.ariaWire":"Ações do fio","ctx.ariaElement":"Ações do elemento","ctx.ariaEdit":"Ações de edição","ctx.done":"Concluído","ctx.cancel":"Cancelar","ctx.rotate":"Girar 90°","ctx.rotateHint":"Gira a seleção no sentido horário; os fios se reconectam pelos novos terminais","ctx.mirror":"Espelhar horizontalmente","ctx.mirrorTitle":"Espelhar","ctx.mirrorHint":"Inverte a seleção da esquerda para a direita","ctx.delete":"Excluir","ctx.deleteHintNode":"Desconecta todos os fios deste nó (os elementos permanecem)","ctx.deleteHintWire":"Remove apenas este fio (os demais no mesmo nó permanecem)","ctx.deleteHintElement":"Remove a seleção e seus fios","ctx.resetWirePath":"Redefinir para roteamento automático","ctx.resetWirePathHint":"Remove os vértices manuais e deixa o roteador redesenhar este fio","menu.undo":"Desfazer","menu.redo":"Refazer","menu.cut":"Recortar","menu.copy":"Copiar","menu.paste":"Colar","menu.rotate":"Girar 90°","menu.mirror":"Espelhar","menu.selectAll":"Selecionar tudo","menu.disconnect":"Desconectar este fio","menu.delete":"Excluir","io.parseFailed":"Falha ao interpretar o JSON: {err}","io.notObject":"O arquivo não é um objeto JSON","io.versionMismatch":'Versão incompatível: esperado "1", recebido {actual}',"io.elementsMissing":"`elements` está ausente ou não é um array","compile.duplicateId":'ID de elemento duplicado: "{id}"',"compile.unknownKind":'Tipo de elemento desconhecido kind="{kind}"',"compile.invalidTermRef":'Referência de terminal inválida "{ref}"',"compile.elementMissing":'Referência a um elemento desconhecido "{id}"',"compile.missingPin":'O elemento "{id}" (kind={kind}) não possui o pino "{pin}"; disponíveis: {available}',"compile.singleTerminal":"O nó possui apenas um terminal — ignorado","compile.layoutMissingElement":'A chave de layout "{id}" referencia um elemento desconhecido',"compile.elementUnconnected":'O elemento "{id}" não possui nenhuma conexão',"cat.busbar":"Barramento / fiação","cat.switching":"Manobra","cat.protection":"Proteção","cat.motor-control":"Controle de motores","cat.transformer":"Transformador","cat.instrument-transformer":"Transformador de instrumento","cat.measurement":"Medição","cat.source":"Fonte","cat.load":"Carga","cat.storage":"Armazenamento","cat.compensation":"Compensação","cat.grounding":"Aterramento","cat.renewable":"Renováveis / eletrônica de potência","onboard.title":"Início rápido","onboard.step1.title":"Posicione um componente","onboard.step1.body":"Escolha a ferramenta Posicionar (P) e arraste um tipo da biblioteca até a tela","onboard.step2.title":"Conecte os fios","onboard.step2.body":"Use a ferramenta Fio (W): arraste de um pino a outro — arraste até um espaço vazio para criar uma junção","onboard.step3.title":"Um barramento é um trilho compartilhado, não um fio","onboard.step3.body":"Use a ferramenta Barramento (B) somente quando vários circuitos compartilham o mesmo trilho. Não use um barramento para ligar dois dispositivos — apenas conecte os pinos (W).","onboard.dismiss":"Entendi"},bS={"arc-suppression-coil.name":"Bobina de supressão de arco","arrester.name":"Para-raios (FBL)","async-motor.name":"Motor de indução","autotransformer.name":"Autotransformador","battery.name":"Armazenamento em bateria","breaker.name":"Disjuntor (QF)","busbar.name":"Segmento de barramento","converter-bidir.name":"Conversor bidirecional (PCS)","dc-dc-converter.name":"Conversor CC/CC","mppt.name":"Controlador MPPT","ct.name":"Transformador de corrente (CT)","disconnector.name":"Seccionador (QS)","earth.name":"Terra","earthing-switch.name":"Chave de aterramento (QE)","fuse.name":"Fusível (FU)","generator.name":"Gerador (G)","grid-source.name":"Fonte da rede","grounding-transformer.name":"Transformador de aterramento (zig-zag)","inverter.name":"Inversor (CC→CA)","load-switch.name":"Chave de carga","load.name":"Carga","luminaire.name":"Luminária (carga de iluminação)","panelboard.name":"Quadro de distribuição","ngr.name":"Resistor de aterramento de neutro (NGR)","pt.name":"Transformador de tensão (PT)","pv.name":"Módulo fotovoltaico","rectifier.name":"Retificador (CA→CC)","series-reactor.name":"Reator série","shunt-capacitor.name":"Capacitor em derivação","shunt-reactor.name":"Reator em derivação","sync-motor.name":"Motor síncrono","transformer-2w.name":"Transformador de dois enrolamentos","transformer-3w.name":"Transformador de três enrolamentos","wind-turbine.name":"Aerogerador","gfci-breaker.name":"Disjuntor GFCI (RCBO)","rcd.name":"Dispositivo de corrente residual (RCD)","recloser.name":"Religador","energy-meter.name":"Medidor de energia (Wh)","voltmeter.name":"Voltímetro (V)","ammeter.name":"Amperímetro (A)","wattmeter.name":"Wattímetro (W)","frequency-meter.name":"Frequencímetro (Hz)","contactor.name":"Contator (KM)","motor-starter.name":"Chave de partida de motor","thermal-overload.name":"Relé de sobrecarga térmica","vfd.name":"Inversor de frequência (VFD)","soft-starter.name":"Chave de partida suave","transfer-switch.name":"Chave de transferência (ATS)","dc-disconnector.name":"Seccionador CC","dc-combiner.name":"Caixa combinadora CC","ev-charger.name":"Carregador de veículo elétrico (VE)","arc-suppression-coil.desc":"Aterramento ressonante de neutro: indutor ligado à terra","busbar.desc":"Segmento de barramento único e extensível, com múltiplas derivações","converter-bidir.desc":"Conversor de armazenamento: CA ↔ CC bidirecional","dc-dc-converter.desc":"Conversor CC/CC / carregador CC (IEC 60617)","mppt.desc":"Controlador de carga solar MPPT (CC/CC, rastreamento do ponto de máxima potência)","earthing-switch.desc":"Seccionador + conexão à terra, porta única","grid-source.desc":"Barramento infinito / rede externa","grounding-transformer.desc":"Transformador estrela-zigue-zague para aterramento de neutro","load.desc":"Carga abstrata (seta de saída de corrente)","luminaire.desc":"Carga de iluminação (símbolo geral de luminária IEC 60617)","ngr.desc":"Aterramento de baixa resistência: neutro do transformador à terra","series-reactor.desc":"Mesmo símbolo do reator em derivação; diferenciado pelo uso","wind-turbine.desc":"Aerogerador: gerador + marca de rotor de três pás","gfci-breaker.desc":"Disjuntor de corrente residual com proteção contra sobrecorrente (UL943 / IEC 61009). GFCI na América do Norte / RCBO na Europa.","rcd.desc":"Disjuntor de corrente residual sem proteção contra sobrecorrente (IEC 61008).","recloser.desc":"Religador automático de média tensão.","energy-meter.desc":"Medidor de energia ativa (kWh) — entrada de serviço / submedição.","contactor.desc":"Contator de circuito principal; normalmente usado com um relé de sobrecarga térmica e um motor.","motor-starter.desc":"Chave de partida de motor (símbolo geral IEC 60617).","thermal-overload.desc":"Relé de sobrecarga térmica do motor; posicionado entre o contator e o motor.","vfd.desc":"Inversor de frequência (Variable Frequency Drive) para controle de velocidade de motores de indução.","soft-starter.desc":"Chave de partida suave do motor (partida a tensão reduzida com tiristores).","transfer-switch.desc":"Chave de transferência de duas fontes (ATS / manual). Duas entradas de fonte + uma saída de carga, com intertravamento mecânico.","dc-disconnector.desc":"Seccionador CC — isolamento do lado CC de string fotovoltaica / bateria.","dc-combiner.desc":"Caixa combinadora de strings fotovoltaicos (exemplo com 4 entradas).","ev-charger.desc":"Estação de recarga de veículos elétricos.","breaker.state.open":"Aberto","disconnector.state.open":"Aberto","earthing-switch.state.open":"Aberto","fuse.state.blown":"Queimado","load-switch.state.open":"Aberto","gfci-breaker.state.open":"Aberto","rcd.state.open":"Aberto","recloser.state.open":"Aberto","contactor.state.open":"Aberto","thermal-overload.state.tripped":"Atuado","transfer-switch.state.position":"Posição (normal/emergência/desligado)","dc-disconnector.state.open":"Aberto","battery.param.E":"Capacidade","busbar.param.Un":"Tensão nominal","converter-bidir.param.S":"Capacidade","dc-dc-converter.param.P":"Potência","mppt.param.I":"Corrente nominal","load.param.P":"Potência ativa","load.param.cosphi":"Fator de potência","ngr.param.R":"Resistência","shunt-capacitor.param.Q":"Potência reativa","shunt-capacitor.param.stages":"Estágios","transformer-2w.param.S":"Capacidade","transformer-2w.param.ratio":"Relação de transformação","gfci-breaker.param.In":"Corrente nominal","panelboard.param.In":"Corrente nominal","gfci-breaker.param.IDn":"Corrente residual de atuação","rcd.param.IDn":"Corrente residual de atuação","breaker.param.In":"Corrente nominal","breaker.param.poles":"Polos","breaker.param.Icu":"Capacidade de interrupção","disconnector.param.In":"Corrente nominal","fuse.param.In":"Corrente nominal","resistor.name":"Resistor (R)","capacitor.name":"Capacitor (C)","diode.name":"Diodo (D)","indicator-light.name":"Lâmpada de sinalização (HL)","push-button.name":"Botoeira (SB)","relay-coil.name":"Bobina de relé (KA)","make-contact.name":"Contato normalmente aberto (NO)","break-contact.name":"Contato normalmente fechado (NC)","bell.name":"Campainha (HA)","terminal.name":"Terminal / junção (X)","fuse-switch-disconnector.name":"Chave seccionadora-fusível","socket-outlet.name":"Tomada / conector","inductor.name":"Indutor (L)","voltage-regulator.name":"Regulador de tensão (T)","dc-motor.name":"Motor CC (M)","heater.name":"Elemento de aquecimento (EH)","selector-switch.name":"Chave seletora (SA)","limit-switch.name":"Chave fim de curso (SQ)","proximity-switch.name":"Chave de proximidade (SQ)","time-relay.name":"Relé temporizador (KT)","buzzer.name":"Zumbidor (HA)","siren.name":"Sirene (HA)","thermocouple.name":"Termopar (BT)","thyristor.name":"Tiristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Diodo zener (D)","igbt.name":"IGBT","plc.name":"CLP / controlador","ups.name":"No-break (UPS)","power-supply.name":"Fonte de alimentação (PS)","genset.name":"Grupo gerador (G)","protective-relay.name":"Relé de proteção","overcurrent-relay.name":"Relé de sobrecorrente (50/51)","undervoltage-relay.name":"Relé de subtensão (27)","reverse-power-relay.name":"Relé de potência reversa (32)","distance-relay.name":"Relé de distância (21)","phase-failure-relay.name":"Relé de falta de fase","buchholz-relay.name":"Relé Buchholz (63)","power-factor-meter.name":"Medidor de fator de potência (cosφ)","synchronoscope.name":"Sincronoscópio","varmeter.name":"Varímetro (var)","resistor.desc":"Resistor geral / limitador de corrente / resistor de frenagem.","capacitor.desc":"Capacitor geral / de filtro / do barramento CC. Use o capacitor em derivação para correção do fator de potência.","diode.desc":"Diodo retificador / de roda livre / de proteção. t1 = ânodo (topo), t2 = cátodo (base).","indicator-light.desc":"Lâmpada de sinalização / indicação de status.","push-button.desc":"Botoeira manual, retorno automático (contato NA).","relay-coil.desc":"Bobina de acionamento de relé / contator (caixa).","make-contact.desc":"Contato auxiliar normalmente aberto (NA).","break-contact.desc":"Contato auxiliar normalmente fechado (NF).","bell.desc":"Campainha de sinalização / alarme.","terminal.desc":"Terminal / caixa de junção / nó de conexão.","fuse-switch-disconnector.desc":"Chave seccionadora-fusível sob carga.","socket-outlet.desc":"Tomada de energia / conector multipolar.","inductor.desc":"Indutor geral / bobina / reator.","voltage-regulator.desc":"Regulador de tensão ajustável do tipo indução / autotransformador.","dc-motor.desc":"Motor CC (símbolo geral de campo série).","heater.desc":"Elemento resistivo de aquecimento / carga térmica.","selector-switch.desc":"Chave seletora / comutadora (rotativa, com retenção de posição).","limit-switch.desc":"Chave fim de curso / de posição (NA, acionamento mecânico).","proximity-switch.desc":"Sensor de proximidade / chave de proximidade sem contato.","time-relay.desc":"Bobina de relé temporizado (de operação retardada).","buzzer.desc":"Zumbidor de sinalização.","siren.desc":"Sirene sonora / de alarme.","thermocouple.desc":"Sensor de temperatura por termopar.","thyristor.desc":"Tiristor triodo de bloqueio reverso / SCR. t1 = ânodo (topo), t2 = cátodo (base).","triac.desc":"Tiristor triodo bidirecional (TRIAC).","zener-diode.desc":"Diodo zener / regulador de tensão. t1 = ânodo (topo), t2 = cátodo (base).","igbt.desc":"IGBT de canal N, modo intensificação. t1 = coletor (topo), t2 = emissor (base), t_g = gate.","plc.desc":"Controlador lógico programável (CLP).","ups.desc":"No-break online / standby (fonte de alimentação ininterrupta).","power-supply.desc":"Fonte chaveada CA→CC / fonte CC. t_ac no topo (~), t_dc na base (=).","genset.desc":"Grupo gerador a diesel / gás.","protective-relay.desc":"Relé de medição / proteção, símbolo geral (IEC 60617).","overcurrent-relay.desc":"Relé de proteção de sobrecorrente (ANSI 50/51).","undervoltage-relay.desc":"Relé de proteção de subtensão (ANSI 27).","reverse-power-relay.desc":"Relé de proteção de potência reversa / corrente reversa (ANSI 32).","distance-relay.desc":"Relé de proteção de distância / subimpedância (ANSI 21).","phase-failure-relay.desc":"Relé de proteção de falta de fase / perda de fase.","buchholz-relay.desc":"Relé Buchholz / relé de gás (ANSI 63).","power-factor-meter.desc":"Medidor de fator de potência (cosφ).","synchronoscope.desc":"Indicador de sincronismo / sincronoscópio.","varmeter.desc":"Medidor de potência reativa (var).","make-contact.state.closed":"Fechado","break-contact.state.open":"Aberto","fuse-switch-disconnector.state.open":"Aberto","selector-switch.state.open":"Aberto","limit-switch.state.closed":"Fechado","resistor.param.R":"Resistência","resistor.param.P":"Potência nominal","capacitor.param.C":"Capacitância","capacitor.param.Un":"Tensão nominal","indicator-light.param.color":"Cor","inductor.param.L":"Indutância","inductor.param.In":"Corrente nominal","voltage-regulator.param.ratio":"Faixa de regulação","heater.param.P":"Potência","ups.param.S":"Capacidade","power-supply.param.Vdc":"Tensão de saída","genset.param.P":"Potência"},yS={ui:gS,library:bS},xS={"common.unnamed":"無題","common.close":"閉じる","common.yes":"はい","common.no":"いいえ","topbar.theme.toLight":"ライトモードに切り替え","topbar.theme.toDark":"ダークモードに切り替え","topbar.theme.currentDark":"現在:ダークテーマ","topbar.theme.currentLight":"現在:ライトテーマ","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"現在:中国語","topbar.export.label":"エクスポート","topbar.export.tooltip":"SVGベクター(編集可能)、PNGビットマップ(2倍高精細)、またはDXF(CAD用)","topbar.export.pngFailed":"PNGのエクスポートに失敗しました:{err}","topbar.export.dxfFailed":"DXFのエクスポートに失敗しました:{err}","topbar.file.label":"ファイル","topbar.file.tooltip":"ローカルの .json 図面を開く、保存、または名前を付けて保存","topbar.file.current":"現在:{name}","topbar.file.new":"新規","topbar.file.open":"開く…","topbar.file.save":"保存","topbar.file.saveAs":"名前を付けて保存…","topbar.file.newConfirm":"新規作成すると保存されていない変更は破棄されます。続行しますか?","topbar.file.openFailed":"開けませんでした:{err}","topbar.file.saveFailed":"保存に失敗しました:{err}","topbar.file.fileDescription":"OneLineEditor 図面","outline.title":"アウトライン","outline.collapse":"折りたたむ","outline.collapseAria":"アウトラインを折りたたむ","outline.empty":"(要素がありません — ライブラリからドラッグして開始)","props.title":"プロパティ","props.node":"電気ノード","props.wire":"配線","props.bus":"母線","props.junction":"接続点","props.junctionPos":"位置","props.nSelected":"{n} 個選択中","props.empty":"選択なし","props.multi":"{n} 個のオブジェクトを選択中","props.name":"名前","props.note":"メモ","props.label":"ラベル","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"電気ノード {id} が見つかりません","props.wireNotFound":"配線 {id} が見つかりません","props.nodeStats":"端子 {terminals} 個 · 要素 {elements} 個","props.selectElement":"{label} を選択","props.selectWholeNode":"電気ノード全体を選択","props.annText":"テキスト","props.annRect":"矩形","props.annLine":"線","props.annTable":"表","props.annNotFound":"注釈 {id} が見つかりません","props.annLabel":"ラベル","props.annLabelPlaceholder":"例:配電盤 1","props.annStroke":"線種","props.annStrokeSolid":"実線","props.annStrokeDashed":"破線","props.annFill":"塗りつぶし","props.annFillNone":"なし","props.annFillTint":"淡色","props.annArrow":"矢印","props.annArrowNone":"なし","props.annArrowEnd":"片側","props.annArrowBoth":"両側","props.annFontSize":"フォントサイズ","props.annRows":"行数","props.annCols":"列数","view.zoomOut":"ズームアウト","view.zoomOutHint":"段階的にズームアウト。ホイール ↓ や ⌘− でも可","view.reset":"100% にリセット","view.current":"現在 {z}%","view.zoomIn":"ズームイン","view.zoomInHint":"段階的にズームイン。ホイール ↑ や ⌘+ でも可","view.fit":"全体表示","view.fitHint":"すべての要素を自動でズームして中央に配置","view.gridHide":"グリッドを非表示","view.gridShow":"グリッドを表示","view.gridHotkey":"G","view.gridHideHint":"グリッドへのスナップも無効化(自由配置)","view.gridShowHint":"グリッドへのスナップも有効化(ドラッグ時に10pxにスナップ)","view.gridHideAria":"グリッドを非表示にしてスナップを無効化","view.gridShowAria":"グリッドを表示してスナップを有効化","view.label":"ラベル","view.labelOff":"オフ","view.labelId":"ID","view.labelAll":"ID + パラメータ","view.labelHint":"ラベルの表示と文字サイズ(書き出しにも反映)","view.labelSize":"サイズ","view.labelSizeSmaller":"ラベルを小さく","view.labelSizeLarger":"ラベルを大きく","view.labelSizeReset":"既定のサイズに戻す","library.title":"ライブラリ","library.empty":"該当する要素がありません","library.searchPlaceholder":"要素を検索…","library.searchAria":"要素を検索","library.clearSearch":"検索をクリア","library.itemHint":"クリックで配置モードに入る、またはキャンバスへドラッグ","tool.select":"選択","tool.selectHint":"クリックで選択、範囲選択で複数選択、右クリックでメニュー","tool.pan":"パン","tool.panHint":"キャンバスをドラッグ。スペースキーで一時的に切替","tool.wire":"配線","tool.wireHint":"ピン/母線/接続点からドラッグ。空白部分へドロップすると接続点を新設、配線上へドロップすると分岐点を作成","tool.bus":"母線","tool.busHint":"キャンバス上でドラッグ — 押下で始点、離すと終点を設定","tool.junction":"接続点","tool.junctionHint":"キャンバスをクリックして接続点(ノード)を配置。配線を自由に接続可能","tool.place":"配置","tool.placeHint":"クリックで配置。端子/母線からドラッグすると配置と同時に接続","tool.text":"テキスト","tool.textHint":"キャンバスをクリックしてテキスト注釈を配置。既存の注釈はダブルクリックで編集","tool.rect":"矩形","tool.rectHint":"ドラッグで矩形/グループ枠を描画(既定は破線)。Shiftで正方形","tool.line":"線","tool.lineHint":"ドラッグで注釈線を描画。Shiftで45°に固定。矢印はパネルで設定","tool.table":"表","tool.tableHint":"ドラッグで列×行を指定(リアルタイム表示)、またはクリックで既定サイズの表を配置。セルはダブルクリックで入力","mode.selectWithSel":"要素をドラッグして移動 · 端子をドラッグして配線 · 右クリックでメニュー","mode.selectEmpty":"クリックで選択 · ドラッグで移動 · 範囲選択で複数選択 · 右クリックでメニュー","mode.pan":"キャンバスをドラッグ · スクロールでズーム · どのツールでもスペース長押しでパン","mode.wireDragging":"ピン/母線/接続点上で離す。空白部分で離すと接続点を新設","mode.wireInit":"任意の接続点または空白部分を押下し、目標にドラッグして離す","mode.busDragging":"ドラッグで母線の方向を決定。離すと終点を設定","mode.busInit":"キャンバスを押下して始点を設定し、ドラッグして終点で離す","mode.junction":"キャンバスをクリックして接続点を配置","mode.placeNoKind":"左側のライブラリから要素の種類を選択してください","mode.placeFromTerm":"目標位置で離すと、新しい要素が元の端子に接続されます","mode.placeNormal":"空白部分をクリックして配置。端子/母線からドラッグすると配置と同時に接続","mode.text":"クリックでテキストを配置 · ダブルクリックで編集 · 選択してドラッグで移動 · Delで削除","mode.rect":"ドラッグで矩形を描画 · Shiftで正方形 · 離した後にサイズ変更やラベル設定が可能","mode.line":"ドラッグで線を描画 · Shiftで45°に固定 · 離した後にパネルで矢印を追加","mode.table":"ドラッグでマス目を指定、またはクリックで3×3の表を配置 · セルはダブルクリックで入力","mode.annTextSel":"テキストをクリックして編集 · ドラッグで移動 · Delで削除","mode.annTableSel":"セルをクリックして入力 · ドラッグで移動 · Delで削除","mode.annShapeSel":"ドラッグで移動 · ハンドルをドラッグしてサイズ変更 · パネルでスタイルを変更 · Delで削除","mode.annEditing":"入力 · Enterで確定 · Escでキャンセル · または ✓ / ✕ ボタン","mode.escSelect":"Escで選択を解除","mode.escOther":"右クリック/Escでキャンセル","tool.placeNoKindTooltip":"左側のライブラリで種類を選択してから、キャンバスをクリック","tool.undo":"元に戻す","tool.undoHint":"直前の編集を元に戻す(移動/回転/削除など)","tool.redo":"やり直す","tool.redoHint":"元に戻した操作をやり直す","layout.label":"レイアウト","layout.hint":"図面全体または選択部分を自動レイアウトし、空きを埋める","layout.allAuto":"すべて自動レイアウト","layout.selAuto":"選択部分を自動レイアウト","layout.allFill":"未配置を埋める","layout.selFill":"選択部分の未配置を埋める","tool.more":"その他","tool.moreHint":"元に戻す/やり直す/レイアウト","view.menu":"表示","view.menuHint":"ズーム・全体表示・グリッド","ctx.ariaNode":"ノード操作","ctx.ariaWire":"配線操作","ctx.ariaElement":"要素操作","ctx.ariaEdit":"編集操作","ctx.done":"完了","ctx.cancel":"キャンセル","ctx.rotate":"90°回転","ctx.rotateHint":"選択部分を時計回りに回転。配線は新しい端子位置に合わせて再配線","ctx.mirror":"左右反転","ctx.mirrorTitle":"反転","ctx.mirrorHint":"選択部分を左右反転","ctx.delete":"削除","ctx.deleteHintNode":"このノードのすべての配線を切断(要素は残る)","ctx.deleteHintWire":"この配線のみを削除(同じノードの他の配線は残る)","ctx.deleteHintElement":"選択部分とその配線を削除","ctx.resetWirePath":"自動配線に戻す","ctx.resetWirePathHint":"手動で調整した折れ点を破棄し、自動ルーティングで再描画","menu.undo":"元に戻す","menu.redo":"やり直す","menu.cut":"切り取り","menu.copy":"コピー","menu.paste":"貼り付け","menu.rotate":"90°回転","menu.mirror":"反転","menu.selectAll":"すべて選択","menu.disconnect":"この配線を切断","menu.delete":"削除","io.parseFailed":"JSONの解析に失敗しました:{err}","io.notObject":"ファイルがJSONオブジェクトではありません","io.versionMismatch":'バージョン不一致:"1" が必要ですが、{actual} でした',"io.elementsMissing":"`elements` が存在しないか、配列ではありません","compile.duplicateId":'要素IDが重複しています:"{id}"',"compile.unknownKind":'不明な要素種別 kind="{kind}"',"compile.invalidTermRef":'無効な端子参照 "{ref}"',"compile.elementMissing":'存在しない要素への参照 "{id}"',"compile.missingPin":'要素 "{id}"(kind={kind})にピン "{pin}" がありません。使用可能:{available}',"compile.singleTerminal":"ノードに端子が1つしかないため無視されました","compile.layoutMissingElement":'layoutキー "{id}" が存在しない要素を参照しています',"compile.elementUnconnected":'要素 "{id}" に接続がありません',"cat.busbar":"母線/配線","cat.switching":"開閉器","cat.protection":"保護","cat.motor-control":"電動機制御","cat.transformer":"変圧器","cat.instrument-transformer":"計器用変成器","cat.measurement":"計測","cat.source":"電源","cat.load":"負荷","cat.storage":"蓄電","cat.compensation":"無効電力補償","cat.grounding":"接地","cat.renewable":"再生可能エネルギー/パワーエレクトロニクス","onboard.title":"クイックスタート","onboard.step1.title":"部品を配置","onboard.step1.body":"配置ツール(P)を選び、ライブラリから種類をキャンバスへドラッグ","onboard.step2.title":"配線する","onboard.step2.body":"配線ツール(W)を使用:ピンから別のピンへドラッグ。空白部分へドラッグすると接続点を新設","onboard.step3.title":"母線は共用レールであり、配線ではありません","onboard.step3.body":"複数の回路が1本のレールを共有する場合のみ母線ツール(B)を使用してください。2つの機器をつなぐために母線を使わないでください — 配線ツール(W)でピン同士を直接つないでください。","onboard.dismiss":"了解"},wS={"arc-suppression-coil.name":"消弧コイル","arrester.name":"避雷器 (FBL)","async-motor.name":"誘導電動機","autotransformer.name":"単巻変圧器","battery.name":"蓄電池","breaker.name":"遮断器 (QF)","busbar.name":"母線区間","converter-bidir.name":"双方向コンバータ (PCS)","dc-dc-converter.name":"DC/DCコンバータ","mppt.name":"MPPTコントローラ","ct.name":"変流器 (CT)","disconnector.name":"断路器 (QS)","earth.name":"接地","earthing-switch.name":"接地開閉器 (QE)","fuse.name":"ヒューズ (FU)","generator.name":"発電機 (G)","grid-source.name":"系統電源","grounding-transformer.name":"接地変圧器(ジグザグ結線)","inverter.name":"インバータ (DC→AC)","load-switch.name":"負荷開閉器","load.name":"負荷","luminaire.name":"照明器具(照明負荷)","panelboard.name":"分電盤","ngr.name":"中性点接地抵抗器 (NGR)","pt.name":"計器用変圧器 (PT)","pv.name":"太陽電池モジュール","rectifier.name":"整流器 (AC→DC)","series-reactor.name":"直列リアクトル","shunt-capacitor.name":"並列コンデンサ","shunt-reactor.name":"並列リアクトル","sync-motor.name":"同期電動機","transformer-2w.name":"二巻線変圧器","transformer-3w.name":"三巻線変圧器","wind-turbine.name":"風力発電機","gfci-breaker.name":"漏電遮断器 (RCBO)","rcd.name":"漏電遮断器 (RCD)","recloser.name":"リクローザ","energy-meter.name":"電力量計 (Wh)","voltmeter.name":"電圧計 (V)","ammeter.name":"電流計 (A)","wattmeter.name":"電力計 (W)","frequency-meter.name":"周波数計 (Hz)","contactor.name":"電磁接触器 (KM)","motor-starter.name":"電動機始動器","thermal-overload.name":"熱動過負荷継電器","vfd.name":"可変周波数ドライブ (VFD)","soft-starter.name":"ソフトスターター","transfer-switch.name":"自動切替開閉器 (ATS)","dc-disconnector.name":"直流断路器","dc-combiner.name":"直流接続箱","ev-charger.name":"EV充電器","arc-suppression-coil.desc":"共振接地方式:中性点と大地間にリアクトルを接続","busbar.desc":"複数の分岐に対応する伸縮可能な単一母線区間","converter-bidir.desc":"蓄電用コンバータ:双方向 AC ↔ DC 変換","dc-dc-converter.desc":"DC/DCコンバータ/直流充電器(IEC 60617)","mppt.desc":"MPPT太陽光充電コントローラ(DC/DC、最大電力点追従)","earthing-switch.desc":"断路器と接地接続を兼ねる単一ポート機器","grid-source.desc":"無限大母線/外部系統","grounding-transformer.desc":"中性点接地用のスター・ジグザグ結線変圧器","load.desc":"抽象負荷(電流流出方向の矢印)","luminaire.desc":"照明負荷(IEC 60617 照明器具一般図記号)","ngr.desc":"低抵抗接地:変圧器中性点と大地間に接続","series-reactor.desc":"並列リアクトルと同一記号。用途によって区別","wind-turbine.desc":"風力発電機:発電機と三枚羽根ローターの記号","gfci-breaker.desc":"過電流保護付き漏電遮断器(UL943 / IEC 61009)。北米ではGFCI、欧州ではRCBOと呼ばれる。","rcd.desc":"過電流保護なしの漏電遮断器(IEC 61008)。","recloser.desc":"中電圧用自動再閉路装置。","energy-meter.desc":"有効電力量計(kWh)— 引込口/子メーター用。","contactor.desc":"主回路用電磁接触器。通常、熱動過負荷継電器や電動機と組み合わせて使用。","motor-starter.desc":"電動機始動器(IEC 60617 一般記号)。","thermal-overload.desc":"電動機用熱動過負荷継電器。接触器と電動機の間に設置。","vfd.desc":"誘導電動機の速度制御用可変周波数ドライブ。","soft-starter.desc":"電動機用ソフトスターター(サイリスタによる低電圧始動方式)。","transfer-switch.desc":"二電源切替開閉器(自動/手動)。2つの電源入力と1つの負荷出力を持ち、機械的にインターロックされる。","dc-disconnector.desc":"直流断路器 — 太陽光ストリングや蓄電池の直流側を切り離す。","dc-combiner.desc":"太陽光ストリング用接続箱(4入力の例)。","ev-charger.desc":"電気自動車用充電ステーション。","breaker.state.open":"開","disconnector.state.open":"開","earthing-switch.state.open":"開","fuse.state.blown":"溶断","load-switch.state.open":"開","gfci-breaker.state.open":"開","rcd.state.open":"開","recloser.state.open":"開","contactor.state.open":"開","thermal-overload.state.tripped":"動作","transfer-switch.state.position":"位置(通常/非常用/オフ)","dc-disconnector.state.open":"開","battery.param.E":"容量","busbar.param.Un":"定格電圧","converter-bidir.param.S":"容量","dc-dc-converter.param.P":"電力","mppt.param.I":"定格電流","load.param.P":"有効電力","load.param.cosphi":"力率","ngr.param.R":"抵抗","shunt-capacitor.param.Q":"無効電力容量","shunt-capacitor.param.stages":"段数","transformer-2w.param.S":"容量","transformer-2w.param.ratio":"巻数比","gfci-breaker.param.In":"定格電流","panelboard.param.In":"定格電流","gfci-breaker.param.IDn":"定格感度電流","rcd.param.IDn":"定格感度電流","breaker.param.In":"定格電流","breaker.param.poles":"極数","breaker.param.Icu":"定格遮断容量","disconnector.param.In":"定格電流","fuse.param.In":"定格電流","resistor.name":"抵抗器 (R)","capacitor.name":"コンデンサ (C)","diode.name":"ダイオード (D)","indicator-light.name":"表示灯 (HL)","push-button.name":"押しボタンスイッチ (SB)","relay-coil.name":"リレーコイル (KA)","make-contact.name":"a接点 (NO)","break-contact.name":"b接点 (NC)","bell.name":"ベル (HA)","terminal.name":"端子台/接続点 (X)","fuse-switch-disconnector.name":"ヒューズ付断路器","socket-outlet.name":"コンセント/コネクタ","inductor.name":"インダクタ (L)","voltage-regulator.name":"電圧調整器 (T)","dc-motor.name":"直流電動機 (M)","heater.name":"発熱体 (EH)","selector-switch.name":"切替スイッチ (SA)","limit-switch.name":"リミットスイッチ (SQ)","proximity-switch.name":"近接スイッチ (SQ)","time-relay.name":"タイムリレー (KT)","buzzer.name":"ブザー (HA)","siren.name":"サイレン (HA)","thermocouple.name":"熱電対 (BT)","thyristor.name":"サイリスタ/SCR (V)","triac.name":"トライアック (V)","zener-diode.name":"ツェナーダイオード (D)","igbt.name":"IGBT","plc.name":"PLC/コントローラ","ups.name":"UPS","power-supply.name":"電源装置 (PS)","genset.name":"発電機セット (G)","protective-relay.name":"保護継電器","overcurrent-relay.name":"過電流継電器 (50/51)","undervoltage-relay.name":"不足電圧継電器 (27)","reverse-power-relay.name":"逆電力継電器 (32)","distance-relay.name":"距離継電器 (21)","phase-failure-relay.name":"欠相継電器","buchholz-relay.name":"ブッフホルツ継電器 (63)","power-factor-meter.name":"力率計 (cosφ)","synchronoscope.name":"同期検定器","varmeter.name":"無効電力計 (var)","resistor.desc":"汎用抵抗器/限流抵抗/制動抵抗。","capacitor.desc":"汎用/フィルタ/直流母線用コンデンサ。力率改善には並列コンデンサを使用。","diode.desc":"整流/還流/保護用ダイオード。t1 = アノード(上)、t2 = カソード(下)。","indicator-light.desc":"信号/状態表示灯。","push-button.desc":"手動押しボタン、自動復帰式(a接点)。","relay-coil.desc":"リレー/接触器の操作コイル(箱形記号)。","make-contact.desc":"常開補助接点(a接点)。","break-contact.desc":"常閉補助接点(b接点)。","bell.desc":"信号ベル/警報ベル。","terminal.desc":"端子台/接続箱/接続ノード。","fuse-switch-disconnector.desc":"負荷時開閉可能なヒューズ付断路器。","socket-outlet.desc":"電源コンセント/多極コネクタ。","inductor.desc":"汎用インダクタ/コイル/チョーク。","voltage-regulator.desc":"誘導形/単巻変圧器形の可変電圧調整器。","dc-motor.desc":"直流電動機(直巻界磁の一般記号)。","heater.desc":"抵抗発熱体/加熱負荷。","selector-switch.desc":"切替スイッチ(回転式、保持形)。","limit-switch.desc":"行程/位置スイッチ(a接点、機械操作式)。","proximity-switch.desc":"近接センサー/非接触式近接スイッチ。","time-relay.desc":"限時(動作遅延)リレーコイル。","buzzer.desc":"信号ブザー。","siren.desc":"音響サイレン/警報器。","thermocouple.desc":"熱電対温度センサー。","thyristor.desc":"逆阻止三端子サイリスタ/SCR。t1 = アノード(上)、t2 = カソード(下)。","triac.desc":"双方向三端子サイリスタ(トライアック)。","zener-diode.desc":"ツェナー/定電圧ダイオード。t1 = アノード(上)、t2 = カソード(下)。","igbt.desc":"Nチャネルエンハンスメント形IGBT。t1 = コレクタ(上)、t2 = エミッタ(下)、t_g = ゲート。","plc.desc":"プログラマブルロジックコントローラ(PLC)。","ups.desc":"オンライン/常時商用給電式無停電電源装置。","power-supply.desc":"AC→DCスイッチング/直流電源装置。t_ac は上(~)、t_dc は下(=)。","genset.desc":"ディーゼル/ガス発電機セット。","protective-relay.desc":"計測/保護継電器の一般記号(IEC 60617)。","overcurrent-relay.desc":"過電流保護継電器(ANSI 50/51)。","undervoltage-relay.desc":"不足電圧保護継電器(ANSI 27)。","reverse-power-relay.desc":"逆電力/逆電流保護継電器(ANSI 32)。","distance-relay.desc":"距離/低インピーダンス保護継電器(ANSI 21)。","phase-failure-relay.desc":"欠相保護継電器。","buchholz-relay.desc":"ブッフホルツ/ガス継電器(ANSI 63)。","power-factor-meter.desc":"力率計(cosφ)。","synchronoscope.desc":"同期検定器/同期指示計。","varmeter.desc":"無効電力計(var)。","make-contact.state.closed":"閉","break-contact.state.open":"開","fuse-switch-disconnector.state.open":"開","selector-switch.state.open":"開","limit-switch.state.closed":"閉","resistor.param.R":"抵抗","resistor.param.P":"定格電力","capacitor.param.C":"静電容量","capacitor.param.Un":"定格電圧","indicator-light.param.color":"色","inductor.param.L":"インダクタンス","inductor.param.In":"定格電流","voltage-regulator.param.ratio":"調整範囲","heater.param.P":"電力","ups.param.S":"容量","power-supply.param.Vdc":"出力電圧","genset.param.P":"電力"},vS={ui:xS,library:wS},kS={"common.unnamed":"Без имени","common.close":"Закрыть","common.yes":"Да","common.no":"Нет","topbar.theme.toLight":"Переключить на светлую","topbar.theme.toDark":"Переключить на тёмную","topbar.theme.currentDark":"Текущая: тёмная тема","topbar.theme.currentLight":"Текущая: светлая тема","topbar.lang.toEnglish":"Переключить на английский","topbar.lang.toChinese":"Переключить на китайский","topbar.lang.currentEnglish":"Текущий: английский","topbar.lang.currentChinese":"Текущий: китайский","topbar.export.label":"Экспорт","topbar.export.tooltip":"Векторный SVG (редактируемый), растровый PNG (2× HiDPI) или DXF (для CAD)","topbar.export.pngFailed":"Не удалось экспортировать PNG: {err}","topbar.export.dxfFailed":"Не удалось экспортировать DXF: {err}","topbar.file.label":"Файл","topbar.file.tooltip":"Открыть локальную схему .json, сохранить или сохранить как","topbar.file.current":"Текущий: {name}","topbar.file.new":"Новый","topbar.file.open":"Открыть…","topbar.file.save":"Сохранить","topbar.file.saveAs":"Сохранить как…","topbar.file.newConfirm":"Создание нового файла отменит все несохранённые изменения. Продолжить?","topbar.file.openFailed":"Не удалось открыть: {err}","topbar.file.saveFailed":"Не удалось сохранить: {err}","topbar.file.fileDescription":"Схема OneLineEditor","outline.title":"Структура","outline.collapse":"Свернуть","outline.collapseAria":"Свернуть структуру","outline.empty":"(Нет элементов — перетащите из библиотеки, чтобы начать)","props.title":"Свойства","props.node":"Электрический узел","props.wire":"Провод","props.bus":"Шина","props.junction":"Соединение","props.junctionPos":"Положение","props.nSelected":"Выбрано: {n}","props.empty":"Ничего не выбрано","props.multi":"Выбрано объектов: {n}","props.name":"Название","props.note":"Заметка","props.label":"Метка","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Электрический узел {id} не найден","props.wireNotFound":"Провод {id} не найден","props.nodeStats":"{terminals} выводов · {elements} элементов","props.selectElement":"Выбрать {label}","props.selectWholeNode":"Выбрать весь электрический узел","props.annText":"Текст","props.annRect":"Прямоугольник","props.annLine":"Линия","props.annTable":"Таблица","props.annNotFound":"Аннотация {id} не найдена","props.annLabel":"Подпись","props.annLabelPlaceholder":"например, Щит №1","props.annStroke":"Обводка","props.annStrokeSolid":"Сплошная","props.annStrokeDashed":"Пунктирная","props.annFill":"Заливка","props.annFillNone":"Нет","props.annFillTint":"Оттенок","props.annArrow":"Стрелки","props.annArrowNone":"Нет","props.annArrowEnd":"В конце","props.annArrowBoth":"С двух сторон","props.annFontSize":"Размер шрифта","props.annRows":"Строки","props.annCols":"Столбцы","view.zoomOut":"Уменьшить","view.zoomOutHint":"Уменьшение на шаг; также колесо ↓ или ⌘−","view.reset":"Сбросить на 100%","view.current":"Текущий масштаб {z}%","view.zoomIn":"Увеличить","view.zoomInHint":"Увеличение на шаг; также колесо ↑ или ⌘+","view.fit":"Вписать в экран","view.fitHint":"Автоматически масштабировать и центрировать все элементы","view.gridHide":"Скрыть сетку","view.gridShow":"Показать сетку","view.gridHotkey":"G","view.gridHideHint":"Также отключает привязку к сетке (свободное размещение)","view.gridShowHint":"Также включает привязку к сетке (шаг 10 px при перетаскивании)","view.gridHideAria":"Скрыть сетку и отключить привязку","view.gridShowAria":"Показать сетку и включить привязку","view.label":"Подписи","view.labelOff":"Выкл","view.labelId":"ID","view.labelAll":"ID + параметры","view.labelHint":"Видимость и размер подписей (в том числе при экспорте)","view.labelSize":"Размер","view.labelSizeSmaller":"Уменьшить размер подписей","view.labelSizeLarger":"Увеличить размер подписей","view.labelSizeReset":"Сбросить размер подписей","library.title":"Библиотека","library.empty":"Нет подходящих элементов","library.searchPlaceholder":"Поиск элементов…","library.searchAria":"Поиск элементов","library.clearSearch":"Очистить поиск","library.itemHint":"Нажмите, чтобы включить режим размещения, или перетащите на холст","tool.select":"Выбор","tool.selectHint":"Клик — выбрать один, рамка — несколько, правая кнопка — меню","tool.pan":"Рука","tool.panHint":"Перетаскивайте холст; пробел временно переключает инструмент","tool.wire":"Провод","tool.wireHint":"Тяните от вывода / шины / точки соединения; в пустое место — создаст точку соединения, на провод — врежется в него","tool.bus":"Шина","tool.busHint":"Тяните по холсту — нажатие задаёт начало, отпускание — конец","tool.junction":"Соединение","tool.junctionHint":"Нажмите на холст, чтобы поставить точку соединения (узел); провода свободно подключаются к ней","tool.place":"Элемент","tool.placeHint":"Нажмите, чтобы разместить; или перетащите от вывода / шины, чтобы разместить и подключить","tool.text":"Текст","tool.textHint":"Нажмите на холст, чтобы добавить текстовую заметку; дважды щёлкните существующую, чтобы изменить","tool.rect":"Прямоугольник","tool.rectHint":"Перетащите, чтобы нарисовать прямоугольник / рамку группы (по умолчанию пунктирную); Shift — квадрат","tool.line":"Линия","tool.lineHint":"Перетащите, чтобы нарисовать линию-аннотацию; Shift — привязка к 45°; стрелки настраиваются в панели","tool.table":"Таблица","tool.tableHint":"Перетащите, чтобы задать столбцы × строки (счётчик в реальном времени), или нажмите для таблицы по умолчанию; дважды щёлкните ячейку, чтобы ввести текст","mode.selectWithSel":"Перетаскивайте элементы · тяните от вывода, чтобы провести провод · правая кнопка — меню","mode.selectEmpty":"Клик — выбрать · перетаскивание — переместить · рамка — несколько · правая кнопка — меню","mode.pan":"Перетаскивайте холст · колесо — масштаб · удерживайте пробел для панорамирования в любом инструменте","mode.wireDragging":"Отпустите на выводе / шине / точке соединения; отпускание в пустом месте создаст точку соединения","mode.wireInit":"Нажмите на любой точке подключения или в пустом месте, перетащите к цели и отпустите","mode.busDragging":"Перетаскивание задаёт направление шины; отпускание — конец","mode.busInit":"Нажмите на холст, чтобы задать начало, тяните и отпустите, чтобы задать конец","mode.junction":"Нажмите на холст, чтобы поставить точку соединения","mode.placeNoKind":"Выберите тип элемента в библиотеке слева","mode.placeFromTerm":"Отпустите у цели — новый элемент подключится к исходному выводу","mode.placeNormal":"Нажмите в пустом месте, чтобы разместить; или перетащите от вывода / шины, чтобы разместить и подключить","mode.text":"Нажмите, чтобы добавить текст · двойной клик — редактировать · перетаскивание выбранного — переместить · Del — удалить","mode.rect":"Перетащите, чтобы нарисовать прямоугольник · Shift — квадрат · после отпускания измените размер и подпись","mode.line":"Перетащите, чтобы нарисовать линию · Shift — привязка к 45° · стрелки добавьте в панели после отпускания","mode.table":"Перетащите, чтобы задать сетку, или нажмите для таблицы 3×3 · дважды щёлкните ячейку, чтобы ввести текст","mode.annTextSel":"Нажмите на текст, чтобы редактировать · перетащите, чтобы переместить · Del — удалить","mode.annTableSel":"Нажмите на ячейку, чтобы заполнить её · перетащите, чтобы переместить · Del — удалить","mode.annShapeSel":"Перетащите, чтобы переместить · тяните за маркеры, чтобы изменить размер · стиль — в панели · Del — удалить","mode.annEditing":"Введите текст · Enter — подтвердить · Esc — отмена · или кнопки ✓ / ✕","mode.escSelect":"Esc — снять выделение","mode.escOther":"Правая кнопка / Esc — отмена","tool.placeNoKindTooltip":"Выберите тип в библиотеке слева, затем нажмите на холст","tool.undo":"Отменить","tool.undoHint":"Отменить последнее действие (перемещение / поворот / удаление и т. д.)","tool.redo":"Повторить","tool.redoHint":"Повторить последнее отменённое действие","layout.label":"Компоновка","layout.hint":"Автоматически расставить всю схему или только выделенное, заполнить пропуски","layout.allAuto":"Автокомпоновка всей схемы","layout.selAuto":"Автокомпоновка выделенного","layout.allFill":"Расставить неразмещённые","layout.selFill":"Расставить неразмещённые в выделении","tool.more":"Ещё","tool.moreHint":"Отмена / повтор / компоновка","view.menu":"Вид","view.menuHint":"Масштаб, вписать, сетка","ctx.ariaNode":"Действия с узлом","ctx.ariaWire":"Действия с проводом","ctx.ariaElement":"Действия с элементом","ctx.ariaEdit":"Действия редактирования","ctx.done":"Готово","ctx.cancel":"Отмена","ctx.rotate":"Повернуть на 90°","ctx.rotateHint":"Повернуть выделенное по часовой стрелке; провода перестроятся через новые выводы","ctx.mirror":"Зеркально по горизонтали","ctx.mirrorTitle":"Зеркало","ctx.mirrorHint":"Отразить выделенное слева направо","ctx.delete":"Удалить","ctx.deleteHintNode":"Отключить все провода этого узла (элементы останутся)","ctx.deleteHintWire":"Удалить только этот провод (остальные провода узла останутся)","ctx.deleteHintElement":"Удалить выделенное и его провода","ctx.resetWirePath":"Сбросить на автотрассировку","ctx.resetWirePathHint":"Убрать вручную заданные изгибы и позволить перерисовать провод автоматически","menu.undo":"Отменить","menu.redo":"Повторить","menu.cut":"Вырезать","menu.copy":"Копировать","menu.paste":"Вставить","menu.rotate":"Повернуть на 90°","menu.mirror":"Зеркально","menu.selectAll":"Выбрать всё","menu.disconnect":"Отключить этот провод","menu.delete":"Удалить","io.parseFailed":"Ошибка разбора JSON: {err}","io.notObject":"Файл не является объектом JSON","io.versionMismatch":'Несовпадение версии: ожидалась "1", получено {actual}',"io.elementsMissing":"Поле `elements` отсутствует или не является массивом","compile.duplicateId":'Повторяющийся ID элемента: "{id}"',"compile.unknownKind":'Неизвестный тип элемента kind="{kind}"',"compile.invalidTermRef":'Некорректная ссылка на вывод "{ref}"',"compile.elementMissing":'Ссылка на несуществующий элемент "{id}"',"compile.missingPin":'У элемента "{id}" (kind={kind}) нет вывода "{pin}"; доступны: {available}',"compile.singleTerminal":"Узел содержит только один вывод — проигнорирован","compile.layoutMissingElement":'Ключ layout "{id}" ссылается на несуществующий элемент',"compile.elementUnconnected":'Элемент "{id}" не имеет подключений',"cat.busbar":"Шины / проводка","cat.switching":"Коммутация","cat.protection":"Защита","cat.motor-control":"Управление двигателем","cat.transformer":"Трансформаторы","cat.instrument-transformer":"Измерительные трансформаторы","cat.measurement":"Измерения","cat.source":"Источники","cat.load":"Нагрузка","cat.storage":"Накопители","cat.compensation":"Компенсация","cat.grounding":"Заземление","cat.renewable":"Возобновляемая энергетика / силовая электроника","onboard.title":"Быстрый старт","onboard.step1.title":"Разместите элемент","onboard.step1.body":"Выберите инструмент «Элемент» (P) и перетащите элемент из библиотеки на холст","onboard.step2.title":"Соедините проводом","onboard.step2.body":"Используйте инструмент «Провод» (W): тяните от одного вывода к другому — перетаскивание в пустое место создаст точку соединения","onboard.step3.title":"Шина — это общая линия, а не провод","onboard.step3.body":"Используйте инструмент «Шина» (B), только если несколько цепей используют одну общую линию. Не используйте шину для соединения двух устройств — просто соедините выводы проводом (W).","onboard.dismiss":"Понятно"},SS={"arc-suppression-coil.name":"Дугогасящая катушка","arrester.name":"Разрядник (FBL)","async-motor.name":"Асинхронный двигатель","autotransformer.name":"Автотрансформатор","battery.name":"Аккумуляторная батарея (накопитель)","breaker.name":"Автоматический выключатель (QF)","busbar.name":"Секция шины","converter-bidir.name":"Двунаправленный преобразователь (PCS)","dc-dc-converter.name":"Преобразователь DC/DC","mppt.name":"Контроллер MPPT","ct.name":"Трансформатор тока (CT)","disconnector.name":"Разъединитель (QS)","earth.name":"Земля","earthing-switch.name":"Заземляющий разъединитель (QE)","fuse.name":"Предохранитель (FU)","generator.name":"Генератор (G)","grid-source.name":"Источник от энергосистемы","grounding-transformer.name":"Заземляющий трансформатор (зигзаг)","inverter.name":"Инвертор (DC→AC)","load-switch.name":"Выключатель нагрузки","load.name":"Нагрузка","luminaire.name":"Светильник (осветительная нагрузка)","panelboard.name":"Распределительный щит","ngr.name":"Резистор заземления нейтрали (NGR)","pt.name":"Трансформатор напряжения (PT)","pv.name":"Фотоэлектрический модуль","rectifier.name":"Выпрямитель (AC→DC)","series-reactor.name":"Последовательный реактор","shunt-capacitor.name":"Шунтирующий конденсатор","shunt-reactor.name":"Шунтирующий реактор","sync-motor.name":"Синхронный двигатель","transformer-2w.name":"Двухобмоточный трансформатор","transformer-3w.name":"Трёхобмоточный трансформатор","wind-turbine.name":"Ветрогенератор","gfci-breaker.name":"Дифференциальный автомат (RCBO)","rcd.name":"Устройство защитного отключения (RCD)","recloser.name":"Реклоузер","energy-meter.name":"Счётчик электроэнергии (Wh)","voltmeter.name":"Вольтметр (V)","ammeter.name":"Амперметр (A)","wattmeter.name":"Ваттметр (W)","frequency-meter.name":"Частотомер (Hz)","contactor.name":"Контактор (KM)","motor-starter.name":"Магнитный пускатель","thermal-overload.name":"Тепловое реле перегрузки","vfd.name":"Частотный преобразователь (VFD)","soft-starter.name":"Устройство плавного пуска","transfer-switch.name":"Устройство АВР (ATS)","dc-disconnector.name":"Разъединитель постоянного тока","dc-combiner.name":"Объединительная коробка постоянного тока","ev-charger.name":"Зарядная станция для электромобилей","arc-suppression-coil.desc":"Резонансное заземление нейтрали: катушка индуктивности на землю","busbar.desc":"Растягиваемая секция одиночной шины с несколькими отводами","converter-bidir.desc":"Преобразователь для накопителя: двунаправленный AC ↔ DC","dc-dc-converter.desc":"Преобразователь DC/DC / зарядное устройство постоянного тока (IEC 60617)","mppt.desc":"Солнечный контроллер заряда MPPT (DC/DC, отслеживание точки максимальной мощности)","earthing-switch.desc":"Разъединитель + соединение с землёй, один порт","grid-source.desc":"Шина бесконечной мощности / внешняя энергосистема","grounding-transformer.desc":"Трансформатор со схемой звезда-зигзаг для заземления нейтрали","load.desc":"Абстрактная нагрузка (стрелка исходящего тока)","luminaire.desc":"Осветительная нагрузка (общий символ светильника МЭК 60617)","ngr.desc":"Заземление через малое сопротивление: нейтраль трансформатора на землю","series-reactor.desc":"То же обозначение, что и у шунтирующего реактора; различаются по способу применения","wind-turbine.desc":"Ветрогенератор: генератор + значок трёхлопастного ротора","gfci-breaker.desc":"Дифференциальный автомат со встроенной защитой от сверхтока (UL943 / IEC 61009). В США — GFCI, в Европе — RCBO.","rcd.desc":"Устройство защитного отключения без защиты от сверхтока (IEC 61008).","recloser.desc":"Автоматический реклоузер среднего напряжения.","energy-meter.desc":"Счётчик активной энергии (кВт·ч) — на вводе / субсчётчик.","contactor.desc":"Контактор главной цепи; обычно используется совместно с тепловым реле и двигателем.","motor-starter.desc":"Пускатель двигателя (общее обозначение по IEC 60617).","thermal-overload.desc":"Тепловое реле перегрузки двигателя; устанавливается между контактором и двигателем.","vfd.desc":"Частотный преобразователь для регулирования скорости асинхронного двигателя.","soft-starter.desc":"Устройство плавного пуска двигателя (тиристорный пуск при пониженном напряжении).","transfer-switch.desc":"Переключатель между двумя источниками (АВР / ручной). Два входа источников + один выход нагрузки, механически сблокированы.","dc-disconnector.desc":"Разъединитель постоянного тока — изоляция стороны DC солнечной цепочки / батареи.","dc-combiner.desc":"Объединительная коробка солнечных цепочек (пример на 4 входа).","ev-charger.desc":"Зарядная станция для электромобилей.","breaker.state.open":"Разомкнут","disconnector.state.open":"Разомкнут","earthing-switch.state.open":"Разомкнут","fuse.state.blown":"Перегорел","load-switch.state.open":"Разомкнут","gfci-breaker.state.open":"Разомкнут","rcd.state.open":"Разомкнут","recloser.state.open":"Разомкнут","contactor.state.open":"Разомкнут","thermal-overload.state.tripped":"Сработало","transfer-switch.state.position":"Положение (нормальное/аварийное/откл.)","dc-disconnector.state.open":"Разомкнут","battery.param.E":"Ёмкость","busbar.param.Un":"Номинальное напряжение","converter-bidir.param.S":"Мощность","dc-dc-converter.param.P":"Мощность","mppt.param.I":"Номинальный ток","load.param.P":"Активная мощность","load.param.cosphi":"Коэффициент мощности","ngr.param.R":"Сопротивление","shunt-capacitor.param.Q":"Реактивная мощность","shunt-capacitor.param.stages":"Ступени","transformer-2w.param.S":"Мощность","transformer-2w.param.ratio":"Коэффициент трансформации","gfci-breaker.param.In":"Номинальный ток","panelboard.param.In":"Номинальный ток","gfci-breaker.param.IDn":"Номинальный отключающий дифференциальный ток","rcd.param.IDn":"Номинальный отключающий дифференциальный ток","breaker.param.In":"Номинальный ток","breaker.param.poles":"Число полюсов","breaker.param.Icu":"Отключающая способность","disconnector.param.In":"Номинальный ток","fuse.param.In":"Номинальный ток","resistor.name":"Резистор (R)","capacitor.name":"Конденсатор (C)","diode.name":"Диод (D)","indicator-light.name":"Сигнальная лампа (HL)","push-button.name":"Кнопка (SB)","relay-coil.name":"Катушка реле (KA)","make-contact.name":"Замыкающий контакт (NO)","break-contact.name":"Размыкающий контакт (NC)","bell.name":"Звонок (HA)","terminal.name":"Клемма / соединение (X)","fuse-switch-disconnector.name":"Предохранитель-разъединитель","socket-outlet.name":"Розетка / разъём","inductor.name":"Катушка индуктивности (L)","voltage-regulator.name":"Регулятор напряжения (T)","dc-motor.name":"Двигатель постоянного тока (M)","heater.name":"Нагревательный элемент (EH)","selector-switch.name":"Переключатель (SA)","limit-switch.name":"Концевой выключатель (SQ)","proximity-switch.name":"Бесконтактный выключатель (SQ)","time-relay.name":"Реле времени (KT)","buzzer.name":"Зуммер (HA)","siren.name":"Сирена (HA)","thermocouple.name":"Термопара (BT)","thyristor.name":"Тиристор / SCR (V)","triac.name":"Симистор (V)","zener-diode.name":"Стабилитрон (D)","igbt.name":"IGBT","plc.name":"ПЛК / контроллер","ups.name":"ИБП (UPS)","power-supply.name":"Источник питания (PS)","genset.name":"Генераторная установка (G)","protective-relay.name":"Защитное реле","overcurrent-relay.name":"Реле максимального тока (50/51)","undervoltage-relay.name":"Реле минимального напряжения (27)","reverse-power-relay.name":"Реле обратной мощности (32)","distance-relay.name":"Дистанционное реле (21)","phase-failure-relay.name":"Реле обрыва фазы","buchholz-relay.name":"Реле Бухгольца (63)","power-factor-meter.name":"Измеритель коэффициента мощности (cosφ)","synchronoscope.name":"Синхроноскоп","varmeter.name":"Варметр (var)","resistor.desc":"Общий резистор / токоограничивающий / тормозной резистор.","capacitor.desc":"Общий / фильтрующий конденсатор / конденсатор шины DC. Для компенсации коэффициента мощности используйте шунтирующий конденсатор.","diode.desc":"Выпрямительный / обратный / защитный диод. t1 = анод (сверху), t2 = катод (снизу).","indicator-light.desc":"Сигнальная лампа состояния.","push-button.desc":"Кнопка ручного управления с автоматическим возвратом (замыкающий контакт NO).","relay-coil.desc":"Катушка управления реле / контактора (обозначение — прямоугольник).","make-contact.desc":"Нормально разомкнутый вспомогательный контакт (замыкающий).","break-contact.desc":"Нормально замкнутый вспомогательный контакт (размыкающий).","bell.desc":"Сигнальный звонок / звонок тревоги.","terminal.desc":"Клемма / клеммная коробка / узел соединения.","fuse-switch-disconnector.desc":"Предохранитель-разъединитель, коммутируемый под нагрузкой.","socket-outlet.desc":"Силовая розетка / многополюсный разъём.","inductor.desc":"Общая катушка индуктивности / дроссель.","voltage-regulator.desc":"Регулируемый индукционный регулятор напряжения / автотрансформаторный регулятор.","dc-motor.desc":"Двигатель постоянного тока (общее обозначение с последовательным возбуждением).","heater.desc":"Резистивный нагревательный элемент / тепловая нагрузка.","selector-switch.desc":"Избирательный переключатель (поворотный, с фиксацией положений).","limit-switch.desc":"Концевой выключатель положения (NO, механическое воздействие).","proximity-switch.desc":"Датчик приближения / бесконтактный выключатель.","time-relay.desc":"Катушка реле времени (с задержкой срабатывания).","buzzer.desc":"Сигнальный зуммер.","siren.desc":"Звуковая сирена / сигнализация.","thermocouple.desc":"Термопарный датчик температуры.","thyristor.desc":"Тиристор с обратной блокировкой (SCR). t1 = анод (сверху), t2 = катод (снизу).","triac.desc":"Двунаправленный триодный тиристор (симистор).","zener-diode.desc":"Стабилитрон / регулирующий диод. t1 = анод (сверху), t2 = катод (снизу).","igbt.desc":"IGBT-транзистор с N-каналом обогащённого типа. t1 = коллектор (сверху), t2 = эмиттер (снизу), t_g = затвор.","plc.desc":"Программируемый логический контроллер (ПЛК).","ups.desc":"Источник бесперебойного питания (онлайн / резервный).","power-supply.desc":"Импульсный источник питания AC→DC / источник постоянного тока. t_ac сверху (~), t_dc снизу (=).","genset.desc":"Дизельная / газовая генераторная установка.","protective-relay.desc":"Измерительное / защитное реле, общее обозначение (IEC 60617).","overcurrent-relay.desc":"Реле максимальной токовой защиты (ANSI 50/51).","undervoltage-relay.desc":"Реле защиты минимального напряжения (ANSI 27).","reverse-power-relay.desc":"Реле защиты от обратной мощности / обратного тока (ANSI 32).","distance-relay.desc":"Дистанционное реле защиты по сопротивлению (ANSI 21).","phase-failure-relay.desc":"Реле защиты от обрыва / потери фазы.","buchholz-relay.desc":"Газовое реле Бухгольца (ANSI 63).","power-factor-meter.desc":"Измеритель коэффициента мощности (cosφ).","synchronoscope.desc":"Индикатор синхронизации / синхроноскоп.","varmeter.desc":"Измеритель реактивной мощности (var).","make-contact.state.closed":"Замкнут","break-contact.state.open":"Разомкнут","fuse-switch-disconnector.state.open":"Разомкнут","selector-switch.state.open":"Разомкнут","limit-switch.state.closed":"Замкнут","resistor.param.R":"Сопротивление","resistor.param.P":"Номинальная мощность","capacitor.param.C":"Ёмкость","capacitor.param.Un":"Номинальное напряжение","indicator-light.param.color":"Цвет","inductor.param.L":"Индуктивность","inductor.param.In":"Номинальный ток","voltage-regulator.param.ratio":"Диапазон регулирования","heater.param.P":"Мощность","ups.param.S":"Мощность","power-supply.param.Vdc":"Выходное напряжение","genset.param.P":"Мощность"},_S={ui:kS,library:SS},CS={"common.unnamed":"بدون عنوان","common.close":"بستن","common.yes":"بله","common.no":"خیر","topbar.theme.toLight":"تغییر به حالت روشن","topbar.theme.toDark":"تغییر به حالت تیره","topbar.theme.currentDark":"فعلی: پوسته تیره","topbar.theme.currentLight":"فعلی: پوسته روشن","topbar.lang.toEnglish":"تغییر به انگلیسی","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"فعلی: انگلیسی","topbar.lang.currentChinese":"فعلی: چینی","topbar.export.label":"خروجی","topbar.export.tooltip":"وکتور SVG (قابل ویرایش)، تصویر PNG (2× کیفیت بالا) یا DXF (CAD)","topbar.export.pngFailed":"خروجی PNG ناموفق بود: {err}","topbar.export.dxfFailed":"خروجی DXF ناموفق بود: {err}","topbar.file.label":"فایل","topbar.file.tooltip":"باز کردن یک نمودار .json محلی، ذخیره، یا ذخیره با نام دیگر","topbar.file.current":"فعلی: {name}","topbar.file.new":"جدید","topbar.file.open":"باز کردن…","topbar.file.save":"ذخیره","topbar.file.saveAs":"ذخیره با نام دیگر…","topbar.file.newConfirm":"ایجاد فایل جدید تغییرات ذخیره‌نشده را از بین می‌برد. ادامه می‌دهید؟","topbar.file.openFailed":"باز کردن ناموفق بود: {err}","topbar.file.saveFailed":"ذخیره ناموفق بود: {err}","topbar.file.fileDescription":"نمودار OneLineEditor","outline.title":"طرح کلی","outline.collapse":"جمع کردن","outline.collapseAria":"جمع کردن طرح کلی","outline.empty":"(هیچ عنصری نیست — برای شروع از کتابخانه بکشید)","props.title":"ویژگی‌ها","props.node":"گره الکتریکی","props.wire":"سیم","props.bus":"شینه","props.junction":"نقطه اتصال","props.junctionPos":"موقعیت","props.nSelected":"{n} مورد انتخاب‌شده","props.empty":"چیزی انتخاب نشده","props.multi":"{n} مورد انتخاب شده","props.name":"نام","props.note":"یادداشت","props.label":"برچسب","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"گره الکتریکی {id} یافت نشد","props.wireNotFound":"سیم {id} یافت نشد","props.nodeStats":"{terminals} ترمینال · {elements} عنصر","props.selectElement":"انتخاب {label}","props.selectWholeNode":"انتخاب کل گره الکتریکی","props.annText":"متن","props.annRect":"مستطیل","props.annLine":"خط","props.annTable":"جدول","props.annNotFound":"حاشیه‌نویسی {id} یافت نشد","props.annLabel":"برچسب","props.annLabelPlaceholder":"مثلاً: تابلو شماره 1","props.annStroke":"نوع خط","props.annStrokeSolid":"ممتد","props.annStrokeDashed":"خط‌چین","props.annFill":"پرکردن","props.annFillNone":"هیچ","props.annFillTint":"ته‌رنگ","props.annArrow":"پیکان‌ها","props.annArrowNone":"هیچ‌کدام","props.annArrowEnd":"انتها","props.annArrowBoth":"دوطرفه","props.annFontSize":"اندازه فونت","props.annRows":"ردیف‌ها","props.annCols":"ستون‌ها","view.zoomOut":"کوچک‌نمایی","view.zoomOutHint":"کوچک‌نمایی پله‌ای؛ همچنین چرخ ماوس ↓ یا ⌘−","view.reset":"بازنشانی به 100%","view.current":"فعلی {z}%","view.zoomIn":"بزرگ‌نمایی","view.zoomInHint":"بزرگ‌نمایی پله‌ای؛ همچنین چرخ ماوس ↑ یا ⌘+","view.fit":"تنظیم نما","view.fitHint":"بزرگ‌نمایی خودکار و وسط‌چین کردن همه عناصر","view.gridHide":"پنهان کردن شبکه","view.gridShow":"نمایش شبکه","view.gridHotkey":"G","view.gridHideHint":"چسبیدن به شبکه را نیز غیرفعال می‌کند (جای‌گذاری آزاد)","view.gridShowHint":"چسبیدن به شبکه را نیز فعال می‌کند (چسبیدن به 10 پیکسل هنگام کشیدن)","view.gridHideAria":"پنهان کردن شبکه و غیرفعال کردن چسبیدن","view.gridShowAria":"نمایش شبکه و فعال کردن چسبیدن","view.label":"برچسب‌ها","view.labelOff":"خاموش","view.labelId":"شناسه","view.labelAll":"شناسه + پارامترها","view.labelHint":"نمایش و اندازهٔ برچسب‌ها (در خروجی هم اعمال می‌شود)","view.labelSize":"اندازه","view.labelSizeSmaller":"کوچک‌کردن برچسب‌ها","view.labelSizeLarger":"بزرگ‌کردن برچسب‌ها","view.labelSizeReset":"بازنشانی اندازهٔ برچسب‌ها","library.title":"کتابخانه","library.empty":"عنصر منطبقی یافت نشد","library.searchPlaceholder":"جستجوی عناصر…","library.searchAria":"جستجوی عناصر","library.clearSearch":"پاک کردن جستجو","library.itemHint":"کلیک کنید تا وارد حالت قرارگیری شوید، یا به بوم بکشید","tool.select":"انتخاب","tool.selectHint":"برای انتخاب کلیک کنید، برای چند مورد کادر بکشید، برای منو راست‌کلیک کنید","tool.pan":"جابجایی","tool.panHint":"بوم را بکشید؛ کلید Space به‌طور موقت این حالت را فعال می‌کند","tool.wire":"سیم‌کشی","tool.wireHint":"از یک پایه/شینه/نقطه اتصال بکشید؛ رها کردن در فضای خالی یک نقطه اتصال می‌سازد، رها کردن روی یک سیم به آن متصل می‌شود","tool.bus":"شینه","tool.busHint":"روی بوم بکشید — با فشردن نقطه شروع و با رها کردن نقطه پایان تعیین می‌شود","tool.junction":"نقطه اتصال","tool.junctionHint":"برای قرار دادن یک نقطه اتصال (گره) روی بوم کلیک کنید؛ سیم‌ها آزادانه به آن متصل می‌شوند","tool.place":"قرار دادن","tool.placeHint":"برای قرار دادن کلیک کنید؛ یا از یک ترمینال/شینه بکشید تا هم‌زمان قرار داده و متصل شود","tool.text":"متن","tool.textHint":"برای قرار دادن یادداشت متنی روی بوم کلیک کنید؛ برای ویرایش یک مورد موجود دوبار کلیک کنید","tool.rect":"مستطیل","tool.rectHint":"برای رسم یک مستطیل / قاب گروه بکشید (به‌طور پیش‌فرض خط‌چین)؛ Shift برای مربع","tool.line":"خط","tool.lineHint":"برای رسم یک خط حاشیه‌نویسی بکشید؛ Shift به 45° می‌چسبد؛ پیکان‌ها در پنل تنظیم می‌شوند","tool.table":"جدول","tool.tableHint":"برای تعیین ستون × ردیف بکشید (شمارش زنده)، یا برای جدول پیش‌فرض کلیک کنید؛ برای تایپ در سلول‌ها دوبار کلیک کنید","mode.selectWithSel":"عناصر را بکشید · ترمینال‌ها را برای سیم‌کشی بکشید · برای منو راست‌کلیک کنید","mode.selectEmpty":"برای انتخاب کلیک کنید · برای جابجایی بکشید · برای چند مورد کادر بکشید · برای منو راست‌کلیک کنید","mode.pan":"بوم را بکشید · برای بزرگ‌نمایی اسکرول کنید · برای جابجایی در هر ابزاری Space را نگه دارید","mode.wireDragging":"روی یک پایه/شینه/نقطه اتصال رها کنید؛ رها کردن در فضای خالی یک نقطه اتصال می‌سازد","mode.wireInit":"روی هر نقطه اتصال یا فضای خالی فشار دهید، به سمت مقصد بکشید و رها کنید","mode.busDragging":"کشیدن جهت شینه را تعیین می‌کند؛ رها کردن پایان را مشخص می‌کند","mode.busInit":"برای تعیین شروع روی بوم فشار دهید، بکشید، برای پایان رها کنید","mode.junction":"برای قرار دادن یک نقطه اتصال روی بوم کلیک کنید","mode.placeNoKind":"یک نوع عنصر را از کتابخانه سمت چپ انتخاب کنید","mode.placeFromTerm":"در مقصد رها کنید — عنصر جدید به ترمینال مبدأ متصل می‌شود","mode.placeNormal":"برای قرار دادن روی فضای خالی کلیک کنید؛ یا از یک ترمینال/شینه بکشید تا هم‌زمان قرار داده و متصل شود","mode.text":"برای قرار دادن متن کلیک کنید · برای ویرایش دوبار کلیک کنید · برای جابجایی انتخاب‌شده بکشید · Del برای حذف","mode.rect":"برای رسم مستطیل بکشید · Shift برای مربع · پس از رها کردن اندازه و برچسب آن را تغییر دهید","mode.line":"برای رسم خط بکشید · Shift به 45° می‌چسبد · پس از رها کردن پیکان را در پنل اضافه کنید","mode.table":"برای تعیین شبکه بکشید، یا برای جدول 3×3 کلیک کنید · برای تایپ در سلول‌ها دوبار کلیک کنید","mode.annTextSel":"برای ویرایش روی متن کلیک کنید · برای جابجایی بکشید · Del برای حذف","mode.annTableSel":"برای پر کردن روی یک سلول کلیک کنید · برای جابجایی بکشید · Del برای حذف","mode.annShapeSel":"برای جابجایی بکشید · برای تغییر اندازه دستگیره‌ها را بکشید · سبک را در پنل تغییر دهید · Del برای حذف","mode.annEditing":"تایپ کنید · Enter برای تأیید · Esc برای لغو · یا دکمه‌های ✓ / ✕","mode.escSelect":"Esc انتخاب را پاک می‌کند","mode.escOther":"راست‌کلیک / Esc برای لغو","tool.placeNoKindTooltip":"یک نوع را از کتابخانه سمت چپ انتخاب کنید، سپس روی بوم کلیک کنید","tool.undo":"واگرد","tool.undoHint":"واگرد آخرین ویرایش (جابجایی / چرخش / حذف و غیره)","tool.redo":"بازانجام","tool.redoHint":"بازانجام آخرین ویرایش واگردشده","layout.label":"چیدمان","layout.hint":"چیدمان خودکار کل نمودار یا فقط انتخاب‌شده، پر کردن فضاهای خالی","layout.allAuto":"چیدمان خودکار همه","layout.selAuto":"چیدمان خودکار انتخاب‌شده","layout.allFill":"پر کردن قرارنگرفته‌ها","layout.selFill":"پر کردن قرارنگرفته‌ها در انتخاب‌شده","tool.more":"بیشتر","tool.moreHint":"واگرد / بازانجام / چیدمان","view.menu":"نما","view.menuHint":"بزرگ‌نمایی، تنظیم نما، شبکه","ctx.ariaNode":"عملیات گره","ctx.ariaWire":"عملیات سیم","ctx.ariaElement":"عملیات عنصر","ctx.ariaEdit":"عملیات ویرایش","ctx.done":"انجام شد","ctx.cancel":"لغو","ctx.rotate":"چرخش 90°","ctx.rotateHint":"چرخش انتخاب‌شده در جهت عقربه‌های ساعت؛ سیم‌ها از ترمینال‌های جدید مسیریابی می‌شوند","ctx.mirror":"قرینه افقی","ctx.mirrorTitle":"قرینه","ctx.mirrorHint":"برگرداندن انتخاب‌شده از چپ به راست","ctx.delete":"حذف","ctx.deleteHintNode":"قطع تمام سیم‌های این گره (عناصر باقی می‌مانند)","ctx.deleteHintWire":"فقط این سیم حذف می‌شود (سیم‌های دیگر همان گره باقی می‌مانند)","ctx.deleteHintElement":"حذف انتخاب‌شده و سیم‌های آن","ctx.resetWirePath":"بازنشانی به مسیریابی خودکار","ctx.resetWirePathHint":"گوشه‌های دستی حذف می‌شود و مسیریاب این سیم را دوباره رسم می‌کند","menu.undo":"واگرد","menu.redo":"بازانجام","menu.cut":"برش","menu.copy":"کپی","menu.paste":"جای‌گذاری","menu.rotate":"چرخش 90°","menu.mirror":"قرینه","menu.selectAll":"انتخاب همه","menu.disconnect":"قطع این سیم","menu.delete":"حذف","io.parseFailed":"تجزیه JSON ناموفق بود: {err}","io.notObject":"فایل یک شیء JSON نیست","io.versionMismatch":'عدم تطابق نسخه: مقدار مورد انتظار "1"، مقدار دریافتی {actual}',"io.elementsMissing":"`elements` وجود ندارد یا آرایه نیست","compile.duplicateId":'شناسه عنصر تکراری: "{id}"',"compile.unknownKind":'نوع عنصر ناشناخته kind="{kind}"',"compile.invalidTermRef":'ارجاع ترمینال نامعتبر "{ref}"',"compile.elementMissing":'ارجاع به عنصر ناشناخته "{id}"',"compile.missingPin":'عنصر "{id}" (kind={kind}) پایه "{pin}" را ندارد؛ پایه‌های موجود: {available}',"compile.singleTerminal":"گره فقط یک ترمینال دارد — نادیده گرفته شد","compile.layoutMissingElement":'کلید layout با شناسه "{id}" به عنصری ناشناخته ارجاع می‌دهد',"compile.elementUnconnected":'عنصر "{id}" هیچ اتصالی ندارد',"cat.busbar":"شینه / سیم‌کشی","cat.switching":"کلیدزنی","cat.protection":"حفاظت","cat.motor-control":"کنترل موتور","cat.transformer":"ترانسفورماتور","cat.instrument-transformer":"ترانسفورماتور اندازه‌گیری","cat.measurement":"اندازه‌گیری","cat.source":"منبع","cat.load":"بار","cat.storage":"ذخیره‌سازی","cat.compensation":"جبران‌سازی","cat.grounding":"اتصال زمین","cat.renewable":"انرژی‌های تجدیدپذیر / الکترونیک قدرت","onboard.title":"شروع سریع","onboard.step1.title":"قرار دادن یک قطعه","onboard.step1.body":"ابزار قرار دادن (P) را انتخاب کنید و یک نوع را از کتابخانه به بوم بکشید","onboard.step2.title":"سیم‌کشی کنید","onboard.step2.body":"از ابزار سیم‌کشی (W) استفاده کنید: از یک پایه به پایه دیگر بکشید — برای ساخت یک نقطه اتصال به فضای خالی بکشید","onboard.step3.title":"شینه یک ریل مشترک است، نه یک سیم","onboard.step3.body":"ابزار شینه (B) را فقط زمانی استفاده کنید که چند مدار یک ریل مشترک دارند. از شینه برای اتصال دو دستگاه استفاده نکنید — فقط پایه‌ها را سیم‌کشی کنید (W).","onboard.dismiss":"متوجه شدم"},$S={"arc-suppression-coil.name":"سلف خاموش‌کننده قوس","arrester.name":"برقگیر (FBL)","async-motor.name":"موتور آسنکرون","autotransformer.name":"اتوترانسفورماتور","battery.name":"ذخیره‌سازی باتری","breaker.name":"کلید اتوماتیک (QF)","busbar.name":"قطعه شینه","converter-bidir.name":"مبدل دوطرفه (PCS)","dc-dc-converter.name":"مبدل DC/DC","mppt.name":"کنترلر MPPT","ct.name":"ترانسفورماتور جریان (CT)","disconnector.name":"سکسیونر (QS)","earth.name":"زمین","earthing-switch.name":"کلید ارت (QE)","fuse.name":"فیوز (FU)","generator.name":"ژنراتور (G)","grid-source.name":"منبع شبکه سراسری","grounding-transformer.name":"ترانسفورماتور زمین (زیگزاگ)","inverter.name":"اینورتر (DC→AC)","load-switch.name":"کلید قطع بار","load.name":"بار","luminaire.name":"چراغ (بار روشنایی)","panelboard.name":"تابلو برق / مرکز بار","ngr.name":"مقاومت زمین نوترال (NGR)","pt.name":"ترانسفورماتور ولتاژ (PT)","pv.name":"ماژول فتوولتائیک","rectifier.name":"یکسوکننده (AC→DC)","series-reactor.name":"راکتور سری","shunt-capacitor.name":"خازن موازی","shunt-reactor.name":"راکتور موازی","sync-motor.name":"موتور سنکرون","transformer-2w.name":"ترانسفورماتور دو سیم‌پیچ","transformer-3w.name":"ترانسفورماتور سه سیم‌پیچ","wind-turbine.name":"توربین بادی","gfci-breaker.name":"کلید GFCI (RCBO)","rcd.name":"کلید جریان نشتی (RCD)","recloser.name":"ریکلوزر","energy-meter.name":"کنتور انرژی (Wh)","voltmeter.name":"ولت‌متر (V)","ammeter.name":"آمپرمتر (A)","wattmeter.name":"وات‌متر (W)","frequency-meter.name":"فرکانس‌متر (Hz)","contactor.name":"کنتاکتور (KM)","motor-starter.name":"راه‌انداز موتور","thermal-overload.name":"رله اضافه‌بار حرارتی","vfd.name":"درایو فرکانس متغیر (VFD)","soft-starter.name":"راه‌انداز نرم","transfer-switch.name":"کلید انتقال اتوماتیک (ATS)","dc-disconnector.name":"سکسیونر DC","dc-combiner.name":"جعبه ترکیب‌کننده DC","ev-charger.name":"شارژر خودرو برقی","arc-suppression-coil.desc":"اتصال زمین تشدیدی نقطه نوترال: سلف به زمین","busbar.desc":"قطعه شینه تک با قابلیت کشش و چند انشعاب","converter-bidir.desc":"مبدل ذخیره‌ساز: دوطرفه AC ↔ DC","dc-dc-converter.desc":"مبدل DC/DC / شارژر DC (IEC 60617)","mppt.desc":"کنترلر شارژ خورشیدی MPPT (DC/DC، ردیابی نقطه توان بیشینه)","earthing-switch.desc":"سکسیونر + اتصال زمین، تک‌پورت","grid-source.desc":"شینه بی‌نهایت / شبکه خارجی","grounding-transformer.desc":"ترانسفورماتور ستاره-زیگزاگ برای اتصال زمین نقطه نوترال","load.desc":"بار انتزاعی (پیکان خروجی جریان)","luminaire.desc":"بار روشنایی (نماد عمومی چراغ IEC 60617)","ngr.desc":"اتصال زمین با مقاومت کم: نوترال ترانسفورماتور به زمین","series-reactor.desc":"نماد مشابه راکتور موازی؛ تمایز بر اساس کاربرد","wind-turbine.desc":"توربین بادی: ژنراتور + نشان روتور سه‌پره","gfci-breaker.desc":"کلید جریان نشتی با حفاظت اضافه‌جریان (UL943 / IEC 61009). GFCI در آمریکای شمالی / RCBO در اروپا.","rcd.desc":"کلید جریان نشتی بدون حفاظت اضافه‌جریان (IEC 61008).","recloser.desc":"ریکلوزر خودکار فشار متوسط.","energy-meter.desc":"کنتور انرژی اکتیو (kWh) — ورودی سرویس / زیرکنتور.","contactor.desc":"کنتاکتور مدار اصلی؛ معمولاً همراه با رله اضافه‌بار حرارتی و موتور استفاده می‌شود.","motor-starter.desc":"راه‌انداز موتور (نماد عمومی IEC 60617).","thermal-overload.desc":"رله اضافه‌بار حرارتی موتور؛ بین کنتاکتور و موتور قرار می‌گیرد.","vfd.desc":"درایو فرکانس متغیر برای کنترل سرعت موتور القایی.","soft-starter.desc":"راه‌انداز نرم موتور (راه‌اندازی با ولتاژ کاهش‌یافته بر پایه تریستور).","transfer-switch.desc":"کلید انتقال دو منبعی (ATS / دستی). دو ورودی منبع + یک خروجی بار، با قفل مکانیکی متقابل.","dc-disconnector.desc":"کلید ایزوله DC — ایزوله‌سازی سمت DC رشته فتوولتائیک / باتری.","dc-combiner.desc":"جعبه ترکیب‌کننده رشته‌های فتوولتائیک (نمونه 4 ورودی).","ev-charger.desc":"ایستگاه شارژ خودرو برقی.","breaker.state.open":"باز","disconnector.state.open":"باز","earthing-switch.state.open":"باز","fuse.state.blown":"سوخته","load-switch.state.open":"باز","gfci-breaker.state.open":"باز","rcd.state.open":"باز","recloser.state.open":"باز","contactor.state.open":"باز","thermal-overload.state.tripped":"تریپ‌کرده","transfer-switch.state.position":"موقعیت (عادی/اضطراری/خاموش)","dc-disconnector.state.open":"باز","battery.param.E":"ظرفیت","busbar.param.Un":"ولتاژ نامی","converter-bidir.param.S":"ظرفیت","dc-dc-converter.param.P":"توان","mppt.param.I":"جریان نامی","load.param.P":"توان اکتیو","load.param.cosphi":"ضریب توان","ngr.param.R":"مقاومت","shunt-capacitor.param.Q":"ظرفیت راکتیو","shunt-capacitor.param.stages":"پله‌ها","transformer-2w.param.S":"ظرفیت","transformer-2w.param.ratio":"نسبت تبدیل","gfci-breaker.param.In":"جریان نامی","panelboard.param.In":"جریان نامی","gfci-breaker.param.IDn":"جریان عملکرد نشتی","rcd.param.IDn":"جریان عملکرد نشتی","breaker.param.In":"جریان نامی","breaker.param.poles":"تعداد قطب","breaker.param.Icu":"قدرت قطع","disconnector.param.In":"جریان نامی","fuse.param.In":"جریان نامی","resistor.name":"مقاومت (R)","capacitor.name":"خازن (C)","diode.name":"دیود (D)","indicator-light.name":"چراغ نشانگر (HL)","push-button.name":"کلید فشاری (SB)","relay-coil.name":"بوبین رله (KA)","make-contact.name":"کنتاکت باز (NO)","break-contact.name":"کنتاکت بسته (NC)","bell.name":"زنگ (HA)","terminal.name":"ترمینال / اتصال (X)","fuse-switch-disconnector.name":"سکسیونر-کلید فیوزدار","socket-outlet.name":"پریز / کانکتور","inductor.name":"سلف (L)","voltage-regulator.name":"تنظیم‌کننده ولتاژ (T)","dc-motor.name":"موتور DC (M)","heater.name":"المنت حرارتی (EH)","selector-switch.name":"کلید سلکتور (SA)","limit-switch.name":"کلید حد (SQ)","proximity-switch.name":"کلید مجاورتی (SQ)","time-relay.name":"رله زمانی (KT)","buzzer.name":"بازر (HA)","siren.name":"آژیر (HA)","thermocouple.name":"ترموکوپل (BT)","thyristor.name":"تریستور / SCR (V)","triac.name":"تریاک (V)","zener-diode.name":"دیود زنر (D)","igbt.name":"IGBT","plc.name":"PLC / کنترلر","ups.name":"UPS","power-supply.name":"منبع تغذیه (PS)","genset.name":"مجموعه ژنراتور (G)","protective-relay.name":"رله حفاظتی","overcurrent-relay.name":"رله اضافه‌جریان (50/51)","undervoltage-relay.name":"رله کاهش ولتاژ (27)","reverse-power-relay.name":"رله توان معکوس (32)","distance-relay.name":"رله دیستانس (21)","phase-failure-relay.name":"رله قطع فاز","buchholz-relay.name":"رله بوخهلتس (63)","power-factor-meter.name":"ضریب توان‌متر (cosφ)","synchronoscope.name":"سنکرونوسکوپ","varmeter.name":"وارمتر (var)","resistor.desc":"مقاومت عمومی / محدودکننده جریان / مقاومت ترمزی.","capacitor.desc":"خازن عمومی / فیلتر / باس DC. برای اصلاح ضریب توان از خازن موازی استفاده کنید.","diode.desc":"دیود یکسوساز / آزادگرد / حفاظتی. t1 = آند (بالا)، t2 = کاتد (پایین).","indicator-light.desc":"چراغ نشانگر سیگنال / وضعیت.","push-button.desc":"کلید فشاری دستی، بازگشت خودکار (کنتاکت باز).","relay-coil.desc":"بوبین عملکرد رله / کنتاکتور (جعبه).","make-contact.desc":"کنتاکت کمکی نرمال باز (NO).","break-contact.desc":"کنتاکت کمکی نرمال بسته (NC).","bell.desc":"زنگ سیگنال / زنگ هشدار.","terminal.desc":"ترمینال / جعبه تقسیم / گره اتصال.","fuse-switch-disconnector.desc":"سکسیونر-کلید فیوزدار قابل قطع زیر بار.","socket-outlet.desc":"پریز برق / کانکتور چندقطبی.","inductor.desc":"سلف عمومی / بوبین / خفه‌کن.","voltage-regulator.desc":"تنظیم‌کننده ولتاژ القایی / اتوترانسفورماتوری قابل تنظیم.","dc-motor.desc":"موتور DC (نماد عمومی تحریک سری).","heater.desc":"المنت حرارتی مقاومتی / بار حرارتی.","selector-switch.desc":"کلید سلکتور / تغییر وضعیت (دوار، پایدار).","limit-switch.desc":"کلید حد حرکت / موقعیت (NO، عملکرد مکانیکی).","proximity-switch.desc":"سنسور مجاورتی / کلید مجاورتی بدون تماس.","time-relay.desc":"بوبین رله با تأخیر زمانی (عملکرد کند).","buzzer.desc":"بازر سیگنال.","siren.desc":"آژیر صوتی / هشدار.","thermocouple.desc":"سنسور دمای ترموکوپل.","thyristor.desc":"تریستور سه‌پایه مسدودکننده معکوس / SCR. t1 = آند (بالا)، t2 = کاتد (پایین).","triac.desc":"تریستور سه‌پایه دوطرفه (TRIAC).","zener-diode.desc":"دیود زنر / تنظیم‌کننده ولتاژ. t1 = آند (بالا)، t2 = کاتد (پایین).","igbt.desc":"IGBT کانال N از نوع تقویتی. t1 = کلکتور (بالا)، t2 = امیتر (پایین)، t_g = گیت.","plc.desc":"کنترل‌کننده منطقی قابل برنامه‌ریزی (PLC).","ups.desc":"منبع تغذیه بی‌وقفه آنلاین / استندبای (UPS).","power-supply.desc":"منبع تغذیه سوییچینگ AC→DC / منبع تغذیه DC. t_ac بالا (~)، t_dc پایین (=).","genset.desc":"مجموعه ژنراتور دیزلی / گازی.","protective-relay.desc":"رله اندازه‌گیری / حفاظتی، نماد عمومی (IEC 60617).","overcurrent-relay.desc":"رله حفاظت اضافه‌جریان (ANSI 50/51).","undervoltage-relay.desc":"رله حفاظت کاهش ولتاژ (ANSI 27).","reverse-power-relay.desc":"رله حفاظت توان معکوس / جریان معکوس (ANSI 32).","distance-relay.desc":"رله حفاظت دیستانس / امپدانس کاهشی (ANSI 21).","phase-failure-relay.desc":"رله حفاظت قطع فاز / افت فاز.","buchholz-relay.desc":"رله بوخهلتس / گازی (ANSI 63).","power-factor-meter.desc":"ضریب توان‌متر (cosφ).","synchronoscope.desc":"نشانگر همزمان‌سازی / سنکرونوسکوپ.","varmeter.desc":"توان راکتیومتر (var).","make-contact.state.closed":"بسته","break-contact.state.open":"باز","fuse-switch-disconnector.state.open":"باز","selector-switch.state.open":"باز","limit-switch.state.closed":"بسته","resistor.param.R":"مقاومت","resistor.param.P":"توان نامی","capacitor.param.C":"ظرفیت خازنی","capacitor.param.Un":"ولتاژ نامی","indicator-light.param.color":"رنگ","inductor.param.L":"اندوکتانس","inductor.param.In":"جریان نامی","voltage-regulator.param.ratio":"محدوده تنظیم","heater.param.P":"توان","ups.param.S":"ظرفیت","power-supply.param.Vdc":"ولتاژ خروجی","genset.param.P":"توان"},jS={ui:CS,library:$S},AS={"common.unnamed":"بلا اسم","common.close":"إغلاق","common.yes":"نعم","common.no":"لا","topbar.theme.toLight":"التبديل إلى الوضع الفاتح","topbar.theme.toDark":"التبديل إلى الوضع الداكن","topbar.theme.currentDark":"الحالي: السمة الداكنة","topbar.theme.currentLight":"الحالي: السمة الفاتحة","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"الحالي: الإنجليزية","topbar.lang.currentChinese":"الحالي: الصينية","topbar.export.label":"تصدير","topbar.export.tooltip":"SVG متجهي (قابل للتحرير)، PNG نقطي (بدقة 2×)، أو DXF (لبرامج CAD)","topbar.export.pngFailed":"فشل تصدير PNG: {err}","topbar.export.dxfFailed":"فشل تصدير DXF: {err}","topbar.file.label":"ملف","topbar.file.tooltip":"افتح مخططًا محليًا بصيغة .json، احفظ، أو احفظ باسم","topbar.file.current":"الحالي: {name}","topbar.file.new":"جديد","topbar.file.open":"فتح…","topbar.file.save":"حفظ","topbar.file.saveAs":"حفظ باسم…","topbar.file.newConfirm":"سيؤدي إنشاء ملف جديد إلى فقدان أي تغييرات غير محفوظة. هل تريد المتابعة؟","topbar.file.openFailed":"فشل الفتح: {err}","topbar.file.saveFailed":"فشل الحفظ: {err}","topbar.file.fileDescription":"مخطط OneLineEditor","outline.title":"المخطط التفصيلي","outline.collapse":"طي","outline.collapseAria":"طي المخطط التفصيلي","outline.empty":"(لا توجد عناصر — اسحب من المكتبة للبدء)","props.title":"الخصائص","props.node":"العقدة الكهربائية","props.wire":"السلك","props.bus":"الشريط الناقل","props.junction":"نقطة الوصل","props.junctionPos":"الموضع","props.nSelected":"تم تحديد {n}","props.empty":"لا يوجد تحديد","props.multi":"تم تحديد {n} كائن","props.name":"الاسم","props.note":"ملاحظة","props.label":"التسمية","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"العقدة الكهربائية {id} غير موجودة","props.wireNotFound":"السلك {id} غير موجود","props.nodeStats":"{terminals} طرف · {elements} عنصر","props.selectElement":"تحديد {label}","props.selectWholeNode":"تحديد العقدة الكهربائية بالكامل","props.annText":"نص","props.annRect":"مستطيل","props.annLine":"خط","props.annTable":"جدول","props.annNotFound":"التعليق التوضيحي {id} غير موجود","props.annLabel":"التسمية","props.annLabelPlaceholder":"مثال: لوحة رقم 1","props.annStroke":"نمط الخط","props.annStrokeSolid":"متصل","props.annStrokeDashed":"متقطع","props.annFill":"التعبئة","props.annFillNone":"بلا","props.annFillTint":"تظليل","props.annArrow":"الأسهم","props.annArrowNone":"بلا","props.annArrowEnd":"طرف واحد","props.annArrowBoth":"الطرفان","props.annFontSize":"حجم الخط","props.annRows":"الصفوف","props.annCols":"الأعمدة","view.zoomOut":"تصغير","view.zoomOutHint":"تصغير تدريجي؛ أو عجلة الفأرة ↓ أو ⌘−","view.reset":"إعادة الضبط إلى 100%","view.current":"الحالي {z}%","view.zoomIn":"تكبير","view.zoomInHint":"تكبير تدريجي؛ أو عجلة الفأرة ↑ أو ⌘+","view.fit":"احتواء العرض","view.fitHint":"تكبير/تصغير تلقائي وتوسيط كل العناصر","view.gridHide":"إخفاء الشبكة","view.gridShow":"إظهار الشبكة","view.gridHotkey":"G","view.gridHideHint":"يعطّل أيضًا الانجذاب إلى الشبكة (وضع حر)","view.gridShowHint":"يفعّل أيضًا الانجذاب إلى الشبكة (ينجذب إلى 10 بكسل عند السحب)","view.gridHideAria":"إخفاء الشبكة وتعطيل الانجذاب","view.gridShowAria":"إظهار الشبكة وتفعيل الانجذاب","view.label":"التسميات","view.labelOff":"إيقاف","view.labelId":"المعرّف","view.labelAll":"المعرّف + المعاملات","view.labelHint":"إظهار التسميات وحجم خطها (ينطبق على التصدير أيضًا)","view.labelSize":"الحجم","view.labelSizeSmaller":"تصغير خط التسميات","view.labelSizeLarger":"تكبير خط التسميات","view.labelSizeReset":"إعادة تعيين حجم التسميات","library.title":"المكتبة","library.empty":"لا توجد عناصر مطابقة","library.searchPlaceholder":"البحث في العناصر…","library.searchAria":"البحث في العناصر","library.clearSearch":"مسح البحث","library.itemHint":"انقر للدخول في وضع الإضافة، أو اسحب إلى لوحة الرسم","tool.select":"تحديد","tool.selectHint":"انقر للاختيار، حدد بالسحب لاختيار عدة عناصر، أو انقر بالزر الأيمن لفتح القائمة","tool.pan":"تحريك","tool.panHint":"اسحب لوحة الرسم؛ مفتاح المسافة يبدّل مؤقتًا","tool.wire":"سلك","tool.wireHint":"اسحب من طرف/شريط ناقل/نقطة وصل؛ السحب إلى مساحة فارغة يُنشئ نقطة وصل، وإلى سلك موجود يصل به","tool.bus":"الشريط الناقل","tool.busHint":"اسحب على لوحة الرسم — اضغط لتحديد نقطة البداية، وحرر لتحديد نقطة النهاية","tool.junction":"نقطة الوصل","tool.junctionHint":"انقر على لوحة الرسم لوضع نقطة وصل (عقدة)؛ يمكن للأسلاك الاتصال بها بحرية","tool.place":"إضافة","tool.placeHint":"انقر للوضع؛ أو اسحب من طرف/شريط ناقل للوضع والتوصيل معًا","tool.text":"نص","tool.textHint":"انقر على لوحة الرسم لوضع ملاحظة نصية؛ انقر نقرًا مزدوجًا على ملاحظة موجودة لتحريرها","tool.rect":"مستطيل","tool.rectHint":"اسحب لرسم مستطيل / إطار تجميع (متقطع افتراضيًا)؛ اضغط Shift لرسم مربع","tool.line":"خط","tool.lineHint":"اسحب لرسم خط توضيحي؛ Shift يقيّده بزاوية 45°؛ إعدادات الأسهم في لوحة الخصائص","tool.table":"جدول","tool.tableHint":"اسحب لتحديد عدد الأعمدة × الصفوف (يظهر العدد مباشرة)، أو انقر لوضع جدول افتراضي؛ انقر نقرًا مزدوجًا على الخلايا للكتابة","mode.selectWithSel":"اسحب العناصر · اسحب الأطراف للتوصيل · انقر بالزر الأيمن لفتح القائمة","mode.selectEmpty":"انقر للاختيار · اسحب للتحريك · حدد بالسحب لاختيار عدة عناصر · انقر بالزر الأيمن لفتح القائمة","mode.pan":"اسحب لوحة الرسم · مرّر للتكبير/التصغير · اضغط مطولاً على المسافة للتحريك في أي أداة","mode.wireDragging":"حرر على طرف/شريط ناقل/نقطة وصل؛ التحرير في مساحة فارغة يُنشئ نقطة وصل","mode.wireInit":"اضغط على أي نقطة اتصال أو مساحة فارغة، اسحب إلى الهدف ثم حرر","mode.busDragging":"السحب يحدد اتجاه الشريط الناقل؛ التحرير يحدد نقطة النهاية","mode.busInit":"اضغط على لوحة الرسم لتحديد البداية، اسحب، ثم حرر لتحديد النهاية","mode.junction":"انقر على لوحة الرسم لوضع نقطة وصل","mode.placeNoKind":"اختر نوع عنصر من المكتبة على اليسار","mode.placeFromTerm":"حرر عند الهدف — سيتصل العنصر الجديد بالطرف المصدر","mode.placeNormal":"انقر على مساحة فارغة للوضع؛ أو اسحب من طرف / شريط ناقل للوضع والتوصيل معًا","mode.text":"انقر لوضع نص · انقر نقرًا مزدوجًا للتحرير · اسحب العنصر المحدد للتحريك · Del للحذف","mode.rect":"اسحب لرسم مستطيل · Shift لرسم مربع · غيّر حجمه وأضف تسمية بعد التحرير","mode.line":"اسحب لرسم خط · Shift يقيّده بزاوية 45° · أضف الأسهم في اللوحة بعد التحرير","mode.table":"اسحب لتحديد شبكة الجدول، أو انقر لوضع جدول 3×3 · انقر نقرًا مزدوجًا على الخلايا للكتابة","mode.annTextSel":"انقر على النص للتحرير · اسحب للتحريك · Del للحذف","mode.annTableSel":"انقر على خلية لملئها · اسحب للتحريك · Del للحذف","mode.annShapeSel":"اسحب للتحريك · اسحب المقابض لتغيير الحجم · غيّر النمط في اللوحة · Del للحذف","mode.annEditing":"اكتب · Enter للتأكيد · Esc للإلغاء · أو زرّي ✓ / ✕","mode.escSelect":"Esc لإلغاء التحديد","mode.escOther":"انقر بالزر الأيمن / Esc للإلغاء","tool.placeNoKindTooltip":"اختر نوعًا من المكتبة على اليسار، ثم انقر على لوحة الرسم","tool.undo":"تراجع","tool.undoHint":"تراجع عن آخر تعديل (تحريك / تدوير / حذف، إلخ)","tool.redo":"إعادة","tool.redoHint":"إعادة آخر تعديل تم التراجع عنه","layout.label":"التخطيط","layout.hint":"تخطيط تلقائي للمخطط بالكامل أو للتحديد فقط، وملء الفراغات","layout.allAuto":"تخطيط تلقائي للكل","layout.selAuto":"تخطيط تلقائي للتحديد","layout.allFill":"ملء العناصر غير الموضوعة","layout.selFill":"ملء العناصر غير الموضوعة في التحديد","tool.more":"المزيد","tool.moreHint":"تراجع / إعادة / تخطيط","view.menu":"العرض","view.menuHint":"تكبير، احتواء، شبكة","ctx.ariaNode":"إجراءات العقدة","ctx.ariaWire":"إجراءات السلك","ctx.ariaElement":"إجراءات العنصر","ctx.ariaEdit":"إجراءات التحرير","ctx.done":"تم","ctx.cancel":"إلغاء","ctx.rotate":"تدوير 90°","ctx.rotateHint":"تدوير التحديد باتجاه عقارب الساعة؛ تُعاد الأسلاك توجيهها عبر الأطراف الجديدة","ctx.mirror":"عكس أفقيًا","ctx.mirrorTitle":"عكس","ctx.mirrorHint":"قلب التحديد أفقيًا","ctx.delete":"حذف","ctx.deleteHintNode":"فصل كل الأسلاك المتصلة بهذه العقدة (تبقى العناصر)","ctx.deleteHintWire":"إزالة هذا السلك فقط (تبقى الأسلاك الأخرى على نفس العقدة)","ctx.deleteHintElement":"إزالة التحديد وأسلاكه","ctx.resetWirePath":"إعادة الضبط إلى التوجيه التلقائي","ctx.resetWirePathHint":"تجاهل النقاط اليدوية ودع الموجّه يعيد رسم هذا السلك","menu.undo":"تراجع","menu.redo":"إعادة","menu.cut":"قص","menu.copy":"نسخ","menu.paste":"لصق","menu.rotate":"تدوير 90°","menu.mirror":"عكس","menu.selectAll":"تحديد الكل","menu.disconnect":"فصل هذا السلك","menu.delete":"حذف","io.parseFailed":"فشل تحليل JSON: {err}","io.notObject":"الملف ليس كائن JSON","io.versionMismatch":'عدم تطابق الإصدار: المتوقع "1"، والفعلي {actual}',"io.elementsMissing":"الحقل `elements` مفقود أو ليس مصفوفة","compile.duplicateId":'معرّف عنصر مكرر: "{id}"',"compile.unknownKind":'نوع عنصر غير معروف kind="{kind}"',"compile.invalidTermRef":'إشارة طرف غير صالحة "{ref}"',"compile.elementMissing":'إشارة إلى عنصر غير موجود "{id}"',"compile.missingPin":'العنصر "{id}" (kind={kind}) لا يحتوي على طرف "{pin}"؛ المتاح: {available}',"compile.singleTerminal":"العقدة تحتوي على طرف واحد فقط — تم تجاهلها","compile.layoutMissingElement":'مفتاح layout "{id}" يشير إلى عنصر غير موجود',"compile.elementUnconnected":'العنصر "{id}" لا يحتوي على أي اتصالات',"cat.busbar":"الشريط الناقل / التوصيلات","cat.switching":"المفاتيح والقواطع","cat.protection":"الحماية","cat.motor-control":"التحكم بالمحركات","cat.transformer":"المحولات","cat.instrument-transformer":"محولات القياس","cat.measurement":"القياس","cat.source":"المصادر","cat.load":"الأحمال","cat.storage":"التخزين","cat.compensation":"التعويض","cat.grounding":"التأريض","cat.renewable":"الطاقة المتجددة / الإلكترونيات الكهربائية","onboard.title":"البدء السريع","onboard.step1.title":"وضع عنصر","onboard.step1.body":"اختر أداة الإضافة (P) واسحب نوعًا من المكتبة إلى لوحة الرسم","onboard.step2.title":"وصّله","onboard.step2.body":"استخدم أداة السلك (W): اسحب من طرف إلى آخر — السحب إلى مساحة فارغة يضع نقطة وصل","onboard.step3.title":"الشريط الناقل قضيب مشترك، وليس سلكًا","onboard.step3.body":"استخدم أداة الشريط الناقل (B) فقط عندما تشترك عدة دوائر في قضيب واحد. لا تستخدم الشريط الناقل لربط جهازين — فقط وصّل الأطراف بسلك (W).","onboard.dismiss":"فهمت"},ES={"arc-suppression-coil.name":"ملف إخماد القوس","arrester.name":"مانع الصواعق (FBL)","async-motor.name":"محرك غير متزامن","autotransformer.name":"محول ذاتي","battery.name":"بطارية التخزين","breaker.name":"قاطع الدائرة (QF)","busbar.name":"مقطع الشريط الناقل","converter-bidir.name":"محوّل ثنائي الاتجاه (PCS)","dc-dc-converter.name":"محول DC/DC","mppt.name":"وحدة تحكم MPPT","ct.name":"محول التيار (CT)","disconnector.name":"مفتاح العزل (QS)","earth.name":"أرضي","earthing-switch.name":"مفتاح التأريض (QE)","fuse.name":"منصهر (FU)","generator.name":"مولد (G)","grid-source.name":"مصدر الشبكة","grounding-transformer.name":"محول التأريض (توصيل متعرج)","inverter.name":"عاكس (DC→AC)","load-switch.name":"مفتاح قطع الحمل","load.name":"حمل","luminaire.name":"مصباح (حمل إنارة)","panelboard.name":"لوحة توزيع / مركز أحمال","ngr.name":"مقاومة تأريض المحايد (NGR)","pt.name":"محول الجهد (PT)","pv.name":"وحدة كهروضوئية","rectifier.name":"مقوّم (AC→DC)","series-reactor.name":"مفاعل توالي","shunt-capacitor.name":"مكثف توازي","shunt-reactor.name":"مفاعل توازي","sync-motor.name":"محرك متزامن","transformer-2w.name":"محول ثنائي الملفات","transformer-3w.name":"محول ثلاثي الملفات","wind-turbine.name":"توربين رياح","gfci-breaker.name":"قاطع GFCI (RCBO)","rcd.name":"جهاز التيار المتبقي (RCD)","recloser.name":"قاطع إعادة التوصيل (Recloser)","energy-meter.name":"عداد الطاقة (Wh)","voltmeter.name":"فولتميتر (V)","ammeter.name":"أميتر (A)","wattmeter.name":"واتميتر (W)","frequency-meter.name":"مقياس التردد (Hz)","contactor.name":"كونتاكتور (KM)","motor-starter.name":"مشغّل محرك","thermal-overload.name":"مرحل الحمل الزائد الحراري","vfd.name":"مشغّل بتردد متغير (VFD)","soft-starter.name":"مشغّل ناعم","transfer-switch.name":"مفتاح تحويل (ATS)","dc-disconnector.name":"مفتاح عزل التيار المستمر","dc-combiner.name":"صندوق تجميع التيار المستمر","ev-charger.name":"شاحن السيارات الكهربائية","arc-suppression-coil.desc":"تأريض محايد رنيني: ملف حثي متصل بالأرض","busbar.desc":"مقطع شريط ناقل واحد قابل للتمديد بعدة نقاط تفريع","converter-bidir.desc":"محول تخزين: تيار متردد ↔ تيار مستمر ثنائي الاتجاه","dc-dc-converter.desc":"محول DC/DC / شاحن تيار مستمر (IEC 60617)","mppt.desc":"وحدة تحكم شمسية MPPT (DC/DC، تتبع نقطة القدرة القصوى)","earthing-switch.desc":"مفتاح عزل + اتصال أرضي، منفذ واحد","grid-source.desc":"شريط ناقل لانهائي / شبكة خارجية","grounding-transformer.desc":"محول نجمي-متعرج لتأريض المحايد","load.desc":"حمل تجريدي (سهم خروج التيار)","luminaire.desc":"حمل إنارة (رمز عام للمصباح وفق IEC 60617)","ngr.desc":"تأريض بمقاومة منخفضة: محايد المحول إلى الأرض","series-reactor.desc":"نفس رمز مفاعل التوازي؛ يُميَّز حسب الاستخدام","wind-turbine.desc":"توربين رياح: مولد + علامة دوار ثلاثي الريش","gfci-breaker.desc":"قاطع تيار متبقٍ مزود بحماية من التيار الزائد (UL943 / IEC 61009). يُعرف بـ GFCI في أمريكا الشمالية و RCBO في أوروبا.","rcd.desc":"قاطع تيار متبقٍ بدون حماية من التيار الزائد (IEC 61008).","recloser.desc":"قاطع إعادة غلق تلقائي للجهد المتوسط.","energy-meter.desc":"عداد طاقة فعالة (kWh) — عند نقطة الدخول أو كعداد فرعي.","contactor.desc":"كونتاكتور الدائرة الرئيسية؛ يُستخدم عادةً مع مرحل حمل زائد حراري ومحرك.","motor-starter.desc":"مشغّل محرك (الرمز العام IEC 60617).","thermal-overload.desc":"مرحل حمل زائد حراري للمحرك؛ يوضع بين الكونتاكتور والمحرك.","vfd.desc":"مشغّل بتردد متغير للتحكم في سرعة المحرك الحثي.","soft-starter.desc":"مشغّل ناعم للمحرك (تشغيل بجهد مخفّض باستخدام الثايرستور).","transfer-switch.desc":"مفتاح تحويل بمصدرين (ATS / يدوي). مدخلا مصدرين + مخرج حمل واحد، مع تأمين ميكانيكي متبادل.","dc-disconnector.desc":"مفتاح عزل للتيار المستمر — لعزل جانب التيار المستمر لسلسلة الألواح الكهروضوئية / البطارية.","dc-combiner.desc":"صندوق تجميع لسلاسل الألواح الكهروضوئية (مثال بأربعة مداخل).","ev-charger.desc":"محطة شحن السيارات الكهربائية.","breaker.state.open":"مفتوح","disconnector.state.open":"مفتوح","earthing-switch.state.open":"مفتوح","fuse.state.blown":"محترق","load-switch.state.open":"مفتوح","gfci-breaker.state.open":"مفتوح","rcd.state.open":"مفتوح","recloser.state.open":"مفتوح","contactor.state.open":"مفتوح","thermal-overload.state.tripped":"متعثر","transfer-switch.state.position":"الموضع (عادي/طوارئ/إيقاف)","dc-disconnector.state.open":"مفتوح","battery.param.E":"السعة","busbar.param.Un":"الجهد الاسمي","converter-bidir.param.S":"السعة","dc-dc-converter.param.P":"القدرة","mppt.param.I":"التيار الاسمي","load.param.P":"القدرة الفعالة","load.param.cosphi":"معامل القدرة","ngr.param.R":"المقاومة","shunt-capacitor.param.Q":"القدرة التفاعلية","shunt-capacitor.param.stages":"المراحل","transformer-2w.param.S":"السعة","transformer-2w.param.ratio":"نسبة التحويل","gfci-breaker.param.In":"التيار الاسمي","panelboard.param.In":"التيار المقنن","gfci-breaker.param.IDn":"تيار التشغيل المتبقي","rcd.param.IDn":"تيار التشغيل المتبقي","breaker.param.In":"التيار الاسمي","breaker.param.poles":"عدد الأقطاب","breaker.param.Icu":"قدرة القطع","disconnector.param.In":"التيار الاسمي","fuse.param.In":"التيار الاسمي","resistor.name":"مقاومة (R)","capacitor.name":"مكثف (C)","diode.name":"ديود (D)","indicator-light.name":"مصباح إشارة (HL)","push-button.name":"زر ضغط (SB)","relay-coil.name":"ملف مرحل (KA)","make-contact.name":"تماس مفتوح عادةً (NO)","break-contact.name":"تماس مغلق عادةً (NC)","bell.name":"جرس (HA)","terminal.name":"طرف / نقطة وصل (X)","fuse-switch-disconnector.name":"مفتاح فصل مزود بمصهر","socket-outlet.name":"مقبس / موصل","inductor.name":"ملف حثي (L)","voltage-regulator.name":"منظم الجهد (T)","dc-motor.name":"محرك تيار مستمر (M)","heater.name":"عنصر تسخين (EH)","selector-switch.name":"مفتاح اختيار (SA)","limit-switch.name":"مفتاح حدّي (SQ)","proximity-switch.name":"مفتاح تقارب (SQ)","time-relay.name":"مرحل زمني (KT)","buzzer.name":"طنّان (HA)","siren.name":"صفارة إنذار (HA)","thermocouple.name":"مزدوجة حرارية (BT)","thyristor.name":"ثايرستور / SCR (V)","triac.name":"ترياك (V)","zener-diode.name":"ديود زينر (D)","igbt.name":"IGBT","plc.name":"PLC / متحكم","ups.name":"UPS","power-supply.name":"مزود طاقة (PS)","genset.name":"مجموعة مولد (G)","protective-relay.name":"مرحل حماية","overcurrent-relay.name":"مرحل تيار زائد (50/51)","undervoltage-relay.name":"مرحل انخفاض الجهد (27)","reverse-power-relay.name":"مرحل القدرة العكسية (32)","distance-relay.name":"مرحل مسافة (21)","phase-failure-relay.name":"مرحل فقد الطور","buchholz-relay.name":"مرحل بوخهولز (63)","power-factor-meter.name":"مقياس معامل القدرة (cosφ)","synchronoscope.name":"مقياس التزامن","varmeter.name":"مقياس القدرة التفاعلية (var)","resistor.desc":"مقاومة عامة / للحد من التيار / مقاومة كبح.","capacitor.desc":"مكثف عام / للترشيح / لناقل التيار المستمر. استخدم مكثف التوازي لتصحيح معامل القدرة.","diode.desc":"ديود تقويم / تدوير حر / حماية. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","indicator-light.desc":"مصباح إشارة / حالة.","push-button.desc":"زر ضغط يدوي، رجوع تلقائي (تماس مفتوح عادةً).","relay-coil.desc":"ملف تشغيل مرحل / كونتاكتور (صندوق).","make-contact.desc":"تماس مساعد مفتوح عادةً (توصيل عند التشغيل).","break-contact.desc":"تماس مساعد مغلق عادةً (فصل عند التشغيل).","bell.desc":"جرس إشارة / جرس إنذار.","terminal.desc":"طرف / صندوق توصيل / عقدة اتصال.","fuse-switch-disconnector.desc":"مفتاح فصل مزود بمصهر يعمل تحت الحمل.","socket-outlet.desc":"مقبس كهربائي / موصل متعدد الأقطاب.","inductor.desc":"ملف حثي عام / وشيعة / خانق.","voltage-regulator.desc":"منظم جهد حثي قابل للتعديل / محول ذاتي.","dc-motor.desc":"محرك تيار مستمر (الرمز العام لملف المجال التوالي).","heater.desc":"عنصر تسخين مقاوم / حمل تسخين.","selector-switch.desc":"مفتاح اختيار / تحويل (دوّار، يثبت في وضعه).","limit-switch.desc":"مفتاح حركة / موضع (مفتوح عادةً، يعمل ميكانيكيًا).","proximity-switch.desc":"حساس تقارب / مفتاح تقارب بلا تماس.","time-relay.desc":"ملف مرحل زمني (تأخير التشغيل).","buzzer.desc":"طنّان إشارة.","siren.desc":"صفارة إنذار صوتية.","thermocouple.desc":"حساس حرارة من نوع مزدوجة حرارية.","thyristor.desc":"ثايرستور ثلاثي الأطراف حاجب عكسي / SCR. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","triac.desc":"ثايرستور ثلاثي ثنائي الاتجاه (TRIAC).","zener-diode.desc":"ديود زينر / منظم جهد. t1 = المصعد (أعلى)، t2 = المهبط (أسفل).","igbt.desc":"IGBT معزز قناة-N. t1 = المجمّع (أعلى)، t2 = الباعث (أسفل)، t_g = البوابة.","plc.desc":"متحكم منطقي قابل للبرمجة (PLC).","ups.desc":"مزود طاقة غير منقطع (UPS) خطي / احتياطي.","power-supply.desc":"مزود طاقة بتحويل مفتاح AC→DC / تيار مستمر. t_ac أعلى (~)، t_dc أسفل (=).","genset.desc":"مجموعة مولد ديزل / غاز.","protective-relay.desc":"مرحل قياس / حماية، رمز عام (IEC 60617).","overcurrent-relay.desc":"مرحل حماية من التيار الزائد (ANSI 50/51).","undervoltage-relay.desc":"مرحل حماية من انخفاض الجهد (ANSI 27).","reverse-power-relay.desc":"مرحل حماية من القدرة العكسية / التيار العكسي (ANSI 32).","distance-relay.desc":"مرحل حماية مسافة / انخفاض الممانعة (ANSI 21).","phase-failure-relay.desc":"مرحل حماية من فقد الطور.","buchholz-relay.desc":"مرحل بوخهولز / الغاز (ANSI 63).","power-factor-meter.desc":"مقياس معامل القدرة (cosφ).","synchronoscope.desc":"مؤشر التزامن / مقياس التزامن.","varmeter.desc":"مقياس القدرة التفاعلية (var).","make-contact.state.closed":"مغلق","break-contact.state.open":"مفتوح","fuse-switch-disconnector.state.open":"مفتوح","selector-switch.state.open":"مفتوح","limit-switch.state.closed":"مغلق","resistor.param.R":"المقاومة","resistor.param.P":"القدرة الاسمية","capacitor.param.C":"السعة الكهربائية","capacitor.param.Un":"الجهد الاسمي","indicator-light.param.color":"اللون","inductor.param.L":"المحاثة","inductor.param.In":"التيار الاسمي","voltage-regulator.param.ratio":"نطاق التنظيم","heater.param.P":"القدرة","ups.param.S":"السعة","power-supply.param.Vdc":"جهد الخرج","genset.param.P":"القدرة"},NS={ui:AS,library:ES},TS={"common.unnamed":"ללא שם","common.close":"סגור","common.yes":"כן","common.no":"לא","topbar.theme.toLight":"עבור למצב בהיר","topbar.theme.toDark":"עבור למצב כהה","topbar.theme.currentDark":"נוכחי: ערכת נושא כהה","topbar.theme.currentLight":"נוכחי: ערכת נושא בהירה","topbar.lang.toEnglish":"עבור לאנגלית","topbar.lang.toChinese":"עבור לסינית","topbar.lang.currentEnglish":"נוכחי: אנגלית","topbar.lang.currentChinese":"נוכחי: סינית","topbar.export.label":"ייצוא","topbar.export.tooltip":"SVG וקטורי (ניתן לעריכה), PNG (2×, רזולוציה גבוהה), או DXF (CAD)","topbar.export.pngFailed":"ייצוא PNG נכשל: {err}","topbar.export.dxfFailed":"ייצוא DXF נכשל: {err}","topbar.file.label":"קובץ","topbar.file.tooltip":"פתחו תרשים .json מקומי, שמרו, או שמרו בשם","topbar.file.current":"נוכחי: {name}","topbar.file.new":"חדש","topbar.file.open":"פתח…","topbar.file.save":"שמור","topbar.file.saveAs":"שמור בשם…","topbar.file.newConfirm":"יצירת קובץ חדש תמחק שינויים שלא נשמרו. להמשיך?","topbar.file.openFailed":"פתיחה נכשלה: {err}","topbar.file.saveFailed":"שמירה נכשלה: {err}","topbar.file.fileDescription":"תרשים OneLineEditor","outline.title":"מבנה","outline.collapse":"כווץ","outline.collapseAria":"כווץ את המבנה","outline.empty":"(אין רכיבים — גררו מהספרייה כדי להתחיל)","props.title":"מאפיינים","props.node":"צומת חשמלי","props.wire":"תיל","props.bus":"פס צבירה","props.junction":"מחבר","props.junctionPos":"מיקום","props.nSelected":"{n} נבחרו","props.empty":"לא נבחר דבר","props.multi":"{n} פריטים נבחרו","props.name":"שם","props.note":"הערה","props.label":"תווית","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"צומת חשמלי {id} לא נמצא","props.wireNotFound":"תיל {id} לא נמצא","props.nodeStats":"{terminals} הדקים · {elements} רכיבים","props.selectElement":"בחר {label}","props.selectWholeNode":"בחר את כל הצומת החשמלי","props.annText":"טקסט","props.annRect":"מלבן","props.annLine":"קו","props.annTable":"טבלה","props.annNotFound":"סימון {id} לא נמצא","props.annLabel":"תווית","props.annLabelPlaceholder":"לדוגמה: לוח 1#","props.annStroke":"סוג קו","props.annStrokeSolid":"רציף","props.annStrokeDashed":"מקווקו","props.annFill":"מילוי","props.annFillNone":"ללא","props.annFillTint":"גוון","props.annArrow":"חיצים","props.annArrowNone":"ללא","props.annArrowEnd":"קצה אחד","props.annArrowBoth":"שני קצוות","props.annFontSize":"גודל גופן","props.annRows":"שורות","props.annCols":"עמודות","view.zoomOut":"הקטן תצוגה","view.zoomOutHint":"הקטנה מדורגת; ניתן גם עם גלגלת ↓ או ⌘−","view.reset":"אפס ל-100%","view.current":"נוכחי {z}%","view.zoomIn":"הגדל תצוגה","view.zoomInHint":"הגדלה מדורגת; ניתן גם עם גלגלת ↑ או ⌘+","view.fit":"התאם תצוגה","view.fitHint":"מתאים אוטומטית ומרכז את כל הרכיבים","view.gridHide":"הסתר רשת","view.gridShow":"הצג רשת","view.gridHotkey":"G","view.gridHideHint":"גם מבטל הצמדה לרשת (מיקום חופשי)","view.gridShowHint":"גם מפעיל הצמדה לרשת (הצמדה ל-10px בגרירה)","view.gridHideAria":"הסתר רשת ובטל הצמדה","view.gridShowAria":"הצג רשת והפעל הצמדה","view.label":"תוויות","view.labelOff":"כבוי","view.labelId":"מזהה","view.labelAll":"מזהה + פרמטרים","view.labelHint":"תצוגת תוויות וגודל הגופן (חל גם על הייצוא)","view.labelSize":"גודל","view.labelSizeSmaller":"הקטנת גופן התוויות","view.labelSizeLarger":"הגדלת גופן התוויות","view.labelSizeReset":"איפוס גודל התוויות","library.title":"ספריית רכיבים","library.empty":"לא נמצאו רכיבים תואמים","library.searchPlaceholder":"חיפוש רכיבים…","library.searchAria":"חיפוש רכיבים","library.clearSearch":"נקה חיפוש","library.itemHint":"לחצו כדי להיכנס למצב מיקום, או גררו אל הקנבס","tool.select":"בחירה","tool.selectHint":"לחיצה לבחירת רכיב, גרירת מסגרת לבחירה מרובה, קליק ימני לתפריט","tool.pan":"הזזה","tool.panHint":"גררו את הקנבס; מקש הרווח מפעיל זמנית","tool.wire":"תיל","tool.wireHint":"גררו מהדק / פס צבירה / מחבר; גרירה לשטח ריק יוצרת מחבר חדש, וגרירה על תיל קיים מתחברת אליו","tool.bus":"פס צבירה","tool.busHint":"גררו על הקנבס — לחצו לקביעת נקודת ההתחלה, שחררו לקביעת הסיום","tool.junction":"מחבר","tool.junctionHint":"לחצו על הקנבס כדי להציב מחבר (צומת); ניתן לחבר אליו תילים בחופשיות","tool.place":"הצבה","tool.placeHint":"לחצו כדי להציב; או גררו מהדק / פס צבירה כדי להציב ולחבר בו-זמנית","tool.text":"טקסט","tool.textHint":"לחצו על הקנבס כדי להוסיף הערת טקסט; לחיצה כפולה על הערה קיימת לעריכה","tool.rect":"מלבן","tool.rectHint":"גררו כדי לצייר מלבן / מסגרת קיבוץ (מקווקו כברירת מחדל); Shift לריבוע","tool.line":"קו","tool.lineHint":"גררו כדי לצייר קו סימון; Shift מצמיד ל-45°; חיצים זמינים בפאנל המאפיינים","tool.table":"טבלה","tool.tableHint":"גררו כדי לקבוע עמודות × שורות (ספירה חיה), או לחצו לטבלת ברירת מחדל; לחיצה כפולה על תא להקלדה","mode.selectWithSel":"גררו רכיבים · גררו מהדקים כדי לחווט · קליק ימני לתפריט","mode.selectEmpty":"לחצו לבחירה · גררו להזזה · מסגרת לבחירה מרובה · קליק ימני לתפריט","mode.pan":"גררו את הקנבס · גלגלת לזום · החזיקו Space כדי להזיז בכל כלי","mode.wireDragging":"שחררו על הדק / פס צבירה / מחבר; שחרור בשטח ריק יוצר מחבר חדש","mode.wireInit":"לחצו על כל נקודת חיבור או שטח ריק, גררו ליעד ושחררו","mode.busDragging":"הגרירה קובעת את כיוון הפס; השחרור קובע את הסיום","mode.busInit":"לחצו על הקנבס לקביעת ההתחלה, גררו, ושחררו לקביעת הסיום","mode.junction":"לחצו על הקנבס כדי להציב מחבר","mode.placeNoKind":"בחרו סוג רכיב מהספרייה בצד שמאל","mode.placeFromTerm":"שחררו ביעד — הרכיב החדש יתחבר בחזרה להדק המקור","mode.placeNormal":"לחצו על שטח ריק כדי להציב; או גררו מהדק / פס צבירה כדי להציב ולחבר","mode.text":"לחצו להוספת טקסט · לחיצה כפולה לעריכה · גררו רכיב נבחר להזזה · Del להסרה","mode.rect":"גררו לציור מלבן · Shift לריבוע · שנו גודל והוסיפו תווית לאחר השחרור","mode.line":"גררו לציור קו · Shift מצמיד ל-45° · הוסיפו חיצים בפאנל לאחר השחרור","mode.table":"גררו לקביעת הרשת, או לחצו לטבלת 3×3 · לחיצה כפולה על תא להקלדה","mode.annTextSel":"לחצו על הטקסט לעריכה · גררו להזזה · Del להסרה","mode.annTableSel":"לחצו על תא למילוי · גררו להזזה · Del להסרה","mode.annShapeSel":"גררו להזזה · גררו את הידיות לשינוי גודל · שנו סגנון בפאנל · Del להסרה","mode.annEditing":"הקלידו · Enter לאישור · Esc לביטול · או כפתורי ✓ / ✕","mode.escSelect":"Esc מנקה את הבחירה","mode.escOther":"קליק ימני / Esc לביטול","tool.placeNoKindTooltip":"בחרו סוג רכיב בספרייה בצד שמאל, ואז לחצו על הקנבס","tool.undo":"בטל","tool.undoHint":"בטל את הפעולה האחרונה (הזזה / סיבוב / מחיקה וכו׳)","tool.redo":"בצע שוב","tool.redoHint":"בצע שוב את הפעולה האחרונה שבוטלה","layout.label":"פריסה","layout.hint":"פריסה אוטומטית של כל התרשים או רק של הבחירה, ומילוי פערים","layout.allAuto":"פריסה אוטומטית לכל התרשים","layout.selAuto":"פריסה אוטומטית לבחירה","layout.allFill":"מלא רכיבים לא ממוקמים","layout.selFill":"מלא רכיבים לא ממוקמים בבחירה","tool.more":"עוד","tool.moreHint":"בטל / בצע שוב / פריסה","view.menu":"תצוגה","view.menuHint":"זום, התאמה, רשת","ctx.ariaNode":"פעולות על צומת","ctx.ariaWire":"פעולות על תיל","ctx.ariaElement":"פעולות על רכיב","ctx.ariaEdit":"פעולות עריכה","ctx.done":"סיום","ctx.cancel":"ביטול","ctx.rotate":"סובב 90°","ctx.rotateHint":"סובב את הבחירה בכיוון השעון; התילים ינותבו מחדש דרך ההדקים החדשים","ctx.mirror":"שקף אופקית","ctx.mirrorTitle":"שיקוף","ctx.mirrorHint":"הפוך את הבחירה מימין לשמאל","ctx.delete":"מחק","ctx.deleteHintNode":"נתק את כל התילים בצומת זה (הרכיבים נשארים)","ctx.deleteHintWire":"הסר רק את התיל הזה (תילים אחרים באותו צומת נשארים)","ctx.deleteHintElement":"הסר את הבחירה ואת התילים המחוברים אליה","ctx.resetWirePath":"אפס לניתוב אוטומטי","ctx.resetWirePathHint":"הסר פינות ידניות ותן לניתוב האוטומטי לצייר מחדש את התיל","menu.undo":"בטל","menu.redo":"בצע שוב","menu.cut":"גזור","menu.copy":"העתק","menu.paste":"הדבק","menu.rotate":"סובב 90°","menu.mirror":"שיקוף","menu.selectAll":"בחר הכל","menu.disconnect":"נתק תיל זה","menu.delete":"מחק","io.parseFailed":"ניתוח JSON נכשל: {err}","io.notObject":"הקובץ אינו אובייקט JSON","io.versionMismatch":'אי-התאמת גרסה: צפוי "1", התקבל {actual}',"io.elementsMissing":"השדה `elements` חסר או שאינו מערך","compile.duplicateId":'מזהה רכיב כפול: "{id}"',"compile.unknownKind":'סוג רכיב לא ידוע kind="{kind}"',"compile.invalidTermRef":'הפניית הדק לא תקינה "{ref}"',"compile.elementMissing":'הפניה לרכיב לא ידוע "{id}"',"compile.missingPin":'לרכיב "{id}" (kind={kind}) אין הדק "{pin}"; זמינים: {available}',"compile.singleTerminal":"לצומת יש הדק אחד בלבד — הצומת נדחה","compile.layoutMissingElement":'מפתח ה-layout "{id}" מפנה לרכיב לא ידוע',"compile.elementUnconnected":'לרכיב "{id}" אין חיבורים',"cat.busbar":"פס צבירה / חיווט","cat.switching":"מיתוג","cat.protection":"הגנה","cat.motor-control":"בקרת מנועים","cat.transformer":"שנאים","cat.instrument-transformer":"שנאי מדידה","cat.measurement":"מדידה","cat.source":"מקור","cat.load":"עומס","cat.storage":"אגירת אנרגיה","cat.compensation":"פיצוי הספק מגיב","cat.grounding":"הארקה","cat.renewable":"אנרגיה מתחדשת / אלקטרוניקת הספק","onboard.title":"התחלה מהירה","onboard.step1.title":"הציבו רכיב","onboard.step1.body":"בחרו בכלי הצבה (P) וגררו סוג רכיב מהספרייה אל הקנבס","onboard.step2.title":"חברו בתילים","onboard.step2.body":"השתמשו בכלי תיל (W): גררו מהדק אחד לאחר — גרירה לשטח ריק תיצור מחבר","onboard.step3.title":"פס צבירה הוא פס משותף, לא תיל","onboard.step3.body":"השתמשו בכלי פס צבירה (B) רק כשכמה מעגלים חולקים פס אחד. אל תשתמשו בפס צבירה כדי לחבר שני התקנים — פשוט חברו את ההדקים בתיל (W).","onboard.dismiss":"הבנתי"},PS={"arc-suppression-coil.name":"סליל דעיכת קשת","arrester.name":"מגן ברקים (FBL)","async-motor.name":"מנוע אסינכרוני","autotransformer.name":"שנאי אוטו","battery.name":"אגירת מצברים","breaker.name":"מפסק (QF)","busbar.name":"קטע פס צבירה","converter-bidir.name":"ממיר דו-כיווני (PCS)","dc-dc-converter.name":"ממיר DC/DC","mppt.name":"בקר MPPT","ct.name":"שנאי זרם (CT)","disconnector.name":"מנתק (QS)","earth.name":"הארקה","earthing-switch.name":"מפסק הארקה (QE)","fuse.name":"נתיך (FU)","generator.name":"גנרטור (G)","grid-source.name":"מקור הזנה מהרשת","grounding-transformer.name":"שנאי הארקה (זיגזג)","inverter.name":"ממיר (DC→AC)","load-switch.name":"מפסק עומס","load.name":"עומס","luminaire.name":"גוף תאורה (עומס תאורה)","panelboard.name":"לוח חשמל","ngr.name":"נגד הארקת נייטרלי (NGR)","pt.name":"שנאי מתח (PT)","pv.name":"מודול פוטו-וולטאי","rectifier.name":"מיישר (AC→DC)","series-reactor.name":"משרן טורי","shunt-capacitor.name":"קבל מקבילי","shunt-reactor.name":"משרן מקבילי","sync-motor.name":"מנוע סינכרוני","transformer-2w.name":"שנאי דו-סלילי","transformer-3w.name":"שנאי תלת-סלילי","wind-turbine.name":"טורבינת רוח","gfci-breaker.name":"מפסק GFCI (RCBO)","rcd.name":"התקן פחת (RCD)","recloser.name":"מפסק שחזור אוטומטי (Recloser)","energy-meter.name":"מונה אנרגיה (Wh)","voltmeter.name":"וולטמטר (V)","ammeter.name":"אמפרמטר (A)","wattmeter.name":"ואטמטר (W)","frequency-meter.name":"מד תדר (Hz)","contactor.name":"מגען (KM)","motor-starter.name":"מתנע מנוע","thermal-overload.name":"ממסר עומס יתר תרמי","vfd.name":"ממיר תדר (VFD)","soft-starter.name":"מתנע רך","transfer-switch.name":"מתג העברה (ATS)","dc-disconnector.name":"מנתק DC","dc-combiner.name":"תיבת ריכוז DC","ev-charger.name":"עמדת טעינה לרכב חשמלי","arc-suppression-coil.desc":"הארקת נייטרלי תהודתית: סליל לאדמה","busbar.desc":"קטע פס יחיד נמתח עם מספר הסתעפויות","converter-bidir.desc":"ממיר אגירה: דו-כיווני AC ↔ DC","dc-dc-converter.desc":"ממיר DC/DC / מטען DC (IEC 60617)","mppt.desc":"בקר טעינה סולארי MPPT (DC/DC, מעקב אחר נקודת ההספק המרבי)","earthing-switch.desc":"מנתק + חיבור הארקה, יציאה בודדת","grid-source.desc":"פס אינסופי / רשת חיצונית","grounding-transformer.desc":"שנאי כוכב-זיגזג להארקת נייטרלי","load.desc":"עומס מופשט (חץ יציאת זרם)","luminaire.desc":"עומס תאורה (סמל כללי לגוף תאורה לפי IEC 60617)","ngr.desc":"הארקה בהתנגדות נמוכה: נייטרלי השנאי לאדמה","series-reactor.desc":"אותו סמל כמו משרן מקבילי; ההבחנה לפי אופן השימוש","wind-turbine.desc":"טורבינת רוח: גנרטור + סימון רוטור תלת-להב","gfci-breaker.desc":"מפסק פחת עם הגנת זרם יתר (UL943 / IEC 61009). מכונה גם GFCI (צפון אמריקה) או RCBO (אירופה).","rcd.desc":"מפסק פחת ללא הגנת זרם יתר (IEC 61008).","recloser.desc":"מפסק שחזור אוטומטי במתח בינוני.","energy-meter.desc":"מונה אנרגיה פעילה (kWh) — כניסת שירות / מונה משנה.","contactor.desc":"מגען למעגל ראשי; משמש בדרך כלל עם ממסר תרמי ומנוע.","motor-starter.desc":"מתנע מנוע (סמל כללי לפי IEC 60617).","thermal-overload.desc":"ממסר עומס יתר תרמי למנוע; ממוקם בין המגען למנוע.","vfd.desc":"ממיר תדר לבקרת מהירות מנוע אסינכרוני.","soft-starter.desc":"מתנע רך למנוע (הפעלה במתח מופחת מבוססת תיריסטורים).","transfer-switch.desc":"מתג העברה דו-מקורי (ATS / ידני). שני מקורות כניסה ויציאת עומס אחת, עם נעילה הדדית ללא הזנה מקבילה.","dc-disconnector.desc":"מנתק DC — בידוד צד DC של מחרוזות פוטו-וולטאיות / מצברים.","dc-combiner.desc":"תיבת ריכוז מחרוזות פוטו-וולטאיות (דוגמה עם 4 כניסות).","ev-charger.desc":"עמדת טעינה לרכב חשמלי.","breaker.state.open":"פתוח","disconnector.state.open":"פתוח","earthing-switch.state.open":"פתוח","fuse.state.blown":"שרוף","load-switch.state.open":"פתוח","gfci-breaker.state.open":"פתוח","rcd.state.open":"פתוח","recloser.state.open":"פתוח","contactor.state.open":"פתוח","thermal-overload.state.tripped":"הופעל","transfer-switch.state.position":"מצב (רגיל/חירום/כבוי)","dc-disconnector.state.open":"פתוח","battery.param.E":"קיבולת","busbar.param.Un":"מתח נקוב","converter-bidir.param.S":"הספק נקוב","dc-dc-converter.param.P":"הספק","mppt.param.I":"זרם נקוב","load.param.P":"הספק פעיל","load.param.cosphi":"מקדם הספק","ngr.param.R":"התנגדות","shunt-capacitor.param.Q":"הספק מגיב","shunt-capacitor.param.stages":"מדרגות","transformer-2w.param.S":"הספק נקוב","transformer-2w.param.ratio":"יחס תמורה","gfci-breaker.param.In":"זרם נקוב","panelboard.param.In":"זרם נקוב","gfci-breaker.param.IDn":"זרם ניתוק פחת","rcd.param.IDn":"זרם ניתוק פחת","breaker.param.In":"זרם נקוב","breaker.param.poles":"מספר קטבים","breaker.param.Icu":"כושר ניתוק","disconnector.param.In":"זרם נקוב","fuse.param.In":"זרם נקוב","resistor.name":"נגד (R)","capacitor.name":"קבל (C)","diode.name":"דיודה (D)","indicator-light.name":"נורית חיווי (HL)","push-button.name":"לחצן (SB)","relay-coil.name":"סליל ממסר (KA)","make-contact.name":"מגע נורמלי-פתוח (NO)","break-contact.name":"מגע נורמלי-סגור (NC)","bell.name":"פעמון (HA)","terminal.name":"הדק / צומת (X)","fuse-switch-disconnector.name":"מפסק-מנתק עם נתיכים","socket-outlet.name":"שקע / מחבר","inductor.name":"משרן (L)","voltage-regulator.name":"ווסת מתח (T)","dc-motor.name":"מנוע DC (M)","heater.name":"גוף חימום (EH)","selector-switch.name":"מתג בורר (SA)","limit-switch.name":"מפסק גבול (SQ)","proximity-switch.name":"מתג קרבה (SQ)","time-relay.name":"ממסר זמן (KT)","buzzer.name":"זמזם (HA)","siren.name":"צופר (HA)","thermocouple.name":"תרמוזוג (BT)","thyristor.name":"תיריסטור / SCR (V)","triac.name":"טריאק (V)","zener-diode.name":"דיודת זנר (D)","igbt.name":"IGBT","plc.name":"בקר PLC","ups.name":"אל-פסק (UPS)","power-supply.name":"ספק כוח (PS)","genset.name":"קבוצת גנרטור (G)","protective-relay.name":"ממסר הגנה","overcurrent-relay.name":"ממסר זרם יתר (50/51)","undervoltage-relay.name":"ממסר תת-מתח (27)","reverse-power-relay.name":"ממסר הספק הפוך (32)","distance-relay.name":"ממסר מרחק (21)","phase-failure-relay.name":"ממסר כשל פאזה","buchholz-relay.name":"ממסר בוכהולץ (63)","power-factor-meter.name":"מד מקדם הספק (cosφ)","synchronoscope.name":"סינכרונוסקופ","varmeter.name":"מד הספק מגיב (var)","resistor.desc":"נגד כללי / הגבלת זרם / נגד בלימה.","capacitor.desc":"קבל כללי / סינון / פס DC. לשיפור מקדם הספק השתמשו בקבל מקבילי.","diode.desc":"דיודת יישור / דיודת חופש / דיודת הגנה. t1 = אנודה (למעלה), t2 = קתודה (למטה).","indicator-light.desc":"נורית איתות / חיווי מצב.","push-button.desc":"לחצן ידני עם החזרה אוטומטית (מגע נורמלי-פתוח).","relay-coil.desc":"סליל הפעלה של ממסר / מגען (תיבה).","make-contact.desc":"מגע עזר נורמלי-פתוח (סוגר).","break-contact.desc":"מגע עזר נורמלי-סגור (פותח).","bell.desc":"פעמון איתות / פעמון אזעקה.","terminal.desc":"הדק / תיבת חיבורים / צומת חיבור.","fuse-switch-disconnector.desc":"מפסק-מנתק עם נתיכים לניתוק בעומס.","socket-outlet.desc":"שקע חשמל / מחבר רב-קוטבי.","inductor.desc":"משרן כללי / סליל / דעכן.","voltage-regulator.desc":"ווסת מתח אינדוקטיבי / שנאי-אוטו מתכוונן.","dc-motor.desc":"מנוע DC (סמל כללי, עירור טורי).","heater.desc":"גוף חימום נגדי / עומס חימום.","selector-switch.desc":"מתג בורר / מתג החלפה (סיבובי, נשאר במצב).","limit-switch.desc":"מפסק גבול / מיקום (נורמלי-פתוח, הפעלה מכנית).","proximity-switch.desc":"חיישן קרבה / מתג קרבה ללא מגע.","time-relay.desc":"סליל ממסר השהיית זמן (פעולה מושהית).","buzzer.desc":"זמזם איתות.","siren.desc":"צופר / אזעקה קולית.","thermocouple.desc":"חיישן טמפרטורה מסוג תרמוזוג.","thyristor.desc":"תיריסטור טריודה חוסם-הפוך / SCR. t1 = אנודה (למעלה), t2 = קתודה (למטה).","triac.desc":"תיריסטור טריודה דו-כיווני (TRIAC).","zener-diode.desc":"דיודת זנר / ווסת מתח. t1 = אנודה (למעלה), t2 = קתודה (למטה).","igbt.desc":"IGBT מסוג ערוץ-N. t1 = קולקטור (למעלה), t2 = אמיטר (למטה), t_g = שער.","plc.desc":"בקר לוגי מתוכנת (PLC).","ups.desc":"אל-פסק (UPS) מסוג און-ליין / המתנה.","power-supply.desc":"ספק כוח נדסק (AC→DC) / ספק DC. t_ac למעלה (~), t_dc למטה (=).","genset.desc":"קבוצת גנרטור דיזל / גז.","protective-relay.desc":"ממסר מדידה / הגנה, סמל כללי (IEC 60617).","overcurrent-relay.desc":"ממסר הגנת זרם יתר (ANSI 50/51).","undervoltage-relay.desc":"ממסר הגנת תת-מתח (ANSI 27).","reverse-power-relay.desc":"ממסר הגנה בפני הספק הפוך / זרם הפוך (ANSI 32).","distance-relay.desc":"ממסר הגנת מרחק / תת-עכבה (ANSI 21).","phase-failure-relay.desc":"ממסר הגנה בפני כשל פאזה / אובדן פאזה.","buchholz-relay.desc":"ממסר בוכהולץ / ממסר גז (ANSI 63).","power-factor-meter.desc":"מד מקדם הספק (cosφ).","synchronoscope.desc":"מד סנכרון / סינכרונוסקופ.","varmeter.desc":"מד הספק מגיב (var).","make-contact.state.closed":"סגור","break-contact.state.open":"פתוח","fuse-switch-disconnector.state.open":"פתוח","selector-switch.state.open":"פתוח","limit-switch.state.closed":"סגור","resistor.param.R":"התנגדות","resistor.param.P":"הספק נקוב","capacitor.param.C":"קיבול","capacitor.param.Un":"מתח נקוב","indicator-light.param.color":"צבע","inductor.param.L":"השראות","inductor.param.In":"זרם נקוב","voltage-regulator.param.ratio":"טווח ויסות","heater.param.P":"הספק","ups.param.S":"הספק נקוב","power-supply.param.Vdc":"מתח יציאה","genset.param.P":"הספק"},IS={ui:TS,library:PS},ve={es:cS,fr:mS,de:fS,pt:yS,ja:vS,ru:_S,fa:jS,ar:NS,he:IS},yr={zh:{"common.unnamed":"未命名","common.close":"关闭","common.yes":"是","common.no":"否","topbar.theme.toLight":"切换到亮色","topbar.theme.toDark":"切换到暗色","topbar.theme.currentDark":"当前:暗色主题","topbar.theme.currentLight":"当前:亮色主题","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"当前:中文","topbar.export.label":"导出","topbar.export.tooltip":"SVG 矢量(可编辑)、PNG 位图(2× 高清)或 DXF(CAD)","topbar.export.pngFailed":"导出 PNG 失败:{err}","topbar.export.dxfFailed":"导出 DXF 失败:{err}","topbar.file.label":"文件","topbar.file.tooltip":"打开本地 .json 图、保存、或另存为","topbar.file.current":"当前:{name}","topbar.file.new":"新建","topbar.file.open":"打开…","topbar.file.save":"保存","topbar.file.saveAs":"另存为…","topbar.file.newConfirm":"新建会清空当前未保存的内容,是否继续?","topbar.file.openFailed":"打开失败:{err}","topbar.file.saveFailed":"保存失败:{err}","topbar.file.fileDescription":"OneLineEditor 图纸","outline.title":"大纲","outline.collapse":"折叠","outline.collapseAria":"折叠大纲","outline.empty":"(无设备 — 从元件库拖入开始)","props.title":"属性","props.node":"电气节点","props.wire":"连线","props.bus":"母线","props.junction":"接线柱","props.junctionPos":"位置","props.nSelected":"{n} 选中","props.empty":"未选中","props.multi":"已选中 {n} 项","props.name":"名称","props.note":"备注","props.label":"标注","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"电气节点 {id} 不存在","props.wireNotFound":"连线 {id} 不存在","props.nodeStats":"{terminals} 个端子 · {elements} 个元件","props.selectElement":"选中 {label}","props.selectWholeNode":"选中整个电气节点","props.annText":"文字","props.annRect":"矩形","props.annLine":"线条","props.annTable":"表格","props.annNotFound":"标注 {id} 不存在","props.annLabel":"标签","props.annLabelPlaceholder":"如:1#配电柜","props.annStroke":"线型","props.annStrokeSolid":"实线","props.annStrokeDashed":"虚线","props.annFill":"填充","props.annFillNone":"无","props.annFillTint":"浅色","props.annArrow":"箭头","props.annArrowNone":"无","props.annArrowEnd":"单向","props.annArrowBoth":"双向","props.annFontSize":"字号","props.annRows":"行数","props.annCols":"列数","view.zoomOut":"缩小","view.zoomOutHint":"按预设档位缩小;也可滚轮 ↓ 或 ⌘−","view.reset":"重置到 100%","view.current":"当前 {z}%","view.zoomIn":"放大","view.zoomInHint":"按预设档位放大;也可滚轮 ↑ 或 ⌘+","view.fit":"适配视图","view.fitHint":"自动缩放并居中所有元件","view.gridHide":"隐藏网格","view.gridShow":"显示网格","view.gridHotkey":"G","view.gridHideHint":"同时关闭对齐吸附(拖动可自由放置)","view.gridShowHint":"同时开启对齐吸附(拖动会贴到 10px 网格)","view.gridHideAria":"隐藏网格并关闭吸附","view.gridShowAria":"显示网格并开启吸附","view.label":"标签","view.labelOff":"关闭","view.labelId":"仅 ID","view.labelAll":"ID + 参数","view.labelHint":"标签显示方式与字号(同样影响导出与打印)","view.labelSize":"字号","view.labelSizeSmaller":"缩小标签字号","view.labelSizeLarger":"放大标签字号","view.labelSizeReset":"恢复默认字号","library.title":"元件库","library.empty":"没有匹配的元件","library.searchPlaceholder":"搜索元件…","library.searchAria":"搜索元件","library.clearSearch":"清除搜索","library.itemHint":"单击进入放置模式或拖到画布","tool.select":"选择","tool.selectHint":"点选元件,框选多个,或右键打开菜单","tool.pan":"平移","tool.panHint":"拖动画布;空格键可临时切换","tool.wire":"连线","tool.wireHint":"从端子/母线/接线柱拖出;拖到空白处会自动新建接线柱,拖到已有连线上可打接点","tool.bus":"母线","tool.busHint":"画布上拖动一段母线,按下定起点、释放定终点","tool.junction":"接线柱","tool.junctionHint":"点击画布放置一个接线柱(接点),连线可自由连到它","tool.place":"元件","tool.placeHint":"点击画布放置;或从端子/母线拖出,同时放置并连接","tool.text":"文字","tool.textHint":"点击画布放置一段文字注释;双击文字可重新编辑","tool.rect":"矩形","tool.rectHint":"拖动绘制矩形 / 分组框(默认虚线);按住 Shift 画正方形","tool.line":"线条","tool.lineHint":"拖动绘制标注线;按住 Shift 按 45° 约束;箭头在属性面板设置","tool.table":"表格","tool.tableHint":"拖动扫出行列(实时显示 列×行),或单击放置默认表格;双击单元格填写","mode.selectWithSel":"拖动元件移动 · 拖端子连线 · 右键打开菜单","mode.selectEmpty":"点选元件 · 拖动移动 · 框选多个 · 右键打开菜单","mode.pan":"拖动画布 · 滚轮缩放 · 按住空格可在其他工具下临时平移","mode.wireDragging":"拖到端子/母线/接线柱释放;空白处释放会新建接线柱","mode.wireInit":"从任意连接点或空白处按下,拖到目标释放;空白处会新建接线柱","mode.busDragging":"拖动决定母线方向,释放定终点","mode.busInit":"在画布按下定起点,拖动后释放定终点","mode.junction":"点击画布放置一个接线柱","mode.placeNoKind":"从左侧元件库选择一种元件","mode.placeFromTerm":"拖到目标位置释放,新元件将连接到起点端子","mode.placeNormal":"点击空白放置;或从已有端子 / 母线拖出,同时放置并连接","mode.text":"点击画布放置文字;双击已有文字可编辑;选中后可拖动 / 删除","mode.rect":"拖动绘制矩形;Shift 正方形;释放后可拉伸并在属性面板加标签","mode.line":"拖动绘制线条;Shift 按 45° 约束;释放后可在属性面板加箭头","mode.table":"拖动扫出表格行列,或单击放置 3×3 表格;双击单元格填写内容","mode.annTextSel":"单击文字即可编辑 · 拖动移动 · Del 删除","mode.annTableSel":"单击单元格填写内容 · 拖动移动 · Del 删除","mode.annShapeSel":"拖动移动 · 拖动手柄缩放 · 右侧面板改样式 · Del 删除","mode.annEditing":"输入内容 · Enter 确认 · Esc 取消 · 或用 ✓ / ✕ 按钮","mode.escSelect":"Esc 清除选择","mode.escOther":"右键 / Esc 取消","tool.placeNoKindTooltip":"从左侧元件库选择一个元件后点击画布放置","tool.undo":"撤销","tool.undoHint":"撤销上一次编辑(移动 / 旋转 / 删除等)","tool.redo":"重做","tool.redoHint":"重做被撤销的操作","layout.label":"布局","layout.hint":"自动排版整个图或仅选中范围,并填补空缺","layout.allAuto":"重新自动布局","layout.selAuto":"重新自动布局选区","layout.allFill":"填补未排版位置","layout.selFill":"填补未排版选区","tool.more":"更多","tool.moreHint":"撤销 / 重做 / 布局","view.menu":"视图","view.menuHint":"缩放、适配、网格","ctx.ariaNode":"选中节点操作","ctx.ariaWire":"选中连线操作","ctx.ariaElement":"选中元件操作","ctx.ariaEdit":"编辑操作","ctx.done":"完成","ctx.cancel":"取消","ctx.rotate":"旋转 90°","ctx.rotateHint":"顺时针旋转选中元件,连线随端子自动重排","ctx.mirror":"水平镜像","ctx.mirrorTitle":"镜像","ctx.mirrorHint":"左右翻转选中元件","ctx.delete":"删除","ctx.deleteHintNode":"断开此电气节点上的所有连接(保留元件)","ctx.deleteHintWire":"移除这一根连线(其它同节点连线保留)","ctx.deleteHintElement":"移除选中元件及其连接的连线","ctx.resetWirePath":"恢复自动走线","ctx.resetWirePathHint":"清除手动调整的拐点,让连线回到自动路由","menu.undo":"撤销","menu.redo":"重做","menu.cut":"剪切","menu.copy":"复制","menu.paste":"粘贴","menu.rotate":"旋转 90°","menu.mirror":"镜像","menu.selectAll":"全选","menu.disconnect":"断开此连线","menu.delete":"删除","io.parseFailed":"JSON 解析失败:{err}","io.notObject":"文件不是 JSON 对象","io.versionMismatch":'版本不兼容:期望 "1",实际 {actual}',"io.elementsMissing":"elements 字段缺失或不是数组","compile.duplicateId":'元件 ID 重复:"{id}"',"compile.unknownKind":'未知元件类型 kind="{kind}"',"compile.invalidTermRef":'非法端子引用 "{ref}"',"compile.elementMissing":'引用了不存在的元件 "{id}"',"compile.missingPin":'元件 "{id}" (kind={kind}) 没有引脚 "{pin}",可用引脚: {available}',"compile.singleTerminal":"节点只包含一个端子,已忽略","compile.layoutMissingElement":'layout 键 "{id}" 引用了不存在的元件',"compile.elementUnconnected":'元件 "{id}" 没有任何连接',"cat.busbar":"母线 / 接线","cat.switching":"开关","cat.protection":"保护","cat.motor-control":"电机控制","cat.transformer":"变压器","cat.instrument-transformer":"互感器","cat.measurement":"测量仪表","cat.source":"电源","cat.load":"负荷","cat.storage":"储能","cat.compensation":"无功补偿","cat.grounding":"中性点接地","cat.renewable":"新能源 / 电力电子","onboard.title":"上手三步","onboard.step1.title":"放一个器件","onboard.step1.body":"切到 元件 工具(P),从左侧元件库选一种拖到画布","onboard.step2.title":"拉线连接","onboard.step2.body":"用 连线 工具(W)从一个引脚拖到另一个引脚;拖到空白处会自动新建接线柱","onboard.step3.title":"母线是共用排,不是连线","onboard.step3.body":"几条回路共用一排时才用 母线 工具(B)。别拿母线连两个器件——点对点直接拉线(W)就行。","onboard.dismiss":"知道了"},en:{"common.unnamed":"Untitled","common.close":"Close","common.yes":"Yes","common.no":"No","topbar.theme.toLight":"Switch to light","topbar.theme.toDark":"Switch to dark","topbar.theme.currentDark":"Current: dark theme","topbar.theme.currentLight":"Current: light theme","topbar.lang.toEnglish":"Switch to English","topbar.lang.toChinese":"切换到中文","topbar.lang.currentEnglish":"Current: English","topbar.lang.currentChinese":"Current: Chinese","topbar.export.label":"Export","topbar.export.tooltip":"SVG vector (editable), PNG bitmap (2× HiDPI), or DXF (CAD)","topbar.export.pngFailed":"PNG export failed: {err}","topbar.export.dxfFailed":"DXF export failed: {err}","topbar.file.label":"File","topbar.file.tooltip":"Open a local .json diagram, save, or save as","topbar.file.current":"Current: {name}","topbar.file.new":"New","topbar.file.open":"Open…","topbar.file.save":"Save","topbar.file.saveAs":"Save as…","topbar.file.newConfirm":"New will discard any unsaved changes. Continue?","topbar.file.openFailed":"Open failed: {err}","topbar.file.saveFailed":"Save failed: {err}","topbar.file.fileDescription":"OneLineEditor diagram","outline.title":"Outline","outline.collapse":"Collapse","outline.collapseAria":"Collapse outline","outline.empty":"(No elements — drag from the library to start)","props.title":"Properties","props.node":"Electrical node","props.wire":"Wire","props.bus":"Bus","props.junction":"Junction","props.junctionPos":"Position","props.nSelected":"{n} selected","props.empty":"Nothing selected","props.multi":"{n} objects selected","props.name":"Name","props.note":"Note","props.label":"Label","props.labelPlaceholder":"L1 / L2 / L3 / N / PE","props.nodeNotFound":"Electrical node {id} not found","props.wireNotFound":"Wire {id} not found","props.nodeStats":"{terminals} terminals · {elements} elements","props.selectElement":"Select {label}","props.selectWholeNode":"Select whole electrical node","props.annText":"Text","props.annRect":"Rectangle","props.annLine":"Line","props.annTable":"Table","props.annNotFound":"Annotation {id} not found","props.annLabel":"Label","props.annLabelPlaceholder":"e.g. Panel #1","props.annStroke":"Stroke","props.annStrokeSolid":"Solid","props.annStrokeDashed":"Dashed","props.annFill":"Fill","props.annFillNone":"None","props.annFillTint":"Tint","props.annArrow":"Arrows","props.annArrowNone":"None","props.annArrowEnd":"End","props.annArrowBoth":"Both","props.annFontSize":"Font size","props.annRows":"Rows","props.annCols":"Columns","view.zoomOut":"Zoom out","view.zoomOutHint":"Step zoom out; also wheel ↓ or ⌘−","view.reset":"Reset to 100%","view.current":"Current {z}%","view.zoomIn":"Zoom in","view.zoomInHint":"Step zoom in; also wheel ↑ or ⌘+","view.fit":"Fit view","view.fitHint":"Auto-zoom and center all elements","view.gridHide":"Hide grid","view.gridShow":"Show grid","view.gridHotkey":"G","view.gridHideHint":"Also disables snap-to-grid (free placement)","view.gridShowHint":"Also enables snap-to-grid (snaps to 10px on drag)","view.gridHideAria":"Hide grid and disable snap","view.gridShowAria":"Show grid and enable snap","view.label":"Labels","view.labelOff":"Off","view.labelId":"ID","view.labelAll":"ID + params","view.labelHint":"Label visibility and type size (applies to exports too)","view.labelSize":"Size","view.labelSizeSmaller":"Smaller label type","view.labelSizeLarger":"Larger label type","view.labelSizeReset":"Reset label size","library.title":"Library","library.empty":"No matching elements","library.searchPlaceholder":"Search elements…","library.searchAria":"Search elements","library.clearSearch":"Clear search","library.itemHint":"Click to enter place mode, or drag onto the canvas","tool.select":"Select","tool.selectHint":"Click to pick, marquee for multiple, right-click for menu","tool.pan":"Pan","tool.panHint":"Drag the canvas; Space toggles temporarily","tool.wire":"Wire","tool.wireHint":"Drag from a pin/bus/junction; into empty space drops a junction, onto a wire taps it","tool.bus":"Busbar","tool.busHint":"Drag on the canvas — press to set start, release to set end","tool.junction":"Junction","tool.junctionHint":"Click the canvas to drop a junction (node); wires attach to it freely","tool.place":"Place","tool.placeHint":"Click to place; or drag from a terminal/bus to place and connect","tool.text":"Text","tool.textHint":"Click the canvas to drop a text note; double-click an existing one to edit","tool.rect":"Rectangle","tool.rectHint":"Drag to draw a rectangle / group frame (dashed by default); Shift for a square","tool.line":"Line","tool.lineHint":"Drag to draw an annotation line; Shift snaps to 45°; arrows live in the panel","tool.table":"Table","tool.tableHint":"Drag to sweep out cols × rows (live count), or click for a default table; double-click cells to type","mode.selectWithSel":"Drag elements · drag terminals to wire · right-click for menu","mode.selectEmpty":"Click to pick · drag to move · marquee for multiple · right-click for menu","mode.pan":"Drag the canvas · scroll to zoom · hold Space to pan in any tool","mode.wireDragging":"Release on a pin/bus/junction; release in empty space drops a junction","mode.wireInit":"Press on any connection point or empty space, drag to a target and release","mode.busDragging":"Drag sets bus direction; release sets the end","mode.busInit":"Press on the canvas to set start, drag, release to set end","mode.junction":"Click the canvas to drop a junction","mode.placeNoKind":"Pick an element kind from the library on the left","mode.placeFromTerm":"Release at the target — the new element will connect back to the source terminal","mode.placeNormal":"Click empty space to place; or drag from a terminal / bus to place and connect","mode.text":"Click to drop text · double-click to edit · drag selected to move · Del to remove","mode.rect":"Drag to draw a rectangle · Shift for square · resize and label it after release","mode.line":"Drag to draw a line · Shift snaps to 45° · add arrows in the panel after release","mode.table":"Drag to sweep out the grid, or click for a 3×3 table · double-click cells to type","mode.annTextSel":"Click the text to edit · drag to move · Del to remove","mode.annTableSel":"Click a cell to fill it in · drag to move · Del to remove","mode.annShapeSel":"Drag to move · drag handles to resize · restyle in the panel · Del to remove","mode.annEditing":"Type · Enter to confirm · Esc to cancel · or the ✓ / ✕ buttons","mode.escSelect":"Esc clears selection","mode.escOther":"Right-click / Esc to cancel","tool.placeNoKindTooltip":"Pick a kind in the library on the left, then click the canvas","tool.undo":"Undo","tool.undoHint":"Undo the last edit (move / rotate / delete, etc.)","tool.redo":"Redo","tool.redoHint":"Redo the last undone edit","layout.label":"Layout","layout.hint":"Auto-layout the whole diagram or just the selection, fill gaps","layout.allAuto":"Auto-layout all","layout.selAuto":"Auto-layout selection","layout.allFill":"Fill unplaced","layout.selFill":"Fill unplaced in selection","tool.more":"More","tool.moreHint":"Undo / redo / layout","view.menu":"View","view.menuHint":"Zoom, fit, grid","ctx.ariaNode":"Node actions","ctx.ariaWire":"Wire actions","ctx.ariaElement":"Element actions","ctx.ariaEdit":"Editing actions","ctx.done":"Done","ctx.cancel":"Cancel","ctx.rotate":"Rotate 90°","ctx.rotateHint":"Rotate selection clockwise; wires re-route through new terminals","ctx.mirror":"Mirror horizontally","ctx.mirrorTitle":"Mirror","ctx.mirrorHint":"Flip selection left-right","ctx.delete":"Delete","ctx.deleteHintNode":"Disconnect every wire on this node (elements stay)","ctx.deleteHintWire":"Remove only this wire (siblings on the same node stay)","ctx.deleteHintElement":"Remove the selection and its wires","ctx.resetWirePath":"Reset to auto-route","ctx.resetWirePathHint":"Drop manual corners and let the router re-draw this wire","menu.undo":"Undo","menu.redo":"Redo","menu.cut":"Cut","menu.copy":"Copy","menu.paste":"Paste","menu.rotate":"Rotate 90°","menu.mirror":"Mirror","menu.selectAll":"Select all","menu.disconnect":"Disconnect this wire","menu.delete":"Delete","io.parseFailed":"JSON parse failed: {err}","io.notObject":"File is not a JSON object","io.versionMismatch":'Version mismatch: expected "1", got {actual}',"io.elementsMissing":"`elements` is missing or not an array","compile.duplicateId":'Duplicate element id: "{id}"',"compile.unknownKind":'Unknown element kind="{kind}"',"compile.invalidTermRef":'Invalid terminal reference "{ref}"',"compile.elementMissing":'Reference to unknown element "{id}"',"compile.missingPin":'Element "{id}" (kind={kind}) has no pin "{pin}"; available: {available}',"compile.singleTerminal":"Node has only one terminal — ignored","compile.layoutMissingElement":'layout key "{id}" references an unknown element',"compile.elementUnconnected":'Element "{id}" has no connections',"cat.busbar":"Busbar / wiring","cat.switching":"Switching","cat.protection":"Protection","cat.motor-control":"Motor control","cat.transformer":"Transformer","cat.instrument-transformer":"Instrument transformer","cat.measurement":"Measurement","cat.source":"Source","cat.load":"Load","cat.storage":"Storage","cat.compensation":"Compensation","cat.grounding":"Grounding","cat.renewable":"Renewables / power electronics","onboard.title":"Quick start","onboard.step1.title":"Place a component","onboard.step1.body":"Pick the Place tool (P) and drag a kind from the library onto the canvas","onboard.step2.title":"Wire it up","onboard.step2.body":"Use the Wire tool (W): drag from one pin to another — drag into empty space to drop a junction","onboard.step3.title":"A busbar is a shared rail, not a wire","onboard.step3.body":"Use the Busbar tool (B) only when several circuits share one rail. Don't use a bus to join two devices — just wire the pins (W).","onboard.dismiss":"Got it"}},mo={zh:yr.zh,en:yr.en,es:ve.es.ui,fr:ve.fr.ui,de:ve.de.ui,pt:ve.pt.ui,ja:ve.ja.ui,ru:ve.ru.ui,fa:ve.fa.ui,ar:ve.ar.ui,he:ve.he.ui},ea="ole-locale",zS=Object.keys(mo);function xr(e){return zS.includes(e)}function MS(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(ea);if(e&&xr(e))return e}catch{}if(typeof navigator<"u"&&typeof navigator.language=="string"){const e=navigator.language.toLowerCase();if(e.startsWith("zh"))return"zh";const t=e.slice(0,2);if(xr(t))return t}return"en"}function wr(e){try{window.localStorage.setItem(ea,e)}catch{}}const Zt=Tn((e,t)=>({locale:MS(),setLocale:n=>{wr(n),e({locale:n})},toggle:()=>{const n=t().locale==="zh"?"en":"zh";wr(n),e({locale:n})}}));function ta(e,t){return t?e.replace(/\{(\w+)\}/g,(n,o)=>t[o]!==void 0?String(t[o]):`{${o}}`):e}function na(e,t){return mo[e][t]??mo.en[t]??t}function Se(e,t){return ta(na(Zt.getState().locale,e),t)}function se(){const e=Zt(t=>t.locale);return(t,n)=>ta(na(e,t),n)}function oa(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var i;const a=l=>l===null?null:JSON.parse(l,void 0),s=(i=n.getItem(r))!=null?i:null;return s instanceof Promise?s.then(a):a(s)},setItem:(r,i)=>n.setItem(r,JSON.stringify(i,void 0)),removeItem:r=>n.removeItem(r)}}const po=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(o){return po(o)(n)},catch(o){return this}}}catch(n){return{then(o){return this},catch(o){return po(o)(n)}}}},DS=(e,t)=>(n,o,r)=>{let i={storage:oa(()=>window.localStorage),partialize:b=>b,version:0,merge:(b,x)=>({...x,...b}),...t},a=!1,s=0;const l=new Set,c=new Set;let u=i.storage;if(!u)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...b)},o,r);const m=()=>{const b=i.partialize({...o()});return u.setItem(i.name,{state:b,version:i.version})},h=r.setState;r.setState=(b,x)=>(h(b,x),m());const g=e((...b)=>(n(...b),m()),o,r);r.getInitialState=()=>g;let p;const f=()=>{var b,x;if(!u)return;const v=++s;a=!1,l.forEach(T=>{var B;return T((B=o())!=null?B:g)});const P=((x=i.onRehydrateStorage)==null?void 0:x.call(i,(b=o())!=null?b:g))||void 0;return po(u.getItem.bind(u))(i.name).then(T=>{if(T)if(typeof T.version=="number"&&T.version!==i.version){if(i.migrate){const B=i.migrate(T.state,T.version);return B instanceof Promise?B.then(V=>[!0,V]):[!0,B]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,T.state];return[!1,void 0]}).then(T=>{var B;if(v!==s)return;const[V,S]=T;if(p=i.merge(S,(B=o())!=null?B:g),n(p,!0),V)return m()}).then(()=>{v===s&&(P==null||P(o(),void 0),p=o(),a=!0,c.forEach(T=>T(p)))}).catch(T=>{v===s&&(P==null||P(void 0,T))})};return r.persist={setOptions:b=>{i={...i,...b},b.storage&&(u=b.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>f(),hasHydrated:()=>a,onHydrate:b=>(l.add(b),()=>{l.delete(b)}),onFinishHydration:b=>(c.add(b),()=>{c.delete(b)})},i.skipHydration||f(),p||g},RS=DS,Fe=.5;function ra(e){if(e.length<2)return e.map(r=>[r[0],r[1]]);const t=[[e[0][0],e[0][1]]];for(let r=1;r<e.length;r++){const i=t[t.length-1];Math.abs(i[0]-e[r][0])<Fe&&Math.abs(i[1]-e[r][1])<Fe||t.push([e[r][0],e[r][1]])}if(t.length<2)return t;const n=[t[0]];for(let r=1;r<t.length;r++){const i=n[n.length-1],a=t[r],s=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]);if(s>Fe&&l>Fe){const u=(n.length>=2?Math.abs(n[n.length-2][1]-i[1])<Fe?"h":"v":null)==="h"?[a[0],i[1]]:[i[0],a[1]];n.push(u)}n.push(a)}const o=[n[0]];for(let r=1;r<n.length-1;r++){const i=o[o.length-1],a=n[r],s=n[r+1],l=Math.abs(i[0]-a[0])<Fe&&Math.abs(a[0]-s[0])<Fe,c=Math.abs(i[1]-a[1])<Fe&&Math.abs(a[1]-s[1])<Fe;l||c||o.push(a)}return o.push(n[n.length-1]),o}function ia(){return{elements:new Map,buses:new Map,junctions:new Map,terminals:new Map,nodes:new Map,layout:new Map,wireRenders:new Map,terminalToNode:new Map,elementToTerminals:new Map,diagnostics:[]}}function aa(e){return{at:(e==null?void 0:e.at)??[0,0],rot:(e==null?void 0:e.rot)??0,mirror:(e==null?void 0:e.mirror)??!1}}function ho(e){return e===90||e===270?"y":"x"}function De(e,t){let[n,o]=e;switch(t.mirror&&(n=-n),t.rot){case 0:break;case 90:[n,o]=[-o,n];break;case 180:[n,o]=[-n,-o];break;case 270:[n,o]=[o,-n];break}return[n+t.at[0],o+t.at[1]]}const OS={n:"e",e:"s",s:"w",w:"n"},LS={n:"n",s:"s",e:"w",w:"e"};function Lt(e,t){let n=t.mirror?LS[e]:e;const o=t.rot/90|0;for(let r=0;r<o;r++)n=OS[n];return n}function fo(e){switch(e){case"n":return[0,-1];case"s":return[0,1];case"e":return[1,0];case"w":return[-1,0]}}class sa{constructor(){Et(this,"parent",new Map);Et(this,"rank",new Map)}add(t){this.parent.has(t)||(this.parent.set(t,t),this.rank.set(t,0))}find(t){this.add(t);let n=t;for(;this.parent.get(n)!==n;){const o=this.parent.get(n),r=this.parent.get(o);this.parent.set(n,r),n=r}return n}union(t,n){const o=this.find(t),r=this.find(n);if(o===r)return;const i=this.rank.get(o),a=this.rank.get(r);i<a?this.parent.set(o,r):i>a?this.parent.set(r,o):(this.parent.set(r,o),this.rank.set(o,i+1))}groups(){const t=new Map;for(const n of this.parent.keys()){const o=this.find(n),r=t.get(o);r?r.push(n):t.set(o,[n])}return t}}const vr=["n","e","s","w"],kr={n:"s",s:"n",e:"w",w:"e"};function sn(e,t){const n=vr.indexOf(e),r=((vr.indexOf(t)-n)%4+4)%4;return[0,90,180,270][r]}const Xn=320,ln=220,Pt=260,Yn=720,It=30,Sr=30,et=80,_r=10,BS=60,HS=520,FS=80,WS=80,Cr=8,$r=new Set(["source","renewable"]);function qS(e){var ir,ar,sr,lr,cr,dr;const{elements:t,buses:n,junctions:o,wires:r,library:i,userLayout:a,userBusLayout:s}=e,l=new Map(a),c=new Map(s),u=new Map,m=new Set(a.keys()),h=new Set(s.keys()),g=new Map;for(const w of t)g.set(w.id,w);const p=new Map;for(const w of n)p.set(w.id,w);const f=w=>{const k=g.get(w);if(k)return i.get(k.kind)},b=new Set(n.map(w=>w.id)),x=w=>b.has(w),v=new Set(o.map(w=>w.id)),P=new Set(o.filter(w=>{var k;return(k=w.layout)==null?void 0:k.at}).map(w=>w.id)),T=new sa;for(const w of r)T.add(w.ends[0]),T.add(w.ends[1]),T.union(w.ends[0],w.ends[1]);for(const w of t){const k=i.get(w.kind);if(k)for(const C of k.terminals)T.add(`${w.id}.${C.id}`)}for(const w of n)T.add(w.id);const B=[];for(const[,w]of T.groups())w.length>=2&&B.push(w);const V=new Map;for(const w of B)for(const k of w)V.set(k,[w]);const S=new Map;for(const w of B){const k=w.filter(x);if(k.length!==0)for(const C of k){const j=w.filter(_=>_!==C),$=S.get(C)??[];$.push(...j),S.set(C,$)}}{const C=N=>g.has(N)&&!!f(N),j=N=>{if(x(N))return null;if(v.has(N))return N;const A=N.indexOf(".");return A>0?N.slice(0,A):null},$=new Map,_=new Set,E=(N,A)=>{$.has(N)||$.set(N,new Set),$.has(A)||$.set(A,new Set),N!==A&&($.get(N).add(A),$.get(A).add(N))};for(const N of B){const A=[];let D=!1;for(const G of N){if(x(G)){D=!0;continue}const ee=j(G);ee&&A.push(ee)}const O=[...new Set(A)];for(const G of O)$.has(G)||$.set(G,new Set),D&&_.add(G);const q=O.filter(G=>v.has(G)),K=O.filter(G=>!v.has(G));if(q.length>0){for(const G of q)for(const ee of K)E(G,ee);for(let G=0;G<q.length;G++)for(let ee=G+1;ee<q.length;ee++)E(q[G],q[ee])}else for(let G=0;G<K.length;G++)for(let ee=G+1;ee<K.length;ee++)E(K[G],K[ee])}const L=(N,A)=>{const D=f(N);if(!D)return null;for(const O of D.terminals){const q=`${N}.${O.id}`;for(const K of V.get(q)??[])for(const G of K)if(j(G)===A)return O}return null},z=N=>{const A=Y=>{var ne;return((ne=$.get(Y))==null?void 0:ne.size)??0},D=Y=>{var ne;return((ne=f(Y))==null?void 0:ne.category)??""},O=Y=>{const ne=D(Y);return ne==="source"?0:ne==="renewable"?1:2+Math.min(A(Y),9)/10},q=N.filter(C).sort((Y,ne)=>O(Y)-O(ne)||Y.localeCompare(ne))[0];if(!q)return;const K=new Map([[q,null]]),G=new Map([[q,0]]),ee=new Map,te=[],U=[q],X=new Set([q]);for(;U.length;){const Y=U.shift();te.push(Y);for(const ne of[...$.get(Y)??[]].sort((je,Ae)=>je.localeCompare(Ae)))X.has(ne)||(X.add(ne),K.set(ne,Y),G.set(ne,(G.get(Y)??0)+1),ee.has(Y)||ee.set(Y,[]),ee.get(Y).push(ne),U.push(ne))}let Q=0;const pe=new Map,we=Y=>{const ne=ee.get(Y)??[];if(ne.length===0){pe.set(Y,Q++);return}for(const Ae of ne)we(Ae);const je=ne.map(Ae=>pe.get(Ae));pe.set(Y,je.reduce((Ae,rn)=>Ae+rn,0)/je.length)};we(q);for(const Y of te){const ne=ye(Xn+(pe.get(Y)??0)*160),je=ye(ln+(G.get(Y)??0)*140);if(v.has(Y)){u.set(Y,[ne,je]);continue}let Ae=0;const rn=K.get(Y)??null;if(rn){const At=L(Y,rn);At&&(Ae=sn(At.orientation,"n"))}else{const At=(ee.get(Y)??[])[0],ur=At?L(Y,At):null;ur&&(Ae=sn(ur.orientation,"s"))}l.set(Y,{at:[ne,je],rot:Ae,mirror:!1}),m.add(Y)}},M=new Set;for(const N of $.keys()){if(M.has(N))continue;const A=[],D=[N];for(M.add(N);D.length;){const O=D.pop();A.push(O);for(const q of $.get(O)??[])M.has(q)||(M.add(q),D.push(q))}A.length<2||A.some(O=>_.has(O))||A.some(O=>l.has(O)||P.has(O))||A.some(C)&&z(A)}}const H=new Map;for(const w of B){const k=w.filter(x);if(k.length!==0)for(const C of w){if(x(C))continue;const j=C.indexOf(".");if(j<0)continue;const $=C.slice(0,j),_=C.slice(j+1),E=H.get($)??[];for(const L of k)E.some(z=>z.busId===L&&z.pin===_)||E.push({busId:L,pin:_});H.set($,E)}}const F=[],Z=new Set;for(const[w,k]of H)if(new Set(k.map(j=>j.busId)).size>=2){const j=((ar=i.get(((ir=g.get(w))==null?void 0:ir.kind)??""))==null?void 0:ar.category)==="transformer"?"vertical":"horizontal";F.push({elementId:w,attachments:k,orientation:j}),j==="vertical"&&Z.add(w)}const R=new Map,W=(w,k)=>{w!==k&&(R.has(w)||R.set(w,new Set),R.has(k)||R.set(k,new Set),R.get(w).add(k),R.get(k).add(w))};for(const w of r)W(w.ends[0],w.ends[1]);for(const w of t){const k=i.get(w.kind);if(!k||k.terminals.length<2)continue;const C=k.terminals.map(j=>`${w.id}.${j.id}`);for(let j=0;j<C.length;j++)for(let $=j+1;$<C.length;$++)W(C[j],C[$])}for(const w of t){if(Z.has(w.id))continue;const k=i.get(w.kind);if(!k||k.category!=="transformer"||k.terminals.length<2)continue;const C=k.terminals.map(_=>`${w.id}.${_.id}`),j=new Map;for(const _ of C){const E=_.slice(w.id.length+1);j.set(E,new Set);const L=new Set(C.filter(N=>N!==_)),z=new Set([_]),M=[_];for(;M.length>0;){const N=M.shift();if(x(N)){j.get(E).add(N);continue}const A=R.get(N);if(A)for(const D of A)z.has(D)||L.has(D)||(z.add(D),M.push(D))}}const $=new Set;for(const _ of j.values())for(const E of _)$.add(E);if($.size>=2){const _=[];for(const[E,L]of j)for(const z of L)_.push({busId:z,pin:E});F.push({elementId:w.id,attachments:_,orientation:"vertical"}),Z.add(w.id)}}const ie=(w,k)=>{var L;const C=f(k),j=C?C.terminals.map(z=>`${k}.${z.id}`):[],$=w,_=new Set([$,...j]),E=[$];for(;E.length>0;){const z=E.shift(),M=z.indexOf(".");if(M>0){const A=z.slice(0,M),D=g.get(A);if(D){const O=(L=i.get(D.kind))==null?void 0:L.category;if(O&&$r.has(O))return!0}}const N=R.get(z);if(N)for(const A of N)_.has(A)||(_.add(A),E.push(A))}return!1};for(const w of F){if(w.orientation!=="horizontal")continue;const k=new Set(w.attachments.map(j=>j.busId));let C=0;for(const j of k)ie(j,w.elementId)&&C++;C===1&&(w.orientation="vertical",Z.add(w.elementId))}for(const w of t){if(Z.has(w.id)||w.kind!=="breaker")continue;const k=i.get(w.kind);if(!k||k.terminals.length!==2)continue;const C=k.terminals.map(_=>`${w.id}.${_.id}`),j=new Map;for(const _ of C){const E=_.slice(w.id.length+1),L=new Set(C.filter(N=>N!==_)),z=new Set([_]),M=[_];for(;M.length>0;){const N=M.shift();if(x(N)){j.set(E,N);break}const A=R.get(N);if(A)for(const D of A){if(z.has(D)||L.has(D))continue;const O=D.indexOf(".");if(O>0){const q=D.slice(0,O);if(q!==w.id){const K=g.get(q),G=K?i.get(K.kind):void 0;if((G==null?void 0:G.category)==="transformer")continue}}z.add(D),M.push(D)}}}if(new Set(j.values()).size>=2){const _=[];for(const[E,L]of j)_.push({busId:L,pin:E});F.push({elementId:w.id,attachments:_,orientation:"horizontal"})}}const ce=new Map;for(const w of n)ce.set(w.id,new Map);for(const w of F){const k=Array.from(new Set(w.attachments.map(C=>C.busId)));for(const C of k)for(const j of k)C!==j&&((sr=ce.get(C))==null||sr.set(j,w))}const me=w=>{var C;const k=(C=i.get(w))==null?void 0:C.category;return k?$r.has(k):!1},J=[];for(const w of n){const k=S.get(w.id);if(k)for(const C of k){if(x(C))continue;const j=C.indexOf(".");if(j<0)continue;const $=C.slice(0,j),_=g.get($);if(_&&me(_.kind)){J.push(w.id);break}}}J.length===0&&n.length>0&&J.push(n[0].id);const ae=new Map;for(const w of J)ae.set(w,0);{const w=[...J];for(;w.length>0;){const k=w.shift(),C=ae.get(k),j=ce.get(k);if(j)for(const[$,_]of j){if(ae.has($))continue;const E=_.orientation==="horizontal"?C:C+1;ae.set($,E),w.push($)}}}for(const w of n){if(ae.has(w.id))continue;const k=ae.size===0?-1:Math.max(...Array.from(ae.values()));ae.set(w.id,k+1)}const he=new Map;for(const w of n){const k=ae.get(w.id),C=he.get(k)??[];C.push(w.id),he.set(k,C)}const xe=[...he.keys()].sort((w,k)=>w-k),$e=(w,k,C)=>{const j=`${w.elementId}.${C}`,$=k,_=f(w.elementId),E=new Set;if(_)for(const A of _.terminals)A.id!==C&&E.add(`${w.elementId}.${A.id}`);const L=new Set([j]),z=[{ref:j,dist:0}],M=new Map,N=(A,D,O,q)=>{L.add(A),M.set(A,D),z.push({ref:A,dist:q+O})};for(;z.length>0;){const{ref:A,dist:D}=z.shift();if(A===$){const G=M.get($);let ee;if(G){const te=G.indexOf(".");if(te>0){const U=G.slice(0,te);U!==w.elementId&&(ee=U)}}return{extent:D,head:ee}}const O=A.indexOf(".");if(O<0)continue;const q=A.slice(0,O),K=A.slice(O+1);if(!x(q)&&!Z.has(q)){const G=f(q),ee=G==null?void 0:G.terminals.find(te=>te.id===K);if(G&&ee)for(const te of G.terminals){if(te.id===K)continue;const U=`${q}.${te.id}`;L.has(U)||E.has(U)||N(U,A,Math.abs(ee.y-te.y),D)}}for(const G of V.get(A)??[])for(const ee of G){if(ee===A||L.has(ee)||E.has(ee))continue;const te=x(A)||x(ee);N(ee,A,te?Sr:It,D)}}return{extent:0}},Ie=(w,k)=>{var A,D,O;const C=(A=ce.get(w))==null?void 0:A.get(k);if(!C||C.orientation==="horizontal")return Pt;const j=f(C.elementId);if(!j)return Pt;const $=(D=C.attachments.find(q=>q.busId===w))==null?void 0:D.pin,_=(O=C.attachments.find(q=>q.busId===k))==null?void 0:O.pin;if(!$||!_)return Pt;const E=j.terminals.find(q=>q.id===$),L=j.terminals.find(q=>q.id===_);if(!E||!L)return Pt;const z=Math.abs(L.y-E.y),M=$e(C,w,$).extent,N=$e(C,k,_).extent;return M+z+N},Fn=new Map;for(const w of F){if(w.orientation!=="vertical")continue;const k=w.attachments.slice().sort((L,z)=>(ae.get(L.busId)??0)-(ae.get(z.busId)??0));if(k.length<2)continue;const C=k[0].busId,j=k[1].busId,$=k[0].pin,E=$e(w,C,$).head??w.elementId;Fn.set(E,{lowerBusId:j})}const Vo=30,Ko=w=>{const k=f(w);return Math.max((k==null?void 0:k.width)??et,et)},Fk=2,Uo=(w,k,C,j=0)=>{const $=f(k);let _=Ko(k);if($&&!C.has(k)&&j<Fk){C.add(k);let E=0;for(const L of $.terminals){const z=`${k}.${L.id}`;if(z!==w)for(const M of V.get(z)??[]){const N=new Set;let A=!1;for(const O of M){if(O===z)continue;if(x(O)){A=!0;continue}const q=O.indexOf(".");if(q<0)continue;const K=O.slice(0,q);K===k||C.has(K)||Z.has(K)||N.add(K)}if(A||N.size===0)continue;let D=0;for(const O of N){const q=[...M].find(K=>K.indexOf(".")>0&&K.slice(0,K.indexOf("."))===O);D+=(q?Uo(q,O,C,j+1):Ko(O))+Vo}E=Math.max(E,D-Vo)}}C.delete(k),_=Math.max(_,E)}return _},Ct=320,ut=new Map,Xo=(w,k)=>{if(!Z.has(w))return!1;const C=F.find(E=>E.elementId===w),j=C==null?void 0:C.attachments.find(E=>E.busId!==k);if(!j)return!1;const $=ae.get(k)??0;return(ae.get(j.busId)??0)<$},$t=(w,k,C)=>{const j=Fn.get(w);if(j){const _=ut.get(j.lowerBusId);if(_!==void 0)return Math.max(k,_+et)}let $=0;return C&&($=Uo(C,w,new Set)),Math.max(k,et,$)},Yo=(w,k)=>{if(ut.has(w))return ut.get(w);if(k.has(w))return Ct;k.add(w);const C=S.get(w)??[];let j=0,$=0;for(const E of C){if(x(E))continue;const L=E.indexOf(".");if(L<0)continue;const z=E.slice(0,L),M=E.slice(L+1);if(Xo(z,w))continue;const N=f(z);if(!N)continue;const A=N.terminals.find(q=>q.id===M);if(!A)continue;const D=Fn.get(z);D&&Yo(D.lowerBusId,k);const O=$t(z,N.width,`${z}.${M}`);A.y>0?j+=O:$+=O}const _=Math.max(Ct,Math.max(j,$)+et);return ut.set(w,_),k.delete(w),_};for(const w of n)Yo(w.id,new Set);const Ze=new Map,Wk=(w,k,C)=>{const j=f(k);if(!j)return;const $=`${k}.${C}`,_=j.terminals.filter(z=>z.id!==C).map(z=>`${k}.${z.id}`);if(_.length===0)return;const E=new Set([$,..._]),L=_.slice();for(;L.length>0;){const z=L.shift();if(x(z)&&z!==w){const N=c.get(z);return N?N.at[0]:void 0}for(const N of V.get(z)??[])for(const A of N)A===z||E.has(A)||(E.add(A),L.push(A));const M=z.indexOf(".");if(M>0){const N=z.slice(0,M);if(!x(N)){const A=f(N);if(A)for(const D of A.terminals){const O=`${N}.${D.id}`;E.has(O)||(E.add(O),L.push(O))}}}}},qk=w=>{const k=S.get(w);if(!k||k.length===0)return;const C=c.get(w);if(!C)return;const j=k.flatMap(A=>{if(x(A))return[];const D=A.indexOf(".");if(D<0)return[];const O=A.slice(0,D),q=A.slice(D+1);if(l.has(O))return[];if(Xo(O,w))return[];const K=f(O);if(!K)return[];const G=K.terminals.find(ee=>ee.id===q);return G?[{elId:O,lib:K,localTerm:G,isLinker:Z.has(O),busFacingRef:`${O}.${q}`}]:[]});if(j.length===0)return;const $=[],_=[];for(const A of j)A.localTerm.y>0?$.push(A):_.push(A);const E=A=>A.reduce((D,O)=>D+$t(O.elId,O.lib.width,O.busFacingRef),0),L=Math.max(E($),E(_))+et,z=Math.max(C.span,L);z!==C.span&&!h.has(w)&&c.set(w,{...C,span:z});const M=c.get(w),N=(A,D)=>{if(A.length===0)return;const O=new Map;for(const X of A){const Q=Wk(w,X.elId,X.localTerm.id);Q!==void 0&&O.set(X.elId,Q)}A.sort((X,Q)=>{const pe=O.get(X.elId)??M.at[0],we=O.get(Q.elId)??M.at[0];if(pe!==we)return pe-we;const Y=$t(X.elId,X.lib.width,X.busFacingRef);return $t(Q.elId,Q.lib.width,Q.busFacingRef)-Y});const q=A.map(X=>$t(X.elId,X.lib.width,X.busFacingRef)),K=q.reduce((X,Q)=>X+Q,0),G=Math.max(z,K),ee=(G-K)/(A.length+1);let te=M.at[0]-G/2+ee;const U=M.at[1]+D*Sr;for(let X=0;X<A.length;X++){const Q=A[X],pe=q[X],we=te+pe/2;Q.isLinker?Ze.has(Q.elId)||Ze.set(Q.elId,we):l.set(Q.elId,{at:[ye(we-Q.localTerm.x),ye(U-Q.localTerm.y)],rot:0,mirror:!1}),te+=pe+ee}};N($,-1),N(_,1)},Gk=w=>{if(l.has(w.elementId)||w.orientation==="horizontal")return;const k=f(w.elementId);if(!k)return;const C=w.attachments.filter(te=>c.has(te.busId));if(C.length<2)return;const j=C.slice().sort((te,U)=>(ae.get(te.busId)??0)-(ae.get(U.busId)??0)),$=j[0].busId,_=c.get($),E=j[0].pin,L=j[j.length-1].pin,z=k.terminals.find(te=>te.id===E),M=k.terminals.find(te=>te.id===L);if(!z||!M)return;const N=z.y<=M.y?0:180,A=ae.get($)??0,D=C.filter(te=>(ae.get(te.busId)??0)===A),O=[];let q=0;for(const te of D){const U=$e(w,te.busId,te.pin);q=Math.max(q,U.extent);const X=U.head?l.get(U.head):void 0;X?O.push(X.at[0]):Ze.has(w.elementId)?O.push(Ze.get(w.elementId)):O.push(c.get(te.busId).at[0])}let K;O.length>0?K=O.reduce((te,U)=>te+U,0)/O.length:Ze.has(w.elementId)?K=Ze.get(w.elementId):K=_.at[0];const G=_.at[1]+q,ee=N===0?[ye(K-z.x),ye(G-z.y)]:[ye(K+z.x),ye(G+z.y)];if(l.set(w.elementId,{at:ee,rot:N,mirror:!1}),D.length>1){const te=l.get(w.elementId),U=De([z.x,z.y],te),X=Lt(z.orientation,te);Vk(`${w.elementId}.${E}`,U,X,K)}},Vk=(w,k,C,j)=>{const $=new Set([w]);let _=w,E=k,L=C;for(;;){const z=V.get(_)??[];let M,N=!1;for(const ne of z){if(ne.length>=3){N=!0;break}const je=ne.find(Ae=>Ae!==_);if(!(!je||$.has(je))){if(x(je)){N=!0;break}M=je;break}}if(N||!M)break;const A=M.indexOf(".");if(A<0)break;const D=M.slice(0,A),O=M.slice(A+1);if(x(D)||Z.has(D)||l.has(D))break;const q=f(D);if(!q)break;const K=q.terminals.find(ne=>ne.id===O);if(!K)break;const G=fo(L),ee=[E[0]+G[0]*It,E[1]+G[1]*It],te=kr[L],U=sn(K.orientation,te),X=De([K.x,K.y],{at:[0,0],rot:U,mirror:!1}),Q=[ye(j-X[0]),ye(ee[1]-X[1])];l.set(D,{at:Q,rot:U,mirror:!1}),$.add(M);const pe=q.terminals.find(ne=>ne.id!==O);if(!pe)break;const we=`${D}.${pe.id}`;$.add(we);const Y={at:Q,rot:U,mirror:!1};E=De([pe.x,pe.y],Y),L=Lt(pe.orientation,Y),_=we}},Kk=w=>{if(l.has(w.elementId)||w.orientation!=="horizontal")return;const k=f(w.elementId);if(!k)return;const C=w.attachments.filter(D=>c.has(D.busId));if(C.length<2)return;const j=C.map(D=>{const O=$e(w,D.busId,D.pin),q=O.head?l.get(O.head):void 0,K=q?q.at[0]:c.get(D.busId).at[0];return{att:D,x:K,extent:O.extent}});j.sort((D,O)=>D.x-O.x);const $=j[0],_=j[j.length-1],E=k.terminals.find(D=>D.id===$.att.pin),L=k.terminals.find(D=>D.id===_.att.pin);if(!E||!L)return;const z=E.y<=L.y?270:90,M=($.x+_.x)/2,A=c.get($.att.busId).at[1]+Math.max($.extent,_.extent);l.set(w.elementId,{at:[ye(M),ye(A)],rot:z,mirror:!1})},Zo=100;let on=ln;for(let w=0;w<xe.length;w++){const k=xe[w],C=he.get(k);let j;if(w===0)j=ln;else{const _=he.get(xe[w-1]);let E=0;for(const L of _)for(const z of C)(lr=ce.get(L))!=null&&lr.get(z)&&(E=Math.max(E,Ie(L,z)));E===0&&(E=Pt),j=on+E}on=j;let $=Xn;for(const _ of C){if(c.has(_)){on=Math.max(on,c.get(_).at[1]);continue}let E;if(w>0){const z=he.get(xe[w-1]),M=[];for(const N of z){const A=(cr=ce.get(N))==null?void 0:cr.get(_);if(!A||A.orientation!=="vertical")continue;const D=(dr=A.attachments.find(q=>q.busId===N))==null?void 0:dr.pin;if(!D)continue;const O=$e(A,N,D);O.head&&l.has(O.head)?M.push(l.get(O.head).at[0]):Ze.has(A.elementId)?M.push(Ze.get(A.elementId)):M.push(c.get(N).at[0])}M.length>0&&(E=M.reduce((N,A)=>N+A,0)/M.length)}if(E===void 0){const z=ut.get(_)??Yn;E=$+z/2,$+=z+Zo}const L=ut.get(_)??Yn;c.set(_,{at:[ye(E),ye(j)],rot:0,span:L,axis:ho(0)})}for(const _ of C)qk(_);if(w>0)for(const _ of F)l.has(_.elementId)||!_.attachments.some(L=>C.includes(L.busId))||Gk(_);for(const _ of F)_.orientation!=="horizontal"||l.has(_.elementId)||!_.attachments.every(L=>C.includes(L.busId))||Kk(_)}if(n.length===0&&l.size<t.length){const w=$=>{const _=new Set,E=f($);if(!E)return _;for(const L of E.terminals){const z=`${$}.${L.id}`;for(const M of V.get(z)??[])for(const N of M){if(N===z||x(N))continue;const A=N.indexOf(".");if(A<0)continue;const D=N.slice(0,A);D!==$&&_.add(D)}}return _},k=new Set,C=[];for(const $ of t){if(k.has($.id)||!f($.id))continue;const _=[],E=[$.id];for(k.add($.id);E.length>0;){const L=E.pop();_.push(L);for(const z of w(L))k.has(z)||(k.add(z),E.push(z))}_.length>=2&&C.push(_)}let j=Xn;for(const $ of C){if($.some(M=>l.has(M)))continue;$.sort((M,N)=>{var K,G;const A=me(((K=g.get(M))==null?void 0:K.kind)??"")?0:1,D=me(((G=g.get(N))==null?void 0:G.kind)??"")?0:1;if(A!==D)return A-D;const O=w(M).size,q=w(N).size;return O!==q?O-q:M.localeCompare(N)});const _=$[0],E=f(_);if(!E)continue;const L=E.terminals.slice().sort((M,N)=>N.y-M.y)[0],z=L?De([L.x,L.y],{at:[0,0],rot:0,mirror:!1}):[0,0];l.set(_,{at:[ye(j-z[0]),ye(ln-z[1])],rot:0,mirror:!1}),j+=Math.max(Yn,$.length*et)+Zo}}const Uk=w=>{if(x(w))return c.has(w);const k=w.indexOf(".");return k<0?!1:l.has(w.slice(0,k))};let Wn=!0,Xk=t.length+4;for(;Wn&&Xk-- >0;){Wn=!1;for(const w of B){if(w.length<2)continue;const k=[],C=new Map;for(const U of w){if(x(U))continue;const X=U.indexOf(".");if(X<0)continue;const Q=U.slice(0,X),pe=U.slice(X+1);if(l.has(Q)){k.push(U);continue}if(Z.has(Q)||C.has(Q))continue;const we=f(Q);if(!we)continue;const Y=we.terminals.find(ne=>ne.id===pe);Y&&C.set(Q,{ref:U,elId:Q,lib:we,localTerm:Y})}if(C.size===0||k.length===0)continue;const j=[...C.values()],$=new Map;for(const U of j)for(const X of V.get(U.ref)??[])for(const Q of X){if(Q===U.ref||x(Q)||!Uk(Q))continue;const pe=Q;$.set(pe,($.get(pe)??0)+1)}let _;if($.size>0){let U=-1;for(const[X,Q]of $)(Q>U||Q===U&&(_===void 0||X<_))&&(U=Q,_=X)}if(_||(_=[...k].sort()[0]),!_)continue;const E=_.indexOf("."),L=_.slice(0,E),z=_.slice(E+1),M=f(L),N=l.get(L);if(!M||!N)continue;const A=M.terminals.find(U=>U.id===z);if(!A)continue;const D=De([A.x,A.y],N),O=Lt(A.orientation,N),q=fo(O),K=[-q[1],q[0]];j.sort((U,X)=>U.elId.localeCompare(X.elId));const G=j.map(U=>Math.max(U.lib.width,et));let te=-G.reduce((U,X)=>U+X,0)/2;for(let U=0;U<j.length;U++){const X=j[U],Q=G[U],pe=te+Q/2;te+=Q;const we=kr[O],Y=sn(X.localTerm.orientation,we),ne=De([X.localTerm.x,X.localTerm.y],{at:[0,0],rot:Y,mirror:!1}),je=[D[0]+q[0]*It+K[0]*pe,D[1]+q[1]*It+K[1]*pe],Ae=[ye(je[0]-ne[0]),ye(je[1]-ne[1])];l.set(X.elId,{at:Ae,rot:Y,mirror:!1}),Wn=!0}}}const jt=w=>{const k=l.get(w),C=f(w);if(!k||!C)return null;const j=C.viewBox.split(/\s+/).map(Number);if(j.length<4||j.some(A=>Number.isNaN(A))){const A=C.width/2;return{min:k.at[0]-A,max:k.at[0]+A}}const[$,_,E,L]=j,z=[[$,_],[$+E,_],[$,_+L],[$+E,_+L]];let M=1/0,N=-1/0;for(const A of z){const D=De(A,k);M=Math.min(M,D[0]),N=Math.max(N,D[0])}return{min:M,max:N}},qn=w=>{const k=new Set,C=f(w);if(!C)return k;for(const j of C.terminals){const $=`${w}.${j.id}`;for(const _ of V.get($)??[])for(const E of _){if(E===$||x(E))continue;const L=E.indexOf(".");if(L<0)continue;const z=E.slice(0,L);z!==w&&k.add(z)}}return k},Qo=40,Gn=w=>{const k=l.get(w),C=f(w);if(!k||!C)return null;const j=C.viewBox.split(/\s+/).map(Number);if(j.length<4||j.some(A=>Number.isNaN(A))){const A=C.height/2;return{min:k.at[1]-A,max:k.at[1]+A}}const[$,_,E,L]=j,z=[[$,_],[$+E,_],[$,_+L],[$+E,_+L]];let M=1/0,N=-1/0;for(const A of z){const D=De(A,k);M=Math.min(M,D[1]),N=Math.max(N,D[1])}return{min:M,max:N}},Yk=(w,k)=>{const C=new Set,j=[];for(const $ of S.get(w)??[]){if(x($))continue;const _=$.indexOf(".");if(_<0)continue;const E=$.slice(0,_),L=l.get(E);!L||L.at[1]>=k-1||C.has(E)||(C.add(E),j.push(E))}for(;j.length>0;){const $=j.pop();for(const _ of qn($)){if(C.has(_))continue;const E=l.get(_);!E||E.at[1]>=k-1||(C.add(_),j.push(_))}}return C},Jo=(w,k,C)=>{const j=new Set([w]),$=[w];for(;$.length>0;){const _=$.pop();for(const E of qn(_))E===k||j.has(E)||!C.has(E)||(j.add(E),$.push(E))}return j},er=(w,k)=>{let C=w.length*w.length+8,j=!1,$=!0;for(;$&&C-- >0;){$=!1;for(let _=0;_<w.length&&!$;_++)for(let E=_+1;E<w.length;E++){const L=w[_],z=w[E],M=jt(L),N=jt(z),A=Gn(L),D=Gn(z);if(!M||!N||!A||!D)continue;const O=Math.min(M.max,N.max)-Math.max(M.min,N.min),q=Math.min(A.max,D.max)-Math.max(A.min,D.min);if(O<=0||q<=0)continue;const K=Jo(L,z,k),G=Jo(z,L,k);if(K.has(z)||G.has(L))continue;const ee=![...K].some(Y=>m.has(Y)),te=![...G].some(Y=>m.has(Y));if(!ee&&!te)continue;const U=(M.min+M.max)/2,X=(N.min+N.max)/2;let Q,pe;ee&&(!te||K.size<=G.size)?(Q=K,pe=U<=X?-1:1):(Q=G,pe=X<=U?-1:1);const we=ye(pe*(O+Qo));if(we!==0){for(const Y of Q){const ne=l.get(Y);ne&&l.set(Y,{...ne,at:[ne.at[0]+we,ne.at[1]]})}j=!0,$=!0;break}}}return j};for(const w of n){const k=c.get(w.id);if(!k)continue;const C=Yk(w.id,k.at[1]);if(C.size<2)continue;const j=[...C];if(er(j,C)){let _=1/0,E=-1/0;for(const L of j){const z=jt(L);z&&(_=Math.min(_,z.min),E=Math.max(E,z.max))}if(Number.isFinite(_)){const z=j.some(N=>m.has(N))?0:ye(k.at[0]-(_+E)/2);if(z!==0)for(const N of j){const A=l.get(N);A&&l.set(N,{...A,at:[A.at[0]+z,A.at[1]]})}const M=E-_+Qo;if(M>k.span&&!h.has(w.id)){const N=c.get(w.id);c.set(w.id,{...N,span:M})}}}}const tr=()=>{const k=t.map(j=>j.id).filter(j=>l.has(j)).map(j=>({x:jt(j),y:Gn(j)})).filter(j=>j.x&&j.y);let C=0;for(let j=0;j<k.length;j++)for(let $=j+1;$<k.length;$++){const _=Math.min(k[j].x.max,k[$].x.max)-Math.max(k[j].x.min,k[$].x.min),E=Math.min(k[j].y.max,k[$].y.max)-Math.max(k[j].y.min,k[$].y.min);_>1&&E>1&&C++}return C},Zk=tr(),nr=new Map;for(const[w,k]of l)nr.set(w,{...k,at:[...k.at]});const or=new Map;for(const[w,k]of c)or.set(w,{...k,at:[...k.at]});const Vn=120,rr=new Map;{const w=new Map,k=new Map,C=[];for(const $ of n)for(const _ of S.get($.id)??[]){if(x(_))continue;const E=_.indexOf(".");if(E<0)continue;const L=_.slice(0,E);l.has(L)&&C.push({el:L,bus:$.id,d:1})}C.sort(($,_)=>$.d-_.d);let j=0;for(;j<C.length;){const{el:$,bus:_,d:E}=C[j++],L=w.get($);if(L===void 0)w.set($,E),k.set($,_);else if(E===L&&k.get($)!==_){k.set($,null);continue}else continue;for(const z of qn($))l.has(z)&&(w.has(z)||C.push({el:z,bus:_,d:E+1}))}for(const[$,_]of k)_&&rr.set($,_)}for(const w of xe){const k=(he.get(w)??[]).filter(M=>c.has(M));if(k.length<2||k.some(M=>h.has(M)))continue;const C=[];let j=0;for(const M of k){const N=c.get(M),A=[];let D=1/0,O=-1/0;for(const[q,K]of rr){if(K!==M)continue;const G=jt(q);G&&(A.push(q),D=Math.min(D,G.min),O=Math.max(O,G.max))}Number.isFinite(D)||(D=N.at[0]-Ct/2,O=N.at[0]+Ct/2),C.push({busId:M,min:D,max:O,members:A}),j+=O-D}if(C.some(M=>M.members.some(N=>m.has(N))))continue;let $=1/0,_=-1/0;for(const M of C)$=Math.min($,M.min),_=Math.max(_,M.max);const E=_-$,L=j+Vn*(C.length-1);if(!(E>L+Vn))continue;C.sort((M,N)=>(M.min+M.max)/2-(N.min+N.max)/2);let z=$;for(const M of C){const N=ye(z-M.min);if(N!==0){const A=c.get(M.busId);c.set(M.busId,{...A,at:[A.at[0]+N,A.at[1]]});for(const D of M.members){const O=l.get(D);O&&l.set(D,{...O,at:[O.at[0]+N,O.at[1]]})}M.min+=N,M.max+=N}z=M.max+Vn}for(const M of C){const N=c.get(M.busId),A=Math.max(Ct,M.max-M.min);A<N.span&&c.set(M.busId,{...N,span:A})}}{const w=t.map(C=>C.id).filter(C=>l.has(C)),k=new Set(w);er(w,k)}if(tr()>Zk){l.clear();for(const[w,k]of nr)l.set(w,k);c.clear();for(const[w,k]of or)c.set(w,k)}let Kn=0;for(const w of t){if(l.has(w.id))continue;const k=Kn%Cr,C=Math.floor(Kn/Cr);l.set(w.id,{at:[ye(BS+k*FS),ye(HS+C*WS)],rot:0,mirror:!1}),Kn++}return{devices:l,buses:c,junctions:u}}function ye(e){return Math.round(e/_r)*_r}function GS(e,t){const n=e.ends[0],o=e.ends[1],r=jr(n,t),i=jr(o,t);if(r||i){const l=r?n:o,u=Zn(r?o:n,t);if(!u)return null;const m=t.buses.get(l);if(!m)return null;const{axis:h,at:g,span:p}=m.geometry,f=p/2;let b;if(h==="x")b=[kn(u[0],g[0]-f,g[0]+f),g[1]];else{const x=kn(u[1],g[1]-f,g[1]+f);b=[g[0],x]}return{wireId:e.id,path:Er(u,b)}}const a=Zn(n,t),s=Zn(o,t);return!a||!s?null:{wireId:e.id,path:Er(a,s)}}function jr(e,t){return!e.includes(".")&&t.buses.has(e)}function Zn(e,t){if(!e.includes(".")){const o=t.buses.get(e);if(o)return o.geometry.at;const r=t.junctions.get(e);return r?r.world:null}const n=t.terminals.get(e);return n?n.world:null}function Ar(e,t,n){if(!e.includes(".")){const r=n.buses.get(e);if(!r){const u=n.junctions.get(e);return u?[u.world[0],u.world[1]]:null}const{axis:i,at:a,span:s}=r.geometry;if(!t)return[a[0],a[1]];const l=s/2;if(i==="x")return[kn(t[0],a[0]-l,a[0]+l),a[1]];const c=kn(t[1],a[1]-l,a[1]+l);return[a[0],c]}const o=n.terminals.get(e);return o?[o.world[0],o.world[1]]:null}function Er(e,t){return e[0]===t[0]||e[1]===t[1]?[e,t]:[e,[e[0],t[1]],t]}function kn(e,t,n){return e<t?t:e>n?n:e}const la="ammeter",ca="电流表 (A)",da="measurement",ua="-22 -42 44 44",ma=44,pa=44,ha='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-15" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">A</text>',fa=[{id:"t_top",x:0,y:-40,orientation:"n"}],ga={kind:"inline"},VS={id:la,name:ca,category:da,viewBox:ua,width:ma,height:pa,svg:ha,terminals:fa,source:ga},KS=Object.freeze(Object.defineProperty({__proto__:null,category:da,default:VS,height:pa,id:la,name:ca,source:ga,svg:ha,terminals:fa,viewBox:ua,width:ma},Symbol.toStringTag,{value:"Module"})),ba="arc-suppression-coil",ya="消弧线圈",xa="grounding",wa="中性点谐振接地:电感线圈连接到地",va="-12 -32 24 67",ka=24,Sa=67,_a='<line x1="0" y1="-30" x2="0" y2="-12" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -12 A 4 4 0 0 1 0 -4 A 4 4 0 0 1 0 4 A 4 4 0 0 1 0 12" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="20" x2="10" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="24" x2="7" y2="24" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="28" x2="4" y2="28" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="32" x2="1.5" y2="32" fill="none" stroke="black" stroke-width="1"/>',Ca=[{id:"t_top",x:0,y:-30,orientation:"n"}],$a={kind:"inline"},US={id:ba,name:ya,category:xa,description:wa,viewBox:va,width:ka,height:Sa,svg:_a,terminals:Ca,source:$a},XS=Object.freeze(Object.defineProperty({__proto__:null,category:xa,default:US,description:wa,height:Sa,id:ba,name:ya,source:$a,svg:_a,terminals:Ca,viewBox:va,width:ka},Symbol.toStringTag,{value:"Module"})),ja="arrester",Aa="避雷器 (FBL)",Ea="protection",Na="-7 -22 14 44",Ta=14,Pa=44,Ia='<line x1="0" y1="-20" x2="0" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><polygon points="-2,-8 2,-8 0,-2" fill="black" stroke="black" stroke-width="1"/><rect x="-5" y="-10" width="10" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',za=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Ma={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_22/en_60617_07_22_03.elmt",qetEnglishName:"Surge diverter; Lightning arrester"},YS={id:ja,name:Aa,category:Ea,viewBox:Na,width:Ta,height:Pa,svg:Ia,terminals:za,source:Ma},ZS=Object.freeze(Object.defineProperty({__proto__:null,category:Ea,default:YS,height:Pa,id:ja,name:Aa,source:Ma,svg:Ia,terminals:za,viewBox:Na,width:Ta},Symbol.toStringTag,{value:"Module"})),Da="async-motor",Ra="异步电动机",Oa="load",La="-62 -82 64 84",Ba=64,Ha=84,Fa='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">3</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-60" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-80" x2="-10" y2="-53" fill="none" stroke="black" stroke-width="1"/>',Wa=[{id:"t1",x:-50,y:-80,orientation:"n"},{id:"t2",x:-10,y:-80,orientation:"n"},{id:"t3",x:-30,y:-80,orientation:"n"}],qa={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_08/en_60617_06_08_01.elmt",qetEnglishName:"Induction motor, three-phase, squirrel cage"},QS={id:Da,name:Ra,category:Oa,viewBox:La,width:Ba,height:Ha,svg:Fa,terminals:Wa,source:qa},JS=Object.freeze(Object.defineProperty({__proto__:null,category:Oa,default:QS,height:Ha,id:Da,name:Ra,source:qa,svg:Fa,terminals:Wa,viewBox:La,width:Ba},Symbol.toStringTag,{value:"Module"})),Ga="autotransformer",Va="自耦变压器",Ka="transformer",Ua="-62 -112 64 144",Xa=64,Ya=144,Za='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-110" x2="-30" y2="-90" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -30 A 30 60 0 0 0 -30 -90" fill="none" stroke="black" stroke-width="1"/>',Qa=[{id:"t1",x:-30,y:-110,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],Ja={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_06.elmt",qetEnglishName:"Auto-transformer, general symbol"},e_={id:Ga,name:Va,category:Ka,viewBox:Ua,width:Xa,height:Ya,svg:Za,terminals:Qa,source:Ja},t_=Object.freeze(Object.defineProperty({__proto__:null,category:Ka,default:e_,height:Ya,id:Ga,name:Va,source:Ja,svg:Za,terminals:Qa,viewBox:Ua,width:Xa},Symbol.toStringTag,{value:"Module"})),es="battery",ts="电池储能",ns="storage",os="-12 -12 29 24",rs=29,is=24,as='<line x1="-10" y1="0" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-5" x2="0" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-10" x2="5" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="0" x2="15" y2="0" fill="none" stroke="black" stroke-width="1"/>',ss=[{id:"t_left",x:-10,y:0,orientation:"w"},{id:"t_right",x:15,y:0,orientation:"e"}],ls=[{name:"E",label:"容量",type:"number",unit:"kWh"}],cs={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_15/en_60617_06_15_01.elmt",qetEnglishName:"Battery cell"},n_={id:es,name:ts,category:ns,viewBox:os,width:rs,height:is,svg:as,terminals:ss,params:ls,source:cs},o_=Object.freeze(Object.defineProperty({__proto__:null,category:ns,default:n_,height:is,id:es,name:ts,params:ls,source:cs,svg:as,terminals:ss,viewBox:os,width:rs},Symbol.toStringTag,{value:"Module"})),ds="bell",us="电铃 (HA)",ms="control",ps="信号电铃 / 警铃。",hs="-32 -32 44 44",fs=44,gs=44,bs='<line x1="-30" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -10 A 20 20 0 0 0 -30 -10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/>',ys=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],xs={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_06.elmt",qetEnglishName:"Bell"},r_={id:ds,name:us,category:ms,description:ps,viewBox:hs,width:fs,height:gs,svg:bs,terminals:ys,source:xs},i_=Object.freeze(Object.defineProperty({__proto__:null,category:ms,default:r_,description:ps,height:gs,id:ds,name:us,source:xs,svg:bs,terminals:ys,viewBox:hs,width:fs},Symbol.toStringTag,{value:"Module"})),ws="break-contact",vs="常闭触点 (NC)",ks="control",Ss="常闭辅助触点 (break contact)。",_s="-2 -42 14 64",Cs=14,$s=64,js='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/>',As=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Es=[{name:"open",type:"boolean",default:!1,label:"断开"}],Ns={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_02/en_60617_07_02_03.elmt",qetEnglishName:"Break contact"},a_={id:ws,name:vs,category:ks,description:Ss,viewBox:_s,width:Cs,height:$s,svg:js,terminals:As,state:Es,source:Ns},s_=Object.freeze(Object.defineProperty({__proto__:null,category:ks,default:a_,description:Ss,height:$s,id:ws,name:vs,source:Ns,state:Es,svg:js,terminals:As,viewBox:_s,width:Cs},Symbol.toStringTag,{value:"Module"})),Ts="breaker",Ps="断路器 (QF)",Is="switching",zs="-7 -22 15 46",Ms=15,Ds=46,Rs='<polyline points="0,20 0,10 -5,-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-8" x2="-2" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/>',Os='<text x="2" y="-10.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">1</text><text x="3" y="21.2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">2</text>',Ls=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Bs=[{name:"open",type:"boolean",default:!1,label:"断开"}],Hs=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"poles",label:"极数",type:"number",unit:"P",showOnCanvas:!0},{name:"Icu",label:"分断能力",type:"number",unit:"kA",showOnCanvas:!0}],Fs={x:6,y:-2,anchor:"start"},Ws={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/11_circuit_breakers/disjoncteur1.elmt",qetEnglishName:"Circuit-breaker"},l_={id:Ts,name:Ps,category:Is,viewBox:zs,width:Ms,height:Ds,svg:Rs,terminalLabelsSvg:Os,terminals:Ls,state:Bs,params:Hs,label:Fs,source:Ws},c_=Object.freeze(Object.defineProperty({__proto__:null,category:Is,default:l_,height:Ds,id:Ts,label:Fs,name:Ps,params:Hs,source:Ws,state:Bs,svg:Rs,terminalLabelsSvg:Os,terminals:Ls,viewBox:zs,width:Ms},Symbol.toStringTag,{value:"Module"})),qs="buchholz-relay",Gs="瓦斯继电器 (63)",Vs="protection",Ks="瓦斯 / 气体继电器 (Buchholz, ANSI 63)。",Us="-22 -62 44 64",Xs=44,Ys=64,Zs='<rect x="-20" y="-60" width="40" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-5" y="-20" width="10" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-20" x2="10" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-55" x2="0" y2="-50" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -50 A 10 5 0 0 0 0 -40" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -40 A 10 5 0 0 0 0 -50" fill="none" stroke="black" stroke-width="1"/>',Qs=[{id:"t_top",x:0,y:-60,orientation:"n"}],Js={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_18/en_60617_07_18_01.elmt",qetEnglishName:"Buchholz protective device; Gas relay"},d_={id:qs,name:Gs,category:Vs,description:Ks,viewBox:Us,width:Xs,height:Ys,svg:Zs,terminals:Qs,source:Js},u_=Object.freeze(Object.defineProperty({__proto__:null,category:Vs,default:d_,description:Ks,height:Ys,id:qs,name:Gs,source:Js,svg:Zs,terminals:Qs,viewBox:Us,width:Xs},Symbol.toStringTag,{value:"Module"})),el="busbar",tl="母线段",nl="busbar",ol="可拉伸单母线段,多设备挂接",rl="-42 -4 84 8",il=84,al=8,sl='<line x1="-40" y1="0" x2="40" y2="0" stroke="black" stroke-width="3" stroke-linecap="round" fill="none"/>',ll=[{id:"tap",x:0,y:0,orientation:"n"}],cl={axis:"x",minLength:20,naturalSpan:80},dl=[{name:"Un",label:"额定电压",type:"number",unit:"kV",showOnCanvas:!0}],ul={x:0,y:-6,anchor:"middle"},ml={kind:"inline"},m_={id:el,name:tl,category:nl,description:ol,viewBox:rl,width:il,height:al,svg:sl,terminals:ll,stretchable:cl,params:dl,label:ul,source:ml},p_=Object.freeze(Object.defineProperty({__proto__:null,category:nl,default:m_,description:ol,height:al,id:el,label:ul,name:tl,params:dl,source:ml,stretchable:cl,svg:sl,terminals:ll,viewBox:rl,width:il},Symbol.toStringTag,{value:"Module"})),pl="buzzer",hl="蜂鸣器 (HA)",fl="control",gl="信号蜂鸣器。",bl="-32 -52 44 64",yl=44,xl=64,wl='<line x1="-30" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><path d="M -30 -30 A 20 20 0 0 0 10 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-12" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-12" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/>',vl=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],kl={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_10.elmt",qetEnglishName:"Buzzer"},h_={id:pl,name:hl,category:fl,description:gl,viewBox:bl,width:yl,height:xl,svg:wl,terminals:vl,source:kl},f_=Object.freeze(Object.defineProperty({__proto__:null,category:fl,default:h_,description:gl,height:xl,id:pl,name:hl,source:kl,svg:wl,terminals:vl,viewBox:bl,width:yl},Symbol.toStringTag,{value:"Module"})),Sl="capacitor",_l="电容 (C)",Cl="passive",$l="通用 / 滤波 / 直流母线电容。无功补偿请用并联电容器。",jl="-7 -23 14 27",Al=14,El=27,Nl='<line x1="-5" y1="2" x2="5" y2="2" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-2" x2="5" y2="-2" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-2" fill="none" stroke="black" stroke-width="1"/>',Tl=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t_bottom",x:0,y:2,orientation:"s"}],Pl=[{name:"C",label:"容值",type:"number",unit:"μF",showOnCanvas:!0},{name:"Un",label:"额定电压",type:"number",unit:"V"}],Il={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/20_capacitors/capacite.elmt",qetEnglishName:"Capacitor"},g_={id:Sl,name:_l,category:Cl,description:$l,viewBox:jl,width:Al,height:El,svg:Nl,terminals:Tl,params:Pl,source:Il},b_=Object.freeze(Object.defineProperty({__proto__:null,category:Cl,default:g_,description:$l,height:El,id:Sl,name:_l,params:Pl,source:Il,svg:Nl,terminals:Tl,viewBox:jl,width:Al},Symbol.toStringTag,{value:"Module"})),zl="contactor",Ml="接触器 (KM)",Dl="motor-control",Rl="主回路接触器, 通常配热继电器和电机使用。",Ol="-10 -42 15 64",Ll=15,Bl=64,Hl='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><path d="M 0 -24.5 A 2.5 2.5 0 0 0 0 -19.5" fill="none" stroke="black" stroke-width="1"/>',Fl=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Wl=[{name:"open",type:"boolean",default:!0,label:"断开"}],ql={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_02.elmt",qetEnglishName:"Contactor; Main make contact of a contactor"},y_={id:zl,name:Ml,category:Dl,description:Rl,viewBox:Ol,width:Ll,height:Bl,svg:Hl,terminals:Fl,state:Wl,source:ql},x_=Object.freeze(Object.defineProperty({__proto__:null,category:Dl,default:y_,description:Rl,height:Bl,id:zl,name:Ml,source:ql,state:Wl,svg:Hl,terminals:Fl,viewBox:Ol,width:Ll},Symbol.toStringTag,{value:"Module"})),Gl="converter-bidir",Vl="双向变流器 (PCS)",Kl="renewable",Ul="储能变流器:双向 AC ↔ DC",Xl="-42 -42 44 48",Yl=44,Zl=48,Ql='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-6" x2="-14" y2="-6" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-6" x2="-4" y2="-6" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/><polyline points="-28,-4 -32,0 -28,4" fill="none" stroke="black" stroke-width="1"/><polyline points="-16,-4 -12,0 -16,4" fill="none" stroke="black" stroke-width="1"/>',Jl=[{id:"t_ac",x:-20,y:-40,orientation:"n"},{id:"t_dc",x:-20,y:0,orientation:"s"}],ec=[{name:"S",label:"容量",type:"number",unit:"MVA"}],tc={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_06.elmt",qetEnglishName:"Rectifier/inverter"},w_={id:Gl,name:Vl,category:Kl,description:Ul,viewBox:Xl,width:Yl,height:Zl,svg:Ql,terminals:Jl,params:ec,source:tc},v_=Object.freeze(Object.defineProperty({__proto__:null,category:Kl,default:w_,description:Ul,height:Zl,id:Gl,name:Vl,params:ec,source:tc,svg:Ql,terminals:Jl,viewBox:Xl,width:Yl},Symbol.toStringTag,{value:"Module"})),nc="ct",oc="电流互感器 (CT)",rc="instrument-transformer",ic="-42 -62 54 64",ac=54,sc=64,lc='<line x1="-30" y1="-60" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-30" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-20" x2="5" y2="-40" fill="none" stroke="black" stroke-width="1"/>',cc=[{id:"t1",x:-30,y:-60,orientation:"n"},{id:"t2",x:-30,y:0,orientation:"s"}],dc={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_10.elmt",qetEnglishName:"Current transformer, general symbol"},k_={id:nc,name:oc,category:rc,viewBox:ic,width:ac,height:sc,svg:lc,terminals:cc,source:dc},S_=Object.freeze(Object.defineProperty({__proto__:null,category:rc,default:k_,height:sc,id:nc,name:oc,source:dc,svg:lc,terminals:cc,viewBox:ic,width:ac},Symbol.toStringTag,{value:"Module"})),uc="dc-combiner",mc="直流汇流箱",pc="renewable",hc="光伏组串汇流箱 (4 路输入示例)。",fc="-27 -32 54 64",gc=54,bc=64,yc='<rect x="-25" y="-15" width="50" height="30" fill="none" stroke="black" stroke-width="1"/><line x1="-18" y1="-30" x2="-18" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="-6" y1="-30" x2="-6" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-30" x2="6" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="18" y1="-30" x2="18" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><text x="-9" y="5" font-family="Liberation Sans, Arial, sans-serif" font-size="7" fill="#000000">DC</text>',xc=[{id:"t_s1",x:-18,y:-30,orientation:"n"},{id:"t_s2",x:-6,y:-30,orientation:"n"},{id:"t_s3",x:6,y:-30,orientation:"n"},{id:"t_s4",x:18,y:-30,orientation:"n"},{id:"t_dc",x:0,y:30,orientation:"s"}],wc={kind:"inline"},__={id:uc,name:mc,category:pc,description:hc,viewBox:fc,width:gc,height:bc,svg:yc,terminals:xc,source:wc},C_=Object.freeze(Object.defineProperty({__proto__:null,category:pc,default:__,description:hc,height:bc,id:uc,name:mc,source:wc,svg:yc,terminals:xc,viewBox:fc,width:gc},Symbol.toStringTag,{value:"Module"})),vc="dc-dc-converter",kc="DC/DC 变换器",Sc="renewable",_c="DC/DC 变换器 / 直流充电器(IEC 60617)",Cc="-42 -42 44 44",$c=44,jc=44,Ac='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/>',Ec=[{id:"t_in",x:-20,y:-40,orientation:"n"},{id:"t_out",x:-20,y:0,orientation:"s"}],Nc=[{name:"P",label:"功率",type:"number",unit:"kW"}],Tc={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_02.elmt",qetEnglishName:"DC/DC converter"},$_={id:vc,name:kc,category:Sc,description:_c,viewBox:Cc,width:$c,height:jc,svg:Ac,terminals:Ec,params:Nc,source:Tc},j_=Object.freeze(Object.defineProperty({__proto__:null,category:Sc,default:$_,description:_c,height:jc,id:vc,name:kc,params:Nc,source:Tc,svg:Ac,terminals:Ec,viewBox:Cc,width:$c},Symbol.toStringTag,{value:"Module"})),Pc="dc-disconnector",Ic="直流隔离开关",zc="switching",Mc="DC isolating switch — 光伏组串 / 储能 直流侧隔离。",Dc="-12 -32 30 64",Rc=30,Oc=64,Lc='<line x1="0" y1="-30" x2="0" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-15" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-4" x2="14" y2="-4" stroke="black" stroke-width="1" fill="none"/><line x1="6" y1="-1" x2="9" y2="-1" stroke="black" stroke-width="0.8" fill="none"/><line x1="11" y1="-1" x2="14" y2="-1" stroke="black" stroke-width="0.8" fill="none"/>',Bc=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Hc=[{name:"open",type:"boolean",default:!1,label:"断开"}],Fc={kind:"inline"},A_={id:Pc,name:Ic,category:zc,description:Mc,viewBox:Dc,width:Rc,height:Oc,svg:Lc,terminals:Bc,state:Hc,source:Fc},E_=Object.freeze(Object.defineProperty({__proto__:null,category:zc,default:A_,description:Mc,height:Oc,id:Pc,name:Ic,source:Fc,state:Hc,svg:Lc,terminals:Bc,viewBox:Dc,width:Rc},Symbol.toStringTag,{value:"Module"})),Wc="dc-motor",qc="直流电机 (M)",Gc="load",Vc="直流电动机 (串励通用符号)。",Kc="-72 -82 89 84",Uc=89,Xc=84,Yc='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-40" y1="-20" x2="-20" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-15" x2="-32" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-29" y1="-15" x2="-20" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-70" y1="-80" x2="-70" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-70" y1="-30" x2="-60" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="10" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="10" y1="-30" x2="10" y2="-50" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -60 A 5 5 0 0 0 10 -50" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -70 A 5 5 0 0 0 10 -60" fill="none" stroke="black" stroke-width="1"/><path d="M 10 -80 A 5 5 0 0 0 10 -70" fill="none" stroke="black" stroke-width="1"/>',Zc=[{id:"t1",x:-70,y:-80,orientation:"n"},{id:"t2",x:10,y:-80,orientation:"n"}],Qc={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_05/en_60617_06_05_01.elmt",qetEnglishName:"Series motor, DC"},N_={id:Wc,name:qc,category:Gc,description:Vc,viewBox:Kc,width:Uc,height:Xc,svg:Yc,terminals:Zc,source:Qc},T_=Object.freeze(Object.defineProperty({__proto__:null,category:Gc,default:N_,description:Vc,height:Xc,id:Wc,name:qc,source:Qc,svg:Yc,terminals:Zc,viewBox:Kc,width:Uc},Symbol.toStringTag,{value:"Module"})),Jc="diode",ed="二极管 (D)",td="passive",nd="整流 / 续流 / 保护二极管。t1=阳极(上), t2=阴极(下)。",od="-12 -42 24 44",rd=24,id=44,ad='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/>',sd=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],ld={x:6,y:-20,anchor:"start"},cd={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_01.elmt",qetEnglishName:"Semiconductor diode, general symbol"},P_={id:Jc,name:ed,category:td,description:nd,viewBox:od,width:rd,height:id,svg:ad,terminals:sd,label:ld,source:cd},I_=Object.freeze(Object.defineProperty({__proto__:null,category:td,default:P_,description:nd,height:id,id:Jc,label:ld,name:ed,source:cd,svg:ad,terminals:sd,viewBox:od,width:rd},Symbol.toStringTag,{value:"Module"})),dd="disconnector",ud="隔离开关 (QS)",md="switching",pd="-10 -42 15 64",hd=15,fd=64,gd='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-3" y1="-20" x2="3" y2="-20" fill="none" stroke="black" stroke-width="1"/>',bd=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],yd=[{name:"open",type:"boolean",default:!1,label:"断开"}],xd=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],wd={x:6,y:-10,anchor:"start"},vd={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_06.elmt",qetEnglishName:"Disconnector; Isolator"},z_={id:dd,name:ud,category:md,viewBox:pd,width:hd,height:fd,svg:gd,terminals:bd,state:yd,params:xd,label:wd,source:vd},M_=Object.freeze(Object.defineProperty({__proto__:null,category:md,default:z_,height:fd,id:dd,label:wd,name:ud,params:xd,source:vd,state:yd,svg:gd,terminals:bd,viewBox:pd,width:hd},Symbol.toStringTag,{value:"Module"})),kd="distance-relay",Sd="距离继电器 (21)",_d="protection",Cd="距离 / 低阻抗保护继电器 (ANSI 21)。",$d="-62 -42 64 44",jd=64,Ad=44,Ed='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-42" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Z &lt;</text>',Nd=[{id:"t_top",x:-30,y:-40,orientation:"n"}],Td={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_09.elmt",qetEnglishName:"Under-impedance relay"},D_={id:kd,name:Sd,category:_d,description:Cd,viewBox:$d,width:jd,height:Ad,svg:Ed,terminals:Nd,source:Td},R_=Object.freeze(Object.defineProperty({__proto__:null,category:_d,default:D_,description:Cd,height:Ad,id:kd,name:Sd,source:Td,svg:Ed,terminals:Nd,viewBox:$d,width:jd},Symbol.toStringTag,{value:"Module"})),Pd="earth",Id="接地",zd="busbar",Md="-12 -17 24 34",Dd=24,Rd=34,Od='<line x1="-10" y1="0" x2="10" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-15" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="5" x2="7" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="10" x2="4" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0.5" y1="15" x2="-0.5" y2="15" fill="none" stroke="black" stroke-width="1"/>',Ld=[{id:"t1",x:0,y:-15,orientation:"n"}],Bd={kind:"elmt",path:"91_en_60617/en_60617_02/en_60617_02_15/en_60617_02_15_01.elmt",qetEnglishName:"Earth or ground, general symbol"},O_={id:Pd,name:Id,category:zd,viewBox:Md,width:Dd,height:Rd,svg:Od,terminals:Ld,source:Bd},L_=Object.freeze(Object.defineProperty({__proto__:null,category:zd,default:O_,height:Rd,id:Pd,name:Id,source:Bd,svg:Od,terminals:Ld,viewBox:Md,width:Dd},Symbol.toStringTag,{value:"Module"})),Hd="earthing-switch",Fd="接地刀闸 (QE)",Wd="switching",qd="隔离开关 + 接地连接,单端口",Gd="-12 -32 24 64",Vd=24,Kd=64,Ud='<line x1="0" y1="-30" x2="0" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="-12" x2="-9" y2="9" stroke="black" stroke-width="1" fill="none"/><line x1="-3" y1="-12" x2="3" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-10" y1="14" x2="10" y2="14" stroke="black" stroke-width="1" fill="none"/><line x1="-7" y1="19" x2="7" y2="19" stroke="black" stroke-width="1" fill="none"/><line x1="-4" y1="24" x2="4" y2="24" stroke="black" stroke-width="1" fill="none"/><line x1="-1.5" y1="29" x2="1.5" y2="29" stroke="black" stroke-width="1" fill="none"/>',Xd=[{id:"t_top",x:0,y:-30,orientation:"n"}],Yd=[{name:"open",type:"boolean",default:!0,label:"断开"}],Zd={x:12,y:-8,anchor:"start"},Qd={kind:"inline"},B_={id:Hd,name:Fd,category:Wd,description:qd,viewBox:Gd,width:Vd,height:Kd,svg:Ud,terminals:Xd,state:Yd,label:Zd,source:Qd},H_=Object.freeze(Object.defineProperty({__proto__:null,category:Wd,default:B_,description:qd,height:Kd,id:Hd,label:Zd,name:Fd,source:Qd,state:Yd,svg:Ud,terminals:Xd,viewBox:Gd,width:Vd},Symbol.toStringTag,{value:"Module"})),Jd="energy-meter",eu="电能表 (Wh)",tu="measurement",nu="有功电能表 (kWh) — 服务入口 / 子表。",ou="-22 -36 44 72",ru=44,iu=72,au='<text x="-10" y="19.2" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Wh</text><rect x="-20" y="-10" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><rect x="-20" y="-30" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',su=[{id:"t1",x:0,y:-34,orientation:"n"},{id:"t2",x:0,y:34,orientation:"s"}],lu={kind:"elmt",path:"11_singlepole/500_home_installation/40_meters/wattheuremetre_08-04-03_en60617.elmt",qetEnglishName:"Watt hour meter (en_60617)"},F_={id:Jd,name:eu,category:tu,description:nu,viewBox:ou,width:ru,height:iu,svg:au,terminals:su,source:lu},W_=Object.freeze(Object.defineProperty({__proto__:null,category:tu,default:F_,description:nu,height:iu,id:Jd,name:eu,source:lu,svg:au,terminals:su,viewBox:ou,width:ru},Symbol.toStringTag,{value:"Module"})),cu="ev-charger",du="EV 充电桩",uu="load",mu="电动汽车充电站 / 充电桩。",pu="-17 -27 34 49",hu=34,fu=49,gu='<line x1="0" y1="-25" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-15" y="-15" width="30" height="35" fill="none" stroke="black" stroke-width="1"/><rect x="-9" y="-8" width="14" height="6" fill="none" stroke="black" stroke-width="0.8"/><rect x="5" y="-7" width="2" height="4" fill="black"/><text x="-9" y="13" font-family="Liberation Sans, Arial, sans-serif" font-size="7" fill="#000000">EV</text>',bu=[{id:"t_top",x:0,y:-25,orientation:"n"}],yu={kind:"inline"},q_={id:cu,name:du,category:uu,description:mu,viewBox:pu,width:hu,height:fu,svg:gu,terminals:bu,source:yu},G_=Object.freeze(Object.defineProperty({__proto__:null,category:uu,default:q_,description:mu,height:fu,id:cu,name:du,source:yu,svg:gu,terminals:bu,viewBox:pu,width:hu},Symbol.toStringTag,{value:"Module"})),xu="frequency-meter",wu="频率表 (Hz)",vu="measurement",ku="-22 -42 44 44",Su=44,_u=44,Cu='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">Hz</text>',$u=[{id:"t_top",x:0,y:-40,orientation:"n"}],ju={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_07.elmt",qetEnglishName:"Frequency meter"},V_={id:xu,name:wu,category:vu,viewBox:ku,width:Su,height:_u,svg:Cu,terminals:$u,source:ju},K_=Object.freeze(Object.defineProperty({__proto__:null,category:vu,default:V_,height:_u,id:xu,name:wu,source:ju,svg:Cu,terminals:$u,viewBox:ku,width:Su},Symbol.toStringTag,{value:"Module"})),Au="fuse-switch-disconnector",Eu="熔断器式隔离开关",Nu="switching",Tu="负荷型熔断器隔离开关 (on-load fuse switch-disconnector)。",Pu="-8 -32 12 64",Iu=12,zu=64,Mu='<line x1="0" y1="30" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="-5" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-13" x2="0" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-3" y1="6" x2="-6" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-6" x2="1" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="5" x2="-3" y2="6" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-6" x2="-6" y2="-5" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-11" rx="1" ry="1" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-13" x2="2" y2="-13" fill="none" stroke="black" stroke-width="1"/>',Du=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Ru=[{name:"open",type:"boolean",default:!1,label:"断开"}],Ou={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_21/en_60617_07_21_09.elmt",qetEnglishName:"Fuse switch-disconnector; On-load isolating fuse switch"},U_={id:Au,name:Eu,category:Nu,description:Tu,viewBox:Pu,width:Iu,height:zu,svg:Mu,terminals:Du,state:Ru,source:Ou},X_=Object.freeze(Object.defineProperty({__proto__:null,category:Nu,default:U_,description:Tu,height:zu,id:Au,name:Eu,source:Ou,state:Ru,svg:Mu,terminals:Du,viewBox:Pu,width:Iu},Symbol.toStringTag,{value:"Module"})),Lu="fuse",Bu="熔断器 (FU)",Hu="switching",Fu="-7 -32 14 64",Wu=14,qu=64,Gu='<line x1="0" y1="-30" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><rect x="-5" y="-15" width="10" height="30" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Vu=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Ku=[{name:"blown",type:"boolean",default:!1,label:"熔断"}],Uu=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],Xu={x:7,y:-2,anchor:"start"},Yu={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_21/en_60617_07_21_01.elmt",qetEnglishName:"Fuse, general symbol"},Y_={id:Lu,name:Bu,category:Hu,viewBox:Fu,width:Wu,height:qu,svg:Gu,terminals:Vu,state:Ku,params:Uu,label:Xu,source:Yu},Z_=Object.freeze(Object.defineProperty({__proto__:null,category:Hu,default:Y_,height:qu,id:Lu,label:Xu,name:Bu,params:Uu,source:Yu,state:Ku,svg:Gu,terminals:Vu,viewBox:Fu,width:Wu},Symbol.toStringTag,{value:"Module"})),Zu="generator",Qu="发电机 (G)",Ju="source",em="-42 -42 44 44",tm=44,nm=44,om='<rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-24" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text>',rm=[{id:"t_bottom",x:-20,y:0,orientation:"s"}],im={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_16/en_60617_06_16_01.elmt",qetEnglishName:"Generator, general symbol"},Q_={id:Zu,name:Qu,category:Ju,viewBox:em,width:tm,height:nm,svg:om,terminals:rm,source:im},J_=Object.freeze(Object.defineProperty({__proto__:null,category:Ju,default:Q_,height:nm,id:Zu,name:Qu,source:im,svg:om,terminals:rm,viewBox:em,width:tm},Symbol.toStringTag,{value:"Module"})),am="genset",sm="发电机组 (G)",lm="source",cm="柴油 / 燃气发电机组。",dm="-28 -22 56 64",um=56,mm=64,pm='<rect x="-26" y="-20" width="52" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">GEN</text><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',hm=[{id:"t_out",x:0,y:40,orientation:"s"}],fm=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],gm={kind:"inline"},eC={id:am,name:sm,category:lm,description:cm,viewBox:dm,width:um,height:mm,svg:pm,terminals:hm,params:fm,source:gm},tC=Object.freeze(Object.defineProperty({__proto__:null,category:lm,default:eC,description:cm,height:mm,id:am,name:sm,params:fm,source:gm,svg:pm,terminals:hm,viewBox:dm,width:um},Symbol.toStringTag,{value:"Module"})),bm="gfci-breaker",ym="GFCI 断路器 (RCBO)",xm="protection",wm="剩余电流断路器带过流保护 (UL943 / IEC 61009)。北美 GFCI / 欧洲 RCBO。",vm="-18 -22 22 44",km=22,Sm=44,_m='<text x="-14" y="13.8" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">IΔ</text><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="-5,-10 0,10 0,20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-4" x2="-8" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><line x1="-8" y1="-4" x2="-8" y2="-8" fill="none" stroke="black" stroke-width="0.4"/><line x1="-13" y1="-8" x2="-8" y2="-8" fill="none" stroke="black" stroke-width="0.4"/><line x1="-13" y1="-8" x2="-13" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><line x1="-16" y1="-4" x2="-13" y2="-4" fill="none" stroke="black" stroke-width="0.4"/><path d="M -8 1 A 2.5 3.5 0 0 0 -13 1" fill="none" stroke="black" stroke-width="0.4"/><line x1="-8" y1="1" x2="-2" y2="1" fill="none" stroke="black" stroke-width="0.4"/><line x1="-16" y1="1" x2="-13" y2="1" fill="none" stroke="black" stroke-width="0.4"/>',Cm=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],$m=[{name:"open",type:"boolean",default:!1,label:"断开"}],jm=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0},{name:"IDn",label:"剩余动作电流",type:"number",unit:"mA",default:30,showOnCanvas:!0}],Am={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/rcbo.elmt",qetEnglishName:"Residual Circuit Breaker with Overload"},nC={id:bm,name:ym,category:xm,description:wm,viewBox:vm,width:km,height:Sm,svg:_m,terminals:Cm,state:$m,params:jm,source:Am},oC=Object.freeze(Object.defineProperty({__proto__:null,category:xm,default:nC,description:wm,height:Sm,id:bm,name:ym,params:jm,source:Am,state:$m,svg:_m,terminals:Cm,viewBox:vm,width:km},Symbol.toStringTag,{value:"Module"})),Em="grid-source",Nm="系统电源",Tm="source",Pm="无穷大母线 / 外部电网",Im="-16 -31 32 53",zm=32,Mm=53,Dm='<circle cx="0" cy="-15" r="14" fill="none" stroke="black" stroke-width="1"/><text x="0" y="-12" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="14">~</text><line x1="0" y1="-1" x2="0" y2="20" stroke="black" stroke-width="1" fill="none"/>',Rm=[{id:"t_bottom",x:0,y:20,orientation:"s"}],Om={kind:"inline"},rC={id:Em,name:Nm,category:Tm,description:Pm,viewBox:Im,width:zm,height:Mm,svg:Dm,terminals:Rm,source:Om},iC=Object.freeze(Object.defineProperty({__proto__:null,category:Tm,default:rC,description:Pm,height:Mm,id:Em,name:Nm,source:Om,svg:Dm,terminals:Rm,viewBox:Im,width:zm},Symbol.toStringTag,{value:"Module"})),Lm="grounding-transformer",Bm="接地变 (Z形)",Hm="grounding",Fm="星-曲折接线变压器,中性点接地用",Wm="-62 -152 64 164",qm=64,Gm=164,Vm='<line x1="-30" y1="-40" x2="-35" y2="-35" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-25" y2="-35" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-35" x2="-40" y2="-38" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-150" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-35" x2="-25" y2="-30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-30" y2="-45" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-45" x2="-25" y2="-48" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-130" x2="-20" y2="-140" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-135" x2="-20" y2="-145" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="0" x2="-20" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="5" x2="-20" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-85" x2="-30" y2="-95" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-95" x2="-20" y2="-100" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-95" x2="-40" y2="-100" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-40" x2="-20" y2="-40" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-40" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/>',Km=[{id:"t1",x:-30,y:-150,orientation:"n"},{id:"t2",x:-30,y:10,orientation:"s"}],Um={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_10/en_60617_06_10_15.elmt",qetEnglishName:"Three-phase transformer, connection star-zigzag with the neutral brought out"},aC={id:Lm,name:Bm,category:Hm,description:Fm,viewBox:Wm,width:qm,height:Gm,svg:Vm,terminals:Km,source:Um},sC=Object.freeze(Object.defineProperty({__proto__:null,category:Hm,default:aC,description:Fm,height:Gm,id:Lm,name:Bm,source:Um,svg:Vm,terminals:Km,viewBox:Wm,width:qm},Symbol.toStringTag,{value:"Module"})),Xm="heater",Ym="电加热器 (EH)",Zm="load",Qm="电阻加热元件 / 电热负荷。",Jm="-22 -7 54 14",ep=54,tp=14,np='<line x1="-20" y1="0" x2="-10" y2="0" fill="none" stroke="black" stroke-width="1"/><rect x="-10" y="-5" width="30" height="10" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="0" x2="30" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-5" x2="-5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="5" y1="-5" x2="5" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="15" y1="-5" x2="15" y2="5" fill="none" stroke="black" stroke-width="1"/>',op=[{id:"t1",x:-20,y:0,orientation:"w"},{id:"t2",x:30,y:0,orientation:"e"}],rp=[{name:"P",label:"功率",type:"number",unit:"kW",showOnCanvas:!0}],ip={kind:"elmt",path:"91_en_60617/en_60617_04/en_60617_04_01/en_60617_04_01_12.elmt",qetEnglishName:"Heating element"},lC={id:Xm,name:Ym,category:Zm,description:Qm,viewBox:Jm,width:ep,height:tp,svg:np,terminals:op,params:rp,source:ip},cC=Object.freeze(Object.defineProperty({__proto__:null,category:Zm,default:lC,description:Qm,height:tp,id:Xm,name:Ym,params:rp,source:ip,svg:np,terminals:op,viewBox:Jm,width:ep},Symbol.toStringTag,{value:"Module"})),ap="igbt",sp="绝缘栅双极晶体管 (IGBT)",lp="passive",cp="N 沟道增强型 IGBT。t1=集电极(上), t2=发射极(下), t_g=门极。",dp="-32 -32 54 74",up=54,mp=74,pp='<line x1="0" y1="25" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polyline points="-30,20 -5,20 -5,-20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-15" x2="20" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="20" y2="40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="15" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-25" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-8" x2="0" y2="8" fill="none" stroke="black" stroke-width="1"/><polyline points="10,-24 8,-21 12,-22" fill="none" stroke="black" stroke-width="1"/><polyline points="10,25 11,29 8,27" fill="none" stroke="black" stroke-width="1"/>',hp=[{id:"t1",x:20,y:-30,orientation:"n"},{id:"t2",x:20,y:40,orientation:"s"},{id:"t_g",x:-30,y:20,orientation:"w"}],fp={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_05/en_60617_05_05_19.elmt",qetEnglishName:"Insulated-gate bipolar transistor (IGBT) enhancement type, N channel"},dC={id:ap,name:sp,category:lp,description:cp,viewBox:dp,width:up,height:mp,svg:pp,terminals:hp,source:fp},uC=Object.freeze(Object.defineProperty({__proto__:null,category:lp,default:dC,description:cp,height:mp,id:ap,name:sp,source:fp,svg:pp,terminals:hp,viewBox:dp,width:up},Symbol.toStringTag,{value:"Module"})),gp="indicator-light",bp="指示灯 (HL)",yp="control",xp="信号 / 状态指示灯。",wp="-12 -22 24 24",vp=24,kp=24,Sp='<ellipse cx="0" cy="-10" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-3" x2="7" y2="-17" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-17" x2="7" y2="-3" fill="none" stroke="black" stroke-width="1"/>',_p=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],Cp=[{name:"color",label:"颜色",type:"string"}],$p={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_01.elmt",qetEnglishName:"Lamp, general symbol"},mC={id:gp,name:bp,category:yp,description:xp,viewBox:wp,width:vp,height:kp,svg:Sp,terminals:_p,params:Cp,source:$p},pC=Object.freeze(Object.defineProperty({__proto__:null,category:yp,default:mC,description:xp,height:kp,id:gp,name:bp,params:Cp,source:$p,svg:Sp,terminals:_p,viewBox:wp,width:vp},Symbol.toStringTag,{value:"Module"})),jp="inductor",Ap="电感 (L)",Ep="passive",Np="通用电感 / 线圈 / 扼流圈。",Tp="-17 -32 34 64",Pp=34,Ip=64,zp='<line x1="0" y1="15" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><path d="M 0 15 A 15 15 0 1 0 -15 0" fill="none" stroke="black" stroke-width="1"/><line x1="-15" y1="0" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>',Mp=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Dp=[{name:"L",label:"电感量",type:"number",unit:"mH",showOnCanvas:!0},{name:"In",label:"额定电流",type:"number",unit:"A"}],Rp={x:6,y:0,anchor:"start"},Op={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/30_inductors/inductance.elmt",qetEnglishName:"Inductor"},hC={id:jp,name:Ap,category:Ep,description:Np,viewBox:Tp,width:Pp,height:Ip,svg:zp,terminals:Mp,params:Dp,label:Rp,source:Op},fC=Object.freeze(Object.defineProperty({__proto__:null,category:Ep,default:hC,description:Np,height:Ip,id:jp,label:Rp,name:Ap,params:Dp,source:Op,svg:zp,terminals:Mp,viewBox:Tp,width:Pp},Symbol.toStringTag,{value:"Module"})),Lp="inverter",Bp="逆变器 (DC→AC)",Hp="renewable",Fp="-42 -42 44 44",Wp=44,qp=44,Gp='<g transform="matrix(1 0 0 -1 0 -40)"><path d="M -15 -8 A 5 2.5 0 0 0 -25 -8" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><path d="M -15 -8 A 5 2.5 0 0 0 -5 -8" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/></g>',Vp=[{id:"t_dc",x:-20,y:0,orientation:"s"},{id:"t_ac",x:-20,y:-40,orientation:"n"}],Kp={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_05.elmt",qetEnglishName:"Inverter"},gC={id:Lp,name:Bp,category:Hp,viewBox:Fp,width:Wp,height:qp,svg:Gp,terminals:Vp,source:Kp},bC=Object.freeze(Object.defineProperty({__proto__:null,category:Hp,default:gC,height:qp,id:Lp,name:Bp,source:Kp,svg:Gp,terminals:Vp,viewBox:Fp,width:Wp},Symbol.toStringTag,{value:"Module"})),Up="limit-switch",Xp="限位开关 (SQ)",Yp="control",Zp="行程 / 位置开关 (常开, 机械操作)。",Qp="-10 -42 12 64",Jp=12,eh=64,th='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-13" x2="-7" y2="-12" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="-12" x2="-3" y2="-8" fill="none" stroke="black" stroke-width="1"/>',nh=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],oh=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],rh={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_08/en_60617_07_08_01.elmt",qetEnglishName:"Position switch, make contact"},yC={id:Up,name:Xp,category:Yp,description:Zp,viewBox:Qp,width:Jp,height:eh,svg:th,terminals:nh,state:oh,source:rh},xC=Object.freeze(Object.defineProperty({__proto__:null,category:Yp,default:yC,description:Zp,height:eh,id:Up,name:Xp,source:rh,state:oh,svg:th,terminals:nh,viewBox:Qp,width:Jp},Symbol.toStringTag,{value:"Module"})),ih="load-switch",ah="负荷开关",sh="switching",lh="-10 -42 14 64",ch=14,dh=64,uh='<line x1="0" y1="-24" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-22" rx="2" ry="2" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-24" x2="2" y2="-24" fill="none" stroke="black" stroke-width="1"/>',mh=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],ph=[{name:"open",type:"boolean",default:!1,label:"断开"}],hh={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_13/en_60617_07_13_08.elmt",qetEnglishName:"Switch-disconnector; On-load isolating switch"},wC={id:ih,name:ah,category:sh,viewBox:lh,width:ch,height:dh,svg:uh,terminals:mh,state:ph,source:hh},vC=Object.freeze(Object.defineProperty({__proto__:null,category:sh,default:wC,height:dh,id:ih,name:ah,source:hh,state:ph,svg:uh,terminals:mh,viewBox:lh,width:ch},Symbol.toStringTag,{value:"Module"})),fh="load",gh="负荷",bh="load",yh="抽象负荷(电流流出箭头)",xh="-8 -22 16 46",wh=16,vh=46,kh='<line x1="0" y1="-20" x2="0" y2="10" stroke="black" stroke-width="1" fill="none"/><polygon points="-6,10 6,10 0,22" fill="black" stroke="black" stroke-width="1"/>',Sh=[{id:"t_top",x:0,y:-20,orientation:"n"}],_h=[{name:"P",label:"有功功率",type:"number",unit:"MW",showOnCanvas:!0},{name:"cosphi",label:"功率因数",type:"number"}],Ch={x:6,y:0,anchor:"start"},$h={kind:"inline"},kC={id:fh,name:gh,category:bh,description:yh,viewBox:xh,width:wh,height:vh,svg:kh,terminals:Sh,params:_h,label:Ch,source:$h},SC=Object.freeze(Object.defineProperty({__proto__:null,category:bh,default:kC,description:yh,height:vh,id:fh,label:Ch,name:gh,params:_h,source:$h,svg:kh,terminals:Sh,viewBox:xh,width:wh},Symbol.toStringTag,{value:"Module"})),jh="luminaire",Ah="灯具 / 照明负荷",Eh="load",Nh="照明负荷(IEC 60617 荧光灯具通用符号)。区别于 indicator-light:那是面板信号灯,这是回路末端的照明负荷。",Th="-27 -7 54 14",Ph=54,Ih=14,zh='<line x1="-25" y1="0" x2="25" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-5" x2="-25" y2="5" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="-5" x2="25" y2="5" fill="none" stroke="black" stroke-width="1"/>',Mh=[{id:"t_top",x:0,y:0,orientation:"n"}],Dh={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_15/en_60617_11_15_04.elmt",qetEnglishName:"Luminaire, general symbol; Fluorescent lamp, general symbol"},_C={id:jh,name:Ah,category:Eh,description:Nh,viewBox:Th,width:Ph,height:Ih,svg:zh,terminals:Mh,source:Dh},CC=Object.freeze(Object.defineProperty({__proto__:null,category:Eh,default:_C,description:Nh,height:Ih,id:jh,name:Ah,source:Dh,svg:zh,terminals:Mh,viewBox:Th,width:Ph},Symbol.toStringTag,{value:"Module"})),Rh="make-contact",Oh="常开触点 (NO)",Lh="control",Bh="常开辅助触点 (make contact)。",Hh="-10 -42 12 64",Fh=12,Wh=64,qh='<line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>',Gh=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Vh=[{name:"closed",type:"boolean",default:!1,label:"闭合"}],Kh={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_02/en_60617_07_02_01.elmt",qetEnglishName:"Make contact, general symbol; Switch, general symbol"},$C={id:Rh,name:Oh,category:Lh,description:Bh,viewBox:Hh,width:Fh,height:Wh,svg:qh,terminals:Gh,state:Vh,source:Kh},jC=Object.freeze(Object.defineProperty({__proto__:null,category:Lh,default:$C,description:Bh,height:Wh,id:Rh,name:Oh,source:Kh,state:Vh,svg:qh,terminals:Gh,viewBox:Hh,width:Fh},Symbol.toStringTag,{value:"Module"})),Uh="motor-starter",Xh="电机启动器",Yh="motor-control",Zh="电机启动器 (IEC 60617 通用符号)。",Qh="-22 -27 44 54",Jh=44,ef=54,tf='<rect x="-20" y="-20" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><polyline points="-20,-20 0,-10 20,-20" fill="none" stroke="black" stroke-width="1"/>',nf=[{id:"t_top",x:0,y:-25,orientation:"n"},{id:"t_bottom",x:0,y:25,orientation:"s"}],of={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_14/en_60617_07_14_01.elmt",qetEnglishName:"Motor starter, general symbol"},AC={id:Uh,name:Xh,category:Yh,description:Zh,viewBox:Qh,width:Jh,height:ef,svg:tf,terminals:nf,source:of},EC=Object.freeze(Object.defineProperty({__proto__:null,category:Yh,default:AC,description:Zh,height:ef,id:Uh,name:Xh,source:of,svg:tf,terminals:nf,viewBox:Qh,width:Jh},Symbol.toStringTag,{value:"Module"})),rf="mppt",af="MPPT 控制器",sf="renewable",lf="MPPT 太阳能充电控制器(DC/DC,最大功率点跟踪)",cf="-42 -42 44 44",df=44,uf=44,mf='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-36" x2="-20" y2="-36" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-36" y1="-32" x2="-30" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="-26" y1="-32" x2="-20" y2="-32" fill="none" stroke="black" stroke-width="1"/>',pf=[{id:"t_pv",x:-20,y:-40,orientation:"n"},{id:"t_bat",x:-20,y:0,orientation:"s"}],hf=[{name:"I",label:"额定电流",type:"number",unit:"A"}],ff={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_02.elmt",qetEnglishName:"DC/DC converter"},NC={id:rf,name:af,category:sf,description:lf,viewBox:cf,width:df,height:uf,svg:mf,terminals:pf,params:hf,source:ff},TC=Object.freeze(Object.defineProperty({__proto__:null,category:sf,default:NC,description:lf,height:uf,id:rf,name:af,params:hf,source:ff,svg:mf,terminals:pf,viewBox:cf,width:df},Symbol.toStringTag,{value:"Module"})),gf="ngr",bf="中性点电阻 (NGR)",yf="grounding",xf="小电阻接地:连接变压器中性点到地",wf="-12 -32 24 62",vf=24,kf=62,Sf='<line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><rect x="-6" y="-15" width="12" height="22" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="7" x2="0" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="15" x2="10" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-7" y1="19" x2="7" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="23" x2="4" y2="23" fill="none" stroke="black" stroke-width="1"/><line x1="-1.5" y1="27" x2="1.5" y2="27" fill="none" stroke="black" stroke-width="1"/>',_f=[{id:"t_top",x:0,y:-30,orientation:"n"}],Cf=[{name:"R",label:"电阻",type:"number",unit:"Ω"}],$f={kind:"inline"},PC={id:gf,name:bf,category:yf,description:xf,viewBox:wf,width:vf,height:kf,svg:Sf,terminals:_f,params:Cf,source:$f},IC=Object.freeze(Object.defineProperty({__proto__:null,category:yf,default:PC,description:xf,height:kf,id:gf,name:bf,params:Cf,source:$f,svg:Sf,terminals:_f,viewBox:wf,width:vf},Symbol.toStringTag,{value:"Module"})),jf="overcurrent-relay",Af="过流继电器 (50/51)",Ef="protection",Nf="过电流保护继电器 (ANSI 50/51)。",Tf="-62 -62 64 64",Pf=64,If=64,zf='<rect x="-60" y="-60" width="60" height="60" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-48" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">5...10A</text>',Mf=[{id:"t_top",x:-30,y:-60,orientation:"n"}],Df={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_05.elmt",qetEnglishName:"Overcurrent relay"},zC={id:jf,name:Af,category:Ef,description:Nf,viewBox:Tf,width:Pf,height:If,svg:zf,terminals:Mf,source:Df},MC=Object.freeze(Object.defineProperty({__proto__:null,category:Ef,default:zC,description:Nf,height:If,id:jf,name:Af,source:Df,svg:zf,terminals:Mf,viewBox:Tf,width:Pf},Symbol.toStringTag,{value:"Module"})),Rf="panelboard",Of="配电箱",Lf="load",Bf="配电箱 / 负荷中心(IEC 60617 分配中心符号):顶部进线,底部分路示意",Hf="-52 -62 54 64",Ff=54,Wf=64,qf='<g transform="matrix(1 0 0 -1 0 -60)"><rect x="-50" y="-40" width="50" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="-60" x2="-40" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-60" x2="-30" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-60" x2="-20" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-60" x2="-10" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-25" y1="-20" x2="-25" y2="0" fill="none" stroke="black" stroke-width="1"/></g>',Gf=[{id:"t_in",x:-25,y:-60,orientation:"n"}],Vf=[{name:"In",label:"额定电流",type:"number",unit:"A",showOnCanvas:!0}],Kf={kind:"elmt",path:"91_en_60617/en_60617_11/en_60617_11_12/en_60617_11_12_07.elmt",qetEnglishName:"Distribution centre"},DC={id:Rf,name:Of,category:Lf,description:Bf,viewBox:Hf,width:Ff,height:Wf,svg:qf,terminals:Gf,params:Vf,source:Kf},RC=Object.freeze(Object.defineProperty({__proto__:null,category:Lf,default:DC,description:Bf,height:Wf,id:Rf,name:Of,params:Vf,source:Kf,svg:qf,terminals:Gf,viewBox:Hf,width:Ff},Symbol.toStringTag,{value:"Module"})),Uf="phase-failure-relay",Xf="断相继电器",Yf="protection",Zf="断相 / 缺相保护继电器。",Qf="-62 -42 64 44",Jf=64,eg=44,tg='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">m &lt; 3</text>',ng=[{id:"t_top",x:-30,y:-40,orientation:"n"}],og={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_12.elmt",qetEnglishName:"Phase-failure detection relay"},OC={id:Uf,name:Xf,category:Yf,description:Zf,viewBox:Qf,width:Jf,height:eg,svg:tg,terminals:ng,source:og},LC=Object.freeze(Object.defineProperty({__proto__:null,category:Yf,default:OC,description:Zf,height:eg,id:Uf,name:Xf,source:og,svg:tg,terminals:ng,viewBox:Qf,width:Jf},Symbol.toStringTag,{value:"Module"})),rg="plc",ig="PLC / 控制器",ag="control",sg="可编程逻辑控制器 (PLC)。",lg="-24 -42 48 84",cg=48,dg=84,ug='<rect x="-22" y="-22" width="44" height="44" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">PLC</text><line x1="0" y1="-40" x2="0" y2="-22" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="22" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',mg=[{id:"t_top",x:0,y:-40,orientation:"n"},{id:"t_bottom",x:0,y:40,orientation:"s"}],pg={kind:"inline"},BC={id:rg,name:ig,category:ag,description:sg,viewBox:lg,width:cg,height:dg,svg:ug,terminals:mg,source:pg},HC=Object.freeze(Object.defineProperty({__proto__:null,category:ag,default:BC,description:sg,height:dg,id:rg,name:ig,source:pg,svg:ug,terminals:mg,viewBox:lg,width:cg},Symbol.toStringTag,{value:"Module"})),hg="power-factor-meter",fg="功率因数表 (cosφ)",gg="measurement",bg="功率因数表 (cosφ)。",yg="-22 -42 44 44",xg=44,wg=44,vg='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-14" y="-6.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">cos φ</text>',kg=[{id:"t_top",x:0,y:-40,orientation:"n"}],Sg={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_05.elmt",qetEnglishName:"Power-factor meter"},FC={id:hg,name:fg,category:gg,description:bg,viewBox:yg,width:xg,height:wg,svg:vg,terminals:kg,source:Sg},WC=Object.freeze(Object.defineProperty({__proto__:null,category:gg,default:FC,description:bg,height:wg,id:hg,name:fg,source:Sg,svg:vg,terminals:kg,viewBox:yg,width:xg},Symbol.toStringTag,{value:"Module"})),_g="power-supply",Cg="开关电源 (PS)",$g="source",jg="AC→DC 开关电源 / 直流电源模块。t_ac 上(~), t_dc 下(=)。",Ag="-24 -42 48 84",Eg=48,Ng=84,Tg='<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="8" y="15" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">=</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Pg=[{id:"t_ac",x:0,y:-40,orientation:"n"},{id:"t_dc",x:0,y:40,orientation:"s"}],Ig=[{name:"Vdc",label:"输出电压",type:"number",unit:"V",showOnCanvas:!0}],zg={kind:"inline"},qC={id:_g,name:Cg,category:$g,description:jg,viewBox:Ag,width:Eg,height:Ng,svg:Tg,terminals:Pg,params:Ig,source:zg},GC=Object.freeze(Object.defineProperty({__proto__:null,category:$g,default:qC,description:jg,height:Ng,id:_g,name:Cg,params:Ig,source:zg,svg:Tg,terminals:Pg,viewBox:Ag,width:Eg},Symbol.toStringTag,{value:"Module"})),Mg="protective-relay",Dg="保护继电器",Rg="protection",Og="测量继电器 / 保护继电器通用符号 (IEC 60617)。",Lg="-32 -42 64 44",Bg=64,Hg=44,Fg='<polygon points="-2,-22 2,-22 0,-25" fill="black" stroke="black" stroke-width="1"/><polygon points="-2,-22 -2,-19 -6,-20" fill="black" stroke="black" stroke-width="1"/><polygon points="2,-22 2,-19 6,-20" fill="black" stroke="black" stroke-width="1"/><polygon points="-2,-19 0,-17 -3,-15" fill="black" stroke="black" stroke-width="1"/><polygon points="0,-17 2,-19 4,-15" fill="black" stroke="black" stroke-width="1"/><rect x="-2" y="-22" width="4" height="4" rx="0" ry="0" fill="black" stroke="black" stroke-width="1"/><rect x="-30" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/>',Wg=[{id:"t_top",x:0,y:-40,orientation:"n"}],qg={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_16/en_60617_07_16_01.elmt",qetEnglishName:"Measuring relay; Device related to a measuring relay"},VC={id:Mg,name:Dg,category:Rg,description:Og,viewBox:Lg,width:Bg,height:Hg,svg:Fg,terminals:Wg,source:qg},KC=Object.freeze(Object.defineProperty({__proto__:null,category:Rg,default:VC,description:Og,height:Hg,id:Mg,name:Dg,source:qg,svg:Fg,terminals:Wg,viewBox:Lg,width:Bg},Symbol.toStringTag,{value:"Module"})),Gg="proximity-switch",Vg="接近开关 (SQ)",Kg="control",Ug="接近传感器 / 无触点接近开关。",Xg="-12 -32 24 64",Yg=24,Zg=64,Qg='<line x1="0" y1="-30" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="30" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="0,-10 -10,0 0,10 10,0" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-6" x2="-4" y2="6" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="-6" x2="4" y2="6" fill="none" stroke="black" stroke-width="1"/>',Jg=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],eb={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_19/en_60617_07_19_01.elmt",qetEnglishName:"Proximity sensor"},UC={id:Gg,name:Vg,category:Kg,description:Ug,viewBox:Xg,width:Yg,height:Zg,svg:Qg,terminals:Jg,source:eb},XC=Object.freeze(Object.defineProperty({__proto__:null,category:Kg,default:UC,description:Ug,height:Zg,id:Gg,name:Vg,source:eb,svg:Qg,terminals:Jg,viewBox:Xg,width:Yg},Symbol.toStringTag,{value:"Module"})),tb="pt",nb="电压互感器 (PT)",ob="instrument-transformer",rb="-22 -42 44 115",ib=44,ab=115,sb='<ellipse cx="0" cy="1" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-40" x2="0" y2="-20" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="30" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="-0.13" y1="51" x2="-0.13" y2="71" fill="none" stroke="black" stroke-width="1"/>',lb=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:71,orientation:"s"}],cb={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_13/en_60617_06_13_01A.elmt",qetEnglishName:"Voltage transformer"},YC={id:tb,name:nb,category:ob,viewBox:rb,width:ib,height:ab,svg:sb,terminals:lb,source:cb},ZC=Object.freeze(Object.defineProperty({__proto__:null,category:ob,default:YC,height:ab,id:tb,name:nb,source:cb,svg:sb,terminals:lb,viewBox:rb,width:ib},Symbol.toStringTag,{value:"Module"})),db="push-button",ub="按钮 (SB)",mb="control",pb="手动按钮, 自动复位 (常开 make)。",hb="-37 -42 39 64",fb=39,gb=64,bb='<line x1="-35" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-15" x2="-35" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/><line x1="-35" y1="-15" x2="-30" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-5" x2="-35" y2="-5" fill="none" stroke="black" stroke-width="1"/>',yb=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],xb={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_02.elmt",qetEnglishName:"Switch, manually operated, push-button, automatic return"},QC={id:db,name:ub,category:mb,description:pb,viewBox:hb,width:fb,height:gb,svg:bb,terminals:yb,source:xb},JC=Object.freeze(Object.defineProperty({__proto__:null,category:mb,default:QC,description:pb,height:gb,id:db,name:ub,source:xb,svg:bb,terminals:yb,viewBox:hb,width:fb},Symbol.toStringTag,{value:"Module"})),wb="pv",vb="光伏组件",kb="renewable",Sb="-33 -22 85 64",_b=85,Cb=64,$b='<line x1="-16" y1="24" x2="-26" y2="14" fill="none" stroke="black" stroke-width="1"/><line x1="-21" y1="29" x2="-31" y2="19" fill="none" stroke="black" stroke-width="1"/><polygon points="-20,23 -17,20 -15,25" fill="black" stroke="black" stroke-width="1"/><polygon points="-22,25 -25,28 -20,30" fill="black" stroke="black" stroke-width="1"/><rect x="-10" y="-20" width="60" height="60" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="15" y="7.2" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">G</text><line x1="10" y1="20" x2="20" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="15" x2="20" y2="25" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="10" x2="25" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="25" y1="20" x2="35" y2="20" fill="none" stroke="black" stroke-width="1"/>',jb=[{id:"t_dc",x:0,y:40,orientation:"s"}],Ab={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_18/en_60617_06_18_06.elmt",qetEnglishName:"Photovoltaic generator"},e$={id:wb,name:vb,category:kb,viewBox:Sb,width:_b,height:Cb,svg:$b,terminals:jb,source:Ab},t$=Object.freeze(Object.defineProperty({__proto__:null,category:kb,default:e$,height:Cb,id:wb,name:vb,source:Ab,svg:$b,terminals:jb,viewBox:Sb,width:_b},Symbol.toStringTag,{value:"Module"})),Eb="rcd",Nb="剩余电流装置 (RCD)",Tb="protection",Pb="不带过流保护的剩余电流断路器 (IEC 61008)。",Ib="-12 -22 19 44",zb=19,Mb=44,Db='<line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="2" y1="-12" x2="-2" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-2" y1="-12" x2="2" y2="-8" fill="none" stroke="black" stroke-width="1"/><polyline points="0,20 0,10 -7,-9" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="13" rx="4.5" ry="2" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,0 -10,0 -10,13 -5,13" fill="none" stroke="black" stroke-width="0.4" stroke-dasharray="4 2"/>',Rb=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],Ob=[{name:"open",type:"boolean",default:!1,label:"断开"}],Lb=[{name:"IDn",label:"剩余动作电流",type:"number",unit:"mA",default:30,showOnCanvas:!0}],Bb={kind:"elmt",path:"11_singlepole/200_fuses_protective_gears/50_residual_current_circuit_breaker/ddr1.elmt",qetEnglishName:"Residual Circuit Breaker with Overload"},n$={id:Eb,name:Nb,category:Tb,description:Pb,viewBox:Ib,width:zb,height:Mb,svg:Db,terminals:Rb,state:Ob,params:Lb,source:Bb},o$=Object.freeze(Object.defineProperty({__proto__:null,category:Tb,default:n$,description:Pb,height:Mb,id:Eb,name:Nb,params:Lb,source:Bb,state:Ob,svg:Db,terminals:Rb,viewBox:Ib,width:zb},Symbol.toStringTag,{value:"Module"})),Hb="recloser",Fb="重合闸 (Recloser)",Wb="protection",qb="中压自动重合闸开关。",Gb="-12 -32 36 64",Vb=36,Kb=64,Ub='<line x1="0" y1="-30" x2="0" y2="-10" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="0" x2="-8" y2="-13" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-8" x2="2" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="-2" y1="-12" x2="2" y2="-8" stroke="black" stroke-width="1" fill="none"/><path d="M 13 -12 A 7 7 0 1 1 6 -5" fill="none" stroke="black" stroke-width="0.8"/><polygon points="4,-7 6,-5 8,-3" fill="black"/><text x="14" y="6" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">AR</text>',Xb=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Yb=[{name:"open",type:"boolean",default:!1,label:"断开"}],Zb={kind:"inline"},r$={id:Hb,name:Fb,category:Wb,description:qb,viewBox:Gb,width:Vb,height:Kb,svg:Ub,terminals:Xb,state:Yb,source:Zb},i$=Object.freeze(Object.defineProperty({__proto__:null,category:Wb,default:r$,description:qb,height:Kb,id:Hb,name:Fb,source:Zb,state:Yb,svg:Ub,terminals:Xb,viewBox:Gb,width:Vb},Symbol.toStringTag,{value:"Module"})),Qb="rectifier",Jb="整流器 (AC→DC)",e0="renewable",t0="-42 -42 44 44",n0=44,o0=44,r0='<line x1="-40" y1="0" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><rect x="-40" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-8" x2="-4" y2="-8" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-4" x2="-14" y2="-4" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-4" x2="-4" y2="-4" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -35 -30" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -30 A 5 2.5 0 0 0 -15 -30" fill="none" stroke="black" stroke-width="1"/>',i0=[{id:"t_ac",x:-20,y:-40,orientation:"n"},{id:"t_dc",x:-20,y:0,orientation:"s"}],a0={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_14/en_60617_06_14_03.elmt",qetEnglishName:"Rectifier"},a$={id:Qb,name:Jb,category:e0,viewBox:t0,width:n0,height:o0,svg:r0,terminals:i0,source:a0},s$=Object.freeze(Object.defineProperty({__proto__:null,category:e0,default:a$,height:o0,id:Qb,name:Jb,source:a0,svg:r0,terminals:i0,viewBox:t0,width:n0},Symbol.toStringTag,{value:"Module"})),s0="relay-coil",l0="继电器线圈 (KA)",c0="control",d0="继电器 / 接触器操作线圈 (方框)。",u0="-22 -22 44 44",m0=44,p0=44,h0='<rect x="-20" y="-10" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/>',f0=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],g0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_15/en_60617_07_15_01.elmt",qetEnglishName:"Operating device, general symbol; Relay coil, general symbol"},l$={id:s0,name:l0,category:c0,description:d0,viewBox:u0,width:m0,height:p0,svg:h0,terminals:f0,source:g0},c$=Object.freeze(Object.defineProperty({__proto__:null,category:c0,default:l$,description:d0,height:p0,id:s0,name:l0,source:g0,svg:h0,terminals:f0,viewBox:u0,width:m0},Symbol.toStringTag,{value:"Module"})),b0="resistor",y0="电阻 (R)",x0="passive",w0="通用电阻 / 限流 / 制动电阻。",v0="-6 -23 12 35",k0=12,S0=35,_0='<line x1="0" y1="-10" x2="0" y2="-20" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="10" x2="4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="10" x2="4" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="4" y1="-10" x2="-4" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="-4" y1="-10" x2="-4" y2="10" fill="none" stroke="black" stroke-width="1"/>',C0=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t2",x:0,y:10,orientation:"s"}],$0=[{name:"R",label:"阻值",type:"number",unit:"Ω",showOnCanvas:!0},{name:"P",label:"额定功率",type:"number",unit:"W"}],j0={x:6,y:0,anchor:"start"},A0={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/10_resistors/resistance.elmt",qetEnglishName:"Resistor"},d$={id:b0,name:y0,category:x0,description:w0,viewBox:v0,width:k0,height:S0,svg:_0,terminals:C0,params:$0,label:j0,source:A0},u$=Object.freeze(Object.defineProperty({__proto__:null,category:x0,default:d$,description:w0,height:S0,id:b0,label:j0,name:y0,params:$0,source:A0,svg:_0,terminals:C0,viewBox:v0,width:k0},Symbol.toStringTag,{value:"Module"})),E0="reverse-power-relay",N0="逆功率继电器 (32)",T0="protection",P0="逆功率 / 逆流保护继电器 (ANSI 32)。",I0="-62 -42 64 44",z0=64,M0=44,D0='<rect x="-60" y="-40" width="60" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-46" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">I</text><polygon points="-15,-20 -30,-20 -24,-22 -24,-18 -30,-20 -24,-20" fill="black" stroke="black" stroke-width="1"/>',R0=[{id:"t_top",x:-30,y:-40,orientation:"n"}],O0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_02.elmt",qetEnglishName:"Reverse current relay"},m$={id:E0,name:N0,category:T0,description:P0,viewBox:I0,width:z0,height:M0,svg:D0,terminals:R0,source:O0},p$=Object.freeze(Object.defineProperty({__proto__:null,category:T0,default:m$,description:P0,height:M0,id:E0,name:N0,source:O0,svg:D0,terminals:R0,viewBox:I0,width:z0},Symbol.toStringTag,{value:"Module"})),L0="selector-switch",B0="选择开关 (SA)",H0="switching",F0="转换 / 选择开关 (旋转操作, 保位)。",W0="-34 -42 36 64",q0=36,G0=64,V0='<line x1="-32" y1="-10" x2="-2" y2="-10" fill="none" stroke="black" stroke-width="1" stroke-dasharray="4 2"/><line x1="0" y1="-20" x2="0" y2="-40" fill="none" stroke="black" stroke-width="1"/><line x1="-32" y1="-15" x2="-32" y2="-5" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="0" x2="-8" y2="-23" fill="none" stroke="black" stroke-width="1"/>',K0=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],U0=[{name:"open",type:"boolean",default:!1,label:"断开"}],X0={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_07/en_60617_07_07_04.elmt",qetEnglishName:"Switch, manually operated, turning, stay-put"},h$={id:L0,name:B0,category:H0,description:F0,viewBox:W0,width:q0,height:G0,svg:V0,terminals:K0,state:U0,source:X0},f$=Object.freeze(Object.defineProperty({__proto__:null,category:H0,default:h$,description:F0,height:G0,id:L0,name:B0,source:X0,state:U0,svg:V0,terminals:K0,viewBox:W0,width:q0},Symbol.toStringTag,{value:"Module"})),Y0="series-reactor",Z0="串联电抗器",Q0="compensation",J0="与并联电抗器同符号;通过用法区分。",e1="-62 -82 64 104",t1=64,n1=104,o1='<line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M -30 0 A 30 30 0 1 0 -60 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-60" y1="-30" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/>',r1=[{id:"t1",x:-30,y:-80,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],i1={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_08.elmt",qetEnglishName:"Choke; Reactor, general symbol"},g$={id:Y0,name:Z0,category:Q0,description:J0,viewBox:e1,width:t1,height:n1,svg:o1,terminals:r1,source:i1},b$=Object.freeze(Object.defineProperty({__proto__:null,category:Q0,default:g$,description:J0,height:n1,id:Y0,name:Z0,source:i1,svg:o1,terminals:r1,viewBox:e1,width:t1},Symbol.toStringTag,{value:"Module"})),a1="shunt-capacitor",s1="并联电容器",l1="compensation",c1="-7 -23 14 27",d1=14,u1=27,m1='<line x1="-5" y1="2" x2="5" y2="2" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="-2" x2="5" y2="-2" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-2" fill="none" stroke="black" stroke-width="1"/>',p1=[{id:"t1",x:0,y:-21,orientation:"n"},{id:"t_bottom",x:0,y:2,orientation:"s"}],h1=[{name:"Q",label:"无功容量",type:"number",unit:"Mvar"},{name:"stages",label:"分组数",type:"number"}],f1={kind:"elmt",path:"11_singlepole/395_electronics_semiconductors/20_capacitors/capacite.elmt",qetEnglishName:"Capacitor"},y$={id:a1,name:s1,category:l1,viewBox:c1,width:d1,height:u1,svg:m1,terminals:p1,params:h1,source:f1},x$=Object.freeze(Object.defineProperty({__proto__:null,category:l1,default:y$,height:u1,id:a1,name:s1,params:h1,source:f1,svg:m1,terminals:p1,viewBox:c1,width:d1},Symbol.toStringTag,{value:"Module"})),g1="shunt-reactor",b1="并联电抗器",y1="compensation",x1="-62 -82 64 104",w1=64,v1=104,k1='<line x1="-30" y1="0" x2="-30" y2="20" fill="none" stroke="black" stroke-width="1"/><path d="M -30 0 A 30 30 0 1 0 -60 -30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-80" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/><line x1="-60" y1="-30" x2="-30" y2="-30" fill="none" stroke="black" stroke-width="1"/>',S1=[{id:"t1",x:-30,y:-80,orientation:"n"},{id:"t_bottom",x:-30,y:20,orientation:"s"}],_1={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_08.elmt",qetEnglishName:"Choke; Reactor, general symbol"},w$={id:g1,name:b1,category:y1,viewBox:x1,width:w1,height:v1,svg:k1,terminals:S1,source:_1},v$=Object.freeze(Object.defineProperty({__proto__:null,category:y1,default:w$,height:v1,id:g1,name:b1,source:_1,svg:k1,terminals:S1,viewBox:x1,width:w1},Symbol.toStringTag,{value:"Module"})),C1="siren",$1="警笛 (HA)",j1="control",A1="声响警笛 / 报警器。",E1="-32 -42 44 54",N1=44,T1=54,P1='<line x1="-20" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-10" x2="0" y2="10" fill="none" stroke="black" stroke-width="1"/><polygon points="10,-10 -30,-10 -10,-40" fill="none" stroke="black" stroke-width="1"/>',I1=[{id:"t1",x:-20,y:10,orientation:"s"},{id:"t2",x:0,y:10,orientation:"s"}],z1={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_10/en_60617_08_10_09.elmt",qetEnglishName:"Siren"},k$={id:C1,name:$1,category:j1,description:A1,viewBox:E1,width:N1,height:T1,svg:P1,terminals:I1,source:z1},S$=Object.freeze(Object.defineProperty({__proto__:null,category:j1,default:k$,description:A1,height:T1,id:C1,name:$1,source:z1,svg:P1,terminals:I1,viewBox:E1,width:N1},Symbol.toStringTag,{value:"Module"})),M1="socket-outlet",D1="插座 / 连接器",R1="load",O1="电源插座 / 多极连接器。",L1="-7 -2 13 34",B1=13,H1=34,F1='<line x1="-5" y1="13" x2="4" y2="20" fill="none" stroke="black" stroke-width="0.4"/><line x1="-1" y1="12" x2="-1" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="12" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="9" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="1" y1="12" x2="1" y2="19" fill="none" stroke="black" stroke-width="1"/><path d="M 3 13 A 3 3 0 0 0 -3 13" fill="none" stroke="black" stroke-width="1"/>',W1=[{id:"t1",x:0,y:0,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],q1={kind:"elmt",path:"11_singlepole/140_connectors_plugs/prise_multipolaire_2.elmt",qetEnglishName:`Plug and multipolar representation
217
+ unifilar`},_$={id:M1,name:D1,category:R1,description:O1,viewBox:L1,width:B1,height:H1,svg:F1,terminals:W1,source:q1},C$=Object.freeze(Object.defineProperty({__proto__:null,category:R1,default:_$,description:O1,height:H1,id:M1,name:D1,source:q1,svg:F1,terminals:W1,viewBox:L1,width:B1},Symbol.toStringTag,{value:"Module"})),G1="soft-starter",V1="软启动器",K1="motor-control",U1="电机软启动器 (晶闸管降压启动)。",X1="-22 -42 44 84",Y1=44,Z1=84,Q1='<rect x="-20" y="-20" width="40" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-12" y1="-12" x2="12" y2="12" stroke="black" stroke-width="1" fill="none"/><polygon points="4,8 12,12 8,4" fill="none" stroke="black" stroke-width="1"/><text x="-12" y="-2" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">SS</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',J1=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],ey={kind:"inline"},$$={id:G1,name:V1,category:K1,description:U1,viewBox:X1,width:Y1,height:Z1,svg:Q1,terminals:J1,source:ey},j$=Object.freeze(Object.defineProperty({__proto__:null,category:K1,default:$$,description:U1,height:Z1,id:G1,name:V1,source:ey,svg:Q1,terminals:J1,viewBox:X1,width:Y1},Symbol.toStringTag,{value:"Module"})),ty="sync-motor",ny="同步电动机",oy="load",ry="-62 -82 64 114",iy=64,ay=114,sy='<ellipse cx="-30" cy="-30" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><text x="-34" y="-24.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">M</text><line x1="-50" y1="-80" x2="-50" y2="-53" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-53" x2="-10" y2="-80" fill="none" stroke="black" stroke-width="1"/><text x="-45" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="14" fill="#000000">1</text><path d="M -25 -20 A 5 2.5 0 0 0 -35 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -25 -20 A 5 2.5 0 0 0 -15 -20" fill="none" stroke="black" stroke-width="1"/><path d="M -40 10 A 5 5 0 0 0 -50 10" fill="none" stroke="black" stroke-width="1"/><path d="M -30 10 A 5 5 0 0 0 -40 10" fill="none" stroke="black" stroke-width="1"/><path d="M -20 10 A 5 5 0 0 0 -30 10" fill="none" stroke="black" stroke-width="1"/><path d="M -10 10 A 5 5 0 0 0 -20 10" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="10" x2="-50" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="10" x2="-10" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="15" x2="-20" y2="15" fill="none" stroke="black" stroke-width="1"/><line x1="-40" y1="20" x2="-32" y2="20" fill="none" stroke="black" stroke-width="1"/><line x1="-27" y1="20" x2="-20" y2="20" fill="none" stroke="black" stroke-width="1"/>',ly=[{id:"t1",x:-10,y:-80,orientation:"n"},{id:"t2",x:-50,y:-80,orientation:"n"}],cy={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_07/en_60617_06_07_02.elmt",qetEnglishName:"Synchronous motor, single-phase"},A$={id:ty,name:ny,category:oy,viewBox:ry,width:iy,height:ay,svg:sy,terminals:ly,source:cy},E$=Object.freeze(Object.defineProperty({__proto__:null,category:oy,default:A$,height:ay,id:ty,name:ny,source:cy,svg:sy,terminals:ly,viewBox:ry,width:iy},Symbol.toStringTag,{value:"Module"})),dy="synchronoscope",uy="同步表",my="measurement",py="同步指示器 / 同步表。",hy="-22 -42 44 44",fy=44,gy=44,by='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-5" x2="0" y2="-35" fill="none" stroke="black" stroke-width="1"/><path d="M 12.374 -30.374 A 17.5 17.5 0 0 0 -12.374 -30.374" fill="none" stroke="black" stroke-width="1"/><polygon points="-13,-30 -11,-33 -10,-31" fill="none" stroke="black" stroke-width="1"/><polygon points="11,-33 13,-30 10,-31" fill="none" stroke="black" stroke-width="1"/>',yy=[{id:"t_top",x:0,y:-40,orientation:"n"}],xy={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_08.elmt",qetEnglishName:"Synchronoscope"},N$={id:dy,name:uy,category:my,description:py,viewBox:hy,width:fy,height:gy,svg:by,terminals:yy,source:xy},T$=Object.freeze(Object.defineProperty({__proto__:null,category:my,default:N$,description:py,height:gy,id:dy,name:uy,source:xy,svg:by,terminals:yy,viewBox:hy,width:fy},Symbol.toStringTag,{value:"Module"})),wy="terminal",vy="接线端子 / 节点 (X)",ky="busbar",Sy="接线端子 / 接线盒 / 汇接节点。",_y="-5 -5 10 10",Cy=10,$y=10,jy='<ellipse cx="0" cy="0" rx="2.5" ry="2.5" fill="black" stroke="black" stroke-width="1"/>',Ay=[{id:"t_top",x:0,y:-2.5,orientation:"n"},{id:"t_bottom",x:0,y:2.5,orientation:"s"},{id:"t_left",x:-2.5,y:0,orientation:"w"},{id:"t_right",x:2.5,y:0,orientation:"e"}],Ey={kind:"elmt",path:"91_en_60617/en_60617_03/en_60617_03_02/en_60617_03_02_02.elmt",qetEnglishName:"Terminal"},P$={id:wy,name:vy,category:ky,description:Sy,viewBox:_y,width:Cy,height:$y,svg:jy,terminals:Ay,source:Ey},I$=Object.freeze(Object.defineProperty({__proto__:null,category:ky,default:P$,description:Sy,height:$y,id:wy,name:vy,source:Ey,svg:jy,terminals:Ay,viewBox:_y,width:Cy},Symbol.toStringTag,{value:"Module"})),Ny="thermal-overload",Ty="热过载继电器",Py="motor-control",Iy="电机热过载保护继电器, 通常串接在接触器和电机之间。",zy="-9 -32 19 64",My=19,Dy=64,Ry='<line x1="0" y1="-30" x2="0" y2="-15" stroke="black" stroke-width="1" fill="none"/><rect x="-7" y="-15" width="14" height="30" fill="none" stroke="black" stroke-width="1"/><polyline points="-4,-10 -1,-5 -4,0 -1,5 -4,10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>',Oy=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],Ly=[{name:"tripped",type:"boolean",default:!1,label:"动作"}],By={kind:"inline"},z$={id:Ny,name:Ty,category:Py,description:Iy,viewBox:zy,width:My,height:Dy,svg:Ry,terminals:Oy,state:Ly,source:By},M$=Object.freeze(Object.defineProperty({__proto__:null,category:Py,default:z$,description:Iy,height:Dy,id:Ny,name:Ty,source:By,state:Ly,svg:Ry,terminals:Oy,viewBox:zy,width:My},Symbol.toStringTag,{value:"Module"})),Hy="thermocouple",Fy="热电偶 (BT)",Wy="measurement",qy="热电偶温度传感器。",Gy="-26 -42 52 46",Vy=52,Ky=46,Uy='<ellipse cx="0" cy="0" rx="2" ry="2" fill="black" stroke="black" stroke-width="1"/><polyline points="-10,-40 -10,-15 0,0 10,-15 10,-40" fill="none" stroke="black" stroke-width="1"/><line x1="-24" y1="-16" x2="-16" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="16" y1="-16" x2="24" y2="-16" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-20" x2="20" y2="-12" fill="none" stroke="black" stroke-width="1"/>',Xy=[{id:"t1",x:10,y:-40,orientation:"n"},{id:"t2",x:-10,y:-40,orientation:"n"}],Yy={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_06/en_60617_08_06_01.elmt",qetEnglishName:"Thermocouple"},D$={id:Hy,name:Fy,category:Wy,description:qy,viewBox:Gy,width:Vy,height:Ky,svg:Uy,terminals:Xy,source:Yy},R$=Object.freeze(Object.defineProperty({__proto__:null,category:Wy,default:D$,description:qy,height:Ky,id:Hy,name:Fy,source:Yy,svg:Uy,terminals:Xy,viewBox:Gy,width:Vy},Symbol.toStringTag,{value:"Module"})),Zy="thyristor",Qy="晶闸管 (V)",Jy="passive",ex="反向阻断三极晶闸管 / SCR。t1=阳极(上), t2=阴极(下)。",tx="-22 -42 34 44",nx=34,ox=44,rx='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="10" y1="-20" x2="-10" y2="-20" fill="none" stroke="black" stroke-width="1"/><polyline points="-20,0 -7,0 -4,-10" fill="none" stroke="black" stroke-width="1"/>',ix=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],ax={x:6,y:-20,anchor:"start"},sx={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_04/en_60617_05_04_06.elmt",qetEnglishName:"Reverse blocking triode thyristor, P-gate (cathode-side controlled)"},O$={id:Zy,name:Qy,category:Jy,description:ex,viewBox:tx,width:nx,height:ox,svg:rx,terminals:ix,label:ax,source:sx},L$=Object.freeze(Object.defineProperty({__proto__:null,category:Jy,default:O$,description:ex,height:ox,id:Zy,label:ax,name:Qy,source:sx,svg:rx,terminals:ix,viewBox:tx,width:nx},Symbol.toStringTag,{value:"Module"})),lx="time-relay",cx="时间继电器 (KT)",dx="control",ux="延时 (缓动) 继电器线圈。",mx="-32 -22 54 44",px=54,hx=44,fx='<rect x="-20" y="-10" width="40" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="-10" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="10" x2="0" y2="20" fill="none" stroke="black" stroke-width="1"/><rect x="-30" y="-10" width="10" height="20" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-10" x2="-20" y2="10" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="10" x2="-20" y2="-10" fill="none" stroke="black" stroke-width="1"/>',gx=[{id:"t1",x:0,y:-20,orientation:"n"},{id:"t2",x:0,y:20,orientation:"s"}],bx={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_15/en_60617_07_15_08.elmt",qetEnglishName:"Relay coil of a slow-operating relay"},B$={id:lx,name:cx,category:dx,description:ux,viewBox:mx,width:px,height:hx,svg:fx,terminals:gx,source:bx},H$=Object.freeze(Object.defineProperty({__proto__:null,category:dx,default:B$,description:ux,height:hx,id:lx,name:cx,source:bx,svg:fx,terminals:gx,viewBox:mx,width:px},Symbol.toStringTag,{value:"Module"})),yx="transfer-switch",xx="切换开关 (ATS)",wx="switching",vx="双源切换开关 (Automatic / Manual Transfer Switch)。两个电源输入 + 一个负荷输出, 互锁不并联。",kx="-27 -32 51 64",Sx=51,_x=64,Cx='<line x1="-15" y1="-30" x2="-15" y2="-12" stroke="black" stroke-width="1" fill="none"/><line x1="15" y1="-30" x2="15" y2="-12" stroke="black" stroke-width="1" fill="none"/><text x="-25" y="-20" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">N</text><text x="19" y="-20" font-family="Liberation Sans, Arial, sans-serif" font-size="6" fill="#000000">E</text><circle cx="-15" cy="-10" r="1.5" fill="black"/><circle cx="15" cy="-10" r="1.5" fill="black"/><circle cx="0" cy="6" r="1.5" fill="black"/><line x1="-15" y1="-10" x2="0" y2="6" stroke="black" stroke-width="1" fill="none"/><line x1="15" y1="-10" x2="0" y2="6" stroke="black" stroke-width="0.6" fill="none" stroke-dasharray="2 1.5"/><line x1="0" y1="6" x2="0" y2="30" stroke="black" stroke-width="1" fill="none"/>',$x=[{id:"t_normal",x:-15,y:-30,orientation:"n"},{id:"t_emergency",x:15,y:-30,orientation:"n"},{id:"t_load",x:0,y:30,orientation:"s"}],jx=[{name:"position",type:"string",default:"normal",label:"位置 (normal/emergency/off)"}],Ax={kind:"inline"},F$={id:yx,name:xx,category:wx,description:vx,viewBox:kx,width:Sx,height:_x,svg:Cx,terminals:$x,state:jx,source:Ax},W$=Object.freeze(Object.defineProperty({__proto__:null,category:wx,default:F$,description:vx,height:_x,id:yx,name:xx,source:Ax,state:jx,svg:Cx,terminals:$x,viewBox:kx,width:Sx},Symbol.toStringTag,{value:"Module"})),Ex="transformer-2w",Nx="双绕组变压器",Tx="transformer",Px="-62 -142 64 144",Ix=64,zx=144,Mx='<ellipse cx="-30" cy="-90" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-140" x2="-30" y2="-120" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-30" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-30" y1="-20" x2="-30" y2="0" fill="none" stroke="black" stroke-width="1"/>',Dx=[{id:"t1",x:-30,y:-140,orientation:"n"},{id:"t2",x:-30,y:0,orientation:"s"}],Rx=[{name:"S",label:"容量",type:"number",unit:"MVA",showOnCanvas:!0},{name:"ratio",label:"变比",type:"string",showOnCanvas:!0}],Ox={x:4,y:-68,anchor:"start"},Lx={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_01.elmt",qetEnglishName:"Transformer with two windings, general symbol"},q$={id:Ex,name:Nx,category:Tx,viewBox:Px,width:Ix,height:zx,svg:Mx,terminals:Dx,params:Rx,label:Ox,source:Lx},G$=Object.freeze(Object.defineProperty({__proto__:null,category:Tx,default:q$,height:zx,id:Ex,label:Ox,name:Nx,params:Rx,source:Lx,svg:Mx,terminals:Dx,viewBox:Px,width:Ix},Symbol.toStringTag,{value:"Module"})),Bx="transformer-3w",Hx="三绕组变压器",Fx="transformer",Wx="-82 -131 114 133",qx=114,Gx=133,Vx='<ellipse cx="-30" cy="-80" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-31" y1="-129" x2="-31" y2="-109" fill="none" stroke="black" stroke-width="1"/><ellipse cx="-50" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-50" rx="30" ry="30" fill="none" stroke="black" stroke-width="1"/><line x1="-50" y1="-20" x2="-50" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-20" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/>',Kx=[{id:"t1",x:-31,y:-129,orientation:"n"},{id:"t_low_left",x:-50,y:0,orientation:"s"},{id:"t_low_right",x:0,y:0,orientation:"s"}],Ux={x:4,y:-64,anchor:"start"},Xx={kind:"elmt",path:"91_en_60617/en_60617_06/en_60617_06_09/en_60617_06_09_04.elmt",qetEnglishName:"Transformer with three windings, general symbol"},V$={id:Bx,name:Hx,category:Fx,viewBox:Wx,width:qx,height:Gx,svg:Vx,terminals:Kx,label:Ux,source:Xx},K$=Object.freeze(Object.defineProperty({__proto__:null,category:Fx,default:V$,height:Gx,id:Bx,label:Ux,name:Hx,source:Xx,svg:Vx,terminals:Kx,viewBox:Wx,width:qx},Symbol.toStringTag,{value:"Module"})),Yx="triac",Zx="双向晶闸管 (V)",Qx="passive",Jx="双向三极晶闸管 (TRIAC)。",ew="-22 -42 44 44",tw=44,nw=44,ow='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-20" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-20,-30 0,-30 -10,-10" fill="none" stroke="black" stroke-width="1"/><line x1="20" y1="-30" x2="-10" y2="-30" fill="none" stroke="black" stroke-width="1"/><polygon points="0,-10 10,-30 20,-10" fill="none" stroke="black" stroke-width="1"/><polyline points="20,0 18,0 14,-10" fill="none" stroke="black" stroke-width="1"/>',rw=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],iw={x:6,y:-20,anchor:"start"},aw={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_04/en_60617_05_04_11.elmt",qetEnglishName:"Bidirectional triode thyristor; Triac"},U$={id:Yx,name:Zx,category:Qx,description:Jx,viewBox:ew,width:tw,height:nw,svg:ow,terminals:rw,label:iw,source:aw},X$=Object.freeze(Object.defineProperty({__proto__:null,category:Qx,default:U$,description:Jx,height:nw,id:Yx,label:iw,name:Zx,source:aw,svg:ow,terminals:rw,viewBox:ew,width:tw},Symbol.toStringTag,{value:"Module"})),sw="undervoltage-relay",lw="欠压继电器 (27)",cw="protection",dw="欠电压保护继电器 (ANSI 27)。",uw="-62 -82 64 84",mw=64,pw=84,hw='<rect x="-60" y="-80" width="60" height="80" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-49" y="-7.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">130 %</text><text x="-55" y="-32.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">50...80 V</text><text x="-41" y="-53.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">U &lt;</text>',fw=[{id:"t_top",x:-30,y:-80,orientation:"n"}],gw={kind:"elmt",path:"91_en_60617/en_60617_07/en_60617_07_17/en_60617_07_17_07.elmt",qetEnglishName:"Undervoltage relay"},Y$={id:sw,name:lw,category:cw,description:dw,viewBox:uw,width:mw,height:pw,svg:hw,terminals:fw,source:gw},Z$=Object.freeze(Object.defineProperty({__proto__:null,category:cw,default:Y$,description:dw,height:pw,id:sw,name:lw,source:gw,svg:hw,terminals:fw,viewBox:uw,width:mw},Symbol.toStringTag,{value:"Module"})),bw="ups",yw="不间断电源 (UPS)",xw="source",ww="在线 / 后备式不间断电源。",vw="-26 -42 52 84",kw=52,Sw=84,_w='<rect x="-24" y="-20" width="48" height="40" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="11" fill="#000000">UPS</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Cw=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],$w=[{name:"S",label:"容量",type:"number",unit:"kVA"}],jw={kind:"inline"},Q$={id:bw,name:yw,category:xw,description:ww,viewBox:vw,width:kw,height:Sw,svg:_w,terminals:Cw,params:$w,source:jw},J$=Object.freeze(Object.defineProperty({__proto__:null,category:xw,default:Q$,description:ww,height:Sw,id:bw,name:yw,params:$w,source:jw,svg:_w,terminals:Cw,viewBox:vw,width:kw},Symbol.toStringTag,{value:"Module"})),Aw="varmeter",Ew="无功功率表 (var)",Nw="measurement",Tw="无功功率表 (var)。",Pw="-22 -42 44 44",Iw=44,zw=44,Mw='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-8" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">var</text>',Dw=[{id:"t_top",x:0,y:-40,orientation:"n"}],Rw={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_04.elmt",qetEnglishName:"Varmeter"},ej={id:Aw,name:Ew,category:Nw,description:Tw,viewBox:Pw,width:Iw,height:zw,svg:Mw,terminals:Dw,source:Rw},tj=Object.freeze(Object.defineProperty({__proto__:null,category:Nw,default:ej,description:Tw,height:zw,id:Aw,name:Ew,source:Rw,svg:Mw,terminals:Dw,viewBox:Pw,width:Iw},Symbol.toStringTag,{value:"Module"})),Ow="vfd",Lw="变频器 (VFD)",Bw="motor-control",Hw="Variable Frequency Drive — 异步电动机调速。",Fw="-24 -42 48 84",Ww=48,qw=84,Gw='<rect x="-22" y="-20" width="44" height="40" fill="none" stroke="black" stroke-width="1"/><line x1="-22" y1="20" x2="22" y2="-20" stroke="black" stroke-width="1" fill="none"/><text x="-15" y="-5" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~</text><text x="6" y="14" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">~f</text><line x1="0" y1="-40" x2="0" y2="-20" stroke="black" stroke-width="1" fill="none"/><line x1="0" y1="20" x2="0" y2="40" stroke="black" stroke-width="1" fill="none"/>',Vw=[{id:"t_in",x:0,y:-40,orientation:"n"},{id:"t_out",x:0,y:40,orientation:"s"}],Kw={kind:"inline"},nj={id:Ow,name:Lw,category:Bw,description:Hw,viewBox:Fw,width:Ww,height:qw,svg:Gw,terminals:Vw,source:Kw},oj=Object.freeze(Object.defineProperty({__proto__:null,category:Bw,default:nj,description:Hw,height:qw,id:Ow,name:Lw,source:Kw,svg:Gw,terminals:Vw,viewBox:Fw,width:Ww},Symbol.toStringTag,{value:"Module"})),Uw="voltage-regulator",Xw="调压器 (T)",Yw="transformer",Zw="可调感应调压器 / 自耦调压器。",Qw="-17 -32 38 64",Jw=38,ev=64,tv='<line x1="-5" y1="21" x2="5" y2="17" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-16.05" x2="4.95" y2="-20.05" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="-5" rx="10" ry="10" fill="none" stroke="black" stroke-width="1"/><ellipse cx="0" cy="0" rx="15" ry="15" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-20.05" x2="4.95" y2="-24.05" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="23" x2="5" y2="19" fill="none" stroke="black" stroke-width="1"/><line x1="-5.05" y1="-18.05" x2="4.95" y2="-22.05" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-30" x2="0" y2="-15" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="15" x2="0" y2="30" fill="none" stroke="black" stroke-width="1"/><line x1="-5" y1="25" x2="5" y2="21" fill="none" stroke="black" stroke-width="1"/><line x1="-15" y1="15" x2="15" y2="-15" fill="none" stroke="black" stroke-width="1"/><polygon points="13,-16 16,-13 19,-19" fill="black" stroke="black" stroke-width="0.4"/>',nv=[{id:"t1",x:0,y:-30,orientation:"n"},{id:"t2",x:0,y:30,orientation:"s"}],ov=[{name:"ratio",label:"调压范围",type:"string",showOnCanvas:!0}],rv={kind:"elmt",path:"11_singlepole/340_converters_inverters/10_converters/regulator_ind_3f_1.elmt",qetEnglishName:"Voltage regulator"},rj={id:Uw,name:Xw,category:Yw,description:Zw,viewBox:Qw,width:Jw,height:ev,svg:tv,terminals:nv,params:ov,source:rv},ij=Object.freeze(Object.defineProperty({__proto__:null,category:Yw,default:rj,description:Zw,height:ev,id:Uw,name:Xw,params:ov,source:rv,svg:tv,terminals:nv,viewBox:Qw,width:Jw},Symbol.toStringTag,{value:"Module"})),iv="voltmeter",av="电压表 (V)",sv="measurement",lv="-22 -42 44 44",cv=44,dv=44,uv='<ellipse cx="0" cy="-20" rx="20" ry="20" fill="none" stroke="black" stroke-width="1"/><text x="-4" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">V</text>',mv=[{id:"t_top",x:0,y:-40,orientation:"n"}],pv={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_02/en_60617_08_02_01.elmt",qetEnglishName:"Voltmeter"},aj={id:iv,name:av,category:sv,viewBox:lv,width:cv,height:dv,svg:uv,terminals:mv,source:pv},sj=Object.freeze(Object.defineProperty({__proto__:null,category:sv,default:aj,height:dv,id:iv,name:av,source:pv,svg:uv,terminals:mv,viewBox:lv,width:cv},Symbol.toStringTag,{value:"Module"})),hv="wattmeter",fv="功率表 (W)",gv="measurement",bv="-22 -42 44 44",yv=44,xv=44,wv='<rect x="-20" y="-40" width="40" height="40" rx="0" ry="0" fill="none" stroke="black" stroke-width="1"/><text x="-6" y="-8.8" font-family="Liberation Sans, Arial, sans-serif" font-size="9" fill="#000000">W</text>',vv=[{id:"t_top",x:0,y:-40,orientation:"n"}],kv={kind:"elmt",path:"91_en_60617/en_60617_08/en_60617_08_03/en_60617_08_03_01.elmt",qetEnglishName:"Recording wattmeter"},lj={id:hv,name:fv,category:gv,viewBox:bv,width:yv,height:xv,svg:wv,terminals:vv,source:kv},cj=Object.freeze(Object.defineProperty({__proto__:null,category:gv,default:lj,height:xv,id:hv,name:fv,source:kv,svg:wv,terminals:vv,viewBox:bv,width:yv},Symbol.toStringTag,{value:"Module"})),Sv="wind-turbine",_v="风力发电机",Cv="renewable",$v="风机:发电机 + 三叶轮标记",jv="-22 -46 44 68",Av=44,Ev=68,Nv='<circle cx="0" cy="0" r="20" fill="none" stroke="black" stroke-width="1"/><text x="0" y="4" text-anchor="middle" font-family="Liberation Sans, Arial, sans-serif" font-size="16">G</text><line x1="0" y1="-20" x2="0" y2="-32" fill="none" stroke="black" stroke-width="1"/><line x1="0" y1="-32" x2="-10" y2="-39" fill="none" stroke="black" stroke-width="1.5"/><line x1="0" y1="-32" x2="10" y2="-39" fill="none" stroke="black" stroke-width="1.5"/><line x1="0" y1="-32" x2="0" y2="-44" fill="none" stroke="black" stroke-width="1.5"/>',Tv=[{id:"t_bottom",x:0,y:20,orientation:"s"}],Pv={kind:"inline"},dj={id:Sv,name:_v,category:Cv,description:$v,viewBox:jv,width:Av,height:Ev,svg:Nv,terminals:Tv,source:Pv},uj=Object.freeze(Object.defineProperty({__proto__:null,category:Cv,default:dj,description:$v,height:Ev,id:Sv,name:_v,source:Pv,svg:Nv,terminals:Tv,viewBox:jv,width:Av},Symbol.toStringTag,{value:"Module"})),Iv="zener-diode",zv="稳压二极管 (D)",Mv="passive",Dv="齐纳 / 稳压二极管。t1=阳极(上), t2=阴极(下)。",Rv="-12 -42 24 44",Ov=24,Lv=44,Bv='<line x1="0" y1="-40" x2="0" y2="0" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-10" x2="10" y2="-10" fill="none" stroke="black" stroke-width="1"/><polygon points="-10,-30 10,-30 0,-10" fill="none" stroke="black" stroke-width="1"/><line x1="-10" y1="-15" x2="-10" y2="-10" fill="none" stroke="black" stroke-width="1"/>',Hv=[{id:"t1",x:0,y:-40,orientation:"n"},{id:"t2",x:0,y:0,orientation:"s"}],Fv={x:6,y:-20,anchor:"start"},Wv={kind:"elmt",path:"91_en_60617/en_60617_05/en_60617_05_03/en_60617_05_03_06.elmt",qetEnglishName:"Breakdown diode, unidirectional; Zener diode"},mj={id:Iv,name:zv,category:Mv,description:Dv,viewBox:Rv,width:Ov,height:Lv,svg:Bv,terminals:Hv,label:Fv,source:Wv},pj=Object.freeze(Object.defineProperty({__proto__:null,category:Mv,default:mj,description:Dv,height:Lv,id:Iv,label:Fv,name:zv,source:Wv,svg:Bv,terminals:Hv,viewBox:Rv,width:Ov},Symbol.toStringTag,{value:"Module"})),hj=Object.assign({"./ammeter.json":KS,"./arc-suppression-coil.json":XS,"./arrester.json":ZS,"./async-motor.json":JS,"./autotransformer.json":t_,"./battery.json":o_,"./bell.json":i_,"./break-contact.json":s_,"./breaker.json":c_,"./buchholz-relay.json":u_,"./busbar.json":p_,"./buzzer.json":f_,"./capacitor.json":b_,"./contactor.json":x_,"./converter-bidir.json":v_,"./ct.json":S_,"./dc-combiner.json":C_,"./dc-dc-converter.json":j_,"./dc-disconnector.json":E_,"./dc-motor.json":T_,"./diode.json":I_,"./disconnector.json":M_,"./distance-relay.json":R_,"./earth.json":L_,"./earthing-switch.json":H_,"./energy-meter.json":W_,"./ev-charger.json":G_,"./frequency-meter.json":K_,"./fuse-switch-disconnector.json":X_,"./fuse.json":Z_,"./generator.json":J_,"./genset.json":tC,"./gfci-breaker.json":oC,"./grid-source.json":iC,"./grounding-transformer.json":sC,"./heater.json":cC,"./igbt.json":uC,"./indicator-light.json":pC,"./inductor.json":fC,"./inverter.json":bC,"./limit-switch.json":xC,"./load-switch.json":vC,"./load.json":SC,"./luminaire.json":CC,"./make-contact.json":jC,"./motor-starter.json":EC,"./mppt.json":TC,"./ngr.json":IC,"./overcurrent-relay.json":MC,"./panelboard.json":RC,"./phase-failure-relay.json":LC,"./plc.json":HC,"./power-factor-meter.json":WC,"./power-supply.json":GC,"./protective-relay.json":KC,"./proximity-switch.json":XC,"./pt.json":ZC,"./push-button.json":JC,"./pv.json":t$,"./rcd.json":o$,"./recloser.json":i$,"./rectifier.json":s$,"./relay-coil.json":c$,"./resistor.json":u$,"./reverse-power-relay.json":p$,"./selector-switch.json":f$,"./series-reactor.json":b$,"./shunt-capacitor.json":x$,"./shunt-reactor.json":v$,"./siren.json":S$,"./socket-outlet.json":C$,"./soft-starter.json":j$,"./sync-motor.json":E$,"./synchronoscope.json":T$,"./terminal.json":I$,"./thermal-overload.json":M$,"./thermocouple.json":R$,"./thyristor.json":L$,"./time-relay.json":H$,"./transfer-switch.json":W$,"./transformer-2w.json":G$,"./transformer-3w.json":K$,"./triac.json":X$,"./undervoltage-relay.json":Z$,"./ups.json":J$,"./varmeter.json":tj,"./vfd.json":oj,"./voltage-regulator.json":ij,"./voltmeter.json":sj,"./wattmeter.json":cj,"./wind-turbine.json":uj,"./zener-diode.json":pj}),qv=Object.values(hj).map(e=>e.default),rt=Object.fromEntries(qv.map(e=>[e.id,e])),Nr=["busbar","switching","protection","motor-control","control","transformer","instrument-transformer","measurement","source","load","storage","compensation","passive","grounding","renewable"],fj=(()=>{var t;const e={};for(const n of qv)(e[t=n.category]??(e[t]=[])).push(n);return e})(),go=new Map(Object.entries(rt));function Gv(e){return rt[e]}function gj(e){const n=[...e].sort().join("|");let o=2166136261;for(let r=0;r<n.length;r++)o^=n.charCodeAt(r),o=Math.imul(o,16777619);return`n_${(o>>>0).toString(36)}`}const bj=320;function tt(e){var v,P,T,B,V;const t=ia(),n=new Map;e.elements.forEach((S,H)=>{if(n.has(S.id)){t.diagnostics.push({code:"E001",severity:"error",message:Se("compile.duplicateId",{id:S.id}),pointer:`/elements/${H}`});return}n.set(S.id,S);const F=go.get(S.kind);F||t.diagnostics.push({code:"E003",severity:"error",message:`${Se("compile.unknownKind",{kind:S.kind})} (id=${S.id})`,pointer:`/elements/${H}`}),t.elements.set(S.id,{element:S,libraryDef:F})});const o=new Map,r=new Map;(e.buses??[]).forEach((S,H)=>{if(n.has(S.id)||o.has(S.id)){t.diagnostics.push({code:"E001",severity:"error",message:Se("compile.duplicateId",{id:S.id}),pointer:`/buses/${H}`});return}if(o.set(S.id,S),S.layout){const F=S.layout.rot??0;r.set(S.id,{at:S.layout.at,span:S.layout.span,rot:F,axis:ho(F)})}});const i=new Map;(e.junctions??[]).forEach((S,H)=>{if(n.has(S.id)||o.has(S.id)||i.has(S.id)){t.diagnostics.push({code:"E001",severity:"error",message:Se("compile.duplicateId",{id:S.id}),pointer:`/junctions/${H}`});return}i.set(S.id,S)});const a=S=>!S.includes(".")&&o.has(S),s=S=>!S.includes(".")&&i.has(S),l=(S,H)=>{if(a(S)||s(S))return!0;const F=S.indexOf(".");if(F<=0)return t.diagnostics.push({code:"E003",severity:"error",message:Se("compile.invalidTermRef",{ref:S}),pointer:H}),!1;const Z=S.slice(0,F),R=S.slice(F+1),W=t.elements.get(Z);if(!W)return t.diagnostics.push({code:"E002",severity:"error",message:Se("compile.elementMissing",{id:Z}),pointer:H}),!1;if(!W.libraryDef)return!1;if(!W.libraryDef.terminals.find(ie=>ie.id===R)){const ie=W.libraryDef.terminals.map(ce=>ce.id).join(", ");return t.diagnostics.push({code:"E003",severity:"error",message:Se("compile.missingPin",{id:Z,kind:W.element.kind,pin:R,available:ie}),pointer:H}),!1}return!0},c=[];(e.wires??[]).forEach((S,H)=>{const F=`/wires/${H}`,Z=l(S.ends[0],F),R=l(S.ends[1],F);Z&&R&&c.push(S)});const u=new Map;if(e.layout)for(const[S,H]of Object.entries(e.layout))t.elements.has(S)?u.set(S,aa(H)):t.diagnostics.push({code:"E004",severity:"error",message:Se("compile.layoutMissingElement",{id:S}),pointer:`/layout/${S}`});const m=qS({elements:e.elements,buses:e.buses??[],junctions:e.junctions??[],wires:c,library:go,userLayout:u,userBusLayout:r});t.layout=m.devices;for(const[S,H]of m.buses){const F=o.get(S);F&&t.buses.set(S,{bus:F,geometry:H})}for(const[S,H]of o)t.buses.has(S)||t.buses.set(S,{bus:H,geometry:{at:((v=H.layout)==null?void 0:v.at)??[0,0],span:((P=H.layout)==null?void 0:P.span)??bj,rot:((T=H.layout)==null?void 0:T.rot)??0,axis:ho(((B=H.layout)==null?void 0:B.rot)??0)}});for(const S of t.elements.values()){if(!S.libraryDef)continue;const H=t.layout.get(S.element.id);if(!H)continue;const F=[];for(const Z of S.libraryDef.terminals){const R=`${S.element.id}.${Z.id}`,W=De([Z.x,Z.y],H),ie=Lt(Z.orientation,H);t.terminals.set(R,{ref:R,elementId:S.element.id,pin:Z.id,world:W,orientation:ie}),F.push(R)}t.elementToTerminals.set(S.element.id,F)}const h=new Map,g=new Set;for(const[S,H]of i)(V=H.layout)!=null&&V.at?(h.set(S,[H.layout.at[0],H.layout.at[1]]),g.add(S)):m.junctions.has(S)&&(h.set(S,m.junctions.get(S)),g.add(S));const p=S=>{if(!S.includes(".")){const F=t.buses.get(S);return F?F.geometry.at:h.get(S)??null}const H=t.terminals.get(S);return H?H.world:null},f=new Map;for(const[S]of i)g.has(S)||f.set(S,[]);for(const S of c){const[H,F]=S.ends;f.has(H)&&f.get(H).push(F),f.has(F)&&f.get(F).push(H)}for(let S=0;S<12;S++){let H=!1;for(const[F,Z]of f){let R=0,W=0,ie=0;for(const ae of Z){const he=p(ae);he&&(R+=he[0],W+=he[1],ie++)}if(!ie)continue;const ce=R/ie,me=W/ie,J=h.get(F);(!J||Math.abs(J[0]-ce)>.01||Math.abs(J[1]-me)>.01)&&(h.set(F,[ce,me]),H=!0)}if(!H)break}const b=new Map;for(const[S]of i)b.set(S,0);for(const S of c)for(const H of S.ends){const F=b.get(H);F!==void 0&&b.set(H,F+1)}for(const[S,H]of i)t.junctions.set(S,{junction:H,world:h.get(S)??[0,0],degree:b.get(S)??0});const x=new sa;for(const S of c)x.add(S.ends[0]),x.add(S.ends[1]),x.union(S.ends[0],S.ends[1]);for(const[,S]of x.groups()){const H=gj(S);t.nodes.set(H,{id:H,terminals:S});for(const F of S)t.terminalToNode.set(F,H)}for(const S of t.elements.values()){const H=t.elementToTerminals.get(S.element.id)??[];if(H.length===0)continue;H.some(Z=>t.terminalToNode.has(Z))||t.diagnostics.push({code:"W001",severity:"warning",message:Se("compile.elementUnconnected",{id:S.element.id})})}for(const S of t.buses.keys())t.terminalToNode.has(S)||t.diagnostics.push({code:"W001",severity:"warning",message:Se("compile.elementUnconnected",{id:S})});for(const S of t.junctions.keys())t.terminalToNode.has(S)||t.diagnostics.push({code:"W001",severity:"warning",message:Se("compile.elementUnconnected",{id:S})});for(const S of c){if(S.path&&S.path.length>=2){const F=S.path,Z=F.length>=2?F[1]:null,R=F.length>=2?F[F.length-2]:null,W=Ar(S.ends[0],Z,t),ie=Ar(S.ends[1],R,t);if(W&&ie){const ce=[[W[0],W[1]],...F.slice(1,-1).map(J=>[J[0],J[1]]),[ie[0],ie[1]]],me=ra(ce);if(me.length>=2){t.wireRenders.set(S.id,{wireId:S.id,path:me,userEdited:!0,...S.label?{label:S.label}:{}});continue}}}const H=GS(S,t);H&&t.wireRenders.set(S.id,S.label?{...H,label:S.label}:H)}return t}const yj={earth:"GND",breaker:"QF",disconnector:"QS","earthing-switch":"QE","load-switch":"QL",fuse:"FU","transformer-2w":"T","transformer-3w":"T",autotransformer:"AT",ct:"CT",pt:"PT",generator:"G","sync-motor":"M","async-motor":"M","grid-source":"L",load:"L",battery:"BAT","shunt-reactor":"LR","series-reactor":"LR","shunt-capacitor":"C",arrester:"FBL","grounding-transformer":"TG",ngr:"NGR","arc-suppression-coil":"ASC",pv:"PV","wind-turbine":"WT",rectifier:"RT",inverter:"INV","converter-bidir":"PCS"},Tr="B",Pr="J";function Oo(e){return new Set([...e.elements.map(t=>t.id),...(e.buses??[]).map(t=>t.id),...(e.junctions??[]).map(t=>t.id)])}function Gt(e,t){const n=yj[t]??t,o=Oo(e);let r=1;for(;o.has(`${n}${r}`);)r++;return`${n}${r}`}function bo(e){const t=Oo(e);let n=1;for(;t.has(`${Tr}${n}`);)n++;return`${Tr}${n}`}function yo(e){const t=Oo(e);let n=1;for(;t.has(`${Pr}${n}`);)n++;return`${Pr}${n}`}function Dt(e){const t=new Set((e.annotations??[]).map(o=>o.id));let n=1;for(;t.has(`a${n}`);)n++;return`a${n}`}function lt(e,t){const n=[e,t].sort(),o=`${n[0]}|${n[1]}`;let r=2166136261;for(let i=0;i<o.length;i++)r^=o.charCodeAt(i),r=Math.imul(r,16777619);return`w_${(r>>>0).toString(36)}`}function Bt(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}function xj(e,t){if(!e||e.length===0||t.size===0)return e;let n=!1;const o=e.map(r=>{if(!r.path||r.path.length<=2)return r;const i=t.get(Bt(r.ends[0])),a=t.get(Bt(r.ends[1]));return!i||!a||i[0]!==a[0]||i[1]!==a[1]||i[0]===0&&i[1]===0?r:(n=!0,{...r,path:r.path.map(([s,l])=>[s+i[0],l+i[1]])})});return n?o:e}function Qn(e,t,n){if(n.length===0)return n;const o=new Set(n.map(s=>s.id)),r=new Set(t.map(s=>s.id)),i=new Set;for(const s of e)if(!r.has(s.id))for(const l of s.ends)o.has(l)&&i.add(l);if(i.size===0)return n;const a=new Set;for(const s of t)for(const l of s.ends)i.has(l)&&a.add(l);return n.filter(s=>!i.has(s.id)||a.has(s.id))}const Ir={version:"1",elements:[]},wj=100,Jn=20;function vj(){if(typeof window>"u")return"select";try{return window.matchMedia("(pointer: coarse)").matches?"pan":"select"}catch{return"select"}}const y=Tn()(RS((e,t)=>({diagram:Ir,internal:tt(Ir),fileSession:null,activeTool:vj(),placeKind:null,lastPlaceKind:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,busbarDrawStart:null,cursorSvg:null,selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,editingElement:null,readOnly:!1,past:[],future:[],clipboard:null,clipboardPasteIndex:0,setDiagram:n=>e({diagram:n,internal:tt(n),past:[],future:[],selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,editingElement:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null}),setFileSession:n=>e({fileSession:n}),setReadOnly:n=>e({readOnly:n}),loadDiagramFromFile:(n,o)=>e({diagram:n,internal:tt(n),fileSession:o,past:[],future:[],selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,annotationDraft:null,annotationPreview:null,editingElement:null,wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null}),dispatch:n=>{const{diagram:o,past:r}=t(),i=n(o);if(i===o)return;const a=r.length>=wj?r.slice(1):r;e({diagram:i,internal:tt(i),past:[...a,o],future:[],annotationPreview:null})},undo:()=>{const{past:n,future:o,diagram:r}=t();if(n.length===0)return;const i=n[n.length-1];e({diagram:i,internal:tt(i),past:n.slice(0,-1),future:[...o,r],wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,annotationPreview:null})},redo:()=>{const{past:n,future:o,diagram:r}=t();if(o.length===0)return;const i=o[o.length-1];e({diagram:i,internal:tt(i),past:[...n,r],future:o.slice(0,-1),wireFromTerminal:null,wireDragFrom:null,placeFromTerminal:null,annotationPreview:null})},setActiveTool:(n,o)=>{const r=t();let i;(o==null?void 0:o.placeKind)!==void 0?i=o.placeKind:n==="place"?i=r.placeKind??r.lastPlaceKind:i=null,e({activeTool:n,placeKind:i,lastPlaceKind:i??r.lastPlaceKind,wireFromTerminal:n==="wire"?r.wireFromTerminal:null,wireDragFrom:n==="wire"?r.wireDragFrom:null,placeFromTerminal:n==="place"?r.placeFromTerminal:null,annotationDraft:null})},setPlaceKind:n=>e(o=>({placeKind:n,lastPlaceKind:n??o.lastPlaceKind})),setWireFromTerminal:n=>e({wireFromTerminal:n}),setWireDragFrom:n=>e({wireDragFrom:n}),setPlaceFromTerminal:n=>e({placeFromTerminal:n}),setBusbarDrawStart:n=>e({busbarDrawStart:n}),setCursorSvg:n=>e({cursorSvg:n}),setSelection:(n,o)=>e({selection:zr(n),selectedWire:null,selectedNode:null,selectedAnnotations:o?zr(o):n.length?[]:t().selectedAnnotations}),toggleInSelection:n=>{const o=t().selection;e({selection:o.includes(n)?o.filter(r=>r!==n):[...o,n],selectedWire:null,selectedNode:null})},clearSelection:()=>e({selection:[],selectedWire:null,selectedNode:null,selectedAnnotations:[],editingAnnotation:null,editingCell:null,editingElement:null}),setSelectedWire:n=>e({selectedWire:n,selection:n?[]:t().selection,selectedNode:null,selectedAnnotations:n?[]:t().selectedAnnotations}),setSelectedNode:n=>e({selectedNode:n,selection:n?[]:t().selection,selectedWire:null,selectedAnnotations:n?[]:t().selectedAnnotations}),setSelectedAnnotation:n=>e({selectedAnnotations:n?[n]:[],selection:n?[]:t().selection,selectedWire:n?null:t().selectedWire,selectedNode:n?null:t().selectedNode,editingAnnotation:n?t().editingAnnotation:null,editingCell:n?t().editingCell:null}),toggleAnnotationInSelection:n=>{const o=t().selectedAnnotations;e({selectedAnnotations:o.includes(n)?o.filter(r=>r!==n):[...o,n],selectedWire:null,selectedNode:null,editingAnnotation:null,editingCell:null})},setEditingAnnotation:n=>e({editingAnnotation:n,selectedAnnotations:n?[n]:t().selectedAnnotations,editingElement:n?null:t().editingElement,editingCell:null}),setEditingCell:n=>e({editingCell:n}),setAnnotationDraft:n=>e({annotationDraft:n}),setAnnotationPreview:n=>e({annotationPreview:n}),setEditingElement:n=>e({editingElement:n,selection:n?[n]:t().selection,editingAnnotation:n?null:t().editingAnnotation,selectedAnnotations:n?[]:t().selectedAnnotations,selectedWire:n?null:t().selectedWire,selectedNode:n?null:t().selectedNode}),copySelection:()=>{var f;const{selection:n,selectedAnnotations:o,diagram:r,internal:i}=t();if(n.length===0&&o.length===0)return;const a=new Set(o),s=(r.annotations??[]).filter(b=>a.has(b.id)).map(b=>structuredClone(b));if(n.length===0){if(s.length===0)return;e({clipboard:{elements:[],buses:[],junctions:[],placements:{},busLayouts:{},wires:[],annotations:s},clipboardPasteIndex:0});return}const l=new Set(n),c=r.elements.filter(b=>l.has(b.id)).map(b=>structuredClone(b)),u=(r.buses??[]).filter(b=>l.has(b.id)).map(b=>structuredClone(b)),m=(r.junctions??[]).filter(b=>l.has(b.id)).map(b=>{var v;const x=structuredClone(b);if(!x.layout){const P=(v=i.junctions.get(b.id))==null?void 0:v.world;P&&(x.layout={at:[P[0],P[1]]})}return x}),h={};for(const b of n)if(l.has(b)&&!i.buses.has(b)){const x=(f=r.layout)==null?void 0:f[b];if(x){h[b]=structuredClone(x);continue}const v=i.layout.get(b);v&&(h[b]=cn(v))}const g={};for(const b of n){const x=i.buses.get(b);x&&(g[b]=mt(x.geometry))}const p=(r.wires??[]).filter(b=>b.ends.every(x=>l.has(Bt(x)))).map(b=>structuredClone(b));e({clipboard:{elements:c,buses:u,junctions:m,placements:h,busLayouts:g,wires:p,annotations:s},clipboardPasteIndex:0})},cutSelection:()=>{const{selection:n,selectedAnnotations:o}=t();n.length===0&&o.length===0||(t().copySelection(),t().deleteSelection())},pasteClipboard:()=>{const{clipboard:n,clipboardPasteIndex:o,diagram:r}=t();if(!n)return;if(n.elements.length===0&&n.buses.length===0&&n.junctions.length===0){const h=n.annotations??[];if(h.length===0)return;const g=o+1,p=Jn*g,f=[];t().dispatch(b=>{let x=b;for(const v of h){const P=Dt(x);f.push(P);const T={...structuredClone(v),id:P,at:[v.at[0]+p,v.at[1]+p]};x={...x,annotations:[...x.annotations??[],T]}}return x}),f.length&&e({selectedAnnotations:f,selection:[],selectedWire:null,selectedNode:null,clipboardPasteIndex:g});return}const i=o+1,a=Jn*i,s=Jn*i,l=new Map;let c=r;for(const h of n.elements){const g=Gt(c,h.kind);l.set(h.id,g),c={...c,elements:[...c.elements,{id:g,kind:h.kind}]}}for(const h of n.buses){const g=bo(c);l.set(h.id,g),c={...c,buses:[...c.buses??[],{id:g}]}}for(const h of n.junctions){const g=yo(c);l.set(h.id,g),c={...c,junctions:[...c.junctions??[],{id:g}]}}const u=[];for(const h of n.annotations??[]){const g=Dt(c),p={...structuredClone(h),id:g,at:[h.at[0]+a,h.at[1]+s]};u.push(p),c={...c,annotations:[...c.annotations??[],p]}}const m=h=>{const g=h.indexOf("."),p=g<0?h:h.slice(0,g),f=l.get(p);return f?g<0?f:`${f}${h.slice(g)}`:h};t().dispatch(h=>{const g=n.elements.map(P=>{const T=structuredClone(P);return T.id=l.get(P.id),T}),p=n.buses.map(P=>{const T=structuredClone(P);T.id=l.get(P.id);const B=n.busLayouts[P.id];return B&&(T.layout={...B,at:[B.at[0]+a,B.at[1]+s]}),T}),f=n.junctions.map(P=>{const T=structuredClone(P);return T.id=l.get(P.id),T.layout&&(T.layout={at:[T.layout.at[0]+a,T.layout.at[1]+s]}),T}),b={...h.layout??{}};for(const[P,T]of l){const B=n.placements[P];B&&(b[T]={...B,at:[B.at[0]+a,B.at[1]+s]})}const x=n.wires.map(P=>{const T=[m(P.ends[0]),m(P.ends[1])];return{id:lt(T[0],T[1]),ends:T,...P.label?{label:P.label}:{}}}),v=Mr(h.wires??[],x);return{...h,elements:[...h.elements,...g],buses:p.length?[...h.buses??[],...p]:h.buses,junctions:f.length?[...h.junctions??[],...f]:h.junctions,wires:v.length?v:void 0,layout:Object.keys(b).length?b:void 0,annotations:u.length?[...h.annotations??[],...u]:h.annotations}}),e({selection:Array.from(l.values()),selectedAnnotations:u.map(h=>h.id),clipboardPasteIndex:i})},autoArrangeAll:()=>{t().dispatch(n=>{var l;const o=n.layout&&Object.keys(n.layout).length>0,r=(n.buses??[]).some(c=>c.layout);if(!o&&!r)return n;const{layout:i,...a}=n,s=(l=n.buses)==null?void 0:l.map(c=>{const{layout:u,...m}=c;return m});return{...a,buses:s}})},autoArrangeSelection:()=>{const{selection:n}=t();if(n.length===0)return;const o=new Set(n);t().dispatch(r=>{let i=!1,a=r.layout;if(a){const l={};for(const[c,u]of Object.entries(a)){if(o.has(c)){i=!0;continue}l[c]=u}i&&(a=Object.keys(l).length?l:void 0)}let s=r.buses;if(s){const l=s.map(c=>{if(o.has(c.id)&&c.layout){i=!0;const{layout:u,...m}=c;return m}return c});i&&(s=l)}return i?{...r,layout:a,buses:s}:r})},fillUnplacedAll:()=>{const n=t().internal;t().dispatch(o=>{const r=o.layout??{},i={};for(const l of o.elements){if(r[l.id])continue;const c=n.layout.get(l.id);c&&(i[l.id]=cn(c))}const a=[];if((o.buses??[]).forEach((l,c)=>{l.layout||n.buses.has(l.id)&&a.push({idx:c,bus:l})}),Object.keys(i).length===0&&a.length===0)return o;let s=o.buses;return a.length>0&&s&&(s=s.map(l=>{const c=n.buses.get(l.id);return!l.layout&&c?{...l,layout:mt(c.geometry)}:l})),{...o,layout:{...r,...i},buses:s}})},fillUnplacedSelection:()=>{const{selection:n,internal:o}=t();n.length!==0&&t().dispatch(r=>{var c;const i=r.layout??{},a={},s=new Map;for(const u of n)if(o.buses.has(u)){const m=o.buses.get(u);(c=r.buses)!=null&&c.find(h=>h.id===u&&h.layout)||s.set(u,mt(m.geometry))}else{if(i[u])continue;const m=o.layout.get(u);m&&(a[u]=cn(m))}if(Object.keys(a).length===0&&s.size===0)return r;let l=r.buses;return s.size>0&&l&&(l=l.map(u=>s.has(u.id)?{...u,layout:s.get(u.id)}:u)),{...r,layout:{...i,...a},buses:l}})},moveElements:(n,o)=>{if(n.size===0&&!(o!=null&&o.size))return;const r=t().internal;t().dispatch(i=>{const a={...i.layout??{}},s=new Map,l=new Map;for(const[g,p]of n){if(r.buses.has(g)){s.set(g,p);continue}if(r.junctions.has(g)){l.set(g,p);continue}const f=r.layout.get(g),b=a[g]??(f?cn(f):{at:[0,0]});a[g]={...b,at:[b.at[0]+p[0],b.at[1]+p[1]]}}let c=i.buses;s.size>0&&(c=(i.buses??[]).map(g=>{const p=s.get(g.id);if(!p)return g;const f=g.layout??mt(r.buses.get(g.id).geometry);return{...g,layout:{...f,at:[f.at[0]+p[0],f.at[1]+p[1]]}}}));let u=i.junctions;l.size>0&&(u=(i.junctions??[]).map(g=>{var b,x;const p=l.get(g.id);if(!p)return g;const f=((b=g.layout)==null?void 0:b.at)??((x=r.junctions.get(g.id))==null?void 0:x.world)??[0,0];return{...g,layout:{at:[f[0]+p[0],f[1]+p[1]]}}}));let m=i.annotations;o!=null&&o.size&&m&&(m=m.map(g=>{const p=o.get(g.id);return p?{...g,at:[g.at[0]+p[0],g.at[1]+p[1]]}:g}));const h=xj(i.wires,n);return{...i,layout:a,buses:c,junctions:u,wires:h,annotations:m}})},deleteSelection:()=>{const{selection:n,selectedAnnotations:o}=t();if(n.length===0&&o.length===0)return;const r=new Set(n),i=new Set(o);t().dispatch(a=>{const s=a.elements.filter(p=>!r.has(p.id)),l=(a.buses??[]).filter(p=>!r.has(p.id)),c=(a.junctions??[]).filter(p=>!r.has(p.id)),u=(a.wires??[]).filter(p=>!r.has(Bt(p.ends[0]))&&!r.has(Bt(p.ends[1]))),m=i.size?(a.annotations??[]).filter(p=>!i.has(p.id)):a.annotations,h=Qn(a.wires??[],u,c),g=a.layout?Object.fromEntries(Object.entries(a.layout).filter(([p])=>!r.has(p))):void 0;return{...a,elements:s,buses:l.length?l:void 0,junctions:h.length?h:void 0,wires:u.length?u:void 0,layout:g&&Object.keys(g).length?g:void 0,annotations:m!=null&&m.length?m:void 0}}),e({selection:[],selectedAnnotations:[],editingAnnotation:null,editingCell:null})},deleteSelectedWire:()=>{const{selectedWire:n,internal:o}=t();if(!n)return;const r=(t().diagram.wires??[]).find(a=>a.id===n),i=new Set;if(r)for(const a of r.ends){const s=a.indexOf(".");s>0&&i.add(a.slice(0,s))}t().dispatch(a=>{const s=a.wires??[],l=s.filter(m=>m.id!==n);if(l.length===s.length)return a;const c={...a.layout??{}};for(const m of i){if(c[m])continue;const h=o.layout.get(m);if(!h)continue;const g={at:h.at};h.rot&&(g.rot=h.rot),h.mirror&&(g.mirror=h.mirror),c[m]=g}const u=Qn(s,l,a.junctions??[]);return{...a,wires:l.length?l:void 0,junctions:u.length?u:void 0,layout:Object.keys(c).length?c:void 0}}),e({selectedWire:null})},deleteSelectedNode:()=>{const{selectedNode:n,internal:o}=t();if(!n)return;const r=o.nodes.get(n);if(!r)return;const i=new Set(r.terminals),a=new Set;for(const s of r.terminals){const l=s.indexOf(".");l>0&&a.add(s.slice(0,l))}t().dispatch(s=>{const l={...s.layout??{}};for(const h of a){if(l[h])continue;const g=o.layout.get(h);if(!g)continue;const p={at:g.at};g.rot&&(p.rot=g.rot),g.mirror&&(p.mirror=g.mirror),l[h]=p}const c=s.wires??[],u=c.filter(h=>!i.has(h.ends[0])&&!i.has(h.ends[1])),m=Qn(c,u,s.junctions??[]);return{...s,wires:u.length?u:void 0,junctions:m.length?m:void 0,layout:Object.keys(l).length?l:void 0}}),e({selectedNode:null})},rotateSelection:n=>{const{selection:o,internal:r}=t();o.length!==0&&t().dispatch(i=>{var c,u,m,h;const a={...i.layout??{}},s=new Map;for(const g of o){if(r.junctions.has(g))continue;if(r.buses.has(g)){const b=r.buses.get(g),v=(((((m=(u=(c=i.buses)==null?void 0:c.find(P=>P.id===g))==null?void 0:u.layout)==null?void 0:m.rot)??b.geometry.rot??0)+n)%360+360)%360;s.set(g,v);continue}const p=a[g]??{at:((h=r.layout.get(g))==null?void 0:h.at)??[0,0]},f=(((p.rot??0)+n)%360+360)%360;a[g]={...p,rot:f}}let l=i.buses;return s.size>0&&(l=(i.buses??[]).map(g=>{if(!s.has(g.id))return g;const p=g.layout??mt(r.buses.get(g.id).geometry);return{...g,layout:{...p,rot:s.get(g.id)}}})),{...i,layout:a,buses:l}})},mirrorSelection:()=>{const{selection:n,internal:o}=t();n.length!==0&&t().dispatch(r=>{var a;const i={...r.layout??{}};for(const s of n){if(o.buses.has(s)||o.junctions.has(s))continue;const l=i[s]??{at:((a=o.layout.get(s))==null?void 0:a.at)??[0,0]};i[s]={...l,mirror:!(l.mirror??!1)}}return{...r,layout:i}})},addElement:(n,o,r)=>{if(n==="busbar")return t().addBus(o,320);const i=Gt(t().diagram,n);return t().dispatch(a=>{const s={id:i,kind:n,...r??{}};return{...a,elements:[...a.elements,s],layout:{...a.layout??{},[i]:{at:o}}}}),e({selection:[i]}),i},addBus:(n,o,r)=>{const i=bo(t().diagram);return t().dispatch(a=>{const s={id:i,layout:r!==void 0?{at:n,span:o,rot:r}:{at:n,span:o}};return{...a,buses:[...a.buses??[],s]}}),e({selection:[i]}),i},addJunction:n=>{const o=yo(t().diagram);return t().dispatch(r=>{const i={id:o,layout:{at:n}};return{...r,junctions:[...r.junctions??[],i]}}),e({selection:[o]}),o},updateJunction:(n,o)=>{t().dispatch(r=>({...r,junctions:(r.junctions??[]).map(i=>i.id===n?{...i,...o}:i)}))},addWire:(n,o)=>{if(n===o)return;const r=lt(n,o);t().dispatch(i=>{const a=i.wires??[];return a.some(s=>s.id===r)?i:{...i,wires:[...a,{id:r,ends:[n,o]}]}})},connectWire:(n,o)=>{t().dispatch(r=>{let i=r;const a=new Set([...i.elements.map(p=>p.id),...(i.buses??[]).map(p=>p.id),...(i.junctions??[]).map(p=>p.id)]),s=()=>{let p=1;for(;a.has(`J${p}`);)p++;const f=`J${p}`;return a.add(f),f},l=p=>{const f=s();return i={...i,junctions:[...i.junctions??[],{id:f,layout:{at:p}}]},f},c=p=>{if("end"in p)return p.end;if("junctionAt"in p)return l(p.junctionAt);const f=(i.wires??[]).find(P=>P.id===p.onWire),b=l(p.at);if(!f)return b;const x=(i.wires??[]).filter(P=>P.id!==p.onWire),v=(P,T)=>({id:lt(P,T),ends:[P,T],...f.label?{label:f.label}:{}});return i={...i,wires:Mr(x,[v(f.ends[0],b),v(b,f.ends[1])])},b},u=c(n),m=c(o);if(u===null||m===null||u===m)return i;const h=lt(u,m),g=i.wires??[];return g.some(p=>p.id===h)?i:{...i,wires:[...g,{id:h,ends:[u,m]}]}})},updateWirePath:(n,o)=>{t().dispatch(r=>{const i=r.wires??[];if(!i.some(c=>c.id===n))return r;const a=o&&o.length>=2?ra(o):null,s=a&&a.length>=2?a:null,l=i.map(c=>{if(c.id!==n)return c;if(s)return{...c,path:s};const{path:u,...m}=c;return m});return{...r,wires:l}})},resetWirePath:n=>{t().updateWirePath(n,null)},updateWire:(n,o)=>{t().dispatch(r=>{const i=r.wires??[];return i.some(a=>a.id===n)?{...r,wires:i.map(a=>a.id===n?{...a,...o}:a)}:r})},updateElement:(n,o)=>{t().dispatch(r=>({...r,elements:r.elements.map(i=>i.id===n?{...i,...o}:i)}))},updatePlacement:(n,o)=>{t().dispatch(r=>{var s;const i=((s=r.layout)==null?void 0:s[n])??t().internal.layout.get(n),a={at:o.at??(i==null?void 0:i.at)??[0,0],...o.rot!==void 0?{rot:o.rot}:i!=null&&i.rot?{rot:i.rot}:{},...o.mirror!==void 0?{mirror:o.mirror}:i!=null&&i.mirror?{mirror:i.mirror}:{}};return{...r,layout:{...r.layout??{},[n]:a}}})},updateBus:(n,o)=>{t().dispatch(r=>{const i=(r.buses??[]).map(a=>{if(a.id!==n)return a;const s=t().internal,l=a.layout??(s.buses.has(n)?mt(s.buses.get(n).geometry):{at:[0,0],span:320}),c={at:o.at??l.at,span:o.span??l.span,...o.rot!==void 0?{rot:o.rot}:l.rot?{rot:l.rot}:{}};return{...a,layout:c}});return{...r,buses:i}})},addAnnotation:(n,o="")=>{const r=Dt(t().diagram);return t().dispatch(i=>{const a={id:r,at:n,text:o};return{...i,annotations:[...i.annotations??[],a]}}),r},insertAnnotation:n=>{const o=Dt(t().diagram);return t().dispatch(r=>({...r,annotations:[...r.annotations??[],{...n,id:o}]})),o},updateAnnotation:(n,o)=>{t().dispatch(r=>{const i=r.annotations??[];let a=!1;const s=i.map(l=>l.id!==n?l:(a=!0,{...l,...o,id:l.id}));return a?{...r,annotations:s}:r})},deleteAnnotation:n=>{var o;t().dispatch(r=>{const i=r.annotations??[],a=i.filter(s=>s.id!==n);return a.length===i.length?r:{...r,annotations:a.length?a:void 0}}),t().selectedAnnotations.includes(n)&&e({selectedAnnotations:t().selectedAnnotations.filter(r=>r!==n),editingAnnotation:null,editingCell:null}),((o=t().annotationPreview)==null?void 0:o.id)===n&&e({annotationPreview:null})}}),{name:"ole-editor",version:2,storage:oa(()=>({getItem:e=>localStorage.getItem(e),setItem:(e,t)=>{y.getState().readOnly||localStorage.setItem(e,t)},removeItem:e=>localStorage.removeItem(e)})),partialize:e=>({diagram:e.diagram,activeTool:e.activeTool,placeKind:e.placeKind,lastPlaceKind:e.lastPlaceKind}),onRehydrateStorage:()=>e=>{e!=null&&e.diagram&&(e.internal=tt(e.diagram))}}));function vt(e){return e.selectedAnnotations.length===1&&e.selection.length===0?e.selectedAnnotations[0]:null}function zr(e){return Array.from(new Set(e))}function Mr(e,t){const n=new Set(e.map(r=>r.id)),o=e.slice();for(const r of t)n.has(r.id)||(n.add(r.id),o.push(r));return o}function cn(e){return{at:[e.at[0],e.at[1]],...e.rot?{rot:e.rot}:{},...e.mirror?{mirror:e.mirror}:{}}}function mt(e){return{at:[e.at[0],e.at[1]],span:e.span,...e.rot?{rot:e.rot}:{}}}let Vv=null;function Dr(e){Vv=e}function Ve(){return Vv}const Sn=10;function Kv(){if(typeof document>"u")return!0;const e=document.querySelector(".ole-canvas-root");return!!e&&!e.classList.contains("hide-grid")}function ue(e){return Kv()?Math.round(e/Sn)*Sn:e}function qe(e){return[ue(e[0]),ue(e[1])]}const kj=30,Sj=144;function Uv(e,t){const n=rt[e],o=y.getState(),r=o.diagram;if(!n||e==="busbar")return{newElementId:o.addElement(e,t),attachedToBus:!1};const i=_j(r,t);if(!i){const f=Xv(n),b=f?[ue(t[0])-f.x,ue(t[1])-f.y]:[ue(t[0]),ue(t[1])];return{newElementId:o.addElement(e,b),attachedToBus:!1}}const{busId:a,busAt:s,axis:l}=i,c=Cj(n,l),u=Gt(r,e),m=n.terminals.find(f=>f.id===c),h=l==="x"?t[0]:s[0],g=l==="y"?t[1]:s[1],p=m?[ue(h)-m.x,ue(g)-m.y]:[ue(t[0]),ue(t[1])];return o.dispatch(f=>{const b={id:u,kind:e},x={at:p},v=`${u}.${c}`,P={id:lt(a,v),ends:[a,v]};return{...f,elements:[...f.elements,b],wires:[...f.wires??[],P],layout:{...f.layout??{},[u]:x}}}),o.setSelection([u]),{newElementId:u,attachedToBus:!0}}function _j(e,t){const n=y.getState().internal;let o=null;for(const r of e.buses??[]){const i=n.buses.get(r.id);if(!i)continue;const{axis:a,at:s,span:l}=i.geometry;let c;if(a==="x"){const u=s[0]-l/2,m=s[0]+l/2,h=t[0]<u?u-t[0]:t[0]>m?t[0]-m:0,g=Math.abs(t[1]-s[1]);c=Math.sqrt(h*h+g*g)}else{const u=s[1]-l/2,m=s[1]+l/2,h=t[1]<u?u-t[1]:t[1]>m?t[1]-m:0,g=Math.abs(t[0]-s[0]);c=Math.sqrt(g*g+h*h)}c<=kj&&(!o||c<o.dist)&&(o={busId:r.id,busAt:[s[0],s[1]],axis:a,dist:c})}return o?{busId:o.busId,busAt:o.busAt,axis:o.axis}:null}function Cj(e,t){return e.terminals.length===0?"t":[...e.terminals].sort((o,r)=>t==="x"?o.y-r.y:o.x-r.x)[0].id}function Xv(e){return!e||e.stretchable||e.terminals.length===0?null:[...e.terminals].sort((n,o)=>n.y-o.y)[0]}function Yv(e,t){const n=y.getState().internal;if(!e.includes(".")&&n.buses.has(e)){const r=n.buses.get(e),{axis:i,at:a,span:s}=r.geometry;if(i==="x"){const g=a[0]-s/2,p=a[0]+s/2,f=Math.max(g,Math.min(p,t[0])),b=a[1],x=t[1]>=b?"s":"n";return{ref:e,world:[f,b],orientation:x,isBus:!0,busId:e}}const l=a[1]-s/2,c=a[1]+s/2,u=Math.max(l,Math.min(c,t[1])),m=a[0],h=t[0]>=m?"e":"w";return{ref:e,world:[m,u],orientation:h,isBus:!0,busId:e}}if(!e.includes(".")&&n.junctions.has(e)){const r=n.junctions.get(e),[i,a]=r.world,s=t[0]-i,l=t[1]-a,c=Math.abs(s)>=Math.abs(l)?s>=0?"e":"w":l>=0?"s":"n";return{ref:e,world:[i,a],orientation:c,isBus:!1}}const o=n.terminals.get(e);return o?{ref:e,world:o.world,orientation:o.orientation,isBus:!1}:null}const $j={n:"s",s:"n",e:"w",w:"e"};function Zv(e,t,n){if(e.terminals.length===0)return{id:"t",x:0,y:0,orientation:"n"};const o=$j[t.orientation],r=e.terminals.filter(l=>l.orientation===o),i=r.length>0?r:e.terminals;let a=i[0],s=Rr(a,n,t.world);for(let l=1;l<i.length;l++){const c=i[l],u=Rr(c,n,t.world);u<s&&(s=u,a=c)}return a}function Rr(e,t,n){const o=t[0]+e.x-n[0],r=t[1]+e.y-n[1];return o*o+r*r}function jj(e,t,n){const o=rt[e],r=y.getState(),i=r.diagram;if(!o)return null;const a=Yv(t,n);if(!a)return null;const s=n[0]-a.world[0],l=n[1]-a.world[1],c=s*s+l*l<=Sj,u=[ue(n[0]),ue(n[1])],m=Zv(o,a,u),h=c?a.world:u,g=[ue(h[0]-m.x),ue(h[1]-m.y)],p=Gt(i,e);return r.dispatch(f=>{const b={id:p,kind:e},x={at:g},v=`${p}.${m.id}`,P=a.isBus&&a.busId?a.busId:t,T={id:lt(P,v),ends:[P,v]};return{...f,elements:[...f.elements,b],wires:[...f.wires??[],T],layout:{...f.layout??{},[p]:x}}}),r.setSelection([p]),{newElementId:p,attachedToBus:a.isBus}}const Aj=9,Be=7,Pn=5,In=32;function kt(e){return typeof e!="number"||!Number.isFinite(e)?Be:Math.min(In,Math.max(Pn,e))}function Qt(e=Be){return e*Aj/Be}function zn(e,t){var i,a;const n=[],o=((i=e.element.name)==null?void 0:i.trim())||e.element.id;if(o&&n.push(o),t!=="all"||!((a=e.libraryDef)!=null&&a.params))return n;const r=e.element.params??{};for(const s of e.libraryDef.params){if(!s.showOnCanvas)continue;const l=r[s.name];l==null||l===""||n.push(`${l}${s.unit??""}`)}return n}function Mn(e,t=Be){const n=Qv(e.viewBox);return n?{x:n.x+n.w+2,y:n.y+n.h/2+t/3,anchor:"start"}:{x:0,y:0,anchor:"start"}}function Ej(e,t){let n=e.x,o=e.y;switch(t.mirror&&(n=-n),t.rot){case 90:[n,o]=[-o,n];break;case 180:[n,o]=[-n,-o];break;case 270:[n,o]=[o,-n];break}return[n+t.at[0],o+t.at[1]]}function Dn(e,t,n,o,r=Be){const i=Ej(e,n),a=e.anchor??"start",s=Qv(t.viewBox);let l=e.x-(s?s.x+s.w/2:0),c=e.y-(s?s.y+s.h/2:0);switch(n.mirror&&(l=-l),n.rot){case 90:[l,c]=[-c,l];break;case 180:[l,c]=[-l,-c];break;case 270:[l,c]=[c,-l];break}return Math.abs(l)<1e-6&&Math.abs(c)<1e-6?{world:i,textAnchor:a,dy:0}:Math.abs(l)>=Math.abs(c)?{world:i,textAnchor:l>=0?"start":"end",dy:0}:c>0?{world:i,textAnchor:"middle",dy:r}:{world:i,textAnchor:"middle",dy:-(o-1)*Qt(r)}}function Qv(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}const Nj=8;function Rn(e,t=Be){if(e.length<2)return null;let n=-1,o=0;for(let m=0;m<e.length-1;m++){const h=Math.hypot(e[m+1][0]-e[m][0],e[m+1][1]-e[m][1]);h>o&&(o=h,n=m)}if(n<0||o<=0)return null;const[r,i]=e[n],[a,s]=e[n+1],l=(r+a)/2,c=(i+s)/2,u=Nj*t/Be;return Math.abs(a-r)>=Math.abs(s-i)?{world:[l,c-u],textAnchor:"middle"}:{world:[l+u,c+t/3],textAnchor:"start"}}function Tj(){const e=y(s=>s.internal.elements),t=y(s=>s.internal.layout),n=y(s=>s.internal.wireRenders),o=y(s=>{var l;return((l=s.diagram.meta)==null?void 0:l.labelMode)??"all"}),r=y(s=>{var l;return kt((l=s.diagram.meta)==null?void 0:l.labelFontSize)}),i=y(s=>s.editingElement),a=Qt(r);return d.jsxs("g",{className:"ole-annotation-layer",pointerEvents:"none",style:{"--ole-label-font-size":`${r}px`},children:[Array.from(e.values()).map(s=>{var p;const l=t.get(s.element.id);if(!l||!s.libraryDef)return null;const c=s.libraryDef.label??Mn(s.libraryDef,r),u=zn(s,o),{world:m,textAnchor:h,dy:g}=Dn(c,s.libraryDef,l,Math.max(1,u.length),r);return i===s.element.id?d.jsx(Ij,{elementId:s.element.id,currentName:((p=s.element.name)==null?void 0:p.trim())||s.element.id,world:m,anchor:h,fontSize:r},s.element.id):o==="off"||u.length===0?null:d.jsx("g",{className:"ole-annotation",transform:`translate(${m[0]} ${m[1]})`,children:u.map((f,b)=>d.jsx("text",{x:0,y:g+b*a,textAnchor:h,className:"ole-annotation-text",children:f},b))},s.element.id)}),o!=="off"&&Array.from(n.values()).map(s=>{var u;const l=(u=s.label)==null?void 0:u.trim();if(!l)return null;const c=Rn(s.path,r);return c?d.jsx("text",{x:c.world[0],y:c.world[1],textAnchor:c.textAnchor,className:"ole-annotation-text",children:l},`wire-${s.wireId}`):null})]})}const eo=200,Pj=9;function Ij({elementId:e,currentName:t,world:n,anchor:o,fontSize:r}){const i=Math.max(Pj,r),a=I.useRef(null);I.useEffect(()=>{const u=a.current;if(!u)return;u.focus();const m=document.createRange();m.selectNodeContents(u);const h=window.getSelection();h==null||h.removeAllRanges(),h==null||h.addRange(m)},[e]);function s(){var p;const u=y.getState(),m=u.diagram.elements.find(f=>f.id===e);if(!m){u.setEditingElement(null);return}const h=(((p=a.current)==null?void 0:p.innerText)??"").replace(/\u00a0/g," ").trim(),g=h===""||h===e?void 0:h;g!==m.name&&u.updateElement(e,{name:g}),u.setEditingElement(null)}function l(u){if(u.key==="Escape"||u.key==="Enter"&&!u.shiftKey){u.preventDefault(),s();return}u.stopPropagation()}let c=n[0];return o==="middle"?c-=eo/2:o==="end"&&(c-=eo),d.jsx("foreignObject",{x:c,y:n[1]-i,width:eo,height:i*2.2,className:"ole-element-name-editor",children:d.jsx("div",{ref:a,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:s,onKeyDown:l,onPointerDown:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),style:{fontSize:`${i}px`,fontFamily:"ui-sans-serif, system-ui, sans-serif",color:"var(--foreground)",background:"var(--canvas-bg)",outline:"1px dashed var(--selection)",padding:"0 2px",display:"inline-block",minWidth:"20px",lineHeight:1.1,textAlign:o==="middle"?"center":o==="end"?"right":"left",whiteSpace:"nowrap",cursor:"text"},children:t})})}function Oe(e){return e.type??"text"}function zj(e){return e.type===void 0||e.type==="text"}const Ge=8,Mj=1.25,Jt="6 4",Dj=.05,Or=8,dn=3,bt=4,Vt=3,Kt=60,Ut=20,xo=16,wo=12,_n=10,Rj=10;function Oj(e,t){const n=e===""?[""]:e.split(`
218
+ `);return[Math.max(20,...n.map(r=>r.length*t*.55)),n.length*t*Mj]}function en(e){return e.points.map(([t,n])=>[e.at[0]+t,e.at[1]+n])}function Lo(e,t){if(!t||t==="none"||e.length<2)return[];const n=[];return(t==="end"||t==="both")&&n.push(Lr(e[e.length-2],e[e.length-1])),t==="both"&&n.push(Lr(e[1],e[0])),n}function Lr(e,t){const n=t[0]-e[0],o=t[1]-e[1],r=Math.hypot(n,o)||1,i=n/r,a=o/r,s=t[0]-i*Or,l=t[1]-a*Or,c=-a,u=i;return[t,[s+c*dn,l+u*dn],[s-c*dn,l-u*dn]]}function Ue(e){return[Hr(e.colWidths),Hr(e.rowHeights)]}function St(e){return Jv(e.colWidths)}function _t(e){return Jv(e.rowHeights)}function Lj(e,t){const n=t[0]-e.at[0],o=t[1]-e.at[1],[r,i]=Ue(e);if(n<0||o<0||n>r||o>i)return null;const a=Br(St(e),n),s=Br(_t(e),o);return a===null||s===null?null:[s,a]}function Br(e,t){for(let n=0;n<e.length-1;n++)if(t>=e[n]&&t<=e[n+1])return n;return null}function Jv(e){const t=[0];let n=0;for(const o of e)n+=o,t.push(n);return t}function Hr(e){return e.reduce((t,n)=>t+n,0)}function ek(e){let t=e.current[0]-e.start[0],n=e.current[1]-e.start[1];if(e.constrain){const r=Math.max(Math.abs(t),Math.abs(n));t=Math.sign(t||1)*r,n=Math.sign(n||1)*r}return{at:[Math.min(e.start[0],e.start[0]+t),Math.min(e.start[1],e.start[1]+n)],size:[Math.abs(t),Math.abs(n)]}}function tk(e){return e.constrain?nk(e.start,e.current):e.current}function nk(e,t){const n=t[0]-e[0],o=t[1]-e[1],r=Math.hypot(n,o);if(r===0)return t;const i=Math.PI/4,a=Math.round(Math.atan2(o,n)/i)*i;return[e[0]+Math.cos(a)*r,e[1]+Math.sin(a)*r]}function ok(e){const t=Math.abs(e.current[0]-e.start[0]),n=Math.abs(e.current[1]-e.start[1]),o=Math.min(30,Math.max(1,Math.round(t/Kt))),r=Math.min(60,Math.max(1,Math.round(n/Ut)));return{at:[Math.min(e.start[0],e.current[0]),Math.min(e.start[1],e.current[1])],cols:o,rows:r}}function rk(e,t){return{colWidths:Array.from({length:e},()=>Kt),rowHeights:Array.from({length:t},()=>Ut),cells:Array.from({length:t},()=>Array.from({length:e},()=>""))}}function ik(e){switch(e.type){case"rect":{const t=e;return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+t.size[0],maxY:t.at[1]+t.size[1]}}case"line":{const t=en(e),n=t.map(r=>r[0]),o=t.map(r=>r[1]);return{minX:Math.min(...n),minY:Math.min(...o),maxX:Math.max(...n),maxY:Math.max(...o)}}case"table":{const t=e,[n,o]=Ue(t);return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+n,maxY:t.at[1]+o}}default:{const t=e,n=t.fontSize??Ge,[o,r]=Oj(t.text,n);return{minX:t.at[0],minY:t.at[1],maxX:t.at[0]+o,maxY:t.at[1]+r}}}}const yt=Ge,Cn=1.25;function Bj(){const e=y(a=>a.diagram.annotations),t=y(a=>a.selectedAnnotations),n=y(a=>a.editingAnnotation),o=y(a=>a.editingCell),r=y(a=>a.annotationPreview);if(!e||e.length===0)return null;const i=new Set(t);return d.jsx("g",{className:"ole-free-annotation-layer",children:e.map(a=>{const s=(r==null?void 0:r.id)===a.id?r:a,l=i.has(a.id);switch(Oe(s)){case"rect":return d.jsx(Hj,{ann:s,isSelected:l},a.id);case"line":return d.jsx(Fj,{ann:s,isSelected:l},a.id);case"table":return d.jsx(Wj,{ann:s,isSelected:l,editingCell:n===a.id?o:null},a.id);default:return n===a.id?d.jsx(Vj,{ann:s},a.id):d.jsx(Gj,{ann:s,isSelected:l},a.id)}})})}function Hj({ann:e,isSelected:t}){const[n,o]=e.at,[r,i]=e.size,a=(e.stroke??"dashed")==="dashed"?Jt:void 0;return d.jsxs("g",{"data-annotation-id":e.id,className:"ole-ann ole-ann-rect","data-selected":t?"true":void 0,children:[e.fill==="tint"&&d.jsx("rect",{className:"ole-ann-fill",x:n,y:o,width:r,height:i}),d.jsx("rect",{className:"ole-ann-shape-hit",x:n,y:o,width:r,height:i}),d.jsx("rect",{className:"ole-ann-rect-border",x:n,y:o,width:r,height:i,strokeDasharray:a}),e.label&&d.jsx("text",{className:"ole-ann-label",x:n+bt,y:o+bt+yt*.85,fontSize:yt,children:e.label})]})}function Fj({ann:e,isSelected:t}){const n=en(e),o=n.map(i=>`${i[0]},${i[1]}`).join(" "),r=(e.stroke??"solid")==="dashed"?Jt:void 0;return d.jsxs("g",{"data-annotation-id":e.id,className:"ole-ann ole-ann-line-group","data-selected":t?"true":void 0,children:[d.jsx("polyline",{className:"ole-ann-shape-hit",points:o}),d.jsx("polyline",{className:"ole-ann-line",points:o,strokeDasharray:r}),Lo(n,e.arrow).map((i,a)=>d.jsx("polygon",{className:"ole-ann-arrow",points:i.map(s=>`${s[0]},${s[1]}`).join(" ")},a))]})}function Wj({ann:e,isSelected:t,editingCell:n}){var g;const[o,r]=e.at,[i,a]=Ue(e),s=St(e),l=_t(e),c=e.fontSize??yt;let u="";for(let p=1;p<e.colWidths.length;p++)u+=`M${o+s[p]} ${r}V${r+a}`;for(let p=1;p<e.rowHeights.length;p++)u+=`M${o} ${r+l[p]}H${o+i}`;const m=[],h=[];for(let p=0;p<e.rowHeights.length;p++)for(let f=0;f<e.colWidths.length;f++){const b=((g=e.cells[p])==null?void 0:g[f])??"";if(b==="")continue;const x=e.colWidths[f],v=o+s[f]+Vt,P=r+l[p]+e.rowHeights[p]/2+c*.35,T=b.length*c*.55>x-2*Vt,B=`ole-ann-clip-${e.id}-${p}-${f}`;T&&h.push(d.jsx("clipPath",{id:B,children:d.jsx("rect",{x:o+s[f],y:r+l[p],width:x,height:e.rowHeights[p]})},B)),m.push(d.jsx("text",{className:"ole-ann-table-text",x:v,y:P,fontSize:c,clipPath:T?`url(#${B})`:void 0,children:b},`${p}-${f}`))}return d.jsxs("g",{"data-annotation-id":e.id,className:"ole-ann ole-ann-table","data-selected":t?"true":void 0,children:[h.length>0&&d.jsx("defs",{children:h}),d.jsx("rect",{className:"ole-ann-table-bg",x:o,y:r,width:i,height:a}),u&&d.jsx("path",{className:"ole-ann-table-grid",d:u}),d.jsx("rect",{className:"ole-ann-table-border",x:o,y:r,width:i,height:a}),m,n&&d.jsx(qj,{ann:e,cell:n})]})}function qj({ann:e,cell:t}){var g;const[n,o]=t,r=I.useRef(null),i=St(e),a=_t(e),s=e.fontSize??yt,l=((g=e.cells[n])==null?void 0:g[o])??"";I.useEffect(()=>{const p=r.current;p&&(p.focus(),p.select())},[n,o]);function c(){var b;const p=y.getState(),f=((b=r.current)==null?void 0:b.value)??"";if(f!==l){const x=e.cells.map(v=>[...v]);for(;x.length<=n;)x.push([]);x[n][o]=f,p.updateAnnotation(e.id,{cells:x})}}function u(){y.getState().setEditingAnnotation(null)}function m(p,f){const b=e.rowHeights.length,x=e.colWidths.length;if(f>=x?(f=0,p+=1):f<0&&(f=x-1,p-=1),p<0||p>=b){u();return}y.getState().setEditingCell([p,f])}function h(p){if(p.key==="Enter"){p.preventDefault(),c(),m(n+1,o);return}if(p.key==="Tab"){p.preventDefault(),c(),m(n,p.shiftKey?o-1:o+1);return}if(p.key==="Escape"){p.preventDefault(),r.current&&(r.current.value=l),c(),u();return}p.stopPropagation()}return d.jsx("foreignObject",{x:e.at[0]+i[o],y:e.at[1]+a[n],width:e.colWidths[o],height:e.rowHeights[n],className:"ole-ann-cell-edit-fo",children:d.jsx("input",{ref:r,defaultValue:l,onBlur:()=>{c(),u()},onKeyDown:h,onPointerDown:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),style:{width:"100%",height:"100%",boxSizing:"border-box",border:"1px solid var(--selection)",outline:"none",background:"var(--canvas-bg)",color:"var(--foreground)",font:`${s}px ui-sans-serif, system-ui, sans-serif`,padding:`0 ${Vt}px`}},`${n}-${o}`)})}function Gj({ann:e,isSelected:t}){const n=e.fontSize??yt,o=e.text===""?[""]:e.text.split(`
219
+ `),r=Math.max(20,...o.map(a=>a.length*n*.55)),i=o.length*n*Cn;return d.jsxs("g",{"data-annotation-id":e.id,className:"ole-free-annotation","data-selected":t?"true":void 0,children:[d.jsx("rect",{x:e.at[0]-1,y:e.at[1]-1,width:r+2,height:i+2,fill:"transparent",className:"ole-free-annotation-hit"}),t&&d.jsx("rect",{x:e.at[0]-1,y:e.at[1]-1,width:r+2,height:i+2,className:"ole-free-annotation-halo"}),o.map((a,s)=>d.jsx("text",{x:e.at[0],y:e.at[1]+n*.85+s*n*Cn,fontSize:n,className:"ole-free-annotation-text",children:a},s))]})}function Vj({ann:e}){const t=I.useRef(null),n=e.fontSize??yt;I.useEffect(()=>{const s=t.current;if(!s)return;s.focus();const l=document.createRange();l.selectNodeContents(s);const c=window.getSelection();c==null||c.removeAllRanges(),c==null||c.addRange(l)},[e.id]);function o(){var c;const s=y.getState(),l=(((c=t.current)==null?void 0:c.innerText)??"").replace(/\u00a0/g," ").trimEnd();l===""?s.deleteAnnotation(e.id):l!==e.text&&s.updateAnnotation(e.id,{text:l}),s.setEditingAnnotation(null),l!==""&&s.setSelectedAnnotation(e.id),s.activeTool==="text"&&s.setActiveTool("select")}function r(s){if(s.key==="Escape"){s.preventDefault(),t.current&&(t.current.innerText=e.text),o();return}if(s.key==="Enter"&&!s.shiftKey){s.preventDefault(),o();return}s.stopPropagation()}return d.jsx("foreignObject",{x:e.at[0],y:e.at[1],width:320,height:200,"data-annotation-id":e.id,className:"ole-free-annotation-edit-fo",children:d.jsx("div",{ref:t,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:o,onKeyDown:r,onPointerDown:s=>s.stopPropagation(),onMouseDown:s=>s.stopPropagation(),style:{fontSize:`${n}px`,lineHeight:Cn,fontFamily:"ui-sans-serif, system-ui, sans-serif",color:"var(--foreground)",background:"var(--canvas-bg)",outline:"1px dashed var(--selection)",padding:"0 2px",minWidth:`${n}px`,minHeight:`${n*Cn}px`,whiteSpace:"pre-wrap",wordBreak:"break-word",cursor:"text"},children:e.text})})}function Kj(){const e=y(s=>s.annotationDraft);if(!e)return null;if(e.kind==="rect"){const{at:s,size:l}=ek(e);return d.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:d.jsx("rect",{x:s[0],y:s[1],width:l[0],height:l[1],strokeDasharray:Jt})})}if(e.kind==="line"){const s=tk(e);return d.jsx("g",{className:"ole-ann-draft",pointerEvents:"none",children:d.jsx("line",{x1:e.start[0],y1:e.start[1],x2:s[0],y2:s[1]})})}const{at:t,cols:n,rows:o}=ok(e),r=n*Kt,i=o*Ut,a=[];for(let s=1;s<n;s++){const l=t[0]+s*Kt;a.push(d.jsx("line",{x1:l,y1:t[1],x2:l,y2:t[1]+i},`c${s}`))}for(let s=1;s<o;s++){const l=t[1]+s*Ut;a.push(d.jsx("line",{x1:t[0],y1:l,x2:t[0]+r,y2:l},`r${s}`))}return d.jsxs("g",{className:"ole-ann-draft",pointerEvents:"none",children:[d.jsx("rect",{x:t[0],y:t[1],width:r,height:i}),a,d.jsxs("text",{className:"ole-ann-draft-badge",x:e.current[0]+12,y:e.current[1]-8,children:[n," × ",o]})]})}const un=7,$n=3;function Uj(){const e=y(vt),t=y(a=>a.diagram.annotations),n=y(a=>a.annotationPreview);if(y(a=>a.readOnly)||!e)return null;const r=(t??[]).find(a=>a.id===e);if(!r)return null;const i=(n==null?void 0:n.id)===e?n:r;switch(Oe(i)){case"rect":return d.jsx(Xj,{ann:i,model:r});case"table":return d.jsx(Zj,{ann:i,model:r});case"line":return d.jsx(tA,{ann:i,model:r});default:return null}}function tn(e,t,n){const o=I.useRef(null);return{onPointerDown:l=>{if(l.button!==0)return;l.stopPropagation(),l.preventDefault();const c=Ve();c&&(o.current={pointerId:l.pointerId,startSvg:c.screenToSvg(l.clientX,l.clientY),orig:structuredClone(e)},l.target.setPointerCapture(l.pointerId))},onPointerMove:l=>{const c=o.current,u=Ve();if(!c||l.pointerId!==c.pointerId||!u)return;const m=u.screenToSvg(l.clientX,l.clientY),h=ue(m[0]-c.startSvg[0]),g=ue(m[1]-c.startSvg[1]);y.getState().setAnnotationPreview(t(c.orig,h,g,l.nativeEvent))},onPointerUp:l=>{const c=o.current;if(!c||l.pointerId!==c.pointerId)return;o.current=null;const u=l.target;u.hasPointerCapture(l.pointerId)&&u.releasePointerCapture(l.pointerId);const m=y.getState(),h=m.annotationPreview;m.setAnnotationPreview(null),h&&h.id===e.id&&m.updateAnnotation(e.id,n(h))},onPointerCancel:l=>{const c=o.current;!c||l.pointerId!==c.pointerId||(o.current=null,y.getState().setAnnotationPreview(null))}}}function ak(e,t,n,o,r,i,a,s){let[l,c]=e,[u,m]=t;return n===1&&(u=Math.max(a,t[0]+r)),n===-1&&(u=Math.max(a,t[0]-r),l=e[0]+t[0]-u),o===1&&(m=Math.max(s,t[1]+i)),o===-1&&(m=Math.max(s,t[1]-i),c=e[1]+t[1]-m),{at:[l,c],size:[u,m]}}const sk=[{dirX:-1,dirY:-1,cursor:"nwse-resize"},{dirX:0,dirY:-1,cursor:"ns-resize"},{dirX:1,dirY:-1,cursor:"nesw-resize"},{dirX:1,dirY:0,cursor:"ew-resize"},{dirX:1,dirY:1,cursor:"nwse-resize"},{dirX:0,dirY:1,cursor:"ns-resize"},{dirX:-1,dirY:1,cursor:"nesw-resize"},{dirX:-1,dirY:0,cursor:"ew-resize"}];function lk(e,t,n,o){const r=n===-1?e[0]:n===1?e[0]+t[0]:e[0]+t[0]/2,i=o===-1?e[1]:o===1?e[1]+t[1]:e[1]+t[1]/2;return[r,i]}function ck({pos:e,cursor:t,handlers:n}){return d.jsx("rect",{className:"ole-annotation-handle",x:e[0]-un/2,y:e[1]-un/2,width:un,height:un,style:{cursor:t},onPointerDown:n.onPointerDown,onPointerMove:n.onPointerMove,onPointerUp:n.onPointerUp,onPointerCancel:n.onPointerCancel})}function Xj({ann:e,model:t}){return d.jsx("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:sk.map((n,o)=>d.jsx(Yj,{grip:n,ann:e,model:t},o))})}function Yj({grip:e,ann:t,model:n}){const o=tn(n,(r,i,a)=>{const s=ak(r.at,r.size,e.dirX,e.dirY,i,a,_n,_n);return{...r,at:s.at,size:s.size}},r=>({at:r.at,size:r.size}));return d.jsx(ck,{pos:lk(t.at,t.size,e.dirX,e.dirY),cursor:e.cursor,handlers:o})}function Zj({ann:e,model:t}){const n=Ue(e),o=St(e),r=_t(e);return d.jsxs("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:[o.slice(1,-1).map((i,a)=>d.jsx(Jj,{index:a,x:e.at[0]+i,ann:e,model:t},`c${a}`)),r.slice(1,-1).map((i,a)=>d.jsx(eA,{index:a,y:e.at[1]+i,ann:e,model:t},`r${a}`)),sk.map((i,a)=>d.jsx(Qj,{grip:i,ann:e,model:t,size:n},a))]})}function Qj({grip:e,ann:t,model:n,size:o}){const r=tn(n,(i,a,s)=>{const l=Ue(i),c=ak(i.at,l,e.dirX,e.dirY,a,s,xo*i.colWidths.length,wo*i.rowHeights.length),u=Fr(i.colWidths,c.size[0]/l[0],xo),m=Fr(i.rowHeights,c.size[1]/l[1],wo),h=u.reduce((f,b)=>f+b,0),g=m.reduce((f,b)=>f+b,0),p=[e.dirX===-1?i.at[0]+l[0]-h:i.at[0],e.dirY===-1?i.at[1]+l[1]-g:i.at[1]];return{...i,at:p,colWidths:u,rowHeights:m}},i=>({at:i.at,colWidths:i.colWidths,rowHeights:i.rowHeights}));return d.jsx(ck,{pos:lk(t.at,o,e.dirX,e.dirY),cursor:e.cursor,handlers:r})}function Fr(e,t,n){return e.map(o=>Math.max(n,Math.round(o*t)))}function Jj({index:e,x:t,ann:n,model:o}){const[,r]=Ue(n),i=tn(o,(a,s)=>{const l=[...a.colWidths];return l[e]=Math.max(xo,a.colWidths[e]+s),{...a,colWidths:l}},a=>({colWidths:a.colWidths}));return d.jsx("rect",{className:"ole-annotation-handle ole-annotation-handle-strip",x:t-$n,y:n.at[1],width:$n*2,height:r,style:{cursor:"col-resize"},onPointerDown:i.onPointerDown,onPointerMove:i.onPointerMove,onPointerUp:i.onPointerUp,onPointerCancel:i.onPointerCancel})}function eA({index:e,y:t,ann:n,model:o}){const[r]=Ue(n),i=tn(o,(a,s,l)=>{const c=[...a.rowHeights];return c[e]=Math.max(wo,a.rowHeights[e]+l),{...a,rowHeights:c}},a=>({rowHeights:a.rowHeights}));return d.jsx("rect",{className:"ole-annotation-handle ole-annotation-handle-strip",x:n.at[0],y:t-$n,width:r,height:$n*2,style:{cursor:"row-resize"},onPointerDown:i.onPointerDown,onPointerMove:i.onPointerMove,onPointerUp:i.onPointerUp,onPointerCancel:i.onPointerCancel})}function tA({ann:e,model:t}){const n=en(e);return d.jsx("g",{className:"ole-annotation-handles",pointerEvents:"auto",children:n.map((o,r)=>d.jsx(nA,{index:r,pos:o,model:t},r))})}function nA({index:e,pos:t,model:n}){const o=tn(n,(r,i,a,s)=>{const l=r.points.map(u=>[...u]);let c=[r.points[e][0]+i,r.points[e][1]+a];if(s.shiftKey){const u=r.points[e-1]??r.points[e+1]??[0,0];c=nk(u,c)}return l[e]=c,{...r,points:l}},r=>({points:r.points}));return d.jsx("circle",{className:"ole-annotation-handle",cx:t[0],cy:t[1],r:4.5,style:{cursor:"move"},onPointerDown:o.onPointerDown,onPointerMove:o.onPointerMove,onPointerUp:o.onPointerUp,onPointerCancel:o.onPointerCancel})}const oA=20;function rA(){const e=y(u=>u.selection),t=y(u=>u.internal);if(e.length!==1)return null;const n=e[0],o=t.buses.get(n);if(!o)return null;const{axis:r,at:i,span:a}=o.geometry,s=a/2,l=r==="x"?[i[0]-s,i[1]]:[i[0],i[1]-s],c=r==="x"?[i[0]+s,i[1]]:[i[0],i[1]+s];return d.jsxs("g",{className:"ole-bus-handles",pointerEvents:"auto",children:[d.jsx(Wr,{x:l[0],y:l[1],busId:n,side:"start",axis:r}),d.jsx(Wr,{x:c[0],y:c[1],busId:n,side:"end",axis:r})]})}function Wr({x:e,y:t,busId:n,side:o,axis:r}){const i=Ve(),a=I.useRef(null),s=u=>{if(u.button!==0||(u.stopPropagation(),u.preventDefault(),!i))return;const m=y.getState().internal.buses.get(n);m&&(a.current={pointerId:u.pointerId,startSpan:m.geometry.span,startAt:[...m.geometry.at],startSvg:i.screenToSvg(u.clientX,u.clientY)},u.target.setPointerCapture(u.pointerId))},l=u=>{const m=a.current;if(!m||u.pointerId!==m.pointerId||!i)return;const h=i.screenToSvg(u.clientX,u.clientY),g=r==="x"?h[0]-m.startSvg[0]:h[1]-m.startSvg[1],p=Kv()?Math.round(g/Sn)*Sn:g,f=m.startSpan+(o==="end"?p:-p);if(f<oA)return;const b=r==="x"?[m.startAt[0]+p/2,m.startAt[1]]:[m.startAt[0],m.startAt[1]+p/2];y.getState().updateBus(n,{span:f,at:b})},c=u=>{const m=a.current;!m||u.pointerId!==m.pointerId||(u.target.hasPointerCapture(u.pointerId)&&u.target.releasePointerCapture(u.pointerId),a.current=null)};return d.jsx("circle",{className:"ole-bus-handle",cx:e,cy:t,r:5,"data-handle":o,onPointerDown:s,onPointerMove:l,onPointerUp:c,onPointerCancel:c})}const vo=.5;function Ht(e,t){return Math.abs(e[1]-t[1])<vo?"h":"v"}function iA(){const e=y(s=>s.selectedWire),t=y(s=>s.internal.wireRenders);if(!e)return null;const n=t.get(e);if(!n||n.path.length<2)return null;const o=n.path,r=o.length,i=[];for(let s=1;s<r-1;s++){const l=Ht(o[s-1],o[s]),c=Ht(o[s],o[s+1]),u=s-1===0,m=s+1===r-1,h=u&&l==="v"||m&&c==="v",g=u&&l==="h"||m&&c==="h";h&&g||i.push(d.jsx(aA,{wireId:e,index:s,xLocked:h,yLocked:g},`v-${s}`))}const a=[];for(let s=0;s<r-1;s++){const l=o[s],c=o[s+1];Math.abs(l[0]-c[0])<vo&&Math.abs(l[1]-c[1])<vo||a.push(d.jsx(sA,{wireId:e,segIndex:s,axis:Ht(l,c)},`m-${s}`))}return d.jsxs("g",{className:"ole-wire-handles",pointerEvents:"auto",children:[a,i]})}function aA({wireId:e,index:t,xLocked:n,yLocked:o}){const r=Ve(),i=I.useRef(null),a=y(p=>{var f;return(f=p.internal.wireRenders.get(e))==null?void 0:f.path});if(!a||t<=0||t>=a.length-1)return null;const[s,l]=a[t],c=n&&!o?"ns-resize":!n&&o?"ew-resize":"move",u=p=>{if(p.button!==0||(p.stopPropagation(),p.preventDefault(),!r))return;const f=y.getState().internal.wireRenders.get(e);f&&(i.current={pointerId:p.pointerId,startPath:f.path.map(b=>[b[0],b[1]]),startSvg:r.screenToSvg(p.clientX,p.clientY),index:t,xLocked:n,yLocked:o},document.body.style.cursor=c,p.target.setPointerCapture(p.pointerId))},m=p=>{const f=i.current;if(!f||p.pointerId!==f.pointerId||!r)return;const b=r.screenToSvg(p.clientX,p.clientY),x=f.startPath,v=f.index;if(v<=0||v>=x.length-1)return;const P=x[v],T=[f.xLocked?P[0]:ue(P[0]+(b[0]-f.startSvg[0])),f.yLocked?P[1]:ue(P[1]+(b[1]-f.startSvg[1]))];if(T[0]===P[0]&&T[1]===P[1])return;const B=x.map(H=>[H[0],H[1]]);B[v]=T;const V=Ht(x[v-1],x[v]);v-1>0&&(V==="h"?B[v-1]=[x[v-1][0],T[1]]:B[v-1]=[T[0],x[v-1][1]]);const S=Ht(x[v],x[v+1]);v+1<x.length-1&&(S==="h"?B[v+1]=[x[v+1][0],T[1]]:B[v+1]=[T[0],x[v+1][1]]),y.getState().updateWirePath(e,B)},h=p=>{const f=i.current;!f||p.pointerId!==f.pointerId||(p.target.hasPointerCapture(p.pointerId)&&p.target.releasePointerCapture(p.pointerId),i.current=null,document.body.style.cursor="")},g=p=>{p.stopPropagation(),p.preventDefault();const f=y.getState().internal.wireRenders.get(e);if(!f||f.path.length<=2||t<=0||t>=f.path.length-1)return;const b=f.path.filter((x,v)=>v!==t);y.getState().updateWirePath(e,b)};return d.jsx("circle",{className:"ole-wire-handle ole-wire-vertex",cx:s,cy:l,r:5,style:{cursor:c},onPointerDown:u,onPointerMove:m,onPointerUp:h,onPointerCancel:h,onDoubleClick:g})}function sA({wireId:e,segIndex:t,axis:n}){const o=Ve(),r=I.useRef(null),i=y(p=>{var f;return(f=p.internal.wireRenders.get(e))==null?void 0:f.path});if(!i||t<0||t>=i.length-1)return null;const a=i[t],s=i[t+1],l=(a[0]+s[0])/2,c=(a[1]+s[1])/2,u=n==="h"?"ns-resize":"ew-resize",m=p=>{if(p.button!==0||(p.stopPropagation(),p.preventDefault(),!o))return;const f=y.getState().internal.wireRenders.get(e);f&&(r.current={pointerId:p.pointerId,startPath:f.path.map(b=>[b[0],b[1]]),startSvg:o.screenToSvg(p.clientX,p.clientY),axis:n,segIndex:t},document.body.style.cursor=u,p.currentTarget.setPointerCapture(p.pointerId))},h=p=>{const f=r.current;if(!f||p.pointerId!==f.pointerId||!o)return;const b=o.screenToSvg(p.clientX,p.clientY),x=f.startPath,v=f.segIndex;if(v>=x.length-1)return;const P=x[v],T=x[v+1],B=[];for(let V=0;V<=v;V++)B.push(x[V]);if(f.axis==="h"){const V=ue(P[1]+(b[1]-f.startSvg[1]));B.push([P[0],V]),B.push([T[0],V])}else{const V=ue(P[0]+(b[0]-f.startSvg[0]));B.push([V,P[1]]),B.push([V,T[1]])}for(let V=v+1;V<x.length;V++)B.push(x[V]);y.getState().updateWirePath(e,B)},g=p=>{const f=r.current;if(!f||p.pointerId!==f.pointerId)return;const b=p.currentTarget;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),r.current=null,document.body.style.cursor=""};return d.jsxs("g",{className:"ole-wire-handle ole-wire-midpoint-group",style:{cursor:u},onPointerDown:m,onPointerMove:h,onPointerUp:g,onPointerCancel:g,children:[d.jsx("circle",{className:"ole-wire-midpoint-hit",cx:l,cy:c,r:8}),d.jsx("circle",{className:"ole-wire-handle ole-wire-midpoint",cx:l,cy:c,r:3.5})]})}const lA=3,to=12;function cA(){const e=y(s=>s.internal.buses),t=y(s=>s.selection),n=y(s=>s.selectedNode),o=y(s=>s.internal.nodes),r=y(s=>s.internal.terminalToNode),i=new Set(t),a=new Set;if(n){const s=o.get(n);if(s)for(const l of s.terminals)!l.includes(".")&&e.has(l)&&a.add(l)}return d.jsx("g",{className:"ole-bus-layer",children:Array.from(e.values()).map(({bus:s,geometry:l})=>{const{axis:c,at:u,span:m}=l,h=m/2,g=c==="x"?u[0]-h:u[0],p=c==="x"?u[1]:u[1]-h,f=c==="x"?u[0]+h:u[0],b=c==="x"?u[1]:u[1]+h,x=i.has(s.id),v=a.has(s.id),P=r.get(s.id)??void 0,T=to/2,B=c==="x"?u[0]-h:u[0]-T,V=c==="x"?u[1]-T:u[1]-h,S=c==="x"?m:to,H=c==="x"?to:m;return d.jsxs("g",{"data-bus-id":s.id,"data-element-id":s.id,"data-node-id":P,"data-selected":x?"true":void 0,"data-node-related":v?"true":void 0,className:"ole-bus",children:[d.jsx("rect",{x:B,y:V,width:S,height:H,fill:"transparent",className:"ole-bus-hit"}),d.jsx("line",{x1:g,y1:p,x2:f,y2:b,stroke:"currentColor",strokeWidth:lA,strokeLinecap:"round",fill:"none"})]},s.id)})})}function dA(){const e=y(s=>s.busbarDrawStart),t=y(s=>s.cursorSvg);if(!e||!t)return null;const n=t[0]-e[0],o=t[1]-e[1],r=Math.abs(n)>=Math.abs(o),i=r?t[0]:e[0],a=r?e[1]:t[1];return d.jsxs("g",{className:"ole-busbar-preview",pointerEvents:"none",children:[d.jsx("line",{x1:e[0],y1:e[1],x2:i,y2:a,className:"ole-busbar-preview-line"}),d.jsx("circle",{cx:e[0],cy:e[1],r:3.5,className:"ole-busbar-preview-anchor"}),d.jsx("circle",{cx:i,cy:a,r:3.5,className:"ole-busbar-preview-anchor"})]})}const uA=2.5,mA=9,pA=13,hA=-13,fA=4.5,gA=8;function bA(){const e=y(s=>s.internal.junctions),t=y(s=>s.selection),n=y(s=>s.selectedNode),o=y(s=>s.internal.nodes),r=y(s=>s.internal.terminalToNode),i=new Set(t),a=new Set;if(n){const s=o.get(n);if(s)for(const l of s.terminals)a.add(l)}return d.jsx("g",{className:"ole-junction-layer",children:Array.from(e.values()).map(({junction:s,world:l,degree:c})=>{const u=r.get(s.id)??void 0,m=t.length===1&&t[0]===s.id,h=l[0]+pA,g=l[1]+hA;return d.jsxs("g",{"data-junction-id":s.id,"data-element-id":s.id,"data-node-id":u,"data-solder":c>=3?"true":void 0,"data-selected":i.has(s.id)?"true":void 0,"data-node-related":a.has(s.id)?"true":void 0,className:"ole-junction",children:[d.jsx("circle",{cx:l[0],cy:l[1],r:mA,fill:"transparent",className:"ole-junction-hit"}),d.jsx("circle",{cx:l[0],cy:l[1],r:uA,className:"ole-junction-dot"}),m&&d.jsxs("g",{className:"ole-junction-wire-handle-group",children:[d.jsx("line",{x1:l[0],y1:l[1],x2:h,y2:g,className:"ole-junction-wire-handle-stem"}),d.jsx("circle",{cx:h,cy:g,r:gA,fill:"transparent",className:"ole-junction-wire-handle"}),d.jsx("circle",{cx:h,cy:g,r:fA,className:"ole-junction-wire-handle-dot"})]})]},s.id)})})}function ot(e){const t=[`translate(${e.at[0]} ${e.at[1]})`];return e.rot&&t.push(`rotate(${e.rot})`),e.mirror&&t.push("scale(-1 1)"),t.join(" ")}function yA(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function xA({lib:e}){const t=yA(e.viewBox);return t?d.jsx("rect",{className:"ole-element-hit",x:t.x,y:t.y,width:t.w,height:t.h}):null}function wA(){const e=y(s=>s.internal.elements),t=y(s=>s.internal.layout),n=y(s=>s.selection),o=y(s=>s.selectedNode),r=y(s=>s.internal.nodes),i=new Set(n),a=new Set;if(o){const s=r.get(o);if(s)for(const l of s.terminals){const c=l.indexOf(".");c>0&&a.add(l.slice(0,c))}}return d.jsx("g",{className:"ole-element-layer",children:Array.from(e.values()).map(s=>{const l=t.get(s.element.id);if(!l)return null;const c=i.has(s.element.id),u=a.has(s.element.id);return s.libraryDef?d.jsxs("g",{"data-element-id":s.element.id,"data-selected":c?"true":void 0,"data-node-related":u?"true":void 0,transform:ot(l),className:"ole-element",children:[d.jsx(xA,{lib:s.libraryDef}),d.jsx("g",{dangerouslySetInnerHTML:{__html:s.libraryDef.svg}}),s.libraryDef.terminalLabelsSvg&&d.jsx("g",{className:"ole-terminal-labels",dangerouslySetInnerHTML:{__html:s.libraryDef.terminalLabelsSvg}})]},s.element.id):d.jsxs("g",{"data-element-id":s.element.id,"data-selected":c?"true":void 0,"data-node-related":u?"true":void 0,transform:ot(l),className:"ole-element ole-element--unknown",children:[d.jsx("rect",{x:-10,y:-10,width:20,height:20,fill:"none",stroke:"#EF4444",strokeWidth:1,strokeDasharray:"2 2"}),d.jsx("text",{x:0,y:4,fontSize:8,fill:"#EF4444",textAnchor:"middle",fontFamily:"system-ui, sans-serif",children:"?"})]},s.element.id)})})}let dk=null;const ko=new Set;function mn(e){dk=e;for(const t of ko)t(e)}function vA(){return dk}function kA(e){return ko.add(e),()=>{ko.delete(e)}}function SA(){const[e,t]=I.useState(vA());return I.useEffect(()=>kA(t),[]),!e||e.w===0&&e.h===0?null:d.jsx("rect",{className:"ole-marquee",x:e.x,y:e.y,width:e.w,height:e.h,pointerEvents:"none"})}function _A(){const e=y(c=>c.activeTool),t=y(c=>c.placeKind),n=y(c=>c.cursorSvg),o=y(c=>c.placeFromTerminal);if(e!=="place"||!t||!n)return null;const r=Gv(t);if(!r)return null;let i=null,a=null;if(o){const c=Yv(o,n);c&&(i=Zv(r,c,n),a={source:c.world,pin:n})}else i=Xv(r);const s=n[0]-((i==null?void 0:i.x)??0),l=n[1]-((i==null?void 0:i.y)??0);return d.jsxs("g",{className:"ole-place-ghost-group",pointerEvents:"none",children:[a&&d.jsxs(d.Fragment,{children:[d.jsx("line",{x1:a.source[0],y1:a.source[1],x2:a.pin[0],y2:a.pin[1],className:"ole-wire-preview-line"}),d.jsx("circle",{cx:a.source[0],cy:a.source[1],r:4,className:"ole-wire-preview-anchor"})]}),d.jsx("g",{className:"ole-place-ghost",transform:`translate(${s} ${l})`,opacity:.5,children:d.jsx("g",{dangerouslySetInnerHTML:{__html:r.svg}})})]})}function CA(){const e=y(r=>r.selection),t=y(r=>r.internal.elements),n=y(r=>r.internal.layout),o=y(r=>r.internal.buses);return e.length===0?null:d.jsx("g",{className:"ole-selection-overlay",pointerEvents:"none",children:e.map(r=>{const i=o.get(r);if(i){const{axis:c,at:u,span:m}=i.geometry,h=m/2,g=c==="x"?u[0]-h:u[0]-4,p=c==="x"?u[1]-4:u[1]-h,f=c==="x"?m:8,b=c==="x"?8:m;return d.jsx("rect",{x:g,y:p,width:f,height:b,fill:"none",className:"ole-selection-rect"},r)}const a=t.get(r),s=n.get(r);if(!(a!=null&&a.libraryDef)||!s)return null;const l=$A(a.libraryDef.viewBox);return l?d.jsx("rect",{x:l.x,y:l.y,width:l.w,height:l.h,fill:"none",className:"ole-selection-rect",transform:ot(s)},r):null})})}function $A(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function jA(){const e=y(i=>i.internal.terminals),t=y(i=>i.internal.terminalToNode),n=y(i=>i.wireFromTerminal),o=y(i=>i.selection),r=new Set(o);return d.jsx("g",{className:"ole-terminal-layer",children:Array.from(e.values()).map(i=>{const a=t.get(i.ref),s=a!==void 0,l=n===i.ref,c=r.has(i.elementId);return d.jsx("circle",{cx:i.world[0],cy:i.world[1],r:3,"data-element-id":i.elementId,"data-terminal-id":i.ref,"data-node-id":a,"data-connected":s?"true":"false","data-active":l?"true":void 0,"data-on-selected":c?"true":void 0,className:"ole-terminal"},i.ref)})})}const qr=4;function AA(e,t,n,o){const r=t[0]-e[0],i=t[1]-e[1],a=o[0]-n[0],s=o[1]-n[1],l=r*s-i*a;if(Math.abs(l)<1e-9)return null;const c=((n[0]-e[0])*s-(n[1]-e[1])*a)/l,u=((n[0]-e[0])*i-(n[1]-e[1])*r)/l,m=1e-6;return c<=m||c>=1-m||u<=m||u>=1-m?null:[e[0]+c*r,e[1]+c*i]}function EA(e,t){const n=[];let o=[e[0]];for(let r=0;r<e.length-1;r++){const i=e[r],a=e[r+1],s=t.get(r);if(!s||s.length===0){o.push(a);continue}const l=a[0]-i[0],c=a[1]-i[1],u=Math.hypot(l,c)||1,m=l/u,h=c/u,g=f=>(f[0]-i[0])*m+(f[1]-i[1])*h,p=s.slice().sort((f,b)=>g(f)-g(b));for(const f of p){const b=g(f),x=Math.max(0,b-qr),v=Math.min(u,b+qr);o.push([i[0]+m*x,i[1]+h*x]),n.push(o),o=[[i[0]+m*v,i[1]+h*v]]}o.push(a)}return n.push(o),n.filter(r=>r.length>=2)}function NA(){const e=y(c=>c.internal.wireRenders),t=y(c=>c.internal.terminalToNode),n=y(c=>c.diagram.wires),o=y(c=>c.selectedWire),r=y(c=>c.selectedNode),i=new Map;for(const c of n??[]){const u=t.get(c.ends[0]);u&&i.set(c.id,u)}const a=Array.from(e.values()).filter(c=>c.path.length>=2),s=[];for(const c of a){const u=i.get(c.wireId);for(let m=0;m<c.path.length-1;m++)s.push({wireId:c.wireId,node:u,i:m,a:c.path[m],b:c.path[m+1]})}const l=new Map;for(let c=0;c<s.length;c++)for(let u=c+1;u<s.length;u++){const m=s[c],h=s[u];if(m.wireId===h.wireId||!(m.node&&h.node&&m.node!==h.node))continue;const g=AA(m.a,m.b,h.a,h.b);if(!g)continue;const p=m.wireId<h.wireId?m:h;let f=l.get(p.wireId);f||(f=new Map,l.set(p.wireId,f));const b=f.get(p.i)??[];b.push(g),f.set(p.i,b)}return d.jsx("g",{className:"ole-wire-layer",fill:"none",stroke:"currentColor",strokeWidth:1,children:a.flatMap(c=>{const u=c.path,m=u.map(v=>`${v[0]},${v[1]}`).join(" "),h=i.get(c.wireId),g=o===c.wireId,p=r!=null&&r===h,f=g||p?"true":void 0,b=l.get(c.wireId),x=b?EA(u,b):[u];return[d.jsx("polyline",{"data-wire-id":c.wireId,"data-node-id":h,className:"ole-wire-hit",points:m},`hit-${c.wireId}`),...x.map((v,P)=>d.jsx("polyline",{"data-wire-id":c.wireId,"data-node-id":h,"data-manual":c.userEdited?"true":void 0,"data-selected":f,className:"ole-wire",points:v.map(T=>`${T[0]},${T[1]}`).join(" ")},`${c.wireId}-${P}`))]})})}let st=null;const So=new Set;function nt(e){if(!(e===null&&st===null||e&&st&&e.ref===st.ref&&e.world[0]===st.world[0]&&e.world[1]===st.world[1])){st=e;for(const t of So)t(e)}}function TA(){return st}function PA(e){return So.add(e),()=>{So.delete(e)}}function IA(){const e=y(l=>l.wireDragFrom),t=y(l=>l.cursorSvg),[n,o]=I.useState(TA());if(I.useEffect(()=>PA(o),[]),!e||!t)return null;const r=e.world,i=(n==null?void 0:n.world[0])??t[0],a=(n==null?void 0:n.world[1])??t[1],s=(n==null?void 0:n.create)==="junction";return d.jsxs("g",{className:"ole-wire-preview",pointerEvents:"none",children:[d.jsx("line",{x1:r[0],y1:r[1],x2:i,y2:a,className:"ole-wire-preview-line"}),d.jsx("circle",{cx:r[0],cy:r[1],r:4,className:"ole-wire-preview-anchor"}),n&&d.jsxs(d.Fragment,{children:[d.jsx("circle",{cx:n.world[0],cy:n.world[1],r:n.isBus?7:8,className:"ole-wire-preview-target-ring","data-create":s?"true":void 0}),!s&&d.jsx("circle",{cx:n.world[0],cy:n.world[1],r:n.isBus?3:4,className:"ole-wire-preview-target-dot"})]})]})}function ct(e,t){return e instanceof Element?e.closest(`[${t}]`):null}function xt(e){var t;return((t=ct(e,"data-element-id"))==null?void 0:t.getAttribute("data-element-id"))??null}function zA(e){var t;return((t=ct(e,"data-bus-id"))==null?void 0:t.getAttribute("data-bus-id"))??null}function MA(e){var t;return((t=ct(e,"data-junction-id"))==null?void 0:t.getAttribute("data-junction-id"))??null}function On(e){var r;const t=(r=ct(e,"data-terminal-id"))==null?void 0:r.getAttribute("data-terminal-id");if(t)return t;const n=MA(e);if(n)return n;const o=zA(e);return o||null}function Ln(e){var t;return((t=ct(e,"data-node-id"))==null?void 0:t.getAttribute("data-node-id"))??null}function _o(e){var t;return((t=ct(e,"data-wire-id"))==null?void 0:t.getAttribute("data-wire-id"))??null}function Xt(e){var t;return((t=ct(e,"data-annotation-id"))==null?void 0:t.getAttribute("data-annotation-id"))??null}function uk(e,t){try{e.dispatchEvent(new PointerEvent("pointercancel",{pointerId:t,bubbles:!0,cancelable:!0,pointerType:"touch"}))}catch{}}function DA(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable}function mk(){const e=y.getState(),t=e.activeTool;if(e.editingAnnotation||e.editingElement){if(typeof document<"u"){const n=document.querySelector(".ole-free-annotation-edit-fo div[contenteditable], .ole-element-name-editor div[contenteditable], .ole-ann-cell-edit-fo input");n==null||n.blur()}e.setEditingAnnotation(null),e.setEditingElement(null);return}if(t==="wire"||t==="busbar"||t==="junction"||t==="text"||t==="rect"||t==="line"||t==="table"){e.setActiveTool("select");return}if(t==="place"){e.placeFromTerminal?e.setPlaceFromTerminal(null):e.placeKind?e.setPlaceKind(null):e.setActiveTool("select");return}(e.selectedNode||e.selectedWire||e.selection.length>0||e.selectedAnnotations.length>0)&&e.clearSelection()}function RA(){I.useEffect(()=>{const e=t=>{if(DA(t.target)||y.getState().readOnly)return;const n=t.metaKey||t.ctrlKey,o=y.getState();if(n&&t.key.toLowerCase()==="z"){t.preventDefault(),t.shiftKey?o.redo():o.undo();return}if(n&&!t.shiftKey&&t.key.toLowerCase()==="y"){t.preventDefault(),o.redo();return}if(n&&t.key.toLowerCase()==="a"){t.preventDefault();const r=y.getState().diagram.elements.map(i=>i.id);o.setSelection(r);return}if(n&&!t.shiftKey&&!t.altKey){const r=t.key.toLowerCase(),i=o.selection.length>0||o.selectedAnnotations.length>0;if(r==="c"){if(!i)return;t.preventDefault(),o.copySelection();return}if(r==="x"){if(!i)return;t.preventDefault(),o.cutSelection();return}if(r==="v"){if(!o.clipboard)return;t.preventDefault(),o.pasteClipboard();return}}if(!n)switch(t.key){case"v":case"V":o.setActiveTool("select");return;case"h":case"H":o.setActiveTool("pan");return;case"w":case"W":o.setActiveTool("wire");return;case"b":case"B":o.setActiveTool("busbar");return;case"j":case"J":o.setActiveTool("junction");return;case"p":case"P":o.setActiveTool("place");return;case"t":case"T":o.setActiveTool("text");return;case"f":case"F":o.setActiveTool("rect");return;case"l":case"L":o.setActiveTool("line");return;case"d":case"D":o.setActiveTool("table");return;case"r":case"R":o.selection.length>0&&(t.preventDefault(),o.rotateSelection(90));return;case"m":case"M":o.selection.length>0&&(t.preventDefault(),o.mirrorSelection());return;case"Delete":case"Backspace":o.selection.length>0||o.selectedAnnotations.length>0?(t.preventDefault(),o.deleteSelection()):o.selectedWire?(t.preventDefault(),o.deleteSelectedWire()):o.selectedNode&&(t.preventDefault(),o.deleteSelectedNode());return;case"Escape":mk();return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[])}let Co=null;const $o=new Set;function OA(e){if(e!==Co){Co=e;for(const t of $o)t(e)}}function LA(){return Co}function BA(e){return $o.add(e),()=>{$o.delete(e)}}const Gr="ole-hover-element-host",HA="ole-hover-terminal-on",FA="ole-hover-node-on";function WA(e){I.useEffect(()=>{const t=e.current;if(!t)return;let n=null,o=null;const r=new Set,i=new Set,a=(m,h,g)=>{for(const p of m)p.classList.remove(g);m.clear();for(const p of h)p.classList.add(g),m.add(p)},s=m=>{var g,p;if(m===n)return;n&&((g=t.querySelector(`[data-element-id="${pn(n)}"]`))==null||g.classList.remove(Gr)),m&&((p=t.querySelector(`[data-element-id="${pn(m)}"]`))==null||p.classList.add(Gr));const h=m?Array.from(t.querySelectorAll(`.ole-terminal[data-element-id="${pn(m)}"]`)):[];a(r,h,HA),n=m,m?t.setAttribute("data-hover-element",""):t.removeAttribute("data-hover-element"),OA(m)},l=m=>{if(m===o)return;const h=m?Array.from(t.querySelectorAll(`[data-node-id="${pn(m)}"]`)):[];a(i,h,FA),o=m,m?t.setAttribute("data-hover-node",""):t.removeAttribute("data-hover-node")},c=m=>{s(xt(m.target));const h=On(m.target);let g=null;h?g=y.getState().internal.terminalToNode.get(h)??null:g=Ln(m.target),l(g)},u=()=>{s(null),l(null)};return t.addEventListener("pointermove",c),t.addEventListener("pointerleave",u),()=>{t.removeEventListener("pointermove",c),t.removeEventListener("pointerleave",u),s(null),l(null)}},[e])}function pn(e){return e.replace(/(["\\])/g,"\\$1")}function qA(e,t,n){const o=[];for(const i of e.elements.values()){if(!i.libraryDef)continue;const a=e.layout.get(i.element.id);if(!a)continue;const s=VA(i.libraryDef.viewBox);if(!s)continue;const l=[[s.x,s.y],[s.x+s.w,s.y],[s.x,s.y+s.h],[s.x+s.w,s.y+s.h]].map(([g,p])=>GA([g,p],a));let c=1/0,u=-1/0,m=1/0,h=-1/0;for(const[g,p]of l)g<c&&(c=g),g>u&&(u=g),p<m&&(m=p),p>h&&(h=p);hn(n,c,m,u,h)&&o.push(i.element.id)}for(const{bus:i,geometry:a}of e.buses.values()){const{axis:s,at:l,span:c}=a,u=c/2,m=s==="x"?l[0]-u:l[0],h=s==="x"?l[0]+u:l[0],g=s==="x"?l[1]:l[1]-u,p=s==="x"?l[1]:l[1]+u;hn(n,m,g,h,p)&&o.push(i.id)}for(const{junction:i,world:a}of e.junctions.values())hn(n,a[0],a[1],a[0],a[1])&&o.push(i.id);const r=[];for(const i of t??[]){const a=ik(i);hn(n,a.minX,a.minY,a.maxX,a.maxY)&&r.push(i.id)}return{elements:o,annotations:r}}function hn(e,t,n,o,r){return o>=e.x&&t<=e.x+e.w&&r>=e.y&&n<=e.y+e.h}function GA(e,t){let[n,o]=e;switch(t.mirror&&(n=-n),t.rot){case 0:break;case 90:[n,o]=[-o,n];break;case 180:[n,o]=[-n,-o];break;case 270:[n,o]=[o,-n];break}return[n+t.at[0],o+t.at[1]]}function VA(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function KA(e,t){const n=y.getState().internal;if(!e.includes(".")){const r=n.buses.get(e);if(r){const{axis:a,at:s,span:l}=r.geometry;if(a==="x"){const h=s[0]-l/2,g=s[0]+l/2,p=Math.max(h,Math.min(g,t[0]));return{ref:e,world:[p,s[1]],isBus:!0}}const c=s[1]-l/2,u=s[1]+l/2,m=Math.max(c,Math.min(u,t[1]));return{ref:e,world:[s[0],m],isBus:!0}}const i=n.junctions.get(e);return i?{ref:e,world:[i.world[0],i.world[1]],isBus:!1}:null}const o=n.terminals.get(e);return o?{ref:e,world:o.world,isBus:!1}:null}const Vr=10,fn=e=>Math.round(e/Vr)*Vr,UA=16;function pk(e,t){let n=e[0],o=1/0;for(let r=0;r<e.length-1;r++){const[i,a]=e[r],[s,l]=e[r+1],c=s-i,u=l-a,m=c*c+u*u,h=m===0?0:Math.max(0,Math.min(1,((t[0]-i)*c+(t[1]-a)*u)/m)),g=i+h*c,p=a+h*u,f=(g-t[0])**2+(p-t[1])**2;f<o&&(o=f,n=[g,p])}return n}function jn(e,t){return typeof document<"u"?document.elementFromPoint(e,t):null}function XA(e,t){const n=y.getState().internal.wireRenders;let o=null,r=t;for(const i of n.values()){if(i.path.length<2)continue;const a=pk(i.path,e),s=Math.hypot(a[0]-e[0],a[1]-e[1]);s<=r&&(r=s,o={wireId:i.wireId,at:a})}return o}function Ft(e,t,n){const o=e?On(e):null;if(o){const s=KA(o,t);if(s)return{spec:{end:o},world:s.world,ref:o,isBus:s.isBus,create:!1}}let r=e?_o(e):null,i=null;if(r){const s=y.getState().internal.wireRenders.get(r);i=s?pk(s.path,t):t}else{const s=XA(t,n);s&&(r=s.wireId,i=s.at)}if(r&&i){const s=[fn(i[0]),fn(i[1])];return{spec:{onWire:r,at:s},world:s,ref:null,isBus:!1,create:!0}}const a=[fn(t[0]),fn(t[1])];return{spec:{junctionAt:a},world:a,ref:null,isBus:!1,create:!0}}function Wt(e,t,n){const o=e.viewport.screenToSvg(t,n),r=e.viewport.screenToSvg(t+UA,n);return Math.hypot(r[0]-o[0],r[1]-o[1])}function hk(e){return{ref:e.ref,world:e.world,isBus:e.isBus,...e.create?{create:"junction"}:{}}}function An(e,t){return e.ref&&t.ref?e.ref===t.ref:!e.ref&&!t.ref?e.world[0]===t.world[0]&&e.world[1]===t.world[1]:!1}const Kr=3;let de=null,Ee=null,Ne=null,fe=null;const YA={id:"select",cursor:"default",onPointerDown(e,t){var m,h,g,p,f,b,x,v,P,T,B,V;if(e.button!==0||e.target instanceof Element&&e.target.closest(".ole-bus-handle, .ole-wire-handle, .ole-annotation-handle"))return;const n=y.getState(),o=Xt(e.target);if(o){e.preventDefault(),e.stopPropagation();const S=(m=n.diagram.annotations)==null?void 0:m.find(F=>F.id===o);if(!S)return;if(e.shiftKey){n.toggleAnnotationInSelection(o);return}if(n.selectedAnnotations.includes(o)&&n.selection.length+n.selectedAnnotations.length>1){Ur(e,t,n.selection,n.selectedAnnotations);return}const H=vt(n)===o;n.setSelectedAnnotation(o),fe={pointerId:e.pointerId,id:o,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),origin:[S.at[0],S.at[1]],moved:!1,wasSelected:H};return}const r=e.target instanceof Element?e.target.closest(".ole-junction-wire-handle"):null;if(r){const S=(h=r.closest("[data-junction-id]"))==null?void 0:h.getAttribute("data-junction-id");if(S){e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((p=(g=e.target).hasPointerCapture)!=null&&p.call(g,e.pointerId))&&e.target.releasePointerCapture(e.pointerId),t.hostEl.classList.add("tool-wire"),n.setWireFromTerminal(S);const H=(f=n.internal.junctions.get(S))==null?void 0:f.world;H&&n.setWireDragFrom({spec:{end:S},world:H,ref:S}),n.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY)),Ne={pointerId:e.pointerId,fromRef:S};return}}const a=(e.target instanceof Element?(b=e.target.closest("[data-terminal-id]"))==null?void 0:b.getAttribute("data-terminal-id"):null)?On(e.target):null;if(a){const S=a.indexOf("."),H=S>0?a.slice(0,S):"";if(H&&n.selection.includes(H)){e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((v=(x=e.target).hasPointerCapture)!=null&&v.call(x,e.pointerId))&&e.target.releasePointerCapture(e.pointerId),t.hostEl.classList.add("tool-wire"),n.setWireFromTerminal(a);const F=(P=n.internal.terminals.get(a))==null?void 0:P.world;F&&n.setWireDragFrom({spec:{end:a},world:F,ref:a}),n.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY)),Ne={pointerId:e.pointerId,fromRef:a};return}}let s=xt(e.target);if(!s){const S=_o(e.target);if(S&&typeof document<"u"){const H=document.elementsFromPoint(e.clientX,e.clientY);for(const F of H){const Z=(B=(T=F.closest)==null?void 0:T.call(F,"[data-bus-id]"))==null?void 0:B.getAttribute("data-bus-id");if(!Z)continue;const R=(V=n.diagram.wires)==null?void 0:V.find(W=>W.id===S);R&&(R.ends[0]===Z||R.ends[1]===Z)&&(s=Z);break}}}if(!s){const S=_o(e.target);if(S){if(e.preventDefault(),e.altKey){const H=Ln(e.target);if(H){n.setSelectedNode(H);return}}n.setSelectedWire(S);return}e.shiftKey||n.clearSelection(),Ee={pointerId:e.pointerId,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),shiftKey:e.shiftKey,baseSelection:e.shiftKey?n.selection.slice():[],baseAnnotations:e.shiftKey?n.selectedAnnotations.slice():[]},t.hostEl.setPointerCapture(e.pointerId),e.preventDefault();return}const l=n.selection;e.shiftKey?n.toggleInSelection(s):l.includes(s)||n.setSelection([s]);const c=y.getState(),u=e.shiftKey?c.selection:l.includes(s)?l:[s];Ur(e,t,u,c.selectedAnnotations)&&e.preventDefault()},onPointerMove(e,t){if(fe&&e.pointerId===fe.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=ue(n[0]-fe.startSvg[0]),r=ue(n[1]-fe.startSvg[1]);!fe.moved&&(o!==0||r!==0)&&(fe.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));const i=t.hostEl.querySelector(`[data-annotation-id="${ze(fe.id)}"]`);i&&i.setAttribute("transform",`translate(${o} ${r})`);return}if(Ne&&e.pointerId===Ne.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY);y.getState().setCursorSvg(n);const o=jn(e.clientX,e.clientY),r=Ft(o,n,Wt(t,e.clientX,e.clientY)),i={spec:{end:Ne.fromRef},world:[0,0],ref:Ne.fromRef};nt(An(i,r)?null:hk(r));return}if(de&&e.pointerId===de.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=ue(n[0]-de.startSvg[0]),r=ue(n[1]-de.startSvg[1]);!de.moved&&(o!==0||r!==0)&&(de.moved=!0,t.hostEl.hasPointerCapture(e.pointerId)||t.hostEl.setPointerCapture(e.pointerId));for(const[i,a]of de.originals){const s=t.hostEl.querySelector(`[data-element-id="${ze(i)}"]`);if(!s)continue;const l={...a,at:[a.at[0]+o,a.at[1]+r]};s.setAttribute("transform",ot(l))}for(const i of de.busOriginals.keys()){const a=t.hostEl.querySelector(`[data-element-id="${ze(i)}"]`);a&&a.setAttribute("transform",`translate(${o} ${r})`)}for(const i of de.junctionOriginals.keys()){const a=t.hostEl.querySelector(`[data-element-id="${ze(i)}"]`);a&&a.setAttribute("transform",`translate(${o} ${r})`)}for(const i of de.annotationOriginals.keys()){const a=t.hostEl.querySelector(`[data-annotation-id="${ze(i)}"]`);a&&a.setAttribute("transform",`translate(${o} ${r})`)}return}if(Ee&&e.pointerId===Ee.pointerId){const n=t.viewport.screenToSvg(e.clientX,e.clientY);mn(Yr(Ee.startSvg,n));return}},onPointerUp(e,t){var n;if(fe&&e.pointerId===fe.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=ue(o[0]-fe.startSvg[0]),i=ue(o[1]-fe.startSvg[1]),a=t.hostEl.querySelector(`[data-annotation-id="${ze(fe.id)}"]`);if(a&&a.removeAttribute("transform"),fe.moved&&(r!==0||i!==0))y.getState().updateAnnotation(fe.id,{at:[fe.origin[0]+r,fe.origin[1]+i]});else if(!fe.moved&&fe.wasSelected){const s=y.getState(),l=(n=s.diagram.annotations)==null?void 0:n.find(c=>c.id===fe.id);l&&Xr(s,l,o)}fe=null;return}if(Ne&&e.pointerId===Ne.pointerId){const o=y.getState(),r=Ne.fromRef;Ne=null,t.hostEl.classList.remove("tool-wire"),o.setWireFromTerminal(null),o.setWireDragFrom(null),o.setCursorSvg(null),nt(null);const i=t.viewport.screenToSvg(e.clientX,e.clientY),a=jn(e.clientX,e.clientY)??(e.target instanceof Element?e.target:null),s=Ft(a,i,Wt(t,e.clientX,e.clientY));if(An({world:[0,0],ref:r},s))return;o.connectWire({end:r},s.spec);return}if(de&&e.pointerId===de.pointerId){if(t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId),de.moved){const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=ue(o[0]-de.startSvg[0]),i=ue(o[1]-de.startSvg[1]);if(r!==0||i!==0){const a=new Map;for(const l of de.originals.keys())a.set(l,[r,i]);for(const l of de.busOriginals.keys())a.set(l,[r,i]);for(const l of de.junctionOriginals.keys())a.set(l,[r,i]);const s=new Map;for(const l of de.annotationOriginals.keys())s.set(l,[r,i]);y.getState().moveElements(a,s)}for(const a of de.busOriginals.keys()){const s=t.hostEl.querySelector(`[data-element-id="${ze(a)}"]`);s&&s.removeAttribute("transform")}for(const a of de.junctionOriginals.keys()){const s=t.hostEl.querySelector(`[data-element-id="${ze(a)}"]`);s&&s.removeAttribute("transform")}for(const a of de.annotationOriginals.keys()){const s=t.hostEl.querySelector(`[data-annotation-id="${ze(a)}"]`);s&&s.removeAttribute("transform")}}de=null;return}if(Ee&&e.pointerId===Ee.pointerId){t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId);const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=Yr(Ee.startSvg,o);if(r.w>=Kr||r.h>=Kr){const i=y.getState(),a=qA(i.internal,i.diagram.annotations,r);Ee.shiftKey?i.setSelection(Zr(Ee.baseSelection,a.elements),Zr(Ee.baseAnnotations,a.annotations)):i.setSelection(a.elements,a.annotations)}mn(null),Ee=null}},onPointerCancel(e,t){var n,o,r,i,a,s;if(fe&&e.pointerId===fe.pointerId){const l=t.hostEl.querySelector(`[data-annotation-id="${ze(fe.id)}"]`);if(l&&l.removeAttribute("transform"),(o=(n=t.hostEl).hasPointerCapture)!=null&&o.call(n,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}fe=null}if(de&&e.pointerId===de.pointerId){for(const[l,c]of de.originals){const u=t.hostEl.querySelector(`[data-element-id="${ze(l)}"]`);u&&u.setAttribute("transform",ot(c))}for(const l of de.busOriginals.keys()){const c=t.hostEl.querySelector(`[data-element-id="${ze(l)}"]`);c&&c.removeAttribute("transform")}for(const l of de.junctionOriginals.keys()){const c=t.hostEl.querySelector(`[data-element-id="${ze(l)}"]`);c&&c.removeAttribute("transform")}for(const l of de.annotationOriginals.keys()){const c=t.hostEl.querySelector(`[data-annotation-id="${ze(l)}"]`);c&&c.removeAttribute("transform")}if((i=(r=t.hostEl).hasPointerCapture)!=null&&i.call(r,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}de=null}if(Ne&&e.pointerId===Ne.pointerId){t.hostEl.classList.remove("tool-wire");const l=y.getState();l.setWireFromTerminal(null),l.setWireDragFrom(null),l.setCursorSvg(null),nt(null),Ne=null}if(Ee&&e.pointerId===Ee.pointerId){if((s=(a=t.hostEl).hasPointerCapture)!=null&&s.call(a,e.pointerId))try{t.hostEl.releasePointerCapture(e.pointerId)}catch{}mn(null),Ee=null}},onDoubleClick(e,t){var i;const n=y.getState(),o=Xt(e.target);if(o){e.preventDefault(),e.stopPropagation();const a=(i=n.diagram.annotations)==null?void 0:i.find(s=>s.id===o);if(!a)return;n.setSelectedAnnotation(o),Xr(n,a,t.viewport.screenToSvg(e.clientX,e.clientY));return}const r=xt(e.target);r&&(e.preventDefault(),e.stopPropagation(),n.setEditingElement(r))},onDeactivate(e){if(de=null,Ee=null,fe=null,Ne){e.hostEl.classList.remove("tool-wire");const t=y.getState();t.setWireFromTerminal(null),t.setWireDragFrom(null),t.setCursorSvg(null),nt(null),Ne=null}mn(null)}};function Ur(e,t,n,o){const r=y.getState(),i=r.internal,a=new Map,s=new Map,l=new Map,c=new Map;for(const m of n){const h=i.buses.get(m);if(h){s.set(m,[h.geometry.at[0],h.geometry.at[1]]);continue}const g=i.junctions.get(m);if(g){l.set(m,[g.world[0],g.world[1]]);continue}const p=i.layout.get(m);p&&a.set(m,{...p})}const u=r.diagram.annotations??[];for(const m of o){const h=u.find(g=>g.id===m);h&&c.set(m,[h.at[0],h.at[1]])}return a.size===0&&s.size===0&&l.size===0&&c.size===0?!1:(de={pointerId:e.pointerId,startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),originals:a,busOriginals:s,junctionOriginals:l,annotationOriginals:c,moved:!1},!0)}function Xr(e,t,n){const o=Oe(t);if(o==="table"){const r=Lj(t,n);r&&(e.setEditingAnnotation(t.id),e.setEditingCell(r))}else o==="text"&&e.setEditingAnnotation(t.id)}function Yr(e,t){const n=Math.min(e[0],t[0]),o=Math.min(e[1],t[1]),r=Math.abs(t[0]-e[0]),i=Math.abs(t[1]-e[1]);return{x:n,y:o,w:r,h:i}}function Zr(e,t){const n=new Set(e);for(const o of t)n.has(o)?n.delete(o):n.add(o);return[...n]}function ze(e){return e.replace(/(["\\])/g,"\\$1")}const ZA=4;let le=null;const QA={id:"pan",cursor:"grab",onPointerDown(e,t){if(e.button!==0)return;const n=t.viewport.getViewport(),o=y.getState().readOnly?null:xt(e.target);let r=null;if(o){const i=y.getState();i.selection.includes(o)||i.setSelection([o]);const a=y.getState().selection,s=y.getState().internal,l=new Map,c=new Map;for(const u of a){const m=s.buses.get(u);if(m){c.set(u,[m.geometry.at[0],m.geometry.at[1]]);continue}const h=s.layout.get(u);h&&l.set(u,{...h})}(l.size>0||c.size>0)&&(r={startSvg:t.viewport.screenToSvg(e.clientX,e.clientY),originals:l,busOriginals:c})}le={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,startTx:n.tx,startTy:n.ty,startTarget:e.target,moved:!1,elementDrag:r},t.hostEl.style.cursor="grabbing",e.preventDefault()},onPointerMove(e,t){if(!le||e.pointerId!==le.pointerId)return;const n=e.clientX-le.startX,o=e.clientY-le.startY;if(!le.moved&&Math.hypot(n,o)>ZA){le.moved=!0;try{t.hostEl.setPointerCapture(e.pointerId)}catch{}}if(le.moved){if(le.elementDrag){const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=ue(r[0]-le.elementDrag.startSvg[0]),a=ue(r[1]-le.elementDrag.startSvg[1]);for(const[s,l]of le.elementDrag.originals){const c=t.hostEl.querySelector(`[data-element-id="${zt(s)}"]`);if(!c)continue;const u={...l,at:[l.at[0]+i,l.at[1]+a]};c.setAttribute("transform",ot(u))}for(const s of le.elementDrag.busOriginals.keys()){const l=t.hostEl.querySelector(`[data-element-id="${zt(s)}"]`);l&&l.setAttribute("transform",`translate(${i} ${a})`)}return}t.viewport.setViewport({tx:le.startTx+n,ty:le.startTy+o})}},onPointerUp(e,t){if(!(!le||e.pointerId!==le.pointerId)){if(t.hostEl.hasPointerCapture(e.pointerId)&&t.hostEl.releasePointerCapture(e.pointerId),t.hostEl.style.cursor="grab",le.elementDrag&&le.moved){const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=ue(n[0]-le.elementDrag.startSvg[0]),r=ue(n[1]-le.elementDrag.startSvg[1]);if(o!==0||r!==0){const i=new Map;for(const a of le.elementDrag.originals.keys())i.set(a,[o,r]);for(const a of le.elementDrag.busOriginals.keys())i.set(a,[o,r]);y.getState().moveElements(i)}for(const i of le.elementDrag.busOriginals.keys()){const a=t.hostEl.querySelector(`[data-element-id="${zt(i)}"]`);a&&a.removeAttribute("transform")}}else!le.moved&&!y.getState().readOnly&&JA(le.startTarget);le=null}},onPointerCancel(e,t){if(le!=null&&le.elementDrag){for(const[n,o]of le.elementDrag.originals){const r=t.hostEl.querySelector(`[data-element-id="${zt(n)}"]`);r&&r.setAttribute("transform",ot(o))}for(const n of le.elementDrag.busOriginals.keys()){const o=t.hostEl.querySelector(`[data-element-id="${zt(n)}"]`);o&&o.removeAttribute("transform")}}le=null},onDeactivate(){le=null}};function JA(e){if(!e)return;const t=y.getState(),n=Xt(e);if(n){t.setSelectedAnnotation(n);return}const o=xt(e);if(o){t.setSelection([o]);return}const r=Ln(e);if(r){t.setSelectedNode(r);return}t.clearSelection()}function zt(e){return e.replace(/(["\\])/g,"\\$1")}const Rt={tight:1024,compact:720,dense:520,mini:380},Qr={full:0,tight:1,compact:2,dense:3,mini:4};function Re(e,t){return Qr[e]>=Qr[t]}function eE(e){return e>=Rt.tight?"full":e>=Rt.compact?"tight":e>=Rt.dense?"compact":e>=Rt.mini?"dense":"mini"}const fk=I.createContext("full");function it(){return I.useContext(fk)}function tE(e){const[t,n]=I.useState(null);return I.useLayoutEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const a=o.clientWidth;n(s=>s===a?s:a)};if(r(),typeof ResizeObserver>"u")return;const i=new ResizeObserver(r);return i.observe(o),()=>i.disconnect()},[e]),t}function gk(){if(typeof window>"u")return!1;try{if(!window.matchMedia("(pointer: coarse)").matches)return!1}catch{return!1}return window.innerWidth<Rt.dense}function dt(){gk()&&y.getState().setActiveTool("pan")}function nE(){gk()&&y.getState().setPlaceKind(null)}const oE={id:"wire",cursor:"crosshair",onActivate(e){e.hostEl.classList.add("tool-wire")},onDeactivate(e){e.hostEl.classList.remove("tool-wire");const t=y.getState();t.setWireFromTerminal(null),t.setWireDragFrom(null),t.setCursorSvg(null),nt(null)},onPointerDown(e,t){var a,s;if(e.button!==0)return;e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&((s=(a=e.target).hasPointerCapture)!=null&&s.call(a,e.pointerId))&&e.target.releasePointerCapture(e.pointerId);const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=Wt(t,e.clientX,e.clientY),r=Ft(e.target instanceof Element?e.target:null,n,o),i=y.getState();i.setWireDragFrom({spec:r.spec,world:r.world,ref:r.ref}),i.setWireFromTerminal(r.ref),i.setCursorSvg(n)},onPointerMove(e,t){const n=y.getState(),o=n.wireDragFrom;if(!o)return;const r=t.viewport.screenToSvg(e.clientX,e.clientY);n.setCursorSvg(r);const i=jn(e.clientX,e.clientY),a=Ft(i,r,Wt(t,e.clientX,e.clientY)),s={spec:o.spec,world:o.world,ref:o.ref,create:!o.ref};nt(An(s,a)?null:hk(a))},onPointerUp(e,t){const n=y.getState(),o=n.wireDragFrom;if(n.setWireFromTerminal(null),n.setWireDragFrom(null),n.setCursorSvg(null),nt(null),!o)return;const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=jn(e.clientX,e.clientY)??(e.target instanceof Element?e.target:null),a=Ft(i,r,Wt(t,e.clientX,e.clientY)),s={spec:o.spec,world:o.world,ref:o.ref,create:!o.ref};An(s,a)||(n.connectWire(o.spec,a.spec),dt())},onPointerLeave(){const e=y.getState();e.setWireFromTerminal(null),e.setWireDragFrom(null),e.setCursorSvg(null),nt(null)}},Jr=10;let Mt=!1;function ei(){setTimeout(()=>nE(),0)}const rE={id:"place",cursor:"copy",onActivate(e){e.hostEl.classList.add("tool-place")},onDeactivate(e){e.hostEl.classList.remove("tool-place");const t=y.getState();t.setPlaceFromTerminal(null),t.setCursorSvg(null),Mt=!1},onPointerDown(e,t){var i,a;if(e.button!==0)return;const{placeKind:n}=y.getState();if(!n)return;e.preventDefault();const o=On(e.target);if(o){e.stopPropagation(),e.target instanceof Element&&((a=(i=e.target).hasPointerCapture)!=null&&a.call(i,e.pointerId))&&e.target.releasePointerCapture(e.pointerId);const s=y.getState();s.setPlaceFromTerminal(o),s.setCursorSvg(t.viewport.screenToSvg(e.clientX,e.clientY));return}const r=t.viewport.screenToSvg(e.clientX,e.clientY);Uv(n,r),Mt=!0},onPointerMove(e,t){const n=t.viewport.screenToSvg(e.clientX,e.clientY);y.getState().setCursorSvg([ti(n[0]),ti(n[1])])},onPointerUp(e,t){const n=y.getState(),o=n.placeFromTerminal;if(o){n.setPlaceFromTerminal(null);const{placeKind:r}=n;if(!r)return;const i=t.viewport.screenToSvg(e.clientX,e.clientY);jj(r,o,i),ei();return}Mt&&(Mt=!1,ei())},onPointerLeave(){const e=y.getState();e.setPlaceFromTerminal(null),e.setCursorSvg(null)},onPointerCancel(){const e=y.getState();e.setPlaceFromTerminal(null),e.setCursorSvg(null),Mt=!1}};function ti(e){return Math.round(e/Jr)*Jr}const ni=10,oi=20;function pt(e){return Math.round(e/ni)*ni}const iE={id:"busbar",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=t.viewport.screenToSvg(e.clientX,e.clientY),o=[pt(n[0]),pt(n[1])];y.getState().setBusbarDrawStart(o),y.getState().setCursorSvg(o)},onPointerMove(e,t){const n=t.viewport.screenToSvg(e.clientX,e.clientY);y.getState().setCursorSvg([pt(n[0]),pt(n[1])])},onPointerUp(e,t){const n=y.getState().busbarDrawStart;if(y.getState().setBusbarDrawStart(null),!n)return;const o=t.viewport.screenToSvg(e.clientX,e.clientY),r=pt(o[0]),i=pt(o[1]),a=r-n[0],s=i-n[1],l=Math.abs(a)>=Math.abs(s);let c,u,m;if(l){if(u=Math.abs(a),u<oi)return;c=0,m=[(n[0]+r)/2,n[1]]}else{if(u=Math.abs(s),u<oi)return;c=90,m=[n[0],(n[1]+i)/2]}y.getState().addBus(m,u,c),dt()},onPointerLeave(){const e=y.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)},onPointerCancel(){const e=y.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)},onDeactivate(){const e=y.getState();e.setBusbarDrawStart(null),e.setCursorSvg(null)}},ri=10,ii=e=>Math.round(e/ri)*ri,aE={id:"junction",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault(),e.stopPropagation();const n=t.viewport.screenToSvg(e.clientX,e.clientY);y.getState().addJunction([ii(n[0]),ii(n[1])]),dt()}},sE={id:"text",cursor:"text",onPointerDown(e,t){if(e.button!==0)return;const n=y.getState(),o=Xt(e.target);if(o){e.preventDefault(),e.stopPropagation(),n.setActiveTool("select"),n.setSelectedAnnotation(o);return}e.preventDefault();const r=t.viewport.screenToSvg(e.clientX,e.clientY),i=n.addAnnotation([r[0],r[1]],"");n.setEditingAnnotation(i),dt()}},lE={id:"rect",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=qe(t.viewport.screenToSvg(e.clientX,e.clientY));y.getState().setAnnotationDraft({kind:"rect",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=y.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:qe(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=y.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=qe(t.viewport.screenToSvg(e.clientX,e.clientY)),{at:i,size:a}=ek({...o,current:r,constrain:e.shiftKey});if(a[0]<_n||a[1]<_n)return;const s=n.insertAnnotation({type:"rect",at:i,size:a,stroke:"dashed"});n.setSelectedAnnotation(s),n.setActiveTool("select"),dt()},onPointerLeave(){y.getState().setAnnotationDraft(null)},onPointerCancel(){y.getState().setAnnotationDraft(null)},onDeactivate(){y.getState().setAnnotationDraft(null)}},cE={id:"line",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=qe(t.viewport.screenToSvg(e.clientX,e.clientY));y.getState().setAnnotationDraft({kind:"line",start:n,current:n,constrain:e.shiftKey})},onPointerMove(e,t){const n=y.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:qe(t.viewport.screenToSvg(e.clientX,e.clientY)),constrain:e.shiftKey})},onPointerUp(e,t){const n=y.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=qe(t.viewport.screenToSvg(e.clientX,e.clientY)),i=tk({...o,current:r,constrain:e.shiftKey}),a=i[0]-o.start[0],s=i[1]-o.start[1];if(Math.hypot(a,s)<Rj)return;const l=n.insertAnnotation({type:"line",at:o.start,points:[[0,0],[a,s]]});n.setSelectedAnnotation(l),n.setActiveTool("select"),dt()},onPointerLeave(){y.getState().setAnnotationDraft(null)},onPointerCancel(){y.getState().setAnnotationDraft(null)},onDeactivate(){y.getState().setAnnotationDraft(null)}},ai=15,dE=3,uE=3,mE={id:"table",cursor:"crosshair",onPointerDown(e,t){if(e.button!==0)return;e.preventDefault();const n=qe(t.viewport.screenToSvg(e.clientX,e.clientY));y.getState().setAnnotationDraft({kind:"table",start:n,current:n,constrain:!1})},onPointerMove(e,t){const n=y.getState(),o=n.annotationDraft;o&&n.setAnnotationDraft({...o,current:qe(t.viewport.screenToSvg(e.clientX,e.clientY))})},onPointerUp(e,t){const n=y.getState(),o=n.annotationDraft;if(n.setAnnotationDraft(null),!o)return;const r=qe(t.viewport.screenToSvg(e.clientX,e.clientY)),i=Math.abs(r[0]-o.start[0]),a=Math.abs(r[1]-o.start[1]),s=i<ai&&a<ai,{at:l,cols:c,rows:u}=s?{at:o.start,cols:dE,rows:uE}:ok({...o,current:r}),m=n.insertAnnotation({type:"table",at:l,...rk(c,u)});n.setSelectedAnnotation(m),n.setActiveTool("select"),dt()},onPointerLeave(){y.getState().setAnnotationDraft(null)},onPointerCancel(){y.getState().setAnnotationDraft(null)},onDeactivate(){y.getState().setAnnotationDraft(null)}},si={select:YA,pan:QA,wire:oE,place:rE,busbar:iE,junction:aE,text:sE,rect:lE,line:cE,table:mE};function pE(e,t){const n=y(r=>r.activeTool),o=y(r=>r.readOnly);I.useEffect(()=>{var p;const r=e.current;if(!r)return;const i=o?"pan":n,a=o?si.pan:si[n],s={viewport:t,hostEl:r};r.dataset.tool=i,(p=a.onActivate)==null||p.call(a,s),a.cursor&&(r.style.cursor=a.cursor);const l=f=>{var b;return(b=a.onPointerDown)==null?void 0:b.call(a,f,s)},c=f=>{var b;return(b=a.onPointerMove)==null?void 0:b.call(a,f,s)},u=f=>{var b;return(b=a.onPointerUp)==null?void 0:b.call(a,f,s)},m=f=>{var b;return a.onPointerCancel?a.onPointerCancel(f,s):(b=a.onPointerUp)==null?void 0:b.call(a,f,s)},h=f=>{var b;return(b=a.onPointerLeave)==null?void 0:b.call(a,f,s)},g=f=>{var b;return(b=a.onDoubleClick)==null?void 0:b.call(a,f,s)};return r.addEventListener("pointerdown",l),r.addEventListener("pointermove",c),r.addEventListener("pointerup",u),r.addEventListener("pointercancel",m),r.addEventListener("pointerleave",h),r.addEventListener("dblclick",g),()=>{var f;r.removeEventListener("pointerdown",l),r.removeEventListener("pointermove",c),r.removeEventListener("pointerup",u),r.removeEventListener("pointercancel",m),r.removeEventListener("pointerleave",h),r.removeEventListener("dblclick",g),(f=a.onDeactivate)==null||f.call(a,s),r.style.cursor="",delete r.dataset.tool}},[n,o,e,t])}let jo=1;const Ao=new Set;function hE(e){if(e!==jo){jo=e;for(const t of Ao)t(e)}}function fE(){return jo}function gE(e){return Ao.add(e),()=>{Ao.delete(e)}}const no=.1,oo=8,bE=1.0015,yE=1.02;function xE(e,t,n={tx:0,ty:0,scale:1}){const o=I.useRef({...n}),r=I.useRef(new Set),i=()=>{const a=t.current,s=e.current;if(a&&a.setAttribute("transform",`translate(${o.current.tx} ${o.current.ty}) scale(${o.current.scale})`),s&&s.style.setProperty("--canvas-scale",String(o.current.scale)),hE(o.current.scale),r.current.size>0){const l={...o.current};for(const c of r.current)c(l)}};return I.useEffect(()=>{const a=e.current;if(!a)return;let s=!1,l=-1,c=0,u=0,m=0,h=0,g=!1;const p=new Map;let f=null,b=!1;const x=()=>{if(p.size<2){f=null;return}const R=[...p.values()],W=R[1].x-R[0].x,ie=R[1].y-R[0].y,ce=Math.hypot(W,ie)||1,me=a.getBoundingClientRect();f={startDist:ce,startScale:o.current.scale,startTx:o.current.tx,startTy:o.current.ty,startMidX:(R[0].x+R[1].x)/2-me.left,startMidY:(R[0].y+R[1].y)/2-me.top}},v=R=>{if(R.pointerType==="touch"){if(p.set(R.pointerId,{x:R.clientX,y:R.clientY}),p.size>=2&&!b){b=!0;for(const W of p.keys())W!==R.pointerId&&uk(a,W);x()}if(b){R.stopPropagation(),R.preventDefault();try{a.setPointerCapture(R.pointerId)}catch{}}}},P=R=>{if(R.pointerType!=="touch"||!p.has(R.pointerId)||(p.set(R.pointerId,{x:R.clientX,y:R.clientY}),!b||!f))return;R.stopPropagation();const W=[...p.values()];if(W.length<2)return;const ie=W[1].x-W[0].x,ce=W[1].y-W[0].y,me=Math.hypot(ie,ce)||1,J=a.getBoundingClientRect(),ae=(W[0].x+W[1].x)/2-J.left,he=(W[0].y+W[1].y)/2-J.top,xe=me/f.startDist,$e=ro(f.startScale*xe,no,oo),Ie=$e/f.startScale;o.current.tx=f.startMidX-(f.startMidX-f.startTx)*Ie+(ae-f.startMidX),o.current.ty=f.startMidY-(f.startMidY-f.startTy)*Ie+(he-f.startMidY),o.current.scale=$e,i()},T=R=>{var W;if(R.pointerType==="touch"&&p.has(R.pointerId)&&(p.delete(R.pointerId),b)){if(R.stopPropagation(),(W=a.hasPointerCapture)!=null&&W.call(a,R.pointerId))try{a.releasePointerCapture(R.pointerId)}catch{}p.size>=2?x():f=null,p.size===0&&(b=!1)}},B=R=>{R.preventDefault();const W=a.getBoundingClientRect(),ie=R.clientX-W.left,ce=R.clientY-W.top,me=R.ctrlKey||R.metaKey;if(R.deltaX===0||me){const he=Math.pow(me?yE:bE,-R.deltaY),xe=ro(o.current.scale*he,no,oo),$e=xe/o.current.scale;o.current.tx=ie-(ie-o.current.tx)*$e,o.current.ty=ce-(ce-o.current.ty)*$e,o.current.scale=xe}else o.current.tx-=R.deltaX,o.current.ty-=R.deltaY;i()},V=R=>{const W=R.button===1,ie=g&&R.button===0;!W&&!ie||(R.preventDefault(),s=!0,l=R.pointerId,c=R.clientX,u=R.clientY,m=o.current.tx,h=o.current.ty,a.setPointerCapture(R.pointerId),a.style.cursor="grabbing")},S=R=>{!s||R.pointerId!==l||(o.current.tx=m+(R.clientX-c),o.current.ty=h+(R.clientY-u),i())},H=R=>{s&&R.pointerId===l&&(s=!1,a.releasePointerCapture(R.pointerId),a.style.cursor=g?"grab":"")},F=R=>{if(R.code==="Space"&&!g){const W=R.target;if(W&&(W.tagName==="INPUT"||W.tagName==="TEXTAREA"||W.isContentEditable))return;g=!0,a.style.cursor="grab",R.preventDefault()}},Z=R=>{R.code==="Space"&&(g=!1,s||(a.style.cursor=""))};return a.addEventListener("wheel",B,{passive:!1}),a.addEventListener("pointerdown",V),a.addEventListener("pointermove",S),a.addEventListener("pointerup",H),a.addEventListener("pointercancel",H),a.addEventListener("pointerdown",v,{capture:!0}),a.addEventListener("pointermove",P,{capture:!0}),a.addEventListener("pointerup",T,{capture:!0}),a.addEventListener("pointercancel",T,{capture:!0}),window.addEventListener("keydown",F),window.addEventListener("keyup",Z),i(),()=>{a.removeEventListener("wheel",B),a.removeEventListener("pointerdown",V),a.removeEventListener("pointermove",S),a.removeEventListener("pointerup",H),a.removeEventListener("pointercancel",H),a.removeEventListener("pointerdown",v,{capture:!0}),a.removeEventListener("pointermove",P,{capture:!0}),a.removeEventListener("pointerup",T,{capture:!0}),a.removeEventListener("pointercancel",T,{capture:!0}),window.removeEventListener("keydown",F),window.removeEventListener("keyup",Z)}},[]),{screenToSvg(a,s){const l=e.current;if(!l)return[a,s];const c=l.getBoundingClientRect(),u=(a-c.left-o.current.tx)/o.current.scale,m=(s-c.top-o.current.ty)/o.current.scale;return[u,m]},getViewport(){return{...o.current}},setViewport(a){a.tx!==void 0&&(o.current.tx=a.tx),a.ty!==void 0&&(o.current.ty=a.ty),a.scale!==void 0&&(o.current.scale=ro(a.scale,no,oo)),i()},subscribe(a){return r.current.add(a),()=>{r.current.delete(a)}}}}function ro(e,t,n){return e<t?t:e>n?n:e}const bk=typeof navigator<"u"&&/Mac|iP(ad|hone|od)/.test(navigator.platform),ht=bk?"⌘":"Ctrl+",wE=bk?"⇧":"Shift+",io=[10,20,50,100,200,500,1e3,2e3,5e3,1e4],vE=18;function kE(e){for(const t of io)if(t*e>=vE)return t;return io[io.length-1]}function SE(){const e=se(),t=I.useRef(null),n=I.useRef(null),o=I.useRef(null),r=xE(t,n);pE(t,r),WA(t),I.useEffect(()=>(Dr(r),()=>Dr(null)),[r]),I.useEffect(()=>{const u=m=>{const h=o.current;if(!h)return;const p=kE(m.scale)*m.scale;h.setAttribute("width",String(p)),h.setAttribute("height",String(p)),h.setAttribute("patternTransform",`translate(${m.tx} ${m.ty})`)};return u(r.getViewport()),r.subscribe(u)},[r]);const i=nS(),a=I.useCallback((u,m,h)=>{const g=y.getState();if(g.readOnly)return;const p=g.activeTool;if(p==="wire"||p==="busbar"||p==="junction"||p==="place"){mk();return}const f=Xt(h),b=f?null:xt(h);if(f)g.selectedAnnotations.includes(f)||g.setSelectedAnnotation(f);else if(b)g.selection.includes(b)||g.setSelection([b]);else{const F=Ln(h);F&&g.selectedNode!==F&&g.setSelectedNode(F)}const x=y.getState(),v=x.selection.length>0,P=x.selectedAnnotations.length>0,T=v||P,B=x.selectedNode!=null,V=!!x.clipboard,S=x.diagram.elements.length>0,H=[{label:e("menu.undo"),shortcut:`${ht}Z`,icon:Do,onSelect:()=>y.getState().undo(),disabled:x.past.length===0},{label:e("menu.redo"),shortcut:`${ht}${wE}Z`,icon:Mo,onSelect:()=>y.getState().redo(),disabled:x.future.length===0},{type:"separator"},{label:e("menu.cut"),shortcut:`${ht}X`,icon:Fi,onSelect:()=>y.getState().cutSelection(),disabled:!T},{label:e("menu.copy"),shortcut:`${ht}C`,icon:Oi,onSelect:()=>y.getState().copySelection(),disabled:!T},{label:e("menu.paste"),shortcut:`${ht}V`,icon:Ri,onSelect:()=>y.getState().pasteClipboard(),disabled:!V},{type:"separator"},{label:e("menu.rotate"),shortcut:"R",icon:Hi,onSelect:()=>y.getState().rotateSelection(90),disabled:!v},{label:e("menu.mirror"),shortcut:"M",icon:Li,onSelect:()=>y.getState().mirrorSelection(),disabled:!v},{type:"separator"},{label:e("menu.selectAll"),shortcut:`${ht}A`,icon:v2,onSelect:()=>{const F=y.getState();F.setSelection(F.diagram.elements.map(Z=>Z.id))},disabled:!S},{type:"separator"},{label:e(B&&!T?"menu.disconnect":"menu.delete"),shortcut:"Del",icon:qi,destructive:!0,onSelect:()=>{const F=y.getState();B&&!T?F.deleteSelectedNode():F.deleteSelection()},disabled:!T&&!B}];i.open(u,m,H)},[i,e]);I.useEffect(()=>{const u=t.current;if(!u)return;const m=700,h=4;let g,p=null;const f=()=>{g!==void 0&&window.clearTimeout(g),g=void 0,p=null},b=P=>{P.pointerType==="touch"&&(f(),p={pointerId:P.pointerId,x:P.clientX,y:P.clientY,target:P.target},g=window.setTimeout(()=>{const T=p;p=null,g=void 0,T&&(uk(u,T.pointerId),a(T.x,T.y,T.target))},m))},x=P=>{if(!p||P.pointerId!==p.pointerId)return;const T=P.clientX-p.x,B=P.clientY-p.y;Math.hypot(T,B)>h&&f()},v=P=>{!p||P.pointerId!==p.pointerId||f()};return u.addEventListener("pointerdown",b),u.addEventListener("pointermove",x),u.addEventListener("pointerup",v),u.addEventListener("pointercancel",v),()=>{f(),u.removeEventListener("pointerdown",b),u.removeEventListener("pointermove",x),u.removeEventListener("pointerup",v),u.removeEventListener("pointercancel",v)}},[a]);const s=u=>{u.dataTransfer.types.includes("application/x-oneline-kind")&&(u.preventDefault(),u.dataTransfer.dropEffect="copy")},l=u=>{if(y.getState().readOnly)return;const m=u.dataTransfer.getData("application/x-oneline-kind");if(!m)return;u.preventDefault();const h=r.screenToSvg(u.clientX,u.clientY);Uv(m,h)},c=u=>{u.preventDefault(),a(u.clientX,u.clientY,u.target)};return d.jsx("div",{ref:t,className:"ole-canvas-root absolute inset-0 overflow-hidden",onDragOver:s,onDrop:l,onContextMenu:c,children:d.jsxs("svg",{className:"ole-canvas-svg block h-full w-full",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("defs",{children:d.jsx("pattern",{ref:o,id:"ole-grid-dots",width:20,height:20,patternUnits:"userSpaceOnUse",children:d.jsx("circle",{cx:0,cy:0,r:2,fill:"var(--canvas-grid-strong)"})})}),d.jsx("rect",{width:"100%",height:"100%",fill:"url(#ole-grid-dots)"}),d.jsxs("g",{ref:n,className:"ole-viewport",children:[d.jsx(cA,{}),d.jsx(NA,{}),d.jsx(bA,{}),d.jsx(wA,{}),d.jsx(Tj,{}),d.jsx(Bj,{}),d.jsx(CA,{}),d.jsx(rA,{}),d.jsx(iA,{}),d.jsx(Uj,{}),d.jsx(jA,{}),d.jsx(IA,{}),d.jsx(dA,{}),d.jsx(Kj,{}),d.jsx(_A,{}),d.jsx(SA,{})]})]})})}const li=60,_E=.1,CE=8,$E=8;function jE(e,t,n){return e<t?t:e>n?n:e}function AE(){return document.querySelector(".ole-canvas-root")}function Bo(){const e=Ve(),t=AE();if(!e||!t)return!1;const n=t.getBoundingClientRect();if(n.width===0||n.height===0)return!1;const o=t.querySelectorAll("[data-element-id]");if(o.length===0)return e.setViewport({tx:n.width/2,ty:n.height/2,scale:1}),!0;let r=1/0,i=1/0,a=-1/0,s=-1/0;for(const x of o){const v=x.getBoundingClientRect();v.width===0&&v.height===0||(v.left<r&&(r=v.left),v.top<i&&(i=v.top),v.right>a&&(a=v.right),v.bottom>s&&(s=v.bottom))}if(r===1/0)return!1;const[l,c]=e.screenToSvg(r,i),[u,m]=e.screenToSvg(a,s),h=Math.max(u-l,1),g=Math.max(m-c,1),p=jE(Math.min((n.width-li*2)/h,(n.height-li*2)/g),_E,CE),f=(l+u)/2,b=(c+m)/2;return e.setViewport({tx:n.width/2-p*f,ty:n.height/2-p*b,scale:p}),!0}function Ho(){let e=$E;const t=()=>{Bo()||--e>0&&requestAnimationFrame(t)};requestAnimationFrame(t)}const ci=10,EE=100;function NE(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(hover: none), (pointer: coarse)").matches}function di(){const[e,t]=I.useState(LA()),[n,o]=I.useState(!1),[r,i]=I.useState(null),a=I.useRef(null),s=I.useRef(void 0),[l]=I.useState(NE);I.useEffect(()=>BA(p=>t(p)),[]),I.useEffect(()=>{if(window.clearTimeout(s.current),o(!1),i(null),!!e)return s.current=window.setTimeout(()=>o(!0),EE),()=>window.clearTimeout(s.current)},[e]);const c=y(p=>e?p.diagram.elements.find(f=>f.id===e)??null:null);if(I.useLayoutEffect(()=>{if(!n||!e)return;let p=0,f=-1,b=-1;const x=()=>{const v=document.querySelector(`[data-element-id="${TE(e)}"]`),P=a.current;if(v&&P){const T=v.getBoundingClientRect();let B=T.bottom+ci;B+P.offsetHeight>window.innerHeight-4&&(B=T.top-P.offsetHeight-ci);let V=T.left+T.width/2-P.offsetWidth/2;V=Math.max(4,Math.min(V,window.innerWidth-P.offsetWidth-4)),(B!==f||V!==b)&&(i({top:B,left:V}),f=B,b=V)}p=requestAnimationFrame(x)};return p=requestAnimationFrame(x),()=>cancelAnimationFrame(p)},[n,e]),l||!n||!e||!c)return null;const u=rt[c.kind],m=c.name??c.id,h=(u==null?void 0:u.name)??c.kind,g=c.name&&c.name!==c.id;return typeof document>"u"?null:zi.createPortal(d.jsxs("div",{ref:a,role:"tooltip",className:"ole-root ole-glass pointer-events-none fixed z-[100] flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] leading-snug shadow-md",style:{top:(r==null?void 0:r.top)??-9999,left:(r==null?void 0:r.left)??-9999,opacity:r?1:0,transition:"opacity 80ms ease-out"},children:[d.jsx("span",{className:"font-medium text-foreground",children:m}),g&&d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:c.id}),d.jsx("span",{className:"text-muted-foreground/80",children:"·"}),d.jsx("span",{className:"text-muted-foreground",children:h})]}),document.body)}function TE(e){return e.replace(/(["\\])/g,"\\$1")}function PE({width:e,children:t}){const n=e==null?"full":eE(e);return d.jsx(fk.Provider,{value:n,children:t})}function ui(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function IE(...e){return t=>{let n=!1;const o=e.map(r=>{const i=ui(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():ui(e[r],null)}}}}var zE=Symbol.for("react.lazy"),En=Ce[" use ".trim().toString()];function ME(e){return typeof e=="object"&&e!==null&&"then"in e}function yk(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zE&&"_payload"in e&&ME(e._payload)}function DE(e){const t=OE(e),n=Ce.forwardRef((o,r)=>{let{children:i,...a}=o;yk(i)&&typeof En=="function"&&(i=En(i._payload));const s=Ce.Children.toArray(i),l=s.find(BE);if(l){const c=l.props.children,u=s.map(m=>m===l?Ce.Children.count(c)>1?Ce.Children.only(null):Ce.isValidElement(c)?c.props.children:null:m);return d.jsx(t,{...a,ref:r,children:Ce.isValidElement(c)?Ce.cloneElement(c,void 0,u):null})}return d.jsx(t,{...a,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var RE=DE("Slot");function OE(e){const t=Ce.forwardRef((n,o)=>{let{children:r,...i}=n;if(yk(r)&&typeof En=="function"&&(r=En(r._payload)),Ce.isValidElement(r)){const a=FE(r),s=HE(i,r.props);return r.type!==Ce.Fragment&&(s.ref=o?IE(o,a):a),Ce.cloneElement(r,s)}return Ce.Children.count(r)>1?Ce.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LE=Symbol("radix.slottable");function BE(e){return Ce.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LE}function HE(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...s)=>{const l=i(...s);return r(...s),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function FE(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const mi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,pi=Ki,WE=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return pi(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(c=>{const u=n==null?void 0:n[c],m=i==null?void 0:i[c];if(u===null)return null;const h=mi(u)||mi(m);return r[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[m,h]=u;return h===void 0||(c[m]=h),c},{}),l=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,u)=>{let{class:m,className:h,...g}=u;return Object.entries(g).every(p=>{let[f,b]=p;return Array.isArray(b)?b.includes({...i,...s}[f]):{...i,...s}[f]===b})?[...c,m,h]:c},[]);return pi(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},qE=WE("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Te=Ce.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,...r},i)=>{const a=o?RE:"button";return d.jsx(a,{className:ke(qE({variant:t,size:n,className:e})),ref:i,...r})});Te.displayName="Button";const GE=350;function Pe({content:e,children:t,disabled:n,delayMs:o=GE}){const r=I.useRef(null),i=I.useRef(null),[a,s]=I.useState(!1),[l,c]=I.useState(null),u=I.useId(),m=I.useRef(void 0),h=()=>{n||(window.clearTimeout(m.current),m.current=window.setTimeout(()=>s(!0),o))},g=()=>{window.clearTimeout(m.current),s(!1)};I.useLayoutEffect(()=>{if(!a||!r.current||!i.current)return;const x=r.current.getBoundingClientRect(),v=i.current.getBoundingClientRect(),P=8;let T="top",B=x.top-v.height-P;B<4&&(T="bottom",B=x.bottom+P);let V=x.left+x.width/2-v.width/2;V=Math.max(4,Math.min(V,window.innerWidth-v.width-4)),c({top:B,left:V,side:T})},[a,e]),I.useEffect(()=>()=>window.clearTimeout(m.current),[]),I.useEffect(()=>{if(!a)return;const x=P=>{P.key==="Escape"&&s(!1)},v=()=>s(!1);return window.addEventListener("keydown",x),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("keydown",x),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[a]);const p=t,f=p.props,b=I.cloneElement(p,{ref:x=>{r.current=x;const v=p.ref;typeof v=="function"?v(x):v&&typeof v=="object"&&(v.current=x)},onPointerEnter:x=>{var v;(v=f.onPointerEnter)==null||v.call(f,x),h()},onPointerLeave:x=>{var v;(v=f.onPointerLeave)==null||v.call(f,x),g()},onFocus:x=>{var v;(v=f.onFocus)==null||v.call(f,x),h()},onBlur:x=>{var v;(v=f.onBlur)==null||v.call(f,x),g()},"aria-describedby":a?u:f["aria-describedby"]});return d.jsxs(d.Fragment,{children:[b,a&&typeof document<"u"&&zi.createPortal(d.jsx("div",{ref:i,id:u,role:"tooltip","data-side":(l==null?void 0:l.side)??"top",className:"ole-root ole-glass pointer-events-none fixed z-[100] max-w-[280px] rounded-md border border-border px-2 py-1 text-[11px] leading-snug text-foreground shadow-md",style:{top:(l==null?void 0:l.top)??-9999,left:(l==null?void 0:l.left)??-9999,opacity:l?1:0,transition:"opacity 80ms ease-out"},children:e}),document.body)]})}const hi=12,VE=56;function KE(){var x;const e=se(),t=y(v=>v.selection),n=y(v=>v.selectedNode),o=y(v=>v.selectedWire),r=y(v=>v.activeTool),i=y(v=>v.rotateSelection),a=y(v=>v.mirrorSelection),s=y(v=>v.deleteSelection),l=y(v=>v.deleteSelectedNode),c=y(v=>v.deleteSelectedWire),u=y(v=>v.resetWirePath),m=y(v=>v.internal.wireRenders),h=o!=null&&((x=m.get(o))==null?void 0:x.userEdited)===!0,g=I.useRef(null);I.useEffect(()=>{const v=g.current;if(!v)return;const P=t.length>0,T=!P&&o!=null,B=!P&&!T&&n!=null;if(!((P||T||B)&&(r==="select"||r==="pan"))){v.style.display="none";return}v.style.display="flex";let S=0,H="";const F=()=>{let Z=1/0,R=-1/0,W=1/0,ie=-1/0,ce=!1;const me=J=>{J.width===0&&J.height===0||(J.left<Z&&(Z=J.left),J.right>R&&(R=J.right),J.top<W&&(W=J.top),J.bottom>ie&&(ie=J.bottom),ce=!0)};if(P)for(const J of t){const ae=document.querySelector(`[data-element-id="${CSS.escape(J)}"]`);ae&&me(ae.getBoundingClientRect())}else if(T&&o){const J=document.querySelector(`polyline.ole-wire[data-wire-id="${CSS.escape(o)}"]`);J&&me(J.getBoundingClientRect())}else if(B&&n){const J=document.querySelectorAll(`polyline.ole-wire[data-node-id="${CSS.escape(n)}"]`);for(const ae of J)me(ae.getBoundingClientRect())}if(ce){const J=(Z+R)/2;let ae=W-hi,he="-100%";ae<VE&&(ae=ie+hi,he="0%");const xe=`translate3d(${J}px, ${ae}px, 0) translate(-50%, ${he})`;xe!==H&&(v.style.transform=xe,H=xe)}S=requestAnimationFrame(F)};return S=requestAnimationFrame(F),()=>cancelAnimationFrame(S)},[t,n,o,r]);const p=t.length===0&&o!=null,f=t.length===0&&!p&&n!=null,b=f||p;return d.jsxs("div",{ref:g,role:"toolbar","aria-label":e(p?"ctx.ariaWire":f?"ctx.ariaNode":"ctx.ariaElement"),className:"ole-glass pointer-events-auto fixed left-0 top-0 z-30 hidden items-center gap-0.5 rounded-2xl border border-border p-1 shadow-md",children:[p&&h&&o&&d.jsxs(d.Fragment,{children:[d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{children:d.jsx("span",{className:"font-medium",children:e("ctx.resetWirePath")})}),d.jsx("div",{className:"text-muted-foreground",children:e("ctx.resetWirePathHint")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>u(o),"aria-label":e("ctx.resetWirePath"),children:d.jsx(w2,{})})}),d.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),!b&&d.jsxs(d.Fragment,{children:[d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:e("ctx.rotate")}),d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"R"})]}),d.jsx("div",{className:"text-muted-foreground",children:e("ctx.rotateHint")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>i(90),"aria-label":e("ctx.rotate"),children:d.jsx(Hi,{})})}),d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:e("ctx.mirror")}),d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"M"})]}),d.jsx("div",{className:"text-muted-foreground",children:e("ctx.mirrorHint")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",className:"size-7",onClick:()=>a(),"aria-label":e("ctx.mirrorTitle"),children:d.jsx(Li,{})})}),d.jsx("div",{"aria-hidden":!0,className:"mx-0.5 h-4 w-px bg-border"})]}),d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:e("ctx.delete")}),d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:"Del"})]}),d.jsx("div",{className:"text-muted-foreground",children:e(p?"ctx.deleteHintWire":f?"ctx.deleteHintNode":"ctx.deleteHintElement")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",className:"size-7 text-destructive hover:text-destructive",onClick:()=>p?c():f?l():s(),"aria-label":e("ctx.delete"),children:d.jsx(qi,{})})})]})}const fi=8,UE=56,Eo=".ole-ann-cell-edit-fo",No=".ole-free-annotation-edit-fo";function gi(){return document.querySelector(`${Eo} input`)??document.querySelector(`${No} [contenteditable]`)}function XE(){const e=se(),t=y(a=>a.editingAnnotation),n=y(a=>a.editingCell),o=I.useRef(null);I.useEffect(()=>{const a=o.current;if(!a)return;if(!t){a.style.display="none";return}a.style.display="flex";let s=0,l="";const c=()=>{const u=gi()??document.querySelector(Eo)??document.querySelector(No)??document.querySelector(`[data-annotation-id="${CSS.escape(t)}"]`);if(u){const m=u.getBoundingClientRect();let h=m.top-fi,g="-100%";h<UE&&(h=m.bottom+fi,g="0%");const p=`translate3d(${m.left}px, ${h}px, 0) translate(0, ${g})`;p!==l&&(a.style.transform=p,l=p)}s=requestAnimationFrame(c)};return s=requestAnimationFrame(c),()=>cancelAnimationFrame(s)},[t,n]);const r=()=>{var a;(a=gi())==null||a.blur()},i=()=>{var c,u;const a=y.getState(),s=a.editingAnnotation,l=(c=a.diagram.annotations)==null?void 0:c.find(m=>m.id===s);if(!l){a.setEditingAnnotation(null);return}if(Oe(l)==="table"&&a.editingCell){const m=document.querySelector(`${Eo} input`),[h,g]=a.editingCell;if(m){m.value=((u=l.cells[h])==null?void 0:u[g])??"",m.blur();return}}else{const m=document.querySelector(`${No} [contenteditable]`);if(m){m.innerText=l.text??"",m.blur();return}}a.setEditingAnnotation(null)};return d.jsxs("div",{ref:o,role:"toolbar","aria-label":e("ctx.ariaEdit"),className:"ole-glass pointer-events-auto fixed left-0 top-0 z-40 hidden items-center gap-0.5 rounded-2xl border border-border p-1 shadow-md",children:[d.jsx(Pe,{content:d.jsxs("span",{className:"font-medium",children:[e("ctx.done")," · Enter"]}),children:d.jsx(Te,{variant:"ghost",size:"icon",className:"size-7 text-emerald-600 hover:text-emerald-600 dark:text-emerald-400 dark:hover:text-emerald-400",onMouseDown:a=>a.preventDefault(),onClick:r,"aria-label":e("ctx.done"),children:d.jsx(r2,{})})}),d.jsx(Pe,{content:d.jsxs("span",{className:"font-medium",children:[e("ctx.cancel")," · Esc"]}),children:d.jsx(Te,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground",onMouseDown:a=>a.preventDefault(),onClick:i,"aria-label":e("ctx.cancel"),children:d.jsx(Nn,{})})})]})}function Bn({open:e,onOpenChange:t,trigger:n,children:o}){const r=I.useRef(null);return I.useEffect(()=>{if(!e)return;const i=s=>{r.current&&!r.current.contains(s.target)&&t(!1)},a=s=>{s.key==="Escape"&&t(!1)};return window.addEventListener("mousedown",i),window.addEventListener("keydown",a),()=>{window.removeEventListener("mousedown",i),window.removeEventListener("keydown",a)}},[e,t]),d.jsxs("div",{ref:r,className:"relative",children:[n,e&&d.jsx("div",{role:"menu",className:"ole-glass absolute bottom-full right-0 mb-1.5 min-w-52 rounded-md border border-border p-1 shadow-md",children:o})]})}const xk="ole-panel-open";function YE(){if(typeof window>"u")return{outlineOpen:!1};try{const e=window.localStorage.getItem(xk);if(!e)return{outlineOpen:!1};const t=JSON.parse(e);return typeof t!="object"||t===null?{outlineOpen:!1}:{outlineOpen:t.outline===!0}}catch{return{outlineOpen:!1}}}function bi(e){try{const t={outline:e.outlineOpen};window.localStorage.setItem(xk,JSON.stringify(t))}catch{}}const Yt=Tn((e,t)=>({...YE(),setOutlineOpen:n=>{e({outlineOpen:n}),bi(t())},toggleOutline:()=>{e(n=>({outlineOpen:!n.outlineOpen})),bi(t())}})),wn=[.1,.25,.5,.75,1,1.25,1.5,2,3,4,6,8],wk=.1,vk=8,kk="ole-grid";function ZE(){try{const e=window.localStorage.getItem(kk);return e==null?!0:e==="1"}catch{return!0}}function QE(e){try{window.localStorage.setItem(kk,e?"1":"0")}catch{}}function JE(e,t,n){return e<t?t:e>n?n:e}function Sk(){return document.querySelector(".ole-canvas-root")}function Fo(e){const t=Ve(),n=Sk();if(!t||!n)return;const o=n.getBoundingClientRect(),r=o.width/2,i=o.height/2,a=t.getViewport(),s=JE(e,wk,vk),l=s/a.scale;t.setViewport({tx:r-(r-a.tx)*l,ty:i-(i-a.ty)*l,scale:s})}function e6(){const e=Ve();if(!e)return;const t=e.getViewport().scale,n=wn.find(o=>o>t+1e-6)??vk;Fo(n)}function t6(){const e=Ve();if(!e)return;const t=e.getViewport().scale;let n=wk;for(let o=wn.length-1;o>=0;o--)if(wn[o]<t-1e-6){n=wn[o];break}Fo(n)}const gn=[Pn,6,Be,8,9,10,12,14,16,20,24,28,In];function n6(e){y.getState().dispatch(t=>{const n={...t.meta??{},labelMode:e};return{...t,meta:n}})}function To(e){y.getState().dispatch(t=>{const n={...t.meta??{}};return e===Be?delete n.labelFontSize:n.labelFontSize=e,{...t,meta:n}})}function yi(e){var o;const t=kt((o=y.getState().diagram.meta)==null?void 0:o.labelFontSize);if(e>0){To(gn.find(r=>r>t)??In);return}let n=Pn;for(let r=gn.length-1;r>=0;r--)if(gn[r]<t){n=gn[r];break}To(n)}function _k(){const[e,t]=I.useState(()=>ZE());return I.useEffect(()=>{const n=Sk();n==null||n.classList.toggle("hide-grid",!e),QE(e)},[e]),I.useEffect(()=>{const n=o=>{if(o.metaKey||o.ctrlKey||o.altKey||o.key!=="g"&&o.key!=="G")return;const r=o.target;r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||(o.preventDefault(),t(i=>!i))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[]),[e,t]}function Ck(){const e=se();return d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.zoomOut")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.zoomOutHint")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",onClick:t6,"aria-label":e("view.zoomOut"),children:d.jsx(zo,{})})})}function $k(){const e=se();return d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.zoomIn")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.zoomInHint")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",onClick:e6,"aria-label":e("view.zoomIn"),children:d.jsx(b2,{})})})}function jk(){const e=se(),[t,n]=I.useState(fE);return I.useEffect(()=>gE(n),[]),d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.reset")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.current",{z:Math.round(t*100)})})]}),children:d.jsxs("button",{type:"button",onClick:()=>Fo(1),className:"min-w-12 rounded-md px-2 py-1 text-center text-xs tabular-nums text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":e("view.reset"),children:[Math.round(t*100),"%"]})})}function Ak(){const e=se();return d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.fit")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.fitHint")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",onClick:Bo,"aria-label":e("view.fit"),children:d.jsx(h2,{})})})}function Ek({grid:e,setGrid:t}){const n=se();return d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:n(e?"view.gridHide":"view.gridShow")}),d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:n("view.gridHotkey")})]}),d.jsx("div",{className:"text-muted-foreground",children:n(e?"view.gridHideHint":"view.gridShowHint")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>t(o=>!o),"aria-label":n(e?"view.gridHideAria":"view.gridShowAria"),"aria-pressed":e,className:ke(!e&&"text-muted-foreground/60"),children:d.jsx(m2,{})})})}function Nk(){const e=se(),t=y(r=>{var i;return((i=r.diagram.meta)==null?void 0:i.labelMode)??"all"}),n=y(r=>{var i;return kt((i=r.diagram.meta)==null?void 0:i.labelFontSize)}),o=[{value:"off",label:e("view.labelOff")},{value:"id",label:e("view.labelId")},{value:"all",label:e("view.labelAll")}];return d.jsxs("div",{className:"flex flex-col gap-1.5 px-1.5 py-1",children:[d.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:e("view.label")}),d.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:o.map(r=>d.jsx("button",{type:"button","aria-pressed":t===r.value,onClick:()=>n6(r.value),className:ke("h-7 flex-1 whitespace-nowrap px-1.5 text-[11px] transition-colors",t===r.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.label},r.value))}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx("span",{className:"text-[11px] text-muted-foreground",children:e("view.labelSize")}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{type:"button","aria-label":e("view.labelSizeSmaller"),disabled:n<=Pn,onClick:()=>yi(-1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"−"}),d.jsx("button",{type:"button","aria-label":e("view.labelSizeReset"),onClick:()=>To(Be),className:"w-9 rounded-md py-1 text-center font-mono text-[11px] tabular-nums hover:bg-accent hover:text-accent-foreground",children:n}),d.jsx("button",{type:"button","aria-label":e("view.labelSizeLarger"),disabled:n>=In,onClick:()=>yi(1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"+"})]})]})]})}function o6(){const e=se(),[t,n]=I.useState(!1),o=y(r=>{var i;return((i=r.diagram.meta)==null?void 0:i.labelMode)??"all"});return d.jsx(Bn,{open:t,onOpenChange:n,trigger:d.jsx(Pe,{content:d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:e("view.label")}),d.jsx("div",{className:"text-muted-foreground",children:e("view.labelHint")})]}),children:d.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>n(r=>!r),"aria-label":e("view.label"),"aria-expanded":t,className:ke(o==="off"&&"text-muted-foreground/60"),children:d.jsx(Gi,{})})}),children:d.jsx(Nk,{})})}function r6({stacked:e}={}){const t=se(),[n,o]=I.useState(!1),[r,i]=_k(),a=d.jsxs("div",{className:"space-y-0.5",children:[d.jsx("div",{className:"font-medium",children:t("view.menu")}),d.jsx("div",{className:"text-muted-foreground",children:t("view.menuHint")})]}),s=e?d.jsx(Pe,{content:a,children:d.jsxs("button",{type:"button",onClick:()=>o(l=>!l),"aria-label":t("view.menu"),"aria-pressed":n,className:ke("flex h-12 w-12 flex-col items-center justify-center gap-0.5 rounded-md text-[10px] font-medium leading-tight transition-colors",n?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[d.jsx(co,{className:"size-4"}),d.jsx("span",{className:"max-w-full truncate",children:t("view.menu")})]})}):d.jsx(Pe,{content:a,children:d.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>o(l=>!l),"aria-label":t("view.menu"),"aria-pressed":n,children:d.jsx(co,{})})});return d.jsx(Bn,{open:n,onOpenChange:o,trigger:s,children:d.jsxs("div",{className:"flex flex-col gap-0.5",children:[d.jsx(jk,{}),d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx(Ck,{}),d.jsx($k,{})]}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsxs("div",{className:"flex items-center gap-0.5",children:[d.jsx(Ak,{}),d.jsx(Ek,{grid:r,setGrid:i})]}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsx(Nk,{})]})})}function xi(){const e=it();return!y(n=>n.readOnly)&&Re(e,"dense")?null:d.jsx(i6,{tier:e})}function i6({tier:e}){const t=Re(e,"tight"),n=y(i=>i.readOnly),[o,r]=_k();return d.jsx("div",{className:"absolute z-50",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))",right:"calc(0.75rem + env(safe-area-inset-right, 0px))"},children:d.jsxs("div",{className:"ole-glass flex items-center gap-0.5 rounded-2xl border border-border p-1.5 shadow-sm",children:[d.jsx(Ck,{}),!t&&d.jsx(jk,{}),d.jsx($k,{}),d.jsx("div",{"aria-hidden":!0,className:"mx-1 h-4 w-px bg-border"}),d.jsx(Ak,{}),d.jsx(Ek,{grid:o,setGrid:r}),!n&&d.jsx(o6,{})]})})}const wi=[{id:"select",labelKey:"tool.select",hotkey:"V",descriptionKey:"tool.selectHint",icon:f2,switchTo:"select",iconOnly:!0},{id:"pan",labelKey:"tool.pan",hotkey:"H",descriptionKey:"tool.panHint",icon:p2,switchTo:"pan",groupBreakAfter:!0,iconOnly:!0},{id:"busbar",labelKey:"tool.bus",hotkey:"B",descriptionKey:"tool.busHint",icon:zo,switchTo:"busbar"},{id:"junction",labelKey:"tool.junction",hotkey:"J",descriptionKey:"tool.junctionHint",icon:a2,switchTo:"junction",iconOnly:!0},{id:"place",labelKey:"tool.place",hotkey:"P",descriptionKey:"tool.placeHint",icon:Wi,switchTo:"place"},{id:"wire",labelKey:"tool.wire",hotkey:"W",descriptionKey:"tool.wireHint",icon:Di,switchTo:"wire",groupBreakAfter:!0},{id:"text",labelKey:"tool.text",hotkey:"T",descriptionKey:"tool.textHint",icon:Gi,switchTo:"text",iconOnly:!0},{id:"rect",labelKey:"tool.rect",hotkey:"F",descriptionKey:"tool.rectHint",icon:k2,switchTo:"rect",iconOnly:!0},{id:"line",labelKey:"tool.line",hotkey:"L",descriptionKey:"tool.lineHint",icon:x2,switchTo:"line",iconOnly:!0},{id:"table",labelKey:"tool.table",hotkey:"D",descriptionKey:"tool.tableHint",icon:S2,switchTo:"table",iconOnly:!0}];function a6(){const e=se(),t=y(h=>h.activeTool),n=y(h=>h.placeKind),o=y(h=>h.placeFromTerminal),r=y(h=>h.wireDragFrom),i=y(h=>h.busbarDrawStart),a=y(h=>h.selection.length>0||h.selectedNode!=null),s=y(h=>h.editingAnnotation),l=y(h=>{var f;const g=vt(h);if(!g)return null;const p=(f=h.diagram.annotations)==null?void 0:f.find(b=>b.id===g);return p?Oe(p):null});if(s)return d.jsx("div",{className:"ole-glass pointer-events-none flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground shadow-sm",children:d.jsx("span",{children:e("mode.annEditing")})});let c=null,u=!1;switch(t){case"select":if(l){c=e(l==="table"?"mode.annTableSel":l==="text"?"mode.annTextSel":"mode.annShapeSel"),u=!0;break}c=e(a?"mode.selectWithSel":"mode.selectEmpty"),a&&(u=!0);break;case"pan":c=e("mode.pan");break;case"wire":c=e(r?"mode.wireDragging":"mode.wireInit"),u=!0;break;case"busbar":c=e(i?"mode.busDragging":"mode.busInit"),u=!0;break;case"junction":c=e("mode.junction"),u=!0;break;case"place":n?o?c=e("mode.placeFromTerm"):c=e("mode.placeNormal"):c=e("mode.placeNoKind"),u=!0;break;case"text":c=e("mode.text"),u=!0;break;case"rect":c=e("mode.rect"),u=!0;break;case"line":c=e("mode.line"),u=!0;break;case"table":c=e("mode.table"),u=!0;break}if(!c)return null;const m=e(t==="select"?"mode.escSelect":"mode.escOther");return d.jsxs("div",{className:"ole-glass pointer-events-none flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs text-muted-foreground shadow-sm",children:[d.jsx("span",{children:c}),u&&d.jsxs("span",{className:"text-muted-foreground/70",children:["· ",m]})]})}function s6(){const e=se(),t=y(x=>x.activeTool),n=y(x=>x.placeKind),o=y(x=>x.setActiveTool),r=y(x=>x.past.length),i=y(x=>x.future.length),a=y(x=>x.undo),s=y(x=>x.redo),l=it(),c=Re(l,"tight"),u=!Re(l,"dense"),m=Re(l,"dense"),h=new Set(["select","text","rect","line","table"]),g=m?wi.filter(x=>!h.has(x.id)):wi,p=x=>t===x.switchTo,[f,b]=I.useState(!1);return d.jsxs("div",{className:"absolute left-1/2 z-20 flex -translate-x-1/2 flex-col items-center gap-1.5",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))"},children:[u&&d.jsx("div",{className:ke("transition-opacity duration-150",f&&"pointer-events-none opacity-0"),children:d.jsx(a6,{})}),d.jsxs("div",{onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),className:ke("ole-glass flex flex-row items-center rounded-2xl border border-border shadow-sm",m?"gap-0.5 p-1":"gap-0.5 p-1.5"),children:[m&&d.jsx(l6,{stacked:!0}),g.map(x=>{const v=x.icon,P=p(x),T=x.id==="place"&&P&&n==null?e("tool.placeNoKindTooltip"):e(x.descriptionKey);return d.jsxs(I.Fragment,{children:[d.jsx(gt,{icon:v,label:e(x.labelKey),hotkey:x.hotkey,active:P,iconOnly:!m&&(x.iconOnly||c),stacked:m,description:T,onClick:()=>{o(x.switchTo,{placeKind:x.presetPlaceKind!==void 0?x.presetPlaceKind:void 0})}}),x.groupBreakAfter&&!m&&d.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"})]},x.id)}),!m&&d.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"}),m?d.jsx(d6,{stacked:!0}):d.jsxs(d.Fragment,{children:[d.jsx(gt,{icon:Do,label:e("tool.undo"),hotkey:"⌘Z",description:e("tool.undoHint"),iconOnly:!0,disabled:r===0,onClick:a}),d.jsx(gt,{icon:Mo,label:e("tool.redo"),hotkey:"⌘⇧Z",description:e("tool.redoHint"),iconOnly:!0,disabled:i===0,onClick:s}),d.jsx("div",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-border"}),d.jsx(c6,{iconOnly:c})]}),m&&d.jsx(r6,{stacked:!0})]})]})}function l6({stacked:e}){const t=se(),n=Yt(r=>r.outlineOpen),o=Yt(r=>r.toggleOutline);return d.jsx(gt,{icon:Bi,label:t("outline.title"),active:n,iconOnly:!0,stacked:e,onClick:o})}function gt({icon:e,label:t,hotkey:n,active:o,disabled:r,iconOnly:i,stacked:a,onClick:s,description:l}){const c=d.jsxs("div",{className:"space-y-0.5",children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-medium",children:t}),n&&d.jsx("span",{className:"ml-1.5 text-muted-foreground",children:n})]}),l&&d.jsx("div",{className:"text-muted-foreground",children:l})]});return d.jsx(Pe,{content:c,disabled:r,children:d.jsxs("button",{type:"button",onClick:s,disabled:r,"aria-label":t,"aria-pressed":o,className:ke("rounded-md font-medium transition-colors",a?"flex h-12 w-12 flex-col items-center justify-center gap-0.5 text-[10px] leading-tight":"flex h-9 items-center gap-1.5 text-xs",!a&&(i?"w-9 justify-center":"px-2.5"),o?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground",r&&"pointer-events-none opacity-40"),children:[d.jsxs("span",{className:"relative inline-flex shrink-0",children:[d.jsx(e,{className:"size-4"}),n&&!a&&d.jsx("span",{"aria-hidden":!0,className:ke("pointer-events-none absolute -right-1.5 -top-1.5 rounded-sm px-1 font-mono text-[8px] leading-[1.1]",o?"bg-primary-foreground/20 text-primary-foreground/85":"bg-foreground/10 text-muted-foreground"),children:n})]}),a?d.jsx("span",{className:"max-w-full truncate",children:t}):!i&&d.jsx("span",{children:t})]})})}function Tk(){const e=y(r=>r.diagram.elements),t=y(r=>r.diagram.layout),n=y(r=>r.selection),o=t??{};return{hasAnyElement:e.length>0,hasArrangedAny:Object.keys(o).length>0,hasGapsAll:e.some(r=>!o[r.id]),hasSelection:n.length>0,selectionHasArranged:n.some(r=>!!o[r]),selectionHasGaps:n.some(r=>!o[r])}}function c6({iconOnly:e}){const t=se(),[n,o]=I.useState(!1),r=Tk(),i=a=>()=>{o(!1),a()};return d.jsxs(Bn,{open:n,onOpenChange:o,trigger:d.jsx(gt,{icon:Ot,label:t("layout.label"),description:t("layout.hint"),active:n,iconOnly:e,onClick:()=>o(a=>!a)}),children:[d.jsx(Me,{onClick:i(()=>y.getState().autoArrangeAll()),icon:d.jsx(Ot,{}),disabled:!r.hasAnyElement||!r.hasArrangedAny,children:t("layout.allAuto")}),d.jsx(Me,{onClick:i(()=>y.getState().autoArrangeSelection()),icon:d.jsx(Ot,{}),disabled:!r.hasSelection||!r.selectionHasArranged,children:t("layout.selAuto")}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsx(Me,{onClick:i(()=>y.getState().fillUnplacedAll()),icon:d.jsx(vn,{}),disabled:!r.hasGapsAll,children:t("layout.allFill")}),d.jsx(Me,{onClick:i(()=>y.getState().fillUnplacedSelection()),icon:d.jsx(vn,{}),disabled:!r.hasSelection||!r.selectionHasGaps,children:t("layout.selFill")})]})}function d6({stacked:e}){const t=se(),[n,o]=I.useState(!1),r=y(h=>h.past.length),i=y(h=>h.future.length),a=y(h=>h.undo),s=y(h=>h.redo),l=y(h=>h.selection.length>0),c=y(h=>h.clipboard!=null),u=Tk(),m=h=>()=>{o(!1),h()};return d.jsxs(Bn,{open:n,onOpenChange:o,trigger:d.jsx(gt,{icon:co,label:t("tool.more"),description:t("tool.moreHint"),active:n,iconOnly:!0,stacked:e,onClick:()=>o(h=>!h)}),children:[d.jsx(Me,{onClick:m(a),icon:d.jsx(Do,{}),disabled:r===0,children:t("tool.undo")}),d.jsx(Me,{onClick:m(s),icon:d.jsx(Mo,{}),disabled:i===0,children:t("tool.redo")}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsx(Me,{onClick:m(()=>y.getState().cutSelection()),icon:d.jsx(Fi,{}),disabled:!l,children:t("menu.cut")}),d.jsx(Me,{onClick:m(()=>y.getState().copySelection()),icon:d.jsx(Oi,{}),disabled:!l,children:t("menu.copy")}),d.jsx(Me,{onClick:m(()=>y.getState().pasteClipboard()),icon:d.jsx(Ri,{}),disabled:!c,children:t("menu.paste")}),d.jsx("div",{"aria-hidden":!0,className:"my-1 h-px bg-border"}),d.jsx(Me,{onClick:m(()=>y.getState().autoArrangeAll()),icon:d.jsx(Ot,{}),disabled:!u.hasAnyElement||!u.hasArrangedAny,children:t("layout.allAuto")}),d.jsx(Me,{onClick:m(()=>y.getState().autoArrangeSelection()),icon:d.jsx(Ot,{}),disabled:!u.hasSelection||!u.selectionHasArranged,children:t("layout.selAuto")}),d.jsx(Me,{onClick:m(()=>y.getState().fillUnplacedAll()),icon:d.jsx(vn,{}),disabled:!u.hasGapsAll,children:t("layout.allFill")}),d.jsx(Me,{onClick:m(()=>y.getState().fillUnplacedSelection()),icon:d.jsx(vn,{}),disabled:!u.hasSelection||!u.selectionHasGaps,children:t("layout.selFill")})]})}function Me({children:e,icon:t,onClick:n,disabled:o}){return d.jsxs("button",{type:"button",role:"menuitem",disabled:o,onClick:n,className:ke("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",o&&"pointer-events-none text-muted-foreground opacity-60 hover:bg-transparent"),children:[t,d.jsx("span",{className:"flex-1",children:e})]})}function u6(){const e=Yt(r=>r.outlineOpen),t=Yt(r=>r.setOutlineOpen),n=it();return Re(n,"dense")?e?d.jsx("div",{className:"absolute z-10",style:{left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",bottom:"calc(4rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px) + 0.75rem)"},children:d.jsx(vi,{onClose:()=>t(!1),sheet:!0})}):null:d.jsx("div",{className:"absolute z-10 flex flex-col items-start",style:{bottom:"calc(0.75rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px))",left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",maxHeight:"calc(100% - 1.5rem)"},children:e?d.jsx(vi,{onClose:()=>t(!1)}):d.jsx(m6,{onClick:()=>t(!0)})})}function m6({onClick:e}){const t=se(),n=it(),o=Re(n,"compact");return d.jsxs("button",{type:"button",onClick:e,"aria-label":t("outline.title"),title:t("outline.title"),className:ke("ole-glass flex h-12 items-center rounded-2xl border border-border text-muted-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",o?"w-12 justify-center":"gap-2 px-3"),children:[d.jsx(Bi,{className:"size-4 shrink-0"}),!o&&d.jsx("span",{className:"text-xs font-medium",children:t("outline.title")})]})}function vi({onClose:e,sheet:t}){const n=se(),o=y(c=>c.diagram.elements),r=y(c=>c.activeTool==="place"),i=it(),a=Re(i,"compact"),s=Re(i,"dense"),l=t?"min(50vh, calc(100vh - 9rem))":r?"min(40vh, calc(100vh - 200px))":"min(70vh, calc(100vh - 100px))";return d.jsxs("aside",{className:ke("ole-glass flex flex-col overflow-hidden rounded-2xl border border-border shadow-sm",t?"w-full":a?"w-52":"w-64"),style:{height:l},children:[d.jsxs("button",{type:"button",onClick:e,"aria-label":n("outline.collapseAria"),title:n("outline.collapse"),className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2 text-left transition-colors hover:bg-muted/40",children:[d.jsx("span",{className:"flex-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:n("outline.title")}),!s&&d.jsx(h6,{children:o.length}),d.jsx(g2,{className:"size-3.5 text-muted-foreground"})]}),d.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:o.length===0?d.jsx("p",{className:"px-2 py-2 text-xs italic text-muted-foreground",children:n("outline.empty")}):d.jsx("ul",{className:"space-y-px",children:o.map(c=>d.jsx(p6,{element:c},c.id))})})]})}function p6({element:e}){const t=rt[e.kind],n=y(l=>l.selection.includes(e.id)),o=y(l=>l.setSelection),r=y(l=>l.toggleInSelection),i=it(),a=!Re(i,"compact"),s=l=>{l.shiftKey||l.metaKey||l.ctrlKey?r(e.id):o([e.id])};return d.jsxs("li",{className:"group flex cursor-pointer items-center gap-2 rounded-md px-2 py-1 hover:bg-accent data-[selected=true]:bg-[color-mix(in_oklch,var(--selection)_18%,transparent)]",title:e.note??`${e.name??e.id} (${e.kind})`,"data-element-id":e.id,"data-selected":n?"true":void 0,onClick:s,children:[d.jsx("div",{className:"flex h-4 w-6 shrink-0 items-center justify-center",children:t&&d.jsx("svg",{viewBox:t.viewBox,className:"ole-symbol size-full",preserveAspectRatio:"xMidYMid meet",dangerouslySetInnerHTML:{__html:t.svg}})}),d.jsx("span",{className:"flex-1 truncate text-xs text-foreground/90 group-hover:text-accent-foreground",children:e.name??e.id}),a&&d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:e.id})]})}function h6({children:e}){return d.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e})}const f6={"arc-suppression-coil.name":"消弧线圈","arrester.name":"避雷器 (FBL)","async-motor.name":"异步电动机","autotransformer.name":"自耦变压器","battery.name":"电池储能","breaker.name":"断路器 (QF)","busbar.name":"母线段","converter-bidir.name":"双向变流器 (PCS)","dc-dc-converter.name":"DC/DC 变换器","mppt.name":"MPPT 控制器","ct.name":"电流互感器 (CT)","disconnector.name":"隔离开关 (QS)","earth.name":"接地","earthing-switch.name":"接地刀闸 (QE)","fuse.name":"熔断器 (FU)","generator.name":"发电机 (G)","grid-source.name":"系统电源","grounding-transformer.name":"接地变 (Z形)","inverter.name":"逆变器 (DC→AC)","load-switch.name":"负荷开关","load.name":"负荷","luminaire.name":"灯具 / 照明负荷","panelboard.name":"配电箱","ngr.name":"中性点电阻 (NGR)","pt.name":"电压互感器 (PT)","pv.name":"光伏组件","rectifier.name":"整流器 (AC→DC)","series-reactor.name":"串联电抗器","shunt-capacitor.name":"并联电容器","shunt-reactor.name":"并联电抗器","sync-motor.name":"同步电动机","transformer-2w.name":"双绕组变压器","transformer-3w.name":"三绕组变压器","wind-turbine.name":"风力发电机","gfci-breaker.name":"GFCI 断路器 (RCBO)","rcd.name":"剩余电流装置 (RCD)","recloser.name":"重合闸 (Recloser)","energy-meter.name":"电能表 (Wh)","voltmeter.name":"电压表 (V)","ammeter.name":"电流表 (A)","wattmeter.name":"功率表 (W)","frequency-meter.name":"频率表 (Hz)","contactor.name":"接触器 (KM)","motor-starter.name":"电机启动器","thermal-overload.name":"热过载继电器","vfd.name":"变频器 (VFD)","soft-starter.name":"软启动器","transfer-switch.name":"切换开关 (ATS)","dc-disconnector.name":"直流隔离开关","dc-combiner.name":"直流汇流箱","ev-charger.name":"EV 充电桩","arc-suppression-coil.desc":"中性点谐振接地:电感线圈连接到地","busbar.desc":"可拉伸单母线段,多设备挂接","converter-bidir.desc":"储能变流器:双向 AC ↔ DC","dc-dc-converter.desc":"DC/DC 变换器 / 直流充电器(IEC 60617)","mppt.desc":"MPPT 太阳能充电控制器(DC/DC,最大功率点跟踪)","earthing-switch.desc":"隔离开关 + 接地连接,单端口","grid-source.desc":"无穷大母线 / 外部电网","grounding-transformer.desc":"星-曲折接线变压器,中性点接地用","load.desc":"抽象负荷(电流流出箭头)","luminaire.desc":"照明负荷(IEC 60617 荧光灯具通用符号)","panelboard.desc":"配电箱 / 负荷中心(IEC 分配中心符号):底部进线,箱顶分路示意","ngr.desc":"小电阻接地:连接变压器中性点到地","series-reactor.desc":"与并联电抗器同符号;通过用法区分","wind-turbine.desc":"风机:发电机 + 三叶轮标记","gfci-breaker.desc":"剩余电流断路器带过流保护 (UL943 / IEC 61009)。北美 GFCI / 欧洲 RCBO。","rcd.desc":"不带过流保护的剩余电流断路器 (IEC 61008)。","recloser.desc":"中压自动重合闸开关。","energy-meter.desc":"有功电能表 (kWh) — 服务入口 / 子表。","contactor.desc":"主回路接触器, 通常配热继电器和电机使用。","motor-starter.desc":"电机启动器 (IEC 60617 通用符号)。","thermal-overload.desc":"电机热过载保护继电器, 通常串接在接触器和电机之间。","vfd.desc":"Variable Frequency Drive — 异步电动机调速。","soft-starter.desc":"电机软启动器 (晶闸管降压启动)。","transfer-switch.desc":"双源切换开关 (Automatic / Manual Transfer Switch)。两个电源输入 + 一个负荷输出, 互锁不并联。","dc-disconnector.desc":"DC 隔离开关 — 光伏组串 / 储能 直流侧隔离。","dc-combiner.desc":"光伏组串汇流箱 (4 路输入示例)。","ev-charger.desc":"电动汽车充电站 / 充电桩。","breaker.state.open":"断开","disconnector.state.open":"断开","earthing-switch.state.open":"断开","fuse.state.blown":"熔断","load-switch.state.open":"断开","gfci-breaker.state.open":"断开","rcd.state.open":"断开","recloser.state.open":"断开","contactor.state.open":"断开","thermal-overload.state.tripped":"动作","transfer-switch.state.position":"位置 (normal/emergency/off)","dc-disconnector.state.open":"断开","battery.param.E":"容量","busbar.param.Un":"额定电压","converter-bidir.param.S":"容量","dc-dc-converter.param.P":"功率","mppt.param.I":"额定电流","load.param.P":"有功功率","load.param.cosphi":"功率因数","ngr.param.R":"电阻","shunt-capacitor.param.Q":"无功容量","shunt-capacitor.param.stages":"分组数","transformer-2w.param.S":"容量","transformer-2w.param.ratio":"变比","gfci-breaker.param.In":"额定电流","panelboard.param.In":"额定电流","gfci-breaker.param.IDn":"剩余动作电流","rcd.param.IDn":"剩余动作电流","breaker.param.In":"额定电流","breaker.param.poles":"极数","breaker.param.Icu":"分断能力","disconnector.param.In":"额定电流","fuse.param.In":"额定电流"},g6={"arc-suppression-coil.name":"Arc-suppression coil","arrester.name":"Surge arrester (FBL)","async-motor.name":"Asynchronous motor","autotransformer.name":"Autotransformer","battery.name":"Battery storage","breaker.name":"Circuit breaker (QF)","busbar.name":"Busbar segment","converter-bidir.name":"Bidirectional converter (PCS)","dc-dc-converter.name":"DC/DC converter","mppt.name":"MPPT controller","ct.name":"Current transformer (CT)","disconnector.name":"Disconnector (QS)","earth.name":"Earth","earthing-switch.name":"Earthing switch (QE)","fuse.name":"Fuse (FU)","generator.name":"Generator (G)","grid-source.name":"Grid source","grounding-transformer.name":"Grounding transformer (zig-zag)","inverter.name":"Inverter (DC→AC)","load-switch.name":"Load break switch","load.name":"Load","luminaire.name":"Luminaire (lighting load)","panelboard.name":"Panelboard / load center","ngr.name":"Neutral grounding resistor (NGR)","pt.name":"Voltage transformer (PT)","pv.name":"PV module","rectifier.name":"Rectifier (AC→DC)","series-reactor.name":"Series reactor","shunt-capacitor.name":"Shunt capacitor","shunt-reactor.name":"Shunt reactor","sync-motor.name":"Synchronous motor","transformer-2w.name":"Two-winding transformer","transformer-3w.name":"Three-winding transformer","wind-turbine.name":"Wind turbine","gfci-breaker.name":"GFCI breaker (RCBO)","rcd.name":"Residual current device (RCD)","recloser.name":"Recloser","energy-meter.name":"Energy meter (Wh)","voltmeter.name":"Voltmeter (V)","ammeter.name":"Ammeter (A)","wattmeter.name":"Wattmeter (W)","frequency-meter.name":"Frequency meter (Hz)","contactor.name":"Contactor (KM)","motor-starter.name":"Motor starter","thermal-overload.name":"Thermal overload relay","vfd.name":"Variable frequency drive (VFD)","soft-starter.name":"Soft starter","transfer-switch.name":"Transfer switch (ATS)","dc-disconnector.name":"DC disconnector","dc-combiner.name":"DC combiner box","ev-charger.name":"EV charger","arc-suppression-coil.desc":"Resonant neutral grounding: inductor to earth","busbar.desc":"Stretchable single-bus segment with multiple taps","converter-bidir.desc":"Storage converter: bidirectional AC ↔ DC","dc-dc-converter.desc":"DC/DC converter / DC charger (IEC 60617)","mppt.desc":"MPPT solar charge controller (DC/DC, maximum power point tracking)","earthing-switch.desc":"Disconnector + earth connection, single port","grid-source.desc":"Infinite bus / external grid","grounding-transformer.desc":"Wye-zigzag transformer for neutral grounding","load.desc":"Abstract load (current-out arrow)","luminaire.desc":"Lighting load (IEC 60617 general luminaire symbol)","ngr.desc":"Low-resistance grounding: transformer neutral to earth","series-reactor.desc":"Same symbol as shunt reactor; distinguished by usage","wind-turbine.desc":"Wind turbine: generator + three-blade rotor mark","gfci-breaker.desc":"Residual-current breaker with overcurrent (UL943 / IEC 61009). NA GFCI / EU RCBO.","rcd.desc":"Residual-current breaker without overcurrent (IEC 61008).","recloser.desc":"Medium-voltage automatic recloser.","energy-meter.desc":"Active energy meter (kWh) — service entrance / submeter.","contactor.desc":"Main-circuit contactor; typically used with a thermal overload and a motor.","motor-starter.desc":"Motor starter (IEC 60617 general symbol).","thermal-overload.desc":"Motor thermal-overload relay; sits between the contactor and the motor.","vfd.desc":"Variable Frequency Drive for induction motor speed control.","soft-starter.desc":"Motor soft-starter (thyristor-based reduced-voltage starting).","transfer-switch.desc":"Two-source transfer switch (ATS / manual). Two source inputs + one load output, mechanically interlocked.","dc-disconnector.desc":"DC isolating switch — PV string / battery DC-side isolation.","dc-combiner.desc":"PV string combiner box (4-input example).","ev-charger.desc":"Electric vehicle charging station.","breaker.state.open":"Open","disconnector.state.open":"Open","earthing-switch.state.open":"Open","fuse.state.blown":"Blown","load-switch.state.open":"Open","gfci-breaker.state.open":"Open","rcd.state.open":"Open","recloser.state.open":"Open","contactor.state.open":"Open","thermal-overload.state.tripped":"Tripped","transfer-switch.state.position":"Position (normal/emergency/off)","dc-disconnector.state.open":"Open","battery.param.E":"Capacity","busbar.param.Un":"Rated voltage","converter-bidir.param.S":"Capacity","dc-dc-converter.param.P":"Power","mppt.param.I":"Rated current","load.param.P":"Active power","load.param.cosphi":"Power factor","ngr.param.R":"Resistance","shunt-capacitor.param.Q":"Reactive capacity","shunt-capacitor.param.stages":"Stages","transformer-2w.param.S":"Capacity","transformer-2w.param.ratio":"Ratio","gfci-breaker.param.In":"Rated current","panelboard.param.In":"Rated current","gfci-breaker.param.IDn":"Residual operating current","rcd.param.IDn":"Residual operating current","breaker.param.In":"Rated current","breaker.param.poles":"Poles","breaker.param.Icu":"Breaking capacity","disconnector.param.In":"Rated current","fuse.param.In":"Rated current","resistor.name":"Resistor (R)","capacitor.name":"Capacitor (C)","diode.name":"Diode (D)","indicator-light.name":"Indicator light (HL)","push-button.name":"Push-button (SB)","relay-coil.name":"Relay coil (KA)","make-contact.name":"NO contact (NO)","break-contact.name":"NC contact (NC)","bell.name":"Bell (HA)","terminal.name":"Terminal / junction (X)","fuse-switch-disconnector.name":"Fuse switch-disconnector","socket-outlet.name":"Socket outlet / connector","inductor.name":"Inductor (L)","voltage-regulator.name":"Voltage regulator (T)","dc-motor.name":"DC motor (M)","heater.name":"Heating element (EH)","selector-switch.name":"Selector switch (SA)","limit-switch.name":"Limit switch (SQ)","proximity-switch.name":"Proximity switch (SQ)","time-relay.name":"Time relay (KT)","buzzer.name":"Buzzer (HA)","siren.name":"Siren (HA)","thermocouple.name":"Thermocouple (BT)","thyristor.name":"Thyristor / SCR (V)","triac.name":"Triac (V)","zener-diode.name":"Zener diode (D)","igbt.name":"IGBT","plc.name":"PLC / controller","ups.name":"UPS","power-supply.name":"Power supply (PS)","genset.name":"Generator set (G)","protective-relay.name":"Protective relay","overcurrent-relay.name":"Overcurrent relay (50/51)","undervoltage-relay.name":"Undervoltage relay (27)","reverse-power-relay.name":"Reverse-power relay (32)","distance-relay.name":"Distance relay (21)","phase-failure-relay.name":"Phase-failure relay","buchholz-relay.name":"Buchholz relay (63)","power-factor-meter.name":"Power-factor meter (cosφ)","synchronoscope.name":"Synchronoscope","varmeter.name":"Varmeter (var)","resistor.desc":"General resistor / current-limiting / braking resistor.","capacitor.desc":"General / filter / DC-bus capacitor. Use shunt capacitor for PF correction.","diode.desc":"Rectifier / freewheeling / protection diode. t1 = anode (top), t2 = cathode (bottom).","indicator-light.desc":"Signal / status indicator light.","push-button.desc":"Manual push-button, automatic return (NO make).","relay-coil.desc":"Relay / contactor operating coil (box).","make-contact.desc":"Normally-open auxiliary contact (make).","break-contact.desc":"Normally-closed auxiliary contact (break).","bell.desc":"Signal bell / alarm bell.","terminal.desc":"Terminal / junction box / connection node.","fuse-switch-disconnector.desc":"On-load fuse switch-disconnector.","socket-outlet.desc":"Power socket outlet / multipole connector.","inductor.desc":"General inductor / coil / choke.","voltage-regulator.desc":"Adjustable induction / autotransformer voltage regulator.","dc-motor.desc":"DC motor (series-field general symbol).","heater.desc":"Resistive heating element / heating load.","selector-switch.desc":"Selector / changeover switch (rotary, stay-put).","limit-switch.desc":"Travel / position switch (NO, mechanically operated).","proximity-switch.desc":"Proximity sensor / contactless proximity switch.","time-relay.desc":"Time-delay (slow-operating) relay coil.","buzzer.desc":"Signal buzzer.","siren.desc":"Audible siren / alarm.","thermocouple.desc":"Thermocouple temperature sensor.","thyristor.desc":"Reverse-blocking triode thyristor / SCR. t1 = anode (top), t2 = cathode (bottom).","triac.desc":"Bidirectional triode thyristor (TRIAC).","zener-diode.desc":"Zener / voltage-regulator diode. t1 = anode (top), t2 = cathode (bottom).","igbt.desc":"N-channel enhancement IGBT. t1 = collector (top), t2 = emitter (bottom), t_g = gate.","plc.desc":"Programmable logic controller (PLC).","ups.desc":"Online / standby uninterruptible power supply.","power-supply.desc":"AC→DC switched-mode / DC power supply. t_ac top (~), t_dc bottom (=).","genset.desc":"Diesel / gas generator set.","protective-relay.desc":"Measuring / protective relay, general symbol (IEC 60617).","overcurrent-relay.desc":"Overcurrent protection relay (ANSI 50/51).","undervoltage-relay.desc":"Undervoltage protection relay (ANSI 27).","reverse-power-relay.desc":"Reverse-power / reverse-current protection relay (ANSI 32).","distance-relay.desc":"Distance / under-impedance protection relay (ANSI 21).","phase-failure-relay.desc":"Phase-failure / phase-loss protection relay.","buchholz-relay.desc":"Buchholz / gas relay (ANSI 63).","power-factor-meter.desc":"Power-factor meter (cosφ).","synchronoscope.desc":"Synchronizing indicator / synchronoscope.","varmeter.desc":"Reactive-power meter (var).","make-contact.state.closed":"Closed","break-contact.state.open":"Open","fuse-switch-disconnector.state.open":"Open","selector-switch.state.open":"Open","limit-switch.state.closed":"Closed","resistor.param.R":"Resistance","resistor.param.P":"Rated power","capacitor.param.C":"Capacitance","capacitor.param.Un":"Rated voltage","indicator-light.param.color":"Color","inductor.param.L":"Inductance","inductor.param.In":"Rated current","voltage-regulator.param.ratio":"Regulation range","heater.param.P":"Power","ups.param.S":"Capacity","power-supply.param.Vdc":"Output voltage","genset.param.P":"Power"},ki={zh:f6,en:g6,es:ve.es.library,fr:ve.fr.library,de:ve.de.library,pt:ve.pt.library,ja:ve.ja.library,ru:ve.ru.library,fa:ve.fa.library,ar:ve.ar.library,he:ve.he.library};function b6(e,t){return ki[e][t]??ki.en[t]}function nn(){const e=Zt(t=>t.locale);return(t,n)=>b6(e,t)??n??t}const Pk="ole-palette-collapsed",y6=new Set(["busbar"]),qt=(()=>{const e={};for(const[t,n]of Object.entries(fj)){const o=n.filter(r=>!y6.has(r.id));o.length&&(e[t]=o)}return e})(),x6=(()=>{const e=new Set(Nr),t=Object.keys(qt).filter(n=>!e.has(n));return[...Nr.filter(n=>{var o;return(o=qt[n])==null?void 0:o.length}),...t]})();function w6(){try{const e=window.localStorage.getItem(Pk);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(n=>typeof n=="string")):new Set}catch{return new Set}}function v6(e){try{window.localStorage.setItem(Pk,JSON.stringify([...e]))}catch{}}function k6(){const e=se(),t=y(m=>m.activeTool==="place"),n=y(m=>m.placeKind),o=y(m=>m.setActiveTool),r=Yt(m=>m.outlineOpen),i=it(),a=Re(i,"dense"),s=68,c=a?void 0:`calc(100vh - ${s}px - ${r?"calc(40vh + 20px)":"68px"})`;if(!t||a&&n!=null)return null;const u=a?{top:`calc(${s}px + var(--ole-top-inset, 0px) + var(--ole-safe-top, 0px))`,left:"calc(0.75rem + var(--ole-left-inset, 0px) + var(--ole-safe-left, 0px))",right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",bottom:"calc(4rem + var(--ole-bottom-inset, 0px) + var(--ole-safe-bottom, 0px) + 0.75rem)"}:{top:s};return d.jsx("div",{className:a?"absolute z-20":"absolute left-3 z-20",style:u,role:"dialog","aria-label":e("library.title"),children:d.jsxs("aside",{className:a?"ole-glass flex h-full w-full flex-col overflow-hidden rounded-2xl border border-border shadow-md":"ole-glass flex w-72 flex-col overflow-hidden rounded-2xl border border-border shadow-md",style:c?{maxHeight:c}:void 0,children:[d.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2",children:[d.jsx("span",{className:"flex-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e("library.title")}),d.jsx("button",{type:"button",onClick:()=>o(a?"pan":"select"),className:"rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground","aria-label":e("common.close"),title:e("common.close"),children:d.jsx(Nn,{className:"size-3.5"})})]}),d.jsx(S6,{sheet:a})]})})}function S6({sheet:e}){const t=se(),n=nn(),[o,r]=I.useState(""),[i,a]=I.useState(()=>w6()),s=I.useMemo(()=>{const m=o.trim().toLowerCase();if(!m)return qt;const h={};for(const[g,p]of Object.entries(qt)){const f=p.filter(b=>{const x=n(`${b.id}.name`,b.name).toLowerCase(),v=n(`${b.id}.desc`,b.description??"").toLowerCase();return x.includes(m)||b.id.toLowerCase().includes(m)||v.includes(m)});f.length&&(h[g]=f)}return h},[o,n]),l=o.trim().length>0,c=l&&Object.values(s).every(m=>!(m!=null&&m.length)),u=I.useCallback((m,h)=>{a(g=>{const p=new Set(g);return h?p.delete(m):p.add(m),v6(p),p})},[]);return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"px-2 pb-1.5 pt-2",children:d.jsx(_6,{value:o,onChange:r})}),d.jsx("div",{className:"flex-1 overflow-y-auto px-2 pb-2",children:c?d.jsx("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:t("library.empty")}):x6.map(m=>{var b;const h=s[m];if(!(h!=null&&h.length))return null;const g=((b=qt[m])==null?void 0:b.length)??h.length,p=t(`cat.${m}`),f=l||!i.has(m);return d.jsxs("details",{open:f,className:"group mb-2 last:mb-0",onToggle:x=>{l||u(m,x.currentTarget.open)},children:[d.jsxs("summary",{className:"flex cursor-pointer select-none items-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:[d.jsx(i2,{className:"size-3 transition-transform [details:not([open])>summary>&]:-rotate-90"}),d.jsx("span",{className:"flex-1",children:p}),d.jsx($6,{children:l&&h.length!==g?`${h.length}/${g}`:g})]}),d.jsx("ul",{className:"mt-0.5 space-y-px",children:h.map(x=>d.jsx(C6,{entry:x,sheet:e},x.id))})]},m)})})]})}function _6({value:e,onChange:t}){const n=se();return d.jsxs("div",{className:"relative",children:[d.jsx(y2,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),d.jsx("input",{type:"text",value:e,onChange:o=>t(o.target.value),placeholder:n("library.searchPlaceholder"),className:"h-7 w-full rounded-md border border-border/60 bg-background/50 pl-7 pr-7 text-xs placeholder:text-muted-foreground focus:border-border focus:outline-none focus:ring-1 focus:ring-ring","aria-label":n("library.searchAria")}),e&&d.jsx("button",{type:"button","aria-label":n("library.clearSearch"),onClick:()=>t(""),className:"absolute right-1 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:d.jsx(Nn,{className:"size-3"})})]})}function C6({entry:e,sheet:t}){const n=se(),o=nn(),r=o(`${e.id}.name`,e.name),i=o(`${e.id}.desc`,e.description??""),a=y(m=>m.setActiveTool),s=y(m=>m.activeTool==="place"&&m.placeKind===e.id),l=y(m=>t&&m.activeTool==="place"&&m.placeKind==null&&m.lastPlaceKind===e.id),c=I.useRef(null);I.useEffect(()=>{var m;l&&((m=c.current)==null||m.scrollIntoView({block:"nearest"}))},[l]);const u=m=>{m.dataTransfer.effectAllowed="copy",m.dataTransfer.setData("application/x-oneline-kind",e.id),m.dataTransfer.setData("text/plain",e.id);const h=document.createElement("div");h.className="ole-glass",h.style.cssText=["position:absolute","top:-9999px","left:-9999px","width:64px","height:64px","display:flex","align-items:center","justify-content:center","border-radius:12px","border:1px solid var(--border)","box-shadow:0 4px 12px rgba(0,0,0,0.12)","color:var(--foreground)","padding:8px"].join(";"),h.innerHTML=`<svg class="ole-symbol" viewBox="${e.viewBox}" width="48" height="48" preserveAspectRatio="xMidYMid meet">${e.svg}</svg>`,document.body.appendChild(h),m.dataTransfer.setDragImage(h,32,32),setTimeout(()=>h.remove(),0)};return d.jsxs("li",{ref:c,className:`group flex cursor-grab items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-accent active:cursor-grabbing ${s?"bg-accent ring-1 ring-[var(--selection)]/60":l?"ring-1 ring-[var(--selection)]/30":""}`,draggable:!0,onDragStart:u,onClick:()=>a("place",{placeKind:e.id}),"data-kind":e.id,title:i?`${r} — ${i}`:`${r} — ${n("library.itemHint")}`,children:[d.jsx("div",{className:"flex h-7 w-12 shrink-0 items-center justify-center",children:d.jsx("svg",{viewBox:e.viewBox,className:"ole-symbol size-full",preserveAspectRatio:"xMidYMid meet",dangerouslySetInnerHTML:{__html:e.svg}})}),d.jsx("span",{className:"truncate text-xs text-foreground/80 group-hover:text-accent-foreground",children:r})]})}function $6({children:e}){return d.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e})}const Po="ole-onboarding-dismissed";function j6(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Po)==="1"}catch{return!1}}function Si(e){try{e?window.localStorage.setItem(Po,"1"):window.localStorage.removeItem(Po)}catch{}}const _i=Tn(e=>({dismissed:j6(),dismiss:()=>{Si(!0),e({dismissed:!0})},reset:()=>{Si(!1),e({dismissed:!1})}}));function A6(){const e=se(),t=_i(o=>o.dismissed),n=_i(o=>o.dismiss);return t?null:d.jsxs("div",{role:"dialog","aria-label":e("onboard.title"),className:"ole-glass pointer-events-none absolute left-1/2 top-1/2 z-10 w-[min(420px,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-border p-5 shadow-md",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm font-semibold",children:e("onboard.title")}),d.jsx("button",{type:"button",onClick:n,"aria-label":e("onboard.dismiss"),className:"pointer-events-auto rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:d.jsx(Nn,{className:"size-3.5"})})]}),d.jsxs("ol",{className:"mt-3 space-y-2.5",children:[d.jsx(ao,{n:1,icon:d.jsx(Wi,{}),title:e("onboard.step1.title"),body:e("onboard.step1.body")}),d.jsx(ao,{n:2,icon:d.jsx(Di,{}),title:e("onboard.step2.title"),body:e("onboard.step2.body")}),d.jsx(ao,{n:3,icon:d.jsx(zo,{}),title:e("onboard.step3.title"),body:e("onboard.step3.body")})]}),d.jsx("button",{type:"button",onClick:n,className:"pointer-events-auto mt-4 w-full rounded-md bg-primary py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90",children:e("onboard.dismiss")})]})}function ao({n:e,icon:t,title:n,body:o}){return d.jsxs("li",{className:"flex items-start gap-2.5",children:[d.jsx("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_oklch,var(--selection)_18%,transparent)] font-mono text-[10px] font-semibold tabular-nums text-[var(--selection)]","aria-hidden":!0,children:e}),d.jsxs("div",{className:"min-w-0 flex-1",children:[d.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[d.jsx("span",{className:"text-muted-foreground [&>svg]:size-3.5",children:t}),d.jsx("span",{children:n})]}),d.jsx("p",{className:"mt-0.5 text-[11px] leading-snug text-muted-foreground",children:o})]})]})}function E6(){const e=se(),t=y(f=>f.selection),n=y(f=>f.diagram.elements),o=y(f=>f.diagram.buses),r=y(f=>f.diagram.junctions),i=y(f=>f.selectedNode),a=y(f=>f.selectedWire),s=y(f=>f.selectedAnnotations),l=y(vt);if(a)return d.jsx(H6,{wireId:a});if(i)return d.jsx(W6,{nodeId:i});if(l)return d.jsx(M6,{annId:l});const c=t.length+s.length;if(c===0)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:e("props.empty")});if(c>1)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:e("props.multi",{n:c})});const u=t[0],m=(o??[]).find(f=>f.id===u);if(m)return d.jsx(I6,{bus:m});const h=(r??[]).find(f=>f.id===u);if(h)return d.jsx(F6,{junction:h});const g=n.find(f=>f.id===u);if(!g)return null;const p=rt[g.kind];return d.jsxs("div",{className:"flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs",children:[d.jsx(Xe,{label:e("props.name"),value:g.name??"",placeholder:g.id,onCommit:f=>y.getState().updateElement(u,{name:f.trim()===""?void 0:f.trim()})}),d.jsx(Wo,{label:e("props.note"),value:g.note??"",onCommit:f=>y.getState().updateElement(u,{note:f.trim()===""?void 0:f.trim()})},u),(p==null?void 0:p.state)&&p.state.length>0&&d.jsx("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:p.state.map(f=>d.jsx(G6,{id:u,element:g,field:f},f.name))}),d.jsx(N6,{id:u,element:g,schema:(p==null?void 0:p.params)??[]})]})}function N6({id:e,element:t,schema:n}){const o=new Set(n.map(i=>i.name)),r=t.params?Object.entries(t.params).filter(([i])=>!o.has(i)):[];return n.length===0&&r.length===0?null:d.jsxs("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:[n.map(i=>d.jsx(T6,{id:e,element:t,field:i},i.name)),r.map(([i,a])=>d.jsx(P6,{id:e,element:t,fieldKey:i,value:a},i))]})}function T6({id:e,element:t,field:n}){var l;const o=se(),r=nn(),i=((l=t.params)==null?void 0:l[n.name])??n.default,a=r(`${t.kind}.param.${n.name}`,n.label??n.name),s=c=>{const u={...t.params??{}};c===void 0||c===""?delete u[n.name]:u[n.name]=c,y.getState().updateElement(e,{params:Object.keys(u).length>0?u:void 0})};return n.type==="boolean"?d.jsx(at,{label:a,children:d.jsx(qo,{active:!!i,onClick:()=>s(!i),children:o(i?"common.yes":"common.no")})}):n.type==="number"?d.jsx(Hn,{label:a,value:typeof i=="number"?i:0,unit:n.unit,onCommit:s}):d.jsx(Xe,{label:a,value:typeof i=="string"?i:"",unit:n.unit,onCommit:c=>s(c.trim()===""?void 0:c)})}function P6({id:e,element:t,fieldKey:n,value:o}){const r=se(),i=a=>{const s={...t.params??{}};a===void 0?delete s[n]:s[n]=a,y.getState().updateElement(e,{params:Object.keys(s).length>0?s:void 0})};return typeof o=="boolean"?d.jsx(at,{label:n,children:d.jsx(qo,{active:o,onClick:()=>i(!o),children:r(o?"common.yes":"common.no")})}):typeof o=="number"?d.jsx(Hn,{label:n,value:o,onCommit:i}):d.jsx(Xe,{label:n,value:o,onCommit:a=>i(a.trim()===""?void 0:a)})}function I6({bus:e}){const t=se(),n=e.id,o=r=>{const i=r.trim();Io(n,{name:i===""?void 0:i})};return d.jsxs("div",{className:"flex flex-col gap-2.5 overflow-y-auto px-3 py-3 text-xs",children:[d.jsx(Xe,{label:t("props.name"),value:e.name??"",placeholder:e.id,onCommit:o}),d.jsx(Wo,{label:t("props.note"),value:e.note??"",onCommit:r=>Io(n,{note:r.trim()===""?void 0:r.trim()})},n),d.jsx(z6,{bus:e})]})}function z6({bus:e}){const t=(o,r)=>{const i={...e.params??{}};r===void 0||r===""?delete i[o]:i[o]=r,Io(e.id,{params:Object.keys(i).length>0?i:void 0})},n=e.params??{};return d.jsx("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border/40 pt-2.5",children:d.jsx(Hn,{label:"Un",value:typeof n.Un=="number"?n.Un:0,unit:"kV",onCommit:o=>t("Un",o)})})}function Io(e,t){y.getState().dispatch(n=>{const o=(n.buses??[]).map(r=>r.id===e?{...r,...t}:r);return{...n,buses:o}})}function M6({annId:e}){const t=se(),n=y(r=>(r.diagram.annotations??[]).find(i=>i.id===e));if(!n)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.annNotFound",{id:e})});const o=r=>y.getState().updateAnnotation(e,r);switch(Oe(n)){case"rect":{const r=n;return d.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[d.jsx(Xe,{label:t("props.annLabel"),value:r.label??"",placeholder:t("props.annLabelPlaceholder"),onCommit:i=>o({label:i.trim()===""?void 0:i.trim()})}),d.jsx(bn,{label:t("props.annStroke"),value:r.stroke??"dashed",options:[{value:"solid",label:t("props.annStrokeSolid")},{value:"dashed",label:t("props.annStrokeDashed")}],onChange:i=>o({stroke:i})}),d.jsx(bn,{label:t("props.annFill"),value:r.fill??"none",options:[{value:"none",label:t("props.annFillNone")},{value:"tint",label:t("props.annFillTint")}],onChange:i=>o({fill:i==="none"?void 0:i})})]})}case"line":{const r=n;return d.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[d.jsx(bn,{label:t("props.annStroke"),value:r.stroke??"solid",options:[{value:"solid",label:t("props.annStrokeSolid")},{value:"dashed",label:t("props.annStrokeDashed")}],onChange:i=>o({stroke:i})}),d.jsx(bn,{label:t("props.annArrow"),value:r.arrow??"none",options:[{value:"none",label:t("props.annArrowNone")},{value:"end",label:t("props.annArrowEnd")},{value:"both",label:t("props.annArrowBoth")}],onChange:i=>o({arrow:i==="none"?void 0:i})})]})}case"table":{const r=n;return d.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[d.jsx(Ci,{label:t("props.annRows"),value:r.rowHeights.length,min:1,onChange:i=>o(D6(r,i))}),d.jsx(Ci,{label:t("props.annCols"),value:r.colWidths.length,min:1,onChange:i=>o(R6(r,i))}),d.jsx($i,{label:t("props.annFontSize"),value:r.fontSize,onCommit:i=>o({fontSize:i})})]})}default:{const r=n;return d.jsx("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:d.jsx($i,{label:t("props.annFontSize"),value:r.fontSize,onCommit:i=>o({fontSize:i})})})}}}function D6(e,t){const n=e.colWidths.length,o=e.rowHeights[e.rowHeights.length-1]??Ut,r=e.rowHeights.slice(0,t);for(;r.length<t;)r.push(o);const i=e.cells.slice(0,t).map(a=>[...a]);for(;i.length<t;)i.push(rk(n,1).cells[0]);return{rowHeights:r,cells:i}}function R6(e,t){const n=e.colWidths[e.colWidths.length-1]??Kt,o=e.colWidths.slice(0,t);for(;o.length<t;)o.push(n);const r=e.cells.map(i=>{const a=i.slice(0,t);for(;a.length<t;)a.push("");return a});return{colWidths:o,cells:r}}function bn({label:e,value:t,options:n,onChange:o}){return d.jsx(at,{label:e,children:d.jsx("div",{className:"flex overflow-hidden rounded-md border border-border/60",children:n.map(r=>d.jsx("button",{type:"button","aria-pressed":t===r.value,onClick:()=>o(r.value),className:ke("h-7 flex-1 truncate px-1.5 text-[11px] transition-colors",t===r.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.label},r.value))})})}function Ci({label:e,value:t,min:n,onChange:o}){return d.jsx(at,{label:e,children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{type:"button","aria-label":`${e} −`,disabled:t<=n,onClick:()=>o(t-1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40",children:"−"}),d.jsx("span",{className:"w-8 text-center font-mono text-[11px] tabular-nums",children:t}),d.jsx("button",{type:"button","aria-label":`${e} +`,onClick:()=>o(t+1),className:"h-7 w-7 rounded-md border border-border/60 text-[13px] leading-none text-muted-foreground hover:bg-accent",children:"+"})]})})}const O6=5,L6=32,B6=8;function $i({label:e,value:t,onCommit:n}){return d.jsx(Xe,{label:e,value:t!=null?String(t):"",placeholder:String(B6),unit:"px",onCommit:o=>{const r=o.trim();if(r===""){n(void 0);return}const i=Number(r);Number.isFinite(i)&&n(Math.min(L6,Math.max(O6,Math.round(i))))}})}function H6({wireId:e}){const t=se(),n=y(b=>b.diagram.wires),o=y(b=>b.diagram.elements),r=y(b=>b.diagram.buses),i=y(b=>b.diagram.junctions),a=y(b=>b.internal.terminalToNode),s=y(b=>b.setSelectedNode),l=(n??[]).find(b=>b.id===e);if(!l)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.wireNotFound",{id:e})});const c=a.get(l.ends[0]),u=new Map(o.map(b=>[b.id,b])),m=new Map((r??[]).map(b=>[b.id,b])),h=new Map((i??[]).map(b=>[b.id,b])),g=b=>{if(!b.includes(".")){const B=m.get(b);if(B)return{id:b,label:B.name??b};const V=h.get(b);return{id:b,label:(V==null?void 0:V.name)??b}}const x=b.indexOf("."),v=b.slice(0,x),P=b.slice(x+1),T=u.get(v);return{id:v,label:(T==null?void 0:T.name)??v,pin:P}},p=g(l.ends[0]),f=g(l.ends[1]);return d.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 text-xs",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.wire")}),d.jsx("div",{className:"font-mono text-[12px]",children:l.id})]}),d.jsx(Xe,{label:t("props.label"),value:l.label??"",placeholder:t("props.labelPlaceholder"),onCommit:b=>y.getState().updateWire(e,{label:b.trim()===""?void 0:b.trim()})}),d.jsx("ul",{className:"space-y-0.5 border-t border-border/40 pt-2",children:[p,f].map((b,x)=>d.jsxs("li",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 hover:bg-accent",onClick:()=>y.getState().setSelection([b.id]),children:[d.jsx("span",{className:"flex-1 truncate font-mono text-[11px]",children:b.id}),d.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:b.label}),b.pin&&d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:b.pin})]},x))}),c&&d.jsx("button",{type:"button",className:"self-start rounded-md border border-border/60 px-2 py-1 text-[11px] text-muted-foreground hover:bg-accent",onClick:()=>s(c),children:t("props.selectWholeNode")})]})}function F6({junction:e}){var r;const t=se(),n=y(i=>{var a;return(a=i.internal.junctions.get(e.id))==null?void 0:a.world}),o=((r=e.layout)==null?void 0:r.at)??n;return d.jsxs("div",{className:"flex flex-col gap-2.5 px-3 py-3 text-xs",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.junction")}),d.jsx("div",{className:"font-mono text-[12px]",children:e.id})]}),d.jsx(Xe,{label:t("props.name"),value:e.name??"",placeholder:e.id,onCommit:i=>y.getState().updateJunction(e.id,{name:i.trim()===""?void 0:i.trim()})}),d.jsx(Wo,{label:t("props.note"),value:e.note??"",onCommit:i=>y.getState().updateJunction(e.id,{note:i.trim()===""?void 0:i.trim()})},e.id),o&&d.jsxs("div",{className:"flex items-center justify-between border-t border-border/40 pt-2",children:[d.jsx("span",{className:"text-muted-foreground",children:t("props.junctionPos")}),d.jsxs("span",{className:"font-mono text-[11px]",children:[Math.round(o[0]),", ",Math.round(o[1])]})]})]})}function W6({nodeId:e}){const t=se(),n=y(s=>s.internal.nodes.get(e)),o=y(s=>s.diagram.elements),r=y(s=>s.setSelection);if(!n)return d.jsx("div",{className:"px-4 py-5 text-center text-xs text-muted-foreground",children:t("props.nodeNotFound",{id:e})});const i=new Map;for(const s of n.terminals){const l=s.indexOf(".");if(l<0)continue;const c=s.slice(0,l),u=s.slice(l+1),m=i.get(c)??[];m.push(u),i.set(c,m)}const a=new Map(o.map(s=>[s.id,s]));return d.jsxs("div",{className:"flex flex-col gap-3 px-3 py-3 text-xs",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("props.node")}),d.jsx("div",{className:"font-mono text-[12px]",children:n.id}),d.jsx("div",{className:"text-[11px] text-muted-foreground",children:t("props.nodeStats",{terminals:n.terminals.length,elements:i.size})})]}),d.jsx("ul",{className:"space-y-0.5 border-t border-border/40 pt-2",children:[...i.entries()].map(([s,l])=>{const c=a.get(s);return d.jsxs("li",{className:"flex cursor-pointer items-center gap-2 rounded-md px-1.5 py-1 hover:bg-accent",onClick:()=>r([s]),title:t("props.selectElement",{label:s}),children:[d.jsx("span",{className:"flex-1 truncate font-mono text-[11px]",children:s}),d.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:(c==null?void 0:c.name)??""}),d.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/80",children:l.join(", ")})]},s)})})]})}function at({label:e,children:t}){return d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("label",{className:"w-16 shrink-0 truncate text-[11px] text-muted-foreground",children:e}),d.jsx("div",{className:"min-w-0 flex-1",children:t})]})}function Xe({label:e,value:t,placeholder:n,unit:o,onCommit:r}){const[i,a]=I.useState(t),s=I.useRef(null);return I.useEffect(()=>a(t),[t]),d.jsx(at,{label:e,children:d.jsxs("div",{className:"relative",children:[d.jsx("input",{ref:s,type:"text",value:i,placeholder:n,onChange:l=>a(l.target.value),onBlur:()=>{i!==t&&r(i)},onKeyDown:l=>{var c,u;l.key==="Enter"&&((c=s.current)==null||c.blur()),l.key==="Escape"&&(a(t),(u=s.current)==null||u.blur())},className:ke("h-7 w-full rounded-md border border-border/60 bg-background/50 px-2 text-[11px] focus:border-border focus:outline-none focus:ring-1 focus:ring-ring",o&&"pr-8")}),o&&d.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:o})]})})}const q6=350;function Wo({label:e,value:t,onCommit:n}){const[o,r]=I.useState(t),i=I.useRef(!1),a=I.useRef(null),s=I.useRef({local:o,value:t,onCommit:n});s.current={local:o,value:t,onCommit:n};const l=I.useRef(null);I.useEffect(()=>{i.current||(r(t),l.current=null)},[t]);const c=()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null);const m=s.current;m.local===m.value||m.local===l.current||(l.current=m.local,m.onCommit(m.local))},u=I.useRef(c);return u.current=c,I.useEffect(()=>()=>u.current(),[]),d.jsx(at,{label:e,children:d.jsx("textarea",{rows:2,value:o,onFocus:()=>{i.current=!0},onChange:m=>{r(m.target.value),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>{a.current=null,u.current()},q6)},onBlur:()=>{i.current=!1,c()},className:"w-full resize-none rounded-md border border-border/60 bg-background/50 px-2 py-1 text-[11px] focus:border-border focus:outline-none focus:ring-1 focus:ring-ring"})})}function Hn({label:e,value:t,min:n,unit:o,onCommit:r}){const[i,a]=I.useState(String(t)),s=I.useRef(null);return I.useEffect(()=>a(String(t)),[t]),d.jsx(at,{label:e,children:d.jsxs("div",{className:"relative",children:[d.jsx("input",{ref:s,type:"number",value:i,onChange:l=>a(l.target.value),onBlur:()=>{const l=Number(i);Number.isFinite(l)&&l!==t?r(l):a(String(t))},onKeyDown:l=>{var c,u;l.key==="Enter"&&((c=s.current)==null||c.blur()),l.key==="Escape"&&(a(String(t)),(u=s.current)==null||u.blur())},min:n,className:ke("h-7 w-full rounded-md border border-border/60 bg-background/50 px-2 font-mono text-[11px] tabular-nums focus:border-border focus:outline-none focus:ring-1 focus:ring-ring",o&&"pr-8")}),o&&d.jsx("span",{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground",children:o})]})})}function qo({active:e,onClick:t,children:n}){return d.jsx("button",{type:"button",onClick:t,className:ke("flex h-6 w-full items-center justify-center gap-1.5 rounded border text-[10px] transition-colors",e?"border-[var(--selection)] bg-[var(--selection)]/15 text-foreground":"border-border/60 text-muted-foreground hover:bg-accent"),"aria-pressed":e,children:n})}function G6({id:e,element:t,field:n}){var l;const o=se(),i=nn()(`${t.kind}.state.${n.name}`,n.label??n.name),a=((l=t.state)==null?void 0:l[n.name])??n.default,s=c=>{const u={...t.state??{}};c===void 0||c===n.default?delete u[n.name]:u[n.name]=c,y.getState().updateElement(e,{state:Object.keys(u).length>0?u:void 0})};return n.type==="boolean"?d.jsx(at,{label:i,children:d.jsx(qo,{active:!!a,onClick:()=>s(!a),children:o(a?"common.yes":"common.no")})}):n.type==="number"?d.jsx(Hn,{label:i,value:typeof a=="number"?a:0,onCommit:s}):d.jsx(Xe,{label:i,value:typeof a=="string"?a:"",onCommit:c=>s(c.trim()===""?void 0:c)})}function V6(){const e=se(),t=nn(),n=y(p=>p.selection),o=y(p=>p.selectedNode),r=y(p=>p.selectedWire),i=y(p=>p.selectedAnnotations),a=y(vt),s=y(p=>p.diagram.annotations),l=y(p=>p.diagram.elements),c=y(p=>p.diagram.buses),u=it(),m=Re(u,"dense");if(n.length===0&&i.length===0&&!o&&!r)return null;let h=e("props.title"),g=null;if(r)h=e("props.wire");else if(o)h=e("props.node");else if(a){const p=(s??[]).find(b=>b.id===a),f=p?Oe(p):"text";h=e(f==="rect"?"props.annRect":f==="line"?"props.annLine":f==="table"?"props.annTable":"props.annText")}else if(n.length===1&&i.length===0){const p=n[0],f=(c??[]).find(b=>b.id===p);if(f)h=f.name??e("props.bus");else{const b=l.find(x=>x.id===p);if(b){const x=rt[b.kind];h=x?t(`${x.id}.name`,x.name):b.kind}}}else g=n.length+i.length;return d.jsxs("aside",{className:ke("ole-glass absolute z-10 flex flex-col overflow-hidden rounded-2xl border border-border shadow-sm",m?"w-48":"w-56"),style:{top:`calc(${m?"4.5rem":"0.75rem"} + var(--ole-top-inset, 0px) + var(--ole-safe-top, 0px))`,right:"calc(0.75rem + var(--ole-right-inset, 0px) + var(--ole-safe-right, 0px))",maxHeight:`calc(100% - ${m?"5.25rem":"1.5rem"} - var(--ole-top-inset, 0px) - var(--ole-safe-top, 0px) - var(--ole-bottom-inset, 0px) - var(--ole-safe-bottom, 0px) - 4.5rem)`},children:[d.jsxs("div",{className:"flex items-center gap-1.5 border-b border-border/40 px-3 py-2",children:[d.jsx("span",{className:"flex-1 truncate text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:h}),g!=null&&d.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5 font-mono text-[10px] tabular-nums text-muted-foreground/80",children:e("props.nSelected",{n:g})})]}),d.jsx(E6,{})]})}function K6(){I.useEffect(()=>{const e=n=>{const o=n.target;if(!o||o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable)return;const r=o.closest("button");r&&r.closest(".ole-glass")&&n.preventDefault()},t=n=>{const o=n.target;if(!o||!o.closest(".ole-canvas-root"))return;const r=document.activeElement;!r||r===document.body||r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable||r.blur()};return window.addEventListener("mousedown",e),window.addEventListener("pointerdown",t,!0),()=>{window.removeEventListener("mousedown",e),window.removeEventListener("pointerdown",t,!0)}},[])}function U6(){K6();const e=y(o=>o.readOnly),t=I.useRef(null),n=tE(t);return d.jsx(oS,{children:d.jsx("div",{ref:t,className:"relative h-full w-full overflow-hidden bg-background text-foreground",children:d.jsxs(PE,{width:n,children:[d.jsx(SE,{}),e?d.jsxs(d.Fragment,{children:[d.jsx(xi,{}),d.jsx(di,{})]}):d.jsxs(d.Fragment,{children:[d.jsx(u6,{}),d.jsx(V6,{}),d.jsx(s6,{}),d.jsx(xi,{}),d.jsx(KE,{}),d.jsx(XE,{}),d.jsx(k6,{}),d.jsx(A6,{}),d.jsx(di,{})]})]})})})}const X6="ole-theme";function Y6(){try{const e=window.localStorage.getItem(X6);return e==="light"||e==="dark"?e:null}catch{return null}}function Z6(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Q6(){return typeof window>"u"?"light":Y6()??(Z6()?"dark":"light")}function Ik(e){typeof document>"u"||document.documentElement.classList.toggle("dark",e==="dark")}function J6({className:e,diagram:t,readOnly:n,locale:o,theme:r}){return I.useEffect(()=>{y.getState().setReadOnly(!!n)},[n]),I.useEffect(()=>{if(!t)return;if(n){y.getState().setDiagram(t),y.getState().setActiveTool("pan");return}y.getState().diagram.elements.length===0&&y.getState().setDiagram(t)},[t,n]),I.useEffect(()=>{o&&Zt.getState().setLocale(o)},[o]),I.useEffect(()=>{r&&Ik(r)},[r]),I.useEffect(()=>{Ho()},[]),RA(),d.jsx("div",{className:`ole-root ${e??"h-full w-full"}`,children:d.jsx(U6,{})})}const zk={"application/json":[".json"]},Mk=()=>typeof window<"u"&&typeof window.showOpenFilePicker=="function",Dk=e=>e instanceof DOMException&&e.name==="AbortError";function ji(e){let t;try{t=JSON.parse(e)}catch(o){throw new Error(Se("io.parseFailed",{err:o.message}))}if(!t||typeof t!="object"||Array.isArray(t))throw new Error(Se("io.notObject"));const n=t;if(n.version!=="1")throw new Error(Se("io.versionMismatch",{actual:JSON.stringify(n.version)}));if(!Array.isArray(n.elements))throw new Error(Se("io.elementsMissing"));return n}function e4(e){return JSON.stringify(e,null,2)+`
220
+ `}async function t4(){if(Mk()){let e;try{[e]=await window.showOpenFilePicker({multiple:!1,types:[{description:Se("topbar.file.fileDescription"),accept:zk}]})}catch(n){if(Dk(n))return null;throw n}const t=await e.getFile();return{diagram:ji(await t.text()),session:{handle:e,name:t.name}}}return new Promise((e,t)=>{const n=document.createElement("input");n.type="file",n.accept=".json,application/json",n.addEventListener("change",async()=>{var r;const o=(r=n.files)==null?void 0:r[0];if(!o)return e(null);try{e({diagram:ji(await o.text()),session:{name:o.name}})}catch(i){t(i)}}),n.addEventListener("cancel",()=>e(null)),n.click()})}async function Ai(e,t,n={}){const o=e4(e);if(!n.saveAs&&(t!=null&&t.handle)){const a=await t.handle.createWritable();return await a.write(o),await a.close(),t}if(Mk()){let a;try{a=await window.showSaveFilePicker({suggestedName:(t==null?void 0:t.name)??"diagram.json",types:[{description:Se("topbar.file.fileDescription"),accept:zk}]})}catch(l){if(Dk(l))return null;throw l}const s=await a.createWritable();return await s.write(o),await s.close(),{handle:a,name:a.name}}const r=URL.createObjectURL(new Blob([o],{type:"application/json"})),i=document.createElement("a");return i.href=r,i.download=(t==null?void 0:t.name)??"diagram.json",i.click(),URL.revokeObjectURL(r),t??{name:"diagram.json"}}function n4(){const e=se(),t=y(m=>m.fileSession),n=(t==null?void 0:t.name)??e("common.unnamed"),{onNew:o,onOpen:r,onSave:i,onSaveAs:a}=o4(),[s,l]=I.useState(!1),c=I.useRef(null);I.useEffect(()=>{const m=h=>{if(!(h.metaKey||h.ctrlKey))return;const g=h.key.toLowerCase();g==="o"?(h.preventDefault(),r()):g==="s"&&(h.preventDefault(),h.shiftKey?a():i())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[r,i,a]),I.useEffect(()=>{if(!s)return;const m=g=>{c.current&&!c.current.contains(g.target)&&l(!1)},h=g=>{g.key==="Escape"&&l(!1)};return window.addEventListener("mousedown",m),window.addEventListener("keydown",h),()=>{window.removeEventListener("mousedown",m),window.removeEventListener("keydown",h)}},[s]);const u=m=>()=>{l(!1),m()};return d.jsxs("div",{ref:c,className:"relative",children:[d.jsxs(Te,{variant:"ghost",size:"sm",className:"gap-1.5","aria-haspopup":"menu","aria-expanded":s,onClick:()=>l(m=>!m),children:[d.jsx(mr,{}),e("topbar.file.label")]}),s&&d.jsxs("div",{role:"menu",className:"ole-glass absolute left-0 top-full mt-1.5 min-w-44 rounded-md border border-border p-1 shadow-md",children:[d.jsx("div",{className:"border-b border-border px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:n}),d.jsx(yn,{onClick:u(o),icon:d.jsx(d2,{}),children:e("topbar.file.new")}),d.jsx(yn,{onClick:u(r),icon:d.jsx(mr,{}),hint:"⌘O",children:e("topbar.file.open")}),d.jsx(yn,{onClick:u(i),icon:d.jsx(pr,{}),hint:"⌘S",children:e("topbar.file.save")}),d.jsx(yn,{onClick:u(a),icon:d.jsx(pr,{}),hint:"⌘⇧S",children:e("topbar.file.saveAs")})]})]})}function yn({children:e,icon:t,hint:n,onClick:o}){return d.jsxs("button",{type:"button",role:"menuitem",onClick:o,className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[t,d.jsx("span",{className:"flex-1",children:e}),n&&d.jsx("span",{className:"text-xs tabular-nums text-muted-foreground",children:n})]})}function o4(){const e=se(),t=y(l=>l.loadDiagramFromFile),n=y(l=>l.setFileSession),o=y(l=>l.setDiagram);return{onNew:()=>{const{diagram:l}=y.getState();l.elements.length>0&&!confirm(e("topbar.file.newConfirm"))||(o({version:"1",elements:[]}),n(null))},onOpen:async()=>{try{const l=await t4();l&&(t(l.diagram,l.session),Ho())}catch(l){alert(e("topbar.file.openFailed",{err:l.message}))}},onSave:async()=>{try{const{diagram:l,fileSession:c}=y.getState(),u=await Ai(l,c);u&&n(u)}catch(l){alert(e("topbar.file.saveFailed",{err:l.message}))}},onSaveAs:async()=>{try{const{diagram:l,fileSession:c}=y.getState(),u=await Ai(l,c,{saveAs:!0});u&&n(u)}catch(l){alert(e("topbar.file.saveFailed",{err:l.message}))}}}}const so="WIRES",Ye="ELEMENTS",lo="LABELS",Le="ANNOTATIONS",Ei=32,Ni=64,r4=8,i4=1.25,a4=6;function Rk(e,t={}){var a,s;const n=new x4(t.precision??6);n.header(t.title),n.tables([{name:so,color:7},{name:Ye,color:7},{name:lo,color:8},{name:Le,color:3}]),n.beginEntities();for(const l of e.wireRenders.values())l.path.length<2||n.lwpolyline(so,l.path.map(be),!1);for(const{geometry:l}of e.buses.values()){const{axis:c,at:u,span:m}=l,h=m/2,g=c==="x"?[u[0]-h,u[1]]:[u[0],u[1]-h],p=c==="x"?[u[0]+h,u[1]]:[u[0],u[1]+h];n.lwpolyline(so,[g,p].map(be),!1)}for(const l of e.elements.values()){const c=e.layout.get(l.element.id),u=l.libraryDef;!c||!u||s4(n,u.svg,c)}const o=t.labelMode??"all",r=kt(t.labelFontSize),i=Qt(r);if(o!=="off"){for(const l of e.elements.values()){const c=e.layout.get(l.element.id);if(!c||!l.libraryDef)continue;const u=zn(l,o);if(u.length===0)continue;const m=l.libraryDef.label??Mn(l.libraryDef,r),{world:[h,g],textAnchor:p,dy:f}=Dn(m,l.libraryDef,c,u.length,r);for(let b=0;b<u.length;b++){const[x,v]=be([h,g+f+b*i]);n.text(lo,[x,v],u[b],r,0,!1,p)}}for(const l of e.wireRenders.values()){const c=(a=l.label)==null?void 0:a.trim();if(!c)continue;const u=Rn(l.path,r);if(!u)continue;const m=be(u.world);n.text(lo,m,c,r,0,!1,u.textAnchor)}}for(const l of t.annotations??[])switch(Oe(l)){case"rect":{const c=l,[u,m]=c.at,[h,g]=c.size;if(n.lwpolyline(Le,[[u,m],[u+h,m],[u+h,m+g],[u,m+g]].map(be),!0),c.label){const p=be([u+bt,m+bt+Ge]);n.text(Le,p,c.label,Ge,0,!1)}break}case"line":{const c=l,u=en(c);if(u.length<2)break;n.lwpolyline(Le,u.map(be),!1);for(const m of Lo(u,c.arrow))n.lwpolyline(Le,m.map(be),!0);break}case"table":{const c=l,[u,m]=c.at,[h,g]=Ue(c),p=St(c),f=_t(c),b=c.fontSize??Ge;n.lwpolyline(Le,[[u,m],[u+h,m],[u+h,m+g],[u,m+g]].map(be),!0);for(let x=1;x<c.colWidths.length;x++)n.line(Le,be([u+p[x],m]),be([u+p[x],m+g]));for(let x=1;x<c.rowHeights.length;x++)n.line(Le,be([u,m+f[x]]),be([u+h,m+f[x]]));for(let x=0;x<c.rowHeights.length;x++)for(let v=0;v<c.colWidths.length;v++){const P=((s=c.cells[x])==null?void 0:s[v])??"";if(P==="")continue;const T=be([u+p[v]+Vt,m+f[x]+c.rowHeights[x]/2+b*.35]);n.text(Le,T,P,b,0,!1)}break}default:{const c=l;if(!c.text)break;const u=c.fontSize??r4,m=c.text.split(`
221
+ `);for(let h=0;h<m.length;h++){const[g,p]=be([c.at[0],c.at[1]+(h+1)*u*i4]);n.text(Le,[g,p],m[h],u,0,!1)}break}}return n.endEntities(),n.toString()}async function Ok(e,t="diagram.dxf",n){const o=Rk(e,n),r=URL.createObjectURL(new Blob([o],{type:"application/dxf;charset=utf-8"})),i=document.createElement("a");i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}function s4(e,t,n){const o=`<svg xmlns="http://www.w3.org/2000/svg">${t}</svg>`,i=new DOMParser().parseFromString(o,"image/svg+xml").documentElement;if(!(!i||i.querySelector("parsererror")))for(const a of Array.from(i.children))switch(a.tagName.toLowerCase()){case"line":l4(e,a,n);break;case"polyline":Ti(e,a,n,!1);break;case"polygon":Ti(e,a,n,!0);break;case"rect":c4(e,a,n);break;case"circle":d4(e,a,n);break;case"ellipse":u4(e,a,n);break;case"path":f4(e,a,n);break;case"text":h4(e,a,n);break}}function l4(e,t,n){const o=_e(t,"x1"),r=_e(t,"y1"),i=_e(t,"x2"),a=_e(t,"y2"),s=be(Ke([o,r],n)),l=be(Ke([i,a],n));e.line(Ye,s,l)}function Ti(e,t,n,o){const r=y4(t.getAttribute("points")??"");if(r.length<2)return;const i=r.map(a=>be(Ke(a,n)));e.lwpolyline(Ye,i,o)}function c4(e,t,n){const o=_e(t,"x"),r=_e(t,"y"),i=_e(t,"width"),a=_e(t,"height"),l=[[o,r],[o+i,r],[o+i,r+a],[o,r+a]].map(c=>be(Ke(c,n)));e.lwpolyline(Ye,l,!0)}function d4(e,t,n){const o=_e(t,"cx"),r=_e(t,"cy"),i=_e(t,"r"),a=be(Ke([o,r],n));e.circle(Ye,a,i)}function u4(e,t,n){const o=_e(t,"cx"),r=_e(t,"cy"),i=_e(t,"rx"),a=_e(t,"ry");if(Math.abs(i-a)<1e-6){m4(e,o,r,i,n);return}p4(e,o,r,i,a,n)}function m4(e,t,n,o,r){const i=be(Ke([t,n],r));e.circle(Ye,i,o)}function p4(e,t,n,o,r,i){const a=[];for(let s=0;s<Ni;s++){const l=s/Ni*Math.PI*2;a.push(be(Ke([t+o*Math.cos(l),n+r*Math.sin(l)],i)))}e.lwpolyline(Ye,a,!0)}function h4(e,t,n){const o=_e(t,"x"),r=_e(t,"y"),i=parseFloat(t.getAttribute("font-size")??"")||a4,a=(t.textContent??"").trim();if(!a)return;const s=be(Ke([o,r],n));e.text(Ye,s,a,i,n.rot,n.mirror)}function f4(e,t,n){const o=t.getAttribute("d")??"",r=g4(o);if(r.length===0)return;let i=null,a=[];const s=()=>{a.length>=2&&e.lwpolyline(Ye,a.map(l=>be(Ke(l,n))),!1),a=[]};for(const l of r)if(l.cmd==="M")s(),i=[l.args[0],l.args[1]],a.push(i);else if(l.cmd==="A"&&i){const[c,u,,m,h,g,p]=l.args,f=b4(i,[g,p],c,u,m!==0,h!==0);if(f)for(let b=1;b<=Ei;b++){const x=f.theta1+f.delta*b/Ei;a.push([f.cx+c*Math.cos(x),f.cy+u*Math.sin(x)])}else a.push([g,p]);i=[g,p]}s()}function g4(e){const t=[],n=/([MmAa])([^MmAa]*)/g;let o;for(;(o=n.exec(e))!==null;){const r=o[1].toUpperCase(),i=o[2].trim().split(/[\s,]+/).filter(a=>a.length>0).map(Number);t.push({cmd:r,args:i})}return t}function b4(e,t,n,o,r,i){if(n<=0||o<=0)return null;const[a,s]=e,[l,c]=t;if(a===l&&s===c)return null;const u=(a-l)/2,m=(s-c)/2;let h=Math.abs(n),g=Math.abs(o);const p=h*h,f=g*g,b=u*u/p+m*m/f;if(b>1){const W=Math.sqrt(b);h*=W,g*=W}const x=r===i?-1:1,v=h*h*g*g-h*h*m*m-g*g*u*u,P=h*h*m*m+g*g*u*u,T=x*Math.sqrt(Math.max(0,v/P)),B=T*(h*m)/g,V=T*-(g*u)/h,S=B+(a+l)/2,H=V+(s+c)/2,F=(W,ie,ce,me)=>{const J=W*ce+ie*me,ae=Math.hypot(W,ie)*Math.hypot(ce,me);let he=Math.acos(Math.max(-1,Math.min(1,J/ae)));return W*me-ie*ce<0&&(he=-he),he},Z=F(1,0,(u-B)/h,(m-V)/g);let R=F((u-B)/h,(m-V)/g,(-u-B)/h,(-m-V)/g);return!i&&R>0?R-=2*Math.PI:i&&R<0&&(R+=2*Math.PI),{cx:S,cy:H,theta1:Z,delta:R}}function Ke(e,t){return De(e,t)}function be(e){return[e[0],-e[1]]}function _e(e,t){const n=parseFloat(e.getAttribute(t)??"");return Number.isFinite(n)?n:0}function y4(e){const t=e.trim().split(/[\s,]+/).map(Number).filter(o=>Number.isFinite(o)),n=[];for(let o=0;o+1<t.length;o+=2)n.push([t[o],t[o+1]]);return n}class x4{constructor(t){Et(this,"out",[]);Et(this,"precision");this.precision=t}toString(){return this.out.join("")}g(t,n){this.out.push(`${t}
222
222
  ${this.fmt(n)}
223
- `)}fmt(t){return typeof t=="number"?Number.isFinite(t)?Number.isInteger(t)?String(t):t.toFixed(this.precision):"0":t}header(t){this.g(0,"SECTION"),this.g(2,"HEADER"),this.g(9,"$ACADVER"),this.g(1,"AC1009"),this.g(9,"$INSUNITS"),this.g(70,0),t&&(this.g(9,"$PROJECTNAME"),this.g(1,ji(t))),this.g(0,"ENDSEC")}tables(t){this.g(0,"SECTION"),this.g(2,"TABLES"),this.g(0,"TABLE"),this.g(2,"LAYER"),this.g(70,t.length);for(const n of t)this.g(0,"LAYER"),this.g(2,n.name),this.g(70,0),this.g(62,n.color),this.g(6,"CONTINUOUS");this.g(0,"ENDTAB"),this.g(0,"ENDSEC")}beginEntities(){this.g(0,"SECTION"),this.g(2,"ENTITIES")}endEntities(){this.g(0,"ENDSEC"),this.g(0,"EOF")}line(t,n,o){this.g(0,"LINE"),this.g(8,t),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(11,o[0]),this.g(21,o[1]),this.g(31,0)}lwpolyline(t,n,o){if(!(n.length<2)){this.g(0,"LWPOLYLINE"),this.g(8,t),this.g(90,n.length),this.g(70,o?1:0);for(const[r,i]of n)this.g(10,r),this.g(20,i)}}circle(t,n,o){this.g(0,"CIRCLE"),this.g(8,t),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(40,o)}text(t,n,o,r,i,a,s="start"){this.g(0,"TEXT"),this.g(8,t),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(40,r),this.g(1,ji(o)),i!==0&&this.g(50,i),a&&this.g(71,2),s!=="start"&&(this.g(72,s==="middle"?1:2),this.g(11,n[0]),this.g(21,n[1]),this.g(31,0))}}function ji(e){return e.replace(/[\r\n]+/g," ").slice(0,250)}const h4="http://www.w3.org/2000/svg",fn=24,f4=1.25;function Wo(e,t={}){var f;const n=w4(e,t),o=Math.floor(n.minX-fn),r=Math.floor(n.minY-fn),i=Math.ceil(n.maxX+fn)-o,a=Math.ceil(n.maxY+fn)-r,s=t.background??"#FFFFFF",l=[];l.push('<?xml version="1.0" encoding="UTF-8"?>'),l.push(`<svg xmlns="${h4}" viewBox="${o} ${r} ${i} ${a}" width="${i}" height="${a}">`),t.title&&l.push(` <title>${We(t.title)}</title>`),s!=="transparent"&&l.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="${s}"/>`),l.push(' <g fill="none" stroke="black" stroke-width="1">');for(const h of e.wireRenders.values()){if(h.path.length<2)continue;const g=h.path.map(([b,x])=>`${b},${x}`).join(" ");l.push(` <polyline points="${g}"/>`)}l.push(" </g>");for(const{bus:h,geometry:g}of e.buses.values()){const{axis:b,at:x,span:v}=g,T=v/2,I=b==="x"?x[0]-T:x[0],H=b==="x"?x[1]:x[1]-T,K=b==="x"?x[0]+T:x[0],_=b==="x"?x[1]:x[1]+T;l.push(` <line id="${We(h.id)}" x1="${I}" y1="${H}" x2="${K}" y2="${_}" stroke="black" stroke-width="3" stroke-linecap="round" fill="none"/>`)}for(const{junction:h,world:g,degree:b}of e.junctions.values())b<3||l.push(` <circle id="${We(h.id)}" cx="${g[0]}" cy="${g[1]}" r="3.5" fill="black"/>`);for(const h of e.elements.values()){if(!h.libraryDef)continue;const g=e.layout.get(h.element.id);g&&(l.push(` <g id="${We(h.element.id)}" transform="${ot(g)}">`),l.push(` ${h.libraryDef.svg}`),l.push(" </g>"))}const c=t.labelMode??"all",m=vt(t.labelFontSize),u=Xt(m);if(c!=="off"){const h=s==="transparent"?"#FFFFFF":s;l.push(` <g fill="black" font-family="ui-sans-serif, system-ui, sans-serif" font-size="${m}" paint-order="stroke" stroke="${h}" stroke-width="2" stroke-linejoin="round">`);for(const g of e.elements.values()){const b=e.layout.get(g.element.id);if(!b||!g.libraryDef)continue;const x=Tn(g,c);if(x.length===0)continue;const v=g.libraryDef.label??Pn(g.libraryDef,m),{world:[T,I],textAnchor:H,dy:K}=In(v,g.libraryDef,b,x.length,m);for(let _=0;_<x.length;_++)l.push(` <text x="${T}" y="${I+K+_*u}" text-anchor="${H}">${We(x[_])}</text>`)}for(const g of e.wireRenders.values()){const b=(f=g.label)==null?void 0:f.trim();if(!b)continue;const x=zn(g.path,m);x&&l.push(` <text x="${x.world[0]}" y="${x.world[1]}" text-anchor="${x.textAnchor}">${We(b)}</text>`)}l.push(" </g>")}const p=t.annotations??[];if(p.length>0){const h=s==="transparent"?"#FFFFFF":s,g=s==="transparent"?"none":s,b=`font-family="ui-sans-serif, system-ui, sans-serif" paint-order="stroke" stroke="${h}" stroke-width="2" stroke-linejoin="round"`;for(const x of p)switch(Oe(x)){case"rect":b4(l,x,b);break;case"line":y4(l,x);break;case"table":x4(l,x,g);break;default:g4(l,x,b);break}}return l.push("</svg>"),l.join(`
224
- `)}function g4(e,t,n){if(!t.text)return;const o=t.fontSize??Ge,r=t.text.split(`
225
- `);e.push(` <g fill="black" ${n}>`);for(let i=0;i<r.length;i++){const a=t.at[1]+o*.85+i*o*f4;e.push(` <text x="${t.at[0]}" y="${a}" font-size="${o}">${We(r[i])}</text>`)}e.push(" </g>")}function b4(e,t,n){const[o,r]=t.at,[i,a]=t.size,s=(t.stroke??"dashed")==="dashed"?` stroke-dasharray="${Yt}"`:"";t.fill==="tint"&&e.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="black" fill-opacity="${Ej}"/>`),e.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="none" stroke="black" stroke-width="1"${s}/>`),t.label&&(e.push(` <g fill="black" ${n}>`),e.push(` <text x="${o+bt}" y="${r+bt+Ge*.85}" font-size="${Ge}">${We(t.label)}</text>`),e.push(" </g>"))}function y4(e,t){const n=Zt(t);if(n.length<2)return;const o=(t.stroke??"solid")==="dashed"?` stroke-dasharray="${Yt}"`:"",r=n.map(([i,a])=>`${i},${a}`).join(" ");e.push(` <polyline points="${r}" fill="none" stroke="black" stroke-width="1"${o}/>`);for(const i of Ro(n,t.arrow))e.push(` <polygon points="${i.map(([a,s])=>`${a},${s}`).join(" ")}" fill="black"/>`)}function x4(e,t,n){var p;const[o,r]=t.at,[i,a]=Ue(t),s=kt(t),l=St(t),c=t.fontSize??Ge;n!=="none"&&e.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="${n}"/>`);let m="";for(let f=1;f<t.colWidths.length;f++)m+=`M${o+s[f]} ${r}V${r+a}`;for(let f=1;f<t.rowHeights.length;f++)m+=`M${o} ${r+l[f]}H${o+i}`;m&&e.push(` <path d="${m}" fill="none" stroke="black" stroke-width="0.5"/>`),e.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="none" stroke="black" stroke-width="1"/>`);const u=[];for(let f=0;f<t.rowHeights.length;f++)for(let h=0;h<t.colWidths.length;h++){const g=((p=t.cells[f])==null?void 0:p[h])??"";if(g==="")continue;const b=o+s[h]+Wt,x=r+l[f]+t.rowHeights[f]/2+c*.35;u.push(` <text x="${b}" y="${x}" font-size="${c}">${We(g)}</text>`)}u.length>0&&(e.push(' <g fill="black" font-family="ui-sans-serif, system-ui, sans-serif">'),e.push(...u),e.push(" </g>"))}function w4(e,t){var m;let n=1/0,o=1/0,r=-1/0,i=-1/0;const a=(u,p)=>{u<n&&(n=u),u>r&&(r=u),p<o&&(o=p),p>i&&(i=p)};for(const u of e.terminals.values())a(u.world[0],u.world[1]);for(const u of e.junctions.values())a(u.world[0],u.world[1]);for(const u of e.elements.values()){const p=e.layout.get(u.element.id),f=u.libraryDef;if(!p||!f)continue;const h=v4(f.viewBox);if(!h){a(p.at[0],p.at[1]);continue}const g=[[h.x,h.y],[h.x+h.w,h.y],[h.x,h.y+h.h],[h.x+h.w,h.y+h.h]];for(const b of g){const[x,v]=Me(b,p);a(x,v)}}for(const{geometry:u}of e.buses.values()){const{axis:p,at:f,span:h}=u,g=h/2;p==="x"?(a(f[0]-g,f[1]),a(f[0]+g,f[1])):(a(f[0],f[1]-g),a(f[0],f[1]+g))}for(const u of e.wireRenders.values())for(const[p,f]of u.path)a(p,f);const s=t.labelMode??"all",l=vt(t.labelFontSize),c=Xt(l);if(s!=="off"){for(const u of e.elements.values()){const p=e.layout.get(u.element.id);if(!p||!u.libraryDef)continue;const f=Tn(u,s);if(f.length===0)continue;const h=u.libraryDef.label??Pn(u.libraryDef,l),{world:[g,b],textAnchor:x,dy:v}=In(h,u.libraryDef,p,f.length,l),T=Ai(f,l),I=f.length*c,H=x==="middle"?g-T/2:x==="end"?g-T:g;a(H,b+v-l),a(H+T,b+v+I)}for(const u of e.wireRenders.values()){const p=(m=u.label)==null?void 0:m.trim();if(!p)continue;const f=zn(u.path,l);if(!f)continue;const[h,g]=f.world,b=Ai([p],l),x=f.textAnchor==="middle"?h-b/2:h;a(x,g-l),a(x+b,g)}}for(const u of t.annotations??[]){if(Oe(u)==="text"&&!u.text)continue;const p=Ij(u);a(p.minX,p.minY),a(p.maxX,p.maxY)}return n===1/0&&(n=0,o=0,r=0,i=0),{minX:n,minY:o,maxX:r,maxY:i}}function Ai(e,t){let n=0;for(const o of e){const r=o.length*t*.55;r>n&&(n=r)}return Math.max(20,n)}function v4(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function We(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function Pk(e,t="diagram.svg",n){const o=Wo(e,n);zk(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),t)}async function Ik(e,t="diagram.png",n){const o=Wo(e,n),r=(n==null?void 0:n.scale)??2,i=URL.createObjectURL(new Blob([o],{type:"image/svg+xml;charset=utf-8"}));try{const a=await k4(i),s=document.createElement("canvas");s.width=Math.round(a.naturalWidth*r),s.height=Math.round(a.naturalHeight*r);const l=s.getContext("2d");if(!l)throw new Error("canvas 2d context unavailable");n!=null&&n.background&&n.background!=="transparent"&&(l.fillStyle=n.background,l.fillRect(0,0,s.width,s.height)),l.drawImage(a,0,0,s.width,s.height);const c=await new Promise((m,u)=>{s.toBlob(p=>p?m(p):u(new Error("toBlob failed")),"image/png")});zk(c,t)}finally{URL.revokeObjectURL(i)}}function k4(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>t(o),o.onerror=()=>n(new Error("failed to load SVG into image")),o.src=e})}function zk(e,t){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=t,o.click(),URL.revokeObjectURL(n)}function S4(){const e=le(),[t,n]=P.useState(!1),o=P.useRef(null);P.useEffect(()=>{if(!t)return;const i=s=>{o.current&&!o.current.contains(s.target)&&n(!1)},a=s=>{s.key==="Escape"&&n(!1)};return window.addEventListener("mousedown",i),window.addEventListener("keydown",a),()=>{window.removeEventListener("mousedown",i),window.removeEventListener("keydown",a)}},[t]);const r=i=>()=>{var u,p,f,h,g;n(!1);const{internal:a,diagram:s,fileSession:l}=y.getState(),c=((u=l==null?void 0:l.name)==null?void 0:u.replace(/\.json$/i,""))??((p=s.meta)==null?void 0:p.title)??"diagram",m={title:(f=s.meta)==null?void 0:f.title,labelMode:(h=s.meta)==null?void 0:h.labelMode,labelFontSize:(g=s.meta)==null?void 0:g.labelFontSize,annotations:s.annotations};i==="svg"?Pk(a,`${c}.svg`,m):i==="png"?Ik(a,`${c}.png`,{...m,scale:2}).catch(b=>{console.error(b),alert(e("topbar.export.pngFailed",{err:b.message}))}):Tk(a,`${c}.dxf`,m).catch(b=>{console.error(b),alert(e("topbar.export.dxfFailed",{err:b.message}))})};return d.jsxs("div",{ref:o,className:"relative",children:[d.jsxs(Ne,{variant:"ghost",size:"sm",className:"gap-1.5","aria-haspopup":"menu","aria-expanded":t,onClick:()=>n(i=>!i),children:[d.jsx(e2,{}),e("topbar.export.label")]}),t&&d.jsxs("div",{role:"menu",className:"ole-glass absolute left-0 top-full mt-1.5 min-w-40 rounded-md border border-border p-1 shadow-md",children:[d.jsxs("button",{type:"button",role:"menuitem",onClick:r("svg"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[d.jsx(r2,{}),d.jsx("span",{className:"flex-1",children:"SVG"})]}),d.jsxs("button",{type:"button",role:"menuitem",onClick:r("png"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[d.jsx(n2,{}),d.jsx("span",{className:"flex-1",children:"PNG (2×)"})]}),d.jsxs("button",{type:"button",role:"menuitem",onClick:r("dxf"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[d.jsx(t2,{}),d.jsx("span",{className:"flex-1",children:"DXF"})]})]})]})}exports.ExportMenu=S4;exports.FileMenu=Y6;exports.LIBRARY=ho;exports.OneLineEditor=K6;exports.annotationKind=Oe;exports.applyTheme=$k;exports.buildExportDxf=Nk;exports.buildExportSvg=Wo;exports.compile=tt;exports.downloadDxf=Tk;exports.downloadPng=Ik;exports.downloadSvg=Pk;exports.emptyInternalModel=ea;exports.fitToContent=Oo;exports.fitToContentSoon=Lo;exports.getInitialTheme=V6;exports.getLibraryEntry=Lv;exports.isTextAnnotation=jj;exports.newAnnotationId=gn;exports.newBusId=fo;exports.newElementId=Ft;exports.newJunctionId=go;exports.orientationVec=po;exports.resolvePlacement=ta;exports.transformOrientation=Rt;exports.transformPoint=Me;exports.useEditorStore=y;exports.useLocale=Ut;exports.wireIdFromEnds=lt;
223
+ `)}fmt(t){return typeof t=="number"?Number.isFinite(t)?Number.isInteger(t)?String(t):t.toFixed(this.precision):"0":t}header(t){this.g(0,"SECTION"),this.g(2,"HEADER"),this.g(9,"$ACADVER"),this.g(1,"AC1009"),this.g(9,"$INSUNITS"),this.g(70,0),t&&(this.g(9,"$PROJECTNAME"),this.g(1,Pi(t))),this.g(0,"ENDSEC")}tables(t){this.g(0,"SECTION"),this.g(2,"TABLES"),this.g(0,"TABLE"),this.g(2,"LAYER"),this.g(70,t.length);for(const n of t)this.g(0,"LAYER"),this.g(2,n.name),this.g(70,0),this.g(62,n.color),this.g(6,"CONTINUOUS");this.g(0,"ENDTAB"),this.g(0,"ENDSEC")}beginEntities(){this.g(0,"SECTION"),this.g(2,"ENTITIES")}endEntities(){this.g(0,"ENDSEC"),this.g(0,"EOF")}line(t,n,o){this.g(0,"LINE"),this.g(8,t),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(11,o[0]),this.g(21,o[1]),this.g(31,0)}lwpolyline(t,n,o){if(!(n.length<2)){this.g(0,"LWPOLYLINE"),this.g(8,t),this.g(90,n.length),this.g(70,o?1:0);for(const[r,i]of n)this.g(10,r),this.g(20,i)}}circle(t,n,o){this.g(0,"CIRCLE"),this.g(8,t),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(40,o)}text(t,n,o,r,i,a,s="start"){this.g(0,"TEXT"),this.g(8,t),this.g(10,n[0]),this.g(20,n[1]),this.g(30,0),this.g(40,r),this.g(1,Pi(o)),i!==0&&this.g(50,i),a&&this.g(71,2),s!=="start"&&(this.g(72,s==="middle"?1:2),this.g(11,n[0]),this.g(21,n[1]),this.g(31,0))}}function Pi(e){return e.replace(/[\r\n]+/g," ").slice(0,250)}const w4="http://www.w3.org/2000/svg",xn=24,v4=1.25;function Go(e,t={}){var g;const n=$4(e,t),o=Math.floor(n.minX-xn),r=Math.floor(n.minY-xn),i=Math.ceil(n.maxX+xn)-o,a=Math.ceil(n.maxY+xn)-r,s=t.background??"#FFFFFF",l=[];l.push('<?xml version="1.0" encoding="UTF-8"?>'),l.push(`<svg xmlns="${w4}" viewBox="${o} ${r} ${i} ${a}" width="${i}" height="${a}">`),t.title&&l.push(` <title>${We(t.title)}</title>`),s!=="transparent"&&l.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="${s}"/>`),l.push(' <g fill="none" stroke="black" stroke-width="1">');for(const p of e.wireRenders.values()){if(p.path.length<2)continue;const f=p.path.map(([b,x])=>`${b},${x}`).join(" ");l.push(` <polyline points="${f}"/>`)}l.push(" </g>");for(const{bus:p,geometry:f}of e.buses.values()){const{axis:b,at:x,span:v}=f,P=v/2,T=b==="x"?x[0]-P:x[0],B=b==="x"?x[1]:x[1]-P,V=b==="x"?x[0]+P:x[0],S=b==="x"?x[1]:x[1]+P;l.push(` <line id="${We(p.id)}" x1="${T}" y1="${B}" x2="${V}" y2="${S}" stroke="black" stroke-width="3" stroke-linecap="round" fill="none"/>`)}for(const{junction:p,world:f,degree:b}of e.junctions.values())b<3||l.push(` <circle id="${We(p.id)}" cx="${f[0]}" cy="${f[1]}" r="3.5" fill="black"/>`);for(const p of e.elements.values()){if(!p.libraryDef)continue;const f=e.layout.get(p.element.id);f&&(l.push(` <g id="${We(p.element.id)}" transform="${ot(f)}">`),l.push(` ${p.libraryDef.svg}`),l.push(" </g>"))}const c=t.labelMode??"all",u=kt(t.labelFontSize),m=Qt(u);if(c!=="off"){const p=s==="transparent"?"#FFFFFF":s;l.push(` <g fill="black" font-family="ui-sans-serif, system-ui, sans-serif" font-size="${u}" paint-order="stroke" stroke="${p}" stroke-width="2" stroke-linejoin="round">`);for(const f of e.elements.values()){const b=e.layout.get(f.element.id);if(!b||!f.libraryDef)continue;const x=zn(f,c);if(x.length===0)continue;const v=f.libraryDef.label??Mn(f.libraryDef,u),{world:[P,T],textAnchor:B,dy:V}=Dn(v,f.libraryDef,b,x.length,u);for(let S=0;S<x.length;S++)l.push(` <text x="${P}" y="${T+V+S*m}" text-anchor="${B}">${We(x[S])}</text>`)}for(const f of e.wireRenders.values()){const b=(g=f.label)==null?void 0:g.trim();if(!b)continue;const x=Rn(f.path,u);x&&l.push(` <text x="${x.world[0]}" y="${x.world[1]}" text-anchor="${x.textAnchor}">${We(b)}</text>`)}l.push(" </g>")}const h=t.annotations??[];if(h.length>0){const p=s==="transparent"?"#FFFFFF":s,f=s==="transparent"?"none":s,b=`font-family="ui-sans-serif, system-ui, sans-serif" paint-order="stroke" stroke="${p}" stroke-width="2" stroke-linejoin="round"`;for(const x of h)switch(Oe(x)){case"rect":S4(l,x,b);break;case"line":_4(l,x);break;case"table":C4(l,x,f);break;default:k4(l,x,b);break}}return l.push("</svg>"),l.join(`
224
+ `)}function k4(e,t,n){if(!t.text)return;const o=t.fontSize??Ge,r=t.text.split(`
225
+ `);e.push(` <g fill="black" ${n}>`);for(let i=0;i<r.length;i++){const a=t.at[1]+o*.85+i*o*v4;e.push(` <text x="${t.at[0]}" y="${a}" font-size="${o}">${We(r[i])}</text>`)}e.push(" </g>")}function S4(e,t,n){const[o,r]=t.at,[i,a]=t.size,s=(t.stroke??"dashed")==="dashed"?` stroke-dasharray="${Jt}"`:"";t.fill==="tint"&&e.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="black" fill-opacity="${Dj}"/>`),e.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="none" stroke="black" stroke-width="1"${s}/>`),t.label&&(e.push(` <g fill="black" ${n}>`),e.push(` <text x="${o+bt}" y="${r+bt+Ge*.85}" font-size="${Ge}">${We(t.label)}</text>`),e.push(" </g>"))}function _4(e,t){const n=en(t);if(n.length<2)return;const o=(t.stroke??"solid")==="dashed"?` stroke-dasharray="${Jt}"`:"",r=n.map(([i,a])=>`${i},${a}`).join(" ");e.push(` <polyline points="${r}" fill="none" stroke="black" stroke-width="1"${o}/>`);for(const i of Lo(n,t.arrow))e.push(` <polygon points="${i.map(([a,s])=>`${a},${s}`).join(" ")}" fill="black"/>`)}function C4(e,t,n){var h;const[o,r]=t.at,[i,a]=Ue(t),s=St(t),l=_t(t),c=t.fontSize??Ge;n!=="none"&&e.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="${n}"/>`);let u="";for(let g=1;g<t.colWidths.length;g++)u+=`M${o+s[g]} ${r}V${r+a}`;for(let g=1;g<t.rowHeights.length;g++)u+=`M${o} ${r+l[g]}H${o+i}`;u&&e.push(` <path d="${u}" fill="none" stroke="black" stroke-width="0.5"/>`),e.push(` <rect x="${o}" y="${r}" width="${i}" height="${a}" fill="none" stroke="black" stroke-width="1"/>`);const m=[];for(let g=0;g<t.rowHeights.length;g++)for(let p=0;p<t.colWidths.length;p++){const f=((h=t.cells[g])==null?void 0:h[p])??"";if(f==="")continue;const b=o+s[p]+Vt,x=r+l[g]+t.rowHeights[g]/2+c*.35;m.push(` <text x="${b}" y="${x}" font-size="${c}">${We(f)}</text>`)}m.length>0&&(e.push(' <g fill="black" font-family="ui-sans-serif, system-ui, sans-serif">'),e.push(...m),e.push(" </g>"))}function $4(e,t){var u;let n=1/0,o=1/0,r=-1/0,i=-1/0;const a=(m,h)=>{m<n&&(n=m),m>r&&(r=m),h<o&&(o=h),h>i&&(i=h)};for(const m of e.terminals.values())a(m.world[0],m.world[1]);for(const m of e.junctions.values())a(m.world[0],m.world[1]);for(const m of e.elements.values()){const h=e.layout.get(m.element.id),g=m.libraryDef;if(!h||!g)continue;const p=j4(g.viewBox);if(!p){a(h.at[0],h.at[1]);continue}const f=[[p.x,p.y],[p.x+p.w,p.y],[p.x,p.y+p.h],[p.x+p.w,p.y+p.h]];for(const b of f){const[x,v]=De(b,h);a(x,v)}}for(const{geometry:m}of e.buses.values()){const{axis:h,at:g,span:p}=m,f=p/2;h==="x"?(a(g[0]-f,g[1]),a(g[0]+f,g[1])):(a(g[0],g[1]-f),a(g[0],g[1]+f))}for(const m of e.wireRenders.values())for(const[h,g]of m.path)a(h,g);const s=t.labelMode??"all",l=kt(t.labelFontSize),c=Qt(l);if(s!=="off"){for(const m of e.elements.values()){const h=e.layout.get(m.element.id);if(!h||!m.libraryDef)continue;const g=zn(m,s);if(g.length===0)continue;const p=m.libraryDef.label??Mn(m.libraryDef,l),{world:[f,b],textAnchor:x,dy:v}=Dn(p,m.libraryDef,h,g.length,l),P=Ii(g,l),T=g.length*c,B=x==="middle"?f-P/2:x==="end"?f-P:f;a(B,b+v-l),a(B+P,b+v+T)}for(const m of e.wireRenders.values()){const h=(u=m.label)==null?void 0:u.trim();if(!h)continue;const g=Rn(m.path,l);if(!g)continue;const[p,f]=g.world,b=Ii([h],l),x=g.textAnchor==="middle"?p-b/2:p;a(x,f-l),a(x+b,f)}}for(const m of t.annotations??[]){if(Oe(m)==="text"&&!m.text)continue;const h=ik(m);a(h.minX,h.minY),a(h.maxX,h.maxY)}return n===1/0&&(n=0,o=0,r=0,i=0),{minX:n,minY:o,maxX:r,maxY:i}}function Ii(e,t){let n=0;for(const o of e){const r=o.length*t*.55;r>n&&(n=r)}return Math.max(20,n)}function j4(e){const t=e.trim().split(/\s+/).map(Number);return t.length!==4||t.some(n=>Number.isNaN(n))?null:{x:t[0],y:t[1],w:t[2],h:t[3]}}function We(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function Lk(e,t="diagram.svg",n){const o=Go(e,n);Hk(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),t)}async function Bk(e,t="diagram.png",n){const o=Go(e,n),r=(n==null?void 0:n.scale)??2,i=URL.createObjectURL(new Blob([o],{type:"image/svg+xml;charset=utf-8"}));try{const a=await A4(i),s=document.createElement("canvas");s.width=Math.round(a.naturalWidth*r),s.height=Math.round(a.naturalHeight*r);const l=s.getContext("2d");if(!l)throw new Error("canvas 2d context unavailable");n!=null&&n.background&&n.background!=="transparent"&&(l.fillStyle=n.background,l.fillRect(0,0,s.width,s.height)),l.drawImage(a,0,0,s.width,s.height);const c=await new Promise((u,m)=>{s.toBlob(h=>h?u(h):m(new Error("toBlob failed")),"image/png")});Hk(c,t)}finally{URL.revokeObjectURL(i)}}function A4(e){return new Promise((t,n)=>{const o=new Image;o.onload=()=>t(o),o.onerror=()=>n(new Error("failed to load SVG into image")),o.src=e})}function Hk(e,t){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=t,o.click(),URL.revokeObjectURL(n)}function E4(){const e=se(),[t,n]=I.useState(!1),o=I.useRef(null);I.useEffect(()=>{if(!t)return;const i=s=>{o.current&&!o.current.contains(s.target)&&n(!1)},a=s=>{s.key==="Escape"&&n(!1)};return window.addEventListener("mousedown",i),window.addEventListener("keydown",a),()=>{window.removeEventListener("mousedown",i),window.removeEventListener("keydown",a)}},[t]);const r=i=>()=>{var m,h,g,p,f;n(!1);const{internal:a,diagram:s,fileSession:l}=y.getState(),c=((m=l==null?void 0:l.name)==null?void 0:m.replace(/\.json$/i,""))??((h=s.meta)==null?void 0:h.title)??"diagram",u={title:(g=s.meta)==null?void 0:g.title,labelMode:(p=s.meta)==null?void 0:p.labelMode,labelFontSize:(f=s.meta)==null?void 0:f.labelFontSize,annotations:s.annotations};i==="svg"?Lk(a,`${c}.svg`,u):i==="png"?Bk(a,`${c}.png`,{...u,scale:2}).catch(b=>{console.error(b),alert(e("topbar.export.pngFailed",{err:b.message}))}):Ok(a,`${c}.dxf`,u).catch(b=>{console.error(b),alert(e("topbar.export.dxfFailed",{err:b.message}))})};return d.jsxs("div",{ref:o,className:"relative",children:[d.jsxs(Te,{variant:"ghost",size:"sm",className:"gap-1.5","aria-haspopup":"menu","aria-expanded":t,onClick:()=>n(i=>!i),children:[d.jsx(s2,{}),e("topbar.export.label")]}),t&&d.jsxs("div",{role:"menu",className:"ole-glass absolute left-0 top-full mt-1.5 min-w-40 rounded-md border border-border p-1 shadow-md",children:[d.jsxs("button",{type:"button",role:"menuitem",onClick:r("svg"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[d.jsx(u2,{}),d.jsx("span",{className:"flex-1",children:"SVG"})]}),d.jsxs("button",{type:"button",role:"menuitem",onClick:r("png"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[d.jsx(c2,{}),d.jsx("span",{className:"flex-1",children:"PNG (2×)"})]}),d.jsxs("button",{type:"button",role:"menuitem",onClick:r("dxf"),className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground [&>svg]:size-4",children:[d.jsx(l2,{}),d.jsx("span",{className:"flex-1",children:"DXF"})]})]})]})}exports.ExportMenu=E4;exports.FileMenu=n4;exports.LIBRARY=go;exports.OneLineEditor=J6;exports.annotationKind=Oe;exports.applyTheme=Ik;exports.buildExportDxf=Rk;exports.buildExportSvg=Go;exports.compile=tt;exports.downloadDxf=Ok;exports.downloadPng=Bk;exports.downloadSvg=Lk;exports.emptyInternalModel=ia;exports.fitToContent=Bo;exports.fitToContentSoon=Ho;exports.getInitialTheme=Q6;exports.getLibraryEntry=Gv;exports.isTextAnnotation=zj;exports.newAnnotationId=Dt;exports.newBusId=bo;exports.newElementId=Gt;exports.newJunctionId=yo;exports.orientationVec=fo;exports.resolvePlacement=aa;exports.soleSelectedAnnotation=vt;exports.transformOrientation=Lt;exports.transformPoint=De;exports.useEditorStore=y;exports.useLocale=Zt;exports.wireIdFromEnds=lt;
226
226
  //# sourceMappingURL=sldeditor.cjs.map