(this["webpackJsonpswush-management-console"]=this["webpackJsonpswush-management-console"]||[]).push([[1],{379:function(e,t,n){var a={"./amplify-amazon-button_5.entry.js":[415,5],"./amplify-auth-fields_9.entry.js":[416,16],"./amplify-authenticator.entry.js":[417,0,24],"./amplify-button_3.entry.js":[418,6],"./amplify-chatbot.entry.js":[419,10],"./amplify-checkbox.entry.js":[420,25],"./amplify-confirm-sign-in_7.entry.js":[421,0,26],"./amplify-container.entry.js":[422,27],"./amplify-federated-buttons_2.entry.js":[423,7],"./amplify-federated-sign-in.entry.js":[424,20],"./amplify-form-field_4.entry.js":[425,28],"./amplify-greetings.entry.js":[426,8],"./amplify-icon-button.entry.js":[427,29],"./amplify-icon.entry.js":[428,21],"./amplify-link.entry.js":[429,30],"./amplify-nav_2.entry.js":[430,9],"./amplify-photo-picker.entry.js":[431,18],"./amplify-picker.entry.js":[432,19],"./amplify-radio-button_2.entry.js":[433,0,31],"./amplify-s3-album.entry.js":[434,11],"./amplify-s3-image-picker.entry.js":[435,12],"./amplify-s3-image.entry.js":[436,17],"./amplify-s3-text-picker.entry.js":[437,13],"./amplify-s3-text.entry.js":[438,14],"./amplify-select-mfa-type.entry.js":[439,15],"./amplify-sign-in-button.entry.js":[440,22],"./amplify-toast.entry.js":[441,32],"./amplify-tooltip.entry.js":[442,33]};function r(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],r=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(r)}))}r.keys=function(){return Object.keys(a)},r.id=379,e.exports=r},403:function(e,t,n){"use strict";n.r(t);var a=n(15),r=n(19),s=n.n(r),i=n(31),c=n(1),o=n.n(c),l=n(27),u=n.n(l),p=n(20),d=n(550),j=n(505),b=n(16),m=n(33),h=n(54),O=n(7),f=n(17),g=n(23),x=n(516),y=n(517),v=n(408),k=n(302),w=n(511),S=n(209),C=n.n(S),I=n(208),M=n.n(I),N=n(145),D=n.n(N),E=n(219),R=n(555),$=n(507),P=n(513),T=n(406),A=n(269),G=n.n(A),L=n(512),q=n(42),F=n(106),U=n(264),_="UI/SHOW_MENU",B="UI/TOGGLE_MENU",V="UI/HIDE_MENU",Q="UI/ADD_GENERAL_ERROR",z="UI/DISMISS_GENERAL_ERROR",W=function(e){return{type:Q,error:e}},H={showMenu:!1,errors:[]};var Y=Object(U.a)((function(e){return e.ui.errors}),(function(e){return e})),J={children:[{name:"System",path:"/",image:"/img/modules/data-management.svg",children:[{name:"Home",path:"/",description:"Home"},{name:"Alerts",path:"/alerts",description:"Alerts"},{name:"Logs",path:"/logs",description:"Logs"}]},{name:"Data Management",path:"/mapping",image:"/img/modules/data-management.svg",children:[{name:"Mapping",children:[{name:"Dashboard",path:"/mapping",description:"View and manage mappings"},{name:"Items",path:"/mapping/items",description:"View and manage mapped children"}]}]},{name:"Season Fantasy",path:"/season",image:"/img/modules/legacyfantasy.jpg",children:[{name:"Dashboard",path:"/season"},{name:"Alerts",path:"/season/app/v2#/alerts"},{name:"Customers",children:[{name:"Users",path:"/season/general/Users/Users/list.aspx",description:"Manage end users"},{name:"Account Verification Media",path:"/season/Users/UserVerificationMedia.aspx",description:"View and manage account verification media"}]},{name:"Sport",children:[{name:"Persons",path:"/season/app#/persons",description:"Manage persons"},{name:"Players",path:"/season/general/tournaments/TournamentContracts.aspx",description:"Manage players in a tournament"},{name:"Players - Import",path:"/season/general/Tournaments/ImportTournamentElements.aspx",description:"Import players to a tournament"},{name:"Player Merger",path:"/season/general/Elements/ElementMerger.aspx",description:"Import players to a tournament"},{name:"Matches",path:"/season/general/Matches/Basic/List.aspx",description:"Manage matches"},{name:"Match groups",path:"/season/general/matchgroups/list.aspx",description:"Manage match groups"},{name:"Assists",path:"/season/general/Games/Assists.aspx",description:"Manage match groups"},{name:"Teams",path:"/season/general/teams/list.aspx",description:"Manage match groups"},{name:"Tournament teams",path:"/season/general/tournaments/TournamentTeams.aspx",description:"Manage which teams participate in a tournament"},{name:"Formations",path:"/season/general/Formations/list.aspx",description:"Manage formations"},{name:"Locations",path:"/season/general/administration/locations/list.aspx",description:"Manage locations"},{name:"Positions",path:"/season/general/administration/Positions/list.aspx",description:"Manage positions"},{name:"Sports",path:"/season/general/administration/Sports/list.aspx",description:"Manage sports"},{name:"Tournaments",path:"/season/general/administration/tournaments/list.aspx",description:"Manage tournaments"}]},{name:"Social",children:[{name:"Groups export",path:"/season/general/Users/Users/GroupExport.aspx",description:"Export group results"}]},{name:"Fantasy",children:[{name:"Fantasy teams",path:"/season/general/Users/Teams/list.aspx",description:"Manage fantasy teams"},{name:"Games",path:"/season/general/administration/Games/list.aspx",description:"Manage games"},{name:"Turns",path:"/season/general/Turns/List.aspx",description:"Manage turns"},{name:"Events",path:"/season/general/administration/eventTypes/list.aspx",description:"Manage events"},{name:"Rulesets",path:"/season/general/Rulesets/list.aspx",description:"Manage rulesets"},{name:"Ruleset formations",path:"/season/general/Rulesets/formations.aspx",description:"Manage which formations a ruleset uses"},{name:"Player values",path:"/season/general/elements/adjustments.aspx",description:"Manage player values"},{name:"Import player values",path:"/season/general/Import/Import.aspx",description:"Import player values"},{name:"Popularity",path:"/season/general/elements/popularity.aspx",description:"View player popularity reports"},{name:"Revenue report",path:"/season/general/reports/salesui.aspx",description:"View revenue reports"},{name:"Prize report",path:"/season/general/reports/prizereport.aspx",description:"View prize reports"}]},{name:"Users & Teams",children:[{name:"Achievements",path:"/season/general/Achievements/AwardUserAchievements.aspx",description:"Award user achievements"},{name:"Mailing list",path:"/season/general/Users/Users/MailingList.aspx",description:"Extract users for mailing lists"}]},{name:"Client management",children:[{name:"Clients",path:"/season/general/administration/clients/list.aspx",description:"Manage clients"},{name:"Websites",path:"/season/general/administration/websites/list.aspx",description:"Manage websites and game offerings"},{name:"Subsites",path:"/season/general/administration/subsite/list.aspx",description:"Manage websites and game offerings"}]},{name:"Shopping",children:[{name:"Orders",path:"/season/general/Shopping/Order/Find.aspx",description:"Manage orders"},{name:"Products",path:"/season/general/Shopping/Products/Find.aspx",description:"Manage products"},{name:"Offerings",path:"/season/app#/tournaments/387/shopping/offerings",description:"Manage product offerings"},{name:"Coupons",path:"/season/general/Shopping/coupon/list.aspx",description:"Manage coupons"},{name:"Feature levels",path:"/season/general/FeatureSystem/Find.aspx",description:"Manage feature levels"},{name:"Freemium model builder",path:"/season/general/Shopping/FeatureLevelAvailabilityBuilder/Standard.aspx",description:"Build freemium models"},{name:"Localized products",path:"/season/general/TextContent/SubsiteProductFinder.aspx",description:"Manage product localization"}]},{name:"Content Management",children:[{name:"Containers",path:"/season/General/TextContent/Default.aspx",description:"Manage translation containers"},{name:"Search",path:"/season/General/TextContent/Search.aspx",description:"Find translation items"},{name:"Bulk import",path:"/season/General/TextContent/Import.aspx",description:"Bulk import translation items"},{name:"FAQ categories",path:"/season/general/faq/faqcategory.aspx",description:"Manage FAQ categories"},{name:"FAQ items",path:"/season/general/faq/faqitem.aspx",description:"Manage FAQ items"},{name:"Views",path:"/season/app#/views",description:"Manage views"}]},{name:"Mailing lists",children:[{name:"Templates",path:"/season/general/support/MailTemplates.aspx",description:"Manage mailing list templates"},{name:"Componser",path:"/season/general/support/MailComposer.aspx",description:"Mailing list composer"},{name:"Turn status mail",path:"/season/general/support/TurnStatusMailsSender.aspx",description:"Turn status mail"}]},{name:"Prizes",children:[{name:"Bundles",path:"/season/app#/prizes/bundles",description:"Manage prize bundles"},{name:"Claims",path:"/season/app#/prizes/claims",description:"Manage prize claims"}]},{name:"Data Management (Legacy)",children:[{name:"Datasources",path:"/season/app#/datasources",description:"Manage datasources"},{name:"Feeds",path:"/season/app/v2#/feeds",description:"Manage feeds"},{name:"Infostrada",path:"/season/app#/dataproviders/infostrada",description:"Manage infostrada"},{name:"Infostrada match importer",path:"/season/general/infostrada/matchImporter.aspx",description:"Infostrada match importer"},{name:"Infostrada match linker",path:"/season/general/infostrada/MatchLinker.aspx",description:"Infostrada match linker"},{name:"Infostrada elements",path:"/season/general/infostrada/element.aspx",description:"Infostrada elements"},{name:"Infostrada elements (Swush)",path:"/season/general/infostrada/ElementSwushBased.aspx",description:"Infostrada elements (Swush)"},{name:"Formula1.com",path:"/season/app#/dataproviders/formula1",description:"Formula 1"},{name:"Formula 1 editor",path:"/season/general/Games/Formula1/List.aspx",description:"Formula 1 editor"},{name:"FantasyData.com",path:"/season/app#/dataproviders/nfldatacom",description:"FantasyData.com"},{name:"Golf import",path:"/season/general/Games/Golf/Importer.aspx",description:"Golf import"},{name:"Golf editor",path:"/season/general/Games/Golf/MatchEditor.aspx",description:"Golf editor"},{name:"Handball",path:"/season/general/Games/Handball/MatchSelector.aspx",description:"Handball"},{name:"Hockey - Nations",path:"/season/general/Games/Icehockey/MatchSelect.aspx",description:"Hockey nations"}]},{name:"Picks",path:"/season/picks",description:"Manage picks games"},{name:"System",children:[{name:"Jobs",path:"/season/app#/jobs",description:"Manage jobs"},{name:"Languages",path:"/season/general/administration/Languages/list.aspx",description:"Manage languages"},{name:"DatasourceLink",path:"/season/general/DatasourceLink/Tools.aspx",description:"DatasourceLink"},{name:"Administrators",path:"/season/general/administration/administrators/list.aspx",description:"Manage administrators"},{name:"Access Groups",path:"/season/general/administration/accessGroups/list.aspx",description:"Manage access Groups"},{name:"Cache bust",path:"/season/cachebust",description:"Cache bust"},{name:"Force update",path:"/season/forceupdate.aspx",description:"Force update"},{name:"Log",path:"/season/general/logs/Log.aspx",description:"Log"},{name:"Log out (Legacy)",path:"/season/logout.aspx",description:"Log out (Legacy)"}]}]},{name:"Sportsbet",path:"/sportsbet",image:"/img/modules/sportsbet.svg",children:[{name:"System",children:[{name:"Alerts",path:"/sportsbet/system/alerta",description:"View alerts"},{name:"FAQ",path:"/sportsbet/system/faq/categories",description:"Manage FAQs"},{name:"Jobs",path:"/sportsbet/system/jobs",description:"Manage jobs"},{name:"Mail templates",path:"/sportsbet/system/mailtemplates",description:"Manage mail templates"},{name:"Mail template partials",path:"/sportsbet/system/mailtemplatepartials",description:"Manage mail template partials"},{name:"Media library",path:"/sportsbet/system/media-library",description:"View media library"},{name:"Providers",path:"/sportsbet/system/providers",description:"Manage providers"},{name:"Reactions",path:"/sportsbet/system/reactions",description:"Manage reactions"},{name:"Schemas",path:"/sportsbet/system/schemas",description:"Manage schemas"},{name:"Segments",path:"/sportsbet/system/segments",description:"Manage segments"},{name:"Tasks",path:"/sportsbet/system/tasks",description:"Manage tasks"},{name:"Users",path:"/sportsbet/system/users",description:"Manage users"},{name:"Webhooks",path:"/sportsbet/system/webhookhandlers",description:"Manage webhooks"}]},{name:"Affiliate",children:[{name:"Clients",path:"/sportsbet/affiliate/affiliateclients",description:"Affiliate clients"},{name:"Affiliates",path:"/sportsbet/affiliate/affiliates",description:"Affiliates"},{name:"Commission Event Types",path:"/sportsbet/affiliate/commissioneventtypes",description:"Manager commission event types"},{name:"Programs",path:"/sportsbet/affiliate/programs",description:"Manage affiliate programs"}]},{name:"Daily Fantasy",children:[{name:"Games",path:"/sportsbet/dfs/game",description:"Manage games"},{name:"Prize Models",path:"/sportsbet/dfs/prize-models",description:"Manage daily prize models"},{name:"Rooms",path:"/sportsbet/dfs/rooms",description:"Manage rooms"},{name:"Rulesets",path:"/sportsbet/dfs/rulesets",description:"Create and manage rulesets"},{name:"SVG Tester",path:"/sportsbet/dfs/svgtester",description:"Test svg player generation"},{name:"Synthetic Event Types",path:"/sportsbet/dfs/syntheticeventtypes",description:"Create and manage synthetic event types"}]},{name:"Economy",children:[{name:"Wager Transmissions",path:"/sportsbet/economy/wagertransmissions",description:"View wager transmissions"},{name:"Wagers",path:"/sportsbet/economy/wagers",description:"View wagers"}]},{name:"Social",children:[{name:"Groups",path:"/sportsbet/social/groups",description:"View and mange groups"}]},{name:"Sport",children:[{name:"Event Types",path:"/sportsbet/sport/eventtypes",description:"View and manage different types of events"},{name:"Leagues",path:"/sportsbet/sport/leagues",description:"View and manage leagues"},{name:"Matches",path:"/sportsbet/sport/matches",description:"View and manage matches"},{name:"Positions",path:"/sportsbet/sport/positions",description:"View and manage positions"},{name:"Sports",path:"/sportsbet/sport/sports",description:"View and manage sports"},{name:"Tournaments",path:"/sportsbet/sport/tournaments",description:"View and manage tournaments"}]}]},{name:"SAM",path:"/sam",image:"/img/modules/sam.svg",children:[{name:"Swush",children:[{name:"Leaderboards",path:"/sam/swush/leaderboards",description:"Manage leaderboards"},{name:"Payment requests",path:"/sam/swush/payment-requests",description:"Manage payment requests"},{name:"Users",path:"/sam/swush/users",description:"Manage users"},{name:"Validation requests",path:"/sam/swush/validation-requests",description:"Manage validation requests"}]},{name:"System",children:[{name:"FAQ",path:"/sam/swush/faq",description:"Manage FAQs"},{name:"Segments",path:"/sam/swush/segments",description:"Manage segments"}]}]}]},X=n(508),K=n(509),Z=function e(t,n,r,s){return Array.prototype.concat.apply(t.map((function(e,t){return Object(a.a)(Object(a.a)({},e),{},{id:s?s+"."+t:t+"",level:r||1,parent:s||null})})),t.map((function(t,a){return e(n(t)||[],n,(r||1)+1,s?s+"."+a:a+"")})))},ee=n(4),te=Object(j.a)((function(e){return{list:{width:250,overflow:"hidden"},fullList:{width:"auto"},drawer:{width:250},drawerOffset:e.mixins.toolbar,moduleHeader:{width:250},moduleImage:{marginRight:e.spacing(1)}}})),ne=function(e){var t=e.menu,n=te(),a=o.a.useState(null),r=Object(b.a)(a,2),s=r[0],i=r[1];return Object(ee.jsxs)("div",{className:n.moduleHeader,children:[Object(ee.jsx)($.a,{children:Object(ee.jsxs)(T.a,{button:!0,onClick:function(e){i(e.currentTarget)},children:[Object(ee.jsx)(X.a,{children:Object(ee.jsx)("img",{className:n.moduleImage,src:t.module&&t.module.image,width:"32",height:"32"})}),Object(ee.jsx)(K.a,{children:t.module&&t.module.name}),Object(ee.jsx)(G.a,{})]})}),Object(ee.jsx)(k.a,{anchorEl:s,open:Boolean(s),onClose:function(){i(null)},children:t.modules.map((function(e){return Object(ee.jsxs)(w.a,{component:g.b,to:e&&e.path,children:[Object(ee.jsx)(X.a,{children:Object(ee.jsx)("img",{className:n.moduleImage,src:e.image,width:"32",height:"32"})}),e.name]},e.name)}))})]})};function ae(){var e=te(),t=Object(q.c)((function(e){return e.ui.showMenu})),n=Object(q.b)(),r=Object(p.h)(),s=Object(c.useMemo)((function(){var e=Z(J.children,(function(e){return e.children||[]})),t=e.filter((function(e){return 1===e.level})),n=e.find((function(e){return r.pathname+r.hash==e.path}));if(n){var s=(n.parent?n.parent.split("."):[])[0]||n.id;return{module:e.find((function(e){return e.id==s})),modules:t,groups:e.filter((function(e){return e.parent==s})).map((function(t){return Object(a.a)(Object(a.a)({},t),{},{children:e.filter((function(e){return e.parent==t.id}))})}))}}return{modules:t}}),[J,r]);return Object(ee.jsxs)(R.a,{className:e.drawer,variant:"persistent",open:t,onClose:function(){n({type:V})},children:[Object(ee.jsx)("div",{className:e.drawerOffset}),Object(ee.jsx)(ne,{menu:s}),Object(ee.jsx)(P.a,{}),Object(ee.jsx)("div",{className:Object(O.a)(e.list),role:"presentation",children:s&&s.groups&&s.groups.map((function(e){return e.path?Object(ee.jsx)($.a,{children:Object(ee.jsx)(T.a,{button:!0,component:g.b,to:e.path,children:e.name},e.name)}):Object(ee.jsxs)(o.a.Fragment,{children:[Object(ee.jsxs)($.a,{children:[Object(ee.jsx)(L.a,{children:e.name}),(e.children||[]).map((function(e){return Object(ee.jsx)(T.a,{button:!0,component:g.b,to:e.path,children:e.name},e.path)}))]}),Object(ee.jsx)(P.a,{})]},e.name)}))})]})}var re=n(301),se=n(18),ie=n(553),ce=n(515),oe=n(514),le=n(558),ue=n(271),pe=n.n(ue),de=n(557),je=Object(j.a)((function(e){return{inline:{display:"inline"},searchIcon:{padding:e.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},search:{position:"relative",borderRadius:e.shape.borderRadius,backgroundColor:Object(se.c)(e.palette.common.white,.15),"&:hover":{backgroundColor:Object(se.c)(e.palette.common.white,.25)},marginRight:e.spacing(2),marginLeft:0,width:"100%"},primaryItem:{display:"flex",alignItems:"center"},inputRoot:{color:"inherit",width:"100%"},inputInput:{padding:e.spacing(1,1,1,0),paddingLeft:"calc(1em + ".concat(e.spacing(4),"px)"),transition:e.transitions.create("width"),width:"100%"}}})),be=Object(oe.a)({stringify:function(e){return e.title+" "+e.description}});function me(e){var t=e.onNavigate,n=je(),r=Object(c.useRef)();Object(re.a)("Control+ArrowUp",(function(){r.current&&(r.current.focus(),r.current.select())}));var s=Object(c.useMemo)((function(){var e=Z(J.children,(function(e){return e.children}));return e.filter((function(e){return!e.children||0==e.children.length})).map((function(t){for(var n=t.parent?t.parent.split("."):[],a=[],r=null,s=0;s0?a.reduce((function(e,t){return e?e+" > "+t.name:e=t.name}),null):"",image:a[0].image,name:t.name,title:t.name,description:t.description,path:t.path}}))}),[J]),i=function(e){e.target.select()};return Object(ee.jsx)(ie.a,{id:"combo-box-demo",options:s,getOptionLabel:function(e){return e.label},filterOptions:be,style:{width:480},onChange:function(e,n){t(n.path)},groupBy:function(e){return e.group},renderOption:function(e){return Object(ee.jsxs)(ee.Fragment,{children:[Object(ee.jsx)(ce.a,{children:Object(ee.jsx)(de.a,{src:e.image})}),Object(ee.jsx)(K.a,{primary:e.title,secondary:e.description})]})},renderInput:function(e){return Object(ee.jsxs)("div",{className:n.search,ref:e.InputProps.ref,children:[Object(ee.jsx)("div",{className:n.searchIcon,children:Object(ee.jsx)(pe.a,{})}),Object(ee.jsx)(le.a,Object(a.a)(Object(a.a)({placeholder:"Search\u2026"},e.inputProps),{},{onFocus:i,inputRef:r,classes:{root:n.inputRoot,input:n.inputInput}}))]})}})}var he,Oe=n(56),fe=n(108),ge=n(521),xe=n(522),ye=n(119),ve=n.n(ye),ke=Object(j.a)((function(e){return{root:{position:"absolute",inset:0,display:"flex",flexDirection:"column"},appBar:{zIndex:e.zIndex.drawer+1},appBarOpen:{},content:{flex:1,position:"relative"},menuButton:{marginRight:e.spacing(2)},title:{flexGrow:1}}})),we=function(e){var t=e.title,n=e.back,a=ke(),r=(Object(q.b)(),Object(q.c)((function(e){return e.ui.showMenu}))),s=Object(p.g)(),i=Object(O.a)(a.appBar,Object(h.a)({},a.appBarOpen,r));return Object(ee.jsx)(x.a,{position:"static",className:i,color:"primary",elevation:0,children:Object(ee.jsxs)(y.a,{children:[n&&Object(ee.jsx)(v.a,{edge:"start",onClick:function(){return s.goBack()},children:Object(ee.jsx)(ve.a,{})}),Object(ee.jsx)(fe.a,{variant:"h6",className:a.title,children:t})]})})},Se=n(519),Ce=n(306),Ie=n(547),Me=n(518),Ne=function(){var e=Object(q.b)(),t=Object(q.c)(Y),n=t.length>0?t[t.length-1]:null;return n?Object(ee.jsx)(Ce.a,{elevation:0,variant:"outlined",square:!0,children:Object(ee.jsx)(Me.a,{children:Object(ee.jsx)(Ie.a,{p:1,children:Object(ee.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(ee.jsx)("div",{style:{flexGrow:1},children:n}),Object(ee.jsx)("div",{children:Object(ee.jsx)(Se.a,{color:"primary",onClick:function(){e({type:z})},children:"Dismiss"})})]})})})}):null},De=n(105),Ee=Object(j.a)((function(e){return{root:{position:"absolute",inset:0,display:"flex",flexDirection:"column"},appBar:{zIndex:e.zIndex.drawer+1},page:{position:"absolute",inset:0,display:"flex",flexDirection:"column"},pageMenuOpen:{width:"calc(100% - ".concat(250,"px)"),marginLeft:250},content:{flex:1,position:"relative",overflowX:"hidden",overflowY:"auto"},contentPadding:{marginTop:e.spacing(3)},menuButton:{marginRight:e.spacing(2)},title:Object(h.a)({flexGrow:1},e.breakpoints.down("sm"),{display:"none"}),offset:e.mixins.toolbar}})),Re=Object(De.a)(he||(he=Object(m.a)(["\n\t query GetAlertMetrics {\n alertMetrics {\n error\n\t\t warning\n }\n }\n"])));function $e(e){var t=e.busy,n=e.title,a=e.children,r=e.fullHeight,s=Ee(),i=(Object(Oe.a)(),o.a.useState(null)),c=Object(b.a)(i,2),l=c[0],u=c[1],d=Object(q.b)(),j=Object(p.g)(),m=Object(q.c)((function(e){return e.ui.showMenu})),S=Object(f.useQuery)(Re,{pollInterval:6e4}).data,I=S&&(S.alertMetrics.error||0)+(S.alertMetrics.warning||0),N=Object(O.a)(s.page,Object(h.a)({},s.pageMenuOpen,m)),R=Object(O.a)(s.content,Object(h.a)({},s.contentPadding,!r));return Object(ee.jsxs)("div",{className:s.root,children:[Object(ee.jsx)(x.a,{className:s.appBar,elevation:0,color:"white",children:Object(ee.jsxs)(y.a,{children:[Object(ee.jsx)(v.a,{color:"inherit",edge:"start",className:s.menuButton,onClick:function(){d({type:B})},children:Object(ee.jsx)(M.a,{})}),Object(ee.jsx)(fe.a,{variant:"h6",className:s.title,children:"Swush Management Console"}),Object(ee.jsx)(me,{onNavigate:function(e){return j.push(e)}}),Object(ee.jsx)(v.a,{component:g.b,to:"/alerts",color:"inherit",children:Object(ee.jsx)(ge.a,{badgeContent:I,color:"error",children:Object(ee.jsx)(D.a,{})})}),Object(ee.jsx)(v.a,{color:"inherit",onClick:function(e){u(e.currentTarget)},edge:"end",children:Object(ee.jsx)(C.a,{})})]})}),Object(ee.jsxs)("div",{className:N,children:[Object(ee.jsx)("div",{className:s.offset}),Object(ee.jsx)(k.a,{id:"simple-menu",anchorEl:l,keepMounted:!0,open:Boolean(l),onClose:function(){u(null)},children:Object(ee.jsx)(w.a,{onClick:function(){u(null),E.a.signOut()},children:"Sign out"})}),Object(ee.jsx)(we,{title:n}),Object(ee.jsx)(Ne,{}),Object(ee.jsxs)("div",{className:R,children:[a,t&&Object(ee.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:Object(ee.jsx)(xe.a,{})})]})]}),Object(ee.jsx)(ae,{})]})}var Pe=Object(j.a)((function(e){return{}}));function Te(){Pe();return Object(ee.jsx)($e,{title:"Home",children:Object(ee.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center "},children:Object(ee.jsx)("img",{src:"welcome.svg",width:"320"})})})}var Ae=n(546),Ge=n(523),Le=n(545),qe=n(551),Fe=n(524),Ue=n(525),_e=n(526),Be=n(527),Ve=function(){var e=Object(p.h)(),t=new URLSearchParams(e.search);return Array.from(t.keys()).reduce((function(e,n){return e[n]=t.get(n),e}),{})},Qe=function(){var e=Ve(),t=e.logGroupName,n=e.logStreamName,a=Object(c.useState)(null),r=Object(b.a)(a,2),o=r[0],l=r[1];return Object(c.useEffect)(Object(i.a)(s.a.mark((function e(){var a,r,i,c,o;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,E.a.currentSession();case 2:return a=e.sent,r=new Le.a({region:"eu-west-1"}),i=new Ae.a({region:"eu-west-1",credentials:Object(qe.a)({client:r,identityPoolId:"eu-west-1:b3882853-0f5a-49df-9552-0a61246c18b5",logins:{"cognito-idp.eu-west-1.amazonaws.com/eu-west-1_ibiNR8TIf":a.getIdToken().getJwtToken()}})}),c=new Ge.a({logGroupName:t,logStreamName:n}),e.next=8,i.send(c);case 8:o=e.sent,l(o);case 10:case"end":return e.stop()}}),e)}))),[]),Object(ee.jsxs)($e,{title:"Log Group",children:[Object(ee.jsx)("h1",{children:"LOGGORUP"}),Object(ee.jsx)(Me.a,{children:Object(ee.jsx)(Fe.a,{component:Ce.a,children:Object(ee.jsx)(Ue.a,{children:o&&o.events.map((function(e){return Object(ee.jsxs)(_e.a,{children:[Object(ee.jsx)(Be.a,{children:e.timestamp}),Object(ee.jsx)(Be.a,{children:Object(ee.jsx)("pre",{children:e.message})})]})}))})})})]})},ze=n(528),We=function(){var e=Ve().name,t=Object(c.useState)(null),n=Object(b.a)(t,2),a=n[0],r=n[1];return Object(c.useEffect)(Object(i.a)(s.a.mark((function t(){var n,a,i,c,o;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,E.a.currentSession();case 2:return n=t.sent,a=new Le.a({region:"eu-west-1"}),i=new Ae.a({region:"eu-west-1",credentials:Object(qe.a)({client:a,identityPoolId:"eu-west-1:b3882853-0f5a-49df-9552-0a61246c18b5",logins:{"cognito-idp.eu-west-1.amazonaws.com/eu-west-1_ibiNR8TIf":n.getIdToken().getJwtToken()}})}),c=new ze.a({logGroupName:e}),t.next=8,i.send(c);case 8:o=t.sent,r(o);case 10:case"end":return t.stop()}}),t)}))),[]),Object(ee.jsxs)($e,{title:"Log Group",children:[Object(ee.jsx)("h1",{children:"LOGGORUP"}),Object(ee.jsx)(Me.a,{children:Object(ee.jsx)(Fe.a,{component:Ce.a,children:Object(ee.jsx)(Ue.a,{children:a&&a.logStreams.map((function(t){return Object(ee.jsxs)(_e.a,{children:[Object(ee.jsx)(Be.a,{children:Object(ee.jsx)(g.b,{to:"/logs/log-events?logGroupName=".concat(encodeURIComponent(e),"&logStreamName=").concat(encodeURIComponent(t.logStreamName)),children:t.logStreamName})}),Object(ee.jsx)(Be.a,{children:new Date(t.creationTime)+""})]})}))})})})]})},He=n(529),Ye=function(){var e=Object(c.useState)(null),t=Object(b.a)(e,2),n=t[0],a=t[1];return Object(c.useEffect)(Object(i.a)(s.a.mark((function e(){var t,n,r,i,c;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,E.a.currentSession();case 2:return t=e.sent,n=new Le.a({region:"eu-west-1"}),r=new Ae.a({region:"eu-west-1",credentials:Object(qe.a)({client:n,identityPoolId:"eu-west-1:b3882853-0f5a-49df-9552-0a61246c18b5",logins:{"cognito-idp.eu-west-1.amazonaws.com/eu-west-1_ibiNR8TIf":t.getIdToken().getJwtToken()}})}),i=new He.a({}),e.next=8,r.send(i);case 8:c=e.sent,a(c);case 10:case"end":return e.stop()}}),e)}))),[]),Object(ee.jsx)($e,{title:"Logs",children:Object(ee.jsx)(Me.a,{children:Object(ee.jsx)(Fe.a,{component:Ce.a,children:Object(ee.jsx)(Ue.a,{children:n&&n.logGroups.map((function(e){return Object(ee.jsxs)(_e.a,{children:[Object(ee.jsx)(Be.a,{children:Object(ee.jsx)(g.b,{to:"/logs/log-group?name=".concat(encodeURIComponent(e.logGroupName)),children:e.logGroupName})}),Object(ee.jsx)(Be.a,{children:e.retentionInDays?"".concat(e.retentionInDays," day(s)"):"Never expire"})]})}))})})})})};var Je,Xe,Ke,Ze,et,tt,nt,at,rt,st,it,ct=function(){return Object(ee.jsxs)(p.d,{children:[Object(ee.jsx)(p.b,{path:"/logs/log-events",component:Qe}),Object(ee.jsx)(p.b,{path:"/logs/log-group",component:We}),Object(ee.jsx)(p.b,{path:"/logs",component:Ye})]})},ot=function(){return Object(ee.jsx)($e,{children:Object(ee.jsx)("h1",{children:"Ok"})})},lt=function(){return Object(ee.jsx)(p.d,{children:Object(ee.jsx)(p.b,{path:"/import",component:ot})})},ut=function(){return Object(ee.jsx)(lt,{})},pt=Object(j.a)((function(){return{container:{width:"100%",height:"100%"},iframe:{width:"100%",height:"100%"}}})),dt=function(e){var t=e.baseUrl,n=e.title,a=pt(),r=Object(p.i)(),s=Object(p.h)(),i=r[0],o=Object(c.useRef)(),l=Object(c.useState)(!1),u=Object(b.a)(l,2),d=u[0],j=u[1];return Object(c.useEffect)((function(){if(o.current){j(!0);var e=document.createElement("iframe");return e.className=a.iframe,e.frameBorder="0",e.onload=function(){j(!1)},e.src=i?"".concat(t,"/").concat(i,"?naked=true").concat(s.hash):"".concat(t),o.current.appendChild(e),function(){o.current&&o.current.removeChild(e)}}}),[o,s,i]),Object(ee.jsx)($e,{busy:d,title:n,fullHeight:!0,children:Object(ee.jsx)("div",{className:a.container,ref:o})})},jt=function(){return Object(ee.jsx)(dt,{title:"Legacy Fantasy Sport",baseUrl:"https://console.swush.com"})},bt=Object(j.a)((function(){return{container:{width:"100%",height:"100%"},iframe:{width:"100%",height:"100%"}}})),mt=function(){var e=bt(),t=Object(p.i)(),n=Object(p.h)(),a=t[0],r=Object(c.useRef)(),s=Object(c.useState)(!1),i=Object(b.a)(s,2),o=i[0],l=i[1];return Object(c.useEffect)((function(){if(r.current){l(!0);var t=document.createElement("iframe");return t.className=e.iframe,t.frameBorder="0",t.onload=function(){l(!1)},t.src="".concat("https://sportsbet-console.swush.com","/").concat(a,"?naked=true").concat(n.hash),r.current.appendChild(t),function(){r.current&&r.current.removeChild(t)}}}),[r,n,a]),Object(ee.jsx)($e,{busy:o,title:"Daily Fantasy",fullHeight:!0,children:Object(ee.jsx)("div",{className:e.container,ref:r})})},ht=Object(j.a)((function(){return{container:{width:"100%",height:"100%"},iframe:{width:"100%",height:"100%"}}})),Ot=function(){var e=ht(),t=Object(p.i)(),n=Object(p.h)(),a=t[0],r=Object(c.useRef)(),s=Object(c.useState)(!1),i=Object(b.a)(s,2),o=i[0],l=i[1];return Object(c.useEffect)((function(){if(r.current){l(!0);var t=document.createElement("iframe");return t.className=e.iframe,t.frameBorder="0",t.onload=function(){l(!1)},t.src="".concat("https://sam-console.swush.com","/").concat(a,"?naked=true").concat(n.hash),r.current.appendChild(t),function(){r.current&&r.current.removeChild(t)}}}),[r,n,a]),Object(ee.jsx)($e,{busy:o,title:"Daily Fantasy",fullHeight:!0,children:Object(ee.jsx)("div",{className:e.container,ref:r})})},ft=Object(j.a)((function(e){return{paper:{padding:e.spacing(2),display:"flex",overflow:"auto",flexDirection:"column"},footer:{textAlign:"right"}}})),gt=function(){var e=ft();return Object(ee.jsx)($e,{title:"Dashboard",children:Object(ee.jsx)(Me.a,{children:Object(ee.jsxs)(Ce.a,{className:e.paper,children:[Object(ee.jsx)(fe.a,{variant:"h6",children:"Item catalog"}),Object(ee.jsx)(fe.a,{variant:"body1",component:"p",color:"textSecondary",children:"Find items in the mapping catalog."}),Object(ee.jsx)("footer",{className:e.footer,children:Object(ee.jsx)(Se.a,{variant:"contained",color:"primary",component:g.b,to:"/mapping/items",children:"View item catalog"})})]})})})},xt=n(541),yt=n(540),vt=n(287),kt=n.n(vt),wt=n(548),St=n(530),Ct=n(535),It=n(532),Mt=n(531),Nt=n(534),Dt=n(533),Et={key:"",title:"",description:"",folder:!1},Rt=Object(f.gql)(Je||(Je=Object(m.a)(["\n\tmutation AddItem($path: String!, $key: String!, $title: String!, $folder: Boolean!) {\n\t\tcreateItem(path: $path, key: $key, title: $title, folder: $folder) {\n\t \t\tid\n\t\t}\n \t}\n"]))),$t=function(e){var t=e.path,n=e.title,r=e.open,o=e.onClose,l=Object(f.useMutation)(Rt),u=Object(b.a)(l,2),p=u[0],d=u[1],j=(d.data,d.error,Object(c.useState)(Object(a.a)({},Et))),m=Object(b.a)(j,2),h=m[0],O=m[1],g=Object(c.useState)(),x=Object(b.a)(g,2),y=x[0],v=x[1],k=function(){var e=Object(i.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,p({variables:Object(a.a)({path:t||"/"},h)});case 3:o(),O(Object(a.a)({},Et)),v(null),e.next=15;break;case 8:if(e.prev=8,e.t0=e.catch(0),!e.t0.graphQLErrors){e.next=14;break}e.t0.graphQLErrors.forEach((function(e){"BAD_USER_INPUT"==e.extensions.code&&v(e.extensions.validationErrors)})),e.next=15;break;case 14:throw e.t0;case 15:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),w=function(){o(),O(Object(a.a)({},Et)),v(null)};return Object(ee.jsxs)(St.a,{open:r,onClose:w,"aria-labelledby":"form-dialog-title",children:[Object(ee.jsx)(Mt.a,{id:"form-dialog-title",children:n||"New Item"}),Object(ee.jsxs)(It.a,{children:[Object(ee.jsx)(wt.a,{value:h.key,error:y&&y.key,variant:"outlined",autoFocus:!0,margin:"normal",id:"key",label:"Key",fullWidth:!0,onChange:function(e){return O(Object(a.a)(Object(a.a)({},h),{},{key:e.target.value}))},helperText:y&&y.key}),Object(ee.jsx)(wt.a,{value:h.title,error:y&&y.title,variant:"outlined",margin:"normal",id:"name",label:"Title",type:"email",helperText:y&&y.title,fullWidth:!0,onChange:function(e){return O(Object(a.a)(Object(a.a)({},h),{},{title:e.target.value}))}}),Object(ee.jsx)(wt.a,{value:h.description,variant:"outlined",margin:"normal",id:"name",label:"Description",multiline:!0,rows:3,fullWidth:!0,onChange:function(e){return O(Object(a.a)(Object(a.a)({},h),{},{description:e.target.value}))}}),Object(ee.jsx)(Dt.a,{control:Object(ee.jsx)(Nt.a,{checked:h.folder,onChange:function(e){return O(Object(a.a)(Object(a.a)({},h),{},{folder:e.target.checked}))},name:"checkedB",color:"primary"}),label:"Folder?"})]}),Object(ee.jsxs)(Ct.a,{children:[Object(ee.jsx)(Se.a,{onClick:w,color:"primary",children:"Cancel"}),Object(ee.jsx)(Se.a,{onClick:k,color:"primary",children:"Ok"})]})]})},Pt=n(304),Tt=n(537),At=n(536),Gt=n(554),Lt=n(282),qt=n.n(Lt),Ft=n(283),Ut=n.n(Ft),_t=n(284),Bt=n.n(_t),Vt=function(e){var t=(e=(e||"").trim()).replace(/^\/|\/$/g,"").split("/"),n=t[t.length-1].trim(),a="/"+t.slice(0,t.length-1).join("/"),r=t.length>2?"/"+t.slice(0,t.length-2).join("/"):null;return{parts:t,parent:r,path:a,key:n}},Qt=function(e){return Object.keys(e).map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))})).join("&")},zt=Object(j.a)((function(e){return{spinnerCell:{position:"relative"},progress:{position:"absolute",left:0,right:0,top:0},search:{flexGrow:1,borderRadius:0}}})),Wt=function(e){var t=e.path,n=[{path:"/",text:"root"}].concat(Object(F.a)((t||"").split("/").filter((function(e){return e.length>0})).map((function(e,t,n){var a=n.slice(0,t+1).join("/");return{path:a.length>0?a:"/",text:e.length>0?e:"root"}}))));return Object(ee.jsx)(Gt.a,{style:{flexGrow:1},children:n.map((function(e,t){return Object(ee.jsx)(At.a,{component:g.b,to:"/"!=e.path?"/mapping/items?path=".concat(e.path,"¤t=").concat(e.path):"/mapping/items",children:e.text},e.path)}))})},Ht=function(e){e.after,e.before;var t=e.query,n=e.path,r=e.items,s=e.startCursor,i=e.endCursor,c=e.showPrevious,o=e.showNext,l=e.onChangeQuery,u=e.onRefresh,p=zt(),d=Vt(n).path,j=Ve(),b=(j.after,j.before,Object(Pt.a)(j,["after","before"])),m="/mapping/items?".concat(Qt(Object(a.a)(Object(a.a)({},b),{},{after:i}))),h="/mapping/items?".concat(Qt(Object(a.a)(Object(a.a)({},b),{},{before:s}))),O=function(e){return e.folder?"/mapping/items?".concat(Qt({path:e.path+e.key,current:e.path+e.key})):"/mapping/items?".concat(Qt(Object(a.a)(Object(a.a)({},j),{},{current:e.path+e.key})))};return Object(ee.jsxs)(Ce.a,{children:[Object(ee.jsxs)(y.a,{className:p.toolbar,children:["/"!=n&&Object(ee.jsx)(v.a,{edge:"start",component:g.b,className:p.back,to:"/mapping/items?path=".concat(d),onClick:function(e){return e.stopPropagation()},children:Object(ee.jsx)(ve.a,{})}),Object(ee.jsx)(Wt,{path:n}),Object(ee.jsx)(v.a,{edge:"end",color:"inherit",onClick:function(){u()},children:Object(ee.jsx)(qt.a,{})})]}),Object(ee.jsxs)(Ie.a,{px:2,children:[Object(ee.jsx)(wt.a,{value:t,size:"small",label:"Search",fullWidth:!0,onChange:l}),!1]}),Object(ee.jsx)($.a,{children:r.map((function(e){return Object(ee.jsxs)(T.a,{button:!0,hover:!0,component:g.b,to:O(e),children:[Object(ee.jsx)(X.a,{edge:"start",children:e.folder?Object(ee.jsx)(Ut.a,{color:"disabled",style:{marginRight:"10px"}}):Object(ee.jsx)(Bt.a,{color:"disabled",style:{marginRight:"10px"}})}),Object(ee.jsx)(K.a,{primary:e.title})]},e.path+e.key)}))}),Object(ee.jsxs)(y.a,{children:[Object(ee.jsx)(Se.a,{component:g.b,to:h,disabled:!c,children:"Prev"}),Object(ee.jsx)(Se.a,{component:g.b,to:m,disabled:!o,children:"Next"})]})]})},Yt=n(552),Jt=n(286),Xt=n.n(Jt),Kt=n(152),Zt=n.n(Kt),en=n(285),tn=n.n(en),nn=function(){var e=Object(c.useState)([]),t=Object(b.a)(e,2),n=t[0],a=t[1];Object(c.useEffect)((function(){a([])}),[]);var r=function(e){n.indexOf(e)<0&&a([].concat(Object(F.a)(n),[e]))},s=function(e){var t=n.indexOf(e);t>=0&&a([].concat(Object(F.a)(n.slice(0,t)),Object(F.a)(n.slice(t+1))))};return{selection:n,select:r,unselect:s,toggle:function(e){n.indexOf(e)>=0?s(e):r(e)},clear:function(){a([])}}},an=n(538),rn=Object(f.gql)(Xe||(Xe=Object(m.a)(["\nquery GetItem($path: String!) {\n item(path: $path) {\n id\n path\n key\n title\n description\n }\n}\n"]))),sn=(Object(f.gql)(Ke||(Ke=Object(m.a)(["\n mutation AddItem($path: String!, $key: String!, $title: String!, $folder: Boolean!) {\n createItem(path: $path, key: $key, title: $title, folder: $folder) {\n id\n }\n }\n"]))),Object(f.gql)(Ze||(Ze=Object(m.a)(["\n mutation AddLink($source: Int!, $target: Int!) {\n createLink(source: $source, target: $target) {\n id\n }\n }\n"])))),cn=Object(f.gql)(et||(et=Object(m.a)(["\n mutation DeleteLink($id: ID!) {\n deleteLink(id: $id) {\n id\n }\n }\n"]))),on=function(e){var t=e.open,n=e.item,a=e.title,r=e.onClose,l=Object(c.useState)(""),u=Object(b.a)(l,2),p=u[0],d=u[1],j=Object(c.useState)(""),m=Object(b.a)(j,2),h=m[0],O=m[1],g=function(e){var t=Object(f.useApolloClient)();return o.a.useCallback((function(n){return t.query({query:e,variables:n})}),[t])}(rn),x=Object(f.useMutation)(sn),y=Object(b.a)(x,1)[0],v=function(){var e=Object(i.a)(s.a.mark((function e(){var t,a,i,c;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Vt(p),a=t.path,i=t.key,e.next=3,g({path:a+"/"+i});case 3:if(!(c=e.sent).data.item){e.next=17;break}return e.prev=5,e.next=8,y({variables:{source:parseInt(n.id),target:parseInt(c.data.item.id)}});case 8:O(""),r(!0),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),O(e.t0.message);case 15:e.next=18;break;case 17:O("Invalid path/key.");case 18:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(){return e.apply(this,arguments)}}();return Object(ee.jsxs)(St.a,{open:t,onClose:function(){return r(!1)},"aria-labelledby":"form-dialog-title",children:[Object(ee.jsx)(Mt.a,{id:"form-dialog-title",children:a}),Object(ee.jsxs)(It.a,{children:[Object(ee.jsx)(an.a,{children:"To create a link manually enter the target path of the object to link this item to below."}),Object(ee.jsx)(wt.a,{value:p,error:!!h,helperText:h,autoFocus:!0,margin:"dense",id:"name",label:"Target path",type:"name",fullWidth:!0,onChange:function(e){return d(e.target.value)}})]}),Object(ee.jsxs)(Ct.a,{children:[Object(ee.jsx)(Se.a,{onClick:function(){return r(!1)},color:"primary",children:"Cancel"}),Object(ee.jsx)(Se.a,{onClick:v,disabled:p.length<1,color:"primary",children:"Ok"})]})]})},ln=function(e){var t=e.open,n=e.title,a=e.text,r=e.onConfirm,s=e.onCancel;return Object(ee.jsxs)(St.a,{open:t,onClose:s,"aria-labelledby":"form-dialog-title",children:[Object(ee.jsx)(Mt.a,{id:"form-dialog-title",children:n}),Object(ee.jsx)(It.a,{children:Object(ee.jsx)(an.a,{children:a})}),Object(ee.jsxs)(Ct.a,{children:[Object(ee.jsx)(Se.a,{onClick:s,color:"primary",children:"Cancel"}),Object(ee.jsx)(Se.a,{onClick:r,color:"primary",children:"Ok"})]})]})},un=n(539),pn=n(110),dn=n.n(pn),jn=n(123),bn=n.n(jn),mn=Object(f.gql)(tt||(tt=Object(m.a)(["\n query GetItems($path : String, $query : String, $limit : Int, $after : String, $before : String) {\n items(path : $path, query: $query, limit : $limit, after : $after, before : $before) {\n totalCount\n edges {\n node {\n id\n path\n key\n title\n description\n folder\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n }\n }\n }\n"]))),hn=Object(j.a)((function(e){return{paper:Object(h.a)({},e.breakpoints.up("md"),{minWidth:"480px"})}})),On=function(e){var t=e.item;return Object(ee.jsxs)("div",{children:[t.path,t.key,Object(ee.jsx)("br",{}),t.description]})},fn=function(e){var t=e.open,n=e.title,r=e.path,o=e.onClose,l=hn(),u=Object(c.useState)(""),p=Object(b.a)(u,2),d=p[0],j=p[1],m=Object(c.useState)(),h=Object(b.a)(m,2),O=h[0],g=h[1],x=Object(c.useState)(null),k=Object(b.a)(x,2),w=k[0],S=k[1],C=Object(f.useQuery)(mn,{variables:Object(a.a)({path:r,query:d,limit:10},w)}),I=C.loading,M=(C.error,C.data),N=C.previousData,D=(M||N||{items:null}).items||{edges:null,pageInfo:null},E=D.edges,R=D.pageInfo||{hasNextPage:!1,hasPreviousPage:!1,startCursor:"",endCursor:""},P=R.hasNextPage,A=R.hasPreviousPage,G=R.startCursor,L=R.endCursor,q=function(){var e=Object(i.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P&&S({after:L});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),F=Object(Oe.a)(),U=Object(un.a)(F.breakpoints.down("sm"));return Object(ee.jsxs)(St.a,{open:t,onClose:function(){return o(!1)},fullScreen:U,classes:{paper:l.paper},children:[Object(ee.jsx)(Mt.a,{color:"primary",id:"form-dialog-title",children:n||"Find item"}),Object(ee.jsxs)(It.a,{children:[Object(ee.jsx)(wt.a,{size:"small",value:d,onChange:function(e){return j(e.target.value)},fullWidth:!0,label:"Search",autoFocus:!0}),I&&Object(ee.jsx)(Tt.a,{}),Object(ee.jsx)($.a,{dense:!0,children:E&&E.map((function(e){return Object(ee.jsx)(T.a,{divider:!0,selected:O===e.node,onClick:function(){return g(e.node)},children:Object(ee.jsx)(K.a,{primary:e.node.title,secondary:Object(ee.jsx)(On,{item:e.node})})},e.node.id)}))}),Object(ee.jsxs)(y.a,{children:[Object(ee.jsx)("div",{style:{flexGrow:1}}),Object(ee.jsx)(v.a,{onClick:function(){A&&S({before:G})},disabled:!A,children:Object(ee.jsx)(bn.a,{})}),Object(ee.jsx)(v.a,{onClick:q,disabled:!P,children:Object(ee.jsx)(dn.a,{})})]})]}),Object(ee.jsxs)(Ct.a,{children:[Object(ee.jsx)(Se.a,{onClick:function(){return o(!1)},color:"primary",children:"Cancel"}),Object(ee.jsx)(Se.a,{onClick:function(){return o(O)},disabled:!O,color:"primary",children:"Ok"})]})]})},gn=function(e){var t=e.item;return Object(ee.jsxs)("div",{children:[t.title,Object(ee.jsx)(fe.a,{variant:"body2",color:"textSecondary",children:t.path+t.key})]})},xn=Object(f.gql)(nt||(nt=Object(m.a)(["\n query GetItemDetails($path: String!) {\n item(path: $path) {\n id\n path\n key\n title\n description\n links {\n id,\n target {\n path,\n key,\n title\n },\n created\n }\n }\n }\n"]))),yn=Object(f.gql)(at||(at=Object(m.a)(["\n mutation DeleteItem($id: ID!) {\n deleteItem(id: $id) {\n id\n }\n }\n"]))),vn=Object(j.a)((function(e){var t;return t={title:{display:"flex"},scope:{textTransform:"uppercase"},root:{display:"flex"},titleRoot:{flexGrow:1}},Object(h.a)(t,"title",{display:"flex",alignItems:"center",fontWeight:"normal"}),Object(h.a)(t,"scope",{textTransform:"uppercase"}),Object(h.a)(t,"details",{display:"flex",flexDirection:"column"}),Object(h.a)(t,"content",{flex:"1 0 auto"}),t})),kn=function(e){var t=e.item,n=vn();if(!t)return null;var a=t?t.path.split("/")[1]:"(Root)";return a||(a="(Root)"),Object(ee.jsxs)("div",{className:n.titleRoot,children:[t?Object(ee.jsx)(fe.a,{variant:"h6",className:n.title,children:t&&t.title}):Object(ee.jsx)(fe.a,{variant:"h6",className:n.title,color:"textSecondary",children:"(No item selected)"}),Object(ee.jsx)(fe.a,{variant:"body2",color:"textSecondary",children:t&&"".concat(t.path).concat(t.key)}),Object(ee.jsx)(fe.a,{variant:"body2",color:"textSecondary",children:t&&t.description})]})},wn=function(e){var t=e.path,n=e.onDeleted;console.log("CURRENT",t);var a=Object(f.useQuery)(xn,{variables:{path:t},skip:!t}),r=a.loading,l=a.error,u=a.data,p=a.refetch,d=Object(f.useMutation)(cn),j=Object(b.a)(d,1)[0],m=Object(f.useMutation)(sn),h=Object(b.a)(m,1)[0];Object(c.useEffect)((function(){p()}),[t]),console.log("CURRENTXZ",t,u,r,l);var O=Vt(t),S=Object(f.useQuery)(xn,{variables:{path:O.path}}).data,C=(u||{item:null}).item,I=(C||{links:[]}).links,M=S&&S.item&&S.item.links.map((function(e){return e.target}))||[],N=Object(c.useState)(!1),D=Object(b.a)(N,2),E=D[0],R=D[1],P=Object(c.useState)(!1),A=Object(b.a)(P,2),G=A[0],L=A[1],q=Object(c.useState)(!1),F=Object(b.a)(q,2),U=F[0],_=F[1],B=nn(),V=B.selection,Q=B.toggle,z=B.clear,W=Object(c.useState)(null),H=Object(b.a)(W,2),Y=H[0],J=H[1],Z=o.a.useState(null),te=Object(b.a)(Z,2),ne=te[0],ae=te[1],re=Object(f.useMutation)(yn),se=Object(b.a)(re,1)[0],ie=function(){var e=Object(i.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M.length>1?ae(t.currentTarget):J(M[0].path+M[0].key);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ce=function(){var e=Object(i.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}return e.next=3,h({variables:{source:parseInt(C.id),target:parseInt(t.id)}});case 3:p();case 4:J(null);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),oe=function(){var e=Object(i.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!1),t=V.map((function(e){return j({variables:{id:e}})})),e.next=4,Promise.all(t);case 4:return e.next=6,p();case 6:z();case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=Object(i.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,se({variables:{id:C.id}});case 3:_(!1),n(),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(0),_(!1),e.t0.graphQLErrors&&e.t0.graphQLErrors.forEach((function(e){"BAD_USER_INPUT"===e.extensions.code&&alert(e.message)}));case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),ue=function(e){return"/mapping/items?".concat(Qt({path:e.path,current:e.path+e.key}))};return r?null:Object(ee.jsxs)(Ce.a,{children:[Object(ee.jsxs)(y.a,{children:[Object(ee.jsx)(kn,{item:C}),Object(ee.jsx)(v.a,{disabled:!C,onClick:function(){},children:Object(ee.jsx)(tn.a,{})}),Object(ee.jsx)(v.a,{edge:"end",disabled:!C,onClick:function(){_(!0)},children:Object(ee.jsx)(Zt.a,{})})]}),Object(ee.jsx)(ln,{open:U,title:"Delete item?",text:"Are you sure you wish to delete this item?",onCancel:function(){return _(!1)},onConfirm:le}),V.length>0&&Object(ee.jsx)(x.a,{position:"relative",elevation:0,color:"secondary",children:Object(ee.jsxs)(y.a,{children:[Object(ee.jsxs)(fe.a,{variant:"body2",style:{flexGrow:1},children:[V.length," item(s) selected"]}),Object(ee.jsx)(v.a,{edge:"end",color:"inherit",onClick:function(){return L(!0)},children:Object(ee.jsx)(Zt.a,{})})]})}),0==V.length&&Object(ee.jsxs)(y.a,{children:[Object(ee.jsx)(fe.a,{variant:"h6",style:{flexGrow:1},children:"Links"}),Object(ee.jsx)(Se.a,{"aria-controls":"simple-menu","aria-haspopup":"true",onClick:ie,disabled:0==M.length,children:M.length>1?"Quick Link...":"Quick Link"}),Object(ee.jsx)(Se.a,{startIcon:Object(ee.jsx)(Xt.a,{}),disabled:!C,onClick:function(){return R(!0)},children:"Link Manually"})]}),Object(ee.jsx)($.a,{children:I.map((function(e){return Object(ee.jsxs)(T.a,{children:[Object(ee.jsx)(X.a,{children:Object(ee.jsx)(Yt.a,{edge:"start",disableRipple:!0,checked:V.indexOf(e.id)>=0,onChange:function(){return Q(e.id)}})}),Object(ee.jsx)(K.a,{primary:Object(ee.jsx)(gn,{item:e.target})}),Object(ee.jsx)(X.a,{children:Object(ee.jsx)(Se.a,{component:g.b,to:ue(e.target),children:"GO TO"})})]},e.id)}))}),Object(ee.jsx)(on,{title:"Create link manually",item:C,open:E,onClose:function(e){e&&p(),R(!1)}}),Object(ee.jsx)(ln,{open:G,title:"Delete these links?",text:"Are you sure you wish to delete these ".concat(V.length," links(s)?"),onCancel:function(){return L(!1)},onConfirm:oe}),Object(ee.jsx)(k.a,{id:"simple-menu",anchorEl:ne,keepMounted:!0,open:Boolean(ne),onClose:function(){ae(null)},children:M.map((function(e){return Object(ee.jsxs)(w.a,{onClick:function(t){return n=e.path+e.key,ae(null),void J(n);var n},children:['To items in "',e.path+e.key,'"']})}))}),Object(ee.jsx)(fn,{open:Boolean(Y),path:Y,title:"Find match for ".concat(C&&C.title),onClose:ce})]})},Sn=Object(f.gql)(rt||(rt=Object(m.a)(["\n query GetItems($path : String, $query : String, $limit : Int, $after : String, $before : String) {\n items(path : $path, query : $query, limit : $limit, after : $after, before : $before) {\n totalCount\n edges {\n node {\n path\n key\n title\n folder\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasPreviousPage\n hasNextPage\n }\n }\n }\n"]))),Cn=function(){var e=Ve(),t=e.path,n=e.current,a=e.after,r=e.before,s=Object(p.g)(),i=Object(c.useState)(!1),o=Object(b.a)(i,2),l=o[0],u=o[1],d=Object(c.useState)(""),j=Object(b.a)(d,2),m=j[0],h=j[1],O=Object(f.useQuery)(Sn,{variables:{path:t,query:m,limit:10,after:a,before:r}}),g=O.data,x=O.previousData,y=O.refetch;Object(c.useEffect)((function(){h("")}),[t]);var v=(g||x||{items:{pageInfo:{}}}).items,k=(v||{edges:[]}).edges,w=k?k.map((function(e){return e.node})):[];return Object(ee.jsxs)($e,{title:"Items",children:[Object(ee.jsx)(Me.a,{children:Object(ee.jsxs)(yt.a,{container:!0,spacing:3,children:[Object(ee.jsx)(yt.a,{xs:12,md:5,item:!0,children:v&&Object(ee.jsx)(Ht,{items:w,path:t,query:m,onChangeQuery:function(e){h(e.target.value)},after:a,before:r,onRefresh:function(e){y()},startCursor:v&&v.pageInfo.startCursor,endCursor:v&&v.pageInfo.endCursor,showPrevious:v&&v.pageInfo.hasPreviousPage,showNext:v&&v.pageInfo.hasNextPage})}),Object(ee.jsx)(yt.a,{xs:12,md:7,item:!0,children:n&&Object(ee.jsx)(wn,{path:n,onDeleted:function(){s.push("/mapping/items?path=".concat(t)),y()}})})]})}),Object(ee.jsx)($t,{open:l,path:t,title:"New item in ".concat(t),onClose:function(){u(!1),y()}}),Object(ee.jsx)(xt.a,{color:"secondary",onClick:function(){return u(!0)},style:{position:"fixed",bottom:"24px",right:"24px"},children:Object(ee.jsx)(kt.a,{})})]})},In=Object(f.gql)(st||(st=Object(m.a)(["\n query GetItem($path: String!) {\n item(path: $path) {\n id\n path\n key\n title\n description\n }\n }\n"]))),Mn=Object(f.gql)(it||(it=Object(m.a)(["\n\tmutation AddItem($path: String!, $key: String!, $title: String!, $description: String, $folder: Boolean!) {\n\t\tcreateItem(path: $path, key: $key, title: $title, description: $description, folder: $folder) {\n\t \t\tid\n\t\t}\n \t}\n"]))),Nn=Object(j.a)((function(e){return{paper:{padding:e.spacing(4),minHeight:"320px",alignItems:"center",justifyContent:"center",textAlign:"center"},header:{marginBottom:e.spacing(4)},footer:{marginTop:e.spacing(2),textAlign:"right"}}})),Dn=function(e){var t=e.request,n=e.onSubmit,r=e.onCancel,s=e.onChange,i=Nn();return Object(ee.jsxs)(Ce.a,{className:i.paper,children:[Object(ee.jsx)(fe.a,{variant:"h6",className:i.header,children:"This item does not exists - create it?"}),Object(ee.jsx)(wt.a,{variant:"outlined",margin:"normal",label:"Path",value:t.path,onChange:function(e){return s(Object(a.a)(Object(a.a)({},t),{},{path:e.target.value}))},fullWidth:!0,disabled:!0}),Object(ee.jsx)(wt.a,{variant:"outlined",margin:"normal",label:"Key",value:t.key,onChange:function(e){return s(Object(a.a)(Object(a.a)({},t),{},{key:e.target.value}))},fullWidth:!0,disabled:!0}),Object(ee.jsx)(wt.a,{variant:"outlined",margin:"normal",label:"Title",value:t.title,onChange:function(e){return s(Object(a.a)(Object(a.a)({},t),{},{title:e.target.value}))},fullWidth:!0}),Object(ee.jsx)(wt.a,{variant:"outlined",margin:"normal",label:"Description",value:t.description,onChange:function(e){return s(Object(a.a)(Object(a.a)({},t),{},{description:e.target.value}))},rows:4,multiline:!0,fullWidth:!0}),Object(ee.jsxs)("div",{className:i.footer,children:[Object(ee.jsx)(Se.a,{variant:"contained",onClick:r,children:"Cancel"}),Object(ee.jsx)(Se.a,{variant:"contained",color:"primary",onClick:n,children:"Create"})]})]})},En=function(){var e=Ve(),t=e.path,n=e.key,a=e.title,r=e.description,o=Object(p.g)(),l=function(e){var t=(e||"").trim();return"/"!=t[0]&&(t="/"+t),"/"!=t[t.length-1]&&(t+="/"),t}(t),u=Object(f.useQuery)(In,{variables:{path:l+n}}),d=u.loading,j=u.data,m=Object(f.useMutation)(Mn),h=Object(b.a)(m,1)[0],O=Object(c.useState)({path:l,key:n,title:a,description:r,folder:!1}),g=Object(b.a)(O,2),x=g[0],y=g[1],v=function(){var e=Object(i.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h({variables:x});case 2:o.push("/mapping/items?path=".concat(l,"¤t=").concat(l+n));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return d?Object(ee.jsx)($e,{title:"Mapping",busy:!0}):Object(ee.jsxs)($e,{title:"Mapping",children:[j.item&&Object(ee.jsx)(p.a,{to:"/mapping/items?path=".concat(l,"¤t=").concat(l+n)}),!j.item&&Object(ee.jsx)(Me.a,{maxWidth:"sm",children:x&&Object(ee.jsx)(Dn,{request:x,onCancel:function(){return o.goBack()},onChange:function(e){return y(e)},onSubmit:v})})]})};var Rn,$n,Pn,Tn,An,Gn,Ln=function(){return Object(ee.jsxs)(p.d,{children:[Object(ee.jsx)(p.b,{path:"/mapping/lookup",component:En}),Object(ee.jsx)(p.b,{path:"/mapping/items",component:Cn}),Object(ee.jsx)(p.b,{path:"/mapping",component:gt})]})},qn=n(133),Fn=n.n(qn),Un=n(542),_n=n(556),Bn=n(293),Vn=n.n(Bn),Qn=n(292),zn=n.n(Qn),Wn=n(210),Hn=n.n(Wn),Yn=n(211),Jn=n.n(Yn),Xn=Object(j.a)((function(e){return{root:{display:"flex",alignItems:"center"},icon:{marginRight:e.spacing(1)}}})),Kn=function(e){var t=e.type,n=Object(Oe.a)();switch(t){case"ERROR":return Object(ee.jsx)(D.a,{style:{color:n.palette.status.danger}});case"WARNING":return Object(ee.jsx)(Hn.a,{style:{color:n.palette.status.warning}});case"INFO":return Object(ee.jsx)(Jn.a,{style:{color:n.palette.status.info}})}},Zn=function(e){var t=e.type,n=Xn();return t?Object(ee.jsxs)("div",{className:n.root,children:[Object(ee.jsx)("div",{className:n.icon,children:Object(ee.jsx)(Kn,{type:t})}),t]}):null},ea=n(288),ta=n.n(ea),na=n(290),aa=n.n(na),ra=n(291),sa=n.n(ra),ia=n(289),ca=n.n(ia),oa=Object(j.a)((function(e){return{root:{display:"flex",alignItems:"center"},icon:{fontSize:0,marginRight:e.spacing(1)},error:{color:e.palette.status.danger}}})),la=function(e){var t=e.status,n=Object(Oe.a)();switch(t){case"NEW":return Object(ee.jsx)(ta.a,{style:{color:n.palette.status.info}});case"DISMISSED":return Object(ee.jsx)(ca.a,{style:{color:n.palette.status.danger}});case"RESOLVED":return Object(ee.jsx)(aa.a,{style:{color:n.palette.status.success}});case"IGNORED":return Object(ee.jsx)(sa.a,{})}},ua=function(e){var t=e.status,n=oa();return t?Object(ee.jsxs)("div",{className:n.root,children:[Object(ee.jsx)("div",{className:n.icon,children:Object(ee.jsx)(la,{status:t})}),t]}):null},pa=function(){var e=Object(p.h)(),t=new URLSearchParams(e.search);return Array.from(t.keys()).reduce((function(e,n){return e[n]=t.get(n),e}),{})},da=Object(f.gql)(Rn||(Rn=Object(m.a)(["\n query GetAlerts($status : AlertStatus, $limit: Int!, $after : String, $before : String ) {\n alerts(status : $status, limit: $limit, after: $after, before: $before) {\n totalCount\n edges {\n node {\n id\n group\n title\n instanceCount\n status\n type\n created\n lastSeen\n }\n }\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n }\n }\n"]))),ja=Object(f.gql)($n||($n=Object(m.a)(["\n query GetAlert($id: ID!, $after: String, $before: String) {\n alert(id : $id) {\n id\n title\n instanceCount\n status\n type\n created\n lastSeen\n instances(limit: 1, after: $after, before: $before) {\n edges {\n node {\n id\n message\n details\n created\n }\n },\n pageInfo \n {\n endCursor\n startCursor\n hasNextPage\n hasPreviousPage\n }\n \n }\n }\n }\n"]))),ba=Object(f.gql)(Pn||(Pn=Object(m.a)(["\n mutation ResolveAlert($id: ID!) {\n resolveAlert(id : $id) {\n id\n }\n }\n"]))),ma=Object(f.gql)(Tn||(Tn=Object(m.a)(["\n mutation ReopenAlert($id: ID!) {\n reopenAlert(id : $id) {\n id\n }\n }\n"]))),ha=Object(f.gql)(An||(An=Object(m.a)(["\n mutation DismissAlert($id: ID!, $time: Int) {\n dismissAlert(id : $id, time: $time) {\n id\n }\n }\n"]))),Oa=Object(f.gql)(Gn||(Gn=Object(m.a)(["\n mutation IgnoreAlert($id: ID!) {\n ignoreAlert(id : $id) {\n id\n }\n }\n"]))),fa=function(e){return Object.keys(e).filter((function(t){return e[t]})).map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))})).join("&")},ga=function(){var e=Object(Oe.a)(),t=Object(p.g)(),n=pa(),r=n.limit,l=void 0===r?10:r,u=n.status,d=void 0===u?"NEW":u,j=n.after,m=n.before,h={status:d,limit:l,after:j,before:m},O=o.a.useState(null),S=Object(b.a)(O,2),C=S[0],I=S[1],M=o.a.useState(null),N=Object(b.a)(M,2),D=N[0],E=N[1],R=Object(f.useMutation)(ba,{refetchQueries:[{query:da,variables:h}]}),$=Object(b.a)(R,1)[0],T=Object(f.useMutation)(ma,{refetchQueries:[{query:da,variables:h}]}),A=Object(b.a)(T,1)[0],G=Object(f.useMutation)(ha,{refetchQueries:[{query:da,variables:h}]}),L=Object(b.a)(G,1)[0],q=Object(f.useMutation)(Oa,{refetchQueries:[{query:da,variables:h}]}),F=Object(b.a)(q,1)[0],U=Object(f.useQuery)(da,{variables:h}),_=U.loading,B=U.data,V=U.refetch,Q=nn(),z=Q.selection,W=Q.toggle,H=Q.clear,Y=(B&&B.alerts.totalCount,B?B.alerts.edges.map((function(e){return e.node})):[]),J=!!B&&B.alerts.pageInfo.hasPreviousPage,X=!!B&&B.alerts.pageInfo.hasNextPage;Object(c.useEffect)((function(){V()}),[d,l,j,m]);var K=function(e){var r="alerts?".concat(fa(Object(a.a)(Object(a.a)({},n),{},{before:null,after:null,status:e})));t.push(r),E(null)},Z=function(){var e=Object(i.a)(s.a.mark((function e(t,n){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:E(null),I(null),e.t0=t,e.next="RESOLVE"===e.t0?5:"REOPEN"===e.t0?8:"DISMISS"===e.t0?11:"IGNORE"===e.t0?14:17;break;case 5:return e.next=7,Promise.all(z.map((function(e){return $({variables:{id:e}})})));case 7:return e.abrupt("break",17);case 8:return e.next=10,Promise.all(z.map((function(e){return A({variables:{id:e}})})));case 10:return e.abrupt("break",17);case 11:return e.next=13,Promise.all(z.map((function(e){return L({variables:{id:e,time:n}})})));case 13:return e.abrupt("break",17);case 14:return e.next=16,Promise.all(z.map((function(e){return F({variables:{id:e}})})));case 16:return e.abrupt("break",17);case 17:H();case 18:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),te=B&&B.alerts.pageInfo.endCursor,ne=B&&B.alerts.pageInfo.startCursor,ae="alerts?".concat(fa(Object(a.a)(Object(a.a)({},n),{},{before:null,after:te}))),re="alerts?".concat(fa(Object(a.a)(Object(a.a)({},n),{},{before:ne,after:null})));return Object(ee.jsxs)($e,{title:"Alerts",busy:_,children:[Object(ee.jsx)(Me.a,{children:Object(ee.jsxs)(Ce.a,{style:{position:"relative"},children:[z.length>0&&Object(ee.jsx)(x.a,{position:"absolute",color:"secondary",elevation:0,children:Object(ee.jsxs)(y.a,{children:[Object(ee.jsx)(fe.a,{style:{flexGrow:1},variant:"body2",children:"".concat(z.length," item(s) selected")}),Object(ee.jsx)(v.a,{color:"inherit",onClick:function(e){I(e.currentTarget)},children:Object(ee.jsx)(zn.a,{})}),Object(ee.jsx)(v.a,{color:"inherit",children:Object(ee.jsx)(Zt.a,{})})]})}),Object(ee.jsxs)(y.a,{children:[Object(ee.jsx)(fe.a,{variant:"h6",style:{marginRight:e.spacing(2)},children:"Alerts"}),Object(ee.jsx)("div",{style:{flexGrow:1},children:"NEW"!==d&&Object(ee.jsx)(_n.a,{label:d,onDelete:function(){return K("NEW")}})}),Object(ee.jsx)(v.a,{color:"inherit",onClick:function(e){E(e.currentTarget)},children:Object(ee.jsx)(Vn.a,{})})]}),Object(ee.jsx)(Fe.a,{children:Object(ee.jsxs)(Ue.a,{size:"small",children:[Object(ee.jsx)(Un.a,{children:Object(ee.jsxs)(_e.a,{children:[Object(ee.jsx)(Be.a,{as:"th",padding:"checkbox"}),Object(ee.jsx)(Be.a,{as:"th",children:"Group"}),Object(ee.jsx)(Be.a,{as:"th",children:"Title"}),Object(ee.jsx)(Be.a,{as:"th",children:"Instances"}),Object(ee.jsx)(Be.a,{as:"th",children:"Status"}),Object(ee.jsx)(Be.a,{as:"th",children:"Type"}),Object(ee.jsx)(Be.a,{as:"th",children:"Last Seen"})]})}),Y.map((function(e){return Object(ee.jsxs)(_e.a,{hover:!0,children:[Object(ee.jsx)(Be.a,{padding:"checkbox",children:Object(ee.jsx)(Yt.a,{checked:z.indexOf(e.id)>=0,onChange:function(){return W(e.id)}})}),Object(ee.jsx)(Be.a,{children:e.group||"(None)"}),Object(ee.jsx)(Be.a,{children:Object(ee.jsx)(At.a,{component:g.b,to:"/alerts/".concat(e.id),children:e.title})}),Object(ee.jsx)(Be.a,{children:e.instanceCount}),Object(ee.jsx)(Be.a,{children:Object(ee.jsx)(ua,{status:e.status})}),Object(ee.jsx)(Be.a,{children:Object(ee.jsx)(Zn,{type:e.type})}),Object(ee.jsx)(Be.a,{style:{whiteSpace:"nowrap"},children:Fn()(e.lastSeen).format("DD MMM. YYYY, HH:mm")})]},e.id)}))]})}),Object(ee.jsxs)(y.a,{children:[Object(ee.jsx)("div",{style:{flexGrow:1}}),Object(ee.jsx)(v.a,{disabled:!J,component:g.b,to:re,children:Object(ee.jsx)(bn.a,{})}),Object(ee.jsx)(v.a,{disabled:!X,component:g.b,to:ae,children:Object(ee.jsx)(dn.a,{})})]})]})}),Object(ee.jsxs)(k.a,{anchorEl:C,keepMounted:!0,open:Boolean(C),onClose:function(){I(null)},children:[Object(ee.jsx)(w.a,{onClick:function(){return Z("REOPEN")},children:"Reopen"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("RESOLVE")},children:"Resolve"}),Object(ee.jsx)(P.a,{}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",0)},children:"Dismiss"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",3600)},children:"Dismiss for 1 hour"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",21600)},children:"Dismiss for 6 hours"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",86400)},children:"Dismiss for 1 day"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",172800)},children:"Dismiss for 2 day"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",259200)},children:"Dismiss for 3 day"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",345600)},children:"Dismiss for 4 day"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",432e3)},children:"Dismiss for 5 day"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",518400)},children:"Dismiss for 6 day"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",604800)},children:"Dismiss for 1 week"}),Object(ee.jsx)(w.a,{onClick:function(){return Z("DISMISS",2592e3)},children:"Dismiss for 30 days"}),Object(ee.jsx)(P.a,{}),Object(ee.jsx)(w.a,{onClick:function(){return Z("IGNORE")},children:"Ignore permanently"})]}),Object(ee.jsxs)(k.a,{anchorEl:D,keepMounted:!0,open:Boolean(D),onClose:function(){E(null)},children:[Object(ee.jsx)(w.a,{onClick:function(){return K("NEW")},children:"New"}),Object(ee.jsx)(w.a,{onClick:function(){return K("DISMISSED")},children:"Dismissed"}),Object(ee.jsx)(w.a,{onClick:function(){return K("RESOLVED")},children:"Resolved"}),Object(ee.jsx)(w.a,{onClick:function(){return K("IGNORED")},children:"Ignored"})]})]})},xa=n(216),ya=n.n(xa),va=function(e){var t=e.title,n=Object(p.g)();return Object(ee.jsxs)(ee.Fragment,{children:[Object(ee.jsx)(v.a,{edge:"start",onClick:function(){return n.goBack()},color:"inherit",children:Object(ee.jsx)(ve.a,{})}),t]})},ka=function(){var e=Object(p.i)().id,t=(Object(p.g)(),Object(c.useState)(null)),n=Object(b.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(null),i=Object(b.a)(s,2),o=i[0],l=i[1],u=Object(f.useQuery)(ja,{variables:{id:e,after:a,before:o}}),d=u.loading,j=u.data,m=j&&j.alert.instances.edges.length>0&&j.alert.instances.edges[0].node,h=m?JSON.parse(m.details):null,O=h?JSON.stringify(h):null,x=j&&j.alert.instances.pageInfo,k=x&&x.hasNextPage,w=x&&x.hasPreviousPage,S=function(e){if("MAP"==e.type){var t=e.parameters,n=t.path,a=t.key,r=t.title,s=t.description;return"/mapping/lookup?path=".concat(encodeURIComponent(n),"&key=").concat(encodeURIComponent(a),"&title=").concat(encodeURIComponent(r),"&description=").concat(encodeURIComponent(s||""))}return"LINK"==e.type?e.parameters.url:null};return j?Object(ee.jsx)($e,{title:Object(ee.jsx)(va,{title:"View alert"}),busy:d,children:Object(ee.jsx)(Me.a,{children:Object(ee.jsxs)(yt.a,{container:!0,spacing:2,children:[Object(ee.jsxs)(yt.a,{item:!0,xs:8,children:[Object(ee.jsx)(Ce.a,{style:{position:"relative",marginBottom:"12px"},children:Object(ee.jsx)(Ie.a,{p:2,children:Object(ee.jsx)(y.a,{children:Object(ee.jsx)(fe.a,{variant:"h6",style:{flexGrow:1},children:j.alert.title})})})}),Object(ee.jsxs)(Ce.a,{style:{position:"relative"},children:[Object(ee.jsxs)(y.a,{children:[Object(ee.jsxs)(fe.a,{variant:"h6",style:{flexGrow:1},children:["Instance #",m&&m.id]}),Object(ee.jsx)(fe.a,{variant:"body2",color:"textSecondary",children:m&&Fn()(m.created).format("DD MMM. YYYY, HH:mm")}),Object(ee.jsx)(v.a,{disabled:!w,onClick:function(){r(null),l(x.startCursor)},children:Object(ee.jsx)(bn.a,{})}),Object(ee.jsx)(v.a,{disabled:!k,onClick:function(){l(null),r(x.endCursor)},children:Object(ee.jsx)(dn.a,{})})]}),Object(ee.jsxs)(Ie.a,{p:2,children:[Object(ee.jsx)(fe.a,{variant:"subtitle1",children:"Message"}),Object(ee.jsx)("pre",{style:{background:ya.a[200],padding:"12px",whiteSpace:"pre-wrap",wordWrap:"break-word"},children:m?m.message:"No message available"}),Object(ee.jsx)(fe.a,{variant:"subtitle1",children:"Details"}),Object(ee.jsx)("pre",{style:{background:ya.a[200],padding:"12px",whiteSpace:"pre-wrap",wordWrap:"break-word"},children:O||"No details available"})]})]})]}),Object(ee.jsxs)(yt.a,{item:!0,xs:3,children:[Object(ee.jsxs)(Ie.a,{pb:2,children:[Object(ee.jsx)(fe.a,{variant:"subtitle1",color:"textSecondary",children:"Instance count"}),Object(ee.jsx)(fe.a,{variant:"h2",children:j.alert.instanceCount})]}),Object(ee.jsx)(P.a,{}),Object(ee.jsxs)(Ie.a,{py:2,children:[Object(ee.jsx)(fe.a,{variant:"subtitle1",color:"textSecondary",children:"Oldest"}),Object(ee.jsx)(fe.a,{variant:"body1",children:Fn()(j.alert.created).format("DD MMM. YYYY, HH:mm")}),Object(ee.jsx)(fe.a,{variant:"subtitle1",color:"textSecondary",children:"Latest"}),Object(ee.jsx)(fe.a,{variant:"body1",children:Fn()(j.alert.lastSeen).format("DD MMM. YYYY, HH:mm")})]}),h&&h.actions&&Object(ee.jsxs)(ee.Fragment,{children:[Object(ee.jsx)(P.a,{}),Object(ee.jsxs)(Ie.a,{py:2,children:[Object(ee.jsx)(fe.a,{variant:"subtitle1",color:"textSecondary",children:"Instance actions"}),Object(ee.jsx)($.a,{children:h.actions.map((function(e){return Object(ee.jsx)(T.a,{component:g.b,to:S(e),button:!0,children:e.name})}))})]})]})]})]})})}):Object(ee.jsx)($e,{title:Object(ee.jsx)(va,{title:"View alert"}),busy:d})};var wa=function(){return Object(ee.jsxs)(p.d,{children:[Object(ee.jsx)(p.b,{path:"/alerts/:id",component:ka}),Object(ee.jsx)(p.b,{path:"/alerts",component:ga})]})},Sa=n(360),Ca=function(){var e=Object(c.useState)(!1),t=Object(b.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(null),o=Object(b.a)(r,2),l=o[0],u=o[1],d=Object(p.g)(),j=Object(c.useCallback)(function(){var e=Object(i.a)(s.a.mark((function e(t){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.payload.event,e.next="signIn"===e.t0?3:"signUp"===e.t0?9:"signOut"===e.t0?10:"signIn_failure"===e.t0?12:(e.t0,13);break;case 3:return e.next=5,E.a.currentAuthenticatedUser();case 5:return n=e.sent,u(!!n),d.push("/"),e.abrupt("break",13);case 9:return e.abrupt("break",13);case 10:return u(null),e.abrupt("break",13);case 12:return e.abrupt("break",13);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[d]);return Object(c.useEffect)(Object(i.a)(s.a.mark((function e(){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,E.a.currentAuthenticatedUser();case 3:t=e.sent,u(!!t),a(!0),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),u(null),a(!0);case 12:return Sa.a.listen("auth",j),e.abrupt("return",(function(){Sa.a.remove("auth",j)}));case 14:case"end":return e.stop()}}),e,null,[[0,8]])}))),[]),Object(c.useMemo)((function(){return{ready:n,isAuthenticated:!!l,user:l}}),[n,l])},Ia=n(300),Ma=n(543),Na=Object(Ia.a)({palette:{status:{danger:"#ff4444",dangerDark:"#fCC0000",warning:"#ffbb33",warningDark:"#FF8800",success:"#00C851",successDark:"#007E33",info:"#33b5e5",infoDark:"#0099CC"}}});var Da=function(){return Ca().ready?Object(ee.jsxs)(d.a,{children:[Object(ee.jsx)(d.b,{slot:"sign-in",usernameAlias:"email",formFields:[{type:"email",placeholder:"e-mail address",required:!0},{type:"password",placeholder:"password",required:!0}],hideSignUp:!0}),Object(ee.jsxs)(Ma.a,{theme:Na,children:[Object(ee.jsxs)(p.d,{children:[Object(ee.jsx)(p.b,{path:"/import",component:ut}),Object(ee.jsx)(p.b,{path:["/sam/*","/sam"],component:Ot}),Object(ee.jsx)(p.b,{path:["/season/*","/season"],component:jt}),Object(ee.jsx)(p.b,{path:["/sportsbet/*","/sportsbet"],component:mt}),Object(ee.jsx)(p.b,{path:"/mapping",component:Ln}),Object(ee.jsx)(p.b,{path:"/logs",component:ct}),Object(ee.jsx)(p.b,{path:"/alerts",component:wa}),Object(ee.jsx)(p.b,{path:"/",component:Te})]}),Object(ee.jsx)(Ne,{})]})]}):null},Ea=function(e){e&&e instanceof Function&&n.e(36).then(n.bind(null,575)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,s=t.getLCP,i=t.getTTFB;n(e),a(e),r(e),s(e),i(e)}))},Ra=n(79),$a=n(544),Pa=n(104),Ta=n(294),Aa=Object(Pa.c)({ui:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:H,t=arguments.length>1?arguments[1]:void 0;switch(t.error,t.type){case _:return Object(a.a)(Object(a.a)({},e),{},{showMenu:!0});case B:return Object(a.a)(Object(a.a)({},e),{},{showMenu:!e.showMenu});case V:return Object(a.a)(Object(a.a)({},e),{},{showMenu:!1});case Q:return Object(a.a)(Object(a.a)({},e),{},{errors:[].concat(Object(F.a)(e.errors),[t.error])});case z:return Object(a.a)(Object(a.a)({},e),{},{errors:e.errors.slice(0,e.errors.length-1)});default:return e}}}),Ga=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||Pa.d,La=Object(Pa.e)(Aa,Ga(Object(Pa.a)(Ta.a))),qa=n(295),Fa=n(296);Ra.default.configure({aws_project_region:"eu-west-1",aws_cognito_region:"eu-west-1",aws_user_pools_id:"eu-west-1_ibiNR8TIf",aws_user_pools_web_client_id:"1ao1a09and5ccfdum3jal10o3t",Auth:{region:"eu-west-1",identityPoolId:"eu-west-1:b3882853-0f5a-49df-9552-0a61246c18b5",userPoolId:"eu-west-1_ibiNR8TIf",userPoolName:"management-console-userpool-prod",userPoolWebClientId:"1ao1a09and5ccfdum3jal10o3t",mandatorySignIn:!0},API:{endpoints:[{name:"mapping",endpoint:"https://api.swush.com/mapping",custom_header:function(){var e=Object(i.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0="Bearer ",e.next=3,E.a.currentSession();case 3:return e.t1=e.sent.getAccessToken().getJwtToken(),e.t2=e.t0.concat.call(e.t0,e.t1),e.abrupt("return",{Authorization:e.t2});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]}});var Ua=Object(qa.a)((function(e){var t=e.graphQLErrors,n=e.networkError;t&&t.forEach((function(e){var t=e.message,n=e.locations,a=e.extensions,r=e.path;a&&"INTERNAL_SERVER_ERROR"===a.code&&(a.exception&&"ECONNREFUSED"==a.exception.code?La.dispatch(W("The server refused the connection.")):La.dispatch(W("An error occurred while contacting the server."))),console.log("[GraphQL error]: Message: ".concat(t,", Location: ").concat(n,", Path: ").concat(r))})),n&&La.dispatch(W("A network error occurred."))})),_a=Object(f.createHttpLink)({uri:"https://console.swushapis.com/graphql"}),Ba=Object(Fa.a)(function(){var e=Object(i.a)(s.a.mark((function e(t,n){var r,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.headers,e.next=3,E.a.currentSession();case 3:return i=e.sent.getAccessToken().getJwtToken(),e.abrupt("return",{headers:Object(a.a)(Object(a.a)({},r),{},{authorization:i?"Bearer ".concat(i):""})});case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),Va=Object(f.from)([Ua,Ba,_a]),Qa=new f.ApolloClient({link:Va,cache:new f.InMemoryCache});u.a.render(Object(ee.jsxs)(ee.Fragment,{children:[Object(ee.jsx)($a.a,{}),Object(ee.jsx)(f.ApolloProvider,{client:Qa,children:Object(ee.jsx)(q.a,{store:La,children:Object(ee.jsx)(g.a,{children:Object(ee.jsx)(Da,{})})})})]}),document.getElementById("root")),Ea()}},[[403,3,4]]]); //# sourceMappingURL=main.debfc703.chunk.js.map