(this["webpackJsonpprofile-picture-generator"]=this["webpackJsonpprofile-picture-generator"]||[]).push([[0],{22:function(e,t,a){},26:function(e,t,a){var r={"./ProfileFrame B&G Bars.png":[28,4],"./ProfileFrame Blue Bars.png":[29,5],"./ProfileFrame Green Bars.png":[30,6],"./ProfileFrame Mixed Bars.png":[31,7],"./ProfileFrame Purple.png":[32,8],"./ProfileFrame R&Y Bars.png":[33,9],"./ProfileFrame Red Bars.png":[34,10],"./ProfileFrame White Bars.png":[35,11],"./ProfileFrame Yellow Bars.png":[36,12]};function n(e){if(!a.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],n=t[0];return a.e(t[1]).then((function(){return a(n)}))}n.keys=function(){return Object.keys(r)},n.id=26,e.exports=n},27:function(e,t,a){"use strict";a.r(t);var r=a(1),n=a(0),c=a.n(n),s=a(11),o=a.n(s),i=a(10),u=a(9),l=a(2),b=(a(22),a(16)),f=a(5),j=a.n(f),d=a(8);var O=function(e){var t=e.onFrameChange,c=Object(n.useState)([]),s=Object(l.a)(c,2),o=s[0],i=s[1],u=Object(n.useState)(null),b=Object(l.a)(u,2),f=b[0],O=b[1];Object(n.useEffect)((function(){function e(){return(e=Object(d.a)(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all(["ProfileFrame Purple","ProfileFrame Yellow Bars","ProfileFrame Red Bars","ProfileFrame Blue Bars","ProfileFrame Green Bars","ProfileFrame White Bars","ProfileFrame Mixed Bars","ProfileFrame R&Y Bars","ProfileFrame B&G Bars"].map(function(){var e=Object(d.a)(j.a.mark((function e(t){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,a(26)("./".concat(t,".png"));case 3:return e.t1=e.sent,e.abrupt("return",{name:e.t0,src:e.t1});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then((function(e){i(e),O(e[0].src.default)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var h=Object(n.useCallback)((function(e){O(e.target.dataset.src)}),[O]);return Object(n.useEffect)((function(){t(f)}),[t,f]),Object(r.jsxs)("div",{className:"FrameChooser",children:[Object(r.jsx)("h2",{children:"Choose a frame:"}),o.map((function(e){var t=e.src.default,a=f===t;return Object(r.jsx)("img",{alt:e.name,"data-src":t,src:t,className:a?"frame choosen":"frame",onClick:h},t)}))]})},h=a(13),g=a.n(h),m=a(14),p=a.n(m);function v(e,t,a){return Math.min(Math.max(t,e),a)}var x=function(e){var t=e.onChange,a=e.background,c=e.backgroundRatio,s=e.foreground,o=Object(n.useRef)(null),i=Object(n.useRef)(null),u=Object(n.useState)(!1),b=Object(l.a)(u,2),f=b[0],j=b[1],d=Object(n.useState)(null),O=Object(l.a)(d,2),h=O[0],m=O[1],x=Object(n.useState)(null),P=Object(l.a)(x,2),w=P[0],k=P[1],F=Object(n.useState)(0),y=Object(l.a)(F,2),C=y[0],S=y[1],B=Object(n.useState)(0),M=Object(l.a)(B,2),E=M[0],I=M[1],R=Object(n.useState)(0),U=Object(l.a)(R,2),D=U[0],N=U[1],L=Object(n.useState)(0),Y=Object(l.a)(L,2),A=Y[0],T=Y[1],X=Object(n.useState)(1),G=Object(l.a)(X,2),_=G[0],H=G[1],W=Object(n.useState)(300),J=Object(l.a)(W,2),V=J[0],q=J[1],z=Object(n.useState)(300),K=Object(l.a)(z,2),Q=K[0],Z=K[1],$=Object(n.useState)(300),ee=Object(l.a)($,2),te=ee[0],ae=ee[1],re=Object(n.useState)(300),ne=Object(l.a)(re,2),ce=ne[0],se=ne[1],oe=Object(n.useState)(0),ie=Object(l.a)(oe,2),ue=ie[0],le=ie[1],be=Object(n.useState)(0),fe=Object(l.a)(be,2),je=fe[0],de=fe[1],Oe=Object(n.useState)(0),he=Object(l.a)(Oe,2),ge=he[0],me=he[1],pe=Object(n.useState)(0),ve=Object(l.a)(pe,2),xe=ve[0],Pe=ve[1];Object(n.useEffect)((function(){t&&t({x:C,y:E,scale:_})}),[t,C,E,_]),Object(n.useEffect)((function(){if(o&&o.current){var e=o.current.offsetWidth,t=o.current.offsetHeight;se(t),ae(e);var a=1,r=1;c<1?a=1/c:c>1&&(r=1*c),q(a),Z(r)}}),[c,s]),Object(n.useEffect)((function(){var e=function(e,t,a,r,n){var c=Math.max(0,e*a-r)/2,s=Math.max(0,t*a-n)/2;return{rangeMaxX:c,rangeMinX:0-c,rangeMaxY:s,rangeMinY:0-s}}(V*te,Q*ce,_,te,ce),t=e.rangeMinX,a=e.rangeMinY,r=e.rangeMaxX,n=e.rangeMaxY;le(t),de(a),me(r),Pe(n)}),[V,Q,te,ce,_]),Object(n.useEffect)((function(){S(0),I(0),N(0),T(0),H(1)}),[a]);var we=Object(n.useCallback)((function(e){var t=1*e.target.dataset.x,a=1*e.target.dataset.y,r=v(t+e.deltaX,ue,ge),n=v(a+e.deltaY,je,xe);e.isFinal?(S(r||0),I(n||0),N(0),T(0)):(N(r-t||0),T(n-a||0))}),[ue,je,ge,xe]),ke=Object(n.useCallback)((function(e,t,a,r){e.preventDefault();var n=v(1*e.target.dataset.scale+t/200,1,8);H(n||1);var c=1*e.target.dataset.x,s=1*e.target.dataset.y;S(v(c,ue,ge)||0),I(v(s,je,xe)||0)}),[ue,je,ge,xe]);return Object(n.useEffect)((function(){if(!f&&o&&o.current){var e=o.current;e.addEventListener("mousedown",(function(e){return e.preventDefault()}),!1),m(new g.a(e,{direction:"DIRECTION_ALL"})),k(p()(e)),j(!0)}}),[o,f]),Object(n.useEffect)((function(){if(h&&w&&f&&o&&o.current)return h.on("pan",we),w.wheel(ke),function(){h.off("pan",we),w.unwheel()}}),[o,we,ke,f,h,w]),Object(r.jsxs)("div",{className:"Editor",ref:o,"data-x":C,"data-y":E,"data-scale":_,children:[Object(r.jsx)("img",{src:a,ref:i,alt:"",className:"background",style:{width:100*V+"%",height:100*Q+"%",transform:"translate3d(calc(-50% + ".concat(C+D,"px), calc(-50% + ").concat(E+A,"px), 0) scale(").concat(_,",").concat(_,")")}}),Object(r.jsx)("img",{src:s,alt:"",className:"foreground"})]})},P=a.p+"static/media/HeaderImage.1f39a672.svg",w=a(15),k=1080;var F=function(){var e=Object(n.useState)(null),t=Object(l.a)(e,2),a=t[0],c=t[1],s=Object(n.useState)(null),o=Object(l.a)(s,2),f=o[0],j=o[1],d=Object(n.useState)(1),h=Object(l.a)(d,2),g=h[0],m=h[1],p=Object(n.useState)(null),v=Object(l.a)(p,2),F=v[0],y=v[1],C=Object(n.useState)(0),S=Object(l.a)(C,2),B=S[0],M=S[1],E=Object(n.useState)(0),I=Object(l.a)(E,2),R=I[0],U=I[1],D=Object(n.useState)({x:0,y:0,scale:1}),N=Object(l.a)(D,2),L=N[0],Y=N[1],A=Object(n.useCallback)((function(e){c(e)}),[c]),T=Object(n.useCallback)((function(e){var t=e.x,a=e.y,r=e.scale;console.log({x:t,y:a,scale:r}),Y({x:t,y:a,scale:r})}),[]),X=Object(n.useCallback)((function(e){if(e){var t=new FileReader;t.onload=function(t){var a=new Image;a.onload=function(){var r,n;a.width