exodeui 6.0.29 → 6.0.30

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.
package/dist/index.d.ts CHANGED
@@ -3,4 +3,4 @@ export * from './types';
3
3
  export * from './engine';
4
4
  export * from './useExodeUI';
5
5
  export * from './ExodeSEO';
6
- export declare const VERSION = "6.0.28";
6
+ export declare const VERSION = "6.0.30";
package/dist/index.js CHANGED
@@ -19,4 +19,4 @@
19
19
  0 ${BA} 0 0 ${1-BA}
20
20
  0 0 ${BA} 0 ${1-BA}
21
21
  0 0 0 1 0"/>`,wA="invert"}if(R!==0||x!==0||j!==0||GA!==0){const BA=1+j+GA,N=BA*(1+R-x/2),f=BA*(1+x),p=BA*(1-R-x/2),oA=M.shadows*.1/255,UA=[N,0,0,0,oA,0,f,0,0,oA,0,0,p,0,oA,0,0,0,1,0].join(" ");CA+=`<feColorMatrix in="${wA}" type="matrix" values="${UA}" result="advanced"/>`,wA="advanced"}if(M.blur&&(CA+=`<feGaussianBlur in="${wA}" stdDeviation="${M.blur}" result="blur"/>`,wA="blur"),CA){const BA=`<svg xmlns="http://www.w3.org/2000/svg"><filter id="f" color-interpolation-filters="sRGB">${CA}</filter></svg>`,N=btoa(BA);t.push(`url('data:image/svg+xml;base64,${N}#f')`)}}t.length>0?A.filter=t.join(" "):A.filter="none",A.imageSmoothingEnabled=!0,A.imageSmoothingQuality="high";const n=A.globalAlpha,X=this.normalizeOpacity(g.opacity!==void 0?g.opacity:100);A.globalAlpha=n*X;const Z=g.compositeOperation||g.blendMode;if(Z&&Z!=="Normal"){const m=Z.toLowerCase();["multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","copy","xor","multiply","screen"].includes(m)&&(A.globalCompositeOperation=m)}const H=A,QA=g.masks||(I.maskedBy?[{maskId:I.maskedBy,inverted:I.maskInverted===!0,type:I.maskType||"alpha",opacity:I.maskOpacity!==void 0?I.maskOpacity/100:1,feather:I.maskFeather||0,isVisible:!0}]:[]);let L=!1;const U=QA.filter(m=>m.isVisible!==!1&&C.has(m.maskId));if(U.length>0){const m=U[0],O=C.get(m.maskId),Y=this.objectStates.get(O.id);Y&&Y.visible!==!1&&(L=!0,(!this.maskBuffer||this.maskBuffer.width!==this.canvasWidth||this.maskBuffer.height!==this.canvasHeight)&&(this.maskBuffer=document.createElement("canvas"),this.maskBuffer.width=this.canvasWidth,this.maskBuffer.height=this.canvasHeight,this.maskCtx=this.maskBuffer.getContext("2d",{willReadFrequently:!0}),this.maskCtx&&(this.maskCtx.imageSmoothingEnabled=!0,this.maskCtx.imageSmoothingQuality="high")),this.maskCtx.setTransform(1,0,0,1,0,0),this.maskCtx.globalCompositeOperation="source-over",this.maskCtx.globalAlpha=1,this.maskCtx.filter="none",this.maskCtx.clearRect(0,0,this.maskBuffer.width,this.maskBuffer.height),this.rootTransform&&this.maskCtx.setTransform(this.rootTransform),I.parentId&&this.applyAbsoluteTransform(this.maskCtx,I.parentId,C),this.maskCtx.save(),this.maskCtx.globalAlpha=1,A=this.maskCtx,A.filter=H.filter)}A.translate(Math.round(a),Math.round(G)),A.rotate(g.rotation*Math.PI/180);const T=g.skew_x||0,AA=g.skew_y||0;(T!==0||AA!==0)&&A.transform(1,Math.tan(AA*Math.PI/180),Math.tan(T*Math.PI/180),1,0,0),A.scale((g.scale_x??1)*(g.flip_x===!0?-1:1),(g.scale_y??1)*(g.flip_y===!0?-1:1));const IA=E.shadow;if(IA&&IA.isEnabled!==!1){let m=IA.color||"#000000";(_=(d=this.artboard)==null?void 0:d.tokens)!=null&&_.colors&&this.artboard.tokens.colors[m]&&(m=this.artboard.tokens.colors[m]);const O=this.normalizeOpacity(IA.opacity??100),Y=IA.spread||0,x=(IA.blur||0)+Y*1.5;let j=m;if(m.startsWith("#")){const wA=m.replace("#",""),kA=parseInt(wA.substring(0,2),16),BA=parseInt(wA.substring(2,4),16),N=parseInt(wA.substring(4,6),16);j=`rgba(${kA}, ${BA}, ${N}, ${O})`}else if(m.startsWith("rgba")){const wA=m.match(/[\d.]+/g);if(wA&&wA.length>=4){const kA=wA[0],BA=wA[1],N=wA[2],f=wA[3];j=`rgba(${kA}, ${BA}, ${N}, ${parseFloat(f)*O})`}}const GA=A.getTransform(),CA=Math.sqrt(GA.a*GA.a+GA.b*GA.b)||1;A.shadowColor=j,A.shadowBlur=x*CA,A.shadowOffsetX=(IA.offsetX||0)*CA,A.shadowOffsetY=(IA.offsetY||0)*CA}const b=I.liquidFill||((hA=I.style)==null?void 0:hA.liquidFill),P=I.artEffect||((SA=I.style)==null?void 0:SA.artEffect);if(b&&b.enabled){A.save();const m=b.fillLevel??.5;A.beginPath();const O=D/2-D*m;A.rect(-i/2,O,i,D*m),A.clip(),A.fillStyle=b.color||"#3b82f6",A.globalAlpha=A.globalAlpha*(b.opacity??1)}const gA=P&&P.enabled&&P.type==="glitch";if(gA){A.save();const O=(P.intensity??.5)*10,Y=A.getTransform(),R=Math.sqrt(Y.a*Y.a+Y.b*Y.b)||1;A.shadowColor="rgba(255, 0, 0, 0.5)",A.shadowBlur=O*R,A.translate(O/2,0)}if(Q.type==="Text")this._renderText(A,I,h,E,g,i,D);else if(Q.type==="Image"){const m=Q.src;if(m){let O=this.imageCache.get(m);O||(O=new Image,O.onload=()=>{},O.onerror=()=>{console.error(`[ExodeUI] Image load failed: ${m.substring(0,100)}${m.length>100?"...":""}`)},O.src=m,this.imageCache.set(m,O));const Y=E.stroke&&E.stroke.width>0&&E.stroke.isEnabled!==!1,R=(((FA=E.stroke)==null?void 0:FA.alignment)||"center").toLowerCase();if(Y&&(R==="outside"||R==="center")&&this.applyStrokeAlignment(A,E,h,i,D,s),E.fill&&E.fill.type!=="None"){A.save();const x=A.globalAlpha,j=this.createCanvasFill(A,E.fill,i,D);A.fillStyle=j||E.fill.color||"transparent",A.globalAlpha=x*this.normalizeOpacity(E.fill.opacity??100),s!==0?(this.drawRoundRect(A,-i/2,-D/2,i,D,s),A.fill()):A.fillRect(-i/2,-D/2,i,D),A.globalAlpha=x,A.restore()}O.complete&&O.naturalWidth>0?(s!==0?(A.save(),this.drawRoundRect(A,-i/2,-D/2,i,D,s),A.clip(),A.drawImage(O,-i/2,-D/2,i,D),A.restore()):A.drawImage(O,-i/2,-D/2,i,D),Y&&R==="inside"&&this.applyStrokeAlignment(A,E,h,i,D,s)):Y&&R==="inside"&&this.applyStrokeAlignment(A,E,h,i,D,s)}}else if(Q.type==="SVG"){const m=Q.svgContent;if(m){const O=E.palette||[],Y=E.fill,R=E.stroke,x=Y?this.normalizeOpacity(Y.opacity??100):1,j=(Y==null?void 0:Y.type)==="Solid"&&(!R||R.isEnabled===!1||R.type==="Solid"&&R.color===Y.color),GA=Y&&Y.type!=="None"?j?"monochrome":Y.type==="Solid"?(Y.color||"")+"|opacity:"+x:JSON.stringify(Y.stops||[])+"|opacity:"+x:"",CA=R&&R.isEnabled!==!1&&(R.width||0)>0?j?["monochrome",R.width||0,R.trimStart??0,R.trimEnd??1,R.trimOffset??0,R.dashOffset??0].join("|"):[R.width||0,R.fill?R.fill.type==="Solid"?R.fill.color||"":JSON.stringify(R.fill.stops||[]):R.color||"",R.opacity??1,R.lineCap||"",R.lineJoin||"",(R.dashArray||[]).join(","),R.trimStart??0,R.trimEnd??1,R.trimOffset??0,R.dashOffset??0].join("|"):"nostroke",wA=[I.id,O.join("_"),GA,CA,g.opacity??100,g.visible!==!1?"v":"h"].join("_");let kA=this.imageCache.get(wA);if(!kA){kA=new Image,kA.crossOrigin="anonymous";let N=m;if(Q.colors&&Q.colors.length>0&&O.length>0&&Q.colors.forEach((iA,V)=>{if(O[V]){const $=iA.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),DA=new RegExp($,"gi");N=N.replace(DA,O[V])}}),Y&&Y.type&&Y.type!=="None"){if(Y.type==="Solid"&&Y.color){const iA=j?"#FFFFFF":Y.color,V=j?1:this.normalizeOpacity(Y.opacity??100);N=N.replace(/\bfill\s*=\s*["'][^"']*["']/gi,$=>/fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test($)?$:`fill="${iA}"`),N=N.replace(/fill\s*:\s*[^;"')]+/gi,$=>/fill\s*:\s*(none|transparent)/i.test($)?$:`fill:${iA}`),V<1&&(N=N.replace(/\bfill-opacity\s*=\s*["'][^"']*["']/gi,`fill-opacity="${V}"`),N=N.replace(/fill-opacity\s*:\s*[^;"')]+/gi,`fill-opacity:${V}`),N.match(/\bfill-opacity\s*=/i)||(N=N.replace(/(<svg[^>]*>)/i,`$1<g fill-opacity="${V}">`),N=N.replace(/<\/svg>/i,"</g></svg>")))}else if(Y.type==="LinearGradient"||Y.type==="RadialGradient"||Y.type==="Linear"||Y.type==="Radial"){const iA="exode-fill",V=this.normalizeOpacity(Y.opacity??100),$=(Y.stops||[]).map(EA=>{const v=EA.offset!==void 0?EA.offset:EA.pos??0,aA=this.normalizeOpacity(EA.opacity??100)*V;return`<stop offset="${v*100}%" stop-color="${EA.color||"#000"}" stop-opacity="${aA}"/>`}).join("");let DA="";if(Y.type==="LinearGradient"||Y.type==="Linear"){const EA=(uA,RA)=>Array.isArray(uA)?uA[RA]??(RA===0?0:1):uA&&typeof uA=="object"?uA[RA===0?"x":"y"]??(RA===0?0:1):RA===0?0:1,v=EA(Y.start,0)*100,aA=EA(Y.start,1)*100,yA=EA(Y.end,0)*100,YA=EA(Y.end,1)*100;DA=`<linearGradient id="${iA}" x1="${v}%" y1="${aA}%" x2="${yA}%" y2="${YA}%" gradientUnits="objectBoundingBox">${$}</linearGradient>`}else{const EA=(YA,uA)=>Array.isArray(YA)?YA[uA]??.5:YA&&typeof YA=="object"?YA[uA===0?"x":"y"]??.5:.5,v=EA(Y.center,0)*100,aA=EA(Y.center,1)*100,yA=(Y.radius??.5)*100;DA=`<radialGradient id="${iA}" cx="${v}%" cy="${aA}%" r="${yA}%" gradientUnits="objectBoundingBox">${$}</radialGradient>`}/<defs>/i.test(N)?N=N.replace(/<defs>/i,`<defs>${DA}`):N=N.replace(/<svg([^>]*)>/i,`<svg$1><defs>${DA}</defs>`),N=N.replace(/\bfill\s*=\s*["'][^"']*["']/gi,EA=>/fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test(EA)?EA:`fill="url(#${iA})"`),N=N.replace(/fill\s*:\s*[^;"')]+/gi,EA=>/fill\s*:\s*(none|transparent)/i.test(EA)?EA:`fill:url(#${iA})`)}}const f=(iA,V,$=1)=>{const DA=(iA.stops||[]).map(YA=>{const uA=YA.offset!==void 0?YA.offset:YA.pos??0,RA=this.normalizeOpacity(YA.opacity??100)*$;return`<stop offset="${uA*100}%" stop-color="${YA.color||"#000"}" stop-opacity="${RA}"/>`}).join(""),EA=(YA,uA,RA=.5)=>Array.isArray(YA)?YA[uA]??RA:YA&&typeof YA=="object"?YA[uA===0?"x":"y"]??RA:RA;if(iA.type==="LinearGradient"||iA.type==="Linear"){const YA=EA(iA.start,0,0)*100,uA=EA(iA.start,1,0)*100,RA=EA(iA.end,0,1)*100,$A=EA(iA.end,1,1)*100;return`<linearGradient id="${V}" x1="${YA}%" y1="${uA}%" x2="${RA}%" y2="${$A}%" gradientUnits="objectBoundingBox">${DA}</linearGradient>`}const v=EA(iA.center,0,.5)*100,aA=EA(iA.center,1,.5)*100,yA=(iA.radius??.5)*100;return`<radialGradient id="${V}" cx="${v}%" cy="${aA}%" r="${yA}%" gradientUnits="objectBoundingBox">${DA}</radialGradient>`},p=(iA,V)=>/<defs>/i.test(iA)?iA.replace(/<defs>/i,`<defs>${V}`):iA.replace(/(<svg[^>]*>)/i,`$1<defs>${V}</defs>`);if(R&&R.isEnabled!==!1&&(R.width||0)>0){const iA=R.width||1,V=j?1:this.normalizeOpacity(R.opacity??100),$=j?"#FFFFFF":R.color||(Y==null?void 0:Y.color)||"#000000";let DA="";const EA=R.fill;if(EA&&EA.type){if(EA.type==="Solid")DA=EA.color||R.color||"#000000";else if(EA.type==="LinearGradient"||EA.type==="RadialGradient"||EA.type==="Linear"||EA.type==="Radial"){const RA="exode-stroke";N=p(N,f(EA,RA,V)),DA=`url(#${RA})`}}DA||(DA=$),N.match(/\bstroke\s*=/i)?N=N.replace(/\bstroke\s*=\s*["'][^"']*["']/gi,RA=>/stroke\s*=\s*["']\s*(none|transparent)\s*["']/i.test(RA)?RA:`stroke="${DA}"`):N=N.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi,`<$1 stroke="${DA}"`),N=N.replace(new RegExp(`(?<![a-z-])stroke\\s*:\\s*(?!none|transparent)[^;"')]+`,"gi"),`stroke:${DA}`),N.match(/\bstroke-width\s*=/i)?N=N.replace(/\bstroke-width\s*=\s*["'][^"']*["']/gi,`stroke-width="${iA}"`):N=N.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi,`<$1 stroke-width="${iA}"`),N=N.replace(/stroke-width\s*:\s*[^;"')]+/gi,`stroke-width:${iA}`),N.match(/\bstroke-opacity\s*=/i)?N=N.replace(/\bstroke-opacity\s*=\s*["'][^"']*["']/gi,`stroke-opacity="${V}"`):N=N.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi,`<$1 stroke-opacity="${V}"`),N=N.replace(/stroke-opacity\s*:\s*[^;"')]+/gi,`stroke-opacity:${V}`),R.lineCap&&(N=N.replace(/\bstroke-linecap\s*=\s*["'][^"']*["']/gi,`stroke-linecap="${R.lineCap}"`),N=N.replace(/stroke-linecap\s*:\s*[^;"')]+/gi,`stroke-linecap:${R.lineCap}`)),R.lineJoin&&(N=N.replace(/\bstroke-linejoin\s*=\s*["'][^"']*["']/gi,`stroke-linejoin="${R.lineJoin}"`),N=N.replace(/stroke-linejoin\s*:\s*[^;"')]+/gi,`stroke-linejoin:${R.lineJoin}`));const v=R.trimStart??0,aA=R.trimEnd??1,yA=R.trimOffset??0,YA=R.dashOffset??0,uA=v!==0||aA!==1||yA!==0||YA!==0;if(uA){const RA=Math.max(0,Math.min(1,v)),$A=Math.max(0,Math.min(1,aA));this.frameCount%600===0&&this.debugLog(`SVG Trim - Object: ${I.name||I.id}, Start: ${RA}, End: ${$A}`);let tg=Q.width||i||100,Kg=Q.height||D||100;const xI=m.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);if(xI){const kI=parseFloat(xI[1]),UI=parseFloat(xI[2]);!isNaN(kI)&&!isNaN(UI)&&(tg=kI,Kg=UI)}const yI=(tg+Kg)*2,OI=(yA%1+1)%1,oI=(YA%1+1)%1;let QI="",DI=0;if(RA>=$A)QI=`0 ${yI}`,DI=0;else{const kI=yI*($A-RA),UI=yI-kI;DI=-(yI*(RA+OI+oI)),QI=`${kI} ${UI}`}N.match(/\bstroke-dasharray\s*=/i)?N=N.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi,`stroke-dasharray="${QI}"`):N=N.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi,`<$1 stroke-dasharray="${QI}"`),N=N.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi,`stroke-dasharray:${QI}`),N.match(/\bstroke-dashoffset\s*=/i)?N=N.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi,`stroke-dashoffset="${DI}"`):N=N.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi,`<$1 stroke-dashoffset="${DI}"`),N=N.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi,`stroke-dashoffset:${DI}`)}else if(R.dashArray&&R.dashArray.length>0){const RA=R.dashArray.join(" ");N=N.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi,`stroke-dasharray="${RA}"`),N=N.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi,`stroke-dasharray:${RA}`),R.dashOffset&&(N=N.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi,`stroke-dashoffset="${R.dashOffset}"`),N=N.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi,`stroke-dashoffset:${R.dashOffset}`))}if(!/\bstroke\s*=\s*["']/i.test(m)&&!new RegExp("(?<![a-z-])stroke\\s*:","i").test(m)){let RA="",$A="";if(uA){const yI=Q.width||i||100,OI=Q.height||D||100,oI=(yI+OI)*2,QI=Math.max(0,Math.min(1,v)),DI=Math.max(0,Math.min(1,aA)),kI=(yA%1+1)%1,UI=(YA%1+1)%1;if(QI>=DI)RA=` stroke-dasharray="0 ${oI}"`,$A=' stroke-dashoffset="0"';else{const WQ=oI*(DI-QI),Ci=oI-WQ,Qi=-(oI*(QI+kI+UI));RA=` stroke-dasharray="${WQ} ${Ci}"`,$A=` stroke-dashoffset="${Qi}"`}}else(NA=R.dashArray)!=null&&NA.length&&(RA=` stroke-dasharray="${R.dashArray.join(" ")}"`,R.dashOffset&&($A=` stroke-dashoffset="${R.dashOffset}"`));const tg=R.lineCap?` stroke-linecap="${R.lineCap}"`:"",Kg=R.lineJoin?` stroke-linejoin="${R.lineJoin}"`:"",xI=`stroke="${DA}" stroke-width="${iA}" stroke-opacity="${V}"${tg}${Kg}${RA}${$A}`;N=N.replace(/(<svg[^>]*>)(\s*(?:<defs>[\s\S]*?<\/defs>)?)/i,(yI,OI,oI)=>`${OI}${oI}<g ${xI}>`),N=N.replace(/<\/svg>/i,"</g></svg>")}}else R&&R.isEnabled===!1&&(N=N.replace(/\bstroke\s*=\s*["'][^"']*["']/gi,'stroke="none"'),N=N.replace(new RegExp(`(?<![a-z-])stroke\\s*:\\s*(?!none|transparent)[^;"')]+`,"gi"),"stroke:none"));const oA=new Blob([N],{type:"image/svg+xml"}),UA=URL.createObjectURL(oA);kA.onload=()=>{if(URL.revokeObjectURL(UA),this.frameCount%900===0){const iA=this.imageCache.get(wA);iA&&this.debugLog(`SVG Payload Ready: ${I.name||I.id} (${iA.naturalWidth}x${iA.naturalHeight})`)}},kA.onerror=()=>{URL.revokeObjectURL(UA),this.debugLog(`SVG Error: Failed to load payload for ${I.name||I.id}`)},kA.src=UA,this.imageCache.set(wA,kA)}let BA=null;if(kA.complete&&kA.naturalWidth>0?(BA=kA,this.lastValidSvgImgMap.set(I.id,kA)):BA=this.lastValidSvgImgMap.get(I.id)||null,BA&&BA.complete&&BA.naturalWidth>0){const N=Math.max(1,i),f=Math.max(1,D);if(j&&(Y==null?void 0:Y.type)==="Solid"){this.maskBuffer||(this.maskBuffer=document.createElement("canvas"),this.maskCtx=this.maskBuffer.getContext("2d")),this.maskBuffer.width=N,this.maskBuffer.height=f,this.maskCtx.setTransform(1,0,0,1,0,0),this.maskCtx.globalCompositeOperation="source-over",this.maskCtx.globalAlpha=1,this.maskCtx.filter="none",this.maskCtx.clearRect(0,0,N,f),this.maskCtx.drawImage(BA,0,0,N,f),this.maskCtx.globalCompositeOperation="source-in";const p=Y.color||"#000000",oA=this.normalizeOpacity(Y.opacity??100);this.maskCtx.fillStyle=p,this.maskCtx.globalAlpha=oA,this.maskCtx.fillRect(0,0,N,f),A.drawImage(this.maskBuffer,-N/2,-f/2,N,f)}else s!==0?(A.save(),this.drawRoundRect(A,-N/2,-f/2,N,f,s),A.clip(),A.drawImage(BA,-N/2,-f/2,N,f),A.restore()):A.drawImage(BA,-N/2,-f/2,N,f)}}}else if(h.type==="LineGraph")this.renderLineGraph(A,h,i,D);else if(I.type==="Shape"){if(this.applyPath(A,h,i,D,s),A.save(),E.blur&&E.blur.amount>0&&(A.filter=`blur(${E.blur.amount}px)`),E.fill){const m=A.globalAlpha,O=this.createCanvasFill(A,E.fill,i,D);O?A.fillStyle=O:A.fillStyle=typeof E.fill=="string"?E.fill:E.fill.color||"transparent",A.globalAlpha=m*this.normalizeOpacity(E.fill.opacity??100),this.applyPath(A,h,i,D,s),A.fill(),A.globalAlpha=m}A.restore(),E.stroke&&E.stroke.width>0&&this.applyStrokeAlignment(A,E,h,i,D,s)}else if(I.type==="Frame"||I.type==="Group"&&!I.isStructuralGroup){const m=g.width??Q.width??I.width??i,O=g.height??Q.height??I.height??D,Y=s;if(A.save(),A.beginPath(),this.drawRoundRect(A,-m/2,-O/2,m,O,Y),E.fill&&E.fill.type!=="None"){const R=A.globalAlpha,x=this.createCanvasFill(A,E.fill,m,O);A.fillStyle=x||E.fill.color||"transparent",A.globalAlpha=R*this.normalizeOpacity(E.fill.opacity??100),A.fill(),A.globalAlpha=R}if(A.restore(),E.stroke&&E.stroke.width>0&&E.stroke.isEnabled!==!1){const R={type:"Rectangle"};this.applyStrokeAlignment(A,E,R,m,O,Y)}}else I.type==="Group"&&I.isStructuralGroup||(I.type==="Component"&&I.variant==="inputbox"?this.renderInputBox(A,I):I.type==="Component"&&I.variant==="button"?this.renderButton(A,I):I.type==="Component"&&I.variant==="toggle_button"?this.renderToggleButton(A,I):I.type==="Toggle"||I.type==="Component"&&I.variant==="toggle"?this.renderToggle(A,I):I.type==="Slider"||I.type==="Component"&&I.variant==="slider"?this.renderSlider(A,I):I.type==="Dropdown"||I.type==="Component"&&I.variant==="dropdown"?this.renderDropdown(A,I):(I.type==="ListView"||I.type==="Component"&&I.variant==="listview")&&this.renderListView(A,I));if(gA&&A.restore(),b&&b.enabled&&A.restore(),I.children&&I.children.length>0){const O=I.type==="Frame",Y=I.clipsContent!==void 0?I.clipsContent:I.clipContent!==void 0?I.clipContent:O;if(A.save(),Y){A.beginPath();const x=g.width??(Q==null?void 0:Q.width)??I.width??0,j=g.height??(Q==null?void 0:Q.height)??I.height??0,GA=g.cornerRadius??(Q==null?void 0:Q.corner_radius)??I.cornerRadius??0;this.drawRoundRect(A,-x/2,-j/2,x,j,GA),A.clip()}let R=0;for(I.children.forEach(x=>{const j=C.get(x);if(!j)return;const GA=this.objectStates.get(x),CA=(GA==null?void 0:GA.geometry)||j.geometry;if(CA&&CA.isMask&&(GA==null?void 0:GA.visible)!==!1){const wA=CA.width||0,kA=CA.height||0;this.applyObjectTransform(A,x);const BA=(GA==null?void 0:GA.corner_radius)??(CA==null?void 0:CA.corner_radius)??0;this.applyPath(A,CA,wA,kA,BA),A.clip(),R++}else this.renderObject(A,j,C)});R>0;)A.restore(),R--;A.restore()}if(L){this.maskCtx.restore(),(g.masks||(I.maskedBy?[{maskId:I.maskedBy,inverted:I.maskInverted===!0,type:I.maskType||"alpha",opacity:I.maskOpacity!==void 0?I.maskOpacity/100:1,feather:I.maskFeather||0,isVisible:!0}]:[])).filter(R=>R.isVisible!==!1&&C.has(R.maskId)).forEach(R=>{const x=C.get(R.maskId),j=this.objectStates.get(x.id),GA=R.feather||0,CA=R.inverted===!0,wA=R.opacity!==void 0?typeof R.opacity=="number"?R.opacity:R.opacity/100:1;if((R.type||"alpha")==="luma"){(!this.lumaBuffer||this.lumaBuffer.width!==this.maskBuffer.width||this.lumaBuffer.height!==this.maskBuffer.height)&&(this.lumaBuffer=document.createElement("canvas"),this.lumaBuffer.width=this.maskBuffer.width,this.lumaBuffer.height=this.maskBuffer.height,this.lumaCtx=this.lumaBuffer.getContext("2d",{willReadFrequently:!0}),this.lumaCtx&&(this.lumaCtx.imageSmoothingEnabled=!0,this.lumaCtx.imageSmoothingQuality="high")),this.lumaCtx.setTransform(1,0,0,1,0,0),this.lumaCtx.globalCompositeOperation="source-over",this.lumaCtx.globalAlpha=1,this.lumaCtx.filter="none",this.lumaCtx.clearRect(0,0,this.lumaBuffer.width,this.lumaBuffer.height),this.lumaCtx.save(),this.rootTransform&&this.lumaCtx.setTransform(this.rootTransform),this.applyAbsoluteTransform(this.lumaCtx,x.id,C),GA>0&&(this.lumaCtx.filter=`blur(${GA}px)`),this.lumaCtx.globalAlpha=wA;const BA=(j==null?void 0:j.width)||x.geometry.width||0,N=(j==null?void 0:j.height)||x.geometry.height||0,f=(j==null?void 0:j.corner_radius)??x.corner_radius??0;if(x.geometry.type==="Text"){const iA=j!=null&&j.geometry?this.deepMerge(x.geometry,j.geometry):x.geometry,V=j!=null&&j.style?this.deepMerge(x.style,j.style):x.style;this._renderText(this.lumaCtx,x,{...iA,width:BA,height:N,corner_radius:f},V,j,BA,N,!0)}else if(x.geometry.type==="Image"){const iA=x.geometry.src;if(iA){let V=this.imageCache.get(iA);V||(V=new Image,V.src=iA,this.imageCache.set(iA,V)),V.complete&&V.naturalWidth>0?this.lumaCtx.drawImage(V,-BA/2,-N/2,BA,N):(this.applyPath(this.lumaCtx,x.geometry,BA,N,f),this.lumaCtx.fillStyle="#ffffff",this.lumaCtx.fill())}}else if(x.geometry.type==="SVG"){const iA=x.geometry.svgContent;if(iA){const V=`__lumamask_${x.id}`;let $=this.imageCache.get(V);if(!$){$=new Image;const DA=new Blob([iA],{type:"image/svg+xml"});$.src=URL.createObjectURL(DA),$.onload=()=>{this.artboard&&this.reset()},this.imageCache.set(V,$)}$.complete&&$.naturalWidth>0?this.lumaCtx.drawImage($,-BA/2,-N/2,BA,N):(this.applyPath(this.lumaCtx,x.geometry,BA,N,f),this.lumaCtx.fillStyle="#ffffff",this.lumaCtx.fill())}}else this.applyPath(this.lumaCtx,x.geometry,BA,N,f),this.lumaCtx.fillStyle="#ffffff",this.lumaCtx.fill();this.lumaCtx.restore();const p=this.maskCtx.getImageData(0,0,this.canvasWidth,this.canvasHeight),oA=this.lumaCtx.getImageData(0,0,this.canvasWidth,this.canvasHeight).data,UA=p.data;for(let iA=0;iA<UA.length;iA+=4){const V=oA[iA],$=oA[iA+1],DA=oA[iA+2];let EA=(.299*V+.587*$+.114*DA)/255;CA&&(EA=1-EA),UA[iA+3]*=EA}this.maskCtx.putImageData(p,0,0)}else{this.maskCtx.save(),this.rootTransform&&this.maskCtx.setTransform(this.rootTransform),this.maskCtx.globalCompositeOperation=CA?"destination-out":"destination-in",GA>0&&(this.maskCtx.filter=`blur(${GA}px)`),this.maskCtx.globalAlpha=wA,this.applyAbsoluteTransform(this.maskCtx,x.id,C);const BA=(j==null?void 0:j.width)||x.geometry.width||0,N=(j==null?void 0:j.height)||x.geometry.height||0,f=(j==null?void 0:j.corner_radius)??x.corner_radius??0;if(x.geometry.type==="Text"){const p=j!=null&&j.geometry?this.deepMerge(x.geometry,j.geometry):x.geometry,oA=j!=null&&j.style?this.deepMerge(x.style,j.style):x.style;this._renderText(this.maskCtx,x,{...p,width:BA,height:N,corner_radius:f},oA,j,BA,N,!0)}else if(x.geometry.type==="Image"){const p=x.geometry.src;if(p){let oA=this.imageCache.get(p);oA||(oA=new Image,oA.src=p,this.imageCache.set(p,oA)),oA.complete&&oA.naturalWidth>0?this.maskCtx.drawImage(oA,-BA/2,-N/2,BA,N):(this.applyPath(this.maskCtx,x.geometry,BA,N,f),this.maskCtx.fillStyle="#ffffff",this.maskCtx.fill())}}else if(x.geometry.type==="SVG"){const p=x.geometry.svgContent;if(p){const oA=`__alphamask_${x.id}`;let UA=this.imageCache.get(oA);if(!UA){UA=new Image;const iA=new Blob([p],{type:"image/svg+xml"});UA.src=URL.createObjectURL(iA),UA.onload=()=>{this.artboard&&this.reset()},this.imageCache.set(oA,UA)}UA.complete&&UA.naturalWidth>0?this.maskCtx.drawImage(UA,-BA/2,-N/2,BA,N):(this.applyPath(this.maskCtx,x.geometry,BA,N,f),this.maskCtx.fillStyle="#ffffff",this.maskCtx.fill())}}else this.applyPath(this.maskCtx,x.geometry,BA,N,f),this.maskCtx.fillStyle="#ffffff",this.maskCtx.fill();this.maskCtx.restore()}}),H.save(),H.setTransform(1,0,0,1,0,0);const Y=I.maskBlendMode||I.blendMode;Y&&Y!=="Normal"&&(H.globalCompositeOperation=Y.toLowerCase()),H.drawImage(this.maskBuffer,0,0),H.restore(),H.restore()}else A.restore()}_renderText(A,I,C,g,Q,E,i,D=!1,o=!1){var l;let s=C.text||"";if(C.textInputId&&!D){const r=this.inputs.get(C.textInputId);r!==void 0&&(s=String(r),Q.geometry&&Q.geometry.type==="Text"&&(Q.geometry.text=s))}let h=s||"";if(C.segments&&Array.isArray(C.segments)){const r=C.segments.map(z=>z&&z.text?z.text:"").join("");r!==h&&r.toUpperCase()===(s||"").toUpperCase()?h=s||"":h=r}let a=((l=C.fontWeight)==null?void 0:l.toString())||"400",G="normal";a.toLowerCase().includes("italic")&&(G="italic",a=a.replace(/italic/gi,"").trim()||"400");const t=this.mapFontWeight(a),K=Math.max(1,C.fontSize||16);let S=C.fontFamily||"Inter";const y=["Bold","SemiBold","Medium","Regular","Light","Thin","ExtraBold","Black","Italic"];y.forEach(r=>{const z=new RegExp(`[\\s-]${r}$`,"i");z.test(S)&&(S=S.replace(z,"").trim())}),A.font=`${G} ${t} ${K}px "${S}", sans-serif`;const F=C.textVerticalAlign||"top";A.textBaseline="top";const e=C.textAlign||"left";A.textAlign=e;const M=C.letterSpacing||0,n=C.paragraphSpacing||0,X=(C.lineHeight||1.2)*K,Z=Math.ceil(C.width||E||200)+.5,H=`${G} ${t} ${K}px "${S}", sans-serif`,QA=r=>{if(M===0)return A.measureText(r).width;let z=0;for(let d=0;d<r.length;d++)z+=A.measureText(r[d]).width+M;return z-M},L=`${h}|${H}|${M}|${n}`;let U=this.pretextCache.get(L);if(!U&&(U=SE(h,H),this.pretextCache.set(L,U),this.pretextCache.size>1e3)){const r=this.pretextCache.keys().next().value;r&&this.pretextCache.delete(r)}const T=U?eE(U,Z,X):{height:0,lines:[]},AA=(T==null?void 0:T.height)??0,IA=(T==null?void 0:T.lines)??[];let b=AA;const P=this.getFontLeadingFactor(C.fontFamily||"Inter"),gA=(X-K)*P;let u=Math.round(-b/2);i>0&&(F==="top"?u=Math.round(-i/2):F==="middle"||F==="center"?u=Math.round(-b/2):F==="bottom"&&(u=Math.round(i/2-b))),u+=gA;const q=(r,z,d,_,hA)=>{var FA,NA,m;const SA=(!D||o)&&(I.behaviors||[]).some(O=>O.enabled&&(O.type.toString().includes("Text")||["Typewriter","Scramble","Wave","Bounce","GlitchText","Reveal3D","RevealSlide","RevealBlur"].includes(O.type)));if(M===0&&!SA&&(C.enableSegments!==!0||!C.segments||C.segments.length===0))_?A.strokeText(r,z,d):A.fillText(r,z,d);else{const O=QA(r);let Y=z;e==="center"?Y-=O/2:e==="right"&&(Y-=O);let R=Y;const x=D&&!o?[]:((FA=I.behaviors)==null?void 0:FA.filter(j=>[W.Typewriter,W.Scramble,W.Wave,W.Bounce,W.GlitchText,W.TextTrail,W.Reveal3D,W.RevealSlide,W.RevealBlur,W.TextLiquid,W.TextVortex,W.TextExplosion,W.TextRain,W.TextGravity,W.TextElastic,W.TextMatrix,W.TextNeon,W.TextGlitch3D,W.TextDissolve,W.TextOrganic,W.TextBreathe,W.TextFloral,W.TextSmoke,W.TextVariable,W.TextMagnet,W.TextSpin,W.TextZing,W.TextPerspective,W.TextMirror].includes(j.type)&&j.enabled))||[];for(let j=0;j<r.length;j++){let GA=r[j];const CA=hA+j;let wA=0,kA=0,BA=1,N=1,f=0,p=1,oA=GA;if(x.forEach(V=>{const $=V.settings||{},DA=$.strength||1,EA=Date.now();if(V.type===W.Typewriter)this.currentTime*($.speed||1)-CA*($.stagger||.05)<0&&(p=0);else if(V.type===W.Scramble)Math.max(0,Math.min(1,this.currentTime/($.duration||1.5))-CA*.02)<1&&Math.random()<.3&&(oA="$%#@!*&"[Math.floor(Math.random()*7)]);else if(V.type===W.Wave)kA+=Math.sin(this.currentTime*5*($.speed||1)+CA*($.frequency||1))*($.amplitude||20)*DA;else if(V.type===W.Bounce){const v=Math.max(0,this.currentTime%2-CA*($.stagger||.1));v<1&&(kA-=Math.abs(Math.sin(v*Math.PI))*($.height||50)*DA)}else if(V.type===W.TextTrail){const v=this.pointerHistory[Math.max(0,this.pointerHistory.length-1-CA*($.delay||5))];v&&(wA+=(v.x-(Q.x+R))*DA*.2,kA+=(v.y-(Q.y+d+kA))*DA*.2)}else if(V.type===W.Reveal3D){const v=Math.max(0,Math.min(1,this.currentTime*($.speed||1)-CA*($.stagger||.1)));BA*=v,N*=v,p=v}else if(V.type===W.RevealSlide){const v=Math.max(0,Math.min(1,this.currentTime*1.5-CA*.05)),aA=(1-v)*($.distance||40)*DA,yA=$.direction||"up";yA==="up"?kA-=aA:yA==="down"?kA+=aA:yA==="left"?wA-=aA:yA==="right"&&(wA+=aA),p=v}else if(V.type===W.RevealBlur){const v=Math.max(0,Math.min(1,this.currentTime*1.2-CA*.1));p=v,wA+=(1-v)*5}else if(V.type===W.TextLiquid){const v=Math.max(0,Math.sin(EA*.001*($.speed||1)+CA*.5));kA+=v*($.amplitude||10)*DA,N*=1+v*.2}else if(V.type===W.TextVortex){const v=EA*.002*($.speed||1)+CA*.2,aA=(1-(Math.sin(EA*.001)*.5+.5))*($.radius||50);wA+=Math.cos(v)*aA*DA,kA+=Math.sin(v)*aA*DA}else if(V.type===W.TextExplosion){const v=$.force||1,aA=this.currentTime%2;if(aA<1){const yA=(CA/r.length-.5)*Math.PI*2,YA=aA*100*v;wA+=Math.cos(yA)*YA*DA,kA+=Math.sin(yA)*YA*DA,p=1-aA}}else if(V.type===W.TextRain){const v=$.speed||1,aA=$.height||100,yA=(EA*.001*v+CA*.1)%1;kA-=(1-yA)*aA*DA,p=yA>.1?1:yA*10}else if(V.type===W.TextGravity){const v=$.gravity||9.8,aA=this.currentTime%3/3,yA=.5*v*Math.pow(aA*10,2);yA<100?kA+=yA*DA:kA+=100*DA}else if(V.type===W.TextMatrix){const v=$.speed||1;if(Math.random()<.1*v){const yA="0123456789ABCDEF!@#$%^&*";oA=yA[Math.floor(Math.random()*yA.length)]}p=.3+(Math.sin(EA*.01*v+CA)+1)/2*.7}else if(V.type===W.TextNeon){const v=Math.random()>.95?.5:1;p=(.7+(Math.sin(EA*.005)+1)/2*.3)*v}else if(V.type===W.TextDissolve)Math.sin(CA*1.5+EA*.002*($.speed||1))>.5&&(p=0);else if(V.type===W.TextOrganic){const v=$.speed||1,aA=$.amplitude||10;wA+=Math.sin(EA*.002*v+CA)*aA*DA,kA+=Math.cos(EA*.0015*v+CA*.7)*aA*DA}else if(V.type===W.TextBreathe){const aA=1+(Math.sin(EA*.003+CA*.2)+1)/2*.2*DA;BA*=aA,N*=aA}else if(V.type===W.TextSpin){const v=$.speed||1;f+=EA*.01*v+CA}else if(V.type===W.TextMagnet){const v=this.pointerHistory[this.pointerHistory.length-1];if(v){const aA=v.x-(Q.x+R),yA=v.y-(Q.y+d);f=Math.atan2(yA,aA)}}else if(V.type===W.TextPerspective){const v=r.length/2,aA=(CA-v)/v,yA=1-Math.abs(aA)*.3*DA;BA*=yA,N*=yA,wA+=aA*20*DA}else if(V.type===W.TextMirror)p*=.8;else if(V.type===W.TextFloral){const v=$.speed||1,aA=$.stagger||.1,yA=(EA*.001*v+CA*aA)%2;yA<1&&(BA*=yA,N*=yA,f+=yA*Math.PI)}else if(V.type===W.TextSmoke){const v=$.speed||1,aA=$.height||50,yA=(EA*5e-4*v+CA*.2)%1;kA-=yA*aA*DA,wA+=Math.sin(EA*.002+CA)*5*DA,p=1-yA}else if(V.type===W.TextVariable){const v=$.speed||1,aA=$.intensity||1.5,yA=(Math.sin(EA*.004*v+CA*.3)+1)/2;BA*=1+yA*(aA-1)*DA}else if(V.type===W.TextZing){const v=$.speed||2,aA=$.distance||100,yA=(EA*.002*v+CA*.05)%1;wA+=(1-yA)*aA*DA,p=yA}else if(V.type===W.TextElastic){const v=$.stiffness||.2,aA=$.damping||.1,yA=Math.sin(EA*.01)*Math.exp(-EA*.001*aA);N*=1+yA*v*DA}else if(V.type===W.TextGlitch3D){const v=$.intensity||5;Math.random()<.2&&(wA+=(Math.random()-.5)*v,kA+=(Math.random()-.5)*v,p=.8)}else if(V.type===W.GlitchText){const v=$.intensity||5;Math.random()<.1&&(wA+=(Math.random()-.5)*v,kA+=(Math.random()-.5)*v,Math.random()<.05&&(p=.5))}}),p<=0){R+=A.measureText(GA).width+M;continue}if(C.enableSegments===!0&&((NA=C.segments)==null?void 0:NA.length)>0){let V=0,$=null;for(const DA of C.segments){if(CA<V+(DA.text||"").length){$=DA;break}V+=(DA.text||"").length}if($){let DA=$.fontFamily||C.fontFamily||"Inter";y.forEach(EA=>{const v=new RegExp(`[\\s-]${EA}$`,"i");v.test(DA)&&(DA=DA.replace(v,"").trim())}),A.font=`${G} ${this.mapFontWeight(($.fontWeight||C.fontWeight||"400").toString())} ${$.fontSize||K}px "${DA}", sans-serif`}}const UA=A.globalAlpha;A.globalAlpha*=p,A.save();const iA=A.measureText(oA).width;if(A.translate(R+wA+iA/2,d+kA),f!==0&&A.rotate(f),A.scale(BA,N),D||o){const V=o?"#000000":this.createCanvasFill(A,g.fill,E,i);A.fillStyle=V||g.fill.color||"#ffffff",A.fillText(oA,-iA/2,0)}else _?A.strokeText(oA,-iA/2,0):A.fillText(oA,-iA/2,0);A.restore(),A.globalAlpha=UA,C.enableSegments===!0&&((m=C.segments)==null?void 0:m.length)>0&&(A.font=`${G} ${this.mapFontWeight((C.fontWeight||"400").toString())} ${K}px "${C.fontFamily||"Inter"}", sans-serif`),R+=A.measureText(GA).width+M}}};if(D){let r=0,z=u;(IA||[]).forEach(d=>{let _=-E/2;e==="center"?_=0:e==="right"&&(_=E/2),q(d.text,_,z,!1,r),r+=(d.text||"").length+1,z+=X})}else if(o){let r=0,z=u;(IA||[]).forEach(d=>{let _=-E/2;e==="center"?_=0:e==="right"&&(_=E/2),q(d.text,_,z,!1,r),r+=(d.text||"").length+1,z+=X})}else{if(g.fill){const r=A.globalAlpha,z=this.createCanvasFill(A,g.fill,E,i);A.fillStyle=z||g.fill.color||"#000000",A.globalAlpha=r*this.normalizeOpacity(g.fill.opacity??100);let d=0,_=u;(IA||[]).forEach(hA=>{let SA=Math.round(-E/2);e==="center"?SA=0:e==="right"&&(SA=Math.round(E/2)),q(hA.text,SA,_,!1,d),d+=(hA.text||"").length+1,_+=X}),A.globalAlpha=r}if(g.stroke&&g.stroke.width>0){const r=A.globalAlpha;g.fill&&g.fill.type!=="None"&&(A.shadowColor="transparent",A.shadowBlur=0,A.shadowOffsetX=0,A.shadowOffsetY=0),A.strokeStyle=g.stroke.color,A.lineWidth=g.stroke.width,A.globalAlpha=r*this.normalizeOpacity(g.stroke.opacity??100);let z=0,d=u;(IA||[]).forEach(_=>{let hA=Math.round(-E/2);e==="center"?hA=0:e==="right"&&(hA=Math.round(E/2)),q(_.text,hA,d,!0,z),z+=(_.text||"").length+1,d+=X}),A.globalAlpha=r}}}applyStrokeAlignment(A,I,C,g,Q,E){if(!I.stroke||I.stroke.width<=0||I.stroke.isEnabled===!1)return;const i=I.stroke,D=i.width,o=(i.alignment||"center").toLowerCase();if(A.save(),I.fill&&I.fill.type!=="None"&&(A.shadowColor="transparent",A.shadowBlur=0,A.shadowOffsetX=0,A.shadowOffsetY=0),i.fill){const S=this.createCanvasFill(A,i.fill,g,Q);S?A.strokeStyle=S:A.strokeStyle=i.color||"#000000"}else A.strokeStyle=i.color||"#000000";const s=A.globalAlpha;A.globalAlpha=s*this.normalizeOpacity(i.opacity??100),A.lineWidth=D,A.lineCap=i.lineCap||"round",A.lineJoin=i.lineJoin||"round",i.miterLimit!==void 0&&(A.miterLimit=i.miterLimit);const h=i.trimStart??0,a=i.trimEnd??1,G=i.trimOffset??0,t=i.dashOffset??0,K=i.dashArray||[];if(h!==0||a!==1||G!==0){const S=this.getPerimeter(C,g,Q);if(S>0){const y=Math.max(0,Math.min(1,h)),F=Math.max(0,Math.min(1,a));if(y<F){const e=S*(F-y),M=S-e,n=-(S*(y+G%1+t%1));A.setLineDash([e,M]),A.lineDashOffset=n}else A.setLineDash([0,S])}}else K.length>0&&(A.setLineDash(K),A.lineDashOffset=t);C.type==="Line"||g===0||Q===0?(this.applyPath(A,C,g,Q,E),A.stroke()):o==="inside"?(A.lineWidth=D*2,A.save(),this.applyPath(A,C,g,Q,E),A.clip(),A.stroke(),A.restore()):o==="outside"?(A.lineWidth=D*2,this.applyPath(A,C,g,Q,E),A.stroke(),A.save(),A.globalCompositeOperation="destination-out",this.applyPath(A,C,g,Q,E),A.fill(),A.restore()):(A.lineWidth=D,this.applyPath(A,C,g,Q,E),A.stroke()),A.restore()}getPerimeter(A,I,C){switch(A.type){case"Rectangle":return(I+C)*2;case"Ellipse":{const g=I/2,Q=C/2,E=Math.abs(A.sweepAngle??360),i=A.ratio||0,D=Math.PI*(3*(g+Q)-Math.sqrt((3*g+Q)*(g+3*Q)));if(E>=360&&i<=0)return D;let o=E/360*D;if(i>0){const s=Math.PI*(3*(g*i+Q*i)-Math.sqrt((3*g*i+Q*i)*(g*i+3*Q*i)));o+=E/360*s,E<360&&(o+=2*Math.sqrt((g-g*i)**2+(Q-Q*i)**2))}else E<360&&(o+=g+Q);return o}case"Line":return A.length||Math.sqrt(I*I+C*C);case"Triangle":return I+Math.sqrt((I/2)**2+C**2)*2;case"Polygon":{const g=A.sides||3,Q=A.radius||Math.min(I,C)/2;return 2*g*Q*Math.sin(Math.PI/g)}case"Star":{const g=A.points||5,Q=A.outer_radius||Math.min(I,C)/2,E=A.inner_radius||Q/2,i=Math.PI/g;return Math.sqrt(Q*Q+E*E-2*Q*E*Math.cos(i))*g*2}case"Path":{const g=A.points||[];if(g.length<2)return A.length||0;let Q=0;for(let E=1;E<g.length;E++){const i=g[E-1],D=g[E];if(i.out_x!==void 0||D.in_x!==void 0)Q+=this.getBezierLength(i.x,i.y,i.out_x??i.x,i.out_y??i.y,D.in_x??D.x,D.in_y??D.y,D.x,D.y);else{const o=D.x-i.x,s=D.y-i.y;Q+=Math.sqrt(o*o+s*s)}}if(A.is_closed){const E=g[g.length-1],i=g[0];if(E.out_x!==void 0||i.in_x!==void 0)Q+=this.getBezierLength(E.x,E.y,E.out_x??E.x,E.out_y??E.y,i.in_x??i.x,i.in_y??i.y,i.x,i.y);else{const D=i.x-E.x,o=i.y-E.y;Q+=Math.sqrt(D*D+o*o)}}return Q}default:return(I+C)*2}}getBezierLength(A,I,C,g,Q,E,i,D,o=10){let s=0,h=A,a=I;for(let G=1;G<=o;G++){const t=G/o,K=1-t,S=t*t,y=K*K,F=y*K,e=S*t,M=F*A+3*y*t*C+3*K*S*Q+e*i,n=F*I+3*y*t*g+3*K*S*E+e*D,X=M-h,Z=n-a;s+=Math.sqrt(X*X+Z*Z),h=M,a=n}return s}getPointOnPath(A,I,C,g){if(A.type==="Path"){const Q=A.points||[];if(Q.length<2)return{x:0,y:0,angle:0};let E=1/0,i=-1/0,D=1/0,o=-1/0;Q.forEach(S=>{E=Math.min(E,S.x),i=Math.max(i,S.x),D=Math.min(D,S.y),o=Math.max(o,S.y)});const s=(E+i)/2,h=(D+o)/2,G=this.getPerimeter(A,I,C)*g;let t=0;const K=[];for(let S=1;S<Q.length;S++)K.push({p0:Q[S-1],p1:Q[S]});A.is_closed&&K.push({p0:Q[Q.length-1],p1:Q[0]});for(const S of K){const y=S.p0,F=S.p1;let e=0;const M=y.out_x!==void 0||F.in_x!==void 0;if(M?e=this.getBezierLength(y.x,y.y,y.out_x??y.x,y.out_y??y.y,F.in_x??F.x,F.in_y??F.y,F.x,F.y):e=Math.sqrt((F.x-y.x)**2+(F.y-y.y)**2),t+e>=G||S===K[K.length-1]){const n=e===0?0:(G-t)/e;if(M)return this.getBezierPointAndAngle(n,y,F,s,h);{const X=y.x+(F.x-y.x)*n-s,Z=y.y+(F.y-y.y)*n-h,H=Math.atan2(F.y-y.y,F.x-y.x);return{x:X,y:Z,angle:H}}}t+=e}}return{x:0,y:0,angle:0}}getBezierPointAndAngle(A,I,C,g,Q){const E=I.x,i=I.y,D=I.out_x??I.x,o=I.out_y??I.y,s=C.in_x??C.x,h=C.in_y??C.y,a=C.x,G=C.y,t=1-A,K=A*A,S=t*t,y=S*t,F=K*A,e=y*E+3*S*A*D+3*t*K*s+F*a-g,M=y*i+3*S*A*o+3*t*K*h+F*G-Q,n=3*S*(D-E)+6*t*A*(s-D)+3*K*(a-s),X=3*S*(o-i)+6*t*A*(h-o)+3*K*(G-h),Z=Math.atan2(X,n);return{x:e,y:M,angle:Z}}applyAbsoluteTransform(A,I,C){if(!C.get(I))return;const Q=[];let E=I;for(;E;){Q.unshift(E);const i=C.get(E);E=i==null?void 0:i.parentId}Q.forEach(i=>{this.applyObjectTransform(A,i)})}applyObjectTransform(A,I){const C=this.objectStates.get(I);if(!C)return;A.translate(C.x,C.y),A.rotate(C.rotation*Math.PI/180);const g=(C.scale_x??1)*(C.flip_x===!0?-1:1),Q=(C.scale_y??1)*(C.flip_y===!0?-1:1);A.scale(g,Q)}applyPath(A,I,C,g,Q){A.beginPath(),this._tracePath(A,I,C,g,Q)}_tracePath(A,I,C,g,Q){if(I.type==="Rectangle"||I.type==="Image"){const E=Q!==void 0?Q:I.corner_radius??0;this.drawRoundRect(A,-C/2,-g/2,C,g,E)}else if(I.type==="Line")A.moveTo(-C/2,0),A.lineTo(C/2,0);else if(I.type==="Ellipse"){const{startAngle:E=0,sweepAngle:i=360,ratio:D=0}=I,o=C/2,s=g/2,h=E*Math.PI/180,a=i*Math.PI/180,G=h+a;i>=360&&D<=0?A.ellipse(0,0,o,s,0,0,Math.PI*2):(A.ellipse(0,0,o,s,0,h,G,!1),D>0?A.ellipse(0,0,o*D,s*D,0,G,h,!0):A.lineTo(0,0),A.closePath())}else if(I.type==="Triangle")A.moveTo(0,-g/2),A.lineTo(C/2,g/2),A.lineTo(-C/2,g/2),A.closePath();else if(I.type==="Polygon"){const E=I.sides||3,i=I.radius||Math.min(C,g)/2;for(let D=0;D<E;D++){const o=D*2*Math.PI/E-Math.PI/2,s=i*Math.cos(o),h=i*Math.sin(o);D===0?A.moveTo(s,h):A.lineTo(s,h)}A.closePath()}else if(I.type==="Star"){const E=I.inner_radius||20,i=I.outer_radius||50,D=I.points||5;for(let o=0;o<D*2;o++){const s=o*Math.PI/D-Math.PI/2,h=o%2===0?i:E,a=h*Math.cos(s),G=h*Math.sin(s);o===0?A.moveTo(a,G):A.lineTo(a,G)}A.closePath()}else if((I.type==="Path"||I.type==="Subtract"||I.type==="Union"||I.type==="Intersect"||I.type==="Exclude"||I.type==="BooleanOperation")&&I.points){let E=1/0,i=-1/0,D=1/0,o=-1/0;I.points.forEach(a=>{E=Math.min(E,a.x),i=Math.max(i,a.x),D=Math.min(D,a.y),o=Math.max(o,a.y)});const s=(E+i)/2,h=(D+o)/2;I.points.forEach((a,G)=>{if(G===0)A.moveTo(a.x-s,a.y-h);else{const t=I.points[G-1],K=(t.out_x??t.x)-s,S=(t.out_y??t.y)-h,y=(a.in_x??a.x)-s,F=(a.in_y??a.y)-h;A.bezierCurveTo(K,S,y,F,a.x-s,a.y-h)}}),I.is_closed&&A.closePath()}else if(I.points&&Array.isArray(I.points)){let E=1/0,i=-1/0,D=1/0,o=-1/0;I.points.forEach(a=>{E=Math.min(E,a.x),i=Math.max(i,a.x),D=Math.min(D,a.y),o=Math.max(o,a.y)});const s=(E+i)/2,h=(D+o)/2;I.points.forEach((a,G)=>{if(G===0)A.moveTo(a.x-s,a.y-h);else{const t=I.points[G-1];t.out_x!==void 0||a.in_x!==void 0?A.bezierCurveTo((t.out_x??t.x)-s,(t.out_y??t.y)-h,(a.in_x??a.x)-s,(a.in_y??a.y)-h,a.x-s,a.y-h):A.lineTo(a.x-s,a.y-h)}}),I.is_closed&&A.closePath()}}renderInputBox(A,I){var SA,FA;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((SA=I.geometry)==null?void 0:SA.width)||250,E=((FA=I.geometry)==null?void 0:FA.height)||45,i=this.focusedId===I.id,D=this.lastHoveredObjectId===I.id,o=g.previewState||"default",s=o!=="default"?o:i?"focused":D?"hovered":"default",h=g.label||{visible:!0,text:"Label"},a=g.helperText||{visible:!1,text:"Helper text"},G=g.leftIcon||{visible:!1},t=g.rightIcon||{visible:!1},K=g.multiline===!0,S=g.corner_radius??8,y=g.corners||{tl:S,tr:S,bl:S,br:S},F=[y.tl,y.tr,y.br,y.bl];let e=g.backgroundColor||"rgba(31, 41, 55, 1)",M=g.borderColor||"rgba(55, 65, 81, 1)",n=g.borderWidth??1.5,X=g.color||"#ffffff",Z=g.placeholderColor||"rgba(156, 163, 175, 1)",H=g.fontSize||14;const QA=`${s}Style`,L=g[QA];if(L?(L.backgroundColor!==void 0&&(e=L.backgroundColor),L.borderColor!==void 0&&(M=L.borderColor),L.borderWidth!==void 0&&(n=L.borderWidth),L.color!==void 0&&(X=L.color),L.placeholderColor!==void 0&&(Z=L.placeholderColor),L.fontSize!==void 0&&(H=L.fontSize)):s==="focused"?(M=g.focusBorderColor||"rgba(59, 130, 246, 1)",n=Math.max(n,2)):s==="hovered"||s==="hover"?(M=g.hoverBorderColor||M,e=g.hoverBackgroundColor||e):s==="disabled"?(e=g.disabledBackgroundColor||"rgba(31, 41, 55, 0.6)",M=g.disabledBorderColor||"rgba(55, 65, 81, 0.4)"):s==="error"&&(M="rgba(239, 68, 68, 1)",n=Math.max(n,2)),A.beginPath(),this.drawRoundRect(A,-Q/2,-E/2,Q,E,F),A.fillStyle=e,A.fill(),n>0&&(A.strokeStyle=M,A.lineWidth=n,A.stroke(),s==="focused"||s==="focus")){A.save(),A.beginPath();const NA=F.map(m=>m+2);this.drawRoundRect(A,-Q/2-2,-E/2-2,Q+4,E+4,NA),A.strokeStyle="rgba(59, 130, 246, 0.3)",A.lineWidth=2,A.stroke(),A.restore()}const U=(NA,m)=>{if(!NA.visible||!NA.svgPath)return;const O=NA.size||14,Y=NA.offset??16,R=NA.color||"#ffffff",x=m?-(Q/2)+Y:Q/2-Y,j=NA.svgPath;if(A.save(),A.translate(x,0),!j.startsWith("<svg")){const GA=new Path2D(j),CA=O/24;A.scale(CA,CA),A.translate(-12,-12),A.fillStyle=R,A.fill(GA)}A.restore()};U(G,!0),U(t,!1);const T=g.text||"",AA=g.placeholder||"Enter text...",IA=!T,b=T||AA,P=IA?Z:X,gA=H,u=g.fontFamily||"Inter",q=g.fontWeight||400;A.font=`${q} ${gA}px "${u}", sans-serif`,A.fillStyle=P,A.textAlign="left",A.textBaseline=K?"top":"middle";const l=g.inputPadding??16,r=G.visible?(G.offset??16)+(G.size||14)/2+8:l,z=t.visible?(t.offset??16)+(t.size||14)/2+8:l,d=-(Q/2)+r,_=Q-r-z,hA=g.inputType==="password"?"•".repeat(b.length):b;if(A.save(),A.beginPath(),A.rect(d-2,-E/2+4,_+4,E-8),A.clip(),K){const NA=hA.split(`
22
- `);let m=-E/2+l;const O=gA*1.2;let Y=0;NA.forEach((R,x)=>{const j=R.split(" ");let GA="";for(let CA=0;CA<j.length;CA++){const wA=GA+j[CA]+" ";A.measureText(wA).width>_&&CA>0?(A.fillText(GA,d,m),GA=j[CA]+" ",m+=O):GA=wA}A.fillText(GA,d,m),Y=A.measureText(GA).width,x<NA.length-1&&(m+=O,Y=0)}),i&&!IA&&Math.floor(performance.now()/500)%2===0&&A.fillRect(d+Y,m,1.5,gA)}else{const m=A.measureText(hA).width;let O=0;if(m>_&&(O=m-_),A.fillText(hA,d-O,0),i&&!IA&&Math.floor(performance.now()/500)%2===0){const R=d+m-O;A.fillRect(R,-(gA/2),1.5,gA)}}if(A.restore(),h.visible!==!1){const NA=h.text||"Label",m=h.fontSize||12,O=h.color||"rgba(156, 163, 175, 1)",Y=h.offset??8;A.font=`600 ${m}px "${u}", sans-serif`,A.fillStyle=O,A.textAlign="left",A.textBaseline="bottom";const R=-(Q/2),x=-(E/2)-Y;A.fillText(NA,R,x)}if(a.visible===!0){const NA=a.text||"Helper text",m=a.fontSize||11,O=s==="error"?"rgba(239, 68, 68, 1)":a.color||"rgba(156, 163, 175, 1)",Y=a.offset??6;A.font=`400 ${m}px "${u}", sans-serif`,A.fillStyle=O,A.textAlign="left",A.textBaseline="top";const R=-(Q/2),x=E/2+Y;A.fillText(NA,R,x)}}renderSlider(A,I){const C=this.objectStates.get(I.id),g=(C==null?void 0:C.geometry)||I.geometry,Q=(C==null?void 0:C.options)||I.options||{},E=g.width||200,i=Q.value??50,D=Q.min??0,s=(Q.max??100)-D,h=s===0?0:(i-D)/s,a=Q.trackHeight||4,G=Q.trackRoundedness??2,t=Q.trackShape??"Rectangle",K=Q.trackPath||"",S=Q.activeColor||"#3b82f6",y=Q.inactiveColor||"#374151",F=Q.thumbShape||"Ellipse",e=Q.thumbWidth??16,M=Q.thumbHeight??16,n=Q.thumbRoundedness??0,X=Q.thumbColor||"#ffffff",Z=Q.thumbPath||"",H=Q.thumbIcon||"",QA=Q.showValueTooltip??!1,L=Q.tooltipBgColor||"#333333",U=Q.tooltipColor||"#ffffff",T=Q.tooltipOffsetX??0,AA=Q.tooltipOffsetY??-25,IA=(d,_,hA,SA,FA,NA,m)=>{if((d==="Custom"||d==="Icon")&&m)try{const O=new Path2D(m);if(A.save(),A.translate(_,hA),d==="Icon"){const Y=Math.min(SA,FA)/24;A.scale(Y,Y),A.translate(-12,-12)}A.fill(O),A.restore();return}catch(O){console.error("Error drawing slider shape in engine:",O)}if(A.beginPath(),d==="Ellipse")A.ellipse(_,hA,SA/2,FA/2,0,0,Math.PI*2);else if(d==="Rectangle")this.drawRoundRect(A,_-SA/2,hA-FA/2,SA,FA,NA);else if(d==="Triangle")A.moveTo(_,hA-FA/2),A.lineTo(_+SA/2,hA+FA/2),A.lineTo(_-SA/2,hA+FA/2),A.closePath();else if(d==="Diamond")A.moveTo(_,hA-FA/2),A.lineTo(_+SA/2,hA),A.lineTo(_,hA+FA/2),A.lineTo(_-SA/2,hA),A.closePath();else if(d==="Polygon"){const O=I.geometry.sides||3,Y=I.geometry.radius||Math.min(SA,FA)/2;for(let R=0;R<O;R++){const x=R*2*Math.PI/O-Math.PI/2,j=_+Y*Math.cos(x),GA=hA+Y*Math.sin(x);R===0?A.moveTo(j,GA):A.lineTo(j,GA)}A.closePath()}else if(d==="Star"){const Y=Math.min(SA,FA)/2,R=Y/2;for(let x=0;x<5*2;x++){const j=x%2===0?Y:R,GA=x*Math.PI/5-Math.PI/2;A.lineTo(_+j*Math.cos(GA),hA+j*Math.sin(GA))}A.closePath()}else d==="Line"&&(A.moveTo(_-SA/2,hA),A.lineTo(_+SA/2,hA));A.fill()};A.fillStyle=y,t==="Line"?(A.strokeStyle=y,A.lineWidth=a,A.beginPath(),A.moveTo(-E/2,0),A.lineTo(E/2,0),A.stroke()):IA(t,0,0,E,a,G,K);const b=E-e,P=-E/2+e/2+h*b,gA=P- -E/2;gA>0&&(A.fillStyle=S,t==="Line"?(A.strokeStyle=S,A.lineWidth=a,A.beginPath(),A.moveTo(-E/2,0),A.lineTo(P,0),A.stroke()):t==="Rectangle"&&(A.beginPath(),this.drawRoundRect(A,-E/2,-a/2,gA,a,G),A.fill())),A.save(),A.translate(P,0);const u=A.getTransform(),q=Math.sqrt(u.a*u.a+u.b*u.b)||1;if(A.shadowColor="rgba(0,0,0,0.2)",A.shadowBlur=4*q,A.shadowOffsetY=1*q,A.fillStyle=X,IA(F,0,0,e,M,n,F==="Icon"?H:Z),A.restore(),QA){A.save(),A.translate(P+T,AA);const d=Math.round(i).toString();A.font="10px Inter, sans-serif";const _=A.measureText(d),hA=6,SA=4,FA=_.width+hA*2,NA=14+SA;A.beginPath(),this.drawRoundRect(A,-FA/2,-NA/2,FA,NA,4),A.fillStyle=L,A.fill(),A.fillStyle=U,A.textAlign="center",A.textBaseline="middle",A.fillText(d,0,0),A.restore()}const l=Q.label||{},r=Q.helperText||{},z=Q.fontFamily||"Inter";if(l.visible!==!1){const d=l.text||"Label",_=l.fontSize||12,hA=l.color||"rgba(156, 163, 175, 1)",SA=l.offset??8;A.font=`600 ${_}px "${z}", sans-serif`,A.fillStyle=hA,A.textAlign="left",A.textBaseline="bottom";const FA=-(E/2),NA=-(a/2)-SA;A.fillText(d,FA,NA)}if(r.visible===!0){const d=r.text||"Helper text",_=r.fontSize||11,hA=r.color||"rgba(156, 163, 175, 1)",SA=r.offset??6;A.font=`400 ${_}px "${z}", sans-serif`,A.fillStyle=hA,A.textAlign="left",A.textBaseline="top";const FA=-(E/2),NA=a/2+SA;A.fillText(d,FA,NA)}}renderDropdown(A,I){var AA;const C=this.objectStates.get(I.id);if(!C)return;const g=C.options||I.options||{},Q=I.geometry.width||160,E=I.geometry.height||40,i=-Q/2,D=-E/2,o=g.corner_radius??6,s=g.disabled||g.previewState==="disabled",h=this.lastHoveredObjectId===I.id||g.previewState==="hover",a=(g.isOpen||g.previewState==="active")&&!s;let G=g.backgroundColor,t=g.borderColor,K=g.color||"#333333";s?(G=g.disabledBackgroundColor||"#f3f4f6",t=g.disabledBorderColor||"#e5e7eb",K=g.disabledColor||"#9ca3af"):a?(G=g.activeBackgroundColor||G,t=g.activeBorderColor||t,K=g.activeColor||K):h&&(G=g.hoverBackgroundColor||G,t=g.hoverBorderColor||t,K=g.hoverColor||K),G||(G="#ffffff"),t||(t="#e5e7eb");const S=A.globalAlpha;A.globalAlpha=S*(g.opacity??1),this.drawRoundRect(A,i,D,Q,E,o),A.fillStyle=this.createCanvasFill(A,typeof G=="string"?{type:"Solid",color:G}:G,Q,E)||"#ffffff",A.fill();const y=g.borderWidth??1;y>0&&(A.strokeStyle=this.createCanvasFill(A,typeof t=="string"?{type:"Solid",color:t}:t,Q,E)||"#e5e7eb",A.lineWidth=y,A.stroke());const F=12,e=g.chevronType||"chevron",M=g.chevronSize||16,n=(a?g.openIconColor:g.closedIconColor)||g.chevronColor||"#6b7280";if(e!=="none"){const IA=i+Q-F-M/2;A.save(),A.translate(IA,0);const b=a?g.openIconAngle??180:g.closedIconAngle??0;if(A.rotate(b*Math.PI/180),A.strokeStyle=n,A.fillStyle=n,A.lineWidth=1.5,A.lineCap="round",A.lineJoin="round",e==="chevron")A.beginPath(),A.moveTo(-M/2,-M*.2),A.lineTo(0,M*.2),A.lineTo(M/2,-M*.2),A.stroke();else if(e==="custom"||e==="path"){const P=a&&g.openIconPath||g.closedIconPath;if(P){const gA=new Path2D(P);A.save();const u=M/24;A.scale(u,u),A.translate(-12,-12),A.fill(gA),A.restore()}}A.restore()}const X=g.selectedOption||g.placeholder||"Select...",Z=g.fontSize||14,H=g.fontWeight||400,QA=g.fontFamily||"Inter, sans-serif";A.font=`${H} ${Z}px ${QA}`;const L=s?g.disabledColor||"#9ca3af":!g.selectedOption&&g.placeholder?"#9ca3af":K;A.fillStyle=this.createCanvasFill(A,typeof L=="string"?{type:"Solid",color:L}:L,Q,E)||"#333333",A.textAlign="left",A.textBaseline="middle";const U=e==="none"?0:M+8,T=Q-F*2-U;if(A.save(),A.beginPath(),A.rect(i+F,D,T,E),A.clip(),A.fillText(X,i+F,0),A.restore(),a&&!s){const IA=D+E+4,b=g.optionsList||[],P=g.itemHeight||32,gA=g.listPadding??4,u=b.length*P+gA*2,q=g.listCornerRadius??o;A.save();const l=g.listShadow||{},r=A.getTransform(),z=Math.sqrt(r.a*r.a+r.b*r.b)||1;A.shadowColor=typeof l.color=="string"?l.color:((AA=l.color)==null?void 0:AA.color)||"rgba(0,0,0,0.15)",A.shadowBlur=(l.blur??12)*z,A.shadowOffsetY=(l.offsetY??6)*z,A.shadowOffsetX=(l.offsetX??0)*z,A.beginPath(),this.drawRoundRect(A,i,IA,Q,u,q),A.fillStyle=this.createCanvasFill(A,typeof g.listBackgroundColor=="string"?{type:"Solid",color:g.listBackgroundColor}:g.listBackgroundColor||{type:"Solid",color:"#ffffff"},Q,u)||"#ffffff",A.fill();const d=g.listBorderWidth??1;d>0&&(A.shadowColor="transparent",A.strokeStyle=this.createCanvasFill(A,typeof g.listBorderColor=="string"?{type:"Solid",color:g.listBorderColor}:g.listBorderColor||{type:"Solid",color:t},Q,u)||"#e5e7eb",A.lineWidth=d,A.stroke()),A.restore();const _=g.itemFontSize||Z,hA=g.itemFontFamily||QA;A.font=`${H} ${_}px ${hA}`,b.forEach((SA,FA)=>{const NA=IA+gA+FA*P;if(SA===g.selectedOption)A.fillStyle=this.createCanvasFill(A,typeof g.itemSelectedBackgroundColor=="string"?{type:"Solid",color:g.itemSelectedBackgroundColor}:g.itemSelectedBackgroundColor||{type:"Solid",color:"#f3f4f6"},Q,P)||"#f3f4f6",A.fillRect(i+d,NA,Q-d*2,P),A.fillStyle=g.itemSelectedColor||g.activeColor||K||"#374151";else if(A.fillStyle=g.listTextColor||K||"#333333",this.activeDropdownId===I.id&&this._lastPointerPos){const O=this._lastPointerPos.y-(IA+gA),Y=Math.floor(O/P);FA===Y&&(A.fillStyle=this.createCanvasFill(A,typeof g.itemHoverBackgroundColor=="string"?{type:"Solid",color:g.itemHoverBackgroundColor}:g.itemHoverBackgroundColor||{type:"Solid",color:"#f9fafb"},Q,P)||"#f9fafb",A.fillRect(i+d,NA,Q-d*2,P),A.fillStyle=g.itemHoverColor||K)}A.fillText(SA,i+F,NA+P/2)})}A.globalAlpha=S}renderButton(A,I){var e,M,n,X;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((e=I.geometry)==null?void 0:e.width)||120,E=((M=I.geometry)==null?void 0:M.height)||40,i=-Q/2,D=-E/2,o=this.lastHoveredObjectId===I.id,s=g.corner_radius??8,h=g.bgShape||"Rectangle",a=o?((n=g.hoverStyle)==null?void 0:n.backgroundColor)||g.buttonBgColor||"#3b82f6":g.buttonBgColor||"#3b82f6",G=g.label||{},t=o?((X=g.hoverStyle)==null?void 0:X.textColor)||G.color||"#ffffff":G.color||"#ffffff",K=g.icon||{enabled:!1};A.save(),A.beginPath(),h==="Rectangle"?this.drawRoundRect(A,i,D,Q,E,s):h==="Ellipse"||h==="Circle"?A.ellipse(0,0,Q/2,E/2,0,0,Math.PI*2):h==="Pill"&&this.drawRoundRect(A,i,D,Q,E,E/2),A.fillStyle=a,A.fill();const S=G.fontSize||14,y=G.fontFamily||"Inter";A.font=`${G.fontWeight||400} ${S}px "${y}", sans-serif`,A.fillStyle=t,A.textAlign="center",A.textBaseline="middle";let F=0;if(K.enabled&&K.svgPath){const Z=K.size||16,H=K.gap||8,QA=K.position==="left"?-(A.measureText(G.text||"").width/2+Z/2+H/2):A.measureText(G.text||"").width/2+Z/2+H/2;A.save(),A.translate(QA,0);const L=new Path2D(K.svgPath),U=Z/24;A.scale(U,U),A.translate(-12,-12),A.fillStyle=K.color||t,A.fill(L),A.restore(),F=K.position==="left"?Z/2+H/2:-(Z/2+H/2)}A.fillText(G.text||"Button",F,0),A.restore()}renderToggleButton(A,I){var S,y;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=g.checked??!1,E=((S=I.geometry)==null?void 0:S.width)||120,i=((y=I.geometry)==null?void 0:y.height)||40,D=-E/2,o=-i/2,s=g.corner_radius??8,h=g.label||{},a=Q?g.activeColor||"#3b82f6":g.inactiveColor||"#374151",G=Q?g.activeTextColor||"#ffffff":g.inactiveTextColor||"#9ca3af";A.save(),A.beginPath(),this.drawRoundRect(A,D,o,E,i,s),A.fillStyle=a,A.fill();const t=h.fontSize||14,K=h.fontFamily||"Inter";A.font=`${h.fontWeight||600} ${t}px "${K}", sans-serif`,A.fillStyle=G,A.textAlign="center",A.textBaseline="middle",A.fillText(h.text||"Toggle",0,0),A.restore()}renderToggle(A,I){var F,e;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((F=I.geometry)==null?void 0:F.width)||52,E=((e=I.geometry)==null?void 0:e.height)||30,i=-Q/2,D=-E/2,o=g.checked??!1,s=g.corner_radius??E/2;A.beginPath(),this.drawRoundRect(A,i,D,Q,E,s),A.fillStyle=o?g.activeColor||"#10b981":g.inactiveColor||"#374151",g.disabled&&(A.globalAlpha*=.5),A.fill();const h=3,a=E-h*2,G=a/2,t=i+h,K=i+Q-h-a,S=o?K:t,y=D+h;if(A.beginPath(),A.arc(S+G,y+G,G,0,Math.PI*2),A.fillStyle=g.knobColor||"#ffffff",A.fill(),g.disabled&&(A.globalAlpha*=2),g.label&&g.label.text){const M=g.label,n=M.fontSize||14,X=M.fontWeight||400,Z=M.fontFamily||"Inter";A.font=`${X} ${n}px "${Z}", sans-serif`,A.fillStyle=M.color||"#f3f4f6",A.textBaseline="middle";const H=M.gap||10;let QA=0,L=0;M.position==="left"?(A.textAlign="right",QA=i-H,L=0):M.position==="right"?(A.textAlign="left",QA=i+Q+H,L=0):M.position==="top"?(A.textAlign="center",QA=0,L=D-H,A.textBaseline="bottom"):M.position==="bottom"?(A.textAlign="center",QA=0,L=D+E+H,A.textBaseline="top"):(A.textAlign="left",QA=i+Q+H,L=0),A.fillText(M.text,QA,L)}}renderLineGraph(A,I,C,g){let Q=I.datasets||[];if((!Q||Q.length===0)&&(I.data||I.graphData)&&(Q=[{id:"line-1",label:"Series 1",data:I.data||I.graphData||[],lineColor:I.lineColor||"#3b82f6",lineWidth:I.lineWidth||2,showArea:I.showArea||!1,areaColor:I.areaColor||"rgba(139, 92, 246, 0.3)",smoothing:I.smoothing||!1,showPoints:I.showPoints!==void 0?I.showPoints:!0,pointSize:I.pointSize||6,pointFill:I.pointFill||"#ffffff",pointStrokeColor:I.pointStrokeColor||I.lineColor||"#3b82f6",pointStrokeWidth:I.pointStrokeWidth||2}]),!Q||Q.length===0||!Q.some(K=>K.data&&K.data.length>=2)){A.save(),A.fillStyle="#6366f1",A.font="12px Inter, system-ui, sans-serif",A.textAlign="center",A.textBaseline="middle",A.fillText("NO DATA",0,0),A.restore();return}let E=1/0,i=-1/0,D=0;if(Q.forEach(K=>{let S=K.data;if(K.isVarEnabled&&K.inputId){let y=this.inputs.get(K.inputId);if(y===void 0){const F=this.inputNameMap.get(K.inputId);F&&F.length>0&&(y=this.inputs.get(F[0]))}y&&Array.isArray(y)&&(S=y)}if(S&&S.length>0){const y=S.filter(F=>typeof F=="number"&&!isNaN(F));y.length>0&&(E=Math.min(E,...y),i=Math.max(i,...y),D=Math.max(D,S.length))}K._resolvedData=S}),D<2)return;const o=i-E,s=C/(D-1),h=K=>{const S=o===0?.5:(K-E)/o;return g/2-S*g},a=K=>K*s-C/2,G=I.axisColor||"#333333";if(I.showXAxis&&(A.beginPath(),A.strokeStyle=I.xAxisColor||G,A.lineWidth=1,A.moveTo(-C/2,g/2),A.lineTo(C/2,g/2),A.stroke()),I.showYAxis&&(A.beginPath(),A.strokeStyle=I.yAxisColor||G,A.lineWidth=1,A.moveTo(-C/2,-g/2),A.lineTo(-C/2,g/2),A.stroke()),A.fillStyle=I.axisLabelColor||"#333333",A.font=`${I.axisLabelFontSize||10}px Inter, sans-serif`,I.showXLabels){A.textAlign="center",A.textBaseline="top";for(let K=0;K<D;K++){const S=a(K);A.fillText(`${K+1}`,S,g/2+5)}}if(I.showYLabels){A.textAlign="right",A.textBaseline="middle";const K=-C/2-5,S=(i+E)/2;A.fillText(i.toFixed(1),K,h(i)),A.fillText(S.toFixed(1),K,h(S)),A.fillText(E.toFixed(1),K,h(E))}const t=10;if(Q.forEach(K=>{const S=K._resolvedData;if(!(!S||S.length<2)){if(K.showArea){if(A.beginPath(),A.moveTo(a(0),g/2),A.lineTo(a(0),h(S[0])),K.smoothing&&S.length>2)for(let F=0;F<S.length-1;F++){const e=S[F===0?F:F-1],M=S[F],n=S[F+1],X=S[F+1===S.length-1?F+1:F+2];for(let Z=1;Z<=t;Z++){const H=Z/t,QA=this._catmullRom(e,M,n,X,H);A.lineTo(a(F+H),h(QA))}}else for(let F=1;F<S.length;F++)A.lineTo(a(F),h(S[F]));A.lineTo(a(S.length-1),g/2),A.closePath();const y=A.globalAlpha;A.globalAlpha=y*(I.areaOpacity??.3),A.fillStyle=K.areaColor||"rgba(139, 92, 246, 0.2)",A.fill(),A.globalAlpha=y}if(A.beginPath(),A.strokeStyle=K.lineColor||"#3b82f6",A.lineWidth=K.lineWidth||2,A.lineJoin="round",A.lineCap="round",A.moveTo(a(0),h(S[0])),K.smoothing&&S.length>2)for(let y=0;y<S.length-1;y++){const F=S[y===0?y:y-1],e=S[y],M=S[y+1],n=S[y+1===S.length-1?y+1:y+2];for(let X=1;X<=t;X++){const Z=X/t,H=this._catmullRom(F,e,M,n,Z);A.lineTo(a(y+Z),h(H))}}else for(let y=1;y<S.length;y++)A.lineTo(a(y),h(S[y]));A.stroke(),K.showPoints&&S.forEach((y,F)=>{const e=a(F),M=h(y);A.beginPath(),A.arc(e,M,(K.pointSize||6)/2,0,Math.PI*2),A.fillStyle=K.pointFill||"#ffffff",A.fill(),A.strokeStyle=K.pointStrokeColor||K.lineColor||"#3b82f6",A.lineWidth=K.pointStrokeWidth||1,A.stroke()})}}),I.showLegend&&Q.length>0){const K=C/2-10;let S=-g/2+15;const y=I.legendFontSize||10,F=y+5;A.font=`${y}px Inter, sans-serif`,A.textAlign="right",A.textBaseline="alphabetic",Q.forEach(e=>{const n=e.label||"Series",X=A.measureText(n).width;A.beginPath(),A.rect(K-X-8-5,S-(8/2+2),8,8),A.fillStyle=e.lineColor||"#3b82f6",A.fill(),A.fillStyle=I.legendColor||"#333333",A.fillText(n,K,S),S+=F})}}_catmullRom(A,I,C,g,Q){const E=(C-A)*.5,i=(g-I)*.5,D=Q*Q,o=Q*D;return(2*I-2*C+E+i)*o+(-3*I+3*C-2*E-i)*D+E*Q+I}normalizeOpacity(A){const I=typeof A=="number"?A:parseFloat(String(A));return isNaN(I)?1:I>1?Math.min(1,I/100):Math.max(0,Math.min(1,I))}createCanvasFill(A,I,C,g){var Q,E,i;if(!I||I.type==="None")return null;if(typeof I=="string")return I;if(I.type==="Solid"&&I.color){const D=I.color,s=(((E=(Q=this.artboard)==null?void 0:Q.tokens)==null?void 0:E.colors)||{})[D]||D;return A.fillStyle=s,s}if((I.type==="LinearGradient"||I.type==="RadialGradient"||I.type==="AngularGradient"||I.type==="DiamondGradient")&&I.stops){const D=(o,s=100)=>{var M,n;const a=(((n=(M=this.artboard)==null?void 0:M.tokens)==null?void 0:n.colors)||{})[o]||o,G=this.normalizeOpacity(I.opacity??100),K=this.normalizeOpacity(s)*G;if(K>=1&&a.startsWith("#"))return a;const S=a.startsWith("#")?a.replace("#",""):"ffffff",y=parseInt(S.substring(0,2),16),F=parseInt(S.substring(2,4),16),e=parseInt(S.substring(4,6),16);return`rgba(${y}, ${F}, ${e}, ${K})`};if(I.type==="LinearGradient"){const o=(K,S,y)=>Array.isArray(K)?K[S]??(S===0?0:1):K&&typeof K=="object"?K[y]??(S===0?0:1):S===0?0:1,s=o(I.start,0,"x")*C-C/2,h=o(I.start,1,"y")*g-g/2,a=o(I.end,0,"x")*C-C/2,G=o(I.end,1,"y")*g-g/2,t=A.createLinearGradient(s,h,a,G);if(I.stops.forEach(K=>{const S=K.offset!==void 0?K.offset:K.pos!==void 0?K.pos:K.position!==void 0?K.position:0,y=D(K.color||"#000000",K.opacity??100);t.addColorStop(Math.max(0,Math.min(1,S)),y)}),I.gradientTransform&&t.setTransform){const[K,S,y,F,e,M]=I.gradientTransform;t.setTransform({a:K,b:S,c:y,d:F,e,f:M})}return t}else if(I.type==="RadialGradient"){const o=(t,K,S)=>Array.isArray(t)?t[K]??.5:t&&typeof t=="object"?t[S]??.5:.5,s=o(I.center,0,"x")*C-C/2,h=o(I.center,1,"y")*g-g/2,a=(I.radius??.5)*Math.max(C,g),G=A.createRadialGradient(s,h,0,s,h,a);if(I.stops.forEach(t=>{const K=t.offset!==void 0?t.offset:t.pos!==void 0?t.pos:t.position!==void 0?t.position:0,S=D(t.color||"#000000",t.opacity??100);G.addColorStop(Math.max(0,Math.min(1,K)),S)}),I.gradientTransform&&G.setTransform){const[t,K,S,y,F,e]=I.gradientTransform;G.setTransform({a:t,b:K,c:S,d:y,e:F,f:e})}return G}else if(I.type==="AngularGradient"){const o=(t,K,S)=>Array.isArray(t)?t[K]??.5:t&&typeof t=="object"?t[S]??.5:.5,s=o(I.center||[.5,.5],0,"x")*C-C/2,h=o(I.center||[.5,.5],1,"y")*g-g/2,a=(I.degree||I.angle||0)*(Math.PI/180),G=(i=A.createConicGradient)==null?void 0:i.call(A,a,s,h);if(G){if(I.stops.forEach(t=>{const K=t.offset!==void 0?t.offset:t.pos!==void 0?t.pos:t.position!==void 0?t.position:0,S=D(t.color||"#000000",t.opacity??100);G.addColorStop(Math.max(0,Math.min(1,K)),S)}),I.gradientTransform&&G.setTransform){const[t,K,S,y,F,e]=I.gradientTransform;G.setTransform({a:t,b:K,c:S,d:y,e:F,f:e})}return G}}else if(I.type==="DiamondGradient"){const o=(t,K,S)=>Array.isArray(t)?t[K]??.5:t&&typeof t=="object"?t[S]??.5:.5,s=o(I.center||[.5,.5],0,"x")*C-C/2,h=o(I.center||[.5,.5],1,"y")*g-g/2,a=(I.radius??.5)*Math.max(C,g);A.save(),A.translate(s,h),A.rotate(Math.PI/4);const G=A.createRadialGradient(0,0,0,0,0,a);if(I.stops.forEach(t=>{const K=t.offset!==void 0?t.offset:t.pos!==void 0?t.pos:t.position!==void 0?t.position:0,S=D(t.color||"#000000",t.opacity??100);G.addColorStop(Math.max(0,Math.min(1,K)),S)}),I.gradientTransform&&G.setTransform){const[t,K,S,y,F,e]=I.gradientTransform;G.setTransform({a:t,b:K,c:S,d:y,e:F,f:e})}return A.scale(1/Math.SQRT2,1/Math.SQRT2),A.fillStyle=G,A.restore(),G}}if(I.type==="Pattern"&&I.url){let D=this.imageCache.get(I.url);if(D||(D=new Image,D.src=I.url,this.imageCache.set(I.url,D)),D.complete&&D.naturalWidth>0){const o=A.createPattern(D,"repeat");if(o&&(I.scaleX!==void 0||I.offsetX!==void 0)){const s=new DOMMatrix,h=I.scaleX??1,a=I.scaleY??1,G=I.offsetX??0,t=I.offsetY??0,K=I.rotation??0;s.translateSelf(G,t),s.rotateSelf(K),s.scaleSelf(h,a),o.setTransform(s)}return o}}return I.color||null}drawRoundRect(A,I,C,g,Q,E){if(E===0||E===void 0||E===null){A.rect(I,C,g,Q);return}let i=E;if(typeof i=="string")try{i=JSON.parse(i)}catch{i=parseFloat(i)||0}let D=0,o=0,s=0,h=0;typeof i=="number"?D=o=s=h=i:Array.isArray(i)?i.length===1?D=o=s=h=i[0]:i.length===2?(D=s=i[0],o=h=i[1]):i.length===3?(D=i[0],o=h=i[1],s=i[2]):i.length>=4&&(D=i[0],o=i[1],s=i[2],h=i[3]):i&&typeof i=="object"&&(D=i.tl??i.corner_radius??i.cornerRadius??0,o=i.tr??i.corner_radius??i.cornerRadius??0,s=i.br??i.corner_radius??i.cornerRadius??0,h=i.bl??i.corner_radius??i.cornerRadius??0);const a=Math.min(Math.abs(g)/2,Math.abs(Q)/2);if(D=Math.min(Math.max(0,D),a),o=Math.min(Math.max(0,o),a),s=Math.min(Math.max(0,s),a),h=Math.min(Math.max(0,h),a),A.roundRect){A.roundRect(I,C,g,Q,[D,o,s,h]);return}A.moveTo(I+D,C),A.lineTo(I+g-o,C),A.arcTo(I+g,C,I+g,C+o,o),A.lineTo(I+g,C+Q-s),A.arcTo(I+g,C+Q,I+g-s,C+Q,s),A.lineTo(I+h,C+Q),A.arcTo(I,C+Q,I,C+Q-h,h),A.lineTo(I,C+D),A.arcTo(I,C,I+D,C,D),A.closePath()}renderListView(A,I){var IA,b,P,gA;const C=this.objectStates.get(I.id)||{},g=C.options||I.options||{},Q=C.width!==void 0?C.width:((IA=I.geometry)==null?void 0:IA.width)||200,E=C.height!==void 0?C.height:((b=I.geometry)==null?void 0:b.height)||300,i=-Q/2,D=-E/2,o=C.corner_radius!==void 0?C.corner_radius:g.corner_radius??0,s=g.orientation||"vertical",h=g.items||[],a=g.itemGap??10,G=g.itemHeight??50,t=g.itemWidth??200,K=g.scrollOffset??0,S=g.padding??0,y=g.glassEffect!==!1,F=g.accentColor||"#3b82f6",e=g.itemTextColor||"#333333",M=g.itemBackgroundColor||"#ffffff",n=g.hoveredIndex??null,X=g.activeItemIndex??null,Z=g.glowIntensity??0,H=g.glowColor||"#3b82f6",QA=typeof H=="string"?H:H.color||((gA=(P=H.stops)==null?void 0:P[0])==null?void 0:gA.color)||"#3b82f6",L=g.opacity!==void 0?g.opacity:I.opacity!==void 0?I.opacity:1;if(A.save(),A.globalAlpha*=L,Z>0){const u=A.getTransform(),q=Math.sqrt(u.a*u.a+u.b*u.b)||1;A.shadowColor=QA,A.shadowBlur=Z*2*q,A.shadowOffsetX=0,A.shadowOffsetY=0}if(y){const u=g.listBackgroundColor||"rgba(31, 41, 55, 0.4)",q=this.createCanvasFill(A,u,Q,E);A.fillStyle=q||"rgba(31, 41, 55, 0.4)",this.drawListViewRect(A,i,D,Q,E,o),A.fill();const l=A.createLinearGradient(i,D,i+Q,D+E);l.addColorStop(0,"rgba(255, 255, 255, 0.15)"),l.addColorStop(.5,"rgba(255, 255, 255, 0.08)"),l.addColorStop(1,"rgba(255, 255, 255, 0.03)"),A.fillStyle=l,this.drawListViewRect(A,i,D,Q,E,o),A.fill(),A.strokeStyle="rgba(255, 255, 255, 0.25)",A.lineWidth=1,this.drawListViewRect(A,i,D,Q,E,o),A.stroke()}else{const u=g.listBackgroundColor||"transparent",q=this.createCanvasFill(A,u,Q,E);q&&(A.fillStyle=q,this.drawListViewRect(A,i,D,Q,E,o),A.fill());const l=g.borderWidth??0;l>0&&(A.strokeStyle=g.borderColor||"#cccccc",A.lineWidth=l,this.drawListViewRect(A,i,D,Q,E,o),A.stroke())}A.shadowBlur=0,A.save(),this.drawListViewRect(A,i,D,Q,E,o),A.clip();const U=typeof S=="number"?S:s==="vertical"?S[0]:S[3];let T=(s==="vertical"?D:i)+K+U;if(A.textBaseline="middle",h.forEach((u,q)=>{const l=s==="vertical"?Q:t,r=s==="vertical"?G:E,z=s==="vertical"?i:T,d=s==="vertical"?T:D,_=n===q,hA=X===q;if(hA){const O=this.createCanvasFill(A,F,l,r);A.fillStyle=O||F;const Y=A.globalAlpha;A.globalAlpha=Y*.8,A.fillRect(z,d,l,r),A.globalAlpha=Y}else if(_)A.fillStyle=y?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.05)",A.fillRect(z,d,l,r);else if(M!=="transparent"){const O=this.createCanvasFill(A,M,l,r);A.fillStyle=O||M,A.fillRect(z,d,l,r)}if(hA||_){const O=this.createCanvasFill(A,F,s==="vertical"?3:l,s==="vertical"?r:3);A.fillStyle=O||F,s==="vertical"?A.fillRect(z,d,3,r):A.fillRect(z,d+r-3,l,3)}const SA=hA?"#ffffff":y?"rgba(255, 255, 255, 0.9)":e;A.fillStyle=SA,A.font=hA||_?"600 14px Inter, sans-serif":"400 14px Inter, sans-serif";const FA=typeof u=="string"?u:(u==null?void 0:u.label)||`Item ${q+1}`,NA=z+(s==="vertical"?16:l/2),m=d+r/2;s==="horizontal"?A.textAlign="center":A.textAlign="left",A.fillText(FA,NA,m),T+=(s==="vertical"?G:t)+a}),A.restore(),g.showScrollbar!==!1){const u=(h.length||0)*(s==="vertical"?G:t)+((h.length||0)-1)*a,q=s==="vertical"?E:Q;if(u>q){const l=q/u,r=q*l,z=-K/u*q,d=g.scrollbarColor||"rgba(255,255,255,0.3)",_=g.scrollbarWidth||4;A.fillStyle=d,s==="vertical"?A.fillRect(i+Q-_-2,D+z,_,r):A.fillRect(i+z,D+E-_-2,r,_)}}A.restore()}updateListViewScrollFromPointer(A){var S,y;if(!this._lastPointerPos||!this._prevPointerPos)return;const I=A.options||{},C=I.orientation||"vertical",g=this._lastPointerPos.x-this._prevPointerPos.x,Q=this._lastPointerPos.y-this._prevPointerPos.y;C==="vertical"?I.scrollOffset=(I.scrollOffset||0)+Q:I.scrollOffset=(I.scrollOffset||0)+g;const E=this.objectStates.get(A.id)||{},i=I.items||[],D=I.itemGap??10,o=I.itemHeight??50,s=I.itemWidth??200,h=E.width!==void 0?E.width:((S=A.geometry)==null?void 0:S.width)||200,a=E.height!==void 0?E.height:((y=A.geometry)==null?void 0:y.height)||300,G=(i.length||0)*(C==="vertical"?o:s)+((i.length||0)-1)*D,K=Math.max(0,G-(C==="vertical"?a:h)+(I.padding*2||0));I.scrollOffset>0&&(I.scrollOffset=0),I.scrollOffset<-K&&(I.scrollOffset=-K)}updateListViewHoverFromPointer(A,I,C){const g=this.getListViewItemIndexAtPointer(A,I,C),Q=A.options||{};Q.hoveredIndex!==g&&(Q.hoveredIndex=g)}getListViewItemIndexAtPointer(A,I,C){var U,T;const g=A.options||{},Q=this.objectStates.get(A.id)||{},E=g.items||[];if(E.length===0)return null;const i=Q.width!==void 0?Q.width:((U=A.geometry)==null?void 0:U.width)||200,D=Q.height!==void 0?Q.height:((T=A.geometry)==null?void 0:T.height)||300,o=g.orientation||"vertical",s=g.itemGap??10,h=g.itemHeight??50,a=g.itemWidth??200,G=g.scrollOffset??0,t=g.padding??0,K=this.getWorldTransform(A.id),S=I-K.x,y=C-K.y,F=-K.rotation*(Math.PI/180),e=Math.cos(F),M=Math.sin(F),n=S*e-y*M,X=S*M+y*e,Z=-i/2,H=-D/2,QA=typeof t=="number"?t:o==="vertical"?t[0]:t[3];let L=(o==="vertical"?H:Z)+G+QA;for(let AA=0;AA<E.length;AA++){const IA=o==="vertical"?i:a,b=o==="vertical"?h:D,P=o==="vertical"?Z:L,gA=o==="vertical"?L:H;if(n>=P&&n<=P+IA&&X>=gA&&X<=gA+b)return AA;L+=(o==="vertical"?h:a)+s}return null}drawListViewRect(A,I,C,g,Q,E){A.beginPath(),this.drawRoundRect(A,I,C,g,Q,E),A.fill()}solveBehaviors(A){if(!this.artboard)return;if(!this._lastPointerPos){this.frameCount%60;return}const{x:I,y:C}=this._lastPointerPos;this.artboard.objects.forEach(g=>{if(!g.behaviors||g.behaviors.length===0)return;const Q=this.objectStates.get(g.id);Q&&g.behaviors.forEach(E=>{var a,G,t,K,S,y,F,e,M,n,X,Z,H,QA,L,U,T,AA,IA,b,P,gA,u,q,l,r,z,d,_,hA,SA,FA,NA,m,O,Y,R,x,j,GA,CA,wA,kA,BA;if(!E.enabled)return;const i=E.startTime||0,D=E.endTime||1/0;if(this.currentTime<i||this.currentTime>D)return;const o=Q.x-I,s=Q.y-C,h=Math.sqrt(o*o+s*s);if(this.frameCount%240===0&&Math.random()<.1&&console.log(`[ExodeUI] Executing ${E.type} on ${g.name}`),E.type===W.Proximity){const N=((a=E.settings)==null?void 0:a.radius)||300,f=((G=E.settings)==null?void 0:G.falloff)||"smooth";let p=0;h<N&&(f==="linear"?p=1-h/N:p=Math.pow(1-h/N,2)),p>0&&E.sensors.forEach(oA=>{this.applyBehaviorSensor(Q,oA,p,A,E.settings)})}else if(E.type===W.Magnetic){const N=((t=E.settings)==null?void 0:t.radius)||400,f=((K=E.settings)==null?void 0:K.strength)||.5;if(h<N&&h>5){const p=1-h/N,oA=o*p*f,UA=s*p*f;Q.x-=oA*A*10,Q.y-=UA*A*10}}else if(E.type===W.Repel){const N=((S=E.settings)==null?void 0:S.radius)||300,f=((y=E.settings)==null?void 0:y.strength)||1;if(h<N){const p=Math.pow(1-h/N,2);Q.x+=o/(h||1)*p*60*f*A*5,Q.y+=s/(h||1)*p*60*f*A*5}}else if(E.type===W.Orbit){const N=((F=E.settings)==null?void 0:F.speed)||1,f=((e=E.settings)==null?void 0:e.radius)||30,p=this.currentTime*N*Math.PI*2;Q.x+=Math.cos(p)*f*A*5,Q.y+=Math.sin(p)*f*A*5,Q.rotation+=2*A*5}else if(E.type===W.Vortex){const N=((M=E.settings)==null?void 0:M.radius)||400,f=((n=E.settings)==null?void 0:n.speed)||2,p=((X=E.settings)==null?void 0:X.strength)||1;if(h<N){const oA=Math.pow(1-h/N,1.5),UA=this.currentTime*f*Math.PI*2,iA=Math.cos(UA)*30-o*.4,V=Math.sin(UA)*30-s*.4;Q.x+=iA*oA*p*A*5,Q.y+=V*oA*p*A*5,Q.rotation+=5*oA*p*A*5,Q.scale_x*=1-oA*.1*p*A,Q.scale_y*=1-oA*.1*p*A}}else if(E.type===W.Fluid){const N=((Z=E.settings)==null?void 0:Z.radius)||300,f=((H=E.settings)==null?void 0:H.strength)||1;if(h<N){const p=Math.pow(1-h/N,1.2),oA=o/(h||1)*p*1.2*f,UA=s/(h||1)*p*1.2*f;Q.x+=oA*10*A*5,Q.y+=UA*10*A*5,Q.scale_x*=1+p*.3*f*A,Q.scale_y*=1+p*.3*f*A}}else if(E.type===W.Elastic){const N=((QA=E.settings)==null?void 0:QA.radius)||300,f=((L=E.settings)==null?void 0:L.strength)||1;if(h<N){const p=1-h/N;Q.scale_x*=1+p*.4*f*A,Q.scale_y*=1+p*.4*f*A}}else if(E.type===W.Holographic){const N=Q.x-this.canvasWidth/2,f=Q.y-this.canvasHeight/2,p=((U=E.settings)==null?void 0:U.factor)||25;if(Q.x-=N/1e3*p*A*5,Q.y-=f/1e3*p*A*5,Q.style){const oA=1-Math.min(1,h/400);Q.style.exposure=(Q.style.exposure||1)+oA*.5*A}}else if(E.type===W.Sticky){const N=((T=E.settings)==null?void 0:T.radius)||80,f=((AA=E.settings)==null?void 0:AA.strength)||1;if(h<N){const p=Math.pow(1-h/N,2);Q.x-=o*p*f*A*10,Q.y-=s*p*f*A*10,Q.scale_x*=1-p*.1*f*A,Q.scale_y*=1-p*.1*f*A}}else if(E.type===W.Dilation){const N=((IA=E.settings)==null?void 0:IA.size)||120,f=((b=E.settings)==null?void 0:b.strength)||1;if(h<N){const p=1-h/N;Q.scale_x*=1+p*.5*f*A,Q.scale_y*=1+p*.5*f*A}}else if(E.type===W.Parallax){const N=((P=E.settings)==null?void 0:P.factor)||.05,f=this.canvasHeight/2,p=(this._lastPointerPos.y-f)*N;Q.y+=p*A*10}else if(E.type===W.Noise||E.type===W.Float){const N=(((gA=E.settings)==null?void 0:gA.frequency)||((u=E.settings)==null?void 0:u.speed)||1)*.002,f=(((q=E.settings)==null?void 0:q.amplitude)||((l=E.settings)==null?void 0:l.range)||50)*(((r=E.settings)==null?void 0:r.strength)||1),p=Date.now();Q.x+=Math.sin(p*N)*f*A,Q.y+=Math.cos(p*N*.8)*f*A,Q.rotation+=Math.sin(p*N*.5)*5*A}else if(E.type===W.Pulse){const N=(((z=E.settings)==null?void 0:z.speed)||1)*.005,f=(((d=E.settings)==null?void 0:d.scale)||1.2)-1,p=Math.sin(Date.now()*N),oA=((_=E.settings)==null?void 0:_.strength)||1;Q.scale_x*=1+p*f*oA*A,Q.scale_y*=1+p*f*oA*A,Q.style&&(Q.style.exposure=(Q.style.exposure||1)+Math.max(0,p)*.1*oA*A)}else if(E.type===W.Draggable){const N=((hA=E.settings)==null?void 0:hA.radius)||150,f=this.draggingBehaviors.has(g.id);if(h<N||f){const p=((SA=E.settings)==null?void 0:SA.strength)||1,oA=f?1:Math.max(0,1-h/N);this.applyBehaviorSensor(Q,mA.PositionX,oA*p,A,E.settings),this.applyBehaviorSensor(Q,mA.PositionY,oA*p,A,E.settings)}}else if(E.type===W.Scroll){const N=((FA=E.settings)==null?void 0:FA.axis)||"vertical",f=((NA=E.settings)==null?void 0:NA.factor)||.5,p=((m=E.settings)==null?void 0:m.strength)||1;(N==="vertical"||N==="both")&&(Q.y+=this.scrollOffset.y*f*p*A),(N==="horizontal"||N==="both")&&(Q.x+=this.scrollOffset.x*f*p*A)}else if(E.type===W.LookAt){const N=((O=E.settings)==null?void 0:O.factor)||1,f=((Y=E.settings)==null?void 0:Y.strength)||1,p=Math.atan2(-s,-o)*(180/Math.PI),oA=Q.rotation,UA=(p-oA+180)%360-180;Q.rotation+=UA*N*f*A*10}else if(E.type===W.Glint||E.type===W.Scan){const N=(((R=E.settings)==null?void 0:R.speed)||1)*.004,f=((x=E.settings)==null?void 0:x.strength)||1,p=(Math.sin(Date.now()*N)+1)/2;Q.style&&(Q.style.exposure=(Q.style.exposure||1)+p*f*A*5),Q.x+=(p-.5)*20*f*A}else if(E.type===W.Ratchet){const N=((j=E.settings)==null?void 0:j.steps)||12,f=(((GA=E.settings)==null?void 0:GA.speed)||1)*30,p=Math.floor(Q.rotation/(360/N))*(360/N);Q.rotation=this.lerp(Q.rotation,p+f*A,.1)}else if(E.type===W.Jitter&&h<300){const N=((CA=E.settings)==null?void 0:CA.strength)||1,f=(((wA=E.settings)==null?void 0:wA.intensity)||5)*N;Q.x+=(Math.random()-.5)*f*A*60,Q.y+=(Math.random()-.5)*f*A*60,Q.rotation+=(Math.random()-.5)*f*A*120}else if(E.type===W.Follower){const N=(kA=E.settings)==null?void 0:kA.targetId;if(N){const f=this.objectStates.get(N);if(f){const p=((BA=E.settings)==null?void 0:BA.stiffness)||.1,oA=f.x-Q.x,UA=f.y-Q.y;Q.x+=oA*p*A*60,Q.y+=UA*p*A*60}}}else E.type===W.Wrap&&(Q.x<0?Q.x=this.canvasWidth:Q.x>this.canvasWidth&&(Q.x=0),Q.y<0?Q.y=this.canvasHeight:Q.y>this.canvasHeight&&(Q.y=0))})})}applyBehaviorSensor(A,I,C,g,Q){const E=(Q==null?void 0:Q.intensity)||(Q==null?void 0:Q.strength)||1,i=C*E*g;switch(I){case mA.Scale:A.scale_x*=1+i*.5,A.scale_y*=1+i*.5;break;case mA.Opacity:A.opacity=Math.max(0,Math.min(100,A.opacity-i*100));break;case mA.RotateZ:A.rotation+=i*180;break;case mA.RotateX:A.rotate_x=(A.rotate_x||0)+i*180;break;case mA.RotateY:A.rotate_y=(A.rotate_y||0)+i*180;break;case mA.PositionX:A.x+=i*300;break;case mA.PositionY:A.y+=i*300;break;case mA.SkewX:A.skew_x=(A.skew_x||0)+i*45;break;case mA.Blur:A.style||(A.style={}),A.style.blur=Math.min(100,(A.style.blur||0)+i*50);break;case mA.Exposure:A.style||(A.style={}),A.style.exposure=(A.style.exposure||1)+i*2;break;case mA.HueShift:A.style||(A.style={}),A.style.hue=(A.style.hue||0)+i*360;break;case mA.CornerRadius:A.corner_radius=Math.min(200,(A.corner_radius||0)+i*100);break;case mA.LetterSpacing:A.geometry||(A.geometry={}),A.geometry.letterSpacing=(A.geometry.letterSpacing||0)+i*10;break}}lerp(A,I,C){return A*(1-C)+I*C}deepMerge(A,I){if(!A)return I;if(!I)return A;if(typeof A!="object"||typeof I!="object"||A===null||I===null)return I;const C={...A};for(const g in I)Object.prototype.hasOwnProperty.call(I,g)&&(I[g]&&typeof I[g]=="object"&&!Array.isArray(I[g])?C[g]=this.deepMerge(A[g],I[g]):C[g]=I[g]);return C}}const OQ=({artboard:B,config:A})=>{const I={...B.seo,...A},C=I.enableSmartExtraction!==!1;eA.useEffect(()=>{const i=I.title||B.name;i&&(document.title=i);let D=I.description;if(!D&&C){const h=B.objects.filter(a=>a.geometry.type==="Text").sort((a,G)=>{var t,K;return(((t=G.geometry.text)==null?void 0:t.length)||0)-(((K=a.geometry.text)==null?void 0:K.length)||0)});h.length>0&&(D=h[0].geometry.text)}D&&(g("name","description",D),g("property","og:description",D)),I.keywords&&I.keywords.length>0&&g("name","keywords",I.keywords.join(", "));const o=I.ogImage||B.backgroundImage;o&&g("property","og:image",o),i&&g("property","og:title",i),g("property","og:type","website")},[I,B,C]);const g=(i,D,o)=>{let s=document.querySelector(`meta[${i}="${D}"]`);s||(s=document.createElement("meta"),s.setAttribute(i,D),document.head.appendChild(s)),s.setAttribute("content",o)},Q=()=>{const i=[];return i.push(HA.jsx("h1",{children:I.title||B.name},"artboard-title")),B.objects.forEach((o,s)=>{if(!(!o.visible&&o.isVisible!==!0))if(o.geometry.type==="Text"){const h=o.geometry.text;h&&(o.geometry.fontSize>24?i.push(HA.jsx("h2",{children:h},o.id||s)):i.push(HA.jsx("p",{children:h},o.id||s)))}else if(o.geometry.type==="Image"){const h=o.geometry.src,a=o.altText||o.name||"Illustration";i.push(HA.jsx("img",{src:h,alt:a},o.id||s))}else o.type==="Button"&&i.push(HA.jsx("button",{children:o.name||"Button"},o.id||s))}),i},E=I.jsonLd||{"@context":"https://schema.org","@type":"VisualArtwork",name:I.title||B.name,description:I.description,image:I.ogImage||B.backgroundImage,abstract:"Animated interface created with ExodeUI"};return HA.jsxs("div",{id:`exode-seo-${B.id||"default"}`,"aria-hidden":"false",style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0",zIndex:-1},children:[Q(),HA.jsx("script",{type:"application/ld+json",children:JSON.stringify(E)})]})},Ai=eA.forwardRef(({artboard:B,src:A,className:I,style:C,autoPlay:g=!0,fit:Q="Contain",alignment:E="Center",enableSEO:i=!0,seo:D,onReady:o,onTrigger:s,onInputUpdate:h,onComponentChange:a,onToggle:G,onInputChange:t,onInputFocus:K,onInputBlur:S,onLog:y},F)=>{const e=eA.useRef(null),M=eA.useRef(new xQ),n=eA.useRef(),X=eA.useRef(0),Z=eA.useRef(null),[H,QA]=eA.useState(B||null);eA.useImperativeHandle(F,()=>e.current),eA.useEffect(()=>{console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"),M.current.setLayout(Q,E)},[Q,E]),eA.useEffect(()=>{s&&M.current.setTriggerCallback(s)},[s]),eA.useEffect(()=>{h&&M.current.setInputUpdateCallback(h)},[h]),eA.useEffect(()=>{a&&M.current.setComponentChangeCallback(a)},[a]),eA.useEffect(()=>{G&&M.current.setToggleCallback(G)},[G]),eA.useEffect(()=>{t&&M.current.setInputChangeCallback(t)},[t]),eA.useEffect(()=>{K&&M.current.setInputFocusCallback(K)},[K]),eA.useEffect(()=>{S&&M.current.setInputBlurCallback(S)},[S]),eA.useEffect(()=>{(async()=>{const T=M.current;let AA=B;if(!AA&&A)try{AA=await(await fetch(A)).json()}catch(IA){console.error("Failed to load ExodeUI animation:",IA);return}if(AA){const IA=AA.id||AA.name||"default";Z.current!==IA&&(T.load(AA),Z.current=IA,QA(AA),X.current=0),o&&o(T)}})()},[B,A]),eA.useEffect(()=>{const U=M.current,T=e.current;if(!T)return;const AA=T.getContext("2d");if(!AA)return;AA.imageSmoothingEnabled=!0,AA.imageSmoothingQuality="high",y&&U.setOnLogCallback(y);const IA=P=>{X.current||(X.current=P);const gA=(P-X.current)/1e3;X.current=P,g&&U.advance(gA);const u=window.devicePixelRatio||1,q=T.getBoundingClientRect(),l=Math.floor(q.width*u),r=Math.floor(q.height*u);(T.width!==l||T.height!==r)&&(T.width=l,T.height=r),U.render(AA,l,r),n.current=requestAnimationFrame(IA)};n.current=requestAnimationFrame(IA);const b=()=>{U.handleScroll(window.scrollX,window.scrollY)};return window.addEventListener("scroll",b,{passive:!0}),()=>{n.current&&cancelAnimationFrame(n.current),window.removeEventListener("scroll",b)}},[g]);const L=(U,T)=>{const AA=U.currentTarget.getBoundingClientRect(),IA=U.clientX-AA.left,b=U.clientY-AA.top,P=AA.width,gA=AA.height;M.current.handlePointerInput(T,IA,b,P,gA)};return HA.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",...C},className:I,children:[HA.jsx("canvas",{ref:e,style:{width:"100%",height:"100%",outline:"none"},tabIndex:0,onPointerDown:U=>{var T;L(U,"down"),(T=e.current)==null||T.focus()},onPointerUp:U=>L(U,"up"),onPointerMove:U=>L(U,"move"),onPointerLeave:U=>L(U,"blur"),onClick:U=>L(U,"click"),onKeyDown:U=>{U.key==="Backspace"||U.key==="Enter"||U.key,M.current.handleKeyDown(U.nativeEvent)}}),i&&H&&HA.jsx(OQ,{artboard:H,config:D})]})});function Ii(){const[B,A]=eA.useState(null),I=eA.useCallback((h,a)=>{B==null||B.setInputBool(h,a)},[B]),C=eA.useCallback((h,a)=>{B==null||B.setInputNumber(h,a)},[B]),g=eA.useCallback(h=>{B==null||B.fireTrigger(h)},[B]),Q=eA.useCallback((h,a)=>{B==null||B.setInputText(h,a)},[B]),E=eA.useCallback((h,a)=>{B==null||B.setInputNumberArray(h,a)},[B]),i=eA.useCallback((h,a)=>{B==null||B.setInputStringArray(h,a)},[B]),D=eA.useCallback((h,a)=>{B==null||B.updateObjectOptions(h,a)},[B]),o=eA.useCallback((h,a,G)=>{B==null||B.updateConstraint(h,a,G)},[B]),s=eA.useCallback((h,a)=>{B==null||B.updateGraphData(h,a)},[B]);return{setEngine:A,engine:B,setInputBool:I,setInputNumber:C,fireTrigger:g,setInputText:Q,setInputNumberArray:E,setInputStringArray:i,updateConstraint:o,updateGraphData:s,updateObjectOptions:D}}const gi="6.0.28";pA.BehaviorSensor=mA,pA.BehaviorType=W,pA.ConditionOp=tC,pA.ExodeSEO=OQ,pA.ExodeUICanvas=Ai,pA.ExodeUIEngine=xQ,pA.LogicOp=NI,pA.VERSION=gi,pA.useExodeUI=Ii,Object.defineProperty(pA,Symbol.toStringTag,{value:"Module"})});
22
+ `);let m=-E/2+l;const O=gA*1.2;let Y=0;NA.forEach((R,x)=>{const j=R.split(" ");let GA="";for(let CA=0;CA<j.length;CA++){const wA=GA+j[CA]+" ";A.measureText(wA).width>_&&CA>0?(A.fillText(GA,d,m),GA=j[CA]+" ",m+=O):GA=wA}A.fillText(GA,d,m),Y=A.measureText(GA).width,x<NA.length-1&&(m+=O,Y=0)}),i&&!IA&&Math.floor(performance.now()/500)%2===0&&A.fillRect(d+Y,m,1.5,gA)}else{const m=A.measureText(hA).width;let O=0;if(m>_&&(O=m-_),A.fillText(hA,d-O,0),i&&!IA&&Math.floor(performance.now()/500)%2===0){const R=d+m-O;A.fillRect(R,-(gA/2),1.5,gA)}}if(A.restore(),h.visible!==!1){const NA=h.text||"Label",m=h.fontSize||12,O=h.color||"rgba(156, 163, 175, 1)",Y=h.offset??8;A.font=`600 ${m}px "${u}", sans-serif`,A.fillStyle=O,A.textAlign="left",A.textBaseline="bottom";const R=-(Q/2),x=-(E/2)-Y;A.fillText(NA,R,x)}if(a.visible===!0){const NA=a.text||"Helper text",m=a.fontSize||11,O=s==="error"?"rgba(239, 68, 68, 1)":a.color||"rgba(156, 163, 175, 1)",Y=a.offset??6;A.font=`400 ${m}px "${u}", sans-serif`,A.fillStyle=O,A.textAlign="left",A.textBaseline="top";const R=-(Q/2),x=E/2+Y;A.fillText(NA,R,x)}}renderSlider(A,I){const C=this.objectStates.get(I.id),g=(C==null?void 0:C.geometry)||I.geometry,Q=(C==null?void 0:C.options)||I.options||{},E=g.width||200,i=Q.value??50,D=Q.min??0,s=(Q.max??100)-D,h=s===0?0:(i-D)/s,a=Q.trackHeight||4,G=Q.trackRoundedness??2,t=Q.trackShape??"Rectangle",K=Q.trackPath||"",S=Q.activeColor||"#3b82f6",y=Q.inactiveColor||"#374151",F=Q.thumbShape||"Ellipse",e=Q.thumbWidth??16,M=Q.thumbHeight??16,n=Q.thumbRoundedness??0,X=Q.thumbColor||"#ffffff",Z=Q.thumbPath||"",H=Q.thumbIcon||"",QA=Q.showValueTooltip??!1,L=Q.tooltipBgColor||"#333333",U=Q.tooltipColor||"#ffffff",T=Q.tooltipOffsetX??0,AA=Q.tooltipOffsetY??-25,IA=(d,_,hA,SA,FA,NA,m)=>{if((d==="Custom"||d==="Icon")&&m)try{const O=new Path2D(m);if(A.save(),A.translate(_,hA),d==="Icon"){const Y=Math.min(SA,FA)/24;A.scale(Y,Y),A.translate(-12,-12)}A.fill(O),A.restore();return}catch(O){console.error("Error drawing slider shape in engine:",O)}if(A.beginPath(),d==="Ellipse")A.ellipse(_,hA,SA/2,FA/2,0,0,Math.PI*2);else if(d==="Rectangle")this.drawRoundRect(A,_-SA/2,hA-FA/2,SA,FA,NA);else if(d==="Triangle")A.moveTo(_,hA-FA/2),A.lineTo(_+SA/2,hA+FA/2),A.lineTo(_-SA/2,hA+FA/2),A.closePath();else if(d==="Diamond")A.moveTo(_,hA-FA/2),A.lineTo(_+SA/2,hA),A.lineTo(_,hA+FA/2),A.lineTo(_-SA/2,hA),A.closePath();else if(d==="Polygon"){const O=I.geometry.sides||3,Y=I.geometry.radius||Math.min(SA,FA)/2;for(let R=0;R<O;R++){const x=R*2*Math.PI/O-Math.PI/2,j=_+Y*Math.cos(x),GA=hA+Y*Math.sin(x);R===0?A.moveTo(j,GA):A.lineTo(j,GA)}A.closePath()}else if(d==="Star"){const Y=Math.min(SA,FA)/2,R=Y/2;for(let x=0;x<5*2;x++){const j=x%2===0?Y:R,GA=x*Math.PI/5-Math.PI/2;A.lineTo(_+j*Math.cos(GA),hA+j*Math.sin(GA))}A.closePath()}else d==="Line"&&(A.moveTo(_-SA/2,hA),A.lineTo(_+SA/2,hA));A.fill()};A.fillStyle=y,t==="Line"?(A.strokeStyle=y,A.lineWidth=a,A.beginPath(),A.moveTo(-E/2,0),A.lineTo(E/2,0),A.stroke()):IA(t,0,0,E,a,G,K);const b=E-e,P=-E/2+e/2+h*b,gA=P- -E/2;gA>0&&(A.fillStyle=S,t==="Line"?(A.strokeStyle=S,A.lineWidth=a,A.beginPath(),A.moveTo(-E/2,0),A.lineTo(P,0),A.stroke()):t==="Rectangle"&&(A.beginPath(),this.drawRoundRect(A,-E/2,-a/2,gA,a,G),A.fill())),A.save(),A.translate(P,0);const u=A.getTransform(),q=Math.sqrt(u.a*u.a+u.b*u.b)||1;if(A.shadowColor="rgba(0,0,0,0.2)",A.shadowBlur=4*q,A.shadowOffsetY=1*q,A.fillStyle=X,IA(F,0,0,e,M,n,F==="Icon"?H:Z),A.restore(),QA){A.save(),A.translate(P+T,AA);const d=Math.round(i).toString();A.font="10px Inter, sans-serif";const _=A.measureText(d),hA=6,SA=4,FA=_.width+hA*2,NA=14+SA;A.beginPath(),this.drawRoundRect(A,-FA/2,-NA/2,FA,NA,4),A.fillStyle=L,A.fill(),A.fillStyle=U,A.textAlign="center",A.textBaseline="middle",A.fillText(d,0,0),A.restore()}const l=Q.label||{},r=Q.helperText||{},z=Q.fontFamily||"Inter";if(l.visible!==!1){const d=l.text||"Label",_=l.fontSize||12,hA=l.color||"rgba(156, 163, 175, 1)",SA=l.offset??8;A.font=`600 ${_}px "${z}", sans-serif`,A.fillStyle=hA,A.textAlign="left",A.textBaseline="bottom";const FA=-(E/2),NA=-(a/2)-SA;A.fillText(d,FA,NA)}if(r.visible===!0){const d=r.text||"Helper text",_=r.fontSize||11,hA=r.color||"rgba(156, 163, 175, 1)",SA=r.offset??6;A.font=`400 ${_}px "${z}", sans-serif`,A.fillStyle=hA,A.textAlign="left",A.textBaseline="top";const FA=-(E/2),NA=a/2+SA;A.fillText(d,FA,NA)}}renderDropdown(A,I){var AA;const C=this.objectStates.get(I.id);if(!C)return;const g=C.options||I.options||{},Q=I.geometry.width||160,E=I.geometry.height||40,i=-Q/2,D=-E/2,o=g.corner_radius??6,s=g.disabled||g.previewState==="disabled",h=this.lastHoveredObjectId===I.id||g.previewState==="hover",a=(g.isOpen||g.previewState==="active")&&!s;let G=g.backgroundColor,t=g.borderColor,K=g.color||"#333333";s?(G=g.disabledBackgroundColor||"#f3f4f6",t=g.disabledBorderColor||"#e5e7eb",K=g.disabledColor||"#9ca3af"):a?(G=g.activeBackgroundColor||G,t=g.activeBorderColor||t,K=g.activeColor||K):h&&(G=g.hoverBackgroundColor||G,t=g.hoverBorderColor||t,K=g.hoverColor||K),G||(G="#ffffff"),t||(t="#e5e7eb");const S=A.globalAlpha;A.globalAlpha=S*(g.opacity??1),this.drawRoundRect(A,i,D,Q,E,o),A.fillStyle=this.createCanvasFill(A,typeof G=="string"?{type:"Solid",color:G}:G,Q,E)||"#ffffff",A.fill();const y=g.borderWidth??1;y>0&&(A.strokeStyle=this.createCanvasFill(A,typeof t=="string"?{type:"Solid",color:t}:t,Q,E)||"#e5e7eb",A.lineWidth=y,A.stroke());const F=12,e=g.chevronType||"chevron",M=g.chevronSize||16,n=(a?g.openIconColor:g.closedIconColor)||g.chevronColor||"#6b7280";if(e!=="none"){const IA=i+Q-F-M/2;A.save(),A.translate(IA,0);const b=a?g.openIconAngle??180:g.closedIconAngle??0;if(A.rotate(b*Math.PI/180),A.strokeStyle=n,A.fillStyle=n,A.lineWidth=1.5,A.lineCap="round",A.lineJoin="round",e==="chevron")A.beginPath(),A.moveTo(-M/2,-M*.2),A.lineTo(0,M*.2),A.lineTo(M/2,-M*.2),A.stroke();else if(e==="custom"||e==="path"){const P=a&&g.openIconPath||g.closedIconPath;if(P){const gA=new Path2D(P);A.save();const u=M/24;A.scale(u,u),A.translate(-12,-12),A.fill(gA),A.restore()}}A.restore()}const X=g.selectedOption||g.placeholder||"Select...",Z=g.fontSize||14,H=g.fontWeight||400,QA=g.fontFamily||"Inter, sans-serif";A.font=`${H} ${Z}px ${QA}`;const L=s?g.disabledColor||"#9ca3af":!g.selectedOption&&g.placeholder?"#9ca3af":K;A.fillStyle=this.createCanvasFill(A,typeof L=="string"?{type:"Solid",color:L}:L,Q,E)||"#333333",A.textAlign="left",A.textBaseline="middle";const U=e==="none"?0:M+8,T=Q-F*2-U;if(A.save(),A.beginPath(),A.rect(i+F,D,T,E),A.clip(),A.fillText(X,i+F,0),A.restore(),a&&!s){const IA=D+E+4,b=g.optionsList||[],P=g.itemHeight||32,gA=g.listPadding??4,u=b.length*P+gA*2,q=g.listCornerRadius??o;A.save();const l=g.listShadow||{},r=A.getTransform(),z=Math.sqrt(r.a*r.a+r.b*r.b)||1;A.shadowColor=typeof l.color=="string"?l.color:((AA=l.color)==null?void 0:AA.color)||"rgba(0,0,0,0.15)",A.shadowBlur=(l.blur??12)*z,A.shadowOffsetY=(l.offsetY??6)*z,A.shadowOffsetX=(l.offsetX??0)*z,A.beginPath(),this.drawRoundRect(A,i,IA,Q,u,q),A.fillStyle=this.createCanvasFill(A,typeof g.listBackgroundColor=="string"?{type:"Solid",color:g.listBackgroundColor}:g.listBackgroundColor||{type:"Solid",color:"#ffffff"},Q,u)||"#ffffff",A.fill();const d=g.listBorderWidth??1;d>0&&(A.shadowColor="transparent",A.strokeStyle=this.createCanvasFill(A,typeof g.listBorderColor=="string"?{type:"Solid",color:g.listBorderColor}:g.listBorderColor||{type:"Solid",color:t},Q,u)||"#e5e7eb",A.lineWidth=d,A.stroke()),A.restore();const _=g.itemFontSize||Z,hA=g.itemFontFamily||QA;A.font=`${H} ${_}px ${hA}`,b.forEach((SA,FA)=>{const NA=IA+gA+FA*P;if(SA===g.selectedOption)A.fillStyle=this.createCanvasFill(A,typeof g.itemSelectedBackgroundColor=="string"?{type:"Solid",color:g.itemSelectedBackgroundColor}:g.itemSelectedBackgroundColor||{type:"Solid",color:"#f3f4f6"},Q,P)||"#f3f4f6",A.fillRect(i+d,NA,Q-d*2,P),A.fillStyle=g.itemSelectedColor||g.activeColor||K||"#374151";else if(A.fillStyle=g.listTextColor||K||"#333333",this.activeDropdownId===I.id&&this._lastPointerPos){const O=this._lastPointerPos.y-(IA+gA),Y=Math.floor(O/P);FA===Y&&(A.fillStyle=this.createCanvasFill(A,typeof g.itemHoverBackgroundColor=="string"?{type:"Solid",color:g.itemHoverBackgroundColor}:g.itemHoverBackgroundColor||{type:"Solid",color:"#f9fafb"},Q,P)||"#f9fafb",A.fillRect(i+d,NA,Q-d*2,P),A.fillStyle=g.itemHoverColor||K)}A.fillText(SA,i+F,NA+P/2)})}A.globalAlpha=S}renderButton(A,I){var e,M,n,X;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((e=I.geometry)==null?void 0:e.width)||120,E=((M=I.geometry)==null?void 0:M.height)||40,i=-Q/2,D=-E/2,o=this.lastHoveredObjectId===I.id,s=g.corner_radius??8,h=g.bgShape||"Rectangle",a=o?((n=g.hoverStyle)==null?void 0:n.backgroundColor)||g.buttonBgColor||"#3b82f6":g.buttonBgColor||"#3b82f6",G=g.label||{},t=o?((X=g.hoverStyle)==null?void 0:X.textColor)||G.color||"#ffffff":G.color||"#ffffff",K=g.icon||{enabled:!1};A.save(),A.beginPath(),h==="Rectangle"?this.drawRoundRect(A,i,D,Q,E,s):h==="Ellipse"||h==="Circle"?A.ellipse(0,0,Q/2,E/2,0,0,Math.PI*2):h==="Pill"&&this.drawRoundRect(A,i,D,Q,E,E/2),A.fillStyle=a,A.fill();const S=G.fontSize||14,y=G.fontFamily||"Inter";A.font=`${G.fontWeight||400} ${S}px "${y}", sans-serif`,A.fillStyle=t,A.textAlign="center",A.textBaseline="middle";let F=0;if(K.enabled&&K.svgPath){const Z=K.size||16,H=K.gap||8,QA=K.position==="left"?-(A.measureText(G.text||"").width/2+Z/2+H/2):A.measureText(G.text||"").width/2+Z/2+H/2;A.save(),A.translate(QA,0);const L=new Path2D(K.svgPath),U=Z/24;A.scale(U,U),A.translate(-12,-12),A.fillStyle=K.color||t,A.fill(L),A.restore(),F=K.position==="left"?Z/2+H/2:-(Z/2+H/2)}A.fillText(G.text||"Button",F,0),A.restore()}renderToggleButton(A,I){var S,y;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=g.checked??!1,E=((S=I.geometry)==null?void 0:S.width)||120,i=((y=I.geometry)==null?void 0:y.height)||40,D=-E/2,o=-i/2,s=g.corner_radius??8,h=g.label||{},a=Q?g.activeColor||"#3b82f6":g.inactiveColor||"#374151",G=Q?g.activeTextColor||"#ffffff":g.inactiveTextColor||"#9ca3af";A.save(),A.beginPath(),this.drawRoundRect(A,D,o,E,i,s),A.fillStyle=a,A.fill();const t=h.fontSize||14,K=h.fontFamily||"Inter";A.font=`${h.fontWeight||600} ${t}px "${K}", sans-serif`,A.fillStyle=G,A.textAlign="center",A.textBaseline="middle",A.fillText(h.text||"Toggle",0,0),A.restore()}renderToggle(A,I){var F,e;const C=this.objectStates.get(I.id),g=(C==null?void 0:C.options)||I.options||{},Q=((F=I.geometry)==null?void 0:F.width)||52,E=((e=I.geometry)==null?void 0:e.height)||30,i=-Q/2,D=-E/2,o=g.checked??!1,s=g.corner_radius??E/2;A.beginPath(),this.drawRoundRect(A,i,D,Q,E,s),A.fillStyle=o?g.activeColor||"#10b981":g.inactiveColor||"#374151",g.disabled&&(A.globalAlpha*=.5),A.fill();const h=3,a=E-h*2,G=a/2,t=i+h,K=i+Q-h-a,S=o?K:t,y=D+h;if(A.beginPath(),A.arc(S+G,y+G,G,0,Math.PI*2),A.fillStyle=g.knobColor||"#ffffff",A.fill(),g.disabled&&(A.globalAlpha*=2),g.label&&g.label.text){const M=g.label,n=M.fontSize||14,X=M.fontWeight||400,Z=M.fontFamily||"Inter";A.font=`${X} ${n}px "${Z}", sans-serif`,A.fillStyle=M.color||"#f3f4f6",A.textBaseline="middle";const H=M.gap||10;let QA=0,L=0;M.position==="left"?(A.textAlign="right",QA=i-H,L=0):M.position==="right"?(A.textAlign="left",QA=i+Q+H,L=0):M.position==="top"?(A.textAlign="center",QA=0,L=D-H,A.textBaseline="bottom"):M.position==="bottom"?(A.textAlign="center",QA=0,L=D+E+H,A.textBaseline="top"):(A.textAlign="left",QA=i+Q+H,L=0),A.fillText(M.text,QA,L)}}renderLineGraph(A,I,C,g){let Q=I.datasets||[];if((!Q||Q.length===0)&&(I.data||I.graphData)&&(Q=[{id:"line-1",label:"Series 1",data:I.data||I.graphData||[],lineColor:I.lineColor||"#3b82f6",lineWidth:I.lineWidth||2,showArea:I.showArea||!1,areaColor:I.areaColor||"rgba(139, 92, 246, 0.3)",smoothing:I.smoothing||!1,showPoints:I.showPoints!==void 0?I.showPoints:!0,pointSize:I.pointSize||6,pointFill:I.pointFill||"#ffffff",pointStrokeColor:I.pointStrokeColor||I.lineColor||"#3b82f6",pointStrokeWidth:I.pointStrokeWidth||2}]),!Q||Q.length===0||!Q.some(K=>K.data&&K.data.length>=2)){A.save(),A.fillStyle="#6366f1",A.font="12px Inter, system-ui, sans-serif",A.textAlign="center",A.textBaseline="middle",A.fillText("NO DATA",0,0),A.restore();return}let E=1/0,i=-1/0,D=0;if(Q.forEach(K=>{let S=K.data;if(K.isVarEnabled&&K.inputId){let y=this.inputs.get(K.inputId);if(y===void 0){const F=this.inputNameMap.get(K.inputId);F&&F.length>0&&(y=this.inputs.get(F[0]))}y&&Array.isArray(y)&&(S=y)}if(S&&S.length>0){const y=S.filter(F=>typeof F=="number"&&!isNaN(F));y.length>0&&(E=Math.min(E,...y),i=Math.max(i,...y),D=Math.max(D,S.length))}K._resolvedData=S}),D<2)return;const o=i-E,s=C/(D-1),h=K=>{const S=o===0?.5:(K-E)/o;return g/2-S*g},a=K=>K*s-C/2,G=I.axisColor||"#333333";if(I.showXAxis&&(A.beginPath(),A.strokeStyle=I.xAxisColor||G,A.lineWidth=1,A.moveTo(-C/2,g/2),A.lineTo(C/2,g/2),A.stroke()),I.showYAxis&&(A.beginPath(),A.strokeStyle=I.yAxisColor||G,A.lineWidth=1,A.moveTo(-C/2,-g/2),A.lineTo(-C/2,g/2),A.stroke()),A.fillStyle=I.axisLabelColor||"#333333",A.font=`${I.axisLabelFontSize||10}px Inter, sans-serif`,I.showXLabels){A.textAlign="center",A.textBaseline="top";for(let K=0;K<D;K++){const S=a(K);A.fillText(`${K+1}`,S,g/2+5)}}if(I.showYLabels){A.textAlign="right",A.textBaseline="middle";const K=-C/2-5,S=(i+E)/2;A.fillText(i.toFixed(1),K,h(i)),A.fillText(S.toFixed(1),K,h(S)),A.fillText(E.toFixed(1),K,h(E))}const t=10;if(Q.forEach(K=>{const S=K._resolvedData;if(!(!S||S.length<2)){if(K.showArea){if(A.beginPath(),A.moveTo(a(0),g/2),A.lineTo(a(0),h(S[0])),K.smoothing&&S.length>2)for(let F=0;F<S.length-1;F++){const e=S[F===0?F:F-1],M=S[F],n=S[F+1],X=S[F+1===S.length-1?F+1:F+2];for(let Z=1;Z<=t;Z++){const H=Z/t,QA=this._catmullRom(e,M,n,X,H);A.lineTo(a(F+H),h(QA))}}else for(let F=1;F<S.length;F++)A.lineTo(a(F),h(S[F]));A.lineTo(a(S.length-1),g/2),A.closePath();const y=A.globalAlpha;A.globalAlpha=y*(I.areaOpacity??.3),A.fillStyle=K.areaColor||"rgba(139, 92, 246, 0.2)",A.fill(),A.globalAlpha=y}if(A.beginPath(),A.strokeStyle=K.lineColor||"#3b82f6",A.lineWidth=K.lineWidth||2,A.lineJoin="round",A.lineCap="round",A.moveTo(a(0),h(S[0])),K.smoothing&&S.length>2)for(let y=0;y<S.length-1;y++){const F=S[y===0?y:y-1],e=S[y],M=S[y+1],n=S[y+1===S.length-1?y+1:y+2];for(let X=1;X<=t;X++){const Z=X/t,H=this._catmullRom(F,e,M,n,Z);A.lineTo(a(y+Z),h(H))}}else for(let y=1;y<S.length;y++)A.lineTo(a(y),h(S[y]));A.stroke(),K.showPoints&&S.forEach((y,F)=>{const e=a(F),M=h(y);A.beginPath(),A.arc(e,M,(K.pointSize||6)/2,0,Math.PI*2),A.fillStyle=K.pointFill||"#ffffff",A.fill(),A.strokeStyle=K.pointStrokeColor||K.lineColor||"#3b82f6",A.lineWidth=K.pointStrokeWidth||1,A.stroke()})}}),I.showLegend&&Q.length>0){const K=C/2-10;let S=-g/2+15;const y=I.legendFontSize||10,F=y+5;A.font=`${y}px Inter, sans-serif`,A.textAlign="right",A.textBaseline="alphabetic",Q.forEach(e=>{const n=e.label||"Series",X=A.measureText(n).width;A.beginPath(),A.rect(K-X-8-5,S-(8/2+2),8,8),A.fillStyle=e.lineColor||"#3b82f6",A.fill(),A.fillStyle=I.legendColor||"#333333",A.fillText(n,K,S),S+=F})}}_catmullRom(A,I,C,g,Q){const E=(C-A)*.5,i=(g-I)*.5,D=Q*Q,o=Q*D;return(2*I-2*C+E+i)*o+(-3*I+3*C-2*E-i)*D+E*Q+I}normalizeOpacity(A){const I=typeof A=="number"?A:parseFloat(String(A));return isNaN(I)?1:I>1?Math.min(1,I/100):Math.max(0,Math.min(1,I))}createCanvasFill(A,I,C,g){var Q,E,i;if(!I||I.type==="None")return null;if(typeof I=="string")return I;if(I.type==="Solid"&&I.color){const D=I.color,s=(((E=(Q=this.artboard)==null?void 0:Q.tokens)==null?void 0:E.colors)||{})[D]||D;return A.fillStyle=s,s}if((I.type==="LinearGradient"||I.type==="RadialGradient"||I.type==="AngularGradient"||I.type==="DiamondGradient")&&I.stops){const D=(o,s=100)=>{var M,n;const a=(((n=(M=this.artboard)==null?void 0:M.tokens)==null?void 0:n.colors)||{})[o]||o,G=this.normalizeOpacity(I.opacity??100),K=this.normalizeOpacity(s)*G;if(K>=1&&a.startsWith("#"))return a;const S=a.startsWith("#")?a.replace("#",""):"ffffff",y=parseInt(S.substring(0,2),16),F=parseInt(S.substring(2,4),16),e=parseInt(S.substring(4,6),16);return`rgba(${y}, ${F}, ${e}, ${K})`};if(I.type==="LinearGradient"){const o=(K,S,y)=>Array.isArray(K)?K[S]??(S===0?0:1):K&&typeof K=="object"?K[y]??(S===0?0:1):S===0?0:1,s=o(I.start,0,"x")*C-C/2,h=o(I.start,1,"y")*g-g/2,a=o(I.end,0,"x")*C-C/2,G=o(I.end,1,"y")*g-g/2,t=A.createLinearGradient(s,h,a,G);if(I.stops.forEach(K=>{const S=K.offset!==void 0?K.offset:K.pos!==void 0?K.pos:K.position!==void 0?K.position:0,y=D(K.color||"#000000",K.opacity??100);t.addColorStop(Math.max(0,Math.min(1,S)),y)}),I.gradientTransform&&t.setTransform){const[K,S,y,F,e,M]=I.gradientTransform;t.setTransform({a:K,b:S,c:y,d:F,e,f:M})}return t}else if(I.type==="RadialGradient"){const o=(t,K,S)=>Array.isArray(t)?t[K]??.5:t&&typeof t=="object"?t[S]??.5:.5,s=o(I.center,0,"x")*C-C/2,h=o(I.center,1,"y")*g-g/2,a=(I.radius??.5)*Math.max(C,g),G=A.createRadialGradient(s,h,0,s,h,a);if(I.stops.forEach(t=>{const K=t.offset!==void 0?t.offset:t.pos!==void 0?t.pos:t.position!==void 0?t.position:0,S=D(t.color||"#000000",t.opacity??100);G.addColorStop(Math.max(0,Math.min(1,K)),S)}),I.gradientTransform&&G.setTransform){const[t,K,S,y,F,e]=I.gradientTransform;G.setTransform({a:t,b:K,c:S,d:y,e:F,f:e})}return G}else if(I.type==="AngularGradient"){const o=(t,K,S)=>Array.isArray(t)?t[K]??.5:t&&typeof t=="object"?t[S]??.5:.5,s=o(I.center||[.5,.5],0,"x")*C-C/2,h=o(I.center||[.5,.5],1,"y")*g-g/2,a=(I.degree||I.angle||0)*(Math.PI/180),G=(i=A.createConicGradient)==null?void 0:i.call(A,a,s,h);if(G){if(I.stops.forEach(t=>{const K=t.offset!==void 0?t.offset:t.pos!==void 0?t.pos:t.position!==void 0?t.position:0,S=D(t.color||"#000000",t.opacity??100);G.addColorStop(Math.max(0,Math.min(1,K)),S)}),I.gradientTransform&&G.setTransform){const[t,K,S,y,F,e]=I.gradientTransform;G.setTransform({a:t,b:K,c:S,d:y,e:F,f:e})}return G}}else if(I.type==="DiamondGradient"){const o=(t,K,S)=>Array.isArray(t)?t[K]??.5:t&&typeof t=="object"?t[S]??.5:.5,s=o(I.center||[.5,.5],0,"x")*C-C/2,h=o(I.center||[.5,.5],1,"y")*g-g/2,a=(I.radius??.5)*Math.max(C,g);A.save(),A.translate(s,h),A.rotate(Math.PI/4);const G=A.createRadialGradient(0,0,0,0,0,a);if(I.stops.forEach(t=>{const K=t.offset!==void 0?t.offset:t.pos!==void 0?t.pos:t.position!==void 0?t.position:0,S=D(t.color||"#000000",t.opacity??100);G.addColorStop(Math.max(0,Math.min(1,K)),S)}),I.gradientTransform&&G.setTransform){const[t,K,S,y,F,e]=I.gradientTransform;G.setTransform({a:t,b:K,c:S,d:y,e:F,f:e})}return A.scale(1/Math.SQRT2,1/Math.SQRT2),A.fillStyle=G,A.restore(),G}}if(I.type==="Pattern"&&I.url){let D=this.imageCache.get(I.url);if(D||(D=new Image,D.src=I.url,this.imageCache.set(I.url,D)),D.complete&&D.naturalWidth>0){const o=A.createPattern(D,"repeat");if(o&&(I.scaleX!==void 0||I.offsetX!==void 0)){const s=new DOMMatrix,h=I.scaleX??1,a=I.scaleY??1,G=I.offsetX??0,t=I.offsetY??0,K=I.rotation??0;s.translateSelf(G,t),s.rotateSelf(K),s.scaleSelf(h,a),o.setTransform(s)}return o}}return I.color||null}drawRoundRect(A,I,C,g,Q,E){if(E===0||E===void 0||E===null){A.rect(I,C,g,Q);return}let i=E;if(typeof i=="string")try{i=JSON.parse(i)}catch{i=parseFloat(i)||0}let D=0,o=0,s=0,h=0;typeof i=="number"?D=o=s=h=i:Array.isArray(i)?i.length===1?D=o=s=h=i[0]:i.length===2?(D=s=i[0],o=h=i[1]):i.length===3?(D=i[0],o=h=i[1],s=i[2]):i.length>=4&&(D=i[0],o=i[1],s=i[2],h=i[3]):i&&typeof i=="object"&&(D=i.tl??i.corner_radius??i.cornerRadius??0,o=i.tr??i.corner_radius??i.cornerRadius??0,s=i.br??i.corner_radius??i.cornerRadius??0,h=i.bl??i.corner_radius??i.cornerRadius??0);const a=Math.min(Math.abs(g)/2,Math.abs(Q)/2);if(D=Math.min(Math.max(0,D),a),o=Math.min(Math.max(0,o),a),s=Math.min(Math.max(0,s),a),h=Math.min(Math.max(0,h),a),A.roundRect){A.roundRect(I,C,g,Q,[D,o,s,h]);return}A.moveTo(I+D,C),A.lineTo(I+g-o,C),A.arcTo(I+g,C,I+g,C+o,o),A.lineTo(I+g,C+Q-s),A.arcTo(I+g,C+Q,I+g-s,C+Q,s),A.lineTo(I+h,C+Q),A.arcTo(I,C+Q,I,C+Q-h,h),A.lineTo(I,C+D),A.arcTo(I,C,I+D,C,D),A.closePath()}renderListView(A,I){var IA,b,P,gA;const C=this.objectStates.get(I.id)||{},g=C.options||I.options||{},Q=C.width!==void 0?C.width:((IA=I.geometry)==null?void 0:IA.width)||200,E=C.height!==void 0?C.height:((b=I.geometry)==null?void 0:b.height)||300,i=-Q/2,D=-E/2,o=C.corner_radius!==void 0?C.corner_radius:g.corner_radius??0,s=g.orientation||"vertical",h=g.items||[],a=g.itemGap??10,G=g.itemHeight??50,t=g.itemWidth??200,K=g.scrollOffset??0,S=g.padding??0,y=g.glassEffect!==!1,F=g.accentColor||"#3b82f6",e=g.itemTextColor||"#333333",M=g.itemBackgroundColor||"#ffffff",n=g.hoveredIndex??null,X=g.activeItemIndex??null,Z=g.glowIntensity??0,H=g.glowColor||"#3b82f6",QA=typeof H=="string"?H:H.color||((gA=(P=H.stops)==null?void 0:P[0])==null?void 0:gA.color)||"#3b82f6",L=g.opacity!==void 0?g.opacity:I.opacity!==void 0?I.opacity:1;if(A.save(),A.globalAlpha*=L,Z>0){const u=A.getTransform(),q=Math.sqrt(u.a*u.a+u.b*u.b)||1;A.shadowColor=QA,A.shadowBlur=Z*2*q,A.shadowOffsetX=0,A.shadowOffsetY=0}if(y){const u=g.listBackgroundColor||"rgba(31, 41, 55, 0.4)",q=this.createCanvasFill(A,u,Q,E);A.fillStyle=q||"rgba(31, 41, 55, 0.4)",this.drawListViewRect(A,i,D,Q,E,o),A.fill();const l=A.createLinearGradient(i,D,i+Q,D+E);l.addColorStop(0,"rgba(255, 255, 255, 0.15)"),l.addColorStop(.5,"rgba(255, 255, 255, 0.08)"),l.addColorStop(1,"rgba(255, 255, 255, 0.03)"),A.fillStyle=l,this.drawListViewRect(A,i,D,Q,E,o),A.fill(),A.strokeStyle="rgba(255, 255, 255, 0.25)",A.lineWidth=1,this.drawListViewRect(A,i,D,Q,E,o),A.stroke()}else{const u=g.listBackgroundColor||"transparent",q=this.createCanvasFill(A,u,Q,E);q&&(A.fillStyle=q,this.drawListViewRect(A,i,D,Q,E,o),A.fill());const l=g.borderWidth??0;l>0&&(A.strokeStyle=g.borderColor||"#cccccc",A.lineWidth=l,this.drawListViewRect(A,i,D,Q,E,o),A.stroke())}A.shadowBlur=0,A.save(),this.drawListViewRect(A,i,D,Q,E,o),A.clip();const U=typeof S=="number"?S:s==="vertical"?S[0]:S[3];let T=(s==="vertical"?D:i)+K+U;if(A.textBaseline="middle",h.forEach((u,q)=>{const l=s==="vertical"?Q:t,r=s==="vertical"?G:E,z=s==="vertical"?i:T,d=s==="vertical"?T:D,_=n===q,hA=X===q;if(hA){const O=this.createCanvasFill(A,F,l,r);A.fillStyle=O||F;const Y=A.globalAlpha;A.globalAlpha=Y*.8,A.fillRect(z,d,l,r),A.globalAlpha=Y}else if(_)A.fillStyle=y?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.05)",A.fillRect(z,d,l,r);else if(M!=="transparent"){const O=this.createCanvasFill(A,M,l,r);A.fillStyle=O||M,A.fillRect(z,d,l,r)}if(hA||_){const O=this.createCanvasFill(A,F,s==="vertical"?3:l,s==="vertical"?r:3);A.fillStyle=O||F,s==="vertical"?A.fillRect(z,d,3,r):A.fillRect(z,d+r-3,l,3)}const SA=hA?"#ffffff":y?"rgba(255, 255, 255, 0.9)":e;A.fillStyle=SA,A.font=hA||_?"600 14px Inter, sans-serif":"400 14px Inter, sans-serif";const FA=typeof u=="string"?u:(u==null?void 0:u.label)||`Item ${q+1}`,NA=z+(s==="vertical"?16:l/2),m=d+r/2;s==="horizontal"?A.textAlign="center":A.textAlign="left",A.fillText(FA,NA,m),T+=(s==="vertical"?G:t)+a}),A.restore(),g.showScrollbar!==!1){const u=(h.length||0)*(s==="vertical"?G:t)+((h.length||0)-1)*a,q=s==="vertical"?E:Q;if(u>q){const l=q/u,r=q*l,z=-K/u*q,d=g.scrollbarColor||"rgba(255,255,255,0.3)",_=g.scrollbarWidth||4;A.fillStyle=d,s==="vertical"?A.fillRect(i+Q-_-2,D+z,_,r):A.fillRect(i+z,D+E-_-2,r,_)}}A.restore()}updateListViewScrollFromPointer(A){var S,y;if(!this._lastPointerPos||!this._prevPointerPos)return;const I=A.options||{},C=I.orientation||"vertical",g=this._lastPointerPos.x-this._prevPointerPos.x,Q=this._lastPointerPos.y-this._prevPointerPos.y;C==="vertical"?I.scrollOffset=(I.scrollOffset||0)+Q:I.scrollOffset=(I.scrollOffset||0)+g;const E=this.objectStates.get(A.id)||{},i=I.items||[],D=I.itemGap??10,o=I.itemHeight??50,s=I.itemWidth??200,h=E.width!==void 0?E.width:((S=A.geometry)==null?void 0:S.width)||200,a=E.height!==void 0?E.height:((y=A.geometry)==null?void 0:y.height)||300,G=(i.length||0)*(C==="vertical"?o:s)+((i.length||0)-1)*D,K=Math.max(0,G-(C==="vertical"?a:h)+(I.padding*2||0));I.scrollOffset>0&&(I.scrollOffset=0),I.scrollOffset<-K&&(I.scrollOffset=-K)}updateListViewHoverFromPointer(A,I,C){const g=this.getListViewItemIndexAtPointer(A,I,C),Q=A.options||{};Q.hoveredIndex!==g&&(Q.hoveredIndex=g)}getListViewItemIndexAtPointer(A,I,C){var U,T;const g=A.options||{},Q=this.objectStates.get(A.id)||{},E=g.items||[];if(E.length===0)return null;const i=Q.width!==void 0?Q.width:((U=A.geometry)==null?void 0:U.width)||200,D=Q.height!==void 0?Q.height:((T=A.geometry)==null?void 0:T.height)||300,o=g.orientation||"vertical",s=g.itemGap??10,h=g.itemHeight??50,a=g.itemWidth??200,G=g.scrollOffset??0,t=g.padding??0,K=this.getWorldTransform(A.id),S=I-K.x,y=C-K.y,F=-K.rotation*(Math.PI/180),e=Math.cos(F),M=Math.sin(F),n=S*e-y*M,X=S*M+y*e,Z=-i/2,H=-D/2,QA=typeof t=="number"?t:o==="vertical"?t[0]:t[3];let L=(o==="vertical"?H:Z)+G+QA;for(let AA=0;AA<E.length;AA++){const IA=o==="vertical"?i:a,b=o==="vertical"?h:D,P=o==="vertical"?Z:L,gA=o==="vertical"?L:H;if(n>=P&&n<=P+IA&&X>=gA&&X<=gA+b)return AA;L+=(o==="vertical"?h:a)+s}return null}drawListViewRect(A,I,C,g,Q,E){A.beginPath(),this.drawRoundRect(A,I,C,g,Q,E),A.fill()}solveBehaviors(A){if(!this.artboard)return;if(!this._lastPointerPos){this.frameCount%60;return}const{x:I,y:C}=this._lastPointerPos;this.artboard.objects.forEach(g=>{if(!g.behaviors||g.behaviors.length===0)return;const Q=this.objectStates.get(g.id);Q&&g.behaviors.forEach(E=>{var a,G,t,K,S,y,F,e,M,n,X,Z,H,QA,L,U,T,AA,IA,b,P,gA,u,q,l,r,z,d,_,hA,SA,FA,NA,m,O,Y,R,x,j,GA,CA,wA,kA,BA;if(!E.enabled)return;const i=E.startTime||0,D=E.endTime||1/0;if(this.currentTime<i||this.currentTime>D)return;const o=Q.x-I,s=Q.y-C,h=Math.sqrt(o*o+s*s);if(this.frameCount%240===0&&Math.random()<.1&&console.log(`[ExodeUI] Executing ${E.type} on ${g.name}`),E.type===W.Proximity){const N=((a=E.settings)==null?void 0:a.radius)||300,f=((G=E.settings)==null?void 0:G.falloff)||"smooth";let p=0;h<N&&(f==="linear"?p=1-h/N:p=Math.pow(1-h/N,2)),p>0&&E.sensors.forEach(oA=>{this.applyBehaviorSensor(Q,oA,p,A,E.settings)})}else if(E.type===W.Magnetic){const N=((t=E.settings)==null?void 0:t.radius)||400,f=((K=E.settings)==null?void 0:K.strength)||.5;if(h<N&&h>5){const p=1-h/N,oA=o*p*f,UA=s*p*f;Q.x-=oA*A*10,Q.y-=UA*A*10}}else if(E.type===W.Repel){const N=((S=E.settings)==null?void 0:S.radius)||300,f=((y=E.settings)==null?void 0:y.strength)||1;if(h<N){const p=Math.pow(1-h/N,2);Q.x+=o/(h||1)*p*60*f*A*5,Q.y+=s/(h||1)*p*60*f*A*5}}else if(E.type===W.Orbit){const N=((F=E.settings)==null?void 0:F.speed)||1,f=((e=E.settings)==null?void 0:e.radius)||30,p=this.currentTime*N*Math.PI*2;Q.x+=Math.cos(p)*f*A*5,Q.y+=Math.sin(p)*f*A*5,Q.rotation+=2*A*5}else if(E.type===W.Vortex){const N=((M=E.settings)==null?void 0:M.radius)||400,f=((n=E.settings)==null?void 0:n.speed)||2,p=((X=E.settings)==null?void 0:X.strength)||1;if(h<N){const oA=Math.pow(1-h/N,1.5),UA=this.currentTime*f*Math.PI*2,iA=Math.cos(UA)*30-o*.4,V=Math.sin(UA)*30-s*.4;Q.x+=iA*oA*p*A*5,Q.y+=V*oA*p*A*5,Q.rotation+=5*oA*p*A*5,Q.scale_x*=1-oA*.1*p*A,Q.scale_y*=1-oA*.1*p*A}}else if(E.type===W.Fluid){const N=((Z=E.settings)==null?void 0:Z.radius)||300,f=((H=E.settings)==null?void 0:H.strength)||1;if(h<N){const p=Math.pow(1-h/N,1.2),oA=o/(h||1)*p*1.2*f,UA=s/(h||1)*p*1.2*f;Q.x+=oA*10*A*5,Q.y+=UA*10*A*5,Q.scale_x*=1+p*.3*f*A,Q.scale_y*=1+p*.3*f*A}}else if(E.type===W.Elastic){const N=((QA=E.settings)==null?void 0:QA.radius)||300,f=((L=E.settings)==null?void 0:L.strength)||1;if(h<N){const p=1-h/N;Q.scale_x*=1+p*.4*f*A,Q.scale_y*=1+p*.4*f*A}}else if(E.type===W.Holographic){const N=Q.x-this.canvasWidth/2,f=Q.y-this.canvasHeight/2,p=((U=E.settings)==null?void 0:U.factor)||25;if(Q.x-=N/1e3*p*A*5,Q.y-=f/1e3*p*A*5,Q.style){const oA=1-Math.min(1,h/400);Q.style.exposure=(Q.style.exposure||1)+oA*.5*A}}else if(E.type===W.Sticky){const N=((T=E.settings)==null?void 0:T.radius)||80,f=((AA=E.settings)==null?void 0:AA.strength)||1;if(h<N){const p=Math.pow(1-h/N,2);Q.x-=o*p*f*A*10,Q.y-=s*p*f*A*10,Q.scale_x*=1-p*.1*f*A,Q.scale_y*=1-p*.1*f*A}}else if(E.type===W.Dilation){const N=((IA=E.settings)==null?void 0:IA.size)||120,f=((b=E.settings)==null?void 0:b.strength)||1;if(h<N){const p=1-h/N;Q.scale_x*=1+p*.5*f*A,Q.scale_y*=1+p*.5*f*A}}else if(E.type===W.Parallax){const N=((P=E.settings)==null?void 0:P.factor)||.05,f=this.canvasHeight/2,p=(this._lastPointerPos.y-f)*N;Q.y+=p*A*10}else if(E.type===W.Noise||E.type===W.Float){const N=(((gA=E.settings)==null?void 0:gA.frequency)||((u=E.settings)==null?void 0:u.speed)||1)*.002,f=(((q=E.settings)==null?void 0:q.amplitude)||((l=E.settings)==null?void 0:l.range)||50)*(((r=E.settings)==null?void 0:r.strength)||1),p=Date.now();Q.x+=Math.sin(p*N)*f*A,Q.y+=Math.cos(p*N*.8)*f*A,Q.rotation+=Math.sin(p*N*.5)*5*A}else if(E.type===W.Pulse){const N=(((z=E.settings)==null?void 0:z.speed)||1)*.005,f=(((d=E.settings)==null?void 0:d.scale)||1.2)-1,p=Math.sin(Date.now()*N),oA=((_=E.settings)==null?void 0:_.strength)||1;Q.scale_x*=1+p*f*oA*A,Q.scale_y*=1+p*f*oA*A,Q.style&&(Q.style.exposure=(Q.style.exposure||1)+Math.max(0,p)*.1*oA*A)}else if(E.type===W.Draggable){const N=((hA=E.settings)==null?void 0:hA.radius)||150,f=this.draggingBehaviors.has(g.id);if(h<N||f){const p=((SA=E.settings)==null?void 0:SA.strength)||1,oA=f?1:Math.max(0,1-h/N);this.applyBehaviorSensor(Q,mA.PositionX,oA*p,A,E.settings),this.applyBehaviorSensor(Q,mA.PositionY,oA*p,A,E.settings)}}else if(E.type===W.Scroll){const N=((FA=E.settings)==null?void 0:FA.axis)||"vertical",f=((NA=E.settings)==null?void 0:NA.factor)||.5,p=((m=E.settings)==null?void 0:m.strength)||1;(N==="vertical"||N==="both")&&(Q.y+=this.scrollOffset.y*f*p*A),(N==="horizontal"||N==="both")&&(Q.x+=this.scrollOffset.x*f*p*A)}else if(E.type===W.LookAt){const N=((O=E.settings)==null?void 0:O.factor)||1,f=((Y=E.settings)==null?void 0:Y.strength)||1,p=Math.atan2(-s,-o)*(180/Math.PI),oA=Q.rotation,UA=(p-oA+180)%360-180;Q.rotation+=UA*N*f*A*10}else if(E.type===W.Glint||E.type===W.Scan){const N=(((R=E.settings)==null?void 0:R.speed)||1)*.004,f=((x=E.settings)==null?void 0:x.strength)||1,p=(Math.sin(Date.now()*N)+1)/2;Q.style&&(Q.style.exposure=(Q.style.exposure||1)+p*f*A*5),Q.x+=(p-.5)*20*f*A}else if(E.type===W.Ratchet){const N=((j=E.settings)==null?void 0:j.steps)||12,f=(((GA=E.settings)==null?void 0:GA.speed)||1)*30,p=Math.floor(Q.rotation/(360/N))*(360/N);Q.rotation=this.lerp(Q.rotation,p+f*A,.1)}else if(E.type===W.Jitter&&h<300){const N=((CA=E.settings)==null?void 0:CA.strength)||1,f=(((wA=E.settings)==null?void 0:wA.intensity)||5)*N;Q.x+=(Math.random()-.5)*f*A*60,Q.y+=(Math.random()-.5)*f*A*60,Q.rotation+=(Math.random()-.5)*f*A*120}else if(E.type===W.Follower){const N=(kA=E.settings)==null?void 0:kA.targetId;if(N){const f=this.objectStates.get(N);if(f){const p=((BA=E.settings)==null?void 0:BA.stiffness)||.1,oA=f.x-Q.x,UA=f.y-Q.y;Q.x+=oA*p*A*60,Q.y+=UA*p*A*60}}}else E.type===W.Wrap&&(Q.x<0?Q.x=this.canvasWidth:Q.x>this.canvasWidth&&(Q.x=0),Q.y<0?Q.y=this.canvasHeight:Q.y>this.canvasHeight&&(Q.y=0))})})}applyBehaviorSensor(A,I,C,g,Q){const E=(Q==null?void 0:Q.intensity)||(Q==null?void 0:Q.strength)||1,i=C*E*g;switch(I){case mA.Scale:A.scale_x*=1+i*.5,A.scale_y*=1+i*.5;break;case mA.Opacity:A.opacity=Math.max(0,Math.min(100,A.opacity-i*100));break;case mA.RotateZ:A.rotation+=i*180;break;case mA.RotateX:A.rotate_x=(A.rotate_x||0)+i*180;break;case mA.RotateY:A.rotate_y=(A.rotate_y||0)+i*180;break;case mA.PositionX:A.x+=i*300;break;case mA.PositionY:A.y+=i*300;break;case mA.SkewX:A.skew_x=(A.skew_x||0)+i*45;break;case mA.Blur:A.style||(A.style={}),A.style.blur=Math.min(100,(A.style.blur||0)+i*50);break;case mA.Exposure:A.style||(A.style={}),A.style.exposure=(A.style.exposure||1)+i*2;break;case mA.HueShift:A.style||(A.style={}),A.style.hue=(A.style.hue||0)+i*360;break;case mA.CornerRadius:A.corner_radius=Math.min(200,(A.corner_radius||0)+i*100);break;case mA.LetterSpacing:A.geometry||(A.geometry={}),A.geometry.letterSpacing=(A.geometry.letterSpacing||0)+i*10;break}}lerp(A,I,C){return A*(1-C)+I*C}deepMerge(A,I){if(!A)return I;if(!I)return A;if(typeof A!="object"||typeof I!="object"||A===null||I===null)return I;const C={...A};for(const g in I)Object.prototype.hasOwnProperty.call(I,g)&&(I[g]&&typeof I[g]=="object"&&!Array.isArray(I[g])?C[g]=this.deepMerge(A[g],I[g]):C[g]=I[g]);return C}}const OQ=({artboard:B,config:A})=>{const I={...B.seo,...A},C=I.enableSmartExtraction!==!1;eA.useEffect(()=>{const i=I.title||B.name;i&&(document.title=i);let D=I.description;if(!D&&C){const h=B.objects.filter(a=>a.geometry.type==="Text").sort((a,G)=>{var t,K;return(((t=G.geometry.text)==null?void 0:t.length)||0)-(((K=a.geometry.text)==null?void 0:K.length)||0)});h.length>0&&(D=h[0].geometry.text)}D&&(g("name","description",D),g("property","og:description",D)),I.keywords&&I.keywords.length>0&&g("name","keywords",I.keywords.join(", "));const o=I.ogImage||B.backgroundImage;o&&g("property","og:image",o),i&&g("property","og:title",i),g("property","og:type","website")},[I,B,C]);const g=(i,D,o)=>{let s=document.querySelector(`meta[${i}="${D}"]`);s||(s=document.createElement("meta"),s.setAttribute(i,D),document.head.appendChild(s)),s.setAttribute("content",o)},Q=()=>{const i=[];return i.push(HA.jsx("h1",{children:I.title||B.name},"artboard-title")),B.objects.forEach((o,s)=>{if(!(!o.visible&&o.isVisible!==!0))if(o.geometry.type==="Text"){const h=o.geometry.text;h&&(o.geometry.fontSize>24?i.push(HA.jsx("h2",{children:h},o.id||s)):i.push(HA.jsx("p",{children:h},o.id||s)))}else if(o.geometry.type==="Image"){const h=o.geometry.src,a=o.altText||o.name||"Illustration";i.push(HA.jsx("img",{src:h,alt:a},o.id||s))}else o.type==="Button"&&i.push(HA.jsx("button",{children:o.name||"Button"},o.id||s))}),i},E=I.jsonLd||{"@context":"https://schema.org","@type":"VisualArtwork",name:I.title||B.name,description:I.description,image:I.ogImage||B.backgroundImage,abstract:"Animated interface created with ExodeUI"};return HA.jsxs("div",{id:`exode-seo-${B.id||"default"}`,"aria-hidden":"false",style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0",zIndex:-1},children:[Q(),HA.jsx("script",{type:"application/ld+json",children:JSON.stringify(E)})]})},Ai=eA.forwardRef(({artboard:B,src:A,className:I,style:C,autoPlay:g=!0,fit:Q="Contain",alignment:E="Center",enableSEO:i=!0,seo:D,onReady:o,onTrigger:s,onInputUpdate:h,onComponentChange:a,onToggle:G,onInputChange:t,onInputFocus:K,onInputBlur:S,onLog:y},F)=>{const e=eA.useRef(null),M=eA.useRef(new xQ),n=eA.useRef(),X=eA.useRef(0),Z=eA.useRef(null),[H,QA]=eA.useState(B||null);eA.useImperativeHandle(F,()=>e.current),eA.useEffect(()=>{console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"),M.current.setLayout(Q,E)},[Q,E]),eA.useEffect(()=>{s&&M.current.setTriggerCallback(s)},[s]),eA.useEffect(()=>{h&&M.current.setInputUpdateCallback(h)},[h]),eA.useEffect(()=>{a&&M.current.setComponentChangeCallback(a)},[a]),eA.useEffect(()=>{G&&M.current.setToggleCallback(G)},[G]),eA.useEffect(()=>{t&&M.current.setInputChangeCallback(t)},[t]),eA.useEffect(()=>{K&&M.current.setInputFocusCallback(K)},[K]),eA.useEffect(()=>{S&&M.current.setInputBlurCallback(S)},[S]),eA.useEffect(()=>{(async()=>{const T=M.current;let AA=B;if(!AA&&A)try{AA=await(await fetch(A)).json()}catch(IA){console.error("Failed to load ExodeUI animation:",IA);return}if(AA){const IA=AA.id||AA.name||"default";Z.current!==IA&&(T.load(AA),Z.current=IA,QA(AA),X.current=0),o&&o(T)}})()},[B,A]),eA.useEffect(()=>{const U=M.current,T=e.current;if(!T)return;const AA=T.getContext("2d");if(!AA)return;AA.imageSmoothingEnabled=!0,AA.imageSmoothingQuality="high",y&&U.setOnLogCallback(y);const IA=P=>{X.current||(X.current=P);const gA=(P-X.current)/1e3;X.current=P,g&&U.advance(gA);const u=window.devicePixelRatio||1,q=T.getBoundingClientRect(),l=Math.floor(q.width*u),r=Math.floor(q.height*u);(T.width!==l||T.height!==r)&&(T.width=l,T.height=r),U.render(AA,l,r),n.current=requestAnimationFrame(IA)};n.current=requestAnimationFrame(IA);const b=()=>{U.handleScroll(window.scrollX,window.scrollY)};return window.addEventListener("scroll",b,{passive:!0}),()=>{n.current&&cancelAnimationFrame(n.current),window.removeEventListener("scroll",b)}},[g]);const L=(U,T)=>{const AA=U.currentTarget.getBoundingClientRect(),IA=U.clientX-AA.left,b=U.clientY-AA.top,P=AA.width,gA=AA.height;M.current.handlePointerInput(T,IA,b,P,gA)};return HA.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",...C},className:I,children:[HA.jsx("canvas",{ref:e,style:{width:"100%",height:"100%",outline:"none"},tabIndex:0,onPointerDown:U=>{var T;L(U,"down"),(T=e.current)==null||T.focus()},onPointerUp:U=>L(U,"up"),onPointerMove:U=>L(U,"move"),onPointerLeave:U=>L(U,"blur"),onClick:U=>L(U,"click"),onKeyDown:U=>{U.key==="Backspace"||U.key==="Enter"||U.key,M.current.handleKeyDown(U.nativeEvent)}}),i&&H&&HA.jsx(OQ,{artboard:H,config:D})]})});function Ii(){const[B,A]=eA.useState(null),I=eA.useCallback((h,a)=>{B==null||B.setInputBool(h,a)},[B]),C=eA.useCallback((h,a)=>{B==null||B.setInputNumber(h,a)},[B]),g=eA.useCallback(h=>{B==null||B.fireTrigger(h)},[B]),Q=eA.useCallback((h,a)=>{B==null||B.setInputText(h,a)},[B]),E=eA.useCallback((h,a)=>{B==null||B.setInputNumberArray(h,a)},[B]),i=eA.useCallback((h,a)=>{B==null||B.setInputStringArray(h,a)},[B]),D=eA.useCallback((h,a)=>{B==null||B.updateObjectOptions(h,a)},[B]),o=eA.useCallback((h,a,G)=>{B==null||B.updateConstraint(h,a,G)},[B]),s=eA.useCallback((h,a)=>{B==null||B.updateGraphData(h,a)},[B]);return{setEngine:A,engine:B,setInputBool:I,setInputNumber:C,fireTrigger:g,setInputText:Q,setInputNumberArray:E,setInputStringArray:i,updateConstraint:o,updateGraphData:s,updateObjectOptions:D}}const gi="6.0.30";pA.BehaviorSensor=mA,pA.BehaviorType=W,pA.ConditionOp=tC,pA.ExodeSEO=OQ,pA.ExodeUICanvas=Ai,pA.ExodeUIEngine=xQ,pA.LogicOp=NI,pA.VERSION=gi,pA.useExodeUI=Ii,Object.defineProperty(pA,Symbol.toStringTag,{value:"Module"})});
package/dist/index.mjs CHANGED
@@ -9436,7 +9436,7 @@ function ai() {
9436
9436
  updateObjectOptions: D
9437
9437
  };
9438
9438
  }
9439
- const Gi = "6.0.28";
9439
+ const Gi = "6.0.30";
9440
9440
  export {
9441
9441
  TA as BehaviorSensor,
9442
9442
  j as BehaviorType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exodeui",
3
- "version": "6.0.29",
3
+ "version": "6.0.30",
4
4
  "description": "React Runtime for ExodeUI Animation Engine",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",