mirror of
https://github.com/voltbonn/profile-picture-generator.git
synced 2024-12-22 15:55:08 +00:00
2 lines
No EOL
20 KiB
JavaScript
2 lines
No EOL
20 KiB
JavaScript
(this["webpackJsonpprofile-picture-generator"]=this["webpackJsonpprofile-picture-generator"]||[]).push([[0],{38:function(e,t,n){},42:function(e,t,n){var a={"./0xSOM.png":[50,13],"./2xSOM-Blue-Green.png":[51,14],"./2xSOM-Red-Yellow.png":[52,15],"./4xSOM-Blue-Red-Yellow-Green-Overflow.png":[53,16],"./4xSOM-Blue-Red-Yellow-Green.png":[54,17],"./5xSOM-Blue.png":[55,18],"./5xSOM-Green.png":[56,19],"./5xSOM-Pride.png":[57,20],"./5xSOM-Red.png":[58,21],"./5xSOM-White.png":[59,22],"./5xSOM-Yellow.png":[60,23],"./Mixed_Bars_Overflow_Non_Binary.png":[61,24],"./Mixed_Bars_Overflow_Pride.png":[62,25],"./Mixed_Bars_Overflow_Trans.png":[63,26],"./RectanglePurple.png":[64,27],"./Volt-Stars.png":[65,28],"./btw_Meine_Stimme_Balken.png":[66,29],"./btw_Meine_Stimme_Sterne_bunt.png":[67,30],"./btw_Meine_Stimme_Sterne_lila.png":[68,31],"./btw_VoteVolt_Balken.png":[69,32],"./btw_VoteVolt_Sterne_bunt.png":[70,33],"./btw_VoteVolt_Sterne_lila.png":[71,34],"./pride-2022-1.png":[72,35],"./pride-2022-2.png":[73,36],"./ukraine.png":[74,37]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=42,e.exports=c},43:function(e,t,n){var a={"./#DeineWahl.png":[75,38],"./#EUReform.png":[76,39],"./#Europa.png":[77,40],"./#EuropeCares.png":[78,41],"./#European.png":[79,42],"./#FutureMadeInEurope.png":[80,43],"./#GeneratieEuropa.png":[81,44],"./#GeneratieVolt.png":[82,45],"./#GenerationEuropa.png":[83,46],"./#IkStemVolt.png":[84,47],"./#JetztBistDuDran.png":[85,48],"./#JoinTheChange.png":[86,49],"./#RejoinEU.png":[87,50],"./#ValuesOverPower.png":[88,51],"./#Volt.png":[89,52],"./#Volt21.png":[90,53],"./#VoltEuropa.png":[91,54],"./#VoltForLGBTIAQ.png":[92,55],"./#VoltGA.png":[93,56],"./#VoltRLP.png":[94,57],"./#VoteVolt.png":[95,58],"./#WirWerdenLaut.png":[96,59],"./#ZukunftMadeInEurope.png":[97,60],"./#ZweitstimmeVolt.png":[98,61],"./#democracy.png":[99,62],"./#paneurop\xe4isch.png":[100,63],"./#pragmatisch.png":[101,64],"./#progressiv.png":[102,65],"./FriedenInEuropa.png":[103,66],"./IVotedFromAbroad.png":[104,67],"./PeaceInEurope.png":[105,68],"./Volt.png":[106,69],"./stemvolt.nl.png":[107,70]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=43,e.exports=c},48:function(e,t,n){var a={"./de.ftl":[108,3],"./en.ftl":[109,4],"./es.ftl":[110,5],"./fr.ftl":[111,6],"./it.ftl":[112,7],"./nl.ftl":[113,8],"./pl.ftl":[114,9],"./pt.ftl":[115,10],"./ru.ftl":[116,11]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=48,e.exports=c},49:function(e,t,n){"use strict";n.r(t);var a=n(5),c=n(2),r=n(1),o=n(0),i=n.n(o),s=n(25),u=n.n(s),O=n(13),l=n(6),h=n(32),d=(n(38),n(30)),j=n(27),p=n(4),b=n.n(p),f=n(9);var g=function(e){var t=e.onChange,a=Object(o.useState)([]),i=Object(c.a)(a,2),s=i[0],u=i[1],O=Object(o.useState)(null),l=Object(c.a)(O,2),h=l[0],d=l[1],j=h?h.src:null;Object(o.useEffect)((function(){function e(){return(e=Object(f.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all(["0xSOM","4xSOM-Blue-Red-Yellow-Green-Overflow","4xSOM-Blue-Red-Yellow-Green","ukraine","Mixed_Bars_Overflow_Pride","Mixed_Bars_Overflow_Trans","Mixed_Bars_Overflow_Non_Binary","Volt-Stars","RectanglePurple","5xSOM-Blue","5xSOM-Green","5xSOM-Red","5xSOM-Yellow"].map(function(){var e=Object(f.a)(b.a.mark((function e(t){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,n(42)("./".concat(t,".png"));case 3:return e.t1=e.sent.default,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){u(e),d(e[0])}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var p=Object(o.useCallback)((function(e){d(e)}),[d]);return Object(o.useEffect)((function(){t(h)}),[t,h]),Object(r.jsx)("div",{className:"FrameChooser",children:s.map((function(e){var t=e.src,n=j===t;return Object(r.jsx)("div",{"data-src":t,className:n?"frame choosen":"frame",onClick:function(){return p(e)},children:Object(r.jsx)("img",{alt:e.name,src:t})},t)}))})},w=n(17),x=n(10),m=function(e){return Object(r.jsx)(w.b,Object(l.a)(Object(l.a)({},e),{},{elems:Object(l.a)({br:Object(r.jsx)("br",{})},e.elems),children:Object(r.jsx)(i.a.Fragment,{children:e.children})}),e.id)};function v(e){return function(t){var n=i.a.useContext(x.a);return i.a.createElement(e,Object(l.a)({getString:function(e,t,a){return n.getString(e,t,a||" ")}},t))}}var A={IVotedFromAbroad:"I voted from abroad!",PeaceInEurope:"Peace in Europe",FriedenInEuropa:"Frieden in Europa"};var C=v((function(e){var t=e.onChange,a=e.getString,i=Object(o.useState)([]),s=Object(c.a)(i,2),u=s[0],l=s[1],h=Object(o.useState)(null),d=Object(c.a)(h,2),j=d[0],p=d[1],g=j?j.src:null,w=a("hashtags");Object(o.useEffect)((function(){function e(){return(e=Object(f.a)(b.a.mark((function e(){return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all([""].concat(Object(O.a)(w.split("\n").map((function(e){return e.trim()})).filter((function(e){return e.length>0})))).map(function(){var e=Object(f.a)(b.a.mark((function e(t){var a,c;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t,""===t){e.next=5;break}return e.next=4,n(43)("./".concat(t,".png"));case 4:a=e.sent.default;case 5:return c=A[t]||t,e.abrupt("return",{name:c,src:a});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then((function(e){l(e),p(e[0])}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[w]);var x=Object(o.useCallback)((function(e){p(e)}),[p]);return Object(o.useEffect)((function(){t(j)}),[t,j]),Object(r.jsx)("div",{className:"HashtagChooser",children:u.map((function(e){var t=e.src,n=g===t;return Object(r.jsx)("button",{"data-src":t,className:n?"isInRow choosen":"isInRow",onClick:function(){return x(e)},children:""===e.name?a("button_no_hashtag"):e.name},e.name)}))})})),D=n(28),Q=n.n(D),H=n(29),T=n.n(H);function _(e,t,n){return Math.min(Math.max(t,e),n)}var N=function(e){var t=e.onChange,n=e.backgroundURL,a=e.backgroundRatio,i=e.frameURL,s=e.hashtagURL,u=Object(o.useRef)(null),O=Object(o.useRef)(null),l=Object(o.useState)(!1),h=Object(c.a)(l,2),d=h[0],j=h[1],p=Object(o.useState)(null),b=Object(c.a)(p,2),f=b[0],g=b[1],w=Object(o.useState)(null),x=Object(c.a)(w,2),m=x[0],v=x[1],A=Object(o.useState)(0),C=Object(c.a)(A,2),D=C[0],H=C[1],N=Object(o.useState)(0),U=Object(c.a)(N,2),k=U[0],S=U[1],F=Object(o.useState)(0),E=Object(c.a)(F,2),M=E[0],y=E[1],B=Object(o.useState)(0),K=Object(c.a)(B,2),R=K[0],I=K[1],L=Object(o.useState)(1),P=Object(c.a)(L,2),V=P[0],Y=P[1],G=Object(o.useState)(300),z=Object(c.a)(G,2),J=z[0],X=z[1],W=Object(o.useState)(300),Z=Object(c.a)(W,2),q=Z[0],$=Z[1],ee=Object(o.useState)(300),te=Object(c.a)(ee,2),ne=te[0],ae=te[1],ce=Object(o.useState)(300),re=Object(c.a)(ce,2),oe=re[0],ie=re[1],se=Object(o.useState)(0),ue=Object(c.a)(se,2),Oe=ue[0],le=ue[1],he=Object(o.useState)(0),de=Object(c.a)(he,2),je=de[0],pe=de[1],be=Object(o.useState)(0),fe=Object(c.a)(be,2),ge=fe[0],we=fe[1],xe=Object(o.useState)(0),me=Object(c.a)(xe,2),ve=me[0],Ae=me[1];Object(o.useEffect)((function(){t&&t({x:D,y:k,scale:V})}),[t,D,k,V]),Object(o.useEffect)((function(){if(u&&u.current){var e=u.current.offsetWidth,t=u.current.offsetHeight;ie(t),ae(e);var n=1,c=1;a<1?n=1/a:a>1&&(c=1*a),X(n),$(c)}}),[a]),Object(o.useEffect)((function(){var e=function(e,t,n,a,c){var r=Math.max(0,e*n-a)/2,o=Math.max(0,t*n-c)/2;return{rangeMaxX:r,rangeMinX:0-r,rangeMaxY:o,rangeMinY:0-o}}(J*ne,q*oe,V,ne,oe),t=e.rangeMinX,n=e.rangeMinY,a=e.rangeMaxX,c=e.rangeMaxY;le(t),pe(n),we(a),Ae(c)}),[J,q,ne,oe,V]),Object(o.useEffect)((function(){H(0),S(0),y(0),I(0),Y(1)}),[n]);var Ce=Object(o.useCallback)((function(e){var t=1*e.target.dataset.x,n=1*e.target.dataset.y,a=_(t+e.deltaX,Oe,ge),c=_(n+e.deltaY,je,ve);e.isFinal?(H(a||0),S(c||0),y(0),I(0)):(y(a-t||0),I(c-n||0))}),[Oe,je,ge,ve]),De=Object(o.useCallback)((function(e,t,n,a){e.preventDefault();var c=_(1*e.target.dataset.scale+t/200,1,8);Y(c||1);var r=1*e.target.dataset.x,o=1*e.target.dataset.y;H(_(r,Oe,ge)||0),S(_(o,je,ve)||0)}),[Oe,je,ge,ve]);return Object(o.useEffect)((function(){if(!d&&u&&u.current){var e=u.current;e.addEventListener("mousedown",(function(e){e.preventDefault()}),!1),e.addEventListener("touchstart",(function(e){e.preventDefault()}),!1),e.addEventListener("touchend",(function(e){e.preventDefault()}),!1),e.addEventListener("touchmove",(function(e){e.preventDefault()}),!1),g(new Q.a(e,{direction:"DIRECTION_ALL"})),v(T()(e)),j(!0)}}),[u,d]),Object(o.useEffect)((function(){if(f&&m&&d&&u&&u.current)return f.on("pan",Ce),m.wheel(De),function(){f.off("pan",Ce),m.unwheel()}}),[u,Ce,De,d,f,m]),Object(r.jsxs)("div",{className:"Editor",ref:u,"data-x":D,"data-y":k,"data-scale":V,children:[Object(r.jsx)("img",{src:n,ref:O,alt:"",className:"background",style:{width:100*J+"%",height:100*q+"%",transform:"translate3d(calc(-50% + ".concat(D+M,"px), calc(-50% + ").concat(k+R,"px), 0) scale(").concat(V,",").concat(V,")")}}),Object(r.jsx)("img",{src:i,alt:"",className:"foreground"}),Object(r.jsx)("img",{src:s,alt:"",className:"hashtag"})]})},U=n.p+"static/media/VoltLogoPurple.125355f6.svg",k="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABDgAAAQ4AgMAAACRfoQcAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJUExURVAjeFAjeE8jd3Yl3xwAAAADdFJOU//+/Q3dsqEAAATsSURBVHgB7dAxAQAABAAwQtI/ipMCvi3CgiMV6NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQ4cOdOjQoUOHDh06dOjQoUOHDh06dOjQoQMdOnTo0KFDhw4dOnTo0KFDhw4dOnToQIcOHTp06NChQ4cOHTp06NChQ4cOHejQoUOHDh06dOjQoUOHDh06dOjQoUMHOnTo0KFDhw4dOnTo0KFDhw4dOnTo0IEOHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NChQIcOHTp06NChQ4cOHTp06NChQ4cOHejQoUOHDh06dOjQoUOHDh06dOjQoUMHOnTo0KFDhw4dOnTo0KFDhw4dOnTo0IEOHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06ECHDh06dOjQoUOHDh06dOjQoUOHDh060KFDhw4dOnTo0KFDhw4dOnTo0KFDhw506NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQ4cOBTp06NChQ4cOHTp06NChQ4cOHTp06ECHDh06dOjQoUOHDh06dOjQoUOHDh060KFDhw4dOnTo0KFDhw4dOnTo0KFDhw506NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQwc6dOjQoUOHDh06dOjQoUOHDh06dOjQgQ4dOnTo0KFDhw4dOnTo0KFDhw4dOnSgQ4cOHTp06NChQ4cOHTp06NChQ4cOHTx06NChQ4cOdOjQoUOHDh06dOjQoUOHDh06dOjQoQMdOnTo0KFDhw4dOnTo0KFDhw4dOnToQIcOHTp06NChQ4cOHTp06NChQ4cOHTrQoUOHDh06dOjQoUOHDh06dOjQoUOHDnTo0KFDhw4dOnTo0KFDhw4dOnTo0KEDHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NCBDh06dOjQoUOHDh06dOjQoUOHDh06dKBDhw4dOnTo0KFDhw4dOnTo0KFDhw4d6NChQ4cOHTp06NChQ4cOHTp06NChQ4cCHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NCBDh06dOjQoUOHDh06dOjQoUOHDh06dKBDhw4dOnTo0KFDhw4dOnTo0KFDhw4dxeoB30xd38yzCvgAAAAASUVORK5CYII=",S="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAALSURBVHgBY2BgAAAAAwABjPg5OgAAAABJRU5ErkJggg==",F=1080;function E(e){var t=e.href,n=e.name,a=e.target,c=e.children,i=Object(h.a)(e,["href","name","target","children"]),s=Object(o.useCallback)((function(e){return window.umami&&n&&window.umami.track("A: "+n),a?window.open(t,a):setTimeout((function(){window.location=t}),200),e.preventDefault(),!1}),[t,n,a]);return Object(r.jsx)("a",Object(l.a)(Object(l.a)({},i),{},{href:t,onClick:s,children:c}))}var M=v((function(e){var t=e.getString,n=e.locales,a=e.currentLocale,i=e.onLanguageChange,s=Object(o.useState)(null),u=Object(c.a)(s,2),h=u[0],p=u[1],b=Object(o.useState)(null),f=Object(c.a)(b,2),w=f[0],x=f[1],v=Object(o.useState)(null),A=Object(c.a)(v,2),D=A[0],Q=A[1],H=Object(o.useState)(1),T=Object(c.a)(H,2),_=T[0],M=T[1],y=Object(o.useState)(null),B=Object(c.a)(y,2),K=B[0],R=B[1],I=h?h.src:null,L=w?w.src:null,P=Object(o.useState)(0),V=Object(c.a)(P,2),Y=V[0],G=V[1],z=Object(o.useState)(0),J=Object(c.a)(z,2),X=J[0],W=J[1],Z=Object(o.useState)({x:0,y:0,scale:1}),q=Object(c.a)(Z,2),$=q[0],ee=q[1],te=Object(o.useCallback)((function(e){p(e)}),[p]),ne=Object(o.useCallback)((function(e){x(e)}),[x]),ae=Object(o.useCallback)((function(e){var t=e.x,n=e.y,a=e.scale;ee({x:t,y:n,scale:a})}),[]),ce=Object(o.useCallback)((function(e){if(e){var t=new FileReader;t.onload=function(t){var n=new Image;n.onload=function(){var a,c;n.width<n.height?(c=n.height/n.width*F,a=F):(c=F,a=n.width/n.height*F),function(e,t){var n=new FileReader;n.onload=function(e){var n=new DataView(e.target.result);if(65496!==n.getUint16(0,!1))return t(-2);for(var a=n.byteLength,c=2;c<a;){var r=n.getUint16(c,!1);if(c+=2,65505===r){if(1165519206!==n.getUint32(c+=2,!1))return t(-1);var o=18761===n.getUint16(c+=6,!1);c+=n.getUint32(c+4,o);var i=n.getUint16(c,o);c+=2;for(var s=0;s<i;s++)if(274===n.getUint16(c+12*s,o))return t(n.getUint16(c+12*s+8,o))}else{if(65280!==(65280&r))break;c+=n.getUint16(c,!1)}}return t(-1)},n.readAsArrayBuffer(e.slice(0,65536))}(e,(function(e){var n=1;switch(e){case 2:case 3:case 4:n=c/a;break;case 5:case 6:case 7:case 8:n=a/c;break;default:n=c/a}G(a),W(c),Q(t.target.result),R(e),M(n)}))},n.src=t.target.result},t.readAsDataURL(e)}}),[]),re=Object(o.useCallback)((function(e){ce(e.target.files[0])}),[ce]),oe=Object(o.useCallback)((function(e){ce(e[0])}),[ce]),ie=Object(o.useCallback)((function(){var e=new Image;e.onload=function(){var t=document.createElement("canvas");t.width=F,t.height=F;var n=t.getContext("2d",{alpha:!0});switch(K){case 2:n.translate(t.width,0),n.scale(-1,1);break;case 3:n.translate(t.width,t.height),n.rotate(Math.PI);break;case 4:n.translate(0,t.height),n.scale(1,-1);break;case 5:n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:n.rotate(.5*Math.PI),n.translate(0,-t.height);break;case 7:n.rotate(.5*Math.PI),n.translate(t.width,-t.height),n.scale(-1,1);break;case 8:n.rotate(-.5*Math.PI),n.translate(-t.width,0)}var a=Y*$.scale,c=X*$.scale;n.drawImage(e,3.5*$.x+.5*(F-a),3.5*$.y+.5*(F-c),a,c);var r=t.toDataURL();Object(j.a)([k].concat(Object(O.a)(r?[r]:[]),Object(O.a)(I?[I]:[]),Object(O.a)(L?[L]:[]))).then((function(e){!function(e,t){var n=document.createElement("a");document.body.appendChild(n),n.download=e,n.href=t,n.click(),n.remove()}("volt-profile-picture.png",e);var t=h.name||"No-Frame",n=w.name||"No-Hashtag";window.umami&&(window.umami.track("F: "+t),window.umami.track("H: "+n),window.umami.track("C: "+[t,n].join(" | ")))}))},e.src=D}),[D,$.x,$.y,$.scale,K,I,L,X,Y,h,w]),se=Object(d.a)({onDrop:oe,accept:"image/*",maxFiles:1,noKeyboard:!0}),ue=se.isDragActive,Oe=se.getRootProps;return Object(r.jsxs)("div",Object(l.a)(Object(l.a)({className:"App"},Oe()),{},{children:[Object(r.jsx)("img",{src:U,className:"HeaderImage",alt:t("alt_volt_logo")}),Object(r.jsx)("h1",{children:Object(r.jsx)(m,{id:"title_profile_generator"})}),Object(r.jsx)("div",{className:ue?"droparea active":"droparea",children:Object(r.jsx)(m,{id:"title_drop_photo_here"})}),Object(r.jsx)("h2",{children:Object(r.jsx)(m,{id:"title_choose_photo"})}),Object(r.jsx)("p",{children:Object(r.jsx)(m,{id:"text_choose_photo_info"})}),Object(r.jsxs)("label",{className:"labelButton",tabIndex:"0",style:{outline:"none"},children:[D?Object(r.jsx)("img",{src:D,alt:"Preview"}):null,Object(r.jsx)("span",{children:t(D?"button_change_photo":"button_load_photo")}),Object(r.jsx)("input",{onChange:re,type:"file",accept:"image/*",style:{display:"none"}})]}),Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)("h2",{children:Object(r.jsx)(m,{id:"title_choose_frame"})}),Object(r.jsx)(g,{onChange:te}),(I||"").startsWith("/static/media/btw_")?null:Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)("h2",{children:Object(r.jsx)(m,{id:"title_choose_hashtag"})}),Object(r.jsx)(C,{onChange:ne})]})]}),D&&I?Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)("h2",{children:Object(r.jsx)(m,{id:"title_reposition_photo"})}),Object(r.jsx)(N,{backgroundURL:D||S,backgroundRatio:_,frameURL:I,hashtagURL:L||S,onChange:ae}),Object(r.jsx)("button",{onClick:ie,children:Object(r.jsx)(m,{id:"button_download"})})]}):null,Object(r.jsxs)("footer",{children:[Object(r.jsx)(E,{name:"imprint",href:"https://www.voltdeutschland.org/impressum",children:Object(r.jsx)(m,{id:"link_imprint"})}),"\xa0 \u2022 \xa0",Object(r.jsx)(E,{name:"privacy_policy",href:"https://www.voltdeutschland.org/datenschutz",children:Object(r.jsx)(m,{id:"link_privacy_policy"})}),"\xa0 \u2022 \xa0",Object(r.jsx)(E,{name:"source_code",href:"https://github.com/voltbonn/profile-picture-generator",children:Object(r.jsx)(m,{id:"link_source_code"})}),"\xa0 \u2022 \xa0",Object(r.jsx)(E,{name:"contact",href:"mailto:thomas.rosen@volteuropa.org",children:Object(r.jsx)(m,{id:"link_app_contact"})})]}),n&&i?Object(r.jsx)("div",{className:"locale_chooser",children:Object.entries(n).map((function(e){var t=Object(c.a)(e,2),n=t[0],o=t[1];return Object(r.jsx)("button",{className:n===a?"isInRow choosen":"isInRow","data-locale":n,onClick:i,children:o},n)}))}):null]}))})),y=function(e){e&&e instanceof Function&&n.e(12).then(n.bind(null,117)).then((function(t){var n=t.getCLS,a=t.getFID,c=t.getFCP,r=t.getLCP,o=t.getTTFB;n(e),a(e),c(e),r(e),o(e)}))},B=(n(44),n(21)),K=n(20),R=n(31),I={de:"Deutsch",en:"English",es:"Espa\xf1ol",pt:"Portugu\xeas",fr:"Fran\xe7ais",it:"Italiano",nl:"Nederlands",pl:"Polska",ru:"P\u0443\u0441\u0441\u043a\u0438\u0439"},L=Object.keys(I);function P(e){return V.apply(this,arguments)}function V(){return(V=Object(f.a)(b.a.mark((function e(t){var a,c,r;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(48)("./"+t+".ftl");case 2:return a=e.sent,e.next=5,fetch(a.default);case 5:return c=e.sent,e.next=8,c.text();case 8:return r=e.sent,e.abrupt("return",Object(B.a)({},t,new K.b(r)));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(e){return G.apply(this,arguments)}function G(){return(G=Object(f.a)(b.a.mark((function e(t){var n,c;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map(P));case 2:return n=e.sent,c=n.reduce((function(e,t){return Object.assign(e,t)})),e.abrupt("return",b.a.mark((function e(){var n,r,o,i;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Object(a.a)(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=11;break}return o=r.value,(i=new K.a(o)).addResource(c[o]),e.next=9,i;case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),n.e(e.t0);case 16:return e.prev=16,n.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(e){var t=e.userLocales,n=e.children,a=e.onLocaleChange,i=Object(o.useState)(function(){var e=new K.a("");return e.addResource(new K.b("")),new w.c([e])}()),s=Object(c.a)(i,2),u=s[0],O=s[1];return Object(o.useEffect)((function(){function e(){return(e=Object(f.a)(b.a.mark((function e(){var n,c;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(R.a)(t,L,{defaultLocale:"en"}),a&&a(n),e.next=4,Y(n);case 4:c=e.sent,O(new w.c(c()));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[t,a]),u?Object(r.jsx)(w.a,{l10n:u,children:n}):Object(r.jsx)("div",{children:"Loading texts\u2026"})}function J(){var e=Object(o.useState)(navigator.languages),t=Object(c.a)(e,2),n=t[0],i=t[1],s=Object(o.useState)(null),u=Object(c.a)(s,2),O=u[0],l=u[1];Object(o.useEffect)((function(){var e=navigator.languages;if(window.umami&&(e||Array.isArray(e))){var t,n=Object(a.a)(e);try{for(n.s();!(t=n.n()).done;){var c=t.value;window.umami.track("L: "+c)}}catch(r){n.e(r)}finally{n.f()}}}),[]);var h=Object(o.useCallback)((function(e){i([e.target.dataset.locale])}),[i]),d=Object(o.useCallback)((function(e){l(e.length>0?e[0]:"")}),[l]);return Object(r.jsx)(z,{userLocales:n,onLocaleChange:d,children:Object(r.jsx)(M,{locales:I,currentLocale:O,onLanguageChange:h})},"AppLocalizationProvider")}u.a.render(Object(r.jsx)(i.a.StrictMode,{children:Object(r.jsx)(J,{})}),document.getElementById("root")),y()}},[[49,1,2]]]);
|
|
//# sourceMappingURL=main.cfd67202.chunk.js.map
|