@cntrl-site/components 1.0.69-alpha.2 → 1.0.69-alpha.3
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/Components/Pretext/Pretext.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.mjs +8 -8
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonComponentProps } from '../props';
|
|
2
2
|
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
|
-
export declare const SHAPE_IDS: readonly ["
|
|
3
|
+
export declare const SHAPE_IDS: readonly ["diamond", "parallelogram", "vase", "circle", "shield", "bobbin", "custom"];
|
|
4
4
|
export type ShapeId = typeof SHAPE_IDS[number];
|
|
5
5
|
type Align = 'left' | 'center' | 'right' | 'justify';
|
|
6
6
|
type PathFit = 'stretch' | 'viewbox';
|
package/dist/index.js
CHANGED
|
@@ -23607,7 +23607,7 @@ export function Helix({
|
|
|
23607
23607
|
</>
|
|
23608
23608
|
);
|
|
23609
23609
|
}
|
|
23610
|
-
`,Iw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],Lw={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:Iw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},Pw={element:Tw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:Lw,sourceCode:Rw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,Pc=120,Ec=3,Ew=.12,Xa=.25,Mw=10,Aw=4e3,kw=.12,Fw=1,_w=2,bu=["bobbin","circle","shield","vase","parallelogram","diamond","custom"];function jr(e){return e<0?0:e>1?1:e}function Mc(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function Nw(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function Hw(e){return e.map(([t,n])=>({x:t,y:n}))}function Ya(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}const il={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"};function ps(e){const t=e==="rectangle"||e==="custom"?void 0:il[e];return t?ko(da(si(t)),ca):[Hw([[0,0],[1,0],[1,1],[0,1]])]}const ca={x:0,y:0,width:100,height:100};function Ww(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?ca:{x:t[0],y:t[1],width:t[2],height:t[3]}}function ko(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function Ac(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))}function Dw(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function qa(e,t){return rn(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function Ow(e){const t=ei(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:rn(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function Bw(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return rn(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function kc(e,t,n,i,o,r){let l=[];if(t&&t.length)l=qa(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=si(d);c.length&&(l=n==="viewbox"?qa(c,i):Ow(c))}if(!l.length){const c=o!=="custom"?il[o]:void 0;c?l=qa(si(c),ca):l=Dw()}}return o==="circle"?Bw(l,r):l}function Fc(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":uo(rn(e,n=>({x:n.x*t.width,y:n.y*t.height})))}const ms=16,zw=12,jw=16,gs="0 0 100 100",Vr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Vw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Gw(e){const t=e.match(Vw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function hn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function hs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function Xw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function En(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Xw)}))}function rn(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function _c(e,t,n,i=n){return rn(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Yw(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),b=Math.sin(u),y=(e.x-l.x)/2,g=(e.y-l.y)/2,h=p*y+b*g,f=-b*y+p*g,v=h*h/(d*d)+f*f/(c*c);if(v>1){const ne=Math.sqrt(v);d*=ne,c*=ne}const S=o===r?-1:1,x=d*d*f*f+c*c*h*h,w=Math.max(0,d*d*c*c-x),D=x===0?0:S*Math.sqrt(w/x),W=D*d*f/c,K=-D*c*h/d,B=p*W-b*K+(e.x+l.x)/2,$=b*W+p*K+(e.y+l.y)/2,V=Math.atan2((f-K)/c,(h-W)/d);let P=Math.atan2((-f-K)/c,(-h-W)/d)-V;!r&&P>0&&(P-=Math.PI*2),r&&P<0&&(P+=Math.PI*2);const _=Math.max(1,Math.ceil(Math.abs(P)/(Math.PI/2))),R=P/_,m=4/3*Math.tan(R/4),M=(ne,L)=>({x:B+p*d*ne-b*c*L,y:$+b*d*ne+p*c*L}),E=[];let z=V;for(let ne=0;ne<_;ne+=1){const L=z+R,H=Math.cos(z),J=Math.sin(z),ie=Math.cos(L),ce=Math.sin(L);E.push({c1:M(H-m*J,J+m*H),c2:M(ie+m*ce,ce-m*ie),p:ne===_-1?on(l):M(ie,ce)}),z=L}return E}function si(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const g=i[0],h=i[i.length-1];Math.abs(g.p.x-h.p.x)<1e-6&&Math.abs(g.p.y-h.p.y)<1e-6&&(g.in=h.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,h)=>{i.push({p:g,in:kn(h??null,g),out:null}),r=g},b=g=>{if(!i.length)return;const h=i[i.length-1];h.out=kn(g,h.p)};Ua.lastIndex=0;let y=Ua.exec(t);for(;y!==null;){const g=y[1],h=g.toUpperCase(),f=g!==h,v=Gw(y[2]),S=x=>f?{x:r.x+v[x],y:r.y+v[x+1]}:{x:v[x],y:v[x+1]};if(h==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(h==="M"){for(let x=0;x+1<v.length;x+=2){const w=S(x);x===0&&(u(),l=on(w)),p(w)}d=null,c=null}else if(h==="L"){for(let x=0;x+1<v.length;x+=2)p(S(x));d=null,c=null}else if(h==="H"){for(const x of v)p({x:f?r.x+x:x,y:r.y});d=null,c=null}else if(h==="V"){for(const x of v)p({x:r.x,y:f?r.y+x:x});d=null,c=null}else if(h==="C"){for(let x=0;x+5<v.length;x+=6){const w=S(x),D=S(x+2),W=S(x+4);b(w),p(W,D),d=D}c=null}else if(h==="S"){for(let x=0;x+3<v.length;x+=4){const w=d?hs(d,r):on(r),D=S(x),W=S(x+2);b(w),p(W,D),d=D}c=null}else if(h==="Q")for(let x=0;x+3<v.length;x+=4){const w=S(x),D=S(x+2);b(hn(r,w,2/3)),p(D,hn(D,w,2/3)),c=w,d=null}else if(h==="T")for(let x=0;x+1<v.length;x+=2){const w=c?hs(c,r):on(r),D=S(x);b(hn(r,w,2/3)),p(D,hn(D,w,2/3)),c=w,d=null}else if(h==="A")for(let x=0;x+6<v.length;x+=7){const w=f?{x:r.x+v[x+5],y:r.y+v[x+6]}:{x:v[x+5],y:v[x+6]};for(const D of Yw(r,v[x],v[x+1],v[x+2],v[x+3]!==0,v[x+4]!==0,w))b(D.c1),p(D.p,D.c2);d=null,c=null}y=Ua.exec(t)}return u(),n}function Ln(e){return`${Number(e.toFixed(2))}`}function kn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function wu(e){return!!(kn(e.in,e.p)||kn(e.out,e.p))}function tr(e,t){return!kn(e.out,e.p)&&!kn(t.in,t.p)}function Nc(e,t){if(tr(e,t))return`L${Ln(t.p.x)},${Ln(t.p.y)}`;const n=kn(e.out,e.p)??e.p,i=kn(t.in,t.p)??t.p;return`C${Ln(n.x)},${Ln(n.y)} ${Ln(i.x)},${Ln(i.y)} ${Ln(t.p.x)},${Ln(t.p.y)}`}function uo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Ln(i.p.x)},${Ln(i.p.y)}`);let r=i;for(const l of o)t.push(Nc(r,l)),r=l;if(n.closed){const l=Nc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Su(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function fs(e,t,n){if(tr(e,t))return hn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function da(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Su(n)){if(tr(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ms;r+=1)i.push(fs(o.from,o.to,r/ms))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function ei(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of da(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function qw(e){const t=ei(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Cu(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function $u(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=zw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/jw)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:on(r),...Cu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Tu(e,t,n=1){if(!e.length)return!1;const i=ei(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function Uw(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:rn(e,u=>{const p=i+(u.x-t.x)*r,b=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+b/c}})}function Kw(e,t){if(!e.length)return e;const n=ei(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return rn(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Ru(e){const t={x:0,y:0,width:Vr,height:Vr},n=e!=="custom"?il[e]:void 0,i=n?rn(si(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):rn($u(ps("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=Kw(i,t);return{shape:e,customPath:uo(o),pathFit:"viewbox",pathViewBox:gs}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function Zw(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,d=En(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Hc(e,t,n,i){var r;if(!t.length)return e;const o=En(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function Jw(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=Iu(i,r,d)}),i}function Qw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=En(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=hs(o,c.p)}return d}function eS(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=En(e);return r[t].nodes[n][i]=null,r}function tS(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const d=En(e),c=d[t].nodes,u=n+1;if(tr(r,l))return c.splice(u,0,{p:hn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,b=l.in??l.p,y=hn(r.p,p,i),g=hn(p,b,i),h=hn(b,l.p,i),f=hn(y,g,i),v=hn(g,h,i),S=hn(f,v,i),x=(n+1)%o.nodes.length;return c[n].out=y,c[x].in=h,c.splice(u,0,{p:S,in:f,out:v}),{contours:d,nodeIndex:u}}function Iu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=En(e);return o[t].nodes.splice(n,1),o}function Wc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=En(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,b=!!kn(l[u].out,l[u].p),y=!!kn(l[p].in,l[p].p);if(wu(d)||b||y)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const g=Cu(l[u].p,d.p,l[p].p);return d.in=g.in,d.out=g.out,r}function nS(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function iS(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Su(i)){const l=tr(r.from,r.to)?1:ms;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=nS(t,fs(r.from,r.to,c),fs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function oS(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Dc(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Oc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}const Bc=Math.PI/4,rS=8,aS=Math.PI/18,sS=8,Vi=24,Gi=[];function lS(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function cS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function ys(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function dS(e,t){const n=ys(e,t);return n?{kind:"align",a:{x:e.x-n.x*Vi,y:e.y-n.y*Vi},b:{x:t.x+n.x*Vi,y:t.y+n.y*Vi}}:{kind:"align",a:e,b:t}}function xs(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function zc(e,t,n,i,o){if(e.axis===null)return dS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return xs(o(r)[t],t,i)}function uS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(zc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(zc(n,"y",l,i,o)),r}function pS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return ys(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return ys(i(p),r)}function mS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,b=Math.hypot(u,p);if(b<1e-6)return{point:e,guides:Gi};const y=Math.atan2(p,u),g=Math.round(y/Bc)*Bc;let h=o?g:null,f=!1;if(!o){const K=[];n&&K.push({angle:Math.atan2(n.y,n.x),smooth:!0}),K.push({angle:g,smooth:!1});for(const B of K){const $=cS(B.angle-y);if(!(Math.abs($)>aS)&&!(Math.abs(Math.sin($))*b>rS)){h=B.angle,f=B.smooth;break}}}const v=i!==null&&i>0&&Math.abs(b-i)<=sS;if(h===null&&!v)return{point:e,guides:Gi};const S=h??y,x=v?i:b,w={x:Math.cos(S),y:Math.sin(S)},D=x+(h===null?0:Vi),W=v?x:f?Vi:0;return{point:l({x:d.x+w.x*x,y:d.y+w.y*x}),guides:[{kind:"angle",a:{x:d.x-w.x*W,y:d.y-w.y*W},b:{x:d.x+w.x*D,y:d.y+w.y*D}}]}}function jc(e,t="stretch",n=ca){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=si(i),d=da(l);if(d.length)return t==="viewbox"?ko(d,n):Ya(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",b),u.appendChild(y);let g=0;try{g=y.getTotalLength()}catch{g=0}if(!g)continue;const h=[];for(let f=0;f<Pc;f+=1){const v=y.getPointAtLength(f/Pc*g);h.push({x:v.x,y:v.y})}p.push(h)}return p.length?t==="viewbox"?ko(p,n):Ya(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?ko([r],n):Ya([r])}function gS(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=jr(n[o]),l=jr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return hS(i)}function hS(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function fS(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function yS(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function xS(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function vS(e,t,n,i){let o=null;for(let r=0;r<Ec;r+=1){const l=jr(t+(n-t)*r/Math.max(1,Ec-1)),d=gS(e,l),c=i==="avoid"?yS(d):d;if(o=o===null?c:fS(o,c),o.length===0)return[]}return o??[]}function Lu(e){return!!e&&typeof e=="object"&&e.type==="link"}const bS=/^(?:https?:|mailto:|tel:)/i;function wS(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!bS.test(t)))return t}function SS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Lu(c)){o(c.children??[],wS(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Vc(e){return{...e.fontFamily&&{fontFamily:ho(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}function CS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Lu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Gc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,y=e.lineHeight*l,g=e.spaceWidth*l,h=[];if(!t.length||d<=0||y<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,g*.5),v=y*Ew;let S=0,x=0,w=0,D=t[0].para,W=0,K=0,B=null;for(;S<t.length&&w<Aw;){const $=x+y>c;if($&&!u)break;const V=t[S].para;if(V>D+1){x+=y*(V-D-1),D=V-1,w+=1;continue}let C=$?[{x0:0,x1:d}]:vS(i,(x+v)/c,(x+y-v)/c,o).map(_=>({x0:_.x0*d,x1:_.x1*d}));p>0&&b>0&&!$&&C.length&&(B===null&&(B=w,W=C[0].x0,K=x),w-B<b&&(C=xS(C,{x0:W,x1:W+p})));const P=C.reduce((_,R)=>Math.max(_,R.x1-R.x0),0);for(const _ of C){const R=_.x1-_.x0;if(R<f)continue;if(S>=t.length||t[S].para!==V)break;const m=S;let M=0;for(;S<t.length&&t[S].para===V;){const E=n[S]*l,z=S===m?E:g+E;if(M+z>R&&!(S===m&&R>=P-.5&&E>d-.5))break;M+=z,S+=1}if(S>m){const E=S>=t.length||t[S].para!==V;h.push({top:x,left:_.x0,width:R,from:m,to:S,justify:r==="justify"&&!E})}if(S>=t.length||t[S].para!==V)break}D=V,x+=y,w+=1}return{segments:h,placed:S,height:h.length?x:0,capLeft:W,capTop:K}}function $S(e){return`
|
|
23610
|
+
`,Iw=["https://cdn.cntrl.site/component-assets/Helix-default-1.png","https://cdn.cntrl.site/component-assets/Helix-default-2.png","https://cdn.cntrl.site/component-assets/Helix-default-3.png","https://cdn.cntrl.site/component-assets/Helix-default-4.png","https://cdn.cntrl.site/component-assets/Helix-default-5.png"],Lw={type:"object",version:1,content:{type:"array",settings:{addItemFromFileExplorer:!0,deleteImageDeletesEntry:!0,allowsVideo:!0},display:{type:"array"},items:{type:"object",properties:{image:{type:"object",label:"Image",display:{isObjectFitEditable:!1,type:"media-input"},properties:{url:{type:"string"},name:{type:"string"},type:{type:"string",enum:["image","video"]}}}}},default:Iw.map(e=>({image:{url:e,name:""}}))},settings:{sizing:"auto auto",properties:{width:{type:"number",scope:"layout",title:"Width",display:{type:"numeric-input"},min:0,max:9999},imageWidth:{type:"number",scope:"layout",title:"Img width",display:{type:"numeric-input"},min:0,max:9999},turnHeight:{type:"number",scope:"layout",title:"Turn height",display:{type:"numeric-input"},min:0,max:9999},itemsPerTurn:{type:"number",scope:"common",title:"Per turn",display:{type:"common-numeric-input"},min:3,max:40},turns:{type:"number",scope:"common",title:"Turns",display:{type:"common-numeric-input"},min:1,max:30},speed:{type:"number",scope:"layout",title:"Speed",display:{type:"speed-control"},min:0,max:7},direction:{type:"string",scope:"common",title:"Direction",display:{type:"direction-control"},enum:["left","right"]},playback:{type:"string",scope:"common",title:"Playback",display:{type:"toggle-cycle",enum:["autoplay","scroll"]}},imageDisplay:{type:"object",scope:"common",title:"Display",display:{type:"image-ratio-control"},properties:{display:{type:"string",enum:["fit","cover"]},ratioValue:{type:"string",enum:["1:1","2:3","3:4","4:5","16:9"]},reversed:{type:"boolean"}}},cornerRadius:{type:"number",scope:"layout",title:"Corner radius",display:{type:"numeric-input"},min:0,max:9999},blur:{type:"string",scope:"common",title:"Blur",display:{type:"toggle-cycle",enum:["on","off"]}}},defaults:{itemsPerTurn:14,turns:3,direction:"right",playback:"autoplay",blur:"off",imageDisplay:{display:"cover",ratioValue:"2:3",reversed:!1}},layoutDefaults:{d:{defaultPaddingTop:30/1440,width:800/1440,imageWidth:160/1440,turnHeight:380/1440,speed:2.2,cornerRadius:0},m:{defaultPaddingTop:10/375,width:320/375,imageWidth:75/375,turnHeight:310/375,speed:2.8,cornerRadius:0},t:{defaultPaddingTop:20/768,width:620/768,imageWidth:100/768,turnHeight:280/768,speed:2.8,cornerRadius:0}},layout:["__componentName__","width","imageWidth","turnHeight","itemsPerTurn","turns","playback","speed","direction","imageDisplay","cornerRadius","blur"]},panels:[{id:"general",icon:"settings",title:"General",tooltip:"General Settings",layout:["__componentName__",{type:"row",items:["direction","speed"]},{type:"row",items:["width"]},{type:"row",items:["imageWidth","turnHeight"]},{type:"row",items:["cornerRadius","imageDisplay"]},{type:"row",items:["itemsPerTurn","turns"]},{type:"row",items:["playback","blur"]}]}]},Pw={element:Tw,id:"helix",name:"Helix",category:"lists",layoutMode:"structured",preview:{type:"image",url:"https://cdn.cntrl.site/component-assets/Helix.mp4"},version:1,defaultSize:{d:{width:720,height:540}},schema:Lw,sourceCode:Rw,assetsPaths:{content:[{path:"image.url",placeholderEnabled:!0}],parameters:[]},fontSettingsPaths:{content:[],parameters:[]}},Cr=typeof window>"u"?s.useEffect:s.useLayoutEffect,Pc=120,Ec=3,Ew=.12,Xa=.25,Mw=10,Aw=4e3,kw=.12,Fw=1,_w=2,bu=["diamond","parallelogram","vase","circle","shield","bobbin","custom"];function jr(e){return e<0?0:e>1?1:e}function Mc(e,t){return e.filter(n=>n.length>0).map(n=>`M ${n.map(i=>`${i.x*t.width} ${i.y*t.height}`).join(" L ")} Z`).join(" ")}function Nw(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(const c of e)for(const u of c){const p=u.x*t.width,b=u.y*t.height;p<n&&(n=p),p>o&&(o=p),b<i&&(i=b),b>r&&(r=b)}const l=o-n,d=r-i;return!isFinite(l)||!isFinite(d)||l<=0||d<=0?null:{x:n,y:i,width:l,height:d}}function Hw(e){return e.map(([t,n])=>({x:t,y:n}))}function Ya(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const d of e)for(const c of d)c.x<t&&(t=c.x),c.x>i&&(i=c.x),c.y<n&&(n=c.y),c.y>o&&(o=c.y);const r=i-t,l=o-n;return!isFinite(r)||!isFinite(l)||r<=0||l<=0?e:e.map(d=>d.map(c=>({x:(c.x-t)/r,y:(c.y-n)/l})))}const il={bobbin:"M57.63,0 L57.63,37.24 L74.66,37.24 L74.66,56.07 L57.63,100 L33.84,100 L16.81,56.07 L16.81,37.24 L33.84,37.24 L33.84,0 Z",circle:"M50,0 C77.61,0 100,22.39 100,50 C100,77.61 77.61,100 50,100 C22.39,100 0,77.61 0,50 C0,22.39 22.39,0 50,0 Z",shield:"M0,0 L100,0 L100,50 L50,100 L0,50 Z",vase:"M25.37,0 L91.55,0 C91.55,0 74.8,25.14 83.07,50.03 C91.34,74.92 74.61,100 74.61,100 L8.43,100 C8.43,100 32.3,75.08 23.9,50 C15.5,24.92 25.37,0 25.37,0 Z",parallelogram:"M25.37,0 L91.55,0 L74.61,100 L8.43,100 Z",diamond:"M50,0 L80,50 L50,100 L20,50 Z"};function ps(e){const t=e==="rectangle"||e==="custom"?void 0:il[e];return t?ko(da(si(t)),ca):[Hw([[0,0],[1,0],[1,1],[0,1]])]}const ca={x:0,y:0,width:100,height:100};function Ww(e){const t=(e??"").trim().split(/[\s,]+/).map(Number).filter(n=>!Number.isNaN(n));return t.length<4||t[2]<=0||t[3]<=0?ca:{x:t[0],y:t[1],width:t[2],height:t[3]}}function ko(e,t){return e.map(n=>n.map(i=>({x:(i.x-t.x)/t.width,y:(i.y-t.y)/t.height})))}function Ac(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return e.map(r=>r.map(l=>({x:(i+l.x*n)/t.width,y:(o+l.y*n)/t.height})))}function Dw(){return[{closed:!0,nodes:[{p:{x:0,y:0},in:null,out:null},{p:{x:1,y:0},in:null,out:null},{p:{x:1,y:1},in:null,out:null},{p:{x:0,y:1},in:null,out:null}]}]}function qa(e,t){return rn(e,n=>({x:(n.x-t.x)/t.width,y:(n.y-t.y)/t.height}))}function Ow(e){const t=ei(e),n=t.maxX-t.minX,i=t.maxY-t.minY;return!isFinite(n)||!isFinite(i)||n<=0||i<=0?e:rn(e,o=>({x:(o.x-t.minX)/n,y:(o.y-t.minY)/i}))}function Bw(e,t){if(!(t.width>0)||!(t.height>0))return e;const n=Math.min(t.width,t.height),i=(t.width-n)/2,o=(t.height-n)/2;return rn(e,r=>({x:(i+r.x*n)/t.width,y:(o+r.y*n)/t.height}))}function kc(e,t,n,i,o,r){let l=[];if(t&&t.length)l=qa(t,i);else{const d=e.trim();if(d&&/^[Mm]/.test(d)){const c=si(d);c.length&&(l=n==="viewbox"?qa(c,i):Ow(c))}if(!l.length){const c=o!=="custom"?il[o]:void 0;c?l=qa(si(c),ca):l=Dw()}}return o==="circle"?Bw(l,r):l}function Fc(e,t){return!(t.width>0)||!(t.height>0)||!e.length?"":uo(rn(e,n=>({x:n.x*t.width,y:n.y*t.height})))}const ms=16,zw=12,jw=16,gs="0 0 100 100",Vr=100,Ua=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,Vw=/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g;function Gw(e){const t=e.match(Vw);return t?t.map(Number).filter(n=>!Number.isNaN(n)):[]}function hn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function hs(e,t){return{x:t.x*2-e.x,y:t.y*2-e.y}}function on(e){return{x:e.x,y:e.y}}function Xw(e){return{p:on(e.p),in:e.in?on(e.in):null,out:e.out?on(e.out):null}}function En(e){return e.map(t=>({closed:t.closed,nodes:t.nodes.map(Xw)}))}function rn(e,t){return e.map(n=>({closed:n.closed,nodes:n.nodes.map(i=>({p:t(i.p),in:i.in?t(i.in):null,out:i.out?t(i.out):null}))}))}function _c(e,t,n,i=n){return rn(e,o=>({x:t.x+(o.x-t.x)*n,y:t.y+(o.y-t.y)*i}))}function Yw(e,t,n,i,o,r,l){let d=Math.abs(t),c=Math.abs(n);if(!d||!c||e.x===l.x&&e.y===l.y)return[{c1:on(e),c2:on(l),p:on(l)}];const u=i*Math.PI/180,p=Math.cos(u),b=Math.sin(u),y=(e.x-l.x)/2,g=(e.y-l.y)/2,h=p*y+b*g,f=-b*y+p*g,v=h*h/(d*d)+f*f/(c*c);if(v>1){const ne=Math.sqrt(v);d*=ne,c*=ne}const S=o===r?-1:1,x=d*d*f*f+c*c*h*h,w=Math.max(0,d*d*c*c-x),D=x===0?0:S*Math.sqrt(w/x),W=D*d*f/c,K=-D*c*h/d,B=p*W-b*K+(e.x+l.x)/2,$=b*W+p*K+(e.y+l.y)/2,V=Math.atan2((f-K)/c,(h-W)/d);let P=Math.atan2((-f-K)/c,(-h-W)/d)-V;!r&&P>0&&(P-=Math.PI*2),r&&P<0&&(P+=Math.PI*2);const _=Math.max(1,Math.ceil(Math.abs(P)/(Math.PI/2))),R=P/_,m=4/3*Math.tan(R/4),M=(ne,L)=>({x:B+p*d*ne-b*c*L,y:$+b*d*ne+p*c*L}),E=[];let z=V;for(let ne=0;ne<_;ne+=1){const L=z+R,H=Math.cos(z),J=Math.sin(z),ie=Math.cos(L),ce=Math.sin(L);E.push({c1:M(H-m*J,J+m*H),c2:M(ie+m*ce,ce-m*ie),p:ne===_-1?on(l):M(ie,ce)}),z=L}return E}function si(e){const t=(e??"").trim();if(!t)return[];const n=[];let i=[],o=!1,r={x:0,y:0},l={x:0,y:0},d=null,c=null;const u=()=>{if(o&&i.length>2){const g=i[0],h=i[i.length-1];Math.abs(g.p.x-h.p.x)<1e-6&&Math.abs(g.p.y-h.p.y)<1e-6&&(g.in=h.in??g.in,i.pop())}i.length>1&&n.push({nodes:i,closed:o}),i=[],o=!1},p=(g,h)=>{i.push({p:g,in:kn(h??null,g),out:null}),r=g},b=g=>{if(!i.length)return;const h=i[i.length-1];h.out=kn(g,h.p)};Ua.lastIndex=0;let y=Ua.exec(t);for(;y!==null;){const g=y[1],h=g.toUpperCase(),f=g!==h,v=Gw(y[2]),S=x=>f?{x:r.x+v[x],y:r.y+v[x+1]}:{x:v[x],y:v[x+1]};if(h==="Z")o=!0,u(),r=on(l),d=null,c=null;else if(h==="M"){for(let x=0;x+1<v.length;x+=2){const w=S(x);x===0&&(u(),l=on(w)),p(w)}d=null,c=null}else if(h==="L"){for(let x=0;x+1<v.length;x+=2)p(S(x));d=null,c=null}else if(h==="H"){for(const x of v)p({x:f?r.x+x:x,y:r.y});d=null,c=null}else if(h==="V"){for(const x of v)p({x:r.x,y:f?r.y+x:x});d=null,c=null}else if(h==="C"){for(let x=0;x+5<v.length;x+=6){const w=S(x),D=S(x+2),W=S(x+4);b(w),p(W,D),d=D}c=null}else if(h==="S"){for(let x=0;x+3<v.length;x+=4){const w=d?hs(d,r):on(r),D=S(x),W=S(x+2);b(w),p(W,D),d=D}c=null}else if(h==="Q")for(let x=0;x+3<v.length;x+=4){const w=S(x),D=S(x+2);b(hn(r,w,2/3)),p(D,hn(D,w,2/3)),c=w,d=null}else if(h==="T")for(let x=0;x+1<v.length;x+=2){const w=c?hs(c,r):on(r),D=S(x);b(hn(r,w,2/3)),p(D,hn(D,w,2/3)),c=w,d=null}else if(h==="A")for(let x=0;x+6<v.length;x+=7){const w=f?{x:r.x+v[x+5],y:r.y+v[x+6]}:{x:v[x+5],y:v[x+6]};for(const D of Yw(r,v[x],v[x+1],v[x+2],v[x+3]!==0,v[x+4]!==0,w))b(D.c1),p(D.p,D.c2);d=null,c=null}y=Ua.exec(t)}return u(),n}function Ln(e){return`${Number(e.toFixed(2))}`}function kn(e,t){return!e||Math.abs(e.x-t.x)<1e-6&&Math.abs(e.y-t.y)<1e-6?null:e}function wu(e){return!!(kn(e.in,e.p)||kn(e.out,e.p))}function tr(e,t){return!kn(e.out,e.p)&&!kn(t.in,t.p)}function Nc(e,t){if(tr(e,t))return`L${Ln(t.p.x)},${Ln(t.p.y)}`;const n=kn(e.out,e.p)??e.p,i=kn(t.in,t.p)??t.p;return`C${Ln(n.x)},${Ln(n.y)} ${Ln(i.x)},${Ln(i.y)} ${Ln(t.p.x)},${Ln(t.p.y)}`}function uo(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const[i,...o]=n.nodes;t.push(`M${Ln(i.p.x)},${Ln(i.p.y)}`);let r=i;for(const l of o)t.push(Nc(r,l)),r=l;if(n.closed){const l=Nc(r,i);l.charAt(0)==="C"&&t.push(l),t.push("Z")}}return t.join(" ")}function Su(e){const t=[];for(let n=0;n+1<e.nodes.length;n+=1)t.push({from:e.nodes[n],to:e.nodes[n+1],index:n});if(e.closed&&e.nodes.length>2){const n=e.nodes.length-1;t.push({from:e.nodes[n],to:e.nodes[0],index:n})}return t}function fs(e,t,n){if(tr(e,t))return hn(e.p,t.p,n);const i=e.out??e.p,o=t.in??t.p,r=1-n,l=r*r*r,d=3*r*r*n,c=3*r*n*n,u=n*n*n;return{x:l*e.p.x+d*i.x+c*o.x+u*t.p.x,y:l*e.p.y+d*i.y+c*o.y+u*t.p.y}}function da(e){const t=[];for(const n of e){if(n.nodes.length<2)continue;const i=[];for(const o of Su(n)){if(tr(o.from,o.to)){i.push(on(o.from.p));continue}for(let r=0;r<ms;r+=1)i.push(fs(o.from,o.to,r/ms))}n.closed||i.push(on(n.nodes[n.nodes.length-1].p)),i.length>2&&t.push(i)}return t}function ei(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(const r of da(e))for(const l of r)l.x<t&&(t=l.x),l.x>i&&(i=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y);return{minX:t,minY:n,maxX:i,maxY:o}}function qw(e){const t=ei(e);return!isFinite(t.minX)||!isFinite(t.maxX)||!isFinite(t.minY)||!isFinite(t.maxY)?null:{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}}function Cu(e,t,n){const i={x:(n.x-e.x)/6,y:(n.y-e.y)/6};return{in:{x:t.x-i.x,y:t.y-i.y},out:{x:t.x+i.x,y:t.y+i.y}}}function $u(e){return e.filter(t=>t.length>2).map(t=>{if(t.length<=zw)return{closed:!0,nodes:t.map(r=>({p:on(r),in:null,out:null}))};const n=Math.max(1,Math.round(t.length/jw)),i=[];for(let r=0;r<t.length;r+=n)i.push(t[r]);const o=i.length;return{closed:!0,nodes:i.map((r,l)=>({p:on(r),...Cu(i[(l-1+o)%o],r,i[(l+1)%o])}))}})}function Tu(e,t,n=1){if(!e.length)return!1;const i=ei(e);if(!isFinite(i.minX)||!isFinite(i.maxX))return!1;const o=i.maxX-i.minX,r=i.maxY-i.minY;if(o<=t.width*2.5&&r<=t.height*2.5)return!1;const l=Math.max(n,t.width*.5),d=Math.max(n,t.height*.5);return i.minX<t.x-l||i.minY<t.y-d||i.maxX>t.x+t.width+l||i.maxY>t.y+t.height+d}function Uw(e,t,n,i,o,r,l){const d=t.width>0?n.width/t.width:1,c=t.height>0?n.height/t.height:1;return!(r>0)||!(l>0)||!(d>0)||!(c>0)?e:rn(e,u=>{const p=i+(u.x-t.x)*r,b=o+(u.y-t.y)*l;return{x:t.x+p/d,y:t.y+b/c}})}function Kw(e,t){if(!e.length)return e;const n=ei(e),i=n.maxX-n.minX,o=n.maxY-n.minY;if(!(i>0)||!(o>0)||n.minX>=t.x-1e-6&&n.minY>=t.y-1e-6&&n.maxX<=t.x+t.width+1e-6&&n.maxY<=t.y+t.height+1e-6)return e;const l=Math.min(t.width/i,t.height/o),d=t.x+(t.width-i*l)/2,c=t.y+(t.height-o*l)/2;return rn(e,u=>({x:d+(u.x-n.minX)*l,y:c+(u.y-n.minY)*l}))}function Ru(e){const t={x:0,y:0,width:Vr,height:Vr},n=e!=="custom"?il[e]:void 0,i=n?rn(si(n),r=>({x:r.x/100*t.width+t.x,y:r.y/100*t.height+t.y})):rn($u(ps("rectangle")),r=>({x:r.x*t.width+t.x,y:r.y*t.height+t.y})),o=Kw(i,t);return{shape:e,customPath:uo(o),pathFit:"viewbox",pathViewBox:gs}}function $r(e,t){return t>0?Math.round(e/t)*t:e}function Zw(e,t,n,i){var u;const o=(u=e[t])==null?void 0:u.nodes[n];if(!o)return e;const r=i.x-o.p.x,l=i.y-o.p.y,d=En(e),c=d[t].nodes[n];return c.p={x:o.p.x+r,y:o.p.y+l},c.in&&(c.in={x:c.in.x+r,y:c.in.y+l}),c.out&&(c.out={x:c.out.x+r,y:c.out.y+l}),d}function Hc(e,t,n,i){var r;if(!t.length)return e;const o=En(e);for(const{contour:l,node:d}of t){const c=(r=o[l])==null?void 0:r.nodes[d];c&&(c.p={x:c.p.x+n,y:c.p.y+i},c.in&&(c.in={x:c.in.x+n,y:c.in.y+i}),c.out&&(c.out={x:c.out.x+n,y:c.out.y+i}))}return o}function Jw(e,t){const n=new Map;for(const{contour:o,node:r}of t){const l=n.get(o)??[];l.push(r),n.set(o,l)}let i=e;return n.forEach((o,r)=>{const l=[...o].sort((d,c)=>c-d);for(const d of l)i=Iu(i,r,d)}),i}function Qw(e,t,n,i,o,r){var u;if(!((u=e[t])==null?void 0:u.nodes[n]))return e;const d=En(e),c=d[t].nodes[n];if(c[i]=on(o),r){const p=i==="in"?"out":"in";c[p]=hs(o,c.p)}return d}function eS(e,t,n,i){var l;const o=(l=e[t])==null?void 0:l.nodes[n];if(!o||!o[i])return e;const r=En(e);return r[t].nodes[n][i]=null,r}function tS(e,t,n,i){const o=e[t];if(!o)return{contours:e,nodeIndex:-1};const r=o.nodes[n],l=o.nodes[(n+1)%o.nodes.length];if(!r||!l)return{contours:e,nodeIndex:-1};const d=En(e),c=d[t].nodes,u=n+1;if(tr(r,l))return c.splice(u,0,{p:hn(r.p,l.p,i),in:null,out:null}),{contours:d,nodeIndex:u};const p=r.out??r.p,b=l.in??l.p,y=hn(r.p,p,i),g=hn(p,b,i),h=hn(b,l.p,i),f=hn(y,g,i),v=hn(g,h,i),S=hn(f,v,i),x=(n+1)%o.nodes.length;return c[n].out=y,c[x].in=h,c.splice(u,0,{p:S,in:f,out:v}),{contours:d,nodeIndex:u}}function Iu(e,t,n){const i=e[t];if(!i||i.nodes.length<=3)return e;const o=En(e);return o[t].nodes.splice(n,1),o}function Wc(e,t,n){const i=e[t];if(!(i==null?void 0:i.nodes[n]))return e;const r=En(e),l=r[t].nodes,d=l[n],c=l.length,u=(n-1+c)%c,p=(n+1)%c,b=!!kn(l[u].out,l[u].p),y=!!kn(l[p].in,l[p].p);if(wu(d)||b||y)return d.in=null,d.out=null,l[u].out=null,l[p].in=null,r;const g=Cu(l[u].p,d.p,l[p].p);return d.in=g.in,d.out=g.out,r}function nS(e,t,n){const i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,l=r===0?0:Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)),d={x:t.x+i*l,y:t.y+o*l};return{t:l,distance:Math.hypot(e.x-d.x,e.y-d.y)}}function iS(e,t){let n=null;return e.forEach((i,o)=>{for(const r of Su(i)){const l=tr(r.from,r.to)?1:ms;for(let d=0;d<l;d+=1){const c=d/l,u=(d+1)/l,p=nS(t,fs(r.from,r.to,c),fs(r.from,r.to,u));(!n||p.distance<n.distance)&&(n={contour:o,segment:r.index,t:c+(u-c)*p.t,distance:p.distance})}}}),n}function oS(e,t){const n=[];return e.forEach((i,o)=>{i.nodes.forEach((r,l)=>{o===t.contour&&l===t.node||n.push(r.p)})}),n}function Dc(e,t,n){const i=t.filter((r,l)=>isFinite(r)&&t.findIndex(d=>Math.abs(d-r)<1e-6)===l),o=i.map(r=>({value:r,axis:r,from:null}));for(const r of e)o.push({value:r[n],axis:null,from:r});for(const r of i)for(const l of e)o.push({value:r*2-l[n],axis:r,from:l});return o}function Oc(e,t,n,i,o){const r=i(t)[n];let l=null,d=1/0;for(const c of e){const u=n==="x"?{x:c.value,y:t.y}:{x:t.x,y:c.value},p=Math.abs(i(u)[n]-r);p>o||l&&p>=d||(l=c,d=p)}return l}const Bc=Math.PI/4,rS=8,aS=Math.PI/18,sS=8,Vi=24,Gi=[];function lS(e,t){return e.length===t.length&&e.every((n,i)=>n.kind===t[i].kind&&n.a.x===t[i].a.x&&n.a.y===t[i].a.y&&n.b.x===t[i].b.x&&n.b.y===t[i].b.y)}function cS(e){const t=Math.PI*2;return((e+Math.PI)%t+t)%t-Math.PI}function ys(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.hypot(n,i);return o<1e-6?null:{x:n/o,y:i/o}}function dS(e,t){const n=ys(e,t);return n?{kind:"align",a:{x:e.x-n.x*Vi,y:e.y-n.y*Vi},b:{x:t.x+n.x*Vi,y:t.y+n.y*Vi}}:{kind:"align",a:e,b:t}}function xs(e,t,n){return t==="x"?{kind:"center",a:{x:e,y:0},b:{x:e,y:n.height}}:{kind:"center",a:{x:0,y:e},b:{x:n.width,y:e}}}function zc(e,t,n,i,o){if(e.axis===null)return dS(n,o(e.from??n));const r=t==="x"?{x:e.axis,y:0}:{x:0,y:e.axis};return xs(o(r)[t],t,i)}function uS(e,t,n,i,o){const r=[],l=o(e);return t&&e.x===t.value&&r.push(zc(t,"x",l,i,o)),n&&e.y===n.value&&r.push(zc(n,"y",l,i,o)),r}function pS(e,t,n,i){const o=e==null?void 0:e.nodes[t];if(!e||!o)return null;const r=i(o.p),l=n==="in"?o.out:o.in;if(l)return ys(i(l),r);const d=e.nodes.length,c=t+(n==="in"?1:-1);if(!e.closed&&(c<0||c>=d))return null;const u=e.nodes[(c+d)%d];if(!u)return null;const p=(n==="in"?u.in:u.out)??u.p;return ys(i(p),r)}function mS(e,t,n,i,o,r,l){const d=r(t),c=r(e),u=c.x-d.x,p=c.y-d.y,b=Math.hypot(u,p);if(b<1e-6)return{point:e,guides:Gi};const y=Math.atan2(p,u),g=Math.round(y/Bc)*Bc;let h=o?g:null,f=!1;if(!o){const K=[];n&&K.push({angle:Math.atan2(n.y,n.x),smooth:!0}),K.push({angle:g,smooth:!1});for(const B of K){const $=cS(B.angle-y);if(!(Math.abs($)>aS)&&!(Math.abs(Math.sin($))*b>rS)){h=B.angle,f=B.smooth;break}}}const v=i!==null&&i>0&&Math.abs(b-i)<=sS;if(h===null&&!v)return{point:e,guides:Gi};const S=h??y,x=v?i:b,w={x:Math.cos(S),y:Math.sin(S)},D=x+(h===null?0:Vi),W=v?x:f?Vi:0;return{point:l({x:d.x+w.x*x,y:d.y+w.y*x}),guides:[{kind:"angle",a:{x:d.x-w.x*W,y:d.y-w.y*W},b:{x:d.x+w.x*D,y:d.y+w.y*D}}]}}function jc(e,t="stretch",n=ca){const i=e.trim();if(!i)return null;if(/^[Mm]/.test(i)){const l=si(i),d=da(l);if(d.length)return t==="viewbox"?ko(d,n):Ya(d);if(typeof document>"u")return null;const c=i.split(/(?=[Mm])/).map(b=>b.trim()).filter(Boolean),u=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=[];for(const b of c){const y=document.createElementNS("http://www.w3.org/2000/svg","path");y.setAttribute("d",b),u.appendChild(y);let g=0;try{g=y.getTotalLength()}catch{g=0}if(!g)continue;const h=[];for(let f=0;f<Pc;f+=1){const v=y.getPointAtLength(f/Pc*g);h.push({x:v.x,y:v.y})}p.push(h)}return p.length?t==="viewbox"?ko(p,n):Ya(p):null}const o=i.split(/[\s,]+/).map(Number).filter(l=>!Number.isNaN(l));if(o.length<6)return null;const r=[];for(let l=0;l+1<o.length;l+=2)r.push({x:o[l],y:o[l+1]});return t==="viewbox"?ko([r],n):Ya([r])}function gS(e,t){const n=[];for(const o of e)for(let r=0;r<o.length;r+=1){const l=o[r],d=o[(r+1)%o.length];(l.y<=t&&d.y>t||d.y<=t&&l.y>t)&&n.push(l.x+(t-l.y)/(d.y-l.y)*(d.x-l.x))}n.sort((o,r)=>o-r);const i=[];for(let o=0;o+1<n.length;o+=2){const r=jr(n[o]),l=jr(n[o+1]);l>r&&i.push({x0:r,x1:l})}return hS(i)}function hS(e){if(e.length<2)return e;const t=[...e].sort((i,o)=>i.x0-o.x0),n=[t[0]];for(let i=1;i<t.length;i+=1){const o=n[n.length-1],r=t[i];r.x0<=o.x1?o.x1=Math.max(o.x1,r.x1):n.push({...r})}return n}function fS(e,t){const n=[];let i=0,o=0;for(;i<e.length&&o<t.length;){const r=Math.max(e[i].x0,t[o].x0),l=Math.min(e[i].x1,t[o].x1);l>r&&n.push({x0:r,x1:l}),e[i].x1<t[o].x1?i+=1:o+=1}return n}function yS(e){const t=[];let n=0;for(const i of e)i.x0>n&&t.push({x0:n,x1:i.x0}),n=Math.max(n,i.x1);return n<1&&t.push({x0:n,x1:1}),t}function xS(e,t){const n=[];for(const i of e){if(t.x1<=i.x0||t.x0>=i.x1){n.push(i);continue}t.x0>i.x0&&n.push({x0:i.x0,x1:t.x0}),t.x1<i.x1&&n.push({x0:t.x1,x1:i.x1})}return n}function vS(e,t,n,i){let o=null;for(let r=0;r<Ec;r+=1){const l=jr(t+(n-t)*r/Math.max(1,Ec-1)),d=gS(e,l),c=i==="avoid"?yS(d):d;if(o=o===null?c:fS(o,c),o.length===0)return[]}return o??[]}function Lu(e){return!!e&&typeof e=="object"&&e.type==="link"}const bS=/^(?:https?:|mailto:|tel:)/i;function wS(e){if(!e)return;const t=e.replace(/\s+/g,"");if(!(/^[a-z][a-z0-9+.-]*:/i.test(t)&&!bS.test(t)))return t}function SS(e){const t=[];return e.forEach((n,i)=>{const o=(r,l,d)=>{for(const c of r){if(Lu(c)){o(c.children??[],wS(c.value),c.target);continue}const u=c,p=(u==null?void 0:u.text)??"";if(p.trim())for(const b of p.split(/\s+/))b&&t.push({text:b,leaf:u,href:l,target:d,para:i})}};o((n==null?void 0:n.children)??[])}),t}function Vc(e){return{...e.fontFamily&&{fontFamily:ho(e.fontFamily)},...e.fontWeight&&{fontWeight:e.fontWeight},...e.fontStyle&&{fontStyle:e.fontStyle},...e.textDecoration&&{textDecoration:e.textDecoration},...e.textTransform&&{textTransform:e.textTransform},...e.fontVariant&&{fontVariant:e.fontVariant},...e.verticalAlign&&{verticalAlign:e.verticalAlign,lineHeight:"0px"}}}function CS(e){return e.map(t=>{const n=[],i=o=>{for(const r of o){if(Lu(r)){i(r.children??[]);continue}n.push((r==null?void 0:r.text)??"")}};return i((t==null?void 0:t.children)??[]),n.join("")})}function Gc(e){const{tokens:t,widths:n,rings:i,mode:o,align:r,scale:l,width:d,height:c,allowOverflow:u,capInset:p,capLines:b}=e,y=e.lineHeight*l,g=e.spaceWidth*l,h=[];if(!t.length||d<=0||y<=0)return{segments:h,placed:0,height:0,capLeft:0,capTop:0};const f=Math.max(1,g*.5),v=y*Ew;let S=0,x=0,w=0,D=t[0].para,W=0,K=0,B=null;for(;S<t.length&&w<Aw;){const $=x+y>c;if($&&!u)break;const V=t[S].para;if(V>D+1){x+=y*(V-D-1),D=V-1,w+=1;continue}let C=$?[{x0:0,x1:d}]:vS(i,(x+v)/c,(x+y-v)/c,o).map(_=>({x0:_.x0*d,x1:_.x1*d}));p>0&&b>0&&!$&&C.length&&(B===null&&(B=w,W=C[0].x0,K=x),w-B<b&&(C=xS(C,{x0:W,x1:W+p})));const P=C.reduce((_,R)=>Math.max(_,R.x1-R.x0),0);for(const _ of C){const R=_.x1-_.x0;if(R<f)continue;if(S>=t.length||t[S].para!==V)break;const m=S;let M=0;for(;S<t.length&&t[S].para===V;){const E=n[S]*l,z=S===m?E:g+E;if(M+z>R&&!(S===m&&R>=P-.5&&E>d-.5))break;M+=z,S+=1}if(S>m){const E=S>=t.length||t[S].para!==V;h.push({top:x,left:_.x0,width:R,from:m,to:S,justify:r==="justify"&&!E})}if(S>=t.length||t[S].para!==V)break}D=V,x+=y,w+=1}return{segments:h,placed:S,height:h.length?x:0,capLeft:W,capTop:K}}function $S(e){return`
|
|
23611
23611
|
.${e}-wrapper {
|
|
23612
23612
|
box-sizing: border-box;
|
|
23613
23613
|
display: flex;
|
|
@@ -23848,12 +23848,12 @@ const DROP_CAP_SIZE_DEFAULT = 1;
|
|
|
23848
23848
|
const EDITOR_PORTAL_Z_INDEX = 2;
|
|
23849
23849
|
|
|
23850
23850
|
export const SHAPE_IDS = [
|
|
23851
|
-
'
|
|
23851
|
+
'diamond',
|
|
23852
|
+
'parallelogram',
|
|
23853
|
+
'vase',
|
|
23852
23854
|
'circle',
|
|
23853
23855
|
'shield',
|
|
23854
|
-
'
|
|
23855
|
-
'parallelogram',
|
|
23856
|
-
'diamond',
|
|
23856
|
+
'bobbin',
|
|
23857
23857
|
'custom',
|
|
23858
23858
|
] as const;
|
|
23859
23859
|
|
package/dist/index.mjs
CHANGED
|
@@ -51307,12 +51307,12 @@ export function Helix({
|
|
|
51307
51307
|
parameters: []
|
|
51308
51308
|
}
|
|
51309
51309
|
}, kr = typeof window > "u" ? Me : Rt, Oc = 120, Bc = 3, Vw = 0.12, is = 0.25, jw = 10, Gw = 4e3, Xw = 0.12, Yw = 1, qw = 2, ku = [
|
|
51310
|
-
"
|
|
51310
|
+
"diamond",
|
|
51311
|
+
"parallelogram",
|
|
51312
|
+
"vase",
|
|
51311
51313
|
"circle",
|
|
51312
51314
|
"shield",
|
|
51313
|
-
"
|
|
51314
|
-
"parallelogram",
|
|
51315
|
-
"diamond",
|
|
51315
|
+
"bobbin",
|
|
51316
51316
|
"custom"
|
|
51317
51317
|
];
|
|
51318
51318
|
function ea(e) {
|
|
@@ -53701,12 +53701,12 @@ const DROP_CAP_SIZE_DEFAULT = 1;
|
|
|
53701
53701
|
const EDITOR_PORTAL_Z_INDEX = 2;
|
|
53702
53702
|
|
|
53703
53703
|
export const SHAPE_IDS = [
|
|
53704
|
-
'
|
|
53704
|
+
'diamond',
|
|
53705
|
+
'parallelogram',
|
|
53706
|
+
'vase',
|
|
53705
53707
|
'circle',
|
|
53706
53708
|
'shield',
|
|
53707
|
-
'
|
|
53708
|
-
'parallelogram',
|
|
53709
|
-
'diamond',
|
|
53709
|
+
'bobbin',
|
|
53710
53710
|
'custom',
|
|
53711
53711
|
] as const;
|
|
53712
53712
|
|