lamassu-server/public/static/js/main.a4b79bb3.chunk.js
Sérgio Salgado e49f91df33 chore: revert erc20 changes
chore: small fixes
chore: build react admin
2022-06-01 19:18:12 +01:00

2 lines
No EOL
830 KiB
JavaScript

(this["webpackJsonplamassu-admin"]=this["webpackJsonplamassu-admin"]||[]).push([[0],{735:function(e,t){},737:function(e,t){},738:function(e,t){},759:function(e,t){},761:function(e,t){},768:function(e,t){},770:function(e,t){},817:function(e,t){},895:function(e,t){},897:function(e,t){},908:function(e,t){},922:function(e,t){},968:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),i=n(47),o=n.n(i),l=n(2),c=n(9),s=n(6),d=n(50),u=n(8),m=n(1111),h=n(1032),p=n(395),b=n(574),f=n(407),j=n(1008),g=n(1096),O=n(10),x=n.n(O),v=n(73),y=n(524),w=n(173),C=n(56),k=r.a.createContext(),E=n(1014),N=n(1012),S=n(7),I=n.n(S),L=n(1031),F=n(533),P=n(552),D=n(545),T=n(97),R=n(536),B=n(1009),A=n(210),M=n(329),W=n(1010),z=n(5),q=n(20),$="#5f668a",H="#44e188",V="#ecfbef",U="#3fd07e",G="#ebefff",X="#dbdfed",_="#16d6d3",Z="#5a67ff",K="#ffffff",Q="#ff584a",Y="#ffeceb",J="#1b2559",ee="#48f694",te=H,ne=U,ae="#fafbff",re=G,ie=X,oe="#dddddd",le="#f2f2f2",ce=J,se=$,de="#72799d",ue="#525772",me=$,he=Q,pe=Y,be=1200,fe=ee,je="Mont",ge="MuseoSans",Oe="BPmono",xe=24,ve=20,ye=16,we=14,Ce=13;var ke=Ce,Ee=we,Ne=ye,Se=xe,Ie=500,Le=ge,Fe=32,Pe=48;var De=2*Fe,Te=J,Re=Y,Be=V,Ae={lineHeight:"120%",color:ce},Me={h1:{extend:Ae,fontSize:xe,fontFamily:je,fontWeight:900},h2:{extend:Ae,fontSize:ve,fontFamily:je,fontWeight:900},h3:{extend:Ae,fontSize:we,fontFamily:je,fontWeight:900},h4:{extend:Ae,fontSize:we,fontFamily:je,fontWeight:700},h5:{extend:Ae,fontSize:ye,fontFamily:je,fontWeight:700},p:{extend:Ae,fontSize:we,fontFamily:ge,fontWeight:500},tl1:{extend:Ae,fontSize:ve,fontFamily:ge,fontWeight:700},tl2:{extend:Ae,fontSize:we,fontFamily:ge,fontWeight:700},info1:{extend:Ae,fontSize:xe,fontFamily:ge,fontWeight:700},info2:{extend:Ae,fontSize:ye,fontFamily:ge,fontWeight:700},info3:{extend:Ae,fontSize:ye,fontFamily:ge,fontWeight:500},mono:{extend:Ae,fontSize:we,fontFamily:Oe,fontWeight:500},monoBold:{fontWeight:700},monoSmall:{fontSize:Ce},inputFont:{fontSize:ve,fontFamily:ge,fontWeight:500,lineHeight:"110%",color:ce},regularLabel:{fontSize:we,fontFamily:ge,fontWeight:500,lineHeight:"110%"},label1:{fontSize:Ce,fontFamily:ge,fontWeight:500,color:ce},label2:{fontSize:Ce,fontFamily:ge,fontWeight:700,color:ce},label3:{fontSize:we,fontFamily:ge,fontWeight:500,color:ce},confirmationCode:{extend:Ae,fontSize:35,fontFamily:ge,fontWeight:900},inline:{display:"inline"},noMargin:{margin:0}},We=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},ze={actionButton:{extend:Me.p,cursor:"pointer",border:"none",height:28,outline:0,borderRadius:6,padding:"0 8px",display:"flex",alignItems:"center"},primary:{extend:We(re,ie,se),"&:active":{color:K,"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},"& $actionButtonIconActive":{display:"none"}},secondary:{extend:We(se,de,ue),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},spring:{extend:We(te,ee,ne),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},tomato:{extend:We("#E45043",he,"#CE463A"),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},actionButtonIcon:{display:"flex",paddingRight:7,"@global":{svg:{width:14,height:14}}},actionButtonIconActive:{}},qe=n(0),$e=Object(f.a)(ze),He=Object(a.memo)((function(e){var t,n=e.className,a=e.Icon,r=e.InverseIcon,i=e.color,o=e.children,l=Object(q.a)(e,["className","Icon","InverseIcon","color","children"]),c=$e(),d=(t={},Object(z.a)(t,c.actionButton,!0),Object(z.a)(t,c.primary,"primary"===i),Object(z.a)(t,c.secondary,"secondary"===i),Object(z.a)(t,c.spring,"spring"===i),Object(z.a)(t,c.tomato,"tomato"===i),t);return Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(d,n)},l),{},{children:[a&&Object(qe.jsx)("div",{className:c.actionButtonIcon,children:Object(qe.jsx)(a,{})}),r&&Object(qe.jsx)("div",{className:I()(c.actionButtonIcon,c.actionButtonIconActive),children:Object(qe.jsx)(r,{})}),o&&Object(qe.jsx)("div",{children:o})]}))})),Ve=Object(f.a)(Me);function Ue(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h1,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h1",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Ge(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h2,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h2",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Xe(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h3,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h3",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function _e(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h4,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h4",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Ze(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h5,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h5",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}var Ke=ot("p"),Qe=ot("info1"),Ye=ot("info2"),Je=ot("info3"),et=ot("mono"),tt=ot("tl1"),nt=ot("tl2"),at=ot("label1"),rt=ot("label2"),it=ot("label3");function ot(e){return function(t){var n,a=t.inline,r=t.noMargin,i=t.className,o=t.children,l=Object(q.a)(t,["inline","noMargin","className","children"]),c=Ve(),d=(n={},Object(z.a)(n,i,!!i),Object(z.a)(n,c[e],e),Object(z.a)(n,c.inline,a),Object(z.a)(n,c.noMargin,r),n);return Object(qe.jsx)("p",Object(s.a)(Object(s.a)({className:I()(d)},l),{},{children:o}))}}function lt(){return(lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ct(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var st=a.createElement("desc",null,"Created with Sketch."),dt=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#1B2559",strokeWidth:2},a.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},a.createElement("path",{d:"M10.1052632,14.3157895 C10.1052632,15.2454737 9.35073684,16 8.42105263,16 C7.49136842,16 6.73684211,15.2454737 6.73684211,14.3157895",id:"Stroke-1"}),a.createElement("path",{d:"M1.6,14.3157895 C0.7168,14.3157895 0,13.6031813 0,12.7251462 C0,11.8471111 0.7168,11.1345029 1.6,11.1345029 L1.6,6.3625731 C1.6,2.84884211 4.4656,0 8,0 C11.5344,0 14.4,2.84884211 14.4,6.3625731 L14.4,11.1345029 C15.2832,11.1345029 16,11.8471111 16,12.7251462 C16,13.6031813 15.2832,14.3157895 14.4,14.3157895 L1.6,14.3157895 Z",id:"Stroke-3",strokeLinejoin:"round"}))));function ut(e,t){var n=e.title,r=e.titleId,i=ct(e,["title","titleId"]);return a.createElement("svg",lt({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,st,dt)}var mt=a.forwardRef(ut);n.p;function ht(){return(ht=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function pt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var bt=a.createElement("desc",null,"Created with Sketch."),ft=a.createElement("g",{id:"icon/stage/spring/empty",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-Copy-6",stroke:"#DDDDDD",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function jt(e,t){var n=e.title,r=e.titleId,i=pt(e,["title","titleId"]);return a.createElement("svg",ht({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,bt,ft)}var gt=a.forwardRef(jt);n.p;function Ot(){return(Ot=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function xt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var vt=a.createElement("desc",null,"Created with Sketch."),yt=a.createElement("g",{id:"icon/stage/zodiac/empty",stroke:"none",strokeWidth:2,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-Copy-6",stroke:"#5F668A",transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function wt(e,t){var n=e.title,r=e.titleId,i=xt(e,["title","titleId"]);return a.createElement("svg",Ot({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,vt,yt)}var Ct=a.forwardRef(wt);n.p;function kt(){return(kt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Et(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Nt=a.createElement("desc",null,"Created with Sketch."),St=a.createElement("g",{id:"icon/stage/zodiac/full",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:8}),a.createElement("circle",{id:"Oval-Copy-5",stroke:"#1B2559",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function It(e,t){var n=e.title,r=e.titleId,i=Et(e,["title","titleId"]);return a.createElement("svg",kt({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Nt,St)}var Lt=a.forwardRef(It),Ft=(n.p,{container:{"@media only screen and (max-width: 1920px)":{width:"30vw"},width:"40vw",height:"110vh",right:0,backgroundColor:K,boxShadow:"0 0 14px 0 rgba(0, 0, 0, 0.24)"},header:{display:"flex",justifyContent:"space-between"},headerText:{marginTop:20,marginLeft:24},actionButtons:{display:"flex",marginLeft:16,height:0},notificationIcon:function(e){var t=e.buttonCoords,n=e.xOffset;return{position:"absolute",top:t?t.y:0,left:t?t.x-n:0,cursor:"pointer",background:"transparent",boxShadow:"0px 0px 0px transparent",border:"0px solid transparent",textShadow:"0px 0px 0px transparent",outline:"none"}},clearAllButton:{marginTop:-16,marginLeft:8,backgroundColor:G},notificationsList:{height:"90vh",maxHeight:"100vh",marginTop:24,marginLeft:0,overflowY:"auto",overflowX:"hidden",backgroundColor:K,zIndex:10},notificationRow:{display:"flex",flexDirection:"row",justifyContent:"flex-start",position:"relative",marginBottom:4,paddingTop:12,"& > *:first-child":{marginRight:24},"& > *":{marginRight:10},"& > *:last-child":{marginRight:0}},notificationContent:{display:"flex",flexDirection:"column",justifyContent:"center",width:300},unread:{backgroundColor:V},notificationRowIcon:{alignSelf:"center","& > *":{marginLeft:24}},readIconWrapper:{flexGrow:1},unreadIcon:{marginTop:2,width:"12px",height:"12px",backgroundColor:ee,borderRadius:"50%",cursor:"pointer",zIndex:1},readIcon:{marginLeft:8,marginTop:5,width:"12px",height:"12px",border:[[1,"solid",$]],borderRadius:"50%",cursor:"pointer",zIndex:1},notificationTitle:{margin:0,color:$},notificationBody:{margin:0},notificationSubtitle:{margin:0,marginBottom:8,color:$},stripes:{position:"absolute",height:"100%",top:"0px",opacity:"60%"},hasUnread:{position:"absolute",top:0,left:16,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"}}),Pt=n(528),Dt=n.n(Pt);function Tt(){return(Tt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Rt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Bt=a.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"notification-center_v01a#2-(open)",transform:"translate(-1023.000000, -459.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},a.createElement("g",{id:"icon/sf-small/wrench",transform:"translate(24.000000, 460.000000)"},a.createElement("path",{d:"M15.7602493,3.10720971 L13.1962412,5.67121772 L10.3290323,5.67121772 L10.3290323,2.80400876 L12.8930403,0.24000075 C12.4378389,0.0872002725 11.9506373,0 11.4434358,0 C8.9282279,0 6.88822153,2.04000637 6.88822153,4.55681424 C6.88822153,5.08081588 6.98102182,5.58321745 7.14422233,6.05201891 L0.580201813,12.6168394 C-0.193400604,13.3904418 -0.193400604,14.6456458 0.580201813,15.4200482 C1.35460423,16.1936506 2.60980816,16.1936506 3.38341057,15.4200482 L9.94823109,8.85602767 C10.4170326,9.01922818 10.9186341,9.11202847 11.4434358,9.11202847 C13.9602436,9.11202847 16.00025,7.0720221 16.00025,4.55681424 C16.00025,4.04961265 15.9130497,3.56241113 15.7602493,3.10720971 Z",id:"Stroke-1"})))));function At(e,t){var n=e.title,r=e.titleId,i=Rt(e,["title","titleId"]);return a.createElement("svg",Tt({width:"32px",height:"32px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Bt)}var Mt=a.forwardRef(At);n.p;function Wt(){return(Wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function zt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var qt=a.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"notification-center_v01a#1-(marked-one-as-read)",transform:"translate(-1023.000000, -123.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},a.createElement("g",{id:"Group-4",transform:"translate(24.000000, 124.000000)"},a.createElement("g",{id:"Group-3"},a.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2"}),a.createElement("polyline",{id:"Path-3",points:"12 0 16 4 12 8"})),a.createElement("g",{id:"Group-2",transform:"translate(8.000000, 12.000000) scale(-1, 1) translate(-8.000000, -12.000000) translate(0.000000, 8.000000)"},a.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2-Copy"}),a.createElement("polyline",{id:"Path-3-Copy",points:"12 0 16 4 12 8"}))))));function $t(e,t){var n=e.title,r=e.titleId,i=zt(e,["title","titleId"]);return a.createElement("svg",Wt({width:"24px",height:"24px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,qt)}var Ht=a.forwardRef($t);n.p;function Vt(){return(Vt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ut(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Gt=a.createElement("desc",null,"Created with Sketch."),Xt=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/warning-icon/tomato"},a.createElement("rect",{id:"Rectangle",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),a.createElement("path",{d:"M11.2971429,14.4857143 L11.1085714,5.82857143 L13.3714286,5.82857143 L13.2,14.4857143 L11.2971429,14.4857143 Z M11.1942857,18 L11.1942857,15.9771429 L13.3028571,15.9771429 L13.3028571,18 L11.1942857,18 Z",id:"!",fill:"#FF584A",fillRule:"nonzero"})));function _t(e,t){var n=e.title,r=e.titleId,i=Ut(e,["title","titleId"]);return a.createElement("svg",Vt({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Gt,Xt)}var Zt,Kt,Qt,Yt=a.forwardRef(_t),Jt=(n.p,Object(f.a)(Ft)),en={transaction:{display:"Transactions",icon:Object(qe.jsx)(Ht,{height:16,width:16})},highValueTransaction:{display:"Transactions",icon:Object(qe.jsx)(Ht,{height:16,width:16})},fiatBalance:{display:"Maintenance",icon:Object(qe.jsx)(Mt,{height:16,width:16})},cryptoBalance:{display:"Maintenance",icon:Object(qe.jsx)(Mt,{height:16,width:16})},compliance:{display:"Compliance",icon:Object(qe.jsx)(Yt,{height:16,width:16})},error:{display:"Error",icon:Object(qe.jsx)(Yt,{height:16,width:16})}},tn=function(e){var t,n,a,r=e.id,i=e.type,o=(e.detail,e.message),l=e.deviceName,c=e.created,s=e.read,d=e.valid,u=e.toggleClear,m=Jt(),h=null!==(t=A.a([i,"display"])(en))&&void 0!==t?t:null,p=null!==(n=A.a([i,"icon"])(en))&&void 0!==n?n:Object(qe.jsx)(Mt,{height:16,width:16}),b=Dt()((new Date).getTime()-new Date(c).getTime(),{compact:!0,verbose:!0}),f=h&&l?"".concat(h," - ").concat(l):"".concat(!h&&l?l:h),j=(a={},Object(z.a)(a,m.readIcon,s),Object(z.a)(a,m.unreadIcon,!s),a);return Object(qe.jsxs)("div",{className:I()(m.notificationRow,!s&&d?m.unread:""),children:[Object(qe.jsx)("div",{className:m.notificationRowIcon,children:Object(qe.jsx)("div",{children:p})}),Object(qe.jsxs)("div",{className:m.notificationContent,children:[Object(qe.jsx)(rt,{className:m.notificationTitle,children:f}),Object(qe.jsx)(nt,{className:m.notificationBody,children:o}),Object(qe.jsx)(at,{className:m.notificationSubtitle,children:b})]}),Object(qe.jsx)("div",{className:m.readIconWrapper,children:Object(qe.jsx)("div",{onClick:function(){return u(r)},className:I()(j)})})]})},nn=Object(f.a)(Ft),an=x()(Zt||(Zt=Object(c.a)(["\n query getNotifications {\n notifications {\n id\n type\n detail\n message\n created\n read\n valid\n }\n hasUnreadNotifications\n machines {\n deviceId\n name\n }\n }\n"]))),rn=x()(Kt||(Kt=Object(c.a)(["\n mutation toggleClearNotification($id: ID!, $read: Boolean!) {\n toggleClearNotification(id: $id, read: $read) {\n id\n read\n }\n }\n"]))),on=x()(Qt||(Qt=Object(c.a)(["\n mutation clearAllNotifications {\n clearAllNotifications {\n id\n }\n }\n"]))),ln=function(e){var t,n,r=e.close,i=e.hasUnreadProp,o=e.buttonCoords,c=e.popperRef,s=e.refetchHasUnreadHeader,d=Object(u.c)(an,{pollInterval:6e4}),m=d.data,h=d.loading,p=Object(a.useState)(300),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(!1),O=Object(l.a)(g,2),x=O[0],v=O[1],y=nn({buttonCoords:o,xOffset:f}),w=F.a(T.a(R.a("name")),B.a(R.a("deviceId")))(null!==(t=A.a(["machines"])(m))&&void 0!==t?t:[]),C=null!==(n=A.a(["notifications"])(m))&&void 0!==n?n:[],k=Object(a.useState)(i),E=Object(l.a)(k,2),N=E[0],S=E[1],I=Object(u.b)(rn,{onError:function(){return console.error("Error while clearing notification")},refetchQueries:function(){return["getNotifications"]}}),L=Object(l.a)(I,1)[0],P=Object(u.b)(on,{onError:function(){return console.error("Error while clearing all notifications")},refetchQueries:function(){return["getNotifications"]}}),D=Object(l.a)(P,1)[0];Object(a.useEffect)((function(){j(c.current.getBoundingClientRect().x),m&&m.hasUnreadNotifications!==N&&(s(),S(!N))}),[c,m,N,s]);return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:y.container,children:[Object(qe.jsxs)("div",{className:y.header,children:[Object(qe.jsx)(Ze,{className:y.headerText,children:"Notifications"}),Object(qe.jsxs)("button",{onClick:r,className:y.notificationIcon,children:[Object(qe.jsx)(mt,{}),N&&Object(qe.jsx)("div",{className:y.hasUnread})]})]}),Object(qe.jsxs)("div",{className:y.actionButtons,children:[N&&Object(qe.jsx)(He,{color:"primary",Icon:Lt,InverseIcon:gt,className:y.clearAllButton,onClick:function(){return v(!x)},children:x?"Show all":"Show unread"}),N&&Object(qe.jsx)(He,{color:"primary",Icon:Ct,InverseIcon:gt,className:y.clearAllButton,onClick:D,children:"Mark all as read"})]}),Object(qe.jsx)("div",{className:y.notificationsList,children:!h&&(x&&N?M.a(W.a("read",!1))(C):C).map((function(e){return Object(qe.jsx)(tn,{id:e.id,type:e.type,detail:e.detail,message:e.message,deviceName:w[e.detail.deviceId],created:e.created,read:e.read,valid:e.valid,toggleClear:function(){return L({variables:{id:e.id,read:!e.read}})}},e.id)}))})]})})},cn=n(1029),sn=n(1030),dn=n(394),un=n(295),mn=n(11),hn=n(165),pn=n.n(hn),bn=n(553),fn=n(1027),jn=n(1131),gn=n(119),On=n(1028),xn=n(3),vn=Object(f.a)({title:{marginTop:24,marginBottom:24}}),yn=Object(a.memo)((function(e){var t=e.children,n=vn();return Object(qe.jsx)(Ue,{className:n.title,children:t})}));function wn(){return(wn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Cn(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kn=a.createElement("desc",null,"Created with Sketch."),En=a.createElement("g",{id:"icon/button/add/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M11.5384615,6 C11.5384615,9.05815385 9.05815385,11.5384615 6,11.5384615 C2.94184615,11.5384615 0.461538462,9.05815385 0.461538462,6 C0.461538462,2.94184615 2.94184615,0.461538462 6,0.461538462 C9.05815385,0.461538462 11.5384615,2.94184615 11.5384615,6 Z",id:"Stroke-1",stroke:"#1B2559"}),a.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#1B2559"}),a.createElement("line",{x1:3.69230769,y1:6,x2:8.30769231,y2:6,id:"Stroke-5",stroke:"#1B2559"}));function Nn(e,t){var n=e.title,r=e.titleId,i=Cn(e,["title","titleId"]);return a.createElement("svg",wn({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,kn,En)}var Sn=a.forwardRef(Nn),In=(n.p,{button:{extend:Me.p,border:"none",backgroundColor:G,cursor:"pointer",outline:0,display:"flex",justifyContent:"center",alignItems:"center",width:167,height:48,color:ce,"&:hover":{backgroundColor:X},"&:active":{backgroundColor:$,color:K,"& svg g *":{stroke:K}},"& svg":{marginRight:8}}}),Ln=Object(f.a)(In),Fn=Object(a.memo)((function(e){var t=e.className,n=e.children,a=Object(q.a)(e,["className","children"]),r=Ln();return Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(r.button,t)},a),{},{children:[Object(qe.jsx)(Sn,{}),n]}))})),Pn=Me.h1,Dn=Me.h3,Tn=function(e){switch(e){case"xl":return 61;case"sm":return 32;case"lg":default:return 40}},Rn={wrapper:function(e){var t=e.size,n=Tn(t);return{height:n+n/12/2}},button:function(e){var t=e.size,n=e.backgroundColor,a=Tn(t),r="xl"===t?3:a/12,i="grey"===n;return{extend:"xl"===t?Pn:Dn,border:"none",color:K,cursor:"pointer",fontWeight:900,outline:0,backgroundColor:i?de:ee,"&:disabled":{backgroundColor:oe,boxShadow:"none","&:hover":{backgroundColor:oe,boxShadow:"none"},"&:active":{marginTop:0}},shadowSize:r,height:a,padding:"0 ".concat("xl"===t?20:a/2,"px"),borderRadius:a/4,boxShadow:"0 ".concat(r,"px ").concat(i?se:te),"&:hover":{backgroundColor:i?se:te,boxShadow:"0 ".concat(r,"px ").concat(i?ue:ne)},"&:active":{marginTop:r/2,backgroundColor:i?de:te,boxShadow:"0 ".concat(r/2,"px ").concat(i?ue:ne)}}}},Bn=Object(f.a)(Rn),An=Object(a.memo)((function(e){var t=e.size,n=void 0===t?"lg":t,a=e.children,r=e.className,i=e.buttonClassName,o=e.backgroundColor,l=Object(q.a)(e,["size","children","className","buttonClassName","backgroundColor"]),c=Bn({size:n,backgroundColor:o});return Object(qe.jsx)("div",{className:I()(r,c.wrapper),children:Object(qe.jsx)("button",Object(s.a)(Object(s.a)({className:I()(i,c.button)},l),{},{children:a}))})})),Mn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Wn={baseButton:{extend:Mn(re,ie,se),cursor:"pointer",border:"none",outline:0,height:32,color:ce,"&:active":{color:K}},primary:{extend:Mn(re,ie,se),"&:active":{color:K,"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"block"}},"& $buttonIconActive":{display:"none"}},secondary:{extend:Mn(se,de,K),color:K,"&:active":{color:ce,"& $buttonIcon":{display:"flex"},"& $buttonIconActive":{display:"none"}},"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"flex"}}},zn=Wn.baseButton,qn=Wn.primary,$n={featureButton:{extend:zn,width:zn.height,borderRadius:zn.height/2,display:"flex",padding:0},primary:qn,buttonIcon:{margin:"auto","& svg":{width:16,height:16,overflow:"visible","& g":{strokeWidth:1.8}}},buttonIconActive:{}},Hn=Object(f.a)($n),Vn=Object(a.memo)((function(e){var t,n=e.className,a=e.Icon,r=e.InverseIcon,i=e.children,o=Object(q.a)(e,["className","Icon","InverseIcon","children"]),l=Hn(),c=(t={},Object(z.a)(t,l.featureButton,!0),Object(z.a)(t,l.primary,!0),t);return Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(c,n)},o),{},{children:[a&&Object(qe.jsx)("div",{className:l.buttonIcon,children:Object(qe.jsx)(a,{})}),r&&Object(qe.jsx)("div",{className:I()(l.buttonIcon,l.buttonIconActive),children:Object(qe.jsx)(r,{})}),i]}))})),Un=n(402),Gn=n(1011),Xn=function(e){var t,n=e.children,r=e.bgColor,i=void 0===r?K:r,o=e.arrowSize,c=void 0===o?6:o,d=e.className,u=Object(q.a)(e,["children","bgColor","arrowSize","className"]),m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],j={popover:{zIndex:3e3,backgroundColor:i,borderRadius:4},arrow:{position:"absolute",fontSize:c,width:"3em",height:"3em"},arrowBottom:{top:0,width:0,height:0,borderLeft:[["2em","solid","transparent"]],borderRight:[["2em","solid","transparent"]],borderBottom:[["2em","solid",i]],marginTop:"-1.9em","&:after":{zIndex:-10,content:'""',position:"absolute",width:3*c,height:3*c,marginLeft:0,bottom:0,top:"calc(50% - 0px)",left:0,border:"5px solid #fff",borderColor:"transparent transparent #fff #fff",transformOrigin:"0 0",transform:"rotate(45deg)",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)"}},arrowTop:{bottom:0,width:0,height:0,borderLeft:[["2em","solid","transparent"]],borderRight:[["2em","solid","transparent"]],borderTop:[["2em","solid",i]],marginBottom:"-1.9em","&:after":{zIndex:-10,content:'""',position:"absolute",width:3*c,height:3*c,marginLeft:0,bottom:0,top:-(4*c+2),left:0,border:"5px solid #fff",borderColor:"transparent transparent #fff #fff",transformOrigin:"0 0",transform:"rotate(45deg)",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)"}},arrowRight:{left:0,width:0,height:0,borderTop:[["2em","solid","transparent"]],borderBottom:[["2em","solid","transparent"]],borderRight:[["2em","solid",i]],marginLeft:"-1.9em"},arrowLeft:{right:0,width:0,height:0,borderTop:[["2em","solid","transparent"]],borderBottom:[["2em","solid","transparent"]],borderLeft:[["2em","solid",i]],marginRight:"-1.9em"},root:{backgroundColor:i}},g=Object(f.a)(j)(),O=(t={},Object(z.a)(t,g.arrow,!0),Object(z.a)(t,g.arrowBottom,"bottom"===u.placement),Object(z.a)(t,g.arrowTop,"top"===u.placement),Object(z.a)(t,g.arrowRight,"right"===u.placement),Object(z.a)(t,g.arrowLeft,"left"===u.placement),t),x=Gn.a(u.modifiers,{flip:{enabled:!1},preventOverflow:{enabled:!0,boundariesElement:"scrollParent"},offset:{enabled:!0,offset:"0, 10"},arrow:{enabled:!0,element:p},computeStyle:{gpuAcceleration:!1}});return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(N.a,Object(s.a)(Object(s.a)({disablePortal:!1,modifiers:x,className:g.popover},u),{},{children:Object(qe.jsxs)(Un.a,{className:I()(g.root,d),children:[Object(qe.jsx)("span",{className:I()(O),ref:b}),n]})}))})},_n=Me.info2,Zn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Kn={idButton:{width:34,height:28,display:"flex",borderRadius:4,padding:0,border:"none",cursor:"pointer"},buttonIcon:{margin:"auto",lineHeight:1,"& svg":{overflow:"visible"}},closed:{extend:Zn(re,ie,se)},open:{extend:Zn(se,se,se)},popoverContent:{extend:_n,padding:8,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:4,"& img":{maxHeight:145}}},Qn=Object(f.a)(Kn),Yn=Object(a.memo)((function(e){var t,n=e.name,r=e.className,i=e.Icon,o=e.InverseIcon,c=(e.popoverWidth,e.children),d=e.popoverClassname,u=Object(q.a)(e,["name","className","Icon","InverseIcon","popoverWidth","children","popoverClassname"]),m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Qn(),j=Boolean(p),g=j?"simple-popper-".concat(n):void 0,O=(t={},Object(z.a)(t,f.idButton,!0),Object(z.a)(t,f.primary,!0),Object(z.a)(t,f.open,j),Object(z.a)(t,f.closed,!j),t),x=Object(z.a)({},f.buttonIcon,!0),v=function(){b(null)};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(E.a,{onClickAway:v,children:Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({"aria-describedby":g,onClick:function(e){b(p?null:e.currentTarget)},className:I()(O,r)},u),{},{children:[i&&!j&&Object(qe.jsx)("div",{className:I()(x),children:Object(qe.jsx)(i,{})}),o&&j&&Object(qe.jsx)("div",{className:I()(x),children:Object(qe.jsx)(o,{})})]}))}),Object(qe.jsx)(Xn,{className:d,id:g,open:j,anchorEl:p,onClose:v,arrowSize:3,placement:"top",children:Object(qe.jsx)("div",{className:f.popoverContent,children:Object(qe.jsx)("div",{children:c})})})]})})),Jn={label:function(e){var t=e.size;return{width:t,height:t}},root:{"& svg":{flex:1},"&:hover":{backgroundColor:"inherit"},"&:hover rect":{stroke:$},"&:hover polygon":{stroke:$},"&:hover path":{stroke:$}}},ea=Object(f.a)(Jn),ta=function(e){var t=e.size,n=e.children,a=e.onClick,r=Object(q.a)(e,["size","children","onClick"]),i=ea({size:t});return Object(qe.jsx)(dn.a,Object(s.a)(Object(s.a)({},r),{},{size:"small",classes:{root:i.root,label:i.label},disableRipple:!0,onClick:a,children:n}))},na=n(248),aa=function(e){return{boxShadow:"inset 0 -4px 0 0 ".concat(Object(na.fade)(e,.8)),"&:hover":{boxShadow:"none",backgroundColor:Object(na.fade)(e,.8)}}},ra={link:{extend:Me.h4,textDecoration:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:"0",height:"100%"},primary:{extend:aa(fe)},secondary:{extend:aa("#ff584a"),"&:hover":{color:K}},noColor:{extend:aa(K)},action:{extend:aa(fe),color:G}},ia=Object(f.a)(ra),oa=Object(a.memo)((function(e){var t,n=e.submit,a=e.className,r=e.children,i=e.color,o=void 0===i?"primary":i,l=Object(q.a)(e,["submit","className","children","color"]),c=ia(),d=(t={},Object(z.a)(t,c.link,!0),Object(z.a)(t,c.primary,"primary"===o),Object(z.a)(t,c.secondary,"secondary"===o),Object(z.a)(t,c.noColor,"noColor"===o),Object(z.a)(t,c.action,"action"===o),t);return Object(qe.jsx)("button",Object(s.a)(Object(s.a)({type:n?"submit":"button",className:I()(d,a)},l),{},{children:r}))})),la=Wn.baseButton,ca=Wn.primary,sa={button:{extend:la,borderRadius:la.height/2,outline:0,padding:"0 20px"},primary:ca,buttonIcon:{marginTop:4,marginRight:4,"& svg":{width:20,height:20,overflow:"visible"}},buttonIconActive:{}};Object(f.a)(sa);function da(){return(da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ua(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ma=a.createElement("desc",null,"Created with Sketch."),ha=a.createElement("g",{id:"icon/button/cancel/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 1.000000)",stroke:"#FFFFFF"},a.createElement("line",{x1:10,y1:0,x2:0,y2:10,id:"Stroke-1"}),a.createElement("line",{x1:0,y1:0,x2:10,y2:10,id:"Stroke-3"})));function pa(e,t){var n=e.title,r=e.titleId,i=ua(e,["title","titleId"]);return a.createElement("svg",da({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,ma,ha)}var ba=a.forwardRef(pa),fa=(n.p,Wn.baseButton),ja={button:{extend:fa,padding:0,color:K,borderRadius:fa.height/2},normalButton:{width:fa.height},activeButton:{display:"flex",flexDirection:"row",alignItems:"center",backgroundColor:se,fontWeight:"bold",padding:"0 5px","&:hover":{backgroundColor:se}},buttonIcon:{width:16,height:16,overflow:"visible","& g":{strokeWidth:1.8}},buttonIconActiveLeft:{marginRight:12,marginLeft:4},buttonIconActiveRight:{marginRight:5,marginLeft:20},white:{color:K}},ga=Object(f.a)(ja),Oa=Object(a.memo)((function(e){var t,n=e.className,r=e.Icon,i=e.InverseIcon,o=e.toggle,c=e.forceDisable,s=void 0!==c&&c,d=e.children,u=Object(a.useState)(!1),m=Object(l.a)(u,2),h=m[0],p=m[1],b=!s&&h,f=ga(),j=(t={},Object(z.a)(t,f.button,!0),Object(z.a)(t,f.normalButton,!b),Object(z.a)(t,f.activeButton,b),t),g=Object(qe.jsx)(r,{className:f.buttonIcon}),O=Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(i,{className:I()(f.buttonIcon,f.buttonIconActiveLeft)}),Object(qe.jsx)(_e,{className:f.white,children:d}),Object(qe.jsx)(ba,{className:I()(f.buttonIcon,f.buttonIconActiveRight)})]});return Object(qe.jsx)("button",{className:I()(j,n),onClick:function(){s=!1;var e=!b;o(e),p(e)},children:b?O:g})}));function xa(){return(xa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function va(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ya=a.createElement("desc",null,"Created with Sketch."),wa=a.createElement("g",{id:"icon/action/external-link/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,points:"20 12.1113 20 21.0003 0 21.0003 0 1.0003 8.889 1.0003"}),a.createElement("polyline",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"14.4443 1 20.0003 1 20.0003 6.556"}),a.createElement("line",{x1:10,y1:11,x2:20,y2:1,id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2}));function Ca(e,t){var n=e.title,r=e.titleId,i=va(e,["title","titleId"]);return a.createElement("svg",xa({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,ya,wa)}var ka=a.forwardRef(Ca);n.p;function Ea(){return(Ea=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Na(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Sa=a.createElement("desc",null,"Created with Sketch."),Ia=a.createElement("g",{id:"icon/action/external-link/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",transform:"translate(0.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},a.createElement("polyline",{id:"Stroke-1",points:"20 11.1113 20 20.0003 0 20.0003 0 0.0003 8.889 0.0003"}),a.createElement("polyline",{id:"Stroke-3",points:"14.4443 0 20.0003 0 20.0003 5.556"}),a.createElement("line",{x1:10,y1:10,x2:20,y2:0,id:"Stroke-5"})));function La(e,t){var n=e.title,r=e.titleId,i=Na(e,["title","titleId"]);return a.createElement("svg",Ea({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Sa,Ia)}var Fa=a.forwardRef(La),Pa=(n.p,Object(f.a)({actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J}})),Da=function(e){var t=e.link,n=e.label,a=Pa();return Object(qe.jsx)("a",{className:a.actionButtonLink,target:"_blank",rel:"noopener noreferrer",href:t,children:Object(qe.jsx)(He,{className:a.actionButton,color:"primary",Icon:Fa,InverseIcon:ka,children:n})})},Ta=n(247),Ra=n(1118),Ba=n(543),Aa=n(1129),Ma=n(1019),Wa=n(1128),za=n(546),qa=n(1020),$a=n(1139),Ha=function(e){switch(e){case"sm":return{fontSize:Ee};case"lg":return{fontSize:Se,fontWeight:700};default:return{fontSize:Ne}}},Va={fontWeight:700},Ua={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Ha(t))},bold:Va,root:function(e){return{width:e.width,"& input":{textAlign:e.textAlign}}},underline:{"&:before":{borderBottomColor:ee},"&:hover:not(.Mui-disabled)::before":{borderBottomColor:ee}}},Ga=Object(f.a)(Ua),Xa=Object(a.memo)((function(e){var t=e.name,n=e.isPasswordFilled,a=e.onChange,r=e.onBlur,i=e.value,o=e.error,l=(e.suffix,e.textAlign),c=e.width,d=e.size,u=e.bold,m=e.className,h=e.InputProps,p=Object(q.a)(e,["name","isPasswordFilled","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","InputProps"]),b=Ga({textAlign:l,width:c,size:d}),f=!o&&!D.a(i)&&!Wa.a(i),j=n||f,g=Object(z.a)({},b.bold,u);return Object(qe.jsx)($a.a,Object(s.a)({id:t,onChange:a,onBlur:r,error:o,value:i,classes:{root:b.root},className:m,InputProps:Object(s.a)({className:I()(g),classes:{root:b.size,underline:j?b.underline:null}},h)},p))})),_a=function(e){e.optionsLimit;var t=e.limit,n=e.options,a=e.label,r=e.valueProp,i=e.multiple,o=e.onChange,l=e.labelProp,c=(e.shouldStayOpen,e.value),d=e.error,u=e.fullWidth,m=e.textAlign,h=e.size,p=e.autoFocus,b=Object(q.a)(e,["optionsLimit","limit","options","label","valueProp","multiple","onChange","labelProp","shouldStayOpen","value","error","fullWidth","textAlign","size","autoFocus"]),f=function(e){return function(t){return Aa.a(W.a(r,t))(e)}},j=R.a(r),g=r?(i?T.a(f(n)):f(n))(c):c,O=function(){return D.a(g)?[]:i?g:[g]};return Object(qe.jsx)(Ra.a,Object(s.a)(Object(s.a)({options:n,multiple:i,value:g,onChange:function(e,t){if(!r)return o(e,t);var n=i?T.a(j)(t):j(t);o(e,n)},getOptionLabel:A.a([l]),forcePopupIcon:!1,filterOptions:function(e,n){var a=n.inputValue;return Ma.a(Wa.a(a)?O():[],function(e,t){return t?Object(Ba.a)(e,t,{keys:[r,l]}):e}(e,a)).slice(0,za.a(void 0)(t)&&Math.max(t,Wa.a(a)?O().length:0))},openOnFocus:!0,autoHighlight:!0,disableClearable:!0,ChipProps:{onDelete:null},clearOnEscape:!0,getOptionSelected:qa.a(r)},b),{},{renderInput:function(e){return Object(qe.jsx)(Xa,Object(s.a)(Object(s.a)({},e),{},{autoFocus:p,label:a,value:c,error:d,size:h,fullWidth:u,textAlign:m}))}}))},Za=n(1119),Ka=n(549),Qa=n.n(Ka),Ya=n(548),Ja=n.n(Ya);function er(){return(er=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function tr(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nr=a.createElement("desc",null,"Created with Sketch."),ar=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/warning-icon/comet"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),a.createElement("path",{d:"M11.2971429,14.4857143 L11.1085714,5.82857143 L13.3714286,5.82857143 L13.2,14.4857143 L11.2971429,14.4857143 Z M11.1942857,18 L11.1942857,15.9771429 L13.3028571,15.9771429 L13.3028571,18 L11.1942857,18 Z",id:"!",fill:"#5F668A",fillRule:"nonzero"})));function rr(e,t){var n=e.title,r=e.titleId,i=tr(e,["title","titleId"]);return a.createElement("svg",er({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,nr,ar)}var ir=a.forwardRef(rr),or=(n.p,Object(f.a)({root:{color:ee,"&$checked":{color:ee}},checked:{},checkBoxLabel:{display:"flex"},wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:se,margin:0,whiteSpace:"break-spaces"}})),lr=function(e){var t=e.name,n=e.onChange,a=e.value,r=e.settings,i=Object(q.a)(e,["name","onChange","value","settings"]),o=r.enabled,l=r.label,c=r.disabledMessage,d=r.rightSideLabel,u=or();return Object(qe.jsx)(qe.Fragment,{children:o?Object(qe.jsxs)("div",{className:u.checkBoxLabel,children:[!d&&Object(qe.jsx)(rt,{children:l}),Object(qe.jsx)(Za.a,Object(s.a)({id:t,classes:{root:u.root,checked:u.checked},onChange:n,value:a,checked:a,icon:Object(qe.jsx)(Ja.a,{style:{marginLeft:2,fontSize:ye}}),checkedIcon:Object(qe.jsx)(Qa.a,{style:{fontSize:ve}}),disableRipple:!0},i)),d&&Object(qe.jsx)(rt,{children:l})]}):Object(qe.jsxs)("div",{className:u.wrapper,children:[Object(qe.jsx)(ir,{}),Object(qe.jsx)(Je,{className:u.message,children:c})]})})},cr=n(550),sr=n.n(cr),dr={input:{width:"3.5rem !important",height:"5rem",border:"2px solid",borderColor:G,borderRadius:"4px"},focus:{border:"2px solid",borderColor:J,borderRadius:"4px","&:focus":{outline:"none"}},error:{borderColor:he},container:{justifyContent:"space-evenly"}},ur=Object(f.a)(dr),mr=Object(f.a)(Me),hr=function(e){var t=e.name,n=e.value,a=e.onChange,r=e.numInputs,i=e.error,o=e.inputStyle,l=e.containerStyle,c=Object(q.a)(e,["name","value","onChange","numInputs","error","inputStyle","containerStyle"]),d=ur(),u=mr();return Object(qe.jsx)(sr.a,Object(s.a)({id:t,value:n,onChange:a,numInputs:r,separator:Object(qe.jsx)("span",{children:" "}),containerStyle:I()(l,d.container),inputStyle:I()(o,d.input,u.confirmationCode),focusStyle:d.focus,errorStyle:d.error,hasErrored:i,isInputNum:!0},c))},pr=n(1017),br=n(1141),fr=n(1021),jr=n(1114),gr=function(e){var t=e.label,n=e.name,a=e.options,r=e.onChange,i=e.value,o=e.className;return Object(qe.jsxs)(pr.a,{className:I()(o),children:[Object(qe.jsx)(br.a,{children:t}),Object(qe.jsx)(jr.a,{autoWidth:!0,labelId:t,id:n,value:i,onChange:r,children:a.map((function(e,t){return Object(qe.jsx)(fr.a,{value:e.value,children:e.display},t)}))})]})},Or=n(551),xr=Object(a.memo)((function(e){var t=e.name,n=e.onChange,a=e.onBlur,r=e.value,i=e.error,o=e.suffix,l=e.textAlign,c=e.width,d=e.size,u=e.bold,m=e.className,h=e.decimalPlaces,p=(e.InputProps,Object(q.a)(e,["name","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","decimalPlaces","InputProps"]));return Object(qe.jsx)(Or.a,Object(s.a)({name:t,onChange:n,onBlur:a,value:r,error:i,suffix:o,textAlign:l,width:c,size:d,bold:u,className:m,customInput:Xa,decimalScale:h,onValueChange:function(e){n({target:{id:t,value:e.floatValue}})}},p))})),vr=n(1143),yr=n(1022),wr=n(1117),Cr={label:{height:16,lineHeight:"16px",margin:[[0,0,4,0]],paddingLeft:3},subtitle:{marginTop:-8,marginLeft:32,color:se}},kr=Object(f.a)(Cr),Er=function(e){var t=e.name,n=e.label,a=e.value,i=e.options,o=e.onChange,l=e.className,c=e.labelClassName,s=e.radioClassName,d=kr();return Object(qe.jsxs)(qe.Fragment,{children:[n&&Object(qe.jsx)(at,{className:d.label,children:n}),Object(qe.jsx)(vr.a,{name:t,value:a,onChange:o,className:I()(l),children:i.map((function(e,t){return Object(qe.jsx)(r.a.Fragment,{children:Object(qe.jsxs)("div",{children:[Object(qe.jsx)(yr.a,{disabled:e.disabled,value:e.code,control:Object(qe.jsx)(wr.a,{className:s}),label:e.display,className:I()(c)}),e.subtitle&&Object(qe.jsx)(at,{className:d.subtitle,children:e.subtitle})]})},t)}))})]})},Nr=Object(a.memo)((function(e){var t=e.value,n=e.onFocus,r=e.isPasswordFilled,i=e.onBlur,o=Object(q.a)(e,["value","onFocus","isPasswordFilled","onBlur"]),c=Object(a.useState)(!1),d=Object(l.a)(c,2),u=d[0],m=d[1];return Object(qe.jsx)(Xa,Object(s.a)(Object(s.a)({},o),{},{type:"password",onFocus:function(e){m(!0),n&&n(e)},onBlur:function(e){m(!1),i&&i(e)},isPasswordFilled:r,value:t,InputProps:{value:t},InputLabelProps:{shrink:r||t||u},placeholder:r?"\u26ac \u26ac \u26ac This field is set \u26ac \u26ac \u26ac":""}))})),Sr=n(1023),Ir=Object(f.a)((function(e){return{root:{width:32,height:20,padding:0,margin:e.spacing(1)},switchBase:{padding:2,"&$disabled":{color:le,"& + $track":{backgroundColor:oe,opacity:1}},"&$checked":{transform:"translateX(58%)",color:e.palette.common.white,"&$disabled":{color:le},"& + $track":{backgroundColor:ee,opacity:1,border:"none"}},"&$focusVisible $thumb":{border:"6px solid #fff",boxShadow:"0 0 4px 0 rgba(0,0,0,0.24)"}},thumb:{width:16,height:16},track:{borderRadius:17,border:"none",backgroundColor:se,opacity:1,transition:e.transitions.create(["background-color","border"])},disabled:{},checked:{},focusVisible:{}}})),Lr=Object(a.memo)((function(e){var t=Object.assign({},e),n=Ir();return Object(qe.jsx)(Sr.a,Object(s.a)({focusVisibleClassName:n.focusVisible,disableRipple:!0,classes:{root:n.root,switchBase:n.switchBase,thumb:n.thumb,track:n.track,checked:n.checked,disabled:n.disabled}},t))})),Fr=n(1157),Pr=n(1024),Dr={noTextTransform:{textTransform:"none"},flex:{display:"flex",alignItems:"center",justifyContent:"start",width:"90%",overflow:"hidden",maxHeight:80},buttonTextContent:{marginLeft:32,textTransform:"none",textAlign:"left"},button:{backgroundColor:ae,marginBottom:16},paragraph:{color:$,marginTop:-10}},Tr=Object(f.a)(Dr),Rr=function(e){var t=e.name,n=e.orientation,a=void 0===n?"vertical":n,r=e.value,i=e.exclusive,o=void 0===i||i,l=e.onChange,c=e.size,s=void 0===c?"small":c,d=Object(q.a)(e,["name","orientation","value","exclusive","onChange","size"]),u=Tr();return Object(qe.jsx)(Fr.a,{size:s,name:t,orientation:a,value:r,exclusive:o,onChange:l,children:d.options.map((function(e){return Object(qe.jsx)(Pr.a,{className:u.button,value:e.value,"aria-label":e.value,children:Object(qe.jsxs)("div",{className:u.flex,children:[Object(qe.jsx)(e.icon,{}),Object(qe.jsxs)("div",{className:u.buttonTextContent,children:[Object(qe.jsx)(_e,{children:e.title}),Object(qe.jsxs)(Ke,{className:u.paragraph,children:[" ",e.description]})]})]})},e.value)}))})},Br=function(e){var t=e.options,n=e.onChange,r=Object(q.a)(e,["options","onChange"]),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],d=o[1],u=r.field,m=u.name,h=u.onBlur,p=u.value,b=r.form,f=b.touched,j=b.errors,g=b.setFieldValue,O=b.setFieldTouched,x=!(!f[m]||!j[m]),v=Object(mn.f)(),y=v.initialValues,w=v.values,C="Function"===Ta.a(t)?t(y,w):t,k=function(e){return g(m,e)},E=!!r.shouldStayOpen;return Object(qe.jsx)(_a,Object(s.a)({name:m,onChange:function(e,t){if(n)return n(p,t,k);g(m,t)},onBlur:function(e){m&&O(m,!0),h&&h(e)},value:p,error:x,open:c,options:C,onOpen:function(){if(!r.multiple)return d(!0);d((null===p||void 0===p?void 0:p.length)!==r.limit)},onClose:function(e,t){d(!(!E||"blur"===t))}},r))},Ar=n(1142),Mr=n(24),Wr=Object(a.memo)((function(e){var t=e.classes,n=Object(q.a)(e,["classes"]);return Object(qe.jsx)(Ar.a,Object(s.a)({size:"small",classes:t},n))})),zr=Object(Mr.a)((function(e){return{root:{backgroundColor:re,borderRadius:4,margin:e.spacing(.5,.25),height:18},label:{fontSize:ke,color:ce,fontWeight:Ie,fontFamily:Le,paddingRight:4,paddingLeft:4}}}))(Wr),qr=n(1130),$r=n(1025),Hr=n(1026),Vr=qr.a($r.a(Number),Hr.a(gn.a(NaN))),Ur=function(e){return Vr(e)?e:null},Gr=function(e){return e.toLocaleString("en-US",{maximumFractionDigits:2})},Xr={cashOut:{empty:Q,full:J},cashIn:{empty:J,full:Q}},_r=function(e){var t=e.cashOut,n=e.applyColorVariant,a=e.isLow;return Xr[t?"cashOut":"cashIn"][n||!a?"full":"empty"]},Zr={cashbox:{borderColor:_r,backgroundColor:_r,height:118,width:function(e){var t=e.width;return null!==t&&void 0!==t?t:80},border:"2px solid",textAlign:"end",display:"inline-block"},fiatBalanceAlertCashbox:{borderColor:_r,backgroundColor:_r,height:118,width:80,border:"4px solid"},emptyPart:{backgroundColor:"white",height:function(e){var t=e.percent;return"".concat(100-t,"%")},position:"relative","& > p":{color:_r,display:"inline-block",position:"absolute",margin:0,bottom:0,right:0}},fullPart:{backgroundColor:_r,"& > p":{color:"white",display:"inline"}}},Kr={row:{display:"flex"},innerRow:{display:"flex",justifyContent:"flex-start"},col2:{marginLeft:14},noMarginText:{marginTop:0,marginBottom:0},link:{marginTop:8},chip:{margin:[[0,0,0,7]]}},Qr=Object(f.a)(Zr),Yr=Object(f.a)(Kr),Jr=function(e){var t,n=e.percent,a=void 0===n?0:n,r=e.cashOut,i=void 0!==r&&r,o=e.width,l=e.className,c=e.emptyPartClassName,s=e.labelClassName,d=e.applyColorVariant,u=e.applyFiatBalanceAlertsStyling,m=e.omitInnerPercentage,h=e.isLow,p=Qr({percent:a,cashOut:i,width:o,applyColorVariant:d,isLow:h}),b=a<=51,f=(t={},Object(z.a)(t,p.fiatBalanceAlertCashbox,u),Object(z.a)(t,p.cashbox,!u),t);return Object(qe.jsxs)("div",{className:I()(l,f),children:[Object(qe.jsx)("div",{className:I()(c,p.emptyPart),children:!m&&b&&Object(qe.jsxs)(rt,{className:s,children:[a.toFixed(0),"%"]})}),Object(qe.jsx)("div",{className:p.fullPart,children:!m&&!b&&Object(qe.jsxs)(rt,{className:s,children:[a.toFixed(0),"%"]})})]})},ei=function(e){var t=e.currency,n=e.notes,a=e.total,r=Yr();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)("div",{className:r.row,children:Object(qe.jsxs)("div",{children:[Object(qe.jsx)("div",{className:r.innerRow,children:Object(qe.jsxs)(Ye,{className:r.noMarginText,children:[n," notes"]})}),Object(qe.jsx)("div",{className:r.innerRow,children:Object(qe.jsxs)(at,{className:r.noMarginText,children:[a," ",t.code]})})]})})})},ti=function(e){var t=e.capacity,n=void 0===t?500:t,a=e.denomination,r=void 0===a?0:a,i=e.currency,o=e.notes,l=e.className,c=e.editingMode,s=void 0!==c&&c,d=e.threshold,u=e.width,m=100*o/n,h=m<d,p=Yr();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:p.row,children:[Object(qe.jsx)("div",{className:p.col,children:Object(qe.jsx)(Jr,{className:l,percent:m,cashOut:!0,isLow:h,width:u})}),!s&&Object(qe.jsxs)("div",{className:p.col2,children:[Object(qe.jsxs)("div",{className:p.innerRow,children:[Object(qe.jsx)(Ye,{className:p.noMarginText,children:o}),Object(qe.jsx)(zr,{className:p.chip,label:"".concat(r," ").concat(i.code)})]}),Object(qe.jsx)("div",{className:p.innerRow,children:Object(qe.jsxs)(at,{className:p.noMarginText,children:[Gr(o*r)," ",i.code]})})]})]})})},ni=Object(f.a)({flex:{display:"flex"},cashCassette:{height:36,marginRight:14}}),ai=Object(a.memo)((function(e){var t=e.decimalPlaces,n=e.width,r=e.threshold,i=e.inputClassName,o=Object(q.a)(e,["decimalPlaces","width","threshold","inputClassName"]),c=ni(),d=o.field,u=d.name,m=d.onChange,h=d.onBlur,p=d.value,b=o.form,f=b.touched,j=b.errors,g=Object(a.useState)(p),O=Object(l.a)(g,2),x=O[0],v=O[1],y=!(!f[u]||!j[u]);return Object(qe.jsxs)("div",{className:c.flex,children:[Object(qe.jsx)(ti,{className:I()(c.cashCassette,i),notes:x,editingMode:!0,width:n,threshold:r}),Object(qe.jsx)(xr,Object(s.a)({name:u,onChange:function(e){return v(e.target.value),m(e)},onBlur:h,value:p,error:y,decimalPlaces:t},o))]})})),ri=Object(a.memo)((function(e){var t=e.label,n=(e.textAlign,e.fullWidth,e.enabled),a=void 0===n||n,r=e.disabledMessage,i=void 0===r?"":r,o=Object(q.a)(e,["label","textAlign","fullWidth","enabled","disabledMessage"]),l=o.field,c=l.name,d=l.onChange,u=l.value,m={enabled:a,label:t,disabledMessage:i};return Object(qe.jsx)(lr,Object(s.a)({name:c,onChange:d,value:u,settings:m},o))})),ii=Object(a.memo)((function(e){var t=e.label,n=Object(q.a)(e,["label"]),a=n.field,r=a.name,i=a.value,o=n.form.setFieldValue;return Object(qe.jsx)(gr,Object(s.a)({name:r,label:t,value:i,options:n.options,ariaLabel:r,onChange:function(e){o(r,e.target.value),n.resetError&&n.resetError()},className:n.className},n))})),oi=Object(a.memo)((function(e){var t=e.decimalPlaces,n=Object(q.a)(e,["decimalPlaces"]),a=n.field,r=a.name,i=a.onChange,o=a.onBlur,l=a.value,c=n.form,d=c.touched,u=c.errors,m=!(!d[r]||!u[r]);return Object(qe.jsx)(xr,Object(s.a)({name:r,onChange:i,onBlur:o,value:l,error:m,decimalPlaces:t},n))})),li=Object(a.memo)((function(e){var t=e.label,n=Object(q.a)(e,["label"]),a=n.field,r=a.name,i=a.onChange,o=a.value;return Object(qe.jsx)(Er,Object(s.a)({name:r,label:t,value:o,options:n.options,ariaLabel:r,onChange:function(e){i(e),n.resetError&&n.resetError()},className:n.className},n))})),ci=Object(a.memo)((function(e){var t=e.isPasswordFilled,n=Object(q.a)(e,["isPasswordFilled"]),a=n.field,r=a.name,i=a.onChange,o=a.onBlur,l=a.value,c=n.form,d=c.touched,u=c.errors,m=!t&&!(!d[r]||!u[r]);return Object(qe.jsx)(Nr,Object(s.a)({name:r,isPasswordFilled:t,onChange:i,onBlur:o,value:l,error:m},n))})),si=Object(a.memo)((function(e){var t=Object.assign({},e),n=t.field,a=n.name,r=n.onChange,i=n.onBlur,o=n.value,l=t.form,c=l.touched,d=l.errors,u=!(!c[a]||!d[a]);return Object(qe.jsx)(Xa,Object(s.a)({name:a,onChange:r,onBlur:i,value:o,error:u},t))}));function di(){return(di=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ui(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var mi=a.createElement("desc",null,"Created with Sketch."),hi=a.createElement("g",{id:"icon/stage/zodiac/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}),a.createElement("path",{d:"M7.80983711,12 C7.54819546,12 7.28655382,11.9032616 7.08725647,11.710772 L5.29971255,9.98428824 C4.90009582,9.59832189 4.90009582,8.97445811 5.29971255,8.58849175 C5.69932929,8.2025254 6.34525711,8.2025254 6.74487384,8.58849175 L7.80983711,9.61707728 L11.2551262,6.28947477 C11.6547429,5.90350841 12.3016927,5.90350841 12.7002874,6.28947477 C13.0999042,6.674454 13.0999042,7.2993049 12.7002874,7.68527125 L8.53241776,11.710772 C8.33312041,11.9032616 8.07147876,12 7.80983711,12",id:"Path",fill:"#1B2559"}));function pi(e,t){var n=e.title,r=e.titleId,i=ui(e,["title","titleId"]);return a.createElement("svg",di({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,mi,hi)}var bi=a.forwardRef(pi);n.p;function fi(){return(fi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ji(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gi=a.createElement("desc",null,"Created with Sketch."),Oi=a.createElement("g",{id:"icon/stage/zodiac/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:4}),a.createElement("circle",{id:"Oval-Copy-5",stroke:"#1B2559",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function xi(e,t){var n=e.title,r=e.titleId,i=ji(e,["title","titleId"]);return a.createElement("svg",fi({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,gi,Oi)}var vi,yi=a.forwardRef(xi),wi=(n.p,Me.tl2),Ci=Me.p,ki=G,Ei={sidebar:Object(z.a)({display:"flex",backgroundColor:ki,width:520,marginLeft:-300,boxShadow:"-500px 0px 0px 0px ".concat(ki),borderRadius:"0 20px 0 0",alignItems:"flex-end",padding:24,flexDirection:"column"},(vi=1440,"@media only screen and (max-width: ".concat(vi,")")),{width:"auto",marginLeft:0,minWidth:250,boxShadow:"-200px 0px 0px 0px ".concat(ki)}),linkWrapper:{cursor:"pointer"},link:{extend:Ci,position:"relative",color:me,margin:"12px 24px 12px 0",cursor:"pointer","&:hover::after":{height:"140%"},"&:after":{content:'""',display:"block",background:J,width:4,height:0,left:"100%",marginLeft:20,bottom:-2,position:"absolute",borderRadius:1e3,transition:"all 0.2s cubic-bezier(0.95, 0.1, 0.45, 0.94)"}},activeLink:{extend:wi,color:J,"&::after":{height:"140%"}},customRenderLink:{"&:hover::after":{height:"100%"},"&:after":{bottom:0}},customRenderActiveLink:{"&::after":{height:"100%"}},item:{position:"relative",margin:"12px 0 12px 0",display:"flex"},itemText:{extend:Ci,color:me,marginRight:24},itemTextActive:{extend:wi,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",me]],right:8,top:18},stepperPast:{border:[[1,"solid",J]]}},Ni=Object(f.a)(Ei),Si=function(e){var t=e.data,n=e.displayName,a=e.isSelected,r=e.onClick,i=e.children,o=e.itemRender,l=e.loading,c=void 0!==l&&l,s=Ni();return Object(qe.jsxs)("div",{className:s.sidebar,children:[c&&Object(qe.jsx)(Ke,{children:"Loading..."}),!c&&(null===t||void 0===t?void 0:t.map((function(e,t){var i;return Object(qe.jsx)("div",{className:s.linkWrapper,onClick:function(){return r(e)},children:Object(qe.jsx)("div",{className:I()((i={},Object(z.a)(i,s.activeLink,a(e)),Object(z.a)(i,s.customRenderActiveLink,o&&a(e)),Object(z.a)(i,s.customRenderLink,o),Object(z.a)(i,s.link,!0),i)),children:o?o(e,a(e)):n(e)},t)})}))),!c&&i]})},Ii=function(e){var t,n,a=e.step,r=e.it,i=e.idx,o=e.steps,l=Ni(),c=a===i,s=i<a,d=i>a;return Object(qe.jsxs)("div",{className:l.item,children:[Object(qe.jsx)("span",{className:I()((t={},Object(z.a)(t,l.itemText,!0),Object(z.a)(t,l.itemTextActive,c),Object(z.a)(t,l.itemTextPast,s),t)),children:r.label}),c&&Object(qe.jsx)(yi,{}),s&&Object(qe.jsx)(bi,{}),d&&Object(qe.jsx)(Ct,{}),i<o.length-1&&Object(qe.jsx)("div",{className:I()((n={},Object(z.a)(n,l.stepperPath,!0),Object(z.a)(n,l.stepperPast,s),n))})]})};function Li(){return(Li=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Fi(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Pi=a.createElement("g",{id:"icon/ID/photo/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M12,14 C9.7912,14 8,12.2088 8,10 C8,7.7912 9.7912,6 12,6 C14.2088,6 16,7.7912 16,10 C16,12.2088 14.2088,14 12,14 Z M16.7142857,3.4 L14.3571429,1 L9.64285714,1 L7.28571429,3.4 L1,3.4 L1,17 L23,17 L23,3.4 L16.7142857,3.4 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:1.6}));function Di(e,t){var n=e.title,r=e.titleId,i=Fi(e,["title","titleId"]);return a.createElement("svg",Li({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/zodiac"):n?a.createElement("title",{id:r},n):null,Pi)}var Ti=a.forwardRef(Di);n.p;function Ri(){return(Ri=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Bi(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ai=a.createElement("style",{type:"text/css"},"\n\t.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#1B2559;}\n"),Mi=a.createElement("desc",null,"Created with Sketch."),Wi=a.createElement("g",{id:"color_x2F_primary_x2F_zodiac",transform:"translate(-0.000000, 0.000000)"},a.createElement("g",{id:"Mask"},a.createElement("path",{id:"path-1_1_",className:"st0",d:"M11.1,9l6.5,6.5c0.6,0.6,0.6,1.5,0,2.1c-0.3,0.3-0.7,0.4-1.1,0.4c-0.4,0-0.8-0.2-1.1-0.4 L9,11.1l-6.5,6.5C2.3,17.8,1.9,18,1.5,18c-0.4,0-0.8-0.2-1.1-0.4c-0.6-0.6-0.6-1.5,0-2.1L6.9,9L0.4,2.5C-0.1,2-0.1,1,0.4,0.4 C1-0.1,2-0.1,2.5,0.4L9,6.9l6.5-6.5c0.6-0.6,1.5-0.6,2.1,0c0.6,0.6,0.6,1.5,0,2.1L11.1,9z"})));function zi(e,t){var n=e.title,r=e.titleId,i=Bi(e,["title","titleId"]);return a.createElement("svg",Ri({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 18 18",style:{enableBackground:"new 0 0 18 18"},xmlSpace:"preserve",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Ai,Mi,Wi)}var qi=a.forwardRef(zi);n.p;function $i(){return($i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Hi(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Vi=a.createElement("desc",null,"Created with Sketch."),Ui=a.createElement("g",{id:"icon/stage/spring/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval",stroke:"#48F694",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}),a.createElement("path",{d:"M7.80983711,12 C7.54819546,12 7.28655382,11.9032616 7.08725647,11.710772 L5.29971255,9.98428824 C4.90009582,9.59832189 4.90009582,8.97445811 5.29971255,8.58849175 C5.69932929,8.2025254 6.34525711,8.2025254 6.74487384,8.58849175 L7.80983711,9.61707728 L11.2551262,6.28947477 C11.6547429,5.90350841 12.3016927,5.90350841 12.7002874,6.28947477 C13.0999042,6.674454 13.0999042,7.2993049 12.7002874,7.68527125 L8.53241776,11.710772 C8.33312041,11.9032616 8.07147876,12 7.80983711,12",id:"Path",fill:"#48F694"}));function Gi(e,t){var n=e.title,r=e.titleId,i=Hi(e,["title","titleId"]);return a.createElement("svg",$i({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Vi,Ui)}var Xi,_i,Zi=a.forwardRef(Gi),Ki=(n.p,"100%"),Qi="column",Yi={dialog:{backgroundColor:ae,width:Ki,minHeight:Ki,display:"flex",flexDirection:Qi,padding:0},wrapper:{width:be,height:Ki,margin:"0 auto",flex:1,display:"flex",flexDirection:Qi},contentDiv:{display:"flex",flex:1,flexDirection:"row"},headerDiv:{display:"flex",justifyContent:"space-between",alignItems:"center"},contentWrapper:{marginLeft:48},button:{marginTop:64},nameTitle:{marginTop:16,marginBottom:25},qrTitle:{marginTop:12,marginBottom:40},qrCodeWrapper:{display:"flex"},qrTextInfoWrapper:{display:"flex",flexDirection:"row"},qrTextWrapper:{width:381,marginLeft:80,display:"flex",flexDirection:"column"},textWrapper:{display:"flex",flexDirection:"column"},qrTextIcon:{marginRight:16},qrText:{marginTop:0},item:{position:"relative",margin:"12px 0 12px 0",display:"flex"},itemText:{extend:Me.p,color:me,marginRight:24},itemTextActive:{extend:Me.tl2,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",me]],right:8,top:18},stepperPast:{border:[[1,"solid",J]]},successMessageWrapper:{backgroundColor:V,display:"flex",flexDirection:"row",padding:"0px 10px",borderRadius:"8px"},successMessage:{color:H,margin:"8px 0px"},successMessageIcon:{marginRight:16,marginBottom:2,display:"flex",flexDirection:"col",alignItems:"center"},errorMessage:{color:he},qrCodeImageWrapper:{display:"flex",flexDirection:"column",backgroundColor:"white",border:"5px solid ".concat(J),padding:5,borderRadius:15},qrCodeScanMessage:{display:"flex",flexDirection:"row",alignItems:"center",margin:[[0,0,20,20]],"& > p":{marginLeft:10}}},Ji=x()(Xi||(Xi=Object(c.a)(["\n mutation createPairingTotem($name: String!) {\n createPairingTotem(name: $name)\n }\n"]))),eo=x()(_i||(_i=Object(c.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),to=Object(f.a)(Yi),no=F.a(bn.a,fn.a([],["machines"])),ao={name:""},ro=xn.f().shape({name:xn.h().required("Machine name is required.").max(50).test("unique-name","Machine name is already in use.",(function(e,t){return!jn.a((function(t){return gn.a(On.a(t),On.a(e))}),t.options.context.machineNames)}))}),io=[{label:"Machine name",component:function(e){var t=e.nextStep,n=e.classes,a=e.setQrCode,r=e.setName,i=Object(u.b)(Ji,{onCompleted:function(e){var n=e.createPairingTotem;a(n),t()},onError:function(e){return console.log(e)}}),o=Object(l.a)(i,1)[0],c=Object(u.c)(eo).data,s=T.a(R.a("name"),(null===c||void 0===c?void 0:c.machines)||{});return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{className:n.nameTitle,children:"Machine Name (ex: Coffee shop 01)"}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:ao,validate:function(e){try{ro.validateSync(e,{context:{machineNames:s}})}catch(t){return t}},onSubmit:function(e){var t=e.name;r(t),o({variables:{name:t}})},children:function(e){var t=e.errors;return Object(qe.jsxs)(mn.d,{className:n.form,children:[Object(qe.jsx)("div",{children:Object(qe.jsx)(mn.a,{name:"name",label:"Enter machine name",component:si})}),t&&Object(qe.jsx)(Ke,{className:n.errorMessage,children:t.message}),Object(qe.jsx)("div",{className:n.button,children:Object(qe.jsx)(An,{type:"submit",children:"Submit"})})]})}})]})}},{label:"Scan QR code",component:function(e){var t,n=e.classes,r=e.qrCode,i=e.name,o=e.count,l=e.onPaired,c=Object(a.useRef)(null),s=Object(u.c)(eo,{pollInterval:1e4}).data;Object(a.useEffect)((function(){return function(){c.current&&clearTimeout(c.current)}}),[]);var d=null===s||void 0===s||null===(t=s.machines)||void 0===t?void 0:t.find((function(e){return e.name===i})),m=no(s)>o&&d;return m&&(c.current=setTimeout((function(){return l(d)}),2e3)),Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{className:n.qrTitle,children:"Scan QR code with your new cryptomat"}),Object(qe.jsxs)("div",{className:n.qrCodeWrapper,children:[Object(qe.jsxs)("div",{className:n.qrCodeImageWrapper,children:[Object(qe.jsx)(pn.a,{size:280,fgColor:J,includeMargin:!0,value:r,className:n.qrCodeBorder}),Object(qe.jsxs)("div",{className:n.qrCodeScanMessage,children:[Object(qe.jsx)(Ti,{}),Object(qe.jsx)(Ke,{noMargin:!0,children:"Snap a picture and scan"})]})]}),Object(qe.jsxs)("div",{className:n.qrTextWrapper,children:[Object(qe.jsxs)("div",{className:n.qrTextInfoWrapper,children:[Object(qe.jsx)("div",{className:n.qrTextIcon,children:Object(qe.jsx)(ir,{})}),Object(qe.jsx)("div",{className:n.textWrapper,children:Object(qe.jsx)(Ke,{className:n.qrText,children:"To pair the machine you need scan the QR code with your machine. To do this either snap a picture of this QR code or download it through the button above and scan it with the scanning bay on your machine."})})]}),m&&Object(qe.jsxs)("div",{className:n.successMessageWrapper,children:[Object(qe.jsx)("div",{className:n.successMessageIcon,children:Object(qe.jsx)(Zi,{})}),Object(qe.jsx)(Ye,{className:n.successMessage,children:"Machine has been successfully paired!"})]})]})]})]})}}],oo=Object(a.memo)((function(e){var t=e.close,n=e.onPaired,r=to(),i=Object(u.c)(eo).data,o=Object(a.useState)(""),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(0),j=Object(l.a)(f,2),g=j[0],O=j[1],x=no(i),v=io[g].component;return Object(qe.jsx)("div",{children:Object(qe.jsx)(cn.a,{fullScreen:!0,className:r.dialog,open:!0,"aria-labelledby":"form-dialog-title",children:Object(qe.jsx)(sn.a,{className:r.dialog,children:Object(qe.jsxs)("div",{className:r.wrapper,children:[Object(qe.jsxs)("div",{className:r.headerDiv,children:[Object(qe.jsx)(yn,{children:"Add Machine"}),Object(qe.jsx)(dn.a,{disableRipple:!0,onClick:t,children:Object(qe.jsx)(un.a,{color:"error",children:Object(qe.jsx)(qi,{})})})]}),Object(qe.jsxs)("div",{className:r.contentDiv,children:[Object(qe.jsx)(Si,{children:io.map((function(e,t){return function(e,t,n,a){var r,i,o=e===n,l=n<e,c=n>e;return Object(qe.jsxs)("div",{className:a.item,children:[Object(qe.jsx)("span",{className:I()((r={},Object(z.a)(r,a.itemText,!0),Object(z.a)(r,a.itemTextActive,o),Object(z.a)(r,a.itemTextPast,l),r)),children:t.label}),o&&Object(qe.jsx)(yi,{}),l&&Object(qe.jsx)(bi,{}),c&&Object(qe.jsx)(Ct,{}),n<io.length-1&&Object(qe.jsx)("div",{className:I()((i={},Object(z.a)(i,a.stepperPath,!0),Object(z.a)(i,a.stepperPast,l),i))})]})}(g,e,t,r)}))}),Object(qe.jsx)("div",{className:r.contentWrapper,children:Object(qe.jsx)(v,{classes:r,nextStep:function(){return O(1)},count:x,onPaired:n,qrCode:s,setQrCode:d,name:p,setName:b})})]})]})})})})}));function lo(){return(lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function co(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var so=a.createElement("desc",null,"Created with Sketch."),uo=a.createElement("g",{id:"icon/button/add/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M11.5384615,6 C11.5384615,9.05815385 9.05815385,11.5384615 6,11.5384615 C2.94184615,11.5384615 0.461538462,9.05815385 0.461538462,6 C0.461538462,2.94184615 2.94184615,0.461538462 6,0.461538462 C9.05815385,0.461538462 11.5384615,2.94184615 11.5384615,6 Z",id:"Stroke-1",stroke:"#FFFFFF"}),a.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#FFFFFF"}),a.createElement("line",{x1:3.69230769,y1:6,x2:8.30769231,y2:6,id:"Stroke-5",stroke:"#FFFFFF"}));function mo(e,t){var n=e.title,r=e.titleId,i=co(e,["title","titleId"]);return a.createElement("svg",lo({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,so,uo)}var ho=a.forwardRef(mo);n.p;function po(){return(po=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bo(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fo=a.createElement("desc",null,"Created with Sketch."),jo=a.createElement("defs",null,a.createElement("path",{d:"M17.8413132,12.8764646 C17.8413132,12.8764646 16.6555879,12.5091919 15.661533,12.2855556 C15.661533,12.2855556 15.3477198,10.3246465 14.8939121,8.23646465 C14.8939121,8.23646465 15.1560495,8.21373737 15.3383242,8.8710101 L16.0223242,12.0219192 C16.0223242,12.0219192 17.2343571,12.2991919 18.1795549,12.6537374 L17.8413132,12.8764646 Z M15.2603407,6.10282828 L15.5328132,5.80555556 C16.0627253,5.87828283 16.3483516,6.02828283 16.3483516,6.02828283 L16.291978,6.11191919 L16.3972088,6.9310101 C16.2440604,6.93646465 16.0091703,7.05919192 16.0091703,7.05919192 L15.8315934,6.95010101 L15.8315934,6.38282828 C15.3026209,6.29919192 15.2556429,6.21828283 15.2556429,6.21828283 L15.2603407,6.10282828 Z M12.4557527,18.2873737 C11.2831813,18.4964646 9.84565385,18.2237374 9.84565385,18.2237374 L9.89732967,17.9991919 C9.89732967,17.9991919 11.6496099,18.1955556 12.6248736,17.8973737 C12.5553462,18.0628283 12.5356154,18.1137374 12.4557527,18.2873737 L12.4557527,18.2873737 Z M9.18984066,14.5464646 C8.379,15.1364646 7.56064286,15.6791919 7.00442308,16.1091919 C6.9705989,16.6955556 6.91516484,17.6464646 6.91516484,17.6464646 L5.46448352,18.5182828 L5.22207692,18.3737374 C5.27845055,17.9219192 5.34891758,17.5882828 5.34891758,17.5882828 L5.55186264,17.4410101 C5.50676374,17.7282828 5.48515385,18.1346465 5.48515385,18.1346465 L6.5928956,17.440101 C6.63705495,16.7019192 6.72443407,15.960101 6.72443407,15.960101 C6.9705989,15.7373737 8.73697253,14.5237374 10.0100803,13.6864646 C10.0100803,13.6864646 10.018533,13.9437374 9.18984066,14.5464646 L9.18984066,14.5464646 Z M14.977533,0.195555556 C15.2612802,0.167373737 15.5065055,0.184646465 15.7103901,0.228282828 L15.7103901,0.228282828 L15.8813901,0.697373737 L16.1003077,0.361919192 C16.2694286,0.447373737 16.3746593,0.547373737 16.4056648,0.624646465 C16.4056648,0.624646465 16.3615055,0.909191919 16.4319725,1.36464646 C16.5005604,1.80373737 16.6988077,2.78191919 16.6988077,2.78191919 C16.9740989,3.00646465 17.2850934,3.51282828 17.2850934,3.51282828 C17.4758242,4.41737374 17.4645495,5.04919192 17.4636099,5.1210101 C16.6734396,4.68646465 15.6173736,4.58555556 15.6173736,4.58555556 L15.6173736,4.58555556 L15.2481264,4.90828283 C15.9753462,5.00828283 16.8792033,5.26555556 17.1122143,5.44555556 C17.2484505,5.74737374 17.3386484,6.22828283 17.3386484,6.22828283 L17.3386484,6.22828283 L17.0445659,6.58919192 L17.3198571,6.8810101 C17.3386484,7.22464646 17.2183846,7.56919192 17.2183846,7.56919192 C17.7905769,7.93010101 17.9512418,8.79373737 18.3101538,10.250101 C18.6700055,11.7064646 18.9903956,12.9055556 18.9903956,12.9055556 L18.9903956,12.9055556 L18.4567253,13.2019192 C19.1623352,15.7282828 18.444511,17.7391919 17.5378352,19.0664646 C16.6320989,20.3946465 16.0862143,21.7137374 16.1031264,22.8910101 L16.1031264,22.8910101 L16.5475385,23.2346465 L16.7749121,23.9491919 L14.3048077,23.9491919 L14.293533,23.2728283 C14.2925934,21.5619192 14.9230385,20.1328283 14.9230385,20.1328283 C15.2857088,20.0473737 15.6596538,19.7628283 15.6596538,19.7628283 C15.0733681,19.8828283 14.3414505,19.7964646 14.3414505,19.7964646 C14.8676044,18.8537374 15.0292088,18.1773737 15.0292088,18.1773737 L15.0292088,18.1773737 L14.7811648,18.1228283 C14.6956648,18.310101 14.6073462,18.4937374 14.5133901,18.6710101 C13.8754286,19.8864646 13.1735769,20.6628283 12.7554725,22.4055556 L12.7554725,22.4055556 L13.1933077,22.7455556 L13.6987912,23.9491919 L10.8509835,23.9491919 C10.8340714,21.8246465 11.495522,20.2273737 11.7341703,19.7628283 C10.2233571,19.9264646 8.42128022,19.1782828 6.99314835,19.4664646 C6.60041209,21.9473737 4.59257143,22.4355556 3.65019231,22.300101 L3.65019231,22.300101 L2.97652747,23.4146465 L3.58724176,23.9491919 L1.33135714,23.9491919 C1.32008242,23.8546465 1.2918956,23.7537374 1.22988462,23.6591919 C1.22988462,23.6591919 1.97401648,22.5882828 2.48231868,21.150101 C2.89008791,21.3255556 3.75166484,20.9928283 3.78736813,20.1055556 C3.82401099,19.2191919 3.67086264,17.8419192 4.46854945,16.7891919 C5.2652967,15.7355556 6.12687363,15.1655556 7.25152747,14.3328283 C7.98250549,13.7910101 9.22084615,12.8755556 9.99974176,12.3010101 L9.99974176,12.3010101 L9.61546154,12.3864646 L6.81087363,14.6491919 L5.82997253,14.6491919 L8.66368681,12.1164646 L8.29725824,12.1091919 L5.33576374,14.6491919 L4.34170879,14.6491919 L7.27313736,11.720101 L6.9208022,11.7173737 L3.88038462,14.6491919 L2.86565934,14.6491919 L5.8093022,11.3037374 L5.46918132,11.3055556 L2.43534066,14.6491919 L1.36706044,14.6491919 L4.22614286,10.8528283 L3.89635714,10.8573737 L0.963989011,14.6491919 L0,14.6491919 C0,14.6491919 4.11809341,8.22464646 4.92893407,7.00737374 C5.73883516,5.79010101 6.6192033,4.62282828 8.06894505,4.38464646 C9.53465934,4.14282828 10.5343516,4.46646465 11.2502967,5.63373737 C11.636456,6.2610101 12.1034176,6.97828283 12.4698462,7.55919192 C12.0968407,8.1510101 11.6298791,8.6110101 11.5857198,9.32282828 C11.534044,10.1419192 12.0921429,10.6373737 12.6558791,10.6773737 C12.2321374,10.5282828 11.8976538,10.0337374 12.0489231,9.37646465 C12.2058297,8.69737374 12.7554725,8.35191919 13.1726374,7.80282828 C13.5315495,7.32828283 13.5371868,6.63282828 13.5108791,6.4010101 C13.4836319,6.16919192 13.2167967,5.98828283 13.2167967,5.98828283 C13.2167967,5.98828283 13.2252527,5.52373737 13.2167967,5.01646465 C13.2083407,4.51010101 13.4300769,4.21828283 13.4300769,4.21828283 C13.4300769,4.21828283 13.4216209,3.4610101 13.3943736,2.57646465 C13.3671264,1.72555556 13.2863242,1.46828283 13.205522,1.35464646 C13.205522,1.35464646 13.2694121,1.10919192 13.5099396,0.844646465 L13.5099396,0.844646465 L13.7542253,1.06282828 L13.8284505,0.571919192 C13.9825385,0.469191919 14.1723297,0.375555556 14.4072198,0.307373737 C14.4325879,0.30010101 14.4570165,0.294646465 14.4823846,0.288282828 L14.4823846,0.288282828 L14.7896209,0.644646465 Z M7.71628243,19.8937938 C8.32897736,19.8402566 9.02386307,19.9393405 9.75797621,20.0432188 L9.75797621,20.0432188 L9.86538462,20.058401 C9.7449004,20.8103202 9.02106112,21.7691969 7.79193531,22.0896215 L7.79193531,22.0896215 L9.01358923,23.5151515 L7.36136769,23.5151515 C7.15589073,23.2226941 6.50396838,22.32135 6.16586538,21.9681638 C6.72065317,21.6525335 7.42954868,21.0388524 7.71628243,19.8937938 Z",id:"path-1"})),go=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-128.000000, -14.000000)"},a.createElement("g",{id:"icon/lamassu-logo",transform:"translate(128.000000, 14.000000)"},a.createElement("g",{id:"color/amaz/default"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("use",{id:"Mask",fill:"#16D6D3",xlinkHref:"#path-1"})))));function Oo(e,t){var n=e.title,r=e.titleId,i=bo(e,["title","titleId"]);return a.createElement("svg",po({width:"19px",height:"24px",viewBox:"0 0 19 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,fo,jo,go)}var xo=a.forwardRef(Oo);n.p;function vo(){return(vo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function yo(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var wo=a.createElement("desc",null,"Created with Sketch."),Co=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#FFFFFF",strokeWidth:2},a.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},a.createElement("path",{d:"M10.1052632,14.3157895 C10.1052632,15.2454737 9.35073684,16 8.42105263,16 C7.49136842,16 6.73684211,15.2454737 6.73684211,14.3157895",id:"Stroke-1"}),a.createElement("path",{d:"M1.6,14.3157895 C0.7168,14.3157895 0,13.6031813 0,12.7251462 C0,11.8471111 0.7168,11.1345029 1.6,11.1345029 L1.6,6.3625731 C1.6,2.84884211 4.4656,0 8,0 C11.5344,0 14.4,2.84884211 14.4,6.3625731 L14.4,11.1345029 C15.2832,11.1345029 16,11.8471111 16,12.7251462 C16,13.6031813 15.2832,14.3157895 14.4,14.3157895 L1.6,14.3157895 Z",id:"Stroke-3",strokeLinejoin:"round"}))));function ko(e,t){var n=e.title,r=e.titleId,i=yo(e,["title","titleId"]);return a.createElement("svg",vo({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,wo,Co)}var Eo=a.forwardRef(ko),No=(n.p,Me.p),So=56,Io=40;var Lo,Fo,Po,Do,To,Ro,Bo,Ao,Mo,Wo,zo,qo,$o,Ho,Vo,Uo,Go,Xo,_o,Zo={headerContainer:{position:"relative"},header:{backgroundColor:J,color:K,height:So,display:"flex"},content:{maxWidth:be,flex:1,display:"flex",alignItems:"center",margin:"0 auto"},nav:{flex:1,display:"flex",alignItems:"center",justifyContent:"space-between"},ul:{display:"flex",paddingLeft:36,height:56,margin:0},li:{listStyle:"none",color:K,margin:[[20,20,0,20]],"&:hover":{color:K},"&:hover::after":{width:"50%",marginLeft:"-25%"},position:"relative","&:after":{content:'""',display:"block",background:K,width:0,height:4,left:"50%",marginLeft:0,bottom:-8,position:"absolute",borderRadius:1e3,transition:[["all","0.2s","cubic-bezier(0.95, 0.1, 0.45, 0.94)"]]}},link:{extend:No,textDecoration:"none",border:"none",color:K,backgroundColor:"transparent"},forceSize:{display:"inline-block",textAlign:"center","&:after":{display:"block",content:"attr(forcesize)",fontWeight:700,height:0,overflow:"hidden",visibility:"hidden"}},activeLink:{color:K,"& li::after":{width:"50%",marginLeft:"-25%"}},addMachine:{marginLeft:"auto"},subheader:{backgroundColor:re,color:K,height:Io,display:"flex"},subheaderUl:{display:"flex",paddingLeft:0,margin:0},subheaderLi:{listStyle:"none",padding:[[0,20]],"&:first-child":{paddingLeft:0}},subheaderLink:{extend:No,textDecoration:"none",border:"none",color:me},activeSubheaderLink:{textShadow:"0.2px 0 0 currentColor",color:ce},white:{color:K},logo:{display:"flex",alignItems:"center","& > svg":{marginRight:16}},logoLink:{cursor:"pointer"},actionButtonsContainer:{zIndex:1,position:"relative",display:"flex",justifyContent:"space-between",minWidth:200,transform:"translateZ(0)"},notificationIcon:{marginTop:4,cursor:"pointer",background:"transparent",boxShadow:"0px 0px 0px transparent",border:"0px solid transparent",textShadow:"0px 0px 0px transparent",outline:"none"},hasUnread:{position:"absolute",top:4,left:186,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"},popper:{zIndex:1}},Ko=Object(f.a)(Zo),Qo=x()(Lo||(Lo=Object(c.a)(["\n query getUnread {\n hasUnreadNotifications\n }\n"]))),Yo=function(e){var t=e.item,n=e.classes,r=e.user,i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],s=o[1];return Object(qe.jsx)("div",{className:n.subheader,children:Object(qe.jsx)("div",{className:n.content,children:Object(qe.jsx)("nav",{children:Object(qe.jsx)("ul",{className:n.subheaderUl,children:t.children.map((function(e,t){return L.a(r.role,e.allowedRoles)?Object(qe.jsx)("li",{className:n.subheaderLi,children:Object(qe.jsx)(C.c,{to:{pathname:e.route,state:{prev:c}},className:n.subheaderLink,activeClassName:n.activeSubheaderLink,isActive:function(t){return!!t&&(s(e.route),!0)},children:e.label})},t):Object(qe.jsx)(qe.Fragment,{})}))})})})})},Jo=F.a(P.a,D.a),el=Object(a.memo)((function(e){var t=e.tree,n=e.user,r=Object(a.useState)(!1),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)({x:0,y:0}),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(!1),k=Object(l.a)(y,2),S=k[0],F=k[1],P=Object(u.c)(Qo),D=P.data,T=P.refetch,R=P.startPolling,B=P.stopPolling,A=Object(a.useRef)(),M=Object(a.useRef)(),W=Object(w.h)(),z=Ko();Object(a.useEffect)((function(){return(null===D||void 0===D?void 0:D.hasUnreadNotifications)?F(!0):Jo(null===D||void 0===D?void 0:D.hasUnreadNotifications)?F(!1):void 0}),[D]),Object(a.useEffect)((function(){return R(6e4),B}));var q=function(){h(null),document.querySelector("#root").classList.remove("root-notifcenter-open"),document.querySelector("body").classList.remove("body-notifcenter-open")},$=Boolean(m),H=$?"notifications-popper":void 0;return Object(qe.jsxs)("header",{className:z.headerContainer,children:[Object(qe.jsx)("div",{className:z.header,children:Object(qe.jsxs)("div",{className:z.content,children:[Object(qe.jsxs)("div",{onClick:function(){v(!1),W.push("/dashboard")},className:I()(z.logo,z.logoLink),children:[Object(qe.jsx)(xo,{}),Object(qe.jsx)(_e,{className:z.white,children:"Lamassu Admin"})]}),Object(qe.jsx)("nav",{className:z.nav,children:Object(qe.jsx)("ul",{className:z.ul,children:t.map((function(e,t){return L.a(n.role,e.allowedRoles)?Object(qe.jsx)(C.c,{to:e.route||e.children[0].route,isActive:function(t){return!!t&&(v(e),!0)},className:I()(z.link,z.whiteLink),activeClassName:z.activeLink,children:Object(qe.jsx)("li",{className:z.li,children:Object(qe.jsx)("span",{className:z.forceSize,forcesize:e.label,children:e.label})})},t):Object(qe.jsx)(qe.Fragment,{})}))})}),Object(qe.jsxs)("div",{className:z.actionButtonsContainer,children:[Object(qe.jsx)(He,{color:"secondary",Icon:Sn,InverseIcon:ho,onClick:function(){return c(!0)},children:"Add machine"}),Object(qe.jsx)(E.a,{onClickAway:q,children:Object(qe.jsxs)("div",{ref:A,children:[Object(qe.jsxs)("button",{onClick:function(e){var t=A.current.getBoundingClientRect();j({x:t.x,y:t.y+5}),h(m?null:e.currentTarget),document.querySelector("#root").classList.add("root-notifcenter-open"),document.querySelector("body").classList.add("body-notifcenter-open")},className:z.notificationIcon,children:[Object(qe.jsx)(Eo,{}),S&&Object(qe.jsx)("div",{className:z.hasUnread})]}),Object(qe.jsx)(N.a,{ref:M,id:H,open:$,anchorEl:m,className:z.popper,disablePortal:!1,placement:"bottom-end",modifiers:{offset:{enabled:!0,offset:"100vw"},preventOverflow:{enabled:!0,boundariesElement:"viewport",padding:0}},children:Object(qe.jsx)(ln,{popperRef:M,buttonCoords:f,close:q,hasUnreadProp:S,refetchHasUnreadHeader:T})})]})})]})]})}),x&&x.children&&Object(qe.jsx)(Yo,{item:x,classes:z,user:n}),o&&Object(qe.jsx)(oo,{close:function(){return c(!1)},onPaired:function(e){c(!1),W.push("/maintenance/machine-status",{id:e.deviceId})}})]})})),tl=n(1113),nl={wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:he,margin:0,whiteSpace:"break-spaces"}},al=Object(f.a)(nl),rl=function(e){var t=e.className,n=e.children,a=(Object(q.a)(e,["className","children"]),al());return Object(qe.jsxs)("div",{className:I()(a.wrapper,t),children:[Object(qe.jsx)(Yt,{}),Object(qe.jsx)(Je,{className:a.message,children:n})]})},il={titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},titleAndButtonsContainer:{display:"flex",alignItems:"center"},error:{marginLeft:12},subpageButton:{marginLeft:12},buttonText:{color:ae,fontFamily:"Mont",fontSize:15},icon:{marginRight:6},label:{marginRight:24}},ol=Object(f.a)(il),ll=function(e){var t=e.className,n=e.title,a=e.error,r=e.labels,i=e.buttons,o=void 0===i?[]:i,l=e.children,c=e.appendix,s=e.appendixRight,d=ol();return Object(qe.jsxs)("div",{className:I()(d.titleWrapper,t),children:[Object(qe.jsxs)("div",{className:d.titleAndButtonsContainer,children:[Object(qe.jsx)(yn,{children:n}),!!c&&c,a&&Object(qe.jsx)(rl,{className:d.error,children:"Failed to save"}),o.length>0&&Object(qe.jsx)(qe.Fragment,{children:o.map((function(e,t){return D.a(e.component)?Object(qe.jsx)(Oa,{className:d.subpageButton,Icon:e.icon,InverseIcon:e.inverseIcon,toggle:e.toggle,forceDisable:e.forceDisable,children:Object(qe.jsx)(Qe,{className:d.buttonText,children:e.text})},t):e.component}))})]}),Object(qe.jsxs)(tl.a,{display:"flex",flexDirection:"row",alignItems:"center",children:[(null!==r&&void 0!==r?r:[]).map((function(e,t){var n=e.icon,a=e.label;return Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"center",children:[Object(qe.jsx)("div",{className:d.icon,children:n}),Object(qe.jsx)(at,{className:d.label,children:a})]},t)})),s]}),l]})},cl=n(304),sl=n(1110),dl=n(1133),ul=n(1074),ml=n(1066),hl=n(1123),pl=n(1124),bl=n(1077),fl=n(1132),jl=n(141),gl=n.n(jl),Ol={title:{paddingTop:8},input:{marginBottom:25,marginTop:-15},wrapper:{padding:"2.5em 4em",width:575,display:"flex",flexDirection:"column"},titleWrapper:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:30},rememberMeWrapper:{marginTop:35,display:"flex",flexDirection:"row"},icon:{transform:"scale(1.5)",marginRight:25},checkbox:{transform:"scale(1.5)",marginRight:5,marginLeft:-5},footer:{marginTop:"10vh"},twofaFooter:{marginTop:"6vh"},fidoLoginButtonWrapper:{marginBottom:12},loginButton:{display:"block",width:"100%"},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:ae,backgroundSize:"cover",height:"100vh",width:"100vw",position:"relative",left:"50%",right:"50%",marginLeft:"-50vw",marginRight:"-50vw",minHeight:"100vh"},info:{marginBottom:"5vh"},info2:{textAlign:"justify"},infoWrapper:{marginBottom:"3vh"},errorMessage:{color:he},qrCodeWrapper:{display:"flex",justifyContent:"center",marginBottom:"3vh"},secretWrapper:{display:"flex",justifyContent:"center",alignItems:"center"},secretLabel:{marginRight:15},secret:{marginRight:35},hiddenSecret:{marginRight:35,filter:"blur(8px)"},confirm2FAInput:{marginTop:25},confirmPassword:{marginTop:25},error:{color:he},enterButton:{display:"none"}},xl="LOGIN",vl="SETUP2FA",yl="INPUT2FA",wl="FIDO",Cl=Object(f.a)(Ol),kl=x()(Fo||(Fo=Object(c.a)(["\n mutation input2FA(\n $username: String!\n $password: String!\n $code: String!\n $rememberMe: Boolean!\n ) {\n input2FA(\n username: $username\n password: $password\n code: $code\n rememberMe: $rememberMe\n )\n }\n"]))),El=x()(Po||(Po=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Nl=function(e){var t=e.state,n=e.dispatch,r=Cl(),i=Object(w.h)(),o=Object(a.useContext)(k).setUserData,c=Object(a.useState)(!1),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.a)(El,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),p=Object(l.a)(h,2),b=p[0],f=p[1].error,j=Object(u.b)(kl,{onCompleted:function(e){if(e.input2FA){var n={context:{headers:{"Pazuz-Operator-Identifier":gl.a.encode(t.clientField)}}};return b(n)}return m(!0)}}),g=Object(l.a)(j,2),O=g[0],x=g[1].error,v=function(){if(6===t.twoFAField.length){var e={variables:{username:t.clientField,password:t.passwordField,code:t.twoFAField,rememberMe:t.rememberMeField},context:{headers:{"Pazuz-Operator-Identifier":gl.a.encode(t.clientField)}}};O(e)}else m(!0)},y=f?"Internal server error":6!==t.twoFAField.length&&d?"The code should have 6 characters!":x||d?"Code is invalid. Please try again.":null;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tt,{className:r.info,children:"Enter your two-factor authentication code"}),Object(qe.jsx)(mn.e,{onSubmit:function(){},initialValues:{},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(hr,{name:"2fa",value:t.twoFAField,onChange:function(e){n({type:yl,payload:{twoFAField:e}}),m(!1)},numInputs:6,error:d,shouldAutoFocus:!0}),Object(qe.jsx)("button",{onClick:v,className:r.enterButton})]})}),Object(qe.jsxs)("div",{className:r.twofaFooter,children:[y&&Object(qe.jsx)(Ke,{className:r.errorMessage,children:y}),Object(qe.jsx)(An,{onClick:v,buttonClassName:r.loginButton,children:"Login"})]})]})},Sl=n(218),Il=Object(f.a)(Ol),Ll=x()(Do||(Do=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Fl=xn.f().shape({localClient:xn.h().required("Client field is required!").email("Username field should be in an email format!"),localRememberMe:xn.b()}),Pl={localClient:"",localRememberMe:!1},Dl=function(e){var t=e.state,n=e.strategy,r=x()(To||(To=Object(c.a)(["\n query generateAssertionOptions($username: String!",", $domain: String!) {\n generateAssertionOptions(username: $username",", domain: $domain)\n }\n "])),"FIDO2FA"===n?", $password: String!":"","FIDO2FA"===n?", password: $password":""),i=x()(Ro||(Ro=Object(c.a)(["\n mutation validateAssertion(\n $username: String!\n ","\n $rememberMe: Boolean!\n $assertionResponse: JSONObject!\n $domain: String!\n ) {\n validateAssertion(\n username: $username\n ","\n rememberMe: $rememberMe\n assertionResponse: $assertionResponse\n domain: $domain\n )\n }\n "])),"FIDO2FA"===n?", $password: String!":"","FIDO2FA"===n?"password: $password":""),o=Il(),s=Object(w.h)(),d=Object(a.useContext)(k).setUserData,m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],v=Object(a.useState)(!1),y=Object(l.a)(v,2),C=y[0],E=y[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],L=S[1],F=Object(u.b)(i,{onCompleted:function(e){e.validateAssertion?q():L(!0)}}),P=Object(l.a)(F,2),D=P[0],T=P[1].error,R=Object(u.a)(r,{variables:"FIDO2FA"===n?{username:t.clientField,password:t.passwordField,domain:window.location.hostname}:{username:p,domain:window.location.hostname},onCompleted:function(e){var a=e.generateAssertionOptions;Object(Sl.a)(a).then((function(e){var a="FIDO2FA"===n?{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,assertionResponse:e,domain:window.location.hostname}:{username:p,rememberMe:g,assertionResponse:e,domain:window.location.hostname};D({variables:a})})).catch((function(e){console.error(e),L(!0)}))}}),B=Object(l.a)(R,2),A=B[0],M=B[1].error,W=Object(u.a)(Ll,{onCompleted:function(e){var t=e.userData;d(t),s.push("/")}}),z=Object(l.a)(W,2),q=z[0],$=z[1].error,H=function(e,t){return e&&t?M||$||T?"Internal server error":e.client&&t.client?e.client:C?"Invalid login.":I?"Code is invalid. Please try again.":null:null};return Object(qe.jsxs)(qe.Fragment,{children:["FIDOPasswordless"===n&&Object(qe.jsx)(mn.e,{validationSchema:Fl,initialValues:Pl,onSubmit:function(e){E(!1),b(e.localClient),O(e.localRememberMe),A()},children:function(e){var t=e.errors,n=e.touched;return Object(qe.jsxs)(mn.d,{id:"fido-form",children:[Object(qe.jsx)(mn.b,{name:"localClient",label:"Client",size:"lg",component:si,fullWidth:!0,autoFocus:!0,className:o.input,error:H(t,n),onKeyUp:function(){C&&E(!1)}}),Object(qe.jsxs)("div",{className:o.rememberMeWrapper,children:[Object(qe.jsx)(mn.b,{name:"localRememberMe",className:o.checkbox,component:ri}),Object(qe.jsx)(rt,{className:o.inputLabel,children:"Keep me logged in"})]}),Object(qe.jsxs)("div",{className:o.twofaFooter,children:[H(t,n)&&Object(qe.jsx)(Ke,{className:o.errorMessage,children:H(t,n)}),Object(qe.jsx)(An,{type:"submit",form:"fido-form",buttonClassName:o.loginButton,children:"Use FIDO"})]})]})}}),"FIDO2FA"===n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ge,{className:o.info,children:"Insert your hardware key and follow the instructions"}),Object(qe.jsx)(An,{type:"button",form:"fido-form",onClick:function(){return A()},buttonClassName:o.loginButton,children:"Use FIDO"})]})]})},Tl=n(34),Rl=n.n(Tl),Bl=n(66),Al=Object(f.a)(Ol),Ml=x()(Bo||(Bo=Object(c.a)(["\n mutation login($username: String!, $password: String!) {\n login(username: $username, password: $password)\n }\n"]))),Wl=x()(Ao||(Ao=Object(c.a)(["\n query generateAssertionOptions($domain: String!) {\n generateAssertionOptions(domain: $domain)\n }\n"]))),zl=x()(Mo||(Mo=Object(c.a)(["\n mutation validateAssertion(\n $assertionResponse: JSONObject!\n $domain: String!\n ) {\n validateAssertion(assertionResponse: $assertionResponse, domain: $domain)\n }\n"]))),ql=x()(Wo||(Wo=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),$l=xn.f().shape({email:xn.h().label("Email").required().email(),password:xn.h().required("Password field is required"),rememberMe:xn.b()}),Hl={email:"",password:"",rememberMe:!1},Vl=function(e,t,n){return e&&t?n?"Invalid email/password combination":e.email&&t.email?e.email:e.password&&t.password?e.password:null:null},Ul=function(e){e.state;var t=e.dispatch,n=e.strategy,r=Al(),i=Object(w.h)(),o=Object(a.useContext)(k).setUserData,c=Object(u.b)(Ml),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=function(){var e=Object(Bl.a)(Rl.a.mark((function e(n,a,r){var i,o,l;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={variables:{username:n,password:a},context:{headers:{"Pazuz-Operator-Identifier":gl.a.encode(n)}}},e.next=3,d(i);case 3:if(o=e.sent,(l=o.data).login){e.next=7;break}return e.abrupt("return");case 7:return e.abrupt("return",t({type:l.login,payload:{clientField:n,passwordField:a,rememberMeField:r}}));case 8:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}(),p=Object(u.b)(zl,{onCompleted:function(e){return e.validateAssertion&&E()}}),b=Object(l.a)(p,2),f=b[0],j=b[1].error,g=Object(u.a)(Wl,{onCompleted:function(e){var t=e.generateAssertionOptions;Object(Sl.a)(t).then((function(e){f({variables:{assertionResponse:e,domain:window.location.hostname}})})).catch((function(e){console.error(e)}))}}),O=Object(l.a)(g,2),x=O[0],v=O[1].error,y=Object(u.a)(ql,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),C=Object(l.a)(y,2),E=C[0],N=C[1].error;return Object(qe.jsx)(mn.e,{validationSchema:$l,initialValues:Hl,onSubmit:function(e){return h(e.email,e.password,e.rememberMe)},children:function(e){var a=e.errors,i=e.touched;return Object(qe.jsxs)(mn.d,{id:"login-form",children:[Object(qe.jsx)(mn.b,{name:"email",label:"Email",size:"lg",component:si,fullWidth:!0,autoFocus:!0,className:r.input,error:Vl(a,i,m||j||v||N)}),Object(qe.jsx)(mn.b,{name:"password",size:"lg",component:ci,label:"Password",fullWidth:!0,error:Vl(a,i,m||j||v||N)}),Object(qe.jsxs)("div",{className:r.rememberMeWrapper,children:[Object(qe.jsx)(mn.b,{name:"rememberMe",className:r.checkbox,component:ri}),Object(qe.jsx)(it,{children:"Keep me logged in"})]}),Object(qe.jsxs)("div",{className:r.footer,children:[Vl(a,i,m||j||v||N)&&Object(qe.jsx)(Ke,{className:r.errorMessage,children:Vl(a,i,m||j||v||N)}),"FIDO2FA"!==n&&Object(qe.jsx)(An,{type:"button",onClick:function(){return"FIDOUsernameless"===n?x({variables:{domain:window.location.hostname}}):t({type:"FIDO",payload:{}})},buttonClassName:r.loginButton,className:r.fidoLoginButtonWrapper,children:"I have a hardware key"}),Object(qe.jsx)(An,{type:"submit",form:"login-form",buttonClassName:r.loginButton,children:"Login"})]})]})}})},Gl=x()(zo||(zo=Object(c.a)(["\n mutation setup2FA(\n $username: String!\n $password: String!\n $rememberMe: Boolean!\n $codeConfirmation: String!\n ) {\n setup2FA(\n username: $username\n password: $password\n rememberMe: $rememberMe\n codeConfirmation: $codeConfirmation\n )\n }\n"]))),Xl=x()(qo||(qo=Object(c.a)(["\n query get2FASecret($username: String!, $password: String!) {\n get2FASecret(username: $username, password: $password) {\n secret\n otpauth\n }\n }\n"]))),_l=x()($o||($o=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Zl=Object(f.a)(Ol),Kl=function(e){var t=e.state,n=(e.dispatch,Zl()),r=Object(w.h)(),i=Object(a.useContext)(k).setUserData,o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(!1),v=Object(l.a)(x,2),y=v[0],C=v[1],E=Object(a.useState)(""),N=Object(l.a)(E,2),S=N[0],I=N[1],L={variables:{username:t.clientField,password:t.passwordField},context:{headers:{"Pazuz-Operator-Identifier":gl.a.encode(t.clientField)}},onCompleted:function(e){var t=e.get2FASecret;d(t.secret),b(t.otpauth)}},F={variables:{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,codeConfirmation:S},context:{headers:{"Pazuz-Operator-Identifier":gl.a.encode(t.clientField)}}},P=Object(u.c)(Xl,L).error,D=Object(u.a)(_l,{onCompleted:function(e){var t=e.userData;i(t),r.push("/")}}),T=Object(l.a)(D,1)[0],R=Object(u.b)(Gl,{onCompleted:function(e){var n=e.setup2FA,a={context:{headers:{"Pazuz-Operator-Identifier":gl.a.encode(t.clientField)}}};n?T(a):C(!0)}}),B=Object(l.a)(R,2),A=B[0],M=B[1].error,W=function(){return M||P?"Internal server error.":6!==S.length&&y?"The code should have 6 characters!":y?"Code is invalid. Please try again.":null},z=function(){6===S.length?A(F):C(!0)};return s&&p&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:n.infoWrapper,children:[Object(qe.jsx)(it,{className:n.info2,children:"This account does not yet have two-factor authentication enabled. To secure the admin, two-factor authentication is required."}),Object(qe.jsx)(it,{className:n.info2,children:"To complete the registration process, scan the following QR code or insert the secret below on a 2FA app, such as Google Authenticator or AndOTP."})]}),Object(qe.jsx)("div",{className:n.qrCodeWrapper,children:Object(qe.jsx)(pn.a,{size:240,fgColor:J,value:p})}),Object(qe.jsxs)("div",{className:n.secretWrapper,children:[Object(qe.jsx)(it,{className:n.secretLabel,children:"Your secret:"}),Object(qe.jsx)(it,{className:g?n.secret:n.hiddenSecret,children:s}),Object(qe.jsx)(He,{disabled:!s&&!p,color:"primary",onClick:function(){O(!g)},children:g?"Hide":"Show"})]}),Object(qe.jsx)("div",{className:n.confirm2FAInput,children:Object(qe.jsx)(mn.e,{onSubmit:function(){},initialValues:{},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(hr,{name:"2fa",value:S,onChange:function(e){I(e),C(!1)},numInputs:6,error:y,shouldAutoFocus:!0}),Object(qe.jsx)("button",{onClick:z,className:n.enterButton})]})})}),Object(qe.jsxs)("div",{className:n.twofaFooter,children:[W()&&Object(qe.jsx)(Ke,{className:n.errorMessage,children:W()}),Object(qe.jsx)(An,{onClick:z,buttonClassName:n.loginButton,children:"Done"})]})]})},Ql="FIDO2FA",Yl=Object(f.a)(Ol),Jl={twoFAField:"",clientField:"",passwordField:"",rememberMeField:!1,loginState:xl},ec=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{loginState:n})},tc=function(){var e=Yl(),t=Object(a.useReducer)(ec,Jl),n=Object(l.a)(t,2),r=n[0],i=n[1];return Object(qe.jsx)(Un.a,{elevation:1,children:Object(qe.jsxs)("div",{className:e.wrapper,children:[Object(qe.jsxs)("div",{className:e.titleWrapper,children:[Object(qe.jsx)(xo,{className:e.icon}),Object(qe.jsx)(Ze,{className:e.title,children:"Lamassu Admin"})]}),function(){switch(r.loginState){case xl:return Object(qe.jsx)(Ul,{state:r,dispatch:i,strategy:Ql});case yl:return Object(qe.jsx)(Nl,{state:r,dispatch:i});case vl:return Object(qe.jsx)(Kl,{state:r,dispatch:i});case wl:return Object(qe.jsx)(Dl,{state:r,strategy:Ql})}}()]})})},nc=Object(f.a)(Ol),ac=function(){var e=nc();return Object(qe.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(qe.jsx)(h.a,{children:Object(qe.jsx)(tc,{})})})},rc=function(){return new URLSearchParams(Object(w.i)().search)},ic=Object(f.a)(Ol),oc=x()(Ho||(Ho=Object(c.a)(["\n query validateRegisterLink($token: String!) {\n validateRegisterLink(token: $token) {\n username\n role\n }\n }\n"]))),lc=x()(Vo||(Vo=Object(c.a)(["\n mutation register(\n $token: String!\n $username: String!\n $password: String!\n $role: String!\n ) {\n register(\n token: $token\n username: $username\n password: $password\n role: $role\n )\n }\n"]))),cc=xn.f({password:xn.h().required("A password is required").min(8,"Your password must contain at least ".concat(8," characters")),confirmPassword:xn.h().required("Please confirm the password").oneOf([xn.g("password")],"Passwords must match")}),sc={password:"",confirmPassword:""},dc={username:null,role:null,result:""},uc=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{result:n})},mc=function(e,t,n,a){return e&&t?n||a?"Internal server error":e.password&&t.password?e.password:e.confirmPassword&&t.confirmPassword?e.confirmPassword:null:null},hc=function(){var e,t=ic(),n=Object(w.h)(),r=rc().get("t"),i=null!==(e=rc().get("id"))&&void 0!==e?e:null,o=Object(a.useReducer)(uc,dc),c=Object(l.a)(o,2),s=c[0],d=c[1],m={context:{headers:{"Pazuz-Operator-Identifier":i}},variables:{token:r},onCompleted:function(e){var t=e.validateRegisterLink;if(!t)return d({type:"failure"});d({type:"success",payload:{username:t.username,role:t.role}})},onError:function(){return d({type:"failure"})}},p=Object(u.c)(oc,m),b=p.error,f=p.loading,j=Object(u.b)(lc,{onCompleted:function(e){e.register&&n.push("/wizard",{fromAuthRegister:!0})}}),g=Object(l.a)(j,2),O=g[0],x=g[1].error;return Object(qe.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:t.welcomeBackground,children:Object(qe.jsx)(h.a,{children:Object(qe.jsx)("div",{children:Object(qe.jsx)(Un.a,{elevation:1,children:Object(qe.jsxs)("div",{className:t.wrapper,children:[Object(qe.jsxs)("div",{className:t.titleWrapper,children:[Object(qe.jsx)(xo,{className:t.icon}),Object(qe.jsx)(Ge,{className:t.title,children:"Lamassu Admin"})]}),!f&&"success"===s.result&&Object(qe.jsx)(mn.e,{validationSchema:cc,initialValues:sc,onSubmit:function(e){O({variables:{token:r,username:s.username,password:e.password,role:s.role}})},children:function(e){var n=e.errors,a=e.touched;return Object(qe.jsxs)(mn.d,{id:"register-form",children:[Object(qe.jsx)(mn.b,{name:"password",label:"Insert a password",autoFocus:!0,component:ci,size:"lg",fullWidth:!0,className:t.input}),Object(qe.jsx)(mn.b,{name:"confirmPassword",label:"Confirm your password",component:ci,size:"lg",fullWidth:!0}),Object(qe.jsxs)("div",{className:t.footer,children:[mc(n,a,b,x)&&Object(qe.jsx)(Ke,{className:t.errorMessage,children:mc(n,a,b,x)}),Object(qe.jsx)(An,{type:"submit",form:"register-form",buttonClassName:t.loginButton,children:"Done"})]})]})}}),!f&&"failure"===s.result&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(it,{children:"Link has expired"}),Object(qe.jsxs)(it,{children:["To obtain a new link, run the command"," ",Object(qe.jsx)("strong",{children:"lamassu-register"})," in your server\u2019s terminal."]})]})]})})})})})},pc=Object(f.a)(Ol),bc=x()(Uo||(Uo=Object(c.a)(["\n query validateReset2FALink($token: String!) {\n validateReset2FALink(token: $token) {\n user_id\n secret\n otpauth\n }\n }\n"]))),fc=x()(Go||(Go=Object(c.a)(["\n mutation reset2FA($token: String!, $userID: ID!, $code: String!) {\n reset2FA(token: $token, userID: $userID, code: $code)\n }\n"]))),jc={userID:null,secret:null,otpauth:null,result:null},gc=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{result:n})},Oc=function(){var e=pc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),r=Object(a.useState)(!1),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!1),d=Object(l.a)(s,2),m=d[0],p=d[1],b=Object(a.useState)(""),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useReducer)(gc,jc),x=Object(l.a)(O,2),v=x[0],y=x[1],C=Object(u.c)(bc,{variables:{token:n},onCompleted:function(e){var t=e.validateReset2FALink;y(t?{type:"success",payload:{userID:t.user_id,secret:t.secret,otpauth:t.otpauth}}:{type:"failure"})},onError:function(){y({type:"failure"})}}),k=C.error,E=C.loading,N=Object(u.b)(fc,{onCompleted:function(e){e.reset2FA?t.push("/"):p(!0)}}),S=Object(l.a)(N,2),I=S[0],L=S[1].error,F=function(){return k?"Internal server error":6!==j.length&&m?"The code should have 6 characters!":L||m?"Code is invalid. Please try again.":null},P=function(){6===j.length?I({variables:{token:n,userID:v.userID,code:j}}):p(!0)};return Object(qe.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(qe.jsx)(h.a,{children:Object(qe.jsx)("div",{children:Object(qe.jsx)(Un.a,{elevation:1,children:Object(qe.jsxs)("div",{className:e.wrapper,children:[Object(qe.jsxs)("div",{className:e.titleWrapper,children:[Object(qe.jsx)(xo,{className:e.icon}),Object(qe.jsx)(Ge,{className:e.title,children:"Lamassu Admin"})]}),!E&&"success"===v.result&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:e.infoWrapper,children:Object(qe.jsx)(rt,{className:e.info2,children:"To finish this process, please scan the following QR code or insert the secret further below on an authentication app of your choice, such Google Authenticator or Authy."})}),Object(qe.jsx)("div",{className:e.qrCodeWrapper,children:Object(qe.jsx)(pn.a,{size:240,fgColor:J,value:v.otpauth})}),Object(qe.jsxs)("div",{className:e.secretWrapper,children:[Object(qe.jsx)(rt,{className:e.secretLabel,children:"Your secret:"}),Object(qe.jsx)(rt,{className:o?e.secret:e.hiddenSecret,children:v.secret}),Object(qe.jsx)(He,{color:"primary",onClick:function(){c(!o)},children:o?"Hide":"Show"})]}),Object(qe.jsx)("div",{className:e.confirm2FAInput,children:Object(qe.jsx)(mn.e,{onSubmit:function(){},initialValues:{},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(hr,{name:"2fa",value:j,onChange:function(e){g(e),p(!1)},numInputs:6,error:m,shouldAutoFocus:!0}),Object(qe.jsx)("button",{onClick:P,className:e.enterButton})]})})}),Object(qe.jsxs)("div",{className:e.twofaFooter,children:[F()&&Object(qe.jsx)(Ke,{className:e.errorMessage,children:F()}),Object(qe.jsx)(An,{onClick:P,buttonClassName:e.loginButton,children:"Done"})]})]}),!E&&"failure"===v.result&&Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(it,{children:"Link has expired"})})]})})})})})},xc=Object(f.a)(Ol),vc=x()(Xo||(Xo=Object(c.a)(["\n query validateResetPasswordLink($token: String!) {\n validateResetPasswordLink(token: $token) {\n id\n }\n }\n"]))),yc=x()(_o||(_o=Object(c.a)(["\n mutation resetPassword($token: String!, $userID: ID!, $newPassword: String!) {\n resetPassword(token: $token, userID: $userID, newPassword: $newPassword)\n }\n"]))),wc=xn.f().shape({password:xn.h().required("A new password is required").test("len","New password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.h().oneOf([xn.g("password"),null],"Passwords must match")}),Cc={password:"",confirmPassword:""},kc=function(e,t,n){return e&&t?n?"Internal server error":e.password&&t.password?e.password:e.confirmPassword&&t.confirmPassword?e.confirmPassword:null:null},Ec=function(){var e=xc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!0),d=Object(l.a)(s,2),m=d[0],p=d[1],b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1];Object(u.c)(vc,{variables:{token:n},onCompleted:function(e){var t=e.validateResetPasswordLink;p(!1),t?(g(!0),c(t.id)):g(!1)},onError:function(){p(!1),g(!1)}});var O=Object(u.b)(yc,{onCompleted:function(e){e.resetPassword&&t.push("/")}}),x=Object(l.a)(O,2),v=x[0],y=x[1].error;return Object(qe.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(qe.jsx)(h.a,{children:Object(qe.jsx)("div",{children:Object(qe.jsx)(Un.a,{elevation:1,children:Object(qe.jsxs)("div",{className:e.wrapper,children:[Object(qe.jsxs)("div",{className:e.titleWrapper,children:[Object(qe.jsx)(xo,{className:e.icon}),Object(qe.jsx)(Ge,{className:e.title,children:"Lamassu Admin"})]}),!m&&j&&Object(qe.jsx)(mn.e,{validationSchema:wc,initialValues:Cc,onSubmit:function(e){v({variables:{token:n,userID:o,newPassword:e.confirmPassword}})},children:function(t){var n=t.errors,a=t.touched;return Object(qe.jsxs)(mn.d,{id:"reset-password",children:[Object(qe.jsx)(mn.b,{name:"password",autoFocus:!0,size:"lg",component:ci,label:"New password",fullWidth:!0,className:e.input}),Object(qe.jsx)(mn.b,{name:"confirmPassword",size:"lg",component:ci,label:"Confirm your password",fullWidth:!0}),Object(qe.jsxs)("div",{className:e.footer,children:[kc(n,a,y)&&Object(qe.jsx)(Ke,{className:e.errorMessage,children:kc(n,a,y)}),Object(qe.jsx)(An,{type:"submit",form:"reset-password",buttonClassName:e.loginButton,children:"Done"})]})]})}}),!m&&!j&&Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(it,{children:"Link has expired"})})]})})})})})};function Nc(){return(Nc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Sc(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ic=a.createElement("desc",null,"Created with Sketch."),Lc=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/direction/cash-in",transform:"translate(-1.000000, 0.000000)",fill:"#16D6D3"},a.createElement("path",{d:"M3.99134364,0.321790399 L10.1430099,4.40569595 C11.0271728,4.99266501 11.2660914,6.1822461 10.6766494,7.06269968 C10.5357408,7.27317585 10.3543728,7.45378298 10.1430099,7.59410043 L3.99134364,11.678006 C3.10718075,12.264975 1.91258801,12.0270588 1.32314609,11.1466052 C1.11243854,10.8318699 1,10.4620686 1,10.0838037 L1,1.91599264 C1,0.857819122 1.86143307,0 2.92406462,0 C3.30392305,0 3.67528233,0.11196683 3.99134364,0.321790399 Z",id:"Path-3"})));function Fc(e,t){var n=e.title,r=e.titleId,i=Sc(e,["title","titleId"]);return a.createElement("svg",Nc({width:"10px",height:"12px",viewBox:"0 0 10 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Ic,Lc)}var Pc=a.forwardRef(Fc);n.p;function Dc(){return(Dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Tc(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Rc=a.createElement("desc",null,"Created with Sketch."),Bc=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/direction/cash-out",transform:"translate(-1.000000, 0.000000)",fill:"#5A67FF"},a.createElement("path",{d:"M3.99134364,0.321790399 L10.1430099,4.40569595 C11.0271728,4.99266501 11.2660914,6.1822461 10.6766494,7.06269968 C10.5357408,7.27317585 10.3543728,7.45378298 10.1430099,7.59410043 L3.99134364,11.678006 C3.10718075,12.264975 1.91258801,12.0270588 1.32314609,11.1466052 C1.11243854,10.8318699 1,10.4620686 1,10.0838037 L1,1.91599264 C1,0.857819122 1.86143307,0 2.92406462,0 C3.30392305,0 3.67528233,0.11196683 3.99134364,0.321790399 Z",id:"Path-3",transform:"translate(6.000000, 6.000000) scale(-1, 1) translate(-6.000000, -6.000000) "})));function Ac(e,t){var n=e.title,r=e.titleId,i=Tc(e,["title","titleId"]);return a.createElement("svg",Dc({width:"10px",height:"12px",viewBox:"0 0 10 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Rc,Bc)}var Mc,Wc=a.forwardRef(Ac),zc=(n.p,{headerLabels:{display:"flex",flexDirection:"row","& > div:first-child":{display:"flex",alignItems:"center",marginLeft:0},"& > div":{display:"flex",alignItems:"center",marginLeft:25},"& > div:last-child":{display:"flex",alignItems:"center",marginLeft:64},"& > div > span":{extend:Me.label1,marginLeft:7}},root:{flexGrow:1,display:"flex",marginBottom:120},emptyMachinesRoot:{height:300,backgroundColor:G,border:"solid 2px ".concat(X)},card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K,flex:1,marginRight:24},container:{display:"flex",justifyContent:"space-between"},button:{color:J,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"}},upperButtonLabel:{textAlign:"center",marginBottom:0,marginTop:0,marginLeft:8},alertsCard:{marginBottom:8},h4:{marginTop:0},centerLabel:{marginTop:40,marginBottom:0},systemStatusCard:{flex:1,marginTop:8},expandedCard:{flex:.9},shrunkCard:{flex:.1},displayFlex:{display:"flex",flexDirection:"column"},inline:{display:"inline"},emptyMachinesContent:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center","& > :first-child":{marginTop:0},"& > *":{marginTop:25}},offColor:{color:de}}),qc=n(38),$c=n.n(qc),Hc=n(98),Vc=n(1033),Uc=n(1034),Gc=n(555),Xc=n(1035),_c=n(1036),Zc="advanced",Kc="cashOut",Qc="wallets",Yc="operatorInfo",Jc="notifications",es="locale",ts="commissions",ns="receipt",as="coinAtmRadar",rs="termsConditions",is="triggersConfig",os=Vc.a((function(e,t){return Uc.a(T.a(Gc.a(0,e),Xc.a(t)))})),ls=Vc.a((function(e,t){return Uc.a(M.a((function(t){return e(t[0])}),Xc.a(t)))})),cs=Vc.a((function(e,t){return _c.a(e,t)?t.slice(e.length):t})),ss=Vc.a((function(e,t){return F.a(function(e){return os(cs("".concat(e,"_")))}(e),function(e){return ls(_c.a("".concat(e,"_")))}(e))(t)})),ds=Vc.a((function(e,t){return os((function(t){return"".concat(e,"_").concat(t)}))(t)})),us={label:{color:se},headerLabels:{whiteSpace:"pre",display:"flex",flexDirection:"row",marginTop:-20},headerLabel:{display:"flex",alignItems:"center"},txOutMargin:{marginLeft:24},tickerLabel:{color:se,marginTop:-5},footer1:{left:0,bottom:0,position:"fixed",width:"100vw",backgroundColor:K,textAlign:"left",zIndex:1,boxShadow:"0px -1px 10px 0px rgba(50, 50, 50, 0.1)",minHeight:96,transition:"min-height 0.5s ease-out","&:hover":{transition:"min-height 0.5s ease-in",minHeight:200}},content1:{width:1200,maxHeight:100,backgroundColor:K,zIndex:2,bottom:-8,margin:"0 auto"}},ms=x()(Mc||(Mc=Object(c.a)(["\n query getData {\n cryptoRates\n cryptoCurrencies {\n code\n display\n }\n config\n accountsConfig {\n code\n display\n }\n }\n"])));$c.a.config({ROUNDING_MODE:$c.a.ROUND_HALF_UP});var hs=Object(f.a)(us),ps=function(){var e,t,n,a,r,i=Object(u.c)(ms).data,o=null!==(e=A.a(["cryptoRates","withCommissions"])(i))&&void 0!==e?e:{},l=hs(),c=null!==(t=A.a(["config"])(i))&&void 0!==t?t:{},s=(Hc.a(o).length,ss("wallets")(c)),d=null!==(n=A.a(["cryptoCurrencies"])(i))&&void 0!==n?n:[],m=null!==(a=A.a(["accountsConfig"])(i))&&void 0!==a?a:[],p=null!==(r=A.a(["locale_fiatCurrency"])(c))&&void 0!==r?r:"";return Object(qe.jsx)("div",{className:l.footer1,children:Object(qe.jsx)("div",{className:l.content1,children:Object(qe.jsx)(h.a,{container:!0,children:Object(qe.jsx)(h.a,{container:!0,className:l.footerContainer1,children:Hc.a(o).map((function(e){return function(e){var t=fl.a(W.a("code",e))(d),n=s["".concat(e,"_ticker")],a=fl.a(W.a("code",n))(m),r=a>-1?m[a].display:"",o=parseFloat(A.a(["cryptoRates","withoutCommissions",e,"cashIn"])(i)),c=parseFloat(A.a(["cryptoRates","withoutCommissions",e,"cashOut"])(i)),u=new $c.a((o+c)/2).toFormat(2),b=new $c.a(parseFloat(A.a(["cryptoRates","withCommissions",e,"cashIn"])(i))).toFormat(2),f=new $c.a(parseFloat(A.a(["cryptoRates","withCommissions",e,"cashOut"])(i))).toFormat(2);return Object(qe.jsxs)(h.a,{item:!0,xs:3,children:[Object(qe.jsx)(rt,{className:l.label,children:d[t].display}),Object(qe.jsxs)("div",{className:l.headerLabels,children:[Object(qe.jsxs)("div",{className:l.headerLabel,children:[Object(qe.jsx)(Pc,{}),Object(qe.jsx)(rt,{children:" ".concat(b," ").concat(p)})]}),Object(qe.jsxs)("div",{className:I()(l.headerLabel,l.txOutMargin),children:[Object(qe.jsx)(Wc,{}),Object(qe.jsx)(rt,{children:" ".concat(f," ").concat(p)})]})]}),Object(qe.jsx)(rt,{className:l.tickerLabel,children:"".concat(r,": ").concat(u," ").concat(p)})]},e)}(e)}))})})})})},bs=n(1041),fs=n(1148),js=n(1042),gs=n(163),Os=n(1120);function xs(){return(xs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function vs(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ys=a.createElement("defs",null,a.createElement("circle",{id:"path-100",cx:80,cy:80,r:80}),a.createElement("rect",{id:"path-300",x:28,y:44,width:104,height:116,rx:4}),a.createElement("filter",{x:"-23.1%",y:"-20.7%",width:"146.2%",height:"141.4%",filterUnits:"objectBoundingBox",id:"filter-4"},a.createElement("feOffset",{dx:0,dy:0,in:"SourceAlpha",result:"shadowOffsetOuter1"}),a.createElement("feGaussianBlur",{stdDeviation:8,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),a.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0",type:"matrix",in:"shadowBlurOuter1"})),a.createElement("rect",{id:"path-5",x:37,y:66,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-6",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-5"})),a.createElement("rect",{id:"path-7",x:37,y:78,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-8",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-7"})),a.createElement("rect",{id:"path-9",x:37,y:90,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-10",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-9"})),a.createElement("rect",{id:"path-11",x:37,y:102,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-12",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-11"}))),ws=a.createElement("g",{id:"\\u21B3-v13a",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"transactions_v13a#1-(empty-table)",transform:"translate(-640.000000, -220.000000)"},a.createElement("g",{id:"Group-2",transform:"translate(640.000000, 220.000000)"},a.createElement("g",{id:"Rectangle"},a.createElement("mask",{id:"mask-200",fill:"white"},a.createElement("use",{xlinkHref:"#path-100"})),a.createElement("use",{id:"Mask",fill:"#EBEFFF",xlinkHref:"#path-100"}),a.createElement("g",{mask:"url(#mask-200)"},a.createElement("use",{fill:"black",fillOpacity:1,filter:"url(#filter-4)",xlinkHref:"#path-300"}),a.createElement("use",{fill:"#FFFFFF",fillRule:"evenodd",xlinkHref:"#path-300"}))),a.createElement("use",{id:"Rectangle",stroke:"#5F668A",mask:"url(#mask-6)",strokeDasharray:1,xlinkHref:"#path-5"}),a.createElement("use",{id:"Rectangle-Copy",stroke:"#5F668A",mask:"url(#mask-8)",strokeDasharray:1,xlinkHref:"#path-7"}),a.createElement("use",{id:"Rectangle-Copy-2",stroke:"#5F668A",mask:"url(#mask-10)",strokeDasharray:1,xlinkHref:"#path-9"}),a.createElement("use",{id:"Rectangle-Copy-3",stroke:"#5F668A",mask:"url(#mask-12)",strokeDasharray:1,xlinkHref:"#path-11"}),a.createElement("rect",{id:"Rectangle",fill:"#EBEFFF",x:37,y:56,width:84,height:6,rx:2}))));function Cs(e,t){var n=e.title,r=e.titleId,i=vs(e,["title","titleId"]);return a.createElement("svg",xs({width:"160px",height:"160px",viewBox:"0 0 160 160",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,ys,ws)}var ks=a.forwardRef(Cs),Es=(n.p,Object(f.a)({emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}})),Ns=Object(a.memo)((function(e){var t=e.message,n=e.className,a=Es();return Object(qe.jsxs)("div",{className:I()(n,a.emptyTable),children:[Object(qe.jsx)(ks,{}),Object(qe.jsx)(_e,{children:t})]})})),Ss=Object(f.a)({table:{tableLayout:"fixed",borderCollapse:"separate",borderSpacing:"0 0"}}),Is=Object(a.memo)((function(e){var t=e.className,n=e.children,a=Object(q.a)(e,["className","children"]),r=Ss();return Object(qe.jsx)("table",Object(s.a)(Object(s.a)({},a),{},{className:I()(r.table,t),children:n}))})),Ls=Object(a.memo)((function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)("tbody",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),Fs=Object(f.a)({td:{padding:[[0,24]]},alignRight:{textAlign:"right"}}),Ps=Object(a.memo)((function(e){var t,n=e.colspan,a=e.rightAlign,r=e.className,i=e.children,o=Object(q.a)(e,["colspan","rightAlign","className","children"]),l=Fs(),c=(t={},Object(z.a)(t,l.td,!0),Object(z.a)(t,l.alignRight,a),t);return Object(qe.jsx)("td",Object(s.a)(Object(s.a)({colSpan:n,className:I()(c,r)},o),{},{children:i}))})),Ds=Object(a.memo)((function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)("thead",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),Ts=Me.tl2,Rs=Object(f.a)({th:{extend:Ts,backgroundColor:Te,height:Fe,textAlign:"left",color:K,padding:"0 ".concat(24,"px")},alignRight:{textAlign:"right"}}),Bs=Object(a.memo)((function(e){var t,n=e.rightAlign,a=e.children,r=e.className,i=Object(q.a)(e,["rightAlign","children","className"]),o=Rs(),l=(t={},Object(z.a)(t,o.th,!0),Object(z.a)(t,o.alignRight,n),t);return Object(qe.jsx)("th",Object(s.a)(Object(s.a)({},i),{},{className:I()(l,r),children:a}))})),As=Me.info2,Ms=Me.p,Ws=Object(f.a)({tr:{extend:Ms,padding:4,height:Pe,backgroundColor:"#ffffff"},lg:{extend:As,height:76},sm:{height:30},error:{backgroundColor:Re},success:{backgroundColor:Be}}),zs=Object(a.memo)((function(e){var t,n=e.className,a=e.children,r=e.header,i=e.error,o=e.success,l=e.size,c=void 0===l?"sm":l,d=Object(q.a)(e,["className","children","header","error","success","size"]),u=Ws(),m=(t={},Object(z.a)(t,u.tr,!r),Object(z.a)(t,u.sm,!r&&"sm"===c),Object(z.a)(t,u.lg,!r&&"lg"===c),Object(z.a)(t,u.error,i),Object(z.a)(t,u.success,o),t);return Object(qe.jsx)("tr",Object(s.a)(Object(s.a)({className:I()(m,n)},d),{},{children:a}))}));function qs(){return(qs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Hs=a.createElement("g",{id:"icon/label/icon/down",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6"},a.createElement("circle",{id:"Oval",fill:"#FFECEB",cx:6,cy:6,r:6}),a.createElement("g",{id:"Group-5",transform:"translate(6.096194, 6.096194) rotate(-315.000000) translate(-6.096194, -6.096194) translate(2.596194, 3.096194)",stroke:"#FF584A"},a.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),a.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function Vs(e,t){var n=e.title,r=e.titleId,i=$s(e,["title","titleId"]);return a.createElement("svg",qs({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Hs)}var Us=a.forwardRef(Vs);n.p;function Gs(){return(Gs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Xs(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _s=a.createElement("g",{id:"icon/label/icon/equal",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6",fill:"#EBEFFF"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:6})),a.createElement("g",{id:"Group",transform:"translate(4.000000, 4.000000)",stroke:"#5F668A",strokeLinecap:"square"},a.createElement("line",{x1:0,y1:1,x2:4,y2:1,id:"Line-12"}),a.createElement("line",{x1:0,y1:3,x2:4,y2:3,id:"Line-12"})));function Zs(e,t){var n=e.title,r=e.titleId,i=Xs(e,["title","titleId"]);return a.createElement("svg",Gs({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,_s)}var Ks=a.forwardRef(Zs);n.p;function Qs(){return(Qs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ys(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Js=a.createElement("g",{id:"icon/label/icon/up",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6"},a.createElement("circle",{id:"Oval",fill:"#ECFBEF",cx:6,cy:6,r:6}),a.createElement("g",{id:"Group-5",transform:"translate(6.096194, 6.096194) rotate(-45.000000) translate(-6.096194, -6.096194) translate(2.596194, 3.096194)",stroke:"#00CD5A"},a.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),a.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function ed(e,t){var n=e.title,r=e.titleId,i=Ys(e,["title","titleId"]);return a.createElement("svg",Qs({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Js)}var td,nd=a.forwardRef(ed),ad=(n.p,n(568)),rd=n(1037),id={"Pacific/Midway":{short:"SST",long:"Midway Island, Samoa"},"Pacific/Honolulu":{short:"HAST",long:"Hawaii"},"America/Juneau":{short:"AKST",long:"Alaska"},"America/Boise":{short:"MST",long:"Mountain Time"},"America/Dawson":{short:"MST",long:"Dawson, Yukon"},"America/Chihuahua":{short:null,long:"Chihuahua, La Paz, Mazatlan"},"America/Phoenix":{short:"MST",long:"Arizona"},"America/Chicago":{short:"CST",long:"Central Time"},"America/Regina":{short:"CST",long:"Saskatchewan"},"America/Mexico_City":{short:"CST",long:"Guadalajara, Mexico City, Monterrey"},"America/Belize":{short:"CST",long:"Central America"},"America/Detroit":{short:"EST",long:"Eastern Time"},"America/Bogota":{short:"COT",long:"Bogota, Lima, Quito"},"America/Caracas":{short:"VET",long:"Caracas, La Paz"},"America/Santiago":{short:"CLST",long:"Santiago"},"America/St_Johns":{short:"HNTN",long:"Newfoundland and Labrador"},"America/Sao_Paulo":{short:"BRT",long:"Brasilia"},"America/Tijuana":{short:"PST",long:"Tijuana"},"America/Montevideo":{short:"UYT",long:"Montevideo"},"America/Argentina/Buenos_Aires":{short:null,long:"Buenos Aires, Georgetown"},"America/Godthab":{short:null,long:"Greenland"},"America/Los_Angeles":{short:"PST",long:"Pacific Time"},"Atlantic/Azores":{short:"AZOT",long:"Azores"},"Atlantic/Cape_Verde":{short:"CVT",long:"Cape Verde Islands"},GMT:{short:"GMT",long:"UTC"},"Europe/London":{short:"GMT",long:"Edinburgh, London"},"Europe/Dublin":{short:"GMT",long:"Dublin"},"Europe/Lisbon":{short:"WET",long:"Lisbon"},"Africa/Casablanca":{short:"WET",long:"Casablanca, Monrovia"},"Atlantic/Canary":{short:"WET",long:"Canary Islands"},"Europe/Belgrade":{short:"CET",long:"Belgrade, Bratislava, Budapest, Ljubljana, Prague"},"Europe/Sarajevo":{short:"CET",long:"Sarajevo, Skopje, Warsaw, Zagreb"},"Europe/Brussels":{short:"CET",long:"Brussels, Copenhagen, Madrid, Paris"},"Europe/Amsterdam":{short:"CET",long:"Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"},"Africa/Algiers":{short:"CET",long:"West Central Africa"},"Europe/Bucharest":{short:"EET",long:"Bucharest"},"Africa/Cairo":{short:"EET",long:"Cairo"},"Europe/Helsinki":{short:"EET",long:"Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius"},"Europe/Athens":{short:"EET",long:"Athens, Istanbul, Minsk"},"Asia/Jerusalem":{short:"IST",long:"Jerusalem"},"Africa/Harare":{short:"CAT",long:"Harare, Pretoria"},"Europe/Moscow":{short:"MSK",long:"Moscow, St. Petersburg, Volgograd"},"Asia/Kuwait":{short:"AST",long:"Kuwait, Riyadh"},"Africa/Nairobi":{short:"EAT",long:"Nairobi"},"Asia/Baghdad":{short:"AST",long:"Baghdad"},"Asia/Tehran":{short:"IRST",long:"Tehran"},"Asia/Dubai":{short:"GST",long:"Abu Dhabi, Muscat"},"Asia/Baku":{short:"AZT",long:"Baku, Tbilisi, Yerevan"},"Asia/Kabul":{short:"AFT",long:"Kabul"},"Asia/Yekaterinburg":{short:"YEKT",long:"Ekaterinburg"},"Asia/Karachi":{short:"PKT",long:"Islamabad, Karachi, Tashkent"},"Asia/Kolkata":{short:"IST",long:"Chennai, Kolkata, Mumbai, New Delhi"},"Asia/Kathmandu":{short:null,long:"Kathmandu"},"Asia/Dhaka":{short:"BST",long:"Astana, Dhaka"},"Asia/Colombo":{short:"IST",long:"Sri Jayawardenepura"},"Asia/Almaty":{short:"ALMT",long:"Almaty, Novosibirsk"},"Asia/Rangoon":{short:null,long:"Yangon Rangoon"},"Asia/Bangkok":{short:"ICT",long:"Bangkok, Hanoi, Jakarta"},"Asia/Krasnoyarsk":{short:"KRAT",long:"Krasnoyarsk"},"Asia/Shanghai":{short:"CST",long:"Beijing, Chongqing, Hong Kong SAR, Urumqi"},"Asia/Kuala_Lumpur":{short:"MYT",long:"Kuala Lumpur, Singapore"},"Asia/Taipei":{short:"CST",long:"Taipei"},"Australia/Perth":{short:"AWST",long:"Perth"},"Asia/Irkutsk":{short:"IRKT",long:"Irkutsk, Ulaanbaatar"},"Asia/Seoul":{short:"KST",long:"Seoul"},"Asia/Tokyo":{short:"JST",long:"Osaka, Sapporo, Tokyo"},"Asia/Yakutsk":{short:"YAKT",long:"Yakutsk"},"Australia/Darwin":{short:"ACST",long:"Darwin"},"Australia/Adelaide":{short:"ACDT",long:"Adelaide"},"Australia/Sydney":{short:"AEDT",long:"Canberra, Melbourne, Sydney"},"Australia/Brisbane":{short:"AEST",long:"Brisbane"},"Australia/Hobart":{short:"AEDT",long:"Hobart"},"Asia/Vladivostok":{short:"VLAT",long:"Vladivostok"},"Pacific/Guam":{short:"ChST",long:"Guam, Port Moresby"},"Asia/Magadan":{short:"MAGT",long:"Magadan, Solomon Islands, New Caledonia"},"Asia/Kamchatka":{short:"PETT",long:"Kamchatka, Marshall Islands"},"Pacific/Fiji":{short:"FJT",long:"Fiji Islands"},"Pacific/Auckland":{short:"NZDT",long:"Auckland, Wellington"},"Pacific/Tongatapu":{short:null,long:"Nuku'alofa"}},od=function(e){var t=Xc.a(e);return gs.a((function(e,t){var n=Object(rd.a)(t[0])<0,a=Object(ad.a)({start:0,end:Math.abs(Object(rd.a)(t[0]))}),r=a.hours.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),i=a.minutes.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),o="(GMT".concat(n?"-":"+").concat(r,":").concat(i,")");return e.push({label:"".concat(o," - ").concat(t[1].long),code:t[0]}),e}),[],t)}(id),ld=n(1155),cd=n(1156),sd=n(1038),dd=function(e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone;return Object(ld.a)(t,e)},ud=function(e,t){var n=Intl.DateTimeFormat().resolvedOptions().timeZone;return Object(cd.a)(t,Object(ld.a)(n,e))},md=function(e,t,n){var a=Intl.DateTimeFormat().resolvedOptions().timeZone,r=Object(cd.a)(t,Object(ld.a)(a,e));return Object(sd.a)(n,r)},hd=function(e,t){return Object(sd.a)(t,e)},pd={wrapper:{display:"flex",height:142},percentageBox:{height:142,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"pre"},label:{color:K},inColor:{backgroundColor:_},outColor:{backgroundColor:Z},other:{minWidth:"6px",borderRadius:2},inWidth:{width:function(e){return"".concat(e,"%")},marginRight:function(e){return 100===e?0:4}},outWidth:{width:function(e){return"".concat(100-e,"%")}}},bd=Object(f.a)(pd),fd=function(e){var t,n=e.cashIn,a=e.cashOut,r=n||0!==a?n:50,i=bd(r),o=function(e){if(!(e<=15))return Object(qe.jsxs)(at,{className:i.label,children:[e,"%"]})},l=(t={},Object(z.a)(t,i.percentageBox,!0),Object(z.a)(t,i.other,r<5&&r>0),t);return Object(qe.jsxs)("div",{className:i.wrapper,children:[Object(qe.jsx)("div",{className:I()(l,i.inColor,i.inWidth),children:o(r)}),Object(qe.jsx)("div",{className:I()(l,i.outColor,i.outWidth),children:o(100-r)})]})},jd=n(28),gd=n(1039),Od=n(328),xd=n(1040),vd=function(e){var t=e.cashInFee?Number.parseFloat(e.cashInFee):0;return Number.parseFloat(e.commissionPercentage)*Number.parseFloat(e.fiat)+t},yd=function(e,t,n){return{created:new Date(new Date(e.created).getTime()+t).toISOString(),profit:n}},wd=function(e){var t=e.created;return new Date(t).toISOString().substring(0,10)},Cd=function(e){var t=e.created;return new Date(t).toISOString().substring(0,13)},kd=function(e,t){var n=e.profit||0;return Object(s.a)(Object(s.a)({},t),{},{profit:n+vd(t)})},Ed={Day:864e5,Week:6048e5,Month:2592e6},Nd=function(e){var t=e.data,n=e.previousTimeData,r=e.previousProfit,i=e.timeFrame,o=Object(a.useRef)(),c=Object(a.useCallback)((function(){var e=jd.select(o.current),a=0,c=0,s=0,d=336-s-c,u=140-a-0,m=function(){var e="Day"===i?Cd:wd,a=gd.a(Od.a(kd,[],e,t));if(!a.length&&!n.length){var o={created:(new Date).toISOString(),profit:0};return[[o,yd(o,-36e5,0)],!0]}if(!a.length&&n.length){var l={created:(new Date).toISOString(),profit:0};return[[l,yd(l,-Ed[i],1)],!1]}if(a.length&&!n.length){var c={created:(new Date).toISOString(),profit:1};return[[c,yd(c,-Ed[i],0)],!1]}return 1===a.length?[xd.a({created:new Date(Date.now()-Ed[i]).toISOString(),profit:r},a),!1]:[a,!1]}(),h=Object(l.a)(m,2),p=h[0],b=h[1];e.attr("width",d),e.append("rect").attr("x",0).attr("y",-a).attr("width",d+s+c).attr("height",u+a).attr("fill",ae).attr("transform","translate(".concat(0,",",a,")")),e.append("linearGradient").attr("id","area-gradient").attr("gradientUnits","userSpaceOnUse").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2","100%").selectAll("stop").data([{offset:"0%",color:G},{offset:"25%",color:G},{offset:"100%",color:ae}]).enter().append("stop").attr("offset",(function(e){return e.offset})).attr("stop-color",(function(e){return e.color}));var f=e.append("g").attr("transform","translate(".concat(s,",").concat(a,")")),j=jd.extent(p,(function(e){return e.created})),g=b?[0,.1]:[0,jd.max(p,(function(e){return e.profit}))],O=jd.scaleLinear().range([u,40]).domain([0,g[1]]),x=jd.scaleTime().domain([new Date(j[0]),new Date(j[1])]).range([0,d]),v=jd.line().x((function(e){return x(new Date(e.created))})).y((function(e){return O(e.profit)})),y=jd.area().x((function(e){return x(new Date(e.created))})).y0(u).y1((function(e){return O(e.profit)}));f.append("path").datum(p).attr("d",y).attr("fill","url(#area-gradient)"),f.append("path").datum(p).attr("d",v).attr("fill","none").attr("stroke-width","2").attr("stroke-linejoin","round").attr("stroke",J)}),[t,i,n,r]);return Object(a.useEffect)((function(){jd.select(o.current).selectAll("*").remove(),c()}),[c,t]),Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)("svg",{ref:o})})},Sd=n(1145),Id=n(1146),Ld=n(1147),Fd=6e4,Pd=864e5,Dd=6048e5,Td=2592e6,Rd=function(e){var t,n=e.data,r=e.timeFrame,i=e.timezone,o=Object(a.useRef)(null),l=250,c=555,s=Object(a.useMemo)((function(){return{top:20,right:.5,bottom:27,left:43.5}}),[]),d=Object(rd.a)(i),u=Date.now()+d,m={Day:[u-Pd,u],Week:[u-Dd,u],Month:[u-Td,u]},h=Object(a.useMemo)((function(){return{Day:{freq:24,step:36e5,tick:jd.utcHour.every(4),labelFormat:"%H:%M"},Week:{freq:7,step:864e5,tick:jd.utcDay.every(1),labelFormat:"%a %d"},Month:{freq:30,step:864e5,tick:jd.utcDay.every(2),labelFormat:"%d"}}}),[]),p=Object(a.useCallback)((function(e){return"day"===r?0===e.getUTCHours():1===e.getUTCDate()}),[r]),b=Object(a.useCallback)((function(e){var t=new Date(e),n=t.getUTCDate(),a=t.getUTCDay(),r=t.getUTCMonth(),i=new Date(t.getTime());i.setUTCDate(n-1);var o=i.getUTCDate(),l=i.getUTCDay(),c=i.getUTCMonth(),s=Array.from(Array(7)).map((function(e,t){return Object(sd.a)("EEE",Object(Sd.a)({days:t},Object(Id.a)(new Date)))})),d=Array.from(Array(12)).map((function(e,t){return Object(sd.a)("LLL",Object(Sd.a)({months:t},Object(Ld.a)(new Date)))}));return{previous:r!==c?d[c]:"".concat(s[l]," ").concat(o),current:r!==c?d[r]:"".concat(s[a]," ").concat(n)}}),[]),f=Object(a.useCallback)((function(e){for(var t=[],n=function(e){var t=h[r].step;return new Date(Math.ceil(e.valueOf()/t)*t)},a=0;a<=h[r].freq;a++){var i=new Date(u-a*h[r].step);n(i)>e[1]||(i<e[0]||t.push(n(i)))}return t}),[u,h,r]),j=jd.scaleUtc().domain(m[r]).range([s.left,c-s.right]),g=jd.scaleLinear().domain([0,1.05*(null!==(t=jd.max(n,(function(e){return new $c.a(e.fiat).toNumber()})))&&void 0!==t?t:1e3)]).nice().range([l-s.bottom,s.top]),O=Object(a.useCallback)((function(e){e.append("rect").attr("x",0).attr("y",s.top).attr("width",c).attr("height",l-s.top-s.bottom).attr("fill",ae)}),[s]),x=Object(a.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(l-s.bottom,")")).call(jd.axisBottom(j).ticks(h[r].tick).tickFormat((function(e){return jd.timeFormat(h[r].labelFormat)(e.getTime()+e.getTimezoneOffset()*Fd)}))).call((function(e){return e.select(".domain").remove()}))}),[s,h,r,j]),v=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(s.left,", 0)")).call(jd.axisLeft(g).ticks(5)).call((function(e){return e.select(".domain").remove()})).selectAll("text").attr("dy","-0.25rem")}),[s,g]),y=Object(a.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(f(j.domain())).join("line").attr("x1",(function(e){return.5+j(e)})).attr("x2",(function(e){return.5+j(e)})).attr("y1",s.top).attr("y2",l-s.bottom).attr("stroke-width",1)})).call((function(e){return e.append("g").selectAll("line").data(jd.axisLeft(g).scale().ticks(5)).join("line").attr("y1",(function(e){return.5+g(e)})).attr("y2",(function(e){return.5+g(e)})).attr("x1",s.left).attr("x2",c-s.right)})).call((function(e){return e.append("g").selectAll("line").data(f(j.domain()).filter(p)).join("line").attr("class","dateSeparator").attr("x1",(function(e){return.5+j(e)})).attr("x2",(function(e){return.5+j(e)})).attr("y1",s.top-10).attr("y2",l-s.bottom).attr("stroke-width",2).join("text")})).call((function(e){var t,n,a=null===jd||void 0===jd||null===(t=jd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var r=f(j.domain()).filter(p),i=b(r);return e.append("text").attr("x",a.x-7).attr("y",a.y).attr("text-anchor","end").attr("dy",".25em").text(i.previous)}})).call((function(e){var t,n,a=null===jd||void 0===jd||null===(t=jd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var r=f(j.domain()).filter(p),i=b(r);return e.append("text").attr("x",a.x+7).attr("y",a.y).attr("text-anchor","start").attr("dy",".25em").text(i.current)}}))}),[s,f,b,j,g,p]),w=Object(a.useCallback)((function(){return jd.selectAll(".tick text").style("stroke",se).style("fill",se).style("stroke-width",0).style("font-family",ge)}),[]),C=Object(a.useCallback)((function(){return jd.selectAll("text").style("stroke",se).style("fill",se).style("stroke-width",0).style("font-family",ge)}),[]),k=Object(a.useCallback)((function(){jd.selectAll(".tick line").style("stroke","transparent").style("fill","transparent")}),[]),E=Object(a.useCallback)((function(e){e.selectAll("circle").data(n).join("circle").attr("cx",(function(e){var t=new Date(e.created);return j(t.setTime(t.getTime()+d))})).attr("cy",(function(e){return g(new $c.a(e.fiat).toNumber())})).attr("fill",(function(e){return"cashIn"===e.txClass?_:Z})).attr("r",3.5)}),[n,d,j,g]),N=Object(a.useCallback)((function(){var e=jd.select(o.current).attr("viewBox",[0,0,c,l]);return e.append("g").call(O),e.append("g").call(y),e.append("g").call(x),e.append("g").call(v),e.append("g").call(w),e.append("g").call(C),e.append("g").call(k),e.append("g").call(E),e.node()}),[O,y,x,v,E,C,k,w]);return Object(a.useEffect)((function(){jd.select(o.current).selectAll("*").remove(),N()}),[N]),Object(qe.jsx)("svg",{ref:o})},Bd=function(e){var t=e.info,n=e.label;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Qe,{style:{marginBottom:0},children:t}),Object(qe.jsx)(at,{style:{margin:0},children:n})]})},Ad={titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},titleAndButtonsContainer:{display:"flex"},error:{marginLeft:12},icon:{marginRight:6},h4:{margin:0,marginRight:64},label:{cursor:"pointer",minHeight:0,minWidth:0,padding:0,color:se,textTransform:"none",borderBottom:"2px solid transparent",display:"inline-block",lineHeight:1.5,"&:hover":{backgroundColor:"transparent"}},newHighlightedLabel:{cursor:"pointer",color:J,fontWeight:700,borderRadius:0,minHeight:0,minWidth:0,textTransform:"none",borderBottom:"2px solid ".concat(J),display:"inline-block",lineHeight:1.5,"&:hover":{backgroundColor:"transparent"}},navButton:{marginLeft:24},navContainer:{display:"flex"},percentUp:{fontSize:ye,fontFamily:ge,fontWeight:700,color:U,height:10},percentDown:{fontSize:ye,fontFamily:ge,fontWeight:700,color:Q,height:13},percentNeutral:{fontSize:ye,fontFamily:ge,fontWeight:700,color:$},profitContainer:{display:"flex",justifyContent:"space-between",margin:"23px 26px -30px 16px",position:"relative"},profitLabel:{fontSize:ye,fontFamily:ge,fontWeight:700,color:ce},directionIcon:{width:16,height:16,marginBottom:-2,marginRight:4},emptyTransactions:{paddingTop:40},commissionProfitTitle:{marginBottom:16},graphHeader:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:16},labelWrapper:{display:"flex",flexDirection:"row",alignItems:"center","& > div":{display:"flex",flexDirection:"row",alignItems:"center",marginLeft:15,"&:first-child":{marginLeft:0},"& > p":{marginLeft:8}}},txGraphContainer:{height:300,marginTop:30},commissionsGraphContainer:{height:250,marginTop:30},verticalLine:{height:15,width:1,backgroundColor:de,marginLeft:31,marginRight:16}},Md=Object(f.a)(Ad),Wd=["Month","Week","Day"],zd=function(e){var t=e.handleSetRange,n=e.showPicker,r=Md(),i=Object(a.useState)("Day"),o=Object(l.a)(i,2),c=o[0],s=o[1],d=gn.a(c);return Object(qe.jsxs)("div",{className:I()(r.titleWrapper),children:[Object(qe.jsx)("div",{className:r.titleAndButtonsContainer,children:Object(qe.jsx)(_e,{className:r.h4,children:"System performance"})}),n&&Object(qe.jsx)("div",{className:r.navContainer,children:Wd.map((function(e,n){return Object(qe.jsx)("div",{onClick:function(e){return n=e.target.innerText,s(n),void t(n);var n},className:d(e)?I()(r.newHighlightedLabel,r.navButton):I()(r.label,r.navButton),children:e},n)}))})]})};$c.a.config({ROUNDING_MODE:$c.a.ROUND_HALF_UP});var qd=T.a(R.a("fiat")),$d=Object(f.a)(Ad),Hd=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?new Date(t):new Date;return Object(bs.a)({seconds:e},n)},Vd={Day:{left:Hd(172800,new Date),right:Hd(86400,new Date)},Week:{left:Hd(1209600,new Date),right:Hd(604800,new Date)},Month:{left:Hd(5184e3,new Date),right:Hd(2592e3,new Date)}},Ud=x()(td||(td=Object(c.a)(["\n query getData($excludeTestingCustomers: Boolean) {\n transactions(excludeTestingCustomers: $excludeTestingCustomers) {\n fiatCode\n fiat\n cashInFee\n commissionPercentage\n created\n txClass\n error\n profit\n }\n fiatRates {\n code\n name\n rate\n }\n config\n }\n"]))),Gd=function(){var e,t,n,r,i,o,c=$d(),d=Object(a.useState)("Day"),m=Object(l.a)(d,2),p=m[0],b=m[1],f=Object(u.c)(Ud,{variables:{excludeTestingCustomers:!0}}),j=f.data,g=f.loading,O=ss("locale")(null===j||void 0===j?void 0:j.config).fiatCurrency,x=ss("locale")(null===j||void 0===j?void 0:j.config).timezone,v=function(e){return function(t){return null===t.error&&(e?null===t.error&&Object(fs.a)(Vd[p].left,ud(t.created,x))&&Object(fs.a)(ud(t.created,x),Vd[p].right):null===t.error&&Object(fs.a)(Vd[p].right,ud(t.created,x))&&Object(fs.a)(ud(t.created,x),new Date))}},y=function(e){if(e.fiatCode===O)return e;var t=Aa.a(W.a("code",e.fiatCode))(j.fiatRates),n=Aa.a(W.a("code",O))(j.fiatRates).rate/t.rate;return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*n})},w=T.a(y)(M.a(v(!1),null!==(e=null===j||void 0===j?void 0:j.transactions)&&void 0!==e?e:[])),C=T.a(y)(M.a(v(!0),null!==(t=null===j||void 0===j?void 0:j.transactions)&&void 0!==t?t:[])),k=function(e){return gs.a((function(e,t){return e.plus(t.profit)}),new $c.a(0),e)},E=function(){var e=Os.a(W.a("txClass","cashIn"))(w),t=Object(l.a)(e,2),n=t[0],a=t[1],r=n.length+a.length;return 0===r?{cashIn:0,cashOut:0}:{cashIn:Math.round(n.length/r*100),cashOut:Math.round(a.length/r*100)}},N=function(){var e=k(w),t=k(C);return e.eq(t)?0:t.eq(0)?100:e.minus(t).times(100).div(t).toNumber()}(),S=(n={},Object(z.a)(n,c.percentDown,N<0),Object(z.a)(n,c.percentUp,N>0),Object(z.a)(n,c.percentNeutral,0===N),n);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(zd,{showPicker:!g&&!Wa.a(j.transactions),handleSetRange:b}),!g&&Wa.a(j.transactions)&&Object(qe.jsx)(Ns,{className:c.emptyTransactions,message:"No transactions so far"}),!g&&!Wa.a(j.transactions)&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(h.a,{container:!0,spacing:2,children:[Object(qe.jsx)(h.a,{item:!0,xs:3,children:Object(qe.jsx)(Bd,{info:bn.a(w),label:"transactions"})}),Object(qe.jsx)(h.a,{item:!0,xs:3,children:Object(qe.jsx)(Bd,{info:new $c.a(js.a(qd(w))).toFormat(2),label:"".concat(null===j||void 0===j?void 0:j.config.locale_fiatCurrency," volume")})})]}),Object(qe.jsx)(h.a,{container:!0,className:c.txGraphContainer,children:Object(qe.jsxs)(h.a,{item:!0,xs:12,children:[Object(qe.jsxs)("div",{className:c.graphHeader,children:[Object(qe.jsx)(rt,{noMargin:!0,children:"Transactions"}),Object(qe.jsxs)("div",{className:c.labelWrapper,children:[Object(qe.jsxs)(Ke,{noMargin:!0,children:[null!==(r=null===(i=id[x])||void 0===i?void 0:i.short)&&void 0!==r?r:null===(o=id[x])||void 0===o?void 0:o.long," ","timezone"]}),Object(qe.jsx)("span",{className:c.verticalLine}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:8,height:8,children:Object(qe.jsx)("rect",{width:8,height:8,rx:4,fill:_})}),Object(qe.jsx)(at,{noMargin:!0,children:"In"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:8,height:8,children:Object(qe.jsx)("rect",{width:8,height:8,rx:4,fill:Z})}),Object(qe.jsx)(at,{noMargin:!0,children:"Out"})]})]})]}),Object(qe.jsx)(Rd,{timeFrame:p,data:w,timezone:x})]})}),Object(qe.jsxs)(h.a,{container:!0,className:c.commissionGraphContainer,children:[Object(qe.jsxs)(h.a,{item:!0,xs:8,children:[Object(qe.jsx)(rt,{noMargin:!0,className:c.commissionProfitTitle,children:"Profit from commissions"}),Object(qe.jsxs)("div",{className:c.profitContainer,children:[Object(qe.jsx)("div",{className:c.profitLabel,children:"".concat(k(w).toFormat(2)," ").concat(null===j||void 0===j?void 0:j.config.locale_fiatCurrency)}),Object(qe.jsxs)("div",{className:I()(S),children:[0===N?Object(qe.jsx)(Ks,{className:c.directionIcon}):N>0?Object(qe.jsx)(nd,{className:c.directionIcon}):Object(qe.jsx)(Us,{className:c.directionIcon}),"".concat(new $c.a(N).toFormat(2),"%")]})]}),Object(qe.jsx)(Nd,{timeFrame:p,data:w,previousTimeData:C,previousProfit:k(C)})]}),Object(qe.jsxs)(h.a,{item:!0,xs:4,children:[Object(qe.jsxs)(h.a,{container:!0,className:c.graphHeader,children:[Object(qe.jsx)(rt,{noMargin:!0,children:"Direction"}),Object(qe.jsxs)("div",{className:c.labelWrapper,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:8,height:8,children:Object(qe.jsx)("rect",{width:8,height:8,rx:2,fill:_})}),Object(qe.jsx)(at,{noMargin:!0,children:"In"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:8,height:8,children:Object(qe.jsx)("rect",{width:8,height:8,rx:2,fill:Z})}),Object(qe.jsx)(at,{noMargin:!0,children:"Out"})]})]})]}),Object(qe.jsx)(h.a,{item:!0,xs:!0,children:Object(qe.jsx)(fd,{cashIn:E().cashIn,cashOut:E().cashOut})})]})]})]})]})},Xd=Object(f.a)(zc),_d=function(){var e=Xd();return Object(qe.jsx)(h.a,{item:!0,xs:12,className:e.displayFlex,children:Object(qe.jsx)("div",{className:e.card,children:Object(qe.jsx)(Gd,{})})})},Zd=n(1043),Kd=Object.freeze({DEFAULT:"default",SHRUNK:"shrunk",EXPANDED:"expanded"}),Qd={card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K}},Yd=Object(f.a)(Qd),Jd=function(e){var t=e.className,n=e.state,a=e.shrunkComponent,r=e.children,i=Yd();return Object(qe.jsx)(h.a,{item:!0,className:I()(t,i.card),children:n===Kd.SHRUNK?a:r})},eu={container:{display:"flex",justifyContent:"space-between"},h4:{margin:0,marginBottom:10},centerLabel:{marginBottom:0,padding:0,textAlign:"center"},upperButtonLabel:{marginTop:-3,marginBottom:24},button:{color:J,marginTop:0,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"}},alertsTableContainer:{margin:0},expandedAlertsTableContainer:{margin:0,maxHeight:460},noAlertsLabel:{color:$,marginLeft:-5,height:100},table:{maxHeight:465,overflowX:"hidden",overflowY:"auto"},listItemText:{margin:"8px 0 8px 0"},linkIcon:{marginLeft:"auto",cursor:"pointer"}},tu=n(1018),nu=n(973),au=n(104);function ru(){return(ru=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function iu(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ou=a.createElement("g",{id:"DASHBOARD",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"dashboard_v9#1-(week)",transform:"translate(-772.000000, -212.000000)"},a.createElement("g",{id:"dashboard/row/alert/positive",transform:"translate(756.000000, 204.000000)"},a.createElement("g",{id:"Group-2",transform:"translate(16.000000, 8.000000)"},a.createElement("polygon",{id:"Rectangle-2-Copy-45",fill:"#FF584A",fillRule:"nonzero",points:"0 11 16 11 16 16 0 16"}),a.createElement("rect",{id:"Rectangle-Copy-10",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:14,height:14})))));function lu(e,t){var n=e.title,r=e.titleId,i=iu(e,["title","titleId"]);return a.createElement("svg",ru({width:"16px",height:"16px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"07E3DD15-D5E4-46A8-BF7B-064F598230CE"):n?a.createElement("title",{id:r},n):null,ou)}var cu=a.forwardRef(lu);n.p;function su(){return(su=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function du(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var uu=a.createElement("defs",null,a.createElement("circle",{id:"path-1-right",cx:10,cy:10,r:10})),mu=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-232.000000, -187.000000)"},a.createElement("g",{id:"icon/sf-contain-b-copy-4",transform:"translate(242.000000, 197.000000) scale(-1, 1) rotate(-270.000000) translate(-242.000000, -197.000000) translate(232.000000, 187.000000)"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1-right"})),a.createElement("use",{id:"Mask",fill:"#EBEFFF",fillRule:"nonzero",xlinkHref:"#path-1-right"}),a.createElement("g",{id:"icon/sf-small/wizzard",mask:"url(#mask-2)",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function hu(e,t){var n=e.title,r=e.titleId,i=du(e,["title","titleId"]);return a.createElement("svg",su({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,uu,mu)}var pu,bu,fu,ju,gu=a.forwardRef(hu),Ou=(n.p,Object(f.a)(eu)),xu={error:Object(qe.jsx)(Yt,{style:{height:20,width:20,marginRight:12}}),fiatBalance:Object(qe.jsx)(cu,{style:{height:18,width:18,marginRight:14}})},vu={error:"/maintenance/machine-status",fiatBalance:"/maintenance/cash-cassettes",cryptoBalance:"/maintenance/funding"},yu=function(e){var t=e.numToRender,n=e.alerts,a=e.machines,r=Object(w.h)(),i=Ou(),o=au.a(0,t,n),l=function(e){var t=e.detail.deviceId;if(!t)return"".concat(e.message);var n=za.a("Unpaired device",a[t]);return"".concat(e.message," - ").concat(n)};return Object(qe.jsx)(tu.a,{dense:!0,className:i.table,children:o.map((function(e,t){return Object(qe.jsxs)(nu.a,{children:[xu[e.type]||Object(qe.jsx)(Mt,{style:{height:23,width:23,marginRight:8}}),Object(qe.jsx)(Ke,{className:i.listItemText,children:l(e)}),Object(qe.jsx)(gu,{className:i.linkIcon,onClick:function(){return r.push(vu[e.type]||"/dashboard")}})]},t)}))})},wu=x()(pu||(pu=Object(c.a)(["\n query getAlerts {\n alerts {\n id\n type\n detail\n message\n created\n read\n valid\n }\n machines {\n deviceId\n name\n }\n }\n"]))),Cu=Object(f.a)(eu),ku=function(e){var t,n,a,r=e.onReset,i=e.onExpand,o=e.size,l=Cu(),c=o===Kd.EXPANDED,s=Object(u.c)(wu).data,d=null!==(t=A.a(["alerts"])(s))&&void 0!==t?t:[],m=F.a(T.a(R.a("name")),B.a(R.a("deviceId")))(null!==(n=null===s||void 0===s?void 0:s.machines)&&void 0!==n?n:[]),p=d.length,b=(a={},Object(z.a)(a,l.alertsTableContainer,!c),Object(z.a)(a,l.expandedAlertsTableContainer,c),a);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:l.container,children:[Object(qe.jsx)(_e,{className:l.h4,children:"Alerts (".concat(p,")")}),c&&Object(qe.jsx)(at,{className:l.upperButtonLabel,children:Object(qe.jsx)(Zd.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:l.button,children:"Show less"})})]}),Object(qe.jsx)(h.a,{className:I()(b),container:!0,spacing:1,children:Object(qe.jsxs)(h.a,{item:!0,xs:12,children:[!d.length&&Object(qe.jsx)(at,{className:l.noAlertsLabel,children:"No new alerts. Your system is running smoothly."}),Object(qe.jsx)(yu,{numToRender:c?d.length:3,alerts:d,machines:m})]})}),!c&&p>3&&Object(qe.jsx)(h.a,{item:!0,xs:12,children:Object(qe.jsx)(at,{className:l.centerLabel,children:Object(qe.jsx)(Zd.a,{onClick:function(){return i("alerts")},size:"small",disableRipple:!0,disableFocusRipple:!0,className:l.button,children:"Show all (".concat(d.length,")")})})})]})},Eu=n(1046),Nu=n(1050),Su=n(1044),Iu=n(1045),Lu=n(1047),Fu=n(1048),Pu=n(570),Du=n(1049),Tu=n(301),Ru=n(1051),Bu={error:Q,warning:"#ff7311",success:ne,neutral:J},Au={error:Y,warning:"#fbf3ec",success:V,neutral:G},Mu=Object(f.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return Au[t]}},label:{fontSize:ke,fontWeight:Ie,fontFamily:Le,paddingRight:4,paddingLeft:4,color:function(e){var t=e.type;return Bu[t]}}}),Wu=function(e){var t=e.status,n=Mu({type:t.type});return Object(qe.jsx)(Ar.a,{type:t.type,label:t.label,classes:n})},zu=function(e){var t=e.statuses,n=t.find((function(e){return"error"===e.type}))||t.find((function(e){return"warning"===e.type}))||t[0],a={label:"+".concat(t.length-1),type:n.type};return Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Wu,{status:n}),t.length>1&&Object(qe.jsx)(Wu,{status:a})]})},qu={container:{display:"flex",justifyContent:"space-between"},label:{margin:0,color:se},row:{backgroundColor:ae,borderBottom:"none"},clickableRow:{cursor:"pointer"},header:{display:"flex",alignItems:"center",whiteSpace:"pre"},error:{color:he},button:{color:J,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"},marginBottom:-40},buttonLabel:{position:"absolute",bottom:160,marginBottom:0},upperButtonLabel:{textAlign:"center",marginBottom:0,marginTop:0},statusHeader:{marginLeft:2},table:{maxHeight:440,"&::-webkit-scrollbar":{width:7},"&::-webkit-scrollbar-thumb":{backgroundColor:se,borderRadius:5}},tableBody:{overflow:"auto"},h4:{marginTop:0},tl2:{display:"inline"},label1:{display:"inline"},machinesTableContainer:{marginTop:10,height:220},expandedMachinesTableContainer:{marginTop:10,height:414},centerLabel:{marginBottom:0,padding:0,textAlign:"center"},machineNameWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},machineRedirectIcon:{marginLeft:10}},$u=x()(bu||(bu=Object(c.a)(["\n query getConfig {\n config\n }\n"]))),Hu=Object(f.a)(qu),Vu=Object(Mr.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15}})(Su.a),Uu=Object(Mr.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15,backgroundColor:"white"}})(Su.a),Gu=function(e){var t,n=e.machines,a=void 0===n?[]:n,r=e.numToRender,i=Hu(),o=Object(w.h)(),l=Object(u.c)($u).data,c=ss("notifications",null!==(t=A.a(["config"],l))&&void 0!==t?t:{}),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return Math.round(e/t*100)},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500,a=s(t,n),r=Pu.a(A.a(["fillingPercentageCassette".concat(e)]),za.a(20))(c);return a<r?Object(qe.jsx)(nt,{className:i.error,children:"".concat(a,"%")}):Object(qe.jsx)(nt,{children:"".concat(a,"%")})},h=function(e){var t=e.name,n=e.deviceId;return o.push("/machines/".concat(n),{selectedMachine:t})},p=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),a)).concat([0]));return Object(qe.jsx)(Iu.a,{className:i.table,children:Object(qe.jsxs)(Eu.a,{children:[Object(qe.jsx)(Lu.a,{children:Object(qe.jsxs)(Fu.a,{children:[Object(qe.jsx)(Uu,{children:Object(qe.jsx)("div",{className:i.header,children:Object(qe.jsx)(rt,{className:i.label,children:"Machines"})})}),Object(qe.jsx)(Uu,{children:Object(qe.jsx)("div",{className:"".concat(i.header," ").concat(i.statusHeader),children:Object(qe.jsx)(rt,{className:i.label,children:"Status"})})}),T.a((function(e){return Object(qe.jsx)(Uu,{children:Object(qe.jsxs)("div",{className:i.header,children:[Object(qe.jsx)(Wc,{}),Object(qe.jsxs)(rt,{className:i.label,children:[" ",e+1]})]})})}),Du.a(Tu.a,p))]})}),Object(qe.jsx)(Nu.a,{children:a.map((function(e,t){return t<r?Object(qe.jsxs)(Fu.a,{onClick:function(){return h(e)},className:I()(i.row),children:[Object(qe.jsx)(Vu,{align:"left",children:Object(qe.jsxs)("div",{className:i.machineNameWrapper,children:[Object(qe.jsx)(nt,{children:e.name}),Object(qe.jsx)(gu,{className:I()(i.machineRedirectIcon,i.clickableRow),onClick:function(){return h(e)}})]})}),Object(qe.jsx)(Vu,{children:Object(qe.jsx)(Wu,{status:e.statuses[0]})}),T.a((function(t){return e.numberOfCassettes>=t?Object(qe.jsx)(Vu,{align:"left",children:m(t,e["cassette".concat(t)])}):Object(qe.jsx)(Vu,{align:"left",children:Object(qe.jsx)(nt,{children:"\u2014 %"})})}),Ru.a(1,p+1))]},e.deviceId+t):null}))})]})})},Xu=Object(f.a)(qu),_u=x()(fu||(fu=Object(c.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n statuses {\n label\n type\n }\n }\n serverVersion\n uptime {\n name\n state\n uptime\n }\n }\n"]))),Zu=function(e){var t,n,a=e.onReset,r=e.onExpand,i=e.size,o=Xu(),l=Object(u.c)(_u),c=l.data,s=l.loading,d=null!==(t=A.a(["machines"])(c))&&void 0!==t?t:[],m=i===Kd.EXPANDED,p=(n={},Object(z.a)(n,o.machinesTableContainer,!m),Object(z.a)(n,o.expandedMachinesTableContainer,m),n);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:o.container,children:[Object(qe.jsx)(_e,{className:o.h4,children:"System status"})," ",m&&Object(qe.jsx)(at,{className:o.upperButtonLabel,children:Object(qe.jsx)(Zd.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show less"})})]}),!s&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(h.a,{container:!0,spacing:1,children:[Object(qe.jsxs)(h.a,{item:!0,xs:4,children:[Object(qe.jsx)(nt,{className:o.tl2,children:null===c||void 0===c?void 0:c.serverVersion}),Object(qe.jsx)(at,{className:o.label1,children:" server version"})]}),Object(qe.jsx)(h.a,{item:!0,xs:4})]}),Object(qe.jsx)(h.a,{container:!0,spacing:1,className:I()(p),children:Object(qe.jsx)(h.a,{item:!0,xs:12,children:Object(qe.jsx)(Gu,{numToRender:m?1/0:4,machines:d})})}),!m&&d.length>4&&Object(qe.jsx)(h.a,{item:!0,xs:12,children:Object(qe.jsx)(at,{className:o.centerLabel,children:Object(qe.jsx)(Zd.a,{onClick:function(){return r()},size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show all (".concat(d.length,")")})})})]})]})},Ku=Object(f.a)(zc),Qu=function(e){var t=e.title,n=e.buttonName,a=e.onUnshrink,r=Ku();return Object(qe.jsxs)("div",{className:r.container,children:[Object(qe.jsx)(_e,{className:r.h4,children:t}),Object(qe.jsx)(at,{className:r.upperButtonLabel,children:Object(qe.jsx)(Zd.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:r.button,children:n})})]})},Yu=function(){var e,t,n=Ku(),r=Object(a.useState)(Kd.DEFAULT),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(Kd.DEFAULT),d=Object(l.a)(s,2),u=d[0],m=d[1],p=function(){m(Kd.DEFAULT),c(Kd.DEFAULT)};return Object(qe.jsx)(h.a,{item:!0,xs:12,className:n.displayFlex,children:Object(qe.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Jd,{className:I()((e={},Object(z.a)(e,n.alertsCard,u!==Kd.SHRUNK),Object(z.a)(e,n.shrunkCard,u===Kd.SHRUNK),Object(z.a)(e,n.expandedCard,u===Kd.EXPANDED),e)),state:u,shrunkComponent:Object(qe.jsx)(Qu,{title:"Alerts",buttonName:"Show alerts",onUnshrink:p}),children:Object(qe.jsx)(ku,{onExpand:function(){m(Kd.EXPANDED),c(Kd.SHRUNK)},onReset:p,size:u})}),Object(qe.jsx)(Jd,{className:I()((t={},Object(z.a)(t,n.shrunkCard,o===Kd.SHRUNK),Object(z.a)(t,n.systemStatusCard,o!==Kd.SHRUNK),Object(z.a)(t,n.expandedCard,u===Kd.EXPANDED),t)),state:o,shrunkComponent:Object(qe.jsx)(Qu,{title:"System status",buttonName:"Show machines",onUnshrink:p}),children:Object(qe.jsx)(Zu,{onExpand:function(){c(Kd.EXPANDED),m(Kd.SHRUNK)},onReset:p,size:o})})]})})})},Ju=Object(f.a)(zc),em=x()(ju||(ju=Object(c.a)(["\n query getData {\n machines {\n name\n }\n serverVersion\n }\n"]))),tm=function(){var e=Object(w.h)(),t=Ju(),n=Object(a.useState)(!1),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Object(u.c)(em),s=c.data;return c.loading?Object(qe.jsx)(qe.Fragment,{}):Wa.a(s.machines)?Object(qe.jsxs)(qe.Fragment,{children:[i&&Object(qe.jsx)(oo,{close:function(){return o(!1)},onPaired:function(t){o(!1),e.push("/maintenance/machine-status",{id:t.deviceId})}}),Object(qe.jsx)(ll,{title:"Dashboard",children:Object(qe.jsx)("div",{className:t.headerLabels,children:Object(qe.jsxs)("span",{children:[Object(qe.jsx)(nt,{className:t.inline,children:null===s||void 0===s?void 0:s.serverVersion})," ",Object(qe.jsx)(at,{className:t.inline,children:" server version"})]})})}),Object(qe.jsx)("div",{className:t.emptyMachinesRoot,children:Object(qe.jsxs)("div",{className:t.emptyMachinesContent,children:[Object(qe.jsx)(Ue,{className:t.offColor,children:"No machines on your system yet"}),Object(qe.jsx)(Ye,{className:t.offColor,children:"To fully take advantage of Lamassu Admin, add a new machine to your system"}),Object(qe.jsx)(An,{onClick:function(){return o(!0)},children:"+ Add new machine"})]})}),Object(qe.jsx)(ps,{})]}):Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ll,{title:"Dashboard",children:Object(qe.jsxs)("div",{className:t.headerLabels,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Pc,{}),Object(qe.jsx)("span",{children:"Cash-in"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Wc,{}),Object(qe.jsx)("span",{children:"Cash-out"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:12,height:12,children:Object(qe.jsx)("rect",{width:12,height:12,rx:3,fill:he})}),Object(qe.jsx)("span",{children:"Action Required"})]})]})}),Object(qe.jsx)("div",{className:t.root,children:Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(qe.jsx)(_d,{})}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(qe.jsx)(Yu,{})})]})}),Object(qe.jsx)(ps,{})]})},nm=n(1125),am=n(243),rm=n.n(am),im=n(1063),om=n(1064),lm=n(1065),cm=n(556),sm=n(1061),dm=n(1134),um=n(1059),mm=n(223),hm=n(1060),pm=n(1127),bm="You have unsaved changes on this page. Are you sure you want to leave?",fm=function(e){var t=e.message,n=void 0===t?bm:t,r=Object(mn.f)(),i=r.dirty&&0===r.submitCount;Object(a.useEffect)((function(){window.onbeforeunload=i?o:void 0}),[i]);var o=function(){return bm};return Object(qe.jsx)(w.a,{when:i,message:n})},jm=n(1052),gm=n(1053),Om=Me.tl2,xm=Me.label1,vm={size:function(e){var t=e.size;return Ha(t)},bold:Va,header:{extend:Om,backgroundColor:Te,height:Fe,textAlign:"left",color:K,display:"flex",alignItems:"center"},doubleHeader:{extend:Om,backgroundColor:Te,height:De,color:K,display:"table-row"},thDoubleLevel:function(e){return{width:e.width,display:"table-cell","& > :first-child":{margin:[[0,10]],extend:xm,fontWeight:700,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:se,color:K,borderRadius:[[0,0,8,8]],height:28},"& > :last-child":{padding:[[0,11]],display:"table-cell",verticalAlign:"middle",height:De-28}}},cellDoubleLevel:{display:"flex",padding:[[0,16]]},td:function(e){var t=e.textAlign;return{width:e.width,padding:[[1,24,0,24]],textAlign:t}},tdHeader:{verticalAlign:"middle",display:"table-cell",padding:[[0,24]]},trError:{backgroundColor:Re},trAdding:{backgroundColor:Be},mainContent:function(e){return{display:"flex",alignItems:"center",minHeight:{sm:34,lg:68}[e.size]||48}},cardContentRoot:{margin:0,padding:0,"&:last-child":{padding:0}},card:{extend:Me.p,"&:before":{height:0},margin:[[4,0,0,0]],width:"100%",boxShadow:[[0,0,4,0,"rgba(0, 0, 0, 0.08)"]]},actionCol:{marginLeft:"auto"},errorContent:{padding:[[12,0,12,24]],color:he}},ym=Object(f.a)(vm),wm=function(e){var t=e.children,n=e.className,a=Object(q.a)(e,["children","className"]);return Object(qe.jsx)("div",Object(s.a)(Object(s.a)({className:I()(n)},a),{},{children:t}))},Cm=function(e){var t=e.children,n=e.className,a=ym();return Object(qe.jsx)("div",{className:I()(n,a.header),children:t})},km=function(e){var t=e.children,n=e.className,a=ym();return Object(qe.jsx)("div",{className:I()(n,a.doubleHeader),children:t})},Em=function(e){var t=e.children,n=e.className;return Object(qe.jsx)("div",{className:I()(n),children:t})},Nm=function(e){var t,n=e.children,a=e.header,r=e.className,i=e.width,o=void 0===i?100:i,l=e.size,c=e.bold,s=e.textAlign,d=e.action,u=ym({textAlign:s,width:o,size:l}),m=(t={},Object(z.a)(t,u.td,!0),Object(z.a)(t,u.tdHeader,a),Object(z.a)(t,u.actionCol,d),Object(z.a)(t,u.size,!a),Object(z.a)(t,u.bold,!a&&c),t);return Object(qe.jsx)("div",{className:I()(r,m),children:n})},Sm=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)(Nm,Object(s.a)(Object(s.a)({header:!0},n),{},{children:t}))},Im=function(e){var t=e.title,n=e.children,a=e.className,r=e.width,i=ym({width:r});return Object(qe.jsxs)("div",{className:I()(a,i.thDoubleLevel),children:[Object(qe.jsx)("div",{children:t}),Object(qe.jsx)("div",{children:n})]})},Lm=function(e){var t,n=e.onClick,a=e.error,r=e.errorMessage,i=e.shouldShowError,o=e.children,l=e.className,c=e.size,s=e.newRow,d=ym({size:c}),u={root:d.cardContentRoot},m=(t={},Object(z.a)(t,d.tr,!0),Object(z.a)(t,d.trError,a),Object(z.a)(t,d.card,!0),Object(z.a)(t,d.trAdding,s),Object(z.a)(t,"className",l),t);return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(jm.a,{className:I()(m,l),onClick:n,children:Object(qe.jsxs)(gm.a,{classes:u,children:[Object(qe.jsx)("div",{className:d.mainContent,children:o}),a&&i&&Object(qe.jsx)("div",{className:d.errorContent,children:r})]})})})},Fm=r.a.createContext(),Pm=n(1055),Dm=n(1056),Tm=n(1121),Rm=n(1054),Bm=n(318),Am=Bm.create({checkTypes:!1,env:Bm.env}),Mm=Am.compose(Am.joinWith(""))(Gc.a(0,Am.toLower)),Wm=Am.compose(Am.joinWith(""))(Gc.a(0,Am.toUpper)),zm=Am.compose(Wm)(Am.toLower),qm=F.a(Am.splitOn(" "),Rm.a(/([A-Z])/g," $1"),Mm),$m=F.a(Am.joinWith(" "),Am.map(zm),qm),Hm=function(e,t,n){return 1===parseInt(e)?t:n},Vm=Object(f.a)({orderedBySpan:{whiteSpace:"nowrap"}}),Um=function(){var e=Vm(),t=Object(a.useContext)(Fm),n=t.elements,r=t.enableEdit,i=t.enableEditText,o=t.editWidth,c=t.enableDelete,s=t.deleteWidth,d=t.enableToggle,u=t.toggleWidth,m=t.orderedBy,h=t.DEFAULT_COL_SIZE,p=function(t,n){var a,r=t.name,i=t.width,o=void 0===i?h:i,l=t.header,c=t.textAlign,s=I()(Object(z.a)({},e.orderedBySpan,D.a(l)&&!D.a(m)&&gn.a(r,m.code)));return Object(qe.jsx)(Nm,{header:!0,width:o,textAlign:c,children:D.a(l)?Object(qe.jsxs)("span",{className:s,children:[$m(r)," ",!D.a(m)&&gn.a(r,m.code)&&"-"]}):Object(qe.jsx)(qe.Fragment,{children:null!==(a=function(e){if(!D.a(m)&&gn.a(r,m.code))try{var t=Tm.a(e),n=A.a(["props","children"],t),a=Aa.a((function(e){return gn.a(e.type,"span")}),n);return a.props.children=xd.a(" -",a.props.children),t}catch(i){return e}return e}(l))&&void 0!==a?a:l})},n)},b=function(e){var t=Os.a(dl.a("doubleHeader"))(e),n=Object(l.a)(t,2),a=n[0],r=n[1];if(!a.length)return[e,Cm];var i=Pm.a(a[0],e),o=F.a(js.a,T.a(A.a(["width"])))(a);return[Dm.a(i,{width:o,elements:a,name:a[0].doubleHeader},r),km]}(n),f=Object(l.a)(b,2),j=f[0],g=f[1];return Object(qe.jsxs)(g,{children:[j.map((function(e,t){var n=e.width,a=e.elements,r=e.name;return a&&a.length?Object(qe.jsx)(Im,{width:n,title:r,children:a.map(p)},t):p(e,t)})),r&&Object(qe.jsx)(Nm,{header:!0,width:o,textAlign:"center",children:null!==i&&void 0!==i?i:"Edit"}),c&&Object(qe.jsx)(Nm,{header:!0,width:s,textAlign:"center",children:"Delete"}),d&&Object(qe.jsx)(Nm,{header:!0,width:u,textAlign:"center",children:"Enable"})]})},Gm=n(1058),Xm=n(1057),_m=Object(f.a)({content:{width:434,padding:16,paddingRight:28},titleSection:{padding:16,paddingRight:12,display:"flex",justifyContent:"space-between",margin:0},actions:{padding:32,paddingTop:16},title:{margin:0},closeButton:{padding:0,marginTop:-4}}),Zm=function(e){var t=e.children,n=e.close,a=_m();return Object(qe.jsxs)("div",{className:a.titleSection,children:[t,n&&Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:n,className:a.closeButton,children:Object(qe.jsx)(qi,{})})]})},Km=function(e){var t=e.title,n=void 0===t?"Confirm Delete":t,a=e.open,r=void 0!==a&&a,i=e.onConfirmed,o=e.onDismissed,l=e.item,c=void 0===l?"item":l,s=e.confirmationMessage,d=void 0===s?"Are you sure you want to delete this ".concat(c,"?"):s,u=e.extraMessage,m=e.errorMessage,h=void 0===m?"":m,p=_m();return Object(qe.jsxs)(cn.a,{open:r,"aria-labelledby":"form-dialog-title",children:[Object(qe.jsx)(Zm,{close:function(){return o()},children:Object(qe.jsx)(_e,{className:p.title,children:n})}),h&&Object(qe.jsx)(Zm,{children:Object(qe.jsx)(rl,{children:h.split(":").map((function(e){return Object(qe.jsxs)(qe.Fragment,{children:[e,Object(qe.jsx)("br",{})]})}))})}),Object(qe.jsxs)(sn.a,{className:p.content,children:[d&&Object(qe.jsx)(Ke,{children:d}),u]}),Object(qe.jsx)(Xm.a,{className:p.actions,children:Object(qe.jsx)(An,{onClick:i,children:"Confirm"})})]})},Qm=n(569);function Ym(){return(Ym=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Jm(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var eh=a.createElement("desc",null,"Created with Sketch."),th=a.createElement("defs",null,a.createElement("path",{id:"arrow-path",d:"M5.3501239,7.53208616 L0.473798314,2.73082122 C-0.158421727,2.1051411 -0.158421727,1.0952488 0.476737158,0.466675069 C1.11220338,-0.155816755 2.1378971,-0.155816755 2.77494316,0.468226909 L6.49990857,4.13723769 L10.2264532,0.466675069 C10.8619195,-0.155816755 11.8876132,-0.155816755 12.5260183,0.469568675 C13.1582383,1.0952488 13.1582383,2.1051411 12.5245507,2.73226987 L7.64673876,7.53497972 C7.33802629,7.83583835 6.92590837,8 6.49990828,8 C6.0739082,8 5.66179027,7.83583835 5.3501239,7.53208616 Z"})),nh=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fillRule:"evenodd"},a.createElement("g",{id:"icon/action/arrow/regular"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("use",{id:"Mask",fillRule:"nonzero",xlinkHref:"#arrow-path"})));function ah(e,t){var n=e.title,r=e.titleId,i=Jm(e,["title","titleId"]);return a.createElement("svg",Ym({width:"13px",height:"8px",viewBox:"0 0 13 8",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,eh,th,nh)}var rh=a.forwardRef(ah),ih=(n.p,Me.p),oh=152,lh={selectedItem:{width:111,display:"block",whiteSpace:"nowrap",overflow:"hidden"},select:{width:oh,zIndex:1,"& label":{extend:Me.label1,color:se,paddingLeft:10},"& button":{extend:ih,position:"relative",border:0,backgroundColor:re,width:oh,padding:[[6,0,6,12]],borderRadius:20,lineHeight:"1.14",textAlign:"left",color:se,cursor:"pointer",outline:"0 none"},"& ul":{maxHeight:"200px",width:oh,overflowY:"auto",position:"absolute",margin:0,borderTop:0,padding:0,borderRadius:[[0,0,8,8]],backgroundColor:re,outline:"0 none","& li":{extend:ih,listStyleType:"none",padding:[[6,12]],cursor:"pointer","& span":{width:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap"}},"& li:hover":{backgroundColor:se,color:K}},"& svg":{position:"absolute",top:12,right:14,fill:se}},selectFiltered:{"& button":{backgroundColor:se,color:K},"& ul":{"& li":{backgroundColor:se,color:K},"& li:hover":{backgroundColor:re,color:se}},"& svg":{fill:[[K],"!important"]}},open:{"& button":{borderRadius:[[8,8,0,0]]}}},ch=Object(f.a)(lh);var sh=function(e){var t,n=e.className,a=e.label,r=e.items,i=Object(q.a)(e,["className","label","items"]),o=ch(),l=Object(Qm.a)({items:r,selectedItem:i.selectedItem,onSelectedItemChange:function(e){i.onSelectedItemChange(e.selectedItem)}}),c=l.isOpen,d=l.selectedItem,u=l.getToggleButtonProps,m=l.getLabelProps,h=l.getMenuProps,p=l.getItemProps,b=(t={},Object(z.a)(t,o.select,!0),Object(z.a)(t,o.selectFiltered,!!i.defaultAsFilter||!gn.a(d,i.default)),Object(z.a)(t,o.open,c),t);return Object(qe.jsxs)("div",{className:I()(b,n),children:[Object(qe.jsx)("label",Object(s.a)(Object(s.a)({},m()),{},{children:a})),Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({},u()),{},{children:[Object(qe.jsx)("span",{className:o.selectedItem,children:d.display}),Object(qe.jsx)(rh,{})]})),Object(qe.jsx)("ul",Object(s.a)(Object(s.a)({},h()),{},{children:c&&r.map((function(e,t){var n=e.code,a=e.display;return Object(qe.jsx)("li",Object(s.a)(Object(s.a)({},p({code:n,index:t})),{},{children:Object(qe.jsx)("span",{children:a})}),"".concat(n).concat(t))}))}))]})};function dh(){return(dh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function uh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var mh=a.createElement("defs",null,a.createElement("path",{id:"a",d:"M0 0h22v22H0z"})),hh=a.createElement("g",{fill:"none",fillRule:"evenodd"},a.createElement("mask",{id:"b",fill:"#fff"},a.createElement("use",{xlinkHref:"#a"})),a.createElement("path",{stroke:"#9B9B9B",strokeWidth:2,strokeLinecap:"round",mask:"url(#b)",d:"M9 9v9M13 9v9"}),a.createElement("g",{mask:"url(#b)",stroke:"#9B9B9B",strokeLinecap:"round",strokeWidth:2},a.createElement("path",{strokeLinejoin:"round",d:"M3 6l2 15h12l2-15"}),a.createElement("path",{d:"M1 5h20M14 4a3 3 0 10-6 0"})));function ph(e,t){var n=e.title,r=e.titleId,i=uh(e,["title","titleId"]);return a.createElement("svg",dh({width:22,height:22,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,mh,hh)}var bh=a.forwardRef(ph);n.p;function fh(){return(fh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gh=a.createElement("desc",null,"Created with Sketch."),Oh=a.createElement("g",{id:"icon/action/delete/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round"},a.createElement("line",{x1:9,y1:9,x2:9,y2:18,id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:13,y1:9,x2:13,y2:18,id:"Stroke-2",stroke:"#1B2559",strokeWidth:2}),a.createElement("polyline",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,strokeLinejoin:"round",points:"3 6 5 21 17 21 19 6"}),a.createElement("line",{x1:1,y1:5,x2:21,y2:5,id:"Stroke-5",stroke:"#1B2559",strokeWidth:2}),a.createElement("path",{d:"M14,4 C14,2.343 12.657,1 11,1 C9.343,1 8,2.343 8,4",id:"Stroke-7",stroke:"#1B2559",strokeWidth:2}));function xh(e,t){var n=e.title,r=e.titleId,i=jh(e,["title","titleId"]);return a.createElement("svg",fh({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,gh,Oh)}var vh=a.forwardRef(xh);n.p;function yh(){return(yh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ch=a.createElement("desc",null,"Created with Sketch."),kh=a.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#9B9B9B",strokeWidth:2}),a.createElement("polygon",{id:"Stroke-3",stroke:"#9B9B9B",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Eh(e,t){var n=e.title,r=e.titleId,i=wh(e,["title","titleId"]);return a.createElement("svg",yh({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Ch,kh)}var Nh=a.forwardRef(Eh);n.p;function Sh(){return(Sh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ih(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Lh=a.createElement("desc",null,"Created with Sketch."),Fh=a.createElement("g",{id:"icon/action/edit/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),a.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Ph(e,t){var n=e.title,r=e.titleId,i=Ih(e,["title","titleId"]);return a.createElement("svg",Sh({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Lh,Fh)}var Dh=a.forwardRef(Ph);n.p;function Th(){return(Th=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Rh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Bh=a.createElement("defs",null,a.createElement("pattern",{id:"pattern_68JiZ",patternUnits:"userSpaceOnUse",width:5.5,height:5.5,patternTransform:"rotate(45)"},a.createElement("line",{x1:0,y:0,x2:0,y2:5.5,stroke:"#DBDFED",strokeWidth:3}))),Ah=a.createElement("rect",{width:"100%",height:"100%",fill:"url(#pattern_68JiZ)",opacity:1});function Mh(e,t){var n=e.title,r=e.titleId,i=Rh(e,["title","titleId"]);return a.createElement("svg",Th({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"36px",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Bh,"{' '}\n ",Ah)}var Wh=a.forwardRef(Mh),zh=(n.p,{saveButton:{marginRight:20},lastOfGroup:{marginBottom:24},extraPadding:{paddingLeft:35,paddingRight:30},extraPaddingRight:{paddingRight:39},withSuffix:function(e){var t=e.textAlign;return{display:"flex",alignItems:"center",justifyContent:"right"===t?"flex-end":t}},suffix:{margin:[[0,0,0,7]]},size:function(e){var t=e.size;return Ha(t)},bold:Va}),qh=Object(f.a)(zh),$h=function(e){var t=e.disabled,n=e.editing,r=qh(),i=Object(mn.f)(),o=i.values,c=i.submitForm,s=i.resetForm,d=Object(a.useContext)(Fm),u=d.editWidth,m=d.onEdit,h=d.enableEdit,p=d.enableDelete,b=d.disableRowEdit,f=d.onDelete,j=d.deleteWidth,g=d.enableToggle,O=d.onToggle,x=d.toggleWidth,v=d.forceAdd,y=d.clearError,w=d.actionColSize,C=d.error,k=t||b&&b(o),E=Object(a.useState)(!1),N=Object(l.a)(E,2),S=N[0],I=N[1];return Object(qe.jsxs)(qe.Fragment,{children:[n&&Object(qe.jsxs)(Nm,{textAlign:"center",width:w,children:[Object(qe.jsx)(oa,{className:r.saveButton,type:"submit",color:"primary",onClick:c,children:"Save"}),!v&&Object(qe.jsx)(oa,{color:"secondary",onClick:function(){y(),s()},children:"Cancel"})]}),!n&&h&&Object(qe.jsx)(Nm,{textAlign:"center",width:u,children:Object(qe.jsx)(ta,{disabled:k,className:r.editButton,onClick:function(){return m&&m(o.id)},children:k?Object(qe.jsx)(Nh,{}):Object(qe.jsx)(Dh,{})})}),!n&&p&&Object(qe.jsxs)(Nm,{textAlign:"center",width:j,children:[Object(qe.jsx)(ta,{disabled:t,onClick:function(){I(!0)},children:t?Object(qe.jsx)(bh,{}):Object(qe.jsx)(vh,{})}),Object(qe.jsx)(Km,{open:S,setDeleteDialog:I,onConfirmed:function(){f(o.id).then((function(e){D.a(e)||I(!1)}))},onDismissed:function(){I(!1),y()},errorMessage:C})]}),!n&&g&&Object(qe.jsx)(Nm,{textAlign:"center",width:x,children:Object(qe.jsx)(Lr,{checked:!!o.active,value:!!o.active,disabled:t,onChange:function(){return O(o.id)}})})]})},Hh=function(e){var t,n=e.editing,a=e.focus,r=e.config,i=e.extraPaddingRight,o=e.extraPadding,l=r.name,c=r.bypassField,d=r.input,u=r.editable,m=void 0===u||u,h=r.size,p=r.bold,b=r.width,f=r.textAlign,j=r.editingAlign,g=void 0===j?f:j,O=r.suffix,x=r.SuffixComponent,v=void 0===x?rt:x,y=r.textStyle,w=void 0===y?function(e){}:y,C=r.isHidden,k=void 0===C?function(e){return!1}:C,E=r.view,N=void 0===E?function(e){return null===e||void 0===e?void 0:e.toString()}:E,S=r.inputProps,I=void 0===S?{}:S,L=Object(mn.f)().values,F=n&&function(e){return"function"===typeof e?e(L):e}(m),P=!c,D=qh({textAlign:F?g:f,size:h}),T=Object(s.a)({fullWidth:!0,autoFocus:a,size:h,bold:p,textAlign:F?g:f},I);return Object(qe.jsxs)(Nm,{className:(t={},Object(z.a)(t,D.extraPaddingRight,i),Object(z.a)(t,D.extraPadding,o),Object(z.a)(t,D.withSuffix,O),t),width:b,size:h,bold:p,textAlign:f,children:[F&&P&&!k(L)&&Object(qe.jsx)(mn.b,Object(s.a)({name:l,component:d},T)),F&&!P&&!k(L)&&Object(qe.jsx)(r.input,{name:l}),!F&&L&&!k(L)&&Object(qe.jsx)("div",{style:w(L,F),children:N(L[l],L)}),O&&!k(L)&&Object(qe.jsx)(v,{className:D.suffix,style:F?{}:w(L,F),children:O}),k(L)&&Object(qe.jsx)(Wh,{})]})},Vh=function(e){var t=e.editing,n=e.disabled,r=e.lastOfGroup,i=e.newRow,o=Object(mn.f)(),c=o.touched,s=o.errors,d=o.values,u=Object(a.useContext)(Fm),m=u.elements,h=u.enableEdit,p=u.enableDelete,b=u.error,f=u.enableToggle,j=u.rowSize,g=u.stripeWhen,O=qh(),x=!t&&g&&g(d)?function(e){var t=Os.a(W.a("stripe",!0))(e),n=Object(l.a)(t,2),a=n[0],r=n[1];if(!a.length)return e;var i=Pm.a(a[0],e),o=F.a(js.a,T.a(A.a(["width"])))(a);return Dm.a(i,{width:o,editable:!1,view:function(){return Object(qe.jsx)(Wh,{})}},r)}(m):m,v=Os.a(dl.a("doubleHeader"))(m),y=Object(l.a)(v,1)[0],w=(null===y||void 0===y?void 0:y.length)?Pm.a(y[0],m):-1,C=(null===y||void 0===y?void 0:y.length)?Pm.a(y[y.length-1],m):-1,k=x.findIndex((function(e){return void 0===e.editable||e.editable})),E=Object(z.a)({},O.lastOfGroup,r),N=Gm.a(Hc.a(c),s),S=N&&Hc.a(N).length>0||!!b,L=b||N&&gd.a(N).join(", ");return Object(qe.jsxs)(Lm,{className:I()(E),size:j,error:t&&S,newRow:i&&!S,errorMessage:L,children:[x.map((function(e,n){return Object(qe.jsx)(Hh,{config:e,editing:t,focus:n===k&&t,extraPaddingRight:C===n,extraPadding:w===n},n)})),(h||p||f)&&Object(qe.jsx)($h,{disabled:n,editing:t})]})},Uh={wrapper:function(e){return{width:e.width}},addLink:{marginLeft:"auto"},title:{margin:0,color:se},outerHeader:{minHeight:16,marginBottom:24,display:"flex",justifyContent:"space-between",alignItems:"center"}},Gh=Object(f.a)(Uh),Xh=F.a(gs.a(cm.a)(0),T.a((function(e){var t;return null!==(t=e.width)&&void 0!==t?t:100}))),_h=function(e){var t,n,r,i=e.name,o=e.title,c=e.titleLg,d=e.elements,u=void 0===d?[]:d,m=e.data,h=void 0===m?[]:m,p=e.save,b=e.error,f=e.rowSize,j=void 0===f?"md":f,g=e.validationSchema,O=e.enableCreate,x=e.enableEdit,v=e.enableEditText,y=e.editWidth,w=e.enableDelete,C=e.deleteWidth,k=void 0===C?87:C,E=e.enableToggle,N=e.toggleWidth,S=void 0===N?87:N,I=e.onToggle,L=e.forceDisable,F=e.disableAdd,P=e.initialValues,D=e.setEditing,T=e.shouldOverrideEdit,B=e.editOverride,A=e.stripeWhen,M=e.disableRowEdit,q=e.groupBy,$=e.sortBy,H=e.createText,V=void 0===H?"Add override":H,U=e.forceAdd,G=void 0!==U&&U,X=e.tbodyWrapperClass,_=e.orderedBy,Z=void 0===_?null:_,K=Object(a.useState)(null),Q=Object(l.a)(K,2),Y=Q[0],J=Q[1],ee=Object(a.useState)(!1),te=Object(l.a)(ee,2),ne=te[0],ae=te[1],re=Object(a.useState)(!1),ie=Object(l.a)(re,2),oe=ie[0],le=ie[1],ce=Object(a.useState)(null),se=Object(l.a)(ce,2),de=se[0],ue=se[1];Object(a.useEffect)((function(){return ue(b)}),[b]),Object(a.useEffect)((function(){ue(null),ae(G)}),[G]);var me=function(){var e=Object(Bl.a)(Rl.a.mark((function e(t){var n,a,r;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oe){e.next=2;break}return e.abrupt("return");case 2:if(le(!0),n=g.cast(t),a=fl.a(W.a("id",n.id))(h),r=-1!==a?dm.a(a,n,h):um.a(n,h),gn.a(h[a],n)){e.next=16;break}return e.prev=7,e.next=10,p(Object(z.a)({},i,r),n);case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(7),le(!1),e.abrupt("return");case 16:ae(!1),D&&D(!1),le(!1);case 19:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t){return e.apply(this,arguments)}}(),he=function(){ae(!1),J(null),D&&D(!1)},pe=function(){ae(!0),ue(null),D&&D(!0,!0)},be=w||E?87:174,fe=za.a(be)(y),je=(null!==(t=w&&k)&&void 0!==t?t:0)+(null!==(n=x&&fe)&&void 0!==n?n:0)+(null!==(r=E&&S)&&void 0!==r?r:0),ge=Xh(u)+je,Oe=Gh({width:ge}),xe=!h.length&&O&&!ne,ve=!L&&!Y&&!F&&!ne,ye=ne||0!==h.length,we=$?hm.a($)(h):h,Ce={elements:u,enableEdit:x,enableEditText:v,onEdit:function(e){if(T&&T(e))return B(e);J(e),ue(null),D&&D(e,!0)},clearError:function(){return ue(null)},error:de,disableRowEdit:M,editWidth:fe,enableDelete:w,onDelete:function(e){var t=mm.a((function(t){return t.id===e}),h);return p(Object(z.a)({},i,t))},deleteWidth:k,enableToggle:E,rowSize:j,onToggle:I,toggleWidth:S,actionColSize:je,stripeWhen:A,forceAdd:G,orderedBy:Z,DEFAULT_COL_SIZE:100};return Object(qe.jsx)(Fm.Provider,{value:Ce,children:Object(qe.jsxs)("div",{className:Oe.wrapper,children:[xe&&ve&&Object(qe.jsx)(Fn,{onClick:pe,children:V}),ye&&Object(qe.jsxs)(qe.Fragment,{children:[(o||O)&&Object(qe.jsxs)("div",{className:Oe.outerHeader,children:[o&&c&&Object(qe.jsx)(tt,{className:Oe.title,children:o}),o&&!c&&Object(qe.jsx)(Ye,{className:Oe.title,children:o}),O&&ve&&Object(qe.jsx)(oa,{className:Oe.addLink,onClick:pe,children:V})]}),Object(qe.jsxs)(wm,{children:[Object(qe.jsx)(Um,{}),Object(qe.jsx)("div",{className:X,children:Object(qe.jsxs)(Em,{children:[ne&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:Object(s.a)({id:Object(pm.a)()},P),onReset:he,validationSchema:g,onSubmit:me,children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(fm,{}),Object(qe.jsx)(Vh,{editing:!0,disabled:L,newRow:!0})]})}),we.map((function(e,t){var n,a=we[t+1],r=!!q&&a,i="Function"===Ta.a(q)?q:R.a(q),o=r&&i(e)!==i(a);return Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:e,onReset:he,validationSchema:g,onSubmit:me,children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(fm,{}),Object(qe.jsx)(Vh,{lastOfGroup:o,editing:Y===e.id,disabled:L||Y&&Y!==e.id||ne})]})},null!==(n=e.id)&&void 0!==n?n:t)}))]})})]})]})]})})},Zh=function(e){var t=e.name,n=e.save,a=e.data,r=void 0===a?{}:a,i=e.namespaces,o=void 0===i?[]:i,l=Object(q.a)(e,["name","save","data","namespaces"]),c=T.a((function(e){return Object(s.a)({id:e},ss(e)(r))}))(o);return Object(qe.jsx)(_h,Object(s.a)({name:t,data:c,save:function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var r=t[1];return n(ds(r.id)(sm.a(["id2"],r)))}},l))},Kh=n(575),Qh=Object(f.a)({modal:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center"},wrapper:function(e){var t=e.width,n=e.height;return{width:t,height:n,display:"flex",flexDirection:"column",minHeight:null!==n&&void 0!==n?n:400,maxHeight:"90vh",overflowY:"auto",borderRadius:8,outline:0}},infoPanelWrapper:function(e){var t=e.width,n=e.infoPanelHeight;return{width:t,height:n,marginTop:16,display:"flex",flexDirection:"column",minHeight:null!==n&&void 0!==n?n:200,maxHeight:"90vh",overflowY:"auto",borderRadius:8,outline:0}},panelContent:{width:"100%",display:"flex",flexDirection:"column",flex:1,padding:[[0,24]]},content:function(e){var t=e.small;return{width:"100%",display:"flex",flexDirection:"column",flex:1,padding:e.xl?[[0,88]]:t?[[0,16]]:[[0,32]]}},button:function(e){var t=e.small,n=e.xl;return{padding:[[0,0,n?26:0,0]],margin:n?[[0,0,"auto","auto"]]:t?[[12,12,"auto","auto"]]:[[16,16,"auto","auto"]]}},header:{display:"flex"},title:function(e){return{margin:e.small?[[20,0,8,16]]:[[28,0,8,32]]}}}),Yh=function(e){var t=e.width,n=e.height,a=e.infoPanelHeight,r=e.title,i=e.small,o=e.xl,l=e.infoPanel,c=e.handleClose,d=e.children,u=(e.secondaryModal,e.className),m=e.closeOnEscape,h=e.closeOnBackdropClick,p=Object(q.a)(e,["width","height","infoPanelHeight","title","small","xl","infoPanel","handleClose","children","secondaryModal","className","closeOnEscape","closeOnBackdropClick"]),b=Qh({width:t,height:n,small:i,infoPanelHeight:a,xl:o}),f=i?_e:Ue,j=o?28:i?16:20;return Object(qe.jsx)(Kh.a,Object(s.a)(Object(s.a)({onClose:function(e,t){(h||"backdropClick"!==t)&&(m||"escapeKeyDown"!==t)&&c()},className:b.modal},p),{},{children:Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(Un.a,{className:I()(b.wrapper,u),children:[Object(qe.jsxs)("div",{className:b.header,children:[r&&Object(qe.jsx)(f,{className:b.title,children:r}),Object(qe.jsx)(ta,{size:j,className:b.button,onClick:function(){return c()},children:Object(qe.jsx)(qi,{})})]}),Object(qe.jsx)("div",{className:b.content,children:d})]}),l&&Object(qe.jsx)(Un.a,{className:I()(b.infoPanelWrapper,u),children:Object(qe.jsx)("div",{className:b.panelContent,children:l})})]})}))},Jh=9999999,ep="manual",tp=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,np=n.p+"static/media/both-filled.7af80d5f.svg",ap={button:{margin:[[35,"auto",0,"auto"]]},modalContent:{display:"flex",flexDirection:"column",alignItems:"center",flex:1,padding:[[0,34]]},splashTitle:{marginTop:15},warningInfo:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:15},warningIcon:{width:25,height:25,marginRight:8,display:"block"},warningText:{flexBasis:"100%",flexGrow:1},machineName:{margin:[[5,0]],color:$}},rp=Object(f.a)(ap),ip=function(e){var t=e.name,n=e.onContinue,a=rp();return Object(qe.jsxs)("div",{className:a.modalContent,children:[Object(qe.jsx)("img",{width:"148",height:"196",alt:"cassette",src:np}),Object(qe.jsx)(Ue,{className:a.splashTitle,noMargin:!0,children:"Update counts"}),Object(qe.jsx)(Ye,{className:a.machineName,noMargin:!0,children:t}),Object(qe.jsxs)("div",{className:a.warningInfo,children:[Object(qe.jsx)(ir,{className:a.warningIcon}),Object(qe.jsx)(Ke,{noMargin:!0,className:a.warningText,children:"Before updating counts on Lamassu Admin, make sure you've done it before on the machines."})]}),Object(qe.jsxs)("div",{className:a.warningInfo,children:[Object(qe.jsx)(ir,{className:a.warningIcon}),Object(qe.jsx)(Ke,{noMargin:!0,className:a.warningText,children:"For cash cassettes, please make sure you've removed the remaining bills before adding the new ones."})]}),Object(qe.jsx)(An,{className:a.button,onClick:n,children:"Get started"})]})},op=n(1062);function lp(){return(lp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function cp(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var sp=a.createElement("desc",null,"Created with Sketch."),dp=a.createElement("g",{id:"icon/stage/spring/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#48F694",cx:9,cy:9,r:4}),a.createElement("circle",{id:"Oval-Copy-5",stroke:"#48F694",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function up(e,t){var n=e.title,r=e.titleId,i=cp(e,["title","titleId"]);return a.createElement("svg",lp({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,sp,dp)}var mp=a.forwardRef(up),hp=(n.p,{stages:{display:"flex",alignItems:"center"},wrapper:{display:"flex",alignItems:"center",margin:0},stage:{display:"flex",height:28,width:28,zIndex:2,"& > svg":{height:"100%",width:"100%",overflow:"visible"}},separator:{width:28,height:2,border:[[2,"solid"]],zIndex:1},separatorSpring:{borderColor:ee},separatorZodiac:{borderColor:J},separatorSpringEmpty:{borderColor:oe},separatorZodiacEmpty:{borderColor:se}}),pp=Object(f.a)(hp),bp=Object(a.memo)((function(e){var t,n,a=e.steps,r=e.currentStep,i=e.color,o=void 0===i?"spring":i,l=e.className;if(r<1||r>a)throw Error("Value of currentStage is invalid");if(a<1)throw Error("Value of stages is invalid");var c=pp(),s=(t={},Object(z.a)(t,c.separator,!0),Object(z.a)(t,c.separatorSpring,"spring"===o),Object(z.a)(t,c.separatorZodiac,"zodiac"===o),t),d=(n={},Object(z.a)(n,c.separator,!0),Object(z.a)(n,c.separatorSpringEmpty,"spring"===o),Object(z.a)(n,c.separatorZodiacEmpty,"zodiac"===o),n);return Object(qe.jsxs)("div",{className:I()(l,c.stages),children:[Ru.a(1,r).map((function(e){return Object(qe.jsxs)("div",{className:c.wrapper,children:[e>1&&Object(qe.jsx)("div",{className:I()(s)}),Object(qe.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(qe.jsx)(Zi,{}),"zodiac"===o&&Object(qe.jsx)(bi,{})]})]},e)})),Object(qe.jsxs)("div",{className:c.wrapper,children:[r>1&&Object(qe.jsx)("div",{className:I()(s)}),Object(qe.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(qe.jsx)(mp,{}),"zodiac"===o&&Object(qe.jsx)(yi,{})]})]}),Ru.a(r+1,a+1).map((function(e){return Object(qe.jsxs)("div",{className:c.wrapper,children:[Object(qe.jsx)("div",{className:I()(d)}),Object(qe.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(qe.jsx)(gt,{}),"zodiac"===o&&Object(qe.jsx)(Ct,{})]})]},e)}))]})}));function fp(){return(fp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jp(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gp=a.createElement("desc",null,"Created with Sketch."),Op=a.createElement("g",{id:"icon/action/help/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M20.0004,11 C20.0004,6.03028475 15.9701153,2 11.0004,2 C6.03004556,2 2.0004,6.02992391 2.0004,11 C2.0004,15.9700761 6.03004556,20 11.0004,20 C15.9701153,20 20.0004,15.9697153 20.0004,11 Z M22.0004,11 C22.0004,17.0742847 17.0746847,22 11.0004,22 C4.92544514,22 0.000400000001,17.0746147 0.000400000001,11 C0.000400000001,4.92538534 4.92544514,0 11.0004,0 C17.0746847,0 22.0004,4.92571525 22.0004,11 Z",id:"Stroke-1",fill:"#1B2559",fillRule:"nonzero"}),a.createElement("path",{d:"M9.9164,8.9063 C9.9164,9.45858475 9.46868475,9.9063 8.9164,9.9063 C8.36411525,9.9063 7.9164,9.45858475 7.9164,8.9063 C7.9164,6.89094438 9.72972438,5.35290249 11.7463843,5.7072003 C13.0663562,5.93764844 14.1348314,7.00654285 14.3652323,8.32479116 C14.6130182,9.7312185 13.941375,11.0876584 12.732214,11.7545735 C12.370484,11.9534687 12.1664,12.2664153 12.1664,12.5913 L12.1664,12.6563 C12.1664,13.2085847 11.7186847,13.6563 11.1664,13.6563 C10.6141153,13.6563 10.1664,13.2085847 10.1664,12.6563 L10.1664,12.5913 C10.1664,11.5009567 10.7946963,10.5375141 11.7674377,10.0026589 C12.2360927,9.74417086 12.493064,9.22519581 12.3953326,8.67046887 C12.3098185,8.1811985 11.8915858,7.76280177 11.4013649,7.67721566 C10.6126181,7.53864454 9.9164,8.1291691 9.9164,8.9063 Z",id:"Stroke-3",fill:"#1B2559",fillRule:"nonzero"}),a.createElement("path",{d:"M10.1039,15.2188 C10.1039,14.6318 10.5799,14.1568 11.1659,14.1568 C11.7529,14.1568 12.2289,14.6318 12.2289,15.2188 C12.2289,15.8058 11.7529,16.2808 11.1659,16.2808 C10.5799,16.2808 10.1039,15.8058 10.1039,15.2188",id:"Fill-5",fill:"#1B2559"}));function xp(e,t){var n=e.title,r=e.titleId,i=jp(e,["title","titleId"]);return a.createElement("svg",fp({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,gp,Op)}var vp,yp,wp,Cp=a.forwardRef(xp),kp=(n.p,Object(f.a)({transparentButton:{border:"none",backgroundColor:"transparent",outline:"none",cursor:"pointer",marginTop:4},popoverContent:function(e){return{width:e.width,padding:[[10,15]]}}})),Ep=function(e){var t=kp({width:e}),n=Object(a.useState)(null),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Boolean(i);return{classes:t,helpPopperAnchorEl:i,helpPopperOpen:c,handleOpenHelpPopper:function(e){o(i?null:e.currentTarget)},handleCloseHelpPopper:function(){o(null)}}},Np=Object(a.memo)((function(e){var t=e.parentElements,n=e.children,a=e.width,r=Ep(a);return Object(qe.jsxs)("div",{children:[!D.a(t)&&Object(qe.jsx)("div",{onMouseEnter:r.handleOpenHelpPopper,onMouseLeave:r.handleCloseHelpPopper,children:t}),D.a(t)&&Object(qe.jsx)("button",{type:"button",onMouseEnter:r.handleOpenHelpPopper,onMouseLeave:r.handleCloseHelpPopper,className:r.classes.transparentButton,children:Object(qe.jsx)(Cp,{})}),Object(qe.jsx)(Xn,{open:r.helpPopperOpen,anchorEl:r.helpPopperAnchorEl,placement:"bottom",children:Object(qe.jsx)("div",{className:r.classes.popoverContent,children:n})})]})})),Sp=n.p+"static/media/acceptor-left.f37bcb1a.svg",Ip=n.p+"static/media/dispenser-1.e4200f4e.svg",Lp=n.p+"static/media/dispenser-2.9f7807a5.svg",Fp=n.p+"static/media/3-cassettes-open-1-left.d6d9aa73.svg",Pp=n.p+"static/media/3-cassettes-open-2-left.a9ee8d4c.svg",Dp=n.p+"static/media/3-cassettes-open-3-left.08fed660.svg",Tp=n.p+"static/media/4-cassettes-open-1-left.7b00c51f.svg",Rp=n.p+"static/media/4-cassettes-open-2-left.b3d9541c.svg",Bp=n.p+"static/media/4-cassettes-open-3-left.e8f1667c.svg",Ap=n.p+"static/media/4-cassettes-open-4-left.bc1a9829.svg",Mp={content:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,paddingBottom:32},titleDiv:{marginBottom:32},title:{margin:[[0,0,12,0]],color:$},stepImage:{width:148,height:196},form:{paddingBottom:95},verticalAlign:{display:"flex",flexDirection:"column"},horizontalAlign:{display:"flex",flexDirection:"row"},centerAlignment:{alignItems:"center"},lineAlignment:{alignItems:"baseline"},fullWidth:{margin:[[0,"auto"]],flexBasis:"auto"},formWrapper:{flexBasis:"100%",display:"flex",justifyContent:"center"},submit:{float:"right"},cashboxBills:{marginRight:5},cassetteCashbox:{width:40,height:35},cassetteFormTitle:{marginTop:18},cassetteFormTitleContent:{marginLeft:10,marginRight:25},smBottomMargin:{marginBottom:25},fiatTotal:{color:$},errorMessage:{color:he}},Wp=Object(f.a)(Mp),zp=function(e,t){return[[Ip,Lp],[Fp,Pp,Dp],[Tp,Rp,Bp,Ap]][e-2][t-2]},qp=function(e){var t=e.step,n=e.name,a=e.machine,r=e.cashoutSettings,i=e.cassetteCapacity,o=(e.error,e.lastStep),l=e.steps,c=e.fiatCurrency,s=e.onContinue,d=e.initialValues,u=Wp(),m=o?"Finish":"Confirm",h=[{display:"Yes",code:"YES"},{display:"No",code:"NO"}],p="cassette".concat(t-1),b=a.numberOfCassettes,f=null===a||void 0===a?void 0:a[p],j=null===r||void 0===r?void 0:r[p],g=function(e){return e[p]||f},O=function(e){return g(e)*j},x=Pu.a(g,(function(e){return e/i*100}),op.a(0,100));return Object(qe.jsxs)("div",{className:u.content,children:[Object(qe.jsxs)("div",{className:u.titleDiv,children:[Object(qe.jsx)(Ye,{className:u.title,children:n}),Object(qe.jsx)(bp,{steps:l.length,currentStep:t})]}),1===t&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{wasCashboxEmptied:""},enableReinitialize:!0,validationSchema:l[0].schema,children:function(e){e.values;var t=e.errors;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.form),children:[Object(qe.jsx)("img",{className:u.stepImage,alt:"cassette",src:Sp}),Object(qe.jsx)("div",{className:u.formWrapper,children:Object(qe.jsxs)("div",{className:I()(u.verticalAlign,u.fullWidth),children:[Object(qe.jsx)(_e,{noMargin:!0,children:"Did you empty the cash box?"}),Object(qe.jsx)(mn.b,{component:li,name:"wasCashboxEmptied",options:h,className:u.horizontalAlign}),t.wasCashboxEmptied&&Object(qe.jsx)("div",{className:u.errorMessage,children:t.wasCashboxEmptied}),Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.centerAlignment),children:[Object(qe.jsx)(Ke,{children:"Since previous update"}),Object(qe.jsx)(Np,{width:215,children:Object(qe.jsx)(Ke,{children:"Number of bills inside the cash box, since the last cash box changes."})})]}),Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.lineAlignment),children:[Object(qe.jsx)(Qe,{noMargin:!0,className:u.cashboxBills,children:null===a||void 0===a?void 0:a.cashbox}),Object(qe.jsx)(Ke,{noMargin:!0,children:"accepted bills"})]})]})})]}),Object(qe.jsx)(An,{className:u.submit,type:"submit",children:m})]})}}),t>1&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:d,enableReinitialize:!0,validationSchema:l[t-1].schema,children:function(e){var n=e.values;e.errors;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.form),children:[Object(qe.jsx)("img",{className:u.stepImage,alt:"cassette",src:zp(b,t)}),Object(qe.jsx)("div",{className:u.formWrapper,children:Object(qe.jsxs)("div",{className:I()(u.verticalAlign,u.fullWidth),children:[Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.smBottomMargin),children:[Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.cassetteFormTitle),children:[Object(qe.jsx)(Wc,{}),Object(qe.jsxs)(_e,{className:u.cassetteFormTitleContent,noMargin:!0,children:["Cash cassette ",t-1," (dispenser)"]})]}),Object(qe.jsx)(Jr,{className:u.cassetteCashbox,percent:x(n),cashOut:!0})]}),Object(qe.jsx)(_e,{noMargin:!0,children:"Refill bill count"}),Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.lineAlignment),children:[Object(qe.jsx)(mn.b,{component:oi,decimalPlaces:0,width:50,placeholder:f.toString(),name:p,className:u.cashboxBills,autoFocus:!0}),Object(qe.jsxs)(Ke,{children:[j," ",c," bills loaded"]})]}),Object(qe.jsxs)(Ke,{noMargin:!0,className:u.fiatTotal,children:["= ",Gr(O(n))," ",c]})]})})]}),Object(qe.jsx)(An,{className:u.submit,type:"submit",children:m})]})}})]})},$p=T.a((function(e){return"cassette".concat(e)}),Ru.a(1,5)),Hp=function(e){var t=e.machine,n=e.cashoutSettings,r=e.locale,i=e.onClose,o=e.save,c=e.error,s=Object(a.useState)({step:0,config:{active:!0}}),d=Object(l.a)(s,2),u=d[0],m=u.step,h=u.config,p=d[1],b=Wa.a(n)||!(null===n||void 0===n?void 0:n.active)?0:t.numberOfCassettes,f=m===b+1,j=function(e){return gs.a((function(t,n){return t[n]=function(e){return Vr(parseInt(e))?parseInt(e):0}(e[n]),t}),{},$p)},g=function(e){var n=Gn.a(h,e);if(f){var a=[null===h||void 0===h?void 0:h.wasCashboxEmptied,null===e||void 0===e?void 0:e.wasCashboxEmptied].includes("YES")?0:null===t||void 0===t?void 0:t.cashbox,r=j(e);return o(t.id,a,r),i()}p({step:m+1,config:n})},O=Pu.a(cm.a(1),Ru.a(1),T.a((function(e){return{type:"cassette ".concat(e),schema:xn.f().shape(Object(z.a)({},"cassette".concat(e),xn.e().label("Bill count").positive().integer().required().min(0).max(500)))}}))),x=um.a({type:"cashbox",schema:xn.f().shape({wasCashboxEmptied:xn.h().required("Select one option.")}),cashoutRequired:!1},O(b));return Object(qe.jsxs)(Yh,{title:0===m?null:"Update counts",handleClose:i,width:554,height:520,open:!0,children:[0===m&&Object(qe.jsx)(ip,{name:null===t||void 0===t?void 0:t.name,onContinue:function(){return g()}}),0!==m&&Object(qe.jsx)(qp,{step:m,name:null===t||void 0===t?void 0:t.name,machine:t,cashoutSettings:n,cassetteCapacity:500,error:c,lastStep:f,steps:x,fiatCurrency:r.fiatCurrency,onContinue:g,initialValues:Wa.a(n)?{}:gs.a((function(e,t){return e["cassette".concat(t)]="",e}),{},Ru.a(1,b+1))})]})},Vp={cashbox:{height:36}},Up=Object(f.a)(Vp),Gp={2:{cashbox:203,cassette:280,cassetteGraph:80,editWidth:87},3:{cashbox:164,cassette:200,cassetteGraph:60,editWidth:87},4:{cashbox:131,cassette:158,cassetteGraph:40,editWidth:87}},Xp=xn.f().shape({name:xn.h().required("Required"),cashbox:xn.e().label("Cash box").required().integer().min(0).max(1e3),cassette1:xn.e().required("Required").integer().min(0).max(500),cassette2:xn.e().required("Required").integer().min(0).max(500),cassette3:xn.e().required("Required").integer().min(0).max(500),cassette4:xn.e().required("Required").integer().min(0).max(500)}),_p=x()(vp||(vp=Object(c.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n $cassette3: Int!\n $cassette4: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n cassette3: $cassette3\n cassette4: $cassette4\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n }\n }\n"]))),Zp=function(e){var t=e.machine,n=e.config,r=e.refetchData,i=e.bills,o=Up(),c=Object(a.useState)(!1),d=Object(l.a)(c,2),m=d[0],h=d[1],p=n&&ss("cashOut")(n),b=n&&ss("locale")(n),f=n&&ss("notifications",n),j=null===b||void 0===b?void 0:b.fiatCurrency,g=t.numberOfCassettes,O=function(e){return ss(e)(p)},x=function(e){var t=e.deviceId;return!O(t).active},v=[{name:"cashbox",header:"Cash box",width:Gp[g].cashbox,stripe:!1,view:function(e){return Object(qe.jsx)(ei,{currency:{code:j},notes:e,total:js.a(T.a((function(e){return e.fiat}))(i))})},input:oi,inputProps:{decimalPlaces:0}}];im.a(om.a(lm.a,g),(function(e){return v.push({name:"cassette".concat(e),header:"Cash cassette ".concat(e),width:Gp[g].cassette,stripe:!0,doubleHeader:"Cash-out",view:function(n){var a;return Object(qe.jsx)(ti,{className:o.cashbox,denomination:null===(a=O(t.deviceId))||void 0===a?void 0:a["cassette".concat(e)],currency:{code:j},notes:n,width:Gp[g].cassetteGraph,threshold:f["fillingPercentageCassette".concat(e)]})},isHidden:function(t){var n=t.numberOfCassettes;return e>n},input:ai,inputProps:{decimalPlaces:0,width:Gp[g].cassetteGraph,inputClassName:o.cashbox}}),cm.a(1,e)}),1),v.push({name:"edit",header:"Edit",width:Gp[g].editWidth,view:function(){return Object(qe.jsx)(ta,{onClick:function(){h(!0)},children:Object(qe.jsx)(Dh,{})})}});var y=Object(u.b)(_p,{refetchQueries:function(){return r()}}),w=Object(l.a)(y,2),C=w[0],k=w[1].error,E=function(e,n,a){return C({variables:Object(s.a)({action:"setCassetteBills",deviceId:t.deviceId,cashbox:n},a)})};return t.name?Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_h,{error:null===k||void 0===k?void 0:k.message,editWidth:Gp[g].editWidth,stripeWhen:x,disableRowEdit:x,name:"cashboxes",elements:v,data:[t],save:E,validationSchema:Xp}),m&&Object(qe.jsx)(Hp,{machine:t,cashoutSettings:O(t.deviceId),onClose:function(){h(!1)},error:null===k||void 0===k?void 0:k.message,save:E,locale:b})]}):null},Kp=n(1135),Qp=n(1122),Yp={marginLeft:6},Jp=Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Pc,{}),Object(qe.jsx)("span",{style:Yp,children:"Cash-in"})]}),eb=Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Wc,{}),Object(qe.jsx)("span",{style:Yp,children:"Cash-out"})]}),tb=function(e){return function(e){return[{name:"name",width:280,size:"sm",view:function(e){return"".concat(e)}},{header:Jp,name:"cashIn",display:"Cash-in",width:130,textAlign:"right",suffix:"%"},{header:eb,name:"cashOut",display:"Cash-out",width:130,textAlign:"right",suffix:"%",inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:155,doubleHeader:"Cash-in only",textAlign:"right",suffix:e},{name:"minimumTx",display:"Minimun Tx",width:155,doubleHeader:"Cash-in only",textAlign:"right",suffix:e}]}(e)},nb=x()(yp||(yp=Object(c.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),ab=x()(wp||(wp=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),rb=function(e){var t=e.name,n=e.id,a=Object(u.c)(nb),r=a.data,i=a.loading,o=Object(u.b)(ab,{refetchQueries:function(){return["getData"]}}),c=Object(l.a)(o,1)[0],s=(null===r||void 0===r?void 0:r.config)&&ss(t)(r.config),d=A.a(["fiatCurrency"])(ss(es)(null===r||void 0===r?void 0:r.config));return Object(qe.jsx)(_h,{name:"overrides",save:function(e){var n=ds(t)(e);return c({variables:{config:n}})},data:function(){if(i||!n||!s)return[];var e=s.overrides?ml.a(M.a(W.a("machine","ALL_MACHINES"),s.overrides),M.a(W.a("machine",n),s.overrides)):[];return T.a((function(t){return gs.a(Kp.a,{code:t.code,name:t.display,cashIn:s.cashIn,cashOut:s.cashOut,fixedFee:s.fixedFee,minimumTx:s.minimumTx},Qp.a(["cashIn","cashOut","fixedFee","minimumTx"],M.a((function(e){return L.a(t.code,e.cryptoCurrencies)||L.a("ALL_COINS",e.cryptoCurrencies)}),e)))}),r.cryptoCurrencies)}(),elements:tb(d)})},ib={douro1:"Douro",sintra:"Sintra",gaia:"Gaia",tejo:"Tejo"},ob={grid:{flex:1,height:"100%"},content:{display:"flex",flexDirection:"column",flex:1,marginLeft:48,maxWidth:900},subtitle:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row",color:$},label3:{color:$,marginTop:0,fontSize:12},row:{display:"flex",flexDirection:"row",justifyContent:"space-around"},rowItem:{flex:1,marginBottom:16},detailItem:{marginBottom:32},actionButtonsContainer:{display:"flex",flexDirection:"row"},breadcrumbsContainer:{marginTop:32},breadcrumbLink:{textDecoration:"none"},detailsMargin:{marginTop:24},sidebarContainer:{height:400,overflowY:"auto"},contentContainer:{"& > *":{marginTop:26},"& > *:first-child":{marginTop:0}}},lb=Object(f.a)(ob),cb=function(e){var t=e.data,n=e.timezone,a=lb();return Object(qe.jsxs)("div",{className:a.row,children:[Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(it,{className:a.label3,children:"Paired at"}),Object(qe.jsx)(Ke,{children:t.pairedAt?md(t.pairedAt,n,"yyyy-MM-dd HH:mm:ss"):""})]}),Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(it,{className:a.label3,children:"Machine model"}),Object(qe.jsx)(Ke,{children:ib[t.model]})]}),Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(it,{className:a.label3,children:"Software version"}),Object(qe.jsx)(Ke,{children:t.version})]})]})},sb=n(1067),db=Object(f.a)({dialogContent:{width:434,padding:16,paddingRight:28},dialogTitle:{padding:16,paddingRight:12,display:"flex","justify-content":"space-between","& > h4":{margin:0},"& > button":{padding:0,marginTop:-4}},dialogActions:{padding:32,paddingTop:16}}),ub=function(e){var t=e.children,n=e.onClose,a=db();return Object(qe.jsxs)("div",{className:a.dialogTitle,children:[t,n&&Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:n,children:Object(qe.jsx)(qi,{})})]})},mb=Object(a.memo)((function(e){var t=e.title,n=void 0===t?"Confirm action":t,r=e.errorMessage,i=void 0===r?"This action requires confirmation":r,o=e.open,c=e.toBeConfirmed,d=e.saveButtonAlwaysEnabled,u=void 0!==d&&d,m=e.message,h=e.confirmationMessage,p=void 0===h?"Write '".concat(c,"' to confirm this action"):h,b=e.onConfirmed,f=e.onDismissed,j=e.initialValue,g=void 0===j?"":j,O=e.disabled,x=void 0!==O&&O,v=Object(q.a)(e,["title","errorMessage","open","toBeConfirmed","saveButtonAlwaysEnabled","message","confirmationMessage","onConfirmed","onDismissed","initialValue","disabled"]),y=db(),w=Object(a.useState)(g),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],L=S[1],F=!u&&c!==k||""===k;return Object(qe.jsxs)(cn.a,Object(s.a)(Object(s.a)({open:o,"aria-labelledby":"form-dialog-title"},v),{},{children:[Object(qe.jsx)(ub,{id:"customized-dialog-title",onClose:function(){E(""),L(!1),f()},children:Object(qe.jsx)(_e,{children:n})}),i&&Object(qe.jsx)(ub,{children:Object(qe.jsx)(rl,{children:i.split(":").map((function(e){return Object(qe.jsxs)(qe.Fragment,{children:[e,Object(qe.jsx)("br",{})]})}))})}),Object(qe.jsxs)(sn.a,{className:y.dialogContent,children:[m&&Object(qe.jsx)(Ke,{children:m}),Object(qe.jsx)(br.a,{htmlFor:"confirm-input",children:p}),Object(qe.jsx)(Xa,{disabled:x,name:"confirm-input",autoFocus:!0,id:"confirm-input",type:"text",size:"sm",fullWidth:!0,value:k,touched:{},error:I,InputLabelProps:{shrink:!0},onChange:function(e){return E(e.target.value)}})]}),Object(qe.jsx)(Xm.a,{className:y.dialogActions,children:Object(qe.jsx)(An,{color:"green",disabled:F,onClick:function(){return b(k)},children:"Confirm"})})]}))}));function hb(){return(hb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function pb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var bb=a.createElement("desc",null,"Created with Sketch."),fb=a.createElement("g",{id:"icon/button/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1",stroke:"#FFFFFF"}),a.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function jb(e,t){var n=e.title,r=e.titleId,i=pb(e,["title","titleId"]);return a.createElement("svg",hb({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,bb,fb)}var gb=a.forwardRef(jb);n.p;function Ob(){return(Ob=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function xb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var vb=a.createElement("desc",null,"Created with Sketch."),yb=a.createElement("g",{id:"icon/button/edit/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1",stroke:"#1B2559"}),a.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function wb(e,t){var n=e.title,r=e.titleId,i=xb(e,["title","titleId"]);return a.createElement("svg",Ob({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,vb,yb)}var Cb=a.forwardRef(wb);n.p;function kb(){return(kb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Eb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Nb=a.createElement("desc",null,"Created with Sketch."),Sb=a.createElement("g",{id:"icon/button/reboot/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-2"},a.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),a.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),a.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},a.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function Ib(e,t){var n=e.title,r=e.titleId,i=Eb(e,["title","titleId"]);return a.createElement("svg",kb({width:"12px",height:"12px",viewBox:"-0.493 -0.5 12.993 13",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Nb,Sb)}var Lb=a.forwardRef(Ib);n.p;function Fb(){return(Fb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Pb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Db=a.createElement("desc",null,"Created with Sketch."),Tb=a.createElement("g",{id:"icon/button/reboot/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",stroke:"#1B2559"},a.createElement("g",{id:"Group-2"},a.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),a.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),a.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},a.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function Rb(e,t){var n=e.title,r=e.titleId,i=Pb(e,["title","titleId"]);return a.createElement("svg",Fb({width:"12px",height:"12px",viewBox:"-0.493 -0.5 12.993 13",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Db,Tb)}var Bb=a.forwardRef(Rb);n.p;function Ab(){return(Ab=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Mb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Wb=a.createElement("desc",null,"Created with Sketch."),zb=a.createElement("g",{id:"icon/button/shut-down/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#FFFFFF"},a.createElement("path",{d:"M7.7735,2 C9.116,2.89710351 10,4.4271328 10,6.16330077 C10,8.92665975 7.7615,11.1666667 5,11.1666667 C2.2385,11.1666667 0,8.92665975 0,6.16330077 C0,4.43663919 0.8745,2.91361461 2.204,2.01450976",id:"Stroke-1"}),a.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function qb(e,t){var n=e.title,r=e.titleId,i=Mb(e,["title","titleId"]);return a.createElement("svg",Ab({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Wb,zb)}var $b=a.forwardRef(qb);n.p;function Hb(){return(Hb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Vb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ub=a.createElement("desc",null,"Created with Sketch."),Gb=a.createElement("g",{id:"icon/button/shut-down/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#1B2559"},a.createElement("path",{d:"M7.7735,2 C9.116,2.89710351 10,4.4271328 10,6.16330077 C10,8.92665975 7.7615,11.1666667 5,11.1666667 C2.2385,11.1666667 0,8.92665975 0,6.16330077 C0,4.43663919 0.8745,2.91361461 2.204,2.01450976",id:"Stroke-1"}),a.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function Xb(e,t){var n=e.title,r=e.titleId,i=Vb(e,["title","titleId"]);return a.createElement("svg",Hb({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Ub,Gb)}var _b=a.forwardRef(Xb);n.p;function Zb(){return(Zb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Kb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Qb=a.createElement("desc",null,"Created with Sketch."),Yb=a.createElement("g",{id:"icon/button/unpair/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-12",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-5"},a.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),a.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),a.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),a.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),a.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),a.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),a.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),a.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function Jb(e,t){var n=e.title,r=e.titleId,i=Kb(e,["title","titleId"]);return a.createElement("svg",Zb({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Qb,Yb)}var ef=a.forwardRef(Jb);n.p;function tf(){return(tf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function nf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var af=a.createElement("desc",null,"Created with Sketch."),rf=a.createElement("g",{id:"icon/button/unpair/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-12",stroke:"#1B2559"},a.createElement("g",{id:"Group-5"},a.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),a.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),a.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),a.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),a.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),a.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),a.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),a.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function of(e,t){var n=e.title,r=e.titleId,i=nf(e,["title","titleId"]);return a.createElement("svg",tf({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,af,rf)}var lf,cf,sf=a.forwardRef(of),df=(n.p,{label:{extend:Me.label1,color:se,marginBottom:4},inlineChip:{marginInlineEnd:"0.25em"},stack:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"start"},mr:{marginRight:8,marginBottom:8},warning:{color:he}}),uf=Object(f.a)(df),mf=x()(lf||(lf=Object(c.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $newName: String\n ) {\n machineAction(deviceId: $deviceId, action: $action, newName: $newName) {\n deviceId\n }\n }\n"]))),hf=x()(cf||(cf=Object(c.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n latestEvent {\n note\n }\n }\n }\n"]))),pf=Object(a.memo)((function(e){var t=e.machine,n=e.onActionSuccess,r=Object(a.useState)({command:null}),i=Object(l.a)(r,2),o=i[0],c=i[1],d=Object(a.useState)({}),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=uf(),x=Object(qe.jsx)("span",{className:O.warning,children:"A user may be in the middle of a transaction and they could lose their funds if you continue."}),v=Object(u.a)(hf,h),y=Object(l.a)(v,2),w=y[0],C=y[1].loading,k=Object(u.b)(mf,{onError:function(e){var t=e.message;g(null!==t&&void 0!==t?t:"An error ocurred")},onCompleted:function(){n&&n(),c({display:o.display,command:null})}}),E=Object(l.a)(k,2),N=E[0],S=E[1].loading,I=Boolean(o.command),L=!("restartServices"!==(null===o||void 0===o?void 0:o.command)||!C),F=function(e){p({variables:{deviceId:t.deviceId},onCompleted:function(t){var n,a=(n=function(e){var t,n;return JSON.parse(null!==(t=null===(n=e.machine.latestEvent)||void 0===n?void 0:n.note)&&void 0!==t?t:'{"state": null}').state}(t))&&!["chooseCoin","idle","pendingIdle","dualIdle","networkDown","unpaired","maintenance","virgin","wifiList"].includes(n)?x:null;c(Object(s.a)(Object(s.a)({},e),{},{message:a}))}}),w()};return Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Xe,{children:"Actions"}),Object(qe.jsxs)("div",{className:O.stack,children:[Object(qe.jsx)(He,{color:"primary",className:O.mr,Icon:Cb,InverseIcon:gb,disabled:S,onClick:function(){return c({command:"rename",display:"Rename",confirmationMessage:"Write the new name for this machine"})},children:"Rename"}),Object(qe.jsx)(He,{color:"primary",className:O.mr,Icon:sf,InverseIcon:ef,disabled:S,onClick:function(){return c({command:"unpair",display:"Unpair"})},children:"Unpair"}),Object(qe.jsx)(He,{color:"primary",className:O.mr,Icon:Bb,InverseIcon:Lb,disabled:S,onClick:function(){return c({command:"reboot",display:"Reboot"})},children:"Reboot"}),Object(qe.jsx)(He,{color:"primary",className:O.mr,Icon:_b,InverseIcon:$b,disabled:S,onClick:function(){return c({command:"shutdown",display:"Shutdown",message:"In order to bring it back online, the machine will need to be visited and its power reset."})},children:"Shutdown"}),Object(qe.jsx)(He,{color:"primary",className:O.inlineChip,Icon:Bb,InverseIcon:Lb,disabled:S,onClick:function(){F({command:"restartServices",display:"Restart services for"})},children:"Restart Services"})]}),Object(qe.jsx)(mb,{disabled:L,open:I,title:"".concat(o.display," this machine?"),errorMessage:j,toBeConfirmed:t.name,message:null===o||void 0===o?void 0:o.message,confirmationMessage:null===o||void 0===o?void 0:o.confirmationMessage,saveButtonAlwaysEnabled:"rename"===(null===o||void 0===o?void 0:o.command),onConfirmed:function(e){g(null),N({variables:Object(s.a)({deviceId:t.deviceId,action:"".concat(null===o||void 0===o?void 0:o.command)},"rename"===(null===o||void 0===o?void 0:o.command)&&{newName:e})})},onDismissed:function(){c({display:o.display,command:null}),g(null)}})]})})),bf=n(557);function ff(){return(ff=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gf=a.createElement("desc",null,"Created with Sketch."),Of=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("g",{id:"icon/action/copy",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5-Copy-2"},a.createElement("polyline",{id:"Stroke-1",strokeWidth:2,points:"6 1.2 6 -0.00024 16 -0.00024 16 13.06376 12 13.06376"}),a.createElement("polygon",{id:"Stroke-3",strokeWidth:2,strokeLinecap:"round",points:"0 15.9368 10 15.9368 10 2.9368 0 2.9368"}))));function xf(e,t){var n=e.title,r=e.titleId,i=jf(e,["title","titleId"]);return a.createElement("svg",ff({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,gf,Of)}var vf=a.forwardRef(xf),yf=(n.p,{titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},wrapper:{flex:1,display:"flex",flexDirection:"row",height:"100%"},tableWrapper:{flex:1,marginLeft:40,display:"block",overflowX:"auto",width:"100%",maxWidth:"78%",maxHeight:"70vh"},table:{whiteSpace:"nowrap",display:"block","& th":{position:"sticky",top:0}},dateColumn:{minWidth:160},levelColumn:{minWidth:100},fillColumn:{width:"100%"},shareButton:{margin:8,display:"flex",alignItems:"center",fontSize:Ce,padding:[[0,12]]},shareIcon:{marginRight:6},button:{margin:8},titleAndButtonsContainer:{display:"flex"},buttonsWrapper:{display:"flex",marginLeft:16,"& > *":{margin:"auto 6px"}}}),wf=Me.label1,Cf={wrapper:{extend:Me.mono,display:"flex",alignItems:"center"},address:{lineBreak:"anywhere"},buttonWrapper:{"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},popoverContent:{extend:wf,display:"flex",justifyContent:"center",alignItems:"center",color:K,borderRadius:4,padding:[[5,9]]}},kf={idCardDataCard:{extend:Me.p,display:"flex",padding:[[11,8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,"&:last-child":{marginBottom:0}}}}},Ef={label:{extend:wf,color:se,marginBottom:4}},Nf={titleWrapper:yf.titleWrapper,titleAndButtonsContainer:yf.titleAndButtonsContainer,buttonsWrapper:yf.buttonsWrapper,headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div":{marginLeft:24},"& > div:first-child":{marginLeft:0},"& span":{extend:wf,marginLeft:6}},overflowTd:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},flexWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",marginRight:16},customerLinkIcon:{marginLeft:2},flexRow:{display:"flex",flexDirection:"row",alignItems:"center"},machineRedirectContainer:{marginLeft:10,paddingLeft:5,paddingRight:5}},Sf=Object(f.a)(Cf),If=function(e){var t=e.className,n=e.buttonClassname,r=e.children,i=e.wrapperClassname,o=(Object(q.a)(e,["className","buttonClassname","children","wrapperClassname"]),Object(a.useState)(null)),c=Object(l.a)(o,2),s=c[0],d=c[1];Object(a.useEffect)((function(){s&&setTimeout((function(){return d(null)}),3e3)}),[s]);var u=Sf(),m=Boolean(s),h=m?"simple-popper":void 0;return Object(qe.jsx)("div",{className:I()(u.wrapper,i),children:r&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:I()(u.address,t),children:r}),Object(qe.jsx)("div",{className:I()(u.buttonWrapper,n),children:Object(qe.jsx)(bf.CopyToClipboard,{text:Rm.a(/\s/g,"")(r),children:Object(qe.jsx)("button",{"aria-describedby":h,onClick:function(e){return function(e){d(s?null:e.currentTarget)}(e)},children:Object(qe.jsx)(vf,{})})})}),Object(qe.jsx)(Xn,{id:h,open:m,anchorEl:s,onClose:function(){d(null)},arrowSize:3,bgColor:$,placement:"top",children:Object(qe.jsx)("div",{className:u.popoverContent,children:Object(qe.jsx)("div",{children:"Copied to clipboard!"})})})]})})},Lf=Object(f.a)(ob),Ff=function(e){var t=e.data,n=e.onActionSuccess,a=Lf();return Object(qe.jsxs)("div",{className:a.contentContainer,children:[Object(qe.jsx)("div",{className:a.row,children:Object(qe.jsx)("div",{className:a.rowItem,children:Object(qe.jsx)(Xe,{children:t.name})})}),Object(qe.jsx)("div",{className:a.row,children:Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Status"}),t&&t.statuses?Object(qe.jsx)(Wu,{status:t.statuses[0]}):null]})}),Object(qe.jsxs)("div",{className:a.row,children:[Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Ping"}),Object(qe.jsx)(Ke,{noMargin:!0,children:t.responseTime?new $c.a(t.responseTime).toFixed(3).toString()+" ms":"unavailable"})]}),Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Last ping"}),Object(qe.jsx)(Ke,{noMargin:!0,children:t.lastPing?Object(sb.a)(new Date(t.lastPing),new Date,{addSuffix:!0}):"unknown"})]}),Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Network speed"}),Object(qe.jsx)(Ke,{noMargin:!0,children:t.downloadSpeed?new $c.a(t.downloadSpeed).toFixed(t.downloadSpeed<10?2:0).toString()+" MB/s":"unavailable"})]})]}),Object(qe.jsx)("div",{className:a.row,children:Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Device ID"}),Object(qe.jsx)(Ke,{noMargin:!0,children:Object(qe.jsx)(If,{buttonClassname:a.copyToClipboard,children:t.deviceId})})]})}),Object(qe.jsx)("div",{className:a.row,children:Object(qe.jsx)(pf,{machine:t,onActionSuccess:n})})]})},Pf=n(68),Df=n(1115),Tf=n(1073),Rf=n(320),Bf=n.n(Rf),Af=n(558),Mf=n.n(Af);function Wf(){return(Wf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function zf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var qf=a.createElement("g",{id:"icon/ID/card/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),a.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:1.6}),a.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#FFFFFF",strokeWidth:1.6}),a.createElement("polygon",{id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:1.6,points:"4.14285714 12.2 9.64285714 12.2 9.64285714 5 4.14285714 5"}));function $f(e,t){var n=e.title,r=e.titleId,i=zf(e,["title","titleId"]);return a.createElement("svg",Wf({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/white"):n?a.createElement("title",{id:r},n):null,qf)}var Hf=a.forwardRef($f);n.p;function Vf(){return(Vf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Uf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Gf=a.createElement("g",{id:"icon/ID/card/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-2",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.6},a.createElement("g",{id:"id-copy"},a.createElement("polygon",{id:"Stroke-1",points:"0 16 22 16 22 0 0 0"}),a.createElement("line",{x1:11.7857143,y1:4,x2:18.8571429,y2:4,id:"Stroke-3"}),a.createElement("line",{x1:11.7857143,y1:7.2,x2:18.8571429,y2:7.2,id:"Stroke-4"}),a.createElement("polygon",{id:"Stroke-5",points:"3.14285714 11.2 8.64285714 11.2 8.64285714 4 3.14285714 4"}))));function Xf(e,t){var n=e.title,r=e.titleId,i=Uf(e,["title","titleId"]);return a.createElement("svg",Vf({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/zodiac"):n?a.createElement("title",{id:r},n):null,Gf)}var _f=a.forwardRef(Xf);n.p;function Zf(){return(Zf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Kf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Qf=a.createElement("g",{id:"icon/ID/phone/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#FFFFFF",strokeWidth:1.6}));function Yf(e,t){var n=e.title,r=e.titleId,i=Kf(e,["title","titleId"]);return a.createElement("svg",Zf({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/white"):n?a.createElement("title",{id:r},n):null,Qf)}var Jf=a.forwardRef(Yf);n.p;function ej(){return(ej=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function tj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nj=a.createElement("g",{id:"icon/ID/phone/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#1B2559",strokeWidth:1.6}));function aj(e,t){var n=e.title,r=e.titleId,i=tj(e,["title","titleId"]);return a.createElement("svg",ej({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/zodiac"):n?a.createElement("title",{id:r},n):null,nj)}var rj=a.forwardRef(aj);n.p;function ij(){return(ij=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function oj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lj=a.createElement("g",{id:"icon/ID/photo/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M12,14 C9.7912,14 8,12.2088 8,10 C8,7.7912 9.7912,6 12,6 C14.2088,6 16,7.7912 16,10 C16,12.2088 14.2088,14 12,14 Z M16.7142857,3.4 L14.3571429,1 L9.64285714,1 L7.28571429,3.4 L1,3.4 L1,17 L23,17 L23,3.4 L16.7142857,3.4 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:1.6}));function cj(e,t){var n=e.title,r=e.titleId,i=oj(e,["title","titleId"]);return a.createElement("svg",ij({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/white"):n?a.createElement("title",{id:r},n):null,lj)}var sj=a.forwardRef(cj);n.p;function dj(){return(dj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function uj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var mj=a.createElement("desc",null,"Created with Sketch."),hj=a.createElement("g",{id:"icon/button/cancel/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#1B2559",strokeWidth:1.2},a.createElement("line",{x1:12,y1:0,x2:0,y2:12,id:"Stroke-1"}),a.createElement("line",{x1:0,y1:0,x2:12,y2:12,id:"Stroke-3"})));function pj(e,t){var n=e.title,r=e.titleId,i=uj(e,["title","titleId"]);return a.createElement("svg",dj({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,mj,hj)}var bj=a.forwardRef(pj);n.p;function fj(){return(fj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gj=a.createElement("desc",null,"Created with Sketch."),Oj=a.createElement("g",{id:"icon/button/download/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#FFFFFF"},a.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),a.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),a.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1"})));function xj(e,t){var n=e.title,r=e.titleId,i=jj(e,["title","titleId"]);return a.createElement("svg",fj({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,gj,Oj)}var vj=a.forwardRef(xj);n.p;function yj(){return(yj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Cj=a.createElement("desc",null,"Created with Sketch."),kj=a.createElement("g",{id:"icon/button/download/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#1B2559"},a.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),a.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),a.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1"})));function Ej(e,t){var n=e.title,r=e.titleId,i=wj(e,["title","titleId"]);return a.createElement("svg",yj({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Cj,kj)}var Nj,Sj,Ij,Lj=a.forwardRef(Ej),Fj=(n.p,n(92)),Pj=n(567),Dj=n(175),Tj=n(109),Rj=n(559),Bj=n(399),Aj="",Mj=Object(Bj.createUploadLink)({credentials:"include",uri:"".concat(Aj,"/graphql")}),Wj=Object(Bj.createUploadLink)({credentials:"include",uri:"".concat("","/graphql")}),zj=function(e){var t=e.children,n=Object(w.h)(),r=Object(w.i)(),i=Object(a.useContext)(k),o=(i.userData,function(e,t,n,a,r){return new Dj.a({link:Tj.ApolloLink.from([Object(Rj.a)((function(n){var r=n.graphQLErrors,i=n.networkError;r&&r.forEach((function(n){var r=n.message,i=n.locations,o=n.path,l=n.extensions;"UNAUTHENTICATED"===(null===l||void 0===l?void 0:l.code)&&(a(null),"/login"!==t.pathname&&e.push("/login")),console.log("[GraphQL error]: Message: ".concat(r,", Location: ").concat(i,", Path: ").concat(o))})),i&&console.log("[Network error]: ".concat(i))})),new Tj.ApolloLink((function(e,t){return t(e).map((function(t){var n=e.getContext().response.headers;if(n){var a=n.get("lamassu_role");r(a)}return t}))})),Tj.ApolloLink.split((function(e){return"pazuz"===e.getContext().clientName}),Wj,Mj)]),cache:new Pj.a,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})}(n,r,0,i.setUserData,i.setRole));return Object(qe.jsx)(Fj.a,{client:o,children:t})},qj=n(1068),$j=n(1069),Hj=n(1070),Vj=n(1071),Uj=n(1072),Gj=Pu.a(Gm.a(["firstName","lastName"]),gd.a,mm.a(qj.a([D.a,Wa.a])),T.a(zm),$j.a(" ")),Xj=function(e){var t,n=e.isAnonymous,a=e.customerName,r=e.customerIdCardData,i=e.customerPhone;return n?"Anonymous":a||za.a(i,(t=r)?function(e){var t=e.firstName,n=e.lastName;return t&&n?"".concat(Hj.a(Vj.a,Uj.a)(t),". ").concat(n):D.a(t)?n:D.a(n)?t:null}(t):null)},_j={wrapper:{display:"flex",flexDirection:"column",marginTop:24},row:{display:"flex",flexDirection:"row",marginBottom:36},secondRow:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginBottom:36},lastRow:{display:"flex",flexDirection:"row",marginBottom:32},label:{color:se,margin:[[0,0,6,0]],whiteSpace:"nowrap"},txIcon:{marginRight:10},clipboardPopover:{height:164,width:215},idButton:{marginRight:4},idCardDataCard:{extend:Me.p,display:"flex",padding:[[11,8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,"&:last-child":{marginBottom:0}}}},bold:{fontWeight:700},direction:{width:233},availableIds:{width:232},exchangeRate:{width:250},commission:{width:217},address:{width:280},downloadRawLogs:{width:180},cancelTransaction:{width:160},status:{width:230,"& > button":{marginTop:20}},transactionId:{width:280},sessionId:{width:215},container:{display:"flex"},chip:{display:"flex",alignItems:"center",padding:"4px 8px 4px 8px",backgroundColor:$,color:K,height:24,marginBottom:-24,marginTop:-3,marginLeft:7,borderRadius:4},chipLabel:{color:K},otherActionsGroup:{display:"flex",flexDirection:"row"},addressHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},walletScore:{display:"flex",flexDirection:"row",alignItems:"center","& > p":{marginLeft:5}},error:{color:Q}},Zj=function(e){return"cashOut"===e.txClass?function(e){return"Operator cancel"===e.hasError?"Cancelled":e.hasError?"Error":e.dispense?"Success":e.expired?"Expired":"Pending"}(e):function(e){return e.operatorCompleted?"Cancelled":e.hasError||e.batchError?"Error":e.sendConfirmed?"Sent":e.expired?"Expired":e.batched?"Batched":"Pending"}(e)},Kj=function(e){return D.a(e.hasError)?D.a(e.batchError)?null:"Batch error: ".concat(e.batchError):e.hasError},Qj=Object(f.a)(_j),Yj=x()(Nj||(Nj=Object(c.a)(["\n query txSummaryAndLogs(\n $txId: ID!\n $deviceId: ID!\n $limit: Int\n $from: Date\n $until: Date\n $txClass: String\n $timezone: String\n ) {\n serverLogsCsv(\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n machineLogsCsv(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n transactionCsv(id: $txId, txClass: $txClass, timezone: $timezone)\n txAssociatedDataCsv(id: $txId, txClass: $txClass, timezone: $timezone)\n }\n"]))),Jj=x()(Sj||(Sj=Object(c.a)(["\n mutation cancelCashOutTransaction($id: ID!) {\n cancelCashOutTransaction(id: $id) {\n id\n }\n }\n"]))),eg=x()(Ij||(Ij=Object(c.a)(["\n mutation cancelCashInTransaction($id: ID!) {\n cancelCashInTransaction(id: $id) {\n id\n }\n }\n"]))),tg=function(e){return Pf.utils.toUnit(new $c.a(e.cryptoAtoms),e.cryptoCode).toNumber()},ng=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Pf.utils.formatCryptoAddress(e,t).replace(/(.{5})/g,"$1 ")},ag=function(e){var t=e.children,n=Qj();return Object(qe.jsx)(at,{className:n.label,children:t})},rg=function(e){var t,n,r,i=e.it,o=e.timezone,c=Qj(),s=Object(a.useState)({command:null}),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(""),b=Object(l.a)(p,2),f=b[0],j=b[1],g="cashIn"===i.txClass,O=new Mf.a,x=Object(u.a)(Yj,{onCompleted:function(e){return W(e)}}),v=Object(l.a)(x,1)[0],y=Object(u.b)(g?eg:Jj,{onError:function(e){var t=e.message;return j(null!==t&&void 0!==t?t:"An error occurred.")},refetchQueries:function(){return["transactions"]}}),w=Object(l.a)(y,1)[0],C=function(e){var t=Number.parseFloat(e.fiat),n=tg(e),a=Number.parseFloat(e.rawTickerPrice),r="cashIn"===e.txClass,i=r?Number.parseFloat(e.cashInFee):0;return r?function(e,t,n,a){return e-t*n+a}(t,n,a,i):function(e,t,n){return t*n-e}(t,n,a)}(i).toFixed(2),k=100*Number.parseFloat(i.commissionPercentage,2),E=g?Number.parseFloat(i.cashInFee):0,N=Number.parseFloat(i.fiat),S=tg(i),L=(N/S).toFixed(2),F="1 ".concat(i.cryptoCode," = ").concat(L," ").concat(i.fiatCode),P=i.discount?"-".concat(i.discount,"%"):null,R=Object(Df.a)(new Date,"yyyyMMdd"),B=i.customerIdCardData&&{name:Gj(i.customerIdCardData),age:null!==(t=i.customerIdCardData.dateOfBirth&&Object(Tf.a)(R(i.customerIdCardData.dateOfBirth),new Date))&&void 0!==t?t:"",country:i.customerIdCardData.country,idCardNumber:i.customerIdCardData.documentNumber,idCardExpirationDate:null!==(n=i.customerIdCardData.expirationDate&&Object(sd.a)("yyyy-MM-dd")(R(i.customerIdCardData.expirationDate)))&&void 0!==n?n:""},A=Object(bs.a)({minutes:3},new Date(i.created)),M=Object(Sd.a)({minutes:3},new Date(i.created)),W=function(){var e=Object(Bl.a)(Rl.a.mark((function e(t){var n,a,r;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="tx_".concat(i.id,"_summary.zip"),a=Hc.a(t),T.a((function(e){return O.file(e+".csv",t[e])}),a),e.next=5,O.generateAsync({type:"blob"});case 5:r=e.sent,Bf.a.saveAs(r,n);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),q=Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ag,{children:"Transaction status"}),Object(qe.jsx)("span",{className:c.bold,children:Zj(i)})]}),$=Object(qe.jsxs)("div",{className:c.walletScore,children:[Object(qe.jsx)("svg",{width:103,height:10,children:T.a((function(e){return Object(qe.jsx)("circle",{cx:10*e+6,cy:4,r:3.5,fill:e<i.walletScore?D.a(i.hasError)?J:he:D.a(i.hasError)?re:pe})}),Ru.a(0,10))}),Object(qe.jsx)(Ke,{noMargin:!0,className:I()((r={},Object(z.a)(r,c.bold,!0),Object(z.a)(r,c.error,!D.a(i.hasError)),r)),children:i.walletScore})]});return Object(qe.jsxs)("div",{className:c.wrapper,children:[Object(qe.jsxs)("div",{className:c.row,children:[Object(qe.jsxs)("div",{className:c.direction,children:[Object(qe.jsx)(ag,{children:"Direction"}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("span",{className:c.txIcon,children:g?Object(qe.jsx)(Pc,{}):Object(qe.jsx)(Wc,{})}),Object(qe.jsx)("span",{children:g?"Cash-in":"Cash-out"})]})]}),Object(qe.jsxs)("div",{className:c.availableIds,children:[Object(qe.jsx)(ag,{children:"Available IDs"}),Object(qe.jsxs)(tl.a,{display:"flex",flexDirection:"row",children:[i.customerPhone&&Object(qe.jsx)(Yn,{className:c.idButton,name:"phone",Icon:rj,InverseIcon:Jf,children:i.customerPhone}),i.customerIdCardPhotoPath&&!i.customerIdCardData&&Object(qe.jsx)(Yn,{popoverClassname:c.clipboardPopover,className:c.idButton,name:"card",Icon:_f,InverseIcon:Hf,children:Object(qe.jsx)("img",{className:c.idCardPhoto,src:"".concat(Aj,"/id-card-photo/").concat(i.customerIdCardPhotoPath),alt:""})}),i.customerIdCardData&&Object(qe.jsx)(Yn,{className:c.idButton,name:"card",Icon:_f,InverseIcon:Hf,children:Object(qe.jsxs)("div",{className:c.idCardDataCard,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Name"}),Object(qe.jsx)("div",{children:B.name})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Age"}),Object(qe.jsx)("div",{children:B.age})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Country"}),Object(qe.jsx)("div",{children:B.country})]})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"ID number"}),Object(qe.jsx)("div",{children:B.idCardNumber})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Expiration date"}),Object(qe.jsx)("div",{children:B.idCardExpirationDate})]})]})]})}),i.customerFrontCameraPath&&Object(qe.jsx)(Yn,{className:c.idButton,name:"cam",Icon:Ti,InverseIcon:sj,children:Object(qe.jsx)("img",{src:"".concat(Aj,"/front-camera-photo/").concat(i.customerFrontCameraPath),alt:""})}),i.txCustomerPhotoPath&&Object(qe.jsx)(Yn,{name:"cam",Icon:Ti,InverseIcon:sj,children:Object(qe.jsx)("img",{src:"".concat(Aj,"/operator-data/customersphotos/").concat(i.txCustomerPhotoPath),alt:""})})]})]}),Object(qe.jsxs)("div",{className:c.exchangeRate,children:[Object(qe.jsx)(ag,{children:"Exchange rate"}),Object(qe.jsx)("div",{children:S>0?F:"-"})]}),Object(qe.jsxs)("div",{className:c.commission,children:[Object(qe.jsx)(ag,{children:"Commission"}),Object(qe.jsxs)("div",{className:c.container,children:["".concat(C," ").concat(i.fiatCode," (").concat(k," %)"),P&&Object(qe.jsx)("div",{className:c.chip,children:Object(qe.jsx)(at,{className:c.chipLabel,children:P})})]})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Fixed fee"}),Object(qe.jsx)("div",{children:g?"".concat(E," ").concat(i.fiatCode):"N/A"})]})]}),Object(qe.jsxs)("div",{className:c.secondRow,children:[Object(qe.jsxs)("div",{className:c.address,children:[Object(qe.jsxs)("div",{className:c.addressHeader,children:[Object(qe.jsx)(ag,{children:"Address"}),!D.a(i.walletScore)&&Object(qe.jsx)(Np,{parentElements:$,children:"CipherTrace score: ".concat(i.walletScore,"/10")})]}),Object(qe.jsx)("div",{children:Object(qe.jsx)(If,{children:ng(i.cryptoCode,i.toAddress)})})]}),Object(qe.jsxs)("div",{className:c.transactionId,children:[Object(qe.jsx)(ag,{children:"Transaction ID"}),Object(qe.jsx)("div",{children:"cashOut"===i.txClass?"N/A":Object(qe.jsx)(If,{children:i.txHash})})]}),Object(qe.jsxs)("div",{className:c.sessionId,children:[Object(qe.jsx)(ag,{children:"Session ID"}),Object(qe.jsx)(If,{children:i.id})]})]}),Object(qe.jsxs)("div",{className:c.lastRow,children:[Object(qe.jsxs)("div",{className:c.status,children:[Kj(i)?Object(qe.jsx)(Np,{parentElements:q,width:200,children:Object(qe.jsx)(Ke,{children:Kj(i)})}):q,"cashOut"===i.txClass&&"Pending"===Zj(i)&&Object(qe.jsx)(He,{color:"primary",Icon:bj,InverseIcon:ba,className:c.cancelTransaction,onClick:function(){return h({command:"cancelTx"})},children:"Cancel transaction"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Other actions"}),Object(qe.jsx)("div",{className:c.otherActionsGroup,children:Object(qe.jsx)(He,{color:"primary",Icon:Lj,InverseIcon:vj,className:c.downloadRawLogs,onClick:function(){return function(e,t){var n=e.id,a=e.deviceId,r=e.txClass;v({variables:{txId:n,from:A,until:M,deviceId:a,txClass:r,timezone:t}})}(i,o)},children:"Download raw logs"})})]})]}),Object(qe.jsx)(mb,{open:"cancelTx"===m.command,title:"Cancel this transaction?",errorMessage:f,toBeConfirmed:i.machineName,message:g?"The user will not be able to redeem the inserted bills, even if they subsequently confirm the transaction. If they've already deposited bills, you'll need to reconcile this transaction with them manually.":"The user will not be able to redeem the cash, even if they subsequently send the required coins. If they've already sent you coins, you'll need to reconcile this transaction with them manually.",onConfirmed:function(){j(null),h({command:null}),w({variables:{id:i.id}})},onDismissed:function(){h({command:null}),j(null)}})]})},ig=Object(a.memo)(rg,(function(e,t){return e.it.id===t.it.id&&e.it.hasError===t.it.hasError&&e.it.batchError===t.it.batchError&&Zj(e.it)===Zj(t.it)})),og=n(144),lg={expandButton:{outline:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:4},rowWrapper:{padding:1},row:{border:[[2,"solid","transparent"]],borderRadius:0},expanded:{border:[[2,"solid",G]],boxShadow:"0 0 8px 0 rgba(0,0,0,0.08)"},before:{paddingTop:12},after:{paddingBottom:12},pointer:{cursor:"pointer"},body:{flex:[[1,1,"auto"]]},table:function(e){return{marginBottom:30,minHeight:200,width:e.width,flex:1,display:"flex",flexDirection:"column"}},emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}};function cg(){return(cg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sg(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dg=a.createElement("desc",null,"Created with Sketch."),ug=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/action/expand/closed",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.5},a.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function mg(e,t){var n=e.title,r=e.titleId,i=sg(e,["title","titleId"]);return a.createElement("svg",cg({width:"18px",height:"6px",viewBox:"0 0 18 6",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,dg,ug)}var hg=a.forwardRef(mg);n.p;function pg(){return(pg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bg(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fg=a.createElement("desc",null,"Created with Sketch."),jg=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/action/expand/open",transform:"translate(1.000000, 1.000000)",fill:"#1B2559",stroke:"#1B2559",strokeWidth:1.5},a.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function gg(e,t){var n=e.title,r=e.titleId,i=bg(e,["title","titleId"]);return a.createElement("svg",pg({width:"18px",height:"6px",viewBox:"0 0 18 6",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,fg,jg)}var Og,xg,vg,yg,wg,Cg=a.forwardRef(gg),kg=(n.p,Object(f.a)(lg)),Eg=function(e){var t,n=e.id,a=e.elements,r=e.data,i=e.width,o=e.Details,l=e.expanded,c=e.expandRow,d=e.expWidth,u=e.expandable,m=e.onClick,h=kg(),p=m||u,b=(t={},Object(z.a)(t,h.pointer,p),Object(z.a)(t,h.row,!0),Object(z.a)(t,h.expanded,l),t);return Object(qe.jsxs)("div",{className:h.rowWrapper,children:[Object(qe.jsx)("div",{className:I()(Object(z.a)({},h.before,l&&0!==n)),children:Object(qe.jsxs)(Lm,{className:I()(b),onClick:function(){u&&c(n),m&&m(r)},error:r.error,errorMessage:r.errorMessage,children:[a.map((function(e,t){var n=e.view,a=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,i=Object(q.a)(e,["view"]);return Object(qe.jsx)(Nm,Object(s.a)(Object(s.a)({},i),{},{children:a(r)}),t)})),u&&Object(qe.jsx)(Nm,{width:d,textAlign:"center",children:Object(qe.jsxs)("button",{onClick:function(){return c(n)},className:h.expandButton,children:[l&&Object(qe.jsx)(Cg,{}),!l&&Object(qe.jsx)(hg,{})]})})]})}),u&&l&&Object(qe.jsx)("div",{className:h.after,children:Object(qe.jsx)(Lm,{className:I()(Object(z.a)({},h.expanded,l)),children:Object(qe.jsx)(Nm,{width:i,children:Object(qe.jsx)(o,{it:r})})})})]})},Ng=function(e){var t=e.elements,n=void 0===t?[]:t,r=e.data,i=void 0===r?[]:r,o=e.Details,c=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,p=e.extraHeight,b=Object(q.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","extraHeight"]),f=Object(a.useState)(d),j=Object(l.a)(f,2),g=j[0],O=j[1];Object(a.useEffect)((function(){return O(d)}),[d]);var x=F.a(js.a,T.a(R.a("width")))(n),v=850-x,y=x+(c?v:0),w=kg({width:y}),C=function(e){O(e===g?null:e)},k=new og.c({defaultHeight:62,fixedWidth:!0});function E(e){var t=e.index,a=e.key,r=e.parent,l=e.style;return Object(qe.jsx)(og.b,{cache:k,columnIndex:0,parent:r,rowIndex:t,children:Object(qe.jsx)("div",{style:l,children:Object(qe.jsx)(Eg,{width:y,id:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:t===g,expandRow:C,expandable:c,onClick:u})})},a)}return Object(qe.jsx)(tl.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(qe.jsxs)(wm,{className:w.table,children:[Object(qe.jsxs)(Cm,{children:[n.map((function(e,t){var n=e.width,a=e.className,r=e.textAlign,i=e.header;return Object(qe.jsx)(Sm,{width:n,className:a,textAlign:r,children:i},t)})),c&&Object(qe.jsx)(Sm,{width:v})]}),Object(qe.jsxs)(Em,{className:w.body,children:[m&&Object(qe.jsx)(_e,{children:"Loading..."}),!m&&Wa.a(i)&&Object(qe.jsx)(_e,{children:h}),Object(qe.jsx)(og.a,{disableWidth:!0,disableHeight:!0,children:function(){return Object(qe.jsx)(og.d,Object(s.a)(Object(s.a)({style:{overflowX:"inherit",outline:"none"}},b),{},{height:62*i.length+p,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:E,overscanRowCount:50,deferredMeasurementCache:k}))}})]})]})})},Sg=Object(f.a)(Nf),Ig=x()(Og||(Og=Object(c.a)(["\n query transactions($limit: Int, $from: Date, $until: Date, $deviceId: ID) {\n transactions(\n limit: $limit\n from: $from\n until: $until\n deviceId: $deviceId\n ) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n customerName\n customerIdCardData\n customerIdCardPhotoPath\n customerFrontCameraPath\n customerPhone\n discount\n customerId\n isAnonymous\n rawTickerPrice\n }\n }\n"]))),Lg=x()(xg||(xg=Object(c.a)(["\n query getData {\n config\n }\n"]))),Fg=function(e){var t=e.id,n=Sg(),r=Object(a.useState)(0),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(""),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(u.a)(Ig,{variables:{limit:5,deviceId:t}}),b=Object(l.a)(p,2),f=b[0],j=b[1],g=j.data,O=j.loading,x=Object(u.c)(Lg),v=x.data,y=x.loading,w=A.a(["config","locale_timezone"],v),C=O||y;!C&&g&&(g.transactions=g.transactions.splice(0,5)),Object(a.useEffect)((function(){null!==t&&f()}),[f,t]);var k=[{header:"",width:0,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(qe.jsx)(Wc,{}):Object(qe.jsx)(Pc,{})}},{header:"Customer",width:122,size:"sm",view:Xj},{header:"Cash",width:144,textAlign:"right",size:"sm",view:function(e){return"".concat(Number.parseFloat(e.fiat)," ").concat(e.fiatCode)}},{header:"Crypto",width:164,textAlign:"right",size:"sm",view:function(e){return"".concat(Pf.utils.toUnit(new $c.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return Pf.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:n.overflowTd,size:"sm",textAlign:"left",width:140},{header:"Date",view:function(e){return md(e.created,w,"yyyy\u2011MM\u2011dd")},textAlign:"left",size:"sm",width:140},{header:"Status",view:function(e){return Zj(e)},size:"sm",width:20}];return Object(qe.jsx)(Ng,{extraHeight:o,onClick:function(e){m===e.id?(h(""),c(0)):(h(e.id),c(310))},loading:C||null===t,emptyText:"No transactions so far",elements:k,data:A.a(["transactions"])(g),Details:ig,expandable:!0})},Pg=Object(f.a)(ob),Dg=x()(vg||(vg=Object(c.a)(["\n query getMachine($deviceId: ID!, $billFilters: JSONObject) {\n machine(deviceId: $deviceId) {\n name\n deviceId\n paired\n lastPing\n pairedAt\n version\n model\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n latestEvent {\n note\n }\n }\n bills(filters: $billFilters) {\n id\n fiat\n deviceId\n created\n }\n config\n }\n"]))),Tg=function(e){var t,n,a,r,i,o,l=e.data,c=e.refetch,s=e.reload,d=Pg(),u=null!==(t=A.a(["config","locale_timezone"],l))&&void 0!==t?t:{},m=null!==(n=A.a(["machine"])(l))&&void 0!==n?n:{},p=null!==(a=A.a(["config"])(l))&&void 0!==a?a:{},b=null!==(r=A.a(["bills"])(l))&&void 0!==r?r:[],f=null!==(i=A.a(["name"])(m))&&void 0!==i?i:null,j=null!==(o=A.a(["deviceId"])(m))&&void 0!==o?o:null;return Object(qe.jsxs)(h.a,{container:!0,className:d.grid,children:[Object(qe.jsx)(h.a,{item:!0,xs:3,children:Object(qe.jsx)(h.a,{item:!0,xs:12,children:Object(qe.jsxs)("div",{className:d.breadcrumbsContainer,children:[Object(qe.jsxs)(nm.a,{separator:Object(qe.jsx)(rm.a,{fontSize:"small"}),children:[Object(qe.jsx)(C.b,{to:"/dashboard",className:d.breadcrumbLink,children:Object(qe.jsx)(it,{noMargin:!0,className:d.subtitle,children:"Dashboard"})}),Object(qe.jsx)(nt,{noMargin:!0,className:d.subtitle,children:f})]}),Object(qe.jsx)(Ff,{data:m,onActionSuccess:s})]})})}),Object(qe.jsx)(h.a,{item:!0,xs:9,children:Object(qe.jsxs)("div",{className:d.content,children:[Object(qe.jsxs)("div",{className:I()(d.detailItem,d.detailsMargin),children:[Object(qe.jsx)(tt,{className:d.subtitle,children:"Details"}),Object(qe.jsx)(cb,{data:m,timezone:u})]}),Object(qe.jsxs)("div",{className:d.detailItem,children:[Object(qe.jsx)(tt,{className:d.subtitle,children:"Cash box & cassettes"}),Object(qe.jsx)(Zp,{refetchData:c,machine:m,config:null!==p&&void 0!==p&&p,bills:b})]}),Object(qe.jsxs)("div",{className:d.transactionsItem,children:[Object(qe.jsx)(tt,{className:d.subtitle,children:"Latest transactions"}),Object(qe.jsx)(Fg,{id:j})]}),Object(qe.jsxs)("div",{className:d.detailItem,children:[Object(qe.jsx)(tt,{className:d.subtitle,children:"Commissions"}),Object(qe.jsx)(rb,{name:"commissions",id:j})]})]})})]})},Rg=function(){var e=Object(w.i)(),t=Object(w.h)(),n=function(e){return e.slice(e.lastIndexOf("/")+1)}(e.pathname),r=Object(a.useState)(!0),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(u.c)(Dg,{onCompleted:function(e){if(null===e.machine)return t.push("/maintenance/machine-status");c(!1)},variables:{deviceId:n},billFilters:{deviceId:n,batch:"none"}}),d=s.data,m=s.refetch;return!o&&Object(qe.jsx)(Tg,{data:d,refetch:m,reload:function(){return t.push(e.pathname)}})},Bg=n(102),Ag=n(330),Mg=n(1075),Wg=n(1076),zg={AED:{thickness:12,lengths:{5:[153,133],10:[157,137],20:[159,139],50:[161,141],100:[165,145],200:[167,147],500:[169,149],1e3:[173,153]},polymer:!1},ANG:{thickness:12,lengths:{10:[152,142],25:[152,142],50:[152,142],100:[152,142]},polymer:!1},AUD:{thickness:13,lengths:{5:[140,120],10:[147,127],20:[154,134],50:[161,141],100:[168,148]},polymer:!0},BGN:{thickness:13,lengths:{1:[117,107],2:[121,111],5:[126,116],10:[131,121],20:[136,126],50:[141,131],100:[146,136]},polymer:!1},CAD:{thickness:13,lengths:{5:[162,142],10:[162,142],20:[162,142],50:[162,142],100:[162,142]},polymer:!0},CHF:{thickness:13,lengths:{10:[133,113],20:[140,120],50:[147,127],100:[154,134],200:[161,141],1e3:[168,148]},polymer:!1},CNY:{thickness:13,lengths:{1:[140,120],5:[145,125],10:[150,130],20:[155,135],50:[160,140],100:[145,165]},polymer:!1},COP:{thickness:13,lengths:{2e3:[138,118],5e3:[143,123],1e4:[148,128],2e4:[153,133],5e4:[158,138],1e5:[163,143]},polymer:!1},CZK:{thickness:12,lengths:{100:[150,130],200:[156,136],500:[162,142],1e3:[168,148],2e3:[174,154],5e3:[180,160]},polymer:!1},EUR:{thickness:12,lengths:{5:[130,110],10:[137,117],20:[143,123],50:[150,130],100:[157,137],200:[163,143],500:[170,150]},polymer:!1},GBP:{thickness:13,lengths:{5:[145,125],10:[152,132],20:[149,129],50:[166,146]},polymer:!0},GHS:{thickness:12,lengths:{1:[147,127],2:[150,130],5:[151,131],10:[155,135],20:[159,139],50:[163,143]},polymer:!1},GIP:{thickness:12,lengths:{5:[138,128],10:[146,136],20:[155,145],50:[162,152],100:[169,159]},polymer:!1},GTQ:{thickness:12,lengths:{1:[160,150],5:[160,150],10:[160,150],20:[160,150],50:[160,150],100:[161,151],200:[160,150]},polymer:!0},HKD:{thickness:13,lengths:{10:[144,124],20:[153,133],50:[158,138],100:[163,143],500:[168,148],1e3:[174,154]},polymer:!1},HNL:{thickness:12,lengths:{1:[166,146],2:[166,146],5:[166,146],10:[166,146],20:[166,146],50:[166,146],100:[166,146],200:[166,146],500:[166,146]},polymer:!1},HRK:{thickness:12,lengths:{5:[127,117],10:[131,121],20:[135,125],50:[139,129],100:[143,133],200:[147,137],500:[151,141],1e3:[155,145]},polymer:!1},ILS:{thickness:13,lengths:{20:[139,119],50:[146,126],100:[153,133],200:[160,140]},polymer:!1},JPY:{thickness:13,lengths:{1e3:[153,147],2e3:[156,152],5e3:[157,154],1e4:[163,158]},polymer:!1},KRW:{thickness:13,lengths:{1e3:[146,126],2e3:[150,130],5e3:[152,132],1e4:[158,138],5e4:[164,144]},polymer:!1},MDL:{thickness:12,lengths:{1:[124,110],5:[124,110],10:[131,111],20:[131,111],50:[131,111],100:[131,111],200:[143,123],500:[143,123],1e3:[143,123]},polymer:!1},MXN:{thickness:12,lengths:{20:[125,115],50:[130,120],100:[137,127],200:[144,134],500:[151,141],1e3:[158,148]},polymer:!0},MYR:{thickness:12,lengths:{1:[130,110],5:[145,125],10:[150,130],20:[155,135],50:[155,135],100:[160,140]},polymer:!1},NAD:{thickness:12,lengths:{10:[134,124],20:[139,129],50:[145,135],100:[151,141],200:[157,147]},polymer:!1},NZD:{thickness:12,lengths:{5:[140,130],10:[145,135],20:[150,140],50:[155,145],100:[160,150]},polymer:!0},PHP:{thickness:12,lengths:{20:[170,150],100:[170,150],200:[170,150],500:[170,150],1e3:[170,150]},polymer:!1},PLN:{thickness:12,lengths:{10:[125,115],20:[131,121],50:[137,127],100:[143,133],200:[149,139],500:[155,145]},polymer:!1},RON:{thickness:12,lengths:{1:[130,110],5:[137,117],10:[143,123],50:[150,130],100:[157,137],200:[160,140],500:[163,143]},polymer:!0},SGD:{thickness:12,lengths:{2:[136,116],5:[143,123],10:[151,131],50:[166,146],100:[172,152],1e3:[180,160]},polymer:!1},TWD:{thickness:13,lengths:{100:[155,135],200:[160,140],500:[165,145],1e3:[170,150],2e3:[175,155]},polymer:!1},USD:{thickness:13,lengths:{1:[166,146],2:[166,146],5:[166,146],10:[166,146],20:[166,146],50:[166,146],100:[166,146]},polymer:!1},UYU:{thickness:13,lengths:{20:[164,154],50:[150,140],100:[164,154],200:[164,154],500:[164,154],1e3:[164,154],2e3:[164,154]},polymer:!1},ZAR:{thickness:12,lengths:{10:[138,118],20:[144,124],50:[150,130],100:[156,136],200:[162,142]},polymer:!1}},qg=Vc.a((function(e,t){var n=R.a("fiatCurrency")(e);return F.a(T.a((function(e){return{code:parseInt(e),display:e}})),Hc.a,A.a([n,"lengths"]))(t)})),$g={name:"All Machines",deviceId:"ALL_MACHINES"},Hg={display:"All Coins",code:"ALL_COINS"},Vg={marginLeft:6,whiteSpace:"nowrap"},Ug=Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Pc,{}),Object(qe.jsx)("span",{style:Vg,children:"Cash-in"})]}),Gg=Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Wc,{}),Object(qe.jsx)("span",{style:Vg,children:"Cash-out"})]}),Xg=function(e,t,n){return function(a){if(!e)return"";var r=Aa.a(W.a(null!==n&&void 0!==n?n:"code",a))(e);return r?R.a(t,r):"Unpaired machine"}},_g=function(e){return function(t){return t?F.a($j.a(", "),T.a(Xg(e,"display")))(t):t}},Zg=function(e,t,n){var a=L.a(Hg.code)(t),r=L.a(Hg.code)(e);return a&&r&&bn.a(t)>1?n(mm.a(gn.a(Hg.code))(t)):a&&!r?n([Hg.code]):void n(t)},Kg=function(e){return[{header:Ug,name:"cashIn",display:"Cash-in",width:169,size:"lg",editingAlign:"right",input:oi,suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{header:Gg,name:"cashOut",display:"Cash-out",width:169,size:"lg",editingAlign:"right",input:oi,suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:oi,suffix:e,bold:Va,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:oi,suffix:e,bold:Va,inputProps:{decimalPlaces:2}}]},Qg=function(e,t,n){return function(e,t,n){var a=[$g].concat(e(["machines"])),r=e(["cryptoCurrencies"]),i=[Hg].concat(T.a((function(e){return{display:e.code,code:e.code}}))(null!==r&&void 0!==r?r:[]));return[{name:"machine",width:196,size:"sm",view:Xg(a,"name","deviceId"),input:Br,inputProps:{options:a,valueProp:"deviceId",labelProp:"name"}},{name:"cryptoCurrencies",width:280,size:"sm",view:_g(i),input:Br,inputProps:{options:i,valueProp:"code",labelProp:"display",multiple:!0,onChange:Zg,shouldStayOpen:!0}},{header:Ug,name:"cashIn",display:"Cash-in",width:130,input:oi,textAlign:"right",suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{header:Gg,name:"cashOut",display:"Cash-out",width:130,input:oi,textAlign:"right",suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:oi,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,bold:Va,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:169,doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:oi,suffix:t,bold:Va,inputProps:{decimalPlaces:2}}]}(A.a(lm.a,e),t)},Yg=100,Jg=function(e){var t=qg(e,zg).map((function(e){return e.code})),n=Wa.a(t)?Jh:Math.max.apply(Math,Object(d.a)(t));return xn.f().shape({cashIn:xn.e().label("Cash-in").min(0).max(Yg).required(),cashOut:xn.e().label("Cash-out").min(0).max(Yg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(n).required()})},eO=function(e,t,n){var a=A.a(lm.a,t),r=[$g].concat(a(["machines"])),i=a(["cryptoCurrencies"]),o=[Hg].concat(T.a((function(e){return{display:e.code,code:e.code}}))(null!==i&&void 0!==i?i:[])),l=qg(n,zg).map((function(e){return parseInt(e.code)})),c=Wa.a(l)?Jh:Math.max.apply(Math,Object(d.a)(l));return xn.f().shape({machine:xn.h().nullable().label("Machine").required(),cryptoCurrencies:xn.a().test({test:function(){var t=this.parent,n=t.id,a=t.machine,i=t.cryptoCurrencies,l=function(e,t,n){var a=R.a("cryptoCurrencies"),r=R.a("machine"),i=M.a(W.a("machine",t))(n),o=Aa.a(W.a("id",e))(n),l=a(o),c=r(o),s=F.a(Ag.a,ul.a,T.a(a))(i);return t!==c?null!==s&&void 0!==s?s:[]:Mg.a(s,l)}(n,a,e),c=a===$g.deviceId,s=L.a(Hg.code,i);if(c&&s)return this.createError({message:"All machines and all coins should be configured in the default setup table"});var d=Wg.a(l,i);if(!Wa.a(d)){var u=_g(o)(d),m=Xg(r,"name","deviceId")(a),h="".concat(u," already overriden for machine: ").concat(m);return this.createError({message:h})}return!0}}).label("Crypto Currencies").required().min(1),cashIn:xn.e().label("Cash-in").min(0).max(Yg).required(),cashOut:xn.e().label("Cash-out").min(0).max(Yg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(c).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(c).required()})},tO={cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},nO={machine:null,cryptoCurrencies:[],cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},aO=function(e){var t=e.machine,n=e.cryptoCurrencies,a=t===$g.deviceId,r=bl.a(Hg.code,n);return a&&r?0:a?1:r?2:3},rO=function(e,t,n,a){return{minimumTx:a.minimumTx,fixedFee:a.fixedFee,cashOut:a.cashOut,cashIn:a.cashIn,machine:t,cryptoCurrencies:[e],default:n,id:Object(pm.a)()}},iO=function(e){var t=qg(e,zg).map((function(e){return parseInt(e.code)})),n=Wa.a(t)?Jh:Math.max.apply(Math,Object(d.a)(t));return xn.f().shape({machine:xn.h().label("Machine").required(),cryptoCurrencies:xn.a().label("Crypto Currency").required().min(1),cashIn:xn.e().label("Cash-in").min(0).max(Yg).required(),cashOut:xn.e().label("Cash-out").min(0).max(Yg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(n).required()})},oO=function(e,t){return{color:e.default?J:te}},lO=function(e,t,n){var a=A.a(lm.a,e);return cO(a,t,tO)},cO=function(e,t,n){var a=[$g].concat(e(["machines"]));return[{name:"machine",width:196,size:"sm",view:Xg(a,"name","deviceId"),editable:!1},{name:"cryptoCurrencies",display:"Crypto Currency",width:255,view:R.a(0),size:"sm",editable:!1},{header:Ug,name:"cashIn",display:"Cash-in",width:130,input:oi,textAlign:"right",suffix:"%",textStyle:function(e){return oO(e)},inputProps:{decimalPlaces:3}},{header:Gg,name:"cashOut",display:"Cash-out",width:140,input:oi,textAlign:"right",greenText:!0,suffix:"%",textStyle:function(e){return oO(e)},inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:oi,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return oO(e)},inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:144,input:oi,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return oO(e)},inputProps:{decimalPlaces:2}}]},sO=n(1078),dO=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return M.a((function(e){return L.a(e.name,t)}),uO(e,n,a))},uO=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=function(e,t,n){return function(a){return e?F.a(R.a(t),Aa.a(W.a(null!==n&&void 0!==n?n:"code",a)))(e):""}},r=function(e){return function(t){return t?F.a($j.a(", "),T.a(a(e,"code")))(t):t}},i=T.a((function(e){return e.machine}),n),o=function(e){return sO.a((function(e,t){return e.deviceId===t}),e,i)},l=e(["machines"]),c=e(["countries"]),s=e(["currencies"]),d=e(["languages"]),u=e(["cryptoCurrencies"]),m=od,h=function(e){var t=Aa.a(W.a("deviceId",e.machine))(l);return t?[t]:[]};return[{name:"machine",width:200,size:"sm",view:a(l,"name","deviceId"),input:Br,inputProps:{options:function(e){return ml.a(h(e))(o(l))},valueProp:"deviceId",labelProp:"name"}},{name:"country",width:200,size:"sm",view:a(c,"display"),input:Br,inputProps:{options:c,valueProp:"code",labelProp:"display"}},{name:"fiatCurrency",width:150,size:"sm",view:a(s,"code"),input:Br,inputProps:{options:s,valueProp:"code",labelProp:"code"}},{name:"languages",width:200,size:"sm",view:r(d),input:Br,inputProps:{options:d,valueProp:"code",labelProp:"display",multiple:!0}},{name:"cryptoCurrencies",width:170,size:"sm",view:r(u),input:Br,inputProps:{options:u,valueProp:"code",labelProp:"code",multiple:!0,optionsLimit:null,onChange:t}},{name:"timezone",width:320,size:"sm",view:a(m,"label"),input:Br,inputProps:{options:m,valueProp:"code",labelProp:"label"}}]},mO=function(e,t){var n=A.a(lm.a,e);return dO(n,["country","fiatCurrency","languages","cryptoCurrencies","timezone"],t,void 0)},hO=function(e,t,n){var a=A.a(lm.a,e);return dO(a,["machine","country","languages","cryptoCurrencies"],n,t)},pO=xn.f().shape({country:xn.h().label("Country").required(),fiatCurrency:xn.h().label("Fiat Currency").required(),languages:xn.a().label("Languages").required().min(1).max(4),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1),timezone:xn.h().label("Timezone").required()}),bO=xn.f().shape({machine:xn.h().label("Machine").required(),country:xn.h().label("Country").required(),languages:xn.a().label("Languages").required().min(1).max(4),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1)}),fO={country:"",fiatCurrency:"",languages:[],cryptoCurrencies:[],timezone:""},jO={machine:"",country:"",languages:[],cryptoCurrencies:[]},gO=n(324),OO={editDisabled:{color:oe}},xO=function(e){return M.a((function(t){return t.class===e}))},vO=function(e){var t=e.id;return M.a((function(e){return bl.a(t)(e.cryptos)}))},yO=xn.f().shape({ticker:xn.h().required(),wallet:xn.h().required(),exchange:xn.h().required(),zeroConf:xn.h(),zeroConfLimit:xn.e().integer().min(0).max(Jh).transform(Ur)}),wO=xn.f().shape({cryptoUnits:xn.h().required(),feeMultiplier:xn.h().required(),allowTransactionBatching:xn.b()}),CO=xn.f().shape({cryptoUnits:xn.h().required(),feeMultiplier:xn.h().default((function(){return"1"})).required(),cryptoCurrency:xn.h().required(),allowTransactionBatching:xn.b().default((function(){return!1})).required()}),kO={cryptoUnits:"",feeMultiplier:"",cryptoCurrency:"",allowTransactionBatching:null},EO=function(e){return F.a(R.a(["display"]),Aa.a(W.a("code",e)))(NO)},NO=[{display:"+60%",code:"1.6"},{display:"+50%",code:"1.5"},{display:"+40%",code:"1.4"},{display:"+30%",code:"1.3"},{display:"+20%",code:"1.2"},{display:"+10%",code:"1.1"},{display:"Default",code:"1"},{display:"-10%",code:"0.9"},{display:"-20%",code:"0.8"},{display:"-30%",code:"0.7"},{display:"-40%",code:"0.6"},{display:"-50%",code:"0.5"},{display:"-60%",code:"0.4"}],SO=[{display:"mili",code:"mili"},{display:"full",code:"full"}],IO=Vc.a((function(e,t){if(D.a(t.cryptoCurrency))return SO;var n=Hc.a(e.getCryptoCurrency(t.cryptoCurrency).units);return T.a((function(e){return{code:e,display:e}}))(n)})),LO=function(e,t,n){return[{name:"cryptoCurrency",width:180,input:Br,inputProps:{options:function(n){return ml.a(e,t(n))},optionsLimit:null,valueProp:"code",labelProp:"display"},size:"sm"},{name:"cryptoUnits",size:"sm",stripe:!0,width:190,input:Br,inputProps:{options:IO(n),valueProp:"code",labelProp:"display"}},{name:"allowTransactionBatching",size:"sm",stripe:!0,width:250,view:function(e,t){return"BTC"!==t.cryptoCurrency?Object(qe.jsx)("span",{style:OO.editDisabled,children:"No"}):t.allowTransactionBatching?"Yes":"No"},input:ri,editable:function(e){return"BTC"===e.cryptoCurrency}},{name:"feeMultiplier",header:"Miner's Fee",size:"sm",stripe:!0,width:250,view:function(e,t){return"BTC"!==t.cryptoCurrency?Object(qe.jsx)("span",{style:OO.editDisabled,children:"Default"}):EO(t.feeMultiplier)},input:Br,inputProps:{options:NO,valueProp:"code",labelProp:"display"},editable:function(e){return"BTC"===e.cryptoCurrency}}]},FO=Hr.a(Pu.a(R.a("id"),gO.a(L.a)(["ETH"]))),PO=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=a?11:0,i=function(t){return F.a(R.a(["display"]),Aa.a(W.a("code",t)))(e)},o=function(e){return xO(e)(t||[])},l=function(e){return function(t){return F.a(R.a("display"),Aa.a(W.a("code",t)))(o(e))}},c=Vc.a((function(e,t){return vO(t)(o(e))}));return[{name:"id",header:"Cryptocurrency",width:150-r,view:i,size:"sm",editable:!1},{name:"ticker",size:"sm",stripe:!0,view:l("ticker"),width:175-r,input:Br,inputProps:{options:c("ticker"),valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"wallet",size:"sm",stripe:!0,view:l("wallet"),width:175-r,input:Br,inputProps:{options:c("wallet"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"exchange",size:"sm",stripe:!0,view:l("exchange"),width:175-r,input:Br,inputProps:{options:c("exchange"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConf",header:"Confidence Checking",size:"sm",stripe:!0,view:function(e,t){var n=l("zeroConf")(e,t);return FO(t)?n:Object(qe.jsx)("span",{style:OO.editDisabled,children:n})},input:Br,width:210-r,inputProps:{options:c("zeroConf"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n},editable:FO},{name:"zeroConfLimit",header:"0-conf Limit",size:"sm",stripe:!0,view:function(e,t){return FO(t)?e:Object(qe.jsx)("span",{style:OO.editDisabled,children:e})},input:oi,width:145-r,inputProps:{decimalPlaces:0},editable:FO}]},DO=Object(f.a)({subtitle:{color:se,marginTop:16,marginBottom:16},extraMarginTop:{marginTop:72}}),TO=Object(a.memo)((function(e){var t,n=e.children,a=e.className,r=e.extraMarginTop,i=DO(),o=(t={},Object(z.a)(t,i.subtitle,!0),Object(z.a)(t,i.extraMarginTop,r),t);return Object(qe.jsx)(tt,{className:I()(o,a),children:n})})),RO=Object(f.a)({section:{marginBottom:72},sectionHeader:{display:"flex",alignItems:"center"},sectionTitle:{margin:[[16,20,23,0]]}}),BO=function(e){var t=e.error,n=e.children,a=e.title,r=RO();return Object(qe.jsxs)("div",{className:r.section,children:[(a||t)&&Object(qe.jsxs)("div",{className:r.sectionHeader,children:[Object(qe.jsx)(TO,{className:r.sectionTitle,children:a}),t&&Object(qe.jsx)(rl,{children:"Failed to save changes"})]}),n]})},AO=Object(f.a)(Yi),MO=Object(f.a)({autoComplete:{width:"100%"}}),WO=x()(yg||(yg=Object(c.a)(["\n query getData {\n config\n }\n"]))),zO=x()(wg||(wg=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var qO,$O,HO=function(e){var t=e.isActive,n=e.doContinue,a=AO(),r=(MO(),Object(u.c)(WO).data),i=Object(u.b)(zO,{onCompleted:n}),o=Object(l.a)(i,1)[0],c=A.a(["fiatCurrency"])(ss(es)(null===r||void 0===r?void 0:r.config)),s=ss(es)(null===r||void 0===r?void 0:r.config);return Object(qe.jsxs)("div",{className:a.wrapper,children:[Object(qe.jsx)(ll,{title:"Commissions"}),Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",initialValues:tO,enableEdit:!0,forceAdd:t,save:function(e){var t=ds("commissions")(e.commissions[0]);return o({variables:{config:t}})},validationSchema:Jg(s),data:[],elements:Kg(c)})})]})},VO=Object(f.a)(Yi),UO=x()(qO||(qO=Object(c.a)(["\n query getData {\n config\n accounts\n currencies {\n code\n display\n }\n countries {\n code\n display\n }\n cryptoCurrencies {\n code\n display\n }\n languages {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),GO=x()($O||($O=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var XO,_O,ZO=function(e){var t=e.isActive,n=e.doContinue,a=VO(),r=Object(u.c)(UO).data,i=Object(u.b)(GO,{onCompleted:n}),o=Object(l.a)(i,1)[0],c=gv((null===r||void 0===r?void 0:r.config)||{},(null===r||void 0===r?void 0:r.cryptoCurrencies)||[]);return Object(qe.jsxs)("div",{className:a.wrapper,children:[Object(qe.jsx)(ll,{title:"Locales"}),Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{title:"Default settings",rowSize:"lg",titleLg:!0,name:"locale",initialValues:fO,forceAdd:t,enableEdit:!0,save:function(e){var t=ds("locale")(e.locale[0]);return o({variables:{config:t}})},validationSchema:pO,data:[],elements:mO(Gn.a(r,{cryptoCurrencies:c}),(function(e,t,n){return n(t)}))})})]})},KO=Object(f.a)({message:function(e){return{width:e.width,marginTop:4,marginLeft:16}}}),QO=function(e){var t=e.children,n=e.width,a=void 0===n?330:n,r=e.className,i=KO({width:a});return Object(qe.jsxs)(tl.a,{display:"flex",className:r,children:[Object(qe.jsx)(ir,{}),Object(qe.jsx)(at,{className:i.message,children:t})]})},YO=n(1079),JO=n(1080),ex={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,32,0]]},button:{margin:[["auto",0,0,"auto"]]},form:{flex:1,display:"flex",flexDirection:"column"},grid:{marginBottom:24,marginTop:12}},tx=Object(f.a)(ex),nx=function(e){var t=e.validationSchema,n=e.elements,r=e.value,i=e.save,o=e.buttonLabel,c=void 0===o?"Save changes":o,d=e.buttonClass,u=e.xs,m=void 0===u?12:u,p=tx(),b=F.a(YO.a,T.a((function(e){var t,n=e.code;return Object(z.a)({},n,null!==(t=r&&r[n])&&void 0!==t?t:"")})))(n),f=Gn.a(b,r),j=Object(a.useState)([]),g=Object(l.a)(j,2),O=g[0],x=g[1];return Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:f,validationSchema:t,onSubmit:function(e){var t=F.a(T.a(R.a("code")),M.a((function(t){return R.a("component",t)===ci&&Wa.a(e[R.a("code",t)])})))(n);return i(sm.a(t,e)).catch((function(e){x({save:"Failed to save changes"})}))},children:function(e){var t=e.errors;return Object(qe.jsxs)(mn.d,{className:p.form,children:[Object(qe.jsx)(h.a,{container:!0,spacing:3,className:p.grid,children:n.map((function(e){var t=e.component,n=e.code,a=e.display,r=e.settings,i=e.inputProps;return Object(qe.jsx)(h.a,{item:!0,xs:m,children:Object(qe.jsx)(mn.a,Object(s.a)(Object(s.a)({component:t},i),{},{name:n,label:a,settings:r,fullWidth:!0}))},n)}))}),Object(qe.jsxs)("div",{className:p.footer,children:[!Wa.a(JO.a(t,O))&&Object(qe.jsx)(rl,{children:Uj.a(gd.a(JO.a(t,O)))}),Object(qe.jsx)(An,{className:I()(p.button,d),type:"submit",children:c})]})]})}})},ax=function(e,t){return{name:"secret-test",message:t?"The ".concat(t," is invalid"):"Invalid field",test:function(t){return!D.a(e)||!D.a(t)||this.createError()}}},rx=function(e,t){return!(_c.a("0",t.originalValue)&&bn.a(t.originalValue)>1)||t.createError()},ix={code:"twilio",name:"Twilio",title:"Twilio (SMS)",elements:[{code:"accountSid",display:"Account SID",component:si},{code:"authToken",display:"Auth Token",component:ci},{code:"fromNumber",display:"Twilio Number (international format)",component:si,face:!0},{code:"toNumber",display:"Notifications Number (international format)",component:si,face:!0}],getValidationSchema:function(e){return xn.f().shape({accountSid:xn.h("The account SID must be a string").max(100,"The account SID is too long").required("The account SID is required"),authToken:xn.h("The auth token must be a string").max(100,"The auth token is too long").test(ax(null===e||void 0===e?void 0:e.authToken,"auth token")),fromNumber:xn.h("The Twilio number must be a string").max(100,"The Twilio number is too long").required("The Twilio number is required"),toNumber:xn.h("The notifications number must be a string").max(100,"The notifications number is too long").required("The notifications number is required")})}},ox={radioGroup:{flexDirection:"row",width:600},radioLabel:{width:150,height:48},mdForm:{width:385},infoMessage:{display:"flex",marginBottom:20,"& > p":{width:330,marginTop:4,marginLeft:16}},actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J},error:{color:he},button:{marginTop:40},formButton:{margin:[[24,0,0]]}},lx=x()(XO||(XO=Object(c.a)(["\n {\n config\n accounts\n }\n"]))),cx=x()(_O||(_O=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),sx=Object(f.a)(Object(s.a)(Object(s.a)({},ox),{},{content:{width:820},radioLabel:Object(s.a)(Object(s.a)({},ox.radioLabel),{},{width:280}),wrapper:{width:1200,height:100,margin:[[0,"auto"]]},title:{marginLeft:8,marginBottom:5},info:{marginTop:20,marginBottom:20}})),dx=[{code:"enable",display:"Yes, I will"},{code:"disable",display:"No, not for now"}];var ux,mx,hx,px,bx,fx,jx,gx,Ox,xx,vx,yx=function(e){var t,n,r=e.doContinue,i=sx(),o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.c)(lx),j=f.data,g=f.refetch,O=Object(u.b)(cx,{onCompleted:r}),x=Object(l.a)(O,1)[0],v=null!==(t=null===j||void 0===j?void 0:j.accounts)&&void 0!==t?t:[],y=(n={},Object(z.a)(n,i.title,!0),Object(z.a)(n,i.error,p),n);return Object(qe.jsx)("div",{className:i.wrapper,children:Object(qe.jsxs)("div",{className:i.content,children:[Object(qe.jsx)(Ue,{children:"Twilio (SMS service)"}),Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"end",children:[Object(qe.jsx)(_e,{noMargin:!0,className:I()(y),children:"Will you setup a two way machine or compliance?"}),Object(qe.jsxs)(Np,{width:304,children:[Object(qe.jsx)(Ke,{children:"Two-way machines allow your customers not only to buy (cash-in) but also sell cryptocurrencies (cash-out)."}),Object(qe.jsx)(Ke,{children:"You\u2019ll need an SMS service for cash-out transactions and for any compliance triggers"})]})]}),Object(qe.jsx)(Er,{labelClassName:i.radioLabel,className:i.radioGroup,options:dx,value:s,onChange:function(e){d(e.target.value),b(!1)}}),Object(qe.jsx)(QO,{className:i.info,children:"To set up Twilio please read the instructions from our support portal."}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001203951-Twilio-for-SMS",label:"Twilio for SMS"}),"enable"===s&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{noMargin:!0,children:"Enter credentials"}),Object(qe.jsx)(nx,{xs:6,save:function(e){return x({variables:{accounts:{twilio:e}}}).then((function(){return g()}))},value:v.twilio,elements:ix.elements,validationSchema:ix.validationSchema,buttonLabel:"Continue",buttonClass:i.formButton})]}),"enable"!==s&&Object(qe.jsx)(An,{size:"lg",onClick:function(){if(!s)return b(!0);r()},className:i.button,children:"Continue"})]})})},wx=n(1081),Cx=Object(f.a)(ox),kx=x()(ux||(ux=Object(c.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Ex=x()(mx||(mx=Object(c.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),Nx=function(e){var t,n=e.data,r=e.doContinue,i=Cx(),o=Object(u.c)(kx).data,c=Object(u.b)(Ex,{onCompleted:r}),d=Object(l.a)(c,1)[0],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=null===n||void 0===n?void 0:n.coin,j=null===o||void 0===o?void 0:o.accountsConfig,g=null!==(t=null===o||void 0===o?void 0:o.cryptoCurrencies)&&void 0!==t?t:[],O=Pu.a(sm.a(["coin","zeroConf","zeroConfLimit"]),ds(f))(n),x=M.a(Pu.a(R.a("name"),gO.a(L.a)(["zeroConf","zeroConfLimit"]),P.a()),PO(g,j,null,!0));return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:p&&i.error,children:"All set"}),Object(qe.jsx)(Ke,{children:"These are your wallet settings. You can later edit these and add additional coins."}),Object(qe.jsx)(Zh,{rowSize:"lg",titleLg:!0,name:"All set",namespaces:[f],data:O,elements:x}),Object(qe.jsx)(An,{size:"lg",onClick:function(){var e=Uj.a(Hc.a(Pf.utils.getCryptoCurrency(f).units)),t=Object(s.a)(Object(s.a)({zeroConfLimit:0},n),{},{cryptoUnits:e});if(!yO.isValidSync(t))return b(!0);var a=ds(f,sm.a("coin",t)),r=ds(Qc)(a);return b(!1),d({variables:{config:r}})},className:i.button,children:"Continue"})]})},Sx={code:"binanceus",name:"Binance.us",title:"Binance.us (Exchange)",elements:[{code:"apiKey",display:"API Key",component:si,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:ci}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),privateKey:xn.h("The private key must be a string").max(100,"The private key is too long").test(ax(null===e||void 0===e?void 0:e.privateKey,"private key"))})}},Ix=function(e){return e&&e.length},Lx=function(e,t){return xn.h().max(100,"Too long").when(e,{is:Ix,then:xn.h().test(ax(t))})},Fx={code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:si,face:!0,long:!0},{code:"environment",display:"Environment",component:Br,inputProps:{options:[{code:"prod",display:"prod"},{code:"test",display:"test"}],labelProp:"display",valueProp:"code"},face:!0},{code:"BTCWalletId",display:"BTC Wallet ID",component:si},{code:"BTCWalletPassphrase",display:"BTC Wallet Passphrase",component:ci},{code:"LTCWalletId",display:"LTC Wallet ID",component:si},{code:"LTCWalletPassphrase",display:"LTC Wallet Passphrase",component:ci},{code:"ZECWalletId",display:"ZEC Wallet ID",component:si},{code:"ZECWalletPassphrase",display:"ZEC Wallet Passphrase",component:ci},{code:"BCHWalletId",display:"BCH Wallet ID",component:si},{code:"BCHWalletPassphrase",display:"BCH Wallet Passphrase",component:ci},{code:"DASHWalletId",display:"DASH Wallet ID",component:si},{code:"DASHWalletPassphrase",display:"DASH Wallet Passphrase",component:ci}],getValidationSchema:function(e){return xn.f().shape({token:xn.h("The token must be a string").max(100,"The token is too long").required("The token is required"),BTCWalletId:xn.h("The BTC wallet ID must be a string").max(100,"The BTC wallet ID is too long"),BTCWalletPassphrase:Lx("BTCWalletId",null===e||void 0===e?void 0:e.BTCWalletPassphrase),LTCWalletId:xn.h("The LTC wallet ID must be a string").max(100,"The LTC wallet ID is too long"),LTCWalletPassphrase:Lx("LTCWalletId",null===e||void 0===e?void 0:e.LTCWalletPassphrase),ZECWalletId:xn.h("The ZEC wallet ID must be a string").max(100,"The ZEC wallet ID is too long"),ZECWalletPassphrase:Lx("ZECWalletId",null===e||void 0===e?void 0:e.ZECWalletPassphrase),BCHWalletId:xn.h("The BCH wallet ID must be a string").max(100,"The BCH wallet ID is too long"),BCHWalletPassphrase:Lx("BCHWalletId",null===e||void 0===e?void 0:e.BCHWalletPassphrase),DASHWalletId:xn.h("The DASH wallet ID must be a string").max(100,"The DASH wallet ID is too long"),DASHWalletPassphrase:Lx("DASHWalletId",null===e||void 0===e?void 0:e.DASHWalletPassphrase),environment:xn.h("The environment must be a string").matches(/(prod|test)/).required("The environment is required")})}},Px={code:"bitstamp",name:"Bitstamp",title:"Bitstamp (Exchange)",elements:[{code:"clientId",display:"Client ID",component:si,face:!0,long:!0},{code:"key",display:"API Key",component:si,face:!0,long:!0},{code:"secret",display:"API Secret",component:ci}],getValidationSchema:function(e){return xn.f().shape({clientId:xn.h("The client ID must be a string").max(100,"The client ID is too long").required("The client ID is required"),key:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),secret:xn.h("The API secret must be a string").max(100,"The API secret is too long").test(ax(null===e||void 0===e?void 0:e.secret,"API secret"))})}},Dx={code:"blockcypher",name:"Blockcypher",title:"Blockcypher (Payments)",elements:[{code:"token",display:"API Token",component:si,face:!0,long:!0},{code:"confidenceFactor",display:"Confidence Factor",component:si,face:!0},{code:"rbf",component:ri,settings:{field:"wallets_BTC_wallet",enabled:!0,disabledMessage:"Lower the confidence of RBF transactions (Available when using bitcoind.)",label:"Lower the confidence of RBF transactions",requirement:"bitcoind",rightSideLabel:!0},face:!0}],getValidationSchema:function(){return xn.f().shape({token:xn.h("The token must be a string").max(100,"The token is too long").required("The token is required"),confidenceFactor:xn.e("The confidence factor must be a number").integer("The confidence factor must be an integer").positive("The confidence factor must be positive").required("The confidence factor is required")})}},Tx={code:"cex",name:"Cex",title:"Cex (Exchange)",elements:[{code:"apiKey",display:"API Key",component:si,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:ci}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),privateKey:xn.h("The private key must be a string").max(100,"The private key is too long").test(ax(null===e||void 0===e?void 0:e.privateKey,"private key"))})}},Rx={code:"ciphertrace",name:"CipherTrace",title:"CipherTrace (Scoring)",elements:[{code:"authorizationValue",display:"Authorization value",component:ci},{code:"scoreThreshold",display:"Score threshold",component:oi,face:!0,long:!1},{code:"enabled",component:ri,settings:{enabled:!0,disabledMessage:"This plugin is disabled",label:"Enabled",requirement:null},face:!0}],getValidationSchema:function(e){return xn.f().shape({authorizationValue:xn.h("The authorization value must be a string").max(100,"Too long").test(ax(null===e||void 0===e?void 0:e.authorizationValue,"authorization value")),scoreThreshold:xn.e("The score threshold must be a number").required("A score threshold is required").min(1,"The score threshold must be between 1 and 10").max(10,"The score threshold must be between 1 and 10").integer("The score threshold must be an integer").test("no-leading-zeros","The score threshold must not have leading zeros",rx)})}},Bx={code:"ftx",name:"Ftx",title:"Ftx (Exchange)",elements:[{code:"apiKey",display:"API Key",component:si,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:ci}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),privateKey:xn.h("The private key must be a string").max(100,"The private key is too long").test(ax(null===e||void 0===e?void 0:e.privateKey,"private key"))})}},Ax={code:"infura",name:"Infura",title:"Infura (Wallet)",elements:[{code:"apiKey",display:"Project ID",component:si,face:!0,long:!0},{code:"apiSecret",display:"Project Secret",component:ci},{code:"endpoint",display:"Endpoint",component:si,face:!0}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The project ID must be a string").max(100,"The project ID is too long").required("The project ID is required"),apiSecret:xn.h("The project secret must be a string").max(100,"The project secret is too long").test(ax(null===e||void 0===e?void 0:e.apiSecret,"project secret")),endpoint:xn.h("The endpoint must be a string").max(100,"The endpoint is too long").required("The endpoint is required")})}},Mx={code:"itbit",name:"itBit",title:"itBit (Exchange)",elements:[{code:"userId",display:"User ID",component:si,face:!0,long:!0},{code:"walletId",display:"Wallet ID",component:si,face:!0,long:!0},{code:"clientKey",display:"Client Key",component:si},{code:"clientSecret",display:"Client Secret",component:ci}],getValidationSchema:function(e){return xn.f().shape({userId:xn.h("The user ID must be a string").max(100,"The user ID is too long").required("The user ID is required"),walletId:xn.h("The wallet ID must be a string").max(100,"The wallet ID is too long").required("The wallet ID is required"),clientKey:xn.h("The client key must be a string").max(100,"The client key is too long").required("The client key is required"),clientSecret:xn.h("The client secret must be a string").max(100,"The client secret is too long").test(ax(null===e||void 0===e?void 0:e.clientSecret,"client secret"))})}},Wx={code:"kraken",name:"Kraken",title:"Kraken (Exchange)",elements:[{code:"apiKey",display:"API Key",component:si,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:ci}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),privateKey:xn.h("The private key must be a string").max(100,"The private key is too long").test(ax(null===e||void 0===e?void 0:e.privateKey,"private key"))})}},zx={code:"mailgun",name:"Mailgun",title:"Mailgun (Email)",elements:[{code:"apiKey",display:"API Key",component:si},{code:"domain",display:"Domain",component:si},{code:"fromEmail",display:"From Email",component:si,face:!0},{code:"toEmail",display:"To Email",component:si,face:!0}],getValidationSchema:function(){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),domain:xn.h("The domain must be a string").max(100,"The domain is too long").required("The domain is required"),fromEmail:xn.h("The from email must be a string").max(100,"The from email is too long").email("The from email must be a valid email address").required("The from email is required"),toEmail:xn.h("The to email must be a string").max(100,"The to email is too long").email("The to email must be a valid email address").required("The to email is required")})}},qx=(hx={},Object(z.a)(hx,Fx.code,Fx),Object(z.a)(hx,Px.code,Px),Object(z.a)(hx,Dx.code,Dx),Object(z.a)(hx,Ax.code,Ax),Object(z.a)(hx,Mx.code,Mx),Object(z.a)(hx,Wx.code,Wx),Object(z.a)(hx,zx.code,zx),Object(z.a)(hx,ix.code,ix),Object(z.a)(hx,Sx.code,Sx),Object(z.a)(hx,Tx.code,Tx),Object(z.a)(hx,Bx.code,Bx),Object(z.a)(hx,Rx.code,Rx),hx),$x=Object(f.a)(Object(s.a)(Object(s.a)({},ox),{},{radioGroup:ox.radioGroup,radioLabel:Object(s.a)(Object(s.a)({},ox.radioLabel),{},{width:200})})),Hx=x()(px||(px=Object(c.a)(["\n {\n accounts\n }\n"]))),Vx=x()(bx||(bx=Object(c.a)(["\n mutation SaveAccountsBC($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Ux=[{code:"enable",display:"I will enable cash-out"},{code:"disable",display:"I won't enable cash-out"}],Gx=function(e){var t,n=e.addData,r=$x(),i=Object(u.c)(Hx).data,o=Object(u.b)(Vx,{onCompleted:function(){return n({zeroConf:"blockcypher"})}}),c=Object(l.a)(o,1)[0],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=null!==(t=null===i||void 0===i?void 0:i.accounts)&&void 0!==t?t:[];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:f&&r.error,children:"Blockcypher"}),Object(qe.jsx)(Ke,{children:"If you are enabling cash-out services, create a Blockcypher account."}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001209472-Blockcypher",label:"Configuring Blockcypher"}),Object(qe.jsx)(Er,{labelClassName:r.radioLabel,className:r.radioGroup,options:Ux,value:m,onChange:function(e){h(e.target.value),j(!1)}}),Object(qe.jsxs)("div",{className:r.mdForm,children:["disable"===m&&Object(qe.jsx)(An,{size:"lg",onClick:function(){return n({zeroConf:"none",zeroConfLimit:0})},className:r.button,children:"Continue"}),"enable"===m&&Object(qe.jsx)(nx,{value:g.blockcypher,save:function(e){return c({variables:{accounts:{blockcypher:e}}})},elements:qx.blockcypher.elements,validationSchema:qx.blockcypher.validationSchema,buttonLabel:"Continue",buttonClass:r.formButton})]})]})},Xx=Object(f.a)(ox),_x=x()(fx||(fx=Object(c.a)(["\n {\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Zx=xn.f().shape({coin:xn.h().required()}),Kx=function(e){var t,n=e.addData,r=Xx(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(u.c)(_x).data,m=null!==(t=null===d||void 0===d?void 0:d.cryptoCurrencies)&&void 0!==t?t:[];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:c&&r.error,children:"Choose your first cryptocurrency"}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{coin:""},onSubmit:function(e){return Zx.isValidSync(e)?"BTC"!==e.coin?n({coin:e.coin,zeroConf:"none",zeroConfLimit:0}):void n(e):s(!0)},children:Object(qe.jsxs)(mn.d,{onChange:function(){return s(!1)},children:[Object(qe.jsx)(fm,{}),Object(qe.jsx)(mn.b,{component:li,name:"coin",labelClassName:r.radioLabel,className:r.radioGroup,options:m}),Object(qe.jsx)(An,{size:"lg",type:"submit",className:r.button,children:"Continue"})]})})]})},Qx=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return F.a(bl.a(e),R.a("cryptos"))}(e)(n)}))},Yx=function(e,t,n,a){var r=Qx(a,n)(e),i=Os.a((function(e){var n=e.code,a=function(e){return t&&t[e]}(n);return!qx[n]||(0,qx[n].getValidationSchema)(a).isValidSync(a)}))(r),o=Object(l.a)(i,2);return{filled:o[0],unfilled:o[1]}},Jx=Object(f.a)(ox),ev=x()(jx||(jx=Object(c.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),tv=x()(gx||(gx=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),nv=function(e){return!D.a(e)&&!bl.a(e)(["mock-exchange","no-exchange"])},av=function(e){var t,n,r,i=e.data,o=e.addData,c=Jx(),s=Object(u.c)(ev).data,d=Object(u.b)(tv,{onCompleted:function(){return k()}}),m=Object(l.a)(d,1)[0],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=null!==(t=null===s||void 0===s?void 0:s.accounts)&&void 0!==t?t:[],y=null!==(n=null===s||void 0===s?void 0:s.accountsConfig)&&void 0!==n?n:[],w=i.coin,C=Yx(y,v,"exchange",w),k=function(){if(!b)return x(!0);o({exchange:b})};return Object(qe.jsxs)("div",{className:c.mdForm,children:[Object(qe.jsx)(_e,{className:O&&c.error,children:"Choose your exchange"}),Object(qe.jsx)(Er,{labelClassName:c.radioLabel,className:c.radioGroup,options:Ma.a(C.filled,C.unfilled),value:b,onChange:function(e){f(e.target.value),x(!1)}}),!nv(b)&&Object(qe.jsx)(An,{size:"lg",onClick:k,className:c.button,children:"Continue"}),nv(b)&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:c.infoMessage,children:[Object(qe.jsx)(ir,{}),Object(qe.jsxs)(Je,{children:["Make sure you set up ",qx[b].name," to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."]})]}),Object(qe.jsx)(Da,{link:{kraken:"https://support.lamassu.is/hc/en-us/articles/115001206891-Kraken-trading",itbit:"https://support.lamassu.is/hc/en-us/articles/360026195032-itBit-trading",bitstamp:"https://support.lamassu.is/hc/en-us/articles/115001206911-Bitstamp-trading"}[b],label:"".concat(qx[b].name," trading")}),Object(qe.jsx)(_e,{noMargin:!0,children:"Enter exchange information"}),Object(qe.jsx)(nx,{value:v[b],save:(r=b,function(e){var t=Object(z.a)({},r,e);return m({variables:{accounts:t}})}),elements:qx[b].elements,validationSchema:qx[b].validationSchema,buttonLabel:"Continue",buttonClass:c.formButton})]})]})},rv=Object(f.a)(ox),iv=x()(Ox||(Ox=Object(c.a)(["\n {\n accountsConfig {\n code\n display\n class\n cryptos\n }\n }\n"]))),ov=function(e){var t,n,r=e.data,i=e.addData,o=rv(),c=Object(u.c)(iv).data,s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=null!==(t=null===c||void 0===c?void 0:c.accounts)&&void 0!==t?t:[],O=null!==(n=null===c||void 0===c?void 0:c.accountsConfig)&&void 0!==n?n:[],x=r.coin,v=Yx(O,g,"ticker",x);return Object(qe.jsxs)("div",{className:o.mdForm,children:[Object(qe.jsx)(_e,{className:f&&o.error,children:"Choose your ticker"}),Object(qe.jsx)(Er,{labelClassName:o.radioLabel,className:o.radioGroup,options:Ma.a(v.filled,v.unfilled),value:m,onChange:function(e){h(e.target.value),j(!1)}}),Object(qe.jsx)(An,{size:"lg",onClick:function(){if(!m)return j(!0);i({ticker:m})},className:o.button,children:"Continue"})]})},lv=function(e){var t;return{code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:si,face:!0,long:!0},{code:"environment",display:"Environment",component:Br,inputProps:{options:[{code:"prod",display:"prod"},{code:"test",display:"test"}],labelProp:"display",valueProp:"code"},face:!0},{code:"".concat(e,"WalletId"),display:"".concat(e," Wallet ID"),component:si},{code:"".concat(e,"WalletPassphrase"),display:"".concat(e," Wallet Passphrase"),component:ci}],validationSchema:xn.f().shape((t={token:xn.h("The token must be a string").max(100,"The token is too long").required("The token is required"),environment:xn.h("The environment must be a string").matches(/(prod|test)/).required("The environment is required")},Object(z.a)(t,"".concat(e,"WalletId"),xn.h("The ".concat(e," wallet ID must be a string")).max(100,"The ".concat(e," wallet ID is too long")).required("The ".concat(e," wallet ID is required"))),Object(z.a)(t,"".concat(e,"WalletPassphrase"),xn.h("The ".concat(e," passphrase must be a string")).max(100,"The ".concat(e," wallet passphrase is too long")).required("The ".concat(e," wallet passphrase is required"))),t))}},cv=Object(f.a)(ox),sv=x()(xx||(xx=Object(c.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),dv=x()(vx||(vx=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),uv=function(e){return bl.a(e)(["infura","bitgo"])},mv=function(e){var t,n,r,i=e.data,o=e.addData,c=cv(),s=Object(u.c)(sv).data,d=Object(u.b)(dv,{onCompleted:function(){return E()}}),m=Object(l.a)(d,1)[0],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=null!==(t=null===s||void 0===s?void 0:s.accounts)&&void 0!==t?t:[],y=null!==(n=null===s||void 0===s?void 0:s.accountsConfig)&&void 0!==n?n:[],w=i.coin,C=Yx(y,v,"wallet",w),k=function(e){return function(t){var n=Object(z.a)({},e,t);return m({variables:{accounts:n}})}},E=function(){if(!b)return x(!0);o({wallet:b})};return Object(qe.jsxs)("div",{className:c.mdForm,children:[Object(qe.jsx)(_e,{className:O&&c.error,children:"Choose your wallet"}),Object(qe.jsx)(Er,{labelClassName:c.radioLabel,className:c.radioGroup,options:Ma.a(C.filled,C.unfilled),value:b,onChange:function(e){f(e.target.value),x(!1)}}),(r=b,bl.a(r)(["bitcoind","geth","litecoind","dashd","zcashd","bitcoincashd"])&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:c.infoMessage,children:[Object(qe.jsx)(ir,{}),Object(qe.jsxs)(Je,{children:["To set up ",b," please read the node wallet instructions from our support portal."]})]}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001209552-Setting-up-your-node-wallets",label:"Support article"})]})),!uv(b)&&Object(qe.jsx)(An,{size:"lg",onClick:E,className:c.button,children:"Continue"}),"bitgo"===b&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:c.infoMessage,children:[Object(qe.jsx)(ir,{}),Object(qe.jsx)(Je,{children:"Make sure you set up a BitGo wallet to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."})]}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/360024455592-Setting-up-BitGo",label:"Support article"}),Object(qe.jsx)(_e,{noMargin:!0,children:"Enter wallet information"}),Object(qe.jsx)(nx,{value:v.bitgo,save:k(b),elements:lv(w).elements,validationSchema:lv(w).validationSchema,buttonLabel:"Continue",buttonClass:c.formButton})]}),"infura"===b&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{noMargin:!0,children:"Enter wallet information"}),Object(qe.jsx)(nx,{value:v.infura,save:k(b),elements:qx.infura.elements,validationSchema:qx.infura.getValidationSchema(v.infura),buttonLabel:"Continue",buttonClass:c.formButton})]})]})},hv=Object(f.a)(Yi),pv=[{label:"Choose cryptocurrency",component:Kx},{label:"Choose wallet",component:mv},{label:"Choose ticker",component:ov},{label:"Exchange",component:av},{label:"Blockcypher",component:Gx},{label:"All set",component:Nx}],bv=function(e){var t=e.doContinue,n=Object(a.useState)(0),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Object(a.useState)({}),s=Object(l.a)(c,2),d=s[0],u=s[1],m=hv(),h="BTC"===(null===d||void 0===d?void 0:d.coin)?pv:wx.a(4,1,pv),p=h[i].component;return Object(qe.jsxs)("div",{className:m.wrapper,children:[Object(qe.jsx)("div",{className:m.headerDiv,children:Object(qe.jsx)(ll,{title:"Wallet settings"})}),Object(qe.jsxs)("div",{className:m.contentDiv,children:[Object(qe.jsx)(Si,{children:h.map((function(e,t){return Object(qe.jsx)(Ii,{step:i,it:e,idx:t,steps:h},t)}))}),Object(qe.jsx)("div",{className:m.contentWrapper,children:Object(qe.jsx)(p,{data:d,addData:function(e){u(Gn.a(d,e)),o(i+1)},doContinue:t})})]})]})},fv={welcome:{textAlign:"center",paddingTop:256},title:{lineHeight:1,fontSize:48},getStarted:{fontSize:24,fontWeight:500,marginBottom:54,color:$}},jv=Object(f.a)(fv);var gv=function(e,t){var n=ss(Qc,e);return M.a((function(e){return yO.isValidSync(ss(e.code,n))}))(t)},Ov=function(e,t){return e?function(e,t){var n=ss(Qc,e),a=T.a((function(e){return ss(e.code,n)}))(t);return F.a(jn.a(Tu.a),T.a((function(e){return yO.isValidSync(e)})))(a)}(e,t)?function(e){var t=ss(es,e);return pO.isValidSync(t)}(e)?function(e){var t=ss(ts,e),n=ss(es,e);return Jg(n).isValidSync(t)}(e)?0:3:2:1:0},xv=[{id:"welcome",Component:function(e){var t=e.doContinue,n=jv();return Object(qe.jsxs)("div",{className:n.welcome,children:[Object(qe.jsx)(Ue,{className:n.title,children:"Welcome to the Lamassu Admin"}),Object(qe.jsxs)(Ke,{className:n.getStarted,children:["To get you started, we\u2019ve put together a wizard that will",Object(qe.jsx)("br",{}),"help set up what you need before pairing your machines."]}),Object(qe.jsx)(An,{size:"xl",onClick:t,children:"Get started"})]})}},{id:"wallet",Component:bv,exImage:"/assets/wizard/fullexample.wallet.png",subtitle:"Wallet settings",text:"Your wallet settings are the first step for this wizard. \n We'll start by setting up one of cryptocurrencies to get you up and running,\n but you can later set up as many as you want."},{id:"locale",Component:ZO,exImage:"/assets/wizard/fullexample.locale.png",subtitle:"Locales",text:"From the Locales panel, you can define default settings\n that will be applied to all machines you add to your network later on.\n These settings may be overridden for specific machines in the Overrides section."},{id:"twilio",Component:yx,exImage:"/assets/wizard/fullexample.twilio.png",subtitle:"Twilio (SMS service)",text:Object(qe.jsxs)(qe.Fragment,{children:["Twilio is used for SMS operator notifications, phone number collection for compliance, and 1-confirmation redemptions on cash-out transactions.",Object(qe.jsx)("br",{}),"You'll need to configure Twilio if you're offering cash-out or any compliance options"]})},{id:"commissions",Component:HO,exImage:"/assets/wizard/fullexample.commissions.png",subtitle:"Commissions",text:"From the Commissions page, you can define all the commissions of your\n machines. The values set here will be default values of all machines\n you'll later add to your network. Default settings keep you from\n having to enter the same values everytime you add a new machine. Once\n a machine is added, you may override these values per machine and per\n cryptocurrency in the overrides section."}],vv=n(1082),yv=Object(f.a)((function(){return{drawer:{borderTop:"none",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)"},wrapper:{padding:"32px 0",flexGrow:1,height:264},smallWrapper:{height:84},title:{margin:[[0,32,0,0]]},subtitle:{marginTop:8,marginBottom:6,lineHeight:1.25,display:"inline"},modal:{background:"none",boxShadow:"none"}}}));var wv,Cv,kv,Ev,Nv,Sv,Iv,Lv,Fv,Pv,Dv=function(e){var t,n=e.currentStep,r=e.steps,i=e.subtitle,o=e.text,c=e.exImage,s=e.open,d=e.start,u=yv(),m=Object(a.useState)(!1),p=Object(l.a)(m,2),b=p[0],f=p[1],j=(t={},Object(z.a)(t,u.wrapper,!0),Object(z.a)(t,u.smallWrapper,!s),t);return Object(qe.jsxs)(vv.a,{anchor:"bottom",open:!0,variant:"persistent",classes:{paperAnchorDockedBottom:u.drawer},children:[Object(qe.jsxs)("div",{className:I()(j),children:[Object(qe.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(qe.jsxs)(h.a,{item:!0,xs:5,container:!0,direction:s?"column":"row",justify:"flex-start",alignItems:"baseline",children:[Object(qe.jsx)(Ge,{className:u.title,children:"Setup Lamassu Admin"}),Object(qe.jsx)(Ye,{className:u.subtitle,children:i}),s&&Object(qe.jsx)(Ke,{children:o})]}),Object(qe.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(qe.jsx)(h.a,{item:!0,xs:12,children:r&&n&&Object(qe.jsx)(bp,{currentStep:n,steps:r})})})]}),s&&Object(qe.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(qe.jsx)(h.a,{item:!0,xs:5,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-start",children:Object(qe.jsx)(oa,{onClick:function(){f(!0)},children:"See full example"})}),Object(qe.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(qe.jsx)(h.a,{item:!0,children:Object(qe.jsx)(An,{size:"lg",onClick:d,children:"Get Started"})})})]})]}),Object(qe.jsx)(Yh,{closeOnEscape:!0,closeOnBackdropClick:!0,className:u.modal,xl:!0,width:1328,handleClose:function(){f(!1)},open:b,children:Object(qe.jsx)("img",{width:1152,src:c,alt:""})})]})},Tv=Object(f.a)({wrapper:{display:"flex",padding:[[16,0]],flexDirection:"column",justifyContent:"space-between",backgroundColor:ae},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:ae,backgroundSize:"cover"},blurred:{filter:"blur(4px)",pointerEvents:"none"}}),Rv=x()(wv||(wv=Object(c.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Bv=function(e){e.fromAuthRegister;var t,n,r=Tv(),i=Object(u.c)(Rv),o=i.data,c=i.loading,s=Object(w.h)(),d=Object(a.useContext)(k).setWizardTested,m=Object(a.useState)(0),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!0),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(!1),v=Object(l.a)(x,2),y=v[0],C=v[1];if(c)return Object(qe.jsx)(qe.Fragment,{});var E=Ov(null===o||void 0===o?void 0:o.config,null===o||void 0===o?void 0:o.cryptoCurrencies),N=s.length&&!(null===(t=s.location.state)||void 0===t?void 0:t.fromAuthRegister);0===E&&(d(!0),N?s.goBack():s.push("/"));var S=0===p,L=(n={},Object(z.a)(n,r.blurred,y),Object(z.a)(n,r.wrapper,!0),Object(z.a)(n,r.welcomeBackground,S),n),F=xv[p];return Object(qe.jsxs)(cn.a,{fullScreen:!0,open:g,children:[Object(qe.jsx)(sn.a,{className:I()(L),children:Object(qe.jsx)(F.Component,{doContinue:function(){p>=xv.length-1&&(O(!1),s.push("/"));var e=0===p&&E?E:p+1;C(!0),b(e)},isActive:!y})}),!S&&Object(qe.jsx)(Dv,{currentStep:p,steps:xv.length-1,exImage:F.exImage,subtitle:F.subtitle,text:F.text,open:y,start:function(){C(!1)}})]})},Av=function(e){return!D.a(null===e||void 0===e?void 0:e.id)&&!D.a(null===e||void 0===e?void 0:e.username)&&!D.a(null===e||void 0===e?void 0:e.role)},Mv="user",Wv="superuser",zv=function(e){var t=Object.assign({},e),n=Object(a.useContext)(k).userData;return Av(n)?Object(qe.jsx)(w.c,Object(s.a)({},t)):Object(qe.jsx)(w.b,{to:"/login"})},qv=function(e){var t=e.component,n=e.restricted,r=Object(q.a)(e,["component","restricted"]),i=Object(a.useContext)(k).userData;return Object(qe.jsx)(w.c,Object(s.a)(Object(s.a)({},r),{},{render:function(e){return Av(i)&&n?Object(qe.jsx)(w.b,{to:"/"}):Object(qe.jsx)(t,Object(s.a)({},e))}}))},$v=n(1088),Hv=n(1087),Vv=n(1086),Uv=n(1089),Gv={overviewLegend:{display:"flex",justifyContent:"flex-end","& span":{marginRight:24},"& > :last-child":{marginRight:0}},legendEntry:{display:"flex",flexDirection:"row",alignItems:"center","& > :first-child":{marginRight:8}},dropdownsOverviewWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:16},verticalLine:{height:64,width:1,border:"solid",borderWidth:.5,borderColor:de},dropdowns:{display:"flex",flexDirection:"row","& div":{marginRight:24},"& > :last-child":{marginRight:0}},overview:{display:"flex",flexDirection:"row",alignItems:"center","& div":{marginRight:40},"& > :last-child":{marginRight:0}},overviewFieldWrapper:{marginTop:6,marginBottom:6,"& span":{fontSize:24}},overviewGrowth:{display:"flex",flexDirection:"row",alignItems:"center","& p":{marginLeft:4}},growthPercentage:{fontWeight:"bold"},growth:{color:"#00CD5A"},decline:{color:Q},graphHeaderWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginBottom:40},graphHeaderLeft:{display:"flex",flexDirection:"column"},graphHeaderRight:{marginTop:15,display:"flex",flexDirection:"row","& > *":{marginRight:30,"&:last-child":{marginRight:0}}},graphLegend:{display:"flex",flexDirection:"row",alignItems:"center","& span":{marginRight:24},"& > :last-child":{marginRight:0}},machineSelector:{width:248},cashInIcon:{width:12,height:12,borderRadius:12,backgroundColor:_},cashOutIcon:{width:12,height:12,borderRadius:12,backgroundColor:Z},txIcon:{width:12,height:12,borderRadius:12,backgroundColor:"#000"},topMachinesRadio:{display:"flex",flexDirection:"row"}},Xv=Object(f.a)(Gv),_v=function(e){var t=e.IconElement,n=e.IconComponent,a=e.label,r=Xv();return Object(qe.jsxs)("span",{className:r.legendEntry,children:[!!n&&Object(qe.jsx)(n,{height:12}),!!t&&t,Object(qe.jsx)(Ke,{children:a})]})},Zv={dotOtWrapper:{position:"absolute",top:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.y)&&void 0!==t?t:0},left:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.x)&&void 0!==t?t:0},width:150,padding:12,borderRadius:8},dotOtTransactionAmount:{margin:[[8,0,8,0]]},dotOtTransactionVolume:{color:$},dotOtTransactionClasses:{marginTop:15,"& p > span":{marginLeft:5},"& p:last-child":{marginTop:5}}},Kv=Object(f.a)(Zv),Qv=function(e){var t=e.coords,n=e.data,a=e.dateInterval,r=e.period,i=e.currency,o=e.representing,l=Kv(t),c=L.a("hourOfDay",o.code)?[hd(a[1],"HH:mm"),hd(a[0],"HH:mm")]:[md(a[1],null,"day"===r.code?"MMM d, HH:mm":"MMM d"),md(a[0],null,"day"===r.code?"HH:mm":"MMM d")],s=gs.a((function(e,t){return e.volume+=parseInt(t.fiat),"cashIn"===t.txClass&&e.cashIn++,"cashOut"===t.txClass&&e.cashOut++,e}),{volume:0,cashIn:0,cashOut:0},n);return Object(qe.jsxs)(Un.a,{className:l.dotOtWrapper,children:[Object(qe.jsx)(Ye,{noMargin:!0,children:"day"===r.code||L.a("hourOfDay",o.code)?"".concat(c[0]," - ").concat(c[1]):"".concat(c[0])}),Object(qe.jsxs)(Ke,{noMargin:!0,className:l.dotOtTransactionAmount,children:[bn.a(n)," ",Hm(bn.a(n),"transaction","transactions")]}),Object(qe.jsxs)(Ke,{noMargin:!0,className:l.dotOtTransactionVolume,children:[Gr(s.volume)," ",i," in volume"]}),Object(qe.jsxs)("div",{className:l.dotOtTransactionClasses,children:[Object(qe.jsxs)(it,{noMargin:!0,children:[Object(qe.jsx)(Pc,{}),Object(qe.jsxs)("span",{children:[s.cashIn," cash-in"]})]}),Object(qe.jsxs)(it,{noMargin:!0,children:[Object(qe.jsx)(Wc,{}),Object(qe.jsxs)("span",{children:[s.cashOut," cash-out"]})]})]})]})},Yv=Object(a.memo)(Qv,(function(e,t){return e.coords===t.coords})),Jv=n(1083),ey=n(1084),ty=function(e){var t=e.data,n=e.timezone,r=e.setSelectionCoords,i=e.setSelectionData,o=e.setSelectionDateInterval,l=(e.selectedMachine,Object(a.useRef)(null)),c=10,s=401,d=1163,u=Object(a.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),m=Object(rd.a)(n),h=function(e,t){for(var n=[],a=new Date(e[0]),r=new Date(e[1]),i=Tm.a(a);i<=r;)n.push(Tm.a(i)),i.setUTCHours(i.getUTCHours()+t);return n},p=Object(a.useCallback)((function(e,n){return M.a((function(t){var a=new Date(t.created).setTime(new Date(t.created).getTime()+new Date(t.created).getTimezoneOffset()*Fd+m),r=new Date(a);return e.getUTCHours()<n.getUTCHours()&&r.getUTCHours()>=new Date(e).getUTCHours()&&r.getUTCHours()<new Date(n).getUTCHours()||e.getUTCHours()>n.getUTCHours()&&r.getUTCHours()<=new Date(e).getUTCHours()&&r.getUTCHours()<new Date(n).getUTCHours()}),t)}),[t,m]),b=Object(a.useCallback)((function(e,t){return gs.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=$c()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=$c()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},p(e,t))}),[p]),f=jd.scaleUtc().domain([dd(Object(Jv.a)(new Date)),dd(Object(Sd.a)({days:1},Object(Jv.a)(new Date)))]).rangeRound([u.left,d-u.right]),j=T.a((function(e){var t=Tm.a(e);e.setUTCHours(e.getUTCHours()+2);var n=Tm.a(e);return[t,p(t,n)]}),ey.a(h(f.domain(),2))),g=T.a((function(e){var t=Tm.a(e);e.setUTCHours(e.getUTCHours()+2);var n=Tm.a(e);return[t,b(t,n)]}),ey.a(h(f.domain(),2))),O=jd.scaleLinear().domain([0,0!==jd.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut}))?jd.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut})):50]).range([s-u.bottom,u.top]),x=Object(a.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(s-u.bottom,")")).call(jd.axisBottom(f).ticks(jd.timeHour.every(2)).tickFormat(jd.timeFormat("%H:%M")))}),[u,f]),v=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(u.left,", 0)")).call(jd.axisLeft(O).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[u,O]),y=Object(a.useCallback)((function(e){return e.attr("stroke",ie).append("g").selectAll("line").data(h(f.domain(),2)).join("line").attr("x1",(function(e){var t=f(e),n=h(f.domain(),2);return t===f(n[bn.a(n)-1])?t-1:.5+t})).attr("x2",(function(e){var t=f(e),n=h(f.domain(),2);return t===f(n[bn.a(n)-1])?t-1:.5+t})).attr("y1",u.top).attr("y2",s-u.bottom)}),[u,f]),w=Object(a.useCallback)((function(e){return e.append("g").selectAll("line").data(h(f.domain(),2)).join("rect").attr("x",(function(e){return f(e)})).attr("y",u.top).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),a=fl.a((function(e){return e===t}),n),r=a+1===bn.a(n)?0:n[a+1]-n[a];return Math.round(100*r)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=Tm.a(new Date(e.target.__data__)),n=Tm.a(t);t.setUTCHours(t.getUTCHours()+2);var a=Tm.a(t),l=j.find((function(e){return gn.a(n,e[0])}))[1],c=Tm.a(e.target.getBoundingClientRect().x),s=Tm.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:c-150-25,u=Tm.a(e.target.getBoundingClientRect().y);o([a,n]),i(l),r({x:Math.round(d),y:Math.round(u)}),jd.select("#event-rect-".concat(f(e.target.__data__))).attr("fill",re)})).on("mouseleave",(function(e){jd.select("#event-rect-".concat(f(e.target.__data__))).attr("fill","transparent"),o(null),i(null),r(null)}))}),[u,j,r,i,o,f]),C=Object(a.useCallback)((function(e){return e.append("g").selectAll("line").data(h(f.domain(),2)).join("rect").attr("id",(function(e){return"event-rect-".concat(f(e))})).attr("x",(function(e){return f(e)})).attr("y",u.top).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),a=fl.a((function(e){return e===t}),n),r=a+1===bn.a(n)?0:n[a+1]-n[a];return Math.round(100*r)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent")}),[u,f]),k=Object(a.useCallback)((function(){return jd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",ge)}),[]),E=Object(a.useCallback)((function(e){e.selectAll("rect").data(ey.a(h(f.domain(),2))).join("rect").attr("stroke",_).attr("fill",_).attr("x",(function(e){return f(e)+5})).attr("y",(function(e){var t=Aa.a((function(t){return gn.a(t[0],e)}),g);return O(t[1].cashIn)-u.top+u.bottom})).attr("height",(function(e){var t=Aa.a((function(t){return gn.a(t[0],e)}),g);return op.a(0,s,s-O(t[1].cashIn)-u.bottom-5)})).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),a=fl.a((function(e){return e===t}),n),r=a===bn.a(n)?0:n[a+1]-n[a];return Math.round(100*(r-c))/100})).attr("rx",2.5)}),[f,O,u,g]),N=Object(a.useCallback)((function(e){e.selectAll("rect").data(ey.a(h(f.domain(),2))).join("rect").attr("stroke",Z).attr("fill",Z).attr("x",(function(e){return f(e)+5})).attr("y",(function(e){var t=Aa.a((function(t){return gn.a(t[0],e)}),g);return O(t[1].cashIn+t[1].cashOut)-u.top+u.bottom})).attr("height",(function(e){var t=Aa.a((function(t){return gn.a(t[0],e)}),g);return op.a(0,s,s-O(t[1].cashOut)-u.bottom-5)})).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),a=fl.a((function(e){return e===t}),n),r=a===bn.a(n)?0:n[a+1]-n[a];return Math.round(100*(r-c))/100})).attr("rx",2.5)}),[f,O,u,g]),S=Object(a.useCallback)((function(){var e=jd.select(l.current).attr("viewBox",[0,0,d,s]);return e.append("g").call(x),e.append("g").call(v),e.append("g").call(y),e.append("g").call(C),e.append("g").call(k),e.append("g").call(E),e.append("g").call(N),e.append("g").call(w),e.node()}),[x,v,C,w,y,E,k,N]);return Object(a.useEffect)((function(){jd.select(l.current).selectAll("*").remove(),S()}),[S]),Object(qe.jsx)("svg",{ref:l})},ny=Object(a.memo)(ty,(function(e,t){return gn.a(e.period,t.period)&&gn.a(e.selectedDay,t.selectedDay)&&gn.a(e.selectedMachine,t.selectedMachine)})),ay=function(e){var t,n=e.data,r=e.period,i=e.timezone,o=e.setSelectionCoords,l=e.setSelectionData,c=e.setSelectionDateInterval,s=Object(a.useRef)(null),u=401,m=1163,h=Object(a.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),p=Object(rd.a)(i),b=Date.now()+p,f={day:[b-Pd,b],week:[b-Dd,b],month:[b-Td,b]},j=Object(a.useMemo)((function(){return{day:{freq:24,step:36e5,tick:jd.utcHour.every(1),labelFormat:"%H:%M"},week:{freq:7,step:864e5,tick:jd.utcDay.every(1),labelFormat:"%a %d"},month:{freq:30,step:864e5,tick:jd.utcDay.every(1),labelFormat:"%d"}}}),[]),g=Object(a.useCallback)((function(e){var t=new Date(e),n=t.getUTCDate(),a=t.getUTCDay(),r=t.getUTCMonth(),i=new Date(t.getTime());i.setUTCDate(n-1);var o=i.getUTCDate(),l=i.getUTCDay(),c=i.getUTCMonth(),s=Array.from(Array(7)).map((function(e,t){return Object(sd.a)("EEE",Object(Sd.a)({days:t},Object(Id.a)(new Date)))})),d=Array.from(Array(12)).map((function(e,t){return Object(sd.a)("LLL",Object(Sd.a)({months:t},Object(Ld.a)(new Date)))}));return{previous:r!==c?d[c]:"".concat(s[l]," ").concat(o),current:r!==c?d[r]:"".concat(s[a]," ").concat(n)}}),[]),O=Object(a.useCallback)((function(e){for(var t=[],n=function(e){var t=j[r.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},a=0;a<=j[r.code].freq;a++){var i=new Date(b-a*j[r.code].step);n(i)>e[1]||(i<e[0]||t.push(n(i)))}return t}),[b,j,r.code]),x=Object(a.useCallback)((function(e){var t=[];t.push(e[1]);for(var n=function(e){var t=j[r.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},a=0;a<=j[r.code].freq;a++){var i=new Date(b-a*j[r.code].step);n(i)>new Date(e[1])||(i<new Date(e[0])||t.push(n(i)))}return t.push(e[0]),t}),[b,j,r.code]),v=jd.scaleUtc().domain(f[r.code]).range([h.left,m-h.right]),y=jd.scaleLinear().domain([0,1.03*(null!==(t=jd.max(n,(function(e){return new $c.a(e.fiat).toNumber()})))&&void 0!==t?t:1e3)]).nice().range([u-h.bottom,h.top]),w=function(e,t){for(var n=[t[1]].concat(Object(d.a)(M.a((function(e){return e>t[0]&&e<t[1]}),e)),[t[0]]),a=[],r=0;r<n.length-1;r++)a.push([n[r],n[r+1]]);return a},C=Object(a.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(u-h.bottom,")")).call(jd.axisBottom(v).ticks(j[r.code].tick).tickFormat((function(e){return jd.timeFormat(j[r.code].labelFormat)(e.getTime()+e.getTimezoneOffset()*Fd)}))).call((function(e){return e.select(".domain").remove()})).call((function(e){return e.append("line").attr("x1",h.left).attr("y1",-401+h.top+h.bottom).attr("x2",h.left).attr("stroke",J).attr("stroke-width",1)}))}),[h,j,r.code,v]),k=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(h.left,", 0)")).call(jd.axisLeft(y).ticks(4.01)).call((function(e){return e.select(".domain").remove()})).call((function(e){return e.selectAll(".tick line").filter((function(e){return 0===e})).clone().attr("x2",m-h.right-h.left).attr("stroke-width",1).attr("stroke",J)}))}),[h,y]),E=Object(a.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(O(v.domain())).join("line").attr("x1",(function(e){return.5+v(e)})).attr("x2",(function(e){return.5+v(e)})).attr("y1",h.top).attr("y2",u-h.bottom)})).call((function(e){return e.append("g").selectAll("line").data(jd.axisLeft(y).scale().ticks(4.01)).join("line").attr("y1",(function(e){return.5+y(e)})).attr("y2",(function(e){return.5+y(e)})).attr("x1",h.left).attr("x2",m-h.right)})).call((function(e){return e.append("g").selectAll("line").data(x(v.domain())).join("rect").attr("x",(function(e){return v(e)})).attr("y",h.top).attr("width",(function(e){var t=Math.round(100*v(e))/100,n=function(e,t){var n;return null!==(n=Aa.a((function(e){return t<=e[0]&&t>=e[1]}),e))&&void 0!==n?n:[0,0]}(w(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range()),t);return Math.round(100*(n[0]-n[1]))/100})).attr("height",u-h.bottom-h.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=Math.round(100*e.target.x.baseVal.value)/100,a=function(e,t,n){for(var a=Ag.a(ul.a(t)),r=t.length-1;r>=0;r--)if(n<a[r])return[e[r],e[r+1]]}(x(v.domain()),w(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range()),t),r=n.filter((function(e){var t=new Date(e.created),n=t.setTime(t.getTime()+p);return n>new Date(a[1])&&n<=new Date(a[0])})),i=Tm.a(e.target.getBoundingClientRect().x),s=Tm.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:i-150-25,u=Tm.a(e.target.getBoundingClientRect().y);c(a),l(r),o({x:Math.round(d),y:Math.round(u)}),jd.select(e.target).attr("fill",re)})).on("mouseleave",(function(e){jd.select(e.target).attr("fill","transparent"),c(null),l(null),o(null)}))})).call((function(e){return e.append("g").selectAll("line").data(O(v.domain()).filter((function(e){return"day"===r.code?0===e.getUTCHours():1===e.getUTCDate()}))).join("line").attr("class","dateSeparator").attr("x1",(function(e){return.5+v(e)})).attr("x2",(function(e){return.5+v(e)})).attr("y1",h.top-50).attr("y2",u-h.bottom).attr("stroke-width",5).join("text")})).call((function(e){var t,n,a=null===jd||void 0===jd||null===(t=jd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var i=O(v.domain()).filter((function(e){return"day"===r.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",a.x-10).attr("y",a.y+33).attr("text-anchor","end").attr("dy",".25em").text(o.previous)}})).call((function(e){var t,n,a=null===jd||void 0===jd||null===(t=jd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var i=O(v.domain()).filter((function(e){return"day"===r.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",a.x+10).attr("y",a.y+33).attr("text-anchor","start").attr("dy",".25em").text(o.current)}}))}),[h,O,g,v,y,r,x,n,p,o,l,c]),N=Object(a.useCallback)((function(){return jd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",ge)}),[]),S=Object(a.useCallback)((function(){return jd.selectAll("text").style("stroke",se).style("fill",se).style("stroke-width",.5).style("font-family",ge)}),[]),I=Object(a.useCallback)((function(){jd.selectAll(".tick line").style("stroke",J).style("fill",J)}),[]),L=Object(a.useCallback)((function(e){e.attr("stroke",J).attr("stroke-width",3).attr("stroke-dasharray","10, 5").call((function(e){var t,a;return e.append("line").attr("y1",.5+y(null!==(t=jd.mean(n,(function(e){return new $c.a(e.fiat).toNumber()})))&&void 0!==t?t:0)).attr("y2",.5+y(null!==(a=jd.mean(n,(function(e){return new $c.a(e.fiat).toNumber()})))&&void 0!==a?a:0)).attr("x1",h.left).attr("x2",m-h.right)}))}),[h,y,n]),F=Object(a.useCallback)((function(e){e.selectAll("circle").data(n).join("circle").attr("cx",(function(e){var t=new Date(e.created);return v(t.setTime(t.getTime()+p))})).attr("cy",(function(e){return y(new $c.a(e.fiat).toNumber())})).attr("fill",(function(e){return"cashIn"===e.txClass?_:Z})).attr("r",3.5)}),[n,p,v,y]),P=Object(a.useCallback)((function(){var e=jd.select(s.current).attr("viewBox",[0,0,m,u]);return e.append("g").call(E),e.append("g").call(L),e.append("g").call(C),e.append("g").call(k),e.append("g").call(N),e.append("g").call(S),e.append("g").call(I),e.append("g").call(F),e.node()}),[L,E,C,k,F,S,I,N]);return Object(a.useEffect)((function(){jd.select(s.current).selectAll("*").remove(),P()}),[P]),Object(qe.jsx)("svg",{ref:s})},ry=Object(a.memo)(ay,(function(e,t){return gn.a(e.period,t.period)&&gn.a(e.selectedMachine,t.selectedMachine)})),iy=n(1085),oy=n(331),ly=n(534),cy=function(e){var t=e.data,n=e.machines,r=e.currency,i=(e.selectedMachine,Object(a.useRef)(null)),o=.15,l=401,c=Object(a.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),s=Tm.a(n),d=bn.a(n)>=5?s:T.a((function(e){return D.a(s[e])?{code:"ghostMachine".concat(e),display:""}:s[e]}),Du.a(Tu.a,5)),u=gs.a((function(e,n){return e[n.code]=M.a((function(e){return e.deviceId===n.code}),t),e}),{},d),m=iy.a((function(e,t){return t[1]-e[1]}),T.a((function(e){return[e.code,(t=e.code,gs.a((function(e,t){return e+$c()(t.fiat).toNumber()}),0,u[t]))];var t}),d)),h=oy.a(5,m),p=Uc.a(T.a((function(e){return[e[0],(t=e[0],gs.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=$c()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=$c()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},u[t]))];var t}),h)),b=jd.scaleBand().domain(h).range([c.left,1163-c.right]).paddingInner(o),f=jd.scaleLinear().domain([0,0!==jd.max(h,(function(e){return e[1]}))?jd.max(h,(function(e){return e[1]})):50]).range([l-c.bottom,c.top]),j=Object(a.useCallback)((function(e){return e.attr("class","x-axis-1").attr("transform","translate(0, ".concat(l-c.bottom,")")).call(jd.axisBottom(b).tickFormat((function(e){var t;return"".concat(null!==(t=Aa.a((function(t){return t.code===e[0]}),d).display)&&void 0!==t?t:"")})).tickSize(0).tickPadding(10))}),[c,b,d]),g=Object(a.useCallback)((function(e){e.attr("class","x-axis-2").attr("transform","translate(0, ".concat(l-c.bottom,")")).call(jd.axisBottom(b).tickFormat((function(e){return L.a("ghostMachine",e[0])?"":"".concat(e[1].toFixed(2)," ").concat(r)})).tickSize(0).tickPadding(10))}),[c,b,r]),O=Object(a.useCallback)((function(){jd.selectAll(".x-axis-1 .tick text").attr("transform",(function(e){var t=(b.range()[1]-b.range()[0])/5;return"translate(".concat(-t/2.25+this.getBBox().width/2,", 0)")}))}),[b]),x=Object(a.useCallback)((function(){jd.selectAll(".x-axis-2 .tick text").attr("transform",(function(e){var t=(b.range()[1]-b.range()[0])/5;return"translate(".concat(t/2.25-this.getBBox().width/2,", 0)")}))}),[b]),v=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(c.left,", 0)")).call(jd.axisLeft(f).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[c,f]),y=Object(a.useCallback)((function(){return jd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",ge)}),[]),w=Object(a.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(ly.a(b.domain())).join("line").attr("x1",(function(e){var t=fl.a((function(t){return gn.a(t,e)}),b.domain()),n=.075*(b(b.domain()[t])-b(b.domain()[t-1]));return.5+b(e)-n})).attr("x2",(function(e){var t=fl.a((function(t){return gn.a(t,e)}),b.domain()),n=.075*(b(b.domain()[t])-b(b.domain()[t-1]));return.5+b(e)-n})).attr("y1",c.top).attr("y2",l-c.bottom)}))}),[c,b]),C=Object(a.useCallback)((function(e){e.selectAll("rect").data(Xc.a(p)).join("rect").attr("fill",_).attr("x",(function(e){return b([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return f(e[1].cashIn)-c.top+c.bottom})).attr("height",(function(e){return op.a(0,l,l-f(e[1].cashIn)-c.bottom-10)})).attr("width",b.bandwidth()).attr("rx",2.5)}),[p,b,f,c]),k=Object(a.useCallback)((function(e){e.selectAll("rect").data(Xc.a(p)).join("rect").attr("fill",Z).attr("x",(function(e){return b([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return f(e[1].cashIn+e[1].cashOut)-c.top+c.bottom})).attr("height",(function(e){return op.a(0,l,l-f(e[1].cashOut)-c.bottom-5)})).attr("width",b.bandwidth()).attr("rx",2.5)}),[p,b,f,c]),E=Object(a.useCallback)((function(){var e=jd.select(i.current).attr("viewBox",[0,0,1163,l]);return e.append("g").call(j),e.append("g").call(g),e.append("g").call(v),e.append("g").call(y),e.append("g").call(w),e.append("g").call(C),e.append("g").call(k),e.append("g").call(O),e.append("g").call(x),e.node()}),[j,g,O,x,v,y,w,C,k]);return Object(a.useEffect)((function(){jd.select(i.current).selectAll("*").remove(),E()}),[E]),Object(qe.jsx)("svg",{ref:i})},sy=Object(a.memo)(cy,(function(e,t){return gn.a(e.period,t.period)&&gn.a(e.selectedMachine,t.selectedMachine)})),dy=function(e){var t=e.data,n=e.representing,r=e.period,i=e.timezone,o=e.currency,c=e.selectedMachine,s=e.machines,d=e.selectedDay,u=Object(a.useState)(null),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];return Object(qe.jsxs)("div",{children:[!D.a(h)&&Object(qe.jsx)(Yv,{coords:h,dateInterval:j,data:v,period:r,currency:o,timezone:i,representing:n}),function(e){switch(e.code){case"overTime":return Object(qe.jsx)(ry,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c});case"topMachinesVolume":case"topMachinesTransactions":return Object(qe.jsx)(sy,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c,machines:M.a((function(e){return"all"!==e.code}),s),currency:o});case"hourOfDayVolume":case"hourOfDayTransactions":return Object(qe.jsx)(ny,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c,machines:M.a((function(e){return"all"!==e.code}),s),currency:o,selectedDay:d});default:throw new Error("There's no graph to represent ".concat(e))}}(n)]})},uy=Object(a.memo)(dy),my=Object(f.a)(Gv),hy=[{code:"hourOfDayTransactions",display:"Transactions"},{code:"hourOfDayVolume",display:"Volume"}],py=function(e){var t=e.title,n=e.period,r=e.data,i=e.machines,o=e.selectedMachine,c=e.handleMachineChange,s=e.selectedDay,d=e.dayOptions,u=e.handleDayChange,m=e.timezone,h=e.currency,p=my(),b=Object(a.useState)(hy[0].code),f=Object(l.a)(b,1)[0],j={cashIn:Object(qe.jsx)("div",{className:p.cashInIcon}),cashOut:Object(qe.jsx)("div",{className:p.cashOutIcon})},g=Object(rd.a)(m),O=gs.a((function(e,t){var n=new Date(t.created);switch(n.setTime(n.getTime()+n.getTimezoneOffset()*Fd+g),n.getDay()){case 0:e.sunday.push(t);break;case 1:e.monday.push(t);break;case 2:e.tuesday.push(t);break;case 3:e.wednesday.push(t);break;case 4:e.thursday.push(t);break;case 5:e.friday.push(t);break;case 6:e.saturday.push(t);break;default:throw new Error("Day of week not recognized")}return e}),Uc.a(T.a((function(e){return[e.code,[]]}),d)),r);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:p.graphHeaderWrapper,children:[Object(qe.jsxs)("div",{className:p.graphHeaderLeft,children:[Object(qe.jsx)(Ge,{noMargin:!0,children:t}),Object(qe.jsxs)(tl.a,{className:p.graphLegend,children:[Object(qe.jsx)(_v,{IconElement:j.cashIn,label:"Cash-in"}),Object(qe.jsx)(_v,{IconElement:j.cashOut,label:"Cash-out"})]})]}),Object(qe.jsxs)("div",{className:p.graphHeaderRight,children:[Object(qe.jsx)(sh,{label:"Day of the week",items:d,default:d[0],selectedItem:s,onSelectedItemChange:u}),Object(qe.jsx)(sh,{label:"Machines",onSelectedItemChange:c,items:i,default:i[0],selectedItem:o})]})]}),Object(qe.jsx)(uy,{representing:Aa.a((function(e){return e.code===f}))(hy),period:n,data:O[s.code],timezone:m,currency:h,selectedMachine:o,machines:i,selectedDay:s})]})},by=Object(f.a)(Gv),fy=function(e){var t=e.title,n=e.representing,a=e.period,r=e.data,i=e.machines,o=e.selectedMachine,l=e.handleMachineChange,c=e.timezone,s=e.currency,d=by(),u={cashIn:Object(qe.jsx)("div",{className:d.cashInIcon}),cashOut:Object(qe.jsx)("div",{className:d.cashOutIcon}),transaction:Object(qe.jsx)("div",{className:d.txIcon}),average:Object(qe.jsx)("svg",{height:"12",width:"18",children:Object(qe.jsx)("path",{stroke:J,strokeWidth:"3",strokeDasharray:"5, 2",d:"M 5 6 l 20 0"})})};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(qe.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(qe.jsx)(Ge,{noMargin:!0,children:t}),Object(qe.jsxs)(tl.a,{className:d.graphLegend,children:[Object(qe.jsx)(_v,{IconElement:u.cashIn,label:"Cash-in"}),Object(qe.jsx)(_v,{IconElement:u.cashOut,label:"Cash-out"}),Object(qe.jsx)(_v,{IconElement:u.transaction,label:"One transaction"}),Object(qe.jsx)(_v,{IconElement:u.average,label:"Average"})]})]}),Object(qe.jsx)("div",{className:d.graphHeaderRight,children:Object(qe.jsx)(sh,{label:"Machines",onSelectedItemChange:l,items:i,default:i[0],selectedItem:o})})]}),Object(qe.jsx)(uy,{representing:n,period:a,data:r,timezone:c,currency:s,selectedMachine:o,machines:i})]})},jy=Object(f.a)(Gv),gy=[{code:"topMachinesTransactions",display:"Transactions"},{code:"topMachinesVolume",display:"Volume"}],Oy=function(e){var t=e.title,n=e.period,r=e.data,i=e.machines,o=e.selectedMachine,c=e.timezone,s=e.currency,d=jy(),u=Object(a.useState)(gy[0].code),m=Object(l.a)(u,1)[0],h={cashIn:Object(qe.jsx)("div",{className:d.cashInIcon}),cashOut:Object(qe.jsx)("div",{className:d.cashOutIcon})};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(qe.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(qe.jsx)(Ge,{noMargin:!0,children:t}),Object(qe.jsxs)(tl.a,{className:d.graphLegend,children:[Object(qe.jsx)(_v,{IconElement:h.cashIn,label:"Cash-in"}),Object(qe.jsx)(_v,{IconElement:h.cashOut,label:"Cash-out"})]})]}),Object(qe.jsx)("div",{className:d.graphHeaderRight})]}),Object(qe.jsx)(uy,{representing:Aa.a(W.a("code",m),gy),period:n,data:r,timezone:c,currency:s,selectedMachine:o,machines:i})]})},xy=Object(f.a)(Gv),vy=[{code:"all",display:"All machines"}],yy=[{code:"overTime",display:"Over time"},{code:"topMachines",display:"Top Machines"},{code:"hourOfTheDay",display:"Hour of the day"}],wy=[{code:"day",display:"Last 24 hours"},{code:"week",display:"Last 7 days"},{code:"month",display:"Last 30 days"}],Cy={day:Pd,week:Dd,month:Td},ky=T.a((function(e){return{code:On.a(e),display:e}}),Array.from(Array(7)).map((function(e,t){return Object(sd.a)("EEEE",Object(Sd.a)({days:t},Object(Id.a)(new Date)))}))),Ey=x()(Cv||(Cv=Object(c.a)(["\n query transactions(\n $from: Date\n $until: Date\n $excludeTestingCustomers: Boolean\n ) {\n transactions(\n from: $from\n until: $until\n excludeTestingCustomers: $excludeTestingCustomers\n ) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n }\n }\n"]))),Ny=x()(kv||(kv=Object(c.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n }\n fiatRates {\n code\n name\n rate\n }\n }\n"]))),Sy=function(e){var t,n=e.label,a=e.value,r=e.oldValue,i=e.currency,o=xy(),l=100*(a-r)/(!r||gn.a(r,0)?1:r),c=(t={},Object(z.a)(t,o.growthPercentage,!0),Object(z.a)(t,o.growth,om.a(a,r)),Object(z.a)(t,o.decline,om.a(r,a)),t);return Object(qe.jsxs)("div",{className:o.overviewEntry,children:[Object(qe.jsx)(Ke,{noMargin:!0,children:n}),Object(qe.jsxs)(Ye,{noMargin:!0,className:o.overviewFieldWrapper,children:[Object(qe.jsx)("span",{children:Gr(a)}),!!i&&" ".concat(i)]}),Object(qe.jsxs)("span",{className:o.overviewGrowth,children:[om.a(l,0)&&Object(qe.jsx)(nd,{height:10}),Vv.a(l,0)&&Object(qe.jsx)(Us,{height:10}),gn.a(l,0)&&Object(qe.jsx)(Ks,{height:10}),Object(qe.jsxs)(Ke,{noMargin:!0,className:I()(c),children:[Gr(l),"%"]})]})]})},Iy=function(){var e,t,n,r,i,o=xy(),c=Object(u.c)(Ey,{variables:{from:Object(Hv.a)(65,Object($v.a)()),until:Object($v.a)(),excludeTestingCustomers:!0}}),d=c.data,m=c.loading,h=Object(u.c)(Ny),p=h.data,b=h.loading,f=Object(a.useState)(yy[0]),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(wy[0]),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(a.useState)(vy[0]),k=Object(l.a)(C,2),E=k[0],N=k[1],S=Object(a.useState)(gn.a(g.code,"hourOfTheDay")?ky[0]:null),I=Object(l.a)(S,2),L=I[0],F=I[1],P=m||b,R=null!==(e=A.a(["transactions"])(d))&&void 0!==e?e:[],B=null!==(t=A.a(["machines"])(p))&&void 0!==t?t:[],z=null!==(n=A.a(["config"])(p))&&void 0!==n?n:[],q=null!==(r=A.a(["fiatRates"])(p))&&void 0!==r?r:[],$=ss("locale")(z).fiatCurrency,H=null===z||void 0===z?void 0:z.locale_timezone,V=function(e){if(e.fiatCode===$)return e;var t=Aa.a(W.a("code",e.fiatCode))(q),n=Aa.a(W.a("code",$))(q),a=(null===n||void 0===n?void 0:n.rate)/(null===t||void 0===t?void 0:t.rate);return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*a})},U=null!==(i=T.a(V)(null===R||void 0===R?void 0:R.filter((function(e){return(!e.dispensed||!e.expired)&&(e.sendConfirmed||e.dispense)}))))&&void 0!==i?i:[],G=Tm.a(vy);Uv.a((function(e){return G.push({code:e.deviceId,display:e.name})}),B);var X=M.a((function(e){return"all"===E.code||e.deviceId===E.code}),U),_=function(e){var t,n;return{current:null!==(t=X.filter((function(t){var n=new Date(t.created);return(!!D.a(L)||gn.a(On.a(Object(sd.a)("EEEE",n)),L.code))&&n>=Date.now()-Cy[e]})))&&void 0!==t?t:[],previous:null!==(n=X.filter((function(t){var n=new Date(t.created);return(!!D.a(L)||gn.a(On.a(Object(sd.a)("EEEE",n)),L.code))&&n<Date.now()-Cy[e]&&n>=Date.now()-2*Cy[e]})))&&void 0!==n?n:[]}},Z={current:_(y.code).current.length,previous:_(y.code).previous.length},K={current:js.a(T.a((function(e){return e.fiat}),_(y.code).current))/(0===Z.current?1:Z.current),previous:js.a(T.a((function(e){return e.fiat}),_(y.code).previous))/(0===Z.previous?1:Z.previous)},Q={current:js.a(T.a((function(e){return e.fiat}),_(y.code).current)),previous:js.a(T.a((function(e){return e.fiat}),_(y.code).previous))},Y={current:js.a(T.a((function(e){return e.fiat*e.commissionPercentage}),_(y.code).current)),previous:js.a(T.a((function(e){return e.fiat*e.commissionPercentage}),_(y.code).previous))};return!P&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ll,{title:"Analytics",children:Object(qe.jsxs)(tl.a,{className:o.overviewLegend,children:[Object(qe.jsx)(_v,{IconComponent:nd,label:"Up since last period"}),Object(qe.jsx)(_v,{IconComponent:Us,label:"Down since last period"}),Object(qe.jsx)(_v,{IconComponent:Ks,label:"Same since last period"})]})}),Object(qe.jsxs)("div",{className:o.dropdownsOverviewWrapper,children:[Object(qe.jsxs)("div",{className:o.dropdowns,children:[Object(qe.jsx)(sh,{label:"Representing",onSelectedItemChange:function(e){O(e),F(gn.a(e.code,"hourOfTheDay")?ky[0]:null)},items:yy,default:yy[0],selectedItem:g,defaultAsFilter:!0}),Object(qe.jsx)(sh,{label:"Time period",onSelectedItemChange:w,items:wy,default:wy[0],selectedItem:y,defaultAsFilter:!0})]}),Object(qe.jsxs)("div",{className:o.overview,children:[Object(qe.jsx)(Sy,{label:"Transactions",value:Z.current,oldValue:Z.previous}),Object(qe.jsx)("div",{className:o.verticalLine}),Object(qe.jsx)(Sy,{label:"Avg. txn amount",value:K.current,oldValue:K.previous,currency:$}),Object(qe.jsx)("div",{className:o.verticalLine}),Object(qe.jsx)(Sy,{label:"Volume",value:Q.current,oldValue:Q.previous,currency:$}),Object(qe.jsx)("div",{className:o.verticalLine}),Object(qe.jsx)(Sy,{label:"Commissions",value:Y.current,oldValue:Y.previous,currency:$})]})]}),function(e){switch(e.code){case"overTime":return Object(qe.jsx)(fy,{title:"Transactions over time",representing:e,period:y,data:T.a(V)(_(y.code).current),machines:G,selectedMachine:E,handleMachineChange:N,timezone:H,currency:$});case"topMachines":return Object(qe.jsx)(Oy,{title:"Transactions over time",representing:e,period:y,data:T.a(V)(_(y.code).current),machines:G,selectedMachine:E,handleMachineChange:N,timezone:H,currency:$});case"hourOfTheDay":return Object(qe.jsx)(py,{title:"Avg. transactions per hour of the day",representing:e,period:y,data:T.a(V)(_(y.code).current),machines:G,selectedMachine:E,handleMachineChange:N,selectedDay:L,dayOptions:ky,handleDayChange:F,timezone:H,currency:$});default:throw new Error("There's no graph info to represent ".concat(e))}}(g)]})},Ly=n(1090),Fy={grid:{flex:1,height:"100%"},content:{display:"flex",flexDirection:"column",flex:1,marginLeft:48},footer:{margin:[["auto",0,24,"auto"]]},modalTitle:{margin:[["auto",0,8.5,"auto"]]},subtitle:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},white:{color:K},deleteButton:{paddingLeft:13},addressRow:{marginLeft:8},error:{marginTop:20},closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},dialogTitle:{margin:[[0,16,8,40]]},dialogContent:{width:615,marginLeft:16},dialogActions:{padding:32,paddingTop:16},cancelButton:{marginRight:8,padding:0}},Py=Object(f.a)(Fy),Dy=function(e){var t=e.onClose,n=e.selectedCoin,a=e.addToBlacklist,r=e.errorMsg,i=Py();return Object(qe.jsxs)(Yh,{closeOnBackdropClick:!0,width:676,height:200,handleClose:t,open:!0,children:[Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:{address:""},validationSchema:xn.f({address:xn.h().trim().required("An address is required")}),onSubmit:function(e){!function(e){"BCH"!==n.code||e.startsWith("bitcoincash:")||(e="bitcoincash:"+e),a(n.code,e)}(e.address.trim())},children:Object(qe.jsxs)(mn.d,{id:"address-form",children:[Object(qe.jsx)(Xe,{className:i.modalTitle,children:n.display?"Blacklist ".concat(On.a(n.display)," address"):""}),Object(qe.jsx)(mn.b,{name:"address",fullWidth:!0,autoComplete:"off",label:"Paste new address to blacklist here",placeholder:"ex: ".concat({BTC:"1ADwinnimZKGgQ3dpyfoUZvJh4p1UWSSpD",ETH:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F",LTC:"LPKvbjwV1Kaksktzkr7TMK3FQtQEEe6Wqa",DASH:"XqQ7gU8eM76rEfey726cJpT2RGKyJyBrcn",ZEC:"t1KGyyv24eL354C9gjveBGEe8Xz9UoPKvHR",BCH:"qrd6za97wm03lfyg82w0c9vqgc727rhemg5yd9k3dm",XMR:"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H"}[n.code]),component:si}),!D.a(r)&&Object(qe.jsx)(rl,{className:i.error,children:r})]})}),Object(qe.jsx)("div",{className:i.footer,children:Object(qe.jsx)(tl.a,{display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{type:"submit",form:"address-form",children:"Blacklist address"})})})]})},Ty=Object(f.a)(lg),Ry=function(e){var t,n=e.id,a=e.index,r=e.elements,i=e.data,o=e.width,l=e.Details,c=e.expanded,d=e.expandRow,u=e.expWidth,m=e.expandable,h=e.onClick,p=e.size,b=Object(q.a)(e,["id","index","elements","data","width","Details","expanded","expandRow","expWidth","expandable","onClick","size"]),f=Ty(),j=h||m,g=(t={},Object(z.a)(t,f.pointer,j),Object(z.a)(t,f.row,!0),Object(z.a)(t,f.expanded,c),t);return Object(qe.jsxs)("div",{className:f.rowWrapper,children:[Object(qe.jsx)("div",{className:I()(Object(z.a)({},f.before,c&&0!==a)),children:Object(qe.jsxs)(Lm,{size:p,className:I()(g),onClick:function(){m&&d(n,i),h&&h(i)},error:i.error||i.hasError||i.batchError,shouldShowError:!1,errorMessage:i.errorMessage||i.hasError||i.batchError,children:[r.map((function(e,t){var n=e.view,a=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,r=Object(q.a)(e,["view"]);return Object(qe.jsx)(Nm,Object(s.a)(Object(s.a)({},r),{},{children:a(i)}),t)})),m&&Object(qe.jsx)(Nm,{width:u,textAlign:"center",children:Object(qe.jsxs)("button",{onClick:function(){return d(n,i)},className:f.expandButton,children:[c&&Object(qe.jsx)(Cg,{}),!c&&Object(qe.jsx)(hg,{})]})})]})}),m&&c&&Object(qe.jsx)("div",{className:f.after,children:Object(qe.jsx)(Lm,{className:I()(Object(z.a)({},f.expanded,c)),children:Object(qe.jsx)(Nm,{width:o,children:Object(qe.jsx)(l,{it:i,timezone:b.timezone})})})})]})},By=function(e){var t=e.elements,n=void 0===t?[]:t,r=e.data,i=void 0===r?[]:r,o=e.Details,c=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,p=e.rowSize,b=Object(q.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","rowSize"]),f=Object(a.useState)(d),j=Object(l.a)(f,2),g=j[0],O=j[1];Object(a.useEffect)((function(){return O(d)}),[d]);var x=F.a(js.a,T.a(R.a("width")))(n),v=1200-x,y=x+(c?v:0),w=Ty({width:y}),C=function(e,t){t.id?(k.clear(t.id),O(t.id===g?null:t.id)):(k.clear(e),O(e===g?null:e))},k=new og.c({defaultHeight:58,fixedWidth:!0});function E(e){var t=e.index,a=e.key,r=e.parent,l=e.style;return Object(qe.jsx)(og.b,{cache:k,columnIndex:0,parent:r,rowIndex:t,children:function(e){var a=e.registerChild;return Object(qe.jsx)("div",{ref:a,style:l,children:Object(qe.jsx)(Ry,{width:y,size:p,id:i[t].id?i[t].id:t,index:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:i[t].id?i[t].id===g:t===g,expandRow:C,expandable:c,onClick:u,timezone:b.timezone})})}},a)}return Object(qe.jsx)(tl.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(qe.jsxs)(wm,{className:w.table,children:[Object(qe.jsxs)(Cm,{children:[n.map((function(e,t){var n=e.width,a=e.className,r=e.textAlign,i=e.header;return Object(qe.jsx)(Sm,{width:n,className:a,textAlign:r,children:i},t)})),c&&Object(qe.jsx)(Sm,{width:v})]}),Object(qe.jsxs)(Em,{className:w.body,children:[m&&Object(qe.jsx)(_e,{children:"Loading..."}),!m&&Wa.a(i)&&Object(qe.jsx)(Ns,{message:h}),!m&&!Wa.a(i)&&Object(qe.jsx)(og.a,{disableWidth:!0,children:function(e){var t=e.height;return Object(qe.jsx)(og.d,Object(s.a)(Object(s.a)({style:{outline:"none"}},b),{},{height:m?0:t,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:E,overscanRowCount:5,deferredMeasurementCache:k}))}})]})]})})},Ay=Object(f.a)(Fy),My=function(e){var t=e.data,n=e.selectedCoin,r=e.handleDeleteEntry,i=e.errorMessage,o=e.setErrorMessage,c=e.deleteDialog,s=e.setDeleteDialog,d=Ay(),u=Object(a.useState)(),m=Object(l.a)(u,2),h=m[0],p=m[1],b=[{name:"address",header:Object(qe.jsx)(at,{className:d.white,children:"Addresses"}),width:800,textAlign:"left",size:"sm",view:function(e){return Object(qe.jsx)("div",{className:d.addressRow,children:Object(qe.jsx)(If,{children:A.a(["address"],e)})})}},{name:"deleteButton",header:Object(qe.jsx)(at,{className:d.white,children:"Delete"}),width:130,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{className:d.deleteButton,onClick:function(){s(!0),p(e)},children:Object(qe.jsx)(vh,{})})}}],f=n?t[n.code]:t[Hc.a(t)[0]];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(By,{data:f,elements:b,emptyText:"No blacklisted addresses so far",name:"blacklistTable"}),Object(qe.jsx)(Km,{open:c,onDismissed:function(){s(!1),o(null)},onConfirmed:function(){o(null),r(A.a(["cryptoCode"],h),A.a(["address"],h))},errorMessage:i})]})},Wy=Object(f.a)(Fy),zy=Ly.a((function(e){return e.cryptoCode})),qy=x()(Ev||(Ev=Object(c.a)(["\n mutation DeleteBlacklistRow($cryptoCode: String!, $address: String!) {\n deleteBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),$y=x()(Nv||(Nv=Object(c.a)(["\n query getBlacklistData {\n blacklist {\n cryptoCode\n address\n }\n cryptoCurrencies {\n display\n code\n }\n }\n"]))),Hy=x()(Sv||(Sv=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Vy=x()(Iv||(Iv=Object(c.a)(["\n query getData {\n config\n }\n"]))),Uy=x()(Lv||(Lv=Object(c.a)(["\n mutation InsertBlacklistRow($cryptoCode: String!, $address: String!) {\n insertBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),Gy=function(e){var t=e.onConfirmed,n=e.onDissmised,a=e.open,r=e.props,i=Wy();return Object(qe.jsxs)(cn.a,Object(s.a)(Object(s.a)({open:a,"aria-labelledby":"form-dialog-title",PaperProps:{style:{borderRadius:8,minWidth:656,bottom:125,right:7}}},r),{},{children:[Object(qe.jsx)("div",{className:i.closeButton,children:Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:n,children:Object(qe.jsx)(qi,{})})}),Object(qe.jsx)(Ge,{className:i.dialogTitle,children:"Are you sure you want to enable this?"}),Object(qe.jsxs)(sn.a,{className:i.dialogContent,children:[Object(qe.jsx)(Je,{children:"This mode means that only paper wallets will be printed for users, and they won't be permitted to scan an address from their own wallet."}),Object(qe.jsx)(Je,{children:"This mode is only useful for countries like Switzerland which mandates such a feature.\n"}),Object(qe.jsx)(Ye,{children:"Don't enable this if you want users to be able to scan an address of their choosing."})]}),Object(qe.jsxs)(Xm.a,{className:i.dialogActions,children:[Object(qe.jsx)(An,{backgroundColor:"grey",className:i.cancelButton,onClick:function(){return n()},children:"Cancel"}),Object(qe.jsx)(An,{onClick:function(){return t(!0)},children:"Confirm"})]})]}))},Xy=function(){var e,t,n=Object(u.c)($y).data,r=Object(u.c)(Vy).data,i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)({code:"BTC",display:"Bitcoin"}),m=Object(l.a)(d,2),p=m[0],b=m[1],f=Object(a.useState)(null),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(!1),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(a.useState)(!1),k=Object(l.a)(C,2),E=k[0],N=k[1],S=Object(u.b)(qy,{onError:function(e){var t=e.message;O(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return w(!1)},refetchQueries:function(){return["getBlacklistData"]}}),I=Object(l.a)(S,1)[0],L=Object(u.b)(Uy,{onError:function(){return console.log("Error while adding row")},refetchQueries:function(){return["getBlacklistData"]}}),F=Object(l.a)(L,1)[0],P=Object(u.b)(Hy,{refetchQueries:function(){return["getData"]}}),T=Object(l.a)(P,1)[0],R=Wy(),B=null!==(e=A.a(["blacklist"])(n))&&void 0!==e?e:[],M=null!==(t=A.a(["cryptoCurrencies"],n))&&void 0!==t?t:[],z=zy(B),q=(null===r||void 0===r?void 0:r.config)&&ss("compliance")(r.config),$=!!(null===q||void 0===q?void 0:q.rejectAddressReuse),H=!!(null===q||void 0===q?void 0:q.enablePaperWalletOnly),V=function(e){var t=ds("compliance")(e);return T({variables:{config:t}})},U=function(e,t){try{return!D.a(Pf.utils.parseUrl(e,"main",t))}catch(n){return!1}},G=function(){var e=Object(Bl.a)(Rl.a.mark((function e(t,n){var a,r;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O(null),U(t,n)){e.next=4;break}return O("Invalid address"),e.abrupt("return");case 4:return e.next=6,F({variables:{cryptoCode:t,address:n}});case 6:if((a=e.sent).errors){e.next=9;break}return e.abrupt("return",s(!1));case 9:r=a.errors.some((function(e){return e.message.includes("duplicate")})),O(r?"This address is already being blocked":"Server error");case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Gy,{open:E,onConfirmed:function(e){V({enablePaperWalletOnly:e}),N(!1)},onDissmised:function(){N(!1)}}),Object(qe.jsx)(ll,{title:"Blacklisted addresses",children:Object(qe.jsx)(tl.a,{display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){return s(!0)},children:"Blacklist new addresses"})})}),Object(qe.jsxs)(h.a,{container:!0,className:R.grid,children:[Object(qe.jsx)(Si,{data:M,isSelected:W.a("code",p.code),displayName:function(e){return e.display},onClick:function(e){b({code:e.code,display:e.display})}}),Object(qe.jsxs)("div",{className:R.content,children:[Object(qe.jsxs)(tl.a,{display:"flex",justifyContent:"space-between",mb:3,children:[Object(qe.jsxs)(_e,{noMargin:!0,className:R.subtitle,children:[p.display?"".concat(p.display," blacklisted addresses"):""," "]}),Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"center",justifyContent:"end",mr:"-140px",children:[Object(qe.jsx)(Ke,{children:"Enable paper wallet (only)"}),Object(qe.jsx)(Lr,{checked:H,onChange:function(e){return H?V({enablePaperWalletOnly:e.target.checked}):N(!0)},value:H}),Object(qe.jsx)(rt,{children:H?"On":"Off"}),Object(qe.jsx)(Np,{width:304,children:Object(qe.jsx)(Ke,{children:'The "Enable paper wallet (only)" option means that only paper wallets will be printed for users, and they won\'t be permitted to scan an address from their own wallet.'})})]}),Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(qe.jsx)(Ke,{children:"Reject reused addresses"}),Object(qe.jsx)(Lr,{checked:$,onChange:function(e){V({rejectAddressReuse:e.target.checked})},value:$}),Object(qe.jsx)(rt,{children:$?"On":"Off"}),Object(qe.jsx)(Np,{width:304,children:Object(qe.jsx)(Ke,{children:'The "Reject reused addresses" option means that all addresses that are used once will be automatically rejected if there\'s an attempt to use them again on a new transaction.'})})]})]}),Object(qe.jsx)(My,{data:z,selectedCoin:p,handleDeleteEntry:function(e,t){I({variables:{cryptoCode:e,address:t}})},errorMessage:g,setErrorMessage:O,deleteDialog:y,setDeleteDialog:w})]})]}),c&&Object(qe.jsx)(Dy,{onClose:function(){O(null),s(!1)},errorMsg:g,selectedCoin:p,addToBlacklist:G})]})},_y={logo:{maxHeight:80,maxWidth:200},subtitle:{margin:0,marginBottom:42,textAlign:"center"},text:{margin:0},button:{margin:[[0,"auto"]]},modalContent:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,padding:[[0,34,107,34]]},innerContent:{paddingBottom:72},title:{color:Z,marginBottom:12,marginTop:30,textAlign:"center"},titleDecorator:{verticalAlign:"bottom",marginRight:12,width:24,height:26}},Zy=Object(f.a)(_y),Ky=function(e){var t=e.name,n=e.onContinue,a=Zy();return Object(qe.jsxs)("div",{className:a.modalContent,children:[Object(qe.jsxs)("div",{className:a.innerContent,children:[Object(qe.jsxs)(Ue,{className:a.title,children:[Object(qe.jsx)(Wc,{className:a.titleDecorator}),Object(qe.jsx)("span",{children:"Enable cash-out"})]}),Object(qe.jsx)(Ye,{className:a.subtitle,children:t}),Object(qe.jsxs)(Ke,{children:["You are about to activate cash-out functionality on your ",t," ","machine which will allow your customers to sell crypto to you."]}),Object(qe.jsx)(Ke,{children:"In order to activate cash-out for this machine, please enter the denominations for the machine."})]}),Object(qe.jsx)(An,{className:a.button,onClick:n,children:"Start configuration"})]})},Qy=n.p+"static/media/cashout-cassette-1.fac6c691.svg",Yy=n.p+"static/media/cashout-cassette-2.34a98cfa.svg",Jy={title:{margin:[[0,0,12,0]]},titleDiv:{paddingBottom:32},subtitle:{margin:[[32,0,21,0]]},edit:{margin:[[0,0,0,0]]},error:{color:he},bill:{width:131,display:"flex",alignItems:"center",justifyContent:"end"},billInput:{width:"100%"},suffix:{paddingLeft:16},submit:{alignSelf:"flex-end"},picker:{width:150},header:{display:"flex"},column:{display:"flex",flexGrow:2,flexDirection:"column",paddingBottom:32,justifyContent:"space-between"},step:{flex:1},stepImage:{position:"relative",top:-20,right:14},disclaimerIcon:{float:"left",margin:[[2,16,48,0]]}},ew=Object(f.a)(Jy),tw=function(e){var t=e.name,n=e.step,a=e.schema,r=e.error,i=e.isLastStep,o=e.onContinue,l=e.steps,c=e.fiatCurrency,s=e.options,d=e.numberOfCassettes,u=ew(),m=i?"Finish":"Next";return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:u.titleDiv,children:[Object(qe.jsx)(Ye,{className:u.title,children:t}),Object(qe.jsx)(bp,{steps:l.length+1,currentStep:n})]}),!i&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:o,initialValues:{cassette1:"",cassette2:"",cassette3:"",cassette4:""},enableReinitialize:!0,validationSchema:a,children:Object(qe.jsxs)(mn.d,{className:u.column,children:[Object(qe.jsxs)("div",{className:u.header,children:[l.map((function(e,t){var a=e.type,r=e.display,i=e.component;return 1+t===n&&Object(qe.jsxs)("div",{className:u.step,children:[Object(qe.jsxs)(_e,{className:u.edit,children:["Edit ",r]}),Object(qe.jsx)(at,{children:"Choose bill denomination"}),Object(qe.jsxs)("div",{className:u.bill,children:[Object(qe.jsx)(mn.b,{className:u.billInput,type:"text",size:"lg",autoFocus:1+t===n,component:(null===s||void 0===s?void 0:s.length)>0?i:oi,fullWidth:!0,decimalPlaces:0,name:a,options:s,valueProp:"code",labelProp:"display"}),Object(qe.jsx)(Qe,{noMargin:!0,className:u.suffix,children:c})]})]},t)})),Object(qe.jsx)("img",{className:u.stepImage,alt:"cassette",width:"148",height:"205",src:{2:{1:Qy,2:Yy},3:{1:Fp,2:Pp,3:Dp},4:{1:Tp,2:Rp,3:Bp,4:Ap}}[d][n]})]}),Object(qe.jsx)(An,{className:u.submit,type:"submit",children:m})]})}),i&&Object(qe.jsxs)("div",{className:u.column,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Ye,{className:u.title,children:"Cash Cassette Bill Count"}),Object(qe.jsxs)(Ke,{children:[Object(qe.jsx)(ir,{className:u.disclaimerIcon}),"When enabling cash-out, your bill count will be automatically set to zero. Make sure you physically put cash inside the cash cassettes to allow the machine to dispense it to your users. If you already did, make sure you set the correct cash cassette bill count for this machine on your Cash Boxes & Cassettes tab under Maintenance."]}),Object(qe.jsx)(Ye,{className:u.title,children:"Default Commissions"}),Object(qe.jsxs)(Ke,{children:[Object(qe.jsx)(ir,{className:u.disclaimerIcon}),"When enabling cash-out, default commissions will be set. To change commissions for this machine, please go to the Commissions tab under Settings where you can set exceptions for each of the available cryptocurrencies."]})]}),r&&Object(qe.jsx)(rl,{children:"Failed to save"}),Object(qe.jsx)(An,{className:u.submit,onClick:function(){return o()},children:m})]})]})},nw={2:{machine:300,cassette:225,zeroConf:200},3:{machine:210,cassette:180,zeroConf:200},4:{machine:200,cassette:150,zeroConf:150}},aw=xn.f().shape({cassette1:xn.e().label("Cassette 1").required().min(1).max(Jh),cassette2:xn.e().label("Cassette 2").required().min(1).max(Jh),cassette3:xn.e().label("Cassette 3").min(1).max(Jh).nullable().transform(Ur),cassette4:xn.e().label("Cassette 4").min(1).max(Jh).nullable().transform(Ur)}),rw=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,r=R.a("fiatCurrency")(n),i=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),e)).concat([0])),o=qg(n,zg),l=(null===o||void 0===o?void 0:o.length)>0?{options:o,labelProp:"display",valueProp:"code",className:a.autoComplete}:{decimalPlaces:0},c=[{name:"id",header:"Machine",width:null===(t=nw[i])||void 0===t?void 0:t.machine,view:function(t){return e.find((function(e){return e.deviceId===t})).name},size:"sm",editable:!1}];return im.a(om.a(lm.a,i),(function(t){var n;return c.push({name:"cassette".concat(t),header:"Cassette ".concat(t),size:"sm",stripe:!0,textAlign:"right",width:null===(n=nw[i])||void 0===n?void 0:n.cassette,suffix:r,bold:Va,view:function(e){return e},input:(null===o||void 0===o?void 0:o.length)>0?Br:oi,inputProps:l,doubleHeader:"Denominations",isHidden:function(n){return t>e.find((function(e){return e.deviceId===n.id})).numberOfCassettes}}),cm.a(1,t)}),1),c},iw=function(e){var t=e.machine,n=e.locale,r=e.onClose,i=e.save,o=e.error,c=t.numberOfCassettes+1,s=Object(a.useState)({step:0,config:{active:!0}}),d=Object(l.a)(s,2),u=d[0],m=u.step,h=u.config,p=d[1],b=qg(n,zg),f=m===c,j=function(){var e=Object(Bl.a)(Rl.a.mark((function e(n){var a;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!f){e.next=2;break}return e.abrupt("return",i(ds(t.deviceId,aw.cast(h,{assert:!1}))));case 2:a=Gn.a(h,n),p({step:m+1,config:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=T.a((function(e){return{type:"cassette".concat(e),display:"Cassette ".concat(e),component:Br,inputProps:{options:b,labelProp:"display",valueProp:"code"}}}),Ru.a(1,t.numberOfCassettes+1));return Object(qe.jsxs)(Yh,{title:0===m?null:"Enable cash-out",handleClose:r,width:554,height:520,open:!0,children:[0===m&&Object(qe.jsx)(Ky,{name:t.name,onContinue:function(){return j()}}),0!==m&&Object(qe.jsx)(tw,{step:m,name:t.name,numberOfCassettes:t.numberOfCassettes,error:o,isLastStep:f,steps:g,fiatCurrency:n.fiatCurrency,options:b,schema:xn.f().shape({cassette1:xn.e().required(),cassette2:t.numberOfCassettes>1&&m>=2?xn.e().required():xn.e().transform(Ur).nullable(),cassette3:t.numberOfCassettes>2&&m>=3?xn.e().required():xn.e().transform(Ur).nullable(),cassette4:t.numberOfCassettes>3&&m>=4?xn.e().required():xn.e().transform(Ur).nullable()}),onContinue:j})]})},ow=Object(f.a)({fudgeFactor:{display:"flex",alignItems:"center"},switchLabel:{margin:6,width:24},autoComplete:{width:"100%"}}),lw=x()(Fv||(Fv=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),cw=x()(Pv||(Pv=Object(c.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n }\n config\n }\n"]))),sw=function(e){var t,n,r=e.name,i=ow(),o=Object(a.useState)(!1),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(u.c)(cw),h=m.data,p=m.loading,b=Object(u.b)(lw,{onCompleted:function(){return d(!1)},refetchQueries:function(){return["getData"]}}),f=Object(l.a)(b,2),j=f[0],g=f[1].error,O=function(e,t){var n=ds(r)(e);return j({variables:{config:n,accounts:t}})},x=(null===h||void 0===h?void 0:h.config)&&ss(r)(h.config),v=null!==(t=null===x||void 0===x?void 0:x.fudgeFactorActive)&&void 0!==t&&t,y=(null===h||void 0===h?void 0:h.config)&&ss("locale")(h.config),w=null!==(n=null===h||void 0===h?void 0:h.machines)&&void 0!==n?n:[];return!p&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ll,{title:"Cash-out",children:Object(qe.jsxs)("div",{className:i.fudgeFactor,children:[Object(qe.jsx)(Ke,{children:"Transaction fudge factor"}),Object(qe.jsx)(Lr,{checked:v,onChange:function(e){O({fudgeFactorActive:e.target.checked})},value:v}),Object(qe.jsx)(rt,{className:i.switchLabel,children:v?"On":"Off"}),Object(qe.jsxs)(Np,{width:304,children:[Object(qe.jsx)(Ke,{children:"Automatically accept customer deposits as complete if their received amount is 100 crypto atoms or less."}),Object(qe.jsx)(Ke,{children:"(Crypto atoms are the smallest unit in each cryptocurrency. E.g., satoshis in Bitcoin, or wei in Ethereum.)"})]})]})}),Object(qe.jsx)(Zh,{namespaces:T.a(A.a(["deviceId"]))(w),data:x,stripeWhen:function(e){return 1===F.a(bn.a,Hc.a)(e)},enableEdit:!0,editWidth:134,enableToggle:!0,toggleWidth:109,onToggle:function(e){var t=ss(e)(x);if(!aw.isValidSync(t))return d(e);O(ds(e,{active:!(null===t||void 0===t?void 0:t.active)}))},save:O,error:null===g||void 0===g?void 0:g.message,validationSchema:aw,disableRowEdit:F.a(P.a,A.a(["active"])),elements:rw(w,y,i)}),Wa.a(w)&&Object(qe.jsx)(Ns,{message:"No machines so far"}),s&&Object(qe.jsx)(iw,{machine:Aa.a(W.a("deviceId",s))(w),onClose:function(){return d(!1)},save:O,error:null===g||void 0===g?void 0:g.message,locale:y})]})},dw=n(1094);function uw(){return(uw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hw=a.createElement("desc",null,"Created with Sketch."),pw=a.createElement("g",{id:"icon/sf-small/listing/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#FFFFFF",strokeWidth:2}));function bw(e,t){var n=e.title,r=e.titleId,i=mw(e,["title","titleId"]);return a.createElement("svg",uw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,hw,pw)}var fw=a.forwardRef(bw);n.p;function jw(){return(jw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function gw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ow=a.createElement("desc",null,"Created with Sketch."),xw=a.createElement("g",{id:"icon/sf-small/listing/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#1B2559",strokeWidth:2}));function vw(e,t){var n=e.title,r=e.titleId,i=gw(e,["title","titleId"]);return a.createElement("svg",jw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Ow,xw)}var yw=a.forwardRef(vw);n.p;function ww(){return(ww=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Cw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kw=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#44e188"});function Ew(e,t){var n=e.title,r=e.titleId,i=Cw(e,["title","titleId"]);return a.createElement("svg",ww({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,kw)}var Nw,Sw,Iw=a.forwardRef(Ew),Lw=(n.p,n(1091)),Fw=n(1136),Pw=Object(a.memo)((function(e){var t,n=e.config,r=e.locale,i=e.currency,o=e.data,c=e.error,s=e.save,d=e.saveOverrides,u=Object(a.useState)(!1),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1],O=n&&!Wa.a(n)?n:tO,x=null!==(t=null===O||void 0===O?void 0:O.overrides)&&void 0!==t?t:[],v=hm.a([Lw.a(aO),Lw.a(R.a("machine"))])(x);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{error:null===c||void 0===c?void 0:c.message,title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",enableEdit:!0,initialValues:O,save:s,validationSchema:Jg(r),data:Fw.a(O),elements:Kg(i),setEditing:function(e,t){return p(t)},forceDisable:j})}),Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{error:null===c||void 0===c?void 0:c.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,groupBy:aO,initialValues:nO,save:d,validationSchema:eO(v,o,r),data:v,elements:Qg(o,i),setEditing:function(e,t){return g(t)},forceDisable:h})})]})})),Dw=n(1092),Tw=n(1093),Rw=n(1116),Bw={code:"SHOW_ALL",display:"Show all"},Aw=[{code:"machine",display:"Machine Name"},{code:"cryptoCurrencies",display:"Cryptocurrency"},{code:"cashIn",display:"Cash-in"},{code:"cashOut",display:"Cash-out"},{code:"fixedFee",display:"Fixed Fee"},{code:"minimumTx",display:"Minimum Tx"}],Mw=Object(f.a)({headerLine:{display:"flex",justifyContent:"",marginBottom:24},select:{marginRight:24},tableWrapper:{flex:1,display:"block",overflowY:"auto",width:"100%",maxHeight:"70vh"}}),Ww=function(e,t){return{code:e,display:t||e}},zw=Object(a.memo)((function(e){var t,n=e.config,r=e.localeConfig,i=e.currency,o=e.data,c=e.error,s=e.saveOverrides,d=Mw(),u=Object(a.useState)(Bw),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(Bw),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(Aw[0]),x=Object(l.a)(O,2),v=x[0],y=x[1],w=null!==(t=R.a("cryptoCurrencies",r))&&void 0!==t?t:[],C=T.a(Ww)(w),k=Dw.a(R.a("display"),T.a((function(e){return Ww(R.a("deviceId",e),R.a("name",e))}))(R.a("machines",o))),E=Rw.a(T.a((function(e){var t,n=null===(t=R.a("overrides",r))||void 0===t?void 0:t.find(W.a("machine",e)),a=n?R.a("cryptoCurrencies",n):w;return Tw.a([e],a)}))(k.map(R.a("code")))),N=T.a((function(e){var t=Object(l.a)(e,2),a=t[0];return function(e,t,n){var a,r=null!==(a=R.a("overrides",n))&&void 0!==a?a:[];if(!r&&Wa.a(r))return rO(e,t,!0,n);var i=Aa.a((function(n){return n.machine===t&&Bg.includes(e)(n.cryptoCurrencies)}))(r);if(void 0!==i)return rO(e,t,!1,i);var o=Aa.a((function(e){return e.machine===t&&Bg.includes("ALL_COINS")(e.cryptoCurrencies)}))(r);if(void 0!==o)return rO(e,t,!1,o);var l=Aa.a((function(t){return"ALL_MACHINES"===t.machine&&Bg.includes(e)(t.cryptoCurrencies)}))(r);return void 0!==l?rO(e,t,!1,l):rO(e,t,!0,n)}(t[1],a,n)}))(E),S=F.a(function(e){switch(e){case Aw[0]:return Dw.a(Aa.a(W.a("code",R.a("machine"))));case Aw[1]:return Dw.a(A.a(["cryptoCurrencies",0]));default:return Dw.a(R.a(e.code))}}(v),function(e,t){return F.a(M.a((function(e){return t===Bw|t.code===e.machine})),M.a((function(t){return e===Bw|e.code===t.cryptoCurrencies[0]})))}(j,h))(N);return Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:d.headerLine,children:[Object(qe.jsx)(sh,{className:d.select,onSelectedItemChange:p,label:"Machines",default:Bw,items:[Bw].concat(k),selectedItem:h}),Object(qe.jsx)(sh,{className:d.select,onSelectedItemChange:g,label:"Cryptocurrency",default:Bw,items:[Bw].concat(C),selectedItem:j}),Object(qe.jsx)(sh,{onSelectedItemChange:y,label:"Sort by",default:Aw[0],items:Aw,selectedItem:v,defaultAsFilter:!0})]}),Object(qe.jsx)("div",{className:d.tableWrapper,children:Object(qe.jsx)(_h,{error:null===c||void 0===c?void 0:c.message,name:"comissionsList",enableEdit:!0,save:s,initialValues:nO,validationSchema:iO(r),data:S,elements:lO(o,i),orderedBy:v})})]})})),qw=Object(f.a)({listViewButton:{marginLeft:4}}),$w=x()(Nw||(Nw=Object(c.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),Hw=x()(Sw||(Sw=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Vw=function(e){var t,n=e.name,r=qw(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(null),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(u.c)($w),f=b.data,j=b.loading,g=Object(u.b)(Hw,{refetchQueries:function(){return["getData"]},onError:function(e){return p(e)}}),O=Object(l.a)(g,1)[0],x=(null===f||void 0===f?void 0:f.config)&&ss(n)(f.config),v=(null===f||void 0===f?void 0:f.config)&&ss(es)(f.config),y=R.a("fiatCurrency")(v),w=R.a("overrides")(x),C=c?[{label:"Override value",icon:Object(qe.jsx)(Iw,{})}]:[];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ll,{title:"Commissions",labels:C,buttons:[{text:"List view",icon:yw,inverseIcon:fw,toggle:s}],iconClassName:r.listViewButton}),!c&&!j&&Object(qe.jsx)(Pw,{config:x,locale:v,currency:y,data:f,error:h,save:function(e){var t=ds(n)(e.commissions[0]);return O({variables:{config:t}})},saveOverrides:function(e){var t=ds(n)(e);return p(null),O({variables:{config:t}})},classes:r}),c&&!j&&Object(qe.jsx)(zw,{config:x,localeConfig:v,currency:y,data:f,error:h,saveOverrides:(t=w,function(e,n){var a,r=A.a(["cryptoCurrencies",0],n),i=qa.a("machine",n),o=M.a(qr.a(i,(function(e){return!qa.a("cryptoCurrencies",n,e)}))),l=(a=r,function(e){return JO.a(e,{cryptoCurrencies:dw.a([a],e.cryptoCurrencies)})}),c=T.a(l)(o(t)).concat(M.a((function(e){return!i(e)}),t)),s={commissions_overrides:um.a(n,c)};return O({variables:{config:s}})})})]})},Uw=n(1097);function Gw(){return(Gw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Xw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _w=a.createElement("desc",null,"Created with Sketch."),Zw=a.createElement("g",{id:"icon/button/authorize/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",cx:6,cy:6,r:5}),a.createElement("polyline",{id:"Stroke-13",stroke:"#FFFFFF",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function Kw(e,t){var n=e.title,r=e.titleId,i=Xw(e,["title","titleId"]);return a.createElement("svg",Gw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,_w,Zw)}var Qw=a.forwardRef(Kw);n.p;function Yw(){return(Yw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Jw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var eC=a.createElement("desc",null,"Created with Sketch."),tC=a.createElement("g",{id:"icon/button/authorize/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-9",stroke:"#1B2559"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5})),a.createElement("polyline",{id:"Stroke-13",stroke:"#1B2559",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function nC(e,t){var n=e.title,r=e.titleId,i=Jw(e,["title","titleId"]);return a.createElement("svg",Yw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,eC,tC)}var aC=a.forwardRef(nC),rC=(n.p,{label1:{display:"flex",marginBottom:2,marginTop:"auto",width:85},label1Pending:{color:$},label1Rejected:{color:Q},label1Accepted:{color:U},cardActionButton:{display:"flex",height:28,marginRight:"auto",marginLeft:12},propertyCardTopRow:{display:"flex",margin:[[0,10,5,0]]},propertyCardBottomRow:{display:"flex",flexDirection:"row",height:45},propertyCard:{display:"flex",flexDirection:"column",borderRadius:8,width:"100%",height:100,padding:[[20]],boxSizing:"border-box",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.04)",border:"solid 0",backgroundColor:K,margin:[[20,0,0,0]]},rowSpaceBetween:{display:"flex",flexFlow:"row nowrap",alignItems:"center",justifyContent:"space-between"},columnSpaceBetween:{display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"space-between",width:90},buttonsWrapper:{display:"flex",flexDirection:"row",justifyContent:"flex-end",marginLeft:"auto",marginTop:"auto"}}),iC=(Object(f.a)(rC),"automatic"),oC="verified",lC="blocked";function cC(){return(cC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dC=a.createElement("desc",null,"Created with Sketch."),uC=a.createElement("g",{id:"icon/button/block/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#FFFFFF"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),a.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function mC(e,t){var n=e.title,r=e.titleId,i=sC(e,["title","titleId"]);return a.createElement("svg",cC({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,dC,uC)}var hC=a.forwardRef(mC);n.p;function pC(){return(pC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fC=a.createElement("desc",null,"Created with Sketch."),jC=a.createElement("g",{id:"icon/button/block/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#1B2559"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),a.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function gC(e,t){var n=e.title,r=e.titleId,i=bC(e,["title","titleId"]);return a.createElement("svg",pC({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,fC,jC)}var OC=a.forwardRef(gC);n.p;function xC(){return(xC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function vC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var yC=a.createElement("g",{id:"icon/button/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Data-icon---small",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("path",{d:"M11,2.44444444 L11,5.5 C11,6.85002939 8.53756612,7.94444444 5.5,7.94444444 C2.521994,7.94444444 0.0939612041,6.81341452 1.11160464e-12,5.5 L0.00282594991,2.44444444",id:"oval-3"}),a.createElement("path",{d:"M11,5.5 L11,8.55555556 C11,9.90558494 8.53756612,11 5.5,11 C2.521994,11 0.0939612041,9.86897007 1.11160464e-12,8.55555556 L0.00282594991,5.5",id:"oval-2"}),a.createElement("ellipse",{id:"oval-1",cx:5.5,cy:2.44444444,rx:5.5,ry:2.44444444})),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",fill:"#5F668A",cx:4,cy:4,r:3.5}),a.createElement("polygon",{id:"Path",fill:"#FFFFFF",fillRule:"nonzero",points:"4.33333333 3.66666667 6 3.66666667 6 4.33333333 4.33333333 4.33333333 4.33333333 6 3.66666667 6 3.66666667 4.33333333 2 4.33333333 2 3.66666667 3.66666667 3.66666667 3.66666667 2 4.33333333 2"})));function wC(e,t){var n=e.title,r=e.titleId,i=vC(e,["title","titleId"]);return a.createElement("svg",xC({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,yC)}var CC=a.forwardRef(wC);n.p;function kC(){return(kC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function EC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var NC=a.createElement("g",{id:"icon/button/data/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Data-icon---small",transform:"translate(1.500000, 0.500000)",stroke:"#1B2559"},a.createElement("path",{d:"M10,2 L10,4.77777778 C10,6.00507722 7.76142375,7 5,7 C2.29272181,7 0.0854192765,5.97179097 0,4.77777778 L0.00256904537,2",id:"oval-3"}),a.createElement("path",{d:"M10,5 L10,7.77777778 C10,9.00507722 7.76142375,10 5,10 C2.29272181,10 0.0854192765,8.97179097 0,7.77777778 L0.00256904537,5",id:"oval-2"}),a.createElement("ellipse",{id:"oval-1",cx:5,cy:2,rx:5,ry:2})),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:4,cy:4,r:3.5}),a.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"4.33333333 3.66666667 6 3.66666667 6 4.33333333 4.33333333 4.33333333 4.33333333 6 3.66666667 6 3.66666667 4.33333333 2 4.33333333 2 3.66666667 3.66666667 3.66666667 3.66666667 2 4.33333333 2"})));function SC(e,t){var n=e.title,r=e.titleId,i=EC(e,["title","titleId"]);return a.createElement("svg",kC({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,NC)}var IC=a.forwardRef(SC),LC=(n.p,n(1098));function FC(){return(FC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function PC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var DC=a.createElement("desc",null,"Created with Sketch."),TC=a.createElement("g",{id:"icon/sf-small/search/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M15.8635238,8.17028571 C15.8635238,12.4198095 12.4187619,15.8645714 8.1692381,15.8645714 C3.92066667,15.8645714 0.475904762,12.4198095 0.475904762,8.17028571 C0.475904762,3.9207619 3.92066667,0.476 8.1692381,0.476 C12.4187619,0.476 15.8635238,3.9207619 15.8635238,8.17028571 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:13.7035238,y1:13.7046667,x2:19.4844762,y2:19.485619,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}));function RC(e,t){var n=e.title,r=e.titleId,i=PC(e,["title","titleId"]);return a.createElement("svg",FC({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,DC,TC)}var BC=a.forwardRef(RC);n.p;function AC(){return(AC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function MC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var WC=a.createElement("g",{id:"icon/search/dark02",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},a.createElement("path",{d:"M14.2771714,7.35325714 C14.2771714,11.1778286 11.1768857,14.2781143 7.35231429,14.2781143 C3.5286,14.2781143 0.428314286,11.1778286 0.428314286,7.35325714 C0.428314286,3.52868571 3.5286,0.4284 7.35231429,0.4284 C11.1768857,0.4284 14.2771714,3.52868571 14.2771714,7.35325714 Z",id:"Stroke-1"}),a.createElement("line",{x1:12.3331714,y1:12.3342,x2:17.5360286,y2:17.5370571,id:"Stroke-3",strokeLinecap:"round"})));function zC(e,t){var n=e.title,r=e.titleId,i=MC(e,["title","titleId"]);return a.createElement("svg",AC({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/search/dark02"):n?a.createElement("title",{id:r},n):null,WC)}var qC=a.forwardRef(zC),$C=(n.p,Object(f.a)({row:{display:"flex",flexDirection:"row"},image:function(e){return{objectFit:"cover",borderRadius:"8px 0px 0px 8px",width:e.width,height:e.height}},popupImage:function(e){return{objectFit:"cover",width:e.popupWidth,height:e.popupHeight}},button:function(e){return{borderRadius:"0px 8px 8px 0px",height:e.height}},popoverContent:{display:"block",padding:[[10,15]]}})),HC=Object(a.memo)((function(e){var t=e.className,n=e.width,r=e.height,i=e.popupWidth,o=e.popupHeight,c=e.src,s=$C({width:n,height:r,popupWidth:i,popupHeight:o}),d=Object(a.useState)(null),u=Object(l.a)(d,2),m=u[0],h=u[1],p=Boolean(m),b=function(e){var t=e.className;return Object(qe.jsx)("img",{className:I()(t),src:c,alt:""})};return Object(qe.jsx)(E.a,{onClickAway:function(){h(null)},children:Object(qe.jsxs)("div",{className:I()(s.row,t),children:[Object(qe.jsx)(b,{className:s.image}),Object(qe.jsx)(Vn,{Icon:qC,InverseIcon:BC,className:s.button,onClick:function(e){h(m?null:e.currentTarget)}}),Object(qe.jsx)(Xn,{open:p,anchorEl:m,placement:"top",children:Object(qe.jsx)("div",{className:s.popoverContent,children:Object(qe.jsx)(b,{className:s.popupImage})})})]})})}));function VC(){return(VC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function UC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var GC=a.createElement("g",{id:"icon/ID/card/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polygon",{id:"Stroke-1",stroke:"#5F668A",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),a.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#5F668A",strokeWidth:1.6}),a.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#5F668A",strokeWidth:1.6}),a.createElement("polygon",{id:"Stroke-5",stroke:"#5F668A",strokeWidth:1.6,points:"4.14285714 12.2 9.64285714 12.2 9.64285714 5 4.14285714 5"}));function XC(e,t){var n=e.title,r=e.titleId,i=UC(e,["title","titleId"]);return a.createElement("svg",VC({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/comet"):n?a.createElement("title",{id:r},n):null,GC)}var _C=a.forwardRef(XC);n.p;function ZC(){return(ZC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function KC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var QC=a.createElement("g",{id:"icon/ID/phone/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#5F668A",strokeWidth:1.6}));function YC(e,t){var n=e.title,r=e.titleId,i=KC(e,["title","titleId"]);return a.createElement("svg",ZC({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/comet"):n?a.createElement("title",{id:r},n):null,QC)}var JC=a.forwardRef(YC);n.p;function ek(){return(ek=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function tk(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nk=a.createElement("desc",null,"Created with Sketch."),ak=a.createElement("g",{id:"icon/crossed-camera",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"crossed-camera"},a.createElement("g",{id:"Group-2"},a.createElement("g",{id:"icon/ID/cam/zodiac",transform:"translate(0.000000, 3.657143)",fill:"#1B2559",fillRule:"nonzero"},a.createElement("path",{d:"M16,19.1876029 C12.4482116,19.1876029 9.56809571,16.389776 9.56809571,12.9394673 C9.56809571,9.48915858 12.4482116,6.69133172 16,6.69133172 C19.5517884,6.69133172 22.4319043,9.48915858 22.4319043,12.9394673 C22.4319043,16.389776 19.5517884,19.1876029 16,19.1876029 Z M16,17.104891 C18.3677075,17.104891 20.2879362,15.239526 20.2879362,12.9394673 C20.2879362,10.6394086 18.3677075,8.77404358 16,8.77404358 C13.6322925,8.77404358 11.7120638,10.6394086 11.7120638,12.9394673 C11.7120638,15.239526 13.6322925,17.104891 16,17.104891 Z M22.7667469,3.30692494 L30.7397807,3.30692494 C31.3318211,3.30692494 31.8117647,3.77315587 31.8117647,4.34828087 L31.8117647,22.0513317 C31.8117647,22.6264567 31.3318211,23.0926877 30.7397807,23.0926877 L1.26021934,23.0926877 C0.6681789,23.0926877 0.188235294,22.6264567 0.188235294,22.0513317 L0.188235294,4.34828087 C0.188235294,3.77315587 0.6681789,3.30692494 1.26021934,3.30692494 L9.23325311,3.30692494 L12.0766705,0.494526627 C12.2782333,0.295162767 12.5538198,0.182857143 12.8414756,0.182857143 L19.1585244,0.182857143 C19.4461802,0.182857143 19.7217667,0.295162767 19.9233295,0.494526627 L22.7667469,3.30692494 Z M29.6677966,5.3896368 L22.3170489,5.3896368 C22.0293931,5.3896368 21.7538065,5.27733118 21.5522438,5.07796732 L18.7088264,2.26556901 L13.2911736,2.26556901 L10.4477562,5.07796732 C10.2461935,5.27733118 9.97060695,5.3896368 9.68295115,5.3896368 L2.33220339,5.3896368 L2.33220339,21.0099758 L29.6677966,21.0099758 L29.6677966,5.3896368 Z",id:"Stroke-1"})),a.createElement("line",{x1:32,y1:0,x2:0,y2:32,id:"Line",stroke:"#FF584A",strokeWidth:2,strokeLinecap:"square"}))));function rk(e,t){var n=e.title,r=e.titleId,i=tk(e,["title","titleId"]);return a.createElement("svg",ek({width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,nk,ak)}var ik=a.forwardRef(rk);n.p;function ok(){return(ok=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function lk(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ck=a.createElement("desc",null,"Created with Sketch."),sk=a.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#5f668a",strokeWidth:2}),a.createElement("polygon",{id:"Stroke-3",stroke:"#5f668a",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function dk(e,t){var n=e.title,r=e.titleId,i=lk(e,["title","titleId"]);return a.createElement("svg",ok({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,ck,sk)}var uk=a.forwardRef(dk);n.p;n.p;n.p;n.p;n.p;var mk={header:{display:"flex",flexDirection:"row",marginBottom:15},title:{marginTop:7,marginRight:24},editIcon:{marginTop:5},cardIcon:{marginTop:7},viewIcons:{marginRight:12},wrapper:{display:"block",overflow:"hidden",whiteSpace:"nowrap"},separator:{color:se,margin:[[8,0,8,150]],position:"relative",display:"inline-block","&:before, &:after":{content:'""',position:"absolute",background:se,top:"50%",width:1e3,height:1},"&:before":{right:"100%",marginRight:15},"&:after":{left:"100%",marginLeft:15}}},hk=n(1095),pk=n(1112),bk=n(572),fk=Object(f.a)({radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:he},specialLabel:{height:40,padding:0,width:250},label:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,141]]},picker:{width:150},field:{"& > *:last-child":{marginBottom:24}}}),jk="custom",gk="requirement",Ok=function(e,t,n){var a=ml.a(["frontCamera","idCardData","idCardPhoto","usSsn","sanctions"],T.a((function(e){return e.id}),n)),r=["frontCamera","idCardPhoto"],i=function(e){var n,a,r=gn.a(e,"frontCamera")?"facephoto":e,i=M.a((function(e){return gn.a(On.a(e.automation),ep)}),null!==(n=null===t||void 0===t?void 0:t.overrides)&&void 0!==n?n:[]);return!!Aa.a((function(e){return gn.a(e.requirement,r)}),i)||gn.a(On.a(null!==(a=t.automation)&&void 0!==a?a:""),ep)},o=T.a((function(t){if(i(t)){if(bk.a(t)){var n=Aa.a((function(e){return e.infoRequestId===t}),e.customInfoRequests);return!D.a(n)&&gn.a(n.override,"automatic")}var a=L.a(t,r)?e["".concat(t,"Path")]:e["".concat(t)];return!D.a(a)&&gn.a(e["".concat(t,"Override")],"automatic")}return!1}),a),l=T.a((function(t){if(i(t)){if(bk.a(t)){var n=Aa.a((function(e){return e.infoRequestId===t}),e.customInfoRequests);return!D.a(n)&&gn.a(n.override,"blocked")}var a=L.a(t,r)?e["".concat(t,"Path")]:e["".concat(t)];return!D.a(a)&&gn.a(e["".concat(t,"Override")],"blocked")}return!1}),a);return"blocked"===e.authorizedOverride?{label:"Blocked",type:"error"}:e.isSuspended?e.daysSuspended>0?{label:"".concat(e.daysSuspended," day suspension"),type:"warning"}:{label:"< 1 day suspension",type:"warning"}:jn.a((function(e){return!0===e}),l)?{label:"Rejected",type:"error"}:jn.a((function(e){return!0===e}),o)?{label:"Pending",type:"warning"}:{label:"Authorized",type:"success"}},xk=function(e,t){var n=e&&t?Object(pk.a)(e,t):null;return n?n.formatInternational():e},vk=function(e){var t,n,a=A.a(["idCardData"])(e);return"".concat(null!==(t=A.a(["firstName"])(a))&&void 0!==t?t:""," ").concat(null!==(n=A.a(["lastName"])(a))&&void 0!==n?n:"").trim()},yk=[{display:"Custom entry",code:"custom"},{display:"Populate existing requirement",code:"requirement"}],wk=[{display:"Text",code:"text"}],Ck=[{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"US SSN",code:"usSsn"},{display:"Customer camera",code:"frontCamera"}],kk=[{label:"Data entry title",name:"title"}],Ek=xn.c((function(e){return"custom"===e.entryType?xn.f().shape({entryType:xn.h().required(),dataType:xn.h().required()}):"requirement"===e.entryType?xn.f().shape({entryType:xn.h().required(),requirement:xn.h().required()}):void 0})),Nk=xn.f().shape({title:xn.h().required(),file:xn.d().required()}),Sk=xn.f().shape({title:xn.h().required(),image:xn.d().required()}),Ik=xn.f().shape({title:xn.h().required(),data:xn.h().required()}),Lk=function(e){var t,n=e.selectedValues,a=e.customInfoRequirementOptions,r=fk(),i=null===n||void 0===n?void 0:n.entryType,o=null===n||void 0===n?void 0:n.dataType,l=null===n||void 0===n?void 0:n.requirement,c="requirement"===i,s=l===jk,u=Wa.a(a)?Ck:(t=Ck,[{display:"Custom information requirement",code:"custom"}].concat(Object(d.a)(t))),m=c?Aa.a(W.a("code",l))(u).display:"",h=c?"Requirement ".concat(m):"Custom ".concat(o," entry"),p=c?Rk[l]:Fk[o],b=c?"idCardPhoto"===l||"frontCamera"===l:"file"===o||"image"===o;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{children:h})}),s&&Object(qe.jsx)(Br,{fullWidth:!0,label:"Available requests",className:r.picker,getOptionSelected:qa.a("code"),labelProp:"display",options:a,onChange:function(e,t){}}),Object(qe.jsx)("div",{className:r.field,children:!b&&!s&&p.options.map((function(e){var t=e.label,n=e.name;return Object(qe.jsx)(mn.b,{name:n,label:t,component:si,width:390})}))}),b&&Object(qe.jsx)(UN,{type:c?l:o})]})},Fk={text:{schema:Ik,options:[{label:"Data entry title",name:"title"},{label:"Data entry",name:"data"}],Component:Lk,initialValues:{data:"",title:""},saveType:"customEntry"},file:{schema:Nk,options:kk,Component:Lk,initialValues:{file:null,title:""},saveType:"customEntryUpload"},image:{schema:Sk,options:kk,Component:Lk,initialValues:{image:null,title:""},saveType:"customEntryUpload"}},Pk={schema:Ek,options:yk,Component:function(e){e.customInfoRequirementOptions;var t=fk(),n=Object(mn.f)().values,a=n.entryType===jk,r=n.entryType===gk;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{children:"Type of entry"})}),Object(qe.jsx)(mn.b,{component:li,name:"entryType",options:yk,labelClassName:t.specialLabel,radioClassName:t.radio,className:I()(t.radioGroup,t.specialGrid)}),a&&Object(qe.jsxs)("div",{children:[Object(qe.jsx)(tl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{children:"Type of data"})}),Object(qe.jsx)(mn.b,{component:li,name:"dataType",options:wk,labelClassName:t.label,radioClassName:t.radio,className:I()(t.radioGroup,t.specialGrid)})]}),r&&Object(qe.jsxs)("div",{children:[Object(qe.jsx)(tl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{children:"Requirements"})}),Object(qe.jsx)(mn.b,{component:li,name:"requirement",options:Ck,labelClassName:t.label,radioClassName:t.radio,className:I()(t.radioGroup,t.specialGrid)})]})]})},initialValues:{entryType:""}},Dk={idCardData:[{name:"firstName",label:"First name",component:si,editable:!0},{name:"documentNumber",label:"ID number",component:si,editable:!0},{name:"dateOfBirth",label:"Birthdate",component:si,editable:!0},{name:"gender",label:"Gender",component:si,editable:!0},{name:"lastName",label:"Last name",component:si,editable:!0},{name:"expirationDate",label:"Expiration Date",component:si,editable:!0},{name:"country",label:"Country",component:si,editable:!0}],usSsn:[{name:"usSsn",label:"US SSN",component:si,size:190,editable:!0}],idCardPhoto:[{name:"idCardPhoto"}],frontCamera:[{name:"frontCamera"}]},Tk={idCardData:xn.f().shape({firstName:xn.h().required(),lastName:xn.h().required(),documentNumber:xn.h().required(),dateOfBirth:xn.h().test({test:function(e){return Object(hk.a)(Object(Df.a)(new Date,"yyyy-MM-dd",e))}}).required(),gender:xn.h().required(),country:xn.h().required(),expirationDate:xn.h().test({test:function(e){return Object(hk.a)(Object(Df.a)(new Date,"yyyy-MM-dd",e))}}).required()}),usSsn:xn.f().shape({usSsn:xn.h().required()}),idCardPhoto:xn.f().shape({idCardPhoto:xn.d().required()}),frontCamera:xn.f().shape({frontCamera:xn.d().required()})},Rk={idCardData:{schema:Tk.idCardData,options:Dk.idCardData,Component:Lk,initialValues:{firstName:"",lastName:"",documentNumber:"",dateOfBirth:"",gender:"",country:"",expirationDate:""},saveType:"customerData"},usSsn:{schema:Tk.usSsn,options:Dk.usSsn,Component:Lk,initialValues:{usSsn:""},saveType:"customerData"},idCardPhoto:{schema:Tk.idCardPhoto,options:Dk.idCardPhoto,Component:Lk,initialValues:{idCardPhoto:null},saveType:"customerDataUpload"},frontCamera:{schema:Tk.frontCamera,options:Dk.frontCamera,Component:Lk,initialValues:{frontCamera:null},saveType:"customerDataUpload"},custom:{Component:Lk,initialValues:{customInfoRequirement:null},saveType:"customInfoRequirement"}},Bk=function(e){return T.a((function(t){return e[t]=Object(sd.a)("yyyyMMdd")(Object(Df.a)(new Date,"yyyy-MM-dd",e[t]))}))(["dateOfBirth","expirationDate"]),e},Ak=T.a((function(e){return dl.a("id")(e)?Object(s.a)(Object(s.a)({},e),{},{photoDir:"operator-data/customersphotos"}):Object(s.a)(Object(s.a)({},e),{},{photoDir:"front-camera-photo"})})),Mk=T.a(F.a(Uc.a,T.a((function(e){var t=Object(l.a)(e,2),n=t[0],a=t[1];return"txCustomerPhotoPath"===n||"frontCameraPath"===n?["path",a]:"txCustomerPhotoAt"===n||"frontCameraAt"===n?["date",a]:e})),Xc.a)),Wk=M.a((function(e){return!D.a(e.date)&&!D.a(e.path)})),zk=F.a(Wk,Ak,Mk),qk={stepper:{margin:[[16,0,14,0]]},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},button:{marginLeft:"auto"},form:{height:"100%",display:"flex",flexDirection:"column"},infoTitle:{margin:[[18,0,20,0]]},infoCurrentText:{color:$},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat($),display:"inline-block"},dropdownField:{marginTop:16,minWidth:155}},$k=Object(f.a)(qk),Hk=function(e){var t=e.onClose,n=e.save,r=e.error,i=e.customInfoRequirementOptions,o=e.addCustomerData,c=e.addPhoto,d=$k(),u=Object(a.useState)(null),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)({step:1}),f=Object(l.a)(b,2),j=f[0],g=j.step,O=j.config,x=f[1],v=function(e,t){return"idCardData"===(null===(n=t)||void 0===n?void 0:n.requirement)?Object(z.a)({},t.requirement,Bk(e)):e;var n},y=2===g,w=function(e,t){var n=(null===t||void 0===t?void 0:t.entryType)!==gk||D.a(null===t||void 0===t?void 0:t.requirement)?Fk[null===t||void 0===t?void 0:t.dataType]:Rk[null===t||void 0===t?void 0:t.requirement];switch(e){case 1:return Pk;case 2:return n;default:return a.Fragment}}(g,h),C=function(){var e=Object(Bl.a)(Rl.a.mark((function e(t){var a;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Gn.a(O,w.schema.cast(t)),p(a),!y){e.next=11;break}e.t0=w.saveType,e.next="customerData"===e.t0?6:"customerDataUpload"===e.t0?7:"customEntry"===e.t0?8:"customInfoRequirement"===e.t0?9:10;break;case 6:return e.abrupt("return",o(v(t,a)));case 7:return e.abrupt("return",c({newPhoto:Uj.a(gd.a(t)),photoType:Uj.a(Hc.a(t))}));case 8:return e.abrupt("return",n(a));case 9:return e.abrupt("return");case 10:return e.abrupt("break",11);case 11:x({step:g+1,config:a});case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)(Yh,{title:"Manual data entry",handleClose:t,width:520,height:520,open:!0,children:[Object(qe.jsx)(bp,{className:d.stepper,steps:2,currentStep:g}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:C,initialValues:w.initialValues,validationSchema:w.schema,children:Object(qe.jsxs)(mn.d,{className:d.form,children:[Object(qe.jsx)(w.Component,Object(s.a)({selectedValues:h,customInfoRequirementOptions:i},w.props)),Object(qe.jsxs)("div",{className:d.submit,children:[r&&Object(qe.jsx)(rl,{children:"Failed to save"}),Object(qe.jsx)(An,{className:d.button,type:"submit",children:y?"Add Data":"Next"})]})]})})]})})},Vk={titleWrapper:yf.titleWrapper,titleAndButtonsContainer:yf.titleAndButtonsContainer,row:{display:"flex",flexFlow:"row nowrap"},rowSpaceBetween:{display:"flex",flexFlow:"row nowrap",alignItems:"center",justifyContent:"space-between"},column:{display:"flex",flexFlow:"column nowrap",width:"100%",height:"100%",justifyContent:"space-between"},textInput:{width:144},p:{fontFamily:"MuseoSans",fontSize:we,fontWeight:500,fontStretch:"normal",fontStyle:"normal",lineHeight:1.14,letterSpacing:"normal",color:J},txId:{fontFamily:"MuseoSans",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},txClassIconLeft:{marginRight:11},txClassIconRight:{marginLeft:11},headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div:first-child":{marginRight:24},"& span":{extend:Me.label1,marginLeft:6}},photo:{width:92,height:92,borderRadius:8,backgroundColor:G,margin:[[0,28,0,0]],alignItems:"center",justifyContent:"center",display:"flex"},img:{width:80},customerName:{marginBottom:32},icon:{marginRight:11},name:{display:"flex",flexDirection:"row",alignItems:"center"},value:{height:16},label:{marginBottom:4,color:$},txSummaryValue:{height:16,marginRight:25},txSummaryLabel:{marginBottom:4,color:$,marginRight:25},idIcon:{marginRight:10},subpageButton:{marginLeft:16},txTableSpacing:{marginTop:40}},Uk=n(337),Gk=Object(f.a)({closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},title:{margin:[[0,16,8,20]]}}),Xk=Object(a.memo)((function(e){var t=e.title,n=void 0===t?"":t,a=e.open,r=e.onDissmised,i=(e.disabled,e.data),o=Object(q.a)(e,["title","open","onDissmised","disabled","data"]),l=Gk();return Object(qe.jsxs)(cn.a,Object(s.a)(Object(s.a)({PaperProps:{style:{borderRadius:8}},fullWidth:!0,open:a,"aria-labelledby":"form-dialog-title"},o),{},{children:[Object(qe.jsx)("div",{className:l.closeButton,children:Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:function(){r()},children:Object(qe.jsx)(qi,{})})}),Object(qe.jsx)(Ue,{className:l.title,children:n}),Object(qe.jsx)(sn.a,{className:l.dialogContent,children:i})]}))})),_k={photo:{width:135,height:135,borderRadius:8,backgroundColor:G,margin:[[0,28,0,0]],alignItems:"center",justifyContent:"center",display:"flex"},img:{objectFit:"cover",objectPosition:"center",width:135,height:135},container:{position:"relative","& > img":{display:"block"},"& > circle":{position:"absolute",top:"0",right:"0",marginRight:5,marginTop:5}},circle:{background:ae,borderRadius:"50%",width:25,height:25,alignItems:"center",justifyContent:"center",display:"flex"}},Zk=n(562),Kk=n.n(Zk);function Qk(){return(Qk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Yk(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Jk=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("polygon",{id:"Simple-Arrow-White",fill:"#1b2559",fillRule:"nonzero",points:"12.1912718 1.56064837 10.8306233 0.395663059 0.196798664 16.2200463 10.8250965 32.3956631 12.1967987 31.2473125 2.33241023 16.233075"}));function eE(e,t){var n=e.title,r=e.titleId,i=Yk(e,["title","titleId"]);return a.createElement("svg",Qk({width:"13px",height:"33px",viewBox:"0 0 13 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Jk)}var tE=a.forwardRef(eE);n.p;function nE(){return(nE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function aE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var rE=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2-Copy",transform:"translate(1.000000, 1.000000)",stroke:"#1b2559",strokeWidth:2},a.createElement("polyline",{id:"Path-4-Copy",points:"0 0 12 15.8202247 0 32"})));function iE(e,t){var n=e.title,r=e.titleId,i=aE(e,["title","titleId"]);return a.createElement("svg",nE({width:"15px",height:"34px",viewBox:"0 0 15 34",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,rE)}var oE=a.forwardRef(iE),lE=(n.p,Object(f.a)({imgWrapper:{alignItems:"center",justifyContent:"center",display:"flex"},imgInner:{objectFit:"cover",objectPosition:"center",width:500,marginBottom:40}})),cE=Object(a.memo)((function(e){var t=e.photosData,n=e.slidePhoto,a=lE();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(Kk.a,{PrevIcon:Object(qe.jsx)(tE,{}),NextIcon:Object(qe.jsx)(oE,{}),navButtonsProps:{style:{backgroundColor:"transparent",borderRadius:0,color:"transparent",opacity:1}},navButtonsWrapperProps:{style:{marginLeft:-22,marginRight:-22}},autoPlay:!1,indicators:!1,navButtonsAlwaysVisible:!0,next:function(e){return n(e)},prev:function(e){return n(e)},children:t.map((function(e,t){return Object(qe.jsx)("div",{children:Object(qe.jsx)("div",{className:a.imgWrapper,children:Object(qe.jsx)("img",{className:a.imgInner,src:"".concat(Aj,"/").concat(null===e||void 0===e?void 0:e.photoDir,"/").concat(null===e||void 0===e?void 0:e.path),alt:""})})})}))})})})),sE={label:{color:se,margin:[[0,0,6,0]]},firstRow:{padding:[[8]],display:"flex",flexDirection:"column"},secondRow:{extend:Me.p,display:"flex",padding:[[8]],"& > div":{display:"flex",flexDirection:"column","& > div":{height:37,marginBottom:15,marginRight:55}}}},dE=Object(f.a)(sE),uE=Object(a.memo)((function(e){var t,n,r=e.photosData,i=e.timezone,o=dE(),c=Object(a.useState)(0),s=Object(l.a)(c,2),d=s[0],u=s[1],m=function(e){var t=e.children,n=dE();return Object(qe.jsx)(at,{className:n.label,children:t})},h=!dl.a("id")(r[d]);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cE,{photosData:r,slidePhoto:function(e){return u(e)}}),!h&&Object(qe.jsxs)("div",{className:o.firstRow,children:[Object(qe.jsx)(m,{children:"Session ID"}),Object(qe.jsx)(If,{children:r&&(null===(t=r[d])||void 0===t?void 0:t.id)})]}),Object(qe.jsxs)("div",{className:o.secondRow,children:[Object(qe.jsx)("div",{children:Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(m,{children:"Date"}),Object(qe.jsx)("div",{children:r&&md(null===(n=r[d])||void 0===n?void 0:n.date,i,"yyyy-MM-dd HH:mm")})]})}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(m,{children:"Taken by"}),Object(qe.jsx)("div",{children:h?"Compliance scan":"Acceptance of T&C"})]})]})]})})),mE=Object(f.a)(_k),hE=Object(a.memo)((function(e){var t=e.photosData,n=e.timezone,r=mE(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=hm.a([function(e,t){return dl.a("id",e)-dl.a("id",t)},Uw.a(R.a("date"))],t),u=Uj.a(d);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(jm.a,{className:r.photo,elevation:0,children:Object(qe.jsx)(Uk.a,{disabled:!u,className:r.button,onClick:function(){s(!0)},children:u?Object(qe.jsxs)("div",{className:r.container,children:[Object(qe.jsx)("img",{className:r.img,src:"".concat(Aj,"/").concat(u.photoDir,"/").concat(u.path),alt:""}),Object(qe.jsx)("circle",{className:r.circle,children:Object(qe.jsx)("div",{children:Object(qe.jsx)(Ye,{children:d.length})})})]}):Object(qe.jsx)(ik,{})})}),Object(qe.jsx)(Xk,{open:c,title:"Photo roll",data:Object(qe.jsx)(uE,{photosData:d,timezone:n}),onDissmised:function(){s(!1)}})]})})),pE=Object(f.a)(Vk),bE=Object(a.memo)((function(e){var t=e.customer,n=e.photosData,a=e.locale,r=e.timezone,i=pE(),o=A.a(["idCardData","documentNumber"])(t),l=A.a(["usSsn"])(t),c=[{header:"Phone number",size:172,value:xk(t.phone,a.country)}];o&&c.push({header:"ID number",size:172,value:o}),l&&c.push({header:"US SSN",size:127,value:l});var s=vk(t);return Object(qe.jsxs)(tl.a,{display:"flex",children:[Object(qe.jsx)(hE,{photosData:n,timezone:r}),Object(qe.jsxs)(tl.a,{display:"flex",flexDirection:"column",children:[Object(qe.jsxs)("div",{className:i.name,children:[Object(qe.jsx)(_f,{className:i.idIcon}),Object(qe.jsx)(Ge,{noMargin:!0,children:s.length?s:xk(A.a(["phone"])(t),a.country)})]}),Object(qe.jsx)(tl.a,{display:"flex",mt:"auto",children:c.map((function(e,t){var n=e.size,a=e.header;return Object(qe.jsx)(at,{noMargin:!0,className:i.label,style:{width:n},children:a},t)}))}),Object(qe.jsx)(tl.a,{display:"flex",children:c.map((function(e,t){var n=e.size,a=e.value;return Object(qe.jsx)(Ke,{noMargin:!0,className:i.value,style:{width:n},children:a},t)}))})]})]})}));function fE(){return(fE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gE=a.createElement("g",{id:"icon/customer-nav/data/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,5 L19,10 C19,12.209139 14.9705627,14 10,14 C5.12689927,14 1.1537547,12.1492238 1,10 L1.00462428,5",id:"Path-Copy-3",stroke:"#5F668A",strokeWidth:2}),a.createElement("path",{d:"M19,10 L19,15 C19,17.209139 14.9705627,19 10,19 C5.12689927,19 1.1537547,17.1492238 1,15 L1.00462428,10",id:"Path-Copy-3",stroke:"#5F668A",strokeWidth:2}),a.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#5F668A",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function OE(e,t){var n=e.title,r=e.titleId,i=jE(e,["title","titleId"]);return a.createElement("svg",fE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,gE)}var xE=a.forwardRef(OE);n.p;function vE(){return(vE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function yE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var wE=a.createElement("g",{id:"icon/customer-nav/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,5 L19,10 C19,12.209139 14.9705627,14 10,14 C5.12689927,14 1.1537547,12.1492238 1,10 L1.00462428,5",id:"Path-Copy-3",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("path",{d:"M19,10 L19,15 C19,17.209139 14.9705627,19 10,19 C5.12689927,19 1.1537547,17.1492238 1,15 L1.00462428,10",id:"Path-Copy-3",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#FFFFFF",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function CE(e,t){var n=e.title,r=e.titleId,i=yE(e,["title","titleId"]);return a.createElement("svg",vE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,wE)}var kE=a.forwardRef(CE);n.p;function EE(){return(EE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function NE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var SE=a.createElement("g",{id:"icon/customer-nav/note/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M18,1 C18.2761424,1 18.5261424,1.11192881 18.7071068,1.29289322 C18.8880712,1.47385763 19,1.72385763 19,2 L19,2 L19,18 C19,18.2761424 18.8880712,18.5261424 18.7071068,18.7071068 C18.5261424,18.8880712 18.2761424,19 18,19 L18,19 L2,19 C1.72385763,19 1.47385763,18.8880712 1.29289322,18.7071068 C1.11192881,18.5261424 1,18.2761424 1,18 L1,18 L1,2 C1,1.72385763 1.11192881,1.47385763 1.29289322,1.29289322 C1.47385763,1.11192881 1.72385763,1 2,1 L2,1 Z",id:"Rectangle",stroke:"#5F668A",strokeWidth:2}),a.createElement("line",{x1:5,y1:5,x2:15,y2:5,id:"Line-4",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:13,x2:10,y2:13,id:"Line-4-Copy",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:9,x2:15,y2:9,id:"Line-4",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}));function IE(e,t){var n=e.title,r=e.titleId,i=NE(e,["title","titleId"]);return a.createElement("svg",EE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,SE)}var LE=a.forwardRef(IE);n.p;function FE(){return(FE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function PE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var DE=a.createElement("g",{id:"icon/customer-nav/note/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M18,1 C18.2761424,1 18.5261424,1.11192881 18.7071068,1.29289322 C18.8880712,1.47385763 19,1.72385763 19,2 L19,2 L19,18 C19,18.2761424 18.8880712,18.5261424 18.7071068,18.7071068 C18.5261424,18.8880712 18.2761424,19 18,19 L18,19 L2,19 C1.72385763,19 1.47385763,18.8880712 1.29289322,18.7071068 C1.11192881,18.5261424 1,18.2761424 1,18 L1,18 L1,2 C1,1.72385763 1.11192881,1.47385763 1.29289322,1.29289322 C1.47385763,1.11192881 1.72385763,1 2,1 L2,1 Z",id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:5,y1:5,x2:15,y2:5,id:"Line-4",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:13,x2:10,y2:13,id:"Line-4-Copy",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:9,x2:15,y2:9,id:"Line-4",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}));function TE(e,t){var n=e.title,r=e.titleId,i=PE(e,["title","titleId"]);return a.createElement("svg",FE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,DE)}var RE=a.forwardRef(TE);n.p;function BE(){return(BE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function AE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ME=a.createElement("g",{id:"icon/customer-nav/overview/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#5F668A",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy",stroke:"#5F668A",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#5F668A",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function WE(e,t){var n=e.title,r=e.titleId,i=AE(e,["title","titleId"]);return a.createElement("svg",BE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,ME)}var zE=a.forwardRef(WE);n.p;function qE(){return(qE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $E(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var HE=a.createElement("g",{id:"icon/customer-nav/overview/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#FFFFFF",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy",stroke:"#FFFFFF",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#FFFFFF",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function VE(e,t){var n=e.title,r=e.titleId,i=$E(e,["title","titleId"]);return a.createElement("svg",qE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,HE)}var UE=a.forwardRef(VE);n.p;function GE(){return(GE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function XE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _E=a.createElement("g",{id:"icon/customer-nav/photos/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:18,height:18,rx:1}),a.createElement("circle",{id:"Oval",stroke:"#5F668A",strokeWidth:2,cx:15,cy:5,r:1}),a.createElement("polyline",{id:"Path",stroke:"#5F668A",strokeWidth:2,strokeLinejoin:"round",points:"1 19 7 13 13 19"}),a.createElement("path",{d:"M13.3333333,14 L18,19 L13.3333333,19 L11,16.5 L13.3333333,14 Z",id:"Combined-Shape",stroke:"#5F668A",strokeWidth:2,strokeLinejoin:"round"}));function ZE(e,t){var n=e.title,r=e.titleId,i=XE(e,["title","titleId"]);return a.createElement("svg",GE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/customer-nav/photos/comet"):n?a.createElement("title",{id:r},n):null,_E)}var KE=a.forwardRef(ZE);n.p;function QE(){return(QE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function YE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var JE=a.createElement("g",{id:"icon/customer-nav/photos/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:18,height:18,rx:1}),a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",strokeWidth:2,cx:15,cy:5,r:1}),a.createElement("polyline",{id:"Path",stroke:"#FFFFFF",strokeWidth:2,strokeLinejoin:"round",points:"1 19 7 13 13 19"}),a.createElement("path",{d:"M13.3333333,14 L18,19 L13.3333333,19 L11,16.5 L13.3333333,14 Z",id:"Combined-Shape",stroke:"#FFFFFF",strokeWidth:2,strokeLinejoin:"round"}));function eN(e,t){var n=e.title,r=e.titleId,i=YE(e,["title","titleId"]);return a.createElement("svg",QE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/customer-nav/photos/white"):n?a.createElement("title",{id:r},n):null,JE)}var tN=a.forwardRef(eN),nN=(n.p,{sidebar:{display:"flex",backgroundColor:"#ebefff",width:219,flexDirection:"column",borderRadius:5},link:{alignItems:"center",display:"flex",extend:Me.p,position:"relative",color:de,padding:15,cursor:"pointer"},activeLink:{display:"flex",alignItems:"center",extend:Me.tl2,color:K,backgroundColor:de,"&:first-child":{borderRadius:[[5,5,0,0]]},"&:last-child":{borderRadius:[[0,0,5,5]]}},icon:{marginRight:15}}),aN=Object(f.a)(nN),rN=function(e){var t=e.isSelected,n=e.onClick,a=aN(),r=[{code:"overview",display:"Overview",Icon:UE,InverseIcon:zE},{code:"customerData",display:"Customer Data",Icon:kE,InverseIcon:xE},{code:"notes",display:"Notes",Icon:RE,InverseIcon:LE},{code:"photos",display:"Photos & files",Icon:tN,InverseIcon:KE}];return Object(qe.jsx)("div",{className:a.sidebar,children:null===r||void 0===r?void 0:r.map((function(e){var r,i=e.Icon,o=e.InverseIcon,l=e.display,c=e.code;return Object(qe.jsxs)("div",{className:I()((r={},Object(z.a)(r,a.activeLink,t(c)),Object(z.a)(r,a.link,!0),r)),onClick:function(){return n(c)},children:[Object(qe.jsx)("div",{className:a.icon,children:t(c)?Object(qe.jsx)(i,{}):Object(qe.jsx)(o,{})}),l]})}))})};n.p;function iN(){return(iN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function oN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lN=a.createElement("desc",null,"Created with Sketch."),cN=a.createElement("g",{id:"icon/action/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function sN(e,t){var n=e.title,r=e.titleId,i=oN(e,["title","titleId"]);return a.createElement("svg",iN({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,lN,cN)}var dN=a.forwardRef(sN);n.p;function uN(){return(uN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hN=a.createElement("g",{id:"icon/button/replace/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-2"},a.createElement("path",{d:"M3.27636475,10.2264084 C2.67216087,9.96069246 2.10487152,9.58126145 1.60869691,9.087544 C-0.521488181,6.9675304 -0.538316861,3.54693703 1.57123953,1.44692357 C1.86137314,1.15837428 2.17625375,0.909794042 2.50930653,0.701182852",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.0943493 1.69429658 3.08837783 0.545717786 1.99994228 0"})),a.createElement("g",{id:"Group-2",transform:"translate(8.999987, 5.500035) scale(-1, -1) translate(-8.999987, -5.500035) translate(6.999974, 0.000000)"},a.createElement("path",{d:"M3.27636475,10.2264084 C2.67216087,9.96069246 2.10487152,9.58126145 1.60869691,9.087544 C-0.521488181,6.9675304 -0.538316861,3.54693703 1.57123953,1.44692357 C1.86137314,1.15837428 2.17625375,0.909794042 2.50930653,0.701182852",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.0943493 1.69429658 3.08837783 0.545717786 1.99994228 3.80623901e-14"}))));function pN(e,t){var n=e.title,r=e.titleId,i=mN(e,["title","titleId"]);return a.createElement("svg",uN({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,hN)}var bN=a.forwardRef(pN);n.p;function fN(){return(fN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gN=a.createElement("desc",null,"Created with Sketch."),ON=a.createElement("defs",null,a.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),xN=a.createElement("g",{id:"icon/sf-small/save/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group"},a.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",points:"20.5 20.5 0.5 20.5 0.5 0.5 16.75 0.5 20.5 4.25"}),a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("g",{id:"Clip-4"}),a.createElement("polygon",{id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",mask:"url(#mask-2)",points:"4.25 7.5 16.75 7.5 16.75 0.5 4.25 0.5"}),a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",strokeWidth:2,mask:"url(#mask-2)",cx:11,cy:14,r:3})));function vN(e,t){var n=e.title,r=e.titleId,i=jN(e,["title","titleId"]);return a.createElement("svg",fN({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,gN,ON,xN)}var yN=a.forwardRef(vN),wN=(n.p,{label1:{display:"flex",width:85,justifyContent:"right"},label1Pending:{color:$},label1Rejected:{color:Q},label1Accepted:{color:U},editButton:{marginTop:20,display:"flex",justifyContent:"right"},deleteButton:{marginRight:8},headerWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",height:40},editingWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginTop:20},replace:{marginRight:5},input:{display:"none"},button:{marginRight:5},editingButtons:{display:"flex",justifyContent:"right"},card:{borderRadius:10,marginRight:15,marginBottom:15},cardHeader:{display:"flex",flexDirection:"row",marginBottom:15},editIcon:{marginTop:5},cardIcon:{marginTop:7},cardTitle:{margin:[[8,15,15,15]]}}),CN=Object(f.a)(wN),kN={field:{position:"relative",width:280,height:48,padding:[[0,4,4,0]],marginTop:2},label:{color:$,margin:[[0,0,0,0]]},notEditing:{display:"flex",flexDirection:"column","& > p:first-child":{height:16,lineHeight:"16px",transformOrigin:"left",paddingLeft:0,margin:[[3,0,3,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",margin:0}},editing:{"& > div":{"& > input":{padding:0,fontSize:14}}},readOnlyLabel:{color:$,margin:[[3,0,3,0]]},readOnlyValue:{margin:0}},EN=Object(f.a)(kN),NN=function(e){var t,n=e.editing,a=e.field,r=e.value,i=e.size,o=Object(q.a)(e,["editing","field","value","size"]),l=EN(),c=(t={},Object(z.a)(t,l.field,!0),Object(z.a)(t,l.notEditing,!n),t);return Object(qe.jsxs)("div",{className:I()(c),children:[!n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(at,{className:l.label,children:a.label}),Object(qe.jsx)(Ke,{children:r})]}),n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(at,{className:l.label,children:a.label}),Object(qe.jsx)(mn.b,Object(s.a)({className:l.editing,id:a.name,name:a.name,component:a.component,type:a.type,width:i},o))]})]})},SN=function(e){var t,n=e.field,a=e.value,r=(Object(q.a)(e,["field","value"]),EN()),i=(t={},Object(z.a)(t,r.field,!0),Object(z.a)(t,r.notEditing,!0),t);return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:I()(i),children:[Object(qe.jsx)(at,{className:r.readOnlyLabel,children:n.label}),Object(qe.jsx)(Ke,{className:r.readOnlyValue,children:a})]})})},IN=function(e){var t,n=e.fields,r=e.save,i=e.authorize,o=e.hasImage,c=e.reject,s=e.state,d=e.title,u=e.titleIcon,m=e.children,p=e.validationSchema,b=e.initialValues,f=(e.deleteEditedData,e.retrieveAdditionalData),j=e.hasAdditionalData,g=void 0===j||j,O=e.editable,x=CN(),v=Object(a.useState)(!1),y=Object(l.a)(v,2),w=y[0],C=y[1],k=Object(a.useState)(null),E=Object(l.a)(k,2),N=E[0],S=E[1],L=Object(a.useState)(null),F=Object(l.a)(L,2),P=F[0],D=F[1],T=(t={},Object(z.a)(t,x.label1,!0),Object(z.a)(t,x.label1Pending,s===iC),Object(z.a)(t,x.label1Rejected,s===lC),Object(z.a)(t,x.label1Accepted,s===oC),t),R=s===iC?{label:"Pending",type:"neutral"}:s===lC?{label:"Rejected",type:"error"}:{label:"Accepted",type:"success"};return Object(qe.jsx)("div",{children:Object(qe.jsx)(jm.a,{className:x.card,children:Object(qe.jsxs)(gm.a,{children:[Object(qe.jsxs)("div",{className:x.headerWrapper,children:[Object(qe.jsxs)("div",{className:x.cardHeader,children:[u,Object(qe.jsx)(Xe,{className:x.cardTitle,children:d})]}),s&&i&&Object(qe.jsx)("div",{className:I()(T),children:Object(qe.jsx)(zu,{statuses:[R]})})]}),m,Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,validationSchema:p,initialValues:b,onSubmit:function(e){r(e),C(!1)},onReset:function(){C(!1),D(!1)},children:function(e){var t=e.setFieldValue;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(fm,{}),Object(qe.jsx)("div",{className:x.row,children:Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:!o&&(null===n||void 0===n?void 0:n.map((function(e,t){return t>=0&&t<4?e.editable?Object(qe.jsx)(NN,{field:e,value:b[e.name],editing:w,size:180}):Object(qe.jsx)(SN,{field:e,value:b[e.name]}):null})))}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:!o&&(null===n||void 0===n?void 0:n.map((function(e,t){return t>=4?e.editable?Object(qe.jsx)(NN,{field:e,value:b[e.name],editing:w,size:180}):Object(qe.jsx)(SN,{field:e,value:b[e.name]}):null})))})]})}),Object(qe.jsxs)("div",{className:x.edit,children:[!w&&Object(qe.jsxs)("div",{className:x.editButton,children:[Object(qe.jsxs)("div",{className:x.deleteButton,children:[!1,!g&&Object(qe.jsx)(He,{color:"primary",type:"button",Icon:IC,InverseIcon:CC,onClick:function(){return f()},children:"Retrieve API data"})]}),O&&Object(qe.jsx)(He,{color:"primary",Icon:Dh,InverseIcon:dN,onClick:function(){return C(!0)},children:"Edit"}),!O&&i&&"Accepted"!==R.label&&Object(qe.jsx)("div",{className:x.button,children:Object(qe.jsx)(He,{color:"spring",type:"button",Icon:Qw,InverseIcon:Qw,onClick:function(){return i()},children:"Authorize"})}),!O&&i&&"Rejected"!==R.label&&Object(qe.jsx)(He,{color:"tomato",type:"button",Icon:hC,InverseIcon:hC,onClick:function(){return c()},children:"Reject"})]}),w&&Object(qe.jsxs)("div",{className:x.editingWrapper,children:[Object(qe.jsx)("div",{className:x.replace,children:o&&Object(qe.jsx)(He,{color:"secondary",type:"button",Icon:bN,InverseIcon:bN,onClick:function(){return N.click()},children:Object(qe.jsxs)("div",{children:[Object(qe.jsx)("input",{type:"file",alt:"",accept:"image/*",className:x.input,ref:function(e){return S(e)},onChange:function(e){var a=Uj.a(e.target.files);a&&t(Uj.a(n).name,a)}}),"Replace"]})})}),Object(qe.jsxs)("div",{className:x.editingButtons,children:[n&&Object(qe.jsx)("div",{className:x.button,children:Object(qe.jsx)(He,{color:"secondary",Icon:yN,InverseIcon:yN,type:"submit",children:"Save"})}),Object(qe.jsx)("div",{className:x.button,children:Object(qe.jsx)(He,{color:"secondary",Icon:ba,InverseIcon:ba,type:"reset",children:"Cancel"})}),i&&"Accepted"!==R.label&&Object(qe.jsx)("div",{className:x.button,children:Object(qe.jsx)(He,{color:"spring",type:"button",Icon:Qw,InverseIcon:Qw,onClick:function(){return i()},children:"Authorize"})}),i&&"Rejected"!==R.label&&Object(qe.jsx)(He,{color:"tomato",type:"button",Icon:hC,InverseIcon:hC,onClick:function(){return c()},children:"Reject"}),P&&Object(qe.jsx)(rl,{children:"Failed to save changes"})]})]})]})]})}})]})})})},LN=(Object(f.a)({field:{height:46},label:{color:$,margin:[[0,3]]},value:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",margin:0,paddingLeft:4}}),function(e,t){return D.a(e)?"":t}),FN=Object(f.a)(Vk),PN=function(e){var t,n,a=e.customer,r=e.data,i=e.loading,o=e.locale,l=FN(),c="cashOut"===a.lastTxClass?Wc:Pc,s=!(Wa.a(r)||D.a(r)),d=o.timezone,u=(t={},Object(z.a)(t,l.titleAndButtonsContainer,i||!i&&!s),Object(z.a)(t,l.txTableSpacing,!i&&s),t),m=[{header:"Transactions",size:127,value:LN(a.totalTxs,"".concat(Number.parseInt(a.totalTxs)))},{header:"Transaction volume",size:167,value:LN(a.totalSpent,"".concat(Number.parseFloat(a.totalSpent)," ").concat(a.lastTxFiatCode))},{header:"Last active",size:142,value:!D.a(d)&&(null!==(n=a.lastActive&&md(a.lastActive,d,"yyyy-MM-dd"))&&void 0!==n?n:"")},{header:"Last transaction",size:198,value:LN(a.lastTxFiat,Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(c,{className:l.icon}),"".concat(Number.parseFloat(a.lastTxFiat)," \n ").concat(a.lastTxFiatCode)]}))}],h=[{width:40,view:function(e){return Object(qe.jsx)(qe.Fragment,{children:"cashOut"===e.txClass?Object(qe.jsx)(Wc,{className:l.txClassIconLeft}):Object(qe.jsx)(Pc,{className:l.txClassIconLeft})})}},{header:"Machine",width:160,view:A.a(["machineName"])},{header:"Transaction ID",width:145,view:function(e){return Object(qe.jsx)(If,{className:l.txId,children:e.id})}},{header:"Cash",width:155,textAlign:"right",view:function(e){return Object(qe.jsxs)(qe.Fragment,{children:["".concat(Number.parseFloat(e.fiat)," "),Object(qe.jsx)(rt,{inline:!0,children:e.fiatCode})]})}},{header:"Crypto",width:145,textAlign:"right",view:function(e){return Object(qe.jsxs)(qe.Fragment,{children:["".concat(Pf.utils.toUnit(new $c.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," "),Object(qe.jsx)(rt,{inline:!0,children:e.cryptoCode})]})}},{header:"Date",width:100,view:function(e){return md(e.created,d,"yyyy\u2011MM\u2011dd")}},{header:"Time (h:m:s)",width:130,view:function(e){return md(e.created,d,"HH:mm:ss")}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Xe,{children:"Transactions"}),Object(qe.jsxs)(tl.a,{display:"flex",flexDirection:"column",children:[Object(qe.jsx)(tl.a,{display:"flex",mt:"auto",children:m.map((function(e,t){var n=e.size,a=e.header;return Object(qe.jsx)(at,{noMargin:!0,className:l.txSummaryLabel,style:{width:n},children:a},t)}))}),Object(qe.jsx)(tl.a,{display:"flex",children:m.map((function(e,t){var n=e.size,a=e.value;return Object(qe.jsx)(Ke,{noMargin:!0,className:l.txSummaryValue,style:{width:n},children:a},t)}))})]}),Object(qe.jsx)("div",{className:l.titleWrapper,children:Object(qe.jsx)("div",{className:I()(u),children:i?Object(qe.jsx)(_e,{children:"Loading"}):s?"":Object(qe.jsx)(_e,{children:"No transactions so far"})})}),s&&Object(qe.jsx)(By,{elements:h,data:r})]})},DN=n(566);function TN(){return(TN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function RN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var BN=a.createElement("g",{id:"icon/button/photo/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2"},a.createElement("g",{id:"Group",transform:"translate(11.666667, 8.333333) scale(-1, 1) translate(-11.666667, -8.333333) translate(3.333333, 0.000000)",stroke:"#1B2559"},a.createElement("rect",{id:"Rectangle-Copy",x:.5,y:.5,width:15.6666667,height:15.6666667,rx:1}),a.createElement("circle",{id:"Oval-Copy",fill:"#1B2559",cx:12.5,cy:4.16666667,r:1}),a.createElement("g",{id:"Group-14",transform:"translate(0.775621, 9.722222)",strokeLinejoin:"round"},a.createElement("polyline",{id:"Path-Copy-2",points:"0 4.58204149 5.10673153 0 11.6154223 6.31150113"}),a.createElement("polyline",{id:"Path",points:"9.02830015 3.23981481 11.3158819 0.925925926 15.0663146 4.81868037"}))),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 6.666667)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.66666667,cy:6.66666667,r:6.16666667}),a.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"7.22222222 6.11111111 10 6.11111111 10 7.22222222 7.22222222 7.22222222 7.22222222 10 6.11111111 10 6.11111111 7.22222222 3.33333333 7.22222222 3.33333333 6.11111111 6.11111111 6.11111111 6.11111111 3.33333333 7.22222222 3.33333333"}))));function AN(e,t){var n=e.title,r=e.titleId,i=RN(e,["title","titleId"]);return a.createElement("svg",TN({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,BN)}var MN=a.forwardRef(AN);n.p;function WN(){return(WN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function zN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var qN=a.createElement("g",{id:"icon/button/upload-file/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Add-File-Icon",transform:"translate(0.000000, 0.500000)"},a.createElement("g",{id:"file-icon",transform:"translate(5.934783, 0.000000)",stroke:"#1B2559"},a.createElement("g",{id:"lines",transform:"translate(3.130435, 7.826087)",strokeLinecap:"round"},a.createElement("line",{x1:0,y1:7.04347826,x2:7.82608696,y2:7.04347826,id:"line-3"}),a.createElement("line",{x1:0,y1:3.91304348,x2:7.82608696,y2:3.91304348,id:"line-2"}),a.createElement("line",{x1:0,y1:.782608696,x2:5.47826087,y2:.782608696,id:"line-1"})),a.createElement("polygon",{id:"paper",strokeLinecap:"round",strokeLinejoin:"round",points:"13.5652174 18.6521739 0 18.6521739 -1.18243096e-12 0 8.47826087 2.91569667e-12 13.5652174 5.08695652"}),a.createElement("polygon",{id:"fold",strokeLinejoin:"round",points:"8.47826087 0 8.47826087 5.08695652 13.5652174 5.08695652"})),a.createElement("g",{id:"plus-sign",transform:"translate(0.000000, 5.934783)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.7826087,cy:6.7826087,r:6.2826087}),a.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"7.34782609 6.2173913 10.173913 6.2173913 10.173913 7.34782609 7.34782609 7.34782609 7.34782609 10.173913 6.2173913 10.173913 6.2173913 7.34782609 3.39130435 7.34782609 3.39130435 6.2173913 6.2173913 6.2173913 6.2173913 3.39130435 7.34782609 3.39130435"}))));function $N(e,t){var n=e.title,r=e.titleId,i=zN(e,["title","titleId"]);return a.createElement("svg",WN({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,qN)}var HN=a.forwardRef($N),VN=(n.p,Object(f.a)({box:{boxSizing:"border-box",width:450,height:120,borderStyle:"dashed",borderColor:se,borderRadius:4,borderWidth:1,backgroundColor:re,display:"flex",justifyContent:"center"},inputContent:{marginTop:35,display:"flex"},uploadContent:{marginTop:50,display:"flex"},board:{marginTop:40,width:450,height:120},icon:{margin:[[14,20,0,0]]}})),UN=function(e){var t=e.type,n=VN(),r=Object(a.useState)({}),i=Object(l.a)(r,2),o=i[0],c=i[1],d=Object(mn.f)().setFieldValue,u="image"===t||"frontCamera"===t||"idCardPhoto"===t,m=Object(a.useCallback)((function(e){d(t,Uj.a(e)),c({preview:u?URL.createObjectURL(Uj.a(e)):Uj.a(e).name})}),[u,t,d]),h=Object(DN.a)({onDrop:m}),p=h.getRootProps,b=h.getInputProps;return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",Object(s.a)(Object(s.a)({},p()),{},{className:n.board,children:[Wa.a(o)&&Object(qe.jsxs)("div",{className:n.box,children:[Object(qe.jsx)("input",Object(s.a)({},b())),Object(qe.jsxs)("div",{className:n.inputContent,children:[u?Object(qe.jsx)(MN,{className:n.icon}):Object(qe.jsx)(HN,{className:n.icon}),Object(qe.jsx)(it,{children:"Drag and drop ".concat(u?"an image":"a file"," or click to open the explorer")})]})]}),!Wa.a(o)&&u&&Object(qe.jsx)("div",{children:Object(qe.jsx)("img",{src:o.preview,className:n.box,alt:""})},o.name),!Wa.a(o)&&!u&&Object(qe.jsx)("div",{className:n.box,children:Object(qe.jsx)(Xe,{className:n.uploadContent,children:o.preview})})]}))})},GN=Object(f.a)(mk),XN=function(e){var t=e.show,n=e.src,a=GN({width:165});return Object(qe.jsx)(qe.Fragment,{children:t?Object(qe.jsx)(HC,{src:n,width:165,height:32,popupWidth:360,popupHeight:240}):Object(qe.jsx)("div",{className:a.photoWrapper,children:Object(qe.jsx)(ik,{})})})},_N=function(e){var t,n,r,i,o,c,s,d,u,m,p,b=e.locale,f=e.customer,j=e.updateCustomer,g=e.replacePhoto,O=e.editCustomer,x=e.deleteEditedData,v=e.updateCustomRequest,y=e.authorizeCustomRequest,w=e.updateCustomEntry,C=e.retrieveAdditionalDataDialog,k=e.setRetrieve,E=GN(),N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],L=(S[1],A.a(["idCardData"])(f)),P=A.a(["expirationDate"])(L),T=A.a(["dateOfBirth"])(L),R=A.a(["sanctions"])(f),B=A.a(["sanctionsAt"])(f)?R?"Passed":"Failed":"Not checked yet",W=Dw.a(F.a(On.a,A.a(["customInfoRequest","customRequest","name"]))),q=[],$=[],H=W(null!==(t=A.a(["customInfoRequests"])(f))&&void 0!==t?t:[]),V=A.a(["phone"])(f),U=A.a(["subscriberInfo"])(f),G=function(e){return e%2===0},X=M.a((function(e){return e.isAvailable})),_={idCardData:{firstName:null!==(n=A.a(["firstName"])(L))&&void 0!==n?n:"",lastName:null!==(r=A.a(["lastName"])(L))&&void 0!==r?r:"",documentNumber:null!==(i=A.a(["documentNumber"])(L))&&void 0!==i?i:"",dateOfBirth:null!==(o=T&&Object(sd.a)("yyyy-MM-dd")(Object(Df.a)(new Date,"yyyyMMdd",T)))&&void 0!==o?o:"",gender:null!==(c=A.a(["gender"])(L))&&void 0!==c?c:"",country:null!==(s=A.a(["country"])(L))&&void 0!==s?s:"",expirationDate:null!==(d=P&&Object(sd.a)("yyyy-MM-dd")(Object(Df.a)(new Date,"yyyyMMdd",P)))&&void 0!==d?d:""},usSsn:{usSsn:null!==(u=f.usSsn)&&void 0!==u?u:""},frontCamera:{frontCamera:null},idCardPhoto:{idCardPhoto:null},smsData:{phoneNumber:xk(V,b.country)}},Z=[{name:"phoneNumber",label:"Phone number",component:si,editable:!1}],K={smsData:xn.c((function(e){var t,n=sm.a(["phoneNumber"])(e),a=Hc.a(n);if(2===bn.a(a))return xn.f().shape((t={},Object(z.a)(t,Uj.a(a),xn.h().required()),Object(z.a)(t,LC.a(a),xn.h().required()),t))}))},Q=[{fields:Dk.idCardData,title:"ID Scan",titleIcon:Object(qe.jsx)(_C,{className:E.cardIcon}),state:A.a(["idCardDataOverride"])(f),authorize:function(){return j({idCardDataOverride:oC})},reject:function(){return j({idCardDataOverride:lC})},deleteEditedData:function(){return x({idCardData:null})},save:function(e){return O({idCardData:Gn.a(L,Bk(e))})},validationSchema:Tk.idCardData,initialValues:_.idCardData,isAvailable:!D.a(L),editable:!0},{fields:Z,title:"SMS data",titleIcon:Object(qe.jsx)(JC,{className:E.cardIcon}),state:A.a(["phoneOverride"])(f),authorize:function(){return j({phoneOverride:oC})},reject:function(){return j({phoneOverride:lC})},save:function(e){O({subscriberInfo:{result:Gn.a(U,sm.a(["phoneNumber"])(e))}})},validationSchema:K.smsData,retrieveAdditionalData:function(){return k(!0)},initialValues:_.smsData,isAvailable:!D.a(V),hasAdditionalData:!D.a(U)&&!Wa.a(U),editable:!1},{title:"Name",titleIcon:Object(qe.jsx)(uk,{className:E.editIcon}),authorize:function(){},reject:function(){},save:function(){},isAvailable:!1,editable:!0},{title:"Sanctions check",titleIcon:Object(qe.jsx)(uk,{className:E.editIcon}),state:A.a(["sanctionsOverride"])(f),authorize:function(){return j({sanctionsOverride:oC})},reject:function(){return j({sanctionsOverride:lC})},children:Object(qe.jsx)(Je,{children:B}),isAvailable:!D.a(R),editable:!0},{fields:Dk.frontCamera,title:"Front facing camera",titleIcon:Object(qe.jsx)(uk,{className:E.editIcon}),state:A.a(["frontCameraOverride"])(f),authorize:function(){return j({frontCameraOverride:oC})},reject:function(){return j({frontCameraOverride:lC})},save:function(e){return g({newPhoto:e.frontCamera,photoType:"frontCamera"})},deleteEditedData:function(){return x({frontCamera:null})},children:f.frontCameraPath?Object(qe.jsx)(XN,{show:f.frontCameraPath,src:"".concat(Aj,"/front-camera-photo/").concat(A.a(["frontCameraPath"])(f))}):null,hasImage:!0,validationSchema:Tk.frontCamera,initialValues:_.frontCamera,isAvailable:!D.a(f.frontCameraPath),editable:!0},{fields:Dk.idCardPhoto,title:"ID card image",titleIcon:Object(qe.jsx)(uk,{className:E.editIcon}),state:A.a(["idCardPhotoOverride"])(f),authorize:function(){return j({idCardPhotoOverride:oC})},reject:function(){return j({idCardPhotoOverride:lC})},save:function(e){return g({newPhoto:e.idCardPhoto,photoType:"idCardPhoto"})},deleteEditedData:function(){return x({idCardPhoto:null})},children:f.idCardPhotoPath?Object(qe.jsx)(XN,{show:f.idCardPhotoPath,src:"".concat(Aj,"/id-card-photo/").concat(A.a(["idCardPhotoPath"])(f))}):null,hasImage:!0,validationSchema:Tk.idCardPhoto,initialValues:_.idCardPhoto,isAvailable:!D.a(f.idCardPhotoPath),editable:!0},{fields:Dk.usSsn,title:"US SSN",titleIcon:Object(qe.jsx)(_C,{className:E.cardIcon}),state:A.a(["usSsnOverride"])(f),authorize:function(){return j({usSsnOverride:oC})},reject:function(){return j({usSsnOverride:lC})},save:function(e){return O(e)},deleteEditedData:function(){return x({usSsn:null})},validationSchema:Tk.usSsn,initialValues:_.usSsn,isAvailable:!D.a(f.usSsn),editable:!0}];Uv.a((function(e){var t,n;$.push({fields:[{name:e.customInfoRequest.id,label:e.customInfoRequest.customRequest.name,value:null!==(t=e.customerData.data)&&void 0!==t?t:"",component:si,editable:!0}],title:e.customInfoRequest.customRequest.name,titleIcon:Object(qe.jsx)(_C,{className:E.cardIcon}),state:A.a(["override"])(e),authorize:function(){return y({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,override:oC}})},reject:function(){return y({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,override:lC}})},save:function(t){v({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,data:{info_request_id:e.customInfoRequest.id,data:t[e.customInfoRequest.id]}}})},deleteEditedData:function(){},validationSchema:xn.f().shape(Object(z.a)({},e.customInfoRequest.id,xn.h())),initialValues:Object(z.a)({},e.customInfoRequest.id,null!==(n=e.customerData.data)&&void 0!==n?n:"")})}),H),Uv.a((function(e){var t,n;q.push({fields:[{name:e.label,label:e.label,value:null!==(t=e.value)&&void 0!==t?t:"",component:si,editable:!0}],title:e.label,titleIcon:Object(qe.jsx)(uk,{className:E.editIcon}),save:function(t){w({fieldId:e.id,value:t[e.label]})},deleteEditedData:function(){},validationSchema:xn.f().shape(Object(z.a)({},e.label,xn.h())),initialValues:Object(z.a)({},e.label,null!==(n=e.value)&&void 0!==n?n:"")})}),null!==(m=A.a(["customFields"])(f))&&void 0!==m?m:[]),Uv.a((function(e){_.smsData[e]=U[e],Z.push({name:e,label:zm(e),component:si,editable:!1})}),null!==(p=Hc.a(U))&&void 0!==p?p:[]);var Y=function(e,t){var n=e.title,a=e.authorize,r=e.reject,i=e.state,o=e.titleIcon,l=e.fields,c=e.save,s=e.deleteEditedData,d=e.retrieveAdditionalData,u=e.children,m=e.validationSchema,h=e.initialValues,p=e.hasImage,b=e.hasAdditionalData,f=e.editable;return Object(qe.jsx)(IN,{title:n,authorize:a,reject:r,state:i,titleIcon:o,hasImage:p,hasAdditionalData:b,fields:l,children:u,validationSchema:m,initialValues:h,save:c,deleteEditedData:s,retrieveAdditionalData:d,editable:f},t)},J=X(Q);return Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:E.header,children:[Object(qe.jsx)(Xe,{className:E.title,children:"Customer data"}),!1]}),Object(qe.jsxs)("div",{children:[!I&&f&&Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:J.map((function(e,t){return G(t)?Y(e,t):null}))}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:J.map((function(e,t){return G(t)?null:Y(e,t)}))})]}),!Wa.a(q)&&Object(qe.jsxs)("div",{className:E.wrapper,children:[Object(qe.jsx)("span",{className:E.separator,children:"Custom data entry"}),Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:q.map((function(e,t){return G(t)?Y(e,t):null}))}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:q.map((function(e,t){return G(t)?null:Y(e,t)}))})]})]}),!Wa.a($)&&Object(qe.jsxs)("div",{className:E.wrapper,children:[Object(qe.jsx)("span",{className:E.separator,children:"Custom requirements"}),Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:$.map((function(e,t){return G(t)?Y(e,t):null}))}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:$.map((function(e,t){return G(t)?null:Y(e,t)}))})]})]})]}),C]})},ZN={header:{display:"flex",flexDirection:"row"},title:{marginTop:7,marginRight:24},notesChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap"}},KN={noteCardWrapper:{flexGrow:0,flexShrink:0,flexBasis:"25%",minWidth:0,maxWidth:500,"&:nth-child(4n+1)":{"& > div":{margin:[[0,10,0,0]]}},"&:nth-child(4n)":{"& > div":{margin:[[0,0,0,10]]}},margin:[[10,0]]},noteCardChip:{height:200,margin:[[0,10]],padding:[[10,10]],cursor:"pointer"},newNoteCard:{backgroundColor:G,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},noteCardHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%"},noteCardTitle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:10},noteCardContent:{display:"box",lineClamp:7,boxOrient:"vertical",margin:[[15,0]],overflow:"hidden",textOverflow:"ellipsis",wordWrap:"break-word"},editCardChip:{height:325,padding:15},editCardHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:15},editCardActions:{display:"flex",flexDirection:"row",alignItems:"center","& > *":{marginRight:10},"& > *:last-child":{marginRight:0}},editNotesContent:{"& > div":{"&:after":{borderBottom:"none"},"&:before":{borderBottom:"none"},"&:hover:not(.Mui-disabled)::before":{borderBottom:"none"}}}},QN=Object(f.a)(KN),YN=function(e){var t=e.setOpenModal,n=QN();return Object(qe.jsx)("div",{className:n.noteCardWrapper,onClick:function(){return t(!0)},children:Object(qe.jsxs)(Un.a,{className:I()(n.noteCardChip,n.newNoteCard),children:[Object(qe.jsx)(Sn,{width:20,height:20}),Object(qe.jsx)(Ke,{children:"Add new"})]})})},JN={form:{display:"flex",flexDirection:"column",height:"100%","& > *":{marginTop:20},"& > *:last-child":{marginTop:"auto"}},submit:{margin:[["auto",0,0,"auto"]]},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]}},eS=Object(f.a)(JN),tS={title:"",content:""},nS=xn.f().shape({title:xn.h().required().trim().max(25),content:xn.h().required()}),aS=function(e){var t=e.showModal,n=e.onClose,a=e.onSubmit,r=e.errorMsg,i=eS();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(Yh,{title:"New note",closeOnBackdropClick:!0,width:416,height:472,handleClose:n,open:t,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:tS,validationSchema:nS,onSubmit:function(e){var t=e.title,n=e.content;a({title:t,content:n})},children:Object(qe.jsxs)(mn.d,{id:"note-form",className:i.form,children:[Object(qe.jsx)(mn.b,{name:"title",autofocus:!0,size:"md",autoComplete:"off",width:350,component:si,label:"Note title"}),Object(qe.jsx)(mn.b,{name:"content",size:"sm",autoComplete:"off",width:350,component:si,multiline:!0,rows:11,label:"Note content"}),Object(qe.jsxs)("div",{className:i.footer,children:[r&&Object(qe.jsx)(rl,{children:r}),Object(qe.jsx)(An,{type:"submit",form:"note-form",className:i.submit,children:"Add note"})]})]})})})})},rS=n(1099),iS=Object(f.a)(KN),oS=function(e){var t=rS.a(/\n/)(e);return T.a((function(e,n){return n===t.length?Object(qe.jsx)(qe.Fragment,{children:e}):Object(qe.jsxs)(qe.Fragment,{children:[e,Object(qe.jsx)("br",{})]})}),t)},lS=function(e){var t=e.note,n=e.deleteNote,a=e.handleClick,r=e.timezone,i=iS();return Object(qe.jsx)("div",{className:i.noteCardWrapper,children:Object(qe.jsxs)(Un.a,{className:i.noteCardChip,onClick:function(){return a(t)},children:[Object(qe.jsxs)("div",{className:i.noteCardHeader,children:[Object(qe.jsxs)("div",{className:i.noteCardTitle,children:[Object(qe.jsx)(Xe,{noMargin:!0,children:null===t||void 0===t?void 0:t.title}),Object(qe.jsx)(Ke,{noMargin:!0,children:md(null===t||void 0===t?void 0:t.created,r,"yyyy-MM-dd")})]}),Object(qe.jsx)("div",{children:Object(qe.jsx)(vh,{className:i.deleteIcon,onClick:function(e){e.stopPropagation(),n({noteId:t.id})}})})]}),Object(qe.jsx)(Ke,{noMargin:!0,className:i.noteCardContent,children:oS(null===t||void 0===t?void 0:t.content)})]})})},cS=n(1149),sS=n(1100);function dS(){return(dS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function uS(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var mS=a.createElement("desc",null,"Created with Sketch."),hS=a.createElement("defs",null,a.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),pS=a.createElement("g",{id:"icon/sf-small/save/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group"},a.createElement("g",{id:"Group-10"},a.createElement("g",{id:"Group-6"},a.createElement("polygon",{id:"Stroke-1",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",points:"20.5 20.5 0.5 20.5 0.5 0.5 16.75 0.5 20.5 4.25"}),a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("g",{id:"Clip-4"}),a.createElement("polygon",{id:"Stroke-5",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",mask:"url(#mask-2)",points:"4.25 7.5 16.75 7.5 16.75 0.5 4.25 0.5"}))),a.createElement("circle",{id:"Oval",stroke:"#1B2559",strokeWidth:2,cx:11,cy:14,r:3})));function bS(e,t){var n=e.title,r=e.titleId,i=uS(e,["title","titleId"]);return a.createElement("svg",dS({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,mS,hS,pS)}var fS=a.forwardRef(bS),jS=(n.p,Object(f.a)(KN)),gS=function(e){var t=e.note,n=e.cancel,r=e.edit,i=e.timezone,o=Object(a.useRef)(),l=jS(),c=xn.f().shape({content:xn.h()}),s={content:t.content};return Object(qe.jsxs)(Un.a,{className:l.editCardChip,children:[Object(qe.jsxs)("div",{className:l.editCardHeader,children:[Object(qe.jsxs)(Ke,{noMargin:!0,children:["Last edited ",Object(cS.a)({delimited:", "},Object(sS.a)({start:ud(new Date(t.lastEditedAt),i),end:ud(new Date,i)}))," ago"]}),Object(qe.jsxs)("div",{className:l.editCardActions,children:[Object(qe.jsx)(He,{color:"primary",type:"button",Icon:bj,InverseIcon:ba,onClick:n,children:"Cancel"}),Object(qe.jsx)(He,{color:"primary",type:"submit",form:"edit-note",Icon:fS,InverseIcon:yN,children:"Save changes"}),Object(qe.jsx)(He,{color:"primary",type:"button",Icon:bj,InverseIcon:ba,onClick:function(){return o.current.setFieldValue("content","")},children:"Clear content"})]})]}),Object(qe.jsx)(mn.e,{validateOnChange:!1,validateOnBlur:!1,validationSchema:c,initialValues:s,onSubmit:function(e){var n=e.content;return r({noteId:t.id,newContent:n,oldContent:t.content})},innerRef:o,children:Object(qe.jsx)(mn.d,{id:"edit-note",children:Object(qe.jsx)(mn.b,{name:"content",component:si,className:l.editNotesContent,size:"sm",autoComplete:"off",fullWidth:!0,multiline:!0,rows:15})})})]})},OS=Object(f.a)(ZN),xS=function(e){var t,n=e.customer,r=e.createNote,i=e.deleteNote,o=e.editNote,c=e.timezone,s=OS(),d=Object(a.useState)(!1),u=Object(l.a)(d,2),m=u[0],h=u[1],p=Object(a.useState)(null),b=Object(l.a)(p,2),f=b[0],j=b[1],g=iy.a((function(e,t){return new Date(null===t||void 0===t?void 0:t.created).getTime()-new Date(null===e||void 0===e?void 0:e.created).getTime()}),null!==(t=n.notes)&&void 0!==t?t:[]),O=function(){h(!1)};return Object(qe.jsxs)("div",{children:[Object(qe.jsx)("div",{className:s.header,children:Object(qe.jsx)(Xe,{className:s.title,children:"Notes"})}),D.a(f)&&Object(qe.jsxs)("div",{className:s.notesChipList,children:[Object(qe.jsx)(YN,{setOpenModal:h}),T.a((function(e){return Object(qe.jsx)(lS,{note:e,deleteNote:i,handleClick:j,timezone:c})}),g)]}),!D.a(f)&&Object(qe.jsx)(gS,{note:f,cancel:function(){j(null)},edit:function(e){gn.a(e.newContent,e.oldContent)||o({noteId:e.noteId,newContent:e.newContent}),j(null)},timezone:c}),m&&Object(qe.jsx)(aS,{showModal:m,onClose:O,onSubmit:function(e){return r(e),O()}})]})},vS=n(535),yS=n(1101);function wS(){return(wS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function CS(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kS=a.createElement("g",{id:"icon/ID/photo/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M12,14 C9.7912,14 8,12.2088 8,10 C8,7.7912 9.7912,6 12,6 C14.2088,6 16,7.7912 16,10 C16,12.2088 14.2088,14 12,14 Z M16.7142857,3.4 L14.3571429,1 L9.64285714,1 L7.28571429,3.4 L1,3.4 L1,17 L23,17 L23,3.4 L16.7142857,3.4 Z",id:"Stroke-1",stroke:"#5F668A",strokeWidth:1.6}));function ES(e,t){var n=e.title,r=e.titleId,i=CS(e,["title","titleId"]);return a.createElement("svg",wS({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/comet"):n?a.createElement("title",{id:r},n):null,kS)}var NS,SS,IS,LS,FS,PS,DS,TS,RS,BS,AS,MS,WS,zS,qS,$S,HS=a.forwardRef(ES),VS=(n.p,{header:{display:"flex",flexDirection:"row"},title:{marginTop:7,marginRight:24,marginBottom:32},photosChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:14},image:{objectFit:"cover",objectPosition:"center",width:224,height:200,borderTopLeftRadius:4,borderTopRightRadius:4},photoCardChip:{cursor:"pointer"},footer:{display:"flex",flexDirection:"row",margin:[[8,0,0,8]]},date:{margin:[[0,0,8,12]]}}),US=Object(f.a)(VS),GS=function(e){var t=e.idx,n=e.date,a=e.src,r=e.setPhotosDialog,i=e.setPhotoClickIndex,o=US();return Object(qe.jsxs)(Un.a,{className:o.photoCardChip,onClick:function(){i(t),r(!0)},children:[Object(qe.jsx)("img",{className:o.image,src:a,alt:""}),Object(qe.jsxs)("div",{className:o.footer,children:[Object(qe.jsx)(HS,{}),Object(qe.jsx)(rt,{className:o.date,children:Object(sd.a)("yyyy-MM-dd",new Date(n))})]})]})},XS=function(e){var t=e.photosData,n=e.timezone,r=US(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(null),u=Object(l.a)(d,2),m=u[0],h=u[1],p=D.a(m)?t:F.a(ul.a,vS.a,yS.a(m))(t);return Object(qe.jsxs)("div",{children:[Object(qe.jsx)("div",{className:r.header,children:Object(qe.jsx)(Xe,{className:r.title,children:"Photos & files"})}),Object(qe.jsx)("div",{className:r.photosChipList,children:t.map((function(e,t){return Object(qe.jsx)(GS,{idx:t,date:e.date,src:"".concat(Aj,"/").concat(e.photoDir,"/").concat(e.path),setPhotosDialog:s,setPhotoClickIndex:h})}))}),Object(qe.jsx)(Xk,{open:c,title:"Photo roll",data:Object(qe.jsx)(uE,{photosData:p,timezone:n}),onDissmised:function(){s(!1),h(null)}})]})},_S={labelLink:{cursor:"pointer",color:$},breadcrumbs:{margin:[[20,0]]},actionLabel:{color:$,margin:[[4,0]]},customerDetails:{marginBottom:18},actionButton:{margin:[[0,0,4,0]],display:"flex",flexDirection:"row",justifyContent:"center"},actionBar:{display:"flex",flexDirection:"column",width:219},panels:{display:"flex"},rightSidePanel:{display:"block",width:1100,marginBottom:25},leftSidePanel:{width:300,"& > *":{marginBottom:25},"& > *:last-child":{marginBottom:0},"& > *:first-child":{marginBottom:50}},userStatusAction:{display:"flex",flexDirection:"row",alignItems:"center",backgroundColor:re,borderRadius:8,padding:[[0,5]]},closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},dialogTitle:{margin:[[0,16,8,40]]},dialogContent:{width:615,marginLeft:16},dialogActions:{padding:32,paddingTop:16},cancelButton:{marginRight:8,padding:0},errorMessage:{marginLeft:38}},ZS=Object(f.a)(_S),KS=x()(NS||(NS=Object(c.a)(["\n query customer($customerId: ID!) {\n config\n customer(customerId: $customerId) {\n id\n authorizedOverride\n frontCameraPath\n frontCameraAt\n frontCameraOverride\n phone\n isAnonymous\n smsOverride\n idCardData\n idCardDataOverride\n idCardDataExpiration\n idCardPhotoPath\n idCardPhotoOverride\n idCardPhotoAt\n usSsn\n usSsnOverride\n sanctions\n sanctionsAt\n sanctionsOverride\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n daysSuspended\n isSuspended\n isTestCustomer\n subscriberInfo\n phoneOverride\n customFields {\n id\n label\n value\n }\n notes {\n id\n customerId\n title\n content\n created\n lastEditedAt\n }\n transactions {\n txClass\n id\n fiat\n fiatCode\n cryptoAtoms\n cryptoCode\n created\n machineName\n errorMessage: error\n error: errorCode\n txCustomerPhotoAt\n txCustomerPhotoPath\n }\n customInfoRequests {\n customerId\n override\n overrideBy\n overrideAt\n customerData\n customInfoRequest {\n id\n enabled\n customRequest\n }\n }\n }\n }\n"]))),QS=x()(SS||(SS=Object(c.a)(["\n mutation setCustomer($customerId: ID!, $customerInput: CustomerInput) {\n setCustomer(customerId: $customerId, customerInput: $customerInput) {\n id\n authorizedOverride\n frontCameraPath\n frontCameraOverride\n phone\n smsOverride\n idCardData\n idCardDataOverride\n idCardDataExpiration\n idCardPhotoPath\n idCardPhotoOverride\n usSsn\n usSsnOverride\n sanctions\n sanctionsAt\n sanctionsOverride\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n subscriberInfo\n phoneOverride\n }\n }\n"]))),YS=x()(IS||(IS=Object(c.a)(["\n mutation editCustomer($customerId: ID!, $customerEdit: CustomerEdit) {\n editCustomer(customerId: $customerId, customerEdit: $customerEdit) {\n id\n idCardData\n usSsn\n }\n }\n"]))),JS=x()(LS||(LS=Object(c.a)(["\n mutation replacePhoto(\n $customerId: ID!\n $photoType: String\n $newPhoto: Upload\n ) {\n replacePhoto(\n customerId: $customerId\n photoType: $photoType\n newPhoto: $newPhoto\n ) {\n id\n newPhoto\n photoType\n }\n }\n"]))),eI=x()(FS||(FS=Object(c.a)(["\n mutation deleteEditedData($customerId: ID!, $customerEdit: CustomerEdit) {\n deleteEditedData(customerId: $customerId, customerEdit: $customerEdit) {\n id\n frontCameraPath\n idCardData\n idCardPhotoPath\n usSsn\n }\n }\n"]))),tI=x()(PS||(PS=Object(c.a)(["\n mutation setAuthorizedCustomRequest(\n $customerId: ID!\n $infoRequestId: ID!\n $override: String!\n ) {\n setAuthorizedCustomRequest(\n customerId: $customerId\n infoRequestId: $infoRequestId\n override: $override\n )\n }\n"]))),nI=x()(DS||(DS=Object(c.a)(["\n mutation setCustomerCustomInfoRequest(\n $customerId: ID!\n $infoRequestId: ID!\n $data: JSON!\n ) {\n setCustomerCustomInfoRequest(\n customerId: $customerId\n infoRequestId: $infoRequestId\n data: $data\n )\n }\n"]))),aI=x()(TS||(TS=Object(c.a)(["\n mutation createCustomerNote(\n $customerId: ID!\n $title: String!\n $content: String!\n ) {\n createCustomerNote(\n customerId: $customerId\n title: $title\n content: $content\n )\n }\n"]))),rI=x()(RS||(RS=Object(c.a)(["\n mutation deleteCustomerNote($noteId: ID!) {\n deleteCustomerNote(noteId: $noteId)\n }\n"]))),iI=x()(BS||(BS=Object(c.a)(["\n mutation editCustomerNote($noteId: ID!, $newContent: String!) {\n editCustomerNote(noteId: $noteId, newContent: $newContent)\n }\n"]))),oI=x()(AS||(AS=Object(c.a)(["\n mutation enableTestCustomer($customerId: ID!) {\n enableTestCustomer(customerId: $customerId)\n }\n"]))),lI=x()(MS||(MS=Object(c.a)(["\n mutation disableTestCustomer($customerId: ID!) {\n disableTestCustomer(customerId: $customerId)\n }\n"]))),cI=x()(WS||(WS=Object(c.a)(["\n query getData {\n config\n }\n"]))),sI=x()(zS||(zS=Object(c.a)(["\n mutation addCustomField($customerId: ID!, $label: String!, $value: String!) {\n addCustomField(customerId: $customerId, label: $label, value: $value)\n }\n"]))),dI=x()(qS||(qS=Object(c.a)(["\n mutation saveCustomField($customerId: ID!, $fieldId: ID!, $value: String!) {\n saveCustomField(customerId: $customerId, fieldId: $fieldId, value: $value)\n }\n"]))),uI=x()($S||($S=Object(c.a)(["\n query customInfoRequests($onlyEnabled: Boolean) {\n customInfoRequests(onlyEnabled: $onlyEnabled) {\n id\n customRequest\n }\n }\n"]))),mI=Object(a.memo)((function(){var e,t,n,r,i,o=Object(w.h)(),c=Object(a.useState)(!1),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(a.useState)(!1),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(a.useState)(null),y=Object(l.a)(v,2),C=y[0],k=y[1],E=Object(a.useState)("overview"),N=Object(l.a)(E,2),S=N[0],I=N[1],L=Object(w.j)().id,F=Object(u.c)(KS,{variables:{customerId:L}}),P=F.data,D=F.refetch,B=F.loading,M=Object(u.c)(cI),W=M.data,z=M.loading,q=Object(u.c)(uI,{variables:{onlyEnabled:!0}}).data,$=Object(u.b)(sI,{onCompleted:function(){return D()}}),H=Object(l.a)($,1)[0],V=Object(u.b)(dI,{onCompleted:function(){return D()}}),U=Object(l.a)(V,1)[0],G=Object(u.b)(JS,{onCompleted:function(){return D()}}),X=Object(l.a)(G,1)[0],_=Object(u.b)(YS,{onCompleted:function(){return D()}}),Z=Object(l.a)(_,1)[0],K=Object(u.b)(eI,{onCompleted:function(){return D()}}),Q=Object(l.a)(K,1)[0],Y=Object(u.b)(QS,{onCompleted:function(){D(),m(!1)},onError:function(e){return k(e)}}),J=Object(l.a)(Y,1)[0],ee=Object(u.b)(tI,{onCompleted:function(){return D()}}),te=Object(l.a)(ee,1)[0],ne=Object(u.b)(nI,{onCompleted:function(){return D()}}),ae=Object(l.a)(ne,1)[0],re=Object(u.b)(aI,{onCompleted:function(){return D()}}),ie=Object(l.a)(re,1)[0],oe=Object(u.b)(rI,{onCompleted:function(){return D()}}),le=Object(l.a)(oe,1)[0],ce=Object(u.b)(iI,{onCompleted:function(){return D()}}),se=Object(l.a)(ce,1)[0],de=Object(u.b)(oI,{variables:{customerId:L},onCompleted:function(){return D()}}),ue=Object(l.a)(de,1)[0],me=Object(u.b)(lI,{variables:{customerId:L},onCompleted:function(){return D()}}),he=Object(l.a)(me,1)[0],pe=function(e){return J({variables:{customerId:L,customerInput:e}})},be=function(e){X({variables:{customerId:L,newPhoto:e.newPhoto,photoType:e.photoType}}),x(null)},fe=function(e){Z({variables:{customerId:L,customerEdit:e}}),x(null)},je=null!==(e=A.a(["config"])(P))&&void 0!==e?e:[],ge=je&&ss(es,je),Oe=null!==(t=A.a(["customer"])(P))&&void 0!==t?t:[],xe=null!==(n=A.a(["transactions"])(Oe))&&void 0!==n?n:[],ve=iy.a(Uw.a(R.a("cryptoAtoms")))(xe),ye=vk(Oe),we=A.a(["authorizedOverride"])(Oe)===lC,Ce=Oe.isSuspended,ke="customerData"===S,Ee="overview"===S,Ne="notes"===S,Se="photos"===S,Ie=Gm.a(["frontCameraPath","frontCameraAt"])(Oe),Le=ve&&T.a(Gm.a(["id","txCustomerPhotoPath","txCustomerPhotoAt"]))(ve),Fe=zk(xd.a(Ie,Le)),Pe=Oe.idCardPhotoPath?[{photoDir:"id-card-photo",path:Oe.idCardPhotoPath,date:Oe.idCardPhotoAt}]:[],De=B||z,Te=A.a(["config","locale_timezone"],W),Re=null!==(r=null===q||void 0===q||null===(i=q.customInfoRequests)||void 0===i?void 0:i.map((function(e){return{value:e.id,display:e.customRequest.name}})))&&void 0!==r?r:[],Be=ZS();return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(nm.a,{classes:{root:Be.breadcrumbs},separator:Object(qe.jsx)(rm.a,{fontSize:"small"}),"aria-label":"breadcrumb",children:[Object(qe.jsx)(at,{noMargin:!0,className:Be.labelLink,onClick:function(){return o.push("/compliance/customers")},children:"Customers"}),Object(qe.jsx)(rt,{noMargin:!0,className:Be.labelLink,children:ye.length?ye:xk(A.a(["phone"])(Oe),ge.country)})]}),Object(qe.jsxs)("div",{className:Be.panels,children:[Object(qe.jsx)("div",{className:Be.leftSidePanel,children:!De&&!Oe.isAnonymous&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(rN,{isSelected:function(e){return e===S},onClick:function(e){return I(e)}}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(at,{className:Be.actionLabel,children:"Actions"}),Object(qe.jsxs)("div",{className:Be.actionBar,children:[Object(qe.jsx)(He,{className:Be.actionButton,color:"primary",Icon:IC,InverseIcon:CC,onClick:function(){return x(!0)},children:"Manual data entry"}),Ce&&Object(qe.jsx)(He,{className:Be.actionButton,color:"primary",Icon:aC,InverseIcon:Qw,onClick:function(){return pe({suspendedUntil:null})},children:"Unsuspend customer"}),Object(qe.jsx)(He,{color:"primary",className:Be.actionButton,Icon:we?aC:OC,InverseIcon:we?Qw:hC,onClick:function(){return pe({authorizedOverride:we?oC:lC})},children:"".concat(we?"Authorize":"Block"," customer")})]})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(at,{className:Be.actionLabel,children:"Special user status"}),Object(qe.jsx)("div",{className:Be.actionBar,children:Object(qe.jsxs)("div",{className:Be.userStatusAction,children:[Object(qe.jsx)(Lr,{checked:!!A.a(["isTestCustomer"])(Oe),value:!!A.a(["isTestCustomer"])(Oe),onChange:function(){return A.a(["isTestCustomer"])(Oe)?he():ue()}}),"Test user"]})})]})]})}),Object(qe.jsxs)("div",{className:Be.rightSidePanel,children:[Ee&&Object(qe.jsxs)("div",{children:[Object(qe.jsx)(tl.a,{className:Be.customerDetails,display:"flex",justifyContent:"space-between",children:Object(qe.jsx)(bE,{customer:Oe,photosData:Fe,locale:ge,setShowCompliance:function(){return f(!b)},timezone:Te})}),Object(qe.jsx)("div",{children:Object(qe.jsx)(PN,{customer:Oe,data:ve,locale:ge,loading:De})})]}),ke&&Object(qe.jsx)("div",{children:Object(qe.jsx)(_N,{locale:ge,customer:Oe,updateCustomer:pe,replacePhoto:be,editCustomer:fe,deleteEditedData:function(e){return Q({variables:{customerId:L,customerEdit:e}})},updateCustomRequest:ae,authorizeCustomRequest:te,updateCustomEntry:function(e){U({variables:{customerId:L,fieldId:e.fieldId,value:e.value}})},setRetrieve:m,retrieveAdditionalDataDialog:Object(qe.jsx)(hI,{onDismissed:function(){k(null),m(!1)},onConfirmed:function(){k(null),J({variables:{customerId:L,customerInput:{subscriberInfo:!0}}})},error:C,open:d})})}),Ne&&Object(qe.jsx)("div",{children:Object(qe.jsx)(xS,{customer:Oe,createNote:function(e){return ie({variables:{customerId:L,title:e.title,content:e.content}})},deleteNote:function(e){return le({variables:{noteId:e.noteId}})},editNote:function(e){return se({variables:{noteId:e.noteId,newContent:e.newContent}})},timezone:Te})}),Se&&Object(qe.jsx)("div",{children:Object(qe.jsx)(XS,{photosData:ml.a(Fe,Pe),timezone:Te})})]}),O&&Object(qe.jsx)(Hk,{error:null===C||void 0===C?void 0:C.message,save:function(e){H({variables:{customerId:L,label:e.title,value:e.data}}),x(null)},addPhoto:be,addCustomerData:fe,onClose:function(){return x(null)},customInfoRequirementOptions:Re})]})]})})),hI=function(e){var t=e.onConfirmed,n=e.onDismissed,a=e.open,r=e.error,i=e.props,o=ZS();return Object(qe.jsxs)(cn.a,Object(s.a)(Object(s.a)({open:a,"aria-labelledby":"form-dialog-title",PaperProps:{style:{borderRadius:8,minWidth:656,bottom:125,right:7}}},i),{},{children:[Object(qe.jsx)("div",{className:o.closeButton,children:Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:function(){return n(!1)},children:Object(qe.jsx)(qi,{})})}),Object(qe.jsx)(Ge,{className:o.dialogTitle,children:"Retrieve API data from Twilio"}),Object(qe.jsxs)(sn.a,{className:o.dialogContent,children:[Object(qe.jsx)(Je,{children:"With this action you'll be using Twilio's API to retrieve additional\n data from this user. This includes name and address, if available.\n"}),Object(qe.jsx)(Je,{children:" There is a small cost from Twilio for each retrieval. Would you like\n to proceed?"})]}),r&&Object(qe.jsx)(rl,{className:o.errorMessage,children:"Failed to fetch additional data"}),Object(qe.jsxs)(Xm.a,{className:o.dialogActions,children:[Object(qe.jsx)(An,{backgroundColor:"grey",className:o.cancelButton,onClick:function(){return n(!1)},children:"Cancel"}),Object(qe.jsx)(An,{onClick:function(){t()},children:"Confirm"})]})]}))},pI=mI,bI=n(1137),fI=n(576),jI=Wn.baseButton,gI=jI.height/2,OI=jI.height/4,xI="rgba(0, 0, 0, 0.08)",vI="0 4px 4px 0 ".concat(xI),yI={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Ha(t))},bold:Va,autocomplete:{'&[data-focus="true"]':{backgroundColor:xI}},popup:{display:"flex",flexDirection:"column",borderRadius:[[0,0,OI,OI]],backgroundColor:G,boxShadow:vI},separator:{width:"88%",height:1,margin:"0 auto",border:"solid 0.5px",borderColor:$},item:{display:"flex",flexDirection:"row",width:"100%",height:36,alignItems:"center"},itemLabel:{margin:[0],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemType:{marginLeft:"auto",fontSize:12,color:$,margin:[0]},input:{display:"flex",flex:1,width:273,padding:[[8,12]],alignItems:"center",height:32,borderRadius:gI,backgroundColor:G,color:J},inputWithPopup:{borderRadius:[[OI,OI,0,0]],boxShadow:vI},iconButton:{marginRight:12}},wI=Object(f.a)(yI),CI=Object(a.memo)((function(e){var t,n=e.loading,r=void 0!==n&&n,i=e.filters,o=void 0===i?[]:i,c=e.options,d=void 0===c?[]:c,u=e.inputPlaceholder,m=void 0===u?"":u,h=e.size,p=e.onChange,b=Object(q.a)(e,["loading","filters","options","inputPlaceholder","size","onChange"]),f=wI({size:h}),j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=(t={},Object(z.a)(t,f.input,!0),Object(z.a)(t,f.inputWithPopup,O),t),y=function(e){return p(e)};return Object(qe.jsx)(Ra.a,Object(s.a)({loading:r,classes:{option:f.autocomplete},value:o,options:d,getOptionLabel:function(e){return e.value},renderOption:function(e){return Object(qe.jsxs)("div",{className:f.item,children:[Object(qe.jsx)(Ke,{className:f.itemLabel,children:e.value}),Object(qe.jsx)(Ke,{className:f.itemType,children:e.type})]})},autoHighlight:!0,disableClearable:!0,clearOnEscape:!0,multiple:!0,filterSelectedOptions:!0,getOptionSelected:function(e,t){return e.type===t.type},PaperComponent:function(e){var t=e.children;return Object(qe.jsxs)(Un.a,{elevation:0,className:f.popup,children:[Object(qe.jsx)("div",{className:f.separator}),t]})},renderInput:function(e){return Object(qe.jsx)(fI.a,Object(s.a)(Object(s.a)({ref:e.InputProps.ref},e),{},{className:I()(v),startAdornment:Object(qe.jsx)(qC,{className:f.iconButton}),placeholder:m,inputProps:Object(s.a)({className:f.bold,classes:{root:f.size}},e.inputProps)}))},onOpen:function(){return x(!0)},onClose:function(){return x(!1)},onChange:function(e,t){return y(t)}},b))}));function kI(){return(kI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function EI(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var NI=a.createElement("g",{id:"icon/button/filter/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M0.6,-3.33066907e-16 L0.509218076,0.00652107669 C0.068925647,0.0708166555 -0.160361948,0.596737342 0.124968515,0.966531156 L4.166,6.204 L4.16660432,9.6 C4.16660432,9.79162756 4.25813682,9.97172829 4.41293455,10.0846831 L6.8797259,11.8846831 L6.96095139,11.9350192 C7.34801849,12.1353088 7.83339568,11.8580867 7.83339568,11.4 L7.833,6.204 L11.8750315,0.966531156 C12.179384,0.572084421 11.8982155,-3.33066907e-16 11.4,-3.33066907e-16 L0.6,-3.33066907e-16 Z M10.179,1.199 L6.75836419,5.63346884 L6.70465653,5.71638775 C6.65811535,5.80315577 6.63339568,5.90052663 6.63339568,6 L6.633,10.219 L5.366,9.294 L5.36660432,6 L5.35847177,5.90154229 C5.34231401,5.80441508 5.30240262,5.71222382 5.24163581,5.63346884 L1.82,1.199 L10.179,1.199 Z",id:"Path",fill:"#FFFFFF",fillRule:"nonzero"}));function SI(e,t){var n=e.title,r=e.titleId,i=EI(e,["title","titleId"]);return a.createElement("svg",kI({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/filter/white"):n?a.createElement("title",{id:r},n):null,NI)}var II=a.forwardRef(SI);n.p;function LI(){return(LI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function FI(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var PI=a.createElement("g",{id:"icon/button/filter/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M0.6,-4.56301663e-14 L0.509218076,0.00652107669 C0.068925647,0.0708166555 -0.160361948,0.596737342 0.124968515,0.966531156 L4.166,6.204 L4.16660432,9.6 C4.16660432,9.79162756 4.25813682,9.97172829 4.41293455,10.0846831 L6.8797259,11.8846831 L6.96095139,11.9350192 C7.34801849,12.1353088 7.83339568,11.8580867 7.83339568,11.4 L7.833,6.204 L11.8750315,0.966531156 C12.179384,0.572084421 11.8982155,-4.56301663e-14 11.4,-4.56301663e-14 L0.6,-4.56301663e-14 Z M10.179,1.199 L6.75836419,5.63346884 L6.70465653,5.71638775 C6.65811535,5.80315577 6.63339568,5.90052663 6.63339568,6 L6.633,10.219 L5.366,9.294 L5.36660432,6 L5.35847177,5.90154229 C5.34231401,5.80441508 5.30240262,5.71222382 5.24163581,5.63346884 L1.82,1.199 L10.179,1.199 Z",id:"Path",fill:"#1B2559",fillRule:"nonzero"}));function DI(e,t){var n=e.title,r=e.titleId,i=FI(e,["title","titleId"]);return a.createElement("svg",LI({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/filter/zodiac"):n?a.createElement("title",{id:r},n):null,PI)}var TI,RI,BI,AI,MI=a.forwardRef(DI),WI=(n.p,{root:{marginLeft:0,height:20,backgroundColor:G,"&:hover, &:focus, &:active":{backgroundColor:G},marginBottom:"auto"},label:{fontSize:ke,fontWeight:Ie,fontFamily:Le,paddingRight:0,paddingLeft:8,color:J}}),zI={button:{width:8,height:8,marginLeft:8,marginRight:8},text:{marginTop:0,marginBottom:0},filters:{display:"flex",marginBottom:16},deleteWrapper:{display:"flex",marginLeft:"auto",justifyContent:"flex-end",flexDirection:"row"},entries:{color:se,margin:"auto",marginRight:12},chips:{marginTop:"auto"}},qI=Object(f.a)(WI),$I=Object(f.a)(zI),HI=function(e){var t=e.filters,n=e.onFilterDelete,a=e.deleteAllFilters,r=e.entries,i=qI(),o=$I();return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ke,{className:o.text,children:"Filters:"}),Object(qe.jsxs)("div",{className:o.filters,children:[Object(qe.jsx)("div",{className:o.chips,children:t.map((function(e,t){return Object(qe.jsx)(zr,{classes:i,label:"".concat(zm(e.type),": ").concat(e.value),onDelete:function(){return n(e)},deleteIcon:Object(qe.jsx)(qi,{className:o.button})},t)}))}),Object(qe.jsxs)("div",{className:o.deleteWrapper,children:[Object(qe.jsx)(it,{className:o.entries,children:"".concat(null!==r&&void 0!==r?r:0," entries")}),Object(qe.jsx)(He,{color:"secondary",Icon:MI,InverseIcon:II,className:o.deleteButton,onClick:a,children:"Delete filters"})]})]})]})},VI=Object(f.a)(Vk),UI=function(e){var t=e.data,n=e.locale,a=e.onClick,r=e.loading,i=e.triggers,o=e.customRequests,l=VI(),c=[{header:"Phone",width:199,view:function(e){return xk(e.phone,n.country)}},{header:"Name",width:241,view:vk},{header:"Total TXs",width:126,textAlign:"right",view:function(e){return"".concat(Number.parseInt(e.totalTxs))}},{header:"Total spent",width:152,textAlign:"right",view:function(e){var t;return"".concat(Number.parseFloat(e.totalSpent)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:"")}},{header:"Last active",width:133,view:function(e){var t;return null!==(t=e.lastActive&&Object(sd.a)("yyyy-MM-dd",new Date(e.lastActive)))&&void 0!==t?t:""}},{header:"Last transaction",width:161,textAlign:"right",view:function(e){var t,n=!D.a(e.lastTxFiatCode),a="cashOut"===e.lastTxClass?Wc:Pc,r=Object(qe.jsx)(a,{className:l.txClassIconRight});return Object(qe.jsxs)(qe.Fragment,{children:[n&&"".concat(parseFloat(e.lastTxFiat)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:""),n&&r]})}},{header:"Status",width:191,view:function(e){return Object(qe.jsx)(zu,{statuses:[Ok(e,i,o)]})}}];return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(By,{loading:r,emptyText:"No customers so far",elements:c,data:t,onClick:a})})},GI=n(400),XI={modalTitle:{marginTop:-5,color:J,fontFamily:je},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]}},_I=GI.PhoneNumberUtil.getInstance(),ZI=function(e,t){var n=Aa.a((function(e){var n=_I.parseAndKeepRawInput(t,e);return _I.isValidNumber(n)}),e),a=_I.parseAndKeepRawInput(t,n);return _I.format(a,GI.PhoneNumberFormat.E164)},KI={phoneNumber:""},QI=Object(f.a)(XI),YI=function(e,t){return e&&t&&e.phoneNumber&&t.phoneNumber?e.phoneNumber:null},JI=function(e){var t,n,a=e.showModal,r=e.handleClose,i=e.onSubmit,o=e.locale,l=QI(),c=xd.a(null===o||void 0===o?void 0:o.country,T.a((function(e){return e.country}),null!==(t=null===o||void 0===o?void 0:o.overrides)&&void 0!==t?t:[]));return Object(qe.jsx)(Yh,{closeOnBackdropClick:!0,width:600,height:300,handleClose:r,open:a,children:Object(qe.jsx)(mn.e,{validationSchema:(n=c,xn.f().shape({phoneNumber:xn.h().required("A phone number is required").test("is-valid-number","That is not a valid phone number",(function(e){try{var t=T.a((function(t){var n=_I.parseAndKeepRawInput(e,t);return _I.isValidNumber(n)}),n);return jn.a((function(e){return!0===e}),t)}catch(a){}})).trim()})),initialValues:KI,validateOnChange:!1,onSubmit:function(e){i({variables:{phoneNumber:ZI(c,e.phoneNumber)}})},children:function(e){var t=e.errors,n=e.touched;return Object(qe.jsxs)(mn.d,{id:"customer-registration-form",className:l.form,children:[Object(qe.jsx)(Ue,{className:l.modalTitle,children:"Create new customer"}),Object(qe.jsx)(mn.b,{component:si,name:"phoneNumber",width:338,autoFocus:!0,label:"Phone number"}),Object(qe.jsxs)("div",{className:l.footer,children:[YI(t,n)&&Object(qe.jsx)(rl,{children:YI(t,n)}),Object(qe.jsx)(An,{type:"submit",form:"customer-registration-form",className:l.submit,children:"Finish"})]})]})}})})},eL=x()(TI||(TI=Object(c.a)(["\n query filters {\n customerFilters {\n type\n value\n }\n }\n"]))),tL=x()(RI||(RI=Object(c.a)(["\n query configAndCustomers(\n $phone: String\n $name: String\n $address: String\n $id: String\n ) {\n config\n customers(phone: $phone, name: $name, address: $address, id: $id) {\n id\n idCardData\n phone\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n authorizedOverride\n frontCameraPath\n frontCameraOverride\n idCardPhotoPath\n idCardPhotoOverride\n idCardData\n idCardDataOverride\n usSsn\n usSsnOverride\n sanctions\n sanctionsOverride\n daysSuspended\n isSuspended\n customInfoRequests {\n customerId\n infoRequestId\n override\n overrideAt\n overrideBy\n customerData\n customInfoRequest {\n id\n enabled\n customRequest\n }\n }\n }\n customInfoRequests {\n id\n }\n }\n"]))),nL=x()(BI||(BI=Object(c.a)(["\n mutation createCustomer($phoneNumber: String) {\n createCustomer(phoneNumber: $phoneNumber) {\n phone\n }\n }\n"]))),aL=Object(f.a)(yf),rL=function(e){return gs.a((function(e,t){return Object(s.a)(Object(s.a)({},e),{},Object(z.a)({},t.type,t.value))}),{},e)},iL=function(){var e,t,n=aL(),r=Object(w.h)(),i=Object(a.useState)([]),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)({}),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)([]),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(!1),x=Object(l.a)(O,2),v=x[0],y=x[1],C=Object(u.c)(tL,{variables:h,onCompleted:function(e){return s(A.a(["customers"])(e))}}),k=C.data,E=C.loading,N=C.refetch,S=Object(u.c)(eL),I=S.data,L=S.loading,F=Object(u.b)(nL,{onCompleted:function(){return y(!1)},refetchQueries:function(){return[{query:tL,variables:h}]}}),P=Object(l.a)(F,1)[0],D=null!==(e=A.a(["config"])(k))&&void 0!==e?e:[],T=null!==(t=A.a(["customInfoRequests"],k))&&void 0!==t?t:[],B=D&&ss(es,D),W=D&&ss(is,D),z=hm.a([Uw.a((function(e){var t;return new Date(null!==(t=R.a("lastActive",e))&&void 0!==t?t:"0")}))])(null!==c&&void 0!==c?c:[]),q=A.a(["customerFilters"])(I);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ll,{title:"Customers",appendix:Object(qe.jsx)("div",{className:n.buttonsWrapper,children:Object(qe.jsx)(CI,{loading:L,filters:j,options:q,inputPlaceholder:"Search customers",onChange:function(e){var t=rL(e);g(e),p({phone:t.phone,name:t.name,address:t.address,id:t.id}),N&&N()}})}),appendixRight:Object(qe.jsx)(tl.a,{display:"flex",children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){return y(!0)},children:"Add new user"})}),labels:[{label:"Cash-in",icon:Object(qe.jsx)(Pc,{})},{label:"Cash-out",icon:Object(qe.jsx)(Wc,{})}]}),j.length>0&&Object(qe.jsx)(HI,{entries:z.length,filters:j,onFilterDelete:function(e){var t=M.a((function(t){return!bI.a(Gm.a(["type","value"],t),e)}))(j);g(t);var n=rL(t);p({phone:n.phone,name:n.name,address:n.address,id:n.id}),N&&N()},deleteAllFilters:function(){g([]);var e=rL([]);p({phone:e.phone,name:e.name,address:e.address,id:e.id}),N&&N()}}),Object(qe.jsx)(UI,{data:z,locale:B,onClick:function(e){return r.push("/compliance/customer/".concat(e.id))},loading:E,triggers:W,customRequests:T}),Object(qe.jsx)(JI,{showModal:v,handleClose:function(){return y(!1)},locale:B,onSubmit:P})]})},oL=n(975),lL=Object(oL.a)({wrapper:{display:"flex",alignItems:"center"},colorIndicator:{borderRadius:3,height:12,width:12,marginRight:8}}),cL=function(e){var t=e.className,n=e.label,a=e.color,r=Object(q.a)(e,["className","label","color"]),i=lL();return Object(qe.jsxs)("div",Object(s.a)(Object(s.a)({className:I()(i.wrapper,t)},r),{},{children:[a&&Object(qe.jsx)("div",{className:i.colorIndicator,style:{backgroundColor:a}}),Object(qe.jsx)(at,Object(s.a)(Object(s.a)({},r),{},{children:n}))]}))},sL=Me.label1,dL=Me.mono,uL={wrapper:{display:"flex",flex:1,flexDirection:"row",height:"100%"},main:{display:"flex",flex:1},firstSide:{margin:"0 ".concat(64,"px 0 ").concat(48,"px")},secondSide:{marginTop:-29},error:{color:he},coinTotal:{margin:"".concat(12,"px 0")},leftSpacer:{marginLeft:8},topSpacer:{marginTop:40},addressWrapper:{display:"flex",flexDirection:"column",flex:1,backgroundColor:re},address:{width:375,margin:"".concat(12,"px ").concat(24,"px")},itemWrapper:{textAlign:"end"},item:{extend:sL,margin:2},inactiveItem:{color:$},firstItem:{fontWeight:700,margin:2},total:{marginTop:"auto",textAlign:"right",marginRight:24},totalPending:{marginTop:2},totalTitle:{color:me,marginBottom:2},table:{marginTop:8,marginLeft:48},tableLabel:{justifyContent:"end",marginTop:-38},pending:{backgroundColor:le},copyToClipboard:{marginLeft:"auto",paddingTop:6,paddingLeft:15,marginRight:-11},mono:{extend:dL,width:375,margin:"".concat(12,"px ").concat(24,"px")}},mL=Object(f.a)(uL),hL=165,pL=140,bL=130,fL=x()(AI||(AI=Object(c.a)(["\n {\n funding {\n cryptoCode\n errorMsg\n fundingAddress\n fundingAddressUrl\n confirmedBalance\n pending\n fiatConfirmedBalance\n fiatPending\n fiatCode\n display\n unitScale\n }\n }\n"]))),jL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Pf.utils.formatCryptoAddress(e,t).replace(/(.{4})/g,"$1 ")},gL=function(e,t){return e.plus(t)},OL=function(e){return new $c.a(e).toFormat(2)},xL=function(e){return OL(e.filter((function(e){return!e.errorMsg})).map((function(e){return new $c.a(e.fiatConfirmedBalance)})).reduce(gL,new $c.a(0)))},vL=function(){var e,t=Object(a.useState)(null),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(!1),c=Object(l.a)(o,1)[0],s=mL(),d=[{cryptoAmount:2,balance:10.23,fiatValue:1e3,date:new Date,performedBy:null,pending:!0},{cryptoAmount:10,balance:12.23,fiatValue:12e3,date:new Date,performedBy:null},{cryptoAmount:5,balance:5,fiatValue:5e4,date:new Date,performedBy:null}],m=Object(u.c)(fL),h=m.data,p=m.loading,b=null!==(e=A.a(["funding"])(h))&&void 0!==e?e:[];b.length&&!r&&i(b[0]);var f=OL(b.filter((function(e){return!e.errorMsg})).map((function(e){return new $c.a(e.fiatPending)})).reduce(gL,new $c.a(0))),j=function(e){return e>=0?"+":""};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{children:Object(qe.jsx)(yn,{children:"Funding"})}),Object(qe.jsxs)("div",{className:s.wrapper,children:[Object(qe.jsx)(Si,{data:b,isSelected:function(e){return r&&r.cryptoCode===e.cryptoCode},onClick:i,displayName:function(e){return e.display},itemRender:function(e,t){var n,a,r=(n={},Object(z.a)(n,s.item,!0),Object(z.a)(n,s.inactiveItem,!t),n),i=(a={},Object(z.a)(a,s.itemWrapper,!0),Object(z.a)(a,s.error,e.errorMsg),a);return Object(qe.jsxs)("div",{className:I()(i),children:[Object(qe.jsx)("div",{className:s.firstItem,children:e.display}),!e.errorMsg&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:I()(r),children:[OL(e.fiatConfirmedBalance)," ",e.fiatCode]}),Object(qe.jsxs)("div",{className:I()(r),children:[e.confirmedBalance," ",e.cryptoCode]})]})]})},loading:p,children:b.length&&Object(qe.jsxs)("div",{className:s.total,children:[Object(qe.jsx)(at,{className:s.totalTitle,children:"Total Crypto Balance"}),Object(qe.jsxs)(Qe,{noMargin:!0,children:[xL(b),b[0].fiatCode]}),Object(qe.jsxs)(at,{className:s.totalPending,children:["(",j(f)," ",f," pending)"]})]})}),r&&!c&&r.errorMsg&&Object(qe.jsx)("div",{className:s.main,children:Object(qe.jsx)("div",{className:s.firstSide,children:Object(qe.jsx)(Je,{className:s.error,children:L.a("ECONNREFUSED",r.errorMsg)?"Couldn't establish connection with the node. Make sure it is installed and try again":r.errorMsg})})}),r&&!c&&!r.errorMsg&&Object(qe.jsxs)("div",{className:s.main,children:[Object(qe.jsxs)("div",{className:s.firstSide,children:[Object(qe.jsxs)(Xe,{children:["Balance (",r.display,")"]}),Object(qe.jsxs)("div",{className:s.coinTotal,children:[Object(qe.jsx)(Qe,{inline:!0,noMargin:!0,children:"".concat(r.confirmedBalance," ").concat(r.cryptoCode)}),Object(qe.jsx)(Ye,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(j(r.pending)," ").concat(r.pending," pending)")})]}),Object(qe.jsxs)("div",{className:s.coinTotal,children:[Object(qe.jsx)(Je,{inline:!0,noMargin:!0,children:"= ".concat(OL(r.fiatConfirmedBalance)," ").concat(r.fiatCode)}),Object(qe.jsx)(it,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(j(r.fiatPending)," ").concat(OL(r.fiatPending)," pending)")})]}),Object(qe.jsx)(Xe,{className:s.topSpacer,children:"Address"}),Object(qe.jsx)("div",{className:s.addressWrapper,children:Object(qe.jsx)("div",{className:s.mono,children:Object(qe.jsx)("strong",{children:Object(qe.jsx)(If,{buttonClassname:s.copyToClipboard,children:jL(r.cryptoCode,r.fundingAddress)},r.cryptoCode)})})})]}),Object(qe.jsxs)("div",{className:s.secondSide,children:[Object(qe.jsxs)(at,{children:["Scan to send ",r.display]}),Object(qe.jsx)(pn.a,{size:240,fgColor:J,value:r.fundingAddressUrl})]})]}),r&&c&&Object(qe.jsxs)("div",{children:[Object(qe.jsx)(cL,{className:s.tableLabel,label:"Pending",color:"#cacaca"}),Object(qe.jsxs)(wm,{className:s.table,children:[Object(qe.jsxs)(Cm,{children:[Object(qe.jsx)(Nm,{header:!0,width:hL,children:"Amount Entered"}),Object(qe.jsx)(Nm,{header:!0,width:hL,children:"Balance After"}),Object(qe.jsx)(Nm,{header:!0,width:hL,children:"Cash Value"}),Object(qe.jsx)(Nm,{header:!0,width:bL,children:"Date"}),Object(qe.jsx)(Nm,{header:!0,width:pL,children:"Time (h:m:s)"}),Object(qe.jsx)(Nm,{header:!0,width:hL,children:"Performed By"})]}),Object(qe.jsx)(Em,{children:d.map((function(e,t){return Object(qe.jsxs)(Lm,{className:I()(Object(z.a)({},s.pending,e.pending)),children:[Object(qe.jsxs)(Nm,{width:hL,children:[e.cryptoAmount," ",r.cryptoCode]}),Object(qe.jsxs)(Nm,{width:hL,children:[e.balance," ",r.cryptoCode]}),Object(qe.jsxs)(Nm,{width:hL,children:[e.fiatValue," ",r.fiatCode]}),Object(qe.jsx)(Nm,{width:bL,children:Object(sd.a)("yyyy-MM-dd",e.date)}),Object(qe.jsx)(Nm,{width:pL,children:Object(sd.a)("hh:mm:ss",e.date)}),Object(qe.jsx)(Nm,{width:hL,children:"add"})]},t)}))})]})]})]})]})};function yL(){return(yL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var CL=a.createElement("circle",{cx:52,cy:32,r:32,fill:"#F7931A"}),kL=a.createElement("path",{d:"m66.1 27.4c0.6-4.3-2.6-6.5-7-8.1l1.4-5.8-3.5-0.9-1.4 5.6c-0.9-0.2-1.9-0.4-2.8-0.7l1.4-5.7-3.5-0.9-1.4 5.8c-0.8-0.2-1.5-0.3-2.2-0.5l0 0-4.8-1.2-0.9 3.8s2.6 0.6 2.6 0.6c1.4 0.4 1.7 1.3 1.6 2l-1.6 6.6c0.1 0 0.2 0.1 0.4 0.1-0.1 0-0.2-0.1-0.4-0.1l-2.3 9.2c-0.2 0.4-0.6 1.1-1.6 0.8 0 0.1-2.6-0.6-2.6-0.6l-1.7 4 4.6 1.1c0.9 0.2 1.7 0.4 2.5 0.6l-1.5 5.8 3.5 0.9 1.4-5.8c1 0.3 1.9 0.5 2.8 0.7l-1.4 5.7 3.5 0.9 1.5-5.8c6 1.1 10.5 0.7 12.4-4.7 1.5-4.4-0.1-6.9-3.2-8.5 2.3-0.5 4-2 4.5-5.2zm-8 11.2c-1.1 4.4-8.4 2-10.8 1.4l1.9-7.7c2.4 0.6 10 1.8 8.9 6.3zm1.1-11.3c-1 4-7.1 2-9.1 1.5l1.7-7c2 0.5 8.4 1.4 7.3 5.6z",fill:"#FFF"});function EL(e,t){var n=e.title,r=e.titleId,i=wL(e,["title","titleId"]);return a.createElement("svg",yL({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,CL,kL)}var NL=a.forwardRef(EL);n.p;function SL(){return(SL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function IL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var LL=a.createElement("path",{fill:"#0AC18E",d:"m0,0l29.7,0a39,39,0,0,0,0,64l-29.7,0zm52,0a32,32,0,0,0,0,64a32,32,0,0,0,0,-64m52,0l-29.7,0a39,39,0,0,1,0,64l29.7,0z"}),FL=a.createElement("path",{fill:"#FFF",transform:"rotate(-28 52 32)",d:"m66.103,27.444c0.637-4.258-2.605-6.547-7.038-8.074l1.438-5.768-3.511-0.875-1.4,5.616c-0.923-0.23-1.871-0.447-2.813-0.662l1.41-5.653-3.509-0.875-1.439,5.766c-0.764-0.174-1.514-0.346-2.242-0.527l0.004-0.018-4.842-1.209-0.934,3.75s2.605,0.597,2.55,0.634c1.422,0.355,1.679,1.296,1.636,2.042l-1.638,6.571c0.098,0.025,0.225,0.061,0.365,0.117-0.117-0.029-0.242-0.061-0.371-0.092l-2.296,9.205c-0.174,0.432-0.615,1.08-1.609,0.834,0.035,0.051-2.552-0.637-2.552-0.637l-1.743,4.019,4.569,1.139c0.85,0.213,1.683,0.436,2.503,0.646l-1.453,5.834,3.507,0.875,1.439-5.772c0.958,0.26,1.888,0.5,2.798,0.726l-1.434,5.745,3.511,0.875,1.453-5.823c5.987,1.133,10.489,0.676,12.384-4.739,1.527-4.36-0.076-6.875-3.226-8.515,2.294-0.529,4.022-2.038,4.483-5.155zm-8.022,11.249c-1.085,4.36-8.426,2.003-10.806,1.412l1.928-7.729c2.38,0.594,10.012,1.77,8.878,6.317zm1.086-11.312c-0.99,3.966-7.1,1.951-9.082,1.457l1.748-7.01c1.982,0.494,8.365,1.416,7.334,5.553z"});function PL(e,t){var n=e.title,r=e.titleId,i=IL(e,["title","titleId"]);return a.createElement("svg",SL({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,LL,FL)}var DL=a.forwardRef(PL);n.p;function TL(){return(TL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function RL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var BL=a.createElement("circle",{cx:1e3,cy:1e3,r:1e3,fill:"#2573c2"}),AL=a.createElement("g",{fill:"#fff"},a.createElement("path",{d:"M1652.6 736.8a143.65 143.65 0 0 0-19.2-63.6c-10-20-27.8-35.6-48.6-43.6a143.51 143.51 0 0 0-68.4-15H628.8l-63.6 190.6h804.2l-127 389.6h-804l-63.6 190.6h891.8a246.33 246.33 0 0 0 77.8-15c25-14.2 53.6-28.6 77.8-48.6a382.69 382.69 0 0 0 63.6-63.6 432.2 432.2 0 0 0 39.2-73.4l117.8-370.4a137.38 137.38 0 0 0 9.8-77.6z"}),a.createElement("path",{d:"M882.2 911.6H409l-63.6 176.2h478z"}));function ML(e,t){var n=e.title,r=e.titleId,i=RL(e,["title","titleId"]);return a.createElement("svg",TL({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,BL,AL)}var WL=a.forwardRef(ML);n.p;function zL(){return(zL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function qL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var $L=a.createElement("g",null,a.createElement("polygon",{fill:"#343434",points:"127.9611 0 125.1661 9.5 125.1661 285.168 127.9611 287.958 255.9231 212.32"}),a.createElement("polygon",{fill:"#8C8C8C",points:"127.962 0 0 212.32 127.962 287.959 127.962 154.158"}),a.createElement("polygon",{fill:"#3C3C3B",points:"127.9611 312.1866 126.3861 314.1066 126.3861 412.3056 127.9611 416.9066 255.9991 236.5866"}),a.createElement("polygon",{fill:"#8C8C8C",points:"127.962 416.9052 127.962 312.1852 0 236.5852"}),a.createElement("polygon",{fill:"#141414",points:"127.9611 287.9577 255.9211 212.3207 127.9611 154.1587"}),a.createElement("polygon",{fill:"#393939",points:"0.0009 212.3208 127.9609 287.9578 127.9609 154.1588"}));function HL(e,t){var n=e.title,r=e.titleId,i=qL(e,["title","titleId"]);return a.createElement("svg",zL({width:"256px",height:"417px",viewBox:"0 0 256 417",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",preserveAspectRatio:"xMidYMid",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,$L)}var VL=a.forwardRef(HL);n.p;function UL(){return(UL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function GL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var XL=a.createElement("circle",{fill:"#989898",cx:52,cy:32,r:32}),_L=a.createElement("path",{fill:"#FFF",d:"m46.92598,12.31703l-4.97801,18.8088l-3.42705,1.32711l-1.64691,6.17189l3.42705,-1.29514l-2.8461,10.76083l30.60893,0l2.09993,-7.98401l-18.42505,0l2.09993,-7.82412l3.3631,-1.26316l1.6469,-6.17188l-3.36309,1.29513l3.6509,-13.83611l-12.21053,0z"});function ZL(e,t){var n=e.title,r=e.titleId,i=GL(e,["title","titleId"]);return a.createElement("svg",UL({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,XL,_L)}var KL=a.forwardRef(ZL);n.p;function QL(){return(QL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function YL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var JL=a.createElement("path",{d:"M127.998 0C57.318 0 0 57.317 0 127.999c0 14.127 2.29 27.716 6.518 40.43H44.8V60.733l83.2 83.2 83.198-83.2v107.695h38.282c4.231-12.714 6.521-26.303 6.521-40.43C256 57.314 198.681 0 127.998 0",fill:"#F60"}),eF=a.createElement("path",{d:"M108.867 163.062l-36.31-36.311v67.765H18.623c22.47 36.863 63.051 61.48 109.373 61.48s86.907-24.617 109.374-61.48h-53.933V126.75l-36.31 36.31-19.13 19.129-19.128-19.128h-.002z",fill:"#4C4C4C"});function tF(e,t){var n=e.title,r=e.titleId,i=YL(e,["title","titleId"]);return a.createElement("svg",QL({width:2500,height:2500,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,JL,eF)}var nF=a.forwardRef(tF);n.p;function aF(){return(aF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function rF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var iF=a.createElement("style",{type:"text/css"},"\n\t.st0{fill:#231F20;}\n\t.st1{fill:#F4B728;}\n"),oF=a.createElement("path",{className:"st0",d:"M245.4,20C121.1,20,20,121.1,20,245.4s101.1,225.4,225.4,225.4s225.4-101.1,225.4-225.4S369.7,20,245.4,20z M245.4,433.6c-103.8,0-188.2-84.4-188.2-188.2S141.6,57.2,245.4,57.2s188.2,84.4,188.2,188.2S349.2,433.6,245.4,433.6z"}),lF=a.createElement("circle",{className:"st1",cx:245.4,cy:245.4,r:177.6}),cF=a.createElement("polygon",{className:"st0",points:"165,315.5 165,349.9 226.5,349.9 226.5,387.6 264.3,387.6 264.3,349.9 325.8,349.9 325.8,304.4 230.4,304.4 325.8,175 325.8,140.6 264.3,140.6 264.3,103 226.5,103 226.5,140.6 165,140.6 165,186.2 260.4,186.2 "});function sF(e,t){var n=e.title,r=e.titleId,i=rF(e,["title","titleId"]);return a.createElement("svg",aF({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 493.3 490.2",style:{enableBackground:"new 0 0 493.3 490.2"},xmlSpace:"preserve",ref:t,"aria-labelledby":r},i),iF,void 0===n?a.createElement("title",{id:r},"headerArtboard 7"):n?a.createElement("title",{id:r},n):null,oF,lF,cF)}var dF,uF,mF,hF,pF,bF,fF,jF,gF,OF=a.forwardRef(sF),xF=(n.p,Object(f.a)({logo:{maxHeight:80,maxWidth:200},title:{margin:[[24,0,32,0]]},text:{margin:0},button:{marginTop:"auto",marginBottom:58},modalContent:{display:"flex",flexDirection:"column",alignItems:"center",padding:[[0,42]],flex:1}})),vF=function(e){var t=e.code,n=e.name,a=e.onContinue,r=xF(),i=function(e){switch(e){case"BTC":return NL;case"BCH":return DL;case"DASH":return WL;case"ETH":return VL;case"LTC":return KL;case"ZEC":return OF;case"XMR":return nF;default:return null}}(t);return Object(qe.jsxs)("div",{className:r.modalContent,children:[Object(qe.jsx)(i,{className:r.logo}),Object(qe.jsxs)(Ue,{className:r.title,children:["Enable ",n]}),Object(qe.jsxs)(Ke,{className:r.text,children:["You are about to enable ",n," on your system. This will allow you to use this cryptocurrency on your machines. To be able to do that, you\u2019ll have to set up all the necessary 3rd party services."]}),Object(qe.jsx)(An,{className:r.button,onClick:a,children:"Start configuration"})]})},yF={title:{margin:[[0,0,12,0]]},subtitle:{margin:[[32,0,21,0]]},error:{color:he},button:{marginLeft:"auto"},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},radioGroup:{flexDirection:"row"},radioLabel:{width:150,height:48},radio:{padding:4,margin:4},setupNew:{display:"flex",alignItems:"center",height:48},picker:{width:150},horizontalAlign:{display:"flex",flexDirection:"row"},centerAlignment:{alignItems:"center"},zeroConfLimit:{marginRight:5,"& > div":{fontSize:xe,fontFamily:je,fontWeight:300,"& > input":{padding:[[6,0,2]]}}}},wF=Object(f.a)(yF),CF={form:null,selected:null,isNew:!1,iError:!1},kF=function(e,t){switch(t.type){case"select":return{form:null,selected:t.selected,isNew:null,iError:!1};case"new":return{form:e.form,selected:null,isNew:!0,iError:!1};case"form":return{form:t.form,selected:t.form.code,isNew:!0,iError:!1};case"error":return Gn.a(e,{innerError:!0});case"reset":return CF;default:throw new Error}},EF=function(e){var t,n=e.type,r=e.schema,i=e.coin,o=e.name,c=e.error,s=e.step,d=e.maxSteps,u=e.lastStep,m=e.isLastStep,h=e.onContinue,p=e.fiatCurrency,b=e.filled,f=e.unfilled,j=e.getValue,g=wF(),O=Object(a.useReducer)(kF,CF),x=Object(l.a)(O,2),v=x[0],y=v.innerError,w=v.selected,C=v.form,k=v.isNew,E=x[1];Object(a.useEffect)((function(){E({type:"reset"})}),[s]);var N=function(e,t){if(!e||!e[n])return E({type:"error"});h(e,t)},S=m?"Finish":"Next",L=null!==o&&void 0!==o?o:n,F=(t={},Object(z.a)(t,g.subtitle,!0),Object(z.a)(t,g.error,y),t);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{className:g.title,children:$m(L)}),Object(qe.jsx)(bp,{steps:u,currentStep:s}),Object(qe.jsx)(_e,{className:I()(F),children:s<d-1?"Select a ".concat(L," or set up a new one"):"Select ".concat(L," for ").concat(i)}),!(m&&s===d)&&Object(qe.jsx)(Er,{options:b,value:w,className:g.radioGroup,onChange:function(e,t){E({type:"select",selected:t})},labelClassName:g.radioLabel,radioClassName:g.radio}),"zeroConfLimit"===n&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!0,initialValues:{zeroConfLimit:""},enableReinitialize:!0,validationSchema:r,children:function(e){e.values;var t=e.setFieldValue;return Object(qe.jsx)(mn.d,{children:Object(qe.jsxs)("div",{className:I()(g.horizontalAlign,g.lineAlignment),children:[Object(qe.jsx)(mn.b,{component:oi,decimalPlaces:0,width:50,placeholder:"0",name:"zeroConfLimit",onChange:function(e){E({type:"select",selected:e.target.value}),t(e.target.id,e.target.value)},className:g.zeroConfLimit}),Object(qe.jsx)(Ye,{children:p})]})})}}),Object(qe.jsxs)("div",{className:g.setupNew,children:[!Wa.a(f)&&!D.a(f)&&Object(qe.jsx)(Er,{value:k,onChange:function(e,t){E({type:"new"})},labelClassName:g.radioLabel,radioClassName:g.radio,options:[{display:"Set up new",code:!0}]}),k&&Object(qe.jsx)(_a,{fullWidth:!0,label:"Select ".concat(L),className:g.picker,getOptionSelected:qa.a("code"),labelProp:"display",options:f,onChange:function(e,t){E({type:"form",form:t})}})]}),C&&Object(qe.jsx)(nx,{save:function(e){return N(Object(z.a)({},n,C.code),Object(z.a)({},C.code,e))},elements:qx[C.code].elements,validationSchema:qx[C.code].validationSchema,value:j(C.code),buttonLabel:S}),!C&&Object(qe.jsxs)("div",{className:g.submit,children:[c&&Object(qe.jsx)(rl,{children:"Failed to save"}),Object(qe.jsx)(An,{className:g.button,onClick:function(){return N(Object(z.a)({},n,w))},children:S})]})]})},NF=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return F.a(bl.a(e),R.a("cryptos"))}(e)(n)}))},SF=M.a((function(e){return!e.deprecated})),IF=function(e,t,n,a){var r=SF(NF(a,n)(e)),i=Os.a((function(e){var n=e.code,a=function(e){return t&&t[e]}(n);return!qx[n]||(0,qx[n].getValidationSchema)(a).isValidSync(a)}))(r),o=Object(l.a)(i,2);return{filled:o[0],unfilled:o[1]}},LF=function(e){var t=e.coin,n=e.onClose,r=e.accountsConfig,i=e.accounts,o=e.fiatCurrency,c=e.save,d=e.error,u=Object(a.useState)({step:0,config:{active:!0},accountsToSave:{}}),m=Object(l.a)(u,2),h=m[0],p=h.step,b=h.config,f=h.accountsToSave,j=m[1],g="Enable ".concat(t.display),O={filled:NF(t.code,"ticker")(r)},x=IF(r,i,"wallet",t.code),v=IF(r,i,"exchange",t.code),y=IF(r,i,"zeroConf",t.code),w=[Object(s.a)({type:"ticker"},O),Object(s.a)({type:"wallet"},x),Object(s.a)({type:"exchange"},v)],C=!Wa.a(y.filled)||!D.a(y.unfilled)&&!Wa.a(y.unfilled)?ml.a(w,[Object(s.a)({type:"zeroConf",name:"confidence checking",schema:xn.f().shape({zeroConfLimit:xn.e().required()})},y),{type:"zeroConfLimit",name:"0-conf limit"}]):w,k=C.length,E=p===k,N=p>0?C[p-1]:null,S=function(){var e=Object(Bl.a)(Rl.a.mark((function e(n,a){var r,i,o,l;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Gn.a(b,n),i=a?Gn.a(f,a):f,!E){e.next=6;break}return o=Uj.a(Hc.a(Pf.utils.getCryptoCurrency(t.code).units)),l=Object(s.a)(Object(s.a)({},r),{},{cryptoUnits:o}),e.abrupt("return",c(ds(t.code,l),i));case 6:j({step:p+1,config:r,accountsToSave:i});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(qe.jsxs)(Yh,{title:0===p?null:g,handleClose:n,width:554,open:!0,children:[0===p&&Object(qe.jsx)(vF,{code:t.code,name:t.display,onContinue:function(){return S()}}),0!==p&&Object(qe.jsx)(EF,Object(s.a)(Object(s.a)({coin:t.display,fiatCurrency:o,error:d,step:p,maxSteps:5,lastStep:k,isLastStep:E},N),{},{onContinue:S,getValue:function(e){return Aa.a(W.a("code",e))(i)}}))]})},FF=Object(f.a)({rightAligned:{marginTop:"20px",marginLeft:"auto",marginBottom:"20px"},rightLink:{marginLeft:"20px"}}),PF=x()(dF||(dF=Object(c.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n currencies {\n code\n display\n }\n countries {\n code\n display\n }\n cryptoCurrencies {\n code\n display\n }\n languages {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),DF=x()(uF||(uF=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),TF=function(e){var t=e.open,n=e.close,a=e.save,r=FF();return Object(qe.jsxs)(Yh,{title:"Change fiat currency?",handleClose:n,width:450,height:310,open:t,children:[Object(qe.jsx)(Ke,{children:"Please note that all values you set that were based on your prior fiat currency are still the same. If you need to adjust these to reflect the new fiat currency (such as minimum transaction amounts, fixed fees, and compliance triggers, for example), please do so now."}),Object(qe.jsx)(Ke,{children:"Also, if you have cash-out enabled, you must define new dispenser bill counts for the new currency for cash-out on the new currency to work."}),Object(qe.jsxs)("div",{className:r.rightAligned,children:[Object(qe.jsx)(oa,{onClick:n,color:"secondary",children:"Cancel"}),Object(qe.jsx)(oa,{className:r.rightLink,onClick:a,color:"primary",children:"Save"})]})]})},RF=function(e){var t,n,r,i,o,c,s=e.name,d=Object(a.useState)(!1),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1],w=Object(a.useState)(!1),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],L=S[1],P=Object(u.c)(PF).data,D=Object(u.b)(DF,{onCompleted:function(){return p(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return y(e)}}),T=Object(l.a)(D,1)[0],R=Object(a.useState)(null),B=Object(l.a)(R,2),A=B[0],M=B[1],z=(null===P||void 0===P?void 0:P.config)&&ss(s)(P.config),q=(null===P||void 0===P?void 0:P.config)&&ss(Qc)(P.config),$=null===P||void 0===P?void 0:P.accountsConfig,H=null!==(t=null===P||void 0===P?void 0:P.accounts)&&void 0!==t?t:[],V=null!==(n=null===P||void 0===P?void 0:P.cryptoCurrencies)&&void 0!==n?n:[],U=z&&!Wa.a(z)?z:fO,G=null!==(r=U.overrides)&&void 0!==r?r:[],X=function(e){return M(null),T({variables:{config:e}})},_=function(e,t,n){var a=Mg.a(t,e)[0];if(!a)return n(t);var r=ss(a)(q);if(!yO.isValidSync(r))return g((function(){return function(){return n(t)}})),void p(a);n(t)};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(TF,{open:A,close:function(){return M(null)},save:function(){return A&&X(A)}}),Object(qe.jsx)(ll,{title:"Locales"}),Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{title:"Default settings",error:null===v||void 0===v?void 0:v.message,titleLg:!0,name:"locale",enableEdit:!0,initialValues:U,save:function(e){var t=ds(s)(e.locale[0]);return z.fiatCurrency&&t.locale_fiatCurrency!==z.fiatCurrency?M(t):X(t)},validationSchema:pO,data:Fw.a(U),elements:mO(P,_),setEditing:function(e,t){return E(t)},forceDisable:I})}),Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{error:null===v||void 0===v?void 0:v.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:jO,save:function(e){var t=ds(s)(e);return y(null),T({variables:{config:t}})},validationSchema:bO,data:null!==G&&void 0!==G?G:[],elements:hO(P,G,_),disableAdd:F.a(Wa.a,Mg.a)(null!==(i=null===P||void 0===P?void 0:P.machines.map((function(e){return e.deviceId})))&&void 0!==i?i:[],null!==(o=null===G||void 0===G?void 0:G.map((function(e){return e.machine})))&&void 0!==o?o:[]),setEditing:function(e,t){return L(t)},forceDisable:k})}),h&&Object(qe.jsx)(LF,{coin:Aa.a(W.a("code",h))(V),onClose:function(){return p(!1)},save:function(e){return X(ds(Qc)(e)).then((function(e){return j(),g(null),e}))},error:null===v||void 0===v?void 0:v.message,cryptoCurrencies:V,userAccounts:null===P||void 0===P||null===(c=P.config)||void 0===c?void 0:c.accounts,accounts:H,accountsConfig:$})]})},BF={identification:{display:"flex",flexDirection:"row",alignItems:"center","& > *:first-child":{marginLeft:0},"& > *":{marginLeft:6},"& > *:nth-child(3)":{marginLeft:15}},form:{display:"flex",flexDirection:"column",height:"100%","& > *:first-child":{marginTop:10},"& > *":{marginBottom:20}},customerAutocomplete:{width:350},discountRateWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},discountInput:{display:"flex",flexDirection:"row",alignItems:"center"},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},submit:{margin:[["auto",0,0,"auto"]]},error:{color:he}},AF=Object(f.a)(BF),MF={customer:"",discount:""},WF=xn.f().shape({customer:xn.h().required("A customer is required!"),discount:xn.e().required("A discount rate is required!").min(0,"Discount rate should be a positive number!").max(100,"Discount rate should have a maximum value of 100%!")}),zF=function(e,t,n){return e&&t?n?"Internal server error":e.customer&&t.customer?e.customer:e.discount&&t.discount?e.discount:null:null},qF=function(e){var t=e.showModal,n=e.setShowModal,a=e.onClose,r=e.creationError,i=e.addDiscount,o=e.customers,l=AF();return Object(qe.jsx)(qe.Fragment,{children:t&&Object(qe.jsx)(Yh,{title:"Add individual customer discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:a,open:!0,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:MF,validationSchema:WF,onSubmit:function(e){!function(e,t){i({variables:{customerId:e,discount:parseInt(t)}}),n(!1)}(e.customer,e.discount)},children:function(e){var t=e.errors,n=e.touched;return Object(qe.jsxs)(mn.d,{id:"individual-discount-form",className:l.form,children:[Object(qe.jsx)("div",{className:l.customerAutocomplete,children:Object(qe.jsx)(mn.b,{name:"customer",label:"Select a customer",component:Br,fullWidth:!0,options:T.a((function(e){var t,n,a,r,i,o;return{code:e.id,display:"".concat(null!==(t=null===e||void 0===e||null===(n=e.idCardData)||void 0===n?void 0:n.firstName)&&void 0!==t?t:"").concat((null===e||void 0===e||null===(a=e.idCardData)||void 0===a?void 0:a.firstName)&&(null===e||void 0===e||null===(r=e.idCardData)||void 0===r?void 0:r.lastName)?" ":"").concat(null!==(i=null===e||void 0===e||null===(o=e.idCardData)||void 0===o?void 0:o.lastName)&&void 0!==i?i:""," (").concat(e.phone,")")}}))(o),labelProp:"display",valueProp:"code"})}),Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:l.discountRateWrapper,children:[Object(qe.jsx)(Xe,{children:"Define discount rate"}),Object(qe.jsxs)(Np,{width:304,children:[Object(qe.jsx)(Ke,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(qe.jsx)(Ke,{children:"For instance, if you charge 8% commissions, and this code is set for 50%, then you'll instead be charging 4% on transactions using the code."})]})]}),Object(qe.jsxs)("div",{className:l.discountInput,children:[Object(qe.jsx)(mn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:l.discountInputField,component:oi}),Object(qe.jsx)(tt,{inline:!0,className:l.inputLabel,children:"%"})]})]}),Object(qe.jsxs)("div",{className:l.footer,children:[zF(t,n,r)&&Object(qe.jsx)(rl,{children:zF(t,n,r)}),Object(qe.jsx)(An,{type:"submit",form:"individual-discount-form",className:l.submit,children:"Add discount"})]})]})}})})})},$F=Object(f.a)(BF),HF=x()(mF||(mF=Object(c.a)(["\n query individualDiscounts {\n individualDiscounts {\n id\n customerId\n discount\n }\n }\n"]))),VF=x()(hF||(hF=Object(c.a)(["\n mutation deleteIndividualDiscount($discountId: ID!) {\n deleteIndividualDiscount(discountId: $discountId) {\n id\n }\n }\n"]))),UF=x()(pF||(pF=Object(c.a)(["\n mutation createIndividualDiscount($customerId: ID!, $discount: Int!) {\n createIndividualDiscount(customerId: $customerId, discount: $discount) {\n id\n }\n }\n"]))),GF=x()(bF||(bF=Object(c.a)(["\n {\n customers {\n id\n phone\n idCardData\n }\n }\n"]))),XF=function(){var e=$F(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],x=function(){return O(!g)},v=Object(u.c)(HF),y=v.data,w=v.loading,C=Object(u.c)(GF),k=C.data,E=C.loading,N=Object(u.b)(UF,{refetchQueries:function(){return["individualDiscounts"]}}),S=Object(l.a)(N,2),I=S[0],L=S[1].error,F=function(e){var t=A.a(["customers"])(k);return Aa.a(W.a("id",e))(t)},P=Object(u.b)(VF,{onError:function(e){var t=e.message;b(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["individualDiscounts"]}}),T=Object(l.a)(P,1)[0],R=[{header:"Identification",width:312,textAlign:"left",size:"sm",view:function(t){var n=F(t.customerId);return Object(qe.jsxs)("div",{className:e.identification,children:[Object(qe.jsx)(rj,{}),Object(qe.jsx)("span",{children:n.phone})]})}},{header:"Name",width:300,textAlign:"left",size:"sm",view:function(e){var t,n,a=F(e.customerId);return D.a(a.idCardData)?Object(qe.jsx)(qe.Fragment,{children:"-"}):Object(qe.jsx)(qe.Fragment,{children:"".concat(null!==(t=a.idCardData.firstName)&&void 0!==t?t:"").concat(a.idCardData.firstName&&a.idCardData.lastName?" ":"").concat(null!==(n=a.idCardData.lastName)&&void 0!==n?n:"")})}},{header:"Discount rate",width:220,textAlign:"left",size:"sm",view:function(e){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tt,{inline:!0,children:e.discount})," %"]})}},{header:"Revoke",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){i(!0),d({variables:{discountId:e.id}})},children:Object(qe.jsx)(vh,{})})}}],B=w||E;return Object(qe.jsxs)(qe.Fragment,{children:[!B&&!Wa.a(y.individualDiscounts)&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tl.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:x,children:"Add new code"})}),Object(qe.jsx)(By,{elements:R,data:A.a(["individualDiscounts"])(y)}),Object(qe.jsx)(Km,{open:r,onDismissed:function(){i(!1),b(null)},onConfirmed:function(){b(null),T(s)},errorMessage:p})]}),!B&&Wa.a(y.individualDiscounts)&&Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(qe.jsx)(it,{children:"It seems there are no active individual customer discounts on your network."}),Object(qe.jsx)(An,{onClick:x,children:"Add individual discount"})]}),Object(qe.jsx)(qF,{showModal:g,setShowModal:O,onClose:function(){O(!1)},creationError:L,addDiscount:I,customers:A.a(["customers"])(k)})]})},_F={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalLabel1:{marginTop:20},modalLabel2Wrapper:{marginTop:40,display:"flex",flexDirection:"row",justifyContent:"flex-start"},discountInput:{display:"flex",flexDirection:"row",alignItems:"flex-start"},inputLabel:{color:J,fontFamily:je,fontSize:24,marginLeft:8,marginTop:15},tableWidth:{width:620},error:{color:he},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]}},ZF=Object(f.a)(_F),KF={code:"",discount:""},QF=xn.f().shape({code:xn.h().required().trim().max(25),discount:xn.e().required().min(0).max(100)}),YF=function(e){var t=e.showModal,n=e.onClose,a=e.errorMsg,r=e.addCode,i=ZF();return Object(qe.jsx)(qe.Fragment,{children:t&&Object(qe.jsx)(Yh,{title:"Add promo code discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:n,open:!0,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:KF,validationSchema:QF,onSubmit:function(e){!function(e,t){r(Vj.a(e),parseInt(t))}(e.code,e.discount)},children:Object(qe.jsxs)(mn.d,{id:"promo-form",className:i.form,children:[Object(qe.jsx)(Xe,{className:i.modalLabel1,children:"Promo code name"}),Object(qe.jsx)(mn.b,{name:"code",autoFocus:!0,size:"lg",autoComplete:"off",width:338,inputProps:{style:{textTransform:"uppercase"}},component:si}),Object(qe.jsxs)("div",{className:i.modalLabel2Wrapper,children:[Object(qe.jsx)(Xe,{className:i.modalLabel2,children:"Define discount rate"}),Object(qe.jsxs)(Np,{width:304,children:[Object(qe.jsx)(Ke,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(qe.jsx)(Ke,{children:"For instance, if you charge 8% commissions, and this code is set for 50%, then you'll instead be charging 4% on transactions using the code."})]})]}),Object(qe.jsxs)("div",{className:i.discountInput,children:[Object(qe.jsx)(mn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:i.discountInputField,component:oi}),Object(qe.jsx)(tt,{inline:!0,className:i.inputLabel,children:"%"})]}),Object(qe.jsxs)("div",{className:i.footer,children:[a&&Object(qe.jsx)(rl,{children:a}),Object(qe.jsx)(An,{type:"submit",form:"promo-form",className:i.submit,children:"Add code"})]})]})})})})},JF=Object(f.a)(_F),eP="Failed to save",tP=x()(fF||(fF=Object(c.a)(["\n query promoCodes {\n promoCodes {\n id\n code\n discount\n }\n }\n"]))),nP=x()(jF||(jF=Object(c.a)(["\n mutation deletePromoCode($codeId: ID!) {\n deletePromoCode(codeId: $codeId) {\n id\n }\n }\n"]))),aP=x()(gF||(gF=Object(c.a)(["\n mutation createPromoCode($code: String!, $discount: Int!) {\n createPromoCode(code: $code, discount: $discount) {\n id\n code\n discount\n }\n }\n"]))),rP=function(){var e=JF(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(null),j=Object(l.a)(f,2),g=j[0],O=j[1],x=function(){return b(!p)},v=Object(u.c)(tP),y=v.data,w=v.loading,C=Object(u.b)(nP,{onError:function(e){var t=e.message;O(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["promoCodes"]}}),k=Object(l.a)(C,1)[0],E=Object(u.b)(aP,{refetchQueries:function(){return["promoCodes"]}}),N=Object(l.a)(E,1)[0],S=[{header:"Code",width:300,textAlign:"left",size:"sm",view:function(e){return e.code}},{header:"Discount",width:220,textAlign:"left",size:"sm",view:function(e){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tt,{inline:!0,children:e.discount})," % in commissions"]})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){i(!0),d({variables:{codeId:e.id}})},children:Object(qe.jsx)(vh,{})})}}];return Object(qe.jsxs)(qe.Fragment,{children:[!w&&!Wa.a(y.promoCodes)&&Object(qe.jsx)(tl.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:x,children:"Add new code"})}),!w&&!Wa.a(y.promoCodes)&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(By,{elements:S,data:A.a(["promoCodes"])(y)}),Object(qe.jsx)(Km,{open:r,onDismissed:function(){i(!1),O(null)},onConfirmed:function(){O(null),k(s)},errorMessage:g})]}),!w&&Wa.a(y.promoCodes)&&Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(qe.jsx)(it,{children:"Currently, there are no active promo codes on your network."}),Object(qe.jsx)(An,{onClick:x,children:"Add Code"})]}),Object(qe.jsx)(YF,{showModal:p,onClose:function(){O(null),b(!1)},errorMsg:g,addCode:function(e,t){O(null),N({variables:{code:e,discount:t}}).then((function(e){if(!e.errors)return b(!1);var t=jn.a((function(e){return L.a("duplicate",null===e||void 0===e?void 0:e.message)}))(e.errors);O(t?"There is already a promotion with that code!":eP)})).catch((function(e){O(eP),console.log(e)}))}})]})};function iP(){return(iP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function oP(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lP=a.createElement("desc",null,"Created with Sketch."),cP=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-3",transform:"translate(-117.000000, -116.000000)",stroke:"#1B2559",strokeWidth:2},a.createElement("g",{id:"arrow-download-logs",transform:"translate(128.500000, 124.500000) rotate(-90.000000) translate(-128.500000, -124.500000) translate(121.000000, 114.000000)"},a.createElement("polyline",{id:"Path-3",points:"0 13.3571429 7.14285714 20.5 14.2857143 13.3571429"}),a.createElement("line",{x1:7.14285714,y1:.142857143,x2:7.14285714,y2:20.1428571,id:"Path-4"}))));function sP(e,t){var n=e.title,r=e.titleId,i=oP(e,["title","titleId"]);return a.createElement("svg",iP({width:"23px",height:"17px",viewBox:"0 0 23 17",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"arrow download logs"):n?a.createElement("title",{id:r},n):null,lP,cP)}var dP=a.forwardRef(sP),uP=(n.p,n(1104)),mP=n(1153),hP=n(1103),pP=n(1126),bP=n(1102),fP=n(1150),jP=n(1151),gP=n(1152),OP=n(1154);function xP(){return(xP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function vP(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var yP=a.createElement("desc",null,"Created with Sketch."),wP=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},a.createElement("g",{id:"icon/sf-contain-b-copy-5",transform:"translate(30.000000, 197.000000) rotate(-270.000000) translate(-30.000000, -197.000000) translate(20.000000, 187.000000)"},a.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function CP(e,t){var n=e.title,r=e.titleId,i=vP(e,["title","titleId"]);return a.createElement("svg",xP({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,yP,wP)}var kP=a.forwardRef(CP);n.p;function EP(){return(EP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function NP(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var SP=a.createElement("desc",null,"Created with Sketch."),IP=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},a.createElement("g",{id:"icon/sf-contain-b-copy-5",transform:"translate(30.000000, 197.000000) rotate(270.000000) translate(-30.000000, -197.000000) translate(20.000000, 187.000000)"},a.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function LP(e,t){var n=e.title,r=e.titleId,i=NP(e,["title","titleId"]);return a.createElement("svg",EP({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,SP,IP)}var FP,PP,DP,TP,RP=a.forwardRef(LP),BP=(n.p,{wrapper:{height:26,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},button:{outline:"none",extend:Me.label1,border:"none",cursor:"pointer",backgroundColor:"transparent",color:J,zIndex:2},lowerBound:{left:"50%"},upperBound:{right:"50%"},selected:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:H,borderRadius:"50%",position:"absolute",zIndex:1},between:{position:"absolute",width:"100%",height:"100%",zIndex:0,backgroundColor:V},disabled:{color:oe,cursor:"default"}}),AP=Object(f.a)(BP),MP=function(e){var t,n,a,r=e.isLowerBound,i=e.isUpperBound,o=e.isBetween,l=e.isDisabled,c=e.children,s=(Object(q.a)(e,["isLowerBound","isUpperBound","isBetween","isDisabled","children"]),AP()),d=r||i,u=(t={},Object(z.a)(t,s.between,o&&!(r&&i)),Object(z.a)(t,s.lowerBound,r&&!i),Object(z.a)(t,s.upperBound,i&&!r),t),m=(n={},Object(z.a)(n,s.wrapper,!0),Object(z.a)(n,s.selected,d),n),h=(a={},Object(z.a)(a,s.button,!0),Object(z.a)(a,s.disabled,l),a);return Object(qe.jsxs)("div",{className:s.wrapper,children:[Object(qe.jsx)("div",{className:I()(u)}),Object(qe.jsx)("div",{className:I()(m),children:Object(qe.jsx)("button",{className:I()(h),children:c})})]})},WP={wrapper:{display:"flex",flexDirection:"column",alignItems:"center"},button:{outline:"none"},navbar:{extend:Me.p,display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:[[15,15]],color:J,"& button":{display:"flex",alignItems:"center",padding:0,border:"none",backgroundColor:G,cursor:"pointer",borderRadius:"50%",width:20,height:20,position:"relative",overflow:"hidden","& svg":{position:"absolute",left:0}}},table:{borderCollapse:"collapse",width:"100%",color:J,"& tr":{"&:first-child":{paddingLeft:5},"&:last-child":{paddingRight:5}},"& th, & td":{margin:0,padding:[[3,0,3,0]]},"& th":{extend:Me.label2}}},zP=Object(f.a)(WP),qP=function(e){var t=e.minDate,n=e.maxDate,r=e.handleSelect,i=Object(q.a)(e,["minDate","maxDate","handleSelect"]),o=Object(a.useState)(new Date),c=Object(l.a)(o,2),s=c[0],d=c[1],u=zP(),m=Array.from(Array(7)).map((function(e,t){return Object(sd.a)("EEEEE",Object(Sd.a)({days:t},Object(Id.a)(new Date)))})),h=function(e){var t=Object(bs.a)({months:1},e),n=Ru.a(0,Object(fP.a)(Object(jP.a)(e))).reverse(),a=T.a((function(e){return Object(bs.a)({days:e},Object(gP.a)(t))}))(n),r=Ru.a(0,function(e){return Object(bP.a)(e)}(e)),i=T.a((function(t){return Object(Sd.a)({days:t},Object(jP.a)(e))}))(r),o=Object(Sd.a)({months:1},e),l=Ru.a(0,42-a.length-i.length),c=T.a((function(e){return Object(Sd.a)({days:e},Object(jP.a)(o))}))(l);return ml.a(ml.a(a,i),c)},p=function(e,t){return h(e).slice(7*t-7,7*t)};return Object(qe.jsxs)("div",{className:u.wrapper,children:[Object(qe.jsxs)("div",{className:u.navbar,children:[Object(qe.jsx)("button",{className:u.button,onClick:function(){return function(e){var n=Object(bs.a)({months:1},e);d(t?Object(mP.a)(t,n)||Object(hP.a)(t,n)>0?n:s:n)}(s)},children:Object(qe.jsx)(kP,{})}),Object(qe.jsx)("span",{children:"".concat(Object(sd.a)("MMMM",s)," ").concat(Object(sd.a)("yyyy",s))}),Object(qe.jsx)("button",{className:u.button,onClick:function(){return function(e){var t=Object(Sd.a)({months:1},e);d(n?Object(mP.a)(n,t)||Object(hP.a)(t,n)>0?t:s:t)}(s)},children:Object(qe.jsx)(RP,{})})]}),Object(qe.jsxs)("table",{className:u.table,children:[Object(qe.jsx)("thead",{children:Object(qe.jsx)("tr",{children:m.map((function(e,t){return Object(qe.jsx)("th",{children:e},t)}))})}),Object(qe.jsx)("tbody",{children:Ru.a(1,8).map((function(e,a){return Object(qe.jsx)("tr",{children:p(s,e).map((function(e,a){return Object(qe.jsx)("td",{onClick:function(){return r(e,t,n)},children:Object(qe.jsx)(MP,{isDisabled:n&&Object(fs.a)(n,e)||t&&Object(fs.a)(e,t),isLowerBound:Object(OP.a)(i.from,e),isUpperBound:Object(OP.a)(i.to,e),isBetween:Object(fs.a)(i.from,e)&&Object(fs.a)(e,i.to),children:Object(sd.a)("d",e)})},a)}))},a)}))})]})]})},$P=Object(f.a)({wrapper:{backgroundColor:"white",borderRadius:10}}),HP=function(e){var t=e.minDate,n=e.maxDate,r=e.className,i=e.onRangeChange,o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],u=Object(a.useState)(null),m=Object(l.a)(u,2),h=m[0],p=m[1];Object(a.useEffect)((function(){i(s,h)}),[s,i,h]);var b=$P();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)("div",{className:I()(b.wrapper,r),children:Object(qe.jsx)(qP,{from:s,to:h,minDate:t,maxDate:n,handleSelect:function(e,t,n){if(!(n&&Object(uP.a)(n,e)>0||t&&Object(uP.a)(e,t)>0))return s&&!h&&Object(uP.a)(e,s)>0?(p(s),void d(e)):void(s&&!h&&(Object(mP.a)(s,e)||Object(hP.a)(s,e)>0)?p(Object(pP.a)({hours:23,minutes:59,seconds:59,milliseconds:999},e)):(d(e),p(null)))}})})})},VP=Me.label1,UP=Me.h4,GP={wrapper:{height:46,width:99},container:{display:"flex"},monthWeekDayContainer:{display:"flex",flexDirection:"column"},label:{extend:VP,lineHeight:1.33,color:J},bigNumber:{extend:Me.info1,lineHeight:1,marginRight:7},monthYear:{extend:Me.label2,lineHeight:1.17,color:J},weekDay:{extend:VP,lineHeight:1.33,color:se}},XP=Object(f.a)(GP),_P=function(e){var t=e.date,n=e.children,a=(Object(q.a)(e,["date","children"]),XP());return Object(qe.jsxs)("div",{className:a.wrapper,children:[Object(qe.jsx)("div",{className:a.label,children:n}),t&&Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:a.container,children:[Object(qe.jsx)("div",{className:a.bigNumber,children:Object(sd.a)("d",t)}),Object(qe.jsxs)("div",{className:a.monthWeekDayContainer,children:[Object(qe.jsx)("span",{className:a.monthYear,children:"".concat(Object(sd.a)("MMM",t)," ").concat(Object(sd.a)("yyyy",t))}),Object(qe.jsx)("span",{className:a.weekDay,children:Object(sd.a)("EEEE",t)})]})]})})]})},ZP={popoverContent:{width:280},popoverHeader:{extend:UP,padding:[[15,15,0,15]]},radioButtonsContainer:{padding:[[5,15,5,15]]},radioButtons:{display:"flex",justifyContent:"space-between",flexDirection:"row",color:J},dateRangePickerShowing:{display:"block",height:"100%"},dateRangePickerHidden:{display:"none",height:0},download:{padding:[[10,15]]},dateContainerWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",backgroundColor:G,padding:[[0,15]],minHeight:70},arrowContainer:{position:"absolute",left:125,top:26},arrow:{margin:"auto"}},KP=Object(f.a)(ZP),QP="all",YP="range",JP="advanced",eD="simplified",tD=function(e){var t,n=e.name,r=e.query,i=e.args,o=e.title,c=e.getLogs,d=e.timezone,m=e.simplified,h=e.className,p=Object(a.useState)(QP),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(JP),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)({from:null,until:null}),w=Object(l.a)(y,2),C=w[0],k=w[1],N=Object(a.useState)(null),S=Object(l.a)(N,2),L=S[0],F=S[1],P=Object(u.a)(r,{onCompleted:function(e){return M(c(e),C)}}),D=Object(l.a)(P,1)[0],T=KP(),R=(t={},Object(z.a)(t,T.dateRangePickerShowing,f===YP),Object(z.a)(t,T.dateRangePickerHidden,f===QP),t),B=Object(a.useCallback)((function(e,t){k({from:e,until:t})}),[k]),M=function(e,t){var a=function(e){return md(e,d,"yyyy-MM-dd_HH-mm")},r=new window.Blob([e],{type:"text/plain;charset=utf-8"});Bf.a.saveAs(r,f===QP?"".concat(a(new Date),"_").concat(n,".csv"):"".concat(a(t.from),"_").concat(a(t.until),"_").concat(n,".csv"))},W=[{display:"All logs",code:QP},{display:"Date range",code:YP}],q=[{display:"Advanced logs",code:JP},{display:"Simplified logs",code:eD}],$=Boolean(L),H=$?"date-range-popover":void 0;return Object(qe.jsx)(E.a,{onClickAway:function(){F(null)},children:Object(qe.jsxs)("div",{className:h,children:[Object(qe.jsx)(Vn,{Icon:Lj,InverseIcon:vj,onClick:function(e){F(L?null:e.currentTarget)},variant:"contained"}),Object(qe.jsx)(Xn,{id:H,open:$,anchorEl:L,placement:"bottom",children:Object(qe.jsxs)("div",{className:T.popoverContent,children:[Object(qe.jsx)("div",{className:T.popoverHeader,children:o}),Object(qe.jsx)("div",{className:T.radioButtonsContainer,children:Object(qe.jsx)(Er,{name:"logs-select",value:f,options:W,ariaLabel:"logs-select",onChange:function(e){var t=A.a(["target","value"])(e);j(t),t===QP&&k({from:null,until:null})},className:T.radioButtons})}),f===YP&&Object(qe.jsxs)("div",{className:I()(R),children:[Object(qe.jsx)("div",{className:T.dateContainerWrapper,children:C&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_P,{date:C.from,children:"From"}),Object(qe.jsx)("div",{className:T.arrowContainer,children:Object(qe.jsx)(dP,{className:T.arrow})}),Object(qe.jsx)(_P,{date:C.until,children:"To"})]})}),Object(qe.jsx)(HP,{maxDate:new Date,onRangeChange:B})]}),m&&Object(qe.jsx)("div",{className:T.radioButtonsContainer,children:Object(qe.jsx)(Er,{name:"simplified-tx-logs",value:x,options:q,ariaLabel:"simplified-tx-logs",onChange:function(e){var t=A.a(["target","value"])(e);v(t)},className:T.radioButtons})}),Object(qe.jsx)("div",{className:T.download,children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){return function(e,t){f===QP&&D({variables:Object(s.a)(Object(s.a)({},t),{},{simplified:x===eD,excludeTestingCustomers:!0})}),e&&e.from&&(e.from&&!e.until&&(e.until=new Date),f===YP&&D({variables:Object(s.a)(Object(s.a)({},t),{},{from:e.from,until:e.until,simplified:x===eD,excludeTestingCustomers:!0})}))}(C,i)},children:"Download"})})]})})]})})},nD=Object(f.a)(yf),aD=x()(FP||(FP=Object(c.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),rD=x()(PP||(PP=Object(c.a)(["\n query MachineLogs(\n $deviceId: ID!\n $limit: Int\n $from: Date\n $until: Date\n $timezone: String\n ) {\n machineLogsCsv(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n }\n"]))),iD=x()(DP||(DP=Object(c.a)(["\n query MachineLogs($deviceId: ID!, $limit: Int, $from: Date, $until: Date) {\n machineLogs(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n ) {\n logLevel\n id\n timestamp\n message\n }\n }\n"]))),oD=x()(TP||(TP=Object(c.a)(["\n query getData {\n config\n }\n"]))),lD=function(){var e,t,n=nD(),r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=null===o||void 0===o?void 0:o.deviceId,b=Object(u.c)(aD),f=b.data,j=b.loading,g=Object(u.c)(oD),O=g.data,x=g.loading,v=A.a(["config","locale_timezone"],O),y=Object(u.c)(iD,{variables:{deviceId:p,limit:500},skip:!o,onCompleted:function(){return h("")}}),w=y.data,C=y.loading;(null===f||void 0===f||null===(e=f.machines)||void 0===e?void 0:e.length)&&!o&&c(null===f||void 0===f?void 0:f.machines[0]);var k=j||x||C;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:n.titleWrapper,children:Object(qe.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(qe.jsx)(yn,{children:"Machine Logs"}),w&&Object(qe.jsxs)("div",{className:n.buttonsWrapper,children:[Object(qe.jsx)(tD,{title:"Download logs",name:o.name,query:rD,args:{deviceId:p,timezone:v},getLogs:function(e){return A.a(["machineLogsCsv"])(e)},timezone:v}),Object(qe.jsx)(Je,{children:m})]})]})}),Object(qe.jsxs)("div",{className:n.wrapper,children:[Object(qe.jsx)(Si,{displayName:function(e){return e.name},data:(null===f||void 0===f?void 0:f.machines)||[],isSelected:function(e){return A.a(["deviceId"])(o)===e.deviceId},onClick:c}),Object(qe.jsxs)("div",{className:n.tableWrapper,children:[Object(qe.jsxs)(Is,{className:n.table,children:[Object(qe.jsx)(Ds,{children:Object(qe.jsxs)(zs,{header:!0,children:[Object(qe.jsx)(Bs,{className:n.dateColumn,children:"Date"}),Object(qe.jsx)(Bs,{className:n.levelColumn,children:"Level"}),Object(qe.jsx)(Bs,{className:n.fillColumn})]})}),Object(qe.jsx)(Ls,{children:w&&w.machineLogs.map((function(e,t){return Object(qe.jsxs)(zs,{size:"sm",children:[Object(qe.jsx)(Ps,{children:v&&md(e.timestamp,v,"yyyy-MM-dd HH:mm")}),Object(qe.jsx)(Ps,{children:e.logLevel}),Object(qe.jsx)(Ps,{children:e.message})]},t)}))})]}),k&&Object(qe.jsx)(_e,{children:"Loading..."}),!k&&!(null===w||void 0===w||null===(t=w.machineLogs)||void 0===t?void 0:t.length)&&Object(qe.jsx)(_e,{children:"No activity so far"})]})]})]})};function cD(){return(cD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dD=a.createElement("desc",null,"Created with Sketch."),uD=a.createElement("g",{id:"icon/sf-small/clock/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#FFFFFF",strokeWidth:2},a.createElement("path",{d:"M0,10 C0,15.522 4.478,20 10,20 C15.522,20 20,15.522 20,10 C20,4.478 15.522,0 10,0 C7.749,0 5.671,0.744 4,1.999",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),a.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function mD(e,t){var n=e.title,r=e.titleId,i=sD(e,["title","titleId"]);return a.createElement("svg",cD({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,dD,uD)}var hD=a.forwardRef(mD);n.p;function pD(){return(pD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fD=a.createElement("desc",null,"Created with Sketch."),jD=a.createElement("g",{id:"icon/sf-small/clock/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#1B2559",strokeWidth:2},a.createElement("path",{d:"M0,10 C0,15.522 4.478,20 10,20 C15.522,20 20,15.522 20,10 C20,4.478 15.522,0 10,0 C7.749,0 5.671,0.744 4,1.999",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),a.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function gD(e,t){var n=e.title,r=e.titleId,i=bD(e,["title","titleId"]);return a.createElement("svg",pD({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,fD,jD)}var OD,xD,vD,yD,wD,CD=a.forwardRef(gD),kD=(n.p,{cashbox:{height:36},tBody:{maxHeight:"65vh",overflow:"auto"},tableWidth:{display:"flex",alignItems:"center",marginRight:1},descriptions:{color:se,marginTop:0},cashboxReset:{color:se,margin:[[13,0,-5,20]]},selection:{marginRight:12},downloadLogsButton:{marginLeft:13}}),ED={footerLabel:{color:$,alignSelf:"center"},footerContent:{width:1200,maxHeight:64,display:"flex",justifyContent:"space-around",position:"fixed"},footerContainer:{position:"fixed",height:64,left:0,bottom:0,width:"100vw",backgroundColor:"white",display:"flex",justifyContent:"space-around",boxShadow:[[0,-1,10,0,"rgba(50, 50, 50, 0.1)"]]},flex:{display:"flex"},icon:{alignSelf:"center",height:20,width:20,marginRight:8},iconLabel:{alignSelf:"center",marginRight:8},valueDisplay:{alignSelf:"center"}},ND=Object(f.a)(ED),SD=function(e){var t=e.machines,n=e.config,a=e.currencyCode,r=e.bills,i=(e.deviceIds,ND()),o=n&&ss("cashOut")(n),l=function(e){return ss(e)(o)},c=js.a(gs.a((function(e,t){var n,a,r,i,o=t.cassette1,c=t.cassette2,s=t.cassette3,d=t.cassette4,u=t.id,m=null!==(n=l(u).cassette1)&&void 0!==n?n:0,h=null!==(a=l(u).cassette2)&&void 0!==a?a:0,p=null!==(r=l(u).cassette3)&&void 0!==r?r:0,b=null!==(i=l(u).cassette4)&&void 0!==i?i:0;return[e[0]+=o*m,e[1]+=c*h,e[2]+=s*p,e[3]+=d*b]}),[0,0,0,0],t)),s=js.a(T.a((function(e){return e.fiat}))(r)),d=new $c.a(c+s).toFormat(0);return Object(qe.jsx)("div",{className:i.footerContainer,children:Object(qe.jsxs)("div",{className:i.footerContent,children:[Object(qe.jsx)(Je,{className:i.footerLabel,children:"Cash value in System"}),Object(qe.jsxs)("div",{className:i.flex,children:[Object(qe.jsx)(Pc,{className:i.icon}),Object(qe.jsx)(Ye,{className:i.iconLabel,children:"Cash-in:"}),Object(qe.jsxs)(Qe,{className:i.valueDisplay,children:[Gr(s)," ",a]})]}),Object(qe.jsxs)("div",{className:i.flex,children:[Object(qe.jsx)(Wc,{className:i.icon}),Object(qe.jsx)(Ye,{className:i.iconLabel,children:"Cash-out:"}),Object(qe.jsxs)(Qe,{className:i.valueDisplay,children:[Gr(c)," ",a]})]}),Object(qe.jsxs)("div",{className:i.flex,children:[Object(qe.jsx)(Ye,{className:i.iconLabel,children:"Total:"}),Object(qe.jsxs)(Qe,{className:i.valueDisplay,children:[Gr(d)," ",a]})]})]})})},ID=n(564),LD=x()(OD||(OD=Object(c.a)(["\n query cashboxBatches {\n cashboxBatches {\n id\n deviceId\n created\n operationType\n customBillCount\n performedBy\n bills {\n fiat\n deviceId\n created\n }\n }\n }\n"]))),FD=Object(f.a)({operationType:{marginLeft:8},operationTypeWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},saveAndCancel:{display:"flex",flexDirection:"row",justifyContent:"space-between"}}),PD=function(e){var t=e.machines,n=e.currency,a=e.timezone,r=FD(),i=Object(u.c)(LD),o=i.data,l=i.loading,c=A.a(["cashboxBatches"])(o),s=gs.a((function(e,t){return Pu.a(ID.a("cash-cassette-".concat(t,"-refill"),Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Wc,{}),Object(qe.jsxs)("span",{className:r.operationType,children:["Cash cassette ",t," refill"]})]})),ID.a("cash-cassette-".concat(t,"-empty"),Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Wc,{}),Object(qe.jsxs)("span",{className:r.operationType,children:["Cash cassette ",t," emptied"]})]})))(e)}),{"cash-box-empty":Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Pc,{}),Object(qe.jsx)("span",{className:r.operationType,children:"Cash box emptied"})]})},Ru.a(1,5)),d=[{name:"operation",header:"Operation",width:200,textAlign:"left",view:function(e){return Object(qe.jsx)("div",{className:r.operationTypeWrapper,children:s[e.operationType]})}},{name:"machine",header:"Machine",width:200,textAlign:"left",view:Pu.a(R.a("deviceId"),(function(e){return Aa.a(W.a("id",e),t)}),za.a({name:Object(qe.jsx)("i",{children:"Unpaired device"})}),R.a("name"))},{name:"billCount",header:"Bill Count",width:115,textAlign:"left",input:oi,inputProps:{decimalPlaces:0},view:function(e){return D.a(e.customBillCount)?e.bills.length:e.customBillCount}},{name:"total",header:"Total",width:180,textAlign:"right",view:function(e){return Object(qe.jsxs)("span",{children:[js.a(T.a((function(e){return R.a("fiat",e)}),e.bills))," ",n]})}},{name:"date",header:"Date",width:135,textAlign:"right",view:function(e){return md(e.created,a,"yyyy-MM-dd")}},{name:"time",header:"Time (h:m)",width:125,textAlign:"right",view:function(e){return md(e.created,a,"HH:mm")}}];return Object(qe.jsx)(By,{loading:l,name:"cashboxHistory",elements:d,data:c,emptyText:"No cash box batches so far"})},DD=Object(f.a)(kD),TD={2:{machine:250,cashbox:260,cassette:300,cassetteGraph:80,editWidth:90},3:{machine:220,cashbox:215,cassette:225,cassetteGraph:60,editWidth:90},4:{machine:190,cashbox:180,cassette:185,cassetteGraph:50,editWidth:90}},RD=xn.f().shape({name:xn.h().required(),cashbox:xn.e().label("Cash box").required().integer().min(0).max(1e3),cassette1:xn.e().label("Cassette 1").required().integer().min(0).max(500),cassette2:xn.e().label("Cassette 2").required().integer().min(0).max(500),cassette3:xn.e().label("Cassette 3").required().integer().min(0).max(500),cassette4:xn.e().label("Cassette 4").required().integer().min(0).max(500)}),BD=x()(xD||(xD=Object(c.a)(["\n query getData($billFilters: JSONObject) {\n machines {\n name\n id: deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n }\n unpairedMachines {\n id: deviceId\n name\n }\n config\n bills(filters: $billFilters) {\n id\n fiat\n created\n deviceId\n }\n }\n"]))),AD=x()(vD||(vD=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),MD=x()(yD||(yD=Object(c.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n $cassette3: Int!\n $cassette4: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n cassette3: $cassette3\n cassette4: $cassette4\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n }\n }\n"]))),WD=x()(wD||(wD=Object(c.a)(["\n query cashboxBatchesCsv($from: Date, $until: Date, $timezone: String) {\n cashboxBatchesCsv(from: $from, until: $until, timezone: $timezone)\n }\n"]))),zD=function(){var e,t,n,r,i,o,c,m,h=DD(),p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(null),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(null),w=Object(l.a)(y,2),C=w[0],k=w[1],E=Object(u.c)(BD,{variables:{billFilters:{batch:"none"}}}),N=E.data,S=E.loading,I=Object(a.useState)(!1),L=Object(l.a)(I,2),F=L[0],P=L[1],D=Object(a.useState)(""),B=Object(l.a)(D,2),M=B[0],z=B[1],q=null!==(e=A.a(["machines"])(N))&&void 0!==e?e:[],$=null!==(t=A.a(["unpairedMachines"])(N))&&void 0!==t?t:[],H=null!==(n=A.a(["config"])(N))&&void 0!==n?n:{},V=ss("notifications",H),U=Object(u.b)(MD,{refetchQueries:function(){return["getData"]}}),G=Object(l.a)(U,2),X=G[0],_=G[1].error,Z=Object(u.b)(AD,{onCompleted:function(){return v(!1)},refetchQueries:function(){return["getData"]}}),K=Object(l.a)(Z,1)[0],Q=A.a(["config","locale_timezone"],N),Y=Ly.a((function(e){return e.deviceId}))(null!==(r=A.a(["bills"])(N))&&void 0!==r?r:[]),J=Ag.a(T.a(R.a("deviceId"))(null!==(i=A.a(["bills"])(N))&&void 0!==i?i:[])),ee=(null===N||void 0===N?void 0:N.config)&&ss("cashOut")(N.config),te=(null===N||void 0===N?void 0:N.config)&&ss("locale")(N.config),ne=null===te||void 0===te?void 0:te.fiatCurrency,ae=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),q)).concat([0])),re=function(e){return ss(e)(ee)},ie=(null===N||void 0===N?void 0:N.config)&&ss("cashIn")(N.config).cashboxReset,oe=function(e){e&&(!function(e){var t=ds("cashIn")(e);K({variables:{config:t}})}({cashboxReset:e}),v(!1))},le=[{display:"Automatic",code:"automatic"},{display:"Manual",code:ep}],ce=function(e){var t=A.a(["target","value"])(e);k(t)},se=[{name:"name",header:"Machine",width:null===(o=TD[ae])||void 0===o?void 0:o.machine,view:function(e){return Object(qe.jsx)(qe.Fragment,{children:e})},input:function(e){var t=e.field.value;return Object(qe.jsx)(qe.Fragment,{children:t})}},{name:"cashbox",header:"Cash box",width:null===(c=TD[ae])||void 0===c?void 0:c.cashbox,view:function(e,t){var n,a=t.id;return Object(qe.jsx)(ei,{currency:{code:ne},notes:e,total:js.a(T.a((function(e){return e.fiat}),null!==(n=Y[a])&&void 0!==n?n:[]))})},input:oi,inputProps:{decimalPlaces:0}}];return im.a(om.a(lm.a,ae),(function(e){var t,n;return se.push({name:"cassette".concat(e),header:"Cassette ".concat(e),width:null===(t=TD[ae])||void 0===t?void 0:t.cassette,stripe:!0,doubleHeader:"Cash-out",view:function(t,n){var a,r,i=n.id;return Object(qe.jsx)(ti,{className:h.cashbox,denomination:null===(a=re(i))||void 0===a?void 0:a["cassette".concat(e)],currency:{code:ne},notes:t,width:null===(r=TD[ae])||void 0===r?void 0:r.cassetteGraph,threshold:V["fillingPercentageCassette".concat(e)]})},isHidden:function(t){var n=t.numberOfCassettes;return e>n},input:ai,inputProps:{decimalPlaces:0,width:null===(n=TD[ae])||void 0===n?void 0:n.cassetteGraph,inputClassName:h.cashbox}}),cm.a(1,e)}),1),se.push({name:"edit",header:"Edit",width:null===(m=TD[ae])||void 0===m?void 0:m.editWidth,textAlign:"center",view:function(e,t){var n=t.id;return Object(qe.jsx)(ta,{onClick:function(){z(n),P(!0)},children:Object(qe.jsx)(Dh,{})})}}),!S&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ll,{title:"Cash Boxes & Cassettes",buttons:[{text:"Cash box history",icon:CD,inverseIcon:hD,toggle:j},{component:f?Object(qe.jsx)(tD,{className:h.downloadLogsButton,title:"Download logs",name:"cashboxHistory",query:WD,getLogs:function(e){return A.a(["cashboxBatchesCsv"])(e)},timezone:Q,args:{timezone:Q}}):Object(qe.jsx)(qe.Fragment,{})}],iconClassName:h.listViewButton,className:h.tableWidth,children:!f&&Object(qe.jsxs)(tl.a,{alignItems:"center",justifyContent:"flex-end",children:[Object(qe.jsx)(at,{className:h.cashboxReset,children:"Cash box resets"}),Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"center",justifyContent:"end",mr:"-4px",children:[ie&&Object(qe.jsx)(Ke,{className:h.selection,children:zm(ie)}),Object(qe.jsx)(ta,{onClick:function(){return v(!0)},className:h.button,children:Object(qe.jsx)(Dh,{})})]})]})}),!f&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_h,{error:null===_||void 0===_?void 0:_.message,name:"cashboxes",stripeWhen:function(e){var t=e.id;return!re(t).active},elements:se,data:q,validationSchema:RD,tbodyWrapperClass:h.tBody}),N&&Wa.a(q)&&Object(qe.jsx)(Ns,{message:"No machines so far"})]}),f&&Object(qe.jsx)(PD,{machines:ml.a(q,$),currency:ne,timezone:Q}),Object(qe.jsx)(SD,{currencyCode:ne,machines:q,config:H,bills:A.a(["bills"])(N),deviceIds:J}),F&&Object(qe.jsx)(Hp,{machine:Aa.a(W.a("id",M),q),cashoutSettings:re(M),onClose:function(){P(!1)},error:null===_||void 0===_?void 0:_.message,save:function(e,t,n){return X({variables:Object(s.a)({action:"setCassetteBills",deviceId:e,cashbox:t},n)})},locale:te}),x&&Object(qe.jsxs)(Yh,{title:"Cash box resets",width:478,handleClose:function(){return v(null)},open:!0,children:[Object(qe.jsx)(Ke,{className:h.descriptions,children:"We can automatically assume you emptied a bill validator's cash box when the machine detects that it has been removed."}),Object(qe.jsx)(Er,{name:"set-automatic-reset",value:null!==C&&void 0!==C?C:ie,options:[le[0]],onChange:ce,className:h.radioButtons}),Object(qe.jsx)(Ke,{className:h.descriptions,children:"Assume the cash box is emptied whenever it's removed, creating a new batch on the history screen and setting its current balance to zero."}),Object(qe.jsx)(Er,{name:"set-manual-reset",value:null!==C&&void 0!==C?C:ie,options:[le[1]],onChange:ce,className:h.radioButtons}),Object(qe.jsx)(Ke,{className:h.descriptions,children:"Cash boxes won't be assumed emptied when removed, nor their counts modified. Instead, to update the count and create a new batch, you'll click the 'Edit' button on this panel."}),Object(qe.jsx)(Xm.a,{className:h.actions,children:Object(qe.jsx)(An,{onClick:function(){return oe(C)},children:"Confirm"})})]})]})};function qD(){return(qD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $D(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var HD=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff7311"});function VD(e,t){var n=e.title,r=e.titleId,i=$D(e,["title","titleId"]);return a.createElement("svg",qD({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,HD)}var UD=a.forwardRef(VD);n.p;function GD(){return(GD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function XD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _D=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff584a"});function ZD(e,t){var n=e.title,r=e.titleId,i=XD(e,["title","titleId"]);return a.createElement("svg",GD({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,_D)}var KD,QD,YD,JD,eT,tT=a.forwardRef(ZD),nT=(n.p,Object(s.a)(Object(s.a)({},kf),{},{wrapper:{display:"flex",marginTop:12,marginBottom:16,fontSize:we},row:{display:"flex",flexDirection:"row"},list:{padding:0,margin:0,listStyle:"none"},item:{height:24,marginBottom:12},link:{color:J,textDecoration:"none"},separator:{width:1,height:170,zIndex:1,marginRight:60,marginLeft:"auto",background:Object(na.fade)($,.5)}})),aT=Object(f.a)(Ef),rT=function(e){var t=e.children,n=aT();return Object(qe.jsx)("div",{className:n.label,children:t})},iT=Object(f.a)(nT),oT=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)(h.a,Object(s.a)(Object(s.a)({container:!0,spacing:4},n),{},{children:t}))},lT=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)(h.a,Object(s.a)(Object(s.a)({item:!0,xs:!0},n),{},{children:t}))},cT=function(e){var t=e.it,n=e.onActionSuccess,a=e.timezone,r=iT();return Object(qe.jsx)(oT,{className:r.wrapper,children:Object(qe.jsx)(lT,{xs:!0,children:Object(qe.jsxs)(oT,{className:r.row,children:[Object(qe.jsxs)(lT,{xs:2,children:[Object(qe.jsx)(rT,{children:"Machine Model"}),Object(qe.jsx)("span",{children:ib[t.model]})]}),Object(qe.jsxs)(lT,{xs:4,children:[Object(qe.jsx)(rT,{children:"Paired at"}),Object(qe.jsx)("span",{children:a&&md(t.pairedAt,a,"yyyy-MM-dd HH:mm:ss")})]}),Object(qe.jsx)(lT,{xs:6,children:Object(qe.jsx)(pf,{machine:t,onActionSuccess:n})}),Object(qe.jsxs)(lT,{xs:2,children:[Object(qe.jsx)(rT,{children:"Network speed"}),Object(qe.jsx)("span",{children:t.downloadSpeed?new $c.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]}),Object(qe.jsxs)(lT,{xs:2,children:[Object(qe.jsx)(rT,{children:"Latency"}),Object(qe.jsx)("span",{children:t.responseTime?new $c.a(t.responseTime).toFixed(3).toString()+" ms":"unavailable"})]}),Object(qe.jsxs)(lT,{xs:2,children:[Object(qe.jsx)(rT,{children:"Packet Loss"}),Object(qe.jsx)("span",{children:t.packetLoss?new $c.a(t.packetLoss).toFixed(3).toString()+" %":"unavailable"})]})]})})})},sT=x()(KD||(KD=Object(c.a)(["\n {\n machines {\n name\n deviceId\n lastPing\n pairedAt\n version\n paired\n cashbox\n cassette1\n cassette2\n version\n model\n statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n }\n }\n"]))),dT=x()(QD||(QD=Object(c.a)(["\n query getData {\n config\n }\n"]))),uT=Object(f.a)(Nf),mT=function(){var e,t=uT(),n=Object(w.h)(),a=Object(w.i)().state,r=null===a||void 0===a?void 0:a.id,i=Object(u.c)(sT),o=i.data,l=i.refetch,c=i.loading,s=Object(u.c)(dT),d=s.data,m=s.configLoading,h=A.a(["config","locale_timezone"],d),p=[{header:"Machine Name",width:250,size:"sm",textAlign:"left",view:function(e){return Object(qe.jsxs)("div",{className:t.flexRow,children:[e.name,Object(qe.jsx)("div",{className:t.machineRedirectContainer,onClick:function(){n.push("/machines/".concat(e.deviceId))},children:Object(qe.jsx)(gu,{})})]})}},{header:"Status",width:350,size:"sm",textAlign:"left",view:function(e){return Object(qe.jsx)(zu,{statuses:e.statuses})}},{header:"Last ping",width:200,size:"sm",textAlign:"left",view:function(e){return e.lastPing?Object(sb.a)(new Date(e.lastPing),new Date,{addSuffix:!0}):"unknown"}},{header:"Software Version",width:200,size:"sm",textAlign:"left",view:function(e){return e.version||"unknown"}}],b=null!==(e=A.a(["machines"])(o))&&void 0!==e?e:[],f=fl.a(W.a("deviceId",r))(b),j=c||m;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:t.titleWrapper,children:[Object(qe.jsx)("div",{className:t.titleAndButtonsContainer,children:Object(qe.jsx)(yn,{children:"Machine Status"})}),Object(qe.jsxs)("div",{className:t.headerLabels,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(UD,{}),Object(qe.jsx)("span",{children:"Warning"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(tT,{}),Object(qe.jsx)("span",{children:"Error"})]})]})]}),Object(qe.jsx)(By,{loading:j,elements:p,data:b,Details:function(e){var t=e.it;return Object(qe.jsx)(cT,{it:t,onActionSuccess:l,timezone:h})},initialExpanded:f,emptyText:"No machines so far",expandable:!0})]})},hT=r.a.createContext(),pT=Object(f.a)({header:{display:"flex",alignItems:"center",marginBottom:16,height:26,margin:0},title:{flexShrink:2,margin:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},button:{border:"none",backgroundColor:"transparent",cursor:"pointer",marginLeft:8},editingButtons:{display:"flex",flexShrink:0,marginLeft:16,justifyContent:"space-between",width:110}}),bT=function(e){var t=e.title,n=e.editing,a=e.disabled,r=e.setEditing,i=pT();return Object(qe.jsxs)("div",{className:i.header,children:[Object(qe.jsx)(_e,{className:i.title,children:t}),!n&&Object(qe.jsx)(ta,{onClick:function(){return r(!0)},className:i.button,disabled:a,children:a?Object(qe.jsx)(Nh,{}):Object(qe.jsx)(Dh,{})}),n&&Object(qe.jsxs)("div",{className:i.editingButtons,children:[Object(qe.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(qe.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"})]})]})},fT=Object(f.a)({text:{margin:[[7,0,7,1]]},fieldWrapper:{height:53},valueWrapper:{display:"flex",alignItems:"baseline"},label:{margin:0},decoration:{margin:[[0,0,0,7]]}}),jT=function(e){var t,n=e.label,a=e.name,r=e.editing,i=e.displayValue,o=e.decoration,l=e.className,c=e.decimalPlaces,s=void 0===c?0:c,d=e.width,u=void 0===d?80:d,m=fT({width:u,editing:r}),h=Object(mn.f)().values,p=(t={},Object(z.a)(t,m.fieldWrapper,!0),Object(z.a)(t,"className",l),t);return Object(qe.jsxs)("div",{className:I()(p),children:[n&&Object(qe.jsx)(at,{className:m.label,children:n}),Object(qe.jsxs)("div",{className:m.valueWrapper,children:[!r&&Object(qe.jsx)(Qe,{className:m.text,children:i(h[a])}),r&&Object(qe.jsx)(mn.b,{id:a,size:"lg",fullWidth:!0,name:a,component:oi,textAlign:"right",width:u,decimalPlaces:s}),Object(qe.jsx)(nt,{className:m.decoration,children:o})]})]})},gT=function(e){var t,n=e.title,r=e.label,i=e.width,o=void 0===i?80:i,c=e.min,s=void 0===c?0:c,d=e.max,u=void 0===d?9999999:d,m=e.name,h=e.section,p=e.className,b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1],O=function(){var e=Object(Bl.a)(Rl.a.mark((function e(t,n){return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){e.next=2;break}return e.abrupt("return");case 2:return g(!0),e.next=5,v(t,n);case 5:g(!1);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),x=Object(a.useContext)(hT),v=x.save,y=x.data,w=x.currency,C=x.isEditing,k=x.isDisabled,E=x.setEditing,N=xn.f().shape(Object(z.a)({},m,xn.e().transform(Ur).integer().min(s).max(u).nullable()));return Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:Object(z.a)({},m,null!==(t=y&&y[m])&&void 0!==t?t:""),validationSchema:N,onSubmit:function(e){return O(h,N.cast(e))},onReset:function(){E(m,!1)},children:Object(qe.jsxs)(mn.d,{className:p,children:[Object(qe.jsx)(fm,{}),Object(qe.jsx)(bT,{title:n,editing:C(m),disabled:k(m),setEditing:function(e){return E(m,e)}}),Object(qe.jsx)(jT,{label:r,name:m,editing:C(m),width:o,displayValue:function(e){return""===e?"-":e},decoration:w})]})})},OT="cryptoLowBalance",xT="cryptoHighBalance",vT=Object(f.a)({cryptoBalanceAlerts:{display:"flex",marginBottom:36,height:135,alignItems:"center"},cryptoBalanceAlertsForm:{width:222,marginRight:32},cryptoBalanceAlertsSecondForm:{marginLeft:50},vertSeparator:{width:1,height:"100%",borderRight:[[1,"solid","black"]]}}),yT=function(e){var t=e.section,n=e.fieldWidth,r=vT(),i=Object(a.useContext)(hT),o=i.data,l=i.save,c=i.currency,s=i.setEditing,d=i.isEditing,u=i.isDisabled;return Object(qe.jsxs)("div",{className:r.cryptoBalanceAlerts,children:[Object(qe.jsx)(gT,{name:OT,data:o,save:l,section:t,decoration:c,className:r.cryptoBalanceAlertsForm,title:"Default (Low Balance)",label:"Alert me under",editing:d(OT),disabled:u(OT),setEditing:function(e){return s(OT,e)},width:n}),Object(qe.jsx)("div",{className:r.vertSeparator}),Object(qe.jsx)(gT,{name:xT,data:o,section:t,save:l,decoration:c,className:r.cryptoBalanceAlertsSecondForm,title:"Default (High Balance)",label:"Alert me over",editing:d(xT),disabled:u(xT),setEditing:function(e){return s(xT,e)},width:n})]})},wT="highBalance",CT="lowBalance",kT="cryptoCurrency",ET="cryptoBalanceOverrides",NT=function(e){var t,n,r,i=e.section,o=Object(a.useContext)(hT),l=o.cryptoCurrencies,c=void 0===l?[]:l,s=o.data,d=o.save,u=o.error,m=o.currency,h=o.isDisabled,p=o.setEditing,b=null!==(t=null===s||void 0===s?void 0:s.cryptoBalanceOverrides)&&void 0!==t?t:[],f=T.a(R.a(kT))(b),j=M.a((function(e){return!bl.a(e.code,f)}))(c),g=(n={},Object(z.a)(n,kT,null),Object(z.a)(n,CT,""),Object(z.a)(n,wT,""),n),O=xn.f().shape((r={},Object(z.a)(r,kT,xn.h().label("Cryptocurrency").nullable().required()),Object(z.a)(r,CT,xn.e().label("Low Balance").when(wT,{is:function(e){return!e},then:xn.e().required()}).transform(Ur).integer().min(0).max(Jh).nullable()),Object(z.a)(r,wT,xn.e().label("High Balance").when(CT,{is:function(e){return!e},then:xn.e().required()}).transform(Ur).integer().min(0).max(Jh).nullable()),r),[CT,wT]),x=[{name:kT,header:"Cryptocurrency",width:166,size:"sm",view:function(e){return F.a(A.a(["display"]),Aa.a(W.a("code",e)))(c)},input:Br,inputProps:{options:function(e){return ml.a(j,function(e){var t=F.a(Aa.a(W.a("code",null===e||void 0===e?void 0:e.cryptoCurrency)))(c);return t?[t]:[]}(e))},optionsLimit:null,valueProp:"code",labelProp:"display"}},{name:CT,width:155,textAlign:"right",bold:!0,input:oi,suffix:m,inputProps:{decimalPlaces:2}},{name:wT,width:155,textAlign:"right",bold:!0,input:oi,suffix:m,inputProps:{decimalPlaces:2}}];return Object(qe.jsx)(_h,{name:ET,title:"Overrides",error:null===u||void 0===u?void 0:u.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return d(i,e)},initialValues:g,validationSchema:O,forceDisable:h(ET)||!c,data:b,elements:x,disableAdd:!(null===j||void 0===j?void 0:j.length),onDelete:function(e){var t={cryptoBalanceOverrides:mm.a((function(t){return t.id===e}),b)};return d(t)},setEditing:function(e){return p(ET,e)}})},ST={wrapper:{display:"flex"},form:{marginBottom:36},title:{marginTop:0},row:{width:236,display:"grid",gridTemplateColumns:"repeat(2,1fr)",gridTemplateRows:"1fr",gridColumnGap:18,gridRowGap:0},col2:{width:136},cashboxLabel:{marginRight:4,fontSize:20},cashboxEmptyPart:{backgroundColor:"".concat(ae)}},IT=Object(f.a)(ST),LT="fiatBalanceAlerts",FT=function(e){var t,n,r,i,o=e.section,l=e.min,c=void 0===l?0:l,s=e.max,u=void 0===s?100:s,m=e.fieldWidth,h=void 0===m?80:m,p=Object(a.useContext)(hT),b=p.isEditing,f=p.isDisabled,j=p.setEditing,g=p.data,O=p.save,x=p.machines,v=void 0===x?[]:x,y=IT(),w=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),v)).concat([2])),C=b(LT),k=xn.f().shape({fillingPercentageCassette1:xn.e().transform(Ur).integer().min(c).max(u).nullable(),fillingPercentageCassette2:xn.e().transform(Ur).integer().min(c).max(u).nullable(),fiatBalanceCassette3:xn.e().transform(Ur).integer().min(c).max(u).nullable(),fiatBalanceCassette4:xn.e().transform(Ur).integer().min(c).max(u).nullable()});return Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{fillingPercentageCassette1:null!==(t=null===g||void 0===g?void 0:g.fillingPercentageCassette1)&&void 0!==t?t:"",fillingPercentageCassette2:null!==(n=null===g||void 0===g?void 0:g.fillingPercentageCassette2)&&void 0!==n?n:"",fillingPercentageCassette3:null!==(r=null===g||void 0===g?void 0:g.fillingPercentageCassette3)&&void 0!==r?r:"",fillingPercentageCassette4:null!==(i=null===g||void 0===g?void 0:g.fillingPercentageCassette4)&&void 0!==i?i:""},validationSchema:k,onSubmit:function(e){return O(o,k.cast(e))},onReset:function(){j(LT,!1)},children:function(e){var t=e.values;return Object(qe.jsxs)(mn.d,{className:y.form,children:[Object(qe.jsx)(fm,{}),Object(qe.jsx)(bT,{title:"Cash out (Empty)",editing:C,disabled:f(LT),setEditing:function(e){return j(LT,e)}}),Object(qe.jsx)("div",{className:y.wrapper,children:T.a((function(e){var n;return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:y.row,children:[Object(qe.jsx)(Jr,{labelClassName:y.cashboxLabel,emptyPartClassName:y.cashboxEmptyPart,percent:null!==(n=t["fillingPercentageCassette".concat(e+1)])&&void 0!==n?n:g["cassette".concat(e+1)],applyColorVariant:!0,applyFiatBalanceAlertsStyling:!0,omitInnerPercentage:!0,cashOut:!0}),Object(qe.jsxs)("div",{className:y.col2,children:[Object(qe.jsxs)(nt,{className:y.title,children:["Cassette ",e+1]}),Object(qe.jsx)(jT,{label:"Alert me under",name:"fillingPercentageCassette".concat(e+1),editing:C,displayValue:function(e){return""===e?"-":e},decoration:"%",width:h})]})]})})}),Du.a(Tu.a,w))})]})}})},PT="fillingPercentageCassette1",DT="fillingPercentageCassette2",TT="fillingPercentageCassette3",RT="fillingPercentageCassette4",BT="machine",AT="fiatBalanceOverrides",MT=[PT,DT,TT,RT],WT={2:{machine:230,cassette:250},3:{machine:216,cassette:270},4:{machine:210,cassette:204}},zT=function(e){var t,n,r,i=e.config,o=e.section,l=Object(a.useContext)(hT),c=l.machines,s=void 0===c?[]:c,u=l.data,m=l.save,h=l.isDisabled,p=l.setEditing,b=l.error,f=null!==(t=null===u||void 0===u?void 0:u.fiatBalanceOverrides)&&void 0!==t?t:[],j=T.a((function(e){return e.machine}),f),g=M.a((function(e){return!L.a(e.deviceId,j)&&function(e){return ss(e)(i)}(e.deviceId).active}))(s),O=(n={},Object(z.a)(n,BT,null),Object(z.a)(n,PT,""),Object(z.a)(n,DT,""),Object(z.a)(n,TT,""),Object(z.a)(n,RT,""),n),x=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),s)).concat([2])),v=100,y=xn.f().shape((r={},Object(z.a)(r,BT,xn.h().label("Machine").nullable().required()),Object(z.a)(r,PT,xn.e().label("Cassette 1").transform(Ur).integer().min(0).max(v).nullable()),Object(z.a)(r,DT,xn.e().label("Cassette 2").transform(Ur).integer().min(0).max(v).nullable()),Object(z.a)(r,TT,xn.e().label("Cassette 3").transform(Ur).integer().min(0).max(v).nullable()),Object(z.a)(r,RT,xn.e().label("Cassette 4").transform(Ur).integer().min(0).max(v).nullable()),r)).test((function(e,t){var n=Gm.a(MT,e);if(!MT.some((function(e){return!D.a(n[e])})))return t.createError({path:PT,message:"At least one of the cassettes must have a value"})})),w=[{name:BT,width:WT[x].machine,size:"sm",view:function(e){return F.a(A.a(["name"]),Aa.a(W.a("deviceId",e)))(s)},input:Br,inputProps:{options:function(e){return ml.a(g,function(e){var t=F.a(Aa.a(W.a("deviceId",null===e||void 0===e?void 0:e.machine)))(s);return t?[t]:[]}(e))},valueProp:"deviceId",labelProp:"name"}}];return im.a(om.a(lm.a,x),(function(e){return w.push({name:"fillingPercentageCassette".concat(e),display:"Cash cassette ".concat(e),width:WT[x].cassette,textAlign:"right",doubleHeader:"Cash Cassette Empty",bold:!0,input:oi,suffix:"%",inputProps:{decimalPlaces:0},view:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.toString())&&void 0!==t?t:"\u2014"},isHidden:function(t){var n;return e>(null===(n=s.find((function(e){return e.deviceId===t.machine})))||void 0===n?void 0:n.numberOfCassettes)}}),cm.a(1,e)}),1),Object(qe.jsx)(_h,{name:AT,title:"Overrides",error:null===b||void 0===b?void 0:b.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return m(o,y.cast(e))},initialValues:O,validationSchema:y,forceDisable:h(AT)||!s,data:f,elements:w,disableAdd:!(null===g||void 0===g?void 0:g.length),setEditing:function(e){return p(AT,e)}})},qT={balance:152,transactions:184,compliance:178,errors:142,security:152,active:263},$T=function(e){var t=e.namespace,n=e.data,a=e.forceDisable,r=e.save,i=e.shouldUpperCase,o=e.onActivation,l=a||!n||!n.active,c=function(e){var t=e.name,a=e.disabled,i=!(!n||!n[t]);return Object(qe.jsx)(Nm,{width:qT[t],textAlign:"center",children:Object(qe.jsx)(Lr,{disabled:a,checked:i,onChange:function(e){("active"!==t||!1!==i||o())&&r(Object(z.a)({},t,e.target.checked))},value:i})})};return Object(qe.jsxs)(Lm,{children:[Object(qe.jsx)(Nm,{width:229,children:i?Vj.a(t):$m(t)}),Object(qe.jsx)(c,{name:"balance",disabled:l}),Object(qe.jsx)(c,{name:"transactions",disabled:l}),Object(qe.jsx)(c,{name:"compliance",disabled:l}),Object(qe.jsx)(c,{name:"errors",disabled:l}),Object(qe.jsx)(c,{name:"security",disabled:l}),Object(qe.jsx)(c,{name:"active",disabled:a})]})},HT=Object(f.a)({wizardTable:{width:930}}),VT=function(e){var t=e.wizard,n=e.forceDisable,r=Object(a.useContext)(hT),i=r.data,o=r.save,l=r.twilioAvailable,c=r.setSmsSetupPopup,s=r.mailgunAvailable,d=r.setEmailSetupPopup,u=[{name:"email",forceDisable:n,shouldUpperCase:!1,onActivation:function(){return!!s||(d(!0),!1)}},{name:"sms",forceDisable:n,shouldUpperCase:!0,onActivation:function(){return!!l||(c(!0),!1)}},{name:"notificationCenter",forceDisable:n,shouldUpperCase:!1,onActivation:function(){return!0}}],m=t?20:0,h=HT();return Object(qe.jsxs)(wm,{className:t?h.wizardTable:null,children:[Object(qe.jsxs)(Cm,{children:[Object(qe.jsx)(Sm,{width:229-m,children:"Channel"}),Object.keys(qT).map((function(e){return Object(qe.jsx)(Sm,{width:qT[e]-m,textAlign:"center",children:$m(e)},e)}))]}),Object(qe.jsx)(Em,{children:u.map((function(e){return Object(qe.jsx)($T,{namespace:e.name,forceDisable:e.forceDisable,save:F.a(o(null),ds(e.name)),data:ss(e.name)(i),shouldUpperCase:e.shouldUpperCase,onActivation:e.onActivation})}))})]})},UT=function(e){var t=e.section,n=e.fieldWidth;return Object(qe.jsx)(gT,{section:t,title:"High value transaction",label:"Alert me over",name:"highValueTransaction",width:n})},GT=x()(YD||(YD=Object(c.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n numberOfCassettes\n }\n cryptoCurrencies {\n code\n display\n }\n accounts\n }\n"]))),XT=x()(JD||(JD=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),_T=x()(eT||(eT=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),ZT=function(e){var t=e.name,n=e.displaySetup,r=void 0===n||n,i=e.displayTransactionAlerts,o=void 0===i||i,c=e.displayFiatAlerts,s=void 0===c||c,d=e.displayCryptoAlerts,m=void 0===d||d,h=e.displayOverrides,p=void 0===h||h,b=e.displayTitle,f=void 0===b||b,j=e.wizard,g=void 0!==j&&j,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1],w=Object(a.useState)(null),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(null),S=Object(l.a)(N,2),I=S[0],L=S[1],P=Object(a.useState)(!1),D=Object(l.a)(P,2),T=D[0],R=D[1],B=Object(a.useState)(!1),M=Object(l.a)(B,2),W=M[0],z=M[1],q=Object(u.c)(GT),$=q.data,H=q.loading,V=Object(u.b)(XT,{refetchQueries:["getData"],onCompleted:function(){return L(null)},onError:function(e){return E(e)}}),U=Object(l.a)(V,1)[0],G=Object(u.b)(_T,{onCompleted:function(){R(!1),z(!1)},refetchQueries:["getData"],onError:function(e){return E(e)}}),X=Object(l.a)(G,1)[0],_=ss(t)(null===$||void 0===$?void 0:$.config),Z=null===$||void 0===$?void 0:$.machines,K=null===$||void 0===$?void 0:$.cryptoCurrencies,Q=dl.a("twilio",(null===$||void 0===$?void 0:$.accounts)||{}),Y=dl.a("mailgun",(null===$||void 0===$?void 0:$.accounts)||{}),J=A.a(["fiatCurrency"])(ss(es)(null===$||void 0===$?void 0:$.config)),ee=Vc.a((function(e,n){var a=ds(t)(n);return y(e),E(null),U({variables:{config:a}})})),te={save:ee,error:k,editingKey:I,data:_,currency:J,isEditing:function(e){return I===e},isDisabled:function(e){return I&&I!==e},setEditing:function(e,t){t||E(null),L(t?e:null)},setSection:y,machines:Z,cryptoCurrencies:K,twilioAvailable:Q,setSmsSetupPopup:R,mailgunAvailable:Y,setEmailSetupPopup:z};return!H&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(hT.Provider,{value:te,children:[f&&Object(qe.jsx)(ll,{title:"Notifications"}),r&&Object(qe.jsx)(BO,{title:"Setup",error:k&&!v,children:Object(qe.jsx)(VT,{forceDisable:!!I,wizard:g})}),o&&Object(qe.jsx)(BO,{title:"Transaction alerts",error:k&&"tx"===v,children:Object(qe.jsx)(UT,{section:"tx",fieldWidth:130})}),s&&Object(qe.jsxs)(BO,{title:"Fiat balance alerts",error:k&&"fiat"===v,children:[Object(qe.jsx)(FT,{section:"fiat",max:100,fieldWidth:50}),p&&Object(qe.jsx)(zT,{config:ss(Kc)(null===$||void 0===$?void 0:$.config),section:"fiat"})]}),m&&Object(qe.jsxs)(BO,{title:"Crypto balance alerts",error:k&&"crypto"===v,children:[Object(qe.jsx)(yT,{section:"crypto",fieldWidth:130}),p&&Object(qe.jsx)(NT,{section:"crypto",fieldWidth:130})]})]}),T&&Object(qe.jsxs)(Yh,{title:"Configure Twilio",width:478,handleClose:function(){return R(!1)},open:!0,children:[Object(qe.jsx)(Ke,{children:"In order for the SMS notifications to work, you'll first need to configure Twilio."}),Object(qe.jsx)(nx,{save:function(e){return E(null),X({variables:{accounts:{twilio:e}}}).then((function(){return F.a(ee(null),ds("sms"))({active:!0})}))},elements:ix.elements,validationSchema:ix.getValidationSchema})]}),W&&Object(qe.jsxs)(Yh,{title:"Configure Mailgun",width:478,handleClose:function(){return z(!1)},open:!0,children:[Object(qe.jsx)(Ke,{children:"In order for the mail notifications to work, you'll first need to configure Mailgun."}),Object(qe.jsx)(nx,{save:function(e){return E(null),X({variables:{accounts:{mailgun:e}}}).then((function(){return F.a(ee(null),ds("email"))({active:!0})}))},elements:zx.elements,validationSchema:zx.getValidationSchema})]})]})},KT=n(1105);function QT(){return(QT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function YT(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var JT=a.createElement("g",{id:"\\u21B3\\u21B3-Coin-ATM-Radar",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"operator-info_v4-CAR#1",transform:"translate(-832.000000, -608.000000)",fill:"#FF584A",fillRule:"nonzero"},a.createElement("g",{id:"Group",transform:"translate(832.000000, 608.000000)"},a.createElement("polygon",{id:"Line-7",points:"13.0484874 0 16 2.95151255 2.95151255 16 0 13.0484874"}),a.createElement("polygon",{id:"Line-7",transform:"translate(8.000000, 8.000000) scale(-1, 1) translate(-8.000000, -8.000000) ",points:"13.0484874 0 16 2.95151255 2.95151255 16 0 13.0484874"}))));function eR(e,t){var n=e.title,r=e.titleId,i=YT(e,["title","titleId"]);return a.createElement("svg",QT({width:"16px",height:"16px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"Group"):n?a.createElement("title",{id:r},n):null,JT)}var tR=a.forwardRef(eR);n.p;function nR(){return(nR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function aR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var rR=a.createElement("desc",null,"Created with Sketch."),iR=a.createElement("g",{id:"icon/table/true",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M4.17451294,13.3251347 L0.599425104,9.29667256 C-0.199808368,8.3960844 -0.199808368,6.94040225 0.599425104,6.03981409 C1.39865858,5.13922593 2.69051421,5.13922593 3.48974768,6.03981409 L5.61967423,8.439847 L12.5102523,0.675441122 C13.3094858,-0.225147041 14.6033855,-0.225147041 15.4005749,0.675441122 C16.1998084,1.57372599 16.1998084,3.03171143 15.4005749,3.93229959 L7.06483552,13.3251347 C6.66624082,13.7742771 6.14295752,14 5.61967423,14 C5.09639093,14 4.57310763,13.7742771 4.17451294,13.3251347 Z",id:"Fill-1",fill:"#48F694"}));function oR(e,t){var n=e.title,r=e.titleId,i=aR(e,["title","titleId"]);return a.createElement("svg",nR({width:"16px",height:"14px",viewBox:"0 0 16 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/table/true"):n?a.createElement("title",{id:r},n):null,rR,iR)}var lR,cR,sR,dR,uR,mR,hR=a.forwardRef(oR),pR=(n.p,{booleanPropertiesTableWrapper:{display:"flex",flexDirection:"column",width:396},tableRow:{display:"flex",alignItems:"center",justifyContent:"space-between","&:nth-child(even)":{backgroundColor:ae},"&:nth-child(odd)":{backgroundColor:G},minHeight:32,height:"auto",padding:[[8,16,8,24]],boxShadow:"0 0 0 0 rgba(0, 0, 0, 0)"},leftTableCell:{display:"flex",alignItems:"center",justifyContent:"left",width:200,padding:[0]},rightTableCell:{display:"flex",alignItems:"center",justifyContent:"right",padding:[0]},transparentButton:{"& > *":{margin:"auto 12px"},"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},rowWrapper:{display:"flex",alignItems:"center",position:"relative",flex:"wrap"},rightAligned:{marginLeft:"auto"},radioButtons:{display:"flex",flexDirection:"row",margin:[-15]},rightLink:{marginLeft:"20px"},fillColumn:yf.fillColumn,popoverContent:{width:272,padding:[[10,15]]}}),bR=Object(f.a)(pR),fR=function(e){var t=e.name;return"true"===Object(mn.f)().values[t]?Object(qe.jsx)(hR,{}):Object(qe.jsx)(tR,{})},jR=Object(a.memo)((function(e){var t=e.title,n=e.disabled,r=e.data,i=e.elements,o=e.save,c=e.forcedEditing,s=void 0!==c&&c,d=Uc.a(i.map((function(e){var t,n;return[e.name,null!==(t=null===(n=r[e.name])||void 0===n?void 0:n.toString())&&void 0!==t?t:null]}))),u=Uc.a(i.map((function(e){return[e.name,xn.b().required()]}))),m=Object(a.useState)(s),h=Object(l.a)(m,2),p=h[0],b=h[1],f=bR(),j=function(){var e=Object(Bl.a)(Rl.a.mark((function e(t){var n;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e,t){return gn.a(e,"true")},o(KT.a(n,M.a(Hr.a(D.a))(t))),b(!1);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=[{display:"Yes",code:"true"},{display:"No",code:"false"}];return Object(qe.jsx)("div",{className:f.booleanPropertiesTableWrapper,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:j,initialValues:d,schemaValidation:u,children:function(e){var a=e.resetForm;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsxs)("div",{className:f.rowWrapper,children:[Object(qe.jsx)(_e,{children:t}),p?Object(qe.jsxs)("div",{className:f.rightAligned,children:[Object(qe.jsx)(oa,{type:"submit",color:"primary",children:"Save"}),Object(qe.jsx)(oa,{type:"reset",className:f.rightLink,onClick:function(){a(),b(!1)},color:"secondary",children:"Cancel"})]}):Object(qe.jsx)(ta,{className:f.transparentButton,onClick:function(){return b(!0)},children:n?Object(qe.jsx)(Nh,{}):Object(qe.jsx)(Dh,{})})]}),Object(qe.jsx)(fm,{}),Object(qe.jsx)(Is,{className:f.fillColumn,children:Object(qe.jsx)(Ls,{className:f.fillColumn,children:i.map((function(e,t){return Object(qe.jsxs)(zs,{size:"sm",className:f.tableRow,children:[Object(qe.jsx)(Ps,{className:f.leftTableCell,children:e.display}),Object(qe.jsxs)(Ps,{className:f.rightTableCell,children:[p&&Object(qe.jsx)(mn.b,{component:li,name:e.name,options:g,className:I()(f.radioButtons,f.rightTableCell)}),!p&&Object(qe.jsx)(fR,{name:e.name})]})]},t)}))})})]})}})})})),gR={content:{display:"flex"},header:{display:"flex",alignItems:"center",position:"relative",flex:"wrap"},section:{marginBottom:52},row:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:28,width:600,"&:last-child":{marginBottom:0}},switchRow:{display:"flex",alignItems:"center",position:"relative",flex:"wrap",justifyContent:"space-between",width:396},switch:{display:"flex",alignItems:"center"},submit:{justifyContent:"flex-start",alignItems:"center",padding:[[0,4,4,4]],"& > button":{marginRight:40}},transparentButton:{"& > *":{margin:"auto 12px"},"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},infoMessage:{display:"flex",marginBottom:52,"& > p":{width:330,color:se,marginTop:4,marginLeft:16}},formErrorMsg:{margin:[[0,0,20,0]]}},OR=Object(f.a)(gR),xR=x()(lR||(lR=Object(c.a)(["\n query getData {\n config\n }\n"]))),vR=x()(cR||(cR=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),yR=Object(a.memo)((function(e){var t=e.title,n=e.disabled,a=void 0!==n&&n,r=e.checked,i=e.save,o=e.label,l=OR();return Object(qe.jsxs)("div",{className:l.switchRow,children:[Object(qe.jsx)(Ke,{children:t}),Object(qe.jsxs)("div",{className:l.switch,children:[Object(qe.jsx)(Lr,{disabled:a,checked:r,onChange:function(e){return i&&i(e.target.checked)}}),o&&Object(qe.jsx)(rt,{children:o})]})]})})),wR=Object(a.memo)((function(e){var t=e.wizard,n=OR(),a=Object(u.c)(xR).data,r=Object(u.b)(vR,{refetchQueries:["getData"]}),i=Object(l.a)(r,1)[0],o=function(e){return i({variables:{config:ds(as,e)}})},c=(null===a||void 0===a?void 0:a.config)&&ss(as,a.config);return c?Object(qe.jsx)("div",{className:n.content,children:Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:n.header,children:[Object(qe.jsx)(_e,{children:"Coin ATM Radar share settings"}),Object(qe.jsx)(Np,{width:304,children:Object(qe.jsxs)(Ke,{children:["For details on configuring this panel, please read the relevant knowledgebase article"," ",Object(qe.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://support.lamassu.is/hc/en-us/articles/360023720472-Coin-ATM-Radar",children:"here"}),"."]})})]}),Object(qe.jsx)(yR,{title:"Share information?",checked:c.active,save:function(e){return o({active:e})},label:c.active?"Yes":"No"}),Object(qe.jsx)(jR,{editing:t,title:"Machine info",data:c,elements:[{name:"commissions",display:"Commissions"},{name:"limitsAndVerification",display:"Limits and verification"}],save:o})]})}):null})),CR={field:{position:"relative",width:280,height:48,padding:[[0,4,4,0]]},notEditing:{display:"flex",flexDirection:"column","& > p:first-child":{height:16,lineHeight:"16px",fontSize:Ce,transformOrigin:"left",paddingLeft:0,margin:[[3,0,3,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",margin:0}}},kR=Object(f.a)(CR),ER=function(e){var t,n=e.editing,a=e.field,r=e.displayValue,i=Object(q.a)(e,["editing","field","displayValue"]),o=kR(),l=(t={},Object(z.a)(t,o.field,!0),Object(z.a)(t,o.notEditing,!n),t);return Object(qe.jsxs)("div",{className:I()(l),children:[!n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(it,{children:a.label}),Object(qe.jsx)(Je,{children:r(a.value)})]}),n&&Object(qe.jsx)(mn.b,Object(s.a)({id:a.name,name:a.name,component:a.component,placeholder:a.placeholder,type:a.type,label:a.label,width:280},i))]})},NR=x()(sR||(sR=Object(c.a)(["\n query getData {\n config\n }\n"]))),SR=x()(dR||(dR=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),IR=Object(f.a)(gR),LR=function(e){var t,n,r,i,o=e.wizard,c=IR(),s=Object(a.useState)(o||!1),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(null),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.b)(SR,{onCompleted:function(){return h(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return j(e)}}),O=Object(l.a)(g,1)[0],x=Object(u.c)(NR).data,v=function(e){return O({variables:{config:ds(Yc,e)}})},y=(null===x||void 0===x?void 0:x.config)&&ss(Yc,x.config);if(!y)return null;var w=xn.f().shape({active:xn.b(),name:xn.h(),phone:xn.h(),email:xn.h().email("Please enter a valid email address").required("An email is required"),website:xn.h(),companyNumber:xn.h()}),C=[{name:"name",label:"Full name",value:null!==(t=y.name)&&void 0!==t?t:"",component:si},{name:"phone",label:"Phone number",value:y.phone,component:si},{name:"email",label:"Email",value:null!==(n=y.email)&&void 0!==n?n:"",component:si},{name:"website",label:"Website",value:null!==(r=y.website)&&void 0!==r?r:"",component:si},{name:"companyNumber",label:"Company number",value:null!==(i=y.companyNumber)&&void 0!==i?i:"",component:si}],k=function(e){return Aa.a(W.a("name",e))(C)},E=function(e){return k(e).value},N=function(e){return e},S={initialValues:{active:y.active,name:E("name"),phone:E("phone"),email:E("email"),website:E("website"),companyNumber:E("companyNumber")}},L=function(e){return D.a(e.email)?null:e.email};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:c.header,children:Object(qe.jsx)(_e,{children:"Contact information"})}),Object(qe.jsxs)("div",{className:c.switchRow,children:[Object(qe.jsx)(Ke,{children:"Info card enabled?"}),Object(qe.jsxs)("div",{className:c.switch,children:[Object(qe.jsx)(Lr,{checked:y.active,onChange:function(e){return v({active:e.target.checked})}}),Object(qe.jsx)(rt,{children:y.active?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:c.section,children:[Object(qe.jsxs)("div",{className:c.header,children:[Object(qe.jsx)(_e,{children:"Info card"}),!m&&Object(qe.jsx)(ta,{className:c.transparentButton,onClick:function(){return h(!0)},children:Object(qe.jsx)(Dh,{})})]}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:S.initialValues,validationSchema:w,onSubmit:function(e){return v(w.cast(e))},onReset:function(){h(!1),j(null)},children:function(e){var t=e.errors;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(fm,{}),Object(qe.jsxs)("div",{className:c.row,children:[Object(qe.jsx)(ER,{field:k("name"),editing:m,displayValue:N,onFocus:function(){return j(null)}}),Object(qe.jsx)(ER,{field:k("phone"),editing:m,displayValue:N,onFocus:function(){return j(null)}})]}),Object(qe.jsxs)("div",{className:c.row,children:[Object(qe.jsx)(ER,{field:k("email"),editing:m,displayValue:N,onFocus:function(){return j(null)}}),Object(qe.jsx)(ER,{field:k("website"),editing:m,displayValue:N,onFocus:function(){return j(null)}})]}),Object(qe.jsx)("div",{className:c.row,children:Object(qe.jsx)(ER,{field:k("companyNumber"),editing:m,displayValue:N,onFocus:function(){return j(null)}})}),m&&!!L(t)&&Object(qe.jsx)(rl,{className:c.formErrorMsg,children:L(t)}),Object(qe.jsx)("div",{className:I()(c.row,c.submit),children:m&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(qe.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"}),f&&Object(qe.jsx)(rl,{children:"Failed to save changes"})]})})]})}})]}),!o&&Object(qe.jsxs)("div",{className:I()(c.section,c.infoMessage),children:[Object(qe.jsx)(ir,{}),Object(qe.jsx)(at,{children:"Sharing your information with your customers through your machines allows them to contact you in case there's a problem with a machine in your network or a transaction."})]})]})},FR=Object(f.a)(gR),PR=x()(uR||(uR=Object(c.a)(["\n query getData {\n config\n }\n"]))),DR=x()(mR||(mR=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),TR=Object(a.memo)((function(e){var t=e.wizard,n=FR(),a=Object(u.c)(PR).data,r=Object(u.b)(DR,{refetchQueries:function(){return["getData"]}}),i=Object(l.a)(r,1)[0],o=(null===a||void 0===a?void 0:a.config)&&ss(ns,a.config);return o?Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:n.header,children:Object(qe.jsx)(_e,{children:"Receipt options"})}),Object(qe.jsxs)("div",{className:n.switchRow,children:[Object(qe.jsx)(Ke,{children:"Enable receipt printing"}),Object(qe.jsxs)("div",{className:n.switch,children:[Object(qe.jsx)(Lr,{checked:o.active,onChange:function(e){return i({variables:{config:ds(ns,Gn.a(o,{active:e.target.checked}))}})}}),Object(qe.jsx)(rt,{children:o.active?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:n.switchRow,children:[Object(qe.jsx)(Ke,{children:"Offer SMS receipt"}),Object(qe.jsxs)("div",{className:n.switch,children:[Object(qe.jsx)(Lr,{checked:o.sms,onChange:function(e){return i({variables:{config:ds(ns,Gn.a(o,{sms:e.target.checked}))}})}}),Object(qe.jsx)(rt,{children:o.sms?"Yes":"No"})]})]}),Object(qe.jsx)(jR,{editing:t,title:"Visible on the receipt (options)",data:o,elements:[{name:"operatorWebsite",display:"Operator website"},{name:"operatorEmail",display:"Operator email"},{name:"operatorPhone",display:"Operator phone"},{name:"companyNumber",display:"Company number"},{name:"machineLocation",display:"Machine location"},{name:"customerNameOrPhoneNumber",display:"Customer name or phone number (if known)"},{name:"exchangeRate",display:"Exchange rate"},{name:"addressQRCode",display:"Address QR code"}],save:function(e){return i({variables:{config:ds(ns,e)}})}})]}):null}));function RR(){return(RR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function BR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var AR=a.createElement("desc",null,"Created with Sketch."),MR=a.createElement("defs",null,a.createElement("path",{d:"M17.8413132,12.8764646 C17.8413132,12.8764646 16.6555879,12.5091919 15.661533,12.2855556 C15.661533,12.2855556 15.3477198,10.3246465 14.8939121,8.23646465 C14.8939121,8.23646465 15.1560495,8.21373737 15.3383242,8.8710101 L16.0223242,12.0219192 C16.0223242,12.0219192 17.2343571,12.2991919 18.1795549,12.6537374 L17.8413132,12.8764646 Z M15.2603407,6.10282828 L15.5328132,5.80555556 C16.0627253,5.87828283 16.3483516,6.02828283 16.3483516,6.02828283 L16.291978,6.11191919 L16.3972088,6.9310101 C16.2440604,6.93646465 16.0091703,7.05919192 16.0091703,7.05919192 L15.8315934,6.95010101 L15.8315934,6.38282828 C15.3026209,6.29919192 15.2556429,6.21828283 15.2556429,6.21828283 L15.2603407,6.10282828 Z M12.4557527,18.2873737 C11.2831813,18.4964646 9.84565385,18.2237374 9.84565385,18.2237374 L9.89732967,17.9991919 C9.89732967,17.9991919 11.6496099,18.1955556 12.6248736,17.8973737 C12.5553462,18.0628283 12.5356154,18.1137374 12.4557527,18.2873737 L12.4557527,18.2873737 Z M9.18984066,14.5464646 C8.379,15.1364646 7.56064286,15.6791919 7.00442308,16.1091919 C6.9705989,16.6955556 6.91516484,17.6464646 6.91516484,17.6464646 L5.46448352,18.5182828 L5.22207692,18.3737374 C5.27845055,17.9219192 5.34891758,17.5882828 5.34891758,17.5882828 L5.55186264,17.4410101 C5.50676374,17.7282828 5.48515385,18.1346465 5.48515385,18.1346465 L6.5928956,17.440101 C6.63705495,16.7019192 6.72443407,15.960101 6.72443407,15.960101 C6.9705989,15.7373737 8.73697253,14.5237374 10.0100803,13.6864646 C10.0100803,13.6864646 10.018533,13.9437374 9.18984066,14.5464646 L9.18984066,14.5464646 Z M14.977533,0.195555556 C15.2612802,0.167373737 15.5065055,0.184646465 15.7103901,0.228282828 L15.7103901,0.228282828 L15.8813901,0.697373737 L16.1003077,0.361919192 C16.2694286,0.447373737 16.3746593,0.547373737 16.4056648,0.624646465 C16.4056648,0.624646465 16.3615055,0.909191919 16.4319725,1.36464646 C16.5005604,1.80373737 16.6988077,2.78191919 16.6988077,2.78191919 C16.9740989,3.00646465 17.2850934,3.51282828 17.2850934,3.51282828 C17.4758242,4.41737374 17.4645495,5.04919192 17.4636099,5.1210101 C16.6734396,4.68646465 15.6173736,4.58555556 15.6173736,4.58555556 L15.6173736,4.58555556 L15.2481264,4.90828283 C15.9753462,5.00828283 16.8792033,5.26555556 17.1122143,5.44555556 C17.2484505,5.74737374 17.3386484,6.22828283 17.3386484,6.22828283 L17.3386484,6.22828283 L17.0445659,6.58919192 L17.3198571,6.8810101 C17.3386484,7.22464646 17.2183846,7.56919192 17.2183846,7.56919192 C17.7905769,7.93010101 17.9512418,8.79373737 18.3101538,10.250101 C18.6700055,11.7064646 18.9903956,12.9055556 18.9903956,12.9055556 L18.9903956,12.9055556 L18.4567253,13.2019192 C19.1623352,15.7282828 18.444511,17.7391919 17.5378352,19.0664646 C16.6320989,20.3946465 16.0862143,21.7137374 16.1031264,22.8910101 L16.1031264,22.8910101 L16.5475385,23.2346465 L16.7749121,23.9491919 L14.3048077,23.9491919 L14.293533,23.2728283 C14.2925934,21.5619192 14.9230385,20.1328283 14.9230385,20.1328283 C15.2857088,20.0473737 15.6596538,19.7628283 15.6596538,19.7628283 C15.0733681,19.8828283 14.3414505,19.7964646 14.3414505,19.7964646 C14.8676044,18.8537374 15.0292088,18.1773737 15.0292088,18.1773737 L15.0292088,18.1773737 L14.7811648,18.1228283 C14.6956648,18.310101 14.6073462,18.4937374 14.5133901,18.6710101 C13.8754286,19.8864646 13.1735769,20.6628283 12.7554725,22.4055556 L12.7554725,22.4055556 L13.1933077,22.7455556 L13.6987912,23.9491919 L10.8509835,23.9491919 C10.8340714,21.8246465 11.495522,20.2273737 11.7341703,19.7628283 C10.2233571,19.9264646 8.42128022,19.1782828 6.99314835,19.4664646 C6.60041209,21.9473737 4.59257143,22.4355556 3.65019231,22.300101 L3.65019231,22.300101 L2.97652747,23.4146465 L3.58724176,23.9491919 L1.33135714,23.9491919 C1.32008242,23.8546465 1.2918956,23.7537374 1.22988462,23.6591919 C1.22988462,23.6591919 1.97401648,22.5882828 2.48231868,21.150101 C2.89008791,21.3255556 3.75166484,20.9928283 3.78736813,20.1055556 C3.82401099,19.2191919 3.67086264,17.8419192 4.46854945,16.7891919 C5.2652967,15.7355556 6.12687363,15.1655556 7.25152747,14.3328283 C7.98250549,13.7910101 9.22084615,12.8755556 9.99974176,12.3010101 L9.99974176,12.3010101 L9.61546154,12.3864646 L6.81087363,14.6491919 L5.82997253,14.6491919 L8.66368681,12.1164646 L8.29725824,12.1091919 L5.33576374,14.6491919 L4.34170879,14.6491919 L7.27313736,11.720101 L6.9208022,11.7173737 L3.88038462,14.6491919 L2.86565934,14.6491919 L5.8093022,11.3037374 L5.46918132,11.3055556 L2.43534066,14.6491919 L1.36706044,14.6491919 L4.22614286,10.8528283 L3.89635714,10.8573737 L0.963989011,14.6491919 L0,14.6491919 C0,14.6491919 4.11809341,8.22464646 4.92893407,7.00737374 C5.73883516,5.79010101 6.6192033,4.62282828 8.06894505,4.38464646 C9.53465934,4.14282828 10.5343516,4.46646465 11.2502967,5.63373737 C11.636456,6.2610101 12.1034176,6.97828283 12.4698462,7.55919192 C12.0968407,8.1510101 11.6298791,8.6110101 11.5857198,9.32282828 C11.534044,10.1419192 12.0921429,10.6373737 12.6558791,10.6773737 C12.2321374,10.5282828 11.8976538,10.0337374 12.0489231,9.37646465 C12.2058297,8.69737374 12.7554725,8.35191919 13.1726374,7.80282828 C13.5315495,7.32828283 13.5371868,6.63282828 13.5108791,6.4010101 C13.4836319,6.16919192 13.2167967,5.98828283 13.2167967,5.98828283 C13.2167967,5.98828283 13.2252527,5.52373737 13.2167967,5.01646465 C13.2083407,4.51010101 13.4300769,4.21828283 13.4300769,4.21828283 C13.4300769,4.21828283 13.4216209,3.4610101 13.3943736,2.57646465 C13.3671264,1.72555556 13.2863242,1.46828283 13.205522,1.35464646 C13.205522,1.35464646 13.2694121,1.10919192 13.5099396,0.844646465 L13.5099396,0.844646465 L13.7542253,1.06282828 L13.8284505,0.571919192 C13.9825385,0.469191919 14.1723297,0.375555556 14.4072198,0.307373737 C14.4325879,0.30010101 14.4570165,0.294646465 14.4823846,0.288282828 L14.4823846,0.288282828 L14.7896209,0.644646465 Z M7.71628243,19.8937938 C8.32897736,19.8402566 9.02386307,19.9393405 9.75797621,20.0432188 L9.75797621,20.0432188 L9.86538462,20.058401 C9.7449004,20.8103202 9.02106112,21.7691969 7.79193531,22.0896215 L7.79193531,22.0896215 L9.01358923,23.5151515 L7.36136769,23.5151515 C7.15589073,23.2226941 6.50396838,22.32135 6.16586538,21.9681638 C6.72065317,21.6525335 7.42954868,21.0388524 7.71628243,19.8937938 Z",id:"path-1"})),WR=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-128.000000, -14.000000)"},a.createElement("g",{id:"icon/lamassu-logo",transform:"translate(128.000000, 14.000000)"},a.createElement("g",{id:"color/amaz/default"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("use",{id:"Mask",fill:"#FFFFFF",xlinkHref:"#path-1"})))));function zR(e,t){var n=e.title,r=e.titleId,i=BR(e,["title","titleId"]);return a.createElement("svg",RR({width:"19px",height:"24px",viewBox:"0 0 19 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,AR,MR,WR)}var qR=a.forwardRef(zR),$R=(n.p,{header:{display:"flex",position:"relative",alignItems:"center",justifyContent:"space-between",width:800},form:{"& > *":{marginTop:20},display:"flex",flexDirection:"column",height:"100%"},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},submit:{margin:[["auto",0,0,"auto"]]},smsPreview:{position:"absolute",left:function(e){return e.x},bottom:function(e){return e.y},width:350,overflow:"visible"},smsPreviewContainer:{display:"flex",flexDirection:"row",alignItems:"flex-end","& > *":{marginRight:10}},smsPreviewIcon:{display:"flex",width:36,height:36,borderRadius:18,backgroundColor:"#16D6D3",alignItems:"center",justifyContent:"center"},smsPreviewContent:{width:225,padding:15,borderRadius:"15px 15px 15px 0px"},chipButtons:{width:480,display:"flex",flexDirection:"column",alignItems:"space-between","& > div":{marginTop:15},"& > div:first-child":{marginTop:0},"& > div > div":{margin:[[0,5,0,5]]},"& > div > div > span":{lineHeight:"120%",color:ce,fontSize:Ce,fontFamily:Oe,fontWeight:500},marginLeft:"auto",marginRight:"auto"},resetToDefault:{width:145},messageWithTooltip:{display:"flex",flexDirection:"row",alignItems:"center"}}),HR=n(1106);function VR(){return(VR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function UR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var GR=a.createElement("desc",null,"Created with Sketch."),XR=a.createElement("g",{id:"icon/button/retry/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#FFFFFF"},a.createElement("path",{d:"M7.1942452e-14,9.603 L0.002,3.598 C0.003,1.611 1.614,-5.86197757e-14 3.602,-5.86197757e-14 L8.4,-5.86197757e-14 C10.39,-5.86197757e-14 12.001,1.613 12,3.601 L11.998,7.205 C11.998,9.192 10.386,10.803 8.398,10.803 L3,10.803",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"4.2002 9.601 3.0002 10.8 4.2002 12"})));function _R(e,t){var n=e.title,r=e.titleId,i=UR(e,["title","titleId"]);return a.createElement("svg",VR({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,GR,XR)}var ZR=a.forwardRef(_R);n.p;function KR(){return(KR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function QR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var YR=a.createElement("desc",null,"Created with Sketch."),JR=a.createElement("g",{id:"icon/button/retry/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#1B2559"},a.createElement("path",{d:"M7.1942452e-14,9.603 L0.002,3.598 C0.003,1.611 1.614,-5.86197757e-14 3.602,-5.86197757e-14 L8.4,-5.86197757e-14 C10.39,-5.86197757e-14 12.001,1.613 12,3.601 L11.998,7.205 C11.998,9.192 10.386,10.803 8.398,10.803 L3,10.803",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"4.2002 9.601 3.0002 10.8 4.2002 12"})));function eB(e,t){var n=e.title,r=e.titleId,i=QR(e,["title","titleId"]);return a.createElement("svg",KR({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,YR,JR)}var tB,nB,aB,rB,iB,oB,lB,cB,sB,dB,uB,mB,hB,pB,bB=a.forwardRef(eB),fB=(n.p,Object(f.a)($R)),jB=function(e,t,n){return e&&t?n?"Internal server error":e.event&&t.event?e.event:e.message&&t.message?e.message:null:null},gB={smsCode:{validator:xn.h().required("The message content is required!").trim().test({name:"has-code",message:"The confirmation code is missing from the message!",exclusive:!1,test:function(e){var t;return(null===e||void 0===e||null===(t=e.match(/#code/g))||void 0===t?void 0:t.length)>0}}).test({name:"has-single-code",message:"There should be a single confirmation code!",exclusive:!1,test:function(e){var t;return 1===(null===e||void 0===e||null===(t=e.match(/#code/g))||void 0===t?void 0:t.length)}})},cashOutDispenseReady:{validator:xn.h().required("The message content is required!").trim()},smsReceipt:{validator:xn.h().trim()}},OB={smsCode:[{code:"#code",display:"Confirmation code",obligatory:!0},{code:"#timestamp",display:"Timestamp",obligatory:!1}],cashOutDispenseReady:[{code:"#timestamp",display:"Timestamp",obligatory:!1}],smsReceipt:[{code:"#timestamp",display:"Timestamp",obligatory:!1}]},xB={smsCode:"Your cryptomat code: #code",cashOutDispenseReady:"Your cash is waiting! Go to the Cryptomat and press Redeem within 24 hours. [#timestamp]",smsReceipt:""},vB=function(e){var t,n,a=e.showModal,r=e.onClose,i=e.sms,o=e.creationError,l=e.submit,c=fB(),s={event:D.a(i)?"":i.event,message:D.a(i)?"":i.message},d=xn.f().shape({event:xn.h().required("An event is required!"),message:null!==(t=null===(n=gB[null===i||void 0===i?void 0:i.event])||void 0===n?void 0:n.validator)&&void 0!==t?t:xn.h().required("The message content is required!").trim()});return Object(qe.jsx)(qe.Fragment,{children:a&&Object(qe.jsx)(Yh,{title:"SMS notice - ".concat(null===i||void 0===i?void 0:i.messageName),closeOnBackdropClick:!0,width:600,height:500,open:!0,handleClose:r,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:s,validationSchema:d,onSubmit:function(e,t,n){return function(e){l(i?{variables:{id:i.id,event:e.event,message:e.message}}:{variables:{event:e.event,message:e.message}}),r()}(e)},children:function(e){var t=e.values,n=e.errors,a=e.touched,r=e.setFieldValue;return Object(qe.jsxs)(mn.d,{id:"sms-notice",className:c.form,children:[Object(qe.jsx)(He,{color:"primary",Icon:bB,InverseIcon:ZR,className:c.resetToDefault,type:"button",onClick:function(){return r("message",xB[null===i||void 0===i?void 0:i.event])},children:"Reset to default"}),Object(qe.jsx)(mn.b,{name:"message",label:"Message content",fullWidth:!0,multiline:!0,rows:6,component:si}),bn.a(OB[null===i||void 0===i?void 0:i.event])>0&&Object(qe.jsx)(Ye,{noMargin:!0,children:"Values to attach"}),Object(qe.jsx)("div",{className:c.chipButtons,children:T.a((function(e){return Object(qe.jsx)("div",{children:T.a((function(e){return Object(qe.jsx)(Ar.a,{label:e.display,size:"small",style:{backgroundColor:G},disabled:L.a(e.code,t.message),className:c.chip,onClick:function(){r("message",t.message.concat(" "===LC.a(t.message)?"":" ",e.code))}})}),e)})}),HR.a(3,OB[null===i||void 0===i?void 0:i.event]))}),Object(qe.jsxs)("div",{className:c.footer,children:[jB(n,a,o)&&Object(qe.jsx)(rl,{children:jB(n,a,o)}),Object(qe.jsx)(An,{type:"submit",form:"sms-notice",className:c.submit,children:"Confirm"})]})]})}})})})},yB=Object(f.a)($R),wB=x()(tB||(tB=Object(c.a)(["\n query SMSNotices {\n SMSNotices {\n id\n event\n message\n messageName\n enabled\n allowToggle\n }\n config\n }\n"]))),CB=x()(nB||(nB=Object(c.a)(["\n mutation editSMSNotice($id: ID!, $event: SMSNoticeEvent!, $message: String!) {\n editSMSNotice(id: $id, event: $event, message: $message) {\n id\n }\n }\n"]))),kB=x()(aB||(aB=Object(c.a)(["\n mutation enableSMSNotice($id: ID!) {\n enableSMSNotice(id: $id) {\n id\n }\n }\n"]))),EB=x()(rB||(rB=Object(c.a)(["\n mutation disableSMSNotice($id: ID!) {\n disableSMSNotice(id: $id) {\n id\n }\n }\n"]))),NB=function(e,t){var n=new RegExp(Object.keys(t).join("|"),"gi");return e.replace(n,(function(e){return t[e.toLowerCase()]}))},SB=function(e){var t=rS.a(/\n/)(e);return T.a((function(e,n){return n===t.length?Object(qe.jsx)(qe.Fragment,{children:e}):Object(qe.jsxs)(qe.Fragment,{children:[e,Object(qe.jsx)("br",{})]})}),t)},IB={smsCode:"",cashOutDispenseReady:"",smsReceipt:SB("The contents of this notice will be appended to the end of the SMS receipt sent, and not replace it.\n\n To edit the contents of the SMS receipt, please go to the 'Receipt' tab")},LB=function(e){var t=e.sms,n=e.coords,a=e.timezone,r=yB(n),i={"#code":123,"#timestamp":md(new Date,a,"HH:mm")};return Object(qe.jsx)("div",{className:r.smsPreview,children:Object(qe.jsxs)("div",{className:r.smsPreviewContainer,children:[Object(qe.jsx)("div",{className:r.smsPreviewIcon,children:Object(qe.jsx)(qR,{width:22,height:22})}),Object(qe.jsx)(Un.a,{className:r.smsPreviewContent,children:Object(qe.jsx)(Ke,{noMargin:!0,children:Wa.a(null===t||void 0===t?void 0:t.message)?Object(qe.jsx)("i",{children:"No content available"}):SB(NB(null===t||void 0===t?void 0:t.message,i))})}),Object(qe.jsx)(it,{children:md(new Date,a,"HH:mm")})]})})},FB=function(){var e=yB(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)({x:0,y:0}),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(""),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(u.c)(wB),k=C.data,E=C.loading,N=A.a(["config","locale_timezone"])(k),S=Object(u.b)(CB,{onError:function(e){var t=e.msg;return w(t)},refetchQueries:function(){return["SMSNotices"]}}),I=Object(l.a)(S,1)[0],L=Object(u.b)(kB,{onError:function(e){var t=e.msg;return w(t)},refetchQueries:function(){return["SMSNotices"]}}),F=Object(l.a)(L,1)[0],P=Object(u.b)(EB,{onError:function(e){var t=e.msg;return w(t)},refetchQueries:function(){return["SMSNotices"]}}),D=Object(l.a)(P,1)[0],T=E,B=[{header:"Message name",width:500,size:"sm",textAlign:"left",view:function(t){return Wa.a(IB[t.event])?R.a("messageName",t):Object(qe.jsxs)("div",{className:e.messageWithTooltip,children:[R.a("messageName",t),Object(qe.jsx)(Np,{width:250,children:Object(qe.jsx)(Ke,{children:IB[t.event]})})]})}},{header:"Edit",width:100,size:"sm",textAlign:"center",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){b(!1),d(e),i(!0)},children:Object(qe.jsx)(Dh,{})})}},{header:"Enable",width:100,size:"sm",textAlign:"center",view:function(e){return Object(qe.jsx)(Lr,{disabled:!e.allowToggle,onClick:function(){e.enabled?D({variables:{id:e.id}}):F({variables:{id:e.id}})},checked:e.enabled})}},{header:"",width:100,size:"sm",textAlign:"center",view:function(e){return Object(qe.jsx)(ta,{onClick:function(t){d(e),O({x:t.currentTarget.getBoundingClientRect().right+50,y:window.innerHeight-5-t.currentTarget.getBoundingClientRect().bottom}),gn.a(s,e)?b(!p):b(!0)},children:gn.a(s,e)&&p?Object(qe.jsx)(Cg,{}):Object(qe.jsx)(hg,{})})}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:e.header,children:Object(qe.jsx)(_e,{children:"SMS notices"})}),r&&Object(qe.jsx)(vB,{showModal:r,onClose:function(){i(!1),d(null)},sms:s,creationError:y,submit:I}),p&&Object(qe.jsx)(LB,{sms:s,coords:g,timezone:N}),Object(qe.jsx)(By,{emptyText:"No SMS notices so far",elements:B,loading:T,data:A.a(["SMSNotices"])(k)})]})},PB=Object(f.a)({field:{position:"relative",width:280,padding:[[0,4,4,0]]},notEditing:{display:"flex",flexDirection:"column"},notEditingSingleLine:{"& > p:first-child":{height:16,lineHeight:"16px",transform:"scale(0.75)",transformOrigin:"left",paddingLeft:0,margin:[[1,0,6,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",height:25,margin:0}},notEditingMultiline:{"& > p:first-child":{height:16,lineHeight:"16px",transform:"scale(0.75)",transformOrigin:"left",paddingLeft:0,margin:[[1,0,5,0]]},"& > p:last-child":{width:502,height:121,overflowY:"auto",lineHeight:"19px",wordWrap:"anywhere",margin:0}}}),DB=function(e){var t,n=e.editing,a=e.name,r=e.width,i=e.placeholder,o=e.label,l=e.value,c=e.multiline,d=void 0!==c&&c,u=e.rows,m=e.onFocus,h=Object(q.a)(e,["editing","name","width","placeholder","label","value","multiline","rows","onFocus"]),p=PB(),b=(t={},Object(z.a)(t,p.field,!0),Object(z.a)(t,p.notEditing,!n),Object(z.a)(t,p.notEditingSingleLine,!n&&!d),Object(z.a)(t,p.notEditingMultiline,!n&&d),t);return Object(qe.jsxs)("div",{className:I()(b),children:[!n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(it,{children:o}),Object(qe.jsx)(Je,{children:l})]}),n&&Object(qe.jsx)(mn.b,Object(s.a)({id:a,name:a,component:si,width:r,placeholder:i,type:"text",label:o,multiline:d,rows:u,rowsMax:"6",onFocus:m},h))]})},TB=x()(iB||(iB=Object(c.a)(["\n query getData {\n config\n }\n"]))),RB=x()(oB||(oB=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),BB=Object(f.a)(gR),AB=function(){var e,t,n,r,i,o,c,s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.b)(RB,{onCompleted:function(){h(null),j(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return h(e)}}),O=Object(l.a)(g,1)[0],x=BB(),v=Object(u.c)(TB).data,y=(null===v||void 0===v?void 0:v.config)&&ss(rs,v.config),w=null!==y&&void 0!==y?y:{},C=null!==(e=null===y||void 0===y?void 0:y.active)&&void 0!==e&&e,k=null!==(t=null===y||void 0===y?void 0:y.delay)&&void 0!==t&&t,E=null!==(n=null===y||void 0===y?void 0:y.tcPhoto)&&void 0!==n&&n,N=function(e){return O({variables:{config:ds(rs,e)}})},S=[{name:"title",label:"Screen title",value:null!==(r=w.title)&&void 0!==r?r:"",width:282},{name:"text",label:"Text content",value:null!==(i=w.text)&&void 0!==i?i:"",width:502,multiline:!0,rows:6},{name:"acceptButtonText",label:"Accept button text",value:null!==(o=w.acceptButtonText)&&void 0!==o?o:"",placeholder:"I accept",width:282},{name:"cancelButtonText",label:"Cancel button text",value:null!==(c=w.cancelButtonText)&&void 0!==c?c:"",placeholder:"Cancel",width:282}],L=function(e){return function(e){return Aa.a(W.a("name",e))(S)}(e).value},F={title:L("title"),text:L("text"),acceptButtonText:L("acceptButtonText"),cancelButtonText:L("cancelButtonText")},P=xn.f().shape({title:xn.h().required().max(50,"Too long"),text:xn.h().required(),acceptButtonText:xn.h().required().max(50,"Too long"),cancelButtonText:xn.h().required().max(50,"Too long")});return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:x.header,children:Object(qe.jsx)(_e,{children:"Terms & Conditions"})}),Object(qe.jsxs)("div",{className:x.switchRow,children:[Object(qe.jsx)(Ke,{children:"Show on screen"}),Object(qe.jsxs)("div",{className:x.switch,children:[Object(qe.jsx)(Lr,{checked:C,onChange:function(e){return N({active:e.target.checked})}}),Object(qe.jsx)(rt,{children:C?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:x.switchRow,children:[Object(qe.jsxs)(Ke,{children:["Capture customer photo on acceptance ",Object(qe.jsx)("br",{})," of Terms & Conditions screen"]}),Object(qe.jsxs)("div",{className:x.switch,children:[Object(qe.jsx)(Lr,{checked:E,onChange:function(e){return N({tcPhoto:e.target.checked})}}),Object(qe.jsx)(rt,{children:E?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:x.switchRow,children:[Object(qe.jsx)(Ke,{children:"Add 7 seconds delay on screen"}),Object(qe.jsxs)("div",{className:x.switch,children:[Object(qe.jsx)(Lr,{checked:k,onChange:function(e){return N({delay:e.target.checked})}}),Object(qe.jsx)(rt,{children:k?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:x.header,children:[Object(qe.jsx)(Ye,{children:"Info card"}),!f&&Object(qe.jsx)(ta,{className:x.transparentButton,onClick:function(){return j(!0)},children:Object(qe.jsx)(Dh,{})})]}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:F,validationSchema:P,onSubmit:function(e){return N(e)},onReset:function(){j(!1),h(null)},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(fm,{}),S.map((function(e,t){return Object(qe.jsx)("div",{className:x.row,children:Object(qe.jsx)(DB,{editing:f,name:e.name,width:e.width,placeholder:e.placeholder,label:e.label,value:e.value,multiline:e.multiline,rows:e.rows,onFocus:function(){return h(null)}})},t)})),Object(qe.jsx)("div",{className:I()(x.row,x.submit),children:f&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(qe.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"}),m&&Object(qe.jsx)(rl,{children:"Failed to save changes"})]})})]})})]})},MB={running:ne,notRunning:pe},WB={running:"#ecfbef",notRunning:he},zB={uptimeContainer:{display:"inline-block",minWidth:104,margin:[[0,20]]},name:{extend:Me.label1,paddingLeft:4,color:se}},qB=Object(f.a)(zB),$B=Object(f.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return WB[t]}},label:{fontSize:ke,fontWeight:Ie,fontFamily:Le,padding:[[4,8]],color:function(e){var t=e.type;return MB[t]}}}),HB=function(e){var t,n=e.process,a=(Object(q.a)(e,["process"]),qB());return Object(qe.jsxs)("div",{className:a.uptimeContainer,children:[Object(qe.jsx)("div",{className:a.name,children:On.a(n.name)}),Object(qe.jsx)(Ar.a,{label:"RUNNING"===n.state?"Running for ".concat((t=n.uptime,t<60?"".concat(t,"s"):t<3600?"".concat(Math.floor(t/60),"m"):t<86400?"".concat(Math.floor(t/60/60),"h"):"".concat(Math.floor(t/60/60/24),"d"))):zm(n.state),classes:$B({type:"RUNNING"===n.state?"running":"notRunning"})})]})},VB={serverTableWrapper:{extend:yf.tableWrapper,maxWidth:"100%",marginLeft:0},serverVersion:{extend:Me.p,color:se,margin:"auto 0 auto 0"},headerLine2:{display:"flex",justifyContent:"space-between",marginBottom:24},uptimeContainer:{margin:"auto 0 auto 0"}},UB=Gn.a(yf,VB),GB=Object(f.a)(UB),XB={code:"SHOW_ALL",display:"Show all"},_B=x()(lB||(lB=Object(c.a)(["\n query ServerData($limit: Int, $from: Date, $until: Date, $timezone: String) {\n serverLogsCsv(\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n }\n"]))),ZB=x()(cB||(cB=Object(c.a)(["\n query ServerData($limit: Int, $from: Date, $until: Date) {\n serverVersion\n uptime {\n name\n state\n uptime\n }\n serverLogs(limit: $limit, from: $from, until: $until) {\n logLevel\n id\n timestamp\n message\n }\n }\n"]))),KB=x()(sB||(sB=Object(c.a)(["\n query getData {\n config\n }\n"]))),QB=function(){var e,t,n=GB(),r=Object(a.useRef)(),i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(XB),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(u.c)(ZB,{onCompleted:function(){return s("")},variables:{limit:500}}),f=b.data,j=b.loading,g=Object(u.c)(KB),O=g.data,x=g.loading,v=A.a(["config","locale_timezone"],O),y=null===f||void 0===f?void 0:f.serverVersion,w=null!==(e=null===f||void 0===f?void 0:f.uptime)&&void 0!==e?e:[],C=F.a(um.a(XB),Ag.a,ml.a([{code:"error",display:"Error"},{code:"info",display:"Info"},{code:"debug",display:"Debug"}]),T.a((function(e){return{code:A.a(["logLevel"])(e),display:$m(A.a(["logLevel"])(e))}})),A.a(["serverLogs"])),k=j||x;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:n.titleWrapper,children:[Object(qe.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(qe.jsx)(yn,{children:"Server"}),f&&Object(qe.jsxs)("div",{className:n.buttonsWrapper,children:[Object(qe.jsx)(tD,{title:"Download logs",name:"server-logs",query:_B,args:{timezone:v},logs:f.serverLogs,getLogs:function(e){return A.a(["serverLogsCsv"])(e)},timezone:v}),Object(qe.jsx)(Je,{children:c})]})]}),Object(qe.jsx)("div",{className:n.serverVersion,children:y&&Object(qe.jsxs)("span",{children:["Server version: v",y]})})]}),Object(qe.jsxs)("div",{className:n.headerLine2,children:[f&&Object(qe.jsx)(sh,{onSelectedItemChange:function(e){r.current&&r.current.scrollTo(0,0),p(e)},label:"Level",items:C(f),default:XB,selectedItem:h}),Object(qe.jsx)("div",{className:n.uptimeContainer,children:w&&w.map((function(e,t){return Object(qe.jsx)(HB,{process:e},t)}))})]}),Object(qe.jsx)("div",{className:n.wrapper,children:Object(qe.jsxs)("div",{ref:r,className:n.serverTableWrapper,children:[Object(qe.jsxs)(Is,{className:n.table,children:[Object(qe.jsx)(Ds,{children:Object(qe.jsxs)(zs,{header:!0,children:[Object(qe.jsx)(Bs,{className:n.dateColumn,children:"Date"}),Object(qe.jsx)(Bs,{className:n.levelColumn,children:"Level"}),Object(qe.jsx)(Bs,{className:n.fillColumn})]})}),Object(qe.jsx)(Ls,{children:f&&f.serverLogs.filter((function(e){return h===XB||e.logLevel===h.code})).map((function(e,t){return Object(qe.jsxs)(zs,{size:"sm",children:[Object(qe.jsx)(Ps,{children:v&&md(e.timestamp,v,"yyyy-MM-dd HH:mm")}),Object(qe.jsx)(Ps,{children:e.logLevel}),Object(qe.jsx)(Ps,{children:e.message})]},t)}))})]}),k&&Object(qe.jsx)(_e,{children:"Loading..."}),!k&&!(null===f||void 0===f||null===(t=f.serverLogs)||void 0===t?void 0:t.length)&&Object(qe.jsx)(_e,{children:"No activity so far"})]})})]})},YB=n(1138),JB=n(1107),eA={tr:function(e){return{margin:0,height:e.height}},table:function(e){return{width:e.width}},head:{display:"flex",flex:1,justifyContent:"space-between",alignItems:"center",paddingRight:12},button:{marginBottom:1},itemWrapper:{display:"flex",flexDirection:"column",marginTop:16,minHeight:35},label:{extend:Me.label1,color:se,marginBottom:4},item:{extend:Me.p,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},tA=Object(f.a)(eA),nA=function(e){var t=e.width,n=void 0===t?378:t,a=e.height,r=void 0===a?128:a,i=e.title,o=e.items,l=e.onEdit,c=e.className,s=tA({width:n,height:r});return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)(wm,{className:I()(c,s.table),children:[Object(qe.jsx)(Cm,{children:Object(qe.jsxs)(Sm,{className:s.head,children:[i,Object(qe.jsx)(ta,{onClick:l,className:s.button,children:Object(qe.jsx)(dN,{})})]})}),Object(qe.jsx)(Em,{children:Object(qe.jsx)(Lm,{className:s.tr,children:Object(qe.jsx)(Nm,{width:n,children:o&&Object(qe.jsxs)(qe.Fragment,{children:[o[0]&&Object(qe.jsxs)("div",{className:s.itemWrapper,children:[Object(qe.jsx)("div",{className:s.label,children:o[0].label}),Object(qe.jsx)("div",{className:s.item,children:o[0].value})]}),o[1]&&Object(qe.jsxs)("div",{className:s.itemWrapper,children:[Object(qe.jsx)("div",{className:s.label,children:o[1].label}),Object(qe.jsx)("div",{className:s.item,children:o[1].value})]})]})})})})]})})},aA=x()(dB||(dB=Object(c.a)(["\n query getData {\n accounts\n config\n }\n"]))),rA=x()(uB||(uB=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),iA=Object(f.a)({wrapper:{marginLeft:1}}),oA=function(){var e,t=Object(a.useState)(null),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(u.c)(aA).data,c=Object(u.b)(rA,{onCompleted:function(){return i(null)},refetchQueries:["getData"]}),d=Object(l.a)(c,1)[0],m=iA(),p=null!==(e=null===o||void 0===o?void 0:o.accounts)&&void 0!==e?e:{},b=function(e,t){var n=M.a(R.a("face"))(t),a=p[e]||{};return T.a((function(e){var t,n=e.display,r=e.code;return{label:n,value:e.long?(t=a[r],!t||t.length<=20?t:"".concat(t.slice(0,8),"(...)").concat(t.slice(t.length-8,t.length))):a[r]}}))(n)};return Object(qe.jsxs)("div",{className:m.wrapper,children:[Object(qe.jsx)(ll,{title:"3rd Party Services"}),Object(qe.jsx)(h.a,{container:!0,spacing:4,children:gd.a(qx).map((function(e){return Object(qe.jsx)(h.a,{item:!0,children:Object(qe.jsx)(nA,{editMessage:"Configure "+e.title,title:e.title,onEdit:function(){return i(e)},items:b(e.code,e.elements)})},e.code)}))}),r&&Object(qe.jsx)(Yh,{title:"Edit ".concat(r.name),width:525,handleClose:function(){return i(null)},open:!0,children:Object(qe.jsx)(nx,{save:function(e){return d({variables:{accounts:Object(z.a)({},r.code,e)}})},elements:function(e){var t=e.code,n=e.elements;return T.a((function(e){return e.component===ri?function(e){var t=e.settings,n=YB.a(["config",t.field]),a=!!D.a(t.requirement)||gn.a(JB.a(n,o),t.requirement);return t.enabled=a,e}(e):e.component!==ci?e:Object(s.a)(Object(s.a)({},e),{},{inputProps:{isPasswordFilled:!D.a(p[t])&&!D.a(A.a([e.code],p[t]))}})}),n)}(r),validationSchema:function(e){var t=e.code,n=e.getValidationSchema;return n(p[t])}(r),value:function(e){var t=e.elements,n=e.code,a=p[n],r=M.a(W.a("component",ci)),i=T.a(R.a(["code"])),o=F.a(i,r)(t);return KT.a((function(e,t){return L.a(t,o)?"":e}),a)}(r)})})]})},lA=n(565),cA=n.n(lA),sA=x()(mB||(mB=Object(c.a)(["\n query sessions {\n sessions {\n sid\n sess\n expire\n }\n }\n"]))),dA=x()(hB||(hB=Object(c.a)(["\n mutation deleteSession($sid: String!) {\n deleteSession(sid: $sid) {\n sid\n }\n }\n"]))),uA=x()(pB||(pB=Object(c.a)(["\n query getData {\n config\n }\n"]))),mA=function(){var e=Object(u.c)(sA),t=e.data,n=e.loading,a=Object(u.b)(dA,{refetchQueries:function(){return["sessions"]}}),r=Object(l.a)(a,1)[0],i=Object(u.c)(uA),o=i.data,c=i.loading,s=A.a(["config","locale_timezone"],o),d=n||c,m=[{header:"Login",width:207,textAlign:"left",size:"sm",view:function(e){return e.sess.user.username}},{header:"Last known use",width:305,textAlign:"left",size:"sm",view:function(e){if(D.a(e.sess.ua))return"No Record";var t=cA()(e.sess.ua);return"".concat(t.browser.name," ").concat(t.browser.version," on ").concat(t.os.name," ").concat(t.os.version)}},{header:"Last known location",width:250,textAlign:"left",size:"sm",view:function(e){return"localhost"===(t=e.sess.ipAddress)||"::1"===t||"127.0.0.1"===t?"This device":e.sess.ipAddress;var t}},{header:"Expiration date",width:290,textAlign:"right",size:"sm",view:function(e){return"".concat(md(e.expire,s,"yyyy-MM-dd")," ").concat(md(e.expire,s,"HH:mm:ss"))}},{header:"",width:80,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){r({variables:{sid:e.sid}})},children:Object(qe.jsx)(vh,{})})}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ll,{title:"Session Management"}),Object(qe.jsx)(By,{loading:d,elements:m,data:A.a(["sessions"])(t)})]})};function hA(){return(hA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function pA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var bA=a.createElement("defs",null,a.createElement("circle",{id:"path-1-right",cx:10,cy:10,r:10})),fA=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-232.000000, -187.000000)"},a.createElement("g",{id:"icon/sf-contain-b-copy-4",transform:"translate(242.000000, 197.000000) scale(-1, 1) rotate(-270.000000) translate(-242.000000, -197.000000) translate(232.000000, 187.000000)"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1-right"})),a.createElement("use",{id:"Mask",fill:"#FFFFFF",fillRule:"nonzero",xlinkHref:"#path-1-right"}),a.createElement("g",{id:"icon/sf-small/wizzard",mask:"url(#mask-2)",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function jA(e,t){var n=e.title,r=e.titleId,i=pA(e,["title","titleId"]);return a.createElement("svg",hA({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,bA,fA)}var gA,OA,xA,vA,yA=a.forwardRef(jA),wA=(n.p,Object(f.a)(Nf)),CA=1e3,kA=x()(gA||(gA=Object(c.a)(["\n query getData {\n config\n }\n"]))),EA=x()(OA||(OA=Object(c.a)(["\n query transactions(\n $simplified: Boolean\n $limit: Int\n $from: Date\n $until: Date\n $timezone: String\n $excludeTestingCustomers: Boolean\n ) {\n transactionsCsv(\n simplified: $simplified\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n excludeTestingCustomers: $excludeTestingCustomers\n )\n }\n"]))),NA=x()(xA||(xA=Object(c.a)(["\n query filters {\n transactionFilters {\n type\n value\n }\n }\n"]))),SA=x()(vA||(vA=Object(c.a)(["\n query transactions(\n $limit: Int\n $from: Date\n $until: Date\n $txClass: String\n $machineName: String\n $customerName: String\n $fiatCode: String\n $cryptoCode: String\n $toAddress: String\n $status: String\n ) {\n transactions(\n limit: $limit\n from: $from\n until: $until\n txClass: $txClass\n machineName: $machineName\n customerName: $customerName\n fiatCode: $fiatCode\n cryptoCode: $cryptoCode\n toAddress: $toAddress\n status: $status\n ) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n customerName\n customerIdCardData\n customerIdCardPhotoPath\n customerFrontCameraPath\n txCustomerPhotoPath\n customerPhone\n discount\n customerId\n isAnonymous\n batched\n batchTime\n rawTickerPrice\n batchError\n walletScore\n }\n }\n"]))),IA=function(e){return gs.a((function(e,t){return Object(s.a)(Object(s.a)({},e),{},Object(z.a)({},t.type,t.value))}),{},e)},LA=function(){var e,t=wA(),n=Object(w.h)(),r=Object(a.useState)([]),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(u.c)(NA),d=s.data,m=s.loading,h=Object(a.useState)({limit:CA}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(u.c)(SA,{variables:b}),g=j.data,O=j.loading,x=j.refetch,v=j.startPolling,y=j.stopPolling;Object(a.useEffect)((function(){return v(1e4),y}));var C=null!==(e=null===g||void 0===g?void 0:g.transactions)&&void 0!==e?e:[],k=Object(u.c)(kA),E=k.data,N=k.configLoading,S=A.a(["config","locale_timezone"],E),I=[{header:"",width:32,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(qe.jsx)(Wc,{}):Object(qe.jsx)(Pc,{})}},{header:"Machine",name:"machineName",width:160,size:"sm",view:A.a(["machineName"])},{header:"Customer",width:202,size:"sm",view:function(e){return Object(qe.jsxs)("div",{className:t.flexWrapper,children:[Object(qe.jsx)("div",{className:t.overflowTd,children:Xj(e)}),!e.isAnonymous&&Object(qe.jsx)("div",{onClick:function(){return t=e.customerId,n.push("/compliance/customer/".concat(t));var t},children:e.hasError||e.batchError?Object(qe.jsx)(yA,{className:t.customerLinkIcon}):Object(qe.jsx)(gu,{className:t.customerLinkIcon})})]})}},{header:"Cash",width:144,textAlign:"right",size:"sm",view:function(e){return"".concat(Number.parseFloat(e.fiat)," ").concat(e.fiatCode)}},{header:"Crypto",width:150,textAlign:"right",size:"sm",view:function(e){return"".concat(Pf.utils.toUnit(new $c.a(e.cryptoAtoms),e.cryptoCode)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return Pf.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:t.overflowTd,size:"sm",width:140},{header:"Date",view:function(e){return S&&md(e.created,S,"yyyy-MM-dd HH:mm")},textAlign:"right",size:"sm",width:195},{header:"Status",view:function(e){return Zj(e)},textAlign:"left",size:"sm",width:80}],L=A.a(["transactionFilters"])(d),F=O||m||N,P=Object(qe.jsx)("svg",{width:12,height:12,children:Object(qe.jsx)("rect",{width:12,height:12,rx:3,fill:he})});return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:t.titleWrapper,children:[Object(qe.jsxs)("div",{className:t.titleAndButtonsContainer,children:[Object(qe.jsx)(yn,{children:"Transactions"}),Object(qe.jsx)("div",{className:t.buttonsWrapper,children:Object(qe.jsx)(CI,{loading:m,filters:o,options:L,inputPlaceholder:"Search Transactions",onChange:function(e){var t=IA(e);c(e),f({limit:CA,txClass:t.type,machineName:t.machine,customerName:t.customer,fiatCode:t.fiat,cryptoCode:t.crypto,toAddress:t.address,status:t.status}),x&&x()}})}),C&&Object(qe.jsx)("div",{className:t.buttonsWrapper,children:Object(qe.jsx)(tD,{title:"Download logs",name:"transactions",query:EA,getLogs:function(e){return A.a(["transactionsCsv"])(e)},simplified:!0,timezone:S,args:{timezone:S}})})]}),Object(qe.jsxs)("div",{className:t.headerLabels,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Pc,{}),Object(qe.jsx)("span",{children:"Cash-in"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Wc,{}),Object(qe.jsx)("span",{children:"Cash-out"})]}),Object(qe.jsxs)("div",{children:[P,Object(qe.jsx)("span",{children:"Transaction error"})]})]})]}),o.length>0&&Object(qe.jsx)(HI,{entries:C.length,filters:o,onFilterDelete:function(e){var t=M.a((function(t){return!bI.a(Gm.a(["type","value"],t),e)}))(o);c(t);var n=IA(t);f({limit:CA,txClass:n.type,machineName:n.machine,customerName:n.customer,fiatCode:n.fiat,cryptoCode:n.crypto,toAddress:n.address,status:n.status}),x&&x()},deleteAllFilters:function(){c([]);var e=IA([]);f({limit:CA,txClass:e.type,machineName:e.machine,customerName:e.customer,fiatCode:e.fiat,cryptoCode:e.crypto,toAddress:e.address,status:e.status}),x&&x()}}),Object(qe.jsx)(By,{loading:F,emptyText:"No transactions so far",elements:I,data:C,Details:ig,expandable:!0,rowSize:"sm",timezone:S})]})};function FA(){return(FA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function PA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var DA=a.createElement("desc",null,"Created with Sketch."),TA=a.createElement("g",{id:"icon/sf-small/filter/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,2.5 C19,1.11909091 17.8809091,0 16.5,0 C15.1190909,0 14,1.11909091 14,2.5 C14,3.88090909 15.1190909,5 16.5,5 C17.8809091,5 19,3.88090909 19,2.5 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M5,9.5 C5,8.11909091 3.88090909,7 2.5,7 C1.11909091,7 0,8.11909091 0,9.5 C0,10.8818182 1.11909091,12 2.5,12 C3.88090909,12 5,10.8818182 5,9.5 Z",id:"Stroke-7",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M19,17.5 C19,16.1190909 17.8809091,15 16.5,15 C15.1190909,15 14,16.1190909 14,17.5 C14,18.8809091 15.1190909,20 16.5,20 C17.8809091,20 19,18.8809091 19,17.5 Z",id:"Stroke-9",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:14,y1:2.5,x2:.498999482,y2:2.5,id:"Line-3",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:20,y1:9.5,x2:6.49899948,y2:9.5,id:"Line-3-Copy",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:14,y1:17.5,x2:.498999482,y2:17.5,id:"Line-3-Copy-2",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}));function RA(e,t){var n=e.title,r=e.titleId,i=PA(e,["title","titleId"]);return a.createElement("svg",FA({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,DA,TA)}var BA=a.forwardRef(RA);n.p;function AA(){return(AA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function MA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var WA=a.createElement("desc",null,"Created with Sketch."),zA=a.createElement("g",{id:"icon/sf-small/filter/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,2.5 C19,1.11909091 17.8809091,0 16.5,0 C15.1190909,0 14,1.11909091 14,2.5 C14,3.88090909 15.1190909,5 16.5,5 C17.8809091,5 19,3.88090909 19,2.5 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M5,9.5 C5,8.11909091 3.88090909,7 2.5,7 C1.11909091,7 0,8.11909091 0,9.5 C0,10.8818182 1.11909091,12 2.5,12 C3.88090909,12 5,10.8818182 5,9.5 Z",id:"Stroke-7",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M19,17.5 C19,16.1190909 17.8809091,15 16.5,15 C15.1190909,15 14,16.1190909 14,17.5 C14,18.8809091 15.1190909,20 16.5,20 C17.8809091,20 19,18.8809091 19,17.5 Z",id:"Stroke-9",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:14,y1:2.5,x2:.498999482,y2:2.5,id:"Line-3",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:20,y1:9.5,x2:6.49899948,y2:9.5,id:"Line-3-Copy",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:14,y1:17.5,x2:.498999482,y2:17.5,id:"Line-3-Copy-2",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}));function qA(e,t){var n=e.title,r=e.titleId,i=MA(e,["title","titleId"]);return a.createElement("svg",AA({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,WA,zA)}var $A=a.forwardRef(qA);n.p;function HA(){return(HA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function VA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var UA=a.createElement("desc",null,"Created with Sketch."),GA=a.createElement("g",{id:"icon/sf-small/settings/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("path",{d:"M10,13 C8.34325,13 7,11.65675 7,10 C7,8.34325 8.34325,7 10,7 C11.65675,7 13,8.34325 13,10 C13,11.65675 11.65675,13 10,13 Z M19.843,11.816 C19.945,11.391 20,10.45 20,10 C20,9.55 19.945,8.609 19.843,8.184 L17.649,7.656 C17.499,7.166 17.302,6.695 17.065,6.25 L18.244,4.324 C18.016,3.951 17.39,3.247 17.071,2.929 C16.753,2.61 16.049,1.984 15.676,1.756 L13.75,2.935 C13.305,2.698 12.834,2.501 12.344,2.351 L11.816,0.157 C11.391,0.055 10.45,0 10,0 C9.55,0 8.609,0.055 8.184,0.157 L7.656,2.351 C7.166,2.501 6.695,2.698 6.25,2.935 L4.324,1.756 C3.951,1.984 3.247,2.61 2.929,2.929 C2.61,3.247 1.984,3.951 1.756,4.324 L2.935,6.25 C2.698,6.695 2.501,7.166 2.351,7.656 L0.157,8.184 C0.055,8.609 0,9.55 0,10 C0,10.45 0.055,11.391 0.157,11.816 L2.351,12.344 C2.501,12.834 2.698,13.304 2.935,13.75 L1.756,15.676 C1.984,16.049 2.61,16.753 2.929,17.071 C3.247,17.39 3.951,18.016 4.324,18.244 L6.25,17.065 C6.696,17.302 7.166,17.499 7.656,17.649 L8.184,19.843 C8.609,19.945 9.55,20 10,20 C10.45,20 11.391,19.945 11.816,19.843 L12.344,17.649 C12.834,17.499 13.304,17.302 13.75,17.065 L15.676,18.244 C16.049,18.016 16.753,17.39 17.071,17.071 C17.39,16.753 18.016,16.049 18.244,15.676 L17.065,13.75 C17.302,13.304 17.499,12.834 17.649,12.344 L19.843,11.816 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}));function XA(e,t){var n=e.title,r=e.titleId,i=VA(e,["title","titleId"]);return a.createElement("svg",HA({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,UA,GA)}var _A=a.forwardRef(XA);n.p;function ZA(){return(ZA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function KA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var QA=a.createElement("desc",null,"Created with Sketch."),YA=a.createElement("g",{id:"icon/sf-small/settings/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("path",{d:"M10,13 C8.34325,13 7,11.65675 7,10 C7,8.34325 8.34325,7 10,7 C11.65675,7 13,8.34325 13,10 C13,11.65675 11.65675,13 10,13 Z M19.843,11.816 C19.945,11.391 20,10.45 20,10 C20,9.55 19.945,8.609 19.843,8.184 L17.649,7.656 C17.499,7.166 17.302,6.695 17.065,6.25 L18.244,4.324 C18.016,3.951 17.39,3.247 17.071,2.929 C16.753,2.61 16.049,1.984 15.676,1.756 L13.75,2.935 C13.305,2.698 12.834,2.501 12.344,2.351 L11.816,0.157 C11.391,0.055 10.45,0 10,0 C9.55,0 8.609,0.055 8.184,0.157 L7.656,2.351 C7.166,2.501 6.695,2.698 6.25,2.935 L4.324,1.756 C3.951,1.984 3.247,2.61 2.929,2.929 C2.61,3.247 1.984,3.951 1.756,4.324 L2.935,6.25 C2.698,6.695 2.501,7.166 2.351,7.656 L0.157,8.184 C0.055,8.609 0,9.55 0,10 C0,10.45 0.055,11.391 0.157,11.816 L2.351,12.344 C2.501,12.834 2.698,13.304 2.935,13.75 L1.756,15.676 C1.984,16.049 2.61,16.753 2.929,17.071 C3.247,17.39 3.951,18.016 4.324,18.244 L6.25,17.065 C6.696,17.302 7.166,17.499 7.656,17.649 L8.184,19.843 C8.609,19.945 9.55,20 10,20 C10.45,20 11.391,19.945 11.816,19.843 L12.344,17.649 C12.834,17.499 13.304,17.302 13.75,17.065 L15.676,18.244 C16.049,18.016 16.753,17.39 17.071,17.071 C17.39,16.753 18.016,16.049 18.244,15.676 L17.065,13.75 C17.302,13.304 17.499,12.834 17.649,12.344 L19.843,11.816 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}));function JA(e,t){var n=e.title,r=e.titleId,i=KA(e,["title","titleId"]);return a.createElement("svg",ZA({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,QA,YA)}var eM=a.forwardRef(JA),tM=(n.p,Object(f.a)({flex:{display:"flex"},column:{flexDirection:"column"},halfWidth:{width:"50%",marginBottom:15,marginRight:50},marginTop:{marginTop:20},marginBottom:{marginBottom:20}})),nM=function(e){var t=e.it.customRequest,n=tM();return Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:I()(n.flex,n.row,n.marginTop),children:[Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Screen 1 title"}),Object(qe.jsx)(at,{children:t.screen1.title})]}),Object(qe.jsx)("div",{className:I()(n.halfWidth,n.flex),children:function(){var e="spaceSeparation"===t.input.constraintType?"First word label":"Text entry label";switch(t.input.type){case"text":return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:e}),Object(qe.jsx)(at,{children:t.input.label1})]}),"spaceSeparation"===t.input.constraintType&&Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Second word label"}),Object(qe.jsx)(at,{children:t.input.label2})]})]});default:return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Screen 2 input title"}),Object(qe.jsx)(at,{children:t.screen2.title})]}),Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Screen 2 input description"}),Object(qe.jsx)(at,{children:t.screen2.text})]})]})}}()})]}),Object(qe.jsxs)("div",{className:I()(n.flex,n.row,n.marginBottom),children:[Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Screen 1 text"}),Object(qe.jsx)(at,{children:t.screen1.text})]}),Object(qe.jsx)("div",{className:n.halfWidth,children:Object(qe.jsxs)(qe.Fragment,{children:[t.input.choiceList&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{children:"Choices"}),t.input.choiceList.map((function(e,t){return Object(qe.jsx)(at,{children:e},t)}))]}),t.input.numDigits&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{children:"Number of digits"}),Object(qe.jsx)(at,{children:t.input.numDigits})]})]})})]})]})},aM=n(571),rM=n(1108),iM=Object(a.memo)((function(e){var t=e.enforceValueSet,n=void 0===t||t,a=Object(q.a)(e,["enforceValueSet"]),r=a.field,i=r.name,o=r.value,l=a.form.setFieldValue;return Object(qe.jsx)(Rr,Object(s.a)({name:i,value:o,options:a.options,ariaLabel:i,onChange:function(e,t){if(n&&!t)return null;l(i,t),a.resetError&&a.resetError()},className:a.className},a))}));function oM(){return(oM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function lM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var cM=a.createElement("g",{id:"entry-icon/keyboard",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2-Copy-2",transform:"translate(0.000000, 6.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-5",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-8",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",x:12,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-6",x:12,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-9",x:12,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-11",x:64,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-32",x:52,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-4",x:24,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-26",x:36,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-27",x:48,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-28",x:60,y:113686838e-21,width:12,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-7",x:24,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-29",x:36,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-30",x:48,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-31",x:60,y:12,width:12,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-10",x:24,y:24,width:24,height:8,rx:2})));function sM(e,t){var n=e.title,r=e.titleId,i=lM(e,["title","titleId"]);return a.createElement("svg",oM({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/keyboard"):n?a.createElement("title",{id:r},n):null,cM)}var dM=a.forwardRef(sM);n.p;function uM(){return(uM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hM=a.createElement("g",{id:"entry-icon/keypad",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(20.000000, 0.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-5",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-8",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",x:12,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-6",x:12,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-9",x:12,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-11",x:12,y:36,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-4",x:24,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-7",x:24,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-10",x:24,y:24,width:8,height:8,rx:2})));function pM(e,t){var n=e.title,r=e.titleId,i=mM(e,["title","titleId"]);return a.createElement("svg",uM({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/keypad"):n?a.createElement("title",{id:r},n):null,hM)}var bM=a.forwardRef(pM);n.p;function fM(){return(fM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gM=a.createElement("g",{id:"entry-icon/list",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-4",transform:"translate(8.000000, 0.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle-Copy-33",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-35",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-37",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-39",x:0,y:36,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-34",x:12,y:2,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-36",x:12,y:14,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-38",x:12,y:26,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-40",x:12,y:38,width:44,height:4,rx:1})));function OM(e,t){var n=e.title,r=e.titleId,i=jM(e,["title","titleId"]);return a.createElement("svg",fM({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/list"):n?a.createElement("title",{id:r},n):null,gM)}var xM=a.forwardRef(OM),vM=(n.p,function(e){return Object(qe.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:G,borderRadius:4,maxWidth:104,maxHeight:64,minWidth:104,minHeight:64},children:Object(qe.jsx)(e,{style:{maxWidth:80}})})}),yM=xn.f().shape({inputType:xn.h().required()}),wM={inputType:""},CM=function(){var e=[{value:"numerical",title:"Numerical entry",description:"User will enter information with a keypad. Good for dates, ID numbers, etc.",icon:function(){return vM(bM)}},{value:"text",title:"Text entry",description:"User will entry information with a keyboard. Good for names, email, address, etc.",icon:function(){return vM(dM)}},{value:"choiceList",title:"Choice list",description:"Gives user multiple options to choose from.",icon:function(){return vM(xM)}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{children:"Choose the type of data entry"}),Object(qe.jsx)(mn.b,{name:"inputType",component:iM,orientation:"vertical",exclusive:!0,options:e})]})},kM=function(e){return xn.f().shape({requirementName:xn.h().required("A requirement name is required").test("unique-name","A custom information requirement with that name already exists",(function(t,n){return!jn.a((function(e){return gn.a(On.a(e),On.a(t))}),T.a((function(e){return e.customRequest.name}),e))}))})},EM={requirementName:""},NM=function(){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{children:"Name of the requirement"})," ",Object(qe.jsx)(Ke,{children:"The name of the requirement will only be visible to you on the dashboard on the requirement list, as well as on the custom information request list. The user won't see this name. Make sure to make it distinguishable and short."}),Object(qe.jsx)(mn.b,{component:si,label:"Requirement name",name:"requirementName",fullWidth:!0})]})},SM=xn.f().shape({screen1Title:xn.h().required(),screen1Text:xn.h().required()}),IM={screen1Title:"",screen1Text:""},LM=function(){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{children:"Screen 1 Information"})," ",Object(qe.jsx)(Ke,{children:"On screen 1 you will request the user if he agrees on providing this information, or if he wishes to terminate the transaction instead."}),Object(qe.jsx)(mn.b,{component:si,label:"Screen title",name:"screen1Title",fullWidth:!0}),Object(qe.jsx)(mn.b,{component:si,label:"Screen text",name:"screen1Text",multiline:!0,fullWidth:!0,rows:5})]})},FM=xn.f().shape({screen2Title:xn.h().required(),screen2Text:xn.h().required()}),PM={screen2Title:"",screen2Text:""},DM=function(){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{children:"Screen 2 Information"})," ",Object(qe.jsx)(Ke,{children:"If the user agrees, on screen 2 is where the user will enter the custom information."}),Object(qe.jsx)(mn.b,{component:si,label:"Screen 2 input title",name:"screen2Title",fullWidth:!0}),Object(qe.jsx)(mn.b,{component:si,label:"Screen 2 input description",name:"screen2Text",fullWidth:!0})]})},TM={flex:{display:"flex"},column:{flexDirection:"column"},choiceList:{display:"flex",flexDirection:"column",maxHeight:240,overflowY:"auto"},button:{width:120,height:28,marginTop:28},textInput:{width:420},row:{flexDirection:"row"},subtitle:{marginBottom:0},radioSubtitle:{marginBottom:0},error:{color:he},tl1:{marginLeft:8,marginTop:25},numberField:{marginTop:109,maxWidth:115},label:{width:200,marginRight:8}},RM=Object(f.a)(TM),BM=function(e){return e.text&&e.text.length},AM=[{display:"Select just one",code:"selectOne"},{display:"Select multiple",code:"selectMultiple"}],MM=function(){var e,t,n,r=RM(),i=Object(mn.f)(),o=Object(a.useRef)(null),l=null!==(e=A.a(["values","listChoices"])(i))&&void 0!==e?e:[],c=null!==(t=A.a(["errors","listChoices"])(i))&&void 0!==t&&t,s=(n={},Object(z.a)(n,r.radioSubtitle,!0),Object(z.a)(n,r.error,!A.a(["values","constraintType"])(i)&&A.a(["errors","constraintType"])(i)),n),d=function(e){return c&&M.a(BM)(l).length<2&&0===e.text.length};Object(a.useEffect)((function(){u()}),[l.length]);var u=function(){var e;null===(e=o.current)||void 0===e||e.scrollIntoView()};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:I()(s),children:"Choice list constraints"}),Object(qe.jsx)(mn.b,{component:li,options:AM,className:r.row,name:"constraintType"}),Object(qe.jsx)(mn.c,{name:"listChoices",children:function(e){var t=e.push;return Object(qe.jsxs)("div",{className:I()(r.flex,r.column),children:[Object(qe.jsx)(_e,{className:r.subtitle,children:"Choices"}),Object(qe.jsx)("div",{className:r.choiceList,children:l.map((function(e,t){return Object(qe.jsx)("div",{ref:o,children:Object(qe.jsx)(mn.b,{className:r.textInput,error:d(e),component:si,name:"listChoices[".concat(t,"].text"),label:"Choice ".concat(t+1)})},t)}))}),Object(qe.jsx)(He,{Icon:Sn,color:"primary",InverseIcon:ho,className:r.button,onClick:function(e){return e.preventDefault(),t({text:""})},children:"Add choice"})]})}})]})},WM=Object(f.a)(TM),zM=[{display:"None",code:"none"},{display:"Date",code:"date"},{display:"Length",code:"length"}],qM=function(){var e,t,n=WM(),a=Object(mn.f)(),r="length"===(null!==(e=A.a(["values","constraintType"])(Object(mn.f)()))&&void 0!==e?e:null),i=(t={},Object(z.a)(t,n.radioSubtitle,!0),Object(z.a)(t,n.error,!A.a(["values","constraintType"])(a)&&A.a(["errors","constraintType"])(a)),t);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:I()(i),children:"Numerical entry constraints"}),Object(qe.jsx)(mn.b,{className:n.row,component:li,options:zM,name:"constraintType"}),r&&Object(qe.jsxs)("div",{className:I()(n.flex,n.numberField),children:[Object(qe.jsx)(mn.b,{component:oi,name:"inputLength",label:"Length",decimalPlaces:0,allowNegative:!1}),Object(qe.jsx)(tt,{className:n.tl1,children:"digits"})]})]})},$M=Object(f.a)(TM),HM=[{display:"None",code:"none"},{display:"Email",code:"email"},{display:"Space separation",subtitle:"(e.g. first and last name)",code:"spaceSeparation"}],VM=function(){var e,t=$M(),n=Object(mn.f)(),a=(e={},Object(z.a)(e,t.radioSubtitle,!0),Object(z.a)(e,t.error,!A.a(["values","constraintType"])(n)&&A.a(["errors","constraintType"])(n)),e);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:I()(a),children:"Text entry constraints"}),Object(qe.jsx)(mn.b,{className:t.row,component:li,options:HM,name:"constraintType"}),function(){switch(n.values.constraintType){case"spaceSeparation":return Object(qe.jsxs)("div",{className:t.flex,children:[Object(qe.jsx)(mn.b,{className:t.label,component:si,name:"inputLabel1",label:"First word label"}),Object(qe.jsx)(mn.b,{className:t.label,component:si,name:"inputLabel2",label:"Second word label"})]});default:return Object(qe.jsx)(mn.b,{className:t.label,component:si,name:"inputLabel1",label:"Text entry label"})}}()]})},UM=function(e){return e.text&&e.text.length},GM={constraintType:"",inputLength:"",inputLabel1:"",inputLabel2:"",listChoices:[{text:""},{text:""}]},XM=xn.c((function(e){switch(e.inputType){case"numerical":return xn.f({constraintType:xn.h().required(),inputLength:xn.e().when("constraintType",{is:"length",then:xn.e().min(0).required(),else:xn.d().notRequired()})});case"text":return xn.f({constraintType:xn.h().required(),inputLabel1:xn.h().required(),inputLabel2:xn.h().when("constraintType",{is:"spaceSeparation",then:xn.h().required(),else:xn.d().notRequired()})});case"choiceList":return xn.f({constraintType:xn.h().required(),listChoices:xn.a().test("has-2-or-more","Choice list needs to have two or more non empty fields",(function(e,t){return M.a(UM)(e).length>1}))});default:return xn.d().notRequired()}})),_M=function(){var e,t=null!==(e=A.a(["values","inputType"])(Object(mn.f)()))&&void 0!==e?e:null,n=function(e){switch(e){case"numerical":return qM;case"text":return VM;case"choiceList":return MM;default:return qM}}(t);return t&&Object(qe.jsx)(n,{})};function ZM(){return(ZM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function KM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var QM=a.createElement("defs",null,a.createElement("style",null,".cls-1,.cls-9{fill:#dee5fc;}.cls-2,.cls-9{opacity:0.8;}.cls-3{isolation:isolate;}.cls-4{clip-path:url(#clip-path);}.cls-5{clip-path:url(#clip-path-2);}.cls-6{fill:#ccd8ff;opacity:0.74;}.cls-7{clip-path:url(#clip-path-3);}.cls-8{fill:#ebefff;}.cls-10{clip-path:url(#clip-path-4);}.cls-11{clip-path:url(#clip-path-5);}.cls-12{clip-path:url(#clip-path-6);}.cls-13{clip-path:url(#clip-path-7);}.cls-14{clip-path:url(#clip-path-8);}.cls-15{clip-path:url(#clip-path-9);}.cls-16{clip-path:url(#clip-path-10);}.cls-17{clip-path:url(#clip-path-11);}.cls-18{clip-path:url(#clip-path-12);}.cls-19{clip-path:url(#clip-path-13);}.cls-20{clip-path:url(#clip-path-14);}.cls-21{clip-path:url(#clip-path-15);}.cls-22{clip-path:url(#clip-path-16);}.cls-23{clip-path:url(#clip-path-17);}.cls-24{clip-path:url(#clip-path-18);}.cls-25{clip-path:url(#clip-path-19);}.cls-26{clip-path:url(#clip-path-20);}.cls-27{clip-path:url(#clip-path-21);}.cls-28{clip-path:url(#clip-path-22);}.cls-29{clip-path:url(#clip-path-23);}.cls-30{clip-path:url(#clip-path-24);}.cls-31{clip-path:url(#clip-path-25);}.cls-32{clip-path:url(#clip-path-26);}.cls-33{clip-path:url(#clip-path-27);}.cls-34{clip-path:url(#clip-path-28);}.cls-35{clip-path:url(#clip-path-29);}.cls-36{clip-path:url(#clip-path-30);}.cls-37{clip-path:url(#clip-path-31);}.cls-38{clip-path:url(#clip-path-32);}.cls-39{clip-path:url(#clip-path-33);}.cls-40{clip-path:url(#clip-path-34);}.cls-41{clip-path:url(#clip-path-35);}.cls-42{clip-path:url(#clip-path-36);}.cls-43{clip-path:url(#clip-path-37);}.cls-44{clip-path:url(#clip-path-38);}.cls-45{clip-path:url(#clip-path-39);}.cls-46{clip-path:url(#clip-path-40);}.cls-47{clip-path:url(#clip-path-41);}.cls-48{clip-path:url(#clip-path-42);}.cls-49{clip-path:url(#clip-path-43);}.cls-50{clip-path:url(#clip-path-44);}.cls-51{clip-path:url(#clip-path-45);}.cls-52{clip-path:url(#clip-path-46);}.cls-53{clip-path:url(#clip-path-47);}.cls-54{clip-path:url(#clip-path-48);}.cls-55{clip-path:url(#clip-path-49);}.cls-56{clip-path:url(#clip-path-50);}.cls-57{clip-path:url(#clip-path-51);}.cls-58{clip-path:url(#clip-path-52);}.cls-59{clip-path:url(#clip-path-53);}.cls-60{clip-path:url(#clip-path-54);}.cls-61{clip-path:url(#clip-path-55);}.cls-62{clip-path:url(#clip-path-56);}.cls-63{clip-path:url(#clip-path-57);}.cls-64{clip-path:url(#clip-path-58);}.cls-65{clip-path:url(#clip-path-59);}.cls-66{clip-path:url(#clip-path-60);}.cls-67{clip-path:url(#clip-path-61);}.cls-68{clip-path:url(#clip-path-62);}.cls-69{clip-path:url(#clip-path-63);}.cls-70{clip-path:url(#clip-path-64);}.cls-71{clip-path:url(#clip-path-65);}.cls-72{clip-path:url(#clip-path-66);}.cls-73{clip-path:url(#clip-path-69);}.cls-74{clip-path:url(#clip-path-70);}.cls-75{clip-path:url(#clip-path-71);}.cls-76{clip-path:url(#clip-path-72);}.cls-77{clip-path:url(#clip-path-73);}.cls-78{clip-path:url(#clip-path-74);}.cls-79{clip-path:url(#clip-path-75);}.cls-80{clip-path:url(#clip-path-76);}.cls-81{clip-path:url(#clip-path-77);}.cls-82{clip-path:url(#clip-path-78);}.cls-83{clip-path:url(#clip-path-79);}.cls-84{clip-path:url(#clip-path-80);}.cls-85{clip-path:url(#clip-path-81);}.cls-86{clip-path:url(#clip-path-82);}.cls-87{fill:#4b5fef;}.cls-88{clip-path:url(#clip-path-83);}.cls-89{fill:#5a67ff;}.cls-90{fill:#7687ff;}"),a.createElement("clipPath",{id:"clip-path"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-2"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-4"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-5"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-6"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-7"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-8"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-9"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-10"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-11"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-12"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-13"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"})),a.createElement("clipPath",{id:"clip-path-14"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-15"},a.createElement("polygon",{className:"cls-1",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"})),a.createElement("clipPath",{id:"clip-path-16"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-17"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-18"},a.createElement("polygon",{className:"cls-1",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"})),a.createElement("clipPath",{id:"clip-path-19"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-20"},a.createElement("polygon",{className:"cls-1",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"})),a.createElement("clipPath",{id:"clip-path-21"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"})),a.createElement("clipPath",{id:"clip-path-22"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-23"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"})),a.createElement("clipPath",{id:"clip-path-24"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"})),a.createElement("clipPath",{id:"clip-path-25"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-26"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"})),a.createElement("clipPath",{id:"clip-path-27"},a.createElement("polygon",{className:"cls-1",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"})),a.createElement("clipPath",{id:"clip-path-28"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-29"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-30"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-31"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-32"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-33"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-34"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-35"},a.createElement("polygon",{className:"cls-1",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"})),a.createElement("clipPath",{id:"clip-path-36"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-37"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-38"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-39"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-40"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-41"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-42"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-43"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-44"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-45"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-46"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"})),a.createElement("clipPath",{id:"clip-path-47"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-48"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"})),a.createElement("clipPath",{id:"clip-path-49"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-50"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-51"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-52"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-53"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-54"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-55"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"})),a.createElement("clipPath",{id:"clip-path-56"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"})),a.createElement("clipPath",{id:"clip-path-57"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-58"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-59"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-60"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-61"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"})),a.createElement("clipPath",{id:"clip-path-62"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"})),a.createElement("clipPath",{id:"clip-path-63"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-64"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"})),a.createElement("clipPath",{id:"clip-path-65"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-66"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-69"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"})),a.createElement("clipPath",{id:"clip-path-70"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-71"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"})),a.createElement("clipPath",{id:"clip-path-72"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-73"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-74"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-75"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"})),a.createElement("clipPath",{id:"clip-path-76"},a.createElement("polygon",{className:"cls-1",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"})),a.createElement("clipPath",{id:"clip-path-77"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-78"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-79"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-80"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-81"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"})),a.createElement("clipPath",{id:"clip-path-82"},a.createElement("polygon",{className:"cls-1",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"})),a.createElement("clipPath",{id:"clip-path-83"},a.createElement("polygon",{className:"cls-1",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}))),YM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}),a.createElement("g",{className:"cls-4"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}),a.createElement("g",{className:"cls-5"},a.createElement("polygon",{className:"cls-6",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}),a.createElement("g",{className:"cls-7"},a.createElement("polygon",{className:"cls-8",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}))))),JM=a.createElement("polygon",{className:"cls-9",points:"38.83 65.53 58.25 54.32 77.66 65.53 58.25 76.74 38.83 65.53"}),eW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}),a.createElement("g",{className:"cls-10"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}),a.createElement("g",{className:"cls-11"},a.createElement("polygon",{className:"cls-6",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}),a.createElement("g",{className:"cls-12"},a.createElement("polygon",{className:"cls-8",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}))))),tW=a.createElement("polygon",{className:"cls-9",points:"58.25 76.74 77.66 65.53 97.08 76.74 77.66 87.95 58.25 76.74"}),nW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}),a.createElement("g",{className:"cls-13"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}),a.createElement("g",{className:"cls-14"},a.createElement("polygon",{className:"cls-6",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}),a.createElement("g",{className:"cls-15"},a.createElement("polygon",{className:"cls-8",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}))))),aW=a.createElement("polygon",{className:"cls-9",points:"38.83 87.95 58.25 76.74 77.66 87.95 58.25 99.16 38.83 87.95"}),rW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}),a.createElement("g",{className:"cls-16"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}),a.createElement("g",{className:"cls-17"},a.createElement("polygon",{className:"cls-6",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}),a.createElement("g",{className:"cls-18"},a.createElement("polygon",{className:"cls-8",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}))))),iW=a.createElement("polygon",{className:"cls-9",points:"19.42 76.74 38.83 65.53 58.25 76.74 38.83 87.95 19.42 76.74"}),oW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"}),a.createElement("g",{className:"cls-19"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"}),a.createElement("g",{className:"cls-20"},a.createElement("polygon",{className:"cls-6",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"}),a.createElement("g",{className:"cls-21"},a.createElement("polygon",{className:"cls-8",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"}))))),lW=a.createElement("polygon",{className:"cls-9",points:"0 87.95 19.42 76.74 38.83 87.95 19.42 99.16 0 87.95"}),cW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"}),a.createElement("g",{className:"cls-22"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"}),a.createElement("g",{className:"cls-23"},a.createElement("polygon",{className:"cls-6",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"}),a.createElement("g",{className:"cls-24"},a.createElement("polygon",{className:"cls-8",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"}))))),sW=a.createElement("polygon",{className:"cls-9",points:"19.42 99.16 38.83 87.95 58.25 99.16 38.83 110.37 19.42 99.16"}),dW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"}),a.createElement("g",{className:"cls-25"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"}),a.createElement("g",{className:"cls-26"},a.createElement("polygon",{className:"cls-6",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"}),a.createElement("g",{className:"cls-27"},a.createElement("polygon",{className:"cls-8",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"}))))),uW=a.createElement("polygon",{className:"cls-9",points:"77.66 87.95 97.08 76.74 116.5 87.95 97.08 99.16 77.66 87.95"}),mW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"}),a.createElement("g",{className:"cls-28"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"}),a.createElement("g",{className:"cls-29"},a.createElement("polygon",{className:"cls-6",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"}),a.createElement("g",{className:"cls-30"},a.createElement("polygon",{className:"cls-8",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"}))))),hW=a.createElement("polygon",{className:"cls-9",points:"58.25 99.16 77.66 87.95 97.08 99.16 77.66 110.37 58.25 99.16"}),pW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"}),a.createElement("g",{className:"cls-31"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"}),a.createElement("g",{className:"cls-32"},a.createElement("polygon",{className:"cls-6",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"}),a.createElement("g",{className:"cls-33"},a.createElement("polygon",{className:"cls-8",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"}))))),bW=a.createElement("polygon",{className:"cls-9",points:"38.83 110.37 58.25 99.16 77.66 110.37 58.25 121.58 38.83 110.37"}),fW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}),a.createElement("g",{className:"cls-34"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-35"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-36"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))))),jW=a.createElement("polygon",{className:"cls-9",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}),gW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}),a.createElement("g",{className:"cls-37"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}),a.createElement("g",{className:"cls-38"},a.createElement("polygon",{className:"cls-6",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}),a.createElement("g",{className:"cls-39"},a.createElement("polygon",{className:"cls-8",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}))))),OW=a.createElement("polygon",{className:"cls-9",points:"58.25 54.32 77.66 43.11 97.08 54.32 77.66 65.53 58.25 54.32"}),xW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"}),a.createElement("g",{className:"cls-40"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"}),a.createElement("g",{className:"cls-41"},a.createElement("polygon",{className:"cls-6",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"}),a.createElement("g",{className:"cls-42"},a.createElement("polygon",{className:"cls-8",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"}))))),vW=a.createElement("polygon",{className:"cls-9",points:"77.66 65.53 97.08 54.32 116.5 65.53 97.08 76.74 77.66 65.53"}),yW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}),a.createElement("g",{className:"cls-43"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}),a.createElement("g",{className:"cls-44"},a.createElement("polygon",{className:"cls-6",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}),a.createElement("g",{className:"cls-45"},a.createElement("polygon",{className:"cls-8",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}))))),wW=a.createElement("polygon",{className:"cls-9",points:"38.83 65.53 58.25 54.32 77.66 65.53 58.25 76.74 38.83 65.53"}),CW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}),a.createElement("g",{className:"cls-46"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}),a.createElement("g",{className:"cls-47"},a.createElement("polygon",{className:"cls-6",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}),a.createElement("g",{className:"cls-48"},a.createElement("polygon",{className:"cls-8",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}))))),kW=a.createElement("polygon",{className:"cls-9",points:"19.42 54.32 38.83 43.11 58.25 54.32 38.83 65.53 19.42 54.32"}),EW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}),a.createElement("g",{className:"cls-49"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}),a.createElement("g",{className:"cls-50"},a.createElement("polygon",{className:"cls-6",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}),a.createElement("g",{className:"cls-51"},a.createElement("polygon",{className:"cls-8",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}))))),NW=a.createElement("polygon",{className:"cls-9",points:"58.25 76.74 77.66 65.53 97.08 76.74 77.66 87.95 58.25 76.74"}),SW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"}),a.createElement("g",{className:"cls-52"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"}),a.createElement("g",{className:"cls-53"},a.createElement("polygon",{className:"cls-6",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"}),a.createElement("g",{className:"cls-54"},a.createElement("polygon",{className:"cls-8",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"}))))),IW=a.createElement("polygon",{className:"cls-9",points:"0 65.53 19.42 54.32 38.83 65.53 19.42 76.74 0 65.53"}),LW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}),a.createElement("g",{className:"cls-55"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}),a.createElement("g",{className:"cls-56"},a.createElement("polygon",{className:"cls-6",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}),a.createElement("g",{className:"cls-57"},a.createElement("polygon",{className:"cls-8",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}))))),FW=a.createElement("polygon",{className:"cls-9",points:"19.42 76.74 38.83 65.53 58.25 76.74 38.83 87.95 19.42 76.74"}),PW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}),a.createElement("g",{className:"cls-58"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}),a.createElement("g",{className:"cls-59"},a.createElement("polygon",{className:"cls-6",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}),a.createElement("g",{className:"cls-60"},a.createElement("polygon",{className:"cls-8",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}))))),DW=a.createElement("polygon",{className:"cls-9",points:"38.83 87.95 58.25 76.74 77.66 87.95 58.25 99.16 38.83 87.95"}),TW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"}),a.createElement("g",{className:"cls-61"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"}),a.createElement("g",{className:"cls-62"},a.createElement("polygon",{className:"cls-6",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"}),a.createElement("g",{className:"cls-63"},a.createElement("polygon",{className:"cls-8",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"}))))),RW=a.createElement("polygon",{className:"cls-9",points:"38.83 20.69 58.25 9.48 77.66 20.69 58.25 31.9 38.83 20.69"}),BW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}),a.createElement("g",{className:"cls-64"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-65"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-66"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))))),AW=a.createElement("polygon",{className:"cls-9",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}),MW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"}),a.createElement("g",{className:"cls-67"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"}),a.createElement("g",{className:"cls-68"},a.createElement("polygon",{className:"cls-6",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"}),a.createElement("g",{className:"cls-69"},a.createElement("polygon",{className:"cls-8",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"}))))),WW=a.createElement("polygon",{className:"cls-9",points:"58.25 31.9 77.66 20.69 97.08 31.9 77.66 43.11 58.25 31.9"}),zW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"}),a.createElement("g",{className:"cls-70"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"}),a.createElement("g",{className:"cls-71"},a.createElement("polygon",{className:"cls-6",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"}),a.createElement("g",{className:"cls-72"},a.createElement("polygon",{className:"cls-8",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"}))))),qW=a.createElement("polygon",{className:"cls-9",points:"19.42 31.9 38.83 20.69 58.25 31.9 38.83 43.11 19.42 31.9"}),$W=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-35"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-36"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))),a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}))),HW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"}),a.createElement("g",{className:"cls-73"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"}),a.createElement("g",{className:"cls-74"},a.createElement("polygon",{className:"cls-6",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"}),a.createElement("g",{className:"cls-75"},a.createElement("polygon",{className:"cls-8",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"}))))),VW=a.createElement("polygon",{className:"cls-9",points:"0 43.11 19.42 31.9 38.83 43.11 19.42 54.32 0 43.11"}),UW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}),a.createElement("g",{className:"cls-76"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}),a.createElement("g",{className:"cls-77"},a.createElement("polygon",{className:"cls-6",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}),a.createElement("g",{className:"cls-78"},a.createElement("polygon",{className:"cls-8",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}))))),GW=a.createElement("polygon",{className:"cls-9",points:"19.42 54.32 38.83 43.11 58.25 54.32 38.83 65.53 19.42 54.32"}),XW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"}),a.createElement("g",{className:"cls-79"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"}),a.createElement("g",{className:"cls-80"},a.createElement("polygon",{className:"cls-6",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"}),a.createElement("g",{className:"cls-81"},a.createElement("polygon",{className:"cls-8",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"}))))),_W=a.createElement("polygon",{className:"cls-9",points:"77.66 43.11 97.08 31.9 116.5 43.11 97.08 54.32 77.66 43.11"}),ZW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}),a.createElement("g",{className:"cls-82"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}),a.createElement("g",{className:"cls-83"},a.createElement("polygon",{className:"cls-6",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}),a.createElement("g",{className:"cls-84"},a.createElement("polygon",{className:"cls-8",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}))))),KW=a.createElement("polygon",{className:"cls-9",points:"58.25 54.32 77.66 43.11 97.08 54.32 77.66 65.53 58.25 54.32"}),QW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"}),a.createElement("g",{className:"cls-85"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"}),a.createElement("g",{className:"cls-86"},a.createElement("polygon",{className:"cls-87",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}),a.createElement("g",{className:"cls-88"},a.createElement("polygon",{className:"cls-89",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}))))),YW=a.createElement("polygon",{className:"cls-90",points:"38.83 11.21 58.25 0 77.66 11.21 58.25 22.42 38.83 11.21"});function JW(e,t){var n=e.title,r=e.titleId,i=KM(e,["title","titleId"]);return a.createElement("svg",ZM({id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 116.5 144",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,QM,YM,JM,eW,tW,nW,aW,rW,iW,oW,lW,cW,sW,dW,uW,mW,hW,pW,bW,fW,jW,gW,OW,xW,vW,yW,wW,CW,kW,EW,NW,SW,IW,LW,FW,PW,DW,TW,RW,BW,AW,MW,WW,zW,qW,$W,HW,VW,UW,GW,XW,_W,ZW,KW,QW,YW)}var ez,tz,nz,az,rz,iz,oz,lz,cz,sz,dz,uz,mz,hz=a.forwardRef(JW),pz=(n.p,Object(f.a)({logo:{maxHeight:150,maxWidth:200},title:{margin:[[24,0,32,0]]},text:{margin:0},button:{marginTop:"auto",marginBottom:58},modalContent:{display:"flex",flexDirection:"column",alignItems:"center",padding:[[0,42]],flex:1}})),bz=function(e){var t=e.onContinue,n=pz();return Object(qe.jsxs)("div",{className:n.modalContent,children:[Object(qe.jsx)(hz,{className:n.logo}),Object(qe.jsx)(Ue,{className:n.title,children:"Custom information request"}),Object(qe.jsx)(Ke,{className:n.text,children:"A custom information request allows you to have an extra option to ask specific information about your customers when adding a trigger that isn't an option on the default requirements list."}),Object(qe.jsx)(Ke,{children:"Note that adding a custom information request isn't the same as adding triggers. You will still need to add a trigger with the new requirement to get this information from your customers."}),Object(qe.jsx)(An,{className:n.button,onClick:t,children:"Get started"})]})},fz=Object(f.a)({stepper:{margin:[[16,0,14,0]]},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},button:{marginLeft:"auto"},form:{height:"100%",display:"flex",flexDirection:"column"}}),jz=function(e){return e.text&&e.text.length},gz=function(e,t){var n,a="choiceList"===e.inputType,r=a?t?A.a(["listChoices"])(e):T.a((function(e){return e.text}))(null!==(n=M.a(jz)(e.listChoices))&&void 0!==n?n:[]):[],i="length"===e.constraintType,o=i?e.inputLength:"",l={name:e.requirementName,screen1:{text:e.screen1Text,title:e.screen1Title},screen2:{title:e.screen2Title,text:e.screen2Text},input:{type:e.inputType,constraintType:e.constraintType}};return a&&(l=aM.a(["input","choiceList"],r,l)),i&&(l=aM.a(["input","numDigits"],o,l)),e.inputLabel1&&(l=aM.a(["input","label1"],e.inputLabel1,l)),e.inputLabel2&&(l=aM.a(["input","label2"],e.inputLabel2,l)),t&&(l=aM.a(["id"],e.id,l)),l},Oz=function(e,t){return D.a(t)?e:t},xz=function(e){var t=e.onClose,n=(e.error,e.toBeEdited),r=e.onSave,i=e.hasError,o=e.existingRequirements,c=fz(),d=!D.a(n),u=Object(a.useState)(d?1:0),m=Object(l.a)(u,2),h=m[0],p=m[1],b=function(e,t){switch(e){case 1:return{schema:kM(t),Component:NM};case 2:return{schema:SM,Component:LM};case 3:return{schema:yM,Component:CM};case 4:return{schema:FM,Component:DM};case 5:return{schema:XM,Component:_M};default:return{schema:{},Component:function(){return Object(qe.jsx)("h1",{children:"Default component step"})}}}}(h,o),f=5===h,j=function(e,t){var n="numerical"===e.inputType||"choiceList"===e.inputType;return d&&2===h?n?p(4):r(gz(e,d),d):d&&4===h?r(gz(e,d),d):3===h?p(n?h+1:h+2):f?r(gz(e,d),d):p(h+1)},g=d?function(e){var t=e.customRequest;return{id:e.id,requirementName:t.name,screen1Title:t.screen1.title,screen1Text:t.screen1.text,screen2Title:t.screen2.title,screen2Text:t.screen2.text,inputType:t.input.type,inputLabel1:t.input.label1,inputLabel2:t.input.label2,listChoices:t.input.choiceList,constraintType:t.input.constraintType,inputLength:t.input.numDigits}}(n):{},O=d?"Editing custom requirement":"New custom requirement";return Object(qe.jsxs)(Yh,{title:h>0?O:"",handleClose:t,width:520,height:620,open:!0,children:[h>0&&Object(qe.jsx)(bp,{className:c.stepper,steps:5,currentStep:h}),0===h&&!d&&Object(qe.jsx)(bz,{onContinue:j}),h>0&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:j,initialValues:rM.a(Oz,Object(s.a)(Object(s.a)(Object(s.a)(Object(s.a)(Object(s.a)({},EM),IM),PM),wM),GM),g),validationSchema:b.schema,children:function(e){var t,n=e.errors;return Object(qe.jsxs)(mn.d,{className:c.form,id:"custom-requirement-form",children:[Object(qe.jsx)(b.Component,{}),Object(qe.jsxs)("div",{className:c.submit,children:[(i||!Wa.a(n))&&Object(qe.jsx)(rl,{children:null!==(t=Uj.a(gd.a(n)))&&void 0!==t?t:"Failed to save"}),Object(qe.jsx)(An,{className:c.button,type:"submit",children:f?"Save":"Next"})]})]})}})]})},vz=Object(f.a)({m0:{margin:0},mb10:{marginBottom:10},centerItems:{display:"flex",flexDirection:"column",alignItems:"center",height:"50%",justifyContent:"center"},alignWithTitleSection:{marginTop:-47,display:"flex"}}),yz={numerical:"Numerical",text:"Text",choiceList:"Choice list"},wz={date:"Date",none:"None",email:"Email",length:"Length",selectOne:"Select one",selectMultiple:"Select multiple",spaceSeparation:"Space separation"},Cz=x()(ez||(ez=Object(c.a)(["\n query getData {\n config\n }\n"]))),kz=x()(tz||(tz=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Ez=x()(nz||(nz=Object(c.a)(["\n mutation insertCustomInfoRequest($customRequest: CustomRequestInput!) {\n insertCustomInfoRequest(customRequest: $customRequest) {\n id\n }\n }\n"]))),Nz=x()(az||(az=Object(c.a)(["\n mutation editCustomInfoRequest(\n $id: ID!\n $customRequest: CustomRequestInput!\n ) {\n editCustomInfoRequest(id: $id, customRequest: $customRequest) {\n id\n }\n }\n"]))),Sz=x()(rz||(rz=Object(c.a)(["\n mutation removeCustomInfoRequest($id: ID!) {\n removeCustomInfoRequest(id: $id) {\n id\n }\n }\n"]))),Iz=function(e){var t,n=e.showWizard,r=e.toggleWizard,i=e.data,o=vz(),c=Object(a.useState)(),d=Object(l.a)(c,2),m=d[0],h=d[1],p=Object(a.useState)(),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(!1),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(!1),w=Object(l.a)(y,2),C=w[0],k=w[1],E=Object(u.c)(Cz),N=E.data,S=E.loading,L=Object(u.b)(kz,{refetchQueries:function(){return["getData"]},onError:function(){return k(!0)}}),F=Object(l.a)(L,1)[0],P=Object(u.b)(Ez,{onError:function(){console.log("Error while adding custom info request"),k(!0)},onCompleted:function(){k(!1),r()},refetchQueries:function(){return["customInfoRequests"]}}),D=Object(l.a)(P,1)[0],T=Object(u.b)(Nz,{onError:function(){console.log("Error while editing custom info request"),k(!0)},onCompleted:function(){k(!1),j(null),r()},refetchQueries:function(){return["getData","customInfoRequests"]}}),R=Object(l.a)(T,1)[0],B=Object(u.b)(Sz,{onError:function(){console.log("Error while removing custom info request"),k(!0)},onCompleted:function(){v(!1),k(!1)},refetchQueries:function(){return["getData","customInfoRequests"]}}),M=Object(l.a)(B,1)[0],W=null!==(t=A.a(["config"])(N))&&void 0!==t?t:[],z=function(e,t){return t?R({variables:{id:e.id,customRequest:sm.a(["id"])(e)}}):D({variables:{customRequest:Object(s.a)({},e)}})},q=Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ke,{noMargin:!0,children:"Deleting this item will result in the triggers using it to be removed, together with the advanced trigger overrides you defined for this item."}),Object(qe.jsxs)(Ke,{noMargin:!0,children:["This action is ",Object(qe.jsx)("b",{children:"permanent"}),"."]})]});return!S&&Object(qe.jsxs)(qe.Fragment,{children:[i.length>0&&Object(qe.jsx)(By,{emptyText:"No custom info requests so far",elements:[{header:"Requirement name",width:300,textAlign:"left",size:"sm",view:function(e){return e.customRequest.name}},{header:"Data entry type",width:300,textAlign:"left",size:"sm",view:function(e){return yz[e.customRequest.input.type]}},{header:"Constraints",width:300,textAlign:"left",size:"sm",view:function(e){return wz[e.customRequest.input.constraintType]}},{header:"Edit",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){return j(e),r()},children:Object(qe.jsx)(Dh,{})})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){return h(e.id),v(!0)},children:Object(qe.jsx)(vh,{})})}}],data:i,Details:nM,expandable:!0,rowSize:"sm"}),!i.length&&Object(qe.jsxs)("div",{className:o.centerItems,children:[Object(qe.jsx)(Qe,{className:I()(o.m0,o.mb10),children:"It seems you haven't added any custom information requests yet."}),Object(qe.jsxs)(Je,{className:I()(o.m0,o.mb10),children:["Please read our"," ",Object(qe.jsx)("a",{href:"https://support.lamassu.is/hc/en-us/sections/115000817232-Compliance",children:Object(qe.jsx)(oa,{children:"Support Article"})})," ","on Compliance before adding new information requests."]}),Object(qe.jsx)(An,{onClick:function(){return r()},children:"Add custom information request"})]}),n&&Object(qe.jsx)(xz,{hasError:C,onClose:function(){j(null),k(!1),r()},toBeEdited:f,onSave:function(){return z.apply(void 0,arguments)},existingRequirements:i}),Object(qe.jsx)(Km,{errorMessage:C?"Failed to delete":"",open:x,onDismissed:function(){v(!1),k(!1)},item:"custom information request",extraMessage:q,onConfirmed:function(){var e;M({variables:{id:e=m}}).then((function(){var t,n=null!==(t=W&&ss(is)(W))&&void 0!==t?t:[],a={overrides:mm.a((function(t){return t.requirement===e}),n.overrides)},r=ds(is)(a);F({variables:{config:r}})}))}})]})},Lz={switchLabel:{margin:6,width:24},tableRadioGroup:{flexDirection:"row",justifyContent:"space-between"},tableRadioLabel:{marginRight:0},tableWidth:{width:918}},Fz=n(1109),Pz=Object(f.a)({radioLabel:{height:40,padding:[[0,10]]},radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:he},specialLabel:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,181]]},directionIcon:{marginRight:2},directionName:{marginLeft:6},thresholdWrapper:{display:"flex",flexDirection:"column"},thresholdTitle:{marginTop:50},thresholdContentWrapper:{display:"flex",flexDirection:"row"},thresholdField:{marginRight:6,width:75},description:{marginTop:7},space:{marginLeft:6,marginRight:6},lastSpace:{marginLeft:6},suspensionDays:{width:34},input:{marginTop:-2},limitedInput:{width:50},daysInput:{width:60},dropdownField:{marginTop:16,minWidth:155}}),Dz=xn.h().required(),Tz=xn.f().shape({threshold:xn.e().nullable().transform(Ur).label("Invalid threshold"),thresholdDays:xn.e().transform(Ur).nullable().label("Invalid threshold days")}),Rz=xn.f().shape({requirement:xn.h().required(),suspensionDays:xn.e().transform(Ur).nullable()}),Bz=xn.f().shape({triggerType:Dz,requirement:Rz,threshold:Tz}).test((function(e,t){var n=e.threshold,a=e.triggerType;if(!a||!{txAmount:function(e){return e.threshold>=0},txVolume:function(e){return e.threshold>=0&&e.thresholdDays>0},txVelocity:function(e){return e.threshold>0&&e.thresholdDays>0},consecutiveDays:function(e){return e.thresholdDays>0}}[a](n))return t.createError({path:"threshold",message:{txAmount:function(e){return"Amount must be greater than or equal to 0"},txVolume:function(e){var t=[];return e.threshold<0&&t.push("Volume must be greater than or equal to 0"),e.thresholdDays<=0&&t.push("Days must be greater than 0"),t.join(", ")},txVelocity:function(e){var t=[];return e.threshold<=0&&t.push("Transactions must be greater than 0"),e.thresholdDays<=0&&t.push("Days must be greater than 0"),t.join(", ")},consecutiveDays:function(e){return"Days must be greater than 0"}}[a](n)})})).test((function(e,t){var n=e.requirement;if(!n||!function(e){return"suspend"!==e.requirement||e.suspensionDays>0}(n))return t.createError({path:"requirement",message:"Suspension days must be greater than 0"})})),Az=xn.f().shape({triggerType:xn.h().required(),threshold:xn.f({threshold:xn.e().transform(Ur).nullable(),thresholdDays:xn.e().transform(Ur).nullable()})}).test((function(e,t){var n=e.threshold,a=e.triggerType;if(!a||!{txAmount:function(e){return e.threshold>=0},txVolume:function(e){return e.threshold>=0&&e.thresholdDays>0},txVelocity:function(e){return e.threshold>0&&e.thresholdDays>0},consecutiveDays:function(e){return e.thresholdDays>0}}[a](n))return t.createError({path:"threshold",message:{txAmount:function(e){return"Amount must be greater than or equal to 0"},txVolume:function(e){var t=[];return(!e.threshold||e.threshold<0)&&t.push("Volume must be greater than or equal to 0"),(!e.thresholdDays||e.thresholdDays<=0)&&t.push("Days must be greater than 0"),t.join(", ")},txVelocity:function(e){var t=[];return(!e.threshold||e.threshold<=0)&&t.push("Transactions must be greater than 0"),(!e.thresholdDays||e.thresholdDays<=0)&&t.push("Days must be greater than 0"),t.join(", ")},consecutiveDays:function(e){return"Days must be greater than 0"}}[a](n)})})),Mz=[{display:"Transaction amount",code:"txAmount"},{display:"Transaction volume",code:"txVolume"},{display:"Transaction velocity",code:"txVelocity"},{display:"Consecutive days",code:"consecutiveDays"}],Wz=function(e){var t,n,a,r,i,o,l=Object.assign({},e),c=Pz(),s=Object(mn.f)(),d=s.errors,u=s.touched,m=s.values,h=s.setTouched,p=s.handleChange,b=Object(z.a)({},c.error,d.triggerType&&u.triggerType),f=bl.a(null===m||void 0===m?void 0:m.triggerType),j=f(["txAmount","txVolume"]),g=f(["txVelocity"]),O=f(["txVolume","txVelocity"]),x=f(["consecutiveDays"]),v=!!d.threshold&&!!(null===(t=u.threshold)||void 0===t?void 0:t.threshold)&&!x&&(!(null===(n=m.threshold)||void 0===n?void 0:n.threshold)||(null===(a=m.threshold)||void 0===a?void 0:a.threshold)<0),y=!!d.threshold&&!!(null===(r=u.threshold)||void 0===r?void 0:r.thresholdDays)&&!f(["txAmount"])&&(!(null===(i=m.threshold)||void 0===i?void 0:i.thresholdDays)||(null===(o=m.threshold)||void 0===o?void 0:o.thresholdDays)<0),w=!(!y&&!v),C=Object(z.a)({},c.error,w);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{className:I()(b),children:"Choose trigger type"})}),Object(qe.jsx)(mn.b,{component:li,name:"triggerType",options:Mz,labelClassName:c.radioLabel,radioClassName:c.radio,className:c.radioGroup,onChange:function(e){p(e),h({threshold:!1,thresholdDays:!1})}}),Object(qe.jsxs)("div",{className:c.thresholdWrapper,children:[(j||g||O||x)&&Object(qe.jsx)(_e,{className:I()(C,c.thresholdTitle),children:"Threshold"}),Object(qe.jsxs)("div",{className:c.thresholdContentWrapper,children:[j&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(mn.b,{className:c.thresholdField,component:oi,size:"lg",name:"threshold.threshold",error:v}),Object(qe.jsx)(Qe,{className:I()(c.description),children:l.currency})]}),g&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(mn.b,{className:c.thresholdField,component:oi,size:"lg",name:"threshold.threshold",error:v}),Object(qe.jsx)(Qe,{className:I()(c.description),children:"transactions"})]}),O&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Qe,{className:I()(b,c.space,c.description),children:"in"}),Object(qe.jsx)(mn.b,{className:c.thresholdField,component:oi,size:"lg",name:"threshold.thresholdDays",error:y}),Object(qe.jsx)(Qe,{className:I()(c.description),children:"days"})]}),x&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(mn.b,{className:c.thresholdField,component:oi,size:"lg",name:"threshold.thresholdDays",error:y}),Object(qe.jsx)(Qe,{className:I()(c.description),children:"consecutive days"})]})]})]})]})},zz=xn.f().shape({requirement:xn.f({requirement:xn.h().required(),suspensionDays:xn.e().when("requirement",{is:function(e){return"suspend"===e},then:xn.e().nullable().transform(Ur),otherwise:xn.e().nullable().transform((function(){return null}))}),customInfoRequestId:xn.h().when("requirement",{is:function(e){return"custom"===e},then:xn.h(),otherwise:xn.h().nullable().transform((function(){return""}))})}).required()}).test((function(e,t){var n=e.requirement,a=function(e,t){switch(t){case"suspend":return e.requirement!==t||e.suspensionDays>0;case"custom":return e.requirement!==t||!D.a(e.customInfoRequestId);default:return!0}};return n&&!a(n,"suspend")?t.createError({path:"requirement",message:"Suspension days must be greater than 0"}):n&&!a(n,"custom")?t.createError({path:"requirement",message:"You must select an item"}):void 0})),qz=[{display:"SMS verification",code:"sms"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"Sanctions",code:"sanctions"},{display:"US SSN",code:"usSsn"},{display:"Suspend",code:"suspend"},{display:"Block",code:"block"}],$z=function(e,t,n){var a,r,i;return!!e.requirement&&!!(null===(a=t.requirement)||void 0===a?void 0:a.suspensionDays)&&(!(null===(r=n.requirement)||void 0===r?void 0:r.suspensionDays)||(null===(i=n.requirement)||void 0===i?void 0:i.suspensionDays)<0)},Hz=function(e,t,n){var a,r,i;return!!e.requirement&&!!(null===(a=t.requirement)||void 0===a?void 0:a.customInfoRequestId)&&(!(null===(r=n.requirement)||void 0===r?void 0:r.customInfoRequestId)||!D.a(null===(i=n.requirement)||void 0===i?void 0:i.customInfoRequestId))},Vz=function(e){var t,n,a=e.customInfoRequests,r=Pz(),i=Object(mn.f)(),o=i.touched,l=i.errors,c=i.values,s=i.handleChange,d=i.setTouched,u="suspend"===(null===c||void 0===c||null===(t=c.requirement)||void 0===t?void 0:t.requirement),m="custom"===(null===c||void 0===c||null===(n=c.requirement)||void 0===n?void 0:n.requirement),h=(null===a||void 0===a?void 0:a.length)>0?[].concat(qz,[{display:"Custom information requirement",code:"custom"}]):[].concat(qz),p=Object(z.a)({},r.error,!!l.requirement&&!u&&!m||u&&$z(l,o,c)||m&&Hz(l,o,c));return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{className:I()(p),children:"Choose a requirement"})}),Object(qe.jsx)(mn.b,{component:li,name:"requirement.requirement",options:h,labelClassName:r.specialLabel,radioClassName:r.radio,className:I()(r.radioGroup,r.specialGrid),onChange:function(e){s(e),d({suspensionDays:!1})}}),u&&Object(qe.jsx)(mn.b,{className:r.thresholdField,component:oi,label:"Days",size:"lg",name:"requirement.suspensionDays",error:$z(l,o,c)}),m&&Object(qe.jsx)("div",{children:Object(qe.jsx)(mn.b,{className:r.dropdownField,component:ii,label:"Available requests",name:"requirement.customInfoRequestId",options:a.map((function(e){return{value:e.id,display:e.customRequest.name}}))})})]})},Uz=function(e){return{schema:zz,options:qz,Component:Vz,props:{customInfoRequests:e},hasRequirementError:$z,hasCustomRequirementError:Hz,initialValues:{requirement:{requirement:"",suspensionDays:"",customInfoRequestId:""}}}},Gz=function(e,t,n){return function(a){return e?F.a(R.a(t),Aa.a(W.a(null!==n&&void 0!==n?n:"code",a)))(e):""}},Xz=function(e){return function(t){return t.id===e}},_z=function(e){var t,n,a,r=e.customInfoRequests,i=Object(mn.f)().values,o=Pz(),l=null===i||void 0===i||null===(t=i.requirement)||void 0===t?void 0:t.requirement,c=null!==(n=A.a(["requirement","customInfoRequestId"])(i))&&void 0!==n?n:"",s="suspend"===l,d=c?null!==(a=A.a(["customRequest","name"])(Aa.a(Xz(c))(r)))&&void 0!==a?a:"":Gz(qz,"display")(l);return Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"baseline",children:["".concat(d," ").concat(s?"for":""),s&&Object(qe.jsx)(mn.b,{bold:!0,className:o.suspensionDays,name:"requirement.suspensionDays",component:oi,textAlign:"center"}),s&&"days"]})},Zz=function(e){var t,n=e.requirement,a=e.suspensionDays,r=e.customInfoRequestId,i=e.customInfoRequests,o=Pz(),l="custom"===n?null!==(t=A.a(["customRequest","name"])(Aa.a(Xz(r))(i)))&&void 0!==t?t:"":Gz(qz,"display")(n),c="suspend"===n;return Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"baseline",children:["".concat(l," ").concat(c?"for":""),c&&Object(qe.jsx)(Ye,{className:o.space,noMargin:!0,children:a}),c&&"days"]})},Kz=function(e){var t,n,a,r=e.config,i=e.currency,o=e.isEdit,l=Pz(),c=(t={},Object(z.a)(t,l.input,!0),Object(z.a)(t,l.limitedInput,"txVelocity"===(null===r||void 0===r?void 0:r.triggerType)),Object(z.a)(t,l.daysInput,"consecutiveDays"===(null===r||void 0===r?void 0:r.triggerType)),t),s=null===r||void 0===r||null===(n=r.threshold)||void 0===n?void 0:n.threshold,d=null===r||void 0===r||null===(a=r.threshold)||void 0===a?void 0:a.thresholdDays,u=o?Object(qe.jsx)(mn.b,{bold:!0,className:I()(c),name:"threshold.threshold",component:oi,textAlign:"right"}):Object(qe.jsx)(Ye,{noMargin:!0,children:s}),m=o?Object(qe.jsx)(mn.b,{bold:!0,className:I()(c),name:"threshold.thresholdDays",component:oi,textAlign:"right"}):Object(qe.jsx)(Ye,{noMargin:!0,children:d});switch(null===r||void 0===r?void 0:r.triggerType){case"txAmount":return Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(qe.jsx)(rt,{noMargin:!0,className:l.lastSpace,children:i})]});case"txVolume":return Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(qe.jsx)(rt,{noMargin:!0,className:l.lastSpace,children:i}),Object(qe.jsx)(at,{noMargin:!0,className:l.space,children:"in"}),m,Object(qe.jsx)(at,{noMargin:!0,className:l.lastSpace,children:"days"})]});case"txVelocity":return Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(qe.jsx)(at,{className:l.space,noMargin:!0,children:"transactions in"}),m,Object(qe.jsx)(at,{className:l.lastSpace,noMargin:!0,children:"days"})]});case"consecutiveDays":return Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[m,Object(qe.jsx)(at,{className:l.lastSpace,noMargin:!0,children:"days"})]});default:return""}},Qz=Object(a.memo)((function(e){var t=e.currency,n=Object(mn.f)().values;return Object(qe.jsx)(Kz,{isEdit:!0,config:n,currency:t})})),Yz=function(e){var t=e.config,n=e.currency;return Object(qe.jsx)(Kz,{config:t,currency:n})},Jz=function(e,t,n){return[{name:"triggerType",size:"sm",width:230,input:function(e){var t=e.field.value;return Object(qe.jsx)(qe.Fragment,{children:Gz(Mz,"display")(t)})},view:Gz(Mz,"display"),inputProps:{options:Mz,valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"requirement",size:"sm",width:230,bypassField:!0,input:function(){return Object(qe.jsx)(_z,{customInfoRequests:n})},view:function(e){return Object(qe.jsx)(Zz,Object(s.a)(Object(s.a)({},e),{},{customInfoRequests:n}))}},{name:"threshold",size:"sm",width:284,textAlign:"right",input:function(){return Object(qe.jsx)(Qz,{currency:e})},view:function(t,n){return Object(qe.jsx)(Yz,{config:n,currency:e})}}]},eq=T.a(R.a("code"))(Mz),tq=[Fz.a((function(e,t){return eq.indexOf(e.triggerType)<eq.indexOf(t.triggerType)}))],nq=function(e){return T.a((function(e){var t=e.requirement,n=e.threshold,a=Object(q.a)(e,["requirement","threshold"]);return Object(s.a)({requirement:t.requirement,suspensionDays:t.suspensionDays,threshold:n.threshold,thresholdDays:n.thresholdDays,customInfoRequestId:t.customInfoRequestId},a)}))(e)},aq={stepper:{margin:[[16,0,14,0]]},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},button:{marginLeft:"auto"},form:{height:"100%",display:"flex",flexDirection:"column"},infoTitle:{margin:[[18,0,20,0]]},infoCurrentText:{color:$},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat($),display:"inline-block"}},rq=Object(f.a)(aq),iq=function(e,t,n){switch(e){case 1:return function(e){return{schema:Az,options:Mz,Component:Wz,props:{currency:e},initialValues:{triggerType:"",threshold:{threshold:"",thresholdDays:""}}}}(t);case 2:return Uz(n);default:return a.Fragment}},oq=function(e,t,n,a){switch(e){case 1:return Object(qe.jsxs)(qe.Fragment,{children:["If the user ",cq(t,n,a)]});case 2:return Object(qe.jsxs)(qe.Fragment,{children:["the user will be ",sq(t,a),"."]});default:return Object(qe.jsx)(qe.Fragment,{})}},lq=function(e,t){var n=Object(qe.jsx)("span",{className:t.blankSpace});return Wa.a(e)||D.a(e)?n:e},cq=function(e,t,n){switch(e.triggerType){case"txAmount":return Object(qe.jsxs)(qe.Fragment,{children:["makes a single transaction over"," ",lq(e.threshold.threshold,n)," ",t]});case"txVolume":return Object(qe.jsxs)(qe.Fragment,{children:["makes more than ",lq(e.threshold.threshold,n)," ",t," worth of transactions within"," ",lq(e.threshold.thresholdDays,n)," ",Hm(e.threshold.thresholdDays,"day","days")]});case"txVelocity":return Object(qe.jsxs)(qe.Fragment,{children:["makes more than ",lq(e.threshold.threshold,n)," ",Hm(e.threshold.threshold,"transaction","transactions")," ","in ",lq(e.threshold.thresholdDays,n)," ",Hm(e.threshold.thresholdDays,"day","days")]});case"consecutiveDays":return Object(qe.jsxs)(qe.Fragment,{children:["at least one transaction every day for"," ",lq(e.threshold.thresholdDays,n)," ",Hm(e.threshold.thresholdDays,"day","days")]});default:return Object(qe.jsx)(qe.Fragment,{})}},sq=function(e,t){var n;switch(null===(n=e.requirement)||void 0===n?void 0:n.requirement){case"sms":return Object(qe.jsx)(qe.Fragment,{children:"asked to enter code provided through SMS verification"});case"idCardPhoto":return Object(qe.jsx)(qe.Fragment,{children:"asked to scan a ID with photo"});case"idCardData":return Object(qe.jsx)(qe.Fragment,{children:"asked to scan a ID"});case"facephoto":return Object(qe.jsx)(qe.Fragment,{children:"asked to have a photo taken"});case"usSsn":return Object(qe.jsx)(qe.Fragment,{children:"asked to input his social security number"});case"sanctions":return Object(qe.jsx)(qe.Fragment,{children:"matched against the OFAC sanctions list"});case"superuser":return Object(qe.jsx)(qe.Fragment,{});case"suspend":return Object(qe.jsxs)(qe.Fragment,{children:["suspended for"," ",lq(e.requirement.suspensionDays,t)," ",Hm(e.requirement.suspensionDays,"day","days")]});case"block":return Object(qe.jsx)(qe.Fragment,{children:"blocked"});case"custom":return Object(qe.jsx)(qe.Fragment,{children:"asked to fulfill a custom requirement"});default:return lq(null,t)}},dq=function(e){var t=e.step,n=e.config,a=void 0===n?{}:n,i=e.liveValues,o=void 0===i?{}:i,l=e.currency,c=rq(),s=Ru.a(1,t).map((function(e,t){return Object(qe.jsx)(r.a.Fragment,{children:oq(e,a,l,c)},t)})),d=oq(t,o,l,c),u=2===t;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ze,{className:c.infoTitle,children:"Trigger overview so far"}),Object(qe.jsxs)(Je,{noMargin:!0,children:[s,1!==t&&", ",Object(qe.jsx)("span",{className:c.infoCurrentText,children:d}),!u&&"..."]})]})},uq=function(e){var t=e.setValues,n=Object(mn.f)().values;return Object(a.useEffect)((function(){t&&n&&t(n)}),[t,n]),null},mq=function(e){var t=e.onClose,n=e.save,r=e.error,i=e.currency,o=e.customInfoRequests,c=rq(),d=Object(a.useState)({}),u=Object(l.a)(d,2),m=u[0],h=u[1],p=Object(a.useState)({step:1}),b=Object(l.a)(p,2),f=b[0],j=f.step,g=f.config,O=b[1],x=2===j,v=iq(j,i,o),y=function(){var e=Object(Bl.a)(Rl.a.mark((function e(t){var a;return Rl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Gn.a(g,v.schema.cast(t)),!x){e.next=3;break}return e.abrupt("return",n(a));case 3:O({step:j+1,config:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),w=function(e,t,n){var a,r,i,o,l,c,s,d,u=null===n||void 0===n?void 0:n.triggerType,m=bl.a(u),h="suspend"===(null===n||void 0===n||null===(a=n.requirement)||void 0===a?void 0:a.requirement),p="custom"===(null===n||void 0===n||null===(r=n.requirement)||void 0===r?void 0:r.requirement),b=Uz().hasRequirementError(e,t,n),f=Uz().hasCustomRequirementError(e,t,n),j=!!e.threshold&&!!(null===(i=t.threshold)||void 0===i?void 0:i.threshold)&&!m(["consecutiveDays"])&&(!(null===(o=n.threshold)||void 0===o?void 0:o.threshold)||(null===(l=n.threshold)||void 0===l?void 0:l.threshold)<0),g=!!e.threshold&&!!(null===(c=t.threshold)||void 0===c?void 0:c.thresholdDays)&&!m(["txAmount"])&&(!(null===(s=n.threshold)||void 0===s?void 0:s.thresholdDays)||(null===(d=n.threshold)||void 0===d?void 0:d.thresholdDays)<0);return m(["txAmount","txVolume","txVelocity"])&&j||m(["txVolume","txVelocity","consecutiveDays"])&&g?e.threshold:h&&b||p&&f?e.requirement:void 0};return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)(Yh,{title:"New compliance trigger",handleClose:t,width:560,height:520,infoPanel:Object(qe.jsx)(dq,{currency:i,step:j,config:g,liveValues:m}),infoPanelHeight:172,open:!0,children:[Object(qe.jsx)(bp,{className:c.stepper,steps:2,currentStep:j}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!0,enableReinitialize:!0,onSubmit:y,initialValues:v.initialValues,validationSchema:v.schema,children:function(e){var t=e.errors,n=e.touched,a=e.values;return Object(qe.jsxs)(mn.d,{className:c.form,children:[Object(qe.jsx)(uq,{setValues:h}),Object(qe.jsx)(v.Component,Object(s.a)({},v.props)),Object(qe.jsxs)("div",{className:c.submit,children:[r&&Object(qe.jsx)(rl,{children:"Failed to save"}),w(t,n,a)&&Object(qe.jsx)(rl,{children:w(t,n,a)}),Object(qe.jsx)(An,{className:c.button,type:"submit",children:x?"Finish":"Next"})]})]})}})]})})},hq=Object(f.a)(Lz),pq=x()(iz||(iz=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),bq=function(e){var t=e.triggers,n=e.showWizard,r=e.config,i=e.toggleWizard,o=e.addNewTriger,c=e.customInfoRequests,d=A.a(["fiatCurrency"])(ss(es)(r)),m=(hq(),Object(a.useState)(null)),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.b)(pq,{onCompleted:function(){return i(!0)},refetchQueries:function(){return["getData"]},onError:function(e){return b(e)}}),j=Object(l.a)(f,1)[0];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_h,{data:t,name:"triggers",enableEdit:!0,sortBy:tq,groupBy:"triggerType",enableDelete:!0,error:null===p||void 0===p?void 0:p.message,save:function(e){return b(null),j({variables:{config:{triggers:nq(e.triggers)}}})},validationSchema:Bz,elements:Jz(d,0,c)}),n&&Object(qe.jsx)(mq,{currency:d,error:null===p||void 0===p?void 0:p.message,save:function(e){var n=ml.a([Object(s.a)({id:Object(pm.a)(),direction:"both"},e)])(t);return j({variables:{config:{triggers:nq(n)}}})},onClose:function(){return i(!0)},customInfoRequests:c}),Wa.a(t)&&Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"center",flexDirection:"column",mt:15,children:[Object(qe.jsx)(Ge,{children:"It seems there are no active compliance triggers on your network"}),Object(qe.jsx)(An,{onClick:o,children:"Add first trigger"})]})]})},fq=function(e){var t=T.a((function(e){return{display:e.customRequest.name,code:e.id}}))(e);return ml.a([{display:"Sanctions",code:"sanctions"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"US SSN",code:"usSsn"}],t)},jq=function(e,t){return R.a("display",Aa.a(W.a("code",e))(fq(t)))},gq=xn.f().shape({expirationTime:xn.h().label("Expiration time").required(),automation:xn.h().label("Automation").matches(/(Manual|Automatic)/).required()}),Oq=function(e,t){return xn.f().shape({id:xn.h().label("Requirement").required().test({test:function(){var n=this.parent.requirement;return!Aa.a(W.a("requirement",n))(e)||this.createError({message:"Requirement ".concat(jq(n,t)," already overriden")})}}),expirationTime:xn.h().label("Expiration time").required(),automation:xn.h().label("Automation").matches(/(Manual|Automatic)/).required()})},xq=function(e){return[{name:"requirement",header:"Requirement",width:196,size:"sm",view:Gz(fq(e),"display"),input:Br,inputProps:{options:fq(e),labelProp:"display",valueProp:"code"}},{name:"expirationTime",header:"Expiration time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:Br,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}]},vq=[{expirationTime:"Forever",automation:"Automatic"}],yq={requirement:"",expirationTime:"Forever",automation:"Automatic"},wq=x()(oz||(oz=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Cq=x()(lz||(lz=Object(c.a)(["\n query getData {\n config\n }\n"]))),kq=x()(cz||(cz=Object(c.a)(["\n query customInfoRequests {\n customInfoRequests {\n id\n customRequest\n enabled\n }\n }\n"]))),Eq=Object(a.memo)((function(){var e,t,n=is,r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!1),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.c)(Cq),O=g.data,x=g.loading,v=Object(u.c)(kq),y=v.data,w=v.loading,C=null!==(e=A.a(["customInfoRequests"])(y))&&void 0!==e?e:[],k=M.a(W.a("enabled",!0))(C),E=x||w,N=Object(u.b)(wq,{refetchQueries:function(){return["getData"]},onError:function(e){return c(e)}}),S=Object(l.a)(N,1)[0],I=(null===O||void 0===O?void 0:O.config)&&ss(n)(null===O||void 0===O?void 0:O.config),L=I&&!Wa.a(I)?I:vq,F=null!==(t=null===I||void 0===I?void 0:I.overrides)&&void 0!==t?t:[];return!E&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{title:"Default requirement settings",error:null===o||void 0===o?void 0:o.message,titleLg:!0,name:"triggersConfig",enableEdit:!0,initialValues:L,save:function(e){var t=ds(n)(e.triggersConfig[0]);return c(null),S({variables:{config:t}})},validationSchema:gq,data:Fw.a(L),elements:[{name:"expirationTime",header:"Expiration time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:Br,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}],setEditing:function(e,t){return h(t)},forceDisable:f})}),Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{error:null===o||void 0===o?void 0:o.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:yq,save:function(e){var t=ds(n)(e);return c(null),S({variables:{config:t}})},validationSchema:Oq(F,k),data:F,elements:xq(k),setEditing:function(e,t){return j(t)},forceDisable:m})})]})})),Nq=Object(f.a)(Lz),Sq=x()(sz||(sz=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Iq=x()(dz||(dz=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Lq=x()(uz||(uz=Object(c.a)(["\n query getData {\n config\n accounts\n }\n"]))),Fq=x()(mz||(mz=Object(c.a)(["\n query customInfoRequests {\n customInfoRequests {\n id\n customRequest\n enabled\n }\n }\n"]))),Pq=function(){var e,t,n,r,i,o=Nq(),c=Object(a.useState)(!1),d=Object(l.a)(c,2),m=d[0],h=d[1],p=Object(u.c)(Lq),b=p.data,f=p.loading,j=Object(u.c)(Fq),g=j.data,O=j.loading,x=Object(a.useState)(null),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(a.useState)(!1),k=Object(l.a)(C,2),E=k[0],N=k[1],S=Object(a.useState)(!1),L=Object(l.a)(S,2),F=L[0],P=L[1],D=null!==(e=A.a(["customInfoRequests"])(g))&&void 0!==e?e:[],R=M.a(W.a("enabled",!0))(D),B=function(e,t){return T.a((function(e){var t=e.requirement,n=e.suspensionDays,a=e.threshold,r=e.thresholdDays,i=e.customInfoRequestId,o=Object(q.a)(e,["requirement","suspensionDays","threshold","thresholdDays","customInfoRequestId"]);return Object(s.a)({requirement:{requirement:t,suspensionDays:n,customInfoRequestId:i},threshold:{threshold:a,thresholdDays:r}},o)}))(e)}(null!==(t=null===b||void 0===b||null===(n=b.config)||void 0===n?void 0:n.triggers)&&void 0!==t?t:[]),$=(null===b||void 0===b?void 0:b.config)&&ss("compliance")(b.config),H=null!==(r=null===$||void 0===$?void 0:$.rejectAddressReuse)&&void 0!==r&&r,V=Object(u.b)(Iq,{onCompleted:function(){return h(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return w(e)}}),U=Object(l.a)(V,1)[0],G=Object(u.b)(Sq,{onCompleted:function(){P(!1),K("newTrigger")()},refetchQueries:function(){return["getData"]},onError:function(e){return w(e)}}),X=Object(l.a)(G,1)[0],_=Object(z.a)({},o.tableWidth,"customInfoRequests"===!E),Z=function(e){return e?document.querySelector("#root").classList.add("root-blur"):document.querySelector("#root").classList.remove("root-blur")},K=function(e){return function(t){return m===e||t?(Z(!1),h(null)):(Z(!0),h(e))}},Q=f||O,Y=function(){dl.a("twilio",(null===b||void 0===b?void 0:b.accounts)||{})?K("newTrigger")():P(!0)};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(ll,{title:"Compliance Triggers",buttons:[{text:"Advanced settings",icon:eM,inverseIcon:_A,forceDisable:!("advancedSettings"===E),toggle:function(e){N(!!e&&"advancedSettings")}},{text:"Custom info requests",icon:$A,inverseIcon:BA,forceDisable:!("customInfoRequests"===E),toggle:function(e){N(!!e&&"customInfoRequests")}}],className:I()(_),children:[!E&&Object(qe.jsx)(tl.a,{display:"flex",alignItems:"center",children:Object(qe.jsxs)(tl.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(qe.jsx)(Ke,{children:"Reject reused addresses"}),Object(qe.jsx)(Lr,{checked:H,onChange:function(e){!function(e){var t=ds("compliance")(e);U({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:H}),Object(qe.jsx)(rt,{className:o.switchLabel,children:H?"On":"Off"}),Object(qe.jsx)(Np,{width:304,children:Object(qe.jsx)(Ke,{children:"This option requires a user to scan a different cryptocurrency address if they attempt to scan one that had been previously used for a transaction in your network"})})]})}),"customInfoRequests"===E&&!Wa.a(R)&&Object(qe.jsx)(tl.a,{display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){return K("newCustomRequest")()},children:"+ Add new custom info request"})}),!Q&&!E&&!Wa.a(B)&&Object(qe.jsx)(tl.a,{display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:Y,children:"+ Add new trigger"})})]}),!Q&&"customInfoRequests"===E&&Object(qe.jsx)(Iz,{data:R,showWizard:"newCustomRequest"===m,toggleWizard:K("newCustomRequest")}),!Q&&!E&&Object(qe.jsx)(bq,{triggers:B,showWizard:"newTrigger"===m,config:null!==(i=null===b||void 0===b?void 0:b.config)&&void 0!==i?i:{},toggleWizard:K("newTrigger"),addNewTriger:Y,customInfoRequests:R}),!Q&&"advancedSettings"===E&&Object(qe.jsx)(Eq,{error:y,save:U,data:b}),F&&Object(qe.jsxs)(Yh,{title:"Configure SMS",width:478,handleClose:function(){return P(!1)},open:!0,children:[Object(qe.jsx)(Ke,{children:"In order for compliance triggers to work, you'll first need to configure Twilio."}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001203951-Twilio-for-SMS",label:"Lamassu Support Article"}),Object(qe.jsx)(nx,{save:function(e){return w(null),X({variables:{accounts:{twilio:e}}})},elements:ix.elements,validationSchema:ix.getValidationSchema})]})]})};function Dq(){return(Dq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Tq(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Rq=a.createElement("g",{id:"icon/button/key/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("circle",{id:"Oval",cx:2.75,cy:8.25,r:2.75}),a.createElement("line",{x1:5.04166667,y1:5.95833333,x2:11,y2:0,id:"Path-13",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:8.25,y1:3.66666667,x2:10.5416667,y2:1.375,id:"Path-13-Copy",strokeWidth:2,strokeLinejoin:"round"})));function Bq(e,t){var n=e.title,r=e.titleId,i=Tq(e,["title","titleId"]);return a.createElement("svg",Dq({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/key/white"):n?a.createElement("title",{id:r},n):null,Rq)}var Aq=a.forwardRef(Bq);n.p;function Mq(){return(Mq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Wq(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var zq=a.createElement("g",{id:"icon/button/key/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(0.500000, 0.500000)",stroke:"#1B2559"},a.createElement("circle",{id:"Oval",cx:2.75,cy:8.25,r:2.75}),a.createElement("line",{x1:5.04166667,y1:5.95833333,x2:11,y2:0,id:"Path-13",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:8.25,y1:3.66666667,x2:10.5416667,y2:1.375,id:"Path-13-Copy",strokeWidth:2,strokeLinejoin:"round"})));function qq(e,t){var n=e.title,r=e.titleId,i=Wq(e,["title","titleId"]);return a.createElement("svg",Mq({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/key/zodiac"):n?a.createElement("title",{id:r},n):null,zq)}var $q=a.forwardRef(qq);n.p;function Hq(){return(Hq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Vq(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Uq=a.createElement("g",{id:"icon/button/lock/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Lock-Icon-White",transform:"translate(0.500000, 0.500000)"},a.createElement("path",{d:"M7.98058644,2.48058644 C7.98058644,1.11059638 6.86999006,0 5.5,0 C4.13000994,0 3.01941356,1.11059638 3.01941356,2.48058644 C3.01941356,3.39391315 3.01941356,4.09482878 3.01941356,4.58333333 L7.98058644,4.58333333 C7.98058644,4.09482878 7.98058644,3.39391315 7.98058644,2.48058644 Z",id:"Lock",stroke:"#FFFFFF",strokeLinejoin:"round"}),a.createElement("rect",{id:"Body",stroke:"#FFFFFF",strokeLinejoin:"round",x:0,y:4.58333333,width:11,height:6.41666667}),a.createElement("circle",{id:"Key-Hole",fill:"#FFFFFF",cx:5.5,cy:7.33333333,r:1})));function Gq(e,t){var n=e.title,r=e.titleId,i=Vq(e,["title","titleId"]);return a.createElement("svg",Hq({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/lock/white"):n?a.createElement("title",{id:r},n):null,Uq)}var Xq=a.forwardRef(Gq);n.p;function _q(){return(_q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Zq(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Kq=a.createElement("g",{id:"icon/button/lock/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Lock-Icon-Zodiac",transform:"translate(0.500000, 0.500000)"},a.createElement("path",{d:"M7.98058644,2.48058644 C7.98058644,1.11059638 6.86999006,0 5.5,0 C4.13000994,0 3.01941356,1.11059638 3.01941356,2.48058644 C3.01941356,3.39391315 3.01941356,4.09482878 3.01941356,4.58333333 L7.98058644,4.58333333 C7.98058644,4.09482878 7.98058644,3.39391315 7.98058644,2.48058644 Z",id:"Lock",stroke:"#1B2559",strokeLinejoin:"round"}),a.createElement("rect",{id:"Body",stroke:"#1B2559",strokeLinejoin:"round",x:0,y:4.58333333,width:11,height:6.41666667}),a.createElement("circle",{id:"Key-Hole",fill:"#1B2559",cx:5.5,cy:7.33333333,r:1})));function Qq(e,t){var n=e.title,r=e.titleId,i=Zq(e,["title","titleId"]);return a.createElement("svg",_q({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/lock/zodiac"):n?a.createElement("title",{id:r},n):null,Kq)}var Yq=a.forwardRef(Qq);n.p;function Jq(){return(Jq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function e$(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var t$=a.createElement("g",{id:"icon/button/user-role/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("g",{id:"User-Role-Icon-White",transform:"translate(2.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("path",{d:"M5.50008791,6.84274776 L5.5,11 L3.66666667,9.35927189 L1.83333333,11 L1.83223109,6.84216075 C2.37179795,7.15453375 2.99835187,7.33333333 3.66666667,7.33333333 C4.33456272,7.33333333 4.96075021,7.15475774 5.50008791,6.84274776 Z",id:"Bottom"}),a.createElement("circle",{id:"Top",cx:3.66666667,cy:3.66666667,r:3.66666667})));function n$(e,t){var n=e.title,r=e.titleId,i=e$(e,["title","titleId"]);return a.createElement("svg",Jq({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/user-role/white"):n?a.createElement("title",{id:r},n):null,t$)}var a$=a.forwardRef(n$);n.p;function r$(){return(r$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function i$(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o$=a.createElement("g",{id:"icon/button/user-role/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("g",{id:"User-Role-Icon-Zodiac",transform:"translate(2.500000, 0.500000)",stroke:"#1B2559"},a.createElement("path",{d:"M5.50008791,6.84274776 L5.5,11 L3.66666667,9.35927189 L1.83333333,11 L1.83223109,6.84216075 C2.37179795,7.15453375 2.99835187,7.33333333 3.66666667,7.33333333 C4.33456272,7.33333333 4.96075021,7.15475774 5.50008791,6.84274776 Z",id:"Bottom"}),a.createElement("circle",{id:"Top",cx:3.66666667,cy:3.66666667,r:3.66666667})));function l$(e,t){var n=e.title,r=e.titleId,i=i$(e,["title","titleId"]);return a.createElement("svg",r$({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/user-role/zodiac"):n?a.createElement("title",{id:r},n):null,o$)}var c$,s$,d$,u$,m$,h$,p$,b$,f$,j$,g$,O$,x$,v$,y$,w$,C$,k$,E$,N$,S$,I$=a.forwardRef(l$),L$=(n.p,{footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalTitle:{marginTop:-5,color:J,fontFamily:je},modalLabel1:{marginTop:20},modalLabel2:{marginTop:40},inputLabel:{color:J,fontFamily:je,fontSize:24,marginLeft:8,marginTop:15},tableWidth:{width:1132},radioGroup:{flexDirection:"row",width:500},radioLabel:{width:150,height:48},copyToClipboard:{marginLeft:"auto",paddingTop:7,marginRight:-5},chip:{backgroundColor:re,fontFamily:je,marginLeft:10},info:{fontFamily:ge,textAlign:"justify"},addressWrapper:{backgroundColor:re,marginTop:8,height:35},address:{margin:"0px ".concat(16,"px 0px ").concat(16,"px"),paddingRight:-15},errorMessage:{fontFamily:ge,color:he},codeContainer:{marginTop:15,marginBottom:15},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]},error:{color:he},link:{position:"absolute",top:10,left:0,bottom:"-20px",right:"-20px",whiteSpace:"nowrap",overflowX:"auto",width:"92.5%"},linkWrapper:{width:"100%",height:"100%",overflow:"hidden",position:"relative"},loginWrapper:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},username:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"},roleSwitch:{marginLeft:15},actionButtonWrapper:{display:"flex",gap:12},enterButton:{display:"none"}}),F$=Object(f.a)(L$),P$=x()(c$||(c$=Object(c.a)(["\n query confirm2FA($code: String!) {\n confirm2FA(code: $code)\n }\n"]))),D$=function(e){var t=e.showModal,n=e.handleClose,r=e.setConfirmation,i=F$(),o=Object(a.useState)(""),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.a)(P$,{onCompleted:function(e){return e.confirm2FA?(r(s),d(""),void b(!1)):b(!0)}}),j=Object(l.a)(f,2),g=j[0],O=j[1].error,x=function(){return O?"Internal server error":6!==s.length&&p?"The code should have 6 characters!":p?"Code is invalid. Please try again.":null},v=function(){6===s.length?g({variables:{code:s}}):b(!0)};return t&&Object(qe.jsxs)(Yh,{closeOnBackdropClick:!0,width:500,height:350,handleClose:n,open:!0,children:[Object(qe.jsx)(Ye,{className:i.modalTitle,children:"Confirm action"}),Object(qe.jsx)(Ke,{className:i.info,children:"To make changes on this user, please confirm this action by entering your two-factor authentication code below."}),Object(qe.jsx)(mn.e,{onSubmit:function(){},initialValues:{},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(hr,{name:"2fa",value:s,onChange:function(e){d(e),b(!1)},numInputs:6,error:p,containerStyle:i.codeContainer,shouldAutoFocus:!0}),Object(qe.jsx)("button",{onClick:v,className:i.enterButton})]})}),x()&&Object(qe.jsx)(Ke,{className:i.errorMessage,children:x()}),Object(qe.jsx)("div",{className:i.footer,children:Object(qe.jsx)(An,{className:i.submit,onClick:v,children:"Confirm"})})]})},T$=x()(s$||(s$=Object(c.a)(["\n mutation changeUserRole(\n $confirmationCode: String\n $id: ID!\n $newRole: String!\n ) {\n changeUserRole(\n confirmationCode: $confirmationCode\n id: $id\n newRole: $newRole\n ) {\n id\n }\n }\n"]))),R$=Object(f.a)(L$),B$=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=R$(),c=Object(u.b)(T$,{onCompleted:function(){return j()},refetchQueries:function(){return["users"]}}),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=function(){f(null),n({type:"close",payload:"showRoleModal"})};return t.showRoleModal&&i&&!b&&Object(qe.jsx)(D$,{showModal:t.showRoleModal,handleClose:j,setConfirmation:f})||t.showRoleModal&&Object(qe.jsxs)(Yh,{closeOnBackdropClick:!0,width:450,height:250,handleClose:j,open:!0,children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Change ",r.username,"'s role?"]}),Object(qe.jsxs)(Ke,{className:o.info,children:["You are about to alter ",r.username,"'s role. This will change this user's permission to access certain resources."]}),Object(qe.jsx)(Ke,{className:o.info,children:"Do you wish to proceed?"}),Object(qe.jsxs)("div",{className:o.footer,children:[m&&Object(qe.jsx)(rl,{children:m}),Object(qe.jsx)(An,{className:o.submit,onClick:function(){d({variables:{confirmationCode:b,id:r.id,newRole:"superuser"===r.role?"user":"superuser"}})},children:"Confirm"})]})]})},A$="https://".concat(window.location.hostname),M$=function(e){return"".concat(A$).concat(e)},W$=Object(f.a)(L$),z$=x()(d$||(d$=Object(c.a)(["\n mutation createRegisterToken($username: String!, $role: String!) {\n createRegisterToken(username: $username, role: $role) {\n token\n expire\n }\n }\n"]))),q$=xn.f().shape({username:xn.h().email("Username field should be in an email format!").required("Username field is required!"),role:xn.h().required("Role field is required!")}),$$={username:"",role:""},H$=[{code:"user",display:"Regular user"},{code:"superuser",display:"Superuser"}],V$=function(e,t,n){return e&&t?n?"Internal server error":e.username&&t.username?e.username:null:null},U$=function(e){var t=e.state,n=e.dispatch,r=W$(),i=Object(a.useState)(""),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(null),m=Object(l.a)(d,2),h=m[0],p=m[1],b=function(){p(null),n({type:"close",payload:"showCreateUserModal"})},f=Object(u.b)(z$,{onCompleted:function(e){var t=e.createRegisterToken,n="t=".concat(t.token);p(M$("/register?".concat(n)))}}),j=Object(l.a)(f,2),g=j[0],O=j[1].error;return Object(qe.jsxs)(qe.Fragment,{children:[t.showCreateUserModal&&!h&&Object(qe.jsx)(Yh,{closeOnBackdropClick:!0,width:600,height:400,handleClose:b,open:!0,children:Object(qe.jsx)(mn.e,{validationSchema:q$,initialValues:$$,onSubmit:function(e){s(e.username),g({variables:{username:e.username,role:e.role}})},children:function(e){var t,n,a=e.errors,i=e.touched;return Object(qe.jsxs)(mn.d,{id:"register-user-form",className:r.form,children:[Object(qe.jsx)(Ue,{className:r.modalTitle,children:"Create new user"}),Object(qe.jsx)(mn.b,{component:si,name:"username",width:338,autoFocus:!0,label:"User login"}),Object(qe.jsx)(Xe,{className:I()((t=a,n=i,Object(z.a)({},r.error,t.role&&n.role)),r.modalLabel2),children:"Role"}),Object(qe.jsx)(mn.b,{component:li,name:"role",labelClassName:r.radioLabel,className:r.radioGroup,options:H$}),Object(qe.jsxs)("div",{className:r.footer,children:[V$(a,i,O)&&Object(qe.jsx)(rl,{children:V$(a,i,O)}),Object(qe.jsx)(An,{type:"submit",form:"register-user-form",className:r.submit,children:"Finish"})]})]})}})}),t.showCreateUserModal&&h&&Object(qe.jsxs)(Yh,{closeOnBackdropClick:!0,width:500,height:200,handleClose:b,open:!0,children:[Object(qe.jsxs)(Ye,{className:r.modalTitle,children:["Creating ",c,"..."]}),Object(qe.jsxs)(Ke,{className:r.info,children:["Safely share this link with ",c," to finish the registration process."]}),Object(qe.jsx)("div",{className:r.addressWrapper,children:Object(qe.jsx)(et,{className:r.address,children:Object(qe.jsx)("strong",{children:Object(qe.jsx)(If,{className:r.link,buttonClassname:r.copyToClipboard,wrapperClassname:r.linkWrapper,children:h})})})})]})]})},G$=x()(u$||(u$=Object(c.a)(["\n mutation enableUser($confirmationCode: String, $id: ID!) {\n enableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),X$=x()(m$||(m$=Object(c.a)(["\n mutation disableUser($confirmationCode: String, $id: ID!) {\n disableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),_$=Object(f.a)(L$),Z$=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=_$(),c=Object(u.b)(G$,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=Object(u.b)(X$,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),p=Object(l.a)(h,2),b=p[0],f=p[1].error,j=Object(a.useState)(null),g=Object(l.a)(j,2),O=g[0],x=g[1],v=function(){(null===r||void 0===r?void 0:r.enabled)?b({variables:{confirmationCode:O,id:r.id}}):d({variables:{confirmationCode:O,id:r.id}})},y=function(){x(null),n({type:"close",payload:"showEnableUserModal"})};return t.showEnableUserModal&&i&&!O&&Object(qe.jsx)(D$,{showModal:t.showEnableUserModal,handleClose:y,setConfirmation:x})||t.showEnableUserModal&&Object(qe.jsxs)(Yh,{closeOnBackdropClick:!0,width:450,height:275,handleClose:y,open:!0,children:[!r.enabled&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Enable ",r.username,"?"]}),Object(qe.jsxs)(Ke,{className:o.info,children:["You are about to enable ",r.username," into the system, activating previous eligible sessions and grant permissions to access the system."]}),Object(qe.jsx)(Ke,{className:o.info,children:"Do you wish to proceed?"})]}),r.enabled&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Disable ",r.username,"?"]}),Object(qe.jsxs)(Ke,{className:o.info,children:["You are about to disable ",r.username," from the system, deactivating previous eligible sessions and removing permissions to access the system."]}),Object(qe.jsx)(Ke,{className:o.info,children:"Do you wish to proceed?"})]}),Object(qe.jsxs)("div",{className:o.footer,children:[f&&Object(qe.jsx)(rl,{children:f}),m&&Object(qe.jsx)(rl,{children:m}),Object(qe.jsx)(An,{className:o.submit,onClick:function(){return v()},children:"Confirm"})]})]})},K$=Object(f.a)(L$),Q$=function(e){var t=e.state,n=e.dispatch,a=K$(),r=function(){n({type:"close",payload:"showFIDOModal"})};return Object(qe.jsxs)(Yh,{closeOnBackdropClick:!0,width:450,height:275,handleClose:r,open:t.showFIDOModal,children:[Object(qe.jsx)(Ye,{className:a.modalTitle,children:"About FIDO authentication"}),Object(qe.jsx)(Ke,{className:a.info,children:"This feature is only available for websites with configured domains, and we detected that a domain is not configured at the moment."}),Object(qe.jsx)(Ke,{children:"Make sure that a domain is configured for this website and try again later."}),Object(qe.jsx)("div",{className:a.footer,children:Object(qe.jsx)(An,{className:a.submit,onClick:function(){return r()},children:"Confirm"})})]})},Y$=x()(h$||(h$=Object(c.a)(["\n mutation createReset2FAToken($confirmationCode: String, $userID: ID!) {\n createReset2FAToken(confirmationCode: $confirmationCode, userID: $userID) {\n token\n user_id\n expire\n }\n }\n"]))),J$=Object(f.a)(L$),eH=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=J$(),c=Object(a.useState)(""),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.b)(Y$,{onCompleted:function(e){var t=e.createReset2FAToken;m(M$("/reset2fa?t=".concat(t.token)))}}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=f.loading,g=f.error,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];Object(a.useEffect)((function(){t.showReset2FAModal&&(v||!i)&&b({variables:{confirmationCode:v,userID:null===r||void 0===r?void 0:r.id}})}),[v,b,i,t.showReset2FAModal,null===r||void 0===r?void 0:r.id]);var w=function(){y(null),n({type:"close",payload:"showReset2FAModal"})};return t.showReset2FAModal&&i&&!v&&Object(qe.jsx)(D$,{showModal:t.showReset2FAModal,handleClose:w,setConfirmation:y})||t.showReset2FAModal&&(v||!i)&&!j&&Object(qe.jsxs)(Yh,{closeOnBackdropClick:!0,width:500,height:200,handleClose:w,open:!0,children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Reset 2FA for ",r.username]}),Object(qe.jsxs)(Ke,{className:o.info,children:["Safely share this link with ",r.username," for a two-factor authentication reset."]}),!g&&Object(qe.jsx)("div",{className:o.addressWrapper,children:Object(qe.jsx)(et,{className:o.address,children:Object(qe.jsx)("strong",{children:Object(qe.jsx)(If,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(qe.jsx)(rl,{children:g})]})},tH=x()(p$||(p$=Object(c.a)(["\n mutation createResetPasswordToken($confirmationCode: String, $userID: ID!) {\n createResetPasswordToken(\n confirmationCode: $confirmationCode\n userID: $userID\n ) {\n token\n user_id\n expire\n }\n }\n"]))),nH=Object(f.a)(L$),aH=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=nH(),c=Object(a.useState)(""),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.b)(tH,{onCompleted:function(e){var t=e.createResetPasswordToken;m(M$("/resetpassword?t=".concat(t.token)))}}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=f.loading,g=f.error,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];Object(a.useEffect)((function(){t.showResetPasswordModal&&(v||!i)&&b({variables:{confirmationCode:v,userID:null===r||void 0===r?void 0:r.id}})}),[v,b,i,t.showResetPasswordModal,null===r||void 0===r?void 0:r.id]);var w=function(){y(null),n({type:"close",payload:"showResetPasswordModal"})};return t.showResetPasswordModal&&i&&!v&&Object(qe.jsx)(D$,{showModal:t.showResetPasswordModal,handleClose:w,setConfirmation:y})||t.showResetPasswordModal&&(v||!i)&&!j&&Object(qe.jsxs)(Yh,{closeOnBackdropClick:!0,width:500,height:180,handleClose:w,open:!0,children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Reset password for ",r.username]}),Object(qe.jsxs)(Ke,{className:o.info,children:["Safely share this link with ",r.username," for a password reset."]}),!g&&Object(qe.jsx)("div",{className:o.addressWrapper,children:Object(qe.jsx)(et,{className:o.address,children:Object(qe.jsx)("strong",{children:Object(qe.jsx)(If,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(qe.jsx)(rl,{children:g})]})},rH=Object(f.a)(L$),iH=x()(b$||(b$=Object(c.a)(["\n query users {\n users {\n id\n username\n role\n enabled\n last_accessed\n last_accessed_from\n last_accessed_address\n }\n }\n"]))),oH=x()(f$||(f$=Object(c.a)(["\n query generateAttestationOptions($userID: ID!, $domain: String!) {\n generateAttestationOptions(userID: $userID, domain: $domain)\n }\n"]))),lH=x()(j$||(j$=Object(c.a)(["\n mutation validateAttestation(\n $userID: ID!\n $attestationResponse: JSONObject!\n $domain: String!\n ) {\n validateAttestation(\n userID: $userID\n attestationResponse: $attestationResponse\n domain: $domain\n )\n }\n"]))),cH={showCreateUserModal:!1,showResetPasswordModal:!1,showReset2FAModal:!1,showRoleModal:!1,showEnableUserModal:!1},sH=function(e,t){var n=t.type,a=t.payload;switch(n){case"close":return cH;case"open":return Object(s.a)(Object(s.a)({},cH),{},Object(z.a)({},a,!0));default:return cH}},dH={user:"Regular",superuser:"Superuser"},uH=function(){var e=rH(),t=Object(a.useContext)(k).userData,n=Object(u.c)(iH).data,r=Object(a.useReducer)(sH,cH),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(u.b)(lH,{onCompleted:function(e){}}),b=Object(l.a)(p,1)[0],f=Object(u.a)(oH,{onCompleted:function(e){var t=e.generateAttestationOptions;return Object(Sl.b)(t).then((function(e){b({variables:{userID:m.id,attestationResponse:e,domain:window.location.hostname}})}))}}),j=Object(l.a)(f,1)[0],g=[{header:"Login",width:307,textAlign:"left",size:"sm",view:function(n){return t.id===n.id?Object(qe.jsxs)("div",{className:e.loginWrapper,children:[Object(qe.jsx)("span",{className:e.username,children:n.username}),Object(qe.jsx)(Ar.a,{size:"small",label:"You",className:e.chip})]}):Object(qe.jsx)("span",{className:e.username,children:n.username})}},{header:"Role",width:160,textAlign:"left",size:"sm",view:function(n){return Object(qe.jsxs)("div",{className:e.loginWrapper,children:[Object(qe.jsx)("span",{children:dH[n.role]}),Object(qe.jsx)(Lr,{className:e.roleSwitch,disabled:t.id===n.id,checked:"superuser"===n.role,onClick:function(){h(n),c({type:"open",payload:"showRoleModal"})},value:"superuser"===n.role})]})}},{header:"Actions",width:565,textAlign:"left",size:"sm",view:function(t){return Object(qe.jsxs)("div",{className:e.actionButtonWrapper,children:[Object(qe.jsx)(He,{Icon:$q,InverseIcon:Aq,color:"primary",onClick:function(){h(t),c({type:"open",payload:"showResetPasswordModal"})},children:"Reset password"}),Object(qe.jsx)(He,{Icon:Yq,InverseIcon:Xq,color:"primary",onClick:function(){h(t),c({type:"open",payload:"showReset2FAModal"})},children:"Reset 2FA"}),Object(qe.jsx)(He,{Icon:I$,InverseIcon:a$,color:"primary",onClick:function(){tp.test(window.location.hostname)?c({type:"open",payload:"showFIDOModal"}):(h(t),j({variables:{userID:t.id,domain:window.location.hostname}}))},children:"Add FIDO"})]})}},{header:"Enabled",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(Lr,{disabled:t.id===e.id,checked:e.enabled,onClick:function(){h(e),c({type:"open",payload:"showEnableUserModal"})},value:e.enabled})}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ll,{title:"User Management"}),Object(qe.jsx)(tl.a,{marginBottom:3,marginTop:-5,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){c({type:"open",payload:"showCreateUserModal"})},children:"Add new user"})}),Object(qe.jsx)(By,{elements:g,data:A.a(["users"])(n)}),Object(qe.jsx)(U$,{state:o,dispatch:c}),Object(qe.jsx)(aH,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(qe.jsx)(eH,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(qe.jsx)(B$,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(qe.jsx)(Z$,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(qe.jsx)(Q$,{state:o,dispatch:c})]})},mH=x()(g$||(g$=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),hH=x()(O$||(O$=Object(c.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),pH=function(){var e,t,n=Zc,r=Qc,i=Object(u.c)(hH).data,o=Object(a.useState)(!1),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.b)(mH,{refetchQueries:function(){return["getData"]}}),j=Object(l.a)(f,2),g=j[0],O=j[1].error,x=null!==(e=null===i||void 0===i?void 0:i.cryptoCurrencies)&&void 0!==e?e:[],v=ss(n)(ss(r)(null===i||void 0===i?void 0:i.config)),y=null!==(t=v.overrides)&&void 0!==t?t:[],w=T.a(R.a("cryptoCurrency"))(y),C=M.a((function(e){return!bl.a(e.code,w)}))(x);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{name:"wallets",data:Fw.a(v),error:null===O||void 0===O?void 0:O.message,enableEdit:!0,editWidth:174,save:function(e){var t=ds(r)(ds(n)(e.wallets[0]));return g({variables:{config:t}})},stripeWhen:function(e){return!wO.isValidSync(e)},inialValues:Fw.a(v),validationSchema:wO,elements:(Pf.utils,[{name:"cryptoUnits",size:"sm",stripe:!0,width:190,input:Br,inputProps:{options:SO,valueProp:"code",labelProp:"display"}},{name:"allowTransactionBatching",header:"Allow BTC Transaction Batching",size:"sm",stripe:!0,width:260,view:function(e,t){return t.allowTransactionBatching?"Yes":"No"},input:ri},{name:"feeMultiplier",header:"BTC Miner's Fee",size:"sm",stripe:!0,width:250,view:EO,input:Br,inputProps:{options:NO,valueProp:"code",labelProp:"display"}}]),setEditing:function(e,t){return d(t)},forceDisable:p})}),Object(qe.jsx)(BO,{children:Object(qe.jsx)(_h,{error:null===O||void 0===O?void 0:O.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,inialValues:kO,save:function(e){var t=ds(r)(ds(n)(e));return g({variables:{config:t}})},validationSchema:CO,data:null!==y&&void 0!==y?y:[],elements:LO(C,(function(e){var t=F.a(Aa.a(W.a("code",null===e||void 0===e?void 0:e.cryptoCurrency)))(x);return t?[t]:[]}),Pf.utils),disableAdd:!(null===C||void 0===C?void 0:C.length),setEditing:function(e,t){return b(t)},forceDisable:s})})]})},bH=x()(x$||(x$=Object(c.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),fH=x()(v$||(v$=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),jH=x()(y$||(y$=Object(c.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n deprecated\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),gH=Object(f.a)({header:{display:"flex",alignItems:"center",justifyContent:"space-between"}}),OH=function(e){var t,n,r,i=e.name,o=gH(),c=Object(a.useState)(null),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(a.useState)(!1),y=Object(l.a)(v,2),w=y[0],C=y[1],k=Object(u.c)(jH).data;console.log(k);var E=Object(u.b)(bH,{onCompleted:function(){return x(!1)},refetchQueries:function(){return["getData"]}}),N=Object(l.a)(E,2),S=N[0],I=N[1].error,L=Object(u.b)(fH,{onCompleted:function(){return m(null)},refetchQueries:function(){return["getData"]}}),F=Object(l.a)(L,1)[0],P=function(e,t){var n=ds(i)(e);return S({variables:{config:n,accounts:t}})},D=(null===k||void 0===k?void 0:k.config)&&ss("locale")(k.config).fiatCurrency,R=(null===k||void 0===k?void 0:k.config)&&ss(i)(k.config),B=null===k||void 0===k?void 0:k.accountsConfig,M=null!==(t=null===k||void 0===k?void 0:k.cryptoCurrencies)&&void 0!==t?t:[],q=null!==(n=null===k||void 0===k?void 0:k.accounts)&&void 0!==n?n:[];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:o.header,children:Object(qe.jsx)(ll,{title:"Wallet Settings",buttons:[{text:"Advanced settings",icon:eM,inverseIcon:_A,toggle:C}]})}),!w&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Zh,{name:"test",namespaces:T.a(A.a(["code"]))(M),data:R,error:null===I||void 0===I?void 0:I.message,stripeWhen:function(e){return!yO.isValidSync(e)},enableEdit:!0,shouldOverrideEdit:function(e){var t=ss(e)(R);return!yO.isValidSync(t)},editOverride:x,editWidth:174,save:P,validationSchema:yO,elements:PO(M,B,(function(e,t,n){return t?!q[t]&&qx[t]?(m(qx[t]),void f((function(){return function(){return n(t)}}))):void n(t):n(t)}))}),O&&Object(qe.jsx)(LF,{coin:Aa.a(W.a("code",O))(M),onClose:function(){return x(!1)},save:P,error:null===I||void 0===I?void 0:I.message,cryptoCurrencies:M,fiatCurrency:D,userAccounts:null===k||void 0===k||null===(r=k.config)||void 0===r?void 0:r.accounts,accounts:q,accountsConfig:B}),d&&Object(qe.jsx)(Yh,{title:"Edit ".concat(d.name),width:478,handleClose:function(){return m(null)},open:!0,children:Object(qe.jsx)(nx,{save:function(e){return F({variables:{accounts:Object(z.a)({},d.code,e)}}).then((function(e){return b(),f(null),e}))},elements:d.elements,validationSchema:d.validationSchema,value:q[d.code]})})]}),w&&Object(qe.jsx)(pH,{})]})},xH=function(){return[{key:"transactions",label:"Transactions",route:"/transactions",allowedRoles:[Mv,Wv],component:LA},{key:"maintenance",label:"Maintenance",route:"/maintenance",allowedRoles:[Mv,Wv],get component(){var e=this;return function(){return Object(qe.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"cash_cassettes",label:"Cash Cassettes",route:"/maintenance/cash-cassettes",allowedRoles:[Mv,Wv],component:zD},{key:"funding",label:"Funding",route:"/maintenance/funding",allowedRoles:[Mv,Wv],component:vL},{key:"logs",label:"Machine Logs",route:"/maintenance/logs",allowedRoles:[Mv,Wv],component:lD},{key:"machine-status",label:"Machine Status",route:"/maintenance/machine-status",allowedRoles:[Mv,Wv],component:mT},{key:"server-logs",label:"Server",route:"/maintenance/server-logs",allowedRoles:[Mv,Wv],component:QB}]},{key:"analytics",label:"Analytics",route:"/analytics",allowedRoles:[Mv,Wv],component:Iy},{key:"settings",label:"Settings",route:"/settings",allowedRoles:[Mv,Wv],get component(){var e=this;return function(){return Object(qe.jsx)(w.b,{to:e.children[0].route})}},children:[{key:ts,label:"Commissions",route:"/settings/commissions",allowedRoles:[Mv,Wv],component:Vw},{key:es,label:"Locales",route:"/settings/locale",allowedRoles:[Mv,Wv],component:RF},{key:Kc,label:"Cash-out",route:"/settings/cash-out",allowedRoles:[Mv,Wv],component:sw},{key:Jc,label:"Notifications",route:"/settings/notifications",allowedRoles:[Mv,Wv],component:ZT},{key:"services",label:"3rd Party Services",route:"/settings/3rd-party-services",allowedRoles:[Mv,Wv],component:oA},{key:Qc,label:"Wallet",route:"/settings/wallet-settings",allowedRoles:[Mv,Wv],component:OH},{key:Yc,label:"Operator Info",route:"/settings/operator-info",title:"Operator Information",allowedRoles:[Mv,Wv],get component(){var e=this;return function(){var t;return Object(qe.jsx)(w.b,{to:{pathname:e.children[0].route,state:{prev:null===(t=e.state)||void 0===t?void 0:t.prev}}})}},children:[{key:"contact-info",label:"Contact information",route:"/settings/operator-info/contact-info",allowedRoles:[Mv,Wv],component:LR},{key:"receipt-printing",label:"Receipt",route:"/settings/operator-info/receipt-printing",allowedRoles:[Mv,Wv],component:TR},{key:"sms-notices",label:"SMS notices",route:"/settings/operator-info/sms-notices",allowedRoles:[Mv,Wv],component:FB},{key:"coin-atm-radar",label:"Coin ATM Radar",route:"/settings/operator-info/coin-atm-radar",allowedRoles:[Mv,Wv],component:wR},{key:"terms-conditions",label:"Terms & Conditions",route:"/settings/operator-info/terms-conditions",allowedRoles:[Mv,Wv],component:AB}]}]},{key:"compliance",label:"Compliance",route:"/compliance",allowedRoles:[Mv,Wv],get component(){var e=this;return function(){return Object(qe.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"triggers",label:"Triggers",route:"/compliance/triggers",allowedRoles:[Mv,Wv],component:Pq},{key:"customers",label:"Customers",route:"/compliance/customers",allowedRoles:[Mv,Wv],component:iL},{key:"blacklist",label:"Blacklist",route:"/compliance/blacklist",allowedRoles:[Mv,Wv],component:Xy},{key:"loyalty",label:"Loyalty",route:"/compliance/loyalty",title:"Loyalty Panel",allowedRoles:[Mv,Wv],get component(){var e=this;return function(){var t;return Object(qe.jsx)(w.b,{to:{pathname:e.children[0].route,state:{prev:null===(t=e.state)||void 0===t?void 0:t.prev}}})}},children:[{key:"individual-discounts",label:"Individual Discounts",route:"/compliance/loyalty/individual-discounts",allowedRoles:[Mv,Wv],component:XF},{key:"promo-codes",label:"Promo Codes",route:"/compliance/loyalty/codes",allowedRoles:[Mv,Wv],component:rP}]},{key:"customer",route:"/compliance/customer/:id",allowedRoles:[Mv,Wv],component:pI}]},{key:"system",label:"System",route:"/system",allowedRoles:[Wv],get component(){var e=this;return function(){return Object(qe.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"user-management",label:"User Management",route:"/system/user-management",allowedRoles:[Wv],component:uH},{key:"session-management",label:"Session Management",route:"/system/session-management",allowedRoles:[Wv],component:mA}]}]},vH=function(e){e.numberOfChips;return{totalAssetWrapper:{display:"flex",flexDirection:"row"},totalAssetFieldWrapper:{display:"flex",flexDirection:"column"},fieldHeader:{color:se,marginBottom:5},fieldValue:{fontSize:36},fieldCurrency:{fontSize:20,alignSelf:"flex-end",margin:[[0,0,5,5]]},separator:{fontSize:32,alignSelf:"center",margin:[[25,20,0,20]]},walletChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap"},walletChipWrapper:{flexGrow:0,flexShrink:0,flexBasis:"16.66667%","&:nth-child(6n+1)":{"& > div":{margin:[[0,10,0,0]]}},"&:nth-child(6n)":{"& > div":{margin:[[0,0,0,10]]}},margin:[[10,0]]},walletChip:{height:200,margin:[[0,10]]},walletHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",height:50},logo:{transform:"scale(0.4, 0.4)",height:80,maxWidth:110,margin:[[-14,0,0,-26]]},zecLogo:{margin:[[-15,0,0,-10]]},bchLogo:{margin:[[-12,0,0,-18]]},hedgedText:{color:se,margin:[[13,12,0,0]]},walletValueWrapper:{display:"flex",flexDirection:"column",margin:[[0,0,0,15]]},walletValue:{fontSize:18,margin:[[0,0,10,0]]},walletChipTitle:{marginTop:50}}},yH=(Object(f.a)(vH),x()(w$||(w$=Object(c.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),function(){return{totalAssetWrapper:{display:"flex",flexDirection:"row"},totalAssetFieldWrapper:{display:"flex",flexDirection:"column"},fieldHeader:{color:se,marginBottom:5},fieldValue:{fontSize:36},fieldCurrency:{fontSize:20,alignSelf:"flex-end",margin:[[0,0,5,5]]},separator:{fontSize:32,alignSelf:"center",margin:[[25,20,0,20]]},tableTitle:{marginTop:35},operation:{display:"flex",flexDirection:"row",alignItems:"center"}}}),wH=(Object(f.a)(yH),x()(C$||(C$=Object(c.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),x()(k$||(k$=Object(c.a)(["\n query getData {\n config\n }\n"]))),function(){return{card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K},h4:{marginTop:0},label:{margin:0,color:se},asset:{float:"left"},amount:{float:"right"},row:{backgroundColor:ae,borderBottom:"none"},totalRow:{backgroundColor:re,borderBottom:"none"},leftSide:{margin:[[0,10,20,0]]},rightSide:{margin:[[0,0,0,10]]}}}),CH=(Object(f.a)(wH),x()(E$||(E$=Object(c.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),{borderBottom:"4px solid white",padding:0,paddingLeft:20,paddingRight:20}),kH=(Object(Mr.a)({root:CH})(Su.a),Object(Mr.a)({root:Object(s.a)(Object(s.a)({},CH),{},{backgroundColor:"white"})})(Su.a),Object(f.a)({wrapper:{flex:1,display:"flex",flexDirection:"column",height:"100%"}})),EH=xH(),NH=T.a(sl.a(dl.a("children"),R.a("children"))),SH=F.a(ul.a,NH)(EH),IH=M.a(dl.a("children"))(SH).concat(M.a(dl.a("children"))(EH)),LH=F.a(ul.a,NH)(SH),FH=ml.a(LH,IH),PH=function(){var e=kH(),t=Object(w.h)(),n=Object(w.i)(),r=Object(a.useContext)(k),i=r.wizardTested,o=r.userData;if(!i&&!bl.a(n.pathname)(["/404","/register","/wizard","/login","/register","/resetpassword","/reset2fa"]))return t.push("/wizard"),null;var l=n.state?p.a:cl.a,c=l===p.a?{direction:fl.a(W.a("route",n.state.prev))(LH)>fl.a(W.a("route",n.pathname))(LH)?"right":"left"}:{timeout:400};return Object(qe.jsxs)(w.e,{children:[Object(qe.jsx)(zv,{exact:!0,path:"/",children:Object(qe.jsx)(w.b,{to:{pathname:"/dashboard"}})}),Object(qe.jsx)(zv,{path:"/dashboard",children:Object(qe.jsx)(l,Object(s.a)(Object(s.a)({className:e.wrapper},c),{},{in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(qe.jsx)("div",{className:e.wrapper,children:Object(qe.jsx)(tm,{})})}))}),Object(qe.jsx)(zv,{path:"/machines",component:Rg}),Object(qe.jsx)(zv,{path:"/wizard",component:Bv}),Object(qe.jsx)(qv,{path:"/register",component:hc}),Object(qe.jsx)(qv,{path:"/login",restricted:!0,component:ac}),Object(qe.jsx)(qv,{path:"/resetpassword",component:Ec}),Object(qe.jsx)(qv,{path:"/reset2fa",component:Oc}),(o?FH.filter((function(e){var t=e.allowedRoles;return L.a(o.role,t)})):[]).map((function(t){var a=t.route,r=t.component,i=t.key;return Object(qe.jsx)(zv,{path:a,children:Object(qe.jsx)(l,Object(s.a)(Object(s.a)({className:e.wrapper},c),{},{in:!!Object(w.g)(n.pathname,{path:a}),mountOnEnter:!0,unmountOnExit:!0,children:Object(qe.jsx)("div",{className:e.wrapper,children:Object(qe.jsx)(zv,{path:a,children:Object(qe.jsx)(r,{name:i})},i)})}))},i)})),Object(qe.jsx)(qv,{path:"/404"}),Object(qe.jsx)(qv,{path:"*",children:Object(qe.jsx)(w.b,{to:{pathname:"/404"}})})]})},DH="100%",TH={"@global":Object(s.a)(Object(s.a)({},{"@font-face":[{fontFamily:"Mont",src:['url("/fonts/MontHeavy/mont-heavy-webfont.woff2") format("woff2")','url("/fonts/MontHeavy/mont-heavy-webfont.woff") format("woff")'],fontWeight:900,fontStyle:"normal"},{fontFamily:"Mont",src:['url("/fonts/MontHeavy/mont-bold-webfont.woff2") format("woff2")','url("/fonts/MontHeavy/mont-bold-webfont.woff") format("woff")'],fontWeight:700,fontStyle:"normal"},{fontFamily:"MuseoSans",src:['url("/fonts/MuseoSans/MuseoSans_500-webfont.woff2") format("woff2")','url("/fonts/MuseoSans/MuseoSans_500-webfont.woff") format("woff")'],fontWeight:500,fontStyle:"normal"},{fontFamily:"MuseoSans",src:['url("/fonts/MuseoSans/MuseoSans_700-webfont.woff2") format("woff2")','url("/fonts/MuseoSans/MuseoSans_700-webfont.woff") format("woff")'],fontWeight:700,fontStyle:"normal"},{fontFamily:"BPmono",src:'url("/fonts/BPmono/BPmono.ttf") format("truetype")',fontWeight:500,fontStyle:"normal"}]}),{},(N$={"#root":{width:DH,minHeight:DH},".root-notifcenter-open":{overflowY:"auto",position:"absolute",top:0,bottom:0,left:0},".body-notifcenter-open":{overflow:"hidden"},".root-blur":{filter:"blur(1px)",pointerEvents:"none"},html:{height:DH,"@media screen and (max-height: 900px)":{scrollbarGutter:"stable"}},body:{width:be,display:"flex",minHeight:DH,"@media screen and (min-width: 1200px)":{width:"auto"}}},Object(z.a)(N$,'a::-moz-focus-inner,\n \'input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(N$,'a::-moz-focus-inner,\n input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(N$,"a,\n a:visited,\n a:focus,\n a:active,\n a:hover",{outline:"0 none"}),Object(z.a)(N$,"button::-moz-focus-inner",{border:0}),Object(z.a)(N$,".ReactVirtualized__Grid__innerScrollContainer",{overflow:"inherit !important"}),N$))},RH=n(208),BH=Me.p,AH=Object(RH.a)({typography:{fontFamily:Le,body1:Object(s.a)({},BH)},MuiButtonBase:{disableRipple:!0},palette:{primary:{light:ee,dark:ee,main:ee},secondary:{light:ee,dark:ee,main:ee},background:{default:ae}},overrides:{MuiRadio:{colorSecondary:{color:ee}},MuiAutocomplete:{root:{color:ce},noOptions:{padding:[[6,16]]},option:{'&[data-focus="true"]':{backgroundColor:re}},paper:{color:ce,margin:0},listbox:{padding:0},tag:{'&[data-tag-index="0"]':{marginLeft:0},margin:2,backgroundColor:re,borderRadius:4,height:18}},MuiChip:{label:{paddingLeft:4,paddingRight:4,color:ce,fontSize:Ce}},MuiInput:{root:{color:ce},underline:{"&:before":{borderBottom:[[2,"solid",ce]]}}},MuiInputLabel:{root:{font:"inherit",fontSize:ye,color:se},shrink:{color:ce,transform:"translate(0, 1.7px) scale(0.83)"}},MuiFormLabel:{root:{"&$focused":{color:ce}}},MuiListItem:{root:{"&:nth-of-type(odd)":{backgroundColor:ae}}},MuiToggleButton:{root:{"&$selected":{backgroundColor:G,borderColor:J,borderTopColor:[J,"!important"],"&:hover":{backgroundColor:X}},"&:hover":{backgroundColor:X}}},MuiToggleButtonGroup:{groupedVertical:{borderRadius:8,border:"1px solid",borderColor:G,"&:not(:first-child)":{borderTop:"1px solid",borderTopColor:G,borderTopRightRadius:8,borderTopLeftRadius:8,borderBottomRightRadius:8,borderBottomLeftRadius:8},"&:not(:last-child)":{borderTop:"1px solid",borderTopColor:G,borderTopRightRadius:8,borderTopLeftRadius:8,borderBottomRightRadius:8,borderBottomLeftRadius:8}}}}}),MH=Object(v.c)({plugins:[Object(y.a)()].concat(Object(d.a)(Object(b.a)().plugins))}),WH="100%",zH="column",qH=Object(f.a)(Object(s.a)(Object(s.a)({},TH),{},{root:{backgroundColor:ae,width:WH,minHeight:WH,display:"flex",flexDirection:zH},wrapper:{width:be,height:WH,margin:"0 auto",flex:1,display:"flex",flexDirection:zH},grid:{flex:1,height:"100%"},contentWithSidebar:{flex:1,marginLeft:48,paddingTop:15},contentWithoutSidebar:{width:be}})),$H=x()(S$||(S$=Object(c.a)(["\n query userData {\n userData {\n id\n username\n role\n enabled\n last_accessed\n last_accessed_from\n last_accessed_address\n }\n }\n"]))),HH=function(){var e=qH(),t=Object(w.i)(),n=Object(w.h)(),r=Object(a.useContext)(k),i=r.wizardTested,o=r.userData,l=r.setUserData,c=Object(u.c)($H,{onCompleted:function(e){!o&&(null===e||void 0===e?void 0:e.userData)&&l(e.userData)}}).loading,s=t.pathname,d=function(e){return jn.a((function(t){return t.route===e}))(F.a(ul.a,T.a(R.a("children")),M.a(dl.a("children")))(SH))}(s),m=d?function(e){return Aa.a(W.a("route",hl.a(1,pl.a((function(e){return"/"!==e}),e))))(FH)}(s):{},b="/404"===t.pathname,f=d?e.contentWithSidebar:e.contentWithoutSidebar;return Object(qe.jsxs)("div",{className:e.root,children:[!b&&i&&o&&Object(qe.jsx)(el,{tree:EH,user:o}),Object(qe.jsxs)("main",{className:e.wrapper,children:[d&&!b&&i&&Object(qe.jsx)(p.a,{direction:"left",in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(qe.jsx)("div",{children:Object(qe.jsx)(ll,{title:m.title})})}),Object(qe.jsxs)(h.a,{container:!0,className:e.grid,children:[d&&!b&&i&&Object(qe.jsx)(Si,{data:m.children,isSelected:function(e){return t.pathname===e.route},displayName:function(e){return e.label},onClick:function(e){return n.push(e.route)}}),Object(qe.jsx)("div",{className:f,children:!c&&Object(qe.jsx)(PH,{})})]})]})]})},VH=function(){var e=Object(a.useState)(!1),t=Object(l.a)(e,2),n=t[0],r=t[1],i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],d=o[1];return Object(qe.jsx)(k.Provider,{value:{wizardTested:n,setWizardTested:r,userData:c,setUserData:d,setRole:function(e){c&&e&&c.role!==e&&d(Object(s.a)(Object(s.a)({},c),{},{role:e}))}},children:Object(qe.jsx)(C.a,{children:Object(qe.jsx)(zj,{children:Object(qe.jsx)(j.b,{jss:MH,children:Object(qe.jsxs)(g.a,{theme:AH,children:[Object(qe.jsx)(m.a,{}),Object(qe.jsx)(HH,{})]})})})})})};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));Promise.resolve().then((function(){return o.a.render(Object(qe.jsx)(r.a.StrictMode,{children:Object(qe.jsx)(VH,{})}),document.getElementById("root"))})),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[968,1,2]]]);
//# sourceMappingURL=main.a4b79bb3.chunk.js.map