"use strict";(self.webpackChunkweb_toolbox=self.webpackChunkweb_toolbox||[]).push([[752],{32376:(e,t,a)=>{a.d(t,{A:()=>c});var o=a(9950),n=a(69935),r=a(10226),i=a(67243),l=a.n(i),s=a(77671);const c=e=>{let{data:t,isDisabled:a,hoverMessage:i,feedbackMessage:c,Icon:d=n.A,...m}=e;const{setToasterState:u}=(0,s.dq)();return o.createElement(r.A,Object.assign({disabled:!t||a,title:null!==i&&void 0!==i?i:"Copy to clipboard",variant:"contained","data-testid":"copy-to-clipboard",color:"primary"},m,{onClick:()=>{if(!t)return;const e=null!==c&&void 0!==c?c:"Content copied into clipboard: ".concat(t.substring(0,25)," \u2026");l()(t,{format:"text/plain"}),u({open:!0,message:e,type:"success",autoHideDuration:2e3})}}),o.createElement(d,null))}},50057:(e,t,a)=>{a.d(t,{n:()=>s});var o=a(9950),n=a(25131),r=a(72772),i=a(73931);const l=(0,n.A)((e=>({root:{margin:e.spacing(1)}}))),s=e=>{let{title:t,iconType:a,children:n}=e;const s=l();return o.createElement(o.Fragment,null,o.createElement(r.m,{titleTemplate:"Web Toolbox - %s",defaultTitle:"Web Toolbox",title:t}),o.createElement("div",{className:s.root},o.createElement(i.A,{iconType:a,title:t}),n))}},73931:(e,t,a)=>{a.d(t,{A:()=>i});var o=a(9950),n=a(82053);const r=(0,a(25131).A)((e=>({title:{wordBreak:"break-word"},titleWithIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginBottom:e.spacing(1)},icon:{height:"40px",width:"40px",marginRight:e.spacing(1)}}))),i=e=>{let{title:t,iconType:a}=e;const i=r();return o.createElement("div",{className:i.titleWithIcon},o.createElement(a,{className:i.icon}),o.createElement(n.A,{variant:"h5",className:i.title},t))}},14752:(e,t,a)=>{a.r(t),a.d(t,{default:()=>N,mapDispatchToProps:()=>R,mapStateToProps:()=>E});var o=a(9950),n=a(72239),r=a(84689),i=a(60899),l=a(8145),s=a(36080),c=a(83239),d=a(16491),m=a(10226),u=a(48089),p=a(50704),g=a(25131),A=a(88021),f=a(10300),v=a(33602),h=a(32376),C=a(50057),b=a(77671),y=a(1810);const x={errorCorrectionLevel:"H",type:"image/png",width:200,quality:.3,margin:1,color:{dark:"#000000FF",light:"#FFFFFFFF"}},w=(0,g.A)((e=>({toolbar:{margin:0,padding:0},qrOptions:{fontFamily:"monospace"},generatedQR:{padding:e.spacing(2)}})));function E(e){return{inputText:e.textInputs.lastQRCodeTextValue,inputOptions:e.textInputs.lastQRCodeOptions}}function R(e){return{storeInputText:(t,a)=>e((0,v.s)(t,a))}}const N=(0,f.Ng)(E,R)((e=>{let{inputText:t,inputOptions:a,storeInputText:g}=e;const f=w(),v=(0,y.Pb)("md"),[E,R]=o.useState(""),{setToasterState:N}=(0,b.dq)();return o.createElement(C.n,{iconType:r.A,title:"QR Code generator"},o.createElement("form",{noValidate:!0,autoComplete:"off"},o.createElement(i.Ay,{container:!0,spacing:1},o.createElement(i.Ay,{item:!0,md:6,sm:12,xs:12},o.createElement(l.A,{autoFocus:v,label:"Text to store into QR Code",placeholder:"Paste or type the content here",multiline:!0,minRows:12,maxRows:v?20:12,variant:"outlined",margin:"normal",fullWidth:!0,value:t,onChange:e=>g("lastQRCodeTextValue",e.target.value)})),o.createElement(i.Ay,{item:!0,md:6,sm:12,xs:12},o.createElement(l.A,{label:"QR Code generation options",multiline:!0,minRows:12,maxRows:v?20:12,variant:"outlined",margin:"normal",fullWidth:!0,InputProps:{classes:{input:f.qrOptions}},value:a,onChange:e=>g("lastQRCodeOptions",e.target.value),helperText:o.createElement(s.A,{target:"_blank",rel:"noreferrer",href:"https://www.npmjs.com/package/qrcode#qr-code-options"},"Options documentation available here!")})))),o.createElement(c.A,{className:f.toolbar},o.createElement(d.A,{component:"div",flexGrow:1}),o.createElement(h.A,{hoverMessage:"Copy image data URL",data:E,sx:{mr:1}}),o.createElement(m.A,{disabled:!E,variant:"contained",title:"Copy the QR Code image into the clipboard",color:"primary",onClick:async()=>{try{const e=await fetch(E),t=await e.blob();await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),N({open:!0,message:"Image copied",type:"success",autoHideDuration:2e3})}catch(e){console.error(e);N({open:!0,message:"Unexpected copy error, see detail on console",type:"warning",autoHideDuration:2e3})}},endIcon:o.createElement(n.A,null),sx:{mr:1}},"Copy Image"),o.createElement(m.A,{variant:"contained",color:"primary",title:"Generate the QR code using the info and encoding parameters",onClick:function(){if(!t)return;const e=a?JSON.parse(a):x;A.toDataURL(t,e,((t,a)=>{if(t)throw t;R(a),g("lastQRCodeOptions",JSON.stringify(e,null,2))}))},disabled:!t,endIcon:o.createElement(r.A,null)},"Generate")),E&&o.createElement(u.A,{className:f.generatedQR},o.createElement(d.A,{component:"div",alignItems:"center",justifyContent:"center",p:1},o.createElement("img",{id:"imgQrCode",src:E,alt:"QR Code"})),o.createElement(p.A,null,o.createElement(l.A,{label:"Full img tag",fullWidth:!0,value:'<img alt="QR Code" src="'.concat(E,'"/>'),margin:"normal",variant:"outlined"}),o.createElement(l.A,{label:"QR Code. Copy-paste into 'src' attribute",fullWidth:!0,value:E,margin:"normal",variant:"outlined",multiline:!0,minRows:"8"}))))}))},72239:(e,t,a)=>{var o=a(24994);t.A=void 0;var n=o(a(79526)),r=a(44414);t.A=(0,n.default)((0,r.jsx)("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Photo")},16491:(e,t,a)=>{a.d(t,{A:()=>C});var o=a(58168),n=a(98587),r=a(9950),i=a(72004),l=a(10116),s=a(70505),c=a(80237),d=a(7148),m=a(44414);const u=["className","component"];var p=a(41681),g=a(58258),A=a(67550);const f=(0,a(80863).A)("MuiBox",["root"]),v=(0,g.A)(),h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:a,defaultClassName:p="MuiBox-root",generateClassName:g}=e,A=(0,l.default)("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(s.A);return r.forwardRef((function(e,r){const l=(0,d.A)(a),s=(0,c.A)(e),{className:f,component:v="div"}=s,h=(0,n.A)(s,u);return(0,m.jsx)(A,(0,o.A)({as:v,ref:r,className:(0,i.A)(f,g?g(p):p),theme:t&&l[t]||l},h))}))}({themeId:A.A,defaultTheme:v,defaultClassName:f.root,generateClassName:p.A.generate}),C=h},48089:(e,t,a)=>{a.d(t,{A:()=>v});var o=a(58168),n=a(98587),r=a(9950),i=a(72004),l=a(74061),s=a(59254),c=a(48283),d=a(2235),m=a(80863),u=a(68483);function p(e){return(0,u.Ay)("MuiCard",e)}(0,m.A)("MuiCard",["root"]);var g=a(44414);const A=["className","raised"],f=(0,s.Ay)(d.A,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({overflow:"hidden"}))),v=r.forwardRef((function(e,t){const a=(0,c.A)({props:e,name:"MuiCard"}),{className:r,raised:s=!1}=a,d=(0,n.A)(a,A),m=(0,o.A)({},a,{raised:s}),u=(e=>{const{classes:t}=e;return(0,l.A)({root:["root"]},p,t)})(m);return(0,g.jsx)(f,(0,o.A)({className:(0,i.A)(u.root,r),elevation:s?8:void 0,ref:t,ownerState:m},d))}))},50704:(e,t,a)=>{a.d(t,{A:()=>f});var o=a(58168),n=a(98587),r=a(9950),i=a(72004),l=a(74061),s=a(59254),c=a(48283),d=a(80863),m=a(68483);function u(e){return(0,m.Ay)("MuiCardContent",e)}(0,d.A)("MuiCardContent",["root"]);var p=a(44414);const g=["className","component"],A=(0,s.Ay)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({padding:16,"&:last-child":{paddingBottom:24}}))),f=r.forwardRef((function(e,t){const a=(0,c.A)({props:e,name:"MuiCardContent"}),{className:r,component:s="div"}=a,d=(0,n.A)(a,g),m=(0,o.A)({},a,{component:s}),f=(e=>{const{classes:t}=e;return(0,l.A)({root:["root"]},u,t)})(m);return(0,p.jsx)(A,(0,o.A)({as:s,className:(0,i.A)(f.root,r),ownerState:m,ref:t},d))}))}}]);