var w3=Object.create;var{getPrototypeOf:A3,defineProperty:Ac,getOwnPropertyNames:F3}=Object;var Hu=Object.prototype.hasOwnProperty;function B3(t){return this[t]}var S3,k3,we=(t,e,r)=>{var i=t!=null&&typeof t==="object";if(i){var n=e?S3??=new WeakMap:k3??=new WeakMap,o=n.get(t);if(o)return o}r=t!=null?w3(A3(t)):{};let a=e||!t||!t.__esModule||!Hu.call(t,"default")?Ac(r,"default",{value:t,enumerable:!0}):r;if(t&&typeof t==="object"||typeof t==="function"){for(let s of F3(t))if(!Hu.call(a,s))Ac(a,s,{get:B3.bind(t,s),enumerable:!0})}if(i)n.set(t,a);return a};var Rn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Y3=(t)=>t;function M3(t,e){this[t]=Y3.bind(null,e)}var I3=(t,e)=>{for(var r in e)Ac(t,r,{get:e[r],enumerable:!0,configurable:!0,set:M3.bind(e,r)})};var Se=Rn(function(Ml,Il){(function(t,e){typeof Ml==="object"&&typeof Il<"u"?Il.exports=e():typeof define==="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.svgson=e())})(Ml,function(){/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/var t=function(et){return et!=null&&(e(et)||r(et)||!!et._isBuffer)};function e(et){return!!et.constructor&&typeof et.constructor.isBuffer==="function"&&et.constructor.isBuffer(et)}function r(et){return typeof et.readFloatLE==="function"&&typeof et.slice==="function"&&e(et.slice(0,0))}var i=Object.prototype.toString,n=function(Q){if(typeof Q>"u")return"undefined";if(Q===null)return"null";if(Q===!0||Q===!1||Q instanceof Boolean)return"boolean";if(typeof Q==="string"||Q instanceof String)return"string";if(typeof Q==="number"||Q instanceof Number)return"number";if(typeof Q==="function"||Q instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(Q))return"array";if(Q instanceof RegExp)return"regexp";if(Q instanceof Date)return"date";var V=i.call(Q);if(V==="[object RegExp]")return"regexp";if(V==="[object Date]")return"date";if(V==="[object Arguments]")return"arguments";if(V==="[object Error]")return"error";if(t(Q))return"buffer";if(V==="[object Set]")return"set";if(V==="[object WeakSet]")return"weakset";if(V==="[object Map]")return"map";if(V==="[object WeakMap]")return"weakmap";if(V==="[object Symbol]")return"symbol";if(V==="[object Int8Array]")return"int8array";if(V==="[object Uint8Array]")return"uint8array";if(V==="[object Uint8ClampedArray]")return"uint8clampedarray";if(V==="[object Int16Array]")return"int16array";if(V==="[object Uint16Array]")return"uint16array";if(V==="[object Int32Array]")return"int32array";if(V==="[object Uint32Array]")return"uint32array";if(V==="[object Float32Array]")return"float32array";if(V==="[object Float64Array]")return"float64array";return"object"};function o(et,Q){return Q={exports:{}},et(Q,Q.exports),Q.exports}var a=o(function(et){(function(){function Q(V,tt){if(typeof tt!=="function")return V;var C={};for(var ot in V)if(Object.prototype.hasOwnProperty.call(V,ot))C[tt(ot,V[ot])||ot]=V[ot];return C}if(et.exports)et.exports=Q;else window.rename=Q})()}),s=function et(Q,V){var tt=n(Q);if(tt!=="object"&&tt!=="array")throw Error("expected an object");var C=[];if(tt==="object")Q=a(Q,V),C={};for(var ot in Q)if(Q.hasOwnProperty(ot)){var it=Q[ot];if(n(it)==="object"||n(it)==="array")C[ot]=et(it,V);else C[ot]=it}return C},l=o(function(et){var Q=Object.prototype.hasOwnProperty,V="~";function tt(){}if(Object.create){if(tt.prototype=Object.create(null),!new tt().__proto__)V=!1}function C(it,lt,mt){this.fn=it,this.context=lt,this.once=mt||!1}function ot(){this._events=new tt,this._eventsCount=0}ot.prototype.eventNames=function(){var lt=[],mt,pt;if(this._eventsCount===0)return lt;for(pt in mt=this._events)if(Q.call(mt,pt))lt.push(V?pt.slice(1):pt);if(Object.getOwnPropertySymbols)return lt.concat(Object.getOwnPropertySymbols(mt));return lt},ot.prototype.listeners=function(lt,mt){var pt=V?V+lt:lt,xt=this._events[pt];if(mt)return!!xt;if(!xt)return[];if(xt.fn)return[xt.fn];for(var dt=0,Lt=xt.length,at=Array(Lt);dt<Lt;dt++)at[dt]=xt[dt].fn;return at},ot.prototype.emit=function(lt,mt,pt,xt,dt,Lt){var at=V?V+lt:lt;if(!this._events[at])return!1;var U=this._events[at],Bt=arguments.length,Pt,yt;if(U.fn){if(U.once)this.removeListener(lt,U.fn,void 0,!0);switch(Bt){case 1:return U.fn.call(U.context),!0;case 2:return U.fn.call(U.context,mt),!0;case 3:return U.fn.call(U.context,mt,pt),!0;case 4:return U.fn.call(U.context,mt,pt,xt),!0;case 5:return U.fn.call(U.context,mt,pt,xt,dt),!0;case 6:return U.fn.call(U.context,mt,pt,xt,dt,Lt),!0}for(yt=1,Pt=Array(Bt-1);yt<Bt;yt++)Pt[yt-1]=arguments[yt];U.fn.apply(U.context,Pt)}else{var Jt=U.length,Dt;for(yt=0;yt<Jt;yt++){if(U[yt].once)this.removeListener(lt,U[yt].fn,void 0,!0);switch(Bt){case 1:U[yt].fn.call(U[yt].context);break;case 2:U[yt].fn.call(U[yt].context,mt);break;case 3:U[yt].fn.call(U[yt].context,mt,pt);break;case 4:U[yt].fn.call(U[yt].context,mt,pt,xt);break;default:if(!Pt)for(Dt=1,Pt=Array(Bt-1);Dt<Bt;Dt++)Pt[Dt-1]=arguments[Dt];U[yt].fn.apply(U[yt].context,Pt)}}}return!0},ot.prototype.on=function(lt,mt,pt){var xt=new C(mt,pt||this),dt=V?V+lt:lt;if(!this._events[dt])this._events[dt]=xt,this._eventsCount++;else if(!this._events[dt].fn)this._events[dt].push(xt);else this._events[dt]=[this._events[dt],xt];return this},ot.prototype.once=function(lt,mt,pt){var xt=new C(mt,pt||this,!0),dt=V?V+lt:lt;if(!this._events[dt])this._events[dt]=xt,this._eventsCount++;else if(!this._events[dt].fn)this._events[dt].push(xt);else this._events[dt]=[this._events[dt],xt];return this},ot.prototype.removeListener=function(lt,mt,pt,xt){var dt=V?V+lt:lt;if(!this._events[dt])return this;if(!mt){if(--this._eventsCount===0)this._events=new tt;else delete this._events[dt];return this}var Lt=this._events[dt];if(Lt.fn){if(Lt.fn===mt&&(!xt||Lt.once)&&(!pt||Lt.context===pt))if(--this._eventsCount===0)this._events=new tt;else delete this._events[dt]}else{for(var at=0,U=[],Bt=Lt.length;at<Bt;at++)if(Lt[at].fn!==mt||xt&&!Lt[at].once||pt&&Lt[at].context!==pt)U.push(Lt[at]);if(U.length)this._events[dt]=U.length===1?U[0]:U;else if(--this._eventsCount===0)this._events=new tt;else delete this._events[dt]}return this},ot.prototype.removeAllListeners=function(lt){var mt;if(lt){if(mt=V?V+lt:lt,this._events[mt])if(--this._eventsCount===0)this._events=new tt;else delete this._events[mt]}else this._events=new tt,this._eventsCount=0;return this},ot.prototype.off=ot.prototype.removeListener,ot.prototype.addListener=ot.prototype.on,ot.prototype.setMaxListeners=function(){return this},ot.prefixed=V,ot.EventEmitter=ot,et.exports=ot});function c(et,Q,V){if(Q in et)Object.defineProperty(et,Q,{value:V,enumerable:!0,configurable:!0,writable:!0});else et[Q]=V;return et}var d=function(){},h={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},y={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},_={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},m={" ":y.space,"\t":y.space,"\n":y.space,"\r":y.space,"<":y.lt,">":y.gt,'"':y.quote,"'":y.quote,"=":y.equal,"/":y.slash},g=function(Q){return m[Q]||y.char},b=function(Q){var V,tt,C,ot,it,lt,mt,pt,xt,dt;Q=Object.assign({debug:!1},Q);var Lt=new l,at=h.data,U="",Bt="",Pt="",yt="",Jt="",Dt="",Ct=function(ce,Nt){if(Bt[0]==="?"||Bt[0]==="!")return;var ke={type:ce,value:Nt};if(Q.debug)console.log("emit:",ke);Lt.emit("data",ke)};Lt.stateMachine=(dt={},c(dt,h.data,(V={},c(V,y.lt,function(){if(U.trim())Ct(_.text,U);Bt="",Jt=!1,at=h.tagBegin}),c(V,y.char,function(kt){U+=kt}),V)),c(dt,h.cdata,c({},y.char,function(kt){if(U+=kt,U.substr(-3)==="]]>")Ct(_.text,U.slice(0,-3)),U="",at=h.data})),c(dt,h.tagBegin,(tt={},c(tt,y.space,d),c(tt,y.char,function(kt){Bt=kt,at=h.tagName}),c(tt,y.slash,function(){Bt="",Jt=!0}),tt)),c(dt,h.tagName,(C={},c(C,y.space,function(){if(Jt)at=h.tagEnd;else at=h.attributeNameStart,Ct(_.openTag,Bt)}),c(C,y.gt,function(){if(Jt)Ct(_.closeTag,Bt);else Ct(_.openTag,Bt);U="",at=h.data}),c(C,y.slash,function(){at=h.tagEnd,Ct(_.openTag,Bt)}),c(C,y.char,function(kt){if(Bt+=kt,Bt==="![CDATA[")at=h.cdata,U="",Bt=""}),C)),c(dt,h.tagEnd,(ot={},c(ot,y.gt,function(){Ct(_.closeTag,Bt),U="",at=h.data}),c(ot,y.char,d),ot)),c(dt,h.attributeNameStart,(it={},c(it,y.char,function(kt){Pt=kt,at=h.attributeName}),c(it,y.gt,function(){U="",at=h.data}),c(it,y.space,d),c(it,y.slash,function(){Jt=!0,at=h.tagEnd}),it)),c(dt,h.attributeName,(lt={},c(lt,y.space,function(){at=h.attributeNameEnd}),c(lt,y.equal,function(){Ct(_.attributeName,Pt),at=h.attributeValueBegin}),c(lt,y.gt,function(){yt="",Ct(_.attributeName,Pt),Ct(_.attributeValue,yt),U="",at=h.data}),c(lt,y.slash,function(){Jt=!0,yt="",Ct(_.attributeName,Pt),Ct(_.attributeValue,yt),at=h.tagEnd}),c(lt,y.char,function(kt){Pt+=kt}),lt)),c(dt,h.attributeNameEnd,(mt={},c(mt,y.space,d),c(mt,y.equal,function(){Ct(_.attributeName,Pt),at=h.attributeValueBegin}),c(mt,y.gt,function(){yt="",Ct(_.attributeName,Pt),Ct(_.attributeValue,yt),U="",at=h.data}),c(mt,y.char,function(kt){yt="",Ct(_.attributeName,Pt),Ct(_.attributeValue,yt),Pt=kt,at=h.attributeName}),mt)),c(dt,h.attributeValueBegin,(pt={},c(pt,y.space,d),c(pt,y.quote,function(kt){Dt=kt,yt="",at=h.attributeValue}),c(pt,y.gt,function(){yt="",Ct(_.attributeValue,yt),U="",at=h.data}),c(pt,y.char,function(kt){Dt="",yt=kt,at=h.attributeValue}),pt)),c(dt,h.attributeValue,(xt={},c(xt,y.space,function(kt){if(Dt)yt+=kt;else Ct(_.attributeValue,yt),at=h.attributeNameStart}),c(xt,y.quote,function(kt){if(Dt===kt)Ct(_.attributeValue,yt),at=h.attributeNameStart;else yt+=kt}),c(xt,y.gt,function(kt){if(Dt)yt+=kt;else Ct(_.attributeValue,yt),U="",at=h.data}),c(xt,y.slash,function(kt){if(Dt)yt+=kt;else Ct(_.attributeValue,yt),Jt=!0,at=h.tagEnd}),c(xt,y.char,function(kt){yt+=kt}),xt)),dt);var ir=function(ce){if(Q.debug)console.log(at,ce);var Nt=Lt.stateMachine[at],ke=Nt[g(ce)]||Nt[y.error]||Nt[y.char];ke(ce)};return Lt.write=function(kt){var ce=kt.length;for(var Nt=0;Nt<ce;Nt++)ir(kt[Nt])},Lt},v={State:h,Action:y,Type:_,create:b},k=v.Type,x={element:"element",text:"text"},A=function(Q){return Object.assign({name:"",type:x.element,value:"",parent:null,attributes:{},children:[]},Q)},S=function(Q){Q=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},Q);var V=void 0,tt=void 0,C=void 0,ot=void 0,it=new l,lt=function(pt){switch(pt.type){case k.openTag:if(C===null)C=tt,C.name=pt.value;else{var xt=A({name:pt.value,parent:C});C.children.push(xt),C=xt}break;case k.closeTag:var dt=C.parent;if(!Q.parentNodes)C.parent=null;if(C.name!==pt.value)break;if(Q.stream&&dt===tt)tt.children=[],C.parent=null;if(!Q.emitTopLevelOnly||dt===tt)it.emit(Q.tagPrefix+C.name,C),it.emit("tag",C.name,C);if(C===tt)V.removeAllListeners("data"),it.emit(Q.doneEvent,C),tt=null;C=dt;break;case k.text:if(C)C.children.push(A({type:x.text,value:pt.value,parent:Q.parentNodes?C:null}));break;case k.attributeName:ot=pt.value,C.attributes[ot]="";break;case k.attributeValue:C.attributes[ot]=pt.value;break}};return it.reset=function(){V=v.create({debug:Q.debug}),V.on("data",lt),tt=A(),C=null,ot="",it.parse=V.write},it.reset(),it},E=function(Q,V){V=Object.assign({},V,{stream:!1,tagPrefix:":"});var tt=S(V),C=void 0;return tt.on("done",function(ot){C=ot}),tt.parse(Q),C},I={parseSync:E,create:S,NodeType:x},T=I.parseSync,P=function(Q){var V=T("<root>".concat(Q,"</root>"),{parentNodes:!1}),tt=V.children&&V.children.length>0&&V.children.every(function(C){return C.name==="svg"});if(tt)return V.children.length===1?V.children[0]:V.children;else throw Error("nothing to parse")},O=function(Q){return s(Q,function(V){if(!N(V))return D(V);return V})},D=function(Q){return Q.replace(/[-|:]([a-z])/gi,function(V,tt){return tt.toUpperCase()})},N=function(Q){return/^(data|aria)(-\w+)/.test(Q)},G=function(Q){if(Q){var V=String(Q);return/[&<>]/.test(V)?"<![CDATA[".concat(V.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):V}return""},K=function(Q){return String(Q).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")},vt=function(Q){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tt=V.transformNode,C=tt===void 0?function(mt){return mt}:tt,ot=V.camelcase,it=ot===void 0?!1:ot,lt=function(pt){var xt=C(pt);if(it)xt=O(xt);return xt};return lt(P(Q))};function H(){for(var et=arguments.length,Q=Array(et),V=0;V<et;V++)Q[V]=arguments[V];return new Promise(function(tt,C){try{var ot=vt.apply(void 0,Q);tt(ot)}catch(it){C(it)}})}var ht=function et(Q){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},tt=V.transformAttr,C=tt===void 0?function(at,U,Bt){return"".concat(at,'="').concat(Bt(U),'"')}:tt,ot=V.transformNode,it=ot===void 0?function(at){return at}:ot,lt=V.selfClose,mt=lt===void 0?!0:lt;if(Array.isArray(Q))return Q.map(function(at){return et(at,{transformAttr:C,selfClose:mt,transformNode:it})}).join("");var pt=it(Q);if(pt.type==="text")return G(pt.value);var xt="";for(var dt in pt.attributes){var Lt=C(dt,pt.attributes[dt],K,pt.name);xt+=Lt?" ".concat(Lt):""}return pt.children&&pt.children.length>0||!mt?"<".concat(pt.name).concat(xt,">").concat(et(pt.children,{transformAttr:C,transformNode:it,selfClose:mt}),"</").concat(pt.name,">"):"<".concat(pt.name).concat(xt,"/>")},wt=Object.assign({},{parse:H,parseSync:vt,stringify:ht});return wt})});var r1=Rn(function(vz,e1){var ei=1000,ri=ei*60,ii=ri*60,Ar=ii*24,cv=Ar*7,lv=Ar*365.25;e1.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return pv(t);else if(r==="number"&&isFinite(t))return e.long?hv(t):dv(t);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function pv(t){if(t=String(t),t.length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*lv;case"weeks":case"week":case"w":return r*cv;case"days":case"day":case"d":return r*Ar;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ii;case"minutes":case"minute":case"mins":case"min":case"m":return r*ri;case"seconds":case"second":case"secs":case"sec":case"s":return r*ei;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function dv(t){var e=Math.abs(t);if(e>=Ar)return Math.round(t/Ar)+"d";if(e>=ii)return Math.round(t/ii)+"h";if(e>=ri)return Math.round(t/ri)+"m";if(e>=ei)return Math.round(t/ei)+"s";return t+"ms"}function hv(t){var e=Math.abs(t);if(e>=Ar)return lo(t,e,Ar,"day");if(e>=ii)return lo(t,e,ii,"hour");if(e>=ri)return lo(t,e,ri,"minute");if(e>=ei)return lo(t,e,ei,"second");return t+" ms"}function lo(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var n1=Rn(function(wz,i1){function uv(t){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=n,r.enabled=s,r.humanize=r1(),r.destroy=c,Object.keys(t).forEach((d)=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let h=0;for(let y=0;y<d.length;y++)h=(h<<5)-h+d.charCodeAt(y),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(d){let h,y=null,_,m;function g(...b){if(!g.enabled)return;let v=g,k=Number(new Date),x=k-(h||k);if(v.diff=x,v.prev=h,v.curr=k,h=k,b[0]=r.coerce(b[0]),typeof b[0]!=="string")b.unshift("%O");let A=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(E,I)=>{if(E==="%%")return"%";A++;let T=r.formatters[I];if(typeof T==="function"){let P=b[A];E=T.call(v,P),b.splice(A,1),A--}return E}),r.formatArgs.call(v,b),(v.log||r.log).apply(v,b)}if(g.namespace=d,g.useColors=r.useColors(),g.color=r.selectColor(d),g.extend=i,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(y!==null)return y;if(_!==r.namespaces)_=r.namespaces,m=r.enabled(d);return m},set:(b)=>{y=b}}),typeof r.init==="function")r.init(g);return g}function i(d,h){let y=r(this.namespace+(typeof h>"u"?":":h)+d);return y.log=this.log,y}function n(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let h=(typeof d==="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of h)if(y[0]==="-")r.skips.push(y.slice(1));else r.names.push(y)}function o(d,h){let y=0,_=0,m=-1,g=0;while(y<d.length)if(_<h.length&&(h[_]===d[y]||h[_]==="*"))if(h[_]==="*")m=_,g=y,_++;else y++,_++;else if(m!==-1)_=m+1,g++,y=g;else return!1;while(_<h.length&&h[_]==="*")_++;return _===h.length}function a(){let d=[...r.names,...r.skips.map((h)=>"-"+h)].join(",");return r.enable(""),d}function s(d){for(let h of r.skips)if(o(d,h))return!1;for(let h of r.names)if(o(d,h))return!0;return!1}function l(d){if(d instanceof Error)return d.stack||d.message;return d}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}i1.exports=uv});var o1=Rn(function(Ll,po){Ll.formatArgs=_v;Ll.save=mv;Ll.load=fv;Ll.useColors=yv;Ll.storage=xv();Ll.destroy=(()=>{let t=!1;return()=>{if(!t)t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();Ll.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function yv(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function _v(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+po.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(n)=>{if(n==="%%")return;if(r++,n==="%c")i=r}),t.splice(i,0,e)}Ll.log=console.debug||console.log||(()=>{});function mv(t){try{if(t)Ll.storage.setItem("debug",t);else Ll.storage.removeItem("debug")}catch(e){}}function fv(){let t;try{t=Ll.storage.getItem("debug")||Ll.storage.getItem("DEBUG")}catch(e){}if(!t&&typeof process<"u"&&"env"in process)t=process.env.DEBUG;return t}function xv(){try{return localStorage}catch(t){}}po.exports=n1()(Ll);var{formatters:gv}=po.exports;gv.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var qr={};I3(qr,{all_layers:()=>c_,any_circuit_element:()=>D9,any_soup_element:()=>Gr,any_source_component:()=>Jy,asset:()=>on,base_circuit_json_error:()=>It,battery_capacity:()=>Ay,brep_shape:()=>xl,cadModelDefaultDirectionMap:()=>N4,cad_cable:()=>u9,cad_collision_error:()=>h9,cad_component:()=>d9,cad_model_axis_directions:()=>p9,cad_model_formats:()=>$4,cad_reference_surface:()=>_9,capacitance:()=>Xc,circle_shape:()=>$c,circuit_json_footprint_load_error:()=>Wf,current:()=>sr,distance:()=>L,duration_ms:()=>Zr,experiment_type:()=>w9,external_footprint_load_error:()=>Tf,frequency:()=>gr,getRotationBetweenPcbPin1Locations:()=>y4,getSimulationReturnCurrentGridJsonSchema:()=>no,getZodPrefixedIdWithDefault:()=>j,inductance:()=>vy,insertionDirectionToCanonical:()=>rm,insertionDirectionToVector:()=>h4,insertion_direction:()=>im,kicadAt:()=>qn,kicadEffects:()=>Fy,kicadFont:()=>Vc,kicadFootprintAttributes:()=>Sy,kicadFootprintMetadata:()=>My,kicadFootprintModel:()=>Yy,kicadFootprintPad:()=>ky,kicadFootprintProperties:()=>By,kicadProperty:()=>rn,kicadSymbolEffects:()=>Ey,kicadSymbolMetadata:()=>Ty,kicadSymbolPinNames:()=>Ly,kicadSymbolPinNumbers:()=>Iy,kicadSymbolProperties:()=>Py,kicadSymbolProperty:()=>ar,layer_ref:()=>gt,layer_string:()=>Tc,length:()=>q,manufacturing_drc_properties:()=>am,ms:()=>te,ninePointAnchor:()=>Qe,parseAndConvertSiUnit:()=>ue,pcbRenderLayer:()=>l4,pcb_autorouting_error:()=>jf,pcb_bend:()=>Qm,pcb_board:()=>Dm,pcb_breakout_point:()=>zf,pcb_bus_length_skew_error:()=>Tm,pcb_bus_routing_constraint_error:()=>jm,pcb_bus_routing_constraint_warning:()=>Rm,pcb_component:()=>sm,pcb_component_invalid_layer_error:()=>t9,pcb_component_missing_courtyard_warning:()=>$f,pcb_component_not_on_board_edge_error:()=>Jf,pcb_component_outside_board_error:()=>Kf,pcb_connector_not_in_accessible_orientation_warning:()=>Xf,pcb_copper_pour:()=>qf,pcb_copper_pour_brep:()=>Hf,pcb_copper_pour_polygon:()=>Gf,pcb_copper_pour_rect:()=>Zf,pcb_copper_text:()=>sf,pcb_courtyard_circle:()=>c9,pcb_courtyard_outline:()=>a9,pcb_courtyard_overlap_error:()=>Ff,pcb_courtyard_pill:()=>l9,pcb_courtyard_polygon:()=>s9,pcb_courtyard_rect:()=>o9,pcb_cutout:()=>Ef,pcb_cutout_circle:()=>Mf,pcb_cutout_path:()=>Lf,pcb_cutout_polygon:()=>If,pcb_cutout_rect:()=>Yf,pcb_debug_line:()=>lm,pcb_debug_object:()=>dm,pcb_debug_object_base:()=>to,pcb_debug_point:()=>pm,pcb_debug_rect:()=>cm,pcb_fabrication_note_dimension:()=>ff,pcb_fabrication_note_path:()=>_f,pcb_fabrication_note_rect:()=>mf,pcb_fabrication_note_text:()=>yf,pcb_fabricator_extra_charge_warning:()=>Vf,pcb_footprint_overlap_error:()=>Af,pcb_ground_plane:()=>Df,pcb_ground_plane_region:()=>Qf,pcb_group:()=>Of,pcb_hole:()=>xm,pcb_hole_circle_or_square_shape:()=>x4,pcb_hole_circle_shape:()=>m4,pcb_hole_oval_shape:()=>g4,pcb_hole_pill_shape:()=>b4,pcb_hole_rect_shape:()=>f4,pcb_hole_rotated_pill_shape:()=>v4,pcb_keepout:()=>Sf,pcb_keepout_outline:()=>Bf,pcb_keepout_overlap_warning:()=>kf,pcb_manual_edit_conflict_warning:()=>Cf,pcb_missing_footprint_error:()=>Pf,pcb_net:()=>Vm,pcb_note_dimension:()=>wf,pcb_note_line:()=>vf,pcb_note_path:()=>bf,pcb_note_rect:()=>gf,pcb_note_text:()=>xf,pcb_packing_error:()=>tf,pcb_pad_pad_clearance_error:()=>i9,pcb_pad_trace_clearance_error:()=>n9,pcb_panel:()=>Km,pcb_panelization_placement_error:()=>ef,pcb_pin1_location:()=>Oc,pcb_placement_error:()=>Jm,pcb_plated_hole:()=>gm,pcb_port:()=>bm,pcb_port_not_connected_error:()=>Nm,pcb_port_not_matched_error:()=>$m,pcb_preflight_routing_error:()=>Rf,pcb_route_hint:()=>nm,pcb_route_hints:()=>_4,pcb_silkscreen_circle:()=>lf,pcb_silkscreen_graphic:()=>hf,pcb_silkscreen_graphic_brep:()=>df,pcb_silkscreen_line:()=>nf,pcb_silkscreen_oval:()=>pf,pcb_silkscreen_path:()=>of,pcb_silkscreen_pill:()=>uf,pcb_silkscreen_rect:()=>cf,pcb_silkscreen_text:()=>af,pcb_smtpad:()=>wm,pcb_smtpad_pill:()=>vm,pcb_solder_paste:()=>Am,pcb_soldermask_opening:()=>Fm,pcb_stiffener:()=>qm,pcb_stiffener_polygon:()=>Gm,pcb_stiffener_rect:()=>Hm,pcb_text:()=>Bm,pcb_thermal_spoke:()=>Uf,pcb_trace:()=>Im,pcb_trace_error:()=>Cm,pcb_trace_hint:()=>rf,pcb_trace_missing_error:()=>Xm,pcb_trace_route_point:()=>Mm,pcb_trace_route_point_through_pad:()=>Ym,pcb_trace_route_point_via:()=>km,pcb_trace_route_point_wire:()=>Sm,pcb_trace_style_warning:()=>Em,pcb_trace_too_long_error:()=>Pm,pcb_trace_too_long_warning:()=>Wm,pcb_trace_too_many_vias_warning:()=>Om,pcb_trace_warning:()=>Lm,pcb_via:()=>zm,pcb_via_clearance_error:()=>e9,pcb_via_trace_clearance_error:()=>r9,point:()=>J,point3:()=>Ae,point_with_bulge:()=>em,polygon_shape:()=>nn,port_arrangement:()=>B_,position:()=>o4,position3:()=>a4,rect_shape:()=>Gn,resistance:()=>Zn,ring:()=>Wc,rotated_rect_shape:()=>Nc,rotation:()=>jt,route_hint_point:()=>om,schematic_arc:()=>L_,schematic_box:()=>b_,schematic_circle:()=>I_,schematic_component:()=>S_,schematic_component_overlap_warning:()=>z_,schematic_component_port_arrangement_by_sides:()=>F_,schematic_component_port_arrangement_by_size:()=>A_,schematic_component_styling_warning:()=>D_,schematic_debug_line:()=>C_,schematic_debug_object:()=>$_,schematic_debug_object_base:()=>Jn,schematic_debug_point:()=>X_,schematic_debug_rect:()=>R_,schematic_element_outside_sheet_warning:()=>U_,schematic_error:()=>O_,schematic_graphic:()=>Z_,schematic_group:()=>H_,schematic_layout_error:()=>j_,schematic_line:()=>Y_,schematic_manual_edit_conflict_warning:()=>V_,schematic_missing_sheet_warning:()=>tm,schematic_net_label:()=>W_,schematic_path:()=>v_,schematic_pin_styles:()=>w_,schematic_port:()=>T_,schematic_rect:()=>M_,schematic_sheet:()=>J_,schematic_sheet_size:()=>K_,schematic_sheet_styling_warning:()=>Q_,schematic_symbol:()=>k_,schematic_table:()=>G_,schematic_table_cell:()=>q_,schematic_text:()=>P_,schematic_text_part:()=>fl,schematic_trace:()=>E_,schematic_voltage_probe:()=>N_,simulation_ac_current_source:()=>b9,simulation_ac_sweep_current_graph:()=>j9,simulation_ac_sweep_voltage_graph:()=>O9,simulation_ac_voltage_source:()=>f9,simulation_complex_sample:()=>wl,simulation_current_probe:()=>M9,simulation_current_source:()=>v9,simulation_dc_current_source:()=>g9,simulation_dc_operating_point_current:()=>P9,simulation_dc_operating_point_voltage:()=>E9,simulation_dc_sweep_current_graph:()=>W9,simulation_dc_sweep_unit:()=>ro,simulation_dc_sweep_voltage_graph:()=>T9,simulation_dc_voltage_source:()=>m9,simulation_experiment:()=>F9,simulation_op_amp:()=>R9,simulation_oscilloscope_trace:()=>X9,simulation_parameter_sweep:()=>L9,simulation_parameter_sweep_coordinate:()=>Ue,simulation_parameter_type:()=>D4,simulation_parameter_unit:()=>vl,simulation_pcb_return_current_field:()=>an,simulation_pcb_return_current_heatmap:()=>oo,simulation_pcb_return_current_marker:()=>ao,simulation_pcb_return_current_result:()=>io,simulation_return_current_contact:()=>Rc,simulation_return_current_excitation:()=>$9,simulation_return_current_field_asset:()=>V9,simulation_return_current_grid_json:()=>z9,simulation_return_current_image_asset:()=>Al,simulation_spice_subcircuit:()=>C9,simulation_switch:()=>k9,simulation_terminal_port:()=>Cc,simulation_transient_current_graph:()=>S9,simulation_transient_voltage_graph:()=>B9,simulation_unknown_experiment_error:()=>I9,simulation_voltage_probe:()=>Y9,simulation_voltage_source:()=>x9,size:()=>Hn,source_ambiguous_port_reference:()=>a_,source_board:()=>o_,source_bus:()=>x_,source_component_availability_warning:()=>ul,source_component_base:()=>Ot,source_component_internal_connection:()=>e_,source_component_misconfigured_error:()=>_l,source_component_pins_underspecified_warning:()=>u_,source_confusing_net_name_warning:()=>f_,source_datasheet:()=>ml,source_failed_to_create_component_error:()=>Zy,source_group:()=>i_,source_i2c_misconfigured_error:()=>yl,source_interconnect:()=>qy,source_invalid_component_property_error:()=>cl,source_manually_placed_via:()=>l_,source_missing_manufacturer_part_number_warning:()=>dl,source_missing_property_error:()=>Uy,source_motor:()=>Cy,source_net:()=>n_,source_no_ground_pin_defined_warning:()=>h_,source_no_power_pin_defined_warning:()=>d_,source_part_not_found_warning:()=>m_,source_pcb_ground_plane:()=>s_,source_pin_attributes:()=>Vy,source_pin_missing_trace_warning:()=>pl,source_pin_must_be_connected_error:()=>y_,source_port:()=>t_,source_printed_part:()=>jy,source_project_metadata:()=>sl,source_property_ignored_warning:()=>Hy,source_refdes_convention_warning:()=>hl,source_runtime_error:()=>g_,source_simple_ammeter:()=>Ny,source_simple_battery:()=>Hc,source_simple_capacitor:()=>zc,source_simple_chip:()=>Uc,source_simple_connector:()=>Qy,source_simple_connector_standards:()=>Dy,source_simple_crystal:()=>zy,source_simple_current_source:()=>Xy,source_simple_diode:()=>Kn,source_simple_fiducial:()=>Wy,source_simple_fuse:()=>$y,source_simple_ground:()=>Oy,source_simple_inductor:()=>Gc,source_simple_led:()=>Qc,source_simple_mosfet:()=>nl,source_simple_op_amp:()=>ol,source_simple_pin_header:()=>Jc,source_simple_pinout:()=>tl,source_simple_potentiometer:()=>Kc,source_simple_power_source:()=>Zc,source_simple_push_button:()=>qc,source_simple_resistor:()=>Dc,source_simple_resonator:()=>el,source_simple_switch:()=>al,source_simple_test_point:()=>il,source_simple_transistor:()=>rl,source_simple_voltage_probe:()=>Gy,source_simple_voltage_source:()=>Ky,source_subassembly:()=>Ry,source_trace:()=>r_,source_trace_not_connected_error:()=>ll,source_unnamed_trace_warning:()=>p_,spice_simulation_options:()=>A9,standard_shape:()=>s4,supplier_footprint_mismatch_warning:()=>Nf,supplier_name:()=>Hr,time:()=>n4,timestamp:()=>wy,unknown_error_finding_part:()=>__,visible_layer:()=>Ht,voltage:()=>Fe,wave_shape:()=>bl});var qu=new Map([["T",1000000000000],["G",1e9],["M",1e6],["K",1000],["k",1000],["",1],["m",0.001],["µ",0.000001],["μ",0.000001],["u",0.000001],["n",0.000000001],["p",0.000000000001],["f",0.000000000000001]]),L3=[...qu.keys()];function Ku(t){return qu.get(t)}var Ju={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:0.001,mohm:0.001,mOhm:0.001,milliohm:0.001,Ω:1,ohm:1,Ohm:1,kΩ:1000,KΩ:1000,kohm:1000,kOhm:1000,KOhm:1000,Kohm:1000,MΩ:1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,GΩ:1e9,Gohm:1e9,GOhm:1e9,TΩ:1000000000000,Tohm:1000000000000,TOhm:1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{µA:0.000001,μA:0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,µF:0.000001,μF:0.000001,uF:0.000001,mF:0.001,F:1,kF:1000,KF:1000,MF:1e6}},H:{baseUnit:"H",variants:{pH:0.000000000001,nH:0.000000001,µH:0.000001,μH:0.000001,uH:0.000001,mH:0.001,H:1,kH:1000,KH:1000,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,µs:0.001,μs:0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,µm:0.001,μm:0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},Fc=new Set;for(let[t,e]of Object.entries(Ju)){Fc.add(t);for(let r of Object.keys(e.variants))Fc.add(r)}function E3(t){for(let e of Object.values(Ju)){if(t in e.variants)return{baseUnit:e.baseUnit,conversionFactor:e.variants[t]};for(let[r,i]of Object.entries(e.variants)){if(!t.endsWith(r))continue;let n=t.slice(0,-r.length),o=Ku(n);if(o==null)continue;return{baseUnit:e.baseUnit,conversionFactor:o*i}}}return{baseUnit:t,conversionFactor:1}}function ue(t,e){if(t===void 0||t===null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof t==="string"&&t.match(/^-?[\d.]+$/))return{value:Number.parseFloat(t),parsedUnit:null,unitOfValue:null};if(typeof t==="number")return{value:t,parsedUnit:null,unitOfValue:null};if(typeof t==="object"&&"x"in t&&"y"in t){let c=ue(t.x,e),d=ue(t.x,e),h=ue(t.y,e);if(d.value===null||h.value===null)return{parsedUnit:null,unitOfValue:null,value:null};return{parsedUnit:c.parsedUnit,unitOfValue:c.unitOfValue,value:{x:d.value,y:h.value}}}let i=t.toString().split("").reverse().join("").match(/[^\d\s]+/)?.[0];if(!i)throw Error(`Could not determine unit: "${t}"`);let n=i.split("").reverse().join(""),o=t.slice(0,-n.length),a=Ku(n);if(e&&a!=null)return{parsedUnit:null,unitOfValue:e,value:Number.parseFloat(o)*a};if(a!=null&&!Fc.has(n))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(o)*a};let{baseUnit:s,conversionFactor:l}=E3(n);return{parsedUnit:n,unitOfValue:s,value:l*Number.parseFloat(o)}}var P3=L3.filter((t)=>t!=="").sort((t,e)=>e.length-t.length).map((t)=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),Mj=new RegExp(`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${P3}))?$`);var Gu=[{value:1000000000000,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1000,symbol:"k"},{value:1,symbol:""},{value:0.001,symbol:"m"},{value:0.000001,symbol:"µ"},{value:0.000000001,symbol:"n"},{value:0.000000000001,symbol:"p"}],Ij=Gu[Gu.length-1];var Et;(function(t){t.assertEqual=(n)=>{};function e(n){}t.assertIs=e;function r(n){throw Error()}t.assertNever=r,t.arrayToEnum=(n)=>{let o={};for(let a of n)o[a]=a;return o},t.getValidEnumValues=(n)=>{let o=t.objectKeys(n).filter((s)=>typeof n[n[s]]!=="number"),a={};for(let s of o)a[s]=n[s];return t.objectValues(a)},t.objectValues=(n)=>t.objectKeys(n).map(function(o){return n[o]}),t.objectKeys=typeof Object.keys==="function"?(n)=>Object.keys(n):(n)=>{let o=[];for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a))o.push(a);return o},t.find=(n,o)=>{for(let a of n)if(o(a))return a;return},t.isInteger=typeof Number.isInteger==="function"?(n)=>Number.isInteger(n):(n)=>typeof n==="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map((a)=>typeof a==="string"?`'${a}'`:a).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(n,o)=>{if(typeof o==="bigint")return o.toString();return o}})(Et||(Et={}));var ty;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ty||(ty={}));var nt=Et.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$e=(t)=>{switch(typeof t){case"undefined":return nt.undefined;case"string":return nt.string;case"number":return Number.isNaN(t)?nt.nan:nt.number;case"boolean":return nt.boolean;case"function":return nt.function;case"bigint":return nt.bigint;case"symbol":return nt.symbol;case"object":if(Array.isArray(t))return nt.array;if(t===null)return nt.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return nt.promise;if(typeof Map<"u"&&t instanceof Map)return nt.map;if(typeof Set<"u"&&t instanceof Set)return nt.set;if(typeof Date<"u"&&t instanceof Date)return nt.date;return nt.object;default:return nt.unknown}};var z=Et.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class fe extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let e=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,e);else this.__proto__=e;this.name="ZodError",this.issues=t}format(t){let e=t||function(n){return n.message},r={_errors:[]},i=(n)=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(e(o));else{let a=r,s=0;while(s<o.path.length){let l=o.path[s];if(s!==o.path.length-1)a[l]=a[l]||{_errors:[]};else a[l]=a[l]||{_errors:[]},a[l]._errors.push(e(o));a=a[l],s++}}};return i(this),r}static assert(t){if(!(t instanceof fe))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Et.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(e)=>e.message){let e={},r=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];e[n]=e[n]||[],e[n].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:e}}get formErrors(){return this.flatten()}}fe.create=(t)=>new fe(t);var T3=(t,e)=>{let r;switch(t.code){case z.invalid_type:if(t.received===nt.undefined)r="Required";else r=`Expected ${t.expected}, received ${t.received}`;break;case z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Et.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:r=`Unrecognized key(s) in object: ${Et.joinValues(t.keys,", ")}`;break;case z.invalid_union:r="Invalid input";break;case z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Et.joinValues(t.options)}`;break;case z.invalid_enum_value:r=`Invalid enum value. Expected ${Et.joinValues(t.options)}, received '${t.received}'`;break;case z.invalid_arguments:r="Invalid function arguments";break;case z.invalid_return_type:r="Invalid function return type";break;case z.invalid_date:r="Invalid date";break;case z.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)r=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)r=`Invalid input: must end with "${t.validation.endsWith}"`;else Et.assertNever(t.validation);else if(t.validation!=="regex")r=`Invalid ${t.validation}`;else r="Invalid";break;case z.too_small:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else r="Invalid input";break;case z.too_big:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else r="Invalid input";break;case z.custom:r="Invalid input";break;case z.invalid_intersection_types:r="Intersection results could not be merged";break;case z.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case z.not_finite:r="Number must be finite";break;default:r=e.defaultError,Et.assertNever(t)}return{message:r}},nr=T3;var W3=nr;function Ci(){return W3}var Cn=(t)=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,o=[...r,...n.path||[]],a={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let s="",l=i.filter((c)=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...n,path:o,message:s}};function rt(t,e){let r=Ci(),i=Cn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===nr?void 0:nr].filter((n)=>!!n)});t.common.issues.push(i)}class le{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,e){let r=[];for(let i of e){if(i.status==="aborted")return bt;if(i.status==="dirty")t.dirty();r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,e){let r=[];for(let i of e){let n=await i.key,o=await i.value;r.push({key:n,value:o})}return le.mergeObjectSync(t,r)}static mergeObjectSync(t,e){let r={};for(let i of e){let{key:n,value:o}=i;if(n.status==="aborted")return bt;if(o.status==="aborted")return bt;if(n.status==="dirty")t.dirty();if(o.status==="dirty")t.dirty();if(n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet))r[n.value]=o.value}return{status:t.value,value:r}}}var bt=Object.freeze({status:"aborted"}),Rr=(t)=>({status:"dirty",value:t}),pe=(t)=>({status:"valid",value:t}),Bc=(t)=>t.status==="aborted",Sc=(t)=>t.status==="dirty",_r=(t)=>t.status==="valid",Xi=(t)=>typeof Promise<"u"&&t instanceof Promise;var ut;(function(t){t.errToObj=(e)=>typeof e==="string"?{message:e}:e||{},t.toString=(e)=>typeof e==="string"?e:e?.message})(ut||(ut={}));class Ye{constructor(t,e,r,i){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=i}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var ey=(t,e)=>{if(_r(e))return{success:!0,data:e.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new fe(t.common.issues);return this._error=r,this._error}}}};function St(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(e)return{errorMap:e,description:n};return{errorMap:(a,s)=>{let{message:l}=t;if(a.code==="invalid_enum_value")return{message:l??s.defaultError};if(typeof s.data>"u")return{message:l??i??s.defaultError};if(a.code!=="invalid_type")return{message:s.defaultError};return{message:l??r??s.defaultError}},description:n}}class Mt{get description(){return this._def.description}_getType(t){return $e(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:$e(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new le,ctx:{common:t.parent.common,data:t.data,parsedType:$e(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Xi(e))throw Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){let r={common:{issues:[],async:e?.async??!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$e(t)},i=this._parseSync({data:t,path:r.path,parent:r});return ey(r,i)}"~validate"(t){let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$e(t)};if(!this["~standard"].async)try{let r=this._parseSync({data:t,path:[],parent:e});return _r(r)?{value:r.value}:{issues:e.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then((r)=>_r(r)?{value:r.value}:{issues:e.common.issues})}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$e(t)},i=this._parse({data:t,path:r.path,parent:r}),n=await(Xi(i)?i:Promise.resolve(i));return ey(r,n)}refine(t,e){let r=(i)=>{if(typeof e==="string"||typeof e>"u")return{message:e};else if(typeof e==="function")return e(i);else return e};return this._refinement((i,n)=>{let o=t(i),a=()=>n.addIssue({code:z.custom,...r(i)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((s)=>{if(!s)return a(),!1;else return!0});if(!o)return a(),!1;else return!0})}refinement(t,e){return this._refinement((r,i)=>{if(!t(r))return i.addIssue(typeof e==="function"?e(r,i):e),!1;else return!0})}_refinement(t){return new Pe({schema:this,typeName:At.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(e)=>this["~validate"](e)}}optional(){return Ee.create(this,this._def)}nullable(){return or.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Le.create(this)}promise(){return zr.create(this,this._def)}or(t){return Di.create([this,t],this._def)}and(t){return Qi.create(this,t,this._def)}transform(t){return new Pe({...St(this._def),schema:this,typeName:At.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t==="function"?t:()=>t;return new Gi({...St(this._def),innerType:this,defaultValue:e,typeName:At.ZodDefault})}brand(){return new Ic({typeName:At.ZodBranded,type:this,...St(this._def)})}catch(t){let e=typeof t==="function"?t:()=>t;return new qi({...St(this._def),innerType:this,catchValue:e,typeName:At.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Qn.create(this,t)}readonly(){return Ki.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var O3=/^c[^\s-]{8,}$/i,j3=/^[0-9a-z]+$/,R3=/^[0-9A-HJKMNP-TV-Z]{26}$/i,C3=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,X3=/^[a-z0-9_-]{21}$/i,$3=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N3=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,V3=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,z3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kc,D3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Q3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,U3=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Z3=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H3=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,G3=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,iy="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",q3=new RegExp(`^${iy}$`);function ny(t){let e="[0-5]\\d";if(t.precision)e=`${e}\\.\\d{${t.precision}}`;else if(t.precision==null)e=`${e}(\\.\\d+)?`;let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function K3(t){return new RegExp(`^${ny(t)}$`)}function J3(t){let e=`${iy}T${ny(t)}`,r=[];if(r.push(t.local?"Z?":"Z"),t.offset)r.push("([+-]\\d{2}:?\\d{2})");return e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function t4(t,e){if((e==="v4"||!e)&&D3.test(t))return!0;if((e==="v6"||!e)&&U3.test(t))return!0;return!1}function e4(t,e){if(!$3.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));if(typeof n!=="object"||n===null)return!1;if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(e&&n.alg!==e)return!1;return!0}catch{return!1}}function r4(t,e){if((e==="v4"||!e)&&Q3.test(t))return!0;if((e==="v6"||!e)&&Z3.test(t))return!0;return!1}class Ve extends Mt{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==nt.string){let n=this._getOrReturnCtx(t);return rt(n,{code:z.invalid_type,expected:nt.string,received:n.parsedType}),bt}let r=new le,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(t.data.length<n.value)i=this._getOrReturnCtx(t,i),rt(i,{code:z.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="max"){if(t.data.length>n.value)i=this._getOrReturnCtx(t,i),rt(i,{code:z.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="length"){let o=t.data.length>n.value,a=t.data.length<n.value;if(o||a){if(i=this._getOrReturnCtx(t,i),o)rt(i,{code:z.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});else if(a)rt(i,{code:z.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});r.dirty()}}else if(n.kind==="email"){if(!V3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"email",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="emoji"){if(!kc)kc=new RegExp(z3,"u");if(!kc.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"emoji",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="uuid"){if(!C3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"uuid",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="nanoid"){if(!X3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"nanoid",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid"){if(!O3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"cuid",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid2"){if(!j3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"cuid2",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ulid"){if(!R3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"ulid",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),rt(i,{validation:"url",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="regex"){if(n.regex.lastIndex=0,!n.regex.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"regex",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="trim")t.data=t.data.trim();else if(n.kind==="includes"){if(!t.data.includes(n.value,n.position))i=this._getOrReturnCtx(t,i),rt(i,{code:z.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()}else if(n.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(n.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(n.kind==="startsWith"){if(!t.data.startsWith(n.value))i=this._getOrReturnCtx(t,i),rt(i,{code:z.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="endsWith"){if(!t.data.endsWith(n.value))i=this._getOrReturnCtx(t,i),rt(i,{code:z.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="datetime"){if(!J3(n).test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{code:z.invalid_string,validation:"datetime",message:n.message}),r.dirty()}else if(n.kind==="date"){if(!q3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{code:z.invalid_string,validation:"date",message:n.message}),r.dirty()}else if(n.kind==="time"){if(!K3(n).test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{code:z.invalid_string,validation:"time",message:n.message}),r.dirty()}else if(n.kind==="duration"){if(!N3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"duration",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ip"){if(!t4(t.data,n.version))i=this._getOrReturnCtx(t,i),rt(i,{validation:"ip",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="jwt"){if(!e4(t.data,n.alg))i=this._getOrReturnCtx(t,i),rt(i,{validation:"jwt",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cidr"){if(!r4(t.data,n.version))i=this._getOrReturnCtx(t,i),rt(i,{validation:"cidr",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64"){if(!H3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"base64",code:z.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64url"){if(!G3.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"base64url",code:z.invalid_string,message:n.message}),r.dirty()}else Et.assertNever(n);return{status:r.value,value:t.data}}_regex(t,e,r){return this.refinement((i)=>t.test(i),{validation:e,code:z.invalid_string,...ut.errToObj(r)})}_addCheck(t){return new Ve({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ut.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ut.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ut.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ut.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ut.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ut.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ut.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ut.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ut.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ut.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ut.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ut.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ut.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ut.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ut.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ut.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...ut.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e?.position,...ut.errToObj(e?.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...ut.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...ut.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...ut.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...ut.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...ut.errToObj(e)})}nonempty(t){return this.min(1,ut.errToObj(t))}trim(){return new Ve({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ve({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ve({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxLength(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}}Ve.create=(t)=>new Ve({checks:[],typeName:At.ZodString,coerce:t?.coerce??!1,...St(t)});function i4(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(t.toFixed(n).replace(".","")),a=Number.parseInt(e.toFixed(n).replace(".",""));return o%a/10**n}class Xr extends Mt{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==nt.number){let n=this._getOrReturnCtx(t);return rt(n,{code:z.invalid_type,expected:nt.number,received:n.parsedType}),bt}let r=void 0,i=new le;for(let n of this._def.checks)if(n.kind==="int"){if(!Et.isInteger(t.data))r=this._getOrReturnCtx(t,r),rt(r,{code:z.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()}else if(n.kind==="min"){if(n.inclusive?t.data<n.value:t.data<=n.value)r=this._getOrReturnCtx(t,r),rt(r,{code:z.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?t.data>n.value:t.data>=n.value)r=this._getOrReturnCtx(t,r),rt(r,{code:z.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(i4(t.data,n.value)!==0)r=this._getOrReturnCtx(t,r),rt(r,{code:z.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else if(n.kind==="finite"){if(!Number.isFinite(t.data))r=this._getOrReturnCtx(t,r),rt(r,{code:z.not_finite,message:n.message}),i.dirty()}else Et.assertNever(n);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,ut.toString(e))}gt(t,e){return this.setLimit("min",t,!1,ut.toString(e))}lte(t,e){return this.setLimit("max",t,!0,ut.toString(e))}lt(t,e){return this.setLimit("max",t,!1,ut.toString(e))}setLimit(t,e,r,i){return new Xr({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:ut.toString(i)}]})}_addCheck(t){return new Xr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ut.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ut.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ut.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ut.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ut.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:ut.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:ut.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ut.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ut.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxValue(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&Et.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(e===null||r.value>e)e=r.value}else if(r.kind==="max"){if(t===null||r.value<t)t=r.value}return Number.isFinite(e)&&Number.isFinite(t)}}Xr.create=(t)=>new Xr({checks:[],typeName:At.ZodNumber,coerce:t?.coerce||!1,...St(t)});class $r extends Mt{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==nt.bigint)return this._getInvalidInput(t);let r=void 0,i=new le;for(let n of this._def.checks)if(n.kind==="min"){if(n.inclusive?t.data<n.value:t.data<=n.value)r=this._getOrReturnCtx(t,r),rt(r,{code:z.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?t.data>n.value:t.data>=n.value)r=this._getOrReturnCtx(t,r),rt(r,{code:z.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(t.data%n.value!==BigInt(0))r=this._getOrReturnCtx(t,r),rt(r,{code:z.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else Et.assertNever(n);return{status:i.value,value:t.data}}_getInvalidInput(t){let e=this._getOrReturnCtx(t);return rt(e,{code:z.invalid_type,expected:nt.bigint,received:e.parsedType}),bt}gte(t,e){return this.setLimit("min",t,!0,ut.toString(e))}gt(t,e){return this.setLimit("min",t,!1,ut.toString(e))}lte(t,e){return this.setLimit("max",t,!0,ut.toString(e))}lt(t,e){return this.setLimit("max",t,!1,ut.toString(e))}setLimit(t,e,r,i){return new $r({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:ut.toString(i)}]})}_addCheck(t){return new $r({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ut.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ut.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ut.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ut.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:ut.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxValue(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}}$r.create=(t)=>new $r({checks:[],typeName:At.ZodBigInt,coerce:t?.coerce??!1,...St(t)});class Xn extends Mt{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==nt.boolean){let r=this._getOrReturnCtx(t);return rt(r,{code:z.invalid_type,expected:nt.boolean,received:r.parsedType}),bt}return pe(t.data)}}Xn.create=(t)=>new Xn({typeName:At.ZodBoolean,coerce:t?.coerce||!1,...St(t)});class Ni extends Mt{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==nt.date){let n=this._getOrReturnCtx(t);return rt(n,{code:z.invalid_type,expected:nt.date,received:n.parsedType}),bt}if(Number.isNaN(t.data.getTime())){let n=this._getOrReturnCtx(t);return rt(n,{code:z.invalid_date}),bt}let r=new le,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(t.data.getTime()<n.value)i=this._getOrReturnCtx(t,i),rt(i,{code:z.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()}else if(n.kind==="max"){if(t.data.getTime()>n.value)i=this._getOrReturnCtx(t,i),rt(i,{code:z.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()}else Et.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ni({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:ut.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:ut.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t!=null?new Date(t):null}}Ni.create=(t)=>new Ni({checks:[],coerce:t?.coerce||!1,typeName:At.ZodDate,...St(t)});class $n extends Mt{_parse(t){if(this._getType(t)!==nt.symbol){let r=this._getOrReturnCtx(t);return rt(r,{code:z.invalid_type,expected:nt.symbol,received:r.parsedType}),bt}return pe(t.data)}}$n.create=(t)=>new $n({typeName:At.ZodSymbol,...St(t)});class Vi extends Mt{_parse(t){if(this._getType(t)!==nt.undefined){let r=this._getOrReturnCtx(t);return rt(r,{code:z.invalid_type,expected:nt.undefined,received:r.parsedType}),bt}return pe(t.data)}}Vi.create=(t)=>new Vi({typeName:At.ZodUndefined,...St(t)});class zi extends Mt{_parse(t){if(this._getType(t)!==nt.null){let r=this._getOrReturnCtx(t);return rt(r,{code:z.invalid_type,expected:nt.null,received:r.parsedType}),bt}return pe(t.data)}}zi.create=(t)=>new zi({typeName:At.ZodNull,...St(t)});class Nr extends Mt{constructor(){super(...arguments);this._any=!0}_parse(t){return pe(t.data)}}Nr.create=(t)=>new Nr({typeName:At.ZodAny,...St(t)});class mr extends Mt{constructor(){super(...arguments);this._unknown=!0}_parse(t){return pe(t.data)}}mr.create=(t)=>new mr({typeName:At.ZodUnknown,...St(t)});class ze extends Mt{_parse(t){let e=this._getOrReturnCtx(t);return rt(e,{code:z.invalid_type,expected:nt.never,received:e.parsedType}),bt}}ze.create=(t)=>new ze({typeName:At.ZodNever,...St(t)});class Nn extends Mt{_parse(t){if(this._getType(t)!==nt.undefined){let r=this._getOrReturnCtx(t);return rt(r,{code:z.invalid_type,expected:nt.void,received:r.parsedType}),bt}return pe(t.data)}}Nn.create=(t)=>new Nn({typeName:At.ZodVoid,...St(t)});class Le extends Mt{_parse(t){let{ctx:e,status:r}=this._processInputParams(t),i=this._def;if(e.parsedType!==nt.array)return rt(e,{code:z.invalid_type,expected:nt.array,received:e.parsedType}),bt;if(i.exactLength!==null){let o=e.data.length>i.exactLength.value,a=e.data.length<i.exactLength.value;if(o||a)rt(e,{code:o?z.too_big:z.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty()}if(i.minLength!==null){if(e.data.length<i.minLength.value)rt(e,{code:z.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()}if(i.maxLength!==null){if(e.data.length>i.maxLength.value)rt(e,{code:z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()}if(e.common.async)return Promise.all([...e.data].map((o,a)=>i.type._parseAsync(new Ye(e,o,e.path,a)))).then((o)=>le.mergeArray(r,o));let n=[...e.data].map((o,a)=>i.type._parseSync(new Ye(e,o,e.path,a)));return le.mergeArray(r,n)}get element(){return this._def.type}min(t,e){return new Le({...this._def,minLength:{value:t,message:ut.toString(e)}})}max(t,e){return new Le({...this._def,maxLength:{value:t,message:ut.toString(e)}})}length(t,e){return new Le({...this._def,exactLength:{value:t,message:ut.toString(e)}})}nonempty(t){return this.min(1,t)}}Le.create=(t,e)=>new Le({type:t,minLength:null,maxLength:null,exactLength:null,typeName:At.ZodArray,...St(e)});function Cr(t){if(t instanceof Qt){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=Ee.create(Cr(i))}return new Qt({...t._def,shape:()=>e})}else if(t instanceof Le)return new Le({...t._def,type:Cr(t.element)});else if(t instanceof Ee)return Ee.create(Cr(t.unwrap()));else if(t instanceof or)return or.create(Cr(t.unwrap()));else if(t instanceof De)return De.create(t.items.map((e)=>Cr(e)));else return t}class Qt extends Mt{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=Et.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==nt.object){let l=this._getOrReturnCtx(t);return rt(l,{code:z.invalid_type,expected:nt.object,received:l.parsedType}),bt}let{status:r,ctx:i}=this._processInputParams(t),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip")){for(let l in i.data)if(!o.includes(l))a.push(l)}let s=[];for(let l of o){let c=n[l],d=i.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new Ye(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof ze){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)s.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict"){if(a.length>0)rt(i,{code:z.unrecognized_keys,keys:a}),r.dirty()}else if(l==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let d=i.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new Ye(i,d,i.path,c)),alwaysSet:c in i.data})}}if(i.common.async)return Promise.resolve().then(async()=>{let l=[];for(let c of s){let d=await c.key,h=await c.value;l.push({key:d,value:h,alwaysSet:c.alwaysSet})}return l}).then((l)=>le.mergeObjectSync(r,l));else return le.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return ut.errToObj,new Qt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,r)=>{let i=this._def.errorMap?.(e,r).message??r.defaultError;if(e.code==="unrecognized_keys")return{message:ut.errToObj(t).message??i};return{message:i}}}:{}})}strip(){return new Qt({...this._def,unknownKeys:"strip"})}passthrough(){return new Qt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Qt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Qt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:At.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new Qt({...this._def,catchall:t})}pick(t){let e={};for(let r of Et.objectKeys(t))if(t[r]&&this.shape[r])e[r]=this.shape[r];return new Qt({...this._def,shape:()=>e})}omit(t){let e={};for(let r of Et.objectKeys(this.shape))if(!t[r])e[r]=this.shape[r];return new Qt({...this._def,shape:()=>e})}deepPartial(){return Cr(this)}partial(t){let e={};for(let r of Et.objectKeys(this.shape)){let i=this.shape[r];if(t&&!t[r])e[r]=i;else e[r]=i.optional()}return new Qt({...this._def,shape:()=>e})}required(t){let e={};for(let r of Et.objectKeys(this.shape))if(t&&!t[r])e[r]=this.shape[r];else{let n=this.shape[r];while(n instanceof Ee)n=n._def.innerType;e[r]=n}return new Qt({...this._def,shape:()=>e})}keyof(){return oy(Et.objectKeys(this.shape))}}Qt.create=(t,e)=>new Qt({shape:()=>t,unknownKeys:"strip",catchall:ze.create(),typeName:At.ZodObject,...St(e)});Qt.strictCreate=(t,e)=>new Qt({shape:()=>t,unknownKeys:"strict",catchall:ze.create(),typeName:At.ZodObject,...St(e)});Qt.lazycreate=(t,e)=>new Qt({shape:t,unknownKeys:"strip",catchall:ze.create(),typeName:At.ZodObject,...St(e)});class Di extends Mt{_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function i(n){for(let a of n)if(a.result.status==="valid")return a.result;for(let a of n)if(a.result.status==="dirty")return e.common.issues.push(...a.ctx.common.issues),a.result;let o=n.map((a)=>new fe(a.ctx.common.issues));return rt(e,{code:z.invalid_union,unionErrors:o}),bt}if(e.common.async)return Promise.all(r.map(async(n)=>{let o={...e,common:{...e.common,issues:[]},parent:null};return{result:await n._parseAsync({data:e.data,path:e.path,parent:o}),ctx:o}})).then(i);else{let n=void 0,o=[];for(let s of r){let l={...e,common:{...e.common,issues:[]},parent:null},c=s._parseSync({data:e.data,path:e.path,parent:l});if(c.status==="valid")return c;else if(c.status==="dirty"&&!n)n={result:c,ctx:l};if(l.common.issues.length)o.push(l.common.issues)}if(n)return e.common.issues.push(...n.ctx.common.issues),n.result;let a=o.map((s)=>new fe(s));return rt(e,{code:z.invalid_union,unionErrors:a}),bt}}get options(){return this._def.options}}Di.create=(t,e)=>new Di({options:t,typeName:At.ZodUnion,...St(e)});var Ne=(t)=>{if(t instanceof Ui)return Ne(t.schema);else if(t instanceof Pe)return Ne(t.innerType());else if(t instanceof Zi)return[t.value];else if(t instanceof fr)return t.options;else if(t instanceof Hi)return Et.objectValues(t.enum);else if(t instanceof Gi)return Ne(t._def.innerType);else if(t instanceof Vi)return[void 0];else if(t instanceof zi)return[null];else if(t instanceof Ee)return[void 0,...Ne(t.unwrap())];else if(t instanceof or)return[null,...Ne(t.unwrap())];else if(t instanceof Ic)return Ne(t.unwrap());else if(t instanceof Ki)return Ne(t.unwrap());else if(t instanceof qi)return Ne(t._def.innerType);else return[]};class Mc extends Mt{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==nt.object)return rt(e,{code:z.invalid_type,expected:nt.object,received:e.parsedType}),bt;let r=this.discriminator,i=e.data[r],n=this.optionsMap.get(i);if(!n)return rt(e,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),bt;if(e.common.async)return n._parseAsync({data:e.data,path:e.path,parent:e});else return n._parseSync({data:e.data,path:e.path,parent:e})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,r){let i=new Map;for(let n of e){let o=Ne(n.shape[t]);if(!o.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,n)}}return new Mc({typeName:At.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:i,...St(r)})}}function Yc(t,e){let r=$e(t),i=$e(e);if(t===e)return{valid:!0,data:t};else if(r===nt.object&&i===nt.object){let n=Et.objectKeys(e),o=Et.objectKeys(t).filter((s)=>n.indexOf(s)!==-1),a={...t,...e};for(let s of o){let l=Yc(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(r===nt.array&&i===nt.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let a=t[o],s=e[o],l=Yc(a,s);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else if(r===nt.date&&i===nt.date&&+t===+e)return{valid:!0,data:t};else return{valid:!1}}class Qi extends Mt{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=(n,o)=>{if(Bc(n)||Bc(o))return bt;let a=Yc(n.value,o.value);if(!a.valid)return rt(r,{code:z.invalid_intersection_types}),bt;if(Sc(n)||Sc(o))e.dirty();return{status:e.value,value:a.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,o])=>i(n,o));else return i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Qi.create=(t,e,r)=>new Qi({left:t,right:e,typeName:At.ZodIntersection,...St(r)});class De extends Mt{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.array)return rt(r,{code:z.invalid_type,expected:nt.array,received:r.parsedType}),bt;if(r.data.length<this._def.items.length)return rt(r,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),bt;if(!this._def.rest&&r.data.length>this._def.items.length)rt(r,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty();let n=[...r.data].map((o,a)=>{let s=this._def.items[a]||this._def.rest;if(!s)return null;return s._parse(new Ye(r,o,r.path,a))}).filter((o)=>!!o);if(r.common.async)return Promise.all(n).then((o)=>le.mergeArray(e,o));else return le.mergeArray(e,n)}get items(){return this._def.items}rest(t){return new De({...this._def,rest:t})}}De.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new De({items:t,typeName:At.ZodTuple,rest:null,...St(e)})};class Vn extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.object)return rt(r,{code:z.invalid_type,expected:nt.object,received:r.parsedType}),bt;let i=[],n=this._def.keyType,o=this._def.valueType;for(let a in r.data)i.push({key:n._parse(new Ye(r,a,r.path,a)),value:o._parse(new Ye(r,r.data[a],r.path,a)),alwaysSet:a in r.data});if(r.common.async)return le.mergeObjectAsync(e,i);else return le.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(t,e,r){if(e instanceof Mt)return new Vn({keyType:t,valueType:e,typeName:At.ZodRecord,...St(r)});return new Vn({keyType:Ve.create(),valueType:t,typeName:At.ZodRecord,...St(e)})}}class zn extends Mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.map)return rt(r,{code:z.invalid_type,expected:nt.map,received:r.parsedType}),bt;let i=this._def.keyType,n=this._def.valueType,o=[...r.data.entries()].map(([a,s],l)=>({key:i._parse(new Ye(r,a,r.path,[l,"key"])),value:n._parse(new Ye(r,s,r.path,[l,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let s of o){let l=await s.key,c=await s.value;if(l.status==="aborted"||c.status==="aborted")return bt;if(l.status==="dirty"||c.status==="dirty")e.dirty();a.set(l.value,c.value)}return{status:e.value,value:a}})}else{let a=new Map;for(let s of o){let{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return bt;if(l.status==="dirty"||c.status==="dirty")e.dirty();a.set(l.value,c.value)}return{status:e.value,value:a}}}}zn.create=(t,e,r)=>new zn({valueType:e,keyType:t,typeName:At.ZodMap,...St(r)});class Vr extends Mt{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.set)return rt(r,{code:z.invalid_type,expected:nt.set,received:r.parsedType}),bt;let i=this._def;if(i.minSize!==null){if(r.data.size<i.minSize.value)rt(r,{code:z.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),e.dirty()}if(i.maxSize!==null){if(r.data.size>i.maxSize.value)rt(r,{code:z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),e.dirty()}let n=this._def.valueType;function o(s){let l=new Set;for(let c of s){if(c.status==="aborted")return bt;if(c.status==="dirty")e.dirty();l.add(c.value)}return{status:e.value,value:l}}let a=[...r.data.values()].map((s,l)=>n._parse(new Ye(r,s,r.path,l)));if(r.common.async)return Promise.all(a).then((s)=>o(s));else return o(a)}min(t,e){return new Vr({...this._def,minSize:{value:t,message:ut.toString(e)}})}max(t,e){return new Vr({...this._def,maxSize:{value:t,message:ut.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}}Vr.create=(t,e)=>new Vr({valueType:t,minSize:null,maxSize:null,typeName:At.ZodSet,...St(e)});class $i extends Mt{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==nt.function)return rt(e,{code:z.invalid_type,expected:nt.function,received:e.parsedType}),bt;function r(a,s){return Cn({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ci(),nr].filter((l)=>!!l),issueData:{code:z.invalid_arguments,argumentsError:s}})}function i(a,s){return Cn({data:a,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ci(),nr].filter((l)=>!!l),issueData:{code:z.invalid_return_type,returnTypeError:s}})}let n={errorMap:e.common.contextualErrorMap},o=e.data;if(this._def.returns instanceof zr){let a=this;return pe(async function(...s){let l=new fe([]),c=await a._def.args.parseAsync(s,n).catch((y)=>{throw l.addIssue(r(s,y)),l}),d=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(d,n).catch((y)=>{throw l.addIssue(i(d,y)),l})})}else{let a=this;return pe(function(...s){let l=a._def.args.safeParse(s,n);if(!l.success)throw new fe([r(s,l.error)]);let c=Reflect.apply(o,this,l.data),d=a._def.returns.safeParse(c,n);if(!d.success)throw new fe([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new $i({...this._def,args:De.create(t).rest(mr.create())})}returns(t){return new $i({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,r){return new $i({args:t?t:De.create([]).rest(mr.create()),returns:e||mr.create(),typeName:At.ZodFunction,...St(r)})}}class Ui extends Mt{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}}Ui.create=(t,e)=>new Ui({getter:t,typeName:At.ZodLazy,...St(e)});class Zi extends Mt{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return rt(e,{received:e.data,code:z.invalid_literal,expected:this._def.value}),bt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Zi.create=(t,e)=>new Zi({value:t,typeName:At.ZodLiteral,...St(e)});function oy(t,e){return new fr({values:t,typeName:At.ZodEnum,...St(e)})}class fr extends Mt{_parse(t){if(typeof t.data!=="string"){let e=this._getOrReturnCtx(t),r=this._def.values;return rt(e,{expected:Et.joinValues(r),received:e.parsedType,code:z.invalid_type}),bt}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let e=this._getOrReturnCtx(t),r=this._def.values;return rt(e,{received:e.data,code:z.invalid_enum_value,options:r}),bt}return pe(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return fr.create(t,{...this._def,...e})}exclude(t,e=this._def){return fr.create(this.options.filter((r)=>!t.includes(r)),{...this._def,...e})}}fr.create=oy;class Hi extends Mt{_parse(t){let e=Et.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==nt.string&&r.parsedType!==nt.number){let i=Et.objectValues(e);return rt(r,{expected:Et.joinValues(i),received:r.parsedType,code:z.invalid_type}),bt}if(!this._cache)this._cache=new Set(Et.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let i=Et.objectValues(e);return rt(r,{received:r.data,code:z.invalid_enum_value,options:i}),bt}return pe(t.data)}get enum(){return this._def.values}}Hi.create=(t,e)=>new Hi({values:t,typeName:At.ZodNativeEnum,...St(e)});class zr extends Mt{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==nt.promise&&e.common.async===!1)return rt(e,{code:z.invalid_type,expected:nt.promise,received:e.parsedType}),bt;let r=e.parsedType===nt.promise?e.data:Promise.resolve(e.data);return pe(r.then((i)=>this._def.type.parseAsync(i,{path:e.path,errorMap:e.common.contextualErrorMap})))}}zr.create=(t,e)=>new zr({type:t,typeName:At.ZodPromise,...St(e)});class Pe extends Mt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===At.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=this._def.effect||null,n={addIssue:(o)=>{if(rt(r,o),o.fatal)e.abort();else e.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let o=i.transform(r.data,n);if(r.common.async)return Promise.resolve(o).then(async(a)=>{if(e.value==="aborted")return bt;let s=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});if(s.status==="aborted")return bt;if(s.status==="dirty")return Rr(s.value);if(e.value==="dirty")return Rr(s.value);return s});else{if(e.value==="aborted")return bt;let a=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(a.status==="aborted")return bt;if(a.status==="dirty")return Rr(a.value);if(e.value==="dirty")return Rr(a.value);return a}}if(i.type==="refinement"){let o=(a)=>{let s=i.refinement(a,n);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(a.status==="aborted")return bt;if(a.status==="dirty")e.dirty();return o(a.value),{status:e.value,value:a.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((a)=>{if(a.status==="aborted")return bt;if(a.status==="dirty")e.dirty();return o(a.value).then(()=>({status:e.value,value:a.value}))})}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!_r(o))return bt;let a=i.transform(o.value,n);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!_r(o))return bt;return Promise.resolve(i.transform(o.value,n)).then((a)=>({status:e.value,value:a}))});Et.assertNever(i)}}Pe.create=(t,e,r)=>new Pe({schema:t,typeName:At.ZodEffects,effect:e,...St(r)});Pe.createWithPreprocess=(t,e,r)=>new Pe({schema:e,effect:{type:"preprocess",transform:t},typeName:At.ZodEffects,...St(r)});class Ee extends Mt{_parse(t){if(this._getType(t)===nt.undefined)return pe(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ee.create=(t,e)=>new Ee({innerType:t,typeName:At.ZodOptional,...St(e)});class or extends Mt{_parse(t){if(this._getType(t)===nt.null)return pe(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}or.create=(t,e)=>new or({innerType:t,typeName:At.ZodNullable,...St(e)});class Gi extends Mt{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;if(e.parsedType===nt.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}}Gi.create=(t,e)=>new Gi({innerType:t,typeName:At.ZodDefault,defaultValue:typeof e.default==="function"?e.default:()=>e.default,...St(e)});class qi extends Mt{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(Xi(i))return i.then((n)=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new fe(r.common.issues)},input:r.data})}));else return{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new fe(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}qi.create=(t,e)=>new qi({innerType:t,typeName:At.ZodCatch,catchValue:typeof e.catch==="function"?e.catch:()=>e.catch,...St(e)});class Dn extends Mt{_parse(t){if(this._getType(t)!==nt.nan){let r=this._getOrReturnCtx(t);return rt(r,{code:z.invalid_type,expected:nt.nan,received:r.parsedType}),bt}return{status:"valid",value:t.data}}}Dn.create=(t)=>new Dn({typeName:At.ZodNaN,...St(t)});var Hj=Symbol("zod_brand");class Ic extends Mt{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}}class Qn extends Mt{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return bt;if(n.status==="dirty")return e.dirty(),Rr(n.value);else return this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();else{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return bt;if(i.status==="dirty")return e.dirty(),{status:"dirty",value:i.value};else return this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,e){return new Qn({in:t,out:e,typeName:At.ZodPipeline})}}class Ki extends Mt{_parse(t){let e=this._def.innerType._parse(t),r=(i)=>{if(_r(i))i.value=Object.freeze(i.value);return i};return Xi(e)?e.then((i)=>r(i)):r(e)}unwrap(){return this._def.innerType}}Ki.create=(t,e)=>new Ki({innerType:t,typeName:At.ZodReadonly,...St(e)});function ry(t,e){let r=typeof t==="function"?t(e):typeof t==="string"?{message:t}:t;return typeof r==="string"?{message:r}:r}function ay(t,e={},r){if(t)return Nr.create().superRefine((i,n)=>{let o=t(i);if(o instanceof Promise)return o.then((a)=>{if(!a){let s=ry(e,i),l=s.fatal??r??!0;n.addIssue({code:"custom",...s,fatal:l})}});if(!o){let a=ry(e,i),s=a.fatal??r??!0;n.addIssue({code:"custom",...a,fatal:s})}return});return Nr.create()}var Gj={object:Qt.lazycreate},At;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(At||(At={}));var p=Ve.create,w=Xr.create,qj=Dn.create,Kj=$r.create,R=Xn.create,Jj=Ni.create,tR=$n.create,eR=Vi.create,rR=zi.create,sy=Nr.create,cy=mr.create,Ji=ze.create,iR=Nn.create,X=Le.create,{create:M,strictCreate:nR}=Qt,Xt=Di.create,de=Mc.create,oR=Qi.create,ly=De.create,Dr=Vn.create,aR=zn.create,sR=Vr.create,cR=$i.create,lR=Ui.create,f=Zi.create,_t=fr.create,pR=Hi.create,dR=zr.create,hR=Pe.create,uR=Ee.create,yR=or.create,_R=Pe.createWithPreprocess,mR=Qn.create;var Zn=p().or(w()).transform((t)=>ue(t,"Ω").value),Xc=p().or(w()).transform((t)=>ue(t,"F").value).transform((t)=>Number.parseFloat(t.toPrecision(12))),vy=p().or(w()).transform((t)=>ue(t,"H").value),Fe=p().or(w()).transform((t)=>ue(t,"V").value),q=p().or(w()).transform((t)=>ue(t).value),gr=p().or(w()).transform((t)=>ue(t,"Hz").value),L=q,sr=p().or(w()).transform((t)=>ue(t,"A").value),Zr=p().or(w()).transform((t)=>ue(t).value),n4=Zr,te=Zr,wy=p().datetime(),jt=p().or(w()).transform((t)=>{if(typeof t==="number")return t;if(t.endsWith("deg"))return Number.parseFloat(t.split("deg")[0]);if(t.endsWith("rad"))return Number.parseFloat(t.split("rad")[0])*180/Math.PI;return Number.parseFloat(t)}),Ay=w().or(p().endsWith("mAh")).transform((t)=>{if(typeof t==="string"){let e=t.replace("mAh",""),r=Number.parseFloat(e);if(Number.isNaN(r))throw Error("Invalid capacity");return r}return t}).describe("Battery capacity in mAh"),B=(t)=>{};B("extra props b");B("missing props b");B(!0);B("mismatched prop types: a");var br=(t)=>{};br(!0);br('T1 has extra: "c", T2 has extra: "d"');br('T1 has extra: "c"');br('T2 has extra: "c"');br('T1 has extra: "d", T2 has extra: "c"');br(!0);var J=M({x:L,y:L}),o4=J;B(!0);B(!0);var Ae=M({x:L,y:L,z:L}),a4=Ae;B(!0);var Hn=M({width:w(),height:w()});B(!0);var Ur=L.pipe(w().finite()),Pc=L.pipe(w().finite().positive()),$c=M({shape:f("circle"),x:Ur,y:Ur,radius:Pc}).strict(),Gn=M({shape:f("rect"),x:Ur,y:Ur,width:Pc,height:Pc}).strict(),Nc=Gn.extend({shape:f("rotated_rect"),ccw_rotation:jt.pipe(w().finite())}),nn=M({shape:f("polygon"),points:X(J.extend({x:Ur,y:Ur})).min(3).refine((t)=>{let e=t.reduce((r,i,n)=>{let o=t[(n+1)%t.length];return r+i.x*o.y-o.x*i.y},0);return Number.isFinite(e)&&e!==0},"Polygon boundary must enclose a nonzero area")}).strict();B(!0);B(!0);B(!0);B(!0);var s4=de("shape",[$c,Gn,Nc,nn]);B(!0);var c4=(t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)]).join(""),j=(t)=>p().optional().default(()=>`${t}_${c4(10)}`),Qe=_t(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]);B(!0);var l4=_t(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","inner7_copper","inner8_copper","edge_cuts","drill"]);B(!0);var on=M({project_relative_path:p(),url:p(),mimetype:p()});B(!0);var qn=J.extend({rotation:jt.optional()});B(!0);var Vc=M({size:J.optional(),thickness:L.optional()});B(!0);var Fy=M({font:Vc.optional()});B(!0);var rn=M({value:p(),at:qn.optional(),layer:p().optional(),uuid:p().optional(),hide:R().optional(),effects:Fy.optional()});B(!0);var By=M({Reference:rn.optional(),Value:rn.optional(),Datasheet:rn.optional(),Description:rn.optional()});B(!0);var Sy=M({through_hole:R().optional(),smd:R().optional(),exclude_from_pos_files:R().optional(),exclude_from_bom:R().optional()});B(!0);var ky=M({name:p(),type:p(),shape:p().optional(),at:qn.optional(),size:J.optional(),drill:L.optional(),layers:X(p()).optional(),removeUnusedLayers:R().optional(),uuid:p().optional()});B(!0);var Yy=M({path:p(),offset:Ae.optional(),scale:Ae.optional(),rotate:Ae.optional()});B(!0);var My=M({footprintName:p().optional(),version:Xt([w(),p()]).optional(),generator:p().optional(),generatorVersion:Xt([w(),p()]).optional(),layer:p().optional(),properties:By.optional(),attributes:Sy.optional(),pads:X(ky).optional(),embeddedFonts:R().optional(),model:Yy.optional()});B(!0);var Iy=M({hide:R().optional()});B(!0);var Ly=M({offset:L.optional(),hide:R().optional()});B(!0);var Ey=M({font:Vc.optional(),justify:Xt([p(),X(p())]).optional(),hide:R().optional()});B(!0);var ar=M({value:p(),id:Xt([w(),p()]).optional(),at:qn.optional(),effects:Ey.optional()});B(!0);var Py=M({Reference:ar.optional(),Value:ar.optional(),Footprint:ar.optional(),Datasheet:ar.optional(),Description:ar.optional(),ki_keywords:ar.optional(),ki_fp_filters:ar.optional()});B(!0);var Ty=M({symbolName:p().optional(),extends:p().optional(),pinNumbers:Iy.optional(),pinNames:Ly.optional(),excludeFromSim:R().optional(),inBom:R().optional(),onBoard:R().optional(),properties:Py.optional(),embeddedFonts:R().optional()});B(!0);var It=M({error_type:p(),message:p(),is_fatal:R().optional()});B(!0);var Hr=_t(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]);B(!0);var Ot=M({type:f("source_component"),ftype:p().optional(),source_component_id:p(),name:p(),manufacturer_part_number:p().optional(),supplier_part_numbers:Dr(Hr,X(p())).optional(),display_value:p().optional(),display_name:p().optional(),are_pins_interchangeable:R().optional(),internally_connected_source_port_ids:X(X(p())).optional(),source_group_id:p().optional(),subcircuit_id:p().optional()});B(!0);var zc=Ot.extend({ftype:f("simple_capacitor"),capacitance:Xc,max_voltage_rating:Fe.optional(),display_capacitance:p().optional(),max_decoupling_trace_length:L.optional()});B(!0);var Dc=Ot.extend({ftype:f("simple_resistor"),resistance:Zn,display_resistance:p().optional()});B(!0);var Kn=Ot.extend({ftype:f("simple_diode")});B(!0);var Wy=Ot.extend({ftype:f("simple_fiducial")});B(!0);var Qc=Kn.extend({ftype:f("simple_led"),color:p().optional(),wavelength:p().optional()});B(!0);var Oy=Ot.extend({ftype:f("simple_ground")});B(!0);var Uc=Ot.extend({ftype:f("simple_chip")});B(!0);var jy=Ot.extend({ftype:f("printedpart"),material:_t(["pla","petg","nylon"]).optional(),color:p().trim().min(1).optional()});B(!0);var Ry=Ot.extend({ftype:f("subassembly")});B(!0);var Cy=Ot.extend({ftype:f("motor")});B(!0);var Zc=Ot.extend({ftype:f("simple_power_source"),voltage:Fe});B(!0);var Xy=Ot.extend({ftype:f("simple_current_source"),current:sr,frequency:gr.optional(),peak_to_peak_current:sr.optional(),wave_shape:_t(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:w().optional(),duty_cycle:w().min(0).max(1).optional()});B(!0);var $y=Ot.extend({ftype:f("simple_fuse"),current_rating_amps:w().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:w().describe("Voltage rating in volts, e.g. ±5V would be 5")});B(!0);var Ny=Ot.extend({ftype:f("simple_ammeter")});B(!0);var py=Xt([w(),p().trim().regex(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*(?:[fpnumkKMGTµμ]?V?|V)?$/,"Expected a scalar voltage, optionally with SI units")]).pipe(Fe).pipe(w().finite()),Vy=M({is_input:R().optional(),is_output:R().optional(),is_bidirectional:R().optional(),is_passive:R().optional(),can_use_tri_state:R().optional(),is_using_tri_state:R().optional(),can_use_open_collector:R().optional(),is_using_open_collector:R().optional(),can_use_open_emitter:R().optional(),is_using_open_emitter:R().optional(),is_gpio:R().optional(),highlight_color:p().optional(),must_be_connected:R().optional(),provides_power:R().optional(),requires_power:R().optional(),provides_ground:R().optional(),requires_ground:R().optional(),provides_voltage:py.optional(),requires_voltage:py.optional(),required_voltage_tolerance:w().finite().min(0).max(1).optional(),do_not_connect:R().optional(),include_in_board_pinout:R().optional(),can_use_internal_pullup:R().optional(),is_using_internal_pullup:R().optional(),needs_external_pullup:R().optional(),can_use_internal_pulldown:R().optional(),is_using_internal_pulldown:R().optional(),needs_external_pulldown:R().optional(),can_use_open_drain:R().optional(),is_using_open_drain:R().optional(),can_use_push_pull:R().optional(),is_using_push_pull:R().optional(),should_have_decoupling_capacitor:R().optional(),recommended_decoupling_capacitor_capacitance:Xt([p(),w()]).optional(),is_configured_for_i2c_sda:R().optional(),is_configured_for_i2c_scl:R().optional(),is_configured_for_spi_mosi:R().optional(),is_configured_for_spi_miso:R().optional(),is_configured_for_spi_sck:R().optional(),is_configured_for_spi_cs:R().optional(),is_configured_for_uart_tx:R().optional(),is_configured_for_uart_rx:R().optional(),supports_i2c_sda:R().optional(),supports_i2c_scl:R().optional(),supports_spi_mosi:R().optional(),supports_spi_miso:R().optional(),supports_spi_sck:R().optional(),supports_spi_cs:R().optional(),supports_uart_tx:R().optional(),supports_uart_rx:R().optional()});B(!0);var Hc=Ot.extend({ftype:f("simple_battery"),capacity:Ay});B(!0);var Gc=Ot.extend({ftype:f("simple_inductor"),inductance:vy,display_inductance:p().optional(),max_current_rating:w().optional()});B(!0);var qc=Ot.extend({ftype:f("simple_push_button")});B(!0);var Kc=Ot.extend({ftype:f("simple_potentiometer"),max_resistance:Zn,display_max_resistance:p().optional()});B(!0);var zy=Ot.extend({ftype:f("simple_crystal"),frequency:w().describe("Frequency in Hz"),load_capacitance:w().optional().describe("Load capacitance in pF"),pin_variant:_t(["two_pin","four_pin"]).optional()});B(!0);var Jc=Ot.extend({ftype:f("simple_pin_header"),pin_count:w(),gender:_t(["male","female"]).optional().default("male")});B(!0);var Dy=["usb_c","m2","jst_sh","jst_gh","jst_zh","jst_ph","jst_xh","jst_vh"],Qy=Ot.extend({ftype:f("simple_connector"),standard:_t(Dy).optional(),pin_count:w().int().positive().optional()});B(!0);var tl=Ot.extend({ftype:f("simple_pinout")});B(!0);var el=Ot.extend({ftype:f("simple_resonator"),load_capacitance:Xc,equivalent_series_resistance:Zn.optional(),frequency:gr});B(!0);var rl=Ot.extend({ftype:f("simple_transistor"),transistor_type:_t(["npn","pnp"])});B(!0);var il=Ot.extend({ftype:f("simple_test_point"),footprint_variant:_t(["pad","through_hole"]).optional(),pad_shape:_t(["rect","circle"]).optional(),pad_diameter:Xt([w(),p()]).optional(),hole_diameter:Xt([w(),p()]).optional(),width:Xt([w(),p()]).optional(),height:Xt([w(),p()]).optional()});B(!0);var nl=Ot.extend({ftype:f("simple_mosfet"),channel_type:_t(["n","p"]),mosfet_mode:_t(["enhancement","depletion"])});B(!0);var ol=Ot.extend({ftype:f("simple_op_amp")});B(!0);var al=Ot.extend({ftype:f("simple_switch")});B(!0);var sl=M({type:f("source_project_metadata"),name:p().optional(),software_used_string:p().optional(),project_url:p().optional(),source_filesystem_md5_hash:p().optional(),created_at:wy.optional()});B(!0);var Uy=It.extend({type:f("source_missing_property_error"),source_missing_property_error_id:j("source_missing_property_error"),source_component_id:p(),property_name:p(),subcircuit_id:p().optional(),error_type:f("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property");B(!0);var Zy=It.extend({type:f("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:j("source_failed_to_create_component_error"),error_type:f("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:p().optional(),subcircuit_id:p().optional(),parent_source_component_id:p().optional(),pcb_center:M({x:w().optional(),y:w().optional()}).optional(),schematic_center:M({x:w().optional(),y:w().optional()}).optional()}).describe("Error emitted when a component fails to be constructed");B(!0);var cl=It.extend({type:f("source_invalid_component_property_error"),source_invalid_component_property_error_id:j("source_invalid_component_property_error"),source_component_id:p(),property_name:p(),property_value:cy().optional(),expected_format:p().optional(),subcircuit_id:p().optional(),error_type:f("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid");B(!0);var ll=It.extend({type:f("source_trace_not_connected_error"),source_trace_not_connected_error_id:j("source_trace_not_connected_error"),error_type:f("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:p().optional(),source_group_id:p().optional(),source_trace_id:p().optional(),connected_source_port_ids:X(p()).optional(),selectors_not_found:X(p()).optional()}).describe("Occurs when a source trace selector does not match any ports");B(!0);var Hy=M({type:f("source_property_ignored_warning"),source_property_ignored_warning_id:j("source_property_ignored_warning"),source_component_id:p(),property_name:p(),subcircuit_id:p().optional(),error_type:f("source_property_ignored_warning").default("source_property_ignored_warning"),message:p()}).describe("The source property was ignored");B(!0);var pl=M({type:f("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:j("source_pin_missing_trace_warning"),warning_type:f("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:p(),source_component_id:p(),source_port_id:p(),subcircuit_id:p().optional()}).describe("Warning emitted when a source component pin is missing a trace connection");B(!0);var dl=M({type:f("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:j("source_missing_manufacturer_part_number_warning"),warning_type:f("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:p(),source_component_id:p(),standard:p().optional(),subcircuit_id:p().optional()}).describe("Warning emitted when a source component is missing its manufacturer part number");B(!0);var hl=M({type:f("source_refdes_convention_warning"),source_refdes_convention_warning_id:j("source_refdes_convention_warning"),warning_type:f("source_refdes_convention_warning").default("source_refdes_convention_warning"),message:p(),source_component_id:p(),refdes:p(),source_component_ftype:p(),expected_prefixes:X(p()),actual_prefix:p().optional(),subcircuit_id:p().optional()}).describe("Warning emitted when a source component reference designator does not match the component type convention");B(!0);var ul=M({type:f("source_component_availability_warning"),source_component_availability_warning_id:j("source_component_availability_warning"),warning_type:f("source_component_availability_warning").default("source_component_availability_warning"),message:p(),source_component_id:p(),subcircuit_id:p().optional(),supplier_name:Hr,supplier_part_numbers:X(p()).nonempty()}).describe("Warning emitted when no supplier alternative can be confirmed in stock. Availability may be unknown or change over time.");B(!0);var Gy=Ot.extend({ftype:f("simple_voltage_probe")});B(!0);var qy=Ot.extend({ftype:f("interconnect")});B(!0);var yl=It.extend({type:f("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:j("source_i2c_misconfigured_error"),error_type:f("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:X(p())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net");B(!0);var _l=It.extend({type:f("source_component_misconfigured_error"),source_component_misconfigured_error_id:j("source_component_misconfigured_error"),error_type:f("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:X(p()),source_port_ids:X(p()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration");B(!0);var Ky=Ot.extend({ftype:f("simple_voltage_source"),voltage:Fe,frequency:gr.optional(),peak_to_peak_voltage:Fe.optional(),wave_shape:_t(["sinewave","square","triangle","sawtooth"]).optional(),phase:jt.optional(),duty_cycle:w().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:te.optional(),rise_time:te.optional(),fall_time:te.optional(),pulse_width:te.optional(),period:te.optional()});B(!0);var ml=M({type:f("source_datasheet"),source_datasheet_id:p(),manufacturer_part_number:p(),datasheet_pdf_urls:X(p().url()),description:p().optional()});B(!0);var Jy=Xt([ml,Dc,zc,Kn,Wy,Qc,Oy,Uc,jy,Ry,Cy,Zc,Xy,Ny,Hc,Gc,qc,Kc,zy,Jc,Qy,tl,el,al,rl,il,nl,ol,$y,Gy,qy,Ky,sl,Uy,cl,Zy,ll,Hy,pl,dl,hl,ul,yl,_l]);B(!0);var t_=M({type:f("source_port"),pin_number:w().optional(),port_hints:X(p()).optional(),name:p(),source_port_id:p(),source_component_id:p().optional(),source_group_id:p().optional(),most_frequently_referenced_by_name:p().optional(),subcircuit_id:p().optional(),subcircuit_connectivity_map_key:p().optional()}).merge(Vy);B(!0);var e_=M({type:f("source_component_internal_connection"),source_component_internal_connection_id:p(),source_component_id:p(),source_port_ids:X(p()),subcircuit_id:p().optional()});B(!0);var r_=M({type:f("source_trace"),source_trace_id:p(),connected_source_port_ids:X(p()),connected_source_net_ids:X(p()),subcircuit_id:p().optional(),subcircuit_connectivity_map_key:p().optional(),max_length:w().optional(),max_via_count:w().int().nonnegative().optional(),name:p().optional(),min_trace_thickness:w().optional(),display_name:p().optional()});B(!0);var i_=M({type:f("source_group"),source_group_id:p(),subcircuit_id:p().optional(),parent_subcircuit_id:p().optional(),parent_source_group_id:p().optional(),is_subcircuit:R().optional(),show_as_schematic_box:R().optional(),name:p().optional(),was_automatically_named:R().optional()});B(!0);var n_=M({type:f("source_net"),source_net_id:p(),name:p(),member_source_group_ids:X(p()),is_power:R().optional(),is_ground:R().optional(),is_digital_signal:R().optional(),is_analog_signal:R().optional(),is_positive_voltage_source:R().optional(),trace_width:w().optional(),subcircuit_id:p().optional(),subcircuit_connectivity_map_key:p().optional()});B(!0);var o_=M({type:f("source_board"),source_board_id:p(),source_group_id:p(),title:p().optional()}).describe("Defines a board in the source domain");B(!0);var a_=It.extend({type:f("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:j("source_ambiguous_port_reference"),error_type:f("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:p().optional(),source_component_id:p().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous");B(!0);var s_=M({type:f("source_pcb_ground_plane"),source_pcb_ground_plane_id:p(),source_group_id:p(),source_net_id:p(),subcircuit_id:p().optional()}).describe("Defines a ground plane in the source domain");B(!0);var c_=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6","inner7","inner8"],Tc=_t(c_),gt=Tc.or(M({name:Tc})).transform((t)=>{if(typeof t==="string")return t;return t.name});B(!0);var Ht=_t(["top","bottom"]),l_=M({type:f("source_manually_placed_via"),source_manually_placed_via_id:p(),source_group_id:p(),source_net_id:p().min(1).optional(),subcircuit_id:p().optional(),source_trace_id:p().optional()}).describe("Defines a via that is manually placed in the source domain");B(!0);var p_=M({type:f("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:j("source_unnamed_trace_warning"),warning_type:f("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:p(),source_trace_id:p(),subcircuit_id:p().optional()}).describe("Warning emitted when a source trace is missing a name");B(!0);var d_=M({type:f("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:j("source_no_power_pin_defined_warning"),warning_type:f("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:p(),source_component_id:p(),source_port_ids:X(p()),subcircuit_id:p().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true");B(!0);var h_=M({type:f("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:j("source_no_ground_pin_defined_warning"),warning_type:f("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:p(),source_component_id:p(),source_port_ids:X(p()),subcircuit_id:p().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins");B(!0);var u_=M({type:f("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:j("source_component_pins_underspecified_warning"),warning_type:f("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:p(),source_component_id:p(),source_port_ids:X(p()),subcircuit_id:p().optional()}).describe("Warning emitted when all ports on a source component are underspecified");B(!0);var y_=It.extend({type:f("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:j("source_pin_must_be_connected_error"),error_type:f("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:p(),source_port_id:p(),subcircuit_id:p().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace");B(!0);var __=It.extend({type:f("unknown_error_finding_part"),unknown_error_finding_part_id:j("unknown_error_finding_part"),error_type:f("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:p().optional(),subcircuit_id:p().optional()}).describe("Error emitted when an unexpected error occurs while finding a part");B(!0);var m_=M({type:f("source_part_not_found_warning"),source_part_not_found_warning_id:j("source_part_not_found_warning"),warning_type:f("source_part_not_found_warning").default("source_part_not_found_warning"),message:p(),source_component_id:p().optional(),subcircuit_id:p().optional(),supplier_name:Hr.optional(),manufacturer_part_number:p().optional(),supplier_part_number:p().optional(),part_name:p().optional()}).describe("Warning emitted when a requested part can not be found");B(!0);var f_=M({type:f("source_confusing_net_name_warning"),source_confusing_net_name_warning_id:j("source_confusing_net_name_warning"),warning_type:f("source_confusing_net_name_warning").default("source_confusing_net_name_warning"),message:p(),source_net_ids:X(p()).min(2),net_name:p(),subcircuit_id:p().optional()}).describe("Warning emitted when electrically disconnected source nets share a name");B(!0);var Lc=Xt([w().nonnegative().finite(),M({reference:f("longest_manhattan"),source_trace_ids:X(p()).min(1).optional(),offset:w().finite().optional()})]),dy=Xt([w().positive().finite(),M({width_multiplier:w().positive().finite()})]),x_=M({type:f("source_bus"),source_bus_id:p(),name:p().optional(),source_trace_ids:X(p()).min(1),max_length_skew:w().nonnegative().finite().optional(),target_impedance:w().positive().finite().optional(),target_differential_impedance:w().positive().finite().optional(),differential_pair:M({positive_source_trace_id:p(),negative_source_trace_id:p(),trace_gap:w().positive().finite().optional(),max_uncoupled_length:w().nonnegative().finite().optional()}).optional(),length_match_source_trace_ids:X(p()).min(1).optional(),min_length:Lc.optional(),max_length:Lc.optional(),target_length:Lc.optional(),length_tolerance:w().nonnegative().finite().optional(),pcb_trace_spacing:dy.optional(),pcb_spacing_to_other_signals:dy.optional(),target_impedance_min:w().positive().finite().optional(),target_impedance_max:w().positive().finite().optional(),target_differential_impedance_min:w().positive().finite().optional(),target_differential_impedance_max:w().positive().finite().optional(),subcircuit_id:p().optional()});B(!0);var g_=It.pick({message:!0,error_type:!0}).extend({type:f("source_runtime_error"),source_runtime_error_id:j("source_runtime_error"),error_type:f("source_runtime_error").default("source_runtime_error"),phase_name:p().optional()}).describe("An unexpected runtime failure while generating or validating a circuit");B(!0);var b_=M({type:f("schematic_box"),schematic_sheet_id:p().optional(),schematic_component_id:p().optional(),schematic_symbol_id:p().optional(),width:L,height:L,is_dashed:R().default(!1),x:L,y:L,subcircuit_id:p().optional()}).describe("Draws a box on the schematic");B(!0);var v_=M({type:f("schematic_path"),schematic_path_id:j("schematic_path"),schematic_sheet_id:p().optional(),schematic_component_id:p().optional(),schematic_symbol_id:p().optional(),fill_color:p().optional(),is_filled:R().optional(),is_dashed:R().default(!1),stroke_width:L.nullable().optional(),stroke_color:p().optional(),dash_length:L.optional(),dash_gap:L.optional(),points:X(J),subcircuit_id:p().optional()});B(!0);var w_=Dr(M({left_margin:q.optional(),right_margin:q.optional(),top_margin:q.optional(),bottom_margin:q.optional()})),A_=M({left_size:w(),right_size:w(),top_size:w().optional(),bottom_size:w().optional()});B(!0);var F_=M({left_side:M({pins:X(w()),direction:_t(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:M({pins:X(w()),direction:_t(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:M({pins:X(w()),direction:_t(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:M({pins:X(w()),direction:_t(["left-to-right","right-to-left"]).optional()}).optional()});B(!0);var B_=Xt([A_,F_]),S_=M({type:f("schematic_component"),size:Hn,center:J,source_component_id:p().optional(),schematic_component_id:p(),schematic_sheet_id:p().optional(),schematic_symbol_id:p().optional(),pin_spacing:q.optional(),pin_styles:w_.optional(),box_width:q.optional(),symbol_name:p().optional(),port_arrangement:B_.optional(),port_labels:Dr(p()).optional(),symbol_display_value:p().optional(),subcircuit_id:p().optional(),schematic_group_id:p().optional(),is_schematic_group:R().optional(),source_group_id:p().optional(),is_box_with_pins:R().optional().default(!0)});B(!0);var p4=M({kicad_symbol:Ty.optional()}).catchall(cy()),k_=M({type:f("schematic_symbol"),schematic_symbol_id:p(),name:p().optional(),metadata:p4.optional()}).describe("Defines a named schematic symbol that can be referenced by components.");B(!0);var Y_=M({type:f("schematic_line"),schematic_line_id:j("schematic_line"),schematic_sheet_id:p().optional(),schematic_component_id:p().optional(),schematic_symbol_id:p().optional(),x1:L,y1:L,x2:L,y2:L,stroke_width:L.nullable().optional(),color:p().default("#000000"),is_dashed:R().default(!1),dash_length:L.optional(),dash_gap:L.optional(),subcircuit_id:p().optional()}).describe("Draws a styled line on the schematic");B(!0);var M_=M({type:f("schematic_rect"),schematic_rect_id:j("schematic_rect"),schematic_sheet_id:p().optional(),schematic_component_id:p().optional(),schematic_symbol_id:p().optional(),center:J,width:L,height:L,rotation:jt.default(0),stroke_width:L.nullable().optional(),color:p().default("#000000"),is_filled:R().default(!1),fill_color:p().optional(),is_dashed:R().default(!1),subcircuit_id:p().optional()}).describe("Draws a styled rectangle on the schematic");B(!0);var I_=M({type:f("schematic_circle"),schematic_circle_id:j("schematic_circle"),schematic_sheet_id:p().optional(),schematic_component_id:p().optional(),schematic_symbol_id:p().optional(),center:J,radius:L,stroke_width:L.nullable().optional(),color:p().default("#000000"),is_filled:R().default(!1),fill_color:p().optional(),is_dashed:R().default(!1),subcircuit_id:p().optional()}).describe("Draws a styled circle on the schematic");B(!0);var L_=M({type:f("schematic_arc"),schematic_arc_id:j("schematic_arc"),schematic_sheet_id:p().optional(),schematic_component_id:p().optional(),schematic_symbol_id:p().optional(),center:J,radius:L,start_angle_degrees:jt,end_angle_degrees:jt,direction:_t(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:L.nullable().optional(),color:p().default("#000000"),is_dashed:R().default(!1),subcircuit_id:p().optional()}).describe("Draws a styled arc on the schematic");B(!0);var E_=M({type:f("schematic_trace"),schematic_trace_id:p(),schematic_sheet_id:p().optional(),source_trace_id:p().optional(),junctions:X(M({x:w(),y:w()})),edges:X(M({from:M({x:w(),y:w()}),to:M({x:w(),y:w()}),is_crossing:R().optional(),from_schematic_port_id:p().optional(),to_schematic_port_id:p().optional()})),subcircuit_id:p().optional(),subcircuit_connectivity_map_key:p().optional()});B(!0);var d4=_t(["center","left","right","top","bottom"]);B(!0);var fl=M({text:p(),is_overlined:R().optional()}),P_=M({type:f("schematic_text"),schematic_sheet_id:p().optional(),schematic_component_id:p().optional(),schematic_symbol_id:p().optional(),schematic_text_id:p(),source_trace_id:p().optional(),text:p(),text_parts:X(fl).min(1).optional(),display_superscript:p().optional(),font_size:w().default(0.18),position:M({x:L,y:L}),rotation:w().default(0),anchor:Xt([d4.describe("legacy"),Qe]).default("center"),color:p().default("#000000"),subcircuit_id:p().optional()});B(!0);var T_=M({type:f("schematic_port"),schematic_port_id:p(),source_port_id:p(),schematic_sheet_id:p().optional(),schematic_component_id:p().optional(),center:J,facing_direction:_t(["up","down","left","right"]).optional(),distance_from_component_edge:w().optional(),side_of_component:_t(["top","bottom","left","right"]).optional(),true_ccw_index:w().optional(),pin_number:w().optional(),display_pin_label:p().optional(),display_pin_label_text_parts:X(fl).min(1).optional(),display_pin_label_font_size:w().positive().finite().optional(),subcircuit_id:p().optional(),is_connected:R().optional(),is_internal_circuit_port:R().optional(),is_overlapping_internal_circuit_port:R().optional(),has_input_arrow:R().optional(),has_output_arrow:R().optional(),is_drawn_with_inversion_circle:R().optional()}).describe("Defines a port on a schematic component");B(!0);var W_=M({type:f("schematic_net_label"),schematic_net_label_id:j("schematic_net_label"),schematic_sheet_id:p().optional(),schematic_trace_id:p().optional(),source_trace_id:p().optional(),source_net_id:p(),center:J,anchor_position:J.optional(),anchor_side:_t(["top","bottom","left","right"]),text:p(),display_superscript:p().optional(),symbol_name:p().optional(),is_movable:R().optional(),subcircuit_id:p().optional()});B(!0);var O_=It.extend({type:f("schematic_error"),schematic_error_id:p(),error_type:f("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:p().optional()}).describe("Defines a schematic error on the schematic");B(!0);var j_=It.extend({type:f("schematic_layout_error"),schematic_layout_error_id:j("schematic_layout_error"),error_type:f("schematic_layout_error").default("schematic_layout_error"),source_group_id:p(),schematic_group_id:p(),subcircuit_id:p().optional()}).describe("Error emitted when schematic layout fails for a group");B(!0);var Jn=M({type:f("schematic_debug_object"),label:p().optional(),subcircuit_id:p().optional()}),R_=Jn.extend({shape:f("rect"),center:J,size:Hn}),C_=Jn.extend({shape:f("line"),start:J,end:J}),X_=Jn.extend({shape:f("point"),center:J}),$_=de("shape",[R_,C_,X_]);B(!0);var N_=M({type:f("schematic_voltage_probe"),schematic_voltage_probe_id:p(),schematic_sheet_id:p().optional(),source_component_id:p().optional(),name:p().optional(),position:J,schematic_trace_id:p(),voltage:Fe.optional(),subcircuit_id:p().optional(),color:p().optional(),label_alignment:Qe.optional()}).describe("Defines a voltage probe measurement point on a schematic trace");B(!0);var V_=M({type:f("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:j("schematic_manual_edit_conflict_warning"),warning_type:f("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:p(),schematic_component_id:p(),schematic_group_id:p().optional(),subcircuit_id:p().optional(),source_component_id:p()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates");B(!0);var z_=M({type:f("schematic_component_overlap_warning"),schematic_component_overlap_warning_id:j("schematic_component_overlap_warning"),warning_type:f("schematic_component_overlap_warning").default("schematic_component_overlap_warning"),message:p(),schematic_component_ids:ly([p(),p()]),schematic_sheet_id:p().optional()}).describe("Warning emitted when the rendered bounds of two schematic components overlap");B(!0);var D_=M({type:f("schematic_component_styling_warning"),schematic_component_styling_warning_id:j("schematic_component_styling_warning"),warning_type:f("schematic_component_styling_warning").default("schematic_component_styling_warning"),message:p(),schematic_component_id:p(),styling_issue_type:p(),schematic_port_ids:X(p()).optional(),source_component_id:p().optional(),schematic_sheet_id:p().optional(),subcircuit_id:p().optional()}).describe("Warning emitted when a schematic component has a visual styling issue");B(!0);var Q_=M({type:f("schematic_sheet_styling_warning"),schematic_sheet_styling_warning_id:j("schematic_sheet_styling_warning"),warning_type:f("schematic_sheet_styling_warning").default("schematic_sheet_styling_warning"),message:p(),schematic_sheet_id:p(),styling_issue_type:f("non_default_sheet_size"),subcircuit_id:p().optional()}).describe("Style warning emitted when a schematic sheet uses a non-default size");B(!0);var U_=M({type:f("schematic_element_outside_sheet_warning"),schematic_element_outside_sheet_warning_id:j("schematic_element_outside_sheet_warning"),warning_type:f("schematic_element_outside_sheet_warning").default("schematic_element_outside_sheet_warning"),message:p(),schematic_sheet_id:p(),schematic_element_type:_t(["schematic_component","schematic_net_label","schematic_trace"]),schematic_element_id:p()}).describe("Warning emitted when a schematic component, net label, or trace extends outside its schematic sheet");B(!0);var hy=L.pipe(w().positive().finite()),Z_=M({type:f("schematic_graphic"),schematic_graphic_id:j("schematic_graphic"),schematic_sheet_id:p().optional(),asset:on.optional(),svg_content:p().optional(),width:hy.optional(),height:hy.optional()}).describe("References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet").superRefine(({asset:t,svg_content:e},r)=>{if(t===void 0&&e===void 0)r.addIssue({code:z.custom,message:"At least one of asset or svg_content is required"})});B(!0);var H_=M({type:f("schematic_group"),schematic_group_id:j("schematic_group"),schematic_sheet_id:p().optional(),source_group_id:p(),is_subcircuit:R().optional(),subcircuit_id:p().optional(),width:q,height:q,center:J,schematic_component_ids:X(p()),show_as_schematic_box:R().optional(),name:p().optional(),description:p().optional()}).describe("Defines a group of components on the schematic");B(!0);var G_=M({type:f("schematic_table"),schematic_table_id:j("schematic_table"),schematic_sheet_id:p().optional(),anchor_position:J,column_widths:X(L),row_heights:X(L),cell_padding:L.optional(),border_width:L.optional(),subcircuit_id:p().optional(),schematic_component_id:p().optional(),anchor:Qe.optional()}).describe("Defines a table on the schematic");B(!0);var q_=M({type:f("schematic_table_cell"),schematic_table_cell_id:j("schematic_table_cell"),schematic_sheet_id:p().optional(),schematic_table_id:p(),start_row_index:w(),end_row_index:w(),start_column_index:w(),end_column_index:w(),text:p().optional(),center:J,width:L,height:L,horizontal_align:_t(["left","center","right"]).optional(),vertical_align:_t(["top","middle","bottom"]).optional(),font_size:L.optional(),subcircuit_id:p().optional()}).describe("Defines a cell within a schematic_table");B(!0);var K_=_t(["a4","ansi_b"]),J_=M({type:f("schematic_sheet"),schematic_sheet_id:j("schematic_sheet"),name:p().optional(),sheet_index:w().optional(),sheet_size:K_.optional(),sheet_width:w().positive().optional(),sheet_height:w().positive().optional(),subcircuit_id:p().optional(),outline_color:p().optional()}).describe("Defines a schematic sheet or page that components can be placed on");B(!0);var tm=M({type:f("schematic_missing_sheet_warning"),schematic_missing_sheet_warning_id:j("schematic_missing_sheet_warning"),warning_type:f("schematic_missing_sheet_warning").default("schematic_missing_sheet_warning"),message:p()}).describe("Circuit-wide warning emitted when a schematic has no schematic sheet. Display as a banner without attaching it to a component or drawing a target outline or leader line.");B(!0);var em=M({x:L,y:L,bulge:w().optional()});B(!0);var Wc=M({vertices:X(em)});B(!0);var xl=M({outer_ring:Wc,inner_rings:X(Wc).default([])});B(!0);var rm={from_left:"from_left",from_right:"from_right",from_top:"from_top",from_bottom:"from_bottom",from_above:"from_above",from_below:"from_below",from_x_neg:"from_left",from_x_pos:"from_right",from_y_pos:"from_top",from_y_neg:"from_bottom",from_z_pos:"from_above",from_z_neg:"from_below",from_front:"from_top",from_back:"from_bottom"},h4={from_left:{x:-1,y:0,z:0},from_right:{x:1,y:0,z:0},from_top:{x:0,y:1,z:0},from_bottom:{x:0,y:-1,z:0},from_above:{x:0,y:0,z:1},from_below:{x:0,y:0,z:-1}},im=_t(["from_left","from_right","from_top","from_bottom","from_above","from_below","from_x_neg","from_x_pos","from_y_pos","from_y_neg","from_z_pos","from_z_neg","from_front","from_back"]).transform((t)=>rm[t]).describe('The side exposing the receptacle where the cable or mating part is attached, following the 2D PCB diagram convention, not a 3D viewport frame. In project coordinate space, "from_top" is +Y, "from_bottom" -Y, "from_left" -X, "from_right" +X, "from_above" +Z and "from_below" -Z. A receptacle on the +Y edge is "from_top" even though the plug moves in -Y as it seats. Cartesian spellings such as "from_y_pos" are accepted and normalized to the named values, as are the deprecated "from_front" (now "from_top") and "from_back" (now "from_bottom").');B(!0);B(!0);var Oc=_t(["leftside_top","leftside_bottom","rightside_top","rightside_bottom","topside_left","topside_right","bottomside_left","bottomside_right"]);B(!0);var u4=[["leftside_top","bottomside_left","rightside_bottom","topside_right"],["leftside_bottom","bottomside_right","rightside_top","topside_left"]],y4=(t,e)=>{for(let r of u4){let i=r.indexOf(t),n=r.indexOf(e);if(i!==-1&&n!==-1)return(n-i+r.length)%r.length*90}return null},nm=M({x:L,y:L,via:R().optional(),via_to_layer:gt.optional()}),_4=X(nm);B(!0);B(!0);var om=M({x:L,y:L,via:R().optional(),to_layer:gt.optional(),trace_width:L.optional()});B(!0);var am=M({min_trace_width:q.optional(),min_board_edge_clearance:q.optional(),min_via_hole_edge_to_via_hole_edge_clearance:q.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:q.optional(),min_trace_to_pad_edge_clearance:q.optional(),min_trace_to_hole_edge_clearance:q.optional().describe("Minimum distance from a trace copper edge to a non-plated hole edge, in mm. No default is applied when omitted."),min_pad_edge_to_pad_edge_clearance:q.optional(),min_same_net_trace_edge_to_trace_edge_clearance:q.optional(),min_different_net_trace_edge_to_trace_edge_clearance:q.optional(),min_via_edge_to_pad_edge_clearance:q.optional(),min_via_hole_diameter:q.optional(),min_via_pad_diameter:q.optional()}),sm=M({type:f("pcb_component"),pcb_component_id:j("pcb_component"),source_component_id:p(),center:J,layer:gt,rotation:jt,display_offset_x:p().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:p().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:q,height:q,do_not_place:R().optional(),is_allowed_to_be_off_board:R().optional(),subcircuit_id:p().optional(),pcb_group_id:p().optional(),position_mode:_t(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:J.optional(),anchor_alignment:Qe.optional(),positioned_relative_to_pcb_group_id:p().optional(),positioned_relative_to_pcb_board_id:p().optional(),cable_insertion_center:J.optional(),insertion_direction:im.optional(),pin1_location:Oc.optional().describe("Location of pin 1 on the unrotated, top-view component footprint"),supplier_pin1_location_map:Dr(Hr,Oc).optional().describe("Pin 1 location for each supplier's unrotated, top-view footprint"),metadata:M({kicad_footprint:My.optional()}).optional(),obstructs_within_bounds:R().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB");B(!0);var to=M({type:f("pcb_debug_object"),pcb_debug_object_id:j("pcb_debug_object"),label:p().optional(),subcircuit_id:p().optional()}),cm=to.extend({shape:f("rect"),center:J,size:Hn}),lm=to.extend({shape:f("line"),start:J,end:J}),pm=to.extend({shape:f("point"),center:J}),dm=de("shape",[cm,lm,pm]);B(!0);var hm=M({type:f("pcb_hole"),pcb_hole_id:j("pcb_hole"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),pcb_component_id:p().optional(),hole_shape:f("circle"),hole_diameter:w(),x:L,y:L,is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional()}),m4=hm.describe("Defines a circular hole on the PCB");B(!0);var um=M({type:f("pcb_hole"),pcb_hole_id:j("pcb_hole"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),pcb_component_id:p().optional(),hole_shape:f("rect"),hole_width:w(),hole_height:w(),x:L,y:L,is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional()}),f4=um.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square.");B(!0);var ym=M({type:f("pcb_hole"),pcb_hole_id:j("pcb_hole"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),pcb_component_id:p().optional(),hole_shape:_t(["circle","square"]),hole_diameter:w(),x:L,y:L,is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional()}),x4=ym.describe("Defines a circular or square hole on the PCB");B(!0);var _m=M({type:f("pcb_hole"),pcb_hole_id:j("pcb_hole"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),pcb_component_id:p().optional(),hole_shape:f("oval"),hole_width:w(),hole_height:w(),x:L,y:L,is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional()}),g4=_m.describe("Defines an oval hole on the PCB");B(!0);var mm=M({type:f("pcb_hole"),pcb_hole_id:j("pcb_hole"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),pcb_component_id:p().optional(),hole_shape:f("pill"),hole_width:w(),hole_height:w(),x:L,y:L,is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional()}),b4=mm.describe("Defines a pill-shaped hole on the PCB");B(!0);var fm=M({type:f("pcb_hole"),pcb_hole_id:j("pcb_hole"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),pcb_component_id:p().optional(),hole_shape:f("rotated_pill"),hole_width:w(),hole_height:w(),x:L,y:L,ccw_rotation:jt,is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional()}),v4=fm.describe("Defines a rotated pill-shaped hole on the PCB");B(!0);var xm=ym.or(_m).or(mm).or(fm).or(hm).or(um),w4=M({type:f("pcb_plated_hole"),shape:f("circle"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),outer_diameter:w(),hole_diameter:w(),is_covered_with_solder_mask:R().optional(),x:L,y:L,layers:X(gt),port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),pcb_plated_hole_id:j("pcb_plated_hole"),soldermask_margin:w().optional()}),A4=M({type:f("pcb_plated_hole"),shape:_t(["oval","pill"]),pcb_group_id:p().optional(),subcircuit_id:p().optional(),outer_width:w(),outer_height:w(),hole_width:w(),hole_height:w(),is_covered_with_solder_mask:R().optional(),x:L,y:L,ccw_rotation:jt,layers:X(gt),port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),pcb_plated_hole_id:j("pcb_plated_hole"),soldermask_margin:w().optional()}),F4=M({type:f("pcb_plated_hole"),shape:f("circular_hole_with_rect_pad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),hole_shape:f("circle"),pad_shape:f("rect"),hole_diameter:w(),rect_pad_width:w(),rect_pad_height:w(),rect_border_radius:w().optional(),hole_offset_x:L.default(0),hole_offset_y:L.default(0),is_covered_with_solder_mask:R().optional(),x:L,y:L,layers:X(gt),port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),pcb_plated_hole_id:j("pcb_plated_hole"),soldermask_margin:w().optional(),rect_ccw_rotation:jt.optional()}),B4=M({type:f("pcb_plated_hole"),shape:f("pill_hole_with_rect_pad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),hole_shape:f("pill"),pad_shape:f("rect"),hole_width:w(),hole_height:w(),rect_pad_width:w(),rect_pad_height:w(),rect_border_radius:w().optional(),hole_offset_x:L.default(0),hole_offset_y:L.default(0),is_covered_with_solder_mask:R().optional(),x:L,y:L,layers:X(gt),port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),pcb_plated_hole_id:j("pcb_plated_hole"),soldermask_margin:w().optional()}),S4=M({type:f("pcb_plated_hole"),shape:f("rotated_pill_hole_with_rect_pad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),hole_shape:f("rotated_pill"),pad_shape:f("rect"),hole_width:w(),hole_height:w(),hole_ccw_rotation:jt,rect_pad_width:w(),rect_pad_height:w(),rect_border_radius:w().optional(),rect_ccw_rotation:jt,hole_offset_x:L.default(0),hole_offset_y:L.default(0),is_covered_with_solder_mask:R().optional(),x:L,y:L,layers:X(gt),port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),pcb_plated_hole_id:j("pcb_plated_hole"),soldermask_margin:w().optional()}),k4=M({type:f("pcb_plated_hole"),shape:f("hole_with_polygon_pad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),hole_shape:_t(["circle","oval","pill","rotated_pill"]),hole_diameter:w().optional(),hole_width:w().optional(),hole_height:w().optional(),pad_outline:X(M({x:L,y:L})).min(3),hole_offset_x:L.default(0),hole_offset_y:L.default(0),is_covered_with_solder_mask:R().optional(),x:L,y:L,layers:X(gt),port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),pcb_plated_hole_id:j("pcb_plated_hole"),soldermask_margin:w().optional(),ccw_rotation:jt.optional()}),gm=Xt([w4,A4,F4,B4,S4,k4]);B(!0);B(!0);B(!0);B(!0);B(!0);B(!0);var bm=M({type:f("pcb_port"),pcb_port_id:j("pcb_port"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),source_port_id:p(),pcb_component_id:p().optional(),x:L,y:L,layers:X(gt),is_board_pinout:R().optional()}).describe("Defines a port on the PCB");B(!0);var Y4=M({type:f("pcb_smtpad"),shape:f("circle"),pcb_smtpad_id:j("pcb_smtpad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,radius:w(),layer:gt,port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional(),solderpaste_margin:w().optional()}),M4=M({type:f("pcb_smtpad"),shape:f("rect"),pcb_smtpad_id:j("pcb_smtpad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),rect_border_radius:w().optional(),corner_radius:w().optional(),layer:gt,port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional(),soldermask_margin_left:w().optional(),soldermask_margin_top:w().optional(),soldermask_margin_right:w().optional(),soldermask_margin_bottom:w().optional(),solderpaste_margin:w().optional()}),I4=M({type:f("pcb_smtpad"),shape:f("rotated_rect"),pcb_smtpad_id:j("pcb_smtpad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),rect_border_radius:w().optional(),corner_radius:w().optional(),ccw_rotation:jt,layer:gt,port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional(),soldermask_margin_left:w().optional(),soldermask_margin_top:w().optional(),soldermask_margin_right:w().optional(),soldermask_margin_bottom:w().optional(),solderpaste_margin:w().optional()}),vm=M({type:f("pcb_smtpad"),shape:f("pill"),pcb_smtpad_id:j("pcb_smtpad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),radius:w(),layer:gt,port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional(),solderpaste_margin:w().optional()}),L4=M({type:f("pcb_smtpad"),shape:f("rotated_pill"),pcb_smtpad_id:j("pcb_smtpad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),radius:w(),ccw_rotation:jt,layer:gt,port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional(),solderpaste_margin:w().optional()}),E4=M({type:f("pcb_smtpad"),shape:f("polygon"),pcb_smtpad_id:j("pcb_smtpad"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),points:X(J),layer:gt,port_hints:X(p()).optional(),pcb_component_id:p().optional(),pcb_port_id:p().optional(),is_covered_with_solder_mask:R().optional(),soldermask_margin:w().optional(),solderpaste_margin:w().optional()}),wm=de("shape",[Y4,M4,I4,L4,vm,E4]).describe("Defines an SMT pad on the PCB");B(!0);B(!0);B(!0);B(!0);B(!0);B(!0);var P4=M({type:f("pcb_solder_paste"),shape:f("circle"),pcb_solder_paste_id:j("pcb_solder_paste"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,radius:w(),layer:gt,pcb_component_id:p().optional(),pcb_smtpad_id:p().optional()}),T4=M({type:f("pcb_solder_paste"),shape:f("rect"),pcb_solder_paste_id:j("pcb_solder_paste"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),layer:gt,pcb_component_id:p().optional(),pcb_smtpad_id:p().optional()}),W4=M({type:f("pcb_solder_paste"),shape:f("pill"),pcb_solder_paste_id:j("pcb_solder_paste"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),radius:w(),layer:gt,pcb_component_id:p().optional(),pcb_smtpad_id:p().optional()}),O4=M({type:f("pcb_solder_paste"),shape:f("rotated_rect"),pcb_solder_paste_id:j("pcb_solder_paste"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),ccw_rotation:L,layer:gt,pcb_component_id:p().optional(),pcb_smtpad_id:p().optional()}),j4=M({type:f("pcb_solder_paste"),shape:f("rotated_pill"),pcb_solder_paste_id:j("pcb_solder_paste"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),radius:w(),ccw_rotation:jt,layer:gt,pcb_component_id:p().optional(),pcb_smtpad_id:p().optional()}),R4=M({type:f("pcb_solder_paste"),shape:f("oval"),pcb_solder_paste_id:j("pcb_solder_paste"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),x:L,y:L,width:w(),height:w(),layer:gt,pcb_component_id:p().optional(),pcb_smtpad_id:p().optional()}),C4=nn.extend({type:f("pcb_solder_paste"),pcb_solder_paste_id:j("pcb_solder_paste"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),holes:X(nn.shape.points).optional(),layer:gt,pcb_component_id:p().optional(),pcb_smtpad_id:p().optional()}),Am=Xt([P4,T4,W4,O4,j4,R4,C4]).describe("Defines solderpaste on the PCB");B(!0);B(!0);B(!0);B(!0);B(!0);B(!0);B(!0);var Un=M({type:f("pcb_soldermask_opening"),pcb_soldermask_opening_id:j("pcb_soldermask_opening"),layer:gt.pipe(Ht),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional()}),Fm=de("shape",[$c.extend(Un.shape),Gn.extend(Un.shape),Nc.extend(Un.shape),nn.extend(Un.shape)]).describe("An explicit opening in top or bottom solder mask or flex coverlay, independent of pads. Removes mask without adding copper or solder paste.");B(!0);var Bm=M({type:f("pcb_text"),pcb_text_id:j("pcb_text"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),text:p(),center:J,layer:gt,width:q,height:q,lines:w(),align:_t(["bottom-left"])}).describe("Defines text on the PCB");B(!0);var uy=L.pipe(w().finite().positive()),Sm=M({route_type:f("wire"),x:L,y:L,width:L,start_width:uy.optional(),end_width:uy.optional(),width_interpolation_mode:_t(["linear","quadratic"]).optional(),copper_pour_id:p().optional(),is_inside_copper_pour:R().optional(),start_pcb_port_id:p().optional(),end_pcb_port_id:p().optional(),layer:gt}).superRefine((t,e)=>{let r=[t.start_width,t.end_width,t.width_interpolation_mode].filter((i)=>i!==void 0).length;if(r===0)return;if(r!==3)e.addIssue({code:z.custom,message:"Wire taper requires start_width, end_width and width_interpolation_mode together"});if(t.width!==t.start_width)e.addIssue({code:z.custom,path:["start_width"],message:"start_width must equal width"});if(!Number.isFinite(t.x)||!Number.isFinite(t.y))e.addIssue({code:z.custom,message:"Tapered wire coordinates must be finite"})}),km=M({route_type:f("via"),x:L,y:L,copper_pour_id:p().optional(),is_inside_copper_pour:R().optional(),hole_diameter:L.optional(),outer_diameter:L.optional(),tented_on_top:R().optional(),tented_on_bottom:R().optional(),from_layer:gt,to_layer:gt}),Ym=M({route_type:f("through_pad"),start:J,end:J,width:L,start_layer:gt,end_layer:gt,pcb_smtpad_id:p().optional(),pcb_plated_hole_id:p().optional()}),Mm=Xt([Sm,km,Ym]),Im=M({type:f("pcb_trace"),source_trace_id:p().optional(),pcb_component_id:p().optional(),pcb_trace_id:j("pcb_trace"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),route_thickness_mode:_t(["constant","interpolated"]).default("constant").optional(),route_order_index:w().optional(),should_round_corners:R().optional(),trace_length:w().optional(),is_antenna_trace:R().optional(),highlight_color:p().optional(),route:X(Mm).superRefine((t,e)=>{for(let[r,i]of t.entries()){if(i.route_type!=="wire"||i.width_interpolation_mode===void 0)continue;let n=t[r+1],o=n?.route_type==="through_pad"?n.start:n,a=n?.route_type==="wire"?n.layer:n?.route_type==="via"?n.from_layer:n?.start_layer,s=o?Math.hypot(o.x-i.x,o.y-i.y):NaN;if(!Number.isFinite(s)||s<=0||a!==i.layer)e.addIssue({code:z.custom,path:[r],message:"Tapered wire must lead to a distinct finite next point on the same layer"})}})}).describe("Defines a trace on the PCB");B(!0);B(!0);var Lm=M({type:f("pcb_trace_warning"),pcb_trace_warning_id:j("pcb_trace_warning"),warning_type:f("pcb_trace_warning").default("pcb_trace_warning"),message:p(),center:J.optional(),pcb_trace_id:p(),source_trace_id:p(),pcb_component_ids:X(p()),pcb_port_ids:X(p()),subcircuit_id:p().optional()}).describe("Defines a trace warning on the PCB");B(!0);var Em=M({type:f("pcb_trace_style_warning"),pcb_trace_style_warning_id:j("pcb_trace_style_warning"),warning_type:f("pcb_trace_style_warning").default("pcb_trace_style_warning"),message:p(),styling_issue_type:f("long_segment_at_odd_angle"),pcb_trace_id:p(),source_trace_id:p().optional(),subcircuit_id:p().optional(),layer:gt,start_route_index:w().int().nonnegative(),end_route_index:w().int().nonnegative(),segment_start:J,segment_end:J,center:J,segment_length:L,minimum_segment_length:L,angle_degrees:w().min(0).lt(360),nearest_allowed_angle_degrees:w().min(0).lt(360).multipleOf(45),angle_deviation_degrees:w().min(0).max(22.5),angle_tolerance_degrees:w().min(0).lt(22.5)}).describe("Warning for a long PCB trace segment whose direction deviates from a multiple of 45 degrees");B(!0);var Pm=M({type:f("pcb_trace_too_long_error"),pcb_trace_too_long_error_id:j("pcb_trace_too_long_error"),error_type:f("pcb_trace_too_long_error").default("pcb_trace_too_long_error"),message:p(),pcb_trace_id:p(),source_net_id:p().optional(),source_trace_id:p().optional(),actual_trace_length:L,maximum_trace_length:L,subcircuit_id:p().optional()}).describe("Error emitted when a PCB trace is longer than its maximum allowed length");B(!0);var Tm=It.extend({type:f("pcb_bus_length_skew_error"),pcb_bus_length_skew_error_id:j("pcb_bus_length_skew_error"),error_type:f("pcb_bus_length_skew_error").default("pcb_bus_length_skew_error"),source_bus_id:p(),source_trace_ids:X(p()),pcb_trace_ids:X(p()),actual_length_skew:w().nonnegative().finite(),maximum_length_skew:w().nonnegative().finite(),subcircuit_id:p().optional()});B(!0);var Wm=M({type:f("pcb_trace_too_long_warning"),pcb_trace_too_long_warning_id:j("pcb_trace_too_long_warning"),warning_type:f("pcb_trace_too_long_warning").default("pcb_trace_too_long_warning"),message:p(),pcb_trace_id:p(),source_net_id:p().optional(),source_trace_id:p().optional(),actual_trace_length:L,maximum_trace_length:L,subcircuit_id:p().optional()}).describe("Warning emitted when a PCB trace is longer than its maximum allowed length");B(!0);var Om=M({type:f("pcb_trace_too_many_vias_warning"),pcb_trace_too_many_vias_warning_id:j("pcb_trace_too_many_vias_warning"),warning_type:f("pcb_trace_too_many_vias_warning").default("pcb_trace_too_many_vias_warning"),message:p(),pcb_trace_id:p(),source_net_id:p().optional(),source_trace_id:p().optional(),actual_via_count:w().int().nonnegative(),maximum_via_count:w().int().nonnegative(),subcircuit_id:p().optional()}).describe("Warning emitted when a PCB trace has more vias than its maximum allowed count");B(!0);var xr=It.extend({type:f("pcb_bus_routing_constraint_error"),pcb_bus_routing_constraint_error_id:j("pcb_bus_routing_constraint_error"),error_type:f("pcb_bus_routing_constraint_error").default("pcb_bus_routing_constraint_error"),source_bus_id:p(),source_trace_ids:X(p()).min(1),pcb_trace_ids:X(p()),subcircuit_id:p().optional()}),jm=de("routing_rule",[xr.extend({routing_rule:f("length_skew"),actual_length_skew:w().nonnegative().finite(),maximum_length_skew:w().nonnegative().finite()}),xr.extend({routing_rule:f("min_length"),actual_trace_length:w().nonnegative().finite(),minimum_trace_length:w().finite()}),xr.extend({routing_rule:f("max_length"),actual_trace_length:w().nonnegative().finite(),maximum_trace_length:w().finite()}),xr.extend({routing_rule:f("target_length"),actual_trace_length:w().nonnegative().finite(),target_trace_length:w().finite(),length_tolerance:w().nonnegative().finite()}),xr.extend({routing_rule:f("pcb_trace_spacing"),other_pcb_trace_id:p(),other_source_trace_id:p().optional(),actual_centerline_spacing:w().nonnegative().finite(),minimum_centerline_spacing:w().positive().finite()}),xr.extend({routing_rule:f("pcb_spacing_to_other_signals"),other_pcb_trace_id:p(),other_source_trace_id:p().optional(),actual_centerline_spacing:w().nonnegative().finite(),minimum_centerline_spacing:w().positive().finite()}),xr.extend({routing_rule:f("impedance_target"),target_impedance:w().positive().finite(),minimum_impedance:w().positive().finite().optional(),maximum_impedance:w().positive().finite().optional()})]).superRefine((t,e)=>{if(t.routing_rule!=="impedance_target")return;if(t.minimum_impedance===void 0&&t.maximum_impedance===void 0)e.addIssue({code:z.custom,path:["minimum_impedance"],message:"Provide an impedance bound"});if(t.minimum_impedance!==void 0&&t.maximum_impedance!==void 0&&t.minimum_impedance>t.maximum_impedance)e.addIssue({code:z.custom,path:["maximum_impedance"],message:"Impedance bounds must be ordered"})}).describe("A declared bus or differential-pair routing constraint is violated.");B(!0);var tn=M({type:f("pcb_bus_routing_constraint_warning"),pcb_bus_routing_constraint_warning_id:j("pcb_bus_routing_constraint_warning"),warning_type:f("pcb_bus_routing_constraint_warning").default("pcb_bus_routing_constraint_warning"),source_bus_id:p(),source_trace_ids:X(p()).min(1),pcb_trace_ids:X(p()),message:p(),subcircuit_id:p().optional()}).describe("A declared bus or pair constraint could not be verified; this is not a pass."),Rm=de("routing_rule",[tn.extend({routing_rule:f("route_geometry")}),tn.extend({routing_rule:f("reference_geometry")}),tn.extend({routing_rule:f("spacing_geometry")}),tn.extend({routing_rule:f("target_length")}),tn.extend({routing_rule:f("physical_impedance")})]);B(!0);var Cm=It.extend({type:f("pcb_trace_error"),pcb_trace_error_id:j("pcb_trace_error"),error_type:f("pcb_trace_error").default("pcb_trace_error"),center:J.optional(),pcb_trace_id:p(),source_trace_id:p(),pcb_component_ids:X(p()),pcb_port_ids:X(p()),subcircuit_id:p().optional()}).describe("Defines a trace error on the PCB");B(!0);var Xm=It.extend({type:f("pcb_trace_missing_error"),pcb_trace_missing_error_id:j("pcb_trace_missing_error"),error_type:f("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:J.optional(),source_trace_id:p(),pcb_component_ids:X(p()),pcb_port_ids:X(p()),subcircuit_id:p().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace");B(!0);var $m=It.extend({type:f("pcb_port_not_matched_error"),pcb_error_id:j("pcb_error"),error_type:f("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:X(p()),subcircuit_id:p().optional()}).describe("Defines a trace error on the PCB where a port is not matched");B(!0);var Nm=It.extend({type:f("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:j("pcb_port_not_connected_error"),error_type:f("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:X(p()),pcb_component_ids:X(p()),subcircuit_id:p().optional()}).describe("Defines an error when a pcb port is not connected to any trace");B(!0);var Vm=M({type:f("pcb_net"),pcb_net_id:j("pcb_net"),source_net_id:p().optional(),highlight_color:p().optional()}).describe("Defines a net on the PCB");B(!0);var zm=M({type:f("pcb_via"),pcb_via_id:j("pcb_via"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),subcircuit_connectivity_map_key:p().optional(),x:L,y:L,outer_diameter:L.default("0.6mm"),hole_diameter:L.default("0.25mm"),topmost_drill_layer:gt.optional(),bottommost_drill_layer:gt.optional(),through_hole:R().optional(),from_layer:gt.optional(),to_layer:gt.optional(),layers:X(gt),pcb_port_ids:X(p()).optional(),pcb_trace_id:p().optional(),source_trace_id:p().optional(),source_net_id:p().min(1).optional(),net_is_assignable:R().optional(),net_assigned:R().optional(),is_tented:R().optional(),tented_on_top:R().optional(),tented_on_bottom:R().optional()}).transform(({is_tented:t,...e})=>{if(t!==void 0)e.tented_on_top??=t,e.tented_on_bottom??=t;return e}).describe("Defines a via on the PCB");B(!0);var Dm=M({type:f("pcb_board"),pcb_board_id:j("pcb_board"),pcb_panel_id:p().optional(),carrier_pcb_board_id:p().optional(),is_subcircuit:R().optional(),subcircuit_id:p().optional(),is_mounted_to_carrier_board:R().optional(),is_via_in_pad_allowed:R().optional(),default_via_tented_on_top:R().optional(),default_via_tented_on_bottom:R().optional(),default_via_plugged:R().optional(),width:q.optional(),height:q.optional(),center:J,display_offset_x:p().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:p().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:q.optional().default(1.4),num_layers:w().optional().default(4),allow_blind_and_buried_vias:R().optional().describe("Whether autorouters may generate blind and buried vias. False restricts newly generated vias to the full board stack."),outline:X(J).optional(),shape:_t(["rect","polygon"]).optional(),material:_t(["fr4","fr1","flex"]).default("fr4"),solder_mask_color:p().optional(),silkscreen_color:p().optional(),anchor_position:J.optional(),anchor_alignment:Qe.optional(),position_mode:_t(["relative_to_panel_anchor","none"]).optional()}).merge(am).describe("Defines the board outline of the PCB");B(!0);var yy=J.extend({x:q.pipe(w().finite()),y:q.pipe(w().finite())}),Qm=M({type:f("pcb_bend"),pcb_bend_id:j("pcb_bend"),pcb_board_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),name:p().optional(),start:yy,end:yy,bend_angle:jt.pipe(w().finite()),bend_radius:q.pipe(w().finite().positive()),bend_side:_t(["left","right"])}).refine(({start:t,end:e})=>t.x!==e.x||t.y!==e.y,{message:"Bend centerline endpoints must be distinct",path:["end"]}).describe("Defines a finite-radius bend on a flat PCB for runtime CAD folding");B(!0);var jc=q.pipe(w().finite().positive()),Um=J.extend({x:q.pipe(w().finite()),y:q.pipe(w().finite())}),Zm=M({type:f("pcb_stiffener"),pcb_stiffener_id:j("pcb_stiffener"),pcb_board_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),name:p().optional(),layer:_t(["top","bottom"]),material:_t(["fr4","polyimide","stainless_steel","aluminum"]),thickness:jc,adhesive_thickness:q.pipe(w().finite().nonnegative()).optional()}),Hm=Zm.extend({shape:f("rect"),center:Um,rotation:jt.pipe(w().finite()).optional(),width:jc,height:jc,outline:Ji().optional()});B(!0);var Gm=Zm.extend({shape:f("polygon"),outline:X(Um).min(3).refine((t)=>{let e=t.reduce((r,i,n)=>{let o=t[(n+1)%t.length];return r+i.x*o.y-o.x*i.y},0);return Number.isFinite(e)&&e!==0},"Stiffener outline must enclose a nonzero area"),center:Ji().optional(),rotation:Ji().optional(),width:Ji().optional(),height:Ji().optional()});B(!0);var qm=de("shape",[Hm,Gm]).describe("Defines bonded mechanical PCB reinforcement without adding copper layers");B(!0);var Km=M({type:f("pcb_panel"),pcb_panel_id:j("pcb_panel"),width:q,height:q,center:J,thickness:q.optional().default(1.4),covered_with_solder_mask:R().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards");B(!0);var Jm=It.extend({type:f("pcb_placement_error"),pcb_placement_error_id:j("pcb_placement_error"),error_type:f("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:p().optional()}).describe("Defines a placement error on the PCB");B(!0);var tf=It.extend({type:f("pcb_packing_error"),pcb_packing_error_id:j("pcb_packing_error"),error_type:f("pcb_packing_error").default("pcb_packing_error"),pcb_group_id:p().optional(),subcircuit_id:p().optional()}).describe("Defines a failure to pack PCB components within layout bounds");B(!0);var ef=It.extend({type:f("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:j("pcb_panelization_placement_error"),error_type:f("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:p().optional(),pcb_board_id:p().optional(),subcircuit_id:p().optional()}).describe("Defines a panelization placement error on the PCB");B(!0);var rf=M({type:f("pcb_trace_hint"),pcb_trace_hint_id:j("pcb_trace_hint"),pcb_port_id:p(),pcb_component_id:p(),route:X(om),subcircuit_id:p().optional()}).describe("A hint that can be used during generation of a PCB trace");B(!0);var nf=M({type:f("pcb_silkscreen_line"),pcb_silkscreen_line_id:j("pcb_silkscreen_line"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),stroke_width:L.default("0.1mm"),x1:L,y1:L,x2:L,y2:L,layer:Ht}).describe("Defines a silkscreen line on the PCB");B(!0);var of=M({type:f("pcb_silkscreen_path"),pcb_silkscreen_path_id:j("pcb_silkscreen_path"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),layer:Ht,route:X(J),stroke_width:q}).describe("Defines a silkscreen path on the PCB");B(!0);var af=M({type:f("pcb_silkscreen_text"),pcb_silkscreen_text_id:j("pcb_silkscreen_text"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),font:f("tscircuit2024").default("tscircuit2024"),font_size:L.default("0.2mm"),pcb_component_id:p(),text:p(),is_knockout:R().default(!1).optional(),knockout_padding:M({left:q,top:q,bottom:q,right:q}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:w().optional(),layer:gt,is_mirrored:R().default(!1).optional(),anchor_position:J.default({x:0,y:0}),anchor_alignment:Qe.default("center")}).describe("Defines silkscreen text on the PCB");B(!0);var sf=M({type:f("pcb_copper_text"),pcb_copper_text_id:j("pcb_copper_text"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),font:f("tscircuit2024").default("tscircuit2024"),font_size:L.default("0.2mm"),pcb_component_id:p(),text:p(),is_knockout:R().default(!1).optional(),knockout_padding:M({left:q,top:q,bottom:q,right:q}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:w().optional(),layer:gt,is_mirrored:R().default(!1).optional(),anchor_position:J.default({x:0,y:0}),anchor_alignment:Qe.default("center")}).describe("Defines copper text on the PCB");B(!0);var cf=M({type:f("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:j("pcb_silkscreen_rect"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,width:q,height:q,layer:gt,stroke_width:q.default("1mm"),corner_radius:q.optional(),is_filled:R().default(!0).optional(),has_stroke:R().optional(),is_stroke_dashed:R().optional(),ccw_rotation:w().optional()}).describe("Defines a silkscreen rect on the PCB");B(!0);var lf=M({type:f("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:j("pcb_silkscreen_circle"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,radius:q,layer:Ht,stroke_width:q.default("1mm"),is_filled:R().optional()}).describe("Defines a silkscreen circle on the PCB");B(!0);var pf=M({type:f("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:j("pcb_silkscreen_oval"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,radius_x:L,radius_y:L,layer:Ht,ccw_rotation:jt.optional()}).describe("Defines a silkscreen oval on the PCB");B(!0);var X4=M({type:f("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:j("pcb_silkscreen_graphic"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),layer:Ht,image_asset:on.optional()}),df=X4.extend({shape:f("brep"),brep_shape:xl}).describe("Defines a BRep silkscreen graphic on the PCB");B(!0);var hf=de("shape",[df]).describe("Defines a silkscreen graphic on the PCB");B(!0);var uf=M({type:f("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:j("pcb_silkscreen_pill"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,width:q,height:q,layer:gt,ccw_rotation:w().optional()}).describe("Defines a silkscreen pill on the PCB");B(!0);var yf=M({type:f("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:j("pcb_fabrication_note_text"),subcircuit_id:p().optional(),pcb_group_id:p().optional(),font:f("tscircuit2024").default("tscircuit2024"),font_size:L.default("1mm"),pcb_component_id:p(),text:p(),ccw_rotation:w().optional(),layer:Ht,anchor_position:J.default({x:0,y:0}),anchor_alignment:_t(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:p().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators");B(!0);var _f=M({type:f("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:j("pcb_fabrication_note_path"),pcb_component_id:p(),subcircuit_id:p().optional(),layer:gt,route:X(J),stroke_width:q,color:p().optional(),is_filled:R().optional(),has_stroke:R().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers");B(!0);var mf=M({type:f("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:j("pcb_fabrication_note_rect"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,width:q,height:q,layer:Ht,stroke_width:q.default("0.1mm"),corner_radius:q.optional(),is_filled:R().optional(),has_stroke:R().optional(),is_stroke_dashed:R().optional(),color:p().optional()}).describe("Defines a fabrication note rectangle on the PCB");B(!0);var ff=M({type:f("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:j("pcb_fabrication_note_dimension"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),layer:Ht,from:J,to:J,text:p().optional(),text_ccw_rotation:w().optional(),offset:q.optional(),offset_distance:q.optional(),offset_direction:M({x:w(),y:w()}).optional(),font:f("tscircuit2024").default("tscircuit2024"),font_size:q.default("1mm"),color:p().optional(),arrow_size:q.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes");B(!0);var xf=M({type:f("pcb_note_text"),pcb_note_text_id:j("pcb_note_text"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),name:p().optional(),font:f("tscircuit2024").default("tscircuit2024"),font_size:L.default("1mm"),text:p().optional(),anchor_position:J.default({x:0,y:0}),anchor_alignment:_t(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:Ht.default("top"),is_mirrored_from_top_view:R().optional(),color:p().optional()}).describe("Defines a documentation note in text on the PCB");B(!0);var gf=M({type:f("pcb_note_rect"),pcb_note_rect_id:j("pcb_note_rect"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),name:p().optional(),text:p().optional(),center:J,width:q,height:q,layer:Ht.default("top"),stroke_width:q.default("0.1mm"),corner_radius:q.optional(),is_filled:R().optional(),has_stroke:R().optional(),is_stroke_dashed:R().optional(),color:p().optional()}).describe("Defines a rectangular documentation note on the PCB");B(!0);var bf=M({type:f("pcb_note_path"),pcb_note_path_id:j("pcb_note_path"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),name:p().optional(),text:p().optional(),route:X(J),layer:Ht.default("top"),stroke_width:q.default("0.1mm"),color:p().optional()}).describe("Defines a polyline documentation note on the PCB");B(!0);var vf=M({type:f("pcb_note_line"),pcb_note_line_id:j("pcb_note_line"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),name:p().optional(),text:p().optional(),x1:L,y1:L,x2:L,y2:L,layer:Ht.default("top"),stroke_width:L.default("0.1mm"),color:p().optional(),is_dashed:R().optional()}).describe("Defines a straight documentation note line on the PCB");B(!0);var wf=M({type:f("pcb_note_dimension"),pcb_note_dimension_id:j("pcb_note_dimension"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),name:p().optional(),from:J,to:J,text:p().optional(),text_ccw_rotation:w().optional(),offset_distance:q.optional(),offset_direction:M({x:w(),y:w()}).optional(),font:f("tscircuit2024").default("tscircuit2024"),font_size:q.default("1mm"),layer:Ht.default("top"),color:p().optional(),arrow_size:q.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes");B(!0);var Af=It.extend({type:f("pcb_footprint_overlap_error"),pcb_error_id:j("pcb_error"),error_type:f("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:X(p()).optional(),pcb_plated_hole_ids:X(p()).optional(),pcb_hole_ids:X(p()).optional(),pcb_keepout_ids:X(p()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element");B(!0);var Ff=It.extend({type:f("pcb_courtyard_overlap_error"),pcb_error_id:j("pcb_error"),error_type:f("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:ly([p(),p()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another");B(!0);var Bf=M({type:f("pcb_keepout"),shape:f("outline"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),outline:X(J).min(2),stroke_width:q,pcb_keepout_id:p(),layers:X(p()),description:p().optional(),excluded_pcb_component_ids:X(p()).optional(),warning_only:R().optional(),allow_traces:R().optional(),allow_placements:R().optional()}),Sf=M({type:f("pcb_keepout"),shape:f("rect"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,width:L,height:L,pcb_keepout_id:p(),layers:X(p()),description:p().optional(),excluded_pcb_component_ids:X(p()).optional(),warning_only:R().optional(),allow_traces:R().optional(),allow_placements:R().optional()}).or(M({type:f("pcb_keepout"),shape:f("circle"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,radius:L,pcb_keepout_id:p(),layers:X(p()),description:p().optional(),excluded_pcb_component_ids:X(p()).optional(),warning_only:R().optional(),allow_traces:R().optional(),allow_placements:R().optional()})).or(Bf);B(!0);B(!0);var kf=M({type:f("pcb_keepout_overlap_warning"),pcb_keepout_overlap_warning_id:j("pcb_keepout_overlap_warning"),warning_type:f("pcb_keepout_overlap_warning").default("pcb_keepout_overlap_warning"),message:p(),pcb_keepout_id:p(),pcb_component_ids:X(p()).optional(),pcb_trace_ids:X(p()).optional(),pcb_smtpad_ids:X(p()).optional(),pcb_plated_hole_ids:X(p()).optional(),pcb_via_ids:X(p()).optional(),center:J.optional(),subcircuit_id:p().optional()}).describe("Warning emitted when copper overlaps a PCB keepout with warning_only enabled");B(!0);var eo=M({type:f("pcb_cutout"),pcb_cutout_id:j("pcb_cutout"),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),pcb_board_id:p().optional(),pcb_panel_id:p().optional()}),Yf=eo.extend({shape:f("rect"),center:J,width:q,height:q,rotation:jt.optional(),corner_radius:q.optional()});B(!0);var Mf=eo.extend({shape:f("circle"),center:J,radius:q});B(!0);var If=eo.extend({shape:f("polygon"),points:X(J)});B(!0);var Lf=eo.extend({shape:f("path"),route:X(J),slot_width:q,slot_length:q.optional(),space_between_slots:q.optional(),slot_corner_radius:q.optional()});B(!0);var Ef=de("shape",[Yf,Mf,If,Lf]).describe("Defines a cutout on the PCB, removing board material.");B(!0);var Pf=It.extend({type:f("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:j("pcb_missing_footprint_error"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),error_type:f("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:p()}).describe("Defines a missing footprint error on the PCB");B(!0);var Tf=It.extend({type:f("external_footprint_load_error"),external_footprint_load_error_id:j("external_footprint_load_error"),pcb_component_id:p(),source_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),footprinter_string:p().optional(),error_type:f("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load");B(!0);var Wf=It.extend({type:f("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:j("circuit_json_footprint_load_error"),pcb_component_id:p(),source_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),error_type:f("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:X(sy()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load");B(!0);var Of=M({type:f("pcb_group"),pcb_group_id:j("pcb_group"),source_group_id:p(),is_subcircuit:R().optional(),subcircuit_id:p().optional(),width:q.optional(),height:q.optional(),center:J,display_offset_x:p().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:p().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:X(J).optional(),anchor_position:J.optional(),anchor_alignment:Qe.default("center"),position_mode:_t(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:p().optional(),positioned_relative_to_pcb_board_id:p().optional(),pcb_component_ids:X(p()),child_layout_mode:_t(["packed","none"]).optional(),name:p().optional(),description:p().optional(),layout_mode:p().optional(),autorouter_configuration:M({trace_clearance:q}).optional(),autorouter_used_string:p().optional()}).describe("Defines a group of components on the PCB");B(!0);var jf=It.extend({type:f("pcb_autorouting_error"),pcb_error_id:j("pcb_autorouting_error"),error_type:f("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:p().optional()}).describe("The autorouting has failed to route a portion of the board");B(!0);var Rf=It.extend({type:f("pcb_preflight_routing_error"),pcb_preflight_routing_error_id:j("pcb_preflight_routing_error"),error_type:f("pcb_preflight_routing_error").default("pcb_preflight_routing_error"),error_code:p(),subcircuit_id:p().optional(),pcb_group_id:p().optional(),routing_phase_index:w().int().optional(),phase_name:p().optional(),source_trace_ids:X(p()).optional(),pcb_component_ids:X(p()).optional(),pcb_port_ids:X(p()).optional(),related_error_ids:X(p()).optional(),measurements:Dr(w().finite()).optional()});B(!0);var Cf=M({type:f("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:j("pcb_manual_edit_conflict_warning"),warning_type:f("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:p(),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),source_component_id:p()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates");B(!0);var _y=_t(["x-","x+","y+","y-"]),Xf=M({type:f("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:j("pcb_connector_not_in_accessible_orientation_warning"),warning_type:f("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:p(),pcb_component_id:p(),source_component_id:p().optional(),pcb_board_id:p().optional(),facing_direction:_y,recommended_facing_direction:_y,subcircuit_id:p().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction");B(!0);var $f=M({type:f("pcb_component_missing_courtyard_warning"),pcb_component_missing_courtyard_warning_id:j("pcb_component_missing_courtyard_warning"),warning_type:f("pcb_component_missing_courtyard_warning").default("pcb_component_missing_courtyard_warning"),message:p(),pcb_component_id:p(),source_component_id:p().optional(),subcircuit_id:p().optional()}).describe("Warning emitted when a PCB component has no courtyard geometry");B(!0);var Nf=M({type:f("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:j("supplier_footprint_mismatch_warning"),warning_type:f("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:p(),source_component_id:p(),pcb_component_id:p().optional(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),supplier_name:Hr.optional(),supplier_part_number:p().optional(),supplier_footprint_url:p().optional(),footprint_copper_intersection_over_union:w()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint");B(!0);var Vf=M({type:f("pcb_fabricator_extra_charge_warning"),pcb_fabricator_extra_charge_warning_id:j("pcb_fabricator_extra_charge_warning"),warning_type:f("pcb_fabricator_extra_charge_warning").default("pcb_fabricator_extra_charge_warning"),message:p(),fabricator_preset:p(),pcb_board_id:p().optional(),pcb_via_ids:X(p()).optional(),subcircuit_id:p().optional()}).describe("Warning that a design feature incurs an extra charge for the selected fabricator preset, such as via hole diameters below 0.3 mm with JLCPCB economy or standard presets.");B(!0);var zf=M({type:f("pcb_breakout_point"),pcb_breakout_point_id:j("pcb_breakout_point"),pcb_group_id:p(),subcircuit_id:p().optional(),source_trace_id:p().optional(),source_port_id:p().optional(),source_net_id:p().optional(),layer:gt.optional(),x:L,y:L}).describe("Defines a routing target within a pcb_group for a source_trace or source_net");B(!0);var Df=M({type:f("pcb_ground_plane"),pcb_ground_plane_id:j("pcb_ground_plane"),source_pcb_ground_plane_id:p(),source_net_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional()}).describe("Defines a ground plane on the PCB");B(!0);var Qf=M({type:f("pcb_ground_plane_region"),pcb_ground_plane_region_id:j("pcb_ground_plane_region"),pcb_ground_plane_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),layer:gt,points:X(J)}).describe("Defines a polygon region of a ground plane");B(!0);var Uf=M({type:f("pcb_thermal_spoke"),pcb_thermal_spoke_id:j("pcb_thermal_spoke"),pcb_ground_plane_id:p(),shape:p(),spoke_count:w(),spoke_thickness:L,spoke_inner_diameter:L,spoke_outer_diameter:L,pcb_plated_hole_id:p().optional(),subcircuit_id:p().optional()}).describe("Pattern for connecting a ground plane to a plated hole");B(!0);var gl=M({type:f("pcb_copper_pour"),pcb_copper_pour_id:j("pcb_copper_pour"),pcb_group_id:p().optional(),subcircuit_id:p().optional(),layer:gt,source_net_id:p().optional(),covered_with_solder_mask:R().optional().default(!0)}),Zf=gl.extend({shape:f("rect"),center:J,width:q,height:q,rotation:jt.optional()});B(!0);var Hf=gl.extend({shape:f("brep"),brep_shape:xl});B(!0);var Gf=gl.extend({shape:f("polygon"),points:X(J)});B(!0);var qf=de("shape",[Zf,Hf,Gf]).describe("Defines a copper pour on the PCB.");B(!0);var Kf=It.extend({type:f("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:j("pcb_component_outside_board_error"),error_type:f("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:p(),pcb_board_id:p(),component_center:J,component_bounds:M({min_x:w(),max_x:w(),min_y:w(),max_y:w()}),subcircuit_id:p().optional(),source_component_id:p().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries");B(!0);var Jf=It.extend({type:f("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:j("pcb_component_not_on_board_edge_error"),error_type:f("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:p(),pcb_board_id:p(),component_center:J,pad_to_nearest_board_edge_distance:w(),source_component_id:p().optional(),subcircuit_id:p().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge");B(!0);var t9=It.extend({type:f("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:j("pcb_component_invalid_layer_error"),error_type:f("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:p().optional(),source_component_id:p(),layer:gt,subcircuit_id:p().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)");B(!0);var e9=It.extend({type:f("pcb_via_clearance_error"),pcb_error_id:j("pcb_error"),error_type:f("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:X(p()).min(2),minimum_clearance:L.optional(),actual_clearance:L.optional(),pcb_center:M({x:w().optional(),y:w().optional()}).optional(),subcircuit_id:p().optional()}).describe("Error emitted when vias are closer than the allowed clearance");B(!0);var r9=It.extend({type:f("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:j("pcb_via_trace_clearance_error"),error_type:f("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:p(),pcb_trace_id:p(),minimum_clearance:L.optional(),actual_clearance:L.optional(),center:M({x:w().optional(),y:w().optional()}).optional(),subcircuit_id:p().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance");B(!0);var i9=It.extend({type:f("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:j("pcb_pad_pad_clearance_error"),error_type:f("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:X(p()).min(2),minimum_clearance:L.optional(),actual_clearance:L.optional(),center:M({x:w().optional(),y:w().optional()}).optional(),subcircuit_id:p().optional()}).describe("Error emitted when pads are closer than the allowed clearance");B(!0);var n9=It.extend({type:f("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:j("pcb_pad_trace_clearance_error"),error_type:f("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:p(),pcb_trace_id:p(),minimum_clearance:L.optional(),actual_clearance:L.optional(),center:M({x:w().optional(),y:w().optional()}).optional(),subcircuit_id:p().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance");B(!0);var o9=M({type:f("pcb_courtyard_rect"),pcb_courtyard_rect_id:j("pcb_courtyard_rect"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,width:q,height:q,layer:Ht,ccw_rotation:jt.optional(),color:p().optional()}).describe("Defines a courtyard rectangle on the PCB");B(!0);var a9=M({type:f("pcb_courtyard_outline"),pcb_courtyard_outline_id:j("pcb_courtyard_outline"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),layer:Ht,outline:X(J).min(2)}).describe("Defines a courtyard outline on the PCB");B(!0);var s9=M({type:f("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:j("pcb_courtyard_polygon"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),layer:Ht,points:X(J).min(3),color:p().optional()}).describe("Defines a courtyard polygon on the PCB");B(!0);var c9=M({type:f("pcb_courtyard_circle"),pcb_courtyard_circle_id:j("pcb_courtyard_circle"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,radius:q,layer:Ht,color:p().optional()}).describe("Defines a courtyard circle on the PCB");B(!0);var l9=M({type:f("pcb_courtyard_pill"),pcb_courtyard_pill_id:j("pcb_courtyard_pill"),pcb_component_id:p(),pcb_group_id:p().optional(),subcircuit_id:p().optional(),center:J,width:q,height:q,radius:q,layer:Ht,color:p().optional()}).describe("Defines a courtyard pill on the PCB");B(!0);var $4=["obj","stl","3mf","gltf","glb","step","wrl"],p9=["x+","x-","y+","y-","z+","z-"],N4={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},d9=M({type:f("cad_component"),cad_component_id:p(),pcb_component_id:p().optional().describe("Optional PCB component reference; omit for CAD geometry without a PCB component"),source_component_id:p(),position:Ae,rotation:Ae.optional(),is_on_folded_board:R().optional().describe("True when position and rotation describe the assembled folded board pose. False or omitted means the flat board pose. PCB records remain flat; pcb_component_id identifies the flat mount and owning board for reversible transforms."),size:Ae.optional(),layer:gt.optional(),subcircuit_id:p().optional(),footprinter_string:p().optional(),model_obj_url:p().optional(),model_stl_url:p().optional(),model_3mf_url:p().optional(),model_gltf_url:p().optional(),model_glb_url:p().optional(),model_step_url:p().optional(),model_wrl_url:p().optional(),model_asset:on.optional(),model_unit_to_mm_scale_factor:w().optional(),model_board_normal_direction:_t(p9).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:Ae.optional(),model_origin_alignment:_t(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:_t(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:sy().optional(),color:p().trim().min(1).optional().describe("Explicit color override for CAD geometry, including authored JSCAD material colors. Omit to preserve model materials."),show_as_translucent_model:R().optional(),show_as_bounding_box:R().optional(),show_hidden_edges:R().optional(),anchor_alignment:_t(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines CAD geometry, optionally associated with a PCB component");B(!0);var h9=It.extend({type:f("cad_collision_error"),cad_collision_error_id:j("cad_collision_error"),error_type:f("cad_collision_error").default("cad_collision_error"),cad_component_ids:X(p()).min(1),pcb_component_ids:X(p()).optional(),source_component_ids:X(p()).min(1),intersection_area_mm2:w().finite().nonnegative(),threshold_area_mm2:w().finite().nonnegative()}).describe("An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies.");B(!0);var my=Ae.refine((t)=>[t.x,t.y,t.z].every(Number.isFinite),"Connector pin 1 positions must be finite").describe("Resolved pin 1 position at the connector mating face, in right-handed circuit world, millimeters: +X right, +Y top, +Z above. An absolute point, not a direction. Computed by the circuit producer from endpoint geometry. Together with the endpoint path tangent, fixes connector roll and identifies its pin 1 side; renderers must not infer it from footprints."),u9=M({type:f("cad_cable"),cad_cable_id:p(),name:p().min(1),from_source_component_id:p(),to_source_component_id:p(),from_connector_pin1_position:my.optional(),to_connector_pin1_position:my.optional(),cableprinter_string:p().min(1).describe('Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'),path:X(Ae).min(2).refine((t)=>t.every((e,r)=>[e.x,e.y,e.z].every(Number.isFinite)&&(r===0||Math.hypot(e.x-t[r-1].x,e.y-t[r-1].y,e.z-t[r-1].z)>0.00000001)),"Cable paths require finite, distinct consecutive points").describe("Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path.")}).describe("A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping.");B(!0);var y9=0.000001,fy=M({x:w().finite(),y:w().finite(),z:w().finite()}).refine((t)=>Math.abs(Math.hypot(t.x,t.y,t.z)-1)<=y9,"Reference surface directions must be unit vectors"),xy=L.pipe(w().finite().positive()),_9=M({type:f("cad_reference_surface"),cad_reference_surface_id:p().min(1),source_component_id:p().min(1).describe("Owning assembly part's source component ID. The part may have no CAD geometry."),name:p().trim().min(1).describe("Reference name, unique within the owning part, e.g. shade in STEM.shade."),shape:f("rect"),center:Ae.refine((t)=>[t.x,t.y,t.z].every(Number.isFinite),"Reference surface centers must be finite").describe("Resolved surface center in right-handed circuit-world XYZ, millimeters: +X right, +Y top, +Z above. An absolute point after assembly placement."),normal:fy.describe("Outward unit normal in circuit-world XYZ. Dimensionless direction; transform with the part's rotation, without translation."),x_axis:fy.describe("In-plane unit X direction in circuit-world XYZ, perpendicular to normal. The second tangent is normal cross x_axis, giving a right-handed frame."),width:xy.optional().describe("Rectangular extent along x_axis in millimeters. Supply together with height. Omission leaves the surface's display size unspecified."),height:xy.optional().describe("Rectangular extent along normal cross x_axis in millimeters. Supply together with width."),subcircuit_id:p().optional()}).superRefine((t,e)=>{if(t.width===void 0!==(t.height===void 0))e.addIssue({code:z.custom,path:["width"],message:"Provide width and height together"});let{normal:r,x_axis:i}=t;if(Math.abs(r.x*i.x+r.y*i.y+r.z*i.z)>y9)e.addIssue({code:z.custom,path:["x_axis"],message:"x_axis must be perpendicular to normal"})}).describe("A named assembly mounting surface with a resolved world-space frame. Reference geometry for optional visualization; does not add solid material or electrical connectivity. The producer resolves part placement independently of CAD-model offsets; renderers consume the world frame without reapplying the owning model's transform.");B(!0);var bl=_t(["sinewave","square","triangle","sawtooth"]),V4=Xt([p(),w()]).transform((t)=>{if(typeof t==="string"){if(t.endsWith("%"))return parseFloat(t.slice(0,-1))/100;return parseFloat(t)}return t}).pipe(w().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),m9=M({type:f("simulation_voltage_source"),simulation_voltage_source_id:j("simulation_voltage_source"),is_dc_source:f(!0).optional().default(!0),positive_source_port_id:p().optional(),negative_source_port_id:p().optional(),positive_source_net_id:p().optional(),negative_source_net_id:p().optional(),voltage:Fe,ac_magnitude:Fe.optional(),ac_phase:jt.optional()}).describe("Defines a DC voltage source for simulation"),f9=M({type:f("simulation_voltage_source"),simulation_voltage_source_id:j("simulation_voltage_source"),is_dc_source:f(!1),terminal1_source_port_id:p().optional(),terminal2_source_port_id:p().optional(),terminal1_source_net_id:p().optional(),terminal2_source_net_id:p().optional(),voltage:Fe.optional(),frequency:gr.optional(),peak_to_peak_voltage:Fe.optional(),wave_shape:bl.optional(),phase:jt.optional(),duty_cycle:V4.optional(),pulse_delay:te.optional(),rise_time:te.optional(),fall_time:te.optional(),pulse_width:te.optional(),period:te.optional(),ac_magnitude:Fe.optional(),ac_phase:jt.optional()}).describe("Defines an AC voltage source for simulation"),x9=Xt([m9,f9]).describe("Defines a voltage source for simulation");B(!0);B(!0);B(!0);var z4=Xt([p(),w()]).transform((t)=>{if(typeof t==="string"){if(t.endsWith("%"))return parseFloat(t.slice(0,-1))/100;return parseFloat(t)}return t}).pipe(w().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),g9=M({type:f("simulation_current_source"),simulation_current_source_id:j("simulation_current_source"),is_dc_source:f(!0).optional().default(!0),positive_source_port_id:p().optional(),negative_source_port_id:p().optional(),positive_source_net_id:p().optional(),negative_source_net_id:p().optional(),current:sr,ac_magnitude:sr.optional(),ac_phase:jt.optional()}).describe("Defines a DC current source for simulation"),b9=M({type:f("simulation_current_source"),simulation_current_source_id:j("simulation_current_source"),is_dc_source:f(!1),terminal1_source_port_id:p().optional(),terminal2_source_port_id:p().optional(),terminal1_source_net_id:p().optional(),terminal2_source_net_id:p().optional(),current:sr.optional(),frequency:gr.optional(),peak_to_peak_current:sr.optional(),wave_shape:bl.optional(),phase:jt.optional(),duty_cycle:z4.optional(),ac_magnitude:sr.optional(),ac_phase:jt.optional()}).describe("Defines an AC current source for simulation"),v9=Xt([g9,b9]).describe("Defines a current source for simulation");B(!0);B(!0);B(!0);var ro=ay((t)=>t==="V"||t==="A"),vl=ay((t)=>t==="Ω"||t==="F"||t==="H"||t==="V"||t==="A"),w9=Xt([f("spice_dc_sweep"),f("spice_dc_operating_point"),f("spice_transient_analysis"),f("spice_ac_analysis"),f("pcb_return_current")]),A9=M({method:_t(["trap","gear"]).optional(),reltol:Xt([w(),p()]).optional(),abstol:Xt([w(),p()]).optional(),vntol:Xt([w(),p()]).optional()}).describe("SPICE solver options for a simulation experiment"),F9=M({type:f("simulation_experiment"),simulation_experiment_id:j("simulation_experiment"),name:p(),experiment_type:w9,time_per_step:Zr.optional(),start_time_ms:te.optional(),end_time_ms:te.optional(),spice_options:A9.optional(),dc_sweep_voltage_source_id:p().optional(),dc_sweep_current_source_id:p().optional(),dc_sweep_start:w().optional(),dc_sweep_stop:w().optional(),dc_sweep_step:w().refine((t)=>t!==0).optional(),dc_sweep_unit:ro.optional(),ac_sweep_type:_t(["linear","decade","octave"]).optional(),ac_samples_per_interval:w().int().positive().optional(),ac_sample_count:w().int().positive().optional(),ac_start_frequency_hz:w().positive().optional(),ac_stop_frequency_hz:w().positive().optional()}).superRefine((t,e)=>{if(t.experiment_type==="spice_dc_sweep"){let r=["dc_sweep_start","dc_sweep_stop","dc_sweep_step","dc_sweep_unit"];for(let o of r)if(t[o]===void 0)e.addIssue({code:z.custom,path:[o],message:`${o} is required for a DC sweep`});let i=t.dc_sweep_voltage_source_id!==void 0,n=t.dc_sweep_current_source_id!==void 0;if(i===n)e.addIssue({code:z.custom,path:["dc_sweep_voltage_source_id"],message:"Exactly one DC sweep voltage or current source ID is required"})}if(t.experiment_type==="spice_ac_analysis"){if(t.ac_sweep_type===void 0)e.addIssue({code:z.custom,path:["ac_sweep_type"],message:"ac_sweep_type is required for an AC analysis"});if(t.ac_start_frequency_hz===void 0)e.addIssue({code:z.custom,path:["ac_start_frequency_hz"],message:"ac_start_frequency_hz is required for an AC analysis"});if(t.ac_stop_frequency_hz===void 0)e.addIssue({code:z.custom,path:["ac_stop_frequency_hz"],message:"ac_stop_frequency_hz is required for an AC analysis"});if(t.ac_sweep_type==="linear"&&t.ac_sample_count===void 0)e.addIssue({code:z.custom,path:["ac_sample_count"],message:"ac_sample_count is required for a linear AC analysis"});if((t.ac_sweep_type==="decade"||t.ac_sweep_type==="octave")&&t.ac_samples_per_interval===void 0)e.addIssue({code:z.custom,path:["ac_samples_per_interval"],message:"ac_samples_per_interval is required for decade and octave AC analyses"})}}).describe("Defines a simulation experiment configuration");B(!0);var Ue=M({simulation_parameter_sweep_id:p(),sweep_index:w().int().nonnegative(),parameter_value:w(),parameter_unit:vl});B(!0);var B9=M({type:f("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:j("simulation_transient_voltage_graph"),simulation_experiment_id:p(),simulation_parameter_sweep_coordinate:Ue.optional(),timestamps_ms:X(w()).optional(),voltage_levels:X(w()),source_component_id:p().optional(),subcircuit_connectivity_map_key:p().optional(),time_per_step:Zr,start_time_ms:te,end_time_ms:te,name:p().optional(),color:p().optional()}).describe("Stores voltage measurements over time for a simulation");B(!0);var S9=M({type:f("simulation_transient_current_graph"),simulation_transient_current_graph_id:j("simulation_transient_current_graph"),simulation_experiment_id:p(),simulation_parameter_sweep_coordinate:Ue.optional(),timestamps_ms:X(w()).optional(),current_levels:X(w()),source_component_id:p().optional(),subcircuit_connectivity_map_key:p().optional(),time_per_step:Zr,start_time_ms:te,end_time_ms:te,name:p().optional(),color:p().optional()}).describe("Stores current measurements over time for a simulation");B(!0);var k9=M({type:f("simulation_switch"),simulation_switch_id:j("simulation_switch"),source_component_id:p().optional(),closes_at:te.optional(),opens_at:te.optional(),starts_closed:R().optional(),switching_frequency:gr.optional()}).describe("Defines a switch for simulation timing control");B(!0);var Y9=M({type:f("simulation_voltage_probe"),simulation_voltage_probe_id:j("simulation_voltage_probe"),source_component_id:p().optional(),name:p().optional(),signal_input_source_port_id:p().optional(),signal_input_source_net_id:p().optional(),reference_input_source_port_id:p().optional(),reference_input_source_net_id:p().optional(),subcircuit_id:p().optional(),color:p().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((t,e)=>{if(t.reference_input_source_port_id||t.reference_input_source_net_id){let i=!!t.signal_input_source_port_id||!!t.reference_input_source_port_id,n=!!t.signal_input_source_net_id||!!t.reference_input_source_net_id;if(i&&n)e.addIssue({code:z.custom,message:"Cannot mix port and net connections in a differential probe."});else if(i){if(!t.signal_input_source_port_id||!t.reference_input_source_port_id)e.addIssue({code:z.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."})}else if(n){if(!t.signal_input_source_net_id||!t.reference_input_source_net_id)e.addIssue({code:z.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}}else if(!!t.signal_input_source_port_id===!!t.signal_input_source_net_id)e.addIssue({code:z.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})});B(!0);var M9=M({type:f("simulation_current_probe"),simulation_current_probe_id:j("simulation_current_probe"),source_component_id:p().optional(),name:p().optional(),positive_source_port_id:p().optional(),negative_source_port_id:p().optional(),positive_source_net_id:p().optional(),negative_source_net_id:p().optional(),subcircuit_id:p().optional(),color:p().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((t,e)=>{let r=!!t.positive_source_port_id,i=!!t.negative_source_port_id,n=!!t.positive_source_net_id,o=!!t.negative_source_net_id,a=r||i,s=n||o;if(a&&s){e.addIssue({code:z.custom,message:"Cannot mix port and net connections in a current probe."});return}if(a){if(!r||!i)e.addIssue({code:z.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(s){if(!n||!o)e.addIssue({code:z.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}e.addIssue({code:z.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})});B(!0);var I9=It.extend({type:f("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:j("simulation_unknown_experiment_error"),error_type:f("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:p().optional(),subcircuit_id:p().optional()}).describe("An unknown error occurred during the simulation experiment.");B(!0);var D4=_t(["resistance","capacitance","inductance","voltage","current"]),en=M({type:f("simulation_parameter_sweep"),simulation_parameter_sweep_id:j("simulation_parameter_sweep"),simulation_experiment_id:p(),name:p().optional(),parameter_values:X(w()).min(1),parameter_unit:vl}),L9=de("parameter_type",[en.extend({parameter_type:f("resistance"),resistor_source_component_id:p()}),en.extend({parameter_type:f("capacitance"),capacitor_source_component_id:p()}),en.extend({parameter_type:f("inductance"),inductor_source_component_id:p()}),en.extend({parameter_type:f("voltage"),source_net_id:p()}),en.extend({parameter_type:f("current"),current_source_component_id:p()})]).describe("Repeats a simulation experiment over component parameter values");B(!0);var E9=M({type:f("simulation_dc_operating_point_voltage"),simulation_dc_operating_point_voltage_id:j("simulation_dc_operating_point_voltage"),simulation_experiment_id:p(),simulation_parameter_sweep_coordinate:Ue.optional(),simulation_voltage_probe_id:p(),voltage:w(),name:p().optional(),color:p().optional()});B(!0);var P9=M({type:f("simulation_dc_operating_point_current"),simulation_dc_operating_point_current_id:j("simulation_dc_operating_point_current"),simulation_experiment_id:p(),simulation_parameter_sweep_coordinate:Ue.optional(),simulation_current_probe_id:p(),current:w(),name:p().optional(),color:p().optional()});B(!0);var T9=M({type:f("simulation_dc_sweep_voltage_graph"),simulation_dc_sweep_voltage_graph_id:j("simulation_dc_sweep_voltage_graph"),simulation_experiment_id:p(),simulation_parameter_sweep_coordinate:Ue.optional(),simulation_voltage_probe_id:p(),sweep_values:X(w()),sweep_unit:ro,voltage_levels:X(w()),name:p().optional(),color:p().optional()}).refine((t)=>t.sweep_values.length===t.voltage_levels.length,{message:"sweep_values and voltage_levels must have the same length"});B(!0);var W9=M({type:f("simulation_dc_sweep_current_graph"),simulation_dc_sweep_current_graph_id:j("simulation_dc_sweep_current_graph"),simulation_experiment_id:p(),simulation_parameter_sweep_coordinate:Ue.optional(),simulation_current_probe_id:p(),sweep_values:X(w()),sweep_unit:ro,current_levels:X(w()),name:p().optional(),color:p().optional()}).refine((t)=>t.sweep_values.length===t.current_levels.length,{message:"sweep_values and current_levels must have the same length"});B(!0);var wl=M({re:w(),im:w()});B(!0);var O9=M({type:f("simulation_ac_sweep_voltage_graph"),simulation_ac_sweep_voltage_graph_id:j("simulation_ac_sweep_voltage_graph"),simulation_experiment_id:p(),simulation_parameter_sweep_coordinate:Ue.optional(),simulation_voltage_probe_id:p(),frequencies_hz:X(w()),complex_voltages:X(wl),name:p().optional(),color:p().optional()}).refine((t)=>t.frequencies_hz.length===t.complex_voltages.length,{message:"frequencies_hz and complex_voltages must have the same length"});B(!0);var j9=M({type:f("simulation_ac_sweep_current_graph"),simulation_ac_sweep_current_graph_id:j("simulation_ac_sweep_current_graph"),simulation_experiment_id:p(),simulation_parameter_sweep_coordinate:Ue.optional(),simulation_current_probe_id:p(),frequencies_hz:X(w()),complex_currents:X(wl),name:p().optional(),color:p().optional()}).refine((t)=>t.frequencies_hz.length===t.complex_currents.length,{message:"frequencies_hz and complex_currents must have the same length"});B(!0);var R9=M({type:f("simulation_op_amp"),simulation_op_amp_id:j("simulation_op_amp"),source_component_id:p().optional(),inverting_input_source_port_id:p(),non_inverting_input_source_port_id:p(),output_source_port_id:p(),positive_supply_source_port_id:p(),negative_supply_source_port_id:p()}).describe("Defines a simple ideal operational amplifier for simulation");B(!0);var C9=M({type:f("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:j("simulation_spice_subcircuit"),source_component_id:p(),spice_pin_to_source_port_map:Dr(p(),p()),subcircuit_source:p()}).describe("Defines a custom SPICE subcircuit model for simulation");B(!0);var gy=(t)=>t!==void 0,X9=M({type:f("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:j("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:p().optional(),simulation_transient_current_graph_id:p().optional(),simulation_voltage_probe_id:p().optional(),simulation_current_probe_id:p().optional(),display_name:p().optional(),color:p().optional(),display_center_value:w().optional(),display_center_offset_divs:w().optional(),volts_per_div:w().positive().optional(),amps_per_div:w().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((t,e)=>{let r=[t.simulation_transient_voltage_graph_id,t.simulation_voltage_probe_id].filter(gy).length,i=[t.simulation_transient_current_graph_id,t.simulation_current_probe_id].filter(gy).length;if(r+i!==1)e.addIssue({code:z.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."});if(r>0&&t.amps_per_div!==void 0)e.addIssue({code:z.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."});if(i>0&&t.volts_per_div!==void 0)e.addIssue({code:z.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})});B(!0);var Ec=M({x:w().finite(),y:w().finite(),layer:gt}),Rc=de("contact_type",[Ec.extend({contact_type:f("pcb_port"),pcb_port_id:p().min(1)}),Ec.extend({contact_type:f("pcb_via"),pcb_via_id:p().min(1)}),Ec.extend({contact_type:f("pcb_copper_pour"),pcb_copper_pour_id:p().min(1)})]).describe("Identifies the reference conductor at a return-current contact");B(!0);var Cc=M({signal_pcb_port_id:p().min(1),reference_pcb_port_id:p().min(1).optional(),reference_layer:gt,resistance:w().finite().positive()}).describe("A two-terminal return-current excitation port with resistance in ohms");B(!0);var $9=M({type:f("simulation_return_current_excitation"),simulation_return_current_excitation_id:j("simulation_return_current_excitation"),simulation_experiment_id:p().min(1),pcb_trace_id:p().min(1),ground_source_net_id:p().min(1),current:w().finite(),return_source:Rc,return_sink:Rc,source_port:Cc.optional(),load_port:Cc.optional()}).describe("Excites a signal trace with signed current in amperes, peak for AC; return_source is near the load and return_sink near the driver for positive current");B(!0);var io=M({type:f("simulation_pcb_return_current_result"),simulation_pcb_return_current_result_id:j("simulation_pcb_return_current_result"),simulation_experiment_id:p().min(1),pcb_board_id:p().min(1),simulation_return_current_excitation_ids:X(p().min(1)).min(1).refine((t)=>new Set(t).size===t.length,"Excitation IDs must be unique"),frequency_hz:w().finite().positive().optional()}).describe("A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent");B(!0);function N9(t){return on.extend({project_relative_path:p().min(1),url:p().url()}).superRefine((e,r)=>{if(!t.includes(e.mimetype))r.addIssue({code:z.custom,path:["mimetype"],message:`Expected one of: ${t.join(", ")}`});if(e.url.startsWith("data:")){if(/^data:([^;,]*)(?:;[^,]*)?,/i.exec(e.url)?.[1]?.toLowerCase()!==e.mimetype)r.addIssue({code:z.custom,path:["url"],message:"Data URL media type must match asset.mimetype"})}})}var V9=N9(["application/json","application/gzip"]),Al=N9(["image/png","image/webp"]),an=M({type:f("simulation_pcb_return_current_field"),simulation_pcb_return_current_field_id:j("simulation_pcb_return_current_field"),simulation_pcb_return_current_result_id:p().min(1),layer:gt,source_net_id:p().min(1),field_type:_t(["real","complex_phasor"]),min_x:w().finite(),min_y:w().finite(),columns:w().int().positive().safe(),rows:w().int().positive().safe(),cell_width:w().finite().positive(),cell_height:w().finite().positive(),copper_thickness:w().finite().positive(),data_format:f("simulation_return_current_grid_json_v1"),field_asset:V9}).superRefine((t,e)=>{if(!Number.isSafeInteger(t.columns*t.rows))e.addIssue({code:z.custom,path:["columns"],message:"The grid cell count must be a safe integer"})}).describe("A sampled sheet-current field in A/mm, using plain or gzipped JSON Asset URLs; dimensions are PCB millimeters");B(!0);var Qr=X(w().finite().nullable()).min(1),z9=de("field_type",[M({field_type:f("real"),sheet_current_x:Qr,sheet_current_y:Qr}),M({field_type:f("complex_phasor"),sheet_current_x_real:Qr,sheet_current_x_imag:Qr,sheet_current_y_real:Qr,sheet_current_y_imag:Qr})]).superRefine((t,e)=>{let r=t.field_type==="real"?[t.sheet_current_x,t.sheet_current_y]:[t.sheet_current_x_real,t.sheet_current_x_imag,t.sheet_current_y_real,t.sheet_current_y_imag],i=r[0];if(r.some((n)=>n.length!==i.length)){e.addIssue({code:z.custom,message:"Current channels must have equal lengths"});return}for(let n=0;n<i.length;n++){let o=i[n]===null;if(r.some((a)=>a[n]===null!==o)){e.addIssue({code:z.custom,message:`Cell ${n} must be null in every channel or finite in every channel`});return}}}).describe("Decoded real or complex sheet-current arrays with a shared conductor mask");B(!0);function no(t){let e=t.columns*t.rows;if(!Number.isSafeInteger(t.columns)||t.columns<=0||!Number.isSafeInteger(t.rows)||t.rows<=0||!Number.isSafeInteger(e))throw Error("Grid dimensions must be positive safe integers");return z9.superRefine((r,i)=>{if(r.field_type!==t.field_type)i.addIssue({code:z.custom,path:["field_type"],message:"Decoded field_type must match the parent field"});if((r.field_type==="real"?r.sheet_current_x:r.sheet_current_x_real).length!==e)i.addIssue({code:z.custom,message:`Each current channel must have ${e} entries (columns * rows)`})})}var oo=M({type:f("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_heatmap_id:j("simulation_pcb_return_current_heatmap"),simulation_pcb_return_current_result_id:p().min(1),layer:gt,source_net_id:p().min(1),min_x:w().finite(),min_y:w().finite(),max_x:w().finite(),max_y:w().finite(),image_asset:Al}).superRefine((t,e)=>{for(let r of["x","y"])if(t[`max_${r}`]<=t[`min_${r}`])e.addIssue({code:z.custom,path:[`max_${r}`],message:"Heatmap bounds must have positive width and height"})}).describe("A transparent PNG/WebP current-density overlay in A/mm²; the top-left pixel maps to (min_x, max_y)");B(!0);var by=M({type:f("simulation_pcb_return_current_marker"),simulation_pcb_return_current_marker_id:j("simulation_pcb_return_current_marker"),simulation_pcb_return_current_result_id:p().min(1),role:_t(["signal_source","signal_load","return_source","return_sink","signal_transition","return_transition"]),label:p().optional(),label_x:w().finite().optional(),label_y:w().finite().optional()}),ao=de("target_type",[by.extend({target_type:f("pcb_port"),pcb_port_id:p().min(1),layer:gt}),by.extend({target_type:f("pcb_via"),pcb_via_id:p().min(1),from_layer:gt,to_layer:gt})]).superRefine((t,e)=>{if(t.label_x===void 0!==(t.label_y===void 0))e.addIssue({code:z.custom,path:["label_x"],message:"label_x and label_y must be provided together"});if(t.target_type==="pcb_via"&&t.from_layer===t.to_layer)e.addIssue({code:z.custom,path:["to_layer"],message:"A via transition must connect distinct layers"})}).describe("A signal/return port or via highlight; markers do not assert measured via-transfer currents");B(!0);var D9=Xt([g_,ml,r_,x_,t_,e_,Jy,n_,i_,Uc,zc,Kn,Qc,Dc,Zc,Hc,Gc,Jc,tl,el,al,rl,il,nl,ol,Kc,qc,s_,l_,o_,sl,cl,ll,pl,p_,f_,dl,ul,hl,d_,h_,u_,y_,__,m_,yl,_l,a_,sm,dm,xm,Pf,Tf,Wf,Cf,Xf,$f,Nf,Vf,gm,Sf,kf,bm,Vm,Bm,Im,Lm,Em,Wm,Pm,Tm,Om,zm,wm,Am,Fm,Dm,Qm,qm,Km,Of,rf,nf,of,af,uf,sf,cf,lf,pf,hf,jm,Rm,Cm,Xm,Jm,tf,ef,$m,Nm,e9,r9,i9,n9,_f,yf,mf,ff,xf,gf,bf,vf,wf,jf,Rf,Af,Ff,zf,Ef,Df,Qf,Uf,qf,Kf,Jf,t9,o9,a9,s9,c9,l9,b_,P_,Y_,M_,I_,L_,S_,k_,T_,E_,v_,O_,j_,W_,$_,N_,V_,z_,D_,Q_,tm,U_,Z_,H_,J_,G_,q_,d9,u9,_9,h9,x9,v9,F9,$9,io,an,oo,ao,B9,S9,E9,P9,T9,W9,O9,j9,L9,k9,Y9,M9,X9,I9,R9,C9]),Gr=D9;B(!0);br(!0);function F(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function Q9(t){let{a:e,b:r,c:i,d:n,e:o,f:a}=t,s=e*n-r*i;return{a:n/s,b:r/-s,c:i/-s,d:e/s,e:(n*o-i*a)/-s,f:(r*o-e*a)/s}}function vr(t){return typeof t>"u"}function Yt(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function cr(...t){t=Array.isArray(t[0])?t[0]:t;let e=(r,i)=>({a:r.a*i.a+r.c*i.b,c:r.a*i.c+r.c*i.d,e:r.a*i.e+r.c*i.f+r.e,b:r.b*i.a+r.d*i.b,d:r.b*i.c+r.d*i.d,f:r.b*i.e+r.d*i.f+r.f});switch(t.length){case 0:throw Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{let[r,i,...n]=t,o=e(r,i);return cr(o,...n)}}}function Ft(...t){return cr(...t)}var{cos:Q4,sin:U4,PI:eV}=Math;function Gt(t,e,r){let i=Q4(t),n=U4(t),o={a:i,c:-n,e:0,b:n,d:i,f:0};if(vr(e)||vr(r))return o;return cr([Yt(e,r),o,Yt(-e,-r)])}function Vt(t,e=void 0,r=void 0,i=void 0){if(vr(e))e=t;let n={a:t,c:0,e:0,b:0,d:e,f:0};if(vr(r)||vr(i))return n;return cr([Yt(r,i),n,Yt(-r,-i)])}var{tan:cV}=Math;function U9(t){return oe(t)}function oe(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function Z9(t,e=10000000000){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function H9(t,e){let r=t[0].x!=null?t[0].x:t[0][0],i=t[0].y!=null?t[0].y:t[0][1],n=e[0].x!=null?e[0].x:e[0][0],o=e[0].y!=null?e[0].y:e[0][1],a=t[1].x!=null?t[1].x:t[1][0],s=t[1].y!=null?t[1].y:t[1][1],l=e[1].x!=null?e[1].x:e[1][0],c=e[1].y!=null?e[1].y:e[1][1],d=t[2].x!=null?t[2].x:t[2][0],h=t[2].y!=null?t[2].y:t[2][1],y=e[2].x!=null?e[2].x:e[2][0],_=e[2].y!=null?e[2].y:e[2][1],m={a:r-d,b:i-h,c:a-d,d:s-h,e:d,f:h},g={a:n-y,b:o-_,c:l-y,d:c-_,e:y,f:_},b=Q9(m),v=cr([g,b]);return Z9(v)}function H4(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function so(t,e,r,i){var n=Error.call(this,t);if(Object.setPrototypeOf)Object.setPrototypeOf(n,so.prototype);return n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}H4(so,Error);function Fl(t,e,r){if(r=r||" ",t.length>e)return t;return e-=t.length,r+=r.repeat(e),t+r.slice(0,e)}so.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r=null,i;for(i=0;i<t.length;i++)if(t[i].source===this.location.source){r=t[i].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(n):n,a=this.location.source+":"+o.line+":"+o.column;if(r){var s=this.location.end,l=Fl("",o.line.toString().length," "),c=r[n.line-1],d=n.line===s.line?s.column:c.length+1,h=d-n.column||1;e+=`
--> `+a+`
`+l+` |
`+o.line+" | "+c+`
`+l+" | "+Fl("",n.column-1," ")+Fl("",h,"^")}else e+=`
at `+a}return e};so.buildMessage=function(t,e){var r={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var d=c.parts.map(function(h){return Array.isArray(h)?o(h[0])+"-"+o(h[1]):o(h)});return"["+(c.inverted?"^":"")+d.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(c){return c.description}};function i(c){return c.charCodeAt(0).toString(16).toUpperCase()}function n(c){return c.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+i(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+i(d)})}function o(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+i(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+i(d)})}function a(c){return r[c.type](c)}function s(c){var d=c.map(a),h,y;if(d.sort(),d.length>0){for(h=1,y=1;h<d.length;h++)if(d[h-1]!==d[h])d[y]=d[h],y++;d.length=y}switch(d.length){case 1:return d[0];case 2:return d[0]+" or "+d[1];default:return d.slice(0,-1).join(", ")+", or "+d[d.length-1]}}function l(c){return c?'"'+n(c)+'"':"end of input"}return"Expected "+s(t)+" but "+l(e)+" found."};var Bl={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let t in Bl)Object.freeze(Bl[t]);var Be=Object.freeze(Bl);var G9=Object.create(null);for(let t in Be)if(Object.hasOwn(Be,t))G9[Be[t]]=t;var ye={to:{},get:{}};ye.get=function(t){let e=t.slice(0,3).toLowerCase(),r,i;switch(e){case"hsl":{r=ye.get.hsl(t),i="hsl";break}case"hwb":{r=ye.get.hwb(t),i="hwb";break}default:{r=ye.get.rgb(t),i="rgb";break}}if(!r)return null;return{model:i,value:r}};ye.get.rgb=function(t){if(!t)return null;let e=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,i=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,n=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,o=/^(\w+)$/,a=[0,0,0,1],s,l,c;if(s=t.match(r)){c=s[2],s=s[1];for(l=0;l<3;l++){let d=l*2;a[l]=Number.parseInt(s.slice(d,d+2),16)}if(c)a[3]=Number.parseInt(c,16)/255}else if(s=t.match(e)){s=s[1],c=s[3];for(l=0;l<3;l++)a[l]=Number.parseInt(s[l]+s[l],16);if(c)a[3]=Number.parseInt(c+c,16)/255}else if(s=t.match(i)){for(l=0;l<3;l++)a[l]=Number.parseFloat(s[l+1]);if(s[4])a[3]=s[5]?Number.parseFloat(s[4])*0.01:Number.parseFloat(s[4])}else if(s=t.match(n)){for(l=0;l<3;l++)a[l]=Math.round(Number.parseFloat(s[l+1])*2.55);if(s[4])a[3]=s[5]?Number.parseFloat(s[4])*0.01:Number.parseFloat(s[4])}else if(s=t.toLowerCase().match(o)){if(s[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(Be,s[1]))return null;return a=Be[s[1]].slice(),a[3]=1,a}else return null;for(l=0;l<3;l++)a[l]=lr(a[l],0,255);return a[3]=lr(a[3],0,1),a};ye.get.hsl=function(t){if(!t)return null;let e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=t.match(e);if(r){let i=Number.parseFloat(r[4]),n=(Number.parseFloat(r[1])%360+360)%360,o=lr(Number.parseFloat(r[2]),0,100),a=lr(Number.parseFloat(r[3]),0,100),s=lr(Number.isNaN(i)?1:i,0,1);return[n,o,a,s]}return null};ye.get.hwb=function(t){if(!t)return null;let e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=t.match(e);if(r){let i=Number.parseFloat(r[4]),n=(Number.parseFloat(r[1])%360+360)%360,o=lr(Number.parseFloat(r[2]),0,100),a=lr(Number.parseFloat(r[3]),0,100),s=lr(Number.isNaN(i)?1:i,0,1);return[n,o,a,s]}return null};ye.to.hex=function(...t){return"#"+co(t[0])+co(t[1])+co(t[2])+(t[3]<1?co(Math.round(t[3]*255)):"")};ye.to.rgb=function(...t){return t.length<4||t[3]===1?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"};ye.to.rgb.percent=function(...t){let e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||t[3]===1?"rgb("+e+"%, "+r+"%, "+i+"%)":"rgba("+e+"%, "+r+"%, "+i+"%, "+t[3]+")"};ye.to.hsl=function(...t){return t.length<4||t[3]===1?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};ye.to.hwb=function(...t){let e="";if(t.length>=4&&t[3]!==1)e=", "+t[3];return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"};ye.to.keyword=function(...t){return G9[t.slice(0,3)]};function lr(t,e,r){return Math.min(Math.max(e,t),r)}function co(t){let e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}var wr=ye;var q9={};for(let t of Object.keys(Be))q9[Be[t]]=t;var st={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},He=st,Ze=0.008856451679035631;function Kr(t){let e=t>0.0031308?1.055*t**0.4166666666666667-0.055:t*12.92;return Math.min(Math.max(0,e),1)}function Jr(t){return t>0.04045?((t+0.055)/1.055)**2.4:t/12.92}for(let t of Object.keys(st)){if(!("channels"in st[t]))throw Error("missing channels property: "+t);if(!("labels"in st[t]))throw Error("missing channel labels property: "+t);if(st[t].labels.length!==st[t].channels)throw Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=st[t];delete st[t].channels,delete st[t].labels,Object.defineProperty(st[t],"channels",{value:e}),Object.defineProperty(st[t],"labels",{value:r})}st.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),o=Math.max(e,r,i),a=o-n,s,l;switch(o){case n:{s=0;break}case e:{s=(r-i)/a;break}case r:{s=2+(i-e)/a;break}case i:{s=4+(e-r)/a;break}}if(s=Math.min(s*60,360),s<0)s+=360;let c=(n+o)/2;if(o===n)l=0;else if(c<=0.5)l=a/(o+n);else l=a/(2-o-n);return[s,l*100,c*100]};st.rgb.hsv=function(t){let e,r,i,n,o,a=t[0]/255,s=t[1]/255,l=t[2]/255,c=Math.max(a,s,l),d=c-Math.min(a,s,l),h=function(y){return(c-y)/6/d+0.5};if(d===0)n=0,o=0;else{switch(o=d/c,e=h(a),r=h(s),i=h(l),c){case a:{n=i-r;break}case s:{n=0.3333333333333333+e-i;break}case l:{n=0.6666666666666666+r-e;break}}if(n<0)n+=1;else if(n>1)n-=1}return[n*360,o*100,c*100]};st.rgb.hwb=function(t){let e=t[0],r=t[1],i=t[2],n=st.rgb.hsl(t)[0],o=0.00392156862745098*Math.min(e,Math.min(r,i));return i=1-0.00392156862745098*Math.max(e,Math.max(r,i)),[n,o*100,i*100]};st.rgb.oklab=function(t){let e=Jr(t[0]/255),r=Jr(t[1]/255),i=Jr(t[2]/255),n=Math.cbrt(0.4122214708*e+0.5363325363*r+0.0514459929*i),o=Math.cbrt(0.2119034982*e+0.6806995451*r+0.1073969566*i),a=Math.cbrt(0.0883024619*e+0.2817188376*r+0.6299787005*i),s=0.2104542553*n+0.793617785*o-0.0040720468*a,l=1.9779984951*n-2.428592205*o+0.4505937099*a,c=0.0259040371*n+0.7827717662*o-0.808675766*a;return[s*100,l*100,c*100]};st.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(1-e,1-r,1-i),o=(1-e-n)/(1-n)||0,a=(1-r-n)/(1-n)||0,s=(1-i-n)/(1-n)||0;return[o*100,a*100,s*100,n*100]};function G4(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}st.rgb.keyword=function(t){let e=q9[t];if(e)return e;let r=Number.POSITIVE_INFINITY,i;for(let n of Object.keys(Be)){let o=Be[n],a=G4(t,o);if(a<r)r=a,i=n}return i};st.keyword.rgb=function(t){return[...Be[t]]};st.rgb.xyz=function(t){let e=Jr(t[0]/255),r=Jr(t[1]/255),i=Jr(t[2]/255),n=e*0.4124564+r*0.3575761+i*0.1804375,o=e*0.2126729+r*0.7151522+i*0.072175,a=e*0.0193339+r*0.119192+i*0.9503041;return[n*100,o*100,a*100]};st.rgb.lab=function(t){let e=st.rgb.xyz(t),r=e[0],i=e[1],n=e[2];r/=95.047,i/=100,n/=108.883,r=r>Ze?r**0.3333333333333333:7.787*r+0.13793103448275862,i=i>Ze?i**0.3333333333333333:7.787*i+0.13793103448275862,n=n>Ze?n**0.3333333333333333:7.787*n+0.13793103448275862;let o=116*i-16,a=500*(r-i),s=200*(i-n);return[o,a,s]};st.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100,n,o;if(r===0)return o=i*255,[o,o,o];let a=i<0.5?i*(1+r):i+r-i*r,s=2*i-a,l=[0,0,0];for(let c=0;c<3;c++){if(n=e+0.3333333333333333*-(c-1),n<0)n++;if(n>1)n--;if(6*n<1)o=s+(a-s)*6*n;else if(2*n<1)o=a;else if(3*n<2)o=s+(a-s)*(0.6666666666666666-n)*6;else o=s;l[c]=o*255}return l};st.hsl.hsv=function(t){let e=t[0],r=t[1]/100,i=t[2]/100,n=r,o=Math.max(i,0.01);i*=2,r*=i<=1?i:2-i,n*=o<=1?o:2-o;let a=(i+r)/2,s=i===0?2*n/(o+n):2*r/(i+r);return[e,s*100,a*100]};st.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,i=t[2]/100,n=Math.floor(e)%6,o=e-Math.floor(e),a=255*i*(1-r),s=255*i*(1-r*o),l=255*i*(1-r*(1-o));switch(i*=255,n){case 0:return[i,l,a];case 1:return[s,i,a];case 2:return[a,i,l];case 3:return[a,s,i];case 4:return[l,a,i];case 5:return[i,a,s]}};st.hsv.hsl=function(t){let e=t[0],r=t[1]/100,i=t[2]/100,n=Math.max(i,0.01),o,a;a=(2-r)*i;let s=(2-r)*n;return o=r*n,o/=s<=1?s:2-s,o=o||0,a/=2,[e,o*100,a*100]};st.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100,n=r+i,o;if(n>1)r/=n,i/=n;let a=Math.floor(6*e),s=1-i;if(o=6*e-a,(a&1)!==0)o=1-o;let l=r+o*(s-r),c,d,h;switch(a){default:case 6:case 0:{c=s,d=l,h=r;break}case 1:{c=l,d=s,h=r;break}case 2:{c=r,d=s,h=l;break}case 3:{c=r,d=l,h=s;break}case 4:{c=l,d=r,h=s;break}case 5:{c=s,d=r,h=l;break}}return[c*255,d*255,h*255]};st.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n=t[3]/100,o=1-Math.min(1,e*(1-n)+n),a=1-Math.min(1,r*(1-n)+n),s=1-Math.min(1,i*(1-n)+n);return[o*255,a*255,s*255]};st.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n,o,a;return n=e*3.2404542+r*-1.5371385+i*-0.4985314,o=e*-0.969266+r*1.8760108+i*0.041556,a=e*0.0556434+r*-0.2040259+i*1.0572252,n=Kr(n),o=Kr(o),a=Kr(a),[n*255,o*255,a*255]};st.xyz.lab=function(t){let e=t[0],r=t[1],i=t[2];e/=95.047,r/=100,i/=108.883,e=e>Ze?e**0.3333333333333333:7.787*e+0.13793103448275862,r=r>Ze?r**0.3333333333333333:7.787*r+0.13793103448275862,i=i>Ze?i**0.3333333333333333:7.787*i+0.13793103448275862;let n=116*r-16,o=500*(e-r),a=200*(r-i);return[n,o,a]};st.xyz.oklab=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n=Math.cbrt(0.8189330101*e+0.3618667424*r-0.1288597137*i),o=Math.cbrt(0.0329845436*e+0.9293118715*r+0.0361456387*i),a=Math.cbrt(0.0482003018*e+0.2643662691*r+0.633851707*i),s=0.2104542553*n+0.793617785*o-0.0040720468*a,l=1.9779984951*n-2.428592205*o+0.4505937099*a,c=0.0259040371*n+0.7827717662*o-0.808675766*a;return[s*100,l*100,c*100]};st.oklab.oklch=function(t){return st.lab.lch(t)};st.oklab.xyz=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n=(0.999999998*e+0.396337792*r+0.215803758*i)**3,o=(1.000000008*e-0.105561342*r-0.063854175*i)**3,a=(1.000000055*e-0.089484182*r-1.291485538*i)**3,s=1.227013851*n-0.55779998*o+0.281256149*a,l=-0.040580178*n+1.11225687*o-0.071676679*a,c=-0.076381285*n-0.421481978*o+1.58616322*a;return[s*100,l*100,c*100]};st.oklab.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n=(e+0.3963377774*r+0.2158037573*i)**3,o=(e-0.1055613458*r-0.0638541728*i)**3,a=(e-0.0894841775*r-1.291485548*i)**3,s=Kr(4.0767416621*n-3.3077115913*o+0.2309699292*a),l=Kr(-1.2684380046*n+2.6097574011*o-0.3413193965*a),c=Kr(-0.0041960863*n-0.7034186147*o+1.707614701*a);return[s*255,l*255,c*255]};st.oklch.oklab=function(t){return st.lch.lab(t)};st.lab.xyz=function(t){let e=t[0],r=t[1],i=t[2],n,o,a;o=(e+16)/116,n=r/500+o,a=o-i/200;let s=o**3,l=n**3,c=a**3;return o=s>Ze?s:(o-0.13793103448275862)/7.787,n=l>Ze?l:(n-0.13793103448275862)/7.787,a=c>Ze?c:(a-0.13793103448275862)/7.787,n*=95.047,o*=100,a*=108.883,[n,o,a]};st.lab.lch=function(t){let e=t[0],r=t[1],i=t[2],n;if(n=Math.atan2(i,r)*360/2/Math.PI,n<0)n+=360;let a=Math.sqrt(r*r+i*i);return[e,a,n]};st.lch.lab=function(t){let e=t[0],r=t[1],n=t[2]/360*2*Math.PI,o=r*Math.cos(n),a=r*Math.sin(n);return[e,o,a]};st.rgb.ansi16=function(t,e=null){let[r,i,n]=t,o=e===null?st.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let a=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(r/255));if(o===2)a+=60;return a};st.hsv.ansi16=function(t){return st.rgb.ansi16(st.hsv.rgb(t),t[2])};st.rgb.ansi256=function(t){let e=t[0],r=t[1],i=t[2];if(e>>4===r>>4&&r>>4===i>>4){if(e<8)return 16;if(e>248)return 231;return Math.round((e-8)/247*24)+232}return 16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)};st.ansi16.rgb=function(t){t=t[0];let e=t%10;if(e===0||e===7){if(t>50)e+=3.5;return e=e/10.5*255,[e,e,e]}let r=(Math.trunc(t>50)+1)*0.5,i=(e&1)*r*255,n=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[i,n,o]};st.ansi256.rgb=function(t){if(t=t[0],t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,i=Math.floor((e=t%36)/6)/5*255,n=e%6/5*255;return[r,i,n]};st.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};st.hex.rgb=function(t){let e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];let r=e[0];if(e[0].length===3)r=[...r].map((s)=>s+s).join("");let i=Number.parseInt(r,16),n=i>>16&255,o=i>>8&255,a=i&255;return[n,o,a]};st.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.max(Math.max(e,r),i),o=Math.min(Math.min(e,r),i),a=n-o,s,l=a<1?o/(1-a):0;if(a<=0)s=0;else if(n===e)s=(r-i)/a%6;else if(n===r)s=2+(i-e)/a;else s=4+(e-r)/a;return s/=6,s%=1,[s*360,a*100,l*100]};st.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,i=r<0.5?2*e*r:2*e*(1-r),n=0;if(i<1)n=(r-0.5*i)/(1-i);return[t[0],i*100,n*100]};st.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,i=e*r,n=0;if(i<1)n=(r-i)/(1-i);return[t[0],i*100,n*100]};st.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100;if(r===0)return[i*255,i*255,i*255];let n=[0,0,0],o=e%1*6,a=o%1,s=1-a,l=0;switch(Math.floor(o)){case 0:{n[0]=1,n[1]=a,n[2]=0;break}case 1:{n[0]=s,n[1]=1,n[2]=0;break}case 2:{n[0]=0,n[1]=1,n[2]=a;break}case 3:{n[0]=0,n[1]=s,n[2]=1;break}case 4:{n[0]=a,n[1]=0,n[2]=1;break}default:n[0]=1,n[1]=0,n[2]=s}return l=(1-r)*i,[(r*n[0]+l)*255,(r*n[1]+l)*255,(r*n[2]+l)*255]};st.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,i=e+r*(1-e),n=0;if(i>0)n=e/i;return[t[0],n*100,i*100]};st.hcg.hsl=function(t){let e=t[1]/100,i=t[2]/100*(1-e)+0.5*e,n=0;if(i>0&&i<0.5)n=e/(2*i);else if(i>=0.5&&i<1)n=e/(2*(1-i));return[t[0],n*100,i*100]};st.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,i=e+r*(1-e);return[t[0],(i-e)*100,(1-i)*100]};st.hwb.hcg=function(t){let e=t[1]/100,i=1-t[2]/100,n=i-e,o=0;if(n<1)o=(i-n)/(1-n);return[t[0],n*100,o*100]};st.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};st.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};st.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};st.gray.hsl=function(t){return[0,0,t[0]]};st.gray.hsv=st.gray.hsl;st.gray.hwb=function(t){return[0,100,t[0]]};st.gray.cmyk=function(t){return[0,0,0,t[0]]};st.gray.lab=function(t){return[t[0],0,0]};st.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(i.length)+i};st.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};function q4(){let t={},e=Object.keys(He);for(let{length:r}=e,i=0;i<r;i++)t[e[i]]={distance:-1,parent:null};return t}function K4(t){let e=q4(),r=[t];e[t].distance=0;while(r.length>0){let i=r.pop(),n=Object.keys(He[i]);for(let{length:o}=n,a=0;a<o;a++){let s=n[a],l=e[s];if(l.distance===-1)l.distance=e[i].distance+1,l.parent=i,r.unshift(s)}}return e}function J4(t,e){return function(r){return e(t(r))}}function tv(t,e){let r=[e[t].parent,t],i=He[e[t].parent][t],n=e[t].parent;while(e[n].parent)r.unshift(e[n].parent),i=J4(He[e[n].parent][n],i),n=e[n].parent;return i.conversion=r,i}function ev(t){let e=K4(t),r={},i=Object.keys(e);for(let{length:n}=i,o=0;o<n;o++){let a=i[o];if(e[a].parent===null)continue;r[a]=tv(a,e)}return r}var K9=ev;var ti={},rv=Object.keys(He);function iv(t){let e=function(...r){let i=r[0];if(i===void 0||i===null)return i;if(i.length>1)r=i;return t(r)};if("conversion"in t)e.conversion=t.conversion;return e}function nv(t){let e=function(...r){let i=r[0];if(i===void 0||i===null)return i;if(i.length>1)r=i;let n=t(r);if(typeof n==="object")for(let{length:o}=n,a=0;a<o;a++)n[a]=Math.round(n[a]);return n};if("conversion"in t)e.conversion=t.conversion;return e}for(let t of rv){ti[t]={},Object.defineProperty(ti[t],"channels",{value:He[t].channels}),Object.defineProperty(ti[t],"labels",{value:He[t].labels});let e=K9(t),r=Object.keys(e);for(let i of r){let n=e[i];ti[t][i]=nv(n),ti[t][i].raw=iv(n)}}var _e=ti;var J9=["keyword","gray","hex"],Sl={};for(let t of Object.keys(_e))Sl[[..._e[t].labels].sort().join("")]=t;var kl={};function ie(t,e){if(!(this instanceof ie))return new ie(t,e);if(e&&e in J9)e=null;if(e&&!(e in _e))throw Error("Unknown model: "+e);let r,i;if(t==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof ie)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if(typeof t==="string"){let n=wr.get(t);if(n===null)throw Error("Unable to parse color from string: "+t);this.model=n.model,i=_e[this.model].channels,this.color=n.value.slice(0,i),this.valpha=typeof n.value[i]==="number"?n.value[i]:1}else if(t.length>0){this.model=e||"rgb",i=_e[this.model].channels;let n=Array.prototype.slice.call(t,0,i);this.color=Yl(n,i),this.valpha=typeof t[i]==="number"?t[i]:1}else if(typeof t==="number")this.model="rgb",this.color=[t>>16&255,t>>8&255,t&255],this.valpha=1;else{this.valpha=1;let n=Object.keys(t);if("alpha"in t)n.splice(n.indexOf("alpha"),1),this.valpha=typeof t.alpha==="number"?t.alpha:0;let o=n.sort().join("");if(!(o in Sl))throw Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Sl[o];let{labels:a}=_e[this.model],s=[];for(r=0;r<a.length;r++)s.push(t[a[r]]);this.color=Yl(s)}if(kl[this.model]){i=_e[this.model].channels;for(r=0;r<i;r++){let n=kl[this.model][r];if(n)this.color[r]=n(this.color[r])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}ie.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(t){let e=this.model in wr.to?this:this.rgb();e=e.round(typeof t==="number"?t:1);let r=e.valpha===1?e.color:[...e.color,this.valpha];return wr.to[e.model](...r)},percentString(t){let e=this.rgb().round(typeof t==="number"?t:1),r=e.valpha===1?e.color:[...e.color,this.valpha];return wr.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let t={},{channels:e}=_e[this.model],{labels:r}=_e[this.model];for(let i=0;i<e;i++)t[r[i]]=this.color[i];if(this.valpha!==1)t.alpha=this.valpha;return t},unitArray(){let t=this.rgb().color;if(t[0]/=255,t[1]/=255,t[2]/=255,this.valpha!==1)t.push(this.valpha);return t},unitObject(){let t=this.rgb().object();if(t.r/=255,t.g/=255,t.b/=255,this.valpha!==1)t.alpha=this.valpha;return t},round(t){return t=Math.max(t||0,0),new ie([...this.color.map(av(t)),this.valpha],this.model)},alpha(t){if(t!==void 0)return new ie([...this.color,Math.max(0,Math.min(1,t))],this.model);return this.valpha},red:Ut("rgb",0,ee(255)),green:Ut("rgb",1,ee(255)),blue:Ut("rgb",2,ee(255)),hue:Ut(["hsl","hsv","hsl","hwb","hcg"],0,(t)=>(t%360+360)%360),saturationl:Ut("hsl",1,ee(100)),lightness:Ut("hsl",2,ee(100)),saturationv:Ut("hsv",1,ee(100)),value:Ut("hsv",2,ee(100)),chroma:Ut("hcg",1,ee(100)),gray:Ut("hcg",2,ee(100)),white:Ut("hwb",1,ee(100)),wblack:Ut("hwb",2,ee(100)),cyan:Ut("cmyk",0,ee(100)),magenta:Ut("cmyk",1,ee(100)),yellow:Ut("cmyk",2,ee(100)),black:Ut("cmyk",3,ee(100)),x:Ut("xyz",0,ee(95.047)),y:Ut("xyz",1,ee(100)),z:Ut("xyz",2,ee(108.833)),l:Ut("lab",0,ee(100)),a:Ut("lab",1),b:Ut("lab",2),keyword(t){if(t!==void 0)return new ie(t);return _e[this.model].keyword(this.color)},hex(t){if(t!==void 0)return new ie(t);return wr.to.hex(...this.rgb().round().color)},hexa(t){if(t!==void 0)return new ie(t);let e=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();if(r.length===1)r="0"+r;return wr.to.hex(...e)+r},rgbNumber(){let t=this.rgb().color;return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255},luminosity(){let t=this.rgb().color,e=[];for(let[r,i]of t.entries()){let n=i/255;e[r]=n<=0.04045?n/12.92:((n+0.055)/1.055)**2.4}return 0.2126*e[0]+0.7152*e[1]+0.0722*e[2]},contrast(t){let e=this.luminosity(),r=t.luminosity();if(e>r)return(e+0.05)/(r+0.05);return(r+0.05)/(e+0.05)},level(t){let e=this.contrast(t);if(e>=7)return"AAA";return e>=4.5?"AA":""},isDark(){let t=this.rgb().color;return(t[0]*2126+t[1]*7152+t[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let t=this.rgb();for(let e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten(t){let e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){let e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate(t){let e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate(t){let e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten(t){let e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken(t){let e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale(){let t=this.rgb().color,e=t[0]*0.3+t[1]*0.59+t[2]*0.11;return ie.rgb(e,e,e)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){let e=this.hsl(),r=e.color[0];return r=(r+t)%360,r=r<0?360+r:r,e.color[0]=r,e},mix(t,e){if(!t||!t.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);let r=t.rgb(),i=this.rgb(),n=e===void 0?0.5:e,o=2*n-1,a=r.alpha()-i.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return ie.rgb(s*r.red()+l*i.red(),s*r.green()+l*i.green(),s*r.blue()+l*i.blue(),r.alpha()*n+i.alpha()*(1-n))}};for(let t of Object.keys(_e)){if(J9.includes(t))continue;let{channels:e}=_e[t];ie.prototype[t]=function(...r){if(this.model===t)return new ie(this);if(r.length>0)return new ie(r,t);return new ie([...sv(_e[this.model][t].raw(this.color)),this.valpha],t)},ie[t]=function(...r){let i=r[0];if(typeof i==="number")i=Yl(r,e);return new ie(i,t)}}function ov(t,e){return Number(t.toFixed(e))}function av(t){return function(e){return ov(e,t)}}function Ut(t,e,r){t=Array.isArray(t)?t:[t];for(let i of t)(kl[i]||=[])[e]=r;return t=t[0],function(i){let n;if(i!==void 0){if(r)i=r(i);return n=this[t](),n.color[e]=i,n}if(n=this[t]().color[e],r)n=r(n);return n}}function ee(t){return function(e){return Math.max(0,Math.min(t,e))}}function sv(t){return Array.isArray(t)?t:[t]}function Yl(t,e){for(let r=0;r<e;r++)if(typeof t[r]!=="number")t[r]=0;return t}var sn=ie;var t1="T1RUTwAJAIAAAwAQQ0ZGII5OHJcAAAcwAABJ3U9TLzJqmmVaAAABAAAAAGBjbWFwFN0WswAABEwAAALEaGVhZC8IHnAAAACcAAAANmhoZWEDrgI1AAAA1AAAACRobXR44MgAAAAAURAAAAFQbWF4cABUUAAAAAD4AAAABm5hbWUZQ94BAAABYAAAAutwb3N0AAMAAAAABxAAAAAgAAEAAAABAABxHWbfXw889QADA+gAAAAA5sttrAAAAADmy22s/9P/PwKHAvkAAAADAAIAAAAAAAAAAQAAA6z/LAAAArQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAFQAAFAAAFQAAAADAq0B9AAFAAACigK7AAAAjAKKArsAAAHfADEBAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAABYWFhYAEAAIQB6A6z/LAAAAvkAwQAAAAEAAAAAAiwC1wAAAAAAAAAAACIBngABAAAAAAAAAAEAWQABAAAAAAABABEAAAABAAAAAAACAAcAMwABAAAAAAADABsA/AABAAAAAAAEABkASAABAAAAAAAFAAsA2wABAAAAAAAGABgAkwABAAAAAAAHAAEAWQABAAAAAAAIAAEAWQABAAAAAAAJAAEAWQABAAAAAAAKAAEAWQABAAAAAAALAAEAWQABAAAAAAAMAAEAWQABAAAAAAANAAEAWQABAAAAAAAOAAEAWQABAAAAAAAQABEAAAABAAAAAAARAAcAMwADAAEECQAAAAIAgwADAAEECQABACIAEQADAAEECQACAA4AOgADAAEECQADADYBFwADAAEECQAEADIAYQADAAEECQAFABYA5gADAAEECQAGADAAqwADAAEECQAHAAIAgwADAAEECQAIAAIAgwADAAEECQAJAAIAgwADAAEECQAKAAIAgwADAAEECQALAAIAgwADAAEECQAMAAIAgwADAAEECQANAAIAgwADAAEECQAOAAIAgwADAAEECQAQACIAEQADAAEECQARAA4AOlRzY2lyY3VpdEFscGhhYmV0AFQAcwBjAGkAcgBjAHUAaQB0AEEAbABwAGgAYQBiAGUAdFJlZ3VsYXIAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0IFJlZ3VsYXIAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgBUAHMAYwBpAHIAYwB1AGkAdABBAGwAcABoAGEAYgBlAHQAUgBlAGcAdQBsAGEAclZlcnNpb24gMC4xAFYAZQByAHMAaQBvAG4AIAAwAC4AMSA6VHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhcgAgADoAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAcgAAAAABAAMAAQAAAAwABAK4AAAAqgCAAAYAKgAAACEAIgAjACQAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA8AD0APgBBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAev//AAAAAAAhACIAIwAkACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAPAA9AD4AQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHr//wAA/+D/4P/g/+D/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/c/9z/3P/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2QABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEABAEAAQEBGVRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgABAQEo+BsA+BwC+B0D+B4Ei/tV+kD5SAUdAAABOQ8dAAAB4BGLHQAASd0SAFcBAQwlNj0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkFZlcnNpb24gMC4xVHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhclRzY2lyY3VpdEFscGhhYmV0UmVndWxhciEiIyQnKCkqKywtLi8wMTIzNDU2Nzg5PD0+QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6AAAAAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QBUAgABAAQAeADuAgwFUgWPBmUHOwffCGMIzwkMCUgJhQq1CzwMhg5ADwwQUBHfEt8U3hYZFqIXFxeiGEIZtBsIHCccsh0sHpIfGh9XIC8gtiEFIjwjJSRTJWUmviftKXQp2CqzK0gsfS0ILW8uPy6iLuAvQy+2L/IxEDItM0A0XjWWNlQ39zjFOTk59zp9Oro76Dy1Pd8+/EAaQJVCDELOQ49EGEVZReRGgUdR+UgO+Uj37vlBFYv8VgWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+FYFjpsFlZkFmpQFnI8FnIcFmoIFlX0FL/z3Fe+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBSeLBXqOBX2UBYGZBYebBY+bBZWZBZmUBQ75SPdm+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQX3p3sVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj3XvcoFYAiBYZ7BYB/BXyDBXmJBXqQBX6VBYOaBYmbBZPgBSR/BXqMBXuSBX+YBYaaBYycBZOaBZiVBZyRBfcPmgWe91QFKH8FeYwFfJIFf5gFhZoFjZwFkpkFmZYFm5EF9wyZBZ33RgWQmgWWmAWakwWdjQWchgWYgQWUfAWMewV7+zIF9zifBZr3JgWQmgWWmAWbkwWcjQWchgWZgQWTfAWNewV++xMF8JcFnIoFm4QFl34FkHwFinoFg30FfoAFeoUF+w19BXj7VQXslwWdigWahAWXfwWRewWKegWDfQV+gAV6hgX7CnwFfvscBYZ7BX9/BXyDBXqJBXqQBX2VBYOaBYmbBZf3CQX7MM0V9zifBZ/3VAX7OHcFDvlI9/T5XhWL/awFiHoFgX4FfIEFeogFeo4FfJUFgpgFh5wFi/msBY+bBZSZBZqUBZyOBZyIBZqCBZV9BfcB+2YVNd0FgpkFiJsFjpsFlZkFmpQFnI4FnIcFmoIF4DkFlX0FjnoFh3sFgX4FfYIFeYgFeo4FQ9sV+z+bBXuQBX2VBYOaBYmbBZCbBZeYBZqTBZ2MBfc+ewWchgWZgAWTfQWMegWGfAWAfgV8gwX7LqUVKjgFe4MFeogFeo8FfZUFgpkFiJwFkJsFlZgF7d4FmpMFnI0FnIcFmYEFlH0FjnsFh3sFLD4VZvsHBYN8BX2BBXqGBXqMBXuTBYCYBYabBY2bBa/3CAWTmQWZlgWckAWciQWbgwWWfwWQewVkIRWkSQWNegWHewWAfgV8gwV6iQV6jwV9lQWCmQVyzQWJmwWPmwWWmQWakwWcjQWchwWZgQWdTxXUWgWXfwWRewWKewWEfAV+fwV7hgV5iwV7kgVCvQV/lwWFmgWLnAWTmgWYlgWbkQWdigXTWhX3fFkFm4QFl38FkXwFi3oFhHwFfoAFe4UFeYwF+3y8BXuSBX+XBYWaBYycBZKaBZeWBZyRBfedUhXVWgWWfwWSewWKewWEfAV+fwV6hgV6iwV7kgVCvAV/mAWFmgWLnAWTmgWXlgWckQWcigX2PBWjOAWMewWGewV/fgV8hAV5igV6kAV+lgWDmQVz3gWKmwWQmwWXmAWakgWdjAWbhgWZgAWp+xAVW/sHBYF9BX2BBXqIBXmOBX2UBYGYBYebBY6cBbz3BwWUmQWalQWcjgWciAWaggWVfQWPewU/+y8V+w5aBXqHBXmOBX2UBYGZBYebBY6bBZWZBZmUBfcOvQWcjgWciAWaggWVfgWPewWIewWBfQX7M00V+zObBXuQBX2WBYOZBYqcBZCaBZaYBZuTBZyMBfczewWchgWYgAWTfAWNewWFewWAfwV7gwX7VqAVNb0Ff5YFg5oFi5sFkZsFl5cFm5IFnIsFnIYF4FkFmIAFknwFjHoFhXwFf38Fe4QFeYoF+wzZFWbuBYmbBY+bBZaYBZqUBZyNBZyHBZmBBZR9BbAnBY17BYd7BYB+BXyDBXmIBXqQBX2VBQ75SPfu+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj4Ko0VsmUFlX0FjnsFh3sFgX0FfYIFeYgFeo8FfZQFYrMFio0FiYwFY7sFiowFiowFYsMFiowFiowFY8oFio4FiY0FbcoFio4FiY4Fd8oFi44Fio0FgcMFi5IFi5IFlcMFjI0Fi44Fn8oFjY4FjI4FqcoFjY0FjI4Fs8oFjIwFjIwFtMMFjIwFjIwFs7sFjYwFjI0FtLMFmZQFnI8FnYgFmYIFlX0Fj3sFiHsFgX0FZGUFZV4FZFUFZE8Fb1AFeFEFg10Fk10FnlEFp1AFsk8FslUFDvlI95tWFYqJBWJjBX2CBXqHBXmOBX2UBYGZBYebBY6bBZWZBbKxBbG4BbLBBbLHBafGBZ7FBZO5BYO5BXjFBW/GBWTHBWTBBWW4BWSxBYGZBYibBY+bBZWZBZqUBZyOBZyHBZmCBbRjBYyJBY2KBbRbBYuKBY2KBbNTBYyKBYyKBbRMBYuIBY2JBapMBYuIBY2IBZ9MBYuIBYyJBZVTBYuEBYuEBYFTBYqJBYuIBXdMBYmIBYuIBWxMBYmJBYuIBWJMBYqKBYqKBWNTBYmKBYuKBWJbBQ75SPeU+FUV+zRWBXqIBXqPBX2VBYKZBYicBY+bBZaYBZqTBfc5wgUh9yQFhJoFi5sFkZsFmJYFm5IFnIsFm4UFmIAF8fsfBfH3HwWYlgWbkQWciwWchAWXgAWRewWLewWEfAUh+yQF9zlUBZqDBZZ+BY97BYh6BYJ9BX2BBXqHBXqOBfs0wAWL+yoFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFDvlI95T39hWL90sFjpwFlZgFmpUFnI4FnIgFmoEFlX4FjnoFi/tLBfdpiwWciAWaggWVfQWOewWIegWBfgV8ggV6hwX7aYsFi/tLBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3SwX7aYsFeo8FfJQFgZgFiJwFjpsFlZkFmpQFnI4FDvlI96puFcJVBZV9BY56BYd7BYF+BXyCBXqIBXqOBX2VBTXfBYeRBYaRBYuMBYqMBYqSBYmSBYyMBYqMBY2SBYyTBYyLBYuMBZCRBY+RBfc/9zwFmpUFnI4FnIgFmoMFlX0Fj3sFiHsFgX0FDvlI90L35RX3kosFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogF+5KLBXqOBXyUBYGZBYibBY6bBZWZBZqUBQ75SPf/7RX7D4sFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9w+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBQ75SKOAFfhx+WMFl5cFm5EFnYwFm4UFmIAFknwFjHoFhXwF/HH9YwV/fwV7hQV5igV7kQV+lgWEmgWKnAUO+Uj4CfkPFUOeBUN4BUZQBWMvBYH7JQWj+wwFxi0F2F0FyYsF2LkFxukFo/cMBYH3JQVj5wVq9x4VjYoFkYgFkYgFjIoFjYoF4EEFi4sFjIoFj4UFkIUFi4oFjIoFuSEFjIQFjYUFlvsyBYqGBYuGBXH7GQWIhQWJhAVH+wIFiYoFiokFhocFh4YFiYoFiooFKVEFh4kFiIkFhooFh4oFh4sFh4oFM4sFh4wFh4sFh4wFhowFiI0Fh40FKcUFiowFiYwFh5AFho8Fio0FiowFRvcCBYmSBYiRBXH3GQWLkAWKkAWW9zIFjZEFjJIFufUFjIwFi4wFkJEFj5EFjIwFjIsF39UFjYwFjIwFkY4FkY4FjYwFjYsF6aMFjowFjowFkYoFkYwFjooFjooF6XMFDvlI9/v5ZRWQjgWNjAWNjAWSiwWSjQWMigWNiwWSigWSiQWMigWNiwWRhwWQhwWMigWNigWOhQWPhQWMigWLiQWMhQWNhAWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/i2BTRFBXuDBXqJBXqPBX2WBYOZBYmbBY+bBZaYBfc19xUFDvlI90rmFffoiwWdiAWZggWVfQWOewWIewWBfQV9ggV5iAX8TosFg4wFg4wFiowFiosFhY8FhI8Fi4sFiowFhpEFh5EFi4wFiowFipIFiZIFi4wFi4wFjJIFjJIFjIwFi4wFj5EFj5EF9zn3PgX3L/dKBcTlBZezBYueBYOqBXeiBV6dBUaQBWaGBVBzBWttBX9mBYN9BX6ABXqGBXmNBXyTBYCYBYaaBYycBZu6BYuMBYyNBY+QBY6RBYyMBYyNBbi2BYuLBYuLBZOQBZKQBYuLBYuLBdWoBZCNBZGMBbqSBZCKBZCMBd2FBZKJBZKKBclxBYyKBY2LBZCHBZGHBYyKBY2JBaxlBYyKBYuKBY+FBY6EBYuKBYyKBZdeBYuFBYyGBYptBYqGBYuGBX1ZBYiFBYmGBUwpBYmJBYqJBfsy+04FiooFiooFDvlI9wqUFYeMBVObBXySBX+YBYabBY2bBZOaBZmVBZuQBZ2KBcB8BdeABeiJBb2WBdGxBbW2BZy5BYOvBWWzBUStBTSiBT2UBYiMBYiLBYWOBYaMBYmNBYiNBYePBYeOBYmOBYmNBYmQBYmQBYuOBYqOBYuQBYuRBYyNBYuOBY2QBY2QBY2NBY2OBY+PBY+PBY6MBY2NBZCNBZGNBY6LBY6MBduVBeKdBdGpBauoBZGqBXWtBV2uBUagBTyPBUp2BVZxBWhxBXyEBXmKBXuQBX2WBYOZBYqcBZCaBZeYBbCnBY+MBY6OBceoBY6MBY6NBdikBZOMBZSMBemGBZCKBZGKBd1yBZKIBZOHBcVeBZCGBZCGBa9UBY2EBY6FBYuKBYyKBYqEBYuDBYBQBYmHBYqHBYmIBYmHBYiIBYiHBVxfBYWGBYSHBUduBdFqBZGGBZKHBcBUBYyIBY6JBY2GBY6HBYuIBY2HBZZQBYuJBYyIBYqFBYuGBYqIBYuJBXNKBYuLBYuLBYeEBYaEBYuLBYuLBVZUBYWHBYaHBTlfBYWJBYWIBU19BYWLBYWKBSeNBYiMBYiLBTmWBQ75SPgF98IVi+oFj5sFlJgFmpUFnI4FnIgFmoEFlX4FjnsFiywF6YsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogFLYsFi/s9BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3PQX71IsFhIwFhYwFiYwFiYsFhY8FhY0Fio0FiYwFh5AFh5AFi40FiY0FipEFiZEFi40Fi40FjJEFjJEFjI0Fi40Fj5EFjpAF+Ab4PgWYlgWcjwWcigWbgwWWfgWQfAWKegWCfQX7yfv5BQ75SKn5QRWOmwWVmQWalAWcjwX4WIsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogF/CuLBYv7dwX3HakFk4sFk4wF9x57BZOIBZOJBcJuBZGGBZGHBbFiBYyJBYyKBY6FBY+FBYuKBYyJBaj7BAWLigWLigWLhAWMhAWKigWLiQV9UQWLiwWLigWHhAWIhAWLiwWKigVnXgWFhQWFhgVFYQWFiQWFiAU5dQWGigWGigU+hwWFjAWGiwVKlwWGjQWGjAVWogWGjgWFjwVUugWAmAWHmwWOmwWUmQWZlQWcjwWciQWaggW9YQW0eQXCgQXNjgXSngXFrgWlqwWUswVz5wVxpwVjoAX7DZkF+01iBYaLBYaKBYeMBYiKBYaNBYaMBYiNBYeMBYePBYeNBYmOBYiNBYmQBYiPBYuOBYmPBYuPBYqQBQ75SPch96QVi4sFi4sFbW4FioMFnlkFm24FtWEFtHIFzoEF2o8FxaMFsqoFnrMFjaoFf7MFeKwFcqQFZ5sFUJcFU44FU4MFU28F+yxcFYqPBYyRBYy5BYuLBYuLBY7cBY2RBYyRBafaBYyNBYuNBbTfBZCSBZCRBcC7BY6NBY2NBdC4BZGOBZCOBdykBYyLBYuLBeKlBZ2NBZuGBZmBBZN8BY17BYZ7BYB+BXyDBTRyBUFzBU9kBV5jBWdABXJEBYp7BZGOBZCPBdGtBZKNBZKOBc6UBZCLBY+LBcuJBY+KBY+LBc58BZCKBZCJBbt2BZKGBZKHBa5oBY6GBY+GBaNhBYyHBY2HBZpZBYyEBYyFBYlbBYuLBYuLBYmDBYmDBYuLBYuLBW9UBYuKBYqKBYaGBYeFBYqKBYqLBVhiBYaIBYaIBUNtBYOJBYOJBS+GBYeMBYaLBTmXBYqLBYqLBYSOBYOOBYuLBYqLBVasBYiPBYaNBVq8BYeQBYeQBXaxBYqOBYqOBXXHBYqSBYmTBQ75SPfP90gVg/saBYd7BYF+BXyCBXmJBXqPBX2VBYKZBYmbBZL3HAWMjQWLjQWc9wcFi4wFjI0Fms0FjI0Fi4wFnsYFjIwFi40FoL4FjIwFi40ForcFjIwFi40Fo7EFjIwFjI0FoqoFjI0FjIwFoqYFjYwF+96LBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfhfiwWQigWQigWOigWPigWPiAWQiQWOiQWNiQWOhwWPhwWMiAWNiAWMhgWNhgWLiAWMiAWJhgWLhgWKiAWKiAWIhwWJhgWIiQWJiAWHiAWHiAVqeQV9gQVkaAV3dAV2bgV1aAV2YgV4WwV5UwV8TAUO+Uj3pvf2FUR0BUpaBXBZBYleBaZdBcVnBdlzBciJBeCmBb6wBaLEBYLEBWK1BTi2BVKfBdH3sxU4kQVLgAVXcwVrXQWVaQW4ZQW/bAXDeAWwlgXetQWdpgWMwwV1rwVr9wEVi4sFk4gFk4kFi4sFjIsF0GgFjokFj4kFjocFj4gFjYgFjYgFrVIFjIkFjYgFjIYFjYYFiogFjIgFiTwFi4gFi4kFiYUFioYFiYkFiogFbVwFiYkFiYgFh4gFh4cFiIoFiYkFUm4F0mYFkIcFkYcFw1IFjYcFj4gFjIcFjYgFjIYFjIcFmDoFi4kFi4kFioUFi4UFiokFiokFbDwFiYcFiogFh4cFiYgFiIgFiIkFR1sFhYgFhYcFJ2sFg4oFg4oFP40FhY0FhIsFMqcFho4FhY0FQ7gFio0FiYwFho8Fh5AFio0FiYwFZc0Fio4Fio4FipAFiZAFjI4Fio4Fjs0Fi4wFi4sFjZMFjZIFi4wFi4sFr80Fi4wFjIwFkJAFkJEFi4wFjIsF2sYFkY4Fko8FmI8FaZ8FiI4Fh40FUrwFiY0FiI4FiY8FiI8Fio4FiY4FeMsFi40Fi4wFipIFi5IFi4wFi4wFjpIFjZIFjIsFjI0Fu9IFjo4FjY4Fj44Fj44Fjo0Fjo0F0KsFkYwFkY0F15gFkIsFkYwF7YQFDvlI+Fr4mBWVnQV8xwVwqwVfoAVIkwVHgwVTdAVnagV+XwWYYAWvaQXDdAXMhAXMmgW8qgVf/BoVi4oFZ0IFgX4FfIIFeYgFeo8FfZUFgpkFiJsFj5sFr9QFtuoFwPcXBYuLBYuMBZKcBT55BYOKBYKLBTuUBYWNBYWMBUWoBYSPBYSQBVm6BYqNBYmMBYiQBYeQBYuOBYqNBXfNBYqOBYqOBYyQBYqQBYyOBYyPBZ/NBYyNBYuNBY+QBY6QBY2NBYyNBb26BZKPBZKQBdGnBZGMBZGNBduVBZGKBZGMBduBBZKJBZKJBcdvBYyKBYyLBZGGBZGHBYuKBYyKBbNcBYyKBYyKBY6FBY6FBYuJBYyKBZ83BYuFBYyEBYqJBYuJBYmFBYmGBYqHBUH7SAVW+xgFi4oFiooFXysFDvlI9y/3yxX4OvtDBZqBBZR9BY57BYd7BYF9BXyCBXqJBXqOBfyY92oFhI8FhY8FiowFiowFh5EFh5EFi4wFiosFipMFiZIFi4wFi4wFjZIFjJIFjIwFi4wFj5EFj5EFjIwFjIsFkY8Fko8F+Jj3agWcjwWciAWaggWVfgWPewWIegWCfQV8ggUO+Ui2+GkV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAWc+4gV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj44/fpFYyKBY+FBY+FBYuKBYyKBYyEBY2EBYuKBYuKBYmEBYqDBYqLBYuKBYeFBYeFBYqKBYqKBYWHBYSHBfyY+2oFeogFeo0FfJQFgZkFh5sFjpsFlJkFmpUF+Dv3QwX8O/dDBXyUBYKZBYicBY+bBZWYBZqUBZyOBZyHBfiY+2oFkocFkYcFDvlI+Ev3kxWGigX7q4sFi4sFLPtyBYF9BX2CBXqIBXmOBX2UBYGYBYecBY6bBfek+REFkJIFkJIFi4sFi4sFko8FkpAFi4sFjIsFk40Fk40FjIsFi4sFk4kFlIoFi4sFi4sFkoYFkocFjIsFi4sFkIQFj4QF97r9EQWPewWIegWBfgV9gQV6iAV5jgV9lAWBmAX7IvfIFfsB94AFJvuABQ75SPe++GUV2bYFlMsFTL8F+weeBSmGBYv7VgX32vxEFYSJBYmLBYmLBfv7hwWKiwWLiwWDjAWCjQWLiwWLiwWEjwWEkAWKiwWLiwWGkgWHkQWLjAWKiwWKkwWJkgWLjAWLiwWL+QoFjJIFjZIFi4wFi4wFkJEFjpEFjIwFjIwFkY8FkY8FjYsFjIwFkowFk40F9yWTBZCKBZCLBfcZdQWOigWPigWQiQWQiQWNiQWOiQXlQQWNiAWPiQWNhwWOhwWMhwWNiAWLhgWMhwWLhwWLhwV9+wAFiokFi4gFiIYFiYYFiYkFiogFh4cFh4cFiIoFiYkFSGYF9wJmBY6JBY+KBY+IBY+JBY2IBY6IBdE3BY6GBY6FBYyJBYuKBYyEBYyEBYX7AAWLiQWLiQWJhQWJhQWKiQWKiQVsWwWIiQWKiAWHiAWHhwWIigWIiQU+ZAWJigWJigVu3BXEqAWeqAWP3QVYyQX7JLsF+1CWBYv7nAUO+Uj4ZPclFaDbBZOZBZiXBZuQBZ2KBZuEBZd/BZF7BYp7BXIwBYqIBYqHBYiHBYmHBYiIBYmIBUNLBYiJBYmJBYaJBYaIBYiLBYiJBSl1BYuLBYuLBYOLBYKLBYuLBYuLBfsEnAWJiwWKjAWEjQWEjgWKjAWKiwVRsQWFkQWFkQVU3QWLiwWLiwWIkwWIkgWLiwWLiwVm918Fi5MFi5MFuvdeBYyMBYuNBY+RBY2RBY2MBYyNBc7XBYyMBYuLBZGQBZKQBYuLBYuLBdGsBZKNBZKOBdqVBYyLBYyLBZOKBZKLBYyKBY2LBfVqBYyLBYyLBZKHBZGHBYyLBYyKBcNZBYyLBYuKBZCFBY+FBYyKBYuLBapEBY57BYh7BYF9BXyCBXqIBXqOBXyVBYGYBXDJBWKwBTSlBU6EBVVxBVRNBWD7TAWt+04FuUgFtG8F6H0F2JwFDvlI93uVFYaKBfs1iAWLiwWKiwWDjAWDjQWKiwWLiwWEjwWEjwWLjAWKiwWHkgWGkQWLjAWLiwWJkwWJkgWMjAWKiwWT+QQFjJAFi5EFjY0Fi48Fj48FjY8FjY4FjY0FkI4Fj44Fjo0FjowFkIwFkY0F7pgFj4sFjowF14kFkYoFkIsF9xBrBYuLBYuLBZOHBZKIBYyLBYuKBeZIBYyKBYuLBZCFBZGFBYuLBYuKBb8wBY2FBY6GBaAsBYuHBYyHBY1EBYqHBYuIBYJOBYmHBYqHBXhXBYeFBYmGBUw8BYWGBYWGBTdZBYWJBYWIBfsdaAV53hX3EasF0rUFwM4Fm7UFlMAFicsFeOAFXtoFPsQF+wGnBUiMBVGDBYX8tAUO+Uj3EeUV+CGLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfxOiwV6jgV8lAWCmQWHmwWL99MFi/fSBY+bBZSZBZqUBZyPBfhOiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX8IYsFi/t+BfeciwWdiAWZggWVfQWOewWIegWBfgV9ggV5hwX7nIsFDvlI9xf32hWL+6oFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBYyKBfgviwWciAWZggWVfQWPewWHewWBfQV9ggV6iAX8FYsFi/t4BffQiwWdiAWZggWVfQWOewWIewWBfQV9ggV5hwUO+Uj4fve0Ffs1iwV6jwV9lAWBmQWImwWOmwWVmQWZlAWdjgX3bIsFj4oFkIsFj4kFj4oFj4kFj4kFjogFj4kFjYgFjocFjYgFjYcFjIcFjYcFi4cFjIcFiocFi4cFXvtaBYqJBYuIBYiGBYiGBYmJBYqJBUtGBYmKBYqJBYWIBYaHBYmKBYmKBTpwBYqLBYuKBYOKBYOKBYqLBYqLBTWSBYSNBYSNBTmuBYWOBYaOBUfCBYaQBYaQBV/QBYuMBYqMBYmRBYiSBYuMBYuMBXf3UgWLkQWLkgWx90IFjIwFi40FjpEFjpEFjIwFjI0FzdsFjIwFi4wFkZAFkY8FjIwFjIsF37QFi4sFi4sFk40Fk44Fi4sFi4sF9xeVBZKKBZGLBfcQcQWbhQWXfwWRfAWLegWEfAV+gAV7hQV5iwX7CKMF+weCBUhrBVZJBWj7MwWe+0IFrlUFxFwF0W4Fz4UFx6AFvL8FDvlI+H74OhWL95sFj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3tgX8DosFi/u2BYd7BYJ9BXyCBXqIBXqOBXyUBYGZBYibBYv34AWL98UFjpsFlZkFmpQFnI8FnIcFmoIFlH0Fj3sFi/ubBQ75SPfu+UEVi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5EQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Ui/9z4Vio4Fia8FjpsFlJkFmZUFnY4FnIkFmoIFlX4Fj3sFjGsFkXIFlXYFmXkFnX0FunoFzoQFu5EFwp8FoJkFnJ0Fl6EFk70FivhxBY6bBZWZBZqUBZyPBZyHBZqCBZR+BY96BYz8dAWKiAWLiAWCTgWJhQWJhAV5awWHhgWIhwVycQWHiAWIiAVtdwWGiQWGiAVKcwWGigWFigVRhAWGiwWGiwU8kwWFjAWFjAVRoQWFjwWFjQVvoQWHjwWHjgV2pQWJkAWIjwV+qAWKkAWJjwWEqwUO+Uj3Uff3FfsBOQWL+3UFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBZmCBZV9BY57BYv7xAX4Hve7BZuSBZyNBZyGBZiABZR8BYx7BYZ7BX9/Bfui+14F9+b70AWVfQWPewWHewWCfQV8ggV6iAV6jgV8lAUO+Uj3DOUV+CuLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfxYiwV6jgV9lAWBmQWHmwWL+REFj5sFlZkFmZQFnI8FnYcFmYIFlX0FjnsFDvlI+KH5WxWOjwWNjQWNjQWRjQWPjgWOjAWOjAWRjAWRjAWOigWOiwWQiQWRigWNigWOigWQhwWPiAWNiQWNiQWOhgWOhgWMiQWMiAWLhgWNhQWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h1BftD+6wFiYkFiokFhocFh4cFiYkFiYoFhYkFhYgFiYsFiIoFhYwFhYoFiIwFiYsFhY4FhY0FiYwFiY0Fh48Fho8Fio0FiY0F+0P3rAWL/HUFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY2RBYuQBYyOBYyNBY6QBY6QBY2NBY2NBY+OBZCPBY6MBY2MBZGMBZCNBY6LBY6MBZGKBZGKBY6KBY6KBY+IBZGJBY2JBY2JBY6HBY+HBfdw+/UF93D39QUO+Uj4e/dPFYT4hgWOmwWVmQWZlAWcjwWdiAWZggWVfQWPewWU/REFioYFi4cFiocFiocFiYgFiYcFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4oFhosFh4oFhosFh4sFh40Fh4wFh40Fh4wFiI4Fh44FiI4FiI4F/BT4oQWL/IkFh3sFgn0FfIIFeogFeo4FfJQFgZkFiJsFi/kRBYyPBYuPBYyPBYyPBY6PBYyOBY6OBY6PBY6NBY6OBZCNBY+NBY+MBY6NBZCLBZCMBY+KBY+LBY+JBZCKBY+JBY6KBY+IBY+IBY2IBY6IBQ75SPgblBWFiAWJiwWJiwUzgAWKiwWKigWEjAWDjAWKiwWKiwUypQWJjAWIjAWGjgWGjgWJjQWJjAU62gWJjgWIjgWJjwWIjwWLjwWJjgVP96AFi40Fi4wFi5IFi5IFjIwFi40FxPddBY2PBYyPBY6OBY2PBY6NBY6PBdHEBYyMBYyMBZKOBZGOBY2LBYyMBfcOqQWPiwWPjAWQigWPjAWPiQWPiwX3B2cFjIoFjYsFkYcFkYgFjIoFjYkFzkoFjYgFjYkFjocFjYYFjIgFjIgFxfuJBYuDBYuDBW/7LgWIhAWJhQVYMgWKiQWLigWGhgWGhgWKigWKigUwTgWJigWKigUg0BXOkwXUvAW11gWl9x8FVvd1BVm8BTCoBShzBVdgBVj7RgXD+4sFy00FDvlI93j3xxWJigX7AooFi/uVBYd7BYF9BX2CBXqIBXmOBX2UBYGZBYibBYv5BQWMkQWMkgWMjAWLjQWPkQWOkAWNjAWMjQWQjwWRjwWNiwWMjAWSjQWRjAX3HZcFjosFj4sF9w6EBY+KBZCLBdp2BY+KBY+KBa96BZCIBZCIBcRbBYuKBYuLBZCFBZCEBYuLBYyLBaRXBY2EBY2EBZA/BYuJBYuJBYqFBYqFBYqJBYuJBXRcBYqJBYqJBYeHBYeFBYmKBYqKBWhxBYWIBYWIBVN2BYeKBYeJBTp8BYiLBYmLBfsCggWF4BX1kwXWmQW5nAWgmwWZpwWGxAV6sAVesQVxlwVEnQX7BpIFL4MFi/uJBQ75SPiTtRXQOQWTfAWNewWFewWAfwV7gwV6igV6kAV+lQVRzwVUYAWIigWJiQWGiQWGiAWHiwWIigU1fgWJjAWJigWEjAWFiwWJjAWIiwU0qQWJjAWIjAWGjgWGjgWJjgWJjAU75AWKjgWJjQWJkAWIkAWLjgWKjQVQ98MFi4sFi4sFi5MFi5MFi4sFi4wFw/d2BY2OBYyPBY2PBY6PBY2OBY2OBdDLBY2MBYyNBZGOBZGOBY2MBY2MBfcLrAWRjAWRjAWNigWOjAWRiQWRigX3BGMFjYoFjooFj4cFkYgFjIkFjYoFzUEFjIkFjYkFjYYFjoYFjIgFjIkFw/uoBYuEBYuEBW/7QgWJhQWJhQX7K0AVMfUFg5oFipsFkJsFlpcFm5MFnIwFnIYFmIEF0zcFmqkFpfc1BVb3lgVZxAU0qgUucQVXWgVY+2IFwvuvBctDBcx2BcmUBQ75SPfz+EoV3JcFrpgFoJsFlqIFjLMFfbkFgZYFd5gFcZUFQZsF+xSQBfsofgWL+10F90g8FftIhQWL+7cFh3oFgn4FfIEFeogFeo4FfJUFgZgFiJwFi/j8BYyRBYyRBYyNBYuNBY+QBY6RBY2MBYyNBZGOBZCPBY2MBY2MBZGMBZKNBfdUmwWOiwWOjAX3G4UFj4oFj4sF3HoFj4kFj4sFrX0Fj4kFj4kFp3kFj4cFkIgFoHQFi4oFjIsFjoQFj4UFi4oFjIoFnU0FjIUFjIUFiVQFi4sFiYMFiYMFi4sFeWQFiooFi4oFhoUFhoUFiosFi4oFaXAFhIgFhYcFXXoFhooFhokFNX8F94H7rQWTfQWNegWGewV/fwV8gwV5igV6kAV+lgX7nPfLBYOaBQ75SOXBFYaOBYqNBYiNBYmQBYeQBVr3AQWHnAWOmwWVmQWZlAWcjgWdiAWZggWVfgW3KgXNaQX3IIcF7bgFq/AFdsUFS68F+4ezBYiNBYiLBYaNBYaNBYmOBYiMBUu+BYiPBYiOBYmOBYiOBYqQBYmOBXrHBYuPBYqOBYuQBYuPBYyPBYyPBbT3DAWOkAWNkAWNjQWMjQWQjwWPjwXvzAWRjgWQjgWOiwWNjAWRiwWRjAX3R4IFjYoFjIwFkogFkooFjIoFjYoFkIcFkYcFjIoFjIoF1zAFknwFjXoFhXwFgH4Fe4QFeYoFe5AFfpYFTNYF+yOTBUBaBWssBZVoBbZoBfeDYwWTiQWTiAXfWgWQhwWQhwWNiQWMigWOhQWOhgWrNgWLhgWNhwWLhwWLiAWKhgWKhgVi+xgFi4oFiooFh4UFiIQFiosFiooFhYYFhYcFiosFiooF+xJRBYmLBYqKBYSKBYSJBYmLBYmLBfs2jwWJjAWJiwWFjQWEjAWJjAWJjAUzuQUO+Uj3yflsFfeiiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX7dYsFi/znBYh7BYF9BX2CBXmIBXqOBXyUBYKZBYebBYv45wX7hYsFeo4FfJQFgZkFiJsFjpsFlZkFmpQFnI8FDvlI+HT3hxWQ+E4Fj5sFlZkFmZQFnY4FnIcFmYIFlX0FjnsFhvxQBYqIBYyJBYFHBYqHBYqGBXdYBYmIBYmHBX53BYiHBYiIBW1sBYWHBYaHBVhxBYSJBYSJBU2BBYWLBYSLBTOUBYaNBYWMBUWlBYWPBYWOBVyvBYeQBYWQBWjCBYiRBYiRBXnSBYqPBYqOBYTsBYuNBYuMBYr39wWOmwWVmQWalAWcjwWchwWaggWVfgWOegWM+/UFki8Fm00Fp2EFr28FxXYF14IFu5MFsJ4FoqIFk5cFnLYFDvlI99H3NRX3a/ivBZSZBZqVBZyPBZyIBZqCBZV+BY97BYh6BfuS/REFi4sFi4oFhoUFh4QFi4sFiooFhIcFhYYFiosFi4sFg4kFg4oFiosFi4sFg4wFgowFi4wFiosFhI8FhI8Fi4sFi4wFhpEFhpEFi4wFi4sF+7j5EgWHmwWOmwWVmQWZlAWcjwWciAWaggWVfQUO+Uj4dvdYFdf4gwWQmwWXlwWbkgWcjAWchgWYgAWTfAWMegUq/REFiYcFioYFiYgFiocFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4kFh4sFhooFh4sFh4sFho0Fh4sFh40Fh40FiI4Fh40FiI4FiI4FiY8FiI4F+0b3/wX7Ofv2BYiHBYiGBYmJBYmJBYaIBYeHBYiKBYiKBYaKBYWJBYiLBYiLBYWMBYaLBYiNBYiLBYaOBYaOBYmNBYiNBYiPBYiPBYqOBYmOBYqQBYmQBTv5CQWNnAWTmQWYlgWckAWcigWbhAWWfgWRewXH/G8F9x/3vgWPkAWPkQWMjAWMjAWRjwWRjwWNiwWMjAWSjAWSjQWNiwWMiwWSiQWTigWMiwWMigWRhwWSiAWMigWMigWPhQWPhQUO+Uj3/Pf/FfeZ+7QFlH0FjXsFhnsFgH4FfIMFeYkFeo8FfpYF+5D3qQX7kPupBX6ABXqHBXmNBXyTBYCYBYabBY2bBZSZBfeZ97QF+5/3uwWCmQWJnAWQmwWWlwWalAWdjAWchwWYgQX3lvuxBfeW97EFmZUFm48FnYoFmoIFln8FkHsFiXoFgn0FDvlI9+j4EhWV++EFiHsFgn0FfYEFeogFeY0FfJQFgZkFh5sFgffjBfud96cFgpkFiJsFj5sFlpkFmpMFnI4FnIcFmYEF94n7kQX3k/eQBZqVBZyPBZyIBZqCBZV+BY96BYh7BYJ9BQ75SPci5RX4KosFnYgFmYIFlX0FjnsFiHsFgX0FfYIFeYgF/IKLBYWMBYaLBYiMBYeMBYeOBYaNBYmNBYiNBYiPBYePBYqOBYmOBYqQBYmPBYuPBYuOBYyQBYuQBYyOBYyOBY6PBY2QBfhP+M4F/CqLBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfiCiwWRigWQigWOigWPigWPiQWQiAWNiQWOiQWOhwWPhwWMiAWNiAWMhwWNhgWLiAWLhwWKhgWLhgWKiAWKiAWIhwWJhgUO+Uj3h3QV9zaLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqHBftjiwV5jwV9lAWBmQWImwWL+Z8FjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfs2iwUO+Ujw+VgV+HH9YwWRfAWKegWEfAV+gAV7hQV5jAV7kQV/lwX8cfljBYWaBYycBZKaBZiWBZuRBZ2KBZuFBQ75SPhWShWHewWBfQV9ggV6hwX7Y4sFeY8FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9zaLBYv5SwX7NosFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BQ75SPeo+WQVko8FjIsFjIwFkowFk40FjIoFjIwFk4kFkooFjIoFjIsFkocFkYcF9577ggWVfgWPewWIegWBfQV9ggV6hwV6jgV8lAX7f/dmBft/+2YFfIIFeogFeo8FfZQFgZkFiJwFj5sFlZgF9573ggUO+UiL+wEV+O6LBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfzuiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj4POoVxcIFi/eQBVLBBVCnBS+LBVBvBUxQBWsvBYtQBaswBcpPBcdvBeaLBfcIZhWHiAWFhwVAZwWKigWJigWEigWFiQWJjAWJigX7BYsFiYwFiYoFhI0FhYwFiYwFiYwFQK8FhY8FhY8FP9MFiowFiowFiJEFh5EFiowFiowFZvYFipIFipIFi9IFjJIFjJEFsPcABYyNBYyMBY+RBY6RBYyMBYyMBdfTBZGPBZGPBdeuBYyMBY2MBZKMBZKNBYyKBY2MBfcFiwWMigWNjAWSiQWSigWMigWNigXWaAWQhwWQiAWLjwWPnAWUmAWalQWcjgWciAWagQWVfgWOegWL/IoFiHsFgX4FfIEFeogFeo4FfJUFgpgFh5sFDvlI9xOvFYaOBYuKBYd6BYF+BX2CBXqHBXmPBX2UBYGYBYicBYv5OAWOmwWVmQWZlAWdjgWciAWZggWVfQWPewWL+3YFkI4FkY8F1asFjIsFjIsFko0Fk40FjIoFjIwF9wSLBYyLBYuLBZOJBZOJBYyLBYuLBddrBZCHBZKIBdZKBYyKBY2KBY6FBY+GBYyJBYyKBbApBYyEBYyEBYtLBYqEBYqDBWYrBYqKBYqJBYeGBYiFBYmKBYqJBUBLBYWIBYWHBUBqBYqLBYqLBYSJBYOJBYqLBYqLBfsEiwWKjAWKigWDjQWEjQWKiwWKiwVBrAWA9w0VwlwFxnEF54sFx6UFycAFqdoFi70FbdsFTcAFT6QFL4sFUHIFVFwFDvlI+DLqFczNBZqVBZyPBZyIBZqDBZV9BY97BYl7BYF9BUVDBYWHBYWHBUZmBYiLBYmJBYWKBYWJBYiMBYmKBSGLBYmMBYiKBYWNBYWMBYmNBYmLBUSwBYWPBYWPBUXTBYqMBYqMBYeRBYeRBYuMBYqMBWn2BYqRBYqSBYvSBYyRBYySBa33AAWMjAWLjAWPkQWPkQWMjAWMjAXR0wWRjwWRjwXSrwWNiwWNjQWRjAWSjQWNigWNjAX1iwWNigWNjAWSiQWRigWNiQWNiwXRZwWRhwWRhwXRQwWVfQWNewWHewWBfQV8gwV6iAV6jwV8lQVKzQVWpgU3iwVVcAVRUAVtLgWLUAWoLwXGUAXCbwXdiwUO+Uj4PfUVwroFi/dxBVS6BVCkBS+LBU9yBU1WBW07BYtZBak8BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKiwWEiQWDiQWKjAWKigX7BIsFiosFiosFhI0Fg40FiosFiosFQKwFhY8Fho4FP8sFio0FiYwFiJEFh5AFio0FiowFZusFipMFipIFi8sFjJIFjJIFsO0FjIwFjI0Fj5AFjpEFjYwFjIwF18wFkY4FkI8F16sFi4sFjIsFk40Fk40Fi4sFjIsF9wSLBYyKBYyMBZOJBZKJBYyLBYyLBdVrBZGHBZCIBYv3dgWPmwWVmQWZlAWcjgWdiAWZggWVfQWOewWL/TgFiHoFgX4FfYIFeYcFeo8FfZQFgZgFh5wFDvlI9x74IBV8YQX4GIsFg5QFZs0FbaYFS6cFJosFSm8F93r7/BXXzgWZlAWdjgWchwWZggWVfQWNegWIewWAfgU6QwWGiAWFhwU8ZgWJiwWKigWEigWEiQWJiwWKiwX7DYsFiosFiosFg40FhIwFiowFiosFOrAFhY8FhY4FO9MFiYwFiowFh5EFh5AFi40Fio0FY/YFipIFipIFi9IFjJIFjJIFs/cABYyNBYuNBY+QBY+QBYyNBY2MBdvTBZKOBZCPBdyvBYyLBYyMBZOMBZKNBYyLBYyLBfcNiwWMiwWMiwWTiQWSigWMigWMiwXbZwWQhwWRiAW1ZwWPhQWQhQWyRAWQewWJegWDfQV/ggWUhQWVfgWOegWIewWBfQV9ggV5iAX8SYsFi3UFrDAFz08FzG4F8IsFDvlI97n4VhWL/CQFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/gkBfsGiwV6jgV8lQWCmAWHmwWPnAWUmAWalQWcjgX3BosFi8AFi40Fi40FjZEFjJEFjY0Fi4wFwOoFkZEFkJEFi4sFi4wFk44Fko8F9asFkowFkowF9YsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFKIsFOXIFZEUFi2EF9zuLBZyIBZqBBZV+BY56BYh7BYF+BXyBBXqIBQ75SPg99yMVwroFi/dxBVS7BVCkBS+LBU9yBU1WBW06BYtaBak7BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKigWEigWDiQWKiwWKiwX7BIsFiosFiosFg40FhIwFiowFiosFQKwFhY8FhY4FQMwFiowFiYwFiJEFh5AFio0FiowFZuwFipIFipIFi8wFjJIFjJIFsOwFjI0FjI0Fj5AFjpAFjY0FjIwF1swFko4FkI8F16sFi4sFjIwFk4wFk40Fi4sFjIsF9wSLBYyLBYyLBZOJBZKKBYyKBYyLBdVrBZGHBZCIBYuLBY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYv8mAWKhAWKhAVmKgWKigWKiQWHhgWIhQWJigWKiQVlawWFhwWFhwVBbAWKigWKiwWEiQWDigWKiwWKiwX7BIsFiosFi4sFg4wFg40FiosFi4sFP6sFho8FhI8FQMsFio0FiYwFiJAFh5AFio0Fio0FZuwFiZwFj5sFlZgFm5QFnI0FnIcFmYEFlH0FrDQFyVYFx3EF54sFxqUFpKAFqdoFDvlI+L34CRWNhAWL+9AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/fIBW7TBVqfBSyLBU1yBS49BYv7vQWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+SwFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/uSBbKsBZGOBZGPBdeqBYyLBYuMBZOMBZONBYyLBYuLBfcGiwWMiwWLiwWTiQWTigWMigWLiwXXbAWLiwWLiwWShgWShwWLigWMiwWPhAWQhQWLigWLiwWxLAUO+CT3NPmIFduLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBTuLBXqOBXyUBYGZBYibBY6bBZWZBZqUBfH7mRWL/E4FiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/hOBY6cBZWYBZqVBZyOBZyIBZqBBZV+BQ75SPgV+YgVyYsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFTYsFeo4FfJQFgpkFh5sFj5sFlJkFmpQF+wn+MhWGigWIjQWHiwUpqQV8kwWAmAWGmwWNmwWUmQWZlgWbjwWdiQXhcQXpoQWhyQWL+I4Fj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/yVBYqEBYqFBWswBYiGBYmHBYmIBYmIBYeIBYeIBYiJBYiJBYaKBYaJBfsXbQWIiwWHigUO+Uj3f/eMFfsRLwWLIQWIewWBfQV8ggV6iAV6jgV8lAWCmQWHmwWL+SwFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/xXBff495sFm5IFnIwFnIYFmIEFk3wFjHoFhnwFgH4F+2v7MgX3mPtwBZV+BZB7BYh7BYJ9BX2BBXqHBXqNBXyTBQ74JPeJ+WMVi/0+BYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5PgWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj43/iYFZCGBYuKBYyJBYyFBY2EBYuKBYyJBYv8WwWHewWBfQV9ggV6iAV5jgV9lAWBmQWImwWL+EgFfJYFXIsFdHgFVDEFi/vmBYh7BYF9BX2CBXmIBXqOBX2UBYGZBYebBYv36gVo4wV1nAVdiwVzeAVVMQWL++YFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h9BY6cBZWYBZmVBZ2OBZyIBZmBBZV+BY2ABa2mBZGOBZGPBY2LBYyMBZKLBZKNBduLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyJBY2KBY+GBY+GBYuJBY2JBZN1BZynBZCQBZCRBbWtBZGPBZGPBY2LBYyMBZKLBZKNBdyLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyKBYyKBQ75SPi++B0VjIUFi/vyBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv36wVt3QVaoQUtiwVPcAUsMwWL++AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/h9BY6cBZWYBZqVBZyOBZyIBZqBBZV+BY56BYtlBbCtBZKPBZCPBdiuBYyLBYyMBZKMBZONBYyLBYyLBfcGiwWMiwWNiwWSiQWSigWMigWNiwXWaAWMiwWLiwWShgWRhgWMiwWLiwWPhAWPhAWLiwWLiwWyIQUO+Uj37Ph4FTWLBVRwBU9PBWwvBYtQBaowBcdPBcNvBeCLBcKnBcfHBarmBYvGBWznBU/HBWH3AxWNjAWRiQWSigWNiQWNiwXTaAWRhgWRhwXTQwWLigWMiwWPhAWPhQWLigWMigWv+wAFjIUFjIQFi0QFioQFioUFZyAFiooFi4oFh4QFh4UFiosFi4oFQ0MFhYcFhYcFQ2YFiYsFiYkFhYoFhIkFiYwFiYoF+wCLBYmMBYmKBYSNBYWMBYmNBYmLBUOwBYWPBYWPBUPTBYuMBYqLBYeRBYeSBYuMBYqMBWf2BYqRBYqSBYvSBYySBYyRBa/3AAWMjAWLjAWPkQWPkgWMiwWLjAXT0wWSjwWQkAXTrgWNiwWNjQWSjAWRjQWNigWNjAX3AIsFDvlI9xTXFYWPBYv7dQWHewWCfQV8ggV6iAV6jgV8lAWBmQWImwWL+TMFjpwFlZgFmpUFnI4FnIgFmoEFlH4Fj3oFi4sFkY8FkI4F1asFjIsFjIwFk4wFko0FjIsFjIsF9wSLBYyLBYuLBZOJBZOKBYyKBYuLBdZsBZGHBZGHBdZLBY2KBYyJBY+GBY+GBYuJBY2JBa8rBY2EBYyDBYtLBYqEBYmEBWYsBYqJBYuJBYeGBYeFBYqKBYmKBUBLBYWHBYaIBUBqBYqLBYqKBYOKBYSJBYqLBYqLBfsEiwWKiwWKiwWDjQWEjAWKjAWKiwVBrAWA9w0VwlwFxnEF54sFx6UFyb8FqdoFi7wFbdsFTb8FT6QFL4sFUHIFVFwFDvlI+D33JRXCugWL924FVLoFUKQFL4sFT3IFTVcFbTsFi1oFqTwFyVcFx3EF54sF9wZiFYaIBYWHBUFqBYqLBYqLBYSJBYOJBYqMBYqKBfsEiwWKjAWKigWEjQWDjQWKiwWKiwVArAWGjgWFjwVAywWJjAWKjQWHkAWHkAWLjQWKjQVm6gWJkgWKkwWLywWMkgWNkgWw6wWMjQWLjQWPkAWPkQWMjAWNjAXWywWRjwWRjwXWqgWLiwWMjAWTjAWTjQWLiwWMiwX3BIsFjIsFjIsFkokFk4oFjIoFjIsF1WwFkIcFkYgFi4sFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/00BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBQ75SPfp+MsVk40F9yaLBZyIBZmBBZV+BY96BYd7BYF+BX2BBXqIBfsdiwU4bgU5TwViNAWL+6MFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/h9BY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYtWBdTABZGNBZGPBeutBQ75SO6nFYSQBYuLBYuMBYeSBYeSBXLSBYmcBY+bBZaYBZuTBZyNBZyGBZmBBZN9BZ9TBbt0BfWLBeSsBbuhBYuoBVHCBfsBygX7BIsFiYsFiosFhI0FhIwFiowFiYwFQK8FhY8Fho8FiowFiYwFiJEFh5EFi4wFio0FipEFipIFi9IFjJMFjZMFi4sFi4wFkJEFj5IF1tMFjIsFjIwFkY8Fko8FjIsFi4wF764Fk4wFk40F9xGLBYyKBY2MBZKJBZKKBYyKBY2KBdZoBZmBBZN8BY17BYd7BYB+BXyDBXmJBXqPBUqqBSGLBTluBVRWBYtuBbN4BfcGiwWOigWPiwWQiQWQigWOigWPiQX3EEQFj4cFkIgF1kQFj4QFkIQFi4sFi4sFjYMFjIMFi0MFioUFioQFiooFi4kFh4UFiIYFiYoFiokFhYgFhoYFQGgFiYsFiYkFJ2cFg4oFg4kF+xGLBYmMBYmKBYWNBYSMBYmMBYqMBUCvBQ75SPdd+DEV+wyLBXqOBXyUBYGZBYibBY6bBZWZBZqUBZyOBfcMiwWL9zcFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/s3BfdDiwWciAWaggWVfQWOewWIewWBfQV8ggV6iAX7Q4sFi/uCBbNMBeF0BfOLBZyHBZqCBZV9BY57BYh7BYF9BXyCBXqIBfsCiwWFjAWFjAX7AqgFg48FhI4Fi4sFiowFhpEFhZAFVOIFio4FiY4FipAFiZAFjI4Fio4FDvlI+GX3SRWL9+AFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/x9BYh6BYF+BXyBBXqIBXqOBXyVBYGYBYicBYuyBWZpBYWHBYWHBT9oBYmKBYqKBYSKBYSJBYmMBYqKBfsGiwWJjAWKigWEjQWEjAWJjAWKjAU/rgWEkAWEkAWLiwWLiwWHkgWHkgVk9AWKkgWKkQWL9/IFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/vrBak6Bb10BeeLBcinBQ75SPfB9xcV92j4JgWWmAWakwWcjQWchwWZgQWUfQWNegWHewX7kfxyBYiHBYiGBYiJBYqJBYaIBYaIBYiKBYiKBYaKBYWKBYiLBYiLBYWMBYaMBYiMBYiMBYaOBYaOBYqNBYiNBYiQBYiPBfuQ+HIFhpsFjZwFlJkFmZUFnI8FnIkFmoMFln4FDvlI+Fj3TRX29+kFk5oFmZUFm5AFnYoFmoMFl34FkHsFiXsF+yr8cgWIhwWKhwWIiAWKhwWHiQWIhwWHiQWIiQWGiQWHiQWHiwWHigWHiwWGiwWHjAWHiwWHjQWGjQWIjQWHjQWIjwWIjQWJjwWIjgWKjwWIjwUg9+kFIPvpBYiHBYqHBYiIBYmHBYiJBYiHBYeJBYiJBYaJBYeJBYeLBYeKBYeLBYaLBYeMBYeLBYeNBYaNBYiNBYeNBYiPBYiNBYmPBYiOBYqPBYiPBfsq+HIFiZsFkJsFl5gFmpMFnYwFm4YFmYEFk3wF9wD76QX29+kFjY8FjI8Fjo4FjY8Fj44Fjo4Fjo0Fj40Fj40Fj40Fj4sFj4wFkIsFkIsFj4oFj4sFj4kFkIkFjokFjokFjogFj4gFjYcFjogFjIcFjYcFDvlI+AL3pxX3evtlBZV+BY97BYh7BYF9BX2BBXqIBXmOBX2UBft992YF+337ZgV9ggV5iAV6jgV9lQWBmQWImwWPmwWVmAX3evdlBft692UFgZgFh5sFjpwFlZgFmZUFnI4FnYgFmYMF9337ZwX3ffdnBZmTBZ2OBZyIBZmBBZV+BY56BYd7BYF+BQ75SOj7TxWDigWLiwWLiwVjiwV6jgV8lAWBmQWImwWOmwWVmQWalAWcjgWqiwXLpQXOwQXJ7gX7dfg4BYebBY2bBZSaBZiVBZyPBZ2JBZqDBZZ+BfdX/AEF91n4AQWWmAWakwWdjQWbhwWZgQWUfAWNewWGewX7gfxMBYuKBYqJBT37EQWGhQWGhgU9TAWEiAWGhwU8bAWLiwWLiwUO+Uj3UtkV98+LBZ2IBZmCBZV9BY57BYh7BYF9BX2CBXmIBfwsiwWEjAWFiwWJjQWIiwWGjgWGjgWJjQWJjAWHkAWHkAWKjQWKjQWKkQWJkAWLjgWLjQWMkQWLkQWNjQWLjQWPkAWOkQX38vguBfvPiwV5jgV9lAWBmQWImwWOmwWVmQWZlAWdjgX4LIsFkooFkYsFjYoFjooFkIgFkYgFjIkFjYoFj4YFj4YFjIkFjIkFjIUFjYYFi4gFi4kFioUFi4UFiYkFi4kFh4YFiIYFDgAAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAGQAAACtAAAArQAAAGQAAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAA==";var W5=we(Se(),1);var TU=we(Se(),1);var j5=we(o1(),1);var a1={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.16 0.240234 L0.24 0.240234 M0.2 0.476089 L0.2 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.2 0.234863 L0.2 0.960796",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},ni={};for(let t in a1){ni[t]=[];let e=a1[t].split("M").slice(1).map((r)=>r.split("L").map((i)=>i.trim().split(" ").map(parseFloat)));for(let r of e)for(let i=0;i<r.length-1;i++)ni[t].push({x1:r[i][0],y1:1-r[i][1],x2:r[i+1][0],y2:1-r[i+1][1]})}var kv=0.09,Yv=0.692052,Mv=0.692052,Iv=1.152,Lv=0;var s1={"0":0.692052,"1":0.692052,"2":0.692052,"3":0.692052,"4":0.692052,"5":0.692052,"6":0.692052,"7":0.692052,"8":0.692052,"9":0.692052,"!":0.692052,'"':0.692052,"#":0.692052,$:0.692052,"'":0.692052,"(":0.692052,")":0.692052,"*":0.692052,"+":0.692052,",":0.692052,"-":0.692052,".":0.692052,"/":0.692052,"<":0.692052,"=":0.692052,">":0.692052,A:0.692052,B:0.692052,C:0.692052,D:0.692052,E:0.692052,F:0.692052,G:0.692052,H:0.692052,I:0.692052,J:0.692052,K:0.692052,L:0.692052,M:0.692052,N:0.692052,O:0.692052,P:0.692052,Q:0.692052,R:0.692052,S:0.692052,T:0.692052,U:0.692052,V:0.692052,W:0.692052,X:0.692052,Y:0.692052,Z:0.692052,"[":0.692052,"\\":0.692052,"]":0.692052,"^":0.692052,_:0.692052,a:0.692052,b:0.692052,c:0.692052,d:0.692052,e:0.692052,f:0.692052,g:0.692052,h:0.692052,i:0.4,j:0.692052,k:0.692052,l:0.4,m:0.692052,n:0.692052,o:0.692052,p:0.692052,q:0.692052,r:0.692052,s:0.692052,t:0.692052,u:0.692052,v:0.692052,w:0.692052,x:0.692052,y:0.692052,z:0.692052," ":0.692052};var c1={glyphWidthRatio:Yv,spaceWidthRatio:Mv,lineHeightRatio:Iv,strokeWidthRatio:kv,letterSpacingRatio:Lv};function l1(t){let e=t;while(e.parent!==null)e=e.parent;let r=t;while(r.parent!==null&&r.parent!==e){let i=r.parent;r.parent=e,r=i}return e}function Pv(t,e){let r={nodeId:t,nextMember:null},i={parent:null,networkId:`connectivity_net${e.nextNetworkNumber++}`,firstMember:r,lastMember:r};return e.rootByNodeId.set(t,i),i}function Tv(t,e){let r=e.rootByNodeId.get(t);return r===void 0?Pv(t,e):l1(r)}function Wv({targetRoot:t,sourceRoot:e}){t.lastMember.nextMember=e.firstMember,t.lastMember=e.lastMember,e.parent=t}function Ov(t){let e=[],r=t.firstMember;while(r!==null)e.push(r.nodeId),r=r.nextMember;return e}function jv(t){let e={rootByNodeId:new Map,nextNetworkNumber:0};for(let i of t){let n=null;for(let o of i){let a=Tv(o,e);if(n===null){n=a;continue}if(n=l1(n),a!==n)Wv({targetRoot:n,sourceRoot:a})}}let r={};for(let i of e.rootByNodeId.values()){if(i.parent!==null)continue;r[i.networkId]=Ov(i)}return r}var Rv=class{netMap;idToNetMap;constructor(t){this.netMap=t,this.idToNetMap={};for(let[e,r]of Object.entries(t))for(let i of r)this.idToNetMap[i]=e}addConnections(t){for(let e of t){let r=new Set;for(let n of e){let o=this.idToNetMap[n];if(o)r.add(o)}let i;if(r.size===0)i=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[i]=[];else if(r.size===1)i=r.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{i=r.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let n of r)if(n!==i){this.netMap[i].push(...this.netMap[n]),this.netMap[n]=this.netMap[i];for(let o of this.netMap[i])this.idToNetMap[o]=i}}for(let n of e){if(!this.netMap[i].includes(n))this.netMap[i].push(n);this.idToNetMap[n]=i}}}getIdsConnectedToNet(t){return this.netMap[t]||[]}getNetConnectedToId(t){return this.idToNetMap[t]}areIdsConnected(t,e){if(t===e)return!0;let r=this.getNetConnectedToId(t);if(!r)return!1;let i=this.getNetConnectedToId(e);if(!i)return!1;return r===i||i===t||i===t}areAllIdsConnected(t){let e=this.getNetConnectedToId(t[0]);for(let r of t){let i=this.getNetConnectedToId(r);if(i===void 0)return!1;if(i!==e)return!1}return!0}};var p1=(t)=>{let e=[];for(let i of t)if(i.type==="source_trace")e.push([i.source_trace_id,...i.connected_source_port_ids??[],...i.connected_source_net_ids??[]].filter(Boolean));else if(i.type==="pcb_port"){let{pcb_port_id:n,source_port_id:o}=i;if(o&&n)e.push([o,n])}else if(i.type==="pcb_smtpad"){let{pcb_smtpad_id:n,pcb_port_id:o}=i;if(o&&n)e.push([n,o])}else if(i.type==="pcb_plated_hole"){let{pcb_plated_hole_id:n,pcb_port_id:o}=i;if(o&&n)e.push([n,o])}else if(i.type==="pcb_trace"){let{pcb_trace_id:n,source_trace_id:o}=i,a=Array.isArray(i.route)?i.route.filter((s)=>s&&s.route_type==="wire"):[];if(o&&n)e.push([n,o]);if(Array.isArray(a)){let s=a.find((c)=>c?.start_pcb_port_id)?.start_pcb_port_id,l=a.find((c)=>c?.end_pcb_port_id)?.end_pcb_port_id;if(s&&n)e.push([s,n]);if(n&&l)e.push([n,l])}}else if(i.type==="pcb_via"){let{pcb_via_id:n,pcb_trace_id:o,source_trace_id:a,source_net_id:s}=i,l=[...i.pcb_port_ids??[],o,a,s].filter((c)=>Boolean(c));if(n&&l.length>0)e.push([n,...l])}else if(i.type==="source_component"){if(i.internally_connected_source_port_ids)for(let n of i.internally_connected_source_port_ids)e.push(n)}let r=jv(e);return new Rv(r)};var wZ=we(Se(),1);var ai={CCW:-1,CW:1,NOT_ORIENTABLE:0},Xv=2*Math.PI;var yo=Object.freeze({__proto__:null,BOUNDARY:2,CCW:!0,CONTAINS:3,CW:!1,END_VERTEX:2,INSIDE:1,INTERLACE:4,NOT_VERTEX:0,ORIENTATION:ai,OUTSIDE:0,OVERLAP_OPPOSITE:2,OVERLAP_SAME:1,PIx2:Xv,START_VERTEX:1}),Oe=0.000001;function F1(t){Oe=t}function B1(){return Oe}var $v=3;function Tl(t){return t<Oe&&t>-Oe}function Br(t,e){return t-e<Oe&&t-e>-Oe}function S1(t,e){return t-e>Oe}function Nv(t,e){return t-e>-Oe}function k1(t,e){return t-e<-Oe}function Vv(t,e){return t-e<Oe}var Y1=Object.freeze({__proto__:null,DECIMALS:$v,EQ:Br,EQ_0:Tl,GE:Nv,GT:S1,LE:Vv,LT:k1,getTolerance:B1,setTolerance:F1}),u={Utils:Y1,Errors:void 0,Matrix:void 0,Planar_set:void 0,Point:void 0,Vector:void 0,Line:void 0,Circle:void 0,Segment:void 0,Arc:void 0,Box:void 0,Edge:void 0,Face:void 0,Ray:void 0,Ray_shooting:void 0,Multiline:void 0,Polygon:void 0,Distance:void 0,Inversion:void 0};for(let t in yo)u[t]=yo[t];Object.defineProperty(u,"DP_TOL",{get:function(){return B1()},set:function(t){F1(t)}});class $t{static get ILLEGAL_PARAMETERS(){return ReferenceError("Illegal Parameters")}static get ZERO_DIVISION(){return Error("Zero division")}static get UNRESOLVED_BOUNDARY_CONFLICT(){return Error("Unresolved boundary conflict in boolean operation")}static get INFINITE_LOOP(){return Error("Infinite loop")}static get CANNOT_COMPLETE_BOOLEAN_OPERATION(){return Error("Cannot complete boolean operation")}static get CANNOT_INVOKE_ABSTRACT_METHOD(){return Error("Abstract method cannot be invoked")}static get OPERATION_IS_NOT_SUPPORTED(){return Error("Operation is not supported")}static get UNSUPPORTED_SHAPE_TYPE(){return Error("Unsupported shape type")}}u.Errors=$t;class _o{constructor(t,e){this.first=t,this.last=e||this.first}[Symbol.iterator](){let t=void 0;return{next:()=>(t=t?t.next:this.first,{value:t,done:t===void 0})}}get size(){let t=0;for(let e of this)t++;return t}toArray(t=void 0,e=void 0){let r=[],i=t||this.first,n=e||this.last,o=i;if(o===void 0)return r;do r.push(o),o=o.next;while(o!==n.next);return r}append(t){if(this.isEmpty())this.first=t;else t.prev=this.last,this.last.next=t;return this.last=t,this.last.next=void 0,this.first.prev=void 0,this}insert(t,e){if(this.isEmpty())this.first=t,this.last=t;else if(e===null||e===void 0)t.next=this.first,this.first.prev=t,this.first=t;else{let r=e.next;if(e.next=t,r)r.prev=t;if(t.prev=e,t.next=r,this.last===e)this.last=t}return this.last.next=void 0,this.first.prev=void 0,this}remove(t){if(t===this.first&&t===this.last)this.first=void 0,this.last=void 0;else{if(t.prev)t.prev.next=t.next;if(t.next)t.next.prev=t.prev;if(t===this.first)this.first=t.next;if(t===this.last)this.last=t.prev}return this}isEmpty(){return this.first===void 0}static testInfiniteLoop(t){let e=t,r=t;do{if(e!=t&&e===r)throw $t.INFINITE_LOOP;e=e.next,r=r.next.next}while(e!=t)}}var d1={stroke:"black"};class M1{constructor(t=d1){for(let e in t)this[e]=t[e];this.stroke=t.stroke??d1.stroke}toAttributesString(){return Object.keys(this).reduce((t,e)=>t+(this[e]!==void 0?this.toAttrString(e,this[e]):""),"")}toAttrString(t,e){let r=t==="className"?"class":this.convertCamelToKebabCase(t);return e===null?`${r} `:`${r}="${e.toString()}" `}convertCamelToKebabCase(t){return t.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).join("-").toLowerCase()}}function kr(t){return new M1(t).toAttributesString()}function di(t,e){let r=[],[i,n,o]=t.standard,[a,s,l]=e.standard,c=i*s-n*a,d=o*s-n*l,h=i*l-o*a;if(!u.Utils.EQ_0(c)){let y,_;if(n===0)y=o/i,_=h/c;else if(s===0)y=l/a,_=h/c;else if(i===0)y=d/c,_=o/n;else if(a===0)y=d/c,_=l/s;else y=d/c,_=h/c;r.push(new u.Point(y,_))}return r}function Yr(t,e){let r=[],i=e.pc.projectionOn(t),n=e.pc.distanceTo(i)[0];if(u.Utils.EQ(n,e.r))r.push(i);else if(u.Utils.LT(n,e.r)){let o=Math.sqrt(e.r*e.r-n*n),a,s;a=t.norm.rotate90CCW().multiply(o),s=i.translate(a),r.push(s),a=t.norm.rotate90CW().multiply(o),s=i.translate(a),r.push(s)}return r}function si(t,e){let r=[];for(let i of e.toSegments()){let n=yn(i,t);for(let o of n)if(!R1(o,r))r.push(o)}return r}function mo(t,e){let r=[];if(si(t,e.box).length===0)return r;let i=new u.Circle(e.pc,e.r),n=Yr(t,i);for(let o of n)if(o.on(e))r.push(o);return r}function yn(t,e){let r=[];if(t.ps.on(e))r.push(t.ps);if(t.pe.on(e)&&!t.isZeroLength())r.push(t.pe);if(r.length>0)return r;if(t.isZeroLength())return r;if(t.ps.leftTo(e)&&t.pe.leftTo(e)||!t.ps.leftTo(e)&&!t.pe.leftTo(e))return r;let i=new u.Line(t.ps,t.pe);return di(i,e)}function fo(t,e){let r=[];if(t.isZeroLength()){if(t.ps.on(e))r.push(t.ps);return r}if(e.isZeroLength()){if(e.ps.on(t))r.push(e.ps);return r}let i=new u.Line(t.ps,t.pe),n=new u.Line(e.ps,e.pe);if(i.incidentTo(n)){if(t.ps.on(e))r.push(t.ps);if(t.pe.on(e))r.push(t.pe);if(e.ps.on(t)&&!e.ps.equalTo(t.ps)&&!e.ps.equalTo(t.pe))r.push(e.ps);if(e.pe.on(t)&&!e.pe.equalTo(t.ps)&&!e.pe.equalTo(t.pe))r.push(e.pe)}else if(i.parallelTo(n)){let o=new u.Vector(t.ps,t.pe),a=new u.Vector(e.ps,e.pe),s=new u.Vector(t.ps,e.ps),l=o.cross(a);if(!u.Utils.EQ_0(l)){let c=s.cross(a)/l,d=s.cross(o)/l;if(u.Utils.GE(c,0)&&u.Utils.LE(c,1)&&u.Utils.GE(d,0)&&u.Utils.LE(d,1))r.push(h1(t.ps.translate(o.multiply(c)),t,e))}}else{let o=di(i,n);if(o.length>0){if(u1(o[0],t)&&u1(o[0],e))r.push(h1(o[0],t,e))}}return r}function h1(t,e,r){for(let i of[e.ps,e.pe,r.ps,r.pe])if(t.equalTo(i))return i;return t}function u1(t,e){let r=e.box;return u.Utils.LE(t.x,r.xmax)&&u.Utils.GE(t.x,r.xmin)&&u.Utils.LE(t.y,r.ymax)&&u.Utils.GE(t.y,r.ymin)}function xo(t,e){let r=[];if(t.isZeroLength()){let[o,a]=t.ps.distanceTo(e.pc);if(u.Utils.EQ(o,e.r))r.push(t.ps);return r}let i=new u.Line(t.ps,t.pe),n=Yr(i,e);for(let o of n)if(o.on(t))r.push(o);return r}function hi(t,e){let r=[];if(t.isZeroLength()){if(t.ps.on(e))r.push(t.ps);return r}let i=new u.Line(t.ps,t.pe),n=new u.Circle(e.pc,e.r),o=Yr(i,n);for(let a of o)if(a.on(t)&&a.on(e))r.push(a);return r}function zv(t,e){let r=[];for(let i of e.toSegments()){let n=fo(i,t);for(let o of n)r.push(o)}return r}function I1(t,e){let r=[],i=new u.Vector(t.pc,e.pc),n=t.r,o=e.r;if(u.Utils.EQ_0(n)||u.Utils.EQ_0(o))return r;if(u.Utils.EQ_0(i.x)&&u.Utils.EQ_0(i.y)&&u.Utils.EQ(n,o))return r.push(t.pc.translate(-n,0)),r;let a=t.pc.distanceTo(e.pc)[0];if(u.Utils.GT(a,n+o))return r;if(u.Utils.LT(a,Math.abs(n-o)))return r;i.x/=a,i.y/=a;let s;if(u.Utils.EQ(a,n+o)||u.Utils.EQ(a,Math.abs(n-o)))return s=t.pc.translate(n*i.x,n*i.y),r.push(s),r;let l=n*n/(2*a)-o*o/(2*a)+a/2,c=t.pc.translate(l*i.x,l*i.y),d=Math.sqrt(n*n-l*l);return s=c.translate(i.rotate90CCW().multiply(d)),r.push(s),s=c.translate(i.rotate90CW().multiply(d)),r.push(s),r}function Dv(t,e){let r=[];for(let i of e.toSegments()){let n=xo(i,t);for(let o of n)r.push(o)}return r}function L1(t,e){let r=[];if(t.pc.equalTo(e.pc)&&u.Utils.EQ(t.r,e.r)){let a;if(a=t.start,a.on(e))r.push(a);if(a=t.end,a.on(e))r.push(a);if(a=e.start,a.on(t))r.push(a);if(a=e.end,a.on(t))r.push(a);return r}let i=new u.Circle(t.pc,t.r),n=new u.Circle(e.pc,e.r),o=i.intersect(n);for(let a of o)if(a.on(t)&&a.on(e))r.push(a);return r}function Nl(t,e){let r=[];if(e.pc.equalTo(t.pc)&&u.Utils.EQ(e.r,t.r))return r.push(t.start),r.push(t.end),r;let i=e,n=new u.Circle(t.pc,t.r),o=I1(i,n);for(let a of o)if(a.on(t))r.push(a);return r}function Qv(t,e){let r=[];for(let i of e.toSegments()){let n=hi(i,t);for(let o of n)r.push(o)}return r}function E1(t,e){return t.isSegment?fo(t.shape,e):hi(e,t.shape)}function P1(t,e){return t.isSegment?hi(t.shape,e):L1(t.shape,e)}function T1(t,e){return t.isSegment?yn(t.shape,e):mo(e,t.shape)}function Uv(t,e){return t.isSegment?Dl(e,t.shape):Ql(e,t.shape)}function Zv(t,e){return t.isSegment?xo(t.shape,e):Nl(t.shape,e)}function Vl(t,e){let r=[];for(let i of e.edges)for(let n of E1(i,t))r.push(n);return r}function zl(t,e){let r=[];for(let i of e.edges)for(let n of P1(i,t))r.push(n);return r}function _n(t,e){let r=[];if(e.isEmpty())return r;for(let i of e.edges)for(let n of T1(i,t))if(!R1(n,r))r.push(n);return t.sortPoints(r)}function W1(t,e){let r=[];if(e.isEmpty())return r;for(let i of e.edges)for(let n of Zv(i,t))r.push(n);return r}function O1(t,e){if(t.isSegment)return E1(e,t.shape);else if(t.isArc)return P1(e,t.shape);else if(t.isLine)return T1(e,t.shape);else if(t.isRay)return Uv(e,t.shape);return[]}function j1(t,e){let r=[];if(e.isEmpty()||t.shape.box.not_intersect(e.box))return r;let i=e.edges.search(t.shape.box);for(let n of i)r=[...r,...O1(t,n)];return r}function Hv(t,e){let r=[];if(e.isEmpty()||t.size===0)return r;for(let i of t)r=[...r,...j1(i,e)];return r}function Gv(t,e){let r=[];if(t.isEmpty()||e.isEmpty())return r;if(t.box.not_intersect(e.box))return r;for(let i of t.edges)r=[...r,...j1(i,e)];return r}function qv(t,e){if(t instanceof u.Line)return _n(t,e);else if(t instanceof u.Segment)return Vl(t,e);else if(t instanceof u.Arc)return zl(t,e);else return[]}function R1(t,e){return e.some((r)=>r.equalTo(t))}function dr(t){return new u.Line(t.start,t.norm)}function Dl(t,e){return yn(e,dr(t)).filter((r)=>t.contains(r))}function Ql(t,e){return mo(dr(t),e).filter((r)=>t.contains(r))}function C1(t,e){return Yr(dr(t),e).filter((r)=>t.contains(r))}function Kv(t,e){return si(dr(t),e).filter((r)=>t.contains(r))}function X1(t,e){return di(dr(t),e).filter((r)=>t.contains(r))}function Jv(t,e){return di(dr(t),dr(e)).filter((r)=>t.contains(r)).filter((r)=>e.contains(r))}function $1(t,e){return _n(dr(t),e).filter((r)=>t.contains(r))}function N1(t,e){if(t.intersect&&t.intersect instanceof Function)return t.intersect(e);throw $t.UNSUPPORTED_SHAPE_TYPE}function ui(t,e){let r=[];for(let i of e)r=[...r,...N1(t,i.shape)];return r}function t8(t,e){let r=[];for(let i of t)for(let n of e)r=[...r,...N1(i.shape,n.shape)];return r}var Mr=class t extends _o{constructor(...e){super();if(this.isInfinite=!1,e.length===1&&e[0]instanceof Array&&e[0].length>0){let r=e[0],i=r.length,n=(l)=>l instanceof u.Segment||l instanceof u.Arc||l instanceof u.Ray||l instanceof u.Line,o=(l)=>l instanceof u.Segment||l instanceof u.Arc||l instanceof u.Ray,a=(l)=>l instanceof u.Segment||l instanceof u.Arc;if(i===1&&n(r[0])||i>1&&o(r[0])&&o(r[i-1])&&r.slice(1,i-1).every(a)){this.isInfinite=r.some((l)=>l instanceof u.Ray||l instanceof u.Line);for(let l of r){let c=new u.Edge(l);this.append(c)}this.setArcLength()}else throw u.Errors.ILLEGAL_PARAMETERS}}get edges(){return[...this]}get box(){return this.edges.reduce((e,r)=>e.merge(r.box),new u.Box)}get vertices(){let e=this.edges.map((r)=>r.start);return e.push(this.last.end),e}get length(){if(this.isEmpty())return 0;if(this.isInfinite)return Number.POSITIVE_INFINITY;let e=0;for(let r of this)e+=r.length;return e}clone(){return new t(this.toShapes())}setArcLength(){for(let e of this)this.setOneEdgeArcLength(e)}setOneEdgeArcLength(e){if(e===this.first)e.arc_length=0;else e.arc_length=e.prev.arc_length+e.prev.length}pointAtLength(e){if(e>this.length||e<0)return null;if(this.isInfinite)return null;let r=null;for(let i of this)if(e>=i.arc_length&&(i===this.last||e<i.next.arc_length)){r=i.pointAtLength(e-i.arc_length);break}return r}addVertex(e,r){let i=r.shape.split(e);if(i[0]===null)return r.prev;if(i[1]===null)return r;let n=new u.Edge(i[0]),o=r.prev;return this.insert(n,o),r.shape=i[1],n}getChain(e,r){let i=[];for(let n=e;n!==r.next;n=n.next)i.push(n);return i}split(e){for(let r of e){let i=this.findEdgeByPoint(r);this.addVertex(r,i)}return this}findEdgeByPoint(e){let r;for(let i of this)if(i.shape.contains(e)){r=i;break}return r}distanceTo(e){if(e instanceof u.Point){let[r,i]=u.Distance.shape2multiline(e,this);return[r,i.reverse()]}if(e instanceof u.Line){let[r,i]=u.Distance.shape2multiline(e,this);return[r,i.reverse()]}if(e instanceof u.Circle){let[r,i]=u.Distance.shape2multiline(e,this);return[r,i.reverse()]}if(e instanceof u.Segment){let[r,i]=u.Distance.shape2multiline(e,this);return[r,i.reverse()]}if(e instanceof u.Arc){let[r,i]=u.Distance.shape2multiline(e,this);return[r,i.reverse()]}if(e instanceof u.Box){let[r,i]=u.Distance.shape2multiline(new u.Polygon(e),this);return[r,i.reverse()]}if(e instanceof u.Multiline)return u.Distance.multiline2multiline(this,e);throw u.Errors.UNSUPPORTED_SHAPE_TYPE}intersect(e){if(e instanceof u.Multiline)return t8(this,e);else return ui(e,this)}contains(e){if(e instanceof u.Point)return this.edges.some((r)=>r.shape.contains(e));throw u.Errors.UNSUPPORTED_SHAPE_TYPE}translate(e){return new t(this.edges.map((r)=>r.shape.translate(e)))}rotate(e=0,r=new u.Point){return new t(this.edges.map((i)=>i.shape.rotate(e,r)))}transform(e=new u.Matrix){return new t(this.edges.map((r)=>r.shape.transform(e)))}toShapes(){return this.edges.map((e)=>e.shape.clone())}toJSON(){return this.edges.map((e)=>e.toJSON())}svgPoints(){return this.vertices.map((e)=>`${e.x},${e.y}`).join(" ")}dpath(){let e=`M${this.first.start.x},${this.first.start.y}`;for(let r of this)e+=r.svg();return e}svg(e={}){let r=`
<path ${kr({fill:"none",...e})} d="`;r+=`
M${this.first.start.x},${this.first.start.y}`;for(let i of this)r+=i.svg();return r+=`" >
</path>`,r}};u.Multiline=Mr;var e8=(...t)=>new u.Multiline(...t);u.multiline=e8;function ci(t,e,r){let i=r.length,n=t.shape.split(e);if(n.length===0)return;let o=0;if(n[0]===null)o=0;else if(n[1]===null)o=t.shape.length;else o=n[0].length;let a=0;if(Br(o,0))a|=1;if(Br(o,t.shape.length))a|=2;let s;if(o===1/0)s=n[0].coord(e);else s=a&2&&t.next&&t.next.arc_length===0?0:t.arc_length+o;r.push({id:i,pt:e,arc_length:s,edge_before:t,edge_after:void 0,face:t.face,is_vertex:a})}function hn(t){t.int_points1_sorted=pr(t.int_points1),t.int_points2_sorted=pr(t.int_points2)}function pr(t){let e=new Map,r=0;for(let n of t)if(!e.has(n.face))e.set(n.face,r),r++;for(let n of t)n.faceId=e.get(n.face);return t.slice().sort(r8)}function r8(t,e){if(t.faceId<e.faceId)return-1;if(t.faceId>e.faceId)return 1;if(t.arc_length<e.arc_length)return-1;if(t.arc_length>e.arc_length)return 1;return 0}function Ul(t){if(t.int_points1.length<2)return;let e=!1,r,i,n,o;for(let a=0;a<t.int_points1_sorted.length;a++){if(t.int_points1_sorted[a].id===-1)continue;r=t.int_points1_sorted[a],i=t.int_points2[r.id];for(let s=a+1;s<t.int_points1_sorted.length;s++){if(n=t.int_points1_sorted[s],!Br(n.arc_length,r.arc_length))break;if(n.id===-1)continue;if(o=t.int_points2[n.id],o.id===-1)continue;if(n.edge_before===r.edge_before&&n.edge_after===r.edge_after&&o.edge_before===i.edge_before&&o.edge_after===i.edge_after)n.id=-1,o.id=-1,e=!0}}i=t.int_points2_sorted[0],r=t.int_points1[i.id];for(let a=1;a<t.int_points2_sorted.length;a++){let s=t.int_points2_sorted[a];if(s.id===-1)continue;if(i.id===-1||!Br(s.arc_length,i.arc_length)){i=s,r=t.int_points1[i.id];continue}let l=t.int_points1[s.id];if(l.edge_before===r.edge_before&&l.edge_after===r.edge_after&&s.edge_before===i.edge_before&&s.edge_after===i.edge_after)l.id=-1,s.id=-1,e=!0}if(e)t.int_points1=t.int_points1.filter((a)=>a.id>=0),t.int_points2=t.int_points2.filter((a)=>a.id>=0),t.int_points1.forEach((a,s)=>a.id=s),t.int_points2.forEach((a,s)=>a.id=s)}function Wl(t){for(let e of t){if(e.edge_before)e.edge_before.bvStart=void 0,e.edge_before.bvEnd=void 0,e.edge_before.bv=void 0,e.edge_before.overlap=void 0;if(e.edge_after)e.edge_after.bvStart=void 0,e.edge_after.bvEnd=void 0,e.edge_after.bv=void 0,e.edge_after.overlap=void 0}for(let e of t){if(e.edge_before)e.edge_before.bvEnd=2;if(e.edge_after)e.edge_after.bvStart=2}}function Ol(t,e){for(let r of t){if(r.edge_before)r.edge_before.setInclusion(e);if(r.edge_after)r.edge_after.setInclusion(e)}}function i8(t){let e=void 0,r=void 0,i=void 0,n=t.int_points1.length;for(let o=0;o<n;o++){let a=t.int_points1_sorted[o];if(a.face!==e)r=o,e=a.face;let s=o,l=li(t.int_points1_sorted,o,e),c;if(s+l<n&&t.int_points1_sorted[s+l].face===e)c=s+l;else c=r;let d=li(t.int_points1_sorted,c,e);i=null;for(let v=c;v<c+d;v++){let k=t.int_points1_sorted[v];if(k.face===e&&t.int_points2[k.id].face===t.int_points2[a.id].face){i=k;break}}if(i===null)continue;let h=a.edge_after,y=i.edge_before;if(!(h.bv===2&&y.bv===2))continue;if(h!==y)continue;let _=t.int_points2[a.id],m=t.int_points2[i.id],g=_.edge_after,b=m.edge_before;if(!(g.bv===2&&b.bv===2&&g===b))_=t.int_points2[i.id],m=t.int_points2[a.id],g=_.edge_after,b=m.edge_before;if(!(g.bv===2&&b.bv===2&&g===b))continue;h.setOverlap(g)}}function li(t,e,r){let i,n,o=1;if(t.length===1)return 1;i=t[e];for(let a=e+1;a<t.length;a++){if(i.face!==r)break;if(n=t[a],!(n.pt.equalTo(i.pt)&&n.edge_before===i.edge_before&&n.edge_after===i.edge_after))break;o++}return o}function pi(t,e){if(!e)return;for(let r of e){let i=r.edge_before;if(r.is_vertex=0,i.shape.start&&i.shape.start.equalTo(r.pt))r.is_vertex|=1;if(i.shape.end&&i.shape.end.equalTo(r.pt))r.is_vertex|=2;if(r.is_vertex&1){if(r.edge_before=i.prev,i.prev)r.is_vertex=2;continue}if(r.is_vertex&2)continue;let n=t.addVertex(r.pt,i);r.edge_before=n}for(let r of e)if(r.edge_before)r.edge_after=r.edge_before.next;else if(t instanceof Mr&&r.is_vertex&1)r.edge_after=t.first}function y1(t,e,r){let i=t.edge_before,n=e.edge_after,o=r.length;i.next=r[0],r[0].prev=i,r[o-1].next=n,n.prev=r[o-1]}var{INSIDE:Te,OUTSIDE:We,BOUNDARY:ne,OVERLAP_SAME:n8,OVERLAP_OPPOSITE:o8}=yo,{NOT_VERTEX:Gz,START_VERTEX:_1,END_VERTEX:m1}=yo,go=1,mn=2,Sr=3;function a8(t,e){let[r,i]=fn(t,e,go,!0);return r}function jl(t,e){let i=e.clone().reverse(),[n,o]=fn(t,i,Sr,!0);return n}function V1(t,e){let[r,i]=fn(t,e,mn,!0);return r}function z1(t,e){let[r,i]=fn(t,e,mn,!1),n=[];for(let a of r.faces)n=[...n,...[...a.edges].map((s)=>s.shape)];let o=[];for(let a of i.faces)o=[...o,...[...a.edges].map((s)=>s.shape)];return[n,o]}function Rl(t,e){let[r,i]=fn(t,e,Sr,!1),n=[];for(let o of r.faces)n=[...n,...[...o.edges].map((a)=>a.shape)];return n}function D1(t,e){let r=t.clone(),i=e.clone(),n=Q1(r,i);hn(n),pi(r,n.int_points1_sorted),pi(i,n.int_points2_sorted),Ul(n),hn(n);let o=n.int_points1_sorted.map((s)=>s.pt),a=n.int_points2_sorted.map((s)=>s.pt);return[o,a]}function s8(t,e,r,i){let n=f1(t,r.int_points1),o=f1(e,r.int_points2);x1(n,e),x1(o,t),Wl(r.int_points1),Wl(r.int_points2),Ol(r.int_points1,e),Ol(r.int_points2,t);while(l8(t,e,r.int_points1,r.int_points1_sorted,r.int_points2,r));i8(r),Cl(t,i,r.int_points1_sorted,!0),Cl(e,i,r.int_points2_sorted,!1),g1(t,n,i,!0),g1(e,o,i,!1)}function c8(t,e,r,i){p8(t,e,i,r.int_points2),d8(t,e,r),Xl(t,r.int_points1),Xl(e,r.int_points2),$l(t,r.int_points1,r.int_points2),$l(t,r.int_points2,r.int_points1),b1(t),b1(e)}function fn(t,e,r,i){let n=t.clone(),o=e.clone(),a=Q1(n,o);if(hn(a),pi(n,a.int_points1_sorted),pi(o,a.int_points2_sorted),Ul(a),hn(a),s8(n,o,a,r),i)c8(n,o,a,r);return[n,o]}function Q1(t,e){let r={int_points1:[],int_points2:[]};for(let i of t.edges){let n=e.edges.search(i.box);for(let o of n){let a=i.shape.intersect(o.shape);for(let s of a)ci(i,s,r.int_points1),ci(o,s,r.int_points2)}}return r}function f1(t,e){let r=[];for(let i of t.faces)if(!e.find((n)=>n.face===i))r.push(i);return r}function x1(t,e){for(let r of t)r.first.bv=r.first.bvStart=r.first.bvEnd=void 0,r.first.setInclusion(e)}function l8(t,e,r,i,n,o){let a,s,l,c=i.length,d=!1;for(let h=0;h<c;h++){let y=i[h];if(y.face!==a)s=h,a=y.face;let _=h,m=li(i,h,a),g;if(_+m<c&&i[_+m].face===a)g=_+m;else g=s;let b=li(i,g,a);l=null;for(let x=g;x<g+b;x++){let A=i[x];if(A.face===a&&n[A.id].face===n[y.id].face){l=A;break}}if(l===null)continue;let v=y.edge_after,k=l.edge_before;if(v.bv===ne&&k.bv!=ne){v.bv=k.bv;continue}if(v.bv!=ne&&k.bv===ne){k.bv=v.bv;continue}if(v.bv===ne&&k.bv===ne&&v!=k||(v.bv===Te&&k.bv===We||v.bv===We&&k.bv===Te)){let x=v.next;while(x!=k)x.bvStart=void 0,x.bvEnd=void 0,x.bv=void 0,x.setInclusion(e),x=x.next}if(v.bv===ne&&k.bv===ne&&v!=k){let x=v.next,A;while(x!=k){if(x.bv!=ne){if(A===void 0)A=x.bv;else if(x.bv!=A)throw $t.UNRESOLVED_BOUNDARY_CONFLICT}x=x.next}if(A!=null)v.bv=A,k.bv=A;continue}if(v.bv===Te&&k.bv===We||v.bv===We&&k.bv===Te){let x=v;while(x!=k){if(x.bvStart===v.bv&&x.bvEnd===k.bv){let[A,S]=x.shape.distanceTo(e);if(A<10*u.DP_TOL){ci(x,S.ps,r);let E=r[r.length-1];if(E.is_vertex&_1)E.edge_after=x,E.edge_before=x.prev,x.bvStart=ne,x.bv=void 0,x.setInclusion(e);else if(E.is_vertex&m1)E.edge_after=x.next,x.bvEnd=ne,x.bv=void 0,x.setInclusion(e);else{let P=e.addVertex(E.pt,x);E.edge_before=P,E.edge_after=P.next,P.setInclusion(e),P.next.bvStart=ne,P.next.bvEnd=void 0,P.next.bv=void 0,P.next.setInclusion(e)}let I=e.findEdgeByPoint(S.pe);ci(I,S.pe,n);let T=n[n.length-1];if(T.is_vertex&_1)T.edge_after=I,T.edge_before=I.prev;else if(T.is_vertex&m1)T.edge_after=I.next;else{let P=n.find((D)=>D.edge_after===I),O=e.addVertex(T.pt,I);if(T.edge_before=O,T.edge_after=O.next,P)P.edge_after=O;O.bvStart=void 0,O.bvEnd=ne,O.bv=void 0,O.setInclusion(t),O.next.bvStart=ne,O.next.bvEnd=void 0,O.next.bv=void 0,O.next.setInclusion(t)}hn(o),d=!0;break}}x=x.next}if(d)break;throw $t.UNRESOLVED_BOUNDARY_CONFLICT}}return d}function Cl(t,e,r,i){if(!r)return;let n=void 0,o=void 0,a,s;for(let l=0;l<r.length;l++){if(a=r[l],a.face!==n)o=l,n=a.face;if(n.isEmpty())continue;let c=l,d=li(r,l,n),h;if(c+d<r.length&&r[c+d].face===a.face)h=c+d;else h=o;s=r[h];let y=h,_=li(r,y,n),m=a.edge_after,g=s.edge_before;if(m.bv===Te&&g.bv===Te&&e===go||m.bv===We&&g.bv===We&&e===mn||(m.bv===We||g.bv===We)&&e===Sr&&!i||(m.bv===Te||g.bv===Te)&&e===Sr&&i||m.bv===ne&&g.bv===ne&&m.overlap&n8&&i||m.bv===ne&&g.bv===ne&&m.overlap&o8){t.removeChain(n,m,g);for(let b=c;b<c+d;b++)r[b].edge_after=void 0;for(let b=y;b<y+_;b++)r[b].edge_before=void 0}l+=d-1}}function p8(t,e,r,i){for(let n of e.faces){for(let o of n)t.edges.add(o);if(i.find((o)=>o.face===n)===void 0)t.addFace(n.first,n.last)}}function d8(t,e,r){if(r.int_points1.length===0)return;for(let i=0;i<r.int_points1.length;i++){let n=r.int_points1[i],o=r.int_points2[i];if(n.edge_before!==void 0&&n.edge_after===void 0){if(o.edge_before===void 0&&o.edge_after!==void 0)n.edge_before.next=o.edge_after,o.edge_after.prev=n.edge_before,n.edge_after=o.edge_after,o.edge_before=n.edge_before}if(o.edge_before!==void 0&&o.edge_after===void 0){if(n.edge_before===void 0&&n.edge_after!==void 0)o.edge_before.next=n.edge_after,n.edge_after.prev=o.edge_before,o.edge_after=n.edge_after,n.edge_before=o.edge_before}if(n.edge_before!==void 0&&n.edge_after===void 0)for(let a of r.int_points1_sorted){if(a===n)continue;if(a.edge_before===void 0&&a.edge_after!==void 0){if(a.pt.equalTo(n.pt))n.edge_before.next=a.edge_after,a.edge_after.prev=n.edge_before,n.edge_after=a.edge_after,a.edge_before=n.edge_before}}if(o.edge_before!==void 0&&o.edge_after===void 0)for(let a of r.int_points2_sorted){if(a===o)continue;if(a.edge_before===void 0&&a.edge_after!==void 0){if(a.pt.equalTo(o.pt))o.edge_before.next=a.edge_after,a.edge_after.prev=o.edge_before,o.edge_after=a.edge_after,a.edge_before=o.edge_before}}}}function Xl(t,e){for(let r of e){if(t.faces.delete(r.face),r.face=void 0,r.edge_before)r.edge_before.face=void 0;if(r.edge_after)r.edge_after.face=void 0}}function $l(t,e,r){for(let i of e){if(i.edge_before===void 0||i.edge_after===void 0)continue;if(i.face)continue;if(i.edge_after.face||i.edge_before.face)continue;let{edge_after:n,edge_before:o}=i;try{_o.testInfiniteLoop(n)}catch(s){throw $t.CANNOT_COMPLETE_BOOLEAN_OPERATION}let a=t.addFace(n,o);for(let s of e)if(s.edge_before&&s.edge_after&&s.edge_before.face===a&&s.edge_after.face===a)s.face=a;for(let s of r)if(s.edge_before&&s.edge_after&&s.edge_before.face===a&&s.edge_after.face===a)s.face=a}}function g1(t,e,r,i){for(let n of e){let o=n.first.bv;if(r===go&&o===Te||r===Sr&&o===Te&&i||r===Sr&&o===We&&!i||r===mn&&o===We)t.deleteFace(n)}}function b1(t){let e=[];for(let r of t.edges)if(!r.face||!t.faces.has(r.face))e.push(r);for(let r of e)t.edges.delete(r)}var h8=Object.freeze({__proto__:null,BOOLEAN_INTERSECT:mn,BOOLEAN_SUBTRACT:Sr,BOOLEAN_UNION:go,calculateIntersections:D1,innerClip:z1,intersect:V1,outerClip:Rl,removeNotRelevantChains:Cl,removeOldFaces:Xl,restoreFaces:$l,subtract:jl,unify:a8}),u8=RegExp("T.F..FFF.|T.F...F.."),y8=RegExp("T........|.T.......|...T.....|....T...."),_8=RegExp("FT.......|F..T.....|F...T...."),m8=RegExp("T.F..F..."),f8=RegExp("T.F..F...|.TF..F...|..FT.F...|..F.TF...");class Ir{constructor(){this.m=[,,,,,,,,,].fill(void 0)}get I2I(){return this.m[0]}set I2I(t){this.m[0]=t}get I2B(){return this.m[1]}set I2B(t){this.m[1]=t}get I2E(){return this.m[2]}set I2E(t){this.m[2]=t}get B2I(){return this.m[3]}set B2I(t){this.m[3]=t}get B2B(){return this.m[4]}set B2B(t){this.m[4]=t}get B2E(){return this.m[5]}set B2E(t){this.m[5]=t}get E2I(){return this.m[6]}set E2I(t){this.m[6]=t}get E2B(){return this.m[7]}set E2B(t){this.m[7]=t}get E2E(){return this.m[8]}set E2E(t){this.m[8]=t}toString(){return this.m.map((t)=>{if(t instanceof Array&&t.length>0)return"T";else if(t instanceof Array&&t.length===0)return"F";else return"*"}).join("")}equal(){return u8.test(this.toString())}intersect(){return y8.test(this.toString())}touch(){return _8.test(this.toString())}inside(){return m8.test(this.toString())}covered(){return f8.test(this.toString())}}function pn(t,e){let r=void 0,i=new u.Ray(e),n=new u.Line(i.pt,i.norm),o=new u.Box(i.box.xmin-u.DP_TOL,i.box.ymin-u.DP_TOL,i.box.xmax+u.DP_TOL,i.box.ymax+u.DP_TOL);if(t.box.not_intersect(o))return u.OUTSIDE;let a=t.edges.search(o);if(a.length===0)return u.OUTSIDE;for(let d of a)if(d.shape.contains(e))return u.BOUNDARY;let s=[...t.faces],l=[];for(let d of a)for(let h of i.intersect(d.shape)){if(h.equalTo(e))return u.BOUNDARY;l.push({pt:h,edge:d,face_index:s.indexOf(d.face)})}l.sort((d,h)=>{if(k1(d.pt.x,h.pt.x))return-1;if(S1(d.pt.x,h.pt.x))return 1;if(d.face_index<h.face_index)return-1;if(d.face_index>h.face_index)return 1;if(d.edge.arc_length<h.edge.arc_length)return-1;if(d.edge.arc_length>h.edge.arc_length)return 1;return 0});let c=0;for(let d=0;d<l.length;d++){let h=l[d];if(h.pt.equalTo(h.edge.shape.start)){if(d>0&&h.pt.equalTo(l[d-1].pt)&&h.face_index===l[d-1].face_index&&h.edge.prev===l[d-1].edge)continue;let y=h.edge.prev;while(Tl(y.length))y=y.prev;let _=y.shape.tangentInEnd(),m=h.pt.translate(_),g=h.edge.shape.tangentInStart(),b=h.pt.translate(g),v=m.leftTo(n),k=b.leftTo(n);if(v&&!k||!v&&k)c++}else if(h.pt.equalTo(h.edge.shape.end)){if(d>0&&h.pt.equalTo(l[d-1].pt)&&h.face_index===l[d-1].face_index&&h.edge.next===l[d-1].edge)continue;let y=h.edge.next;while(Tl(y.length))y=y.next;let _=y.shape.tangentInStart(),m=h.pt.translate(_),g=h.edge.shape.tangentInEnd(),b=h.pt.translate(g),v=m.leftTo(n),k=b.leftTo(n);if(v&&!k||!v&&k)c++}else if(h.edge.shape instanceof u.Segment)c++;else{let y=h.edge.shape.box;if(!(Br(h.pt.y,y.ymin)||Br(h.pt.y,y.ymax)))c++}}return r=c%2===1?1:0,r}function x8(t,e){return yi(t,e).equal()}function U1(t,e){return yi(t,e).intersect()}function g8(t,e){return yi(t,e).touch()}function b8(t,e){return!U1(t,e)}function Z1(t,e){return yi(t,e).inside()}function H1(t,e){return yi(t,e).covered()}function v8(t,e){return Z1(e,t)}function G1(t,e){return H1(e,t)}function yi(t,e){if(t instanceof u.Line&&e instanceof u.Line)return w8(t,e);else if(t instanceof u.Line&&e instanceof u.Circle)return A8(t,e);else if(t instanceof u.Line&&e instanceof u.Box)return F8(t,e);else if(t instanceof u.Line&&e instanceof u.Polygon)return B8(t,e);else if((t instanceof u.Segment||t instanceof u.Arc)&&e instanceof u.Polygon)return v1(t,e);else if((t instanceof u.Segment||t instanceof u.Arc)&&(e instanceof u.Circle||e instanceof u.Box))return v1(t,new u.Polygon(e));else if(t instanceof u.Polygon&&e instanceof u.Polygon)return ho(t,e);else if((t instanceof u.Circle||t instanceof u.Box)&&(e instanceof u.Circle||e instanceof u.Box))return ho(new u.Polygon(t),new u.Polygon(e));else if((t instanceof u.Circle||t instanceof u.Box)&&e instanceof u.Polygon)return ho(new u.Polygon(t),e);else if(t instanceof u.Polygon&&(e instanceof u.Circle||e instanceof u.Box))return ho(t,new u.Polygon(e))}function w8(t,e){let r=new Ir,i=di(t,e);if(i.length===0)if(t.contains(e.pt)&&e.contains(t.pt))r.I2I=[t],r.I2E=[],r.E2I=[];else r.I2I=[],r.I2E=[t],r.E2I=[e];else r.I2I=i,r.I2E=t.split(i),r.E2I=e.split(i);return r}function A8(t,e){let r=new Ir,i=Yr(t,e);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[t],r.E2I=[e];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=t.split(i),r.E2I=[e];else{let n=new Mr([t]),o=t.sortPoints(i);n.split(o);let a=n.toShapes();r.I2I=[a[1]],r.I2B=o,r.I2E=[a[0],a[2]],r.E2I=new u.Polygon([e.toArc()]).cutWithLine(t)}return r}function F8(t,e){let r=new Ir,i=si(t,e);if(i.length===0)r.I2I=[],r.I2B=[],r.I2E=[t],r.E2I=[e];else if(i.length===1)r.I2I=[],r.I2B=i,r.I2E=t.split(i),r.E2I=[e];else{let n=new Mr([t]),o=t.sortPoints(i);n.split(o);let a=n.toShapes();if(e.toSegments().some((s)=>s.contains(i[0])&&s.contains(i[1])))r.I2I=[],r.I2B=[a[1]],r.I2E=[a[0],a[2]],r.E2I=[e];else r.I2I=[a[1]],r.I2B=o,r.I2E=[a[0],a[2]],r.E2I=new u.Polygon(e.toSegments()).cutWithLine(t)}return r}function B8(t,e){let r=new Ir,i=_n(t,e),n=new Mr([t]),o=i.length>0?i.slice():t.sortPoints(i);return n.split(o),[...n].forEach((a)=>a.setInclusion(e)),r.I2I=[...n].filter((a)=>a.bv===u.INSIDE).map((a)=>a.shape),r.I2B=[...n].slice(1).map((a)=>a.bv===u.BOUNDARY?a.shape:a.shape.start),r.I2E=[...n].filter((a)=>a.bv===u.OUTSIDE).map((a)=>a.shape),r.E2I=e.cutWithLine(t),r}function v1(t,e){let r=new Ir,i=qv(t,e),n=i.length>0?i.slice():t.sortPoints(i),o=new Mr([t]);o.split(n),[...o].forEach((a)=>a.setInclusion(e)),r.I2I=[...o].filter((a)=>a.bv===u.INSIDE).map((a)=>a.shape),r.I2B=[...o].slice(1).map((a)=>a.bv===u.BOUNDARY?a.shape:a.shape.start),r.I2E=[...o].filter((a)=>a.bv===u.OUTSIDE).map((a)=>a.shape),r.B2I=[],r.B2B=[],r.B2E=[];for(let a of[t.start,t.end])switch(pn(e,a)){case u.INSIDE:r.B2I.push(a);break;case u.BOUNDARY:r.B2B.push(a);break;case u.OUTSIDE:r.B2E.push(a);break}return r}function ho(t,e){let r=new Ir,[i,n]=D1(t,e),o=V1(t,e),a=jl(t,e),s=jl(e,t),[l,c]=z1(t,e),d=Rl(t,e),h=Rl(e,t);return r.I2I=o.isEmpty()?[]:[o],r.I2B=c,r.I2E=a.isEmpty()?[]:[a],r.B2I=l,r.B2B=i,r.B2E=d,r.E2I=s.isEmpty()?[]:[s],r.E2B=h,r}var S8=Object.freeze({__proto__:null,contain:v8,cover:G1,covered:H1,disjoint:b8,equal:x8,inside:Z1,intersect:U1,relate:yi,touch:g8});class xe{constructor(t=1,e=0,r=0,i=1,n=0,o=0){this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o}fromMatrix3x3(t){let[e,r,i]=t[0],[n,o,a]=t[1];return new xe(e,n,r,o,i,a)}toMatrix3x3(){return[[this.a,this.c,this.tx],[this.b,this.d,this.ty],[0,0,1]]}clone(){return new xe(this.a,this.b,this.c,this.d,this.tx,this.ty)}transform(t){return[t[0]*this.a+t[1]*this.c+this.tx,t[0]*this.b+t[1]*this.d+this.ty]}multiply(t){return new xe(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.tx+this.c*t.ty+this.tx,this.b*t.tx+this.d*t.ty+this.ty)}translate(...t){let e,r;if(t.length==1&&!isNaN(t[0].x)&&!isNaN(t[0].y))e=t[0].x,r=t[0].y;else if(t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")e=t[0],r=t[1];else throw $t.ILLEGAL_PARAMETERS;return this.multiply(new xe(1,0,0,1,e,r))}rotate(t,e=0,r=0){let i=Math.cos(t),n=Math.sin(t);return this.translate(e,r).multiply(new xe(i,n,-n,i,0,0)).translate(-e,-r)}scale(t,e){return this.multiply(new xe(t,0,0,e,0,0))}equalTo(t){if(!u.Utils.EQ(this.tx,t.tx))return!1;if(!u.Utils.EQ(this.ty,t.ty))return!1;if(!u.Utils.EQ(this.a,t.a))return!1;if(!u.Utils.EQ(this.b,t.b))return!1;if(!u.Utils.EQ(this.c,t.c))return!1;if(!u.Utils.EQ(this.d,t.d))return!1;return!0}}u.Matrix=xe;var k8=(...t)=>new u.Matrix(...t);u.matrix=k8;class q1{constructor(t,e){this.low=t,this.high=e}get max(){return this.clone()}less_than(t){return this.low<t.low||this.low===t.low&&this.high<t.high}equal_to(t){return this.low===t.low&&this.high===t.high}intersect(t){return!this.not_intersect(t)}not_intersect(t){return this.high<t.low||t.high<this.low}merge(t){let e=this.low===void 0?t.low:this.low<t.low?this.low:t.low,r=this.high===void 0?t.high:this.high>t.high?this.high:t.high,i=this.clone();return i.low=e,i.high=r,i}output(){return[this.low,this.high]}comparable_less_than(t,e){return t<e}}class Zl extends q1{clone(){return new Zl(this.low,this.high)}}var ae=1,Rt=0;class Ge{constructor(t,e,r=null,i=null,n=null,o=Rt){if(this.left=r,this.right=i,this.parent=n,this.color=o,this.item={key:void 0,values:[]},e!==void 0)this.item.values.push(e);if(t!==void 0)if(Array.isArray(t)){let[a,s]=t;if(!Number.isNaN(a)&&!Number.isNaN(s)){let l=a,c=s;if(l>c)[l,c]=[c,l];this.item.key=new Zl(l,c)}}else this.item.key=t;this.max=this.item.key?this.item.key.max:void 0}isNil(){return this.item.key===void 0&&this.item.values.length===0&&this.left===null&&this.right===null&&this.color===Rt}requireKey(){if(!this.item.key)throw Error("Node key is undefined (nil/sentinel). Operation is not applicable.");return this.item.key}less_than(t){let e=this.requireKey(),r=t.requireKey();return e.less_than(r)}_value_equal(t){let e=this.item.values[0],r=t.item.values[0];return e&&r&&e.equal_to?e.equal_to(r):e===r}equal_to(t){let e=this.requireKey(),r=t.requireKey();return e.equal_to(r)}intersect(t){let e=this.requireKey(),r=t.requireKey();return e.intersect(r)}copy_data(t){this.item.key=t.item.key,this.item.values=t.item.values.slice()}update_max(){if(this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max)this.max=this.max?this.max.merge(this.right.max):this.right.max;if(this.left&&this.left.max)this.max=this.max?this.max.merge(this.left.max):this.left.max}not_intersect_left_subtree(t){if(!this.left)return!0;let e=this.left.max?this.left.max.high:this.left.item.key.high,r=this.requireKey(),i=t.requireKey();return r.comparable_less_than(e,i.low)}not_intersect_right_subtree(t){if(!this.right)return!0;let e=this.right.max?this.right.max.low:this.right.item.key.low,r=this.requireKey(),i=t.requireKey();return r.comparable_less_than(i.high,e)}}class un{constructor(){this.root=null,this.nil_node=new Ge}get size(){let t=0;return this.tree_walk(this.root,(e)=>t+=e.item.values.length),t}get keys(){let t=[];return this.tree_walk(this.root,(e)=>t.push(e.item.key.output())),t}get values(){let t=[];return this.tree_walk(this.root,(e)=>{for(let r of e.item.values)t.push(r)}),t}get items(){let t=[];return this.tree_walk(this.root,(e)=>{let r=e.item.key.output();for(let i of e.item.values)t.push({key:r,value:i})}),t}isEmpty(){return this.root==null||this.root===this.nil_node}clear(){this.root=null}insert(t,e=t){if(t===void 0)return;let r=this.tree_search(this.root,new Ge(t));if(r)return r.item.values.push(e),r;let i=new Ge(t,e,this.nil_node,this.nil_node,null,ae);return this.tree_insert(i),this.recalc_max(i),i}exist(t,e=t){let r=this.tree_search(this.root,new Ge(t));if(!r)return!1;if(arguments.length<2||e===t)return!0;return r.item.values.some((i)=>i&&i.equal_to?i.equal_to(e):i===e)}remove(t,e=t){let r=this.tree_search(this.root,new Ge(t));if(!r)return;if(arguments.length<2)return this.tree_delete(r),r;let i=r.item.values.findIndex((n)=>n&&n.equal_to?n.equal_to(e):n===e);if(i>=0){if(r.item.values.splice(i,1),r.item.values.length===0)this.tree_delete(r);return r}return}search(t,e=(r,i)=>r===i?i.output():r){let r=new Ge(t),i=[];this.tree_search_interval(this.root,r,i);let n=[];for(let o of i)for(let a of o.item.values)n.push(e(a,o.item.key));return n}intersect_any(t){let e=new Ge(t);return this.tree_find_any_interval(this.root,e)}forEach(t){this.tree_walk(this.root,(e)=>{for(let r of e.item.values)t(e.item.key,r)})}map(t){let e=new un;return this.tree_walk(this.root,(r)=>{for(let i of r.item.values)e.insert(r.item.key,t(i,r.item.key))}),e}*iterate(t,e=(r,i)=>r===i?i.output():r){let r=null;if(t)r=this.tree_search_nearest_forward(this.root,new Ge(t));else if(this.root)r=this.local_minimum(this.root);while(r){for(let i of r.item.values)yield e(i,r.item.key);r=this.tree_successor(r)}}recalc_max(t){let e=t;while(e.parent!=null)e.parent.update_max(),e=e.parent}tree_insert(t){let e=this.root,r=null;if(this.root==null||this.root===this.nil_node)this.root=t;else{while(e!==this.nil_node)if(r=e,t.less_than(e))e=e.left;else e=e.right;if(t.parent=r,t.less_than(r))r.left=t;else r.right=t}this.insert_fixup(t)}insert_fixup(t){let e,r;e=t;while(e!==this.root&&e.parent.color===ae)if(e.parent===e.parent.parent.left)if(r=e.parent.parent.right,r.color===ae)e.parent.color=Rt,r.color=Rt,e.parent.parent.color=ae,e=e.parent.parent;else{if(e===e.parent.right)e=e.parent,this.rotate_left(e);e.parent.color=Rt,e.parent.parent.color=ae,this.rotate_right(e.parent.parent)}else if(r=e.parent.parent.left,r.color===ae)e.parent.color=Rt,r.color=Rt,e.parent.parent.color=ae,e=e.parent.parent;else{if(e===e.parent.left)e=e.parent,this.rotate_right(e);e.parent.color=Rt,e.parent.parent.color=ae,this.rotate_left(e.parent.parent)}this.root.color=Rt}tree_delete(t){let e,r;if(t.left===this.nil_node||t.right===this.nil_node)e=t;else e=this.tree_successor(t);if(e.left!==this.nil_node)r=e.left;else r=e.right;if(r.parent=e.parent,e===this.root)this.root=r;else{if(e===e.parent.left)e.parent.left=r;else e.parent.right=r;e.parent.update_max()}if(this.recalc_max(r),e!==t)t.copy_data(e),t.update_max(),this.recalc_max(t);if(e.color===Rt)this.delete_fixup(r)}delete_fixup(t){let e=t,r;while(e!==this.root&&e.parent!=null&&e.color===Rt)if(e===e.parent.left){if(r=e.parent.right,r.color===ae)r.color=Rt,e.parent.color=ae,this.rotate_left(e.parent),r=e.parent.right;if(r.left.color===Rt&&r.right.color===Rt)r.color=ae,e=e.parent;else{if(r.right.color===Rt)r.color=ae,r.left.color=Rt,this.rotate_right(r),r=e.parent.right;r.color=e.parent.color,e.parent.color=Rt,r.right.color=Rt,this.rotate_left(e.parent),e=this.root}}else{if(r=e.parent.left,r.color===ae)r.color=Rt,e.parent.color=ae,this.rotate_right(e.parent),r=e.parent.left;if(r.left.color===Rt&&r.right.color===Rt)r.color=ae,e=e.parent;else{if(r.left.color===Rt)r.color=ae,r.right.color=Rt,this.rotate_left(r),r=e.parent.left;r.color=e.parent.color,e.parent.color=Rt,r.left.color=Rt,this.rotate_right(e.parent),e=this.root}}e.color=Rt}tree_search(t,e){if(t==null||t===this.nil_node)return;if(e.equal_to(t))return t;if(e.less_than(t))return this.tree_search(t.left,e);else return this.tree_search(t.right,e)}tree_search_nearest_forward(t,e){let r=null,i=t;while(i&&i!==this.nil_node)if(i.less_than(e))if(i.intersect(e))r=i,i=i.left;else i=i.right;else{if(!r||i.less_than(r))r=i;i=i.left}return r||null}tree_search_interval(t,e,r){if(t!=null&&t!==this.nil_node){if(t.left!==this.nil_node&&!t.not_intersect_left_subtree(e))this.tree_search_interval(t.left,e,r);if(t.intersect(e))r.push(t);if(t.right!==this.nil_node&&!t.not_intersect_right_subtree(e))this.tree_search_interval(t.right,e,r)}}tree_find_any_interval(t,e){let r=!1;if(t!=null&&t!==this.nil_node){if(t.left!==this.nil_node&&!t.not_intersect_left_subtree(e))r=this.tree_find_any_interval(t.left,e);if(!r)r=t.intersect(e);if(!r&&t.right!==this.nil_node&&!t.not_intersect_right_subtree(e))r=this.tree_find_any_interval(t.right,e)}return r}local_minimum(t){let e=t;while(e.left!=null&&e.left!==this.nil_node)e=e.left;return e}local_maximum(t){let e=t;while(e.right!=null&&e.right!==this.nil_node)e=e.right;return e}tree_successor(t){let e,r,i;if(t.right!==this.nil_node)e=this.local_minimum(t.right);else{r=t,i=t.parent;while(i!=null&&i.right===r)r=i,i=i.parent;e=i}return e}rotate_left(t){let e=t.right;if(t.right=e.left,e.left!==this.nil_node)e.left.parent=t;if(e.parent=t.parent,t===this.root)this.root=e;else if(t===t.parent.left)t.parent.left=e;else t.parent.right=e;if(e.left=t,t.parent=e,t!==null&&t!==this.nil_node)t.update_max();if(e!=null&&e!==this.nil_node)e.update_max()}rotate_right(t){let e=t.left;if(t.left=e.right,e.right!==this.nil_node)e.right.parent=t;if(e.parent=t.parent,t===this.root)this.root=e;else if(t===t.parent.left)t.parent.left=e;else t.parent.right=e;if(e.right=t,t.parent=e,t!==null&&t!==this.nil_node)t.update_max();if(e!=null&&e!==this.nil_node)e.update_max()}tree_walk(t,e){if(t!=null&&t!==this.nil_node)this.tree_walk(t.left,e),e(t),this.tree_walk(t.right,e)}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,function(e){if(e.color===ae){if(!(e.left.color===Rt&&e.right.color===Rt))t=!1}}),t}testBlackHeightProperty(t){let e=0,r=0,i=0;if(t.color===Rt)e++;if(t.left!==this.nil_node)r=this.testBlackHeightProperty(t.left);else r=1;if(t.right!==this.nil_node)i=this.testBlackHeightProperty(t.right);else i=1;if(r!==i)throw Error("Red-black height property violated");return e+=r,e}}class K1 extends Set{constructor(t){super(t);this.index=new un,this.forEach((e)=>this.index.insert(e))}add(t){let e=this.size,{key:r,value:i}=t,n=r||t.box,o=i||t;if(super.add(o),this.size>e)this.index.insert(n,o);return this}delete(t){let{key:e,value:r}=t,i=e||t.box,n=r||t,o=super.delete(n);if(o)this.index.remove(i,n);return o}clear(){super.clear(),this.index=new un}search(t){return this.index.search(t)}hit(t){let e=new u.Box(t.x-1,t.y-1,t.x+1,t.y+1);return this.index.search(e).filter((i)=>t.on(i))}svg(){return[...this].reduce((e,r)=>e+r.svg(),"")}}u.PlanarSet=K1;class qe{get name(){throw $t.CANNOT_INVOKE_ABSTRACT_METHOD}get box(){throw $t.CANNOT_INVOKE_ABSTRACT_METHOD}clone(){throw $t.CANNOT_INVOKE_ABSTRACT_METHOD}translate(...t){return this.transform(new xe().translate(...t))}rotate(t,e=new u.Point){return this.transform(new xe().rotate(t,e.x,e.y))}scale(t,e){return this.transform(new xe().scale(t,e))}transform(...t){throw $t.CANNOT_INVOKE_ABSTRACT_METHOD}toJSON(){return Object.assign({},this,{name:this.name})}svg(t={}){throw $t.CANNOT_INVOKE_ABSTRACT_METHOD}}var J1=class t extends qe{constructor(...e){super();if(this.x=0,this.y=0,e.length===0)return;if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let r=e[0];if(typeof r[0]=="number"&&typeof r[1]=="number"){this.x=r[0],this.y=r[1];return}}if(e.length===1&&e[0]instanceof Object&&e[0].name==="point"){let{x:r,y:i}=e[0];this.x=r,this.y=i;return}if(e.length===2){if(typeof e[0]=="number"&&typeof e[1]=="number"){this.x=e[0],this.y=e[1];return}}throw $t.ILLEGAL_PARAMETERS}get box(){return new u.Box(this.x,this.y,this.x,this.y)}clone(){return new u.Point(this.x,this.y)}get vertices(){return[this.clone()]}equalTo(e){return u.Utils.EQ(this.x,e.x)&&u.Utils.EQ(this.y,e.y)}lessThan(e){if(u.Utils.LT(this.y,e.y))return!0;if(u.Utils.EQ(this.y,e.y)&&u.Utils.LT(this.x,e.x))return!0;return!1}transform(e){return new u.Point(e.transform([this.x,this.y]))}projectionOn(e){if(this.equalTo(e.pt))return this.clone();let r=new u.Vector(this,e.pt);if(u.Utils.EQ_0(r.cross(e.norm)))return e.pt.clone();let i=r.dot(e.norm),n=e.norm.multiply(i);return this.translate(n)}leftTo(e){let r=new u.Vector(e.pt,this);return u.Utils.GT(r.dot(e.norm),0)}distanceTo(e){if(e instanceof t){let r=e.x-this.x,i=e.y-this.y;return[Math.sqrt(r*r+i*i),new u.Segment(this,e)]}if(e instanceof u.Line)return u.Distance.point2line(this,e);if(e instanceof u.Circle)return u.Distance.point2circle(this,e);if(e instanceof u.Segment)return u.Distance.point2segment(this,e);if(e instanceof u.Arc)return u.Distance.point2arc(this,e);if(e instanceof u.Box)return u.Distance.point2polygon(this,new u.Polygon(e));if(e instanceof u.Polygon)return u.Distance.point2polygon(this,e);if(e instanceof u.PlanarSet)return u.Distance.shape2planarSet(this,e);if(e instanceof u.Multiline)return u.Distance.shape2multiline(this,e)}on(e){if(e instanceof u.Point)return this.equalTo(e);if(e.contains&&e.contains instanceof Function)return e.contains(this);throw u.Errors.UNSUPPORTED_SHAPE_TYPE}get name(){return"point"}svg(e={}){let r=e.r??3;return`
<circle cx="${this.x}" cy="${this.y}" r="${r}"
${kr({fill:"red",...e})} />`}};u.Point=J1;var Y8=(...t)=>new u.Point(...t);u.point=Y8;var M8=class extends qe{constructor(...e){super();if(this.x=0,this.y=0,e.length===0)return;if(e.length===1&&e[0]instanceof Array&&e[0].length===2){let r=e[0];if(typeof r[0]=="number"&&typeof r[1]=="number"){this.x=r[0],this.y=r[1];return}}if(e.length===1&&e[0]instanceof Object&&e[0].name==="vector"){let{x:r,y:i}=e[0];this.x=r,this.y=i;return}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{start:r,end:i}=e[0];this.x=i.x-r.x,this.y=i.y-r.y;return}if(e.length===2){let r=e[0],i=e[1];if(typeof r=="number"&&typeof i=="number"){this.x=r,this.y=i;return}if(r instanceof u.Point&&i instanceof u.Point){this.x=i.x-r.x,this.y=i.y-r.y;return}}throw $t.ILLEGAL_PARAMETERS}clone(){return new u.Vector(this.x,this.y)}get slope(){let e=Math.atan2(this.y,this.x);if(e<0)e=2*Math.PI+e;return e}get length(){return Math.sqrt(this.dot(this))}isZeroLength(){return u.Utils.EQ_0(this.length)}equalTo(e){return u.Utils.EQ(this.x,e.x)&&u.Utils.EQ(this.y,e.y)}multiply(e){return new u.Vector(e*this.x,e*this.y)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}normalize(){if(this.isZeroLength())throw $t.ZERO_DIVISION;return new u.Vector(this.x/this.length,this.y/this.length)}rotate(e,r=new u.Point){if(r.x===0&&r.y===0)return this.transform(new xe().rotate(e));throw $t.OPERATION_IS_NOT_SUPPORTED}transform(e){return new u.Vector(e.transform([this.x,this.y]))}rotate90CCW(){return new u.Vector(-this.y,this.x)}rotate90CW(){return new u.Vector(this.y,-this.x)}invert(){return new u.Vector(-this.x,-this.y)}add(e){return new u.Vector(this.x+e.x,this.y+e.y)}subtract(e){return new u.Vector(this.x-e.x,this.y-e.y)}angleTo(e){let r=this.normalize(),i=e.normalize(),n=Math.atan2(r.cross(i),r.dot(i));if(n<0)n+=2*Math.PI;return n}projectionOn(e){let r=e.normalize(),i=this.dot(r);return r.multiply(i)}get name(){return"vector"}};u.Vector=M8;var tx=(...t)=>new u.Vector(...t);u.vector=tx;var ex=class t extends qe{constructor(...e){super();if(this.ps=new u.Point,this.pe=new u.Point,e.length===0)return;if(e.length===1&&e[0]instanceof Array&&e[0].length===4){let r=e[0];this.ps=new u.Point(r[0],r[1]),this.pe=new u.Point(r[2],r[3]);return}if(e.length===1&&e[0]instanceof Object&&e[0].name==="segment"){let{ps:r,pe:i}=e[0];this.ps=new u.Point(r.x,r.y),this.pe=new u.Point(i.x,i.y);return}if(e.length===1&&e[0]instanceof u.Point){this.ps=e[0].clone();return}if(e.length===2&&e[0]instanceof u.Point&&e[1]instanceof u.Point){this.ps=e[0].clone(),this.pe=e[1].clone();return}if(e.length===4){this.ps=new u.Point(e[0],e[1]),this.pe=new u.Point(e[2],e[3]);return}throw $t.ILLEGAL_PARAMETERS}clone(){return new u.Segment(this.start,this.end)}get start(){return this.ps}get end(){return this.pe}get vertices(){return[this.ps.clone(),this.pe.clone()]}get length(){return this.start.distanceTo(this.end)[0]}get slope(){return new u.Vector(this.start,this.end).slope}get box(){return new u.Box(Math.min(this.start.x,this.end.x),Math.min(this.start.y,this.end.y),Math.max(this.start.x,this.end.x),Math.max(this.start.y,this.end.y))}equalTo(e){return this.ps.equalTo(e.ps)&&this.pe.equalTo(e.pe)}contains(e){return u.Utils.EQ_0(this.distanceToPoint(e))}intersect(e){if(e instanceof u.Point)return this.contains(e)?[e]:[];if(e instanceof u.Line)return yn(this,e);if(e instanceof u.Ray)return Dl(e,this);if(e instanceof u.Segment)return fo(this,e);if(e instanceof u.Circle)return xo(this,e);if(e instanceof u.Box)return zv(this,e);if(e instanceof u.Arc)return hi(this,e);if(e instanceof u.Polygon)return Vl(this,e);if(e instanceof u.Multiline)return ui(this,e)}distanceTo(e){if(e instanceof u.Point){let[r,i]=u.Distance.point2segment(e,this);return i=i.reverse(),[r,i]}if(e instanceof u.Circle){let[r,i]=u.Distance.segment2circle(this,e);return[r,i]}if(e instanceof u.Line){let[r,i]=u.Distance.segment2line(this,e);return[r,i]}if(e instanceof u.Segment){let[r,i]=u.Distance.segment2segment(this,e);return[r,i]}if(e instanceof u.Arc){let[r,i]=u.Distance.segment2arc(this,e);return[r,i]}if(e instanceof u.Box){let[r,i]=u.Distance.shape2polygon(this,new u.Polygon(e));return[r,i]}if(e instanceof u.Polygon){let[r,i]=u.Distance.shape2polygon(this,e);return[r,i]}if(e instanceof u.PlanarSet){let[r,i]=u.Distance.shape2planarSet(this,e);return[r,i]}if(e instanceof u.Multiline)return u.Distance.shape2multiline(this,e)}tangentInStart(){return new u.Vector(this.start,this.end).normalize()}tangentInEnd(){return new u.Vector(this.end,this.start).normalize()}reverse(){return new t(this.end,this.start)}split(e){if(this.start.equalTo(e))return[null,this.clone()];if(this.end.equalTo(e))return[this.clone(),null];return[new u.Segment(this.start,e),new u.Segment(e,this.end)]}middle(){return new u.Point((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}pointAtLength(e){if(e>this.length||e<0)return null;if(e==0)return this.start;if(e==this.length)return this.end;let r=e/this.length;return new u.Point((this.end.x-this.start.x)*r+this.start.x,(this.end.y-this.start.y)*r+this.start.y)}distanceToPoint(e){let[r,...i]=u.Distance.point2segment(e,this);return r}definiteIntegral(e=0){let r=this.end.x-this.start.x,i=this.start.y-e,n=this.end.y-e;return r*(i+n)/2}transform(e=new u.Matrix){return new t(this.ps.transform(e),this.pe.transform(e))}isZeroLength(){return this.ps.equalTo(this.pe)}sortPoints(e){return new u.Line(this.start,this.end).sortPoints(e)}get name(){return"segment"}svg(e={}){return`
<line x1="${this.start.x}" y1="${this.start.y}" x2="${this.end.x}" y2="${this.end.y}" ${kr(e)} />`}};u.Segment=ex;var I8=(...t)=>new u.Segment(...t);u.segment=I8;var{vector:ln}=u,L8=class t extends qe{constructor(...e){super();if(this.pt=new u.Point,this.norm=new u.Vector(0,1),e.length===0)return;if(e.length===1&&e[0]instanceof Object&&e[0].name==="line"){let{pt:r,norm:i}=e[0];this.pt=new u.Point(r),this.norm=new u.Vector(i);return}if(e.length===2){let r=e[0],i=e[1];if(r instanceof u.Point&&i instanceof u.Point){if(this.pt=r,this.norm=t.points2norm(r,i),this.norm.dot(ln(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(r instanceof u.Point&&i instanceof u.Vector){if(u.Utils.EQ_0(i.x)&&u.Utils.EQ_0(i.y))throw $t.ILLEGAL_PARAMETERS;if(this.pt=r.clone(),this.norm=i.clone(),this.norm=this.norm.normalize(),this.norm.dot(ln(this.pt.x,this.pt.y))>=0)this.norm.invert();return}if(r instanceof u.Vector&&i instanceof u.Point){if(u.Utils.EQ_0(r.x)&&u.Utils.EQ_0(r.y))throw $t.ILLEGAL_PARAMETERS;if(this.pt=i.clone(),this.norm=r.clone(),this.norm=this.norm.normalize(),this.norm.dot(ln(this.pt.x,this.pt.y))>=0)this.norm.invert();return}}throw $t.ILLEGAL_PARAMETERS}clone(){return new u.Line(this.pt,this.norm)}get start(){return}get end(){return}get length(){return Number.POSITIVE_INFINITY}get box(){return new u.Box(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY)}get middle(){return}get slope(){return new u.Vector(this.norm.y,-this.norm.x).slope}get standard(){let e=this.norm.x,r=this.norm.y,i=this.norm.dot(ln(this.pt.x,this.pt.y));return[e,r,i]}parallelTo(e){return u.Utils.EQ_0(this.norm.cross(e.norm))}incidentTo(e){return this.parallelTo(e)&&this.pt.on(e)}contains(e){if(this.pt.equalTo(e))return!0;let r=new u.Vector(this.pt,e);return u.Utils.EQ_0(this.norm.dot(r))}coord(e){return ln(e.x,e.y).cross(this.norm)}intersect(e){if(e instanceof u.Point)return this.contains(e)?[e]:[];if(e instanceof u.Line)return di(this,e);if(e instanceof u.Ray)return X1(e,this);if(e instanceof u.Circle)return Yr(this,e);if(e instanceof u.Box)return si(this,e);if(e instanceof u.Segment)return yn(e,this);if(e instanceof u.Arc)return mo(this,e);if(e instanceof u.Polygon)return _n(this,e);if(e instanceof u.Multiline)return ui(this,e)}distanceTo(e){if(e instanceof u.Point){let[r,i]=u.Distance.point2line(e,this);return i=i.reverse(),[r,i]}if(e instanceof u.Circle){let[r,i]=u.Distance.circle2line(e,this);return i=i.reverse(),[r,i]}if(e instanceof u.Segment){let[r,i]=u.Distance.segment2line(e,this);return[r,i.reverse()]}if(e instanceof u.Arc){let[r,i]=u.Distance.arc2line(e,this);return[r,i.reverse()]}if(e instanceof u.Box){let[r,i]=u.Distance.shape2polygon(this,new u.Polygon(e));return[r,i]}if(e instanceof u.Polygon){let[r,i]=u.Distance.shape2polygon(this,e);return[r,i]}}split(e){if(e instanceof u.Point)return[new u.Ray(e,this.norm),new u.Ray(e,this.norm)];else{let r=new u.Multiline([this]),i=this.sortPoints(e);return r.split(i),r.toShapes()}}rotate(e,r=new u.Point){return new u.Line(this.pt.rotate(e,r),this.norm.rotate(e))}transform(e){return new u.Line(this.pt.transform(e),this.norm.clone())}sortPoints(e){return e.slice().sort((r,i)=>{if(this.coord(r)<this.coord(i))return-1;if(this.coord(r)>this.coord(i))return 1;return 0})}get name(){return"line"}svg(e,r={}){let i=si(this,e);if(i.length===0)return"";let n=i[0],o=i.length===2?i[1]:i.find((s)=>!s.equalTo(n));if(o===void 0)o=n;return new u.Segment(n,o).svg(r)}static points2norm(e,r){if(e.equalTo(r))throw $t.ILLEGAL_PARAMETERS;return new u.Vector(e,r).normalize().rotate90CCW()}};u.Line=L8;var E8=(...t)=>new u.Line(...t);u.line=E8;var rx=class extends qe{constructor(...e){super();if(this.pc=new u.Point,this.r=1,e.length===1&&e[0]instanceof Object&&e[0].name==="circle"){let{pc:r,r:i}=e[0];this.pc=new u.Point(r),this.r=i}else{let[r,i]=[...e];if(r&&r instanceof u.Point)this.pc=r.clone();if(i!==void 0)this.r=i}}clone(){return new u.Circle(this.pc.clone(),this.r)}get center(){return this.pc}get box(){return new u.Box(this.pc.x-this.r,this.pc.y-this.r,this.pc.x+this.r,this.pc.y+this.r)}contains(e){if(e instanceof u.Point)return u.Utils.LE(e.distanceTo(this.center)[0],this.r);if(e instanceof u.Segment)return u.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&u.Utils.LE(e.end.distanceTo(this.center)[0],this.r);if(e instanceof u.Arc)return this.intersect(e).length===0&&u.Utils.LE(e.start.distanceTo(this.center)[0],this.r)&&u.Utils.LE(e.end.distanceTo(this.center)[0],this.r);if(e instanceof u.Circle)return this.intersect(e).length===0&&u.Utils.LE(e.r,this.r)&&u.Utils.LE(e.center.distanceTo(this.center)[0],this.r)}toArc(e=!0){return new u.Arc(this.center,this.r,Math.PI,-Math.PI,e)}scale(e,r){if(e!==r)throw $t.OPERATION_IS_NOT_SUPPORTED;if(!(this.pc.x===0&&this.pc.y===0))throw $t.OPERATION_IS_NOT_SUPPORTED;return new u.Circle(this.pc,this.r*e)}transform(e=new u.Matrix){return new u.Circle(this.pc.transform(e),this.r)}intersect(e){if(e instanceof u.Point)return this.contains(e)?[e]:[];if(e instanceof u.Line)return Yr(e,this);if(e instanceof u.Ray)return C1(e,this);if(e instanceof u.Segment)return xo(e,this);if(e instanceof u.Circle)return I1(e,this);if(e instanceof u.Box)return Dv(this,e);if(e instanceof u.Arc)return Nl(e,this);if(e instanceof u.Polygon)return W1(this,e);if(e instanceof u.Multiline)return ui(this,e)}distanceTo(e){if(e instanceof u.Point){let[r,i]=u.Distance.point2circle(e,this);return i=i.reverse(),[r,i]}if(e instanceof u.Circle){let[r,i]=u.Distance.circle2circle(this,e);return[r,i]}if(e instanceof u.Line){let[r,i]=u.Distance.circle2line(this,e);return[r,i]}if(e instanceof u.Segment){let[r,i]=u.Distance.segment2circle(e,this);return i=i.reverse(),[r,i]}if(e instanceof u.Arc){let[r,i]=u.Distance.arc2circle(e,this);return i=i.reverse(),[r,i]}if(e instanceof u.Box){let[r,i]=u.Distance.shape2polygon(this,new u.Polygon(e));return[r,i]}if(e instanceof u.Polygon){let[r,i]=u.Distance.shape2polygon(this,e);return[r,i]}if(e instanceof u.PlanarSet){let[r,i]=u.Distance.shape2planarSet(this,e);return[r,i]}if(e instanceof u.Multiline){let[r,i]=u.Distance.shape2multiline(this,e);return[r,i]}}get name(){return"circle"}svg(e={}){return`
<circle cx="${this.pc.x}" cy="${this.pc.y}" r="${this.r}"
${kr({fill:"none",...e})} />`}};u.Circle=rx;var P8=(...t)=>new u.Circle(...t);u.circle=P8;class Hl extends qe{constructor(...t){super();if(this.pc=new u.Point,this.r=1,this.startAngle=0,this.endAngle=2*Math.PI,this.counterClockwise=!0,t.length===0)return;if(t.length===1&&t[0]instanceof Object&&t[0].name==="arc"){let{pc:e,r,startAngle:i,endAngle:n,counterClockwise:o}=t[0];this.pc=new u.Point(e.x,e.y),this.r=r,this.startAngle=i,this.endAngle=n,this.counterClockwise=o}else{let[e,r,i,n,o]=[...t];if(e&&e instanceof u.Point)this.pc=e.clone();if(r!==void 0)this.r=r;if(i!==void 0)this.startAngle=i;if(n!==void 0)this.endAngle=n;if(o!==void 0)this.counterClockwise=o}}clone(){return new u.Arc(this.pc.clone(),this.r,this.startAngle,this.endAngle,this.counterClockwise)}get sweep(){let t=this.startAngle,e=this.endAngle;if(u.Utils.EQ(Math.abs(t-e),u.PIx2))return u.PIx2;if(Math.abs(t)>u.PIx2)t-=Math.trunc(t/u.PIx2)*u.PIx2;if(t<0)t+=u.PIx2;if(Math.abs(e)>u.PIx2)e-=Math.trunc(e/u.PIx2)*u.PIx2;if(e<0)e+=u.PIx2;let r=this.counterClockwise?e-t:t-e;if(r<0)r+=u.PIx2;return r}get start(){return new u.Point(this.pc.x+this.r,this.pc.y).rotate(this.startAngle,this.pc)}get end(){return new u.Point(this.pc.x+this.r,this.pc.y).rotate(this.endAngle,this.pc)}get center(){return this.pc.clone()}get vertices(){return[this.start.clone(),this.end.clone()]}get length(){return Math.abs(this.sweep*this.r)}get box(){let e=this.breakToFunctional().reduce((r,i)=>r.merge(i.start.box),new u.Box);return e=e.merge(this.end.box),e}contains(t){if(!u.Utils.EQ(this.pc.distanceTo(t)[0],this.r))return!1;if(t.equalTo(this.start))return!0;let e=new u.Vector(this.pc,t).slope,r=new u.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise);return u.Utils.LE(r.length,this.length)}split(t){if(this.start.equalTo(t))return[null,this.clone()];if(this.end.equalTo(t))return[this.clone(),null];let e=new u.Vector(this.pc,t).slope;return[new u.Arc(this.pc,this.r,this.startAngle,e,this.counterClockwise),new u.Arc(this.pc,this.r,e,this.endAngle,this.counterClockwise)]}middle(){let t=this.counterClockwise?this.startAngle+this.sweep/2:this.startAngle-this.sweep/2;return new u.Arc(this.pc,this.r,this.startAngle,t,this.counterClockwise).end}pointAtLength(t){if(t>this.length||t<0)return null;if(t===0)return this.start;if(t===this.length)return this.end;let e=t/this.length,r=this.counterClockwise?this.startAngle+this.sweep*e:this.startAngle-this.sweep*e;return new u.Arc(this.pc,this.r,this.startAngle,r,this.counterClockwise).end}chordHeight(){return(1-Math.cos(Math.abs(this.sweep/2)))*this.r}intersect(t){if(t instanceof u.Point)return this.contains(t)?[t]:[];if(t instanceof u.Line)return mo(t,this);if(t instanceof u.Ray)return Ql(t,this);if(t instanceof u.Circle)return Nl(this,t);if(t instanceof u.Segment)return hi(t,this);if(t instanceof u.Box)return Qv(this,t);if(t instanceof u.Arc)return L1(this,t);if(t instanceof u.Polygon)return zl(this,t);if(t instanceof u.Multiline)return ui(this,t)}distanceTo(t){if(t instanceof u.Point){let[e,r]=u.Distance.point2arc(t,this);return r=r.reverse(),[e,r]}if(t instanceof u.Circle){let[e,r]=u.Distance.arc2circle(this,t);return[e,r]}if(t instanceof u.Line){let[e,r]=u.Distance.arc2line(this,t);return[e,r]}if(t instanceof u.Segment){let[e,r]=u.Distance.segment2arc(t,this);return r=r.reverse(),[e,r]}if(t instanceof u.Arc){let[e,r]=u.Distance.arc2arc(this,t);return[e,r]}if(t instanceof u.Box){let[e,r]=u.Distance.shape2polygon(this,new u.Polygon(t));return[e,r]}if(t instanceof u.Polygon){let[e,r]=u.Distance.shape2polygon(this,t);return[e,r]}if(t instanceof u.PlanarSet){let[e,r]=u.Distance.shape2planarSet(this,t);return[e,r]}if(t instanceof u.Multiline)return u.Distance.shape2multiline(this,t)}breakToFunctional(){let t=[],e=[0,Math.PI/2,Math.PI,3*Math.PI/2],r=this.startAngle,i=this.endAngle;if(u.Utils.EQ(Math.abs(r-i),u.PIx2))i=r;if(Math.abs(r)>u.PIx2)r-=Math.trunc(r/u.PIx2)*u.PIx2;if(r<0)r+=u.PIx2;if(Math.abs(i)>u.PIx2)i-=Math.trunc(i/u.PIx2)*u.PIx2;if(i<0)i+=u.PIx2;let n=r,o,a,s;if(this.counterClockwise)a=Math.ceil(r/(Math.PI/2))%4,s=1;else a=Math.floor(r/(Math.PI/2))%4,s=-1;for(let l=0,c=a;l<4;l++,c=(c+s+4)%4){if(o=e[c],o===n)continue;let d=this.counterClockwise?o-r:r-o;if(d<0)d+=u.PIx2;if(d>this.sweep)break;t.push(new u.Arc(this.pc,this.r,n,o,this.counterClockwise)),n=o}if(t.length===0)return t.push(this),t;if(o=i,n!==o)t.push(new u.Arc(this.pc,this.r,n,o,this.counterClockwise));return t}tangentInStart(){let t=new u.Vector(this.pc,this.start),e=this.counterClockwise?Math.PI/2:-Math.PI/2;return t.rotate(e).normalize()}tangentInEnd(){let t=new u.Vector(this.pc,this.end),e=this.counterClockwise?-Math.PI/2:Math.PI/2;return t.rotate(e).normalize()}reverse(){return new u.Arc(this.pc,this.r,this.endAngle,this.startAngle,!this.counterClockwise)}transform(t=new u.Matrix){let e=this.start.transform(t),r=this.end.transform(t),i=this.pc.transform(t),n=this.counterClockwise;if(t.a*t.d<0)n=!n;return u.Arc.arcSE(i,e,r,n)}static arcSE(t,e,r,i){let{vector:n}=u,o=n(t,e).slope,a=n(t,r).slope;if(u.Utils.EQ(o,a))a+=2*Math.PI,i=!0;let s=n(t,e).length;return new u.Arc(t,s,o,a,i)}definiteIntegral(t=0){return this.breakToFunctional().reduce((i,n)=>i+n.circularSegmentDefiniteIntegral(t),0)}circularSegmentDefiniteIntegral(t){let r=new u.Segment(this.start,this.end).definiteIntegral(t),i=u.Utils.EQ(this.sweep,u.PIx2)?0:this.circularSegmentArea();return this.counterClockwise?r-i:r+i}circularSegmentArea(){return 0.5*this.r*this.r*(this.sweep-Math.sin(this.sweep))}sortPoints(t){let{vector:e}=u;return t.slice().sort((r,i)=>{let n=e(this.pc,r).slope,o=e(this.pc,i).slope;if(n<o)return-1;if(n>o)return 1;return 0})}get name(){return"arc"}svg(t={}){let e=this.sweep<=Math.PI?"0":"1",r=this.counterClockwise?"1":"0";if(u.Utils.EQ(this.sweep,2*Math.PI))return new u.Circle(this.pc,this.r).svg(t);else return`
<path d="M${this.start.x},${this.start.y}
A${this.r},${this.r} 0 ${e},${r} ${this.end.x},${this.end.y}"
${kr({fill:"none",...t})} />`}}u.Arc=Hl;var T8=(...t)=>new u.Arc(...t);u.arc=T8;class Fr extends qe{constructor(t=void 0,e=void 0,r=void 0,i=void 0){super();this.xmin=t,this.ymin=e,this.xmax=r,this.ymax=i}clone(){return new Fr(this.xmin,this.ymin,this.xmax,this.ymax)}get low(){return new u.Point(this.xmin,this.ymin)}get high(){return new u.Point(this.xmax,this.ymax)}get max(){return this.clone()}get center(){return new u.Point((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)}get width(){return Math.abs(this.xmax-this.xmin)}get height(){return Math.abs(this.ymax-this.ymin)}get box(){return this.clone()}not_intersect(t){return this.xmax<t.xmin||this.xmin>t.xmax||this.ymax<t.ymin||this.ymin>t.ymax}intersect(t){return!this.not_intersect(t)}merge(t){return new Fr(this.xmin===void 0?t.xmin:Math.min(this.xmin,t.xmin),this.ymin===void 0?t.ymin:Math.min(this.ymin,t.ymin),this.xmax===void 0?t.xmax:Math.max(this.xmax,t.xmax),this.ymax===void 0?t.ymax:Math.max(this.ymax,t.ymax))}less_than(t){if(this.low.lessThan(t.low))return!0;if(this.low.equalTo(t.low)&&this.high.lessThan(t.high))return!0;return!1}equal_to(t){return this.low.equalTo(t.low)&&this.high.equalTo(t.high)}output(){return this.clone()}comparable_less_than(t,e){return t.lessThan(e)}set(t,e,r,i){this.xmin=t,this.ymin=e,this.xmax=r,this.ymax=i}extend(t){if(t<=0)return this.clone();return new Fr(this.xmin-t,this.ymin-t,this.xmax+t,this.ymax+t)}toPoints(){return[new u.Point(this.xmin,this.ymin),new u.Point(this.xmax,this.ymin),new u.Point(this.xmax,this.ymax),new u.Point(this.xmin,this.ymax)]}toSegments(){let t=this.toPoints();return[new u.Segment(t[0],t[1]),new u.Segment(t[1],t[2]),new u.Segment(t[2],t[3]),new u.Segment(t[3],t[0])]}rotate(t,e=new u.Point){throw $t.OPERATION_IS_NOT_SUPPORTED}transform(t=new u.Matrix){return this.toPoints().map((r)=>r.transform(t)).reduce((r,i)=>r.merge(i.box),new Fr)}contains(t){if(t instanceof u.Point)return t.x>=this.xmin&&t.x<=this.xmax&&t.y>=this.ymin&&t.y<=this.ymax;if(t instanceof u.Segment)return t.vertices.every((e)=>this.contains(e));if(t instanceof u.Box)return t.toSegments().every((e)=>this.contains(e));if(t instanceof u.Circle)return this.contains(t.box);if(t instanceof u.Arc)return t.vertices.every((e)=>this.contains(e))&&this.toSegments().every((e)=>hi(e,t).length===0);if(t instanceof u.Line||t instanceof u.Ray)return!1;if(t instanceof u.Multiline)return t.toShapes().every((e)=>this.contains(e));if(t instanceof u.Polygon)return this.contains(t.box)}distanceTo(t){let e=this.toSegments().map((i)=>i.distanceTo(t)),r=[Number.MAX_SAFE_INTEGER,null];return e.forEach((i)=>{if(i[0]<r[0])r=i}),r}get name(){return"box"}svg(t={}){let e=this.xmax-this.xmin,r=this.ymax-this.ymin;return`
<rect x="${this.xmin}" y="${this.ymin}" width="${e}" height="${r}"
${kr({fill:"none",...t})} />`}}u.Box=Fr;var W8=(...t)=>new u.Box(...t);u.box=W8;class ix{constructor(t){this.shape=t,this.next=void 0,this.prev=void 0,this.face=void 0,this.arc_length=0,this.bvStart=void 0,this.bvEnd=void 0,this.bv=void 0,this.overlap=void 0}get start(){return this.shape.start}get end(){return this.shape.end}get length(){return this.shape.length}get box(){return this.shape.box}get isSegment(){return this.shape instanceof u.Segment}get isArc(){return this.shape instanceof u.Arc}get isLine(){return this.shape instanceof u.Line}get isRay(){return this.shape instanceof u.Ray}middle(){return this.shape.middle()}pointAtLength(t){return this.shape.pointAtLength(t)}contains(t){return this.shape.contains(t)}setInclusion(t){if(this.bv!==void 0)return this.bv;if(this.shape instanceof u.Line||this.shape instanceof u.Ray)return this.bv=u.OUTSIDE,this.bv;if(this.bvStart===void 0)this.bvStart=pn(t,this.start);if(this.bvEnd===void 0)this.bvEnd=pn(t,this.end);if(this.bvStart===u.OUTSIDE||this.bvEnd==u.OUTSIDE)this.bv=u.OUTSIDE;else if(this.bvStart===u.INSIDE||this.bvEnd==u.INSIDE)this.bv=u.INSIDE;else{let e=pn(t,this.middle());this.bv=e}return this.bv}setOverlap(t){let e=void 0,r=this.shape,i=t.shape;if(r instanceof u.Segment&&i instanceof u.Segment){if(r.start.equalTo(i.start)&&r.end.equalTo(i.end))e=u.OVERLAP_SAME;else if(r.start.equalTo(i.end)&&r.end.equalTo(i.start))e=u.OVERLAP_OPPOSITE}else if(r instanceof u.Arc&&i instanceof u.Arc){if(r.start.equalTo(i.start)&&r.end.equalTo(i.end)&&r.middle().equalTo(i.middle()))e=u.OVERLAP_SAME;else if(r.start.equalTo(i.end)&&r.end.equalTo(i.start)&&r.middle().equalTo(i.middle()))e=u.OVERLAP_OPPOSITE}else if(r instanceof u.Segment&&i instanceof u.Arc||r instanceof u.Arc&&i instanceof u.Segment){if(r.start.equalTo(i.start)&&r.end.equalTo(i.end)&&r.middle().equalTo(i.middle()))e=u.OVERLAP_SAME;else if(r.start.equalTo(i.end)&&r.end.equalTo(i.start)&&r.middle().equalTo(i.middle()))e=u.OVERLAP_OPPOSITE}if(this.overlap===void 0)this.overlap=e;if(t.overlap===void 0)t.overlap=e}svg(){if(this.shape instanceof u.Segment)return` L${this.shape.end.x},${this.shape.end.y}`;else if(this.shape instanceof u.Arc){let t=this.shape,e,r=t.counterClockwise?"1":"0";if(u.Utils.EQ(t.sweep,2*Math.PI)){let i=t.counterClockwise?1:-1,n=new u.Arc(t.pc,t.r,t.startAngle,t.startAngle+i*Math.PI,t.counterClockwise),o=new u.Arc(t.pc,t.r,t.startAngle+i*Math.PI,t.endAngle,t.counterClockwise);return e="0",` A${n.r},${n.r} 0 ${e},${r} ${n.end.x},${n.end.y}
A${o.r},${o.r} 0 ${e},${r} ${o.end.x},${o.end.y}`}else return e=t.sweep<=Math.PI?"0":"1",` A${t.r},${t.r} 0 ${e},${r} ${t.end.x},${t.end.y}`}}toJSON(){return this.shape.toJSON()}}u.Edge=ix;class nx extends _o{constructor(t,e){super(t,e);this.setCircularLinks()}setCircularLinks(){if(this.isEmpty())return;this.last.next=this.first,this.first.prev=this.last}[Symbol.iterator](){let t=void 0;return{next:()=>{let e=t?t:this.first,r=this.first?t?t===this.first:!1:!0;return t=e?e.next:void 0,{value:e,done:r}}}}append(t){return super.append(t),this.setCircularLinks(),this}insert(t,e){return super.insert(t,e),this.setCircularLinks(),this}remove(t){return super.remove(t),this}}class oi extends nx{constructor(t,...e){super();if(this._box=void 0,this._orientation=void 0,e.length===0)return;if(e.length===1){if(e[0]instanceof Array){let r=e[0];if(r.length===0)return;if(r.every((i)=>i instanceof u.Point)){let i=oi.points2segments(r);this.shapes2face(t.edges,i)}else if(r.every((i)=>i instanceof Array&&i.length===2)){let i=r.map((o)=>new u.Point(o[0],o[1])),n=oi.points2segments(i);this.shapes2face(t.edges,n)}else if(r.every((i)=>i instanceof u.Segment||i instanceof u.Arc))this.shapes2face(t.edges,r);else if(r.every((i)=>i.name==="segment"||i.name==="arc")){let i=[];for(let n of r){let o;if(n.name==="segment")o=new u.Segment(n);else o=new u.Arc(n);i.push(o)}this.shapes2face(t.edges,i)}}else if(e[0]instanceof oi){let r=e[0];this.first=r.first,this.last=r.last;for(let i of r)t.edges.add(i)}else if(e[0]instanceof u.Circle)this.shapes2face(t.edges,[e[0].toArc(!0)]);else if(e[0]instanceof u.Box){let r=e[0];this.shapes2face(t.edges,[new u.Segment(new u.Point(r.xmin,r.ymin),new u.Point(r.xmax,r.ymin)),new u.Segment(new u.Point(r.xmax,r.ymin),new u.Point(r.xmax,r.ymax)),new u.Segment(new u.Point(r.xmax,r.ymax),new u.Point(r.xmin,r.ymax)),new u.Segment(new u.Point(r.xmin,r.ymax),new u.Point(r.xmin,r.ymin))])}}if(e.length===2&&e[0]instanceof u.Edge&&e[1]instanceof u.Edge)this.first=e[0],this.last=e[1],this.last.next=this.first,this.first.prev=this.last,this.setArcLength()}get edges(){return this.toArray()}get vertices(){return this.edges.map((t)=>t.shape.start.clone())}get shapes(){return this.edges.map((t)=>t.shape.clone())}get box(){if(this._box===void 0){let t=new u.Box;for(let e of this)t=t.merge(e.box);this._box=t}return this._box}get perimeter(){return this.last.arc_length+this.last.length}pointAtLength(t){if(t>this.perimeter||t<0)return null;let e=null;for(let r of this)if(t>=r.arc_length&&(r===this.last||t<r.next.arc_length)){e=r.pointAtLength(t-r.arc_length);break}return e}static points2segments(t){let e=[];for(let r=0;r<t.length;r++){if(t[r].equalTo(t[(r+1)%t.length]))continue;e.push(new u.Segment(t[r],t[(r+1)%t.length]))}return e}shapes2face(t,e){for(let r of e){let i=new u.Edge(r);this.append(i),t.add(i)}}append(t){return super.append(t),this.setOneEdgeArcLength(t),t.face=this,this}insert(t,e){return super.insert(t,e),this.setOneEdgeArcLength(t),t.face=this,this}remove(t){return super.remove(t),this.setArcLength(),this}merge_with_next_edge(t){return t.shape.end.x=t.next.shape.end.x,t.shape.end.y=t.next.shape.end.y,this.remove(t.next),this}reverse(){let t=[],e=this.last;do e.shape=e.shape.reverse(),t.push(e),e=e.prev;while(e!==this.last);this.first=void 0,this.last=void 0;for(let r of t){if(this.first===void 0)r.prev=r,r.next=r,this.first=r,this.last=r;else r.prev=this.last,this.last.next=r,this.last=r,this.last.next=this.first,this.first.prev=this.last;this.setOneEdgeArcLength(r)}if(this._orientation!==void 0)this._orientation=void 0,this._orientation=this.orientation()}setArcLength(){for(let t of this)this.setOneEdgeArcLength(t),t.face=this}setOneEdgeArcLength(t){if(t===this.first)t.arc_length=0;else t.arc_length=t.prev.arc_length+t.prev.length}area(){return Math.abs(this.signedArea())}signedArea(){let t=0,e=this.box.ymin;for(let r of this)t+=r.shape.definiteIntegral(e);return t}orientation(){if(this._orientation===void 0){let t=this.signedArea();if(u.Utils.EQ_0(t))this._orientation=ai.NOT_ORIENTABLE;else if(u.Utils.LT(t,0))this._orientation=ai.CCW;else this._orientation=ai.CW}return this._orientation}isSimple(t){return oi.getSelfIntersections(this,t,!0).length===0}static getSelfIntersections(t,e,r=!1){let i=[];for(let n of t){let o=e.search(n.box);for(let a of o){if(n===a)continue;if(a.face!==t)continue;if(n.shape instanceof u.Segment&&a.shape instanceof u.Segment&&(n.next===a||n.prev===a))continue;let s=n.shape.intersect(a.shape);for(let l of s){if(l.equalTo(n.start)&&l.equalTo(a.end)&&a===n.prev)continue;if(l.equalTo(n.end)&&l.equalTo(a.start)&&a===n.next)continue;if(i.push(l),r)break}if(i.length>0&&r)break}if(i.length>0&&r)break}return i}findEdgeByPoint(t){let e;for(let r of this){if(t.equalTo(r.shape.start))continue;if(t.equalTo(r.shape.end)||r.shape.contains(t)){e=r;break}}return e}toPolygon(){return new u.Polygon(this.shapes)}toJSON(){return this.edges.map((t)=>t.toJSON())}svg(){let t=`M${this.first.start.x},${this.first.start.y}`;for(let e of this)t+=e.svg();return t+=" z",t}}u.Face=oi;class Gl extends qe{constructor(...t){super();if(this.pt=new u.Point,this.norm=new u.Vector(0,1),t.length===0)return;if(t.length>=1&&t[0]instanceof u.Point)this.pt=t[0].clone();if(t.length===1)return;if(t.length===2&&t[1]instanceof u.Vector){this.norm=t[1].clone();return}throw $t.ILLEGAL_PARAMETERS}clone(){return new Gl(this.pt,this.norm)}get slope(){return new u.Vector(this.norm.y,-this.norm.x).slope}get box(){let t=this.slope;return new u.Box(t>Math.PI/2&&t<3*Math.PI/2?Number.NEGATIVE_INFINITY:this.pt.x,t>=0&&t<=Math.PI?this.pt.y:Number.NEGATIVE_INFINITY,t>=Math.PI/2&&t<=3*Math.PI/2?this.pt.x:Number.POSITIVE_INFINITY,t>=Math.PI&&t<=2*Math.PI||t===0?this.pt.y:Number.POSITIVE_INFINITY)}get start(){return this.pt}get end(){return}get length(){return Number.POSITIVE_INFINITY}contains(t){if(this.pt.equalTo(t))return!0;let e=new u.Vector(this.pt,t);return u.Utils.EQ_0(this.norm.dot(e))&&u.Utils.GE(e.cross(this.norm),0)}coord(t){return tx(t.x,t.y).cross(this.norm)}split(t){if(!this.contains(t))return[];if(this.pt.equalTo(t))return[this];return[new u.Segment(this.pt,t),new u.Ray(t,this.norm)]}intersect(t){if(t instanceof u.Point)return this.contains(t)?[t]:[];if(t instanceof u.Segment)return Dl(this,t);if(t instanceof u.Arc)return Ql(this,t);if(t instanceof u.Line)return X1(this,t);if(t instanceof u.Ray)return Jv(this,t);if(t instanceof u.Circle)return C1(this,t);if(t instanceof u.Box)return Kv(this,t);if(t instanceof u.Polygon)return $1(this,t);if(t instanceof u.Multiline)return ui(this,t)}rotate(t,e=new u.Point){return new u.Ray(this.pt.rotate(t,e),this.norm.rotate(t))}transform(t){return new u.Ray(this.pt.transform(t),this.norm.clone())}get name(){return"ray"}svg(t,e={}){let r=new u.Line(this.pt,this.norm),i=si(r,t);if(i=i.filter((o)=>this.contains(o)),i.length===0||i.length===2)return"";return new u.Segment(this.pt,i[0]).svg(e)}}u.Ray=Gl;var O8=(...t)=>new u.Ray(...t);u.ray=O8;var ox=class t{constructor(){this.faces=new u.PlanarSet,this.edges=new u.PlanarSet;let e=[...arguments];if(e.length===1&&(e[0]instanceof Array&&e[0].length>0||e[0]instanceof u.Circle||e[0]instanceof u.Box)){let r=e[0];if(e[0]instanceof Array&&e[0].every((i)=>i instanceof Array))if(r.every((i)=>i instanceof Array&&i.length===2&&typeof i[0]==="number"&&typeof i[1]==="number"))this.faces.add(new u.Face(this,r));else for(let i of r)if(i instanceof Array&&i[0]instanceof Array&&i[0].every((n)=>n instanceof Array&&n.length===2&&typeof n[0]==="number"&&typeof n[1]==="number"))for(let n of i)this.faces.add(new u.Face(this,n));else this.faces.add(new u.Face(this,i));else this.faces.add(new u.Face(this,r))}}get box(){return[...this.faces].reduce((e,r)=>e.merge(r.box),new u.Box)}get vertices(){return[...this.faces].flatMap((e)=>e.vertices)}clone(){let e=new t;for(let r of this.faces)e.addFace(r.shapes);return e}createFromArray(e){let r=new t;return e.forEach((i)=>[...i.faces].forEach((n)=>r.addFace(n.shapes))),r}isEmpty(){return this.edges.size===0||this.faces.size===0}isValid(){let e=!0;for(let r of this.faces)if(!r.isSimple(this.edges)){e=!1;break}return e}area(){let e=[...this.faces].reduce((r,i)=>r+i.signedArea(),0);return Math.abs(e)}addFace(...e){let r=new u.Face(this,...e);return this.faces.add(r),r}deleteFace(e){for(let r of e)this.edges.delete(r);return this.faces.delete(e)}recreateFaces(){this.faces.clear();for(let i of this.edges)i.face=null;let e,r=!0;while(r){r=!1;for(let i of this.edges)if(i.face===null){e=i,r=!0;break}if(r){let i=e;do i=i.next;while(i.next!==e);this.addFace(e,i)}}}removeChain(e,r,i){if(i.next===r){this.deleteFace(e);return}for(let n=r;n!==i.next;n=n.next)if(e.remove(n),this.edges.delete(n),e.isEmpty()){this.deleteFace(e);break}}addVertex(e,r){let i=r.shape.split(e);if(i[0]===null)return r.prev;if(i[1]===null)return r;let n=new u.Edge(i[0]),o=r.prev;return r.face.insert(n,o),this.edges.delete(r),this.edges.add(n),r.shape=i[1],this.edges.add(r),n}removeEndVertex(e){let r=e.next;if(r===e)return;e.face.merge_with_next_edge(e),this.edges.delete(r)}cut(e){let i=this.splitToIslands().flatMap((n)=>n._cutSingleIsland(e)).filter((n)=>n.isValid()&&n.isEmpty()===!1);return this.createFromArray(i)}_cutSingleIsland(e){let r=this.clone(),i=e.clone(),n={int_points1:[],int_points2:[],int_points1_sorted:[],int_points2_sorted:[]};for(let s of i.edges)for(let l of r.edges){let c=O1(s,l);for(let d of c)ci(s,d,n.int_points1),ci(l,d,n.int_points2)}if(n.int_points1.length===0)return r;n.int_points1_sorted=pr(n.int_points1),n.int_points2_sorted=pr(n.int_points2),pi(i,n.int_points1_sorted),pi(r,n.int_points2_sorted),Ul(n),n.int_points1_sorted=pr(n.int_points1),n.int_points2_sorted=pr(n.int_points2),Wl(n.int_points1),Ol(n.int_points1,r);for(let s of n.int_points1_sorted)if(s.edge_before&&s.edge_after&&s.edge_before.bv===s.edge_after.bv)n.int_points2[s.id]=-1,s.id=-1;if(n.int_points1=n.int_points1.filter((s)=>s.id>=0),n.int_points2=n.int_points2.filter((s)=>s.id>=0),n.int_points1.forEach((s,l)=>{s.id=l}),n.int_points2.forEach((s,l)=>{s.id=l}),n.int_points1.length===0)return r;n.int_points1_sorted=pr(n.int_points1),n.int_points2_sorted=pr(n.int_points2);let o,a;for(let s=1;s<n.int_points1_sorted.length;s++)if(a=n.int_points1_sorted[s],o=n.int_points1_sorted[s-1],a.edge_before&&a.edge_before.bv===1){let l=o.edge_after,c=a.edge_before,d=i.getChain(l,c);y1(n.int_points2[o.id],n.int_points2[a.id],d),d.forEach((h)=>r.edges.add(h)),d=d.reverse().map((h)=>new u.Edge(h.shape.reverse()));for(let h=0;h<d.length-1;h++)d[h].next=d[h+1],d[h+1].prev=d[h];y1(n.int_points2[a.id],n.int_points2[o.id],d),d.forEach((h)=>r.edges.add(h))}return r.recreateFaces(),r}cutWithLine(e){let r=new Mr([e]);return this.cut(r)}findEdgeByPoint(e){let r;for(let i of this.faces)if(r=i.findEdgeByPoint(e),r!==void 0)break;return r}splitToIslands(){if(this.isEmpty())return[];let e=this.toArray();e.sort((n,o)=>o.area()-n.area());let r=[...e[0].faces][0].orientation(),i=e.filter((n)=>[...n.faces][0].orientation()===r);for(let n of e){let o=[...n.faces][0];if(o.orientation()===r)continue;for(let a of i)if(o.shapes.every((s)=>a.contains(s))){a.addFace(o.shapes);break}}return i}rearrange(){if(this.faces.size<=1)return this.clone();let e=this.splitToIslands(),r=new t;return e.forEach((i)=>{i.faces.forEach((n)=>r.addFace(n.shapes))}),r}orientation(){if(this.isEmpty())return ai.NOT_ORIENTABLE;return[...this.faces][0].orientation()}isOuter(e){return e.orientation()===this.orientation()}isMultiPolygon(){let e=0;return this.faces.forEach((r)=>{if(this.isOuter(r))e++}),e>1}reverse(){for(let e of this.faces)e.reverse();return this}contains(e){if(e instanceof u.Point){let r=pn(this,e);return r===1||r===2}else return G1(this,e)}distanceTo(e){if(e instanceof u.Point){let[r,i]=u.Distance.point2polygon(e,this);return i=i.reverse(),[r,i]}if(e instanceof u.Circle||e instanceof u.Line||e instanceof u.Segment||e instanceof u.Arc){let[r,i]=u.Distance.shape2polygon(e,this);return i=i.reverse(),[r,i]}if(e instanceof u.Box)return this.distanceTo(new u.Polygon(e));if(e instanceof u.Polygon){let r=[Number.POSITIVE_INFINITY,new u.Segment],i,n;for(let o of this.edges){let a=r[0];if([i,n]=u.Distance.shape2planarSet(o.shape,e.edges,a),u.Utils.LT(i,a))r=[i,n]}return r}}intersect(e){if(e instanceof u.Point)return this.contains(e)?[e]:[];if(e instanceof u.Line)return _n(e,this);if(e instanceof u.Ray)return $1(e,this);if(e instanceof u.Circle)return W1(e,this);if(e instanceof u.Segment)return Vl(e,this);if(e instanceof u.Arc)return zl(e,this);if(e instanceof u.Polygon)return Gv(e,this);if(e instanceof u.Multiline)return Hv(e,this)}translate(e){let r=new t;for(let i of this.faces)r.addFace(i.shapes.map((n)=>n.translate(e)));return r}rotate(e=0,r=new u.Point){let i=new t;for(let n of this.faces)i.addFace(n.shapes.map((o)=>o.rotate(e,r)));return i}scale(e,r){let i=new t;for(let n of this.faces)i.addFace(n.shapes.map((o)=>o.scale(e,r)));return i}transform(e=new u.Matrix){let r=new t;for(let i of this.faces)r.addFace(i.shapes.map((n)=>n.transform(e)));return r}toJSON(){return[...this.faces].map((e)=>e.toJSON())}toArray(){return[...this.faces].map((e)=>e.toPolygon())}dpath(){return[...this.faces].reduce((e,r)=>e+r.svg(),"")}svg(e={}){let r=`
<path ${kr({fillRule:"evenodd",fill:"lightcyan",...e})} d="`;for(let i of this.faces)r+=`
${i.svg()}`;return r+=`" >
</path>`,r}};u.Polygon=ox;var j8=(...t)=>new u.Polygon(...t);u.polygon=j8;var{Circle:El,Line:w1,Point:A1,Vector:uo,Utils:Pl}=u;class dn{constructor(t){this.circle=t}get inversion_circle(){return this.circle}static inversePoint(t,e){let r=new uo(t.pc,e),i=t.r*t.r,n=r.dot(r);return Pl.EQ_0(n)?new A1(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY):t.pc.translate(r.multiply(i/n))}static inverseCircle(t,e){let r=t.pc.distanceTo(e.pc)[0];if(Pl.EQ(r,e.r)){let i=t.r*t.r/(2*e.r),n=new uo(t.pc,e.pc);n=n.normalize();let o=t.pc.translate(n.multiply(i));return new w1(o,n)}else{let i=new uo(t.pc,e.pc),n=t.r*t.r/(i.dot(i)-e.r*e.r),o=t.pc.translate(i.multiply(n)),a=Math.abs(n)*e.r;return new El(o,a)}}static inverseLine(t,e){let[r,i]=t.pc.distanceTo(e);if(Pl.EQ_0(r))return e.clone();else{let n=t.r*t.r/(2*r),o=new uo(t.pc,i.end);return o=o.multiply(n/r),new El(t.pc.translate(o),n)}}inverse(t){if(t instanceof A1)return dn.inversePoint(this.circle,t);else if(t instanceof El)return dn.inverseCircle(this.circle,t);else if(t instanceof w1)return dn.inverseLine(this.circle,t)}}u.Inversion=dn;var R8=(t)=>new u.Inversion(t);u.inversion=R8;class ct{static point2point(t,e){return t.distanceTo(e)}static point2line(t,e){let r=t.projectionOn(e);return[new u.Vector(t,r).length,new u.Segment(t,r)]}static point2circle(t,e){let[r,i]=t.distanceTo(e.center);if(u.Utils.EQ_0(r))return[e.r,new u.Segment(t,e.toArc().start)];else{let n=Math.abs(r-e.r),o=new u.Vector(e.pc,t).normalize().multiply(e.r),a=e.pc.translate(o);return[n,new u.Segment(t,a)]}}static point2segment(t,e){if(e.start.equalTo(e.end))return ct.point2point(t,e.start);let r=new u.Vector(e.start,e.end),i=new u.Vector(e.start,t),n=new u.Vector(e.end,t),o=r.dot(i),a=-r.dot(n),s,l;if(u.Utils.GE(o,0)&&u.Utils.GE(a,0)){let c=e.tangentInStart();return s=Math.abs(c.cross(i)),l=e.start.translate(c.multiply(c.dot(i))),[s,new u.Segment(t,l)]}else if(o<0)return t.distanceTo(e.start);else return t.distanceTo(e.end)}static point2arc(t,e){let r=new u.Circle(e.pc,e.r),i=[],n,o;if([n,o]=ct.point2circle(t,r),o.end.on(e))i.push(ct.point2circle(t,r));return i.push(ct.point2point(t,e.start)),i.push(ct.point2point(t,e.end)),ct.sort(i),i[0]}static point2edge(t,e){return e.shape instanceof u.Segment?ct.point2segment(t,e.shape):ct.point2arc(t,e.shape)}static segment2line(t,e){let r=t.intersect(e);if(r.length>0)return[0,new u.Segment(r[0],r[0])];let i=[];return i.push(ct.point2line(t.start,e)),i.push(ct.point2line(t.end,e)),ct.sort(i),i[0]}static segment2segment(t,e){let r=fo(t,e);if(r.length>0)return[0,new u.Segment(r[0],r[0])];let i=[],n,o;return[n,o]=ct.point2segment(e.start,t),i.push([n,o.reverse()]),[n,o]=ct.point2segment(e.end,t),i.push([n,o.reverse()]),i.push(ct.point2segment(t.start,e)),i.push(ct.point2segment(t.end,e)),ct.sort(i),i[0]}static segment2circle(t,e){let r=t.intersect(e);if(r.length>0)return[0,new u.Segment(r[0],r[0])];let i=new u.Line(t.ps,t.pe),[n,o]=ct.point2line(e.center,i);if(u.Utils.GE(n,e.r)&&o.end.on(t))return ct.point2circle(o.end,e);else{let[a,s]=ct.point2circle(t.start,e),[l,c]=ct.point2circle(t.end,e);return u.Utils.LT(a,l)?[a,s]:[l,c]}}static segment2arc(t,e){let r=t.intersect(e);if(r.length>0)return[0,new u.Segment(r[0],r[0])];let i=new u.Line(t.ps,t.pe),n=new u.Circle(e.pc,e.r),[o,a]=ct.point2line(n.center,i);if(u.Utils.GE(o,n.r)&&a.end.on(t)){let[d,h]=ct.point2circle(a.end,n);if(h.end.on(e))return[d,h]}let s=[];s.push(ct.point2arc(t.start,e)),s.push(ct.point2arc(t.end,e));let l,c;return[l,c]=ct.point2segment(e.start,t),s.push([l,c.reverse()]),[l,c]=ct.point2segment(e.end,t),s.push([l,c.reverse()]),ct.sort(s),s[0]}static circle2circle(t,e){let r=t.intersect(e);if(r.length>0)return[0,new u.Segment(r[0],r[0])];if(t.center.equalTo(e.center)){let i=t.toArc(),n=e.toArc();return ct.point2point(i.start,n.start)}else{let i=new u.Line(t.center,e.center),n=i.intersect(t),o=i.intersect(e),a=[];return a.push(ct.point2point(n[0],o[0])),a.push(ct.point2point(n[0],o[1])),a.push(ct.point2point(n[1],o[0])),a.push(ct.point2point(n[1],o[1])),ct.sort(a),a[0]}}static circle2line(t,e){let r=t.intersect(e);if(r.length>0)return[0,new u.Segment(r[0],r[0])];let[i,n]=ct.point2line(t.center,e),[o,a]=ct.point2circle(n.end,t);return a=a.reverse(),[o,a]}static arc2line(t,e){let r=e.intersect(t);if(r.length>0)return[0,new u.Segment(r[0],r[0])];let i=new u.Circle(t.center,t.r),[n,o]=ct.point2line(i.center,e);if(u.Utils.GE(n,i.r)){let[a,s]=ct.point2circle(o.end,i);if(s.end.on(t))return[a,s]}else{let a=[];return a.push(ct.point2line(t.start,e)),a.push(ct.point2line(t.end,e)),ct.sort(a),a[0]}}static arc2circle(t,e){let r=t.intersect(e);if(r.length>0)return[0,new u.Segment(r[0],r[0])];let i=new u.Circle(t.center,t.r),[n,o]=ct.circle2circle(i,e);if(o.start.on(t))return[n,o];else{let a=[];return a.push(ct.point2circle(t.start,e)),a.push(ct.point2circle(t.end,e)),ct.sort(a),a[0]}}static arc2arc(t,e){let r=t.intersect(e);if(r.length>0)return[0,new u.Segment(r[0],r[0])];let i=new u.Circle(t.center,t.r),n=new u.Circle(e.center,e.r),[o,a]=ct.circle2circle(i,n);if(a.start.on(t)&&a.end.on(e))return[o,a];else{let s=[],l,c;if([l,c]=ct.point2arc(t.start,e),c.end.on(e))s.push([l,c]);if([l,c]=ct.point2arc(t.end,e),c.end.on(e))s.push([l,c]);if([l,c]=ct.point2arc(e.start,t),c.end.on(t))s.push([l,c.reverse()]);if([l,c]=ct.point2arc(e.end,t),c.end.on(t))s.push([l,c.reverse()]);return[l,c]=ct.point2point(t.start,e.start),s.push([l,c]),[l,c]=ct.point2point(t.start,e.end),s.push([l,c]),[l,c]=ct.point2point(t.end,e.start),s.push([l,c]),[l,c]=ct.point2point(t.end,e.end),s.push([l,c]),ct.sort(s),s[0]}}static point2polygon(t,e){let r=[Number.POSITIVE_INFINITY,new u.Segment];for(let i of e.edges){let[n,o]=ct.point2edge(t,i);if(u.Utils.LT(n,r[0]))r=[n,o]}return r}static shape2polygon(t,e){let r=[Number.POSITIVE_INFINITY,new u.Segment];for(let i of e.edges){let[n,o]=t.distanceTo(i.shape);if(u.Utils.LT(n,r[0]))r=[n,o]}return r}static polygon2polygon(t,e){let r=[Number.POSITIVE_INFINITY,new u.Segment];for(let i of t.edges)for(let n of e.edges){let[o,a]=i.shape.distanceTo(n.shape);if(u.Utils.LT(o,r[0]))r=[o,a]}return r}static box2box_minmax(t,e){let r=Math.max(Math.max(t.xmin-e.xmax,0),Math.max(e.xmin-t.xmax,0)),i=Math.max(Math.max(t.ymin-e.ymax,0),Math.max(e.ymin-t.ymax,0)),n=r*r+i*i,o=t.merge(e),a=o.xmax-o.xmin,s=o.ymax-o.ymin,l=a*a+s*s;return[n,l]}static minmax_tree_process_level(t,e,r,i){let n,o;for(let c of e){[n,o]=ct.box2box_minmax(t.box,c.item.key);for(let d of c.item.values)if(d instanceof u.Edge)i.insert([n,o],d.shape);else i.insert([n,o],d);if(u.Utils.LT(o,r))r=o}if(e.length===0)return r;let a=e.map((c)=>c.left.isNil()?void 0:c.left).filter((c)=>c!==void 0),s=e.map((c)=>c.right.isNil()?void 0:c.right).filter((c)=>c!==void 0),l=[...a,...s].filter((c)=>{let[d,h]=ct.box2box_minmax(t.box,c.max);return u.Utils.LE(d,r)});return r=ct.minmax_tree_process_level(t,l,r,i),r}static minmax_tree(t,e,r){let i=new un,n=[e.index.root],o=r<Number.POSITIVE_INFINITY?r*r:Number.POSITIVE_INFINITY;return o=ct.minmax_tree_process_level(t,n,o,i),i}static minmax_tree_calc_distance(t,e,r){let i,n;if(e!=null&&!e.isNil()){if([i,n]=ct.minmax_tree_calc_distance(t,e.left,r),n)return[i,n];if(u.Utils.LT(i[0],Math.sqrt(e.item.key.low)))return[i,!0];let[o,a]=ct.distanceToArray(t,e.item.values);if(u.Utils.LT(o,i[0]))i=[o,a];return[i,n]=ct.minmax_tree_calc_distance(t,e.right,i),[i,n]}return[r,!1]}static shape2planarSet(t,e,r=Number.POSITIVE_INFINITY){let i=[r,new u.Segment],n=!1;if(e instanceof u.PlanarSet){let o=ct.minmax_tree(t,e,r);[i,n]=ct.minmax_tree_calc_distance(t,o.root,i)}return i}static sort(t){t.sort((e,r)=>{if(u.Utils.LT(e[0],r[0]))return-1;if(u.Utils.GT(e[0],r[0]))return 1;return 0})}static distance(t,e){return t.distanceTo(e)}static distanceToArray(t,e){let r=[Number.POSITIVE_INFINITY,new u.Segment];for(let i of e){let[n,o]=t.distanceTo(i);if(u.Utils.LT(n,r[0]))r=[n,o]}return r}static shape2multiline(t,e){let r=[Number.POSITIVE_INFINITY,new u.Segment];for(let i of e){let[n,o]=ct.distance(t,i.shape);if(u.Utils.LT(n,r[0]))r=[n,o]}return r}static multiline2multiline(t,e){let r=[Number.POSITIVE_INFINITY,new u.Segment];for(let i of t)for(let n of e){let[o,a]=ct.distance(i.shape,n.shape);if(u.Utils.LT(o,r[0]))r=[o,a]}return r}}u.Distance=ct;var{Multiline:C8,Point:ax,Segment:X8,Polygon:sx}=u;function ql(t){return new ax(t.split(" ").map(Number))}function cx(t){return t.split(", ").map(ql)}function Kl(t){let e=cx(t),r=[];for(let i=0;i<e.length-1;i++)r.push(new X8(e[i],e[i+1]));return new C8(r)}function $8(t){return t.replace(/\(\(/,"").replace(/\)\)$/,"").split("), (").map(Kl)}function lx(t){let e=t.replace(/\(\(/,"").replace(/\)\)$/,"").split("), ("),r=new sx,i;return e.forEach((n,o)=>{let a=n.split(", ").map((l)=>new ax(l.split(" ").map(Number))),s=r.addFace(a);if(o===0)i=s.orientation();else if(s.orientation()===i)s.reverse()}),r}function N8(t){let r=t.split(/\)\), \(\(/).map((o)=>"(("+o+"))").map(lx),i=new sx;return r.reduce((o,a)=>[...o,...a?.faces],[]).forEach((o)=>i.addFace([...o?.shapes])),i}function V8(t){if(t.startsWith("POLYGON")){let e=t.replace(/^POLYGON /,"");return lx(e)}else{let e=t.replace(/^MULTIPOLYGON \(\(\((.*)\)\)\)$/,"$1");return N8(e)}}function z8(t){return t.split(`
`).map((r)=>r.match(/\(([^)]+)\)/)[1]).map(ql)}function D8(t){return t.split(`
`).map((r)=>r.match(/\(([^)]+)\)/)[1]).map(Kl).reduce((r,i)=>[...r,...i],[])}function px(t){if(t.startsWith("POINT")){let e=t.replace(/^POINT \(/,"").replace(/\)$/,"");return ql(e)}else if(t.startsWith("MULTIPOINT")){let e=t.replace(/^MULTIPOINT \(/,"").replace(/\)$/,"");return cx(e)}else if(t.startsWith("LINESTRING")){let e=t.replace(/^LINESTRING \(/,"").replace(/\)$/,"");return Kl(e)}else if(t.startsWith("MULTILINESTRING")){let e=t.replace(/^MULTILINESTRING /,"");return $8(e)}else if(t.startsWith("POLYGON")||t.startsWith("MULTIPOLYGON"))return V8(t);else if(t.startsWith("GEOMETRYCOLLECTION")){let e=/(?<type>POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON) \((?:[^\(\)]|\([^\)]*\))*\)/g,r=t.match(e);if(r[0].startsWith("GEOMETRYCOLLECTION"))r[0]=r[0].replace("GEOMETRYCOLLECTION (","");return r.map(px).map((n)=>n instanceof Array?n:[n]).reduce((n,o)=>[...n,...o],[])}else if(dx(t))return z8(t);else if(hx(t))return D8(t);return[]}function dx(t){return t.split(`
`)?.every((e)=>e.includes("POINT"))}function hx(t){return t.split(`
`)?.every((e)=>e.includes("LINESTRING"))}function Q8(t){return t.startsWith("POINT")||dx(t)||t.startsWith("LINESTRING")||hx(t)||t.startsWith("MULTILINESTRING")||t.startsWith("POLYGON")||t.startsWith("MULTIPOINT")||t.startsWith("MULTIPOLYGON")||t.startsWith("GEOMETRYCOLLECTION")}u.isWktString=Q8;u.parseWKT=px;u.BooleanOperations=h8;u.Relations=S8;function ux(t,e,r){if(!e||!r)return;let i=t.get(e);if(!i)i=new Set,t.set(e,i);i.add(r);let n=t.get(r);if(!n)n=new Set,t.set(r,n);n.add(e)}function yx(t,e){if(!e.subcircuit_id&&!e.source_group_id)return[...t];let r=e;if(e.subcircuit_id){let s=new Set([e.subcircuit_id]),l=new Map,c=new Map;for(let h of t)if(h.type==="source_group"){let{source_group_id:y,subcircuit_id:_}=h;if(_)c.set(y,_);let m=h.parent_source_group_id;if(m){if(!l.has(m))l.set(m,[]);l.get(m).push(y)}}let d;for(let[h,y]of c)if(y===e.subcircuit_id){d=h;break}if(d){let h=(y)=>{let _=l.get(y)||[];for(let m of _){let g=c.get(m);if(g)s.add(g);h(m)}};h(d),r={...e,subcircuit_ids:Array.from(s)}}}let i=new Map;for(let s of t){let l=`${s.type}_id`,c=s[l];if(typeof c==="string")i.set(c,s)}let n=new Map;for(let s of t){let l=Object.entries(s);for(let[c,d]of l){if(c==="parent_source_group_id")continue;if(c.endsWith("_id")&&typeof d==="string"){let h=i.get(d);ux(n,s,h)}else if(c.endsWith("_ids")&&Array.isArray(d)){for(let h of d)if(typeof h==="string"){let y=i.get(h);ux(n,s,y)}}}}let o=[],a=new Set;for(let s of t){let l=!1;if(r.subcircuit_id&&"subcircuit_id"in s&&s.subcircuit_id===r.subcircuit_id)l=!0;else if(r.subcircuit_ids&&"subcircuit_id"in s&&s.subcircuit_id&&r.subcircuit_ids.includes(s.subcircuit_id))l=!0;else if(r.source_group_id&&"source_group_id"in s&&s.source_group_id===r.source_group_id)l=!0;else if(r.source_group_id&&"member_source_group_ids"in s&&Array.isArray(s.member_source_group_ids)&&s.member_source_group_ids.includes(r.source_group_id))l=!0;if(l)o.push(s),a.add(s)}while(o.length>0){let s=o.shift(),l=n.get(s);if(!l)continue;for(let c of l)if(!a.has(c))a.add(c),o.push(c)}return t.filter((s)=>a.has(s))}var bo=(t,e={})=>{let r=t,i=r._internal_store;if(!i){i={counts:{},editCount:0},r._internal_store=i;for(let o of r){let a=o.type,s=o[`${a}_id`];if(!s)continue;let l=Number.parseInt(s.split("_").pop());if(!Number.isNaN(l))i.counts[a]=Math.max(i.counts[a]??0,l)}}let n=new Proxy({},{get:(o,a)=>{if(a==="toArray")return()=>(r.editCount=i.editCount,r);if(a==="editCount")return i.editCount;if(a==="subtree")return(l)=>bo(yx(r,l),e);if(a==="insert")return(l)=>{let c=l.type;if(!c)throw Error("insert requires an element with a type");i.counts[c]??=-1,i.counts[c]++;let d=i.counts[c],h={...l,type:c,[`${c}_id`]:`${c}_${d}`};if(e.validateInserts)(qr[c]??Gr).parse(h);return r.push(h),i.editCount++,h};if(a==="insertAll")return(l)=>l.map((c)=>n.insert(c));let s=a;return{get:(l)=>r.find((c)=>c.type===s&&c[`${s}_id`]===l),getUsing:(l)=>{let c=Object.keys(l);if(c.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let d=c[0],h=d.replace("_id",""),y=r.find((_)=>_.type===h&&_[d]===l[d]);if(!y)return null;return r.find((_)=>_.type===s&&_[`${s}_id`]===y[`${s}_id`])},getWhere:(l)=>{let c=Object.keys(l);return r.find((d)=>d.type===s&&c.every((h)=>d[h]===l[h]))},list:(l)=>{let c=!l?[]:Object.keys(l);return r.filter((d)=>d.type===s&&c.every((h)=>d[h]===l[h]))},insert:(l)=>{i.counts[s]??=-1,i.counts[s]++;let c=i.counts[s],d={type:s,[`${s}_id`]:`${s}_${c}`,...l};if(e.validateInserts)(qr[s]??Gr).parse(d);return r.push(d),i.editCount++,d},delete:(l)=>{let c=r.find((d)=>d[`${s}_id`]===l);if(!c)return;r.splice(r.indexOf(c),1),i.editCount++},update:(l,c)=>{let d=r.find((h)=>h.type===s&&h[`${s}_id`]===l);if(!d)return null;return Object.assign(d,c),i.editCount++,d},select:(l)=>{if(s==="source_component")return r.find((c)=>c.type==="source_component"&&c.name===l.replace(/\./g,""));else if(s==="pcb_port"||s==="source_port"||s==="schematic_port"){let[c,d]=l.replace(/\./g,"").split(/[\s\>]+/),h=r.find((_)=>_.type==="source_component"&&_.name===c);if(!h)return null;let y=r.find((_)=>_.type==="source_port"&&_.source_component_id===h.source_component_id&&(_.name===d||(_.port_hints??[]).includes(d)));if(!y)return null;if(s==="source_port")return y;if(s==="pcb_port")return r.find((_)=>_.type==="pcb_port"&&_.source_port_id===y.source_port_id);else if(s==="schematic_port")return r.find((_)=>_.type==="schematic_port"&&_.source_port_id===y.source_port_id)}}}}});return n};bo.unparsed=bo;var qt=bo;function Jl(t){let e=t.type;return`${e}:${t[`${e}_id`]}`}var tp=(t,e={})=>{let r=t._internal_store_indexed;if(!r){r={counts:{},editCount:0,indexes:{}};for(let a of t){let s=a.type,l=a[`${s}_id`];if(!l)continue;let c=Number.parseInt(l.split("_").pop()||"");if(!Number.isNaN(c))r.counts[s]=Math.max(r.counts[s]??0,c)}let n=e.indexConfig||{},o=r.indexes;if(n.byId)o.byId=new Map;if(n.byType)o.byType=new Map;if(n.byRelation)o.byRelation=new Map;if(n.bySubcircuit)o.bySubcircuit=new Map;if(n.byCustomField&&n.byCustomField.length>0){o.byCustomField=new Map;for(let a of n.byCustomField)o.byCustomField.set(a,new Map)}for(let a of t){if(n.byId){let s=Jl(a);o.byId.set(s,a)}if(n.byType){let s=o.byType.get(a.type)||[];s.push(a),o.byType.set(a.type,s)}if(n.byRelation){let s=Object.entries(a);for(let[l,c]of s)if(l.endsWith("_id")&&l!==`${a.type}_id`&&typeof c==="string"){let d=o.byRelation.get(l)||new Map,h=d.get(c)||[];h.push(a),d.set(c,h),o.byRelation.set(l,d)}}if(n.bySubcircuit&&"subcircuit_id"in a){let s=a.subcircuit_id;if(s&&typeof s==="string"){let l=o.bySubcircuit.get(s)||[];l.push(a),o.bySubcircuit.set(s,l)}}if(n.byCustomField&&o.byCustomField){for(let s of n.byCustomField)if(s in a){let l=a[s];if(l!==void 0&&(typeof l==="string"||typeof l==="number")){let c=String(l),d=o.byCustomField.get(s),h=d.get(c)||[];h.push(a),d.set(c,h)}}}}t._internal_store_indexed=r}let i=new Proxy({},{get:(n,o)=>{if(o==="toArray")return()=>(t.editCount=r.editCount,t);if(o==="editCount")return r.editCount;if(o==="insert")return(s)=>{let{type:l,...c}=s;if(!l)throw Error("insert requires an element with a type");return delete c[`${l}_id`],i[l].insert(c)};if(o==="insertAll")return(s)=>s.map((l)=>i.insert(l));if(o==="subtree")return(s)=>tp(yx(t,s),e);let a=o;return{get:(s)=>{let l=e.indexConfig||{};if(l.byId&&r.indexes.byId)return r.indexes.byId.get(`${a}:${s}`)||null;if(l.byType&&r.indexes.byType)return(r.indexes.byType.get(a)||[]).find((d)=>d[`${a}_id`]===s)||null;return t.find((c)=>c.type===a&&c[`${a}_id`]===s)||null},getUsing:(s)=>{let l=e.indexConfig||{},c=Object.keys(s);if(c.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let d=c[0],h=d.replace("_id","");if(l.byRelation&&r.indexes.byRelation){let _=r.indexes.byRelation.get(d);if(_){let g=(_.get(s[d])||[]).find((v)=>v.type===h);if(!g)return null;let b=g[`${a}_id`];if(l.byId&&r.indexes.byId)return r.indexes.byId.get(`${a}:${b}`)||null;if(l.byType&&r.indexes.byType)return(r.indexes.byType.get(a)||[]).find((k)=>k[`${a}_id`]===b)||null;return t.find((v)=>v.type===a&&v[`${a}_id`]===b)||null}}let y=t.find((_)=>_.type===h&&_[d]===s[d]);if(!y)return null;return t.find((_)=>_.type===a&&_[`${a}_id`]===y[`${a}_id`])||null},getWhere:(s)=>{let l=e.indexConfig||{},c=Object.keys(s);if(c.length===1&&l.byCustomField&&r.indexes.byCustomField){let d=c[0],h=r.indexes.byCustomField.get(d);if(h){let y=String(s[d]);return(h.get(y)||[]).find((m)=>m.type===a)||null}}if("subcircuit_id"in s&&l.bySubcircuit&&r.indexes.bySubcircuit){let d=s.subcircuit_id;return(r.indexes.bySubcircuit.get(d)||[]).find((y)=>y.type===a&&c.every((_)=>y[_]===s[_]))||null}if(l.byType&&r.indexes.byType)return(r.indexes.byType.get(a)||[]).find((h)=>c.every((y)=>h[y]===s[y]))||null;return t.find((d)=>d.type===a&&c.every((h)=>d[h]===s[h]))||null},list:(s)=>{let l=e.indexConfig||{},c=!s?[]:Object.keys(s);if(c.length===0&&l.byType&&r.indexes.byType)return(r.indexes.byType.get(a)||[]).slice();if(c.length===1&&c[0]==="subcircuit_id"&&l.bySubcircuit&&r.indexes.bySubcircuit){let h=s.subcircuit_id;return(r.indexes.bySubcircuit.get(h)||[]).filter((_)=>_.type===a)}let d;if(l.byType&&r.indexes.byType)d=r.indexes.byType.get(a)||[];else d=t.filter((h)=>h.type===a);if(c.length>0)return d.filter((h)=>c.every((y)=>h[y]===s[y]));return d.slice()},insert:(s)=>{r.counts[a]??=-1,r.counts[a]++;let l=r.counts[a],c={type:a,[`${a}_id`]:`${a}_${l}`,...s};if(e.validateInserts)(qr[a]??Gr).parse(c);t.push(c),r.editCount++;let d=e.indexConfig||{};if(d.byId&&r.indexes.byId){let h=Jl(c);r.indexes.byId.set(h,c)}if(d.byType&&r.indexes.byType){let h=r.indexes.byType.get(a)||[];h.push(c),r.indexes.byType.set(a,h)}if(d.byRelation&&r.indexes.byRelation){let h=Object.entries(c);for(let[y,_]of h)if(y.endsWith("_id")&&y!==`${c.type}_id`&&typeof _==="string"){let m=r.indexes.byRelation.get(y)||new Map,g=m.get(_)||[];g.push(c),m.set(_,g),r.indexes.byRelation.set(y,m)}}if(d.bySubcircuit&&r.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h&&typeof h==="string"){let y=r.indexes.bySubcircuit.get(h)||[];y.push(c),r.indexes.bySubcircuit.set(h,y)}}if(d.byCustomField&&r.indexes.byCustomField){for(let h of d.byCustomField)if(h in c){let y=c[h];if(y!==void 0&&(typeof y==="string"||typeof y==="number")){let _=String(y),m=r.indexes.byCustomField.get(h),g=m.get(_)||[];g.push(c),m.set(_,g)}}}return c},delete:(s)=>{let l=e.indexConfig||{},c;if(l.byId&&r.indexes.byId)c=r.indexes.byId.get(`${a}:${s}`);else if(l.byType&&r.indexes.byType)c=(r.indexes.byType.get(a)||[]).find((y)=>y[`${a}_id`]===s);else c=t.find((h)=>h[`${a}_id`]===s);if(!c)return;let d=t.indexOf(c);if(d>=0)t.splice(d,1),r.editCount++;if(l.byId&&r.indexes.byId){let h=Jl(c);r.indexes.byId.delete(h)}if(l.byType&&r.indexes.byType){let y=(r.indexes.byType.get(a)||[]).filter((_)=>_[`${a}_id`]!==s);r.indexes.byType.set(a,y)}if(l.byRelation&&r.indexes.byRelation)for(let[h,y]of r.indexes.byRelation.entries())for(let[_,m]of y.entries()){let g=m.filter((b)=>b!==c);if(g.length===0)y.delete(_);else y.set(_,g)}if(l.bySubcircuit&&r.indexes.bySubcircuit&&"subcircuit_id"in c){let h=c.subcircuit_id;if(h){let _=(r.indexes.bySubcircuit.get(h)||[]).filter((m)=>m!==c);if(_.length===0)r.indexes.bySubcircuit.delete(h);else r.indexes.bySubcircuit.set(h,_)}}if(l.byCustomField&&r.indexes.byCustomField)for(let h of r.indexes.byCustomField.values())for(let[y,_]of h.entries()){let m=_.filter((g)=>g!==c);if(m.length===0)h.delete(y);else h.set(y,m)}},update:(s,l)=>{let c=e.indexConfig||{},d;if(c.byId&&r.indexes.byId)d=r.indexes.byId.get(`${a}:${s}`);else if(c.byType&&r.indexes.byType)d=(r.indexes.byType.get(a)||[]).find((y)=>y[`${a}_id`]===s);else d=t.find((h)=>h.type===a&&h[`${a}_id`]===s);if(!d)return null;if(c.byRelation&&r.indexes.byRelation){let h=Object.entries(d);for(let[y,_]of h)if(y.endsWith("_id")&&y!==`${d.type}_id`&&typeof _==="string"){if(y in l&&l[y]!==_){let m=r.indexes.byRelation.get(y);if(m){let b=(m.get(_)||[]).filter((v)=>v!==d);if(b.length===0)m.delete(_);else m.set(_,b)}}}}if(c.bySubcircuit&&r.indexes.bySubcircuit&&"subcircuit_id"in d&&"subcircuit_id"in l){let h=d.subcircuit_id,y=l.subcircuit_id;if(h!==y){let m=(r.indexes.bySubcircuit.get(h)||[]).filter((g)=>g!==d);if(m.length===0)r.indexes.bySubcircuit.delete(h);else r.indexes.bySubcircuit.set(h,m)}}if(c.byCustomField&&r.indexes.byCustomField){for(let h of c.byCustomField)if(h in d&&h in l&&d[h]!==l[h]){let y=r.indexes.byCustomField.get(h);if(y){let _=String(d[h]),g=(y.get(_)||[]).filter((b)=>b!==d);if(g.length===0)y.delete(_);else y.set(_,g)}}}if(Object.assign(d,l),r.editCount++,c.byRelation&&r.indexes.byRelation){let h=Object.entries(d);for(let[y,_]of h)if(y.endsWith("_id")&&y!==`${d.type}_id`&&typeof _==="string"){if(y in l){let m=r.indexes.byRelation.get(y)||new Map,g=m.get(_)||[];if(!g.includes(d))g.push(d),m.set(_,g),r.indexes.byRelation.set(y,m)}}}if(c.bySubcircuit&&r.indexes.bySubcircuit&&"subcircuit_id"in d&&"subcircuit_id"in l){let h=d.subcircuit_id;if(h&&typeof h==="string"){let y=r.indexes.bySubcircuit.get(h)||[];if(!y.includes(d))y.push(d),r.indexes.bySubcircuit.set(h,y)}}if(c.byCustomField&&r.indexes.byCustomField){for(let h of c.byCustomField)if(h in d&&h in l){let y=d[h];if(y!==void 0&&(typeof y==="string"||typeof y==="number")){let _=String(y),m=r.indexes.byCustomField.get(h),g=m.get(_)||[];if(!g.includes(d))g.push(d),m.set(_,g)}}}return d},select:(s)=>{if(a==="source_component")return t.find((l)=>l.type==="source_component"&&l.name===s.replace(/\./g,""))||null;else if(a==="pcb_port"||a==="source_port"||a==="schematic_port"){let[l,c]=s.replace(/\./g,"").split(/[\s\>]+/),d=t.find((y)=>y.type==="source_component"&&y.name===l);if(!d)return null;let h=t.find((y)=>y.type==="source_port"&&y.source_component_id===d.source_component_id&&(y.name===c||(y.port_hints??[]).includes(c)));if(!h)return null;if(a==="source_port")return h;if(a==="pcb_port")return t.find((y)=>y.type==="pcb_port"&&y.source_port_id===h.source_port_id)||null;else if(a==="schematic_port")return t.find((y)=>y.type==="schematic_port"&&y.source_port_id===h.source_port_id)||null}return null}}}});return i};tp.unparsed=tp;var U8={leftside_top:{side:"leftside",alignment:"top"},leftside_bottom:{side:"leftside",alignment:"bottom"},rightside_top:{side:"rightside",alignment:"top"},rightside_bottom:{side:"rightside",alignment:"bottom"},topside_left:{side:"topside",alignment:"left"},topside_right:{side:"topside",alignment:"right"},bottomside_left:{side:"bottomside",alignment:"left"},bottomside_right:{side:"bottomside",alignment:"right"}},oD=Object.keys(U8);var LZ=we(Se(),1);var XZ=we(Se(),1);var HZ=we(Se(),1);function ge(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function _x(t){return typeof t>"u"}function mx(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function ss(...t){t=Array.isArray(t[0])?t[0]:t;let e=(r,i)=>({a:r.a*i.a+r.c*i.b,c:r.a*i.c+r.c*i.d,e:r.a*i.e+r.c*i.f+r.e,b:r.b*i.a+r.d*i.b,d:r.b*i.c+r.d*i.d,f:r.b*i.e+r.d*i.f+r.f});switch(t.length){case 0:throw Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{let[r,i,...n]=t,o=e(r,i);return ss(o,...n)}}}var{cos:Z8,sin:H8,PI:pD}=Math;function G8(t,e,r){let i=Z8(t),n=H8(t),o={a:i,c:-n,e:0,b:n,d:i,f:0};return _x(e)||_x(r)?o:ss([mx(e,r),o,mx(-e,-r)])}var{tan:dD}=Math;function q8(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function cs(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,cs.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}q8(cs,Error);function ep(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,r+=r.repeat(e),t+r.slice(0,e))}cs.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r=null,i;for(i=0;i<t.length;i++)if(t[i].source===this.location.source){r=t[i].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(n):n,a=this.location.source+":"+o.line+":"+o.column;if(r){var s=this.location.end,l=ep("",o.line.toString().length," "),c=r[n.line-1],d=n.line===s.line?s.column:c.length+1,h=d-n.column||1;e+=`
--> `+a+`
`+l+` |
`+o.line+" | "+c+`
`+l+" | "+ep("",n.column-1," ")+ep("",h,"^")}else e+=`
at `+a}return e};cs.buildMessage=function(t,e){var r={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var d=c.parts.map(function(h){return Array.isArray(h)?o(h[0])+"-"+o(h[1]):o(h)});return"["+(c.inverted?"^":"")+d.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(c){return c.description}};function i(c){return c.charCodeAt(0).toString(16).toUpperCase()}function n(c){return c.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+i(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+i(d)})}function o(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(d){return"\\x0"+i(d)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(d){return"\\x"+i(d)})}function a(c){return r[c.type](c)}function s(c){var d=c.map(a),h,y;if(d.sort(),d.length>0){for(h=1,y=1;h<d.length;h++)d[h-1]!==d[h]&&(d[y]=d[h],y++);d.length=y}switch(d.length){case 1:return d[0];case 2:return d[0]+" or "+d[1];default:return d.slice(0,-1).join(", ")+", or "+d[d.length-1]}}function l(c){return c?'"'+n(c)+'"':"end of input"}return"Expected "+s(t)+" but "+l(e)+" found."};function Ke(t){if(t.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let e=1/0,r=-1/0,i=1/0,n=-1/0,o=(a)=>{e=Math.min(e,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),n=Math.max(n,a.y)};return t.forEach((a)=>{switch(a.type){case"path":a.points.forEach(o);break;case"text":o({x:a.x,y:a.y});break;case"circle":{let{x:s,y:l,radius:c}=a;o({x:s-c,y:l-c}),o({x:s+c,y:l+c});break}case"box":{let{x:s,y:l,width:c,height:d}=a,h=c/2,y=d/2;o({x:s-h,y:l-y}),o({x:s+h,y:l+y});break}}}),{minX:e,maxX:r,minY:i,maxY:n}}var K8=(t,e="right")=>{switch(e){case"down":switch(t){case"middle_top":return"middle_right";case"middle_bottom":return"middle_left";case"middle_left":return"middle_bottom";case"middle_right":return"middle_top"}break;case"up":switch(t){case"middle_top":return"middle_left";case"middle_bottom":return"middle_right";case"middle_left":return"middle_top";case"middle_right":return"middle_bottom"}break;case"left":switch(t){case"middle_top":return"middle_bottom";case"middle_bottom":return"middle_top";case"middle_left":return"middle_right";case"middle_right":return"middle_left"}break;case"right":return t}return t},gi=(t,e)=>{let{primitives:r,center:i,ports:n,size:o}=t,a=ss({a:1,b:0,c:0,d:-1,e:0,f:2*i.y}),s=r.map((c)=>{switch(c={...c},c.type){case"path":return{...c,points:c.points.map((_)=>ge(a,_))};case"text":let d=ge(a,{x:c.x,y:c.y}),h={top_left:"bottom_left",top_right:"bottom_right",bottom_left:"top_left",bottom_right:"top_right",center:"center",middle_top:"middle_bottom",middle_bottom:"middle_top",middle_left:"middle_left",middle_right:"middle_right"};return{...c,x:d.x,y:d.y,anchor:h[c.anchor]};case"circle":case"box":let y=ge(a,{x:c.x,y:c.y});return{...c,x:y.x,y:y.y}}}),l=n.map((c)=>({...c,...ge(a,c)}));return{primitives:s,center:i,ports:l,size:o,...e}},Me=(t,e)=>{let{primitives:r,center:i,ports:n,size:o}=t,a=ss({a:-1,b:0,c:0,d:1,e:0,f:2*i.x}),s=r.map((c)=>{switch(c={...c},c.type){case"path":return{...c,points:c.points.map((_)=>ge(a,_))};case"text":let d=ge(a,{x:c.x,y:c.y}),h={top_left:"top_right",top_right:"top_left",bottom_left:"bottom_right",bottom_right:"bottom_left",center:"center",middle_top:"middle_top",middle_bottom:"middle_bottom",middle_left:"middle_right",middle_right:"middle_left"};return{...c,x:d.x,y:d.y,anchor:h[c.anchor]};case"circle":case"box":let y=ge(a,{x:c.x,y:c.y});return{...c,x:y.x,y:y.y}}}),l=n.map((c)=>({...c,...ge(a,c)}));return{primitives:s,center:i,ports:l,size:o,...e}},An=(t,e)=>{let{newOrientation:r,overrides:i}=e,n={up:Math.PI/2,right:0,down:-Math.PI/2,left:-Math.PI},o=G8(r?n[r]:Math.PI/2,t.center.x,t.center.y),{primitives:a,center:s,size:l,ports:c}=t,d=a.map((_)=>{switch(_={..._},_.type){case"path":return{..._,points:_.points.map((v)=>ge(o,v))};case"text":let m=ge(o,{x:_.x,y:_.y});return _.anchor=K8(_.anchor,r??"right"),{..._,x:m.x,y:m.y};case"circle":let g=ge(o,{x:_.x,y:_.y});return{..._,x:g.x,y:g.y};case"box":let b=ge(o,{x:_.x,y:_.y});return{..._,x:b.x,y:b.y,width:_.height,height:_.width}}}),h=c.map((_)=>({..._,...ge(o,_)})),y=Ke(d);return{primitives:d,center:s,ports:h,size:{width:y.maxX-y.minX,height:y.maxY-y.minY},...i}},Z=(t,e="down",r={})=>An(t,{newOrientation:e,overrides:r}),J8=class{symbol;constructor(t){this.symbol=JSON.parse(JSON.stringify(t)),this.symbol.size=this.computeSize()}changeTextAnchor(t,e,r){return this.symbol={...this.symbol,primitives:this.symbol.primitives.map((i)=>i.type==="text"&&i.text===t?{...i,anchor:e,...r?{x:i.x+r.x,y:i.y+r.y}:{}}:i)},this}labelPort(t,e){return this.symbol={...this.symbol,ports:this.symbol.ports.map((r)=>r.labels.includes(t)?{...r,labels:e}:r)},this}rotateRightFacingSymbol(t){return this.symbol=An(this.symbol,{newOrientation:t}),this}computeSize(){let t=Ke(this.symbol.primitives);return{width:t.maxX-t.minX,height:t.maxY-t.minY}}build(){return{...this.symbol,size:this.computeSize()}}},W=(t)=>{let e=t.primitives??[...Object.values(t.paths??{}),...Object.values(t.texts??{}),...Object.values(t.circles??{}),...Object.values(t.rects??{})],r=t.ports??Object.entries(t.refblocks).flatMap(([n,o])=>[{...o,labels:[n]}]),i=t.center??{x:t.bounds.centerX,y:t.bounds.centerY};return r.length===2&&(i={x:(r[0].x+r[1].x)/2,y:(r[0].y+r[1].y)/2}),new J8({...t,primitives:e,ports:r,center:i})},bi={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path17:{type:"path",points:[{x:0,y:-0.13},{x:0.07,y:-0.11}],color:"primary",fill:!1},path18:{type:"path",points:[{x:0.07,y:-0.11},{x:0.14,y:-0.13}],color:"primary",fill:!1},path19:{type:"path",points:[{x:-0.15,y:-0.13},{x:-0.07,y:-0.11}],color:"primary",fill:!1},path20:{type:"path",points:[{x:-0.07,y:-0.11},{x:0,y:-0.13}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:t7,texts:hD,bounds:vo,refblocks:fx,circles:e7}=bi,r7=W({primitives:[...Object.values(t7),...Object.values(e7),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...fx.left1,labels:["1"]},{...fx.right1,labels:["2"]}],size:{width:vo.width,height:vo.height},center:{x:vo.centerX,y:vo.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:i7,texts:uD,bounds:wo,refblocks:xx,circles:n7}=bi,o7=W({primitives:[...Object.values(i7),...Object.values(n7),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...xx.left1,labels:["1"]},{...xx.right1,labels:["2"]}],size:{width:wo.width,height:wo.height},center:{x:wo.centerX,y:wo.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:a7,texts:yD,bounds:Ao,refblocks:gx,circles:s7}=bi,c7=W({primitives:[...Object.values(a7),...Object.values(s7),{type:"text",text:"{REF}",x:-0,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:0,y:0.4094553499999995}],ports:[{...gx.left1,labels:["1"]},{...gx.right1,labels:["2"]}],size:{width:Ao.width,height:Ao.height},center:{x:Ao.centerX,y:Ao.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:l7,texts:_D,bounds:Fo,refblocks:bx,circles:p7}=bi,d7=W({primitives:[...Object.values(l7),...Object.values(p7),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...bx.left1,labels:["1"]},{...bx.right1,labels:["2"]}],size:{width:Fo.width,height:Fo.height},center:{x:Fo.centerX,y:Fo.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:h7,texts:mD,bounds:Bo,refblocks:vx,circles:u7}=bi,y7=W({primitives:[...Object.values(h7),...Object.values(u7),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...vx.left1,labels:["1"]},{...vx.right1,labels:["2"]}],size:{width:Bo.width,height:Bo.height},center:{x:Bo.centerX,y:Bo.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:_7,texts:fD,bounds:So,refblocks:wx,circles:m7}=bi,f7=W({primitives:[...Object.values(_7),...Object.values(m7),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...wx.left1,labels:["1"]},{...wx.right1,labels:["2"]}],size:{width:So.width,height:So.height},center:{x:So.centerX,y:So.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Ep={paths:{"input-a-lead":{type:"path",points:[{x:-0.6,y:0.16000000000000014},{x:-0.25,y:0.16000000000000014}],color:"primary",fill:!1},"input-b-lead":{type:"path",points:[{x:-0.6,y:-0.1399999999999999},{x:-0.25,y:-0.1399999999999999}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.25,y:0.3600000000000001},{x:0,y:0.3600000000000001},{x:0,y:0.3600000000000001},{x:0.029662962962962967,y:0.359535925925926},{x:0.05863703703703704,y:0.3581540740740742},{x:0.08690000000000002,y:0.35587000000000013},{x:0.11442962962962966,y:0.3526992592592594},{x:0.14120370370370372,y:0.3486574074074076},{x:0.16720000000000004,y:0.34376000000000023},{x:0.19239629629629632,y:0.3380225925925927},{x:0.21677037037037045,y:0.331460740740741},{x:0.2403,y:0.3240900000000001},{x:0.26296296296296295,y:0.31592592592592605},{x:0.28473703703703696,y:0.30698407407407413},{x:0.30560000000000004,y:0.2972800000000002},{x:0.3255296296296295,y:0.2868292592592593},{x:0.34450370370370376,y:0.2756474074074076},{x:0.36249999999999993,y:0.2637500000000001},{x:0.3794962962962963,y:0.25115259259259276},{x:0.39547037037037036,y:0.2378707407407409},{x:0.41040000000000004,y:0.2239200000000002},{x:0.42426296296296295,y:0.20931592592592613},{x:0.437037037037037,y:0.19407407407407426},{x:0.4487,y:0.1782100000000002},{x:0.4592296296296296,y:0.16173925925925947},{x:0.46860370370370374,y:0.14467740740740764},{x:0.4768,y:0.12704000000000024},{x:0.4837962962962963,y:0.10884259259259285},{x:0.4895703703703703,y:0.09010074074074101},{x:0.4941,y:0.07083000000000027},{x:0.49736296296296295,y:0.05104592592592622},{x:0.49933703703703697,y:0.03076407407407436},{x:0.5,y:0.0100000000000003},{x:0.5,y:0.010000000000000231},{x:0.5,y:0.010000000000000231},{x:0.499337037037037,y:-0.010764074074073858},{x:0.49736296296296295,y:-0.031045925925925727},{x:0.49410000000000004,y:-0.05082999999999982},{x:0.48957037037037043,y:-0.07010074074074057},{x:0.48379629629629634,y:-0.08884259259259243},{x:0.47680000000000006,y:-0.10703999999999986},{x:0.46860370370370374,y:-0.12467740740740728},{x:0.4592296296296297,y:-0.14173925925925915},{x:0.4486999999999999,y:-0.15820999999999985},{x:0.4370370370370371,y:-0.17407407407407394},{x:0.4242629629629629,y:-0.18931592592592578},{x:0.4104000000000001,y:-0.20391999999999988},{x:0.3954703703703703,y:-0.21787074074074056},{x:0.37949629629629644,y:-0.2311525925925925},{x:0.36249999999999993,y:-0.24374999999999986},{x:0.3445037037037037,y:-0.25564740740740727},{x:0.3255296296296296,y:-0.26682925925925916},{x:0.30560000000000004,y:-0.2772799999999999},{x:0.28473703703703707,y:-0.28698407407407395},{x:0.262962962962963,y:-0.29592592592592576},{x:0.24030000000000004,y:-0.30408999999999986},{x:0.21677037037037042,y:-0.3114607407407406},{x:0.19239629629629634,y:-0.31802259259259247},{x:0.16720000000000007,y:-0.3237599999999998},{x:0.14120370370370378,y:-0.32865740740740723},{x:0.11442962962962971,y:-0.33269925925925914},{x:0.08690000000000009,y:-0.33586999999999984},{x:0.058637037037037126,y:-0.33815407407407394},{x:0.029662962962963058,y:-0.33953592592592574},{x:0.00000000000000009992007221626409,y:-0.33999999999999986},{x:0,y:-0.33999999999999986},{x:-0.25,y:-0.33999999999999986},{x:-0.25,y:0.3600000000000001}],color:"primary",fill:!1},"output-lead":{type:"path",points:[{x:0.5,y:0.010000000000000231},{x:0.6000000000000001,y:0.010000000000000231}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4700000000000002},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.47}},refblocks:{left1:{x:-0.6,y:-0.1399999999999999},left2:{x:-0.6,y:0.16000000000000014},right1:{x:0.6000000000000001,y:0.010000000000000231}},bounds:{minX:-0.6,maxX:0.6000000000000001,minY:-0.47,maxY:0.4700000000000002,width:1.2000000000000002,height:0.9400000000000002,centerX:0.00000000000000005551115123125783,centerY:0.00000000000000011102230246251565},circles:{}},x7=W(Ep).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),Db=W(Ep).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),g7=Me(Db),b7=W(Ep).labelPort("left1",["2","in2","input2","b"]).labelPort("left2",["1","in1","input1","a"]).labelPort("right1",["3","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),vi={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14,y:0.18},{x:0.08,y:0.2}],color:"primary",fill:!1},"path43-8-3":{type:"path",points:[{x:0.21,y:-0.11},{x:0.15,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:v7,texts:xD,bounds:ko,refblocks:Ax,circles:w7}=vi,A7=W({primitives:[...Object.values(v7),...Object.values(w7),{type:"text",text:"{REF}",x:-0.15,y:0.3294553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3294553499999995}],ports:[{...Ax.left1,labels:["1"]},{...Ax.right1,labels:["2"]}],size:{width:ko.width,height:ko.height},center:{x:ko.centerX,y:ko.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),F7=W(vi).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:B7,texts:gD,bounds:Yo,refblocks:Fx,circles:S7}=vi,k7=W({primitives:[...Object.values(B7),...Object.values(S7),{type:"text",text:"{REF}",x:-0,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:0.3294553499999995}],ports:[{...Fx.left1,labels:["1"]},{...Fx.right1,labels:["2"]}],size:{width:Yo.width,height:Yo.height},center:{x:Yo.centerX,y:Yo.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Y7=W(vi).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),ls={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.07000000000000006,y:0.1399999999999999},{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001},{x:0.16999999999999993,y:-0.1399999999999999}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},M7={boxresistor:{horizontalOffset:0.16,horizontalHeight:0.65,verticalX:0.16,verticalRefY:0.16,verticalValY:-0.16,verticalWidth:0.9},capacitor:{horizontalOffset:0.24,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.095,verticalValY:-0.095,verticalWidth:0.9},led:{horizontalOffset:0.38,horizontalHeight:0.9,verticalX:0.38,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:1.1},diode:{horizontalOffset:0.22,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:0.9},resistor:{horizontalOffset:0.22,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:0.9}},ft=(t,{kind:e,orientation:r,pin1Labels:i=["1"],pin2Labels:n=["2"]})=>{let o=M7[e],a=W({...t,texts:{}}).rotateRightFacingSymbol(r).labelPort("left1",i).labelPort("right1",n).build(),s=r==="right"||r==="left",l=s?[{type:"text",text:"{REF}",x:0,y:o.horizontalOffset,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-o.horizontalOffset,anchor:"middle_top"}]:[{type:"text",text:"{REF}",x:o.verticalX,y:o.verticalRefY,anchor:"middle_left"},{type:"text",text:"{VAL}",x:o.verticalX,y:o.verticalValY,anchor:"middle_left"}],[c,d]=a.ports,h=Math.hypot(d.x-c.x,d.y-c.y);return{...a,primitives:[...a.primitives,...l],size:s?{width:h,height:o.horizontalHeight}:{width:o.verticalWidth,height:h}}},I7=ft(ls,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),L7=ft(ls,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),E7=ft(ls,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),P7=ft(ls,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),{paths:T7,texts:bD,bounds:Mo,refblocks:Bx,circles:W7}=vi,O7=W({primitives:[...Object.values(T7),...Object.values(W7),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...Bx.left1,labels:["1"]},{...Bx.right1,labels:["2"]}],size:{width:Mo.width,height:Mo.height},center:{x:Mo.centerX,y:Mo.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:j7,texts:vD,bounds:Io,refblocks:Sx,circles:R7}=vi,C7=W({primitives:[...Object.values(j7),...Object.values(R7),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...Sx.left1,labels:["1"]},{...Sx.right1,labels:["2"]}],size:{width:Io.width,height:Io.height},center:{x:Io.centerX,y:Io.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),ps={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.050000000000000044,y:0.11999999999999988},{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009},{x:0.15000000000000013,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},X7=ft(ps,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),$7=ft(ps,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),N7=ft(ps,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),V7=ft(ps,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),ds={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:0.14,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.18,y:0.18},{x:0.11,y:0.18}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.18,y:-0.09},{x:0.11,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:z7,texts:wD,bounds:Lo,refblocks:kx,circles:D7}=ds,Q7=W({primitives:[...Object.values(z7),...Object.values(D7),{type:"text",text:"{REF}",x:-0.16,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0.16,y:0.2294553499999995}],ports:[{...kx.left1,labels:["1"]},{...kx.right1,labels:["2"]}],size:{width:Lo.width,height:Lo.height},center:{x:Lo.centerX,y:Lo.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),{paths:U7,texts:AD,bounds:Eo,refblocks:Yx,circles:Z7}=ds,Qb=W({primitives:[...Object.values(U7),...Object.values(Z7),{type:"text",text:"{REF}",x:-0.0001118,y:-0.18},{type:"text",text:"{VAL}",x:0.0001118,y:0.2738453}],ports:[{...Yx.left1,labels:["1"]},{...Yx.right1,labels:["2"]}],size:{width:Eo.width,height:Eo.height},center:{x:Eo.centerX,y:Eo.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["2"]).labelPort("right1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:H7,texts:FD,bounds:Po,refblocks:Mx,circles:G7}=ds,q7=W({primitives:[...Object.values(H7),...Object.values(G7),{type:"text",text:"{REF}",x:-0.0050250999999996715,y:0.27384529999999985,anchor:"middle_left"},{type:"text",text:"{VAL}",x:-0.00011179999999999524,y:-0.27384530000000007,anchor:"middle_left"}],ports:[{...Mx.left1,labels:["1"]},{...Mx.right1,labels:["2"]}],size:{width:Po.width,height:Po.height},center:{x:Po.centerX,y:Po.centerY}}).changeTextAnchor("{VAL}","middle_top").labelPort("right1",["2"]).labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:BD,texts:SD,bounds:kD,refblocks:YD,circles:MD}=ds,Pp=Z(Qb,"down"),Tp=Pp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Wp=Pp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Tp.anchor="middle_left";Wp.anchor="middle_left";Tp.x=0.25;Tp.y+=0.21;Wp.y-=0.21;Wp.x=0.25;var K7=Pp,Fn={paths:{path43:{type:"path",points:[{x:-0.06,y:0.19},{x:-0.06,y:-0.12}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:0.02,y:0.13},{x:0.02,y:-0.06}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.06,y:0.03},{x:-0.5,y:0.03}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.5,y:0.03},{x:0.03,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.03,y:0.27},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.28}},refblocks:{left1:{x:-0.5,y:0.03},right1:{x:0.5,y:0.03}},bounds:{minX:-0.5,maxX:0.5,minY:-0.38,maxY:0.27,width:1,height:0.29,centerX:0,centerY:0.06},circles:{}},{paths:J7,bounds:Ix,refblocks:Lx,circles:tw}=Fn,ew=W({primitives:[...Object.values(J7),...Object.values(tw),{type:"text",text:"{REF}",x:-0.2,y:0.31},{type:"text",text:"{VAL}",x:0.2,y:0.31}],ports:[{...Lx.left1,labels:["1"]},{...Lx.right1,labels:["2"]}],center:{x:Ix.centerX,y:Ix.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_left").build(),rw={...ew,size:{width:1,height:0.9}};function Tt(t){let e=t.size;if(!e){let r=Ke(t.primitives);e={width:r.maxX-r.minX,height:r.maxY-r.minY}}return{...t,size:e}}var{paths:iw,texts:Ex,bounds:To,refblocks:Px,circles:nw}=Fn,Ub=Tt({primitives:[...Object.values(iw),...Object.values(nw),{...Ex.top1,anchor:"middle_bottom"},{...Ex.bottom1,anchor:"middle_top"}],ports:[{...Px.left1,labels:["1"]},{...Px.right1,labels:["2"]}],size:{width:To.width,height:To.height},center:{x:To.centerX,y:To.centerY}}),{paths:ow,bounds:Tx,refblocks:Wx,circles:aw}=Fn,sw=W({primitives:[...Object.values(ow),...Object.values(aw),{type:"text",text:"{REF}",x:0,y:-0.22},{type:"text",text:"{VAL}",x:0,y:0.28}],ports:[{...Wx.left1,labels:["1"]},{...Wx.right1,labels:["2"]}],center:{x:Tx.centerX,y:Tx.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_bottom").build(),cw={...sw,size:{width:1,height:0.65}},{paths:lw,bounds:Ox,refblocks:jx,circles:pw}=Fn,dw=W({primitives:[...Object.values(lw),...Object.values(pw),{type:"text",text:"{REF}",x:0,y:0.28},{type:"text",text:"{VAL}",x:0,y:-0.22}],ports:[{...jx.left1,labels:["1"]},{...jx.right1,labels:["2"]}],center:{x:Ox.centerX,y:Ox.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_bottom").build(),hw={...dw,size:{width:1,height:0.65}},{paths:uw,bounds:Rx,refblocks:Cx,circles:yw}=Fn,_w=W({primitives:[...Object.values(uw),...Object.values(yw),{type:"text",text:"{REF}",x:0.2,y:-0.25},{type:"text",text:"{VAL}",x:-0.2,y:-0.25}],ports:[{...Cx.left1,labels:["1"]},{...Cx.right1,labels:["2"]}],center:{x:Rx.centerX,y:Rx.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_left").build(),mw={..._w,size:{width:1,height:0.9}},fw=An(Ub,{newOrientation:"up"}),hs={paths:{path1:{type:"path",points:[{x:-0.3,y:0},{x:-0.19998,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path2:{type:"path",points:[{x:0.19998,y:0},{x:0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path3:{type:"path",points:[{x:-0.19998,y:0.07998},{x:0.19998,y:0.07998},{x:0.19998,y:-0.07998},{x:-0.19998,y:-0.07998},{x:-0.19998,y:0.07998}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.45,anchor:"middle_bottom"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.45,maxY:0.3,width:0.6,height:0.75,centerX:0,centerY:0},circles:{}},{paths:xw,texts:ID,bounds:Xx,refblocks:$x,circles:gw}=hs,bw=W({primitives:[...Object.values(xw),...Object.values(gw),{type:"text",text:"{REF}",x:-0.16,y:0.16},{type:"text",text:"{VAL}",x:0.16,y:0.16}],ports:[{...$x.left1,labels:["1"]},{...$x.right1,labels:["2"]}],center:{x:Xx.centerX,y:Xx.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),vw={...bw,size:{width:0.9,height:0.6}},{paths:ww,texts:LD,bounds:Nx,refblocks:Vx,circles:Aw}=hs,Fw=W({primitives:[...Object.values(ww),...Object.values(Aw),{type:"text",text:"{REF}",x:0,y:-0.16},{type:"text",text:"{VAL}",x:0,y:0.16}],ports:[{...Vx.left1,labels:["1"]},{...Vx.right1,labels:["2"]}],center:{x:Nx.centerX,y:Nx.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Bw={...Fw,size:{width:0.6,height:0.65}},{paths:Sw,texts:ED,bounds:zx,refblocks:Dx,circles:kw}=hs,Yw=W({primitives:[...Object.values(Sw),...Object.values(kw),{type:"text",text:"{REF}",x:0,y:0.16},{type:"text",text:"{VAL}",x:0,y:-0.16}],ports:[{...Dx.left1,labels:["1"]},{...Dx.right1,labels:["2"]}],center:{x:zx.centerX,y:zx.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Mw={...Yw,size:{width:0.6,height:0.65}},us={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012},body:{type:"path",points:[{x:-0.175,y:0.075},{x:0.175,y:0.075},{x:0.175,y:-0.075},{x:-0.175,y:-0.075},{x:-0.175,y:0.075}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.175,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},Iw=ft(us,{kind:"boxresistor",orientation:"down"}),Lw=ft(us,{kind:"boxresistor",orientation:"left"}),Ew=ft(us,{kind:"boxresistor",orientation:"right"}),Pw=ft(us,{kind:"boxresistor",orientation:"up"}),ys={paths:{path2:{type:"path",points:[{x:0.15,y:-0.01},{x:0.55,y:-0.01}],color:"primary",fill:!0},"path2-5":{type:"path",points:[{x:-0.15,y:0.06},{x:0.14,y:0.06}],color:"primary",fill:!0},"path2-5-1":{type:"path",points:[{x:0.14,y:0.06},{x:0.14,y:-0.08}],color:"primary",fill:!0},"path2-5-1-6":{type:"path",points:[{x:-0.16,y:0.06},{x:-0.16,y:-0.08}],color:"primary",fill:!0},"path2-5-4":{type:"path",points:[{x:-0.15,y:-0.08},{x:0.14,y:-0.08}],color:"primary",fill:!0},"path2-9":{type:"path",points:[{x:-0.55,y:-0.01},{x:-0.17,y:-0.01}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.17},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.17}},refblocks:{left1:{x:-0.55,y:-0.01},right1:{x:0.55,y:-0.01}},bounds:{minX:-0.58,maxX:0.58,minY:-0.17,maxY:0.17,width:1.16,height:0.35,centerX:0,centerY:0},circles:{}},{paths:Tw,texts:PD,bounds:Wo,refblocks:Qx,circles:Ww}=ys,Ow=W({primitives:[...Object.values(Tw),...Object.values(Ww),{type:"text",text:"{REF}",x:-0.2,y:0.1404553499999995},{type:"text",text:"{VAL}",x:0.2,y:0.1494553499999995}],ports:[{...Qx.left1,labels:["1"]},{...Qx.right1,labels:["2"]}],size:{width:Wo.width,height:Wo.height},center:{x:Wo.centerX,y:Wo.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:jw,texts:TD,bounds:Oo,refblocks:Ux,circles:Rw}=ys,Cw=W({primitives:[...Object.values(jw),...Object.values(Rw),{type:"text",text:"{REF}",x:0,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:0.1704553499999995}],ports:[{...Ux.left1,labels:["1"]},{...Ux.right1,labels:["2"]}],size:{width:Oo.width,height:Oo.height},center:{x:Oo.centerX,y:Oo.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:Xw,texts:WD,bounds:jo,refblocks:Zx,circles:$w}=ys,Nw=W({primitives:[...Object.values(Xw),...Object.values($w),{type:"text",text:"{REF}",x:0,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:-0.1704553499999995}],ports:[{...Zx.left1,labels:["1"]},{...Zx.right1,labels:["2"]}],size:{width:jo.width,height:jo.height},center:{x:jo.centerX,y:jo.centerY}}).rotateRightFacingSymbol("right").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:Vw,texts:OD,bounds:Ro,refblocks:Hx,circles:zw}=ys,Dw=W({primitives:[...Object.values(Vw),...Object.values(zw),{type:"text",text:"{REF}",x:0.2,y:-0.1404553499999995},{type:"text",text:"{VAL}",x:-0.2,y:-0.1494553499999995}],ports:[{...Hx.left1,labels:["1"]},{...Hx.right1,labels:["2"]}],size:{width:Ro.width,height:Ro.height},center:{x:Ro.centerX,y:Ro.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:Qw,texts:jD,bounds:Gx,refblocks:qx,circles:Uw}=hs,Zw=W({primitives:[...Object.values(Qw),...Object.values(Uw),{type:"text",text:"{REF}",x:0.16,y:-0.16},{type:"text",text:"{VAL}",x:-0.16,y:-0.16}],ports:[{...qx.left1,labels:["1"]},{...qx.right1,labels:["2"]}],center:{x:Gx.centerX,y:Gx.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),Hw={...Zw,size:{width:0.9,height:0.6}},_s={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.14,y:0}],color:"primary",fill:!1,strokeWidth:0.012},body:{type:"path",points:[{x:-0.14,y:0.065},{x:0.14,y:0.065},{x:0.14,y:-0.065},{x:-0.14,y:-0.065},{x:-0.14,y:0.065}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.14,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},Gw=ft(_s,{kind:"boxresistor",orientation:"down"}),qw=ft(_s,{kind:"boxresistor",orientation:"left"}),Kw=ft(_s,{kind:"boxresistor",orientation:"right"}),Jw=ft(_s,{kind:"boxresistor",orientation:"up"}),Op={paths:{"horizontal-bar":{type:"path",points:[{x:-0.4,y:0},{x:0.4,y:0}],color:"primary",fill:!1},"middle-dash-1":{type:"path",points:[{x:0,y:0.2},{x:0,y:0.07}],color:"primary",fill:!1},"middle-dash-2":{type:"path",points:[{x:0,y:0.01},{x:0,y:-0.12}],color:"primary",fill:!1},"middle-dash-3":{type:"path",points:[{x:0,y:-0.18},{x:0,y:-0.31}],color:"primary",fill:!1},"left-vertical":{type:"path",points:[{x:-0.25,y:0},{x:-0.25,y:-0.2}],color:"primary",fill:!1},"right-vertical":{type:"path",points:[{x:0.25,y:0},{x:0.25,y:-0.2}],color:"primary",fill:!1},"left-ground":{type:"path",points:[{x:-0.3,y:-0.2},{x:-0.25,y:-0.3},{x:-0.2,y:-0.2},{x:-0.3,y:-0.2}],color:"primary",fill:!1},"right-ground":{type:"path",points:[{x:0.2,y:-0.2},{x:0.25,y:-0.3},{x:0.3,y:-0.2},{x:0.2,y:-0.2}],color:"primary",fill:!1}},refblocks:{left1:{x:-0.4,y:0},right1:{x:0.4,y:0}},texts:{ref:{type:"text",text:"{REF}",x:0,y:0.35}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.35,width:0.8,height:0.75,centerX:0,centerY:-0.02},circles:{}},{paths:tA,texts:RD,bounds:Kx,refblocks:Jx,circles:eA}=Op,rA=W({primitives:[...Object.values(tA),...Object.values(eA),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...Jx.left1,labels:["1"]},{...Jx.right1,labels:["2"]}],center:{x:Kx.centerX,y:Kx.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),{paths:iA,texts:CD,bounds:tg,refblocks:eg,circles:nA}=Op,Zb=W({primitives:[...Object.values(iA),...Object.values(nA),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...eg.left1,labels:["1"]},{...eg.right1,labels:["2"]}],center:{x:tg.centerX,y:tg.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),oA=Me(Zb),{paths:aA,texts:XD,bounds:rg,refblocks:ig,circles:sA}=Op,cA=W({primitives:[...Object.values(aA),...Object.values(sA),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...ig.left1,labels:["1"]},{...ig.right1,labels:["2"]}],center:{x:rg.centerX,y:rg.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right").build(),ms={paths:{path27:{type:"path",points:[{x:0.3,y:0},{x:0.06,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path28:{type:"path",points:[{x:-0.06,y:0},{x:-0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path29:{type:"path",points:[{x:0.06,y:0.16002},{x:0.06,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},path30:{type:"path",points:[{x:-0.06,y:0.16002},{x:-0.06,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.24,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.24,anchor:"middle_top"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.24,maxY:0.24,width:0.6,height:0.48,centerX:0,centerY:0},circles:{}},{paths:lA,texts:$D,bounds:Co,refblocks:ng,circles:pA}=ms,dA=W({primitives:[...Object.values(lA),...Object.values(pA),{type:"text",text:"{REF}",x:-0.2,y:0.115},{type:"text",text:"{VAL}",x:0.2,y:0.115}],ports:[{...ng.left1,labels:["1"]},{...ng.right1,labels:["2"]}],size:{width:Co.width,height:Co.height},center:{x:Co.centerX,y:Co.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),hA={...dA,size:{width:0.9,height:0.6}},uA=W(ms).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),yA={...uA,size:{width:0.6,height:0.65}},fs={paths:{path27:{type:"path",points:[{x:0.3,y:0},{x:0.000657,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path28:{type:"path",points:[{x:-0.038683,y:0},{x:-0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path30:{type:"path",points:[{x:-0.074255,y:0.16002},{x:-0.074255,y:0.16002},{x:-0.069544,y:0.149352},{x:-0.065126,y:0.138684},{x:-0.061005,y:0.128016},{x:-0.057182,y:0.117348},{x:-0.053663,y:0.10668},{x:-0.05045,y:0.096012},{x:-0.047547,y:0.085344},{x:-0.044957,y:0.074676},{x:-0.042684,y:0.064008},{x:-0.040732,y:0.05334},{x:-0.039103,y:0.042672},{x:-0.037801,y:0.032004},{x:-0.03683,y:0.021336},{x:-0.036193,y:0.010668},{x:-0.035893,y:0},{x:-0.036193,y:-0.010668},{x:-0.03683,y:-0.021336},{x:-0.037801,y:-0.032004},{x:-0.039103,y:-0.042672},{x:-0.040732,y:-0.05334},{x:-0.042684,y:-0.064008},{x:-0.044957,y:-0.074676},{x:-0.047547,y:-0.085344},{x:-0.05045,y:-0.096012},{x:-0.053663,y:-0.10668},{x:-0.057182,y:-0.117348},{x:-0.061005,y:-0.128016},{x:-0.065126,y:-0.138684},{x:-0.069544,y:-0.149352},{x:-0.074255,y:-0.16002},{x:-0.074255,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},"path30-7":{type:"path",points:[{x:-0.000385,y:0.16002},{x:-0.000385,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},"path30-9-2":{type:"path",points:[{x:0.156026,y:0.2},{x:0.085846,y:0.2}],color:"primary",fill:!1,strokeWidth:0.012},"path30-9-2-9":{type:"path",points:[{x:0.120936,y:0.16491},{x:0.120936,y:0.23509}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.42,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42,anchor:"middle_top"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.55,maxY:0.55,width:0.6,height:1.1,centerX:0,centerY:0},circles:{"viewbox-padding-min":{type:"circle",x:-0.3,y:-0.55,radius:0,fill:!1,color:"transparent"},"viewbox-padding-max":{type:"circle",x:0.3,y:0.55,radius:0,fill:!1,color:"transparent"}}},_A=W(fs).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.3}).changeTextAnchor("{VAL}","middle_left",{x:-0.12,y:-0.3}).build(),mA=W(fs).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),fA=W(fs).rotateRightFacingSymbol("left").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.78}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.78}).build(),xA=W(fs).rotateRightFacingSymbol("down").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_left",{x:-0.12,y:0.3}).changeTextAnchor("{VAL}","middle_left",{x:0.72,y:-0.3}).build(),gA=W(ms).rotateRightFacingSymbol("right").changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").build(),bA={...gA,size:{width:0.6,height:0.65}},xs={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.06,y:0}],color:"primary",fill:!1,strokeWidth:0.012},"left-plate":{type:"path",points:[{x:-0.06,y:0.16},{x:-0.06,y:-0.16}],color:"primary",fill:!1,strokeWidth:0.012},"right-plate":{type:"path",points:[{x:0.06,y:0.16},{x:0.06,y:-0.16}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.06,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},vA=ft(xs,{kind:"capacitor",orientation:"down",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),wA=ft(xs,{kind:"capacitor",orientation:"left",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),AA=ft(xs,{kind:"capacitor",orientation:"right",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),FA=ft(xs,{kind:"capacitor",orientation:"up",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),{paths:BA,texts:ND,bounds:Xo,refblocks:og,circles:SA}=ms,kA=W({primitives:[...Object.values(BA),...Object.values(SA),{type:"text",text:"{REF}",x:0.2,y:-0.095},{type:"text",text:"{VAL}",x:-0.2,y:-0.095}],ports:[{...og.left1,labels:["1"]},{...og.right1,labels:["2"]}],size:{width:Xo.width,height:Xo.height},center:{x:Xo.centerX,y:Xo.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),YA={...kA,size:{width:0.9,height:0.6}},gs={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.05,y:0}],color:"primary",fill:!1,strokeWidth:0.012},"left-plate":{type:"path",points:[{x:-0.05,y:0.14},{x:-0.05,y:-0.14}],color:"primary",fill:!1,strokeWidth:0.012},"right-plate":{type:"path",points:[{x:0.05,y:0.14},{x:0.05,y:-0.14}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.05,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},MA=ft(gs,{kind:"capacitor",orientation:"down",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),IA=ft(gs,{kind:"capacitor",orientation:"left",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),LA=ft(gs,{kind:"capacitor",orientation:"right",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),EA=ft(gs,{kind:"capacitor",orientation:"up",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),wi={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.29,y:0.29},{x:0.29,y:-0.23}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.02,y:0.37},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.37}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:PA,texts:VD,bounds:$o,refblocks:ag,circles:TA}=wi,WA=W({primitives:[...Object.values(PA),...Object.values(TA),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...ag.left1,labels:["1"]},{...ag.right1,labels:["2"]}],size:{width:$o.width,height:$o.height},center:{x:$o.centerX,y:$o.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),OA=W(wi).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:jA,texts:zD,bounds:No,refblocks:sg,circles:RA}=wi,CA=W({primitives:[...Object.values(jA),...Object.values(RA),{type:"text",text:"{REF}",x:-0,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:0,y:0.3894553499999995}],ports:[{...sg.left1,labels:["1"]},{...sg.right1,labels:["2"]}],size:{width:No.width,height:No.height},center:{x:No.centerX,y:No.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),XA=W(wi).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:$A,texts:DD,bounds:Vo,refblocks:cg,circles:NA}=wi,VA=W({primitives:[...Object.values($A),...Object.values(NA),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...cg.left1,labels:["1"]},{...cg.right1,labels:["2"]}],size:{width:Vo.width,height:Vo.height},center:{x:Vo.centerX,y:Vo.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:zA,texts:QD,bounds:zo,refblocks:lg,circles:DA}=wi,QA=W({primitives:[...Object.values(zA),...Object.values(DA),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...lg.left1,labels:["1"]},{...lg.right1,labels:["2"]}],size:{width:zo.width,height:zo.height},center:{x:zo.centerX,y:zo.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),bs={paths:{path27:{type:"path",points:[{x:0.54,y:-0.01},{x:0.13,y:-0.01}],color:"primary",fill:!1},path29:{type:"path",points:[{x:0.13,y:0.25},{x:0.13,y:-0.27}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:0.07,y:0.25},{x:0.07,y:-0.28}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.14,y:0.25},{x:-0.14,y:-0.27}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.08,y:0.26},{x:-0.08,y:-0.27}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:0.07,y:0.26},{x:-0.08,y:0.26}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:0.07,y:-0.28},{x:-0.08,y:-0.28}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.21,y:0.32},{x:0.2,y:0.32}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:0.71},{x:0,y:0.33},{x:0,y:0.32}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:-0.21,y:0.32},{x:-0.21,y:0.25}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.2,y:0.32},{x:0.2,y:0.25}],color:"primary",fill:!1},"path43-9":{type:"path",points:[{x:0.19,y:-0.35},{x:-0.22,y:-0.35}],color:"primary",fill:!1},"path44-0-5":{type:"path",points:[{x:-0.02,y:-0.71},{x:-0.02,y:-0.36},{x:-0.02,y:-0.35}],color:"primary",fill:!1},"path43-8-1":{type:"path",points:[{x:0.19,y:-0.35},{x:0.19,y:-0.28}],color:"primary",fill:!1},"path43-8-8-9":{type:"path",points:[{x:-0.22,y:-0.35},{x:-0.22,y:-0.28}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.14,y:-0.01},{x:-0.54,y:-0.01}],color:"primary",fill:!1}},texts:{left1:{type:"text",text:"{REF}",x:0.53,y:0.28},right1:{type:"text",text:"{VAL}",x:0.54,y:-0.28}},refblocks:{top1:{x:0,y:0.71},bottom1:{x:-0.02,y:-0.71},left1:{x:-0.54,y:-0.01},right1:{x:0.54,y:-0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.74,maxY:0.74,width:1.14,height:1.48,centerX:0,centerY:0},circles:{}},{paths:UA,texts:UD,bounds:Do,refblocks:Qo,circles:ZA}=bs,HA=W({primitives:[...Object.values(UA),...Object.values(ZA),{type:"text",text:"{REF}",x:-0.4,y:0.4094554499999995},{type:"text",text:"{VAL}",x:0.4,y:0.4094553499999995}],ports:[{...Qo.left1,labels:["1"]},{...Qo.right1,labels:["3"]},{...Qo.bottom1,labels:["2"]},{...Qo.top1,labels:["4"]}],size:{width:Do.width,height:Do.height},center:{x:Do.centerX,y:Do.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),GA=W(bs).labelPort("top1",["2","gnd1"]).labelPort("bottom1",["4","gnd2"]).labelPort("left1",["3"]).labelPort("right1",["1"]).changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),qA=W(bs).labelPort("top1",["4","gnd1"]).labelPort("bottom1",["2","gnd2"]).labelPort("left1",["1"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),{paths:KA,texts:ZD,bounds:Uo,refblocks:Zo,circles:JA}=bs,tF=W({primitives:[...Object.values(KA),...Object.values(JA),{type:"text",text:"{VAL}",x:-0.4,y:-0.4094554499999995},{type:"text",text:"{REF}",x:0.4,y:-0.4094553499999995}],ports:[{...Zo.left1,labels:["1"]},{...Zo.right1,labels:["3"]},{...Zo.bottom1,labels:["2"]},{...Zo.top1,labels:["4"]}],size:{width:Uo.width,height:Uo.height},center:{x:Uo.centerX,y:Uo.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),vs={paths:{path27:{type:"path",points:[{x:0.55,y:-0.01},{x:0.13,y:-0.01}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.14,y:-0.01},{x:-0.55,y:-0.01}],color:"primary",fill:!1},path29:{type:"path",points:[{x:0.13,y:-0.28},{x:0.13,y:0.25}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:0.07,y:-0.28},{x:0.07,y:0.25}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.14,y:-0.28},{x:-0.14,y:0.25}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.08,y:-0.28},{x:-0.08,y:0.25}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:0.07,y:-0.28},{x:-0.08,y:-0.28}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:0.07,y:0.26},{x:-0.08,y:0.26}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{VAL}",x:-0.01,y:-0.42},bottom1:{type:"text",text:"{REF}",x:0,y:0.43}},refblocks:{left1:{x:-0.55,y:-0.01},right1:{x:0.55,y:-0.01}},bounds:{minX:-0.58,maxX:0.58,minY:-0.52,maxY:0.43,width:1.16,height:1,centerX:0,centerY:-0.04},circles:{}},{paths:eF,texts:HD,bounds:Ho,refblocks:pg,circles:rF}=vs,iF=W({primitives:[...Object.values(eF),...Object.values(rF),{type:"text",text:"{REF}",x:-0.3,y:0.3094553499999995},{type:"text",text:"{VAL}",x:0.3,y:0.3094553499999995}],ports:[{...pg.left1,labels:["1"]},{...pg.right1,labels:["2"]}],size:{width:Ho.width,height:Ho.height},center:{x:Ho.centerX,y:Ho.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),nF=W(vs).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),oF=W(vs).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:aF,texts:GD,bounds:Go,refblocks:dg,circles:sF}=vs,cF=W({primitives:[...Object.values(aF),...Object.values(sF),{type:"text",text:"{REF}",x:0.3,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.3094553499999995}],ports:[{...dg.left1,labels:["1"]},{...dg.right1,labels:["2"]}],size:{width:Go.width,height:Go.height},center:{x:Go.centerX,y:Go.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),xn=0.6,rp=0.3,lF=[{type:"path",points:[{x:-xn,y:0},{x:-rp,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:rp,y:0},{x:xn,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:rp,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],pF=W({primitives:[...lF,{type:"text",text:"{REF}",x:-0.2,y:0.35},{type:"text",text:"{VAL}",x:0.2,y:0.35}],ports:[{x:-xn,y:0,labels:["1"]},{x:xn,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:xn*2,height:0.9}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),gn=0.6,ip=0.3,dF=[{type:"path",points:[{x:-gn,y:0},{x:-ip,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:ip,y:0},{x:gn,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:ip,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],hF=W({primitives:[...dF,{type:"text",text:"{REF}",x:0,y:-0.4},{type:"text",text:"{VAL}",x:0,y:0.4}],ports:[{x:-gn,y:0,labels:["1"]},{x:gn,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:gn*2,height:0.9}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),bn=0.6,np=0.3,uF=[{type:"path",points:[{x:-bn,y:0},{x:-np,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:np,y:0},{x:bn,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:np,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],yF=W({primitives:[...uF,{type:"text",text:"{REF}",x:0,y:0.4},{type:"text",text:"{VAL}",x:0,y:-0.4}],ports:[{x:-bn,y:0,labels:["1"]},{x:bn,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:bn*2,height:0.9}}).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),vn=0.6,op=0.3,_F=[{type:"path",points:[{x:-vn,y:0},{x:-op,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:op,y:0},{x:vn,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:op,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],mF=W({primitives:[..._F,{type:"text",text:"{REF}",x:0.2,y:-0.35},{type:"text",text:"{VAL}",x:-0.2,y:-0.35}],ports:[{x:-vn,y:0,labels:["1"]},{x:vn,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:vn*2,height:0.9}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Ai={paths:{path11:{type:"path",points:[{x:1.99,y:-1.64},{x:2.1,y:-1.64}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:2.1,y:-1.48},{x:2.1,y:-1.8}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:2.22,y:-1.5},{x:2.11,y:-1.58}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:2.23,y:-1.78},{x:2.11,y:-1.7}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:2.23,y:-1.49},{x:2.23,y:-1.14}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:2.23,y:-1.97},{x:2.23,y:-1.79}],color:"primary",fill:!1},"arrow-2":{type:"path",points:[{x:2.17,y:-1.7},{x:2.13,y:-1.76},{x:2.19,y:-1.76},{x:2.17,y:-1.7}],color:"primary",fill:!0},path1:{type:"path",points:[{x:1.6,y:-1.5},{x:1.86,y:-1.5}],color:"primary",fill:!1},path2:{type:"path",points:[{x:1.87,y:-1.34},{x:1.87,y:-1.66}],color:"primary",fill:!1},path3:{type:"path",points:[{x:1.99,y:-1.36},{x:1.87,y:-1.44}],color:"primary",fill:!1},path4:{type:"path",points:[{x:1.99,y:-1.64},{x:1.88,y:-1.56}],color:"primary",fill:!1},"arrow-1":{type:"path",points:[{x:1.94,y:-1.56},{x:1.89,y:-1.62},{x:1.96,y:-1.62},{x:1.94,y:-1.56}],color:"primary",fill:!0},path9:{type:"path",points:[{x:1.99,y:-1.35},{x:2.23,y:-1.36}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:1.88,y:-1.94},right1:{type:"text",text:"{REF}",x:1.88,y:-1.14}},refblocks:{right1:{x:2.23,y:-1.97},right2:{x:1.6,y:-1.5},right3:{x:2.23,y:-1.14}},bounds:{minX:1.58,maxX:2.35,minY:-1.98,maxY:-1.12,width:0.77,height:0.86,centerX:1.96,centerY:-1.55},circles:{"path1-0":{type:"circle",x:2.05,y:-1.54,radius:0.3,color:"primary",fill:!1}}},fF=W(Ai).rotateRightFacingSymbol("down").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0.8,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0,y:0.15}).build(),xF=W(Ai).rotateRightFacingSymbol("right").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_right").changeTextAnchor("{REF}","middle_right").build(),gF=W(Ai).rotateRightFacingSymbol("left").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.8}).changeTextAnchor("{REF}","middle_left",{x:0,y:0.8}).build(),bF=W(Ai).rotateRightFacingSymbol("right").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_right").changeTextAnchor("{REF}","middle_right").build(),vF=W(Ai).rotateRightFacingSymbol("up").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0.8,y:0.15}).build(),wF=W(Ai).rotateRightFacingSymbol("up").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0.8,y:0.15}).build(),AF={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.12,y:0.09},{x:0.12,y:0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.45},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.35},left1:{type:"text",text:"A",x:0,y:-0.1}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:-0.09,maxY:0.09,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:hg,bounds:qo,refblocks:ug,circles:FF}=AF,Bn=Tt({primitives:[hg.path11,hg.path12,{type:"path",points:[{x:-0.12,y:0.14},{x:0.12,y:0.14}],color:"primary",fill:!1},...Object.values(FF),{type:"text",text:"{REF}",x:0,y:0.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.35,anchor:"middle_top"},{type:"path",points:[{x:-0.095,y:-0.16},{x:0,y:0.09}],color:"primary",fill:!1},{type:"path",points:[{x:0,y:0.09},{x:0.095,y:-0.16}],color:"primary",fill:!1},{type:"path",points:[{x:-0.048,y:-0.045},{x:0.048,y:-0.045}],color:"primary",fill:!1}],ports:[{...ug.left1,labels:["1"]},{...ug.right1,labels:["2"]}],size:{width:qo.width,height:qo.height},center:{x:qo.centerX,y:qo.centerY}}),Yp=structuredClone(Bn);Yp.primitives=Yp.primitives.map((t)=>t.type!=="text"?t:t.text==="{REF}"?{...t,x:-0.16,y:0.3594553499999995,anchor:"middle_bottom"}:t.text==="{VAL}"?{...t,x:0.16,y:0.35,anchor:"middle_bottom"}:t);var yg=An(Yp,{newOrientation:"down"}),BF=Me(Bn),SF=Bn,Mp=structuredClone(Bn);Mp.primitives=Mp.primitives.map((t)=>t.type!=="text"?t:t.text==="{REF}"?{...t,x:0.16,y:-0.3594553499999995,anchor:"middle_top"}:t.text==="{VAL}"?{...t,x:-0.16,y:-0.35,anchor:"middle_top"}:t);var kF=An(Mp,{newOrientation:"up"}),Fi={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.12,y:-0.14},{x:0.12,y:-0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:YF,texts:qD,bounds:Ko,refblocks:_g,circles:MF}=Fi,IF=W({primitives:[...Object.values(YF),...Object.values(MF),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{..._g.left1,labels:["1"]},{..._g.right1,labels:["2"]}],size:{width:Ko.width,height:Ko.height},center:{x:Ko.centerX,y:Ko.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:LF,texts:KD,bounds:Jo,refblocks:mg,circles:EF}=Fi,PF=W({primitives:[...Object.values(LF),...Object.values(EF),{type:"text",text:"{REF}",x:-0,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0,y:-0.3294553499999995}],ports:[{...mg.left1,labels:["1"]},{...mg.right1,labels:["2"]}],size:{width:Jo.width,height:Jo.height},center:{x:Jo.centerX,y:Jo.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:TF,texts:JD,bounds:ta,refblocks:fg,circles:WF}=Fi,OF=W({primitives:[...Object.values(TF),...Object.values(WF),{type:"text",text:"{REF}",x:-0,y:-0.3294553499999995},{type:"text",text:"{VAL}",x:0,y:0.4294553499999995}],ports:[{...fg.left1,labels:["1"]},{...fg.right1,labels:["2"]}],size:{width:ta.width,height:ta.height},center:{x:ta.centerX,y:ta.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:jF,texts:tQ,bounds:ea,refblocks:xg,circles:RF}=Fi,CF=W({primitives:[...Object.values(jF),...Object.values(RF),{type:"text",text:"{REF}",x:-0,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0,y:-0.3294553499999995}],ports:[{...xg.left1,labels:["1"]},{...xg.right1,labels:["2"]}],size:{width:ea.width,height:ea.height},center:{x:ea.centerX,y:ea.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:XF,texts:eQ,bounds:ra,refblocks:gg,circles:$F}=Fi,NF=W({primitives:[...Object.values(XF),...Object.values($F),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...gg.left1,labels:["1"]},{...gg.right1,labels:["2"]}],size:{width:ra.width,height:ra.height},center:{x:ra.centerX,y:ra.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:VF,texts:rQ,bounds:ia,refblocks:bg,circles:zF}=Fi,DF=W({primitives:[...Object.values(VF),...Object.values(zF),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...bg.left1,labels:["1"]},{...bg.right1,labels:["2"]}],size:{width:ia.width,height:ia.height},center:{x:ia.centerX,y:ia.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Bi={paths:{path11:{type:"path",points:[{x:-0.54,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.1,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:-0.15},{x:-0.09,y:0.26}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.09,y:-0.15},{x:0.09,y:0.26}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.15},{x:0.09,y:-0.05},{x:-0.08,y:0.06}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:0.08,y:0.26},{x:0.08,y:0.05},{x:-0.09,y:0.15},{x:0.07,y:0.26}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.03,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{left1:{x:-0.54,y:0.04},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.42,maxY:0.42,width:1.14,height:0.83,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.05,radius:0.29,color:"primary",fill:!1}}},QF=W(Bi).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:-0.03,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:0.8,y:-0.2}).build(),UF=W(Bi).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.1}).changeTextAnchor("{VAL}","middle_top").build(),ZF=W(Bi).rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.8}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.9}).build(),HF=W(Bi).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.1}).changeTextAnchor("{VAL}","middle_top").build(),GF=W(Bi).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:-0.13,y:-0.2}).build(),qF=W(Bi).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:-0.13,y:-0.2}).build(),ws={paths:{triangle:{type:"path",points:[{x:-0.06,y:-0.09},{x:-0.06,y:0.09},{x:0.06,y:0},{x:-0.06,y:-0.09}],color:"primary",fill:!1},stem:{type:"path",points:[{x:-0.11,y:0},{x:-0.06,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.03}},refblocks:{left1:{x:-0.11,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{}},{paths:KF,bounds:vg,refblocks:JF}=ws,tB=W({primitives:[...Object.values(KF),{type:"text",text:"{REF}",x:-0.13,y:-0}],ports:[{...JF.left1,labels:["1"]}],center:{x:vg.centerX,y:vg.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),{paths:eB,bounds:wg,refblocks:rB}=ws,iB=W({primitives:[...Object.values(eB),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...rB.left1,labels:["1"]}],center:{x:wg.centerX,y:wg.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),{paths:nB,bounds:Ag,refblocks:oB}=ws,aB=W({primitives:[...Object.values(nB),{type:"text",text:"{REF}",x:-0.13,y:-0}],ports:[{...oB.left1,labels:["1"]}],center:{x:Ag.centerX,y:Ag.centerY}}).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),{paths:sB,bounds:Fg,refblocks:cB}=ws,lB=W({primitives:[...Object.values(sB),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...cB.left1,labels:["1"]}],center:{x:Fg.centerX,y:Fg.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),pB={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},As=W(pB).labelPort("left1",["1","pos","anode"]).labelPort("right1",["2","neg","cathode"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),dB=Z(As,"down"),hB=Z(As,"left"),Fs={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},uB=ft(Fs,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),yB=ft(Fs,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),_B=ft(Fs,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),mB=ft(Fs,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),fB=Z(As,"up"),Bs={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},xB=ft(Bs,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),gB=ft(Bs,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),bB=ft(Bs,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),vB=ft(Bs,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),wB={paths:{path1:{type:"path",points:[{x:-0.37,y:0.22},{x:-0.13,y:0.22}],color:"primary",fill:!1},"path-1-2":{type:"path",points:[{x:-0.07,y:0.22},{x:0.11,y:0.16}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:0.13},{x:0.37,y:0.13}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.36},{x:0.37,y:0.36}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.37,y:-0.18},{x:-0.13,y:-0.18}],color:"primary",fill:!1},"path4-5":{type:"path",points:[{x:-0.07,y:-0.19},{x:0.1,y:-0.24}],color:"primary",fill:!1},path5:{type:"path",points:[{x:0.1,y:-0.27},{x:0.37,y:-0.27}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.12,y:-0.04},{x:0.37,y:-0.04}],color:"primary",fill:!1},"path1-4-join":{type:"path",points:[{x:0,y:-0.2},{x:0,y:0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.56},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42}},refblocks:{left1:{x:-0.37,y:0.22},left2:{x:-0.37,y:-0.18},right1:{x:0.37,y:0.36},right2:{x:0.37,y:0.13},right3:{x:0.37,y:-0.04},right5:{x:0.37,y:-0.27}},bounds:{minX:-0.4,maxX:0.4,minY:-0.47,maxY:0.56,width:1,height:1.04,centerX:0,centerY:0.05},circles:{"circle-2":{type:"circle",x:0.08,y:0.13,radius:0.02,color:"primary",fill:!1},"circle-5":{type:"circle",x:0.08,y:-0.27,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:0.08,y:0.37,radius:0.02,color:"primary",fill:!1},"circle-6":{type:"circle",x:0.08,y:-0.04,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.22,radius:0.02,color:"primary",fill:!1},"circle-4":{type:"circle",x:-0.1,y:-0.18,radius:0.02,color:"primary",fill:!1}}},Ss=W(wB).labelPort("left1",["1"]).labelPort("right1",["3"]).labelPort("right2",["2"]).labelPort("right3",["6"]).labelPort("left2",["4"]).labelPort("right5",["5"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),jp=Z(Ss,"down"),Rp=jp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Cp=jp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Rp.anchor="middle_bottom";Cp.anchor="middle_top";Rp.x=0;Rp.y+=0.537;Cp.y-=0.5375;Cp.x=0;var AB=jp,Xp=Z(Ss,"left"),$p=Xp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Np=Xp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");$p.anchor="middle_bottom";Np.anchor="middle_top";$p.x=0;$p.y+=1;Np.y-=1;Np.x=0;var FB=Xp,Vp=Z(Ss,"up"),zp=Vp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Dp=Vp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");zp.anchor="middle_bottom";Dp.anchor="middle_top";zp.x=0;zp.y+=0.537;Dp.y-=0.5375;Dp.x=0;var BB=Vp,SB={paths:{path1:{type:"path",points:[{x:-0.37,y:0.22},{x:-0.13,y:0.22}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.23},{x:0.11,y:0.33}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:0.13},{x:0.37,y:0.13}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.36},{x:0.37,y:0.36}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.37,y:-0.18},{x:-0.13,y:-0.18}],color:"primary",fill:!1},"path4-6":{type:"path",points:[{x:-0.07,y:-0.18},{x:0.11,y:-0.07}],color:"primary",fill:!1},path5:{type:"path",points:[{x:0.1,y:-0.27},{x:0.37,y:-0.27}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.12,y:-0.04},{x:0.37,y:-0.04}],color:"primary",fill:!1},"path1-4-join":{type:"path",points:[{x:0,y:-0.12},{x:0,y:0.27}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.61},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.52}},refblocks:{left1:{x:-0.37,y:0.22},left2:{x:-0.37,y:-0.18},right1:{x:0.37,y:0.36},right2:{x:0.37,y:0.13},right3:{x:0.37,y:-0.04},right5:{x:0.37,y:-0.27}},bounds:{minX:-0.4,maxX:0.4,minY:-0.47,maxY:0.56,width:1,height:1.04,centerX:0,centerY:0.05},circles:{"circle-2":{type:"circle",x:0.08,y:0.13,radius:0.02,color:"primary",fill:!1},"circle-5":{type:"circle",x:0.08,y:-0.27,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:0.08,y:0.37,radius:0.02,color:"primary",fill:!1},"circle-6":{type:"circle",x:0.08,y:-0.04,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.22,radius:0.02,color:"primary",fill:!1},"circle-4":{type:"circle",x:-0.1,y:-0.18,radius:0.02,color:"primary",fill:!1}}},ks=W(SB).labelPort("left1",["1"]).labelPort("right1",["3"]).labelPort("right2",["2"]).labelPort("right3",["6"]).labelPort("left2",["4"]).labelPort("right5",["5"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Qp=Z(ks,"down"),Up=Qp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Zp=Qp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Up.anchor="middle_bottom";Zp.anchor="middle_top";Up.x=0;Up.y+=0.565;Zp.y-=0.555;Zp.x=0;var kB=Qp,Hp=Z(ks,"left"),Gp=Hp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),qp=Hp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Gp.anchor="middle_bottom";qp.anchor="middle_top";Gp.x=0;Gp.y+=1.09;qp.y-=1.09;qp.x=0;var YB=Hp,Kp=Z(ks,"up"),Jp=Kp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),t0=Kp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Jp.anchor="middle_bottom";t0.anchor="middle_top";Jp.x=0;Jp.y+=0.565;t0.y-=0.555;t0.x=0;var MB=Kp,IB={paths:{path11:{type:"path",points:[{x:-0.38,y:0.06},{x:-0.14,y:0.06}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:0.07},{x:0.11,y:0.11}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.13,y:0.06},{x:0.38,y:0.06}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.38,y:-0.17},{x:-0.14,y:-0.17}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-0.09,y:-0.17},{x:0.11,y:-0.12}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:0.13,y:-0.17},{x:0.38,y:-0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.31},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.31}},refblocks:{left1:{x:-0.38,y:-0.17},left3:{x:-0.38,y:0.06},right1:{x:0.38,y:-0.17},right3:{x:0.38,y:0.06}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.81,height:0.79,centerX:0,centerY:0},circles:{"circle-4":{type:"circle",x:0.1,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.1,y:-0.17,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:-0.11,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.11,y:-0.17,radius:0.02,color:"primary",fill:!1}}},Ys=W(IB).labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("right3",["4"]).labelPort("left3",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),e0=Z(Ys,"down"),r0=e0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),i0=e0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");r0.anchor="middle_bottom";i0.anchor="middle_top";r0.x=0.4;r0.y+=0.265;i0.y-=0.265;i0.x=0.4;var LB=e0,n0=Z(Ys,"left"),o0=n0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),a0=n0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");o0.anchor="middle_bottom";a0.anchor="middle_top";o0.x=0;o0.y+=0.67;a0.y-=0.67;a0.x=0;var EB=n0,s0=Z(Ys,"up"),c0=s0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),l0=s0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");c0.anchor="middle_bottom";l0.anchor="middle_top";c0.x=0.46;c0.y+=0.265;l0.y-=0.265;l0.x=0.46;var PB=s0,TB={paths:{path11:{type:"path",points:[{x:-0.38,y:0.06},{x:-0.14,y:0.06}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:0.07},{x:0.1,y:0.2}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.13,y:0.06},{x:0.38,y:0.06}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.38,y:-0.17},{x:-0.14,y:-0.17}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-0.09,y:-0.16},{x:0.1,y:-0.03}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:0.13,y:-0.17},{x:0.38,y:-0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.42},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42}},refblocks:{left1:{x:-0.38,y:-0.17},left3:{x:-0.38,y:0.06},right1:{x:0.38,y:-0.17},right3:{x:0.38,y:0.06}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.81,height:0.79,centerX:0,centerY:0},circles:{"circle-4":{type:"circle",x:0.1,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.1,y:-0.17,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:-0.11,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.11,y:-0.17,radius:0.02,color:"primary",fill:!1}}},Ms=W(TB).labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("right3",["4"]).labelPort("left3",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),p0=Z(Ms,"down"),d0=p0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),h0=p0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");d0.anchor="middle_bottom";h0.anchor="middle_top";d0.x=0.4;d0.y+=0.295;h0.y-=0.295;h0.x=0.42;var WB=p0,u0=Z(Ms,"left"),y0=u0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),_0=u0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");y0.anchor="middle_bottom";_0.anchor="middle_top";y0.x=0;y0.y+=0.795;_0.y-=0.795;_0.x=0;var OB=u0,m0=Z(Ms,"up"),f0=m0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),x0=m0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");f0.anchor="middle_bottom";x0.anchor="middle_top";f0.x=0.46;f0.y+=0.315;x0.y-=0.315;x0.x=0.46;var jB=m0,na={paths:{"left-terminal-lead":{type:"path",points:[{x:-0.7,y:0.06000000000000005},{x:-0.3938805999999999,y:0.06000000000000005}],color:"primary",fill:!1},"diode-bridge":{type:"path",points:[{x:-0.2763954999999998,y:0.06000000000000005},{x:0.27446270000000017,y:0.06000000000000005}],color:"primary",fill:!1},"right-terminal-lead":{type:"path",points:[{x:0.39193030000000006,y:0.06000000000000005},{x:0.7000000000000002,y:0.06000000000000005}],color:"primary",fill:!1},"junction-lead":{type:"path",points:[{x:0,y:0.06000000000000005},{x:0,y:-0.2200000000000002}],color:"primary",fill:!1},"first-diode-body":{type:"path",points:[{x:-0.3938805999999999,y:0.12609950000000003},{x:-0.2783806,y:0.05897259999999993},{x:-0.3938805999999999,y:-0.007179100000000105},{x:-0.3938805999999999,y:0.12609950000000003}],color:"primary",fill:!1},"first-cathode-bar":{type:"path",points:[{x:-0.2763954999999998,y:0.1754652000000001},{x:-0.2763954999999998,y:-0.05455969999999999},{x:-0.23000749999999992,y:-0.05455969999999999},{x:-0.23000749999999992,y:-0.027900499999999884}],color:"primary",fill:!1},"first-cathode-upper-hook":{type:"path",points:[{x:-0.32379350000000007,y:0.13499749999999988},{x:-0.3228009999999999,y:0.1754652000000001},{x:-0.2763954999999998,y:0.1754652000000001}],color:"primary",fill:!1},"second-diode-body":{type:"path",points:[{x:0.27446270000000017,y:0.12609950000000003},{x:0.3899626999999999,y:0.05897259999999993},{x:0.27446270000000017,y:-0.007179100000000105},{x:0.27446270000000017,y:0.12609950000000003}],color:"primary",fill:!1},"second-cathode-bar":{type:"path",points:[{x:0.39193030000000006,y:0.1754652000000001},{x:0.39193030000000006,y:-0.05455969999999999},{x:0.43931089999999995,y:-0.05455969999999999},{x:0.43931089999999995,y:-0.027900499999999884}],color:"primary",fill:!1},"second-cathode-upper-hook":{type:"path",points:[{x:0.3455249,y:0.13499749999999988},{x:0.3465174000000002,y:0.1754652000000001},{x:0.39193030000000006,y:0.1754652000000001}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3400000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3400000000000001}},refblocks:{bottom1:{x:0,y:-0.2200000000000002},left1:{x:-0.7,y:0.06000000000000005},right1:{x:0.7000000000000002,y:0.06000000000000005}},bounds:{minX:-0.7,maxX:0.7000000000000002,minY:-0.3400000000000001,maxY:0.3400000000000001,width:1.4000000000000001,height:0.6800000000000002,centerX:0.00000000000000011102230246251565,centerY:0},circles:{"junction-dot":{type:"circle",x:0,y:0.06000000000000005,radius:0.024291,color:"primary",fill:!0}}},RB={right:{reference:{x:0,y:0.34},value:{x:0,y:-0.34}},up:{reference:{x:0.17,y:-0.34},value:{x:-0.17,y:-0.34}},down:{reference:{x:-0.17,y:0.34},value:{x:0.17,y:0.34}}},g0=(t)=>{let e=RB[t],r=t==="up"||t==="down";return W({...na,texts:{...na.texts,top1:{...na.texts.top1,...e.reference},bottom1:{...na.texts.bottom1,...e.value}}}).labelPort("left1",["1","anode"]).labelPort("bottom1",["2","junction","common"]).labelPort("right1",["3","cathode"]).rotateRightFacingSymbol(t).changeTextAnchor("{REF}",r?"middle_left":"middle_bottom").changeTextAnchor("{VAL}",r?"middle_left":"middle_top").build()},CB=g0("down"),Hb=g0("right"),XB=Me(Hb),$B=g0("up"),Gb={paths:{path5:{type:"path",points:[{x:-0.44,y:0},{x:-0.16,y:0}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.17,y:0},{x:0.44,y:0.01}],color:"primary",fill:!1},path9:{type:"path",points:[{x:-0.25,y:-0.16},{x:0.02,y:0.3},{x:0.25,y:0.17},{x:-0.02,y:-0.29},{x:-0.25,y:-0.16}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.37},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.37}},refblocks:{left1:{x:-0.44,y:0},right1:{x:0.44,y:0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.25,maxY:0.25,width:1.13,height:0.5,centerX:0,centerY:0},circles:{}},{paths:NB,texts:iQ,bounds:oa,refblocks:Bg,circles:VB}=Gb,qb=W({primitives:[...Object.values(NB),...Object.values(VB),{type:"text",text:"{REF}",x:0.18,y:-0.3204553499999995},{type:"text",text:"{VAL}",x:-0.25,y:-0.3294553499999995}],ports:[{...Bg.left1,labels:["1"]},{...Bg.right1,labels:["2"]}],size:{width:oa.width,height:oa.height},center:{x:oa.centerX,y:oa.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),b0=gi(qb),v0=b0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),w0=b0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");v0.anchor="middle_left";w0.anchor="middle_left";v0.y+=0.4;v0.x=0.32;w0.y-=0.45;w0.x=0.32;var zB=b0,Kb=W(Gb).labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),DB=Me(Kb),Si={paths:{path11:{type:"path",points:[{x:-0.56,y:0.04},{x:-0.22,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:0.05},{x:0.48,y:0.05}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:0.14,y:-0.15},{x:0.14,y:0.25}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.22,y:0.25},{x:-0.21,y:-0.15},{x:0.14,y:0.05},{x:-0.22,y:0.25}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.09,y:0.38},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.38},right1:{type:"text",text:"",x:0.59,y:-0.33}},refblocks:{left1:{x:-0.56,y:0.04},right1:{x:0.48,y:0.05}},bounds:{minX:-0.59,maxX:0.59,minY:-0.38,maxY:0.38,width:1.18,height:0.76,centerX:0,centerY:0},circles:{}},{paths:QB,texts:nQ,bounds:aa,refblocks:Sg,circles:UB}=Si,ZB=W({primitives:[...Object.values(QB),...Object.values(UB),{type:"text",text:"{REF}",x:-0.15,y:0.3294553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3294553499999995}],ports:[{...Sg.left1,labels:["1"]},{...Sg.right1,labels:["2"]}],size:{width:aa.width,height:aa.height},center:{x:aa.centerX,y:aa.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:HB,texts:oQ,bounds:sa,refblocks:kg,circles:GB}=Si,qB=W({primitives:[...Object.values(HB),...Object.values(GB),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...kg.left1,labels:["1"]},{...kg.right1,labels:["2"]}],size:{width:sa.width,height:sa.height},center:{x:sa.centerX,y:sa.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:KB,texts:aQ,bounds:ca,refblocks:Yg,circles:JB}=Si,tS=W({primitives:[...Object.values(KB),...Object.values(JB),{type:"text",text:"{REF}",x:-0,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:0,y:0.4094553499999995}],ports:[{...Yg.left1,labels:["1"]},{...Yg.right1,labels:["2"]}],size:{width:ca.width,height:ca.height},center:{x:ca.centerX,y:ca.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:eS,texts:sQ,bounds:la,refblocks:Mg,circles:rS}=Si,iS=W({primitives:[...Object.values(eS),...Object.values(rS),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...Mg.left1,labels:["1"]},{...Mg.right1,labels:["2"]}],size:{width:la.width,height:la.height},center:{x:la.centerX,y:la.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:nS,texts:cQ,bounds:pa,refblocks:Ig,circles:oS}=Si,aS=W({primitives:[...Object.values(nS),...Object.values(oS),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...Ig.left1,labels:["1"]},{...Ig.right1,labels:["2"]}],size:{width:pa.width,height:pa.height},center:{x:pa.centerX,y:pa.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:sS,texts:lQ,bounds:da,refblocks:Lg,circles:cS}=Si,lS=W({primitives:[...Object.values(sS),...Object.values(cS),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...Lg.left1,labels:["1"]},{...Lg.right1,labels:["2"]}],size:{width:da.width,height:da.height},center:{x:da.centerX,y:da.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),pS={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Hz",x:0,y:-0.04}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:dS,texts:hS,bounds:ha,refblocks:Eg,circles:uS}=pS,A0=Tt({primitives:[...Object.values(dS),...Object.values(uS),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...hS.left1,x:0,y:0.01,anchor:"center",fontSize:0.2}],ports:[{...Eg.left1,labels:["1"]},{...Eg.right1,labels:["2"]}],size:{width:ha.width,height:ha.height},center:{x:ha.centerX,y:ha.centerY}}),{5:yS,..._S}=A0.primitives;function mS(t){return typeof t=="object"}var Pg=Z({...A0,primitives:Object.values(_S).filter(mS)}),fS={...Pg,primitives:[...Pg.primitives,yS]},xS={paths:{path10:{type:"path",points:[{x:-0.53,y:0.04},{x:0.53,y:0.04}],color:"primary",fill:!1},path14:{type:"path",points:[{x:0,y:0.17},{x:0.27,y:0.17},{x:0.27,y:-0.1},{x:-0.26,y:-0.1},{x:-0.26,y:0.17},{x:0,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.24},bottom1:{type:"text",text:"{VAL}",x:-0.17,y:-0.24}},refblocks:{left1:{x:-0.53,y:0.04},right1:{x:0.53,y:0.04}},bounds:{minX:-0.56,maxX:0.56,minY:-0.24,maxY:0.24,width:1.13,height:0.47,centerX:0,centerY:0},circles:{}},{paths:gS,texts:bS,bounds:ua,refblocks:Tg}=xS,Jb=Tt({primitives:[...Object.values(gS),{...bS.top1,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.2,anchor:"middle_top"}],ports:[{...Tg.left1,labels:["1"]},{...Tg.right1,labels:["2"]}],size:{width:ua.width,height:ua.height},center:{x:ua.centerX,y:ua.centerY}}),vS=Z(Jb),ki={paths:{path1:{type:"path",points:[{x:-0.29,y:0.01},{x:0.04,y:0}],color:"primary",fill:!0},path2:{type:"path",points:[{x:0.04,y:-0.22},{x:0.04,y:0.22}],color:"primary",fill:!0},path3:{type:"path",points:[{x:0.12,y:-0.17},{x:0.12,y:0.17}],color:"primary",fill:!0},path4:{type:"path",points:[{x:0.19,y:-0.06},{x:0.19,y:0.06}],color:"primary",fill:!0}},texts:{right1:{type:"text",text:"{REF}",x:0.31,y:-0.02}},refblocks:{left1:{x:-0.29,y:0.01}},bounds:{minX:-0.31,maxX:0.31,minY:-0.22,maxY:0.22,width:0.62,height:0.45,centerX:0,centerY:0},circles:{}},wS=W(ki).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),AS=W(ki).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),FS=W(ki).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),BS=W(ki).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),SS=W(ki).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),kS=W(ki).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),F0={paths:{path11:{type:"path",points:[{x:-0.52,y:0.03},{x:-0.18,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.19,y:0.04},{x:0.52,y:0.04}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.31,y:0.2},{x:-0.31,y:-0.11},{x:-0.01,y:0.04},{x:-0.3,y:0.2}],color:"primary",fill:!0},"path11-0-9-5":{type:"path",points:[{x:0.33,y:0.2},{x:0.33,y:-0.1},{x:0.04,y:0.04},{x:0.33,y:0.2}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.04,y:0.32},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.32}},refblocks:{left1:{x:-0.52,y:0.03},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.32,maxY:0.32,width:1.09,height:0.63,centerX:0,centerY:0},circles:{}},{paths:pQ,texts:dQ,bounds:hQ,refblocks:uQ,circles:yQ}=F0,YS=W(F0).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),MS=W(F0).rotateRightFacingSymbol("down").changeTextAnchor("{VAL}","middle_right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),IS={paths:{path45:{type:"path",points:[{x:0.14,y:0},{x:-0.13,y:-0.14}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:0.13,y:0},{x:0.3,y:0}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-0.13,y:0.13},{x:0.14,y:0}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-0.13,y:-0.14},{x:-0.13,y:0.13}],color:"primary",fill:!1},path48:{type:"path",points:[{x:0.14,y:0.13},{x:0.14,y:-0.14}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-0.13,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path25:{type:"path",points:[{x:0.16,y:0.29},{x:0.25,y:0.3},{x:0.22,y:0.21}],color:"primary",fill:!0},path78:{type:"path",points:[{x:0.08,y:0.17},{x:0.09,y:0.17},{x:0.21,y:0.27},{x:0.21,y:0.27}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:-0.02,y:0.31},{x:0.08,y:0.32},{x:0.04,y:0.23}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:-0.1,y:0.19},{x:-0.09,y:0.2},{x:0.04,y:0.29},{x:0.04,y:0.29}],color:"primary",fill:!1},box:{type:"path",points:[{x:-0.3,y:-0.4},{x:0.3,y:-0.4},{x:0.3,y:0.4},{x:-0.3,y:0.4},{x:-0.3,y:-0.4},{x:-0.3,y:0.4}],color:"primary",fill:!1},"path48-1":{type:"path",points:[{x:-0.3,y:0.13},{x:-0.54,y:0.13}],color:"primary",fill:!1},"path48-2":{type:"path",points:[{x:-0.3,y:-0.13},{x:-0.54,y:-0.13}],color:"primary",fill:!1},"path48-3":{type:"path",points:[{x:0.3,y:-0.13},{x:0.54,y:-0.13}],color:"primary",fill:!1},"path48-4":{type:"path",points:[{x:0.3,y:0.13},{x:0.54,y:0.13}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:0,y:-0.43},right1:{type:"text",text:"{REF}",x:0,y:0.43}},refblocks:{left1:{x:-0.54,y:0.13},left2:{x:-0.54,y:-0.13},right1:{x:0.54,y:-0.13},right2:{x:0.54,y:0.13}},bounds:{minX:-0.56,maxX:0.56,minY:-0.32,maxY:0.32,width:1.13,height:0.65,centerX:0,centerY:0},circles:{}},Is=W(IS).labelPort("left1",["1","DIN"]).labelPort("left2",["2","POWER"]).labelPort("right1",["3","GND"]).labelPort("right2",["4","DOUT"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),LS=Z(Is,"down"),ES=Me(Is),B0=Z(Is,"up"),S0=B0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),k0=B0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");S0.anchor="middle_left";k0.anchor="middle_left";S0.y+=0.21;S0.x=0.44;k0.y-=0.21;k0.x=0.44;var PS=B0,TS={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:-0.01,y:0}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},path42:{type:"path",points:[{x:0.01,y:-0.12},{x:0.01,y:0.14}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.28,y:-0.25},{x:0.28,y:-0.56}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.56},{x:0.28,y:0.27}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.17,y:-0.22},{x:0.28,y:-0.23},{x:0.23,y:-0.14}],color:"primary",fill:!0},path17:{type:"path",points:[{x:0.08,y:-0.09},{x:0.23,y:-0.2}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.28,y:0.26}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.02,y:-0.42}},refblocks:{top1:{x:0.28,y:0.56},bottom1:{x:0.28,y:-0.56},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.17,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0.01,radius:0.29,color:"primary",fill:!1}}},t2=W(TS).changeTextAnchor("{VAL}","middle_right").labelPort("left1",["3"]).labelPort("top1",["2"]).labelPort("bottom1",["1"]).changeTextAnchor("{REF}","middle_right").build(),Y0=Z(t2),M0=Y0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),e2=Y0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");M0.anchor="middle_left";e2.anchor="middle_right";M0.x=0.45;M0.y+=0.065;e2.y+=0.065;var WS=Y0,OS={paths:{"path12-1-8-6-9":{type:"path",points:[{x:0.02,y:-0.02},{x:0.02,y:-0.1}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-0.47,y:-0.19},{x:-0.17,y:-0.19}],color:"primary",fill:!1},"path12-1-5-6-8":{type:"path",points:[{x:0.02,y:0.17},{x:0.02,y:0.11}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-0.15,y:-0.03},{x:0.2,y:-0.19}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.2,y:-0.19},{x:0.47,y:-0.19}],color:"primary",fill:!1},"path12-1-8-6-9-4":{type:"path",points:[{x:0.02,y:0.12},{x:0.02,y:0.02}],color:"primary",fill:!1},"path12-1-8-6-9-4-3":{type:"path",points:[{x:0.08,y:0.11},{x:0.08,y:0.05}],color:"primary",fill:!1},"path12-1-8-6-9-4-3-1":{type:"path",points:[{x:-0.04,y:0.11},{x:-0.04,y:0.05}],color:"primary",fill:!1},"path12-1-8-6-9-4-4":{type:"path",points:[{x:0.08,y:0.11},{x:-0.04,y:0.11}],color:"primary",fill:!1},"path14-5":{type:"path",points:[{x:-0.01,y:0.28},{x:0.01,y:0.25},{x:0.04,y:0.23},{x:0.06,y:0.2}],color:"primary",fill:!0},"path14-5-3":{type:"path",points:[{x:-0.01,y:0.2},{x:0.01,y:0.23},{x:0.04,y:0.25},{x:0.06,y:0.28}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.38}},refblocks:{left1:{x:-0.47,y:-0.19},right1:{x:0.47,y:-0.19}},bounds:{minX:-0.5,maxX:0.5,minY:-0.38,maxY:0.38,width:1,height:0.76,centerX:0,centerY:0},circles:{path9:{type:"circle",x:0.02,y:0.24,radius:0.06,color:"primary",fill:!1}}},r2=W(OS).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),i2=Z(r2),n2=i2.primitives.filter((t)=>t.type==="text"),I0=n2.find((t)=>t.text==="{VAL}");I0.x=-0.35;I0.y=0;I0.anchor="middle_right";var L0=n2.find((t)=>t.text==="{REF}");L0.y=0;L0.x=0.35;L0.anchor="middle_left";var jS=i2,Ls={paths:{path8698:{type:"path",points:[{x:-0.19796749999999919,y:-0.023826854587889912},{x:-0.2004570399999992,y:-0.018993393814014044},{x:-0.2029465799999992,y:-0.014174384106555204},{x:-0.20543611999999922,y:-0.009384187436300498},{x:-0.20792565999999923,y:-0.004636988132081332},{x:-0.21041519999999925,y:0.00005329457033053167},{x:-0.21290473999999926,y:0.004673092344940184},{x:-0.21539427999999927,y:0.009209271428771242},{x:-0.21788381999999928,y:0.013649213595881985},{x:-0.2203733599999993,y:0.01798089395292432},{x:-0.2228628999999993,y:0.022192955076609913},{x:-0.22535243999999932,y:0.02627477703600152},{x:-0.22784197999999933,y:0.030216542867918667},{x:-0.23033151999999935,y:0.03400929910178016},{x:-0.23282105999999936,y:0.03764501096072756},{x:-0.23531059999999937,y:0.04111661189869628},{x:-0.23780013999999938,y:0.04441804716802203},{x:-0.2402896799999994,y:0.04754431114897349},{x:-0.2427792199999994,y:0.05049147821106258},{x:-0.24526875999999942,y:0.053256726915861724},{x:-0.24775829999999943,y:0.05583835741211009},{x:-0.25024783999999944,y:0.05823580191586174},{x:-0.25273737999999946,y:0.060449628211062575},{x:-0.25522691999999947,y:0.0624815361489735},{x:-0.2577164599999995,y:0.06433434716802203},{x:-0.2602059999999995,y:0.06601198689869628},{x:-0.2626955399999995,y:0.06751946096072757},{x:-0.2651850799999995,y:0.06886282410178016},{x:-0.26767461999999953,y:0.07004914286791866},{x:-0.27016415999999954,y:0.0710864520360015},{x:-0.27265369999999955,y:0.07198370507660991},{x:-0.27514323999999957,y:0.07275071895292433},{x:-0.2776327799999996,y:0.07339811359588198},{x:-0.2801223199999996,y:0.07393724642877124},{x:-0.2826118599999996,y:0.07438014234494018},{x:-0.2851013999999996,y:0.07473941957033053},{x:-0.28759093999999963,y:0.07502821186791866},{x:-0.29008047999999964,y:0.07526008756369952},{x:-0.29257001999999965,y:0.07544896589344477},{x:-0.29505955999999967,y:0.07560903118598594},{x:-0.2975490999999997,y:0.07575464541211008},{x:-0.30003863749999965,y:0.07560903118598594},{x:-0.3025281749999997,y:0.07544896589344477},{x:-0.30501771249999965,y:0.07526008756369951},{x:-0.3075072499999996,y:0.07502821186791866},{x:-0.30999678749999965,y:0.07473941957033052},{x:-0.3124863249999996,y:0.07438014234494018},{x:-0.3149758624999996,y:0.07393724642877124},{x:-0.31746539999999956,y:0.07339811359588198},{x:-0.3199549374999996,y:0.07275071895292431},{x:-0.32244447499999956,y:0.07198370507660991},{x:-0.32493401249999954,y:0.0710864520360015},{x:-0.32742354999999956,y:0.07004914286791866},{x:-0.32991308749999954,y:0.06886282410178016},{x:-0.3324026249999995,y:0.06751946096072756},{x:-0.33489216249999954,y:0.06601198689869628},{x:-0.3373816999999995,y:0.06433434716802203},{x:-0.3398712374999995,y:0.06248153614897349},{x:-0.3423607749999995,y:0.06044962821106258},{x:-0.3448503124999994,y:0.05823580191586174},{x:-0.34733984999999945,y:0.05583835741211009},{x:-0.3498293874999995,y:0.053256726915861724},{x:-0.35231892499999945,y:0.050491478211062576},{x:-0.3548084624999994,y:0.0475443111489735},{x:-0.3572979999999994,y:0.04441804716802203},{x:-0.35978753749999937,y:0.04111661189869628},{x:-0.3622770749999994,y:0.03764501096072756},{x:-0.36476661249999937,y:0.03400929910178016},{x:-0.36725614999999934,y:0.030216542867918673},{x:-0.36974568749999936,y:0.02627477703600152},{x:-0.37223522499999934,y:0.022192955076609917},{x:-0.3747247624999993,y:0.017980893952924324},{x:-0.37721429999999934,y:0.013649213595881985},{x:-0.3797038374999993,y:0.00920927142877125},{x:-0.3821933749999993,y:0.004673092344940191},{x:-0.3846829124999993,y:0.00005329457033053514},{x:-0.3871724499999993,y:-0.004636988132081328},{x:-0.38966198749999925,y:-0.009384187436300498},{x:-0.3921515249999992,y:-0.014174384106555197},{x:-0.39464106249999925,y:-0.01899339381401404},{x:-0.3971305999999992,y:-0.023826854587889912}],color:"primary",fill:!1},path8700:{type:"path",points:[{x:0.0011955000000007932,y:-0.02382615458789039},{x:-0.00129403749999919,y:-0.01899269131401453},{x:-0.0037835749999991734,y:-0.014173679106555696},{x:-0.006273112499999156,y:-0.009383479936300985},{x:-0.00876264999999914,y:-0.004636278132081827},{x:-0.011252187499999122,y:0.00005400707033003174},{x:-0.013741724999999105,y:0.004673807344939681},{x:-0.016231262499999087,y:0.009209988928770731},{x:-0.018720799999999073,y:0.013649933595881476},{x:-0.021210337499999055,y:0.017981616452923805},{x:-0.023699874999999038,y:0.022193680076609393},{x:-0.026189412499999024,y:0.026275504536001},{x:-0.028678949999999002,y:0.030217272867918137},{x:-0.03116848749999899,y:0.034010031601779636},{x:-0.03365802499999897,y:0.03764574596072702},{x:-0.03614756249999895,y:0.04111734939869574},{x:-0.03863709999999894,y:0.04441878716802149},{x:-0.04112663749999892,y:0.04754505364897295},{x:-0.043616174999998904,y:0.05049222321106203},{x:-0.04610571249999888,y:0.05325747441586117},{x:-0.04859524999999887,y:0.055839107412109526},{x:-0.051084787499998854,y:0.05823655441586117},{x:-0.05357432499999884,y:0.06045038321106201},{x:-0.05606386249999881,y:0.06248229364897292},{x:-0.0585533999999988,y:0.06433510716802145},{x:-0.061042937499998784,y:0.0660127493986957},{x:-0.06353247499999877,y:0.06752022596072697},{x:-0.06602201249999876,y:0.06886359160177957},{x:-0.06851154999999873,y:0.07004991286791806},{x:-0.07100108749999871,y:0.07108722453600091},{x:-0.0734906249999987,y:0.0719844800766093},{x:-0.07598016249999869,y:0.07275149645292371},{x:-0.07846969999999867,y:0.07339889359588138},{x:-0.08095923749999864,y:0.07393802892877062},{x:-0.08344877499999863,y:0.07438092734493956},{x:-0.08593831249999861,y:0.07474020707032991},{x:-0.0884278499999986,y:0.07502900186791804},{x:-0.09091738749999859,y:0.07526088006369888},{x:-0.09340692499999856,y:0.07544976089344414},{x:-0.09589646249999854,y:0.0756098286859853},{x:-0.09838599999999853,y:0.07575544541210943},{x:-0.10087553999999854,y:0.0756098286859853},{x:-0.10336507999999855,y:0.07544976089344414},{x:-0.10585461999999857,y:0.07526088006369887},{x:-0.10834415999999858,y:0.07502900186791804},{x:-0.11083369999999859,y:0.0747402070703299},{x:-0.1133232399999986,y:0.07438092734493956},{x:-0.11581277999999862,y:0.07393802892877062},{x:-0.11830231999999863,y:0.07339889359588138},{x:-0.12079185999999864,y:0.07275149645292371},{x:-0.12328139999999865,y:0.0719844800766093},{x:-0.12577093999999867,y:0.07108722453600091},{x:-0.12826047999999868,y:0.07004991286791806},{x:-0.1307500199999987,y:0.06886359160177957},{x:-0.1332395599999987,y:0.06752022596072697},{x:-0.13572909999999871,y:0.0660127493986957},{x:-0.13821863999999873,y:0.06433510716802145},{x:-0.14070817999999874,y:0.06248229364897291},{x:-0.14319771999999875,y:0.06045038321106202},{x:-0.14568725999999876,y:0.05823655441586117},{x:-0.14817679999999878,y:0.055839107412109526},{x:-0.1506663399999988,y:0.05325747441586117},{x:-0.1531558799999988,y:0.05049222321106202},{x:-0.1556454199999988,y:0.047545053648972956},{x:-0.15813495999999883,y:0.04441878716802149},{x:-0.16062449999999884,y:0.04111734939869574},{x:-0.16311403999999885,y:0.03764574596072702},{x:-0.16560357999999886,y:0.034010031601779636},{x:-0.16809311999999887,y:0.03021727286791814},{x:-0.1705826599999989,y:0.026275504536001},{x:-0.1730721999999989,y:0.022193680076609396},{x:-0.1755617399999989,y:0.017981616452923805},{x:-0.17805127999999892,y:0.013649933595881474},{x:-0.18054081999999894,y:0.00920998892877074},{x:-0.18303035999999895,y:0.0046738073449396865},{x:-0.18551989999999896,y:0.00005400707033003521},{x:-0.18800943999999897,y:-0.004636278132081827},{x:-0.19049897999999899,y:-0.009383479936300985},{x:-0.192988519999999,y:-0.01417367910655569},{x:-0.19547805999999898,y:-0.018992691314014522},{x:-0.19796759999999902,y:-0.02382615458789039}],color:"primary",fill:!1},path8702:{type:"path",points:[{x:0.2003586000000006,y:-0.02382615458789039},{x:0.19786906000000057,y:-0.01899269131401453},{x:0.19537952000000058,y:-0.014173679106555696},{x:0.19288998000000057,y:-0.009383479936300985},{x:0.1904004400000006,y:-0.004636278132081827},{x:0.18791090000000055,y:0.00005400707033003174},{x:0.1854213600000005,y:0.004673807344939681},{x:0.18293182000000052,y:0.009209988928770731},{x:0.1804422800000005,y:0.013649933595881476},{x:0.17795274000000053,y:0.017981616452923805},{x:0.17546320000000049,y:0.022193680076609393},{x:0.17297366000000047,y:0.026275504536001},{x:0.17048412000000046,y:0.030217272867918137},{x:0.16799458000000045,y:0.034010031601779636},{x:0.16550504000000044,y:0.03764574596072702},{x:0.16301550000000042,y:0.04111734939869574},{x:0.1605259600000004,y:0.04441878716802149},{x:0.1580364200000004,y:0.04754505364897295},{x:0.1555468800000004,y:0.05049222321106203},{x:0.15305734000000037,y:0.05325747441586117},{x:0.15056780000000036,y:0.055839107412109526},{x:0.14807826000000035,y:0.05823655441586117},{x:0.14558872000000034,y:0.06045038321106201},{x:0.14309918000000033,y:0.06248229364897292},{x:0.1406096400000003,y:0.06433510716802145},{x:0.1381201000000003,y:0.0660127493986957},{x:0.1356305600000003,y:0.06752022596072697},{x:0.13314102000000028,y:0.06886359160177957},{x:0.13065148000000026,y:0.07004991286791806},{x:0.12816194000000025,y:0.07108722453600091},{x:0.12567240000000024,y:0.0719844800766093},{x:0.12318286000000023,y:0.07275149645292371},{x:0.12069332000000021,y:0.07339889359588138},{x:0.1182037800000002,y:0.07393802892877062},{x:0.11571424000000019,y:0.07438092734493956},{x:0.11322470000000018,y:0.07474020707032991},{x:0.11073516000000017,y:0.07502900186791804},{x:0.10824562000000015,y:0.07526088006369888},{x:0.10575608000000014,y:0.07544976089344414},{x:0.10326654000000013,y:0.0756098286859853},{x:0.10077700000000012,y:0.07575544541210943},{x:0.09828746250000013,y:0.0756098286859853},{x:0.09579792500000014,y:0.07544976089344414},{x:0.09330838750000017,y:0.07526088006369887},{x:0.09081885000000019,y:0.07502900186791804},{x:0.0883293125000002,y:0.0747402070703299},{x:0.08583977500000022,y:0.07438092734493956},{x:0.08335023750000023,y:0.07393802892877062},{x:0.08086070000000026,y:0.07339889359588138},{x:0.07837116250000027,y:0.07275149645292371},{x:0.07588162500000029,y:0.0719844800766093},{x:0.0733920875000003,y:0.07108722453600091},{x:0.07090255000000031,y:0.07004991286791806},{x:0.06841301250000034,y:0.06886359160177957},{x:0.06592347500000036,y:0.06752022596072697},{x:0.06343393750000037,y:0.0660127493986957},{x:0.060944400000000384,y:0.06433510716802145},{x:0.0584548625000004,y:0.06248229364897291},{x:0.05596532500000043,y:0.06045038321106202},{x:0.05347578750000044,y:0.05823655441586117},{x:0.050986250000000455,y:0.055839107412109526},{x:0.04849671250000047,y:0.05325747441586117},{x:0.04600717500000048,y:0.05049222321106202},{x:0.04351763750000051,y:0.047545053648972956},{x:0.041028100000000525,y:0.04441878716802149},{x:0.03853856250000054,y:0.04111734939869574},{x:0.036049025000000554,y:0.03764574596072702},{x:0.03355948750000057,y:0.034010031601779636},{x:0.031069950000000596,y:0.03021727286791814},{x:0.02858041250000061,y:0.026275504536001},{x:0.026090875000000624,y:0.022193680076609396},{x:0.023601337500000638,y:0.017981616452923805},{x:0.021111800000000652,y:0.013649933595881474},{x:0.01862226250000068,y:0.00920998892877074},{x:0.016132725000000694,y:0.0046738073449396865},{x:0.013643187500000709,y:0.00005400707033003521},{x:0.011153650000000723,y:-0.004636278132081827},{x:0.008664112500000737,y:-0.009383479936300985},{x:0.006174575000000764,y:-0.01417367910655569},{x:0.0036850375000007786,y:-0.018992691314014522},{x:0.0011955000000007932,y:-0.02382615458789039}],color:"primary",fill:!1},path8704:{type:"path",points:[{x:0.3995216000000006,y:-0.02382615458789039},{x:0.39703206250000056,y:-0.01899269131401453},{x:0.3945425250000006,y:-0.014173679106555696},{x:0.3920529875000006,y:-0.009383479936300985},{x:0.38956345000000064,y:-0.004636278132081827},{x:0.38707391250000067,y:0.00005400707033003174},{x:0.3845843750000007,y:0.004673807344939681},{x:0.38209483750000073,y:0.009209988928770731},{x:0.37960530000000076,y:0.013649933595881476},{x:0.3771157625000008,y:0.017981616452923805},{x:0.37462622500000076,y:0.022193680076609393},{x:0.37213668750000073,y:0.026275504536001},{x:0.36964715000000076,y:0.030217272867918137},{x:0.3671576125000008,y:0.034010031601779636},{x:0.3646680750000008,y:0.03764574596072702},{x:0.36217853750000084,y:0.04111734939869574},{x:0.3596890000000008,y:0.04441878716802149},{x:0.3571994625000009,y:0.04754505364897295},{x:0.35470992500000087,y:0.05049222321106203},{x:0.35222038750000095,y:0.05325747441586117},{x:0.3497308500000009,y:0.055839107412109526},{x:0.3472413125000009,y:0.05823655441586117},{x:0.344751775000001,y:0.06045038321106201},{x:0.34226223750000095,y:0.06248229364897292},{x:0.33977270000000104,y:0.06433510716802145},{x:0.337283162500001,y:0.0660127493986957},{x:0.334793625000001,y:0.06752022596072697},{x:0.33230408750000107,y:0.06886359160177957},{x:0.3298145500000011,y:0.07004991286791806},{x:0.32732501250000107,y:0.07108722453600091},{x:0.3248354750000011,y:0.0719844800766093},{x:0.3223459375000011,y:0.07275149645292371},{x:0.3198564000000011,y:0.07339889359588138},{x:0.3173668625000012,y:0.07393802892877062},{x:0.31487732500000115,y:0.07438092734493956},{x:0.3123877875000012,y:0.07474020707032991},{x:0.3098982500000012,y:0.07502900186791804},{x:0.30740871250000124,y:0.07526088006369888},{x:0.30491917500000126,y:0.07544976089344414},{x:0.30242963750000124,y:0.0756098286859853},{x:0.29994010000000126,y:0.07575544541210943},{x:0.29745056000000125,y:0.0756098286859853},{x:0.29496102000000124,y:0.07544976089344414},{x:0.2924714800000012,y:0.07526088006369887},{x:0.2899819400000012,y:0.07502900186791804},{x:0.2874924000000012,y:0.0747402070703299},{x:0.2850028600000012,y:0.07438092734493956},{x:0.2825133200000012,y:0.07393802892877062},{x:0.28002378000000117,y:0.07339889359588138},{x:0.27753424000000115,y:0.07275149645292371},{x:0.27504470000000114,y:0.0719844800766093},{x:0.27255516000000113,y:0.07108722453600091},{x:0.2700656200000011,y:0.07004991286791806},{x:0.2675760800000011,y:0.06886359160177957},{x:0.2650865400000011,y:0.06752022596072697},{x:0.2625970000000011,y:0.0660127493986957},{x:0.26010746000000107,y:0.06433510716802145},{x:0.25761792000000105,y:0.06248229364897291},{x:0.25512838000000104,y:0.06045038321106202},{x:0.25263884000000103,y:0.05823655441586117},{x:0.250149300000001,y:0.055839107412109526},{x:0.247659760000001,y:0.05325747441586117},{x:0.245170220000001,y:0.05049222321106202},{x:0.24268068000000098,y:0.047545053648972956},{x:0.24019114000000097,y:0.04441878716802149},{x:0.23770160000000096,y:0.04111734939869574},{x:0.23521206000000094,y:0.03764574596072702},{x:0.23272252000000093,y:0.034010031601779636},{x:0.23023298000000092,y:0.03021727286791814},{x:0.2277434400000009,y:0.026275504536001},{x:0.2252539000000009,y:0.022193680076609396},{x:0.22276436000000088,y:0.017981616452923805},{x:0.22027482000000087,y:0.013649933595881474},{x:0.21778528000000086,y:0.00920998892877074},{x:0.21529574000000085,y:0.0046738073449396865},{x:0.21280620000000083,y:0.00005400707033003521},{x:0.21031666000000082,y:-0.004636278132081827},{x:0.2078271200000008,y:-0.009383479936300985},{x:0.2053375800000008,y:-0.01417367910655569},{x:0.20284804000000078,y:-0.018992691314014522},{x:0.20035850000000077,y:-0.02382615458789039}],color:"primary",fill:!1},path8706:{type:"path",points:[{x:-0.40026109999999937,y:-0.022544054587890106},{x:-0.5272914999999991,y:-0.022544054587890106}],color:"primary",fill:!1},"path8706-5":{type:"path",points:[{x:0.5282280000000006,y:-0.027111054587890093},{x:0.4011975999999997,y:-0.027111054587890093}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.0020145999999989783,y:0.22997364541210996},bottom1:{type:"text",text:"{VAL}",x:-0.002185205294839676,y:-0.22997364541210996}},refblocks:{left1:{x:-0.5279125,y:-0.021272154587890446},right1:{x:0.5279125,y:-0.026521254587889898}},bounds:{minX:-0.556070941,maxX:0.556070941,minY:-0.22997364541210996,maxY:0.22997364541210996,width:1.112141882,height:0.4599472908242199,centerX:0,centerY:0},circles:{}},RS=W(Ls).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right",{x:-0.5,y:0}).changeTextAnchor("{VAL}","middle_left",{x:0.5,y:0}).build(),CS=W(Ls).rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.5}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.5}).build(),XS=W(Ls).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),$S=W(Ls).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_left").build(),o2={paths:{path11:{type:"path",points:[{x:-0.54,y:-0.06},{x:-0.15,y:-0.06}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.13,y:-0.05},{x:-0.13,y:-0.18}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.13,y:0.08},{x:0.13,y:-0.05}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.13,y:-0.18},{x:-0.13,y:0.08}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.13,y:0.08},{x:0.13,y:-0.18}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:-0.05},{x:0.54,y:-0.06}],color:"primary",fill:!1},"path25-0-9-8":{type:"path",points:[{x:-0.03,y:0.39},{x:-0.05,y:0.47},{x:-0.08,y:0.39}],color:"primary",fill:!0},"path78-6-5-5":{type:"path",points:[{x:-0.05,y:0.27},{x:-0.05,y:0.29},{x:-0.05,y:0.41},{x:-0.05,y:0.42}],color:"primary",fill:!1},"path25-0-9-8-2":{type:"path",points:[{x:0.07,y:0.39},{x:0.04,y:0.47},{x:0.02,y:0.39}],color:"primary",fill:!0},"path78-6-5-5-7":{type:"path",points:[{x:0.04,y:0.27},{x:0.04,y:0.29},{x:0.04,y:0.41},{x:0.04,y:0.42}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:0.03,y:0.06},{x:0.03,y:-0.16}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.38,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.38,y:-0.47}},refblocks:{left1:{x:-0.54,y:-0.06},right1:{x:0.54,y:-0.06}},bounds:{minX:-0.57,maxX:0.57,minY:-0.47,maxY:0.47,width:1.14,height:0.93,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:-0.05,radius:0.29,color:"primary",fill:!1}}};o2.bounds.width+=0.2;var Es=W(o2).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","anode","pos"]).labelPort("right1",["2","cathode","neg"]).changeTextAnchor("{REF}","middle_bottom").build(),E0=Z(Es,"down"),P0=E0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),T0=E0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");P0.anchor="middle_left";T0.anchor="middle_left";P0.y+=0.9;P0.x=0.3;T0.y-=0.1;T0.x=0.3;var NS=E0,W0=Z(Es,"left"),O0=W0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),j0=W0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");O0.anchor="middle_left";j0.anchor="middle_left";O0.y+=0.71;O0.x=0.44;j0.y-=0.71;j0.x=0.44;var VS=W0,R0=Z(Es,"up"),C0=R0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),X0=R0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");C0.anchor="middle_left";X0.anchor="middle_left";C0.y+=0.1;C0.x=0.3;X0.y-=0.71;X0.x=0.3;var zS=R0,DS={paths:{path45:{type:"path",points:[{x:0.14,y:0},{x:-0.13,y:-0.14}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:0.13,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-0.13,y:0.13},{x:0.14,y:0}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-0.13,y:-0.14},{x:-0.13,y:0.13}],color:"primary",fill:!1},path48:{type:"path",points:[{x:0.14,y:0.13},{x:0.14,y:-0.14}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-0.13,y:0},{x:-0.54,y:0}],color:"primary",fill:!1},path25:{type:"path",points:[{x:0.16,y:0.29},{x:0.25,y:0.3},{x:0.22,y:0.21}],color:"primary",fill:!0},path78:{type:"path",points:[{x:0.08,y:0.17},{x:0.09,y:0.17},{x:0.21,y:0.27},{x:0.21,y:0.27}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:-0.02,y:0.31},{x:0.08,y:0.32},{x:0.04,y:0.23}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:-0.1,y:0.19},{x:-0.09,y:0.2},{x:0.04,y:0.29},{x:0.04,y:0.29}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:0,y:-0.21},right1:{type:"text",text:"{REF}",x:0,y:0.41}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.56,maxX:0.56,minY:-0.32,maxY:0.32,width:1.13,height:0.65,centerX:0,centerY:0},circles:{}},{paths:QS,texts:Wg,bounds:ya,refblocks:Og,circles:US}=DS,$0=Tt({primitives:[...Object.values(QS),...Object.values(US),{...Wg.bottom1,anchor:"middle_top"},{...Wg.right1,anchor:"middle_bottom"}],ports:[{...Og.left1,labels:["1","anode","pos"]},{...Og.right1,labels:["2","cathode","neg"]}],size:{width:ya.width,height:ya.height},center:{x:ya.centerX,y:ya.centerY}}),N0=Z($0,"up"),V0=N0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),z0=N0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");V0.anchor="middle_left";z0.anchor="middle_left";V0.y+=0.21;V0.x=0.21;z0.y-=0.21;z0.x=0.21;var a2=N0,D0=gi(a2),Q0=D0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),U0=D0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Q0.anchor="middle_left";U0.anchor="middle_left";Q0.y+=0.4;Q0.x=0.2;U0.y-=0.41;U0.x=0.2;var ZS=D0,HS=Me($0),Ps={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1},"emission-0-shaft":{type:"path",points:[{x:-0.11999999999999988,y:0.15999999999999992},{x:-0.030000000000000027,y:0.29000000000000004}],color:"primary",fill:!1},"emission-0-head":{type:"path",points:[{x:-0.08499999999999996,y:0.2699999999999998},{x:-0.030000000000000027,y:0.29000000000000004},{x:-0.030000000000000027,y:0.22999999999999998}],color:"primary",fill:!1},"emission-1-shaft":{type:"path",points:[{x:0,y:0.15999999999999992},{x:0.09000000000000008,y:0.29000000000000004}],color:"primary",fill:!1},"emission-1-head":{type:"path",points:[{x:0.03500000000000014,y:0.2699999999999998},{x:0.09000000000000008,y:0.29000000000000004},{x:0.09000000000000008,y:0.22999999999999998}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3999999999999999},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.40000000000000013}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.40000000000000013,maxY:0.3999999999999999,width:0.5,height:0.8,centerX:0,centerY:-0.00000000000000011102230246251565},circles:{}},GS=ft(Ps,{kind:"led",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),qS=ft(Ps,{kind:"led",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),KS=ft(Ps,{kind:"led",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),JS=ft(Ps,{kind:"led",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Ts={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1},"emission-0-shaft":{type:"path",points:[{x:-0.11999999999999988,y:0.15999999999999992},{x:-0.030000000000000027,y:0.29000000000000004}],color:"primary",fill:!1},"emission-0-head":{type:"path",points:[{x:-0.08499999999999996,y:0.2699999999999998},{x:-0.030000000000000027,y:0.29000000000000004},{x:-0.030000000000000027,y:0.22999999999999998}],color:"primary",fill:!1},"emission-1-shaft":{type:"path",points:[{x:0,y:0.15999999999999992},{x:0.09000000000000008,y:0.29000000000000004}],color:"primary",fill:!1},"emission-1-head":{type:"path",points:[{x:0.03500000000000014,y:0.2699999999999998},{x:0.09000000000000008,y:0.29000000000000004},{x:0.09000000000000008,y:0.22999999999999998}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3999999999999999},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.40000000000000013}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.40000000000000013,maxY:0.3999999999999999,width:0.34999999999999987,height:0.8,centerX:0.00000000000000011102230246251565,centerY:-0.00000000000000011102230246251565},circles:{}},tk=ft(Ts,{kind:"led",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),ek=ft(Ts,{kind:"led",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),rk=ft(Ts,{kind:"led",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),ik=ft(Ts,{kind:"led",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),nk={paths:{path11:{type:"path",points:[{x:-0.52,y:-0.01},{x:-0.18,y:-0.01}],color:"primary",fill:!1},"path11-2":{type:"path",points:[{x:-0.17,y:-0.11},{x:-0.17,y:0.08}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.17,y:-0.12},{x:0.16,y:-0.12}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:-0.17,y:0.08},{x:0.16,y:0.08}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.17,y:-0.01},{x:0.52,y:-0.01}],color:"primary",fill:!1},"path11-2-1":{type:"path",points:[{x:0.16,y:-0.12},{x:0.16,y:0.08}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:-0.4,y:-0.21},{x:-0.33,y:-0.18},{x:-0.34,y:-0.27}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:-0.45,y:-0.34},{x:-0.44,y:-0.32},{x:-0.35,y:-0.22},{x:-0.35,y:-0.22}],color:"primary",fill:!1},"path25-0-9-0":{type:"path",points:[{x:-0.3,y:-0.34},{x:-0.22,y:-0.31},{x:-0.24,y:-0.4}],color:"primary",fill:!0},"path78-6-5-9":{type:"path",points:[{x:-0.35,y:-0.46},{x:-0.34,y:-0.45},{x:-0.25,y:-0.35},{x:-0.25,y:-0.35}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:-0.41},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.46}},refblocks:{left1:{x:-0.52,y:-0.01},right1:{x:0.52,y:-0.01}},bounds:{minX:-0.55,maxX:0.55,minY:-0.51,maxY:0.46,width:1.1,height:0.62,centerX:0,centerY:-0.02},circles:{path1:{type:"circle",x:0,y:-0.02,radius:0.28,color:"primary",fill:!1}}},{paths:ok,texts:jg,bounds:_a,refblocks:Rg,circles:ak}=nk,s2=Tt({primitives:[...Object.values(ok),...Object.values(ak),{...jg.top1,anchor:"middle_left",x:0},{...jg.bottom1,anchor:"middle_left",x:0}],ports:[{...Rg.left1,labels:["1"]},{...Rg.right1,labels:["2"]}],size:{width:_a.width,height:_a.height},center:{x:_a.centerX,y:_a.centerY}}),c2=Z(s2),l2=c2.primitives.filter((t)=>t.type==="text"),Z0=l2.find((t)=>t.text==="{VAL}");Z0.x=-0.35;Z0.y=0;Z0.anchor="middle_right";var H0=l2.find((t)=>t.text==="{REF}");H0.y=0;H0.x=0.35;H0.anchor="middle_left";var sk=c2,ck={paths:{path208:{type:"path",points:[{x:0.38,y:0.13},{x:0.52,y:-0.13}],color:"primary",fill:!1},path209:{type:"path",points:[{x:0.25,y:-0.13},{x:0.38,y:0.13}],color:"primary",fill:!1},path210:{type:"path",points:[{x:0.52,y:-0.13},{x:0.25,y:-0.13}],color:"primary",fill:!1},path211:{type:"path",points:[{x:0.25,y:0.13},{x:0.52,y:0.13}],color:"primary",fill:!1},path212:{type:"path",points:[{x:0.12,y:-0.4},{x:0.38,y:-0.4}],color:"primary",fill:!1},path213:{type:"path",points:[{x:0.38,y:0.4},{x:0.12,y:0.4}],color:"primary",fill:!1},path214:{type:"path",points:[{x:0.12,y:0.54},{x:0.12,y:0.18}],color:"primary",fill:!1},path215:{type:"path",points:[{x:0.12,y:-0.54},{x:0.12,y:0}],color:"primary",fill:!1},path216:{type:"path",points:[{x:0.38,y:-0.4},{x:0.38,y:0.4}],color:"primary",fill:!1},path217:{type:"path",points:[{x:-0.14,y:0.26},{x:-0.14,y:-0.27}],color:"primary",fill:!1},path218:{type:"path",points:[{x:-0.22,y:-0.27},{x:-0.22,y:0.26}],color:"primary",fill:!1},path219:{type:"path",points:[{x:-0.54,y:-0.27},{x:-0.22,y:-0.27}],color:"primary",fill:!1},path220:{type:"path",points:[{x:-0.14,y:-0.19},{x:0.12,y:-0.19}],color:"primary",fill:!1},path221:{type:"path",points:[{x:-0.14,y:0.18},{x:0.12,y:0.18}],color:"primary",fill:!1},path222:{type:"path",points:[{x:-0.07,y:0},{x:0.12,y:0}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{VAL}",x:0.57,y:0.02},right2:{type:"text",text:"{REF}",x:0.57,y:0.21}},refblocks:{top1:{x:0.12,y:0.54},bottom1:{x:0.12,y:-0.54},left1:{x:-0.54,y:-0.27}},bounds:{minX:-0.57,maxX:0.57,minY:-0.57,maxY:0.57,width:1.14,height:1.14,centerX:0,centerY:0},circles:{}};function Sn(t,e){return{width:Math.max(...e.map((r)=>Math.abs(r.x-t.x)))*2,height:Math.max(...e.map((r)=>Math.abs(r.y-t.y)))*2}}var{paths:lk,texts:Cg,bounds:Xg,refblocks:_i}=ck,$g={x:Xg.centerX+0.2,y:Xg.centerY},p2=Tt({primitives:[...Object.values(lk),{...Cg.right1,anchor:"middle_left"},{...Cg.right2,anchor:"middle_left"}],ports:[{..._i.top1,labels:["1"]},{..._i.bottom1,labels:["2"]},{..._i.left1,labels:["3"]}],size:Sn($g,[_i.top1,_i.bottom1,_i.left1]),center:$g}),G0=Z(p2),d2=G0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),q0=G0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");d2.anchor="middle_top";q0.anchor="middle_top";d2.x=q0.x;q0.y+=0.15;var pk=G0,dk={paths:{"path12-1-8-6-9":{type:"path",points:[{x:0.01,y:0.07},{x:0.01,y:-0.01}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-0.47,y:-0.09},{x:-0.17,y:-0.09}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-0.16,y:-0.01},{x:0.17,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.2,y:-0.09},{x:0.47,y:-0.09}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.1,y:0.06},{x:-0.1,y:0.06},{x:-0.1,y:0.07},{x:-0.1,y:0.07},{x:-0.1,y:0.07},{x:-0.1,y:0.08},{x:-0.1,y:0.08},{x:-0.1,y:0.08},{x:-0.1,y:0.09},{x:-0.09,y:0.09},{x:-0.09,y:0.09},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.11},{x:-0.09,y:0.11},{x:-0.08,y:0.11},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.05,y:0.14},{x:-0.05,y:0.15},{x:-0.05,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.03,y:0.16},{x:-0.03,y:0.16},{x:-0.03,y:0.16},{x:-0.02,y:0.16},{x:-0.02,y:0.16},{x:-0.02,y:0.16},{x:-0.01,y:0.16},{x:-0.01,y:0.16},{x:0,y:0.16},{x:0,y:0.16},{x:0,y:0.16},{x:0.01,y:0.16},{x:0.01,y:0.16},{x:0.01,y:0.16},{x:0.02,y:0.16},{x:0.02,y:0.16},{x:0.02,y:0.16},{x:0.03,y:0.16},{x:0.03,y:0.16},{x:0.03,y:0.16},{x:0.04,y:0.16},{x:0.04,y:0.16},{x:0.04,y:0.16},{x:0.05,y:0.15},{x:0.05,y:0.15},{x:0.05,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.14},{x:0.07,y:0.14},{x:0.07,y:0.14},{x:0.07,y:0.14},{x:0.08,y:0.14},{x:0.08,y:0.13},{x:0.08,y:0.13},{x:0.08,y:0.13},{x:0.09,y:0.13},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.1,y:0.11},{x:0.1,y:0.11},{x:0.1,y:0.1},{x:0.1,y:0.1},{x:0.11,y:0.09},{x:0.11,y:0.09},{x:0.11,y:0.09},{x:0.11,y:0.08},{x:0.11,y:0.08},{x:0.11,y:0.08},{x:0.11,y:0.07},{x:0.11,y:0.07},{x:0.11,y:0.07},{x:0.11,y:0.06},{x:0.11,y:0.06},{x:0.1,y:0.06},{x:0.1,y:0.06},{x:0.09,y:0.06},{x:0.09,y:0.06},{x:0.08,y:0.06},{x:0.07,y:0.06},{x:0.07,y:0.06},{x:0.06,y:0.06},{x:0.05,y:0.06},{x:0.05,y:0.06},{x:0.04,y:0.06},{x:0.03,y:0.06},{x:0.03,y:0.06},{x:0.02,y:0.06},{x:0.01,y:0.06},{x:0.01,y:0.06},{x:0,y:0.06},{x:-0.01,y:0.06},{x:-0.01,y:0.06},{x:-0.02,y:0.06},{x:-0.03,y:0.06},{x:-0.03,y:0.06},{x:-0.04,y:0.06},{x:-0.05,y:0.06},{x:-0.05,y:0.06},{x:-0.06,y:0.06},{x:-0.07,y:0.06},{x:-0.07,y:0.06},{x:-0.08,y:0.06},{x:-0.09,y:0.06},{x:-0.09,y:0.06}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.27}},refblocks:{left1:{x:-0.47,y:-0.09},right1:{x:0.47,y:-0.09}},bounds:{minX:-0.5,maxX:0.5,minY:-0.27,maxY:0.27,width:1,height:0.53,centerX:0,centerY:0},circles:{}};var{paths:hk,texts:Ng,bounds:ma,refblocks:Vg,circles:uk}=dk,h2=Tt({primitives:[...Object.values(hk),...Object.values(uk),{...Ng.top1,anchor:"middle_bottom",x:0},{...Ng.bottom1,anchor:"middle_top",x:0}],ports:[{...Vg.left1,labels:["1"]},{...Vg.right1,labels:["2"]}],size:{width:ma.width,height:ma.height},center:{x:ma.centerX+0.006,y:ma.centerY+0.06}}),K0=Z(h2),wn=K0.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),as=K0.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");wn.anchor="middle_left";as.anchor="middle_right";wn.x=wn.x-0.03;wn.y=wn.y;as.x=as.x;as.y=0;var yk=K0,Wt=({horizontalSymbol:t,verticalSymbol:e,gateSide:r,drainSide:i})=>{let n=r==="left"||r==="right",o=i==="left"||i==="right";if(n===o)throw Error(`Invalid MOSFET orientation: gate ${r}, drain ${i}. Gate and drain must be perpendicular.`);let a=n?t:e;return(r==="right"||o&&i==="left")&&(a=Me(a)),(r==="bottom"||!o&&i==="bottom")&&(a=gi(a)),a},_k={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.09,y:0.19},{x:0.09,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.27,y:-0.04},{x:0.27,y:0.03},{x:0.2,y:0},{x:0.27,y:-0.04}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.17},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:mk,texts:zg,bounds:Dg,refblocks:Lr,circles:fk}=_k,u2={x:Dg.centerX,y:Dg.centerY},xk={x:u2.x,y:Lr.left1.y},je=Tt({primitives:[...Object.values(mk),...Object.values(fk),{...zg.top1,anchor:"middle_right",x:0},{...zg.bottom1,anchor:"middle_right",x:0}],ports:[{...Lr.top1,labels:["1","drain"]},{...Lr.bottom1,labels:["2","source"]},{...Lr.left1,labels:["3","gate"]}],size:Sn(u2,[Lr.top1,Lr.bottom1,Lr.left1]),center:xk}),y2=Z(je),_2=y2.primitives.filter((t)=>t.type==="text"),J0=_2.find((t)=>t.text==="{VAL}");J0.x=-0.35;J0.y=0;J0.anchor="middle_right";var td=_2.find((t)=>t.text==="{REF}");td.y=0;td.x=0.35;td.anchor="middle_left";var Je=y2,gk=Wt({horizontalSymbol:je,verticalSymbol:Je,gateSide:"bottom",drainSide:"left"}),bk=Wt({horizontalSymbol:je,verticalSymbol:Je,gateSide:"bottom",drainSide:"right"}),vk=Wt({horizontalSymbol:je,verticalSymbol:Je,gateSide:"left",drainSide:"bottom"}),wk=Wt({horizontalSymbol:je,verticalSymbol:Je,gateSide:"left",drainSide:"top"}),Ak=Wt({horizontalSymbol:je,verticalSymbol:Je,gateSide:"right",drainSide:"bottom"}),Fk=Wt({horizontalSymbol:je,verticalSymbol:Je,gateSide:"right",drainSide:"top"}),Bk=Wt({horizontalSymbol:je,verticalSymbol:Je,gateSide:"top",drainSide:"left"}),Sk=Wt({horizontalSymbol:je,verticalSymbol:Je,gateSide:"top",drainSide:"right"}),kk={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:0.09,y:0.15},{x:0.09,y:0.07}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:0.09,y:-0.08},{x:0.09,y:-0.15}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:0.09,y:0.03},{x:0.09,y:-0.04}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.27,y:-0.04},{x:0.27,y:0.03},{x:0.2,y:0},{x:0.27,y:-0.04}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.11},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:Yk,texts:Qg,bounds:Ug,refblocks:mi,circles:Mk}=kk,Zg={x:Ug.centerX,y:Ug.centerY},Re=Tt({primitives:[...Object.values(Yk),...Object.values(Mk),{...Qg.top1,anchor:"middle_right",x:0},{...Qg.bottom1,anchor:"middle_right",x:0}],ports:[{...mi.top1,labels:["1","drain"]},{...mi.bottom1,labels:["2","source"]},{...mi.left1,labels:["3","gate"]}],size:Sn(Zg,[mi.top1,mi.bottom1,mi.left1]),center:Zg}),m2=Z(Re),f2=m2.primitives.filter((t)=>t.type==="text"),ed=f2.find((t)=>t.text==="{VAL}");ed.x=-0.35;ed.y=0;ed.anchor="middle_right";var rd=f2.find((t)=>t.text==="{REF}");rd.y=0;rd.x=0.35;rd.anchor="middle_left";var tr=m2,Ik=Wt({horizontalSymbol:Re,verticalSymbol:tr,gateSide:"bottom",drainSide:"left"}),Lk=Wt({horizontalSymbol:Re,verticalSymbol:tr,gateSide:"bottom",drainSide:"right"}),Ek=Wt({horizontalSymbol:Re,verticalSymbol:tr,gateSide:"left",drainSide:"bottom"}),Pk=Wt({horizontalSymbol:Re,verticalSymbol:tr,gateSide:"left",drainSide:"top"}),Tk=Wt({horizontalSymbol:Re,verticalSymbol:tr,gateSide:"right",drainSide:"bottom"}),Wk=Wt({horizontalSymbol:Re,verticalSymbol:tr,gateSide:"right",drainSide:"top"}),Ok=Wt({horizontalSymbol:Re,verticalSymbol:tr,gateSide:"top",drainSide:"left"}),jk=Wt({horizontalSymbol:Re,verticalSymbol:tr,gateSide:"top",drainSide:"right"}),Rk={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.55},{x:0.28,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.1}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.29,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.07,y:-0.1},{x:0.29,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.07},{x:0.01,y:0},{x:-0.08,y:0.06}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.15,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.42}},refblocks:{top1:{x:0.28,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:Ck,texts:Hg,bounds:fa,refblocks:ap,circles:Xk}=Rk,x2=Tt({primitives:[...Object.values(Ck),...Object.values(Xk),{...Hg.top1,anchor:"middle_right",x:0},{...Hg.bottom1,anchor:"middle_right",x:0}],ports:[{...ap.top1,labels:["1","drain"]},{...ap.bottom1,labels:["2","source"]},{...ap.left1,labels:["3","gate"]}],size:{width:fa.width,height:fa.height},center:{x:fa.centerX,y:fa.centerY}}),g2=Z(x2),b2=g2.primitives.filter((t)=>t.type==="text"),id=b2.find((t)=>t.text==="{VAL}");id.x=-0.35;id.y=0;id.anchor="middle_right";var nd=b2.find((t)=>t.text==="{REF}");nd.y=0;nd.x=0.35;nd.anchor="middle_left";var $k=g2,Nk={paths:{diag1:{type:"path",points:[{x:-0.1,y:-0.1},{x:0.1,y:0.1}],color:"primary",fill:!1},diag2:{type:"path",points:[{x:-0.1,y:0.1},{x:0.1,y:-0.1}],color:"primary",fill:!1},stem:{type:"path",points:[{x:-0.2,y:0},{x:0,y:0}],color:"primary",fill:!1}},texts:{},refblocks:{left1:{x:-0.2,y:0}},bounds:{minX:-0.19,maxX:0.2,minY:-0.12,maxY:0.12,width:0.39,height:0.24,centerX:0,centerY:0},circles:{}},{paths:Vk,bounds:Gg,refblocks:zk}=Nk,Ws=W({primitives:[...Object.values(Vk)],ports:[{...zk.left1,labels:["1"]}],center:{x:Gg.centerX,y:Gg.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).build(),Dk=Z(Ws,"down"),Qk=Z(Ws,"left"),Uk=Z(Ws,"up"),Yi={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:0.07,y:0.27},{x:0.07,y:-0.28}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:0.28,y:0.24},{x:0.08,y:0.11}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:0.29,y:-0.24},{x:0.09,y:-0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:0.25},{x:0.29,y:0.55}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.25}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.19,y:-0.1},{x:0.12,y:-0.2},{x:0.22,y:-0.2},{x:0.19,y:-0.1}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.08,y:0.36},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.41}},refblocks:{top1:{x:0.29,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{"path1-0":{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:Zk,texts:_Q,bounds:xa,refblocks:sp,circles:Hk}=Yi,Gk=W({primitives:[...Object.values(Zk),...Object.values(Hk),{type:"text",text:"{REF}",x:-0.3,y:0.5094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.5094553499999995}],ports:[{...sp.top1,labels:["1","collector"]},{...sp.bottom1,labels:["3","emitter"]},{...sp.left1,labels:["2","base"]}],size:{width:xa.width,height:xa.height},center:{x:xa.centerX,y:xa.centerY}}).rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_right").build(),{paths:qk,texts:mQ,bounds:ga,refblocks:cp,circles:Kk}=Yi,Jk=W({primitives:[...Object.values(qk),...Object.values(Kk),{type:"text",text:"{REF}",x:0.55,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.4094553499999995}],ports:[{...cp.top1,labels:["1","collector"]},{...cp.bottom1,labels:["3","emitter"]},{...cp.left1,labels:["2","base"]}],size:{width:ga.width,height:ga.height},center:{x:ga.centerX,y:ga.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:tY,texts:fQ,bounds:ba,refblocks:lp,circles:eY}=Yi,rY=W({primitives:[...Object.values(tY),...Object.values(eY),{type:"text",text:"{REF}",x:-0.5,y:0.3094553499999995},{type:"text",text:"{VAL}",x:0.55,y:0.3094553499999995}],ports:[{...lp.top1,labels:["1","collector"]},{...lp.bottom1,labels:["3","emitter"]},{...lp.left1,labels:["2","base"]}],size:{width:ba.width,height:ba.height},center:{x:ba.centerX,y:ba.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:iY,texts:xQ,bounds:va,refblocks:pp,circles:nY}=Yi,oY=W({primitives:[...Object.values(iY),...Object.values(nY),{type:"text",text:"{REF}",x:0.55,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.4094553499999995}],ports:[{...pp.top1,labels:["1","collector"]},{...pp.bottom1,labels:["3","emitter"]},{...pp.left1,labels:["2","base"]}],size:{width:va.width,height:va.height},center:{x:va.centerX,y:va.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:aY,texts:gQ,bounds:wa,refblocks:dp,circles:sY}=Yi,cY=W({primitives:[...Object.values(aY),...Object.values(sY),{type:"text",text:"{REF}",x:-0.3,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.4094553499999995}],ports:[{...dp.top1,labels:["1","collector"]},{...dp.bottom1,labels:["3","emitter"]},{...dp.left1,labels:["2","base"]}],size:{width:wa.width,height:wa.height},center:{x:wa.centerX,y:wa.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:lY,texts:bQ,bounds:Aa,refblocks:hp,circles:pY}=Yi,dY=W({primitives:[...Object.values(lY),...Object.values(pY),{type:"text",text:"{REF}",x:-0.3,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.4094553499999995}],ports:[{...hp.top1,labels:["1","collector"]},{...hp.bottom1,labels:["3","emitter"]},{...hp.left1,labels:["2","base"]}],size:{width:Aa.width,height:Aa.height},center:{x:Aa.centerX,y:Aa.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),hY={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.32,y:-0.21}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.32,y:0.31},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.32,y:-0.21},{x:-0.32,y:0.31}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.18},{x:-0.57,y:0.18}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.32,y:-0.09},{x:-0.57,y:-0.09}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.43,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"rect1577-3":{type:"path",points:[{x:-0.19,y:-0.09},{x:-0.27,y:-0.09}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.19,y:0.18},{x:-0.27,y:0.18}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.23,y:0.14},{x:-0.23,y:0.22}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.42},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3}},refblocks:{left1:{x:-0.57,y:0.18},left2:{x:-0.57,y:-0.09},right1:{x:0.43,y:0.04}},bounds:{minX:-0.57,maxX:0.43,minY:-0.38,maxY:0.27,width:1.09,height:0.3,centerX:-0.07,centerY:0.05},circles:{}},Os=W(hY).labelPort("left1",["1","inp1"]).labelPort("left2",["2","inp2"]).labelPort("right1",["3","out"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),uY=Z(Os,"down"),yY=gi(Z(Os,"left")),_Y=Z(Os,"up"),mY={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.32,y:-0.21}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.32,y:0.31},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.32,y:-0.21},{x:-0.32,y:0.31}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.18},{x:-0.57,y:0.18}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.32,y:-0.09},{x:-0.57,y:-0.09}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.43,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path44-1":{type:"path",points:[{x:-0.1,y:0.44},{x:-0.1,y:0.18}],color:"primary",fill:!1},"path44-2":{type:"path",points:[{x:-0.09,y:-0.34},{x:-0.09,y:-0.09}],color:"primary",fill:!1},"rect1577-3":{type:"path",points:[{x:-0.19,y:0.18},{x:-0.27,y:0.18}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.19,y:-0.09},{x:-0.27,y:-0.09}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.23,y:0.14},{x:-0.23,y:0.22}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.25,y:0.32},bottom1:{type:"text",text:"{VAL}",x:0.25,y:-0.24}},refblocks:{left1:{x:-0.57,y:0.18},left2:{x:-0.57,y:-0.09},right1:{x:0.43,y:0.04},top2:{x:-0.1,y:0.44},bottom1:{x:-0.09,y:-0.34}},bounds:{minX:-0.57,maxX:0.43,minY:-0.38,maxY:0.27,width:1.09,height:0.3,centerX:-0.07,centerY:0.05},circles:{}},js=W(mY).labelPort("left1",["1","inp1"]).labelPort("left2",["2","inp2"]).labelPort("right1",["4","out"]).labelPort("top2",["5","V+"]).labelPort("bottom1",["3","V-"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),fY=Z(js,"down"),xY=gi(Z(js,"left")),gY=Z(js,"up"),bY={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.09,y:0.19},{x:0.09,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.2,y:0.03},{x:0.2,y:-0.04},{x:0.27,y:-0.01},{x:0.2,y:0.03}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.17},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:vY,texts:qg,bounds:Kg,refblocks:fi,circles:wY}=bY,Jg={x:Kg.centerX,y:Kg.centerY},Ce=Tt({primitives:[...Object.values(vY),...Object.values(wY),{...qg.top1,anchor:"middle_right",x:0},{...qg.bottom1,anchor:"middle_right",x:0}],ports:[{...fi.top1,labels:["1","drain"]},{...fi.bottom1,labels:["2","source"]},{...fi.left1,labels:["3","gate"]}],size:Sn(Jg,[fi.top1,fi.bottom1,fi.left1]),center:Jg}),v2=Z(Ce),w2=v2.primitives.filter((t)=>t.type==="text"),od=w2.find((t)=>t.text==="{VAL}");od.x=-0.35;od.y=0;od.anchor="middle_right";var ad=w2.find((t)=>t.text==="{REF}");ad.y=0;ad.x=0.35;ad.anchor="middle_left";var er=v2,AY=Wt({horizontalSymbol:Ce,verticalSymbol:er,gateSide:"bottom",drainSide:"left"}),FY=Wt({horizontalSymbol:Ce,verticalSymbol:er,gateSide:"bottom",drainSide:"right"}),BY=Wt({horizontalSymbol:Ce,verticalSymbol:er,gateSide:"left",drainSide:"bottom"}),SY=Wt({horizontalSymbol:Ce,verticalSymbol:er,gateSide:"left",drainSide:"top"}),kY=Wt({horizontalSymbol:Ce,verticalSymbol:er,gateSide:"right",drainSide:"bottom"}),YY=Wt({horizontalSymbol:Ce,verticalSymbol:er,gateSide:"right",drainSide:"top"}),MY=Wt({horizontalSymbol:Ce,verticalSymbol:er,gateSide:"top",drainSide:"left"}),IY=Wt({horizontalSymbol:Ce,verticalSymbol:er,gateSide:"top",drainSide:"right"}),LY={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:0.09,y:0.15},{x:0.09,y:0.07}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:0.09,y:-0.08},{x:0.09,y:-0.15}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:0.09,y:0.03},{x:0.09,y:-0.04}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.2,y:0.03},{x:0.2,y:-0.04},{x:0.27,y:-0.01},{x:0.2,y:0.03}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.11},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:EY,texts:tb,bounds:eb,refblocks:xi,circles:PY}=LY,rb={x:eb.centerX,y:eb.centerY},Xe=Tt({primitives:[...Object.values(EY),...Object.values(PY),{...tb.top1,anchor:"middle_right",x:0},{...tb.bottom1,anchor:"middle_right",x:0}],ports:[{...xi.top1,labels:["1","drain"]},{...xi.bottom1,labels:["2","source"]},{...xi.left1,labels:["3","gate"]}],size:Sn(rb,[xi.top1,xi.bottom1,xi.left1]),center:rb}),A2=Z(Xe),F2=A2.primitives.filter((t)=>t.type==="text"),sd=F2.find((t)=>t.text==="{VAL}");sd.x=-0.35;sd.y=0;sd.anchor="middle_right";var cd=F2.find((t)=>t.text==="{REF}");cd.y=0;cd.x=0.35;cd.anchor="middle_left";var rr=A2,TY=Wt({horizontalSymbol:Xe,verticalSymbol:rr,gateSide:"bottom",drainSide:"left"}),WY=Wt({horizontalSymbol:Xe,verticalSymbol:rr,gateSide:"bottom",drainSide:"right"}),OY=Wt({horizontalSymbol:Xe,verticalSymbol:rr,gateSide:"left",drainSide:"bottom"}),jY=Wt({horizontalSymbol:Xe,verticalSymbol:rr,gateSide:"left",drainSide:"top"}),RY=Wt({horizontalSymbol:Xe,verticalSymbol:rr,gateSide:"right",drainSide:"bottom"}),CY=Wt({horizontalSymbol:Xe,verticalSymbol:rr,gateSide:"right",drainSide:"top"}),XY=Wt({horizontalSymbol:Xe,verticalSymbol:rr,gateSide:"top",drainSide:"left"}),$Y=Wt({horizontalSymbol:Xe,verticalSymbol:rr,gateSide:"top",drainSide:"right"}),NY={paths:{path11:{type:"path",points:[{x:-0.54,y:-0.01},{x:-0.15,y:-0.02}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.13,y:0},{x:-0.13,y:-0.13}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.13,y:0.13},{x:0.13,y:0}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.13,y:-0.13},{x:-0.13,y:0.13}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.13,y:0.13},{x:0.13,y:-0.13}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:0},{x:0.54,y:-0.01}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:0.2,y:0.38},{x:0.16,y:0.28},{x:0.26,y:0.3}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:0.33,y:0.43},{x:0.32,y:0.42},{x:0.21,y:0.31},{x:0.21,y:0.31}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:0.35,y:0.35},{x:0.31,y:0.26},{x:0.41,y:0.27}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:0.48,y:0.4},{x:0.47,y:0.39},{x:0.35,y:0.29},{x:0.35,y:0.29}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.1,y:0.35},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.43}},refblocks:{left1:{x:-0.54,y:-0.01},right1:{x:0.54,y:-0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.43,maxY:0.43,width:1.14,height:0.85,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:-0.01,radius:0.29,color:"primary",fill:!1}}},B2=W(NY).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),S2=Z(B2),VY=S2.primitives.filter((t)=>t.type==="text"),k2=VY.find((t)=>t.text==="{REF}");k2.y=0;k2.anchor="middle_left";var zY=S2,ld={paths:{enclosure:{type:"path",points:[{x:-0.5,y:0.2749999999999999},{x:0.5,y:0.2749999999999999},{x:0.5,y:-0.27500000000000013},{x:-0.5,y:-0.27500000000000013},{x:-0.5,y:0.2749999999999999}],color:"primary",fill:!1},"pin-one-lead":{type:"path",points:[{x:-0.6499999999999999,y:0.10833329999999997},{x:-0.5,y:0.10833329999999997}],color:"primary",fill:!1},"pin-two-lead":{type:"path",points:[{x:-0.6499999999999999,y:-0.10833329999999997},{x:-0.5,y:-0.10833329999999997}],color:"primary",fill:!1},"pin-four-lead":{type:"path",points:[{x:0.5,y:0.10833329999999997},{x:0.6499999999999999,y:0.10833329999999997}],color:"primary",fill:!1},"pin-three-lead":{type:"path",points:[{x:0.5,y:-0.10833329999999997},{x:0.6499999999999999,y:-0.10833329999999997}],color:"primary",fill:!1},"led-anode-lead":{type:"path",points:[{x:-0.5,y:0.10833329999999997},{x:-0.2749999999999999,y:0.10833329999999997},{x:-0.2749999999999999,y:0.04999999999999982}],color:"primary",fill:!1},"led-body":{type:"path",points:[{x:-0.32499999999999996,y:0.04999999999999982},{x:-0.22499999999999987,y:0.04999999999999982},{x:-0.2749999999999999,y:-0.050000000000000044},{x:-0.32499999999999996,y:0.04999999999999982}],color:"primary",fill:!1},"led-cathode":{type:"path",points:[{x:-0.32499999999999996,y:-0.050000000000000044},{x:-0.22499999999999987,y:-0.050000000000000044}],color:"primary",fill:!1},"led-cathode-lead":{type:"path",points:[{x:-0.2749999999999999,y:-0.050000000000000044},{x:-0.2749999999999999,y:-0.10833329999999997},{x:-0.5,y:-0.10833329999999997}],color:"primary",fill:!1},collector:{type:"path",points:[{x:0.5,y:0.10833329999999997},{x:0.3700000000000001,y:0.10833329999999997},{x:0.28000000000000025,y:0.05499999999999994}],color:"primary",fill:!1},"transistor-base":{type:"path",points:[{x:0.28000000000000025,y:0.08499999999999996},{x:0.28000000000000025,y:-0.08499999999999996}],color:"primary",fill:!1},emitter:{type:"path",points:[{x:0.28000000000000025,y:-0.05500000000000016},{x:0.375,y:-0.10833329999999997},{x:0.5,y:-0.10833329999999997}],color:"primary",fill:!1},"emitter-arrow":{type:"path",points:[{x:0.31620000000000004,y:-0.09600000000000009},{x:0.365,y:-0.10270000000000024},{x:0.3338000000000001,y:-0.06460000000000021}],color:"primary",fill:!1},"light-ray-one":{type:"path",points:[{x:-0.1299999999999999,y:0.10499999999999998},{x:0.1050000000000002,y:0.009999999999999787}],color:"primary",fill:!1},"light-ray-one-head":{type:"path",points:[{x:0.04700000000000015,y:0.014000000000000012},{x:0.1050000000000002,y:0.009999999999999787},{x:0.06099999999999994,y:0.04699999999999993}],color:"primary",fill:!1},"light-ray-two":{type:"path",points:[{x:-0.1299999999999999,y:-0.0050000000000001155},{x:0.1050000000000002,y:-0.10000000000000009}],color:"primary",fill:!1},"light-ray-two-head":{type:"path",points:[{x:0.04700000000000015,y:-0.09600000000000009},{x:0.1050000000000002,y:-0.10000000000000009},{x:0.06099999999999994,y:-0.06300000000000017}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3800000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3800000000000001}},refblocks:{left1:{x:-0.6499999999999999,y:-0.10833333333330031},left2:{x:-0.6499999999999999,y:0.10833333333329986},right1:{x:0.6499999999999999,y:-0.10833333333330031},right2:{x:0.6499999999999999,y:0.10833333333329986}},bounds:{minX:-0.6499999999999999,maxX:0.6499999999999999,minY:-0.3800000000000001,maxY:0.3800000000000001,width:1.2999999999999998,height:0.7600000000000002,centerX:0,centerY:0},circles:{}},DY=W(ld).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),Y2=W(ld).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),QY=Me(Y2),UY=W(ld).labelPort("left1",["2","cathode","input_cathode"]).labelPort("left2",["1","anode","input_anode"]).labelPort("right1",["3","emitter","output_emitter"]).labelPort("right2",["4","collector","output_collector"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),ZY={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.55},{x:0.28,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.1}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.29,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.07,y:-0.1},{x:0.29,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.01,y:-0.07},{x:0.01,y:0.06},{x:-0.08,y:0},{x:0.01,y:-0.07}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.15,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.42}},refblocks:{top1:{x:0.28,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:HY,texts:ib,bounds:Fa,refblocks:up,circles:GY}=ZY,M2=Tt({primitives:[...Object.values(HY),...Object.values(GY),{...ib.top1,anchor:"middle_right",x:0},{...ib.bottom1,anchor:"middle_right"}],ports:[{...up.top1,labels:["1","drain"]},{...up.bottom1,labels:["2","source"]},{...up.left1,labels:["3","gate"]}],size:{width:Fa.width,height:Fa.height},center:{x:Fa.centerX,y:Fa.centerY}}),I2=Z(M2),L2=I2.primitives.filter((t)=>t.type==="text"),pd=L2.find((t)=>t.text==="{VAL}");pd.x=-0.35;pd.y=0;pd.anchor="middle_right";var dd=L2.find((t)=>t.text==="{REF}");dd.y=0;dd.x=0.35;dd.anchor="middle_left";var qY=I2,Er={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:0.07,y:0.27},{x:0.07,y:-0.28}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:0.28,y:0.24},{x:0.08,y:0.11}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:0.29,y:-0.24},{x:0.09,y:-0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:0.25},{x:0.29,y:0.55}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.25}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.15,y:-0.23},{x:0.22,y:-0.12},{x:0.12,y:-0.12},{x:0.15,y:-0.23}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.08,y:0.37},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.41}},refblocks:{top1:{x:0.29,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{"path1-0":{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:KY,texts:vQ,bounds:Ba,refblocks:yp,circles:JY}=Er,tM=W({primitives:[...Object.values(KY),...Object.values(JY),{type:"text",text:"{REF}",x:-0.1,y:0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:-0.3094553499999995}],ports:[{...yp.top1,labels:["1","collector"]},{...yp.bottom1,labels:["3","emitter"]},{...yp.left1,labels:["2","base"]}],size:{width:Ba.width,height:Ba.height},center:{x:Ba.centerX,y:Ba.centerY}}).rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_right").build(),{paths:wQ,texts:AQ,bounds:FQ,refblocks:BQ,circles:SQ}=Er,eM=W(Er).rotateRightFacingSymbol("up").changeTextAnchor("{VAL}","middle_left").labelPort("left1",["2","base"]).labelPort("top1",["1","collector"]).labelPort("bottom1",["3","emitter"]).changeTextAnchor("{REF}","middle_right").build(),{paths:rM,texts:kQ,bounds:Sa,refblocks:_p,circles:iM}=Er,nM=W({primitives:[...Object.values(rM),...Object.values(iM),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{..._p.top1,labels:["1","collector"]},{..._p.bottom1,labels:["3","emitter"]},{..._p.left1,labels:["2","base"]}],size:{width:Sa.width,height:Sa.height},center:{x:Sa.centerX,y:Sa.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_bottom").build(),{paths:oM,texts:YQ,bounds:ka,refblocks:mp,circles:aM}=Er,sM=W({primitives:[...Object.values(oM),...Object.values(aM),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...mp.top1,labels:["1","collector"]},{...mp.bottom1,labels:["3","emitter"]},{...mp.left1,labels:["2","base"]}],size:{width:ka.width,height:ka.height},center:{x:ka.centerX,y:ka.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_top").changeTextAnchor("{VAL}","middle_top").build(),{paths:cM,texts:MQ,bounds:Ya,refblocks:fp,circles:lM}=Er,pM=W({primitives:[...Object.values(cM),...Object.values(lM),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...fp.top1,labels:["1","collector"]},{...fp.bottom1,labels:["3","emitter"]},{...fp.left1,labels:["2","base"]}],size:{width:Ya.width,height:Ya.height},center:{x:Ya.centerX,y:Ya.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:dM,texts:IQ,bounds:Ma,refblocks:xp,circles:hM}=Er,uM=W({primitives:[...Object.values(dM),...Object.values(hM),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...xp.top1,labels:["1","collector"]},{...xp.bottom1,labels:["3","emitter"]},{...xp.left1,labels:["2","base"]}],size:{width:Ma.width,height:Ma.height},center:{x:Ma.centerX,y:Ma.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),yM={paths:{path40:{type:"path",points:[{x:-0.19,y:0.33},{x:-0.26,y:0.14}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.38,y:0.26},{x:-0.19,y:0.33}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.26,y:0.14},{x:-0.38,y:0.26}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.26,y:0.39},{x:-0.13,y:0.26}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.2},{x:-0.52,y:0}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:0.52},{x:-0.19,y:0.33}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-0.19,y:-0.32},{x:-0.38,y:-0.26}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-0.26,y:-0.13},{x:-0.19,y:-0.32}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-0.38,y:-0.26},{x:-0.26,y:-0.13}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-0.13,y:-0.26},{x:-0.26,y:-0.39}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-0.32,y:-0.19},{x:-0.51,y:-0.01}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-0.01,y:-0.5},{x:-0.19,y:-0.32}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:0.32,y:0.19},{x:0.13,y:0.26}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:0.26,y:0.38},{x:0.32,y:0.19}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:0.13,y:0.26},{x:0.26,y:0.38}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:0.39,y:0.26},{x:0.26,y:0.13}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:0.2,y:0.32},{x:0.01,y:0.51}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:0.52,y:0},{x:0.32,y:0.19}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:0.32,y:-0.19},{x:0.26,y:-0.38}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:0.13,y:-0.26},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:0.26,y:-0.38},{x:0.13,y:-0.26}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:0.26,y:-0.13},{x:0.39,y:-0.26}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:0.19,y:-0.32},{x:0,y:-0.52}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:0.5,y:-0.01},{x:0.32,y:-0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.29,y:0.46},bottom1:{type:"text",text:"{VAL}",x:-0.29,y:-0.5}},refblocks:{top1:{x:0,y:0.52},bottom1:{x:0,y:-0.52},left1:{x:-0.52,y:0},right1:{x:0.52,y:0}},bounds:{minX:-0.55,maxX:0.55,minY:-0.55,maxY:0.55,width:1.09,height:1.09,centerX:0,centerY:0},circles:{}},{paths:_M,texts:nb,bounds:Ia,refblocks:ob}=yM,E2=Tt({primitives:[...Object.values(_M),{...nb.bottom1,y:0.35,anchor:"middle_top"},{...nb.top1,anchor:"middle_left"}],ports:[{...ob.left1,labels:["1"]},{...ob.right1,labels:["2"]}],size:{width:Ia.width+0.05,height:Ia.height},center:{x:Ia.centerX,y:Ia.centerY}}),mM=Z(E2),fM=mM,xM={paths:{path18:{type:"path",points:[{x:-0.53,y:0},{x:-0.27,y:0}],color:"primary",fill:!1},path19:{type:"path",points:[{x:0.26,y:0},{x:0.53,y:0}],color:"primary",fill:!1},path20:{type:"path",points:[{x:0,y:0.13},{x:0.26,y:0.13},{x:0.26,y:-0.13},{x:-0.27,y:-0.13},{x:-0.27,y:0.13},{x:0,y:0.13}],color:"primary",fill:!1},path24:{type:"path",points:[{x:0.29,y:-0.29},{x:0.26,y:-0.16},{x:0.16,y:-0.26},{x:0.29,y:-0.29}],color:"primary",fill:!0},path26:{type:"path",points:[{x:-0.3,y:0.29},{x:0.2,y:-0.2}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.06,y:0.2},bottom1:{type:"text",text:"{VAL}",x:-0.1,y:-0.28}},refblocks:{left1:{x:-0.53,y:0},right1:{x:0.53,y:0}},bounds:{minX:-0.56,maxX:0.56,minY:-0.29,maxY:0.29,width:1.13,height:0.58,centerX:0,centerY:0},circles:{}},{paths:gM,texts:ab,bounds:La,refblocks:sb}=xM,Rs=Tt({primitives:[...Object.values(gM),{...ab.bottom1,x:0,y:-0.35,anchor:"middle_top"},{...ab.top1,x:0,y:0.35,anchor:"middle_bottom"}],ports:[{...sb.left1,labels:["1"]},{...sb.right1,labels:["2"]}],size:{width:La.width+0.05,height:La.height},center:{x:La.centerX,y:La.centerY}}),hd=Z(Rs,"down"),ud=hd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),yd=hd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");ud.anchor="middle_left";yd.anchor="middle_left";ud.y+=0.31;ud.x=0.34;yd.y-=0.31;yd.x=0.34;var bM=hd,_d=Z(Rs,"left"),md=_d.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),fd=_d.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");md.anchor="middle_bottom";fd.anchor="middle_top";md.y+=0.73;md.x=0;fd.y-=0.7;fd.x=0;var vM=_d,xd=Z(Rs,"up"),gd=xd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),bd=xd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");gd.anchor="middle_left";bd.anchor="middle_left";gd.y+=0.21;gd.x=0.34;bd.y-=0.21;bd.x=0.34;var wM=xd,Cs={paths:{path1:{type:"path",points:[{x:-0.42,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},"path1-2-1":{type:"path",points:[{x:-0.3,y:0},{x:-0.25,y:0.1},{x:-0.15,y:-0.1},{x:-0.05,y:0.1},{x:0.05,y:-0.1},{x:0.15,y:0.1},{x:0.25,y:-0.1},{x:0.3,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.3,y:0},{x:0.42,y:0}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0,y:-0.17},{x:0,y:-0.4}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0,y:-0.12},{x:0.05,y:-0.2},{x:-0.05,y:-0.2},{x:0,y:-0.12}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.3,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0.3,y:-0.25}},refblocks:{left:{x:-0.42,y:0},right:{x:0.42,y:0},bottom:{x:0,y:-0.4}},bounds:{minX:-0.42,maxX:0.42,minY:-0.2,maxY:0.2,width:0.84,height:0.4,centerX:0,centerY:0},circles:{}},{paths:AM,texts:LQ,bounds:Ea,refblocks:gp,circles:FM}=Cs,BM=W({primitives:[...Object.values(AM),...Object.values(FM),{type:"text",text:"{REF}",x:-0.15,y:0.2394553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.2394553499999995}],ports:[{...gp.left,labels:["1"]},{...gp.right,labels:["3"]},{...gp.bottom,labels:["2"]}],size:{width:Ea.width,height:Ea.height},center:{x:Ea.centerX,y:Ea.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:SM,texts:EQ,bounds:Pa,refblocks:bp,circles:kM}=Cs,YM=W({primitives:[...Object.values(SM),...Object.values(kM),{type:"text",text:"{REF}",x:-0.3,y:-0.3894553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.3194553499999995}],ports:[{...bp.left,labels:["1"]},{...bp.right,labels:["3"]},{...bp.bottom,labels:["2"]}],size:{width:Pa.width,height:Pa.height},center:{x:Pa.centerX,y:Pa.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),MM=W(Cs).labelPort("left",["1"]).labelPort("right",["3"]).labelPort("bottom",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:IM,texts:PQ,bounds:Ta,refblocks:vp,circles:LM}=Cs,EM=W({primitives:[...Object.values(IM),...Object.values(LM),{type:"text",text:"{REF}",x:0.3,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.2894553499999995}],ports:[{...vp.left,labels:["1"]},{...vp.right,labels:["3"]},{...vp.bottom,labels:["2"]}],size:{width:Ta.width,height:Ta.height},center:{x:Ta.centerX,y:Ta.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),PM={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.16,y:0.4},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.4},left1:{type:"text",text:"COS φ",x:-0.15,y:0.01}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:TM,texts:TQ,bounds:Wa,refblocks:cb,circles:WM}=PM,P2=Tt({primitives:[...Object.values(TM),...Object.values(WM),{type:"text",text:"{REF}",x:0,y:0.43330070000000065,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.43330070000000065,anchor:"middle_top"},{type:"text",text:"COS φ",x:0,y:0.014279000000000375,anchor:"center"}],ports:[{...cb.left1,labels:["1"]},{...cb.right1,labels:["2"]}],size:{width:Wa.width,height:Wa.height},center:{x:Wa.centerX,y:Wa.centerY}}),T2=Z(P2),vd=T2.primitives.filter((t)=>t.type==="text"),Ip=vd.find((t)=>t.text==="{REF}"),wd=vd.find((t)=>t.text==="{VAL}"),Lp=vd.find((t)=>t.text==="COS φ");Ip.x=0.35;Ip.y=0.4279000000000375,Ip.anchor="middle_left";wd.anchor="middle_left";wd.x=0.35;wd.y=-0.4279000000000375,Lp.x=0;Lp.y=0.014279000000000375,Lp.anchor="center";var OM=T2,jM={paths:{"path12-1-8-6-9-9":{type:"path",points:[{x:0.01,y:0.03},{x:0.01,y:-0.09}],color:"primary",fill:!1},"path12-1-5-6-4":{type:"path",points:[{x:-0.47,y:-0.05},{x:-0.17,y:-0.05}],color:"primary",fill:!1},"path12-1-8-0-0":{type:"path",points:[{x:-0.16,y:-0.09},{x:0.18,y:-0.09}],color:"primary",fill:!1},"path12-1-0-1":{type:"path",points:[{x:0.2,y:-0.05},{x:0.47,y:-0.05}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.22},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.22}},refblocks:{left1:{x:-0.47,y:-0.05},right1:{x:0.47,y:-0.05}},bounds:{minX:-0.5,maxX:0.5,minY:-0.22,maxY:0.22,width:1,height:0.45,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:-0.14,y:-0.05,radius:0.02,color:"primary",fill:!1},circle:{type:"circle",x:0.17,y:-0.05,radius:0.02,color:"primary",fill:!1}}},{paths:RM,texts:lb,bounds:pb,refblocks:db,circles:CM}=jM,W2=Tt({primitives:[...Object.values(RM),...Object.values(CM),{...lb.top1,anchor:"middle_left"},{...lb.bottom1,anchor:"middle_left"}],ports:[{...db.left1,labels:["1"]},{...db.right1,labels:["2"]}],center:{x:pb.centerX,y:pb.centerY}}),XM=Z(W2,"up"),O2={paths:{"path12-1-8-6-9-9":{type:"path",points:[{x:-0.05,y:0.09},{x:-0.05,y:0.04}],color:"primary",fill:!1},"path12-1-8-7-9-9":{type:"path",points:[{x:-0.05,y:0.09},{x:0.07,y:0.09}],color:"primary",fill:!1},"path12-1-8-6-9-10":{type:"path",points:[{x:0.07,y:0.09},{x:0.07,y:0.04}],color:"primary",fill:!1},"path12-1-5-6-4":{type:"path",points:[{x:-0.47,y:-0.05},{x:-0.17,y:-0.05}],color:"primary",fill:!1},"path12-1-8-0-0":{type:"path",points:[{x:-0.16,y:0.04},{x:0.18,y:0.04}],color:"primary",fill:!1},"path12-1-0-1":{type:"path",points:[{x:0.2,y:-0.05},{x:0.47,y:-0.05}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.29},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.22}},refblocks:{left1:{x:-0.47,y:-0.05},right1:{x:0.47,y:-0.05}},bounds:{minX:-0.5,maxX:0.5,minY:-0.22,maxY:0.22,width:1,height:0.45,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:-0.14,y:-0.05,radius:0.02,color:"primary",fill:!1},circle:{type:"circle",x:0.17,y:-0.05,radius:0.02,color:"primary",fill:!1}}},{paths:$M,texts:hb,bounds:NM,refblocks:wp,circles:VM}=O2,kn=Tt({primitives:[...Object.values($M),...Object.values(VM),{...hb.top1,x:0,y:0.3594553499999995,anchor:"middle_bottom"},{...hb.bottom1,x:0,y:-0.3594553499999995,anchor:"middle_top"}],ports:[{...wp.left1,labels:["1"]},{...wp.right1,labels:["2"]}],center:{x:NM.centerX,y:wp.left1.y}}),Ad=Z(kn,"down"),Fd=Ad.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Bd=Ad.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Fd.anchor="middle_bottom";Bd.anchor="middle_top";Fd.y=0.4;Fd.x=0.35;Bd.y=-0.4;Bd.x=0.35;var zM=Ad,{paths:DM,texts:ub,bounds:QM,refblocks:Ap,circles:UM}=O2,ZM=Tt({primitives:[...Object.values(DM),...Object.values(UM),{...ub.top1,x:0,y:0.3594553499999995,anchor:"middle_bottom"},{...ub.bottom1,x:0,y:-0.3594553499999995,anchor:"middle_top"}],ports:[{...Ap.left1,labels:["1"]},{...Ap.right1,labels:["2"]}],center:{x:QM.centerX,y:Ap.left1.y}}),Sd=Z(kn,"left"),kd=Sd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Yd=Sd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");kd.anchor="middle_bottom";Yd.anchor="middle_top";kd.y=0.4;kd.x=0;Yd.y=-0.4;Yd.x=0;var HM=Sd,Md=Z(kn,"up"),Id=Md.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ld=Md.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Id.anchor="middle_left";Ld.anchor="middle_left";Id.y+=0.4;Id.x=0.34;Ld.y-=0.41;Ld.x=0.34;var GM=Md,Ed=Z(kn,"up"),Pd=Ed.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Td=Ed.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Pd.anchor="middle_left";Td.anchor="middle_left";Pd.y+=0.4;Pd.x=0.34;Td.y-=0.41;Td.x=0.34;var qM=Ed,Xs={paths:{path12_rotated:{type:"path",points:[{x:-0.09,y:0.12},{x:-0.09,y:-0.12}],color:"primary",fill:!1},path2_rotated:{type:"path",points:[{x:-0.09,y:0},{x:0.09,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.03}},refblocks:{left1:{x:0.09,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{}},{paths:KM,texts:WQ,bounds:yb,refblocks:JM,circles:tI}=Xs,eI=W({primitives:[...Object.values(KM),...Object.values(tI),{type:"text",text:"{REF}",x:-0.14,y:-0}],ports:[{...JM.left1,labels:["1"]}],center:{x:yb.centerX,y:yb.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),{paths:rI,texts:OQ,bounds:_b,refblocks:iI,circles:nI}=Xs,oI=W({primitives:[...Object.values(rI),...Object.values(nI),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...iI.left1,labels:["1"]}],center:{x:_b.centerX,y:_b.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),{paths:aI,texts:jQ,bounds:mb,refblocks:sI,circles:cI}=Xs,lI=W({primitives:[...Object.values(aI),...Object.values(cI),{type:"text",text:"{REF}",x:-0.14,y:-0}],ports:[{...sI.left1,labels:["1"]}],center:{x:mb.centerX,y:mb.centerY}}).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),{paths:pI,texts:RQ,bounds:fb,refblocks:dI}=Xs,hI=W({primitives:[...Object.values(pI),{type:"text",text:"{REF}",x:-0.14,y:0}],ports:[{...dI.left1,labels:["1"]}],center:{x:fb.centerX,y:fb.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),uI={paths:{path40:{type:"path",points:[{x:-0.19,y:-0.33},{x:-0.26,y:-0.14}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.38,y:-0.26},{x:-0.19,y:-0.33}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.26,y:-0.14},{x:-0.38,y:-0.26}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.26,y:-0.39},{x:-0.13,y:-0.26}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:-0.2},{x:-0.52,y:0}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:-0.52},{x:-0.19,y:-0.33}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-0.19,y:0.32},{x:-0.38,y:0.26}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-0.26,y:0.13},{x:-0.19,y:0.32}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-0.38,y:0.26},{x:-0.26,y:0.13}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-0.13,y:0.26},{x:-0.26,y:0.39}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-0.32,y:0.19},{x:-0.51,y:0.01}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-0.01,y:0.5},{x:-0.19,y:0.32}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:0.32,y:-0.19},{x:0.13,y:-0.26}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:0.26,y:-0.38},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:0.13,y:-0.26},{x:0.26,y:-0.38}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:0.39,y:-0.26},{x:0.26,y:-0.13}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:0.2,y:-0.32},{x:0.01,y:-0.51}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:0.52,y:0},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:0.32,y:0.19},{x:0.26,y:0.38}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:0.13,y:0.26},{x:0.32,y:0.19}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:0.26,y:0.38},{x:0.13,y:0.26}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:0.26,y:0.13},{x:0.39,y:0.26}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:0.19,y:0.32},{x:0,y:0.52}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:0.5,y:0.01},{x:0.32,y:0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.29,y:-0.46},bottom1:{type:"text",text:"{VAL}",x:-0.29,y:0.5}},refblocks:{top1:{x:0,y:-0.52},bottom1:{x:0,y:0.52},left1:{x:-0.52,y:0},right1:{x:0.52,y:0}},bounds:{minX:-0.55,maxX:0.55,minY:-0.56,maxY:0.55,width:1.09,height:1.1,centerX:0,centerY:0},circles:{}},{paths:yI,texts:xb,bounds:Oa,refblocks:ja,circles:_I}=uI,j2=Tt({primitives:[...Object.values(yI),...Object.values(_I),{...xb.top1,anchor:"middle_right"},{...xb.bottom1,anchor:"middle_right"}],ports:[{...ja.top1,labels:["1"]},{...ja.bottom1,labels:["2"]},{...ja.left1,labels:["3"]},{...ja.right1,labels:["4"]}],size:{width:Oa.width,height:Oa.height},center:{x:Oa.centerX,y:Oa.centerY}}),Wd=Z(j2),mI=Wd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),fI=Wd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");mI.anchor="middle_left";fI.anchor="middle_right";var xI=Wd,$s={paths:{path27:{type:"path",points:[{x:0.47,y:0.04},{x:0.21,y:0.04}],color:"primary",fill:!1},"path27-0":{type:"path",points:[{x:-0.21,y:0.04},{x:-0.47,y:0.04}],color:"primary",fill:!1},"path27-8-2-4":{type:"path",points:[{x:0.21,y:0.04},{x:0.19,y:-0.05}],color:"primary",fill:!1},"path27-8-2-4-29":{type:"path",points:[{x:-0.19,y:0.14},{x:-0.21,y:0.04}],color:"primary",fill:!1},"path27-8-2-4-5":{type:"path",points:[{x:0.19,y:-0.05},{x:0.13,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1":{type:"path",points:[{x:0.08,y:-0.05},{x:0.13,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9":{type:"path",points:[{x:0.08,y:-0.05},{x:0.03,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2":{type:"path",points:[{x:-0.03,y:-0.05},{x:0.03,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1":{type:"path",points:[{x:-0.03,y:-0.05},{x:-0.08,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1-2":{type:"path",points:[{x:-0.13,y:-0.05},{x:-0.08,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1-2-2":{type:"path",points:[{x:-0.13,y:-0.05},{x:-0.19,y:0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.05,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.04,y:-0.42}},refblocks:{left1:{x:-0.47,y:0.04},right1:{x:0.47,y:0.04}},bounds:{minX:-0.49,maxX:0.49,minY:-0.42,maxY:0.42,width:0.99,height:0.84,centerX:0,centerY:0},circles:{}},{paths:gI,texts:CQ,bounds:Ra,refblocks:gb,circles:bI}=$s,vI=W({primitives:[...Object.values(gI),...Object.values(bI),{type:"text",text:"{REF}",x:-0.2,y:0.2194553499999995},{type:"text",text:"{VAL}",x:0.2,y:0.2194553499999995}],ports:[{...gb.left1,labels:["1"]},{...gb.right1,labels:["2"]}],size:{width:Ra.width,height:Ra.height},center:{x:Ra.centerX,y:Ra.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:wI,texts:XQ,bounds:Ca,refblocks:bb,circles:AI}=$s,FI=W({primitives:[...Object.values(wI),...Object.values(AI),{type:"text",text:"{REF}",x:0,y:-0.1704553499999995},{type:"text",text:"{VAL}",x:0,y:0.2294553499999995}],ports:[{...bb.left1,labels:["1"]},{...bb.right1,labels:["2"]}],size:{width:Ca.width,height:Ca.height},center:{x:Ca.centerX,y:Ca.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:BI,texts:$Q,bounds:Xa,refblocks:vb,circles:SI}=$s,kI=W({primitives:[...Object.values(BI),...Object.values(SI),{type:"text",text:"{REF}",x:0,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:-0.1704553499999995}],ports:[{...vb.left1,labels:["1"]},{...vb.right1,labels:["2"]}],size:{width:Xa.width,height:Xa.height},center:{x:Xa.centerX,y:Xa.centerY}}).rotateRightFacingSymbol("right").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Ns={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.16,y:0}],color:"primary",fill:!1,strokeWidth:0.02},zigzag:{type:"path",points:[{x:-0.16,y:0},{x:-0.12,y:0.095},{x:-0.07,y:-0.095},{x:-0.02,y:0.095},{x:0.02,y:-0.095},{x:0.07,y:0.095},{x:0.12,y:-0.095},{x:0.16,y:0}],color:"primary",fill:!1,strokeWidth:0.02},"right-lead":{type:"path",points:[{x:0.16,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.02}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},YI=ft(Ns,{kind:"resistor",orientation:"down"}),MI=ft(Ns,{kind:"resistor",orientation:"left"}),II=ft(Ns,{kind:"resistor",orientation:"right"}),LI=ft(Ns,{kind:"resistor",orientation:"up"}),{paths:EI,texts:NQ,bounds:$a,refblocks:wb,circles:PI}=$s,TI=W({primitives:[...Object.values(EI),...Object.values(PI),{type:"text",text:"{REF}",x:0.2,y:-0.1404553499999995},{type:"text",text:"{VAL}",x:-0.2,y:-0.1494553499999995}],ports:[{...wb.left1,labels:["1"]},{...wb.right1,labels:["2"]}],size:{width:$a.width,height:$a.height},center:{x:$a.centerX,y:$a.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Vs={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.115,y:0}],color:"primary",fill:!1,strokeWidth:0.02},zigzag:{type:"path",points:[{x:-0.115,y:0},{x:-0.07,y:0.095},{x:-0.025,y:-0.095},{x:0.025,y:0.095},{x:0.07,y:-0.095},{x:0.115,y:0}],color:"primary",fill:!1,strokeWidth:0.02},"right-lead":{type:"path",points:[{x:0.115,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.02}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},WI=ft(Vs,{kind:"resistor",orientation:"down"}),OI=ft(Vs,{kind:"resistor",orientation:"left"}),jI=ft(Vs,{kind:"resistor",orientation:"right"}),RI=ft(Vs,{kind:"resistor",orientation:"up"}),R2={paths:{path27:{type:"path",points:[{x:0.76,y:-0.28},{x:0.31,y:-0.28}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.3,y:-0.02},{x:-0.77,y:-0.02}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.3,y:0.35},{x:-0.3,y:-0.28}],color:"primary",fill:!1},"path27-3":{type:"path",points:[{x:0.77,y:0.35},{x:0.32,y:0.35}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.07,y:-0.28},{x:-0.3,y:-0.28}],color:"primary",fill:!1},"path29-5-7":{type:"path",points:[{x:0.33,y:-0.28},{x:0.11,y:-0.28}],color:"primary",fill:!1},"path29-5-7-6":{type:"path",points:[{x:-0.06,y:-0.17},{x:-0.06,y:-0.39}],color:"primary",fill:!1},"path29-5-7-6-6":{type:"path",points:[{x:0.09,y:-0.17},{x:0.09,y:-0.39}],color:"primary",fill:!1},"path29-5-9":{type:"path",points:[{x:-0.07,y:0.35},{x:-0.3,y:0.35}],color:"primary",fill:!1},"path29-5-7-2":{type:"path",points:[{x:0.33,y:0.35},{x:0.11,y:0.35}],color:"primary",fill:!1},"path29-5-7-6-0":{type:"path",points:[{x:-0.06,y:0.46},{x:-0.06,y:0.24}],color:"primary",fill:!1},"path29-5-7-6-6-2":{type:"path",points:[{x:0.09,y:0.46},{x:0.09,y:0.24}],color:"primary",fill:!1},"path29-5-92":{type:"path",points:[{x:0.33,y:0.13},{x:0.33,y:0.35}],color:"primary",fill:!1},"path29-5-7-28":{type:"path",points:[{x:0.33,y:-0.28},{x:0.33,y:-0.05}],color:"primary",fill:!1},"path29-5-7-6-9":{type:"path",points:[{x:0.44,y:0.11},{x:0.22,y:0.11}],color:"primary",fill:!1},"path29-5-7-6-6-7":{type:"path",points:[{x:0.44,y:-0.04},{x:0.22,y:-0.04}],color:"primary",fill:!1},"path29-5-7-6-9-2":{type:"path",points:[{x:0.44,y:0.07},{x:0.22,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-4":{type:"path",points:[{x:0.44,y:0},{x:0.44,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-4-6":{type:"path",points:[{x:0.22,y:0},{x:0.22,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-9":{type:"path",points:[{x:0.44,y:0},{x:0.22,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.02,y:0.53},bottom1:{type:"text",text:"{VAL}",x:0.01,y:-0.54}},refblocks:{left1:{x:-0.77,y:-0.02},right1:{x:0.76,y:-0.28},right2:{x:0.77,y:0.35}},bounds:{minX:-0.79,maxX:0.79,minY:-0.54,maxY:0.54,width:1.59,height:1.07,centerX:0,centerY:0},circles:{}},{paths:CI,texts:Ab,bounds:Na,refblocks:Fp,circles:XI}=R2,zs=Tt({primitives:[...Object.values(CI),...Object.values(XI),{...Ab.top1,anchor:"middle_bottom"},{...Ab.bottom1,anchor:"middle_top"}],ports:[{...Fp.left1,labels:["1"]},{...Fp.right1,labels:["2"]},{...Fp.right2,labels:["3"]}],size:{width:Na.width,height:Na.height},center:{x:Na.centerX,y:Na.centerY}}),Od=Z(zs,"down"),jd=Od.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Rd=Od.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");jd.anchor="middle_bottom";Rd.anchor="middle_top";jd.y+=0.3;jd.x+=0.101;Rd.y-=0.49999;Rd.x+=1.19999;var $I=Od,{paths:NI,texts:VQ,bounds:Va,refblocks:Bp,circles:VI}=R2,C2=Tt({primitives:[...Object.values(NI),...Object.values(VI),{type:"text",text:"{REF}",x:0.01596175000000022,y:-0.5308501500000009,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0.013116750000000454,y:0.5408501499999989,anchor:"middle_bottom"}],ports:[{...Bp.left1,labels:["1"]},{...Bp.right1,labels:["2"]},{...Bp.right2,labels:["3"]}],size:{width:Va.width,height:Va.height},center:{x:Va.centerX,y:Va.centerY}}),Cd=Z(zs,"left"),Xd=Cd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),$d=Cd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Xd.anchor="middle_bottom";$d.anchor="middle_top";Xd.y+=0.99;Xd.x-=0;$d.y-=1.10999;$d.x=0;var zI=Cd,Nd=Z(zs,"up"),Vd=Nd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),zd=Nd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Vd.anchor="middle_bottom";zd.anchor="middle_top";Vd.y+=0.499;Vd.x=0.62;zd.y-=0.29999;zd.x+=0.1;var DI=Nd,QI=Z(C2),Dd={paths:{"input-lead":{type:"path",points:[{x:-0.65,y:0.010000000000000231},{x:-0.30000000000000004,y:0.010000000000000231}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.30000000000000004,y:0.3600000000000001},{x:0.25,y:0.010000000000000231},{x:-0.30000000000000004,y:-0.33999999999999986},{x:-0.30000000000000004,y:0.3600000000000001}],color:"primary",fill:!1},"schmitt-marker":{type:"path",points:[{x:-0.17999999999999994,y:-0.08999999999999986},{x:-0.09999999999999987,y:-0.08999999999999986},{x:-0.09999999999999987,y:0.1100000000000001},{x:-0.019999999999999796,y:0.1100000000000001}],color:"primary",fill:!1},"output-lead":{type:"path",points:[{x:0.3800000000000001,y:0.010000000000000231},{x:0.6500000000000001,y:0.010000000000000231}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4700000000000002},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.47}},refblocks:{left1:{x:-0.65,y:0.010000000000000231},right1:{x:0.6500000000000001,y:0.010000000000000231}},bounds:{minX:-0.65,maxX:0.6500000000000001,minY:-0.47,maxY:0.4700000000000002,width:1.3000000000000003,height:0.9400000000000002,centerX:0.00000000000000005551115123125783,centerY:0.00000000000000011102230246251565},circles:{"inversion-bubble":{type:"circle",x:0.31499999999999995,y:0.010000000000000231,radius:0.065,color:"primary",fill:!1}}},UI=W(Dd).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),X2=W(Dd).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),ZI=Me(X2),HI=W(Dd).labelPort("left1",["1","in","input","a"]).labelPort("right1",["2","out","output","y"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),GI={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-7":{type:"path",points:[{x:0.21,y:0.18},{x:0.14,y:0.18}],color:"primary",fill:!1},"path43-7-9":{type:"path",points:[{x:0.21,y:0.13},{x:0.21,y:0.18}],color:"primary",fill:!1},"path43-7-2":{type:"path",points:[{x:0.08,y:-0.09},{x:0.14,y:-0.09}],color:"primary",fill:!1},"path43-7-9-3":{type:"path",points:[{x:0.08,y:-0.04},{x:0.08,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},Ds=W(GI).labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{VAL}","middle_top").changeTextAnchor("{REF}","middle_bottom").build(),Qd=Z(Ds,"down"),Ud=Qd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Zd=Qd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Ud.anchor="middle_left";Zd.anchor="middle_left";Ud.y+=0.3;Ud.x=0.3;Zd.y-=0.3;Zd.x=0.3;var qI=Qd,Hd=Z(Ds,"left"),Gd=Hd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),qd=Hd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Gd.anchor="middle_bottom";qd.anchor="middle_top";Gd.y+=0.5;Gd.x=0;qd.y-=0.55;qd.x=0;var KI=Hd,Kd=Z(Ds,"up"),Jd=Kd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),th=Kd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Jd.anchor="middle_left";th.anchor="middle_left";Jd.y+=0.3;Jd.x=0.3;th.y-=0.3;th.x=0.3;var JI=Kd,$2={paths:{path11:{type:"path",points:[{x:-0.52,y:0.04},{x:-0.18,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.19,y:0.05},{x:0.52,y:0.05}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:0.18,y:-0.15},{x:0.18,y:0.25}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:0.19,y:0},{x:0.35,y:-0.14}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:0.35,y:-0.14},{x:0.34,y:-0.35}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.17,y:0.27},{x:-0.17,y:-0.15},{x:0.18,y:0.05},{x:-0.17,y:0.27}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.22,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.11,y:-0.38}},refblocks:{bottom1:{x:0.34,y:-0.35},left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.05}},bounds:{minX:-0.55,maxX:0.55,minY:-0.38,maxY:0.38,width:1.09,height:0.77,centerX:0,centerY:0},circles:{}},{paths:zQ,texts:DQ,bounds:QQ,refblocks:UQ,circles:ZQ}=$2,N2=W($2).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("bottom1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),V2=Z(N2),tL=V2.primitives.filter((t)=>t.type==="text"),z2=tL.find((t)=>t.text==="{REF}");z2.y=0;z2.anchor="middle_left";var eL=V2,D2={paths:{path44:{type:"path",points:[{x:-0.195,y:-0.025},{x:-0.45,y:-0.025}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:-0.025},{x:0.195,y:-0.025}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.07,y:-0.025},{x:-0.07,y:-0.025}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.1},{x:0.07,y:-0.15}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.07,y:-0.15}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.082252,y:0.099398},{x:-0.094386,y:0.097598},{x:-0.106286,y:0.094618},{x:-0.117835,y:0.090485},{x:-0.128925,y:0.08524},{x:-0.139446,y:0.078934},{x:-0.149299,y:0.071626},{x:-0.158388,y:0.063388},{x:-0.166626,y:0.054299},{x:-0.173934,y:0.044446},{x:-0.18024,y:0.033925},{x:-0.185485,y:0.022835},{x:-0.189618,y:0.011286},{x:-0.192598,y:-0.000614},{x:-0.194398,y:-0.012748},{x:-0.195,y:-0.025},{x:-0.194398,y:-0.037252},{x:-0.192598,y:-0.049386},{x:-0.189618,y:-0.061286},{x:-0.185485,y:-0.072835},{x:-0.18024,y:-0.083925},{x:-0.173934,y:-0.094446},{x:-0.166626,y:-0.104299},{x:-0.158388,y:-0.113388},{x:-0.149299,y:-0.121626},{x:-0.139446,y:-0.128934},{x:-0.128925,y:-0.13524},{x:-0.117835,y:-0.140485},{x:-0.106286,y:-0.144618},{x:-0.094386,y:-0.147598},{x:-0.082252,y:-0.149398},{x:-0.07,y:-0.15}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.07,y:0.1},{x:0.082252,y:0.099398},{x:0.094386,y:0.097598},{x:0.106286,y:0.094618},{x:0.117835,y:0.090485},{x:0.128925,y:0.08524},{x:0.139446,y:0.078934},{x:0.149299,y:0.071626},{x:0.158388,y:0.063388},{x:0.166626,y:0.054299},{x:0.173934,y:0.044446},{x:0.18024,y:0.033925},{x:0.185485,y:0.022835},{x:0.189618,y:0.011286},{x:0.192598,y:-0.000614},{x:0.194398,y:-0.012748},{x:0.195,y:-0.025},{x:0.194398,y:-0.037252},{x:0.192598,y:-0.049386},{x:0.189618,y:-0.061286},{x:0.185485,y:-0.072835},{x:0.18024,y:-0.083925},{x:0.173934,y:-0.094446},{x:0.166626,y:-0.104299},{x:0.158388,y:-0.113388},{x:0.149299,y:-0.121626},{x:0.139446,y:-0.128934},{x:0.128925,y:-0.13524},{x:0.117835,y:-0.140485},{x:0.106286,y:-0.144618},{x:0.094386,y:-0.147598},{x:0.082252,y:-0.149398},{x:0.07,y:-0.15}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.15414649999999952}},refblocks:{left1:{x:-0.4458008,y:-0.025023700000000426},right1:{x:0.4458008,y:-0.02514810000000045}},bounds:{minX:-0.45,maxX:0.45,minY:-0.15,maxY:0.1,width:0.9,height:0.25,centerX:0,centerY:-0.025},circles:{}},rL=W(D2).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),eh=W(D2).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Q2=Z(eh,"left"),rh=Q2.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");rh.anchor="middle_bottom";rh.y+=0.4;rh.x=0;var iL=Q2,U2=Z(eh,"up"),ih=U2.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");ih.anchor="middle_left";ih.y+=0;ih.x=0.2;var nL=U2,Z2={paths:{path44:{type:"path",points:[{x:-0.195,y:-0.025},{x:-0.45,y:-0.025}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:-0.025},{x:0.195,y:-0.025}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.1},{x:0.07,y:-0.15}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.07,y:-0.15}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.082252,y:0.099398},{x:-0.094386,y:0.097598},{x:-0.106286,y:0.094618},{x:-0.117835,y:0.090485},{x:-0.128925,y:0.08524},{x:-0.139446,y:0.078934},{x:-0.149299,y:0.071626},{x:-0.158388,y:0.063388},{x:-0.166626,y:0.054299},{x:-0.173934,y:0.044446},{x:-0.18024,y:0.033925},{x:-0.185485,y:0.022835},{x:-0.189618,y:0.011286},{x:-0.192598,y:-0.000614},{x:-0.194398,y:-0.012748},{x:-0.195,y:-0.025},{x:-0.194398,y:-0.037252},{x:-0.192598,y:-0.049386},{x:-0.189618,y:-0.061286},{x:-0.185485,y:-0.072835},{x:-0.18024,y:-0.083925},{x:-0.173934,y:-0.094446},{x:-0.166626,y:-0.104299},{x:-0.158388,y:-0.113388},{x:-0.149299,y:-0.121626},{x:-0.139446,y:-0.128934},{x:-0.128925,y:-0.13524},{x:-0.117835,y:-0.140485},{x:-0.106286,y:-0.144618},{x:-0.094386,y:-0.147598},{x:-0.082252,y:-0.149398},{x:-0.07,y:-0.15}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.07,y:0.1},{x:0.082252,y:0.099398},{x:0.094386,y:0.097598},{x:0.106286,y:0.094618},{x:0.117835,y:0.090485},{x:0.128925,y:0.08524},{x:0.139446,y:0.078934},{x:0.149299,y:0.071626},{x:0.158388,y:0.063388},{x:0.166626,y:0.054299},{x:0.173934,y:0.044446},{x:0.18024,y:0.033925},{x:0.185485,y:0.022835},{x:0.189618,y:0.011286},{x:0.192598,y:-0.000614},{x:0.194398,y:-0.012748},{x:0.195,y:-0.025},{x:0.194398,y:-0.037252},{x:0.192598,y:-0.049386},{x:0.189618,y:-0.061286},{x:0.185485,y:-0.072835},{x:0.18024,y:-0.083925},{x:0.173934,y:-0.094446},{x:0.166626,y:-0.104299},{x:0.158388,y:-0.113388},{x:0.149299,y:-0.121626},{x:0.139446,y:-0.128934},{x:0.128925,y:-0.13524},{x:0.117835,y:-0.140485},{x:0.106286,y:-0.144618},{x:0.094386,y:-0.147598},{x:0.082252,y:-0.149398},{x:0.07,y:-0.15}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.15414649999999952}},refblocks:{left1:{x:-0.44,y:-0.02},right1:{x:0.4458008,y:-0.02514810000000045}},bounds:{minX:-0.45,maxX:0.45,minY:-0.15,maxY:0.1,width:0.9,height:0.25,centerX:0,centerY:-0.025},circles:{}},oL=W(Z2).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),nh=W(Z2).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),H2=Z(nh,"left"),oh=H2.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");oh.anchor="middle_bottom";oh.y+=0.4;oh.x=0;var aL=H2,G2=Z(nh,"up"),ah=G2.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");ah.anchor="middle_left";ah.y+=0.05;ah.x=0.2;var sL=G2,q2={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},path1:{type:"path",points:[{x:-0.045,y:0.1},{x:-0.125,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.28075747049999955}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},cL=W(q2).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),sh=W(q2).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),K2=Z(sh,"left"),ch=K2.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");ch.anchor="middle_left";ch.y+=0.5;ch.x=0.2;var lL=K2,J2=Z(sh,"up"),lh=J2.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");lh.anchor="middle_left";lh.y+=0.3;lh.x=0.2;var pL=J2,t6={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},path1:{type:"path",points:[{x:-0.045,y:0.1},{x:-0.125,y:0.1}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.125,y:0.1},{x:0.045,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.28}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},dL=W(t6).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),ph=W(t6).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),e6=Z(ph,"left"),dh=e6.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");dh.anchor="middle_left";dh.y+=0.5;dh.x=0.2;var hL=e6,r6=Z(ph,"up"),hh=r6.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");hh.anchor="middle_left";hh.y+=0.4;hh.x=0.2;var uL=r6,i6={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.125,y:0.1},{x:0.045,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.28}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},yL=W(i6).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),uh=W(i6).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),n6=Z(uh,"left"),yh=n6.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");yh.anchor="middle_left";yh.y+=0.6;yh.x=0.3;var _L=n6,o6=Z(uh,"up"),_h=o6.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");_h.anchor="middle_left";_h.y+=0.4;_h.x=0.2;var mL=o6,a6={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.28075747049999955}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},fL=W(a6).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),mh=W(a6).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),s6=Z(mh,"left"),fh=s6.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");fh.anchor="middle_left";fh.y+=0.5;fh.x=0.3;var xL=s6,c6=Z(mh,"up"),xh=c6.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");xh.anchor="middle_left";xh.y+=0.3;xh.x=0.2;var gL=c6,bL={paths:{path1:{type:"path",points:[{x:-0.37,y:0.03},{x:-0.13,y:0.03}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.03},{x:0.11,y:-0.03}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:-0.06},{x:0.37,y:-0.06}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.17},{x:0.37,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.37},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.37}},refblocks:{left1:{x:-0.37,y:0.03},right1:{x:0.37,y:-0.06},right2:{x:0.37,y:0.17}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.79,height:0.79,centerX:0,centerY:0},circles:{"circle-3":{type:"circle",x:0.08,y:-0.07,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.03,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.08,y:0.17,radius:0.02,color:"primary",fill:!1}}},Qs=W(bL).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right2",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),gh=Z(Qs,"down"),bh=gh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),vh=gh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");bh.anchor="middle_bottom";vh.anchor="middle_top";bh.x=0.44;bh.y+=0.28;vh.y-=0.28;vh.x=0.44;var vL=gh,wh=Z(Qs,"left"),Ah=wh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Fh=wh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Ah.anchor="middle_bottom";Fh.anchor="middle_top";Ah.x=0;Ah.y+=0.625;Fh.y-=0.695;Fh.x=0;var wL=wh,Bh=Z(Qs,"up"),Sh=Bh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),kh=Bh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Sh.anchor="middle_bottom";kh.anchor="middle_top";Sh.x=0.4;Sh.y+=0.28;kh.y-=0.28;kh.x=0.4;var AL=Bh,FL={paths:{path1:{type:"path",points:[{x:-0.37,y:0.03},{x:-0.13,y:0.03}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.03},{x:0.11,y:0.14}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:-0.06},{x:0.37,y:-0.06}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.17},{x:0.37,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.4}},refblocks:{left1:{x:-0.37,y:0.03},right1:{x:0.37,y:-0.06},right3:{x:0.37,y:0.17}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.79,height:0.79,centerX:0,centerY:0},circles:{"circle-3":{type:"circle",x:0.08,y:-0.07,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.03,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.08,y:0.17,radius:0.02,color:"primary",fill:!1}}},Us=W(FL).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right3",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),Yh=Z(Us,"down"),Mh=Yh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ih=Yh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Mh.anchor="middle_bottom";Ih.anchor="middle_top";Mh.x=0.44;Mh.y+=0.28;Ih.y-=0.28;Ih.x=0.44;var BL=Yh,Lh=Z(Us,"left"),Eh=Lh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ph=Lh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Eh.anchor="middle_bottom";Ph.anchor="middle_top";Eh.x=0;Eh.y+=0.625;Ph.y-=0.695;Ph.x=0;var SL=Lh,Th=Z(Us,"up"),Wh=Th.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Oh=Th.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Wh.anchor="middle_bottom";Oh.anchor="middle_top";Wh.x=0.4;Wh.y+=0.28;Oh.y-=0.28;Oh.x=0.4;var kL=Th,Mi={paths:{"lead-positive":{type:"path",points:[{x:-0.4,y:0.19999999999999996},{x:-0.20000000000000007,y:0.19999999999999996}],color:"primary",fill:!1},"lead-negative":{type:"path",points:[{x:-0.4,y:-0.20000000000000018},{x:-0.20000000000000007,y:-0.20000000000000018}],color:"primary",fill:!1},"voice-coil":{type:"path",points:[{x:-0.20000000000000007,y:0.19999999999999996},{x:0,y:0.19999999999999996},{x:0,y:-0.20000000000000018},{x:-0.20000000000000007,y:-0.20000000000000018},{x:-0.20000000000000007,y:0.19999999999999996}],color:"primary",fill:!1},cone:{type:"path",points:[{x:0,y:0.19999999999999996},{x:0.3999999999999999,y:0.3999999999999999},{x:0.3999999999999999,y:-0.40000000000000013},{x:0,y:-0.20000000000000018},{x:0,y:0.19999999999999996}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.6},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.6000000000000001}},refblocks:{left1:{x:-0.4,y:-0.20000000000000018},left2:{x:-0.4,y:0.19999999999999996}},bounds:{minX:-0.4,maxX:0.3999999999999999,minY:-0.6000000000000001,maxY:0.6,width:0.7999999999999999,height:1.2000000000000002,centerX:-0.00000000000000005551115123125783,centerY:-0.00000000000000005551115123125783},circles:{}},l6=W(Mi).rotateRightFacingSymbol("down").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),za=Ke(l6.primitives),YL={...l6,center:{x:(za.minX+za.maxX)/2,y:(za.minY+za.maxY)/2}},p6=W(Mi).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Da=Ke(p6.primitives),ML={...p6,center:{x:(Da.minX+Da.maxX)/2,y:(Da.minY+Da.maxY)/2}},d6=W(Mi).rotateRightFacingSymbol("left").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Qa=Ke(d6.primitives),IL={...d6,center:{x:(Qa.minX+Qa.maxX)/2,y:(Qa.minY+Qa.maxY)/2}},h6=W(Mi).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Ua=Ke(h6.primitives),LL={...h6,center:{x:(Ua.minX+Ua.maxX)/2,y:(Ua.minY+Ua.maxY)/2}},u6=W(Mi).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Za=Ke(u6.primitives),EL={...u6,center:{x:(Za.minX+Za.maxX)/2,y:(Za.minY+Za.maxY)/2}},y6=W(Mi).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Ha=Ke(y6.primitives),PL={...y6,center:{x:(Ha.minX+Ha.maxX)/2,y:(Ha.minY+Ha.maxY)/2}},Zs={paths:{path11:{type:"path",points:[{x:-0.38,y:0},{x:-0.12,y:-0.01}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.07,y:0},{x:0.11,y:0.05}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.12,y:-0.01},{x:0.38,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.31},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.28}},refblocks:{left1:{x:-0.12,y:-0.01},left2:{x:-0.38,y:0},right1:{x:0.12,y:-0.01},right2:{x:0.38,y:0}},bounds:{minX:-0.4,maxX:0.4,minY:-0.25,maxY:0.25,width:0.81,height:0.5,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:0.1,y:0,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0,radius:0.02,color:"primary",fill:!1}}};delete Zs.refblocks.left1;delete Zs.refblocks.right1;Zs.bounds.width+=0.2;var Hs=W(Zs).changeTextAnchor("{VAL}","middle_top").labelPort("left2",["1"]).labelPort("right2",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),jh=Z(Hs,"down"),Rh=jh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ch=jh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Rh.anchor="middle_bottom";Ch.anchor="middle_top";Rh.x=0.3;Rh.y+=0.265;Ch.y-=0.265;Ch.x=0.3;var TL=jh,Xh=Z(Hs,"left"),$h=Xh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Nh=Xh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");$h.anchor="middle_bottom";Nh.anchor="middle_top";$h.x=0;$h.y+=0.57;Nh.y-=0.57;Nh.x=0;var WL=Xh,Vh=Z(Hs,"up"),zh=Vh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Dh=Vh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");zh.anchor="middle_bottom";Dh.anchor="middle_top";zh.x=0.3;zh.y+=0.265;Dh.y-=0.265;Dh.x=0.3;var OL=Vh,Gs={paths:{path11:{type:"path",points:[{x:-0.38,y:0},{x:-0.12,y:-0.01}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.07,y:0.01},{x:0.1,y:0.14}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.12,y:-0.01},{x:0.38,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.12,y:-0.01},left2:{x:-0.38,y:0},right1:{x:0.12,y:-0.01},right2:{x:0.38,y:0}},bounds:{minX:-0.4,maxX:0.4,minY:-0.25,maxY:0.25,width:0.81,height:0.5,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:0.1,y:0,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0,radius:0.02,color:"primary",fill:!1}}};delete Gs.refblocks.left1;delete Gs.refblocks.right1;Gs.bounds.width+=0.2;var qs=W(Gs).changeTextAnchor("{VAL}","middle_top").labelPort("left2",["1"]).labelPort("right2",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Qh=Z(qs,"down"),Uh=Qh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Zh=Qh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Uh.anchor="middle_bottom";Zh.anchor="middle_top";Uh.x=0.3;Uh.y+=0.265;Zh.y-=0.265;Zh.x=0.3;var jL=Qh,Hh=Z(qs,"left"),Gh=Hh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),qh=Hh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Gh.anchor="middle_bottom";qh.anchor="middle_top";Gh.x=0;Gh.y+=0.57;qh.y-=0.57;qh.x=0;var RL=Hh,Kh=Z(qs,"up"),Jh=Kh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),tu=Kh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Jh.anchor="middle_bottom";tu.anchor="middle_top";Jh.x=0.3;Jh.y+=0.265;tu.y-=0.265;tu.x=0.3;var CL=Kh,Ks={paths:{path44:{type:"path",points:[{x:-0.16845120000000047,y:0.02621170000000017},{x:-0.4458008,y:0.02709619999999968}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.4458008,y:0.026971799999999657},{x:0.1677968999999997,y:0.027926399999999685}],color:"primary",fill:!1},"path8704-1":{type:"path",points:[{x:-0.0040837000000002455,y:-0.13467459999999964},{x:-0.0040837000000002455,y:-0.13467459999999964},{x:-0.017668143940740948,y:-0.1311205263185182},{x:-0.03043520885925943,y:-0.12727072121481456},{x:-0.04240966440000013,y:-0.1231399985999998},{x:-0.05361628020740751,y:-0.11874317238518502},{x:-0.064079825925926,y:-0.11409505648148131},{x:-0.07382507120000005,y:-0.10921046479999987},{x:-0.0828767856740741,y:-0.10410421125185171},{x:-0.0912597389925926,y:-0.09879110974814802},{x:-0.09899870079999995,y:-0.0932859741999998},{x:-0.10611844074074069,y:-0.08760361851851838},{x:-0.11264372845925916,y:-0.0817588566148146},{x:-0.11859933359999993,y:-0.07576650239999982},{x:-0.12401002580740728,y:-0.06964136978518495},{x:-0.12890057472592584,y:-0.06339827268148127},{x:-0.13329574999999985,y:-0.05705202499999972},{x:-0.13722032127407394,y:-0.05061744065185156},{x:-0.14069905819259243,y:-0.04410933354814783},{x:-0.14375673039999987,y:-0.03754251759999966},{x:-0.14641810754074058,y:-0.030931806718518143},{x:-0.1487079592592591,y:-0.0242920148148144},{x:-0.15065105519999983,y:-0.017637955799999563},{x:-0.15227216500740723,y:-0.01098444358518472},{x:-0.15359605832592574,y:-0.004346292081480994},{x:-0.1546475047999998,y:0.00226168480000051},{x:-0.15545127407407386,y:0.008824673148148676},{x:-0.1560321357925924,y:0.015327859051852397},{x:-0.1564148595999998,y:0.02175642860000056},{x:-0.1566242151407405,y:0.028095567881482052},{x:-0.15668497205925902,y:0.03433046298518576},{x:-0.15662189999999976,y:0.04044630000000058},{x:-0.15662189999999976,y:0.0404463000000006},{x:-0.15662189999999976,y:0.0404463000000006},{x:-0.15622857394444417,y:0.04717166472222282},{x:-0.1553217675555553,y:0.05388046444444503},{x:-0.15392183849999977,y:0.060558907500000585},{x:-0.1520491444444442,y:0.0671932022222228},{x:-0.1497240430555553,y:0.07376955694444502},{x:-0.14696689199999974,y:0.08027418000000058},{x:-0.14379804894444415,y:0.0866932797222228},{x:-0.1402378715555553,y:0.09301306444444506},{x:-0.13630671749999965,y:0.09921974250000057},{x:-0.13202494444444415,y:0.10529952222222282},{x:-0.12741291005555522,y:0.11123861194444501},{x:-0.1224909719999997,y:0.1170232200000006},{x:-0.11727948794444407,y:0.12263955472222278},{x:-0.11179881555555524,y:0.12807382444444504},{x:-0.10606931249999965,y:0.13331223750000057},{x:-0.1001113364444441,y:0.13834100222222284},{x:-0.09394524505555521,y:0.14314632694444504},{x:-0.08759139599999967,y:0.14771442000000062},{x:-0.08107014694444413,y:0.15203148972222283},{x:-0.07440185555555523,y:0.15608374444444503},{x:-0.0676068794999997,y:0.15985739250000058},{x:-0.06070557644444415,y:0.16333864222222283},{x:-0.05371830405555529,y:0.16651370194444504},{x:-0.04666541999999976,y:0.1693687800000006},{x:-0.03956728194444424,y:0.1718900847222228},{x:-0.03244424755555539,y:0.17406382444444501},{x:-0.025316674499999876,y:0.17587620750000055},{x:-0.01820492044444437,y:0.17731344222222278},{x:-0.01112934305555553,y:0.178361736944445},{x:-0.004110300000000034,y:0.17900730000000054},{x:-0.004110300000000011,y:0.17900730000000054}],color:"primary",fill:!1},"path8704-1-9":{type:"path",points:[{x:0.004158700000000071,y:-0.1355885000000001},{x:0.004158700000000071,y:-0.1355885000000001},{x:0.017743143940740766,y:-0.1320344263185187},{x:0.03051020885925925,y:-0.12818462121481505},{x:0.042484664399999955,y:-0.12405389860000024},{x:0.053691280207407335,y:-0.11965707238518546},{x:0.0641548259259258,y:-0.11500895648148178},{x:0.07390007119999986,y:-0.1101243648000003},{x:0.0829517856740739,y:-0.10501811125185218},{x:0.0913347389925924,y:-0.09970500974814848},{x:0.09907370079999973,y:-0.09419987420000027},{x:0.10619344074074046,y:-0.08851751851851883},{x:0.11271872845925893,y:-0.08267275661481507},{x:0.11867433359999968,y:-0.07668040240000029},{x:0.12408502580740703,y:-0.0705552697851854},{x:0.12897557472592555,y:-0.06431217268148172},{x:0.13337074999999957,y:-0.05796592500000018},{x:0.13729532127407365,y:-0.05153134065185202},{x:0.14077405819259214,y:-0.045023233548148286},{x:0.14383173039999952,y:-0.038456417600000126},{x:0.14649310754074024,y:-0.03184570671851861},{x:0.14878295925925875,y:-0.02520591481481487},{x:0.1507260551999995,y:-0.01855185580000003},{x:0.15234716500740686,y:-0.011898343585185192},{x:0.15367105832592537,y:-0.005260192081481464},{x:0.15472250479999944,y:0.001347784800000043},{x:0.1555262740740735,y:0.007910773148148207},{x:0.156107135792592,y:0.01441395905185193},{x:0.1564898595999994,y:0.020842528600000094},{x:0.15669921514074014,y:0.02718166788148159},{x:0.15675997205925862,y:0.03341656298518529},{x:0.15669689999999936,y:0.03953240000000011},{x:0.15669689999999936,y:0.039532400000000134},{x:0.15669689999999936,y:0.039532400000000134},{x:0.1563035739444438,y:0.04625776472222235},{x:0.15539676755555493,y:0.05296656444444457},{x:0.15399683849999934,y:0.05964500750000013},{x:0.1521241444444438,y:0.06627930222222234},{x:0.14979904305555491,y:0.07285565694444456},{x:0.14704189199999937,y:0.07936028000000013},{x:0.1438730489444438,y:0.08577937972222234},{x:0.1403128715555549,y:0.09209916444444458},{x:0.13638171749999925,y:0.0983058425000001},{x:0.13209994444444376,y:0.10438562222222235},{x:0.12748791005555482,y:0.11032471194444453},{x:0.12256597199999929,y:0.11610932000000013},{x:0.1173544879444437,y:0.1217256547222223},{x:0.11187381555555485,y:0.12715992444444457},{x:0.10614431249999925,y:0.1323983375000001},{x:0.10018633644444369,y:0.13742710222222235},{x:0.09402024505555481,y:0.14223242694444457},{x:0.08766639599999927,y:0.14680052000000016},{x:0.08114514694444372,y:0.15111758972222236},{x:0.07447685555555483,y:0.15516984444444457},{x:0.06768187949999929,y:0.15894349250000012},{x:0.06078057644444377,y:0.16242474222222236},{x:0.053793304055554894,y:0.16559980194444457},{x:0.046740419999999366,y:0.16845488000000014},{x:0.039642281944443844,y:0.17097618472222234},{x:0.03251924755555499,y:0.17314992444444455},{x:0.02539167449999948,y:0.17496230750000008},{x:0.018279920444443973,y:0.17639954222222232},{x:0.011204343055555134,y:0.17744783694444452},{x:0.004185299999999637,y:0.17809340000000007},{x:0.004185299999999614,y:0.17809340000000007}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.08039130000000005,y:0.0179576999999993},{x:-0.08039130000000005,y:0.09650599999999931}],color:"primary",fill:!0},"path4-5":{type:"path",points:[{x:0.01494479999999987,y:-0.055216500000000224},{x:0.01494479999999987,y:0.09691909999999937}],color:"primary",fill:!0},"path4-5-8":{type:"path",points:[{x:0.06871169999999927,y:-0.056870000000000864},{x:0.06871169999999927,y:0.018784499999999538}],color:"primary",fill:!0},"path4-1":{type:"path",points:[{x:-0.08179359999999969,y:0.09650570000000003},{x:0.015771699999999722,y:0.09650570000000003}],color:"primary",fill:!0},"path4-1-6":{type:"path",points:[{x:0.0117995999999998,y:-0.05594970000000088},{x:0.06843709999999925,y:-0.05594970000000088}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.17162450000000073,y:0.11125030000000025},{x:-0.2688274000000015,y:0.11125030000000025},{x:-0.2688274000000015,y:0.11469129999999961},{x:-0.17162450000000073,y:0.11469129999999961}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.2184661999999995,y:0.16159429999999997},{x:-0.2184661999999995,y:0.06439139999999943},{x:-0.22190719999999908,y:0.06439139999999943},{x:-0.22190719999999908,y:0.16159429999999997}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.0024445000000006267,y:0.23933980000000044},bottom1:{type:"text",text:"{VAL}",x:0.00341719999999901,y:-0.23933980000000066}},refblocks:{left1:{x:-0.4458008,y:0.02709619999999968},right1:{x:0.4458008,y:0.026971799999999657}},bounds:{minX:-0.473959241,maxX:0.473959241,minY:-0.23933980000000066,maxY:0.23933980000000044,width:0.947918482,height:0.4786796000000011,centerX:0,centerY:-0.00000000000000011102230246251565},circles:{}},XL=W(Ks).rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_left",{x:0.02,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:0.5,y:-0.2}).build(),$L=W(Ks).rotateRightFacingSymbol("left").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.45}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.55}).build(),NL=W(Ks).rotateRightFacingSymbol("right").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),VL=W(Ks).rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{VAL}","middle_left",{x:0.02,y:-0.2}).changeTextAnchor("{REF}","middle_left",{x:0.5,y:0.2}).build(),_6={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-5":{type:"path",points:[{x:0.19,y:-0.09},{x:0.15,y:-0.09}],color:"primary",fill:!1},"path43-5-2":{type:"path",points:[{x:0.19,y:-0.14},{x:0.19,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:HQ,texts:GQ,bounds:qQ,refblocks:KQ,circles:JQ}=_6,m6=W(_6).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),zL=Z(m6),DL={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"RPM",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:QL,texts:UL,bounds:Ga,refblocks:Fb,circles:ZL}=DL,eu=Tt({primitives:[...Object.values(QL),...Object.values(ZL),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...UL.left1,y:0.01,anchor:"center",fontSize:0.2}],ports:[{...Fb.left1,labels:["1"]},{...Fb.right1,labels:["2"]}],size:{width:Ga.width,height:Ga.height},center:{x:Ga.centerX,y:Ga.centerY}}),{5:HL,...GL}=eu.primitives;function qL(t){return typeof t=="object"}var Bb=Z({...eu,primitives:Object.values(GL).filter(qL)}),KL={...Bb,primitives:[...Bb.primitives,HL]},Js=Tt({primitives:[{type:"path",points:[{x:-0.2,y:0},{x:0,y:0}],color:"primary",fill:!1},{type:"path",points:Array.from({length:32},(t,e)=>{let r=Math.PI/2-e*Math.PI/31,i=0.1;return{x:0.1-i*Math.cos(r),y:i*Math.sin(r)}}),color:"primary",fill:!1},{type:"text",text:"{REF}",x:0.125,y:0,anchor:"middle_left"}],ports:[{x:-0.2,y:0,labels:["1"]}],center:{x:0,y:0}}),f6=Z(Js,"down"),Sb=f6.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");Sb&&(Sb.anchor="middle_top");var JL=f6,tE=Z(Js,"left"),x6=Z(Js,"up"),kb=x6.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");kb&&(kb.anchor="middle_bottom");var eE=x6,rE={paths:{path40:{type:"path",points:[{x:0.44,y:0.04},{x:0.19,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:0.19,y:0.18},{x:0.44,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:0.19,y:-0.09},{x:0.19,y:0.18}],color:"primary",fill:!1},path44:{type:"path",points:[{x:0.19,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.43,y:0.22},{x:-0.11,y:0.04}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{right1:{x:-0.43,y:0.22}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},ru=W(rE).labelPort("right1",["1"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),iu=Z(ru,"up"),nu=iu.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),ou=iu.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");nu.anchor="middle_bottom";ou.anchor="middle_top";nu.x=0.4;nu.y+=0.2;ou.y-=0.3;ou.x=0.4;var g6=iu,au=gi(g6),su=au.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),cu=au.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");su.anchor="middle_bottom";cu.anchor="middle_top";su.x=0.35;su.y+=0.4;cu.y-=0.4;cu.x=0.35;var iE=au,lu=Z(ru,"left"),pu=lu.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),du=lu.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");pu.anchor="middle_bottom";du.anchor="middle_top";pu.x=0;pu.y+=0.5;du.y-=0.6;du.x=0;var nE=lu,hu={paths:{"primary-winding":{type:"path",points:[{x:-0.6666666666666999,y:0.6000000000000001},{x:-0.1419999999999999,y:0.6000000000000001},{x:-0.1419999999999999,y:0.6000000000000001},{x:-0.13426666666666656,y:0.5976565925925927},{x:-0.12706666666666658,y:0.5950394074074075},{x:-0.12039999999999991,y:0.5921680000000001},{x:-0.11426666666666657,y:0.5890619259259261},{x:-0.10866666666666656,y:0.5857407407407409},{x:-0.10359999999999989,y:0.5822240000000002},{x:-0.09906666666666655,y:0.5785312592592594},{x:-0.09506666666666656,y:0.5746820740740743},{x:-0.09159999999999985,y:0.5706959999999999},{x:-0.08866666666666653,y:0.5665925925925928},{x:-0.08626666666666649,y:0.5623914074074075},{x:-0.08439999999999986,y:0.5581120000000002},{x:-0.08306666666666651,y:0.5537739259259259},{x:-0.08226666666666653,y:0.5493967407407409},{x:-0.08199999999999985,y:0.5449999999999999},{x:-0.08226666666666652,y:0.5406032592592593},{x:-0.08306666666666651,y:0.5362260740740741},{x:-0.08439999999999986,y:0.5318880000000001},{x:-0.08626666666666652,y:0.5276085925925926},{x:-0.08866666666666652,y:0.5234074074074074},{x:-0.09159999999999985,y:0.519304},{x:-0.09506666666666652,y:0.515317925925926},{x:-0.09906666666666653,y:0.5114687407407408},{x:-0.10359999999999986,y:0.507776},{x:-0.10866666666666652,y:0.5042592592592593},{x:-0.11426666666666653,y:0.5009380740740741},{x:-0.12039999999999987,y:0.49783200000000005},{x:-0.12706666666666652,y:0.4949605925925927},{x:-0.1342666666666665,y:0.49234340740740745},{x:-0.14199999999999988,y:0.4900000000000001},{x:-0.1419999999999999,y:0.4900000000000001},{x:-0.1419999999999999,y:0.4900000000000001},{x:-0.13426666666666656,y:0.48765659259259264},{x:-0.12706666666666658,y:0.48503940740740753},{x:-0.12039999999999991,y:0.4821680000000002},{x:-0.11426666666666657,y:0.4790619259259261},{x:-0.10866666666666656,y:0.47574074074074085},{x:-0.10359999999999989,y:0.4722240000000002},{x:-0.09906666666666655,y:0.46853125925925937},{x:-0.09506666666666656,y:0.46468207407407425},{x:-0.09159999999999985,y:0.46069599999999994},{x:-0.08866666666666653,y:0.45659259259259266},{x:-0.08626666666666649,y:0.45239140740740735},{x:-0.08439999999999986,y:0.4481120000000001},{x:-0.08306666666666651,y:0.4437739259259259},{x:-0.08226666666666653,y:0.43939674074074087},{x:-0.08199999999999985,y:0.43499999999999994},{x:-0.08226666666666652,y:0.4306032592592593},{x:-0.08306666666666651,y:0.42622607407407415},{x:-0.08439999999999986,y:0.42188800000000015},{x:-0.08626666666666652,y:0.41760859259259264},{x:-0.08866666666666652,y:0.4134074074074075},{x:-0.09159999999999985,y:0.40930400000000006},{x:-0.09506666666666652,y:0.40531792592592597},{x:-0.09906666666666653,y:0.4014687407407408},{x:-0.10359999999999986,y:0.3977760000000001},{x:-0.10866666666666652,y:0.3942592592592593},{x:-0.11426666666666653,y:0.3909380740740741},{x:-0.12039999999999987,y:0.38783200000000007},{x:-0.12706666666666652,y:0.3849605925925927},{x:-0.1342666666666665,y:0.38234340740740747},{x:-0.14199999999999988,y:0.3800000000000001},{x:-0.1419999999999999,y:0.3800000000000001},{x:-0.1419999999999999,y:0.3800000000000001},{x:-0.13426666666666656,y:0.37765659259259265},{x:-0.12706666666666658,y:0.3750394074074076},{x:-0.12039999999999991,y:0.3721680000000001},{x:-0.11426666666666657,y:0.36906192592592607},{x:-0.10866666666666656,y:0.36574074074074087},{x:-0.10359999999999989,y:0.36222400000000016},{x:-0.09906666666666655,y:0.3585312592592594},{x:-0.09506666666666656,y:0.35468207407407426},{x:-0.09159999999999985,y:0.350696},{x:-0.08866666666666653,y:0.34659259259259273},{x:-0.08626666666666649,y:0.3423914074074074},{x:-0.08439999999999986,y:0.33811200000000013},{x:-0.08306666666666651,y:0.3337739259259259},{x:-0.08226666666666653,y:0.3293967407407409},{x:-0.08199999999999985,y:0.325},{x:-0.08226666666666652,y:0.3206032592592593},{x:-0.08306666666666651,y:0.31622607407407416},{x:-0.08439999999999986,y:0.3118880000000001},{x:-0.08626666666666652,y:0.30760859259259266},{x:-0.08866666666666652,y:0.30340740740740746},{x:-0.09159999999999985,y:0.299304},{x:-0.09506666666666652,y:0.29531792592592593},{x:-0.09906666666666653,y:0.2914687407407408},{x:-0.10359999999999986,y:0.28777600000000003},{x:-0.10866666666666652,y:0.28425925925925927},{x:-0.11426666666666653,y:0.2809380740740741},{x:-0.12039999999999987,y:0.277832},{x:-0.12706666666666652,y:0.27496059259259265},{x:-0.1342666666666665,y:0.2723434074074074},{x:-0.14199999999999988,y:0.27},{x:-0.1419999999999999,y:0.27},{x:-0.1419999999999999,y:0.27},{x:-0.13426666666666656,y:0.2676565925925926},{x:-0.12706666666666658,y:0.26503940740740745},{x:-0.12039999999999991,y:0.2621680000000001},{x:-0.11426666666666657,y:0.25906192592592603},{x:-0.10866666666666656,y:0.25574074074074093},{x:-0.10359999999999989,y:0.25222400000000017},{x:-0.09906666666666655,y:0.2485312592592594},{x:-0.09506666666666656,y:0.24468207407407425},{x:-0.09159999999999985,y:0.24069600000000008},{x:-0.08866666666666653,y:0.23659259259259274},{x:-0.08626666666666649,y:0.2323914074074075},{x:-0.08439999999999986,y:0.2281120000000002},{x:-0.08306666666666651,y:0.22377392592592601},{x:-0.08226666666666653,y:0.2193967407407409},{x:-0.08199999999999985,y:0.2150000000000001},{x:-0.08226666666666652,y:0.21060325925925938},{x:-0.08306666666666651,y:0.20622607407407423},{x:-0.08439999999999986,y:0.20188800000000012},{x:-0.08626666666666652,y:0.1976085925925927},{x:-0.08866666666666652,y:0.19340740740740753},{x:-0.09159999999999985,y:0.18930400000000008},{x:-0.09506666666666652,y:0.185317925925926},{x:-0.09906666666666653,y:0.18146874074074082},{x:-0.10359999999999986,y:0.17777600000000005},{x:-0.10866666666666652,y:0.17425925925925928},{x:-0.11426666666666653,y:0.17093807407407408},{x:-0.12039999999999987,y:0.16783199999999998},{x:-0.12706666666666652,y:0.16496059259259258},{x:-0.1342666666666665,y:0.16234340740740733},{x:-0.14199999999999988,y:0.15999999999999992},{x:-0.1419999999999999,y:0.15999999999999992},{x:-0.1419999999999999,y:0.15999999999999992},{x:-0.13426666666666656,y:0.1577116296296296},{x:-0.12706666666666658,y:0.15525451851851865},{x:-0.12039999999999991,y:0.15264066666666695},{x:-0.11426666666666657,y:0.1498820740740747},{x:-0.10866666666666656,y:0.1469907407407417},{x:-0.10359999999999989,y:0.14397866666666803},{x:-0.09906666666666655,y:0.14085785185185365},{x:-0.09506666666666656,y:0.1376402962962987},{x:-0.09159999999999985,y:0.13433800000000298},{x:-0.08866666666666653,y:0.1309629629629667},{x:-0.08626666666666649,y:0.12752718518518963},{x:-0.08439999999999986,y:0.12404266666667203},{x:-0.08306666666666651,y:0.12052140740741364},{x:-0.08226666666666653,y:0.11697540740741469},{x:-0.08199999999999985,y:0.11341666666667499},{x:-0.08226666666666652,y:0.10985718518519466},{x:-0.08306666666666651,y:0.10630896296297365},{x:-0.08439999999999986,y:0.10278400000001198},{x:-0.08626666666666652,y:0.09929429629630965},{x:-0.08866666666666652,y:0.09585185185186663},{x:-0.09159999999999985,y:0.09246866666668296},{x:-0.09506666666666652,y:0.08915674074075862},{x:-0.09906666666666653,y:0.08592807407409363},{x:-0.10359999999999986,y:0.08279466666668796},{x:-0.10866666666666652,y:0.07976851851854162},{x:-0.11426666666666653,y:0.07686162962965462},{x:-0.12039999999999987,y:0.07408600000002696},{x:-0.12706666666666652,y:0.07145362962965862},{x:-0.1342666666666665,y:0.06897651851854962},{x:-0.14199999999999988,y:0.06666666666669996},{x:-0.1419999999999999,y:0.06666666666669996},{x:-0.6666666666666999,y:0.06666666666669996}],color:"primary",fill:!1},"auxiliary-winding":{type:"path",points:[{x:-0.6666666666666999,y:-0.06666666666669996},{x:-0.1419999999999999,y:-0.06666666666669996},{x:-0.1419999999999999,y:-0.06666666666669996},{x:-0.13426666666666656,y:-0.0689765185185496},{x:-0.12706666666666658,y:-0.07145362962965864},{x:-0.12039999999999991,y:-0.07408600000002695},{x:-0.11426666666666657,y:-0.07686162962965463},{x:-0.10866666666666656,y:-0.07976851851854162},{x:-0.10359999999999989,y:-0.08279466666668797},{x:-0.09906666666666655,y:-0.08592807407409363},{x:-0.09506666666666656,y:-0.08915674074075866},{x:-0.09159999999999985,y:-0.09246866666668294},{x:-0.08866666666666653,y:-0.09585185185186663},{x:-0.08626666666666649,y:-0.09929429629630962},{x:-0.08439999999999986,y:-0.10278400000001198},{x:-0.08306666666666651,y:-0.10630896296297361},{x:-0.08226666666666653,y:-0.10985718518519468},{x:-0.08199999999999985,y:-0.11341666666667496},{x:-0.08226666666666652,y:-0.11697540740741467},{x:-0.08306666666666651,y:-0.12052140740741367},{x:-0.08439999999999986,y:-0.124042666666672},{x:-0.08626666666666652,y:-0.12752718518518966},{x:-0.08866666666666652,y:-0.13096296296296667},{x:-0.09159999999999985,y:-0.134338000000003},{x:-0.09506666666666652,y:-0.13764029629629865},{x:-0.09906666666666653,y:-0.14085785185185368},{x:-0.10359999999999986,y:-0.14397866666666798},{x:-0.10866666666666652,y:-0.14699074074074164},{x:-0.11426666666666653,y:-0.1498820740740746},{x:-0.12039999999999987,y:-0.15264066666666695},{x:-0.12706666666666652,y:-0.15525451851851862},{x:-0.1342666666666665,y:-0.1577116296296296},{x:-0.14199999999999988,y:-0.15999999999999992},{x:-0.1419999999999999,y:-0.15999999999999992},{x:-0.1419999999999999,y:-0.15999999999999992},{x:-0.13426666666666656,y:-0.16234340740740733},{x:-0.12706666666666658,y:-0.16496059259259252},{x:-0.12039999999999991,y:-0.16783199999999995},{x:-0.11426666666666657,y:-0.17093807407407402},{x:-0.10866666666666656,y:-0.17425925925925922},{x:-0.10359999999999989,y:-0.17777599999999996},{x:-0.09906666666666655,y:-0.18146874074074068},{x:-0.09506666666666656,y:-0.1853179259259259},{x:-0.09159999999999985,y:-0.18930399999999992},{x:-0.08866666666666653,y:-0.19340740740740736},{x:-0.08626666666666649,y:-0.19760859259259247},{x:-0.08439999999999986,y:-0.20188799999999998},{x:-0.08306666666666651,y:-0.20622607407407395},{x:-0.08226666666666653,y:-0.2106032592592592},{x:-0.08199999999999985,y:-0.21499999999999986},{x:-0.08226666666666652,y:-0.21939674074074067},{x:-0.08306666666666651,y:-0.22377392592592585},{x:-0.08439999999999986,y:-0.22811199999999995},{x:-0.08626666666666652,y:-0.23239140740740732},{x:-0.08866666666666652,y:-0.23659259259259252},{x:-0.09159999999999985,y:-0.2406959999999999},{x:-0.09506666666666652,y:-0.244682074074074},{x:-0.09906666666666653,y:-0.24853125925925917},{x:-0.10359999999999986,y:-0.2522239999999999},{x:-0.10866666666666652,y:-0.2557407407407406},{x:-0.11426666666666653,y:-0.2590619259259258},{x:-0.12039999999999987,y:-0.26216799999999985},{x:-0.12706666666666652,y:-0.2650394074074072},{x:-0.1342666666666665,y:-0.2676565925925924},{x:-0.14199999999999988,y:-0.26999999999999974},{x:-0.1419999999999999,y:-0.2699999999999998},{x:-0.1419999999999999,y:-0.2699999999999998},{x:-0.13426666666666656,y:-0.2723434074074072},{x:-0.12706666666666658,y:-0.2749605925925925},{x:-0.12039999999999991,y:-0.27783199999999986},{x:-0.11426666666666657,y:-0.280938074074074},{x:-0.10866666666666656,y:-0.28425925925925916},{x:-0.10359999999999989,y:-0.2877759999999999},{x:-0.09906666666666655,y:-0.29146874074074064},{x:-0.09506666666666656,y:-0.295317925925926},{x:-0.09159999999999985,y:-0.29930399999999985},{x:-0.08866666666666653,y:-0.30340740740740735},{x:-0.08626666666666649,y:-0.30760859259259243},{x:-0.08439999999999986,y:-0.311888},{x:-0.08306666666666651,y:-0.31622607407407394},{x:-0.08226666666666653,y:-0.32060325925925925},{x:-0.08199999999999985,y:-0.3249999999999999},{x:-0.08226666666666652,y:-0.3293967407407407},{x:-0.08306666666666651,y:-0.33377392592592586},{x:-0.08439999999999986,y:-0.338112},{x:-0.08626666666666652,y:-0.3423914074074074},{x:-0.08866666666666652,y:-0.34659259259259256},{x:-0.09159999999999985,y:-0.35069599999999995},{x:-0.09506666666666652,y:-0.35468207407407404},{x:-0.09906666666666653,y:-0.35853125925925927},{x:-0.10359999999999986,y:-0.362224},{x:-0.10866666666666652,y:-0.3657407407407407},{x:-0.11426666666666653,y:-0.3690619259259259},{x:-0.12039999999999987,y:-0.37216800000000005},{x:-0.12706666666666652,y:-0.37503940740740743},{x:-0.1342666666666665,y:-0.37765659259259265},{x:-0.14199999999999988,y:-0.3800000000000001},{x:-0.1419999999999999,y:-0.3800000000000001},{x:-0.1419999999999999,y:-0.3800000000000001},{x:-0.13426666666666656,y:-0.38234340740740747},{x:-0.12706666666666658,y:-0.38496059259259274},{x:-0.12039999999999991,y:-0.38783200000000007},{x:-0.11426666666666657,y:-0.39093807407407416},{x:-0.10866666666666656,y:-0.3942592592592593},{x:-0.10359999999999989,y:-0.3977760000000001},{x:-0.09906666666666655,y:-0.40146874074074074},{x:-0.09506666666666656,y:-0.40531792592592597},{x:-0.09159999999999985,y:-0.40930399999999995},{x:-0.08866666666666653,y:-0.41340740740740745},{x:-0.08626666666666649,y:-0.4176085925925925},{x:-0.08439999999999986,y:-0.4218880000000001},{x:-0.08306666666666651,y:-0.4262260740740739},{x:-0.08226666666666653,y:-0.43060325925925924},{x:-0.08199999999999985,y:-0.4349999999999999},{x:-0.08226666666666652,y:-0.4393967407407407},{x:-0.08306666666666651,y:-0.4437739259259258},{x:-0.08439999999999986,y:-0.44811199999999995},{x:-0.08626666666666652,y:-0.4523914074074073},{x:-0.08866666666666652,y:-0.45659259259259244},{x:-0.09159999999999985,y:-0.4606959999999999},{x:-0.09506666666666652,y:-0.46468207407407397},{x:-0.09906666666666653,y:-0.4685312592592591},{x:-0.10359999999999986,y:-0.47222399999999987},{x:-0.10866666666666652,y:-0.4757407407407406},{x:-0.11426666666666653,y:-0.4790619259259258},{x:-0.12039999999999987,y:-0.4821679999999998},{x:-0.12706666666666652,y:-0.4850394074074072},{x:-0.1342666666666665,y:-0.4876565925925923},{x:-0.14199999999999988,y:-0.48999999999999977},{x:-0.1419999999999999,y:-0.48999999999999977},{x:-0.1419999999999999,y:-0.48999999999999977},{x:-0.13426666666666656,y:-0.4923434074074071},{x:-0.12706666666666658,y:-0.49496059259259245},{x:-0.12039999999999991,y:-0.4978319999999999},{x:-0.11426666666666657,y:-0.500938074074074},{x:-0.10866666666666656,y:-0.5042592592592593},{x:-0.10359999999999989,y:-0.507776},{x:-0.09906666666666655,y:-0.5114687407407407},{x:-0.09506666666666656,y:-0.5153179259259261},{x:-0.09159999999999985,y:-0.5193039999999998},{x:-0.08866666666666653,y:-0.5234074074074074},{x:-0.08626666666666649,y:-0.5276085925925925},{x:-0.08439999999999986,y:-0.531888},{x:-0.08306666666666651,y:-0.536226074074074},{x:-0.08226666666666653,y:-0.5406032592592593},{x:-0.08199999999999985,y:-0.5449999999999999},{x:-0.08226666666666652,y:-0.5493967407407407},{x:-0.08306666666666651,y:-0.5537739259259259},{x:-0.08439999999999986,y:-0.558112},{x:-0.08626666666666652,y:-0.5623914074074075},{x:-0.08866666666666652,y:-0.5665925925925925},{x:-0.09159999999999985,y:-0.5706959999999999},{x:-0.09506666666666652,y:-0.574682074074074},{x:-0.09906666666666653,y:-0.5785312592592593},{x:-0.10359999999999986,y:-0.582224},{x:-0.10866666666666652,y:-0.5857407407407407},{x:-0.11426666666666653,y:-0.5890619259259259},{x:-0.12039999999999987,y:-0.5921679999999998},{x:-0.12706666666666652,y:-0.5950394074074072},{x:-0.1342666666666665,y:-0.5976565925925924},{x:-0.14199999999999988,y:-0.5999999999999999},{x:-0.1419999999999999,y:-0.5999999999999999},{x:-0.6666666666666999,y:-0.5999999999999999}],color:"primary",fill:!1},"secondary-one-winding":{type:"path",points:[{x:0.6666666666666998,y:0.4666666666667001},{x:0.133,y:0.4666666666667001},{x:0.133,y:0.4666666666667001},{x:0.12449333333333333,y:0.46512612345682036},{x:0.11657333333333333,y:0.4634445432099042},{x:0.10923999999999999,y:0.4616320000000254},{x:0.10249333333333334,y:0.45969856790125796},{x:0.09633333333333331,y:0.45765432098767606},{x:0.09075999999999998,y:0.4555093333333538},{x:0.0857733333333333,y:0.45327367901236504},{x:0.08137333333333331,y:0.450957432098784},{x:0.07755999999999993,y:0.44857066666668444},{x:0.0743333333333333,y:0.4461234567901409},{x:0.07169333333333326,y:0.4436258765432269},{x:0.06963999999999997,y:0.44108800000001697},{x:0.06817333333333327,y:0.4385199012345847},{x:0.06729333333333329,y:0.43593165432100456},{x:0.06699999999999995,y:0.43333333333335006},{x:0.06729333333333329,y:0.4307350123456958},{x:0.06817333333333328,y:0.4281467654321155},{x:0.06963999999999995,y:0.42557866666668337},{x:0.07169333333333328,y:0.4230407901234733},{x:0.07433333333333328,y:0.42054320987655935},{x:0.07755999999999996,y:0.4180960000000157},{x:0.08137333333333328,y:0.4157092345679163},{x:0.08577333333333328,y:0.4133929876543353},{x:0.09075999999999997,y:0.4111573333333466},{x:0.0963333333333333,y:0.4090123456790242},{x:0.10249333333333328,y:0.40696809876544227},{x:0.10923999999999996,y:0.405034666666675},{x:0.1165733333333333,y:0.4032221234567961},{x:0.12449333333333329,y:0.40154054320987975},{x:0.13299999999999998,y:0.40000000000000013},{x:0.133,y:0.40000000000000013},{x:0.133,y:0.40000000000000013},{x:0.12449333333333333,y:0.39845945679012046},{x:0.11657333333333333,y:0.3967778765432042},{x:0.10923999999999999,y:0.39496533333332534},{x:0.10249333333333334,y:0.39303190123455795},{x:0.09633333333333331,y:0.3909876543209761},{x:0.09075999999999998,y:0.3888426666666537},{x:0.0857733333333333,y:0.386607012345665},{x:0.08137333333333331,y:0.38429076543208396},{x:0.07755999999999993,y:0.3819039999999844},{x:0.0743333333333333,y:0.37945679012344086},{x:0.07169333333333326,y:0.37695920987652687},{x:0.06963999999999997,y:0.37442133333331695},{x:0.06817333333333327,y:0.37185323456788455},{x:0.06729333333333329,y:0.36926498765430443},{x:0.06699999999999995,y:0.36666666666665004},{x:0.06729333333333329,y:0.3640683456789958},{x:0.06817333333333328,y:0.3614800987654155},{x:0.06963999999999995,y:0.35891199999998336},{x:0.07169333333333328,y:0.3563741234567732},{x:0.07433333333333328,y:0.35387654320985934},{x:0.07755999999999996,y:0.3514293333333157},{x:0.08137333333333328,y:0.3490425679012163},{x:0.08577333333333328,y:0.34672632098763523},{x:0.09075999999999997,y:0.3444906666666465},{x:0.0963333333333333,y:0.34234567901232416},{x:0.10249333333333328,y:0.3403014320987423},{x:0.10923999999999996,y:0.3383679999999749},{x:0.1165733333333333,y:0.33655545679009613},{x:0.12449333333333329,y:0.3348738765431798},{x:0.13299999999999998,y:0.3333333333333002},{x:0.133,y:0.3333333333333002},{x:0.6666666666666998,y:0.3333333333333002}],color:"primary",fill:!1},"secondary-two-winding":{type:"path",points:[{x:0.6666666666666998,y:-0.19999999999999996},{x:0.133,y:-0.19999999999999996},{x:0.133,y:-0.19999999999999996},{x:0.12449333333333333,y:-0.2015405432098796},{x:0.11657333333333333,y:-0.2032221234567959},{x:0.10923999999999999,y:-0.20503466666667475},{x:0.10249333333333334,y:-0.20696809876544214},{x:0.09633333333333331,y:-0.20901234567902405},{x:0.09075999999999998,y:-0.21115733333334635},{x:0.0857733333333333,y:-0.21339298765433506},{x:0.08137333333333331,y:-0.2157092345679162},{x:0.07755999999999993,y:-0.21809600000001547},{x:0.0743333333333333,y:-0.2205432098765592},{x:0.07169333333333326,y:-0.22304079012347303},{x:0.06963999999999997,y:-0.22557866666668316},{x:0.06817333333333327,y:-0.22814676543211523},{x:0.06729333333333329,y:-0.23073501234569563},{x:0.06699999999999995,y:-0.23333333333334982},{x:0.06729333333333329,y:-0.2359316543210042},{x:0.06817333333333328,y:-0.2385199012345845},{x:0.06963999999999995,y:-0.24108800000001673},{x:0.07169333333333328,y:-0.24362587654322676},{x:0.07433333333333328,y:-0.2461234567901406},{x:0.07755999999999996,y:-0.24857066666668426},{x:0.08137333333333328,y:-0.25095743209878363},{x:0.08577333333333328,y:-0.25327367901236475},{x:0.09075999999999997,y:-0.25550933333335346},{x:0.0963333333333333,y:-0.2576543209876757},{x:0.10249333333333328,y:-0.25969856790125756},{x:0.10923999999999996,y:-0.26163200000002496},{x:0.1165733333333333,y:-0.2634445432099038},{x:0.12449333333333329,y:-0.26512612345682},{x:0.13299999999999998,y:-0.2666666666666997},{x:0.133,y:-0.2666666666666997},{x:0.133,y:-0.2666666666666997},{x:0.12449333333333333,y:-0.26820720987657004},{x:0.11657333333333333,y:-0.2698887901234782},{x:0.10923999999999999,y:-0.27170133333335017},{x:0.10249333333333334,y:-0.2736347654321117},{x:0.09633333333333331,y:-0.2756790123456887},{x:0.09075999999999998,y:-0.27782400000000707},{x:0.0857733333333333,y:-0.2800596543209926},{x:0.08137333333333331,y:-0.2823759012345713},{x:0.07755999999999993,y:-0.28476266666666866},{x:0.0743333333333333,y:-0.28720987654321106},{x:0.07169333333333326,y:-0.28970745679012394},{x:0.06963999999999997,y:-0.2922453333333336},{x:0.06817333333333327,y:-0.29481343209876537},{x:0.06729333333333329,y:-0.29740167901234577},{x:0.06699999999999995,y:-0.3},{x:0.06729333333333329,y:-0.3025983209876544},{x:0.06817333333333328,y:-0.30518656790123455},{x:0.06963999999999995,y:-0.3077546666666665},{x:0.07169333333333328,y:-0.310292543209876},{x:0.07433333333333328,y:-0.31279012345678897},{x:0.07755999999999996,y:-0.31523733333333126},{x:0.08137333333333328,y:-0.31762409876542885},{x:0.08577333333333328,y:-0.3199403456790074},{x:0.09075999999999997,y:-0.32217599999999297},{x:0.0963333333333333,y:-0.3243209876543113},{x:0.10249333333333328,y:-0.32636523456788824},{x:0.10923999999999996,y:-0.32829866666664975},{x:0.1165733333333333,y:-0.33011120987652165},{x:0.12449333333333329,y:-0.3317927901234298},{x:0.13299999999999998,y:-0.3333333333333002},{x:0.133,y:-0.3333333333333002},{x:0.6666666666666998,y:-0.3333333333333002}],color:"primary",fill:!1},"core-left":{type:"path",points:[{x:-0.03599999999999981,y:0.66},{x:-0.03599999999999981,y:-0.6599999999999999}],color:"primary",fill:!1},"core-right":{type:"path",points:[{x:0.028999999999999915,y:0.66},{x:0.028999999999999915,y:-0.6599999999999999}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.7200000000000001},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.72}},refblocks:{left1:{x:-0.6666666666666999,y:-0.5999999999999999},left2:{x:-0.6666666666666999,y:-0.06666666666669996},left3:{x:-0.6666666666666999,y:0.06666666666669996},left4:{x:-0.6666666666666999,y:0.6000000000000001},right1:{x:0.6666666666666998,y:-0.3333333333333002},right2:{x:0.6666666666666998,y:-0.19999999999999996},right3:{x:0.6666666666666998,y:0.3333333333333002},right4:{x:0.6666666666666998,y:0.4666666666667001}},bounds:{minX:-0.6666666666666999,maxX:0.6666666666666998,minY:-0.72,maxY:0.7200000000000001,width:1.3333333333333997,height:1.44,centerX:-0.00000000000000005551115123125783,centerY:0.00000000000000005551115123125783},circles:{"primary-polarity-dot":{type:"circle",x:-0.19599999999999995,y:0.535,radius:0.0172,color:"primary",fill:!0},"auxiliary-polarity-dot":{type:"circle",x:-0.19599999999999995,y:-0.1316666666666999,radius:0.0172,color:"primary",fill:!0},"secondary-one-polarity-dot":{type:"circle",x:0.18999999999999995,y:0.42700000000000005,radius:0.0172,color:"primary",fill:!0},"secondary-two-polarity-dot":{type:"circle",x:0.18999999999999995,y:-0.23999999999999977,radius:0.0172,color:"primary",fill:!0}}},oE=W(hu).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("down").build(),b6=W(hu).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").build(),aE=Me(b6),sE=W(hu).labelPort("left1",["1","primary_end"]).labelPort("left2",["2","primary_start"]).labelPort("left3",["3","auxiliary_end"]).labelPort("left4",["4","auxiliary_start"]).labelPort("right1",["8","secondary1_end"]).labelPort("right2",["7","secondary1_start"]).labelPort("right3",["6","secondary2_end"]).labelPort("right4",["5","secondary2_start"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").build(),v6={paths:{path11:{type:"path",points:[{x:-0.54,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.1,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:-0.15},{x:-0.09,y:0.26}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.09,y:-0.15},{x:0.09,y:0.26}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.15},{x:0.09,y:-0.05},{x:-0.08,y:0.06}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:0.08,y:0.26},{x:0.08,y:0.05},{x:-0.09,y:0.15},{x:0.07,y:0.26}],color:"primary",fill:!0},"path12-2":{type:"path",points:[{x:0.09,y:-0.06},{x:0.27,y:-0.17}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:0.27,y:-0.18},{x:0.27,y:-0.31}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{bottom1:{x:0.27,y:-0.31},left1:{x:-0.54,y:0.04},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.42,maxY:0.42,width:1.14,height:0.83,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.05,radius:0.29,color:"primary",fill:!1}}},{paths:tU,texts:eU,bounds:rU,refblocks:iU,circles:nU}=v6,w6=W(v6).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("bottom1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),A6=Z(w6),F6=A6.primitives.filter((t)=>t.type==="text"),cE=F6.find((t)=>t.text==="{REF}"),lE=F6.find((t)=>t.text==="{VAL}");cE.y=0;lE.y=0;var pE=A6,dE={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14,y:0.18},{x:0.08,y:0.18}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.14,y:-0.09},{x:0.08,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:hE,texts:Yb,bounds:qa,refblocks:Mb,circles:uE}=dE,B6=Tt({primitives:[...Object.values(hE),...Object.values(uE),{...Yb.top1,anchor:"middle_bottom"},{...Yb.bottom1,anchor:"middle_top"}],ports:[{...Mb.left1,labels:["1"]},{...Mb.right1,labels:["2"]}],size:{width:qa.width,height:qa.height},center:{x:qa.centerX,y:qa.centerY}}),uu=Z(B6),yE=uu.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),_E=uu.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");yE.anchor="middle_left";_E.anchor="middle_right";var mE=uu,fE={paths:{path11:{type:"path",points:[{x:-0.34,y:0.22},{x:-0.02,y:0.01}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.23,y:0.13},{x:0.23,y:0.4}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:0.23,y:-0.08},{x:0.23,y:-0.35}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.01,y:-0.18},{x:-0.01,y:0.23}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.23,y:0.12},{x:-0.01,y:0.12}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.11,y:0.13},{x:-0.17,y:0.04},{x:-0.06,y:0.03},{x:-0.11,y:0.13}],color:"primary",fill:!0},"path11-0-3-8":{type:"path",points:[{x:0.23,y:-0.08},{x:-0.01,y:-0.08}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.2,y:0.39},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{top1:{x:0.23,y:0.4},bottom1:{x:0.23,y:-0.35},left1:{x:-0.34,y:0.22}},bounds:{minX:-0.37,maxX:0.37,minY:-0.42,maxY:0.42,width:0.74,height:0.85,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.08,y:0.01,radius:0.29,color:"primary",fill:!1}}},{paths:xE,texts:Ib,bounds:Ka,refblocks:Sp,circles:gE}=fE,S6=Tt({primitives:[...Object.values(xE),...Object.values(gE),{...Ib.top1,anchor:"middle_left"},{...Ib.bottom1,anchor:"middle_right"}],ports:[{...Sp.top1,labels:["1"]},{...Sp.bottom1,labels:["2"]},{...Sp.left1,labels:["3"]}],size:{width:Ka.width,height:Ka.height},center:{x:Ka.centerX,y:Ka.centerY}}),k6=Z(S6),Y6=k6.primitives.filter((t)=>t.type==="text"),bE=Y6.find((t)=>t.text==="{REF}");bE.y=0.1;var M6=Y6.find((t)=>t.text==="{VAL}");M6.y=0.1;M6.x=-0.4;var vE=k6,wE={paths:{capsule_outer:{type:"path",points:[{x:-0.44,y:0.34},{x:-0.45,y:0.39},{x:-0.46,y:0.42},{x:-0.49,y:0.44},{x:-0.52,y:0.46},{x:-0.56,y:0.46},{x:-0.6,y:0.46},{x:-0.63,y:0.44},{x:-0.65,y:0.42},{x:-0.67,y:0.39},{x:-0.68,y:0.34},{x:-0.68,y:-0.34},{x:-0.67,y:-0.39},{x:-0.65,y:-0.42},{x:-0.63,y:-0.44},{x:-0.6,y:-0.45},{x:-0.56,y:-0.46},{x:-0.52,y:-0.45},{x:-0.49,y:-0.44},{x:-0.46,y:-0.42},{x:-0.45,y:-0.39},{x:-0.44,y:-0.34},{x:-0.44,y:0.34}],color:"primary",fill:!1},capsule_inner:{type:"path",points:[{x:-0.51,y:0.28},{x:-0.52,y:0.32},{x:-0.53,y:0.34},{x:-0.56,y:0.35},{x:-0.57,y:0.35},{x:-0.58,y:0.34},{x:-0.6,y:0.32},{x:-0.61,y:0.28},{x:-0.61,y:-0.28},{x:-0.6,y:-0.32},{x:-0.58,y:-0.34},{x:-0.57,y:-0.35},{x:-0.56,y:-0.35},{x:-0.53,y:-0.34},{x:-0.52,y:-0.32},{x:-0.51,y:-0.28},{x:-0.51,y:0.28}],color:"primary",fill:!0},usb_vertical:{type:"path",points:[{x:0.1,y:-0.4},{x:0.1,y:0.4}],color:"primary",fill:!1},usb_left_branch:{type:"path",points:[{x:0.1,y:-0.1},{x:-0.03,y:0.05},{x:-0.03,y:0.15}],color:"primary",fill:!1},usb_right_branch:{type:"path",points:[{x:0.1,y:0},{x:0.25,y:0.15},{x:0.25,y:0.25}],color:"primary",fill:!1},usb_arrow:{type:"path",points:[{x:0.05,y:0.4},{x:0.1,y:0.5},{x:0.15,y:0.4},{x:0.05,y:0.4}],color:"primary",fill:!0},usb_square:{type:"path",points:[{x:0.2,y:0.25},{x:0.3,y:0.25},{x:0.3,y:0.35},{x:0.2,y:0.35},{x:0.2,y:0.25}],color:"primary",fill:!0}},circles:{usb_base:{type:"circle",x:0.1,y:-0.4,radius:0.07,color:"primary",fill:!0},usb_tip_circle:{type:"circle",x:-0.03,y:0.15,radius:0.04,color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.25,y:0.7}},refblocks:{},bounds:{minX:-0.75,maxX:0.35,minY:-0.6,maxY:0.75,width:1.1,height:1.35,centerX:-0.2,centerY:0.08}},AE=W(wE).changeTextAnchor("{REF}","middle_bottom").build(),FE={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Var",x:-0.19,y:0.07}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:BE,texts:kp,bounds:Ja,refblocks:Lb,circles:SE}=FE,I6=Tt({primitives:[...Object.values(BE),...Object.values(SE),{...kp.top1,x:0,y:-0.3594553499999995,anchor:"middle_top"},{...kp.bottom1,x:0,y:0.35,anchor:"middle_bottom"},{...kp.left1,x:-0.02,y:0.01,fontSize:0.2,anchor:"center"}],ports:[{...Lb.left1,labels:["1"]},{...Lb.right1,labels:["2"]}],size:{width:Ja.width,height:Ja.height},center:{x:Ja.centerX,y:Ja.centerY}}),kE=Z(I6),YE={paths:{path40:{type:"path",points:[{x:0.08,y:0.04},{x:-0.18,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.18,y:0.18},{x:0.08,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.18,y:-0.09},{x:-0.18,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.09,y:0.17},{x:0.1,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.2,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.21,y:0.04}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:0.19,y:0.17},{x:0.19,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:ME,texts:Eb,bounds:ts,refblocks:Pb,circles:IE}=YE,L6=Tt({primitives:[...Object.values(ME),...Object.values(IE),{...Eb.top1,anchor:"middle_bottom"},{...Eb.bottom1,anchor:"middle_top"}],ports:[{...Pb.left1,labels:["1"]},{...Pb.right1,labels:["2"]}],size:{width:ts.width,height:ts.height},center:{x:ts.centerX,y:ts.centerY}}),yu=Z(L6),LE=yu.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),EE=yu.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");LE.anchor="middle_left";EE.anchor="middle_right";var PE=yu,TE={paths:{path5:{type:"path",points:[{x:-0.54,y:0},{x:-0.26,y:0}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.27,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path7:{type:"path",points:[{x:0.27,y:-0.23},{x:-0.26,y:0.24}],color:"primary",fill:!1},path8:{type:"path",points:[{x:0.38,y:-0.23},{x:0.27,y:-0.23}],color:"primary",fill:!1},path9:{type:"path",points:[{x:0,y:0.14},{x:0.27,y:0.14},{x:0.27,y:-0.13},{x:-0.26,y:-0.13},{x:-0.26,y:0.14},{x:0,y:0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.06,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0.01,y:-0.25}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.25,maxY:0.25,width:1.13,height:0.5,centerX:0,centerY:0},circles:{}},{paths:WE,texts:Tb,bounds:es,refblocks:Wb}=TE,E6=Tt({primitives:[...Object.values(WE),{...Tb.top1,x:0,anchor:"middle_bottom"},{...Tb.bottom1,x:0,anchor:"middle_top"}],ports:[{...Wb.left1,labels:["1","-"]},{...Wb.right1,labels:["2","+"]}],size:{width:es.width,height:es.height},center:{x:es.centerX,y:es.centerY}}),P6=Z(E6),T6=P6.primitives.filter((t)=>t.type==="text"),_u=T6.find((t)=>t.text==="{REF}"),mu=T6.find((t)=>t.text==="{VAL}");_u.x=0.3;_u.y=0.15;_u.anchor="middle_left";mu.x=0.3;mu.y=-0.15;mu.anchor="middle_left";var OE=P6,jE={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Var",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:RE,texts:CE,bounds:rs,refblocks:Ob,circles:XE}=jE,fu=Tt({primitives:[...Object.values(RE),...Object.values(XE),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...CE.left1,anchor:"center",y:0.02,fontSize:0.2}],ports:[{...Ob.left1,labels:["1"]},{...Ob.right1,labels:["2"]}],size:{width:rs.width,height:rs.height},center:{x:rs.centerX,y:rs.centerY}}),{5:$E,...NE}=fu.primitives;function VE(t){return typeof t=="object"}var jb=Z({...fu,primitives:Object.values(NE).filter(VE)}),zE={...jb,primitives:[...jb.primitives,$E]},tc={paths:{"path28-2":{type:"path",points:[{x:0.19,y:0},{x:0,y:0.09}],color:"primary",fill:!1},"path28-2-6":{type:"path",points:[{x:0.19,y:0},{x:0,y:-0.09}],color:"primary",fill:!1},"path29-3":{type:"path",points:[{x:0.19,y:0},{x:-0.23,y:0}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{REF}",x:0.25,y:0}},refblocks:{left1:{x:-0.23,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.09,maxY:0.09,width:0.5,height:0.19,centerX:0,centerY:0},circles:{}};function ec(t,e){let{width:r,height:i}=t.size,n=1,o=1;e.width!==void 0&&e.height!==void 0?(n=e.width/r,o=e.height/i):e.width!==void 0?n=o=e.width/r:e.height!==void 0&&(n=o=e.height/i);let a=t.primitives.map((s)=>{switch(s.type){case"path":return{...s,points:s.points.map((l)=>({x:l.x*n,y:l.y*o}))};case"text":return{...s,x:s.x*n,y:s.y*o,fontSize:s.fontSize?s.fontSize*n:void 0};case"circle":return{...s,x:s.x*n,y:s.y*o,radius:s.radius*n};case"box":return{...s,x:s.x*n,y:s.y*o,width:s.width*n,height:s.height*o};default:return s}});return{...t,primitives:a,center:{x:t.center.x*n,y:t.center.y*o},ports:t.ports.map((s)=>({...s,x:s.x*n,y:s.y*o})),size:{width:r*n,height:i*o}}}var DE=W(tc).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),QE=ec(DE,{width:0.24,height:0.23}),UE=W(tc).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),ZE=ec(UE,{width:0.23,height:0.24}),HE=W(tc).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),GE=ec(HE,{width:0.23,height:0.24}),qE=W(tc).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),KE=ec(qE,{width:0.24,height:0.23}),xu={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.02,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.8,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:oU,texts:aU,bounds:sU,circles:cU,refblocks:lU}=xu,JE=W(xu).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:tP,texts:pU,bounds:Rb,circles:eP,refblocks:Cb}=xu,rP=W({primitives:[...Object.values(tP),...Object.values(eP),{type:"text",text:"{REF}",x:-0.2,y:0.35},{type:"text",text:"{VAL}",x:0.2,y:0.35}],ports:[{...Cb.left1,labels:["left1"]},{...Cb.right1,labels:["right1"]}],center:{x:Rb.centerX,y:Rb.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),iP=rP,nP={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Wh",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:oP,texts:aP,bounds:is,refblocks:Xb,circles:sP}=nP,gu=Tt({primitives:[...Object.values(oP),...Object.values(sP),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...aP.left1,anchor:"center",y:0.01,fontSize:0.2}],ports:[{...Xb.left1,labels:["1"]},{...Xb.right1,labels:["2"]}],size:{width:is.width,height:is.height},center:{x:is.centerX,y:is.centerY}}),{5:cP,...lP}=gu.primitives;function pP(t){return typeof t=="object"}var $b=Z({...gu,primitives:Object.values(lP).filter(pP)}),dP={...$b,primitives:[...$b.primitives,cP]},hP={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"W",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:uP,texts:yP,bounds:ns,refblocks:Nb,circles:_P}=hP,bu=Tt({primitives:[...Object.values(uP),...Object.values(_P),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...yP.left1,anchor:"center",y:0.01,fontSize:0.3}],ports:[{...Nb.left1,labels:["1"]},{...Nb.right1,labels:["2"]}],size:{width:ns.width,height:ns.height},center:{x:ns.centerX,y:ns.centerY}}),{5:mP,...fP}=bu.primitives;function xP(t){return typeof t=="object"}var Vb=Z({...bu,primitives:Object.values(fP).filter(xP)}),gP={...Vb,primitives:[...Vb.primitives,mP]},W6={paths:{path40:{type:"path",points:[{x:0.14458890000000002,y:0.04403629999999992},{x:-0.1199943999999995,y:-0.08825540000000043}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.1199943999999995,y:0.17632800000000026},{x:0.14458890000000002,y:0.04403629999999992}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.1199943999999995,y:-0.0882553999999991},{x:-0.1199943999999995,y:0.17632800000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14458890000000002,y:0.17632800000000026},{x:0.14458890000000002,y:-0.0882553999999991}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12219909999999956,y:0.04403629999999992},{x:-0.5168693999999996,y:0.04403629999999992}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.5233797000000002,y:0.043951100000000354},{x:0.1496715999999998,y:0.043951100000000354}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14458890000000002,y:0.17632800000000026},{x:0.21069330000000042,y:0.17632800000000026}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.14458890000000002,y:-0.0882553999999991},{x:0.07848449999999962,y:-0.0882553999999991}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.0050250999999996715,y:0.27384530000000007},bottom1:{type:"text",text:"{VAL}",x:-0.00011179999999977319,y:-0.27384529999999985}},refblocks:{left1:{x:-0.5191471000000001,y:0.044920700000000924},right1:{x:0.5191470999999999,y:0.04389609999999999}},bounds:{minX:-0.5473055410000001,maxX:0.5473055409999998,minY:-0.27384529999999985,maxY:0.27384530000000007,width:1.094611082,height:0.5476905999999999,centerX:-0.00000000000000011102230246251565,centerY:0.00000000000000011102230246251565},circles:{}},bP=W(W6).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),rc={paths:{"anode-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.11999999999999988,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.11999999999999988,y:0.11999999999999988},{x:0.1200000000000001,y:0},{x:-0.11999999999999988,y:-0.1200000000000001},{x:-0.11999999999999988,y:0.11999999999999988}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.16999999999999993,y:0.11999999999999988},{x:0.1200000000000001,y:0.11999999999999988},{x:0.1200000000000001,y:-0.1200000000000001},{x:0.07000000000000006,y:-0.1200000000000001}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.1200000000000001,y:0},{x:0.25,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},vP=ft(rc,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),wP=ft(rc,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),AP=ft(rc,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),FP=ft(rc,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),{paths:BP,bounds:os,refblocks:zb,circles:SP}=W6,kP=W({primitives:[...Object.values(BP),...Object.values(SP),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...zb.left1,labels:["1"]},{...zb.right1,labels:["2"]}],size:{width:os.width,height:os.height},center:{x:os.centerX,y:os.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),ic={paths:{"anode-lead":{type:"path",points:[{x:-0.17499999999999982,y:0},{x:-0.09999999999999987,y:0}],color:"primary",fill:!1},body:{type:"path",points:[{x:-0.09999999999999987,y:0.09999999999999987},{x:0.10000000000000009,y:0},{x:-0.09999999999999987,y:-0.10000000000000009},{x:-0.09999999999999987,y:0.09999999999999987}],color:"primary",fill:!1},"cathode-bar":{type:"path",points:[{x:0.15000000000000013,y:0.09999999999999987},{x:0.10000000000000009,y:0.09999999999999987},{x:0.10000000000000009,y:-0.10000000000000009},{x:0.050000000000000044,y:-0.10000000000000009}],color:"primary",fill:!1},"cathode-lead":{type:"path",points:[{x:0.10000000000000009,y:0},{x:0.17500000000000004,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.17499999999999982,y:0},right1:{x:0.17500000000000004,y:0}},bounds:{minX:-0.17499999999999982,maxX:0.17500000000000004,minY:-0.25,maxY:0.25,width:0.34999999999999987,height:0.5,centerX:0.00000000000000011102230246251565,centerY:0},circles:{}},YP=ft(ic,{kind:"diode",orientation:"down",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),MP=ft(ic,{kind:"diode",orientation:"left",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),IP=ft(ic,{kind:"diode",orientation:"right",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),LP=ft(ic,{kind:"diode",orientation:"up",pin1Labels:["1","pos","anode"],pin2Labels:["2","neg","cathode"]}),Pr={ac_voltmeter_down:r7,ac_voltmeter_horz:o7,ac_voltmeter_left:c7,ac_voltmeter_right:d7,ac_voltmeter_up:y7,ac_voltmeter_vert:f7,and_gate_down:x7,and_gate_left:g7,and_gate_right:Db,and_gate_up:b7,avalanche_diode_down:A7,avalanche_diode_horz:F7,avalanche_diode_left:k7,avalanche_diode_right:Y7,avalanche_diode_sm_down:I7,avalanche_diode_sm_left:L7,avalanche_diode_sm_right:E7,avalanche_diode_sm_up:P7,avalanche_diode_up:O7,avalanche_diode_vert:C7,avalanche_diode_xs_down:X7,avalanche_diode_xs_left:$7,avalanche_diode_xs_right:N7,avalanche_diode_xs_up:V7,backward_diode_down:Q7,backward_diode_left:Qb,backward_diode_right:q7,backward_diode_up:K7,battery_down:rw,battery_horz:Ub,battery_left:cw,battery_right:hw,battery_up:mw,battery_vert:fw,boxresistor_down:vw,boxresistor_left:Bw,boxresistor_right:Mw,boxresistor_sm_down:Iw,boxresistor_sm_left:Lw,boxresistor_sm_right:Ew,boxresistor_sm_up:Pw,boxresistor_small_down:Ow,boxresistor_small_left:Cw,boxresistor_small_right:Nw,boxresistor_small_up:Dw,boxresistor_up:Hw,boxresistor_xs_down:Gw,boxresistor_xs_left:qw,boxresistor_xs_right:Kw,boxresistor_xs_up:Jw,bridged_ground_down:rA,bridged_ground_left:oA,bridged_ground_right:Zb,bridged_ground_up:cA,capacitor_down:hA,capacitor_left:yA,capacitor_polarized_down:_A,capacitor_polarized_left:mA,capacitor_polarized_right:fA,capacitor_polarized_up:xA,capacitor_right:bA,capacitor_sm_down:vA,capacitor_sm_left:wA,capacitor_sm_right:AA,capacitor_sm_up:FA,capacitor_up:YA,capacitor_xs_down:MA,capacitor_xs_left:IA,capacitor_xs_right:LA,capacitor_xs_up:EA,constant_current_diode_down:WA,constant_current_diode_horz:OA,constant_current_diode_left:CA,constant_current_diode_right:XA,constant_current_diode_up:VA,constant_current_diode_vert:QA,crystal_4pin_down:HA,crystal_4pin_left:GA,crystal_4pin_right:qA,crystal_4pin_up:tF,crystal_down:iF,crystal_left:nF,crystal_right:oF,crystal_up:cF,current_source_down:pF,current_source_left:hF,current_source_right:yF,current_source_up:mF,darlington_pair_transistor_down:fF,darlington_pair_transistor_horz:xF,darlington_pair_transistor_left:gF,darlington_pair_transistor_right:bF,darlington_pair_transistor_up:vF,darlington_pair_transistor_vert:wF,dc_ammeter_down:yg,dc_ammeter_horz:Bn,dc_ammeter_left:BF,dc_ammeter_right:SF,dc_ammeter_up:kF,dc_ammeter_vert:yg,dc_voltmeter_down:IF,dc_voltmeter_horz:PF,dc_voltmeter_left:OF,dc_voltmeter_right:CF,dc_voltmeter_up:NF,dc_voltmeter_vert:DF,diac_down:QF,diac_horz:UF,diac_left:ZF,diac_right:HF,diac_up:GF,diac_vert:qF,digital_ground_down:tB,digital_ground_left:iB,digital_ground_right:aB,digital_ground_up:lB,diode_down:dB,diode_left:hB,diode_right:As,diode_sm_down:uB,diode_sm_left:yB,diode_sm_right:_B,diode_sm_up:mB,diode_up:fB,diode_xs_down:xB,diode_xs_left:gB,diode_xs_right:bB,diode_xs_up:vB,dpdt_normally_closed_switch_down:AB,dpdt_normally_closed_switch_left:FB,dpdt_normally_closed_switch_right:Ss,dpdt_normally_closed_switch_up:BB,dpdt_switch_down:kB,dpdt_switch_left:YB,dpdt_switch_right:ks,dpdt_switch_up:MB,dpst_normally_closed_switch_down:LB,dpst_normally_closed_switch_left:EB,dpst_normally_closed_switch_right:Ys,dpst_normally_closed_switch_up:PB,dpst_switch_down:WB,dpst_switch_left:OB,dpst_switch_right:Ms,dpst_switch_up:jB,dual_series_schottky_diode_down:CB,dual_series_schottky_diode_left:XB,dual_series_schottky_diode_right:Hb,dual_series_schottky_diode_up:$B,ferrite_bead_down:zB,ferrite_bead_left:DB,ferrite_bead_right:Kb,ferrite_bead_up:qb,filled_diode_down:ZB,filled_diode_horz:qB,filled_diode_left:tS,filled_diode_right:iS,filled_diode_up:aS,filled_diode_vert:lS,frequency_meter_horz:A0,frequency_meter_vert:fS,fuse_horz:Jb,fuse_vert:vS,ground_down:wS,ground_horz:AS,ground_left:FS,ground_right:BS,ground_up:SS,ground_vert:kS,gunn_diode_horz:YS,gunn_diode_vert:MS,icled_down:LS,icled_left:ES,icled_right:Is,icled_up:PS,igbt_transistor_horz:t2,igbt_transistor_vert:WS,illuminated_push_button_normally_open_horz:r2,illuminated_push_button_normally_open_vert:jS,inductor_down:RS,inductor_left:CS,inductor_right:XS,inductor_up:$S,laser_diode_down:NS,laser_diode_left:VS,laser_diode_right:Es,laser_diode_up:zS,led_down:ZS,led_left:HS,led_right:$0,led_sm_down:GS,led_sm_left:qS,led_sm_right:KS,led_sm_up:JS,led_up:a2,led_xs_down:tk,led_xs_left:ek,led_xs_right:rk,led_xs_up:ik,light_dependent_resistor_horz:s2,light_dependent_resistor_vert:sk,mosfet_depletion_normally_on_horz:p2,mosfet_depletion_normally_on_vert:pk,mushroom_head_normally_open_momentary_horz:h2,mushroom_head_normally_open_momentary_vert:yk,n_channel_d_mosfet_transistor_gate_bottom_drain_left:gk,n_channel_d_mosfet_transistor_gate_bottom_drain_right:bk,n_channel_d_mosfet_transistor_gate_left_drain_bottom:vk,n_channel_d_mosfet_transistor_gate_left_drain_top:wk,n_channel_d_mosfet_transistor_gate_right_drain_bottom:Ak,n_channel_d_mosfet_transistor_gate_right_drain_top:Fk,n_channel_d_mosfet_transistor_gate_top_drain_left:Bk,n_channel_d_mosfet_transistor_gate_top_drain_right:Sk,n_channel_d_mosfet_transistor_horz:je,n_channel_d_mosfet_transistor_vert:Je,n_channel_e_mosfet_transistor_gate_bottom_drain_left:Ik,n_channel_e_mosfet_transistor_gate_bottom_drain_right:Lk,n_channel_e_mosfet_transistor_gate_left_drain_bottom:Ek,n_channel_e_mosfet_transistor_gate_left_drain_top:Pk,n_channel_e_mosfet_transistor_gate_right_drain_bottom:Tk,n_channel_e_mosfet_transistor_gate_right_drain_top:Wk,n_channel_e_mosfet_transistor_gate_top_drain_left:Ok,n_channel_e_mosfet_transistor_gate_top_drain_right:jk,n_channel_e_mosfet_transistor_horz:Re,n_channel_e_mosfet_transistor_vert:tr,njfet_transistor_horz:x2,njfet_transistor_vert:$k,not_connected_down:Dk,not_connected_left:Qk,not_connected_right:Ws,not_connected_up:Uk,npn_bipolar_transistor_down:Gk,npn_bipolar_transistor_horz:Jk,npn_bipolar_transistor_left:rY,npn_bipolar_transistor_right:oY,npn_bipolar_transistor_up:cY,npn_bipolar_transistor_vert:dY,opamp_no_power_down:uY,opamp_no_power_left:yY,opamp_no_power_right:Os,opamp_no_power_up:_Y,opamp_with_power_down:fY,opamp_with_power_left:xY,opamp_with_power_right:js,opamp_with_power_up:gY,p_channel_d_mosfet_transistor_gate_bottom_drain_left:AY,p_channel_d_mosfet_transistor_gate_bottom_drain_right:FY,p_channel_d_mosfet_transistor_gate_left_drain_bottom:BY,p_channel_d_mosfet_transistor_gate_left_drain_top:SY,p_channel_d_mosfet_transistor_gate_right_drain_bottom:kY,p_channel_d_mosfet_transistor_gate_right_drain_top:YY,p_channel_d_mosfet_transistor_gate_top_drain_left:MY,p_channel_d_mosfet_transistor_gate_top_drain_right:IY,p_channel_d_mosfet_transistor_horz:Ce,p_channel_d_mosfet_transistor_vert:er,p_channel_e_mosfet_transistor_gate_bottom_drain_left:TY,p_channel_e_mosfet_transistor_gate_bottom_drain_right:WY,p_channel_e_mosfet_transistor_gate_left_drain_bottom:OY,p_channel_e_mosfet_transistor_gate_left_drain_top:jY,p_channel_e_mosfet_transistor_gate_right_drain_bottom:RY,p_channel_e_mosfet_transistor_gate_right_drain_top:CY,p_channel_e_mosfet_transistor_gate_top_drain_left:XY,p_channel_e_mosfet_transistor_gate_top_drain_right:$Y,p_channel_e_mosfet_transistor_horz:Xe,p_channel_e_mosfet_transistor_vert:rr,photodiode_horz:B2,photodiode_vert:zY,phototransistor_optocoupler_down:DY,phototransistor_optocoupler_left:QY,phototransistor_optocoupler_right:Y2,phototransistor_optocoupler_up:UY,pjfet_transistor_horz:M2,pjfet_transistor_vert:qY,pnp_bipolar_transistor_down:tM,pnp_bipolar_transistor_horz:eM,pnp_bipolar_transistor_left:nM,pnp_bipolar_transistor_right:sM,pnp_bipolar_transistor_up:pM,pnp_bipolar_transistor_vert:uM,potentiometer_horz:E2,potentiometer_vert:fM,potentiometer2_down:bM,potentiometer2_left:vM,potentiometer2_right:Rs,potentiometer2_up:wM,potentiometer3_down:BM,potentiometer3_left:YM,potentiometer3_right:MM,potentiometer3_up:EM,power_factor_meter_horz:P2,power_factor_meter_vert:OM,push_button_normally_closed_momentary_horz:W2,push_button_normally_closed_momentary_vert:XM,push_button_normally_open_momentary_down:zM,push_button_normally_open_momentary_horz:ZM,push_button_normally_open_momentary_left:HM,push_button_normally_open_momentary_right:kn,push_button_normally_open_momentary_up:GM,push_button_normally_open_momentary_vert:qM,rail_down:eI,rail_left:oI,rail_right:lI,rail_up:hI,rectifier_diode_horz:j2,rectifier_diode_vert:xI,resistor_down:vI,resistor_left:FI,resistor_right:kI,resistor_sm_down:YI,resistor_sm_left:MI,resistor_sm_right:II,resistor_sm_up:LI,resistor_up:TI,resistor_xs_down:WI,resistor_xs_left:OI,resistor_xs_right:jI,resistor_xs_up:RI,resonator_down:$I,resonator_horz:C2,resonator_left:zI,resonator_right:zs,resonator_up:DI,resonator_vert:QI,schmitt_trigger_inverter_down:UI,schmitt_trigger_inverter_left:ZI,schmitt_trigger_inverter_right:X2,schmitt_trigger_inverter_up:HI,schottky_diode_down:qI,schottky_diode_left:KI,schottky_diode_right:Ds,schottky_diode_up:JI,silicon_controlled_rectifier_horz:N2,silicon_controlled_rectifier_vert:eL,solderjumper2_bridged12_down:rL,solderjumper2_bridged12_left:iL,solderjumper2_bridged12_right:eh,solderjumper2_bridged12_up:nL,solderjumper2_down:oL,solderjumper2_left:aL,solderjumper2_right:nh,solderjumper2_up:sL,solderjumper3_bridged12_down:cL,solderjumper3_bridged12_left:lL,solderjumper3_bridged12_right:sh,solderjumper3_bridged12_up:pL,solderjumper3_bridged123_down:dL,solderjumper3_bridged123_left:hL,solderjumper3_bridged123_right:ph,solderjumper3_bridged123_up:uL,solderjumper3_bridged23_down:yL,solderjumper3_bridged23_left:_L,solderjumper3_bridged23_right:uh,solderjumper3_bridged23_up:mL,solderjumper3_down:fL,solderjumper3_left:xL,solderjumper3_right:mh,solderjumper3_up:gL,spdt_normally_closed_switch_down:vL,spdt_normally_closed_switch_left:wL,spdt_normally_closed_switch_right:Qs,spdt_normally_closed_switch_up:AL,spdt_switch_down:BL,spdt_switch_left:SL,spdt_switch_right:Us,spdt_switch_up:kL,speaker_down:YL,speaker_horz:ML,speaker_left:IL,speaker_right:LL,speaker_up:EL,speaker_vert:PL,spst_normally_closed_switch_down:TL,spst_normally_closed_switch_left:WL,spst_normally_closed_switch_right:Hs,spst_normally_closed_switch_up:OL,spst_switch_down:jL,spst_switch_left:RL,spst_switch_right:qs,spst_switch_up:CL,square_wave_down:XL,square_wave_left:$L,square_wave_right:NL,square_wave_up:VL,step_recovery_diode_horz:m6,step_recovery_diode_vert:zL,tachometer_horz:eu,tachometer_vert:KL,testpoint_down:JL,testpoint_left:tE,testpoint_right:Js,testpoint_up:eE,tilted_ground_down:iE,tilted_ground_left:nE,tilted_ground_right:ru,tilted_ground_up:g6,transformer_4_winding_down:oE,transformer_4_winding_left:aE,transformer_4_winding_right:b6,transformer_4_winding_up:sE,triac_horz:w6,triac_vert:pE,tunnel_diode_horz:B6,tunnel_diode_vert:mE,unijunction_transistor_horz:S6,unijunction_transistor_vert:vE,usbc:AE,var_meter_horz:I6,var_meter_vert:kE,varactor_diode_horz:L6,varactor_diode_vert:PE,varistor_horz:E6,varistor_vert:OE,varmeter_horz:fu,varmeter_vert:zE,vcc_down:QE,vcc_left:ZE,vcc_right:GE,vcc_up:KE,volt_meter_horz:JE,volt_meter_vert:iP,watt_hour_meter_horz:gu,watt_hour_meter_vert:dP,wattmeter_horz:bu,wattmeter_vert:gP,zener_diode_horz:bP,zener_diode_sm_down:vP,zener_diode_sm_left:wP,zener_diode_sm_right:AP,zener_diode_sm_up:FP,zener_diode_vert:kP,zener_diode_xs_down:YP,zener_diode_xs_left:MP,zener_diode_xs_right:IP,zener_diode_xs_up:LP};var dU=Object.fromEntries(Object.keys(Pr).map((t)=>[t,t]));var LH=we(Se(),1);var WH=we(Se(),1);var Bj=we(Se(),1);var Sj=we(Se(),1);var eG=we(Se(),1);var EP=new Set(["pcb_trace","pcb_smtpad","pcb_via","pcb_plated_hole","pcb_copper_pour","pcb_copper_text"]),Yn=(t,e)=>({name:"g",type:"element",value:"",attributes:t,children:e});function mc(t,e){return t.flatMap((r)=>{if(r.children.length){let n=mc(r.children,e);return n.length?[{...r,children:n}]:[]}return r.attributes["data-pcb-layer"]==="drill"===e?[r]:[]})}function b5(t){let e={...t.attributes};for(let r of["opacity","fill-opacity","stroke-opacity"])if(r in e)e[r]="1";return{...t,attributes:e,children:t.children.map(b5)}}function ju(t){return{...t,attributes:{...t.attributes,...t.attributes.fill&&t.attributes.fill!=="none"?{fill:"black"}:{},...t.attributes.stroke&&t.attributes.stroke!=="none"?{stroke:"black"}:{}},children:t.children.map(ju)}}function PP({circuitJson:t,ctx:e,selectedIds:r,hiddenOpacity:i,width:n,height:o,create:a}){let s=new Set(r),l=(k)=>k[`${k.type}_id`],c=new Set(["top","bottom"]);for(let k of t){if(k.type==="pcb_board")for(let x=1;x<=(k.num_layers??2)-2;x++)c.add(`inner${x}`);if("layer"in k&&typeof k.layer==="string"&&/^(top|bottom|inner\d+)$/.test(k.layer))c.add(k.layer);if("layers"in k&&Array.isArray(k.layers)){for(let x of k.layers)if(/^(top|bottom|inner\d+)$/.test(x))c.add(x)}if(k.type==="pcb_trace"){for(let x of k.route)if(x.route_type==="wire")c.add(x.layer)}}let d=e.layer??"top",h=(k)=>k===d?100:k==="bottom"?0:k==="top"?50:40-Number(k.slice(5)),y=[...c].sort((k,x)=>h(k)-h(x)),_={...e,showSolderMask:!1,showSolderPaste:!1,showPinNumbers:!1,showAnchorOffsets:!1,circuitJson:t.filter((k)=>k.type!=="pcb_copper_pour")},m=[],g=[],b=[],v=[];for(let k of y){let x={..._,layer:k,colorMap:{...e.colorMap,copper:{...e.colorMap.copper,top:e.colorMap.copper[k]}}},A=[],S=[],E=[];for(let P of t){if(P.type==="pcb_hole"||P.type==="pcb_cutout"){E.push(...a(P,x).map(ju));continue}if(!EP.has(P.type))continue;if("layer"in P&&P.layer!==k)continue;if((P.type==="pcb_via"||P.type==="pcb_plated_hole")&&!P.layers.includes(k))continue;let O=P.type==="pcb_plated_hole"?{...P,layers:[k]}:P,D=O.type==="pcb_trace"?{...O,route:O.route.map((K)=>{let{is_inside_copper_pour:vt,copper_pour_id:H,...ht}=K;return ht})}:O,N=a(D,x).map(b5),G=mc(N,!0);if(E.push(...G.map(ju)),A.push(...mc(N,!1)),s.has(l(P))){if(S.push(...mc(N,!1)),k===y.filter((K)=>!("layers"in P)||!Array.isArray(P.layers)||P.layers.includes(K)).at(-1))b.push(...G)}}let I=`xray-holes-${k}`;v.push({name:"mask",type:"element",value:"",attributes:{id:I,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(n),height:String(o)},children:[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:String(n),height:String(o),fill:"white"}},...E]});let T={"data-pcb-layer":k,mask:`url(#${I})`};m.push(Yn({...T,opacity:String(i)},A)),g.push(Yn(T,S))}return[{name:"defs",type:"element",value:"",attributes:{},children:v},Yn({"data-x-ray":"background"},m),Yn({"data-x-ray":"selected"},g),Yn({"data-x-ray":"drills"},b)]}var me=0.000000001;function TP(t,e){let{startIsInsideCopperPour:r,endIsInsideCopperPour:i,start:n,end:o}=t;if(r===i)return t;let a=Wr(n),s=Wr(o),l=OP(e).flatMap((_)=>RP(_,a,s));if(l.length===0)return t;let c=i?Math.min(...l):Math.max(...l),d=w5(a,s,c),h=WP(t.startWidth,t.endWidth,c),y={...t,start:r?d:n,end:i?d:o,startWidth:r?h:t.startWidth,endWidth:i?h:t.endWidth};return XP(y.start,y.end)?null:y}function WP(t,e,r){return t+(e-t)*r}function OP(t){switch(t.shape){case"rect":return[jP(t)];case"polygon":return[t.points.map(Wr)];case"brep":return[t.brep_shape.outer_ring.vertices.map(j6),...t.brep_shape.inner_rings.map((e)=>e.vertices.map(j6))]}}function jP(t){let e=Wr(t.center),r=t.width/2,i=t.height/2,n=(t.rotation??0)*Math.PI/180,o=Math.cos(n),a=Math.sin(n);return[{x:-r,y:-i},{x:r,y:-i},{x:r,y:i},{x:-r,y:i}].map((s)=>({x:e.x+s.x*o-s.y*a,y:e.y+s.x*a+s.y*o}))}function RP(t,e,r){let i=[];for(let n=0;n<t.length;n++){let o=t[n],a=t[(n+1)%t.length];if(!o||!a)continue;if(o.bulge){i.push(...CP(e,r,o,a,o.bulge));continue}let s=v5(e,r,o,a);if(s!==null)i.push(s)}return i}function CP(t,e,r,i,n){let o=i.x-r.x,a=i.y-r.y,s=Math.hypot(o,a);if(s<me||Math.abs(n)<me){let A=v5(t,e,r,i);return A===null?[]:[A]}let l=s*(1-n**2)/(4*n),c={x:(r.x+i.x)/2-a/s*l,y:(r.y+i.y)/2+o/s*l},d=Math.atan2(r.y-c.y,r.x-c.x),h=4*Math.atan(n),y=Math.hypot(r.x-c.x,r.y-c.y),_={x:e.x-t.x,y:e.y-t.y},m={x:t.x-c.x,y:t.y-c.y},g=wu(_,_);if(g<me)return[];let b=2*wu(m,_),v=wu(m,m)-y**2,k=b**2-4*g*v;if(k<-me)return[];let x=Math.sqrt(Math.max(0,k));return[(-b-x)/(2*g),(-b+x)/(2*g)].filter((A)=>{if(A<-me||A>1+me)return!1;let S=w5(t,e,A),E=Math.atan2(S.y-c.y,S.x-c.x);return(h>0?O6(E-d):O6(d-E))<=Math.abs(h)+me})}function v5(t,e,r,i){let n={x:e.x-t.x,y:e.y-t.y},o={x:i.x-r.x,y:i.y-r.y},a=vu(n,o);if(Math.abs(a)<me)return null;let s={x:r.x-t.x,y:r.y-t.y},l=vu(s,o)/a,c=vu(s,n)/a;if(l<-me||l>1+me||c<-me||c>1+me)return null;return Math.min(1,Math.max(0,l))}function vu(t,e){return t.x*e.y-t.y*e.x}function wu(t,e){return t.x*e.x+t.y*e.y}function O6(t){let e=2*Math.PI,r=t%e;return r<0?r+e:r}function w5(t,e,r){return{x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}}function Wr(t){return{x:L.parse(t.x),y:L.parse(t.y)}}function j6(t){return{...Wr(t),bulge:t.bulge}}function XP(t,e){let r=Wr(t),i=Wr(e);return Math.abs(r.x-i.x)<me&&Math.abs(r.y-i.y)<me}function $u(t){if(!t||typeof t!=="object")return!1;return"route_type"in t&&t.route_type==="wire"&&(("start_width"in t)||("end_width"in t)||("width_interpolation_mode"in t))}function A5(t){let e=[];for(let r=0;r<t.length-1;r++){let i=t[r];if(!$u(i))continue;let n=t[r+1];if(!n)continue;let o=n.route_type==="through_pad"?n.start:{x:n.x,y:n.y},a=n.route_type==="via"?n.from_layer:n.route_type==="through_pad"?n.start_layer:n.layer;if(!o||a!==i.layer||i.width!==i.start_width)continue;let s={start:{x:i.x,y:i.y},end:o,start_width:i.start_width,end_width:i.end_width,width_interpolation_mode:i.width_interpolation_mode,layer:i.layer,is_inside_copper_pour:Boolean(i.is_inside_copper_pour&&n.is_inside_copper_pour)};if(B5(s))e.push(s)}return e}function F5(t){let{start:e,end:r,start_width:i,end_width:n}=t,o=r.x-e.x,a=r.y-e.y,s=Math.hypot(o,a);if(!B5(t))return[];let l=Math.abs(n-i),c=t.width_interpolation_mode==="linear"?1:Math.max(1,Math.ceil(Math.sqrt(l/(0.001+l*0.000001)*0.375))),d=-a/s,h=o/s,y=[],_=[];for(let m=0;m<=c;m++){let g=m/c,b=i<=n?g:1-g,k=(t.width_interpolation_mode==="quadratic"?Math.min(i,n)+l*b*b:i+(n-i)*g)/2,x=e.x+o*g,A=e.y+a*g;y.push({x:x+d*k,y:A+h*k}),_.push({x:x-d*k,y:A-h*k})}return[...y,..._.reverse()]}function B5(t){let{start:e,end:r,start_width:i,end_width:n}=t,o=Math.hypot(r.x-e.x,r.y-e.y);if(![e.x,e.y,r.x,r.y,o,i,n].every(Number.isFinite)||o<=0||i<=0||n<=0)return!1;if(t.width_interpolation_mode!=="linear"&&t.width_interpolation_mode!=="quadratic")return!1;return!0}function $P(t){switch(t.route_type){case"through_pad":return[t.start,t.end];default:return[t]}}function NP(t){let e=[];for(let r=0;r<t.length-1;r++){let i=t[r],n=t[r+1];if(!i||!n)continue;if($u(i))continue;let o=i.route_type==="through_pad"?i.end:i,a=n.route_type==="through_pad"?n.start:n,s=i.route_type==="wire"?i.layer:i.route_type==="through_pad"?i.end_layer:n.route_type==="wire"?n.layer:n.route_type==="through_pad"?n.start_layer:null;if(!s)continue;if(VP(o,a))continue;let l=R6(i),c=R6(n),d=Au(i)??Au(n)??0,h=Au(n)??d;e.push({start:o,end:a,layer:s,width:d,startWidth:d,endWidth:h,isInsideCopperPour:l&&c,startIsInsideCopperPour:l,endIsInsideCopperPour:c,copperPourId:l?C6(i):c?C6(n):void 0})}for(let r of t){if(!r||r.route_type!=="through_pad")continue;for(let i of new Set([r.start_layer,r.end_layer]))e.push({start:r.start,end:r.end,layer:i,width:r.width,startWidth:r.width,endWidth:r.width,isInsideCopperPour:!1,startIsInsideCopperPour:!1,endIsInsideCopperPour:!1})}return e}function Au(t){return"width"in t?L.parse(t.width):void 0}function R6(t){return"is_inside_copper_pour"in t&&t.is_inside_copper_pour===!0}function C6(t){if(!("copper_pour_id"in t))return;return t.copper_pour_id}function VP(t,e){let r=L.parse(t.x),i=L.parse(t.y),n=L.parse(e.x),o=L.parse(e.y);return r===n&&i===o}function zP(t){let e=[],r=[];for(let i=0;i<t.length;i++){let n=t[i];if(!n)continue;let o=DP(t,i),a=Nu(-o.y,o.x),s=n.width/2;e.push({x:n.x+a.x*s,y:n.y+a.y*s}),r.push({x:n.x-a.x*s,y:n.y-a.y*s})}return e.concat(r.reverse())}function DP(t,e){if(t.length<2)return{x:1,y:0};if(e<=0)return nc(t[0],t[1]);if(e>=t.length-1)return nc(t[t.length-2],t[t.length-1]);let r=nc(t[e-1],t[e]),i=nc(t[e],t[e+1]),n=Nu(r.x+i.x,r.y+i.y);if(n.x!==0||n.y!==0)return n;if(r.x!==0||r.y!==0)return r;if(i.x!==0||i.y!==0)return i;return{x:1,y:0}}function nc(t,e){if(!t||!e)return{x:1,y:0};let r=Nu(e.x-t.x,e.y-t.y);return r.x===0&&r.y===0?{x:1,y:0}:r}function Nu(t,e){let r=Math.hypot(t,e);if(r<=Number.EPSILON)return{x:0,y:0};return{x:t/r,y:e/r}}var zt={copper:{top:"rgb(200, 52, 52)",inner1:"rgb(255, 140, 0)",inner2:"rgb(255, 215, 0)",inner3:"rgb(50, 205, 50)",inner4:"rgb(64, 224, 208)",inner5:"rgb(138, 43, 226)",inner6:"rgb(255, 105, 180)",inner7:"rgb(0, 191, 255)",inner8:"rgb(160, 82, 45)",bottom:"rgb(77, 127, 196)"},soldermaskWithCopperUnderneath:{top:"rgb(18, 82, 50)",bottom:"rgb(18, 82, 50)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},soldermaskOverCopper:{top:"rgb(52, 135, 73)",bottom:"rgb(52, 135, 73)"},substrate:"rgb(201, 162, 110)",drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",courtyard:{top:"#FF00FF",bottom:"rgb(38, 233, 255)"},keepout:"#FF6B6B",debugComponent:{fill:null,stroke:null}},wU=zt.drill,AU=zt.silkscreen.top,FU=zt.silkscreen.bottom,BU={...zt.copper};function he(t,e=zt){return e.copper[t]??"white"}var QP={bottom:"rgb(105, 105, 105)",top:"rgb(105, 105, 105)"};function Tr(t){return QP[t]??"rgb(105, 105, 105)"}function Ru({elementType:t,shapeAttributes:e,layer:r,fillColor:i,fillOpacity:n,className:o,additionalAttributes:a}){let s={class:o,fill:i,"fill-opacity":n,"data-type":"pcb_soldermask","data-pcb-layer":r,...e,...a};return{name:t,type:"element",value:"",children:[],attributes:s}}function Vu(t,e){let{transform:r,colorMap:i}=e,n=e.layer??"top",o=e.showSolderMask&&(n==="top"||n==="bottom");if(o&&!t.layers.includes(n))return[];let a=e.boardOwnerMap?.has(t.pcb_via_id)?t.pcb_via_id:t.pcb_trace_id??t.pcb_via_id,s=e.boardOwnerMap?.get(a),l=t,c=(n==="top"?l.tented_on_top:l.tented_on_bottom)??l.is_tented??(n==="top"?s?.default_via_tented_on_top:s?.default_via_tented_on_bottom),[d,h]=F(r,[t.x,t.y]),y=t.outer_diameter*Math.abs(r.a),_=t.outer_diameter*Math.abs(r.a),m=t.hole_diameter*Math.abs(r.a),g=t.hole_diameter*Math.abs(r.a),b=Math.min(y,_)/2,v=Math.min(m,g)/2,k={name:"g",type:"element",value:"",attributes:{"data-type":"pcb_via","data-pcb-layer":o&&c?n:"through"},children:[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-outer",fill:i.copper[o?n:"top"],cx:d.toString(),cy:h.toString(),r:b.toString(),"data-type":"pcb_via","data-pcb-layer":o?n:"top"}},{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-inner",fill:i.drill,cx:d.toString(),cy:h.toString(),r:v.toString(),"data-type":"pcb_via","data-pcb-layer":"drill"}}]};if(o&&c){let x=i.soldermaskWithCopperUnderneath[n],A,S=1;try{let I=sn(x);S=I.alpha(),x=I.alpha(1).rgb().string(),A=sn.rgb(I.red()/2,I.green()/2,I.blue()/2).string()}catch{}let E={name:"g",type:"element",value:"",attributes:{class:"pcb-via-tenting","data-type":"pcb_soldermask","data-pcb-layer":n,opacity:S.toString()},children:[Ru({elementType:"circle",shapeAttributes:{cx:d.toString(),cy:h.toString(),r:b.toString()},layer:n,fillColor:x,fillOpacity:"1",className:"pcb-via-tenting-ring"})]};if(A!==void 0)E.children.push(Ru({elementType:"circle",shapeAttributes:{cx:d.toString(),cy:h.toString(),r:v.toString()},layer:n,fillColor:A,fillOpacity:"1",className:"pcb-via-tenting-hole"}));k.children.push(E)}return[k]}function ji(t,e){if(t.length===0)return"";let r=t.map((n)=>{let[o,a]=F(e,[n.x,n.y]);return{...n,x:o,y:a}}),i=`M ${r[0].x} ${r[0].y}`;for(let n=0;n<r.length;n++){let o=r[n],a=r[(n+1)%r.length];if(o.bulge){if(Math.hypot(a.x-o.x,a.y-o.y)<0.000000001)continue;let s=o.bulge,l=a.x-o.x,c=a.y-o.y,d=Math.hypot(l,c),h=Math.abs(d/4/s*(s*s+1)),y=s<0?1:0,_=Math.abs(s)>1?1:0;i+=` A ${h} ${h} 0 ${_} ${y} ${a.x} ${a.y}`}else i+=` L ${a.x} ${a.y}`}return i+=" Z",i}function S5(t,e){if(t.shape==="rect"){let[r,i]=F(e,[t.center.x,t.center.y]),n=t.width*Math.abs(e.a),o=t.height*Math.abs(e.d),a=-(t.rotation??0);return{elementType:"rect",shapeAttributes:{x:(-n/2).toString(),y:(-o/2).toString(),width:n.toString(),height:o.toString(),transform:oe(Ft(Yt(r,i),Gt(a*Math.PI/180)))}}}if(t.shape==="polygon"){if(!t.points||t.points.length===0)return null;return{elementType:"polygon",shapeAttributes:{points:t.points.map((i)=>F(e,[i.x,i.y])).map((i)=>`${i[0]},${i[1]}`).join(" ")}}}if(t.shape==="brep"){let{brep_shape:r}=t,i=ji(r.outer_ring.vertices,e);for(let n of r.inner_rings??[])i+=` ${ji(n.vertices,e)}`;return{elementType:"path",shapeAttributes:{d:i,"fill-rule":"evenodd"}}}return null}function k5(t){return`copper-pour-trace-mask-${t}`.replace(/[^a-zA-Z0-9_-]/g,"_")}function UP({layer:t,circuitJson:e}){for(let r of e){if(r.type!=="pcb_copper_pour")continue;if(r.layer!==t)continue;return k5(t)}return}function ZP({circuitJson:t,transform:e,svgWidth:r,svgHeight:i,usedMaskIds:n}){if(n.size===0)return null;let o=new Map;for(let s of t){if(s.type!=="pcb_copper_pour")continue;let l=s,c=k5(l.layer);if(!n.has(c))continue;let d=o.get(c);if(d)d.push(l);else o.set(c,[l])}if(o.size===0)return null;let a=[];for(let[s,l]of o){let c=[{name:"rect",type:"element",value:"",children:[],attributes:{x:"0",y:"0",width:r.toString(),height:i.toString(),fill:"#fff"}}];for(let d of l){let h=S5(d,e);if(!h)continue;c.push({name:h.elementType,type:"element",value:"",children:[],attributes:{...h.shapeAttributes,fill:"#000"}})}a.push({name:"mask",type:"element",value:"",children:c,attributes:{id:s,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:r.toString(),height:i.toString()}})}return{name:"defs",type:"element",value:"",children:a,attributes:{class:"copper-pour-trace-mask-defs"}}}function Y5(t){let e=[],r=new Map;for(let i of t){let n=i.attributes?.["data-type"],o=i.attributes?.mask;if(!(n==="pcb_trace"||n==="pcb_trace_soldermask")||!o?.includes("#copper-pour-trace-mask-")){e.push(i);continue}let s=r.get(o);if(!s){let m={name:"g",type:"element",value:"",children:[],attributes:{class:"pcb-trace-mask-group",mask:o}};s={object:m,pathsByAttributes:new Map},r.set(o,s),e.push(m)}let{mask:l,d:c="",...d}=i.attributes,h=JSON.stringify(d),y=s.pathsByAttributes.get(h);if(y){y.attributes.d+=` ${c}`;continue}let _={...i,attributes:{...d,d:c}};s.pathsByAttributes.set(h,_),s.object.children.push(_)}return e}function M5(t,e){let{transform:r,layer:i,colorMap:n,showSolderMask:o}=e;if(!t.route||!Array.isArray(t.route)||t.route.length===0)return[];let a=[],s=e.copperPourTraceMaskIdsByLayer??=new Map,l=[];for(let d of NP(t.route)){let h=d;if(h.isInsideCopperPour)continue;if(h.copperPourId&&h.startIsInsideCopperPour!==h.endIsInsideCopperPour){let _=e.circuitJson?.find((m)=>m.type==="pcb_copper_pour"&&m.pcb_copper_pour_id===h.copperPourId);if(_){let m=TP(h,_);if(!m)continue;h=m}}let y=h.layer;if(!y)continue;if(i&&y!==i)continue;l.push(h)}let c=(d)=>{if(!s.has(d))s.set(d,e.circuitJson?UP({layer:d,circuitJson:e.circuitJson}):void 0);let h=s.get(d);if(h)return e.usedCopperPourTraceMaskIds?.add(h),{mask:`url(#${h})`};return{}};for(let d of A5(t.route)){if(i&&d.layer!==i)continue;if(d.is_inside_copper_pour)continue;let h=F5(d).map((_)=>F(r,_));if(!h.length)continue;let y=o?n.soldermaskWithCopperUnderneath[d.layer]:he(d.layer,n);a.push({name:"path",type:"element",value:"",children:[],attributes:{class:o?"pcb-soldermask":"pcb-trace",fill:y,stroke:"none",d:h.map((_,m)=>`${m===0?"M":"L"} ${_.x} ${_.y}`).join(" ")+" Z","data-type":o?"pcb_trace_soldermask":"pcb_trace","data-route-type":"wire","data-wire-taper":"true","data-width-interpolation-mode":d.width_interpolation_mode,"data-pcb-layer":d.layer,...c(d.layer)}})}if(t.route_thickness_mode==="interpolated")for(let d of HP(l)){let h=d[0]?.layer;if(!h)continue;let y=GP(d,r);if(!y)continue;let _=he(h,n),m=n.soldermaskWithCopperUnderneath[h];a.push({name:"path",type:"element",value:"",children:[],attributes:{class:o?"pcb-soldermask":"pcb-trace",fill:o?m:_,stroke:"none",d:y,"shape-rendering":"geometricPrecision","data-type":o?"pcb_trace_soldermask":"pcb_trace","data-pcb-layer":h,...c(h)}})}else for(let d of l){let h=F(r,[d.start.x,d.start.y]),y=F(r,[d.end.x,d.end.y]),_=d.layer,m=he(_,n),g=n.soldermaskWithCopperUnderneath[_],b=d.width?(d.width*Math.abs(r.a)).toString():"0.3",v=c(_);if(o){let k={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask",stroke:g,fill:"none",d:`M ${h[0]} ${h[1]} L ${y[0]} ${y[1]}`,"stroke-width":b,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace_soldermask","data-pcb-layer":_,...v}};a.push(k)}else{let k={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-trace",stroke:m,fill:"none",d:`M ${h[0]} ${h[1]} L ${y[0]} ${y[1]}`,"stroke-width":b,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"crispEdges","data-type":"pcb_trace","data-pcb-layer":_,...v}};a.push(k)}}for(let[d,h]of t.route.entries()){if(!h||h.route_type!=="via")continue;if(eT(e).has(I5(h)))continue;a.push(...Vu(KP(t,h,d,e),e))}return a}function HP(t){let e=[];for(let r of t){let i=e[e.length-1],n=i?.[i.length-1];if(i&&n?.layer===r.layer&&qP(n.end,r.start))i.push(r);else e.push([r])}return e}function GP(t,e){let r=t[0];if(!r)return"";let i=[{x:L.parse(r.start.x),y:L.parse(r.start.y),width:r.startWidth},...t.map((l)=>({x:L.parse(l.end.x),y:L.parse(l.end.y),width:l.endWidth}))],o=zP(i).map((l)=>F(e,[l.x,l.y])),[a,...s]=o;if(!a)return"";return[`M ${a[0]} ${a[1]}`,...s.map((l)=>`L ${l[0]} ${l[1]}`),"Z"].join(" ")}function qP(t,e){return L.parse(t.x)===L.parse(e.x)&&L.parse(t.y)===L.parse(e.y)}function KP(t,e,r,i){let n=JP(t.route,r),o=i.boardOwnerMap?.get(t.pcb_trace_id),{holeDiameter:a,outerDiameter:s}=tT(o,n);return{type:"pcb_via",pcb_via_id:`${t.pcb_trace_id}_route_via_${r}`,pcb_trace_id:t.pcb_trace_id,subcircuit_id:t.subcircuit_id,pcb_group_id:t.pcb_group_id,x:e.x,y:e.y,outer_diameter:s,hole_diameter:a,layers:[e.from_layer,e.to_layer],tented_on_top:e.tented_on_top,tented_on_bottom:e.tented_on_bottom}}function JP(t,e){let r=X6(t,e,-1),i=X6(t,e,1);return Math.max(r??0,i??0)}function X6(t,e,r){for(let i=e+r;i>=0&&i<t.length;i+=r){let n=t[i];if($u(n))return r===-1?n.end_width:n.start_width;if(!n||!("width"in n)||typeof n.width!=="number")continue;return n.width}return}function tT(t,e){let r=fc(t?.min_via_hole_diameter),i=fc(t?.min_via_pad_diameter),n=Math.max(e,0.3),o=Math.max(n*2,0.6);return{holeDiameter:r??n,outerDiameter:i??o}}function eT(t){return t.standaloneViaPositionKeys??=new Set(t.circuitJson?.filter((e)=>e.type==="pcb_via").map((e)=>I5(e))??[])}function I5(t){let e=fc(t.x),r=fc(t.y);if(e!==void 0&&r!==void 0)return`${e}:${r}`;return`${String(t.x)}:${String(t.y)}`}function fc(t){if(t===null||t===void 0)return;let e=L.safeParse(t);return e.success?e.data:void 0}function L5(t,e){if(!e)return{};let r=E5(t,e);if(!r)return{};let i=e.find((s)=>s.type==="source_port"&&s.source_port_id===r),n=e.find((s)=>s.type==="source_component"&&s.source_component_id===i?.source_component_id),o={};if(n?.name&&i?.name)o["data-pad-name"]=`${n.name}.${i.name}`;let a=iT(r,e);if(a)o["data-pad-net-name"]=a;return o}function rT(t,e){if(e){let n=E5(t,e),o=e.find((a)=>a.type==="source_port"&&a.source_port_id===n);if(o?.type==="source_port"&&o.pin_number!=null)return o.pin_number.toString()}let r=t.port_hints?.find((n)=>n.trim().length>0);if(!r)return;return r.match(/^pin(\d+)$/i)?.[1]??r}function E5(t,e){if(t.source_port_id)return t.source_port_id;if(t.pcb_port_id){let n=e.find((o)=>o.type==="pcb_port"&&o.pcb_port_id===t.pcb_port_id);if(n?.source_port_id)return n.source_port_id}let r=t.pcb_smtpad_id??t.pcb_plated_hole_id;if(!r)return;return e.find((n)=>{if(n.type!=="pcb_port")return!1;let o=n;return o.pcb_smtpad_id===r||o.pcb_plated_hole_id===r})?.source_port_id}function iT(t,e){let i=e.find((o)=>{if(o.type!=="source_trace")return!1;return o.connected_source_port_ids?.includes(t)})?.connected_source_net_ids?.[0];if(!i)return;return e.find((o)=>o.type==="source_net"&&o.source_net_id===i)?.name}function P5(t,e){let{transform:r,layer:i,colorMap:n,showSolderMask:o}=e;if(i&&t.layer!==i)return[];let a=L5(t,e.circuitJson),s=Boolean(t?.is_covered_with_solder_mask),l=o&&s,c=n.soldermaskWithCopperUnderneath[t.layer]??n.soldermaskWithCopperUnderneath.top,d=(t.soldermask_margin??0)*Math.abs(r.a);if(t.shape==="rect"||t.shape==="rotated_rect"){let h=t.width*Math.abs(r.a),y=t.height*Math.abs(r.d),[_,m]=F(r,[t.x,t.y]),b=(t.corner_radius??t.rect_border_radius??0)*Math.abs(r.a),v={left:(t.soldermask_margin_left??t.soldermask_margin??0)*Math.abs(r.a),right:(t.soldermask_margin_right??t.soldermask_margin??0)*Math.abs(r.a),top:(t.soldermask_margin_top??t.soldermask_margin??0)*Math.abs(r.a),bottom:(t.soldermask_margin_bottom??t.soldermask_margin??0)*Math.abs(r.a)},k=v.left<0||v.right<0||v.top<0||v.bottom<0,x=v.left===0&&v.right===0&&v.top===0&&v.bottom===0;if(t.shape==="rotated_rect"&&t.ccw_rotation){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:he(t.layer,n),x:(-h/2).toString(),y:(-y/2).toString(),width:h.toString(),height:y.toString(),transform:`translate(${_} ${m}) rotate(${-t.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...a,...b?{rx:b.toString(),ry:b.toString()}:{}}};if(!l)return[P];let O=h+v.left+v.right,D=y+v.top+v.bottom,N=b?b+d:0;if(k){let K={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,x:(-h/2).toString(),y:(-y/2).toString(),width:h.toString(),height:y.toString(),transform:`translate(${_} ${m}) rotate(${-t.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...b?{rx:b.toString(),ry:b.toString()}:{}}},vt={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:he(t.layer,n),x:(-h/2-v.left).toString(),y:(-y/2-v.top).toString(),width:O.toString(),height:D.toString(),transform:`translate(${_} ${m}) rotate(${-t.ccw_rotation})`,"data-type":"pcb_soldermask","data-pcb-layer":t.layer,...N>0?{rx:N.toString(),ry:N.toString()}:{}}};return[K,vt]}if(x)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,x:(-h/2).toString(),y:(-y/2).toString(),width:h.toString(),height:y.toString(),transform:`translate(${_} ${m}) rotate(${-t.ccw_rotation})`,"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...b?{rx:b.toString(),ry:b.toString()}:{}}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:n.substrate,x:(-h/2-v.left).toString(),y:(-y/2-v.top).toString(),width:O.toString(),height:D.toString(),transform:`translate(${_} ${m}) rotate(${-t.ccw_rotation})`,...N>0?{rx:N.toString(),ry:N.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":t.layer}},P]}let A={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:he(t.layer,n),x:(_-h/2).toString(),y:(m-y/2).toString(),width:h.toString(),height:y.toString(),"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...a,...b?{rx:b.toString(),ry:b.toString()}:{}}};if(!l)return[A];let S=h+v.left+v.right,E=y+v.top+v.bottom,I=b?b+d:0;if(k){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,x:(_-h/2).toString(),y:(m-y/2).toString(),width:h.toString(),height:y.toString(),"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...b?{rx:b.toString(),ry:b.toString()}:{}}},O={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:he(t.layer,n),x:(_-h/2-v.left).toString(),y:(m-y/2-v.top).toString(),width:S.toString(),height:E.toString(),"data-type":"pcb_soldermask","data-pcb-layer":t.layer,...I>0?{rx:I.toString(),ry:I.toString()}:{}}};return[P,O]}if(x)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,x:(_-h/2).toString(),y:(m-y/2).toString(),width:h.toString(),height:y.toString(),...I>0?{rx:b.toString(),ry:b.toString()}:{},"data-type":"pcb_smtpad","data-pcb-layer":t.layer}}];return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:n.substrate,x:(_-h/2-v.left).toString(),y:(m-y/2-v.top).toString(),width:S.toString(),height:E.toString(),...I>0?{rx:I.toString(),ry:I.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":t.layer}},A]}if(t.shape==="pill"||t.shape==="rotated_pill"){let h=t.shape==="rotated_pill",y=t.width*Math.abs(r.a),_=t.height*Math.abs(r.d),m=t.radius*Math.abs(r.a),[g,b]=F(r,[t.x,t.y]),v=h?{transform:`translate(${g} ${b}) rotate(${-(t.ccw_rotation??0)})`}:void 0,k={class:"pcb-pad",fill:he(t.layer,n),x:h?(-y/2).toString():(g-y/2).toString(),y:h?(-_/2).toString():(b-_/2).toString(),width:y.toString(),height:_.toString(),rx:m.toString(),ry:m.toString(),"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...a,...v??{}},x={name:"rect",type:"element",value:"",children:[],attributes:k};if(!l)return[x];let A=y+2*d,S=_+2*d,E=m+d;if(d<0){let P={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,x:h?(-y/2).toString():(g-y/2).toString(),y:h?(-_/2).toString():(b-_/2).toString(),width:y.toString(),height:_.toString(),rx:m.toString(),ry:m.toString(),"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...v??{}}},O={class:"pcb-pad-exposed",fill:he(t.layer,n),x:h?(-A/2).toString():(g-A/2).toString(),y:h?(-S/2).toString():(b-S/2).toString(),width:A.toString(),height:S.toString(),rx:E.toString(),ry:E.toString(),"data-type":"pcb_soldermask","data-pcb-layer":t.layer,...v??{}};return[P,{name:"rect",type:"element",value:"",children:[],attributes:O}]}if(d===0)return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,x:h?(-y/2).toString():(g-y/2).toString(),y:h?(-_/2).toString():(b-_/2).toString(),width:y.toString(),height:_.toString(),rx:m.toString(),ry:m.toString(),"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...v??{}}}];let I={class:"pcb-soldermask-cutout",fill:n.substrate,x:h?(-A/2).toString():(g-A/2).toString(),y:h?(-S/2).toString():(b-S/2).toString(),width:A.toString(),height:S.toString(),rx:E.toString(),ry:E.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":t.layer,...v??{}};return[{name:"rect",type:"element",value:"",children:[],attributes:I},x]}if(t.shape==="circle"){let h=t.radius*Math.abs(r.a),[y,_]=F(r,[t.x,t.y]),m={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:he(t.layer,n),cx:y.toString(),cy:_.toString(),r:h.toString(),"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...a}};if(!l)return[m];let g=h+d;if(d<0){let v={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,cx:y.toString(),cy:_.toString(),r:h.toString(),"data-type":"pcb_smtpad","data-pcb-layer":t.layer}},k={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:he(t.layer,n),cx:y.toString(),cy:_.toString(),r:g.toString(),"data-type":"pcb_soldermask","data-pcb-layer":t.layer}};return[v,k]}if(d===0)return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,cx:y.toString(),cy:_.toString(),r:h.toString(),"data-type":"pcb_smtpad","data-pcb-layer":t.layer}}];return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:n.substrate,cx:y.toString(),cy:_.toString(),r:g.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":t.layer}},m]}if(t.shape==="polygon"){let h=(t.points??[]).map((g)=>F(r,[g.x,g.y])),y={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad",fill:he(t.layer,n),points:h.map((g)=>g.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":t.layer,...a}};if(!l)return[y];let _=h;if(d!==0){let g=h.reduce((v,k)=>v+k[0],0)/h.length,b=h.reduce((v,k)=>v+k[1],0)/h.length;_=h.map(([v,k])=>{let x=v-g,A=k-b,S=Math.sqrt(x*x+A*A);if(S===0)return[v,k];let E=x/S,I=A/S;return[v+E*d,k+I*d]})}if(d<0){let g={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,points:h.map((v)=>v.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":t.layer}},b={name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-exposed",fill:he(t.layer,n),points:_.map((v)=>v.join(",")).join(" "),"data-type":"pcb_soldermask","data-pcb-layer":t.layer}};return[g,b]}if(d===0)return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-pad-covered",fill:c,points:h.map((b)=>b.join(",")).join(" "),"data-type":"pcb_smtpad","data-pcb-layer":t.layer}}];return[{name:"polygon",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:n.substrate,points:_.map((g)=>g.join(",")).join(" "),"data-type":"pcb_soldermask_opening","data-pcb-layer":t.layer}},y]}return[]}var Ie=(t,e,r=[])=>({name:t,type:"element",value:"",attributes:e,children:r}),Fu=(t,e)=>Ie("text",e,[{name:"",type:"text",value:t,attributes:{},children:[]}]);function nT(t,e){let r=t.filter((n)=>n.type==="simulation_pcb_return_current_result"&&n.simulation_pcb_return_current_result_id===e);if(r.length!==1)throw Error(`Expected one return-current result '${e}'`);let i=io.parse(r[0]);if(!t.some((n)=>n.type==="simulation_experiment"&&n.simulation_experiment_id===i.simulation_experiment_id&&n.experiment_type==="pcb_return_current"))throw Error(`Missing PCB return-current experiment '${i.simulation_experiment_id}'`);if(!t.some((n)=>n.type==="pcb_board"&&n.pcb_board_id===i.pcb_board_id))throw Error(`Missing PCB board '${i.pcb_board_id}'`);return i}function $6(t,e){if(t.field_type==="real"){let a=t.sheet_current_x[e],s=t.sheet_current_y[e];return a==null||s==null?null:{x:a,y:s,magnitude:Math.hypot(a,s)}}let r=t.sheet_current_x_real[e],i=t.sheet_current_x_imag[e],n=t.sheet_current_y_real[e],o=t.sheet_current_y_imag[e];if(r==null||i==null||n==null||o==null)return null;return{x:r,y:n,magnitude:Math.hypot(r,i,n,o)}}var oc=[[30,60,130],[20,170,190],[90,200,140],[245,210,65],[220,65,45]];function N6(t){let e=Math.max(0,Math.min(1,t))*(oc.length-1),r=Math.floor(e),i=oc[r],n=oc[Math.min(r+1,oc.length-1)];return`rgb(${i.map((o,a)=>Math.round(o+(n[a]-o)*(e-r))).join(",")})`}function oT({circuitJson:t,resultId:e,ctx:r,options:i={},width:n,height:o}){let a=nT(t,e),s=i.opacity??0.65;if(!Number.isFinite(s)||s<0||s>1)throw Error("Return-current opacity must be between 0 and 1");let l=i.densityRange;if(l&&(!Number.isFinite(l.min)||!Number.isFinite(l.max)||l.min<0||l.max<=l.min))throw Error("Return-current densityRange requires 0 <= min < max");let c=(S)=>("simulation_pcb_return_current_result_id"in S)&&S.simulation_pcb_return_current_result_id===e,d=t.filter((S)=>S.type==="simulation_pcb_return_current_heatmap"&&c(S)).map((S)=>oo.parse(S)).filter((S)=>!r.layer||S.layer===r.layer),h=t.filter((S)=>S.type==="simulation_pcb_return_current_field"&&c(S)).map((S)=>an.parse(S)).filter((S)=>!r.layer||S.layer===r.layer);if(!h.length&&!d.length)throw Error(`No return-current field or heatmap for '${e}' on ${r.layer??"any layer"}`);let y=h.flatMap((S)=>{let E=i.fieldData?.[S.simulation_pcb_return_current_field_id];if(!E)return[];return[{field:S,grid:no(S).parse(E)}]});if(!d.length&&!y.length)throw Error("Return-current field assets need decoded fieldData; use convertCircuitJsonToPcbSimulationSvg to load assets");let _=0;for(let{field:S,grid:E}of y)for(let I=0;I<S.columns*S.rows;I++)_=Math.max(_,($6(E,I)?.magnitude??0)/S.copper_thickness);let m=l?.min??0,g=l?.max??(_||1),b=[],v=[];for(let S of d){if(l&&y.some(({field:O})=>O.layer===S.layer&&O.source_net_id===S.source_net_id))continue;let[E,I]=F(r.transform,[S.min_x,S.max_y]),[T,P]=F(r.transform,[S.max_x,S.min_y]);b.push(Ie("image",{x:String(E),y:String(I),width:String(T-E),height:String(P-I),href:S.image_asset.url,preserveAspectRatio:"none",opacity:String(s),"data-type":S.type,"data-pcb-layer":S.layer,"data-source-net-id":S.source_net_id,"data-units":"A/mm²"}))}for(let{field:S,grid:E}of y){let I=!l&&d.some((T)=>T.layer===S.layer&&T.source_net_id===S.source_net_id);k(S,E,I)}function k(S,E,I){let T=Math.max(1,Math.ceil(Math.sqrt(S.columns*S.rows/500)));for(let P=0;P<S.rows;P++)for(let O=0;O<S.columns;O++){let D=P*S.columns+O,N=$6(E,D);if(!N)continue;let G=N.magnitude/S.copper_thickness,K=S.min_x+O*S.cell_width,vt=S.min_y+P*S.cell_height,[H,ht]=F(r.transform,[K,vt+S.cell_height]);if(!I)b.push(Ie("rect",{x:String(H),y:String(ht),width:String(S.cell_width*Math.abs(r.transform.a)),height:String(S.cell_height*Math.abs(r.transform.d)),fill:N6((G-m)/(g-m)),opacity:String(s),"data-type":"simulation_pcb_return_current_cell","data-pcb-layer":S.layer,"data-grid-index":String(D),"data-current-density":String(G),"data-units":"A/mm²"}));if(!i.showVectors||P%T||O%T)continue;let wt=Math.hypot(N.x,N.y);if(wt===0)continue;let[et,Q]=F(r.transform,[K+S.cell_width/2,vt+S.cell_height/2]),V=N.x/wt*8,tt=-N.y/wt*8,C=et+V,ot=Q+tt;v.push(Ie("path",{d:`M ${et-V} ${Q-tt} L ${C} ${ot} M ${C-V*0.4-tt*0.3} ${ot-tt*0.4+V*0.3} L ${C} ${ot} L ${C-V*0.4+tt*0.3} ${ot-tt*0.4-V*0.3}`,fill:"none",stroke:"#fff","stroke-width":"1.2","data-type":"simulation_pcb_return_current_vector","data-pcb-layer":S.layer,"data-grid-index":String(D),"data-sheet-current-x":String(N.x),"data-sheet-current-y":String(N.y),"data-units":"A/mm","data-arrow-reference":"excitation-current-peak"}))}}let x=[];for(let S of a.simulation_return_current_excitation_ids){let E=t.find((T)=>T.type==="simulation_return_current_excitation"&&T.simulation_return_current_excitation_id===S);if(!E||E.type!=="simulation_return_current_excitation")throw Error(`Missing return-current excitation '${S}'`);if(E.simulation_experiment_id!==a.simulation_experiment_id)throw Error(`Excitation '${S}' belongs to a different experiment`);let I=t.find((T)=>T.type==="pcb_trace"&&T.pcb_trace_id===E.pcb_trace_id);if(!I||I.type!=="pcb_trace")throw Error(`Missing signal trace '${E.pcb_trace_id}'`);x.push(Ie("g",{"data-type":"simulation_pcb_return_current_signal","data-pcb-trace-id":I.pcb_trace_id},M5({...I,route:I.route.map((T)=>{let{is_inside_copper_pour:P,copper_pour_id:O,...D}=T;return D})},{...r,layer:void 0,showSolderMask:!1,circuitJson:t.filter((T)=>T.type!=="pcb_copper_pour"),colorMap:{...r.colorMap,copper:{...r.colorMap.copper,top:"#08d9ef",bottom:"#ff941f"}}})))}for(let S of t){if(S.type!=="simulation_pcb_return_current_marker"||!c(S))continue;let E=ao.parse(S),I=E.target_type==="pcb_port"?t.find((K)=>K.type==="pcb_port"&&K.pcb_port_id===E.pcb_port_id):t.find((K)=>K.type==="pcb_via"&&K.pcb_via_id===E.pcb_via_id);if(!I||I.type!=="pcb_port"&&I.type!=="pcb_via")throw Error(`Missing ${E.target_type} for return-current marker '${E.simulation_pcb_return_current_marker_id}'`);let[T,P]=F(r.transform,[L.parse(I.x),L.parse(I.y)]),O=E.role.startsWith("return_")?"#ed80e6":"#08d9ef",D=E.target_type==="pcb_port"?t.flatMap((K)=>K.type==="pcb_smtpad"&&K.pcb_port_id===E.pcb_port_id?P5(K,{...r,layer:void 0,showSolderMask:!1,colorMap:{...r.colorMap,copper:{...r.colorMap.copper,[K.layer]:O}}}):[]):[],N=I.type==="pcb_via"?Vu(I,{...r,layer:void 0,showSolderMask:!1,colorMap:{...r.colorMap,drill:"#102b29",copper:{...r.colorMap.copper,top:O}}}):[],G=[...D,...N,Ie("circle",{cx:String(T),cy:String(P),r:"8",stroke:O,"stroke-width":"3",fill:"none"})];if(E.label){let K=E.label_x!==void 0&&E.label_y!==void 0?F(r.transform,[E.label_x,E.label_y]):[T+13,P-13];G.push(Ie("line",{x1:String(T),y1:String(P),x2:String(K[0]),y2:String(K[1]),stroke:O,"stroke-width":"1"})),G.push(Fu(E.label,{x:String(K[0]),y:String(K[1]-4),fill:"white","font-size":"12","font-family":"sans-serif","paint-order":"stroke",stroke:"#122b29","stroke-width":"4"}))}x.push(Ie("g",{"data-type":E.type,"data-role":E.role,"data-target-type":E.target_type,"data-target-id":E.target_type==="pcb_port"?E.pcb_port_id:E.pcb_via_id},G))}let A=[];if(i.showLegend!==!1){let E=`${a.frequency_hz===void 0?"frequency not specified":`${a.frequency_hz/1e6} MHz`} · ${r.layer??"all result layers"} · average density A/mm² · cyan: top signal · orange: bottom signal · magenta: return${i.showVectors?" · arrows: current at excitation peak":""}`;if(A.push(Ie("rect",{x:"0",y:String(o-28),width:String(n),height:"28",fill:"#102b29",opacity:"0.95"})),A.push(Fu(E,{x:"10",y:String(o-10),fill:"white","font-family":"sans-serif","font-size":"12"})),y.length&&(d.length===0||l)){for(let I=0;I<80;I++)A.push(Ie("rect",{x:String(n-170+I*2),y:"12",width:"2",height:"10",fill:N6(I/79)}));A.push(Fu(`${m.toPrecision(3)} – ${g.toPrecision(3)} A/mm²`,{x:String(n-170),y:"36",fill:"white","font-family":"sans-serif","font-size":"12"}))}}return[Ie("g",{"data-simulation-result-id":e},[...b,...v,...x,...A])]}var aT={pcb_background:0,pcb_boundary:1,pcb_panel:5,pcb_board:10,pcb_cutout:15,pcb_cutout_path:15,pcb_keepout:16,pcb_hole:18,pcb_plated_hole_drill:19,pcb_plated_hole:20,pcb_trace_soldermask:25,pcb_trace:30,pcb_smtpad:30,pcb_copper_pour:35,pcb_via:36,pcb_soldermask:40,pcb_soldermask_opening:25,pcb_soldermask_opening_layer:44,pcb_solder_paste:45,pcb_silkscreen_text:50,pcb_silkscreen_path:50,pcb_silkscreen_graphic:50,pcb_silkscreen_rect:50,pcb_silkscreen_circle:50,pcb_silkscreen_line:50,pcb_silkscreen_oval:50,pcb_silkscreen_pill:50,pcb_component:60,pcb_pad_pin_number:65,pcb_fabrication_note_text:70,pcb_fabrication_note_path:70,pcb_fabrication_note_rect:70,pcb_fabrication_note_dimension:70,pcb_note_dimension:70,pcb_note_text:70,pcb_note_rect:70,pcb_note_path:70,pcb_note_line:70,pcb_bend:70,pcb_trace_error:80,pcb_footprint_overlap_error:80,pcb_component_outside_board_error:80,pcb_pad_trace_clearance_error:80,pcb_via_trace_clearance_error:80,pcb_connector_not_in_accessible_orientation_warning:80,pcb_manual_edit_conflict_warning:80,pcb_rats_nest:85,pcb_debug_object:90},V6=100;function T5(t){return t.map((e,r)=>({object:e,index:r,layerPriority:sT(e.attributes?.["data-pcb-layer"]??void 0),typePriority:cT(e.attributes?.["data-type"]??void 0)})).sort((e,r)=>{if(e.layerPriority!==r.layerPriority)return e.layerPriority-r.layerPriority;if(e.typePriority!==r.typePriority)return e.typePriority-r.typePriority;return e.index-r.index}).map(({object:e})=>e)}function sT(t){if(!t)return 500;let e=t.toLowerCase();if(e==="global")return-100;if(e==="bottom")return 4;if(e==="board")return 2;if(e==="soldermask-top"||e==="soldermask-bottom")return 3;if(e.startsWith("inner")){let r=e.match(/\d+/);return 5+(r?Number.parseInt(r[0],10):0)}if(e==="through")return 18;if(e==="top")return 17;if(e==="drill")return 30;if(e==="overlay")return 40;return 10}function cT(t){if(!t)return V6;return aT[t]??V6}var lT=new Set(["pcb_trace","pcb_copper_pour","pcb_smtpad","pcb_plated_hole","pcb_via","pcb_copper_text"]);function pT({circuitJson:t,ctx:e,create:r}){if(!e.showSolderMask)return[];let i=[];for(let n of["bottom","top"]){if(e.layer&&e.layer!==n)continue;let o=t.filter((d)=>d.type==="pcb_soldermask_opening"&&d.layer===n);if(o.length===0)continue;let a=o.map((d)=>dT(d,e)),s=`pcb-soldermask-openings-${n}`,l={...e,layer:n,showSolderMask:!1},c=t.flatMap((d)=>lT.has(d.type)?r(d,l):[]);i.push({name:"g",type:"element",value:"",attributes:{"data-type":"pcb_soldermask_opening_layer","data-pcb-layer":n},children:[{name:"defs",type:"element",value:"",attributes:{},children:[{name:"clipPath",type:"element",value:"",attributes:{id:s,clipPathUnits:"userSpaceOnUse"},children:a}]},...a.map((d,h)=>({...d,attributes:{...d.attributes,fill:e.colorMap.substrate,"data-type":"pcb_soldermask_opening","data-pcb-layer":n,"data-pcb-soldermask-opening-id":o[h].pcb_soldermask_opening_id}})),{name:"g",type:"element",value:"",attributes:{"clip-path":`url(#${s})`},children:Y5(T5(c))}]})}return i}function dT(t,e){let{transform:r}=e,i={type:"element",value:"",children:[]};if(t.shape==="polygon")return{...i,name:"polygon",attributes:{points:t.points.map((l)=>F(r,[l.x,l.y]).join(",")).join(" ")}};let[n,o]=F(r,[t.x,t.y]);if(t.shape==="circle")return{...i,name:"circle",attributes:{cx:String(n),cy:String(o),r:String(t.radius*Math.abs(r.a))}};let a=t.width*Math.abs(r.a),s=t.height*Math.abs(r.d);return{...i,name:"rect",attributes:{x:String(n-a/2),y:String(o-s/2),width:String(a),height:String(s),...t.shape==="rotated_rect"?{transform:`rotate(${-t.ccw_rotation} ${n} ${o})`}:{}}}}var Or="TscircuitAlphabet",z6="data-tscircuit-alphabet-font";function O5(t){let e=(i)=>({...i,children:(i.children??[]).filter((n)=>!(z6 in(n.attributes??{}))).map(e)}),r=e(t);return r.children.push({name:"style",type:"element",value:"",attributes:{[z6]:"",type:"text/css"},children:[{name:"",type:"text",value:`@font-face { font-family: '${Or}'; src: url('data:font/ttf;base64,${t1}') format('truetype'); font-weight: normal; font-style: normal; }`,attributes:{},children:[]}]}),W5.stringify(r)}function hT(t,e,r){let{transform:i,shouldDrawErrors:n}=r;if(!n)return[];let{pcb_port_ids:o}=t,a=e.find((y)=>y.type==="pcb_port"&&y.pcb_port_id===o?.[0]),s=e.find((y)=>y.type==="pcb_port"&&y.pcb_port_id===o?.[1]);if(!a||!s){let _=t.message?.match(/pcb_via\[#?(pcb_via_\d+)\]/)?.[1],m=e.find((g)=>g.type==="pcb_via"&&g.pcb_via_id===_);if(m&&m.type==="pcb_via")return uT(t,m,r);if(t.center){let g=F(i,{x:t.center.x,y:t.center.y});return Cu([{name:"rect",type:"element",attributes:{x:(g.x-5).toString(),y:(g.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${g.x} ${g.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:g.x.toString(),y:(g.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:t.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}else return[]}let l=F(i,{x:a.x,y:a.y}),c=F(i,{x:s.x,y:s.y}),d={x:(l.x+c.x)/2,y:(l.y+c.y)/2};if(isNaN(l.x)||isNaN(l.y)||isNaN(c.x)||isNaN(c.y)||isNaN(d.x)||isNaN(d.y))return[];let h=[{name:"line",type:"element",attributes:{x1:l.x.toString(),y1:l.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"line",type:"element",attributes:{x1:d.x.toString(),y1:d.y.toString(),x2:c.x.toString(),y2:c.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""},{name:"rect",type:"element",attributes:{x:(d.x-5).toString(),y:(d.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${d.x} ${d.y})`},children:[],value:""},{name:"text",type:"element",attributes:{x:d.x.toString(),y:(d.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:t.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}];return Cu(h)}function uT(t,e,r){let{transform:i}=r;if(t.center&&e){let n=F(i,{x:t.center.x,y:t.center.y}),o=F(i,{x:e.x,y:e.y}),a=o.x-n.x,s=o.y-n.y,l=Math.sqrt(a*a+s*s),c=Math.atan2(s,a)*180/Math.PI,d=10,h=l+20,y=20,_=(n.x+o.x)/2,m=(n.y+o.y)/2;return Cu([{name:"rect",type:"element",attributes:{x:(_-h/2).toString(),y:(m-10).toString(),width:h.toString(),height:20 .toString(),fill:"none",stroke:"red","stroke-width":"1","stroke-dasharray":"3,2",transform:`rotate(${c} ${_} ${m})`},children:[],value:""},{name:"rect",type:"element",attributes:{x:(_-5).toString(),y:(m-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${_} ${m})`},children:[],value:""},{name:"text",type:"element",attributes:{x:_.toString(),y:(m-10-5).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:t.message||"Pcb Trace Error",name:"",attributes:{},children:[]}],value:""}])}return[]}function Cu(t){return t.map((e)=>({...e,attributes:{...e.attributes??{},"data-type":e.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":e.attributes?.["data-pcb-layer"]??"overlay"},children:(e.children??[]).map((r)=>{if(r?.type==="element")return{...r,attributes:{...r.attributes??{},"data-type":r.attributes?.["data-type"]??"pcb_trace_error","data-pcb-layer":r.attributes?.["data-pcb-layer"]??"overlay"}};return r})}))}function yT(t){return t.map((e)=>({...e,attributes:{...e.attributes??{},"data-type":e.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":e.attributes?.["data-pcb-layer"]??"overlay"},children:(e.children??[]).map((r)=>{if(r?.type==="element")return{...r,attributes:{...r.attributes??{},"data-type":r.attributes?.["data-type"]??"pcb_footprint_overlap_error","data-pcb-layer":r.attributes?.["data-pcb-layer"]??"overlay"}};return r})}))}function _T(t,e,r){let{transform:i,shouldDrawErrors:n}=r;if(!n)return[];let o=[],a=[],s=[];if(t.pcb_smtpad_ids)for(let d of t.pcb_smtpad_ids){let h=e.find((y)=>y.type==="pcb_smtpad"&&y.pcb_smtpad_id===d);if(h){if(a.push({x:h.x,y:h.y,type:"pcb_smtpad",id:d,pcb_port_id:h.pcb_port_id}),h.pcb_port_id)s.push(h.pcb_port_id)}}let l=s.length>1&&s.every((d)=>d===s[0]),c=a;if(l)c=a.filter((d)=>d.type!=="pcb_smtpad");if(t.pcb_plated_hole_ids)for(let d of t.pcb_plated_hole_ids){let h=e.find((y)=>y.type==="pcb_plated_hole"&&y.pcb_plated_hole_id===d);if(h)c.push({x:h.x,y:h.y,type:"pcb_plated_hole",id:d})}if(t.pcb_hole_ids)for(let d of t.pcb_hole_ids){let h=e.find((y)=>y.type==="pcb_hole"&&y.pcb_hole_id===d);if(h)c.push({x:h.x,y:h.y,type:"pcb_hole",id:d})}if(c.length>0){let d=c.reduce((_,m)=>_+m.x,0)/c.length,h=c.reduce((_,m)=>_+m.y,0)/c.length,y=F(i,{x:d,y:h});o.push({name:"rect",type:"element",attributes:{x:(y.x-5).toString(),y:(y.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${y.x} ${y.y})`},children:[],value:""}),o.push({name:"text",type:"element",attributes:{x:y.x.toString(),y:(y.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",value:t.message||"PCB Footprint Overlap Error",name:"",attributes:{},children:[]}],value:""});for(let _ of c){let m=F(i,{x:_.x,y:_.y});if(o.push({name:"rect",type:"element",attributes:{x:(m.x-5).toString(),y:(m.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${m.x} ${m.y})`},children:[],value:""}),c.length>1)o.push({name:"line",type:"element",attributes:{x1:y.x.toString(),y1:y.y.toString(),x2:m.x.toString(),y2:m.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2"},children:[],value:""})}}return yT(o)}function mT(t,e,r){let{transform:i,shouldDrawErrors:n}=r;if(!n)return[];let o=[],a=[];for(let d of t.pcb_component_ids){let h=e.find((y)=>y.type==="pcb_component"&&y.pcb_component_id===d);if(h)a.push(h.center)}if(a.length===0)return[];let s=a.reduce((d,h)=>d+h.x,0)/a.length,l=a.reduce((d,h)=>d+h.y,0)/a.length,c=F(i,{x:s,y:l});o.push({name:"rect",type:"element",attributes:{x:(c.x-5).toString(),y:(c.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${c.x} ${c.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""}),o.push({name:"text",type:"element",attributes:{x:c.x.toString(),y:(c.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[{type:"text",value:t.message||"PCB Courtyard Overlap",name:"",attributes:{},children:[]}],value:""});for(let d of a){let h=F(i,d);o.push({name:"rect",type:"element",attributes:{x:(h.x-5).toString(),y:(h.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${h.x} ${h.y})`,"data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}if(a.length===2){let d=a.map((_)=>F(i,_)),h=d[0],y=d[1];o.push({name:"line",type:"element",attributes:{x1:h.x.toString(),y1:h.y.toString(),x2:y.x.toString(),y2:y.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,3","data-type":"pcb_courtyard_overlap_error","data-pcb-layer":"overlay"},children:[],value:""})}return o}function fT(t){return t.map((e)=>({...e,attributes:{...e.attributes??{},"data-type":e.attributes?.["data-type"]??"pcb_component_outside_board_error","data-pcb-layer":e.attributes?.["data-pcb-layer"]??"overlay"}}))}function xT(t,e){let r=t.pcb_component_id;if(!r)return t.component_bounds??null;let i=e.find((n)=>n.type==="pcb_component"&&n.pcb_component_id===r);if(i?.center&&i?.width&&i?.height)return{min_x:i.center.x-i.width/2,max_x:i.center.x+i.width/2,min_y:i.center.y-i.height/2,max_y:i.center.y+i.height/2};return t.component_bounds??null}function gT(t,e,r){let{shouldDrawErrors:i,transform:n}=r;if(!i)return[];let o=xT(t,e);if(!o)return[];let a=F(n,{x:o.min_x,y:o.min_y}),s=F(n,{x:o.max_x,y:o.max_y}),l=Math.min(a.x,s.x),c=Math.min(a.y,s.y),d=Math.abs(s.x-a.x),h=Math.abs(s.y-a.y),y=l+d/2,_=c+h/2,m=[{type:"element",name:"rect",value:"",attributes:{x:l.toString(),y:c.toString(),width:d.toString(),height:h.toString(),fill:"none",stroke:"red","stroke-width":"1.5","stroke-dasharray":"4,2"},children:[]},{type:"element",name:"rect",value:"",attributes:{x:(y-5).toString(),y:(_-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${y} ${_})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:y.toString(),y:(c-10).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:t.message??"PCB component extends outside board boundaries",attributes:{},children:[]}]}];return fT(m)}function Tn(t){return t!==void 0&&typeof t.x==="number"&&Number.isFinite(t.x)&&typeof t.y==="number"&&Number.isFinite(t.y)}function bT(t,e){if(t.type==="pcb_via_trace_clearance_error")return e.find((r)=>r.type==="pcb_via"&&r.pcb_via_id===t.pcb_via_id);return e.find((r)=>r.type==="pcb_smtpad"&&r.pcb_smtpad_id===t.pcb_pad_id||r.type==="pcb_plated_hole"&&r.pcb_plated_hole_id===t.pcb_pad_id)}function vT(t){if(!t)return;if("x"in t&&"y"in t&&Tn(t))return{x:t.x,y:t.y};if(t.type==="pcb_smtpad"&&t.shape==="polygon"&&t.points.length>0){let e=t.points.filter(Tn);if(e.length===0)return;let r=e.map((n)=>n.x),i=e.map((n)=>n.y);return{x:(Math.min(...r)+Math.max(...r))/2,y:(Math.min(...i)+Math.max(...i))/2}}return}function wT(t){if(t.route_type==="through_pad")return[t.start,t.end].filter(Tn);let e=t;return Tn(e)?[{x:e.x,y:e.y}]:[]}function AT(t){if(!t)return;let e,r;for(let i of t.route){let n=wT(i);if(!e&&n[0])e=n[0];if(n.length>0)r=n[n.length-1]}return e&&r?{start:e,end:r}:void 0}function FT(t,e){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Bu(t,e,r){let i=t.x-e.x,n=t.y-e.y;if(i*i+n*n<0.25)return;return{type:"element",name:"line",value:"",attributes:{x1:t.x.toString(),y1:t.y.toString(),x2:e.x.toString(),y2:e.y.toString(),stroke:"red","stroke-width":"1.5","stroke-dasharray":"2,2","data-error-reference":r},children:[]}}function BT(t,e){return t.map((r)=>({...r,attributes:{...r.attributes??{},"data-type":r.attributes?.["data-type"]??e,"data-pcb-layer":r.attributes?.["data-pcb-layer"]??"overlay"}}))}function ST(t,e,r){let{shouldDrawErrors:i,transform:n}=r;if(!i)return[];let o=vT(bT(t,e)),a=e.find((x)=>x.type==="pcb_trace"&&x.pcb_trace_id===t.pcb_trace_id),s=AT(a),l=Tn(t.center)?t.center:o??(s?FT(s.start,s.end):void 0);if(!l)return[];let c=F(n,l),d=o?F(n,o):void 0,h=s?{start:F(n,s.start),end:F(n,s.end)}:void 0,y=[h?Bu(h.start,c,"trace-start"):void 0,h?Bu(h.end,c,"trace-end"):void 0,d?Bu(d,c,"obstacle"):void 0].filter((x)=>x!==void 0),_=t.type==="pcb_pad_trace_clearance_error"?"Pad/trace":"Via/trace",{actual_clearance:m,minimum_clearance:g}=t,b=m!==void 0&&g!==void 0?`${_} clearance ${m} is below minimum ${g}`:t.type==="pcb_pad_trace_clearance_error"?"Pad and trace too close":"Via and trace too close",v=t.message??b,k=[...y,{type:"element",name:"rect",value:"",attributes:{x:(c.x-5).toString(),y:(c.y-5).toString(),width:"10",height:"10",fill:"red",transform:`rotate(45 ${c.x} ${c.y})`},children:[]},{type:"element",name:"text",value:"",attributes:{x:c.x.toString(),y:(c.y-15).toString(),fill:"red","font-family":"sans-serif","font-size":"12","text-anchor":"middle"},children:[{type:"text",name:"",value:v,attributes:{},children:[]}]}];return BT(k,t.type)}function kT(t,e){let{transform:r}=e;if(!Array.isArray(t.route)||t.route.length<2)return[];let i=t.route[0],n=t.route[t.route.length-1],o=i.x===n.x&&i.y===n.y,a=t.route.slice(0,o?-1:void 0).map((d,h)=>{let[y,_]=F(r,[d.x,d.y]);return h===0?`M ${y} ${_}`:`L ${y} ${_}`}).join(" ")+(o||t.is_filled?" Z":""),s=t.color||"rgba(255,255,255,0.5)",l=s,c;if(t.is_filled&&t.has_stroke!==!1&&t.stroke_width>0)try{let d=sn(s);if(d.alpha()<1)l=d.alpha(1).rgb().string(),c=d.alpha().toString()}catch{}return[{name:"path",type:"element",attributes:{class:"pcb-fabrication-note-path",stroke:t.has_stroke===!1?"none":l,fill:t.is_filled?l:"none",d:a,...c===void 0?{}:{opacity:c},"stroke-width":(t.stroke_width*Math.abs(r.a)).toString(),"data-pcb-component-id":t.pcb_component_id,"data-pcb-fabrication-note-path-id":t.pcb_fabrication_note_path_id,"data-type":"pcb_fabrication_note_path","data-pcb-layer":"overlay"},value:"",children:[]}]}var R5=j5.default("circuit-to-svg"),Zt=R5.extend("pcb"),VU=R5.extend("sch");function C5(t){switch(t){case"top_left":return{textAnchor:"start",dominantBaseline:"text-before-edge"};case"top_center":return{textAnchor:"middle",dominantBaseline:"text-before-edge"};case"top_right":return{textAnchor:"end",dominantBaseline:"text-before-edge"};case"center_left":return{textAnchor:"start",dominantBaseline:"central"};case"center_right":return{textAnchor:"end",dominantBaseline:"central"};case"bottom_left":return{textAnchor:"start",dominantBaseline:"text-after-edge"};case"bottom_center":return{textAnchor:"middle",dominantBaseline:"text-after-edge"};case"bottom_right":return{textAnchor:"end",dominantBaseline:"text-after-edge"};case"center":default:return{textAnchor:"middle",dominantBaseline:"central"}}}function YT(t,e){let{transform:r,layer:i}=e,{anchor_position:n,anchor_alignment:o="center",text:a,font_size:s=1,layer:l="top",color:c,ccw_rotation:d=0}=t;if(i&&l!==i)return[];if(!n||typeof n.x!=="number"||typeof n.y!=="number")return Zt(`[pcb_fabrication_note_text] Invalid anchor_position for "${t.pcb_fabrication_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(n)}`),[];let[h,y]=F(r,[n.x,n.y]),_=s*Math.abs(r.a),{textAnchor:m,dominantBaseline:g}=C5(o),b=Ft(Yt(h,y),Gt(-d*Math.PI/180));return[{name:"text",type:"element",attributes:{x:"0",y:"0","font-family":Or,"font-size":_.toString(),"text-anchor":m,"dominant-baseline":g,transform:oe(b),class:"pcb-fabrication-note-text",fill:c||"rgba(255,255,255,0.5)","data-type":"pcb_fabrication_note_text","data-pcb-layer":"overlay"},children:[{type:"text",value:a,name:"",attributes:{},children:[]}],value:""}]}var MT="rgba(255,255,255,0.5)",IT="rgba(255,255,255,0.2)";function LT(t,e){let{transform:r,layer:i}=e,{center:n,width:o,height:a,stroke_width:s,is_filled:l,has_stroke:c,is_stroke_dashed:d,color:h,layer:y="top",pcb_component_id:_,pcb_fabrication_note_rect_id:m,corner_radius:g}=t;if(i&&y!==i)return[];if(!n||typeof n.x!=="number"||typeof n.y!=="number"||typeof o!=="number"||typeof a!=="number")return Zt(`[pcb_fabrication_note_rect] Invalid data for "${m}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(n)}, width=${JSON.stringify(o)}, height=${JSON.stringify(a)}`),[];let b=o/2,v=a/2,[k,x]=F(r,[n.x-b,n.y+v]),[A,S]=F(r,[n.x+b,n.y-v]),E=Math.min(k,A),I=Math.min(x,S),T=Math.abs(A-k),P=Math.abs(S-x),D=(typeof s==="number"?s:0)*Math.abs(r.a),N=h??MT,G=typeof g==="number"&&g>0?g:0,K=G*Math.abs(r.a),vt=G*Math.abs(r.d),H={x:E.toString(),y:I.toString(),width:T.toString(),height:P.toString(),class:"pcb-fabrication-note-rect","data-type":"pcb_fabrication_note_rect","data-pcb-fabrication-note-rect-id":m,"data-pcb-layer":"overlay"};if(_!==void 0)H["data-pcb-component-id"]=_;if(K>0)H.rx=K.toString();if(vt>0)H.ry=vt.toString();if(l)H.fill=h??IT;else H.fill="none";if(c??D>0){if(H.stroke=N,H["stroke-width"]=D.toString(),d){let et=0.2*Math.abs(r.a),Q=0.1*Math.abs(r.a);H["stroke-dasharray"]=`${et} ${Q}`}}else H.stroke="none";return[{name:"rect",type:"element",value:"",attributes:H,children:[]}]}function Su(t){let e=Math.hypot(t.x,t.y)||1;return{x:t.x/e,y:t.y/e}}var ET=1.5,PT=0.6,TT=0.3;function D6(t){return t.map((e,r)=>r===0?`M ${e.x} ${e.y}`:`L ${e.x} ${e.y}`).join(" ")}function WT(t,e){let{transform:r,layer:i}=e,{from:n,to:o,text:a,font_size:s=1,color:l,arrow_size:c,layer:d,pcb_component_id:h,pcb_fabrication_note_dimension_id:y,offset_distance:_,offset_direction:m,text_ccw_rotation:g}=t;if(i&&d&&d!==i)return[];if(!n||!o||typeof n!=="object"||typeof o!=="object")return Zt(`[pcb_fabrication_note_dimension] Invalid endpoints for "${y}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(n)}, to=${JSON.stringify(o)}`),[];if(typeof n.x!=="number"||typeof n.y!=="number"||typeof o.x!=="number"||typeof o.y!=="number")return Zt(`[pcb_fabrication_note_dimension] Invalid point values for "${y}": x and y must be numbers, got from=${JSON.stringify(n)}, to=${JSON.stringify(o)}`),[];let b=typeof c==="number"?c:void 0;if(b===void 0||!Number.isFinite(b)||b<=0)return Zt(`[pcb_fabrication_note_dimension] Invalid arrow_size for "${y}": expected positive number, got ${JSON.stringify(c)}`),[];let v=b,k=Su({x:o.x-n.x,y:o.y-n.y});if(Number.isNaN(k.x)||Number.isNaN(k.y))return[];let x={x:-k.y,y:k.x},A=m&&typeof m.x==="number"&&typeof m.y==="number",S=A?Su({x:m.x,y:m.y}):{x:0,y:0},E=typeof _==="number"?_:0,I={x:S.x*E,y:S.y*E},T=(Nt)=>({x:Nt.x+I.x,y:Nt.y+I.y}),P=T(n),O=T(o),D=v/2,N={x:P.x+k.x*v,y:P.y+k.y*v},G={x:O.x-k.x*v,y:O.y-k.y*v},K=[ce(P),ce({x:N.x+x.x*D,y:N.y+x.y*D}),ce({x:N.x-x.x*D,y:N.y-x.y*D})],vt=[ce(O),ce({x:G.x+x.x*D,y:G.y+x.y*D}),ce({x:G.x-x.x*D,y:G.y-x.y*D})],[H,ht]=F(r,[N.x,N.y]),[wt,et]=F(r,[G.x,G.y]),Q=v/5*Math.abs(r.a),V=l||"rgba(255,255,255,0.5)",tt=A&&(Math.abs(S.x)>Number.EPSILON||Math.abs(S.y)>Number.EPSILON)?S:x,C=E+v,ot=(Nt)=>{let ke={x:Nt.x+tt.x*C,y:Nt.y+tt.y*C},[jr,bc]=F(r,[Nt.x,Nt.y]),[vc,wc]=F(r,[ke.x,ke.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${jr} ${bc} L ${vc} ${wc}`,stroke:V,fill:"none","stroke-width":Q.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-extension"},children:[]}},it=[ot(n),ot(o)],lt={x:(n.x+o.x)/2+I.x,y:(n.y+o.y)/2+I.y},[mt,pt]=F(r,[P.x,P.y]),[xt,dt]=F(r,[O.x,O.y]),Lt=Su({x:xt-mt,y:dt-pt}),at=Math.atan2(Lt.y,Lt.x)*180/Math.PI;if(at>90||at<-90)at+=180;let U=typeof g==="number"&&Number.isFinite(g)?at-g:at,Bt=0;if(a&&typeof g==="number"&&Number.isFinite(g)){let Nt=a.length*s*PT,ke=s,jr=g*Math.PI/180,bc=Math.abs(Math.sin(jr)),vc=Math.abs(Math.cos(jr)),wc=Nt/2,v3=ke/2;Bt=wc*bc+v3*vc+s*TT}let Pt=v*ET+Bt,yt={x:lt.x+x.x*Pt,y:lt.y+x.y*Pt},[Jt,Dt]=F(r,[yt.x,yt.y]),Ct=s*Math.abs(r.a),ir=[...it,{name:"path",type:"element",value:"",attributes:{d:`M ${H} ${ht} L ${wt} ${et}`,stroke:V,fill:"none","stroke-width":Q.toString(),"stroke-linecap":"round",class:"pcb-fabrication-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${D6(K)} Z`,fill:V,class:"pcb-fabrication-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${D6(vt)} Z`,fill:V,class:"pcb-fabrication-note-dimension-arrow"},children:[]}];if(a)ir.push({name:"text",type:"element",value:"",attributes:{x:Jt.toString(),y:Dt.toString(),fill:V,"font-size":Ct.toString(),"font-family":Or,"text-anchor":"middle","dominant-baseline":"central",class:"pcb-fabrication-note-dimension-text",transform:`rotate(${U} ${Jt} ${Dt})`},children:[{type:"text",name:"",value:a,attributes:{},children:[]}]});let kt={class:"pcb-fabrication-note-dimension","data-type":"pcb_fabrication_note_dimension","data-pcb-fabrication-note-dimension-id":y,"data-pcb-layer":d??"overlay"};if(h!==void 0)kt["data-pcb-component-id"]=h;return[{name:"g",type:"element",value:"",attributes:kt,children:ir}];function ce(Nt){let[ke,jr]=F(r,[Nt.x,Nt.y]);return{x:ke,y:jr}}}var re={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(255, 38, 226)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(232, 178, 167)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},meta:{filename:"kicad_2020",name:"KiCad 2020",version:2},simulation_palette:["#1f77b4","#d62728","#2ca02c","#ff7f0e","#9467bd","#17becf","#8c564b","#e377c2","#7f7f7f","#bcbd22"],palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{aux_items:"rgb(46, 46, 46)",background:"rgb(245, 241, 237)",brightened:"rgb(255, 0, 255)",bus:"rgb(0, 0, 132)",bus_junction:"rgb(0, 0, 132)",component_body:"rgb(255, 255, 194)",component_outline:"rgb(132, 0, 0)",cursor:"rgb(15, 15, 15)",erc_error:"rgba(230, 9, 13, 0.800)",erc_warning:"rgba(209, 146, 0, 0.800)",fields:"rgb(132, 0, 132)",grid:"rgb(181, 181, 181)",grid_axes:"rgb(0, 0, 132)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 150, 0)",label_global:"rgb(132, 0, 0)",label_background:"rgba(255, 255, 255, 0.6)",label_hier:"rgb(114, 86, 0)",label_local:"rgb(15, 15, 15)",net_name:"rgb(132, 132, 132)",no_connect:"rgb(132, 0, 0)",note:"rgb(0, 0, 194)",override_item_colors:!1,pin:"rgb(132, 0, 0)",pin_name:"rgb(0, 100, 100)",pin_number:"rgb(169, 0, 0)",reference:"rgb(0, 100, 100)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(132, 0, 0)",sheet_background:"rgba(253, 255, 231, 0.000)",sheet_fields:"rgb(132, 0, 132)",sheet_filename:"rgb(114, 86, 0)",sheet_label:"rgb(0, 100, 100)",sheet_name:"rgb(0, 100, 100)",table:"rgb(102, 102, 102)",value:"rgb(0, 100, 100)",wire:"rgb(0, 150, 0)",wire_crossing:"rgb(30, 180, 30)",worksheet:"rgb(132, 0, 0)"}};function ku(t){let e=Math.hypot(t.x,t.y)||1;return{x:t.x/e,y:t.y/e}}function Q6(t){return t.map((e,r)=>r===0?`M ${e.x} ${e.y}`:`L ${e.x} ${e.y}`).join(" ")}function OT(t,e){let{transform:r}=e,{from:i,to:n,text:o,font_size:a=1,color:s,arrow_size:l,offset_distance:c,offset_direction:d,text_ccw_rotation:h}=t;if(!i||!n)return Zt(`[pcb_note_dimension] Invalid endpoints for "${t.pcb_note_dimension_id}": expected {from: {x, y}, to: {x, y}}, got from=${JSON.stringify(i)}, to=${JSON.stringify(n)}`),[];if(!Number.isFinite(l)||l<=0)return Zt(`[pcb_note_dimension] Invalid arrow_size for "${t.pcb_note_dimension_id}": expected positive number, got ${JSON.stringify(l)}`),[];let y=ku({x:n.x-i.x,y:n.y-i.y});if(Number.isNaN(y.x)||Number.isNaN(y.y))return[];let _={x:-y.y,y:y.x},m=d&&typeof d.x==="number"&&typeof d.y==="number",g=m?ku({x:d.x,y:d.y}):{x:0,y:0},b=typeof c==="number"?c:0,v={x:g.x*b,y:g.y*b},k=(yt)=>({x:yt.x+v.x,y:yt.y+v.y}),x=k(i),A=k(n),S=l/2,E={x:x.x+y.x*l,y:x.y+y.y*l},I={x:A.x-y.x*l,y:A.y-y.y*l},T=[Pt(x),Pt({x:E.x+_.x*S,y:E.y+_.y*S}),Pt({x:E.x-_.x*S,y:E.y-_.y*S})],P=[Pt(A),Pt({x:I.x+_.x*S,y:I.y+_.y*S}),Pt({x:I.x-_.x*S,y:I.y-_.y*S})],[O,D]=F(r,[E.x,E.y]),[N,G]=F(r,[I.x,I.y]),K=l/5*Math.abs(r.a),vt=s||re.board.user_2,H=m&&(Math.abs(g.x)>Number.EPSILON||Math.abs(g.y)>Number.EPSILON)?g:_,ht=b+l,wt=(yt)=>{let Jt={x:yt.x+H.x*ht,y:yt.y+H.y*ht},[Dt,Ct]=F(r,[yt.x,yt.y]),[ir,kt]=F(r,[Jt.x,Jt.y]);return{name:"path",type:"element",value:"",attributes:{d:`M ${Dt} ${Ct} L ${ir} ${kt}`,stroke:vt,fill:"none","stroke-width":K.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-extension"},children:[]}},et=[wt(i),wt(n)],Q={x:(i.x+n.x)/2+v.x,y:(i.y+n.y)/2+v.y},[V,tt]=F(r,[x.x,x.y]),[C,ot]=F(r,[A.x,A.y]),it=ku({x:C-V,y:ot-tt}),lt=Math.atan2(it.y,it.x)*180/Math.PI;if(lt>90||lt<-90)lt+=180;let mt=typeof h==="number"&&Number.isFinite(h)?lt-h:lt,pt=0;if(o&&typeof h==="number"&&Number.isFinite(h)){let yt=o.length*a*0.6,Jt=a,Dt=h*Math.PI/180,Ct=Math.abs(Math.sin(Dt)),ir=Math.abs(Math.cos(Dt)),kt=yt/2,ce=Jt/2;pt=kt*Ct+ce*ir+a*0.3}let xt=l*1.5+pt,dt={x:Q.x+_.x*xt,y:Q.y+_.y*xt},[Lt,at]=F(r,[dt.x,dt.y]),U=a*Math.abs(r.a),Bt=[...et,{name:"path",type:"element",value:"",attributes:{d:`M ${O} ${D} L ${N} ${G}`,stroke:vt,fill:"none","stroke-width":K.toString(),"stroke-linecap":"round",class:"pcb-note-dimension-line"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${Q6(T)} Z`,fill:vt,class:"pcb-note-dimension-arrow"},children:[]},{name:"path",type:"element",value:"",attributes:{d:`${Q6(P)} Z`,fill:vt,class:"pcb-note-dimension-arrow"},children:[]}];if(o)Bt.push({name:"text",type:"element",value:"",attributes:{x:Lt.toString(),y:at.toString(),fill:vt,"font-size":U.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":"central",class:"pcb-note-dimension-text",transform:`rotate(${mt} ${Lt} ${at})`},children:[{type:"text",name:"",value:o,attributes:{},children:[]}]});return[{name:"g",type:"element",value:"",attributes:{class:"pcb-note-dimension","data-type":"pcb_note_dimension","data-pcb-note-dimension-id":t.pcb_note_dimension_id,"data-pcb-layer":"overlay"},children:Bt}];function Pt(yt){let[Jt,Dt]=F(r,[yt.x,yt.y]);return{x:Jt,y:Dt}}}var jT=re.board.user_2;function RT(t,e){let{transform:r}=e,{anchor_position:i,text:n,font_size:o=1,anchor_alignment:a="center",color:s}=t;if(!i||typeof i.x!=="number"||typeof i.y!=="number")return Zt(`[pcb_note_text] Invalid anchor_position for "${t.pcb_note_text_id}": expected {x: number, y: number}, got ${JSON.stringify(i)}`),[];if(typeof n!=="string"||n.length===0)return Zt(`[pcb_note_text] Invalid text for "${t.pcb_note_text_id}": expected non-empty string, got ${JSON.stringify(n)}`),[];let[l,c]=F(r,[i.x,i.y]),d=o*Math.abs(r.a),{textAnchor:h,dominantBaseline:y}=C5(a),_=n.split(`
`),m=_.length===1?[{type:"text",name:"",value:n,attributes:{},children:[]}]:_.map((b,v)=>({type:"element",name:"tspan",value:"",attributes:{x:l.toString(),...v>0?{dy:"1em"}:{}},children:[{type:"text",name:"",value:b,attributes:{},children:[]}]}));return[{name:"text",type:"element",value:"",attributes:{x:l.toString(),y:c.toString(),fill:s??jT,"font-family":Or,"font-size":d.toString(),"text-anchor":h,"dominant-baseline":y,class:"pcb-note-text","data-type":"pcb_note_text","data-pcb-note-text-id":t.pcb_note_text_id,"data-pcb-layer":"overlay"},children:m}]}var CT=re.board.user_2,XT=re.board.user_2;function $T(t,e){let{transform:r}=e,{center:i,width:n,height:o,stroke_width:a,is_filled:s,has_stroke:l,is_stroke_dashed:c,color:d,corner_radius:h}=t;if(!i||typeof i.x!=="number"||typeof i.y!=="number"||typeof n!=="number"||typeof o!=="number")return Zt(`[pcb_note_rect] Invalid data for "${t.pcb_note_rect_id}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(i)}, width=${JSON.stringify(n)}, height=${JSON.stringify(o)}`),[];let y=n/2,_=o/2,[m,g]=F(r,[i.x-y,i.y+_]),[b,v]=F(r,[i.x+y,i.y-_]),k=Math.min(m,b),x=Math.min(g,v),A=Math.abs(b-m),S=Math.abs(v-g),I=(typeof a==="number"?a:0)*Math.abs(r.a),T=typeof h==="number"&&h>0?h:0,P=T*Math.abs(r.a),O=T*Math.abs(r.d),D=d??CT,N={x:k.toString(),y:x.toString(),width:A.toString(),height:S.toString(),class:"pcb-note-rect","data-type":"pcb_note_rect","data-pcb-note-rect-id":t.pcb_note_rect_id,"data-pcb-layer":"overlay"};if(P>0)N.rx=P.toString();if(O>0)N.ry=O.toString();if(s)N.fill=d??XT;else N.fill="none";if(l??I>0){if(N.stroke=D,N["stroke-width"]=I.toString(),c){let vt=0.2*Math.abs(r.a),H=0.1*Math.abs(r.a);N["stroke-dasharray"]=`${vt} ${H}`}}else N.stroke="none";return[{name:"rect",type:"element",value:"",attributes:N,children:[]}]}var NT=re.board.user_2;function VT(t,e){let{transform:r}=e;if(!Array.isArray(t.route)||t.route.length===0)return Zt(`[pcb_note_path] Invalid route for "${t.pcb_note_path_id}": expected non-empty array of points, got ${JSON.stringify(t.route)}`),[];for(let a of t.route)if(typeof a.x!=="number"||typeof a.y!=="number")return Zt(`[pcb_note_path] Invalid point in route for "${t.pcb_note_path_id}": expected {x: number, y: number}, got ${JSON.stringify(a)}`),[];let i=t.route.map((a,s)=>{let[l,c]=F(r,[a.x,a.y]);return s===0?`M ${l} ${c}`:`L ${l} ${c}`}).join(" "),n=t.stroke_width*Math.abs(r.a);return[{name:"path",type:"element",value:"",attributes:{d:i,stroke:t.color??NT,fill:"none","stroke-width":n.toString(),class:"pcb-note-path","data-type":"pcb_note_path","data-pcb-note-path-id":t.pcb_note_path_id,"data-pcb-layer":"overlay"},children:[]}]}var zT=re.board.user_2;function DT(t,e){let{transform:r}=e,{x1:i,y1:n,x2:o,y2:a,stroke_width:s,color:l,is_dashed:c}=t;if(typeof i!=="number"||typeof n!=="number"||typeof o!=="number"||typeof a!=="number")return Zt(`[pcb_note_line] Invalid coordinates for "${t.pcb_note_line_id}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(i)}, y1=${JSON.stringify(n)}, x2=${JSON.stringify(o)}, y2=${JSON.stringify(a)}`),[];let[d,h]=F(r,[i,n]),[y,_]=F(r,[o,a]),g=(typeof s==="number"?s:0)*Math.abs(r.a),b={x1:d.toString(),y1:h.toString(),x2:y.toString(),y2:_.toString(),stroke:l??zT,"stroke-width":g.toString(),"stroke-linecap":"round",class:"pcb-note-line","data-type":"pcb_note_line","data-pcb-note-line-id":t.pcb_note_line_id,"data-pcb-layer":"overlay"};if(c){let k=0.2*Math.abs(r.a),x=0.1*Math.abs(r.a);b["stroke-dasharray"]=`${k} ${x}`}return[{name:"line",type:"element",value:"",attributes:b,children:[]}]}var X5="BEND LINE",QT=Array.from(X5).reduce((t,e)=>t+(s1[e]??c1.spaceWidthRatio),0);function UT(t,e){let r=e.boardOwnerMap?.get(t.pcb_board_id);if(!r)return[];let[i,n]=F(e.transform,[r.center.x+t.start.x,r.center.y+t.start.y]),[o,a]=F(e.transform,[r.center.x+t.end.x,r.center.y+t.end.y]),s=Math.abs(e.transform.a),l=Math.hypot(o-i,a-n),c=Math.min(0.5*s,l*0.8/QT),d=Math.atan2(a-n,o-i);if(d>=Math.PI/2)d-=Math.PI;if(d<-Math.PI/2)d+=Math.PI;let h=Ft(Yt((i+o)/2,(n+a)/2),Gt(d));return[{name:"line",type:"element",value:"",attributes:{x1:i.toString(),y1:n.toString(),x2:o.toString(),y2:a.toString(),stroke:"#ffd54f","stroke-width":(0.15*s).toString(),"stroke-dasharray":`${0.75*s} ${0.4*s}`,"stroke-linecap":"butt",class:"pcb-bend-line","data-type":"pcb_bend","data-pcb-bend-id":t.pcb_bend_id,"data-pcb-board-id":t.pcb_board_id,"data-pcb-layer":"overlay"},children:[{name:"title",type:"element",value:"",attributes:{},children:[{name:"",type:"text",value:`${t.name??t.pcb_bend_id}: ${t.bend_angle}°, radius ${t.bend_radius} mm`,attributes:{},children:[]}]}]},...l>0?[{name:"text",type:"element",value:"",attributes:{x:"0",y:(-(c*0.6+0.2*s)).toString(),fill:"#ffd54f","font-family":Or,"font-size":c.toString(),"text-anchor":"middle","dominant-baseline":"central",transform:oe(h),class:"pcb-bend-line-label","data-type":"pcb_bend","data-pcb-bend-id":t.pcb_bend_id,"data-pcb-board-id":t.pcb_board_id,"data-pcb-layer":"overlay"},children:[{name:"",type:"text",value:X5,attributes:{},children:[]}]}]:[]]}function ZT(t,e){let{transform:r,colorMap:i,showSolderMask:n}=e,[o,a]=F(r,[t.x,t.y]),s=L5(t,e.circuitJson),l=Array.isArray(t.layers)&&t.layers[0]||t.layer||"top",c=l,d=Boolean(t.is_covered_with_solder_mask),h=(t.soldermask_margin??0)*Math.abs(r.a),y=n&&d&&h!==0,_=i.soldermaskWithCopperUnderneath.top;if(t.shape==="pill"){let m=t.outer_width*Math.abs(r.a),g=t.outer_height*Math.abs(r.a),b=t.hole_width*Math.abs(r.a),v=t.hole_height*Math.abs(r.a),k=t.ccw_rotation||0,x=k?`translate(${o} ${a}) rotate(${-k})`:`translate(${o} ${a})`,A=k?`translate(${o} ${a}) rotate(${-k})`:`translate(${o} ${a})`,S=(I,T)=>{if(I>T){let P=T/2,O=I-2*P;return`M${-I/2+P},${-P} h${O} a${P},${P} 0 0 1 0,${T} h${-O} a${P},${P} 0 0 1 0,${-T} z`}else if(T>I){let P=I/2,O=T-2*P;return`M${P},${-T/2+P} v${O} a${P},${P} 0 0 1 ${-I},0 v${-O} a${P},${P} 0 0 1 ${I},0 z`}else{let P=I/2;return`M${-P},0 a${P},${P} 0 0 1 ${I},0 a${P},${P} 0 0 1 ${-I},0 z`}},E=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer",fill:i.copper.top,d:S(m,g),transform:x,"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,d:S(b,v),transform:A,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(y){let I=m+2*h,T=g+2*h;if(h<0)E=[{name:"path",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,d:S(m,g),transform:x,"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"path",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:i.copper.top,d:S(I,T),transform:x,"data-type":"pcb_soldermask","data-pcb-layer":c},value:"",children:[]},E[1]];else E.unshift({name:"path",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,d:S(I,T),transform:x,"data-type":"pcb_soldermask_opening","data-pcb-layer":c},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...s},children:E,value:""}]}if(t.shape==="oval"){let m=t.outer_width*Math.abs(r.a),g=t.outer_height*Math.abs(r.a),b=t.hole_width*Math.abs(r.a),v=t.hole_height*Math.abs(r.a),k=t.ccw_rotation||0,x=k?`translate(${o} ${a}) rotate(${-k})`:`translate(${o} ${a})`,A=[{name:"ellipse",type:"element",attributes:{class:"pcb-hole-outer",fill:i.copper.top,cx:"0",cy:"0",rx:(m/2).toString(),ry:(g/2).toString(),transform:x,"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,cx:"0",cy:"0",rx:(b/2).toString(),ry:(v/2).toString(),transform:x,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...s},children:A,value:""}]}if(t.shape==="circle"){let m=t.outer_diameter*Math.abs(r.a),g=t.outer_diameter*Math.abs(r.a),b=t.hole_diameter*Math.abs(r.a),v=t.hole_diameter*Math.abs(r.a),k=Math.min(m,g)/2,x=Math.min(b,v)/2,A=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer",fill:i.copper.top,cx:o.toString(),cy:a.toString(),r:k.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,cx:o.toString(),cy:a.toString(),r:x.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(y){let S=k+h;if(h<0)A=[{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,cx:o.toString(),cy:a.toString(),r:k.toString(),"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:i.copper.top,cx:o.toString(),cy:a.toString(),r:S.toString(),"data-type":"pcb_soldermask","data-pcb-layer":c},value:"",children:[]},A[1]];else A.unshift({name:"circle",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,cx:o.toString(),cy:a.toString(),r:S.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":c},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...s},children:A,value:""}]}if(t.shape==="circular_hole_with_rect_pad"){let m=t,g=t.hole_diameter*Math.abs(r.a),b=t.rect_pad_width*Math.abs(r.a),v=t.rect_pad_height*Math.abs(r.a),k=(t.rect_border_radius??0)*Math.abs(r.a),x=t.rect_ccw_rotation??0,A=m.rect_ccw_rotation??0,S=A?`translate(${o} ${a}) rotate(${-A})`:void 0,E=A?(-b/2).toString():(o-b/2).toString(),I=A?(-v/2).toString():(a-v/2).toString(),T=g/2,[P,O]=F(r,[m.x+(m.hole_offset_x??0),m.y+(m.hole_offset_y??0)]),D=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:i.copper.top,...x?{x:(-b/2).toString(),y:(-v/2).toString(),transform:`translate(${o} ${a}) rotate(${-x})`}:{x:(o-b/2).toString(),y:(a-v/2).toString()},width:b.toString(),height:v.toString(),...S?{transform:S}:{},...k?{rx:k.toString(),ry:k.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,cx:P.toString(),cy:O.toString(),r:T.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(y){let N=b+2*h,G=v+2*h,K=k+h;if(h<0)D=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,...x?{x:(-b/2).toString(),y:(-v/2).toString(),transform:`translate(${o} ${a}) rotate(${-x})`}:{x:(o-b/2).toString(),y:(a-v/2).toString()},width:b.toString(),height:v.toString(),...S?{transform:S}:{},...k?{rx:k.toString(),ry:k.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:i.copper.top,...x?{x:(-N/2).toString(),y:(-G/2).toString(),transform:`translate(${o} ${a}) rotate(${-x})`}:{x:(o-N/2).toString(),y:(a-G/2).toString()},width:N.toString(),height:G.toString(),...S?{transform:S}:{},...K>0?{rx:K.toString(),ry:K.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":c},value:"",children:[]},D[1]];else D.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,...x?{x:(-N/2).toString(),y:(-G/2).toString(),transform:`translate(${o} ${a}) rotate(${-x})`}:{x:(o-N/2).toString(),y:(a-G/2).toString()},width:N.toString(),height:G.toString(),...S?{transform:S}:{},...k?{rx:K.toString(),ry:K.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":c},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...s},children:D,value:""}]}if(t.shape==="pill_hole_with_rect_pad"){let m=t,g=m.rect_pad_width*Math.abs(r.a),b=m.rect_pad_height*Math.abs(r.a),v=(m.rect_border_radius??0)*Math.abs(r.a),k=m.hole_height*Math.abs(r.a),x=m.hole_width*Math.abs(r.a),A=m,S=A.hole_offset_x??0,E=A.hole_offset_y??0,[I,T]=F(r,[m.x+S,m.y+E]),P=Math.min(k,x)/2,O=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:i.copper.top,x:(o-g/2).toString(),y:(a-b/2).toString(),width:g.toString(),height:b.toString(),...v?{rx:v.toString(),ry:v.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,x:(I-x/2).toString(),y:(T-k/2).toString(),width:x.toString(),height:k.toString(),rx:P.toString(),ry:P.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(y){let D=g+2*h,N=b+2*h,G=v+h;if(h<0)O=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(o-g/2).toString(),y:(a-b/2).toString(),width:g.toString(),height:b.toString(),...v?{rx:v.toString(),ry:v.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:i.copper.top,x:(o-D/2).toString(),y:(a-N/2).toString(),width:D.toString(),height:N.toString(),...G>0?{rx:G.toString(),ry:G.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":c},value:"",children:[]},O[1]];else O.unshift({name:"rect",type:"element",attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,x:(o-D/2).toString(),y:(a-N/2).toString(),width:D.toString(),height:N.toString(),...v?{rx:G.toString(),ry:G.toString()}:{},"data-type":"pcb_soldermask_opening","data-pcb-layer":c},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...s},children:O,value:""}]}if(t.shape==="rotated_pill_hole_with_rect_pad"){let m=t,g=m.rect_pad_width*Math.abs(r.a),b=m.rect_pad_height*Math.abs(r.a),v=(m.rect_border_radius??0)*Math.abs(r.a),k=m.hole_height*Math.abs(r.a),x=m.hole_width*Math.abs(r.a),A=m,S=A.hole_offset_x??0,E=A.hole_offset_y??0,[I,T]=F(r,[m.x+S,m.y+E]),P=Math.min(k,x)/2,O=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:i.copper.top,x:(-g/2).toString(),y:(-b/2).toString(),width:g.toString(),height:b.toString(),transform:`translate(${o} ${a}) rotate(${-m.rect_ccw_rotation})`,...v?{rx:v.toString(),ry:v.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,x:(-x/2).toString(),y:(-k/2).toString(),width:x.toString(),height:k.toString(),rx:P.toString(),ry:P.toString(),transform:`translate(${I} ${T}) rotate(${-m.hole_ccw_rotation})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}];if(y){let D=g+2*h,N=b+2*h,G=v+h;if(h<0)O=[{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-covered",fill:_,x:(-g/2).toString(),y:(-b/2).toString(),width:g.toString(),height:b.toString(),transform:`translate(${o} ${a}) rotate(${-m.rect_ccw_rotation})`,...v?{rx:v.toString(),ry:v.toString()}:{},"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},{name:"rect",type:"element",attributes:{class:"pcb-hole-outer-exposed",fill:i.copper.top,x:(-D/2).toString(),y:(-N/2).toString(),width:D.toString(),height:N.toString(),transform:`translate(${o} ${a}) rotate(${-m.rect_ccw_rotation})`,...G>0?{rx:G.toString(),ry:G.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":c},value:"",children:[]},O[1]];else O.push({name:"rect",type:"element",attributes:{class:"pcb-solder-mask",fill:_,x:(-D/2).toString(),y:(-N/2).toString(),width:D.toString(),height:N.toString(),transform:`translate(${o} ${a}) rotate(${-m.rect_ccw_rotation})`,...v?{rx:G.toString(),ry:G.toString()}:{},"data-type":"pcb_soldermask","data-pcb-layer":c},value:"",children:[]})}return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...s},children:O,value:""}]}if(t.shape==="hole_with_polygon_pad"){let m=t,g=m.pad_outline||[],b=m.x??0,v=m.y??0,x=g.map((I)=>F(r,[b+I.x,v+I.y])).map((I)=>I.join(",")).join(" "),[A,S]=F(r,[b+m.hole_offset_x,v+m.hole_offset_y]),E=()=>{if(m.hole_shape==="circle"){let T=(m.hole_diameter??0)*Math.abs(r.a)/2;return{name:"circle",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,cx:A.toString(),cy:S.toString(),r:T.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(m.hole_shape==="oval"){let I=(m.hole_width??0)*Math.abs(r.a),T=(m.hole_height??0)*Math.abs(r.a),P=I/2,O=T/2;return{name:"ellipse",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,cx:A.toString(),cy:S.toString(),rx:P.toString(),ry:O.toString(),"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}if(m.hole_shape==="pill"||m.hole_shape==="rotated_pill"){let I=(m.hole_width??0)*Math.abs(r.a),T=(m.hole_height??0)*Math.abs(r.a),P=I>T,O=Math.min(I,T)/2,D=Math.abs(P?I-T:T-I),N=P?`M${-D/2},${-O} h${D} a${O},${O} 0 0 1 0,${T} h-${D} a${O},${O} 0 0 1 0,-${T} z`:`M${-O},${-D/2} v${D} a${O},${O} 0 0 0 ${I},0 v-${D} a${O},${O} 0 0 0 -${I},0 z`;return{name:"path",type:"element",attributes:{class:"pcb-hole-inner",fill:i.drill,d:N,transform:`translate(${A} ${S})`,"data-type":"pcb_plated_hole_drill","data-pcb-layer":"drill"},value:"",children:[]}}return{name:"g",type:"element",attributes:{},value:"",children:[]}};return[{name:"g",type:"element",attributes:{"data-type":"pcb_plated_hole","data-pcb-layer":"through",...s},children:[{name:"polygon",type:"element",attributes:{class:"pcb-hole-outer-pad",fill:i.copper.top,points:x,"data-type":"pcb_plated_hole","data-pcb-layer":l},value:"",children:[]},E()],value:""}]}return[]}function HT(t,e){let{transform:r,layer:i,colorMap:n}=e;if(!t.route||!Array.isArray(t.route))return[];let o=t.route.map((d,h)=>{let[y,_]=F(r,[d.x,d.y]);return h===0?`M ${y} ${_}`:`L ${y} ${_}`}).join(" "),a=t.route[0],s=t.route[t.route.length-1];if(a&&s&&a.x===s.x&&a.y===s.y)o+=" Z";let l=t.layer||"top";if(i&&l!==i)return[];let c=l==="bottom"?n.silkscreen.bottom:n.silkscreen.top;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${l}`,d:o,fill:"none",stroke:c,"stroke-width":(t.stroke_width*Math.abs(r.a)).toString(),"stroke-linecap":"round","stroke-linejoin":"round","data-pcb-component-id":t.pcb_component_id,"data-pcb-silkscreen-path-id":t.pcb_silkscreen_path_id,"data-type":"pcb_silkscreen_path","data-pcb-layer":l},value:"",children:[]}]}function GT(t,e){let{transform:r,layer:i,colorMap:n}=e,{layer:o="top"}=t;if(i&&o!==i)return[];if(t.shape!=="brep")return[];let a=o==="bottom"?n.silkscreen.bottom:n.silkscreen.top,s=ji(t.brep_shape.outer_ring.vertices,r);for(let l of t.brep_shape.inner_rings??[])s+=` ${ji(l.vertices,r)}`;return[{name:"path",type:"element",attributes:{class:`pcb-silkscreen pcb-silkscreen-${o}`,d:s,fill:a,"fill-rule":"evenodd",stroke:"none","data-pcb-component-id":t.pcb_component_id,"data-pcb-silkscreen-graphic-id":t.pcb_silkscreen_graphic_id,"data-type":"pcb_silkscreen_graphic","data-pcb-layer":o},value:"",children:[]}]}function U6(t){let{text:e,anchorAlignment:r,fontSize:i,charAdvance:n,spaceAdvance:o,trailingSpacing:a,lineHeight:s,mapSegment:l}=t,c=e.split(`
`),d=c.length*s,h=c.map((k)=>qT(k,n,o,a)),y=[],_=-d/2;for(let k=0;k<c.length;k++){let x=c[k]??"",S=-(h[k]??0)/2;for(let E of x){if(E===" "){S+=o;continue}let I=ni[E];if(I)for(let T of I)y.push(l(T,S,_,i));S+=n}_+=s}let m=KT(y);if(!m)return{pathData:"",bounds:null};let g=zu(r,m),b=eW(y,g),v=rW(m,g);return{pathData:iW(b),bounds:v}}function qT(t,e,r,i){let n=0;for(let o of t)n+=o===" "?r:e;return n>0?n-i:0}function KT(t){if(t.length===0)return null;let{POSITIVE_INFINITY:e,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i,NEGATIVE_INFINITY:n}=Number;for(let o of t)e=Math.min(e,o.x1,o.x2),r=Math.min(r,o.y1,o.y2),i=Math.max(i,o.x1,o.x2),n=Math.max(n,o.y1,o.y2);return{minX:e,minY:r,maxX:i,maxY:n}}function zu(t,e){return{x:-JT(t,e),y:-tW(t,e)}}function JT(t,e){if(t==="top_left"||t==="center_left"||t==="bottom_left")return e.minX;if(t==="top_right"||t==="center_right"||t==="bottom_right")return e.maxX;return(e.minX+e.maxX)/2}function tW(t,e){if(t==="top_left"||t==="top_center"||t==="top_right")return e.minY;if(t==="bottom_left"||t==="bottom_center"||t==="bottom_right")return e.maxY;return(e.minY+e.maxY)/2}function eW(t,e){if(e.x===0&&e.y===0)return t;return t.map((r)=>({x1:r.x1+e.x,y1:r.y1+e.y,x2:r.x2+e.x,y2:r.y2+e.y}))}function rW(t,e){return{minX:t.minX+e.x,minY:t.minY+e.y,maxX:t.maxX+e.x,maxY:t.maxY+e.y}}function iW(t){return t.map((e)=>`M${e.x1} ${e.y1}L${e.x2} ${e.y2}`).join(" ")}var Z6=0.94,ac=0.045,$5=Object.fromEntries(Object.entries(ni).map(([t,e])=>{let r=e.flatMap((n)=>[n.x1,n.x2]),i=e.flatMap((n)=>[n.y1,n.y2]);return[t,e.length?{minX:Math.min(...r)-ac,maxX:Math.max(...r)+ac,minY:-(Math.max(...i)+ac)*Z6,maxY:-(Math.min(...i)-ac)*Z6}:null]})),H6=Math.round(Math.max(...Object.values($5).map((t)=>t?t.maxX-t.minX:0))*1000)/1000;function nW(t,e){let r=null,n=t.split(`
`).map((o,a)=>{let s=Array.from(o),l=-(s.length*H6*e)/2,c=a*e*1.1;return s.forEach((d,h)=>{let y=$5[d];if(!y)return;let _=l+h*H6*e,m={minX:_+y.minX*e,maxX:_+y.maxX*e,minY:c+y.minY*e,maxY:c+y.maxY*e};r=r?{minX:Math.min(r.minX,m.minX),maxX:Math.max(r.maxX,m.maxX),minY:Math.min(r.minY,m.minY),maxY:Math.max(r.maxY,m.maxY)}:m}),{name:"tspan",type:"element",value:"",attributes:{x:l.toString(),y:c.toString()},children:[{name:"",type:"text",value:o,attributes:{},children:[]}]}});return{bounds:r,textNode:{name:"text",type:"element",value:"",attributes:{"font-family":Or,"font-size":e.toString(),"text-anchor":"start","dominant-baseline":"alphabetic","xml:space":"preserve",fill:"black",stroke:"none"},children:n}}}var oW=0;function aW(t,e){let{transform:r,layer:i,colorMap:n}=e,{anchor_position:o,text:a,font_size:s=1,layer:l="top",ccw_rotation:c=0,anchor_alignment:d="center",is_knockout:h=!1,knockout_padding:y,is_mirrored:_=!1}=t;if(i&&l!==i)return[];if(!o||typeof o.x!=="number"||typeof o.y!=="number")return Zt(`[pcb_silkscreen_text] Invalid anchor_position for "${t.pcb_silkscreen_text_id}": expected {x: number, y: number}, got ${JSON.stringify(o)}`),[];if(!a)return[];let[m,g]=F(r,[o.x,o.y]),b=Math.abs(r.a),v=l==="bottom"?n.silkscreen.bottom:n.silkscreen.top,x=l==="bottom"?!0:_===!0;if(h){let O=nW(a,s);if(!O.bounds)return[];let D=y?.left??s*0.5,N=y?.right??s*0.5,G=y?.top??s*0.3,K=y?.bottom??s*0.3,vt=O.bounds.minX-D,H=O.bounds.minY-G,ht=O.bounds.maxX-O.bounds.minX+D+N,wt=O.bounds.maxY-O.bounds.minY+G+K,et={minX:vt,minY:H,maxX:vt+ht,maxY:H+wt},Q=zu(d,et),V=vt+Q.x,tt=H+Q.y,C=[{name:"rect",type:"element",value:"",attributes:{x:vt.toString(),y:H.toString(),width:ht.toString(),height:wt.toString(),fill:"white"},children:[]},O.textNode],it=Q.x!==0||Q.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${Q.x} ${Q.y})`},children:C}]:C,lt=oe(Ft(Yt(m,g),Gt(-c*Math.PI/180),...x?[Vt(-1,1)]:[],Vt(b,b))),mt=`silkscreen-knockout-mask-${t.pcb_silkscreen_text_id}-${oW++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:mt},children:it}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:V.toString(),y:tt.toString(),width:ht.toString(),height:wt.toString(),fill:v,mask:`url(#${mt})`,transform:lt,class:`pcb-silkscreen-text-knockout pcb-silkscreen-${l}`,"data-type":"pcb_silkscreen_text","data-pcb-silkscreen-text-id":t.pcb_silkscreen_text_id,"data-pcb-layer":l}}]}let A=s*b,S="middle",E="central";switch(d){case"top_left":S="start",E="text-before-edge";break;case"top_center":S="middle",E="text-before-edge";break;case"top_right":S="end",E="text-before-edge";break;case"center_left":S="start",E="central";break;case"center_right":S="end",E="central";break;case"bottom_left":S="start",E="text-after-edge";break;case"bottom_center":S="middle",E="text-after-edge";break;case"bottom_right":S="end",E="text-after-edge";break;case"center":default:S="middle",E="central";break}let I=Ft(Yt(m,g),Gt(-c*Math.PI/180),...x?[Vt(-1,1)]:[]),T=a.split(`
`),P=T.length===1?[{type:"text",value:a,name:"",attributes:{},children:[]}]:T.map((O,D)=>({type:"element",name:"tspan",value:"",attributes:{x:"0",...D>0?{dy:A.toString()}:{}},children:[{type:"text",value:O,name:"",attributes:{},children:[]}]}));return[{name:"text",type:"element",attributes:{x:"0",y:"0",dx:"0",dy:"0",fill:v,"font-family":Or,"font-size":A.toString(),"text-anchor":S,"dominant-baseline":E,transform:oe(I),class:`pcb-silkscreen-text pcb-silkscreen-${l}`,"data-pcb-silkscreen-text-id":t.pcb_silkscreen_text_id,stroke:"none","data-type":"pcb_silkscreen_text","data-pcb-layer":l},children:P,value:""}]}function sW(t,e){let{transform:r,layer:i,colorMap:n}=e,{center:o,width:a,height:s,layer:l="top",pcb_silkscreen_rect_id:c,stroke_width:d,is_filled:h,has_stroke:y,is_stroke_dashed:_,corner_radius:m,ccw_rotation:g=0}=t;if(i&&l!==i)return[];if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof a!=="number"||typeof s!=="number")return Zt(`[pcb_silkscreen_rect] Invalid data for "${c}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(o)}, width=${JSON.stringify(a)}, height=${JSON.stringify(s)}`),[];let[b,v]=F(r,[o.x,o.y]),k=typeof m==="number"&&m>0?m:0,x=k*Math.abs(r.a),A=k*Math.abs(r.d),S=a*Math.abs(r.a),E=s*Math.abs(r.d),I=d*Math.abs(r.a),T=l==="bottom"?n.silkscreen.bottom:n.silkscreen.top,P={x:(-S/2).toString(),y:(-E/2).toString(),width:S.toString(),height:E.toString(),class:`pcb-silkscreen-rect pcb-silkscreen-${l}`,"data-pcb-silkscreen-rect-id":c,"data-type":"pcb_silkscreen_rect","data-pcb-layer":l};if(typeof g==="number"&&g!==0)P.transform=`translate(${b} ${v}) rotate(${-g})`;else P.x=(b-S/2).toString(),P.y=(v-E/2).toString();if(x>0)P.rx=x.toString();if(A>0)P.ry=A.toString();P.fill=h?T:"none";let O;if(y===void 0)O=I>0;else O=y;if(O){if(P.stroke=T,P["stroke-width"]=I.toString(),_){let N=0.1*Math.abs(r.a),G=0.05*Math.abs(r.a);P["stroke-dasharray"]=`${N} ${G}`}}else P.stroke="none";return[{name:"rect",type:"element",attributes:P,value:"",children:[]}]}var sc=1,Ii=0.2,G6=1.4,q6=0.53,cW=0;function lW(t,e){let{transform:r,layer:i,colorMap:n}=e,{anchor_position:o,text:a,font_size:s="0.2mm",layer:l,ccw_rotation:c=0,anchor_alignment:d="center",is_knockout:h=!1,knockout_padding:y,is_mirrored:_=!1}=t,m=l??"top";if(i&&i!==m)return[];if(!o)return[];if(!a)return[];let[g,b]=F(r,[o.x,o.y]),v=L.parse(s)??0.2,k=Math.abs(r.a),x=he(m,n),S=m==="bottom"?!0:_===!0;if(h){let O=v*q6,D=U6({text:a,anchorAlignment:d,fontSize:O,charAdvance:(sc+Ii)*O,spaceAdvance:(sc+Ii)*O*0.6,trailingSpacing:Ii*O,lineHeight:O*G6,mapSegment:(dt,Lt,at,U)=>({x1:Lt+dt.x1*U,y1:at+(1-dt.y1)*U,x2:Lt+dt.x2*U,y2:at+(1-dt.y2)*U})});if(!D.bounds||!D.pathData)return[];let N=y?.left??O*0.5,G=y?.right??O*0.5,K=y?.top??O*0.3,vt=y?.bottom??O*0.3,H=D.bounds.minX-N,ht=D.bounds.minY-K,wt=D.bounds.maxX-D.bounds.minX+N+G,et=D.bounds.maxY-D.bounds.minY+K+vt,Q=O*0.15,V={minX:H,minY:ht,maxX:H+wt,maxY:ht+et},tt=zu(d,V),C=H+tt.x,ot=ht+tt.y,it=[{name:"rect",type:"element",value:"",attributes:{x:H.toString(),y:ht.toString(),width:wt.toString(),height:et.toString(),fill:"white"},children:[]},{name:"path",type:"element",value:"",attributes:{d:D.pathData,fill:"none",stroke:"black","stroke-width":Q.toString(),"stroke-linecap":"round","stroke-linejoin":"round"},children:[]}],mt=tt.x!==0||tt.y!==0?[{name:"g",type:"element",value:"",attributes:{transform:`translate(${tt.x} ${tt.y})`},children:it}]:it,pt=oe(Ft(Yt(g,b),Gt(-c*Math.PI/180),...S?[Vt(-1,1)]:[],Vt(k,k))),xt=`knockout-mask-${t.pcb_copper_text_id}-${cW++}`;return[{name:"defs",type:"element",value:"",children:[{name:"mask",type:"element",value:"",attributes:{id:xt},children:mt}],attributes:{}},{name:"rect",type:"element",value:"",children:[],attributes:{x:C.toString(),y:ot.toString(),width:wt.toString(),height:et.toString(),fill:x,mask:`url(#${xt})`,transform:pt,class:`pcb-copper-text-knockout pcb-copper-${m}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":t.pcb_copper_text_id}}]}let E=v*q6,I=U6({text:a,anchorAlignment:d,fontSize:E,charAdvance:(sc+Ii)*E,spaceAdvance:(sc+Ii)*E*0.6,trailingSpacing:Ii*E,lineHeight:E*G6,mapSegment:(O,D,N,G)=>({x1:D+O.x1*G,y1:N+(1-O.y1)*G,x2:D+O.x2*G,y2:N+(1-O.y2)*G})});if(!I.pathData)return[];let T=oe(Ft(Yt(g,b),Gt(-c*Math.PI/180),...S?[Vt(-1,1)]:[],Vt(k,k))),P=E*0.15;return[{name:"path",type:"element",attributes:{d:I.pathData,fill:"none",stroke:x,"stroke-width":P.toString(),"stroke-linecap":"round","stroke-linejoin":"round",transform:T,class:`pcb-copper-text pcb-copper-${m}`,"data-type":"pcb_copper_text","data-pcb-copper-text-id":t.pcb_copper_text_id},children:[],value:""}]}function pW(t,e){let{transform:r,layer:i,colorMap:n}=e,{center:o,radius:a,layer:s="top",pcb_silkscreen_circle_id:l,stroke_width:c=1,is_filled:d}=t;if(i&&s!==i)return[];if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof a!=="number")return console.error("Invalid PCB Silkscreen Circle data:",{center:o,radius:a}),[];let[h,y]=F(r,[o.x,o.y]),_=a*Math.abs(r.a),m=c*Math.abs(r.a),g=s==="bottom"?n.silkscreen.bottom:n.silkscreen.top;return[{name:"circle",type:"element",attributes:{cx:h.toString(),cy:y.toString(),r:_.toString(),class:`pcb-silkscreen-circle pcb-silkscreen-${s}`,fill:d?g:"none",stroke:g,"stroke-width":m.toString(),"data-pcb-silkscreen-circle-id":l,"data-type":"pcb_silkscreen_circle","data-pcb-layer":s},value:"",children:[]}]}function dW(t,e){let{transform:r,layer:i,colorMap:n}=e,{x1:o,y1:a,x2:s,y2:l,stroke_width:c,layer:d="top",pcb_silkscreen_line_id:h}=t;if(i&&d!==i)return[];if(typeof o!=="number"||typeof a!=="number"||typeof s!=="number"||typeof l!=="number")return Zt(`[pcb_silkscreen_line] Invalid coordinates for "${h}": expected x1, y1, x2, y2 as numbers, got x1=${JSON.stringify(o)}, y1=${JSON.stringify(a)}, x2=${JSON.stringify(s)}, y2=${JSON.stringify(l)}`),[];let[y,_]=F(r,[o,a]),[m,g]=F(r,[s,l]),b=c*Math.abs(r.a),v=d==="bottom"?n.silkscreen.bottom:n.silkscreen.top;return[{name:"line",type:"element",attributes:{x1:y.toString(),y1:_.toString(),x2:m.toString(),y2:g.toString(),stroke:v,"stroke-width":b.toString(),class:`pcb-silkscreen-line pcb-silkscreen-${d}`,"data-pcb-silkscreen-line-id":h,"data-type":"pcb_silkscreen_line","data-pcb-layer":d},value:"",children:[]}]}function hW(t,e){let{transform:r,layer:i,colorMap:n}=e,{center:o,width:a,height:s,layer:l="top",pcb_silkscreen_pill_id:c,ccw_rotation:d=0}=t;if(i&&l!==i)return[];let[h,y]=F(r,[o.x,o.y]),_=a*Math.abs(r.a),m=s*Math.abs(r.d),b=Math.min(a,s)/2,v=b*Math.abs(r.a),k=b*Math.abs(r.d),x=l==="bottom"?n.silkscreen.bottom:n.silkscreen.top;return[{name:"rect",type:"element",attributes:{x:(h-_/2).toString(),y:(y-m/2).toString(),width:_.toString(),height:m.toString(),rx:v.toString(),ry:k.toString(),fill:"none",stroke:x,"stroke-width":(0.1*Math.abs(r.a)).toString(),class:`pcb-silkscreen-pill pcb-silkscreen-${l}`,"data-pcb-silkscreen-pill-id":c,"data-type":"pcb_silkscreen_pill","data-pcb-layer":l,...d!==0&&{transform:`rotate(${-d} ${h} ${y})`}},value:"",children:[]}]}function uW(t,e){let{transform:r,layer:i,colorMap:n}=e,{center:o,radius_x:a,radius_y:s,layer:l="top",pcb_silkscreen_oval_id:c,ccw_rotation:d=0}=t;if(i&&l!==i)return[];if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof a!=="number"||typeof s!=="number")return Zt(`[pcb_silkscreen_oval] Invalid data for "${c}": expected center {x: number, y: number}, radius_x: number, radius_y: number, got center=${JSON.stringify(o)}, radius_x=${JSON.stringify(a)}, radius_y=${JSON.stringify(s)}`),[];let[h,y]=F(r,[o.x,o.y]),_=a*Math.abs(r.a),m=s*Math.abs(r.d),g=l==="bottom"?n.silkscreen.bottom:n.silkscreen.top;return[{name:"ellipse",type:"element",attributes:{cx:h.toString(),cy:y.toString(),rx:_.toString(),ry:m.toString(),fill:"none",stroke:g,"stroke-width":(0.1*Math.abs(r.a)).toString(),class:`pcb-silkscreen-oval pcb-silkscreen-${l}`,"data-pcb-silkscreen-oval-id":c,"data-type":"pcb_silkscreen_oval","data-pcb-layer":l,...d!==0&&{transform:`rotate(${-d} ${h} ${y})`}},value:"",children:[]}]}function yW(t,e){let{transform:r,layer:i,colorMap:n}=e,{center:o,width:a,height:s,layer:l="top",pcb_courtyard_rect_id:c,ccw_rotation:d=0}=t;if(i&&l!==i)return[];if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof a!=="number"||typeof s!=="number")return Zt(`[pcb_courtyard_rect] Invalid data for "${c}": expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(o)}, width=${JSON.stringify(a)}, height=${JSON.stringify(s)}`),[];let[h,y]=F(r,[o.x,o.y]),_=a*Math.abs(r.a),m=s*Math.abs(r.d),g=0.05*Math.abs(r.a),b=l==="bottom"?n.courtyard.bottom:n.courtyard.top,v={x:(-_/2).toString(),y:(-m/2).toString(),width:_.toString(),height:m.toString(),class:`pcb-courtyard-rect pcb-courtyard-${l}`,"data-pcb-courtyard-rect-id":c,"data-type":"pcb_courtyard_rect","data-pcb-layer":l,"stroke-linejoin":"round"};if(typeof d==="number"&&d!==0)v.transform=`translate(${h} ${y}) rotate(${-d})`;else v.x=(h-_/2).toString(),v.y=(y-m/2).toString();return v.fill="none",v.stroke=b,v["stroke-width"]=g.toString(),[{name:"rect",type:"element",attributes:v,value:"",children:[]}]}function _W(t,e){let{transform:r,layer:i,colorMap:n}=e,{layer:o="top",pcb_courtyard_polygon_id:a,points:s,color:l}=t;if(i&&o!==i)return[];if(!s||s.length===0)return Zt(`[pcb_courtyard_polygon] Invalid data for "${a}": expected non-empty array of points, got ${JSON.stringify(s)}`),[];let d=s.map((g)=>F(r,[g.x,g.y])).map((g)=>`${g[0]},${g[1]}`).join(" "),h=0.05*Math.abs(r.a),y=l??(o==="bottom"?n.courtyard.bottom:n.courtyard.top);return[{name:"polygon",type:"element",attributes:{points:d,class:`pcb-courtyard-polygon pcb-courtyard-${o}`,"data-pcb-courtyard-polygon-id":a,"data-type":"pcb_courtyard_polygon","data-pcb-layer":o,fill:"none",stroke:y,"stroke-width":h.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function mW(t,e){let{transform:r,layer:i,colorMap:n}=e,{layer:o,pcb_courtyard_outline_id:a,outline:s}=t;if(i&&o!==i)return[];if(!s||s.length===0)return Zt(`[pcb_courtyard_outline] Invalid data for "${a}": expected non-empty array of points, got ${JSON.stringify(s)}`),[];let c=s.map((m)=>F(r,[m.x,m.y])).map((m)=>`${m[0]},${m[1]}`).join(" "),d=0.05*Math.abs(r.a),h=o==="bottom"?n.courtyard.bottom:n.courtyard.top;return[{name:"polygon",type:"element",attributes:{points:c,class:`pcb-courtyard-outline pcb-courtyard-${o}`,"data-pcb-courtyard-outline-id":a,"data-type":"pcb_courtyard_outline","data-pcb-layer":o,fill:"none",stroke:h,"stroke-width":d.toString(),"stroke-linejoin":"round"},value:"",children:[]}]}function fW(t,e){let{transform:r,layer:i,colorMap:n}=e,{center:o,radius:a,layer:s="top",pcb_courtyard_circle_id:l}=t;if(i&&s!==i)return[];if(!o||typeof o.x!=="number"||typeof o.y!=="number"||typeof a!=="number")return console.error(`[pcb_courtyard_circle] Invalid data for "${l}": expected center {x: number, y: number}, radius: number, got center=${JSON.stringify(o)}, radius=${JSON.stringify(a)}`),[];let[c,d]=F(r,[o.x,o.y]),h=a*Math.abs(r.a),y=0.05*Math.abs(r.a),_=s==="bottom"?n.courtyard.bottom:n.courtyard.top,m={cx:c.toString(),cy:d.toString(),r:h.toString(),class:`pcb-courtyard-circle pcb-courtyard-${s}`,"data-pcb-courtyard-circle-id":l,"data-type":"pcb_courtyard_circle","data-pcb-layer":s};return m.fill="none",m.stroke=_,m["stroke-width"]=y.toString(),[{name:"circle",type:"element",attributes:m,value:"",children:[]}]}var K6=0.05,be=4,J6=8,N5=11,Ti=1,Ei=5,t5=1.5,V5=2,Yu=Ei+2,Mu=V5+2,En=Ei+be+6,xW=15,gW=10,bW=0.2,vW=50;function Du(t){let{groupAnchorPosition:e,componentPosition:r,transform:i,componentWidth:n=0,componentHeight:o=0,displayXOffset:a,displayYOffset:s}=t,l=[],[c,d]=F(i,[e.x,e.y]),[h,y]=F(i,[r.x,r.y]),_=r.x-e.x,m=r.y-e.y,g=Math.abs(i.a),b=n*g,v=o*g;l.push(AW(c,d));let k=wW(c,d,h,y);l.push({name:"line",type:"element",attributes:{x1:k.x1.toString(),y1:k.y1.toString(),x2:k.x2.toString(),y2:k.y2.toString(),stroke:"#ffffff","stroke-width":"0.5","stroke-dasharray":"3,3",opacity:"0.5",class:"anchor-offset-connector"},children:[],value:""}),l.push({name:"circle",type:"element",attributes:{cx:h.toString(),cy:y.toString(),r:V5.toString(),fill:"#ffffff",opacity:"0.7",class:"anchor-offset-component-marker"},children:[],value:""});let x=Math.abs(y-d),A=Math.abs(h-c),S=Math.sqrt(A*A+x*x),E=v/2+xW,I=Math.max(E,Math.min(vW,S*bW)),T=m>0?y-I:y+I,P=b/2+gW,O=_>0?h+P:h-P;if(cc(T,d)||cc(T,y)){let D=Math.min(d,y),N=Math.max(d,y),G=D-En,K=N+En;T=Math.abs(T-G)<Math.abs(T-K)?G:K}if(cc(O,c)||cc(O,h)){let D=Math.min(c,h),N=Math.max(c,h),G=D-En,K=N+En;O=Math.abs(O-G)<Math.abs(O-K)?G:K}if(Math.abs(_)>K6)l.push(...FW({startX:c,endX:h,y:T,offsetMm:_,offsetY:m,displayOffset:a}));if(Math.abs(m)>K6)l.push(...BW({x:O,startY:d,endY:y,offsetMm:m,offsetX:_,displayOffset:s}));return l}function wW(t,e,r,i){let n=r-t,o=i-e,a=Math.hypot(n,o),s=Yu+Mu;if(!(a>s))return{x1:t,y1:e,x2:r,y2:i};let l=n/a,c=o/a;return{x1:t+l*Yu,y1:e+c*Yu,x2:r-l*Mu,y2:i-c*Mu}}function cc(t,e){return Math.abs(t-e)<En}function AW(t,e){return{name:"g",type:"element",attributes:{class:"anchor-offset-marker","data-type":"anchor_offset_marker"},children:[{name:"line",type:"element",attributes:{x1:t.toString(),y1:(e-Ei).toString(),x2:t.toString(),y2:(e+Ei).toString(),stroke:"#ffffff","stroke-width":t5.toString(),"stroke-linecap":"round"},children:[],value:""},{name:"line",type:"element",attributes:{x1:(t-Ei).toString(),y1:e.toString(),x2:(t+Ei).toString(),y2:e.toString(),stroke:"#ffffff","stroke-width":t5.toString(),"stroke-linecap":"round"},children:[],value:""}],value:""}}function FW({startX:t,endX:e,y:r,offsetMm:i,offsetY:n,displayOffset:o}){let a=[];a.push({name:"line",type:"element",attributes:{x1:t.toString(),y1:r.toString(),x2:e.toString(),y2:r.toString(),stroke:"#ffffff","stroke-width":Ti.toString(),class:"anchor-offset-dimension-x"},children:[],value:""}),a.push({name:"line",type:"element",attributes:{x1:t.toString(),y1:(r-be).toString(),x2:t.toString(),y2:(r+be).toString(),stroke:"#ffffff","stroke-width":Ti.toString()},children:[],value:""}),a.push({name:"line",type:"element",attributes:{x1:e.toString(),y1:(r-be).toString(),x2:e.toString(),y2:(r+be).toString(),stroke:"#ffffff","stroke-width":Ti.toString()},children:[],value:""});let s=(t+e)/2,l=n>0?r-be-J6:r+be+J6;return a.push({name:"text",type:"element",attributes:{x:s.toString(),y:l.toString(),fill:"#ffffff","font-size":N5.toString(),"font-family":"Arial, sans-serif","text-anchor":"middle","dominant-baseline":n>0?"baseline":"hanging",class:"anchor-offset-label"},children:[{type:"text",value:z5("X",i,o),name:"",attributes:{},children:[]}],value:""}),a}function BW({x:t,startY:e,endY:r,offsetMm:i,offsetX:n,displayOffset:o}){let a=[];a.push({name:"line",type:"element",attributes:{x1:t.toString(),y1:e.toString(),x2:t.toString(),y2:r.toString(),stroke:"#ffffff","stroke-width":Ti.toString(),class:"anchor-offset-dimension-y"},children:[],value:""}),a.push({name:"line",type:"element",attributes:{x1:(t-be).toString(),y1:e.toString(),x2:(t+be).toString(),y2:e.toString(),stroke:"#ffffff","stroke-width":Ti.toString()},children:[],value:""}),a.push({name:"line",type:"element",attributes:{x1:(t-be).toString(),y1:r.toString(),x2:(t+be).toString(),y2:r.toString(),stroke:"#ffffff","stroke-width":Ti.toString()},children:[],value:""});let s=(e+r)/2,l=n<0?t-be-4:t+be+4;return a.push({name:"text",type:"element",attributes:{x:l.toString(),y:s.toString(),fill:"#ffffff","font-size":N5.toString(),"font-family":"Arial, sans-serif","text-anchor":n<0?"end":"start","dominant-baseline":"middle",class:"anchor-offset-label"},children:[{type:"text",value:z5("Y",i,o),name:"",attributes:{},children:[]}],value:""}),a}function z5(t,e,r){let i=typeof r==="string"?r:e.toFixed(2),o=typeof i==="string"&&i.trim().endsWith("mm")?"":"mm";return`${t}: ${i}${o}`}function Wn(t){let e=t?.anchor_position??t?.center;if(e&&typeof e.x==="number"&&typeof e.y==="number")return{x:e.x,y:e.y};return}function SW(t,e){let{transform:r,colorMap:i,showSolderMask:n,circuitJson:o}=e,{width:a,height:s,center:l,outline:c,position_mode:d,anchor_position:h,display_offset_x:y,display_offset_y:_}=t,m;if(c&&Array.isArray(c)&&c.length>=3)m=c.map((b,v)=>{let[k,x]=F(r,[b.x,b.y]);return v===0?`M ${k} ${x}`:`L ${k} ${x}`}).join(" ");else{let b=a/2,v=s/2,k=F(r,[l.x-b,l.y-v]),x=F(r,[l.x+b,l.y-v]),A=F(r,[l.x+b,l.y+v]),S=F(r,[l.x-b,l.y+v]);m=`M ${k[0]} ${k[1]} L ${x[0]} ${x[1]} L ${A[0]} ${A[1]} L ${S[0]} ${S[1]}`}m+=" Z";let g=[];if(n){let v=(e.layer??"top")==="bottom"?"soldermask-bottom":"soldermask-top";g.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board-soldermask",d:m,fill:i.soldermask.top,"fill-opacity":"0.8",stroke:"none","data-type":"pcb_soldermask","data-pcb-layer":v}})}if(g.push({name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-board",d:m,fill:"none",stroke:i.boardOutline,"stroke-width":(0.1*Math.abs(r.a)).toString(),"data-type":"pcb_board","data-pcb-layer":"board"}}),e.showAnchorOffsets&&o&&d==="relative_to_panel_anchor"){let b=o.find((v)=>v.type==="pcb_panel");if(b){let v=Wn(b);if(v)g.push(...Du({groupAnchorPosition:v,componentPosition:h??l,transform:r,componentWidth:a,componentHeight:s,displayXOffset:y,displayYOffset:_}))}}return g}function kW(t,e){let{transform:r,colorMap:i,showSolderMask:n}=e,o=Number(t.width),a=Number(t.height),s=t.center??{x:o/2,y:a/2},l=o/2,c=a/2,d=F(r,[s.x-l,s.y-c]),h=F(r,[s.x+l,s.y-c]),y=F(r,[s.x+l,s.y+c]),_=F(r,[s.x-l,s.y+c]),m=`M ${d[0]} ${d[1]} L ${h[0]} ${h[1]} L ${y[0]} ${y[1]} L ${_[0]} ${_[1]} Z`,g=t.covered_with_solder_mask!==!1,b=Boolean(n&&g);return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-panel",d:m,fill:"none",stroke:i.boardOutline,"stroke-width":(0.1*Math.abs(r.a)).toString(),"data-type":"pcb_panel","data-pcb-layer":"board"}}]}function YW(t,e){let{transform:r,colorMap:i,showSolderMask:n}=e,o=e.layer??"top",[a,s]=F(r,[t.x,t.y]),l=Boolean(t.is_covered_with_solder_mask),c=(t.soldermask_margin??0)*Math.abs(r.a),d=n&&l&&c!==0,h=i.soldermask.top;if(t.hole_shape==="circle"||t.hole_shape==="square"){let y=t.hole_diameter*Math.abs(r.a),_=y/2;if(t.hole_shape==="circle"){let v={name:"circle",type:"element",attributes:{class:"pcb-hole",cx:a.toString(),cy:s.toString(),r:_.toString(),fill:i.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!d)return[v];let k=_+c;if(c<0){let A={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:h,cx:a.toString(),cy:s.toString(),r:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},S={name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:i.drill,cx:a.toString(),cy:s.toString(),r:k.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[A,S]}return[{name:"circle",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,cx:a.toString(),cy:s.toString(),r:k.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":o}},v]}let m={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(a-_).toString(),y:(s-_).toString(),width:y.toString(),height:y.toString(),fill:i.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!d)return[m];let g=y+2*c;if(c<0){let v={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:h,x:(a-_).toString(),y:(s-_).toString(),width:y.toString(),height:y.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},k={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:i.drill,x:(a-g/2).toString(),y:(s-g/2).toString(),width:g.toString(),height:g.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[v,k]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,x:(a-g/2).toString(),y:(s-g/2).toString(),width:g.toString(),height:g.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":o}},m]}if(t.hole_shape==="oval"){let y=t.hole_width*Math.abs(r.a),_=t.hole_height*Math.abs(r.a),m=y/2,g=_/2,b={name:"ellipse",type:"element",attributes:{class:"pcb-hole",cx:a.toString(),cy:s.toString(),rx:m.toString(),ry:g.toString(),fill:i.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!d)return[b];let v=m+c,k=g+c;if(c<0){let A={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:h,cx:a.toString(),cy:s.toString(),rx:m.toString(),ry:g.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},S={name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:i.drill,cx:a.toString(),cy:s.toString(),rx:v.toString(),ry:k.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[A,S]}return[{name:"ellipse",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,cx:a.toString(),cy:s.toString(),rx:v.toString(),ry:k.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":o}},b]}if(t.hole_shape==="rect"){let y=t.hole_width*Math.abs(r.a),_=t.hole_height*Math.abs(r.a),m={name:"rect",type:"element",attributes:{class:"pcb-hole",x:(a-y/2).toString(),y:(s-_/2).toString(),width:y.toString(),height:_.toString(),fill:i.drill,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!d)return[m];let g=y+2*c,b=_+2*c;if(c<0){let k={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:h,x:(a-y/2).toString(),y:(s-_/2).toString(),width:y.toString(),height:_.toString(),"data-type":"pcb_hole","data-pcb-layer":"drill"}},x={name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:i.drill,x:(a-g/2).toString(),y:(s-b/2).toString(),width:g.toString(),height:b.toString(),"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[k,x]}return[{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,x:(a-g/2).toString(),y:(s-b/2).toString(),width:g.toString(),height:b.toString(),"data-type":"pcb_soldermask_opening","data-pcb-layer":o}},m]}if(t.hole_shape==="pill"){let y=t.hole_width*Math.abs(r.a),_=t.hole_height*Math.abs(r.a),m=y>_,g=Math.min(y,_)/2,b=Math.abs(m?y-_:_-y),v=m?`M${a-b/2},${s-g} h${b} a${g},${g} 0 0 1 0,${_} h-${b} a${g},${g} 0 0 1 0,-${_} z`:`M${a-g},${s-b/2} v${b} a${g},${g} 0 0 0 ${y},0 v-${b} a${g},${g} 0 0 0 -${y},0 z`,k={name:"path",type:"element",attributes:{class:"pcb-hole",fill:i.drill,d:v,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!d)return[k];let x=y+2*c,A=_+2*c,S=x>A,E=Math.min(x,A)/2,I=Math.abs(S?x-A:A-x),T=S?`M${a-I/2},${s-E} h${I} a${E},${E} 0 0 1 0,${A} h-${I} a${E},${E} 0 0 1 0,-${A} z`:`M${a-E},${s-I/2} v${I} a${E},${E} 0 0 0 ${x},0 v-${I} a${E},${E} 0 0 0 -${x},0 z`;if(c<0){let O={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:h,d:v,"data-type":"pcb_hole","data-pcb-layer":"drill"}},D={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:i.drill,d:T,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[O,D]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,d:T,"data-type":"pcb_soldermask_opening","data-pcb-layer":o}},k]}if(t.hole_shape==="rotated_pill"){let y=t.hole_width*Math.abs(r.a),_=t.hole_height*Math.abs(r.a),m="ccw_rotation"in t?t.ccw_rotation??0:0,g=y>_,b=Math.min(y,_)/2,v=Math.abs(g?y-_:_-y),k=g?`M${-v/2},${-b} h${v} a${b},${b} 0 0 1 0,${_} h-${v} a${b},${b} 0 0 1 0,-${_} z`:`M${-b},${-v/2} v${v} a${b},${b} 0 0 0 ${y},0 v-${v} a${b},${b} 0 0 0 -${y},0 z`,x={name:"path",type:"element",attributes:{class:"pcb-hole",fill:i.drill,d:k,transform:`translate(${a} ${s}) rotate(${-m})`,"data-type":"pcb_hole","data-pcb-layer":"drill"},children:[],value:""};if(!d)return[x];let A=y+2*c,S=_+2*c,E=A>S,I=Math.min(A,S)/2,T=Math.abs(E?A-S:S-A),P=E?`M${-T/2},${-I} h${T} a${I},${I} 0 0 1 0,${S} h-${T} a${I},${I} 0 0 1 0,-${S} z`:`M${-I},${-T/2} v${T} a${I},${I} 0 0 0 ${A},0 v-${T} a${I},${I} 0 0 0 -${A},0 z`;if(c<0){let D={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-covered",fill:h,d:k,transform:`translate(${a} ${s}) rotate(${-m})`,"data-type":"pcb_hole","data-pcb-layer":"drill"}},N={name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-hole-exposed",fill:i.drill,d:P,transform:`translate(${a} ${s}) rotate(${-m})`,"data-type":"pcb_soldermask","data-pcb-layer":"drill"}};return[D,N]}return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-soldermask-cutout",fill:i.substrate,d:P,"data-type":"pcb_soldermask_opening","data-pcb-layer":o}},x]}return[]}var MW=(t,e)=>{let r=qt(e).pcb_smtpad.get(t);if(r&&"x"in r&&"y"in r)return{x:r.x,y:r.y};let i=qt(e).pcb_plated_hole.get(t);if(i&&"x"in i&&"y"in i)return{x:i.x,y:i.y};return null},IW=(t,e,r,i)=>{let n=r.getIdsConnectedToNet(e),o=null,a=1/0;for(let s of n){let l=MW(s,i);if(l){let c=t.x-l.x,d=t.y-l.y,h=Math.sqrt(c*c+d*d);if(h>0&&h<a)a=h,o=l}}return o};function LW(t,e){let{transform:r}=e,i=p1(t),n=t.filter((l)=>l.type==="pcb_port"),o=t.filter((l)=>l.type==="source_trace"),a=[];n.forEach((l,c)=>{let d=l.pcb_port_id;if(!d)return;let h=i.getNetConnectedToId(d);if(!h)return;let y=!1,_=qt(t).source_port.getWhere({pcb_port_id:d});if(_&&_.source_port_id){let b=_.source_port_id;for(let v of o)if(Array.isArray(v.connected_source_port_ids)&&v.connected_source_port_ids.includes(b)&&Array.isArray(v.connected_source_net_ids)&&v.connected_source_net_ids.length>0){y=!0;break}}let m={x:l.x,y:l.y},g=IW(m,h,i,t);if(!g)return;a.push({key:`${d}-${c}`,startPoint:m,endPoint:g,isInNet:y})});let s=[];for(let l of a){let c=F(r,[l.startPoint.x,l.startPoint.y]),d=F(r,[l.endPoint.x,l.endPoint.y]),h={x1:c[0].toString(),y1:c[1].toString(),x2:d[0].toString(),y2:d[1].toString(),stroke:"white","stroke-width":"1","stroke-dasharray":"6,6","data-type":"pcb_rats_nest","data-pcb-layer":"overlay"};s.push({name:"line",type:"element",attributes:h,value:"",children:[]})}return s}function EW(t,e){let{transform:r,colorMap:i}=e;if(t.shape==="rect"){let n=t,[o,a]=F(r,[n.center.x,n.center.y]),s=n.width*Math.abs(r.a),l=n.height*Math.abs(r.d),c=-(n.rotation??0),{corner_radius:d}=n,h=typeof d==="number"&&d>0?d:0,y=h*Math.abs(r.a),_=h*Math.abs(r.d),m={class:"pcb-cutout pcb-cutout-rect",x:(-s/2).toString(),y:(-l/2).toString(),width:s.toString(),height:l.toString(),fill:i.drill,transform:oe(Ft(Yt(o,a),Gt(c*Math.PI/180))),"data-type":"pcb_cutout","data-pcb-layer":"drill"};if(y>0)m.rx=y.toString();if(_>0)m.ry=_.toString();return[{name:"rect",type:"element",attributes:m,children:[],value:""}]}if(t.shape==="circle"){let n=t,[o,a]=F(r,[n.center.x,n.center.y]),s=n.radius*Math.abs(r.a);return[{name:"circle",type:"element",attributes:{class:"pcb-cutout pcb-cutout-circle",cx:o.toString(),cy:a.toString(),r:s.toString(),fill:i.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}if(t.shape==="polygon"){let n=t;if(!n.points||n.points.length===0)return[];return[{name:"polygon",type:"element",attributes:{class:"pcb-cutout pcb-cutout-polygon",points:n.points.map((s)=>F(r,[s.x,s.y])).map((s)=>`${s[0]},${s[1]}`).join(" "),fill:i.drill,"data-type":"pcb_cutout","data-pcb-layer":"drill"},children:[],value:""}]}return[]}function PW(t,e){let{transform:r,colorMap:i}=e;if(!t.route||!Array.isArray(t.route))return[];let n=t.route[0],o=t.route[t.route.length-1],a=n&&o&&n.x===o.x&&n.y===o.y;return[{name:"path",type:"element",attributes:{class:"pcb-cutout pcb-cutout-path",d:t.route.slice(0,a?-1:void 0).map((l,c)=>{let[d,h]=F(r,[l.x,l.y]);return c===0?`M ${d} ${h}`:`L ${d} ${h}`}).join(" ")+(a?" Z":""),fill:i.drill,"data-type":"pcb_cutout_path","data-pcb-cutout-id":t.pcb_cutout_id,"data-pcb-layer":"drill"},value:"",children:[]}]}var Qu="pcb-keepout-pattern",Pi=20,TW=5,Iu="rgba(255, 107, 107, 0.2)";function WW(t){let e=[];for(let r=-Pi;r<=Pi;r+=TW)e.push({name:"line",type:"element",value:"",attributes:{x1:r.toString(),y1:"0",x2:(r+Pi).toString(),y2:Pi.toString(),stroke:t,"stroke-width":"1"},children:[]});return e}function OW(t){return{name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:Qu,width:Pi.toString(),height:Pi.toString(),patternUnits:"userSpaceOnUse"},children:WW(t)}]}}function Lu(t,e,r,i){let n={class:`pcb-keepout ${r} pcb-keepout-background`,"data-type":"pcb_keepout","data-pcb-layer":e,"data-pcb-keepout-id":t,stroke:"none"};if(i)n["data-description"]=i;return n}function Eu(t,e,r,i){let n={class:`pcb-keepout ${r} pcb-keepout-pattern`,fill:`url(#${Qu})`,"data-type":"pcb_keepout","data-pcb-layer":e,"data-pcb-keepout-id":t,stroke:"none"};if(i)n["data-description"]=i;return n}function jW(t,e){let{transform:r,layer:i,colorMap:n}=e;if(i&&!t.layers.includes(i))return[];let o=[],a=n.keepout;for(let s of t.layers){if(i&&s!==i)continue;if(t.shape==="rect"){let l=t,[c,d]=F(r,[l.center.x,l.center.y]),h=l.width*Math.abs(r.a),y=l.height*Math.abs(r.d),_=oe(Ft(Yt(c,d))),m={...Lu(l.pcb_keepout_id,s,"pcb-keepout-rect",l.description),x:(-h/2).toString(),y:(-y/2).toString(),width:h.toString(),height:y.toString(),fill:Iu,transform:_},g={...Eu(l.pcb_keepout_id,s,"pcb-keepout-rect",l.description),x:(-h/2).toString(),y:(-y/2).toString(),width:h.toString(),height:y.toString(),transform:_};o.push({name:"rect",type:"element",attributes:m,children:[],value:""},{name:"rect",type:"element",attributes:g,children:[],value:""})}else if(t.shape==="circle"){let l=t,[c,d]=F(r,[l.center.x,l.center.y]),h=l.radius*Math.abs(r.a),y={...Lu(l.pcb_keepout_id,s,"pcb-keepout-circle",l.description),cx:c.toString(),cy:d.toString(),r:h.toString(),fill:Iu},_={...Eu(l.pcb_keepout_id,s,"pcb-keepout-circle",l.description),cx:c.toString(),cy:d.toString(),r:h.toString()};o.push({name:"circle",type:"element",attributes:y,children:[],value:""},{name:"circle",type:"element",attributes:_,children:[],value:""})}else if(t.shape==="outline"){let l=t,c=l.outline.map((_,m)=>{let[g,b]=F(r,[_.x,_.y]);return m===0?`M ${g} ${b}`:`L ${g} ${b}`}).join(" "),d=l.stroke_width*Math.abs(r.a),h={...Lu(l.pcb_keepout_id,s,"pcb-keepout-outline",l.description),d:c,fill:"none",stroke:Iu,"stroke-width":d.toString(),"stroke-linecap":"round","stroke-linejoin":"round"},y={...Eu(l.pcb_keepout_id,s,"pcb-keepout-outline",l.description),d:c,fill:"none",stroke:`url(#${Qu})`,"stroke-width":d.toString(),"stroke-linecap":"round","stroke-linejoin":"round"};o.push({name:"path",type:"element",attributes:h,children:[],value:""},{name:"path",type:"element",attributes:y,children:[],value:""})}}return o}function RW({elementType:t,shapeAttributes:e,layer:r,colorMap:i,additionalAttributes:n}){let o={class:"pcb-soldermask-cutout",fill:i.substrate,"data-type":"pcb_soldermask_opening","data-pcb-layer":r,...e,...n};return{name:t,type:"element",value:"",children:[],attributes:o}}function CW(t,e){let{transform:r,layer:i,colorMap:n,showSolderMask:o}=e,{layer:a}=t;if(i&&a!==i)return[];let s=S5(t,r);if(!s)return[];let{elementType:l,shapeAttributes:c}=s,d=he(a,n),h="0.5",y=t.covered_with_solder_mask!==!1,_=a==="bottom"?n.soldermaskOverCopper.bottom:n.soldermaskOverCopper.top,m="0.9",g={name:l,type:"element",value:"",children:[],attributes:{class:`pcb-copper-pour pcb-copper-pour-${t.shape}`,...c,fill:d,"fill-opacity":h,"data-type":"pcb_copper_pour","data-pcb-layer":a}},b=o?y?Ru({elementType:l,shapeAttributes:c,layer:a,fillColor:_,fillOpacity:m,className:"pcb-soldermask-covered-pour"}):RW({elementType:l,shapeAttributes:c,layer:a,colorMap:n}):null;if(!b)return[g];if(!y&&t.pcb_copper_pour_id?.includes("substrate_only"))return[b];return[g,b]}function XW(t,e){let{transform:r,layer:i}=e;if(i&&t.layer!==i)return[];if(t.shape==="polygon"){let a=ji(t.points,r);for(let s of t.holes??[])a+=` ${ji(s,r)}`;return[{name:"path",type:"element",value:"",children:[],attributes:{class:"pcb-solder-paste",fill:Tr(t.layer),d:a,"fill-rule":"evenodd","data-type":"pcb_solder_paste","data-pcb-layer":t.layer}}]}let[n,o]=F(r,[t.x,t.y]);if(t.shape==="rect"||t.shape==="rotated_rect"){let a=t.width*Math.abs(r.a),s=t.height*Math.abs(r.d);if(t.shape==="rotated_rect"&&t.ccw_rotation)return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:Tr(t.layer),x:(-a/2).toString(),y:(-s/2).toString(),width:a.toString(),height:s.toString(),transform:`translate(${n} ${o}) rotate(${-t.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":t.layer}}];return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:Tr(t.layer),x:(n-a/2).toString(),y:(o-s/2).toString(),width:a.toString(),height:s.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":t.layer}}]}if(t.shape==="pill"){let a=t.width*Math.abs(r.a),s=t.height*Math.abs(r.d),l=t.radius*Math.abs(r.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:Tr(t.layer),x:(n-a/2).toString(),y:(o-s/2).toString(),width:a.toString(),height:s.toString(),rx:l.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":t.layer}}]}if(t.shape==="rotated_pill"){let a=t.width*Math.abs(r.a),s=t.height*Math.abs(r.d),l=t.radius*Math.abs(r.a);return[{name:"rect",type:"element",attributes:{class:"pcb-solder-paste",fill:Tr(t.layer),x:(-a/2).toString(),y:(-s/2).toString(),width:a.toString(),height:s.toString(),rx:l.toString(),transform:`translate(${n} ${o}) rotate(${-t.ccw_rotation})`,"data-type":"pcb_solder_paste","data-pcb-layer":t.layer}}]}if(t.shape==="oval"){let a=t.width*Math.abs(r.a),s=t.height*Math.abs(r.d);return[{name:"ellipse",type:"element",attributes:{class:"pcb-solder-paste",fill:Tr(t.layer),cx:n.toString(),cy:o.toString(),rx:(a/2).toString(),ry:(s/2).toString(),"data-type":"pcb_solder_paste","data-pcb-layer":t.layer}}]}if(t.shape==="circle"){let a=t.radius*Math.abs(r.a);return[{name:"circle",type:"element",attributes:{class:"pcb-solder-paste",fill:Tr(t.layer),cx:n.toString(),cy:o.toString(),r:a.toString(),"data-type":"pcb_solder_paste","data-pcb-layer":t.layer}}]}}var $W="rgba(255, 255, 255, 0.5)",e5="pcb-grid-pattern";function NW({grid:t,svgWidth:e,svgHeight:r}){if(!t)return{};let i=t.lineColor??$W,{cellSize:n,majorCellSize:o}=t,a=t.majorLineColor??i;if(o!==void 0){if(!n||n<=0)throw Error("grid.majorCellSize requires a positive grid.cellSize");if(o<=0)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize");let h=o/n,y=Math.round(h);if(!Number.isFinite(h)||Math.abs(h-y)>0.000001)throw Error("grid.majorCellSize must be a positive multiple of grid.cellSize")}if(!n||n<=0)return{};let s=o!==void 0,l=s?VW(n,o,i,a):[{name:"path",type:"element",value:"",attributes:{d:`M ${n} 0 L 0 0 0 ${n}`,fill:"none",stroke:i,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}],c={name:"defs",type:"element",value:"",attributes:{},children:[{name:"pattern",type:"element",value:"",attributes:{id:e5,width:s?o.toString():n.toString(),height:s?o.toString():n.toString(),patternUnits:"userSpaceOnUse"},children:l}]},d={name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:e.toString(),height:r.toString(),fill:`url(#${e5})`,"pointer-events":"none","data-type":"pcb_grid","data-pcb-layer":"global"},children:[]};return{defs:c,rect:d}}function VW(t,e,r,i){let n=[],o=Math.round(e/t);for(let a=0;a<o;a+=1){let l=Number((a*t).toFixed(6)).toString(),c=a===0?i:r,d=e.toString();n.push({name:"line",type:"element",value:"",attributes:{x1:l,y1:"0",x2:l,y2:d,stroke:c,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]}),n.push({name:"line",type:"element",value:"",attributes:{x1:"0",y1:l,x2:d,y2:l,stroke:c,"stroke-width":"1","shape-rendering":"crispEdges"},children:[]})}return n}function zW(t,e){let{transform:r,circuitJson:i}=e,{center:n,width:o,height:a,rotation:s=0}=t,[l,c]=F(r,[n.x,n.y]),d=o*Math.abs(r.a),h=a*Math.abs(r.d),y=`translate(${l}, ${c}) rotate(${-s}) scale(1, -1)`,_=[];if(e.showAnchorOffsets&&i&&t.position_mode==="relative_to_group_anchor"&&(t.positioned_relative_to_pcb_group_id||t.positioned_relative_to_pcb_board_id)){let m=DW(t,i);if(m)_.push(...Du({groupAnchorPosition:m,componentPosition:n,transform:r,componentWidth:o,componentHeight:a,displayXOffset:t.display_offset_x,displayYOffset:t.display_offset_y}))}if(!e.colorMap.debugComponent?.fill&&!e.colorMap.debugComponent?.stroke)return _;return _.push({name:"g",type:"element",attributes:{transform:y,"data-type":"pcb_component","data-pcb-layer":t.layer??"top"},children:[{name:"rect",type:"element",attributes:{class:"pcb-component",x:(-d/2).toString(),y:(-h/2).toString(),width:d.toString(),height:h.toString(),fill:e.colorMap.debugComponent.fill??"transparent",stroke:e.colorMap.debugComponent.stroke??"transparent","data-type":"pcb_component","data-pcb-layer":t.layer??"top"}}],value:""}),_}function DW(t,e){if(t.positioned_relative_to_pcb_group_id){let r=e.find((n)=>n.type==="pcb_group"&&n.pcb_group_id===t.positioned_relative_to_pcb_group_id),i=Wn(r);if(i)return i}if(t.positioned_relative_to_pcb_board_id){let r=e.find((n)=>n.type==="pcb_board"&&n.pcb_board_id===t.positioned_relative_to_pcb_board_id),i=Wn(r);if(i)return i}return}var r5=["rgba(100, 200, 255, 0.6)","rgba(255, 150, 100, 0.6)","rgba(100, 255, 150, 0.6)","rgba(200, 100, 255, 0.6)","rgba(255, 220, 100, 0.6)","rgba(255, 100, 200, 0.6)","rgba(100, 255, 255, 0.6)","rgba(180, 255, 100, 0.6)"],QW=0.1;function UW(t,e){let{transform:r,circuitJson:i}=e,{center:n,width:o,height:a}=t,s=[];if(e.showAnchorOffsets&&t.position_mode==="relative_to_group_anchor"&&i){let T=HW(t,i);if(T)s.push(...Du({groupAnchorPosition:T,componentPosition:t.anchor_position??t.center,transform:r,componentWidth:t.width,componentHeight:t.height,displayXOffset:t.display_offset_x,displayYOffset:t.display_offset_y}))}let l=Array.isArray(t.outline)?t.outline:void 0,c=QW*Math.abs(r.a),d=0.3*Math.abs(r.a),h=0.15*Math.abs(r.a),y={class:"pcb-group",fill:"none",stroke:ZW(t.pcb_group_id),"stroke-width":c.toString(),"stroke-dasharray":`${d} ${h}`,"data-type":"pcb_group","data-pcb-group-id":t.pcb_group_id,"data-pcb-layer":"overlay"};if(t.name)y["data-group-name"]=t.name;if(l&&l.length>=3&&l.every((T)=>T&&typeof T.x==="number"&&typeof T.y==="number")){let T=l.map((P,O)=>{let[D,N]=F(r,[P.x,P.y]);return O===0?`M ${D} ${N}`:`L ${D} ${N}`}).join(" ");return s.push({name:"path",type:"element",value:"",children:[],attributes:{...y,d:`${T} Z`}}),s}if(!n||typeof n.x!=="number"||typeof n.y!=="number"||typeof o!=="number"||typeof a!=="number")return Zt(`[pcb_group] Invalid data for "${t.pcb_group_id}"${t.name?` (name: "${t.name}")`:""}: expected center {x: number, y: number}, width: number, height: number, got center=${JSON.stringify(n)}, width=${JSON.stringify(o)}, height=${JSON.stringify(a)}`),s;let _=o/2,m=a/2,[g,b]=F(r,[n.x-_,n.y+m]),[v,k]=F(r,[n.x+_,n.y-m]),x=Math.min(g,v),A=Math.min(b,k),S=Math.abs(v-g),E=Math.abs(k-b),I={name:"rect",type:"element",value:"",attributes:{...y,x:x.toString(),y:A.toString(),width:S.toString(),height:E.toString()},children:[]};return s.push(I),s}function ZW(t){let e=t.match(/(\d+)$/),r=e?Number.parseInt(e[1],10):0;return r5[r%r5.length]}function HW(t,e){if(t.positioned_relative_to_pcb_group_id){let r=e.find((n)=>n.type==="pcb_group"&&n.pcb_group_id===t.positioned_relative_to_pcb_group_id),i=Wn(r);if(i)return i}if(t.positioned_relative_to_pcb_board_id){let r=e.find((n)=>n.type==="pcb_board"&&n.pcb_board_id===t.positioned_relative_to_pcb_board_id),i=Wn(r);if(i)return i}return}function D5(t){return t.find((r)=>r.type==="project_software_metadata"||r.type==="source_project_metadata")?.software_used_string}var GW={name:"circuit-to-svg",type:"module",engines:{node:"24.x"},version:"0.0.449",repository:{type:"git",url:"https://github.com/tscircuit/circuit-to-svg.git"},description:"Convert Circuit JSON to SVG",main:"dist/index.js",files:["dist"],scripts:{start:"cosmos",prepublish:"npm run build",prepare:"node scripts/prepare-git.cjs",build:"tsup-node ./lib/index.ts --format esm --dts --sourcemap --external tscircuit",format:"biome format . --write","format:check":"biome format .",cosmos:"cosmos","cosmos-export":"cosmos-export"},license:"ISC",devDependencies:{"@biomejs/biome":"^1.9.4","@resvg/resvg-js":"^2.6.2","@tscircuit/alphabet":"^0.0.27","@tscircuit/checks-latest":"npm:@tscircuit/checks@0.0.179","@tscircuit/circuit-json-util":"^0.0.115","@types/bun":"^1.2.8","@types/color":"^4.2.1","@types/debug":"^4.1.12","@vitejs/plugin-react":"5.0.0",biome:"^0.3.3","bun-match-svg":"^0.0.12","circuit-json":"^0.0.522","circuit-json-to-connectivity-map":"^0.0.23",esbuild:"^0.20.2","format-si-unit":"^0.0.12","performance-now":"^2.1.0",react:"19.1.0","react-cosmos":"7.0.0","react-cosmos-plugin-vite":"7.0.0","react-dom":"19.1.0","schematic-symbols":"^0.0.246",tscircuit:"^0.0.2629",tsup:"^8.0.2",typescript:"^5.4.5","vite-tsconfig-paths":"^5.0.1"},peerDependencies:{"@tscircuit/alphabet":"*","@tscircuit/circuit-json-util":"*","circuit-json":"*","circuit-json-to-connectivity-map":"*","schematic-symbols":"*"},dependencies:{"@types/node":"^22.5.5","bun-types":"^1.1.40","calculate-elbow":"0.0.12",color:"^5.0.3",debug:"^4.4.3","svg-path-commander":"^2.1.11",svgson:"^5.3.1","transformation-matrix":"^2.16.1"}},Q5=GW.version;function qW({objects:t,layer:e,width:r,height:i,showSolderMask:n=!1}){let o=t.filter((d)=>d.attributes["data-pcb-layer"]===e&&(d.attributes.class==="pcb-pad"||d.attributes.class==="pcb-pad-exposed"||d.attributes["data-type"]==="pcb_soldermask_opening"));if(o.length===0)return null;let a=t.filter((d)=>d.attributes["data-type"]==="pcb_via").flatMap((d)=>d.children).filter((d)=>d.attributes.class==="pcb-via-tenting"||d.attributes.class==="pcb-via-tenting-hole"),s=t.filter((d)=>n&&d.attributes["data-pcb-layer"]===e&&(d.attributes["data-type"]==="pcb_copper_pour"||d.attributes.class==="pcb-soldermask-covered-pour")),l=o.filter((d)=>d.attributes.class==="pcb-pad"||d.attributes.class==="pcb-pad-exposed"),c=[];for(let{targets:d,cutouts:h,maskId:y}of[{targets:a,cutouts:o,maskId:`via-tenting-mask-${e}`},{targets:s,cutouts:l,maskId:`copper-pour-pad-opening-mask-${e}`}]){if(d.length===0||h.length===0)continue;for(let _ of d)_.attributes.mask=`url(#${y})`;c.push(KW(y,h,r,i))}if(c.length===0)return null;return{name:"defs",type:"element",value:"",attributes:{},children:c}}function KW(t,e,r,i){return{name:"mask",type:"element",value:"",attributes:{id:t,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:String(r),height:String(i)},children:[{name:"rect",type:"element",value:"",attributes:{x:"0",y:"0",width:String(r),height:String(i),fill:"white"},children:[]},...e.map((n)=>({...n,attributes:{...n.attributes,fill:"black"}}))]}}function U5(t,e="error_text_overlay"){let r=t.filter((o)=>o.type.endsWith("_error"));if(r.length===0)return null;let i=r.map((o)=>o.message).filter((o)=>!!o);if(i.length===0)return null;return{name:"text",type:"element",value:"",attributes:{x:"10",y:"20",fill:"red","font-family":"monospace","font-size":"12px","data-type":e,"data-layer":"global"},children:i.map((o,a)=>({name:"tspan",type:"element",value:"",attributes:{x:"10",dy:a===0?"0":"1.2em"},children:[{type:"text",value:o,name:"",attributes:{},children:[]}]}))}}function JW({anchorPosition:t,textWidth:e,textHeight:r,anchorAlignment:i}){switch(i){case"top_left":return{x:t.x+e/2,y:t.y+r/2};case"top_center":return{x:t.x,y:t.y+r/2};case"top_right":return{x:t.x-e/2,y:t.y+r/2};case"center_left":return{x:t.x+e/2,y:t.y};case"center_right":return{x:t.x-e/2,y:t.y};case"bottom_left":return{x:t.x+e/2,y:t.y-r/2};case"bottom_center":return{x:t.x,y:t.y-r/2};case"bottom_right":return{x:t.x-e/2,y:t.y-r/2};case"center":default:return t}}function tO(t){let{POSITIVE_INFINITY:e,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i,NEGATIVE_INFINITY:n}=Number,o=!1,{POSITIVE_INFINITY:a,POSITIVE_INFINITY:s,NEGATIVE_INFINITY:l,NEGATIVE_INFINITY:c}=Number,d=!1;for(let x of t)if(x.type==="pcb_panel"){let A=x,S=L.parse(A.width),E=L.parse(A.height);if(S===void 0||E===void 0)continue;let I=A.center??{x:S/2,y:E/2};h({center:I,width:S,height:E})}else if(x.type==="pcb_board"){if(x.outline&&Array.isArray(x.outline)&&x.outline.length>=3)_(x.outline),m(x.outline);else if("center"in x&&"width"in x&&"height"in x)h({center:x.center,width:x.width,height:x.height}),y({center:x.center,width:x.width,height:x.height})}else if(x.type==="pcb_courtyard_rect")h({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.ccw_rotation});else if(x.type==="pcb_soldermask_opening")if(x.shape==="polygon")g(x.points);else if(x.shape==="circle")h({center:{x:x.x,y:x.y},width:x.radius*2,height:x.radius*2});else h({center:{x:x.x,y:x.y},width:x.width,height:x.height,ccwRotationDegrees:x.shape==="rotated_rect"?x.ccw_rotation:0});else if(x.type==="pcb_solder_paste"&&x.shape==="polygon")g(x.points);else if(x.type==="pcb_smtpad"){let A=x;if(A.shape==="rect"||A.shape==="pill")h({center:{x:A.x,y:A.y},width:A.width,height:A.height});else if(A.shape==="rotated_rect"||A.shape==="rotated_pill")h({center:{x:A.x,y:A.y},width:A.width,height:A.height,ccwRotationDegrees:A.ccw_rotation});else if(A.shape==="circle"){let S=L.parse(A.radius);if(S!==void 0)h({center:{x:A.x,y:A.y},width:S*2,height:S*2})}else if(A.shape==="polygon")g(A.points)}else if(x.type==="pcb_via"){let A=L.parse(x.outer_diameter);h({center:{x:x.x,y:x.y},width:A??0,height:A??0})}else if(x.type==="pcb_plated_hole"){let A=x,S={x:A.x,y:A.y};if(A.shape==="circle"){let E=L.parse(A.outer_diameter);h({center:S,width:E??0,height:E??0})}else if(A.shape==="oval"||A.shape==="pill")h({center:S,width:A.outer_width,height:A.outer_height});else if(A.shape==="circular_hole_with_rect_pad"||A.shape==="pill_hole_with_rect_pad")h({center:S,width:A.rect_pad_width,height:A.rect_pad_height});else if(A.shape==="rotated_pill_hole_with_rect_pad")h({center:S,width:A.rect_pad_width,height:A.rect_pad_height,ccwRotationDegrees:A.rect_ccw_rotation});else if(A.shape==="hole_with_polygon_pad")g((A.pad_outline??[]).map((E)=>({x:A.x+E.x,y:A.y+E.y})))}else if(x.type==="pcb_hole"){let A=x,S={x:A.x,y:A.y};if(A.hole_shape==="circle"||A.hole_shape==="square"){let E=L.parse(A.hole_diameter);h({center:S,width:E??0,height:E??0})}else if(A.hole_shape==="rotated_pill")h({center:S,width:A.hole_width,height:A.hole_height,ccwRotationDegrees:A.ccw_rotation});else if(A.hole_shape==="oval"||A.hole_shape==="rect"||A.hole_shape==="pill")h({center:S,width:A.hole_width,height:A.hole_height})}else if(x.type==="pcb_note_line")g([{x:x.x1,y:x.y1},{x:x.x2,y:x.y2}]);else if("x"in x&&"y"in x)h({center:{x:x.x,y:x.y},width:0,height:0});else if("route"in x)g(x.route);else if(x.type==="pcb_note_rect"||x.type==="pcb_fabrication_note_rect")h({center:x.center,width:x.width,height:x.height});else if(x.type==="pcb_note_dimension"||x.type==="pcb_fabrication_note_dimension"){let A=x,{from:S,to:E,text:I,font_size:T=1,arrow_size:P,offset_distance:O,offset_direction:D}=A;if(!S||!E||!P)continue;h({center:S,width:0,height:0}),h({center:E,width:0,height:0});let N=(at)=>{let U=Math.hypot(at.x,at.y)||1;return{x:at.x/U,y:at.y/U}},G=N({x:E.x-S.x,y:E.y-S.y});if(Number.isNaN(G.x)||Number.isNaN(G.y))continue;let K={x:-G.y,y:G.x},vt=D&&typeof D.x==="number"&&typeof D.y==="number",H=vt?N(D):{x:0,y:0},ht=typeof O==="number"?O:0,wt={x:H.x*ht,y:H.y*ht},et={x:S.x+wt.x,y:S.y+wt.y},Q={x:E.x+wt.x,y:E.y+wt.y};h({center:et,width:0,height:0}),h({center:Q,width:0,height:0});let V=vt&&(Math.abs(H.x)>Number.EPSILON||Math.abs(H.y)>Number.EPSILON)?H:K,tt=ht+P,C={x:S.x+V.x*tt,y:S.y+V.y*tt},ot={x:E.x+V.x*tt,y:E.y+V.y*tt};h({center:C,width:0,height:0}),h({center:ot,width:0,height:0});let it=P/2,lt={x:et.x+G.x*P,y:et.y+G.y*P},mt={x:Q.x-G.x*P,y:Q.y-G.y*P},pt={x:lt.x+K.x*it,y:lt.y+K.y*it},xt={x:lt.x-K.x*it,y:lt.y-K.y*it};h({center:pt,width:0,height:0}),h({center:xt,width:0,height:0});let dt={x:mt.x+K.x*it,y:mt.y+K.y*it},Lt={x:mt.x-K.x*it,y:mt.y-K.y*it};if(h({center:dt,width:0,height:0}),h({center:Lt,width:0,height:0}),I){let at={x:(S.x+E.x)/2+wt.x,y:(S.y+E.y)/2+wt.y},U=P*1.5,Bt={x:at.x+K.x*U,y:at.y+K.y*U},Pt=I.length*T*0.6;h({center:Bt,width:Pt,height:T})}}else if(x.type==="pcb_note_text"||x.type==="pcb_fabrication_note_text")v({text:x.text,anchorPosition:x.anchor_position,fontSize:x.font_size,anchorAlignment:x.anchor_alignment,ccwRotationDegrees:x.type==="pcb_fabrication_note_text"?x.ccw_rotation??1:0});else if(x.type==="pcb_cutout"){let A=x;if(A.shape==="rect")h({center:A.center,width:A.width,height:A.height,ccwRotationDegrees:A.rotation});else if(A.shape==="circle"){let S=L.parse(A.radius);if(S!==void 0)h({center:A.center,width:S*2,height:S*2})}else if(A.shape==="polygon")g(A.points);else if(A.shape==="path"){let S=A;if(S.route&&Array.isArray(S.route))g(S.route)}}else if(x.type==="pcb_keepout"){let A=x;if(A.shape==="rect")h({center:A.center,width:A.width,height:A.height});else if(A.shape==="circle"){let S=typeof A.radius==="number"?A.radius:L.parse(A.radius)??0;if(S>0)h({center:A.center,width:S*2,height:S*2})}else if(A.shape==="outline")for(let S of A.outline)h({center:S,width:A.stroke_width,height:A.stroke_width})}else if(x.type==="pcb_silkscreen_graphic"||x.type==="pcb_silkscreen_text"||x.type==="pcb_silkscreen_rect"||x.type==="pcb_silkscreen_circle"||x.type==="pcb_silkscreen_line"||x.type==="pcb_silkscreen_oval"||x.type==="pcb_silkscreen_pill")k(x);else if(x.type==="pcb_copper_text")h({center:x.anchor_position,width:0,height:0});else if(x.type==="pcb_copper_pour"){if(x.shape==="rect")h({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.rotation});else if(x.shape==="polygon")g(x.points);else if(x.shape==="brep")g(x.brep_shape.outer_ring.vertices)}return{minX:e,minY:r,maxX:i,maxY:n,boardMinX:a,boardMinY:s,boardMaxX:l,boardMaxY:c,hasBounds:o,hasBoardBounds:d};function h({center:x,width:A,height:S,ccwRotationDegrees:E}){if(!x)return;let I=L.parse(x.x),T=L.parse(x.y);if(I===void 0||T===void 0)return;let P=L.parse(A)??0,O=L.parse(S)??0,D=P/2,N=O/2;if(typeof E==="number"&&E!==0){let G=E*Math.PI/180,K=Math.abs(Math.cos(G)),vt=Math.abs(Math.sin(G)),H=D*K+N*vt,ht=D*vt+N*K;D=H,N=ht}e=Math.min(e,I-D),r=Math.min(r,T-N),i=Math.max(i,I+D),n=Math.max(n,T+N),o=!0}function y({center:x,width:A,height:S}){if(!x)return;let E=L.parse(x.x),I=L.parse(x.y);if(E===void 0||I===void 0)return;let T=L.parse(A)??0,P=L.parse(S)??0,O=T/2,D=P/2;a=Math.min(a,E-O),s=Math.min(s,I-D),l=Math.max(l,E+O),c=Math.max(c,I+D),o=!0,d=!0}function _(x){let A=!1;for(let S of x){let E=L.parse(S.x),I=L.parse(S.y);if(E===void 0||I===void 0)continue;e=Math.min(e,E),r=Math.min(r,I),i=Math.max(i,E),n=Math.max(n,I),A=!0}if(A)o=!0}function m(x){let A=!1;for(let S of x){let E=L.parse(S.x),I=L.parse(S.y);if(E===void 0||I===void 0)continue;a=Math.min(a,E),s=Math.min(s,I),l=Math.max(l,E),c=Math.max(c,I),A=!0}if(A)o=!0,d=!0}function g(x){let A=!1,S=[...x.flatMap(b),...A5(x).flatMap(F5)];for(let E of S)for(let I of[E]){let T=L.parse(I.x),P=L.parse(I.y);if(T===void 0||P===void 0)continue;e=Math.min(e,T),r=Math.min(r,P),i=Math.max(i,T),n=Math.max(n,P),A=!0}if(A)o=!0}function b(x){return"route_type"in x?$P(x):[x]}function v({text:x,anchorPosition:A,fontSize:S=1,anchorAlignment:E="center",ccwRotationDegrees:I=0}){if(!x||!A)return;let T=x.split(`
`),O=Math.max(...T.map((G)=>G.length),0)*S*0.6,D=Math.max(T.length,1)*S,N=JW({anchorPosition:A,textWidth:O,textHeight:D,anchorAlignment:E});h({center:N,width:O,height:D,ccwRotationDegrees:I})}function k(x){if(x.type==="pcb_silkscreen_text")h({center:x.anchor_position,width:0,height:0});else if(x.type==="pcb_silkscreen_graphic"){for(let A of x.brep_shape.outer_ring.vertices)h({center:{x:A.x,y:A.y},width:0,height:0});for(let A of x.brep_shape.inner_rings??[])for(let S of A.vertices)h({center:{x:S.x,y:S.y},width:0,height:0})}else if(x.type==="pcb_silkscreen_path")g(x.route);else if(x.type==="pcb_silkscreen_rect")h({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.ccw_rotation});else if(x.type==="pcb_silkscreen_circle"){let A=L.parse(x.radius);if(A!==void 0)h({center:x.center,width:A*2,height:A*2})}else if(x.type==="pcb_silkscreen_line")h({center:{x:x.x1,y:x.y1},width:0,height:0}),h({center:{x:x.x2,y:x.y2},width:0,height:0});else if(x.type==="pcb_silkscreen_oval"){let A=L.parse(x.radius_x),S=L.parse(x.radius_y);if(A!==void 0&&S!==void 0)h({center:x.center,width:A*2,height:S*2})}else if(x.type==="pcb_silkscreen_pill")h({center:x.center,width:x.width,height:x.height,ccwRotationDegrees:x.ccw_rotation});else if(x.type==="pcb_cutout"){let A=x;if(A.shape==="rect")h({center:A.center,width:A.width,height:A.height,ccwRotationDegrees:A.rotation});else if(A.shape==="circle"){let S=L.parse(A.radius);if(S!==void 0)h({center:A.center,width:S*2,height:S*2})}else if(A.shape==="polygon")g(A.points);else if(A.shape==="path"){let S=A;if(S.route&&Array.isArray(S.route))g(S.route)}}}}var eO=({circuitJson:t,drawPaddingOutsideBoard:e,baseBounds:r,viewportOptions:i})=>{let n=e?1:0,o=e||!r.hasBoardBounds?r.minX:r.boardMinX,a=e||!r.hasBoardBounds?r.minY:r.boardMinY,s=e||!r.hasBoardBounds?r.maxX:r.boardMaxX,l=e||!r.hasBoardBounds?r.maxY:r.boardMaxY,c=!1,{POSITIVE_INFINITY:d,POSITIVE_INFINITY:h,NEGATIVE_INFINITY:y,NEGATIVE_INFINITY:_}=Number,m=new Map,g=new Map;for(let b of t)if(b.type==="pcb_panel"){let v=b,k=i5(v.center,v.width,v.height);if(!k)continue;if(d=Math.min(d,k.minX),h=Math.min(h,k.minY),y=Math.max(y,k.maxX),_=Math.max(_,k.maxY),c=!0,v.pcb_panel_id)m.set(v.pcb_panel_id,k)}else if(b.type==="pcb_board"){let v=b,x=rO(v.outline)??i5(v.center,v.width,v.height);if(x&&v.pcb_board_id)g.set(v.pcb_board_id,x)}if(i?.viewport){let{minX:b,minY:v,maxX:k,maxY:x}=i.viewport;o=b,a=v,s=k,l=x,n=0}else if(i?.viewportTarget?.pcb_panel_id){let b=m.get(i.viewportTarget.pcb_panel_id);if(!b)throw Error(`Viewport target panel '${i.viewportTarget.pcb_panel_id}' not found`);o=b.minX,a=b.minY,s=b.maxX,l=b.maxY,n=0}else if(i?.viewportTarget?.pcb_board_id){let b=g.get(i.viewportTarget.pcb_board_id);if(!b)throw Error(`Viewport target board '${i.viewportTarget.pcb_board_id}' not found`);o=b.minX,a=b.minY,s=b.maxX,l=b.maxY,n=0}else if(c)o=d,a=h,s=y,l=_;return{boundsMinX:o,boundsMinY:a,boundsMaxX:s,boundsMaxY:l,padding:n}};function i5(t,e,r){if(!t||e===void 0||r===void 0)return;let i=L.parse(t.x),n=L.parse(t.y);if(i===void 0||n===void 0)return;let o=L.parse(e),a=L.parse(r);if(o===void 0||a===void 0)return;let s=o/2,l=a/2;return{minX:i-s,minY:n-l,maxX:i+s,maxY:n+l}}function rO(t){if(!t||t.length<3)return;let{POSITIVE_INFINITY:e,POSITIVE_INFINITY:r,NEGATIVE_INFINITY:i,NEGATIVE_INFINITY:n}=Number;for(let o of t){let a=L.parse(o.x),s=L.parse(o.y);if(a===void 0||s===void 0)continue;e=Math.min(e,a),r=Math.min(r,s),i=Math.max(i,a),n=Math.max(n,s)}if(!Number.isFinite(e)||!Number.isFinite(r))return;if(!Number.isFinite(i)||!Number.isFinite(n))return;return{minX:e,minY:r,maxX:i,maxY:n}}var iO=0.5,nO=0.42,oO=0.58,aO=0.75;function n5(t,e){if(!e.showPinNumbers)return[];if(t.type==="pcb_smtpad"){if(e.layer&&t.layer!==e.layer)return[]}else if(e.layer&&!t.layers.includes(e.layer))return[];let r=rT(t,e.circuitJson);if(!r)return[];let i=sO(t);if(!i||i.width<=0||i.height<=0)return[];let n=Math.abs(e.transform.a),o=Math.min(iO,i.height*nO,i.width*aO/(r.length*oO));if(o<=0)return[];let[a,s]=F(e.transform,[i.centerX,i.centerY]),l=t.type==="pcb_smtpad"?t.layer:"through",c=i.ccwRotation?`rotate(${-i.ccwRotation} ${a} ${s})`:void 0;return[{name:"text",type:"element",value:"",attributes:{class:"pcb-pad-pin-number",x:a.toString(),y:s.toString(),fill:"#b0b0b0","font-family":"Arial, sans-serif","font-size":(o*n).toString(),"font-weight":"500","text-anchor":"middle","dominant-baseline":"central","pointer-events":"none","data-type":"pcb_pad_pin_number","data-pcb-layer":l,"data-pin-number":r,...c?{transform:c}:{}},children:[{type:"text",value:r,name:"",attributes:{},children:[]}]}]}function sO(t){if(t.type==="pcb_smtpad"){if(t.shape==="polygon")return o5(t.points);if(t.shape==="circle")return{centerX:t.x,centerY:t.y,width:t.radius*2,height:t.radius*2,ccwRotation:0};return{centerX:t.x,centerY:t.y,width:t.width,height:t.height,ccwRotation:t.shape==="rotated_rect"||t.shape==="rotated_pill"?t.ccw_rotation:0}}if(t.shape==="circle")return{centerX:t.x,centerY:t.y,width:t.outer_diameter,height:t.outer_diameter,ccwRotation:0};if(t.shape==="oval"||t.shape==="pill")return{centerX:t.x,centerY:t.y,width:t.outer_width,height:t.outer_height,ccwRotation:t.ccw_rotation};if(t.shape==="hole_with_polygon_pad"){let e=o5(t.pad_outline);if(!e)return;return{...e,centerX:t.x+e.centerX,centerY:t.y+e.centerY,ccwRotation:0}}if("rect_pad_width"in t)return{centerX:t.x,centerY:t.y,width:t.rect_pad_width,height:t.rect_pad_height,ccwRotation:t.shape==="rotated_pill_hole_with_rect_pad"?t.rect_ccw_rotation:t.shape==="circular_hole_with_rect_pad"?t.rect_ccw_rotation??0:0};return}function o5(t){if(t.length===0)return;let e=t.map((s)=>s.x),r=t.map((s)=>s.y),i=Math.min(...e),n=Math.max(...e),o=Math.min(...r),a=Math.max(...r);return{centerX:(i+n)/2,centerY:(o+a)/2,width:n-i,height:a-o,ccwRotation:0}}var a5="rgb(255, 208, 66)";function cO(t,e){return t.map((r)=>({...r,attributes:{...r.attributes??{},"data-type":e.type,"data-pcb-layer":"overlay"}}))}function lO(t,e,r){if(!r.shouldDrawWarnings)return[];let i=e.find((v)=>v.type==="pcb_component"&&v.pcb_component_id===t.pcb_component_id);if(!i)return[];let n=(i.rotation??0)*Math.PI/180,o=Math.cos(n),a=Math.sin(n),s=i.width/2,l=i.height/2,c=[{x:-s,y:-l},{x:s,y:-l},{x:s,y:l},{x:-s,y:l}].map((v)=>F(r.transform,{x:i.center.x+v.x*o-v.y*a,y:i.center.y+v.x*a+v.y*o})),d=Math.min(...c.map((v)=>v.x)),h=Math.min(...c.map((v)=>v.y)),y=Math.max(...c.map((v)=>v.x)),_=Math.max(...c.map((v)=>v.y)),m=y-d,g=_-h,b=d+m/2;return cO([{name:"rect",type:"element",value:"",attributes:{x:d.toString(),y:h.toString(),width:m.toString(),height:g.toString(),fill:"none",stroke:a5,"stroke-width":"2","stroke-dasharray":"6,3"},children:[]},{name:"text",type:"element",value:"",attributes:{x:b.toString(),y:(h-10).toString(),fill:a5,"font-family":"sans-serif","font-size":"12","font-weight":"600","text-anchor":"middle"},children:[{type:"text",name:"",value:t.message,attributes:{},children:[]}]}],t)}var Z5="#ff4d4d",pO=(t)=>({type:"text",value:t,name:"",attributes:{},children:[]}),Pu=({label:t,x:e,y:r,style:i,anchor:n="start"})=>t?[{name:"text",type:"element",value:"",attributes:{x:e.toString(),y:r.toString(),fill:Z5,"font-family":"monospace","font-size":i.fontSize.toString(),"font-weight":"600","text-anchor":n},children:[pO(t)]}]:[],dO=(t)=>({"data-type":"pcb_debug_object","data-pcb-layer":"overlay","data-pcb-debug-object-id":t.pcb_debug_object_id,"data-debug-shape":t.shape});function hO({debugObject:t,transform:e,style:r,labelStackIndex:i=0}){let n=dO(t),o={fill:"none",stroke:Z5,"stroke-width":r.strokeWidth.toString(),"stroke-dasharray":`${r.dashLength},${r.dashLength}`};if(t.shape==="rect"){let l=F(e,[t.center.x-t.size.width/2,t.center.y-t.size.height/2]),c=F(e,[t.center.x+t.size.width/2,t.center.y+t.size.height/2]),d=Math.min(l[0],c[0]),h=Math.min(l[1],c[1]),y=Math.abs(c[0]-l[0]),_=Math.abs(c[1]-l[1]);return[{name:"g",type:"element",value:"",attributes:n,children:[{name:"rect",type:"element",value:"",attributes:{x:d.toString(),y:h.toString(),width:y.toString(),height:_.toString(),...o},children:[]},...Pu({label:t.label,x:d,y:h-r.labelGap-i*(r.fontSize+r.labelGap),style:r})]}]}if(t.shape==="line"){let[l,c]=F(e,[t.start.x,t.start.y]),[d,h]=F(e,[t.end.x,t.end.y]);return[{name:"g",type:"element",value:"",attributes:n,children:[{name:"line",type:"element",value:"",attributes:{x1:l.toString(),y1:c.toString(),x2:d.toString(),y2:h.toString(),...o},children:[]},...Pu({label:t.label,x:(l+d)/2,y:(c+h)/2-r.labelGap,style:r,anchor:"middle"})]}]}let[a,s]=F(e,[t.center.x,t.center.y]);return[{name:"g",type:"element",value:"",attributes:n,children:[{name:"circle",type:"element",value:"",attributes:{cx:a.toString(),cy:s.toString(),r:r.pointRadius.toString(),...o},children:[]},...Pu({label:t.label,x:a+r.pointRadius+r.labelGap,y:s-r.pointRadius,style:r})]}]}function uO(t){let e=new Map,r=new Map,i=t.filter((a)=>a.type==="pcb_board");for(let a of t)switch(a.type){case"source_group":if(r.set(a.source_group_id,a.subcircuit_id??a.parent_subcircuit_id??a.parent_source_group_id),a.is_subcircuit&&a.subcircuit_id)r.set(a.subcircuit_id,a.parent_subcircuit_id??a.parent_source_group_id);break;case"pcb_group":r.set(a.pcb_group_id,a.subcircuit_id??a.source_group_id);break;case"pcb_component":r.set(a.pcb_component_id,a.subcircuit_id??a.pcb_group_id);break;case"pcb_trace":r.set(a.pcb_trace_id,a.subcircuit_id??a.pcb_group_id??a.pcb_component_id);break;case"pcb_via":r.set(a.pcb_via_id,a.subcircuit_id??a.pcb_group_id??a.pcb_trace_id);break}for(let a of i)if(e.set(a.pcb_board_id,a),a.subcircuit_id)e.set(a.subcircuit_id,a);let n=new Set;function o(a){if(e.has(a))return e.get(a);if(n.has(a)||!r.has(a))return;n.add(a);let s=r.get(a),l=s?o(s):i.length===1?i[0]:void 0;return e.set(a,l),n.delete(a),l}for(let a of r.keys())o(a);return e}function H5(t,e){if(e?.showFabricationNotes===!1)t=t.filter((U)=>!U.type.startsWith("pcb_fabrication_note_"));let r=Boolean(e?.xRayElementIds?.length);if(r&&e?.hiddenLayerOpacity!==void 0&&(!Number.isFinite(e.hiddenLayerOpacity)||e.hiddenLayerOpacity<0||e.hiddenLayerOpacity>1))throw Error("hiddenLayerOpacity must be between 0 and 1");let i=!r&&(e?.drawPaddingOutsideBoard??!0),n=e?.layer,o=e?.colorOverrides,a={...zt.copper};if(o?.copper){for(let[U,Bt]of Object.entries(o.copper))if(Bt!==void 0)a[U]=Bt}let s={copper:a,drill:o?.drill??zt.drill,silkscreen:{top:o?.silkscreen?.top??zt.silkscreen.top,bottom:o?.silkscreen?.bottom??zt.silkscreen.bottom},boardOutline:o?.boardOutline??zt.boardOutline,soldermask:{top:o?.soldermask?.top??zt.soldermask.top,bottom:o?.soldermask?.bottom??zt.soldermask.bottom},soldermaskOverCopper:{top:o?.soldermaskOverCopper?.top??zt.soldermaskOverCopper.top,bottom:o?.soldermaskOverCopper?.bottom??zt.soldermaskOverCopper.bottom},soldermaskWithCopperUnderneath:{top:o?.soldermaskWithCopperUnderneath?.top??zt.soldermaskWithCopperUnderneath.top,bottom:o?.soldermaskWithCopperUnderneath?.bottom??zt.soldermaskWithCopperUnderneath.bottom},substrate:o?.substrate??zt.substrate,courtyard:{top:o?.courtyard?.top??zt.courtyard.top,bottom:o?.courtyard?.bottom??zt.courtyard.bottom},keepout:o?.keepout??zt.keepout,debugComponent:{fill:o?.debugComponent?.fill??zt.debugComponent.fill,stroke:o?.debugComponent?.stroke??zt.debugComponent.stroke}},l=t.filter((U)=>{if(U.type==="pcb_courtyard_rect"&&!e?.showCourtyards)return!1;if(U.type==="pcb_soldermask_opening")return Boolean(e?.showSolderMask)&&(!n||U.layer===n);return!0}),{minX:c,minY:d,maxX:h,maxY:y,boardMinX:_,boardMinY:m,boardMaxX:g,boardMaxY:b,hasBoardBounds:v}=tO(l),{boundsMinX:k,boundsMinY:x,boundsMaxX:A,boundsMaxY:S,padding:E}=eO({circuitJson:t,drawPaddingOutsideBoard:i,baseBounds:{minX:c,minY:d,maxX:h,maxY:y,boardMinX:_,boardMinY:m,boardMaxX:g,boardMaxY:b,hasBoardBounds:v},viewportOptions:{viewport:e?.viewport,viewportTarget:e?.viewportTarget}}),I=A-k+2*E,T=S-x+2*E,P=e?.width??800,O=e?.height??600;if(e?.matchBoardAspectRatio){let U=A-k,Bt=S-x;if(U>0&&Bt>0){let Pt=U/Bt;if(e?.width&&!e?.height)O=e.width/Pt;else if(e?.height&&!e?.width)P=e.height*Pt;else O=P/Pt}}let D=[];for(let U of t)if("route"in U&&U.route!==void 0)D.push(U.route);let N=P/I,G=O/T,K=Math.min(N,G),vt=(P-I*K)/2,H=(O-T*K)/2,ht=Ft(Yt(vt-k*K+E*K,O-H+x*K-E*K),Vt(K,-K)),wt=Math.min(P,O),et=Math.max(1,Math.min(2,wt*0.002)),Q=Math.max(10,Math.min(18,wt*0.02)),V={transform:ht,layer:n,shouldDrawErrors:e?.shouldDrawErrors,shouldDrawWarnings:e?.shouldDrawWarnings,showCourtyards:e?.showCourtyards,showPcbGroups:e?.showPcbGroups,drawPaddingOutsideBoard:i,colorMap:s,showSolderMask:e?.showSolderMask,showSolderPaste:e?.showSolderPaste,showPcbNotes:e?.showPcbNotes??!0,showBendLines:e?.showBendLines,showDebugObjects:e?.showDebugObjects,debugObjectStyle:{fontSize:Q,strokeWidth:et,dashLength:et*4,labelGap:Q*0.35,pointRadius:et*3},showAnchorOffsets:e?.showAnchorOffsets,showPinNumbers:e?.showPinNumbers,circuitJson:t,boardOwnerMap:uO(t),usedCopperPourTraceMaskIds:new Set},tt=r?[]:t.flatMap((U)=>Tu({elm:U,circuitJson:t,ctx:V}));if(!r)tt.push(...pT({circuitJson:t,ctx:V,create:(U,Bt)=>Tu({elm:U,circuitJson:t,ctx:Bt})}));let C=String(0.05*K);for(let U of t)if("stroke_width"in U){C=String(K*U.stroke_width);break}if(!r&&e?.shouldDrawRatsNest){let U=LW(t,V);tt=[...tt,...U]}let ot=r?PP({circuitJson:t,ctx:V,selectedIds:e.xRayElementIds,hiddenOpacity:e?.hiddenLayerOpacity??0.2,width:P,height:O,create:(U,Bt)=>Tu({elm:U,circuitJson:t,ctx:Bt})}):Y5(T5(tt)),it=[{name:"style",type:"element",value:"",attributes:{},children:[{type:"text",value:"",name:"",attributes:{},children:[]}]}],lt=NW({grid:r?void 0:e?.grid,svgWidth:P,svgHeight:O});if(lt.defs)it.push(lt.defs);if(t.some((U)=>U.type==="pcb_keepout"))it.push(OW(s.keepout??zt.keepout));let pt=ZP({circuitJson:t,transform:ht,svgWidth:P,svgHeight:O,usedMaskIds:V.usedCopperPourTraceMaskIds});if(pt)it.push(pt);let xt=qW({showSolderMask:V.showSolderMask,objects:tt,layer:n??"top",width:P,height:O});if(xt)it.push(xt);if(it.push({name:"rect",type:"element",value:"",attributes:{class:"boundary",x:"0",y:"0",fill:e?.backgroundColor??"#000",width:P.toString(),height:O.toString(),"data-type":"pcb_background","data-pcb-layer":"global"},children:[]}),i)it.push(yO(ht,c,d,h,y));if(it.push(...ot),e?.simulationResultId)it.push(...oT({circuitJson:t,resultId:e.simulationResultId,ctx:V,options:e.returnCurrent,width:P,height:O}));if(lt.rect)it.push(lt.rect);if(!r&&e?.showErrorsInTextOverlay){let U=U5(t,"pcb_error_text_overlay");if(U)it.push(U)}let dt=D5(t),Lt=Q5,at={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:P.toString(),height:O.toString(),...dt&&{"data-software-used-string":dt},...e?.includeVersion&&{"data-circuit-to-svg-version":Lt}},value:"",children:it.filter((U)=>U!==null)};try{return O5(at)}catch(U){throw console.error("Error stringifying SVG object:",U),U}}function Tu({elm:t,circuitJson:e,ctx:r}){switch(t.type){case"pcb_debug_object":return r.showDebugObjects?hO({debugObject:t,transform:r.transform,style:r.debugObjectStyle,labelStackIndex:t.shape==="rect"?e.slice(0,e.indexOf(t)).filter((n)=>n.type==="pcb_debug_object"&&n.shape==="rect"&&n.center.x===t.center.x&&n.center.y===t.center.y&&n.size.width===t.size.width&&n.size.height===t.size.height).length:0}):[];case"pcb_trace_error":return hT(t,e,r).filter(Boolean);case"pcb_footprint_overlap_error":return _T(t,e,r).filter(Boolean);case"pcb_courtyard_overlap_error":return mT(t,e,r).filter(Boolean);case"pcb_component_outside_board_error":return gT(t,e,r).filter(Boolean);case"pcb_pad_trace_clearance_error":case"pcb_via_trace_clearance_error":return ST(t,e,r).filter(Boolean);case"pcb_connector_not_in_accessible_orientation_warning":case"pcb_manual_edit_conflict_warning":return lO(t,e,r);case"pcb_component":return zW(t,r).filter(Boolean);case"pcb_trace":return M5(t,r);case"pcb_copper_pour":return CW(t,r);case"pcb_plated_hole":return[...ZT(t,r).filter(Boolean),...n5(t,r)];case"pcb_hole":return YW(t,r);case"pcb_smtpad":return[...P5(t,r),...n5(t,r)];case"pcb_solder_paste":return r.showSolderPaste?XW(t,r):[];case"pcb_silkscreen_text":return aW(t,r);case"pcb_silkscreen_rect":return sW(t,r);case"pcb_silkscreen_circle":return pW(t,r);case"pcb_silkscreen_line":return dW(t,r);case"pcb_silkscreen_pill":return hW(t,r);case"pcb_silkscreen_oval":return uW(t,r);case"pcb_copper_text":return lW(t,r);case"pcb_courtyard_rect":if(!r.showCourtyards)return[];return yW(t,r);case"pcb_courtyard_polygon":if(!r.showCourtyards)return[];return _W(t,r);case"pcb_courtyard_circle":if(!r.showCourtyards)return[];return fW(t,r);case"pcb_courtyard_outline":if(!r.showCourtyards)return[];return mW(t,r);case"pcb_fabrication_note_path":return kT(t,r);case"pcb_fabrication_note_text":return YT(t,r);case"pcb_fabrication_note_rect":return LT(t,r);case"pcb_fabrication_note_dimension":return WT(t,r);case"pcb_note_dimension":if(!r.showPcbNotes)return[];return OT(t,r);case"pcb_note_text":if(!r.showPcbNotes)return[];return RT(t,r);case"pcb_note_rect":if(!r.showPcbNotes)return[];return $T(t,r);case"pcb_note_path":if(!r.showPcbNotes)return[];return VT(t,r);case"pcb_note_line":if(!r.showPcbNotes)return[];return DT(t,r);case"pcb_bend":if(!r.showBendLines)return[];return UT(t,r);case"pcb_silkscreen_path":return HT(t,r);case"pcb_silkscreen_graphic":return GT(t,r);case"pcb_panel":return r.drawPaddingOutsideBoard?kW(t,r):[];case"pcb_board":return r.drawPaddingOutsideBoard?SW(t,r):[];case"pcb_via":if(r.layer&&!t.layers.includes(r.layer))return[];return Vu(t,r);case"pcb_cutout":let i=t;if(i.shape==="path")return PW(i,r);return EW(t,r);case"pcb_keepout":return jW(t,r);case"pcb_group":return r.showPcbGroups?UW(t,r):[];default:return[]}}function yO(t,e,r,i,n){let[o,a]=F(t,[e,r]),[s,l]=F(t,[i,n]),c=Math.abs(s-o),d=Math.abs(l-a),h=Math.min(o,s),y=Math.min(a,l);return{name:"rect",type:"element",value:"",children:[],attributes:{class:"pcb-boundary",fill:"none",stroke:"#fff","stroke-width":"0.3",x:h.toString(),y:y.toString(),width:c.toString(),height:d.toString(),"data-type":"pcb_boundary","data-pcb-layer":"global"}}}var _O={pin_number:0.15,negated_pin_number:0.12,reference_designator:0.18,manufacturer_number:0.18,net_label:0.18,error:0.05},ur=(t,e)=>e??_O[t],ve=(t,e,r)=>Math.abs(t.a)*ur(e,r);function mO(t){let{minX:e,minY:r,maxX:i,maxY:n}=t.bounds,o=t.cellSize??1,a=t.labelCells??!1,s=[],l=(c,d)=>{let[h,y]=F(t.transform,[c,d]);return{x:h,y}};for(let c=Math.floor(e);c<=Math.ceil(i);c+=o){let d=l(c,r),h=l(c,n);s.push({name:"line",type:"element",attributes:{x1:d.x.toString(),y1:d.y.toString(),x2:h.x.toString(),y2:h.y.toString(),stroke:re.schematic.grid,"stroke-width":(0.01*Math.abs(t.transform.a)).toString(),"stroke-opacity":"0.5"}})}for(let c=Math.floor(r);c<=Math.ceil(n);c+=o){let d=l(e,c),h=l(i,c);s.push({name:"line",type:"element",attributes:{x1:d.x.toString(),y1:d.y.toString(),x2:h.x.toString(),y2:h.y.toString(),stroke:re.schematic.grid,"stroke-width":(0.01*Math.abs(t.transform.a)).toString(),"stroke-opacity":"0.5"}})}if(a){let c=(d,h)=>{if(o<=0.1)return`${d.toFixed(1)},${h.toFixed(1)}`;return`${d},${h}`};for(let d=Math.floor(e);d<=Math.ceil(i);d+=o)for(let h=Math.floor(r);h<=Math.ceil(n);h+=o){let y=l(d,h);s.push({name:"text",type:"element",attributes:{x:(y.x-2.5).toString(),y:(y.y-5).toString(),fill:re.schematic.grid,"font-size":(o/5*Math.abs(t.transform.a)).toString(),"fill-opacity":"0.5","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif"},children:[{type:"text",value:c(d,h),name:"",attributes:{},children:[]}]})}}return{name:"g",value:"",type:"element",attributes:{class:"grid sch-grid"},children:s}}function fO(t){let{points:e,transform:r}=t,i=[];for(let n of e){let[o,a]=F(r,[n.x-0.1,n.y-0.1]),[s,l]=F(r,[n.x+0.1,n.y+0.1]),[c,d]=F(r,[n.x-0.1,n.y+0.1]),[h,y]=F(r,[n.x+0.1,n.y-0.1]);i.push({name:"path",type:"element",attributes:{d:`M${o},${a} L${s},${l} M${c},${d} L${h},${y}`,stroke:re.schematic.grid,"stroke-width":(0.02*Math.abs(r.a)).toString(),"stroke-opacity":"0.7"}});let[_,m]=F(r,[n.x+0.15,n.y-0.15]);i.push({name:"text",type:"element",attributes:{x:_.toString(),y:m.toString(),fill:re.schematic.grid,"font-size":(0.1*Math.abs(r.a)).toString(),"fill-opacity":"0.7","text-anchor":"start","font-family":"sans-serif","dominant-baseline":"middle"},children:[{type:"text",value:n.label||`(${n.x},${n.y})`,name:"",attributes:{},children:[]}]})}return{name:"g",value:"",type:"element",attributes:{class:"labeled-points sch-labeled-points"},children:i}}function xO(t){return t.reduce((e,r)=>{if(!e)return r;if(r.sheet_index===void 0)return e;if(e.sheet_index===void 0)return r;return r.sheet_index<e.sheet_index?r:e},void 0)}var s5={"0":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"1":{width:13,height:27,ascent:22,descent:5,left:-3,right:9},"2":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"3":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"4":{width:13,height:27,ascent:22,descent:5,left:0,right:12},"5":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"6":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"7":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"8":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"9":{width:13,height:27,ascent:22,descent:5,left:-1,right:12}," ":{width:7,height:27,ascent:22,descent:5,left:0,right:0},"!":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},'"':{width:9,height:27,ascent:22,descent:5,left:-1,right:7},"#":{width:13,height:27,ascent:22,descent:5,left:0,right:13},$:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"%":{width:21,height:27,ascent:22,descent:5,left:-1,right:20},"&":{width:16,height:27,ascent:22,descent:5,left:-1,right:15},"'":{width:5,height:27,ascent:22,descent:5,left:-1,right:3},"(":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},")":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"*":{width:9,height:27,ascent:22,descent:5,left:-1,right:8},"+":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},",":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"-":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},".":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"/":{width:7,height:27,ascent:22,descent:5,left:0,right:7},":":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},";":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"<":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"=":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},">":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"?":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"@":{width:24,height:27,ascent:22,descent:5,left:-1,right:23},A:{width:16,height:27,ascent:22,descent:5,left:0,right:16},B:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},C:{width:17,height:27,ascent:22,descent:5,left:-1,right:16},D:{width:17,height:27,ascent:22,descent:5,left:-2,right:16},E:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},F:{width:15,height:27,ascent:22,descent:5,left:-2,right:14},G:{width:19,height:27,ascent:22,descent:5,left:-1,right:17},H:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},I:{width:7,height:27,ascent:22,descent:5,left:-2,right:5},J:{width:12,height:27,ascent:22,descent:5,left:-1,right:10},K:{width:16,height:27,ascent:22,descent:5,left:-2,right:16},L:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},M:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},N:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},O:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},P:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},Q:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},R:{width:17,height:27,ascent:22,descent:5,left:-2,right:17},S:{width:16,height:27,ascent:22,descent:5,left:-1,right:15},T:{width:15,height:27,ascent:22,descent:5,left:-1,right:14},U:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},V:{width:16,height:27,ascent:22,descent:5,left:0,right:16},W:{width:23,height:27,ascent:22,descent:5,left:0,right:22},X:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Y:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Z:{width:15,height:27,ascent:22,descent:5,left:0,right:14},"[":{width:7,height:27,ascent:22,descent:5,left:-2,right:6},"\\":{width:7,height:27,ascent:22,descent:5,left:0,right:7},"]":{width:7,height:27,ascent:22,descent:5,left:0,right:5},"^":{width:11,height:27,ascent:22,descent:5,left:-1,right:11},_:{width:13,height:27,ascent:22,descent:5,left:0,right:14},"`":{width:8,height:27,ascent:22,descent:5,left:-1,right:5},a:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},b:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},c:{width:12,height:27,ascent:22,descent:5,left:-1,right:12},d:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},e:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},f:{width:7,height:27,ascent:22,descent:5,left:0,right:8},g:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},h:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},i:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},j:{width:5,height:27,ascent:22,descent:5,left:1,right:4},k:{width:12,height:27,ascent:22,descent:5,left:-2,right:12},l:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},m:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},n:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},o:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},p:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},q:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},r:{width:8,height:27,ascent:22,descent:5,left:-2,right:8},s:{width:12,height:27,ascent:22,descent:5,left:-1,right:11},t:{width:7,height:27,ascent:22,descent:5,left:0,right:6},u:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},v:{width:12,height:27,ascent:22,descent:5,left:0,right:12},w:{width:17,height:27,ascent:22,descent:5,left:0,right:17},x:{width:12,height:27,ascent:22,descent:5,left:0,right:12},y:{width:12,height:27,ascent:22,descent:5,left:0,right:12},z:{width:12,height:27,ascent:22,descent:5,left:0,right:11},"{":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"|":{width:6,height:27,ascent:22,descent:5,left:-2,right:4},"}":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"~":{width:14,height:27,ascent:22,descent:5,left:-1,right:13}},On=(t)=>{if(!t)return 0;let e=0;for(let r of t){let i=s5[r];if(i)e+=i.width;else e+=s5["?"].width}return e/27},G5=0.65,q5=0.08;function xc(t){return On(t.text||"")+(t.display_superscript?q5+On(t.display_superscript)*G5:0)}function Uu(t,e,r,i="central"){let n=[{type:"text",value:t,name:"",attributes:{},children:[]}];if(e)n.push({type:"element",name:"tspan",value:"",attributes:{class:"sch-net-label-superscript","font-size":`${r*G5}px`,dx:`${r*q5}`,dy:`${-r*(i==="ideographic"?0.5:0.25)}`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]});return n}var Ri=(t)=>{switch(t){case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1};case"left":return{x:1,y:0};case"right":return{x:-1,y:0}}throw Error(`Invalid side: ${t}`)},hr=0.3,Wi=0.3,Oi=0.06,K5=0.2,J5=(t)=>({"data-circuit-json-type":"schematic_net_label","data-schematic-net-label-id":t.schematic_net_label_id}),gO={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},c5={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"};function bO(t){return{left:180,top:90,bottom:-90,right:0}[t]??0}function vO(t,e,r){let i=r+hr*2+Oi*t.text.length+Wi,n=Ri(t.anchor_side);return t.anchor_position??{x:t.center.x-n.x*i*e/2,y:t.center.y-n.y*i*e/2}}var wO=(t,e)=>{let r=t<0?t+2*Math.PI:t,i=e<0?e+2*Math.PI:e,n=Math.abs(r-i);if(n>Math.PI)n=2*Math.PI-n;return n},t3=({schPorts:t,symbol:e,schComponent:r})=>{let i=t.map((s)=>{let l=s.center.x-r.center.x,c=s.center.y-r.center.y;return{port:s,angle:Math.atan2(c,l)}}),n=e.ports.map((s)=>{let l=s.x-e.center.x,c=s.y-e.center.y;return{port:s,angle:Math.atan2(c,l)}});i.sort((s,l)=>s.angle-l.angle),n.sort((s,l)=>s.angle-l.angle);let o=[],a=new Set;for(let s of i){let l=null;for(let c of n){if(a.has(c.port))continue;let d=wO(s.angle,c.angle);if(l===null||d<l.angleDiff)l={symbolPort:c.port,angleDiff:d}}if(l&&l.angleDiff<Math.PI/4)o.push({schPort:s.port,symbolPort:l.symbolPort}),a.add(l.symbolPort)}return o};function e3(t,e,r,i){let n=Math.sqrt((r.x-t.x)**2+(r.y-t.y)**2),a=Math.sqrt((i.x-e.x)**2+(i.y-e.y)**2)/n,s=e.x-a*t.x,l=e.y-a*t.y,c=Yt(s,l),d=Vt(a,a);return Ft(c,d)}function AO(t){let e=[],r=new Map,i=new Map,n=null;for(let o of t)if(o.type==="schematic_component")e.push(o);else if(o.type==="schematic_port"&&o.schematic_component_id){let a=r.get(o.schematic_component_id)??[];a.push(o),r.set(o.schematic_component_id,a)}else if(o.type==="source_component")i.set(o.source_component_id,o);for(let o of e){let a=FO({component:o,schematicPorts:r.get(o.schematic_component_id)??[],sourceComponent:o.source_component_id?i.get(o.source_component_id):void 0});if(!a)continue;n=n?r3(n,a):a}return n}function FO({component:t,schematicPorts:e,sourceComponent:r}){if(!t.symbol_name)return null;let i=Pr[t.symbol_name];if(!i)return null;let n=t3({schPorts:e,symbol:i,schComponent:t});if(!n[0])return null;let o=e3(n[1]?.symbolPort??i.center,n[1]?.schPort.center??t.center,n[0].symbolPort,n[0].schPort.center),a=null;for(let s of i.primitives){if(s.type!=="text")continue;let l=BO({primitive:s,component:t,sourceComponent:r});if(!l)continue;let c=F(o,s),d=ur("reference_designator"),h=SO({x:c.x,y:c.y,width:On(l)*d,height:d,anchor:s.anchor});a=a?r3(a,h):h}return a}function BO({primitive:t,component:e,sourceComponent:r}){if(t.text==="{REF}")return r?.display_name??r?.name??"";if(t.text==="{VAL}")return e.symbol_display_value??"";return""}function SO({x:t,y:e,width:r,height:i,anchor:n}){let o=t,a=t,s=e-i/2,l=e+i/2;if(n.includes("left"))a=t+r;else if(n.includes("right"))o=t-r;else o=t-r/2,a=t+r/2;if(n.includes("top"))s=e-i,l=e;else if(n.includes("bottom"))s=e,l=e+i;return{minX:o,minY:s,maxX:a,maxY:l}}function r3(t,e){return{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}}var i3=(t,e)=>{if(t.column_widths&&t.column_widths.length>0&&t.row_heights&&t.row_heights.length>0){let d=(h)=>{if(typeof h==="number")return h;if(h.endsWith("mm"))return parseFloat(h);if(h.endsWith("in"))return parseFloat(h)*25.4;return parseFloat(h)};return{column_widths:t.column_widths.map(d),row_heights:t.row_heights.map(d)}}let r=e.filter((d)=>d.type==="schematic_table_cell"&&d.schematic_table_id===t.schematic_table_id);if(r.length===0)return{column_widths:[],row_heights:[]};let i=r.reduce((d,h)=>Math.max(d,h.end_column_index),-1)+1,n=r.reduce((d,h)=>Math.max(d,h.end_row_index),-1)+1,{cell_padding:o=0.2}=t,a=Array(i).fill(0),s=Array(n).fill(0),l={},c={};for(let d of r){let h=ur("reference_designator",d.font_size),_=On(d.text??"")*h+2*o,m=h*1.2+2*o,g=`${d.start_row_index}-${d.start_column_index}`;l[g]=_,c[g]=m}for(let d=0;d<n;d++)for(let h=0;h<i;h++){let y=`${d}-${h}`;if(l[y]&&l[y]>a[h])a[h]=l[y];if(c[y]&&c[y]>s[d])s[d]=c[y]}for(let d of r){if(d.start_column_index===d.end_column_index&&d.start_row_index===d.end_row_index)continue;let h=`${d.start_row_index}-${d.start_column_index}`,y=l[h],_=c[h];if(y===void 0||_===void 0)continue;let m=0;for(let b=d.start_column_index;b<=d.end_column_index;b++)m+=a[b];if(y>m){let v=(y-m)/(d.end_column_index-d.start_column_index+1);for(let k=d.start_column_index;k<=d.end_column_index;k++)a[k]+=v}let g=0;for(let b=d.start_row_index;b<=d.end_row_index;b++)g+=s[b];if(_>g){let v=(_-g)/(d.end_row_index-d.start_row_index+1);for(let k=d.start_row_index;k<=d.end_row_index;k++)s[k]+=v}}return{column_widths:a,row_heights:s}},kO=10.16,YO=1.1,yr=kO/YO,MO=297/yr,IO=210/yr,mH=20/yr,lc=5/yr;function gc(t={}){let e=t.center??{x:0,y:0},r=t.sheet_width===void 0?MO:t.sheet_width/yr,i=t.sheet_height===void 0?IO:t.sheet_height/yr,n=e.x-r/2,o=e.x+r/2,a=e.y-i/2,s=e.y+i/2;return{center:e,width:r,height:i,minX:n,maxX:o,minY:a,maxY:s,innerMinX:n+lc,innerMaxX:o-lc,innerMinY:a+lc,innerMaxY:s-lc}}function n3(t,e=0.5){let{POSITIVE_INFINITY:r,POSITIVE_INFINITY:i,NEGATIVE_INFINITY:n,NEGATIVE_INFINITY:o}=Number,a=0.2;for(let c of t)if(c.type==="schematic_sheet"){let d=gc(c);l(d.center,{width:d.width,height:d.height},0)}else if(c.type==="schematic_component")l(c.center,c.size,0);else if(c.type==="schematic_port")l(c.center,{width:a,height:a},0);else if(c.type==="schematic_debug_object"){if(c.shape==="rect")l(c.center,c.size,0);else if(c.shape==="line")l(c.start,{width:0.1,height:0.1},0),l(c.end,{width:0.1,height:0.1},0)}else if(c.type==="schematic_net_label"){let d=ur("net_label"),h=xc(c),_=(h+hr*2+Oi*(c.text?.length||0)+Wi)*d,m=K5,g=bO(c.anchor_side)/180*Math.PI,b=vO(c,d,h),v=Ri(c.anchor_side),k={x:b.x+v.x*_/2,y:b.y+v.y*_/2};l(k,{width:_,height:m},g)}else if(c.type==="schematic_trace")for(let d of c.edges)l(d.from,{width:0.1,height:0.1},0),l(d.to,{width:0.1,height:0.1},0);else if(c.type==="schematic_text"){let h=ur("reference_designator",c.font_size)??0.18,y=c.text??"",_=c.display_superscript;if(_){let m=y.split(`
`),g=Math.max(...m.map((E,I)=>xc({text:E,display_superscript:I===m.length-1?_:void 0})))*h,b=c.anchor,v=b==="left"||b.endsWith("_left")?g/2:b==="right"||b.endsWith("_right")?-g/2:0,k=b==="top"||b.startsWith("top_")?0:b==="bottom"||b.startsWith("bottom_")?-h:-h/2,x=(m.length+0.3)*h,A=-(k-0.3*h+x/2),S=-(c.rotation??0)*Math.PI/180;l({x:c.position.x+v*Math.cos(S)-A*Math.sin(S),y:c.position.y+v*Math.sin(S)+A*Math.cos(S)},{width:g,height:x},S)}else{let m=y.length*h,g=h;l(c.position,{width:m,height:g},c.rotation??0)}}else if(c.type==="schematic_voltage_probe"){if(l(c.position,{width:0.2,height:0.4},0),c.name){let d=ur("net_label"),h=On(c.name)*d,y=d,_=0.3,m=c.label_alignment??"top_right",g=c.position.x,b=c.position.y;if(m.includes("top"))b+=0.3+y/2;else if(m.includes("bottom"))b-=0.3+y/2;if(m.includes("right"))g+=0.3+h/2;else if(m.includes("left"))g-=0.3+h/2;l({x:g,y:b},{width:h,height:y},0)}}else if(c.type==="schematic_box")l({x:c.x+c.width/2,y:c.y+c.height/2},{width:c.width,height:c.height},0);else if(c.type==="schematic_table"){let{column_widths:d,row_heights:h}=i3(c,t),y=d.reduce((x,A)=>x+A,0),_=h.reduce((x,A)=>x+A,0),m=c.anchor??"center",g=c.anchor_position.x,b=c.anchor_position.y;if(m.includes("center"))g-=y/2;else if(m.includes("right"))g-=y;if(m.includes("center"))b+=_/2;else if(m.includes("bottom"))b+=_;let v=g+y/2,k=b-_/2;l({x:v,y:k},{width:y,height:_},0)}else if(c.type==="schematic_line")l({x:c.x1,y:c.y1},{width:0.02,height:0.02},0),l({x:c.x2,y:c.y2},{width:0.02,height:0.02},0);else if(c.type==="schematic_circle")l(c.center,{width:c.radius*2,height:c.radius*2},0);else if(c.type==="schematic_rect")l(c.center,{width:c.width,height:c.height},c.rotation);else if(c.type==="schematic_arc")l(c.center,{width:c.radius*2,height:c.radius*2},0);else if(c.type==="schematic_path"){if(c.points&&c.points.length>0)for(let d of c.points)l(d,{width:0.02,height:0.02},0)}if(!Number.isFinite(r))r=-1,i=-1,n=1,o=1;r-=e,i-=e,n+=e,o+=e;let s=AO(t);if(s){if(s.minX<r)r=s.minX-e;if(s.minY<i)i=s.minY-e;if(s.maxX>n)n=s.maxX+e;if(s.maxY>o)o=s.maxY+e}return{minX:r,minY:i,maxX:n,maxY:o};function l(c,d,h){let y=[{x:-d.width/2,y:-d.height/2},{x:d.width/2,y:-d.height/2},{x:d.width/2,y:d.height/2},{x:-d.width/2,y:d.height/2}];for(let _ of y){let m=_.x*Math.cos(h)-_.y*Math.sin(h)+c.x,g=_.x*Math.sin(h)+_.y*Math.cos(h)+c.y;r=Math.min(r,m),i=Math.min(i,g),n=Math.max(n,m),o=Math.max(o,g)}}}function pc(t){if(!Number.isFinite(t))return"0";return Number.parseFloat(t.toFixed(6)).toString()}var jn="image/svg+xml";function LO({schematicGraphic:t,viewport:e}){let r=EO(t);return{name:"g",type:"element",value:"",attributes:{class:"schematic-graphic","pointer-events":"none","data-circuit-json-type":"schematic_graphic","data-schematic-graphic-id":t.schematic_graphic_id,...t.schematic_sheet_id?{"data-schematic-sheet-id":t.schematic_sheet_id}:{}},children:[{name:"image",type:"element",value:"",attributes:{href:r,x:pc(e.x),y:pc(e.y),width:pc(e.width),height:pc(e.height),preserveAspectRatio:"xMidYMid meet",overflow:"hidden","pointer-events":"none"},children:[]}]}}function EO(t){let e=`Unable to render schematic graphic "${t.schematic_graphic_id}"`,{asset:r,svg_content:i}=t;if(!r){if(i!==void 0)return l5(i);throw Error(`${e}: asset or svg_content is required`)}if(o3(r.mimetype)!==jn)throw Error(`${e}: asset.mimetype must be "${jn}" (received ${JSON.stringify(r.mimetype)})`);let n=r.url.trim();if(n.toLowerCase().startsWith("data:"))return PO(n,e),n;if(i!==void 0)return l5(i);throw Error(`${e}: asset.url must be an inline SVG data URL because circuit-to-svg cannot synchronously load ${JSON.stringify(r.url)}`)}function PO(t,e){let r=t.match(/^data:([^,]*),(.*)$/is);if(!r)throw Error(`${e}: asset.url is not a valid SVG data URL`);let i=r[1].split(";").map((l)=>l.trim());if(o3(i.shift()??"")!==jn)throw Error(`${e}: asset.url must use the "${jn}" media type`);let o=r[2],a=i.findIndex((l)=>l.toLowerCase()==="base64"),s=a!==-1;if(s&&a!==i.length-1)throw Error(`${e}: asset.url must place "base64" as its final metadata token`);if(s){let l=o.replace(/\s+/g,"");if(!/^(?:[a-z\d+/]{4})*(?:[a-z\d+/]{2}==|[a-z\d+/]{3}=)?$/i.test(l))throw Error(`${e}: asset.url is not a valid SVG data URL`);return}if(o.includes("#"))throw Error(`${e}: asset.url must percent-encode "#" in a non-base64 SVG data URL`);try{decodeURIComponent(o)}catch(l){throw Error(`${e}: asset.url is not a valid SVG data URL`,{cause:l})}}function l5(t){let e=new TextEncoder().encode(t),r="",i=32768;for(let n=0;n<e.length;n+=i)r+=String.fromCharCode(...e.subarray(n,n+i));return`data:${jn};base64,${btoa(r)}`}function o3(t){return(t.split(";",1)[0]??"").trim().toLowerCase()}var Kt=(t)=>Math.abs(t.a)*0.02,Xu=({text:t,realCenter:e,realToScreenTransform:r})=>{let i=F(r,e);return{type:"element",name:"text",value:"",attributes:{x:i.x.toString(),y:i.y.toString(),fill:"red","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${ve(r,"error")}px`},children:[{type:"text",value:t,name:"",attributes:{},children:[]}]}},TO=({schNetLabel:t,realToScreenTransform:e,colorMap:r})=>{if(!t.text)return[];let i=t.text.startsWith("N_"),n=i?t.text.slice(2):t.text,o=J5(t),a=[],s=Pr[t.symbol_name];if(!s){let H=Xu({text:`Symbol not found: ${t.symbol_name}`,realCenter:t.center,realToScreenTransform:e});return H.attributes={...H.attributes,...o},a.push(H),a}let l=s.primitives.filter((H)=>H.type==="path"),c=s.primitives.filter((H)=>H.type==="text"),d=s.primitives.filter((H)=>H.type==="circle"),h=s.primitives.filter((H)=>H.type==="box"),y={minX:Math.min(...l.flatMap((H)=>H.points.map((ht)=>ht.x))),maxX:Math.max(...l.flatMap((H)=>H.points.map((ht)=>ht.x))),minY:Math.min(...l.flatMap((H)=>H.points.map((ht)=>ht.y))),maxY:Math.max(...l.flatMap((H)=>H.points.map((ht)=>ht.y)))},_=ur("net_label"),g=xc({...t,text:n})+hr*2+Oi*n.length+Wi,b=Ri(t.anchor_side),v=t.anchor_position??{x:t.center.x-b.x*g*_/2,y:t.center.y-b.y*g*_/2},x=Gt(0/180*Math.PI),A={minX:Math.min(...s.primitives.flatMap((H)=>H.type==="path"?H.points.map((ht)=>ht.x):[])),maxX:Math.max(...s.primitives.flatMap((H)=>H.type==="path"?H.points.map((ht)=>ht.x):[])),minY:Math.min(...s.primitives.flatMap((H)=>H.type==="path"?H.points.map((ht)=>ht.y):[])),maxY:Math.max(...s.primitives.flatMap((H)=>H.type==="path"?H.points.map((ht)=>ht.y):[]))},S=s.ports?.[0]?{x:s.ports[0].x,y:s.ports[0].y}:{x:A.minX,y:(A.minY+A.maxY)/2},E=F(x,S),I=Ft(Yt(v.x-E.x,v.y-E.y),x,Vt(1)),[T,P]=F(Ft(e,I),[y.minX,y.minY]),[O,D]=F(Ft(e,I),[y.maxX,y.maxY]),N=Math.abs(D-P),G=Math.min(P,D),K=Math.abs(O-T),vt=Math.min(T,O);a.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay sch-net-label-overlay",...o,x:vt.toString(),y:G.toString(),width:K.toString(),height:N.toString(),fill:"transparent"},children:[]});for(let H of l){let ht=H.points.map((wt,et)=>{let[Q,V]=F(Ft(e,I),[wt.x,wt.y]);return`${et===0?"M":"L"} ${Q} ${V}`}).join(" ");a.push({name:"path",type:"element",attributes:{class:"sch-net-label-symbol-path",...o,d:ht+(H.closed?" Z":""),stroke:r.schematic.component_outline,fill:"none","stroke-width":`${Kt(e)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let H of c){let ht=F(Ft(e,I),H),wt=H.text;if(wt==="{REF}")wt=n||"";else if(wt==="{VAL}")wt="";let Q=Math.abs(e.a)*0.1,V={x:ht.x,y:ht.y};a.push({name:"text",type:"element",attributes:{class:"sch-net-label-symbol-text",...o,x:V.x.toString(),y:V.y.toString(),fill:r.schematic.label_local,"font-family":"sans-serif","text-anchor":gO[H.anchor],"dominant-baseline":c5[H.anchor],"font-size":`${ve(e,"reference_designator")}px`,...i&&wt===n?{style:"text-decoration: overline;"}:{}},children:Uu(wt,H.text==="{REF}"?t.display_superscript:void 0,ve(e,"reference_designator"),c5[H.anchor]),value:""})}for(let H of h){let ht=F(Ft(e,I),H),wt=Ft(e,I).a;a.push({name:"rect",type:"element",attributes:{class:"sch-net-label-symbol-box",...o,x:ht.x.toString(),y:ht.y.toString(),width:(H.width*wt).toString(),height:(H.height*wt).toString(),fill:"red"},value:"",children:[]})}for(let H of d){let ht=F(Ft(e,I),H),wt=Ft(e,I).a;a.push({name:"circle",type:"element",attributes:{class:"sch-net-label-symbol-circle",...o,cx:ht.x.toString(),cy:ht.y.toString(),r:(H.radius*wt).toString(),fill:"none",stroke:r.schematic.component_outline,"stroke-width":`${Kt(e)}px`},value:"",children:[]})}return a},WO=({schNetLabel:t,realToScreenTransform:e,colorMap:r})=>{if(!t.text)return[];let i=t.text;if(t.symbol_name)return TO({schNetLabel:t,realToScreenTransform:e,colorMap:r});let n=J5(t),o=[],a=ve(e,"net_label"),s=ur("net_label"),l=K5/s/2,c=xc({...t,text:i}),d=F(e,t.center),h=Ri(t.anchor_side),y={...h};y.y*=-1;let _=c+hr*2+Oi*i.length+Wi,m=t.anchor_position?F(e,t.anchor_position):{x:d.x-y.x*_*a/2,y:d.y-y.y*_*a/2},g=t.anchor_position??{x:t.center.x-h.x*_*s/2,y:t.center.y-h.y*_*s/2},b={left:0,top:-90,bottom:90,right:180}[t.anchor_side],v=[{x:0,y:0},{x:hr,y:l},{x:hr*2+Wi+Oi*i.length+c,y:l},{x:hr*2+Wi+Oi*i.length+c,y:-l},{x:hr,y:-l}].map((E)=>F(Ft(e,Yt(g.x,g.y),Vt(s),Gt(b/180*Math.PI)),E)),k=`
M ${v[0].x},${v[0].y}
L ${v[1].x},${v[1].y}
L ${v[2].x},${v[2].y}
L ${v[3].x},${v[3].y}
L ${v[4].x},${v[4].y}
Z
`;o.push({name:"path",type:"element",attributes:{class:"net-label sch-net-label",...n,d:k,fill:r.schematic.label_background,stroke:r.schematic.label_global,"stroke-width":`${Kt(e)}px`},value:"",children:[]});let x={x:m.x+y.x*a*0.5,y:m.y+y.y*a*0.5},A={left:"start",top:"start",bottom:"start",right:"end"}[t.anchor_side],S={left:"",right:"",top:`rotate(90 ${x.x} ${x.y})`,bottom:`rotate(-90 ${x.x} ${x.y})`}[t.anchor_side];return o.push({name:"text",type:"element",attributes:{class:"net-label-text sch-net-label-text",...n,x:x.x.toString(),y:x.y.toString(),fill:r.schematic.label_global,"text-anchor":A,"dominant-baseline":"central","font-family":"sans-serif","font-variant-numeric":"tabular-nums","font-size":`${a}px`,transform:S},children:Uu(i,t.display_superscript,a),value:""}),o},OO=0.02,jO=({schPort:t,transform:e})=>{let r=F(e,t.center),i=Math.abs(e.a)*OO*2;return[{name:"g",type:"element",value:"",attributes:{class:"schematic-port-hover sch-port-hover","data-schematic-port-id":t.source_port_id,...t.schematic_sheet_id?{"data-schematic-sheet-id":t.schematic_sheet_id}:{}},children:[{name:"circle",type:"element",value:"",attributes:{cx:r.x.toString(),cy:r.y.toString(),r:i.toString(),fill:"red",opacity:"0"},children:[]}]}]},RO=({component:t,transform:e,circuitJson:r})=>{let i=qt(r).schematic_port.list({schematic_component_id:t.schematic_component_id}),n=[];for(let o of i)n.push(...jO({schPort:o,transform:e}));return n},CO=({schPort:t,transform:e,colorMap:r})=>{let{x:n,y:o}=t.center,a=[-1,1].map((s)=>{let l=F(e,{x:n-0.05,y:o-s*0.05}),c=F(e,{x:n+0.05,y:o+s*0.05});return`M ${l.x} ${l.y} L ${c.x} ${c.y}`}).join(" ");return{name:"path",type:"element",value:"",attributes:{class:"sch-port-no-connect","data-schematic-port-id":t.schematic_port_id,"data-source-port-id":t.source_port_id,d:a,fill:"none",stroke:r.schematic.no_connect,"stroke-width":`${Kt(e)}px`,"stroke-linecap":"round"},children:[]}},p5=0.02,XO=({schPort:t,transform:e,circuitJson:r,colorMap:i})=>{let n=[],o=Math.abs(e.a)*p5,a=Math.abs(e.a)*p5,s=F(e,t.center),l=r.find((d)=>d.type==="source_port"&&d.source_port_id===t.source_port_id);if(!l?.do_not_connect)n.push({name:"circle",type:"element",value:"",attributes:{class:"component-pin sch-component-pin sch-port-indicator",cx:s.x.toString(),cy:s.y.toString(),r:o.toString(),fill:"none",stroke:i.schematic.component_outline,"stroke-width":a.toString(),"data-schematic-port-id":t.schematic_port_id},children:[]});let c=t.display_pin_label??l?.name;if(c){let d={...t.center},h=t.distance_from_component_edge??0,y=0.05,_="middle",m="";switch(t.facing_direction){case"left":d.x+=h/2,d.y+=0.05,_="start";break;case"right":d.x-=h/2,d.y+=0.05,_="end";break;case"up":d.y-=h/2,d.x-=0.05,_="middle";break;case"down":d.y+=h/2,d.x-=0.05,_="middle";break}let g=F(e,d),b=ve(e,"pin_number");if(t.facing_direction==="up"||t.facing_direction==="down")m=`rotate(-90 ${g.x} ${g.y})`;n.push({name:"text",type:"element",value:"",attributes:{class:"port-indicator-label sch-port-label",x:g.x.toString(),y:g.y.toString(),fill:i.schematic.component_outline,"font-family":"sans-serif","font-size":`${b*0.7}px`,"text-anchor":_,"dominant-baseline":"middle",...m&&{transform:m}},children:[{type:"text",value:c,name:"",attributes:{},children:[]}]})}return n},a3=(t)=>({type:"element",name:"tspan",value:"",attributes:t.is_overlined?{"text-decoration":"overline"}:{},children:[{type:"text",name:"",value:t.text,attributes:{},children:[]}]}),$O=(t)=>t.filter((e)=>e.text).map(a3),NO=(t)=>{let e=[[]];for(let r of t)r.text.split(`
`).forEach((i,n)=>{if(n>0)e.push([]);if(i)e.at(-1).push(a3({...r,text:i}))});return e},Zu=({elm:t,transform:e,colorMap:r})=>{let i=F(e,t.position),n={center:"middle",center_right:"end",bottom_left:"start",bottom_center:"middle",bottom_right:"end",left:"start",right:"end",top:"middle",bottom:"middle",top_left:"start",top_center:"middle",top_right:"end",center_left:"start"},o={center:"middle",center_right:"middle",bottom_left:"ideographic",bottom_center:"ideographic",bottom_right:"ideographic",left:"middle",right:"middle",top:"hanging",bottom:"ideographic",top_left:"hanging",top_center:"hanging",top_right:"hanging",center_left:"middle"},a=t.text.split(`
`),s=NO(t.text_parts??[]),l=a.length===1?t.text_parts?.length?s[0]:[{type:"text",value:t.text,name:t.schematic_text_id,attributes:{},children:[]}]:a.map((c,d)=>({type:"element",name:"tspan",value:"",attributes:{x:i.x.toString(),...d>0?{dy:"1em"}:{}},children:t.text_parts?.length?s[d]??[]:[{type:"text",value:c,name:d===0?t.schematic_text_id:"",attributes:{},children:[]}]}));if(t.display_superscript)(a.length===1?l:l[l.length-1].children).push(...Uu("",t.display_superscript,ve(e,"reference_designator",t.font_size),o[t.anchor]).slice(1));return{type:"element",name:"text",value:"",attributes:{class:"sch-text","data-schematic-text-id":t.schematic_text_id,x:i.x.toString(),y:i.y.toString(),fill:t.color??r.schematic.sheet_label,"text-anchor":n[t.anchor],"dominant-baseline":o[t.anchor],"font-family":"sans-serif","font-size":`${ve(e,"reference_designator",t.font_size)}px`,transform:`rotate(${t.rotation}, ${i.x}, ${i.y})`},children:l}};function s3({schArc:t,transform:e,colorMap:r}){let i=F(e,t.center),n=Math.abs(e.a)*t.radius,o=t.stroke_width??0.02,a=Math.abs(e.a)*o,s=t.start_angle_degrees*Math.PI/180,l=t.end_angle_degrees*Math.PI/180,c=i.x+n*Math.cos(s),d=i.y+n*Math.sin(s),h=i.x+n*Math.cos(l),y=i.y+n*Math.sin(l),_=t.end_angle_degrees-t.start_angle_degrees;if(t.direction==="clockwise")_=-_;if(_<0)_+=360;let m=_>180?1:0,g=t.direction==="clockwise"?1:0;return[{name:"path",type:"element",attributes:{class:"sch-arc",d:`M ${c} ${d} A ${n} ${n} 0 ${m} ${g} ${h} ${y}`,fill:"none",stroke:t.color,"stroke-width":a.toString(),...t.is_dashed&&{"stroke-dasharray":(a*3).toString()},"data-schematic-arc-id":t.schematic_arc_id,...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}var VO=({schematicBox:t,transform:e,colorMap:r})=>{let i=F(e,{x:t.x,y:t.y}),n=F(e,{x:t.x+t.width,y:t.y+t.height}),o=Math.min(i.y,n.y),a=Math.max(i.y,n.y),s=Math.min(i.x,n.x),l=Math.max(i.x,n.x),c=Kt(e),d={class:"schematic-box sch-box",x:s.toString(),y:o.toString(),width:(l-s).toString(),height:(a-o).toString(),"stroke-width":`${c}px`,stroke:r.schematic.component_outline||"black",fill:"transparent"};if(t.is_dashed){let h=8*c,y=4*c;d["stroke-dasharray"]=`${h} ${y}`}return[{name:"rect",type:"element",value:"",attributes:d,children:[]}]};function c3({schCircle:t,transform:e,colorMap:r}){let i=F(e,t.center),n=Math.abs(e.a)*t.radius,o=t.stroke_width??0.02,a=Math.abs(e.a)*o;return[{name:"circle",type:"element",attributes:{class:"sch-circle",cx:i.x.toString(),cy:i.y.toString(),r:n.toString(),fill:t.is_filled?t.fill_color??t.color:"none",stroke:t.color,"stroke-width":a.toString(),...t.is_dashed&&{"stroke-dasharray":(a*3).toString()},"data-schematic-circle-id":t.schematic_circle_id,...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}var l3=(t,e)=>{for(let r of t){if(r.type!=="source_trace")continue;let i=r;if(Array.isArray(i.connected_source_port_ids)&&i.connected_source_port_ids.includes(e))return!0}return!1},zO={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},DO={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"},QO=({component:t,transform:e,circuitJson:r,colorMap:i})=>{let n=[],o=Pr[t.symbol_name];if(!o)return[Xu({text:`Symbol not found: ${t.symbol_name}`,realCenter:t.center,realToScreenTransform:e})];let a=qt(r).schematic_port.list({schematic_component_id:t.schematic_component_id}),s=qt(r).source_component.get(t.source_component_id),l=t3({schPorts:a,symbol:o,schComponent:t});if(!l[0])return[Xu({text:`Could not match ports for symbol ${t.symbol_name}`,realCenter:t.center,realToScreenTransform:e})];let c=e3(l[1]?.symbolPort??o.center,l[1]?.schPort.center??t.center,l[0].symbolPort,l[0].schPort.center),d=o.primitives.filter((T)=>T.type==="path"),h=o.primitives.filter((T)=>T.type==="text"),y=o.primitives.filter((T)=>T.type==="circle"),_=o.primitives.filter((T)=>T.type==="box"),m=new Set;for(let T of l)if(l3(r,T.schPort.source_port_id)||qt(r).source_port.get(T.schPort.source_port_id)?.do_not_connect)m.add(T.symbolPort);let g={minX:Math.min(...d.flatMap((T)=>T.points.map((P)=>P.x))),maxX:Math.max(...d.flatMap((T)=>T.points.map((P)=>P.x))),minY:Math.min(...d.flatMap((T)=>T.points.map((P)=>P.y))),maxY:Math.max(...d.flatMap((T)=>T.points.map((P)=>P.y)))},[b,v]=F(Ft(e,c),[g.minX,g.minY]),[k,x]=F(Ft(e,c),[g.maxX,g.maxY]),A=Math.abs(x-v),S=Math.min(v,x),E=Math.abs(k-b),I=Math.min(b,k);n.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:I.toString(),y:S.toString(),width:E.toString(),height:A.toString(),fill:"transparent"},children:[]});for(let T of d){let{points:P,color:O,closed:D,fill:N}=T;n.push({type:"element",name:"path",attributes:{class:"sch-component-symbol-path",d:P.map((G,K)=>{let[vt,H]=F(Ft(e,c),[G.x,G.y]);return`${K===0?"M":"L"} ${vt} ${H}`}).join(" ")+(D?" Z":""),stroke:i.schematic.component_outline,fill:"none","stroke-width":`${Kt(e)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let T of h){let P=F(Ft(e,c),T),O="",D=T.text==="{REF}";if(D)O=s?.display_name??s?.name??"";else if(T.text==="{VAL}")O=t.symbol_display_value??"";let N=DO[T.anchor];n.push({name:"text",type:"element",attributes:{class:D?"sch-component-name sch-component-text":"sch-component-text",x:P.x.toString(),y:P.y.toString(),...D?{stroke:i.schematic.background,"stroke-width":`${Kt(e)}px`,"paint-order":"stroke"}:{},fill:i.schematic.label_local,"font-family":"sans-serif","text-anchor":zO[T.anchor],"dominant-baseline":N,"font-size":`${ve(e,"reference_designator")}px`},value:"",children:[{type:"text",value:O,name:"",attributes:{},children:[]}]})}for(let T of _){let P=F(Ft(e,c),T),O=Ft(e,c).a;n.push({name:"rect",type:"element",attributes:{class:"sch-component-symbol-box",x:P.x.toString(),y:P.y.toString(),width:(T.width*O).toString(),height:(T.height*O).toString(),fill:"red"},value:"",children:[]})}for(let T of o.ports){if(m.has(T))continue;let P=F(Ft(e,c),T);n.push({type:"element",name:"circle",attributes:{class:"component-pin sch-component-pin",cx:P.x.toString(),cy:P.y.toString(),r:`${Math.abs(e.a)*0.02}px`,"stroke-width":`${Kt(e)}px`,fill:"none",stroke:i.schematic.component_outline},value:"",children:[]})}for(let T of y){let P=F(Ft(e,c),T),O=Math.abs(T.radius*e.a);n.push({type:"element",name:"circle",attributes:{class:"sch-component-symbol-circle",cx:P.x.toString(),cy:P.y.toString(),r:`${O}px`,"stroke-width":`${Kt(e)}px`,fill:"none",stroke:i.schematic.component_outline},value:"",children:[]})}return n},Mn=0.02,d5=(t,e,r,i,n)=>{let o=Math.PI/6,a={x:t.x-r*Math.cos(e-o),y:t.y-r*Math.sin(e-o)},s={x:t.x-r*Math.cos(e+o),y:t.y-r*Math.sin(e+o)};return{name:"polygon",type:"element",attributes:{points:`${t.x},${t.y} ${a.x},${a.y} ${s.x},${s.y}`,fill:"white",stroke:i,"stroke-width":`${n}px`},value:"",children:[]}},UO=({schPort:t,schComponent:e,transform:r,circuitJson:i})=>{let n=[],o=qt(i).source_port.get(t.source_port_id),a={x:t.center.x,y:t.center.y},s=t.distance_from_component_edge??0.4;switch(t.side_of_component){case"left":a.x+=s;break;case"right":a.x-=s;break;case"top":a.y-=s;break;case"bottom":a.y+=s;break}let l=F(r,t.center),c=F(r,a),d=o!=null&&o.source_component_id==null&&typeof t.is_connected==="boolean"?t.is_connected:l3(i,t.source_port_id),h=t.is_drawn_with_inversion_circle??!1,y=0.06,_={...t.center};if(!d&&!o?.do_not_connect)switch(t.side_of_component){case"left":_.x+=Mn;break;case"right":_.x-=Mn;break;case"top":_.y-=Mn;break;case"bottom":_.y+=Mn;break}let m=F(r,_);if(h){let x=Math.abs(r.a)*y,A={...c};switch(t.side_of_component){case"left":A.x-=x,c.x-=x*2;break;case"right":A.x+=x,c.x+=x*2;break;case"top":A.y-=x,c.y-=x*2;break;case"bottom":A.y+=x,c.y+=x*2;break}n.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-inversion-bubble",cx:A.x.toString(),cy:A.y.toString(),r:x.toString(),fill:"white",stroke:re.schematic.component_outline,"stroke-width":`${Kt(r)}px`},value:"",children:[]})}n.push({name:"line",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-line",x1:c.x.toString(),y1:c.y.toString(),x2:m.x.toString(),y2:m.y.toString(),"stroke-width":`${Kt(r)}px`},value:"",children:[]});let g=Math.abs(r.a)*Mn,b=[];if(!d&&!o?.do_not_connect)b.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-terminal",cx:l.x.toString(),cy:l.y.toString(),r:g.toString(),"stroke-width":`${Kt(r)}px`},value:"",children:[]});b.push({name:"rect",type:"element",attributes:{x:(l.x-g).toString(),y:(l.y-g).toString(),width:(g*2).toString(),height:(g*2).toString(),opacity:"0"},value:"",children:[]}),n.push({name:"g",type:"element",value:"",attributes:{class:"sch-port","data-schematic-port-id":t.source_port_id},children:b});let{has_input_arrow:v,has_output_arrow:k}=t;if((v||k)&&t.side_of_component){let x=Math.abs(r.a)*0.1,A=re.schematic.component_outline,S=x*Math.cos(Math.PI/6),E=Kt(r)/3,I=0,T=0;if(t.side_of_component==="left")I=0,T=Math.PI;else if(t.side_of_component==="right")I=Math.PI,T=0;else if(t.side_of_component==="top")I=Math.PI/2,T=-Math.PI/2;else if(t.side_of_component==="bottom")I=-Math.PI/2,T=Math.PI/2;let P=v&&k,O={...c},D={...c};if(P){let N=S;if(t.side_of_component==="left")D.x-=N;else if(t.side_of_component==="right")D.x+=N;else if(t.side_of_component==="top")D.y-=N;else if(t.side_of_component==="bottom")D.y+=N}if(v)n.push(d5(O,I,x,A,E));if(k){let N={x:D.x+x*Math.cos(T),y:D.y+x*Math.sin(T)};n.push(d5(N,T,x,A,E))}}return n},ZO=(t)=>{let e=[],{schPort:r,schComponent:i,transform:n,circuitJson:o}=t,a={x:r.center.x,y:r.center.y};if(!r.side_of_component)return[];let s=Ri(r.side_of_component),l=r.distance_from_component_edge??0.4;if(a.x+=s.x*l/2,a.y+=s.y*l/2,r.side_of_component==="top"||r.side_of_component==="bottom")a.x-=0.02;else a.y+=0.02;let c=F(n,a);return e.push({name:"text",type:"element",attributes:{class:"pin-number sch-pin-number",x:c.x.toString(),y:c.y.toString(),style:"font-family: sans-serif;",fill:re.schematic.pin_number,"text-anchor":"middle","dominant-baseline":"auto","font-size":`${ve(n,"pin_number")}px`,transform:r.side_of_component==="top"||r.side_of_component==="bottom"?`rotate(-90 ${c.x} ${c.y})`:""},children:[{type:"text",value:r.pin_number?.toString()||"",name:"",attributes:{},children:[]}],value:""}),e},h5=0.1,p3=(t)=>{let e=[],{schPort:r,schComponent:i,transform:n,labelColor:o=re.schematic.pin_number,labelClassName:a="pin-number sch-pin-label"}=t,s={x:r.center.x,y:r.center.y};if(!r.side_of_component)return[];let l=Ri(r.side_of_component),c=r.distance_from_component_edge??0.4;s.x+=l.x*(c+h5),s.y+=l.y*(c+h5);let d=F(n,s),h=r.display_pin_label??i.port_labels?.[`${r.pin_number}`];if(!h)return[];let y=h.startsWith("N_"),_=y?h.slice(2):h,m=r.display_pin_label_text_parts,g=r.is_drawn_with_inversion_circle??!1,b=ve(n,y||g?"negated_pin_number":"pin_number",r.display_pin_label_font_size);return e.push({name:"text",type:"element",attributes:{class:a,x:d.x.toString(),y:d.y.toString(),style:`font-family: sans-serif;${y&&!m?.length?" text-decoration: overline;":""}`,fill:o,"text-anchor":r.side_of_component==="left"||r.side_of_component==="bottom"?"start":"end","dominant-baseline":"middle","font-size":`${b}px`,transform:r.side_of_component==="top"||r.side_of_component==="bottom"?`rotate(-90 ${d.x} ${d.y})`:""},children:m?.length?$O(m):[{type:"text",value:_||"",name:"",attributes:{},children:[]}],value:""}),e},HO=(t)=>{let e=[],{schPort:r,schComponent:i,transform:n,circuitJson:o}=t;return e.push(...UO(t)),e.push(...ZO(t)),e.push(...p3(t)),e},GO=({component:t,transform:e,circuitJson:r,colorMap:i})=>{let n=[],o=F(e,{x:t.center.x-t.size.width/2,y:t.center.y+t.size.height/2}),a=F(e,{x:t.center.x+t.size.width/2,y:t.center.y-t.size.height/2}),s=a.x-o.x,l=a.y-o.y;n.push({name:"rect",type:"element",value:"",attributes:{class:"component chip sch-component-body",x:o.x.toString(),y:o.y.toString(),width:s.toString(),height:l.toString(),"stroke-width":`${Kt(e)}px`,fill:i.schematic.component_body,stroke:i.schematic.component_outline},children:[]}),n.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:o.x.toString(),y:o.y.toString(),width:s.toString(),height:l.toString(),fill:"transparent"},children:[]});let c=qt(r).schematic_text.list();for(let h of c)if(h.schematic_component_id===t.schematic_component_id)n.push(Zu({elm:h,transform:e,colorMap:i}));let d=qt(r).schematic_port.list({schematic_component_id:t.schematic_component_id});for(let h of d)n.push(...HO({schPort:h,schComponent:t,transform:e,circuitJson:r}));return n};function d3({isDashed:t,dashLength:e,dashGap:r,strokeWidth:i,transform:n}){if(!t)return;let o=Math.abs(n.a),a=i*o*3,s=e!==void 0?e*o:a,l=r!==void 0?r*o:a;return`${s} ${l}`}function h3({schLine:t,transform:e,colorMap:r}){let i=F(e,{x:t.x1,y:t.y1}),n=F(e,{x:t.x2,y:t.y2}),o=t.stroke_width??0.02,a=Math.abs(e.a)*o,s=d3({isDashed:t.is_dashed,dashLength:t.dash_length,dashGap:t.dash_gap,strokeWidth:o,transform:e});return[{name:"line",type:"element",attributes:{class:"sch-line",x1:i.x.toString(),y1:i.y.toString(),x2:n.x.toString(),y2:n.y.toString(),stroke:t.color,"stroke-width":a.toString(),...s&&{"stroke-dasharray":s},"data-schematic-line-id":t.schematic_line_id,...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}function u3({schRect:t,transform:e,colorMap:r}){let i=F(e,t.center),n=Math.abs(e.a)*t.width,o=Math.abs(e.d)*t.height,a=t.stroke_width??0.02,s=Math.abs(e.a)*a,l=i.x-n/2,c=i.y-o/2;return[{name:"rect",type:"element",attributes:{class:"sch-rect",x:l.toString(),y:c.toString(),width:n.toString(),height:o.toString(),fill:t.is_filled?t.fill_color??t.color:"none",stroke:t.color,"stroke-width":s.toString(),...t.is_dashed&&{"stroke-dasharray":(s*3).toString()},...t.rotation!==0&&{transform:`rotate(${t.rotation} ${i.x} ${i.y})`},"data-schematic-rect-id":t.schematic_rect_id,...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}function y3({schPath:t,transform:e,colorMap:r}){let i=t.stroke_color??r.schematic.component_outline,n=t.fill_color??"none",o=t.stroke_width??0.02,a=Math.abs(e.a)*o,s=d3({isDashed:t.is_dashed,dashLength:t.dash_length,dashGap:t.dash_gap,strokeWidth:o,transform:e});if(!t.points||t.points.length<2)return[];return[{name:"path",type:"element",attributes:{class:"sch-path",d:t.points.map((d)=>F(e,{x:d.x,y:d.y})).map((d,h)=>`${h===0?"M":"L"} ${d.x} ${d.y}`).join(" "),stroke:i,"stroke-width":a.toString(),fill:t.is_filled?n:"none","stroke-linecap":"round","stroke-linejoin":"round",...s&&{"stroke-dasharray":s},...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}function u5(t){if(t.type==="schematic_rect")return 0;if((t.type==="schematic_circle"||t.type==="schematic_path")&&t.is_filled)return 1;if(t.type==="schematic_text")return 3;return 2}var qO=({component:t,transform:e,circuitJson:r,colorMap:i})=>{let n=[],o=t.schematic_component_id,a=r.filter((s)=>("schematic_component_id"in s)&&s.schematic_component_id===o).sort((s,l)=>u5(s)-u5(l));for(let s of a)if(s.type==="schematic_text"&&t.is_box_with_pins===!1)n.push(Zu({elm:s,transform:e,colorMap:i}));else if(s.type==="schematic_line")n.push(...h3({schLine:s,transform:e,colorMap:i}));else if(s.type==="schematic_circle")n.push(...c3({schCircle:s,transform:e,colorMap:i}));else if(s.type==="schematic_rect")n.push(...u3({schRect:s,transform:e,colorMap:i}));else if(s.type==="schematic_arc")n.push(...s3({schArc:s,transform:e,colorMap:i}));else if(s.type==="schematic_path")n.push(...y3({schPath:s,transform:e,colorMap:i}));if(t.is_box_with_pins===!1){let s=r.filter((c)=>c.type==="schematic_line"&&c.schematic_component_id===o),l=r.filter((c)=>c.type==="schematic_port"&&c.schematic_component_id===o);for(let c of l){let d=s.find((b)=>b.x1===c.center.x&&b.y1===c.center.y||b.x2===c.center.x&&b.y2===c.center.y);if(!d)continue;let h=d.x1===c.center.x&&d.y1===c.center.y?{x:d.x2,y:d.y2}:{x:d.x1,y:d.y1},y=h.x-c.center.x,_=h.y-c.center.y,m=Math.abs(y)>Math.abs(_)?y>0?"left":"right":_>0?"bottom":"top",g=Math.max(Math.abs(y),Math.abs(_));n.push(...p3({schPort:{...c,side_of_component:m,distance_from_component_edge:g},schComponent:t,transform:e,circuitJson:r,labelClassName:"port-label sch-pin-label",labelColor:i.schematic.pin_name}))}}return n};function KO(t){let{component:e}=t,r=[];if(e.is_box_with_pins!==!1)if(e.symbol_name)r=QO(t);else r=GO(t);let i=qO(t),n=[...r,...i];return[{type:"element",name:"g",attributes:{class:"sch-component","data-circuit-json-type":"schematic_component","data-schematic-component-id":e.schematic_component_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:n,value:""}]}function JO({debugObject:t,transform:e}){if(t.shape==="rect"){let[r,i]=F(e,[t.center.x-t.size.width/2,t.center.y-t.size.height/2]),[n,o]=F(e,[t.center.x+t.size.width/2,t.center.y+t.size.height/2]);[i,o]=[Math.min(i,o),Math.max(i,o)];let a=Math.abs(n-r),s=Math.abs(o-i),[l,c]=F(e,[t.center.x,t.center.y]);return[{name:"rect",type:"element",value:"",attributes:{x:r.toString(),y:i.toString(),width:a.toString(),height:s.toString(),fill:"none",stroke:"red","stroke-width":(0.02*Math.abs(e.a)).toString(),"stroke-dasharray":"5,5"},children:t.label?[{name:"text",type:"element",value:"",attributes:{x:l.toString(),y:(c-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(e.a)).toString(),fill:"red"},children:[{type:"text",value:t.label,name:"",attributes:{},children:[]}]}]:[]}]}if(t.shape==="line"){let[r,i]=F(e,[t.start.x,t.start.y]),[n,o]=F(e,[t.end.x,t.end.y]),a=(r+n)/2,s=(i+o)/2;return[{name:"line",type:"element",value:"",attributes:{x1:r.toString(),y1:i.toString(),x2:n.toString(),y2:o.toString(),stroke:"red","stroke-width":(0.02*Math.abs(e.a)).toString(),"stroke-dasharray":"5,5"},children:t.label?[{name:"text",type:"element",value:"",attributes:{x:a.toString(),y:(s-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(e.a)).toString(),fill:"red"},children:[{type:"text",value:t.label,name:"",attributes:{},children:[]}]}]:[]}]}return[]}var _3=0.2/yr,tj=3/yr,dc=["1","2","3","4","5","6"],In=["A","B","C","D"];function ej({schematicSheet:t,transform:e,colorMap:r}){let i=gc(t),n=r.schematic.sheet,o=r.schematic.net_name,a=[y5({id:`${t.schematic_sheet_id}_outer`,center:i.center,width:i.width,height:i.height,transform:e,color:n}),y5({id:`${t.schematic_sheet_id}_inner`,center:i.center,width:i.innerMaxX-i.innerMinX,height:i.innerMaxY-i.innerMinY,transform:e,color:n})];for(let s=1;s<dc.length;s++){let l=i.innerMinX+(i.innerMaxX-i.innerMinX)*s/dc.length;a.push(hc({id:`${t.schematic_sheet_id}_top_column_${s}`,x1:l,y1:i.maxY,x2:l,y2:i.innerMaxY,transform:e,color:n}),hc({id:`${t.schematic_sheet_id}_bottom_column_${s}`,x1:l,y1:i.minY,x2:l,y2:i.innerMinY,transform:e,color:n}))}for(let s=1;s<In.length;s++){let l=i.innerMinY+(i.innerMaxY-i.innerMinY)*s/In.length;a.push(hc({id:`${t.schematic_sheet_id}_left_row_${s}`,x1:i.minX,y1:l,x2:i.innerMinX,y2:l,transform:e,color:n}),hc({id:`${t.schematic_sheet_id}_right_row_${s}`,x1:i.maxX,y1:l,x2:i.innerMaxX,y2:l,transform:e,color:n}))}return dc.forEach((s,l)=>{let c=i.innerMinX+(i.innerMaxX-i.innerMinX)*(l+0.5)/dc.length;a.push(uc({text:s,x:c,y:(i.maxY+i.innerMaxY)/2,transform:e,color:o}),uc({text:s,x:c,y:(i.minY+i.innerMinY)/2,transform:e,color:o}))}),In.forEach((s,l)=>{let c=i.innerMinY+(i.innerMaxY-i.innerMinY)*(In.length-l-0.5)/In.length;a.push(uc({text:s,x:(i.minX+i.innerMinX)/2,y:c,transform:e,color:o}),uc({text:s,x:(i.maxX+i.innerMaxX)/2,y:c,transform:e,color:o}))}),[{name:"g",type:"element",value:"",attributes:{class:"schematic-sheet","data-circuit-json-type":"schematic_sheet","data-schematic-sheet-id":t.schematic_sheet_id},children:a}]}function y5({id:t,center:e,width:r,height:i,transform:n,color:o}){let a=F(n,e),s=Math.abs(n.a)*r,l=Math.abs(n.d)*i;return{name:"rect",type:"element",value:"",attributes:{class:"sch-rect",x:(a.x-s/2).toString(),y:(a.y-l/2).toString(),width:s.toString(),height:l.toString(),fill:"none",stroke:o,"stroke-width":(Math.abs(n.a)*_3).toString(),"data-schematic-rect-id":t},children:[]}}function hc({id:t,x1:e,y1:r,x2:i,y2:n,transform:o,color:a}){let s=F(o,{x:e,y:r}),l=F(o,{x:i,y:n});return{name:"line",type:"element",value:"",attributes:{class:"sch-line",x1:s.x.toString(),y1:s.y.toString(),x2:l.x.toString(),y2:l.y.toString(),stroke:a,"stroke-width":(Math.abs(o.a)*_3).toString(),"data-schematic-line-id":t},children:[]}}function uc({text:t,x:e,y:r,transform:i,color:n}){let o=F(i,{x:e,y:r});return{type:"element",name:"text",value:"",attributes:{class:"sch-text",x:o.x.toString(),y:o.y.toString(),fill:n,"text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${ve(i,"reference_designator",tj)}px`,transform:`rotate(0, ${o.x}, ${o.y})`},children:[{type:"text",value:t,name:"",attributes:{},children:[]}]}}var rj=({schematicTable:t,transform:e,colorMap:r,circuitJson:i})=>{let{anchor_position:n,border_width:o=0.05,anchor:a="center"}=t,{column_widths:s,row_heights:l}=i3(t,i),c=s.reduce((I,T)=>I+T,0),d=l.reduce((I,T)=>I+T,0),{x:h,y}=n;if(a.includes("center"))h-=c/2;else if(a.includes("right"))h-=c;if(a.includes("center"))y+=d/2;else if(a.includes("bottom"))y+=d;let _=[],m=o*Math.abs(e.a),g=Kt(e),[b,v]=F(e,[h,y]),[k,x]=F(e,[h+c,y-d]);_.push({name:"rect",type:"element",attributes:{class:"sch-table-border",x:b.toString(),y:v.toString(),width:(k-b).toString(),height:(x-v).toString(),fill:"none",stroke:r.schematic.table,"stroke-width":m.toString()},children:[],value:""});let A=i.filter((I)=>I.type==="schematic_table_cell"&&I.schematic_table_id===t.schematic_table_id),S=h;for(let I=0;I<s.length-1;I++){S+=s[I];let T=y;for(let P=0;P<l.length;P++){let O=T-l[P];if(!A.some((N)=>N.start_column_index<=I&&N.end_column_index>I&&N.start_row_index<=P&&N.end_row_index>=P)){let N=F(e,{x:S,y:T}),G=F(e,{x:S,y:O});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:N.x.toString(),y1:N.y.toString(),x2:G.x.toString(),y2:G.y.toString(),stroke:r.schematic.table,"stroke-width":g.toString()},children:[],value:""})}T=O}}let E=y;for(let I=0;I<l.length-1;I++){E-=l[I];let T=h;for(let P=0;P<s.length;P++){let O=T+s[P];if(!A.some((N)=>N.start_row_index<=I&&N.end_row_index>I&&N.start_column_index<=P&&N.end_column_index>=P)){let N=F(e,{x:T,y:E}),G=F(e,{x:O,y:E});_.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:N.x.toString(),y1:N.y.toString(),x2:G.x.toString(),y2:G.y.toString(),stroke:r.schematic.table,"stroke-width":g.toString()},children:[],value:""})}T=O}}for(let I of A)if(I.text){let T=s.slice(I.start_column_index,I.end_column_index+1).reduce((Q,V)=>Q+V,0),P=l.slice(I.start_row_index,I.end_row_index+1).reduce((Q,V)=>Q+V,0),O=h+s.slice(0,I.start_column_index).reduce((Q,V)=>Q+V,0),D=y-l.slice(0,I.start_row_index).reduce((Q,V)=>Q+V,0),{cell_padding:N=0.2}=t,G=I.horizontal_align??"center",K=I.vertical_align??"middle",vt={x:O+T/2,y:D-P/2};if(G==="left")vt.x=O+N;else if(G==="right")vt.x=O+T-N;if(K==="top")vt.y=D-N;else if(K==="bottom")vt.y=D-P+N;let H=F(e,vt),ht=ve(e,"reference_designator",I.font_size),wt={left:"start",center:"middle",right:"end"},et={top:"hanging",middle:"middle",bottom:"ideographic"};_.push({name:"text",type:"element",attributes:{class:"sch-table-text",x:H.x.toString(),y:H.y.toString(),"font-size":`${ht}px`,"text-anchor":wt[G],"dominant-baseline":et[K],fill:r.schematic.table,"font-family":"sans-serif"},children:[{type:"text",value:I.text,name:"",attributes:{},children:[]}],value:""})}return[{name:"g",type:"element",attributes:{class:"sch-table","data-schematic-table-id":t.schematic_table_id},children:_,value:""}]};function ij({trace:t,transform:e,colorMap:r}){let i=t.edges;if(i.length===0)return[];let n=[],o=[],a="";for(let s=0;s<i.length;s++){let l=i[s];if(l.is_crossing)continue;let[c,d]=F(e,[l.from.x,l.from.y]),[h,y]=F(e,[l.to.x,l.to.y]);if(s===0||i[s-1]?.is_crossing)a+=`M ${c} ${d} L ${h} ${y}`;else a+=` L ${h} ${y}`}if(a)n.push({name:"path",type:"element",attributes:{d:a,class:"trace-invisible-hover-outline sch-trace-hitbox",stroke:r.schematic.wire,fill:"none","stroke-width":`${Kt(e)*8}px`,"stroke-linecap":"round",opacity:"0","stroke-linejoin":"round"},value:"",children:[]}),n.push({name:"path",type:"element",attributes:{class:"sch-trace-path",d:a,stroke:r.schematic.wire,fill:"none","stroke-width":`${Kt(e)}px`,"stroke-linecap":"round","stroke-linejoin":"round"},value:"",children:[]});for(let s of i){if(!s.is_crossing)continue;let[l,c]=F(e,[s.from.x,s.from.y]),[d,h]=F(e,[s.to.x,s.to.y]),y=(l+d)/2,_=(c+h)/2,m=d-l,g=h-c,b=Math.sqrt(m*m+g*g),v=b*0.7,k=-g/b*v,x=m/b*v,A=y+k,S=_-Math.abs(x);o.push({name:"path",type:"element",attributes:{class:"trace-crossing-outline sch-trace-crossing-outline",d:`M ${l} ${c} Q ${A} ${S} ${d} ${h}`,stroke:r.schematic.background,fill:"none","stroke-width":`${Kt(e)*1.5}px`,"stroke-linecap":"butt"},value:"",children:[]}),o.push({name:"path",type:"element",attributes:{class:"sch-trace-crossing-path",d:`M ${l} ${c} Q ${A} ${S} ${d} ${h}`,stroke:r.schematic.wire,fill:"none","stroke-width":`${Kt(e)}px`,"stroke-linecap":"round"},value:"",children:[]})}if(t.junctions)for(let s of t.junctions){let[l,c]=F(e,[s.x,s.y]);o.push({name:"circle",type:"element",attributes:{cx:l.toString(),cy:c.toString(),r:(Math.abs(e.a)*0.03).toString(),class:"trace-junction sch-trace-junction",fill:r.schematic.junction},value:"",children:[]})}return[{name:"g",type:"element",value:"",attributes:{class:"trace sch-trace","data-layer":"base","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":t.schematic_trace_id,...t.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":t.subcircuit_connectivity_map_key}},children:n},{name:"g",type:"element",value:"",attributes:{class:"trace-overlays sch-trace-overlays","data-layer":"overlay","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":t.schematic_trace_id,...t.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":t.subcircuit_connectivity_map_key}},children:o}]}function nj({probe:t,transform:e,colorMap:r,fallbackColor:i}){let[n,o]=F(e,[t.position.x,t.position.y]),a=t.color??i??r.schematic.reference,s=Math.abs(e.a)*0.6,l=Math.abs(e.a)*0.28,c=t.label_alignment??"top_right",d,h,y,_;switch(c){case"top_left":d=-135*Math.PI/180,h="end",y=-8,_=-8;break;case"top_center":d=-90*Math.PI/180,h="middle",y=0,_=-8;break;case"top_right":d=-45*Math.PI/180,h="start",y=8,_=-8;break;case"center_left":d=180*Math.PI/180,h="end",y=-8,_=0;break;case"center":d=-90*Math.PI/180,h="middle",y=0,_=-8;break;case"center_right":d=0*Math.PI/180,h="start",y=8,_=0;break;case"bottom_left":d=135*Math.PI/180,h="end",y=-8,_=8;break;case"bottom_center":d=90*Math.PI/180,h="middle",y=0,_=8;break;case"bottom_right":d=45*Math.PI/180,h="start",y=8,_=8;break;default:d=-50*Math.PI/180,h="start",y=8,_=0}let m=n+s*Math.cos(d),g=o+s*Math.sin(d),b=n,v=o,k=[`M ${m},${g}`,`L ${b},${v}`,`M ${b},${v}`,`L ${b-l*Math.cos((d*180/Math.PI+150)*Math.PI/180)},${v-l*Math.sin((d*180/Math.PI+150)*Math.PI/180)}`,`L ${b-l*Math.cos((d*180/Math.PI+210)*Math.PI/180)},${v-l*Math.sin((d*180/Math.PI+210)*Math.PI/180)}`,"Z"].join(" "),x=(m+y).toString(),A=(g+_).toString(),S=[];if(t.name&&t.voltage!==void 0)S.push({type:"element",name:"tspan",value:"",attributes:{x},children:[{type:"text",value:t.name,name:"",attributes:{},children:[]}]}),S.push({type:"element",name:"tspan",value:"",attributes:{x,dy:"1.2em"},children:[{type:"text",value:`${t.voltage}V`,name:"",attributes:{},children:[]}]});else{let E=[];if(t.name)E.push(t.name);if(t.voltage!==void 0)E.push(`${t.voltage}V`);S.push({type:"text",value:E.join(" "),name:"",attributes:{},children:[]})}return[{name:"path",type:"element",attributes:{class:"sch-voltage-probe",d:k,stroke:a,fill:a,"stroke-width":`${Kt(e)}px`},value:"",children:[]},{type:"element",name:"text",value:"",attributes:{class:"sch-voltage-probe-label",x,y:A,fill:a,"text-anchor":h,"dominant-baseline":"middle","font-family":"sans-serif","font-size":`${ve(e,"reference_designator")}px`,"font-weight":"bold","data-schematic-voltage-probe-id":t.schematic_voltage_probe_id},children:S}]}var Pn=6,yc=12,se=12,Wu=6,oj=14,_5=11,m5=280,aj=140;function m3({message:t,targetBounds:e,svgWidth:r,svgHeight:i,occupiedCalloutBounds:n}){let o=Math.max(1,r-se*2),a=lj(t,Math.max(12,Math.floor((Math.min(m5,o)-Wu*2)/(_5*0.56)))),s=Math.max(...a.map((_)=>_.length)),l=Math.min(m5,o,Math.max(Math.min(aj,o),s*_5*0.56+Wu*2)),c=Wu*2+a.length*oj,d=sj({targetBounds:e,calloutWidth:l,calloutHeight:c,svgWidth:r,svgHeight:i,occupiedCalloutBounds:n});n.push(d);let h=f3(e,Pn),y=cj(d,h);return{messageLines:a,calloutWidth:l,calloutHeight:c,placement:d,targetOutline:h,leader:y}}function sj({targetBounds:t,calloutWidth:e,calloutHeight:r,svgWidth:i,svgHeight:n,occupiedCalloutBounds:o}){let a=(t.minX+t.maxX)/2,s=(t.minY+t.maxY)/2,l=t.minY-Pn-yc-r,c=t.maxY+Pn+yc,d=t.minX-Pn-yc-e,h=t.maxX+Pn+yc,y=[];if(l>=se)y.push(Ln({x:Li(a-e/2,se,i-se-e),y:l,width:e,height:r,side:"top"}));if(c+r<=n-se)y.push(Ln({x:Li(a-e/2,se,i-se-e),y:c,width:e,height:r,side:"bottom"}));if(h+e<=i-se)y.push(Ln({x:h,y:Li(s-r/2,se,n-se-r),width:e,height:r,side:"right"}));if(d>=se)y.push(Ln({x:d,y:Li(s-r/2,se,n-se-r),width:e,height:r,side:"left"}));let _=y.find((m)=>o.every((g)=>!pj(f3(m,4),g)));if(_)return _;if(y[0])return y[0];return Ln({x:Li(a-e/2,se,i-se-e),y:Li(l,se,n-se-r),width:e,height:r,side:"top"})}function cj(t,e){let r=(e.minX+e.maxX)/2,i=(e.minY+e.maxY)/2,n=(t.minX+t.maxX)/2,o=(t.minY+t.maxY)/2;switch(t.side){case"top":return{from:{x:n,y:t.maxY},to:{x:r,y:e.minY}};case"bottom":return{from:{x:n,y:t.minY},to:{x:r,y:e.maxY}};case"left":return{from:{x:t.maxX,y:o},to:{x:e.minX,y:i}};case"right":return{from:{x:t.minX,y:o},to:{x:e.maxX,y:i}}}}function lj(t,e){let r=t.trim().split(/\s+/),i=[],n="";for(let o of r){let a=n?`${n} ${o}`:o;if(a.length<=e||n.length===0){n=a;continue}i.push(n),n=o}if(n)i.push(n);return i.length>0?i:["Diagnostic"]}function f3(t,e){return{minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e}}function pj(t,e){return!(t.maxX<=e.minX||t.minX>=e.maxX||t.maxY<=e.minY||t.minY>=e.maxY)}function Ln({x:t,y:e,width:r,height:i,side:n}){return{minX:t,minY:e,maxX:t+r,maxY:e+i,side:n}}function Li(t,e,r){if(r<e)return(e+r)/2;return Math.min(Math.max(t,e),r)}var Ou=6,dj=14,f5=11,x3=(t)=>t.type==="schematic_component_overlap_warning"||t.type==="schematic_component_styling_warning"||t.type==="schematic_sheet_styling_warning"||t.type==="schematic_element_outside_sheet_warning"||t.type==="schematic_manual_edit_conflict_warning";function hj({circuitJson:t,transform:e,svgWidth:r,svgHeight:i,colorMap:n}){let o=n.schematic.erc_warning,a=[];return t.filter(x3).flatMap((s)=>{let l=uj(s,t,e);if(!l)return[];let{messageLines:c,calloutWidth:d,calloutHeight:h,placement:y,targetOutline:_,leader:m}=m3({message:s.message,targetBounds:l,svgWidth:r,svgHeight:i,occupiedCalloutBounds:a}),g=fj(s);return[{name:"g",type:"element",value:"",attributes:{class:"schematic-warning","data-type":s.type,"data-warning-id":g,role:"note","aria-label":s.message},children:[{name:"rect",type:"element",value:"",attributes:{x:_.minX.toString(),y:_.minY.toString(),width:(_.maxX-_.minX).toString(),height:(_.maxY-_.minY).toString(),rx:"6",fill:"none",stroke:o,"stroke-width":"1","stroke-dasharray":"4,3","data-warning-reference":"target"},children:[]},{name:"line",type:"element",value:"",attributes:{x1:m.from.x.toString(),y1:m.from.y.toString(),x2:m.to.x.toString(),y2:m.to.y.toString(),stroke:o,"stroke-width":"1","data-warning-reference":"leader"},children:[]},{name:"rect",type:"element",value:"",attributes:{x:y.minX.toString(),y:y.minY.toString(),width:d.toString(),height:h.toString(),fill:"rgba(255, 250, 235, 0.97)",stroke:o,"stroke-width":"1","data-warning-reference":"callout"},children:[]},{name:"text",type:"element",value:"",attributes:{x:(y.minX+Ou).toString(),y:(y.minY+Ou+f5).toString(),fill:"#5c4300","font-family":"sans-serif","font-size":f5.toString()},children:c.map((v,k)=>({name:"tspan",type:"element",value:"",attributes:{x:(y.minX+Ou).toString(),dy:k===0?"0":dj.toString()},children:[gj(v)]}))}]}]})}function uj(t,e,r){let n=yj(t).map((o)=>_j(e,o)).filter((o)=>Boolean(o)).map((o)=>mj(o,r)).filter((o)=>Boolean(o));if(n.length===0)return null;return n.reduce(xj)}function yj(t){switch(t.type){case"schematic_sheet_styling_warning":return[t.schematic_sheet_id];case"schematic_component_overlap_warning":return t.schematic_component_ids;case"schematic_component_styling_warning":return[t.schematic_component_id,...t.schematic_port_ids??[]];case"schematic_manual_edit_conflict_warning":return[t.schematic_component_id];case"schematic_element_outside_sheet_warning":return[t.schematic_element_id]}}function _j(t,e){return t.find((r)=>{if(!r.type.startsWith("schematic_"))return!1;let i=`${r.type}_id`;return r[i]===e})}function mj(t,e){if(t.type==="schematic_sheet"){let r=gc(t);return _c([F(e,{x:r.minX,y:r.maxY}),F(e,{x:r.maxX,y:r.minY})])}if(t.type==="schematic_component"){let r=F(e,{x:t.center.x-t.size.width/2,y:t.center.y+t.size.height/2}),i=F(e,{x:t.center.x+t.size.width/2,y:t.center.y-t.size.height/2});return _c([r,i])}if(t.type==="schematic_port"){let r=F(e,t.center);return x5(_c([r]),4)}if(t.type==="schematic_net_label"){let r=F(e,t.anchor_position??t.center),i=Math.max(28,t.text.length*8);return{minX:r.x-i/2,minY:r.y-10,maxX:r.x+i/2,maxY:r.y+10}}if(t.type==="schematic_trace"){let r=t.edges.flatMap((i)=>[F(e,i.from),F(e,i.to)]);if(r.length===0)return null;return x5(_c(r),4)}return null}function fj(t){switch(t.type){case"schematic_sheet_styling_warning":return t.schematic_sheet_styling_warning_id;case"schematic_component_overlap_warning":return t.schematic_component_overlap_warning_id;case"schematic_component_styling_warning":return t.schematic_component_styling_warning_id;case"schematic_element_outside_sheet_warning":return t.schematic_element_outside_sheet_warning_id;case"schematic_manual_edit_conflict_warning":return t.schematic_manual_edit_conflict_warning_id}}function _c(t){return{minX:Math.min(...t.map((e)=>e.x)),minY:Math.min(...t.map((e)=>e.y)),maxX:Math.max(...t.map((e)=>e.x)),maxY:Math.max(...t.map((e)=>e.y))}}function xj(t,e){return{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}}function x5(t,e){return{minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e}}function gj(t){return{name:"",type:"text",value:t,attributes:{},children:[]}}function bj({circuitJson:t,transform:e,svgWidth:r,svgHeight:i}){let n=vj(t,e);return t.flatMap((o)=>{let a=wj(o);if(!a)return[];let s=t.filter((b)=>b.type==="schematic_port"&&a.sourcePortIds.includes(b.source_port_id)),l=s[0];if(!l)return[];let c=s.flatMap((b)=>{let v=F(e,b.center);return[{name:"circle",type:"element",value:"",attributes:{cx:v.x.toString(),cy:v.y.toString(),r:"9",fill:"red","fill-opacity":"0.15",stroke:"red","stroke-width":"2","data-type":o.type,"data-source-port-id":b.source_port_id,"data-error-id":a.errorId,"aria-label":a.message},children:[{name:"title",type:"element",value:"",attributes:{},children:[{name:"",type:"text",value:a.message,attributes:{},children:[]}]}]}]}),d=F(e,l.center),{placement:h,leader:y,messageLines:_,calloutWidth:m,calloutHeight:g}=m3({message:a.message,targetBounds:{minX:d.x-9,minY:d.y-9,maxX:d.x+9,maxY:d.y+9},svgWidth:r,svgHeight:i,occupiedCalloutBounds:n});return[...c,{name:"g",type:"element",value:"",attributes:{"data-type":"source_port_error_callout","data-error-type":o.type,"data-error-id":a.errorId,"data-source-port-id":l.source_port_id,"aria-label":a.message,role:"note"},children:[{name:"line",type:"element",value:"",children:[],attributes:{x1:y.from.x.toString(),y1:y.from.y.toString(),x2:y.to.x.toString(),y2:y.to.y.toString(),stroke:"red","stroke-width":"1"}},{name:"rect",type:"element",value:"",children:[],attributes:{x:h.minX.toString(),y:h.minY.toString(),width:m.toString(),height:g.toString(),fill:"rgba(255, 245, 245, 0.97)",stroke:"red","stroke-width":"1"}},{name:"text",type:"element",value:"",attributes:{x:(h.minX+6).toString(),y:(h.minY+17).toString(),fill:"#a00000","font-family":"sans-serif","font-size":"11"},children:_.map((b,v)=>({name:"tspan",type:"element",value:"",attributes:{x:(h.minX+6).toString(),dy:v===0?"0":"14"},children:[{name:"",type:"text",value:b,attributes:{},children:[]}]}))}]}]})}function vj(t,e){return t.flatMap((r)=>{if(r.type!=="schematic_component")return[];let i=n3(t.filter((o)=>o.type==="source_component"?o.source_component_id===r.source_component_id:("schematic_component_id"in o)&&o.schematic_component_id===r.schematic_component_id),0),n=[{x:i.minX,y:i.minY},{x:i.minX,y:i.maxY},{x:i.maxX,y:i.minY},{x:i.maxX,y:i.maxY}].map((o)=>F(e,o));return[{minX:Math.min(...n.map((o)=>o.x)),minY:Math.min(...n.map((o)=>o.y)),maxX:Math.max(...n.map((o)=>o.x)),maxY:Math.max(...n.map((o)=>o.y))}]})}function wj(t){switch(t.type){case"source_component_misconfigured_error":return{errorId:t.source_component_misconfigured_error_id,sourcePortIds:t.source_port_ids??[],message:t.message};case"source_pin_must_be_connected_error":return{errorId:t.source_pin_must_be_connected_error_id,sourcePortIds:[t.source_port_id],message:t.message};case"source_i2c_misconfigured_error":return{errorId:t.source_i2c_misconfigured_error_id,sourcePortIds:t.source_port_ids,message:t.message};case"source_trace_not_connected_error":return{errorId:t.source_trace_not_connected_error_id,sourcePortIds:t.connected_source_port_ids??[],message:t.message}}}function g3(t,e){let r=t.filter((C)=>C.type==="schematic_sheet"),i=xO(r),n=i;if(e?.schematicSheetId!==void 0)n=r.find((C)=>C.schematic_sheet_id===e.schematicSheetId)??i;else if(e?.schematicSheetIndex!==void 0)n=r.find((C)=>C.sheet_index===e.schematicSheetIndex)??i;let o=n?t.filter((C)=>!C.type.startsWith("schematic_")||x3(C)||("schematic_sheet_id"in C)&&C.schematic_sheet_id===n.schematic_sheet_id):t,a=n3(n?[n]:o),s=a.maxX-a.minX,l=a.maxY-a.minY,c=e?.width??1200,d=e?.height??600,h=e?.colorOverrides,y={...re,schematic:{...re.schematic,...h?.schematic??{}}},_=s/l,m=c/d,g;if(_>m){let C=c/_;g={x:0,y:(d-C)/2}}else{let C=d*_;g={x:(c-C)/2,y:0}}let b=H9([{x:a.minX,y:a.maxY},{x:a.maxX,y:a.maxY},{x:a.maxX,y:a.minY}],[{x:g.x,y:g.y},{x:c-g.x,y:g.y},{x:c-g.x,y:d-g.y}]),v=[];if(v.push({name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:c.toString(),height:d.toString()},children:[],value:""}),e?.grid){let C=typeof e.grid==="object"?e.grid:{};v.push(mO({bounds:a,transform:b,...C}))}let k=[],x=[],A=[],S=[],E=[],I=[],T=[],P=[],O=[],D=[],N=[],G=[],K=[],vt=Aj({transform:b,svgWidth:c,svgHeight:d,schematicSheet:n}),H=Array.isArray(y.simulation_palette)?y.simulation_palette:Array.isArray(y.palette)?y.palette:[],ht=0;for(let C of o)if(C.type==="schematic_sheet")G.push(...ej({schematicSheet:C,transform:b,colorMap:y}));else if(C.type==="schematic_graphic")K.push(LO({schematicGraphic:C,viewport:Fj({availableViewport:vt,schematicGraphic:C,transform:b})}));else if(C.type==="schematic_debug_object")k.push(...JO({debugObject:C,transform:b}));else if(C.type==="schematic_component")x.push(...KO({component:C,transform:b,circuitJson:o,colorMap:y})),O.push(...RO({component:C,transform:b,circuitJson:o}));else if(C.type==="schematic_box")T.push(...VO({schematicBox:C,transform:b,colorMap:y}));else if(C.type==="schematic_trace")A.push(...ij({trace:C,transform:b,colorMap:y}));else if(C.type==="schematic_net_label")S.push(...WO({schNetLabel:C,realToScreenTransform:b,colorMap:y}));else if(C.type==="schematic_text"&&!C.schematic_component_id)E.push(Zu({elm:C,transform:b,colorMap:y}));else if(C.type==="schematic_voltage_probe"){let ot=H.length>0?H[ht%H.length]:void 0;ht+=1,I.push(...nj({probe:C,transform:b,colorMap:y,fallbackColor:ot}))}else if(C.type==="schematic_table")P.push(...rj({schematicTable:C,transform:b,colorMap:y,circuitJson:o}));else if(C.type==="schematic_line"){if(C.schematic_component_id)continue;N.push(...h3({schLine:C,transform:b,colorMap:y}))}else if(C.type==="schematic_circle"){if(C.schematic_component_id)continue;N.push(...c3({schCircle:C,transform:b,colorMap:y}))}else if(C.type==="schematic_rect"){if(C.schematic_component_id)continue;N.push(...u3({schRect:C,transform:b,colorMap:y}))}else if(C.type==="schematic_arc"){if(C.schematic_component_id)continue;N.push(...s3({schArc:C,transform:b,colorMap:y}))}else if(C.type==="schematic_path"){if(C.schematic_component_id)continue;N.push(...y3({schPath:C,transform:b,colorMap:y}))}else if(C.type==="schematic_port"){let ot=o.find((it)=>it.type==="source_port"&&it.source_port_id===C.source_port_id);if(ot?.type==="source_port"&&ot.do_not_connect===!0)D.push(CO({schPort:C,transform:b,colorMap:y}));if(e?.drawPorts)D.push(...XO({schPort:C,transform:b,circuitJson:o,colorMap:y}))}let wt=A.filter((C)=>C.attributes?.["data-layer"]!=="overlay"),et=A.filter((C)=>C.attributes?.["data-layer"]==="overlay");if(v.push(...K,...k,...G,...wt,...et,...N,...x,...O,...D,...S,...E,...T,...I,...P),e?.labeledPoints)v.push(fO({points:e.labeledPoints,transform:b}));if(e?.shouldDrawWarnings)v.push(...hj({circuitJson:o,transform:b,svgWidth:c,svgHeight:d,colorMap:y}));if(e?.shouldDrawErrors)v.push(...bj({circuitJson:o,transform:b,svgWidth:c,svgHeight:d}));let Q=D5(t),V=Q5;if(e?.showErrorsInTextOverlay){let C=U5(t);if(C)v.push(C)}let tt={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",class:["tscircuit-schematic",e?.className].filter(Boolean).join(" "),width:c.toString(),height:d.toString(),style:`background-color: ${y.schematic.background}`,"data-real-to-screen-transform":U9(b),...Q&&{"data-software-used-string":Q},...e?.includeVersion&&{"data-circuit-to-svg-version":V}},children:[{name:"style",type:"element",children:[{type:"text",value:`
.boundary { fill: ${y.schematic.background}; }
.schematic-boundary { fill: none; stroke: #fff; }
.component { fill: none; stroke: ${y.schematic.component_outline}; }
.chip { fill: ${y.schematic.component_body}; stroke: ${y.schematic.component_outline}; }
.component-pin { fill: none; stroke: ${y.schematic.component_outline}; }
.text { font-family: sans-serif; fill: ${y.schematic.wire}; }
.pin-number { fill: ${y.schematic.pin_number}; }
.port-label { fill: ${y.schematic.reference}; }
.component-name { fill: ${y.schematic.reference}; }
${e?.css??""}
`,name:"",attributes:{},children:[]}],value:"",attributes:{}},...v],value:""};return O5(tt)}function Aj({transform:t,svgWidth:e,svgHeight:r,schematicSheet:i}){if(!i)return{x:0,y:0,width:e,height:r};let n=gc(i),o=F(t,{x:n.innerMinX,y:n.innerMaxY}),a=F(t,{x:n.innerMaxX,y:n.innerMinY});return{x:Math.min(o.x,a.x),y:Math.min(o.y,a.y),width:Math.abs(a.x-o.x),height:Math.abs(a.y-o.y)}}function Fj({availableViewport:t,schematicGraphic:e,transform:r}){if(e.width===void 0&&e.height===void 0)return t;let i=e.width===void 0?t.width:g5(e.width*Math.hypot(r.a,r.b),t.width),n=e.height===void 0?t.height:g5(e.height*Math.hypot(r.c,r.d),t.height);return{x:t.x+(t.width-i)/2,y:t.y+(t.height-n)/2,width:i,height:n}}function g5(t,e){if(!Number.isFinite(t))return e;return Math.max(0,Math.min(t,e))}var b3={convertCircuitJsonToSchematicSvg:g3,convertCircuitJsonToPcbSvg:H5,colorMap:re};if(typeof window<"u")window.Tscircuit=b3;var aG=b3;export{b3 as Tscircuit,re as colorMap,H5 as convertCircuitJsonToPcbSvg,g3 as convertCircuitJsonToSchematicSvg,aG as default};