@arach/arc-iso 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ (function(I,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],V):(I=typeof globalThis<"u"?globalThis:I||self,V(I.ArcIso={},I.React))})(this,(function(I,V){"use strict";const ct=30*(Math.PI/180),xt=Math.cos(ct),$t=Math.sin(ct);function a(e,n,l=0){return{screenX:(e-n)*xt,screenY:-(e+n)*$t-l}}function tt(e,n,l,f=0,o=0,y=0){const x={frontBottom:a(e,0,0),rightBottom:a(e,n,0),backBottom:a(0,n,0),leftBottom:a(0,0,0),frontTop:a(e,0,l),rightTop:a(e,n,l),backTop:a(0,n,l),leftTop:a(0,0,l)},T=v=>({x:v.screenX+f,y:v.screenY+o}),g=Object.fromEntries(Object.entries(x).map(([v,j])=>[v,T(j)])),A=(v,j,O,b)=>{if(b<=0){const $=a(0,0,O),i=a(v,0,O),u=a(v,j,O),C=a(0,j,O);return`M ${$.screenX+f},${$.screenY+o} L ${i.screenX+f},${i.screenY+o} L ${u.screenX+f},${u.screenY+o} L ${C.screenX+f},${C.screenY+o} Z`}const L=Math.min(v,j)/2,M=Math.min(b,L),k=8,E=[],z=($,i,u,C)=>{for(let P=0;P<=k;P++){const G=u+(C-u)*(P/k),Q=$+M*Math.cos(G),t=i+M*Math.sin(G),c=a(Q,t,O);E.push(`${c.screenX+f},${c.screenY+o}`)}};return z(M,M,Math.PI,Math.PI*1.5),z(v-M,M,Math.PI*1.5,Math.PI*2),z(v-M,j-M,0,Math.PI*.5),z(M,j-M,Math.PI*.5,Math.PI),`M ${E[0]} L ${E.slice(1).join(" L ")} Z`},h=v=>`M ${v.map(j=>`${j.x},${j.y}`).join(" L ")} Z`,X=(v,j,O,b,L,M)=>{const E=[];for(let u=0;u<6;u++){const C=L+(M-L)*(u/6),P=L+(M-L)*((u+1)/6),G=(C+P)/2,Q=Math.cos(G),t=Math.sin(G),_=Q*-.577+t*-.577+0*.577,K=.3+Math.max(0,_+.4)*.5,W=a(v+O*Math.cos(C),j+O*Math.sin(C),0),R=a(v+O*Math.cos(P),j+O*Math.sin(P),0),p=a(v+O*Math.cos(C),j+O*Math.sin(C),b),Y=a(v+O*Math.cos(P),j+O*Math.sin(P),b),et=`M ${W.screenX+f},${W.screenY+o} L ${R.screenX+f},${R.screenY+o} L ${Y.screenX+f},${Y.screenY+o} L ${p.screenX+f},${p.screenY+o} Z`;E.push({path:et,intensity:K})}return E},d=Math.min(y,Math.min(e,n)/2),s=A(e,n,l,d);let m,S,N,F,H,B;if(d>0){const v=[{x:a(0,d,0).screenX+f,y:a(0,d,0).screenY+o},{x:a(0,n-d,0).screenX+f,y:a(0,n-d,0).screenY+o},{x:a(0,n-d,l).screenX+f,y:a(0,n-d,l).screenY+o},{x:a(0,d,l).screenX+f,y:a(0,d,l).screenY+o}];m=h(v);const j=[{x:a(d,0,0).screenX+f,y:a(d,0,0).screenY+o},{x:a(e-d,0,0).screenX+f,y:a(e-d,0,0).screenY+o},{x:a(e-d,0,l).screenX+f,y:a(e-d,0,l).screenY+o},{x:a(d,0,l).screenX+f,y:a(d,0,l).screenY+o}];S=h(j),N=X(d,d,d,l,Math.PI,Math.PI*1.5),F=X(e-d,d,d,l,Math.PI*1.5,Math.PI*2),H=X(d,n-d,d,l,Math.PI*.5,Math.PI),B=X(e-d,n-d,d,l,0,Math.PI*.5)}else{const v=[g.leftBottom,g.backBottom,g.backTop,g.leftTop],j=[g.leftBottom,g.frontBottom,g.frontTop,g.leftTop];m=h(v),S=h(j),N=[],F=[],H=[],B=[]}const q=`M ${g.leftBottom.x},${g.leftBottom.y} L ${g.frontBottom.x},${g.frontBottom.y} L ${g.rightBottom.x},${g.rightBottom.y} L ${g.backBottom.x},${g.backBottom.y} Z`;return{top:s,left:m,right:S,cornerFrontLeft:N,cornerFrontRight:F,cornerBackLeft:H,cornerBackRight:B,outline:q}}function gt(e,n=60,l=50){return{top:`hsl(${e}, ${n}%, ${Math.min(l+15,95)}%)`,right:`hsl(${e}, ${n}%, ${l}%)`,left:`hsl(${e}, ${n}%, ${Math.max(l-15,15)}%)`}}const it={violet:{hue:270,saturation:60,lightness:55},blue:{hue:220,saturation:70,lightness:50},cyan:{hue:190,saturation:80,lightness:45},emerald:{hue:155,saturation:65,lightness:45},amber:{hue:40,saturation:90,lightness:50},rose:{hue:350,saturation:70,lightness:55},slate:{hue:220,saturation:15,lightness:50},zinc:{hue:240,saturation:5,lightness:50}};function kt(e){const n=it[e]||it.slate;return gt(n.hue,n.saturation,n.lightness)}var nt={exports:{}},ot={};var ft;function vt(){if(ft)return ot;ft=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function l(f,o,y){var x=null;if(y!==void 0&&(x=""+y),o.key!==void 0&&(x=""+o.key),"key"in o){y={};for(var T in o)T!=="key"&&(y[T]=o[T])}else y=o;return o=y.ref,{$$typeof:e,type:f,key:x,ref:o!==void 0?o:null,props:y}}return ot.Fragment=n,ot.jsx=l,ot.jsxs=l,ot}var rt={};var dt;function jt(){return dt||(dt=1,process.env.NODE_ENV!=="production"&&(function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===k?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case H:return"Profiler";case F:return"StrictMode";case j:return"Suspense";case O:return"SuspenseList";case M:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case S:return"Portal";case q:return t.displayName||"Context";case B:return(t._context.displayName||"Context")+".Consumer";case v:var c=t.render;return t=t.displayName,t||(t=c.displayName||c.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case b:return c=t.displayName||null,c!==null?c:e(t.type)||"Memo";case L:c=t._payload,t=t._init;try{return e(t(c))}catch{}}return null}function n(t){return""+t}function l(t){try{n(t);var c=!1}catch{c=!0}if(c){c=console;var _=c.error,w=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return _.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",w),n(t)}}function f(t){if(t===N)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===L)return"<...>";try{var c=e(t);return c?"<"+c+">":"<...>"}catch{return"<...>"}}function o(){var t=E.A;return t===null?null:t.getOwner()}function y(){return Error("react-stack-top-frame")}function x(t){if(z.call(t,"key")){var c=Object.getOwnPropertyDescriptor(t,"key").get;if(c&&c.isReactWarning)return!1}return t.key!==void 0}function T(t,c){function _(){u||(u=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",c))}_.isReactWarning=!0,Object.defineProperty(t,"key",{get:_,configurable:!0})}function g(){var t=e(this.type);return C[t]||(C[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function A(t,c,_,w,K,W){var R=_.ref;return t={$$typeof:m,type:t,key:c,props:_,_owner:w},(R!==void 0?R:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:g}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function h(t,c,_,w,K,W){var R=c.children;if(R!==void 0)if(w)if($(R)){for(w=0;w<R.length;w++)X(R[w]);Object.freeze&&Object.freeze(R)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else X(R);if(z.call(c,"key")){R=e(t);var p=Object.keys(c).filter(function(et){return et!=="key"});w=0<p.length?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}",Q[R+w]||(p=0<p.length?"{"+p.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ let props = %s;
3
+ <%s {...props} />
4
+ React keys must be passed directly to JSX without using spread:
5
+ let props = %s;
6
+ <%s key={someKey} {...props} />`,w,R,p,R),Q[R+w]=!0)}if(R=null,_!==void 0&&(l(_),R=""+_),x(c)&&(l(c.key),R=""+c.key),"key"in c){_={};for(var Y in c)Y!=="key"&&(_[Y]=c[Y])}else _=c;return R&&T(_,typeof t=="function"?t.displayName||t.name||"Unknown":t),A(t,R,_,o(),K,W)}function X(t){d(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===L&&(t._payload.status==="fulfilled"?d(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function d(t){return typeof t=="object"&&t!==null&&t.$$typeof===m}var s=V,m=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),q=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),E=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,$=Array.isArray,i=console.createTask?console.createTask:function(){return null};s={react_stack_bottom_frame:function(t){return t()}};var u,C={},P=s.react_stack_bottom_frame.bind(s,y)(),G=i(f(y)),Q={};rt.Fragment=N,rt.jsx=function(t,c,_){var w=1e4>E.recentlyCreatedOwnerStacks++;return h(t,c,_,!1,w?Error("react-stack-top-frame"):P,w?i(f(t)):G)},rt.jsxs=function(t,c,_){var w=1e4>E.recentlyCreatedOwnerStacks++;return h(t,c,_,!0,w?Error("react-stack-top-frame"):P,w?i(f(t)):G)}})()),rt}var pt;function Tt(){return pt||(pt=1,process.env.NODE_ENV==="production"?nt.exports=vt():nt.exports=jt()),nt.exports}var r=Tt();const ut='"JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace',Et={blue:{top:"#3b82f6",side:"#2563eb",front:"#1d4ed8"},violet:{top:"#8b5cf6",side:"#7c3aed",front:"#6d28d9"},cyan:{top:"#06b6d4",side:"#0891b2",front:"#0e7490"},emerald:{top:"#10b981",side:"#059669",front:"#047857"},amber:{top:"#f59e0b",side:"#d97706",front:"#b45309"},rose:{top:"#f43f5e",side:"#e11d48",front:"#be123c"},slate:{top:"#475569",side:"#334155",front:"#1e293b"}},_t={blue:{top:"#93c5fd",side:"#60a5fa",front:"#3b82f6"},violet:{top:"#c4b5fd",side:"#a78bfa",front:"#8b5cf6"},cyan:{top:"#67e8f9",side:"#22d3ee",front:"#06b6d4"},emerald:{top:"#6ee7b7",side:"#34d399",front:"#10b981"},amber:{top:"#fcd34d",side:"#fbbf24",front:"#f59e0b"},rose:{top:"#fda4af",side:"#fb7185",front:"#f43f5e"},slate:{top:"#e2e8f0",side:"#cbd5e1",front:"#94a3b8"}};function st(e,n,l){const f=A=>{const h=A.replace("#","");return{r:parseInt(h.substring(0,2),16),g:parseInt(h.substring(2,4),16),b:parseInt(h.substring(4,6),16)}},o=f(e),y=f(n),x=Math.round(o.r+(y.r-o.r)*l),T=Math.round(o.g+(y.g-o.g)*l),g=Math.round(o.b+(y.b-o.b)*l);return`rgb(${x},${T},${g})`}function Rt({x:e,y:n,z:l,children:f,fontSize:o=8,color:y="#1e293b",shadow:x}){const T=a(e,n,l);return r.jsx("g",{transform:`translate(${T.screenX}, ${T.screenY})`,filter:x,children:r.jsx("g",{transform:"matrix(0.866, -0.5, 0.866, 0.5, 0, 0)",children:r.jsx("text",{x:0,y:0,textAnchor:"middle",fill:y,fontSize:o,fontWeight:600,fontFamily:ut,style:{textTransform:"uppercase",letterSpacing:"0.06em"},children:f})})})}function St({width:e,depth:n,elevation:l,color:f,opacity:o,borderColor:y,theme:x,isGround:T}){const A=tt(e,n,T?8:2,0,0),h=a(0,0,l);return r.jsxs("g",{transform:`translate(${h.screenX}, ${h.screenY})`,children:[T&&r.jsx("g",{transform:"translate(4, 4)",opacity:.2,children:r.jsx("path",{d:A.top,fill:"#000"})}),r.jsx("path",{d:A.top,fill:f,opacity:o}),T&&r.jsxs(r.Fragment,{children:[r.jsx("path",{d:A.left,fill:x==="dark"?"#0f172a":"#cbd5e1",opacity:.8}),r.jsx("path",{d:A.right,fill:x==="dark"?"#1e293b":"#94a3b8",opacity:.8})]}),r.jsx("path",{d:A.top,fill:"none",stroke:y||(x==="dark"?"#475569":"#94a3b8"),strokeWidth:T?1.5:.75,opacity:T?1:.6})]})}function wt({config:e,options:n={},className:l,style:f,onNodeClick:o,onLayerClick:y}){const{interactive:x=!0,animate:T=!0,showLabels:g=!0,expandOnHover:A=!0}=n,{theme:h,canvas:X,origin:d,tiers:s,floorSize:m,nodes:S,cornerRadius:N=0}=e,F=h==="dark"?Et:_t,H=h==="dark"?"#0f172a":"#fafafa",B=h==="dark"?"#e2e8f0":"#1e293b",q=h==="dark"?"#64748b":"#94a3b8",[v,j]=V.useState(new Set);V.useEffect(()=>{T?(j(new Set),s.forEach(($,i)=>{setTimeout(()=>{j(u=>new Set([...u,i]))},i*150+100)})):j(new Set(s.map(($,i)=>i)))},[e.id,T,s.length]);const[O,b]=V.useState(null),[L,M]=V.useState(null),[k,E]=V.useState(null),z=[...S].sort(($,i)=>{const u=s[$.tier]?.elevation||0,C=s[i.tier]?.elevation||0;if(u!==C)return u-C;const P=$.x+$.width+($.y+$.depth);return i.x+i.width+(i.y+i.depth)-P});return r.jsx("div",{className:l,style:{display:"inline-block",...f},children:r.jsxs("svg",{width:X.width,height:X.height,style:{backgroundColor:H},onClick:()=>{x&&(E(null),M(null))},children:[r.jsxs("defs",{children:[r.jsx("pattern",{id:`grid-${e.id}`,width:"24",height:"24",patternUnits:"userSpaceOnUse",children:r.jsx("circle",{cx:"12",cy:"12",r:"0.5",fill:h==="dark"?"#1e293b":"#e2e8f0"})}),r.jsx("filter",{id:`glow-${e.id}`,x:"-20%",y:"-20%",width:"140%",height:"140%",children:r.jsx("feDropShadow",{dx:"0",dy:"4",stdDeviation:"8",floodColor:h==="dark"?"#60a5fa":"#3b82f6",floodOpacity:"0.3"})}),r.jsxs("radialGradient",{id:`bg-${e.id}`,cx:"48%",cy:"34%",r:"82%",children:[r.jsx("stop",{offset:"0%",stopColor:h==="dark"?"#16203a":"#ffffff"}),r.jsx("stop",{offset:"55%",stopColor:h==="dark"?"#0e1526":"#f2f5f9"}),r.jsx("stop",{offset:"100%",stopColor:h==="dark"?"#080d18":"#e7ecf2"})]}),r.jsx("filter",{id:`contact-${e.id}`,x:"-60%",y:"-60%",width:"220%",height:"220%",children:r.jsx("feGaussianBlur",{stdDeviation:"5"})}),r.jsxs("linearGradient",{id:`sheen-${e.id}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0%",stopColor:"#ffffff",stopOpacity:"0.18"}),r.jsx("stop",{offset:"55%",stopColor:"#ffffff",stopOpacity:"0.04"}),r.jsx("stop",{offset:"100%",stopColor:"#ffffff",stopOpacity:"0"})]}),r.jsxs("linearGradient",{id:`shade-${e.id}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0%",stopColor:"#000000",stopOpacity:"0"}),r.jsx("stop",{offset:"100%",stopColor:"#000000",stopOpacity:"0.24"})]}),r.jsx("filter",{id:`label-${e.id}`,x:"-40%",y:"-40%",width:"180%",height:"180%",children:r.jsx("feDropShadow",{dx:"0",dy:"0.5",stdDeviation:"0.7",floodColor:"#000000",floodOpacity:"0.7"})})]}),r.jsx("rect",{width:"100%",height:"100%",fill:`url(#bg-${e.id})`}),r.jsx("rect",{width:"100%",height:"100%",fill:`url(#grid-${e.id})`,opacity:"0.5"}),r.jsx("g",{transform:`translate(${d.x}, ${d.y})`,children:s.map(($,i)=>{const u=z.filter(p=>p.tier===i),C=v.has(i),P=x&&(L===i||L===null&&k===null&&O===i),G=x&&(L!==null||O!==null||k!==null),Q=k?.tier===i,t=G&&!P&&!Q,c=C?0:60,_=C?1:0,w=P&&A?{x:10,y:-34}:{x:0,y:0},K=P?1.03:1,W=a(m.width/2,m.depth/2,$.elevation),R=$.offset||{x:0,y:0};return r.jsxs("g",{"data-tier":i,onMouseEnter:()=>x&&b(i),onMouseLeave:()=>x&&b(null),onClick:p=>{x&&(p.stopPropagation(),E(null),M(Y=>Y===i?null:i),y?.(i))},style:{transform:`translate(${R.x+w.x}px, ${R.y+w.y}px) translate(${W.screenX}px, ${W.screenY+c}px) scale(${K}) translate(${-W.screenX}px, ${-W.screenY}px)`,transition:"transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease-out",opacity:_*(t?.35:1),filter:P?`url(#glow-${e.id})`:"none",cursor:x?"pointer":"default"},children:[r.jsx(St,{width:m.width,depth:m.depth,elevation:i===0?-2:$.elevation,color:$.floorColor||(h==="dark"?"#0f172a":"#f8fafc"),opacity:$.floorOpacity||(i===0?.95:.5),borderColor:$.borderColor,theme:h,isGround:i===0}),u.map((p,Y)=>{const et=$.elevation+5,mt=a(p.x,p.y,et),U=tt(p.width,p.depth,p.height,mt.screenX,mt.screenY,N),J=F[p.color]||F.slate,lt=k?.tier===i&&k?.index===Y,Pt=x&&k!==null&&!lt,yt=a(p.x-3,p.y-3,$.elevation),At=tt(p.width+6,p.depth+6,0,yt.screenX,yt.screenY,N).top;return r.jsxs("g",{"data-node":`${i}-${Y}`,opacity:(p.opacity??1)*(Pt?.3:1),onClick:x?D=>{if(D.stopPropagation(),M(null),E(Z=>Z&&Z.tier===i&&Z.index===Y?null:{tier:i,index:Y}),o?.(p,{tier:i,index:Y}),p.link)try{window.open(p.link,"_blank")}catch{}}:void 0,style:{cursor:x?"pointer":"default",transition:"opacity 0.3s ease-out"},children:[r.jsx("path",{d:At,fill:"#000000",opacity:.3,filter:`url(#contact-${e.id})`}),U.cornerBackRight?.map((D,Z)=>r.jsx("path",{d:D.path,fill:st(J.front,J.side,D.intensity)},`cbr-${Z}`)),U.cornerBackLeft?.map((D,Z)=>r.jsx("path",{d:D.path,fill:st(J.side,J.front,D.intensity)},`cbl-${Z}`)),r.jsx("path",{d:U.left,fill:J.side}),r.jsx("path",{d:U.left,fill:`url(#shade-${e.id})`}),r.jsx("path",{d:U.right,fill:J.front}),r.jsx("path",{d:U.right,fill:`url(#shade-${e.id})`}),U.cornerFrontRight?.map((D,Z)=>r.jsx("path",{d:D.path,fill:st(J.front,J.side,D.intensity)},`cfr-${Z}`)),U.cornerFrontLeft?.map((D,Z)=>r.jsx("path",{d:D.path,fill:st(J.front,J.side,D.intensity)},`cfl-${Z}`)),r.jsx("path",{d:U.top,fill:J.top}),r.jsx("path",{d:U.top,fill:`url(#sheen-${e.id})`}),r.jsx("path",{d:U.top,fill:"none",stroke:lt?"#ffffff":"rgba(255,255,255,0.28)",strokeWidth:lt?1.4:.75,strokeLinejoin:"round"}),g&&p.label&&r.jsx(Rt,{x:p.x+p.width/2,y:p.y+p.depth/2,z:et+p.height+2,fontSize:p.width>70?9:8,color:B,shadow:`url(#label-${e.id})`,children:p.label})]},Y)}),g&&r.jsx("text",{x:a(-25,m.depth/2,$.elevation+15).screenX-35,y:a(-25,m.depth/2,$.elevation+15).screenY,fill:q,fontSize:9,fontWeight:500,fontFamily:ut,opacity:.6,style:{letterSpacing:"0.05em"},children:$.name})]},i)})})]})})}const ht='"JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace',Ot={blue:{top:"#3b82f6",side:"#2563eb",front:"#1d4ed8"},violet:{top:"#8b5cf6",side:"#7c3aed",front:"#6d28d9"},cyan:{top:"#06b6d4",side:"#0891b2",front:"#0e7490"},emerald:{top:"#10b981",side:"#059669",front:"#047857"},amber:{top:"#f59e0b",side:"#d97706",front:"#b45309"},rose:{top:"#f43f5e",side:"#e11d48",front:"#be123c"},slate:{top:"#475569",side:"#334155",front:"#1e293b"}},Mt={blue:{top:"#93c5fd",side:"#60a5fa",front:"#3b82f6"},violet:{top:"#c4b5fd",side:"#a78bfa",front:"#8b5cf6"},cyan:{top:"#67e8f9",side:"#22d3ee",front:"#06b6d4"},emerald:{top:"#6ee7b7",side:"#34d399",front:"#10b981"},amber:{top:"#fcd34d",side:"#fbbf24",front:"#f59e0b"},rose:{top:"#fda4af",side:"#fb7185",front:"#f43f5e"},slate:{top:"#e2e8f0",side:"#cbd5e1",front:"#94a3b8"}};function at(e,n,l){const f=A=>{const h=A.replace("#","");return{r:parseInt(h.substring(0,2),16),g:parseInt(h.substring(2,4),16),b:parseInt(h.substring(4,6),16)}},o=f(e),y=f(n),x=Math.round(o.r+(y.r-o.r)*l),T=Math.round(o.g+(y.g-o.g)*l),g=Math.round(o.b+(y.b-o.b)*l);return`rgb(${x},${T},${g})`}function bt(e){const{theme:n,canvas:l,origin:f,tiers:o,floorSize:y,nodes:x,cornerRadius:T=0}=e,g=n==="dark"?Ot:Mt,A=n==="dark"?"#0f172a":"#fafafa",h=n==="dark"?"#e2e8f0":"#1e293b",X=n==="dark"?"#64748b":"#94a3b8",d=[...x].sort((m,S)=>{const N=o[m.tier]?.elevation||0,F=o[S.tier]?.elevation||0;return N!==F?N-F:S.x+S.width+(S.y+S.depth)-(m.x+m.width+(m.y+m.depth))});let s=`<svg xmlns="http://www.w3.org/2000/svg" width="${l.width}" height="${l.height}" style="background:${A}">`;s+=`<defs>
7
+ <pattern id="grid" width="24" height="24" patternUnits="userSpaceOnUse">
8
+ <circle cx="12" cy="12" r="0.5" fill="${n==="dark"?"#1e293b":"#e2e8f0"}"/>
9
+ </pattern>
10
+ <radialGradient id="bg" cx="48%" cy="34%" r="82%">
11
+ <stop offset="0%" stop-color="${n==="dark"?"#16203a":"#ffffff"}"/>
12
+ <stop offset="55%" stop-color="${n==="dark"?"#0e1526":"#f2f5f9"}"/>
13
+ <stop offset="100%" stop-color="${n==="dark"?"#080d18":"#e7ecf2"}"/>
14
+ </radialGradient>
15
+ <filter id="contact" x="-60%" y="-60%" width="220%" height="220%"><feGaussianBlur stdDeviation="5"/></filter>
16
+ <linearGradient id="sheen" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="#ffffff" stop-opacity="0.18"/><stop offset="55%" stop-color="#ffffff" stop-opacity="0.04"/><stop offset="100%" stop-color="#ffffff" stop-opacity="0"/></linearGradient>
17
+ <linearGradient id="shade" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="#000000" stop-opacity="0"/><stop offset="100%" stop-color="#000000" stop-opacity="0.24"/></linearGradient>
18
+ <filter id="labelshadow" x="-40%" y="-40%" width="180%" height="180%"><feDropShadow dx="0" dy="0.5" stdDeviation="0.7" flood-color="#000000" flood-opacity="0.7"/></filter>
19
+ </defs>`,s+='<rect width="100%" height="100%" fill="url(#bg)"/>',s+='<rect width="100%" height="100%" fill="url(#grid)" opacity="0.5"/>',s+=`<g transform="translate(${f.x},${f.y})">`;for(let m=0;m<o.length;m++){const S=o[m],N=d.filter(b=>b.tier===m),F=S.offset||{x:0,y:0};s+=`<g transform="translate(${F.x},${F.y})">`;const H=m===0?8:2,B=tt(y.width,y.depth,H,0,0),q=a(0,0,m===0?-2:S.elevation),v=S.floorColor||(n==="dark"?"#0f172a":"#f8fafc"),j=S.floorOpacity||(m===0?.95:.5);s+=`<g transform="translate(${q.screenX},${q.screenY})">`,m===0&&(s+=`<g transform="translate(4,4)" opacity="0.2"><path d="${B.top}" fill="#000"/></g>`),s+=`<path d="${B.top}" fill="${v}" opacity="${j}"/>`,m===0&&(s+=`<path d="${B.left}" fill="${n==="dark"?"#0f172a":"#cbd5e1"}" opacity="0.8"/>`,s+=`<path d="${B.right}" fill="${n==="dark"?"#1e293b":"#94a3b8"}" opacity="0.8"/>`),s+=`<path d="${B.top}" fill="none" stroke="${S.borderColor||(n==="dark"?"#475569":"#94a3b8")}" stroke-width="${m===0?1.5:.75}" opacity="${m===0?1:.6}"/>`,s+="</g>";for(const b of N){const L=S.elevation+5,M=a(b.x,b.y,L),k=tt(b.width,b.depth,b.height,M.screenX,M.screenY,T),E=g[b.color]||g.slate,z=b.opacity??1;s+=`<g opacity="${z}">`;const $=a(b.x-3,b.y-3,S.elevation),i=tt(b.width+6,b.depth+6,0,$.screenX,$.screenY,T).top;if(s+=`<path d="${i}" fill="#000000" opacity="0.3" filter="url(#contact)"/>`,k.cornerBackRight)for(const u of k.cornerBackRight)s+=`<path d="${u.path}" fill="${at(E.front,E.side,u.intensity)}"/>`;if(k.cornerBackLeft)for(const u of k.cornerBackLeft)s+=`<path d="${u.path}" fill="${at(E.side,E.front,u.intensity)}"/>`;if(s+=`<path d="${k.left}" fill="${E.side}"/>`,s+=`<path d="${k.left}" fill="url(#shade)"/>`,s+=`<path d="${k.right}" fill="${E.front}"/>`,s+=`<path d="${k.right}" fill="url(#shade)"/>`,k.cornerFrontRight)for(const u of k.cornerFrontRight)s+=`<path d="${u.path}" fill="${at(E.front,E.side,u.intensity)}"/>`;if(k.cornerFrontLeft)for(const u of k.cornerFrontLeft)s+=`<path d="${u.path}" fill="${at(E.front,E.side,u.intensity)}"/>`;if(s+=`<path d="${k.top}" fill="${E.top}"/>`,s+=`<path d="${k.top}" fill="url(#sheen)"/>`,s+=`<path d="${k.top}" fill="none" stroke="rgba(255,255,255,0.28)" stroke-width="0.75" stroke-linejoin="round"/>`,b.label){const u=a(b.x+b.width/2,b.y+b.depth/2,L+b.height+2),C=b.width>70?9:8;s+=`<g transform="translate(${u.screenX},${u.screenY})" filter="url(#labelshadow)">`,s+='<g transform="matrix(0.866,-0.5,0.866,0.5,0,0)">',s+=`<text x="0" y="0" text-anchor="middle" fill="${h}" font-size="${C}" font-weight="600" font-family='${ht}' style="text-transform:uppercase;letter-spacing:0.06em">${b.label}</text>`,s+="</g></g>"}s+="</g>"}const O=a(-25,y.depth/2,S.elevation+15);s+=`<text x="${O.screenX-35}" y="${O.screenY}" fill="${X}" font-size="9" font-weight="500" font-family='${ht}' opacity="0.6" style="letter-spacing:0.05em">${S.name}</text>`,s+="</g>"}return s+="</g></svg>",s}function Ct(e,n){e.innerHTML=bt(n)}I.ArcDiagram=wt,I.getColorShading=kt,I.isoBox=tt,I.isoToScreen=a,I.renderToElement=Ct,I.renderToString=bt,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));