1import{j as g}from"./client-BDJMow-F.js";import{r as F}from"./tabler-icons-development-DI2L2NPt.js";import{T as Ya}from"./ToolsBreadcrumb-CWvUAVzG.js";import{E as et}from"./ExploreToolsSection-BO8ODazJ.js";import{t as at}from"./toolTypeRoles.module-CRugzuNx.js";import{l as tt}from"./loadJsPDF-BE4kp0-g.js";import{f as rt,m as nt,h as ot}from"./colorHandoff-cnxmPNMl.js";import"./CloudinaryImage-B1iMtP-y.js";const ca=[{id:"postcard",label:"Postcard",dim:"4x6 in",w:4,h:6,unit:"in"},{id:"bizcard",label:"Business card",dim:"3.5x2 in",w:2,h:3.5,unit:"in"},{id:"print57",label:"Print",dim:"5x7 in",w:5,h:7,unit:"in"},{id:"letter",label:"Letter",dim:"8.5x11 in",w:8.5,h:11,unit:"in"},{id:"poster",label:"Poster",dim:"18x24 in",w:18,h:24,unit:"in"},{id:"square",label:"Square",dim:"2048 px",w:2048,h:2048,unit:"px",lock:!0},{id:"phone",label:"Phone wallpaper",dim:"1179x2556",w:1179,h:2556,unit:"px",lock:!0},{id:"desktop",label:"Desktop wallpaper",dim:"4K",w:3840,h:2160,unit:"px",lock:!0}],Ia={dm:{css:"'DM Sans', sans-serif",canvas:"DM Sans",label:"DM Sans"},inter:{css:"'Inter', sans-serif",canvas:"Inter",label:"Inter"},serif:{css:"Georgia, 'Times New Roman', serif",canvas:"Georgia",label:"Georgia"},mono:{css:"ui-monospace, 'SF Mono', Menlo, monospace",canvas:"Menlo",label:"Mono"},poppins:{css:"'Poppins', sans-serif",canvas:"Poppins",label:"Poppins"},montserrat:{css:"'Montserrat', sans-serif",canvas:"Montserrat",label:"Montserrat"},raleway:{css:"'Raleway', sans-serif",canvas:"Raleway",label:"Raleway"},grotesk:{css:"'Space Grotesk', sans-serif",canvas:"Space Grotesk",label:"Space Grotesk"},playfair:{css:"'Playfair Display', serif",canvas:"Playfair Display",label:"Playfair Display"},lora:{css:"'Lora', serif",canvas:"Lora",label:"Lora"},merriweather:{css:"'Merriweather', serif",canvas:"Merriweather",label:"Merriweather"},dmserif:{css:"'DM Serif Display', serif",canvas:"DM Serif Display",label:"DM Serif Display"},caveat:{css:"'Caveat', cursive",canvas:"Caveat",label:"Caveat"},pacifico:{css:"'Pacifico', cursive",canvas:"Pacifico",label:"Pacifico"}},Ta={yblocks:[{id:"size",label:"Block size",min:60,max:160,step:10,def:100,unit:"%"}],stitch:[{id:"mix",label:"Arrangement",min:1,max:9,step:1,def:1}],bloom:[{id:"size",label:"Bloom size",min:60,max:160,step:10,def:100,unit:"%"}],arches:[{id:"rings",label:"Rings",min:3,max:14,step:1,def:6}],chevron:[{id:"size",label:"Chevron size",min:60,max:160,step:10,def:100,unit:"%"}],vstripes:[{id:"count",label:"Stripes",min:4,max:24,step:1,def:18}],hstripes:[{id:"count",label:"Stripes",min:4,max:24,step:1,def:18}],sigstripes:[{id:"pins",label:"Pinstripes",min:0,max:60,step:5,def:28,unit:"%"},{id:"mix",label:"Arrangement",min:1,max:9,step:1,def:1}],checker:[{id:"size",label:"Checker size",min:60,max:160,step:10,def:100,unit:"%"}],weave:[{id:"size",label:"Weave size",min:60,max:160,step:10,def:100,unit:"%"}],mosaic:[{id:"count",label:"Tiles across",min:3,max:16,step:1,def:10}],diagonal:[{id:"size",label:"Stripe width",min:60,max:180,step:10,def:100,unit:"%"}],tumbling:[{id:"size",label:"Block size",min:60,max:160,step:10,def:100,unit:"%"}],cubes:[{id:"size",label:"Cube size",min:60,max:160,step:10,def:100,unit:"%"}],penrose:[{id:"size",label:"Tile size",min:70,max:150,step:10,def:100,unit:"%"}],hexes:[{id:"size",label:"Hex size",min:60,max:160,step:10,def:100,unit:"%"}],stairs:[{id:"size",label:"Step size",min:60,max:160,step:10,def:100,unit:"%"}],columns:[{id:"size",label:"Column size",min:60,max:160,step:10,def:100,unit:"%"}],triangles:[{id:"count",label:"Triangles across",min:4,max:18,step:1,def:10}],pyramids:[{id:"size",label:"Pyramid size",min:60,max:160,step:10,def:100,unit:"%"}],diamonds:[{id:"count",label:"Diamonds across",min:5,max:24,step:1,def:13}],waves:[{id:"swell",label:"Wave height",min:40,max:170,step:10,def:100,unit:"%"}],survey:[{id:"detail",label:"Contour detail",min:12,max:28,step:2,def:20},{id:"relief",label:"Landform size",min:60,max:180,step:10,def:100,unit:"%"},{id:"labels",label:"Elevation values",toggle:!0,def:1}
1],wstripes:[{id:"swell",label:"Wave depth",min:40,max:160,step:10,def:100,unit:"%"}],zigzag:[{id:"sharp",label:"Peak height",min:40,max:100,step:10,def:100,unit:"%"}],gem:[{id:"rings",label:"Rings",min:4,max:24,step:1,def:16}],shingles:[{id:"size",label:"Shingle size",min:60,max:160,step:10,def:100,unit:"%"}],scallops:[{id:"size",label:"Scallop size",min:60,max:160,step:10,def:100,unit:"%"}],spiral:[{id:"arms",label:"Arms",min:4,max:14,step:1,def:12}]},st={colors:["#ff2e88","#ff61c3","#7d28ff","#1cc7ff","#0f0f1a","#fffefb"],size:"postcard",orient:"landscape",layout:"yblocks",scale:1,font:"dm",title:"",hex:!1,hexStyle:"plain",align:"left",bg:"white",frame:"none",varAmt:0,varSeed:1234567,name:"My pattern",opts:{}};function se(t){const r=parseInt(t.slice(1),16),e=(r>>16&255)/255,a=(r>>8&255)/255,l=(r&255)/255,f=Math.max(e,a,l),s=Math.min(e,a,l);let p=0,m=0;const c=(f+s)/2;if(f!==s){const o=f-s;m=c>.5?o/(2-f-s):o/(f+s),f===e?p=(a-l)/o+(a<l?6:0):f===a?p=(l-e)/o+2:p=(e-a)/o+4,p*=60}return{h:p,s:m,l:c}}function K(t,r,e){t=(t%360+360)%360/360;const a=e<.5?e*(1+r):e+r-e*r,l=2*e-a,f=function(p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?l+(a-l)*6*p:p<1/2?a:p<2/3?l+(a-l)*(2/3-p)*6:l},s=function(p){return Math.round(p*255).toString(16).padStart(2,"0")};return"#"+s(f(t+1/3))+s(f(t))+s(f(t-1/3))}function lt(t){let r=0;return t.forEach(function(e){const a=parseInt(e.slice(1),16);r+=(.299*(a>>16&255)+.587*(a>>8&255)+.114*(a&255))/255}),r/t.length<.55?"#ffffff":"#1d1d1f"}function Ma(t){let r=t>>>0;return function(){r|=0,r=r+1831565813|0;let e=Math.imul(r^r>>>15,1|r);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function qa(t,r,e){if(!r){const p=[];for(let m=0;m<t;m++)p.push(1/t);return p}const a=Ma(e),l=r/100,f=[];let s=0;for(let p=0;p<t;p++){const m=Math.max(.16,1+(a()-.5)*2*l*.92);f.push(m),s+=m}return f.map(function(p){return p/s})}function it(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,fl2:m,op:c}=t,o=[];let n;var i=Math.max(m(6),Math.round(a/(p*.14*((c.size!=null?c.size:100)/100)))),h=a/i,u=h/2,v=h/2,M=Ma(424242+s*101),k=function(X){var I=se(X);return K(I.h,I.s,Math.max(.07,I.l-.13))},j=null;for(n=0;n<i;n++){for(var w=r+n*h,d=w+h,z=n%2===0?1:-1,N=e-u*2-Math.floor(M()*2)*u,y=null,E={};N<e+l+u*2;){var b=Math.round((N-e)/u),R=j?j[b]:null,C,H=0;do C=f[Math.floor(M()*s)],H++;while(H<14&&(C===y&&s>1||C===R&&s>2));y=C,E[Math.round((N+z*v-e)/u)]=C;var L=N,D=N+z*v;o.push({k:"poly",pts:[[w,Math.round(L*10)/10],[d,Math.round(D*10)/10],[d,Math.round((D+u+1)*10)/10],[w,Math.round((L+u+1)*10)/10]],grad:{x1:z===1?w:d,y1:0,x2:z===1?d:w,y2:0,c1:C,c2:k(C)},fill:C}),N+=u}j=E}return o}function ct(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,ov:m,varAmt:c,varSeed:o}=t,n=[];let i;var h=Math.max(2,Math.round(s/p)),u=qa(h,c,o),v=e;for(i=0;i<h;i++){var M=l*u[i];n.push({k:"rect",x:r,y:v,w:a,h:M+(i<h-1?m:0),fill:f[i%s]}),v+=M}return n}function ht(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,ov:m,op:c}=t,o=[];let n;var i=c.count!=null?Math.max(2,Math.round(c.count/p)):Math.max(2,Math.round(s*3/p)),h=a/i;for(n=0;n<i;n++)o.push({k:"rect",x:r+n*h,y:e,w:h+(n<i-1?m:0),h:l,fill:f[n%s]});return o}function ft(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,ov:m,op:c}=t,o=[];let n;var i=c.count!=null?Math.max(2,Math.round(c.count/p)):Math.max(2,Math.round(s*3/p)),h=l/i;for(n=0;n<i;n++)o.push({k:"rect",x:r,y:e+n*h,w:a,h:h+(n<i-1?m:0),fill:f[n%s]});return o}function ut(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,uScale:m,ov:c,op:o}=t,n=[];for(var i=Math.max(p*.07,(a+l)*m/(s*4))*((o.size!=null?o.size:100)/100),h=0,u=-l;u<a+i;u+=i)n.push({k:"poly",pts:[[r+u,e+l],[r+u+i+c,e+l],[r+u+i+l+c,e],[r+u+l,e]],fill:f[h%s]}),h++;return n}function dt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,uScale:m,op:c}=t,o=[];let n;var i=Math.max(2,Math.round(s*2/m)),h=Math.max(4,Math.round(10/m)),u=a/h,v=Math.min(l/i*.48,p*.045*((c.sharp!=null?c.sharp:100)/100)),M=function(N,y){var E=Math.round((y-r)/u),b=(E+N)%2===0?-1:1;return e+l*N/i+v*b};for(n=0;n<i;n++){for(var k=[],j=0;j<=h;j++){var w=r+u*j;k.push([Math.round(w*10)/10,Math.round((n===0?e:M(n,w))*10)/10])}for(var d=h;d>=0;d--){var z=r+u*d;k.push([Math.round(z*10)/10,Math.round((n===i-1?e+l:M(n+1,z))*10)/10])}o.push({k:"poly",pts:k,fill:f[n%s]})}return o}function pt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,op:m}=t,c=[];let o;var n=m.count!=null?Math.max(2,Math.round(m.count/p)):Math.max(2,Math.round(Math.max(7,Math.round(Math.max(4,s)*1.67))/p)),i=Math.max(2,Math.round(l/(a/n))),h=a/n/2,u=l/i;for(o=0;o<i;o++){for(var v=e+o*u,M=v+u,k=0;k<=n*2-2;k++){var j=r+k*h,w=r+(k+1)*h,d=r+Math.min(n*2,k+2)*h,z=(k+o)%2===0,N=z?[[
1j,M],[w,v],[d,M]]:[[j,v],[w,M],[d,v]];c.push({k:"poly",pts:N,fill:f[(k+o)%s]})}var y=r+a,E=r+(n*2-1)*h,b=r+h;o%2===0?(c.push({k:"poly",pts:[[r,v],[b,v],[r,M]],fill:f[(o+s-1)%s]}),c.push({k:"poly",pts:[[E,v],[y,v],[y,M]],fill:f[(2*n-1+o)%s]})):(c.push({k:"poly",pts:[[r,M],[b,M],[r,v]],fill:f[(o+s-1)%s]}),c.push({k:"poly",pts:[[E,M],[y,M],[y,v]],fill:f[(2*n-1+o)%s]}))}return c}function mt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,ov:m,op:c}=t,o=[];for(var n=Ma(17+((c.mix!=null?c.mix:1)-1)*101),i=[.014,.019,.027,.041,.062,.089],h=p*.006,u=h*5,v=r,M=-1,k=-1;;){var j=r+a-v,w=n()<(c.pins!=null?c.pins:28)/100,d=w?u:p*i[Math.floor(n()*i.length)];if(d>j-p*.014){for(var z=-1,N=0;N<s;N++)if(N!==M&&N!==k){z=N;break}if(z===-1){var y=o[o.length-1];y.w=r+a-y.x}else o.push({k:"rect",x:v,y:e,w:j,h:l,fill:f[z]});break}if(w){var E;do E=Math.floor(n()*s);while(s>1&&E===M);var b;do b=Math.floor(n()*s);while(s>1&&b===E);o.push({k:"rect",x:v,y:e,w:u+m,h:l,fill:f[E]}),o.push({k:"rect",x:v+h,y:e,w:h,h:l,fill:f[b]}),o.push({k:"rect",x:v+h*3,y:e,w:h,h:l,fill:f[b]}),k===-1&&(k=E),M=E,v+=u}else{var R;do R=Math.floor(n()*s);while(s>1&&R===M);o.push({k:"rect",x:v,y:e,w:d+m,h:l,fill:f[R]}),k===-1&&(k=R),M=R,v+=d}}return o}function vt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,ov:m,fl2:c,op:o}=t,n=[];let i,h;var u=Math.max(c(3),Math.round(a/(p*.16*((o.size!=null?o.size:100)/100)))),v=Math.max(c(3),Math.round(l/(a/u))),M=a/u,k=l/v;for(h=0;h<v;h++)for(i=0;i<u;i++)n.push({k:"rect",x:r+i*M,y:e+h*k,w:M+(i<u-1?m:0),h:k+(h<v-1?m:0),fill:f[(i+h)%s]});return n}function gt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,ov:m,op:c}=t,o=[];let n,i;var h=c.count!=null?Math.max(2,Math.round(c.count/p)):Math.max(2,Math.round(Math.max(5,Math.round(s*1.67))/p)),u=Math.max(2,Math.round(h*l/a)),v=a/h,M=l/u;for(n=0;n<h;n++)for(i=0;i<u;i++)o.push({k:"rect",x:r+n*v,y:e+i*M,w:v+(n<h-1?m:0),h:M+(i<u-1?m:0),fill:f[(n+i)%s]});return o}function xt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,uScale:m,op:c}=t,o=[];let n,i;var h=Math.max(40*m,p*.06*((c.size!=null?c.size:100)/100)),u=h*.72,v=u*.1,M=Math.max(1.2,u*.065),k=Math.ceil(a/h)+1,j=Math.ceil(l/h)+1,w=0;for(n=0;n<s;n++)w+=se(f[n]).l;var d=w/s<.45?"rgba(245,242,250,0.4)":"rgba(29,29,31,0.3)",z=f[0],N=s>1?1+Math.floor((s-1)/2):0,y=function(D){return f[(D%s+s)%s]},E=function(D){return f[((D+N)%s+s)%s]};o.push({k:"rect",x:r,y:e,w:a,h:l,fill:z});var b=function(D){return Math.round(D*10)/10};for(i=0;i<j;i++){var R=e+i*h;o.push({k:"rect",x:r,y:b(R),w:a,h:b(u),fill:y(i)}),o.push({k:"rect",x:r,y:b(R+v),w:a,h:b(M),fill:d}),o.push({k:"rect",x:r,y:b(R+u-v-M),w:a,h:b(M),fill:d})}for(n=0;n<k;n++){var C=r+n*h;o.push({k:"rect",x:b(C),y:e,w:b(u),h:l,fill:E(n)}),o.push({k:"rect",x:b(C+v),y:e,w:b(M),h:l,fill:d}),o.push({k:"rect",x:b(C+u-v-M),y:e,w:b(M),h:l,fill:d})}for(i=0;i<j;i++)for(n=0;n<k;n++)if((n+i)%2!==0){var H=r+n*h,L=e+i*h;o.push({k:"rect",x:b(H),y:b(L),w:b(u),h:b(u),fill:y(i)}),o.push({k:"rect",x:b(H),y:b(L+v),w:b(u),h:b(M),fill:d}),o.push({k:"rect",x:b(H),y:b(L+u-v-M),w:b(u),h:b(M),fill:d})}return o}function bt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,op:m}=t,c=[];for(var o=a/(m.count!=null?Math.max(3,Math.round(m.count/p)):Math.max(3,Math.round(Math.max(10,Math.round(s*2.2))/p))),n=o*1.55,i=0,h=e;h<e+l+n/2;h+=n/2){for(var u=i%2*(o/2),v=0,M=r+u-o;M<r+a+o/2;M+=o)c.push({k:"poly",pts:[[M,h-n/2-.5],[M+o/2+.5,h],[M,h+n/2+.5],[M-o/2-.5,h]],fill:f[(2*v+i)%s]}),v++;i++}return c}function Mt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,op:m}=t,c=[];let o;var n=r+a/2,i=e+l/2,h=m.rings!=null?Math.max(3,Math.round(m.rings/p)):Math.max(3,Math.round(Math.max(s+3,Math.round(s*2.72))/p));for(o=0;o<h;o++){var u=(h-o)/h,v=a*1.03*u,M=l*1.03*u;c.push({k:"poly",pts:[[n,i-M],[n+v,i],[n,i+M],[n-v,i]],fill:f[o%s]})}return c}function wt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,op:m}=t,c=[];let o;var n=r+a/2,i=e+l;c.push({k:"rect",x:r,y:e,w:a,h:l,fill:f[0]});var h=m.rings!=null?Math.max(2,Math.round(m.rings/p)):Math.max(2,Math.round(s/p));for(o=1;o<h;o++){var u=(h-o)/h,v=a*1.04*u,M=l*1.02*u,k=Math.min(v/2,M),j=i-M;c.push({k:"circle",cx:n,cy:j+k,rad:k,fill:f[o%s]}),M>k&&c.push({k:"rect",x:n-v/2,y:j+k,w:v,h:M-k,fill:f[o%s]})}return c}function yt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,fl2:m,op:c}=t,o=[];for(var n=Math.max(m(7),Math.round(a/(p*.13*((c.size!=null?c.size:100)/100)))),i=a/(2*n),h=Math.ceil(l/i)+3,u=-1;u<h;u++)for(var v=e+u*i,M=(u%2+2)%2*i,k=-1;k<=n+1;k++){var j=r+k*2*i+M;o.push({k:"circle",cx:Math.round(j*10)/10,cy:Math.round(v*10)/10,rad:Math.round(i*1.08*10)/10,fill:f[((2*k+u)%s+s)%s]})}return o}function kt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,fl2:m,op:c}=t,o=[];let n;var i=Math.max(m(5),Math.round(a/(p*.16*((c.size!=null?c.size:100)/100)))),h=a/(2*i),u=h/2,v=h,M=u+v,k=se(f[0]),j=K(k.h,Math.max(.18,k.s*.9),.28);o.push({k:"rect",x:r,y:e,w:a,h:l,fill:j});for(var w=Math.ceil(l/M)+2,d=-1;d<w;d++){var z=e+d*M,N=d%2===0?0:h;for(n=-1;n<=i;n++){var y=r+n*2*h+N,E=f[(n+i+(d+2))%s],b=se(E),R=Math.max(.18,b.s*.9),C=K(b.h,R,.78),H=K(b.h,R,.52),L=K(b.h,R,.28);o.push({k:"poly",st:1,pts:[[y,z-u],[y+h,z],[y,z+u],[y-h,z]],fill:C}),o.push({k:"poly",st:1,pts:[[y-h,z],[y,z+u],[y,z+u+v],[y-h,z+v]],fill:L}),o.push({k:"poly",st:1,pts:[[y,z+u],[y+h,z],[y+h,z+v],[y,z+u+v]],fill:H})}}return o}function St(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,op:m}=t,c=[];for(var o=a*.7*p/Math.max(4,s)*((m.size!=null?m.size:100)/100),n=o/2,i=o/4,h=o/2,u=3*i,v=2*n,M=0,k=e-u;k<e+l+u;k+=u){for(var j=M%2*n,w=0,d=r-v+j;d<r+a+v;d+=v){var z=f[(M+w)%s],N=se(z),y=K(N.h,N.s,Math.min(.93,N.l+.15)),E=K(N.h,N.s,Math.max(.07,N.l-.17));c.push({k:"poly",pts:[[d,k],[d+n,k+i],[d,k+2*i],[d-n,k+i]],fill:y}),c.push({k:"poly",pts:[[d-n,k+i],[d,k+2*i],[d,k+2*i+h],[d-n,k+i+h]],fill:z}),c.push({k:"poly",pts:[[d,k+2*i],[d+n,k+i],[d+n,k+i+h],[d,k+2*i+h]],fill:E}),w++}M++}return c}function jt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,fl2:m,op:c}=t,o=[];let n;var i=Math.max(m(7),Math.round(a/(p*.112*((c.size!=null?c.size:100)/100)))),h=[],u=0;for(n=0;n<s;n++){var v=se(f[n]),M=v.s*(1-Math.abs(v.l-.5));h.push(M),M>u&&(u=M)}var k=[];for(n=0;n<s;n++)h[n]>=u*.5&&k.push(n);k.length||(k=[0]);for(var j=k.length,w=a/(2*i),d=w*Math.tan(Math.PI/6),z=2*d,N=3*d+z,y=2*N,E=Math.ceil(l/y)+2,b=function(re){return Math.round(re*10)/10},R=-1;R<=2*i+1;R++)for(var C=r+R*w,H=(R%2+2)%2*N,L=-1;L<E;L++){var D=e+L*y+H,X=f[((Math.floor(R/2)+L)%s+s)%s],I=se(X),G=Math.max(.18,I.s*.9),T=k[((Math.floor(R/2)+L)%j+j)%j],J=se(f[T]),Z=K(J.h,Math.max(.35,J.s*.95),.78),q=K(I.h,G,.52),V=K(I.h,G,.28),S=[b(C),b(D-2*d)],A=[b(C+w),b(D-d)],O=[b(C+w),b(D+d)],Q=[b(C),b(D+2*d)],U=[b(C-w),b(D+d)],$=[b(C-w),b(D-d)],fe=[U[0],b(U[1]+z)],ue=[Q[0],b(Q[1]+z)],de=[O[0],b(O[1]+z)];o.push({k:"poly",st:1,pts:[U,Q,ue,fe],fill:V}),o.push({k:"poly",st:1,pts:[Q,O,de,ue],fill:q}),o.push({k:"poly",st:1,pts:[S,A,O,Q,U,$],fill:Z})}return o}function zt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,fl2:m,op:c}=t,o=[];for(var n=Math.max(m(8),Math.round(a/(p*.133*((c.size!=null?c.size:100)/100)))),i=a/(3*n),h=i*Math.tan(Math.PI/6),u=4*h,v=6*h,M=Math.ceil(l/v)+2,k=l/2%v,j=function(J,Z){for(var q=J[0],V=J[1],S=0;S<Z.length;S++)q+=Z[S][0],V+=Z[S][1];return[Math.round(q*10)/10,Math.round(V*10)/10]},w=-1;w<=n+1;w++)for(var d=Math.round((r+w*3*i)*10)/10,z=(w%2+2)%2*3*h,N=f[(w%s+s)%s],y=se(N),E=Math.max(.18,y.s*.9),b=K(y.h,E,.78),R=K(y.h,E,.52),C=K(y.h,E,.28),H=[-i,-h],L=[i,-h],D=[i,h],X=[-i,h],I=[0,2*h],G=-2;G<M;G++){var T=[d,Math.round((e+k+G*v+z)*10)/10];
1o.push({k:"poly",st:1,pts:[T,j(T,[H,H]),j(T,[H,H,I]),j(T,[H,H,I,D]),j(T,[H,H,I,D,I]),j(T,[[0,u]])],fill:C}),o.push({k:"poly",st:1,pts:[T,j(T,[L,L]),j(T,[L,L,I]),j(T,[L,L,I,X]),j(T,[L,L,I,X,I]),j(T,[[0,u]])],fill:R}),o.push({k:"poly",st:1,pts:[T,j(T,[H,H]),j(T,[H,H,L]),j(T,[L])],fill:b}),o.push({k:"poly",st:1,pts:[T,j(T,[L,L]),j(T,[L,L,H]),j(T,[H])],fill:b})}return o}function Nt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,op:m}=t,c=[];var o=p*.11*((m.size!=null?m.size:100)/100),n=o*.25,i=o-n,h=Math.cos(Math.PI/6);c.push({k:"rect",x:r,y:e,w:a,h:l,fill:"#ffffff"});for(var u=Math.max(2,Math.round(a/(2*o*1.217))),v=Math.max(2,Math.round(l/(o*1.4))),M=a/(2*u),k=l/v,j=u+1,w=v+1,d=function(C){return Math.round(C*10)/10},z=function(C,H,L,D){if(!(C<r-o*3.4||C>r+a+o*3.4||H<e-o*3.4||H>e+l+o*3.4)){var X=se(D),I=Math.max(.18,X.s*.9),G=K(X.h,I,.78),T=K(X.h,I,.52),J=K(X.h,I,.28),Z=L?-1:1,q=function(Q,U,$){return[d(C+Z*(Q-U)*h),d(H+Z*((Q+U)*.5-$))]},V=function(Q,U,$,fe,ue){c.push({k:"poly",st:1,pts:[q(Q[0],Q[1],Q[2]),q(U[0],U[1],U[2]),q($[0],$[1],$[2]),q(fe[0],fe[1],fe[2])],fill:ue})},S=i,A=n,O=o;V([S+A,S,0],[S+A,S+A,0],[S+A,S+A,O],[S+A,S,O],J),V([S,S+A,0],[S+A,S+A,0],[S+A,S+A,O],[S,S+A,O],T),V([S,S,O],[S+A,S,O],[S+A,S+A,O],[S,S+A,O],G),V([0,0,A],[O,0,A],[O,A,A],[0,A,A],G),V([0,A,A],[O,A,A],[O,A,0],[0,A,0],T),V([O,0,A],[O,A,A],[O,A,0],[O,0,0],J),V([O-A,0,A],[O,0,A],[O,O,A],[O-A,O,A],G),V([O,0,A],[O,0,0],[O,O,0],[O,O,A],J),V([O-A,O,A],[O,O,A],[O,O,0],[O-A,O,0],T),V([S+A,S,0],[S+A,S+A,0],[S+A,S+A,2*A],[S+A,S,2*A],J),V([S,S+A,0],[S+A,S+A,0],[S+A,S+A,2*A],[S,S+A,2*A],T)}},N=-2;N<=j;N++)for(var y=-2;y<=w;y++){var E=(N%u+u)%u,b=(y%v+v)%v,R=(E+b)%s;z(r+2*N*M+o*.55,e+y*k+o*.583,!1,f[R]),z(r+2*N*M+o*2.417,e+y*k+o*2.033,!0,f[(R+1)%s])}return c}function Pt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,op:m}=t,c=[];for(var o=p*.085*((m.size!=null?m.size:100)/100),n=Math.ceil(a/o)+1,i=Math.ceil(l/o)+1,h=function(R){return Math.round(R*10)/10},u=0;u<i;u++)for(var v=0;v<n;v++){var M=se(f[((v+u)%s+s)%s]),k=Math.max(.18,M.s*.9),j=r+v*o,w=e+u*o,d=h(j+o/2),z=h(w+o/2),N=h(j),y=h(w),E=h(j+o),b=h(w+o);c.push({k:"poly",st:1,pts:[[N,y],[E,y],[d,z]],fill:K(M.h,k,.8)}),c.push({k:"poly",st:1,pts:[[N,y],[N,b],[d,z]],fill:K(M.h,k,.55)}),c.push({k:"poly",st:1,pts:[[E,y],[E,b],[d,z]],fill:K(M.h,k,.42)}),c.push({k:"poly",st:1,pts:[[N,b],[E,b],[d,z]],fill:K(M.h,k,.26)})}return c}function Rt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,op:m}=t,c=[];let o;var n=p*.065*((m.size!=null?m.size:100)/100),i=n/2,h=n*3.76,u=h,v=0,M=2;for(o=0;o<s;o++){var k=se(f[o]);k.l<M&&(M=k.l,v=o)}c.push({k:"rect",x:r,y:e,w:a,h:l,fill:f[v]});for(var j=Math.ceil(l/h)+2,w=Math.ceil(a/(2*n))+2,d=function(q){return Math.round(q*10)/10},z=function(q,V,S){c.push({k:"poly",st:1,pts:[[d(q),d(V-i)],[d(q+n),d(V)],[d(q),d(V+i)],[d(q-n),d(V)]],fill:S})},N=function(q,V,S,A,O){c.push({k:"poly",st:1,pts:[[d(q-n),d(V)],[d(q),d(V+i)],[d(q),d(V+i+O)],[d(q-n),d(V+O)]],fill:S}),c.push({k:"poly",st:1,pts:[[d(q),d(V+i)],[d(q+n),d(V)],[d(q+n),d(V+O)],[d(q),d(V+i+O)]],fill:A})},y=0;y<j;y++){for(var E=e+y*h,b=-1;b<w;b++){var R=r+b*2*n,C=se(f[(b%s+s)%s]),H=Math.max(.18,C.s*.9),L=se(f[((b+1)%s+s)%s]),D=Math.max(.18,L.s*.9),X=K(C.h,H,.52),I=K(L.h,D,.3);(b%2+2)%2===0?N(R,E,X,I,u):N(R,E-i,X,I,u+i)}for(var G=-1;G<w;G++){var T=r+G*2*n,J=se(f[(G%s+s)%s]),Z=K(J.h,Math.max(.35,J.s*.95),.18);(G%2+2)%2===0?z(T,E,Z):z(T,E-i,f[v])}}return c}function Et(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,fl2:m,op:c}=t,o=[];var n=a/Math.max(m(9),Math.round(a/(p*.115*((c.size!=null?c.size:100)/100)))),i=n*.53,h=n*.4,u=n*.2,v=i+u,M=se(f[0]);o.push({k:"rect",x:r,y:e,w:a,h:l,fill:K(M.h,Math.max(.18,M.s*.9),.28)});for(var k=Math.ceil((l+a*(i/n))/v)+4,j=Math.ceil(a/n)+3,w=-Math.ceil(a*(i/n)/2/v)-3,d=function(X){return Math.round(X*10)/10},z=w;z<k;z++)for(var N=f[(z%s+s)%s],y=se(N),E=Math.max(.18,y.s*.9),b=K(y.h,E,.78),R=K(y.h,E,.52),C=K(y.h,E,.28),H=-2;H<j;H++){var L=r+H*n,D=e+z*v+H*i-a*(i/n)/2;D<e-v*2||D>e+l+v*2||(o.push({k:"poly",st:1,pts:[[d(L+n),d(D)],[d(L+n+h),d(D-u)],[d(L+n+h),d(D-u+i)],[d(L+n),d(D+i)]],fill:C}),o.push({k:"rect",x:d(L),y:d(D),w:d(n),h:d(i),fill:R,st:1}),o.push({k:"poly",st:1,pts:[[d(L),d(D)],[d(L+n),d(D)],[d(L+n+h),d(D-u)],[d(L+h),d(D-u)]],fill:b}))}return o}function At(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,op:m}=t,c=[];let o;var n=p*.24*((m.size!=null?m.size:100)/100),i=a/Math.max(1,Math.round(a/n)),h=l/Math.max(1,Math.round(l/n)),u=Math.min(i,h)/320;c.push({k:"rect",x:r,y:e,w:a,h:l,fill:"#ffffff"});var v=[],M=0,k=2,j=0,w=-1;for(o=0;o<s;o++){var d=se(f[o]);d.l<=.82&&v.push(o),d.l<k&&(k=d.l,M=o);var z=d.s*(1-Math.abs(d.l-.5));z>w&&(w=z,j=o)}if(!v.length)for(o=0;o<s;o++)v.push(o);for(var N=v.length,y=function(T){return Math.round(T*10)/10},E=function(T,J,Z,q,V,S){var A=q+S,O=V-S,Q=Math.sin(Z),U=-Math.cos(Z),$=Math.cos(Z),fe=Math.sin(Z),ue=T+Q*A,de=J+U*A,re=T+Q*O,Ae=J+U*O,we=[],ge=8,me;for(me=0;me<=ge;me++){var Ve=Math.PI*(me/ge);we.push([y(re+(-$*Math.cos(Ve)+Q*Math.sin(Ve))*S),y(Ae+(-fe*Math.cos(Ve)+U*Math.sin(Ve))*S)])}for(me=0;me<=ge;me++){var Se=Math.PI*(me/ge);we.push([y(ue+($*Math.cos(Se)-Q*Math.sin(Se))*S),y(de+(fe*Math.cos(Se)-U*Math.sin(Se))*S)])}return we},b=Math.round(a/i),R=Math.round(l/h),C=0;C<R;C++)for(var H=0;H<b;H++){for(var L=r+(H+.5)*i,D=e+(C+.5)*h,X=0;X<10;X++)c.push({k:"poly",pts:E(L,D,X*Math.PI/5,36*u,118*u,15*u),fill:f[v[X%N]]});c.push({k:"circle",cx:y(L),cy:y(D),rad:y(37*u),fill:"#ffffff"}),c.push({k:"circle",cx:y(L),cy:y(D),rad:y(17*u),fill:f[M]})}for(var I=0;I<=R;I++)for(var G=0;G<=b;G++)c.push({k:"circle",cx:y(r+G*i),cy:y(e+I*h),rad:y(10*u),fill:f[j]});return c}function Lt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,fl2:m,op:c}=t,o=[];let n;var i=Math.max(m(6),Math.round(a/(p*.18*((c.size!=null?c.size:100)/100)))),h=a/(2*i),u=h*.56,v=Math.ceil(l/u)+3,M=0,k=-1;for(n=0;n<s;n++){var j=se(f[n]).l;j>k&&(k=j,M=n)}var w=[];for(n=0;n<s;n++)n!==M&&w.push(n);w.length||(w=[M]);var d=w.length;o.push({k:"rect",x:r,y:e,w:a,h:l,fill:f[w[0]]});for(var z=[1,.72],N=-1;N<v;
1N++)for(var y=(N%2+2)%2*h,E=-1;E<=i;E++){for(var b=r+E*2*h+y,R=e+N*u,C=((2*E+N)%d+d)%d,H=0;H<2;H++)o.push({k:"circle",cx:Math.round(b*10)/10,cy:Math.round(R*10)/10,rad:Math.round(h*z[H]*10)/10,fill:f[w[(C+H)%d]]});o.push({k:"circle",cx:Math.round(b*10)/10,cy:Math.round(R*10)/10,rad:Math.round(h*.42*10)/10,fill:f[M]})}return o}function Ct(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,fl2:m,op:c}=t,o=[];let n;var i=a/Math.max(m(10),Math.round(a/(p*.062))),h=i*.34*((c.swell!=null?c.swell:100)/100),u=p*.16,v=Math.ceil(a/i)+3,M=Math.max(120,Math.min(220,Math.round(l/8))),k=0;for(n=0;n<s;n++)k+=se(f[n]).l;var j=k/s<.45?"rgba(245,242,250,0.35)":"rgba(29,29,31,0.3)",w=Math.max(1.4,i*.035);o.push({k:"rect",x:r,y:e,w:a,h:l,fill:f[0]});for(var d=function(D){return Math.round(D*10)/10},z=function(D,X){return r+D*i+h*Math.sin((X-e)/u*Math.PI*2)},N=-2;N<v;N++){for(var y=[],E=[],b=0;b<=M;b++){var R=e-6+(l+12)*b/M;y.push([d(z(N,R)),d(R)]),E.push([d(z(N+1,R)),d(R)])}o.push({k:"poly",pts:y.concat(E.slice().reverse()),fill:f[(N%s+s)%s]});for(var C=[],H=0;H<y.length;H++)C.push([d(y[H][0]-w/2),y[H][1]]);for(var L=y.length-1;L>=0;L--)C.push([d(y[L][0]+w/2),y[L][1]]);o.push({k:"poly",pts:C,fill:j})}return o}function Ht(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,uScale:m,op:c}=t,o=[];let n,i;var h=function(je){return Math.round(je*10)/10},u=m||1,v=p/u,M=Math.max(22,Math.round(a/(v*.036))),k=Math.max(10,Math.round(l/(a/M))),j=.5,w=Math.round(M/j),d=Math.round(k/j),z=Ma(880+s*131+((c.mix!=null?c.mix:1)-1)*977),N=[],y=[];for(n=0;n<=w;n++)N.push(z()<.5?0:1);for(i=0;i<=d;i++)y.push(z()<.5?0:1);var E=function(je,Le){return(Le+N[je])%2===0},b=function(je,Le){return(je+y[Le])%2===0},R=[];for(n=0;n<w*d;n++)R.push(-1);for(var C=[],H=0,L=0;L<w*d;L++)if(R[L]===-1){var D=H++;C.push({});var X=[L];for(R[L]=D;X.length;){var I=X.pop(),G=I%w,T=Math.floor(I/w),J=function(je,Le,oa){if(!(je<0||Le<0||je>=w||Le>=d)){var We=Le*w+je;if(oa){R[We]!==-1&&R[We]!==D&&(C[D][R[We]]=1,C[R[We]][D]=1);return}R[We]===-1&&(R[We]=D,X.push(We))}};J(G-1,T,E(G,T)),J(G+1,T,E(G+1,T)),J(G,T-1,b(G,T)),J(G,T+1,b(G,T+1))}}for(var Z=[],q=0;q<H;q++){var V={};for(var S in C[q])Z[S]!==void 0&&(V[Z[S]]=1);for(var A=[],O=0;O<s;O++)V[O]||A.push(O);Z.push(A.length?A[Math.floor(z()*A.length)]:Math.floor(z()*s))}var Q=Math.min(w,Math.max(2,Math.round(M/u))),U=Math.min(d,Math.max(2,Math.round(k/u))),$=Math.floor((w-Q)/2),fe=Math.floor((d-U)/2),ue=a/Q,de=l/U;for(i=0;i<U;i++)for(var re=0;re<Q;){for(var Ae=Z[R[(i+fe)*w+(re+$)]],we=re+1;we<Q&&Z[R[(i+fe)*w+(we+$)]]===Ae;)we++;o.push({k:"rect",x:h(r+re*ue),y:h(e+i*de),w:h((we-re)*ue+.6),h:h(de+.6),fill:f[Ae]}),re=we}var ge=Math.max(1.4,Math.min(ue,de)*.1),me=Math.min(ue,de)*.16,Ve=0;for(n=0;n<s;n++)Ve+=se(f[n]).l;var Se=Ve/s<.45?"#f2eef8":"#2a2140";for(n=0;n<=Q;n++)for(i=0;i<U;i++)if(E(n+$,i+fe)){var $e=Math.min(Math.max(r,r+n*ue-ge/2),r+a-ge);o.push({k:"rect",x:h($e),y:h(e+i*de+me),w:h(ge),h:h(de-2*me),fill:Se})}for(i=0;i<=U;i++)for(n=0;n<Q;n++)if(b(n+$,i+fe)){var ha=Math.min(Math.max(e,e+i*de-ge/2),e+l-ge);o.push({k:"rect",x:h(r+n*ue+me),y:h(ha),w:h(ue-2*me),h:h(ge),fill:Se})}return o}function Ot(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,mn:p,uScale:m,op:c}=t,o=[];let n;var i=Math.max(2,Math.round(Math.max(s+1,Math.round(s*1.43))/m)),h=Math.max(44,Math.round(60/m)),u=Math.min(l/i*.7,Math.min(l/i*.4,p*.05)*((c.swell!=null?c.swell:100)/100)),v=function(z,N){return e+l*z/i+u*Math.sin((N-r)/a*Math.PI*4.2/m+z*1.15)};for(n=0;n<i;n++){for(var M=[],k=0;k<=h;k++){var j=r+a*k/h;M.push([Math.round(j*10)/10,Math.round((n===0?e:v(n,j))*10)/10])}for(var w=h;w>=0;w--){var d=r+a*w/h;M.push([Math.round(d*10)/10,Math.round((n===i-1?e+l:v(n+1,d))*10)/10])}o.push({k:"poly",pts:M,fill:f[n%s]})}return o}function Tt(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,uScale:p,op:m}=t,c=[];let o;var n=r+a/2,i=e+l/2,h=Math.sqrt(a*a+l*l)/2*1.02,u=m.arms!=null?Math.max(3,Math.round(m.arms)):Math.max(4,Math.round(Math.max(6,s*2)));s>1&&(u-1)%s===0&&u++;var v=3.9/(p||1),M=Math.max(90,Math.min(220,Math.round(h/9)));for(o=0;o<u;o++){for(var k=o*2*Math.PI/u-Math.PI/2,j=(o+1)*2*Math.PI/u-Math.PI/2+.014,w=[],d=0;d<=M;d++){var z=h*d/M,N=k+v*d/M;w.push([Math.round((n+Math.cos(N)*z)*10)/10,Math.round((i+Math.sin(N)*z)*10)/10])}for(var y=Math.max(14,Math.round(h*(j-k)/10)),E=1;E<=y;E++){var b=k+v+(j-k)*E/y;w.push([Math.round((n+Math.cos(b)*h)*10)/10,Math.round((i+Math.sin(b)*h)*10)/10])}for(var R=M;R>=0;R--){var C=h*R/M,H=j+v*R/M;w.push([Math.round((n+Math.cos(H)*C)*10)/10,Math.round((i+Math.sin(H)*C)*10)/10])}c.push({k:"poly",pts:w,fill:f[o%s]})}return c}function _t(t){const{ax:r,ay:e,aw:a,ah:l,colors:f,n:s,op:p,varSeed:m}=t,c=t.detail||1,o=[];
1var n=p.detail!=null?p.detail:20,i=6,h=4,u=c<1?Math.max(28,Math.round(116*.45)):116,v=Math.max(72,Math.min(248,Math.round(u*a/l))),M=a/(v-2*i),k=l/(u-2*i),j=a/720,w=function(ne){var ae=Ma(ne),ve=new Uint8Array(512),ee=new Uint8Array(256),B,Me,ze;for(B=0;B<256;B++)ee[B]=B;for(B=255;B>0;B--)Me=Math.floor(ae()*(B+1)),ze=ee[B],ee[B]=ee[Me],ee[Me]=ze;for(B=0;B<512;B++)ve[B]=ee[B&255];var le=[[1,1],[-1,1],[1,-1],[-1,-1],[1,0],[-1,0],[0,1],[0,-1]],He=.5*(Math.sqrt(3)-1),oe=(3-Math.sqrt(3))/6;return function(Ne,Y){var De=0,Pe=0,he=0,Fe=(Ne+Y)*He,Oe=Math.floor(Ne+Fe),Ge=Math.floor(Y+Fe),ie=(Oe+Ge)*oe,Re=Ne-(Oe-ie),ye=Y-(Ge-ie),Ie,Ye;Re>ye?(Ie=1,Ye=0):(Ie=0,Ye=1);var ea=Re-Ie+oe,Xe=ye-Ye+oe,va=Re-1+2*oe,ga=ye-1+2*oe,aa=Oe&255,Ze=Ge&255,Ee,ce;return ce=.5-Re*Re-ye*ye,ce>=0&&(Ee=le[ve[aa+ve[Ze]]&7],ce*=ce,De=ce*ce*(Ee[0]*Re+Ee[1]*ye)),ce=.5-ea*ea-Xe*Xe,ce>=0&&(Ee=le[ve[aa+Ie+ve[Ze+Ye]]&7],ce*=ce,Pe=ce*ce*(Ee[0]*ea+Ee[1]*Xe)),ce=.5-va*va-ga*ga,ce>=0&&(Ee=le[ve[aa+1+ve[Ze+1]]&7],ce*=ce,he=ce*ce*(Ee[0]*va+Ee[1]*ga)),70*(De+Pe+he)}},d=w(8823+m>>>0),z=w(9814+m>>>0),N=function(ne,ae,ve,ee){for(var B=.55,Me=1,ze=0,le=0,He=0;He<ee;He++)ze+=B*ne(ae*Me,ve*Me),le+=B,B*=.42,Me*=2.1;return ze/le},y=new Float64Array(v*u),E=.0095*(100/(p.relief!=null?p.relief:100)),b,R;for(R=0;R<u;R++)for(b=0;b<v;b++){var C=b*E,H=R*E,L=N(z,C+5.2,H+1.3,2),D=N(z,C+9.7,H+8.1,2);y[R*v+b]=N(d,C+.3*L,H+.3*D,3)}var X=new Float64Array(y.length),I;for(I=0;I<4;I++){for(R=0;R<u;R++)for(b=0;b<v;b++){var G=Math.max(0,b-1),T=Math.min(v-1,b+1);X[R*v+b]=(y[R*v+G]+y[R*v+b]+y[R*v+T])/3}for(R=0;R<u;R++)for(b=0;b<v;b++){var J=Math.max(0,R-1),Z=Math.min(u-1,R+1);y[R*v+b]=(X[J*v+b]+X[R*v+b]+X[Z*v+b])/3}}var q=1/0,V=-1/0,S;for(S=0;S<y.length;S++)y[S]<q&&(q=y[S]),y[S]>V&&(V=y[S]);var A=V-q||1;for(S=0;S<y.length;S++)y[S]=(y[S]-q)/A;var O=function(ne,ae){return ne<0||ae<0||ne>=v||ae>=u?-1:y[ae*v+ne]},Q=function(ne){for(var ae=[],ve=function(ta,Ha){return(ne-ta)/(Ha-ta)},ee=-1;ee<u;ee++)for(var B=-1;B<v;B++){var Me=O(B,ee),ze=O(B+1,ee),le=O(B+1,ee+1),He=O(B,ee+1),oe=(Me>=ne?8:0)|(ze>=ne?4:0)|(le>=ne?2:0)|(He>=ne?1:0);if(!(oe===0||oe===15)){var Ne=[B+ve(Me,ze),ee],Y=[B+1,ee+ve(ze,le)],De=[B+ve(He,le),ee+1],Pe=[B,ee+ve(Me,He)],he=function(ta,Ha){ae.push([ta,Ha])};if(oe===1||oe===14)he(Pe,De);else if(oe===2||oe===13)he(De,Y);else if(oe===3||oe===12)he(Pe,Y);else if(oe===4||oe===11)he(Ne,Y);else if(oe===6||oe===9)he(Ne,De);else if(oe===7||oe===8)he(Pe,Ne);else{var Fe=(Me+ze+le+He)/4>=ne;oe===5?Fe?(he(Pe,Ne),he(De,Y)):(he(Pe,De),he(Ne,Y)):Fe?(he(Ne,Y),he(Pe,De)):(he(Pe,Ne),he(De,Y))}}}for(var Oe=function(ta){return Math.round(ta[0]*512)+"_"+Math.round(ta[1]*512)},Ge={},ie=0;ie<ae.length;ie++){var Re=Oe(ae[ie][0]),ye=Oe(ae[ie][1]);(Ge[Re]=Ge[Re]||[]).push(ie),(Ge[ye]=Ge[ye]||[]).push(ie)}var Ie=new Uint8Array(ae.length),Ye=[];for(ie=0;ie<ae.length;ie++)if(!Ie[ie]){Ie[ie]=1;for(var ea=[ae[ie][0],ae[ie][1]],Xe=Oe(ae[ie][1]),va=Oe(ae[ie][0]),ga=0;Xe!==va&&ga++<1e5;){for(var aa=Ge[Xe]||[],Ze=-1,Ee=0;Ee<aa.length;Ee++)if(!Ie[aa[Ee]]){Ze=aa[Ee];break}if(Ze===-1)break;Ie[Ze]=1;var ce=ae[Ze],Wa=Oe(ce[0])===Xe?ce[1]:ce[0];ea.push(Wa),Xe=Oe(Wa)}ea.length>=4&&Ye.push(ea)}return Ye},U=function(ne){return Math.round((r+(ne-i)*M)*10)/10},$=function(ne){return Math.round((e+(ne-i)*k)*10)/10},fe=Math.pow(4*(a/720),2),ue=30*(a/720),de=function(ne){for(var ae="",ve=0;ve<ne.length;ve++){for(var ee=ne[ve],B=[ee[0]],Me=U(ee[0][0]),ze=$(ee[0][1]),le=1;le<ee.length-1;le++){var He=U(ee[le][0]),oe=$(ee[le][1]);(He-Me)*(He-Me)+(oe-ze)*(oe-ze)>=fe&&(B.push(ee[le]),Me=He,ze=oe)}B.push(ee[ee.length-1]);var Ne=0;for(le=1;le<B.length;le++)Ne+=Math.hypot((B[le][0]-B[le-1][0])*M,(B[le][1]-B[le-1][1])*k);if(!(B.length<5&&Ne<ue)){var Y=B;if(Y[0][0]===Y[Y.length-1][0]&&Y[0][1]===Y[Y.length-1][1]&&(Y=Y.slice(0,-1)),c<1&&Y.length>12){for(var De=Math.max(2,Math.round(1/c)),Pe=[],he=0;he<Y.length;he+=De)Pe.push(Y[he]);Pe.length>=3&&(Y=Pe)}var Fe=Y.length;if(!(Fe<3)){var Oe=function(ye){return Math.round((U(Y[ye][0])+U(Y[(ye+1)%Fe][0]))/2*10)/10},Ge=function(ye){return Math.round(($(Y[ye][1])+$(Y[(ye+1)%Fe][1]))/2*10)/10};ae+="M"+Oe(0)+" "+Ge(0);for(var ie=1;ie<=Fe;ie++){var Re=ie%Fe;ae+="Q"+U(Y[Re][0])+" "+$(Y[Re][1])+" "+Oe(Re)+" "+Ge(Re)}ae+="Z"}}}return ae},re=[];for(S=0;S<s;S++){var Ae=se(f[S]);re.push({i:S,l:Ae.l})}re.sort(function(ne,ae){return ae.l-ne.l});var we=re[0].i,ge=Math.max(1,s-1),me=re[s-1].i,Ve=re[Math.max(0,s-2)].i;o.push({k:"rect",x:r,y:e,w:a,h:l,fill:f[we]});var Se=[];for(S=1;S<n;S++)Se.push(Q(S/n));for(S=0;S<ge;S++){var $e=Math.round((S+1)*n/(ge+1))-1;$e=Math.max(0,Math.min(n-2,$e));var ha=re[Math.min(S+1,s-1)].i,je=de(Se[$e]);je&&o.push({k:"path",d:je,fill:f[ha],fr:"evenodd"})}for(S=0;S<n-1;S++){var Le=(S+1)%h===0,oa=de(Se[S]);oa&&o.push({k:"path",d:oa,fill:"none",sk:f[Le?me:Ve],sw:Math.round((Le?2:.9)*j*10)/10,op:Le?.95:.62})}var We=Math.pow(2.2*(a/720),2),wa=p.labels==null||p.labels===1,fa=Math.round(11*j*10)/10,ua=Math.round(3.2*j*10)/10,ya=170*(a/720),Ea=24*(a/720),ka=60*(a/720);for(S=0;wa&&S<n-1;S++)if((S+1)%h===0){for(var sa=(S+1)*25,x=Se[S],P=[],_=0;_<x.length;_++){for(var W=x[_],xe=0,te=1;te<W.length;te++)xe+=Math.hypot((W[te][0]-W[te-1][0])*M,(W[te][1]-W[te-1][1])*k);xe>=ya&&P.push({r:W,L:xe})}for(P.sort(function(ne,ae){return ae.L-ne.L}),_=0;_<Math.min(4,P.length);_++){var Te=P[_].r,pe=[Te[0]],be=U(Te[0][0]),da=$(Te[0][1]);for(te=1;te<Te.length-1;te++){var la=U(Te[te][0]),qe=$(Te[te][1]);(la-be)*(la-be)+(qe-da)*(qe-da)>=We&&(pe.push(Te[te]),be=la,da=qe)}var Be=pe.length;if(!(Be<10)){var Ce=null,Qe=1/0;for(te=3;te<Be-3;te+=2){var Ue=pe[te-3],_e=pe[te],Ke=pe[te+3],pa=Math.atan2($(_e[1])-$(Ue[1]),U(_e[0])-U(Ue[0])),Ga=Math.atan2($(Ke[1])-$(_e[1]),U(Ke[0])-U(_e[0])),Sa=Math.abs(Ga-pa);Sa>Math.PI&&(Sa=2*Math.PI-Sa);var Aa=U(_e[0]),La=$(_e[1]),Ca=Math.min(Aa-r,r+a-Aa,La-e,e+l-La);if(!(Ca<Ea)){var Va=Sa+(Ca<ka?(ka-Ca)*.05/(a/720):0);if(Va<Qe){Qe=Va;var ma=(pa+Ga)/2*180/Math.PI;ma>90&&(ma-=180),ma<-90&&(ma+=180),Ce={x:Aa,y:La,ang:Math.round(ma*10)/10}}}}Ce&&o.push({k:"text",x:Ce.x,y:Ce.y,rot:Ce.ang,str:sa+" m",size:fa,fill:f[me],halo:f[we],hw:ua})}}}return o}const Dt="yblocks",Ba=[{id:"yblocks",label:"Y blocks",popular:!0,miniView:{z:1.9},draw:zt},{id:"stitch",label:"Stitching",miniView:{z:2.4},draw:Ht},{id:"bloom",label:"Bloom grid",miniView:{z:1.6},draw:At}
1,{id:"arches",label:"Arches",miniView:{z:1,anchor:"b"},draw:wt},{id:"chevron",label:"Retro chevron",miniView:{z:2},draw:it},{id:"hbars",label:"Horizontal bars",miniView:{z:1},draw:ct},{id:"vstripes",label:"Thin stripes",miniView:{z:1},draw:ht},{id:"hstripes",label:"Sideways stripes",miniView:{z:1},draw:ft},{id:"sigstripes",label:"Signature stripes",miniView:{z:1.4},draw:mt},{id:"checker",label:"Checkerboard",miniView:{z:1.5},draw:vt},{id:"weave",label:"Basket weave",miniView:{z:1.8},draw:xt},{id:"mosaic",label:"Mosaic",miniView:{z:2.2},draw:gt},{id:"diagonal",label:"Diagonal",miniView:{z:1.6},draw:ut},{id:"tumbling",label:"Tumbling blocks",miniView:{z:1.9},draw:kt},{id:"cubes",label:"Isometric cubes",popular:!0,miniView:{z:1.9},draw:St},{id:"penrose",label:"Penrose lattice",miniView:{z:2},draw:Nt},{id:"hexes",label:"Hex prisms",miniView:{z:1.9},draw:jt},{id:"stairs",label:"Isometric stairs",miniView:{z:1.9},draw:Et},{id:"columns",label:"Isometric columns",miniView:{z:1.5},draw:Rt},{id:"triangles",label:"Triangles",miniView:{z:1.9},draw:pt},{id:"pyramids",label:"Pyramid pop",miniView:{z:2},draw:Pt},{id:"diamonds",label:"Diamonds",miniView:{z:1.7},draw:bt},{id:"waves",label:"Waves",miniView:{z:1},draw:Ot},{id:"survey",label:"Ink survey",miniView:{z:1.15},draw:_t},{id:"wstripes",label:"Wave stripes",miniView:{z:1.3},draw:Ct},{id:"zigzag",label:"Zigzag",miniView:{z:1.7},draw:dt},{id:"gem",label:"Gem",miniView:{z:1.6},draw:Mt},{id:"shingles",label:"Shingles",popular:!0,miniView:{z:1.9},draw:yt},{id:"scallops",label:"Deco scallops",miniView:{z:1.7},draw:Lt},{id:"spiral",label:"Spiral",miniView:{z:1},draw:Tt}],za=Object.fromEntries(Ba.map(t=>[t.id,t]));function na(t){return za[t]||za[Dt]}function _a(t,r){return na(t).draw(r)}function Da(t,r,e,a,l,f,s,p,m,c={},o=1){const n=s||1;return{ax:t,ay:r,aw:e,ah:a,colors:l,n:l.length,mn:f,uScale:n,ov:1,varAmt:p,varSeed:m,op:c||{},detail:o,fl2:i=>Math.max(2,Math.round(i/n)),barWeights:i=>qa(i,p,m)}}function Gt(t){const r=ca.filter(l=>l.id===t.size)[0];let e,a;if(r.unit==="in"?(e=r.w*300,a=r.h*300):(e=r.w,a=r.h),!r.lock&&t.orient==="landscape"){const l=e;e=a,a=l}return{w:Math.round(e),h:Math.round(a),s:r}}function Vt(t){if(t.bg==="white")return"#ffffff";const r=se(t.colors[0]);return t.bg==="tint"?K(r.h,Math.min(1,r.s*.45),.94):K(r.h,Math.min(1,r.s*.6),.11)}function Pa(t){const r=Gt(t),e=r.w,a=r.h,l=r.s,f=Math.min(e,a),s=l.id==="phone"||l.id==="desktop",p=t.frame==="none",m=s||p?0:Math.round(f*.085),c=p?Math.round(f*.05):0,o=Ia[t.font],n=t.title.trim(),i=!!n||t.hex,h=n?Math.round(f*.052):0,u=t.hex?Math.round(f*.024):0;let v=0;const M=Math.round(p?f*.055:f*.014);i&&!s&&(v=Math.round(f*.058)+h+(n&&t.hex?Math.round(f*.036):0)+u+M);const k=Vt(t),j=t.bg==="dark",w=j?"#f5f5f7":"#1d1d1f",d=j?"#d1d1d6":"#8e8e93",z=m,N=m,y=e-m*2,E=a-m*2-v,b=!s&&!p?Math.max(2,Math.round(f*.01)):0,R=Da(z-b,N-b,y+b*2,E+b*2,t.colors,f*(t.scale||1),t.scale||1,t.varAmt,t.varSeed,t.opts[t.layout]||{}),C=_a(t.layout,R),H=C.length;if(!s&&!p&&(C.push({k:"rect",x:0,y:0,w:e,h:N,fill:k}),C.push({k:"rect",x:0,y:N,w:z,h:E,fill:k}),C.push({k:"rect",x:z+y,y:N,w:e-z-y,h:E,fill:k}),C.push({k:"rect",x:0,y:N+E,w:e,h:a-(N+E),fill:k})),!s&&!p){const G=Math.max(1,Math.round(f*.0016*10)/10),T=j?"#f5f5f7":"#1d1d1f";C.push({k:"path",d:"M"+z+" "+N+"H"+(z+y)+"V"+(N+E)+"H"+z+"Z",fill:"none",sk:T,sw:G})}const L=[],D=t.align==="center"?"middle":t.align==="right"?"end":"start";function X(G,T){return t.align==="center"?G+T/2:t.align==="right"?G+T:G}function I(G,T,J,Z,q,V){const S=t.hexStyle!=="plain",A=S?Z*.9:0,O=t.colors.map(function(re){return re.length*Z*.62+A*2}),Q=S?Z*.75:Z*1.6,U=O.reduce(function(re,Ae){return re+Ae},0)+Q*(t.colors.length-1);let $=t.align==="center"?G+(T-U)/2:t.align==="right"?G+T-U:G;const fe=Z*1.9,ue=t.hexStyle==="black"?"#1d1d1f":s||j?"#ffffff":"#f5f5f7",de=t.hexStyle==="black"?"#ffffff":"#1d1d1f";t.colors.forEach(function(re,Ae){S?(C.push({k:"pill",x:$,y:J-Z*1.34,w:O[Ae],h:fe,rx:fe/2,fill:ue}),L.push({x:$+A,y:J,size:Z,align:"start",fill:de,font:o,weight:500,ls:"0.02em",str:re,op:1})):L.push({x:$,y:J,size:Z,align:"start",fill:q,font:o,weight:400,ls:"0.02em",str:re,op:V}),$+=O[Ae]+Q})}if(s){const G=lt(t.colors),T=Math.round(f*.06),J=e-T*2;let Z=a-T;t.hex&&(I(T,J,Z,u,G,.72),Z-=u+Math.round(f*.036)),n&&L.push({x:X(T,J),y:Z,size:h,align:D,fill:G,font:o,weight:500,ls:"-0.02em",str:n,op:1})}else if(i){const G=z+c,T=y-c*2;let J=N+E+Math.round(f*.058);n&&(L.push({x:X(G,T),y:J+h*.78,size:h,align:D,fill:w,font:o,weight:500,ls:"-0.02em",str:n,op:1}),J+=h+Math.round(f*.036)),t.hex&&I(G,T,J+u*.78,u,d,1)}return{shapes:C,texts:L,W:e,H:a,bg:k,titleText:n||t.name,coreCount:H}}function ba(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function xa(t,r,e,a){const l=t.grad?"url(#"+e+r+")":t.fill;return t.k==="rect"?"<rect"+a+' x="'+t.x+'" y="'+t.y+'" width="'+t.w+'" height="'+t.h+'" fill="'+l+'"/>':t.k==="pill"?"<rect"+a+' x="'+t.x+'" y="'+t.y+'" width="'+t.w+'" height="'+t.h+'" rx="'+t.rx+'" fill="'+l+'"/>':t.k==="poly"?"<polygon"+a+' points="'+(t.pts||[]).map(f=>f[0]+","+f[1]).join(" ")+'" fill="'+l+'"'+(t.st?' stroke="'+l+'" stroke-width="0.8"':"")+"/>":t.k==="path"?"<path"+a+' d="'+t.d+'" fill="'+(t.fill||"none")+'"'+(t.fr?' fill-rule="'+t.fr+'"':"")+(t.sk?' stroke="'+t.sk+'" stroke-width="'+t.sw+'" stroke-linejoin="round" stroke-linecap="round"':"")+(t.op!=null?' opacity="'+t.op+'"':"")+"/>":t.k==="text"?"<text"+a+' x="'+t.x+'" y="'+t.y+'"'+(t.rot?' transform="rotate('+t.rot+" "+t.x+" "+t.y+')"':"")+` font-family="'Inter',sans-serif" font-size="`+t.size+'" font-weight="600" fill="'+t.fill+'" stroke="'+t.halo+'" stroke-width="'+t.hw+'" paint-order="stroke" stroke-linejoin="round" text-anchor="middle" dominant-baseline="middle">'+ba(t.str||"")+"</text>":"<circle"+a+' cx="'+t.cx+'" cy="'+t.cy+'" r="'+t.rad+'" fill="'+l+'"/>'}function Ua(t,r){let e="";return t.forEach(function(a,l){a.grad&&(e+='<linearGradient id="'+r+l+'" gradientUnits="userSpaceOnUse" x1="'+a.grad.x1+'" y1="'+a.grad.y1+'" x2="'+a.grad.x2+'" y2="'+a.grad.y2+'"><stop offset="0" stop-color="'+a.grad.c1+'"/><stop offset="1" stop-color="'+a.grad.c2+'"/></linearGradient>')}),e}const Xa=300;function Za(t,r,e=Xa){let a=function(c){return""},l=a;const f=!!r&&t.shapes.length<=e,s=!!r&&t.shapes.length>e;if(f){const c=Math.min(.013,.26/Math.max(1,t.shapes.length)),o=t.shapes.length*c;a=function(n){return' class="anim-s" style="animation-delay:'+(n*c).toFixed(3)+'s"'},l=function(n){return' class="anim-t" style="animation-delay:'+(o+.05+n*.045).toFixed(3)+'s"'}}let p='<svg xmlns="http://www.w3.org/2000/svg" width="'+t.W+'" height="'+t.H+'" viewBox="0 0 '+t.W+" "+t.H+'">';p+="<title>"+ba(t.titleText)+" color pattern, jukeboxprint.com</title>",p+="<desc>Custom color pattern made with the Jukebox Print free pattern generator, https://www.jukeboxprint.com/tools/free-pattern-generator</desc>",p+='<rect width="'+t.W+'" height="'+t.H+'" fill="'+(t.bg||"#ffffff")+'"/>';const m=Ua(t.shapes,"lg");if(m&&(p+="<defs>"+m+"</defs>"),s){const c=Math.max(1,t.coreCount),o=Math.min(14,c),n=Math.ceil(c/o),i=.045;for(let h=0;h<o;h++){const u=h*n;if(u>=c)break;const v=Math.min(c,u+n);p+='<g class="anim-g" style="animation-delay:'+(h*i).toFixed(3)+'s">';for(let M=u;M<v;M++)p+=xa(t.shapes[M],M,"lg","");p+="</g>"}for(let h=c;h<t.shapes.length;h++)p+=xa(t.shapes[h],h,"lg","")}
1else t.shapes.forEach(function(c,o){p+=xa(c,o,"lg",a(o))});return t.texts.forEach(function(c,o){p+="<text"+l(o)+' x="'+c.x+'" y="'+c.y+'" font-family="'+c.font.css.replace(/"/g,"'")+'" font-size="'+c.size+'" font-weight="'+c.weight+'" letter-spacing="'+c.ls+'" fill="'+c.fill+'"'+(c.op!==void 0&&c.op<1?' fill-opacity="'+c.op+'"':"")+' text-anchor="'+c.align+'">'+ba(c.str)+"</text>"}),p+"</svg>"}function Ja(t){const r=document.createElement("canvas");r.width=t.W,r.height=t.H;const e=r.getContext("2d");return e.fillStyle=t.bg||"#ffffff",e.fillRect(0,0,t.W,t.H),t.shapes.forEach(function(a){if(a.grad){const l=e.createLinearGradient(a.grad.x1,a.grad.y1,a.grad.x2,a.grad.y2);l.addColorStop(0,a.grad.c1),l.addColorStop(1,a.grad.c2),e.fillStyle=l}else e.fillStyle=a.fill;if(a.k==="rect")e.fillRect(a.x,a.y,a.w,a.h);else if(a.k==="pill")e.beginPath(),e.roundRect?e.roundRect(a.x,a.y,a.w,a.h,a.rx):e.rect(a.x,a.y,a.w,a.h),e.fill();else if(a.k==="poly"){const l=a.pts;e.beginPath(),e.moveTo(l[0][0],l[0][1]);for(let f=1;f<l.length;f++)e.lineTo(l[f][0],l[f][1]);e.closePath(),e.fill(),a.st&&(e.strokeStyle=e.fillStyle,e.lineWidth=.8,e.stroke())}else if(a.k==="path"){const l=new Path2D(a.d);a.op!=null&&(e.globalAlpha=a.op),a.fill&&a.fill!=="none"&&e.fill(l,a.fr==="evenodd"?"evenodd":"nonzero"),a.sk&&(e.strokeStyle=a.sk,e.lineWidth=a.sw||1,e.lineJoin="round",e.lineCap="round",e.stroke(l)),e.globalAlpha=1}else a.k==="text"?(e.save(),e.translate(a.x,a.y),a.rot&&e.rotate(a.rot*Math.PI/180),e.font="600 "+a.size+"px Inter, sans-serif",e.textAlign="center",e.textBaseline="middle",e.lineJoin="round",e.strokeStyle=a.halo,e.lineWidth=a.hw*2,e.strokeText(a.str,0,0),e.fillStyle=a.fill,e.fillText(a.str,0,0),e.restore()):(e.beginPath(),e.arc(a.cx,a.cy,a.rad,0,Math.PI*2),e.fill())}),t.texts.forEach(function(a){e.globalAlpha=a.op!==void 0?a.op:1,e.fillStyle=a.fill,e.font=a.weight+" "+a.size+"px "+a.font.canvas+", sans-serif",e.textAlign=a.align==="middle"?"center":a.align==="end"?"right":"left",e.fillText(a.str,a.x,a.y),e.globalAlpha=1}),r}function ia(t,r,e,a,l){const f=l||{},s=Da(0,0,e,a,r,a,1,f.varAmt||0,f.varSeed||1234567),p=_a(t,s),m="thumb-"+t+"-";let c='<svg viewBox="0 0 '+e+" "+a+'"'+(f.preserve?' preserveAspectRatio="xMidYMid slice"':"")+' xmlns="http://www.w3.org/2000/svg">';f.bg&&(c+='<rect width="'+e+'" height="'+a+'" fill="'+f.bg+'"/>');const o=Ua(p,m);return o&&(c+="<defs>"+o+"</defs>"),p.forEach(function(n,i){c+=xa(n,i,m,"")}),c+"</svg>"}function Wt(t,r,e,a){const s=na(t).miniView||{z:1.7};let m=460/(s.z||1.7),c=m*(44/84);c>300&&(c=300,m=c*(84/44));const o=(460-m)/2,n=s.anchor==="b"?300-c:(300-c)/2,i=Da(0,0,460,300,r,300,1,e,a,{},.2),h=_a(t,i),u=8,v=function(w){if(w.k==="path")return!0;if(w.k==="circle")return w.cx+w.rad>o-u&&w.cx-w.rad<o+m+u&&w.cy+w.rad>n-u&&w.cy-w.rad<n+c+u;if(w.k==="poly"){let d=1e9,z=-1e9,N=1e9,y=-1e9;const E=w.pts;for(let b=0;b<E.length;b++)E[b][0]<d&&(d=E[b][0]),E[b][0]>z&&(z=E[b][0]),E[b][1]<N&&(N=E[b][1]),E[b][1]>y&&(y=E[b][1]);return z>o-u&&d<o+m+u&&y>n-u&&N<n+c+u}return w.x+w.w>o-u&&w.x<o+m+u&&w.y+w.h>n-u&&w.y<n+c+u},M="mlg-"+t+"-";let k='<svg viewBox="'+Math.round(o*10)/10+" "+Math.round(n*10)/10+" "+Math.round(m*10)/10+" "+Math.round(c*10)/10+'" preserveAspectRatio="xMidYMid slice" xmlns="http://www.w3.org/2000/svg">',j="";return h.forEach(function(w,d){w.grad&&v(w)&&(j+='<linearGradient id="'+M+d+'" gradientUnits="userSpaceOnUse" x1="'+w.grad.x1+'" y1="'+w.grad.y1+'" x2="'+w.grad.x2+'" y2="'+w.grad.y2+'"><stop offset="0" stop-color="'+w.grad.c1+'"/><stop offset="1" stop-color="'+w.grad.c2+'"/></linearGradient>')}),j&&(k+="<defs>"+j+"</defs>"),h.forEach(function(w,d){w.k!=="text"&&v(w)&&(k+=xa(w,d,M,""))}),k+"</svg>"}const Ft=["#800f2f","#e63946","#ff4d6d","#ff6b35","#f77f00","#bc6c25","#ffb703","#f5d547","#a7c957","#606c38","#4f772d","#40916c","#2a9d8f","#94d2bd","#5cc8d7","#219ebc","#0077b6","#023e8a","#3a0ca3","#5e60ce","#7209b7","#c77dff","#b5179e","#f72585","#ff8fab","#f5ebe0","#e0c097","#e29578","#a47864","#8d5524","#adb5bd","#495057","#1d1d1f"],Na=[{name:"Sunset over the Pacific",hexes:["#fde0c5","#fcb27a","#f47b51","#c34a5e","#5b3a8c","#1a1f4d"]},{name:"Tokyo neon",hexes:["#ff2e88","#ff61c3","#7d28ff","#1cc7ff","#0f0f1a","#fffefb"]},{name:"Forest after rain",hexes:["#e7e4d3","#a8b89a","#5d7a52","#3a4f2c","#2c2a1f","#0e1a14"]},{name:"Santorini",hexes:["#fdfdfd","#e6f0f5","#9bc5dc","#3d83ad","#1f4d6b","#0e2335"]},{name:"Coffee shop",hexes:["#f3eadb","#dcc4a0","#a87d56","#6b4226","#3a261a","#1a110b"]},{name:"Vaporwave dream",hexes:["#ffd1ec","#ff90c8","#c191ff","#7fdbff","#1de9b6","#fff48f"]}
1,{name:"Desert canyon",hexes:["#f4e2c1","#e6b181","#c46c3a","#8a3d28","#4d2018","#2c2a26"]},{name:"Berry market",hexes:["#fff2f0","#ff8c8c","#d63384","#7a1c5e","#4d0a3a","#1a0512"]},{name:"Peach sorbet",hexes:["#fff4e6","#ffe0c2","#ffc09b","#ff9a76","#f56e58","#d94f46"]},{name:"Midnight aurora",hexes:["#0b1026","#1c2e58","#21518c","#1e88a8","#35d0ba","#a5f8ce"]},{name:"Lavender haze",hexes:["#f4f0fb","#e2d7f4","#c5aee8","#a284d6","#7c5cba","#543a8f"]},{name:"Golden hour",hexes:["#fff8e1","#ffe9a8","#ffd166","#f4a259","#e07a3f","#b25330"]}],It=[{name:"Film grain",hexes:["#deece8","#cbc9a7","#bb8098","#5f567c","#50362f"]},{name:"Oat",hexes:["#efece6","#ded6c4","#cbc59a","#abaf6f","#797b51"]},{name:"Onyx",hexes:["#a894a6","#766070","#4a3b45","#272025","#110e0f"]},{name:"Harbor",hexes:["#b5ccee","#6294da","#385dc7","#364096","#20265a"]},{name:"Walnut",hexes:["#e8e1d9","#c1af9a","#9e8161","#6c5842","#392f23"]},{name:"Cabernet",hexes:["#cc667c","#b63c34","#853728","#592117","#2e1a10"]},{name:"Stillwater",hexes:["#d0dee4","#abc4c6","#8ca397","#636b80","#425663"]},{name:"Yuletide",hexes:["#bd2832","#29683f","#d4c169","#ebe3d7","#48181b"]},{name:"Northwind",hexes:["#cee1e9","#85bed6","#4b87b4","#2b6082","#203346"]},{name:"Reefbloom",hexes:["#f4ccbe","#e9ab87","#e4804e","#cd671e","#8c680d"]},{name:"Nightfall",hexes:["#5c94a3","#3f6f79","#233e57","#162131","#0d1217"]},{name:"Mesa noon",hexes:["#e4ceb9","#d89c71","#c7673e","#8d4238","#52452a"]},{name:"Topsoil",hexes:["#e0c9ac","#c78c6b","#809a5b","#7a3f26","#423523"]},{name:"Soiree",hexes:["#f1eee8","#c8ae8a","#8b464f","#252f41","#bda93e"]},{name:"Gemleaf",hexes:["#88e7af","#41d7a8","#32a493","#1b7e57","#124a3e"]},{name:"Harvest",hexes:["#ebc697","#e28435","#b2401e","#77211c","#302318"]},{name:"Understory",hexes:["#b0cc9d","#54b95e","#30844b","#654f2d","#1c442b"]},{name:"Gilded",hexes:["#efe8be","#dfcb86","#c9c055","#a89e2e","#626c23"]},{name:"Pewter",hexes:["#e3e4e8","#b0b5bf","#7e8595","#535865","#2c2f3a"]},{name:"Fern",hexes:["#bce6ce","#72ca97","#4cb396","#478385","#2b4f50"]},{name:"Pumpkin patch",hexes:["#f27e38","#5e2a74","#74b73c","#31291c","#ebd98d"]},{name:"Oxblood",hexes:["#d8787d","#c43b51","#912c27","#5e241d","#341913"]},{name:"Studio",hexes:["#e6e7eb","#aaafbd","#535b75","#25303e","#3dd9dd"]},{name:"Graphite",hexes:["#e5dce1","#baa1ae","#936c80","#644a57","#35272e"]},{name:"Admiral",hexes:["#86a3df","#385dc7","#2a3a8e","#1f375c","#121430"]},{name:"Laser",hexes:["#db00ff","#ff8929","#0500ff","#29ffe3","#383a03"]},{name:"Linen",hexes:["#e8eaed","#c0c6ce","#949ca8","#616c80","#40414f"]},{name:"Open water",hexes:["#b8e4e8","#6ed0e0","#2895b3","#1f3b6a","#13213c"]},{name:"Grove",hexes:["#c6dab4","#8cb67c","#5f9b4f","#4b6b38","#284422"]},{name:"Clementine",hexes:["#f5ccad","#ea9453","#d9a426","#a6a326","#646217"]},{name:"Petal",hexes:["#f2cfd9","#dd7e9a","#ca3560","#892442","#491323"]},{name:"Iris",hexes:["#e3d0f1","#b381da","#893ac5","#5d2886","#311547"]},{name:"Ember",hexes:["#f0b2b6","#e05c65","#ce4731","#9c5530","#5e331d"]},{name:"Diner",hexes:["#eca03f","#e03f26","#d2709b","#40aaae","#e8e5d8"]},{name:"Porcelain",hexes:["#ead2c8","#d7b19d","#c29175","#aa7450","#7e5a3f"]}
1,{name:"First bloom",hexes:["#d4ebc7","#91ddb0","#e0a8c0","#ecebbf","#3d8867"]},{name:"Boardwalk",hexes:["#52c4e8","#f8f063","#ea684d","#36c2b4","#22416a"]},{name:"Last light",hexes:["#f4d169","#eb7a39","#e63c2d","#9a2a58","#39216d"]},{name:"Lagoon",hexes:["#bae8e8","#6ecfcf","#4694b9","#425b8a","#283753"]},{name:"Cay",hexes:["#d0f0f1","#81d7da","#3ac1c5","#288386","#154647"]},{name:"Heirloom",hexes:["#e3d6c3","#bb8b6d","#a7574c","#6b8352","#4c3725"]},{name:"Hearth",hexes:["#eed3c3","#e0a27b","#cc913d","#967122","#503c16"]},{name:"First dance",hexes:["#f1ece2","#eadce0","#acbcb4","#c5a977","#4d5f79"]},{name:"First frost",hexes:["#e4eaf0","#9db3d1","#6276b9","#364066","#1f2b3f"]},{name:"Lemon",hexes:["#f7e8ab","#eece4f","#d9de21","#89aa22","#526614"]}],ra=Na.concat(It),qt=[{name:"Sunset shingles",colors:["#f6d9c3","#f2ab7e","#e0704a","#8e4f6d","#3f3c66"],layout:"shingles",bg:"tint",font:"dm",align:"center",hexStyle:"plain"},{name:"Midnight arches",colors:["#84eee8","#8dd0d6","#e3d98c","#e1a9dc","#80257c"],layout:"arches",bg:"dark",font:"grotesk",align:"center",hexStyle:"white"},{name:"Ocean bars",colors:["#bae8e8","#6ecfcf","#4694b9","#425b8a","#283753"],layout:"hbars",bg:"white",font:"dm",align:"left",hexStyle:"plain"},{name:"Candy gem",colors:["#ffd6e8","#ff8fab","#f72585","#b5179e","#7209b7"],layout:"gem",bg:"tint",font:"playfair",align:"center",hexStyle:"plain"},{name:"Forest cubes",colors:["#e9f5db","#b5c99a","#87986a","#588157","#3a5a40"],layout:"cubes",bg:"white",font:"lora",align:"left",hexStyle:"plain"},{name:"Retro diagonal",colors:["#f4f1de","#e07a5f","#3d405b","#81b29a","#f2cc8f"],layout:"diagonal",bg:"white",font:"poppins",align:"left",hexStyle:"plain"},{name:"Golden mosaic",colors:["#fff8e1","#ffd166","#f4a259","#e07a3f","#b25330"],layout:"mosaic",bg:"white",font:"lora",align:"left",hexStyle:"plain"},{name:"Neon zigzag",colors:["#00f5d4","#00bbf9","#9b5de5","#f15bb5","#fee440"],layout:"zigzag",bg:"dark",font:"grotesk",align:"center",hexStyle:"white"}],$a="https://www.jukeboxprint.com/tools/free-pattern-generator";function Bt(t){const r={};try{const e=new URLSearchParams(t);if(e.get("p")){const a=e.get("p").split(",").map(function(l){return l=l.trim().replace("#",""),/^[0-9a-fA-F]{6}$/.test(l)?"#"+l.toLowerCase():null}).filter(Boolean);a.length>=2&&(r.colors=a.slice(0,10))}if(e.get("name")&&(r.name=e.get("name").slice(0,48)),e.get("size")&&ca.some(a=>a.id===e.get("size"))&&(r.size=e.get("size")),e.get("layout")&&za[e.get("layout")]&&(r.layout=e.get("layout")),e.get("font")&&Ia[e.get("font")]&&(r.font=e.get("font")),e.get("o")==="portrait"&&(r.orient="portrait"),(e.get("a")==="center"||e.get("a")==="right")&&(r.align=e.get("a")),(e.get("hs")==="white"||e.get("hs")==="black")&&(r.hexStyle=e.get("hs")),e.get("text")&&(r.title=e.get("text").slice(0,64)),e.get("labels")==="1"&&(r.hex=!0),e.get("bd")==="1"&&(r.frame="border"),e.get("po")){const a=r.layout||"yblocks",l=Ta[a]||[],f={};e.get("po").split(",").forEach(function(s){const p=s.split(":");if(p.length!==2)return;const m=l.filter(o=>o.id===p[0])[0];if(!m)return;const c=Number(p[1]);Number.isFinite(c)&&(f[m.id]=m.toggle?c?1:0:Math.max(m.min,Math.min(m.max,c)))}),Object.keys(f).length&&(r.opts={},r.opts[a]=f)}if(e.get("vw")&&(r.varAmt=Math.max(0,Math.min(100,parseInt(e.get("vw"),10)||0))),e.get("sc")){const a=parseInt(e.get("sc"),10);a>=50&&a<=250&&(r.scale=a/100)}e.get("vs")&&(r.varSeed=parseInt(e.get("vs"),10)||void 0)}catch{}return r}function Ut(t){const r=new URLSearchParams;r.set("p",t.colors.map(a=>a.replace("#","")).join(",")),r.set("size",t.size),r.set("layout",t.layout),t.orient==="portrait"&&r.set("o","portrait"),t.title&&r.set("text",t.title),t.hex&&r.set("labels","1"),t.align!=="left"&&r.set("a",t.align),t.hexStyle!=="plain"&&r.set("hs",t.hexStyle),t.frame==="border"&&r.set("bd","1");const e=t.opts[t.layout];return e&&Object.keys(e).length&&r.set("po",Object.keys(e).map(a=>a+":"+e[a]).join(",")),t.varAmt>0&&(r.set("vw",String(t.varAmt)),r.set("vs",String(t.varSeed))),t.scale&&Math.round(t.scale*100)!==100&&r.set("sc",String(Math.round(t.scale*100))),$a+"?"+r.toString()}const Oa=$a;function Xt(t){return(t||"").toString().replace(/[^a-zA-Z0-9 ]+/g,"").trim().split(/\s+/).map(function(r){return r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()}).join("-")}function Ra(t){const r=new Date,e=r.getFullYear()+"-"+String(r.getMonth()+1).padStart(2,"0")+"-"+String(r.getDate()).padStart(2,"0");return"Jukebox-"+(Xt(t.title||t.name)||"Color")+"-Pattern-"+e}function Qa(t,r){const e=document.createElement("a");e.href=t,e.download=r,document.body.appendChild(e),e.click(),document.body.removeChild(e)}function Zt(t){const r=new Blob([Za(Pa(t))],{type:"image/svg+xml"}),e=URL.createObjectURL(r);Qa(e,Ra(t)+".svg"),setTimeout(function(){URL.revokeObjectURL(e)},1e3)}function Ka(t,r){Ja(Pa(t)).toBlob(function(a){r(a)},"image/png")}function Jt(t){document.fonts.ready.then(function(){Ka(t,function(r){if(!r)return;const e=URL.createObjectURL(r);Qa(e,Ra(t)+".png"),setTimeout(function(){URL.revokeObjectURL(e)},1e3)})})}function $t(t){document.fonts.ready.then(function(){tt().then(function(r){const e=Pa(t),a=Ja(e),l=ca.filter(s=>s.id===t.size)[0];let f;if(l.unit==="in"){const s=e.W/300,p=e.H/300;f=new r({unit:"in",format:[s,p],orientation:s>p?"landscape":"portrait"}),f.addImage(a.toDataURL("image/png"),"PNG",0,0,s,p)}else f=new r({unit:"px",format:[e.W,e.H],orientation:e.W>e.H?"landscape":"portrait",hotfixes:["px_scaling"]}),f.addImage(a.toDataURL("image/png"),"PNG",0,0,e.W,e.H);
1f.save(Ra(t)+".pdf")})})}function Qt(t,r){const e=Ut(t),a=navigator;a.share?Ka(t,function(l){const f=l?new File([l],Ra(t)+".png",{type:"image/png"}):null,s={title:"My color pattern",text:(t.title||t.name)+", made with the Jukebox Print free pattern generator",url:e};f&&a.canShare&&a.canShare({files:[f]})&&(s.files=[f]),a.share(s).catch(function(){navigator.clipboard&&navigator.clipboard.writeText(e).then(r)})}):navigator.clipboard&&navigator.clipboard.writeText(e).then(r)}function Kt(t){const r=navigator;r.share?r.share({title:"Free pattern generator",text:"Turn any color palette into patterns, posters and wallpapers, free",url:Oa}).catch(function(){navigator.clipboard&&navigator.clipboard.writeText(Oa).then(t)}):navigator.clipboard&&navigator.clipboard.writeText(Oa).then(t)}const ja=["bloom","checker","hbars","arches","waves","wstripes","gem","diamonds","cubes","yblocks","shingles","scallops","columns"],Yt=({studioColorsKey:t,onUse:r})=>{const[e,a]=F.useState([]),l=F.useRef(ja[0]),f=F.useRef(null),s=F.useRef(0),p=F.useRef(t);return p.current=t,F.useEffect(()=>{let m=!0;const c=j=>{m&&a(j)},o=()=>{const j=p.current,w=Na.filter(z=>z.hexes.join()!==j&&(!f.current||z.hexes.join()!==f.current.join())),d=w[Math.floor(Math.random()*w.length)]||Na[0];return f.current=d.hexes.slice(),f.current},n=j=>{l.current=j;const w=ia(j,o(),460,300),d=++s.current;c(z=>[...z.map(N=>({...N,opacity:0})),{key:d,html:w,opacity:0}]),requestAnimationFrame(()=>requestAnimationFrame(()=>c(z=>z.map(N=>({...N,opacity:N.key===d?1:0}))))),window.setTimeout(()=>c(z=>z.filter(N=>N.key===d)),1600)},i=()=>{let j;do j=ja[Math.floor(Math.random()*ja.length)];while(j===l.current&&ja.length>1);n(j)},h=window.matchMedia("(max-width:900px)");let u=0;const v=()=>{u||h.matches||(i(),u=window.setInterval(i,5200))},M=()=>{u&&window.clearInterval(u),u=0},k=()=>h.matches?M():v();return v(),h.addEventListener("change",k),()=>{m=!1,M(),h.removeEventListener("change",k)}},[]),g.jsx("div",{className:"hero-demo",id:"heroDemo",role:"button",tabIndex:0,"aria-label":"Use this layout in the maker",title:"Tap to use this layout",onClick:()=>r(l.current),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),r(l.current))},children:e.map(m=>g.jsx("div",{className:"hlayer",style:{opacity:m.opacity},dangerouslySetInnerHTML:{__html:m.html}},m.key))})},er=0,ar=1234567,tr=({current:t,colors:r,onSelect:e})=>{const a=F.useRef(null),[l,f]=F.useState(!1);F.useEffect(()=>f(!0),[]);const s=F.useMemo(()=>Ba.map(c=>({id:c.id,inner:(l?Wt(c.id,r,er,ar):'<i class="laythumb"></i>')+(c.popular?'<i class="laybadge">Popular</i>':"")+"<span>"+ba(c.label)+"</span>"})),[r,l]),p=(c,o)=>{const n=a.current;if(!n||!c)return;const i=c.getBoundingClientRect(),h=n.getBoundingClientRect(),u=n.scrollLeft+(i.left-h.left)-(n.clientWidth-i.width)/2;n.scrollTo({left:Math.max(0,u),behavior:o?"smooth":"auto"})};F.useEffect(()=>{p(a.current?.querySelector(".lay.is-on"),!1)},[]);const m=(c,o)=>{p(o,!0),e(c)};return g.jsx("div",{className:"layouts",id:"layouts",ref:a,children:s.map(c=>g.jsx("button",{className:"lay"+(t===c.id?" is-on":""),onClick:o=>m(c.id,o.currentTarget),dangerouslySetInnerHTML:{__html:c.inner}},c.id))})},rr=({layout:t,opts:r,onSnapshot:e,onSet:a})=>{const l=Ta[t],f=F.useRef(!1);return l?g.jsx(g.Fragment,{children:l.map(s=>{const p=r&&r[s.id]!=null?r[s.id]:s.def;return s.toggle?g.jsxs("div",{className:"optrow",children:[g.jsx("div",{className:"optlabel",children:g.jsx("span",{children:s.label})}),g.jsx("div",{className:"pills",children:[["On",1],["Off",0]].map(([m,c])=>g.jsx("button",{type:"button",className:"pill"+(p===c?" is-on":""),onClick:()=>{p!==c&&(e(),a(s.id,c))},children:m},m))})]},s.id):g.jsxs("div",{className:"optrow",children:[g.jsxs("div",{className:"optlabel",children:[g.jsx("span",{children:s.label}),g.jsxs("small",{children:[p,s.unit||""]})]}),g.jsx("input",{type:"range",min:s.min,max:s.max,step:s.step||1,value:p,"aria-label":s.label,onInput:m=>{f.current||(e(),f.current=!0),a(s.id,+m.target.value)},onChange:m=>{f.current||(e(),f.current=!0),a(s.id,+m.target.value),f.current=!1}})]},s.id)})}):null},Fa=12,nr=15,or=900,sr=400,lr='<a class="trustrow" href="https://www.trustpilot.com/review/jukeboxprint.com" target="_blank" rel="noopener"><span class="tstars" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span><span class="trusttxt">See our reviews on Trustpilot</span></a>';function ir(t){const r=t.length,e=30,a=42,l=52,f=248;let s='<svg viewBox="0 0 300 84" xmlns="http://www.w3.org/2000/svg">';return t.forEach(function(p,m){const c=r>1?l+m*(f-l)/(r-1):150,n=se(p).l>.8?' stroke="#e2e2e7" stroke-width="1"':"";s+='<circle cx="'+Math.round(c*10)/10+'" cy="'+a+'" r="'+e+'" fill="'+p+'"'+n+"/>"}),s+"</svg>"}function cr(t){if(t.bg==="white")return"#ffffff";const r=se(t.colors[0]);return t.bg==="tint"?K(r.h,Math.min(1,r.s*.45),.94):K(r.h,Math.min(1,r.s*.6),.11)}function ke(t,r){return t+Math.random()*(r-t)}function Je(t){return t[Math.floor(Math.random()*t.length)]}function hr(){const t=ke(0,360),r=Je(["analogous","triadic","complement","mono","wild"]),e=4+Math.floor(ke(0,4)),a=[];for(let l=0;l<e;l++){let f,s,p;const m=e===1?0:l/(e-1);r==="analogous"?(f=t+(l-e/2)*ke(14,26),s=ke(.5,.85),p=.28+m*ke(.42,.58)):r==="triadic"?(f=t+l%3*120+ke(-8,8),s=ke(.45,.8),p=ke(.3,.78)):r==="complement"?(f=t+l%2*180+ke(-10,10),s=ke(.45,.85),p=.26+m*.55):r==="mono"?(f=t+ke(-4,4),s=ke(.35,.75),p=.18+m*.7):(f=ke(0,360),s=ke(.5,.9),p=ke(.25,.8)),a.push(K(f,s,p))}return a}const br=({tools:t=[]})=>{const[r,e]=F.useState(st),a=F.useRef(r);a.current=r;const l=F.useRef(!0),[f,s]=F.useState(!1),p=F.useRef([]),[m,c]=F.useState(!1),[o,n]=F.useState(!1),[i,h]=F.useState(!1),[u,v]=F.useState(!1),[M,k]=F.useState(0),[j,w]=F.useState(Fa),[d,z]=F.useState("Share your design"),[N,y]=F.useState("Share this page"),E=F.useRef(null),b=F.useRef(null),R=F.useRef(null),C=F.useRef(null),H=F.useRef(null),L=F.useRef(null),D=F.useRef(null),X=F.useRef(null),I=F.useRef(!1),G=F.useRef(!1),T=F.useRef(!1),J=F.useRef(1),Z=F.useRef(1),q=F.useRef(Xa),V=(x,P=!0)=>{l.current=P,e(_=>({..._,...x}))},S=()=>{const x=a.current,P={...x,colors:x.colors.slice()};p.current.push(P),p.current.length>25&&p.current.shift(),s(!0)},A=()=>{const x=p.current;if(!x.length)return;const P=x.pop();l.current=!0,e(P),x.length||s(!1)};F.useEffect(()=>{const x=window.matchMedia("(hover: none) and (pointer: coarse)").matches||window.innerWidth<=900;q.current=x?sr:or,w(x?Fa:nr),v(!0);const P=rt(),W={...Bt(window.location.search)};P&&(W.colors=P.colors,P.name&&(W.name=P.name),P.layout&&za[P.layout]&&(W.layout=P.layout)),Object.keys(W).length&&(l.current=!0,e(pe=>({...pe,...W}
1)),P&&nt({p:ot(P.colors),name:P.name,layout:W.layout}),window.setTimeout(()=>{(L.current??H.current)?.scrollIntoView({behavior:"smooth",block:"start"})},200));const xe=window.Trustpilot;xe&&D.current&&xe.loadFromElement(D.current,!0);const te=pe=>{const be=pe.target;b.current&&!b.current.contains(be)&&c(!1),R.current&&!R.current.contains(be)&&n(!1),C.current&&!C.current.contains(be)&&h(!1)},Te=pe=>{if(pe.key==="Escape"){c(!1),n(!1),h(!1);return}if((pe.metaKey||pe.ctrlKey)&&(pe.key==="z"||pe.key==="Z")){const be=(pe.target.tagName||"").toLowerCase();if(be==="input"||be==="textarea"||be==="select")return;pe.preventDefault(),A()}};return document.addEventListener("click",te),document.addEventListener("keydown",Te),()=>{document.removeEventListener("click",te),document.removeEventListener("keydown",Te)}},[]);const O=()=>{H.current&&H.current.scrollIntoView({behavior:"smooth"})};F.useEffect(()=>{J.current=r.scale},[r.scale]);const Q=(x,P)=>{l.current=!1,e(_=>{const W=_.colors.slice();return W[x]=P.toLowerCase(),{..._,colors:W}})},U=x=>{l.current=!0,e(P=>P.colors.length>2?{...P,colors:P.colors.filter((_,W)=>W!==x)}:P)},$=()=>{l.current=!0,e(x=>{const P=na(x.layout).maxColors??10;return x.colors.length<P?{...x,colors:[...x.colors,x.colors[x.colors.length-1]]}:x})},fe=x=>{l.current=!0,e(P=>{if(P.colors.indexOf(x)!==-1)return P;const _=na(P.layout).maxColors??10;if(P.colors.length<_)return{...P,colors:[...P.colors,x]};const W=P.colors.slice();return W[W.length-1]=x,{...P,colors:W}})},ue=(x,P)=>{if(x.target.closest&&x.target.closest(".rm"))return;const _=x.currentTarget,W=_.querySelector("input"),xe=E.current;if(!xe)return;const te=x.clientX,Te=x.clientY,pe=Array.prototype.slice.call(xe.querySelectorAll(".chip"));let be=!1;const da=x.pointerId,la=Be=>{const Ce=Be.clientX-te,Qe=Be.clientY-Te;if(!be&&Math.abs(Ce)>7&&Math.abs(Ce)>Math.abs(Qe)){be=!0,_.classList.add("dragging"),W&&W.setAttribute("disabled","");try{_.setPointerCapture(da)}catch{}}be&&(Be.preventDefault(),_.style.transform="translateX("+Ce+"px) scale(1.14)")},qe=Be=>{if(document.removeEventListener("pointermove",la),document.removeEventListener("pointerup",qe),document.removeEventListener("pointercancel",qe),W&&W.removeAttribute("disabled"),!be)return;_.classList.remove("dragging"),_.style.transform="";let Ce=P,Qe=1/0;pe.forEach(function(Ue,_e){const Ke=Ue.getBoundingClientRect(),pa=Math.abs(Be.clientX-(Ke.left+Ke.width/2));pa<Qe&&(Qe=pa,Ce=_e)}),Ce!==P&&(l.current=!0,e(Ue=>{const _e=Ue.colors.slice(),Ke=_e.splice(P,1)[0];return _e.splice(Ce,0,Ke),{...Ue,colors:_e}}))};document.addEventListener("pointermove",la),document.addEventListener("pointerup",qe),document.addEventListener("pointercancel",qe)},de=x=>{const P=x.toLowerCase();if(G.current)l.current=!1,e(_=>({..._,colors:_.colors.map((W,xe)=>xe===_.colors.length-1?P:W)}));else{if(a.current.colors.indexOf(P)!==-1)return;S(),G.current=!0,l.current=!1,e(_=>{const W=na(_.layout).maxColors??10;return _.colors.length<W?{..._,colors:[..._.colors,P]}:{..._,colors:_.colors.map((xe,te)=>te===_.colors.length-1?P:xe)}})}},re=()=>{S(),l.current=!0,e(x=>{const P=x.colors.slice();for(let W=P.length-1;W>0;W--){const xe=Math.floor(Math.random()*(W+1)),te=P[W];P[W]=P[xe],P[xe]=te}const _=x.layout==="survey"?Math.floor(Math.random()*1e9):x.varSeed;return{...x,colors:P,varSeed:_}})},Ae=()=>{S(),l.current=!0;const x=hr(),P=Je(["yblocks","stitch","bloom","arches","chevron","hbars","vstripes","hstripes","checker","weave","mosaic","diagonal","tumbling","cubes","penrose","hexes","stairs","columns","triangles","pyramids","diamonds","waves","wstripes","zigzag","gem","shingles","scallops","spiral"]),_=ca.filter(W=>W.id===a.current.size)[0];e(W=>({...W,colors:x,layout:P,align:Je(["left","center","right"]),hexStyle:Je(["plain","plain","white","black"]),bg:Je(["white","white","tint","dark"]),frame:Je(["border","border","none"]),varAmt:Je([0,0,35,65]),varSeed:Math.floor(Math.random()*1e9),orient:_.lock?W.orient:Je(["landscape","portrait"])}))},we=x=>{S(),V({colors:x.hexes.slice(),name:x.name}
1,!0),c(!1),O()},ge=x=>{S(),l.current=!0,e(P=>{const _={...P.opts};return delete _[x.layout],{...P,colors:x.colors.slice(),layout:x.layout,bg:x.bg,font:x.font,align:x.align,hexStyle:x.hexStyle,name:x.name,frame:"none",varAmt:0,scale:1,opts:_}}),O()},me=x=>{I.current||(S(),I.current=!0);const P=parseInt(x,10)/100;Z.current=P;const _=X.current?X.current.querySelector("svg"):null;_&&(_.style.transformOrigin="50% 50%",_.style.transform="scale("+P/J.current+")"),T.current||(T.current=!0,requestAnimationFrame(()=>{T.current=!1,l.current=!1,e(W=>({...W,scale:Z.current}))}))},Ve=x=>{I.current=!1,l.current=!1,e(P=>({...P,scale:parseInt(x,10)/100}))},Se=x=>{l.current=!1,e(P=>({...P,varAmt:parseInt(x,10)||0,varSeed:Math.floor(Math.random()*1e9)}))},$e=x=>{l.current=!1,e(P=>({...P,varAmt:parseInt(x,10)||0}))},ha=(x,P)=>{l.current=!0,e(_=>({..._,opts:{..._.opts,[_.layout]:{..._.opts[_.layout]||{},[x]:P}}}))},je=x=>{if(x.unit!=="in")return x.dim;let P=x.w,_=x.h;if(r.orient==="landscape"){const W=P;P=_,_=W}return Math.round(P*10)/10+"x"+Math.round(_*10)/10+" in"},Le=()=>{Qt(a.current,()=>{z("Link copied"),window.setTimeout(()=>z("Share your design"),1400)}),h(!1)},oa=()=>{Kt(()=>{y("Link copied"),window.setTimeout(()=>y("Share this page"),1400)}),h(!1)},We=F.useMemo(()=>Za(Pa(r),l.current,q.current),[r]),wa=Math.round((r.scale||1)*100),fa=ca.filter(x=>x.id===r.size)[0],ua=na(r.layout).maxColors??10,ya=F.useMemo(()=>{const x=M*j,P=ra.slice(x,x+j);return P.length?P:ra.slice(0,j)},[M,j]),Ea=F.useMemo(()=>ya.map(x=>({p:x,html:ir(x.hexes)})),[ya]),ka=F.useMemo(()=>qt.map(x=>({p:x,html:ia(x.layout,x.colors,300,190,{bg:cr(x)})+"<span>"+ba(x.name)+"</span>"})),[]),sa=F.useMemo(()=>u?[ia("yblocks",ra[0].hexes,480,300,{preserve:!0}),ia("shingles",ra[2].hexes,480,300,{preserve:!0}),ia("bloom",ra[1].hexes,480,300,{preserve:!0}),ia("waves",ra[3].hexes,480,300,{preserve:!0})]:["","","",""],[u]);return g.jsxs("div",{className:"jbx-patgen",children:[g.jsx(Ya,{items:[{name:"Free pattern generator"}],className:"pat-crumb"}),g.jsxs("div",{className:"wrap",children:[g.jsxs("header",{className:"hero",children:[g.jsxs("div",{className:"hero-copy",children:[g.jsxs("h1",{children:["Free pattern",g.jsx("br",{}),"generator"]}),g.jsxs("p",{className:"sub",children:["Turn any color palette into a pattern you can actually use. Pick your colors below, or bring a palette from our ",g.jsx("a",{href:"/tools/color-palette-generator",children:"color palette generator"}),", choose from checkerboards, chevrons and isometric cubes, and download a print ready PNG, SVG or PDF, a poster or a phone wallpaper. Free, no signup, no watermarks."]}),g.jsx("div",{className:"trustwrap",children:g.jsx("div",{className:"trustpilot-widget",ref:D,"data-locale":"en-US","data-template-id":"5419b6ffb0d04a076446a9af","data-businessunit-id":"57ec3f760000ff000595528a","data-style-height":"20px","data-style-width":"100%","data-theme":"light",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:lr}})})]}),g.jsx(Yt,{studioColorsKey:r.colors.join(),onUse:x=>{V({layout:x},!0),O()}})]}),g.jsx("h2",{className:"makerhead",ref:L,children:"Make your own geometric pattern from any color palette"}),g.jsxs("div",{className:"studio",ref:H,children:[g.jsxs("div",{className:"editor",children:[g.jsxs("aside",{className:"panel",children:[g.jsxs("section",{className:"step",children:[g.jsxs("h2",{className:"hrow",children:["Colors",g.jsx("button",{className:"pill",onClick:re,children:"Shuffle"})]}),g.jsxs("div",{className:"chips",ref:E,children:[r.colors.map((x,P)=>g.jsxs("div",{className:"chip",style:{background:x},onPointerDown:_=>ue(_,P),children:[g.jsx("input",{type:"color",value:x,onInput:_=>Q(P,_.target.value),onChange:_=>Q(P,_.target.value)}),r.colors.length>2&&g.jsx("button",{className:"rm","aria-label":"Remove color",onClick:_=>{_.stopPropagation(),U(P)},children:"x"})]},P)),r.colors.length<ua&&g.jsx("button",{className:"chip-add","aria-label":"Add a color",onClick:$,children:"+"})]}),ua<10&&g.jsxs("p",{className:"panelhint",children:[na(r.layout).label," uses ",ua," colors"]}),g.jsxs("div",{className:"plwrap"+(m?" is-open":""),ref:b,children:[g.jsxs("button",{className:"szsel",type:"button","aria-haspopup":"listbox","aria-expanded":m,onClick:x=>{x.stopPropagation(),c(P=>!P)},children:[g.jsx("span",{children:"Choose a palette"}),g.jsx("span",{className:"szcaret","aria-hidden":"true",children:"â¾"})]}),g.jsx("div",{className:"szmenu plmenu",role:"listbox","aria-label":"Choose a palette",children:Na.map(x=>g.jsxs("button",{type:"button",className:"plitem",role:"option",onClick:()=>we(x),children:[g.jsx("span",{className:"pldots",children:x.hexes.slice(0,6).map((P,_)=>g.jsx("i",{style:{background:P}},_))}),g.jsx("span",{children:x.name})]},x.name))})]}),g.jsx("p",{className:"panelhint",children:"Tap a color to add it"}),g.jsxs("div",{className:"popgrid",children:[Ft.map(x=>g.jsx("button",{className:"pop",style:{background:x},"aria-label":"Add "+x,title:x,onClick:()=>fe(x)},x)),g.jsx("label",{className:"pop popwheel",title:"Custom color",children:g.jsx("input",{type:"color",className:"wheelinput","aria-label":"Pick a custom color",defaultValue:"#ff5478",onInput:x=>de(x.target.value),onChange:x=>
1{de(x.target.value),G.current=!1,l.current=!0,e(P=>({...P}))}})})]})]}),r.layout!=="survey"&&g.jsxs("section",{className:"step",children:[g.jsxs("h2",{className:"hrow",children:["Scale ",g.jsxs("span",{className:"scaleval",children:[wa,"%"]})]}),g.jsx("input",{type:"range",className:"scaleslider",min:50,max:250,value:wa,step:1,"aria-label":"Pattern scale",onInput:x=>me(x.target.value),onChange:x=>Ve(x.target.value)})]}),(Ta[r.layout]||r.layout==="hbars")&&g.jsxs("section",{className:"step",children:[g.jsx("h2",{children:"Pattern settings"}),r.layout==="hbars"?g.jsxs("div",{className:"optrow",children:[g.jsxs("div",{className:"optlabel",children:[g.jsx("span",{children:"Bar width variation"}),g.jsxs("small",{children:[r.varAmt,"%"]})]}),g.jsx("input",{type:"range",min:0,max:100,step:1,value:r.varAmt,"aria-label":"Bar width variation",onInput:x=>Se(x.target.value),onChange:x=>$e(x.target.value)})]}):g.jsx(rr,{layout:r.layout,opts:r.opts[r.layout],onSnapshot:S,onSet:ha})]}),g.jsxs("section",{className:"step",children:[g.jsx("h2",{children:"Size"}),g.jsxs("div",{className:"szwrap"+(o?" is-open":""),ref:R,children:[g.jsxs("button",{className:"szsel",type:"button","aria-haspopup":"listbox","aria-expanded":o,onClick:x=>{x.stopPropagation(),n(P=>!P)},children:[g.jsxs("span",{id:"szLabel",children:[fa.label,g.jsx("small",{children:je(fa)})]}),g.jsx("span",{className:"szcaret","aria-hidden":"true",children:"â¾"})]}),g.jsx("div",{className:"szmenu",role:"listbox","aria-label":"Select size",children:ca.map(x=>g.jsxs("button",{type:"button",role:"option",className:"szitem"+(r.size===x.id?" is-on":""),onClick:()=>{V({size:x.id},!0),n(!1)},children:[x.label,g.jsx("small",{children:x.dim})]},x.id))})]}),g.jsxs("div",{className:"pills orient",style:{display:fa.lock?"none":"flex"},children:[g.jsx("button",{className:"pill"+(r.orient==="landscape"?" is-on":""),onClick:()=>V({orient:"landscape"},!0),children:"Landscape"}),g.jsx("button",{className:"pill"+(r.orient==="portrait"?" is-on":""),onClick:()=>V({orient:"portrait"},!0),children:"Portrait"})]})]}),g.jsxs("section",{className:"step",children:[g.jsx("h2",{children:"Border"}),g.jsxs("div",{className:"pills orient",children:[g.jsx("button",{className:"pill"+(r.frame==="border"?" is-on":""),onClick:()=>V({frame:"border"},!0),children:"With border"}),g.jsx("button",{className:"pill"+(r.frame==="none"?" is-on":""),onClick:()=>V({frame:"none"},!0),children:"Borderless"})]})]})]}),g.jsxs("div",{className:"stagewrap",children:[g.jsx("div",{className:"stagebox",children:g.jsx("div",{className:"stagecard",children:g.jsx("div",{id:"preview",ref:X,dangerouslySetInnerHTML:{__html:We}})})}),g.jsxs("div",{className:"dlwrap"+(i?" is-open":""),ref:C,children:[g.jsx("button",{className:"btn btn-black","aria-haspopup":"true","aria-expanded":i,onClick:x=>{x.stopPropagation(),h(P=>!P)},children:"Download pattern"}),g.jsxs("div",{className:"dlmenu",children:[g.jsx("button",{className:"dlitem",onClick:()=>{Jt(a.current),h(!1)},children:"Download PNG"}),g.jsx("button",{className:"dlitem",onClick:()=>{$t(a.current),h(!1)},children:"Download PDF"}),g.jsx("button",{className:"dlitem",onClick:()=>{Zt(a.current),h(!1)},children:"Download SVG"}),g.jsx("div",{className:"dlsep"}),g.jsx("button",{className:"dlitem",onClick:Le,children:d}),g.jsx("button",{className:"dlitem",onClick:oa,children:N})]})]})]})]}),g.jsxs("section",{className:"step stripsec",children:[g.jsxs("h2",{className:"hrow",children:["Choose a pattern",g.jsxs("span",{className:"hbtns",children:[g.jsx("button",{className:"pill undo"+(f?" is-avail":""),onClick:A,children:"Undo"}),g.jsx("button",{className:"pill",onClick:Ae,children:"Surprise me"})]})]}),g.jsx(tr,{current:r.layout,colors:r.colors,onSelect:x=>V({layout:x},!0)})]})]}),g.jsxs("section",{className:"presets",children:[g.jsxs("h2",{className:"hrow",children:["Popular palettes",g.jsx("button",{className:"pill",type:"button",onClick:()=>k(x=>(x+1)%Math.ceil(ra.length/j)),children:"More palettes"})]}),g.jsx("p",{className:"psub",children:"The most loved palettes from our library. Tap one to load its colors into the maker."}),g.jsx("div",{className:"palgrid",children:Ea.map(({p:x,html:P})=>g.jsx("button",{className:"palcard","aria-label":x.name,onClick:()=>we(x),dangerouslySetInnerHTML:{__html:P}},x.name))})]}),g.jsxs("section",{className:"presets",children:[g.jsx("h2",{children:"Popular patterns"}),g.jsx("p",{className:"psub",children:"Tap a style to load it into the maker, then make it yours."}),g.jsx("div",{className:"pgrid",children:ka.map(({p:x,html:P})=>g.jsx("button",{className:"preset",onClick:()=>ge(x),dangerouslySetInnerHTML:{__html:P}},x.name))})]}),g.jsxs("section",{className:"feats",children:[g.jsxs("article",{className:"feat",children:[g.jsxs("div",{className:"feat-copy",children:[g.jsx("h2",{children:"A free geometric pattern generator"}),g.jsx("p",{children:"Install nothing, sign up for nothing. Choose your colors and watch them become geometric patterns on the spot: checkerboards, chevrons, argyle, waves, tumbling blocks and isometric cubes, every one drawn from your exact hex codes."}),g.jsx("p",{children:"Not feeling it? Hit shuffle for a random pattern, or drag your colors into a new order and the whole pattern recomposes around them."})]}),g.jsx("div",{className:"feat-art","aria-hidden":"true",dangerouslySetInnerHTML:{__html:sa[0]}})]}),g.jsxs("article",{className:"feat feat--flip",children:[g.jsxs("div",{className:"feat-copy",children:[g.jsx("h2",{children:"Seamless repeating patterns, ready for print"}),g.jsx("p",{children:"Every download is a true seamless pattern. Tile it edge to edge and the repeat lines up perfectly, no visible seams, no awkward joins. Prints come out at 300 dpi in real sizes, postcard to 18x24 poster, and the SVG is pure vector so it stays sharp at any scale. What you see on screen is what comes off the press."})]}),g.jsx("div",{className:"feat-art","aria-hidden":"true",dangerouslySetInnerHTML:{__html:sa[1]}})]}),g.jsxs("article",{className:"feat",children:[g.jsxs("div",{className:"feat-copy",children:[g.jsx("h2",{children:"A phone wallpaper maker and background generator"}),g.jsx("p",{children:"Wallpapers are the most popular thing people make here. One tap on the phone wallpaper size and your palette becomes a clean patterned background, cut to fit modern screens, a custom wallpaper in your exact colors. There is a 4K desktop wallpaper too, and a square format for social feeds."})]}),g.jsx("div",{className:"feat-art","aria-hidden":"true",dangerouslySetInnerHTML:{__html:sa[2]}})]}),g.jsxs("article",{className:"feat feat--flip",children:[g.jsxs("div",{className:"feat-copy",children:[g.jsx("h2",{children:"Start from any palette, or from a photo"}),g.jsxs("p",{children:["Every palette in our library opens here with its colors preloaded. Browse over 1,400 curated palettes in the ",g.jsx("a",{href:"/tools/color-palettes",children:"color palette library"}),", or pull colors straight from a photo with the ",g.jsx("a",{href:"/tools/color-palette-generator",children:"color palette generator"})," and build a pattern from an image. Everything you make travels inside the URL, so sharing it is just copying a link."]})]}),g.jsx("div",{className:"feat-art","aria-hidden":"true",dangerouslySetInnerHTML:{__html:sa[3]}})]})]})]}),g.jsx(et,{tools:t,headingClassName:at.toolsGridHeading})]})};export{br as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.