From ee2f55fd07dabb8e13f4d2329ceb6dfde5e0a9a6 Mon Sep 17 00:00:00 2001 From: metrico Date: Tue, 31 Oct 2023 17:15:37 +0000 Subject: [PATCH] Upgrade view to v0.25.6 --- view/asset-manifest.json | 10 +++++----- view/index.html | 2 +- .../js/{14.934f9e37.chunk.js => 14.714ace2e.chunk.js} | 2 +- .../{368.6610f292.chunk.js => 368.a12caf5e.chunk.js} | 2 +- .../{380.ce6a5eca.chunk.js => 380.e5bef301.chunk.js} | 2 +- view/static/js/{main.b5a8989c.js => main.0ee7f0a7.js} | 4 ++-- ...89c.js.LICENSE.txt => main.0ee7f0a7.js.LICENSE.txt} | 0 7 files changed, 11 insertions(+), 11 deletions(-) rename view/static/js/{14.934f9e37.chunk.js => 14.714ace2e.chunk.js} (99%) rename view/static/js/{368.6610f292.chunk.js => 368.a12caf5e.chunk.js} (99%) rename view/static/js/{380.ce6a5eca.chunk.js => 380.e5bef301.chunk.js} (98%) rename view/static/js/{main.b5a8989c.js => main.0ee7f0a7.js} (99%) rename view/static/js/{main.b5a8989c.js.LICENSE.txt => main.0ee7f0a7.js.LICENSE.txt} (100%) diff --git a/view/asset-manifest.json b/view/asset-manifest.json index 5da7f341..a36be80e 100644 --- a/view/asset-manifest.json +++ b/view/asset-manifest.json @@ -1,11 +1,11 @@ { "files": { "main.css": "/static/css/main.91f5a756.css", - "main.js": "/static/js/main.b5a8989c.js", - "static/js/14.934f9e37.chunk.js": "/static/js/14.934f9e37.chunk.js", - "static/js/368.6610f292.chunk.js": "/static/js/368.6610f292.chunk.js", + "main.js": "/static/js/main.0ee7f0a7.js", + "static/js/14.714ace2e.chunk.js": "/static/js/14.714ace2e.chunk.js", + "static/js/368.a12caf5e.chunk.js": "/static/js/368.a12caf5e.chunk.js", "static/css/380.87716002.chunk.css": "/static/css/380.87716002.chunk.css", - "static/js/380.ce6a5eca.chunk.js": "/static/js/380.ce6a5eca.chunk.js", + "static/js/380.e5bef301.chunk.js": "/static/js/380.e5bef301.chunk.js", "static/js/886.192408f9.chunk.js": "/static/js/886.192408f9.chunk.js", "static/js/261.2d8f2bda.chunk.js": "/static/js/261.2d8f2bda.chunk.js", "static/js/966.0d040013.chunk.js": "/static/js/966.0d040013.chunk.js", @@ -21,6 +21,6 @@ }, "entrypoints": [ "static/css/main.91f5a756.css", - "static/js/main.b5a8989c.js" + "static/js/main.0ee7f0a7.js" ] } \ No newline at end of file diff --git a/view/index.html b/view/index.html index a38def2e..44755854 100644 --- a/view/index.html +++ b/view/index.html @@ -1 +1 @@ -Qryn-View
\ No newline at end of file +Qryn-View
\ No newline at end of file diff --git a/view/static/js/14.934f9e37.chunk.js b/view/static/js/14.714ace2e.chunk.js similarity index 99% rename from view/static/js/14.934f9e37.chunk.js rename to view/static/js/14.714ace2e.chunk.js index 5d127310..44a468da 100644 --- a/view/static/js/14.934f9e37.chunk.js +++ b/view/static/js/14.714ace2e.chunk.js @@ -1 +1 @@ -"use strict";(self.webpackChunkqryn_view=self.webpackChunkqryn_view||[]).push([[14],{25687:function(e,t,n){n.r(t),n.d(t,{MainAppStyles:function(){return ae},default:function(){return le}});var r=n(30168),i=n(31238),o=n(62975),a=n(47313),l=n(58467),c=n(99811),s=n(29439),d=n(87462),u=n(63366),h=n(83061),v=n(20564),p=n(63649),m=n(39028),x=n(86728),f=n(46417),g=["className","component"];var b=n(41271),Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=e.defaultClassName,r=void 0===n?"MuiBox-root":n,i=e.generateClassName,o=(0,v.ZP)("div",{shouldForwardProp:function(e){return"theme"!==e&&"sx"!==e&&"as"!==e}})(p.Z);return a.forwardRef((function(e,n){var a=(0,x.Z)(t),l=(0,m.Z)(e),c=l.className,s=l.component,v=void 0===s?"div":s,p=(0,u.Z)(l,g);return(0,f.jsx)(o,(0,d.Z)({as:v,ref:n,className:(0,h.Z)(c,i?i(r):r),theme:a},p))}))}({defaultTheme:(0,n(68658).Z)(),defaultClassName:"MuiBox-root",generateClassName:b.Z.generate}),w=Z,j=n(24064),C=n(95765),S=n(21921),N=n(17551),z=n(88564),y=n(29394),A=n(99273),k=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],H=(0,z.ZP)("div",{name:"MuiDivider",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})((function(e){var t=e.theme,n=e.ownerState;return(0,d.Z)({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},n.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},n.light&&{borderColor:t.vars?"rgba(".concat(t.vars.palette.dividerChannel," / 0.08)"):(0,N.Fq)(t.palette.divider,.08)},"inset"===n.variant&&{marginLeft:72},"middle"===n.variant&&"horizontal"===n.orientation&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},"middle"===n.variant&&"vertical"===n.orientation&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},"vertical"===n.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},n.flexItem&&{alignSelf:"stretch",height:"auto"})}),(function(e){var t=e.theme,n=e.ownerState;return(0,d.Z)({},n.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{position:"relative",width:"100%",borderTop:"thin solid ".concat((t.vars||t).palette.divider),top:"50%",content:'""',transform:"translateY(50%)"}})}),(function(e){var t=e.theme,n=e.ownerState;return(0,d.Z)({},n.children&&"vertical"===n.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",top:"0%",left:"50%",borderTop:0,borderLeft:"thin solid ".concat((t.vars||t).palette.divider),transform:"translateX(0%)"}})}),(function(e){var t=e.ownerState;return(0,d.Z)({},"right"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})})),V=(0,z.ZP)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:function(e,t){var n=e.ownerState;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})((function(e){var t=e.theme,n=e.ownerState;return(0,d.Z)({display:"inline-block",paddingLeft:"calc(".concat(t.spacing(1)," * 1.2)"),paddingRight:"calc(".concat(t.spacing(1)," * 1.2)")},"vertical"===n.orientation&&{paddingTop:"calc(".concat(t.spacing(1)," * 1.2)"),paddingBottom:"calc(".concat(t.spacing(1)," * 1.2)")})})),B=a.forwardRef((function(e,t){var n=(0,y.Z)({props:e,name:"MuiDivider"}),r=n.absolute,i=void 0!==r&&r,o=n.children,a=n.className,l=n.component,c=void 0===l?o?"div":"hr":l,s=n.flexItem,v=void 0!==s&&s,p=n.light,m=void 0!==p&&p,x=n.orientation,g=void 0===x?"horizontal":x,b=n.role,Z=void 0===b?"hr"!==c?"separator":void 0:b,w=n.textAlign,j=void 0===w?"center":w,C=n.variant,N=void 0===C?"fullWidth":C,z=(0,u.Z)(n,k),B=(0,d.Z)({},n,{absolute:i,component:c,flexItem:v,light:m,orientation:g,role:Z,textAlign:j,variant:N}),M=function(e){var t=e.absolute,n=e.children,r=e.classes,i=e.flexItem,o=e.light,a=e.orientation,l=e.textAlign,c={root:["root",t&&"absolute",e.variant,o&&"light","vertical"===a&&"vertical",i&&"flexItem",n&&"withChildren",n&&"vertical"===a&&"withChildrenVertical","right"===l&&"vertical"!==a&&"textAlignRight","left"===l&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]};return(0,S.Z)(c,A.V,r)}(B);return(0,f.jsx)(H,(0,d.Z)({as:c,className:(0,h.Z)(M.root,a),role:Z,ref:t,ownerState:B},z,{children:o?(0,f.jsx)(V,{className:M.wrapper,ownerState:B,children:o}):null}))})),M=n(47131),P=n(78899),R=n(38167),T=n(57585),I=n(88435),L=n(56352),U=n(79861),D=n(2135),F=n(76854),E=n(13002),W=n(52586),O=n(87975),q=n(8454),Y=n(30735),_=n(62424);function G(e){var t=e.c,n=(0,L.I0)(),r=(0,q.Z)(),i="Link Copied To Clipboard";return(0,f.jsxs)(C.Z,{onClick:function(){n((0,O.E9)(!0)),setTimeout((function(){var e,t,o;if(null===(e=navigator)||void 0===e||!e.clipboard||!window.isSecureContext){var a=document.createElement("textarea");return a.value=window.location.href,a.style.position="fixed",a.style.left="-999999px",a.style.top="-999999px",document.body.appendChild(a),a.focus(),a.select(),new Promise((function(e,t){var o=r.add({data:window.location.href,description:"From Shared URL"},10);n((0,Y.Z)(o)),document.execCommand("copy")?e():t(),a.remove(),n((0,O.el)({type:_.m.success,message:i}))}))}null===(t=navigator)||void 0===t||null===(o=t.clipboard)||void 0===o||o.writeText(window.location.href).then((function(){var e=r.add({data:window.location.href,description:"From Shared URL"},10);n((0,Y.Z)(e)),n((0,O.el)({type:_.m.success,message:i}))}),(function(e){console.log("error on copy",e)}))}),200)},disabled:!1,style:{fontSize:"12px"},children:[" ",(0,f.jsx)(W.Z,{fontSize:"small",className:t}),(0,f.jsx)("span",{children:"Copy Link"})]})}var Q,X=n(29826),J=(n(41801).Z.button(Q||(Q=(0,r.Z)(["\n border: none;\n background: ",";\n border: 1px solid ",";\n color: ",";\n padding: 3px 12px;\n border-radius: 3px;\n font-size: 12px;\n cursor: pointer;\n user-select: none;\n line-height: 20px;\n display: flex;\n align-items: center;\n margin-left: 10px;\n height: 26px;\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor})),function(e){return{color:"".concat(e.textColor),overflow:"visible",fontSize:"12px",background:"".concat(e.widgetContainer),border:"1px solid ".concat(e.buttonBorder),mt:1.5,"& .MuiAvatar-root":{width:32,height:32,ml:-.5,mr:1},"&:before":{content:'""',display:"block",position:"absolute",top:0,right:14,width:10,height:10,borderLeft:"1px solid ".concat(e.buttonBorder),borderTop:"1px solid ".concat(e.buttonBorder),bgcolor:"".concat(e.widgetContainer),transform:"translateY(-50%) rotate(45deg)",zIndex:0},"& .icon":{fontSize:"16px",marginRight:"4px",color:"".concat(e.textColor)},"& .item":{fontSize:"12px",color:"".concat(e.textColor)}}});function K(){var e=(0,L.v9)((function(e){return e.showDataSourceSetting})),t=(0,L.v9)((function(e){return e.currentUser})),n=(0,L.v9)((function(e){return e.currentUser.role})),r=(0,L.I0)(),o=(0,i.F)(),l=a.useState(null),c=(0,s.Z)(l,2),d=c[0],u=c[1],h=Boolean(d),v=(0,a.useState)(n||"superAdmin"),p=(0,s.Z)(v,2),m=p[0],x=p[1];(0,a.useEffect)((function(){x(n)}),[n]);var g=function(){u(null)};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(w,{sx:{display:"flex",alignItems:"center",textAlign:"center"},children:(0,f.jsx)(P.Z,{title:"Settings",children:(0,f.jsx)(M.Z,{onClick:function(e){u(e.currentTarget)},size:"small",sx:{ml:2,color:"".concat(o.textColor)},"aria-controls":h?"account-menu":void 0,"aria-haspopup":"true","aria-expanded":h?"true":void 0,children:(0,f.jsx)(X.ZP,{name:t.name,size:"30px",round:"3px"})})})}),(0,f.jsxs)(j.Z,{anchorEl:d,id:"account-menu",open:h,onClose:g,onClick:g,PaperProps:{elevation:0,sx:J(o)},transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},children:[(0,f.jsx)(G,{c:"icon"}),(0,f.jsx)(B,{}),(0,f.jsxs)(C.Z,{onClick:function(){r((0,U.Z)(!0)),g()},className:"item",children:[(0,f.jsx)(R.Z,{className:"icon"})," General Settings"]}),(0,f.jsx)(B,{}),(0,f.jsx)(D.rU,{to:"/",children:(0,f.jsxs)(C.Z,{className:"item",children:[(0,f.jsx)(T.Z,{className:"icon"}),"Search"]})}),(0,f.jsx)(D.rU,{to:"/plugins",children:(0,f.jsxs)(C.Z,{className:"item",children:[(0,f.jsx)(I.Z,{className:"icon"}),"Plugins"]})}),(0,f.jsx)(D.rU,{to:"/users",children:(0,f.jsxs)(C.Z,{className:"item",children:[(0,f.jsx)(F.Z,{className:"icon"}),"Users"]})}),e&&("admin"===m||"superAdmin"===m)&&(0,f.jsx)(D.rU,{to:"datasources",children:(0,f.jsxs)(C.Z,{className:"item",children:[(0,f.jsx)(E.Z,{className:"icon"}),"Datasources"]})})]})]})}var $,ee,te=n.p+"static/media/qryn-logo.26a5a5a8cc98abd3f4b1.png",ne=function(e){return(0,o.iv)($||($=(0,r.Z)(["\n background: ",";\n height: 30px;\n padding: 4px;\n display: flex;\n align-items: center;\n border-bottom:1px solid ",";\n .logo-section {\n margin: 0;\n .version {\n color: ",";\n font-size: 10px;\n margin-left: 5px;\n }\n .path {\n color:",";\n margin-left:20px;\n flex:1;\n font-weight:bold;\n text-transform:uppercase;\n font-size:11px;\n letter-spacing:1px;\n }\n }\n"])),e.widgetContainer,e.buttonBorder,e.textColor,e.textColor)},re=function(){var e,t=(0,i.F)(),n=(0,l.TH)();return(0,f.jsxs)("div",{className:(0,o.cx)(ne(t)),children:[(0,f.jsxs)("div",{className:"logo-section",children:[(0,f.jsx)("img",{src:te,alt:"Qryn View",height:"24px",className:"logo"}),(0,f.jsx)("p",{className:"version",children:"0.25.5"}),(0,f.jsxs)("p",{className:"path",children:[" ","/"," ",(e=n.pathname,e.replace(/\//,""))]})]}),(0,f.jsx)(c.Z,{section:"Status Bar",localProps:t}),(0,f.jsx)(K,{})]})},ie=n(25146),oe=n(79727),ae=function(e){return(0,o.iv)(ee||(ee=(0,r.Z)(["\n background: ",";\n display:flex;\n flex-direction:column;\n height:100vh;\n flex:1;\n\n"])),e.mainBgColor)};function le(){var e=(0,i.F)(),t=(0,L.v9)((function(e){return e.settingsDialogOpen}));return(0,f.jsxs)("div",{className:(0,o.cx)(ae(e)),children:[(0,f.jsx)(re,{}),(0,f.jsx)(l.j3,{}),(0,f.jsx)(ie.P,{}),(0,f.jsx)(oe.ZP,{open:t})]})}},88435:function(e,t,n){var r=n(64836);t.Z=void 0;var i=r(n(45045)),o=n(46417),a=(0,i.default)((0,o.jsx)("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"}),"Extension");t.Z=a},76854:function(e,t,n){var r=n(64836);t.Z=void 0;var i=r(n(45045)),o=n(46417),a=(0,i.default)((0,o.jsx)("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z"}),"PersonOutlineOutlined");t.Z=a},13002:function(e,t,n){var r=n(64836);t.Z=void 0;var i=r(n(45045)),o=n(46417),a=(0,i.default)((0,o.jsx)("path",{d:"M2 20h20v-4H2v4zm2-3h2v2H4v-2zM2 4v4h20V4H2zm4 3H4V5h2v2zm-4 7h20v-4H2v4zm2-3h2v2H4v-2z"}),"Storage");t.Z=a},57585:function(e,t,n){var r=n(64836);t.Z=void 0;var i=r(n(45045)),o=n(46417),a=(0,i.default)((0,o.jsx)("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4-3.2-3.2zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8z"}),"TravelExplore");t.Z=a}}]); \ No newline at end of file +"use strict";(self.webpackChunkqryn_view=self.webpackChunkqryn_view||[]).push([[14],{25687:function(e,t,n){n.r(t),n.d(t,{MainAppStyles:function(){return ae},default:function(){return le}});var r=n(30168),i=n(31238),o=n(62975),a=n(47313),l=n(58467),c=n(99811),s=n(29439),d=n(87462),u=n(63366),h=n(83061),v=n(20564),p=n(63649),m=n(39028),x=n(86728),f=n(46417),g=["className","component"];var b=n(41271),Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=e.defaultClassName,r=void 0===n?"MuiBox-root":n,i=e.generateClassName,o=(0,v.ZP)("div",{shouldForwardProp:function(e){return"theme"!==e&&"sx"!==e&&"as"!==e}})(p.Z);return a.forwardRef((function(e,n){var a=(0,x.Z)(t),l=(0,m.Z)(e),c=l.className,s=l.component,v=void 0===s?"div":s,p=(0,u.Z)(l,g);return(0,f.jsx)(o,(0,d.Z)({as:v,ref:n,className:(0,h.Z)(c,i?i(r):r),theme:a},p))}))}({defaultTheme:(0,n(68658).Z)(),defaultClassName:"MuiBox-root",generateClassName:b.Z.generate}),w=Z,j=n(24064),C=n(95765),S=n(21921),N=n(17551),z=n(88564),y=n(29394),A=n(99273),k=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],H=(0,z.ZP)("div",{name:"MuiDivider",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})((function(e){var t=e.theme,n=e.ownerState;return(0,d.Z)({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},n.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},n.light&&{borderColor:t.vars?"rgba(".concat(t.vars.palette.dividerChannel," / 0.08)"):(0,N.Fq)(t.palette.divider,.08)},"inset"===n.variant&&{marginLeft:72},"middle"===n.variant&&"horizontal"===n.orientation&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},"middle"===n.variant&&"vertical"===n.orientation&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},"vertical"===n.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},n.flexItem&&{alignSelf:"stretch",height:"auto"})}),(function(e){var t=e.theme,n=e.ownerState;return(0,d.Z)({},n.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{position:"relative",width:"100%",borderTop:"thin solid ".concat((t.vars||t).palette.divider),top:"50%",content:'""',transform:"translateY(50%)"}})}),(function(e){var t=e.theme,n=e.ownerState;return(0,d.Z)({},n.children&&"vertical"===n.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",top:"0%",left:"50%",borderTop:0,borderLeft:"thin solid ".concat((t.vars||t).palette.divider),transform:"translateX(0%)"}})}),(function(e){var t=e.ownerState;return(0,d.Z)({},"right"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===t.textAlign&&"vertical"!==t.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})})),V=(0,z.ZP)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:function(e,t){var n=e.ownerState;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})((function(e){var t=e.theme,n=e.ownerState;return(0,d.Z)({display:"inline-block",paddingLeft:"calc(".concat(t.spacing(1)," * 1.2)"),paddingRight:"calc(".concat(t.spacing(1)," * 1.2)")},"vertical"===n.orientation&&{paddingTop:"calc(".concat(t.spacing(1)," * 1.2)"),paddingBottom:"calc(".concat(t.spacing(1)," * 1.2)")})})),B=a.forwardRef((function(e,t){var n=(0,y.Z)({props:e,name:"MuiDivider"}),r=n.absolute,i=void 0!==r&&r,o=n.children,a=n.className,l=n.component,c=void 0===l?o?"div":"hr":l,s=n.flexItem,v=void 0!==s&&s,p=n.light,m=void 0!==p&&p,x=n.orientation,g=void 0===x?"horizontal":x,b=n.role,Z=void 0===b?"hr"!==c?"separator":void 0:b,w=n.textAlign,j=void 0===w?"center":w,C=n.variant,N=void 0===C?"fullWidth":C,z=(0,u.Z)(n,k),B=(0,d.Z)({},n,{absolute:i,component:c,flexItem:v,light:m,orientation:g,role:Z,textAlign:j,variant:N}),M=function(e){var t=e.absolute,n=e.children,r=e.classes,i=e.flexItem,o=e.light,a=e.orientation,l=e.textAlign,c={root:["root",t&&"absolute",e.variant,o&&"light","vertical"===a&&"vertical",i&&"flexItem",n&&"withChildren",n&&"vertical"===a&&"withChildrenVertical","right"===l&&"vertical"!==a&&"textAlignRight","left"===l&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]};return(0,S.Z)(c,A.V,r)}(B);return(0,f.jsx)(H,(0,d.Z)({as:c,className:(0,h.Z)(M.root,a),role:Z,ref:t,ownerState:B},z,{children:o?(0,f.jsx)(V,{className:M.wrapper,ownerState:B,children:o}):null}))})),M=n(47131),P=n(78899),R=n(38167),T=n(57585),I=n(88435),L=n(56352),U=n(79861),D=n(2135),F=n(76854),E=n(13002),W=n(52586),O=n(87975),q=n(8454),Y=n(30735),_=n(62424);function G(e){var t=e.c,n=(0,L.I0)(),r=(0,q.Z)(),i="Link Copied To Clipboard";return(0,f.jsxs)(C.Z,{onClick:function(){n((0,O.E9)(!0)),setTimeout((function(){var e,t,o;if(null===(e=navigator)||void 0===e||!e.clipboard||!window.isSecureContext){var a=document.createElement("textarea");return a.value=window.location.href,a.style.position="fixed",a.style.left="-999999px",a.style.top="-999999px",document.body.appendChild(a),a.focus(),a.select(),new Promise((function(e,t){var o=r.add({data:window.location.href,description:"From Shared URL"},10);n((0,Y.Z)(o)),document.execCommand("copy")?e():t(),a.remove(),n((0,O.el)({type:_.m.success,message:i}))}))}null===(t=navigator)||void 0===t||null===(o=t.clipboard)||void 0===o||o.writeText(window.location.href).then((function(){var e=r.add({data:window.location.href,description:"From Shared URL"},10);n((0,Y.Z)(e)),n((0,O.el)({type:_.m.success,message:i}))}),(function(e){console.log("error on copy",e)}))}),200)},disabled:!1,style:{fontSize:"12px"},children:[" ",(0,f.jsx)(W.Z,{fontSize:"small",className:t}),(0,f.jsx)("span",{children:"Copy Link"})]})}var Q,X=n(29826),J=(n(41801).Z.button(Q||(Q=(0,r.Z)(["\n border: none;\n background: ",";\n border: 1px solid ",";\n color: ",";\n padding: 3px 12px;\n border-radius: 3px;\n font-size: 12px;\n cursor: pointer;\n user-select: none;\n line-height: 20px;\n display: flex;\n align-items: center;\n margin-left: 10px;\n height: 26px;\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor})),function(e){return{color:"".concat(e.textColor),overflow:"visible",fontSize:"12px",background:"".concat(e.widgetContainer),border:"1px solid ".concat(e.buttonBorder),mt:1.5,"& .MuiAvatar-root":{width:32,height:32,ml:-.5,mr:1},"&:before":{content:'""',display:"block",position:"absolute",top:0,right:14,width:10,height:10,borderLeft:"1px solid ".concat(e.buttonBorder),borderTop:"1px solid ".concat(e.buttonBorder),bgcolor:"".concat(e.widgetContainer),transform:"translateY(-50%) rotate(45deg)",zIndex:0},"& .icon":{fontSize:"16px",marginRight:"4px",color:"".concat(e.textColor)},"& .item":{fontSize:"12px",color:"".concat(e.textColor)}}});function K(){var e=(0,L.v9)((function(e){return e.showDataSourceSetting})),t=(0,L.v9)((function(e){return e.currentUser})),n=(0,L.v9)((function(e){return e.currentUser.role})),r=(0,L.I0)(),o=(0,i.F)(),l=a.useState(null),c=(0,s.Z)(l,2),d=c[0],u=c[1],h=Boolean(d),v=(0,a.useState)(n||"superAdmin"),p=(0,s.Z)(v,2),m=p[0],x=p[1];(0,a.useEffect)((function(){x(n)}),[n]);var g=function(){u(null)};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(w,{sx:{display:"flex",alignItems:"center",textAlign:"center"},children:(0,f.jsx)(P.Z,{title:"Settings",children:(0,f.jsx)(M.Z,{onClick:function(e){u(e.currentTarget)},size:"small",sx:{ml:2,color:"".concat(o.textColor)},"aria-controls":h?"account-menu":void 0,"aria-haspopup":"true","aria-expanded":h?"true":void 0,children:(0,f.jsx)(X.ZP,{name:t.name,size:"30px",round:"3px"})})})}),(0,f.jsxs)(j.Z,{anchorEl:d,id:"account-menu",open:h,onClose:g,onClick:g,PaperProps:{elevation:0,sx:J(o)},transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},children:[(0,f.jsx)(G,{c:"icon"}),(0,f.jsx)(B,{}),(0,f.jsxs)(C.Z,{onClick:function(){r((0,U.Z)(!0)),g()},className:"item",children:[(0,f.jsx)(R.Z,{className:"icon"})," General Settings"]}),(0,f.jsx)(B,{}),(0,f.jsx)(D.rU,{to:"/",children:(0,f.jsxs)(C.Z,{className:"item",children:[(0,f.jsx)(T.Z,{className:"icon"}),"Search"]})}),(0,f.jsx)(D.rU,{to:"/plugins",children:(0,f.jsxs)(C.Z,{className:"item",children:[(0,f.jsx)(I.Z,{className:"icon"}),"Plugins"]})}),(0,f.jsx)(D.rU,{to:"/users",children:(0,f.jsxs)(C.Z,{className:"item",children:[(0,f.jsx)(F.Z,{className:"icon"}),"Users"]})}),e&&("admin"===m||"superAdmin"===m)&&(0,f.jsx)(D.rU,{to:"datasources",children:(0,f.jsxs)(C.Z,{className:"item",children:[(0,f.jsx)(E.Z,{className:"icon"}),"Datasources"]})})]})]})}var $,ee,te=n.p+"static/media/qryn-logo.26a5a5a8cc98abd3f4b1.png",ne=function(e){return(0,o.iv)($||($=(0,r.Z)(["\n background: ",";\n height: 30px;\n padding: 4px;\n display: flex;\n align-items: center;\n border-bottom:1px solid ",";\n .logo-section {\n margin: 0;\n .version {\n color: ",";\n font-size: 10px;\n margin-left: 5px;\n }\n .path {\n color:",";\n margin-left:20px;\n flex:1;\n font-weight:bold;\n text-transform:uppercase;\n font-size:11px;\n letter-spacing:1px;\n }\n }\n"])),e.widgetContainer,e.buttonBorder,e.textColor,e.textColor)},re=function(){var e,t=(0,i.F)(),n=(0,l.TH)();return(0,f.jsxs)("div",{className:(0,o.cx)(ne(t)),children:[(0,f.jsxs)("div",{className:"logo-section",children:[(0,f.jsx)("img",{src:te,alt:"Qryn View",height:"24px",className:"logo"}),(0,f.jsx)("p",{className:"version",children:"0.25.6"}),(0,f.jsxs)("p",{className:"path",children:[" ","/"," ",(e=n.pathname,e.replace(/\//,""))]})]}),(0,f.jsx)(c.Z,{section:"Status Bar",localProps:t}),(0,f.jsx)(K,{})]})},ie=n(25146),oe=n(79727),ae=function(e){return(0,o.iv)(ee||(ee=(0,r.Z)(["\n background: ",";\n display:flex;\n flex-direction:column;\n height:100vh;\n flex:1;\n\n"])),e.mainBgColor)};function le(){var e=(0,i.F)(),t=(0,L.v9)((function(e){return e.settingsDialogOpen}));return(0,f.jsxs)("div",{className:(0,o.cx)(ae(e)),children:[(0,f.jsx)(re,{}),(0,f.jsx)(l.j3,{}),(0,f.jsx)(ie.P,{}),(0,f.jsx)(oe.ZP,{open:t})]})}},88435:function(e,t,n){var r=n(64836);t.Z=void 0;var i=r(n(45045)),o=n(46417),a=(0,i.default)((0,o.jsx)("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"}),"Extension");t.Z=a},76854:function(e,t,n){var r=n(64836);t.Z=void 0;var i=r(n(45045)),o=n(46417),a=(0,i.default)((0,o.jsx)("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z"}),"PersonOutlineOutlined");t.Z=a},13002:function(e,t,n){var r=n(64836);t.Z=void 0;var i=r(n(45045)),o=n(46417),a=(0,i.default)((0,o.jsx)("path",{d:"M2 20h20v-4H2v4zm2-3h2v2H4v-2zM2 4v4h20V4H2zm4 3H4V5h2v2zm-4 7h20v-4H2v4zm2-3h2v2H4v-2z"}),"Storage");t.Z=a},57585:function(e,t,n){var r=n(64836);t.Z=void 0;var i=r(n(45045)),o=n(46417),a=(0,i.default)((0,o.jsx)("path",{d:"M19.3 16.9c.4-.7.7-1.5.7-2.4 0-2.5-2-4.5-4.5-4.5S11 12 11 14.5s2 4.5 4.5 4.5c.9 0 1.7-.3 2.4-.7l3.2 3.2 1.4-1.4-3.2-3.2zm-3.8.1c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12 20v2C6.48 22 2 17.52 2 12S6.48 2 12 2c4.84 0 8.87 3.44 9.8 8h-2.07c-.64-2.46-2.4-4.47-4.73-5.41V5c0 1.1-.9 2-2 2h-2v2c0 .55-.45 1-1 1H8v2h2v3H9l-4.79-4.79C4.08 10.79 4 11.38 4 12c0 4.41 3.59 8 8 8z"}),"TravelExplore");t.Z=a}}]); \ No newline at end of file diff --git a/view/static/js/368.6610f292.chunk.js b/view/static/js/368.a12caf5e.chunk.js similarity index 99% rename from view/static/js/368.6610f292.chunk.js rename to view/static/js/368.a12caf5e.chunk.js index 0fad0e2d..06eed56e 100644 --- a/view/static/js/368.6610f292.chunk.js +++ b/view/static/js/368.a12caf5e.chunk.js @@ -1 +1 @@ -(self.webpackChunkqryn_view=self.webpackChunkqryn_view||[]).push([[368],{64368:function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return yn},getURlParams:function(){return jn}});var i,r,a,u,s=t(29439),o=t(37762),l=t(36426),c=t(47313),d=t(56352),f=t(79644),v=t(58467),h=t(1413),x=t(93433),p=t(30168),m=t(62975),g=t(46271),Z=t(87975),S=t(60065),j=t(25026),y=t(82751),b=t(9964),N=t(53132),k=t(41434),z=t(95334),w=t(16450),C=function(n){return function(e){e({type:"SET_IS_DATASOURCE_SAVED",isDsSaved:n})}},O=t(43262),J=t(59236),I=t(46417),T=(0,m.iv)(i||(i=(0,p.Z)(["\n height: 12px !important;\n width: 12px !important;\n color: white;\n margin: 0px 4px;\n"]))),A=function(n){return(0,m.iv)(r||(r=(0,p.Z)(["\n display: flex;\n align-items: center;\n background: ",";\n color: white;\n font-size: 11px;\n padding: 4px;\n border-radius: 3px;\n margin-right: 10px;\n cursor: pointer;\n span {\n margin-right: 4px;\n font-weight: bold;\n }\n"])),n.primaryDark)},_=(0,m.iv)(a||(a=(0,p.Z)(["\n display: flex;\n align-items: center;\n background: #b62c14;\n color: white;\n font-size: 12px;\n padding: 4px;\n border-radius: 3px;\n margin-right: 10px;\n cursor: pointer;\n span {\n margin-right: 4px;\n font-weight: bold;\n }\n"]))),E=(0,m.iv)(u||(u=(0,p.Z)(["\n display: flex;\n align-items: center;\n font-size: 12px;\n &.loading-icon {\n height: 14px;\n width: 14px;\n }\n"]))),L=function(n){var e=n.setIsSaved,t=(0,O.Fg)();return(0,I.jsxs)("div",{className:(0,m.cx)(A(t)),onClick:function(n){return e(!1)},children:[(0,I.jsx)(w.Z,{className:(0,m.cx)(T)})," ",(0,I.jsx)("span",{children:"Saved"})]})},D=function(n){var e=n.errorText;return(0,I.jsxs)("div",{className:(0,m.cx)(_),children:[(0,I.jsx)(J.Z,{className:(0,m.cx)(T)})," ",(0,I.jsx)("span",{children:e})]})};function F(n){var e=n.onClickAdd,t=n.isAdd,i=n.title,r=n.isEditing,a=n.fieldErrors,u=(0,d.I0)(),o=(0,c.useState)(!1),l=(0,s.Z)(o,2),v=l[0],h=l[1];return(0,c.useEffect)((function(){return r&&(setTimeout((function(){h(!0),u(C(!0))}),800),h(!1)),h(!1),function(){h(!1)}}),[r]),(0,I.jsxs)(f.Af,{children:[i,(0,I.jsxs)("div",{className:"edit-buttons",children:[r&&(0,I.jsxs)("div",{className:E,children:[(0,I.jsx)(z.Z,{style:{height:"13px",width:"13px"}})," ","Saving ..."]}),(null===a||void 0===a?void 0:a.protocol)&&(0,I.jsx)(D,{errorText:"Insecure Mixed Content. Mixing HTTP and HTTPS is insecure and is not supported."}),(null===a||void 0===a?void 0:a.url)&&(0,I.jsx)(D,{errorText:"Please complete API URL"}),v&&(0,I.jsx)(L,{setIsSaved:h}),t&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(k.Z,{fontSize:"small",style:{cursor:"pointer",display:"flex"},onClick:e})})]})]})}var M=t(16806),U=t.n(M),P=t(70024),R=function(n){var e=(0,d.I0)(),t=(0,d.v9)((function(n){return n.dataSources})),i=(0,c.useState)(!1),r=(0,s.Z)(i,2),a=r[0],u=r[1],o=n.headers,l=n.id,v=(0,c.useState)((null===n||void 0===n?void 0:n.cors)||!1),p=(0,s.Z)(v,2),m=p[0],g=p[1],Z=function(n,i,r){u((function(){return!0}));var a=n.target.value,s=(t.find((function(n){return n.id===l})).headers||[]).map((function(n){return n.id===i?(n[r]=a,n):n})),o=t.map((function(n){return n.id===l&&(n.headers=(0,x.Z)(s)),n}));localStorage.setItem("dataSources",JSON.stringify(o)),e((0,b.Z)(o)),setTimeout((function(){u((function(){return!1}))}),800)};return(0,I.jsx)("div",{className:"",children:o&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(F,{title:"Custom HTTP Headers",isEdit:!1,isAdd:!0,isEditing:a,onClickAdd:function(n){n.preventDefault();var i=null===t||void 0===t?void 0:t.find((function(n){return n.id===l})),r=i.headers,a=JSON.parse(JSON.stringify((0,x.Z)(t)));if(o.length>0){var u=(0,h.Z)((0,h.Z)({},r[r.length-1]),{},{id:(0,y.x0)()}),s=(0,h.Z)((0,h.Z)({},i),{},{headers:[].concat((0,x.Z)(i.headers),[u])}),c=null===a||void 0===a?void 0:a.map((function(n){return n.id===l?(0,h.Z)({},s):n}));localStorage.setItem("dataSources",JSON.stringify(c)),e((0,b.Z)(c))}}}),(0,I.jsxs)(f.zs,{children:[(0,I.jsx)(f.__,{children:"Use CORS"})," ",(0,I.jsx)(P.Z,{size:"small",checked:m,onChange:function(n){var i=n.target.checked,r=t.map((function(n){return n.id===l&&(n.cors=i),n}));g((function(){return i})),localStorage.setItem("dataSources",JSON.stringify(r)),e((0,b.Z)(r))}})]}),null===o||void 0===o?void 0:o.map((function(n,i){return(0,I.jsx)(f.zs,{children:(0,I.jsxs)(f.BZ,{children:[(0,I.jsx)(N.gN,{label:"header",value:U().sanitize(n.header),onChange:function(e){return Z(e,n.id,"header")}}),(0,I.jsx)(N.gN,{label:"value",value:U().sanitize(n.value),onChange:function(e){return Z(e,n.id,"value")}}),(0,I.jsx)(j.Z,{onClick:function(i){return function(n,i){var r=null===t||void 0===t?void 0:t.find((function(n){return n.id===l})),a=(0,x.Z)(o).filter((function(n){return n.id!==i})),u=(0,h.Z)((0,h.Z)({},r),{},{headers:(0,x.Z)(a)}),s=null===t||void 0===t?void 0:t.map((function(n){return n.id===l?(0,h.Z)({},u):n}));localStorage.setItem("dataSources",JSON.stringify(s)),e((0,b.Z)(s))}(0,n.id)},style:{cursor:"pointer",marginLeft:"10px"},fontSize:"small"})]})},i)}))]})})};function q(n){var e=(0,v.s0)(),t=(0,O.Fg)(),i=(0,d.v9)((function(n){return n.urlLocation})),r=(0,d.I0)(),a=n.title,u=(0,d.v9)((function(n){return n.isDsSaved})),s=(0,c.useMemo)((function(){return u?"Save":"Back"}),[u]);return(0,I.jsxs)("div",{className:"ds-header",children:[(0,I.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,I.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,I.jsxs)("div",{style:{display:"flex"},children:[(0,I.jsx)(N.D8,{}),(0,I.jsx)("h1",{children:a})]}),(0,I.jsxs)("p",{style:{color:t.textColor,fontSize:"10px",marginTop:"5px",marginLeft:"10px",opacity:".5"},children:["v","0.25.5"]})]})}),(0,I.jsx)(N.zx,{value:U().sanitize(s),onClick:function(){var n=(null===i||void 0===i?void 0:i.length)>0;r(C(!1)),e(!n&&"Back"!==s||"DataSources"===a?"/":-1)},editing:!0,primary:u})]})}var B=t(4942),H=function(n){var e=n.id,t=n.name,i=n.regex,r=n.urlLabel,a=n.internalLink,u=n.linkType,s=n.locked,o=n.dataSourceId,l=n.fieldEditing,v=(0,d.I0)(),p=(0,d.v9)((function(n){return n.dataSources})),m=(0,c.useMemo)((function(){return p.map((function(n){return{name:n.name,value:n.id}}))}),[p]),g=function(n,t){l();var i=JSON.parse(JSON.stringify(p)),r=i.find((function(n){return n.id===o})).linkedFields.map((function(i){return i.id===e?(0,h.Z)((0,h.Z)({},i),{},(0,B.Z)({},n,t)):i}));return i.map((function(n){return n.id===o?(0,h.Z)((0,h.Z)({},n),{},{linkedFields:r}):n}))},Z=function(n,e){l();var t=n.target.value,i=g(e,t);localStorage.setItem("dataSources",JSON.stringify(i)),v((0,b.Z)(i))};return(0,I.jsxs)(f.X9,{children:[(0,I.jsxs)(f.zs,{children:[(0,I.jsx)(N.gN,{value:U().sanitize(t),label:"Name",onChange:function(n){return Z(n,"name")}}),(0,I.jsx)(N.gN,{value:U().sanitize(i),label:"Regex",onChange:function(n){return Z(n,"regex")}}),(0,I.jsx)(N.gN,{value:U().sanitize(r),label:"URL Label",onChange:function(n){return Z(n,"urlLabel")}}),(0,I.jsx)(j.Z,{onClick:function(n){l();var t=JSON.parse(JSON.stringify(p)),i=t.find((function(n){return n.id===o})).linkedFields.filter((function(n){return n.id!==e})),r=t.map((function(n){return n.id===o?(0,h.Z)((0,h.Z)({},n),{},{linkedFields:(0,x.Z)(i)}):n}));localStorage.setItem("dataSources",JSON.stringify(r)),v((0,b.Z)(r))},fontSize:"small",style:{marginLeft:"10px",cursor:"pointer",display:s?"none":"inline-block"}})]}),(0,I.jsxs)(f.zs,{className:"internal",children:[(0,I.jsx)(N.ll,{value:a,label:"Internal Link",onChange:function(n){return function(n,e){l();var t=Boolean(n.target.checked),i=g(e,t);localStorage.setItem("dataSources",JSON.stringify(i)),v((0,b.Z)(i))}(n,"internalLink")}}),(0,I.jsx)(N.Ph,{label:"",value:U().sanitize(u),opts:m,selectType:"linkedField",onChange:function(n){return Z(n,"linkID")}})]})]})},V=t(15671),$=t(43144),W=function(){function n(){(0,V.Z)(this,n),this.id=void 0,this.dataSource=void 0,this.ds_id=void 0,this.name=void 0,this.regex=void 0,this.query=void 0,this.urlLabel=void 0,this.url=void 0,this.internalLink=void 0,this.linkType=void 0,this.id=(0,y.x0)(),this.dataSource="Logs",this.ds_id="logs",this.name="traceID",this.regex='^.*?"traceID" ="(w+)".*$/',this.query="${__value.raw}",this.urlLabel="",this.url="",this.internalLink=!0,this.linkType="Traces"}return(0,$.Z)(n,[{key:"create",value:function(){return{id:this.id,dataSource:this.dataSource,ds_id:this.ds_id,name:this.name,regex:this.regex,query:this.query,urlLabel:this.urlLabel,url:this.url,internalLink:this.internalLink,linkType:this.linkType}}}]),n}(),G=function(n){var e=n.linkedFields,t=n.name,i=n.id,r=(0,d.v9)((function(n){return n.dataSources})),a=(0,d.I0)(),u=(0,c.useState)(!1),o=(0,s.Z)(u,2),l=o[0],v=o[1],p=function(){v((function(){return!0})),setTimeout((function(){v((function(){return!1}))}),800)};return(null===e||void 0===e?void 0:e.length)>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(F,{title:"Linked Fields",isEdit:!0,isAdd:!0,onClickAdd:function(){var n=new W;n.dataSource=t,n.create();var u=JSON.parse(JSON.stringify(e)),s=[].concat((0,x.Z)(u),[(0,h.Z)({},n)]),o=JSON.parse(JSON.stringify(r)),l=null===o||void 0===o?void 0:o.map((function(n){return n.id===i?(0,h.Z)((0,h.Z)({},n),{},{linkedFields:s}):n}));localStorage.setItem("dataSources",JSON.stringify(l)),a((0,b.Z)(l))},isEditing:l}),(0,I.jsx)(f.VJ,{children:null===e||void 0===e?void 0:e.map((function(n,e){return(0,I.jsx)(H,(0,h.Z)((0,h.Z)({},n),{},{dataSourceId:i,locked:!1,fieldEditing:p}),e)}))})]}):null};function K(n){var e=n.value,t=n.label,i=n.onChange,r=n.placeholder;return(0,I.jsxs)(f.BZ,{children:[(0,I.jsx)(f.__,{children:t}),(0,I.jsx)(f.Kx,{className:"ds-input",onChange:i,placeholder:r,value:U().sanitize(e)})]})}function Q(n){var e=n.auth,t=n.id,i=(0,d.I0)(),r=(0,d.v9)((function(n){return n.dataSources})),a=(0,c.useState)([]),u=(0,s.Z)(a,2),o=u[0],l=u[1],v=(0,c.useState)(!1),p=(0,s.Z)(v,2),m=p[0],g=p[1],Z=(0,c.useMemo)((function(){var n;return null===(n=Object.entries(e))||void 0===n?void 0:n.map((function(n){var e=(0,s.Z)(n,2),t=e[0],i=e[1];return(0,h.Z)({name:t},i)})).filter((function(n){return"fields"!==n.name}))}),[e]),S=(0,c.useMemo)((function(){var n;return null===(n=Object.entries(e))||void 0===n?void 0:n.map((function(n){var e=(0,s.Z)(n,2),t=e[0],i=e[1];return(0,h.Z)({name:t},i)})).find((function(n){return"fields"===n.name}))}),[e]),j=function(n,a){var u=JSON.parse(JSON.stringify(e));u[a].value=n;var s=JSON.parse(JSON.stringify(r)).map((function(n){return n.id===t?(0,h.Z)((0,h.Z)({},n),{},{auth:(0,h.Z)({},u)}):n}));return localStorage.setItem("dataSources",JSON.stringify(s)),i((0,b.Z)(s)),s};(0,c.useEffect)((function(){var n,e,t=null===(n=Z.filter((function(n){return"switch"===n.form_type&&!(null===n||void 0===n||!n.value)})))||void 0===n||null===(e=n.filter((function(n){return!!n.withFields})))||void 0===e?void 0:e.map((function(n){return n.name}));l(t)}),[Z,l]);var y=function(n,a,u){var s;g((function(){return!0}));var o=n.target.value,l=JSON.parse(JSON.stringify(e)),c=(0,h.Z)((0,h.Z)({},l),{},{fields:(0,h.Z)((0,h.Z)({},l.fields),{},(0,B.Z)({},u,null===l||void 0===l||null===(s=l.fields[u])||void 0===s?void 0:s.map((function(n){return n.name===a?(n.value=o,(0,h.Z)({},n)):n}))))}),d=JSON.parse(JSON.stringify((0,x.Z)(r))),f=null===d||void 0===d?void 0:d.map((function(n){return n.id===t?(n.auth=c,n):n}));localStorage.setItem("dataSources",JSON.stringify(f)),i((0,b.Z)(f)),setTimeout((function(){g((function(){return!1}))}),600)};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(F,{title:"HTTP Auth Fields",isEditing:m,isEdit:!1,isAdd:!1}),(0,I.jsxs)(f.VJ,{children:[Z&&Z.map((function(n,e){return"select"===n.form_type?(0,I.jsx)(N.Ph,{value:U().sanitize(n.value),name:U().sanitize(n.name),onChange:function(e){return function(n,e){g((function(){return!0}));var t=n.target.value;j(t,e),setTimeout((function(){g((function(){return!1}))}),800)}(e,n.name)},locked:!1,opts:n.options,label:n.label},e):"switch"===n.form_type?(0,I.jsx)(N.ll,{label:n.label,value:n.value,onChange:function(e){return function(n,e){g((function(){return!0}));var t=n.target.checked;j(t,e),setTimeout((function(){g((function(){return!1}))}),800)}(e,n.name)}},e):null})),(0,I.jsx)(f.zs,{children:o&&o.map((function(n,e){var t;return(0,I.jsx)(f.zs,{children:S[n]&&(null===(t=S[n])||void 0===t?void 0:t.map((function(e,t){return"input"===e.form_type||"password"===e.form_type?(0,I.jsx)(N.gN,{onChange:function(t){return y(t,e.name,n)},type:e.form_type,value:U().sanitize(e.value),label:e.label,placeholder:e.placeholder},t):"textarea"===e.form_type?(0,I.jsx)(K,{onChange:function(t){return y(t,e.name,n)},value:U().sanitize(e.value),label:e.label,placeholder:e.placeholder},t):null})))},e)}))})]})]})}var X,Y=t(41801).Z.div(X||(X=(0,p.Z)(["\n position: absolute;\n left: 0;\n top: 0;\n background: ",";\n display: flex;\n flex-direction: culumn;\n justify-content: center;\n color: ",";\n flex: 1;\n height: 100%;\n width: 100%;\n\n .body-cont {\n max-width: 1440px;\n padding: 10px;\n margin: 10px;\n border-radius: 3px;\n flex: 1;\n background: ",";\n overflow-y: auto;\n overflow-x: hidden;\n }\n .ds-header {\n padding: 10px;\n padding-bottom: 20px;\n font-size: 24px;\n flex: 1;\n display: flex;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n padding-left: 0px;\n .logo {\n margin-right: 10px;\n }\n }\n .ds-cont {\n margin-bottom: 10px;\n border: 1px solid ",";\n border-radius: 3px;\n overflow-y: auto;\n }\n .ds-item {\n padding: 10px;\n // margin-bottom: 10px;\n border-radius: 3px 3px 0px 0px;\n padding-bottom: 14px;\n display: flex;\n .logo {\n padding: 10px;\n padding-right: 20px;\n padding-left: 0px;\n }\n .ds-text {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n .ds-type {\n font-size: 18px;\n padding: 10px;\n padding-left: 0px;\n color: ",";\n }\n small {\n font-size: 12px;\n }\n .setting-icon {\n justify-self: flex-end;\n cursor: pointer;\n }\n .ds-settings {\n background: ",";\n }\n }\n"])),(function(n){return n.theme.viewBg}),(function(n){return n.theme.textColor}),(function(n){return n.theme.widgetContainer}),(function(n){return n.theme.buttonBorder}),(function(n){return n.theme.textColor}),(function(n){return n.theme.viewBg})),nn=t(2135);function en(){var n=(0,d.v9)((function(n){return n.dataSources}));return(null===n||void 0===n?void 0:n.length)>0?(0,I.jsx)("div",{style:{margin:"10px"},children:n.map((function(n,e){var t=n.icon,i=n.id,r=n.name,a=n.type,u=n.url;return(0,I.jsx)("div",{className:"ds-cont",children:(0,I.jsx)(nn.rU,{to:i,children:(0,I.jsxs)("div",{className:"ds-item",children:[(0,I.jsx)(N.JO,{icon:t}),(0,I.jsxs)("div",{className:"ds-text",children:[(0,I.jsx)("div",{className:"ds-type",children:r}),(0,I.jsxs)("span",{children:[(0,I.jsxs)("small",{children:[a," | "," "]}),(0,I.jsx)("small",{style:{userSelect:"all"},children:u})]})]})]})})},e)}))}):(0,I.jsx)("div",{children:(0,I.jsx)("h1",{children:"No Data Sources Found."})})}var tn,rn=function(n){var e=n.headers,t=n.id,i=n.linkedFields,r=n.name,a=n.url,u=n.cors,o=(0,d.I0)(),l=(0,d.v9)((function(n){return n.dataSources})),v=(0,c.useState)({url:!1,protocol:!1}),x=(0,s.Z)(v,2),p=x[0],m=x[1],g=function(n,e){var i=e;if("url"===n){var r=e.replace(/\/$/,"");i=r}var a=JSON.parse(JSON.stringify(l));return a.forEach((function(e){e.id===t&&(e[n]=i)})),a},Z=(0,c.useState)(!1),S=(0,s.Z)(Z,2),j=S[0],y=S[1],k=function(n,e){y((function(){return!0}));var t=n.target.value;if("url"===e){var i=function(e){try{return{value:window.location.protocol===new URL(e).protocol,error:""}}catch(n){return{value:!1,error:"url"}}}(t);if("url"===(null===i||void 0===i?void 0:i.error)&&m((function(n){return(0,h.Z)((0,h.Z)({},n),{},{url:!0})})),null!==i&&void 0!==i&&i.value||""!==(null===i||void 0===i?void 0:i.error)||m((function(n){return(0,h.Z)((0,h.Z)({},n),{},{protocol:!0})})),""===(null===i||void 0===i?void 0:i.error)&&null!==i&&void 0!==i&&i.value){m((function(n){return(0,h.Z)((0,h.Z)({},n),{},{protocol:!1,url:!1})}));var r=g(e,t);localStorage.setItem("dataSources",JSON.stringify(r)),o((0,b.Z)(r)),setTimeout((function(){y((function(){return!1}))}),800)}}var a=g(e,t);localStorage.setItem("dataSources",JSON.stringify(a)),o((0,b.Z)(a)),setTimeout((function(){y((function(){return!1}))}),800)};return(0,I.jsxs)(f.jy,{children:[(0,I.jsx)(F,{isEditing:j,isEdit:!0,isAdd:!1,title:"DataSource Settings",fieldErrors:p}),(0,I.jsx)(f.VJ,{children:(0,I.jsxs)(f.zs,{children:[(0,I.jsx)(N.gN,{value:U().sanitize(r),label:"Name",onChange:function(n){return k(n,"name")}}),(0,I.jsx)(N.gN,{value:U().sanitize(a),label:"URL",error:p.url||p.protocol,onChange:function(n){return k(n,"url")}})]})}),(0,I.jsx)(Q,(0,h.Z)({},n)),(0,I.jsx)(R,{cors:u,headers:e,id:t}),(0,I.jsx)(G,(0,h.Z)((0,h.Z)({},n),{},{linkedFields:i}))]})},an=(0,m.iv)(tn||(tn=(0,p.Z)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-right: 20px;\n"])));function un(n){var e=n.url,t=n.auth,i=t.basicAuth,r=(0,s.Z)(t.fields.basicAuth,2),a=r[0],u=r[1],o=(0,g.Z)(["qryn-dev-cookie","qryn-settings"]),l=(0,s.Z)(o,2),c=(l[0],l[1]),f=(0,d.I0)(),v=(0,d.v9)((function(n){return n.dataSources}));return(0,I.jsxs)("div",{className:"ds-cont",children:[(0,I.jsxs)("div",{className:(0,m.cx)(an),children:[(0,I.jsx)(fn,(0,h.Z)({},n)),(0,I.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,I.jsx)(N.zx,{title:"Set Cookie with name: qryn-settings",value:U().sanitize("Save Cookie"),onClick:function(){var n=new Date;(new Date).setDate(n.getDate()+1);var t=JSON.stringify({url:e});try{c("qryn-settings","".concat(btoa(a.value),":").concat(btoa(u.value),"@").concat(btoa(t),"&&").concat(btoa("admin")),{path:"/"})}catch(i){console.log(i)}},primary:!0}),(0,I.jsx)(N.zx,{title:"Use same URL and Basic Auth for all Data Sources",value:U().sanitize("Use For All"),onClick:function(){var n=(0,x.Z)(v),t=JSON.parse(JSON.stringify(n)),r=null===t||void 0===t?void 0:t.map((function(n){var t;return(0,h.Z)((0,h.Z)({},n),{},{url:U().sanitize(e),auth:(0,h.Z)((0,h.Z)({},n.auth),{},{basicAuth:(0,h.Z)((0,h.Z)({},n.auth.basicAuth),{},{value:i.value}),fields:(0,h.Z)((0,h.Z)({},n.auth.fields),{},{basicAuth:null===(t=(0,x.Z)(n.auth.fields.basicAuth))||void 0===t?void 0:t.map((function(n){return"user"===n.name?(0,h.Z)((0,h.Z)({},n),{},{value:U().sanitize(a.value)}):"password"===n.name?(0,h.Z)((0,h.Z)({},n),{},{value:U().sanitize(u.value)}):n}))})})})}));localStorage.setItem("dataSources",JSON.stringify(r)),f((0,b.Z)(r)),f((0,Z.el)({type:"success",message:"Set same URL and Basic Auth for All Data Sources"}))},primary:!0})]})]}),(0,I.jsx)("div",{className:"ds-settings",children:(0,I.jsx)(rn,(0,h.Z)({},n))})]})}var sn,on,ln,cn,dn,fn=function(n){var e=n.icon,t=n.name,i=n.type,r=n.url;return(0,I.jsxs)("div",{className:"ds-item",children:[(0,I.jsx)(N.JO,{icon:e}),(0,I.jsxs)("div",{className:"ds-text",children:[(0,I.jsx)("div",{className:"ds-type",children:t}),(0,I.jsxs)("small",{children:[U().sanitize(i)," | ",U().sanitize(r)]})]})]})};function vn(){var n=(0,v.UO)().id,e=(0,d.v9)((function(n){return n})).theme,t=(0,d.v9)((function(n){return n.dataSources})),i=(0,c.useMemo)((function(){return t&&0!==t.length&&t.find((function(e){return e.id===n}))||{}}),[n,t]),r=S.n;return(0,I.jsx)(l.a,{theme:r[e],children:(0,I.jsx)(Y,{children:(0,I.jsxs)("div",{className:"body-cont",children:[(0,I.jsx)(q,{title:"DataSource Settings",datasource:i}),(0,I.jsx)("div",{className:"datasource-body",children:(0,I.jsx)(un,(0,h.Z)({},i))})]})})})}var hn=function(n){return(0,m.iv)(sn||(sn=(0,p.Z)(["\n display: flex;\n flex-direction: column;\n flex: 1;\n flex-wrap: wrap;\n width: 400px;\n border: 1px solid ",";\n padding: 5px;\n border-radius: 3px;\n margin-left:10px;\n"])),n.buttonBorder)},xn=(0,m.iv)(on||(on=(0,p.Z)(["\n display: flex;\n padding: 4px 12px;\n font-size: 14px;\n border-radius: 4px;\n white-space: nowrap;\n align-items: center;\n justify-content: space-between;\n"]))),pn=(0,m.iv)(ln||(ln=(0,p.Z)(["\n margin: 5px;\n"]))),mn=(0,m.iv)(cn||(cn=(0,p.Z)(["\n margin-left: 20px;\n display: flex;\n align-items: center;\n span {\n font-size: 12px;\n }\n"]))),gn=(0,m.iv)(dn||(dn=(0,p.Z)(["\n align-items: center;\n width: 100%;\n display: flex;\n margin-top: 10px;\n justify-content: space-between;\n flex: 1;\n"]))),Zn=function(n){var e=(0,c.useState)(""),t=(0,s.Z)(e,2),i=t[0],r=t[1],a=(0,c.useState)(""),u=(0,s.Z)(a,2),o=u[0],l=u[1],f=(0,c.useState)(""),v=(0,s.Z)(f,2),p=v[0],g=v[1],Z=(0,c.useState)(!1),S=(0,s.Z)(Z,2),j=S[0],y=S[1],k=(0,c.useState)(!1),z=(0,s.Z)(k,2),w=z[0],C=z[1],J=(0,d.v9)((function(n){return n.dataSources})),T=(0,d.I0)(),A=(0,O.Fg)();return(0,I.jsxs)("div",{className:(0,m.cx)(hn(A)),children:[(0,I.jsxs)("div",{className:(0,m.cx)(xn),children:["Use one setting for all Data Sources",(0,I.jsx)(P.Z,{checked:j,size:"small",onChange:function(n){y((function(){return n.target.checked}))}})]}),j&&(0,I.jsxs)("div",{className:(0,m.cx)(pn),children:[(0,I.jsx)(N.gN,{value:U().sanitize(i),label:"url",onChange:function(n){var e,t=((null===n||void 0===n||null===(e=n.target)||void 0===e?void 0:e.value)||"").replace(/\/$/,"");r((function(){return t}))},placeholder:"http://qryn.dev"}),w&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N.gN,{value:U().sanitize(o),label:"user",onChange:function(n){l((function(){return n.target.value}))},placeholder:"default"}),(0,I.jsx)(N.gN,{value:U().sanitize(p),label:"password",onChange:function(n){g((function(){return n.target.value}))},type:"password",placeholder:""})]}),(0,I.jsxs)("div",{className:(0,m.cx)(gn),children:[(0,I.jsxs)("div",{className:(0,m.cx)(mn),children:[(0,I.jsx)("span",{children:"Use Basic Auth"})," ",(0,I.jsx)(P.Z,{checked:w,size:"small",onChange:function(n){C((function(){return n.target.checked}))}})," "]}),(0,I.jsx)(N.zx,{value:U().sanitize("Save"),onClick:function(n){var e=JSON.parse(JSON.stringify(J)),t=null===e||void 0===e?void 0:e.map((function(n){var e;return(0,h.Z)((0,h.Z)({},n),{},{url:i,auth:(0,h.Z)((0,h.Z)({},n.auth),{},{basicAuth:(0,h.Z)((0,h.Z)({},n.auth.basicAuth),{},{value:w}),fields:(0,h.Z)((0,h.Z)({},n.auth.fields),{},{basicAuth:null===(e=(0,x.Z)(n.auth.fields.basicAuth))||void 0===e?void 0:e.map((function(n){return"user"===n.name?(0,h.Z)((0,h.Z)({},n),{},{value:o}):"password"===n.name?(0,h.Z)((0,h.Z)({},n),{},{value:p}):n}))})})})}));localStorage.setItem("dataSources",JSON.stringify(t)),T((0,b.Z)(t))},editing:!1,primary:!0})]})]})]})},Sn=t(66367);function jn(n){var e,t=n.replace(/#/,""),i=decodeURIComponent(t),r=new URLSearchParams(i),a={left:"",right:""},u=(0,o.Z)(r);try{for(u.s();!(e=u.n()).done;){var l=(0,s.Z)(e.value,2),c=l[0],d=l[1];"left"!==c&&"right"!==c||(a[c]=JSON.parse(d))}}catch(f){u.e(f)}finally{u.f()}}function yn(){var n=(0,Sn.useMediaQuery)({query:"(prefers-color-scheme: dark)"}),e=(0,d.I0)(),t=(0,O.Fg)(),i=(0,d.v9)((function(n){return n.autoTheme}));return(0,c.useEffect)((function(){if(i){var t=n?"dark":"light";e((0,Z.Dc)(t)),localStorage.setItem("theme",JSON.stringify({theme:t,auto:i}))}}),[n,i,e]),(0,I.jsxs)(l.a,{theme:t,children:[(0,I.jsx)(f._z,{children:(0,I.jsxs)("div",{className:"cont",children:[(0,I.jsx)(en,{}),(0,I.jsx)("div",{style:{display:"flex",flex:1},children:(0,I.jsx)("div",{style:{height:"40px"},children:(0,I.jsx)(Zn,{})})})]})}),(0,I.jsx)(v.Z5,{children:(0,I.jsx)(v.AW,{path:":id",element:(0,I.jsx)(vn,{})})})]})}},9964:function(n,e){"use strict";e.Z=function(n){return function(e){e({type:"SET_DATA_SOURCES",dataSources:n})}}},95334:function(n,e,t){"use strict";var i=t(64836);e.Z=void 0;var r=i(t(45045)),a=t(46417),u=(0,r.default)((0,a.jsx)("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}),"CachedOutlined");e.Z=u},16450:function(n,e,t){"use strict";var i=t(64836);e.Z=void 0;var r=i(t(45045)),a=t(46417),u=(0,r.default)((0,a.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");e.Z=u},25026:function(n,e,t){"use strict";var i=t(64836);e.Z=void 0;var r=i(t(45045)),a=t(46417),u=(0,r.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4h-3.5z"}),"DeleteOutlineOutlined");e.Z=u},59236:function(n,e,t){"use strict";var i=t(64836);e.Z=void 0;var r=i(t(45045)),a=t(46417),u=(0,r.default)((0,a.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline");e.Z=u},45045:function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i.createSvgIcon}});var i=t(28308)},47228:function(n,e,t){"use strict";t.d(e,{Z:function(){return i}});var i=function(n){var e,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function i(){for(var i=this,r=arguments.length,a=new Array(r),u=0;u0){var u=(0,h.Z)((0,h.Z)({},r[r.length-1]),{},{id:(0,y.x0)()}),s=(0,h.Z)((0,h.Z)({},i),{},{headers:[].concat((0,x.Z)(i.headers),[u])}),c=null===a||void 0===a?void 0:a.map((function(n){return n.id===l?(0,h.Z)({},s):n}));localStorage.setItem("dataSources",JSON.stringify(c)),e((0,b.Z)(c))}}}),(0,I.jsxs)(f.zs,{children:[(0,I.jsx)(f.__,{children:"Use CORS"})," ",(0,I.jsx)(P.Z,{size:"small",checked:m,onChange:function(n){var i=n.target.checked,r=t.map((function(n){return n.id===l&&(n.cors=i),n}));g((function(){return i})),localStorage.setItem("dataSources",JSON.stringify(r)),e((0,b.Z)(r))}})]}),null===o||void 0===o?void 0:o.map((function(n,i){return(0,I.jsx)(f.zs,{children:(0,I.jsxs)(f.BZ,{children:[(0,I.jsx)(N.gN,{label:"header",value:U().sanitize(n.header),onChange:function(e){return Z(e,n.id,"header")}}),(0,I.jsx)(N.gN,{label:"value",value:U().sanitize(n.value),onChange:function(e){return Z(e,n.id,"value")}}),(0,I.jsx)(j.Z,{onClick:function(i){return function(n,i){var r=null===t||void 0===t?void 0:t.find((function(n){return n.id===l})),a=(0,x.Z)(o).filter((function(n){return n.id!==i})),u=(0,h.Z)((0,h.Z)({},r),{},{headers:(0,x.Z)(a)}),s=null===t||void 0===t?void 0:t.map((function(n){return n.id===l?(0,h.Z)({},u):n}));localStorage.setItem("dataSources",JSON.stringify(s)),e((0,b.Z)(s))}(0,n.id)},style:{cursor:"pointer",marginLeft:"10px"},fontSize:"small"})]})},i)}))]})})};function q(n){var e=(0,v.s0)(),t=(0,O.Fg)(),i=(0,d.v9)((function(n){return n.urlLocation})),r=(0,d.I0)(),a=n.title,u=(0,d.v9)((function(n){return n.isDsSaved})),s=(0,c.useMemo)((function(){return u?"Save":"Back"}),[u]);return(0,I.jsxs)("div",{className:"ds-header",children:[(0,I.jsx)("div",{style:{display:"flex",alignItems:"center"},children:(0,I.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,I.jsxs)("div",{style:{display:"flex"},children:[(0,I.jsx)(N.D8,{}),(0,I.jsx)("h1",{children:a})]}),(0,I.jsxs)("p",{style:{color:t.textColor,fontSize:"10px",marginTop:"5px",marginLeft:"10px",opacity:".5"},children:["v","0.25.6"]})]})}),(0,I.jsx)(N.zx,{value:U().sanitize(s),onClick:function(){var n=(null===i||void 0===i?void 0:i.length)>0;r(C(!1)),e(!n&&"Back"!==s||"DataSources"===a?"/":-1)},editing:!0,primary:u})]})}var B=t(4942),H=function(n){var e=n.id,t=n.name,i=n.regex,r=n.urlLabel,a=n.internalLink,u=n.linkType,s=n.locked,o=n.dataSourceId,l=n.fieldEditing,v=(0,d.I0)(),p=(0,d.v9)((function(n){return n.dataSources})),m=(0,c.useMemo)((function(){return p.map((function(n){return{name:n.name,value:n.id}}))}),[p]),g=function(n,t){l();var i=JSON.parse(JSON.stringify(p)),r=i.find((function(n){return n.id===o})).linkedFields.map((function(i){return i.id===e?(0,h.Z)((0,h.Z)({},i),{},(0,B.Z)({},n,t)):i}));return i.map((function(n){return n.id===o?(0,h.Z)((0,h.Z)({},n),{},{linkedFields:r}):n}))},Z=function(n,e){l();var t=n.target.value,i=g(e,t);localStorage.setItem("dataSources",JSON.stringify(i)),v((0,b.Z)(i))};return(0,I.jsxs)(f.X9,{children:[(0,I.jsxs)(f.zs,{children:[(0,I.jsx)(N.gN,{value:U().sanitize(t),label:"Name",onChange:function(n){return Z(n,"name")}}),(0,I.jsx)(N.gN,{value:U().sanitize(i),label:"Regex",onChange:function(n){return Z(n,"regex")}}),(0,I.jsx)(N.gN,{value:U().sanitize(r),label:"URL Label",onChange:function(n){return Z(n,"urlLabel")}}),(0,I.jsx)(j.Z,{onClick:function(n){l();var t=JSON.parse(JSON.stringify(p)),i=t.find((function(n){return n.id===o})).linkedFields.filter((function(n){return n.id!==e})),r=t.map((function(n){return n.id===o?(0,h.Z)((0,h.Z)({},n),{},{linkedFields:(0,x.Z)(i)}):n}));localStorage.setItem("dataSources",JSON.stringify(r)),v((0,b.Z)(r))},fontSize:"small",style:{marginLeft:"10px",cursor:"pointer",display:s?"none":"inline-block"}})]}),(0,I.jsxs)(f.zs,{className:"internal",children:[(0,I.jsx)(N.ll,{value:a,label:"Internal Link",onChange:function(n){return function(n,e){l();var t=Boolean(n.target.checked),i=g(e,t);localStorage.setItem("dataSources",JSON.stringify(i)),v((0,b.Z)(i))}(n,"internalLink")}}),(0,I.jsx)(N.Ph,{label:"",value:U().sanitize(u),opts:m,selectType:"linkedField",onChange:function(n){return Z(n,"linkID")}})]})]})},V=t(15671),$=t(43144),W=function(){function n(){(0,V.Z)(this,n),this.id=void 0,this.dataSource=void 0,this.ds_id=void 0,this.name=void 0,this.regex=void 0,this.query=void 0,this.urlLabel=void 0,this.url=void 0,this.internalLink=void 0,this.linkType=void 0,this.id=(0,y.x0)(),this.dataSource="Logs",this.ds_id="logs",this.name="traceID",this.regex='^.*?"traceID" ="(w+)".*$/',this.query="${__value.raw}",this.urlLabel="",this.url="",this.internalLink=!0,this.linkType="Traces"}return(0,$.Z)(n,[{key:"create",value:function(){return{id:this.id,dataSource:this.dataSource,ds_id:this.ds_id,name:this.name,regex:this.regex,query:this.query,urlLabel:this.urlLabel,url:this.url,internalLink:this.internalLink,linkType:this.linkType}}}]),n}(),G=function(n){var e=n.linkedFields,t=n.name,i=n.id,r=(0,d.v9)((function(n){return n.dataSources})),a=(0,d.I0)(),u=(0,c.useState)(!1),o=(0,s.Z)(u,2),l=o[0],v=o[1],p=function(){v((function(){return!0})),setTimeout((function(){v((function(){return!1}))}),800)};return(null===e||void 0===e?void 0:e.length)>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(F,{title:"Linked Fields",isEdit:!0,isAdd:!0,onClickAdd:function(){var n=new W;n.dataSource=t,n.create();var u=JSON.parse(JSON.stringify(e)),s=[].concat((0,x.Z)(u),[(0,h.Z)({},n)]),o=JSON.parse(JSON.stringify(r)),l=null===o||void 0===o?void 0:o.map((function(n){return n.id===i?(0,h.Z)((0,h.Z)({},n),{},{linkedFields:s}):n}));localStorage.setItem("dataSources",JSON.stringify(l)),a((0,b.Z)(l))},isEditing:l}),(0,I.jsx)(f.VJ,{children:null===e||void 0===e?void 0:e.map((function(n,e){return(0,I.jsx)(H,(0,h.Z)((0,h.Z)({},n),{},{dataSourceId:i,locked:!1,fieldEditing:p}),e)}))})]}):null};function K(n){var e=n.value,t=n.label,i=n.onChange,r=n.placeholder;return(0,I.jsxs)(f.BZ,{children:[(0,I.jsx)(f.__,{children:t}),(0,I.jsx)(f.Kx,{className:"ds-input",onChange:i,placeholder:r,value:U().sanitize(e)})]})}function Q(n){var e=n.auth,t=n.id,i=(0,d.I0)(),r=(0,d.v9)((function(n){return n.dataSources})),a=(0,c.useState)([]),u=(0,s.Z)(a,2),o=u[0],l=u[1],v=(0,c.useState)(!1),p=(0,s.Z)(v,2),m=p[0],g=p[1],Z=(0,c.useMemo)((function(){var n;return null===(n=Object.entries(e))||void 0===n?void 0:n.map((function(n){var e=(0,s.Z)(n,2),t=e[0],i=e[1];return(0,h.Z)({name:t},i)})).filter((function(n){return"fields"!==n.name}))}),[e]),S=(0,c.useMemo)((function(){var n;return null===(n=Object.entries(e))||void 0===n?void 0:n.map((function(n){var e=(0,s.Z)(n,2),t=e[0],i=e[1];return(0,h.Z)({name:t},i)})).find((function(n){return"fields"===n.name}))}),[e]),j=function(n,a){var u=JSON.parse(JSON.stringify(e));u[a].value=n;var s=JSON.parse(JSON.stringify(r)).map((function(n){return n.id===t?(0,h.Z)((0,h.Z)({},n),{},{auth:(0,h.Z)({},u)}):n}));return localStorage.setItem("dataSources",JSON.stringify(s)),i((0,b.Z)(s)),s};(0,c.useEffect)((function(){var n,e,t=null===(n=Z.filter((function(n){return"switch"===n.form_type&&!(null===n||void 0===n||!n.value)})))||void 0===n||null===(e=n.filter((function(n){return!!n.withFields})))||void 0===e?void 0:e.map((function(n){return n.name}));l(t)}),[Z,l]);var y=function(n,a,u){var s;g((function(){return!0}));var o=n.target.value,l=JSON.parse(JSON.stringify(e)),c=(0,h.Z)((0,h.Z)({},l),{},{fields:(0,h.Z)((0,h.Z)({},l.fields),{},(0,B.Z)({},u,null===l||void 0===l||null===(s=l.fields[u])||void 0===s?void 0:s.map((function(n){return n.name===a?(n.value=o,(0,h.Z)({},n)):n}))))}),d=JSON.parse(JSON.stringify((0,x.Z)(r))),f=null===d||void 0===d?void 0:d.map((function(n){return n.id===t?(n.auth=c,n):n}));localStorage.setItem("dataSources",JSON.stringify(f)),i((0,b.Z)(f)),setTimeout((function(){g((function(){return!1}))}),600)};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(F,{title:"HTTP Auth Fields",isEditing:m,isEdit:!1,isAdd:!1}),(0,I.jsxs)(f.VJ,{children:[Z&&Z.map((function(n,e){return"select"===n.form_type?(0,I.jsx)(N.Ph,{value:U().sanitize(n.value),name:U().sanitize(n.name),onChange:function(e){return function(n,e){g((function(){return!0}));var t=n.target.value;j(t,e),setTimeout((function(){g((function(){return!1}))}),800)}(e,n.name)},locked:!1,opts:n.options,label:n.label},e):"switch"===n.form_type?(0,I.jsx)(N.ll,{label:n.label,value:n.value,onChange:function(e){return function(n,e){g((function(){return!0}));var t=n.target.checked;j(t,e),setTimeout((function(){g((function(){return!1}))}),800)}(e,n.name)}},e):null})),(0,I.jsx)(f.zs,{children:o&&o.map((function(n,e){var t;return(0,I.jsx)(f.zs,{children:S[n]&&(null===(t=S[n])||void 0===t?void 0:t.map((function(e,t){return"input"===e.form_type||"password"===e.form_type?(0,I.jsx)(N.gN,{onChange:function(t){return y(t,e.name,n)},type:e.form_type,value:U().sanitize(e.value),label:e.label,placeholder:e.placeholder},t):"textarea"===e.form_type?(0,I.jsx)(K,{onChange:function(t){return y(t,e.name,n)},value:U().sanitize(e.value),label:e.label,placeholder:e.placeholder},t):null})))},e)}))})]})]})}var X,Y=t(41801).Z.div(X||(X=(0,p.Z)(["\n position: absolute;\n left: 0;\n top: 0;\n background: ",";\n display: flex;\n flex-direction: culumn;\n justify-content: center;\n color: ",";\n flex: 1;\n height: 100%;\n width: 100%;\n\n .body-cont {\n max-width: 1440px;\n padding: 10px;\n margin: 10px;\n border-radius: 3px;\n flex: 1;\n background: ",";\n overflow-y: auto;\n overflow-x: hidden;\n }\n .ds-header {\n padding: 10px;\n padding-bottom: 20px;\n font-size: 24px;\n flex: 1;\n display: flex;\n width: 100%;\n justify-content: space-between;\n align-items: center;\n padding-left: 0px;\n .logo {\n margin-right: 10px;\n }\n }\n .ds-cont {\n margin-bottom: 10px;\n border: 1px solid ",";\n border-radius: 3px;\n overflow-y: auto;\n }\n .ds-item {\n padding: 10px;\n // margin-bottom: 10px;\n border-radius: 3px 3px 0px 0px;\n padding-bottom: 14px;\n display: flex;\n .logo {\n padding: 10px;\n padding-right: 20px;\n padding-left: 0px;\n }\n .ds-text {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n .ds-type {\n font-size: 18px;\n padding: 10px;\n padding-left: 0px;\n color: ",";\n }\n small {\n font-size: 12px;\n }\n .setting-icon {\n justify-self: flex-end;\n cursor: pointer;\n }\n .ds-settings {\n background: ",";\n }\n }\n"])),(function(n){return n.theme.viewBg}),(function(n){return n.theme.textColor}),(function(n){return n.theme.widgetContainer}),(function(n){return n.theme.buttonBorder}),(function(n){return n.theme.textColor}),(function(n){return n.theme.viewBg})),nn=t(2135);function en(){var n=(0,d.v9)((function(n){return n.dataSources}));return(null===n||void 0===n?void 0:n.length)>0?(0,I.jsx)("div",{style:{margin:"10px"},children:n.map((function(n,e){var t=n.icon,i=n.id,r=n.name,a=n.type,u=n.url;return(0,I.jsx)("div",{className:"ds-cont",children:(0,I.jsx)(nn.rU,{to:i,children:(0,I.jsxs)("div",{className:"ds-item",children:[(0,I.jsx)(N.JO,{icon:t}),(0,I.jsxs)("div",{className:"ds-text",children:[(0,I.jsx)("div",{className:"ds-type",children:r}),(0,I.jsxs)("span",{children:[(0,I.jsxs)("small",{children:[a," | "," "]}),(0,I.jsx)("small",{style:{userSelect:"all"},children:u})]})]})]})})},e)}))}):(0,I.jsx)("div",{children:(0,I.jsx)("h1",{children:"No Data Sources Found."})})}var tn,rn=function(n){var e=n.headers,t=n.id,i=n.linkedFields,r=n.name,a=n.url,u=n.cors,o=(0,d.I0)(),l=(0,d.v9)((function(n){return n.dataSources})),v=(0,c.useState)({url:!1,protocol:!1}),x=(0,s.Z)(v,2),p=x[0],m=x[1],g=function(n,e){var i=e;if("url"===n){var r=e.replace(/\/$/,"");i=r}var a=JSON.parse(JSON.stringify(l));return a.forEach((function(e){e.id===t&&(e[n]=i)})),a},Z=(0,c.useState)(!1),S=(0,s.Z)(Z,2),j=S[0],y=S[1],k=function(n,e){y((function(){return!0}));var t=n.target.value;if("url"===e){var i=function(e){try{return{value:window.location.protocol===new URL(e).protocol,error:""}}catch(n){return{value:!1,error:"url"}}}(t);if("url"===(null===i||void 0===i?void 0:i.error)&&m((function(n){return(0,h.Z)((0,h.Z)({},n),{},{url:!0})})),null!==i&&void 0!==i&&i.value||""!==(null===i||void 0===i?void 0:i.error)||m((function(n){return(0,h.Z)((0,h.Z)({},n),{},{protocol:!0})})),""===(null===i||void 0===i?void 0:i.error)&&null!==i&&void 0!==i&&i.value){m((function(n){return(0,h.Z)((0,h.Z)({},n),{},{protocol:!1,url:!1})}));var r=g(e,t);localStorage.setItem("dataSources",JSON.stringify(r)),o((0,b.Z)(r)),setTimeout((function(){y((function(){return!1}))}),800)}}var a=g(e,t);localStorage.setItem("dataSources",JSON.stringify(a)),o((0,b.Z)(a)),setTimeout((function(){y((function(){return!1}))}),800)};return(0,I.jsxs)(f.jy,{children:[(0,I.jsx)(F,{isEditing:j,isEdit:!0,isAdd:!1,title:"DataSource Settings",fieldErrors:p}),(0,I.jsx)(f.VJ,{children:(0,I.jsxs)(f.zs,{children:[(0,I.jsx)(N.gN,{value:U().sanitize(r),label:"Name",onChange:function(n){return k(n,"name")}}),(0,I.jsx)(N.gN,{value:U().sanitize(a),label:"URL",error:p.url||p.protocol,onChange:function(n){return k(n,"url")}})]})}),(0,I.jsx)(Q,(0,h.Z)({},n)),(0,I.jsx)(R,{cors:u,headers:e,id:t}),(0,I.jsx)(G,(0,h.Z)((0,h.Z)({},n),{},{linkedFields:i}))]})},an=(0,m.iv)(tn||(tn=(0,p.Z)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-right: 20px;\n"])));function un(n){var e=n.url,t=n.auth,i=t.basicAuth,r=(0,s.Z)(t.fields.basicAuth,2),a=r[0],u=r[1],o=(0,g.Z)(["qryn-dev-cookie","qryn-settings"]),l=(0,s.Z)(o,2),c=(l[0],l[1]),f=(0,d.I0)(),v=(0,d.v9)((function(n){return n.dataSources}));return(0,I.jsxs)("div",{className:"ds-cont",children:[(0,I.jsxs)("div",{className:(0,m.cx)(an),children:[(0,I.jsx)(fn,(0,h.Z)({},n)),(0,I.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,I.jsx)(N.zx,{title:"Set Cookie with name: qryn-settings",value:U().sanitize("Save Cookie"),onClick:function(){var n=new Date;(new Date).setDate(n.getDate()+1);var t=JSON.stringify({url:e});try{c("qryn-settings","".concat(btoa(a.value),":").concat(btoa(u.value),"@").concat(btoa(t),"&&").concat(btoa("admin")),{path:"/"})}catch(i){console.log(i)}},primary:!0}),(0,I.jsx)(N.zx,{title:"Use same URL and Basic Auth for all Data Sources",value:U().sanitize("Use For All"),onClick:function(){var n=(0,x.Z)(v),t=JSON.parse(JSON.stringify(n)),r=null===t||void 0===t?void 0:t.map((function(n){var t;return(0,h.Z)((0,h.Z)({},n),{},{url:U().sanitize(e),auth:(0,h.Z)((0,h.Z)({},n.auth),{},{basicAuth:(0,h.Z)((0,h.Z)({},n.auth.basicAuth),{},{value:i.value}),fields:(0,h.Z)((0,h.Z)({},n.auth.fields),{},{basicAuth:null===(t=(0,x.Z)(n.auth.fields.basicAuth))||void 0===t?void 0:t.map((function(n){return"user"===n.name?(0,h.Z)((0,h.Z)({},n),{},{value:U().sanitize(a.value)}):"password"===n.name?(0,h.Z)((0,h.Z)({},n),{},{value:U().sanitize(u.value)}):n}))})})})}));localStorage.setItem("dataSources",JSON.stringify(r)),f((0,b.Z)(r)),f((0,Z.el)({type:"success",message:"Set same URL and Basic Auth for All Data Sources"}))},primary:!0})]})]}),(0,I.jsx)("div",{className:"ds-settings",children:(0,I.jsx)(rn,(0,h.Z)({},n))})]})}var sn,on,ln,cn,dn,fn=function(n){var e=n.icon,t=n.name,i=n.type,r=n.url;return(0,I.jsxs)("div",{className:"ds-item",children:[(0,I.jsx)(N.JO,{icon:e}),(0,I.jsxs)("div",{className:"ds-text",children:[(0,I.jsx)("div",{className:"ds-type",children:t}),(0,I.jsxs)("small",{children:[U().sanitize(i)," | ",U().sanitize(r)]})]})]})};function vn(){var n=(0,v.UO)().id,e=(0,d.v9)((function(n){return n})).theme,t=(0,d.v9)((function(n){return n.dataSources})),i=(0,c.useMemo)((function(){return t&&0!==t.length&&t.find((function(e){return e.id===n}))||{}}),[n,t]),r=S.n;return(0,I.jsx)(l.a,{theme:r[e],children:(0,I.jsx)(Y,{children:(0,I.jsxs)("div",{className:"body-cont",children:[(0,I.jsx)(q,{title:"DataSource Settings",datasource:i}),(0,I.jsx)("div",{className:"datasource-body",children:(0,I.jsx)(un,(0,h.Z)({},i))})]})})})}var hn=function(n){return(0,m.iv)(sn||(sn=(0,p.Z)(["\n display: flex;\n flex-direction: column;\n flex: 1;\n flex-wrap: wrap;\n width: 400px;\n border: 1px solid ",";\n padding: 5px;\n border-radius: 3px;\n margin-left:10px;\n"])),n.buttonBorder)},xn=(0,m.iv)(on||(on=(0,p.Z)(["\n display: flex;\n padding: 4px 12px;\n font-size: 14px;\n border-radius: 4px;\n white-space: nowrap;\n align-items: center;\n justify-content: space-between;\n"]))),pn=(0,m.iv)(ln||(ln=(0,p.Z)(["\n margin: 5px;\n"]))),mn=(0,m.iv)(cn||(cn=(0,p.Z)(["\n margin-left: 20px;\n display: flex;\n align-items: center;\n span {\n font-size: 12px;\n }\n"]))),gn=(0,m.iv)(dn||(dn=(0,p.Z)(["\n align-items: center;\n width: 100%;\n display: flex;\n margin-top: 10px;\n justify-content: space-between;\n flex: 1;\n"]))),Zn=function(n){var e=(0,c.useState)(""),t=(0,s.Z)(e,2),i=t[0],r=t[1],a=(0,c.useState)(""),u=(0,s.Z)(a,2),o=u[0],l=u[1],f=(0,c.useState)(""),v=(0,s.Z)(f,2),p=v[0],g=v[1],Z=(0,c.useState)(!1),S=(0,s.Z)(Z,2),j=S[0],y=S[1],k=(0,c.useState)(!1),z=(0,s.Z)(k,2),w=z[0],C=z[1],J=(0,d.v9)((function(n){return n.dataSources})),T=(0,d.I0)(),A=(0,O.Fg)();return(0,I.jsxs)("div",{className:(0,m.cx)(hn(A)),children:[(0,I.jsxs)("div",{className:(0,m.cx)(xn),children:["Use one setting for all Data Sources",(0,I.jsx)(P.Z,{checked:j,size:"small",onChange:function(n){y((function(){return n.target.checked}))}})]}),j&&(0,I.jsxs)("div",{className:(0,m.cx)(pn),children:[(0,I.jsx)(N.gN,{value:U().sanitize(i),label:"url",onChange:function(n){var e,t=((null===n||void 0===n||null===(e=n.target)||void 0===e?void 0:e.value)||"").replace(/\/$/,"");r((function(){return t}))},placeholder:"http://qryn.dev"}),w&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(N.gN,{value:U().sanitize(o),label:"user",onChange:function(n){l((function(){return n.target.value}))},placeholder:"default"}),(0,I.jsx)(N.gN,{value:U().sanitize(p),label:"password",onChange:function(n){g((function(){return n.target.value}))},type:"password",placeholder:""})]}),(0,I.jsxs)("div",{className:(0,m.cx)(gn),children:[(0,I.jsxs)("div",{className:(0,m.cx)(mn),children:[(0,I.jsx)("span",{children:"Use Basic Auth"})," ",(0,I.jsx)(P.Z,{checked:w,size:"small",onChange:function(n){C((function(){return n.target.checked}))}})," "]}),(0,I.jsx)(N.zx,{value:U().sanitize("Save"),onClick:function(n){var e=JSON.parse(JSON.stringify(J)),t=null===e||void 0===e?void 0:e.map((function(n){var e;return(0,h.Z)((0,h.Z)({},n),{},{url:i,auth:(0,h.Z)((0,h.Z)({},n.auth),{},{basicAuth:(0,h.Z)((0,h.Z)({},n.auth.basicAuth),{},{value:w}),fields:(0,h.Z)((0,h.Z)({},n.auth.fields),{},{basicAuth:null===(e=(0,x.Z)(n.auth.fields.basicAuth))||void 0===e?void 0:e.map((function(n){return"user"===n.name?(0,h.Z)((0,h.Z)({},n),{},{value:o}):"password"===n.name?(0,h.Z)((0,h.Z)({},n),{},{value:p}):n}))})})})}));localStorage.setItem("dataSources",JSON.stringify(t)),T((0,b.Z)(t))},editing:!1,primary:!0})]})]})]})},Sn=t(66367);function jn(n){var e,t=n.replace(/#/,""),i=decodeURIComponent(t),r=new URLSearchParams(i),a={left:"",right:""},u=(0,o.Z)(r);try{for(u.s();!(e=u.n()).done;){var l=(0,s.Z)(e.value,2),c=l[0],d=l[1];"left"!==c&&"right"!==c||(a[c]=JSON.parse(d))}}catch(f){u.e(f)}finally{u.f()}}function yn(){var n=(0,Sn.useMediaQuery)({query:"(prefers-color-scheme: dark)"}),e=(0,d.I0)(),t=(0,O.Fg)(),i=(0,d.v9)((function(n){return n.autoTheme}));return(0,c.useEffect)((function(){if(i){var t=n?"dark":"light";e((0,Z.Dc)(t)),localStorage.setItem("theme",JSON.stringify({theme:t,auto:i}))}}),[n,i,e]),(0,I.jsxs)(l.a,{theme:t,children:[(0,I.jsx)(f._z,{children:(0,I.jsxs)("div",{className:"cont",children:[(0,I.jsx)(en,{}),(0,I.jsx)("div",{style:{display:"flex",flex:1},children:(0,I.jsx)("div",{style:{height:"40px"},children:(0,I.jsx)(Zn,{})})})]})}),(0,I.jsx)(v.Z5,{children:(0,I.jsx)(v.AW,{path:":id",element:(0,I.jsx)(vn,{})})})]})}},9964:function(n,e){"use strict";e.Z=function(n){return function(e){e({type:"SET_DATA_SOURCES",dataSources:n})}}},95334:function(n,e,t){"use strict";var i=t(64836);e.Z=void 0;var r=i(t(45045)),a=t(46417),u=(0,r.default)((0,a.jsx)("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}),"CachedOutlined");e.Z=u},16450:function(n,e,t){"use strict";var i=t(64836);e.Z=void 0;var r=i(t(45045)),a=t(46417),u=(0,r.default)((0,a.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");e.Z=u},25026:function(n,e,t){"use strict";var i=t(64836);e.Z=void 0;var r=i(t(45045)),a=t(46417),u=(0,r.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4h-3.5z"}),"DeleteOutlineOutlined");e.Z=u},59236:function(n,e,t){"use strict";var i=t(64836);e.Z=void 0;var r=i(t(45045)),a=t(46417),u=(0,r.default)((0,a.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline");e.Z=u},45045:function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i.createSvgIcon}});var i=t(28308)},47228:function(n,e,t){"use strict";t.d(e,{Z:function(){return i}});var i=function(n){var e,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function i(){for(var i=this,r=arguments.length,a=new Array(r),u=0;u1&&void 0!==arguments[1]?arguments[1]:"logs";if("flux"===n||"traces"===n)try{return e}catch(m){console.log(m)}else{var t=Ne(e);try{for(var r=[],i=e.length,a=t.length,o=0;o1&&void 0!==arguments[1]?arguments[1]:"logs",a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=null===(n=A.Z.getState())||void 0===n||null===(t=n[o.panel])||void 0===t?void 0:t.find((function(e){return e.id===o.id}));s&&(o.dataSourceId=s.dataSourceId,o.url=s.dataSourceURL);var u=null===(r=A.Z.getState())||void 0===r?void 0:r.theme,c=Ve.n[u];return e.length>0&&"traces"===i?null===e||void 0===e?void 0:e.map((function(e){return"durationMs"===e.accessorKey?{header:"Duration Ms",accessorKey:e.accessorKey,cell:function(e){return function(e){return e.getValue()+" ms"}(e)}}:"startTimeUnixNano"===e.accessorKey?{header:"Start Time",accessorKey:e.accessorKey,cell:function(e){return function(e){return new Oe.Z("en-US").format(e.getValue()/1e6)}(e)}}:"traceID"===e.accessorKey||"traceId"===e.accessorKey?{header:"Trace Id",accessorKey:e.accessorKey,cell:function(e){return(0,Fe.jsx)("button",{onClick:function(n){return function(e,t){var r=A.Z.dispatch,i=A.Z.getState()[e.panel],a=A.Z.getState().right,o=window.innerWidth<=1013,s=i.find((function(n){return n.id===e.id}));"left"!==e.panel||o||r(w(!0));var u=JSON.parse(JSON.stringify(a)),c=JSON.parse(JSON.stringify(s));try{var d=(0,l.Z)((0,l.Z)({},u[0]),{},{id:u[0].id,idRef:"Trace "+t,panel:"right",queryType:"range",dataSourceType:"traces",dataSourceId:e.dataSourceId,dataSourceURL:e.url,expr:t,limit:100,step:100,tableView:!1,chartView:!1,isShowTs:!1,isBuilder:!1,isLogsVolume:!1,browserOpen:!1,open:!0,labels:[],values:[],direction:"backwards"});r(x([d])),r(Tn("traces",t,"range",c.limit||100,"right",d.id,"backwards",e.dataSourceId,e.url))}catch(n){console.log(n)}}(o,e.getValue())},className:(0,ze.cx)(He(c)),children:e.getValue()})}}:"rootServiceName"===e.accessorKey?{header:"Service Name",accessorKey:e.accessorKey,cell:function(e){return e.getValue()}}:"rootTraceName"===e.accessorKey?{header:"Trace Name",accessorKey:e.accessorKey,cell:function(e){return e.getValue()}}:e})):e.length>0&&"flux"===i?null===e||void 0===e?void 0:e.map((function(e){return e.accessorKey===a||"_time"===e.accessorKey?{header:"Time",accessorKey:e.accessorKey,cell:function(e){return function(e){return Be(e.getValue()).format("YYYY-MM-DDTHH:mm:ss.SSZ")}(e)}}:e})):e.length>0?[{header:"Time",accessorKey:"time",cell:function(e){return function(e){return Be(parseInt(e.getValue()+"000")).format("YYYY-MM-DDTHH:mm:ss.SSZ")}(e)}}].concat((0,H.Z)(e),[{header:"Value",accessorKey:"value"}]):[]}function qe(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"logs",t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=null===e||void 0===e?void 0:e.map((function(e){return{header:e,accessorKey:e,id:e,cell:function(e){return e.getValue()}}}));return Pe(i,n,t,r)}Oe.Z.addDefaultLocale(Le.Z);var Ae=function(e){return function(n){n({type:"SET_LEFT_DATAVIEW",leftDataView:e})}},Qe=function(e){return function(n){n({type:"SET_RIGHT_DATAVIEW",rightDataView:e})}};function We(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}function Ue(e){var n=e.result,t=e.debugMode,r=e.dispatch,i=e.panel,a=e.id,o=e.type,s=e.dsType,c=e.raw,f={panel:i,id:a,type:o};if("traces"===o)try{var p=Me(n);if(p.length>0){var v=function(e){var n=e[0],t=Object.entries(n);if(t){var r=t.find((function(e){var n=(0,u.Z)(e,2),t=(n[0],n[1]);return d().isDate(t)}));return(null===r||void 0===r?void 0:r[0])||null}}(n),h=qe(p,o,v,{panel:i,id:a,type:o}),g=Ee(n,o),m={columnsData:h,dataRows:g,panel:i,id:a};if((null===h||void 0===h?void 0:h.length)>0&&(null===g||void 0===g?void 0:g.length)>0){var x,b,y={id:a,type:"vector",raw:c,dsType:s,data:{tableData:m},tableData:m,total:(null===m||void 0===m||null===(x=m.dataRows)||void 0===x?void 0:x.length)||0},Z=We(i),w=Z.action,S=Z.state,j=null===(b=A.Z.getState())||void 0===b?void 0:b[S];if(j.some((function(e){return e.id===y.id}))){r(w([]));var k=j.filter((function(e){return e.id!==y.id}));r(w([].concat((0,H.Z)(k),[(0,l.Z)({},y)])))}else{r(w([].concat((0,H.Z)(j),[y])))}}}}catch($){console.log($)}else if("flux"===o)try{var C=Me(n);if(C.length>0){var T=function(e){var n=e[0],t=Object.entries(n);if(t){var r=t.find((function(e){var n=(0,u.Z)(e,2),t=(n[0],n[1]);return d().isDate(t)}));return(null===r||void 0===r?void 0:r[0])||null}}(n),_=qe(C,o,T,f),I=Ee(n,o),D={columnsData:_,dataRows:I,panel:i,id:a};if((null===_||void 0===_?void 0:_.length)>0&&(null===I||void 0===I?void 0:I.length)>0){var N,M,E={id:a,type:"vector",data:{tableData:D},raw:c,dsType:s,tableData:D,total:(null===D||void 0===D||null===(N=D.dataRows)||void 0===N?void 0:N.length)||0},R=We(i),O=R.action,L=R.state,V=null===(M=A.Z.getState())||void 0===M?void 0:M[L];if(V.some((function(e){return e.id===E.id}))){r(O([]));var z=V.filter((function(e){return e.id!==E.id}));r(O([].concat((0,H.Z)(z),[(0,l.Z)({},E)])))}else{r(O([].concat((0,H.Z)(V),[E])))}}}}catch($){console.log($)}else try{var F=Ne(n);if(F.length>0){var B=qe(F,o,null,f),P=Ee(n),q={columnsData:B,dataRows:P,panel:i,id:a};if(B.length>0&&P.length>0){var Q,W,U={id:a,type:"vector",data:{tableData:q}||{},raw:c,dsType:s,tableData:q||{},total:(null===q||void 0===q||null===(Q=q.dataRows)||void 0===Q?void 0:Q.length)||0},J=We(i),G=J.action,K=J.state,Y=null===(W=A.Z.getState())||void 0===W?void 0:W[K];if(Y.some((function(e){return e.id===U.id}))){r(G([]));var X=Y.filter((function(e){return e.id!==U.id}));r(G([].concat((0,H.Z)(X),[(0,l.Z)({},U)])))}else{r(G([].concat((0,H.Z)(Y),[U])))}}}}catch($){t&&console.log("\ud83d\udea7 getData / getting an error from rendering vector type streams"),console.log($)}}function Je(e){return(null===e||void 0===e?void 0:e.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{id:(0,Ie.x0)()})})))||[]}function Ge(e){var n,t=[{header:"Time",accessorKey:"time",cell:function(e){return function(e){return d()(e.getValue()).format("YYYY-MM-DDTHH:mm:ss.SSZ")}(e)}},{header:"Metric",accessorKey:"metric"},{header:"Value",accessorKey:"value"}],r=function(e){return e.map((function(e){var n=e.metric,t=e.values;return{metric:JSON.stringify(n),rows:t.map((function(e){var t=(0,u.Z)(e,2),r=t[0],i=t[1];return{time:r,metric:JSON.stringify(n),value:i}})),get rowsLength(){var e;return null===(e=this.rows)||void 0===e?void 0:e.length},get title(){return"'".concat(this.metric,"' (").concat(this.rowsLength,")")}}}))}(e),i=[],a=(0,s.Z)(r);try{for(a.s();!(n=a.n()).done;){var o=n.value;i.push(o.rows)}}catch(c){a.e(c)}finally{a.f()}var l=(0,De.sortBy)(i.flat(),(function(e){return e.time}));return{columnsData:t,dataRows:l,total:l.length}}function Ke(e){var n=e.result,t=e.debugMode,r=e.dispatch,i=e.panel,a=e.id,o=e.raw,s=e.dsType,u=e.isLogsVolume,c=Ge(n),d=function(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}(i);try{var f,p=Je(n),v={id:a,type:"matrix",tableData:c,data:p,dsType:s,raw:o,total:(null===p||void 0===p?void 0:p.length)||0},h=d.action,g=d.state,m=null===(f=A.Z.getState())||void 0===f?void 0:f[g];if(m.some((function(e){return e.id===v.id}))){if(u){var x=(0,H.Z)(m).map((function(e){return e.id===a?(0,l.Z)((0,l.Z)({},e),{},{logsVolumeData:p,total:p.length}):e}));r(h([])),r(h(x))}else{r(h([]));var b=m.filter((function(e){return e.id!==v.id}));r(h([].concat((0,H.Z)(b),[(0,l.Z)({},v)])))}}else{r(h([].concat((0,H.Z)(m),[v])))}}catch(y){t&&console.log("\ud83d\udea7 getData / getting an error from rendering matrix type streams"),console.log(y)}}var Ye=function(e){return function(n){n({type:"SET_LOGS",logs:e})}},Xe=t(69059);function $e(e){return(0,Fe.jsx)("span",{title:e.getValue(),children:e.getValue()})}function en(e){var n=[{id:"time",header:"Time",accessorKey:"time",cell:function(e){return n=e,d()(parseInt(n.getValue())/1e6).format("YYYY-MM-DDTHH:mm:ss.SSZ");var n}},{id:"stream",header:"Stream",accessorKey:"stream",cell:function(e){return $e(e)}},{id:"log",accessorKey:"log",header:"Log",cell:function(e){return $e(e)}}],t=function(e){return null===e||void 0===e?void 0:e.map((function(e){var n=e.stream,t=e.values;return{stream:"".concat(JSON.stringify(n)),rows:null===t||void 0===t?void 0:t.map((function(e){var t=(0,u.Z)(e,2),r=t[0],i=t[1];return{time:r,stream:JSON.stringify(n),log:i}})),get rowsLength(){var e;return(null===this||void 0===this||null===(e=this.rows)||void 0===e?void 0:e.length)||0}}}))}(e),r=(null===t||void 0===t?void 0:t.length)||0,i=[];if(r>0){var a,o=(0,s.Z)(t);try{for(o.s();!(a=o.n()).done;){var l=a.value;i.push(l.rows)}}catch(c){o.e(c)}finally{o.f()}}return{columnsData:n,dataRows:(0,De.sortBy)(i.flat(),(function(e){return e.time})),length:r}}function nn(e){var n=e.result,t=e.raw,r=e.time,i=e.debugMode,a=e.queryType,o=e.panel,s=e.id,u=e.dispatch,c=e.dsType,d=e.direction,f=e.isLogsVolume,p=fn(n,d),v=function(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}(o),h=en(n),g=dn(p,d);var m,x={id:s,type:"stream",tableData:{},data:[{}],raw:"[]",labels:[],total:0,isLogsVolume:f,dsType:c};if(g)try{var b;(function(e){return cn.apply(this,arguments)})(u(Ye(g||[]))).then((function(){0===g.length&&(i&&console.log("\ud83d\udea7 getData / getting no messages sorted"),u(Q(!0))),u(Q(!1))}));var y=Array.from(new Set(null===g||void 0===g?void 0:g.map((function(e){return Object.keys(e.tags)})))),Z=(m=y,[].concat.apply([],m).filter((function(e,n,t){return t.indexOf(e)===n})));x={id:s,type:"stream",dsType:c,tableData:h,data:g,isLogsVolume:f,raw:t,labels:(0,H.Z)(Z),total:(null===g||void 0===g?void 0:g.length)||0};var w=v.action,S=v.state,j=null===(b=A.Z.getState())||void 0===b?void 0:b[S];if(j.some((function(e){return e.id===x.id}))){if(f){var k=(0,H.Z)(j).map((function(e){if(e.id===s){var n,t=[];null!==e&&void 0!==e&&e.logsVolumeData&&(null===(n=e.logsVolumeData)||void 0===n?void 0:n.length)>0&&(t=(0,H.Z)(e.logsVolumeData));var r=(0,l.Z)({},x);return(0,l.Z)((0,l.Z)({},r),{},{logsVolumeData:t})}return e}));u(w([])),u(w(k))}else{var C;u(w([]));var T=j.filter((function(e){return e.id!==x.id}));C=[].concat((0,H.Z)(T),[(0,l.Z)({},x)]),u(w(C))}}else{var _=[].concat((0,H.Z)(j),[x]);u(w(_))}"instant"===a&&u((0,Xe.H)(r))}catch(L){console.log(L)}else{var I,D=v.action,N=v.state,M=null===(I=A.Z.getState())||void 0===I?void 0:I[N];if(M.some((function(e){return e.id===x.id}))){var E;u(D([]));var R=(null===M||void 0===M?void 0:M.filter((function(e){return e.id!==x.id})))||[];E=[].concat((0,H.Z)(R),[(0,l.Z)({},x)]),u(D(E))}else{var O=[].concat((0,H.Z)(M),[x]);u(D(O))}}}function tn(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}function rn(e){return an.apply(this,arguments)}function an(){return an=(0,F.Z)((0,z.Z)().mark((function e(n){var t,r,i,a,o,s,u,c,d,f,p,v,h,g,m,x,b,y,Z;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.result,r=n.debugMode,i=n.dispatch,a=n.panel,o=n.id,s=n.type,u=n.dsType,c=n.queryType,d=n.raw,"trace-search"!==c){e.next=6;break}return e.next=4,Ue(n);case 4:e.next=7;break;case 6:try{v={id:o,type:s,dsType:u,tableData:{},data:t,raw:d,labels:[],open:!0,total:null===t||void 0===t||null===(f=t.resourceSpans)||void 0===f?void 0:f.length},h=tn(a),g=h.action,m=h.state,(x=null===(p=A.Z.getState())||void 0===p?void 0:p[m]).some((function(e){return e.id===v.id}))?([],i(g([])),y=x.filter((function(e){return e.id!==v.id})),b=[].concat((0,H.Z)(y),[(0,l.Z)({},v)]),i(g(b))):(Z=[].concat((0,H.Z)(x),[v]),i(g(Z)))}catch(w){r&&console.log(" \ud83d\udea7 getData / getting an error from rendering Traces type streams",w),console.log(w)}case 7:case"end":return e.stop()}}),e)}))),an.apply(this,arguments)}function on(e){return(0,Fe.jsx)("span",{title:e.getValue(),children:e.getValue()})}function ln(e){var n,t=[{accessorKey:"time",header:function(){return(0,Fe.jsx)("span",{children:"Time"})},cell:function(e){return function(e){return d()(e.getValue()).format("YYYY-MM-DDTHH:mm:ss.SSZ")}(e)}},{header:"Metric",cell:function(e){return on(e)},accessorKey:"metric"},{header:"Value",accessorKey:"value",cell:function(e){return on(e)}}],r=function(e){return e.map((function(e){var n=e.metric,t=e.values;return{metric:JSON.stringify(n),rows:t.map((function(e){var t=(0,u.Z)(e,2),r=t[0],i=t[1];return{time:r,metric:JSON.stringify(n),value:i}})),get rowsLength(){var e;return null===(e=this.rows)||void 0===e?void 0:e.length},get title(){return"'".concat(this.metric,"' (").concat(this.rowsLength,")")}}}))}(e),i=[],a=(0,s.Z)(r);try{for(a.s();!(n=a.n()).done;){var o=n.value;i.push(o.rows)}}catch(c){a.e(c)}finally{a.f()}var l=(0,De.sortBy)(i.flat(),(function(e){return e.time}));return{columnsData:t,dataRows:l,total:l.length}}function sn(e){var n=e.result,t=e.debugMode,r=e.dispatch,i=e.panel,a=e.id,o=e.raw,s=e.dsType;n=function(e){return[{metric:{__name__:"Flux"},values:e.map((function(e){return Object.values(e).map((function(e,n){return isNaN(+e)?null:(e instanceof Date?e.getTime()/1e3:e)+(0===n?0:"")})).filter((function(e){return!!e}))}))}]}(n);var c=ln(n),f=function(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}(i);try{var p,v=Je(n),h=function(e){var n=e.result,t=e.panel,r=e.id,i=e.type,a={panel:t,id:r,type:i},o=Me(e.result),l=function(e){var n=e[0],t=Object.entries(n);if(t){var r=t.find((function(e){var n=(0,u.Z)(e,2),t=(n[0],n[1]);return d().isDate(t)}));return(null===r||void 0===r?void 0:r[0])||null}}(n),s=qe(o,i,l,a),c=Ee(n,i),f={columnsData:s,dataRows:c,panel:t,id:r};if((null===s||void 0===s?void 0:s.length)>0&&(null===c||void 0===c?void 0:c.length)>0)return f}(e),g={id:a,type:"vector",tableData:c,data:{chartData:v,tableData:h},dsType:s,raw:o,total:(null===v||void 0===v?void 0:v.length)||0},m=f.action,x=f.state,b=null===(p=A.Z.getState())||void 0===p?void 0:p[x];if(b.some((function(e){return e.id===g.id}))){r(m([]));var y=b.filter((function(e){return e.id!==g.id}));r(m([].concat((0,H.Z)(y),[(0,l.Z)({},g)])))}else{r(m([].concat((0,H.Z)(b),[g])))}}catch(Z){t&&console.log("\ud83d\udea7 getData / getting an error from rendering Flux type streams"),console.error(Z)}}var un=A.Z.getState().debugMode;function cn(){return(cn=(0,F.Z)((0,z.Z)().mark((function e(n){return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dn(e,n){return"forward"===n?function(e){var n=performance.now(),t=null===e||void 0===e?void 0:e.sort((function(e,n){return e.timestamp-n.timestamp})),r=performance.now()-n;un&&console.log("\ud83d\udea7 getData / sorting logs took: ",r," ms");return t}(e):function(e){var n=performance.now(),t=null===e||void 0===e?void 0:e.sort((function(e,n){return n.timestamp-e.timestamp})),r=performance.now()-n;un&&console.log("\ud83d\udea7 getData / sorting logs took: ",r," ms");return t}(e)}function fn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"backwards",t=performance.now(),r=[];null===e||void 0===e||e.forEach((function(e){e.values.forEach((function(n,t){var i=(0,u.Z)(n,2),a=i[0],o=i[1];r.push({type:"stream",timestamp:Ze(a),text:o,tags:e.stream||{},isShowTs:!0,isBuilder:!1,showLabels:!1,id:(0,Ie.x0)()})}))}));var i=performance.now()-t;return un&&console.log("\ud83d\udea7 getData / mapping logs took: ",i," ms"),dn(r,n)}function pn(e){return vn.apply(this,arguments)}function vn(){return(vn=(0,F.Z)((0,z.Z)().mark((function e(n){var t;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n.type,e.t0=t,e.next="streams"===e.t0?4:"vector"===e.t0?7:"matrix"===e.t0?10:"scalar"===e.t0?13:"flux"===e.t0?16:"traces"===e.t0?19:22;break;case 4:return e.next=6,nn(n);case 6:case 9:case 12:case 15:case 18:case 21:return e.abrupt("break",24);case 7:return e.next=9,Ue(n);case 10:return e.next=12,Ke(n);case 13:return e.next=15,Ke(n);case 16:return e.next=18,sn(n);case 19:return e.next=21,rn(n);case 22:return e.next=24,nn(n);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hn(e){return function(n){n({type:"SET_RESPONSE_TYPE",responseType:e})}}var gn=t(13997),mn=t.n(gn);function xn(e){return bn.apply(this,arguments)}function bn(){return(bn=(0,F.Z)((0,z.Z)().mark((function e(n){var t,r,i,a,o,l,s;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t={meta:[],data:[],statistics:{elapsed:.360986682,rows_read:0,bytes_read:0}},r=mn().parse(n,{header:!0,comments:!0,dynamicTyping:!0}),e.next=5,r.data.map((function(e){return delete e[""],delete e.table,delete e.result,e}));case 5:for(t.data=e.sent,t.data.length=t.data.length-2,i=0,a=Object.entries(t.data[0]);i0&&pn({result:t.data.traces||[],raw:t.data,time:v,debugMode:g,dispatch:r,dsType:n,type:n,panel:i,open:!0,id:a,ts:Date.now(),queryType:s}),(null===t||void 0===t||null===(b=t.data)||void 0===b||null===(y=b.resourceSpans)||void 0===y?void 0:y.length)>0&&pn({result:(null===t||void 0===t?void 0:t.data)||[],raw:null===t||void 0===t?void 0:t.data,time:v,debugMode:g,dispatch:r,type:n,dsType:n,panel:i,open:!0,id:a,ts:Date.now(),queryType:s})),"flux"!==n){e.next=6;break}return e.next=6,xn(null===t||void 0===t?void 0:t.data).then((function(e){var t;(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.length)>0&&pn({result:e.data||[],raw:null===e||void 0===e?void 0:e.data,time:v,debugMode:g,queryType:s,dispatch:r,dsType:n,type:n,panel:i,open:!0,id:a,ts:Date.now(),direction:o})}));case 6:0===(null===t||void 0===t||null===(c=t.data)||void 0===c||null===(d=c.streams)||void 0===d?void 0:d.length)&&(pn({result:[],raw:"[]",time:v,debugMode:g,queryType:s,dispatch:r,open:!0,type:"streams",dsType:n,panel:i,id:a,ts:Date.now(),direction:o,isLogsVolume:u}),r(Q(!0))),null!==t&&void 0!==t&&null!==(f=t.data)&&void 0!==f&&f.data?(N=null===t||void 0===t||null===(Z=t.data)||void 0===Z||null===(w=Z.data)||void 0===w?void 0:w.result,M=null===t||void 0===t||null===(S=t.data)||void 0===S||null===(j=S.data)||void 0===j?void 0:j.resultType,E={hasStats:!1,statsData:{}},null!==t&&void 0!==t&&null!==(k=t.data)&&void 0!==k&&null!==(C=k.data)&&void 0!==C&&C.stats&&(null===(T=Object.keys(null===t||void 0===t||null===(_=t.data)||void 0===_||null===(I=_.data)||void 0===I?void 0:I.stats))||void 0===T?void 0:T.length)>0&&(E={hasStats:!0,statsData:(0,l.Z)({},null===t||void 0===t||null===(R=t.data)||void 0===R||null===(O=R.data)||void 0===O?void 0:O.stats)}),L=A.Z.getState()[i],V=null===L||void 0===L?void 0:L.map((function(e){var n,t;return e.id===a?(0,l.Z)((0,l.Z)({},e),{},{hasStats:(null===(n=E)||void 0===n?void 0:n.hasStats)||!1,statsData:(null===(t=E)||void 0===t?void 0:t.statsData)||{},open:!0}):e})),r(yn(i,V)),r(hn(n)),pn({result:N,raw:null===t||void 0===t||null===(D=t.data)||void 0===D?void 0:D.data,time:v,debugMode:g,queryType:s,dispatch:r,type:M,dsType:n,open:!0,panel:i,id:a,ts:Date.now(),direction:o,isLogsVolume:u})):Te(r);case 8:case"end":return e.stop()}}),e)}))),Sn.apply(this,arguments)}var jn=t(70804);function kn(e){var n=e.match(/\[(.*?)\]/gm),t=(null===n||void 0===n?void 0:n[0].replace(/\[\]']+/g,"").trim())||"",r=0;if(Array.isArray(n)){var i,a,o,l=t.match((0,jn.Z)(/^([0-9.]+)(ns|us|ms|s|m|h)?$/,{tnum:1,trange:2})),s=("string"===typeof(null===l||void 0===l||null===(i=l.groups)||void 0===i?void 0:i.tnum)?parseInt(null===l||void 0===l||null===(a=l.groups)||void 0===a?void 0:a.tnum):1)/function(e){var n=/^(ns|us|ms|s|m|h)$/,t={ns:1e9,us:1e6,s:1,m:1/60,h:1/3600},r=new Map(Object.entries(t));return n.test(e)&&"string"===typeof e?r.get(e)||1/60:r.get("m")||1/60}((null===l||void 0===l||null===(o=l.groups)||void 0===o?void 0:o.trange)||"m");r=s}return r}function Cn(e,n){window.bosco.send(e,n)}function Tn(e,n,t,r,i,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"backwards",u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,f=arguments.length>10&&void 0!==arguments[10]&&arguments[10],p={url:"",requestHeaders:{},method:{value:""},headers:[],auth:{method:{value:"GET"},basicAuth:{value:!0},fields:{basicAuth:[{name:"user",value:""},{name:"password",value:""}]}},hasSettings:!1},v="",h="";if(""!==u){var g,b,y,Z,w,S,j=A.Z.getState().dataSources,k=j.find((function(e){return e.id===u}));if(k&&(null===(g=Object.keys(k))||void 0===g?void 0:g.length)>0){var C=j.find((function(e){return e.id===u})),T=""!==p.url?p.url:C.url;p=(0,l.Z)((0,l.Z)({},C),{},{url:T,hasSettings:!0})}if((null===(b=p)||void 0===b||null===(y=b.headers)||void 0===y?void 0:y.length)>0){var _,I={},D=(0,s.Z)(p.headers);try{for(D.s();!(_=D.n()).done;){var N=_.value,M=(0,B.Z)({},String(N.header),N.value);I=(0,l.Z)((0,l.Z)({},I),M)}}catch(ne){D.e(ne)}finally{D.f()}p.requestHeaders=I||{}}if(null!==(Z=p)&&void 0!==Z&&null!==(w=Z.auth)&&void 0!==w&&null!==(S=w.basicAuth)&&void 0!==S&&S.value){var E,R,O,L,V=null===(E=p)||void 0===E||null===(R=E.auth)||void 0===R||null===(O=R.fields)||void 0===O?void 0:O.basicAuth,P={username:"",password:""},W=(0,s.Z)(V);try{for(W.s();!(L=W.n()).done;){var U=L.value;"user"===(null===U||void 0===U?void 0:U.name)&&(P.username=U.value,v=U.value),"password"===(null===U||void 0===U?void 0:U.name)&&(P.password=U.value,h=U.value)}}catch(ne){W.e(ne)}finally{W.f()}p.requestHeaders=(0,l.Z)({},p.requestHeaders)}}var J=function(e,n){var t=A.Z.getState()[i];!function(e,n,t){"left"===e?n(m(t)):"right"===e&&n(x(t))}(i,e,function(e,n,t){return(0,H.Z)(e).map((function(e){return e.id===n?(0,l.Z)((0,l.Z)({},e),{},{loading:t||!1}):e}))}(t,a,n))},G=A.Z.getState().debugMode,K=function(e,n){var t,r=(null===(t=Object.keys(n))||void 0===t?void 0:t.length)>0?n:void 0;return"flux"===e?{method:"POST",headers:r||{Accept:"application/csv","Content-Type":"application/vnd.flux"}}:{method:"GET",headers:r||{"Content-Type":"application/json"}}}(e,p.requestHeaders),Y=kn(n),X=function(e,n,t,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",o=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,s=arguments.length>8?arguments[8]:void 0,u=arguments.length>9?arguments[9]:void 0,c=arguments.length>10?arguments[10]:void 0,d=A.Z.getState().isSplit?2:1,f=window.innerWidth,p=Ce(e,u,c),v=p.parsedTime,h=p.time,g=a,m=0;0===(m=s>0?s:f/Math.round(f/r*10/d))&&(m=1);var x="&step=".concat(m),b="".concat(encodeURIComponent(n)),y="";switch(e){case"logs":default:y="".concat(g,"/loki/api/v1");break;case"metrics":y="".concat(g,"/api/v1");break;case"flux":y="".concat(g,"/api/v2/query");break;case"traces":y="trace-search"===o?"".concat(l):"".concat(g,"/api/traces/").concat(n,"/json")}return{queryUrl:y,encodedQuery:b,parsedTime:v,time:h,queryStep:x,limit:t,direction:i,queryType:o}}(e,n,r,Y,o,p.url||"",t,c,d,a,i),$=function(e,n,t){return function(e,n,t){var r=n.queryUrl,i=n.encodedQuery,a=n.limit,o=n.parsedTime,l=n.queryStep,s=n.direction,u=n.time;return"metrics"===e||"logs"===e?"instant"===t?"".concat(r,"/query?query=").concat(i,"&limit=").concat(a,"&time=").concat(u,"&direction=").concat(s):"".concat(r,"/query_range?query=").concat(i,"&limit=").concat(a).concat(o).concat(l,"&direction=").concat(s):"flux"===e?"".concat(r):"traces"===e?"trace-search"===t?"".concat(r).concat(o):"".concat(r):""}(e,t,n)}(e,t,X),ee=function(e,n){var t,r=null===(t=A.Z.getState())||void 0===t?void 0:t["".concat(i,"DataView")],o=null===r||void 0===r?void 0:r.find((function(e){return e.id===a}));o&&(o.loading=e),function(e,n,t){t("left"===e?Ae(n):Qe(n))}(i,r,n)};return function(){var r=(0,F.Z)((0,z.Z)().mark((function r(s){var u,d,p;return(0,z.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(ee(!0,s),J(s,!0),""!==c){r.next=6;break}return"trace-search"===t&&Zn(e,s,i,a,o,t),J(s,!1),r.abrupt("return");case 6:if(""!==n||"trace-search"===t){r.next=10;break}return"traces"===e&&Zn(e,s,i,a,o,t),J(s,!1),r.abrupt("return");case 10:if("undefined"!=typeof u&&u.cancel("Cancelling the previous request"),u=q().CancelToken.source(),K.cancelToken=u.token,r.prev=13,"POST"!==(null===K||void 0===K?void 0:K.method)){r.next=19;break}return r.next=17,null===q()||void 0===q()||null===(d=q().post($,n,K))||void 0===d?void 0:d.then((function(n){wn(e,n,s,i,a,o,t)})).catch((function(e){Te(s),s(Q(!0)),ee(!1,s),G&&console.log("Error loading flux data",e)})).finally((function(){ee(!1,s),J(s,!1)}));case 17:r.next=22;break;case 19:if("GET"!==(null===K||void 0===K?void 0:K.method)){r.next=22;break}return r.next=22,null===q()||void 0===q()||null===(p=q().get($,(0,l.Z)({auth:{username:v,password:h}},K)))||void 0===p?void 0:p.then((function(n){wn(e,n||{data:{data:[]}},s,i,a,o,t,f),G&&Cn({level:"info",id:a,type:e,direction:o},a),J(s,!1)})).catch((function(n){Te(s),s(Q(!0)),ee(!1,s),J(s,!1),G&&(Cn({level:"error",id:a,type:e,direction:o},a),console.log("getting an error from response: ",n))})).finally((function(){J(s,!1),ee(!1,s)}));case 22:r.next=28;break;case 24:r.prev=24,r.t0=r.catch(13),J(s,!1),console.log(r.t0);case 28:case"end":return r.stop()}}),r,null,[[13,24]])})));return function(e){return r.apply(this,arguments)}}()}var _n,In,Dn,Nn,Mn,En,Rn,On,Ln,Vn,zn,Fn,Bn,Hn,Pn,qn,An,Qn,Wn,Un,Jn,Gn,Kn,Yn,Xn,$n,et,nt,tt,rt,it,at,ot,lt=function(e){return function(n){n({type:"SET_HISTORY_OPEN",historyOpen:e})}},st=t(56410),ut=t(96217),ct=t(68816),dt=t(78941),ft=t(52586),pt=t(9165),vt=t(72106),ht=t(72191),gt=t(57009),mt=t(77782),xt=t(65726),bt=t(22166),yt=t(66859),Zt=t(61113),wt=t(8454),St=t(30735),jt=t(41801),kt=t(14606),Ct=t(81543),Tt=t(55863),_t=t(38167),It=t(36240),Dt=t(57983),Nt=t(42361),Mt=t(73696),Et=t(33947),Rt=t(64864),Ot=t(48644),Lt=((0,jt.Z)(Rt.z)(_n||(_n=(0,r.Z)(["\n background: none;\n border: none;\n display: flex;\n height: 26px;\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.isActive?e.theme.inputTextFocus:e.theme.textColor})),jt.Z.div(In||(In=(0,r.Z)(["\n display: flex;\n justify-content: space-between;\n padding: 10px 7px 4px 5px;\n background: ",";\n"])),(function(e){return e.theme.widgetContainer})),jt.Z.div(Dn||(Dn=(0,r.Z)(["\n display: flex;\n align-items: center;\n .selector {\n margin-left: 10px;\n .label {\n flex: 1;\n color: ",";\n padding: 4px 8px;\n font-size: 12px;\n text-transform: uppercase;\n background: ",";\n border-radius: 4px;\n white-space: nowrap;\n }\n }\n input {\n color: ",";\n background: ",";\n border: none;\n outline: none;\n padding: 4px 8px;\n font-size: 1em;\n border-radius: 3px;\n line-height: 1.5;\n margin: 0px 5px;\n &:focus {\n color: orange;\n }\n &.limit {\n width: 50px;\n }\n\n &.date-time-range {\n width: 120px;\n }\n }\n"])),(function(e){return e.theme.inputLabelColor}),(function(e){return e.theme.inputLabelBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg})),jt.Z.div(Nn||(Nn=(0,r.Z)(["\n display: flex;\n align-items: center;\n margin-left: 20px;\n display: flex;\n align-items: center;\n transition: 0.2s all;\n height: 26px;\n .selector {\n margin-left: 10px;\n .label {\n flex: 1;\n color: ",";\n padding: 4px 8px;\n font-size: 12px;\n text-transform: uppercase;\n background: ",";\n border-radius: 4px;\n white-space: nowrap;\n }\n .input {\n background: ",";\n }\n }\n & div {\n display: flex;\n align-items: center;\n }\n"])),(function(e){return e.theme.inputLabelColor}),(function(e){return e.theme.mainBgColor}),(function(e){return e.theme.inputLabelBg})),(0,jt.Z)(Rt.z)(Mn||(Mn=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n text-overflow: ellipsis;\n transition: 0.2s all;\n display:flex;\n align-items:center;\n height: 26px;\n &:hover {\n background: ",";\n }\n span {\n margin:0;\n padding:0;\n @media screen and (max-width: 565px) {\n display: none;\n }\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover})),(0,jt.Z)(Ot.K)(En||(En=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n height: 18px;\n margin-right: 4px;\n &:focus {\n color: orange;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder})),(0,jt.Z)(Rt.z)(Rn||(Rn=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n border-radius: 3px;\n height: 26px;\n margin:0px 1px;\n padding: ",";\n span {\n margin-left: 5px;\n }\n svg {\n margin: 0;\n padding: 0;\n }\n &:hover {\n color: orange;\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return"small"===e.size?"3px 5px":""}))),Vt=((0,jt.Z)(Lt)(On||(On=(0,r.Z)(["\n background: ",";\n color: ",";\n cursor: ",";\n text-overflow: ellipsis;\n transition: 0.2s all;\n height: 26px;\n span {\n margin-left: 4px;\n color: ",";\n @media screen and (max-width: 565px) {\n display: none;\n }\n }\n &:hover {\n background: ",";\n }\n \n"])),(function(e){return e.theme.buttonDefault}),(function(e){var n=e.isActive,t=e.theme;return n?"orange":t.textColor}),(function(e){return e.isActive?"pointer":"not-allowed"}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover})),(0,jt.Z)((function(e){return(0,Fe.jsx)(Et.ZP,(0,l.Z)({anchor:"bottom",style:{maxHeight:"250px"},variant:"persistent"},e))}))((function(e){var n=e.theme;return{"& .MuiPaper-root":{borderTop:"1px solid ".concat(n.buttonBorder)}}}))),zt=(0,jt.Z)(ht.Z)(Ln||(Ln=(0,r.Z)(['\n height: "320px";\n background: ',";\n"])),(function(e){return e.theme.inputBg})),Ft=(0,jt.Z)(Ct.Z)(Vn||(Vn=(0,r.Z)(["\n color: ",";\n background: ",";\n border:1px solid ",";\n cursor: pointer;\n font-size: 13px;\n background-color: transparent;\n padding: 6px 10px;\n border: none;\n border-radius: 3px 3px 0px 0px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid transparent;\n transition: 0.2s all;\n\n &:hover {\n background-color: ",";\n }\n\n &:focus {\n color: ",";\n background: ",";\n border-radius: 3px 3px 0px 0px;\n\n outline-offset: 2px;\n }\n\n &."," {\n border-bottom: 1px solid ",";\n }\n\n &."," {\n opacity: 0.5;\n cursor: not-allowed;\n }\n @media screen and (max-width: 360px) {\n span {\n display: none;\n }\n padding: 5px 20px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),Tt.Z.selected,(function(e){return e.theme.primaryDark}),kt.Z.disabled),Bt=(0,jt.Z)(It.Z)(zn||(zn=(0,r.Z)(["\n height: 16px;\n width: 16px;\n margin-right: 3px;\n"]))),Ht=(0,jt.Z)(dt.Z)(Fn||(Fn=(0,r.Z)(["\n height: 16px;\n width: 16px;\n margin-right: 3px;\n"]))),Pt=(0,jt.Z)(_t.Z)(Bn||(Bn=(0,r.Z)(["\n height: 16px;\n width: 16px;\n margin-right: 3px;\n"]))),qt=(0,jt.Z)(pt.Z)(Hn||(Hn=(0,r.Z)(["\n height: 16px;\n width: 16px;\n margin-right: 3px;\n"]))),At=(0,jt.Z)(Dt.Z)(Pn||(Pn=(0,r.Z)(["\n height: 21px;\n width: 16px;\n padding: 0px 3px;\n border-radius: 3px 0px 0px 3px;\n background: ",";\n"])),(function(e){return e.theme.inputBg})),Qt=jt.Z.div(qn||(qn=(0,r.Z)(["\n padding: 0px 15px;\n font-size: 13px;\n display: flex;\n align-items: center;\n color: ",";\n justify-content: space-between;\n background: ",";\n height: 37px;\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.tabHeader})),Wt=(0,jt.Z)(Mt.Z)(An||(An=(0,r.Z)(["\n width: 100%;\n background: ",";\n"])),(function(e){return e.theme.widgetContainer})),Ut=(0,jt.Z)(Nt.Z)(Qn||(Qn=(0,r.Z)(["\n min-width: 320px;\n background: ",";\n border-bottom: 4px solid ",";\n display: flex;\n align-items: center;\n align-content: space-between;\n"])),(function(e){return e.theme.tabHeader}),(function(e){return e.theme.historyRow})),Jt=jt.Z.div(Wn||(Wn=(0,r.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n font-size: 14px;\n flex: 1;\n padding: 20px;\n height: 50%;\n"])),(function(e){return e.theme.textColor})),Gt=jt.Z.div(Un||(Un=(0,r.Z)(["\n height: 250px;\n overflow-y: auto;\n color: ",";\n background: ",";\n &.starredCont {\n height: 210px;\n }\n &::-webkit-scrollbar {\n width: 5px;\n background: ",";\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.tabBg}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.scrollbarThumb})),Kt=(0,jt.Z)(Lt)(Jn||(Jn=(0,r.Z)(["\n padding: 3px 6px;\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n border: none;\n color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0px 6px;\n cursor: pointer;\n min-height: 20px;\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor})),Yt=jt.Z.div(Gn||(Gn=(0,r.Z)(["\n height: 100px;\n width: 240px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n padding: 20px;\n background: ",";\n border:1px solid ",";\n margin: 10px;\n border-radius: 3px;\n & div {\n font-size: 15px;\n color: ",";\n line-height: 1.5;\n }\n & small {\n font-size: 12px;\n color: ",";\n line-height: 1.5;\n margin-bottom: 10px;\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textPrimaryAccent}),(function(e){return e.theme.textColor})),Xt=(0,jt.Z)(Kt)(Kn||(Kn=(0,r.Z)(["\n background: ",";\n color: ",";\n white-space: nowrap;\n .open-icon {\n display: none;\n }\n .open-text {\n display: flex;\n font-size: 12px;\n }\n @media screen and (max-width: 1070px) {\n .open-icon {\n display: flex;\n }\n .open-text {\n display: none;\n \n }\n }\n"])),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.buttonText})),$t=(0,jt.Z)(Kt)(Yn||(Yn=(0,r.Z)(["\n font-weight: bold;\n padding: 10px 20px;\n background: ",";\n color: ",";\n margin: 0;\n width: 100%;\n white-space: nowrap;\n"])),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.buttonText})),er=(0,jt.Z)(Kt)(Xn||(Xn=(0,r.Z)(["\n background: none;\n color: ",";\n\n position: absolute;\n right: 0;\n"])),(function(e){return e.theme.textColor})),nr=(0,jt.Z)(Kt)($n||($n=(0,r.Z)(["\n background: ",";\n border:1px solid ",";\n padding: 8px 16px;\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder})),tr=(0,jt.Z)(Kt)(et||(et=(0,r.Z)(["\n background: ",";\n color:",";\n padding: 8px 16px;\n"])),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.buttonText})),rr=jt.Z.input(nt||(nt=(0,r.Z)(["\n color: ",";\n background: ",";\n border:none;\n height: 21px;\n margin: 0px 10px 0px 0px;\n padding: 0px;\n font-size: 13px;\n border-radius: 0px 3px 3px 0px;\n font-family: monospace;\n font-size: 12px;\n &:focus {\n outline: none;\n color: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.inputTextFocus})),ir=jt.Z.span(tt||(tt=(0,r.Z)(['\n flex: 1;\n font-family: monospace;\n display:flex;\n align-items: center;\n font-size: "13px";\n color: ',";\n white-space: nowrap;\n padding: 4px 0px;\n overflow: hidden;\n text-overflow: ellipsis;\n"])),(function(e){return e.theme.textColor})),ar=jt.Z.div(rt||(rt=(0,r.Z)(["\n display: flex;\n flex: 1;\n justify-content: space-between;\n .open-button {\n display: none;\n }\n .inline-params {\n align-items: center;\n display: ",";\n flex: 1;\n grid-template-columns: 1fr 0.25fr 0.25fr auto;\n margin-right: 5px;\n }\n\n .open-button {\n display: flex;\n color: ",";\n background: none;\n border: none;\n }\n .block-params {\n display: ",";\n flex-direction: column;\n flex: 1;\n p {\n display: flex;\n align-items: center;\n flex: 1;\n line-height: 1.5;\n font-size: 12px;\n font-family: monospace;\n span {\n margin-left: 3px;\n &.key {\n flex: 1;\n }\n &.value {\n flex: 3;\n }\n }\n }\n }\n @media screen and (max-width: 1070px) {\n .inline-params {\n display: none;\n }\n }\n"])),(function(e){return e.open?"none":"grid"}),(function(e){return e.theme.buttonText}),(function(e){return e.open?"flex":"none"})),or=jt.Z.div(it||(it=(0,r.Z)(["\n padding: 5px 0px;\n padding-left: 10px;\n border: 1px solid ",";\n margin: 5px;\n border-radius: 3px;\n font-size: 13px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])),(function(e){return e.theme.historyRow})),lr=jt.Z.div(at||(at=(0,r.Z)(["\n @media screen and (max-width: 1370px) {\n display: none;\n }\n"]))),sr=t(66149),ur=t(33604),cr=t(96467),dr=t(97762),fr=t(4117),pr=t(45859),vr=t(79727),hr=t(43262),gr=jt.Z.div(ot||(ot=(0,r.Z)(["\n background: ",";\n #alert-dialog-title {\n color: ",";\n }\n #alert-dialog-description {\n color: ",";\n font-weight: normal;\n }\n"])),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.textColor}),(function(e){return e.theme.textOff}));function mr(e){var n=e.clearHistory,t=e.dialogType,r=(0,f.useState)(!1),i=(0,u.Z)(r,2),a=i[0],o=i[1],l=(0,hr.Fg)(),s=function(){o(!1)};return(0,Fe.jsx)(pr.Z,{theme:l,children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)(D.Z,{title:"Clear Query History",children:(0,Fe.jsx)($t,{onClick:function(){o(!0)},children:"Clear History"})}),(0,Fe.jsx)(sr.Z,{open:a,onClose:s,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",PaperProps:{classes:{root:vr.ht}},children:(0,Fe.jsxs)(gr,{children:[(0,Fe.jsxs)(ur.Z,{id:"alert-dialog-title",children:["Are you sure you want to clear the ",t," ","History?"]}),(0,Fe.jsx)(cr.Z,{children:(0,Fe.jsxs)(dr.Z,{id:"alert-dialog-description",children:["Click \u2018Clear History\u2019 to delete your"," ",t," history permanently"]})}),(0,Fe.jsxs)(fr.Z,{children:[(0,Fe.jsx)(nr,{onClick:s,children:"Cancel"}),(0,Fe.jsx)(tr,{onClick:function(){n(),o(!1)},autoFocus:!0,children:"Clear History"})]})]})})]})})}function xr(e){var n=e.message;return(0,Fe.jsx)(Jt,{children:n})}var br=t(11198);function yr(e){var n=e.onClose;return(0,Fe.jsx)(er,{onClick:n,children:(0,Fe.jsx)(br.Z,{style:{height:"16px",width:"16px"}})})}var Zr,wr,Sr,jr,kr,Cr,Tr,_r,Ir=t(62424),Dr=t(403),Nr=t(83618),Mr=t(50567),Er=t(88620),Rr=t(47347),Or=t(82395),Lr=t(70501),Vr=t(9019),zr=t(70943),Fr=t(93345),Br=t(80038),Hr=t(8885),Pr=t(39231),qr=t(94836),Ar=t(47131),Qr=t(89790),Wr=t(54045),Ur=t(68659),Jr=t(20644),Gr=t(87910),Kr=t(8121),Yr=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],Xr=["Su","Mo","Tu","We","Th","Fr","Sa"],$r={FIRST_MONTH:Symbol("firstMonth"),SECOND_MONTH:Symbol("secondMonth")},ei="dateTimeRange",ni=t(68658),ti=A.Z.getState().theme,ri=Ve.n[ti],ii=function(){var e=A.Z.getState().theme;return(0,ni.Z)({palette:{mode:e,primary:{main:ri.textColor}}})},ai=jt.Z.select(Zr||(Zr=(0,r.Z)(["\n cursor: pointer;\n position: relative;\n font-size: 14px;\n color: ",";\n background: ",";\n border: none;\n border-radius: 3px;\n padding: 4px 8px;\n line-height: 20px;\n flex: 1;\n &::-webkit-scrollbar {\n width: 5px;\n background: ",";\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.scrollbarThumb})),oi=(0,Hr.Z)((function(){return(0,Br.Z)({iconContainer:{padding:5,color:ri.textColor},icon:{padding:10,color:ri.textColor,"&:hover":{color:ri.textColor,background:"none"}},selector:{color:ri.textColor,borderBottom:"1px solid ".concat(ri.textColor)}})}))((function(e){var n=e.date,t=e.classes,r=e.setDate,i=e.nextDisabled,a=e.prevDisabled,o=e.onClickNext,l=e.onClickPrevious,s=(0,hr.Fg)();return(0,Fe.jsx)(pr.Z,{theme:s,children:(0,Fe.jsxs)(Vr.ZP,{container:!0,justifyContent:"space-between",alignItems:"center",style:{marginTop:"20px"},children:[(0,Fe.jsx)(Vr.ZP,{item:!0,className:t.iconContainer,children:(0,Fe.jsx)(Ar.Z,{disabled:a,onClick:l,children:(0,Fe.jsx)(Qr.Z,{style:{color:a?s.textOff:s.textColor}})})}),(0,Fe.jsx)(Vr.ZP,{item:!0,children:(0,Fe.jsx)(ai,{value:(0,Gr.Z)(n),onChange:function(e){r((0,Ur.Z)(n,parseInt(e.target.value)))},children:Yr.map((function(e,n){return(0,Fe.jsx)("option",{value:n,children:e},e)}))})}),(0,Fe.jsx)(Vr.ZP,{item:!0,children:(0,Fe.jsx)(ai,{value:(0,Kr.Z)(n),onChange:function(e){r((0,Jr.Z)(n,parseInt(e.target.value)))},children:me(n,30).map((function(e){return(0,Fe.jsx)("option",{className:"custom-option",value:e,children:e},e)}))})}),(0,Fe.jsx)(Vr.ZP,{item:!0,className:t.iconContainer,children:(0,Fe.jsx)(Ar.Z,{disabled:i,onClick:o,children:(0,Fe.jsx)(Wr.Z,{style:{color:i?s.textOff:s.textColor}})})})]})})})),li=(0,Hr.Z)((function(){return(0,Br.Z)({leftBorderRadius:{borderRadius:"50% 0 0 50%"},rightBorderRadius:{borderRadius:"0 50% 50% 0"},buttonContainer:{display:"flex"},button:{height:30,width:30,padding:0},inactive:{color:"gray"},outlined:{border:"1px solid #11abab"},buttonText:{lineHeight:1.6,color:"primary"},filled:{"&:hover":{backgroundColor:"#11abab",color:"text.primary"},backgroundColor:"#11abab",color:"text.primary"},highlighted:{backgroundColor:"#14b8b852"},contrast:{color:"text.primary"}})}))((function(e){var n=e.classes;return(0,Fe.jsx)(I.a,{theme:ii,children:(0,Fe.jsx)("div",{className:pe(n.buttonContainer,e.startOfRange&&n.leftBorderRadius,e.endOfRange&&n.rightBorderRadius,!e.disabled&&e.highlighted&&n.highlighted,e.disabled&&n.disabled),children:(0,Fe.jsx)(Ar.Z,{className:pe(n.button,!e.disabled&&e.outlined&&n.outlined,!e.disabled&&e.filled&&n.filled),disabled:e.disabled,onClick:e.onClick,onMouseOver:e.onHover,children:(0,Fe.jsx)(Zt.Z,{color:e.disabled?"text.secondary":"text.primary",className:pe(n.buttonText,!e.disabled&&e.filled&&n.contrast,e.disabled&&n.inactive),variant:"body2",children:e.value})})})})})),si=-1,ui=1,ci=(0,Hr.Z)((function(e){return(0,Br.Z)({root:{width:260,background:e.mainBgColor},weekDaysContainer:{marginTop:5,paddingLeft:30,paddingRight:30},daysContainer:{paddingLeft:15,paddingRight:15,marginTop:10,marginBottom:20}})}))((function(e){var n,t,r=(0,hr.Fg)(),i=(0,f.useState)(r),a=(0,u.Z)(i,2),o=a[0],l=a[1],s=e.classes,c=e.helpers,d=e.handlers,p=e.value,v=e.dateRange,h=e.marker,g=e.setValue,m=e.minDate,x=e.maxDate,b=(0,u.Z)(e.navState,2),y=b[0],Z=b[1];return(0,f.useEffect)((function(){l(r)}),[r,l]),(0,Fe.jsx)(I.a,{theme:r,children:(0,Fe.jsx)(Lr.Z,{square:!0,elevation:0,className:s.root,style:{background:r.mainBgColor},children:(0,Fe.jsxs)(Vr.ZP,{container:!0,children:[(0,Fe.jsx)(oi,{date:p,setDate:g,nextDisabled:!Z,prevDisabled:!y,onClickPrevious:function(){return d.onMonthNavigate(h,si)},onClickNext:function(){return d.onMonthNavigate(h,ui)}}),(0,Fe.jsx)(Vr.ZP,{item:!0,container:!0,direction:"row",justifyContent:"space-between",className:s.weekDaysContainer,children:Xr.map((function(e){return(0,Fe.jsx)("div",{style:{color:r.textColor,fontSize:"10px"},children:e},e)}))}),(0,Fe.jsx)(Vr.ZP,{item:!0,container:!0,direction:"column",justifyContent:"space-between",className:s.daysContainer,children:(n=ve(p),t=7,Array.from({length:Math.ceil(n.length/t)},(function(e,r){return n.slice(r*t,r*t+t)}))).map((function(e,n){return(0,Fe.jsx)(Vr.ZP,{container:!0,direction:"row",justifyContent:"center",children:e.map((function(e){var n=function(e,n){var t=e.dateStart;return t&&(0,X.Z)(n,t)}(v,e),t=function(e,n){var t=e.dateEnd;return t&&(0,X.Z)(n,t)}(v,e),r=function(e){var n=e.dateStart,t=e.dateEnd;return!(!n||!t)&&(0,X.Z)(n,t)}(v),i=function(e,n){var t=e.dateStart,r=e.dateEnd;return t&&r&&((0,$.Z)(n,{start:t,end:r})||(0,X.Z)(n,t)||(0,X.Z)(n,r))}(v,e)||c.inHoverRange(e);return(0,Fe.jsx)(li,{themeSelected:o,filled:n||t,outlined:(0,Pr.Z)(e),highlighted:i&&!r,disabled:!(0,ae.Z)(p,e)||!(0,$.Z)(e,{start:m,end:x}),startOfRange:n&&!r,endOfRange:t&&!r,onClick:function(){return d.onDayClick(e)},onHover:function(){return d.onDayHover(e)},value:(0,qr.Z)(e)},(0,st.Z)(e,"mm-dd-yyyy"))}))},n)}))})]})})})})),di=jt.Z.div(wr||(wr=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n padding: 10px;\n max-height: 250px;\n overflow-y: auto;\n flex: 1;\n margin-top: 10px;\n margin-bottom: 10px;\n padding: 5px;\n &::-webkit-scrollbar {\n width: 5px;\n background: ",";\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n button {\n background: none;\n text-align: left;\n border: none;\n padding: 10px;\n line-height: 1.5;\n border-radius: 3px;\n font-size: 12px;\n cursor: pointer;\n &:hover {\n background: ",";\n }\n }\n"])),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonHover})),fi=function(e){var n=(0,hr.Fg)();return(0,Fe.jsx)(I.a,{theme:n,children:(0,Fe.jsx)(di,{children:e.ranges.map((function(t,r){return(0,Fe.jsx)("button",{onClick:function(){e.setRange(t),e.onClose()},children:(0,Fe.jsx)("span",{style:{fontWeight:xe(t,e.selectedRange)?"bold":"normal",color:xe(t,e.selectedRange)?"orange":n.textColor,whiteSpace:"nowrap"},children:t.label})},r)}))})})},pi=t(66713),vi=t(28165),hi=t(31238),gi=jt.Z.div(Sr||(Sr=(0,r.Z)(["\n display: ",";\n flex-direction: column;\n margin: 20px;\n margin-top: 30px;\n .time-selectors {\n display: ",";\n flex-direction: column;\n margin-bottom: 15px;\n .label {\n font-size: 0.85em;\n color: ",";\n width: 50px;\n margin-left: 5px;\n margin-bottom: 5px;\n white-space: nowrap;\n }\n .input-group {\n display: flex;\n margin-bottom: 20px;\n input {\n background:",";\n color:",";\n }\n .date-time-ranged {\n font-size: 14px;\n width: 170px;\n line-height: 20px;\n border: 1px solid ",";\n color: ",";\n margin: 0;\n padding: 0px 8px;\n margin-right: 5px;\n &:focus {\n border: 1px solid\n ",";\n }\n }\n }\n }\n"])),(function(e){return e.isDisplay?"flex":"none"}),(function(e){return e.isDisplay?"flex":"none"}),(function(e){return e.theme.inputLabelColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault})),mi=(0,jt.Z)(Rt.z)(jr||(jr=(0,r.Z)(["\n color: ",";\n background: ",";\n padding: 6px;\n justify-content: center;\n margin-top: 10px;\n margin-bottom: 10px;\n cursor: pointer;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.buttonText}),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.primaryLight})),xi=(0,jt.Z)(Rt.z)(kr||(kr=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n padding: 8px;\n &:hover {\n background: ",";\n color: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}));function bi(e){var n=e.getEditedStartDate,t=e.getEditedEndDate,r=e.handleStart,i=e.handleStop,a=e.onTimeRangeSet,l=e.setCalendarOpen,s=e.isFullCalendar,u=e.setStopCalendar,c=e.setStartCalendar,d=e.startCalendarOpen,f=e.stopCalendarOpen,p=e.isHorizontal,v=e.styles,h=e.isMobile,g=(0,hi.F)();return(0,Fe.jsx)(I.a,{theme:g,children:(0,Fe.jsxs)(gi,{isDisplay:v,children:[(0,Fe.jsxs)("div",{className:"time-selectors",children:[(0,Fe.jsx)("span",{className:"label",children:"From"}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("input",{className:"date-time-ranged",value:o().sanitize(n()),onChange:function(e){return r(e,!1)},onBlur:function(e){return r(e,!0)}}),(0,Fe.jsx)(xi,{onClick:function(){s?l((function(e){return!e})):(l((function(e){return!e||!d})),u((function(){return!1})),c((function(e){return!e})))},children:(0,Fe.jsx)(vi.Z,{style:{height:"16px",width:"16px"}})})]})]}),(0,Fe.jsxs)("div",{className:"time-selectors",children:[(0,Fe.jsx)("span",{className:"label",children:"To"}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("input",{className:"date-time-ranged",value:o().sanitize(t()),onChange:function(e){return i(e,!1)},onBlur:function(e){return i(e,!0)}}),(0,Fe.jsx)(xi,{onClick:function(){s?l((function(e){return!e})):(l((function(e){return!e||!f})),c((function(){return!1})),u((function(e){return!e})))},children:(0,Fe.jsx)(vi.Z,{style:{height:"16px",width:"16px"}})})]})]}),(0,Fe.jsx)(mi,{isHorizontal:p,isMobile:h,onClick:function(e){a(e)},children:"Apply Time Range"})]})})}var yi=jt.Z.button(Cr||(Cr=(0,r.Z)(["\n padding: 10px;\n border-radius: 3px;\n color: ",";\n font-size: 1em;\n border: none;\n background: none;\n display: flex;\n\n cursor: pointer;\n align-items: center;\n justify-content: center;\n margin-bottom: 10px;\n &:hover {\n background: #11111155;\n }\n span {\n margin-right: 4px;\n font-size: 12px;\n }\n"])),(function(e){return e.theme.textPrimaryAccent})),Zi=jt.Z.div(Tr||(Tr=(0,r.Z)(["\n position: absolute;\n .header {\n padding: 10px;\n justify-content: space-between;\n }\n .headerItem {\n text-align: center;\n }\n .dateComplete {\n font-size: 0.85em;\n }\n .divider {\n border-left: 1px solid action;\n margin-bottom: 20;\n }\n .container {\n position: relative;\n z-index: 1000;\n right: 75%; // this should be 100% by default\n top: 30px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n background: ",";\n }\n .applyButton {\n color: white;\n background: hsl(0, 0%, 31%);\n border: 1px solid hsl(0, 0%, 31%);\n padding: 6px 8px;\n border-radius: 3px;\n margin-left: 10px;\n cursor: pointer;\n }\n"])),(function(e){return e.theme.mainBgColor})),wi=function(e){var n=e.ranges,t=e.dateRange,a=e.minDate,o=e.maxDate,s=e.firstMonth,c=e.setFirstMonth,d=e.secondMonth,p=e.setSecondMonth,h=e.setDateRange,g=e.helpers,m=e.handlers,x=(0,hr.Fg)(),b=(0,f.useState)(!1),y=(0,u.Z)(b,2),Z=y[0],w=y[1],S="Last 5 minutes",j=(new Date(Date.now()-3e5),new Date(Date.now()),(0,zr.Z)(d,s)>=2),k={dateRange:t,minDate:a,maxDate:o,helpers:g,handlers:m},C=(0,i.I0)(),T=(0,f.useState)(t.dateStart),D=(0,u.Z)(T,2),N=D[0],M=D[1],E=(0,f.useState)(t.dateEnd),R=(0,u.Z)(E,2),O=R[0],L=R[1],V=(0,f.useState)(!0),z=(0,u.Z)(V,2),F=z[0],B=z[1],H=(0,f.useState)(t.label)||S,P=(0,u.Z)(H,1)[0],q=(0,_.useMediaQuery)({query:"(min-width: 1013px)"}),A=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),Q=(0,_.useMediaQuery)({query:"(orientation: portrait)"}),W=(0,i.v9)((function(e){return e.isSplit})),U=(0,f.useState)(!1),J=(0,u.Z)(U,2),G=J[0],Y=J[1],X=(0,f.useState)(!1),$=(0,u.Z)(X,2),ee=$[0],te=$[1];(0,f.useEffect)((function(){if(P){var e=he(P);M(e.dateStart),L(e.dateEnd)}}),[L,M,P]);var re=function(e,n){e.preventDefault();var t=new Date(e.target.value);n&&(0,ne.Z)(t)?L(t):L(e.target.value)},ie=function(e,n){e.preventDefault();var t=new Date(e.target.value);n&&(0,ne.Z)(t)?M(t):M(e.target.value)},ae=function(n){n.preventDefault();var r=new Date(N),i=new Date(O);(0,Dr.Z)(r)&&!(0,Fr.Z)(t.dateStart,r)&&(C((0,v.qv)(r)),M(r)),(0,ne.Z)(i)&&!(0,Fr.Z)(t.dateEnd,i)&&(C((0,v.wW)(i)),L(i));var a=(0,ne.Z)(i)&&(0,Dr.Z)(r),o=(0,K.Z)(r,i),l=!(0,Fr.Z)(t.dateStart,r)||!(0,Fr.Z)(t.dateEnd,i);a&&o&&l?(C((0,v.Xn)("")),h({dateStart:r,dateEnd:i}),oe({dateStart:r,dateEnd:i}),e.onClose(n)):o||console.log("Invalid time range")},oe=function(e){localStorage.setItem(ei,JSON.stringify(e))},le=function(){return(0,ne.Z)(N)?(0,st.Z)(N,"yyy-MM-dd HH:mm:ss"):N},se=function(){return(0,ne.Z)(O)?(0,st.Z)(O,"yyy-MM-dd HH:mm:ss"):"undefined"!==typeof O?O:""};return(0,Fe.jsx)(I.a,{theme:x,children:(0,Fe.jsx)(Zi,{children:(0,Fe.jsx)(Lr.Z,{className:"container",elevation:5,children:(0,Fe.jsxs)(Vr.ZP,{display:"flex",style:{flex:"1"},children:[Z&&q&&(0,Fe.jsxs)(Vr.ZP,{container:!0,direction:"row",wrap:"nowrap",children:[(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:s,setValue:c,navState:[!0,j],marker:$r.FIRST_MONTH})),(0,Fe.jsx)("div",{className:"divider"}),(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:d,setValue:p,navState:[j,!0],marker:$r.SECOND_MONTH}))]}),Z&&!q&&!Q&&!F&&!W&&(0,Fe.jsxs)(Vr.ZP,{container:!0,direction:"row",wrap:"nowrap",children:[G&&(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:s,setValue:c,navState:[!0,j],marker:$r.FIRST_MONTH})),ee&&(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:d,setValue:p,navState:[j,!0],marker:$r.SECOND_MONTH}))]}),(0,Fe.jsxs)(Vr.ZP,{display:"flex",flex:1,children:[(0,Fe.jsxs)("div",{style:{display:"flex",flexDirection:"column",flex:"1"},children:[A&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("div",{style:{maxHeight:Q?"60vh":"50vh",overflowY:"auto",display:F?"flex":"none",flex:1,flexDirection:"column"},children:(0,Fe.jsx)(fi,{selectedRange:t,isHorizontal:!Q,ranges:n,setRange:h,onClose:e.onClose})}),(0,Fe.jsx)(bi,{styles:!F,getEditedStartDate:le,isHorizontal:!Q,isMobile:!0,isFullCalendar:!1,getEditedEndDate:se,handleStart:ie,handleStop:re,onTimeRangeSet:ae,calendarOpen:Z,stopCalendarOpen:ee,startCalendarOpen:G,setCalendarOpen:w,setStopCalendar:te,setStartCalendar:Y}),A&&(0,Fe.jsxs)(yi,{onClick:function(){B((function(e){return!e}))},theme:x,children:[(0,Fe.jsx)("span",{children:F?"Set Absolute Time":"Set Relative Time"}),(0,Fe.jsx)(pi.Z,{className:(0,ze.iv)(_r||(_r=(0,r.Z)(["\n font-size: 12px;\n "])))})]})]}),!A&&(0,Fe.jsx)(bi,{styles:!0,isMobile:!1,isFullCalendar:!0,getEditedStartDate:le,getEditedEndDate:se,handleStart:ie,handleStop:re,onTimeRangeSet:ae,calendarOpen:Z,setCalendarOpen:w}),Z&&A&&!F&&(0,Fe.jsxs)(Vr.ZP,{container:!0,direction:"row",wrap:"nowrap",children:[G&&(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:s,setValue:c,navState:[!0,j],marker:$r.FIRST_MONTH})),ee&&(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:d,setValue:p,navState:[j,!0],marker:$r.SECOND_MONTH}))]})]}),(0,Fe.jsx)("div",{className:"divider"}),q&&(0,Fe.jsx)(Vr.ZP,{style:{display:"flex",flex:1},children:(0,Fe.jsx)(fi,{selectedRange:t,ranges:n,setRange:h,onClose:e.onClose})})]})]})})})})},Si=function(e){return function(n){n({type:"SET_RANGE_OPEN",rangeOpen:e})}};var ji,ki,Ci=t(88999),Ti=t(21411),_i=t(24064),Ii=jt.Z.div(ji||(ji=(0,r.Z)(['\n display: flex;\n flex-direction: column;\n justify-content: "center";\n padding: "3px";\n .time-span {\n text-align: center;\n }\n'])));function Di(e){var n=e.dateRange,t=(0,hr.Fg)();return(0,Fe.jsx)(I.a,{theme:t,children:(0,Fe.jsxs)(Ii,{children:[(0,Fe.jsx)("span",{className:"time-span",children:(0,ne.Z)(n.dateStart)?(0,st.Z)(n.dateStart,"yyyy/MM/dd HH:mm:ss"):n.dateStart}),(0,Fe.jsx)("span",{className:"time-span",children:"to"}),(0,Fe.jsx)("span",{className:"time-span",children:(0,ne.Z)(n.dateEnd)?(0,st.Z)(n.dateEnd,"yyyy/MM/dd HH:mm:ss"):"undefined"!==typeof n.dateEnd?n.dateEnd:""})]})})}var Ni=(0,ze.iv)(ki||(ki=(0,r.Z)(["\n svg {\n font-size: 1.15em;\n margin: 0px 2px;\n }\n .tooltip {\n background-color: red;\n display: flex;\n align-items: center;\n justify-items: center;\n }\n\n @media screen and (max-width: 1200px) {\n font-size: 1em;\n padding: 8px;\n color: #ddd;\n line-height: 1.5;\n svg {\n margin-right: 0;\n }\n span {\n display: none;\n }\n }\n"]))),Mi=function(e){try{var n=localStorage.getItem(e);if("string"===typeof n){var t=JSON.parse(n);if(t.dateStart&&t.dateEnd)return JSON.parse(n)}}catch(r){return console.log(r),{dateStart:"",dateEnd:""}}},Ei=function(e){return(0,Fe.jsx)(_i.Z,(0,l.Z)({id:e.id,elevation:0,anchorOrigin:{vertical:"bottom",horizontal:"left"},PaperProps:{sx:{background:e.qryntheme.buttonDefault,color:e.qryntheme.textColor}},transformOrigin:{vertical:"bottom",horizontal:"left"}},e))},Ri=["1m","5m","10m","30m","1h","3h","6h","12h","24h"];var Oi=function(e){var n=Date.now(),t=e.id,r=e.minDate,a=e.maxDate,o=e.startTs,s=e.stopTs,c=e.label,d=e.onLabelChange,p=e.onStartChange,v=e.onStopChange,h=e.pickerOpen,g=e.onPickerOpen,m=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),x=(0,i.v9)((function(e){return e.isSplit})),b=(0,hr.Fg)(),y={label:"Last 5 minutes",dateStart:new Date(Date.now()-3e5),dateEnd:new Date(Date.now())},Z=function(){try{var e=Mi(ei);if(!e)return y;if(""!==(null===e||void 0===e?void 0:e.label)&&"undefined"!==typeof e.label){var n=he(null===e||void 0===e?void 0:e.label);e.dateStart=n.dateStart,e.dateEnd=n.dateEnd}else e.dateStart=new Date(e.dateStart),e.dateEnd=new Date(e.dateEnd);return e}catch(t){if((0,Dr.Z)(o)&&(0,Dr.Z)(s))return{dateStart:o,dateEnd:s}}},w=ge(r,(0,Nr.Z)(n,-10)),S=ge(a,(0,Nr.Z)(n,10)),j=be(Z()||{},w,S),k=(0,u.Z)(j,2),C=k[0],T=k[1],M=(0,f.useState)((0,l.Z)({},Z())),E=(0,u.Z)(M,2),R=E[0],O=E[1],L=(0,f.useState)(),V=(0,u.Z)(L,2),z=V[0],F=V[1],B=(0,f.useState)(C||n),H=(0,u.Z)(B,2),P=H[0],q=H[1],A=(0,f.useState)(T||(0,oe.Z)(P,1)),Q=(0,u.Z)(A,2),W=Q[0],U=Q[1],J=(0,f.useMemo)((function(){return{dateStart:o,dateEnd:s,label:c}}),[o,s,c]);(0,f.useEffect)((function(){d(J.label)}),[J.label]);var G=R.dateStart,Y=R.dateEnd,ee=function(){var e=(0,i.I0)(),n=(0,f.useRef)(null),t=function(n){"Escape"===n.key&&e(Si(!1))},r=function(t){n.current&&!n.current.contains(t.target)&&e(Si(!1))};return(0,f.useEffect)((function(){return document.addEventListener("keydown",t,!0),document.addEventListener("click",r,!0),function(){document.removeEventListener("keydown",t,!0),document.removeEventListener("click",r,!0)}})),{ref:n}}().ref,te=function(e){localStorage.setItem(ei,JSON.stringify(e))},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===e||void 0===e||e.preventDefault(),g(!1)},se={inHoverRange:function(e){return G&&!Y&&z&&(0,Mr.Z)(z,G)&&(0,$.Z)(e,{start:G,end:z})}},ue={onDayClick:function(e){if(!G||Y||(0,K.Z)(e,G))O({dateStart:e,dateEnd:void 0});else{var n={dateStart:G,dateEnd:e};ce(n),te(n),O(n),d(""),le()}F(e)},onDayHover:function(e){G&&!Y&&(z&&(0,X.Z)(e,z)||F(e))},onMonthNavigate:function(e,n){if(e===$r.FIRST_MONTH){var t=(0,oe.Z)(P,n);(0,K.Z)(t,W)&&q(t)}else{var r=(0,oe.Z)(W,n);(0,K.Z)(P,r)&&U(r)}}};function ce(e){var n=e.dateStart,t=e.dateEnd,r=e.label,i=(0,Dr.Z)(n),a=(0,Dr.Z)(t),o="undefined"!==typeof r;i&&p(n),a&&v(t),o&&d(r)}var de=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"range",t="backward"===e?Er.Z:Rr.Z,r={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};"range"===n?r=(0,Or.Z)({start:G,end:Y}):n.includes("d")?r.days=parseInt(n):n.includes("h")?r.hours=parseInt(n):n.includes("m")?r.minutes=parseInt(n):n.includes("s")&&(r.seconds=parseInt(n));var i={dateStart:t(G,r),dateEnd:t(Y,r),label:""};O(i),te(i),ce(i)},fe=(0,f.useState)(null),pe=(0,u.Z)(fe,2),ve=pe[0],me=pe[1],xe=Boolean(ve),Ze=(0,f.useState)(null),we=(0,u.Z)(Ze,2),Se=we[0],je=we[1],ke=Boolean(Se),Ce=function(e,n,t){me(null),je(null),n&&t&&de(n,t)};return(0,Fe.jsxs)("div",{style:{display:"flex"},children:[!m&&!x&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(Lt,{onClick:function(){de("backward")},attachedside:"r",emptySide:"l",className:(0,ze.cx)(Ni),children:(0,Fe.jsx)(Ti.Z,{})}),(0,Fe.jsx)(Lt,{onClick:function(e){me((function(n){return e.currentTarget}))},attachedside:"both",size:"small",className:(0,ze.cx)(Ni),"aria-controls":xe?"backward-menu":void 0,"aria-haspopup":"true","aria-expanded":xe?"true":void 0,children:(0,Fe.jsx)(yt.Z,{})}),(0,Fe.jsx)(Ei,{id:"backward-menu",anchorEl:ve,open:xe,onClose:Ce,qryntheme:b,children:Ri.map((function(e){return(0,Fe.jsx)(N.Z,{sx:{"&.MuiMenuItem-root":{fontSize:12}},onClick:function(n){return Ce(0,"backward",e)},children:e},"".concat(e," l"))}))})]}),(0,Fe.jsx)(D.Z,{title:c?(0,Fe.jsx)(Di,{dateRange:R}):"",children:(0,Fe.jsxs)(Lt,{onClick:function(e){e.preventDefault(),!0===h?le(e):g(!0)},className:(0,ze.cx)(Ni),attachedside:"both",children:[(0,Fe.jsx)(Ci.Z,{}),(0,Fe.jsx)("span",{children:c||((0,ne.Z)(R.dateStart)?(0,st.Z)(R.dateStart,"yyyy/MM/dd HH:mm:ss"):R.dateStart)+"-"+((0,ne.Z)(R.dateEnd)?(0,st.Z)(R.dateEnd,"yyyy/MM/dd HH:mm:ss"):"undefined"!==typeof R.dateEnd?R.dateEnd:"")})]})}),!m&&!x&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(Lt,{onClick:function(e){je((function(n){return e.currentTarget}))},id:"forward-button-".concat(t),size:"small",className:(0,ze.cx)(Ni),"aria-controls":ke?"forward-menu".concat(t):void 0,"aria-haspopup":"true","aria-expanded":ke?"true":void 0,children:(0,Fe.jsx)(yt.Z,{})}),(0,Fe.jsx)(Ei,{id:"forward-menu-".concat(t),anchorEl:Se,open:ke,onClose:Ce,qryntheme:b,children:Ri.map((function(e){return(0,Fe.jsx)(N.Z,{sx:{"&.MuiMenuItem-root":{fontSize:12}},onClick:function(n){return Ce(0,"forward",e)},children:e},"".concat(e," r"))}))}),(0,Fe.jsx)(Lt,{onClick:function(){de("forward")},attachedside:"l",className:(0,ze.cx)(Ni),children:(0,Fe.jsx)(mt.Z,{})})]}),h?(0,Fe.jsx)("div",{tabIndex:0,ref:ee,children:(0,Fe.jsx)(I.a,{theme:b,children:(0,Fe.jsx)(wi,{dateRange:R,minDate:w,maxDate:S,ranges:ye(new Date),firstMonth:P,secondMonth:W,setFirstMonth:function(e){(0,K.Z)(e,W)&&q(e)},setSecondMonth:function(e){(0,Mr.Z)(e,P)&&U(e)},setDateRange:function(e){var n=e.label,t=e.dateStart,r=e.dateEnd;t&&r&&(e.label=n,e.dateStart=t=(0,re.Z)([t,w]),e.dateEnd=r=(0,ie.Z)([r,S]),O(e),te(e),ce(e),q(t),U((0,ae.Z)(t,r)?(0,oe.Z)(t,1):r))},helpers:se,handlers:ue,onClose:le})})}):null]})};function Li(e){var n=e.historyTabHeader,t=e.historyTab,r=e.starredHistoryTab,i=e.closeButton,a=e.linksTabHeader,o=e.linksTab,l=e.settingTab,s=e.settingTabHeader;return(0,Fe.jsxs)(zt,{defaultValue:0,children:[(0,Fe.jsxs)(Ut,{children:[(0,Fe.jsxs)(Ft,{children:[(0,Fe.jsx)(Bt,{}),(0,Fe.jsx)("span",{children:"Queries"})]}),(0,Fe.jsxs)(Ft,{children:[(0,Fe.jsx)(qt,{}),(0,Fe.jsx)("span",{children:"Links"})]}),(0,Fe.jsxs)(Ft,{children:[(0,Fe.jsx)(Ht,{}),(0,Fe.jsx)("span",{children:"Starred"})]}),(0,Fe.jsxs)(Ft,{children:[(0,Fe.jsx)(Pt,{}),(0,Fe.jsx)("span",{children:"Settings"})]}),i]}),(0,Fe.jsxs)(Wt,{value:0,children:[n,t]}),(0,Fe.jsxs)(Wt,{value:1,children:[a,o]}),(0,Fe.jsx)(Wt,{value:2,children:r}),(0,Fe.jsxs)(Wt,{value:3,children:[s,l]})]})}function Vi(e){var n,t=e.pos,r=e.item,i=e.copyLink,a=e.handleDelete,o=e.handleStarLinkItem,l=e.handleSubmit,s=e.label,c=(0,f.useState)(!1),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=r.fromDate,g=r.toDate,m=r.type,x=r.url,b=r.queryInput,y=r.limit;return(0,Fe.jsxs)(ar,{open:p,children:[(0,Fe.jsx)(zi,{pos:t,onOpen:p}),(0,Fe.jsx)("button",{className:"open-button",onClick:function(){v((function(e){return!e}))},children:p?(0,Fe.jsx)(bt.Z,{fontSize:"small"}):(0,Fe.jsx)(xt.Z,{fontSize:"small"})}),(0,Fe.jsxs)("div",{className:"inline-params",children:[(0,Fe.jsx)(D.Z,{title:"API URL",children:(0,Fe.jsxs)("span",{style:{display:"flex",alignItems:"center"},children:[(0,Fe.jsx)(pt.Z,{fontSize:"small",style:{marginRight:"3px"}})," ",x]})}),(0,Fe.jsxs)("span",{style:{whiteSpace:"nowrap"},children:["limit: ",y]}),(0,Fe.jsxs)("span",{style:{whiteSpace:"nowrap"},children:["step: ",null===r||void 0===r||null===(n=r.params)||void 0===n?void 0:n.step]}),(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[" ",(0,Fe.jsx)(D.Z,{title:"".concat(h," - ").concat(g),children:(0,Fe.jsx)(vt.Z,{style:{marginRight:"3px",height:"14px",width:"14px"}})})," ",(0,Fe.jsxs)(lr,{children:[h," - ",g]})]})]}),(0,Fe.jsxs)("div",{className:"block-params",children:[(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" Query:"})," ",(0,Fe.jsx)("span",{className:"value",children:b})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" API URL:"})," ",(0,Fe.jsx)("span",{className:"value",children:x})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" Data Source Type:"})," ",(0,Fe.jsx)("span",{className:"value",children:m})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:"From: "})," ",(0,Fe.jsx)("span",{className:"value",children:h})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" To: "})," ",(0,Fe.jsxs)("span",{className:"value",children:[" ",g]})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:"Limit: "})," ",(0,Fe.jsx)("span",{className:"value",children:y})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" Step:"})," ",(0,Fe.jsx)("span",{className:"value",children:r.params.step})," "]})]}),(0,Fe.jsx)(Fi,{item:r,onOpen:p,copyLink:i,handleDelete:a,handleStarLinkItem:o,handleSubmit:l,label:s})]})}function zi(e){var n=e.pos,t=e.onOpen;return(0,Fe.jsx)("div",{style:{display:t?"none":"flex",width:"30vw"},children:(0,Fe.jsxs)(ir,{children:["Link ",n," "]})})}function Fi(e){var n=e.item,t=e.onOpen,r=e.copyLink,i=e.handleDelete,a=e.handleStarLinkItem,o=e.handleSubmit,l=e.label,s=(0,hr.Fg)(),c=(0,f.useState)(null),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=Boolean(p),g=(0,f.useState)(!1),m=(0,u.Z)(g,2),x=m[0],b=m[1];return(0,Fe.jsxs)("div",{style:{display:"flex",flexDirection:t?"column-reverse":"row",justifyContent:"space-between",alignItems:"center"},children:[(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(D.Z,{title:"Copy Link to Clipboard",placement:"right-end",children:(0,Fe.jsxs)("span",{style:{display:"flex"},children:[(0,Fe.jsx)(Kt,{onClick:function(e){return r(null===n||void 0===n?void 0:n.data,"link",x)},isActive:!0,style:{flex:1},className:"URL-COPY",attachedside:"r",children:(0,Fe.jsx)(pt.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})}),(0,Fe.jsx)(Kt,{attachedside:"l",onClick:function(e){v((function(n){return e.currentTarget})),b((function(e){return x}))},size:"small",className:"date-time-selector","aria-controls":h?"backward-menu":void 0,"aria-haspopup":"true","aria-expanded":h?"true":void 0,children:(0,Fe.jsx)(yt.Z,{fontSize:"small"})}),(0,Fe.jsx)(Ei,{id:"backward-menu",anchorEl:p,open:h,onClose:function(e,n,t){v(null)},qryntheme:s,size:"small",children:(0,Fe.jsx)(N.Z,{style:{padding:"0 14px"},children:(0,Fe.jsx)(M.Z,{children:(0,Fe.jsx)(E.Z,{style:{padding:"0",marginRight:0,cursor:l?"default":"not-allowed"},checked:x,onChange:function(e){b((function(n){return Boolean(e.target.checked)}))},control:(0,Fe.jsx)(R.Z,{style:{paddingRight:"0px",marginRight:"3px"},sx:{"& .MuiSvgIcon-root":{fontSize:14}},disabled:!l}),label:(0,Fe.jsx)(Zt.Z,{style:{fontSize:"12px",color:s.textColor},children:"Relative time"})})})},"relativeTime")})]})})}),(0,Fe.jsx)(D.Z,{title:"Delete Query",children:(0,Fe.jsx)(Kt,{onClick:function(e){return i(n)},children:(0,Fe.jsx)(ut.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Star / Unstar Link",children:(0,Fe.jsx)(Kt,{onClick:function(){return a(n)},children:n.starred?(0,Fe.jsx)(ct.Z,{style:{height:"14px",width:"14px"},fontSize:"small"}):(0,Fe.jsx)(dt.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Search Logs from Query",children:(0,Fe.jsxs)(Xt,{onClick:function(){return o(null===n||void 0===n?void 0:n.data)},children:[(0,Fe.jsx)(gt.Z,{className:"open-icon",fontSize:"small"}),(0,Fe.jsx)("span",{className:"open-text",children:"Open In New Tab"})]})})]})}function Bi(e){var n=e.queryHistory,t=e.copyQuery,r=e.handleDelete,i=e.handleStarItem,a=e.handleSubmit,o=e.filtered,l=e.emptyMessage,s=e.isStarred,c=(0,f.useState)([]),d=(0,u.Z)(c,2),p=d[0],v=d[1];function h(e){var n="";if("string"===typeof e)try{n=JSON.parse(e).queryInput}catch(t){n=e}return n}return(0,f.useEffect)((function(){v(n)}),[]),(0,f.useEffect)((function(){o.length>0&&v(o)}),[o]),(0,f.useEffect)((function(){v(n)}),[n]),(0,Fe.jsx)(Gt,{className:s?"starredCont":"",children:p.length>0?null===p||void 0===p?void 0:p.map((function(e,n){return(0,Fe.jsxs)(or,{children:[(0,Fe.jsx)("span",{style:{color:"#666",paddingRight:"10px",width:"10px",display:"flex",alignItems:"center"},children:p.length-n}),(0,Fe.jsx)(D.Z,{title:e.data,children:(0,Fe.jsxs)(ir,{children:[h(e.data)," "]})}),(0,Fe.jsx)("span",{children:(0,st.Z)(e.timestamp,"yyyy/MM/dd HH:mm:ss")}),(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Fe.jsx)(D.Z,{title:"Copy Query to Clipboard",children:(0,Fe.jsx)(Kt,{onClick:function(){return t(e.data)},children:(0,Fe.jsx)(ft.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Delete Query",children:(0,Fe.jsx)(Kt,{onClick:function(){return r(e)},children:(0,Fe.jsx)(ut.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Star / Unstar Query",children:(0,Fe.jsx)(Kt,{onClick:function(){return i(e)},children:e.starred?(0,Fe.jsx)(ct.Z,{style:{height:"14px",width:"14px"},fontSize:"small"}):(0,Fe.jsx)(dt.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Search Logs from Query",children:(0,Fe.jsxs)(Xt,{onClick:function(){return a(e)},children:[(0,Fe.jsx)(mt.Z,{className:"open-icon"}),(0,Fe.jsx)("span",{className:"open-text",children:"Show Results"})]})})]})]},n)})):(0,Fe.jsx)(xr,{message:l})})}function Hi(e){var n=e.linksHistory,t=e.copyLink,r=e.handleDelete,i=e.handleStarLinkItem,a=e.handleSubmit,o=e.filtered,l=e.emptyMessage,s=e.isStarred,c=e.label,d=(0,f.useState)([]),p=(0,u.Z)(d,2),v=p[0],h=p[1];return(0,f.useEffect)((function(){h(n)}),[]),(0,f.useEffect)((function(){o.length>0&&h(o)}),[o]),(0,f.useEffect)((function(){h(n)}),[n]),(0,Fe.jsx)(Gt,{className:s?"starredCont":"",children:v.length>0?null===v||void 0===v?void 0:v.map((function(e,n){return(0,Fe.jsxs)(or,{children:[(0,Fe.jsx)("span",{style:{paddingRight:"10px",color:"#666",width:"10px",display:"flex",alignItems:"center"},children:(null===v||void 0===v?void 0:v.length)-n}),(0,Fe.jsx)(Vi,{pos:(null===v||void 0===v?void 0:v.length)-n,item:e,copyLink:t,handleDelete:r,handleStarLinkItem:i,handleSubmit:a,label:c})]},n)})):(0,Fe.jsx)(xr,{message:l})})}function Pi(e){var n=e.starredQueries,t=e.starredLinks,r=e.handleDeleteQuery,i=e.handleDeleteLink,a=e.handleStarItem,o=e.handleStarLinkItem,l=e.handleSubmitQuery,s=e.handleSubmitLink,c=e.filteredLinks,d=e.filteredQueries,p=e.setFilteredStarLink,v=e.setFilteredStarQuery,h=e.filterItems,g=e.emptyQueryMessage,m=e.emptyLinkMessage,x=e.copyQuery,b=e.label,y=(0,f.useState)([]),Z=(0,u.Z)(y,2),w=Z[0],S=Z[1],j=(0,f.useState)([]),k=(0,u.Z)(j,2),C=k[0],T=k[1];return(0,f.useEffect)((function(){S(n),T(t)}),[]),(0,f.useEffect)((function(){c.length>0&&T(c),d.length>0&&S(d)}),[c,d]),(0,f.useEffect)((function(){S(n),T(t)}),[n,t]),(0,Fe.jsxs)(ht.Z,{defaultValue:0,children:[(0,Fe.jsxs)(Ut,{children:[(0,Fe.jsx)(Ft,{children:"Queries"}),(0,Fe.jsx)(Ft,{children:"Links"})]}),(0,Fe.jsxs)(Wt,{value:0,children:[(0,Fe.jsx)(qi,{searchQueriesText:"Queries",queryHistory:n,filterItems:h,setFilteredItems:v}),(0,Fe.jsx)(Bi,{queryHistory:w,copyQuery:x,handleDelete:r,handleStarItem:a,handleSubmit:l,filtered:d,emptyMessage:g,isStarred:!0})]}),(0,Fe.jsxs)(Wt,{value:1,children:[(0,Fe.jsx)(qi,{searchQueriesText:"Links",queryHistory:t,filterItems:h,setFilteredItems:p}),(0,Fe.jsx)(Hi,{linksHistory:C,copyQuery:x,handleDelete:i,handleStarLinkItem:o,handleSubmit:s,filtered:c,emptyMessage:m,isStarred:!0,label:b})]})]})}function qi(e){var n=e.queryHistory,t=e.filterItems,r=e.setFilteredItems,i=e.searchQueriesText,a=(0,f.useState)(""),l=(0,u.Z)(a,2),s=l[0],c=l[1];return(0,Fe.jsx)(Qt,{children:(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Fe.jsx)(At,{}),(0,Fe.jsx)(rr,{type:"text",value:o().sanitize(s),onChange:function(e){var i=e.target.value;c(i);var a=t(n,i);a.length>0?r(a):r([])},placeholder:"Search ".concat(i)})," ",(0,Fe.jsxs)("span",{style:{margin:"0px 4px"},children:["Total: ",n.length]})]})})}function Ai(e){var n=e.queryHistory,t=e.linksHistory;return(0,Fe.jsx)(Qt,{children:(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Fe.jsxs)("span",{style:{margin:"0px 4px"},children:["Query History Rows: ",null===n||void 0===n?void 0:n.length]})," | ",(0,Fe.jsxs)("span",{style:{margin:"0px 4px"},children:["Links History Rows: ",null===t||void 0===t?void 0:t.length]})]})})}function Qi(e){var n=e.clearHistory,t=e.clearLinksHistory;return(0,Fe.jsx)(Gt,{children:(0,Fe.jsxs)("div",{style:{display:"flex"},children:[(0,Fe.jsxs)(Yt,{children:[(0,Fe.jsx)("div",{children:"Clear Query History"}),(0,Fe.jsx)("small",{children:"Delete all of your query history, permanently."}),(0,Fe.jsx)(mr,{dialogType:"Query",clearHistory:n})]}),(0,Fe.jsxs)(Yt,{children:[(0,Fe.jsx)("div",{children:"Clear Links History"}),(0,Fe.jsx)("small",{children:"Delete all of your links history, permanently."}),(0,Fe.jsx)(mr,{dialogType:"Links",clearHistory:t})]})]})})}var Wi=function(e){var n="Link Copied To Clipboard",t=(0,i.I0)(),r=(0,L.Z)().historyStore(),a=(0,wt.Z)(),o=(0,i.v9)((function(e){return e.queryHistory})),s=(0,i.v9)((function(e){return e.linksHistory})),c=(0,i.v9)((function(e){return e.historyOpen})),d=(0,hr.Fg)(),p=(0,f.useState)([]),h=(0,u.Z)(p,2),g=h[0],m=h[1],x=(0,f.useState)([]),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useState)([]),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,f.useState)([]),T=(0,u.Z)(C,2),_=T[0],I=T[1],D=(0,f.useState)([]),N=(0,u.Z)(D,2),M=N[0],E=N[1],R=(0,f.useState)(!1),z=(0,u.Z)(R,2),F=z[0],B=z[1],H=(0,i.v9)((function(e){return e})),P=H.start,q=H.stop,A=(0,i.v9)((function(e){return e.label}));function Q(e){var n=r.remove(e);t(V(n)),t((0,v.el)({message:"Query deleted succesfully",type:Ir.m.info}))}function W(e){var n=a.remove(e);t((0,St.Z)(n))}function U(e){var n={};try{n=JSON.parse(e.data)}catch(x){n=(0,l.Z)({},{id:"",limit:100,panel:"left",queryInput:"",queryType:"range",direction:"forward"})}var r=n,i=r.id,a=r.limit,o=r.panel,s=r.queryInput,u=r.queryType,c=r.type,d=r.dataSourceId,f=r.url,p=r.direction,v="",h=0;if(s.includes("$__interval")){var g=(q.getTime()-P.getTime())/1e3/30/+1..toFixed(1),m=Math.round(g*window.devicePixelRatio.toFixed(2));v=s.replace(/\[\$__interval\]/,"[".concat(m,"s]")),h=m}else v=s;t(Tn(c,v,u,a,o,i,p||"forward",d,f,h))}function J(e){window.open(e)}function G(e,n){return null===e||void 0===e?void 0:e.filter((function(e){return e.data.toLowerCase().includes(n.toLowerCase())}))}function K(e){E(e)}function Y(e){var n=(0,l.Z)((0,l.Z)({},e),{},{starred:!e.starred}),i=r.update(n);t(V(i)),n.starred?t((0,v.el)({message:"Query starred succesfully",type:Ir.m.success})):t((0,v.el)({message:"Query unstarred succesfully",type:Ir.m.success}))}function X(e){var n=(0,l.Z)((0,l.Z)({},e),{},{starred:!e.starred}),r=a.update(n);t((0,St.Z)(r)),n.starred?t((0,v.el)({message:"Link starred succesfully",type:Ir.m.success})):t((0,v.el)({message:"Link unstarred succesfully",type:Ir.m.success}))}function $(){t((0,v.el)({type:"success",message:n}))}function ee(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"query",t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new URL(e).hash,i=new URLSearchParams(r.replace(/#/,""));i.set("label",A);var a=new URL(window.location.href);a.hash="#".concat(i.toString());var o="query"===n?JSON.parse(e).queryInput:t&&A?a:e;setTimeout((function(){var e;null!==(e=navigator)&&void 0!==e&&e.clipboard&&window.isSecureContext?function(e){navigator.clipboard.writeText(e).then((function(){$()}),(function(e){console.log("error on copy",e)}))}(o):function(e){var n=document.createElement("textarea");n.value=e,n.style={position:"fixed",left:"-999999px",top:"-999999px"},document.body.appendChild(n),n.focus(),n.select(),new Promise((function(e,t){$(),document.execCommand("copy")?e():t(),n.remove()}))}(o)}),200)}function ne(){var e=r.clean();t(V(e)),(null===e||void 0===e?void 0:e.length)<1&&t((0,v.el)({message:"Query History cleared succesfully",type:Ir.m.info}))}return(0,f.useEffect)((function(){var e=(null===o||void 0===o?void 0:o.filter((function(e){return e.starred})))||[],n=(null===s||void 0===s?void 0:s.filter((function(e){return e.starred})))||[];B(n),m(e)}),[o,s]),(0,Fe.jsx)(O.Z,{theme:d,children:c&&(0,Fe.jsx)(Vt,{anchor:"bottom",style:{maxHeight:"250px"},open:c,variant:"persistent",theme:d,children:(0,Fe.jsx)(Li,{historyTabHeader:(0,Fe.jsx)(qi,{searchQueriesText:"Queries",queryHistory:o,clearHistory:ne,filterItems:G,setFilteredItems:function(e){Z(e)}}),historyTab:(0,Fe.jsx)(Bi,{queryHistory:o,copyQuery:ee,handleDelete:Q,handleStarItem:Y,handleSubmit:U,filtered:y,emptyMessage:"There is no query history. Please execute some queries and you will see a history here."}),linksTabHeader:(0,Fe.jsx)(qi,{searchQueriesText:"Links",queryHistory:s,filterItems:G,setFilteredItems:function(e){k(e)}}),linksTab:(0,Fe.jsx)(Hi,{linksHistory:s,copyLink:ee,handleDelete:W,handleStarLinkItem:X,handleSubmit:J,filtered:j,label:A,emptyMessage:"There is no links history. Please execute some queries and share links and you will see a history here."}),starredTabHeader:(0,Fe.jsx)(qi,{searchQueriesText:"Queries",queryHistory:g,clearHistory:ne,filterItems:G,setFilteredItems:K}),starredTab:(0,Fe.jsx)(Bi,{queryHistory:g,copyQuery:ee,handleDelete:Q,handleStarItem:Y,handleSubmit:U,filtered:M,emptyMessage:"Click the \u2018Star\u2019 icon to save queries and find them here to reuse again"}),starredHistoryTab:(0,Fe.jsx)(Pi,{starredQueries:g,starredLinks:F,handleDeleteQuery:Q,handleDeleteLink:W,handleStarItem:Y,handleStarLinkItem:X,handleSubmitQuery:U,handleSubmitLink:J,filterItems:G,setFilteredStarLink:function(e){I(e)},setFilteredStarQuery:K,filteredQueries:M,filteredLinks:_,emptyQueryMessage:"Click the 'Star' icon to save links and find them here to reuse again",emptyLinkMessage:"Click the 'Star' icon to save queries and find them here to reuse again",copyQuery:ee,label:A}),settingTabHeader:(0,Fe.jsx)(Ai,{queryHistory:o,linksHistory:s}),settingTab:(0,Fe.jsx)(Qi,{clearHistory:ne,clearLinksHistory:function(){var e=a.clean();t((0,St.Z)(e)),(null===e||void 0===e?void 0:e.length)<1&&t((0,v.el)({message:"Links History cleared succesfully",type:Ir.m.info}))}}),closeButton:(0,Fe.jsx)(yr,{onClose:function(){t(lt(!1))}})})})})},Ui=t(99811),Ji=function(e){var n=e.type,t=e.actualQuery,r=e.total,i=e.dataView;return(0,f.useMemo)((function(){var e=("matrix"===n||"flux"===n)&&(null===t||void 0===t?void 0:t.tableView),a="stream"===n&&(null===t||void 0===t?void 0:t.tableView),o="",l="",s="",u="";if(e){var c,d=25*(null===i||void 0===i||null===(c=i.tableData)||void 0===c?void 0:c.total),f=d<330?d:330;o="".concat(f+25,"px"),s="".concat(f,"px"),l="fit-content",u="fit-content"}if("vector"===n||a){var p=25*r,v=p<330?p:330;o="".concat(v+25,"px"),s="".concat(v,"px"),l="fit-content",u="fit-content"}if("stream"===n&&(null===t||void 0===t||!t.tableView)){var h=25*r<350?"fit-content":"inherit";o=h,s=h,l="fit-content",u="fit-content"}return"matrix"!==n&&"flux"!==n||null!==t&&void 0!==t&&t.tableView||(o="fit-content",s="400px",l="fit-content",u="fit-content"),{regularCont:o,regularView:s,maxCont:l,maxView:u}}),[r,n,null===t||void 0===t?void 0:t.tableView])},Gi=function(e){var n,t=e.total,r=e.panelSize,i=e.dataView,a=0;"matrix"===i.type?a=null===i||void 0===i||null===(n=i.tableData)||void 0===n?void 0:n.total:a=t;return(0,f.useMemo)((function(){var e=25*a;return"max"===r?e:"min"===r?0:e<310?e:310}),[r])},Ki=function(e){var n=e.panel,t=e.dataView;return(0,f.useMemo)((function(){var e={};return n&&t&&(e=null===n||void 0===n?void 0:n.find((function(e){return e.id===t.id}))),e}),[n,t])};function Yi(e){var n=e.name;return(0,Fe.jsx)(Fe.Fragment,{children:n})}var Xi,$i,ea,na,ta,ra,ia,aa,oa,la,sa=t(85281),ua=(jt.Z.div(Xi||(Xi=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n margin: 5px;\n padding: 6px;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n flex: 1;\n border-radius: 3px;\n\n &::-webkit-scrollbar {\n width: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.mainBgColor}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.scrollbarThumb})),jt.Z.div($i||($i=(0,r.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n height: 100%;\n font-size: 0.75em;\n letter-spacing: 1px;\n padding: 30px;\n color: ",";\n background: ",";\n text-align: center;\n"])),(function(e){return e.theme.textOff}),(function(e){return e.theme.secondaryWidgetContainer}))),ca=(jt.Z.div(ea||(ea=(0,r.Z)(["\n display: flex;\n align-items: center;\n font-size: 10px;\n font-family: monospace;\n margin: 0px 10px;\n color: ",";\n span {\n background: ",";\n padding: 4px;\n border-radius: 4px;\n border: 1px solid ",";\n margin: 0px 5px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder})),jt.Z.div(na||(na=(0,r.Z)(["\n display: flex;\n min-height: min-content;\n flex-direction: column;\n height: 100%;\n"]))),(0,jt.Z)(sa.Z)(ta||(ta=(0,r.Z)(["\n position: absolute;\n top: 50px;\n left: 0;\n right: 0;\n margin: auto;\n"]))),jt.Z.div(ra||(ra=(0,r.Z)(["\n overflow-y: auto;\n margin: 2px;\n display: flex;\n flex-direction: column;\n flex: 1;\n max-height: 100vh;\n &::-webkit-scrollbar {\n background: transparent;\n }\n ::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n"])))),da=jt.Z.div(ia||(ia=(0,r.Z)(["\n display: flex;\n align-items: center;\n color: ",";\n font-size: 12px;\n .header-actions {\n justify-self: flex-end;\n .header-icon {\n padding: 1px 2px;\n margin: 0px 2px;\n border-radius: 3px;\n cursor: pointer;\n color: ",";\n &:hover {\n background: ",";\n }\n }\n }\n .view-header-info {\n display: flex;\n flex: 1;\n align-items: center;\n span {\n margin: 0px 3px;\n .exp {\n font-family: monospace;\n }\n }\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault})),fa=jt.Z.div(aa||(aa=(0,r.Z)(["\n margin: 0px 2px;\n padding: 2px;\n font-size: 10px;\n border: 1px solid ",";\n border-radius: 3px;\n"])),(function(e){return e.theme.buttonBorder})),pa=jt.Z.div(oa||(oa=(0,r.Z)(["\n display: flex;\n align-items: center;\n margin: 0px 12px;\n flex: 1;\n max-width: 450px;\n overflow-x: auto;\n &::-webkit-scrollbar {\n width: 5px;\n height: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.scrollbarThumb})),va=jt.Z.div(la||(la=(0,r.Z)(["\n background: ",";\n color: ",";\n display: flex;\n flex-direction: column;\n padding: 20px;\n div {\n width: 100%;\n overflow-wrap: break-word;\n font-family: monospace;\n }\n p {\n padding: 10px;\n font-size: 12px;\n display: flex;\n flex: 1;\n align-items: center;\n flex-wrap: wrap;\n span.label {\n background: ",";\n color: ",";\n margin: 2px;\n padding: 2px;\n border-radius: 2px;\n }\n }\n h4 {\n margin-bottom: 20px;\n padding-bottom: 4px;\n border-bottom: 1px solid ",";\n }\n pre {\n font-family: monospace;\n }\n small {\n font-size: 10px;\n }\n"])),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.buttonBorder})),ha=t(33973),ga=t(446),ma=function(e){var n=e.labels;return(null===n||void 0===n?void 0:n.length)>0?(0,Fe.jsxs)("p",{children:["Labels:",n.map((function(e,n){return(0,Fe.jsx)("span",{className:"label",children:e},n)}))]}):null},xa=function(e){var n=e.idRef,t=e.expr,r=e.queryType;return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("h4",{children:n}),(0,Fe.jsx)("div",{children:(0,Fe.jsx)("p",{children:t})}),(0,Fe.jsxs)("p",{children:["Query Type: ",r]})]})},ba=function(e){var n=e.expr,t=e.idRef,r=e.labels,i=e.limit,a=e.queryType,o=e.total,s={idRef:t,expr:n,queryType:a},u={labels:r};return(0,Fe.jsxs)(va,{children:[(0,Fe.jsx)(xa,(0,l.Z)({},s)),(0,Fe.jsx)(ma,(0,l.Z)({},u)),(0,Fe.jsxs)("p",{children:["Limit: ",i]}),(0,Fe.jsxs)("p",{children:["Total: ",o]})]})};function ya(e){var n=e.expr,t=e.idRef,r=e.labels,i=e.queryType,a=e.limit,o=e.total,l=e.onClose,s=e.open,u=(0,hr.Fg)();return(0,Fe.jsx)(I.a,{theme:u,children:(0,Fe.jsx)(sr.Z,{open:s,onClose:l,PaperProps:{classes:{root:vr.ht}},children:(0,Fe.jsx)(ba,{expr:n,idRef:t,labels:r,queryType:i,limit:a,total:o})})})}function Za(e){var n=(e||{fixedSize:!1}).fixedSize,t=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),r=(0,f.useState)(!1),i=(0,u.Z)(r,2),a=i[0],o=i[1],s=(0,f.useState)(!0),c=(0,u.Z)(s,2),d=c[0],p=c[1],v=(0,hr.Fg)(),h=e.actualQuery,g=e.dataView,m=e.type,x=e.total,b=e.setMinimize,y=e.setMaxHeight,Z=(0,f.useMemo)((function(){var e="matrix"===m&&(null===h||void 0===h?void 0:h.tableView),n="stream"===m&&(null===h||void 0===h?void 0:h.tableView);return"matrix"!==m&&"flux"!==m||null!==h&&void 0!==h&&h.tableView?"stream"!==m||null!==h&&void 0!==h&&h.tableView?"vector"===m||e||n?"Table":"empty"===m?"No Results":void 0:"Logs":"Chart"}),[m,null===h||void 0===h?void 0:h.tableView]),w=(0,f.useCallback)((function(){d?(b(),p(!1)):(y(),p(!0))}),[d,b,y]),S=(0,f.useCallback)((function(){o(!0)}),[]),j=(0,f.useMemo)((function(){var e;return(null===g||void 0===g||null===(e=g.labels)||void 0===e?void 0:e.join(" | "))||""}),[g.labels]),k=(0,f.useMemo)((function(){var n;if(null!==g&&void 0!==g&&null!==(n=g.labels)&&void 0!==n&&n.length){if((null===g||void 0===g?void 0:g.labels.length)>4){var t=(0,H.Z)(g.labels).slice(0,4);return(0,Fe.jsxs)(Fe.Fragment,{children:[t.map((function(n,t){return(0,Fe.jsx)(fa,{children:(0,Fe.jsx)(Yi,(0,l.Z)({name:n},e.theme))},t)}))," ","..."]})}return(0,Fe.jsx)(Fe.Fragment,{children:g.labels.map((function(n,t){return(0,Fe.jsx)(fa,{children:(0,Fe.jsx)(Yi,(0,l.Z)({name:n},e.theme))},t)}))})}}),[g.labels,e.theme]);if(h){var C,T=h.idRef,N=h.expr,M=h.limit,E=h.queryType;return(0,Fe.jsx)(I.a,{theme:v,children:(0,Fe.jsxs)(da,{children:[(0,Fe.jsxs)("div",{className:"view-header-info",children:[(0,Fe.jsx)("span",{children:(0,Fe.jsx)("span",{className:"exp",children:Z})}),(0,Fe.jsx)(D.Z,{title:(null===h||void 0===h?void 0:h.expr)||"",children:(0,Fe.jsxs)("span",{children:[" ",(0,Fe.jsx)("span",{className:"exp",children:null===h||void 0===h?void 0:h.idRef})]})}),!t&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("span",{children:["limit:"," ",(0,Fe.jsx)("span",{className:"exp",children:null===h||void 0===h?void 0:h.limit})]}),(0,Fe.jsxs)("span",{children:["count: ",(0,Fe.jsx)("span",{className:"exp",children:x})]})]}),(null===g||void 0===g||null===(C=g.labels)||void 0===C?void 0:C.length)>0&&!t&&(0,Fe.jsx)("span",{children:(0,Fe.jsxs)(pa,{title:j,children:["labels:",k]})})]}),(0,Fe.jsx)("div",{className:"header-actions",children:!n&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(ha.Z,{className:"header-icon",style:{fontSize:"12px"},onClick:S}),(0,Fe.jsx)(Ta,{isOpen:d,onClick:w})]})}),a&&(0,Fe.jsx)(ya,{labels:g.labels||[],limit:M,expr:N,queryType:E,idRef:T,open:a,total:x,onClose:function(e){return o(!1)}})]})})}return null}var wa,Sa,ja,ka,Ca,Ta=function(e){var n=e.isOpen,t=e.onClick;return n?(0,Fe.jsx)(ga.Z,{className:"header-icon",onClick:t,style:{fontSize:"14px"}}):(0,Fe.jsx)(Qr.Z,{className:"header-icon",onClick:t,style:{fontSize:"14px"}})};function _a(e){var n=(0,hr.Fg)();return e.loading?null:(0,Fe.jsx)(I.a,{theme:n,children:(0,Fe.jsx)(ua,{children:"Please adjust search parameters and click on \u2018Show Results\u2019 button"})})}var Ia=jt.Z.div(wa||(wa=(0,r.Z)(["\n margin: 4px;\n padding: 5px;\n margin-top: 0px;\n border: 1px solid ",";\n border-radius: 3px;\n display: flex;\n flex-direction: column;\n flex: ",";\n\n height: ",";\n .view-content {\n height: ",";\n display: ",";\n flex-direction: ",";\n flex: 1;\n }\n"])),(function(e){return e.theme.buttonBorder}),(function(e){return"min"===e.size?0:1}),(function(e){return"regular"===e.size?e.vheight.regularCont:"max"===e.size?e.vheight.maxCont:"20px"}),(function(e){return"regular"===e.size?e.vheight.regularView:"max"===e.size?e.vheight.maxView:"0px"}),(function(e){return"min"===e.size?"none":(e.size,"flex")}),(function(e){return e.size,"column"})),Da=(0,jt.Z)(Mt.Z)(Sa||(Sa=(0,r.Z)(["\n width: 100%;\n background: ",";\n height: inherit;\n flex: 1;\n"])),(function(e){return e.theme.widgetContainer})),Na=((0,jt.Z)(ht.Z)(ja||(ja=(0,r.Z)(["\n display: flex;\n height: 100%;\n"]))),(0,jt.Z)(Nt.Z)(ka||(ka=(0,r.Z)(["\n min-width: 320px;\n background: ",";\n border-bottom: 4px solid ",";\n display: ",";\n align-items: center;\n align-content: space-between;\n"])),(function(e){return e.theme.tabHeader}),(function(e){return e.theme.historyRow}),(function(e){return"min"===e.panelsize?"none":"flex"}))),Ma=(0,jt.Z)(Ct.Z)(Ca||(Ca=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n cursor: pointer;\n font-size: 13px;\n background-color: transparent;\n padding: 6px 10px;\n border: none;\n border-radius: 3px 3px 0px 0px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid transparent;\n transition: 0.2s all;\n\n &:hover {\n background-color: ",";\n }\n\n &:focus {\n color: ",";\n background: ",";\n border-radius: 3px 3px 0px 0px;\n\n outline-offset: 2px;\n }\n\n &."," {\n border-bottom: 1px solid ",";\n }\n\n &."," {\n opacity: 0.5;\n cursor: not-allowed;\n }\n @media screen and (max-width: 360px) {\n span {\n display: none;\n }\n padding: 5px 20px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),Tt.Z.selected,(function(e){return e.theme.primaryDark}),kt.Z.disabled);function Ea(e){var n=e.viewRef,t=e.panelSize,r=e.setStreamClose,i=e.setMinimize,a=e.setMaxHeight,o=e.actualQuery,s=e.total,u=e.loading;return(0,Fe.jsxs)(Ia,{ref:n,size:t,vheight:"regular",children:[(0,Fe.jsx)(Za,(0,l.Z)({onClose:r,setMinimize:i,setMaxHeight:a,actualQuery:o,total:s,type:"empty",fixedSize:!0},e)),(0,Fe.jsx)(_a,{loading:u})]})}var Ra,Oa,La,Va,za,Fa=t(15671),Ba=t(43144),Ha=t(60136),Pa=t(29388),qa=t(16912),Aa={critical:["emerg","fatal","alert","crit","critical"],error:["err","eror","error"],warning:["warn","warning"],info:["info","information","notice"],debug:["dbug","debug"],trace:["trace"]},Qa={critical:"purple",error:"red",warning:"orange",info:"green",debug:"blue",trace:"lightblue",unknown:"gray"},Wa=(0,qa.Z)((function(e,n){return{items:e,toggleItemActive:n}}));var Ua,Ja,Ga=(0,ze.iv)(Ra||(Ra=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n margin-top: 3px;\n"]))),Ka=jt.Z.div(Oa||(Oa=(0,r.Z)(["\n color: ",";\n font-size: 12px;\n cursor: pointer;\n padding-left: 0.5rem;\n margin-left: 0.25rem;\n display: flex;\n flex-direction: column;\n margin-bottom: 2px;\n margin-top: 2px;\n font-family: monospace;\n &:hover {\n background: ",";\n }\n\n p {\n display: inline-block;\n overflow-wrap: anywhere;\n margin-left: 3px;\n }\n border-left: 4px solid ",";\n .log-ts-row {\n display: flex;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.logBgColor}),(function(e){return e.rowColor})),Ya=jt.Z.span(La||(La=(0,r.Z)(["\n font-size: 12px;\n color: ",";\n line-height: 1.5;\n"])),(function(e){return e.theme.textPrimary})),Xa=jt.Z.span(Va||(Va=(0,r.Z)(["\n position: relative;\n color: ",";\n margin-right: 0.25rem;\n white-space: nowrap;\n font-size: 12px;\n line-height: 1.5;\n"])),(function(e){return e.theme.textColor})),$a=jt.Z.div(za||(za=(0,r.Z)(["\n overflow: hidden;\n overflow-y: auto;\n height: calc(100% - 20px);\n"])));function eo(e){var n=e.text,t=e.dateFormated,r=e.isMobile,i=e.isSplit,a=e.isShowTs;return(0,Fe.jsxs)("div",{className:"log-ts-row",children:[a&&!r&&!i&&(0,Fe.jsx)(Xa,{children:t}),(0,Fe.jsxs)(Ya,{children:[(r||i)&&a&&(0,Fe.jsx)("p",{children:t}),(0,Fe.jsx)("p",{children:n})]})]})}var no=jt.Z.div(Ua||(Ua=(0,r.Z)(["\n color: ",";\n flex: 0;\n background-color: hsl(220, 67%, 55%);\n display: flex;\n margin-left: 5px;\n padding: 0 4px;\n border-radius: 2px;\n font-size: 12px;\n align-items: center;\n white-space: nowrap;\n"])),(function(e){return e.theme.buttonText})),to=jt.Z.div(Ja||(Ja=(0,r.Z)(["\n color: ",";\n flex: 1;\n display: flex;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.textPrimary}),(function(e){return e.theme.widgetContainer})),ro={width:"18px",height:"18px"},io=t(33774),ao=["json","regexp","logfmt","pattern","~","="],oo=/{[^}]*}/,lo={newQuery:function(e,n,t){var r=(0,u.Z)(e,2),i=r[0],a=r[1];return"".concat(t[0]||"","{").concat(i).concat(n,'"').concat(a,'"}').concat(t[2]||"")},equalLabels:function(e,n,t){return"!="===n?lo.newQuery(e,n,t):"{}"},formatQuery:function(e,n){return"".concat(n[0]||"","{").concat(e||"","}").concat(n[2]||"")},splitLabels:function(e){var n,t;return(null===e||void 0===e||null===(n=e.match(/[^{}]+(?=})/g))||void 0===n||null===(t=n.map((function(e){return e.split(",")})))||void 0===t?void 0:t.flat())||[]},addLabel:function(e,n,t){return"!="===e?n:t},rmValueFromLabel:function(e,n){var t,r=null===e||void 0===e?void 0:e.split("=~"),i=(0,u.Z)(r,2),a=i[0],o=i[1],l=null===o||void 0===o?void 0:o.split(/[""]/)[1],s=null===l||void 0===l?void 0:l.split("|"),c=null===s||void 0===s?void 0:s.filter((function(e){return e.trim()!==(null===n||void 0===n?void 0:n.trim())}));if((null===c||void 0===c?void 0:c.length)>1){var d,f=null===c||void 0===c||null===(d=c.join("|"))||void 0===d?void 0:d.trim();return(null===a||void 0===a?void 0:a.trim())+'=~"'+f+'"'}var p=null===c||void 0===c||null===(t=c.join(""))||void 0===t?void 0:t.trim();return(null===a||void 0===a?void 0:a.trim())+'="'+p+'"'},rmNonEqValueFromLabel:function(e,n){var t,r=null===e||void 0===e?void 0:e.split("!~"),i=(0,u.Z)(r,2),a=i[0],o=i[1],l=null===o||void 0===o?void 0:o.split(/[""]/)[1],s=null===l||void 0===l?void 0:l.split("|"),c=null===s||void 0===s?void 0:s.filter((function(e){return e.trim()!==(null===n||void 0===n?void 0:n.trim())}));if((null===c||void 0===c?void 0:c.length)>1){var d,f=null===c||void 0===c||null===(d=c.join("|"))||void 0===d?void 0:d.trim();return(null===a||void 0===a?void 0:a.trim())+'!~"'+f+'"'}var p=null===c||void 0===c||null===(t=c.join(""))||void 0===t?void 0:t.trim();return(null===a||void 0===a?void 0:a.trim())+'!="'+p+'"'},addValueToLabel:function(e,n,t){var r=t?"=":"=~",i=null===e||void 0===e?void 0:e.split(r),a=(0,u.Z)(i,2),o=a[0],l=a[1],s=null===l||void 0===l?void 0:l.split(/[""]/)[1];return"".concat(o,'=~"').concat(null===s||void 0===s?void 0:s.trim(),"|").concat(null===n||void 0===n?void 0:n.trim(),'"')},addNonEqValueToLabel:function(e,n,t){var r=t?"!=":"!~",i=null===e||void 0===e?void 0:e.split(r),a=(0,u.Z)(i,2),o=a[0],l=a[1],s=null===l||void 0===l?void 0:l.split(/[""]/)[1];return"".concat(o,'!~"').concat(null===s||void 0===s?void 0:s.trim(),"|").concat(null===n||void 0===n?void 0:n.trim(),'"')},isEqualsQuery:function(e,n){var t=(0,u.Z)(n,2),r=t[0],i=t[1];return e==="{".concat(r,'="').concat(i,'"}')},editQuery:function(e,n,t,r){return lo.isEqualsQuery(e,n)&&null!==n?lo.equalLabels(n,t,r):so.fromLabels(e,n,t,r)}},so={fromLabels:function(e,n,t,r){var i=function(e,n,t){var r=(0,u.Z)(e,2),i=r[0],a=r[1],o="".concat(i,'="').concat(a,'"'),l="".concat(i,'!="').concat(a,'"'),c=lo.splitLabels(n);if(!c)return"";var d,f=(0,s.Z)(c);try{var p=function(){var e,r,s,u,c,f,p,v,h,g,m,x,b,y,Z,w,S,j,k,C,T,_=d.value,I=_.match(/([^{}=,~!]+)/gm),D=lo.splitLabels(n);if(!I)return{v:""};if(null!==a&&!_.includes(null===i||void 0===i?void 0:i.trim())&&(null===D||void 0===D||!D.some((function(e){return e.includes(i)})))){var N="!="===t?l:_,M=lo.addLabel(t,N,o);return{v:lo.splitLabels(n).concat(M).join(",")}}if(null!==a&&null!==_&&void 0!==_&&_.includes("=")&&(null===_||void 0===_||null===(e=_.split("="))||void 0===e||null===(r=e[0])||void 0===r?void 0:r.trim())===(null===i||void 0===i?void 0:i.trim())&&(null===_||void 0===_||!_.includes(a))){var E,R,O=lo.addValueToLabel(_,a,!0),L=new RegExp("".concat(_));return{v:null===lo||void 0===lo||null===(E=lo.splitLabels(n))||void 0===E||null===(R=E.join(","))||void 0===R?void 0:R.replace(L,O)}}if(null!==a&&null!==_&&void 0!==_&&_.includes("=~")&&(null===_||void 0===_||null===(s=_.split("=~"))||void 0===s||null===(u=s[0])||void 0===u?void 0:u.trim())===(null===i||void 0===i?void 0:i.trim())&&null!==_&&void 0!==_&&_.includes(a)){var V,z,F=lo.rmValueFromLabel(_,a),B=new RegExp("".concat(_));return{v:null===lo||void 0===lo||null===(V=lo.splitLabels(n))||void 0===V||null===(z=V.join(","))||void 0===z?void 0:z.replace(B,F)}}if(null!==a&&null!==_&&void 0!==_&&_.includes("=~")&&(null===_||void 0===_||null===(c=_.split("=~"))||void 0===c||null===(f=c[0])||void 0===f?void 0:f.trim())===(null===i||void 0===i?void 0:i.trim())&&(null===_||void 0===_||!_.includes(null===a||void 0===a?void 0:a.trim())))return{v:lo.addValueToLabel(_,a,!1)};if(null!==_&&void 0!==_&&_.includes("=")&&(null===_||void 0===_||null===(p=_.split("="))||void 0===p||null===(v=p[0])||void 0===v?void 0:v.trim())===(null===i||void 0===i?void 0:i.trim())&&((null===_||void 0===_||null===(h=_.split('"'))||void 0===h||null===(g=h[1])||void 0===g?void 0:g.trim())===(null===a||void 0===a?void 0:a.trim())||null===a)&&null!==D&&void 0!==D&&D.some((function(e){return e===_}))){var H=null===D||void 0===D?void 0:D.filter((function(e){return e!==_}));return{v:null===H||void 0===H?void 0:H.join(",")}}if(null!==_&&void 0!==_&&_.includes("!=")&&(null===_||void 0===_||null===(m=_.split("!="))||void 0===m||null===(x=m[0])||void 0===x?void 0:x.trim())===(null===i||void 0===i?void 0:i.trim())&&((null===_||void 0===_||null===(b=_.split('"'))||void 0===b||null===(y=b[1])||void 0===y?void 0:y.trim())===(null===a||void 0===a?void 0:a.trim())||null===a)&&null!==D&&void 0!==D&&D.some((function(e){return e===_}))){var P=null===D||void 0===D?void 0:D.filter((function(e){return e!==_}));return{v:null===P||void 0===P?void 0:P.join(",")}}if(null!==_&&void 0!==_&&_.includes("!=")&&(null===_||void 0===_||null===(Z=_.split("!=")[0])||void 0===Z?void 0:Z.trim())===(null===i||void 0===i?void 0:i.trim())){var q,A,Q=lo.addNonEqValueToLabel(_,a,!0),W=new RegExp("".concat(_));return{v:null===(q=lo.splitLabels(n))||void 0===q||null===(A=q.join(","))||void 0===A?void 0:A.replace(W,Q)}}if(null!==a&&null!==_&&void 0!==_&&_.includes("!~")&&(null===_||void 0===_||null===(w=_.split("!~"))||void 0===w||null===(S=w[0])||void 0===S?void 0:S.trim())===(null===i||void 0===i?void 0:i.trim())&&null!==_&&void 0!==_&&_.includes(a)){var U=lo.rmNonEqValueFromLabel(_,a),J=new RegExp("".concat(_));return{v:lo.splitLabels(n).join(",").replace(J,U)}}if(null!==_&&void 0!==_&&_.includes("!=")&&(null===_||void 0===_||null===(j=_.split("!="))||void 0===j||null===(k=j[0])||void 0===k?void 0:k.trim())===(null===i||void 0===i?void 0:i.trim())&&((null===_||void 0===_||null===(C=_.split('"'))||void 0===C||null===(T=C[1])||void 0===T?void 0:T.trim())===(null===a||void 0===a?void 0:a.trim())||null===a)&&null!==D&&void 0!==D&&D.some((function(e){return e===_}))){var G=null===D||void 0===D?void 0:D.filter((function(e){return e!==_}));return{v:null===G||void 0===G?void 0:G.join(",")}}};for(f.s();!(d=f.n()).done;){var v=p();if("object"===typeof v)return v.v}}catch(h){f.e(h)}finally{f.f()}return""}(n,e,t);return lo.formatQuery(i,r)}};function uo(e,n,t,r,i){var a,o,l=lo.newQuery,s=lo.editQuery,u=[n,t],c=null===e||void 0===e?void 0:e.split(/[{}]/),d=(null===e||void 0===e?void 0:e.match(oo))&&c[1].length>7;return(null===(a=c[1])||void 0===a?void 0:a.length)<1&&"metrics"===i?"".concat(t,"{}"):(null===(o=c[1])||void 0===o?void 0:o.length)>1&&"metrics"===i?"".concat(t,"{").concat(c[1],"}"):d||"__name__"===n?s(e,u,r,c):l(u,r,c)}function co(e,n,t,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"logs",o=(0,u.Z)(r,2),l=o[0],s=o[1],c=A.Z.dispatch,d=i?"!=":"=",f=A.Z.getState(),p=f.left,v=f.right,h=uo(e,l,s,d,a);if("left"===n){var g=(0,H.Z)(p);g.forEach((function(e){e.id===t&&(e.expr=h)})),c(m(g))}if("right"===n){var b=(0,H.Z)(v);b.forEach((function(e){e.id===t&&(e.expr=h)})),c(x(b))}}function fo(e,n,t,r){return e.includes("".concat(t).concat(n,'"').concat(r,'"'))}function po(e,n,t){return vo.apply(this,arguments)}function vo(){return vo=(0,F.Z)((0,z.Z)().mark((function e(n,t,r){var i,a,o,l,s,u,c,d,f=arguments;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=f.length>3&&void 0!==f[3]&&f[3],a=f.length>4?f[4]:void 0,n.preventDefault(),n.stopPropagation(),o=a.expr,l=a.panel,s=a.id,u=a.dataSourceType,c=fo(o,"!=",t,r),d=fo(o,"=",t,r),!(c&&i||d&&!i)){e.next=9;break}return e.abrupt("return");case 9:co(o,l,s,[t,r],i,u);case 10:case"end":return e.stop()}}),e)}))),vo.apply(this,arguments)}var ho=function(e){var n=e.dataSourceData,t=e.linkedFieldTags,r=e.buttonKey,a=e.value,o=e.openTraces,l=(0,i.v9)((function(e){return e.dataSources}));if(null!==n&&void 0!==n&&n.linkedFields){var s=n.linkedFields,c=function(e){var n,t;return(null===e||void 0===e||null===(n=e.fields)||void 0===n||null===(t=n.map((function(e){if(null!==e&&void 0!==e&&e.tagGroups){var n=Object.entries(null===e||void 0===e?void 0:e.tagGroups);return null===n||void 0===n?void 0:n.map((function(e){var n=(0,u.Z)(e,2);return{name:n[0],value:n[1]}}))}return[]})))||void 0===t?void 0:t.flat())||[]}(t),d=null===c||void 0===c?void 0:c.map((function(e){return e.name}));if((null===s||void 0===s?void 0:s.length)>0){var f=s[0],p=f.dataSourceId,v=f.linkType,h=f.internalLink,g=null===l||void 0===l?void 0:l.find((function(e){return e.id===p})),m=null===g||void 0===g?void 0:g.url;if(d.includes(r)&&a&&!0===h)return(0,Fe.jsxs)(no,{onClick:function(e){o(e,r,a,p,m,v)},children:[(0,Fe.jsx)(io.Z,{style:{width:"14px",height:"14px"}}),(0,Fe.jsx)("span",{children:v})]})}}return null},go=t(70306),mo=t(48005);function xo(e){var n=e.label,t=e.value,r=e.actQuery;return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("span",{"aria-label":"Filter for value",title:"Filter for value",onClick:function(e){return po(e,n,t,!1,r)},className:"icon",children:(0,Fe.jsx)(go.Z,{color:"primary",style:ro})}),(0,Fe.jsx)("span",{"aria-label":"Filter out value",title:"Filter out value",onClick:function(e){return po(e,n,t,!0,r)},className:"icon",children:(0,Fe.jsx)(mo.Z,{color:"primary",style:ro})})]})}function bo(e){var n=e.tags,t=e.actQuery,r=e.dataSourceData,a=e.linkedFieldTags,o=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),s=(0,hi.F)(),c=(0,i.v9)((function(e){return e.isEmbed})),d=(0,i.I0)(),f=(0,i.v9)((function(e){return e.right})),p=function(n,t,r,i,a,s){var u;n.stopPropagation(),"left"!==(null===e||void 0===e||null===(u=e.actQuery)||void 0===u?void 0:u.panel)||o||d(w(!0));var c=JSON.parse(JSON.stringify(f)),p=JSON.parse(JSON.stringify(e.actQuery));try{var v=(0,l.Z)((0,l.Z)({},c[0]),{},{id:c[0].id,idRef:s+"="+r,panel:"right",queryType:"range",dataSourceType:s.toLowerCase()||"traces",dataSourceId:i||"32D16h5uYBqUUzhD",dataSourceURL:a,expr:r,limit:100,step:100,tableView:!1,chartView:!1,isShowTs:!1,browserOpen:!1,labels:[],values:[],direction:"forward",loading:!1,open:!0});d(Tn(s.toLowerCase()||"traces",r,"range",p.limit||100,"right",v.id,"forward",i||"32D16h5uYBqUUzhD",a)),d(x([v]))}catch(n){console.log(n)}};return(0,Fe.jsx)(I.a,{theme:s,children:Object.entries(n).map((function(n,i){var o=(0,u.Z)(n,2),s=o[0],d=o[1];return(0,Fe.jsx)(to,{children:(0,Fe.jsxs)("div",{className:"value-tags",children:[!c&&(0,Fe.jsx)(xo,{label:s,value:d,actQuery:t}),(0,Fe.jsx)("span",{children:s}),(0,Fe.jsxs)("span",{style:{flex:1},children:[d,(0,Fe.jsx)(ho,(0,l.Z)((0,l.Z)({},e),{},{dataSourceData:r,linkedFieldTags:a,buttonKey:s,value:d,openTraces:p}))]})]},i)},i)}))})}function yo(e){var n=e.showLabels,t=e.tags,r=e.actQuery;return n?(0,Fe.jsx)("div",{className:"value-tags-container",children:(0,Fe.jsx)(bo,(0,l.Z)((0,l.Z)({},e),{},{tags:t,actQuery:r}))}):null}function Zo(e){var n=e.toggleItemActive,t=e.index,r=e.log,i=e.actQuery,a=e.isMobile,o=e.isSplit,u=e.dataSourceData,d=r.tags,p=r.timestamp,v=r.text,h=r.showLabels,g=function(e,n){return(0,f.useMemo)((function(){var t;if((null===n||void 0===n||null===(t=n.linkedFields)||void 0===t?void 0:t.length)>0){var r,i=n.linkedFields.map((function(n){var t=n.id,r=n.regex,i=n.name,a=n.internalLink,o=new RegExp(r,"i"),l=e.match(o);return l&&(null===l||void 0===l?void 0:l.length)>0?{name:i,internalLink:a,id:t,tagGroups:l.groups}:{}})),a={tags:{},fields:[]},o=(0,s.Z)(i);try{for(o.s();!(r=o.n()).done;){var u=r.value;a.tags=(0,l.Z)((0,l.Z)({},a.tags),u.tagGroups),a.fields.push(u)}}catch(c){o.e(c)}finally{o.f()}return a}return{}}),[n,e])}(v,u),m=(0,f.useMemo)((function(){return function(e){var n=(null===e||void 0===e?void 0:e.severity)||(null===e||void 0===e?void 0:e.level);if(n){var t=Object.keys(Aa).find((function(e){return Aa[e].includes(n.toLowerCase())}));return Qa[t]}return Qa.unknown}(d)}),[d]),x=(0,f.useMemo)((function(){return function(e){return c(parseInt(e)).format("YYYY-MM-DD HH:mm:ss.SSS UTC")}(p)}),[p]),b={actQuery:i,tags:(0,l.Z)((0,l.Z)({},d),g.tags),linkedFieldTags:g,showLabels:h,dataSourceData:u},y={dateFormated:x,text:v,isMobile:a,isSplit:o,dataSourceData:u},Z={rowColor:m,onClick:function(){n(t)}};return(0,Fe.jsxs)(Ka,(0,l.Z)((0,l.Z)({},Z),{},{children:[(0,Fe.jsx)(eo,(0,l.Z)((0,l.Z)({},y),{},{isShowTs:i.isShowTs})),(0,Fe.jsx)(yo,(0,l.Z)({},b))]}))}function wo(e){var n,t=e.items,r=e.toggleItemActive,a=e.actQuery,o=e.dataSourceId,l=a.splitted,s=Wa(t,r),u=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),c=function(e){return(0,f.useMemo)((function(){var n=null===e||void 0===e?void 0:e.linkedFields,t=null===e||void 0===e?void 0:e.id,r=null===e||void 0===e?void 0:e.name,i=null===e||void 0===e?void 0:e.url;if(e)return{linkedFields:n,id:t,name:r,url:i}}),[e])}((0,i.v9)((function(e){var n=e.dataSources;return null===n||void 0===n?void 0:n.find((function(e){return e.id===o}))})));return null===s||void 0===s||null===(n=s.items)||void 0===n?void 0:n.map((function(e,n){return(0,Fe.jsx)(Zo,{index:n,dataSourceId:o,dataSourceData:c,actQuery:a,log:e,isSplit:l,isMobile:u,toggleItemActive:r},n)}))}var So,jo,ko,Co,To,_o,Io,Do=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;(0,Fa.Z)(this,t),(r=n.call(this,e)).toggleItemActive=function(e){return r.setState((function(n){var t=n.messages[e],r=n.messages.concat();return r[e]=(0,l.Z)((0,l.Z)({},t),{},{showLabels:!t.showLabels}),{messages:r}}))};var i=(e||[]).messages;return r.state={messages:i},r}return(0,Ba.Z)(t,[{key:"render",value:function(){var e=this.props.actualQuery,n=e.dataSourceId,t=this.state.messages;return(0,Fe.jsx)($a,{children:(0,Fe.jsx)(wo,(0,l.Z)((0,l.Z)({},this.props),{},{dataSourceId:n,actQuery:e,items:t,toggleItemActive:this.toggleItemActive}))})}}]),t}(f.PureComponent),No=t(24325),Mo=t(17432),Eo=t(23436),Ro=function(e,n,t,r){var i=(0,Eo.O4)(e.getValue(n),t);return r(i),i.passed},Oo={cell:function(e){return e.getValue()}},Lo=function(e,n){return{updateData:function(t,r,i){n(),e((function(e){return e.map((function(n,a){return a!==t?n:(0,l.Z)((0,l.Z)({},e[t]),{},(0,B.Z)({},r,i))}))}))}}},Vo=t(45987),zo=["value","onChange","debounce","theme"],Fo=function(e){return(0,ze.iv)(So||(So=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 3px 8px;\n font-size: 12px;\n"])),e.textColor,e.inputBg,e.buttonBorder)},Bo=function(e){var n=e.value,t=e.onChange,r=e.debounce,i=void 0===r?500:r,a=e.theme,s=(0,Vo.Z)(e,zo),c=(0,f.useState)(n),d=(0,u.Z)(c,2),p=d[0],v=d[1];return(0,f.useEffect)((function(){v(n)}),[n]),(0,f.useEffect)((function(){var e=setTimeout((function(){t(p)}),i);return function(){return clearTimeout(e)}}),[p]),(0,Fe.jsx)("input",(0,l.Z)((0,l.Z)({},s),{},{className:(0,ze.cx)(Fo(a)),value:o().sanitize(String(p)),onChange:function(e){return v(e.target.value)}}))},Ho=t(55748),Po=t(22628),qo=t(79263),Ao=t(53390),Qo=(0,ze.iv)(jo||(jo=(0,r.Z)(["\n display: flex;\n align-items: center;\n gap: 1px;\n"]))),Wo=(0,ze.iv)(ko||(ko=(0,r.Z)(["\n font-size: 12px;\n"]))),Uo=function(e){return(0,ze.iv)(Co||(Co=(0,r.Z)(["\n border-radius: 3px;\n outline: none;\n border: 1px solid ",";\n background: ",";\n color: ",";\n padding: 3px 8px;\n margin: 2px;\n width: 70px;\n"])),e.buttonBorder,e.inputBg,e.textColor)},Jo=function(e){return(0,ze.iv)(To||(To=(0,r.Z)(["\n color: ",";\n border: 1px solid ",";\n background: ",";\n padding: 3px 8px 2px 8px;\n border-radius: 3px;\n cursor: pointer;\n font-size: 12px;\n"])),e.textColor,e.buttonBorder,e.inputBg)},Go=((0,ze.iv)(_o||(_o=(0,r.Z)(["\n height: 12px;\n width: 12px;\n"]))),function(e){return(0,ze.iv)(Io||(Io=(0,r.Z)(["\n display: flex;\n align-items: center;\n border: 1px solid ",";\n color: ",";\n background: ",";\n cursor: pointer;\n"])),e.buttonBorder,e.textColor,e.buttonDefault)});var Ko=function(e){e.getSelectedRowModel;var n=e.hasNextPage,t=e.hasPreviousPage,r=e.nextPage,i=e.pageCount,a=e.pageIndex,l=e.pageSize,s=e.previousPage,u=(e.refreshData,e.rerender,e.rowSelection,e.setPageIndex),c=e.setPageSize,d=e.totalRows,f=(0,hr.Fg)();return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center",flex:1,width:"100%",color:f.textColor,margin:"5px"},children:[(0,Fe.jsx)("button",{className:(0,ze.cx)(Go(f)),onClick:function(){return u(0)},disabled:!t,children:(0,Fe.jsx)(Po.Z,{style:{height:"12px",width:"12px"}})}),(0,Fe.jsx)("button",{className:(0,ze.cx)(Go(f)),onClick:function(){return s()},disabled:!t,children:(0,Fe.jsx)(Ao.Z,{style:{height:"12px",width:"12px"}})}),(0,Fe.jsx)("button",{className:(0,ze.cx)(Go(f)),onClick:function(){return r()},disabled:!n,children:(0,Fe.jsx)(qo.Z,{style:{height:"12px",width:"12px"}})}),(0,Fe.jsx)("button",{className:(0,ze.cx)(Go(f)),onClick:function(){return u(i-1)},disabled:!n,children:(0,Fe.jsx)(Ho.Z,{style:{height:"12px",width:"12px"}})}),(0,Fe.jsx)("span",{className:(0,ze.cx)(Qo,Wo),children:(0,Fe.jsxs)("div",{children:["Page"," ",(0,Fe.jsxs)("strong",{children:[a+1," of ",i]})]})}),(0,Fe.jsxs)("span",{className:(0,ze.cx)(Qo,Wo),children:["- Go to page:",(0,Fe.jsx)("input",{type:"number",defaultValue:a+1,onChange:function(e){var n=e.target.value?Number(e.target.value)-1:0;u(n)},className:(0,ze.cx)(Uo(f))})]}),(0,Fe.jsx)("select",{className:(0,ze.cx)(Jo(f)),value:o().sanitize(String(l)),onChange:function(e){c(Number(e.target.value))},children:[10,20,30,40,50].map((function(e){return(0,Fe.jsxs)("option",{value:o().sanitize(String(e)),children:["Show ",e," Rows"]},e)}))}),(0,Fe.jsxs)("div",{style:{fontSize:"12px",marginLeft:"6px"},children:[" ","Total: ",d," Rows"]})]}),(0,Fe.jsx)("div",{className:"flex items-center gap-2"})]})},Yo=function(e){var n,t,r,i,a=e.columnFilterValue,o=e.getFacetedMinMaxValues,l=e.setFilterValue,s=(0,hr.Fg)(),u=null===(n=o())||void 0===n?void 0:n[0],c=Number(null!==u&&void 0!==u?u:""),d=null===(t=o())||void 0===t?void 0:t[1],f=Number(d);return(0,Fe.jsxs)("div",{children:[(0,Fe.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center",justifyContent:"center"},children:[(0,Fe.jsx)(Bo,{theme:s,type:"number",min:c,max:f,value:null!==(r=null===a||void 0===a?void 0:a[0])&&void 0!==r?r:"",onChange:function(e){return l((function(n){return[e,null===n||void 0===n?void 0:n[1]]}))},placeholder:"Min ".concat(u?"(".concat(c,")"):""),className:"w-24 border shadow rounded"}),(0,Fe.jsx)(Bo,{theme:s,type:"number",min:c,max:f,value:null!==(i=null===a||void 0===a?void 0:a[1])&&void 0!==i?i:"",onChange:function(e){return l((function(n){return[null===n||void 0===n?void 0:n[0],e]}))},placeholder:"Max ".concat(d?"(".concat(f,")"):""),className:"w-24 border shadow rounded"})]}),(0,Fe.jsx)("div",{className:"h-1"})]})},Xo=function(e){var n=e.columnId,t=e.columnFilterValue,r=e.columnSize,i=e.setFilterValue,a=e.sortedUniqueValues,l=n+"list",s=(0,hr.Fg)();return(0,Fe.jsxs)(f.Fragment,{children:[(0,Fe.jsx)("datalist",{id:l,children:a.slice(0,5e3).map((function(e){return(0,Fe.jsx)("option",{value:o().sanitize(e)},e)}))}),(0,Fe.jsx)(Bo,{theme:s,type:"text",value:o().sanitize(null!==t&&void 0!==t?t:""),onChange:function(e){return i(e)},placeholder:"Search... (".concat(r,")"),className:"w-36 border shadow rounded",list:l}),(0,Fe.jsx)("div",{className:"h-1"})]})};var $o,el,nl=function(e){var n,t=e.column,r=null===(n=e.table.getPreFilteredRowModel().flatRows[0])||void 0===n?void 0:n.getValue(t.id),i=t.getFilterValue(),a=t.getFacetedUniqueValues(),l=(0,f.useMemo)((function(){return"number"===typeof r?[]:Array.from(a.keys()).sort()}),[a]);return"number"===typeof r?(0,Fe.jsx)(Yo,{columnFilterValue:i,getFacetedMinMaxValues:t.getFacetedMinMaxValues,setFilterValue:t.setFilterValue}):(0,Fe.jsx)(Xo,{columnId:t.id,columnFilterValue:o().sanitize(i),columnSize:a.size,setFilterValue:t.setFilterValue,sortedUniqueValues:l})},tl=t(74612),rl=t(32882),il=(0,ze.iv)($o||($o=(0,r.Z)(["\n position: relative;\n &.resizer {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n width: 5px;\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n &.isResizing {\n background: blue;\n opacity: 1;\n }\n }\n"]))),al=function(e,n){return(0,ze.iv)(el||(el=(0,r.Z)(["\n height: 14px !important;\n width: 14px !important;\n color: "," !important;\n cursor: pointer;\n border: 1px solid ",";\n border-radius: 3px;\n padding: 2px;\n"])),e,n)};function ol(e,n){return"left"===n?e.getLeftVisibleCells():"right"===n?e.getRightVisibleCells():"center"===n?e.getCenterVisibleCells():e.getVisibleCells()}var ll,sl=function(e){var n=e.table,t=e.tableGroup,r=(e.columnResizeMode,(0,hr.Fg)()),i=function(e,n){return"left"===n?[e.getLeftHeaderGroups(),e.getLeftFooterGroups()]:"right"===n?[e.getRightHeaderGroups(),e.getRightFooterGroups()]:"center"===n?[e.getCenterHeaderGroups(),e.getCenterFooterGroups()]:[e.getHeaderGroups(),e.getFooterGroups()]}(n,t),a=(0,u.Z)(i,1)[0];return(0,Fe.jsx)(I.a,{theme:r,children:(0,Fe.jsxs)("table",{style:{width:"100%"},children:[(0,Fe.jsx)("thead",{children:a.map((function(e){return(0,Fe.jsx)("tr",{children:e.headers.map((function(e){var t;return(0,Fe.jsxs)("th",{className:(0,ze.cx)(il),key:e.id,colSpan:e.colSpan,style:{width:e.getSize()},children:[" ",(0,Fe.jsxs)("div",{style:{display:"flex",gap:"6px",alignItems:"center",fontSize:"13px"},children:[e.isPlaceholder?null:(0,No.ie)(e.column.columnDef.header,e.getContext()),(0,Fe.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")}),(0,Fe.jsxs)("div",{style:{fontSize:"12px",display:"flex",alignItems:"center",gap:"6px"},children:[e.column.getCanFilter()?(0,Fe.jsx)("div",{children:(0,Fe.jsx)(nl,{column:e.column,table:n})}):null,(0,Fe.jsx)("button",{onClick:e.column.getToggleSortingHandler(),style:{border:"none",background:"none",display:"flex",alignItems:"center"},title:"Sort",className:e.column.getCanSort()?"cursor-pointer select-none":"",children:null!==(t={asc:(0,Fe.jsx)(rl.Z,{className:(0,ze.cx)(al(r.textColor,r.buttonBorder))}),desc:(0,Fe.jsx)(yt.Z,{className:(0,ze.cx)(al(r.textColor,r.buttonBorder))})}[e.column.getIsSorted()])&&void 0!==t?t:(0,Fe.jsx)(tl.Z,{className:(0,ze.cx)(al(r.textColor,r.buttonBorder))})})]})]})]})}))},e.id)}))}),(0,Fe.jsx)("tbody",{children:n.getRowModel().rows.map((function(e){return(0,Fe.jsx)("tr",{children:ol(e,t).map((function(e){return(0,Fe.jsx)("td",{style:{width:e.column.getSize(),fontSize:"12px"},children:(0,No.ie)(e.column.columnDef.cell,e.getContext())},e.id)}))},e.id)}))})]})})};var ul,cl=jt.Z.div(ll||(ll=(0,r.Z)(["\n padding: 5px;\n\n table {\n border-spacing: 0;\n border: 1px solid ",";\n border-radius: 4px;\n border-bottom: none;\n border-top: none;\n color: ",";\n\n tr {\n :last-child {\n td {\n border-bottom: none;\n }\n }\n }\n\n th,\n td {\n margin: 0;\n padding: 0.45rem;\n border-bottom: 1px solid ",";\n border-right: 1px solid ",";\n :last-child {\n border-right: 0;\n }\n }\n\n td {\n input {\n font-size: 12px;\n padding: 0;\n margin: 0;\n border: 0;\n }\n }\n }\n\n .pagination {\n padding: 0.5rem;\n }\n"])),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonBorder}));function dl(e){var n,t=(0,f.useReducer)((function(){return{}}),{})[1],r=e.columns,i=e.data,a=(0,hr.Fg)(),l=(0,f.useState)(i),s=(0,u.Z)(l,2),c=s[0],d=s[1],p=(0,f.useState)({}),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,f.useState)([]),x=(0,u.Z)(m,2),b=x[0],y=x[1],Z=(0,f.useState)({}),w=(0,u.Z)(Z,2),S=w[0],j=w[1],k=(0,f.useState)([]),C=(0,u.Z)(k,2),T=C[0],_=C[1],D=(0,f.useState)(""),N=(0,u.Z)(D,2),M=N[0],E=N[1],R=function(){var e=(0,f.useRef)(!0),n=e.current,t=(0,f.useCallback)((function(){e.current=!1}),[]);return(0,f.useEffect)((function(){e.current=!0})),(0,f.useMemo)((function(){return[Boolean(n),t]}),[n,t])}(),O=(0,u.Z)(R,2),L=O[0],V=O[1],z=(0,f.useState)("onChange"),F=(0,u.Z)(z,1)[0],B=(0,No.b7)({data:c,columns:r,defaultColumn:Oo,getCoreRowModel:(0,Mo.sC)(),getFilteredRowModel:(0,Mo.vL)(),getPaginationRowModel:(0,Mo.G_)(),getSortedRowModel:(0,Mo.tj)(),getGroupedRowModel:(0,Mo.qe)(),getFacetedRowModel:(0,Mo.o6)(),getFacetedUniqueValues:(0,Mo.JG)(),getFacetedMinMaxValues:(0,Mo.HO)(),onColumnFiltersChange:_,onGlobalFilterChange:E,globalFilterFn:Ro,autoResetPageIndex:L,enableColumnResizing:!0,columnResizeMode:F,onColumnVisibilityChange:g,onGroupingChange:y,onRowSelectionChange:j,meta:Lo(d,V),state:{grouping:b,columnFilters:T,globalFilter:M,columnVisibility:h}});return(0,f.useEffect)((function(){var e,n;"fullName"===(null===(e=B.getState().columnFilters[0])||void 0===e?void 0:e.id)&&("fullName"!==(null===(n=B.getState().sorting[0])||void 0===n?void 0:n.id)&&B.setSorting([{id:"fullName",desc:!1}]))}),[null===(n=B.getState().columnFilters[0])||void 0===n?void 0:n.id]),(0,Fe.jsx)(I.a,{theme:a,children:(0,Fe.jsxs)(cl,{theme:a,children:[(0,Fe.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",margin:"4px",marginLeft:0},children:[(0,Fe.jsx)("div",{style:{display:"flex",fontSize:"14px",gap:"6px",margin:"4px",marginLeft:0},children:B.getAllLeafColumns().map((function(e){return(0,Fe.jsx)("div",{children:(0,Fe.jsxs)("label",{style:{display:"flex",alignItems:"center",color:a.textColor},children:[(0,Fe.jsx)("input",{type:"checkbox",checked:e.getIsVisible(),onChange:e.getToggleVisibilityHandler(),className:"mr-1"}),e.id]})},e.id)}))}),(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"14px",margin:"4px",color:a.textColor},children:["Search:",(0,Fe.jsx)(Bo,{theme:a,style:{fontSize:"12px",padding:"3px 8px"},value:o().sanitize(null!==M&&void 0!==M?M:""),onChange:function(e){return E(String(e))},placeholder:"Search all columns..."})]})]}),(0,Fe.jsx)("div",{style:{display:"flex"},children:(0,Fe.jsx)(sl,{columnResizeMode:F,table:B,tableGroup:"center"})}),(0,Fe.jsx)("div",{style:{display:"flex"},children:(0,Fe.jsx)(Ko,{getSelectedRowModel:B.getSelectedRowModel,hasNextPage:B.getCanNextPage(),hasPreviousPage:B.getCanPreviousPage(),nextPage:B.nextPage,pageCount:B.getPageCount(),pageIndex:B.getState().pagination.pageIndex,pageSize:B.getState().pagination.pageSize,previousPage:B.previousPage,refreshData:function(){return d(i)},rerender:t,rowSelection:S,setPageIndex:B.setPageIndex,setPageSize:B.setPageSize,totalRows:B.getPrePaginationRowModel().rows.length})})]})})}var fl=jt.Z.div(ul||(ul=(0,r.Z)(["\n display: block;\n overflow: auto;\n &::-webkit-scrollbar {\n width: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n .table {\n border-spacing: 0;\n border-radius: 4px;\n font-size: 12px;\n color: ",";\n &::-webkit-scrollbar {\n width: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n .tr {\n display: block;\n :last-child {\n .td {\n border-bottom: 0;\n }\n }\n }\n .th {\n background: ",";\n border-bottom: none;\n padding: 3px;\n :last-child {\n box-sizing: unset !important;\n }\n }\n .th,\n .td {\n display: block;\n flex: 1;\n margin: 0;\n justify-content: space-between;\n border-bottom: 1px solid\n ",";\n border-right: 1px solid\n ",";\n padding: 3px;\n position: relative;\n white-space: nowrap;\n overflow: hidden;\n .show-add-labels {\n display: none;\n }\n &:hover {\n .show-add-labels {\n display: flex;\n align-items: center;\n }\n }\n\n :last-child {\n border-right: 0;\n padding-right: 0px;\n }\n\n .resizer {\n display: inline-block;\n background: ",";\n width: 5px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n transform: translateX(50%);\n z-index: 1;\n // touch-action:none;\n &.isResizing {\n background: red;\n }\n }\n }\n }\n\n .pagination {\n // padding: 0.5rem;\n }\n"])),(function(e){return e.theme.scrollbarThumb}),(function(e){return e.theme.textColor}),(function(e){return e.theme.scrollbarThumb}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonBorder})),pl=function(e){var n=e.data,t=n.columnsData,r=n.dataRows,i=e.actualQuery,a=e.height,o=e.size,l=e.width,s=(0,f.useMemo)((function(){return t}),[t]),u=(0,f.useMemo)((function(){return r}),[r]);return(0,Fe.jsx)(fl,{children:t&&r&&(0,Fe.jsx)(dl,{actQuery:i,columns:s,width:l,data:u,height:a,size:o})})},vl=t(10580),hl=t.n(vl);function gl(e){var n=e.id;try{return JSON.parse(localStorage.getItem("tabsState")||"{[".concat(n,"]:0}"))}catch(t){return(0,B.Z)({},n,0)}}var ml=t(76666),xl=t.n(ml),bl=window;bl.$=xl(),bl.jQuery=xl();t(70764),t(23187),t(16850),t(59682),t(48815),t(22073);var yl="".concat("qryn_view","_chart_type"),Zl=function(){return{xaxis:{show:!0,mode:"time",timezone:"local",timeformat:"%Y-%m-%d %H:%M:%S",reserveSpace:!1,shadowSize:0},yaxis:{tickFormatter:Vl},grid:{show:!0,aboveData:!1,color:"#999",clickable:!0,hoverable:!0,autoHighlight:!1,highlightColor:"blue",mouseActiveRadius:30,borderWidth:0,minBorderMargin:0,labelMarginX:0,labelMarginY:0,shadowSize:0,margin:{left:5,right:5}},legend:{noColumns:0,position:"nw",show:!1},interaction:{redrawOverlayInterval:1},series:{stack:arguments.length>0&&void 0!==arguments[0]&&arguments[0],lines:{show:!0,lineWidth:1.5,shadowSize:0,zero:!1},bars:{align:"center",show:!1,barWidth:5e3,shadowSize:0,zero:!1},points:{show:!0,radius:1,shadowSize:0,zero:!1}},markings:{clickable:!1},crosshair:{color:"#88888855",mode:"xy",linewidth:1},selection:{mode:"x"}}},wl=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{stack:n,lines:{show:!1,lineWidth:1.5,shadowSize:0,fill:n},bars:{show:!0,barWidth:0!==e?e:5e3,shadowSize:0},points:{show:!0,radius:.25,shadowSize:0}}},Sl=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{stack:e,lines:{show:!0,lineWidth:1,shadowSize:0,stack:e,fill:e},bars:{show:!1,barWidth:0,shadowSize:0},points:{show:!1,radius:1,shadowSize:0}}},jl=function(){return{stack:arguments.length>0&&void 0!==arguments[0]&&arguments[0],lines:{show:!1,lineWidth:1.5,shadowSize:0},bars:{show:!1,barWidth:0,shadowSize:0},points:{show:!0,radius:2,shadowSize:0}}};var kl=function(e){return 2===(null===e||void 0===e?void 0:e.length)?e[1]:e[1]-e[2]};function Cl(e){return(null===e||void 0===e?void 0:e.length)>0&&(null===e||void 0===e?void 0:e.filter((function(e){return parseFloat(e.value)===parseFloat(kl(e.item.datapoint))})))||[]}function Tl(e){var n,t=Cl(e);return(null===(n=t)||void 0===n?void 0:n.map((function(e){return o().sanitize('
\n
\n \n

').concat(e.label,"

\n
\n
\n
\n
\n "))})).join(""))||[]}function _l(e){var n=e.map((function(e){var n;return null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.map((function(e){var n=(0,u.Z)(e,2),t=n[0];n[1];return t}))})).flat().sort(),t=n[0],r=n[n.length-1],i=r-t;return{first:t,last:r,timeSpan:i/1e3/107e3,length:n.length,timeDiff:i,seriesLength:e.length}}var Il=function(e,n){var t=e.length,r=e.timeDiff,i=e.seriesLength;return Math.round(r/n/t*(1===i?.5:i-1)*1e3)};function Dl(e){var n=_l(e),t=n.timeSpan;return{timeformat:t>1?"%m/%d %H:%M":t>30?"%y/%m/%d %H:%M":"%H:%M:%S",min:n.first,max:n.last}}function Nl(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"bar":return wl(n,t);case"line":default:return Sl(t);case"points":return jl(t)}}function Ml(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,a=(0,l.Z)({},e);return 0===(null===(n=Object.keys(e))||void 0===n?void 0:n.length)&&(a={level:"unknown"},1===i&&r&&(a={level:"logs"})),r&&a?null===(t=Object.entries(a))||void 0===t?void 0:t.map((function(e){var n=(0,u.Z)(e,2);n[0];return n[1]})):!r&&a?"{ "+Object.entries(a).map((function(e){var n=(0,u.Z)(e,2),t=n[0],r=n[1];return"".concat(t,'="').concat(r,'"')})).join(", ")+" }":""}function El(){var e=[];try{var n=localStorage.getItem("labelsSelected");return"string"===typeof n&&(e=JSON.parse(n)),e}catch(t){return console.log(t),e}}function Rl(e){var n=e.label.id,t=El();return(null===t||void 0===t?void 0:t.length)>0&&t.some((function(e){return e.id===n}))}function Ol(e,n){var t,r=El();if(r.length>0){var i=null===(t=r)||void 0===t?void 0:t.map((function(e){return e.id})),a=null===e||void 0===e?void 0:e.map((function(e){return null!==i&&void 0!==i&&i.includes(e.id)?function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Nl(n,0,t),i=r.lines,a=r.bars,o=r.points;return(0,l.Z)((0,l.Z)({},e),{},{stack:t,bars:a,lines:i,points:o,isVisible:!0})}(e,n):function(e){return(0,l.Z)((0,l.Z)({},e),{},{lines:(0,l.Z)((0,l.Z)({},e.lines),{},{show:!1}),bars:(0,l.Z)((0,l.Z)({},e.bars),{},{show:!1}),points:(0,l.Z)((0,l.Z)({},e.points),{},{show:!1}),isVisible:!1})}(e)}));return a}return e}function Ll(e,n){var t=0;return"M"===n&&(t=1e6),"K"===n&&(t=1e3),e%t===0?0:1}function Vl(e,n){return e>999999?(e/1e6).toFixed(Ll(e,"M"))+" M":e>999?(e/1e3).toFixed(Ll(e,"K"))+" K":e.toFixed(n.tickDecimals)}var zl=window.jQuery;function Fl(e){var n=null;zl("#tooltip").remove(),n=null,zl(this).on("plothover",(function(t,r,i){e.unhighlight(),i?function(){for(var t=e.getData(),r=(0,u.Z)(i.datapoint,2),a=r[0],l=(r[1],JSON.parse(localStorage.getItem("labelsSelected")||"null")),s=function(e){return 2===(null===e||void 0===e?void 0:e.length)?e[1]:e[1]-e[2]},c=parseFloat(i.datapoint[1])%1?parseFloat(s(i.datapoint)).toFixed(3):s(i.datapoint),f=l.length>0,p=[],v=0;v\n

',d()(i.datapoint[0]).format("YYYY-MM-DDTHH:mm:ss.SSSZ"),'

\n \n

\n Value: ').concat(c,'

\n \n
\n ').concat(w,"\n
"));zl("#tooltip").remove();var j=S;if((null===p||void 0===p?void 0:p.length)>0){var k=function(e){var n=Cl(e);if((null===n||void 0===n?void 0:n.length)>0){var t,r,i=null===n||void 0===n?void 0:n.sort((function(e,n){return e.label.length>n.label.length?0:1}));return i&&i.length>0?null===(t=i[0])||void 0===t||null===(r=t.label)||void 0===r?void 0:r.length:0}return 0}(p);!function(e,n,t,r){var i,a=window.innerWidth/2,l=window.event.clientX;i=l,l>a&&(i-=r<125?6*r+15:505);zl(o().sanitize('
'.concat(t,"
"))).css({position:"absolute",display:"none",top:n,left:i,padding:"6px","font-size":"12px","flex-direction":"column","max-width":"500px","border-radius":"6px 6px 6px 6px","background-color":"#333",color:"#aaa"}).appendTo("body").fadeIn(125)}(i.pageX,i.pageY,j,k)}}}():(zl("#tooltip").remove(),n=null)}))}var Bl,Hl,Pl,ql,Al,Ql,Wl,Ul={critical:"purple",error:"red",warning:"orange",info:"green",debug:"blue",trace:"lightblue",unknown:"gray"},Jl=function(e,n,t){return(0,f.useMemo)((function(){var r,i,a=[{data:[],label:[],isVisible:!0,shadowSize:0,id:""}];return(null===n||void 0===n?void 0:n.length)>0?(a=null===(r=(0,H.Z)(n))||void 0===r?void 0:r.map((function(e){var r,i,a={data:(r=null===e||void 0===e?void 0:e.values,(null===r||void 0===r?void 0:r.map((function(e){var n=(0,u.Z)(e,2);return[1e3*n[0],n[1]]})))||[]),label:Ml(null===e||void 0===e?void 0:e.metric,t,n.length),isVisible:!0,shadowSize:0,id:e.id};if(t){var o=(i=Ml(null===e||void 0===e?void 0:e.metric,t,n.length)||"",Ul[i[0]]||"gray");a.color=o}return a})),e?null===(i=a)||void 0===i?void 0:i.splice(0,20):a):a}),[e,n])},Gl=function(e){var n=e.tWidth,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,f.useMemo)((function(){if(n){var e=(0,l.Z)({},Zl(t));return e.xaxis.ticks=Math.round(n/125),e}return Zl}),[n])},Kl=function(e){return(0,f.useMemo)((function(){return Ve.n[e]}),[e])};function Yl(){return(0,f.useMemo)((function(){return function(){try{var e=localStorage.getItem("labelsSelected");if("string"===typeof e)return JSON.parse(e)}catch(n){return console.log(n),[]}}()}),[])}var Xl=jt.Z.div(Bl||(Bl=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n max-height: 60px;\n overflow-y: auto;\n margin: 5px;\n &::-webkit-scrollbar {\n width: 5px;\n height: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.scrollbarThumb})),$l=jt.Z.div(Hl||(Hl=(0,r.Z)(["\n font-size: 12px;\n color: ",";\n font-family: sans-serif;\n display: flex;\n align-items: center;\n line-height: 1.5;\n padding-right: 10px;\n cursor: pointer;\n opacity: ",";\n border-radius: 3px;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.isVisible?"1":".5"}),(function(e){return e.theme.buttonHover})),es=jt.Z.div(Pl||(Pl=(0,r.Z)(["\n height: 4px;\n width: 16px;\n margin-right: 8px;\n background: ",';\n content: " ";\n'])),(function(e){return e.color})),ns=jt.Z.button(ql||(ql=(0,r.Z)(["\n background: ",";\n color: ",";\n padding: 3px 12px;\n border: 1px solid ",";\n border-radius: ",";\n cursor: pointer;\n font-size: 12px;\n line-height: 20px;\n white-space: nowrap;\n flex: 1;\n"])),(function(e){return e.isActive?e.theme.buttonDefault:e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}),(function(e){return e.rightBtn?"0px 3px 3px 0px":e.leftBtn?"3px 0px 0px 3px":"none"})),ts=jt.Z.div(Al||(Al=(0,r.Z)(["\n display: flex;\n align-items: center;\n flex-direction: ",";\n\n margin: 10px 25px;\n justify-content: space-between;\n .limit-cont {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex: 1;\n margin-bottom: ",";\n width: ",";\n div {\n flex: ",";\n text-align: ",";\n }\n }\n .chart-buttons-cont {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: ",";\n width: ",";\n }\n"])),(function(e){return e.isMobile?"column":"row"}),(function(e){return e.isMobile?"10px":"0px"}),(function(e){return e.isMobile?"100%":"auto"}),(function(e){return e.isMobile?"1":"0"}),(function(e){return e.isMobile?"center":"left"}),(function(e){return e.isMobile?"1":"0"}),(function(e){return e.isMobile?"100%":"auto"})),rs=jt.Z.div(Ql||(Ql=(0,r.Z)(["\n font-size: 12px;\n line-height: 20px;\n padding: 3px 12px;\n white-space: nowrap;\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n cursor: pointer;\n transition: 0.2s all;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover})),is=jt.Z.div(Wl||(Wl=(0,r.Z)(["\n height: inherit;\n display: flex;\n flex-direction: column;\n flex: 1;\n background: ",";\n .chart-cont {\n flex: 1;\n }\n"])),(function(e){return e.theme.chartBg}));function as(e){var n=e.onLabelClick,t=e.labels,r=Yl(),i=(0,f.useMemo)((function(){return(null===r||void 0===r?void 0:r.length)>0}),[r]);function a(e){var n=e.id;return null===r||void 0===r?void 0:r.some((function(e){return e.id===n}))}return(0,Fe.jsx)(Xl,{children:(null===t||void 0===t?void 0:t.length)&&(null===t||void 0===t?void 0:t.map((function(e,r){return(0,Fe.jsxs)($l,{isVisible:!i||a(e),onClick:function(){return function(e){e.isVisible=!e.isVisible,n(t,e)}(e)},children:[(0,Fe.jsx)(es,{color:e.color}),e.label]},r)})))})}function os(e){var n=e.isSpliced,t=e.handleNoLimitData,r=e.handleLimitData,i=e.matrixData;return n?(0,Fe.jsxs)(rs,{onClick:t,children:[i.length>20?"Showing: 20 Series, Show All ":"Showing: ",i.length," Series"]}):(0,Fe.jsxs)(rs,{onClick:r,children:["Showing: ",i.length," Series, Show Only 20 Series"]})}function ls(e){var n=e.matrixData,t=e.chartType,r=e.handleNoLimitData,i=e.handleLimitData,a=e.isSpliced,o=e.onSetChartType,l=(0,hr.Fg)(),s=(0,_.useMediaQuery)({query:"(max-width: 565px)"});return(0,Fe.jsx)(I.a,{theme:l,children:(0,Fe.jsxs)(ts,{isMobile:s,children:[(0,Fe.jsx)("div",{className:"limit-cont",children:(0,Fe.jsx)(os,{isSpliced:a,handleNoLimitData:r,handleLimitData:i,matrixData:n})}),(0,Fe.jsxs)("div",{className:"chart-buttons-cont",children:[(0,Fe.jsx)(ns,{isActive:"bar"===t,onClick:function(){o("bar")},leftBtn:!0,children:"bar chart"}),(0,Fe.jsx)(ns,{onClick:function(){o("line")},isActive:"line"===t,children:"line chart"}),(0,Fe.jsx)(ns,{onClick:function(){o("points")},isActive:"points"===t,rightBtn:!0,children:"points chart"})]})]})})}function ss(e){var n=e.theme,t=e.matrixData,r=e.chartType,i=e.handleLimitData,a=e.handleNoLimitData,o=e.isSpliced,l=e.onSetChartType,s=e.chartRef,u=e.onLabelClick,c=e.labels,d=e.isLogsVolume;return(0,Fe.jsx)(I.a,{theme:n,children:(0,Fe.jsxs)(is,{children:[d?(0,Fe.jsx)("div",{style:{display:"flex",justifyContent:"center",fontSize:"12px",color:n.textColor},children:"Logs Volume"}):(0,Fe.jsx)(ls,{matrixData:t,chartType:r,handleNoLimitData:a,handleLimitData:i,isSpliced:o,onSetChartType:l}),(0,Fe.jsx)("div",{className:"chart-cont",children:(0,Fe.jsx)("div",{ref:s,id:"chart-container",style:{flex:"1",minHeight:"97px",height:"100%",display:"block",position:"relative",paddingTop:"10px"}})}),(0,Fe.jsx)(as,{onLabelClick:u,labels:c})]})})}function us(e){var n=e.matrixData,t=e.actualQuery,r=e.type,a=e.tWidth,o=t.expr,s=t.dataSourceType,d=t.queryType,p=t.limit,h=t.panel,g=t.id,m=t.isLogsVolume,x=(0,f.useRef)(null),b=(0,i.v9)((function(e){return e.theme})),y=Kl(b),Z=window.jQuery;Z.fn.UseTooltip=Fl;var w=Jl(!0,n,m&&"stream"===r),S=(0,i.I0)(),j=(0,f.useState)(!0),k=(0,u.Z)(j,2),C=k[0],T=k[1],_=(0,f.useState)(w),I=(0,u.Z)(_,2),D=I[0],N=I[1],M=(0,f.useState)(Jl(!1,n,m&&"stream"===r)),E=(0,u.Z)(M,1)[0],R=(0,f.useState)([]),O=(0,u.Z)(R,2),L=O[0],V=O[1],z=(0,f.useState)(x.current),F=(0,u.Z)(z,2),B=F[0],H=F[1],P=Gl({tWidth:a},m&&"stream"===r||!1),q=(0,f.useState)(P),A=(0,u.Z)(q,2),Q=A[0],W=A[1],U=(0,f.useMemo)((function(){var e=localStorage.getItem(yl);return m&&"stream"===r?"bar":""!==e?e:"line"}),[m]),J=(0,f.useState)(U),G=(0,u.Z)(J,2),K=G[0],Y=G[1];function X(e,n,t){var r=0;m&&"stream"===n&&(r=Il(_l(e),a));var i=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"bar":return{series:wl(n,t)};case"line":default:return{series:Sl(t)};case"points":return{series:jl(t)}}}(n,r),o=Dl(e),s=o.timeformat,u=o.min,c=o.max;return Z.plot(t,e,Z.extend(!0,{},Q,(0,l.Z)((0,l.Z)({},i),{},{xaxis:{timeformat:s,min:u,max:c}})))}function $(e){var n=Z(x.current),t=C?D:E,r=Ol(t,e);try{var i=X(r,e,n),a=i.getData();V(a),Z(x.current).UseTooltip(i),Y(e),function(e){localStorage.setItem(yl,e)}(e)}catch(o){console.log(t,o)}}function ee(e,n){var t=Z(x.current),i=C?D:E;e.preventDefault();var u=[],f=JSON.parse(localStorage.getItem("labelsSelected")||"null")||[];if((null===f||void 0===f?void 0:f.length)>0){var b=0;m&&"stream"===r&&(b=Il(_l(i),a));var y=Nl(K,b,m&&"stream"===r),w=y.lines,j=y.bars,k=y.points,T=null===f||void 0===f?void 0:f.map((function(e){return e.id}));u=null===i||void 0===i?void 0:i.map((function(e){return T.includes(e.id)?(0,l.Z)((0,l.Z)({},e),{},{stack:m&&"stream"===r,bars:j,lines:w,points:k,isVisible:!0,shadowSize:0}):(0,l.Z)((0,l.Z)({},e),{},{lines:(0,l.Z)((0,l.Z)({},e.lines),{},{show:!1}),bars:(0,l.Z)((0,l.Z)({},e.bars),{},{show:!1}),points:(0,l.Z)((0,l.Z)({},e.points),{},{show:!1}),isVisible:!1,shadowSize:0})}))}else u=i;try{var _=Z.plot(t,u,Z.extend(!0,{},Q,{xaxis:{min:n.xaxis.from-1e5,max:n.xaxis.to+1e5,timeformat:Dl(u).timeformat}}));Z(x.current).UseTooltip(_),setTimeout((function(){var e=n.xaxis.from,t=n.xaxis.to,r=new Date(c(parseInt(e)).format("YYYY-MM-DDTHH:mm:ss.SSSZ")),i=new Date(c(parseInt(t)).format("YYYY-MM-DDTHH:mm:ss.SSSZ")),a=(0,st.Z)(r,"yyyy/MM/dd HH:mm:ss"),l=(0,st.Z)(i,"yyyy/MM/dd HH:mm:ss"),u="".concat(a,"-").concat(l);S((0,v.wW)(i)),S((0,v.qv)(r)),S((0,v.Xn)(u)),S(Tn(s,o,d,p,h,g))}),400)}catch(I){console.log("error on chart redraw",I)}}(0,f.useEffect)((function(){H(x.current),V(null===D||void 0===D?void 0:D.map((function(e){return e.label}))),Z(x.current).bind("plotselected",ee),N(w),localStorage.setItem("labelsSelected",JSON.stringify([]))}),[]),(0,f.useEffect)((function(){W(Q),H(x.current),function(){var e=C?D:E,n=Z(x.current),t=Ol(e,null);try{var i=0;m&&"stream"===r&&(i=Il(_l(t),a));var o=Dl(t),l=o.timeformat,s=o.min,u=o.max,c=Nl(K,i,m&&"stream"===r),d=c.bars,f=c.lines,p=c.points,v=c.stack,h=Z.plot(n,t,Z.extend(!0,{},Q,{series:{stack:v,bars:d,lines:f,points:p},xaxis:{timeformat:l,min:s,max:u}})),g=h.getData();V(g),Z(x.current).UseTooltip(h)}catch(b){console.log(b)}}()}),[n,C]);if(n){var ne={height:e.vHeight,theme:y,matrixData:n,chartType:K,handleLimitData:function(e){T(!0)},handleNoLimitData:function(e){T(!1)},isSpliced:C,onSetChartType:$,chartRef:x,onLabelClick:function(e,n){var t=[],i=JSON.parse(localStorage.getItem("labelsSelected")||"null")||[];if(i.some((function(e){return e.id===n.id}))){var o=i.filter((function(e){return e.id!==n.id}));localStorage.setItem("labelsSelected",JSON.stringify(o)),t=o}else t=i.concat(n),localStorage.setItem("labelsSelected",JSON.stringify(t));if(t.length>0){var s,u=null===(s=t)||void 0===s?void 0:s.map((function(e){return e.id})),c=Nl(K,0),d=c.lines,f=c.bars,p=c.points,v=null===e||void 0===e?void 0:e.map((function(e){return u.includes(e.id)?(0,l.Z)((0,l.Z)({},e),{},{stack:m&&"stream"===r,bars:f,lines:d,points:p}):(0,l.Z)((0,l.Z)({},e),{},{lines:(0,l.Z)((0,l.Z)({},e.lines),{},{show:!1}),bars:(0,l.Z)((0,l.Z)({},e.bars),{},{show:!1}),points:(0,l.Z)((0,l.Z)({},e.points),{},{show:!1})})})),h=Dl(v),g=h.timeformat,b=h.min,y=h.max,w=0;m&&"stream"===r&&(w=Il(_l(v),a));var S=Z.plot(B,v,Z.extend(!0,{},Q,{series:Nl(K,w),xaxis:{timeformat:g,min:b,max:y}})),j=S.getData();V(j),Z(x.current).UseTooltip(S)}else{var k=C?D:E,T=0;m&&"stream"===r&&(T=Il(_l(k),a));var _=Nl(K,T),I=_.lines,N=_.bars,M=_.points,R=null===k||void 0===k?void 0:k.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{bars:N,lines:I,points:M,isVisible:!0,shadowSize:0})})),O=Dl(R),L=O.timeformat,z=O.min,F=O.max,H=Z.plot(B,R,Z.extend(!0,{},Q,{series:Nl(K,T||0,m&&"stream"===r),xaxis:{timeformat:L,min:z,max:F}})),P=H.getData();V(P),Z(x.current).UseTooltip(H)}},labels:L,isLogsVolume:m&&"stream"===r},te=new Set;return n.forEach((function(e){var n;null===e||void 0===e||null===(n=e.values)||void 0===n||n.forEach((function(e){return te.add(null===e||void 0===e?void 0:e[0])}))})),1===te.size&&"bar"!==K&&$("bar"),(0,Fe.jsx)(ss,(0,l.Z)({},ne))}return null}function cs(e){var n,t=e.viewRef,r=e.panelSize,a=e.viewHeight,o=e.setStreamClose,s=e.setMaxHeight,c=e.setMinimize,d=e.actualQuery,p=e.total,v=e.type,h=e.theight,g=e.viewWidth,m=e.tableData,x=e.streamData,b=e.logsVolumeData,y=d.isLogsVolume,Z=d.limit,w=(0,f.useState)(gl(d)[d.id]||0),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,f.useMemo)((function(){var n;return JSON.parse(JSON.stringify(null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw))||[]}),[null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw]),T=(0,i.v9)((function(e){return e.theme})),_=(0,f.useMemo)((function(){return"light"===T?"rjv-default":"tomorrow"}),[T]);return(0,Fe.jsxs)(Ia,{ref:t,size:r,vheight:a,children:[(0,Fe.jsx)(Za,(0,l.Z)({onClose:o,setMinimize:c,setMaxHeight:s,actualQuery:d,total:p,type:v},e)),y&&(null===b||void 0===b?void 0:b.length)>0&&g>0&&(0,Fe.jsx)("div",{children:(0,Fe.jsx)(us,(0,l.Z)((0,l.Z)({},e),{},{tWidth:g,chartLimit:Z,matrixData:b,actualQuery:d}))}),(0,Fe.jsxs)(ht.Z,{defaultValue:gl(d)[d.id]||0,value:j,onChange:function(e,n){var t=(0,l.Z)((0,l.Z)({},gl(d)),{},(0,B.Z)({},d.id,n));localStorage.setItem("tabsState",JSON.stringify(t)),"number"===typeof n&&k((function(){return n}))},children:[(0,Fe.jsxs)(Na,{panelsize:e.panelSize,children:[(0,Fe.jsx)(Ma,{children:"Logs"}),m&&(0,Fe.jsx)(Ma,{children:"Table"}),(0,Fe.jsx)(Ma,{children:"Raw"})]}),(0,Fe.jsx)(Da,{value:0,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)(Do,(0,l.Z)((0,l.Z)({},e),{},{onClose:o,messages:x,actualQuery:d}))})}),(0,Fe.jsx)(Da,{value:1,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)(pl,(0,l.Z)((0,l.Z)({},e),{},{height:h,data:m,actualQuery:d}))})}),(0,Fe.jsx)(Da,{value:2,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)("div",{style:{padding:"20px"},children:(0,Fe.jsx)(hl(),{theme:_,src:C})})})})]})]})}var ds,fs=function(e){var n,t=e.viewRef,r=e.panelSize,a=e.viewHeight,o=e.setStreamClose,s=e.setMaxHeight,c=e.setMinimize,d=e.actualQuery,p=e.total,v=e.type,h=e.theight,g=e.tableData,m=e.viewWidth,x=e.limit,b=e.streamData,y=(0,i.v9)((function(e){return e.theme})),Z=(0,f.useMemo)((function(){return"light"===y?"rjv-default":"tomorrow"}),[y]),w=(0,f.useState)(gl(d)[d.id]||0),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,f.useMemo)((function(){var n;return JSON.parse(JSON.stringify(null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw))||[]}),[null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw]);return(0,Fe.jsxs)(Ia,{ref:t,size:r,vheight:a,children:[(0,Fe.jsx)(Za,(0,l.Z)({onClose:o,setMinimize:c,setMaxHeight:s,actualQuery:d,total:p,type:v},e)),(0,Fe.jsxs)(ht.Z,{style:{display:"flex",flex:1,flexDirection:"column"},defaultValue:gl(d)[d.id]||0,value:j,onChange:function(e,n){var t=(0,l.Z)((0,l.Z)({},gl(d)),{},(0,B.Z)({},d.id,n));localStorage.setItem("tabsState",JSON.stringify(t)),"number"===typeof n&&k((function(){return n}))},children:[(0,Fe.jsxs)(Na,{panelsize:e.panelSize,children:[(0,Fe.jsx)(Ma,{children:"Chart"}),(0,Fe.jsx)(Ma,{children:"Table"}),(0,Fe.jsx)(Ma,{children:"Raw"})]}),(0,Fe.jsx)(Da,{value:0,children:(0,Fe.jsx)("div",{className:"view-content",style:{height:"100%"},children:(0,Fe.jsx)(us,(0,l.Z)((0,l.Z)({},e),{},{tWidth:m,chartLimit:x,matrixData:b,actualQuery:d}))})}),(0,Fe.jsx)(Da,{value:1,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)(pl,(0,l.Z)((0,l.Z)({},e),{},{height:h,data:g,actualQuery:d}))})}),(0,Fe.jsx)(Da,{value:2,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)("div",{style:{padding:"20px"},children:(0,Fe.jsx)(hl(),{theme:Z,src:C})})})})]})]})},ps=function(e){var n,t=e.viewRef,r=e.panelSize,a=e.viewHeight,s=e.setStreamClose,c=e.setMinimize,d=e.setMaxHeight,p=e.actualQuery,v=e.total,h=e.type,g=e.theight,m=e.streamData,x=e.viewWidth,b=e.limit,y=(0,i.v9)((function(e){return e.theme})),Z=(0,f.useMemo)((function(){return"light"===y?"rjv-default":"tomorrow"}),[y]),w=(0,f.useRef)(null),S=(0,f.useMemo)((function(){var n;return JSON.parse(JSON.stringify(null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw))||[]}),[null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw]),j=(0,f.useState)(gl(p)[p.id]||0),k=(0,u.Z)(j,2),C=k[0],T=k[1];return(0,Fe.jsxs)(Ia,{ref:t,size:r,vheight:a,children:[(0,Fe.jsx)(Za,(0,l.Z)({onClose:s,setMinimize:c,setMaxHeight:d,actualQuery:p,total:v,type:h},e)),(0,Fe.jsxs)(ht.Z,{defaultValue:gl(p)[p.id]||0,value:C,onChange:function(e,n){var t=(0,l.Z)((0,l.Z)({},gl(p)),{},(0,B.Z)({},p.id,n));localStorage.setItem("tabsState",JSON.stringify(t)),"number"===typeof n&&T((function(){return n}))},children:[(0,Fe.jsxs)(Na,{panelsize:e.panelSize,children:[(0,Fe.jsx)(Ma,{children:"Table"}),(0,Fe.jsx)(Ma,{children:"Raw"}),(null===m||void 0===m?void 0:m.chartData)&&(0,Fe.jsx)(Ma,{children:"Chart"})]}),(0,Fe.jsx)(Da,{value:0,children:(0,Fe.jsx)("div",{className:"view-content",ref:w,id:o().sanitize("".concat(null===p||void 0===p?void 0:p.id,"-view")),children:(0,Fe.jsx)(pl,(0,l.Z)((0,l.Z)({},e),{},{height:g,data:m.tableData,actualQuery:p}))})}),(0,Fe.jsx)(Da,{value:1,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)("div",{style:{padding:"20px"},children:(0,Fe.jsx)(hl(),{theme:Z,src:S})})})}),(null===m||void 0===m?void 0:m.chartData)&&(0,Fe.jsx)(Da,{value:2,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)(us,(0,l.Z)((0,l.Z)({},e),{},{tWidth:x,chartLimit:b,matrixData:m.chartData,actualQuery:p}))})})]})]})},vs=t(66781),hs=t.n(vs),gs={scrollPageDown:{binding:"s",label:"Scroll down"},scrollPageUp:{binding:"w",label:"Scroll up"},scrollToNextVisibleSpan:{binding:"f",label:"Scroll to the next visible span"},scrollToPrevVisibleSpan:{binding:"b",label:"Scroll to the previous visible span"},panLeft:{binding:["a","left"],label:"Pan left"},panLeftFast:{binding:["shift+a","shift+left"],label:"Pan left \u2014 Large"},panRight:{binding:["d","right"],label:"Pan right"},panRightFast:{binding:["shift+d","shift+right"],label:"Pan right \u2014 Large"},zoomIn:{binding:"up",label:"Zoom in"},zoomInFast:{binding:"shift+up",label:"Zoom in \u2014 Large"},zoomOut:{binding:"down",label:"Zoom out"},zoomOutFast:{binding:"shift+down",label:"Zoom out \u2014 Large"},collapseAll:{binding:"]",label:"Collapse All"},expandAll:{binding:"[",label:"Expand All"},collapseOne:{binding:"p",label:"Collapse One Level"},expandOne:{binding:"o",label:"Expand One Level"},searchSpans:{binding:"ctrl+b",label:"Search Spans"},clearSearch:{binding:"escape",label:"Clear Search"}};function ms(){if(ds)return ds;var e=new(hs())(document.body);return ds=e,e}var xs,bs,ys,Zs,ws,Ss,js,ks,Cs,Ts,_s,Is,Ds,Ns,Ms,Es,Rs,Os,Ls=t(46123),Vs=t.n(Ls),zs=(0,ze.iv)(xs||(xs=(0,r.Z)(["\n position: relative;\n"]))),Fs=function(e){return(0,ze.iv)(bs||(bs=(0,r.Z)(["\ncolor: ",";\n"])),e.textColor)},Bs=(0,ze.iv)(ys||(ys=(0,r.Z)(["\n margin-bottom: 0.25rem;\n"]))),Hs=(0,ze.iv)(Zs||(Zs=(0,r.Z)(["\n margin-top: 0.25rem;\n margin-bottom: 0.25rem;\n"]))),Ps=(0,ze.iv)(ws||(ws=(0,r.Z)(["\n margin: 0;\n font-size:12px;\n font-weight:bold;\n font-family:monospace;\n"]))),qs=(0,ze.iv)(Ss||(Ss=(0,r.Z)(["\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n"]))),As=(0,ze.iv)(js||(js=(0,r.Z)(["\n padding-bottom: 0.5rem;\n"]))),Qs=(0,ze.iv)(ks||(ks=(0,r.Z)(["\n display: flex;\n"]))),Ws=((0,ze.iv)(Cs||(Cs=(0,r.Z)(["\n align-items: center;\n"]))),(0,ze.iv)(Ts||(Ts=(0,r.Z)(["\n align-items: start;\n"]))),(0,ze.iv)(_s||(_s=(0,r.Z)(["\n flex: 1 1 auto;\n min-width: 0; /* 1 */\n min-height: 0; /* 1 */\n"]))),(0,ze.iv)(Is||(Is=(0,r.Z)(["\n text-align: right;\n"])))),Us=(0,ze.iv)(Ds||(Ds=(0,r.Z)(["\n display: inline-block;\n"]))),Js=(0,ze.iv)(Ns||(Ns=(0,r.Z)(["\n // margin: -0.2rem 0.25rem 0 0;\n"]))),Gs=(0,ze.iv)(Ms||(Ms=(0,r.Z)(["\n text-overflow: ellipsis;\n"]))),Ks=(0,ze.iv)(Es||(Es=(0,r.Z)(["\n width: 100%;\n"]))),Ys=(0,ze.iv)(Rs||(Rs=(0,r.Z)(["\n color: #aaa;\n"]))),Xs=((0,ze.iv)(Os||(Os=(0,r.Z)(["\n justify-content: flex-end;\n"]))),t(82374)),$s=t.n(Xs);var eu=1e3,nu=1e3*eu,tu=60*nu,ru=60*tu,iu=24*ru,au=Math.log10(eu),ou=[{unit:"d",microseconds:iu,ofPrevious:24},{unit:"h",microseconds:ru,ofPrevious:60},{unit:"m",microseconds:tu,ofPrevious:60},{unit:"s",microseconds:nu,ofPrevious:1e3},{unit:"ms",microseconds:eu,ofPrevious:1e3},{unit:"\u03bcs",microseconds:1,ofPrevious:1e3}];var lu=function(e,n,t){return function(e,n){var t=n+(Math.floor(Math.log10(Math.abs(e)))+1);return t<=0?Math.trunc(e):Number(e.toPrecision(t))}(e/t,n)*t};function su(e){var n=(0,De.dropWhile)(ou,(function(n,t){var r=n.microseconds;return te})),t=(0,u.Z)(n,2),r=t[0],i=t[1];if(1e3===r.ofPrevious)return"".concat((0,De.round)(e/r.microseconds,2)).concat(r.unit);var a=Math.floor(e/r.microseconds),o="".concat(a).concat(r.unit),l=Math.round(e/i.microseconds%r.ofPrevious),s="".concat(l).concat(i.unit);return 0===l?o:"".concat(o," ").concat(s)}function uu(e,n,t){return!(!Array.isArray(t.tags)||!t.tags.length)&&t.tags.some((function(t){return t.key===e&&t.value===n}))}var cu=uu.bind(null,"span.kind","client"),du=uu.bind(null,"span.kind","server"),fu=uu.bind(null,"error",!0),pu=uu.bind(null,"error","true"),vu=function(e){return fu(e)||pu(e)};var hu,gu,mu,xu,bu=jt.Z.div(hu||(hu=(0,r.Z)(["\n pointer-events: none;\n"]))),yu=jt.Z.div(gu||(gu=(0,r.Z)(["\n position: absolute;\n height: 100%;\n width: 1px;\n background: ",";\n &:last-child {\n width: 0;\n }\n"])),(function(e){return e.theme.buttonBorder})),Zu=(0,ze.iv)(mu||(mu=(0,r.Z)(["\n left: 0.25rem;\n position: absolute;\n"]))),wu=(0,ze.iv)(xu||(xu=(0,r.Z)(["\n left: initial;\n right: 0.25rem;\n"])));function Su(e){var n,t=e.endTime,r=e.numTicks,i=e.showLabels,a=e.startTime;if(i){n=[];for(var o=(t||0)-(a||0),l=0;l=1)),children:n[c]})},d))}return(0,Fe.jsx)(bu,{children:u})}Su.defaultProps={endTime:null,showLabels:null,startTime:null};var ju,ku=["children","className"],Cu=["children","className","width","style","theme"],Tu=function(e){return(0,ze.iv)(ju||(ju=(0,r.Z)(["\n color: ",";\n display: flex;\n flex: 0 1 auto;\n flex-direction: row;\n"])),null===e||void 0===e?void 0:e.textColor)};function _u(e){var n=e.children,t=e.className,r=void 0===t?"":t,i=(0,Vo.Z)(e,ku);return(0,Fe.jsx)("div",(0,l.Z)((0,l.Z)({className:Vs()(Tu(e.theme),r)},i),{},{children:n}))}function Iu(e){var n=e.children,t=e.className,r=void 0===t?"":t,i=e.width,a=e.style,o=e.theme,s=(0,Vo.Z)(e,Cu),u="".concat(100*i,"%"),c=(0,l.Z)((0,l.Z)({},a),{},{flexBasis:u,maxWidth:u});return(0,Fe.jsx)("div",(0,l.Z)((0,l.Z)({className:Vs()(zs,r,Fs(o)),style:c,"data-testid":"TimelineRowCell"},s),{},{children:n}))}_u.defaultProps={className:""},Iu.defaultProps={className:"",style:{}},_u.Cell=Iu;var Du,Nu,Mu=t(75115),Eu=t(96447),Ru=(0,ze.iv)(Du||(Du=(0,r.Z)(["\n align-items: center;\n display: flex;\n flex: none;\n gap:2px;\n justify-content: center;\n margin-right: 0.5rem;\n"])));function Ou(e){var n=e.onExpandAll,t=e.onExpandOne,r=e.onCollapseAll,i=e.onCollapseOne;return(0,Fe.jsxs)("div",{className:Ru,"data-testid":"TimelineCollapser",children:[(0,Fe.jsx)(D.Z,{title:"Expand +1",children:(0,Fe.jsx)(ga.Z,{fontSize:"small",style:{cursor:"pointer",color:e.theme.textColor},onClick:t})}),(0,Fe.jsx)(D.Z,{title:"Collapse +1",children:(0,Fe.jsx)(mt.Z,{fontSize:"small",style:{cursor:"pointer",color:e.theme.textColor},onClick:i})}),(0,Fe.jsx)(D.Z,{title:"Expand All",children:(0,Fe.jsx)(Mu.Z,{fontSize:"small",style:{cursor:"pointer",color:e.theme.textColor},onClick:n})}),(0,Fe.jsx)(D.Z,{title:"Collapse All",children:(0,Fe.jsx)(Eu.Z,{fontSize:"small",style:{cursor:"pointer",color:e.theme.textColor},onClick:r})})]})}!function(e){e.DragEnd="DragEnd",e.DragMove="DragMove",e.DragStart="DragStart",e.MouseEnter="MouseEnter",e.MouseLeave="MouseLeave",e.MouseMove="MouseMove"}(Nu||(Nu={}));var Lu,Vu,zu,Fu,Bu,Hu,Pu,qu,Au,Qu,Wu,Uu,Ju,Gu,Ku=Nu,Yu=["getBounds","tag","resetBoundsOnResize"],Xu=0,$u=function(){function e(n){var t=this,r=n.getBounds,i=n.tag,a=n.resetBoundsOnResize,o=void 0===a||a,l=(0,Vo.Z)(n,Yu);(0,Fa.Z)(this,e),this._bounds=void 0,this._isDragging=void 0,this._onMouseEnter=void 0,this._onMouseLeave=void 0,this._onMouseMove=void 0,this._onDragStart=void 0,this._onDragMove=void 0,this._onDragEnd=void 0,this._resetBoundsOnResize=void 0,this.getBounds=void 0,this.tag=void 0,this.handleMouseEnter=void 0,this.handleMouseMove=void 0,this.handleMouseLeave=void 0,this.handleMouseDown=void 0,this.resetBounds=function(){t._bounds=void 0},this._handleMinorMouseEvent=function(e){var n=e.button,r=e.clientX,i=e.type;if(!t._isDragging&&n===Xu){var a,o=null;if("mouseenter"===i)o=Ku.MouseEnter,a=t._onMouseEnter;else if("mouseleave"===i)o=Ku.MouseLeave,a=t._onMouseLeave;else{if("mousemove"!==i)throw new Error("invalid event type: ".concat(i));o=Ku.MouseMove,a=t._onMouseMove}if(a){var l=t._getPosition(r);a({event:e,type:o,value:l.value,x:l.x,manager:t,tag:t.tag})}}},this._handleDragEvent=function(e){var n,r=e.button,i=e.clientX,a=e.type,o=null;if("mousedown"===a){if(t._isDragging||r!==Xu)return;window.addEventListener("mousemove",t._handleDragEvent),window.addEventListener("mouseup",t._handleDragEvent);var l=(0,De.get)(document,"body.style");l&&(l.userSelect="none"),t._isDragging=!0,o=Ku.DragStart,n=t._onDragStart}else if("mousemove"===a){if(!t._isDragging)return;o=Ku.DragMove,n=t._onDragMove}else{if("mouseup"!==a)throw new Error("invalid event type: ".concat(a));if(!t._isDragging)return;t._stopDragging(),o=Ku.DragEnd,n=t._onDragEnd}if(n){var s=t._getPosition(i);n({event:e,type:o,value:s.value,x:s.x,manager:t,tag:t.tag})}},this.handleMouseDown=this._handleDragEvent,this.handleMouseEnter=this._handleMinorMouseEvent,this.handleMouseMove=this._handleMinorMouseEvent,this.handleMouseLeave=this._handleMinorMouseEvent,this.getBounds=r,this.tag=i,this._isDragging=!1,this._bounds=void 0,this._resetBoundsOnResize=Boolean(o),this._resetBoundsOnResize&&window.addEventListener("resize",this.resetBounds),this._onMouseEnter=l.onMouseEnter,this._onMouseLeave=l.onMouseLeave,this._onMouseMove=l.onMouseMove,this._onDragStart=l.onDragStart,this._onDragMove=l.onDragMove,this._onDragEnd=l.onDragEnd}return(0,Ba.Z)(e,[{key:"_getBounds",value:function(){return this._bounds||(this._bounds=this.getBounds(this.tag)),this._bounds}},{key:"_getPosition",value:function(e){var n=this._getBounds(),t=n.clientXLeft,r=n.maxValue,i=n.minValue,a=n.width,o=e-t,l=o/a;return null!=i&&lr&&(l=r,o=r*a),{value:l,x:o}}},{key:"_stopDragging",value:function(){window.removeEventListener("mousemove",this._handleDragEvent),window.removeEventListener("mouseup",this._handleDragEvent);var e=(0,De.get)(document,"body.style");e&&(e.userSelect=null),this._isDragging=!1}},{key:"isDragging",value:function(){return this._isDragging}},{key:"dispose",value:function(){this._isDragging&&this._stopDragging(),this._resetBoundsOnResize&&window.removeEventListener("resize",this.resetBounds),this._bounds=void 0,this._onMouseEnter=void 0,this._onMouseLeave=void 0,this._onMouseMove=void 0,this._onDragStart=void 0,this._onDragMove=void 0,this._onDragEnd=void 0}}]),e}(),ec=jt.Z.div(Lu||(Lu=(0,r.Z)(["\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n"]))),nc=(0,ze.iv)(Vu||(Vu=(0,r.Z)(['\n border-left: 2px solid transparent;\n cursor: col-resize;\n height: 5000px;\n margin-left: -1px;\n position: absolute;\n top: 0;\n width: 1px;\n z-index: 10;\n &:hover {\n border-left: 2px solid rgba(0, 0, 0, 0.3);\n }\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: -8px;\n right: 0;\n content: " ";\n }\n']))),tc=(0,ze.iv)(zu||(zu=(0,r.Z)(["\n background: rgba(136, 0, 136, 0.05);\n width: unset;\n &::before {\n left: -2000px;\n right: -2000px;\n }\n"]))),rc=(0,ze.iv)(Fu||(Fu=(0,r.Z)(["\n border-left: 2px solid #808;\n border-right: 1px solid #999;\n"]))),ic=(0,ze.iv)(Bu||(Bu=(0,r.Z)(["\n border-left: 1px solid #999;\n border-right: 2px solid #808;\n"]))),ac=(0,ze.iv)(Hu||(Hu=(0,r.Z)(['\n position: absolute;\n top: 0;\n bottom: 0;\n &::before,\n &::after {\n border-right: 1px solid #ccc;\n content: " ";\n height: 9px;\n position: absolute;\n right: 9px;\n top: 25px;\n }\n &::after {\n right: 5px;\n }\n']))),oc=(0,ze.iv)(Pu||(Pu=(0,r.Z)(["\n &::before,\n &::after {\n border-right: 1px solid rgba(136, 0, 136, 0.5);\n }\n"]))),lc=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e)).state=void 0,r._dragManager=void 0,r._rootElm=void 0,r._setRootElm=function(e){r._rootElm=e},r._getDraggingBounds=function(){if(!r._rootElm)throw new Error("invalid state");var e=r._rootElm.getBoundingClientRect(),n=e.left,t=e.width,i=r.props,a=i.min;return{clientXLeft:n,width:t,maxValue:i.max,minValue:a}},r._handleDragUpdate=function(e){var n=e.value;r.setState({dragPosition:n})},r._handleDragEnd=function(e){var n=e.manager,t=e.value;n.resetBounds(),r.setState({dragPosition:null}),r.props.onChange(t)},r._dragManager=new $u({getBounds:r._getDraggingBounds,onDragEnd:r._handleDragEnd,onDragMove:r._handleDragUpdate,onDragStart:r._handleDragUpdate}),r._rootElm=void 0,r.state={dragPosition:null},r}return(0,Ba.Z)(t,[{key:"componentWillUnmount",value:function(){this._dragManager.dispose()}},{key:"render",value:function(){var e,n=this.props,t=n.position,r=n.columnResizeHandleHeight,i=this.state.dragPosition,a={left:"".concat(100*t,"%")},o=!1,l=!1;this._dragManager.isDragging()&&this._rootElm&&null!=i?(o=it,"".concat(100*i,"%"),e={left:"".concat(100*Math.min(t,i),"%"),right:"calc(".concat(100*(1-Math.max(t,i)),"% - 1px)")}):e=a;e.height=r;var s=o||l;return(0,Fe.jsxs)(ec,{ref:this._setRootElm,"data-testid":"TimelineColumnResizer",children:[(0,Fe.jsx)("div",{className:Vs()(ac,s&&oc),style:a,"data-testid":"TimelineColumnResizer--gripIcon"}),(0,Fe.jsx)("div",{"aria-hidden":!0,className:Vs()(nc,s&&tc,l&&ic,o&&rc),onMouseDown:this._dragManager.handleMouseDown,style:e,"data-testid":"TimelineColumnResizer--dragger"})]})}}]),t}(f.PureComponent),sc=jt.Z.div(qu||(qu=(0,r.Z)(["\n bottom: 0;\n cursor: vertical-text;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n font-size:12px;\n"]))),uc=jt.Z.div(Au||(Au=(0,r.Z)(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 1px;\n background-color: red;\n"]))),cc=(0,ze.iv)(Qu||(Qu=(0,r.Z)(["\n position: absolute;\n top: 0;\n bottom: 0;\n"]))),dc=(0,ze.iv)(Wu||(Wu=(0,r.Z)(["\n border-left: 1px solid;\n"]))),fc=(0,ze.iv)(Uu||(Uu=(0,r.Z)(["\n border-right: 1px solid;\n"]))),pc=(0,ze.iv)(Ju||(Ju=(0,r.Z)(["\n background-color: rgba(68, 68, 255, 0.2);\n border-color: #44f;\n"]))),vc=(0,ze.iv)(Gu||(Gu=(0,r.Z)(["\n background-color: rgba(255, 68, 68, 0.2);\n border-color: #f44;\n"])));function hc(e,n,t){return e+t*(n-e)}function gc(e,n,t){return(t-e)/(n-e)}function mc(e,n,t,r,i){var a,o=function(e,n){var t=e=1||a<=0?{isOutOfView:!0}:(i<0&&(i=0),a>1&&(a=1),{isDraggingLeft:e>n,left:"".concat(100*i,"%"),width:"".concat(100*(a-i),"%")})}(gc(e,n,t),gc(e,n,r));if(function(e){return Reflect.has(e,"isOutOfView")}(o))return null;var l=o.isDraggingLeft,s=o.left,c=o.width,d=(0,ze.cx)((a={},(0,B.Z)(a,fc,!l),(0,B.Z)(a,vc,!i),(0,B.Z)(a,pc,i),a));return(0,Fe.jsx)("div",{className:(0,ze.cx)(cc,dc,d),style:{left:s,width:c},"data-testid":"Dragged"})}var xc,bc,yc,Zc=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e))._draggerReframe=void 0,r._root=void 0,r._setRoot=function(e){r._root=e},r._getDraggingBounds=function(){if(!r._root)throw new Error("invalid state");var e=r._root.getBoundingClientRect();return{clientXLeft:e.left,width:e.width}},r._handleReframeMouseMove=function(e){var n=e.value,t=(0,u.Z)(r.props.viewRangeTime.current,2),i=hc(t[0],t[1],n);r.props.updateNextViewRangeTime({cursor:i})},r._handleReframeMouseLeave=function(){r.props.updateNextViewRangeTime({cursor:void 0})},r._handleReframeDragUpdate=function(e){var n=e.value,t=r.props.viewRangeTime,i=t.current,a=t.reframe,o=(0,u.Z)(i,2),l=hc(o[0],o[1],n),s={reframe:{anchor:a?a.anchor:l,shift:l}};r.props.updateNextViewRangeTime(s)},r._handleReframeDragEnd=function(e){var n=e.manager,t=e.value,i=r.props.viewRangeTime,a=i.current,o=i.reframe,l=(0,u.Z)(a,2),s=hc(l[0],l[1],t),c=o?o.anchor:s,d=s=s&&r<=c&&(e="".concat(100*gc(s,c,r),"%")),(0,Fe.jsxs)(sc,{"aria-hidden":!0,ref:this._setRoot,onMouseDown:this._draggerReframe.handleMouseDown,onMouseLeave:this._draggerReframe.handleMouseLeave,onMouseMove:this._draggerReframe.handleMouseMove,"data-testid":"TimelineViewingLayer",children:[null!=e&&(0,Fe.jsx)(uc,{style:{left:e},"data-testid":"TimelineViewingLayer--cursorGuide"}),null!=i&&mc(s,c,i.anchor,i.shift,!1),null!=a&&mc(s,c,c,a,!0),null!=o&&mc(s,c,s,o,!0)]})}}]),t}(f.PureComponent),wc=function(e){return(0,ze.iv)(xc||(xc=(0,r.Z)(["\n background:",";\n border-bottom: 1px solid ",";\n color:","\n height: 38px;\n line-height: 38px;\n width: 100%;\n z-index: 4;\n position: relative;\n font-size:12px;\n"])),e.mainBgColor,e.buttonBorder,e.textColor)},Sc=(0,ze.iv)(bc||(bc=(0,r.Z)(["\n align-items: center;\n"]))),jc=(0,ze.iv)(yc||(yc=(0,r.Z)(["\n flex: 1;\n overflow: hidden;\n margin: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));function kc(e){var n=e.duration,t=e.nameColumnWidth,r=e.numTicks,i=e.onCollapseAll,a=e.onCollapseOne,o=e.onColummWidthChange,l=e.onExpandAll,s=e.onExpandOne,c=e.updateViewRangeTime,d=e.updateNextViewRangeTime,f=e.viewRangeTime,p=e.columnResizeHandleHeight,v=(0,u.Z)(f.current,2),h=v[0],g=v[1];return(0,Fe.jsxs)(_u,{theme:e.theme,className:wc(e.theme),"data-testid":"TimelineHeaderRow",children:[(0,Fe.jsxs)(_u.Cell,{theme:e.theme,className:Vs()(Qs,qs,Sc),width:t,id:"collapser",children:[(0,Fe.jsx)("h4",{className:jc,children:"Service & Operation"}),(0,Fe.jsx)(Ou,{theme:e.theme,onCollapseAll:i,onExpandAll:l,onCollapseOne:a,onExpandOne:s})]}),(0,Fe.jsxs)(_u.Cell,{theme:e.theme,id:"ticker",width:1-t,children:[(0,Fe.jsx)(Zc,{boundsInvalidator:t,updateNextViewRangeTime:d,updateViewRangeTime:c,viewRangeTime:f}),(0,Fe.jsx)(Su,{theme:e.theme,numTicks:r,startTime:h*n,endTime:g*n,showLabels:!0})]}),(0,Fe.jsx)(lc,{columnResizeHandleHeight:p,position:t,onChange:o,min:.2,max:.85})]})}var Cc=["#7db26c","#eab839","#6cd0e0","#ef853e","#e14c41","#1f78c1","#bb44a9","#715ea1","#4f8542","#cca300","#447ebb","#c05a16","#880f02","#0a427b","#6b1e61","#594578","#b6daa9","#f4d699","#6edaed","#f9ba90","#f29191","#83b6d8","#e5a9e2","#afa3e0","#629e51","#e6ad0f","#64b1c9","#e0752e","#bd1900","#0a52a3","#952d82","#614d93","#99c388","#f2cb6e","#66c6db","#f9924e","#ea6661","#5095ce","#d685ce","#7f6cb7","#3f6732","#977402","#30585f","#99430a","#5a140c","#052b51","#501648","#3e2a5a","#e0f9d7","#fceaca","#d1faff","#f9e2d2","#fce2de","#b8def4","#f9d7f9","#ddd9f7"];function Tc(e){if(7!==e.length)return[0,0,0];var n=e.slice(1,3),t=e.slice(3,5),r=e.slice(5);return[parseInt(n,16),parseInt(t,16),parseInt(r,16)]}var _c=function(){function e(n,t){(0,Fa.Z)(this,e),this.colorsHex=void 0,this.colorsRgb=void 0,this.cache=void 0;var r=function(e,n){if(!n)return Cc;var t=e.indexOf("#e14c41");t>-1&&e.splice(t,1);var r,i=[],a=(0,s.Z)(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i.push(o)}}catch(l){a.e(l)}finally{a.f()}return i}(n,t);this.colorsHex=r,this.colorsRgb=r.map(Tc),this.cache=new Map}return(0,Ba.Z)(e,[{key:"_getColorIndex",value:function(e){var n=this.cache.get(e);if(null==n){var t=this.hashCode(e.toLowerCase()),r=Math.abs(t%this.colorsHex.length);n=4===r?r+1:r,this.cache.set(e,n)}return n}},{key:"hashCode",value:function(e){var n,t=0;for(n=0;n=e&&(this.lastI=e-1))}},{key:"calcHeights",value:function(e,n,t){null!=t&&(this.lastI=t);var r=e+this.bufferLen;if(!(r<=this.lastI)){r>=this.heights.length&&(r=this.heights.length-1);var i=this.lastI;for(-1===this.lastI&&(i=0,this.ys[0]=0);i<=r;){var a=this.heights[i]=n(i);this.ys[i+1]=this.ys[i]+a,i++}this.lastI=r}}},{key:"calcYs",value:function(e,n){for(;(null==this.ys[this.lastI]||e>this.ys[this.lastI])&&this.lastIthis.lastI)this.calcHeights(t,n);else{var r=n(t);if(r!==this.heights[t]){var i=r-this.heights[t];for(this.heights[t]=r;++t<=this.lastI;)this.ys[t]+=i;null!=this.ys[this.lastI+1]&&(this.ys[this.lastI+1]+=i)}}}},{key:"findFloorIndex",value:function(e,n){this.calcYs(e,n);var t,r=0,i=this.lastI;if(this.ys.length<2||ethis.ys[i])return i;for(;rthis.ys[t]){if(e<=this.ys[t+1])return t;r=t}else{if(!(e=this.ys[t-1])return t-1;i=t}throw new Error("unable to find floor index for y=".concat(e))}},{key:"getRowPosition",value:function(e,n){return this.confirmHeight(e,n),{height:this.heights[e],y:this.ys[e]}}},{key:"getEstimatedHeight",value:function(){var e=this.ys[this.lastI]+this.heights[this.lastI];return this.lastI>=this.dataLen-1?0|e:e/(this.lastI+1)*this.heights.length|0}}]),e}(),Mc=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e))._yPositions=void 0,r._knownHeights=void 0,r._startIndexDrawn=void 0,r._endIndexDrawn=void 0,r._startIndex=void 0,r._endIndex=void 0,r._viewHeight=void 0,r._scrollTop=void 0,r._isScrolledOrResized=void 0,r._htmlTopOffset=void 0,r._windowScrollListenerAdded=void 0,r._htmlElm=void 0,r._wrapperElm=void 0,r._itemHolderElm=void 0,r.getViewHeight=function(){return r._viewHeight},r.getBottomVisibleIndex=function(){var e=r._scrollTop+r._viewHeight;return r._yPositions.findFloorIndex(e,r._getHeight)},r.getTopVisibleIndex=function(){return r._yPositions.findFloorIndex(r._scrollTop,r._getHeight)},r.getRowPosition=function(e){return r._yPositions.getRowPosition(e,r._getHeight)},r.scrollToIndex=function(e){var n,t,i=r.props.scrollElement,a=(null===i||void 0===i?void 0:i.getBoundingClientRect().top)||0,o=((null===i||void 0===i?void 0:i.scrollTop)||0)+((null===(n=r._itemHolderElm)||void 0===n?void 0:n.getBoundingClientRect().top)||0)-a,l=r.getRowPosition(e).y;null===(t=r.props.scrollElement)||void 0===t||t.scrollTo({top:l+o-80})},r._onScroll=function(){r._isScrolledOrResized||(r._isScrolledOrResized=!0,window.requestAnimationFrame(r._positionList))},r._positionList=function(){if(r._isScrolledOrResized=!1,r._wrapperElm){r._calcViewIndexes();var e=r.props.viewBufferMin>r._startIndex?0:r._startIndex-r.props.viewBufferMin,n=r.props.viewBufferMinr._endIndexDrawn)&&r.forceUpdate()}},r._initWrapper=function(e){r.props.windowScroller&&(r._wrapperElm=e,e&&(r._viewHeight=e.clientHeight))},r._initItemHolder=function(e){r._itemHolderElm=e,r._scanItemHeights()},r._scanItemHeights=function(){var e=r.props.getIndexFromKey;if(r._itemHolderElm){for(var n=null,t=null,i=!1,a=r._itemHolderElm.childNodes,o=a.length,l=0;lthis._startIndex?0:this._startIndex-c,v=cthis._endIndexDrawn?(e=u>this._startIndex?0:this._startIndex-u,(n=this._endIndex+u)>=r&&(n=r-1)):(e=this._startIndexDrawn,n=this._endIndexDrawn>r-1?r-1:this._endIndexDrawn)}else e=0,n=(o small {\n color: ',";\n }\n text-align: left;\n background: transparent;\n border: none;\n"])),e.textColor,e.textColor)},hp=(0,ze.iv)(Hf||(Hf=(0,r.Z)(["\n &::before {\n bottom: 0;\n }\n"]))),gp=(0,ze.iv)(Pf||(Pf=(0,r.Z)(["\n padding: 0 0.25rem 0 0.5rem;\n 12px;\n"]))),mp=(0,ze.iv)(qf||(qf=(0,r.Z)(["\n font-weight: bold;\n font-style: italic;\n"]))),xp=(0,ze.iv)(Af||(Af=(0,r.Z)(["\n border-radius: 6.5px;\n color: #fff;\n font-size: 0.85em;\n margin-right: 0.25rem;\n padding: 1px;\n"]))),bp=jt.Z.i(Qf||(Qf=(0,r.Z)(["\n border-radius: 6.5px;\n display: inline-block;\n font-size: 0.85em;\n height: 1em;\n margin-right: 0.25rem;\n padding: 1px;\n width: 1em;\n vertical-align: middle;\n"]))),yp=(0,ze.iv)(Wf||(Wf=(0,r.Z)(["\n left: 100%;\n"]))),Zp=(0,ze.iv)(Uf||(Uf=(0,r.Z)(["\n right: 100%;\n"]))),wp=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(){var e;(0,Fa.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a1-O?(i="".concat(L," | ").concat(M),a=Zp):(i="".concat(M," | ").concat(L),a=yp);return(0,Fe.jsxs)(_u,{theme:this.props.theme,className:Vs()(sp,(e={},(0,B.Z)(e,dp(this.props.theme),f),(0,B.Z)(e,fp(this.props.theme),p),(0,B.Z)(e,(this.props.theme,(0,ze.iv)(Ff||(Ff=(0,r.Z)(["\n &:hover ."," {\n background: #ffeccf;\n }\n"])),$f)),p&&f),(0,B.Z)(e,pp(this.props.theme),v),(0,B.Z)(e,up,k),(0,B.Z)(e,cp,C),e),l),children:[(0,Fe.jsx)(_u.Cell,{theme:this.props.theme,className:Vs()(rp,"nameColumn"),width:c,children:(0,Fe.jsxs)("div",{className:Vs()(np,Yf,(n={},(0,B.Z)(n,tp,p),(0,B.Z)(n,"nameWrapperMatchingFilter",p),n)),children:[(0,Fe.jsx)(Jf,{theme:this.props.theme,onClick:I?this._childrenToggle:void 0,childrenVisible:d,span:Z,hoverIndentGuideIds:w,addHoverIndentGuideId:S,removeHoverIndentGuideId:j}),(0,Fe.jsxs)("button",{type:"button",className:Vs()(vp(this.props.theme),(0,B.Z)({},hp,f)),"aria-checked":f,title:L,onClick:this._detailToggle,role:"switch",style:{borderColor:s},tabIndex:0,children:[(0,Fe.jsxs)("span",{className:Vs()(gp,(0,B.Z)({},mp,I&&!d)),children:[x&&(0,Fe.jsx)(Lc.Z,{style:{backgroundColor:Z.errorIconColor?Z.errorIconColor:"#db2828"},className:xp}),N," ",g&&(0,Fe.jsxs)("span",{children:[(0,Fe.jsx)(Vc.Z,{})," ",(0,Fe.jsx)(bp,{style:{background:g.color}}),g.serviceName]}),m&&(0,Fe.jsxs)("span",{children:[(0,Fe.jsx)(Vc.Z,{})," ",(0,Fe.jsx)(bp,{style:{background:m.color}}),m.serviceName]})]}),(0,Fe.jsx)(ip,{children:g?g.operationName:D}),(0,Fe.jsxs)(ip,{children:[" ",this.getSpanBarLabel(Z,u,M)]})]}),T&&function(){var e=T(Z),n=function(e){return e?Object.values(e).reduce((function(e,n){return e+n.length}),0):0}(e);if(e&&1===n){var t,r,i,a,o,l,s=null!==(t=null!==(r=null!==(i=null===(a=e.logLinks)||void 0===a?void 0:a[0])&&void 0!==i?i:null===(o=e.metricLinks)||void 0===o?void 0:o[0])&&void 0!==r?r:null===(l=e.traceLinks)||void 0===l?void 0:l[0])&&void 0!==t?t:void 0;return s?(0,Fe.jsx)("a",{href:s.href,target:"_blank",style:{marginRight:"5px"},rel:"noopener noreferrer",onClick:s.onClick?function(e){e.ctrlKey||e.metaKey||e.shiftKey||!s.onClick||(e.preventDefault(),s.onClick(e))}:void 0,children:s.content}):null}return null}()]})}),(0,Fe.jsxs)(_u.Cell,{theme:this.props.theme,className:Vs()(ap,$f,(t={},(0,B.Z)(t,op(this.props.theme),f),(0,B.Z)(t,lp(this.props.theme),p&&f),t)),"data-testid":"span-view",style:{cursor:"pointer"},width:1-c,onClick:this._detailToggle,children:[(0,Fe.jsx)(Su,{theme:this.props.theme,numTicks:h}),(0,Fe.jsx)(mf,{rpc:g,viewStart:R,viewEnd:O,getViewedBounds:b,color:s,shortLabel:M,longLabel:i,traceStartTime:y,span:Z,labelClassName:"".concat(Kf," ").concat(a),className:Gf})]})]})}}]),t}(f.PureComponent);wp.displayName="UnthemedSpanBarRow",wp.defaultProps={className:"",rpc:null};var Sp,jp,kp,Cp,Tp,_p,Ip,Dp,Np,Mp=wp,Ep=(0,ze.iv)(Sp||(Sp=(0,r.Z)(["\n background: #ddd;\n"]))),Rp=(0,ze.iv)(jp||(jp=(0,r.Z)(["\n display: inline-block;\n width: 1px;\n height: 0.9em;\n margin: 0 8px;\n vertical-align: middle;\n"]))),Op=(0,ze.iv)(kp||(kp=(0,r.Z)(["\n display: block;\n height: 1px;\n width: 100%;\n margin: 24px 0;\n clear: both;\n position: relative;\n top: -0.06em;\n"])));function Lp(e){var n=e.className,t=e.style,r=e.type;return(0,Fe.jsx)("div",{style:t,className:(0,ze.cx)(Ep,"horizontal"===r?Op:Rp,n)})}var Vp=(0,ze.iv)(Cp||(Cp=(0,r.Z)(["\n list-style: none;\n margin: 0;\n padding: 0;\n"]))),zp=(0,ze.iv)(Tp||(Tp=(0,r.Z)(["\n margin-right: -8px;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n"]))),Fp=(0,ze.iv)(_p||(_p=(0,r.Z)(["\n display: inline-block;\n"]))),Bp=function(e){return(0,ze.iv)(Ip||(Ip=(0,r.Z)(["\n border-right: 1px solid ",";\n padding: 0 8px;\n"])),e)},Hp=jt.Z.span(Dp||(Dp=(0,r.Z)(["\n color: ",";\n margin-right: 0.25rem;\n font-size: 12px;\n"])),(function(e){return e.theme.textColor})),Pp=jt.Z.strong(Np||(Np=(0,r.Z)(["\n color: ",";\n margin-right: 0.55rem;\n font-size: 12px;\n"])),(function(e){return e.theme.textColor}));function qp(e){var n=e.className,t=e.divider,r=void 0!==t&&t,i=e.items;return(0,Fe.jsx)("ul",{className:Vs()(Vp,n,r?zp:""),children:i.map((function(n){var t=n.key,i=n.label,a=n.value;return(0,Fe.jsxs)("li",{className:Vs()(Fp,r?Bp(e.theme.buttonBorder):""),children:[(0,Fe.jsx)(Hp,{theme:e.theme,children:i}),(0,Fe.jsx)(Pp,{theme:e.theme,children:a})]},"".concat(t))}))})}var Ap,Qp,Wp,Up,Jp,Gp="label",Kp=t(94795),Yp=t.n(Kp),Xp=t(69099);function $p(e){var n=(0,f.useState)(!1),t=(0,u.Z)(n,2),r=t[0],i=t[1];return(0,Fe.jsx)(D.Z,{title:r?"Copied":e.tooltipTitle,children:(0,Fe.jsx)(Xp.Z,{type:"button",onClick:function(){i(!0)}})})}$p.defaultProps={icon:"copy",className:void 0};var ev="copyIcon",nv=jt.Z.div(Ap||(Ap=(0,r.Z)(["\n background:",";\n border: 1px solid ",";\n margin-bottom: 0.5rem;\n max-height: 450px;\n overflow: auto;\n"])),(function(e){return e.theme.viewBg}),(function(e){return e.theme.buttonBorder})),tv=jt.Z.tbody(Qp||(Qp=(0,r.Z)(["\n vertical-align: baseline;\n"]))),rv=jt.Z.tr(Wp||(Wp=(0,r.Z)(["\ncolor:",";\n & > td {\n padding: 0rem 0.5rem;\n height: 30px;\n line-height: 30px;\n box-sizing: border-box;\n font-size: 12px;\n color:",";\n }\n &:nth-of-type(2n) > td {\n background:",";\n }\n &:not(:hover) ."," {\n visibility: hidden;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.textColor}),(function(e){return e.theme.widgetContainer}),ev),iv=jt.Z.td(Up||(Up=(0,r.Z)(["\n color: "," !important;\n white-space: pre;\n width: 125px;\n"])),(function(e){return e.theme.textColor})),av=jt.Z.td(Jp||(Jp=(0,r.Z)(["\n text-align: right;\n"]))),ov=/^(\[|\{)/;function lv(e){if("string"===typeof e&&ov.test(e))try{return JSON.parse(e)}catch(n){}return e}var sv,uv,cv,dv,fv,pv,vv,hv,gv=function(e){return(0,Fe.jsxs)("a",{href:e.href,title:e.title,target:"_blank",rel:"noopener noreferrer",children:[e.children," ",(0,Fe.jsx)(io.Z,{})]})};function mv(e){var n=e.data,t=e.linksGetter,r=e.theme;return(0,Fe.jsx)(nv,{theme:r,"data-testid":"KeyValueTable",children:(0,Fe.jsx)("table",{className:Ks,children:(0,Fe.jsx)(tv,{children:n.map((function(e,i){var a,o={__html:Yp()(lv(e.value))},l=(0,Fe.jsx)("div",{className:Us,dangerouslySetInnerHTML:o}),s=t?t(n,i):null;return a=s&&s.length?(0,Fe.jsx)("div",{children:(0,Fe.jsx)(gv,{href:s[0].url,title:s[0].text,children:l})}):l,(0,Fe.jsxs)(rv,{theme:r,children:[(0,Fe.jsx)(iv,{theme:r,"data-testid":"KeyValueTable--keyColumn",children:e.key}),(0,Fe.jsx)("td",{children:a}),(0,Fe.jsx)(av,{children:(0,Fe.jsx)($p,{className:ev,copyText:JSON.stringify(e,null,2),tooltipTitle:"Copy JSON"})})]},"".concat(e.key,"-").concat(i))}))})})})}gv.defaultProps={title:""};var xv,bv,yv,Zv,wv=(0,ze.iv)(sv||(sv=(0,r.Z)(["\n cursor: pointer;\n overflow: hidden;\n display: flex;\n align-items: center;\n padding: 0.25em 0.1em;\n font-size: 12px;\n text-overflow: ellipsis;\n white-space: nowrap;\n &:hover {\n // background: #e8e8e8;\n }\n"]))),Sv=(0,ze.iv)(uv||(uv=(0,r.Z)(["\n background: none;\n cursor: initial;\n"]))),jv=(0,ze.iv)(cv||(cv=(0,r.Z)(["\n &:hover {\n // background: #ddd;\n }\n"]))),kv=(0,ze.iv)(dv||(dv=(0,r.Z)(["\n // color: #aaa;\n"]))),Cv=jt.Z.ul(fv||(fv=(0,r.Z)(["\n display: inline;\n list-style: none;\n padding: 0;\n"]))),Tv=jt.Z.li(pv||(pv=(0,r.Z)(["\n display: inline;\n margin-left: 0.7em;\n padding-right: 0.5rem;\n border-right: 1px solid #ddd;\n &:last-child {\n padding-right: 0;\n border-right: none;\n }\n"]))),_v=jt.Z.span(vv||(vv=(0,r.Z)(["\n color: #777;\n"]))),Iv=jt.Z.span(hv||(hv=(0,r.Z)(["\n color: #bbb;\n padding: 0 0.2em;\n"])));function Dv(e){var n=e.data;return Array.isArray(n)&&n.length?(0,Fe.jsx)(Cv,{children:n.map((function(e,n){return(0,Fe.jsxs)(Tv,{children:[(0,Fe.jsx)(_v,{children:e.key}),(0,Fe.jsx)(Iv,{children:"="}),String(e.value)]},"".concat(e.key,"-").concat(n))}))}):null}function Nv(e){var n,t=e.className,r=e.data,i=e.highContrast,a=e.interactive,o=e.isOpen,s=e.label,u=e.linksGetter,c=e.onToggle,d=!Array.isArray(r)||!r.length,f=null,p=null;return a&&(f=o?(0,Fe.jsx)(ga.Z,{fontSize:"small",style:{height:"13px",width:"13px"}}):(0,Fe.jsx)(mt.Z,{fontSize:"small",style:{height:"13px",width:"13px"}}),p={"aria-checked":o,onClick:d?null:c,role:"switch"}),(0,Fe.jsxs)("div",{className:Vs()(t,Gs),children:[(0,Fe.jsxs)("div",(0,l.Z)((0,l.Z)({className:Vs()(wv,(n={},(0,B.Z)(n,Sv,d),(0,B.Z)(n,jv,i&&!d),n))},p),{},{"data-testid":"AccordianKeyValues--header",children:[f,(0,Fe.jsxs)("strong",{"data-test":Gp,children:[s,o||":"]}),!o&&(0,Fe.jsx)(Dv,{data:r})]})),o&&(0,Fe.jsx)(mv,{theme:e.theme,data:r,linksGetter:u})]})}Dv.defaultProps={data:null},Nv.defaultProps={className:null,highContrast:!1,interactive:!0,onToggle:null};var Mv=jt.Z.div(xv||(xv=(0,r.Z)(["\n // border: 1px solid #d8d8d8;\n position: relative;\n margin-bottom: 0.25rem;\n"]))),Ev=jt.Z.small(bv||(bv=(0,r.Z)(["\n// color: #999;\n font-size: 80%;\n"]))),Rv=jt.Z.div(yv||(yv=(0,r.Z)(["\n // background: #f0f0f0;\n // border-top: 1px solid #d8d8d8;\n // padding: 0.5rem 0.5rem 0.25rem 0.5rem;\n"]))),Ov=(0,ze.iv)(Zv||(Zv=(0,r.Z)(["\n display: flex;\n align-items: center;\n // background: #e4e4e4;\n color: inherit;\n \n font-size: 12px;\n padding: 0.25rem 0.5rem;\n &:hover {\n // background: #dadada;\n }\n"])));function Lv(e){var n=e.interactive,t=e.isOpen,r=e.linksGetter,i=e.logs,a=e.openedItems,o=e.onItemToggle,s=e.onToggle,u=e.timestamp,c=null,d="span",p=null;n&&(c=t?(0,Fe.jsx)(ga.Z,{style:{height:"13px",width:"12px"},className:Js}):(0,Fe.jsx)(pi.Z,{style:{height:"13px",width:"12px"},className:Js}),d="a",p={"aria-checked":t,onClick:s,role:"switch"});var v=f.useMemo((function(){return i.map((function(e){var n,t=null===(n=Object.keys(e))||void 0===n?void 0:n.filter((function(e){return"timeUnixNano"!==e}));return{timestamp:parseInt(e.timeUnixNano)/1e3,fields:t.map((function(n){return{key:n,value:e[n]}}))}}))}),[i]);return(0,Fe.jsxs)(Mv,{children:[(0,Fe.jsxs)(d,(0,l.Z)((0,l.Z)({className:Ov},p),{},{children:[c," ",(0,Fe.jsxs)("strong",{children:["Events (",v.length,")"]})]})),t&&(0,Fe.jsxs)(Rv,{children:[(0,De.sortBy)(v,"timestamp").map((function(e,t){return(0,Fe.jsx)(Nv,{className:t0?[{key:"child_count",label:"Child Count:",value:l.childSpanCount}]:[]));return(0,Fe.jsxs)("div",{"data-testid":"span-detail-component",children:[(0,Fe.jsxs)(ah,{children:[(0,Fe.jsx)("h2",{className:Vs()(Ps),children:y}),(0,Fe.jsx)(oh,{children:(0,Fe.jsx)(qp,{theme:e.theme,className:Ws,divider:!0,items:N})})]}),(0,Fe.jsx)(Lp,{className:Hs,type:"horizontal"}),(0,Fe.jsxs)("div",{children:[(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)(Nv,{theme:e.theme,data:T,label:"Attributes",linksGetter:r,isOpen:v,onToggle:function(){return s(k)}}),Z.tags&&(0,Fe.jsx)(Nv,{theme:e.theme,className:Bs,data:Z.tags,label:"Resource",linksGetter:r,isOpen:h,onToggle:function(){return o(k)}})]}),(null===l||void 0===l||null===(n=l.events)||void 0===n?void 0:n.length)>0&&(0,Fe.jsx)(Lv,{linksGetter:r,logs:l.events,isOpen:g.isOpen,openedItems:g.openedItems,onToggle:function(){return a(k)},onItemToggle:function(e){return i(k,e)},timestamp:u}),C&&C.length>0&&(0,Fe.jsx)(Lv,{linksGetter:r,logs:C,isOpen:g.isOpen,openedItems:g.openedItems,onToggle:function(){return a(k)},onItemToggle:function(e){return i(k,e)},timestamp:u}),_&&_.length>0&&(0,Fe.jsx)(ih,{className:uh,headerClassName:ch,label:(0,Fe.jsx)(dh,{children:"Warnings"}),data:_,isOpen:m,onToggle:function(){return c(k)}}),D&&D.length&&(0,Fe.jsx)(ih,{label:"Stack trace",data:D,isOpen:b,TextComponent:function(e){var n,t,r;(null===(n=e.data)||void 0===n?void 0:n.length)>1?t=e.data.map((function(e,n){return"StackTrace ".concat(n+1,":\n").concat(e)})).join("\n"):t=null===(r=e.data)||void 0===r?void 0:r[0];return(0,Fe.jsx)(fh,{style:{cursor:"unset"},readOnly:!0,cols:10,rows:10,value:t})},onToggle:function(){return d(k)}}),I&&I.length>0&&(I.length>1||"CHILD_OF"!==I[0].refType)&&(0,Fe.jsx)(qv,{data:I,isOpen:x.isOpen,openedItems:x.openedItems,onToggle:function(){return f(k)},onItemToggle:function(e){return p(k,e)}}),(0,Fe.jsxs)(lh,{children:[(0,Fe.jsx)(sh,{"data-label":"SpanID:"})," ",k]})]})]})}var vh,hh,gh,mh,xh,bh,yh=function(e){var n;return" (".concat(null===(n=d()(e/1e3))||void 0===n?void 0:n.format("HH:mm:ss.SSS"),")")},Zh=jt.Z.span(vh||(vh=(0,r.Z)(['\n cursor: pointer;\n height: 100%;\n overflow: hidden;\n position: absolute;\n width: 100%;\n &::before {\n border-left: 4px solid;\n pointer-events: none;\n width: 1000px;\n }\n &::after {\n border-right: 1000px solid;\n border-color: inherit;\n cursor: pointer;\n opacity: 0.2;\n }\n\n /* border-color inherit must come AFTER other border declarations for accent */\n &::before,\n &::after {\n border-color: inherit;\n content: " ";\n position: absolute;\n height: 100%;\n }\n\n &:hover::after {\n opacity: 0.35;\n }\n']))),wh=jt.Z.div(hh||(hh=(0,r.Z)(["\n border: 1px solid ",";\n border-top: 3px solid;\n padding: 0.75rem;\n"])),(function(e){return e.theme.buttonBorder})),Sh=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(){var e;(0,Fa.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a=r?u=!0:r=null),u||(n.has(l)&&(r=s+1),i.push({span:o,isDetail:!1,spanIndex:a}),t.has(l)&&i.push({span:o,isDetail:!0,spanIndex:a}))}return i}(e.spans,n,t):[]})),Mh=(0,qa.Z)((function(e){var n=e.min,t=e.max,r=e.viewStart,i=e.viewEnd,a=t-n,o=n+r*a,l=t-(1-i)*a-o;return function(e,n){return{start:(e-o)/l,end:(n-o)/l}}}),De.isEqual),Eh=(0,qa.Z)((function(e){var n=(0,u.Z)(e,2);return{left:n[0]>0,right:n[1]<1}}),De.isEqual),Rh=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e)).listView=void 0,r.topTraceViewRef=(0,f.createRef)(),r.getViewRange=function(){return r.props.currentViewRangeTime},r.getSearchedSpanIDs=function(){return r.props.findMatchesIDs},r.getCollapsedChildren=function(){return r.props.childrenHiddenIDs},r.mapRowIndexToSpanIndex=function(e){return r.getRowStates()[e].spanIndex},r.mapSpanIndexToRowIndex=function(e){for(var n=r.getRowStates().length,t=0;t=0)null===(n=r.listView)||void 0===n||n.scrollToIndex(t)}},r.scrollToTop=function(){var e,n=r.props.topOfViewRef;null===n||void 0===n||null===(e=n.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},(0,e.setTrace)(e.trace,e.uiFind),r}return(0,Ba.Z)(t,[{key:"componentDidMount",value:function(){this.scrollToSpan(this.props.focusedSpanId)}},{key:"shouldComponentUpdate",value:function(e){for(var n=Object.keys(e),t=0;tt;r++)if(vu(e[r]))return!0;return!1}(h.spans,n),D=null;if(k){var N=function(e){if(e.length<=1||!cu(e[0]))return!1;for(var n=e[0].depth+1,t=1;t-1};if(null==e)return function(){return!0};throw new Error("Invalid value: ".concat(e))}var ag=function(e){return e};function og(e,n){if(n)return n.find((function(n){return n.key===e}))}function lg(e,n){return e.template(n)}function sg(e,n,t,r){var i=t[r],a="logs",l=n.process.tags===t;l&&(a="process"),n.tags===t&&(a="tags");var s=[];return e.forEach((function(e){if(e.type(a)&&e.key(i.key)&&e.value(i.value)){var r={},u=e.parameters.every((function(s){var u=og(s,t);return u||l||(u=function(e,n){for(var t=n;t;){var r=og(e,t.tags)||og(e,t.process.tags);if(r)return r;t=$h(t)}}(s,n)),u?(r[s]=u.value,!0):(console.warn(o().sanitize("Skipping link pattern, missing parameter ".concat(s," for key ").concat(i.key," in ").concat(a,".")),e.object),!1)}));u&&s.push({url:lg(e.url,r),text:lg(e.text,r)})}})),s}var ug,cg,dg,fg=(ug="linkPatterns",(0,De.get)(Xh,ug)||[]).map((function(e){try{var n=rg(e.url,encodeURIComponent),t=rg(e.text,ag);return{object:e,type:ig(e.type),key:ig(e.key),value:ig(e.value),url:n,text:t,parameters:(0,De.uniq)(n.parameters.concat(t.parameters))}}catch(r){return console.error("Ignoring invalid link pattern: ".concat(r),e),null}})).filter(Boolean),pg=(0,Kh.Z)(10)((function(e){return e?function(e,n){var t=[],r=Object.keys(n).filter((function(e){return"string"===typeof n[e]||"number"===n[e]}));return e.filter((function(e){return e.type("traces")})).forEach((function(e){var i={};e.parameters.every((function(e){var t=e;return!!r.includes(t)&&(i[e]=n[t],!0)}))&&t.push({url:lg(e.url,i),text:lg(e.text,i)})})),t}(fg,e):[]}));cg=fg,dg=new WeakMap;var vg,hg=(0,De.memoize)((function(e){for(var n,t=new Set(e.map((function(e){return e.spanID}))),r=function(r){if(e[r].references&&e[r].references.some((function(n){var i=n.traceID,a=n.spanID;return i===e[r].traceID&&t.has(a)})))return"continue";if(!n)return n=e[r],"continue";var i=e[r].references&&e[r].references.length||0,a=n.references&&n.references.length||0;(i .scrubber-handle-expansion {\n fill-opacity: 1;\n }\n &:hover > .scrubber-handle {\n fill: #44f;\n }\n &:hover + .scrubber.line {\n stroke: #44f;\n }\n"]))),Bg=Vs()((0,ze.iv)(Mg||(Mg=(0,r.Z)(["\n cursor: col-resize;\n fill: #555;\n "]))),"scrubber-handle"),Hg=(0,ze.iv)(Eg||(Eg=(0,r.Z)(["\n & .scrubber-handle-expansion {\n fill-opacity: 1;\n }\n & .scrubber-handle {\n fill: #44f;\n }\n & > .scrubber-line {\n stroke: #44f;\n }\n"]))),Pg=Vs()((0,ze.iv)(Rg||(Rg=(0,r.Z)(["\n cursor: col-resize;\n fill-opacity: 0;\n fill: #44f;\n "]))),"scrubber-handle-expansion"),qg=Vs()((0,ze.iv)(Og||(Og=(0,r.Z)(["\n pointer-events: none;\n stroke: #555;\n "]))),"scrubber-line");function Ag(e){var n=e.isDragging,t=e.onMouseDown,r=e.onMouseEnter,i=e.onMouseLeave,a=e.position,o="".concat(100*a,"%"),l=Vs()((0,B.Z)({},Hg,n));return(0,Fe.jsxs)("g",{className:l,"data-testid":"scrubber-component",children:[(0,Fe.jsxs)(Fg,{"data-testid":"scrubber-component-g",onMouseDown:t,onMouseEnter:r,onMouseLeave:i,children:[(0,Fe.jsx)("rect",{"data-testid":"scrubber-component-rect-1",x:o,className:Pg,style:{transform:"translate(-4.5px)"},width:"9",height:"20"}),(0,Fe.jsx)("rect",{"data-testid":"scrubber-component-rect-2",x:o,className:Bg,style:{transform:"translate(-1.5px)"},width:"3",height:"20"})]}),(0,Fe.jsx)("line",{className:qg,y2:"100%",x1:o,x2:o,"data-testid":"scrubber-component-line"})]})}var Qg,Wg,Ug,Jg,Gg,Kg,Yg,Xg,$g=t(1568),em="JaegerUiComponents__ViewingLayerResetZoomHoverClassName",nm=(0,Lg.iv)(Qg||(Qg=(0,r.Z)(["\n display: none;\n position: absolute;\n right: 1%;\n top: 10%;\n z-index: 1;\n background-color: hsla(210, 12%, 16%, 16%);\n color: hsl(210, 12%, 16%);\n &:hover {\n background-color: hsla(210, 12%, 16%, 20%);\n color: hsl(210, 12%, 16%);\n \n }\n"]))),tm=jt.Z.div(Wg||(Wg=(0,r.Z)(["\n cursor: vertical-text;\n position: relative;\n z-index: 1;\n &:hover > ."," {\n display: unset;\n }\n"])),em),rm=jt.Z.svg(Ug||(Ug=(0,r.Z)(["\n border: 1px solid ",";\n /* need !important here to overcome something from semantic UI */\n overflow: visible !important;\n position: relative;\n transform-origin: 0 0;\n width: 100%;\n"])),(function(e){return e.theme.buttonBorder})),im=jt.Z.div(Jg||(Jg=(0,r.Z)(["\n bottom: 0;\n cursor: col-resize;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n user-select: none;\n"]))),am=jt.Z.rect(Gg||(Gg=(0,r.Z)(["\n fill: rgba(214, 214, 214, 0.5);\n"]))),om=jt.Z.line(Kg||(Kg=(0,r.Z)(["\n stroke: #f44;\n stroke-width: 1;\n"]))),lm=jt.Z.rect(Yg||(Yg=(0,r.Z)(["\n fill: #44f;\n"]))),sm=jt.Z.rect(Xg||(Xg=(0,r.Z)(["\n fill-opacity: 0.2;\n fill: #44f;\n"]))),um={SHIFT_END:"SHIFT_END",SHIFT_START:"SHIFT_START",REFRAME:"REFRAME"};var cm=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e)).state=void 0,r._root=void 0,r._draggerReframe=void 0,r._draggerStart=void 0,r._draggerEnd=void 0,r._setRoot=function(e){r._root=e},r._getDraggingBounds=function(e){if(!r._root)throw new Error("invalid state");var n=r._root.getBoundingClientRect(),t=n.left,i=n.width,a=(0,u.Z)(r.props.viewRange.time.current,2),o=a[0],l=a[1],s=1,c=0;return e===um.SHIFT_START?s=l:e===um.SHIFT_END&&(c=o),{clientXLeft:t,maxValue:s,minValue:c,width:i}},r._handleReframeMouseMove=function(e){var n=e.value;r.props.updateNextViewRangeTime({cursor:n})},r._handleReframeMouseLeave=function(){r.props.updateNextViewRangeTime({cursor:null})},r._handleReframeDragUpdate=function(e){var n=e.value,t=r.props.viewRange.time,i={reframe:{anchor:t.reframe?t.reframe.anchor:n,shift:n}};r.props.updateNextViewRangeTime(i)},r._handleReframeDragEnd=function(e){var n=e.manager,t=e.value,i=r.props.viewRange.time,a=i.reframe?i.reframe.anchor:t,o=t0&&(0,$g.tZ)(am,{x:0,y:0,height:"100%",width:"".concat(g,"%")}),x>0&&(0,$g.tZ)(am,{x:"".concat(100-x,"%"),y:0,height:"100%",width:"".concat(x,"%")}),(0,$g.tZ)(zg,{numTicks:r}),m&&(0,$g.tZ)(om,{x1:m,y1:"0",x2:m,y2:n-2,strokeWidth:"1"}),null!=s&&this._getMarkers(v,s),null!=c&&this._getMarkers(h,c),(0,$g.tZ)(Ag,{isDragging:null!=s,onMouseDown:this._draggerStart.handleMouseDown,onMouseEnter:this._draggerStart.handleMouseEnter,onMouseLeave:this._draggerStart.handleMouseLeave,position:v||0}),(0,$g.tZ)(Ag,{isDragging:null!=c,position:h||1,onMouseDown:this._draggerEnd.handleMouseDown,onMouseEnter:this._draggerEnd.handleMouseEnter,onMouseLeave:this._draggerEnd.handleMouseLeave}),null!=d&&this._getMarkers(d.anchor,d.shift)]}),f&&(0,$g.tZ)(im,{})]})}}]),t}(f.PureComponent);function dm(e){return{valueOffset:e.relativeStartTime,valueWidth:e.duration,serviceName:e.process.serviceName}}var fm=(0,qa.Z)((function(e){return e.spans.map(dm)})),pm=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(){return(0,Fa.Z)(this,t),n.apply(this,arguments)}return(0,Ba.Z)(t,[{key:"render",value:function(){var e=this.props,n=e.height,t=e.trace,r=e.viewRange,i=e.updateNextViewRangeTime,a=e.updateViewRangeTime;if(!t)return(0,Fe.jsx)("div",{});var o=fm(t);return(0,Fe.jsxs)("div",{className:Vs()(As,qs),children:[(0,Fe.jsx)(Ig,{theme:this.props.theme,numTicks:4,duration:t.duration}),(0,Fe.jsxs)("div",{className:zs,children:[(0,Fe.jsx)(Cg,(0,l.Z)((0,l.Z)({},this.props),{},{valueWidth:t.duration,items:o})),(0,Fe.jsx)(cm,{theme:this.props.theme,viewRange:r,numTicks:4,height:n||60,updateViewRangeTime:a,updateNextViewRangeTime:i})]})]})}}]),t}(f.PureComponent);pm.defaultProps={height:60};var vm,hm,gm,mm,xm,bm,ym,Zm,wm,Sm,jm=["renderer"],km=jt.Z.header(vm||(vm=(0,r.Z)(["\n & > :first-of-type {\n border-bottom: 1px solid ",";\n }\n & > :nth-of-type(2) {\n background-color: ",";\n border-bottom: 1px solid ",";\n }\n & > :last-child {\n border-bottom: 1px solid ",";\n }\n"])),(function(e){var n=e.theme;return null===n||void 0===n?void 0:n.buttonBorder}),(function(e){var n;return null===e||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.widgetContainer}),(function(e){var n;return null===e||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.buttonBorder}),(function(e){var n;return null===e||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.widgetContainer})),Cm=jt.Z.div(hm||(hm=(0,r.Z)(["\n align-items: center;\n display: flex;\n"]))),Tm=(0,ze.iv)(gm||(gm=(0,r.Z)(["\n align-items: center;\n align-self: stretch;\n background: inherit;\n background-color: #fafafa;\n border-bottom: 1px solid #ddd;\n border-right: 1px solid #ddd;\n color: inherit;\n display: flex;\n font-size: 1.4rem;\n padding: 0 1rem;\n margin-bottom: -1px;\n &:hover {\n background-color: #f0f0f0;\n border-color: #ccc;\n }\n"]))),_m=(0,ze.iv)(mm||(mm=(0,r.Z)(["\n align-items: center;\n display: flex;\n flex: 1;\n\n &:hover * {\n text-decoration: underline;\n }\n &:hover > *,\n &:hover small {\n text-decoration: none;\n }\n /* Adapt styles when changing from a element into button */\n background: transparent;\n text-align: left;\n border: none;\n"]))),Im=(0,ze.iv)(xm||(xm=(0,r.Z)(["\n font-size: 2.5rem;\n transition: transform 0.07s ease-out;\n"]))),Dm=(0,ze.iv)(bm||(bm=(0,r.Z)(["\n transform: rotate(90deg);\n"]))),Nm=function(e){return(0,ze.iv)(ym||(ym=(0,r.Z)(["\n color: ",";\n flex: 1;\n font-size: 14px;\n font-weight: bold;\n line-height: 1em;\n margin: 0 0 0 0.5em;\n padding:10px 0px;\n"])),e)},Mm=(0,ze.iv)(Zm||(Zm=(0,r.Z)(["\n margin-left: 0;\n"]))),Em=(0,ze.iv)(wm||(wm=(0,r.Z)(["\n border-bottom: 1px solid #e4e4e4;\n padding: 0.25rem 0.5rem !important;\n"]))),Rm=jt.Z.small(Sm||(Sm=(0,r.Z)(["\n white-space: nowrap;\n font-size: 80%;\n"]))),Om=[{key:"timestamp",label:"Trace Start:",renderer:function(e){return d()((null===e||void 0===e?void 0:e.startTime)/1e3).format("YYYY-MM-DDTHH:mm:ss.SSSZ")}},{key:"duration",label:"Duration:",renderer:function(e){return su(e.duration)}},{key:"service-count",label:"Services:",renderer:function(e){return new Set((0,De.values)(e.services).map((function(e){return e.name}))).size}},{key:"depth",label:"Depth:",renderer:function(e){return(0,De.get)((0,De.maxBy)(e.spans,"depth"),"depth",0)+1}},{key:"span-count",label:"Total Spans:",renderer:function(e){var n;return null===e||void 0===e||null===(n=e.spans)||void 0===n?void 0:n.length}}];function Lm(e){var n,t,r=e.canCollapse,i=e.hideMap,a=e.hideSummary,o=e.onSlimViewClicked,s=e.slimView,u=e.trace,c=e.updateNextViewRangeTime,d=e.updateViewRangeTime,p=e.viewRange,v=(0,I.u)(),h=f.useMemo((function(){return u?pg(u):[]}),[u]);if(!u)return null;var g=!a&&!s&&Om.map((function(e){var n=e.renderer,t=(0,Vo.Z)(e,jm);return(0,l.Z)((0,l.Z)({},t),{},{value:n(u)})})),m=(0,Fe.jsxs)("h1",{style:{color:null===e||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.textColor},className:Vs()(Nm(null===e||void 0===e||null===(t=e.theme)||void 0===t?void 0:t.textColor),r&&Mm),children:[(0,Fe.jsx)(Gh,{traceName:hg(u.spans)})," ",(0,Fe.jsx)(Rm,{className:Ys,children:u.traceID})]});return(0,Fe.jsxs)(km,{theme:e.theme,children:[(0,Fe.jsxs)(Cm,{children:[h&&h.length>0&&(0,Fe.jsx)(qh,{links:h,className:Tm}),r?(0,Fe.jsxs)("button",{type:"button",className:_m,onClick:o,role:"switch","aria-checked":!s,children:[(0,Fe.jsx)(mt.Z,{className:Vs()(Im,!s&&Dm)}),m]}):m]}),g&&(0,Fe.jsx)(qp,{theme:e.theme,className:Em,items:g}),!i&&!s&&(0,Fe.jsx)(pm,(0,l.Z)((0,l.Z)({},e),{},{theme:v,trace:u,viewRange:p,updateNextViewRangeTime:c,updateViewRangeTime:d}))]})}var Vm=function(){function e(n){(0,Fa.Z)(this,e),this.isTagsOpen=void 0,this.isEventsOpen=void 0,this.isProcessOpen=void 0,this.logs=void 0,this.events=void 0,this.references=void 0,this.isWarningsOpen=void 0,this.isStackTracesOpen=void 0,this.isReferencesOpen=void 0;var t=n||{},r=t.isTagsOpen,i=t.isEventsOpen,a=t.isProcessOpen,o=t.isReferencesOpen,l=t.isWarningsOpen,s=t.isStackTracesOpen,u=t.logs,c=t.references,d=t.events;this.isTagsOpen=Boolean(r),this.isEventsOpen=Boolean(i),this.isProcessOpen=Boolean(a),this.isReferencesOpen=Boolean(o),this.isWarningsOpen=Boolean(l),this.isStackTracesOpen=Boolean(s),this.logs={isOpen:Boolean(u&&u.isOpen),openedItems:u&&u.openedItems?new Set(u.openedItems):new Set},this.events={isOpen:Boolean(d&&d.isOpen),openedItems:d&&d.openedItems?new Set(d.openedItems):new Set},this.references={isOpen:Boolean(c&&c.isOpen),openedItems:c&&c.openedItems?new Set(c.openedItems):new Set}}return(0,Ba.Z)(e,[{key:"toggleTags",value:function(){var n=new e(this);return n.isTagsOpen=!this.isTagsOpen,n}},{key:"toggleEvents",value:function(){var n=new e(this);return n.isEventsOpen=!this.isEventsOpen,n}},{key:"toggleEventItem",value:function(n){var t=new e(this);return t.events.openedItems.has(n)?t.events.openedItems.delete(n):t.events.openedItems.add(n),t}},{key:"toggleProcess",value:function(){var n=new e(this);return n.isProcessOpen=!this.isProcessOpen,n}},{key:"toggleReferences",value:function(){var n=new e(this);return n.references.isOpen=!this.references.isOpen,n}},{key:"toggleReferenceItem",value:function(n){var t=new e(this);return t.references.openedItems.has(n)?t.references.openedItems.delete(n):t.references.openedItems.add(n),t}},{key:"toggleWarnings",value:function(){var n=new e(this);return n.isWarningsOpen=!this.isWarningsOpen,n}},{key:"toggleStackTraces",value:function(){var n=new e(this);return n.isStackTracesOpen=!this.isStackTracesOpen,n}},{key:"toggleLogs",value:function(){var n=new e(this);return n.logs.isOpen=!this.logs.isOpen,n}},{key:"toggleLogItem",value:function(n){var t=new e(this);return t.logs.openedItems.has(n)?t.logs.openedItems.delete(n):t.logs.openedItems.add(n),t}}]),e}(),zm=t(35323),Fm=function(){function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];(0,Fa.Z)(this,e),this.value=void 0,this.children=void 0,this.value=n,this.children=t}return(0,Ba.Z)(e,[{key:"depth",get:function(){return this.children.reduce((function(e,n){return Math.max(n.depth+1,e)}),1)}},{key:"size",get:function(){var e=0;return this.walk((function(){return e++})),e}},{key:"addChild",value:function(n){return this.children.push(n instanceof e?n:new e(n)),this}},{key:"find",value:function(n){if(e.iterFunction(e.searchFunction(n))(this))return this;for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0;for(n.push({node:this,depth:t});n.length;){var r=n.pop(),i=r.node,a=r.depth;e(i.value,i,a),t=a+1;for(var o=i.children.length-1;o>=0;)n.push({node:i.children[o],depth:t}),o--}}}],[{key:"iterFunction",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(t){return e(t.value,t,n)}}},{key:"searchFunction",value:function(n){return"function"===typeof n?n:function(t,r){return n instanceof e?r===n:t===n}}}]),e}();var Bm=function(e){return e.serviceName},Hm=t(31507),Pm=t.n(Hm),qm=function(e){return e.spanID},Am=function(e){return e.operationName},Qm=function(e){return e.duration},Wm=function(e){return e.startTime},Um=function(e){return e.processID},Jm=(0,zm.P1)((0,zm.P1)((function(e){return e.span}),(function(e){return e.references||[]})),(function(e){return e.type}),(function(e,n){return e.find((function(e){return e.refType===n}))})),Gm=((0,zm.P1)((function(e){return Jm({span:e,type:"CHILD_OF"})}),(function(e){return e?e.spanID:null})),(0,zm.P1)((function(e){if(!e.process)throw new Error("\n you must hydrate the spans with the processes, perhaps\n using hydrateSpansWithProcesses(), before accessing a span's process\n ");return e.process}),Bm)),Km=((0,zm.P1)((function(e){return e.spans}),(function(e){return e.leftBound}),(function(e){return e.rightBound}),(function(e,n,t){return e.filter((function(e){return Wm(e)>=n&&Wm(e)<=t}))})),(0,zm.P1)((function(e){return e.spans}),(function(e){return e.text}),(function(e,n){return Pm().filter(n,e,{extract:function(e){return"".concat(Gm(e)," ").concat(Am(e))}}).map((function(e){return e.original}))}))),Ym=(0,zm.P1)(Km,(function(e){return e.reduce((function(e,n){return(0,l.Z)((0,l.Z)({},e),{},(0,B.Z)({},qm(n),n))}),{})})),Xm=((0,zm.P1)((function(e){return e.spans}),Ym,(function(e,n){return e.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{muted:!n[qm(e)]})}))})),function(e){return e.spans}),$m=function(e){return e.processes},ex=(0,zm.P1)((function(e){return e.span}),(function(e){return e.processes}),(function(e,n){return(0,l.Z)((0,l.Z)({},e),{},{process:n[Um(e)]})})),nx=(0,zm.P1)(Xm,(function(e){return e.reduce((function(e,n){return e.set(qm(n),n)}),new Map)})),tx="__root__";function rx(e){var n=new Map(e.spans.map((function(e){return[e.spanID,new Fm(e.spanID)]}))),t=new Map(e.spans.map((function(e){return[e.spanID,e]}))),r=new Fm(tx);e.spans.forEach((function(e){var t=n.get(e.spanID);if(Array.isArray(e.references)&&e.references.length){var i=e.references[0],a=i.refType,o=i.spanID;if("CHILD_OF"!==a&&"FOLLOWS_FROM"!==a)throw new Error("Unrecognized ref type: ".concat(a));(n.get(o)||r).children.push(t)}else r.children.push(t)}));var i=function(e,n){var r=t.get(e.value),i=t.get(n.value);return+(r.startTime>i.startTime)||+(r.startTime===i.startTime)-1};return e.spans.forEach((function(e){var t=n.get(e.spanID);t.children.length>1&&t.children.sort(i)})),r.children.sort(i),r}(0,zm.P1)(Xm,(function(e){return e.length}));var ix=(0,zm.P1)(Xm,(function(e){return e.reduce((function(e,n){return e?Math.min(e,Wm(n)):Wm(n)}),null)})),ax=(0,zm.P1)(Xm,ix,(function(e,n){return e.reduce((function(e,t){return e?Math.max(Wm(t)-n+Qm(t),e):Qm(t)}),null)})),ox=((0,zm.P1)(ix,ax,(function(e,n){return e+n})),(0,zm.P1)(rx,nx,(function(e,n){return e.children.map((function(e){return n.get(e.value)})).sort((function(e,n){return t=Wm(e),r=Wm(n),t-r;var t,r}))[0]}))),lx=((0,zm.P1)(rx,(function(e){return e.depth-1})),(0,zm.P1)((0,zm.P1)((function(e){return e.trace}),rx),(0,zm.P1)((function(e){return e.span}),qm),(function(e,n){return e.getPath(n).length-1})),(0,zm.P1)($m,(function(e){return Object.keys(e).reduce((function(n,t){return n.add(Bm(e[t]))}),new Set)}))),sx=((0,zm.P1)(lx,(function(e){return e.size})),{ms:function(e){var n=lu(e,au,eu);return"".concat($s().duration(n/eu).asMilliseconds(),"ms")},s:function(e){var n=lu(e,au,nu);return"".concat($s().duration(n/eu).asSeconds(),"s")}}),ux=(0,zm.P1)(ax,(function(e){return e>=nu?sx.s:sx.ms})),cx=((0,zm.P1)((function(e){return e.duration}),(function(e){var n=e.unit;return sx[n]}),(function(e,n){return n(e)})),(0,zm.P1)((function(e){return e.duration}),(0,zm.P1)((function(e){return e.trace}),ux),(function(e,n){return n(e)})),(0,zm.P1)((function(e){return e.trace}),(function(e){return e.spans}),(function(e){return e.sort}),(function(e,n,t){var r=t.dir,i=t.comparator,a=t.selector;return(0,H.Z)(n).sort((function(n,t){return r*i(a(n,e),a(t,e))}))})),(0,zm.P1)(rx,(function(e){var n=new Map,t=0;return e.walk((function(e){return n.set(e,t++)})),n})));(0,zm.P1)((0,zm.P1)((function(e){return e.trace}),rx),(0,zm.P1)((function(e){return e.span}),qm),(function(e,n){var t=e.find(n);return t?t.size-1:-1})),(0,zm.P1)((0,zm.P1)((function(e){return e.trace}),cx),(function(e){return e.span}),(function(e,n){return e.get(qm(n))})),(0,zm.P1)((0,zm.P1)((0,zm.P1)((function(e){var n=Xm(e),t=$m(e);return(0,l.Z)((0,l.Z)({},e),{},{spans:n.map((function(e){return ex({span:e,processes:t})}))})}),ox),(0,zm.zB)({name:Am,serviceName:Gm})),(function(e){var n=e.name,t=e.serviceName;return"".concat(t,": ").concat(n)})),(0,zm.P1)((function(e){return e.spans}),(0,zm.P1)((function(e){return e.trace}),rx),(function(e){return e.collapsed}),(function(e,n,t){var r=t.reduce((function(e,t){return n.find(t).walk((function(n){return n!==t&&e.add(n)})),e}),new Set);return r.size>0?e.filter((function(e){return!r.has(qm(e))})):e})),(0,zm.P1)((function(e){return e.trace}),(function(e){var n=e.interval;return void 0===n?4:n}),(function(e){var n=e.width;return void 0===n?3:n}),(function(e,n,t){return(0,H.Z)((n+1).keys()).map((function(r){return{timestamp:ix(e)+ax(e)*(r/n),width:t}}))})),(0,zm.P1)((function(e){return e}),Xm,(function(e,n){var t=new Map;return(0,l.Z)((0,l.Z)({},e),{},{spans:n.reduce((function(e,n){var r=t.has(qm(n))?"".concat(qm(n),"_").concat(t.get(qm(n))):qm(n),i=(0,l.Z)((0,l.Z)({},n),{},{spanID:r});return r!==qm(n)&&console.warn("duplicate spanID in trace replaced",qm(n),"new:",r),t.set(qm(n),(t.get(qm(n))||0)+1),e.concat([i])}),[])})})),(0,zm.P1)((function(e){return e}),Xm,(function(e,n){return(0,l.Z)((0,l.Z)({},e),{},{spans:n.filter((function(e){return!!Wm(e)}))})}));function dx(e,n,t){return function(r){var i=n.get(r);if(i){var a;a="tags"===e?i.toggleTags():"process"===e?i.toggleProcess():"events"===e?i.toggleEvents():"warnings"===e?i.toggleWarnings():"references"===e?i.toggleReferences():"stackTraces"===e?i.toggleStackTraces():i.toggleLogs();var o=new Map(n);o.set(r,a),t(o)}}}function fx(e,n){return e.filter((function(e){return e.hasChildren})).length===n.size}var px;function vx(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.forEach((function(t){var r;t.depth=n,(null===(r=t.children)||void 0===r?void 0:r.length)>0&&(n+=1,t.children.forEach((function(r){t.spanID===r&&vx(e,n)})))}))}function hx(e){var n,t=function(e){var n;return(null===(n=e.resourceSpans)||void 0===n?void 0:n.map((function(e){var n=e.resource;return e.instrumentationLibrarySpans.map((function(e){return e.spans.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{resource:n})}))}))}))).flat(2)}(e);return null===e||void 0===e||null===(n=e.resourceSpans)||void 0===n?void 0:n.map((function(e){var n,r,i,a,o,s=e.instrumentationLibrarySpans,u=t.find((function(e){return-1===Object.keys(e).indexOf("parentSpanId")})),c=(0,H.Z)(t),d=null===c||void 0===c?void 0:c.sort((function(e,n){return parseInt(e.startTimeUnixNano)-parseInt(n.startTimeUnixNano)})),f=(null===(n=d[0])||void 0===n?void 0:n.startTimeUnixNano)/1e3,p=(null===(r=d.map((function(e){return e.endTimeUnixNano})))||void 0===r||null===(i=r.sort())||void 0===i?void 0:i.reverse())[0]/1e3,v=null===t||void 0===t?void 0:t.map((function(e,n){var t,r,i,a=null===(t=e.attributes)||void 0===t?void 0:t.map((function(e){var n;return{key:null===e||void 0===e?void 0:e.key,value:null===e||void 0===e||null===(n=e.value)||void 0===n?void 0:n.stringValue}})),o=null===e||void 0===e||null===(r=e.resource)||void 0===r||null===(i=r.attributes)||void 0===i?void 0:i.map((function(e){var n;return{key:null===e||void 0===e?void 0:e.key,value:null===e||void 0===e||null===(n=e.value)||void 0===n?void 0:n.stringValue}})),l=Math.round((null===e||void 0===e?void 0:e.endTimeUnixNano)/1e3)-Math.round((null===e||void 0===e?void 0:e.startTimeUnixNano)/1e3),s=(null===e||void 0===e?void 0:e.startTimeUnixNano)/1e3,u={serviceName:null===e||void 0===e?void 0:e.serviceName,tags:o};return{traceID:(null===e||void 0===e?void 0:e.traceID)||(null===e||void 0===e?void 0:e.traceId),spanID:(null===e||void 0===e?void 0:e.spanID)||e.spanId,parentSpanID:(null===e||void 0===e?void 0:e.parentSpanID)||(null===e||void 0===e?void 0:e.parentSpanId)||"",operationName:null===e||void 0===e?void 0:e.name,serviceName:null===e||void 0===e?void 0:e.serviceName,serviceTags:o,startTime:s,duration:l,relativeStartTime:0,events:(null===e||void 0===e?void 0:e.events)||[],logs:[],references:[],tags:a,processID:null===e||void 0===e?void 0:e.spanID,flags:0,dataFrameRowIndex:n,process:u,children:[]}}));if((null===(a=v)||void 0===a?void 0:a.length)>0)try{v.forEach((function(e){var n,t=null===(n=v)||void 0===n?void 0:n.some((function(n){return(null===n||void 0===n?void 0:n.spanID)===(null===e||void 0===e?void 0:e.parentSpanID)}));if(""!==(null===e||void 0===e?void 0:e.parentSpanID)&&t){var r,i,a,o,s=null===(r=v)||void 0===r?void 0:r.find((function(n){return n.spanID===e.parentSpanID}));s&&(v=null===(i=v)||void 0===i||null===(a=i.map((function(n){return n.spanID===s.spanID?(0,l.Z)((0,l.Z)({},n),{},{children:[].concat((0,H.Z)(n.children),[e.spanID])}):n})))||void 0===a?void 0:a.map((function(e){var n;return(null===e||void 0===e||null===(n=e.children)||void 0===n?void 0:n.length)>0?(0,l.Z)((0,l.Z)({},e),{},{hasChildren:!0,childSpanCount:e.children.length,relativeStartTime:e.startTime-v[0].startTime}):(0,l.Z)((0,l.Z)({},e),{},{relativeStartTime:e.startTime-v[0].startTime})}))),null===e||void 0===e||null===(o=e.references)||void 0===o||o.push({refType:"CHILD_OF",spanID:s.spanID,traceID:s.traceID,span:(0,l.Z)({},s)})}}))}catch(y){console.log(y)}vx(v);var h={services:[],spans:[],traceID:"",traceName:"",processes:{},duration:0,startTime:0,endTime:0},g=null===(o=v)||void 0===o?void 0:o[0];if(s&&p&&f){var m=g.serviceName,x=g.name,b=g.traceID;h={services:v.map((function(e){return{name:e.serviceName,numberOfSpans:v.length}})),spans:v,traceID:u?null===u||void 0===u?void 0:u.traceID:b,traceName:u?"".concat(null===u||void 0===u?void 0:u.serviceName,": ").concat(null===u||void 0===u?void 0:u.name):"".concat(m,": ").concat(x),processes:{},duration:p-f,startTime:f,endTime:p}}return h}))}var gx,mx,xx,bx,yx,Zx,wx,Sx=jt.Z.div(px||(px=(0,r.Z)(["\n margin: 4px;\n padding: 5px;\n margin-top:0px;\n border: 1px solid ",";\n border-radius: 3px;\n display:flex;\n flex-direction:column;\n flex:",";\n \n height: ",";\n .view-content {\n margin:3px;\n height: ",";\n display: ",";\n flex-direction: ",";\n flex:1;\n }\n"])),(function(e){var n;return null===(n=e.theme)||void 0===n?void 0:n.buttonBorder}),(function(e){return"min"===e.size?0:1}),(function(e){var n,t;return"regular"===e.size?null===e||void 0===e||null===(n=e.vheight)||void 0===n?void 0:n.regularCont:"max"===(null===e||void 0===e?void 0:e.size)?null===e||void 0===e||null===(t=e.vheight)||void 0===t?void 0:t.maxCont:"20px"}),(function(e){var n,t;return"regular"===e.size?null===e||void 0===e||null===(n=e.vheight)||void 0===n?void 0:n.regularView:"max"===(null===e||void 0===e?void 0:e.size)?null===e||void 0===e||null===(t=e.vheight)||void 0===t?void 0:t.maxView:"0px"}),(function(e){return"min"===e.size?"none":(null===e||void 0===e||e.size,"flex")}),(function(e){return null===e||void 0===e||e.size,"column"}));function jx(){return{}}function kx(e){var n=e.viewRef,t=e.panelSize,r=e.viewHeight,i=e.setStreamClose,a=e.setMaxHeight,o=e.setMinimize,s=e.actualQuery,c=e.total,d=e.type,p=e.dataView.data,v=(0,f.useMemo)((function(){return hx(p)[0]}),[p]),h=(0,hi.F)(),g=(0,f.useMemo)((function(){var e,n;if((null===v||void 0===v||null===(e=v.spans)||void 0===e?void 0:e.length)>0){var t=(n=v.spans,[{name:"traceID",type:"string",typeInfo:{frame:"string"}},{name:"spanID",type:"string",typeInfo:{frame:"string"}},{name:"parentSpanID",type:"string",typeInfo:{frame:"string"}},{name:"operationName",type:"string",typeInfo:{frame:"string"}},{name:"serviceName",type:"string",typeInfo:{frame:"string"}},{name:"serviceTags",type:"other",typeInfo:{frame:"json.RawMessage"}},{name:"startTime",type:"number",typeInfo:{frame:"float64"}},{name:"duration",type:"number",typeInfo:{frame:"float64"}},{name:"logs",type:"other",typeInfo:{frame:"json.RawMessage"}},{name:"references",type:"other",typeInfo:{frame:"json.RawMessage"}},{name:"tags",type:"other",typeInfo:{frame:"json.RawMessage"}}].map((function(e){var t=e.name,r=e.type,i=e.typeInfo;return{name:t,type:r,typeInfo:i,config:{},values:null===n||void 0===n?void 0:n.map((function(e){return e[t]})),entities:{},state:null}})));return{name:"Trace",refId:(null===s||void 0===s?void 0:s.idRef)||"Traces",fields:t,length:null===t||void 0===t?void 0:t.length}}return null}),[v,s]),m={traceProp:(0,l.Z)({},v)}.traceProp,x=function(){var e=(0,f.useState)(new Set),n=(0,u.Z)(e,2),t=n[0],r=n[1];return{hoverIndentGuideIds:t,addHoverIndentGuideId:(0,f.useCallback)((function(e){r((function(n){var t=new Set(n);return t.add(e),t}))}),[]),removeHoverIndentGuideId:(0,f.useCallback)((function(e){r((function(n){var t=new Set(n);return t.delete(e),t}))}),[])}}(),b=x.removeHoverIndentGuideId,y=x.addHoverIndentGuideId,Z=x.hoverIndentGuideIds,w=function(){var e=(0,f.useState)({time:{current:[0,1]}}),n=(0,u.Z)(e,2),t=n[0],r=n[1],i=(0,f.useCallback)((function(e){r((function(n){var t=(0,l.Z)((0,l.Z)({},n.time),e);return(0,l.Z)((0,l.Z)({},n),{},{time:t})}))}),[]);return{viewRange:t,updateViewRangeTime:(0,f.useCallback)((function(e,n){var t={current:[e,n]};r((function(e){return(0,l.Z)((0,l.Z)({},e),{},{time:t})}))}),[]),updateNextViewRangeTime:i}}(),S=w.viewRange,j=w.updateViewRangeTime,k=w.updateNextViewRangeTime,C=function(){var e=(0,f.useState)(new Set),n=(0,u.Z)(e,2),t=n[0],r=n[1],i=(0,f.useCallback)((function(e){if(0!==t.size){var n=-1,i=!0,a=e.reduce((function(e,t){return t.depth<=n&&(i=!0),i&&e.has(t.spanID)&&(e.delete(t.spanID),i=!1,n=t.depth),e}),new Set(t));r(a)}}),[t]),a=(0,f.useCallback)((function(e){if(!fx(e,t)){var n,i=e.reduce((function(e,t){return n&&t.depth<=n.depth?(e.add(n.spanID),t.hasChildren&&(n=t)):t.hasChildren&&!e.has(t.spanID)&&(n=t),e}),new Set(t));n&&i.add(n.spanID),r(i)}}),[t]),o=(0,f.useCallback)((function(){r(new Set)}),[]),l=(0,f.useCallback)((function(e){if(!fx(e,t)){var n=e.reduce((function(e,n){return n.hasChildren&&e.add(n.spanID),e}),new Set);r(n)}}),[t]),s=(0,f.useCallback)((function(e){var n=new Set(t);t.has(e)?n.delete(e):n.add(e),r(n)}),[t]);return{childrenHiddenIDs:t,expandOne:i,collapseOne:a,expandAll:o,collapseAll:l,childrenToggle:s}}(),T=C.expandOne,_=C.collapseOne,D=C.childrenToggle,N=C.collapseAll,M=C.childrenHiddenIDs,E=C.expandAll,R=function(e){var n=(0,f.useState)(new Map),t=(0,u.Z)(n,2),r=t[0],i=t[1],a=(0,f.useCallback)((function(e){var n=new Map(r);n.has(e)?n.delete(e):n.set(e,new Vm),i(n)}),[r]),o=(0,f.useCallback)((function(e,n){var t=r.get(e);if(t){var a=t.toggleEventItem(n),o=new Map(r);return o.set(e,a),i(o)}}),[r]),l=(0,f.useCallback)((function(e,n){var t=r.get(e);if(t){var a=t.toggleLogItem(n),o=new Map(r);return o.set(e,a),i(o)}}),[r]),s=(0,f.useCallback)((function(e,n){var t=r.get(e);if(t){var a=t.toggleReferenceItem(n),o=new Map(r);return o.set(e,a),i(o)}}),[r]);return{detailStates:r,toggleDetail:a,detailLogItemToggle:l,detailLogsToggle:(0,f.useCallback)((function(e){return dx("logs",r,i)(e)}),[r]),detailEventsItemToggle:o,detailEventsToggle:(0,f.useCallback)((function(e){return dx("events",r,i)(e)}),[r]),detailWarningsToggle:(0,f.useCallback)((function(e){return dx("warnings",r,i)(e)}),[r]),detailStackTracesToggle:(0,f.useCallback)((function(e){return dx("stackTraces",r,i)(e)}),[r]),detailReferenceItemToggle:s,detailReferencesToggle:(0,f.useCallback)((function(e){return dx("references",r,i)(e)}),[r]),detailProcessToggle:(0,f.useCallback)((function(e){return dx("process",r,i)(e)}),[r]),detailTagsToggle:(0,f.useCallback)((function(e){return dx("tags",r,i)(e)}),[r])}}(),O=R.detailStates,L=R.toggleDetail,V=R.detailLogItemToggle,z=R.detailLogsToggle,F=R.detailEventsToggle,B=R.detailProcessToggle,H=R.detailReferencesToggle,P=R.detailReferenceItemToggle,q=R.detailTagsToggle,A=R.detailWarningsToggle,Q=R.detailStackTracesToggle,W=(0,f.useState)(!1),U=(0,u.Z)(W,2),J=U[0],G=U[1],K=(0,f.useState)(.25),Y=(0,u.Z)(K,2),X=Y[0],$=Y[1],ee=(0,f.useMemo)((function(){return{childrenHiddenIDs:M,detailStates:O,hoverIndentGuideIds:Z,shouldScrollToFirstUiFindMatch:!1,spanNameColumnWidth:X,traceID:null===m||void 0===m?void 0:m.traceID}}),[M,O,Z,X,null===m||void 0===m?void 0:m.traceID]),ne=(0,f.useCallback)((function(){return G(!J)}),[J]);if(g&&v){var te=(0,l.Z)({ref:n,size:t,vheight:r},e);return(0,Fe.jsx)(I.a,{theme:h,children:(0,Fe.jsxs)(Sx,(0,l.Z)((0,l.Z)({},te),{},{children:[(0,Fe.jsx)(Za,(0,l.Z)((0,l.Z)({},e),{},{onClose:i,setMinimize:o,setMaxHeight:a,actualQuery:s,total:c,type:d})),(0,Fe.jsxs)("div",{className:"view-content",children:[(0,Fe.jsx)(Lm,(0,l.Z)((0,l.Z)({},e),{},{canCollapse:!1,hideMap:!1,hideSummary:!1,theme:h,onSlimViewClicked:ne,onTraceGraphViewClicked:jx,slimView:J,trace:m,updateNextViewRangeTime:k,updateViewRangeTime:j,viewRange:S})),(0,Fe.jsx)(Fh,(0,l.Z)((0,l.Z)({},e),{},{theme:h,registerAccessors:jx,scrollToFirstVisibleSpan:jx,trace:m,traceTimeline:ee,updateNextViewRangeTime:k,updateViewRangeTime:j,viewRange:S,setSpanNameColumnWidth:$,collapseAll:N,collapseOne:_,expandAll:E,expandOne:T,childrenToggle:D,clearShouldScrollToFirstUiFindMatch:jx,detailLogItemToggle:V,detailLogsToggle:z,detailEventsToggle:F,detailWarningsToggle:A,detailStackTracesToggle:Q,detailReferencesToggle:H,detailReferenceItemToggle:P,detailProcessToggle:B,detailTagsToggle:q,detailToggle:L,setTrace:jx,addHoverIndentGuideId:y,removeHoverIndentGuideId:b,linksGetter:jx,uiFind:e.search,scrollElement:e.scrollElement}))]})]}))})}return null}function Cx(e){var n,t,r,a,o,s=e.dataView,c=e.name,d=s.type,p=s.total,v=s.loading,h=(0,i.v9)((function(e){return e.isSplit})),g=(0,f.useRef)(null),m=(0,i.v9)((function(e){return e[c]})),x=(0,f.useState)("max"),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=Ki({panel:m,dataView:s}),S=(0,f.useState)(0),j=(0,u.Z)(S,2),k=j[0],C=j[1];(0,f.useEffect)((function(){var e,n;null!==g&&void 0!==g&&null!==(e=g.current)&&void 0!==e&&e.clientWidth&&C(null===(n=g.current)||void 0===n?void 0:n.clientWidth)}),[null===g||void 0===g||null===(n=g.current)||void 0===n?void 0:n.clientWidth]);var T=(0,f.useState)(s.data),_=(0,u.Z)(T,2),I=_[0],D=_[1],N=(0,f.useState)(s.tableData||{}),M=(0,u.Z)(N,2),E=M[0],R=M[1];(0,f.useEffect)((function(){D(s.data)}),[s.data,D,h]),(0,f.useEffect)((function(){R(s.tableData||{})}),[s.tableData,R]);var O=function(){D([]),R([])},L=function(){Z((function(e){return"min"!==e?"min":"regular"}))},V=function(){Z((function(e){return"max"!==e?"max":"regular"}))},z=Gi({total:p,panelSize:y,dataView:s}),F=Ji({type:d,actualQuery:w,total:p,dataView:s});if("traces"===d){var B=(0,l.Z)({viewRef:g,panelSize:y,viewHeight:F,setStreamClose:O,setMaxHeight:V,setMinimize:L,actualQuery:w,total:p,type:d,theight:z,tableData:E,viewWidth:k,streamData:I,theme:e.theme},e);return(0,Fe.jsx)(kx,(0,l.Z)({},B))}if(w&&"matrix"===d&&(null===I||void 0===I?void 0:I.length)>0){var H=w.limit,P=(0,l.Z)({viewRef:g,panelSize:y,viewHeight:F,setStreamClose:O,setMaxHeight:V,setMinimize:L,actualQuery:w,total:p,type:d,theight:z,tableData:E,viewWidth:k,limit:H,streamData:I},e);return(0,Fe.jsx)(fs,(0,l.Z)({},P))}if(w&&"stream"===d&&(null===I||void 0===I?void 0:I.length)>0){var q=(0,l.Z)({viewRef:g,panelSize:y,viewHeight:F,viewWidth:k,setStreamClose:O,setMaxHeight:V,logsVolumeData:s.logsVolumeData,setMinimize:L,actualQuery:w,total:p,type:d,theight:z,tableData:E,streamData:I},e);return(0,Fe.jsx)(cs,(0,l.Z)({},q))}if(w&&"vector"===d&&(null===I||void 0===I||null===(t=I.chartData)||void 0===t?void 0:t.length)>0||w&&"vector"===d&&(null===I||void 0===I||null===(r=I.tableData)||void 0===r||null===(a=r.dataRows)||void 0===a?void 0:a.length)>0){var A=w.limit,Q=(0,l.Z)({viewRef:g,panelSize:y,viewHeight:F,setStreamClose:O,setMinimize:L,setMaxHeight:V,actualQuery:w,total:p,type:d,theight:z,streamData:I,viewWidth:k,limit:A},e);return(0,Fe.jsx)(ps,(0,l.Z)({},Q))}if(!w||null!==I&&void 0!==I&&null!==(o=I.dataRows)&&void 0!==o&&o.length||null!==I&&void 0!==I&&I.length)return null;var W=(0,l.Z)({viewRef:g,panelSize:y,setStreamClose:O,setMinimize:L,setMaxHeight:V,actualQuery:w,total:p,loading:v},e);return(0,Fe.jsx)(Ea,(0,l.Z)({},W))}function Tx(e){var n=e.name,t=e.open,r=(0,hr.Fg)(),a=(0,f.useState)(n),o=(0,u.Z)(a,1)[0],s=(0,i.v9)((function(e){return e["".concat(o,"DataView")]})),c=(0,i.v9)((function(e){return e[o]})),d=(0,f.useMemo)((function(){return s.sort((function(e,n){return c.findIndex((function(n){return n.id===e.id}))-c.findIndex((function(e){return e.id===n.id}))}))}),[s,c]);return d.length>0?(0,Fe.jsx)(I.a,{theme:r,children:(0,Fe.jsxs)(ca,{children:[(0,Fe.jsx)(Ui.Z,{section:"Data Views",localProps:e}),null===d||void 0===d?void 0:d.map((function(n,r){return(0,Fe.jsx)(Cx,(0,l.Z)((0,l.Z)({},e),{},{splitted:t,dataView:n}),r)}))]})}):null}var _x=function(e){return(0,ze.iv)(gx||(gx=(0,r.Z)(["\n color: ",";\n display: flex;\n flex: 1;\n flex-direction: column;\n border: 1px solid ",";\n margin-top: 5px;\n border-radius: 5px;\n"])),e.textColor,e.buttonBorder)},Ix=function(e){return(0,ze.iv)(mx||(mx=(0,r.Z)(["\n font-size: 14px;\n background: ",";\n padding: 5px;\n border-bottom: 1px solid ",";\n"])),e.widgetContainer,e.buttonBorder)},Dx=function(e){return(0,ze.iv)(xx||(xx=(0,r.Z)(["\n display: table;\n"])))},Nx=(0,ze.iv)(bx||(bx=(0,r.Z)(["\n display: table-row;\n font-size: 13px;\n"]))),Mx=function(e,n){return(0,ze.iv)(yx||(yx=(0,r.Z)(["\n display: table-cell;\n padding: 5px;\n border-top: 1px solid ",";\n ","\n"])),e.buttonBorder,"key"===n?"color:".concat(e.textPrimary,";"):"")},Ex=(0,ze.iv)(Zx||(Zx=(0,r.Z)(["\n font-weight: lighter;\n"]))),Rx=(0,ze.iv)(wx||(wx=(0,r.Z)(["\n font-family: monospace;\n"])));function Ox(e){var n=e.data,t=n.hasStats,r=n.statsData,i=(0,hi.F)(),a=(0,f.useMemo)((function(){var e;return"object"!==typeof r&&void 0!==r&&(null===(e=Object.keys(r))||void 0===e?void 0:e.length)<1?[["key","val"]]:Object.entries(r)}),[r]);return(null===a||void 0===a?void 0:a.length)>0&&t?(0,Fe.jsxs)("div",{className:(0,ze.cx)(_x(i)),children:[(0,Fe.jsx)("div",{className:(0,ze.cx)(Ix(i)),children:"Stats"}),(0,Fe.jsx)("div",{className:(0,ze.cx)(Dx(i)),children:null===a||void 0===a?void 0:a.map((function(e,n){var t=(0,u.Z)(e,2),r=t[0],a=t[1];return(0,Fe.jsxs)("div",{className:(0,ze.cx)(Nx),children:[(0,Fe.jsx)("div",{className:(0,ze.cx)(Mx(i,"key"),Ex),children:r}),(0,Fe.jsx)("div",{className:(0,ze.cx)(Mx(i,"value"),Rx),children:a||""})]},n)}))})]}):null}var Lx,Vx,zx,Fx,Bx,Hx,Px,qx,Ax,Qx,Wx,Ux,Jx,Gx,Kx,Yx,Xx=t(81097),$x=Rt.z,eb=(0,jt.Z)(It.Z)(Lx||(Lx=(0,r.Z)(["\n height: 18px;\n color: ",";\n width: 18px;\n"])),(function(e){return e.color})),nb=(0,jt.Z)($x)(Vx||(Vx=(0,r.Z)(["\n background: none;\n margin-left: 5px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n height: 28px;\n span {\n margin-left: 5px;\n }\n @media screen and (max-width: 1070px) {\n display: flex;\n gap: 2px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder})),tb=(0,jt.Z)($x)(zx||(zx=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n text-overflow: ellipsis;\n transition: 0.25s all;\n padding-left: 6px;\n justify-content: flex-start;\n color: ",";\n height: 28px;\n &:hover {\n background: ",";\n }\n @media screen and (max-width: 1070px) {\n display: ",";\n margin: 0;\n gap: 2px;\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover}),(function(e){return e.isMobile?"flex":"none"})),rb=jt.Z.div(Fx||(Fx=(0,r.Z)(["\n display: flex;\n margin-left: 0px;\n flex-wrap: wrap;\n border-radius: 3px;\n gap: 2px;\n"]))),ib=(0,jt.Z)($x,{shouldForwardProp:function(e){return(0,Xx.Z)(e)&&"loading"!==e}})(Bx||(Bx=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n transition: 0.25s all;\n justify-content: center;\n height: 28px;\n margin: 0px 4px;\n &:hover {\n background: ",";\n }\n &:disabled {\n background: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n }\n @media screen and (max-width: 1070px) {\n display: flex;\n margin: 0;\n gap: 2px;\n }\n"])),(function(e){return e.loading?"#44bcd8":e.theme.primaryDark}),(function(e){return e.theme.primaryBorder}),(function(e){return e.theme.buttonText}),(function(e){return e.theme.primaryLight}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor})),ab=(0,jt.Z)($x)(Hx||(Hx=(0,r.Z)(["\n background: none;\n margin-left: 5px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n height: 28px;\n span {\n margin-left: 5px;\n }\n display: ",";\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.isMobile||e.isSplit?"flex":"none"})),ob=jt.Z.div(Px||(Px=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n margin-bottom: 4px;\n @media screen and (max-width: 1070px) {\n display: flex;\n gap: 2px;\n }\n"]))),lb=jt.Z.div(qx||(qx=(0,r.Z)(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 20px;\n margin-right: 10px;\n margin: 2px;\n"]))),sb=(jt.Z.div(Ax||(Ax=(0,r.Z)(["\n display: flex;\n align-items: center;\n"]))),jt.Z.div(Qx||(Qx=(0,r.Z)(["\n display: flex;\n flex: 1;\n flex-direction: column;\n background: ",";\n"])),(function(e){return e.theme.widgetContainer}))),ub=jt.Z.div(Wx||(Wx=(0,r.Z)(["\n margin: 20px;\n display: flex;\n flex-direction: column;\n flex: 1;\n .options-input {\n margin: 10px;\n display: flex;\n justify-content: space-between;\n }\n"]))),cb=((0,jt.Z)(Ot.K)(Ux||(Ux=(0,r.Z)(["\n background: ",";\n margin: 5px;\n flex: 1;\n padding: 5px 12px;\n border: 1px solid ",";\n color: ",";\n &:focus {\n border: 1px solid ",";\n }\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover})),(0,jt.Z)($x)(Jx||(Jx=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n height: 30px;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.primaryBorder}),(function(e){return e.theme.buttonText}),(function(e){return e.theme.primaryLight})),jt.Z.label(Gx||(Gx=(0,r.Z)(["\n font-size: 12px;\n color: ",";\n margin-left: 10px;\n"])),(function(e){return e.theme.inputLabelColor}))),db=jt.Z.div(Kx||(Kx=(0,r.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 10px;\n h3 {\n margin-left: 10px;\n font-size: 1em;\n color: ",";\n }\n"])),(function(e){return e.theme.textColor})),fb=(0,jt.Z)($x)(Yx||(Yx=(0,r.Z)(["\n background: none;\n padding: 0;\n color: ",";\n"])),(function(e){return e.theme.textColor}));function pb(e){var n=e.isDisabled,t=e.onClick,r=e.isMobile,i=e.alterText,a=e.loading,o=void 0!==a&&a,l=(0,hi.F)();return(0,Fe.jsx)(I.a,{theme:l,children:(0,Fe.jsx)(ib,{disabled:n,type:"submit",onClick:t,isMobile:r,loading:o||!1,children:o?(0,Fe.jsx)(Fe.Fragment,{children:"Loading..."}):(0,Fe.jsx)(Fe.Fragment,{children:i||"Show Results"})})})}function vb(e){var n=e.isDisabled,t=e.onClick,r=e.isMobile,i=e.alterText,a=(0,hi.F)();return(0,Fe.jsx)(I.a,{theme:a,children:(0,Fe.jsx)(nb,{disabled:n,type:"submit",onClick:t,isMobile:r,children:i||"Show Logs Rate"})})}function hb(e){return e&&"{"!==e&&"}"!==e}var gb,mb,xb,bb,yb,Zb,wb,Sb,jb,kb,Cb,Tb,_b={JSONClone:function(e){var n=JSON.stringify(e);return JSON.parse(n)},updateLabel:function(e,n){var t,r=[],i=(0,s.Z)(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.name===n?r.push((0,l.Z)((0,l.Z)({},a),{},{selected:!a.selected})):r.push(a)}}catch(o){i.e(o)}finally{i.f()}return r},updateLabelSelected:function(e,n){return e.some((function(e){return e===n}))?e.filter((function(e){return e!==n})):e.concat(n)}},Ib=function(e,n){var t={expr:"",dataSourceId:e,queryId:n};try{var r=JSON.parse(localStorage.getItem("queryData")||"[]")||[];if(r&&(null===r||void 0===r?void 0:r.length)>0){var i=null===r||void 0===r?void 0:r.find((function(t){return t.dataSourceId===e&&t.queryId===n}));return i&&(t=(0,l.Z)({},i)),t}return t}catch(a){return console.error(a),t}},Db=function(e){try{var n=JSON.parse(localStorage.getItem("dataSources")||"[]");return null===n||void 0===n?void 0:n.find((function(n){return n.id===e}))}catch(t){return{}}},Nb=function(e,n,t){var r={expr:e,queryId:n,dataSourceId:t},i=function(){try{return JSON.parse(localStorage.getItem("queryData")||"[]")}catch(e){return[]}}(),a=[];a=i&&i.length>0&&Array.isArray(i)&&i.some((function(e){return e.dataSourceId===t&&e.queryId===n}))?i.map((function(e){return e.queryId===n&&e.dataSourceId===t?(0,l.Z)({},r):e})):[].concat((0,H.Z)(i),[r]),localStorage.setItem("queryData",JSON.stringify(a))},Mb=(jt.Z.div(gb||(gb=(0,r.Z)(["\n padding-top: 5px;\n height: 100%;\n width: 100%;\n display: flex;\n flex:1;\n flex-direction: column;\n background-color: "," !important;\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: "," !important;\n }\n"])),(function(e){return e.theme.mainBgColor}),(function(e){return e.theme.scrollbarThumb})),jt.Z.div(mb||(mb=(0,r.Z)(["\n display: flex;\n align-items:center;\n"])))),Eb=(jt.Z.div(xb||(xb=(0,r.Z)(["\n display: flex;\n align-items: center;\n"]))),jt.Z.div(bb||(bb=(0,r.Z)(["\n display: flex;\n flex: 1;\n flex-direction: column;\n\n \n background: ",";\n"])),(function(e){return e.theme.widgetContainer})),jt.Z.div(yb||(yb=(0,r.Z)(["\n margin: 20px;\n display: flex;\n flex-direction: column;\n flex: 1;\n"]))),jt.Z.label(Zb||(Zb=(0,r.Z)(["\n font-size: 11px;\n white-space: nowrap;\n color: ",";\n margin-left: 10px;\n"])),(function(e){return e.theme.textColor}))),Rb=jt.Z.div(wb||(wb=(0,r.Z)(["\n display: flex;\n margin-right: 10px;\n"]))),Ob=jt.Z.div(Sb||(Sb=(0,r.Z)(["\n color: ",";\n background: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n white-space: nowrap;\n padding: 0px 10px;\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonInactive})),Lb=jt.Z.input(jb||(jb=(0,r.Z)(["\n flex: 1;\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius: 3px;\n max-width: 60px;\n padding-left: 8px;\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}));function Vb(e){var n=(0,i.I0)(),t=e.data.id,r=e.name,a=(0,i.v9)((function(e){return e[r]})),o=(0,f.useState)(e.data.limit),l=(0,u.Z)(o,2),s=l[0],c=l[1],d=(0,f.useMemo)((function(){return e.data.limit}),[e.data.limit]);return(0,f.useEffect)((function(){c(d)}),[d,c]),(0,Fe.jsxs)(Rb,{children:[(0,Fe.jsx)(Ob,{children:"Query Limit"}),(0,Fe.jsx)(D.Z,{title:"max 20000",children:(0,Fe.jsx)(Lb,{type:"number",value:s,onChange:function(e){var i=e.target.value;i>2e4&&(i=2e4);var o=(0,H.Z)(a);o.forEach((function(e){e.id===t&&(e.limit=i)})),n(function(e,n){return"left"===e?m(n):x(n)}(r,o))}})})]})}var zb=jt.Z.div(kb||(kb=(0,r.Z)(["\n color: ",";\n background: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n white-space: nowrap;\n padding: 0px 10px;\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonInactive})),Fb=jt.Z.div(Cb||(Cb=(0,r.Z)(["\n display: flex;\n align-items: center;\n font-size: 12px;\n background-color: ",";\n\n border: 1px solid ",";\n color: ",";\n border-radius: 3px;\n margin-right: 10px;\n"])),(function(e){return e.theme.buttonInactive}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor})),Bb=jt.Z.div(Tb||(Tb=(0,r.Z)(["\n cursor: pointer;\n display: flex;\n align-items: center;\n background: ",";\n border-left: ",";\n border-right: ",";\n border-radius: ",";\n flex: 1;\n height: 90%;\n\n padding: 0px 12px;\n font-size: 12px;\n line-height: 20px;\n"])),(function(e){return e.selected?e.theme.buttonDefault:e.theme.buttonInactive}),(function(e){return"last"===e.position?"1px solid ".concat(e.theme.buttonBorder):"none"}),(function(e){return"first"===e.position?"1px solid ".concat(e.theme.buttonBorder):"none"}),(function(e){var n=e.position;return"first"===n?"3px 0px 0px 3px":"last"===n?"0px 3px 3px 0px":"0px"})),Hb=function(e,n){var t=n.length;return 0===e?"first":e===t-1?"last":"center"};function Pb(e){var n=e.options,t=e.defaultActive,r=e.label,i=e.onChange,a=(0,f.useMemo)((function(){return t}),[t]),o=(0,f.useState)(a),l=(0,u.Z)(o,2),s=l[0],c=l[1];return(0,f.useEffect)((function(){c(t)}),[t]),(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(zb,{children:r}),(0,Fe.jsx)(Fb,{children:n&&n.map((function(e,n,r){return(0,Fe.jsx)(Bb,{selected:e.value===s,defaultActive:t,position:Hb(n,r),onClick:function(n){return function(e){c(e),i(e)}(e.value)},children:e.label},n)}))})]})}var qb,Ab=t(70024),Qb=jt.Z.div(qb||(qb=(0,r.Z)(["\n display: flex;\n padding: 4px 8px;\n // background: ",";\n color: ",";\n height: 26px;\n"])),(function(e){return e.theme.widgetContainer}),(function(e){return e.color}));function Wb(e,n){return"left"===e?m(n):x(n)}var Ub=[{value:"range",label:"Range"},{value:"instant",label:"Instant"}],Jb=[{value:"forward",label:"Forward"},{value:"backwards",label:"Backwards"}];function Gb(e){var n=(0,i.I0)(),t=e.name,r=e.data,a=(0,hr.Fg)(),o=(0,i.v9)((function(e){return e[t]})),s=(0,i.v9)((function(e){return e.responseType})),c=(0,p.TH)().hash,d=r.id,v=r.queryType,h=r.tableView,g=r.idRef,m=r.isShowTs,x=r.isBuilder,b=r.isLogsVolume,y=r.direction,Z=r.dataSourceType,w=r.isShowStats,S=r.hasStats,j=(0,f.useState)(h),k=(0,u.Z)(j,2),C=k[0],T=k[1],_=(0,f.useState)(m||!1),D=(0,u.Z)(_,2),N=D[0],M=D[1],E=(0,f.useState)(x||!1),R=(0,u.Z)(E,2),O=R[0],L=R[1],V=(0,f.useState)(b||!1),z=(0,u.Z)(V,2),F=z[0],B=z[1],P=(0,f.useState)(w||!1),q=(0,u.Z)(P,2),A=q[0],Q=q[1],W=(0,f.useState)(v),U=(0,u.Z)(W,2),J=U[0],G=U[1],K=(0,f.useState)(y||"forward"),Y=(0,u.Z)(K,2),X=Y[0],$=Y[1];return(0,f.useEffect)((function(){var e=new URLSearchParams(c.replace(/#/,"")).get(t),r=JSON.parse(decodeURIComponent(e)||"[]");if((null===r||void 0===r?void 0:r.length)>0){var i=r.find((function(e){return e.idRef===g}));if(i){var a=(0,H.Z)(o);a.forEach((function(e){e.idRef===g&&(e.queryType=i.queryType,e.direction=i.direction)})),n(Wb(t,a))}}}),[]),(0,f.useEffect)((function(){T(e.data.tableView)}),[T,e.data.tableView]),(0,f.useEffect)((function(){M(e.data.isShowTs)}),[M,e.data.isShowTs]),(0,f.useEffect)((function(){L(e.data.isBuilder)}),[L,e.data.isBuilder]),(0,f.useEffect)((function(){B(e.data.isLogsVolume)}),[B,e.data.isLogsVolume]),(0,Fe.jsx)(I.a,{theme:a,children:(0,Fe.jsxs)(Qb,{children:[(0,Fe.jsx)(Ui.Z,{section:"Query Options",localProps:e}),(0,Fe.jsx)(Pb,{label:"Query Type",options:Ub,onChange:function(e){var r=(0,H.Z)(o);r.forEach((function(n){n.id===d&&(n.queryType=e)})),n(Wb(t,r)),G(e)},defaultActive:J}),(0,Fe.jsx)(Pb,{label:"Direction",options:Jb,onChange:function(e){var r=(0,H.Z)(o);r.forEach((function(n){n.id===d&&(n.direction=e)})),n(Wb(t,r)),$(e)},defaultActive:X}),(0,Fe.jsx)(Vb,(0,l.Z)({},e)),"flux"===Z&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(Eb,{children:"Chart View"}),(0,Fe.jsx)(Ab.Z,{checked:C,size:"small",onChange:function(){var e=(0,H.Z)(o);e.forEach((function(e){e.id===d&&(e.tableView=!C)})),n(Wb(t,e))},inputProps:{"aria-label":"controlled"}})]}),"vector"!==s&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)(Mb,{children:[(0,Fe.jsx)(Eb,{children:"Timestamp"}),(0,Fe.jsx)(Ab.Z,{checked:N,size:"small",onChange:function(){var e=(0,H.Z)(o);e.forEach((function(e){e.id===d&&(e.isShowTs=!N)})),n(Wb(t,e))},inputProps:{"aria-label":"controlled-ts"}})]}),(0,Fe.jsxs)(Mb,{children:[(0,Fe.jsx)(Eb,{children:"Query Builder"}),(0,Fe.jsx)(Ab.Z,{checked:O,size:"small",onChange:function(){var e=(0,H.Z)(o);e.forEach((function(e){e.id===d&&(e.isBuilder=!O)})),n(Wb(t,e))},inputProps:{"aria-label":"controlled-ts"}})]}),(0,Fe.jsxs)(Mb,{children:[(0,Fe.jsx)(Eb,{children:"Logs Volume"}),(0,Fe.jsx)(Ab.Z,{checked:F,size:"small",onChange:function(){var e=(0,H.Z)(o);e.forEach((function(e){e.id===d&&(e.isLogsVolume=!F)})),n(Wb(t,e))},inputProps:{"aria-label":"controlled-ts"}})]}),S&&(0,Fe.jsxs)(Mb,{children:[(0,Fe.jsx)(Eb,{children:"Stats Info"}),(0,Fe.jsx)(Ab.Z,{checked:A,size:"small",onChange:function(e){var r=e.target.checked;Q((function(){return r}));var i=(0,H.Z)(o);i.forEach((function(e){e.id===d&&(e.isShowStats=!A)})),n(Wb(t,i))},inputProps:{"aria-label":"controlled-ts"}})]})]})]})})}var Kb,Yb=function(e){var n=(0,i.I0)(),t=(0,i.v9)((function(e){return e.responseType})),r=(0,p.TH)().hash,a=e.data,o=a.id,s=a.idRef,c=a.dataSourceType,d=a.isBuilder,v=e.open,h=e.handleClose,g=e.actPanel,m=e.name,x=(0,f.useState)(e.data.tableView),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useState)(e.data.isShowTs),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,f.useState)(d||!1),T=(0,u.Z)(C,2),_=T[0],I=T[1],D=(0,f.useState)(e.data.queryType),N=(0,u.Z)(D,2),M=N[0],E=N[1],R=(0,f.useState)(e.data.traceQueryType||"traceId"),O=(0,u.Z)(R,2),L=O[0],V=O[1],z=(0,f.useState)(e.data.direction),F=(0,u.Z)(z,2),B=F[0],P=F[1];(0,f.useEffect)((function(){var e=new URLSearchParams(r.replace(/#/,"")).get(m),t=JSON.parse(decodeURIComponent(e));if((null===t||void 0===t?void 0:t.length)>0){var i=t.find((function(e){return e.idRef===s}));if(i){var a=(0,H.Z)(g),o=A(a,s);"undefined"!==typeof o&&(o.queryType=i.queryType,o.direction=i.direction,n(Zj(m,a)))}}}),[]);var q=function(e,n){return e.find((function(e){return e.id===n}))},A=function(e,n){return e.find((function(e){return e.id===n}))};function Q(e){var t=(0,H.Z)(g),r=q(t,o);"undefined"!==typeof r&&(r.traceQueryType=e,n(Zj(m,t))),V((function(n){return e}))}(0,f.useEffect)((function(){Z(e.data.tableView)}),[Z,e.data.tableView]),(0,f.useEffect)((function(){k(e.data.isShowTs)}),[k,e.data.isShowTs]),(0,f.useEffect)((function(){I(e.data.isBuilder)}),[I,e.data.isBuilder]);return(0,Fe.jsx)(sr.Z,{open:v,onClose:h,PaperProps:{classes:{root:vr.ht}},children:(0,Fe.jsxs)(sb,{children:[(0,Fe.jsxs)(db,{children:[(0,Fe.jsx)("h3",{children:"Query Options"}),(0,Fe.jsxs)(fb,{onClick:h,children:[" ",(0,Fe.jsx)(br.Z,{})," "]})]}),(0,Fe.jsxs)(ub,{children:[(0,Fe.jsx)("div",{className:"options-input",children:(0,Fe.jsx)(Pb,{label:"Trace Type",options:kj,onChange:Q,defaultActive:L})}),(0,Fe.jsx)("div",{className:"options-input",children:(0,Fe.jsx)(Pb,{label:"Query Type",options:Sj,onChange:function(e){var t=(0,H.Z)(g),r=q(t,o);"undefined"!==typeof r&&(r.queryType=e,n(Zj(m,t))),E(e)},defaultActive:M})}),(0,Fe.jsx)("div",{className:"options-input",children:(0,Fe.jsx)(Pb,{label:"Direction",options:jj,onChange:function(e){var t=(0,H.Z)(g),r=q(t,o);"undefined"!==typeof r&&(r.direction=e,n(Zj(m,t))),P(e)},defaultActive:B})}),(0,Fe.jsx)("div",{className:"options-input",children:(0,Fe.jsx)(Vb,(0,l.Z)({},e))}),"flux"===c&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Chart View"}),(0,Fe.jsx)(Ab.Z,{checked:y,size:"small",onChange:function(){var e=(0,H.Z)(g),t=q(e,o);"undefined"!==typeof t&&(t.tableView=!y,n(Zj(m,e)))},inputProps:{"aria-label":"controlled"}})]}),"vector"!==t&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsxs)(lb,{children:[(0,Fe.jsx)(cb,{children:"Timestamp"}),(0,Fe.jsx)(Ab.Z,{checked:j,size:"small",onChange:function(){var e=(0,H.Z)(g);e.forEach((function(e){e.id===o&&(e.isShowTs=!j)})),n(Zj(m,e))},inputProps:{"aria-label":"controlled-ts"}})]}),(0,Fe.jsxs)(lb,{children:[(0,Fe.jsx)(cb,{children:"Query Builder"}),(0,Fe.jsx)(Ab.Z,{checked:_,size:"small",onChange:function(){var e=(0,H.Z)(g);e.forEach((function(e){e.id===o&&(e.isBuilder=!_)})),n(Zj(m,e))},inputProps:{"aria-label":"controlled-ts"}})]})]})]})]})})};var Xb=(0,ze.iv)(Kb||(Kb=(0,r.Z)(["\n height: 18px !important;\n width: 18px !important;\n"])));function $b(e){var n=(0,i.I0)(),t=e.name,r=e.data,a=r.id,o=r.browserOpen,l=(0,f.useMemo)((function(){return o}),[o]),s=(0,hi.F)(),c=((0,i.v9)((function(e){return e.labels})),(0,i.v9)((function(e){return e[t]}))),d=(0,f.useState)(l),p=(0,u.Z)(d,2),v=p[0],h=p[1];(0,f.useEffect)((function(){h(l)}),[l]);return(0,Fe.jsx)(I.a,{theme:s,children:(0,Fe.jsx)(D.Z,{title:function(n){var t;return(null===(t=e.labels)||void 0===t?void 0:t.length)>0?"Show / Hide Labels":"Labels Not Available"}(),children:(0,Fe.jsxs)(tb,{onClick:function(){var e=(0,H.Z)(c);e.forEach((function(e){e.id===a&&(e.browserOpen=!v)})),n(function(e,n){return"left"===e?m(n):x(n)}(t,e)),h(l)},browserActive:v,isMobile:e.isMobile,children:[function(e){return e?(0,Fe.jsx)(ga.Z,{className:(0,ze.cx)(Xb)}):(0,Fe.jsx)(mt.Z,{className:(0,ze.cx)(Xb)})}(v),"Labels"]})})})}function ey(e){var n=e.disabled,t=e.onClick,r=e.isMobile,i=(0,hi.F)();return(0,Fe.jsx)(I.a,{theme:i,children:(0,Fe.jsx)(ab,{disabled:n,type:"submit",onClick:t,isMobile:r,children:"Options"})})}function ny(e){var n=e.queryLength,t=e.handleHistoryClick,r=e.isMobile,i=(0,f.useState)(!1),a=(0,u.Z)(i,2),o=a[0],l=a[1],s=(0,hi.F)();return(0,f.useEffect)((function(){l(n>0)}),[n]),(0,Fe.jsx)(I.a,{theme:s,children:(0,Fe.jsx)(D.Z,{title:"Query History ("+n+")",children:(0,Fe.jsxs)(nb,{isMobile:r,onClick:t,children:[(0,Fe.jsx)(eb,{color:o?s.textColor:s.textOff}),r&&(0,Fe.jsx)("span",{children:"History"})]})})})}var ty,ry,iy,ay,oy,ly,sy,uy,cy,dy,fy,py,vy,hy=["isSplit","onShowQuerySettings","queryHistory","handleHistoryClick","queryValid","onSubmit","onSubmitRate","data","name","loading","hasStats","showStatsOpen","handleStatsOpen"],gy=function(e){var n=(0,i.I0)(),t=e.isSplit,r=e.onShowQuerySettings,a=e.queryHistory,o=e.handleHistoryClick,s=e.queryValid,c=e.onSubmit,d=e.onSubmitRate,p=e.data,v=e.name,h=e.loading,g=e.hasStats,m=e.showStatsOpen,x=e.handleStatsOpen,b=(0,Vo.Z)(e,hy),y=p.id,Z=p.dataSourceType,w=(0,f.useState)(e.data.chartView),S=(0,u.Z)(w,2),j=S[0],k=S[1];(0,f.useEffect)((function(){k(e.data.chartView)}),[k,e.data.chartView]);var C,T=(0,i.v9)((function(e){return e[v]}));return(0,Fe.jsxs)(ob,{children:[(C=Z,"flux"!==C&&"metrics"!==C&&"traces"!==C?(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)($b,(0,l.Z)((0,l.Z)({},e),{},{isMobile:!0})),(0,Fe.jsx)(ey,(0,l.Z)((0,l.Z)({},b),{},{isSplit:t,isMobile:!0,onClick:r}))]}):null),(0,Fe.jsx)(ny,{queryLength:null===a||void 0===a?void 0:a.length,handleHistoryClick:o,isMobile:!0}),"logs"===Z&&(0,Fe.jsx)(vb,{disabled:!s,onClick:d,isMobile:!1}),"logs"===Z&&g&&t&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Show Stats"}),(0,Fe.jsx)(Ab.Z,{checked:m,size:"small",onChange:x,inputProps:{"aria-label":"controlled-switch"}})]}),(0,Fe.jsx)(pb,{disabled:!s,onClick:c,isMobile:!0,loading:h||!1}),"flux"===Z&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Chart View"}),(0,Fe.jsx)(Ab.Z,{checked:j,size:"small",onChange:function(){var e=(0,H.Z)(T),t=function(e,n){return e.find((function(e){return e.id===n}))}(e,y);"undefined"!==typeof t&&(t.chartView=!j,n(Zj(v,e)))},inputProps:{"aria-label":"controlled"}})]})]})},my=t(28048),xy=t(32720),by=t(55386),yy=t(19803),Zy=t.n(yy),wy=(t(68293),t(66940),(0,jt.Z)(xy.CX)(ty||(ty=(0,r.Z)(["\n flex: 1;\n background: ",";\n border: 1px solid ",";\n color: ",";\n padding: 4px 8px;\n font-size: 12px;\n font-family: monospace;\n margin: 0px 5px;\n border-radius: 3px;\n line-height: 1.5;\n line-break: anywhere;\n overflow-y: scroll;\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}))),Sy=jt.Z.div(ry||(ry=(0,r.Z)(["\n display: flex;\n align-items: center;\n flex: 1;\n max-width: 100%;\n"])));function jy(e){var n=e.attributes,t=e.children,i=e.leaf,a=(0,hi.F)();return(0,Fe.jsx)("span",(0,l.Z)((0,l.Z)({},n),{},{className:(0,ze.iv)(iy||(iy=(0,r.Z)(["\n font-family: monospace;\n // background: black;\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),i.comment&&(0,ze.iv)(ay||(ay=(0,r.Z)(["\n color: blue;\n "]))),(i.operator||i.url)&&(0,ze.iv)(oy||(oy=(0,r.Z)(["\n color: ",";\n "])),a.textOff),i.keyword&&(0,ze.iv)(ly||(ly=(0,r.Z)(["\n color: #57aed4;\n "]))),(i.variable||i.regex)&&(0,ze.iv)(sy||(sy=(0,r.Z)(["\n color: #e90;\n "]))),(i.number||i.boolean||i.tag||i.constant||i.symbol||i["attr-name"]||i.selector)&&(0,ze.iv)(uy||(uy=(0,r.Z)(["\n color: #dd4a68;\n "]))),i.punctuation&&(0,ze.iv)(cy||(cy=(0,r.Z)(["\n color: orange;\n "]))),(i.string||i.char)&&(0,ze.iv)(dy||(dy=(0,r.Z)(["\n color: green;\n "]))),(i.function||i["class-name"]||i["attr-name"])&&(0,ze.iv)(fy||(fy=(0,r.Z)(["\n color: #dd4a68;\n "]))),i["context-labels"]&&(0,ze.iv)(py||(py=(0,r.Z)(["\n color: orange;\n "]))),i["label-key"]&&(0,ze.iv)(vy||(vy=(0,r.Z)(["\n color: green;\n "])))),children:t}))}function ky(e){var n;return"string"===typeof e?null===e||void 0===e?void 0:e.length:"string"===typeof(null===e||void 0===e?void 0:e.content)?null===e||void 0===e?void 0:e.content.length:null===e||void 0===e||null===(n=e.content)||void 0===n?void 0:n.reduce((function(e,n){return e+ky(n)}),0)}function Cy(e){var n=e.onQueryChange,t=e.value,r=e.onKeyDown,i=(e.defaultValue,e.isSplit,(0,hi.F)()),a=(0,f.useCallback)((function(e){return(0,Fe.jsx)(jy,(0,l.Z)({},e))}),[]),o=(0,f.useMemo)((function(){return(0,by.VC)((0,xy.BU)((0,my.Jh)()))}),[]),c=(0,f.useRef)(null),d=(0,f.useState)("sql"),p=(0,u.Z)(d,1)[0],v=(0,f.useCallback)((function(e){var n=(0,u.Z)(e,2),t=n[0],r=n[1],i=[];if(!my.xv.isText(t)||(null===t||void 0===t?void 0:t.length)<1)return i;var a,o=Zy().tokenize(t.text,Zy().languages[p]),l=0,c=(0,s.Z)(o);try{for(c.s();!(a=c.n()).done;){var d,f=a.value,v=l+ky(f);if("string"!==typeof f)i.push((d={},(0,B.Z)(d,f.type,!0),(0,B.Z)(d,"anchor",{path:r,offset:l}),(0,B.Z)(d,"focus",{path:r,offset:v}),d));l=v}}catch(h){c.e(h)}finally{c.f()}return i}),[p]),h=(0,f.useState)(t),g=(0,u.Z)(h,2),m=g[0],x=g[1];return(0,f.useEffect)((function(){x(t)}),[]),(0,f.useEffect)((function(){x(t),o.children=t}),[t,x]),(0,Fe.jsx)(I.a,{theme:i,children:(0,Fe.jsx)(Sy,{ref:c,children:(0,Fe.jsx)(xy.mH,{editor:o,value:m,onChange:n,children:(0,Fe.jsx)(wy,{decorate:v,renderLeaf:a,placeholder:"",onKeyDown:r,spellCheck:"false"})})})})}var Ty=function(e){var n,t=e.isTabletOrMobile,r=e.isBuilder,a=e.dataSourceType,s=e.handleQueryChange,u=e.expr,c=e.queryValue,d=e.handleInputKeyDown,f=e.queryHistory,p=e.handleHistoryClick,v=e.queryValid,h=e.onSubmit,g=e.onSubmitRate,m=e.loading,x=(0,i.v9)((function(e){return e.isSplit}));return(0,Fe.jsxs)(rb,{children:[!t&&!x&&!r&&(n="logs",a===n)&&(0,Fe.jsx)($b,(0,l.Z)({},e)),("logs"!==a||!r)&&"metrics"!==a&&(0,Fe.jsx)(Cy,{onQueryChange:s,defaultValue:o().sanitize(u||""),value:c,onKeyDown:d}),!x&&"flux"!==a&&"traces"!==a&&"logs"===a&&!r&&!t&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(ny,{queryLength:f.length,handleHistoryClick:p}),"logs"===a&&!r&&(0,Fe.jsx)(vb,{disabled:!v,onClick:g,isMobile:!1}),(0,Fe.jsx)(pb,{disabled:!v,onClick:h,isMobile:!1,loading:m||!1})]}),("traces"===a||"metrics"===a)&&(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(pb,{disabled:!v,onClick:h,isMobile:!1,loading:m||!1})})]})},_y=t(9964),Iy=t(9820),Dy=t(53132);var Ny=t(48268);function My(e){var n,t=(0,Ny.Uc)(e),r=(0,l.Z)((0,l.Z)({},t),{},{"Content-Type":"application/json"}),i={},a={};if(null===e||void 0===e||null===(n=e.auth)||void 0===n?void 0:n.basicAuth.value){var o,u,c,d=null===e||void 0===e||null===(o=e.auth)||void 0===o||null===(u=o.fields)||void 0===u?void 0:u.basicAuth,f=(0,s.Z)(d);try{for(f.s();!(c=f.n()).done;){var p=c.value;"user"===p.name&&(a.username=p.value),"password"===p.name&&(a.password=p.value)}}catch(v){f.e(v)}finally{f.f()}i.auth=a}return i.options={method:"GET"},i.headers=r,i}var Ey,Ry,Oy,Ly,Vy,zy,Fy,By,Hy,Py,qy,Ay,Qy=t(17527),Wy=t(74092),Uy=function(e,n,t){return{container:function(e){return(0,l.Z)((0,l.Z)({},e),{},{flex:t?1:""})},menu:function(n){return(0,l.Z)((0,l.Z)({},n),{},{fontSize:"12px",color:e.textColor})},control:function(r){return(0,l.Z)((0,l.Z)({},r),{},{fontSize:"12px",height:28,minHeight:28,boxShadow:"none",color:e.textColor,border:"1px solid ".concat(e.buttonBorder),minWidth:n,flex:t?1:""})},input:function(n){return(0,l.Z)((0,l.Z)({},n),{},{fontSize:"12px",color:e.textColor})},indicatorSeparator:function(e){return{display:"none"}},dropdownIndicator:function(n){return{padding:0,svg:{height:12},color:e.textColor}},clearIndicator:function(e){return{padding:0,svg:{height:12}}},singleValue:function(n){return(0,l.Z)((0,l.Z)({},n),{},{fontSize:"12px",height:30,minHeight:30,margin:0,padding:0,marginTop:"4px",color:e.textColor})},valueContainer:function(e){return(0,l.Z)((0,l.Z)({},e),{},{display:"flex",flex:t?1:""})}}},Jy=(0,ze.iv)(Ey||(Ey=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 3px;\n"]))),Gy=(0,ze.iv)(Ry||(Ry=(0,r.Z)(["\n display: flex;\n align-items: center;\n"]))),Ky=function(e){return(0,ze.iv)(Oy||(Oy=(0,r.Z)(["\n color: ",";\n border: 1px solid ",";\n margin-left: 3px;\n cursor: pointer;\n\n padding: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 3px;\n"])),e.textColor,e.buttonBorder)},Yy=function(e){return(0,ze.iv)(Ly||(Ly=(0,r.Z)(["\n display: flex;\n align-items: center;\n margin-top: 3px;\n margin-left: 3px;\n cursor: pointer;\n color: ",";\n padding: 0px 12px;\n border-radius: 3px;\n height: 28px;\n small {\n font-size: 12px;\n margin: 0;\n padding: 0;\n }\n"])),e.textColor)},Xy=function(e){return(0,ze.iv)(Vy||(Vy=(0,r.Z)(["\n color: ",";\n margin-right: 2px;\n"])),e.textColor)},$y=(0,ze.iv)(zy||(zy=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n margin: 0px 0px;\n"]))),eZ=(0,ze.iv)(Fy||(Fy=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n flex: 1;\n"]))),nZ=(0,ze.iv)(By||(By=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n"]))),tZ=((0,ze.iv)(Hy||(Hy=(0,r.Z)(["\n display: flex;\n margin: 10px 0px;\n"]))),(0,ze.iv)(Py||(Py=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n margin-top: 10px;\n"])))),rZ=(0,ze.iv)(qy||(qy=(0,r.Z)(["\n //align-items:center;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n"]))),iZ=function(e){return(0,ze.iv)(Ay||(Ay=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n color: ",";\n margin-left: 5px;\n transition: 0.25s all;\n justify-content: center;\n padding: 3px 12px;\n margin-top: 5px;\n height: 30px;\n display: flex;\n align-items: center;\n align-self: flex-end;\n max-width: 200px;\n cursor: pointer;\n &:hover {\n background: ",";\n }\n"])),e.primaryDark,e.primaryBorder,e.buttonText,e.primaryLight)},aZ=75,oZ={display:"flex",alignItems:"center",flex:1,width:"100%"},lZ={display:"flex",alignItems:"flex-end",flex:1,width:"100%"};function sZ(e){var n=e.defaultValue,t=e.options,r=(0,f.useMemo)((function(){var e=null===t||void 0===t?void 0:t.find((function(e){return(null===e||void 0===e?void 0:e.value)===n}));return{label:null===e||void 0===e?void 0:e.label}}),[n,t]);return(0,Fe.jsx)("div",{style:lZ,children:(0,Fe.jsx)("div",{children:r.label})})}var uZ,cZ=function(e){var n=Qy.c.Option,t=e.data.label;return(0,Fe.jsx)(n,(0,l.Z)((0,l.Z)({},e),{},{children:(0,Fe.jsx)("div",{style:oZ,children:(0,Fe.jsx)("span",{style:{fontSize:"12px"},children:t})})}))},dZ=function(e){var n=e.data.label;return(0,Fe.jsx)("div",{style:lZ,children:(0,Fe.jsx)("div",{children:n})})},fZ=(0,f.forwardRef)((function(e,n){var t=e.options,r=e.onSelectChange,i=e.label,a=e.labelWidth,o=(0,hr.Fg)();return(0,Fe.jsxs)("div",{style:{marginTop:"5px",display:"flex",alignItems:"center",flex:1,whiteSpace:"nowrap"},children:[(0,Fe.jsx)("label",{style:{width:"".concat(a,"px"),fontSize:"12px",color:o.textColor,padding:"0px 10px"},children:i}),(0,Fe.jsx)(Wy.ZP,{styles:Uy(o,100,!0),placeholder:(0,Fe.jsx)(sZ,(0,l.Z)({},e)),options:t,ref:n,components:{Option:cZ,SingleValue:dZ},theme:function(e){return(0,Ny.Pu)(e,o)},onChange:r})]})}));function pZ(e){var n=e.name,t=e.data,r=t.id,a=t.dataSourceId,s=t.dataSourceType,c=t.dataSourceURL,d=t.expr,p=e.onSearchChange,v=(0,i.I0)(),h=function(e){var n=e.id,t=(0,i.v9)((function(e){return e.dataSources})),r=(0,f.useState)({data:{tagValues:[]}}||{}),a=(0,u.Z)(r,2),o=a[0],l=a[1],s=(0,f.useMemo)((function(){return t.find((function(e){return e.id===n}))}),[t,n]);return(0,f.useEffect)((function(){if("traces"===s.type&&null!==s&&void 0!==s&&s.url&&""!==(null===s||void 0===s?void 0:s.url)){var e=My(s),n="".concat(s.url,"/api/search/tag/service.name/values"),t=function(){var t=(0,F.Z)((0,z.Z)().mark((function t(){var r;return(0,z.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,q().get(n,e);case 3:r=t.sent,l(r||[]),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("Error at loading Service Names",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();t()}}),[]),(0,f.useMemo)((function(){var e;return null!==o&&void 0!==o&&null!==(e=o.data)&&void 0!==e&&e.tagValues?[{name:"Select Service Name",value:"",label:"Select Service Name"}].concat(o.data.tagValues.map((function(e){return{name:e,value:e,label:e}}))):[{name:"",value:""}]}),[o])}({id:a}),g=function(e){var n=e.id,t=(0,i.v9)((function(e){return e.dataSources})),r=(0,f.useState)({data:{tagValues:[]}}||{}),a=(0,u.Z)(r,2),o=a[0],l=a[1],s=(0,f.useMemo)((function(){return t.find((function(e){return e.id===n}))}),[t,n]);return(0,f.useEffect)((function(){if("traces"===s.type&&null!==s&&void 0!==s&&s.url&&""!==(null===s||void 0===s?void 0:s.url)){var e=My(s),n="".concat(s.url,"/api/search/tag/name/values"),t=function(){var t=(0,F.Z)((0,z.Z)().mark((function t(){var r;return(0,z.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,q().get(n,e);case 3:r=t.sent,l(r||[]),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("Error at loading Span Names",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();t()}}),[]),(0,f.useMemo)((function(){var e;return null!==o&&void 0!==o&&null!==(e=o.data)&&void 0!==e&&e.tagValues?[{name:"Search Span Name",value:"",label:"Search Span Name"}].concat(o.data.tagValues.map((function(e){return{name:e,value:e,label:e}}))):[{name:"",value:"",label:""}]}),[o])}({id:a}),m=(0,f.useState)({name:"",value:"",label:""}),x=(0,u.Z)(m,2),b=x[0],y=x[1],Z=(0,f.useState)(g[0]||{name:"",value:"",label:""}),w=(0,u.Z)(Z,2),S=w[0],j=w[1],k=(0,hr.Fg)(),C=(0,f.useState)({searchName:b.value||"",name:S.value||"",tags:"",minDuration:"",maxDuration:"",limit:20}),T=(0,u.Z)(C,2),_=T[0],I=T[1],D=(0,f.useState)(""),N=(0,u.Z)(D,2),M=N[0],E=N[1];(0,f.useEffect)((function(){h.length>0&&E(function(e){var n=e.searchName,t=e.name,r=e.minDuration,i=e.maxDuration,a=e.tags,o=e.limit,l="";(null===n||void 0===n?void 0:n.length)>0&&(l=' service.name="'.concat(n,'"'));var s="";(null===a||void 0===a?void 0:a.length)>0&&(s=" ".concat(a));var u="";(null===t||void 0===t?void 0:t.length)>0&&(u=' name="'.concat(t,'"'));var c="";(null===r||void 0===r?void 0:r.length)>0&&(c="&minDuration=".concat(r));var d="";(null===i||void 0===i?void 0:i.length)>0&&(d="&maxDuration=".concat(i));var f="";o&&(f="&limit=".concat(o));var p=encodeURIComponent("".concat(s).concat(l).concat(u));return"search?tags=".concat(p).concat(c).concat(d).concat(f)}(_))}),[_]);var R=function(){return{dataSourceType:s,expr:d,queryType:"trace-search",limit:_.limit,name:n,id:r,open:!0,direction:"forward",dataSourceId:a,url:"".concat(c,"/api/").concat(M)}},O=function(e,n){var t,r=(null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value)||"";I((function(e){return(0,l.Z)((0,l.Z)({},e),{},(0,B.Z)({},n,r))})),p(R())};return(0,Fe.jsx)("div",{className:(0,ze.cx)(tZ),children:(0,Fe.jsxs)("div",{className:(0,ze.cx)(rZ),children:[(0,Fe.jsx)(fZ,(0,l.Z)((0,l.Z)({},e),{},{defaultValue:"",label:"Service Name",options:h,onSelectChange:function(e){var n=(null===e||void 0===e?void 0:e.value)||"";y({name:n,value:n,label:n}),I((function(e){return(0,l.Z)((0,l.Z)({},e),{},{searchName:n})})),p(R())},labelWidth:aZ})),(0,Fe.jsx)(fZ,(0,l.Z)((0,l.Z)({},e),{},{defaultValue:"",label:"Span Name",options:g,onSelectChange:function(e){var n=(null===e||void 0===e?void 0:e.value)||"";j({name:n,value:n,label:n}),I((function(e){return(0,l.Z)((0,l.Z)({},e),{},{name:n})})),p(R())},labelWidth:aZ})),(0,Fe.jsx)(Dy.gN,{label:"Tags",placeholder:"http.status_code=200 error=true",onChange:function(e){return O(e,"tags")},value:o().sanitize(_.tags),labelWidth:aZ}),(0,Fe.jsx)(Dy.gN,{label:"Limit",placeholder:"Set limit, default 20",onChange:function(e){return O(e,"limit")},value:o().sanitize(String(_.limit)),labelWidth:aZ}),(0,Fe.jsx)(Dy.gN,{label:"Min Duration",placeholder:"e.g. 1.2s, 100ms",onChange:function(e){return O(e,"minDuration")},value:o().sanitize(_.minDuration),labelWidth:aZ}),(0,Fe.jsx)(Dy.gN,{label:"Max Duration",placeholder:"e.g. 1.2s, 100ms",onChange:function(e){return O(e,"maxDuration")},value:o().sanitize(_.maxDuration),labelWidth:aZ}),(0,Fe.jsx)("button",{className:(0,ze.cx)(iZ(k)),onClick:function(){c&&""!==c&&v(Tn(s,d,"trace-search",_.limit,n,r,"forward",a,"".concat(c,"/api/").concat(M)))},children:"Search Traces"})]})})}var vZ=(0,ze.iv)(uZ||(uZ=(0,r.Z)(["\n display: flex;\n height:30px;\n"]))),hZ=[{label:"Search",value:"search"},{label:"TraceID",value:"traceId"}];function gZ(e){var n=e.value,t=e.onChange,r=(0,f.useState)(n||"traceId"),i=(0,u.Z)(r,2),a=i[0],o=i[1];return(0,Fe.jsx)("div",{className:(0,ze.cx)(vZ),children:(0,Fe.jsx)(Pb,{label:"Query Type",options:hZ,onChange:function(e){o((function(n){return e})),t(e)},defaultActive:a})})}function mZ(e,n,t,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=(0,f.useState)(!1),o=(0,u.Z)(a,2),l=o[0],s=o[1],c=(0,f.useState)([]),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,hr.mm)(n),g=(0,hr.uk)(t),m=(0,hr.qX)(e,r,i),x=(0,f.useMemo)((function(){return(0,Ny.Bp)(m.url,h,g)}),[m.url,h,g]);return(0,f.useEffect)((function(){(0,Ny.jY)(m,x,s,v)}),[m]),{loading:l,logsResponse:(0,f.useMemo)((function(){var e,n,t;return null!==p&&void 0!==p&&null!==(e=p.data)&&void 0!==e&&e.data&&Array.isArray(null===p||void 0===p||null===(n=p.data)||void 0===n?void 0:n.data)?null===(t=p.data.data)||void 0===t?void 0:t.map((function(e){return{label:e,value:e}})):[{label:"",value:""}]}),[p])}}var xZ,bZ,yZ,ZZ=t(81400),wZ=t(23860),SZ=t(24754),jZ=t.n(SZ),kZ=t(64664),CZ=t(31852),TZ=function(e){return(0,ze.iv)(xZ||(xZ=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n .operation-header {\n background: ",";\n color: ",";\n padding: 0px 8px;\n border-bottom: 1px solid ",";\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 28px;\n span {\n // font-weight: bold;\n font-size: 12px;\n }\n .operation-tools {\n display: none;\n align-items: center;\n }\n &:hover .operation-tools {\n display: flex;\n }\n }\n .operation-body {\n padding: 8px;\n }\n"])),e.viewBg,e.textColor,e.buttonBorder)},_Z=function(e){return(0,ze.iv)(bZ||(bZ=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n gap: 3px;\n .input-group {\n display: flex;\n align-items: center;\n gap: 3px;\n justify-content: space-between;\n }\n .col {\n flex-direction: column;\n }\n .end {\n justify-content: flex-end;\n }\n .wrap {\n display: table;\n }\n label {\n font-size: 12px;\n color: ",";\n }\n input {\n height: 26px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 0px 6px;\n max-width: 100px;\n &.checkbox {\n font-size: 12px;\n height: 12px;\n }\n }\n\n select {\n height: 26px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 0px 6px;\n }\n button {\n height: 26px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 4px 8px;\n cursor: pointer;\n font-size: 12px;\n }\n\n .binary-operation-bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: ",";\n border-radius: 3px;\n padding: 6px;\n .binary-operation-cont {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n }\n"])),e.textColor,e.textColor,e.inputBg,e.buttonBorder,e.textColor,e.inputBg,e.buttonBorder,e.textColor,e.inputBg,e.buttonBorder,e.widgetContainer)},IZ=(0,ze.iv)(yZ||(yZ=(0,r.Z)(["\n margin: 0px;\n padding: 0px;\n height: 12px;\n width: 12px;\n cursor: pointer;\n"]))),DZ=function(e){var n=e.initial,t=e.onChange,r=(0,f.useMemo)((function(){var e;return null===(e=["$__interval","1m","5m","10m","1h","24h"])||void 0===e?void 0:e.map((function(e){return{name:e,value:e}}))}),[]);return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:r.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})},NZ=function(e){var n=e.initial,t=e.onChange,r=(0,f.useMemo)((function(){var e;return null===(e=["0.25","0.5","0.75","0.9","0.99"])||void 0===e?void 0:e.map((function(e){return{name:e,value:e}}))}),[]);return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:r.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})},MZ=function(e){var n=e.initial,t=e.onChange,r=e.opts;return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:r.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})},EZ=function(e){var n=e.initial,t=e.onChange,r=(0,f.useMemo)((function(){var e;return null===(e=["duration","duration_seconds","bytes",""])||void 0===e?void 0:e.map((function(e){return{name:e,value:e}}))}),[]);return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:r.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})},RZ=function(e){var n=e.initial,t=e.onChange,r=e.labels,i=(0,f.useMemo)((function(){return(null===r||void 0===r?void 0:r.map((function(e){return{name:e,value:e}})))||[{name:"Select Label",value:""}]}),[]);return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:i.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})};function OZ(e){var n,t={};if((null===e||void 0===e||null===(n=e.headers)||void 0===n?void 0:n.length)>0){var r,i=(0,s.Z)(e.headers);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=(0,B.Z)({},String(a.header),a.value);t=(0,l.Z)((0,l.Z)({},t),o)}}catch(u){i.e(u)}finally{i.f()}}return t}var LZ=function(e){var n,t=OZ(e),r={headers:(0,l.Z)((0,l.Z)({},t),{},{"Content-Type":"application/json"})},i={};if(null===e||void 0===e||null===(n=e.auth)||void 0===n?void 0:n.basicAuth.value){var a,o,u,c=null===e||void 0===e||null===(a=e.auth)||void 0===a||null===(o=a.fields)||void 0===o?void 0:o.basicAuth,d=(0,s.Z)(c);try{for(d.s();!(u=d.n()).done;){var f=u.value;"user"===f.name&&(i.username=f.value),"password"===f.name&&(i.password=f.value)}}catch(p){d.e(p)}finally{d.f()}}return{basicAuth:i,options:r,headers:(0,l.Z)((0,l.Z)({},t),{},{"Content-Type":"application/json"})}},VZ=function(){var e=(0,F.Z)((0,z.Z)().mark((function e(n,t,r,i,a){var o,s;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.prev=1,o=(0,l.Z)((0,l.Z)({},t),{},{auth:r}),e.next=5,q().get(n,o);case 5:(s=e.sent)&&a(s||[]),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),console.error("Error fetching labels"),console.error(e.t0);case 13:i(!1);case 14:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(n,t,r,i,a){return e.apply(this,arguments)}}();function zZ(){return(zZ=(0,F.Z)((0,z.Z)().mark((function e(n,t,r,i){var a,o,l;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.url||""===n.url){e.next=4;break}return a=LZ(n),o=a.basicAuth,l=a.options,e.next=4,VZ(t,l,o,r,i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var FZ,BZ,HZ,PZ,qZ,AZ,QZ,WZ,UZ,JZ,GZ,KZ=function(e){return(0,f.useMemo)((function(){return e.getTime()+"000000"}),[e])},YZ=function(e,n,t,r){return(0,f.useMemo)((function(){return function(e,n,t,r){return"".concat(e).concat("/loki/api/v1/series?match").concat(encodeURIComponent("[]"),"=").concat(encodeURIComponent(n),"&start=").concat(t,"&end=").concat(r)}(e,n,t,r)}),[e,t,r,n])},XZ=function(e){return(0,f.useMemo)((function(){var n,t,r,i;return null!==e&&void 0!==e&&null!==(n=e.data)&&void 0!==n&&n.data&&Array.isArray(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.data)&&(null===e||void 0===e||null===(r=e.data)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.length)>0?function(e){var n;return Array.from(new Set(null===(n=e.map((function(e){return Object.keys(e)})))||void 0===n?void 0:n.flat()))}(e.data.data):[]}),[e])},$Z=function(e,n){return(0,f.useMemo)((function(){var e;return null!==n&&void 0!==n&&n.labelOpts&&(null===(e=n.labelOpts)||void 0===e?void 0:e.filter((function(e){return"__name__"!==e})))||[]}),[e,n])},ew=function(e){var n=e.setOperations,t=e.id,r=(0,hr.Fg)(),i=(0,f.useState)([]),a=(0,u.Z)(i,2),l=a[0],s=a[1],c=(0,f.useCallback)((function(e,r){s((function(n){var t,i=(0,H.Z)(n);return i[r]=null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value,i})),n((function(n){var i=(0,H.Z)(n);return null===i||void 0===i?void 0:i.map((function(n){return n.id===t?(n.expressions[r]=e.target.value,n):n}))}))}),[]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(r)),children:[Array.isArray(l)&&(null===l||void 0===l?void 0:l.length)>0?null===l||void 0===l?void 0:l.map((function(e,r){return(0,Fe.jsxs)("div",{className:"input-group",children:[" ",(0,Fe.jsx)("input",{className:"expression-input",value:o().sanitize(e),onChange:function(e){return c(e,r)}})," ",(0,Fe.jsx)("button",{onClick:function(e){return function(e,r){s((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.filter((function(e,n){return n!==r}))})),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){var n;return e.id===t?(e.expressions=null===(n=(0,H.Z)(null===e||void 0===e?void 0:e.expressions))||void 0===n?void 0:n.filter((function(e,n){return n!==r})),e):e}))}))}(0,r)},children:"x"})," "]},r)})):null,(0,Fe.jsx)("button",{onClick:function(){s((function(e){return[].concat((0,H.Z)(e),[""])})),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.expressions=[].concat((0,H.Z)(e.expressions),[""]),e):e}))}))},children:"Add Expression"})]})},nw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)(),c=(0,f.useCallback)((function(e){l(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.expressions[0]=e.target.value,n):n}))}))}),[a]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"",onChange:c})})},tw=function(e){var n=e.setOperations,t=e.id,r=(0,hr.Fg)(),i=(0,f.useState)(""),a=(0,u.Z)(i,2),l=a[0],s=a[1],c=(0,f.useCallback)((function(e){s(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.labelValue=e.target.value,n):n}))}))}),[l]),d=(0,f.useCallback)((function(e){n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.conversion_function=e.target.value,n):n}))}))}),[]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(r)),children:[(0,Fe.jsx)("input",{value:o().sanitize(l),placeholder:"Unrap Label",onChange:c}),(0,Fe.jsx)(EZ,{initial:"",onChange:d,className:"expression-input"})]})},rw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)(),c=(0,f.useCallback)((function(e){l(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.expressions[0]=e.target.value,n):n}))}))}),[a]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"",onChange:c})})},iw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)(),c=(0,f.useCallback)((function(e){l(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.expressions[0]=e.target.value,n):n}))}))}),[a]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"{{.status_code}}",onChange:c})})},aw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,f.useState)("1"),c=(0,u.Z)(s,2),d=c[0],p=c[1],v=(0,hr.Fg)();return(0,f.useEffect)((function(){var e=[a,d].join(",");n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.after_args=","+e,n):n}))}))}),[a,d]),(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(v)),children:[(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Minimum Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(n){return e.target.value}))}})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Maximum Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(d),placeholder:"1",onChange:function(e){p((function(n){return e.target.value}))}})]})]})},ow=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)();return(0,f.useEffect)((function(){var e=[a].join(",");n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.after_args=","+e,n):n}))}))}),[a]),(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("label",{children:"Minimum Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(n){return e.target.value}))}})]})})},lw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)();return(0,f.useEffect)((function(){var e=[a].join(",");n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.after_args=","+e,n):n}))}))}),[a]),(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("label",{children:"Maximum Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(n){return e.target.value}))}})]})})},sw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)();return(0,f.useEffect)((function(){n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.prev_args=a+", ",e):e}))}))}),[a]),(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("label",{children:"Quantile"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(){return e.target.value}))}})]})})},uw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)();return(0,f.useEffect)((function(){n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.after_args=","+a,e):e}))}))}),[a]),(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("label",{children:"Nearest Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(n){return e.target.value}))}})]})})},cw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,f.useState)("$1"),c=(0,u.Z)(s,2),d=c[0],p=c[1],v=(0,f.useState)(""),h=(0,u.Z)(v,2),g=h[0],m=h[1],x=(0,f.useState)("(.*)"),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,hr.Fg)();return(0,f.useEffect)((function(){n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.after_args=', "'+a+'", "'+d+'", "'+g+'", "'+y+'"',e):e}))}))}),[a,d,g,y]),(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(w)),children:[(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Destination Label"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:a,onChange:function(e){l(e.target.value)}})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Replacement"}),(0,Fe.jsx)("input",{value:o().sanitize(d),placeholder:d,onChange:function(e){p(e.target.value)}})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Source Label"}),(0,Fe.jsx)("input",{value:o().sanitize(g),placeholder:g,onChange:function(e){m(e.target.value)}})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Regex"}),(0,Fe.jsx)("input",{value:o().sanitize(y),placeholder:y,onChange:function(e){Z(e.target.value)}})]})]})},dw=function(e){return(0,Fe.jsx)(Fe.Fragment,{})},fw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(e.range),i=(0,u.Z)(r,2),a=i[0],o=i[1],l=(0,hr.Fg)(),s=(0,f.useCallback)((function(e){var r=e.target.value;o(r),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.range=r,e):e}))}))}),[a]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(l)),children:(0,Fe.jsx)(DZ,{onChange:s,initial:a})})},pw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(e.quantile),i=(0,u.Z)(r,1)[0];(0,f.useEffect)((function(){n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.prev_args="".concat(e.quantile,","),n):n}))}))}),[e.quantile]);var a=(0,hr.Fg)(),o=(0,f.useCallback)((function(e){var r=e.target.value;n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.quantile=r,e):e}))}))}),[i]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(a)),children:(0,Fe.jsx)(NZ,{onChange:o,initial:e.quantile})})},vw=function(e){var n=e.setOperations,t=e.id,r=$Z(t,e),i=(0,f.useState)(""),a=(0,u.Z)(i,2),l=a[0],s=a[1],c=(0,f.useState)(e.labels||[""]),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useState)(","),g=(0,u.Z)(h,2),m=g[0],x=g[1],b=(0,hr.Fg)(),y=(0,f.useCallback)((function(e,n){v((function(e){var t=(0,H.Z)(e);return null===t||void 0===t?void 0:t.filter((function(e,t){return t!==n}))}))}),[p]);return(0,f.useEffect)((function(){var e=p.join('"'+m+'"');n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.after_args=', "'+l+'", "'+m+'", "'+e+'"',n):n}))}))}),[l,p,m]),(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(b)),children:[(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Destination Label"}),(0,Fe.jsx)(RZ,{initial:"",onChange:function(e){s((function(){return e.target.value}))},className:"expression-input",labels:r})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Replacement"}),(0,Fe.jsx)("input",{value:o().sanitize(m),placeholder:m,onChange:function(e){x((function(){return e.target.value}))}})]}),(0,Fe.jsx)("div",{className:"input-group col",children:null===p||void 0===p?void 0:p.map((function(e,n){return(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Source Label"}),(0,Fe.jsx)(RZ,{initial:"",onChange:function(e){return function(e,n){v((function(t){var r,i=(0,H.Z)(t);return i[n]=null===e||void 0===e||null===(r=e.target)||void 0===r?void 0:r.value,i}))}(e,n)},className:"expression-input",labels:r}),(0,Fe.jsx)("button",{onClick:function(e){return y(e,n)},children:"x"})," "]},n)}))}),(0,Fe.jsx)("div",{className:"input-group end",children:(0,Fe.jsx)("button",{onClick:function(e){v((function(e){return[].concat((0,H.Z)(e),[""])}))},children:"+ Add Source Label"})})]})},hw=function(e){var n=e.setOperations,t=e.id,r=$Z(t,e),i=(0,f.useState)(e.labels||[]),a=(0,u.Z)(i,2),l=a[0],s=a[1],c=(0,f.useState)(e.range),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useState)(e.quantile),g=(0,u.Z)(h,2),m=g[0],x=g[1],b=(0,hr.Fg)(),y=(0,f.useCallback)((function(e,r){s((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.filter((function(e,n){return n!==r}))})),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){var n;return e.id===t?(e.labels=null===(n=(0,H.Z)(null===e||void 0===e?void 0:e.labels))||void 0===n?void 0:n.filter((function(e,n){return n!==r})),e):e}))}))}),[l]),Z=(0,f.useCallback)((function(e,r){s((function(n){var t,i=(0,H.Z)(n);return i[r]=null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value,i})),n((function(n){var i=(0,H.Z)(n);return null===i||void 0===i?void 0:i.map((function(n){return n.id===t?(n.labels[r]=e.target.value,n):n}))}))}),[l]),w=(0,f.useCallback)((function(e){var r=e.target.value;x(r),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.quantile=r,e):e}))}))}),[p]),S=(0,f.useCallback)((function(e){var r=e.target.value;v(r),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.range=r,e):e}))}))}),[p]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(b)),children:[Array.isArray(l)&&(null===l||void 0===l?void 0:l.length)>0?null===l||void 0===l?void 0:l.map((function(e,n){return(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)(RZ,{initial:"",onChange:function(e){return Z(e,n)},className:"expression-input",labels:r}),(0,Fe.jsx)("button",{onClick:function(e){return y(e,n)},children:"x"})," "]},n)})):null,"Quantile Over Time"===e.header&&(0,Fe.jsx)("input",{onChange:w,value:o().sanitize(m)}),(0,Fe.jsx)("button",{onClick:function(e){s((function(e){return[].concat((0,H.Z)(e),[""])}))},children:"Add Label"}),(0,Fe.jsx)(DZ,{onChange:S,initial:p})]})},gw=function(e){var n,t=e.setOperations,r=e.id,i=e.aggrType,a=$Z(r,e),l=(0,f.useState)([""]),s=(0,u.Z)(l,2),c=s[0],d=s[1],p=(0,f.useState)(e.kValue||[]),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,hr.Fg)(),x=(0,f.useCallback)((function(e,n){d((function(e){var t=(0,H.Z)(e);return null===t||void 0===t?void 0:t.filter((function(e,t){return t!==n}))})),t((function(e){var t=(0,H.Z)(e);return null===t||void 0===t?void 0:t.map((function(e){var t;return e.id===r?(e.labels=null===(t=(0,H.Z)(null===e||void 0===e?void 0:e.labels))||void 0===t?void 0:t.filter((function(e,t){return t!==n})),e):e}))}))}),[c]),b=(0,f.useCallback)((function(e,n){d((function(t){var r,i=(0,H.Z)(t);return i[n]=null===e||void 0===e||null===(r=e.target)||void 0===r?void 0:r.value,i})),t((function(t){var i=(0,H.Z)(t);return null===i||void 0===i?void 0:i.map((function(t){return t.id===r?(t.labels[n]=e.target.value,t):t}))}))}),[c]),y=(0,f.useCallback)((function(e){g(e.target.value),t((function(n){var t=(0,H.Z)(n);return null===t||void 0===t?void 0:t.map((function(n){return n.id===r?(n.kValue=e.target.value,n):n}))}))}),[h]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(m)),children:[(n=i,("topk"===n||"bottomk"===n)&&(0,Fe.jsx)("input",{type:"number",value:o().sanitize(String(h)),placeholder:"",onChange:y})),Array.isArray(c)&&(null===c||void 0===c?void 0:c.length)>0?null===c||void 0===c?void 0:c.map((function(e,n){return(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)(RZ,{initial:"",onChange:function(e){return b(e,n)},className:"expression-input",labels:a}),(0,Fe.jsx)("button",{onClick:function(e){return x(e,n)},children:"x"})," "]},n)})):null,(0,Fe.jsx)("button",{onClick:function(e){d((function(e){return[].concat((0,H.Z)(e),[""])})),t((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===r?(e.labels=(0,H.Z)(c),e):e}))}))},children:"Add Label"})]})},mw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)({label:"",operator:"equals",value:""}),i=(0,u.Z)(r,2),a=i[0],s=i[1],c=(0,hr.Fg)(),d=(0,f.useMemo)((function(){return[{name:"=",value:"equals"},{name:"!=",value:"not_equals"},{name:"=~",value:"regex_equals"},{name:"!~",value:"regex_not_equals"},{name:">",value:"more"},{name:"<",value:"less"},{name:">=",value:"more_equals"},{name:"<=",value:"less_equals"}]}),[]);(0,f.useEffect)((function(){n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.labelFilter=(0,l.Z)({},a),e):e}))}))}),[a]);var p=(0,f.useCallback)((function(e,n){s((function(t){return(0,l.Z)((0,l.Z)({},t),{},(0,B.Z)({},n,e.target.value))}))}),[]);return"No Pipeline Errors"!==e.header?(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(c)),children:[(0,Fe.jsx)("input",{value:o().sanitize(a.label),placeholder:"Text Filter",onChange:function(e){return p(e,"label")}}),(0,Fe.jsx)("select",{defaultValue:"equals",onChange:function(e){return p(e,"operator")},children:d.map((function(e,n){return(0,Fe.jsx)("option",{value:o().sanitize(e.value),children:e.name},n)}))}),(0,Fe.jsx)("input",{value:o().sanitize(a.value),placeholder:"Text Filter",onChange:function(e){return p(e,"value")}})]}):null},xw=function(e){var n=e.setOperations,t=e.id,r=e.binaryOperation,i=(0,hr.Fg)(),a=(0,f.useState)(r||{value:0,bool:!1}),s=(0,u.Z)(a,2),c=s[0],d=s[1],p=(0,f.useCallback)((function(e,r){var i="value"===r?e.target.value:!!e.target.checked;d((function(e){return(0,l.Z)((0,l.Z)({},e),{},(0,B.Z)({},r,i))})),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.binaryOperation=(0,l.Z)((0,l.Z)({},e.binaryOperation),{},(0,B.Z)({},r,i)),e):e}))}))}),[c]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(i)),children:[(0,Fe.jsx)("input",{value:o().sanitize(c.value),placeholder:"Value",onChange:function(e){return p(e,"value")}}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Boolean"}),(0,Fe.jsx)("input",{type:"checkbox",className:"checkbox",checked:c.bool||!1,value:o().sanitize("Boolean"),onChange:function(e){return p(e,"bool")}})]})]})},bw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)(),c=(0,f.useCallback)((function(e){l(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.filterText=e.target.value,n):n}))}))}),[t,n]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"Text Filter",onChange:c})})},yw=["rate","rate_counter","count_over_time","sum_over_time","bytes_rate","bytes_over_time","absent_over_time"],Zw=["avg_over_time","max_over_time","min_over_time","first_over_time","last_over_time","stdvar_over_time","stddev_over_time","quantile_over_time",""],ww=["sum","min","max","avg","stddev","stdvar","count"],Sw=["topk","bottomk"],jw=function(e,n){return yw.includes(e)?(0,Fe.jsx)(fw,(0,l.Z)({},n)):Zw.includes(e)?(0,Fe.jsx)(hw,(0,l.Z)({},n)):null},kw=function(e,n,t){switch(e){case"formats":return function(e,n){switch(e){case"json":return(0,Fe.jsx)(ew,(0,l.Z)({},n));case"pattern":return(0,Fe.jsx)(nw,(0,l.Z)({},n));case"regexp":return(0,Fe.jsx)(rw,(0,l.Z)({},n));case"line_format":return(0,Fe.jsx)(iw,(0,l.Z)({},n));case"unwrap":return(0,Fe.jsx)(tw,(0,l.Z)({},n));default:return(0,Fe.jsx)(dw,(0,l.Z)({},n))}}(n,t);case"range_functions":default:return jw(n,t);case"aggregations":return function(e,n){return ww.includes(e)||Sw.includes(e)?(0,Fe.jsx)(gw,(0,l.Z)((0,l.Z)({},n),{},{aggrType:e})):void 0}(n,t);case"line_filters":return(0,Fe.jsx)(bw,(0,l.Z)({},t));case"label_filters":return(0,Fe.jsx)(mw,(0,l.Z)({},t));case"binary_operations":return(0,Fe.jsx)(xw,(0,l.Z)({},t));case"functions":return function(e,n){return"histogram_quantile"===e?(0,Fe.jsx)(pw,(0,l.Z)({},n)):"clamp"===e?(0,Fe.jsx)(aw,(0,l.Z)({},n)):"clamp_max"===e?(0,Fe.jsx)(lw,(0,l.Z)({},n)):"clamp_min"===e?(0,Fe.jsx)(ow,(0,l.Z)({},n)):"quantile"===e?(0,Fe.jsx)(sw,(0,l.Z)({},n)):"round"===e?(0,Fe.jsx)(uw,(0,l.Z)({},n)):"label_replace"===e?(0,Fe.jsx)(cw,(0,l.Z)({},n)):"label_join"===e?(0,Fe.jsx)(vw,(0,l.Z)({},n)):jw(e,n)}(n,t)}},Cw=t(3860),Tw=t(32519),_w=t(70042),Iw=t(38499),Dw=(t(22252),t(63185),t(41434)),Nw=(0,ze.F4)(FZ||(FZ=(0,r.Z)(["\n from {\n opacity: 0;\n }\n"]))),Mw=(0,ze.F4)(BZ||(BZ=(0,r.Z)(["\n to {\n opacity: 0;\n }\n"]))),Ew=((0,ze.iv)(qZ||(qZ=(0,r.Z)(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n"]))),function(e){return(0,ze.iv)(AZ||(AZ=(0,r.Z)(["\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 6px;\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-top:4px;\n margin: 3px;\n"])),e.inputBg,e.textColor,e.buttonBorder)}),Rw=(0,ze.iv)(QZ||(QZ=(0,r.Z)(["\n animation: "," 0.15s ease-out;\n"])),Nw),Ow=(0,ze.iv)(WZ||(WZ=(0,r.Z)(["\n animation: "," 0.2s ease-out forwards;\n"])),Mw),Lw=function(e,n){var t=e.hover;e.disabled;return Vs()(function(e){return(0,ze.iv)(UZ||(UZ=(0,r.Z)(["\n // color:white;\n background: "," !important;\n color: "," !important;\n border-radius: 3px;\n padding: 0.275rem 0.525rem;\n &:hover {\n background: "," !important;\n }\n"])),e.inputBg,e.textColor,e.widgetContainer)}(n),(0,B.Z)({},function(e){return(0,ze.iv)(JZ||(JZ=(0,r.Z)(["\n // color: white !important;\n color: ",";\n background: "," !important;\n"])),e.textColor,e.widgetContainer)}(n),t))},Vw=function(e,n){return Vs()(Lw(e,n),function(e){return(0,ze.iv)(PZ||(PZ=(0,r.Z)(["\n position: relative;\n font-size: 12px;\n color: "," !important;\n background: "," !important;\n &::after {\n // content: ;\n position: absolute;\n width: 4px;\n right: 0.625rem;\n }\n &:hover {\n background: "," !important;\n }\n"])),e.textColor,e.inputBg,e.widgetContainer)}(n))},zw=function(e,n){var t;return Vs()(function(e){return(0,ze.iv)(HZ||(HZ=(0,r.Z)(["\n font-family: sans-serif;\n font-size: 12px;\n user-select: none;\n color: "," !important;\n background: "," !important;\n box-shadow: 1px 1px 20px 1px rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n padding: 6px;\n min-width: 10rem;\n"])),e.textColor,e.inputBg)}(n),(t={},(0,B.Z)(t,Rw,"opening"===e.state),(0,B.Z)(t,Ow,"closing"===e.state),t))},Fw=function(e){var n=e.theme;return(0,Fe.jsx)(Cw.W,(0,l.Z)((0,l.Z)({},e),{},{menuClassName:function(e){return zw(e,n)},itemProps:{className:function(e){return Vw(e,n)}}}))},Bw={Aggregations:["Sum","Min","Max","Avg","Stddev","Stdvar","Count","Topk","Bottomk"],"Range Functions":["Rate","Rate Counter","Count Over Time","Sum Over Time","Bytes Rate","Bytes Over Time","Absent Over Time","Avg Over Time","Max Over Time","Min Over Time","First Over Time","Last Over Time","Quantile Over Time"],Formats:["Json","Logfmt","Regexp","Pattern","Unpack","Line Format","Unwrap"],"Binary Operations":["Add Scalar","Subtract Scalar","Multiply by scalar","Divide by scalar","Modulo by scalar","Exponent","Equal To","Not Equal To","Greater Than","Less Than","Greater Or Equal To","Less Or Equal To","Binary Operation With Query"],"Label Filters":["Label Filter Expression","IP Label Filter Expression","No Pipeline Errors"],"Line Filters":["Line Contains","Line Does Not Contain","Line Contains Case Insensitive","Line Does Not Contain Case Insensitive","Line Contains Regex Match","Line Does Not Match Regex","IP Line Filter Expression","IP Line Not Filter Expression"],Trigonometric:["Acos","Acosh","Asin","Asinh","Atan","Atanh","Cos","Cosh","Sin","Sinh","Tan","Tanh"],"Time Functions":["Day Of Month","Day Of Week","Days In Month"],Functions:["Histogram Quantile","Label Replace","Ln","absent","Ceil","Clamp","Clamp max","Clamp min","Deg","Exp","Floor","Group","Hour","Label join","Log10","Log2","Minute","Pi","Quantile","Rad","Round","Scalar","Sgn","Sort","Sort desc","Sqrt","Stddev","Time","Timestamp","Vector","Year"]};var Hw=function(e){return(0,ze.iv)(GZ||(GZ=(0,r.Z)(["\n margin-bottom: 6px;\n .szh-menu {\n background: "," !important;\n color: "," !important;\n }\n .szh-menu__item {\n &:hover {\n background: "," !important;\n }\n }\n"])),e.inputBg,e.textColor,e.widgetContainer)};function Pw(e){var n=e.menuClick,t=(0,f.useMemo)((function(){return Object.keys(Bw)}),[]),r=(0,hr.Fg)();return(0,Fe.jsx)(Tw.v,{className:(0,ze.cx)(Hw(r)),menuButton:(0,Fe.jsxs)(_w.j,{className:(0,ze.cx)(Ew(r)),children:[" ",(0,Fe.jsx)(Dw.Z,{style:{height:"13px",width:"13px"}}),(0,Fe.jsx)("span",{style:{fontSize:"12px",fontFamily:"sans-serif"},children:"Add Operator"})]}),children:null===t||void 0===t?void 0:t.map((function(e,t){var i;return(0,Fe.jsx)(Fw,{label:e,theme:r,children:null===(i=Bw[e])||void 0===i?void 0:i.map((function(t,r){return(0,Fe.jsx)(Iw.s,{onClick:function(r){return n(r,t,e)},style:{fontSize:"12px"},children:t},r)}))},t)}))})}function qw(e){var n,t=e.opType,r=e.onOperationSelect,i=(0,hr.Fg)();return(0,Fe.jsx)(Tw.v,{className:(0,ze.cx)(Hw(i)),menuButton:(0,Fe.jsx)(ga.Z,{style:{height:"13px",width:"13px",margin:"0px 12px",cursor:"pointer"}}),children:null===(n=Bw[t])||void 0===n?void 0:n.map((function(e,n){return(0,Fe.jsx)(Iw.s,{onClick:function(n){return r(n,e)},style:{fontSize:"12px"},children:e},n)}))})}function Aw(e){var n=e.id,t=e.opType,r=e.header,i=e.removeItem,a=e.index,o=e.setOperations,s=(0,hr.Fg)(),c=(0,f.useState)(r),d=(0,u.Z)(c,2),p=d[0],v=d[1];(0,f.useEffect)((function(){v(r)}),[r,v]);var h=(0,f.useCallback)((function(e,t){v(t),o((function(e){var r=(0,H.Z)(e);return null===r||void 0===r?void 0:r.map((function(e){return e.id===n?e=(0,l.Z)((0,l.Z)({},e),{},{header:t,name:t.toLowerCase().split(" ").join("_")}):e}))}))}),[p]),g=function(e){var n,t;return(null===e||void 0===e||null===(n=e.toLowerCase())||void 0===n||null===(t=n.split(" "))||void 0===t?void 0:t.join("_"))||""};return r&&"string"===typeof r?(0,Fe.jsxs)("div",{className:(0,ze.cx)(TZ(s)),children:[(0,Fe.jsxs)("div",{className:"operation-header",children:[(0,Fe.jsx)("span",{children:p}),(0,Fe.jsxs)("div",{className:"operation-tools",children:[(0,Fe.jsx)(qw,{opType:t,onOperationSelect:h}),(0,Fe.jsx)(br.Z,{className:(0,ze.cx)(IZ),onClick:function(e){return i(a)}})]})]}),(0,Fe.jsx)("div",{className:"operation-body",children:kw(g(t),g(r),(0,l.Z)({},e))})]}):null}var Qw,Ww="card",Uw=function(e){return{border:"1px solid ".concat(e.buttonBorder),backgroundColor:"".concat(e.inputBg),fontSize:"12px",cursor:"move",display:"flex",margin:"4px",borderRadius:"3px"}},Jw=function(e){var n=e.id,t=e.header,r=e.rate,i=e.opType,a=e.index,o=e.body,s=e.moveItem,c=e.removeItem,d=e.kValue,p=e.quantile,v=e.labelFilter,h=e.filterText,g=e.lineFilter,m=e.conversion_function,x=e.labelValue,b=e.labelOpts,y=e.binaryOperation,Z=(0,f.useRef)(null),w=(0,hr.Fg)(),S=(0,kZ.L)({accept:Ww,collect:function(e){return{handlerId:e.getHandlerId()}},hover:function(e,n){var t;if(Z.current){var r=e.index,i=a;if(r!==i){var o=null===(t=Z.current)||void 0===t?void 0:t.getBoundingClientRect(),l=(o.right-o.left)/2,u=n.getClientOffset().x-o.left;ri&&u>l||(s(r,i),e.index=i)}}}}),j=(0,u.Z)(S,2),k=j[0].handlerId,C=j[1],T=(0,CZ.c)({type:Ww,item:function(){return{id:n,index:a}},collect:function(e){return{isDragging:e.isDragging()}}}),_=(0,u.Z)(T,2),I=_[0].isDragging?.5:1;return(0,_[1])(C(Z)),(0,Fe.jsx)("div",{ref:Z,style:(0,l.Z)((0,l.Z)({},Uw(w)),{},{opacity:I}),"data-handler-id":k,children:(0,Fe.jsx)(Aw,(0,l.Z)((0,l.Z)({},e),{},{rate:r,id:n,header:t,opType:i,body:o,index:a,kValue:d,quantile:p,labelFilter:v,binaryOperation:y,conversion_function:m,labelValue:x,lineFilter:g,labelOpts:b,filterText:h,removeItem:c}))})},Gw=(0,ze.iv)(Qw||(Qw=(0,r.Z)(["\n width: 100%;\n display: flex;\n flex-wrap:wrap;\n"]))),Kw=function(e){var n=e.operations,t=e.setOperations,r=(0,f.useCallback)((function(e,n){t((function(t){return jZ()(t,{$splice:[[e,1],[n,0,t[e]]]})}))}),[]),i=(0,f.useCallback)((function(e){t((function(n){return jZ()(n,{$splice:[[e,1]]})}))}),[]),a=(0,f.useCallback)((function(n,t){return(0,f.createElement)(Jw,(0,l.Z)((0,l.Z)({},e),{},{key:n.id,index:t,id:n.id,opType:n.opType,header:n.header,kValue:n.kValue,quantile:n.quantile,labelValue:n.labelValue,conversion_function:n.conversion_function,binaryOperation:n.binaryOperation,labelOpts:n.labelOpts,lineFilter:n.lineFilter,body:n.body||(0,Fe.jsx)(Fe.Fragment,{}),moveItem:r,removeItem:i}))}),[]);return(0,Fe.jsx)(ZZ.W,{backend:wZ.PD,children:(0,Fe.jsx)("div",{className:(0,ze.cx)(Gw),children:n.map((function(e,n){return a(e,n)}))})})},Yw=function(e){var n=e.mainTheme,t=e.resetLabelsState;return(0,Fe.jsxs)("div",{className:(0,ze.cx)(Yy(n)),onClick:t,children:[(0,Fe.jsx)(Dw.Z,{className:(0,ze.cx)(Xy(n)),fontSize:"small",style:{height:"14px",width:"14px"}})," ",(0,Fe.jsx)("small",{children:"Add Labels"})]})},Xw=t(13074),$w=t(53052),eS=(0,f.forwardRef)((function(e,n){var t=e.selectOpts,r=e.mainTheme,i=e.minWidth,a=e.onChange,o=e.defaultValue,l=e.type,s=e.keyVal,c=e.objId,d=e.labelsLength,p=(0,hr.LS)(o,l,s),v=(0,f.useState)(p||$w.NQ),h=(0,u.Z)(v,2),g=h[0],m=h[1],x=(0,hr.sd)(l,s);(0,f.useEffect)((function(){(0,Ny.j6)(m,l,s)}),[d]);return(0,Fe.jsx)(Wy.ZP,{id:c,isMulti:x,options:t,styles:Uy(r,i),value:g,ref:n,defaultValue:p,theme:function(e){return(0,Ny.Pu)(e,r)},onChange:function(e){m((function(){return e})),a({value:e,id:c})}})}));var nS=function(e){var n=e.keyVal,t=e.labelOpts,r=e.labelAdd,a=e.labelRemove,s=e.onChange,c=e.labelValuesLength,d=e.id,p=e.dataSourceId,v=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useRef)(null),m=(0,hr.Fg)(),x=(0,f.useState)(n),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useState)(t[0]||{label:"Select Option",value:""}),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=function(e,n){var t=(0,i.v9)((function(e){return e})),r=t.start,a=t.stop,o=(0,i.v9)((function(e){return e.dataSources})),l=(0,f.useState)(!1),s=(0,u.Z)(l,2),c=s[0],d=s[1],p=(0,f.useState)([]),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,f.useMemo)((function(){return o.find((function(n){return n.id===e}))}),[o,e]),x=(0,hr.mm)(r),b=(0,hr.uk)(a),y=(0,f.useMemo)((function(){return(0,Ny.c8)(m.url,n,x,b)}),[m.url,x,b,n]),Z=(0,hr.QL)(h);return(0,f.useEffect)((function(){return n&&""!==n&&(0,Ny.jY)(m,y,d,g),function(){g([]),d(!1)}}),[y,m]),{logsResponse:Z,loading:c}}(p,j.value),T=C.logsResponse,_=(0,f.useState)({label:"=",value:"equals"}),I=(0,u.Z)(_,2),D=I[0],N=I[1],M=(0,f.useMemo)((function(){return"regexequals"===D.value||"regexexclude"===D.value}),[D.value]);return c>0?(0,Fe.jsxs)("div",{id:d,className:(0,ze.cx)(Jy),children:[(0,Fe.jsx)(eS,{ref:v,type:"label",isMulti:!1,defaultValue:o().sanitize(n.label),selectOpts:t,mainTheme:m,onChange:function(e){var n=e.value,t=e.id;k((function(){return{value:null===n||void 0===n?void 0:n.value,label:null===n||void 0===n?void 0:n.value}}));var r=JSON.parse(JSON.stringify(y)),i=(0,l.Z)((0,l.Z)({},r),{},{label:null===n||void 0===n?void 0:n.label,value:n.value,id:t});s(i),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{label:null===n||void 0===n?void 0:n.value})}))},keyVal:n,objId:d,minWidth:100,labelsLength:c}),(0,Fe.jsx)(eS,{ref:h,type:"operator",isMulti:!1,defaultValue:o().sanitize(n.operator),selectOpts:$w.bn,keyVal:n,mainTheme:m,onChange:function(e){var n=e.value,t=e.id,r=JSON.parse(JSON.stringify(y)),i=(0,l.Z)((0,l.Z)({},r),{},{operator:null===n||void 0===n?void 0:n.value,id:t});s(i),N((function(){return(0,l.Z)({},n)})),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{operator:null===n||void 0===n?void 0:n.value})}))},objId:d,minWidth:60,labelsLength:c}),(0,Fe.jsxs)("div",{className:(0,ze.cx)(Gy),children:[(0,Fe.jsx)(eS,{ref:g,type:"value",isMulti:M,defaultValue:o().sanitize(n.values),selectOpts:T,keyVal:n,mainTheme:m,onChange:function(e){var n=e.value,t=e.id,r=[],i=null!==n?n:{label:"",value:""};r=M&&Array.isArray(i)?null===i||void 0===i?void 0:i.map((function(e){return e.value})):[i.value];var a=JSON.parse(JSON.stringify(y)),o=(0,l.Z)((0,l.Z)({},a),{},{values:r,id:t});s(o),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{values:r})}))},objId:d,minWidth:250,labelsLength:c}),(0,Fe.jsx)(Xw.Z,{className:(0,ze.cx)(Ky(m)),style:{height:"14px",width:"14px"},onClick:function(){null!==v&&void 0!==v&&v.current&&null!==h&&void 0!==h&&h.current&&null!==g&&void 0!==g&&g.current&&a(n.id)}}),(0,Fe.jsx)(Dw.Z,{className:(0,ze.cx)(Ky(m)),style:{height:"14px",width:"14px"},onClick:r})]})]}):null},tS=function(e,n){var t=(0,i.v9)((function(e){return e})),r=t.start,a=t.stop,o=(0,i.v9)((function(e){return e.dataSources})),l=(0,f.useState)({}),s=(0,u.Z)(l,2),c=s[0],d=s[1],p=(0,f.useState)(!1),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=function(e,n){return(0,f.useMemo)((function(){return e.find((function(e){return e.id===n}))}),[e,n])}(o,e),x=KZ(r),b=KZ(a),y=YZ(m.url,n,x,b);return(0,f.useEffect)((function(){""!==n&&"{}"!==n&&function(e,n,t,r){zZ.apply(this,arguments)}(m,y,g,d)}),[y,m,g,d,n]),{loading:h,labelSeries:XZ(c)}},rS=function(e){return{result:"",range:"",setRange:function(e){this.range=e},setRate:function(){this.result+=" [".concat(this.range,"])")},setFn:function(n){this.result="".concat(e,"(").concat(n)},build:function(e){return this.setFn(e),this.setRate(),this.result}}},iS=function(e){return{result:"",range:"",quantile:.5,labels:[],labelsString:"",setQuantile:function(e){this.quantile=e},setRange:function(e){this.range=e},setRate:function(){this.result+=" [".concat(this.range,"])")},setFn:function(n){this.result="".concat(e,"(").concat(n)},build:function(e){return this.setFn(e),this.setRate(),this.result}}},aS=function(e){return{result:"",range:"",labels:[],labelsString:"",quantile:.99,setFn:function(n){this.result="quantile_over_time"!==e?"".concat(e,"(").concat(n):"".concat(e,"(").concat(this.quantile,", ").concat(n)},updRange:function(e){this.range=e},setRange:function(){this.result+="[".concat(this.range,"])")},addLabel:function(e){this.labels=[].concat((0,H.Z)(this.labels),[e])},setQuantile:function(e){this.quantile=e},setLabels:function(){this.labelsString=this.labels.join(",")},build:function(e){return this.setFn(e),this.setRange(),this.labels.length>0?(this.setLabels(),this.result+=" by(".concat(this.labelsString,")")):this.result}}},oS=function(e){return{result:"",labels:[],labelString:"",aggrType:"by",aggrTypeString:"",setAggrType:function(e){this.aggrType=e},addLabel:function(e){this.labels=[].concat((0,H.Z)(this.labels),[e])},setLabels:function(){this.labelString=this.labels.join(",")},setAggrTypeString:function(){this.aggrTypeString="".concat(this.aggrType,"(").concat(this.labelString,")")},setFn:function(n){this.result="".concat(e,"(").concat(n,")")},build:function(n){return this.setFn(n),this.labels.length>0&&(this.setLabels(),this.setAggrTypeString(),this.result="".concat(e," ").concat(this.aggrTypeString," (").concat(n,")")),this.result}}},lS=function(e){return{result:"",labels:[],labelString:"",kvalue:5,aggrType:"by",aggrTypeString:"",setAggrType:function(e){this.aggrType=e},setAggrTypeString:function(){this.aggrTypeString="".concat(this.aggrType,"(").concat(this.labelString,")")},addLabel:function(e){this.labels=[].concat((0,H.Z)(this.labels),[e])},setLabels:function(){this.labelString=this.labels.join(",")},setKValue:function(e){this.kvalue=e},setFn:function(n){this.result="".concat(e," (").concat(this.kvalue,", ").concat(n,")")},build:function(n){return this.setFn(n),this.labels.length>0&&(this.setLabels(),this.setAggrTypeString(),this.result="".concat(e," ").concat(this.aggrTypeString," (").concat(this.kvalue,", ").concat(n,")")),this.result}}},sS={line_contains:"|= `",line_does_not_contain:"!= `",line_contains_regex_match:"|~ `",line_does_not_match_regex:"!~ `",line_contains_case_insensitive:"|~ `(?i)",line_does_not_contain_case_insensitive:"!~ `(?i)",ip_line_filter_expression:"|= ip(`",ip_line_not_filter_expression:"!= ip(`"},uS=function(e){return e.includes("ip_")},cS=function(e){return{result:"",filterText:"",lineFilter:sS[e],setFilterText:function(e){this.filterText=e},setFn:function(e){this.result="".concat(e," ").concat(this.lineFilter).concat(this.filterText)},closeFn:function(){var n=uS(e)?"`)":"`";this.result+="".concat(n)},build:function(e){return this.setFn(e),this.closeFn(),this.result}}},dS={equals:"=",not_equals:"!=",regex_equals:"=~",regex_not_equals:"!~",more:">",less:"<",more_equals:">=",less_equals:"<="},fS=function(e){return{result:"",label:"",operator:"=",value:"",labelValueString:"",setLabel:function(e){this.label=e},setOperator:function(e){this.operator=dS[e]},setValue:function(e){this.value=e},setFilterType:function(n){return uS(e)?"ip(`"+n+"`)":"`"+n+"`"},setLabelValueString:function(){this.labelValueString=" "+this.label+" "+this.operator+this.setFilterType(this.value)},setFn:function(n){"no_pipeline_errors"!==e?(this.setLabelValueString(),this.result="".concat(n," |").concat(this.labelValueString)):this.result=n+" | __error__=``"},build:function(e){return this.setFn(e),this.result}}},pS={add_scalar:"+",subtract_scalar:"-",multiply_by_scalar:"*",divide_by_scalar:"/",modulo_by_scalar:"%",exponent:"^",equal_to:"==",not_equal_to:"!=",greater_than:">",less_than:"<",greater_or_equal_to:">=",less_or_equal_to:"<=",binary_operation_with_query:""},vS=function(e){return{result:"",value:"",bool:!1,boolString:"",setValue:function(e){this.value=e},setBoolean:function(e){this.bool=e},setBooleanString:function(){this.boolString=this.bool?"bool ":""},setFn:function(n){this.result="".concat(n," ").concat(pS[e]," ").concat(this.boolString).concat(this.value)},build:function(e){return this.setBooleanString(),this.setFn(e),this.result}}},hS=function(e){return{result:"",setFn:function(n){this.result="".concat(e,"(").concat(n,")")},build:function(e){return this.setFn(e),this.result}}},gS=function(e){return{result:"",setFn:function(n){this.result="".concat(e,"(").concat(n,")")},build:function(e){return this.setFn(e),this.result}}},mS=function(e){return{result:"",prev_args:"",after_args:"",setPrevArgs:function(e){this.prev_args=e},setAfterArgs:function(e){this.after_args=e},setFn:function(n){this.result="".concat(e,"(").concat(this.prev_args).concat(n).concat(this.after_args,")")},setEditableParams:function(e){"string"===typeof(null===e||void 0===e?void 0:e.after_args)&&""!==(null===e||void 0===e?void 0:e.after_args)&&this.setAfterArgs(e.after_args),"string"===typeof(null===e||void 0===e?void 0:e.prev_args)&&""!==(null===e||void 0===e?void 0:e.prev_args)&&this.setPrevArgs(e.prev_args)},build:function(e){return this.setFn(e),this.result}}},xS={json:function(){return{result:"",expressions:[],expressionsString:"",setJSON:function(e){return""!==e&&(this.result+=e+" | json"),this.result},addExpression:function(e){this.expressions=[].concat((0,H.Z)(this.expressions),[e])},setExpressions:function(){this.expressionsString=this.expressions.join(" ")},build:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.setJSON(e),this.expressions.length>0?(this.setExpressions(),this.result+" "+this.expressionsString):this.result}}},logfmt:function(){return{result:"",setLogFmt:function(){return this.result+=" | logfmt",this.result},build:function(e){return this.result+=e+this.setLogFmt(),this.result}}},unpack:function(){return{result:"",setUnPack:function(){return this.result+=" | unpack",this.result},build:function(e){return this.result+=e+this.setUnPack(),this.result}}},regexp:function(){return{result:"",expression:"",setRegex:function(e){this.result=e+" | regexp"},setExpression:function(e){this.expression=e||""},setText:function(){this.result+=" `"+this.expression+"`"},build:function(e){return this.setRegex(e),this.setText(),this.result}}},pattern:function(){return{result:"",expression:"",setPattern:function(e){this.result=e+" | pattern"},setExpression:function(e){this.expression=e||""},setText:function(){this.result+=" `"+this.expression+"`"},build:function(e){return this.setPattern(e),this.setText(),this.result}}},line_format:function(){return{result:"",expression:"",setLine:function(e){this.result=e+" | line_format"},setExpression:function(e){this.expression=e||""},setText:function(){this.result+=" `"+this.expression+"`"},build:function(e){return this.setLine(e),this.setText(),this.result}}},unwrap:function(){return{result:"",labelValue:"",conversion_function:"",setLabelValue:function(e){this.labelValue=e},setConversionFn:function(e){this.conversion_function=e},setConversionFnString:function(){this.labelValue=this.conversion_function+"("+this.labelValue+")"},setUnwrapFmt:function(){this.result=" | unwrap ",""!==this.labelValue&&""===this.conversion_function&&(this.result+=" ".concat(this.labelValue)),""!==this.conversion_function&&(this.setConversionFnString(),this.result+="".concat(this.labelValue))},build:function(e){return this.setUnwrapFmt(),e+this.result}}}},bS=function(e){return{range:rS(e),label_range:aS(e)}},yS=function(e){return{aggr:oS(e),aggr_btk:lS(e)}},ZS=function(e){return{metric_functions:gS(e),editable_functions:mS(e)}},wS=["json","logfmt","regexp","pattern","unpack","line_format","label_format","unwrap"],SS=["duration","duration_seconds","bytes",""],jS=["rate","rate_counter","count_over_time","sum_over_time","bytes_rate","bytes_over_time","absent_over_time"],kS=["changes","irate","increase","idelta","delta","holt winters","predict linear","quantile over time","deriv","resets","avg_over_time","min_over_time","max_over_time","last_over_time","present_over_time","stddev_over_time"],CS=["avg_over_time","max_over_time","min_over_time","first_over_time","last_over_time","stdvar_over_time","stddev_over_time","quantile_over_time"],TS=["line_contains","line_does_not_contain","line_contains_regex_match","line_does_not_match_regex","line_contains_case_insensitive","line_does_not_contain_case_insensitive","ip_line_filter_expression","ip_line_not_filter_expression"],_S=["add_scalar","subtract_scalar","multiply_by_scalar","divide_by_scalar","modulo_by_scalar","exponent","equal_to","not_equal_to","greater_than","less_than","greater_or_equal_to","less_or_equal_to","binary_operation_with_query"],IS=["no_pipeline_errors","ip_label_filter_expression","label_filter_expression"],DS=["acos","acosh","asin","asinh","atan","atanh","cos","cosh","sin","sinh","tan","tanh"],NS=["sum","min","max","avg","stddev","stdvar","count","count_values"],MS=["topk","bottomk"],ES=["day_of_month","day_of_week","days_in_month"],RS=["ln","absent","ceil","deg","exp","floor","group","hour","log10","log2","minute","pi","rad","scalar","sgn","sort","sort_desc","sqrt","stddev","time","timestamp","vector","year"],OS=["histogram_quantile","label_replace","clamp","clamp_max","clamp_min","label_join","quantile","round"],LS=function(e,n){return""===e?JSON.parse(JSON.stringify(n)):JSON.parse(JSON.stringify(e))},VS=function(e,n){Array.isArray(n)&&(null===n||void 0===n?void 0:n.length)>0&&n.forEach((function(n){e.addLabel(n)}))},zS=function(e,n){var t="";if(e&&"string"===typeof e){var r=(0,Ny.lo)(JSON.parse(e));(null===n||void 0===n?void 0:n.length)>0?n.forEach((function(e){if(wS.includes(e.name)){var n=LS(t,r);if(t=xS[e.name](),"unwrap"===e.name&&(""!==(null===e||void 0===e?void 0:e.labelValue)&&"string"===typeof e.labelValue&&t.setLabelValue(e.labelValue),""!==(null===e||void 0===e?void 0:e.conversion_function)&&"string"===typeof e.conversion_function&&SS.includes(e.conversion_function)&&t.setConversionFn(e.conversion_function)),"json"===e.name)!function(e,n){Array.isArray(n)&&n.length>0&&n.forEach((function(n){e.addExpression(n)}))}(t,e.expressions);else if(i=e.name,["line_format","regexp","pattern"].includes(i)){""!==(0,u.Z)(e.expressions,1)[0]&&t.setExpression(e.expressions[0])}t=t.build(n)}var i,a,o,l,s,c;if(jS.includes(e.name)){var d=LS(t,r);(t=bS(e.name).range).setRange(e.range||"$__interval"),t=t.build(d)}if(kS.includes(e.name)){var f=LS(t,r);(t=(a=e.name,{range_function:iS(a)}).range_function).setRange(e.range||"$__interval"),t=t.build(f)}if(RS.includes(e.name)){var p=LS(t,r);t=(t=ZS(e.name).metric_functions).build(p)}if(OS.includes(e.name)){var v=LS(t,r);(t=ZS(e.name).editable_functions).setEditableParams(e),t=t.build(v)}if(DS.includes(e.name)){var h=LS(t,r);t=function(e){return{trigonometric:(n=e,{result:"",setFn:function(e){this.result="".concat(n,"(").concat(e,")")},build:function(e){return this.setFn(e),this.result}})};var n}(e.name).trigonometric,t=t.build(h)}if(CS.includes(e.name)){var g=LS(t,r);t=bS(e.name).label_range,VS(t,e.labels),t.updRange(e.range||"$__interval"),"quantile_over_time"===e.name&&t.setQuantile(e.quantile),t=t.build(g)}if(NS.includes(e.name)){var m=LS(t,r);t=yS(e.name).aggr,VS(t,e.labels),t=t.build(m)}if(MS.includes(e.name)){var x=LS(t,r);t=yS(e.name).aggr_btk,VS(t,e.labels),function(e,n){e.setKValue(n)}(t,e.kValue),t=t.build(x)}if(TS.includes(e.name)){var b=LS(t,r);(t=(o=e.name,{line_filter:cS(o)}).line_filter).setFilterText(e.filterText||""),t=t.build(b)}if(IS.includes(e.name)&&null!==e&&void 0!==e&&e.labelFilter){var y,Z,w,S,j=LS(t,r);(t=null===(l=e.name,y={label_filter:fS(l)})||void 0===y?void 0:y.label_filter).setLabel((null===e||void 0===e||null===(Z=e.labelFilter)||void 0===Z?void 0:Z.label)||""),t.setOperator((null===e||void 0===e||null===(w=e.labelFilter)||void 0===w?void 0:w.operator)||"equals"),t.setValue((null===e||void 0===e||null===(S=e.labelFilter)||void 0===S?void 0:S.value)||""),t=t.build(j)}if(ES.includes(e.name)){var k,C=LS(t,r);t=(t=null===(s=e.name,k={time_function:hS(s)})||void 0===k?void 0:k.time_function).build(C)}if(_S.includes(e.name)&&null!==e&&void 0!==e&&e.binaryOperation){var T,_,I,D=LS(t,r);(t=null===(c=e.name,T={binary_operation:vS(c)})||void 0===T?void 0:T.binary_operation).setValue((null===e||void 0===e||null===(_=e.binaryOperation)||void 0===_?void 0:_.value)||1),t.setBoolean((null===e||void 0===e||null===(I=e.binaryOperation)||void 0===I?void 0:I.bool)||!1),t=t.build(D)}})):t=r}return t},FS=function(e){var n=e.dataSourceId,t=e.logsResponse,r=e.theme,i=e.setFinalQuery,a=e.setLabelsString,o=e.labelValueString,s=e.setLabelValueString,c=e.setBuilders,d=e.index,p=(0,f.useState)(e.labelValuesState||[(0,l.Z)({},$w.eW)]),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=function(e){g((function(n){var t=JSON.parse(JSON.stringify(n))||[];return null===t||void 0===t?void 0:t.filter((function(n){return n.id!==e}))})),s((function(n){var t,r=[];(null===n||void 0===n?void 0:n.length)>1&&(r=JSON.parse(n||JSON.stringify("[]")));var i=null===(t=r)||void 0===t?void 0:t.filter((function(n){return n.id!==e}));return JSON.stringify(i)}))},x=function(e){g((function(e){return[].concat((0,H.Z)(e),[(0,l.Z)((0,l.Z)({},$w.e5),{},{id:(0,Ie.x0)()})])}))},b=function(e){var n=null===h||void 0===h?void 0:h.some((function(n){return n.id===e.id}));1!==(null===h||void 0===h?void 0:h.length)||n||(g((function(){return[e]})),s((function(){return JSON.stringify([e])})));var t=(0,H.Z)(h),r=null===t||void 0===t?void 0:t.map((function(n){return n.id===e.id?(0,l.Z)({},e):n}));n&&(g((function(){return(0,H.Z)(r)})),s((function(){return JSON.stringify(r)})))};(0,f.useEffect)((function(){var e=o||JSON.stringify(""),n=(0,Ny.lo)(JSON.parse(e));a(n),i(n)}),[o]),(0,f.useEffect)((function(){c((function(e){var n=(0,H.Z)(e);return n.map((function(e){return n.indexOf(e)===d?(0,l.Z)((0,l.Z)({},e),{},{labelValuesState:(0,H.Z)(h),logsVolumeQuery:(t=(0,Ny.lo)(h),"sum by(level) (count_over_time(".concat(t,"[$__interval]))"))}):e;var t}))}))}),[h]);return Array.isArray(h)?(0,Fe.jsxs)("div",{className:(0,ze.cx)($y),children:[(null===h||void 0===h?void 0:h.length)>0&&(null===h||void 0===h?void 0:h.map((function(e,r){return(0,Fe.jsx)(nS,{dataSourceId:n,id:e.id,keyVal:e,labelOpts:t,labelAdd:x,labelRemove:m,onChange:b,currentState:h,labelValuesLength:h.length||0},r)}))),HS(r,(function(){g((function(){return[(0,l.Z)({},$w.eW)]}))}),(null===h||void 0===h?void 0:h.length)||0)]}):null},BS=function(e){var n=e.dataSourceId,t=e.setFinalQuery,r=e.labelsString,i=e.labelValueString,a=e.addBinary,o=e.setBuilders,s=e.index,c=tS(n,r).labelSeries,d=(0,f.useState)(e.operations||[]),p=(0,u.Z)(d,2),v=p[0],h=p[1];(0,f.useEffect)((function(){if(""!==i){var e=zS(i,v);t(e)}}),[v,i]);var g=(0,f.useCallback)((function(e,n,t){if("Binary Operation With Query"!==n){var r=(0,Ny.hf)(n,t,c,v);h((function(e){return(0,Ny.HA)(t,r,e)}))}else a(s)}),[v,c,r]);return(0,f.useEffect)((function(){o((function(e){var n=(0,H.Z)(e);return n.map((function(e){return n.indexOf(e)===s?(0,l.Z)((0,l.Z)({},e),{},{operations:(0,H.Z)(v)}):e}))}))}),[v]),(0,Fe.jsxs)("div",{className:(0,ze.cx)($y),children:[(0,Fe.jsx)(Pw,{menuClick:g}),(0,Fe.jsx)(Kw,(0,l.Z)((0,l.Z)({},e),{},{setOperations:h,operations:v}))]})},HS=function(e,n,t){return t<1?(0,Fe.jsx)(Yw,{mainTheme:e,resetLabelsState:n}):null};function PS(e){var n,t=function(e){var n,t={};if((null===e||void 0===e||null===(n=e.headers)||void 0===n?void 0:n.length)>0){var r,i=(0,s.Z)(e.headers);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=(0,B.Z)({},String(a.header),a.value);t=(0,l.Z)((0,l.Z)({},t),o)}}catch(u){i.e(u)}finally{i.f()}}return t}(e),r={},i={};if(null===e||void 0===e||null===(n=e.auth)||void 0===n?void 0:n.basicAuth.value){var a,o,u,c=null===e||void 0===e||null===(a=e.auth)||void 0===a||null===(o=a.fields)||void 0===o?void 0:o.basicAuth,d=(0,s.Z)(c);try{for(d.s();!(u=d.n()).done;){var f=u.value;"user"===f.name&&(i.username=f.value),"password"===f.name&&(i.password=f.value)}}catch(p){d.e(p)}finally{d.f()}r.auth=i}return r.options={method:"GET"},r.headers=(0,l.Z)((0,l.Z)({},t),{},{"Content-Type":"application/json"}),r}function qS(e){var n=(0,i.v9)((function(e){return e.dataSources})),t=(0,i.v9)((function(e){return e.start})),r=(0,i.v9)((function(e){return e.stop})),a=(0,f.useMemo)((function(){return{start:c(t).unix(),end:c(r).unix()}}),[t,r]),o=(0,f.useState)([]),l=(0,u.Z)(o,2),s=l[0],d=l[1],p=(0,f.useMemo)((function(){return n.find((function(n){return n.id===e}))}),[n,e]);return(0,f.useEffect)((function(){if("metrics"===p.type&&null!==p&&void 0!==p&&p.url&&""!==(null===p||void 0===p?void 0:p.url)){var e=PS(p),n="".concat(p.url,"/api/v1/label/__name__/values?start=").concat(a.start,"&end=").concat(a.end),t=function(){var t=(0,F.Z)((0,z.Z)().mark((function t(){var r,i;return(0,z.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,q().get(n,e);case 3:200===(null===(r=t.sent)||void 0===r?void 0:r.status)&&d((null===r||void 0===r||null===(i=r.data)||void 0===i?void 0:i.data)||[]),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("Error at loading Span Names",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();t()}}),[]),(0,f.useMemo)((function(){return(null===s||void 0===s?void 0:s.length)>0?s.map((function(e){return{label:e,value:e}})):[{label:"",value:""}]}),[s])}var AS=function(e){var n=e.keyVal,t=e.labelOpts,r=e.valuesOpts,i=e.labelAdd,a=e.labelRemove,s=e.onChange,c=e.labelValuesLength,d=e.id,p=e.metric,v=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useRef)(null),m=(0,hr.Fg)(),x=(0,f.useState)(n),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useState)(t[0]||{label:"Select Option",value:""}),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,hr.ZX)(r,j),T=(0,f.useState)({label:"=",value:"equals"}),_=(0,u.Z)(T,2),I=_[0],D=_[1],N=(0,f.useMemo)((function(){return"regexequals"===I.value||"regexexclude"===I.value}),[I.value]);return c>0?(0,Fe.jsxs)("div",{id:d,className:(0,ze.cx)(Jy),children:[(0,Fe.jsx)(eS,{ref:v,type:"label",isMulti:!1,defaultValue:o().sanitize(n.label),selectOpts:t,mainTheme:m,onChange:function(e){var n=e.value,t=e.id;k((function(){return{value:null===n||void 0===n?void 0:n.value,label:null===n||void 0===n?void 0:n.value}}));var r=JSON.parse(JSON.stringify(y)),i=(0,l.Z)((0,l.Z)({},r),{},{metric:p,label:null===n||void 0===n?void 0:n.label,value:n.value,id:t});s(i),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{label:null===n||void 0===n?void 0:n.value,metric:p})}))},keyVal:n,objId:d,minWidth:100,labelsLength:c}),(0,Fe.jsx)(eS,{ref:h,type:"operator",isMulti:!1,defaultValue:o().sanitize(n.operator),selectOpts:$w.bn,keyVal:n,mainTheme:m,onChange:function(e){var n=e.value,t=e.id,r=JSON.parse(JSON.stringify(y)),i=(0,l.Z)((0,l.Z)({},r),{},{operator:null===n||void 0===n?void 0:n.value,id:t});s(i),D((function(){return(0,l.Z)({},n)})),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{operator:null===n||void 0===n?void 0:n.value})}))},objId:d,minWidth:60,labelsLength:c}),(0,Fe.jsxs)("div",{className:(0,ze.cx)(Gy),children:[(0,Fe.jsx)(eS,{ref:g,type:"value",isMulti:N,defaultValue:o().sanitize(n.values),selectOpts:C,keyVal:n,mainTheme:m,onChange:function(e){var n=e.value,t=e.id,r=[],i=null!==n?n:{label:"",value:"",metric:p};r=N&&Array.isArray(i)?null===i||void 0===i?void 0:i.map((function(e){return e.value})):[i.value];var a=JSON.parse(JSON.stringify(y)),o=(0,l.Z)((0,l.Z)({},a),{},{values:r,id:t});s(o),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{values:r})}))},objId:d,minWidth:250,labelsLength:c}),(0,Fe.jsx)(Xw.Z,{className:(0,ze.cx)(Ky(m)),style:{height:"14px",width:"14px"},onClick:function(e){null!==v&&void 0!==v&&v.current&&null!==h&&void 0!==h&&h.current&&null!==g&&void 0!==g&&g.current&&a(n.id)}}),(0,Fe.jsx)(Dw.Z,{className:(0,ze.cx)(Ky(m)),style:{height:"14px",width:"14px"},onClick:i})]})]}):null};function QS(e){var n=e.dataSourceId,t=e.value,r=e.metricValueChange,a=e.onChange,o=e.setBuilders,s=e.index,c=e.setFinalQuery,p=e.labelValueString,v=e.setLabelValueString,h=function(e,n){var t=(0,i.v9)((function(e){return e.dataSources})),r=(0,i.v9)((function(e){return e.start})),a=(0,i.v9)((function(e){return e.stop})),o=(0,f.useMemo)((function(){return{start:d()(r).unix(),end:d()(a).unix()}}),[r,a]),l=(0,f.useState)([]),s=(0,u.Z)(l,2),c=s[0],p=s[1],v=(0,f.useMemo)((function(){return t.find((function(n){return n.id===e}))}),[t,e]),h=(0,f.useMemo)((function(){var e=encodeURIComponent('{__name__="'.concat(n,'"}')),t="match".concat(encodeURIComponent("[]"));if(n)return"".concat(t,"=").concat(e)}),[n]);return(0,f.useEffect)((function(){if("metrics"===v.type&&null!==v&&void 0!==v&&v.url&&""!==(null===v||void 0===v?void 0:v.url)&&n&&""!==n){var e=(0,Ny.wU)(v),t="".concat(v.url,"/api/v1/series?start=").concat(o.start,"&end=").concat(o.end,"&").concat(h),r=function(){var n=(0,F.Z)((0,z.Z)().mark((function n(){var r,i;return(0,z.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,q().get(t,e);case 3:200===(null===(r=n.sent)||void 0===r?void 0:r.status)&&p((null===r||void 0===r||null===(i=r.data)||void 0===i?void 0:i.data)||[]),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.log("Error at loading Span Names",n.t0);case 10:case"end":return n.stop()}}),n,null,[[0,7]])})));return function(){return n.apply(this,arguments)}}();r()}}),[v,o.end,o.start,h]),(0,f.useMemo)((function(){if((null===c||void 0===c?void 0:c.length)>0){var e=(0,H.Z)(c),n={};return e.forEach((function(e){Object.keys(e).forEach((function(t){var r;null!==(r=n[t])&&void 0!==r&&r.some((function(n){return n===e[t]}))||(n[t]=[].concat((0,H.Z)(n[t]||[]),[e[t]]))}))})),n}return{}}),[c])}(n,t),g=(0,f.useState)(e.labelValuesState||[(0,l.Z)((0,l.Z)({},$w.eW),{},{metric:t})]),m=(0,u.Z)(g,2),x=m[0],b=m[1],y=(0,hr.Fg)(),Z=(0,hr.Af)(h),w=function(e){b((function(n){var t=JSON.parse(JSON.stringify(n))||[];return null===t||void 0===t?void 0:t.filter((function(n){return n.id!==e}))})),v((function(n){var t,r=[];(null===n||void 0===n?void 0:n.length)>1&&(r=JSON.parse(n||JSON.stringify("[]")));var i=null===(t=r)||void 0===t?void 0:t.filter((function(n){return n.id!==e}));return JSON.stringify(i)}))},S=function(){b((function(e){return[].concat((0,H.Z)(e),[(0,l.Z)((0,l.Z)({},$w.e5),{},{metric:t,id:(0,Ie.x0)()})])}))},j=function(e){var n=null===x||void 0===x?void 0:x.some((function(n){return n.id===e.id}));1!==(null===x||void 0===x?void 0:x.length)||n||(b((function(){return[e]})),v((function(){return JSON.stringify([e])})));var t=(0,H.Z)(x),r=null===t||void 0===t?void 0:t.map((function(n){return n.id===e.id?(0,l.Z)({},e):n}));n&&(b((function(){return(0,H.Z)(r)})),v((function(){return JSON.stringify(r)}))),a(e)},k=function(){b((function(e){return[(0,l.Z)((0,l.Z)({},$w.eW),{},{metric:t})]}))};(0,f.useEffect)((function(){var e=p||JSON.stringify(""),n=(0,Ny.Gh)(t,JSON.parse(e));r(n),c(n)}),[p,t]),(0,f.useEffect)((function(){o((function(e){var n=(0,H.Z)(e);return n.map((function(e){return n.indexOf(e)===s?(0,l.Z)((0,l.Z)({},e),{},{labelValuesState:(0,H.Z)(x)}):e}))}))}),[x]);return(0,Fe.jsx)(I.a,{theme:y,children:(0,Fe.jsxs)("div",{className:(0,ze.cx)($y),children:[(null===x||void 0===x?void 0:x.length)>0&&(null===x||void 0===x?void 0:x.map((function(e,n){return(0,Fe.jsx)(AS,{id:e.id,idx:n,metric:t,keyVal:e,labelOpts:Z,valuesOpts:h,labelAdd:S,labelRemove:w,onChange:j,currentState:x,useValueSelectOpts:hr.ZX,labelValuesLength:(null===x||void 0===x?void 0:x.length)||0},n)}))),(null===x||void 0===x?void 0:x.length)<1?(0,Fe.jsx)(Yw,{mainTheme:y,resetLabelsState:k}):null]})})}var WS,US,JS,GS,KS,YS,XS,$S,ej,nj,tj,rj,ij,aj=function(e){var n=(0,hr.Fg)(),t=e.builders,r=e.setBuilders,i=e.dataSourceId,a=e.logsResponse;return(0,Fe.jsx)("div",{className:(0,ze.cx)(eZ),children:null===t||void 0===t?void 0:t.map((function(t,o){return(0,f.createElement)(lj,(0,l.Z)((0,l.Z)({},e),{},{builder:t,dataSourceId:i,logsResponse:a,key:o,idx:o,theme:n,setBuilders:r}))}))})},oj=function(e){var n=e.onBinaryClose,t=e.theme,r=e.onBinaryOptChange,i=e.binaryValue,a=(0,f.useState)(i.vectValue||""),l=(0,u.Z)(a,2),s=l[0],c=l[1],d=(0,f.useCallback)((function(e,n){c(e.target.value),r(e,n)}),[s]),p=(0,f.useMemo)((function(){return Object.entries($w.lX).map((function(e){var n=(0,u.Z)(e,2);return{value:n[0],name:n[1]}}))}),[$w.lX]),v=(0,f.useMemo)((function(){return Object.entries($w.fs).map((function(e){var n=(0,u.Z)(e,2);return{value:n[0],name:n[1]}}))}),[$w.lX]);return(0,Fe.jsx)("div",{children:(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(t)),children:(0,Fe.jsxs)("div",{className:"binary-operation-bar",children:[(0,Fe.jsxs)("div",{className:"binary-operation-cont",children:[(0,Fe.jsx)("label",{children:"Operator"})," ",(0,Fe.jsx)(MZ,{initial:i.binaryOpt||"divide",onChange:function(e){return r(e,"binaryOpt")},opts:p}),(0,Fe.jsx)("label",{children:"Label Matches"}),(0,Fe.jsx)(MZ,{initial:i.vectOpt||"on",onChange:function(e){return r(e,"vectOpt")},opts:v}),(0,Fe.jsx)("input",{value:o().sanitize(s),onChange:function(e){return d(e,"vectValue")}})]}),(0,Fe.jsx)("button",{onClick:n,children:" X"})]})})})},lj=function(e){var n=e.builder,t=e.theme,r=e.idx,i=e.setBuilders,a=e.logsResponse,s=e.dataSourceId,c=(0,f.useState)((0,Ny.lo)(n.labelValuesState)||""),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useMemo)((function(){if(null!==n&&void 0!==n&&n.labelValuesState){var e=(0,Ny.yv)(null===n||void 0===n?void 0:n.labelValuesState);return"{".concat(e,"}")||0}return{}}),[n.labelValuesState]),g=qS(s),m=(0,f.useState)(g[0]||{label:"",value:""}),x=(0,u.Z)(m,2),b=x[0],y=x[1],Z=(0,f.useState)(n.builderResult||""),w=(0,u.Z)(Z,2),S=w[0],j=w[1],k=(0,f.useState)(JSON.stringify(n.labelValuesState)||""),C=(0,u.Z)(k,2),T=C[0],_=C[1];(0,f.useEffect)((function(){_(JSON.stringify(n.labelValuesState))}),[n]);var I=(0,f.useCallback)((function(e){i((function(n){return(0,H.Z)(n).map((function(n,t){return t===r?(0,l.Z)((0,l.Z)({},n),{},{builderResult:e}):n}))})),j(e)}),[]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(eZ),children:[n.isBinary&&(0,Fe.jsx)(oj,{theme:t,binaryValue:o().sanitize(n.binaryValue),onBinaryOptChange:function(e,n){i((function(t){return(0,H.Z)(t).map((function(t,i){return i===r?(0,l.Z)((0,l.Z)({},t),{},{binaryValue:(0,l.Z)((0,l.Z)({},t.binaryValue),{},(0,B.Z)({},n,e.target.value))}):t}))}))},onBinaryClose:function(){i((function(e){return(0,H.Z)(e).filter((function(e,n){return n!==r}))}))}}),(0,Fe.jsx)("div",{className:(0,ze.cx)(nZ),children:!0===n.isMetrics?(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(sj,{theme:t,onMetricChange:function(e){var n=e.value;y((function(e){return{value:null===n||void 0===n?void 0:n.value,label:null===n||void 0===n?void 0:n.value}}))},dataSourceId:s}),(0,Fe.jsx)(QS,{index:r,onChange:function(e){},dataSourceId:s,value:o().sanitize(b.value),setBuilders:i,finalQuery:S,builder:n,setFinalQuery:I,labelValueString:T,setLabelValueString:_,metricValueChange:function(e){}})]}):(0,Fe.jsx)(FS,(0,l.Z)((0,l.Z)({},n),{},{dataSourceId:s,logsResponse:a,setLabelsString:v,finalQuery:S,setFinalQuery:I,labelValueString:T,setLabelValueString:_,setBuilders:i,index:r,theme:t}))}),(0,Fe.jsx)(BS,(0,l.Z)((0,l.Z)((0,l.Z)({},e),n),{},{setBuilders:i,dataSourceId:s,labelsString:function(e,n,t){return e.isMetrics?t:n}(n,p,h),labelValueString:T,setFinalQuery:I,finalQuery:S,index:r}))]},r)},sj=function(e){var n=e.dataSourceId,t=e.theme,r=e.onMetricChange,i=qS(n);return(0,Fe.jsx)(eS,{isMulti:!1,type:"metric",defaultValue:o().sanitize("Select Metric..."),selectOpts:i,mainTheme:t,onChange:r,minWidth:250,labelValuesLength:0})},uj=function(e){return(0,ze.iv)(WS||(WS=(0,r.Z)(["\n padding: 8px;\n display: flex;\n flex: 1;\n gap:4px;\n flex-direction: column;\n border-bottom: 1px solid ",";\n background: ",";\n label {\n font-size: 11px;\n color: ",";\n\n padding: 4px 10px;\n }\n .action-buttons {\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content:flex-end;\n gap:2px;\n }\n @media (min-width: 420px) {\n flex-direction: row;\n align-items: center;\n &.action-buttons {\n margin-top: 0px;\n }\n }\n"])),e.buttonBorder,e.widgetContainer,e.textColor)},cj=function(e){return(0,ze.iv)(US||(US=(0,r.Z)(["\n flex: 1;\n background: ",";\n color: ",";\n padding: 3px 6px;\n font-size: 12px;\n font-family: monospace;\n margin: 0px 5px;\n border-radius: 3px;\n line-height: 1.5;\n line-break: anywhere;\n overflow-y: scroll;\n @media (max-width: 420px) {\n margin:0px;\n }\n"])),e.inputBg,e.textColor)};function dj(e){var n=e.attributes,t=e.children,i=e.leaf,a=e.theme;return(0,Fe.jsx)("span",(0,l.Z)((0,l.Z)({},n),{},{className:(0,ze.iv)(JS||(JS=(0,r.Z)(["\n font-family: monospace;\n // background: black;\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),i.comment&&(0,ze.iv)(GS||(GS=(0,r.Z)(["\n color: blue;\n "]))),(i.operator||i.url)&&(0,ze.iv)(KS||(KS=(0,r.Z)(["\n color: ",";\n "])),a.textOff),i.keyword&&(0,ze.iv)(YS||(YS=(0,r.Z)(["\n color: #57aed4;\n "]))),(i.variable||i.regex)&&(0,ze.iv)(XS||(XS=(0,r.Z)(["\n color: #e90;\n "]))),(i.number||i.boolean||i.tag||i.constant||i.symbol||i["attr-name"]||i.selector)&&(0,ze.iv)($S||($S=(0,r.Z)(["\n color: #dd4a68;\n "]))),i.punctuation&&(0,ze.iv)(ej||(ej=(0,r.Z)(["\n color: orange;\n "]))),(i.string||i.char)&&(0,ze.iv)(nj||(nj=(0,r.Z)(["\n color: green;\n "]))),(i.function||i["class-name"]||i["attr-name"])&&(0,ze.iv)(tj||(tj=(0,r.Z)(["\n color: #dd4a68;\n "]))),i["context-labels"]&&(0,ze.iv)(rj||(rj=(0,r.Z)(["\n color: orange;\n "]))),i["label-key"]&&(0,ze.iv)(ij||(ij=(0,r.Z)(["\n color: green;\n "])))),children:t}))}function fj(e){var n;return"string"===typeof e?null===e||void 0===e?void 0:e.length:"string"===typeof(null===e||void 0===e?void 0:e.content)?null===e||void 0===e?void 0:e.content.length:null===e||void 0===e||null===(n=e.content)||void 0===n?void 0:n.reduce((function(e,n){return e+fj(n)}),0)}function pj(e){var n=(0,hr.Fg)(),t=e.queryText,r=e.searchButton,i=e.logsRateButton,a=e.queryInput,c=(0,f.useState)([{type:"paragraph",children:[{text:o().sanitize(t)}]}]),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useState)("sql"),g=(0,u.Z)(h,1)[0],m=(0,f.useCallback)((function(e){var n=(0,u.Z)(e,2),t=n[0],r=n[1],i=[];if(!my.xv.isText(t)||(null===t||void 0===t?void 0:t.length)<1)return i;var a,o=Zy().tokenize(t.text,Zy().languages[g]),l=0,c=(0,s.Z)(o);try{for(c.s();!(a=c.n()).done;){var d,f=a.value,p=l+fj(f);if("string"!==typeof f)i.push((d={},(0,B.Z)(d,f.type,!0),(0,B.Z)(d,"anchor",{path:r,offset:l}),(0,B.Z)(d,"focus",{path:r,offset:p}),d));l=p}}catch(v){c.e(v)}finally{c.f()}return i}),[g]),x=(0,f.useCallback)((function(e){return(0,Fe.jsx)(dj,(0,l.Z)((0,l.Z)({},e),{},{theme:n}))}),[]);(0,f.useEffect)((function(){v([{type:"paragraph",children:[{text:o().sanitize(e.queryText)}]}]),y.children=[{text:o().sanitize(e.queryText)}]}),[e.queryText]);var b=(0,f.useCallback)((function(e){v(e)}),[p]);(0,f.useEffect)((function(){p!==a&&""!==a&&(v([{type:"paragraph",children:[{text:o().sanitize(a)}]}]),y.children=[{text:o().sanitize(a)}])}),[a]);var y=(0,f.useMemo)((function(){return(0,by.VC)((0,xy.BU)((0,my.Jh)()))}),[]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(uj(n)),children:[(0,Fe.jsx)("label",{children:"Raw Query"}),(0,Fe.jsx)(xy.mH,{editor:y,value:p,onChange:b,children:(0,Fe.jsx)(xy.CX,{renderLeaf:x,decorate:m,className:(0,ze.cx)(cj(n)),readOnly:!0,placeholder:t})}),(0,Fe.jsxs)("div",{className:"action-buttons",children:[i,r]})]})}function vj(e){var n=e.dataSourceId,t=e.labelValueChange,r=e.searchButton,a=e.logsRateButton,o=e.queryInput,s=(0,i.v9)((function(e){return e.dataSources})),c=(0,i.v9)((function(e){return e})),d=mZ(n,c.start,c.stop,s).logsResponse,p=(0,f.useState)(""),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,I.u)(),x=(0,f.useState)([$w.DJ]),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useCallback)((function(e){Z((function(n){return[].concat((0,H.Z)(n),[(0,l.Z)((0,l.Z)({},n[e]),{},{isBinary:!0})])}))}),[y]);(0,f.useEffect)((function(){t(h)}),[h]),(0,f.useEffect)((function(){Z((function(e){return(0,H.Z)(e).map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{logsResponse:d})}))}))}),[d]);var S=function(e){var n="";return e.forEach((function(e){e.isBinary?n+="".concat(function(e){var n=e.binaryValue,t=n.binaryOpt,r=n.vectOpt,i=n.vectValue,a="";return""!==i&&(a="".concat(r,"(").concat(i,")"))," ".concat($w.lX[t]," ").concat(a)}(e)," ").concat(e.builderResult):n+=e.builderResult})),n};return(0,f.useEffect)((function(){g(S(y))}),[y]),(0,Fe.jsx)(I.a,{theme:m,children:(0,Fe.jsxs)("div",{className:(0,ze.cx)(eZ),children:[(0,Fe.jsx)(aj,{type:"metrics_search",addBinary:w,dataSourceId:n,logsResponse:d,setBuilders:Z,builders:y,finalQuery:h}),(0,Fe.jsx)(pj,{queryText:h,searchButton:r,logsRateButton:a,queryInput:o})]})})}function hj(e){var n=e.handleMetricValueChange,t=e.data,r=t.dataSourceId,a=t.hasStats,o=e.searchButton,s=e.statsSwitch,u=e.logsRateButton,c=(0,hr.Fg)(),d=(0,i.v9)((function(e){return e.isSplit}));return(0,Fe.jsxs)(I.a,{theme:c,children:[(0,Fe.jsx)("div",{className:(0,ze.cx)($y),children:(0,Fe.jsx)(vj,(0,l.Z)((0,l.Z)({},e),{},{dataSourceId:r,labelValueChange:function(e){n(e)},searchButton:o,logsRateButton:u}))}),a&&d&&(0,Fe.jsx)("div",{style:{display:"flex",margin:"10px 0px"},children:s})]})}var gj,mj={operations:[],labelsState:[],binaryValue:{binaryOpt:"divide",vectOpt:"on",vectValue:""},builderResult:"",logsVolumeQuery:"",isBinary:!1},xj={minus:"-",plus:"+",by:"*",divide:"/",exp:"^",equals:"==",not_equals:"!=",modulo:"%",more:"<",less:">",less_equals:"<=",more_equals:">="};function bj(e){var n=e.dataSourceId,t=e.labelValueChange,r=e.handleLogsVolumeChange,a=e.searchButton,o=e.queryInput,s=(0,i.v9)((function(e){return e.dataSources})),c=(0,i.v9)((function(e){return e})),d=mZ(n,c.start,c.stop,s).logsResponse,p=(0,f.useState)(""),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,I.u)(),x=(0,f.useState)([mj]),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useCallback)((function(e){Z((function(n){return[].concat((0,H.Z)(n),[(0,l.Z)((0,l.Z)({},n[e]),{},{isBinary:!0})])}))}),[y]);(0,f.useEffect)((function(){""!==y[0].logsVolumeQuery&&r(y[0].logsVolumeQuery)}),[y]),(0,f.useEffect)((function(){t(h)}),[h]),(0,f.useEffect)((function(){Z((function(e){return(0,H.Z)(e).map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{logsResponse:d})}))}))}),[d]);var S=function(e){var n="";return e.forEach((function(e){e.isBinary?n+="".concat(function(e){var n=e.binaryValue,t=n.binaryOpt,r=n.vectOpt,i=n.vectValue,a="";return""!==i&&(a="".concat(r,"(").concat(i,")"))," ".concat(xj[t]," ").concat(a)}(e)," ").concat(e.builderResult):n+=e.builderResult})),n};return(0,f.useEffect)((function(){g(S(y))}),[y]),(0,Fe.jsx)(I.a,{theme:m,children:(0,Fe.jsxs)("div",{className:(0,ze.cx)(eZ),children:[(0,Fe.jsx)(aj,{type:"logs_search",addBinary:w,dataSourceId:n,logsResponse:d,setBuilders:Z,builders:y,finalQuery:h}),(0,Fe.jsx)(pj,{queryText:h,searchButton:a,queryInput:o})]})})}function yj(e){var n=e.handleLogValueChange,t=e.data,r=t.dataSourceId,a=t.hasStats,o=e.searchButton,s=e.statsSwitch,u=(0,hr.Fg)(),c=(0,i.v9)((function(e){return e.isSplit}));return(0,Fe.jsxs)(I.a,{theme:u,children:[(0,Fe.jsx)("div",{className:(0,ze.cx)(Ga),children:(0,Fe.jsx)(bj,(0,l.Z)((0,l.Z)({},e),{},{dataSourceId:r,labelValueChange:function(e){n(e)},searchButton:o}))}),a&&c&&(0,Fe.jsx)("div",{style:{display:"flex",margin:"10px 0px"},children:s})]})}function Zj(e,n){return"left"===e?m(n):x(n)}var wj,Sj=[{value:"range",label:"Range"},{value:"instant",label:"Instant"}],jj=[{value:"forward",label:"Forward"},{value:"backwards",label:"Backwards"}],kj=[{value:"traceId",label:"TraceId"},{value:"search",label:"Search"}],Cj=(0,ze.iv)(gj||(gj=(0,r.Z)(["\n max-width: 100%;\n"]))),Tj=function(e){var n=e.data,t=e.name,r=e.width,a=e.launchQuery,s=n.queryType,c=n.limit,d=n.id,v=n.dataSourceType,h=n.direction,g=n.dataSourceId,m=n.splitted,x=e.data,b=x.loading,y=x.hasStats,Z=x.isShowStats,S=x.isBuilder,j=x.isLogsVolume,k=x.logsVolumeQuery,C=Ib,T=Db,D=Nb,N=(0,p.TH)().hash,M=(0,i.I0)(),E=(0,wt.Z)(),R=(0,L.Z)().historyStore(),O=(0,hr.Fg)(),z=(0,i.v9)((function(e){return e})),F=z.historyOpen,B=z.isEmbed,P=z.queryHistory,q=z.start,A=z.stop,W=(0,i.v9)((function(e){return e.isSplit})),U=(0,i.v9)((function(e){return e[t]})),J=(0,_.useMediaQuery)({query:"(max-width: 1070px)"}),G=(0,f.useState)(n.expr),K=(0,u.Z)(G,2),Y=K[0],X=K[1],$=(0,f.useState)(!1),ee=(0,u.Z)($,2),ne=ee[0],te=ee[1],re=(0,f.useState)(n.expr.split(/[ ]+/).map((function(e){return{children:[{text:o().sanitize(e)}]}}))||[{children:[{text:o().sanitize("Enter a cLoki Query")}]}]),ie=(0,u.Z)(re,2),ae=ie[0],oe=ie[1],le=(0,f.useState)("traceId"),se=(0,u.Z)(le,2),ue=se[0],ce=se[1],de=(0,f.useState)([]),fe=(0,u.Z)(de,1)[0],pe=(0,f.useState)({}),ve=(0,u.Z)(pe,2),he=(ve[0],ve[1]),ge=(0,f.useState)(Z||!1),me=(0,u.Z)(ge,2),xe=me[0],be=me[1],ye=(0,f.useState)(!1),Ze=(0,u.Z)(ye,2),we=Ze[0],Se=Ze[1],je=(0,i.v9)((function(e){return e.dataSources})),ke=(0,i.v9)((function(e){return e[t]})),Ce=(0,f.useMemo)((function(){return Iy.E7.find((function(e){return e.id===g}))}),[g]);function Te(e,n){if(n&&""!==e){var t=e.match(/[^{\}]+(?=})/g);if(Array.isArray(t)&&(null===t||void 0===t?void 0:t.length)>0){var r="{".concat(null===t||void 0===t?void 0:t.join(","),"}"),i="sum by(level) (count_over_time(".concat(r,"[$__interval]))");Ie(i)}}}function _e(e){oe(e),Ne(e)}(0,f.useEffect)((function(){var e,n=(C(g,d)||"").expr,r=T(g);X(n),oe([{children:[{text:n}]}]),Te(n,j);var i=function(e,n){return null===e||void 0===e?void 0:e.find((function(e){return e.id===g}))}(je),a={};if(r&&(null===r||void 0===r?void 0:r.url)!==Ce&&""!==(null===r||void 0===r?void 0:r.url)){a=(0,l.Z)({},r);var o=(0,H.Z)(ke);o.forEach((function(e){e.id===d&&(e.dataSourceId=a.id,e.dataSourceType=a.type,e.dataSourceURL=a.url)})),M(Zj(t,o));var u=(0,H.Z)(je);u.forEach((function(e){e.id===g&&(e=a)})),M((0,_y.Z)(u))}else i&&""!==i.url&&(a=(0,l.Z)({},i));B&&M(Tn(v,Y,s,c,t,d,h,g,null===(e=a)||void 0===e?void 0:e.url))}),[]),(0,f.useEffect)((function(){X(n.expr),oe([{children:[{text:o().sanitize(n.expr)}]}])}),[n.expr]),(0,f.useEffect)((function(){var e=ae[0].children[0].text;X(e)}),[ae]),(0,f.useEffect)((function(){J&&W&&M(w(!1))}),[J]),(0,f.useEffect)((function(){var e=(C(g,d)||"").expr,n=T(g);X(e),oe([{children:[{text:o().sanitize(e)}]}]),j&&k&&Te(e,j);var r=null===je||void 0===je?void 0:je.find((function(e){return e.id===g})),i={};if(n&&(null===n||void 0===n?void 0:n.url)!==Ce&&""!==(null===n||void 0===n?void 0:n.url)){i=(0,l.Z)({},n);var a=(0,H.Z)(ke);a.forEach((function(e){e.id===d&&(e.dataSourceId=i.id,e.dataSourceType=i.type,e.dataSourceURL=i.url)})),M(Zj(t,a));var u=(0,H.Z)(je);u.forEach((function(e){e.id===g&&(e=i)})),M((0,_y.Z)(u))}else r&&""!==r.url&&(i=(0,l.Z)({},r));var f,p=Le(e).isMatrix;""!==e&&(null===e||void 0===e?void 0:e.length)>6&&M(Tn(v,e,s,c,t,d,h,g,null===(f=i)||void 0===f?void 0:f.url));j&&null!==k&&void 0!==k&&k.query&&""!==(null===k||void 0===k?void 0:k.query)&&"logs"===v&&!p&&M(Tn(v,k.query,s,c,t,d,h,g,i.url,k.customStep,!0))}),[g,d]),(0,f.useEffect)((function(){"string"===typeof Y&&(X(Y),oe([{children:[{text:o().sanitize(Y)}]}]),Ne(),j&&Te(Y,!0))}),[Y]),(0,f.useEffect)((function(){"string"===typeof a&&""!==a&&(X(a),oe([{children:[{text:o().sanitize(a)}]}]),Ne(),j&&Te(a,!0))}),[a]),(0,f.useEffect)((function(){Te(Y,j)}),[Y]);var Ie=function(e){var n=function(e,n,t,r){var i="",a=0;if(e.includes("$__interval")){var o=(r.getTime()-t.getTime())/1e3/30/Number((n/window.innerWidth).toFixed(1)),l=Math.round(o*Number(window.devicePixelRatio.toFixed(2)));i=e.replace(/\[\$__interval\]/,"[".concat(l,"s]")),a=l}else i=e;return{query:i,customStep:a}}(e,r,q,A),t=n.query,i=n.customStep;Me({query:t,customStep:i})},De=function(e){e.preventDefault();var n=je.find((function(e){return e.id===g}));if(hb(Y)&&n)try{Re(n.type,Y,s,c,d,h,n.id,n.url),j&&!k&&Te(Y,j),Oe(Y,!0),Ve(),D(Y,d,g)}catch(e){console.error(e)}else M(Q(!0)),console.log("Please make a log query",Y)},Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if((null===e||void 0===e?void 0:e.length)>0){var n=new URLSearchParams(N.replace(/#/,"")),r=null===e||void 0===e?void 0:e.map((function(e){return e.children[0].text})).join("\n"),i=(0,H.Z)(U);i.forEach((function(e){e.id===d&&r&&(e.expr=r)})),M(Zj(t,i)),n.set(t,JSON.stringify(i)),D(Y,d,g)}},Me=function(e){var n=(0,H.Z)(U);n.forEach((function(n){n.id===d&&e&&""!==e.query&&(n.logsVolumeQuery={query:e.query,customStep:e.customStep})})),M(Zj(t,n))};var Ee=function(e){e.preventDefault();var n="";0===Y.length||(n=function(e){var n="";if(0!==e.length){var t=e.startsWith("rate(");n="metrics"===v?t?(n=e.replace(/{([^}]+)}/g,"{}")).replace(/\[\d+ms\]/,"[$__interval]"):"rate(".concat(e.replace(/{([^}]+)}/g,"{}"),"[$__interval])"):t?e.replace(/\[\d+ms\]/,"[$__interval]"):"rate(".concat(e,"[$__interval])")}return n}(Y),X(n),oe([{children:[{text:o().sanitize(n)}]}]),te(hb(n))),hb(n)&&function(n){var t=je.find((function(e){return e.id===g}));try{Re(t.type,n,s,c,d,h,t.id,t.url),Ve()}catch(e){console.error(e)}}(n)};var Re=function(e,n,r,i,a,o,l,s){var u=R.add({data:JSON.stringify({type:e,queryInput:n,queryType:r,limit:i,direction:o,dataSourceId:l,url:s,panel:t,id:a}),url:window.location.hash},10);M(V(u))},Oe=function(e,n){var r=je.find((function(e){return e.id===g})),i=(0,H.Z)(U);"logs"===v&&i.forEach((function(e){e.id===d&&(e.browserOpen=!1)})),M(Zj(t,i));var a=Le(e),o=a.querySubmit,l=a.customStep,u=a.isMatrix;n&&""!==o&&(null===o||void 0===o?void 0:o.length)>6&&M(Tn(v,o,s,c,t,d,h,g,r.url,l,j&&!u)),j&&null!==k&&void 0!==k&&k.query&&""!==(null===k||void 0===k?void 0:k.query)&&!u&&M(Tn(v,k.query,s,c,t,d,h,g,r.url,k.customStep,!0))};function Le(e){var n="",t=0,i=!1;if(null!==e.match(/\((.*?)\)/)&&(i=!0),e.includes("$__interval")){i=!0;var a=(A.getTime()-q.getTime())/1e3/30/Number((r/window.innerWidth).toFixed(1)),o=Math.round(a*Number(window.devicePixelRatio.toFixed(2)));n=e.replace(/\[\$__interval\]/,"[".concat(o,"s]")),t=o}else n=e;return{customStep:t,querySubmit:n,isMatrix:i}}var Ve=function(){var e=je.find((function(e){return e.id===g})),n=E.add({data:{href:window.location.href,url:e.url,type:v,queryInput:Y,queryType:s,limit:c,panel:t,id:d},description:"From Query Submit"},10);M((0,St.Z)(n))};function Be(e){M(lt(!F))}function He(){Se(!we)}function Pe(e){var n=e.target.checked;be((function(){return n}));var r=JSON.parse(JSON.stringify(ke)),i=null===r||void 0===r?void 0:r.map((function(e){return e.id===d?(0,l.Z)((0,l.Z)({},e),{},{isShowStats:n}):e}));M(Zj(t,i))}var qe=function(e){ce((function(){return e}))};if(B)return null;return B?null:(0,Fe.jsx)("div",{className:(0,ze.cx)(Cj),id:d,children:(0,Fe.jsxs)(I.a,{theme:O,children:["metrics"!==v&&"traces"!==v&&(J||W)&&(0,Fe.jsx)(gy,(0,l.Z)((0,l.Z)({},e),{},{isSplit:m,dataSourceType:v,onShowQuerySettings:He,queryHistory:P,handleHistoryClick:Be,isTabletOrMobile:J,queryValid:ne,onSubmit:De,onSubmitRate:Ee,labels:fe,loading:b||!1,hasStats:y,showStatsOpen:xe,handleStatsOpen:Pe})),function(e,n,t,r,i,a){return"traces"===e?(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingRight:"15px",marginBottom:"4px"},children:(0,Fe.jsx)(gZ,{value:"traceId",onChange:qe})}),"traceId"===ue&&t,"search"===ue&&n]}):"metrics"===e?(0,Fe.jsxs)(Fe.Fragment,{children:[r,t]}):"logs"===e?(0,Fe.jsxs)(Fe.Fragment,{children:[S&&i,t]}):t}(v,(0,Fe.jsx)(pZ,(0,l.Z)((0,l.Z)({},e),{},{onSearchChange:function(e){he((function(){return e}))}})),(0,Fe.jsx)(Ty,(0,l.Z)((0,l.Z)({},e),{},{isSplit:m,isBuilder:S,dataSourceType:v,handleQueryChange:_e,expr:Y,queryValue:ae,handleInputKeyDown:function(e){"Enter"===e.code&&e.ctrlKey&&De(e)},queryHistory:P,handleHistoryClick:Be,queryValid:ne,onSubmit:De,onSubmitRate:Ee,isTabletOrMobile:J,labels:fe,loading:b||!1})),(0,Fe.jsx)(hj,(0,l.Z)((0,l.Z)({},e),{},{queryInput:Y,searchButton:(0,Fe.jsx)(pb,{disabled:!ne,loading:b||!1,onClick:De,isMobile:!1,alterText:"Use Query"}),logsRateButton:(0,Fe.jsx)(vb,{disabled:!ne,onClick:Ee,isMobile:!1,alterText:"Use as Rate Query"}),statsSwitch:(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Show Stats"}),(0,Fe.jsx)(Ab.Z,{checked:xe,size:"small",onChange:Pe,inputProps:{"aria-label":"controlled"}})]}),handleMetricValueChange:function(e){_e([{children:[{text:o().sanitize(e)}]}])}})),(0,Fe.jsx)(yj,(0,l.Z)((0,l.Z)({},e),{},{queryInput:Y,isBuilder:S,searchButton:(0,Fe.jsx)(pb,{disabled:!ne,loading:b||!1,onClick:De,isMobile:!1,alterText:"Use Query"}),logsRateButton:(0,Fe.jsx)(vb,{disabled:!ne,onClick:Ee,isMobile:!1,alterText:"Use as Rate Query"}),statsSwitch:(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Show Stats"}),(0,Fe.jsx)(Ab.Z,{checked:xe,size:"small",onChange:Pe,inputProps:{"aria-label":"controlled"}})]}),handleLogValueChange:function(e){_e([{children:[{text:o().sanitize(e)}]}])},handleLogsVolumeChange:Ie}))),!W&&function(e,n,t,r){return!t&&!n&&("metrics"===e||"logs"===e)?r:null}(v,m,J,(0,Fe.jsx)(Gb,(0,l.Z)({},e))),function(e,n,t,r){return e||n||"flux"!==t||"traces"!==t?r:null}(J,m,v,(0,Fe.jsx)(Yb,(0,l.Z)((0,l.Z)({},e),{},{open:we,handleClose:function(){He()},actPanel:U,name:t})))]})})},_j=Tj,Ij=function(e){var n=jt.Z.div(wj||(wj=(0,r.Z)(["\n color: ",";\n padding: 10px;\n "])),(function(e){return e.theme.textColor}));return(0,Fe.jsx)(n,{children:"No labels available, please adjust API"})};function Dj(e){var n=e.label,t=e.type,r=(0,f.useState)(e.selected),i=(0,u.Z)(r,2),a=i[0],o=i[1];(0,f.useEffect)((function(){o(e.selected)}),[e.selected]);var l=(0,f.useMemo)((function(){return a?{borderColor:"#11abab",color:"#11abab"}:{}}),[a]);return(0,Fe.jsx)("small",{className:t,style:l,onClick:function(t){return e.onClick(n)},children:n})}function Nj(e){var n=e.labels,t=e.data.dataSourceType,r=function(n){"Select Metric"===n?e.onLabelSelected("__name__"):e.onLabelSelected(n)},i=(0,f.useMemo)((function(){return"metrics"!==t?n:null===n||void 0===n?void 0:n.filter((function(e){return"__name__"!==e.name}))}),[t,n]);return(0,Fe.jsxs)("div",{className:"valuelist-content",children:[i&&(0,Fe.jsx)(Fe.Fragment,{children:i.map((function(e,n){return(0,Fe.jsx)(Dj,{label:e.name,selected:e.selected,onClick:r},n)}))}),!i&&(0,Fe.jsx)(Ij,(0,l.Z)({},e))]})}function Mj(e){return e.getTime()+"000000"}var Ej,Rj,Oj,Lj=function(e,n,t,r,i){return{metrics:"".concat(e,"/api/v1/label/").concat(t,"/values"),logs:"".concat(e,"/loki/api/v1/label/").concat(t,"/values?start=").concat(r,"&end=").concat(i)}[n]};var Vj=jt.Z.div(Ej||(Ej=(0,r.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n width: 100%;\n height: 100%;\n"]))),zj=(0,jt.Z)(sa.Z)(Rj||(Rj=(0,r.Z)(["\n width: 30px;\n height: 30px;\n"]))),Fj=jt.Z.input(Oj||(Oj=(0,r.Z)(["\n background: ",";\n color: ",";\n font-size: 10px;\n border: 1px solid ",";\n border-radius: 3px;\n outline: none;\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}));function Bj(e,n){return"left"===e?m(n):x(n)}var Hj={borderColor:"#11abab",color:"#11abab"},Pj=function(e){var n=e.value,t=e.data,r=e.onValueClick,i=(0,f.useMemo)((function(){return n.selected}),[n.selected]),a=(0,f.useState)(i),o=(0,u.Z)(a,2),s=o[0],c=o[1],d=(0,f.useMemo)((function(){return s||(null===t||void 0===t?void 0:t.metric)===n.name?Hj:{}}),[s,n.selected,t.metric,n.name]);(0,f.useEffect)((function(){c(n.selected)}),[n.selected]);return(0,Fe.jsx)("small",{className:"label-value",style:d,onClick:function(){var e=!1;c((function(n){return e=!n,!n}));var t=(0,l.Z)((0,l.Z)({},n),{},{selected:e});r(t)},children:n.name})},qj=function(e){var n=(0,i.I0)(),t=e.name,r=e.data,a=e.labelsSelected,o=e.label,c=e.queries,d=r.dataSourceId,p=r.start,v=r.stop,h=r.labels,g=(0,f.useState)(""),m=(0,u.Z)(g,2),x=m[0],b=m[1],y=function(e,n,t,r){var a,o=(0,i.v9)((function(e){return e.dataSources})),c=(0,f.useMemo)((function(){return o.find((function(n){return n.id===e}))}),[o,e]),d=null===c||void 0===c||null===(a=c.auth)||void 0===a?void 0:a.basicAuth.value,p={},v={};if(d){var h,g,m,x=null===c||void 0===c||null===(h=c.auth)||void 0===h||null===(g=h.fields)||void 0===g?void 0:g.basicAuth,b=(0,s.Z)(x);try{for(b.s();!(m=b.n()).done;){var y=m.value;"user"===y.name&&(p.username=y.value),"password"===y.name&&(p.password=y.value)}}catch(P){b.e(P)}finally{b.f()}v.auth=p}var Z=Mj(t),w=Mj(r),S=new AbortController,j=(0,f.useState)(),k=(0,u.Z)(j,2),C=k[0],T=k[1];(0,f.useEffect)((function(){T(Lj(c.url,c.type,n,Z,w))}),[n,T,c]);var _=OZ(c),I=(0,f.useState)((0,l.Z)((0,l.Z)({},_),{},{"Content-Type":"application/json"})),D=(0,u.Z)(I,1)[0],N=(0,f.useMemo)((function(){return{signal:S.signal,method:"GET"}}),[]);v.options=N,v.headers=D;var M=(0,f.useState)([]),E=(0,u.Z)(M,2),R=E[0],O=E[1],L=(0,f.useState)(!1),V=(0,u.Z)(L,2),B=V[0],H=V[1];return(0,f.useEffect)((function(){if("flux"!==c.type&&""!==n){var e=function(){var e=(0,F.Z)((0,z.Z)().mark((function e(){var n;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(H(!0),!C||""===C){e.next=12;break}return e.prev=2,e.next=5,q().get(C,v);case 5:n=e.sent,O(n||[]),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.log(e.t0);case 12:H(!1);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}();e()}}),[c,C,n]),{response:R,controller:N.signal,loading:B}}(d,o,new Date(p),new Date(v)),Z=y.response,w=y.loading,S=(0,f.useState)([]),j=(0,u.Z)(S,2),k=j[0],C=j[1];(0,f.useEffect)((function(){var e,n=null===r||void 0===r||null===(e=r.labels)||void 0===e?void 0:e.find((function(e){return e.name===e})),t=null===n||void 0===n?void 0:n.values;"undefined"!==typeof t&&C(t)}),[c]);var T=(0,f.useMemo)((function(){var n,t;if((null===e||void 0===e||null===(n=e.data)||void 0===n||null===(t=n.labels)||void 0===t?void 0:t.length)<1)return[];var r=e.data.labels.find((function(e){return e.name===o}));return r?null===r||void 0===r?void 0:r.values:[]}),[e.data.labels]),_=(0,f.useMemo)((function(){var e,n;if((null===Z||void 0===Z||null===(e=Z.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.length)>0){var t,i,a,s=null===r||void 0===r||null===(t=r.labels)||void 0===t?void 0:t.find((function(e){return e.name===o})),u=null===s||void 0===s?void 0:s.values,c=new Map;return null===u||void 0===u||u.forEach((function(e){c.set(e.name,(0,l.Z)((0,l.Z)({},e),{},{label:o}))})),null===Z||void 0===Z||null===(i=Z.data)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.map((function(e){var n,t;return{label:o,name:e,selected:(null===(n=c.get(e))||void 0===n?void 0:n.selected)||!1,inverted:!1,type:"value",id:(null===(t=c.get(e))||void 0===t?void 0:t.id)||(0,Ie.x0)()}}))}return[]}),[Z]),I=(0,f.useState)(_),D=(0,u.Z)(I,2),N=D[0],M=D[1],E=(0,f.useState)(N),R=(0,u.Z)(E,2),O=R[0],L=R[1];(0,f.useEffect)((function(){M(_)}),[_,M]),(0,f.useEffect)((function(){L(N)}),[N,L]),(0,f.useEffect)((function(){if(_&&T){var e=function(e){var n=JSON.stringify(e);return JSON.parse(n)}(_),n=[];e.forEach((function(e){if(T.some((function(n){return n.name===e.name}))){var t=T.find((function(n){return n.name===e.name}));n.push((0,l.Z)({},t))}else n.push(e)})),M(n)}}),[T,_,M]);var V=function(r){var i=[];k.length>0&&(i=function(e,n){return n.some((function(n){return n.name===e.name}))?n.filter((function(n){return n.name!==e.name})):n.some((function(n){return n.name===e.name}))?void 0:[].concat((0,H.Z)(n),[(0,l.Z)({},e)])}(r,k),"metrics"===r.type&&M((function(e){var n=e.some((function(e){return e.id===r.id})),t=(0,H.Z)(e);if(n)return null===t||void 0===t?void 0:t.map((function(e){return e.id===r.id?(0,l.Z)((0,l.Z)({},e),{},{selected:!1}):(0,l.Z)((0,l.Z)({},e),{},{selected:!0})}))}))),i=[].concat((0,H.Z)(i),[(0,l.Z)({},r)]);var u=[];if((null===h||void 0===h?void 0:h.length)<1)u=[{name:o,selected:a.includes(o)&&i.length>0,values:(0,H.Z)(i)}];else if(h.some((function(e){return e.name===o}))){var d,f=(0,s.Z)(h);try{for(f.s();!(d=f.n()).done;){var p=d.value;p.name===o?(p={name:o,selected:a.includes(o)&&i.length>0,values:(0,H.Z)(i)},u.push(p)):u.push(p)}}catch(m){f.e(m)}finally{f.f()}}else u=[].concat((0,H.Z)(h),[{name:o,selected:a.includes(o)&&i.length>0,values:(0,H.Z)(i)}]);var v=null===a||void 0===a?void 0:a.map((function(e){return u.some((function(n){return n.name===e}))?u.find((function(n){return n.name===e})):{name:e,selected:!0,values:[]}})),g=(0,H.Z)(c);g.forEach((function(n){n.id===e.data.id&&(n.labels=v)})),n(Bj(t,g)),C(i)},B=(0,f.useCallback)((function(e){var n=e.target.value;b((function(e){return n})),L(""!==e?function(){return N.filter((function(e){return e.name.toLowerCase().includes(n.toLowerCase())}))}:function(){return N})}),[x]);return(0,Fe.jsxs)("div",{className:"values-column",children:[(0,Fe.jsx)("div",{className:"values-column-title",children:(0,Fe.jsx)(Aj,{resp:_,label:o,onClear:function(i){var a=uo(r.expr||"",i||o,null,"=","value"),l=(0,H.Z)(c);l.forEach((function(n){n.id===e.data.id&&(n.expr=a)})),n(Bj(t,l))},filterState:x,onFilterChange:B})}),(0,Fe.jsxs)("div",{className:"valuelist-content column",children:[w&&(0,Fe.jsx)(Vj,{children:(0,Fe.jsx)(zj,{})}),(null===N||void 0===N?void 0:N.length)>0&&(null===O||void 0===O?void 0:O.map((function(n,t){return(0,f.createElement)(Pj,(0,l.Z)((0,l.Z)({},e),{},{key:t,value:n,actPanel:c,onValueClick:V}))})))]})]})},Aj=function(e){var n=e.resp,t=e.label,r=e.onClear,i=e.filterState,a=e.onFilterChange;return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("span",{children:[(0,Fe.jsx)("span",{className:"key",children:t})," | ",null===n||void 0===n?void 0:n.length]}),(0,Fe.jsx)("span",{children:(0,Fe.jsx)(Fj,{placeholder:"Search For Values...",value:i,onChange:a})}),(0,Fe.jsx)("span",{className:"close-column",onClick:function(e){return r(t)},children:"clear"})]})};function Qj(e){var n=e.data,t=e.name,r=n.dataSourceType,a=(0,i.I0)(),o=(0,i.v9)((function(e){return e[t]})),c=(0,f.useState)(e.labelsSelected),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useMemo)((function(){return"metrics"===r?p.filter((function(e){return"__name__"!==e.name})):p}),[p,r]),g=(0,f.useMemo)((function(){return"metrics"===r?p.filter((function(e){return"__name__"===e.name})):null}),[p,r]);return(0,f.useEffect)((function(){v(e.labelsSelected)}),[e.labelsSelected,v]),(0,Fe.jsxs)("div",{className:"values-container",children:[(0,Fe.jsxs)("div",{className:"values-container-column",children:[null!==g&&p.length>0&&(0,Fe.jsx)(qj,(0,l.Z)((0,l.Z)({},e),{},{label:"__name__",type:"metrics"})),p&&(null===h||void 0===h?void 0:h.map((function(n,t){return(0,f.createElement)(qj,(0,l.Z)((0,l.Z)({},e),{},{label:n,key:t,type:"logs"}))})))]}),(0,Fe.jsx)("div",{style:{margin:"3px",marginBottom:"6px"},children:(0,Fe.jsx)(pb,{onClick:function(){var r=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=n,a=i.split("{")[0],o="";if(t){o=i.split("}")[1];var l=i.split(/[|json]/);if(ao.some((function(e){return l[1].includes(e)}))){var u=" | ".concat(r);o=o.toString().concat(u.toString())}}else o=i.split("}")[1];var c,d=[],f=(0,s.Z)(e);try{var p=function(){var e=c.value;if(e.selected&&e.values&&e.values.length>0){var n=e.values.filter((function(e){return e.selected&&!e.inverted})).map((function(e){return e.name})),t=e.values.filter((function(e){return e.selected&&e.inverted})).map((function(e){return e.name}));n.length>1?d.push("".concat(e.name,'=~"').concat(n.join("|"),'"')):1===n.length&&d.push("".concat(e.name,'="').concat(n[0],'"')),t.forEach((function(n){d.push("".concat(e.name,'!="').concat(n,'"'))}))}};for(f.s();!(c=f.n()).done;)p()}catch(v){f.e(v)}finally{f.f()}return[a,"{",d.join(","),"}",o].join("")}(n.labels,n.expr),i=(0,H.Z)(o);i.forEach((function(t){t.id===e.data.id&&(t.expr=r,t.labels=n.labels)})),a(function(e,n){return"left"===e?m(n):x(n)}(t,i))},isMobile:!1,alterText:"Use Query",loading:!1})})]})}function Wj(e){return e.getTime()+"000000"}function Uj(e){return Math.round(e.getTime()/1e3)}var Jj,Gj=function(e,n,t,r){return"metrics"===n?"".concat(e,"/api/v1/labels"):"".concat(e,"/loki/api/v1/label?start=").concat(t,"&end=").concat(r)},Kj=function(e,n){return{metrics:Uj(e),logs:Wj(e)}[n]};var Yj,Xj,$j=jt.Z.div(Jj||(Jj=(0,r.Z)(["\n background: ",";\n\n .valuesList {\n transition: 0.02s all;\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n flex-direction: column;\n font-size: 12px;\n border-radius: 4px;\n transition: 0.02s all;\n .valuelist-title {\n display: flex;\n flex-direction: column;\n flex: 1;\n justify-content: space-between;\n font-size: 1em;\n flex: 1;\n margin: 5px;\n }\n .valuelist-content {\n display: flex;\n font-size: 14px;\n align-items: center;\n flex-wrap: wrap;\n max-height: 500px;\n overflow: auto;\n .metric-label {\n background: gray;\n }\n }\n .valuelist-filter {\n display: flex;\n flex: 1;\n flex-direction: column;\n\n .valuelist-filter-title {\n font-size: 0.75em;\n }\n input {\n color: white;\n background: $black-quoise;\n padding: 6px 3px;\n border-radius: 4px;\n flex: 1;\n margin: 0px 3px;\n outline: none;\n border: none;\n }\n }\n &::-webkit-scrollbar {\n width: 10px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: $grey-light;\n }\n }\n\n .valuelist-content {\n small {\n color: ",";\n background: ",";\n border: 1px solid ",";\n\n margin: 2px;\n padding: 2px 7px;\n border-radius: 3px;\n line-height: 1.5;\n font-size: 12px;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 40ch;\n transition: .5s all;\n &:hover {\n background: ",";\n }\n &.metric {\n color: ",";\n background: ",";\n }\n }\n }\n\n\n \n .values-container {\n .values-container-column {\n display: flex;\n flex-wrap: wrap;\n max-width: 100%;\n .values-column {\n margin: 5px;\n border-radius: 3px;\n height: fit-content;\n min-width: 278px;\n max-width: 278px;\n flex: 1;\n background: ",";\n\n .column {\n border: 1px solid ",";\n background: ",";\n border-top: none;\n max-height: 350px;\n &::-webkit-scrollbar {\n width: 10px;\n color: #58585898;\n background: #ffffff1f;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: $grey-light;\n }\n }\n .values-column-title {\n padding: 4px;\n font-size: 1em;\n border-radius: 4px 4px 0px 0px;\n display: flex;\n flex: 1;\n transition: 0.02s all;\n justify-content: space-between;\n color: ",";\n background: ",";\n border: 1px solid ",";\n .close-column {\n align-self: flex-end;\n justify-self: end;\n cursor: pointer;\n padding: 2px;\n border-radius: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n\n font-size: 10px;\n &:hover {\n background: $dark-quoise-hover;\n\n color: black;\n }\n }\n }\n }\n }\n }\n"])),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.buttonText}),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.textColor}),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.buttonBorder})),ek=function(e,n){return"left"===e?m(n):x(n)};function nk(e){var n=e.data,t=e.name,r=e.queries,a=(0,i.I0)(),o=n.dataSourceId,c=n.labels,d=n.start,p=n.stop,h=n.id,g=_b.updateLabelSelected,m=(0,f.useState)([]),x=(0,u.Z)(m,2),b=x[0],y=x[1],Z=(0,f.useState)([]),w=(0,u.Z)(Z,2),S=w[0],j=w[1],k=(0,hi.F)(),C=function(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=(0,i.I0)(),d=a||new Date(Date.now()+3e4),p=o||new Date(Date.now()),h=(0,i.v9)((function(e){return e.dataSources})),g=(0,f.useMemo)((function(){var n=h.find((function(n){return n.id===e}));return""!==r&&(n.url=r),n}),[e,h]),m=(0,f.useState)(g.type||""),x=(0,u.Z)(m,2),b=x[0],y=x[1];(0,f.useEffect)((function(){y(g.type)}),[g,y]),n=Kj(new Date(d),b),t=Kj(new Date(p),b);var Z=(0,f.useState)(Gj(g.url,b,n,t)),w=(0,u.Z)(Z,2),S=w[0],j=w[1];(0,f.useEffect)((function(){j(Gj(g.url,b,n,t))}),[j,b,g]);var k=(0,f.useState)([]),C=(0,u.Z)(k,2),T=C[0],_=C[1],I=(0,f.useState)(!1),D=(0,u.Z)(I,2),N=D[0],M=D[1];return(0,f.useEffect)((function(){if("flux"!==g.type&&g.url&&""!==g.url){var e,n=(0,Ny.Uc)(g),t=null===g||void 0===g||null===(e=g.auth)||void 0===e?void 0:e.basicAuth.value,r={},i={};if(t){var a,o,u,d=null===g||void 0===g||null===(a=g.auth)||void 0===a||null===(o=a.fields)||void 0===o?void 0:o.basicAuth,f=(0,s.Z)(d);try{for(f.s();!(u=f.n()).done;){var p=u.value;"user"===p.name&&(i.username=p.value),"password"===p.name&&(i.password=p.value)}}catch(m){f.e(m)}finally{f.f()}r.auth=i}r.options={method:"GET"},r.headers=(0,l.Z)((0,l.Z)({},n),{},{"Content-Type":"application/json"});var h=function(){var e=(0,F.Z)((0,z.Z)().mark((function e(){var n;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(!0),e.prev=1,e.next=4,q().get(S,r).then((function(e){return e})).catch((function(e){var n="";n=e.response?"Error "+e.response.status+"at Labels ":e.request?e.request:e.message,console.log("error requesting labels"),console.log(e),c((0,v.el)({type:Ir.m.error,message:n}))}));case 4:n=e.sent,_(n||[]),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.log("Error fetching labels"),console.log(e.t0);case 12:M(!1);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();h()}}),[S,g]),{response:T,loading:N}}(o,"",d,p),T=C.response,_=C.loading,D=(0,f.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)>0?c.map((function(e){return{name:e.name,selected:e.selected}})):[]}),[c]);(0,f.useEffect)((function(){var e,n;null!==T&&void 0!==T&&null!==(e=T.data)&&void 0!==e&&e.data&&y(null===T||void 0===T||null===(n=T.data)||void 0===n?void 0:n.data)}),[T,y]);var N=(0,f.useMemo)((function(){if((null===b||void 0===b?void 0:b.length)>0)return null===b||void 0===b?void 0:b.map((function(e){return{name:e,selected:!1}}))}),[b]);(0,f.useEffect)((function(){N&&O(N)}),[N]);var M=(0,f.useState)(N),E=(0,u.Z)(M,2),R=E[0],O=E[1];(0,f.useEffect)((function(){if(N&&D){var e=JSON.parse(JSON.stringify(N)).map((function(e){var n=D.find((function(n){return n.name===e.name}));return n?(0,l.Z)({},n):e})),n=e.filter((function(e){return e.selected})).map((function(e){return e.name}));j(n),O(e)}}),[D,N,O]);var L=(0,f.useCallback)((function(e){var n=function(e,n){var t,r=[],i=(0,s.Z)(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.name===n?r.push((0,l.Z)((0,l.Z)({},a),{},{selected:!a.selected})):r.push(a)}}catch(o){i.e(o)}finally{i.f()}return r}(R,e),i=g(S,e);!function(e,n,i){var o=(0,H.Z)(n),s=null===n||void 0===n?void 0:n.filter((function(n){var t=null===e||void 0===e?void 0:e.find((function(e){return e.name===n.name}));return null===t||void 0===t?void 0:t.selected}));if((null===o||void 0===o?void 0:o.length)>0&&null!==n&&void 0!==n&&n.some((function(e){return e.name===i}))){var u=(0,H.Z)(r),c=null===u||void 0===u?void 0:u.map((function(e){return e.id===h?(0,l.Z)((0,l.Z)({},e),{},{labels:s}):e}));a(ek(t,c))}}(n,c,e),O(n),j(i)}),[R,S,c]);return n?(0,Fe.jsx)(I.a,{theme:k,children:(0,Fe.jsx)($j,{children:(0,Fe.jsxs)("div",{className:"valuesList",children:[(0,Fe.jsx)("div",{className:"valuelist-title",children:!_&&(0,Fe.jsx)(Nj,(0,l.Z)((0,l.Z)({},e),{},{labels:R,onLabelSelected:L}))}),(0,Fe.jsx)(Qj,(0,l.Z)((0,l.Z)({},e),{},{labelsSelected:S}))]})})}):null}jt.Z.div(Yj||(Yj=(0,r.Z)(["\n padding: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n"]))),jt.Z.div(Xj||(Xj=(0,r.Z)(["\n padding: 10px;\n color: orangered;\n border: 1px solid orangered;\n border-radius: 3px;\n font-size: 1em;\n"])));var tk,rk,ik,ak,ok,lk,sk,uk=function(e){var n=(0,hi.F)(),t=e.data.browserOpen,r=(0,f.useState)(t),i=(0,u.Z)(r,2),a=i[0],o=i[1];return(0,f.useEffect)((function(){o(t)}),[t]),a&&(0,Fe.jsx)(I.a,{theme:n,children:(0,Fe.jsx)(nk,(0,l.Z)({},e))})},ck=function(e){var n=e.data,t=n.dataSourceType,r=n.isShowStats,a=n.isBuilder,o=e.launchQuery,s=(0,i.v9)((function(e){return e.isEmbed})),u=(0,f.useMemo)((function(){return!a}),[a]);return(0,Fe.jsxs)("div",{style:{margin:"3px 0px"},children:[(0,Fe.jsx)(_j,(0,l.Z)((0,l.Z)({},e),{},{launchQuery:o})),function(n,t,r){return!n&&"logs"===t&&!r&&(0,Fe.jsx)(uk,(0,l.Z)({},e))}(s,t,a),function(n,t){return n&&t&&(0,Fe.jsx)(Ox,(0,l.Z)({},e))}(r,u)]})},dk=t(72453),fk=t(47518),pk=jt.Z.div(tk||(tk=(0,r.Z)(["\n background: ",";\n color: ",";\n display: flex;\n flex-direction:column;\n border-radius: 3px;\n margin-bottom: 3px;\n padding:5px;\n .query-title {\n display: flex;\n align-items: center;\n }\n .query-tools-cont {\n display:flex;\n align-items:center;\n justify-content:space-between;\n flex-wrap:wrap;\n }\n .query-tools {\n display: flex;\n align-items: center;\n flex-wrap:wrap;\n justify-content:space-between;\n flex:1;\n gap:2px;\n margin-top:4px;\n \n }\n .query-id {\n font-size: 13px;\n font-weight: bold;\n margin-left: 5px;\n }\n .query-title-tabs {\n display:flex;\n align-items:center;\n }\n"])),(function(e){var n=e.theme;return"".concat(n.secondaryWidgetContainer)}),(function(e){var n=e.theme;return"".concat(n.textColor)})),vk=jt.Z.button(rk||(rk=(0,r.Z)(["\n background: none;\n border: none;\n padding: 0px 2px;\n cursor: pointer;\n"]))),hk=(0,jt.Z)(yt.Z)(ik||(ik=(0,r.Z)(["\n font-size: 13px;\n color: ",";\n"])),(function(e){return e.theme.textColor})),gk=(0,jt.Z)(fk.Z)(ak||(ak=(0,r.Z)(["\n font-size: 13px;\n color: ",";\n"])),(function(e){return e.theme.textColor})),mk=(jt.Z.div(ok||(ok=(0,r.Z)(["\n display: flex;\n margin-right: 10px;\n flex-direction: row;\n margin-top: 5px;\n align-items: center;\n select {\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius:3px;\n font-size:12px;\n height:26px;\n }\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder})),jt.Z.div(lk||(lk=(0,r.Z)(["\n color: ",";\n display: flex;\n align-items: center;\n font-size: 12px;\n padding: 0px 10px;\n flex: 0;\n white-space: nowrap;\n\n border-radius: 3px 0px 0px 3px;\n"])),(function(e){return e.theme.textColor})),function(e){return(0,ze.iv)(sk||(sk=(0,r.Z)(["\n margin-left: 20px;\n font-family: monospace;\n font-size: 12px;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 100px;\n color: ",";\n background: transparent;\n border: none;\n outline: none;\n"])),e.textColor)});function xk(e){var n=(0,f.useState)(!1),t=(0,u.Z)(n,2),r=t[0],i=t[1],a=(0,f.useState)(e.idRef),l=(0,u.Z)(a,2),s=l[0],c=l[1],d=(0,hr.Fg)();return!0===r?(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(D.Z,{title:s,children:(0,Fe.jsx)("input",{className:(0,ze.cx)(mk(d)),value:o().sanitize(s),placeholder:s,onChange:function(e){e.preventDefault();var n=e.target.value;c(n)},onKeyDown:function(n){"Enter"===n.key&&(e.onIdRefUpdate(s),i(!1))},onBlur:function(n){e.onIdRefUpdate(s),i(!1)}})})}):(0,Fe.jsxs)(Fe.Fragment,{children:[" ",(0,Fe.jsx)(D.Z,{title:s,children:(0,Fe.jsx)("p",{className:(0,ze.cx)(mk(d)),onClick:function(e){return i(!0)},children:s})})]})}var bk={height:"18px",width:"18px",marginRight:"3px"},yk={display:"flex",alignItems:"center"},Zk={display:"flex",alignItems:"flex-end"},wk={height:"14px",width:"14px",marginRight:"3px"};function Sk(e){var n=e.defaultValue,t=e.options,r=(0,f.useMemo)((function(){var e=null===t||void 0===t?void 0:t.find((function(e){return(null===e||void 0===e?void 0:e.value)===n}));return{icon:null===e||void 0===e?void 0:e.icon,label:null===e||void 0===e?void 0:e.label}}),[n,t]);return(0,Fe.jsxs)("div",{style:Zk,children:[(0,Fe.jsx)(Dy.JO,{icon:r.icon,style:wk}),(0,Fe.jsx)("div",{children:r.label})]})}var jk,kk,Ck=function(e){var n=Qy.c.Option,t=e.data,r=t.label,i=t.icon;return(0,Fe.jsx)(n,(0,l.Z)((0,l.Z)({},e),{},{children:(0,Fe.jsxs)("div",{style:yk,children:[(0,Fe.jsx)(Dy.JO,{icon:i,style:bk}),(0,Fe.jsx)("span",{style:{fontSize:"14px"},children:r})]})}))},Tk=function(e){var n=e.data,t=n.icon,r=n.label;return(0,Fe.jsxs)("div",{style:Zk,children:[(0,Fe.jsx)(Dy.JO,{icon:t,style:wk}),(0,Fe.jsx)("div",{children:r})]})},_k=(0,f.forwardRef)((function(e,n){var t=e.options,r=e.onSelectChange,i=(0,hr.Fg)();return(0,Fe.jsx)(Wy.ZP,{styles:Uy(i,100),placeholder:(0,Fe.jsx)(Sk,(0,l.Z)({},e)),options:t,ref:n,components:{Option:Ck,SingleValue:Tk},theme:function(e){return(0,Ny.Pu)(e,i)},onChange:r})})),Ik=function(e){var n=e.value,t=e.onChange,r=e.opts,i=e.extValue,a=(0,f.useRef)(null);(0,f.useEffect)((function(){(null===n||void 0===n?void 0:n.value)!==i&&""!==i&&(a.current.value=i)}),[]),(0,f.useEffect)((function(){(null===n||void 0===n?void 0:n.value)!==i&&""!==i&&null!==a&&void 0!==a&&a.current&&a.current.setValue(i)}),[i]);var o=(0,f.useMemo)((function(){return r.map((function(e){return{value:null===e||void 0===e?void 0:e.value,label:null===e||void 0===e?void 0:e.name,icon:null===e||void 0===e?void 0:e.icon}}))}),[r]);return r?(0,Fe.jsx)(_k,{ref:a,defaultValue:i,options:o,onSelectChange:function(e){t({target:{value:null===e||void 0===e?void 0:e.value}})}}):null},Dk=jt.Z.button(jk||(jk=(0,r.Z)(["\npadding:3px 12px;\nfont-size: 12px;\nline-height:20px;\ncursor:pointer;\nuser-select: none;\nborder:none;\nborder-radius: 3px;\nfont-weight: 500;\nwhite-space: nowrap;\ndisplay:flex;\nalign-items: center;\n"]))),Nk=(0,jt.Z)(Dk)(kk||(kk=(0,r.Z)(["\n background: ",";\n border:1px solid ",";\n color: ",";\n cursor: pointer;\n text-overflow: ellipsis;\n transition: 0.2s all;\n height:26px;\n margin: 0px 6px;\n span {\n margin-left: 4px;\n color: ",";\n }\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover}));function Mk(e){var n=e.side,t=e.isSplit,r=(0,i.v9)((function(e){return e[n]})),a=(0,i.v9)((function(e){return e.left})),o=(0,i.v9)((function(e){return e.right})),s=(0,i.I0)(),c=t?"Close Split View":"Split View";return(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(D.Z,{title:c,children:(0,Fe.jsx)(Nk,{onClick:function(e){(e.preventDefault(),e.stopPropagation(),t)?(!function(e,n,t,r){var i=(0,u.Z)(e,2),a=i[0],o=i[1],s=(0,H.Z)(t),c=null===s||void 0===s?void 0:s.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{open:!1})}));"left"===n&&o&&r(m((0,H.Z)(c))),"right"===n&&a&&r(x((0,H.Z)(c)))}([a[0].open,o[0].open],n,r,s),s(w(!1))):(!function(e,n){var t=(0,u.Z)(e,2),r=t[0],i=t[1],a=(0,H.Z)(r),o=(0,H.Z)(i),s=function(e){return null===e||void 0===e?void 0:e.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{open:!0})}))},c=s(a),d=s(o);n(m(c)),n(x(d))}([a,o],s),s(w(!0)))},children:t?"Close":"Split"})})})}var Ek,Rk=t(88564),Ok=t(28485),Lk=t(65280),Vk=(0,Rk.ZP)((function(e){return(0,Fe.jsx)(Ok.Z,(0,l.Z)((0,l.Z)({},e),{},{TabIndicatorProps:{children:(0,Fe.jsx)("span",{className:"MuiTabs-indicatorSpan"})}}))}))((function(e){var n=e.theme;return{"& .MuiButtonBase-root-MuiTab-root":{maxHeight:"20px"},"& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,width:"100%",backgroundColor:null===n||void 0===n?void 0:n.primaryDark}}})),zk=(0,Rk.ZP)((function(e){return(0,Fe.jsx)(Lk.Z,(0,l.Z)({disableRipple:!0},e))}))((function(e){var n=e.theme;return{textTransform:"none",fontWeight:n.typography.fontWeightRegular,fontSize:"12px",padding:0,marginRight:"8px",color:n.textOff,"&.Mui-selected":{color:n.textColor},"&.Mui-focusVisible":{backgroundColor:"rgba(100, 95, 228, 0.32)"}}})),Fk=function(e){return(0,ze.iv)(Ek||(Ek=(0,r.Z)(["\n background: ",";\n .MuiTabs-root {\n height: 20px !important;\n min-height: 20px;\n }\n .MuiButtonBase-root {\n min-height: 0;\n }\n"])),e.WidgetBg)};function Bk(e){var n,t,r,a,o,l=(0,i.I0)(),s=e.onTabChange,c=e.tabsValue,d=e.isTabs,p=e.activeTabs,v=e.children,h=e.data,g=h.expr,b=h.open,y=h.id,Z=h.start,w=h.stop,S=h.label,j=h.pickerOpen,k=h.idRef,C=e.isQueryOpen,T=(0,hi.F)(),I=(0,i.v9)((function(e){return e.left})),N=(0,i.v9)((function(e){return e.right})),M=(0,i.v9)((function(n){return n[e.name]})),E=(0,i.v9)((function(e){return e.isEmbed})),R=(0,i.v9)((function(e){return e.isSplit})),O=(0,i.v9)((function(e){return e.dataSources})),L=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),V=(0,f.useState)(e.data.dataSourceId),z=(0,u.Z)(V,2),F=z[0],B=z[1],P=(0,f.useMemo)((function(){return O.length>0?O.map((function(e){return{value:e.id,name:e.name,type:e.type,icon:e.icon}})):null}),[O]);(0,f.useEffect)((function(){B(e.data.dataSourceId)}),[]),(0,f.useEffect)((function(){var n;null!==e&&void 0!==e&&null!==(n=e.data)&&void 0!==n&&n.dataSourceId&&B(e.data.dataSourceId)}),[e.data.dataSourceId]);var q=(0,f.useState)({value:(null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.dataSourceId)||"32D16h5uYBqUUzhD",name:(null===O||void 0===O||null===(t=O.find((function(n){var t;return(null===n||void 0===n?void 0:n.id)===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.dataSourceId)})))||void 0===t?void 0:t.name)||(null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.dataSourceId),type:null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.dataSourceType,icon:(null===O||void 0===O||null===(o=O.find((function(n){var t;return n.id===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.dataSourceId)})))||void 0===o?void 0:o.icon)||(null===e||void 0===e?void 0:e.data.dataSourceId)}),A=(0,u.Z)(q,2),Q=A[0],W=A[1],U=function(e,n){return"left"===e?m(n):x(n)};var J=function(e,n){e.forEach((function(e){e.start=Z,e.stop=w,e.label=S})),l(U(n,e))};return(0,Fe.jsxs)(pk,{children:[(0,Fe.jsxs)("div",{className:"query-tools-cont",children:[(0,Fe.jsxs)("div",{className:"query-title-tabs",children:[(0,Fe.jsx)(Hk,{isEmbed:E,idRef:k,expr:g,onIdRefUpdate:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.idRef=n)})),l(U(e.name,t))},isQueryOpen:C}),d&&(0,Fe.jsx)("div",{className:(0,ze.cx)(Fk(T)),children:(0,Fe.jsxs)(Vk,{value:c,onChange:s,children:[(0,Fe.jsx)(zk,{label:"Search"}),(null===p||void 0===p?void 0:p.length)>0&&(null===p||void 0===p?void 0:p.map((function(e,n){return(0,Fe.jsx)(zk,{label:e.name},n)})))]})})]}),!E&&(0,Fe.jsxs)("div",{className:"query-tools",children:[(0,Fe.jsx)("div",{style:{display:"flex",alignItems:"center"}}),(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center",justifySelf:"flex-end"},children:[(0,Fe.jsx)(Ui.Z,{section:"Query Toolbar",localProps:e}),!L&&(0,Fe.jsx)(Mk,{isSplit:R,open:b,side:e.name}),(0,Fe.jsx)(Oi,{id:y,onStopChange:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.stop=n)})),l(U(e.name,t))},onStartChange:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.start=n)})),l(U(e.name,t))},onLabelChange:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.label=n)})),l(U(e.name,t))},onPickerOpen:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.pickerOpen=n)})),l(U(e.name,t))},startTs:Z,stopTs:w,label:S,pickerOpen:j}),(0,Fe.jsx)(D.Z,{title:"Sync Time Ranges",children:(0,Fe.jsx)(dk.Z,{style:{fontSize:"15px",cursor:"pointer",padding:"3px",marginLeft:"10px"},onClick:function(){var e=(0,H.Z)(I),n=(0,H.Z)(N);J(e,"left"),J(n,"right")}})}),(0,Fe.jsx)(Ik,{extValue:F,value:Q,onChange:function(n){var t,r,i=n.target.value,a=O.find((function(e){return(null===e||void 0===e?void 0:e.id)===i})),o=JSON.parse(JSON.stringify(M)),s=P.find((function(e){return e.value===i})),u=function(){try{var e;return(e=localStorage.getItem("dsSelected"))?JSON.parse(e):[]}catch(n){console.log(n)}}(),c=[];(null===u||void 0===u?void 0:u.length)>0?c=(null===u||void 0===u?void 0:u.find((function(n){var t;return(null===n||void 0===n?void 0:n.queryId)===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.id)})))||!1?u.map((function(n){var t;return n.queryId===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.id)?{queryId:null===n||void 0===n?void 0:n.queryId,dataSourceId:null===a||void 0===a?void 0:a.id}:n})):[].concat((0,H.Z)(u),[{queryId:null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.id,dataSourceId:null===a||void 0===a?void 0:a.id}]):c=[].concat((0,H.Z)(u),[{queryId:null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.id,dataSourceId:null===a||void 0===a?void 0:a.id}]);localStorage.setItem("dsSelected",JSON.stringify(c)),W((function(e){return s})),o.forEach((function(n){var t;(null===n||void 0===n?void 0:n.id)===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.id)&&(n.dataSourceId=null===a||void 0===a?void 0:a.id,n.dataSourceType=null===a||void 0===a?void 0:a.type,n.dataSourceURL=null===a||void 0===a?void 0:a.url)})),l(U(e.name,o))},opts:P,label:""}),(0,Fe.jsx)(Dw.Z,{style:{fontSize:"15px",cursor:"pointer",padding:"3px",marginLeft:"10px"},onClick:e.onAddQuery}),(0,Fe.jsx)(ut.Z,{style:{fontSize:"15px",cursor:"pointer",padding:"3px"},onClick:e.onDeleteQuery})]})]})]}),v]})}var Hk=function(e){var n=e.isEmbed,t=e.expr,r=e.isQueryOpen;return(0,Fe.jsxs)("div",{className:"query-title",children:[!n&&(0,Fe.jsx)(vk,{onClick:function(){r[1](!r[0])},children:r[0]?(0,Fe.jsx)(hk,{}):(0,Fe.jsx)(gk,{})}),(0,Fe.jsx)(xk,(0,l.Z)({},e)),n&&(0,Fe.jsx)("p",{style:{marginLeft:"20px",fontFamily:"monospace"},children:t})]})},Pk=t(4760),qk=function(e){var n=e.section,t=e.localProps,r=e.name;return(0,Fe.jsx)("div",{className:"renderer-content",children:function(e,r){return(0,Fe.jsx)(r,{localProps:t,section:n,name:e})}(r,Pk.Q$.getPlugin(n,r).Component)})},Ak=function(){try{var e=JSON.parse(localStorage.getItem("queryData")||"[]")||[];return(0,H.Z)(e)}catch(n){return[]}};function Qk(e,n){return(null===e||void 0===e?void 0:e.length)>1?null===e||void 0===e?void 0:e.filter((function(e){return(null===e||void 0===e?void 0:e.id)!==n})):e}var Wk=function(e){localStorage.setItem("queryData",JSON.stringify(e))},Uk=function(e,n){return e.filter((function(e){return function(e,n){return e.queryId!==n}(e,n)}))},Jk=function(e,n,t){var r=function(e){return e[e.length-1].lastIdx}(e),i=function(e,n){return e>n.length-1?"".concat(n[0]).concat(e):n[e]}(r,t);return function(e,n,t,r){var i=(0,l.Z)((0,l.Z)({},r),{},{id:(0,Ie.x0)(),idRef:t,labels:[],expr:"",lastIdx:e+1,cp:0});return[].concat((0,H.Z)(n),[i])}(r,e,i,n)},Gk=function(e,n){return"left"===e?(r=n,function(e){e({type:"SET_LEFT_PANEL",left:r})}):(t=n,function(e){e({type:"SET_RIGHT_PANEL",right:t})});var t,r},Kk=["children","value","index"];function Yk(e){var n=e.children,t=e.value,r=e.index,i=(0,Vo.Z)(e,Kk);return(0,Fe.jsx)("div",(0,l.Z)((0,l.Z)({role:"tabpanel",hidden:t!==r,id:"simple-tabpanel-".concat(r),"aria-labelledby":"simple-tab-".concat(r)},i),{},{children:t===r&&(0,Fe.jsx)(Fe.Fragment,{children:n})}))}var Xk,$k,eC,nC,tC,rC,iC,aC,oC=function(e){var n=e.name,t=e.data,r=t.id,a=(0,f.useState)(""),o=(0,u.Z)(a,2),s=o[0],c=o[1],d=(0,i.I0)(),p=(0,i.v9)((function(e){return e["".concat(n,"DataView")]})),v=(0,i.v9)((function(e){return e[n]})),h=(0,f.useState)(!0),g=function(e){return(0,f.useMemo)((function(){return Array.from(Array(26)).map((function(e,n){return n+65})).map((function(n){var t;return(null===e||void 0===e||null===(t=e.slice(0,1))||void 0===t?void 0:t.toUpperCase())+"-"+String.fromCharCode(n)}))}),[])}(n),m=(0,hi.F)(),x=(0,f.useState)(0),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,Pk.lu)("Query Item"),S=w.activeTabs,j=w.isActiveTabs;return(0,Fe.jsx)(I.a,{theme:m,children:(0,Fe.jsx)(Bk,(0,l.Z)((0,l.Z)({},e),{},{isQueryOpen:h,onDeleteQuery:function(){var e,t=Qk(v,r),i=Qk(p,r),a=Ak();(null===a||void 0===a?void 0:a.length)>0&&function(){var e=Ak();if((null===e||void 0===e?void 0:e.length)>0){var n=Uk(e,r);Wk(n)}}(),t&&d(Gk(n,t)),i&&d(function(e,n){return"left"===e?(r=n,function(e){e({type:"SET_LEFT_DATAVIEW",leftDataView:r})}):(t=n,function(e){e({type:"SET_RIGHT_DATAVIEW",rightDataView:t})});var t,r}(n,i)),"right"===n&&0===t.length&&d((e=!1,function(n){n({type:"SET_SPLIT_VIEW",isSplit:e})}))},onAddQuery:function(){var e=Jk(v,t,g);d(Gk(n,e))},onTabChange:function(e,n){Z((function(){return n}))},tabsValue:y,isTabs:j,activeTabs:S,children:j?(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)(Yk,{value:y,index:0,children:h[0]&&(0,Fe.jsx)(ck,(0,l.Z)((0,l.Z)({},e),{},{launchQuery:s}))}),null===S||void 0===S?void 0:S.map((function(n,t){return(0,Fe.jsx)(Yk,{value:y,index:t+1,children:(0,Fe.jsx)(qk,{name:n.name,section:"Query Item",localProps:{props:e,setLaunchQuery:c}})},t)}))]}):(0,Fe.jsx)(Fe.Fragment,{children:h[0]&&(0,Fe.jsx)(ck,(0,l.Z)((0,l.Z)({},e),{},{launchQuery:s}))})}))})},lC=function(e){return(0,ze.iv)(Xk||(Xk=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n margin: 6px;\n"])),e.mainBgColor,e.buttonBorder)},sC=function(e){var n=e.queries,t=(0,hi.F)();return n&&Array.isArray(n)&&(null===n||void 0===n?void 0:n.length)>0?(0,Fe.jsxs)("div",{className:(0,ze.cx)(lC(t)),children:[null===n||void 0===n?void 0:n.map((function(n,t){return(0,f.createElement)(oC,(0,l.Z)((0,l.Z)({},e),{},{data:n,key:t}))})),(0,Fe.jsx)(Ui.Z,{section:"Queries",localProps:{queries:n,theme:t}})]}):null},uC=jt.Z.div($k||($k=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n flex: 1;\n width: 100%;\n min-width:50%;\n"]))),cC=function(e){var n,t=e.name,r=(0,i.I0)(),a=(0,i.v9)((function(e){return e.isSplit})),o=(0,i.v9)((function(e){return e[t]})),s=(0,p.TH)().hash,c=(0,f.useRef)(null),d=(0,f.useState)(0),v=(0,u.Z)(d,2),h=v[0],g=v[1];return(0,f.useEffect)((function(){var e,n=new URLSearchParams(s.replace(/#/,"")).get(t),i=[];n&&(i=JSON.parse(decodeURIComponent(n))),(null===(e=i)||void 0===e?void 0:e.length)>0&&r(function(e,n){return"left"===e?(t=n,function(e){e({type:"SET_LEFT_PANEL",left:t})}):(r=n,function(e){e({type:"SET_RIGHT_PANEL",right:r})});var t,r}(t,i));var a=function(){g(c.current.clientWidth)};return window.addEventListener("resize",a),function(){window.removeEventListener("resize",a)}}),[]),(0,f.useEffect)((function(){var e;"number"===typeof(null===c||void 0===c||null===(e=c.current)||void 0===e?void 0:e.clientWidth)&&g(c.current.clientWidth)}),[null===c||void 0===c||null===(n=c.current)||void 0===n?void 0:n.clientWidth]),(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsxs)(uC,{isSplit:a,ref:c,children:[(0,Fe.jsx)(sC,(0,l.Z)((0,l.Z)({},e),{},{width:h,queries:o})),(0,Fe.jsx)(Ui.Z,{section:"Panel",localProps:{props:e,panel:o,width:h}}),(0,Fe.jsx)(Tx,(0,l.Z)((0,l.Z)({},e),{},{splitted:a}))]})})},dC=(0,jt.Z)(ht.Z)(eC||(eC=(0,r.Z)(["\n background: ",";\n"])),(function(e){return e.theme.inputBg})),fC=(0,jt.Z)(Ct.Z)(nC||(nC=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n cursor: pointer;\n font-size: 13px;\n background-color: transparent;\n padding: 6px 10px;\n border: none;\n border-radius: 3px 3px 0px 0px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid transparent;\n transition: 0.2s all;\n\n &:hover {\n background-color: ",";\n }\n\n &:focus {\n color: ",";\n background: ",";\n border-radius: 3px 3px 0px 0px;\n\n outline-offset: 2px;\n }\n\n &."," {\n border-bottom: 1px solid ",";\n }\n\n &."," {\n opacity: 0.5;\n cursor: not-allowed;\n }\n @media screen and (max-width: 360px) {\n span {\n display: none;\n }\n padding: 5px 20px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),Tt.Z.selected,(function(e){return e.theme.primaryDark}),kt.Z.disabled),pC=(jt.Z.div(tC||(tC=(0,r.Z)(["\n padding: 0px 15px;\n font-size: 13px;\n display: flex;\n align-items: center;\n color: ",";\n justify-content: space-between;\n background: ",";\n height: 37px;\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.tabHeader})),(0,jt.Z)(Mt.Z)(rC||(rC=(0,r.Z)(["\n width: 100%;\n background: ",";\n height: inherit;\n"])),(function(e){return e.theme.widgetContainer}))),vC=(0,jt.Z)(Nt.Z)(iC||(iC=(0,r.Z)(["\n min-width: 320px;\n background: ",";\n border-bottom: 4px solid ",";\n display: flex;\n align-items: center;\n align-content: space-between;\n"])),(function(e){return e.theme.tabHeader}),(function(e){return e.theme.historyRow}));function hC(){return(0,Fe.jsxs)(dC,{defaultValue:0,children:[(0,Fe.jsxs)(vC,{children:[(0,Fe.jsx)(fC,{children:(0,Fe.jsx)("span",{children:"Left"})}),(0,Fe.jsx)(fC,{children:(0,Fe.jsx)("span",{children:"Right"})})]}),(0,Fe.jsx)(pC,{value:0,children:(0,Fe.jsx)(cC,{name:"left"})}),(0,Fe.jsx)(pC,{value:1,children:(0,Fe.jsx)(cC,{name:"right"})})]})}var gC=jt.Z.div(aC||(aC=(0,r.Z)(["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: inherit;\n width: 100%;\n flex: 1;\n\n background-color: "," !important;\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: "," !important;\n }\n .panels-container {\n display: flex;\n background: ",";\n height: calc(100vh - 45px);\n }\n"])),(function(e){return e.theme.mainBgColor}),(function(e){return e.theme.scrollbarThumb}),(function(e){return e.theme.shBgColor}));function mC(e){var n=e.theme;return(0,Fe.jsxs)(I.a,{theme:n,children:[(0,Fe.jsx)(gC,{children:(0,Fe.jsx)(hC,{})}),(0,Fe.jsx)(Wi,{})]})}function xC(e){var n=e.theme,t=(e.isEmbed,e.isSplit),r=e.settingsDialogOpen,a=(0,f.useState)(0),o=(0,u.Z)(a,2),l=o[0],s=o[1],c=(0,f.useState)(0),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useState)(0),g=(0,u.Z)(h,2),m=g[0],x=g[1],b=(0,f.useState)(0),y=(0,u.Z)(b,2),Z=y[0],w=y[1],S=(0,f.useState)(0),j=(0,u.Z)(S,2),k=j[0],C=j[1],T=(0,f.useState)(0),_=(0,u.Z)(T,2),D=_[0],N=_[1],M=(0,f.useState)(!1),E=(0,u.Z)(M,2),R=E[0],O=E[1],L=(0,f.useState)(!1),V=(0,u.Z)(L,2),z=V[0],F=V[1],B=(0,f.useRef)(null);(0,f.useEffect)((function(){var e=B.current.clientWidth;s(B.current.clientWidth),v(e/(t?2:1)),t&&x(e/2),N(t?e/4>370?e/4:370:e)}),[v,x,s,N,D,t]),(0,f.useEffect)((function(){var e=B.current.clientWidth;w(p/e),t&&C(m/e)}),[p,m,t]),(0,f.useEffect)((function(){var e=function(){var e=B.current.clientWidth;s(e),v(e*Z),t&&x(e*k)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[l,p,m,Z,k,t]);var H=(0,i.v9)((function(e){return e.left})),P=(0,i.v9)((function(e){return e.right}));(0,f.useEffect)((function(){O(H[0].open),F(P[0].open)}),[H[0].open,P[0].open]);return(0,Fe.jsxs)(I.a,{theme:n,children:[(0,Fe.jsx)(gC,{children:function(e,n){return(0,Fe.jsxs)("div",{className:"panels-container",ref:B,children:[!0===e&&(0,Fe.jsx)(cC,{name:"left"}),!0===n&&(0,Fe.jsx)(cC,{name:"right"})]})}(R,z)}),(0,Fe.jsx)(vr.ZP,{open:r}),(0,Fe.jsx)(Wi,{})]})}var bC=t(46271);var yC=function(e){return function(n){n({type:"SHOW_DATA_SOURCE_SETTING",showDataSourceSetting:e})}};var ZC=function(e){var n={},t=(null===e||void 0===e?void 0:e.cors)||!1,r=OZ(e),i=(0,l.Z)((0,l.Z)({},r),{},{"Content-Type":"application/json",Accept:"application/json"}),a={method:"GET",headers:i};return!0===t&&(a.mode="cors"),n.options=a,n.headers=i,n.validateStatus=function(e){return e>=200&&e<400||404===e||500===e},n},wC=function(){var e=(0,F.Z)((0,z.Z)().mark((function e(n,t,r){return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q().get("".concat(n,"/ready"),t).then((function(e){var n,t;if(e&&null!==e&&void 0!==e&&e.status&&null!==e&&void 0!==e&&e.headers)return r={status:e.status,contentType:null===e||void 0===e||null===(n=e.headers)||void 0===n?void 0:n["content-type"],contentLength:null===e||void 0===e||null===(t=e.headers)||void 0===t?void 0:t["content-length"]}})).catch((function(e){return e})).finally((function(){return r}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}();function SC(e,n,t,r){return jC.apply(this,arguments)}function jC(){return(jC=(0,F.Z)((0,z.Z)().mark((function e(n,t,r,i){var a,o,s,u,c,d,f,p;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={},o=ZC(t),s=!1,u=(0,l.Z)({},o),""!==(null===r||void 0===r?void 0:r.username)&&i&&(u.auth=r),e.prev=5,e.next=8,wC(n,u,a);case 8:c=e.sent,a=c,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),s=!1;case 15:return e.prev=15,!a||200!==(null===(d=a)||void 0===d?void 0:d.status)||"application/json; charset=utf-8"!==(null===(f=a)||void 0===f?void 0:f.contentType)&&"0"!==(null===(p=a)||void 0===p?void 0:p.contentLength)||(s=!0),e.finish(15);case 18:return e.abrupt("return",s);case 19:case"end":return e.stop()}}),e,null,[[5,12,15,18]])})))).apply(this,arguments)}function kC(){return(kC=(0,F.Z)((0,z.Z)().mark((function e(n,t,r){var i,a,o,u,c,d,f,p,v,h,g,m,x,b,y,Z,w,S;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=window.location.origin,d=n.find((function(e){return"logs"===e.type})),f=null===d||void 0===d||null===(i=d.auth)||void 0===i||null===(a=i.basicAuth)||void 0===a?void 0:a.value,p={username:"",password:""},v=null===d||void 0===d||null===(o=d.auth)||void 0===o||null===(u=o.fields)||void 0===u?void 0:u.basicAuth,h=(null===v||void 0===v?void 0:v.length)>0,f&&h){g=(0,s.Z)(v);try{for(g.s();!(m=g.n()).done;)"user"===(null===(x=m.value)||void 0===x?void 0:x.name)&&(p.username=(null===x||void 0===x?void 0:x.value)||""),"password"===(null===x||void 0===x?void 0:x.name)&&(p.password=(null===x||void 0===x?void 0:x.value)||"")}catch(j){g.e(j)}finally{g.f()}}if(b=!1,y=!1,""===(null===d||void 0===d?void 0:d.url)){e.next=13;break}return e.next=12,SC(d.url,d,p,f);case 12:b=e.sent;case 13:if(b){e.next=18;break}return e.next=16,SC(c,d);case 16:(y=e.sent)&&!b?(Z=(0,H.Z)(n),w=JSON.parse(JSON.stringify(Z)),S=null===w||void 0===w?void 0:w.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{url:c})})),localStorage.setItem("dataSources",JSON.stringify(S)),t((0,_y.Z)(S))):b||y||r("datasources");case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var CC,TC=t(42520),_C=function(e){return(0,ze.iv)(CC||(CC=(0,r.Z)(["\n background: ",";\n"])),e.widgetContainer)};function IC(){var e=(0,p.s0)(),n=(0,i.v9)((function(e){return e.dataSources})),t=(0,p.TH)().hash,r=(0,f.useMemo)((function(){return new URLSearchParams(t.replace(/#/,""))}),[t]);!function(){var e=(0,f.useMemo)((function(){return window.matchMedia("(prefers-color-scheme: light)").matches}),[]),n=(0,i.I0)(),t=(0,i.v9)((function(e){return e.urlQueryParams})),r=(0,i.v9)((function(e){return e.start})),a=(0,i.v9)((function(e){return e.stop})),d=(0,i.v9)((function(e){return e.label})),_=(0,i.v9)((function(e){return e.from})),I=(0,i.v9)((function(e){return e.to})),D=(0,i.v9)((function(e){return e.step})),N=(0,i.v9)((function(e){return e.isSubmit})),M=(0,i.v9)((function(e){return e.isEmbed})),E=(0,i.v9)((function(e){return e.time})),R=(0,i.v9)((function(e){return e.left})),O=(0,i.v9)((function(e){return e.right})),L=(0,i.v9)((function(e){return e.theme})),V=(0,i.v9)((function(e){return e.autoTheme})),z=(0,i.v9)((function(e){return e.isSplit})),F=(0,f.useState)(e?"light":L),B=(0,u.Z)(F,2),H=B[0],P=B[1];(0,f.useEffect)((function(){P(L)}),[L]);var q={start:r,step:D,stop:a,label:d,from:_,to:I,time:E,isSubmit:N,isEmbed:M,theme:L,autoTheme:V,left:R,right:O,isSplit:z},A={start:v.qv,step:v.F1,stop:v.wW,label:v.Xn,from:h,to:b,time:v.HN,isSubmit:v.E9,isEmbed:g,theme:v.Dc,left:m,right:x,isSplit:w,autoTheme:v.XD},Q=function(e){return(null===e||void 0===e?void 0:e.getTime())+"000000"},W=function(e,n){try{var t=JSON.parse(e);return t&&void 0!==t?t:n}catch(r){return n}},U=(0,p.TH)().hash;(0,f.useEffect)((function(){var e=new URLSearchParams(U.replace(/#/,""));if(U.length>0){var r,i=t,a=(0,s.Z)(e.entries());try{for(a.s();!(r=a.n()).done;){var d=(0,u.Z)(r.value,2),f=d[0],p=d[1];i[f]=p}}catch(v){a.e(v)}finally{a.f()}Object.keys(i).length>0&&(n(Z((0,l.Z)((0,l.Z)({},t),{},{startParams:i}))),n(y(o().sanitize(U))),Object.keys(i).forEach((function(e){if((S.includes(e)||j.includes(e))&&""!==i[e])n(A[e](o().sanitize(i[e])));else if("theme"===e)n(A[e](o().sanitize(H)));else if(C.includes(e)&&""!==i[e]){var t=i[e]/1e6,r=new Date(c(t).format("YYYY-MM-DDTHH:mm:ss.SSSZ"));n(A[e](r))}else if(T.includes(e))try{var a=W(i[e],!1);n(A[e](a))}catch(s){console.log(s)}else if(k.includes(e))try{var l=W(decodeURIComponent(i[e]),[]);(null===l||void 0===l?void 0:l.length)>0&&n(A[e](l))}catch(s){console.log(s)}})))}else S.concat(C).concat(T).concat(k).forEach((function(n){var t;if(S.includes(n))e.set(n,o().sanitize(null===(t=q[n])||void 0===t?void 0:t.toString()));else if("theme"===n)e.set(n,o().sanitize(H.toString()));else if(C.includes(n)){var r,i=1e6*(null===(r=q[n])||void 0===r?void 0:r.getTime());e.set(n,o().sanitize(i.toString()))}else if(T.includes(n))try{e.set(n,W(q[n],!1))}catch(l){console.log(l)}else if(k.includes(n))try{var a=JSON.stringify(q[n]);e.set(n,a)}catch(l){console.log(l)}})),window.location.hash=e}),[]),(0,f.useEffect)((function(){if(U.length>0){var e,n=new URLSearchParams(U.replace(/#/,"")),t={},r=(0,s.Z)(n.entries());try{for(r.s();!(e=r.n()).done;){var i=(0,u.Z)(e.value,2),a=i[0],l=i[1];t[a]=l}}catch(c){r.e(c)}finally{r.f()}Object.keys(q).forEach((function(e){if(S.includes(e)&&t[e]!==q[e]){var r=o().sanitize(q[e].toString().trim());n.set(e,r)}else if(C.includes(e)&&t[e]!==Q(q[e])){var i=Q(q[e]);n.set(e,o().sanitize(i))}else if(T.includes(e)&&t[e]!==q[e])try{n.set(e,W(q[e],!1))}catch(s){console.error(s)}else if("left"===e){var a=JSON.stringify(R);n.set("left",o().sanitize(a))}else if("right"===e){var l=JSON.stringify(O);n.set("right",o().sanitize(l))}})),window.location.hash=n}}),[q])}();var a=function(e){var n="",t=!1,r=(0,i.v9)((function(e){return e.currentUser})),a=(0,f.useMemo)((function(){return e.has("cookie")||!1}),[e]),l=(0,f.useMemo)((function(){return a?o().sanitize(e.get("cookie")):""}),[e,a]),s=(0,bC.Z)([l]),c=(0,u.Z)(s,2),d=c[0],p=(c[1],(0,bC.Z)(["user-cookie"])),v=(0,u.Z)(p,2),h=v[0],g=(v[1],r);if(null!==h&&void 0!==h&&h["user-cookie"])try{g=atob(h["user-cookie"])}catch(m){console.log("could not parse user cookie")}return d[l]&&""!==d[l]&&(n=d[l],t=!0),{cookieAuth:n,cookiesAvailable:t,cookieUser:g}}(r),d=a.cookiesAvailable,I=a.cookieAuth,D=a.cookieUser,N=function(e){var n=(0,f.useMemo)((function(){return e.has("url")}),[e]);return{url:(0,f.useMemo)((function(){return n?o().sanitize(e.get("url")):""}),[e,n]),urlAvailable:n}}(r),M=N.urlAvailable,E=N.url;(0,f.useEffect)((function(){d&&!M||!d&&M||d&&""!==I&&M&&""!==M?function(e,n,t,r,i,a){var o="",s=!1,c=!1,d={};if(r&&(c=!0),i){var f=t.split("@"),p=(0,u.Z)(f,2),v=p[0],h=(p[1],v.split(":")),g=(0,u.Z)(h,2),m=g[0],x=g[1];""!==m&&""!==x&&(d={user:m,password:x},s=!0)}!r&&s&&(o=window.location.protocol+"//"+window.location.host,c=!0),""===o&&(c=!0,o=decodeURIComponent(n));var b=(0,H.Z)(a),y=JSON.parse(JSON.stringify(b)),Z=null===y||void 0===y?void 0:y.map((function(e){var n;return(0,l.Z)((0,l.Z)({},e),{},{url:c?o:e.url,auth:(0,l.Z)((0,l.Z)({},e.auth),{},{basicAuth:(0,l.Z)((0,l.Z)({},e.auth.basicAuth),{},{value:s}),fields:(0,l.Z)((0,l.Z)({},e.auth.fields),{},{basicAuth:s?null===(n=(0,H.Z)(e.auth.fields.basicAuth))||void 0===n?void 0:n.map((function(e){return"user"===e.name?(0,l.Z)((0,l.Z)({},e),{},{value:d.user}):"password"===e.name?(0,l.Z)((0,l.Z)({},e),{},{value:d.password}):e})):(0,H.Z)(e.auth.fields.basicAuth)})})})}));t&&d&&e(yC(!1)),localStorage.setItem("dataSources",JSON.stringify(Z)),e((0,_y.Z)(Z))}(L,E,I,M,d,n):function(e,n,t){kC.apply(this,arguments)}(n,L,e)}),[]),(0,f.useEffect)((function(){if(D&&"string"===typeof D)try{L((0,TC.l)(JSON.parse(D)))}catch(e){console.log(e)}}),[D]),(0,f.useEffect)((function(){var e={url:o().sanitize(window.location.hash),cookiesAvailable:d};localStorage.setItem(btoa("cookie-location"),btoa(JSON.stringify(e)))}),[d]);var R=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),O=(0,_.useMediaQuery)({query:"(prefers-color-scheme: dark)"}),L=(0,i.I0)(),V=(0,i.v9)((function(e){return e.isSplit})),z=(0,i.v9)((function(e){return e.isEmbed})),F=(0,hi.F)(),B=(0,i.v9)((function(e){return e.autoTheme})),P=(0,i.v9)((function(e){return e.settingsDialogOpen}));(0,f.useEffect)((function(){if(B){var e=O?"dark":"light";L((0,v.Dc)(e)),localStorage.setItem("theme",JSON.stringify({theme:e,auto:B}))}}),[O,B,L]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_C(F)),children:function(e,n,t,r){return e?(0,Fe.jsx)(mC,{isEmbed:t,theme:F,settingsDialogOpen:r}):(0,Fe.jsx)(xC,{isEmbed:t,isSplit:n,theme:F,settingsDialogOpen:r})}(R,z,V,P)})}},42520:function(e,n,t){t.d(n,{l:function(){return r}});var r=function(e){return function(n){return n({type:"SET_CURRENT_USER",currentUser:e})}}}}]); \ No newline at end of file +"use strict";(self.webpackChunkqryn_view=self.webpackChunkqryn_view||[]).push([[380],{9964:function(e,n){n.Z=function(e){return function(n){n({type:"SET_DATA_SOURCES",dataSources:e})}}},12624:function(e,n,t){t.r(n),t.d(n,{default:function(){return IC}});var r=t(30168),i=t(56352),a=t(16806),o=t.n(a),l=t(1413),s=t(37762),u=t(29439),c=t(70816),d=t.n(c),f=t(47313),p=t(58467),v=t(87975);function h(e){return function(n){n({type:"SET_FROM_TIME",toTime:e})}}var g=function(e){return function(n){n({type:"SET_IS_EMBED",isEmbed:e})}},m=function(e){return function(n){n({type:"SET_LEFT_PANEL",left:e})}},x=function(e){return function(n){n({type:"SET_RIGHT_PANEL",right:e})}};function b(e){return function(e){e({type:"SET_TO_TIME"})}}var y=function(e){return function(n){n({type:"SET_URL_LOCATION",urlLocation:e})}},Z=function(e){return function(n){n({type:"SET_URL_QUERY_PARAMS",urlQueryParams:e})}},w=function(e){return function(n){n({type:"SET_SPLIT_VIEW",isSplit:e})}},S=["step","theme","time"],j=["label"],k=["left","right"],C=["start","stop"],T=["isSubmit","isSplit","autoTheme","isEmbed"];var _=t(66367),I=t(36426),D=t(78899),N=t(95765),M=t(16429),E=t(83929),R=t(44758),O=t(36063),L=t(62256),V=function(e){return function(n){n({type:"SET_QUERY_HISTORY",queryHistory:e})}},z=t(74165),F=t(15861),B=t(4942),H=t(93433),P=t(31881),q=t.n(P),A=t(21090),Q=function(e){return function(n){n({type:"SET_IS_EMPTY_VIEW",isEmptyView:e})}};var W=t(59376),U=t(41156),J=t(34605),G=t(98589),K=t(33532),Y=t(99004),X=t(3051),$=t(31700),ee=t(93601),ne=t(8859),te=t(50514),re=t(32288),ie=t(34193),ae=t(98789),oe=t(79254),le=t(91469),se=t(60206),ue=t(6021),ce=t(56148),de=t(78392),fe=t(58892),pe=function(){for(var e=arguments.length,n=new Array(e),t=0;t1&&void 0!==arguments[1]?arguments[1]:"logs";if("flux"===n||"traces"===n)try{return e}catch(m){console.log(m)}else{var t=Ne(e);try{for(var r=[],i=e.length,a=t.length,o=0;o1&&void 0!==arguments[1]?arguments[1]:"logs",a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=null===(n=A.Z.getState())||void 0===n||null===(t=n[o.panel])||void 0===t?void 0:t.find((function(e){return e.id===o.id}));s&&(o.dataSourceId=s.dataSourceId,o.url=s.dataSourceURL);var u=null===(r=A.Z.getState())||void 0===r?void 0:r.theme,c=Ve.n[u];return e.length>0&&"traces"===i?null===e||void 0===e?void 0:e.map((function(e){return"durationMs"===e.accessorKey?{header:"Duration Ms",accessorKey:e.accessorKey,cell:function(e){return function(e){return e.getValue()+" ms"}(e)}}:"startTimeUnixNano"===e.accessorKey?{header:"Start Time",accessorKey:e.accessorKey,cell:function(e){return function(e){return new Oe.Z("en-US").format(e.getValue()/1e6)}(e)}}:"traceID"===e.accessorKey||"traceId"===e.accessorKey?{header:"Trace Id",accessorKey:e.accessorKey,cell:function(e){return(0,Fe.jsx)("button",{onClick:function(n){return function(e,t){var r=A.Z.dispatch,i=A.Z.getState()[e.panel],a=A.Z.getState().right,o=window.innerWidth<=1013,s=i.find((function(n){return n.id===e.id}));"left"!==e.panel||o||r(w(!0));var u=JSON.parse(JSON.stringify(a)),c=JSON.parse(JSON.stringify(s));try{var d=(0,l.Z)((0,l.Z)({},u[0]),{},{id:u[0].id,idRef:"Trace "+t,panel:"right",queryType:"range",dataSourceType:"traces",dataSourceId:e.dataSourceId,dataSourceURL:e.url,expr:t,limit:100,step:100,tableView:!1,chartView:!1,isShowTs:!1,isBuilder:!1,isLogsVolume:!1,browserOpen:!1,open:!0,labels:[],values:[],direction:"backwards"});r(x([d])),r(Tn("traces",t,"range",c.limit||100,"right",d.id,"backwards",e.dataSourceId,e.url))}catch(n){console.log(n)}}(o,e.getValue())},className:(0,ze.cx)(He(c)),children:e.getValue()})}}:"rootServiceName"===e.accessorKey?{header:"Service Name",accessorKey:e.accessorKey,cell:function(e){return e.getValue()}}:"rootTraceName"===e.accessorKey?{header:"Trace Name",accessorKey:e.accessorKey,cell:function(e){return e.getValue()}}:e})):e.length>0&&"flux"===i?null===e||void 0===e?void 0:e.map((function(e){return e.accessorKey===a||"_time"===e.accessorKey?{header:"Time",accessorKey:e.accessorKey,cell:function(e){return function(e){return Be(e.getValue()).format("YYYY-MM-DDTHH:mm:ss.SSZ")}(e)}}:e})):e.length>0?[{header:"Time",accessorKey:"time",cell:function(e){return function(e){return Be(parseInt(e.getValue()+"000")).format("YYYY-MM-DDTHH:mm:ss.SSZ")}(e)}}].concat((0,H.Z)(e),[{header:"Value",accessorKey:"value"}]):[]}function qe(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"logs",t=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=null===e||void 0===e?void 0:e.map((function(e){return{header:e,accessorKey:e,id:e,cell:function(e){return e.getValue()}}}));return Pe(i,n,t,r)}Oe.Z.addDefaultLocale(Le.Z);var Ae=function(e){return function(n){n({type:"SET_LEFT_DATAVIEW",leftDataView:e})}},Qe=function(e){return function(n){n({type:"SET_RIGHT_DATAVIEW",rightDataView:e})}};function We(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}function Ue(e){var n=e.result,t=e.debugMode,r=e.dispatch,i=e.panel,a=e.id,o=e.type,s=e.dsType,c=e.raw,f={panel:i,id:a,type:o};if("traces"===o)try{var p=Me(n);if(p.length>0){var v=function(e){var n=e[0],t=Object.entries(n);if(t){var r=t.find((function(e){var n=(0,u.Z)(e,2),t=(n[0],n[1]);return d().isDate(t)}));return(null===r||void 0===r?void 0:r[0])||null}}(n),h=qe(p,o,v,{panel:i,id:a,type:o}),g=Ee(n,o),m={columnsData:h,dataRows:g,panel:i,id:a};if((null===h||void 0===h?void 0:h.length)>0&&(null===g||void 0===g?void 0:g.length)>0){var x,b,y={id:a,type:"vector",raw:c,dsType:s,data:{tableData:m},tableData:m,total:(null===m||void 0===m||null===(x=m.dataRows)||void 0===x?void 0:x.length)||0},Z=We(i),w=Z.action,S=Z.state,j=null===(b=A.Z.getState())||void 0===b?void 0:b[S];if(j.some((function(e){return e.id===y.id}))){r(w([]));var k=j.filter((function(e){return e.id!==y.id}));r(w([].concat((0,H.Z)(k),[(0,l.Z)({},y)])))}else{r(w([].concat((0,H.Z)(j),[y])))}}}}catch($){console.log($)}else if("flux"===o)try{var C=Me(n);if(C.length>0){var T=function(e){var n=e[0],t=Object.entries(n);if(t){var r=t.find((function(e){var n=(0,u.Z)(e,2),t=(n[0],n[1]);return d().isDate(t)}));return(null===r||void 0===r?void 0:r[0])||null}}(n),_=qe(C,o,T,f),I=Ee(n,o),D={columnsData:_,dataRows:I,panel:i,id:a};if((null===_||void 0===_?void 0:_.length)>0&&(null===I||void 0===I?void 0:I.length)>0){var N,M,E={id:a,type:"vector",data:{tableData:D},raw:c,dsType:s,tableData:D,total:(null===D||void 0===D||null===(N=D.dataRows)||void 0===N?void 0:N.length)||0},R=We(i),O=R.action,L=R.state,V=null===(M=A.Z.getState())||void 0===M?void 0:M[L];if(V.some((function(e){return e.id===E.id}))){r(O([]));var z=V.filter((function(e){return e.id!==E.id}));r(O([].concat((0,H.Z)(z),[(0,l.Z)({},E)])))}else{r(O([].concat((0,H.Z)(V),[E])))}}}}catch($){console.log($)}else try{var F=Ne(n);if(F.length>0){var B=qe(F,o,null,f),P=Ee(n),q={columnsData:B,dataRows:P,panel:i,id:a};if(B.length>0&&P.length>0){var Q,W,U={id:a,type:"vector",data:{tableData:q}||{},raw:c,dsType:s,tableData:q||{},total:(null===q||void 0===q||null===(Q=q.dataRows)||void 0===Q?void 0:Q.length)||0},J=We(i),G=J.action,K=J.state,Y=null===(W=A.Z.getState())||void 0===W?void 0:W[K];if(Y.some((function(e){return e.id===U.id}))){r(G([]));var X=Y.filter((function(e){return e.id!==U.id}));r(G([].concat((0,H.Z)(X),[(0,l.Z)({},U)])))}else{r(G([].concat((0,H.Z)(Y),[U])))}}}}catch($){t&&console.log("\ud83d\udea7 getData / getting an error from rendering vector type streams"),console.log($)}}function Je(e){return(null===e||void 0===e?void 0:e.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{id:(0,Ie.x0)()})})))||[]}function Ge(e){var n,t=[{header:"Time",accessorKey:"time",cell:function(e){return function(e){return d()(e.getValue()).format("YYYY-MM-DDTHH:mm:ss.SSZ")}(e)}},{header:"Metric",accessorKey:"metric"},{header:"Value",accessorKey:"value"}],r=function(e){return e.map((function(e){var n=e.metric,t=e.values;return{metric:JSON.stringify(n),rows:t.map((function(e){var t=(0,u.Z)(e,2),r=t[0],i=t[1];return{time:r,metric:JSON.stringify(n),value:i}})),get rowsLength(){var e;return null===(e=this.rows)||void 0===e?void 0:e.length},get title(){return"'".concat(this.metric,"' (").concat(this.rowsLength,")")}}}))}(e),i=[],a=(0,s.Z)(r);try{for(a.s();!(n=a.n()).done;){var o=n.value;i.push(o.rows)}}catch(c){a.e(c)}finally{a.f()}var l=(0,De.sortBy)(i.flat(),(function(e){return e.time}));return{columnsData:t,dataRows:l,total:l.length}}function Ke(e){var n=e.result,t=e.debugMode,r=e.dispatch,i=e.panel,a=e.id,o=e.raw,s=e.dsType,u=e.isLogsVolume,c=Ge(n),d=function(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}(i);try{var f,p=Je(n),v={id:a,type:"matrix",tableData:c,data:p,dsType:s,raw:o,total:(null===p||void 0===p?void 0:p.length)||0},h=d.action,g=d.state,m=null===(f=A.Z.getState())||void 0===f?void 0:f[g];if(m.some((function(e){return e.id===v.id}))){if(u){var x=(0,H.Z)(m).map((function(e){return e.id===a?(0,l.Z)((0,l.Z)({},e),{},{logsVolumeData:p,total:p.length}):e}));r(h([])),r(h(x))}else{r(h([]));var b=m.filter((function(e){return e.id!==v.id}));r(h([].concat((0,H.Z)(b),[(0,l.Z)({},v)])))}}else{r(h([].concat((0,H.Z)(m),[v])))}}catch(y){t&&console.log("\ud83d\udea7 getData / getting an error from rendering matrix type streams"),console.log(y)}}var Ye=function(e){return function(n){n({type:"SET_LOGS",logs:e})}},Xe=t(69059);function $e(e){return(0,Fe.jsx)("span",{title:e.getValue(),children:e.getValue()})}function en(e){var n=[{id:"time",header:"Time",accessorKey:"time",cell:function(e){return n=e,d()(parseInt(n.getValue())/1e6).format("YYYY-MM-DDTHH:mm:ss.SSZ");var n}},{id:"stream",header:"Stream",accessorKey:"stream",cell:function(e){return $e(e)}},{id:"log",accessorKey:"log",header:"Log",cell:function(e){return $e(e)}}],t=function(e){return null===e||void 0===e?void 0:e.map((function(e){var n=e.stream,t=e.values;return{stream:"".concat(JSON.stringify(n)),rows:null===t||void 0===t?void 0:t.map((function(e){var t=(0,u.Z)(e,2),r=t[0],i=t[1];return{time:r,stream:JSON.stringify(n),log:i}})),get rowsLength(){var e;return(null===this||void 0===this||null===(e=this.rows)||void 0===e?void 0:e.length)||0}}}))}(e),r=(null===t||void 0===t?void 0:t.length)||0,i=[];if(r>0){var a,o=(0,s.Z)(t);try{for(o.s();!(a=o.n()).done;){var l=a.value;i.push(l.rows)}}catch(c){o.e(c)}finally{o.f()}}return{columnsData:n,dataRows:(0,De.sortBy)(i.flat(),(function(e){return e.time})),length:r}}function nn(e){var n=e.result,t=e.raw,r=e.time,i=e.debugMode,a=e.queryType,o=e.panel,s=e.id,u=e.dispatch,c=e.dsType,d=e.direction,f=e.isLogsVolume,p=fn(n,d),v=function(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}(o),h=en(n),g=dn(p,d);var m,x={id:s,type:"stream",tableData:{},data:[{}],raw:"[]",labels:[],total:0,isLogsVolume:f,dsType:c};if(g)try{var b;(function(e){return cn.apply(this,arguments)})(u(Ye(g||[]))).then((function(){0===g.length&&(i&&console.log("\ud83d\udea7 getData / getting no messages sorted"),u(Q(!0))),u(Q(!1))}));var y=Array.from(new Set(null===g||void 0===g?void 0:g.map((function(e){return Object.keys(e.tags)})))),Z=(m=y,[].concat.apply([],m).filter((function(e,n,t){return t.indexOf(e)===n})));x={id:s,type:"stream",dsType:c,tableData:h,data:g,isLogsVolume:f,raw:t,labels:(0,H.Z)(Z),total:(null===g||void 0===g?void 0:g.length)||0};var w=v.action,S=v.state,j=null===(b=A.Z.getState())||void 0===b?void 0:b[S];if(j.some((function(e){return e.id===x.id}))){if(f){var k=(0,H.Z)(j).map((function(e){if(e.id===s){var n,t=[];null!==e&&void 0!==e&&e.logsVolumeData&&(null===(n=e.logsVolumeData)||void 0===n?void 0:n.length)>0&&(t=(0,H.Z)(e.logsVolumeData));var r=(0,l.Z)({},x);return(0,l.Z)((0,l.Z)({},r),{},{logsVolumeData:t})}return e}));u(w([])),u(w(k))}else{var C;u(w([]));var T=j.filter((function(e){return e.id!==x.id}));C=[].concat((0,H.Z)(T),[(0,l.Z)({},x)]),u(w(C))}}else{var _=[].concat((0,H.Z)(j),[x]);u(w(_))}"instant"===a&&u((0,Xe.H)(r))}catch(L){console.log(L)}else{var I,D=v.action,N=v.state,M=null===(I=A.Z.getState())||void 0===I?void 0:I[N];if(M.some((function(e){return e.id===x.id}))){var E;u(D([]));var R=(null===M||void 0===M?void 0:M.filter((function(e){return e.id!==x.id})))||[];E=[].concat((0,H.Z)(R),[(0,l.Z)({},x)]),u(D(E))}else{var O=[].concat((0,H.Z)(M),[x]);u(D(O))}}}function tn(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}function rn(e){return an.apply(this,arguments)}function an(){return an=(0,F.Z)((0,z.Z)().mark((function e(n){var t,r,i,a,o,s,u,c,d,f,p,v,h,g,m,x,b,y,Z;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.result,r=n.debugMode,i=n.dispatch,a=n.panel,o=n.id,s=n.type,u=n.dsType,c=n.queryType,d=n.raw,"trace-search"!==c){e.next=6;break}return e.next=4,Ue(n);case 4:e.next=7;break;case 6:try{v={id:o,type:s,dsType:u,tableData:{},data:t,raw:d,labels:[],open:!0,total:null===t||void 0===t||null===(f=t.resourceSpans)||void 0===f?void 0:f.length},h=tn(a),g=h.action,m=h.state,(x=null===(p=A.Z.getState())||void 0===p?void 0:p[m]).some((function(e){return e.id===v.id}))?([],i(g([])),y=x.filter((function(e){return e.id!==v.id})),b=[].concat((0,H.Z)(y),[(0,l.Z)({},v)]),i(g(b))):(Z=[].concat((0,H.Z)(x),[v]),i(g(Z)))}catch(w){r&&console.log(" \ud83d\udea7 getData / getting an error from rendering Traces type streams",w),console.log(w)}case 7:case"end":return e.stop()}}),e)}))),an.apply(this,arguments)}function on(e){return(0,Fe.jsx)("span",{title:e.getValue(),children:e.getValue()})}function ln(e){var n,t=[{accessorKey:"time",header:function(){return(0,Fe.jsx)("span",{children:"Time"})},cell:function(e){return function(e){return d()(e.getValue()).format("YYYY-MM-DDTHH:mm:ss.SSZ")}(e)}},{header:"Metric",cell:function(e){return on(e)},accessorKey:"metric"},{header:"Value",accessorKey:"value",cell:function(e){return on(e)}}],r=function(e){return e.map((function(e){var n=e.metric,t=e.values;return{metric:JSON.stringify(n),rows:t.map((function(e){var t=(0,u.Z)(e,2),r=t[0],i=t[1];return{time:r,metric:JSON.stringify(n),value:i}})),get rowsLength(){var e;return null===(e=this.rows)||void 0===e?void 0:e.length},get title(){return"'".concat(this.metric,"' (").concat(this.rowsLength,")")}}}))}(e),i=[],a=(0,s.Z)(r);try{for(a.s();!(n=a.n()).done;){var o=n.value;i.push(o.rows)}}catch(c){a.e(c)}finally{a.f()}var l=(0,De.sortBy)(i.flat(),(function(e){return e.time}));return{columnsData:t,dataRows:l,total:l.length}}function sn(e){var n=e.result,t=e.debugMode,r=e.dispatch,i=e.panel,a=e.id,o=e.raw,s=e.dsType;n=function(e){return[{metric:{__name__:"Flux"},values:e.map((function(e){return Object.values(e).map((function(e,n){return isNaN(+e)?null:(e instanceof Date?e.getTime()/1e3:e)+(0===n?0:"")})).filter((function(e){return!!e}))}))}]}(n);var c=ln(n),f=function(e){return"left"===e?{state:"leftDataView",action:Ae}:{state:"rightDataView",action:Qe}}(i);try{var p,v=Je(n),h=function(e){var n=e.result,t=e.panel,r=e.id,i=e.type,a={panel:t,id:r,type:i},o=Me(e.result),l=function(e){var n=e[0],t=Object.entries(n);if(t){var r=t.find((function(e){var n=(0,u.Z)(e,2),t=(n[0],n[1]);return d().isDate(t)}));return(null===r||void 0===r?void 0:r[0])||null}}(n),s=qe(o,i,l,a),c=Ee(n,i),f={columnsData:s,dataRows:c,panel:t,id:r};if((null===s||void 0===s?void 0:s.length)>0&&(null===c||void 0===c?void 0:c.length)>0)return f}(e),g={id:a,type:"vector",tableData:c,data:{chartData:v,tableData:h},dsType:s,raw:o,total:(null===v||void 0===v?void 0:v.length)||0},m=f.action,x=f.state,b=null===(p=A.Z.getState())||void 0===p?void 0:p[x];if(b.some((function(e){return e.id===g.id}))){r(m([]));var y=b.filter((function(e){return e.id!==g.id}));r(m([].concat((0,H.Z)(y),[(0,l.Z)({},g)])))}else{r(m([].concat((0,H.Z)(b),[g])))}}catch(Z){t&&console.log("\ud83d\udea7 getData / getting an error from rendering Flux type streams"),console.error(Z)}}var un=A.Z.getState().debugMode;function cn(){return(cn=(0,F.Z)((0,z.Z)().mark((function e(n){return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dn(e,n){return"forward"===n?function(e){var n=performance.now(),t=null===e||void 0===e?void 0:e.sort((function(e,n){return e.timestamp-n.timestamp})),r=performance.now()-n;un&&console.log("\ud83d\udea7 getData / sorting logs took: ",r," ms");return t}(e):function(e){var n=performance.now(),t=null===e||void 0===e?void 0:e.sort((function(e,n){return n.timestamp-e.timestamp})),r=performance.now()-n;un&&console.log("\ud83d\udea7 getData / sorting logs took: ",r," ms");return t}(e)}function fn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"backwards",t=performance.now(),r=[];null===e||void 0===e||e.forEach((function(e){e.values.forEach((function(n,t){var i=(0,u.Z)(n,2),a=i[0],o=i[1];r.push({type:"stream",timestamp:Ze(a),text:o,tags:e.stream||{},isShowTs:!0,isBuilder:!1,showLabels:!1,id:(0,Ie.x0)()})}))}));var i=performance.now()-t;return un&&console.log("\ud83d\udea7 getData / mapping logs took: ",i," ms"),dn(r,n)}function pn(e){return vn.apply(this,arguments)}function vn(){return(vn=(0,F.Z)((0,z.Z)().mark((function e(n){var t;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=n.type,e.t0=t,e.next="streams"===e.t0?4:"vector"===e.t0?7:"matrix"===e.t0?10:"scalar"===e.t0?13:"flux"===e.t0?16:"traces"===e.t0?19:22;break;case 4:return e.next=6,nn(n);case 6:case 9:case 12:case 15:case 18:case 21:return e.abrupt("break",24);case 7:return e.next=9,Ue(n);case 10:return e.next=12,Ke(n);case 13:return e.next=15,Ke(n);case 16:return e.next=18,sn(n);case 19:return e.next=21,rn(n);case 22:return e.next=24,nn(n);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hn(e){return function(n){n({type:"SET_RESPONSE_TYPE",responseType:e})}}var gn=t(13997),mn=t.n(gn);function xn(e){return bn.apply(this,arguments)}function bn(){return(bn=(0,F.Z)((0,z.Z)().mark((function e(n){var t,r,i,a,o,l,s;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t={meta:[],data:[],statistics:{elapsed:.360986682,rows_read:0,bytes_read:0}},r=mn().parse(n,{header:!0,comments:!0,dynamicTyping:!0}),e.next=5,r.data.map((function(e){return delete e[""],delete e.table,delete e.result,e}));case 5:for(t.data=e.sent,t.data.length=t.data.length-2,i=0,a=Object.entries(t.data[0]);i0&&pn({result:t.data.traces||[],raw:t.data,time:v,debugMode:g,dispatch:r,dsType:n,type:n,panel:i,open:!0,id:a,ts:Date.now(),queryType:s}),(null===t||void 0===t||null===(b=t.data)||void 0===b||null===(y=b.resourceSpans)||void 0===y?void 0:y.length)>0&&pn({result:(null===t||void 0===t?void 0:t.data)||[],raw:null===t||void 0===t?void 0:t.data,time:v,debugMode:g,dispatch:r,type:n,dsType:n,panel:i,open:!0,id:a,ts:Date.now(),queryType:s})),"flux"!==n){e.next=6;break}return e.next=6,xn(null===t||void 0===t?void 0:t.data).then((function(e){var t;(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.length)>0&&pn({result:e.data||[],raw:null===e||void 0===e?void 0:e.data,time:v,debugMode:g,queryType:s,dispatch:r,dsType:n,type:n,panel:i,open:!0,id:a,ts:Date.now(),direction:o})}));case 6:0===(null===t||void 0===t||null===(c=t.data)||void 0===c||null===(d=c.streams)||void 0===d?void 0:d.length)&&(pn({result:[],raw:"[]",time:v,debugMode:g,queryType:s,dispatch:r,open:!0,type:"streams",dsType:n,panel:i,id:a,ts:Date.now(),direction:o,isLogsVolume:u}),r(Q(!0))),null!==t&&void 0!==t&&null!==(f=t.data)&&void 0!==f&&f.data?(N=null===t||void 0===t||null===(Z=t.data)||void 0===Z||null===(w=Z.data)||void 0===w?void 0:w.result,M=null===t||void 0===t||null===(S=t.data)||void 0===S||null===(j=S.data)||void 0===j?void 0:j.resultType,E={hasStats:!1,statsData:{}},null!==t&&void 0!==t&&null!==(k=t.data)&&void 0!==k&&null!==(C=k.data)&&void 0!==C&&C.stats&&(null===(T=Object.keys(null===t||void 0===t||null===(_=t.data)||void 0===_||null===(I=_.data)||void 0===I?void 0:I.stats))||void 0===T?void 0:T.length)>0&&(E={hasStats:!0,statsData:(0,l.Z)({},null===t||void 0===t||null===(R=t.data)||void 0===R||null===(O=R.data)||void 0===O?void 0:O.stats)}),L=A.Z.getState()[i],V=null===L||void 0===L?void 0:L.map((function(e){var n,t;return e.id===a?(0,l.Z)((0,l.Z)({},e),{},{hasStats:(null===(n=E)||void 0===n?void 0:n.hasStats)||!1,statsData:(null===(t=E)||void 0===t?void 0:t.statsData)||{},open:!0}):e})),r(yn(i,V)),r(hn(n)),pn({result:N,raw:null===t||void 0===t||null===(D=t.data)||void 0===D?void 0:D.data,time:v,debugMode:g,queryType:s,dispatch:r,type:M,dsType:n,open:!0,panel:i,id:a,ts:Date.now(),direction:o,isLogsVolume:u})):Te(r);case 8:case"end":return e.stop()}}),e)}))),Sn.apply(this,arguments)}var jn=t(70804);function kn(e){var n=e.match(/\[(.*?)\]/gm),t=(null===n||void 0===n?void 0:n[0].replace(/\[\]']+/g,"").trim())||"",r=0;if(Array.isArray(n)){var i,a,o,l=t.match((0,jn.Z)(/^([0-9.]+)(ns|us|ms|s|m|h)?$/,{tnum:1,trange:2})),s=("string"===typeof(null===l||void 0===l||null===(i=l.groups)||void 0===i?void 0:i.tnum)?parseInt(null===l||void 0===l||null===(a=l.groups)||void 0===a?void 0:a.tnum):1)/function(e){var n=/^(ns|us|ms|s|m|h)$/,t={ns:1e9,us:1e6,s:1,m:1/60,h:1/3600},r=new Map(Object.entries(t));return n.test(e)&&"string"===typeof e?r.get(e)||1/60:r.get("m")||1/60}((null===l||void 0===l||null===(o=l.groups)||void 0===o?void 0:o.trange)||"m");r=s}return r}function Cn(e,n){window.bosco.send(e,n)}function Tn(e,n,t,r,i,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"backwards",u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,f=arguments.length>10&&void 0!==arguments[10]&&arguments[10],p={url:"",requestHeaders:{},method:{value:""},headers:[],auth:{method:{value:"GET"},basicAuth:{value:!0},fields:{basicAuth:[{name:"user",value:""},{name:"password",value:""}]}},hasSettings:!1},v="",h="";if(""!==u){var g,b,y,Z,w,S,j=A.Z.getState().dataSources,k=j.find((function(e){return e.id===u}));if(k&&(null===(g=Object.keys(k))||void 0===g?void 0:g.length)>0){var C=j.find((function(e){return e.id===u})),T=""!==p.url?p.url:C.url;p=(0,l.Z)((0,l.Z)({},C),{},{url:T,hasSettings:!0})}if((null===(b=p)||void 0===b||null===(y=b.headers)||void 0===y?void 0:y.length)>0){var _,I={},D=(0,s.Z)(p.headers);try{for(D.s();!(_=D.n()).done;){var N=_.value,M=(0,B.Z)({},String(N.header),N.value);I=(0,l.Z)((0,l.Z)({},I),M)}}catch(ne){D.e(ne)}finally{D.f()}p.requestHeaders=I||{}}if(null!==(Z=p)&&void 0!==Z&&null!==(w=Z.auth)&&void 0!==w&&null!==(S=w.basicAuth)&&void 0!==S&&S.value){var E,R,O,L,V=null===(E=p)||void 0===E||null===(R=E.auth)||void 0===R||null===(O=R.fields)||void 0===O?void 0:O.basicAuth,P={username:"",password:""},W=(0,s.Z)(V);try{for(W.s();!(L=W.n()).done;){var U=L.value;"user"===(null===U||void 0===U?void 0:U.name)&&(P.username=U.value,v=U.value),"password"===(null===U||void 0===U?void 0:U.name)&&(P.password=U.value,h=U.value)}}catch(ne){W.e(ne)}finally{W.f()}p.requestHeaders=(0,l.Z)({},p.requestHeaders)}}var J=function(e,n){var t=A.Z.getState()[i];!function(e,n,t){"left"===e?n(m(t)):"right"===e&&n(x(t))}(i,e,function(e,n,t){return(0,H.Z)(e).map((function(e){return e.id===n?(0,l.Z)((0,l.Z)({},e),{},{loading:t||!1}):e}))}(t,a,n))},G=A.Z.getState().debugMode,K=function(e,n){var t,r=(null===(t=Object.keys(n))||void 0===t?void 0:t.length)>0?n:void 0;return"flux"===e?{method:"POST",headers:r||{Accept:"application/csv","Content-Type":"application/vnd.flux"}}:{method:"GET",headers:r||{"Content-Type":"application/json"}}}(e,p.requestHeaders),Y=kn(n),X=function(e,n,t,r,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",o=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,s=arguments.length>8?arguments[8]:void 0,u=arguments.length>9?arguments[9]:void 0,c=arguments.length>10?arguments[10]:void 0,d=A.Z.getState().isSplit?2:1,f=window.innerWidth,p=Ce(e,u,c),v=p.parsedTime,h=p.time,g=a,m=0;0===(m=s>0?s:f/Math.round(f/r*10/d))&&(m=1);var x="&step=".concat(m),b="".concat(encodeURIComponent(n)),y="";switch(e){case"logs":default:y="".concat(g,"/loki/api/v1");break;case"metrics":y="".concat(g,"/api/v1");break;case"flux":y="".concat(g,"/api/v2/query");break;case"traces":y="trace-search"===o?"".concat(l):"".concat(g,"/api/traces/").concat(n,"/json")}return{queryUrl:y,encodedQuery:b,parsedTime:v,time:h,queryStep:x,limit:t,direction:i,queryType:o}}(e,n,r,Y,o,p.url||"",t,c,d,a,i),$=function(e,n,t){return function(e,n,t){var r=n.queryUrl,i=n.encodedQuery,a=n.limit,o=n.parsedTime,l=n.queryStep,s=n.direction,u=n.time;return"metrics"===e||"logs"===e?"instant"===t?"".concat(r,"/query?query=").concat(i,"&limit=").concat(a,"&time=").concat(u,"&direction=").concat(s):"".concat(r,"/query_range?query=").concat(i,"&limit=").concat(a).concat(o).concat(l,"&direction=").concat(s):"flux"===e?"".concat(r):"traces"===e?"trace-search"===t?"".concat(r).concat(o):"".concat(r):""}(e,t,n)}(e,t,X),ee=function(e,n){var t,r=null===(t=A.Z.getState())||void 0===t?void 0:t["".concat(i,"DataView")],o=null===r||void 0===r?void 0:r.find((function(e){return e.id===a}));o&&(o.loading=e),function(e,n,t){t("left"===e?Ae(n):Qe(n))}(i,r,n)};return function(){var r=(0,F.Z)((0,z.Z)().mark((function r(s){var u,d,p;return(0,z.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(ee(!0,s),J(s,!0),""!==c){r.next=6;break}return"trace-search"===t&&Zn(e,s,i,a,o,t),J(s,!1),r.abrupt("return");case 6:if(""!==n||"trace-search"===t){r.next=10;break}return"traces"===e&&Zn(e,s,i,a,o,t),J(s,!1),r.abrupt("return");case 10:if("undefined"!=typeof u&&u.cancel("Cancelling the previous request"),u=q().CancelToken.source(),K.cancelToken=u.token,r.prev=13,"POST"!==(null===K||void 0===K?void 0:K.method)){r.next=19;break}return r.next=17,null===q()||void 0===q()||null===(d=q().post($,n,K))||void 0===d?void 0:d.then((function(n){wn(e,n,s,i,a,o,t)})).catch((function(e){Te(s),s(Q(!0)),ee(!1,s),G&&console.log("Error loading flux data",e)})).finally((function(){ee(!1,s),J(s,!1)}));case 17:r.next=22;break;case 19:if("GET"!==(null===K||void 0===K?void 0:K.method)){r.next=22;break}return r.next=22,null===q()||void 0===q()||null===(p=q().get($,(0,l.Z)({auth:{username:v,password:h}},K)))||void 0===p?void 0:p.then((function(n){wn(e,n||{data:{data:[]}},s,i,a,o,t,f),G&&Cn({level:"info",id:a,type:e,direction:o},a),J(s,!1)})).catch((function(n){Te(s),s(Q(!0)),ee(!1,s),J(s,!1),G&&(Cn({level:"error",id:a,type:e,direction:o},a),console.log("getting an error from response: ",n))})).finally((function(){J(s,!1),ee(!1,s)}));case 22:r.next=28;break;case 24:r.prev=24,r.t0=r.catch(13),J(s,!1),console.log(r.t0);case 28:case"end":return r.stop()}}),r,null,[[13,24]])})));return function(e){return r.apply(this,arguments)}}()}var _n,In,Dn,Nn,Mn,En,Rn,On,Ln,Vn,zn,Fn,Bn,Hn,Pn,qn,An,Qn,Wn,Un,Jn,Gn,Kn,Yn,Xn,$n,et,nt,tt,rt,it,at,ot,lt=function(e){return function(n){n({type:"SET_HISTORY_OPEN",historyOpen:e})}},st=t(56410),ut=t(96217),ct=t(68816),dt=t(78941),ft=t(52586),pt=t(9165),vt=t(72106),ht=t(72191),gt=t(57009),mt=t(77782),xt=t(65726),bt=t(22166),yt=t(66859),Zt=t(61113),wt=t(8454),St=t(30735),jt=t(41801),kt=t(14606),Ct=t(81543),Tt=t(55863),_t=t(38167),It=t(36240),Dt=t(57983),Nt=t(42361),Mt=t(73696),Et=t(33947),Rt=t(64864),Ot=t(48644),Lt=((0,jt.Z)(Rt.z)(_n||(_n=(0,r.Z)(["\n background: none;\n border: none;\n display: flex;\n height: 26px;\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.isActive?e.theme.inputTextFocus:e.theme.textColor})),jt.Z.div(In||(In=(0,r.Z)(["\n display: flex;\n justify-content: space-between;\n padding: 10px 7px 4px 5px;\n background: ",";\n"])),(function(e){return e.theme.widgetContainer})),jt.Z.div(Dn||(Dn=(0,r.Z)(["\n display: flex;\n align-items: center;\n .selector {\n margin-left: 10px;\n .label {\n flex: 1;\n color: ",";\n padding: 4px 8px;\n font-size: 12px;\n text-transform: uppercase;\n background: ",";\n border-radius: 4px;\n white-space: nowrap;\n }\n }\n input {\n color: ",";\n background: ",";\n border: none;\n outline: none;\n padding: 4px 8px;\n font-size: 1em;\n border-radius: 3px;\n line-height: 1.5;\n margin: 0px 5px;\n &:focus {\n color: orange;\n }\n &.limit {\n width: 50px;\n }\n\n &.date-time-range {\n width: 120px;\n }\n }\n"])),(function(e){return e.theme.inputLabelColor}),(function(e){return e.theme.inputLabelBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg})),jt.Z.div(Nn||(Nn=(0,r.Z)(["\n display: flex;\n align-items: center;\n margin-left: 20px;\n display: flex;\n align-items: center;\n transition: 0.2s all;\n height: 26px;\n .selector {\n margin-left: 10px;\n .label {\n flex: 1;\n color: ",";\n padding: 4px 8px;\n font-size: 12px;\n text-transform: uppercase;\n background: ",";\n border-radius: 4px;\n white-space: nowrap;\n }\n .input {\n background: ",";\n }\n }\n & div {\n display: flex;\n align-items: center;\n }\n"])),(function(e){return e.theme.inputLabelColor}),(function(e){return e.theme.mainBgColor}),(function(e){return e.theme.inputLabelBg})),(0,jt.Z)(Rt.z)(Mn||(Mn=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n text-overflow: ellipsis;\n transition: 0.2s all;\n display:flex;\n align-items:center;\n height: 26px;\n &:hover {\n background: ",";\n }\n span {\n margin:0;\n padding:0;\n @media screen and (max-width: 565px) {\n display: none;\n }\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover})),(0,jt.Z)(Ot.K)(En||(En=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n height: 18px;\n margin-right: 4px;\n &:focus {\n color: orange;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder})),(0,jt.Z)(Rt.z)(Rn||(Rn=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n border-radius: 3px;\n height: 26px;\n margin:0px 1px;\n padding: ",";\n span {\n margin-left: 5px;\n }\n svg {\n margin: 0;\n padding: 0;\n }\n &:hover {\n color: orange;\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return"small"===e.size?"3px 5px":""}))),Vt=((0,jt.Z)(Lt)(On||(On=(0,r.Z)(["\n background: ",";\n color: ",";\n cursor: ",";\n text-overflow: ellipsis;\n transition: 0.2s all;\n height: 26px;\n span {\n margin-left: 4px;\n color: ",";\n @media screen and (max-width: 565px) {\n display: none;\n }\n }\n &:hover {\n background: ",";\n }\n \n"])),(function(e){return e.theme.buttonDefault}),(function(e){var n=e.isActive,t=e.theme;return n?"orange":t.textColor}),(function(e){return e.isActive?"pointer":"not-allowed"}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover})),(0,jt.Z)((function(e){return(0,Fe.jsx)(Et.ZP,(0,l.Z)({anchor:"bottom",style:{maxHeight:"250px"},variant:"persistent"},e))}))((function(e){var n=e.theme;return{"& .MuiPaper-root":{borderTop:"1px solid ".concat(n.buttonBorder)}}}))),zt=(0,jt.Z)(ht.Z)(Ln||(Ln=(0,r.Z)(['\n height: "320px";\n background: ',";\n"])),(function(e){return e.theme.inputBg})),Ft=(0,jt.Z)(Ct.Z)(Vn||(Vn=(0,r.Z)(["\n color: ",";\n background: ",";\n border:1px solid ",";\n cursor: pointer;\n font-size: 13px;\n background-color: transparent;\n padding: 6px 10px;\n border: none;\n border-radius: 3px 3px 0px 0px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid transparent;\n transition: 0.2s all;\n\n &:hover {\n background-color: ",";\n }\n\n &:focus {\n color: ",";\n background: ",";\n border-radius: 3px 3px 0px 0px;\n\n outline-offset: 2px;\n }\n\n &."," {\n border-bottom: 1px solid ",";\n }\n\n &."," {\n opacity: 0.5;\n cursor: not-allowed;\n }\n @media screen and (max-width: 360px) {\n span {\n display: none;\n }\n padding: 5px 20px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),Tt.Z.selected,(function(e){return e.theme.primaryDark}),kt.Z.disabled),Bt=(0,jt.Z)(It.Z)(zn||(zn=(0,r.Z)(["\n height: 16px;\n width: 16px;\n margin-right: 3px;\n"]))),Ht=(0,jt.Z)(dt.Z)(Fn||(Fn=(0,r.Z)(["\n height: 16px;\n width: 16px;\n margin-right: 3px;\n"]))),Pt=(0,jt.Z)(_t.Z)(Bn||(Bn=(0,r.Z)(["\n height: 16px;\n width: 16px;\n margin-right: 3px;\n"]))),qt=(0,jt.Z)(pt.Z)(Hn||(Hn=(0,r.Z)(["\n height: 16px;\n width: 16px;\n margin-right: 3px;\n"]))),At=(0,jt.Z)(Dt.Z)(Pn||(Pn=(0,r.Z)(["\n height: 21px;\n width: 16px;\n padding: 0px 3px;\n border-radius: 3px 0px 0px 3px;\n background: ",";\n"])),(function(e){return e.theme.inputBg})),Qt=jt.Z.div(qn||(qn=(0,r.Z)(["\n padding: 0px 15px;\n font-size: 13px;\n display: flex;\n align-items: center;\n color: ",";\n justify-content: space-between;\n background: ",";\n height: 37px;\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.tabHeader})),Wt=(0,jt.Z)(Mt.Z)(An||(An=(0,r.Z)(["\n width: 100%;\n background: ",";\n"])),(function(e){return e.theme.widgetContainer})),Ut=(0,jt.Z)(Nt.Z)(Qn||(Qn=(0,r.Z)(["\n min-width: 320px;\n background: ",";\n border-bottom: 4px solid ",";\n display: flex;\n align-items: center;\n align-content: space-between;\n"])),(function(e){return e.theme.tabHeader}),(function(e){return e.theme.historyRow})),Jt=jt.Z.div(Wn||(Wn=(0,r.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n font-size: 14px;\n flex: 1;\n padding: 20px;\n height: 50%;\n"])),(function(e){return e.theme.textColor})),Gt=jt.Z.div(Un||(Un=(0,r.Z)(["\n height: 250px;\n overflow-y: auto;\n color: ",";\n background: ",";\n &.starredCont {\n height: 210px;\n }\n &::-webkit-scrollbar {\n width: 5px;\n background: ",";\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.tabBg}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.scrollbarThumb})),Kt=(0,jt.Z)(Lt)(Jn||(Jn=(0,r.Z)(["\n padding: 3px 6px;\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n border: none;\n color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0px 6px;\n cursor: pointer;\n min-height: 20px;\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor})),Yt=jt.Z.div(Gn||(Gn=(0,r.Z)(["\n height: 100px;\n width: 240px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n padding: 20px;\n background: ",";\n border:1px solid ",";\n margin: 10px;\n border-radius: 3px;\n & div {\n font-size: 15px;\n color: ",";\n line-height: 1.5;\n }\n & small {\n font-size: 12px;\n color: ",";\n line-height: 1.5;\n margin-bottom: 10px;\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textPrimaryAccent}),(function(e){return e.theme.textColor})),Xt=(0,jt.Z)(Kt)(Kn||(Kn=(0,r.Z)(["\n background: ",";\n color: ",";\n white-space: nowrap;\n .open-icon {\n display: none;\n }\n .open-text {\n display: flex;\n font-size: 12px;\n }\n @media screen and (max-width: 1070px) {\n .open-icon {\n display: flex;\n }\n .open-text {\n display: none;\n \n }\n }\n"])),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.buttonText})),$t=(0,jt.Z)(Kt)(Yn||(Yn=(0,r.Z)(["\n font-weight: bold;\n padding: 10px 20px;\n background: ",";\n color: ",";\n margin: 0;\n width: 100%;\n white-space: nowrap;\n"])),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.buttonText})),er=(0,jt.Z)(Kt)(Xn||(Xn=(0,r.Z)(["\n background: none;\n color: ",";\n\n position: absolute;\n right: 0;\n"])),(function(e){return e.theme.textColor})),nr=(0,jt.Z)(Kt)($n||($n=(0,r.Z)(["\n background: ",";\n border:1px solid ",";\n padding: 8px 16px;\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder})),tr=(0,jt.Z)(Kt)(et||(et=(0,r.Z)(["\n background: ",";\n color:",";\n padding: 8px 16px;\n"])),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.buttonText})),rr=jt.Z.input(nt||(nt=(0,r.Z)(["\n color: ",";\n background: ",";\n border:none;\n height: 21px;\n margin: 0px 10px 0px 0px;\n padding: 0px;\n font-size: 13px;\n border-radius: 0px 3px 3px 0px;\n font-family: monospace;\n font-size: 12px;\n &:focus {\n outline: none;\n color: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.inputTextFocus})),ir=jt.Z.span(tt||(tt=(0,r.Z)(['\n flex: 1;\n font-family: monospace;\n display:flex;\n align-items: center;\n font-size: "13px";\n color: ',";\n white-space: nowrap;\n padding: 4px 0px;\n overflow: hidden;\n text-overflow: ellipsis;\n"])),(function(e){return e.theme.textColor})),ar=jt.Z.div(rt||(rt=(0,r.Z)(["\n display: flex;\n flex: 1;\n justify-content: space-between;\n .open-button {\n display: none;\n }\n .inline-params {\n align-items: center;\n display: ",";\n flex: 1;\n grid-template-columns: 1fr 0.25fr 0.25fr auto;\n margin-right: 5px;\n }\n\n .open-button {\n display: flex;\n color: ",";\n background: none;\n border: none;\n }\n .block-params {\n display: ",";\n flex-direction: column;\n flex: 1;\n p {\n display: flex;\n align-items: center;\n flex: 1;\n line-height: 1.5;\n font-size: 12px;\n font-family: monospace;\n span {\n margin-left: 3px;\n &.key {\n flex: 1;\n }\n &.value {\n flex: 3;\n }\n }\n }\n }\n @media screen and (max-width: 1070px) {\n .inline-params {\n display: none;\n }\n }\n"])),(function(e){return e.open?"none":"grid"}),(function(e){return e.theme.buttonText}),(function(e){return e.open?"flex":"none"})),or=jt.Z.div(it||(it=(0,r.Z)(["\n padding: 5px 0px;\n padding-left: 10px;\n border: 1px solid ",";\n margin: 5px;\n border-radius: 3px;\n font-size: 13px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])),(function(e){return e.theme.historyRow})),lr=jt.Z.div(at||(at=(0,r.Z)(["\n @media screen and (max-width: 1370px) {\n display: none;\n }\n"]))),sr=t(66149),ur=t(33604),cr=t(96467),dr=t(97762),fr=t(4117),pr=t(45859),vr=t(79727),hr=t(43262),gr=jt.Z.div(ot||(ot=(0,r.Z)(["\n background: ",";\n #alert-dialog-title {\n color: ",";\n }\n #alert-dialog-description {\n color: ",";\n font-weight: normal;\n }\n"])),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.textColor}),(function(e){return e.theme.textOff}));function mr(e){var n=e.clearHistory,t=e.dialogType,r=(0,f.useState)(!1),i=(0,u.Z)(r,2),a=i[0],o=i[1],l=(0,hr.Fg)(),s=function(){o(!1)};return(0,Fe.jsx)(pr.Z,{theme:l,children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)(D.Z,{title:"Clear Query History",children:(0,Fe.jsx)($t,{onClick:function(){o(!0)},children:"Clear History"})}),(0,Fe.jsx)(sr.Z,{open:a,onClose:s,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",PaperProps:{classes:{root:vr.ht}},children:(0,Fe.jsxs)(gr,{children:[(0,Fe.jsxs)(ur.Z,{id:"alert-dialog-title",children:["Are you sure you want to clear the ",t," ","History?"]}),(0,Fe.jsx)(cr.Z,{children:(0,Fe.jsxs)(dr.Z,{id:"alert-dialog-description",children:["Click \u2018Clear History\u2019 to delete your"," ",t," history permanently"]})}),(0,Fe.jsxs)(fr.Z,{children:[(0,Fe.jsx)(nr,{onClick:s,children:"Cancel"}),(0,Fe.jsx)(tr,{onClick:function(){n(),o(!1)},autoFocus:!0,children:"Clear History"})]})]})})]})})}function xr(e){var n=e.message;return(0,Fe.jsx)(Jt,{children:n})}var br=t(11198);function yr(e){var n=e.onClose;return(0,Fe.jsx)(er,{onClick:n,children:(0,Fe.jsx)(br.Z,{style:{height:"16px",width:"16px"}})})}var Zr,wr,Sr,jr,kr,Cr,Tr,_r,Ir=t(62424),Dr=t(403),Nr=t(83618),Mr=t(50567),Er=t(88620),Rr=t(47347),Or=t(82395),Lr=t(70501),Vr=t(9019),zr=t(70943),Fr=t(93345),Br=t(80038),Hr=t(8885),Pr=t(39231),qr=t(94836),Ar=t(47131),Qr=t(89790),Wr=t(54045),Ur=t(68659),Jr=t(20644),Gr=t(87910),Kr=t(8121),Yr=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],Xr=["Su","Mo","Tu","We","Th","Fr","Sa"],$r={FIRST_MONTH:Symbol("firstMonth"),SECOND_MONTH:Symbol("secondMonth")},ei="dateTimeRange",ni=t(68658),ti=A.Z.getState().theme,ri=Ve.n[ti],ii=function(){var e=A.Z.getState().theme;return(0,ni.Z)({palette:{mode:e,primary:{main:ri.textColor}}})},ai=jt.Z.select(Zr||(Zr=(0,r.Z)(["\n cursor: pointer;\n position: relative;\n font-size: 14px;\n color: ",";\n background: ",";\n border: none;\n border-radius: 3px;\n padding: 4px 8px;\n line-height: 20px;\n flex: 1;\n &::-webkit-scrollbar {\n width: 5px;\n background: ",";\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.scrollbarThumb})),oi=(0,Hr.Z)((function(){return(0,Br.Z)({iconContainer:{padding:5,color:ri.textColor},icon:{padding:10,color:ri.textColor,"&:hover":{color:ri.textColor,background:"none"}},selector:{color:ri.textColor,borderBottom:"1px solid ".concat(ri.textColor)}})}))((function(e){var n=e.date,t=e.classes,r=e.setDate,i=e.nextDisabled,a=e.prevDisabled,o=e.onClickNext,l=e.onClickPrevious,s=(0,hr.Fg)();return(0,Fe.jsx)(pr.Z,{theme:s,children:(0,Fe.jsxs)(Vr.ZP,{container:!0,justifyContent:"space-between",alignItems:"center",style:{marginTop:"20px"},children:[(0,Fe.jsx)(Vr.ZP,{item:!0,className:t.iconContainer,children:(0,Fe.jsx)(Ar.Z,{disabled:a,onClick:l,children:(0,Fe.jsx)(Qr.Z,{style:{color:a?s.textOff:s.textColor}})})}),(0,Fe.jsx)(Vr.ZP,{item:!0,children:(0,Fe.jsx)(ai,{value:(0,Gr.Z)(n),onChange:function(e){r((0,Ur.Z)(n,parseInt(e.target.value)))},children:Yr.map((function(e,n){return(0,Fe.jsx)("option",{value:n,children:e},e)}))})}),(0,Fe.jsx)(Vr.ZP,{item:!0,children:(0,Fe.jsx)(ai,{value:(0,Kr.Z)(n),onChange:function(e){r((0,Jr.Z)(n,parseInt(e.target.value)))},children:me(n,30).map((function(e){return(0,Fe.jsx)("option",{className:"custom-option",value:e,children:e},e)}))})}),(0,Fe.jsx)(Vr.ZP,{item:!0,className:t.iconContainer,children:(0,Fe.jsx)(Ar.Z,{disabled:i,onClick:o,children:(0,Fe.jsx)(Wr.Z,{style:{color:i?s.textOff:s.textColor}})})})]})})})),li=(0,Hr.Z)((function(){return(0,Br.Z)({leftBorderRadius:{borderRadius:"50% 0 0 50%"},rightBorderRadius:{borderRadius:"0 50% 50% 0"},buttonContainer:{display:"flex"},button:{height:30,width:30,padding:0},inactive:{color:"gray"},outlined:{border:"1px solid #11abab"},buttonText:{lineHeight:1.6,color:"primary"},filled:{"&:hover":{backgroundColor:"#11abab",color:"text.primary"},backgroundColor:"#11abab",color:"text.primary"},highlighted:{backgroundColor:"#14b8b852"},contrast:{color:"text.primary"}})}))((function(e){var n=e.classes;return(0,Fe.jsx)(I.a,{theme:ii,children:(0,Fe.jsx)("div",{className:pe(n.buttonContainer,e.startOfRange&&n.leftBorderRadius,e.endOfRange&&n.rightBorderRadius,!e.disabled&&e.highlighted&&n.highlighted,e.disabled&&n.disabled),children:(0,Fe.jsx)(Ar.Z,{className:pe(n.button,!e.disabled&&e.outlined&&n.outlined,!e.disabled&&e.filled&&n.filled),disabled:e.disabled,onClick:e.onClick,onMouseOver:e.onHover,children:(0,Fe.jsx)(Zt.Z,{color:e.disabled?"text.secondary":"text.primary",className:pe(n.buttonText,!e.disabled&&e.filled&&n.contrast,e.disabled&&n.inactive),variant:"body2",children:e.value})})})})})),si=-1,ui=1,ci=(0,Hr.Z)((function(e){return(0,Br.Z)({root:{width:260,background:e.mainBgColor},weekDaysContainer:{marginTop:5,paddingLeft:30,paddingRight:30},daysContainer:{paddingLeft:15,paddingRight:15,marginTop:10,marginBottom:20}})}))((function(e){var n,t,r=(0,hr.Fg)(),i=(0,f.useState)(r),a=(0,u.Z)(i,2),o=a[0],l=a[1],s=e.classes,c=e.helpers,d=e.handlers,p=e.value,v=e.dateRange,h=e.marker,g=e.setValue,m=e.minDate,x=e.maxDate,b=(0,u.Z)(e.navState,2),y=b[0],Z=b[1];return(0,f.useEffect)((function(){l(r)}),[r,l]),(0,Fe.jsx)(I.a,{theme:r,children:(0,Fe.jsx)(Lr.Z,{square:!0,elevation:0,className:s.root,style:{background:r.mainBgColor},children:(0,Fe.jsxs)(Vr.ZP,{container:!0,children:[(0,Fe.jsx)(oi,{date:p,setDate:g,nextDisabled:!Z,prevDisabled:!y,onClickPrevious:function(){return d.onMonthNavigate(h,si)},onClickNext:function(){return d.onMonthNavigate(h,ui)}}),(0,Fe.jsx)(Vr.ZP,{item:!0,container:!0,direction:"row",justifyContent:"space-between",className:s.weekDaysContainer,children:Xr.map((function(e){return(0,Fe.jsx)("div",{style:{color:r.textColor,fontSize:"10px"},children:e},e)}))}),(0,Fe.jsx)(Vr.ZP,{item:!0,container:!0,direction:"column",justifyContent:"space-between",className:s.daysContainer,children:(n=ve(p),t=7,Array.from({length:Math.ceil(n.length/t)},(function(e,r){return n.slice(r*t,r*t+t)}))).map((function(e,n){return(0,Fe.jsx)(Vr.ZP,{container:!0,direction:"row",justifyContent:"center",children:e.map((function(e){var n=function(e,n){var t=e.dateStart;return t&&(0,X.Z)(n,t)}(v,e),t=function(e,n){var t=e.dateEnd;return t&&(0,X.Z)(n,t)}(v,e),r=function(e){var n=e.dateStart,t=e.dateEnd;return!(!n||!t)&&(0,X.Z)(n,t)}(v),i=function(e,n){var t=e.dateStart,r=e.dateEnd;return t&&r&&((0,$.Z)(n,{start:t,end:r})||(0,X.Z)(n,t)||(0,X.Z)(n,r))}(v,e)||c.inHoverRange(e);return(0,Fe.jsx)(li,{themeSelected:o,filled:n||t,outlined:(0,Pr.Z)(e),highlighted:i&&!r,disabled:!(0,ae.Z)(p,e)||!(0,$.Z)(e,{start:m,end:x}),startOfRange:n&&!r,endOfRange:t&&!r,onClick:function(){return d.onDayClick(e)},onHover:function(){return d.onDayHover(e)},value:(0,qr.Z)(e)},(0,st.Z)(e,"mm-dd-yyyy"))}))},n)}))})]})})})})),di=jt.Z.div(wr||(wr=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n padding: 10px;\n max-height: 250px;\n overflow-y: auto;\n flex: 1;\n margin-top: 10px;\n margin-bottom: 10px;\n padding: 5px;\n &::-webkit-scrollbar {\n width: 5px;\n background: ",";\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n button {\n background: none;\n text-align: left;\n border: none;\n padding: 10px;\n line-height: 1.5;\n border-radius: 3px;\n font-size: 12px;\n cursor: pointer;\n &:hover {\n background: ",";\n }\n }\n"])),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonHover})),fi=function(e){var n=(0,hr.Fg)();return(0,Fe.jsx)(I.a,{theme:n,children:(0,Fe.jsx)(di,{children:e.ranges.map((function(t,r){return(0,Fe.jsx)("button",{onClick:function(){e.setRange(t),e.onClose()},children:(0,Fe.jsx)("span",{style:{fontWeight:xe(t,e.selectedRange)?"bold":"normal",color:xe(t,e.selectedRange)?"orange":n.textColor,whiteSpace:"nowrap"},children:t.label})},r)}))})})},pi=t(66713),vi=t(28165),hi=t(31238),gi=jt.Z.div(Sr||(Sr=(0,r.Z)(["\n display: ",";\n flex-direction: column;\n margin: 20px;\n margin-top: 30px;\n .time-selectors {\n display: ",";\n flex-direction: column;\n margin-bottom: 15px;\n .label {\n font-size: 0.85em;\n color: ",";\n width: 50px;\n margin-left: 5px;\n margin-bottom: 5px;\n white-space: nowrap;\n }\n .input-group {\n display: flex;\n margin-bottom: 20px;\n input {\n background:",";\n color:",";\n }\n .date-time-ranged {\n font-size: 14px;\n width: 170px;\n line-height: 20px;\n border: 1px solid ",";\n color: ",";\n margin: 0;\n padding: 0px 8px;\n margin-right: 5px;\n &:focus {\n border: 1px solid\n ",";\n }\n }\n }\n }\n"])),(function(e){return e.isDisplay?"flex":"none"}),(function(e){return e.isDisplay?"flex":"none"}),(function(e){return e.theme.inputLabelColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault})),mi=(0,jt.Z)(Rt.z)(jr||(jr=(0,r.Z)(["\n color: ",";\n background: ",";\n padding: 6px;\n justify-content: center;\n margin-top: 10px;\n margin-bottom: 10px;\n cursor: pointer;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.buttonText}),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.primaryLight})),xi=(0,jt.Z)(Rt.z)(kr||(kr=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n padding: 8px;\n &:hover {\n background: ",";\n color: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}));function bi(e){var n=e.getEditedStartDate,t=e.getEditedEndDate,r=e.handleStart,i=e.handleStop,a=e.onTimeRangeSet,l=e.setCalendarOpen,s=e.isFullCalendar,u=e.setStopCalendar,c=e.setStartCalendar,d=e.startCalendarOpen,f=e.stopCalendarOpen,p=e.isHorizontal,v=e.styles,h=e.isMobile,g=(0,hi.F)();return(0,Fe.jsx)(I.a,{theme:g,children:(0,Fe.jsxs)(gi,{isDisplay:v,children:[(0,Fe.jsxs)("div",{className:"time-selectors",children:[(0,Fe.jsx)("span",{className:"label",children:"From"}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("input",{className:"date-time-ranged",value:o().sanitize(n()),onChange:function(e){return r(e,!1)},onBlur:function(e){return r(e,!0)}}),(0,Fe.jsx)(xi,{onClick:function(){s?l((function(e){return!e})):(l((function(e){return!e||!d})),u((function(){return!1})),c((function(e){return!e})))},children:(0,Fe.jsx)(vi.Z,{style:{height:"16px",width:"16px"}})})]})]}),(0,Fe.jsxs)("div",{className:"time-selectors",children:[(0,Fe.jsx)("span",{className:"label",children:"To"}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("input",{className:"date-time-ranged",value:o().sanitize(t()),onChange:function(e){return i(e,!1)},onBlur:function(e){return i(e,!0)}}),(0,Fe.jsx)(xi,{onClick:function(){s?l((function(e){return!e})):(l((function(e){return!e||!f})),c((function(){return!1})),u((function(e){return!e})))},children:(0,Fe.jsx)(vi.Z,{style:{height:"16px",width:"16px"}})})]})]}),(0,Fe.jsx)(mi,{isHorizontal:p,isMobile:h,onClick:function(e){a(e)},children:"Apply Time Range"})]})})}var yi=jt.Z.button(Cr||(Cr=(0,r.Z)(["\n padding: 10px;\n border-radius: 3px;\n color: ",";\n font-size: 1em;\n border: none;\n background: none;\n display: flex;\n\n cursor: pointer;\n align-items: center;\n justify-content: center;\n margin-bottom: 10px;\n &:hover {\n background: #11111155;\n }\n span {\n margin-right: 4px;\n font-size: 12px;\n }\n"])),(function(e){return e.theme.textPrimaryAccent})),Zi=jt.Z.div(Tr||(Tr=(0,r.Z)(["\n position: absolute;\n .header {\n padding: 10px;\n justify-content: space-between;\n }\n .headerItem {\n text-align: center;\n }\n .dateComplete {\n font-size: 0.85em;\n }\n .divider {\n border-left: 1px solid action;\n margin-bottom: 20;\n }\n .container {\n position: relative;\n z-index: 1000;\n right: 75%; // this should be 100% by default\n top: 30px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n background: ",";\n }\n .applyButton {\n color: white;\n background: hsl(0, 0%, 31%);\n border: 1px solid hsl(0, 0%, 31%);\n padding: 6px 8px;\n border-radius: 3px;\n margin-left: 10px;\n cursor: pointer;\n }\n"])),(function(e){return e.theme.mainBgColor})),wi=function(e){var n=e.ranges,t=e.dateRange,a=e.minDate,o=e.maxDate,s=e.firstMonth,c=e.setFirstMonth,d=e.secondMonth,p=e.setSecondMonth,h=e.setDateRange,g=e.helpers,m=e.handlers,x=(0,hr.Fg)(),b=(0,f.useState)(!1),y=(0,u.Z)(b,2),Z=y[0],w=y[1],S="Last 5 minutes",j=(new Date(Date.now()-3e5),new Date(Date.now()),(0,zr.Z)(d,s)>=2),k={dateRange:t,minDate:a,maxDate:o,helpers:g,handlers:m},C=(0,i.I0)(),T=(0,f.useState)(t.dateStart),D=(0,u.Z)(T,2),N=D[0],M=D[1],E=(0,f.useState)(t.dateEnd),R=(0,u.Z)(E,2),O=R[0],L=R[1],V=(0,f.useState)(!0),z=(0,u.Z)(V,2),F=z[0],B=z[1],H=(0,f.useState)(t.label)||S,P=(0,u.Z)(H,1)[0],q=(0,_.useMediaQuery)({query:"(min-width: 1013px)"}),A=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),Q=(0,_.useMediaQuery)({query:"(orientation: portrait)"}),W=(0,i.v9)((function(e){return e.isSplit})),U=(0,f.useState)(!1),J=(0,u.Z)(U,2),G=J[0],Y=J[1],X=(0,f.useState)(!1),$=(0,u.Z)(X,2),ee=$[0],te=$[1];(0,f.useEffect)((function(){if(P){var e=he(P);M(e.dateStart),L(e.dateEnd)}}),[L,M,P]);var re=function(e,n){e.preventDefault();var t=new Date(e.target.value);n&&(0,ne.Z)(t)?L(t):L(e.target.value)},ie=function(e,n){e.preventDefault();var t=new Date(e.target.value);n&&(0,ne.Z)(t)?M(t):M(e.target.value)},ae=function(n){n.preventDefault();var r=new Date(N),i=new Date(O);(0,Dr.Z)(r)&&!(0,Fr.Z)(t.dateStart,r)&&(C((0,v.qv)(r)),M(r)),(0,ne.Z)(i)&&!(0,Fr.Z)(t.dateEnd,i)&&(C((0,v.wW)(i)),L(i));var a=(0,ne.Z)(i)&&(0,Dr.Z)(r),o=(0,K.Z)(r,i),l=!(0,Fr.Z)(t.dateStart,r)||!(0,Fr.Z)(t.dateEnd,i);a&&o&&l?(C((0,v.Xn)("")),h({dateStart:r,dateEnd:i}),oe({dateStart:r,dateEnd:i}),e.onClose(n)):o||console.log("Invalid time range")},oe=function(e){localStorage.setItem(ei,JSON.stringify(e))},le=function(){return(0,ne.Z)(N)?(0,st.Z)(N,"yyy-MM-dd HH:mm:ss"):N},se=function(){return(0,ne.Z)(O)?(0,st.Z)(O,"yyy-MM-dd HH:mm:ss"):"undefined"!==typeof O?O:""};return(0,Fe.jsx)(I.a,{theme:x,children:(0,Fe.jsx)(Zi,{children:(0,Fe.jsx)(Lr.Z,{className:"container",elevation:5,children:(0,Fe.jsxs)(Vr.ZP,{display:"flex",style:{flex:"1"},children:[Z&&q&&(0,Fe.jsxs)(Vr.ZP,{container:!0,direction:"row",wrap:"nowrap",children:[(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:s,setValue:c,navState:[!0,j],marker:$r.FIRST_MONTH})),(0,Fe.jsx)("div",{className:"divider"}),(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:d,setValue:p,navState:[j,!0],marker:$r.SECOND_MONTH}))]}),Z&&!q&&!Q&&!F&&!W&&(0,Fe.jsxs)(Vr.ZP,{container:!0,direction:"row",wrap:"nowrap",children:[G&&(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:s,setValue:c,navState:[!0,j],marker:$r.FIRST_MONTH})),ee&&(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:d,setValue:p,navState:[j,!0],marker:$r.SECOND_MONTH}))]}),(0,Fe.jsxs)(Vr.ZP,{display:"flex",flex:1,children:[(0,Fe.jsxs)("div",{style:{display:"flex",flexDirection:"column",flex:"1"},children:[A&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("div",{style:{maxHeight:Q?"60vh":"50vh",overflowY:"auto",display:F?"flex":"none",flex:1,flexDirection:"column"},children:(0,Fe.jsx)(fi,{selectedRange:t,isHorizontal:!Q,ranges:n,setRange:h,onClose:e.onClose})}),(0,Fe.jsx)(bi,{styles:!F,getEditedStartDate:le,isHorizontal:!Q,isMobile:!0,isFullCalendar:!1,getEditedEndDate:se,handleStart:ie,handleStop:re,onTimeRangeSet:ae,calendarOpen:Z,stopCalendarOpen:ee,startCalendarOpen:G,setCalendarOpen:w,setStopCalendar:te,setStartCalendar:Y}),A&&(0,Fe.jsxs)(yi,{onClick:function(){B((function(e){return!e}))},theme:x,children:[(0,Fe.jsx)("span",{children:F?"Set Absolute Time":"Set Relative Time"}),(0,Fe.jsx)(pi.Z,{className:(0,ze.iv)(_r||(_r=(0,r.Z)(["\n font-size: 12px;\n "])))})]})]}),!A&&(0,Fe.jsx)(bi,{styles:!0,isMobile:!1,isFullCalendar:!0,getEditedStartDate:le,getEditedEndDate:se,handleStart:ie,handleStop:re,onTimeRangeSet:ae,calendarOpen:Z,setCalendarOpen:w}),Z&&A&&!F&&(0,Fe.jsxs)(Vr.ZP,{container:!0,direction:"row",wrap:"nowrap",children:[G&&(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:s,setValue:c,navState:[!0,j],marker:$r.FIRST_MONTH})),ee&&(0,Fe.jsx)(ci,(0,l.Z)((0,l.Z)({},k),{},{value:d,setValue:p,navState:[j,!0],marker:$r.SECOND_MONTH}))]})]}),(0,Fe.jsx)("div",{className:"divider"}),q&&(0,Fe.jsx)(Vr.ZP,{style:{display:"flex",flex:1},children:(0,Fe.jsx)(fi,{selectedRange:t,ranges:n,setRange:h,onClose:e.onClose})})]})]})})})})},Si=function(e){return function(n){n({type:"SET_RANGE_OPEN",rangeOpen:e})}};var ji,ki,Ci=t(88999),Ti=t(21411),_i=t(24064),Ii=jt.Z.div(ji||(ji=(0,r.Z)(['\n display: flex;\n flex-direction: column;\n justify-content: "center";\n padding: "3px";\n .time-span {\n text-align: center;\n }\n'])));function Di(e){var n=e.dateRange,t=(0,hr.Fg)();return(0,Fe.jsx)(I.a,{theme:t,children:(0,Fe.jsxs)(Ii,{children:[(0,Fe.jsx)("span",{className:"time-span",children:(0,ne.Z)(n.dateStart)?(0,st.Z)(n.dateStart,"yyyy/MM/dd HH:mm:ss"):n.dateStart}),(0,Fe.jsx)("span",{className:"time-span",children:"to"}),(0,Fe.jsx)("span",{className:"time-span",children:(0,ne.Z)(n.dateEnd)?(0,st.Z)(n.dateEnd,"yyyy/MM/dd HH:mm:ss"):"undefined"!==typeof n.dateEnd?n.dateEnd:""})]})})}var Ni=(0,ze.iv)(ki||(ki=(0,r.Z)(["\n svg {\n font-size: 1.15em;\n margin: 0px 2px;\n }\n .tooltip {\n background-color: red;\n display: flex;\n align-items: center;\n justify-items: center;\n }\n\n @media screen and (max-width: 1200px) {\n font-size: 1em;\n padding: 8px;\n color: #ddd;\n line-height: 1.5;\n svg {\n margin-right: 0;\n }\n span {\n display: none;\n }\n }\n"]))),Mi=function(e){try{var n=localStorage.getItem(e);if("string"===typeof n){var t=JSON.parse(n);if(t.dateStart&&t.dateEnd)return JSON.parse(n)}}catch(r){return console.log(r),{dateStart:"",dateEnd:""}}},Ei=function(e){return(0,Fe.jsx)(_i.Z,(0,l.Z)({id:e.id,elevation:0,anchorOrigin:{vertical:"bottom",horizontal:"left"},PaperProps:{sx:{background:e.qryntheme.buttonDefault,color:e.qryntheme.textColor}},transformOrigin:{vertical:"bottom",horizontal:"left"}},e))},Ri=["1m","5m","10m","30m","1h","3h","6h","12h","24h"];var Oi=function(e){var n=Date.now(),t=e.id,r=e.minDate,a=e.maxDate,o=e.startTs,s=e.stopTs,c=e.label,d=e.onLabelChange,p=e.onStartChange,v=e.onStopChange,h=e.pickerOpen,g=e.onPickerOpen,m=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),x=(0,i.v9)((function(e){return e.isSplit})),b=(0,hr.Fg)(),y={label:"Last 5 minutes",dateStart:new Date(Date.now()-3e5),dateEnd:new Date(Date.now())},Z=function(){try{var e=Mi(ei);if(!e)return y;if(""!==(null===e||void 0===e?void 0:e.label)&&"undefined"!==typeof e.label){var n=he(null===e||void 0===e?void 0:e.label);e.dateStart=n.dateStart,e.dateEnd=n.dateEnd}else e.dateStart=new Date(e.dateStart),e.dateEnd=new Date(e.dateEnd);return e}catch(t){if((0,Dr.Z)(o)&&(0,Dr.Z)(s))return{dateStart:o,dateEnd:s}}},w=ge(r,(0,Nr.Z)(n,-10)),S=ge(a,(0,Nr.Z)(n,10)),j=be(Z()||{},w,S),k=(0,u.Z)(j,2),C=k[0],T=k[1],M=(0,f.useState)((0,l.Z)({},Z())),E=(0,u.Z)(M,2),R=E[0],O=E[1],L=(0,f.useState)(),V=(0,u.Z)(L,2),z=V[0],F=V[1],B=(0,f.useState)(C||n),H=(0,u.Z)(B,2),P=H[0],q=H[1],A=(0,f.useState)(T||(0,oe.Z)(P,1)),Q=(0,u.Z)(A,2),W=Q[0],U=Q[1],J=(0,f.useMemo)((function(){return{dateStart:o,dateEnd:s,label:c}}),[o,s,c]);(0,f.useEffect)((function(){d(J.label)}),[J.label]);var G=R.dateStart,Y=R.dateEnd,ee=function(){var e=(0,i.I0)(),n=(0,f.useRef)(null),t=function(n){"Escape"===n.key&&e(Si(!1))},r=function(t){n.current&&!n.current.contains(t.target)&&e(Si(!1))};return(0,f.useEffect)((function(){return document.addEventListener("keydown",t,!0),document.addEventListener("click",r,!0),function(){document.removeEventListener("keydown",t,!0),document.removeEventListener("click",r,!0)}})),{ref:n}}().ref,te=function(e){localStorage.setItem(ei,JSON.stringify(e))},le=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===e||void 0===e||e.preventDefault(),g(!1)},se={inHoverRange:function(e){return G&&!Y&&z&&(0,Mr.Z)(z,G)&&(0,$.Z)(e,{start:G,end:z})}},ue={onDayClick:function(e){if(!G||Y||(0,K.Z)(e,G))O({dateStart:e,dateEnd:void 0});else{var n={dateStart:G,dateEnd:e};ce(n),te(n),O(n),d(""),le()}F(e)},onDayHover:function(e){G&&!Y&&(z&&(0,X.Z)(e,z)||F(e))},onMonthNavigate:function(e,n){if(e===$r.FIRST_MONTH){var t=(0,oe.Z)(P,n);(0,K.Z)(t,W)&&q(t)}else{var r=(0,oe.Z)(W,n);(0,K.Z)(P,r)&&U(r)}}};function ce(e){var n=e.dateStart,t=e.dateEnd,r=e.label,i=(0,Dr.Z)(n),a=(0,Dr.Z)(t),o="undefined"!==typeof r;i&&p(n),a&&v(t),o&&d(r)}var de=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"range",t="backward"===e?Er.Z:Rr.Z,r={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};"range"===n?r=(0,Or.Z)({start:G,end:Y}):n.includes("d")?r.days=parseInt(n):n.includes("h")?r.hours=parseInt(n):n.includes("m")?r.minutes=parseInt(n):n.includes("s")&&(r.seconds=parseInt(n));var i={dateStart:t(G,r),dateEnd:t(Y,r),label:""};O(i),te(i),ce(i)},fe=(0,f.useState)(null),pe=(0,u.Z)(fe,2),ve=pe[0],me=pe[1],xe=Boolean(ve),Ze=(0,f.useState)(null),we=(0,u.Z)(Ze,2),Se=we[0],je=we[1],ke=Boolean(Se),Ce=function(e,n,t){me(null),je(null),n&&t&&de(n,t)};return(0,Fe.jsxs)("div",{style:{display:"flex"},children:[!m&&!x&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(Lt,{onClick:function(){de("backward")},attachedside:"r",emptySide:"l",className:(0,ze.cx)(Ni),children:(0,Fe.jsx)(Ti.Z,{})}),(0,Fe.jsx)(Lt,{onClick:function(e){me((function(n){return e.currentTarget}))},attachedside:"both",size:"small",className:(0,ze.cx)(Ni),"aria-controls":xe?"backward-menu":void 0,"aria-haspopup":"true","aria-expanded":xe?"true":void 0,children:(0,Fe.jsx)(yt.Z,{})}),(0,Fe.jsx)(Ei,{id:"backward-menu",anchorEl:ve,open:xe,onClose:Ce,qryntheme:b,children:Ri.map((function(e){return(0,Fe.jsx)(N.Z,{sx:{"&.MuiMenuItem-root":{fontSize:12}},onClick:function(n){return Ce(0,"backward",e)},children:e},"".concat(e," l"))}))})]}),(0,Fe.jsx)(D.Z,{title:c?(0,Fe.jsx)(Di,{dateRange:R}):"",children:(0,Fe.jsxs)(Lt,{onClick:function(e){e.preventDefault(),!0===h?le(e):g(!0)},className:(0,ze.cx)(Ni),attachedside:"both",children:[(0,Fe.jsx)(Ci.Z,{}),(0,Fe.jsx)("span",{children:c||((0,ne.Z)(R.dateStart)?(0,st.Z)(R.dateStart,"yyyy/MM/dd HH:mm:ss"):R.dateStart)+"-"+((0,ne.Z)(R.dateEnd)?(0,st.Z)(R.dateEnd,"yyyy/MM/dd HH:mm:ss"):"undefined"!==typeof R.dateEnd?R.dateEnd:"")})]})}),!m&&!x&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(Lt,{onClick:function(e){je((function(n){return e.currentTarget}))},id:"forward-button-".concat(t),size:"small",className:(0,ze.cx)(Ni),"aria-controls":ke?"forward-menu".concat(t):void 0,"aria-haspopup":"true","aria-expanded":ke?"true":void 0,children:(0,Fe.jsx)(yt.Z,{})}),(0,Fe.jsx)(Ei,{id:"forward-menu-".concat(t),anchorEl:Se,open:ke,onClose:Ce,qryntheme:b,children:Ri.map((function(e){return(0,Fe.jsx)(N.Z,{sx:{"&.MuiMenuItem-root":{fontSize:12}},onClick:function(n){return Ce(0,"forward",e)},children:e},"".concat(e," r"))}))}),(0,Fe.jsx)(Lt,{onClick:function(){de("forward")},attachedside:"l",className:(0,ze.cx)(Ni),children:(0,Fe.jsx)(mt.Z,{})})]}),h?(0,Fe.jsx)("div",{tabIndex:0,ref:ee,children:(0,Fe.jsx)(I.a,{theme:b,children:(0,Fe.jsx)(wi,{dateRange:R,minDate:w,maxDate:S,ranges:ye(new Date),firstMonth:P,secondMonth:W,setFirstMonth:function(e){(0,K.Z)(e,W)&&q(e)},setSecondMonth:function(e){(0,Mr.Z)(e,P)&&U(e)},setDateRange:function(e){var n=e.label,t=e.dateStart,r=e.dateEnd;t&&r&&(e.label=n,e.dateStart=t=(0,re.Z)([t,w]),e.dateEnd=r=(0,ie.Z)([r,S]),O(e),te(e),ce(e),q(t),U((0,ae.Z)(t,r)?(0,oe.Z)(t,1):r))},helpers:se,handlers:ue,onClose:le})})}):null]})};function Li(e){var n=e.historyTabHeader,t=e.historyTab,r=e.starredHistoryTab,i=e.closeButton,a=e.linksTabHeader,o=e.linksTab,l=e.settingTab,s=e.settingTabHeader;return(0,Fe.jsxs)(zt,{defaultValue:0,children:[(0,Fe.jsxs)(Ut,{children:[(0,Fe.jsxs)(Ft,{children:[(0,Fe.jsx)(Bt,{}),(0,Fe.jsx)("span",{children:"Queries"})]}),(0,Fe.jsxs)(Ft,{children:[(0,Fe.jsx)(qt,{}),(0,Fe.jsx)("span",{children:"Links"})]}),(0,Fe.jsxs)(Ft,{children:[(0,Fe.jsx)(Ht,{}),(0,Fe.jsx)("span",{children:"Starred"})]}),(0,Fe.jsxs)(Ft,{children:[(0,Fe.jsx)(Pt,{}),(0,Fe.jsx)("span",{children:"Settings"})]}),i]}),(0,Fe.jsxs)(Wt,{value:0,children:[n,t]}),(0,Fe.jsxs)(Wt,{value:1,children:[a,o]}),(0,Fe.jsx)(Wt,{value:2,children:r}),(0,Fe.jsxs)(Wt,{value:3,children:[s,l]})]})}function Vi(e){var n,t=e.pos,r=e.item,i=e.copyLink,a=e.handleDelete,o=e.handleStarLinkItem,l=e.handleSubmit,s=e.label,c=(0,f.useState)(!1),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=r.fromDate,g=r.toDate,m=r.type,x=r.url,b=r.queryInput,y=r.limit;return(0,Fe.jsxs)(ar,{open:p,children:[(0,Fe.jsx)(zi,{pos:t,onOpen:p}),(0,Fe.jsx)("button",{className:"open-button",onClick:function(){v((function(e){return!e}))},children:p?(0,Fe.jsx)(bt.Z,{fontSize:"small"}):(0,Fe.jsx)(xt.Z,{fontSize:"small"})}),(0,Fe.jsxs)("div",{className:"inline-params",children:[(0,Fe.jsx)(D.Z,{title:"API URL",children:(0,Fe.jsxs)("span",{style:{display:"flex",alignItems:"center"},children:[(0,Fe.jsx)(pt.Z,{fontSize:"small",style:{marginRight:"3px"}})," ",x]})}),(0,Fe.jsxs)("span",{style:{whiteSpace:"nowrap"},children:["limit: ",y]}),(0,Fe.jsxs)("span",{style:{whiteSpace:"nowrap"},children:["step: ",null===r||void 0===r||null===(n=r.params)||void 0===n?void 0:n.step]}),(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[" ",(0,Fe.jsx)(D.Z,{title:"".concat(h," - ").concat(g),children:(0,Fe.jsx)(vt.Z,{style:{marginRight:"3px",height:"14px",width:"14px"}})})," ",(0,Fe.jsxs)(lr,{children:[h," - ",g]})]})]}),(0,Fe.jsxs)("div",{className:"block-params",children:[(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" Query:"})," ",(0,Fe.jsx)("span",{className:"value",children:b})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" API URL:"})," ",(0,Fe.jsx)("span",{className:"value",children:x})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" Data Source Type:"})," ",(0,Fe.jsx)("span",{className:"value",children:m})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:"From: "})," ",(0,Fe.jsx)("span",{className:"value",children:h})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" To: "})," ",(0,Fe.jsxs)("span",{className:"value",children:[" ",g]})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:"Limit: "})," ",(0,Fe.jsx)("span",{className:"value",children:y})," "]}),(0,Fe.jsxs)("p",{children:[(0,Fe.jsx)("span",{className:"key",children:" Step:"})," ",(0,Fe.jsx)("span",{className:"value",children:r.params.step})," "]})]}),(0,Fe.jsx)(Fi,{item:r,onOpen:p,copyLink:i,handleDelete:a,handleStarLinkItem:o,handleSubmit:l,label:s})]})}function zi(e){var n=e.pos,t=e.onOpen;return(0,Fe.jsx)("div",{style:{display:t?"none":"flex",width:"30vw"},children:(0,Fe.jsxs)(ir,{children:["Link ",n," "]})})}function Fi(e){var n=e.item,t=e.onOpen,r=e.copyLink,i=e.handleDelete,a=e.handleStarLinkItem,o=e.handleSubmit,l=e.label,s=(0,hr.Fg)(),c=(0,f.useState)(null),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=Boolean(p),g=(0,f.useState)(!1),m=(0,u.Z)(g,2),x=m[0],b=m[1];return(0,Fe.jsxs)("div",{style:{display:"flex",flexDirection:t?"column-reverse":"row",justifyContent:"space-between",alignItems:"center"},children:[(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(D.Z,{title:"Copy Link to Clipboard",placement:"right-end",children:(0,Fe.jsxs)("span",{style:{display:"flex"},children:[(0,Fe.jsx)(Kt,{onClick:function(e){return r(null===n||void 0===n?void 0:n.data,"link",x)},isActive:!0,style:{flex:1},className:"URL-COPY",attachedside:"r",children:(0,Fe.jsx)(pt.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})}),(0,Fe.jsx)(Kt,{attachedside:"l",onClick:function(e){v((function(n){return e.currentTarget})),b((function(e){return x}))},size:"small",className:"date-time-selector","aria-controls":h?"backward-menu":void 0,"aria-haspopup":"true","aria-expanded":h?"true":void 0,children:(0,Fe.jsx)(yt.Z,{fontSize:"small"})}),(0,Fe.jsx)(Ei,{id:"backward-menu",anchorEl:p,open:h,onClose:function(e,n,t){v(null)},qryntheme:s,size:"small",children:(0,Fe.jsx)(N.Z,{style:{padding:"0 14px"},children:(0,Fe.jsx)(M.Z,{children:(0,Fe.jsx)(E.Z,{style:{padding:"0",marginRight:0,cursor:l?"default":"not-allowed"},checked:x,onChange:function(e){b((function(n){return Boolean(e.target.checked)}))},control:(0,Fe.jsx)(R.Z,{style:{paddingRight:"0px",marginRight:"3px"},sx:{"& .MuiSvgIcon-root":{fontSize:14}},disabled:!l}),label:(0,Fe.jsx)(Zt.Z,{style:{fontSize:"12px",color:s.textColor},children:"Relative time"})})})},"relativeTime")})]})})}),(0,Fe.jsx)(D.Z,{title:"Delete Query",children:(0,Fe.jsx)(Kt,{onClick:function(e){return i(n)},children:(0,Fe.jsx)(ut.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Star / Unstar Link",children:(0,Fe.jsx)(Kt,{onClick:function(){return a(n)},children:n.starred?(0,Fe.jsx)(ct.Z,{style:{height:"14px",width:"14px"},fontSize:"small"}):(0,Fe.jsx)(dt.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Search Logs from Query",children:(0,Fe.jsxs)(Xt,{onClick:function(){return o(null===n||void 0===n?void 0:n.data)},children:[(0,Fe.jsx)(gt.Z,{className:"open-icon",fontSize:"small"}),(0,Fe.jsx)("span",{className:"open-text",children:"Open In New Tab"})]})})]})}function Bi(e){var n=e.queryHistory,t=e.copyQuery,r=e.handleDelete,i=e.handleStarItem,a=e.handleSubmit,o=e.filtered,l=e.emptyMessage,s=e.isStarred,c=(0,f.useState)([]),d=(0,u.Z)(c,2),p=d[0],v=d[1];function h(e){var n="";if("string"===typeof e)try{n=JSON.parse(e).queryInput}catch(t){n=e}return n}return(0,f.useEffect)((function(){v(n)}),[]),(0,f.useEffect)((function(){o.length>0&&v(o)}),[o]),(0,f.useEffect)((function(){v(n)}),[n]),(0,Fe.jsx)(Gt,{className:s?"starredCont":"",children:p.length>0?null===p||void 0===p?void 0:p.map((function(e,n){return(0,Fe.jsxs)(or,{children:[(0,Fe.jsx)("span",{style:{color:"#666",paddingRight:"10px",width:"10px",display:"flex",alignItems:"center"},children:p.length-n}),(0,Fe.jsx)(D.Z,{title:e.data,children:(0,Fe.jsxs)(ir,{children:[h(e.data)," "]})}),(0,Fe.jsx)("span",{children:(0,st.Z)(e.timestamp,"yyyy/MM/dd HH:mm:ss")}),(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Fe.jsx)(D.Z,{title:"Copy Query to Clipboard",children:(0,Fe.jsx)(Kt,{onClick:function(){return t(e.data)},children:(0,Fe.jsx)(ft.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Delete Query",children:(0,Fe.jsx)(Kt,{onClick:function(){return r(e)},children:(0,Fe.jsx)(ut.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Star / Unstar Query",children:(0,Fe.jsx)(Kt,{onClick:function(){return i(e)},children:e.starred?(0,Fe.jsx)(ct.Z,{style:{height:"14px",width:"14px"},fontSize:"small"}):(0,Fe.jsx)(dt.Z,{style:{height:"14px",width:"14px"},fontSize:"small"})})}),(0,Fe.jsx)(D.Z,{title:"Search Logs from Query",children:(0,Fe.jsxs)(Xt,{onClick:function(){return a(e)},children:[(0,Fe.jsx)(mt.Z,{className:"open-icon"}),(0,Fe.jsx)("span",{className:"open-text",children:"Show Results"})]})})]})]},n)})):(0,Fe.jsx)(xr,{message:l})})}function Hi(e){var n=e.linksHistory,t=e.copyLink,r=e.handleDelete,i=e.handleStarLinkItem,a=e.handleSubmit,o=e.filtered,l=e.emptyMessage,s=e.isStarred,c=e.label,d=(0,f.useState)([]),p=(0,u.Z)(d,2),v=p[0],h=p[1];return(0,f.useEffect)((function(){h(n)}),[]),(0,f.useEffect)((function(){o.length>0&&h(o)}),[o]),(0,f.useEffect)((function(){h(n)}),[n]),(0,Fe.jsx)(Gt,{className:s?"starredCont":"",children:v.length>0?null===v||void 0===v?void 0:v.map((function(e,n){return(0,Fe.jsxs)(or,{children:[(0,Fe.jsx)("span",{style:{paddingRight:"10px",color:"#666",width:"10px",display:"flex",alignItems:"center"},children:(null===v||void 0===v?void 0:v.length)-n}),(0,Fe.jsx)(Vi,{pos:(null===v||void 0===v?void 0:v.length)-n,item:e,copyLink:t,handleDelete:r,handleStarLinkItem:i,handleSubmit:a,label:c})]},n)})):(0,Fe.jsx)(xr,{message:l})})}function Pi(e){var n=e.starredQueries,t=e.starredLinks,r=e.handleDeleteQuery,i=e.handleDeleteLink,a=e.handleStarItem,o=e.handleStarLinkItem,l=e.handleSubmitQuery,s=e.handleSubmitLink,c=e.filteredLinks,d=e.filteredQueries,p=e.setFilteredStarLink,v=e.setFilteredStarQuery,h=e.filterItems,g=e.emptyQueryMessage,m=e.emptyLinkMessage,x=e.copyQuery,b=e.label,y=(0,f.useState)([]),Z=(0,u.Z)(y,2),w=Z[0],S=Z[1],j=(0,f.useState)([]),k=(0,u.Z)(j,2),C=k[0],T=k[1];return(0,f.useEffect)((function(){S(n),T(t)}),[]),(0,f.useEffect)((function(){c.length>0&&T(c),d.length>0&&S(d)}),[c,d]),(0,f.useEffect)((function(){S(n),T(t)}),[n,t]),(0,Fe.jsxs)(ht.Z,{defaultValue:0,children:[(0,Fe.jsxs)(Ut,{children:[(0,Fe.jsx)(Ft,{children:"Queries"}),(0,Fe.jsx)(Ft,{children:"Links"})]}),(0,Fe.jsxs)(Wt,{value:0,children:[(0,Fe.jsx)(qi,{searchQueriesText:"Queries",queryHistory:n,filterItems:h,setFilteredItems:v}),(0,Fe.jsx)(Bi,{queryHistory:w,copyQuery:x,handleDelete:r,handleStarItem:a,handleSubmit:l,filtered:d,emptyMessage:g,isStarred:!0})]}),(0,Fe.jsxs)(Wt,{value:1,children:[(0,Fe.jsx)(qi,{searchQueriesText:"Links",queryHistory:t,filterItems:h,setFilteredItems:p}),(0,Fe.jsx)(Hi,{linksHistory:C,copyQuery:x,handleDelete:i,handleStarLinkItem:o,handleSubmit:s,filtered:c,emptyMessage:m,isStarred:!0,label:b})]})]})}function qi(e){var n=e.queryHistory,t=e.filterItems,r=e.setFilteredItems,i=e.searchQueriesText,a=(0,f.useState)(""),l=(0,u.Z)(a,2),s=l[0],c=l[1];return(0,Fe.jsx)(Qt,{children:(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Fe.jsx)(At,{}),(0,Fe.jsx)(rr,{type:"text",value:o().sanitize(s),onChange:function(e){var i=e.target.value;c(i);var a=t(n,i);a.length>0?r(a):r([])},placeholder:"Search ".concat(i)})," ",(0,Fe.jsxs)("span",{style:{margin:"0px 4px"},children:["Total: ",n.length]})]})})}function Ai(e){var n=e.queryHistory,t=e.linksHistory;return(0,Fe.jsx)(Qt,{children:(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Fe.jsxs)("span",{style:{margin:"0px 4px"},children:["Query History Rows: ",null===n||void 0===n?void 0:n.length]})," | ",(0,Fe.jsxs)("span",{style:{margin:"0px 4px"},children:["Links History Rows: ",null===t||void 0===t?void 0:t.length]})]})})}function Qi(e){var n=e.clearHistory,t=e.clearLinksHistory;return(0,Fe.jsx)(Gt,{children:(0,Fe.jsxs)("div",{style:{display:"flex"},children:[(0,Fe.jsxs)(Yt,{children:[(0,Fe.jsx)("div",{children:"Clear Query History"}),(0,Fe.jsx)("small",{children:"Delete all of your query history, permanently."}),(0,Fe.jsx)(mr,{dialogType:"Query",clearHistory:n})]}),(0,Fe.jsxs)(Yt,{children:[(0,Fe.jsx)("div",{children:"Clear Links History"}),(0,Fe.jsx)("small",{children:"Delete all of your links history, permanently."}),(0,Fe.jsx)(mr,{dialogType:"Links",clearHistory:t})]})]})})}var Wi=function(e){var n="Link Copied To Clipboard",t=(0,i.I0)(),r=(0,L.Z)().historyStore(),a=(0,wt.Z)(),o=(0,i.v9)((function(e){return e.queryHistory})),s=(0,i.v9)((function(e){return e.linksHistory})),c=(0,i.v9)((function(e){return e.historyOpen})),d=(0,hr.Fg)(),p=(0,f.useState)([]),h=(0,u.Z)(p,2),g=h[0],m=h[1],x=(0,f.useState)([]),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useState)([]),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,f.useState)([]),T=(0,u.Z)(C,2),_=T[0],I=T[1],D=(0,f.useState)([]),N=(0,u.Z)(D,2),M=N[0],E=N[1],R=(0,f.useState)(!1),z=(0,u.Z)(R,2),F=z[0],B=z[1],H=(0,i.v9)((function(e){return e})),P=H.start,q=H.stop,A=(0,i.v9)((function(e){return e.label}));function Q(e){var n=r.remove(e);t(V(n)),t((0,v.el)({message:"Query deleted succesfully",type:Ir.m.info}))}function W(e){var n=a.remove(e);t((0,St.Z)(n))}function U(e){var n={};try{n=JSON.parse(e.data)}catch(x){n=(0,l.Z)({},{id:"",limit:100,panel:"left",queryInput:"",queryType:"range",direction:"forward"})}var r=n,i=r.id,a=r.limit,o=r.panel,s=r.queryInput,u=r.queryType,c=r.type,d=r.dataSourceId,f=r.url,p=r.direction,v="",h=0;if(s.includes("$__interval")){var g=(q.getTime()-P.getTime())/1e3/30/+1..toFixed(1),m=Math.round(g*window.devicePixelRatio.toFixed(2));v=s.replace(/\[\$__interval\]/,"[".concat(m,"s]")),h=m}else v=s;t(Tn(c,v,u,a,o,i,p||"forward",d,f,h))}function J(e){window.open(e)}function G(e,n){return null===e||void 0===e?void 0:e.filter((function(e){return e.data.toLowerCase().includes(n.toLowerCase())}))}function K(e){E(e)}function Y(e){var n=(0,l.Z)((0,l.Z)({},e),{},{starred:!e.starred}),i=r.update(n);t(V(i)),n.starred?t((0,v.el)({message:"Query starred succesfully",type:Ir.m.success})):t((0,v.el)({message:"Query unstarred succesfully",type:Ir.m.success}))}function X(e){var n=(0,l.Z)((0,l.Z)({},e),{},{starred:!e.starred}),r=a.update(n);t((0,St.Z)(r)),n.starred?t((0,v.el)({message:"Link starred succesfully",type:Ir.m.success})):t((0,v.el)({message:"Link unstarred succesfully",type:Ir.m.success}))}function $(){t((0,v.el)({type:"success",message:n}))}function ee(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"query",t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new URL(e).hash,i=new URLSearchParams(r.replace(/#/,""));i.set("label",A);var a=new URL(window.location.href);a.hash="#".concat(i.toString());var o="query"===n?JSON.parse(e).queryInput:t&&A?a:e;setTimeout((function(){var e;null!==(e=navigator)&&void 0!==e&&e.clipboard&&window.isSecureContext?function(e){navigator.clipboard.writeText(e).then((function(){$()}),(function(e){console.log("error on copy",e)}))}(o):function(e){var n=document.createElement("textarea");n.value=e,n.style={position:"fixed",left:"-999999px",top:"-999999px"},document.body.appendChild(n),n.focus(),n.select(),new Promise((function(e,t){$(),document.execCommand("copy")?e():t(),n.remove()}))}(o)}),200)}function ne(){var e=r.clean();t(V(e)),(null===e||void 0===e?void 0:e.length)<1&&t((0,v.el)({message:"Query History cleared succesfully",type:Ir.m.info}))}return(0,f.useEffect)((function(){var e=(null===o||void 0===o?void 0:o.filter((function(e){return e.starred})))||[],n=(null===s||void 0===s?void 0:s.filter((function(e){return e.starred})))||[];B(n),m(e)}),[o,s]),(0,Fe.jsx)(O.Z,{theme:d,children:c&&(0,Fe.jsx)(Vt,{anchor:"bottom",style:{maxHeight:"250px"},open:c,variant:"persistent",theme:d,children:(0,Fe.jsx)(Li,{historyTabHeader:(0,Fe.jsx)(qi,{searchQueriesText:"Queries",queryHistory:o,clearHistory:ne,filterItems:G,setFilteredItems:function(e){Z(e)}}),historyTab:(0,Fe.jsx)(Bi,{queryHistory:o,copyQuery:ee,handleDelete:Q,handleStarItem:Y,handleSubmit:U,filtered:y,emptyMessage:"There is no query history. Please execute some queries and you will see a history here."}),linksTabHeader:(0,Fe.jsx)(qi,{searchQueriesText:"Links",queryHistory:s,filterItems:G,setFilteredItems:function(e){k(e)}}),linksTab:(0,Fe.jsx)(Hi,{linksHistory:s,copyLink:ee,handleDelete:W,handleStarLinkItem:X,handleSubmit:J,filtered:j,label:A,emptyMessage:"There is no links history. Please execute some queries and share links and you will see a history here."}),starredTabHeader:(0,Fe.jsx)(qi,{searchQueriesText:"Queries",queryHistory:g,clearHistory:ne,filterItems:G,setFilteredItems:K}),starredTab:(0,Fe.jsx)(Bi,{queryHistory:g,copyQuery:ee,handleDelete:Q,handleStarItem:Y,handleSubmit:U,filtered:M,emptyMessage:"Click the \u2018Star\u2019 icon to save queries and find them here to reuse again"}),starredHistoryTab:(0,Fe.jsx)(Pi,{starredQueries:g,starredLinks:F,handleDeleteQuery:Q,handleDeleteLink:W,handleStarItem:Y,handleStarLinkItem:X,handleSubmitQuery:U,handleSubmitLink:J,filterItems:G,setFilteredStarLink:function(e){I(e)},setFilteredStarQuery:K,filteredQueries:M,filteredLinks:_,emptyQueryMessage:"Click the 'Star' icon to save links and find them here to reuse again",emptyLinkMessage:"Click the 'Star' icon to save queries and find them here to reuse again",copyQuery:ee,label:A}),settingTabHeader:(0,Fe.jsx)(Ai,{queryHistory:o,linksHistory:s}),settingTab:(0,Fe.jsx)(Qi,{clearHistory:ne,clearLinksHistory:function(){var e=a.clean();t((0,St.Z)(e)),(null===e||void 0===e?void 0:e.length)<1&&t((0,v.el)({message:"Links History cleared succesfully",type:Ir.m.info}))}}),closeButton:(0,Fe.jsx)(yr,{onClose:function(){t(lt(!1))}})})})})},Ui=t(99811),Ji=function(e){var n=e.type,t=e.actualQuery,r=e.total,i=e.dataView;return(0,f.useMemo)((function(){var e=("matrix"===n||"flux"===n)&&(null===t||void 0===t?void 0:t.tableView),a="stream"===n&&(null===t||void 0===t?void 0:t.tableView),o="",l="",s="",u="";if(e){var c,d=25*(null===i||void 0===i||null===(c=i.tableData)||void 0===c?void 0:c.total),f=d<330?d:330;o="".concat(f+25,"px"),s="".concat(f,"px"),l="fit-content",u="fit-content"}if("vector"===n||a){var p=25*r,v=p<330?p:330;o="".concat(v+25,"px"),s="".concat(v,"px"),l="fit-content",u="fit-content"}if("stream"===n&&(null===t||void 0===t||!t.tableView)){var h=25*r<350?"fit-content":"inherit";o=h,s=h,l="fit-content",u="fit-content"}return"matrix"!==n&&"flux"!==n||null!==t&&void 0!==t&&t.tableView||(o="fit-content",s="400px",l="fit-content",u="fit-content"),{regularCont:o,regularView:s,maxCont:l,maxView:u}}),[r,n,null===t||void 0===t?void 0:t.tableView])},Gi=function(e){var n,t=e.total,r=e.panelSize,i=e.dataView,a=0;"matrix"===i.type?a=null===i||void 0===i||null===(n=i.tableData)||void 0===n?void 0:n.total:a=t;return(0,f.useMemo)((function(){var e=25*a;return"max"===r?e:"min"===r?0:e<310?e:310}),[r])},Ki=function(e){var n=e.panel,t=e.dataView;return(0,f.useMemo)((function(){var e={};return n&&t&&(e=null===n||void 0===n?void 0:n.find((function(e){return e.id===t.id}))),e}),[n,t])};function Yi(e){var n=e.name;return(0,Fe.jsx)(Fe.Fragment,{children:n})}var Xi,$i,ea,na,ta,ra,ia,aa,oa,la,sa=t(85281),ua=(jt.Z.div(Xi||(Xi=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n margin: 5px;\n padding: 6px;\n overflow-y: auto;\n overflow-x: hidden;\n position: relative;\n flex: 1;\n border-radius: 3px;\n\n &::-webkit-scrollbar {\n width: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.mainBgColor}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.scrollbarThumb})),jt.Z.div($i||($i=(0,r.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n height: 100%;\n font-size: 0.75em;\n letter-spacing: 1px;\n padding: 30px;\n color: ",";\n background: ",";\n text-align: center;\n"])),(function(e){return e.theme.textOff}),(function(e){return e.theme.secondaryWidgetContainer}))),ca=(jt.Z.div(ea||(ea=(0,r.Z)(["\n display: flex;\n align-items: center;\n font-size: 10px;\n font-family: monospace;\n margin: 0px 10px;\n color: ",";\n span {\n background: ",";\n padding: 4px;\n border-radius: 4px;\n border: 1px solid ",";\n margin: 0px 5px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder})),jt.Z.div(na||(na=(0,r.Z)(["\n display: flex;\n min-height: min-content;\n flex-direction: column;\n height: 100%;\n"]))),(0,jt.Z)(sa.Z)(ta||(ta=(0,r.Z)(["\n position: absolute;\n top: 50px;\n left: 0;\n right: 0;\n margin: auto;\n"]))),jt.Z.div(ra||(ra=(0,r.Z)(["\n overflow-y: auto;\n margin: 2px;\n display: flex;\n flex-direction: column;\n flex: 1;\n max-height: 100vh;\n &::-webkit-scrollbar {\n background: transparent;\n }\n ::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n"])))),da=jt.Z.div(ia||(ia=(0,r.Z)(["\n display: flex;\n align-items: center;\n color: ",";\n font-size: 12px;\n .header-actions {\n justify-self: flex-end;\n .header-icon {\n padding: 1px 2px;\n margin: 0px 2px;\n border-radius: 3px;\n cursor: pointer;\n color: ",";\n &:hover {\n background: ",";\n }\n }\n }\n .view-header-info {\n display: flex;\n flex: 1;\n align-items: center;\n span {\n margin: 0px 3px;\n .exp {\n font-family: monospace;\n }\n }\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault})),fa=jt.Z.div(aa||(aa=(0,r.Z)(["\n margin: 0px 2px;\n padding: 2px;\n font-size: 10px;\n border: 1px solid ",";\n border-radius: 3px;\n"])),(function(e){return e.theme.buttonBorder})),pa=jt.Z.div(oa||(oa=(0,r.Z)(["\n display: flex;\n align-items: center;\n margin: 0px 12px;\n flex: 1;\n max-width: 450px;\n overflow-x: auto;\n &::-webkit-scrollbar {\n width: 5px;\n height: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.scrollbarThumb})),va=jt.Z.div(la||(la=(0,r.Z)(["\n background: ",";\n color: ",";\n display: flex;\n flex-direction: column;\n padding: 20px;\n div {\n width: 100%;\n overflow-wrap: break-word;\n font-family: monospace;\n }\n p {\n padding: 10px;\n font-size: 12px;\n display: flex;\n flex: 1;\n align-items: center;\n flex-wrap: wrap;\n span.label {\n background: ",";\n color: ",";\n margin: 2px;\n padding: 2px;\n border-radius: 2px;\n }\n }\n h4 {\n margin-bottom: 20px;\n padding-bottom: 4px;\n border-bottom: 1px solid ",";\n }\n pre {\n font-family: monospace;\n }\n small {\n font-size: 10px;\n }\n"])),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.buttonBorder})),ha=t(33973),ga=t(446),ma=function(e){var n=e.labels;return(null===n||void 0===n?void 0:n.length)>0?(0,Fe.jsxs)("p",{children:["Labels:",n.map((function(e,n){return(0,Fe.jsx)("span",{className:"label",children:e},n)}))]}):null},xa=function(e){var n=e.idRef,t=e.expr,r=e.queryType;return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("h4",{children:n}),(0,Fe.jsx)("div",{children:(0,Fe.jsx)("p",{children:t})}),(0,Fe.jsxs)("p",{children:["Query Type: ",r]})]})},ba=function(e){var n=e.expr,t=e.idRef,r=e.labels,i=e.limit,a=e.queryType,o=e.total,s={idRef:t,expr:n,queryType:a},u={labels:r};return(0,Fe.jsxs)(va,{children:[(0,Fe.jsx)(xa,(0,l.Z)({},s)),(0,Fe.jsx)(ma,(0,l.Z)({},u)),(0,Fe.jsxs)("p",{children:["Limit: ",i]}),(0,Fe.jsxs)("p",{children:["Total: ",o]})]})};function ya(e){var n=e.expr,t=e.idRef,r=e.labels,i=e.queryType,a=e.limit,o=e.total,l=e.onClose,s=e.open,u=(0,hr.Fg)();return(0,Fe.jsx)(I.a,{theme:u,children:(0,Fe.jsx)(sr.Z,{open:s,onClose:l,PaperProps:{classes:{root:vr.ht}},children:(0,Fe.jsx)(ba,{expr:n,idRef:t,labels:r,queryType:i,limit:a,total:o})})})}function Za(e){var n=(e||{fixedSize:!1}).fixedSize,t=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),r=(0,f.useState)(!1),i=(0,u.Z)(r,2),a=i[0],o=i[1],s=(0,f.useState)(!0),c=(0,u.Z)(s,2),d=c[0],p=c[1],v=(0,hr.Fg)(),h=e.actualQuery,g=e.dataView,m=e.type,x=e.total,b=e.setMinimize,y=e.setMaxHeight,Z=(0,f.useMemo)((function(){var e="matrix"===m&&(null===h||void 0===h?void 0:h.tableView),n="stream"===m&&(null===h||void 0===h?void 0:h.tableView);return"matrix"!==m&&"flux"!==m||null!==h&&void 0!==h&&h.tableView?"stream"!==m||null!==h&&void 0!==h&&h.tableView?"vector"===m||e||n?"Table":"empty"===m?"No Results":void 0:"Logs":"Chart"}),[m,null===h||void 0===h?void 0:h.tableView]),w=(0,f.useCallback)((function(){d?(b(),p(!1)):(y(),p(!0))}),[d,b,y]),S=(0,f.useCallback)((function(){o(!0)}),[]),j=(0,f.useMemo)((function(){var e;return(null===g||void 0===g||null===(e=g.labels)||void 0===e?void 0:e.join(" | "))||""}),[g.labels]),k=(0,f.useMemo)((function(){var n;if(null!==g&&void 0!==g&&null!==(n=g.labels)&&void 0!==n&&n.length){if((null===g||void 0===g?void 0:g.labels.length)>4){var t=(0,H.Z)(g.labels).slice(0,4);return(0,Fe.jsxs)(Fe.Fragment,{children:[t.map((function(n,t){return(0,Fe.jsx)(fa,{children:(0,Fe.jsx)(Yi,(0,l.Z)({name:n},e.theme))},t)}))," ","..."]})}return(0,Fe.jsx)(Fe.Fragment,{children:g.labels.map((function(n,t){return(0,Fe.jsx)(fa,{children:(0,Fe.jsx)(Yi,(0,l.Z)({name:n},e.theme))},t)}))})}}),[g.labels,e.theme]);if(h){var C,T=h.idRef,N=h.expr,M=h.limit,E=h.queryType;return(0,Fe.jsx)(I.a,{theme:v,children:(0,Fe.jsxs)(da,{children:[(0,Fe.jsxs)("div",{className:"view-header-info",children:[(0,Fe.jsx)("span",{children:(0,Fe.jsx)("span",{className:"exp",children:Z})}),(0,Fe.jsx)(D.Z,{title:(null===h||void 0===h?void 0:h.expr)||"",children:(0,Fe.jsxs)("span",{children:[" ",(0,Fe.jsx)("span",{className:"exp",children:null===h||void 0===h?void 0:h.idRef})]})}),!t&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("span",{children:["limit:"," ",(0,Fe.jsx)("span",{className:"exp",children:null===h||void 0===h?void 0:h.limit})]}),(0,Fe.jsxs)("span",{children:["count: ",(0,Fe.jsx)("span",{className:"exp",children:x})]})]}),(null===g||void 0===g||null===(C=g.labels)||void 0===C?void 0:C.length)>0&&!t&&(0,Fe.jsx)("span",{children:(0,Fe.jsxs)(pa,{title:j,children:["labels:",k]})})]}),(0,Fe.jsx)("div",{className:"header-actions",children:!n&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(ha.Z,{className:"header-icon",style:{fontSize:"12px"},onClick:S}),(0,Fe.jsx)(Ta,{isOpen:d,onClick:w})]})}),a&&(0,Fe.jsx)(ya,{labels:g.labels||[],limit:M,expr:N,queryType:E,idRef:T,open:a,total:x,onClose:function(e){return o(!1)}})]})})}return null}var wa,Sa,ja,ka,Ca,Ta=function(e){var n=e.isOpen,t=e.onClick;return n?(0,Fe.jsx)(ga.Z,{className:"header-icon",onClick:t,style:{fontSize:"14px"}}):(0,Fe.jsx)(Qr.Z,{className:"header-icon",onClick:t,style:{fontSize:"14px"}})};function _a(e){var n=(0,hr.Fg)();return e.loading?null:(0,Fe.jsx)(I.a,{theme:n,children:(0,Fe.jsx)(ua,{children:"Please adjust search parameters and click on \u2018Show Results\u2019 button"})})}var Ia=jt.Z.div(wa||(wa=(0,r.Z)(["\n margin: 4px;\n padding: 5px;\n margin-top: 0px;\n border: 1px solid ",";\n border-radius: 3px;\n display: flex;\n flex-direction: column;\n flex: ",";\n\n height: ",";\n .view-content {\n height: ",";\n display: ",";\n flex-direction: ",";\n flex: 1;\n }\n"])),(function(e){return e.theme.buttonBorder}),(function(e){return"min"===e.size?0:1}),(function(e){return"regular"===e.size?e.vheight.regularCont:"max"===e.size?e.vheight.maxCont:"20px"}),(function(e){return"regular"===e.size?e.vheight.regularView:"max"===e.size?e.vheight.maxView:"0px"}),(function(e){return"min"===e.size?"none":(e.size,"flex")}),(function(e){return e.size,"column"})),Da=(0,jt.Z)(Mt.Z)(Sa||(Sa=(0,r.Z)(["\n width: 100%;\n background: ",";\n height: inherit;\n flex: 1;\n"])),(function(e){return e.theme.widgetContainer})),Na=((0,jt.Z)(ht.Z)(ja||(ja=(0,r.Z)(["\n display: flex;\n height: 100%;\n"]))),(0,jt.Z)(Nt.Z)(ka||(ka=(0,r.Z)(["\n min-width: 320px;\n background: ",";\n border-bottom: 4px solid ",";\n display: ",";\n align-items: center;\n align-content: space-between;\n"])),(function(e){return e.theme.tabHeader}),(function(e){return e.theme.historyRow}),(function(e){return"min"===e.panelsize?"none":"flex"}))),Ma=(0,jt.Z)(Ct.Z)(Ca||(Ca=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n cursor: pointer;\n font-size: 13px;\n background-color: transparent;\n padding: 6px 10px;\n border: none;\n border-radius: 3px 3px 0px 0px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid transparent;\n transition: 0.2s all;\n\n &:hover {\n background-color: ",";\n }\n\n &:focus {\n color: ",";\n background: ",";\n border-radius: 3px 3px 0px 0px;\n\n outline-offset: 2px;\n }\n\n &."," {\n border-bottom: 1px solid ",";\n }\n\n &."," {\n opacity: 0.5;\n cursor: not-allowed;\n }\n @media screen and (max-width: 360px) {\n span {\n display: none;\n }\n padding: 5px 20px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),Tt.Z.selected,(function(e){return e.theme.primaryDark}),kt.Z.disabled);function Ea(e){var n=e.viewRef,t=e.panelSize,r=e.setStreamClose,i=e.setMinimize,a=e.setMaxHeight,o=e.actualQuery,s=e.total,u=e.loading;return(0,Fe.jsxs)(Ia,{ref:n,size:t,vheight:"regular",children:[(0,Fe.jsx)(Za,(0,l.Z)({onClose:r,setMinimize:i,setMaxHeight:a,actualQuery:o,total:s,type:"empty",fixedSize:!0},e)),(0,Fe.jsx)(_a,{loading:u})]})}var Ra,Oa,La,Va,za,Fa=t(15671),Ba=t(43144),Ha=t(60136),Pa=t(29388),qa=t(16912),Aa={critical:["emerg","fatal","alert","crit","critical"],error:["err","eror","error"],warning:["warn","warning"],info:["info","information","notice"],debug:["dbug","debug"],trace:["trace"]},Qa={critical:"purple",error:"red",warning:"orange",info:"green",debug:"blue",trace:"lightblue",unknown:"gray"},Wa=(0,qa.Z)((function(e,n){return{items:e,toggleItemActive:n}}));var Ua,Ja,Ga=(0,ze.iv)(Ra||(Ra=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n margin-top: 3px;\n"]))),Ka=jt.Z.div(Oa||(Oa=(0,r.Z)(["\n color: ",";\n font-size: 12px;\n cursor: pointer;\n padding-left: 0.5rem;\n margin-left: 0.25rem;\n display: flex;\n flex-direction: column;\n margin-bottom: 2px;\n margin-top: 2px;\n font-family: monospace;\n &:hover {\n background: ",";\n }\n\n p {\n display: inline-block;\n overflow-wrap: anywhere;\n margin-left: 3px;\n }\n border-left: 4px solid ",";\n .log-ts-row {\n display: flex;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.logBgColor}),(function(e){return e.rowColor})),Ya=jt.Z.span(La||(La=(0,r.Z)(["\n font-size: 12px;\n color: ",";\n line-height: 1.5;\n"])),(function(e){return e.theme.textPrimary})),Xa=jt.Z.span(Va||(Va=(0,r.Z)(["\n position: relative;\n color: ",";\n margin-right: 0.25rem;\n white-space: nowrap;\n font-size: 12px;\n line-height: 1.5;\n"])),(function(e){return e.theme.textColor})),$a=jt.Z.div(za||(za=(0,r.Z)(["\n overflow: hidden;\n overflow-y: auto;\n height: calc(100% - 20px);\n"])));function eo(e){var n=e.text,t=e.dateFormated,r=e.isMobile,i=e.isSplit,a=e.isShowTs;return(0,Fe.jsxs)("div",{className:"log-ts-row",children:[a&&!r&&!i&&(0,Fe.jsx)(Xa,{children:t}),(0,Fe.jsxs)(Ya,{children:[(r||i)&&a&&(0,Fe.jsx)("p",{children:t}),(0,Fe.jsx)("p",{children:n})]})]})}var no=jt.Z.div(Ua||(Ua=(0,r.Z)(["\n color: ",";\n flex: 0;\n background-color: hsl(220, 67%, 55%);\n display: flex;\n margin-left: 5px;\n padding: 0 4px;\n border-radius: 2px;\n font-size: 12px;\n align-items: center;\n white-space: nowrap;\n"])),(function(e){return e.theme.buttonText})),to=jt.Z.div(Ja||(Ja=(0,r.Z)(["\n color: ",";\n flex: 1;\n display: flex;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.textPrimary}),(function(e){return e.theme.widgetContainer})),ro={width:"18px",height:"18px"},io=t(33774),ao=["json","regexp","logfmt","pattern","~","="],oo=/{[^}]*}/,lo={newQuery:function(e,n,t){var r=(0,u.Z)(e,2),i=r[0],a=r[1];return"".concat(t[0]||"","{").concat(i).concat(n,'"').concat(a,'"}').concat(t[2]||"")},equalLabels:function(e,n,t){return"!="===n?lo.newQuery(e,n,t):"{}"},formatQuery:function(e,n){return"".concat(n[0]||"","{").concat(e||"","}").concat(n[2]||"")},splitLabels:function(e){var n,t;return(null===e||void 0===e||null===(n=e.match(/[^{}]+(?=})/g))||void 0===n||null===(t=n.map((function(e){return e.split(",")})))||void 0===t?void 0:t.flat())||[]},addLabel:function(e,n,t){return"!="===e?n:t},rmValueFromLabel:function(e,n){var t,r=null===e||void 0===e?void 0:e.split("=~"),i=(0,u.Z)(r,2),a=i[0],o=i[1],l=null===o||void 0===o?void 0:o.split(/[""]/)[1],s=null===l||void 0===l?void 0:l.split("|"),c=null===s||void 0===s?void 0:s.filter((function(e){return e.trim()!==(null===n||void 0===n?void 0:n.trim())}));if((null===c||void 0===c?void 0:c.length)>1){var d,f=null===c||void 0===c||null===(d=c.join("|"))||void 0===d?void 0:d.trim();return(null===a||void 0===a?void 0:a.trim())+'=~"'+f+'"'}var p=null===c||void 0===c||null===(t=c.join(""))||void 0===t?void 0:t.trim();return(null===a||void 0===a?void 0:a.trim())+'="'+p+'"'},rmNonEqValueFromLabel:function(e,n){var t,r=null===e||void 0===e?void 0:e.split("!~"),i=(0,u.Z)(r,2),a=i[0],o=i[1],l=null===o||void 0===o?void 0:o.split(/[""]/)[1],s=null===l||void 0===l?void 0:l.split("|"),c=null===s||void 0===s?void 0:s.filter((function(e){return e.trim()!==(null===n||void 0===n?void 0:n.trim())}));if((null===c||void 0===c?void 0:c.length)>1){var d,f=null===c||void 0===c||null===(d=c.join("|"))||void 0===d?void 0:d.trim();return(null===a||void 0===a?void 0:a.trim())+'!~"'+f+'"'}var p=null===c||void 0===c||null===(t=c.join(""))||void 0===t?void 0:t.trim();return(null===a||void 0===a?void 0:a.trim())+'!="'+p+'"'},addValueToLabel:function(e,n,t){var r=t?"=":"=~",i=null===e||void 0===e?void 0:e.split(r),a=(0,u.Z)(i,2),o=a[0],l=a[1],s=null===l||void 0===l?void 0:l.split(/[""]/)[1];return"".concat(o,'=~"').concat(null===s||void 0===s?void 0:s.trim(),"|").concat(null===n||void 0===n?void 0:n.trim(),'"')},addNonEqValueToLabel:function(e,n,t){var r=t?"!=":"!~",i=null===e||void 0===e?void 0:e.split(r),a=(0,u.Z)(i,2),o=a[0],l=a[1],s=null===l||void 0===l?void 0:l.split(/[""]/)[1];return"".concat(o,'!~"').concat(null===s||void 0===s?void 0:s.trim(),"|").concat(null===n||void 0===n?void 0:n.trim(),'"')},isEqualsQuery:function(e,n){var t=(0,u.Z)(n,2),r=t[0],i=t[1];return e==="{".concat(r,'="').concat(i,'"}')},editQuery:function(e,n,t,r){return lo.isEqualsQuery(e,n)&&null!==n?lo.equalLabels(n,t,r):so.fromLabels(e,n,t,r)}},so={fromLabels:function(e,n,t,r){var i=function(e,n,t){var r=(0,u.Z)(e,2),i=r[0],a=r[1],o="".concat(i,'="').concat(a,'"'),l="".concat(i,'!="').concat(a,'"'),c=lo.splitLabels(n);if(!c)return"";var d,f=(0,s.Z)(c);try{var p=function(){var e,r,s,u,c,f,p,v,h,g,m,x,b,y,Z,w,S,j,k,C,T,_=d.value,I=_.match(/([^{}=,~!]+)/gm),D=lo.splitLabels(n);if(!I)return{v:""};if(null!==a&&!_.includes(null===i||void 0===i?void 0:i.trim())&&(null===D||void 0===D||!D.some((function(e){return e.includes(i)})))){var N="!="===t?l:_,M=lo.addLabel(t,N,o);return{v:lo.splitLabels(n).concat(M).join(",")}}if(null!==a&&null!==_&&void 0!==_&&_.includes("=")&&(null===_||void 0===_||null===(e=_.split("="))||void 0===e||null===(r=e[0])||void 0===r?void 0:r.trim())===(null===i||void 0===i?void 0:i.trim())&&(null===_||void 0===_||!_.includes(a))){var E,R,O=lo.addValueToLabel(_,a,!0),L=new RegExp("".concat(_));return{v:null===lo||void 0===lo||null===(E=lo.splitLabels(n))||void 0===E||null===(R=E.join(","))||void 0===R?void 0:R.replace(L,O)}}if(null!==a&&null!==_&&void 0!==_&&_.includes("=~")&&(null===_||void 0===_||null===(s=_.split("=~"))||void 0===s||null===(u=s[0])||void 0===u?void 0:u.trim())===(null===i||void 0===i?void 0:i.trim())&&null!==_&&void 0!==_&&_.includes(a)){var V,z,F=lo.rmValueFromLabel(_,a),B=new RegExp("".concat(_));return{v:null===lo||void 0===lo||null===(V=lo.splitLabels(n))||void 0===V||null===(z=V.join(","))||void 0===z?void 0:z.replace(B,F)}}if(null!==a&&null!==_&&void 0!==_&&_.includes("=~")&&(null===_||void 0===_||null===(c=_.split("=~"))||void 0===c||null===(f=c[0])||void 0===f?void 0:f.trim())===(null===i||void 0===i?void 0:i.trim())&&(null===_||void 0===_||!_.includes(null===a||void 0===a?void 0:a.trim())))return{v:lo.addValueToLabel(_,a,!1)};if(null!==_&&void 0!==_&&_.includes("=")&&(null===_||void 0===_||null===(p=_.split("="))||void 0===p||null===(v=p[0])||void 0===v?void 0:v.trim())===(null===i||void 0===i?void 0:i.trim())&&((null===_||void 0===_||null===(h=_.split('"'))||void 0===h||null===(g=h[1])||void 0===g?void 0:g.trim())===(null===a||void 0===a?void 0:a.trim())||null===a)&&null!==D&&void 0!==D&&D.some((function(e){return e===_}))){var H=null===D||void 0===D?void 0:D.filter((function(e){return e!==_}));return{v:null===H||void 0===H?void 0:H.join(",")}}if(null!==_&&void 0!==_&&_.includes("!=")&&(null===_||void 0===_||null===(m=_.split("!="))||void 0===m||null===(x=m[0])||void 0===x?void 0:x.trim())===(null===i||void 0===i?void 0:i.trim())&&((null===_||void 0===_||null===(b=_.split('"'))||void 0===b||null===(y=b[1])||void 0===y?void 0:y.trim())===(null===a||void 0===a?void 0:a.trim())||null===a)&&null!==D&&void 0!==D&&D.some((function(e){return e===_}))){var P=null===D||void 0===D?void 0:D.filter((function(e){return e!==_}));return{v:null===P||void 0===P?void 0:P.join(",")}}if(null!==_&&void 0!==_&&_.includes("!=")&&(null===_||void 0===_||null===(Z=_.split("!=")[0])||void 0===Z?void 0:Z.trim())===(null===i||void 0===i?void 0:i.trim())){var q,A,Q=lo.addNonEqValueToLabel(_,a,!0),W=new RegExp("".concat(_));return{v:null===(q=lo.splitLabels(n))||void 0===q||null===(A=q.join(","))||void 0===A?void 0:A.replace(W,Q)}}if(null!==a&&null!==_&&void 0!==_&&_.includes("!~")&&(null===_||void 0===_||null===(w=_.split("!~"))||void 0===w||null===(S=w[0])||void 0===S?void 0:S.trim())===(null===i||void 0===i?void 0:i.trim())&&null!==_&&void 0!==_&&_.includes(a)){var U=lo.rmNonEqValueFromLabel(_,a),J=new RegExp("".concat(_));return{v:lo.splitLabels(n).join(",").replace(J,U)}}if(null!==_&&void 0!==_&&_.includes("!=")&&(null===_||void 0===_||null===(j=_.split("!="))||void 0===j||null===(k=j[0])||void 0===k?void 0:k.trim())===(null===i||void 0===i?void 0:i.trim())&&((null===_||void 0===_||null===(C=_.split('"'))||void 0===C||null===(T=C[1])||void 0===T?void 0:T.trim())===(null===a||void 0===a?void 0:a.trim())||null===a)&&null!==D&&void 0!==D&&D.some((function(e){return e===_}))){var G=null===D||void 0===D?void 0:D.filter((function(e){return e!==_}));return{v:null===G||void 0===G?void 0:G.join(",")}}};for(f.s();!(d=f.n()).done;){var v=p();if("object"===typeof v)return v.v}}catch(h){f.e(h)}finally{f.f()}return""}(n,e,t);return lo.formatQuery(i,r)}};function uo(e,n,t,r,i){var a,o,l=lo.newQuery,s=lo.editQuery,u=[n,t],c=null===e||void 0===e?void 0:e.split(/[{}]/),d=(null===e||void 0===e?void 0:e.match(oo))&&c[1].length>7;return(null===(a=c[1])||void 0===a?void 0:a.length)<1&&"metrics"===i?"".concat(t,"{}"):(null===(o=c[1])||void 0===o?void 0:o.length)>1&&"metrics"===i?"".concat(t,"{").concat(c[1],"}"):d||"__name__"===n?s(e,u,r,c):l(u,r,c)}function co(e,n,t,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"logs",o=(0,u.Z)(r,2),l=o[0],s=o[1],c=A.Z.dispatch,d=i?"!=":"=",f=A.Z.getState(),p=f.left,v=f.right,h=uo(e,l,s,d,a);if("left"===n){var g=(0,H.Z)(p);g.forEach((function(e){e.id===t&&(e.expr=h)})),c(m(g))}if("right"===n){var b=(0,H.Z)(v);b.forEach((function(e){e.id===t&&(e.expr=h)})),c(x(b))}}function fo(e,n,t,r){return e.includes("".concat(t).concat(n,'"').concat(r,'"'))}function po(e,n,t){return vo.apply(this,arguments)}function vo(){return vo=(0,F.Z)((0,z.Z)().mark((function e(n,t,r){var i,a,o,l,s,u,c,d,f=arguments;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=f.length>3&&void 0!==f[3]&&f[3],a=f.length>4?f[4]:void 0,n.preventDefault(),n.stopPropagation(),o=a.expr,l=a.panel,s=a.id,u=a.dataSourceType,c=fo(o,"!=",t,r),d=fo(o,"=",t,r),!(c&&i||d&&!i)){e.next=9;break}return e.abrupt("return");case 9:co(o,l,s,[t,r],i,u);case 10:case"end":return e.stop()}}),e)}))),vo.apply(this,arguments)}var ho=function(e){var n=e.dataSourceData,t=e.linkedFieldTags,r=e.buttonKey,a=e.value,o=e.openTraces,l=(0,i.v9)((function(e){return e.dataSources}));if(null!==n&&void 0!==n&&n.linkedFields){var s=n.linkedFields,c=function(e){var n,t;return(null===e||void 0===e||null===(n=e.fields)||void 0===n||null===(t=n.map((function(e){if(null!==e&&void 0!==e&&e.tagGroups){var n=Object.entries(null===e||void 0===e?void 0:e.tagGroups);return null===n||void 0===n?void 0:n.map((function(e){var n=(0,u.Z)(e,2);return{name:n[0],value:n[1]}}))}return[]})))||void 0===t?void 0:t.flat())||[]}(t),d=null===c||void 0===c?void 0:c.map((function(e){return e.name}));if((null===s||void 0===s?void 0:s.length)>0){var f=s[0],p=f.dataSourceId,v=f.linkType,h=f.internalLink,g=null===l||void 0===l?void 0:l.find((function(e){return e.id===p})),m=null===g||void 0===g?void 0:g.url;if(d.includes(r)&&a&&!0===h)return(0,Fe.jsxs)(no,{onClick:function(e){o(e,r,a,p,m,v)},children:[(0,Fe.jsx)(io.Z,{style:{width:"14px",height:"14px"}}),(0,Fe.jsx)("span",{children:v})]})}}return null},go=t(70306),mo=t(48005);function xo(e){var n=e.label,t=e.value,r=e.actQuery;return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("span",{"aria-label":"Filter for value",title:"Filter for value",onClick:function(e){return po(e,n,t,!1,r)},className:"icon",children:(0,Fe.jsx)(go.Z,{color:"primary",style:ro})}),(0,Fe.jsx)("span",{"aria-label":"Filter out value",title:"Filter out value",onClick:function(e){return po(e,n,t,!0,r)},className:"icon",children:(0,Fe.jsx)(mo.Z,{color:"primary",style:ro})})]})}function bo(e){var n=e.tags,t=e.actQuery,r=e.dataSourceData,a=e.linkedFieldTags,o=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),s=(0,hi.F)(),c=(0,i.v9)((function(e){return e.isEmbed})),d=(0,i.I0)(),f=(0,i.v9)((function(e){return e.right})),p=function(n,t,r,i,a,s){var u;n.stopPropagation(),"left"!==(null===e||void 0===e||null===(u=e.actQuery)||void 0===u?void 0:u.panel)||o||d(w(!0));var c=JSON.parse(JSON.stringify(f)),p=JSON.parse(JSON.stringify(e.actQuery));try{var v=(0,l.Z)((0,l.Z)({},c[0]),{},{id:c[0].id,idRef:s+"="+r,panel:"right",queryType:"range",dataSourceType:s.toLowerCase()||"traces",dataSourceId:i||"32D16h5uYBqUUzhD",dataSourceURL:a,expr:r,limit:100,step:100,tableView:!1,chartView:!1,isShowTs:!1,browserOpen:!1,labels:[],values:[],direction:"forward",loading:!1,open:!0});d(Tn(s.toLowerCase()||"traces",r,"range",p.limit||100,"right",v.id,"forward",i||"32D16h5uYBqUUzhD",a)),d(x([v]))}catch(n){console.log(n)}};return(0,Fe.jsx)(I.a,{theme:s,children:Object.entries(n).map((function(n,i){var o=(0,u.Z)(n,2),s=o[0],d=o[1];return(0,Fe.jsx)(to,{children:(0,Fe.jsxs)("div",{className:"value-tags",children:[!c&&(0,Fe.jsx)(xo,{label:s,value:d,actQuery:t}),(0,Fe.jsx)("span",{children:s}),(0,Fe.jsxs)("span",{style:{flex:1},children:[d,(0,Fe.jsx)(ho,(0,l.Z)((0,l.Z)({},e),{},{dataSourceData:r,linkedFieldTags:a,buttonKey:s,value:d,openTraces:p}))]})]},i)},i)}))})}function yo(e){var n=e.showLabels,t=e.tags,r=e.actQuery;return n?(0,Fe.jsx)("div",{className:"value-tags-container",children:(0,Fe.jsx)(bo,(0,l.Z)((0,l.Z)({},e),{},{tags:t,actQuery:r}))}):null}function Zo(e){var n=e.toggleItemActive,t=e.index,r=e.log,i=e.actQuery,a=e.isMobile,o=e.isSplit,u=e.dataSourceData,d=r.tags,p=r.timestamp,v=r.text,h=r.showLabels,g=function(e,n){return(0,f.useMemo)((function(){var t;if((null===n||void 0===n||null===(t=n.linkedFields)||void 0===t?void 0:t.length)>0){var r,i=n.linkedFields.map((function(n){var t=n.id,r=n.regex,i=n.name,a=n.internalLink,o=new RegExp(r,"i"),l=e.match(o);return l&&(null===l||void 0===l?void 0:l.length)>0?{name:i,internalLink:a,id:t,tagGroups:l.groups}:{}})),a={tags:{},fields:[]},o=(0,s.Z)(i);try{for(o.s();!(r=o.n()).done;){var u=r.value;a.tags=(0,l.Z)((0,l.Z)({},a.tags),u.tagGroups),a.fields.push(u)}}catch(c){o.e(c)}finally{o.f()}return a}return{}}),[n,e])}(v,u),m=(0,f.useMemo)((function(){return function(e){var n=(null===e||void 0===e?void 0:e.severity)||(null===e||void 0===e?void 0:e.level);if(n){var t=Object.keys(Aa).find((function(e){return Aa[e].includes(n.toLowerCase())}));return Qa[t]}return Qa.unknown}(d)}),[d]),x=(0,f.useMemo)((function(){return function(e){return c(parseInt(e)).format("YYYY-MM-DD HH:mm:ss.SSS UTC")}(p)}),[p]),b={actQuery:i,tags:(0,l.Z)((0,l.Z)({},d),g.tags),linkedFieldTags:g,showLabels:h,dataSourceData:u},y={dateFormated:x,text:v,isMobile:a,isSplit:o,dataSourceData:u},Z={rowColor:m,onClick:function(){n(t)}};return(0,Fe.jsxs)(Ka,(0,l.Z)((0,l.Z)({},Z),{},{children:[(0,Fe.jsx)(eo,(0,l.Z)((0,l.Z)({},y),{},{isShowTs:i.isShowTs})),(0,Fe.jsx)(yo,(0,l.Z)({},b))]}))}function wo(e){var n,t=e.items,r=e.toggleItemActive,a=e.actQuery,o=e.dataSourceId,l=a.splitted,s=Wa(t,r),u=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),c=function(e){return(0,f.useMemo)((function(){var n=null===e||void 0===e?void 0:e.linkedFields,t=null===e||void 0===e?void 0:e.id,r=null===e||void 0===e?void 0:e.name,i=null===e||void 0===e?void 0:e.url;if(e)return{linkedFields:n,id:t,name:r,url:i}}),[e])}((0,i.v9)((function(e){var n=e.dataSources;return null===n||void 0===n?void 0:n.find((function(e){return e.id===o}))})));return null===s||void 0===s||null===(n=s.items)||void 0===n?void 0:n.map((function(e,n){return(0,Fe.jsx)(Zo,{index:n,dataSourceId:o,dataSourceData:c,actQuery:a,log:e,isSplit:l,isMobile:u,toggleItemActive:r},n)}))}var So,jo,ko,Co,To,_o,Io,Do=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;(0,Fa.Z)(this,t),(r=n.call(this,e)).toggleItemActive=function(e){return r.setState((function(n){var t=n.messages[e],r=n.messages.concat();return r[e]=(0,l.Z)((0,l.Z)({},t),{},{showLabels:!t.showLabels}),{messages:r}}))};var i=(e||[]).messages;return r.state={messages:i},r}return(0,Ba.Z)(t,[{key:"render",value:function(){var e=this.props.actualQuery,n=e.dataSourceId,t=this.state.messages;return(0,Fe.jsx)($a,{children:(0,Fe.jsx)(wo,(0,l.Z)((0,l.Z)({},this.props),{},{dataSourceId:n,actQuery:e,items:t,toggleItemActive:this.toggleItemActive}))})}}]),t}(f.PureComponent),No=t(24325),Mo=t(17432),Eo=t(23436),Ro=function(e,n,t,r){var i=(0,Eo.O4)(e.getValue(n),t);return r(i),i.passed},Oo={cell:function(e){return e.getValue()}},Lo=function(e,n){return{updateData:function(t,r,i){n(),e((function(e){return e.map((function(n,a){return a!==t?n:(0,l.Z)((0,l.Z)({},e[t]),{},(0,B.Z)({},r,i))}))}))}}},Vo=t(45987),zo=["value","onChange","debounce","theme"],Fo=function(e){return(0,ze.iv)(So||(So=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 3px 8px;\n font-size: 12px;\n"])),e.textColor,e.inputBg,e.buttonBorder)},Bo=function(e){var n=e.value,t=e.onChange,r=e.debounce,i=void 0===r?500:r,a=e.theme,s=(0,Vo.Z)(e,zo),c=(0,f.useState)(n),d=(0,u.Z)(c,2),p=d[0],v=d[1];return(0,f.useEffect)((function(){v(n)}),[n]),(0,f.useEffect)((function(){var e=setTimeout((function(){t(p)}),i);return function(){return clearTimeout(e)}}),[p]),(0,Fe.jsx)("input",(0,l.Z)((0,l.Z)({},s),{},{className:(0,ze.cx)(Fo(a)),value:o().sanitize(String(p)),onChange:function(e){return v(e.target.value)}}))},Ho=t(55748),Po=t(22628),qo=t(79263),Ao=t(53390),Qo=(0,ze.iv)(jo||(jo=(0,r.Z)(["\n display: flex;\n align-items: center;\n gap: 1px;\n"]))),Wo=(0,ze.iv)(ko||(ko=(0,r.Z)(["\n font-size: 12px;\n"]))),Uo=function(e){return(0,ze.iv)(Co||(Co=(0,r.Z)(["\n border-radius: 3px;\n outline: none;\n border: 1px solid ",";\n background: ",";\n color: ",";\n padding: 3px 8px;\n margin: 2px;\n width: 70px;\n"])),e.buttonBorder,e.inputBg,e.textColor)},Jo=function(e){return(0,ze.iv)(To||(To=(0,r.Z)(["\n color: ",";\n border: 1px solid ",";\n background: ",";\n padding: 3px 8px 2px 8px;\n border-radius: 3px;\n cursor: pointer;\n font-size: 12px;\n"])),e.textColor,e.buttonBorder,e.inputBg)},Go=((0,ze.iv)(_o||(_o=(0,r.Z)(["\n height: 12px;\n width: 12px;\n"]))),function(e){return(0,ze.iv)(Io||(Io=(0,r.Z)(["\n display: flex;\n align-items: center;\n border: 1px solid ",";\n color: ",";\n background: ",";\n cursor: pointer;\n"])),e.buttonBorder,e.textColor,e.buttonDefault)});var Ko=function(e){e.getSelectedRowModel;var n=e.hasNextPage,t=e.hasPreviousPage,r=e.nextPage,i=e.pageCount,a=e.pageIndex,l=e.pageSize,s=e.previousPage,u=(e.refreshData,e.rerender,e.rowSelection,e.setPageIndex),c=e.setPageSize,d=e.totalRows,f=(0,hr.Fg)();return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center",flex:1,width:"100%",color:f.textColor,margin:"5px"},children:[(0,Fe.jsx)("button",{className:(0,ze.cx)(Go(f)),onClick:function(){return u(0)},disabled:!t,children:(0,Fe.jsx)(Po.Z,{style:{height:"12px",width:"12px"}})}),(0,Fe.jsx)("button",{className:(0,ze.cx)(Go(f)),onClick:function(){return s()},disabled:!t,children:(0,Fe.jsx)(Ao.Z,{style:{height:"12px",width:"12px"}})}),(0,Fe.jsx)("button",{className:(0,ze.cx)(Go(f)),onClick:function(){return r()},disabled:!n,children:(0,Fe.jsx)(qo.Z,{style:{height:"12px",width:"12px"}})}),(0,Fe.jsx)("button",{className:(0,ze.cx)(Go(f)),onClick:function(){return u(i-1)},disabled:!n,children:(0,Fe.jsx)(Ho.Z,{style:{height:"12px",width:"12px"}})}),(0,Fe.jsx)("span",{className:(0,ze.cx)(Qo,Wo),children:(0,Fe.jsxs)("div",{children:["Page"," ",(0,Fe.jsxs)("strong",{children:[a+1," of ",i]})]})}),(0,Fe.jsxs)("span",{className:(0,ze.cx)(Qo,Wo),children:["- Go to page:",(0,Fe.jsx)("input",{type:"number",defaultValue:a+1,onChange:function(e){var n=e.target.value?Number(e.target.value)-1:0;u(n)},className:(0,ze.cx)(Uo(f))})]}),(0,Fe.jsx)("select",{className:(0,ze.cx)(Jo(f)),value:o().sanitize(String(l)),onChange:function(e){c(Number(e.target.value))},children:[10,20,30,40,50].map((function(e){return(0,Fe.jsxs)("option",{value:o().sanitize(String(e)),children:["Show ",e," Rows"]},e)}))}),(0,Fe.jsxs)("div",{style:{fontSize:"12px",marginLeft:"6px"},children:[" ","Total: ",d," Rows"]})]}),(0,Fe.jsx)("div",{className:"flex items-center gap-2"})]})},Yo=function(e){var n,t,r,i,a=e.columnFilterValue,o=e.getFacetedMinMaxValues,l=e.setFilterValue,s=(0,hr.Fg)(),u=null===(n=o())||void 0===n?void 0:n[0],c=Number(null!==u&&void 0!==u?u:""),d=null===(t=o())||void 0===t?void 0:t[1],f=Number(d);return(0,Fe.jsxs)("div",{children:[(0,Fe.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center",justifyContent:"center"},children:[(0,Fe.jsx)(Bo,{theme:s,type:"number",min:c,max:f,value:null!==(r=null===a||void 0===a?void 0:a[0])&&void 0!==r?r:"",onChange:function(e){return l((function(n){return[e,null===n||void 0===n?void 0:n[1]]}))},placeholder:"Min ".concat(u?"(".concat(c,")"):""),className:"w-24 border shadow rounded"}),(0,Fe.jsx)(Bo,{theme:s,type:"number",min:c,max:f,value:null!==(i=null===a||void 0===a?void 0:a[1])&&void 0!==i?i:"",onChange:function(e){return l((function(n){return[null===n||void 0===n?void 0:n[0],e]}))},placeholder:"Max ".concat(d?"(".concat(f,")"):""),className:"w-24 border shadow rounded"})]}),(0,Fe.jsx)("div",{className:"h-1"})]})},Xo=function(e){var n=e.columnId,t=e.columnFilterValue,r=e.columnSize,i=e.setFilterValue,a=e.sortedUniqueValues,l=n+"list",s=(0,hr.Fg)();return(0,Fe.jsxs)(f.Fragment,{children:[(0,Fe.jsx)("datalist",{id:l,children:a.slice(0,5e3).map((function(e){return(0,Fe.jsx)("option",{value:o().sanitize(e)},e)}))}),(0,Fe.jsx)(Bo,{theme:s,type:"text",value:o().sanitize(null!==t&&void 0!==t?t:""),onChange:function(e){return i(e)},placeholder:"Search... (".concat(r,")"),className:"w-36 border shadow rounded",list:l}),(0,Fe.jsx)("div",{className:"h-1"})]})};var $o,el,nl=function(e){var n,t=e.column,r=null===(n=e.table.getPreFilteredRowModel().flatRows[0])||void 0===n?void 0:n.getValue(t.id),i=t.getFilterValue(),a=t.getFacetedUniqueValues(),l=(0,f.useMemo)((function(){return"number"===typeof r?[]:Array.from(a.keys()).sort()}),[a]);return"number"===typeof r?(0,Fe.jsx)(Yo,{columnFilterValue:i,getFacetedMinMaxValues:t.getFacetedMinMaxValues,setFilterValue:t.setFilterValue}):(0,Fe.jsx)(Xo,{columnId:t.id,columnFilterValue:o().sanitize(i),columnSize:a.size,setFilterValue:t.setFilterValue,sortedUniqueValues:l})},tl=t(74612),rl=t(32882),il=(0,ze.iv)($o||($o=(0,r.Z)(["\n position: relative;\n &.resizer {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n width: 5px;\n cursor: col-resize;\n user-select: none;\n touch-action: none;\n &.isResizing {\n background: blue;\n opacity: 1;\n }\n }\n"]))),al=function(e,n){return(0,ze.iv)(el||(el=(0,r.Z)(["\n height: 14px !important;\n width: 14px !important;\n color: "," !important;\n cursor: pointer;\n border: 1px solid ",";\n border-radius: 3px;\n padding: 2px;\n"])),e,n)};function ol(e,n){return"left"===n?e.getLeftVisibleCells():"right"===n?e.getRightVisibleCells():"center"===n?e.getCenterVisibleCells():e.getVisibleCells()}var ll,sl=function(e){var n=e.table,t=e.tableGroup,r=(e.columnResizeMode,(0,hr.Fg)()),i=function(e,n){return"left"===n?[e.getLeftHeaderGroups(),e.getLeftFooterGroups()]:"right"===n?[e.getRightHeaderGroups(),e.getRightFooterGroups()]:"center"===n?[e.getCenterHeaderGroups(),e.getCenterFooterGroups()]:[e.getHeaderGroups(),e.getFooterGroups()]}(n,t),a=(0,u.Z)(i,1)[0];return(0,Fe.jsx)(I.a,{theme:r,children:(0,Fe.jsxs)("table",{style:{width:"100%"},children:[(0,Fe.jsx)("thead",{children:a.map((function(e){return(0,Fe.jsx)("tr",{children:e.headers.map((function(e){var t;return(0,Fe.jsxs)("th",{className:(0,ze.cx)(il),key:e.id,colSpan:e.colSpan,style:{width:e.getSize()},children:[" ",(0,Fe.jsxs)("div",{style:{display:"flex",gap:"6px",alignItems:"center",fontSize:"13px"},children:[e.isPlaceholder?null:(0,No.ie)(e.column.columnDef.header,e.getContext()),(0,Fe.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")}),(0,Fe.jsxs)("div",{style:{fontSize:"12px",display:"flex",alignItems:"center",gap:"6px"},children:[e.column.getCanFilter()?(0,Fe.jsx)("div",{children:(0,Fe.jsx)(nl,{column:e.column,table:n})}):null,(0,Fe.jsx)("button",{onClick:e.column.getToggleSortingHandler(),style:{border:"none",background:"none",display:"flex",alignItems:"center"},title:"Sort",className:e.column.getCanSort()?"cursor-pointer select-none":"",children:null!==(t={asc:(0,Fe.jsx)(rl.Z,{className:(0,ze.cx)(al(r.textColor,r.buttonBorder))}),desc:(0,Fe.jsx)(yt.Z,{className:(0,ze.cx)(al(r.textColor,r.buttonBorder))})}[e.column.getIsSorted()])&&void 0!==t?t:(0,Fe.jsx)(tl.Z,{className:(0,ze.cx)(al(r.textColor,r.buttonBorder))})})]})]})]})}))},e.id)}))}),(0,Fe.jsx)("tbody",{children:n.getRowModel().rows.map((function(e){return(0,Fe.jsx)("tr",{children:ol(e,t).map((function(e){return(0,Fe.jsx)("td",{style:{width:e.column.getSize(),fontSize:"12px"},children:(0,No.ie)(e.column.columnDef.cell,e.getContext())},e.id)}))},e.id)}))})]})})};var ul,cl=jt.Z.div(ll||(ll=(0,r.Z)(["\n padding: 5px;\n\n table {\n border-spacing: 0;\n border: 1px solid ",";\n border-radius: 4px;\n border-bottom: none;\n border-top: none;\n color: ",";\n\n tr {\n :last-child {\n td {\n border-bottom: none;\n }\n }\n }\n\n th,\n td {\n margin: 0;\n padding: 0.45rem;\n border-bottom: 1px solid ",";\n border-right: 1px solid ",";\n :last-child {\n border-right: 0;\n }\n }\n\n td {\n input {\n font-size: 12px;\n padding: 0;\n margin: 0;\n border: 0;\n }\n }\n }\n\n .pagination {\n padding: 0.5rem;\n }\n"])),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonBorder}));function dl(e){var n,t=(0,f.useReducer)((function(){return{}}),{})[1],r=e.columns,i=e.data,a=(0,hr.Fg)(),l=(0,f.useState)(i),s=(0,u.Z)(l,2),c=s[0],d=s[1],p=(0,f.useState)({}),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,f.useState)([]),x=(0,u.Z)(m,2),b=x[0],y=x[1],Z=(0,f.useState)({}),w=(0,u.Z)(Z,2),S=w[0],j=w[1],k=(0,f.useState)([]),C=(0,u.Z)(k,2),T=C[0],_=C[1],D=(0,f.useState)(""),N=(0,u.Z)(D,2),M=N[0],E=N[1],R=function(){var e=(0,f.useRef)(!0),n=e.current,t=(0,f.useCallback)((function(){e.current=!1}),[]);return(0,f.useEffect)((function(){e.current=!0})),(0,f.useMemo)((function(){return[Boolean(n),t]}),[n,t])}(),O=(0,u.Z)(R,2),L=O[0],V=O[1],z=(0,f.useState)("onChange"),F=(0,u.Z)(z,1)[0],B=(0,No.b7)({data:c,columns:r,defaultColumn:Oo,getCoreRowModel:(0,Mo.sC)(),getFilteredRowModel:(0,Mo.vL)(),getPaginationRowModel:(0,Mo.G_)(),getSortedRowModel:(0,Mo.tj)(),getGroupedRowModel:(0,Mo.qe)(),getFacetedRowModel:(0,Mo.o6)(),getFacetedUniqueValues:(0,Mo.JG)(),getFacetedMinMaxValues:(0,Mo.HO)(),onColumnFiltersChange:_,onGlobalFilterChange:E,globalFilterFn:Ro,autoResetPageIndex:L,enableColumnResizing:!0,columnResizeMode:F,onColumnVisibilityChange:g,onGroupingChange:y,onRowSelectionChange:j,meta:Lo(d,V),state:{grouping:b,columnFilters:T,globalFilter:M,columnVisibility:h}});return(0,f.useEffect)((function(){var e,n;"fullName"===(null===(e=B.getState().columnFilters[0])||void 0===e?void 0:e.id)&&("fullName"!==(null===(n=B.getState().sorting[0])||void 0===n?void 0:n.id)&&B.setSorting([{id:"fullName",desc:!1}]))}),[null===(n=B.getState().columnFilters[0])||void 0===n?void 0:n.id]),(0,Fe.jsx)(I.a,{theme:a,children:(0,Fe.jsxs)(cl,{theme:a,children:[(0,Fe.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",margin:"4px",marginLeft:0},children:[(0,Fe.jsx)("div",{style:{display:"flex",fontSize:"14px",gap:"6px",margin:"4px",marginLeft:0},children:B.getAllLeafColumns().map((function(e){return(0,Fe.jsx)("div",{children:(0,Fe.jsxs)("label",{style:{display:"flex",alignItems:"center",color:a.textColor},children:[(0,Fe.jsx)("input",{type:"checkbox",checked:e.getIsVisible(),onChange:e.getToggleVisibilityHandler(),className:"mr-1"}),e.id]})},e.id)}))}),(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"14px",margin:"4px",color:a.textColor},children:["Search:",(0,Fe.jsx)(Bo,{theme:a,style:{fontSize:"12px",padding:"3px 8px"},value:o().sanitize(null!==M&&void 0!==M?M:""),onChange:function(e){return E(String(e))},placeholder:"Search all columns..."})]})]}),(0,Fe.jsx)("div",{style:{display:"flex"},children:(0,Fe.jsx)(sl,{columnResizeMode:F,table:B,tableGroup:"center"})}),(0,Fe.jsx)("div",{style:{display:"flex"},children:(0,Fe.jsx)(Ko,{getSelectedRowModel:B.getSelectedRowModel,hasNextPage:B.getCanNextPage(),hasPreviousPage:B.getCanPreviousPage(),nextPage:B.nextPage,pageCount:B.getPageCount(),pageIndex:B.getState().pagination.pageIndex,pageSize:B.getState().pagination.pageSize,previousPage:B.previousPage,refreshData:function(){return d(i)},rerender:t,rowSelection:S,setPageIndex:B.setPageIndex,setPageSize:B.setPageSize,totalRows:B.getPrePaginationRowModel().rows.length})})]})})}var fl=jt.Z.div(ul||(ul=(0,r.Z)(["\n display: block;\n overflow: auto;\n &::-webkit-scrollbar {\n width: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n .table {\n border-spacing: 0;\n border-radius: 4px;\n font-size: 12px;\n color: ",";\n &::-webkit-scrollbar {\n width: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n .tr {\n display: block;\n :last-child {\n .td {\n border-bottom: 0;\n }\n }\n }\n .th {\n background: ",";\n border-bottom: none;\n padding: 3px;\n :last-child {\n box-sizing: unset !important;\n }\n }\n .th,\n .td {\n display: block;\n flex: 1;\n margin: 0;\n justify-content: space-between;\n border-bottom: 1px solid\n ",";\n border-right: 1px solid\n ",";\n padding: 3px;\n position: relative;\n white-space: nowrap;\n overflow: hidden;\n .show-add-labels {\n display: none;\n }\n &:hover {\n .show-add-labels {\n display: flex;\n align-items: center;\n }\n }\n\n :last-child {\n border-right: 0;\n padding-right: 0px;\n }\n\n .resizer {\n display: inline-block;\n background: ",";\n width: 5px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n transform: translateX(50%);\n z-index: 1;\n // touch-action:none;\n &.isResizing {\n background: red;\n }\n }\n }\n }\n\n .pagination {\n // padding: 0.5rem;\n }\n"])),(function(e){return e.theme.scrollbarThumb}),(function(e){return e.theme.textColor}),(function(e){return e.theme.scrollbarThumb}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonBorder})),pl=function(e){var n=e.data,t=n.columnsData,r=n.dataRows,i=e.actualQuery,a=e.height,o=e.size,l=e.width,s=(0,f.useMemo)((function(){return t}),[t]),u=(0,f.useMemo)((function(){return r}),[r]);return(0,Fe.jsx)(fl,{children:t&&r&&(0,Fe.jsx)(dl,{actQuery:i,columns:s,width:l,data:u,height:a,size:o})})},vl=t(10580),hl=t.n(vl);function gl(e){var n=e.id;try{return JSON.parse(localStorage.getItem("tabsState")||"{[".concat(n,"]:0}"))}catch(t){return(0,B.Z)({},n,0)}}var ml=t(76666),xl=t.n(ml),bl=window;bl.$=xl(),bl.jQuery=xl();t(70764),t(23187),t(16850),t(59682),t(48815),t(22073);var yl="".concat("qryn_view","_chart_type"),Zl=function(){return{xaxis:{show:!0,mode:"time",timezone:"local",timeformat:"%Y-%m-%d %H:%M:%S",reserveSpace:!1,shadowSize:0},yaxis:{tickFormatter:Vl},grid:{show:!0,aboveData:!1,color:"#999",clickable:!0,hoverable:!0,autoHighlight:!1,highlightColor:"blue",mouseActiveRadius:30,borderWidth:0,minBorderMargin:0,labelMarginX:0,labelMarginY:0,shadowSize:0,margin:{left:5,right:5}},legend:{noColumns:0,position:"nw",show:!1},interaction:{redrawOverlayInterval:1},series:{stack:arguments.length>0&&void 0!==arguments[0]&&arguments[0],lines:{show:!0,lineWidth:1.5,shadowSize:0,zero:!1},bars:{align:"center",show:!1,barWidth:5e3,shadowSize:0,zero:!1},points:{show:!0,radius:1,shadowSize:0,zero:!1}},markings:{clickable:!1},crosshair:{color:"#88888855",mode:"xy",linewidth:1},selection:{mode:"x"}}},wl=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{stack:n,lines:{show:!1,lineWidth:1.5,shadowSize:0,fill:n},bars:{show:!0,barWidth:0!==e?e:5e3,shadowSize:0},points:{show:!0,radius:.25,shadowSize:0}}},Sl=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{stack:e,lines:{show:!0,lineWidth:1,shadowSize:0,stack:e,fill:e},bars:{show:!1,barWidth:0,shadowSize:0},points:{show:!1,radius:1,shadowSize:0}}},jl=function(){return{stack:arguments.length>0&&void 0!==arguments[0]&&arguments[0],lines:{show:!1,lineWidth:1.5,shadowSize:0},bars:{show:!1,barWidth:0,shadowSize:0},points:{show:!0,radius:2,shadowSize:0}}};var kl=function(e){return 2===(null===e||void 0===e?void 0:e.length)?e[1]:e[1]-e[2]};function Cl(e){return(null===e||void 0===e?void 0:e.length)>0&&(null===e||void 0===e?void 0:e.filter((function(e){return parseFloat(e.value)===parseFloat(kl(e.item.datapoint))})))||[]}function Tl(e){var n,t=Cl(e);return(null===(n=t)||void 0===n?void 0:n.map((function(e){return o().sanitize('
\n
\n \n

').concat(e.label,"

\n
\n
\n
\n
\n "))})).join(""))||[]}function _l(e){var n=e.map((function(e){var n;return null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.map((function(e){var n=(0,u.Z)(e,2),t=n[0];n[1];return t}))})).flat().sort(),t=n[0],r=n[n.length-1],i=r-t;return{first:t,last:r,timeSpan:i/1e3/107e3,length:n.length,timeDiff:i,seriesLength:e.length}}var Il=function(e,n){var t=e.length,r=e.timeDiff,i=e.seriesLength;return Math.round(r/n/t*(1===i?.5:i-1)*1e3)};function Dl(e){var n=_l(e),t=n.timeSpan;return{timeformat:t>1?"%m/%d %H:%M":t>30?"%y/%m/%d %H:%M":"%H:%M:%S",min:n.first,max:n.last}}function Nl(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"bar":return wl(n,t);case"line":default:return Sl(t);case"points":return jl(t)}}function Ml(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,a=(0,l.Z)({},e);return 0===(null===(n=Object.keys(e))||void 0===n?void 0:n.length)&&(a={level:"unknown"},1===i&&r&&(a={level:"logs"})),r&&a?null===(t=Object.entries(a))||void 0===t?void 0:t.map((function(e){var n=(0,u.Z)(e,2);n[0];return n[1]})):!r&&a?"{ "+Object.entries(a).map((function(e){var n=(0,u.Z)(e,2),t=n[0],r=n[1];return"".concat(t,'="').concat(r,'"')})).join(", ")+" }":""}function El(){var e=[];try{var n=localStorage.getItem("labelsSelected");return"string"===typeof n&&(e=JSON.parse(n)),e}catch(t){return console.log(t),e}}function Rl(e){var n=e.label.id,t=El();return(null===t||void 0===t?void 0:t.length)>0&&t.some((function(e){return e.id===n}))}function Ol(e,n){var t,r=El();if(r.length>0){var i=null===(t=r)||void 0===t?void 0:t.map((function(e){return e.id})),a=null===e||void 0===e?void 0:e.map((function(e){return null!==i&&void 0!==i&&i.includes(e.id)?function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Nl(n,0,t),i=r.lines,a=r.bars,o=r.points;return(0,l.Z)((0,l.Z)({},e),{},{stack:t,bars:a,lines:i,points:o,isVisible:!0})}(e,n):function(e){return(0,l.Z)((0,l.Z)({},e),{},{lines:(0,l.Z)((0,l.Z)({},e.lines),{},{show:!1}),bars:(0,l.Z)((0,l.Z)({},e.bars),{},{show:!1}),points:(0,l.Z)((0,l.Z)({},e.points),{},{show:!1}),isVisible:!1})}(e)}));return a}return e}function Ll(e,n){var t=0;return"M"===n&&(t=1e6),"K"===n&&(t=1e3),e%t===0?0:1}function Vl(e,n){return e>999999?(e/1e6).toFixed(Ll(e,"M"))+" M":e>999?(e/1e3).toFixed(Ll(e,"K"))+" K":e.toFixed(n.tickDecimals)}var zl=window.jQuery;function Fl(e){var n=null;zl("#tooltip").remove(),n=null,zl(this).on("plothover",(function(t,r,i){e.unhighlight(),i?function(){for(var t=e.getData(),r=(0,u.Z)(i.datapoint,2),a=r[0],l=(r[1],JSON.parse(localStorage.getItem("labelsSelected")||"null")),s=function(e){return 2===(null===e||void 0===e?void 0:e.length)?e[1]:e[1]-e[2]},c=parseFloat(i.datapoint[1])%1?parseFloat(s(i.datapoint)).toFixed(3):s(i.datapoint),f=l.length>0,p=[],v=0;v\n

',d()(i.datapoint[0]).format("YYYY-MM-DDTHH:mm:ss.SSSZ"),'

\n \n

\n Value: ').concat(c,'

\n \n
\n ').concat(w,"\n
"));zl("#tooltip").remove();var j=S;if((null===p||void 0===p?void 0:p.length)>0){var k=function(e){var n=Cl(e);if((null===n||void 0===n?void 0:n.length)>0){var t,r,i=null===n||void 0===n?void 0:n.sort((function(e,n){return e.label.length>n.label.length?0:1}));return i&&i.length>0?null===(t=i[0])||void 0===t||null===(r=t.label)||void 0===r?void 0:r.length:0}return 0}(p);!function(e,n,t,r){var i,a=window.innerWidth/2,l=window.event.clientX;i=l,l>a&&(i-=r<125?6*r+15:505);zl(o().sanitize('
'.concat(t,"
"))).css({position:"absolute",display:"none",top:n,left:i,padding:"6px","font-size":"12px","flex-direction":"column","max-width":"500px","border-radius":"6px 6px 6px 6px","background-color":"#333",color:"#aaa"}).appendTo("body").fadeIn(125)}(i.pageX,i.pageY,j,k)}}}():(zl("#tooltip").remove(),n=null)}))}var Bl,Hl,Pl,ql,Al,Ql,Wl,Ul={critical:"purple",error:"red",warning:"orange",info:"green",debug:"blue",trace:"lightblue",unknown:"gray"},Jl=function(e,n,t){return(0,f.useMemo)((function(){var r,i,a=[{data:[],label:[],isVisible:!0,shadowSize:0,id:""}];return(null===n||void 0===n?void 0:n.length)>0?(a=null===(r=(0,H.Z)(n))||void 0===r?void 0:r.map((function(e){var r,i,a={data:(r=null===e||void 0===e?void 0:e.values,(null===r||void 0===r?void 0:r.map((function(e){var n=(0,u.Z)(e,2);return[1e3*n[0],n[1]]})))||[]),label:Ml(null===e||void 0===e?void 0:e.metric,t,n.length),isVisible:!0,shadowSize:0,id:e.id};if(t){var o=(i=Ml(null===e||void 0===e?void 0:e.metric,t,n.length)||"",Ul[i[0]]||"gray");a.color=o}return a})),e?null===(i=a)||void 0===i?void 0:i.splice(0,20):a):a}),[e,n])},Gl=function(e){var n=e.tWidth,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,f.useMemo)((function(){if(n){var e=(0,l.Z)({},Zl(t));return e.xaxis.ticks=Math.round(n/125),e}return Zl}),[n])},Kl=function(e){return(0,f.useMemo)((function(){return Ve.n[e]}),[e])};function Yl(){return(0,f.useMemo)((function(){return function(){try{var e=localStorage.getItem("labelsSelected");if("string"===typeof e)return JSON.parse(e)}catch(n){return console.log(n),[]}}()}),[])}var Xl=jt.Z.div(Bl||(Bl=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n max-height: 60px;\n overflow-y: auto;\n margin: 5px;\n &::-webkit-scrollbar {\n width: 5px;\n height: 5px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: ",";\n }\n"])),(function(e){return e.theme.scrollbarThumb})),$l=jt.Z.div(Hl||(Hl=(0,r.Z)(["\n font-size: 12px;\n color: ",";\n font-family: sans-serif;\n display: flex;\n align-items: center;\n line-height: 1.5;\n padding-right: 10px;\n cursor: pointer;\n opacity: ",";\n border-radius: 3px;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.isVisible?"1":".5"}),(function(e){return e.theme.buttonHover})),es=jt.Z.div(Pl||(Pl=(0,r.Z)(["\n height: 4px;\n width: 16px;\n margin-right: 8px;\n background: ",';\n content: " ";\n'])),(function(e){return e.color})),ns=jt.Z.button(ql||(ql=(0,r.Z)(["\n background: ",";\n color: ",";\n padding: 3px 12px;\n border: 1px solid ",";\n border-radius: ",";\n cursor: pointer;\n font-size: 12px;\n line-height: 20px;\n white-space: nowrap;\n flex: 1;\n"])),(function(e){return e.isActive?e.theme.buttonDefault:e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}),(function(e){return e.rightBtn?"0px 3px 3px 0px":e.leftBtn?"3px 0px 0px 3px":"none"})),ts=jt.Z.div(Al||(Al=(0,r.Z)(["\n display: flex;\n align-items: center;\n flex-direction: ",";\n\n margin: 10px 25px;\n justify-content: space-between;\n .limit-cont {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex: 1;\n margin-bottom: ",";\n width: ",";\n div {\n flex: ",";\n text-align: ",";\n }\n }\n .chart-buttons-cont {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: ",";\n width: ",";\n }\n"])),(function(e){return e.isMobile?"column":"row"}),(function(e){return e.isMobile?"10px":"0px"}),(function(e){return e.isMobile?"100%":"auto"}),(function(e){return e.isMobile?"1":"0"}),(function(e){return e.isMobile?"center":"left"}),(function(e){return e.isMobile?"1":"0"}),(function(e){return e.isMobile?"100%":"auto"})),rs=jt.Z.div(Ql||(Ql=(0,r.Z)(["\n font-size: 12px;\n line-height: 20px;\n padding: 3px 12px;\n white-space: nowrap;\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n cursor: pointer;\n transition: 0.2s all;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover})),is=jt.Z.div(Wl||(Wl=(0,r.Z)(["\n height: inherit;\n display: flex;\n flex-direction: column;\n flex: 1;\n background: ",";\n .chart-cont {\n flex: 1;\n }\n"])),(function(e){return e.theme.chartBg}));function as(e){var n=e.onLabelClick,t=e.labels,r=Yl(),i=(0,f.useMemo)((function(){return(null===r||void 0===r?void 0:r.length)>0}),[r]);function a(e){var n=e.id;return null===r||void 0===r?void 0:r.some((function(e){return e.id===n}))}return(0,Fe.jsx)(Xl,{children:(null===t||void 0===t?void 0:t.length)&&(null===t||void 0===t?void 0:t.map((function(e,r){return(0,Fe.jsxs)($l,{isVisible:!i||a(e),onClick:function(){return function(e){e.isVisible=!e.isVisible,n(t,e)}(e)},children:[(0,Fe.jsx)(es,{color:e.color}),e.label]},r)})))})}function os(e){var n=e.isSpliced,t=e.handleNoLimitData,r=e.handleLimitData,i=e.matrixData;return n?(0,Fe.jsxs)(rs,{onClick:t,children:[i.length>20?"Showing: 20 Series, Show All ":"Showing: ",i.length," Series"]}):(0,Fe.jsxs)(rs,{onClick:r,children:["Showing: ",i.length," Series, Show Only 20 Series"]})}function ls(e){var n=e.matrixData,t=e.chartType,r=e.handleNoLimitData,i=e.handleLimitData,a=e.isSpliced,o=e.onSetChartType,l=(0,hr.Fg)(),s=(0,_.useMediaQuery)({query:"(max-width: 565px)"});return(0,Fe.jsx)(I.a,{theme:l,children:(0,Fe.jsxs)(ts,{isMobile:s,children:[(0,Fe.jsx)("div",{className:"limit-cont",children:(0,Fe.jsx)(os,{isSpliced:a,handleNoLimitData:r,handleLimitData:i,matrixData:n})}),(0,Fe.jsxs)("div",{className:"chart-buttons-cont",children:[(0,Fe.jsx)(ns,{isActive:"bar"===t,onClick:function(){o("bar")},leftBtn:!0,children:"bar chart"}),(0,Fe.jsx)(ns,{onClick:function(){o("line")},isActive:"line"===t,children:"line chart"}),(0,Fe.jsx)(ns,{onClick:function(){o("points")},isActive:"points"===t,rightBtn:!0,children:"points chart"})]})]})})}function ss(e){var n=e.theme,t=e.matrixData,r=e.chartType,i=e.handleLimitData,a=e.handleNoLimitData,o=e.isSpliced,l=e.onSetChartType,s=e.chartRef,u=e.onLabelClick,c=e.labels,d=e.isLogsVolume;return(0,Fe.jsx)(I.a,{theme:n,children:(0,Fe.jsxs)(is,{children:[d?(0,Fe.jsx)("div",{style:{display:"flex",justifyContent:"center",fontSize:"12px",color:n.textColor},children:"Logs Volume"}):(0,Fe.jsx)(ls,{matrixData:t,chartType:r,handleNoLimitData:a,handleLimitData:i,isSpliced:o,onSetChartType:l}),(0,Fe.jsx)("div",{className:"chart-cont",children:(0,Fe.jsx)("div",{ref:s,id:"chart-container",style:{flex:"1",minHeight:"97px",height:"100%",display:"block",position:"relative",paddingTop:"10px"}})}),(0,Fe.jsx)(as,{onLabelClick:u,labels:c})]})})}function us(e){var n=e.matrixData,t=e.actualQuery,r=e.type,a=e.tWidth,o=t.expr,s=t.dataSourceType,d=t.queryType,p=t.limit,h=t.panel,g=t.id,m=t.isLogsVolume,x=(0,f.useRef)(null),b=(0,i.v9)((function(e){return e.theme})),y=Kl(b),Z=window.jQuery;Z.fn.UseTooltip=Fl;var w=Jl(!0,n,m&&"stream"===r),S=(0,i.I0)(),j=(0,f.useState)(!0),k=(0,u.Z)(j,2),C=k[0],T=k[1],_=(0,f.useState)(w),I=(0,u.Z)(_,2),D=I[0],N=I[1],M=(0,f.useState)(Jl(!1,n,m&&"stream"===r)),E=(0,u.Z)(M,1)[0],R=(0,f.useState)([]),O=(0,u.Z)(R,2),L=O[0],V=O[1],z=(0,f.useState)(x.current),F=(0,u.Z)(z,2),B=F[0],H=F[1],P=Gl({tWidth:a},m&&"stream"===r||!1),q=(0,f.useState)(P),A=(0,u.Z)(q,2),Q=A[0],W=A[1],U=(0,f.useMemo)((function(){var e=localStorage.getItem(yl);return m&&"stream"===r?"bar":""!==e?e:"line"}),[m]),J=(0,f.useState)(U),G=(0,u.Z)(J,2),K=G[0],Y=G[1];function X(e,n,t){var r=0;m&&"stream"===n&&(r=Il(_l(e),a));var i=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"bar":return{series:wl(n,t)};case"line":default:return{series:Sl(t)};case"points":return{series:jl(t)}}}(n,r),o=Dl(e),s=o.timeformat,u=o.min,c=o.max;return Z.plot(t,e,Z.extend(!0,{},Q,(0,l.Z)((0,l.Z)({},i),{},{xaxis:{timeformat:s,min:u,max:c}})))}function $(e){var n=Z(x.current),t=C?D:E,r=Ol(t,e);try{var i=X(r,e,n),a=i.getData();V(a),Z(x.current).UseTooltip(i),Y(e),function(e){localStorage.setItem(yl,e)}(e)}catch(o){console.log(t,o)}}function ee(e,n){var t=Z(x.current),i=C?D:E;e.preventDefault();var u=[],f=JSON.parse(localStorage.getItem("labelsSelected")||"null")||[];if((null===f||void 0===f?void 0:f.length)>0){var b=0;m&&"stream"===r&&(b=Il(_l(i),a));var y=Nl(K,b,m&&"stream"===r),w=y.lines,j=y.bars,k=y.points,T=null===f||void 0===f?void 0:f.map((function(e){return e.id}));u=null===i||void 0===i?void 0:i.map((function(e){return T.includes(e.id)?(0,l.Z)((0,l.Z)({},e),{},{stack:m&&"stream"===r,bars:j,lines:w,points:k,isVisible:!0,shadowSize:0}):(0,l.Z)((0,l.Z)({},e),{},{lines:(0,l.Z)((0,l.Z)({},e.lines),{},{show:!1}),bars:(0,l.Z)((0,l.Z)({},e.bars),{},{show:!1}),points:(0,l.Z)((0,l.Z)({},e.points),{},{show:!1}),isVisible:!1,shadowSize:0})}))}else u=i;try{var _=Z.plot(t,u,Z.extend(!0,{},Q,{xaxis:{min:n.xaxis.from-1e5,max:n.xaxis.to+1e5,timeformat:Dl(u).timeformat}}));Z(x.current).UseTooltip(_),setTimeout((function(){var e=n.xaxis.from,t=n.xaxis.to,r=new Date(c(parseInt(e)).format("YYYY-MM-DDTHH:mm:ss.SSSZ")),i=new Date(c(parseInt(t)).format("YYYY-MM-DDTHH:mm:ss.SSSZ")),a=(0,st.Z)(r,"yyyy/MM/dd HH:mm:ss"),l=(0,st.Z)(i,"yyyy/MM/dd HH:mm:ss"),u="".concat(a,"-").concat(l);S((0,v.wW)(i)),S((0,v.qv)(r)),S((0,v.Xn)(u)),S(Tn(s,o,d,p,h,g))}),400)}catch(I){console.log("error on chart redraw",I)}}(0,f.useEffect)((function(){H(x.current),V(null===D||void 0===D?void 0:D.map((function(e){return e.label}))),Z(x.current).bind("plotselected",ee),N(w),localStorage.setItem("labelsSelected",JSON.stringify([]))}),[]),(0,f.useEffect)((function(){W(Q),H(x.current),function(){var e=C?D:E,n=Z(x.current),t=Ol(e,null);try{var i=0;m&&"stream"===r&&(i=Il(_l(t),a));var o=Dl(t),l=o.timeformat,s=o.min,u=o.max,c=Nl(K,i,m&&"stream"===r),d=c.bars,f=c.lines,p=c.points,v=c.stack,h=Z.plot(n,t,Z.extend(!0,{},Q,{series:{stack:v,bars:d,lines:f,points:p},xaxis:{timeformat:l,min:s,max:u}})),g=h.getData();V(g),Z(x.current).UseTooltip(h)}catch(b){console.log(b)}}()}),[n,C]);if(n){var ne={height:e.vHeight,theme:y,matrixData:n,chartType:K,handleLimitData:function(e){T(!0)},handleNoLimitData:function(e){T(!1)},isSpliced:C,onSetChartType:$,chartRef:x,onLabelClick:function(e,n){var t=[],i=JSON.parse(localStorage.getItem("labelsSelected")||"null")||[];if(i.some((function(e){return e.id===n.id}))){var o=i.filter((function(e){return e.id!==n.id}));localStorage.setItem("labelsSelected",JSON.stringify(o)),t=o}else t=i.concat(n),localStorage.setItem("labelsSelected",JSON.stringify(t));if(t.length>0){var s,u=null===(s=t)||void 0===s?void 0:s.map((function(e){return e.id})),c=Nl(K,0),d=c.lines,f=c.bars,p=c.points,v=null===e||void 0===e?void 0:e.map((function(e){return u.includes(e.id)?(0,l.Z)((0,l.Z)({},e),{},{stack:m&&"stream"===r,bars:f,lines:d,points:p}):(0,l.Z)((0,l.Z)({},e),{},{lines:(0,l.Z)((0,l.Z)({},e.lines),{},{show:!1}),bars:(0,l.Z)((0,l.Z)({},e.bars),{},{show:!1}),points:(0,l.Z)((0,l.Z)({},e.points),{},{show:!1})})})),h=Dl(v),g=h.timeformat,b=h.min,y=h.max,w=0;m&&"stream"===r&&(w=Il(_l(v),a));var S=Z.plot(B,v,Z.extend(!0,{},Q,{series:Nl(K,w),xaxis:{timeformat:g,min:b,max:y}})),j=S.getData();V(j),Z(x.current).UseTooltip(S)}else{var k=C?D:E,T=0;m&&"stream"===r&&(T=Il(_l(k),a));var _=Nl(K,T),I=_.lines,N=_.bars,M=_.points,R=null===k||void 0===k?void 0:k.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{bars:N,lines:I,points:M,isVisible:!0,shadowSize:0})})),O=Dl(R),L=O.timeformat,z=O.min,F=O.max,H=Z.plot(B,R,Z.extend(!0,{},Q,{series:Nl(K,T||0,m&&"stream"===r),xaxis:{timeformat:L,min:z,max:F}})),P=H.getData();V(P),Z(x.current).UseTooltip(H)}},labels:L,isLogsVolume:m&&"stream"===r},te=new Set;return n.forEach((function(e){var n;null===e||void 0===e||null===(n=e.values)||void 0===n||n.forEach((function(e){return te.add(null===e||void 0===e?void 0:e[0])}))})),1===te.size&&"bar"!==K&&$("bar"),(0,Fe.jsx)(ss,(0,l.Z)({},ne))}return null}function cs(e){var n,t=e.viewRef,r=e.panelSize,a=e.viewHeight,o=e.setStreamClose,s=e.setMaxHeight,c=e.setMinimize,d=e.actualQuery,p=e.total,v=e.type,h=e.theight,g=e.viewWidth,m=e.tableData,x=e.streamData,b=e.logsVolumeData,y=d.isLogsVolume,Z=d.limit,w=(0,f.useState)(gl(d)[d.id]||0),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,f.useMemo)((function(){var n;return JSON.parse(JSON.stringify(null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw))||[]}),[null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw]),T=(0,i.v9)((function(e){return e.theme})),_=(0,f.useMemo)((function(){return"light"===T?"rjv-default":"tomorrow"}),[T]);return(0,Fe.jsxs)(Ia,{ref:t,size:r,vheight:a,children:[(0,Fe.jsx)(Za,(0,l.Z)({onClose:o,setMinimize:c,setMaxHeight:s,actualQuery:d,total:p,type:v},e)),y&&(null===b||void 0===b?void 0:b.length)>0&&g>0&&(0,Fe.jsx)("div",{children:(0,Fe.jsx)(us,(0,l.Z)((0,l.Z)({},e),{},{tWidth:g,chartLimit:Z,matrixData:b,actualQuery:d}))}),(0,Fe.jsxs)(ht.Z,{defaultValue:gl(d)[d.id]||0,value:j,onChange:function(e,n){var t=(0,l.Z)((0,l.Z)({},gl(d)),{},(0,B.Z)({},d.id,n));localStorage.setItem("tabsState",JSON.stringify(t)),"number"===typeof n&&k((function(){return n}))},children:[(0,Fe.jsxs)(Na,{panelsize:e.panelSize,children:[(0,Fe.jsx)(Ma,{children:"Logs"}),m&&(0,Fe.jsx)(Ma,{children:"Table"}),(0,Fe.jsx)(Ma,{children:"Raw"})]}),(0,Fe.jsx)(Da,{value:0,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)(Do,(0,l.Z)((0,l.Z)({},e),{},{onClose:o,messages:x,actualQuery:d}))})}),(0,Fe.jsx)(Da,{value:1,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)(pl,(0,l.Z)((0,l.Z)({},e),{},{height:h,data:m,actualQuery:d}))})}),(0,Fe.jsx)(Da,{value:2,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)("div",{style:{padding:"20px"},children:(0,Fe.jsx)(hl(),{theme:_,src:C})})})})]})]})}var ds,fs=function(e){var n,t=e.viewRef,r=e.panelSize,a=e.viewHeight,o=e.setStreamClose,s=e.setMaxHeight,c=e.setMinimize,d=e.actualQuery,p=e.total,v=e.type,h=e.theight,g=e.tableData,m=e.viewWidth,x=e.limit,b=e.streamData,y=(0,i.v9)((function(e){return e.theme})),Z=(0,f.useMemo)((function(){return"light"===y?"rjv-default":"tomorrow"}),[y]),w=(0,f.useState)(gl(d)[d.id]||0),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,f.useMemo)((function(){var n;return JSON.parse(JSON.stringify(null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw))||[]}),[null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw]);return(0,Fe.jsxs)(Ia,{ref:t,size:r,vheight:a,children:[(0,Fe.jsx)(Za,(0,l.Z)({onClose:o,setMinimize:c,setMaxHeight:s,actualQuery:d,total:p,type:v},e)),(0,Fe.jsxs)(ht.Z,{style:{display:"flex",flex:1,flexDirection:"column"},defaultValue:gl(d)[d.id]||0,value:j,onChange:function(e,n){var t=(0,l.Z)((0,l.Z)({},gl(d)),{},(0,B.Z)({},d.id,n));localStorage.setItem("tabsState",JSON.stringify(t)),"number"===typeof n&&k((function(){return n}))},children:[(0,Fe.jsxs)(Na,{panelsize:e.panelSize,children:[(0,Fe.jsx)(Ma,{children:"Chart"}),(0,Fe.jsx)(Ma,{children:"Table"}),(0,Fe.jsx)(Ma,{children:"Raw"})]}),(0,Fe.jsx)(Da,{value:0,children:(0,Fe.jsx)("div",{className:"view-content",style:{height:"100%"},children:(0,Fe.jsx)(us,(0,l.Z)((0,l.Z)({},e),{},{tWidth:m,chartLimit:x,matrixData:b,actualQuery:d}))})}),(0,Fe.jsx)(Da,{value:1,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)(pl,(0,l.Z)((0,l.Z)({},e),{},{height:h,data:g,actualQuery:d}))})}),(0,Fe.jsx)(Da,{value:2,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)("div",{style:{padding:"20px"},children:(0,Fe.jsx)(hl(),{theme:Z,src:C})})})})]})]})},ps=function(e){var n,t=e.viewRef,r=e.panelSize,a=e.viewHeight,s=e.setStreamClose,c=e.setMinimize,d=e.setMaxHeight,p=e.actualQuery,v=e.total,h=e.type,g=e.theight,m=e.streamData,x=e.viewWidth,b=e.limit,y=(0,i.v9)((function(e){return e.theme})),Z=(0,f.useMemo)((function(){return"light"===y?"rjv-default":"tomorrow"}),[y]),w=(0,f.useRef)(null),S=(0,f.useMemo)((function(){var n;return JSON.parse(JSON.stringify(null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw))||[]}),[null===e||void 0===e||null===(n=e.dataView)||void 0===n?void 0:n.raw]),j=(0,f.useState)(gl(p)[p.id]||0),k=(0,u.Z)(j,2),C=k[0],T=k[1];return(0,Fe.jsxs)(Ia,{ref:t,size:r,vheight:a,children:[(0,Fe.jsx)(Za,(0,l.Z)({onClose:s,setMinimize:c,setMaxHeight:d,actualQuery:p,total:v,type:h},e)),(0,Fe.jsxs)(ht.Z,{defaultValue:gl(p)[p.id]||0,value:C,onChange:function(e,n){var t=(0,l.Z)((0,l.Z)({},gl(p)),{},(0,B.Z)({},p.id,n));localStorage.setItem("tabsState",JSON.stringify(t)),"number"===typeof n&&T((function(){return n}))},children:[(0,Fe.jsxs)(Na,{panelsize:e.panelSize,children:[(0,Fe.jsx)(Ma,{children:"Table"}),(0,Fe.jsx)(Ma,{children:"Raw"}),(null===m||void 0===m?void 0:m.chartData)&&(0,Fe.jsx)(Ma,{children:"Chart"})]}),(0,Fe.jsx)(Da,{value:0,children:(0,Fe.jsx)("div",{className:"view-content",ref:w,id:o().sanitize("".concat(null===p||void 0===p?void 0:p.id,"-view")),children:(0,Fe.jsx)(pl,(0,l.Z)((0,l.Z)({},e),{},{height:g,data:m.tableData,actualQuery:p}))})}),(0,Fe.jsx)(Da,{value:1,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)("div",{style:{padding:"20px"},children:(0,Fe.jsx)(hl(),{theme:Z,src:S})})})}),(null===m||void 0===m?void 0:m.chartData)&&(0,Fe.jsx)(Da,{value:2,children:(0,Fe.jsx)("div",{className:"view-content",children:(0,Fe.jsx)(us,(0,l.Z)((0,l.Z)({},e),{},{tWidth:x,chartLimit:b,matrixData:m.chartData,actualQuery:p}))})})]})]})},vs=t(66781),hs=t.n(vs),gs={scrollPageDown:{binding:"s",label:"Scroll down"},scrollPageUp:{binding:"w",label:"Scroll up"},scrollToNextVisibleSpan:{binding:"f",label:"Scroll to the next visible span"},scrollToPrevVisibleSpan:{binding:"b",label:"Scroll to the previous visible span"},panLeft:{binding:["a","left"],label:"Pan left"},panLeftFast:{binding:["shift+a","shift+left"],label:"Pan left \u2014 Large"},panRight:{binding:["d","right"],label:"Pan right"},panRightFast:{binding:["shift+d","shift+right"],label:"Pan right \u2014 Large"},zoomIn:{binding:"up",label:"Zoom in"},zoomInFast:{binding:"shift+up",label:"Zoom in \u2014 Large"},zoomOut:{binding:"down",label:"Zoom out"},zoomOutFast:{binding:"shift+down",label:"Zoom out \u2014 Large"},collapseAll:{binding:"]",label:"Collapse All"},expandAll:{binding:"[",label:"Expand All"},collapseOne:{binding:"p",label:"Collapse One Level"},expandOne:{binding:"o",label:"Expand One Level"},searchSpans:{binding:"ctrl+b",label:"Search Spans"},clearSearch:{binding:"escape",label:"Clear Search"}};function ms(){if(ds)return ds;var e=new(hs())(document.body);return ds=e,e}var xs,bs,ys,Zs,ws,Ss,js,ks,Cs,Ts,_s,Is,Ds,Ns,Ms,Es,Rs,Os,Ls=t(46123),Vs=t.n(Ls),zs=(0,ze.iv)(xs||(xs=(0,r.Z)(["\n position: relative;\n"]))),Fs=function(e){return(0,ze.iv)(bs||(bs=(0,r.Z)(["\ncolor: ",";\n"])),e.textColor)},Bs=(0,ze.iv)(ys||(ys=(0,r.Z)(["\n margin-bottom: 0.25rem;\n"]))),Hs=(0,ze.iv)(Zs||(Zs=(0,r.Z)(["\n margin-top: 0.25rem;\n margin-bottom: 0.25rem;\n"]))),Ps=(0,ze.iv)(ws||(ws=(0,r.Z)(["\n margin: 0;\n font-size:12px;\n font-weight:bold;\n font-family:monospace;\n"]))),qs=(0,ze.iv)(Ss||(Ss=(0,r.Z)(["\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n"]))),As=(0,ze.iv)(js||(js=(0,r.Z)(["\n padding-bottom: 0.5rem;\n"]))),Qs=(0,ze.iv)(ks||(ks=(0,r.Z)(["\n display: flex;\n"]))),Ws=((0,ze.iv)(Cs||(Cs=(0,r.Z)(["\n align-items: center;\n"]))),(0,ze.iv)(Ts||(Ts=(0,r.Z)(["\n align-items: start;\n"]))),(0,ze.iv)(_s||(_s=(0,r.Z)(["\n flex: 1 1 auto;\n min-width: 0; /* 1 */\n min-height: 0; /* 1 */\n"]))),(0,ze.iv)(Is||(Is=(0,r.Z)(["\n text-align: right;\n"])))),Us=(0,ze.iv)(Ds||(Ds=(0,r.Z)(["\n display: inline-block;\n"]))),Js=(0,ze.iv)(Ns||(Ns=(0,r.Z)(["\n // margin: -0.2rem 0.25rem 0 0;\n"]))),Gs=(0,ze.iv)(Ms||(Ms=(0,r.Z)(["\n text-overflow: ellipsis;\n"]))),Ks=(0,ze.iv)(Es||(Es=(0,r.Z)(["\n width: 100%;\n"]))),Ys=(0,ze.iv)(Rs||(Rs=(0,r.Z)(["\n color: #aaa;\n"]))),Xs=((0,ze.iv)(Os||(Os=(0,r.Z)(["\n justify-content: flex-end;\n"]))),t(82374)),$s=t.n(Xs);var eu=1e3,nu=1e3*eu,tu=60*nu,ru=60*tu,iu=24*ru,au=Math.log10(eu),ou=[{unit:"d",microseconds:iu,ofPrevious:24},{unit:"h",microseconds:ru,ofPrevious:60},{unit:"m",microseconds:tu,ofPrevious:60},{unit:"s",microseconds:nu,ofPrevious:1e3},{unit:"ms",microseconds:eu,ofPrevious:1e3},{unit:"\u03bcs",microseconds:1,ofPrevious:1e3}];var lu=function(e,n,t){return function(e,n){var t=n+(Math.floor(Math.log10(Math.abs(e)))+1);return t<=0?Math.trunc(e):Number(e.toPrecision(t))}(e/t,n)*t};function su(e){var n=(0,De.dropWhile)(ou,(function(n,t){var r=n.microseconds;return te})),t=(0,u.Z)(n,2),r=t[0],i=t[1];if(1e3===r.ofPrevious)return"".concat((0,De.round)(e/r.microseconds,2)).concat(r.unit);var a=Math.floor(e/r.microseconds),o="".concat(a).concat(r.unit),l=Math.round(e/i.microseconds%r.ofPrevious),s="".concat(l).concat(i.unit);return 0===l?o:"".concat(o," ").concat(s)}function uu(e,n,t){return!(!Array.isArray(t.tags)||!t.tags.length)&&t.tags.some((function(t){return t.key===e&&t.value===n}))}var cu=uu.bind(null,"span.kind","client"),du=uu.bind(null,"span.kind","server"),fu=uu.bind(null,"error",!0),pu=uu.bind(null,"error","true"),vu=function(e){return fu(e)||pu(e)};var hu,gu,mu,xu,bu=jt.Z.div(hu||(hu=(0,r.Z)(["\n pointer-events: none;\n"]))),yu=jt.Z.div(gu||(gu=(0,r.Z)(["\n position: absolute;\n height: 100%;\n width: 1px;\n background: ",";\n &:last-child {\n width: 0;\n }\n"])),(function(e){return e.theme.buttonBorder})),Zu=(0,ze.iv)(mu||(mu=(0,r.Z)(["\n left: 0.25rem;\n position: absolute;\n"]))),wu=(0,ze.iv)(xu||(xu=(0,r.Z)(["\n left: initial;\n right: 0.25rem;\n"])));function Su(e){var n,t=e.endTime,r=e.numTicks,i=e.showLabels,a=e.startTime;if(i){n=[];for(var o=(t||0)-(a||0),l=0;l=1)),children:n[c]})},d))}return(0,Fe.jsx)(bu,{children:u})}Su.defaultProps={endTime:null,showLabels:null,startTime:null};var ju,ku=["children","className"],Cu=["children","className","width","style","theme"],Tu=function(e){return(0,ze.iv)(ju||(ju=(0,r.Z)(["\n color: ",";\n display: flex;\n flex: 0 1 auto;\n flex-direction: row;\n"])),null===e||void 0===e?void 0:e.textColor)};function _u(e){var n=e.children,t=e.className,r=void 0===t?"":t,i=(0,Vo.Z)(e,ku);return(0,Fe.jsx)("div",(0,l.Z)((0,l.Z)({className:Vs()(Tu(e.theme),r)},i),{},{children:n}))}function Iu(e){var n=e.children,t=e.className,r=void 0===t?"":t,i=e.width,a=e.style,o=e.theme,s=(0,Vo.Z)(e,Cu),u="".concat(100*i,"%"),c=(0,l.Z)((0,l.Z)({},a),{},{flexBasis:u,maxWidth:u});return(0,Fe.jsx)("div",(0,l.Z)((0,l.Z)({className:Vs()(zs,r,Fs(o)),style:c,"data-testid":"TimelineRowCell"},s),{},{children:n}))}_u.defaultProps={className:""},Iu.defaultProps={className:"",style:{}},_u.Cell=Iu;var Du,Nu,Mu=t(75115),Eu=t(96447),Ru=(0,ze.iv)(Du||(Du=(0,r.Z)(["\n align-items: center;\n display: flex;\n flex: none;\n gap:2px;\n justify-content: center;\n margin-right: 0.5rem;\n"])));function Ou(e){var n=e.onExpandAll,t=e.onExpandOne,r=e.onCollapseAll,i=e.onCollapseOne;return(0,Fe.jsxs)("div",{className:Ru,"data-testid":"TimelineCollapser",children:[(0,Fe.jsx)(D.Z,{title:"Expand +1",children:(0,Fe.jsx)(ga.Z,{fontSize:"small",style:{cursor:"pointer",color:e.theme.textColor},onClick:t})}),(0,Fe.jsx)(D.Z,{title:"Collapse +1",children:(0,Fe.jsx)(mt.Z,{fontSize:"small",style:{cursor:"pointer",color:e.theme.textColor},onClick:i})}),(0,Fe.jsx)(D.Z,{title:"Expand All",children:(0,Fe.jsx)(Mu.Z,{fontSize:"small",style:{cursor:"pointer",color:e.theme.textColor},onClick:n})}),(0,Fe.jsx)(D.Z,{title:"Collapse All",children:(0,Fe.jsx)(Eu.Z,{fontSize:"small",style:{cursor:"pointer",color:e.theme.textColor},onClick:r})})]})}!function(e){e.DragEnd="DragEnd",e.DragMove="DragMove",e.DragStart="DragStart",e.MouseEnter="MouseEnter",e.MouseLeave="MouseLeave",e.MouseMove="MouseMove"}(Nu||(Nu={}));var Lu,Vu,zu,Fu,Bu,Hu,Pu,qu,Au,Qu,Wu,Uu,Ju,Gu,Ku=Nu,Yu=["getBounds","tag","resetBoundsOnResize"],Xu=0,$u=function(){function e(n){var t=this,r=n.getBounds,i=n.tag,a=n.resetBoundsOnResize,o=void 0===a||a,l=(0,Vo.Z)(n,Yu);(0,Fa.Z)(this,e),this._bounds=void 0,this._isDragging=void 0,this._onMouseEnter=void 0,this._onMouseLeave=void 0,this._onMouseMove=void 0,this._onDragStart=void 0,this._onDragMove=void 0,this._onDragEnd=void 0,this._resetBoundsOnResize=void 0,this.getBounds=void 0,this.tag=void 0,this.handleMouseEnter=void 0,this.handleMouseMove=void 0,this.handleMouseLeave=void 0,this.handleMouseDown=void 0,this.resetBounds=function(){t._bounds=void 0},this._handleMinorMouseEvent=function(e){var n=e.button,r=e.clientX,i=e.type;if(!t._isDragging&&n===Xu){var a,o=null;if("mouseenter"===i)o=Ku.MouseEnter,a=t._onMouseEnter;else if("mouseleave"===i)o=Ku.MouseLeave,a=t._onMouseLeave;else{if("mousemove"!==i)throw new Error("invalid event type: ".concat(i));o=Ku.MouseMove,a=t._onMouseMove}if(a){var l=t._getPosition(r);a({event:e,type:o,value:l.value,x:l.x,manager:t,tag:t.tag})}}},this._handleDragEvent=function(e){var n,r=e.button,i=e.clientX,a=e.type,o=null;if("mousedown"===a){if(t._isDragging||r!==Xu)return;window.addEventListener("mousemove",t._handleDragEvent),window.addEventListener("mouseup",t._handleDragEvent);var l=(0,De.get)(document,"body.style");l&&(l.userSelect="none"),t._isDragging=!0,o=Ku.DragStart,n=t._onDragStart}else if("mousemove"===a){if(!t._isDragging)return;o=Ku.DragMove,n=t._onDragMove}else{if("mouseup"!==a)throw new Error("invalid event type: ".concat(a));if(!t._isDragging)return;t._stopDragging(),o=Ku.DragEnd,n=t._onDragEnd}if(n){var s=t._getPosition(i);n({event:e,type:o,value:s.value,x:s.x,manager:t,tag:t.tag})}},this.handleMouseDown=this._handleDragEvent,this.handleMouseEnter=this._handleMinorMouseEvent,this.handleMouseMove=this._handleMinorMouseEvent,this.handleMouseLeave=this._handleMinorMouseEvent,this.getBounds=r,this.tag=i,this._isDragging=!1,this._bounds=void 0,this._resetBoundsOnResize=Boolean(o),this._resetBoundsOnResize&&window.addEventListener("resize",this.resetBounds),this._onMouseEnter=l.onMouseEnter,this._onMouseLeave=l.onMouseLeave,this._onMouseMove=l.onMouseMove,this._onDragStart=l.onDragStart,this._onDragMove=l.onDragMove,this._onDragEnd=l.onDragEnd}return(0,Ba.Z)(e,[{key:"_getBounds",value:function(){return this._bounds||(this._bounds=this.getBounds(this.tag)),this._bounds}},{key:"_getPosition",value:function(e){var n=this._getBounds(),t=n.clientXLeft,r=n.maxValue,i=n.minValue,a=n.width,o=e-t,l=o/a;return null!=i&&lr&&(l=r,o=r*a),{value:l,x:o}}},{key:"_stopDragging",value:function(){window.removeEventListener("mousemove",this._handleDragEvent),window.removeEventListener("mouseup",this._handleDragEvent);var e=(0,De.get)(document,"body.style");e&&(e.userSelect=null),this._isDragging=!1}},{key:"isDragging",value:function(){return this._isDragging}},{key:"dispose",value:function(){this._isDragging&&this._stopDragging(),this._resetBoundsOnResize&&window.removeEventListener("resize",this.resetBounds),this._bounds=void 0,this._onMouseEnter=void 0,this._onMouseLeave=void 0,this._onMouseMove=void 0,this._onDragStart=void 0,this._onDragMove=void 0,this._onDragEnd=void 0}}]),e}(),ec=jt.Z.div(Lu||(Lu=(0,r.Z)(["\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n"]))),nc=(0,ze.iv)(Vu||(Vu=(0,r.Z)(['\n border-left: 2px solid transparent;\n cursor: col-resize;\n height: 5000px;\n margin-left: -1px;\n position: absolute;\n top: 0;\n width: 1px;\n z-index: 10;\n &:hover {\n border-left: 2px solid rgba(0, 0, 0, 0.3);\n }\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: -8px;\n right: 0;\n content: " ";\n }\n']))),tc=(0,ze.iv)(zu||(zu=(0,r.Z)(["\n background: rgba(136, 0, 136, 0.05);\n width: unset;\n &::before {\n left: -2000px;\n right: -2000px;\n }\n"]))),rc=(0,ze.iv)(Fu||(Fu=(0,r.Z)(["\n border-left: 2px solid #808;\n border-right: 1px solid #999;\n"]))),ic=(0,ze.iv)(Bu||(Bu=(0,r.Z)(["\n border-left: 1px solid #999;\n border-right: 2px solid #808;\n"]))),ac=(0,ze.iv)(Hu||(Hu=(0,r.Z)(['\n position: absolute;\n top: 0;\n bottom: 0;\n &::before,\n &::after {\n border-right: 1px solid #ccc;\n content: " ";\n height: 9px;\n position: absolute;\n right: 9px;\n top: 25px;\n }\n &::after {\n right: 5px;\n }\n']))),oc=(0,ze.iv)(Pu||(Pu=(0,r.Z)(["\n &::before,\n &::after {\n border-right: 1px solid rgba(136, 0, 136, 0.5);\n }\n"]))),lc=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e)).state=void 0,r._dragManager=void 0,r._rootElm=void 0,r._setRootElm=function(e){r._rootElm=e},r._getDraggingBounds=function(){if(!r._rootElm)throw new Error("invalid state");var e=r._rootElm.getBoundingClientRect(),n=e.left,t=e.width,i=r.props,a=i.min;return{clientXLeft:n,width:t,maxValue:i.max,minValue:a}},r._handleDragUpdate=function(e){var n=e.value;r.setState({dragPosition:n})},r._handleDragEnd=function(e){var n=e.manager,t=e.value;n.resetBounds(),r.setState({dragPosition:null}),r.props.onChange(t)},r._dragManager=new $u({getBounds:r._getDraggingBounds,onDragEnd:r._handleDragEnd,onDragMove:r._handleDragUpdate,onDragStart:r._handleDragUpdate}),r._rootElm=void 0,r.state={dragPosition:null},r}return(0,Ba.Z)(t,[{key:"componentWillUnmount",value:function(){this._dragManager.dispose()}},{key:"render",value:function(){var e,n=this.props,t=n.position,r=n.columnResizeHandleHeight,i=this.state.dragPosition,a={left:"".concat(100*t,"%")},o=!1,l=!1;this._dragManager.isDragging()&&this._rootElm&&null!=i?(o=it,"".concat(100*i,"%"),e={left:"".concat(100*Math.min(t,i),"%"),right:"calc(".concat(100*(1-Math.max(t,i)),"% - 1px)")}):e=a;e.height=r;var s=o||l;return(0,Fe.jsxs)(ec,{ref:this._setRootElm,"data-testid":"TimelineColumnResizer",children:[(0,Fe.jsx)("div",{className:Vs()(ac,s&&oc),style:a,"data-testid":"TimelineColumnResizer--gripIcon"}),(0,Fe.jsx)("div",{"aria-hidden":!0,className:Vs()(nc,s&&tc,l&&ic,o&&rc),onMouseDown:this._dragManager.handleMouseDown,style:e,"data-testid":"TimelineColumnResizer--dragger"})]})}}]),t}(f.PureComponent),sc=jt.Z.div(qu||(qu=(0,r.Z)(["\n bottom: 0;\n cursor: vertical-text;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n font-size:12px;\n"]))),uc=jt.Z.div(Au||(Au=(0,r.Z)(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 1px;\n background-color: red;\n"]))),cc=(0,ze.iv)(Qu||(Qu=(0,r.Z)(["\n position: absolute;\n top: 0;\n bottom: 0;\n"]))),dc=(0,ze.iv)(Wu||(Wu=(0,r.Z)(["\n border-left: 1px solid;\n"]))),fc=(0,ze.iv)(Uu||(Uu=(0,r.Z)(["\n border-right: 1px solid;\n"]))),pc=(0,ze.iv)(Ju||(Ju=(0,r.Z)(["\n background-color: rgba(68, 68, 255, 0.2);\n border-color: #44f;\n"]))),vc=(0,ze.iv)(Gu||(Gu=(0,r.Z)(["\n background-color: rgba(255, 68, 68, 0.2);\n border-color: #f44;\n"])));function hc(e,n,t){return e+t*(n-e)}function gc(e,n,t){return(t-e)/(n-e)}function mc(e,n,t,r,i){var a,o=function(e,n){var t=e=1||a<=0?{isOutOfView:!0}:(i<0&&(i=0),a>1&&(a=1),{isDraggingLeft:e>n,left:"".concat(100*i,"%"),width:"".concat(100*(a-i),"%")})}(gc(e,n,t),gc(e,n,r));if(function(e){return Reflect.has(e,"isOutOfView")}(o))return null;var l=o.isDraggingLeft,s=o.left,c=o.width,d=(0,ze.cx)((a={},(0,B.Z)(a,fc,!l),(0,B.Z)(a,vc,!i),(0,B.Z)(a,pc,i),a));return(0,Fe.jsx)("div",{className:(0,ze.cx)(cc,dc,d),style:{left:s,width:c},"data-testid":"Dragged"})}var xc,bc,yc,Zc=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e))._draggerReframe=void 0,r._root=void 0,r._setRoot=function(e){r._root=e},r._getDraggingBounds=function(){if(!r._root)throw new Error("invalid state");var e=r._root.getBoundingClientRect();return{clientXLeft:e.left,width:e.width}},r._handleReframeMouseMove=function(e){var n=e.value,t=(0,u.Z)(r.props.viewRangeTime.current,2),i=hc(t[0],t[1],n);r.props.updateNextViewRangeTime({cursor:i})},r._handleReframeMouseLeave=function(){r.props.updateNextViewRangeTime({cursor:void 0})},r._handleReframeDragUpdate=function(e){var n=e.value,t=r.props.viewRangeTime,i=t.current,a=t.reframe,o=(0,u.Z)(i,2),l=hc(o[0],o[1],n),s={reframe:{anchor:a?a.anchor:l,shift:l}};r.props.updateNextViewRangeTime(s)},r._handleReframeDragEnd=function(e){var n=e.manager,t=e.value,i=r.props.viewRangeTime,a=i.current,o=i.reframe,l=(0,u.Z)(a,2),s=hc(l[0],l[1],t),c=o?o.anchor:s,d=s=s&&r<=c&&(e="".concat(100*gc(s,c,r),"%")),(0,Fe.jsxs)(sc,{"aria-hidden":!0,ref:this._setRoot,onMouseDown:this._draggerReframe.handleMouseDown,onMouseLeave:this._draggerReframe.handleMouseLeave,onMouseMove:this._draggerReframe.handleMouseMove,"data-testid":"TimelineViewingLayer",children:[null!=e&&(0,Fe.jsx)(uc,{style:{left:e},"data-testid":"TimelineViewingLayer--cursorGuide"}),null!=i&&mc(s,c,i.anchor,i.shift,!1),null!=a&&mc(s,c,c,a,!0),null!=o&&mc(s,c,s,o,!0)]})}}]),t}(f.PureComponent),wc=function(e){return(0,ze.iv)(xc||(xc=(0,r.Z)(["\n background:",";\n border-bottom: 1px solid ",";\n color:","\n height: 38px;\n line-height: 38px;\n width: 100%;\n z-index: 4;\n position: relative;\n font-size:12px;\n"])),e.mainBgColor,e.buttonBorder,e.textColor)},Sc=(0,ze.iv)(bc||(bc=(0,r.Z)(["\n align-items: center;\n"]))),jc=(0,ze.iv)(yc||(yc=(0,r.Z)(["\n flex: 1;\n overflow: hidden;\n margin: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));function kc(e){var n=e.duration,t=e.nameColumnWidth,r=e.numTicks,i=e.onCollapseAll,a=e.onCollapseOne,o=e.onColummWidthChange,l=e.onExpandAll,s=e.onExpandOne,c=e.updateViewRangeTime,d=e.updateNextViewRangeTime,f=e.viewRangeTime,p=e.columnResizeHandleHeight,v=(0,u.Z)(f.current,2),h=v[0],g=v[1];return(0,Fe.jsxs)(_u,{theme:e.theme,className:wc(e.theme),"data-testid":"TimelineHeaderRow",children:[(0,Fe.jsxs)(_u.Cell,{theme:e.theme,className:Vs()(Qs,qs,Sc),width:t,id:"collapser",children:[(0,Fe.jsx)("h4",{className:jc,children:"Service & Operation"}),(0,Fe.jsx)(Ou,{theme:e.theme,onCollapseAll:i,onExpandAll:l,onCollapseOne:a,onExpandOne:s})]}),(0,Fe.jsxs)(_u.Cell,{theme:e.theme,id:"ticker",width:1-t,children:[(0,Fe.jsx)(Zc,{boundsInvalidator:t,updateNextViewRangeTime:d,updateViewRangeTime:c,viewRangeTime:f}),(0,Fe.jsx)(Su,{theme:e.theme,numTicks:r,startTime:h*n,endTime:g*n,showLabels:!0})]}),(0,Fe.jsx)(lc,{columnResizeHandleHeight:p,position:t,onChange:o,min:.2,max:.85})]})}var Cc=["#7db26c","#eab839","#6cd0e0","#ef853e","#e14c41","#1f78c1","#bb44a9","#715ea1","#4f8542","#cca300","#447ebb","#c05a16","#880f02","#0a427b","#6b1e61","#594578","#b6daa9","#f4d699","#6edaed","#f9ba90","#f29191","#83b6d8","#e5a9e2","#afa3e0","#629e51","#e6ad0f","#64b1c9","#e0752e","#bd1900","#0a52a3","#952d82","#614d93","#99c388","#f2cb6e","#66c6db","#f9924e","#ea6661","#5095ce","#d685ce","#7f6cb7","#3f6732","#977402","#30585f","#99430a","#5a140c","#052b51","#501648","#3e2a5a","#e0f9d7","#fceaca","#d1faff","#f9e2d2","#fce2de","#b8def4","#f9d7f9","#ddd9f7"];function Tc(e){if(7!==e.length)return[0,0,0];var n=e.slice(1,3),t=e.slice(3,5),r=e.slice(5);return[parseInt(n,16),parseInt(t,16),parseInt(r,16)]}var _c=function(){function e(n,t){(0,Fa.Z)(this,e),this.colorsHex=void 0,this.colorsRgb=void 0,this.cache=void 0;var r=function(e,n){if(!n)return Cc;var t=e.indexOf("#e14c41");t>-1&&e.splice(t,1);var r,i=[],a=(0,s.Z)(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i.push(o)}}catch(l){a.e(l)}finally{a.f()}return i}(n,t);this.colorsHex=r,this.colorsRgb=r.map(Tc),this.cache=new Map}return(0,Ba.Z)(e,[{key:"_getColorIndex",value:function(e){var n=this.cache.get(e);if(null==n){var t=this.hashCode(e.toLowerCase()),r=Math.abs(t%this.colorsHex.length);n=4===r?r+1:r,this.cache.set(e,n)}return n}},{key:"hashCode",value:function(e){var n,t=0;for(n=0;n=e&&(this.lastI=e-1))}},{key:"calcHeights",value:function(e,n,t){null!=t&&(this.lastI=t);var r=e+this.bufferLen;if(!(r<=this.lastI)){r>=this.heights.length&&(r=this.heights.length-1);var i=this.lastI;for(-1===this.lastI&&(i=0,this.ys[0]=0);i<=r;){var a=this.heights[i]=n(i);this.ys[i+1]=this.ys[i]+a,i++}this.lastI=r}}},{key:"calcYs",value:function(e,n){for(;(null==this.ys[this.lastI]||e>this.ys[this.lastI])&&this.lastIthis.lastI)this.calcHeights(t,n);else{var r=n(t);if(r!==this.heights[t]){var i=r-this.heights[t];for(this.heights[t]=r;++t<=this.lastI;)this.ys[t]+=i;null!=this.ys[this.lastI+1]&&(this.ys[this.lastI+1]+=i)}}}},{key:"findFloorIndex",value:function(e,n){this.calcYs(e,n);var t,r=0,i=this.lastI;if(this.ys.length<2||ethis.ys[i])return i;for(;rthis.ys[t]){if(e<=this.ys[t+1])return t;r=t}else{if(!(e=this.ys[t-1])return t-1;i=t}throw new Error("unable to find floor index for y=".concat(e))}},{key:"getRowPosition",value:function(e,n){return this.confirmHeight(e,n),{height:this.heights[e],y:this.ys[e]}}},{key:"getEstimatedHeight",value:function(){var e=this.ys[this.lastI]+this.heights[this.lastI];return this.lastI>=this.dataLen-1?0|e:e/(this.lastI+1)*this.heights.length|0}}]),e}(),Mc=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e))._yPositions=void 0,r._knownHeights=void 0,r._startIndexDrawn=void 0,r._endIndexDrawn=void 0,r._startIndex=void 0,r._endIndex=void 0,r._viewHeight=void 0,r._scrollTop=void 0,r._isScrolledOrResized=void 0,r._htmlTopOffset=void 0,r._windowScrollListenerAdded=void 0,r._htmlElm=void 0,r._wrapperElm=void 0,r._itemHolderElm=void 0,r.getViewHeight=function(){return r._viewHeight},r.getBottomVisibleIndex=function(){var e=r._scrollTop+r._viewHeight;return r._yPositions.findFloorIndex(e,r._getHeight)},r.getTopVisibleIndex=function(){return r._yPositions.findFloorIndex(r._scrollTop,r._getHeight)},r.getRowPosition=function(e){return r._yPositions.getRowPosition(e,r._getHeight)},r.scrollToIndex=function(e){var n,t,i=r.props.scrollElement,a=(null===i||void 0===i?void 0:i.getBoundingClientRect().top)||0,o=((null===i||void 0===i?void 0:i.scrollTop)||0)+((null===(n=r._itemHolderElm)||void 0===n?void 0:n.getBoundingClientRect().top)||0)-a,l=r.getRowPosition(e).y;null===(t=r.props.scrollElement)||void 0===t||t.scrollTo({top:l+o-80})},r._onScroll=function(){r._isScrolledOrResized||(r._isScrolledOrResized=!0,window.requestAnimationFrame(r._positionList))},r._positionList=function(){if(r._isScrolledOrResized=!1,r._wrapperElm){r._calcViewIndexes();var e=r.props.viewBufferMin>r._startIndex?0:r._startIndex-r.props.viewBufferMin,n=r.props.viewBufferMinr._endIndexDrawn)&&r.forceUpdate()}},r._initWrapper=function(e){r.props.windowScroller&&(r._wrapperElm=e,e&&(r._viewHeight=e.clientHeight))},r._initItemHolder=function(e){r._itemHolderElm=e,r._scanItemHeights()},r._scanItemHeights=function(){var e=r.props.getIndexFromKey;if(r._itemHolderElm){for(var n=null,t=null,i=!1,a=r._itemHolderElm.childNodes,o=a.length,l=0;lthis._startIndex?0:this._startIndex-c,v=cthis._endIndexDrawn?(e=u>this._startIndex?0:this._startIndex-u,(n=this._endIndex+u)>=r&&(n=r-1)):(e=this._startIndexDrawn,n=this._endIndexDrawn>r-1?r-1:this._endIndexDrawn)}else e=0,n=(o small {\n color: ',";\n }\n text-align: left;\n background: transparent;\n border: none;\n"])),e.textColor,e.textColor)},hp=(0,ze.iv)(Hf||(Hf=(0,r.Z)(["\n &::before {\n bottom: 0;\n }\n"]))),gp=(0,ze.iv)(Pf||(Pf=(0,r.Z)(["\n padding: 0 0.25rem 0 0.5rem;\n 12px;\n"]))),mp=(0,ze.iv)(qf||(qf=(0,r.Z)(["\n font-weight: bold;\n font-style: italic;\n"]))),xp=(0,ze.iv)(Af||(Af=(0,r.Z)(["\n border-radius: 6.5px;\n color: #fff;\n font-size: 0.85em;\n margin-right: 0.25rem;\n padding: 1px;\n"]))),bp=jt.Z.i(Qf||(Qf=(0,r.Z)(["\n border-radius: 6.5px;\n display: inline-block;\n font-size: 0.85em;\n height: 1em;\n margin-right: 0.25rem;\n padding: 1px;\n width: 1em;\n vertical-align: middle;\n"]))),yp=(0,ze.iv)(Wf||(Wf=(0,r.Z)(["\n left: 100%;\n"]))),Zp=(0,ze.iv)(Uf||(Uf=(0,r.Z)(["\n right: 100%;\n"]))),wp=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(){var e;(0,Fa.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a1-O?(i="".concat(L," | ").concat(M),a=Zp):(i="".concat(M," | ").concat(L),a=yp);return(0,Fe.jsxs)(_u,{theme:this.props.theme,className:Vs()(sp,(e={},(0,B.Z)(e,dp(this.props.theme),f),(0,B.Z)(e,fp(this.props.theme),p),(0,B.Z)(e,(this.props.theme,(0,ze.iv)(Ff||(Ff=(0,r.Z)(["\n &:hover ."," {\n background: #ffeccf;\n }\n"])),$f)),p&&f),(0,B.Z)(e,pp(this.props.theme),v),(0,B.Z)(e,up,k),(0,B.Z)(e,cp,C),e),l),children:[(0,Fe.jsx)(_u.Cell,{theme:this.props.theme,className:Vs()(rp,"nameColumn"),width:c,children:(0,Fe.jsxs)("div",{className:Vs()(np,Yf,(n={},(0,B.Z)(n,tp,p),(0,B.Z)(n,"nameWrapperMatchingFilter",p),n)),children:[(0,Fe.jsx)(Jf,{theme:this.props.theme,onClick:I?this._childrenToggle:void 0,childrenVisible:d,span:Z,hoverIndentGuideIds:w,addHoverIndentGuideId:S,removeHoverIndentGuideId:j}),(0,Fe.jsxs)("button",{type:"button",className:Vs()(vp(this.props.theme),(0,B.Z)({},hp,f)),"aria-checked":f,title:L,onClick:this._detailToggle,role:"switch",style:{borderColor:s},tabIndex:0,children:[(0,Fe.jsxs)("span",{className:Vs()(gp,(0,B.Z)({},mp,I&&!d)),children:[x&&(0,Fe.jsx)(Lc.Z,{style:{backgroundColor:Z.errorIconColor?Z.errorIconColor:"#db2828"},className:xp}),N," ",g&&(0,Fe.jsxs)("span",{children:[(0,Fe.jsx)(Vc.Z,{})," ",(0,Fe.jsx)(bp,{style:{background:g.color}}),g.serviceName]}),m&&(0,Fe.jsxs)("span",{children:[(0,Fe.jsx)(Vc.Z,{})," ",(0,Fe.jsx)(bp,{style:{background:m.color}}),m.serviceName]})]}),(0,Fe.jsx)(ip,{children:g?g.operationName:D}),(0,Fe.jsxs)(ip,{children:[" ",this.getSpanBarLabel(Z,u,M)]})]}),T&&function(){var e=T(Z),n=function(e){return e?Object.values(e).reduce((function(e,n){return e+n.length}),0):0}(e);if(e&&1===n){var t,r,i,a,o,l,s=null!==(t=null!==(r=null!==(i=null===(a=e.logLinks)||void 0===a?void 0:a[0])&&void 0!==i?i:null===(o=e.metricLinks)||void 0===o?void 0:o[0])&&void 0!==r?r:null===(l=e.traceLinks)||void 0===l?void 0:l[0])&&void 0!==t?t:void 0;return s?(0,Fe.jsx)("a",{href:s.href,target:"_blank",style:{marginRight:"5px"},rel:"noopener noreferrer",onClick:s.onClick?function(e){e.ctrlKey||e.metaKey||e.shiftKey||!s.onClick||(e.preventDefault(),s.onClick(e))}:void 0,children:s.content}):null}return null}()]})}),(0,Fe.jsxs)(_u.Cell,{theme:this.props.theme,className:Vs()(ap,$f,(t={},(0,B.Z)(t,op(this.props.theme),f),(0,B.Z)(t,lp(this.props.theme),p&&f),t)),"data-testid":"span-view",style:{cursor:"pointer"},width:1-c,onClick:this._detailToggle,children:[(0,Fe.jsx)(Su,{theme:this.props.theme,numTicks:h}),(0,Fe.jsx)(mf,{rpc:g,viewStart:R,viewEnd:O,getViewedBounds:b,color:s,shortLabel:M,longLabel:i,traceStartTime:y,span:Z,labelClassName:"".concat(Kf," ").concat(a),className:Gf})]})]})}}]),t}(f.PureComponent);wp.displayName="UnthemedSpanBarRow",wp.defaultProps={className:"",rpc:null};var Sp,jp,kp,Cp,Tp,_p,Ip,Dp,Np,Mp=wp,Ep=(0,ze.iv)(Sp||(Sp=(0,r.Z)(["\n background: #ddd;\n"]))),Rp=(0,ze.iv)(jp||(jp=(0,r.Z)(["\n display: inline-block;\n width: 1px;\n height: 0.9em;\n margin: 0 8px;\n vertical-align: middle;\n"]))),Op=(0,ze.iv)(kp||(kp=(0,r.Z)(["\n display: block;\n height: 1px;\n width: 100%;\n margin: 24px 0;\n clear: both;\n position: relative;\n top: -0.06em;\n"])));function Lp(e){var n=e.className,t=e.style,r=e.type;return(0,Fe.jsx)("div",{style:t,className:(0,ze.cx)(Ep,"horizontal"===r?Op:Rp,n)})}var Vp=(0,ze.iv)(Cp||(Cp=(0,r.Z)(["\n list-style: none;\n margin: 0;\n padding: 0;\n"]))),zp=(0,ze.iv)(Tp||(Tp=(0,r.Z)(["\n margin-right: -8px;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n"]))),Fp=(0,ze.iv)(_p||(_p=(0,r.Z)(["\n display: inline-block;\n"]))),Bp=function(e){return(0,ze.iv)(Ip||(Ip=(0,r.Z)(["\n border-right: 1px solid ",";\n padding: 0 8px;\n"])),e)},Hp=jt.Z.span(Dp||(Dp=(0,r.Z)(["\n color: ",";\n margin-right: 0.25rem;\n font-size: 12px;\n"])),(function(e){return e.theme.textColor})),Pp=jt.Z.strong(Np||(Np=(0,r.Z)(["\n color: ",";\n margin-right: 0.55rem;\n font-size: 12px;\n"])),(function(e){return e.theme.textColor}));function qp(e){var n=e.className,t=e.divider,r=void 0!==t&&t,i=e.items;return(0,Fe.jsx)("ul",{className:Vs()(Vp,n,r?zp:""),children:i.map((function(n){var t=n.key,i=n.label,a=n.value;return(0,Fe.jsxs)("li",{className:Vs()(Fp,r?Bp(e.theme.buttonBorder):""),children:[(0,Fe.jsx)(Hp,{theme:e.theme,children:i}),(0,Fe.jsx)(Pp,{theme:e.theme,children:a})]},"".concat(t))}))})}var Ap,Qp,Wp,Up,Jp,Gp="label",Kp=t(94795),Yp=t.n(Kp),Xp=t(69099);function $p(e){var n=(0,f.useState)(!1),t=(0,u.Z)(n,2),r=t[0],i=t[1];return(0,Fe.jsx)(D.Z,{title:r?"Copied":e.tooltipTitle,children:(0,Fe.jsx)(Xp.Z,{type:"button",onClick:function(){i(!0)}})})}$p.defaultProps={icon:"copy",className:void 0};var ev="copyIcon",nv=jt.Z.div(Ap||(Ap=(0,r.Z)(["\n background:",";\n border: 1px solid ",";\n margin-bottom: 0.5rem;\n max-height: 450px;\n overflow: auto;\n"])),(function(e){return e.theme.viewBg}),(function(e){return e.theme.buttonBorder})),tv=jt.Z.tbody(Qp||(Qp=(0,r.Z)(["\n vertical-align: baseline;\n"]))),rv=jt.Z.tr(Wp||(Wp=(0,r.Z)(["\ncolor:",";\n & > td {\n padding: 0rem 0.5rem;\n height: 30px;\n line-height: 30px;\n box-sizing: border-box;\n font-size: 12px;\n color:",";\n }\n &:nth-of-type(2n) > td {\n background:",";\n }\n &:not(:hover) ."," {\n visibility: hidden;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.textColor}),(function(e){return e.theme.widgetContainer}),ev),iv=jt.Z.td(Up||(Up=(0,r.Z)(["\n color: "," !important;\n white-space: pre;\n width: 125px;\n"])),(function(e){return e.theme.textColor})),av=jt.Z.td(Jp||(Jp=(0,r.Z)(["\n text-align: right;\n"]))),ov=/^(\[|\{)/;function lv(e){if("string"===typeof e&&ov.test(e))try{return JSON.parse(e)}catch(n){}return e}var sv,uv,cv,dv,fv,pv,vv,hv,gv=function(e){return(0,Fe.jsxs)("a",{href:e.href,title:e.title,target:"_blank",rel:"noopener noreferrer",children:[e.children," ",(0,Fe.jsx)(io.Z,{})]})};function mv(e){var n=e.data,t=e.linksGetter,r=e.theme;return(0,Fe.jsx)(nv,{theme:r,"data-testid":"KeyValueTable",children:(0,Fe.jsx)("table",{className:Ks,children:(0,Fe.jsx)(tv,{children:n.map((function(e,i){var a,o={__html:Yp()(lv(e.value))},l=(0,Fe.jsx)("div",{className:Us,dangerouslySetInnerHTML:o}),s=t?t(n,i):null;return a=s&&s.length?(0,Fe.jsx)("div",{children:(0,Fe.jsx)(gv,{href:s[0].url,title:s[0].text,children:l})}):l,(0,Fe.jsxs)(rv,{theme:r,children:[(0,Fe.jsx)(iv,{theme:r,"data-testid":"KeyValueTable--keyColumn",children:e.key}),(0,Fe.jsx)("td",{children:a}),(0,Fe.jsx)(av,{children:(0,Fe.jsx)($p,{className:ev,copyText:JSON.stringify(e,null,2),tooltipTitle:"Copy JSON"})})]},"".concat(e.key,"-").concat(i))}))})})})}gv.defaultProps={title:""};var xv,bv,yv,Zv,wv=(0,ze.iv)(sv||(sv=(0,r.Z)(["\n cursor: pointer;\n overflow: hidden;\n display: flex;\n align-items: center;\n padding: 0.25em 0.1em;\n font-size: 12px;\n text-overflow: ellipsis;\n white-space: nowrap;\n &:hover {\n // background: #e8e8e8;\n }\n"]))),Sv=(0,ze.iv)(uv||(uv=(0,r.Z)(["\n background: none;\n cursor: initial;\n"]))),jv=(0,ze.iv)(cv||(cv=(0,r.Z)(["\n &:hover {\n // background: #ddd;\n }\n"]))),kv=(0,ze.iv)(dv||(dv=(0,r.Z)(["\n // color: #aaa;\n"]))),Cv=jt.Z.ul(fv||(fv=(0,r.Z)(["\n display: inline;\n list-style: none;\n padding: 0;\n"]))),Tv=jt.Z.li(pv||(pv=(0,r.Z)(["\n display: inline;\n margin-left: 0.7em;\n padding-right: 0.5rem;\n border-right: 1px solid #ddd;\n &:last-child {\n padding-right: 0;\n border-right: none;\n }\n"]))),_v=jt.Z.span(vv||(vv=(0,r.Z)(["\n color: #777;\n"]))),Iv=jt.Z.span(hv||(hv=(0,r.Z)(["\n color: #bbb;\n padding: 0 0.2em;\n"])));function Dv(e){var n=e.data;return Array.isArray(n)&&n.length?(0,Fe.jsx)(Cv,{children:n.map((function(e,n){return(0,Fe.jsxs)(Tv,{children:[(0,Fe.jsx)(_v,{children:e.key}),(0,Fe.jsx)(Iv,{children:"="}),String(e.value)]},"".concat(e.key,"-").concat(n))}))}):null}function Nv(e){var n,t=e.className,r=e.data,i=e.highContrast,a=e.interactive,o=e.isOpen,s=e.label,u=e.linksGetter,c=e.onToggle,d=!Array.isArray(r)||!r.length,f=null,p=null;return a&&(f=o?(0,Fe.jsx)(ga.Z,{fontSize:"small",style:{height:"13px",width:"13px"}}):(0,Fe.jsx)(mt.Z,{fontSize:"small",style:{height:"13px",width:"13px"}}),p={"aria-checked":o,onClick:d?null:c,role:"switch"}),(0,Fe.jsxs)("div",{className:Vs()(t,Gs),children:[(0,Fe.jsxs)("div",(0,l.Z)((0,l.Z)({className:Vs()(wv,(n={},(0,B.Z)(n,Sv,d),(0,B.Z)(n,jv,i&&!d),n))},p),{},{"data-testid":"AccordianKeyValues--header",children:[f,(0,Fe.jsxs)("strong",{"data-test":Gp,children:[s,o||":"]}),!o&&(0,Fe.jsx)(Dv,{data:r})]})),o&&(0,Fe.jsx)(mv,{theme:e.theme,data:r,linksGetter:u})]})}Dv.defaultProps={data:null},Nv.defaultProps={className:null,highContrast:!1,interactive:!0,onToggle:null};var Mv=jt.Z.div(xv||(xv=(0,r.Z)(["\n // border: 1px solid #d8d8d8;\n position: relative;\n margin-bottom: 0.25rem;\n"]))),Ev=jt.Z.small(bv||(bv=(0,r.Z)(["\n// color: #999;\n font-size: 80%;\n"]))),Rv=jt.Z.div(yv||(yv=(0,r.Z)(["\n // background: #f0f0f0;\n // border-top: 1px solid #d8d8d8;\n // padding: 0.5rem 0.5rem 0.25rem 0.5rem;\n"]))),Ov=(0,ze.iv)(Zv||(Zv=(0,r.Z)(["\n display: flex;\n align-items: center;\n // background: #e4e4e4;\n color: inherit;\n \n font-size: 12px;\n padding: 0.25rem 0.5rem;\n &:hover {\n // background: #dadada;\n }\n"])));function Lv(e){var n=e.interactive,t=e.isOpen,r=e.linksGetter,i=e.logs,a=e.openedItems,o=e.onItemToggle,s=e.onToggle,u=e.timestamp,c=null,d="span",p=null;n&&(c=t?(0,Fe.jsx)(ga.Z,{style:{height:"13px",width:"12px"},className:Js}):(0,Fe.jsx)(pi.Z,{style:{height:"13px",width:"12px"},className:Js}),d="a",p={"aria-checked":t,onClick:s,role:"switch"});var v=f.useMemo((function(){return i.map((function(e){var n,t=null===(n=Object.keys(e))||void 0===n?void 0:n.filter((function(e){return"timeUnixNano"!==e}));return{timestamp:parseInt(e.timeUnixNano)/1e3,fields:t.map((function(n){return{key:n,value:e[n]}}))}}))}),[i]);return(0,Fe.jsxs)(Mv,{children:[(0,Fe.jsxs)(d,(0,l.Z)((0,l.Z)({className:Ov},p),{},{children:[c," ",(0,Fe.jsxs)("strong",{children:["Events (",v.length,")"]})]})),t&&(0,Fe.jsxs)(Rv,{children:[(0,De.sortBy)(v,"timestamp").map((function(e,t){return(0,Fe.jsx)(Nv,{className:t0?[{key:"child_count",label:"Child Count:",value:l.childSpanCount}]:[]));return(0,Fe.jsxs)("div",{"data-testid":"span-detail-component",children:[(0,Fe.jsxs)(ah,{children:[(0,Fe.jsx)("h2",{className:Vs()(Ps),children:y}),(0,Fe.jsx)(oh,{children:(0,Fe.jsx)(qp,{theme:e.theme,className:Ws,divider:!0,items:N})})]}),(0,Fe.jsx)(Lp,{className:Hs,type:"horizontal"}),(0,Fe.jsxs)("div",{children:[(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)(Nv,{theme:e.theme,data:T,label:"Attributes",linksGetter:r,isOpen:v,onToggle:function(){return s(k)}}),Z.tags&&(0,Fe.jsx)(Nv,{theme:e.theme,className:Bs,data:Z.tags,label:"Resource",linksGetter:r,isOpen:h,onToggle:function(){return o(k)}})]}),(null===l||void 0===l||null===(n=l.events)||void 0===n?void 0:n.length)>0&&(0,Fe.jsx)(Lv,{linksGetter:r,logs:l.events,isOpen:g.isOpen,openedItems:g.openedItems,onToggle:function(){return a(k)},onItemToggle:function(e){return i(k,e)},timestamp:u}),C&&C.length>0&&(0,Fe.jsx)(Lv,{linksGetter:r,logs:C,isOpen:g.isOpen,openedItems:g.openedItems,onToggle:function(){return a(k)},onItemToggle:function(e){return i(k,e)},timestamp:u}),_&&_.length>0&&(0,Fe.jsx)(ih,{className:uh,headerClassName:ch,label:(0,Fe.jsx)(dh,{children:"Warnings"}),data:_,isOpen:m,onToggle:function(){return c(k)}}),D&&D.length&&(0,Fe.jsx)(ih,{label:"Stack trace",data:D,isOpen:b,TextComponent:function(e){var n,t,r;(null===(n=e.data)||void 0===n?void 0:n.length)>1?t=e.data.map((function(e,n){return"StackTrace ".concat(n+1,":\n").concat(e)})).join("\n"):t=null===(r=e.data)||void 0===r?void 0:r[0];return(0,Fe.jsx)(fh,{style:{cursor:"unset"},readOnly:!0,cols:10,rows:10,value:t})},onToggle:function(){return d(k)}}),I&&I.length>0&&(I.length>1||"CHILD_OF"!==I[0].refType)&&(0,Fe.jsx)(qv,{data:I,isOpen:x.isOpen,openedItems:x.openedItems,onToggle:function(){return f(k)},onItemToggle:function(e){return p(k,e)}}),(0,Fe.jsxs)(lh,{children:[(0,Fe.jsx)(sh,{"data-label":"SpanID:"})," ",k]})]})]})}var vh,hh,gh,mh,xh,bh,yh=function(e){var n;return" (".concat(null===(n=d()(e/1e3))||void 0===n?void 0:n.format("HH:mm:ss.SSS"),")")},Zh=jt.Z.span(vh||(vh=(0,r.Z)(['\n cursor: pointer;\n height: 100%;\n overflow: hidden;\n position: absolute;\n width: 100%;\n &::before {\n border-left: 4px solid;\n pointer-events: none;\n width: 1000px;\n }\n &::after {\n border-right: 1000px solid;\n border-color: inherit;\n cursor: pointer;\n opacity: 0.2;\n }\n\n /* border-color inherit must come AFTER other border declarations for accent */\n &::before,\n &::after {\n border-color: inherit;\n content: " ";\n position: absolute;\n height: 100%;\n }\n\n &:hover::after {\n opacity: 0.35;\n }\n']))),wh=jt.Z.div(hh||(hh=(0,r.Z)(["\n border: 1px solid ",";\n border-top: 3px solid;\n padding: 0.75rem;\n"])),(function(e){return e.theme.buttonBorder})),Sh=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(){var e;(0,Fa.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a=r?u=!0:r=null),u||(n.has(l)&&(r=s+1),i.push({span:o,isDetail:!1,spanIndex:a}),t.has(l)&&i.push({span:o,isDetail:!0,spanIndex:a}))}return i}(e.spans,n,t):[]})),Mh=(0,qa.Z)((function(e){var n=e.min,t=e.max,r=e.viewStart,i=e.viewEnd,a=t-n,o=n+r*a,l=t-(1-i)*a-o;return function(e,n){return{start:(e-o)/l,end:(n-o)/l}}}),De.isEqual),Eh=(0,qa.Z)((function(e){var n=(0,u.Z)(e,2);return{left:n[0]>0,right:n[1]<1}}),De.isEqual),Rh=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e)).listView=void 0,r.topTraceViewRef=(0,f.createRef)(),r.getViewRange=function(){return r.props.currentViewRangeTime},r.getSearchedSpanIDs=function(){return r.props.findMatchesIDs},r.getCollapsedChildren=function(){return r.props.childrenHiddenIDs},r.mapRowIndexToSpanIndex=function(e){return r.getRowStates()[e].spanIndex},r.mapSpanIndexToRowIndex=function(e){for(var n=r.getRowStates().length,t=0;t=0)null===(n=r.listView)||void 0===n||n.scrollToIndex(t)}},r.scrollToTop=function(){var e,n=r.props.topOfViewRef;null===n||void 0===n||null===(e=n.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},(0,e.setTrace)(e.trace,e.uiFind),r}return(0,Ba.Z)(t,[{key:"componentDidMount",value:function(){this.scrollToSpan(this.props.focusedSpanId)}},{key:"shouldComponentUpdate",value:function(e){for(var n=Object.keys(e),t=0;tt;r++)if(vu(e[r]))return!0;return!1}(h.spans,n),D=null;if(k){var N=function(e){if(e.length<=1||!cu(e[0]))return!1;for(var n=e[0].depth+1,t=1;t-1};if(null==e)return function(){return!0};throw new Error("Invalid value: ".concat(e))}var ag=function(e){return e};function og(e,n){if(n)return n.find((function(n){return n.key===e}))}function lg(e,n){return e.template(n)}function sg(e,n,t,r){var i=t[r],a="logs",l=n.process.tags===t;l&&(a="process"),n.tags===t&&(a="tags");var s=[];return e.forEach((function(e){if(e.type(a)&&e.key(i.key)&&e.value(i.value)){var r={},u=e.parameters.every((function(s){var u=og(s,t);return u||l||(u=function(e,n){for(var t=n;t;){var r=og(e,t.tags)||og(e,t.process.tags);if(r)return r;t=$h(t)}}(s,n)),u?(r[s]=u.value,!0):(console.warn(o().sanitize("Skipping link pattern, missing parameter ".concat(s," for key ").concat(i.key," in ").concat(a,".")),e.object),!1)}));u&&s.push({url:lg(e.url,r),text:lg(e.text,r)})}})),s}var ug,cg,dg,fg=(ug="linkPatterns",(0,De.get)(Xh,ug)||[]).map((function(e){try{var n=rg(e.url,encodeURIComponent),t=rg(e.text,ag);return{object:e,type:ig(e.type),key:ig(e.key),value:ig(e.value),url:n,text:t,parameters:(0,De.uniq)(n.parameters.concat(t.parameters))}}catch(r){return console.error("Ignoring invalid link pattern: ".concat(r),e),null}})).filter(Boolean),pg=(0,Kh.Z)(10)((function(e){return e?function(e,n){var t=[],r=Object.keys(n).filter((function(e){return"string"===typeof n[e]||"number"===n[e]}));return e.filter((function(e){return e.type("traces")})).forEach((function(e){var i={};e.parameters.every((function(e){var t=e;return!!r.includes(t)&&(i[e]=n[t],!0)}))&&t.push({url:lg(e.url,i),text:lg(e.text,i)})})),t}(fg,e):[]}));cg=fg,dg=new WeakMap;var vg,hg=(0,De.memoize)((function(e){for(var n,t=new Set(e.map((function(e){return e.spanID}))),r=function(r){if(e[r].references&&e[r].references.some((function(n){var i=n.traceID,a=n.spanID;return i===e[r].traceID&&t.has(a)})))return"continue";if(!n)return n=e[r],"continue";var i=e[r].references&&e[r].references.length||0,a=n.references&&n.references.length||0;(i .scrubber-handle-expansion {\n fill-opacity: 1;\n }\n &:hover > .scrubber-handle {\n fill: #44f;\n }\n &:hover + .scrubber.line {\n stroke: #44f;\n }\n"]))),Bg=Vs()((0,ze.iv)(Mg||(Mg=(0,r.Z)(["\n cursor: col-resize;\n fill: #555;\n "]))),"scrubber-handle"),Hg=(0,ze.iv)(Eg||(Eg=(0,r.Z)(["\n & .scrubber-handle-expansion {\n fill-opacity: 1;\n }\n & .scrubber-handle {\n fill: #44f;\n }\n & > .scrubber-line {\n stroke: #44f;\n }\n"]))),Pg=Vs()((0,ze.iv)(Rg||(Rg=(0,r.Z)(["\n cursor: col-resize;\n fill-opacity: 0;\n fill: #44f;\n "]))),"scrubber-handle-expansion"),qg=Vs()((0,ze.iv)(Og||(Og=(0,r.Z)(["\n pointer-events: none;\n stroke: #555;\n "]))),"scrubber-line");function Ag(e){var n=e.isDragging,t=e.onMouseDown,r=e.onMouseEnter,i=e.onMouseLeave,a=e.position,o="".concat(100*a,"%"),l=Vs()((0,B.Z)({},Hg,n));return(0,Fe.jsxs)("g",{className:l,"data-testid":"scrubber-component",children:[(0,Fe.jsxs)(Fg,{"data-testid":"scrubber-component-g",onMouseDown:t,onMouseEnter:r,onMouseLeave:i,children:[(0,Fe.jsx)("rect",{"data-testid":"scrubber-component-rect-1",x:o,className:Pg,style:{transform:"translate(-4.5px)"},width:"9",height:"20"}),(0,Fe.jsx)("rect",{"data-testid":"scrubber-component-rect-2",x:o,className:Bg,style:{transform:"translate(-1.5px)"},width:"3",height:"20"})]}),(0,Fe.jsx)("line",{className:qg,y2:"100%",x1:o,x2:o,"data-testid":"scrubber-component-line"})]})}var Qg,Wg,Ug,Jg,Gg,Kg,Yg,Xg,$g=t(1568),em="JaegerUiComponents__ViewingLayerResetZoomHoverClassName",nm=(0,Lg.iv)(Qg||(Qg=(0,r.Z)(["\n display: none;\n position: absolute;\n right: 1%;\n top: 10%;\n z-index: 1;\n background-color: hsla(210, 12%, 16%, 16%);\n color: hsl(210, 12%, 16%);\n &:hover {\n background-color: hsla(210, 12%, 16%, 20%);\n color: hsl(210, 12%, 16%);\n \n }\n"]))),tm=jt.Z.div(Wg||(Wg=(0,r.Z)(["\n cursor: vertical-text;\n position: relative;\n z-index: 1;\n &:hover > ."," {\n display: unset;\n }\n"])),em),rm=jt.Z.svg(Ug||(Ug=(0,r.Z)(["\n border: 1px solid ",";\n /* need !important here to overcome something from semantic UI */\n overflow: visible !important;\n position: relative;\n transform-origin: 0 0;\n width: 100%;\n"])),(function(e){return e.theme.buttonBorder})),im=jt.Z.div(Jg||(Jg=(0,r.Z)(["\n bottom: 0;\n cursor: col-resize;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n user-select: none;\n"]))),am=jt.Z.rect(Gg||(Gg=(0,r.Z)(["\n fill: rgba(214, 214, 214, 0.5);\n"]))),om=jt.Z.line(Kg||(Kg=(0,r.Z)(["\n stroke: #f44;\n stroke-width: 1;\n"]))),lm=jt.Z.rect(Yg||(Yg=(0,r.Z)(["\n fill: #44f;\n"]))),sm=jt.Z.rect(Xg||(Xg=(0,r.Z)(["\n fill-opacity: 0.2;\n fill: #44f;\n"]))),um={SHIFT_END:"SHIFT_END",SHIFT_START:"SHIFT_START",REFRAME:"REFRAME"};var cm=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(e){var r;return(0,Fa.Z)(this,t),(r=n.call(this,e)).state=void 0,r._root=void 0,r._draggerReframe=void 0,r._draggerStart=void 0,r._draggerEnd=void 0,r._setRoot=function(e){r._root=e},r._getDraggingBounds=function(e){if(!r._root)throw new Error("invalid state");var n=r._root.getBoundingClientRect(),t=n.left,i=n.width,a=(0,u.Z)(r.props.viewRange.time.current,2),o=a[0],l=a[1],s=1,c=0;return e===um.SHIFT_START?s=l:e===um.SHIFT_END&&(c=o),{clientXLeft:t,maxValue:s,minValue:c,width:i}},r._handleReframeMouseMove=function(e){var n=e.value;r.props.updateNextViewRangeTime({cursor:n})},r._handleReframeMouseLeave=function(){r.props.updateNextViewRangeTime({cursor:null})},r._handleReframeDragUpdate=function(e){var n=e.value,t=r.props.viewRange.time,i={reframe:{anchor:t.reframe?t.reframe.anchor:n,shift:n}};r.props.updateNextViewRangeTime(i)},r._handleReframeDragEnd=function(e){var n=e.manager,t=e.value,i=r.props.viewRange.time,a=i.reframe?i.reframe.anchor:t,o=t0&&(0,$g.tZ)(am,{x:0,y:0,height:"100%",width:"".concat(g,"%")}),x>0&&(0,$g.tZ)(am,{x:"".concat(100-x,"%"),y:0,height:"100%",width:"".concat(x,"%")}),(0,$g.tZ)(zg,{numTicks:r}),m&&(0,$g.tZ)(om,{x1:m,y1:"0",x2:m,y2:n-2,strokeWidth:"1"}),null!=s&&this._getMarkers(v,s),null!=c&&this._getMarkers(h,c),(0,$g.tZ)(Ag,{isDragging:null!=s,onMouseDown:this._draggerStart.handleMouseDown,onMouseEnter:this._draggerStart.handleMouseEnter,onMouseLeave:this._draggerStart.handleMouseLeave,position:v||0}),(0,$g.tZ)(Ag,{isDragging:null!=c,position:h||1,onMouseDown:this._draggerEnd.handleMouseDown,onMouseEnter:this._draggerEnd.handleMouseEnter,onMouseLeave:this._draggerEnd.handleMouseLeave}),null!=d&&this._getMarkers(d.anchor,d.shift)]}),f&&(0,$g.tZ)(im,{})]})}}]),t}(f.PureComponent);function dm(e){return{valueOffset:e.relativeStartTime,valueWidth:e.duration,serviceName:e.process.serviceName}}var fm=(0,qa.Z)((function(e){return e.spans.map(dm)})),pm=function(e){(0,Ha.Z)(t,e);var n=(0,Pa.Z)(t);function t(){return(0,Fa.Z)(this,t),n.apply(this,arguments)}return(0,Ba.Z)(t,[{key:"render",value:function(){var e=this.props,n=e.height,t=e.trace,r=e.viewRange,i=e.updateNextViewRangeTime,a=e.updateViewRangeTime;if(!t)return(0,Fe.jsx)("div",{});var o=fm(t);return(0,Fe.jsxs)("div",{className:Vs()(As,qs),children:[(0,Fe.jsx)(Ig,{theme:this.props.theme,numTicks:4,duration:t.duration}),(0,Fe.jsxs)("div",{className:zs,children:[(0,Fe.jsx)(Cg,(0,l.Z)((0,l.Z)({},this.props),{},{valueWidth:t.duration,items:o})),(0,Fe.jsx)(cm,{theme:this.props.theme,viewRange:r,numTicks:4,height:n||60,updateViewRangeTime:a,updateNextViewRangeTime:i})]})]})}}]),t}(f.PureComponent);pm.defaultProps={height:60};var vm,hm,gm,mm,xm,bm,ym,Zm,wm,Sm,jm=["renderer"],km=jt.Z.header(vm||(vm=(0,r.Z)(["\n & > :first-of-type {\n border-bottom: 1px solid ",";\n }\n & > :nth-of-type(2) {\n background-color: ",";\n border-bottom: 1px solid ",";\n }\n & > :last-child {\n border-bottom: 1px solid ",";\n }\n"])),(function(e){var n=e.theme;return null===n||void 0===n?void 0:n.buttonBorder}),(function(e){var n;return null===e||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.widgetContainer}),(function(e){var n;return null===e||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.buttonBorder}),(function(e){var n;return null===e||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.widgetContainer})),Cm=jt.Z.div(hm||(hm=(0,r.Z)(["\n align-items: center;\n display: flex;\n"]))),Tm=(0,ze.iv)(gm||(gm=(0,r.Z)(["\n align-items: center;\n align-self: stretch;\n background: inherit;\n background-color: #fafafa;\n border-bottom: 1px solid #ddd;\n border-right: 1px solid #ddd;\n color: inherit;\n display: flex;\n font-size: 1.4rem;\n padding: 0 1rem;\n margin-bottom: -1px;\n &:hover {\n background-color: #f0f0f0;\n border-color: #ccc;\n }\n"]))),_m=(0,ze.iv)(mm||(mm=(0,r.Z)(["\n align-items: center;\n display: flex;\n flex: 1;\n\n &:hover * {\n text-decoration: underline;\n }\n &:hover > *,\n &:hover small {\n text-decoration: none;\n }\n /* Adapt styles when changing from a element into button */\n background: transparent;\n text-align: left;\n border: none;\n"]))),Im=(0,ze.iv)(xm||(xm=(0,r.Z)(["\n font-size: 2.5rem;\n transition: transform 0.07s ease-out;\n"]))),Dm=(0,ze.iv)(bm||(bm=(0,r.Z)(["\n transform: rotate(90deg);\n"]))),Nm=function(e){return(0,ze.iv)(ym||(ym=(0,r.Z)(["\n color: ",";\n flex: 1;\n font-size: 14px;\n font-weight: bold;\n line-height: 1em;\n margin: 0 0 0 0.5em;\n padding:10px 0px;\n"])),e)},Mm=(0,ze.iv)(Zm||(Zm=(0,r.Z)(["\n margin-left: 0;\n"]))),Em=(0,ze.iv)(wm||(wm=(0,r.Z)(["\n border-bottom: 1px solid #e4e4e4;\n padding: 0.25rem 0.5rem !important;\n"]))),Rm=jt.Z.small(Sm||(Sm=(0,r.Z)(["\n white-space: nowrap;\n font-size: 80%;\n"]))),Om=[{key:"timestamp",label:"Trace Start:",renderer:function(e){return d()((null===e||void 0===e?void 0:e.startTime)/1e3).format("YYYY-MM-DDTHH:mm:ss.SSSZ")}},{key:"duration",label:"Duration:",renderer:function(e){return su(e.duration)}},{key:"service-count",label:"Services:",renderer:function(e){return new Set((0,De.values)(e.services).map((function(e){return e.name}))).size}},{key:"depth",label:"Depth:",renderer:function(e){return(0,De.get)((0,De.maxBy)(e.spans,"depth"),"depth",0)+1}},{key:"span-count",label:"Total Spans:",renderer:function(e){var n;return null===e||void 0===e||null===(n=e.spans)||void 0===n?void 0:n.length}}];function Lm(e){var n,t,r=e.canCollapse,i=e.hideMap,a=e.hideSummary,o=e.onSlimViewClicked,s=e.slimView,u=e.trace,c=e.updateNextViewRangeTime,d=e.updateViewRangeTime,p=e.viewRange,v=(0,I.u)(),h=f.useMemo((function(){return u?pg(u):[]}),[u]);if(!u)return null;var g=!a&&!s&&Om.map((function(e){var n=e.renderer,t=(0,Vo.Z)(e,jm);return(0,l.Z)((0,l.Z)({},t),{},{value:n(u)})})),m=(0,Fe.jsxs)("h1",{style:{color:null===e||void 0===e||null===(n=e.theme)||void 0===n?void 0:n.textColor},className:Vs()(Nm(null===e||void 0===e||null===(t=e.theme)||void 0===t?void 0:t.textColor),r&&Mm),children:[(0,Fe.jsx)(Gh,{traceName:hg(u.spans)})," ",(0,Fe.jsx)(Rm,{className:Ys,children:u.traceID})]});return(0,Fe.jsxs)(km,{theme:e.theme,children:[(0,Fe.jsxs)(Cm,{children:[h&&h.length>0&&(0,Fe.jsx)(qh,{links:h,className:Tm}),r?(0,Fe.jsxs)("button",{type:"button",className:_m,onClick:o,role:"switch","aria-checked":!s,children:[(0,Fe.jsx)(mt.Z,{className:Vs()(Im,!s&&Dm)}),m]}):m]}),g&&(0,Fe.jsx)(qp,{theme:e.theme,className:Em,items:g}),!i&&!s&&(0,Fe.jsx)(pm,(0,l.Z)((0,l.Z)({},e),{},{theme:v,trace:u,viewRange:p,updateNextViewRangeTime:c,updateViewRangeTime:d}))]})}var Vm=function(){function e(n){(0,Fa.Z)(this,e),this.isTagsOpen=void 0,this.isEventsOpen=void 0,this.isProcessOpen=void 0,this.logs=void 0,this.events=void 0,this.references=void 0,this.isWarningsOpen=void 0,this.isStackTracesOpen=void 0,this.isReferencesOpen=void 0;var t=n||{},r=t.isTagsOpen,i=t.isEventsOpen,a=t.isProcessOpen,o=t.isReferencesOpen,l=t.isWarningsOpen,s=t.isStackTracesOpen,u=t.logs,c=t.references,d=t.events;this.isTagsOpen=Boolean(r),this.isEventsOpen=Boolean(i),this.isProcessOpen=Boolean(a),this.isReferencesOpen=Boolean(o),this.isWarningsOpen=Boolean(l),this.isStackTracesOpen=Boolean(s),this.logs={isOpen:Boolean(u&&u.isOpen),openedItems:u&&u.openedItems?new Set(u.openedItems):new Set},this.events={isOpen:Boolean(d&&d.isOpen),openedItems:d&&d.openedItems?new Set(d.openedItems):new Set},this.references={isOpen:Boolean(c&&c.isOpen),openedItems:c&&c.openedItems?new Set(c.openedItems):new Set}}return(0,Ba.Z)(e,[{key:"toggleTags",value:function(){var n=new e(this);return n.isTagsOpen=!this.isTagsOpen,n}},{key:"toggleEvents",value:function(){var n=new e(this);return n.isEventsOpen=!this.isEventsOpen,n}},{key:"toggleEventItem",value:function(n){var t=new e(this);return t.events.openedItems.has(n)?t.events.openedItems.delete(n):t.events.openedItems.add(n),t}},{key:"toggleProcess",value:function(){var n=new e(this);return n.isProcessOpen=!this.isProcessOpen,n}},{key:"toggleReferences",value:function(){var n=new e(this);return n.references.isOpen=!this.references.isOpen,n}},{key:"toggleReferenceItem",value:function(n){var t=new e(this);return t.references.openedItems.has(n)?t.references.openedItems.delete(n):t.references.openedItems.add(n),t}},{key:"toggleWarnings",value:function(){var n=new e(this);return n.isWarningsOpen=!this.isWarningsOpen,n}},{key:"toggleStackTraces",value:function(){var n=new e(this);return n.isStackTracesOpen=!this.isStackTracesOpen,n}},{key:"toggleLogs",value:function(){var n=new e(this);return n.logs.isOpen=!this.logs.isOpen,n}},{key:"toggleLogItem",value:function(n){var t=new e(this);return t.logs.openedItems.has(n)?t.logs.openedItems.delete(n):t.logs.openedItems.add(n),t}}]),e}(),zm=t(35323),Fm=function(){function e(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];(0,Fa.Z)(this,e),this.value=void 0,this.children=void 0,this.value=n,this.children=t}return(0,Ba.Z)(e,[{key:"depth",get:function(){return this.children.reduce((function(e,n){return Math.max(n.depth+1,e)}),1)}},{key:"size",get:function(){var e=0;return this.walk((function(){return e++})),e}},{key:"addChild",value:function(n){return this.children.push(n instanceof e?n:new e(n)),this}},{key:"find",value:function(n){if(e.iterFunction(e.searchFunction(n))(this))return this;for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0;for(n.push({node:this,depth:t});n.length;){var r=n.pop(),i=r.node,a=r.depth;e(i.value,i,a),t=a+1;for(var o=i.children.length-1;o>=0;)n.push({node:i.children[o],depth:t}),o--}}}],[{key:"iterFunction",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(t){return e(t.value,t,n)}}},{key:"searchFunction",value:function(n){return"function"===typeof n?n:function(t,r){return n instanceof e?r===n:t===n}}}]),e}();var Bm=function(e){return e.serviceName},Hm=t(31507),Pm=t.n(Hm),qm=function(e){return e.spanID},Am=function(e){return e.operationName},Qm=function(e){return e.duration},Wm=function(e){return e.startTime},Um=function(e){return e.processID},Jm=(0,zm.P1)((0,zm.P1)((function(e){return e.span}),(function(e){return e.references||[]})),(function(e){return e.type}),(function(e,n){return e.find((function(e){return e.refType===n}))})),Gm=((0,zm.P1)((function(e){return Jm({span:e,type:"CHILD_OF"})}),(function(e){return e?e.spanID:null})),(0,zm.P1)((function(e){if(!e.process)throw new Error("\n you must hydrate the spans with the processes, perhaps\n using hydrateSpansWithProcesses(), before accessing a span's process\n ");return e.process}),Bm)),Km=((0,zm.P1)((function(e){return e.spans}),(function(e){return e.leftBound}),(function(e){return e.rightBound}),(function(e,n,t){return e.filter((function(e){return Wm(e)>=n&&Wm(e)<=t}))})),(0,zm.P1)((function(e){return e.spans}),(function(e){return e.text}),(function(e,n){return Pm().filter(n,e,{extract:function(e){return"".concat(Gm(e)," ").concat(Am(e))}}).map((function(e){return e.original}))}))),Ym=(0,zm.P1)(Km,(function(e){return e.reduce((function(e,n){return(0,l.Z)((0,l.Z)({},e),{},(0,B.Z)({},qm(n),n))}),{})})),Xm=((0,zm.P1)((function(e){return e.spans}),Ym,(function(e,n){return e.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{muted:!n[qm(e)]})}))})),function(e){return e.spans}),$m=function(e){return e.processes},ex=(0,zm.P1)((function(e){return e.span}),(function(e){return e.processes}),(function(e,n){return(0,l.Z)((0,l.Z)({},e),{},{process:n[Um(e)]})})),nx=(0,zm.P1)(Xm,(function(e){return e.reduce((function(e,n){return e.set(qm(n),n)}),new Map)})),tx="__root__";function rx(e){var n=new Map(e.spans.map((function(e){return[e.spanID,new Fm(e.spanID)]}))),t=new Map(e.spans.map((function(e){return[e.spanID,e]}))),r=new Fm(tx);e.spans.forEach((function(e){var t=n.get(e.spanID);if(Array.isArray(e.references)&&e.references.length){var i=e.references[0],a=i.refType,o=i.spanID;if("CHILD_OF"!==a&&"FOLLOWS_FROM"!==a)throw new Error("Unrecognized ref type: ".concat(a));(n.get(o)||r).children.push(t)}else r.children.push(t)}));var i=function(e,n){var r=t.get(e.value),i=t.get(n.value);return+(r.startTime>i.startTime)||+(r.startTime===i.startTime)-1};return e.spans.forEach((function(e){var t=n.get(e.spanID);t.children.length>1&&t.children.sort(i)})),r.children.sort(i),r}(0,zm.P1)(Xm,(function(e){return e.length}));var ix=(0,zm.P1)(Xm,(function(e){return e.reduce((function(e,n){return e?Math.min(e,Wm(n)):Wm(n)}),null)})),ax=(0,zm.P1)(Xm,ix,(function(e,n){return e.reduce((function(e,t){return e?Math.max(Wm(t)-n+Qm(t),e):Qm(t)}),null)})),ox=((0,zm.P1)(ix,ax,(function(e,n){return e+n})),(0,zm.P1)(rx,nx,(function(e,n){return e.children.map((function(e){return n.get(e.value)})).sort((function(e,n){return t=Wm(e),r=Wm(n),t-r;var t,r}))[0]}))),lx=((0,zm.P1)(rx,(function(e){return e.depth-1})),(0,zm.P1)((0,zm.P1)((function(e){return e.trace}),rx),(0,zm.P1)((function(e){return e.span}),qm),(function(e,n){return e.getPath(n).length-1})),(0,zm.P1)($m,(function(e){return Object.keys(e).reduce((function(n,t){return n.add(Bm(e[t]))}),new Set)}))),sx=((0,zm.P1)(lx,(function(e){return e.size})),{ms:function(e){var n=lu(e,au,eu);return"".concat($s().duration(n/eu).asMilliseconds(),"ms")},s:function(e){var n=lu(e,au,nu);return"".concat($s().duration(n/eu).asSeconds(),"s")}}),ux=(0,zm.P1)(ax,(function(e){return e>=nu?sx.s:sx.ms})),cx=((0,zm.P1)((function(e){return e.duration}),(function(e){var n=e.unit;return sx[n]}),(function(e,n){return n(e)})),(0,zm.P1)((function(e){return e.duration}),(0,zm.P1)((function(e){return e.trace}),ux),(function(e,n){return n(e)})),(0,zm.P1)((function(e){return e.trace}),(function(e){return e.spans}),(function(e){return e.sort}),(function(e,n,t){var r=t.dir,i=t.comparator,a=t.selector;return(0,H.Z)(n).sort((function(n,t){return r*i(a(n,e),a(t,e))}))})),(0,zm.P1)(rx,(function(e){var n=new Map,t=0;return e.walk((function(e){return n.set(e,t++)})),n})));(0,zm.P1)((0,zm.P1)((function(e){return e.trace}),rx),(0,zm.P1)((function(e){return e.span}),qm),(function(e,n){var t=e.find(n);return t?t.size-1:-1})),(0,zm.P1)((0,zm.P1)((function(e){return e.trace}),cx),(function(e){return e.span}),(function(e,n){return e.get(qm(n))})),(0,zm.P1)((0,zm.P1)((0,zm.P1)((function(e){var n=Xm(e),t=$m(e);return(0,l.Z)((0,l.Z)({},e),{},{spans:n.map((function(e){return ex({span:e,processes:t})}))})}),ox),(0,zm.zB)({name:Am,serviceName:Gm})),(function(e){var n=e.name,t=e.serviceName;return"".concat(t,": ").concat(n)})),(0,zm.P1)((function(e){return e.spans}),(0,zm.P1)((function(e){return e.trace}),rx),(function(e){return e.collapsed}),(function(e,n,t){var r=t.reduce((function(e,t){return n.find(t).walk((function(n){return n!==t&&e.add(n)})),e}),new Set);return r.size>0?e.filter((function(e){return!r.has(qm(e))})):e})),(0,zm.P1)((function(e){return e.trace}),(function(e){var n=e.interval;return void 0===n?4:n}),(function(e){var n=e.width;return void 0===n?3:n}),(function(e,n,t){return(0,H.Z)((n+1).keys()).map((function(r){return{timestamp:ix(e)+ax(e)*(r/n),width:t}}))})),(0,zm.P1)((function(e){return e}),Xm,(function(e,n){var t=new Map;return(0,l.Z)((0,l.Z)({},e),{},{spans:n.reduce((function(e,n){var r=t.has(qm(n))?"".concat(qm(n),"_").concat(t.get(qm(n))):qm(n),i=(0,l.Z)((0,l.Z)({},n),{},{spanID:r});return r!==qm(n)&&console.warn("duplicate spanID in trace replaced",qm(n),"new:",r),t.set(qm(n),(t.get(qm(n))||0)+1),e.concat([i])}),[])})})),(0,zm.P1)((function(e){return e}),Xm,(function(e,n){return(0,l.Z)((0,l.Z)({},e),{},{spans:n.filter((function(e){return!!Wm(e)}))})}));function dx(e,n,t){return function(r){var i=n.get(r);if(i){var a;a="tags"===e?i.toggleTags():"process"===e?i.toggleProcess():"events"===e?i.toggleEvents():"warnings"===e?i.toggleWarnings():"references"===e?i.toggleReferences():"stackTraces"===e?i.toggleStackTraces():i.toggleLogs();var o=new Map(n);o.set(r,a),t(o)}}}function fx(e,n){return e.filter((function(e){return e.hasChildren})).length===n.size}var px;function vx(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;e.forEach((function(t){var r;t.depth=n,(null===(r=t.children)||void 0===r?void 0:r.length)>0&&(n+=1,t.children.forEach((function(r){t.spanID===r&&vx(e,n)})))}))}function hx(e){var n,t=function(e){var n;return(null===(n=e.resourceSpans)||void 0===n?void 0:n.map((function(e){var n=e.resource;return e.instrumentationLibrarySpans.map((function(e){return e.spans.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{resource:n})}))}))}))).flat(2)}(e);return null===e||void 0===e||null===(n=e.resourceSpans)||void 0===n?void 0:n.map((function(e){var n,r,i,a,o,s=e.instrumentationLibrarySpans,u=t.find((function(e){return-1===Object.keys(e).indexOf("parentSpanId")})),c=(0,H.Z)(t),d=null===c||void 0===c?void 0:c.sort((function(e,n){return parseInt(e.startTimeUnixNano)-parseInt(n.startTimeUnixNano)})),f=(null===(n=d[0])||void 0===n?void 0:n.startTimeUnixNano)/1e3,p=(null===(r=d.map((function(e){return e.endTimeUnixNano})))||void 0===r||null===(i=r.sort())||void 0===i?void 0:i.reverse())[0]/1e3,v=null===t||void 0===t?void 0:t.map((function(e,n){var t,r,i,a=null===(t=e.attributes)||void 0===t?void 0:t.map((function(e){var n;return{key:null===e||void 0===e?void 0:e.key,value:null===e||void 0===e||null===(n=e.value)||void 0===n?void 0:n.stringValue}})),o=null===e||void 0===e||null===(r=e.resource)||void 0===r||null===(i=r.attributes)||void 0===i?void 0:i.map((function(e){var n;return{key:null===e||void 0===e?void 0:e.key,value:null===e||void 0===e||null===(n=e.value)||void 0===n?void 0:n.stringValue}})),l=Math.round((null===e||void 0===e?void 0:e.endTimeUnixNano)/1e3)-Math.round((null===e||void 0===e?void 0:e.startTimeUnixNano)/1e3),s=(null===e||void 0===e?void 0:e.startTimeUnixNano)/1e3,u={serviceName:null===e||void 0===e?void 0:e.serviceName,tags:o};return{traceID:(null===e||void 0===e?void 0:e.traceID)||(null===e||void 0===e?void 0:e.traceId),spanID:(null===e||void 0===e?void 0:e.spanID)||e.spanId,parentSpanID:(null===e||void 0===e?void 0:e.parentSpanID)||(null===e||void 0===e?void 0:e.parentSpanId)||"",operationName:null===e||void 0===e?void 0:e.name,serviceName:null===e||void 0===e?void 0:e.serviceName,serviceTags:o,startTime:s,duration:l,relativeStartTime:0,events:(null===e||void 0===e?void 0:e.events)||[],logs:[],references:[],tags:a,processID:null===e||void 0===e?void 0:e.spanID,flags:0,dataFrameRowIndex:n,process:u,children:[]}}));if((null===(a=v)||void 0===a?void 0:a.length)>0)try{v.forEach((function(e){var n,t=null===(n=v)||void 0===n?void 0:n.some((function(n){return(null===n||void 0===n?void 0:n.spanID)===(null===e||void 0===e?void 0:e.parentSpanID)}));if(""!==(null===e||void 0===e?void 0:e.parentSpanID)&&t){var r,i,a,o,s=null===(r=v)||void 0===r?void 0:r.find((function(n){return n.spanID===e.parentSpanID}));s&&(v=null===(i=v)||void 0===i||null===(a=i.map((function(n){return n.spanID===s.spanID?(0,l.Z)((0,l.Z)({},n),{},{children:[].concat((0,H.Z)(n.children),[e.spanID])}):n})))||void 0===a?void 0:a.map((function(e){var n;return(null===e||void 0===e||null===(n=e.children)||void 0===n?void 0:n.length)>0?(0,l.Z)((0,l.Z)({},e),{},{hasChildren:!0,childSpanCount:e.children.length,relativeStartTime:e.startTime-v[0].startTime}):(0,l.Z)((0,l.Z)({},e),{},{relativeStartTime:e.startTime-v[0].startTime})}))),null===e||void 0===e||null===(o=e.references)||void 0===o||o.push({refType:"CHILD_OF",spanID:s.spanID,traceID:s.traceID,span:(0,l.Z)({},s)})}}))}catch(y){console.log(y)}vx(v);var h={services:[],spans:[],traceID:"",traceName:"",processes:{},duration:0,startTime:0,endTime:0},g=null===(o=v)||void 0===o?void 0:o[0];if(s&&p&&f){var m=g.serviceName,x=g.name,b=g.traceID;h={services:v.map((function(e){return{name:e.serviceName,numberOfSpans:v.length}})),spans:v,traceID:u?null===u||void 0===u?void 0:u.traceID:b,traceName:u?"".concat(null===u||void 0===u?void 0:u.serviceName,": ").concat(null===u||void 0===u?void 0:u.name):"".concat(m,": ").concat(x),processes:{},duration:p-f,startTime:f,endTime:p}}return h}))}var gx,mx,xx,bx,yx,Zx,wx,Sx=jt.Z.div(px||(px=(0,r.Z)(["\n margin: 4px;\n padding: 5px;\n margin-top:0px;\n border: 1px solid ",";\n border-radius: 3px;\n display:flex;\n flex-direction:column;\n flex:",";\n \n height: ",";\n .view-content {\n margin:3px;\n height: ",";\n display: ",";\n flex-direction: ",";\n flex:1;\n }\n"])),(function(e){var n;return null===(n=e.theme)||void 0===n?void 0:n.buttonBorder}),(function(e){return"min"===e.size?0:1}),(function(e){var n,t;return"regular"===e.size?null===e||void 0===e||null===(n=e.vheight)||void 0===n?void 0:n.regularCont:"max"===(null===e||void 0===e?void 0:e.size)?null===e||void 0===e||null===(t=e.vheight)||void 0===t?void 0:t.maxCont:"20px"}),(function(e){var n,t;return"regular"===e.size?null===e||void 0===e||null===(n=e.vheight)||void 0===n?void 0:n.regularView:"max"===(null===e||void 0===e?void 0:e.size)?null===e||void 0===e||null===(t=e.vheight)||void 0===t?void 0:t.maxView:"0px"}),(function(e){return"min"===e.size?"none":(null===e||void 0===e||e.size,"flex")}),(function(e){return null===e||void 0===e||e.size,"column"}));function jx(){return{}}function kx(e){var n=e.viewRef,t=e.panelSize,r=e.viewHeight,i=e.setStreamClose,a=e.setMaxHeight,o=e.setMinimize,s=e.actualQuery,c=e.total,d=e.type,p=e.dataView.data,v=(0,f.useMemo)((function(){return hx(p)[0]}),[p]),h=(0,hi.F)(),g=(0,f.useMemo)((function(){var e,n;if((null===v||void 0===v||null===(e=v.spans)||void 0===e?void 0:e.length)>0){var t=(n=v.spans,[{name:"traceID",type:"string",typeInfo:{frame:"string"}},{name:"spanID",type:"string",typeInfo:{frame:"string"}},{name:"parentSpanID",type:"string",typeInfo:{frame:"string"}},{name:"operationName",type:"string",typeInfo:{frame:"string"}},{name:"serviceName",type:"string",typeInfo:{frame:"string"}},{name:"serviceTags",type:"other",typeInfo:{frame:"json.RawMessage"}},{name:"startTime",type:"number",typeInfo:{frame:"float64"}},{name:"duration",type:"number",typeInfo:{frame:"float64"}},{name:"logs",type:"other",typeInfo:{frame:"json.RawMessage"}},{name:"references",type:"other",typeInfo:{frame:"json.RawMessage"}},{name:"tags",type:"other",typeInfo:{frame:"json.RawMessage"}}].map((function(e){var t=e.name,r=e.type,i=e.typeInfo;return{name:t,type:r,typeInfo:i,config:{},values:null===n||void 0===n?void 0:n.map((function(e){return e[t]})),entities:{},state:null}})));return{name:"Trace",refId:(null===s||void 0===s?void 0:s.idRef)||"Traces",fields:t,length:null===t||void 0===t?void 0:t.length}}return null}),[v,s]),m={traceProp:(0,l.Z)({},v)}.traceProp,x=function(){var e=(0,f.useState)(new Set),n=(0,u.Z)(e,2),t=n[0],r=n[1];return{hoverIndentGuideIds:t,addHoverIndentGuideId:(0,f.useCallback)((function(e){r((function(n){var t=new Set(n);return t.add(e),t}))}),[]),removeHoverIndentGuideId:(0,f.useCallback)((function(e){r((function(n){var t=new Set(n);return t.delete(e),t}))}),[])}}(),b=x.removeHoverIndentGuideId,y=x.addHoverIndentGuideId,Z=x.hoverIndentGuideIds,w=function(){var e=(0,f.useState)({time:{current:[0,1]}}),n=(0,u.Z)(e,2),t=n[0],r=n[1],i=(0,f.useCallback)((function(e){r((function(n){var t=(0,l.Z)((0,l.Z)({},n.time),e);return(0,l.Z)((0,l.Z)({},n),{},{time:t})}))}),[]);return{viewRange:t,updateViewRangeTime:(0,f.useCallback)((function(e,n){var t={current:[e,n]};r((function(e){return(0,l.Z)((0,l.Z)({},e),{},{time:t})}))}),[]),updateNextViewRangeTime:i}}(),S=w.viewRange,j=w.updateViewRangeTime,k=w.updateNextViewRangeTime,C=function(){var e=(0,f.useState)(new Set),n=(0,u.Z)(e,2),t=n[0],r=n[1],i=(0,f.useCallback)((function(e){if(0!==t.size){var n=-1,i=!0,a=e.reduce((function(e,t){return t.depth<=n&&(i=!0),i&&e.has(t.spanID)&&(e.delete(t.spanID),i=!1,n=t.depth),e}),new Set(t));r(a)}}),[t]),a=(0,f.useCallback)((function(e){if(!fx(e,t)){var n,i=e.reduce((function(e,t){return n&&t.depth<=n.depth?(e.add(n.spanID),t.hasChildren&&(n=t)):t.hasChildren&&!e.has(t.spanID)&&(n=t),e}),new Set(t));n&&i.add(n.spanID),r(i)}}),[t]),o=(0,f.useCallback)((function(){r(new Set)}),[]),l=(0,f.useCallback)((function(e){if(!fx(e,t)){var n=e.reduce((function(e,n){return n.hasChildren&&e.add(n.spanID),e}),new Set);r(n)}}),[t]),s=(0,f.useCallback)((function(e){var n=new Set(t);t.has(e)?n.delete(e):n.add(e),r(n)}),[t]);return{childrenHiddenIDs:t,expandOne:i,collapseOne:a,expandAll:o,collapseAll:l,childrenToggle:s}}(),T=C.expandOne,_=C.collapseOne,D=C.childrenToggle,N=C.collapseAll,M=C.childrenHiddenIDs,E=C.expandAll,R=function(e){var n=(0,f.useState)(new Map),t=(0,u.Z)(n,2),r=t[0],i=t[1],a=(0,f.useCallback)((function(e){var n=new Map(r);n.has(e)?n.delete(e):n.set(e,new Vm),i(n)}),[r]),o=(0,f.useCallback)((function(e,n){var t=r.get(e);if(t){var a=t.toggleEventItem(n),o=new Map(r);return o.set(e,a),i(o)}}),[r]),l=(0,f.useCallback)((function(e,n){var t=r.get(e);if(t){var a=t.toggleLogItem(n),o=new Map(r);return o.set(e,a),i(o)}}),[r]),s=(0,f.useCallback)((function(e,n){var t=r.get(e);if(t){var a=t.toggleReferenceItem(n),o=new Map(r);return o.set(e,a),i(o)}}),[r]);return{detailStates:r,toggleDetail:a,detailLogItemToggle:l,detailLogsToggle:(0,f.useCallback)((function(e){return dx("logs",r,i)(e)}),[r]),detailEventsItemToggle:o,detailEventsToggle:(0,f.useCallback)((function(e){return dx("events",r,i)(e)}),[r]),detailWarningsToggle:(0,f.useCallback)((function(e){return dx("warnings",r,i)(e)}),[r]),detailStackTracesToggle:(0,f.useCallback)((function(e){return dx("stackTraces",r,i)(e)}),[r]),detailReferenceItemToggle:s,detailReferencesToggle:(0,f.useCallback)((function(e){return dx("references",r,i)(e)}),[r]),detailProcessToggle:(0,f.useCallback)((function(e){return dx("process",r,i)(e)}),[r]),detailTagsToggle:(0,f.useCallback)((function(e){return dx("tags",r,i)(e)}),[r])}}(),O=R.detailStates,L=R.toggleDetail,V=R.detailLogItemToggle,z=R.detailLogsToggle,F=R.detailEventsToggle,B=R.detailProcessToggle,H=R.detailReferencesToggle,P=R.detailReferenceItemToggle,q=R.detailTagsToggle,A=R.detailWarningsToggle,Q=R.detailStackTracesToggle,W=(0,f.useState)(!1),U=(0,u.Z)(W,2),J=U[0],G=U[1],K=(0,f.useState)(.25),Y=(0,u.Z)(K,2),X=Y[0],$=Y[1],ee=(0,f.useMemo)((function(){return{childrenHiddenIDs:M,detailStates:O,hoverIndentGuideIds:Z,shouldScrollToFirstUiFindMatch:!1,spanNameColumnWidth:X,traceID:null===m||void 0===m?void 0:m.traceID}}),[M,O,Z,X,null===m||void 0===m?void 0:m.traceID]),ne=(0,f.useCallback)((function(){return G(!J)}),[J]);if(g&&v){var te=(0,l.Z)({ref:n,size:t,vheight:r},e);return(0,Fe.jsx)(I.a,{theme:h,children:(0,Fe.jsxs)(Sx,(0,l.Z)((0,l.Z)({},te),{},{children:[(0,Fe.jsx)(Za,(0,l.Z)((0,l.Z)({},e),{},{onClose:i,setMinimize:o,setMaxHeight:a,actualQuery:s,total:c,type:d})),(0,Fe.jsxs)("div",{className:"view-content",children:[(0,Fe.jsx)(Lm,(0,l.Z)((0,l.Z)({},e),{},{canCollapse:!1,hideMap:!1,hideSummary:!1,theme:h,onSlimViewClicked:ne,onTraceGraphViewClicked:jx,slimView:J,trace:m,updateNextViewRangeTime:k,updateViewRangeTime:j,viewRange:S})),(0,Fe.jsx)(Fh,(0,l.Z)((0,l.Z)({},e),{},{theme:h,registerAccessors:jx,scrollToFirstVisibleSpan:jx,trace:m,traceTimeline:ee,updateNextViewRangeTime:k,updateViewRangeTime:j,viewRange:S,setSpanNameColumnWidth:$,collapseAll:N,collapseOne:_,expandAll:E,expandOne:T,childrenToggle:D,clearShouldScrollToFirstUiFindMatch:jx,detailLogItemToggle:V,detailLogsToggle:z,detailEventsToggle:F,detailWarningsToggle:A,detailStackTracesToggle:Q,detailReferencesToggle:H,detailReferenceItemToggle:P,detailProcessToggle:B,detailTagsToggle:q,detailToggle:L,setTrace:jx,addHoverIndentGuideId:y,removeHoverIndentGuideId:b,linksGetter:jx,uiFind:e.search,scrollElement:e.scrollElement}))]})]}))})}return null}function Cx(e){var n,t,r,a,o,s=e.dataView,c=e.name,d=s.type,p=s.total,v=s.loading,h=(0,i.v9)((function(e){return e.isSplit})),g=(0,f.useRef)(null),m=(0,i.v9)((function(e){return e[c]})),x=(0,f.useState)("max"),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=Ki({panel:m,dataView:s}),S=(0,f.useState)(0),j=(0,u.Z)(S,2),k=j[0],C=j[1];(0,f.useEffect)((function(){var e,n;null!==g&&void 0!==g&&null!==(e=g.current)&&void 0!==e&&e.clientWidth&&C(null===(n=g.current)||void 0===n?void 0:n.clientWidth)}),[null===g||void 0===g||null===(n=g.current)||void 0===n?void 0:n.clientWidth]);var T=(0,f.useState)(s.data),_=(0,u.Z)(T,2),I=_[0],D=_[1],N=(0,f.useState)(s.tableData||{}),M=(0,u.Z)(N,2),E=M[0],R=M[1];(0,f.useEffect)((function(){D(s.data)}),[s.data,D,h]),(0,f.useEffect)((function(){R(s.tableData||{})}),[s.tableData,R]);var O=function(){D([]),R([])},L=function(){Z((function(e){return"min"!==e?"min":"regular"}))},V=function(){Z((function(e){return"max"!==e?"max":"regular"}))},z=Gi({total:p,panelSize:y,dataView:s}),F=Ji({type:d,actualQuery:w,total:p,dataView:s});if("traces"===d){var B=(0,l.Z)({viewRef:g,panelSize:y,viewHeight:F,setStreamClose:O,setMaxHeight:V,setMinimize:L,actualQuery:w,total:p,type:d,theight:z,tableData:E,viewWidth:k,streamData:I,theme:e.theme},e);return(0,Fe.jsx)(kx,(0,l.Z)({},B))}if(w&&"matrix"===d&&(null===I||void 0===I?void 0:I.length)>0){var H=w.limit,P=(0,l.Z)({viewRef:g,panelSize:y,viewHeight:F,setStreamClose:O,setMaxHeight:V,setMinimize:L,actualQuery:w,total:p,type:d,theight:z,tableData:E,viewWidth:k,limit:H,streamData:I},e);return(0,Fe.jsx)(fs,(0,l.Z)({},P))}if(w&&"stream"===d&&(null===I||void 0===I?void 0:I.length)>0){var q=(0,l.Z)({viewRef:g,panelSize:y,viewHeight:F,viewWidth:k,setStreamClose:O,setMaxHeight:V,logsVolumeData:s.logsVolumeData,setMinimize:L,actualQuery:w,total:p,type:d,theight:z,tableData:E,streamData:I},e);return(0,Fe.jsx)(cs,(0,l.Z)({},q))}if(w&&"vector"===d&&(null===I||void 0===I||null===(t=I.chartData)||void 0===t?void 0:t.length)>0||w&&"vector"===d&&(null===I||void 0===I||null===(r=I.tableData)||void 0===r||null===(a=r.dataRows)||void 0===a?void 0:a.length)>0){var A=w.limit,Q=(0,l.Z)({viewRef:g,panelSize:y,viewHeight:F,setStreamClose:O,setMinimize:L,setMaxHeight:V,actualQuery:w,total:p,type:d,theight:z,streamData:I,viewWidth:k,limit:A},e);return(0,Fe.jsx)(ps,(0,l.Z)({},Q))}if(!w||null!==I&&void 0!==I&&null!==(o=I.dataRows)&&void 0!==o&&o.length||null!==I&&void 0!==I&&I.length)return null;var W=(0,l.Z)({viewRef:g,panelSize:y,setStreamClose:O,setMinimize:L,setMaxHeight:V,actualQuery:w,total:p,loading:v},e);return(0,Fe.jsx)(Ea,(0,l.Z)({},W))}function Tx(e){var n=e.name,t=e.open,r=(0,hr.Fg)(),a=(0,f.useState)(n),o=(0,u.Z)(a,1)[0],s=(0,i.v9)((function(e){return e["".concat(o,"DataView")]})),c=(0,i.v9)((function(e){return e[o]})),d=(0,f.useMemo)((function(){return s.sort((function(e,n){return c.findIndex((function(n){return n.id===e.id}))-c.findIndex((function(e){return e.id===n.id}))}))}),[s,c]);return d.length>0?(0,Fe.jsx)(I.a,{theme:r,children:(0,Fe.jsxs)(ca,{children:[(0,Fe.jsx)(Ui.Z,{section:"Data Views",localProps:e}),null===d||void 0===d?void 0:d.map((function(n,r){return(0,Fe.jsx)(Cx,(0,l.Z)((0,l.Z)({},e),{},{splitted:t,dataView:n}),r)}))]})}):null}var _x=function(e){return(0,ze.iv)(gx||(gx=(0,r.Z)(["\n color: ",";\n display: flex;\n flex: 1;\n flex-direction: column;\n border: 1px solid ",";\n margin-top: 5px;\n border-radius: 5px;\n"])),e.textColor,e.buttonBorder)},Ix=function(e){return(0,ze.iv)(mx||(mx=(0,r.Z)(["\n font-size: 14px;\n background: ",";\n padding: 5px;\n border-bottom: 1px solid ",";\n"])),e.widgetContainer,e.buttonBorder)},Dx=function(e){return(0,ze.iv)(xx||(xx=(0,r.Z)(["\n display: table;\n"])))},Nx=(0,ze.iv)(bx||(bx=(0,r.Z)(["\n display: table-row;\n font-size: 13px;\n"]))),Mx=function(e,n){return(0,ze.iv)(yx||(yx=(0,r.Z)(["\n display: table-cell;\n padding: 5px;\n border-top: 1px solid ",";\n ","\n"])),e.buttonBorder,"key"===n?"color:".concat(e.textPrimary,";"):"")},Ex=(0,ze.iv)(Zx||(Zx=(0,r.Z)(["\n font-weight: lighter;\n"]))),Rx=(0,ze.iv)(wx||(wx=(0,r.Z)(["\n font-family: monospace;\n"])));function Ox(e){var n=e.data,t=n.hasStats,r=n.statsData,i=(0,hi.F)(),a=(0,f.useMemo)((function(){var e;return"object"!==typeof r&&void 0!==r&&(null===(e=Object.keys(r))||void 0===e?void 0:e.length)<1?[["key","val"]]:Object.entries(r)}),[r]);return(null===a||void 0===a?void 0:a.length)>0&&t?(0,Fe.jsxs)("div",{className:(0,ze.cx)(_x(i)),children:[(0,Fe.jsx)("div",{className:(0,ze.cx)(Ix(i)),children:"Stats"}),(0,Fe.jsx)("div",{className:(0,ze.cx)(Dx(i)),children:null===a||void 0===a?void 0:a.map((function(e,n){var t=(0,u.Z)(e,2),r=t[0],a=t[1];return(0,Fe.jsxs)("div",{className:(0,ze.cx)(Nx),children:[(0,Fe.jsx)("div",{className:(0,ze.cx)(Mx(i,"key"),Ex),children:r}),(0,Fe.jsx)("div",{className:(0,ze.cx)(Mx(i,"value"),Rx),children:a||""})]},n)}))})]}):null}var Lx,Vx,zx,Fx,Bx,Hx,Px,qx,Ax,Qx,Wx,Ux,Jx,Gx,Kx,Yx,Xx=t(81097),$x=Rt.z,eb=(0,jt.Z)(It.Z)(Lx||(Lx=(0,r.Z)(["\n height: 18px;\n color: ",";\n width: 18px;\n"])),(function(e){return e.color})),nb=(0,jt.Z)($x)(Vx||(Vx=(0,r.Z)(["\n background: none;\n margin-left: 5px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n height: 28px;\n span {\n margin-left: 5px;\n }\n @media screen and (max-width: 1070px) {\n display: flex;\n gap: 2px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder})),tb=(0,jt.Z)($x)(zx||(zx=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n text-overflow: ellipsis;\n transition: 0.25s all;\n padding-left: 6px;\n justify-content: flex-start;\n color: ",";\n height: 28px;\n &:hover {\n background: ",";\n }\n @media screen and (max-width: 1070px) {\n display: ",";\n margin: 0;\n gap: 2px;\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover}),(function(e){return e.isMobile?"flex":"none"})),rb=jt.Z.div(Fx||(Fx=(0,r.Z)(["\n display: flex;\n margin-left: 0px;\n flex-wrap: wrap;\n border-radius: 3px;\n gap: 2px;\n"]))),ib=(0,jt.Z)($x,{shouldForwardProp:function(e){return(0,Xx.Z)(e)&&"loading"!==e}})(Bx||(Bx=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n transition: 0.25s all;\n justify-content: center;\n height: 28px;\n margin: 0px 4px;\n &:hover {\n background: ",";\n }\n &:disabled {\n background: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n }\n @media screen and (max-width: 1070px) {\n display: flex;\n margin: 0;\n gap: 2px;\n }\n"])),(function(e){return e.loading?"#44bcd8":e.theme.primaryDark}),(function(e){return e.theme.primaryBorder}),(function(e){return e.theme.buttonText}),(function(e){return e.theme.primaryLight}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor})),ab=(0,jt.Z)($x)(Hx||(Hx=(0,r.Z)(["\n background: none;\n margin-left: 5px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n height: 28px;\n span {\n margin-left: 5px;\n }\n display: ",";\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.isMobile||e.isSplit?"flex":"none"})),ob=jt.Z.div(Px||(Px=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n margin-bottom: 4px;\n @media screen and (max-width: 1070px) {\n display: flex;\n gap: 2px;\n }\n"]))),lb=jt.Z.div(qx||(qx=(0,r.Z)(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 20px;\n margin-right: 10px;\n margin: 2px;\n"]))),sb=(jt.Z.div(Ax||(Ax=(0,r.Z)(["\n display: flex;\n align-items: center;\n"]))),jt.Z.div(Qx||(Qx=(0,r.Z)(["\n display: flex;\n flex: 1;\n flex-direction: column;\n background: ",";\n"])),(function(e){return e.theme.widgetContainer}))),ub=jt.Z.div(Wx||(Wx=(0,r.Z)(["\n margin: 20px;\n display: flex;\n flex-direction: column;\n flex: 1;\n .options-input {\n margin: 10px;\n display: flex;\n justify-content: space-between;\n }\n"]))),cb=((0,jt.Z)(Ot.K)(Ux||(Ux=(0,r.Z)(["\n background: ",";\n margin: 5px;\n flex: 1;\n padding: 5px 12px;\n border: 1px solid ",";\n color: ",";\n &:focus {\n border: 1px solid ",";\n }\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover})),(0,jt.Z)($x)(Jx||(Jx=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n height: 30px;\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.primaryBorder}),(function(e){return e.theme.buttonText}),(function(e){return e.theme.primaryLight})),jt.Z.label(Gx||(Gx=(0,r.Z)(["\n font-size: 12px;\n color: ",";\n margin-left: 10px;\n"])),(function(e){return e.theme.inputLabelColor}))),db=jt.Z.div(Kx||(Kx=(0,r.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 10px;\n h3 {\n margin-left: 10px;\n font-size: 1em;\n color: ",";\n }\n"])),(function(e){return e.theme.textColor})),fb=(0,jt.Z)($x)(Yx||(Yx=(0,r.Z)(["\n background: none;\n padding: 0;\n color: ",";\n"])),(function(e){return e.theme.textColor}));function pb(e){var n=e.isDisabled,t=e.onClick,r=e.isMobile,i=e.alterText,a=e.loading,o=void 0!==a&&a,l=(0,hi.F)();return(0,Fe.jsx)(I.a,{theme:l,children:(0,Fe.jsx)(ib,{disabled:n,type:"submit",onClick:t,isMobile:r,loading:o||!1,children:o?(0,Fe.jsx)(Fe.Fragment,{children:"Loading..."}):(0,Fe.jsx)(Fe.Fragment,{children:i||"Show Results"})})})}function vb(e){var n=e.isDisabled,t=e.onClick,r=e.isMobile,i=e.alterText,a=(0,hi.F)();return(0,Fe.jsx)(I.a,{theme:a,children:(0,Fe.jsx)(nb,{disabled:n,type:"submit",onClick:t,isMobile:r,children:i||"Show Logs Rate"})})}function hb(e){return e&&"{"!==e&&"}"!==e}var gb,mb,xb,bb,yb,Zb,wb,Sb,jb,kb,Cb,Tb,_b={JSONClone:function(e){var n=JSON.stringify(e);return JSON.parse(n)},updateLabel:function(e,n){var t,r=[],i=(0,s.Z)(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.name===n?r.push((0,l.Z)((0,l.Z)({},a),{},{selected:!a.selected})):r.push(a)}}catch(o){i.e(o)}finally{i.f()}return r},updateLabelSelected:function(e,n){return e.some((function(e){return e===n}))?e.filter((function(e){return e!==n})):e.concat(n)}},Ib=function(e,n){var t={expr:"",dataSourceId:e,queryId:n};try{var r=JSON.parse(localStorage.getItem("queryData")||"[]")||[];if(r&&(null===r||void 0===r?void 0:r.length)>0){var i=null===r||void 0===r?void 0:r.find((function(t){return t.dataSourceId===e&&t.queryId===n}));return i&&(t=(0,l.Z)({},i)),t}return t}catch(a){return console.error(a),t}},Db=function(e){try{var n=JSON.parse(localStorage.getItem("dataSources")||"[]");return null===n||void 0===n?void 0:n.find((function(n){return n.id===e}))}catch(t){return{}}},Nb=function(e,n,t){var r={expr:e,queryId:n,dataSourceId:t},i=function(){try{return JSON.parse(localStorage.getItem("queryData")||"[]")}catch(e){return[]}}(),a=[];a=i&&i.length>0&&Array.isArray(i)&&i.some((function(e){return e.dataSourceId===t&&e.queryId===n}))?i.map((function(e){return e.queryId===n&&e.dataSourceId===t?(0,l.Z)({},r):e})):[].concat((0,H.Z)(i),[r]),localStorage.setItem("queryData",JSON.stringify(a))},Mb=(jt.Z.div(gb||(gb=(0,r.Z)(["\n padding-top: 5px;\n height: 100%;\n width: 100%;\n display: flex;\n flex:1;\n flex-direction: column;\n background-color: "," !important;\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: "," !important;\n }\n"])),(function(e){return e.theme.mainBgColor}),(function(e){return e.theme.scrollbarThumb})),jt.Z.div(mb||(mb=(0,r.Z)(["\n display: flex;\n align-items:center;\n"])))),Eb=(jt.Z.div(xb||(xb=(0,r.Z)(["\n display: flex;\n align-items: center;\n"]))),jt.Z.div(bb||(bb=(0,r.Z)(["\n display: flex;\n flex: 1;\n flex-direction: column;\n\n \n background: ",";\n"])),(function(e){return e.theme.widgetContainer})),jt.Z.div(yb||(yb=(0,r.Z)(["\n margin: 20px;\n display: flex;\n flex-direction: column;\n flex: 1;\n"]))),jt.Z.label(Zb||(Zb=(0,r.Z)(["\n font-size: 11px;\n white-space: nowrap;\n color: ",";\n margin-left: 10px;\n"])),(function(e){return e.theme.textColor}))),Rb=jt.Z.div(wb||(wb=(0,r.Z)(["\n display: flex;\n margin-right: 10px;\n"]))),Ob=jt.Z.div(Sb||(Sb=(0,r.Z)(["\n color: ",";\n background: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n white-space: nowrap;\n padding: 0px 10px;\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonInactive})),Lb=jt.Z.input(jb||(jb=(0,r.Z)(["\n flex: 1;\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius: 3px;\n max-width: 60px;\n padding-left: 8px;\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}));function Vb(e){var n=(0,i.I0)(),t=e.data.id,r=e.name,a=(0,i.v9)((function(e){return e[r]})),o=(0,f.useState)(e.data.limit),l=(0,u.Z)(o,2),s=l[0],c=l[1],d=(0,f.useMemo)((function(){return e.data.limit}),[e.data.limit]);return(0,f.useEffect)((function(){c(d)}),[d,c]),(0,Fe.jsxs)(Rb,{children:[(0,Fe.jsx)(Ob,{children:"Query Limit"}),(0,Fe.jsx)(D.Z,{title:"max 20000",children:(0,Fe.jsx)(Lb,{type:"number",value:s,onChange:function(e){var i=e.target.value;i>2e4&&(i=2e4);var o=(0,H.Z)(a);o.forEach((function(e){e.id===t&&(e.limit=i)})),n(function(e,n){return"left"===e?m(n):x(n)}(r,o))}})})]})}var zb=jt.Z.div(kb||(kb=(0,r.Z)(["\n color: ",";\n background: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 11px;\n white-space: nowrap;\n padding: 0px 10px;\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonInactive})),Fb=jt.Z.div(Cb||(Cb=(0,r.Z)(["\n display: flex;\n align-items: center;\n font-size: 12px;\n background-color: ",";\n\n border: 1px solid ",";\n color: ",";\n border-radius: 3px;\n margin-right: 10px;\n"])),(function(e){return e.theme.buttonInactive}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor})),Bb=jt.Z.div(Tb||(Tb=(0,r.Z)(["\n cursor: pointer;\n display: flex;\n align-items: center;\n background: ",";\n border-left: ",";\n border-right: ",";\n border-radius: ",";\n flex: 1;\n height: 90%;\n\n padding: 0px 12px;\n font-size: 12px;\n line-height: 20px;\n"])),(function(e){return e.selected?e.theme.buttonDefault:e.theme.buttonInactive}),(function(e){return"last"===e.position?"1px solid ".concat(e.theme.buttonBorder):"none"}),(function(e){return"first"===e.position?"1px solid ".concat(e.theme.buttonBorder):"none"}),(function(e){var n=e.position;return"first"===n?"3px 0px 0px 3px":"last"===n?"0px 3px 3px 0px":"0px"})),Hb=function(e,n){var t=n.length;return 0===e?"first":e===t-1?"last":"center"};function Pb(e){var n=e.options,t=e.defaultActive,r=e.label,i=e.onChange,a=(0,f.useMemo)((function(){return t}),[t]),o=(0,f.useState)(a),l=(0,u.Z)(o,2),s=l[0],c=l[1];return(0,f.useEffect)((function(){c(t)}),[t]),(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(zb,{children:r}),(0,Fe.jsx)(Fb,{children:n&&n.map((function(e,n,r){return(0,Fe.jsx)(Bb,{selected:e.value===s,defaultActive:t,position:Hb(n,r),onClick:function(n){return function(e){c(e),i(e)}(e.value)},children:e.label},n)}))})]})}var qb,Ab=t(70024),Qb=jt.Z.div(qb||(qb=(0,r.Z)(["\n display: flex;\n padding: 4px 8px;\n // background: ",";\n color: ",";\n height: 26px;\n"])),(function(e){return e.theme.widgetContainer}),(function(e){return e.color}));function Wb(e,n){return"left"===e?m(n):x(n)}var Ub=[{value:"range",label:"Range"},{value:"instant",label:"Instant"}],Jb=[{value:"forward",label:"Forward"},{value:"backwards",label:"Backwards"}];function Gb(e){var n=(0,i.I0)(),t=e.name,r=e.data,a=(0,hr.Fg)(),o=(0,i.v9)((function(e){return e[t]})),s=(0,i.v9)((function(e){return e.responseType})),c=(0,p.TH)().hash,d=r.id,v=r.queryType,h=r.tableView,g=r.idRef,m=r.isShowTs,x=r.isBuilder,b=r.isLogsVolume,y=r.direction,Z=r.dataSourceType,w=r.isShowStats,S=r.hasStats,j=(0,f.useState)(h),k=(0,u.Z)(j,2),C=k[0],T=k[1],_=(0,f.useState)(m||!1),D=(0,u.Z)(_,2),N=D[0],M=D[1],E=(0,f.useState)(x||!1),R=(0,u.Z)(E,2),O=R[0],L=R[1],V=(0,f.useState)(b||!1),z=(0,u.Z)(V,2),F=z[0],B=z[1],P=(0,f.useState)(w||!1),q=(0,u.Z)(P,2),A=q[0],Q=q[1],W=(0,f.useState)(v),U=(0,u.Z)(W,2),J=U[0],G=U[1],K=(0,f.useState)(y||"forward"),Y=(0,u.Z)(K,2),X=Y[0],$=Y[1];return(0,f.useEffect)((function(){var e=new URLSearchParams(c.replace(/#/,"")).get(t),r=JSON.parse(decodeURIComponent(e)||"[]");if((null===r||void 0===r?void 0:r.length)>0){var i=r.find((function(e){return e.idRef===g}));if(i){var a=(0,H.Z)(o);a.forEach((function(e){e.idRef===g&&(e.queryType=i.queryType,e.direction=i.direction)})),n(Wb(t,a))}}}),[]),(0,f.useEffect)((function(){T(e.data.tableView)}),[T,e.data.tableView]),(0,f.useEffect)((function(){M(e.data.isShowTs)}),[M,e.data.isShowTs]),(0,f.useEffect)((function(){L(e.data.isBuilder)}),[L,e.data.isBuilder]),(0,f.useEffect)((function(){B(e.data.isLogsVolume)}),[B,e.data.isLogsVolume]),(0,Fe.jsx)(I.a,{theme:a,children:(0,Fe.jsxs)(Qb,{children:[(0,Fe.jsx)(Ui.Z,{section:"Query Options",localProps:e}),(0,Fe.jsx)(Pb,{label:"Query Type",options:Ub,onChange:function(e){var r=(0,H.Z)(o);r.forEach((function(n){n.id===d&&(n.queryType=e)})),n(Wb(t,r)),G(e)},defaultActive:J}),(0,Fe.jsx)(Pb,{label:"Direction",options:Jb,onChange:function(e){var r=(0,H.Z)(o);r.forEach((function(n){n.id===d&&(n.direction=e)})),n(Wb(t,r)),$(e)},defaultActive:X}),(0,Fe.jsx)(Vb,(0,l.Z)({},e)),"flux"===Z&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(Eb,{children:"Chart View"}),(0,Fe.jsx)(Ab.Z,{checked:C,size:"small",onChange:function(){var e=(0,H.Z)(o);e.forEach((function(e){e.id===d&&(e.tableView=!C)})),n(Wb(t,e))},inputProps:{"aria-label":"controlled"}})]}),"vector"!==s&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)(Mb,{children:[(0,Fe.jsx)(Eb,{children:"Timestamp"}),(0,Fe.jsx)(Ab.Z,{checked:N,size:"small",onChange:function(){var e=(0,H.Z)(o);e.forEach((function(e){e.id===d&&(e.isShowTs=!N)})),n(Wb(t,e))},inputProps:{"aria-label":"controlled-ts"}})]}),(0,Fe.jsxs)(Mb,{children:[(0,Fe.jsx)(Eb,{children:"Query Builder"}),(0,Fe.jsx)(Ab.Z,{checked:O,size:"small",onChange:function(){var e=(0,H.Z)(o);e.forEach((function(e){e.id===d&&(e.isBuilder=!O)})),n(Wb(t,e))},inputProps:{"aria-label":"controlled-ts"}})]}),(0,Fe.jsxs)(Mb,{children:[(0,Fe.jsx)(Eb,{children:"Logs Volume"}),(0,Fe.jsx)(Ab.Z,{checked:F,size:"small",onChange:function(){var e=(0,H.Z)(o);e.forEach((function(e){e.id===d&&(e.isLogsVolume=!F)})),n(Wb(t,e))},inputProps:{"aria-label":"controlled-ts"}})]}),S&&(0,Fe.jsxs)(Mb,{children:[(0,Fe.jsx)(Eb,{children:"Stats Info"}),(0,Fe.jsx)(Ab.Z,{checked:A,size:"small",onChange:function(e){var r=e.target.checked;Q((function(){return r}));var i=(0,H.Z)(o);i.forEach((function(e){e.id===d&&(e.isShowStats=!A)})),n(Wb(t,i))},inputProps:{"aria-label":"controlled-ts"}})]})]})]})})}var Kb,Yb=function(e){var n=(0,i.I0)(),t=(0,i.v9)((function(e){return e.responseType})),r=(0,p.TH)().hash,a=e.data,o=a.id,s=a.idRef,c=a.dataSourceType,d=a.isBuilder,v=e.open,h=e.handleClose,g=e.actPanel,m=e.name,x=(0,f.useState)(e.data.tableView),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useState)(e.data.isShowTs),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,f.useState)(d||!1),T=(0,u.Z)(C,2),_=T[0],I=T[1],D=(0,f.useState)(e.data.queryType),N=(0,u.Z)(D,2),M=N[0],E=N[1],R=(0,f.useState)(e.data.traceQueryType||"traceId"),O=(0,u.Z)(R,2),L=O[0],V=O[1],z=(0,f.useState)(e.data.direction),F=(0,u.Z)(z,2),B=F[0],P=F[1];(0,f.useEffect)((function(){var e=new URLSearchParams(r.replace(/#/,"")).get(m),t=JSON.parse(decodeURIComponent(e));if((null===t||void 0===t?void 0:t.length)>0){var i=t.find((function(e){return e.idRef===s}));if(i){var a=(0,H.Z)(g),o=A(a,s);"undefined"!==typeof o&&(o.queryType=i.queryType,o.direction=i.direction,n(Zj(m,a)))}}}),[]);var q=function(e,n){return e.find((function(e){return e.id===n}))},A=function(e,n){return e.find((function(e){return e.id===n}))};function Q(e){var t=(0,H.Z)(g),r=q(t,o);"undefined"!==typeof r&&(r.traceQueryType=e,n(Zj(m,t))),V((function(n){return e}))}(0,f.useEffect)((function(){Z(e.data.tableView)}),[Z,e.data.tableView]),(0,f.useEffect)((function(){k(e.data.isShowTs)}),[k,e.data.isShowTs]),(0,f.useEffect)((function(){I(e.data.isBuilder)}),[I,e.data.isBuilder]);return(0,Fe.jsx)(sr.Z,{open:v,onClose:h,PaperProps:{classes:{root:vr.ht}},children:(0,Fe.jsxs)(sb,{children:[(0,Fe.jsxs)(db,{children:[(0,Fe.jsx)("h3",{children:"Query Options"}),(0,Fe.jsxs)(fb,{onClick:h,children:[" ",(0,Fe.jsx)(br.Z,{})," "]})]}),(0,Fe.jsxs)(ub,{children:[(0,Fe.jsx)("div",{className:"options-input",children:(0,Fe.jsx)(Pb,{label:"Trace Type",options:kj,onChange:Q,defaultActive:L})}),(0,Fe.jsx)("div",{className:"options-input",children:(0,Fe.jsx)(Pb,{label:"Query Type",options:Sj,onChange:function(e){var t=(0,H.Z)(g),r=q(t,o);"undefined"!==typeof r&&(r.queryType=e,n(Zj(m,t))),E(e)},defaultActive:M})}),(0,Fe.jsx)("div",{className:"options-input",children:(0,Fe.jsx)(Pb,{label:"Direction",options:jj,onChange:function(e){var t=(0,H.Z)(g),r=q(t,o);"undefined"!==typeof r&&(r.direction=e,n(Zj(m,t))),P(e)},defaultActive:B})}),(0,Fe.jsx)("div",{className:"options-input",children:(0,Fe.jsx)(Vb,(0,l.Z)({},e))}),"flux"===c&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Chart View"}),(0,Fe.jsx)(Ab.Z,{checked:y,size:"small",onChange:function(){var e=(0,H.Z)(g),t=q(e,o);"undefined"!==typeof t&&(t.tableView=!y,n(Zj(m,e)))},inputProps:{"aria-label":"controlled"}})]}),"vector"!==t&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsxs)(lb,{children:[(0,Fe.jsx)(cb,{children:"Timestamp"}),(0,Fe.jsx)(Ab.Z,{checked:j,size:"small",onChange:function(){var e=(0,H.Z)(g);e.forEach((function(e){e.id===o&&(e.isShowTs=!j)})),n(Zj(m,e))},inputProps:{"aria-label":"controlled-ts"}})]}),(0,Fe.jsxs)(lb,{children:[(0,Fe.jsx)(cb,{children:"Query Builder"}),(0,Fe.jsx)(Ab.Z,{checked:_,size:"small",onChange:function(){var e=(0,H.Z)(g);e.forEach((function(e){e.id===o&&(e.isBuilder=!_)})),n(Zj(m,e))},inputProps:{"aria-label":"controlled-ts"}})]})]})]})]})})};var Xb=(0,ze.iv)(Kb||(Kb=(0,r.Z)(["\n height: 18px !important;\n width: 18px !important;\n"])));function $b(e){var n=(0,i.I0)(),t=e.name,r=e.data,a=r.id,o=r.browserOpen,l=(0,f.useMemo)((function(){return o}),[o]),s=(0,hi.F)(),c=((0,i.v9)((function(e){return e.labels})),(0,i.v9)((function(e){return e[t]}))),d=(0,f.useState)(l),p=(0,u.Z)(d,2),v=p[0],h=p[1];(0,f.useEffect)((function(){h(l)}),[l]);return(0,Fe.jsx)(I.a,{theme:s,children:(0,Fe.jsx)(D.Z,{title:function(n){var t;return(null===(t=e.labels)||void 0===t?void 0:t.length)>0?"Show / Hide Labels":"Labels Not Available"}(),children:(0,Fe.jsxs)(tb,{onClick:function(){var e=(0,H.Z)(c);e.forEach((function(e){e.id===a&&(e.browserOpen=!v)})),n(function(e,n){return"left"===e?m(n):x(n)}(t,e)),h(l)},browserActive:v,isMobile:e.isMobile,children:[function(e){return e?(0,Fe.jsx)(ga.Z,{className:(0,ze.cx)(Xb)}):(0,Fe.jsx)(mt.Z,{className:(0,ze.cx)(Xb)})}(v),"Labels"]})})})}function ey(e){var n=e.disabled,t=e.onClick,r=e.isMobile,i=(0,hi.F)();return(0,Fe.jsx)(I.a,{theme:i,children:(0,Fe.jsx)(ab,{disabled:n,type:"submit",onClick:t,isMobile:r,children:"Options"})})}function ny(e){var n=e.queryLength,t=e.handleHistoryClick,r=e.isMobile,i=(0,f.useState)(!1),a=(0,u.Z)(i,2),o=a[0],l=a[1],s=(0,hi.F)();return(0,f.useEffect)((function(){l(n>0)}),[n]),(0,Fe.jsx)(I.a,{theme:s,children:(0,Fe.jsx)(D.Z,{title:"Query History ("+n+")",children:(0,Fe.jsxs)(nb,{isMobile:r,onClick:t,children:[(0,Fe.jsx)(eb,{color:o?s.textColor:s.textOff}),r&&(0,Fe.jsx)("span",{children:"History"})]})})})}var ty,ry,iy,ay,oy,ly,sy,uy,cy,dy,fy,py,vy,hy=["isSplit","onShowQuerySettings","queryHistory","handleHistoryClick","queryValid","onSubmit","onSubmitRate","data","name","loading","hasStats","showStatsOpen","handleStatsOpen"],gy=function(e){var n=(0,i.I0)(),t=e.isSplit,r=e.onShowQuerySettings,a=e.queryHistory,o=e.handleHistoryClick,s=e.queryValid,c=e.onSubmit,d=e.onSubmitRate,p=e.data,v=e.name,h=e.loading,g=e.hasStats,m=e.showStatsOpen,x=e.handleStatsOpen,b=(0,Vo.Z)(e,hy),y=p.id,Z=p.dataSourceType,w=(0,f.useState)(e.data.chartView),S=(0,u.Z)(w,2),j=S[0],k=S[1];(0,f.useEffect)((function(){k(e.data.chartView)}),[k,e.data.chartView]);var C,T=(0,i.v9)((function(e){return e[v]}));return(0,Fe.jsxs)(ob,{children:[(C=Z,"flux"!==C&&"metrics"!==C&&"traces"!==C?(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)($b,(0,l.Z)((0,l.Z)({},e),{},{isMobile:!0})),(0,Fe.jsx)(ey,(0,l.Z)((0,l.Z)({},b),{},{isSplit:t,isMobile:!0,onClick:r}))]}):null),(0,Fe.jsx)(ny,{queryLength:null===a||void 0===a?void 0:a.length,handleHistoryClick:o,isMobile:!0}),"logs"===Z&&(0,Fe.jsx)(vb,{disabled:!s,onClick:d,isMobile:!1}),"logs"===Z&&g&&t&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Show Stats"}),(0,Fe.jsx)(Ab.Z,{checked:m,size:"small",onChange:x,inputProps:{"aria-label":"controlled-switch"}})]}),(0,Fe.jsx)(pb,{disabled:!s,onClick:c,isMobile:!0,loading:h||!1}),"flux"===Z&&(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Chart View"}),(0,Fe.jsx)(Ab.Z,{checked:j,size:"small",onChange:function(){var e=(0,H.Z)(T),t=function(e,n){return e.find((function(e){return e.id===n}))}(e,y);"undefined"!==typeof t&&(t.chartView=!j,n(Zj(v,e)))},inputProps:{"aria-label":"controlled"}})]})]})},my=t(28048),xy=t(32720),by=t(55386),yy=t(19803),Zy=t.n(yy),wy=(t(68293),t(66940),(0,jt.Z)(xy.CX)(ty||(ty=(0,r.Z)(["\n flex: 1;\n background: ",";\n border: 1px solid ",";\n color: ",";\n padding: 4px 8px;\n font-size: 12px;\n font-family: monospace;\n margin: 0px 5px;\n border-radius: 3px;\n line-height: 1.5;\n line-break: anywhere;\n overflow-y: scroll;\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}))),Sy=jt.Z.div(ry||(ry=(0,r.Z)(["\n display: flex;\n align-items: center;\n flex: 1;\n max-width: 100%;\n"])));function jy(e){var n=e.attributes,t=e.children,i=e.leaf,a=(0,hi.F)();return(0,Fe.jsx)("span",(0,l.Z)((0,l.Z)({},n),{},{className:(0,ze.iv)(iy||(iy=(0,r.Z)(["\n font-family: monospace;\n // background: black;\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),i.comment&&(0,ze.iv)(ay||(ay=(0,r.Z)(["\n color: blue;\n "]))),(i.operator||i.url)&&(0,ze.iv)(oy||(oy=(0,r.Z)(["\n color: ",";\n "])),a.textOff),i.keyword&&(0,ze.iv)(ly||(ly=(0,r.Z)(["\n color: #57aed4;\n "]))),(i.variable||i.regex)&&(0,ze.iv)(sy||(sy=(0,r.Z)(["\n color: #e90;\n "]))),(i.number||i.boolean||i.tag||i.constant||i.symbol||i["attr-name"]||i.selector)&&(0,ze.iv)(uy||(uy=(0,r.Z)(["\n color: #dd4a68;\n "]))),i.punctuation&&(0,ze.iv)(cy||(cy=(0,r.Z)(["\n color: orange;\n "]))),(i.string||i.char)&&(0,ze.iv)(dy||(dy=(0,r.Z)(["\n color: green;\n "]))),(i.function||i["class-name"]||i["attr-name"])&&(0,ze.iv)(fy||(fy=(0,r.Z)(["\n color: #dd4a68;\n "]))),i["context-labels"]&&(0,ze.iv)(py||(py=(0,r.Z)(["\n color: orange;\n "]))),i["label-key"]&&(0,ze.iv)(vy||(vy=(0,r.Z)(["\n color: green;\n "])))),children:t}))}function ky(e){var n;return"string"===typeof e?null===e||void 0===e?void 0:e.length:"string"===typeof(null===e||void 0===e?void 0:e.content)?null===e||void 0===e?void 0:e.content.length:null===e||void 0===e||null===(n=e.content)||void 0===n?void 0:n.reduce((function(e,n){return e+ky(n)}),0)}function Cy(e){var n=e.onQueryChange,t=e.value,r=e.onKeyDown,i=(e.defaultValue,e.isSplit,(0,hi.F)()),a=(0,f.useCallback)((function(e){return(0,Fe.jsx)(jy,(0,l.Z)({},e))}),[]),o=(0,f.useMemo)((function(){return(0,by.VC)((0,xy.BU)((0,my.Jh)()))}),[]),c=(0,f.useRef)(null),d=(0,f.useState)("sql"),p=(0,u.Z)(d,1)[0],v=(0,f.useCallback)((function(e){var n=(0,u.Z)(e,2),t=n[0],r=n[1],i=[];if(!my.xv.isText(t)||(null===t||void 0===t?void 0:t.length)<1)return i;var a,o=Zy().tokenize(t.text,Zy().languages[p]),l=0,c=(0,s.Z)(o);try{for(c.s();!(a=c.n()).done;){var d,f=a.value,v=l+ky(f);if("string"!==typeof f)i.push((d={},(0,B.Z)(d,f.type,!0),(0,B.Z)(d,"anchor",{path:r,offset:l}),(0,B.Z)(d,"focus",{path:r,offset:v}),d));l=v}}catch(h){c.e(h)}finally{c.f()}return i}),[p]),h=(0,f.useState)(t),g=(0,u.Z)(h,2),m=g[0],x=g[1];return(0,f.useEffect)((function(){x(t)}),[]),(0,f.useEffect)((function(){x(t),o.children=t}),[t,x]),(0,Fe.jsx)(I.a,{theme:i,children:(0,Fe.jsx)(Sy,{ref:c,children:(0,Fe.jsx)(xy.mH,{editor:o,value:m,onChange:n,children:(0,Fe.jsx)(wy,{decorate:v,renderLeaf:a,placeholder:"",onKeyDown:r,spellCheck:"false"})})})})}var Ty=function(e){var n,t=e.isTabletOrMobile,r=e.isBuilder,a=e.dataSourceType,s=e.handleQueryChange,u=e.expr,c=e.queryValue,d=e.handleInputKeyDown,f=e.queryHistory,p=e.handleHistoryClick,v=e.queryValid,h=e.onSubmit,g=e.onSubmitRate,m=e.loading,x=(0,i.v9)((function(e){return e.isSplit}));return(0,Fe.jsxs)(rb,{children:[!t&&!x&&!r&&(n="logs",a===n)&&(0,Fe.jsx)($b,(0,l.Z)({},e)),("logs"!==a||!r)&&"metrics"!==a&&(0,Fe.jsx)(Cy,{onQueryChange:s,defaultValue:o().sanitize(u||""),value:c,onKeyDown:d}),!x&&"flux"!==a&&"traces"!==a&&"logs"===a&&!r&&!t&&(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(ny,{queryLength:f.length,handleHistoryClick:p}),"logs"===a&&!r&&(0,Fe.jsx)(vb,{disabled:!v,onClick:g,isMobile:!1}),(0,Fe.jsx)(pb,{disabled:!v,onClick:h,isMobile:!1,loading:m||!1})]}),("traces"===a||"metrics"===a)&&(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(pb,{disabled:!v,onClick:h,isMobile:!1,loading:m||!1})})]})},_y=t(9964),Iy=t(9820),Dy=t(53132);var Ny=t(48268);function My(e){var n,t=(0,Ny.Uc)(e),r=(0,l.Z)((0,l.Z)({},t),{},{"Content-Type":"application/json"}),i={},a={};if(null===e||void 0===e||null===(n=e.auth)||void 0===n?void 0:n.basicAuth.value){var o,u,c,d=null===e||void 0===e||null===(o=e.auth)||void 0===o||null===(u=o.fields)||void 0===u?void 0:u.basicAuth,f=(0,s.Z)(d);try{for(f.s();!(c=f.n()).done;){var p=c.value;"user"===p.name&&(a.username=p.value),"password"===p.name&&(a.password=p.value)}}catch(v){f.e(v)}finally{f.f()}i.auth=a}return i.options={method:"GET"},i.headers=r,i}var Ey,Ry,Oy,Ly,Vy,zy,Fy,By,Hy,Py,qy,Ay,Qy=t(17527),Wy=t(74092),Uy=function(e,n,t){return{container:function(e){return(0,l.Z)((0,l.Z)({},e),{},{flex:t?1:""})},menu:function(n){return(0,l.Z)((0,l.Z)({},n),{},{fontSize:"12px",color:e.textColor})},control:function(r){return(0,l.Z)((0,l.Z)({},r),{},{fontSize:"12px",height:28,minHeight:28,boxShadow:"none",color:e.textColor,border:"1px solid ".concat(e.buttonBorder),minWidth:n,flex:t?1:""})},input:function(n){return(0,l.Z)((0,l.Z)({},n),{},{fontSize:"12px",color:e.textColor})},indicatorSeparator:function(e){return{display:"none"}},dropdownIndicator:function(n){return{padding:0,svg:{height:12},color:e.textColor}},clearIndicator:function(e){return{padding:0,svg:{height:12}}},singleValue:function(n){return(0,l.Z)((0,l.Z)({},n),{},{fontSize:"12px",height:30,minHeight:30,margin:0,padding:0,marginTop:"4px",color:e.textColor})},valueContainer:function(e){return(0,l.Z)((0,l.Z)({},e),{},{display:"flex",flex:t?1:""})}}},Jy=(0,ze.iv)(Ey||(Ey=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 3px;\n"]))),Gy=(0,ze.iv)(Ry||(Ry=(0,r.Z)(["\n display: flex;\n align-items: center;\n"]))),Ky=function(e){return(0,ze.iv)(Oy||(Oy=(0,r.Z)(["\n color: ",";\n border: 1px solid ",";\n margin-left: 3px;\n cursor: pointer;\n\n padding: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 3px;\n"])),e.textColor,e.buttonBorder)},Yy=function(e){return(0,ze.iv)(Ly||(Ly=(0,r.Z)(["\n display: flex;\n align-items: center;\n margin-top: 3px;\n margin-left: 3px;\n cursor: pointer;\n color: ",";\n padding: 0px 12px;\n border-radius: 3px;\n height: 28px;\n small {\n font-size: 12px;\n margin: 0;\n padding: 0;\n }\n"])),e.textColor)},Xy=function(e){return(0,ze.iv)(Vy||(Vy=(0,r.Z)(["\n color: ",";\n margin-right: 2px;\n"])),e.textColor)},$y=(0,ze.iv)(zy||(zy=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n margin: 0px 0px;\n"]))),eZ=(0,ze.iv)(Fy||(Fy=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n flex: 1;\n"]))),nZ=(0,ze.iv)(By||(By=(0,r.Z)(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n"]))),tZ=((0,ze.iv)(Hy||(Hy=(0,r.Z)(["\n display: flex;\n margin: 10px 0px;\n"]))),(0,ze.iv)(Py||(Py=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n margin-top: 10px;\n"])))),rZ=(0,ze.iv)(qy||(qy=(0,r.Z)(["\n //align-items:center;\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n"]))),iZ=function(e){return(0,ze.iv)(Ay||(Ay=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n color: ",";\n margin-left: 5px;\n transition: 0.25s all;\n justify-content: center;\n padding: 3px 12px;\n margin-top: 5px;\n height: 30px;\n display: flex;\n align-items: center;\n align-self: flex-end;\n max-width: 200px;\n cursor: pointer;\n &:hover {\n background: ",";\n }\n"])),e.primaryDark,e.primaryBorder,e.buttonText,e.primaryLight)},aZ=75,oZ={display:"flex",alignItems:"center",flex:1,width:"100%"},lZ={display:"flex",alignItems:"flex-end",flex:1,width:"100%"};function sZ(e){var n=e.defaultValue,t=e.options,r=(0,f.useMemo)((function(){var e=null===t||void 0===t?void 0:t.find((function(e){return(null===e||void 0===e?void 0:e.value)===n}));return{label:null===e||void 0===e?void 0:e.label}}),[n,t]);return(0,Fe.jsx)("div",{style:lZ,children:(0,Fe.jsx)("div",{children:r.label})})}var uZ,cZ=function(e){var n=Qy.c.Option,t=e.data.label;return(0,Fe.jsx)(n,(0,l.Z)((0,l.Z)({},e),{},{children:(0,Fe.jsx)("div",{style:oZ,children:(0,Fe.jsx)("span",{style:{fontSize:"12px"},children:t})})}))},dZ=function(e){var n=e.data.label;return(0,Fe.jsx)("div",{style:lZ,children:(0,Fe.jsx)("div",{children:n})})},fZ=(0,f.forwardRef)((function(e,n){var t=e.options,r=e.onSelectChange,i=e.label,a=e.labelWidth,o=(0,hr.Fg)();return(0,Fe.jsxs)("div",{style:{marginTop:"5px",display:"flex",alignItems:"center",flex:1,whiteSpace:"nowrap"},children:[(0,Fe.jsx)("label",{style:{width:"".concat(a,"px"),fontSize:"12px",color:o.textColor,padding:"0px 10px"},children:i}),(0,Fe.jsx)(Wy.ZP,{styles:Uy(o,100,!0),placeholder:(0,Fe.jsx)(sZ,(0,l.Z)({},e)),options:t,ref:n,components:{Option:cZ,SingleValue:dZ},theme:function(e){return(0,Ny.Pu)(e,o)},onChange:r})]})}));function pZ(e){var n=e.name,t=e.data,r=t.id,a=t.dataSourceId,s=t.dataSourceType,c=t.dataSourceURL,d=t.expr,p=e.onSearchChange,v=(0,i.I0)(),h=function(e){var n=e.id,t=(0,i.v9)((function(e){return e.dataSources})),r=(0,f.useState)({data:{tagValues:[]}}||{}),a=(0,u.Z)(r,2),o=a[0],l=a[1],s=(0,f.useMemo)((function(){return t.find((function(e){return e.id===n}))}),[t,n]);return(0,f.useEffect)((function(){if("traces"===s.type&&null!==s&&void 0!==s&&s.url&&""!==(null===s||void 0===s?void 0:s.url)){var e=My(s),n="".concat(s.url,"/api/search/tag/service.name/values"),t=function(){var t=(0,F.Z)((0,z.Z)().mark((function t(){var r;return(0,z.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,q().get(n,e);case 3:r=t.sent,l(r||[]),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("Error at loading Service Names",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();t()}}),[]),(0,f.useMemo)((function(){var e;return null!==o&&void 0!==o&&null!==(e=o.data)&&void 0!==e&&e.tagValues?[{name:"Select Service Name",value:"",label:"Select Service Name"}].concat(o.data.tagValues.map((function(e){return{name:e,value:e,label:e}}))):[{name:"",value:""}]}),[o])}({id:a}),g=function(e){var n=e.id,t=(0,i.v9)((function(e){return e.dataSources})),r=(0,f.useState)({data:{tagValues:[]}}||{}),a=(0,u.Z)(r,2),o=a[0],l=a[1],s=(0,f.useMemo)((function(){return t.find((function(e){return e.id===n}))}),[t,n]);return(0,f.useEffect)((function(){if("traces"===s.type&&null!==s&&void 0!==s&&s.url&&""!==(null===s||void 0===s?void 0:s.url)){var e=My(s),n="".concat(s.url,"/api/search/tag/name/values"),t=function(){var t=(0,F.Z)((0,z.Z)().mark((function t(){var r;return(0,z.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,q().get(n,e);case 3:r=t.sent,l(r||[]),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("Error at loading Span Names",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();t()}}),[]),(0,f.useMemo)((function(){var e;return null!==o&&void 0!==o&&null!==(e=o.data)&&void 0!==e&&e.tagValues?[{name:"Search Span Name",value:"",label:"Search Span Name"}].concat(o.data.tagValues.map((function(e){return{name:e,value:e,label:e}}))):[{name:"",value:"",label:""}]}),[o])}({id:a}),m=(0,f.useState)({name:"",value:"",label:""}),x=(0,u.Z)(m,2),b=x[0],y=x[1],Z=(0,f.useState)(g[0]||{name:"",value:"",label:""}),w=(0,u.Z)(Z,2),S=w[0],j=w[1],k=(0,hr.Fg)(),C=(0,f.useState)({searchName:b.value||"",name:S.value||"",tags:"",minDuration:"",maxDuration:"",limit:20}),T=(0,u.Z)(C,2),_=T[0],I=T[1],D=(0,f.useState)(""),N=(0,u.Z)(D,2),M=N[0],E=N[1];(0,f.useEffect)((function(){h.length>0&&E(function(e){var n=e.searchName,t=e.name,r=e.minDuration,i=e.maxDuration,a=e.tags,o=e.limit,l="";(null===n||void 0===n?void 0:n.length)>0&&(l=' service.name="'.concat(n,'"'));var s="";(null===a||void 0===a?void 0:a.length)>0&&(s=" ".concat(a));var u="";(null===t||void 0===t?void 0:t.length)>0&&(u=' name="'.concat(t,'"'));var c="";(null===r||void 0===r?void 0:r.length)>0&&(c="&minDuration=".concat(r));var d="";(null===i||void 0===i?void 0:i.length)>0&&(d="&maxDuration=".concat(i));var f="";o&&(f="&limit=".concat(o));var p=encodeURIComponent("".concat(s).concat(l).concat(u));return"search?tags=".concat(p).concat(c).concat(d).concat(f)}(_))}),[_]);var R=function(){return{dataSourceType:s,expr:d,queryType:"trace-search",limit:_.limit,name:n,id:r,open:!0,direction:"forward",dataSourceId:a,url:"".concat(c,"/api/").concat(M)}},O=function(e,n){var t,r=(null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value)||"";I((function(e){return(0,l.Z)((0,l.Z)({},e),{},(0,B.Z)({},n,r))})),p(R())};return(0,Fe.jsx)("div",{className:(0,ze.cx)(tZ),children:(0,Fe.jsxs)("div",{className:(0,ze.cx)(rZ),children:[(0,Fe.jsx)(fZ,(0,l.Z)((0,l.Z)({},e),{},{defaultValue:"",label:"Service Name",options:h,onSelectChange:function(e){var n=(null===e||void 0===e?void 0:e.value)||"";y({name:n,value:n,label:n}),I((function(e){return(0,l.Z)((0,l.Z)({},e),{},{searchName:n})})),p(R())},labelWidth:aZ})),(0,Fe.jsx)(fZ,(0,l.Z)((0,l.Z)({},e),{},{defaultValue:"",label:"Span Name",options:g,onSelectChange:function(e){var n=(null===e||void 0===e?void 0:e.value)||"";j({name:n,value:n,label:n}),I((function(e){return(0,l.Z)((0,l.Z)({},e),{},{name:n})})),p(R())},labelWidth:aZ})),(0,Fe.jsx)(Dy.gN,{label:"Tags",placeholder:"http.status_code=200 error=true",onChange:function(e){return O(e,"tags")},value:o().sanitize(_.tags),labelWidth:aZ}),(0,Fe.jsx)(Dy.gN,{label:"Limit",placeholder:"Set limit, default 20",onChange:function(e){return O(e,"limit")},value:o().sanitize(String(_.limit)),labelWidth:aZ}),(0,Fe.jsx)(Dy.gN,{label:"Min Duration",placeholder:"e.g. 1.2s, 100ms",onChange:function(e){return O(e,"minDuration")},value:o().sanitize(_.minDuration),labelWidth:aZ}),(0,Fe.jsx)(Dy.gN,{label:"Max Duration",placeholder:"e.g. 1.2s, 100ms",onChange:function(e){return O(e,"maxDuration")},value:o().sanitize(_.maxDuration),labelWidth:aZ}),(0,Fe.jsx)("button",{className:(0,ze.cx)(iZ(k)),onClick:function(){c&&""!==c&&v(Tn(s,d,"trace-search",_.limit,n,r,"forward",a,"".concat(c,"/api/").concat(M)))},children:"Search Traces"})]})})}var vZ=(0,ze.iv)(uZ||(uZ=(0,r.Z)(["\n display: flex;\n height:30px;\n"]))),hZ=[{label:"Search",value:"search"},{label:"TraceID",value:"traceId"}];function gZ(e){var n=e.value,t=e.onChange,r=(0,f.useState)(n||"traceId"),i=(0,u.Z)(r,2),a=i[0],o=i[1];return(0,Fe.jsx)("div",{className:(0,ze.cx)(vZ),children:(0,Fe.jsx)(Pb,{label:"Query Type",options:hZ,onChange:function(e){o((function(n){return e})),t(e)},defaultActive:a})})}function mZ(e,n,t,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=(0,f.useState)(!1),o=(0,u.Z)(a,2),l=o[0],s=o[1],c=(0,f.useState)([]),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,hr.mm)(n),g=(0,hr.uk)(t),m=(0,hr.qX)(e,r,i),x=(0,f.useMemo)((function(){return(0,Ny.Bp)(m.url,h,g)}),[m.url,h,g]);return(0,f.useEffect)((function(){(0,Ny.jY)(m,x,s,v)}),[m]),{loading:l,logsResponse:(0,f.useMemo)((function(){var e,n,t;return null!==p&&void 0!==p&&null!==(e=p.data)&&void 0!==e&&e.data&&Array.isArray(null===p||void 0===p||null===(n=p.data)||void 0===n?void 0:n.data)?null===(t=p.data.data)||void 0===t?void 0:t.map((function(e){return{label:e,value:e}})):[{label:"",value:""}]}),[p])}}var xZ,bZ,yZ,ZZ=t(81400),wZ=t(23860),SZ=t(24754),jZ=t.n(SZ),kZ=t(64664),CZ=t(31852),TZ=function(e){return(0,ze.iv)(xZ||(xZ=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n .operation-header {\n background: ",";\n color: ",";\n padding: 0px 8px;\n border-bottom: 1px solid ",";\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 28px;\n span {\n // font-weight: bold;\n font-size: 12px;\n }\n .operation-tools {\n display: none;\n align-items: center;\n }\n &:hover .operation-tools {\n display: flex;\n }\n }\n .operation-body {\n padding: 8px;\n }\n"])),e.viewBg,e.textColor,e.buttonBorder)},_Z=function(e){return(0,ze.iv)(bZ||(bZ=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n gap: 3px;\n .input-group {\n display: flex;\n align-items: center;\n gap: 3px;\n justify-content: space-between;\n }\n .col {\n flex-direction: column;\n }\n .end {\n justify-content: flex-end;\n }\n .wrap {\n display: table;\n }\n label {\n font-size: 12px;\n color: ",";\n }\n input {\n height: 26px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 0px 6px;\n max-width: 100px;\n &.checkbox {\n font-size: 12px;\n height: 12px;\n }\n }\n\n select {\n height: 26px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 0px 6px;\n }\n button {\n height: 26px;\n color: ",";\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 4px 8px;\n cursor: pointer;\n font-size: 12px;\n }\n\n .binary-operation-bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: ",";\n border-radius: 3px;\n padding: 6px;\n .binary-operation-cont {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n }\n"])),e.textColor,e.textColor,e.inputBg,e.buttonBorder,e.textColor,e.inputBg,e.buttonBorder,e.textColor,e.inputBg,e.buttonBorder,e.widgetContainer)},IZ=(0,ze.iv)(yZ||(yZ=(0,r.Z)(["\n margin: 0px;\n padding: 0px;\n height: 12px;\n width: 12px;\n cursor: pointer;\n"]))),DZ=function(e){var n=e.initial,t=e.onChange,r=(0,f.useMemo)((function(){var e;return null===(e=["$__interval","1m","5m","10m","1h","24h"])||void 0===e?void 0:e.map((function(e){return{name:e,value:e}}))}),[]);return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:r.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})},NZ=function(e){var n=e.initial,t=e.onChange,r=(0,f.useMemo)((function(){var e;return null===(e=["0.25","0.5","0.75","0.9","0.99"])||void 0===e?void 0:e.map((function(e){return{name:e,value:e}}))}),[]);return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:r.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})},MZ=function(e){var n=e.initial,t=e.onChange,r=e.opts;return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:r.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})},EZ=function(e){var n=e.initial,t=e.onChange,r=(0,f.useMemo)((function(){var e;return null===(e=["duration","duration_seconds","bytes",""])||void 0===e?void 0:e.map((function(e){return{name:e,value:e}}))}),[]);return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:r.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})},RZ=function(e){var n=e.initial,t=e.onChange,r=e.labels,i=(0,f.useMemo)((function(){return(null===r||void 0===r?void 0:r.map((function(e){return{name:e,value:e}})))||[{name:"Select Label",value:""}]}),[]);return(0,Fe.jsx)("select",{defaultValue:n,onChange:t,children:i.map((function(e,n){return(0,Fe.jsx)("option",{value:e.value,children:e.name},n)}))})};function OZ(e){var n,t={};if((null===e||void 0===e||null===(n=e.headers)||void 0===n?void 0:n.length)>0){var r,i=(0,s.Z)(e.headers);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=(0,B.Z)({},String(a.header),a.value);t=(0,l.Z)((0,l.Z)({},t),o)}}catch(u){i.e(u)}finally{i.f()}}return t}var LZ=function(e){var n,t=OZ(e),r={headers:(0,l.Z)((0,l.Z)({},t),{},{"Content-Type":"application/json"})},i={};if(null===e||void 0===e||null===(n=e.auth)||void 0===n?void 0:n.basicAuth.value){var a,o,u,c=null===e||void 0===e||null===(a=e.auth)||void 0===a||null===(o=a.fields)||void 0===o?void 0:o.basicAuth,d=(0,s.Z)(c);try{for(d.s();!(u=d.n()).done;){var f=u.value;"user"===f.name&&(i.username=f.value),"password"===f.name&&(i.password=f.value)}}catch(p){d.e(p)}finally{d.f()}}return{basicAuth:i,options:r,headers:(0,l.Z)((0,l.Z)({},t),{},{"Content-Type":"application/json"})}},VZ=function(){var e=(0,F.Z)((0,z.Z)().mark((function e(n,t,r,i,a){var o,s;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.prev=1,o=(0,l.Z)((0,l.Z)({},t),{},{auth:r}),e.next=5,q().get(n,o);case 5:(s=e.sent)&&a(s||[]),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),console.error("Error fetching labels"),console.error(e.t0);case 13:i(!1);case 14:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(n,t,r,i,a){return e.apply(this,arguments)}}();function zZ(){return(zZ=(0,F.Z)((0,z.Z)().mark((function e(n,t,r,i){var a,o,l;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.url||""===n.url){e.next=4;break}return a=LZ(n),o=a.basicAuth,l=a.options,e.next=4,VZ(t,l,o,r,i);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var FZ,BZ,HZ,PZ,qZ,AZ,QZ,WZ,UZ,JZ,GZ,KZ=function(e){return(0,f.useMemo)((function(){return e.getTime()+"000000"}),[e])},YZ=function(e,n,t,r){return(0,f.useMemo)((function(){return function(e,n,t,r){return"".concat(e).concat("/loki/api/v1/series?match").concat(encodeURIComponent("[]"),"=").concat(encodeURIComponent(n),"&start=").concat(t,"&end=").concat(r)}(e,n,t,r)}),[e,t,r,n])},XZ=function(e){return(0,f.useMemo)((function(){var n,t,r,i;return null!==e&&void 0!==e&&null!==(n=e.data)&&void 0!==n&&n.data&&Array.isArray(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.data)&&(null===e||void 0===e||null===(r=e.data)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.length)>0?function(e){var n;return Array.from(new Set(null===(n=e.map((function(e){return Object.keys(e)})))||void 0===n?void 0:n.flat()))}(e.data.data):[]}),[e])},$Z=function(e,n){return(0,f.useMemo)((function(){var e;return null!==n&&void 0!==n&&n.labelOpts&&(null===(e=n.labelOpts)||void 0===e?void 0:e.filter((function(e){return"__name__"!==e})))||[]}),[e,n])},ew=function(e){var n=e.setOperations,t=e.id,r=(0,hr.Fg)(),i=(0,f.useState)([]),a=(0,u.Z)(i,2),l=a[0],s=a[1],c=(0,f.useCallback)((function(e,r){s((function(n){var t,i=(0,H.Z)(n);return i[r]=null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value,i})),n((function(n){var i=(0,H.Z)(n);return null===i||void 0===i?void 0:i.map((function(n){return n.id===t?(n.expressions[r]=e.target.value,n):n}))}))}),[]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(r)),children:[Array.isArray(l)&&(null===l||void 0===l?void 0:l.length)>0?null===l||void 0===l?void 0:l.map((function(e,r){return(0,Fe.jsxs)("div",{className:"input-group",children:[" ",(0,Fe.jsx)("input",{className:"expression-input",value:o().sanitize(e),onChange:function(e){return c(e,r)}})," ",(0,Fe.jsx)("button",{onClick:function(e){return function(e,r){s((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.filter((function(e,n){return n!==r}))})),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){var n;return e.id===t?(e.expressions=null===(n=(0,H.Z)(null===e||void 0===e?void 0:e.expressions))||void 0===n?void 0:n.filter((function(e,n){return n!==r})),e):e}))}))}(0,r)},children:"x"})," "]},r)})):null,(0,Fe.jsx)("button",{onClick:function(){s((function(e){return[].concat((0,H.Z)(e),[""])})),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.expressions=[].concat((0,H.Z)(e.expressions),[""]),e):e}))}))},children:"Add Expression"})]})},nw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)(),c=(0,f.useCallback)((function(e){l(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.expressions[0]=e.target.value,n):n}))}))}),[a]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"",onChange:c})})},tw=function(e){var n=e.setOperations,t=e.id,r=(0,hr.Fg)(),i=(0,f.useState)(""),a=(0,u.Z)(i,2),l=a[0],s=a[1],c=(0,f.useCallback)((function(e){s(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.labelValue=e.target.value,n):n}))}))}),[l]),d=(0,f.useCallback)((function(e){n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.conversion_function=e.target.value,n):n}))}))}),[]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(r)),children:[(0,Fe.jsx)("input",{value:o().sanitize(l),placeholder:"Unrap Label",onChange:c}),(0,Fe.jsx)(EZ,{initial:"",onChange:d,className:"expression-input"})]})},rw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)(),c=(0,f.useCallback)((function(e){l(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.expressions[0]=e.target.value,n):n}))}))}),[a]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"",onChange:c})})},iw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)(),c=(0,f.useCallback)((function(e){l(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.expressions[0]=e.target.value,n):n}))}))}),[a]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"{{.status_code}}",onChange:c})})},aw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,f.useState)("1"),c=(0,u.Z)(s,2),d=c[0],p=c[1],v=(0,hr.Fg)();return(0,f.useEffect)((function(){var e=[a,d].join(",");n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.after_args=","+e,n):n}))}))}),[a,d]),(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(v)),children:[(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Minimum Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(n){return e.target.value}))}})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Maximum Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(d),placeholder:"1",onChange:function(e){p((function(n){return e.target.value}))}})]})]})},ow=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)();return(0,f.useEffect)((function(){var e=[a].join(",");n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.after_args=","+e,n):n}))}))}),[a]),(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("label",{children:"Minimum Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(n){return e.target.value}))}})]})})},lw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)();return(0,f.useEffect)((function(){var e=[a].join(",");n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.after_args=","+e,n):n}))}))}),[a]),(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("label",{children:"Maximum Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(n){return e.target.value}))}})]})})},sw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)();return(0,f.useEffect)((function(){n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.prev_args=a+", ",e):e}))}))}),[a]),(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("label",{children:"Quantile"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(){return e.target.value}))}})]})})},uw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)("1"),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)();return(0,f.useEffect)((function(){n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.after_args=","+a,e):e}))}))}),[a]),(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("label",{children:"Nearest Scalar"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"1",onChange:function(e){l((function(n){return e.target.value}))}})]})})},cw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,f.useState)("$1"),c=(0,u.Z)(s,2),d=c[0],p=c[1],v=(0,f.useState)(""),h=(0,u.Z)(v,2),g=h[0],m=h[1],x=(0,f.useState)("(.*)"),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,hr.Fg)();return(0,f.useEffect)((function(){n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.after_args=', "'+a+'", "'+d+'", "'+g+'", "'+y+'"',e):e}))}))}),[a,d,g,y]),(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(w)),children:[(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Destination Label"}),(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:a,onChange:function(e){l(e.target.value)}})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Replacement"}),(0,Fe.jsx)("input",{value:o().sanitize(d),placeholder:d,onChange:function(e){p(e.target.value)}})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Source Label"}),(0,Fe.jsx)("input",{value:o().sanitize(g),placeholder:g,onChange:function(e){m(e.target.value)}})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Regex"}),(0,Fe.jsx)("input",{value:o().sanitize(y),placeholder:y,onChange:function(e){Z(e.target.value)}})]})]})},dw=function(e){return(0,Fe.jsx)(Fe.Fragment,{})},fw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(e.range),i=(0,u.Z)(r,2),a=i[0],o=i[1],l=(0,hr.Fg)(),s=(0,f.useCallback)((function(e){var r=e.target.value;o(r),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.range=r,e):e}))}))}),[a]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(l)),children:(0,Fe.jsx)(DZ,{onChange:s,initial:a})})},pw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(e.quantile),i=(0,u.Z)(r,1)[0];(0,f.useEffect)((function(){n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.prev_args="".concat(e.quantile,","),n):n}))}))}),[e.quantile]);var a=(0,hr.Fg)(),o=(0,f.useCallback)((function(e){var r=e.target.value;n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.quantile=r,e):e}))}))}),[i]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(a)),children:(0,Fe.jsx)(NZ,{onChange:o,initial:e.quantile})})},vw=function(e){var n=e.setOperations,t=e.id,r=$Z(t,e),i=(0,f.useState)(""),a=(0,u.Z)(i,2),l=a[0],s=a[1],c=(0,f.useState)(e.labels||[""]),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useState)(","),g=(0,u.Z)(h,2),m=g[0],x=g[1],b=(0,hr.Fg)(),y=(0,f.useCallback)((function(e,n){v((function(e){var t=(0,H.Z)(e);return null===t||void 0===t?void 0:t.filter((function(e,t){return t!==n}))}))}),[p]);return(0,f.useEffect)((function(){var e=p.join('"'+m+'"');n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.after_args=', "'+l+'", "'+m+'", "'+e+'"',n):n}))}))}),[l,p,m]),(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(b)),children:[(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Destination Label"}),(0,Fe.jsx)(RZ,{initial:"",onChange:function(e){s((function(){return e.target.value}))},className:"expression-input",labels:r})]}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Replacement"}),(0,Fe.jsx)("input",{value:o().sanitize(m),placeholder:m,onChange:function(e){x((function(){return e.target.value}))}})]}),(0,Fe.jsx)("div",{className:"input-group col",children:null===p||void 0===p?void 0:p.map((function(e,n){return(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Source Label"}),(0,Fe.jsx)(RZ,{initial:"",onChange:function(e){return function(e,n){v((function(t){var r,i=(0,H.Z)(t);return i[n]=null===e||void 0===e||null===(r=e.target)||void 0===r?void 0:r.value,i}))}(e,n)},className:"expression-input",labels:r}),(0,Fe.jsx)("button",{onClick:function(e){return y(e,n)},children:"x"})," "]},n)}))}),(0,Fe.jsx)("div",{className:"input-group end",children:(0,Fe.jsx)("button",{onClick:function(e){v((function(e){return[].concat((0,H.Z)(e),[""])}))},children:"+ Add Source Label"})})]})},hw=function(e){var n=e.setOperations,t=e.id,r=$Z(t,e),i=(0,f.useState)(e.labels||[]),a=(0,u.Z)(i,2),l=a[0],s=a[1],c=(0,f.useState)(e.range),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useState)(e.quantile),g=(0,u.Z)(h,2),m=g[0],x=g[1],b=(0,hr.Fg)(),y=(0,f.useCallback)((function(e,r){s((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.filter((function(e,n){return n!==r}))})),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){var n;return e.id===t?(e.labels=null===(n=(0,H.Z)(null===e||void 0===e?void 0:e.labels))||void 0===n?void 0:n.filter((function(e,n){return n!==r})),e):e}))}))}),[l]),Z=(0,f.useCallback)((function(e,r){s((function(n){var t,i=(0,H.Z)(n);return i[r]=null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value,i})),n((function(n){var i=(0,H.Z)(n);return null===i||void 0===i?void 0:i.map((function(n){return n.id===t?(n.labels[r]=e.target.value,n):n}))}))}),[l]),w=(0,f.useCallback)((function(e){var r=e.target.value;x(r),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.quantile=r,e):e}))}))}),[p]),S=(0,f.useCallback)((function(e){var r=e.target.value;v(r),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.range=r,e):e}))}))}),[p]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(b)),children:[Array.isArray(l)&&(null===l||void 0===l?void 0:l.length)>0?null===l||void 0===l?void 0:l.map((function(e,n){return(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)(RZ,{initial:"",onChange:function(e){return Z(e,n)},className:"expression-input",labels:r}),(0,Fe.jsx)("button",{onClick:function(e){return y(e,n)},children:"x"})," "]},n)})):null,"Quantile Over Time"===e.header&&(0,Fe.jsx)("input",{onChange:w,value:o().sanitize(m)}),(0,Fe.jsx)("button",{onClick:function(e){s((function(e){return[].concat((0,H.Z)(e),[""])}))},children:"Add Label"}),(0,Fe.jsx)(DZ,{onChange:S,initial:p})]})},gw=function(e){var n,t=e.setOperations,r=e.id,i=e.aggrType,a=$Z(r,e),l=(0,f.useState)([""]),s=(0,u.Z)(l,2),c=s[0],d=s[1],p=(0,f.useState)(e.kValue||[]),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,hr.Fg)(),x=(0,f.useCallback)((function(e,n){d((function(e){var t=(0,H.Z)(e);return null===t||void 0===t?void 0:t.filter((function(e,t){return t!==n}))})),t((function(e){var t=(0,H.Z)(e);return null===t||void 0===t?void 0:t.map((function(e){var t;return e.id===r?(e.labels=null===(t=(0,H.Z)(null===e||void 0===e?void 0:e.labels))||void 0===t?void 0:t.filter((function(e,t){return t!==n})),e):e}))}))}),[c]),b=(0,f.useCallback)((function(e,n){d((function(t){var r,i=(0,H.Z)(t);return i[n]=null===e||void 0===e||null===(r=e.target)||void 0===r?void 0:r.value,i})),t((function(t){var i=(0,H.Z)(t);return null===i||void 0===i?void 0:i.map((function(t){return t.id===r?(t.labels[n]=e.target.value,t):t}))}))}),[c]),y=(0,f.useCallback)((function(e){g(e.target.value),t((function(n){var t=(0,H.Z)(n);return null===t||void 0===t?void 0:t.map((function(n){return n.id===r?(n.kValue=e.target.value,n):n}))}))}),[h]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(m)),children:[(n=i,("topk"===n||"bottomk"===n)&&(0,Fe.jsx)("input",{type:"number",value:o().sanitize(String(h)),placeholder:"",onChange:y})),Array.isArray(c)&&(null===c||void 0===c?void 0:c.length)>0?null===c||void 0===c?void 0:c.map((function(e,n){return(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)(RZ,{initial:"",onChange:function(e){return b(e,n)},className:"expression-input",labels:a}),(0,Fe.jsx)("button",{onClick:function(e){return x(e,n)},children:"x"})," "]},n)})):null,(0,Fe.jsx)("button",{onClick:function(e){d((function(e){return[].concat((0,H.Z)(e),[""])})),t((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===r?(e.labels=(0,H.Z)(c),e):e}))}))},children:"Add Label"})]})},mw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)({label:"",operator:"equals",value:""}),i=(0,u.Z)(r,2),a=i[0],s=i[1],c=(0,hr.Fg)(),d=(0,f.useMemo)((function(){return[{name:"=",value:"equals"},{name:"!=",value:"not_equals"},{name:"=~",value:"regex_equals"},{name:"!~",value:"regex_not_equals"},{name:">",value:"more"},{name:"<",value:"less"},{name:">=",value:"more_equals"},{name:"<=",value:"less_equals"}]}),[]);(0,f.useEffect)((function(){n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.labelFilter=(0,l.Z)({},a),e):e}))}))}),[a]);var p=(0,f.useCallback)((function(e,n){s((function(t){return(0,l.Z)((0,l.Z)({},t),{},(0,B.Z)({},n,e.target.value))}))}),[]);return"No Pipeline Errors"!==e.header?(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(c)),children:[(0,Fe.jsx)("input",{value:o().sanitize(a.label),placeholder:"Text Filter",onChange:function(e){return p(e,"label")}}),(0,Fe.jsx)("select",{defaultValue:"equals",onChange:function(e){return p(e,"operator")},children:d.map((function(e,n){return(0,Fe.jsx)("option",{value:o().sanitize(e.value),children:e.name},n)}))}),(0,Fe.jsx)("input",{value:o().sanitize(a.value),placeholder:"Text Filter",onChange:function(e){return p(e,"value")}})]}):null},xw=function(e){var n=e.setOperations,t=e.id,r=e.binaryOperation,i=(0,hr.Fg)(),a=(0,f.useState)(r||{value:0,bool:!1}),s=(0,u.Z)(a,2),c=s[0],d=s[1],p=(0,f.useCallback)((function(e,r){var i="value"===r?e.target.value:!!e.target.checked;d((function(e){return(0,l.Z)((0,l.Z)({},e),{},(0,B.Z)({},r,i))})),n((function(e){var n=(0,H.Z)(e);return null===n||void 0===n?void 0:n.map((function(e){return e.id===t?(e.binaryOperation=(0,l.Z)((0,l.Z)({},e.binaryOperation),{},(0,B.Z)({},r,i)),e):e}))}))}),[c]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(_Z(i)),children:[(0,Fe.jsx)("input",{value:o().sanitize(c.value),placeholder:"Value",onChange:function(e){return p(e,"value")}}),(0,Fe.jsxs)("div",{className:"input-group",children:[(0,Fe.jsx)("label",{children:"Boolean"}),(0,Fe.jsx)("input",{type:"checkbox",className:"checkbox",checked:c.bool||!1,value:o().sanitize("Boolean"),onChange:function(e){return p(e,"bool")}})]})]})},bw=function(e){var n=e.setOperations,t=e.id,r=(0,f.useState)(""),i=(0,u.Z)(r,2),a=i[0],l=i[1],s=(0,hr.Fg)(),c=(0,f.useCallback)((function(e){l(e.target.value),n((function(n){var r=(0,H.Z)(n);return null===r||void 0===r?void 0:r.map((function(n){return n.id===t?(n.filterText=e.target.value,n):n}))}))}),[t,n]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(s)),children:(0,Fe.jsx)("input",{value:o().sanitize(a),placeholder:"Text Filter",onChange:c})})},yw=["rate","rate_counter","count_over_time","sum_over_time","bytes_rate","bytes_over_time","absent_over_time"],Zw=["avg_over_time","max_over_time","min_over_time","first_over_time","last_over_time","stdvar_over_time","stddev_over_time","quantile_over_time",""],ww=["sum","min","max","avg","stddev","stdvar","count"],Sw=["topk","bottomk"],jw=function(e,n){return yw.includes(e)?(0,Fe.jsx)(fw,(0,l.Z)({},n)):Zw.includes(e)?(0,Fe.jsx)(hw,(0,l.Z)({},n)):null},kw=function(e,n,t){switch(e){case"formats":return function(e,n){switch(e){case"json":return(0,Fe.jsx)(ew,(0,l.Z)({},n));case"pattern":return(0,Fe.jsx)(nw,(0,l.Z)({},n));case"regexp":return(0,Fe.jsx)(rw,(0,l.Z)({},n));case"line_format":return(0,Fe.jsx)(iw,(0,l.Z)({},n));case"unwrap":return(0,Fe.jsx)(tw,(0,l.Z)({},n));default:return(0,Fe.jsx)(dw,(0,l.Z)({},n))}}(n,t);case"range_functions":default:return jw(n,t);case"aggregations":return function(e,n){return ww.includes(e)||Sw.includes(e)?(0,Fe.jsx)(gw,(0,l.Z)((0,l.Z)({},n),{},{aggrType:e})):void 0}(n,t);case"line_filters":return(0,Fe.jsx)(bw,(0,l.Z)({},t));case"label_filters":return(0,Fe.jsx)(mw,(0,l.Z)({},t));case"binary_operations":return(0,Fe.jsx)(xw,(0,l.Z)({},t));case"functions":return function(e,n){return"histogram_quantile"===e?(0,Fe.jsx)(pw,(0,l.Z)({},n)):"clamp"===e?(0,Fe.jsx)(aw,(0,l.Z)({},n)):"clamp_max"===e?(0,Fe.jsx)(lw,(0,l.Z)({},n)):"clamp_min"===e?(0,Fe.jsx)(ow,(0,l.Z)({},n)):"quantile"===e?(0,Fe.jsx)(sw,(0,l.Z)({},n)):"round"===e?(0,Fe.jsx)(uw,(0,l.Z)({},n)):"label_replace"===e?(0,Fe.jsx)(cw,(0,l.Z)({},n)):"label_join"===e?(0,Fe.jsx)(vw,(0,l.Z)({},n)):jw(e,n)}(n,t)}},Cw=t(3860),Tw=t(32519),_w=t(70042),Iw=t(38499),Dw=(t(22252),t(63185),t(41434)),Nw=(0,ze.F4)(FZ||(FZ=(0,r.Z)(["\n from {\n opacity: 0;\n }\n"]))),Mw=(0,ze.F4)(BZ||(BZ=(0,r.Z)(["\n to {\n opacity: 0;\n }\n"]))),Ew=((0,ze.iv)(qZ||(qZ=(0,r.Z)(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n"]))),function(e){return(0,ze.iv)(AZ||(AZ=(0,r.Z)(["\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius: 3px;\n padding: 6px;\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-top:4px;\n margin: 3px;\n"])),e.inputBg,e.textColor,e.buttonBorder)}),Rw=(0,ze.iv)(QZ||(QZ=(0,r.Z)(["\n animation: "," 0.15s ease-out;\n"])),Nw),Ow=(0,ze.iv)(WZ||(WZ=(0,r.Z)(["\n animation: "," 0.2s ease-out forwards;\n"])),Mw),Lw=function(e,n){var t=e.hover;e.disabled;return Vs()(function(e){return(0,ze.iv)(UZ||(UZ=(0,r.Z)(["\n // color:white;\n background: "," !important;\n color: "," !important;\n border-radius: 3px;\n padding: 0.275rem 0.525rem;\n &:hover {\n background: "," !important;\n }\n"])),e.inputBg,e.textColor,e.widgetContainer)}(n),(0,B.Z)({},function(e){return(0,ze.iv)(JZ||(JZ=(0,r.Z)(["\n // color: white !important;\n color: ",";\n background: "," !important;\n"])),e.textColor,e.widgetContainer)}(n),t))},Vw=function(e,n){return Vs()(Lw(e,n),function(e){return(0,ze.iv)(PZ||(PZ=(0,r.Z)(["\n position: relative;\n font-size: 12px;\n color: "," !important;\n background: "," !important;\n &::after {\n // content: ;\n position: absolute;\n width: 4px;\n right: 0.625rem;\n }\n &:hover {\n background: "," !important;\n }\n"])),e.textColor,e.inputBg,e.widgetContainer)}(n))},zw=function(e,n){var t;return Vs()(function(e){return(0,ze.iv)(HZ||(HZ=(0,r.Z)(["\n font-family: sans-serif;\n font-size: 12px;\n user-select: none;\n color: "," !important;\n background: "," !important;\n box-shadow: 1px 1px 20px 1px rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n padding: 6px;\n min-width: 10rem;\n"])),e.textColor,e.inputBg)}(n),(t={},(0,B.Z)(t,Rw,"opening"===e.state),(0,B.Z)(t,Ow,"closing"===e.state),t))},Fw=function(e){var n=e.theme;return(0,Fe.jsx)(Cw.W,(0,l.Z)((0,l.Z)({},e),{},{menuClassName:function(e){return zw(e,n)},itemProps:{className:function(e){return Vw(e,n)}}}))},Bw={Aggregations:["Sum","Min","Max","Avg","Stddev","Stdvar","Count","Topk","Bottomk"],"Range Functions":["Rate","Rate Counter","Count Over Time","Sum Over Time","Bytes Rate","Bytes Over Time","Absent Over Time","Avg Over Time","Max Over Time","Min Over Time","First Over Time","Last Over Time","Quantile Over Time"],Formats:["Json","Logfmt","Regexp","Pattern","Unpack","Line Format","Unwrap"],"Binary Operations":["Add Scalar","Subtract Scalar","Multiply by scalar","Divide by scalar","Modulo by scalar","Exponent","Equal To","Not Equal To","Greater Than","Less Than","Greater Or Equal To","Less Or Equal To","Binary Operation With Query"],"Label Filters":["Label Filter Expression","IP Label Filter Expression","No Pipeline Errors"],"Line Filters":["Line Contains","Line Does Not Contain","Line Contains Case Insensitive","Line Does Not Contain Case Insensitive","Line Contains Regex Match","Line Does Not Match Regex","IP Line Filter Expression","IP Line Not Filter Expression"],Trigonometric:["Acos","Acosh","Asin","Asinh","Atan","Atanh","Cos","Cosh","Sin","Sinh","Tan","Tanh"],"Time Functions":["Day Of Month","Day Of Week","Days In Month"],Functions:["Histogram Quantile","Label Replace","Ln","absent","Ceil","Clamp","Clamp max","Clamp min","Deg","Exp","Floor","Group","Hour","Label join","Log10","Log2","Minute","Pi","Quantile","Rad","Round","Scalar","Sgn","Sort","Sort desc","Sqrt","Stddev","Time","Timestamp","Vector","Year"]};var Hw=function(e){return(0,ze.iv)(GZ||(GZ=(0,r.Z)(["\n margin-bottom: 6px;\n .szh-menu {\n background: "," !important;\n color: "," !important;\n }\n .szh-menu__item {\n &:hover {\n background: "," !important;\n }\n }\n"])),e.inputBg,e.textColor,e.widgetContainer)};function Pw(e){var n=e.menuClick,t=(0,f.useMemo)((function(){return Object.keys(Bw)}),[]),r=(0,hr.Fg)();return(0,Fe.jsx)(Tw.v,{className:(0,ze.cx)(Hw(r)),menuButton:(0,Fe.jsxs)(_w.j,{className:(0,ze.cx)(Ew(r)),children:[" ",(0,Fe.jsx)(Dw.Z,{style:{height:"13px",width:"13px"}}),(0,Fe.jsx)("span",{style:{fontSize:"12px",fontFamily:"sans-serif"},children:"Add Operator"})]}),children:null===t||void 0===t?void 0:t.map((function(e,t){var i;return(0,Fe.jsx)(Fw,{label:e,theme:r,children:null===(i=Bw[e])||void 0===i?void 0:i.map((function(t,r){return(0,Fe.jsx)(Iw.s,{onClick:function(r){return n(r,t,e)},style:{fontSize:"12px"},children:t},r)}))},t)}))})}function qw(e){var n,t=e.opType,r=e.onOperationSelect,i=(0,hr.Fg)();return(0,Fe.jsx)(Tw.v,{className:(0,ze.cx)(Hw(i)),menuButton:(0,Fe.jsx)(ga.Z,{style:{height:"13px",width:"13px",margin:"0px 12px",cursor:"pointer"}}),children:null===(n=Bw[t])||void 0===n?void 0:n.map((function(e,n){return(0,Fe.jsx)(Iw.s,{onClick:function(n){return r(n,e)},style:{fontSize:"12px"},children:e},n)}))})}function Aw(e){var n=e.id,t=e.opType,r=e.header,i=e.removeItem,a=e.index,o=e.setOperations,s=(0,hr.Fg)(),c=(0,f.useState)(r),d=(0,u.Z)(c,2),p=d[0],v=d[1];(0,f.useEffect)((function(){v(r)}),[r,v]);var h=(0,f.useCallback)((function(e,t){v(t),o((function(e){var r=(0,H.Z)(e);return null===r||void 0===r?void 0:r.map((function(e){return e.id===n?e=(0,l.Z)((0,l.Z)({},e),{},{header:t,name:t.toLowerCase().split(" ").join("_")}):e}))}))}),[p]),g=function(e){var n,t;return(null===e||void 0===e||null===(n=e.toLowerCase())||void 0===n||null===(t=n.split(" "))||void 0===t?void 0:t.join("_"))||""};return r&&"string"===typeof r?(0,Fe.jsxs)("div",{className:(0,ze.cx)(TZ(s)),children:[(0,Fe.jsxs)("div",{className:"operation-header",children:[(0,Fe.jsx)("span",{children:p}),(0,Fe.jsxs)("div",{className:"operation-tools",children:[(0,Fe.jsx)(qw,{opType:t,onOperationSelect:h}),(0,Fe.jsx)(br.Z,{className:(0,ze.cx)(IZ),onClick:function(e){return i(a)}})]})]}),(0,Fe.jsx)("div",{className:"operation-body",children:kw(g(t),g(r),(0,l.Z)({},e))})]}):null}var Qw,Ww="card",Uw=function(e){return{border:"1px solid ".concat(e.buttonBorder),backgroundColor:"".concat(e.inputBg),fontSize:"12px",cursor:"move",display:"flex",margin:"4px",borderRadius:"3px"}},Jw=function(e){var n=e.id,t=e.header,r=e.rate,i=e.opType,a=e.index,o=e.body,s=e.moveItem,c=e.removeItem,d=e.kValue,p=e.quantile,v=e.labelFilter,h=e.filterText,g=e.lineFilter,m=e.conversion_function,x=e.labelValue,b=e.labelOpts,y=e.binaryOperation,Z=(0,f.useRef)(null),w=(0,hr.Fg)(),S=(0,kZ.L)({accept:Ww,collect:function(e){return{handlerId:e.getHandlerId()}},hover:function(e,n){var t;if(Z.current){var r=e.index,i=a;if(r!==i){var o=null===(t=Z.current)||void 0===t?void 0:t.getBoundingClientRect(),l=(o.right-o.left)/2,u=n.getClientOffset().x-o.left;ri&&u>l||(s(r,i),e.index=i)}}}}),j=(0,u.Z)(S,2),k=j[0].handlerId,C=j[1],T=(0,CZ.c)({type:Ww,item:function(){return{id:n,index:a}},collect:function(e){return{isDragging:e.isDragging()}}}),_=(0,u.Z)(T,2),I=_[0].isDragging?.5:1;return(0,_[1])(C(Z)),(0,Fe.jsx)("div",{ref:Z,style:(0,l.Z)((0,l.Z)({},Uw(w)),{},{opacity:I}),"data-handler-id":k,children:(0,Fe.jsx)(Aw,(0,l.Z)((0,l.Z)({},e),{},{rate:r,id:n,header:t,opType:i,body:o,index:a,kValue:d,quantile:p,labelFilter:v,binaryOperation:y,conversion_function:m,labelValue:x,lineFilter:g,labelOpts:b,filterText:h,removeItem:c}))})},Gw=(0,ze.iv)(Qw||(Qw=(0,r.Z)(["\n width: 100%;\n display: flex;\n flex-wrap:wrap;\n"]))),Kw=function(e){var n=e.operations,t=e.setOperations,r=(0,f.useCallback)((function(e,n){t((function(t){return jZ()(t,{$splice:[[e,1],[n,0,t[e]]]})}))}),[]),i=(0,f.useCallback)((function(e){t((function(n){return jZ()(n,{$splice:[[e,1]]})}))}),[]),a=(0,f.useCallback)((function(n,t){return(0,f.createElement)(Jw,(0,l.Z)((0,l.Z)({},e),{},{key:n.id,index:t,id:n.id,opType:n.opType,header:n.header,kValue:n.kValue,quantile:n.quantile,labelValue:n.labelValue,conversion_function:n.conversion_function,binaryOperation:n.binaryOperation,labelOpts:n.labelOpts,lineFilter:n.lineFilter,body:n.body||(0,Fe.jsx)(Fe.Fragment,{}),moveItem:r,removeItem:i}))}),[]);return(0,Fe.jsx)(ZZ.W,{backend:wZ.PD,children:(0,Fe.jsx)("div",{className:(0,ze.cx)(Gw),children:n.map((function(e,n){return a(e,n)}))})})},Yw=function(e){var n=e.mainTheme,t=e.resetLabelsState;return(0,Fe.jsxs)("div",{className:(0,ze.cx)(Yy(n)),onClick:t,children:[(0,Fe.jsx)(Dw.Z,{className:(0,ze.cx)(Xy(n)),fontSize:"small",style:{height:"14px",width:"14px"}})," ",(0,Fe.jsx)("small",{children:"Add Labels"})]})},Xw=t(13074),$w=t(53052),eS=(0,f.forwardRef)((function(e,n){var t=e.selectOpts,r=e.mainTheme,i=e.minWidth,a=e.onChange,o=e.defaultValue,l=e.type,s=e.keyVal,c=e.objId,d=e.labelsLength,p=(0,hr.LS)(o,l,s),v=(0,f.useState)(p||$w.NQ),h=(0,u.Z)(v,2),g=h[0],m=h[1],x=(0,hr.sd)(l,s);(0,f.useEffect)((function(){(0,Ny.j6)(m,l,s)}),[d]);return(0,Fe.jsx)(Wy.ZP,{id:c,isMulti:x,options:t,styles:Uy(r,i),value:g,ref:n,defaultValue:p,theme:function(e){return(0,Ny.Pu)(e,r)},onChange:function(e){m((function(){return e})),a({value:e,id:c})}})}));var nS=function(e){var n=e.keyVal,t=e.labelOpts,r=e.labelAdd,a=e.labelRemove,s=e.onChange,c=e.labelValuesLength,d=e.id,p=e.dataSourceId,v=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useRef)(null),m=(0,hr.Fg)(),x=(0,f.useState)(n),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useState)(t[0]||{label:"Select Option",value:""}),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=function(e,n){var t=(0,i.v9)((function(e){return e})),r=t.start,a=t.stop,o=(0,i.v9)((function(e){return e.dataSources})),l=(0,f.useState)(!1),s=(0,u.Z)(l,2),c=s[0],d=s[1],p=(0,f.useState)([]),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,f.useMemo)((function(){return o.find((function(n){return n.id===e}))}),[o,e]),x=(0,hr.mm)(r),b=(0,hr.uk)(a),y=(0,f.useMemo)((function(){return(0,Ny.c8)(m.url,n,x,b)}),[m.url,x,b,n]),Z=(0,hr.QL)(h);return(0,f.useEffect)((function(){return n&&""!==n&&(0,Ny.jY)(m,y,d,g),function(){g([]),d(!1)}}),[y,m]),{logsResponse:Z,loading:c}}(p,j.value),T=C.logsResponse,_=(0,f.useState)({label:"=",value:"equals"}),I=(0,u.Z)(_,2),D=I[0],N=I[1],M=(0,f.useMemo)((function(){return"regexequals"===D.value||"regexexclude"===D.value}),[D.value]);return c>0?(0,Fe.jsxs)("div",{id:d,className:(0,ze.cx)(Jy),children:[(0,Fe.jsx)(eS,{ref:v,type:"label",isMulti:!1,defaultValue:o().sanitize(n.label),selectOpts:t,mainTheme:m,onChange:function(e){var n=e.value,t=e.id;k((function(){return{value:null===n||void 0===n?void 0:n.value,label:null===n||void 0===n?void 0:n.value}}));var r=JSON.parse(JSON.stringify(y)),i=(0,l.Z)((0,l.Z)({},r),{},{label:null===n||void 0===n?void 0:n.label,value:n.value,id:t});s(i),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{label:null===n||void 0===n?void 0:n.value})}))},keyVal:n,objId:d,minWidth:100,labelsLength:c}),(0,Fe.jsx)(eS,{ref:h,type:"operator",isMulti:!1,defaultValue:o().sanitize(n.operator),selectOpts:$w.bn,keyVal:n,mainTheme:m,onChange:function(e){var n=e.value,t=e.id,r=JSON.parse(JSON.stringify(y)),i=(0,l.Z)((0,l.Z)({},r),{},{operator:null===n||void 0===n?void 0:n.value,id:t});s(i),N((function(){return(0,l.Z)({},n)})),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{operator:null===n||void 0===n?void 0:n.value})}))},objId:d,minWidth:60,labelsLength:c}),(0,Fe.jsxs)("div",{className:(0,ze.cx)(Gy),children:[(0,Fe.jsx)(eS,{ref:g,type:"value",isMulti:M,defaultValue:o().sanitize(n.values),selectOpts:T,keyVal:n,mainTheme:m,onChange:function(e){var n=e.value,t=e.id,r=[],i=null!==n?n:{label:"",value:""};r=M&&Array.isArray(i)?null===i||void 0===i?void 0:i.map((function(e){return e.value})):[i.value];var a=JSON.parse(JSON.stringify(y)),o=(0,l.Z)((0,l.Z)({},a),{},{values:r,id:t});s(o),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{values:r})}))},objId:d,minWidth:250,labelsLength:c}),(0,Fe.jsx)(Xw.Z,{className:(0,ze.cx)(Ky(m)),style:{height:"14px",width:"14px"},onClick:function(){null!==v&&void 0!==v&&v.current&&null!==h&&void 0!==h&&h.current&&null!==g&&void 0!==g&&g.current&&a(n.id)}}),(0,Fe.jsx)(Dw.Z,{className:(0,ze.cx)(Ky(m)),style:{height:"14px",width:"14px"},onClick:r})]})]}):null},tS=function(e,n){var t=(0,i.v9)((function(e){return e})),r=t.start,a=t.stop,o=(0,i.v9)((function(e){return e.dataSources})),l=(0,f.useState)({}),s=(0,u.Z)(l,2),c=s[0],d=s[1],p=(0,f.useState)(!1),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=function(e,n){return(0,f.useMemo)((function(){return e.find((function(e){return e.id===n}))}),[e,n])}(o,e),x=KZ(r),b=KZ(a),y=YZ(m.url,n,x,b);return(0,f.useEffect)((function(){""!==n&&"{}"!==n&&function(e,n,t,r){zZ.apply(this,arguments)}(m,y,g,d)}),[y,m,g,d,n]),{loading:h,labelSeries:XZ(c)}},rS=function(e){return{result:"",range:"",setRange:function(e){this.range=e},setRate:function(){this.result+=" [".concat(this.range,"])")},setFn:function(n){this.result="".concat(e,"(").concat(n)},build:function(e){return this.setFn(e),this.setRate(),this.result}}},iS=function(e){return{result:"",range:"",quantile:.5,labels:[],labelsString:"",setQuantile:function(e){this.quantile=e},setRange:function(e){this.range=e},setRate:function(){this.result+=" [".concat(this.range,"])")},setFn:function(n){this.result="".concat(e,"(").concat(n)},build:function(e){return this.setFn(e),this.setRate(),this.result}}},aS=function(e){return{result:"",range:"",labels:[],labelsString:"",quantile:.99,setFn:function(n){this.result="quantile_over_time"!==e?"".concat(e,"(").concat(n):"".concat(e,"(").concat(this.quantile,", ").concat(n)},updRange:function(e){this.range=e},setRange:function(){this.result+="[".concat(this.range,"])")},addLabel:function(e){this.labels=[].concat((0,H.Z)(this.labels),[e])},setQuantile:function(e){this.quantile=e},setLabels:function(){this.labelsString=this.labels.join(",")},build:function(e){return this.setFn(e),this.setRange(),this.labels.length>0?(this.setLabels(),this.result+=" by(".concat(this.labelsString,")")):this.result}}},oS=function(e){return{result:"",labels:[],labelString:"",aggrType:"by",aggrTypeString:"",setAggrType:function(e){this.aggrType=e},addLabel:function(e){this.labels=[].concat((0,H.Z)(this.labels),[e])},setLabels:function(){this.labelString=this.labels.join(",")},setAggrTypeString:function(){this.aggrTypeString="".concat(this.aggrType,"(").concat(this.labelString,")")},setFn:function(n){this.result="".concat(e,"(").concat(n,")")},build:function(n){return this.setFn(n),this.labels.length>0&&(this.setLabels(),this.setAggrTypeString(),this.result="".concat(e," ").concat(this.aggrTypeString," (").concat(n,")")),this.result}}},lS=function(e){return{result:"",labels:[],labelString:"",kvalue:5,aggrType:"by",aggrTypeString:"",setAggrType:function(e){this.aggrType=e},setAggrTypeString:function(){this.aggrTypeString="".concat(this.aggrType,"(").concat(this.labelString,")")},addLabel:function(e){this.labels=[].concat((0,H.Z)(this.labels),[e])},setLabels:function(){this.labelString=this.labels.join(",")},setKValue:function(e){this.kvalue=e},setFn:function(n){this.result="".concat(e," (").concat(this.kvalue,", ").concat(n,")")},build:function(n){return this.setFn(n),this.labels.length>0&&(this.setLabels(),this.setAggrTypeString(),this.result="".concat(e," ").concat(this.aggrTypeString," (").concat(this.kvalue,", ").concat(n,")")),this.result}}},sS={line_contains:"|= `",line_does_not_contain:"!= `",line_contains_regex_match:"|~ `",line_does_not_match_regex:"!~ `",line_contains_case_insensitive:"|~ `(?i)",line_does_not_contain_case_insensitive:"!~ `(?i)",ip_line_filter_expression:"|= ip(`",ip_line_not_filter_expression:"!= ip(`"},uS=function(e){return e.includes("ip_")},cS=function(e){return{result:"",filterText:"",lineFilter:sS[e],setFilterText:function(e){this.filterText=e},setFn:function(e){this.result="".concat(e," ").concat(this.lineFilter).concat(this.filterText)},closeFn:function(){var n=uS(e)?"`)":"`";this.result+="".concat(n)},build:function(e){return this.setFn(e),this.closeFn(),this.result}}},dS={equals:"=",not_equals:"!=",regex_equals:"=~",regex_not_equals:"!~",more:">",less:"<",more_equals:">=",less_equals:"<="},fS=function(e){return{result:"",label:"",operator:"=",value:"",labelValueString:"",setLabel:function(e){this.label=e},setOperator:function(e){this.operator=dS[e]},setValue:function(e){this.value=e},setFilterType:function(n){return uS(e)?"ip(`"+n+"`)":"`"+n+"`"},setLabelValueString:function(){this.labelValueString=" "+this.label+" "+this.operator+this.setFilterType(this.value)},setFn:function(n){"no_pipeline_errors"!==e?(this.setLabelValueString(),this.result="".concat(n," |").concat(this.labelValueString)):this.result=n+" | __error__=``"},build:function(e){return this.setFn(e),this.result}}},pS={add_scalar:"+",subtract_scalar:"-",multiply_by_scalar:"*",divide_by_scalar:"/",modulo_by_scalar:"%",exponent:"^",equal_to:"==",not_equal_to:"!=",greater_than:">",less_than:"<",greater_or_equal_to:">=",less_or_equal_to:"<=",binary_operation_with_query:""},vS=function(e){return{result:"",value:"",bool:!1,boolString:"",setValue:function(e){this.value=e},setBoolean:function(e){this.bool=e},setBooleanString:function(){this.boolString=this.bool?"bool ":""},setFn:function(n){this.result="".concat(n," ").concat(pS[e]," ").concat(this.boolString).concat(this.value)},build:function(e){return this.setBooleanString(),this.setFn(e),this.result}}},hS=function(e){return{result:"",setFn:function(n){this.result="".concat(e,"(").concat(n,")")},build:function(e){return this.setFn(e),this.result}}},gS=function(e){return{result:"",setFn:function(n){this.result="".concat(e,"(").concat(n,")")},build:function(e){return this.setFn(e),this.result}}},mS=function(e){return{result:"",prev_args:"",after_args:"",setPrevArgs:function(e){this.prev_args=e},setAfterArgs:function(e){this.after_args=e},setFn:function(n){this.result="".concat(e,"(").concat(this.prev_args).concat(n).concat(this.after_args,")")},setEditableParams:function(e){"string"===typeof(null===e||void 0===e?void 0:e.after_args)&&""!==(null===e||void 0===e?void 0:e.after_args)&&this.setAfterArgs(e.after_args),"string"===typeof(null===e||void 0===e?void 0:e.prev_args)&&""!==(null===e||void 0===e?void 0:e.prev_args)&&this.setPrevArgs(e.prev_args)},build:function(e){return this.setFn(e),this.result}}},xS={json:function(){return{result:"",expressions:[],expressionsString:"",setJSON:function(e){return""!==e&&(this.result+=e+" | json"),this.result},addExpression:function(e){this.expressions=[].concat((0,H.Z)(this.expressions),[e])},setExpressions:function(){this.expressionsString=this.expressions.join(" ")},build:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.setJSON(e),this.expressions.length>0?(this.setExpressions(),this.result+" "+this.expressionsString):this.result}}},logfmt:function(){return{result:"",setLogFmt:function(){return this.result+=" | logfmt",this.result},build:function(e){return this.result+=e+this.setLogFmt(),this.result}}},unpack:function(){return{result:"",setUnPack:function(){return this.result+=" | unpack",this.result},build:function(e){return this.result+=e+this.setUnPack(),this.result}}},regexp:function(){return{result:"",expression:"",setRegex:function(e){this.result=e+" | regexp"},setExpression:function(e){this.expression=e||""},setText:function(){this.result+=" `"+this.expression+"`"},build:function(e){return this.setRegex(e),this.setText(),this.result}}},pattern:function(){return{result:"",expression:"",setPattern:function(e){this.result=e+" | pattern"},setExpression:function(e){this.expression=e||""},setText:function(){this.result+=" `"+this.expression+"`"},build:function(e){return this.setPattern(e),this.setText(),this.result}}},line_format:function(){return{result:"",expression:"",setLine:function(e){this.result=e+" | line_format"},setExpression:function(e){this.expression=e||""},setText:function(){this.result+=" `"+this.expression+"`"},build:function(e){return this.setLine(e),this.setText(),this.result}}},unwrap:function(){return{result:"",labelValue:"",conversion_function:"",setLabelValue:function(e){this.labelValue=e},setConversionFn:function(e){this.conversion_function=e},setConversionFnString:function(){this.labelValue=this.conversion_function+"("+this.labelValue+")"},setUnwrapFmt:function(){this.result=" | unwrap ",""!==this.labelValue&&""===this.conversion_function&&(this.result+=" ".concat(this.labelValue)),""!==this.conversion_function&&(this.setConversionFnString(),this.result+="".concat(this.labelValue))},build:function(e){return this.setUnwrapFmt(),e+this.result}}}},bS=function(e){return{range:rS(e),label_range:aS(e)}},yS=function(e){return{aggr:oS(e),aggr_btk:lS(e)}},ZS=function(e){return{metric_functions:gS(e),editable_functions:mS(e)}},wS=["json","logfmt","regexp","pattern","unpack","line_format","label_format","unwrap"],SS=["duration","duration_seconds","bytes",""],jS=["rate","rate_counter","count_over_time","sum_over_time","bytes_rate","bytes_over_time","absent_over_time"],kS=["changes","irate","increase","idelta","delta","holt winters","predict linear","quantile over time","deriv","resets","avg_over_time","min_over_time","max_over_time","last_over_time","present_over_time","stddev_over_time"],CS=["avg_over_time","max_over_time","min_over_time","first_over_time","last_over_time","stdvar_over_time","stddev_over_time","quantile_over_time"],TS=["line_contains","line_does_not_contain","line_contains_regex_match","line_does_not_match_regex","line_contains_case_insensitive","line_does_not_contain_case_insensitive","ip_line_filter_expression","ip_line_not_filter_expression"],_S=["add_scalar","subtract_scalar","multiply_by_scalar","divide_by_scalar","modulo_by_scalar","exponent","equal_to","not_equal_to","greater_than","less_than","greater_or_equal_to","less_or_equal_to","binary_operation_with_query"],IS=["no_pipeline_errors","ip_label_filter_expression","label_filter_expression"],DS=["acos","acosh","asin","asinh","atan","atanh","cos","cosh","sin","sinh","tan","tanh"],NS=["sum","min","max","avg","stddev","stdvar","count","count_values"],MS=["topk","bottomk"],ES=["day_of_month","day_of_week","days_in_month"],RS=["ln","absent","ceil","deg","exp","floor","group","hour","log10","log2","minute","pi","rad","scalar","sgn","sort","sort_desc","sqrt","stddev","time","timestamp","vector","year"],OS=["histogram_quantile","label_replace","clamp","clamp_max","clamp_min","label_join","quantile","round"],LS=function(e,n){return""===e?JSON.parse(JSON.stringify(n)):JSON.parse(JSON.stringify(e))},VS=function(e,n){Array.isArray(n)&&(null===n||void 0===n?void 0:n.length)>0&&n.forEach((function(n){e.addLabel(n)}))},zS=function(e,n){var t="";if(e&&"string"===typeof e){var r=(0,Ny.lo)(JSON.parse(e));(null===n||void 0===n?void 0:n.length)>0?n.forEach((function(e){if(wS.includes(e.name)){var n=LS(t,r);if(t=xS[e.name](),"unwrap"===e.name&&(""!==(null===e||void 0===e?void 0:e.labelValue)&&"string"===typeof e.labelValue&&t.setLabelValue(e.labelValue),""!==(null===e||void 0===e?void 0:e.conversion_function)&&"string"===typeof e.conversion_function&&SS.includes(e.conversion_function)&&t.setConversionFn(e.conversion_function)),"json"===e.name)!function(e,n){Array.isArray(n)&&n.length>0&&n.forEach((function(n){e.addExpression(n)}))}(t,e.expressions);else if(i=e.name,["line_format","regexp","pattern"].includes(i)){""!==(0,u.Z)(e.expressions,1)[0]&&t.setExpression(e.expressions[0])}t=t.build(n)}var i,a,o,l,s,c;if(jS.includes(e.name)){var d=LS(t,r);(t=bS(e.name).range).setRange(e.range||"$__interval"),t=t.build(d)}if(kS.includes(e.name)){var f=LS(t,r);(t=(a=e.name,{range_function:iS(a)}).range_function).setRange(e.range||"$__interval"),t=t.build(f)}if(RS.includes(e.name)){var p=LS(t,r);t=(t=ZS(e.name).metric_functions).build(p)}if(OS.includes(e.name)){var v=LS(t,r);(t=ZS(e.name).editable_functions).setEditableParams(e),t=t.build(v)}if(DS.includes(e.name)){var h=LS(t,r);t=function(e){return{trigonometric:(n=e,{result:"",setFn:function(e){this.result="".concat(n,"(").concat(e,")")},build:function(e){return this.setFn(e),this.result}})};var n}(e.name).trigonometric,t=t.build(h)}if(CS.includes(e.name)){var g=LS(t,r);t=bS(e.name).label_range,VS(t,e.labels),t.updRange(e.range||"$__interval"),"quantile_over_time"===e.name&&t.setQuantile(e.quantile),t=t.build(g)}if(NS.includes(e.name)){var m=LS(t,r);t=yS(e.name).aggr,VS(t,e.labels),t=t.build(m)}if(MS.includes(e.name)){var x=LS(t,r);t=yS(e.name).aggr_btk,VS(t,e.labels),function(e,n){e.setKValue(n)}(t,e.kValue),t=t.build(x)}if(TS.includes(e.name)){var b=LS(t,r);(t=(o=e.name,{line_filter:cS(o)}).line_filter).setFilterText(e.filterText||""),t=t.build(b)}if(IS.includes(e.name)&&null!==e&&void 0!==e&&e.labelFilter){var y,Z,w,S,j=LS(t,r);(t=null===(l=e.name,y={label_filter:fS(l)})||void 0===y?void 0:y.label_filter).setLabel((null===e||void 0===e||null===(Z=e.labelFilter)||void 0===Z?void 0:Z.label)||""),t.setOperator((null===e||void 0===e||null===(w=e.labelFilter)||void 0===w?void 0:w.operator)||"equals"),t.setValue((null===e||void 0===e||null===(S=e.labelFilter)||void 0===S?void 0:S.value)||""),t=t.build(j)}if(ES.includes(e.name)){var k,C=LS(t,r);t=(t=null===(s=e.name,k={time_function:hS(s)})||void 0===k?void 0:k.time_function).build(C)}if(_S.includes(e.name)&&null!==e&&void 0!==e&&e.binaryOperation){var T,_,I,D=LS(t,r);(t=null===(c=e.name,T={binary_operation:vS(c)})||void 0===T?void 0:T.binary_operation).setValue((null===e||void 0===e||null===(_=e.binaryOperation)||void 0===_?void 0:_.value)||1),t.setBoolean((null===e||void 0===e||null===(I=e.binaryOperation)||void 0===I?void 0:I.bool)||!1),t=t.build(D)}})):t=r}return t},FS=function(e){var n=e.dataSourceId,t=e.logsResponse,r=e.theme,i=e.setFinalQuery,a=e.setLabelsString,o=e.labelValueString,s=e.setLabelValueString,c=e.setBuilders,d=e.index,p=(0,f.useState)(e.labelValuesState||[(0,l.Z)({},$w.eW)]),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=function(e){g((function(n){var t=JSON.parse(JSON.stringify(n))||[];return null===t||void 0===t?void 0:t.filter((function(n){return n.id!==e}))})),s((function(n){var t,r=[];(null===n||void 0===n?void 0:n.length)>1&&(r=JSON.parse(n||JSON.stringify("[]")));var i=null===(t=r)||void 0===t?void 0:t.filter((function(n){return n.id!==e}));return JSON.stringify(i)}))},x=function(e){g((function(e){return[].concat((0,H.Z)(e),[(0,l.Z)((0,l.Z)({},$w.e5),{},{id:(0,Ie.x0)()})])}))},b=function(e){var n=null===h||void 0===h?void 0:h.some((function(n){return n.id===e.id}));1!==(null===h||void 0===h?void 0:h.length)||n||(g((function(){return[e]})),s((function(){return JSON.stringify([e])})));var t=(0,H.Z)(h),r=null===t||void 0===t?void 0:t.map((function(n){return n.id===e.id?(0,l.Z)({},e):n}));n&&(g((function(){return(0,H.Z)(r)})),s((function(){return JSON.stringify(r)})))};(0,f.useEffect)((function(){var e=o||JSON.stringify(""),n=(0,Ny.lo)(JSON.parse(e));a(n),i(n)}),[o]),(0,f.useEffect)((function(){c((function(e){var n=(0,H.Z)(e);return n.map((function(e){return n.indexOf(e)===d?(0,l.Z)((0,l.Z)({},e),{},{labelValuesState:(0,H.Z)(h),logsVolumeQuery:(t=(0,Ny.lo)(h),"sum by(level) (count_over_time(".concat(t,"[$__interval]))"))}):e;var t}))}))}),[h]);return Array.isArray(h)?(0,Fe.jsxs)("div",{className:(0,ze.cx)($y),children:[(null===h||void 0===h?void 0:h.length)>0&&(null===h||void 0===h?void 0:h.map((function(e,r){return(0,Fe.jsx)(nS,{dataSourceId:n,id:e.id,keyVal:e,labelOpts:t,labelAdd:x,labelRemove:m,onChange:b,currentState:h,labelValuesLength:h.length||0},r)}))),HS(r,(function(){g((function(){return[(0,l.Z)({},$w.eW)]}))}),(null===h||void 0===h?void 0:h.length)||0)]}):null},BS=function(e){var n=e.dataSourceId,t=e.setFinalQuery,r=e.labelsString,i=e.labelValueString,a=e.addBinary,o=e.setBuilders,s=e.index,c=tS(n,r).labelSeries,d=(0,f.useState)(e.operations||[]),p=(0,u.Z)(d,2),v=p[0],h=p[1];(0,f.useEffect)((function(){if(""!==i){var e=zS(i,v);t(e)}}),[v,i]);var g=(0,f.useCallback)((function(e,n,t){if("Binary Operation With Query"!==n){var r=(0,Ny.hf)(n,t,c,v);h((function(e){return(0,Ny.HA)(t,r,e)}))}else a(s)}),[v,c,r]);return(0,f.useEffect)((function(){o((function(e){var n=(0,H.Z)(e);return n.map((function(e){return n.indexOf(e)===s?(0,l.Z)((0,l.Z)({},e),{},{operations:(0,H.Z)(v)}):e}))}))}),[v]),(0,Fe.jsxs)("div",{className:(0,ze.cx)($y),children:[(0,Fe.jsx)(Pw,{menuClick:g}),(0,Fe.jsx)(Kw,(0,l.Z)((0,l.Z)({},e),{},{setOperations:h,operations:v}))]})},HS=function(e,n,t){return t<1?(0,Fe.jsx)(Yw,{mainTheme:e,resetLabelsState:n}):null};function PS(e){var n,t=function(e){var n,t={};if((null===e||void 0===e||null===(n=e.headers)||void 0===n?void 0:n.length)>0){var r,i=(0,s.Z)(e.headers);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=(0,B.Z)({},String(a.header),a.value);t=(0,l.Z)((0,l.Z)({},t),o)}}catch(u){i.e(u)}finally{i.f()}}return t}(e),r={},i={};if(null===e||void 0===e||null===(n=e.auth)||void 0===n?void 0:n.basicAuth.value){var a,o,u,c=null===e||void 0===e||null===(a=e.auth)||void 0===a||null===(o=a.fields)||void 0===o?void 0:o.basicAuth,d=(0,s.Z)(c);try{for(d.s();!(u=d.n()).done;){var f=u.value;"user"===f.name&&(i.username=f.value),"password"===f.name&&(i.password=f.value)}}catch(p){d.e(p)}finally{d.f()}r.auth=i}return r.options={method:"GET"},r.headers=(0,l.Z)((0,l.Z)({},t),{},{"Content-Type":"application/json"}),r}function qS(e){var n=(0,i.v9)((function(e){return e.dataSources})),t=(0,i.v9)((function(e){return e.start})),r=(0,i.v9)((function(e){return e.stop})),a=(0,f.useMemo)((function(){return{start:c(t).unix(),end:c(r).unix()}}),[t,r]),o=(0,f.useState)([]),l=(0,u.Z)(o,2),s=l[0],d=l[1],p=(0,f.useMemo)((function(){return n.find((function(n){return n.id===e}))}),[n,e]);return(0,f.useEffect)((function(){if("metrics"===p.type&&null!==p&&void 0!==p&&p.url&&""!==(null===p||void 0===p?void 0:p.url)){var e=PS(p),n="".concat(p.url,"/api/v1/label/__name__/values?start=").concat(a.start,"&end=").concat(a.end),t=function(){var t=(0,F.Z)((0,z.Z)().mark((function t(){var r,i;return(0,z.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,q().get(n,e);case 3:200===(null===(r=t.sent)||void 0===r?void 0:r.status)&&d((null===r||void 0===r||null===(i=r.data)||void 0===i?void 0:i.data)||[]),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log("Error at loading Span Names",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();t()}}),[]),(0,f.useMemo)((function(){return(null===s||void 0===s?void 0:s.length)>0?s.map((function(e){return{label:e,value:e}})):[{label:"",value:""}]}),[s])}var AS=function(e){var n=e.keyVal,t=e.labelOpts,r=e.valuesOpts,i=e.labelAdd,a=e.labelRemove,s=e.onChange,c=e.labelValuesLength,d=e.id,p=e.metric,v=(0,f.useRef)(null),h=(0,f.useRef)(null),g=(0,f.useRef)(null),m=(0,hr.Fg)(),x=(0,f.useState)(n),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useState)(t[0]||{label:"Select Option",value:""}),S=(0,u.Z)(w,2),j=S[0],k=S[1],C=(0,hr.ZX)(r,j),T=(0,f.useState)({label:"=",value:"equals"}),_=(0,u.Z)(T,2),I=_[0],D=_[1],N=(0,f.useMemo)((function(){return"regexequals"===I.value||"regexexclude"===I.value}),[I.value]);return c>0?(0,Fe.jsxs)("div",{id:d,className:(0,ze.cx)(Jy),children:[(0,Fe.jsx)(eS,{ref:v,type:"label",isMulti:!1,defaultValue:o().sanitize(n.label),selectOpts:t,mainTheme:m,onChange:function(e){var n=e.value,t=e.id;k((function(){return{value:null===n||void 0===n?void 0:n.value,label:null===n||void 0===n?void 0:n.value}}));var r=JSON.parse(JSON.stringify(y)),i=(0,l.Z)((0,l.Z)({},r),{},{metric:p,label:null===n||void 0===n?void 0:n.label,value:n.value,id:t});s(i),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{label:null===n||void 0===n?void 0:n.value,metric:p})}))},keyVal:n,objId:d,minWidth:100,labelsLength:c}),(0,Fe.jsx)(eS,{ref:h,type:"operator",isMulti:!1,defaultValue:o().sanitize(n.operator),selectOpts:$w.bn,keyVal:n,mainTheme:m,onChange:function(e){var n=e.value,t=e.id,r=JSON.parse(JSON.stringify(y)),i=(0,l.Z)((0,l.Z)({},r),{},{operator:null===n||void 0===n?void 0:n.value,id:t});s(i),D((function(){return(0,l.Z)({},n)})),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{operator:null===n||void 0===n?void 0:n.value})}))},objId:d,minWidth:60,labelsLength:c}),(0,Fe.jsxs)("div",{className:(0,ze.cx)(Gy),children:[(0,Fe.jsx)(eS,{ref:g,type:"value",isMulti:N,defaultValue:o().sanitize(n.values),selectOpts:C,keyVal:n,mainTheme:m,onChange:function(e){var n=e.value,t=e.id,r=[],i=null!==n?n:{label:"",value:"",metric:p};r=N&&Array.isArray(i)?null===i||void 0===i?void 0:i.map((function(e){return e.value})):[i.value];var a=JSON.parse(JSON.stringify(y)),o=(0,l.Z)((0,l.Z)({},a),{},{values:r,id:t});s(o),Z((function(e){return(0,l.Z)((0,l.Z)({},e),{},{values:r})}))},objId:d,minWidth:250,labelsLength:c}),(0,Fe.jsx)(Xw.Z,{className:(0,ze.cx)(Ky(m)),style:{height:"14px",width:"14px"},onClick:function(e){null!==v&&void 0!==v&&v.current&&null!==h&&void 0!==h&&h.current&&null!==g&&void 0!==g&&g.current&&a(n.id)}}),(0,Fe.jsx)(Dw.Z,{className:(0,ze.cx)(Ky(m)),style:{height:"14px",width:"14px"},onClick:i})]})]}):null};function QS(e){var n=e.dataSourceId,t=e.value,r=e.metricValueChange,a=e.onChange,o=e.setBuilders,s=e.index,c=e.setFinalQuery,p=e.labelValueString,v=e.setLabelValueString,h=function(e,n){var t=(0,i.v9)((function(e){return e.dataSources})),r=(0,i.v9)((function(e){return e.start})),a=(0,i.v9)((function(e){return e.stop})),o=(0,f.useMemo)((function(){return{start:d()(r).unix(),end:d()(a).unix()}}),[r,a]),l=(0,f.useState)([]),s=(0,u.Z)(l,2),c=s[0],p=s[1],v=(0,f.useMemo)((function(){return t.find((function(n){return n.id===e}))}),[t,e]),h=(0,f.useMemo)((function(){var e=encodeURIComponent('{__name__="'.concat(n,'"}')),t="match".concat(encodeURIComponent("[]"));if(n)return"".concat(t,"=").concat(e)}),[n]);return(0,f.useEffect)((function(){if("metrics"===v.type&&null!==v&&void 0!==v&&v.url&&""!==(null===v||void 0===v?void 0:v.url)&&n&&""!==n){var e=(0,Ny.wU)(v),t="".concat(v.url,"/api/v1/series?start=").concat(o.start,"&end=").concat(o.end,"&").concat(h),r=function(){var n=(0,F.Z)((0,z.Z)().mark((function n(){var r,i;return(0,z.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,q().get(t,e);case 3:200===(null===(r=n.sent)||void 0===r?void 0:r.status)&&p((null===r||void 0===r||null===(i=r.data)||void 0===i?void 0:i.data)||[]),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.log("Error at loading Span Names",n.t0);case 10:case"end":return n.stop()}}),n,null,[[0,7]])})));return function(){return n.apply(this,arguments)}}();r()}}),[v,o.end,o.start,h]),(0,f.useMemo)((function(){if((null===c||void 0===c?void 0:c.length)>0){var e=(0,H.Z)(c),n={};return e.forEach((function(e){Object.keys(e).forEach((function(t){var r;null!==(r=n[t])&&void 0!==r&&r.some((function(n){return n===e[t]}))||(n[t]=[].concat((0,H.Z)(n[t]||[]),[e[t]]))}))})),n}return{}}),[c])}(n,t),g=(0,f.useState)(e.labelValuesState||[(0,l.Z)((0,l.Z)({},$w.eW),{},{metric:t})]),m=(0,u.Z)(g,2),x=m[0],b=m[1],y=(0,hr.Fg)(),Z=(0,hr.Af)(h),w=function(e){b((function(n){var t=JSON.parse(JSON.stringify(n))||[];return null===t||void 0===t?void 0:t.filter((function(n){return n.id!==e}))})),v((function(n){var t,r=[];(null===n||void 0===n?void 0:n.length)>1&&(r=JSON.parse(n||JSON.stringify("[]")));var i=null===(t=r)||void 0===t?void 0:t.filter((function(n){return n.id!==e}));return JSON.stringify(i)}))},S=function(){b((function(e){return[].concat((0,H.Z)(e),[(0,l.Z)((0,l.Z)({},$w.e5),{},{metric:t,id:(0,Ie.x0)()})])}))},j=function(e){var n=null===x||void 0===x?void 0:x.some((function(n){return n.id===e.id}));1!==(null===x||void 0===x?void 0:x.length)||n||(b((function(){return[e]})),v((function(){return JSON.stringify([e])})));var t=(0,H.Z)(x),r=null===t||void 0===t?void 0:t.map((function(n){return n.id===e.id?(0,l.Z)({},e):n}));n&&(b((function(){return(0,H.Z)(r)})),v((function(){return JSON.stringify(r)}))),a(e)},k=function(){b((function(e){return[(0,l.Z)((0,l.Z)({},$w.eW),{},{metric:t})]}))};(0,f.useEffect)((function(){var e=p||JSON.stringify(""),n=(0,Ny.Gh)(t,JSON.parse(e));r(n),c(n)}),[p,t]),(0,f.useEffect)((function(){o((function(e){var n=(0,H.Z)(e);return n.map((function(e){return n.indexOf(e)===s?(0,l.Z)((0,l.Z)({},e),{},{labelValuesState:(0,H.Z)(x)}):e}))}))}),[x]);return(0,Fe.jsx)(I.a,{theme:y,children:(0,Fe.jsxs)("div",{className:(0,ze.cx)($y),children:[(null===x||void 0===x?void 0:x.length)>0&&(null===x||void 0===x?void 0:x.map((function(e,n){return(0,Fe.jsx)(AS,{id:e.id,idx:n,metric:t,keyVal:e,labelOpts:Z,valuesOpts:h,labelAdd:S,labelRemove:w,onChange:j,currentState:x,useValueSelectOpts:hr.ZX,labelValuesLength:(null===x||void 0===x?void 0:x.length)||0},n)}))),(null===x||void 0===x?void 0:x.length)<1?(0,Fe.jsx)(Yw,{mainTheme:y,resetLabelsState:k}):null]})})}var WS,US,JS,GS,KS,YS,XS,$S,ej,nj,tj,rj,ij,aj=function(e){var n=(0,hr.Fg)(),t=e.builders,r=e.setBuilders,i=e.dataSourceId,a=e.logsResponse;return(0,Fe.jsx)("div",{className:(0,ze.cx)(eZ),children:null===t||void 0===t?void 0:t.map((function(t,o){return(0,f.createElement)(lj,(0,l.Z)((0,l.Z)({},e),{},{builder:t,dataSourceId:i,logsResponse:a,key:o,idx:o,theme:n,setBuilders:r}))}))})},oj=function(e){var n=e.onBinaryClose,t=e.theme,r=e.onBinaryOptChange,i=e.binaryValue,a=(0,f.useState)(i.vectValue||""),l=(0,u.Z)(a,2),s=l[0],c=l[1],d=(0,f.useCallback)((function(e,n){c(e.target.value),r(e,n)}),[s]),p=(0,f.useMemo)((function(){return Object.entries($w.lX).map((function(e){var n=(0,u.Z)(e,2);return{value:n[0],name:n[1]}}))}),[$w.lX]),v=(0,f.useMemo)((function(){return Object.entries($w.fs).map((function(e){var n=(0,u.Z)(e,2);return{value:n[0],name:n[1]}}))}),[$w.lX]);return(0,Fe.jsx)("div",{children:(0,Fe.jsx)("div",{className:(0,ze.cx)(_Z(t)),children:(0,Fe.jsxs)("div",{className:"binary-operation-bar",children:[(0,Fe.jsxs)("div",{className:"binary-operation-cont",children:[(0,Fe.jsx)("label",{children:"Operator"})," ",(0,Fe.jsx)(MZ,{initial:i.binaryOpt||"divide",onChange:function(e){return r(e,"binaryOpt")},opts:p}),(0,Fe.jsx)("label",{children:"Label Matches"}),(0,Fe.jsx)(MZ,{initial:i.vectOpt||"on",onChange:function(e){return r(e,"vectOpt")},opts:v}),(0,Fe.jsx)("input",{value:o().sanitize(s),onChange:function(e){return d(e,"vectValue")}})]}),(0,Fe.jsx)("button",{onClick:n,children:" X"})]})})})},lj=function(e){var n=e.builder,t=e.theme,r=e.idx,i=e.setBuilders,a=e.logsResponse,s=e.dataSourceId,c=(0,f.useState)((0,Ny.lo)(n.labelValuesState)||""),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useMemo)((function(){if(null!==n&&void 0!==n&&n.labelValuesState){var e=(0,Ny.yv)(null===n||void 0===n?void 0:n.labelValuesState);return"{".concat(e,"}")||0}return{}}),[n.labelValuesState]),g=qS(s),m=(0,f.useState)(g[0]||{label:"",value:""}),x=(0,u.Z)(m,2),b=x[0],y=x[1],Z=(0,f.useState)(n.builderResult||""),w=(0,u.Z)(Z,2),S=w[0],j=w[1],k=(0,f.useState)(JSON.stringify(n.labelValuesState)||""),C=(0,u.Z)(k,2),T=C[0],_=C[1];(0,f.useEffect)((function(){_(JSON.stringify(n.labelValuesState))}),[n]);var I=(0,f.useCallback)((function(e){i((function(n){return(0,H.Z)(n).map((function(n,t){return t===r?(0,l.Z)((0,l.Z)({},n),{},{builderResult:e}):n}))})),j(e)}),[]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(eZ),children:[n.isBinary&&(0,Fe.jsx)(oj,{theme:t,binaryValue:o().sanitize(n.binaryValue),onBinaryOptChange:function(e,n){i((function(t){return(0,H.Z)(t).map((function(t,i){return i===r?(0,l.Z)((0,l.Z)({},t),{},{binaryValue:(0,l.Z)((0,l.Z)({},t.binaryValue),{},(0,B.Z)({},n,e.target.value))}):t}))}))},onBinaryClose:function(){i((function(e){return(0,H.Z)(e).filter((function(e,n){return n!==r}))}))}}),(0,Fe.jsx)("div",{className:(0,ze.cx)(nZ),children:!0===n.isMetrics?(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(sj,{theme:t,onMetricChange:function(e){var n=e.value;y((function(e){return{value:null===n||void 0===n?void 0:n.value,label:null===n||void 0===n?void 0:n.value}}))},dataSourceId:s}),(0,Fe.jsx)(QS,{index:r,onChange:function(e){},dataSourceId:s,value:o().sanitize(b.value),setBuilders:i,finalQuery:S,builder:n,setFinalQuery:I,labelValueString:T,setLabelValueString:_,metricValueChange:function(e){}})]}):(0,Fe.jsx)(FS,(0,l.Z)((0,l.Z)({},n),{},{dataSourceId:s,logsResponse:a,setLabelsString:v,finalQuery:S,setFinalQuery:I,labelValueString:T,setLabelValueString:_,setBuilders:i,index:r,theme:t}))}),(0,Fe.jsx)(BS,(0,l.Z)((0,l.Z)((0,l.Z)({},e),n),{},{setBuilders:i,dataSourceId:s,labelsString:function(e,n,t){return e.isMetrics?t:n}(n,p,h),labelValueString:T,setFinalQuery:I,finalQuery:S,index:r}))]},r)},sj=function(e){var n=e.dataSourceId,t=e.theme,r=e.onMetricChange,i=qS(n);return(0,Fe.jsx)(eS,{isMulti:!1,type:"metric",defaultValue:o().sanitize("Select Metric..."),selectOpts:i,mainTheme:t,onChange:r,minWidth:250,labelValuesLength:0})},uj=function(e){return(0,ze.iv)(WS||(WS=(0,r.Z)(["\n padding: 8px;\n display: flex;\n flex: 1;\n gap:4px;\n flex-direction: column;\n border-bottom: 1px solid ",";\n background: ",";\n label {\n font-size: 11px;\n color: ",";\n\n padding: 4px 10px;\n }\n .action-buttons {\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content:flex-end;\n gap:2px;\n }\n @media (min-width: 420px) {\n flex-direction: row;\n align-items: center;\n &.action-buttons {\n margin-top: 0px;\n }\n }\n"])),e.buttonBorder,e.widgetContainer,e.textColor)},cj=function(e){return(0,ze.iv)(US||(US=(0,r.Z)(["\n flex: 1;\n background: ",";\n color: ",";\n padding: 3px 6px;\n font-size: 12px;\n font-family: monospace;\n margin: 0px 5px;\n border-radius: 3px;\n line-height: 1.5;\n line-break: anywhere;\n overflow-y: scroll;\n @media (max-width: 420px) {\n margin:0px;\n }\n"])),e.inputBg,e.textColor)};function dj(e){var n=e.attributes,t=e.children,i=e.leaf,a=e.theme;return(0,Fe.jsx)("span",(0,l.Z)((0,l.Z)({},n),{},{className:(0,ze.iv)(JS||(JS=(0,r.Z)(["\n font-family: monospace;\n // background: black;\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),i.comment&&(0,ze.iv)(GS||(GS=(0,r.Z)(["\n color: blue;\n "]))),(i.operator||i.url)&&(0,ze.iv)(KS||(KS=(0,r.Z)(["\n color: ",";\n "])),a.textOff),i.keyword&&(0,ze.iv)(YS||(YS=(0,r.Z)(["\n color: #57aed4;\n "]))),(i.variable||i.regex)&&(0,ze.iv)(XS||(XS=(0,r.Z)(["\n color: #e90;\n "]))),(i.number||i.boolean||i.tag||i.constant||i.symbol||i["attr-name"]||i.selector)&&(0,ze.iv)($S||($S=(0,r.Z)(["\n color: #dd4a68;\n "]))),i.punctuation&&(0,ze.iv)(ej||(ej=(0,r.Z)(["\n color: orange;\n "]))),(i.string||i.char)&&(0,ze.iv)(nj||(nj=(0,r.Z)(["\n color: green;\n "]))),(i.function||i["class-name"]||i["attr-name"])&&(0,ze.iv)(tj||(tj=(0,r.Z)(["\n color: #dd4a68;\n "]))),i["context-labels"]&&(0,ze.iv)(rj||(rj=(0,r.Z)(["\n color: orange;\n "]))),i["label-key"]&&(0,ze.iv)(ij||(ij=(0,r.Z)(["\n color: green;\n "])))),children:t}))}function fj(e){var n;return"string"===typeof e?null===e||void 0===e?void 0:e.length:"string"===typeof(null===e||void 0===e?void 0:e.content)?null===e||void 0===e?void 0:e.content.length:null===e||void 0===e||null===(n=e.content)||void 0===n?void 0:n.reduce((function(e,n){return e+fj(n)}),0)}function pj(e){var n=(0,hr.Fg)(),t=e.queryText,r=e.searchButton,i=e.logsRateButton,a=e.queryInput,c=(0,f.useState)([{type:"paragraph",children:[{text:o().sanitize(t)}]}]),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useState)("sql"),g=(0,u.Z)(h,1)[0],m=(0,f.useCallback)((function(e){var n=(0,u.Z)(e,2),t=n[0],r=n[1],i=[];if(!my.xv.isText(t)||(null===t||void 0===t?void 0:t.length)<1)return i;var a,o=Zy().tokenize(t.text,Zy().languages[g]),l=0,c=(0,s.Z)(o);try{for(c.s();!(a=c.n()).done;){var d,f=a.value,p=l+fj(f);if("string"!==typeof f)i.push((d={},(0,B.Z)(d,f.type,!0),(0,B.Z)(d,"anchor",{path:r,offset:l}),(0,B.Z)(d,"focus",{path:r,offset:p}),d));l=p}}catch(v){c.e(v)}finally{c.f()}return i}),[g]),x=(0,f.useCallback)((function(e){return(0,Fe.jsx)(dj,(0,l.Z)((0,l.Z)({},e),{},{theme:n}))}),[]);(0,f.useEffect)((function(){v([{type:"paragraph",children:[{text:o().sanitize(e.queryText)}]}]),y.children=[{text:o().sanitize(e.queryText)}]}),[e.queryText]);var b=(0,f.useCallback)((function(e){v(e)}),[p]);(0,f.useEffect)((function(){p!==a&&""!==a&&(v([{type:"paragraph",children:[{text:o().sanitize(a)}]}]),y.children=[{text:o().sanitize(a)}])}),[a]);var y=(0,f.useMemo)((function(){return(0,by.VC)((0,xy.BU)((0,my.Jh)()))}),[]);return(0,Fe.jsxs)("div",{className:(0,ze.cx)(uj(n)),children:[(0,Fe.jsx)("label",{children:"Raw Query"}),(0,Fe.jsx)(xy.mH,{editor:y,value:p,onChange:b,children:(0,Fe.jsx)(xy.CX,{renderLeaf:x,decorate:m,className:(0,ze.cx)(cj(n)),readOnly:!0,placeholder:t})}),(0,Fe.jsxs)("div",{className:"action-buttons",children:[i,r]})]})}function vj(e){var n=e.dataSourceId,t=e.labelValueChange,r=e.searchButton,a=e.logsRateButton,o=e.queryInput,s=(0,i.v9)((function(e){return e.dataSources})),c=(0,i.v9)((function(e){return e})),d=mZ(n,c.start,c.stop,s).logsResponse,p=(0,f.useState)(""),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,I.u)(),x=(0,f.useState)([$w.DJ]),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useCallback)((function(e){Z((function(n){return[].concat((0,H.Z)(n),[(0,l.Z)((0,l.Z)({},n[e]),{},{isBinary:!0})])}))}),[y]);(0,f.useEffect)((function(){t(h)}),[h]),(0,f.useEffect)((function(){Z((function(e){return(0,H.Z)(e).map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{logsResponse:d})}))}))}),[d]);var S=function(e){var n="";return e.forEach((function(e){e.isBinary?n+="".concat(function(e){var n=e.binaryValue,t=n.binaryOpt,r=n.vectOpt,i=n.vectValue,a="";return""!==i&&(a="".concat(r,"(").concat(i,")"))," ".concat($w.lX[t]," ").concat(a)}(e)," ").concat(e.builderResult):n+=e.builderResult})),n};return(0,f.useEffect)((function(){g(S(y))}),[y]),(0,Fe.jsx)(I.a,{theme:m,children:(0,Fe.jsxs)("div",{className:(0,ze.cx)(eZ),children:[(0,Fe.jsx)(aj,{type:"metrics_search",addBinary:w,dataSourceId:n,logsResponse:d,setBuilders:Z,builders:y,finalQuery:h}),(0,Fe.jsx)(pj,{queryText:h,searchButton:r,logsRateButton:a,queryInput:o})]})})}function hj(e){var n=e.handleMetricValueChange,t=e.data,r=t.dataSourceId,a=t.hasStats,o=e.searchButton,s=e.statsSwitch,u=e.logsRateButton,c=(0,hr.Fg)(),d=(0,i.v9)((function(e){return e.isSplit}));return(0,Fe.jsxs)(I.a,{theme:c,children:[(0,Fe.jsx)("div",{className:(0,ze.cx)($y),children:(0,Fe.jsx)(vj,(0,l.Z)((0,l.Z)({},e),{},{dataSourceId:r,labelValueChange:function(e){n(e)},searchButton:o,logsRateButton:u}))}),a&&d&&(0,Fe.jsx)("div",{style:{display:"flex",margin:"10px 0px"},children:s})]})}var gj,mj={operations:[],labelsState:[],binaryValue:{binaryOpt:"divide",vectOpt:"on",vectValue:""},builderResult:"",logsVolumeQuery:"",isBinary:!1},xj={minus:"-",plus:"+",by:"*",divide:"/",exp:"^",equals:"==",not_equals:"!=",modulo:"%",more:"<",less:">",less_equals:"<=",more_equals:">="};function bj(e){var n=e.dataSourceId,t=e.labelValueChange,r=e.handleLogsVolumeChange,a=e.searchButton,o=e.queryInput,s=(0,i.v9)((function(e){return e.dataSources})),c=(0,i.v9)((function(e){return e})),d=mZ(n,c.start,c.stop,s).logsResponse,p=(0,f.useState)(""),v=(0,u.Z)(p,2),h=v[0],g=v[1],m=(0,I.u)(),x=(0,f.useState)([mj]),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,f.useCallback)((function(e){Z((function(n){return[].concat((0,H.Z)(n),[(0,l.Z)((0,l.Z)({},n[e]),{},{isBinary:!0})])}))}),[y]);(0,f.useEffect)((function(){""!==y[0].logsVolumeQuery&&r(y[0].logsVolumeQuery)}),[y]),(0,f.useEffect)((function(){t(h)}),[h]),(0,f.useEffect)((function(){Z((function(e){return(0,H.Z)(e).map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{logsResponse:d})}))}))}),[d]);var S=function(e){var n="";return e.forEach((function(e){e.isBinary?n+="".concat(function(e){var n=e.binaryValue,t=n.binaryOpt,r=n.vectOpt,i=n.vectValue,a="";return""!==i&&(a="".concat(r,"(").concat(i,")"))," ".concat(xj[t]," ").concat(a)}(e)," ").concat(e.builderResult):n+=e.builderResult})),n};return(0,f.useEffect)((function(){g(S(y))}),[y]),(0,Fe.jsx)(I.a,{theme:m,children:(0,Fe.jsxs)("div",{className:(0,ze.cx)(eZ),children:[(0,Fe.jsx)(aj,{type:"logs_search",addBinary:w,dataSourceId:n,logsResponse:d,setBuilders:Z,builders:y,finalQuery:h}),(0,Fe.jsx)(pj,{queryText:h,searchButton:a,queryInput:o})]})})}function yj(e){var n=e.handleLogValueChange,t=e.data,r=t.dataSourceId,a=t.hasStats,o=e.searchButton,s=e.statsSwitch,u=(0,hr.Fg)(),c=(0,i.v9)((function(e){return e.isSplit}));return(0,Fe.jsxs)(I.a,{theme:u,children:[(0,Fe.jsx)("div",{className:(0,ze.cx)(Ga),children:(0,Fe.jsx)(bj,(0,l.Z)((0,l.Z)({},e),{},{dataSourceId:r,labelValueChange:function(e){n(e)},searchButton:o}))}),a&&c&&(0,Fe.jsx)("div",{style:{display:"flex",margin:"10px 0px"},children:s})]})}function Zj(e,n){return"left"===e?m(n):x(n)}var wj,Sj=[{value:"range",label:"Range"},{value:"instant",label:"Instant"}],jj=[{value:"forward",label:"Forward"},{value:"backwards",label:"Backwards"}],kj=[{value:"traceId",label:"TraceId"},{value:"search",label:"Search"}],Cj=(0,ze.iv)(gj||(gj=(0,r.Z)(["\n max-width: 100%;\n"]))),Tj=function(e){var n=e.data,t=e.name,r=e.width,a=e.launchQuery,s=n.queryType,c=n.limit,d=n.id,v=n.dataSourceType,h=n.direction,g=n.dataSourceId,m=n.splitted,x=e.data,b=x.loading,y=x.hasStats,Z=x.isShowStats,S=x.isBuilder,j=x.isLogsVolume,k=x.logsVolumeQuery,C=Ib,T=Db,D=Nb,N=(0,p.TH)().hash,M=(0,i.I0)(),E=(0,wt.Z)(),R=(0,L.Z)().historyStore(),O=(0,hr.Fg)(),z=(0,i.v9)((function(e){return e})),F=z.historyOpen,B=z.isEmbed,P=z.queryHistory,q=z.start,A=z.stop,W=(0,i.v9)((function(e){return e.isSplit})),U=(0,i.v9)((function(e){return e[t]})),J=(0,_.useMediaQuery)({query:"(max-width: 1070px)"}),G=(0,f.useState)(n.expr),K=(0,u.Z)(G,2),Y=K[0],X=K[1],$=(0,f.useState)(!1),ee=(0,u.Z)($,2),ne=ee[0],te=ee[1],re=(0,f.useState)(n.expr.split(/[ ]+/).map((function(e){return{children:[{text:o().sanitize(e)}]}}))||[{children:[{text:o().sanitize("Enter a cLoki Query")}]}]),ie=(0,u.Z)(re,2),ae=ie[0],oe=ie[1],le=(0,f.useState)("traceId"),se=(0,u.Z)(le,2),ue=se[0],ce=se[1],de=(0,f.useState)([]),fe=(0,u.Z)(de,1)[0],pe=(0,f.useState)({}),ve=(0,u.Z)(pe,2),he=(ve[0],ve[1]),ge=(0,f.useState)(Z||!1),me=(0,u.Z)(ge,2),xe=me[0],be=me[1],ye=(0,f.useState)(!1),Ze=(0,u.Z)(ye,2),we=Ze[0],Se=Ze[1],je=(0,i.v9)((function(e){return e.dataSources})),ke=(0,i.v9)((function(e){return e[t]})),Ce=(0,f.useMemo)((function(){return Iy.E7.find((function(e){return e.id===g}))}),[g]);function Te(e,n){if(n&&""!==e){var t=e.match(/[^{\}]+(?=})/g);if(Array.isArray(t)&&(null===t||void 0===t?void 0:t.length)>0){var r="{".concat(null===t||void 0===t?void 0:t.join(","),"}"),i="sum by(level) (count_over_time(".concat(r,"[$__interval]))");Ie(i)}}}function _e(e){oe(e),Ne(e)}(0,f.useEffect)((function(){var e,n=(C(g,d)||"").expr,r=T(g);X(n),oe([{children:[{text:n}]}]),Te(n,j);var i=function(e,n){return null===e||void 0===e?void 0:e.find((function(e){return e.id===g}))}(je),a={};if(r&&(null===r||void 0===r?void 0:r.url)!==Ce&&""!==(null===r||void 0===r?void 0:r.url)){a=(0,l.Z)({},r);var o=(0,H.Z)(ke);o.forEach((function(e){e.id===d&&(e.dataSourceId=a.id,e.dataSourceType=a.type,e.dataSourceURL=a.url)})),M(Zj(t,o));var u=(0,H.Z)(je);u.forEach((function(e){e.id===g&&(e=a)})),M((0,_y.Z)(u))}else i&&""!==i.url&&(a=(0,l.Z)({},i));B&&M(Tn(v,Y,s,c,t,d,h,g,null===(e=a)||void 0===e?void 0:e.url))}),[]),(0,f.useEffect)((function(){X(n.expr),oe([{children:[{text:o().sanitize(n.expr)}]}])}),[n.expr]),(0,f.useEffect)((function(){var e=ae[0].children[0].text;X(e)}),[ae]),(0,f.useEffect)((function(){J&&W&&M(w(!1))}),[J]),(0,f.useEffect)((function(){var e=(C(g,d)||"").expr,n=T(g);X(e),oe([{children:[{text:o().sanitize(e)}]}]),j&&k&&Te(e,j);var r=null===je||void 0===je?void 0:je.find((function(e){return e.id===g})),i={};if(n&&(null===n||void 0===n?void 0:n.url)!==Ce&&""!==(null===n||void 0===n?void 0:n.url)){i=(0,l.Z)({},n);var a=(0,H.Z)(ke);a.forEach((function(e){e.id===d&&(e.dataSourceId=i.id,e.dataSourceType=i.type,e.dataSourceURL=i.url)})),M(Zj(t,a));var u=(0,H.Z)(je);u.forEach((function(e){e.id===g&&(e=i)})),M((0,_y.Z)(u))}else r&&""!==r.url&&(i=(0,l.Z)({},r));var f,p=Le(e).isMatrix;""!==e&&(null===e||void 0===e?void 0:e.length)>6&&M(Tn(v,e,s,c,t,d,h,g,null===(f=i)||void 0===f?void 0:f.url));j&&null!==k&&void 0!==k&&k.query&&""!==(null===k||void 0===k?void 0:k.query)&&"logs"===v&&!p&&M(Tn(v,k.query,s,c,t,d,h,g,i.url,k.customStep,!0))}),[g,d]),(0,f.useEffect)((function(){"string"===typeof Y&&(X(Y),oe([{children:[{text:o().sanitize(Y)}]}]),Ne(),j&&Te(Y,!0))}),[Y]),(0,f.useEffect)((function(){"string"===typeof a&&""!==a&&(X(a),oe([{children:[{text:o().sanitize(a)}]}]),Ne(),j&&Te(a,!0))}),[a]),(0,f.useEffect)((function(){Te(Y,j)}),[Y]);var Ie=function(e){var n=function(e,n,t,r){var i="",a=0;if(e.includes("$__interval")){var o=(r.getTime()-t.getTime())/1e3/30/Number((n/window.innerWidth).toFixed(1)),l=Math.round(o*Number(window.devicePixelRatio.toFixed(2)));i=e.replace(/\[\$__interval\]/,"[".concat(l,"s]")),a=l}else i=e;return{query:i,customStep:a}}(e,r,q,A),t=n.query,i=n.customStep;Me({query:t,customStep:i})},De=function(e){e.preventDefault();var n=je.find((function(e){return e.id===g}));if(hb(Y)&&n)try{Re(n.type,Y,s,c,d,h,n.id,n.url),j&&!k&&Te(Y,j),Oe(Y,!0),Ve(),D(Y,d,g)}catch(e){console.error(e)}else M(Q(!0)),console.log("Please make a log query",Y)},Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if((null===e||void 0===e?void 0:e.length)>0){var n=new URLSearchParams(N.replace(/#/,"")),r=null===e||void 0===e?void 0:e.map((function(e){return e.children[0].text})).join("\n"),i=(0,H.Z)(U);i.forEach((function(e){e.id===d&&r&&(e.expr=r)})),M(Zj(t,i)),n.set(t,JSON.stringify(i)),D(Y,d,g)}},Me=function(e){var n=(0,H.Z)(U);n.forEach((function(n){n.id===d&&e&&""!==e.query&&(n.logsVolumeQuery={query:e.query,customStep:e.customStep})})),M(Zj(t,n))};var Ee=function(e){e.preventDefault();var n="";0===Y.length||(n=function(e){var n="";if(0!==e.length){var t=e.startsWith("rate(");n="metrics"===v?t?(n=e.replace(/{([^}]+)}/g,"{}")).replace(/\[\d+ms\]/,"[$__interval]"):"rate(".concat(e.replace(/{([^}]+)}/g,"{}"),"[$__interval])"):t?e.replace(/\[\d+ms\]/,"[$__interval]"):"rate(".concat(e,"[$__interval])")}return n}(Y),X(n),oe([{children:[{text:o().sanitize(n)}]}]),te(hb(n))),hb(n)&&function(n){var t=je.find((function(e){return e.id===g}));try{Re(t.type,n,s,c,d,h,t.id,t.url),Ve()}catch(e){console.error(e)}}(n)};var Re=function(e,n,r,i,a,o,l,s){var u=R.add({data:JSON.stringify({type:e,queryInput:n,queryType:r,limit:i,direction:o,dataSourceId:l,url:s,panel:t,id:a}),url:window.location.hash},10);M(V(u))},Oe=function(e,n){var r=je.find((function(e){return e.id===g})),i=(0,H.Z)(U);"logs"===v&&i.forEach((function(e){e.id===d&&(e.browserOpen=!1)})),M(Zj(t,i));var a=Le(e),o=a.querySubmit,l=a.customStep,u=a.isMatrix;n&&""!==o&&(null===o||void 0===o?void 0:o.length)>6&&M(Tn(v,o,s,c,t,d,h,g,r.url,l,j&&!u)),j&&null!==k&&void 0!==k&&k.query&&""!==(null===k||void 0===k?void 0:k.query)&&!u&&M(Tn(v,k.query,s,c,t,d,h,g,r.url,k.customStep,!0))};function Le(e){var n="",t=0,i=!1;if(null!==e.match(/\((.*?)\)/)&&(i=!0),e.includes("$__interval")){i=!0;var a=(A.getTime()-q.getTime())/1e3/30/Number((r/window.innerWidth).toFixed(1)),o=Math.round(a*Number(window.devicePixelRatio.toFixed(2)));n=e.replace(/\[\$__interval\]/,"[".concat(o,"s]")),t=o}else n=e;return{customStep:t,querySubmit:n,isMatrix:i}}var Ve=function(){var e=je.find((function(e){return e.id===g})),n=E.add({data:{href:window.location.href,url:e.url,type:v,queryInput:Y,queryType:s,limit:c,panel:t,id:d},description:"From Query Submit"},10);M((0,St.Z)(n))};function Be(e){M(lt(!F))}function He(){Se(!we)}function Pe(e){var n=e.target.checked;be((function(){return n}));var r=JSON.parse(JSON.stringify(ke)),i=null===r||void 0===r?void 0:r.map((function(e){return e.id===d?(0,l.Z)((0,l.Z)({},e),{},{isShowStats:n}):e}));M(Zj(t,i))}var qe=function(e){ce((function(){return e}))};if(B)return null;return B?null:(0,Fe.jsx)("div",{className:(0,ze.cx)(Cj),id:d,children:(0,Fe.jsxs)(I.a,{theme:O,children:["metrics"!==v&&"traces"!==v&&(J||W)&&(0,Fe.jsx)(gy,(0,l.Z)((0,l.Z)({},e),{},{isSplit:m,dataSourceType:v,onShowQuerySettings:He,queryHistory:P,handleHistoryClick:Be,isTabletOrMobile:J,queryValid:ne,onSubmit:De,onSubmitRate:Ee,labels:fe,loading:b||!1,hasStats:y,showStatsOpen:xe,handleStatsOpen:Pe})),function(e,n,t,r,i,a){return"traces"===e?(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingRight:"15px",marginBottom:"4px"},children:(0,Fe.jsx)(gZ,{value:"traceId",onChange:qe})}),"traceId"===ue&&t,"search"===ue&&n]}):"metrics"===e?(0,Fe.jsxs)(Fe.Fragment,{children:[r,t]}):"logs"===e?(0,Fe.jsxs)(Fe.Fragment,{children:[S&&i,t]}):t}(v,(0,Fe.jsx)(pZ,(0,l.Z)((0,l.Z)({},e),{},{onSearchChange:function(e){he((function(){return e}))}})),(0,Fe.jsx)(Ty,(0,l.Z)((0,l.Z)({},e),{},{isSplit:m,isBuilder:S,dataSourceType:v,handleQueryChange:_e,expr:Y,queryValue:ae,handleInputKeyDown:function(e){"Enter"===e.code&&e.ctrlKey&&De(e)},queryHistory:P,handleHistoryClick:Be,queryValid:ne,onSubmit:De,onSubmitRate:Ee,isTabletOrMobile:J,labels:fe,loading:b||!1})),(0,Fe.jsx)(hj,(0,l.Z)((0,l.Z)({},e),{},{queryInput:Y,searchButton:(0,Fe.jsx)(pb,{disabled:!ne,loading:b||!1,onClick:De,isMobile:!1,alterText:"Use Query"}),logsRateButton:(0,Fe.jsx)(vb,{disabled:!ne,onClick:Ee,isMobile:!1,alterText:"Use as Rate Query"}),statsSwitch:(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Show Stats"}),(0,Fe.jsx)(Ab.Z,{checked:xe,size:"small",onChange:Pe,inputProps:{"aria-label":"controlled"}})]}),handleMetricValueChange:function(e){_e([{children:[{text:o().sanitize(e)}]}])}})),(0,Fe.jsx)(yj,(0,l.Z)((0,l.Z)({},e),{},{queryInput:Y,isBuilder:S,searchButton:(0,Fe.jsx)(pb,{disabled:!ne,loading:b||!1,onClick:De,isMobile:!1,alterText:"Use Query"}),logsRateButton:(0,Fe.jsx)(vb,{disabled:!ne,onClick:Ee,isMobile:!1,alterText:"Use as Rate Query"}),statsSwitch:(0,Fe.jsxs)("div",{className:"options-input",children:[(0,Fe.jsx)(cb,{children:"Show Stats"}),(0,Fe.jsx)(Ab.Z,{checked:xe,size:"small",onChange:Pe,inputProps:{"aria-label":"controlled"}})]}),handleLogValueChange:function(e){_e([{children:[{text:o().sanitize(e)}]}])},handleLogsVolumeChange:Ie}))),!W&&function(e,n,t,r){return!t&&!n&&("metrics"===e||"logs"===e)?r:null}(v,m,J,(0,Fe.jsx)(Gb,(0,l.Z)({},e))),function(e,n,t,r){return e||n||"flux"!==t||"traces"!==t?r:null}(J,m,v,(0,Fe.jsx)(Yb,(0,l.Z)((0,l.Z)({},e),{},{open:we,handleClose:function(){He()},actPanel:U,name:t})))]})})},_j=Tj,Ij=function(e){var n=jt.Z.div(wj||(wj=(0,r.Z)(["\n color: ",";\n padding: 10px;\n "])),(function(e){return e.theme.textColor}));return(0,Fe.jsx)(n,{children:"No labels available, please adjust API"})};function Dj(e){var n=e.label,t=e.type,r=(0,f.useState)(e.selected),i=(0,u.Z)(r,2),a=i[0],o=i[1];(0,f.useEffect)((function(){o(e.selected)}),[e.selected]);var l=(0,f.useMemo)((function(){return a?{borderColor:"#11abab",color:"#11abab"}:{}}),[a]);return(0,Fe.jsx)("small",{className:t,style:l,onClick:function(t){return e.onClick(n)},children:n})}function Nj(e){var n=e.labels,t=e.data.dataSourceType,r=function(n){"Select Metric"===n?e.onLabelSelected("__name__"):e.onLabelSelected(n)},i=(0,f.useMemo)((function(){return"metrics"!==t?n:null===n||void 0===n?void 0:n.filter((function(e){return"__name__"!==e.name}))}),[t,n]);return(0,Fe.jsxs)("div",{className:"valuelist-content",children:[i&&(0,Fe.jsx)(Fe.Fragment,{children:i.map((function(e,n){return(0,Fe.jsx)(Dj,{label:e.name,selected:e.selected,onClick:r},n)}))}),!i&&(0,Fe.jsx)(Ij,(0,l.Z)({},e))]})}function Mj(e){return e.getTime()+"000000"}var Ej,Rj,Oj,Lj=function(e,n,t,r,i){return{metrics:"".concat(e,"/api/v1/label/").concat(t,"/values"),logs:"".concat(e,"/loki/api/v1/label/").concat(t,"/values?start=").concat(r,"&end=").concat(i)}[n]};var Vj=jt.Z.div(Ej||(Ej=(0,r.Z)(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n width: 100%;\n height: 100%;\n"]))),zj=(0,jt.Z)(sa.Z)(Rj||(Rj=(0,r.Z)(["\n width: 30px;\n height: 30px;\n"]))),Fj=jt.Z.input(Oj||(Oj=(0,r.Z)(["\n background: ",";\n color: ",";\n font-size: 10px;\n border: 1px solid ",";\n border-radius: 3px;\n outline: none;\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder}));function Bj(e,n){return"left"===e?m(n):x(n)}var Hj={borderColor:"#11abab",color:"#11abab"},Pj=function(e){var n=e.value,t=e.data,r=e.onValueClick,i=(0,f.useMemo)((function(){return n.selected}),[n.selected]),a=(0,f.useState)(i),o=(0,u.Z)(a,2),s=o[0],c=o[1],d=(0,f.useMemo)((function(){return s||(null===t||void 0===t?void 0:t.metric)===n.name?Hj:{}}),[s,n.selected,t.metric,n.name]);(0,f.useEffect)((function(){c(n.selected)}),[n.selected]);return(0,Fe.jsx)("small",{className:"label-value",style:d,onClick:function(){var e=!1;c((function(n){return e=!n,!n}));var t=(0,l.Z)((0,l.Z)({},n),{},{selected:e});r(t)},children:n.name})},qj=function(e){var n=(0,i.I0)(),t=e.name,r=e.data,a=e.labelsSelected,o=e.label,c=e.queries,d=r.dataSourceId,p=r.start,v=r.stop,h=r.labels,g=(0,f.useState)(""),m=(0,u.Z)(g,2),x=m[0],b=m[1],y=function(e,n,t,r){var a,o=(0,i.v9)((function(e){return e.dataSources})),c=(0,f.useMemo)((function(){return o.find((function(n){return n.id===e}))}),[o,e]),d=null===c||void 0===c||null===(a=c.auth)||void 0===a?void 0:a.basicAuth.value,p={},v={};if(d){var h,g,m,x=null===c||void 0===c||null===(h=c.auth)||void 0===h||null===(g=h.fields)||void 0===g?void 0:g.basicAuth,b=(0,s.Z)(x);try{for(b.s();!(m=b.n()).done;){var y=m.value;"user"===y.name&&(p.username=y.value),"password"===y.name&&(p.password=y.value)}}catch(P){b.e(P)}finally{b.f()}v.auth=p}var Z=Mj(t),w=Mj(r),S=new AbortController,j=(0,f.useState)(),k=(0,u.Z)(j,2),C=k[0],T=k[1];(0,f.useEffect)((function(){T(Lj(c.url,c.type,n,Z,w))}),[n,T,c]);var _=OZ(c),I=(0,f.useState)((0,l.Z)((0,l.Z)({},_),{},{"Content-Type":"application/json"})),D=(0,u.Z)(I,1)[0],N=(0,f.useMemo)((function(){return{signal:S.signal,method:"GET"}}),[]);v.options=N,v.headers=D;var M=(0,f.useState)([]),E=(0,u.Z)(M,2),R=E[0],O=E[1],L=(0,f.useState)(!1),V=(0,u.Z)(L,2),B=V[0],H=V[1];return(0,f.useEffect)((function(){if("flux"!==c.type&&""!==n){var e=function(){var e=(0,F.Z)((0,z.Z)().mark((function e(){var n;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(H(!0),!C||""===C){e.next=12;break}return e.prev=2,e.next=5,q().get(C,v);case 5:n=e.sent,O(n||[]),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.log(e.t0);case 12:H(!1);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(){return e.apply(this,arguments)}}();e()}}),[c,C,n]),{response:R,controller:N.signal,loading:B}}(d,o,new Date(p),new Date(v)),Z=y.response,w=y.loading,S=(0,f.useState)([]),j=(0,u.Z)(S,2),k=j[0],C=j[1];(0,f.useEffect)((function(){var e,n=null===r||void 0===r||null===(e=r.labels)||void 0===e?void 0:e.find((function(e){return e.name===e})),t=null===n||void 0===n?void 0:n.values;"undefined"!==typeof t&&C(t)}),[c]);var T=(0,f.useMemo)((function(){var n,t;if((null===e||void 0===e||null===(n=e.data)||void 0===n||null===(t=n.labels)||void 0===t?void 0:t.length)<1)return[];var r=e.data.labels.find((function(e){return e.name===o}));return r?null===r||void 0===r?void 0:r.values:[]}),[e.data.labels]),_=(0,f.useMemo)((function(){var e,n;if((null===Z||void 0===Z||null===(e=Z.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.length)>0){var t,i,a,s=null===r||void 0===r||null===(t=r.labels)||void 0===t?void 0:t.find((function(e){return e.name===o})),u=null===s||void 0===s?void 0:s.values,c=new Map;return null===u||void 0===u||u.forEach((function(e){c.set(e.name,(0,l.Z)((0,l.Z)({},e),{},{label:o}))})),null===Z||void 0===Z||null===(i=Z.data)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.map((function(e){var n,t;return{label:o,name:e,selected:(null===(n=c.get(e))||void 0===n?void 0:n.selected)||!1,inverted:!1,type:"value",id:(null===(t=c.get(e))||void 0===t?void 0:t.id)||(0,Ie.x0)()}}))}return[]}),[Z]),I=(0,f.useState)(_),D=(0,u.Z)(I,2),N=D[0],M=D[1],E=(0,f.useState)(N),R=(0,u.Z)(E,2),O=R[0],L=R[1];(0,f.useEffect)((function(){M(_)}),[_,M]),(0,f.useEffect)((function(){L(N)}),[N,L]),(0,f.useEffect)((function(){if(_&&T){var e=function(e){var n=JSON.stringify(e);return JSON.parse(n)}(_),n=[];e.forEach((function(e){if(T.some((function(n){return n.name===e.name}))){var t=T.find((function(n){return n.name===e.name}));n.push((0,l.Z)({},t))}else n.push(e)})),M(n)}}),[T,_,M]);var V=function(r){var i=[];k.length>0&&(i=function(e,n){return n.some((function(n){return n.name===e.name}))?n.filter((function(n){return n.name!==e.name})):n.some((function(n){return n.name===e.name}))?void 0:[].concat((0,H.Z)(n),[(0,l.Z)({},e)])}(r,k),"metrics"===r.type&&M((function(e){var n=e.some((function(e){return e.id===r.id})),t=(0,H.Z)(e);if(n)return null===t||void 0===t?void 0:t.map((function(e){return e.id===r.id?(0,l.Z)((0,l.Z)({},e),{},{selected:!1}):(0,l.Z)((0,l.Z)({},e),{},{selected:!0})}))}))),i=[].concat((0,H.Z)(i),[(0,l.Z)({},r)]);var u=[];if((null===h||void 0===h?void 0:h.length)<1)u=[{name:o,selected:a.includes(o)&&i.length>0,values:(0,H.Z)(i)}];else if(h.some((function(e){return e.name===o}))){var d,f=(0,s.Z)(h);try{for(f.s();!(d=f.n()).done;){var p=d.value;p.name===o?(p={name:o,selected:a.includes(o)&&i.length>0,values:(0,H.Z)(i)},u.push(p)):u.push(p)}}catch(m){f.e(m)}finally{f.f()}}else u=[].concat((0,H.Z)(h),[{name:o,selected:a.includes(o)&&i.length>0,values:(0,H.Z)(i)}]);var v=null===a||void 0===a?void 0:a.map((function(e){return u.some((function(n){return n.name===e}))?u.find((function(n){return n.name===e})):{name:e,selected:!0,values:[]}})),g=(0,H.Z)(c);g.forEach((function(n){n.id===e.data.id&&(n.labels=v)})),n(Bj(t,g)),C(i)},B=(0,f.useCallback)((function(e){var n=e.target.value;b((function(e){return n})),L(""!==e?function(){return N.filter((function(e){return e.name.toLowerCase().includes(n.toLowerCase())}))}:function(){return N})}),[x]);return(0,Fe.jsxs)("div",{className:"values-column",children:[(0,Fe.jsx)("div",{className:"values-column-title",children:(0,Fe.jsx)(Aj,{resp:_,label:o,onClear:function(i){var a=uo(r.expr||"",i||o,null,"=","value"),l=(0,H.Z)(c);l.forEach((function(n){n.id===e.data.id&&(n.expr=a)})),n(Bj(t,l))},filterState:x,onFilterChange:B})}),(0,Fe.jsxs)("div",{className:"valuelist-content column",children:[w&&(0,Fe.jsx)(Vj,{children:(0,Fe.jsx)(zj,{})}),(null===N||void 0===N?void 0:N.length)>0&&(null===O||void 0===O?void 0:O.map((function(n,t){return(0,f.createElement)(Pj,(0,l.Z)((0,l.Z)({},e),{},{key:t,value:n,actPanel:c,onValueClick:V}))})))]})]})},Aj=function(e){var n=e.resp,t=e.label,r=e.onClear,i=e.filterState,a=e.onFilterChange;return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("span",{children:[(0,Fe.jsx)("span",{className:"key",children:t})," | ",null===n||void 0===n?void 0:n.length]}),(0,Fe.jsx)("span",{children:(0,Fe.jsx)(Fj,{placeholder:"Search For Values...",value:i,onChange:a})}),(0,Fe.jsx)("span",{className:"close-column",onClick:function(e){return r(t)},children:"clear"})]})};function Qj(e){var n=e.data,t=e.name,r=n.dataSourceType,a=(0,i.I0)(),o=(0,i.v9)((function(e){return e[t]})),c=(0,f.useState)(e.labelsSelected),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useMemo)((function(){return"metrics"===r?p.filter((function(e){return"__name__"!==e.name})):p}),[p,r]),g=(0,f.useMemo)((function(){return"metrics"===r?p.filter((function(e){return"__name__"===e.name})):null}),[p,r]);return(0,f.useEffect)((function(){v(e.labelsSelected)}),[e.labelsSelected,v]),(0,Fe.jsxs)("div",{className:"values-container",children:[(0,Fe.jsxs)("div",{className:"values-container-column",children:[null!==g&&p.length>0&&(0,Fe.jsx)(qj,(0,l.Z)((0,l.Z)({},e),{},{label:"__name__",type:"metrics"})),p&&(null===h||void 0===h?void 0:h.map((function(n,t){return(0,f.createElement)(qj,(0,l.Z)((0,l.Z)({},e),{},{label:n,key:t,type:"logs"}))})))]}),(0,Fe.jsx)("div",{style:{margin:"3px",marginBottom:"6px"},children:(0,Fe.jsx)(pb,{onClick:function(){var r=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=n,a=i.split("{")[0],o="";if(t){o=i.split("}")[1];var l=i.split(/[|json]/);if(ao.some((function(e){return l[1].includes(e)}))){var u=" | ".concat(r);o=o.toString().concat(u.toString())}}else o=i.split("}")[1];var c,d=[],f=(0,s.Z)(e);try{var p=function(){var e=c.value;if(e.selected&&e.values&&e.values.length>0){var n=e.values.filter((function(e){return e.selected&&!e.inverted})).map((function(e){return e.name})),t=e.values.filter((function(e){return e.selected&&e.inverted})).map((function(e){return e.name}));n.length>1?d.push("".concat(e.name,'=~"').concat(n.join("|"),'"')):1===n.length&&d.push("".concat(e.name,'="').concat(n[0],'"')),t.forEach((function(n){d.push("".concat(e.name,'!="').concat(n,'"'))}))}};for(f.s();!(c=f.n()).done;)p()}catch(v){f.e(v)}finally{f.f()}return[a,"{",d.join(","),"}",o].join("")}(n.labels,n.expr),i=(0,H.Z)(o);i.forEach((function(t){t.id===e.data.id&&(t.expr=r,t.labels=n.labels)})),a(function(e,n){return"left"===e?m(n):x(n)}(t,i))},isMobile:!1,alterText:"Use Query",loading:!1})})]})}function Wj(e){return e.getTime()+"000000"}function Uj(e){return Math.round(e.getTime()/1e3)}var Jj,Gj=function(e,n,t,r){return"metrics"===n?"".concat(e,"/api/v1/labels"):"".concat(e,"/loki/api/v1/label?start=").concat(t,"&end=").concat(r)},Kj=function(e,n){return{metrics:Uj(e),logs:Wj(e)}[n]};var Yj,Xj,$j=jt.Z.div(Jj||(Jj=(0,r.Z)(["\n background: ",";\n\n .valuesList {\n transition: 0.02s all;\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n flex-direction: column;\n font-size: 12px;\n border-radius: 4px;\n transition: 0.02s all;\n .valuelist-title {\n display: flex;\n flex-direction: column;\n flex: 1;\n justify-content: space-between;\n font-size: 1em;\n flex: 1;\n margin: 5px;\n }\n .valuelist-content {\n display: flex;\n font-size: 14px;\n align-items: center;\n flex-wrap: wrap;\n max-height: 500px;\n overflow: auto;\n .metric-label {\n background: gray;\n }\n }\n .valuelist-filter {\n display: flex;\n flex: 1;\n flex-direction: column;\n\n .valuelist-filter-title {\n font-size: 0.75em;\n }\n input {\n color: white;\n background: $black-quoise;\n padding: 6px 3px;\n border-radius: 4px;\n flex: 1;\n margin: 0px 3px;\n outline: none;\n border: none;\n }\n }\n &::-webkit-scrollbar {\n width: 10px;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: $grey-light;\n }\n }\n\n .valuelist-content {\n small {\n color: ",";\n background: ",";\n border: 1px solid ",";\n\n margin: 2px;\n padding: 2px 7px;\n border-radius: 3px;\n line-height: 1.5;\n font-size: 12px;\n cursor: pointer;\n align-items: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 40ch;\n transition: .5s all;\n &:hover {\n background: ",";\n }\n &.metric {\n color: ",";\n background: ",";\n }\n }\n }\n\n\n \n .values-container {\n .values-container-column {\n display: flex;\n flex-wrap: wrap;\n max-width: 100%;\n .values-column {\n margin: 5px;\n border-radius: 3px;\n height: fit-content;\n min-width: 278px;\n max-width: 278px;\n flex: 1;\n background: ",";\n\n .column {\n border: 1px solid ",";\n background: ",";\n border-top: none;\n max-height: 350px;\n &::-webkit-scrollbar {\n width: 10px;\n color: #58585898;\n background: #ffffff1f;\n }\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: $grey-light;\n }\n }\n .values-column-title {\n padding: 4px;\n font-size: 1em;\n border-radius: 4px 4px 0px 0px;\n display: flex;\n flex: 1;\n transition: 0.02s all;\n justify-content: space-between;\n color: ",";\n background: ",";\n border: 1px solid ",";\n .close-column {\n align-self: flex-end;\n justify-self: end;\n cursor: pointer;\n padding: 2px;\n border-radius: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n\n font-size: 10px;\n &:hover {\n background: $dark-quoise-hover;\n\n color: black;\n }\n }\n }\n }\n }\n }\n"])),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.buttonText}),(function(e){return e.theme.primaryDark}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.textColor}),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.buttonBorder})),ek=function(e,n){return"left"===e?m(n):x(n)};function nk(e){var n=e.data,t=e.name,r=e.queries,a=(0,i.I0)(),o=n.dataSourceId,c=n.labels,d=n.start,p=n.stop,h=n.id,g=_b.updateLabelSelected,m=(0,f.useState)([]),x=(0,u.Z)(m,2),b=x[0],y=x[1],Z=(0,f.useState)([]),w=(0,u.Z)(Z,2),S=w[0],j=w[1],k=(0,hi.F)(),C=function(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=(0,i.I0)(),d=a||new Date(Date.now()+3e4),p=o||new Date(Date.now()),h=(0,i.v9)((function(e){return e.dataSources})),g=(0,f.useMemo)((function(){var n=h.find((function(n){return n.id===e}));return""!==r&&(n.url=r),n}),[e,h]),m=(0,f.useState)(g.type||""),x=(0,u.Z)(m,2),b=x[0],y=x[1];(0,f.useEffect)((function(){y(g.type)}),[g,y]),n=Kj(new Date(d),b),t=Kj(new Date(p),b);var Z=(0,f.useState)(Gj(g.url,b,n,t)),w=(0,u.Z)(Z,2),S=w[0],j=w[1];(0,f.useEffect)((function(){j(Gj(g.url,b,n,t))}),[j,b,g]);var k=(0,f.useState)([]),C=(0,u.Z)(k,2),T=C[0],_=C[1],I=(0,f.useState)(!1),D=(0,u.Z)(I,2),N=D[0],M=D[1];return(0,f.useEffect)((function(){if("flux"!==g.type&&g.url&&""!==g.url){var e,n=(0,Ny.Uc)(g),t=null===g||void 0===g||null===(e=g.auth)||void 0===e?void 0:e.basicAuth.value,r={},i={};if(t){var a,o,u,d=null===g||void 0===g||null===(a=g.auth)||void 0===a||null===(o=a.fields)||void 0===o?void 0:o.basicAuth,f=(0,s.Z)(d);try{for(f.s();!(u=f.n()).done;){var p=u.value;"user"===p.name&&(i.username=p.value),"password"===p.name&&(i.password=p.value)}}catch(m){f.e(m)}finally{f.f()}r.auth=i}r.options={method:"GET"},r.headers=(0,l.Z)((0,l.Z)({},n),{},{"Content-Type":"application/json"});var h=function(){var e=(0,F.Z)((0,z.Z)().mark((function e(){var n;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(!0),e.prev=1,e.next=4,q().get(S,r).then((function(e){return e})).catch((function(e){var n="";n=e.response?"Error "+e.response.status+"at Labels ":e.request?e.request:e.message,console.log("error requesting labels"),console.log(e),c((0,v.el)({type:Ir.m.error,message:n}))}));case 4:n=e.sent,_(n||[]),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),console.log("Error fetching labels"),console.log(e.t0);case 12:M(!1);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();h()}}),[S,g]),{response:T,loading:N}}(o,"",d,p),T=C.response,_=C.loading,D=(0,f.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)>0?c.map((function(e){return{name:e.name,selected:e.selected}})):[]}),[c]);(0,f.useEffect)((function(){var e,n;null!==T&&void 0!==T&&null!==(e=T.data)&&void 0!==e&&e.data&&y(null===T||void 0===T||null===(n=T.data)||void 0===n?void 0:n.data)}),[T,y]);var N=(0,f.useMemo)((function(){if((null===b||void 0===b?void 0:b.length)>0)return null===b||void 0===b?void 0:b.map((function(e){return{name:e,selected:!1}}))}),[b]);(0,f.useEffect)((function(){N&&O(N)}),[N]);var M=(0,f.useState)(N),E=(0,u.Z)(M,2),R=E[0],O=E[1];(0,f.useEffect)((function(){if(N&&D){var e=JSON.parse(JSON.stringify(N)).map((function(e){var n=D.find((function(n){return n.name===e.name}));return n?(0,l.Z)({},n):e})),n=e.filter((function(e){return e.selected})).map((function(e){return e.name}));j(n),O(e)}}),[D,N,O]);var L=(0,f.useCallback)((function(e){var n=function(e,n){var t,r=[],i=(0,s.Z)(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.name===n?r.push((0,l.Z)((0,l.Z)({},a),{},{selected:!a.selected})):r.push(a)}}catch(o){i.e(o)}finally{i.f()}return r}(R,e),i=g(S,e);!function(e,n,i){var o=(0,H.Z)(n),s=null===n||void 0===n?void 0:n.filter((function(n){var t=null===e||void 0===e?void 0:e.find((function(e){return e.name===n.name}));return null===t||void 0===t?void 0:t.selected}));if((null===o||void 0===o?void 0:o.length)>0&&null!==n&&void 0!==n&&n.some((function(e){return e.name===i}))){var u=(0,H.Z)(r),c=null===u||void 0===u?void 0:u.map((function(e){return e.id===h?(0,l.Z)((0,l.Z)({},e),{},{labels:s}):e}));a(ek(t,c))}}(n,c,e),O(n),j(i)}),[R,S,c]);return n?(0,Fe.jsx)(I.a,{theme:k,children:(0,Fe.jsx)($j,{children:(0,Fe.jsxs)("div",{className:"valuesList",children:[(0,Fe.jsx)("div",{className:"valuelist-title",children:!_&&(0,Fe.jsx)(Nj,(0,l.Z)((0,l.Z)({},e),{},{labels:R,onLabelSelected:L}))}),(0,Fe.jsx)(Qj,(0,l.Z)((0,l.Z)({},e),{},{labelsSelected:S}))]})})}):null}jt.Z.div(Yj||(Yj=(0,r.Z)(["\n padding: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n"]))),jt.Z.div(Xj||(Xj=(0,r.Z)(["\n padding: 10px;\n color: orangered;\n border: 1px solid orangered;\n border-radius: 3px;\n font-size: 1em;\n"])));var tk,rk,ik,ak,ok,lk,sk,uk=function(e){var n=(0,hi.F)(),t=e.data.browserOpen,r=(0,f.useState)(t),i=(0,u.Z)(r,2),a=i[0],o=i[1];return(0,f.useEffect)((function(){o(t)}),[t]),a&&(0,Fe.jsx)(I.a,{theme:n,children:(0,Fe.jsx)(nk,(0,l.Z)({},e))})},ck=function(e){var n=e.data,t=n.dataSourceType,r=n.isShowStats,a=n.isBuilder,o=e.launchQuery,s=(0,i.v9)((function(e){return e.isEmbed})),u=(0,f.useMemo)((function(){return!a}),[a]);return(0,Fe.jsxs)("div",{style:{margin:"3px 0px"},children:[(0,Fe.jsx)(_j,(0,l.Z)((0,l.Z)({},e),{},{launchQuery:o})),function(n,t,r){return!n&&"logs"===t&&!r&&(0,Fe.jsx)(uk,(0,l.Z)({},e))}(s,t,a),function(n,t){return n&&t&&(0,Fe.jsx)(Ox,(0,l.Z)({},e))}(r,u)]})},dk=t(72453),fk=t(47518),pk=jt.Z.div(tk||(tk=(0,r.Z)(["\n background: ",";\n color: ",";\n display: flex;\n flex-direction:column;\n border-radius: 3px;\n margin-bottom: 3px;\n padding:5px;\n .query-title {\n display: flex;\n align-items: center;\n }\n .query-tools-cont {\n display:flex;\n align-items:center;\n justify-content:space-between;\n flex-wrap:wrap;\n }\n .query-tools {\n display: flex;\n align-items: center;\n flex-wrap:wrap;\n justify-content:space-between;\n flex:1;\n gap:2px;\n margin-top:4px;\n \n }\n .query-id {\n font-size: 13px;\n font-weight: bold;\n margin-left: 5px;\n }\n .query-title-tabs {\n display:flex;\n align-items:center;\n }\n"])),(function(e){var n=e.theme;return"".concat(n.secondaryWidgetContainer)}),(function(e){var n=e.theme;return"".concat(n.textColor)})),vk=jt.Z.button(rk||(rk=(0,r.Z)(["\n background: none;\n border: none;\n padding: 0px 2px;\n cursor: pointer;\n"]))),hk=(0,jt.Z)(yt.Z)(ik||(ik=(0,r.Z)(["\n font-size: 13px;\n color: ",";\n"])),(function(e){return e.theme.textColor})),gk=(0,jt.Z)(fk.Z)(ak||(ak=(0,r.Z)(["\n font-size: 13px;\n color: ",";\n"])),(function(e){return e.theme.textColor})),mk=(jt.Z.div(ok||(ok=(0,r.Z)(["\n display: flex;\n margin-right: 10px;\n flex-direction: row;\n margin-top: 5px;\n align-items: center;\n select {\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius:3px;\n font-size:12px;\n height:26px;\n }\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder})),jt.Z.div(lk||(lk=(0,r.Z)(["\n color: ",";\n display: flex;\n align-items: center;\n font-size: 12px;\n padding: 0px 10px;\n flex: 0;\n white-space: nowrap;\n\n border-radius: 3px 0px 0px 3px;\n"])),(function(e){return e.theme.textColor})),function(e){return(0,ze.iv)(sk||(sk=(0,r.Z)(["\n margin-left: 20px;\n font-family: monospace;\n font-size: 12px;\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 100px;\n color: ",";\n background: transparent;\n border: none;\n outline: none;\n"])),e.textColor)});function xk(e){var n=(0,f.useState)(!1),t=(0,u.Z)(n,2),r=t[0],i=t[1],a=(0,f.useState)(e.idRef),l=(0,u.Z)(a,2),s=l[0],c=l[1],d=(0,hr.Fg)();return!0===r?(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(D.Z,{title:s,children:(0,Fe.jsx)("input",{className:(0,ze.cx)(mk(d)),value:o().sanitize(s),placeholder:s,onChange:function(e){e.preventDefault();var n=e.target.value;c(n)},onKeyDown:function(n){"Enter"===n.key&&(e.onIdRefUpdate(s),i(!1))},onBlur:function(n){e.onIdRefUpdate(s),i(!1)}})})}):(0,Fe.jsxs)(Fe.Fragment,{children:[" ",(0,Fe.jsx)(D.Z,{title:s,children:(0,Fe.jsx)("p",{className:(0,ze.cx)(mk(d)),onClick:function(e){return i(!0)},children:s})})]})}var bk={height:"18px",width:"18px",marginRight:"3px"},yk={display:"flex",alignItems:"center"},Zk={display:"flex",alignItems:"flex-end"},wk={height:"14px",width:"14px",marginRight:"3px"};function Sk(e){var n=e.defaultValue,t=e.options,r=(0,f.useMemo)((function(){var e=null===t||void 0===t?void 0:t.find((function(e){return(null===e||void 0===e?void 0:e.value)===n}));return{icon:null===e||void 0===e?void 0:e.icon,label:null===e||void 0===e?void 0:e.label}}),[n,t]);return(0,Fe.jsxs)("div",{style:Zk,children:[(0,Fe.jsx)(Dy.JO,{icon:r.icon,style:wk}),(0,Fe.jsx)("div",{children:r.label})]})}var jk,kk,Ck=function(e){var n=Qy.c.Option,t=e.data,r=t.label,i=t.icon;return(0,Fe.jsx)(n,(0,l.Z)((0,l.Z)({},e),{},{children:(0,Fe.jsxs)("div",{style:yk,children:[(0,Fe.jsx)(Dy.JO,{icon:i,style:bk}),(0,Fe.jsx)("span",{style:{fontSize:"14px"},children:r})]})}))},Tk=function(e){var n=e.data,t=n.icon,r=n.label;return(0,Fe.jsxs)("div",{style:Zk,children:[(0,Fe.jsx)(Dy.JO,{icon:t,style:wk}),(0,Fe.jsx)("div",{children:r})]})},_k=(0,f.forwardRef)((function(e,n){var t=e.options,r=e.onSelectChange,i=(0,hr.Fg)();return(0,Fe.jsx)(Wy.ZP,{styles:Uy(i,100),placeholder:(0,Fe.jsx)(Sk,(0,l.Z)({},e)),options:t,ref:n,components:{Option:Ck,SingleValue:Tk},theme:function(e){return(0,Ny.Pu)(e,i)},onChange:r})})),Ik=function(e){var n=e.value,t=e.onChange,r=e.opts,i=e.extValue,a=(0,f.useRef)(null);(0,f.useEffect)((function(){(null===n||void 0===n?void 0:n.value)!==i&&""!==i&&(a.current.value=i)}),[]),(0,f.useEffect)((function(){(null===n||void 0===n?void 0:n.value)!==i&&""!==i&&null!==a&&void 0!==a&&a.current&&a.current.setValue(i)}),[i]);var o=(0,f.useMemo)((function(){return r.map((function(e){return{value:null===e||void 0===e?void 0:e.value,label:null===e||void 0===e?void 0:e.name,icon:null===e||void 0===e?void 0:e.icon}}))}),[r]);return r?(0,Fe.jsx)(_k,{ref:a,defaultValue:i,options:o,onSelectChange:function(e){t({target:{value:null===e||void 0===e?void 0:e.value}})}}):null},Dk=jt.Z.button(jk||(jk=(0,r.Z)(["\npadding:3px 12px;\nfont-size: 12px;\nline-height:20px;\ncursor:pointer;\nuser-select: none;\nborder:none;\nborder-radius: 3px;\nfont-weight: 500;\nwhite-space: nowrap;\ndisplay:flex;\nalign-items: center;\n"]))),Nk=(0,jt.Z)(Dk)(kk||(kk=(0,r.Z)(["\n background: ",";\n border:1px solid ",";\n color: ",";\n cursor: pointer;\n text-overflow: ellipsis;\n transition: 0.2s all;\n height:26px;\n margin: 0px 6px;\n span {\n margin-left: 4px;\n color: ",";\n }\n &:hover {\n background: ",";\n }\n"])),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonHover}));function Mk(e){var n=e.side,t=e.isSplit,r=(0,i.v9)((function(e){return e[n]})),a=(0,i.v9)((function(e){return e.left})),o=(0,i.v9)((function(e){return e.right})),s=(0,i.I0)(),c=t?"Close Split View":"Split View";return(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsx)(D.Z,{title:c,children:(0,Fe.jsx)(Nk,{onClick:function(e){(e.preventDefault(),e.stopPropagation(),t)?(!function(e,n,t,r){var i=(0,u.Z)(e,2),a=i[0],o=i[1],s=(0,H.Z)(t),c=null===s||void 0===s?void 0:s.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{open:!1})}));"left"===n&&o&&r(m((0,H.Z)(c))),"right"===n&&a&&r(x((0,H.Z)(c)))}([a[0].open,o[0].open],n,r,s),s(w(!1))):(!function(e,n){var t=(0,u.Z)(e,2),r=t[0],i=t[1],a=(0,H.Z)(r),o=(0,H.Z)(i),s=function(e){return null===e||void 0===e?void 0:e.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{open:!0})}))},c=s(a),d=s(o);n(m(c)),n(x(d))}([a,o],s),s(w(!0)))},children:t?"Close":"Split"})})})}var Ek,Rk=t(88564),Ok=t(28485),Lk=t(65280),Vk=(0,Rk.ZP)((function(e){return(0,Fe.jsx)(Ok.Z,(0,l.Z)((0,l.Z)({},e),{},{TabIndicatorProps:{children:(0,Fe.jsx)("span",{className:"MuiTabs-indicatorSpan"})}}))}))((function(e){var n=e.theme;return{"& .MuiButtonBase-root-MuiTab-root":{maxHeight:"20px"},"& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,width:"100%",backgroundColor:null===n||void 0===n?void 0:n.primaryDark}}})),zk=(0,Rk.ZP)((function(e){return(0,Fe.jsx)(Lk.Z,(0,l.Z)({disableRipple:!0},e))}))((function(e){var n=e.theme;return{textTransform:"none",fontWeight:n.typography.fontWeightRegular,fontSize:"12px",padding:0,marginRight:"8px",color:n.textOff,"&.Mui-selected":{color:n.textColor},"&.Mui-focusVisible":{backgroundColor:"rgba(100, 95, 228, 0.32)"}}})),Fk=function(e){return(0,ze.iv)(Ek||(Ek=(0,r.Z)(["\n background: ",";\n .MuiTabs-root {\n height: 20px !important;\n min-height: 20px;\n }\n .MuiButtonBase-root {\n min-height: 0;\n }\n"])),e.WidgetBg)};function Bk(e){var n,t,r,a,o,l=(0,i.I0)(),s=e.onTabChange,c=e.tabsValue,d=e.isTabs,p=e.activeTabs,v=e.children,h=e.data,g=h.expr,b=h.open,y=h.id,Z=h.start,w=h.stop,S=h.label,j=h.pickerOpen,k=h.idRef,C=e.isQueryOpen,T=(0,hi.F)(),I=(0,i.v9)((function(e){return e.left})),N=(0,i.v9)((function(e){return e.right})),M=(0,i.v9)((function(n){return n[e.name]})),E=(0,i.v9)((function(e){return e.isEmbed})),R=(0,i.v9)((function(e){return e.isSplit})),O=(0,i.v9)((function(e){return e.dataSources})),L=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),V=(0,f.useState)(e.data.dataSourceId),z=(0,u.Z)(V,2),F=z[0],B=z[1],P=(0,f.useMemo)((function(){return O.length>0?O.map((function(e){return{value:e.id,name:e.name,type:e.type,icon:e.icon}})):null}),[O]);(0,f.useEffect)((function(){B(e.data.dataSourceId)}),[]),(0,f.useEffect)((function(){var n;null!==e&&void 0!==e&&null!==(n=e.data)&&void 0!==n&&n.dataSourceId&&B(e.data.dataSourceId)}),[e.data.dataSourceId]);var q=(0,f.useState)({value:(null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.dataSourceId)||"32D16h5uYBqUUzhD",name:(null===O||void 0===O||null===(t=O.find((function(n){var t;return(null===n||void 0===n?void 0:n.id)===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.dataSourceId)})))||void 0===t?void 0:t.name)||(null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.dataSourceId),type:null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.dataSourceType,icon:(null===O||void 0===O||null===(o=O.find((function(n){var t;return n.id===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.dataSourceId)})))||void 0===o?void 0:o.icon)||(null===e||void 0===e?void 0:e.data.dataSourceId)}),A=(0,u.Z)(q,2),Q=A[0],W=A[1],U=function(e,n){return"left"===e?m(n):x(n)};var J=function(e,n){e.forEach((function(e){e.start=Z,e.stop=w,e.label=S})),l(U(n,e))};return(0,Fe.jsxs)(pk,{children:[(0,Fe.jsxs)("div",{className:"query-tools-cont",children:[(0,Fe.jsxs)("div",{className:"query-title-tabs",children:[(0,Fe.jsx)(Hk,{isEmbed:E,idRef:k,expr:g,onIdRefUpdate:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.idRef=n)})),l(U(e.name,t))},isQueryOpen:C}),d&&(0,Fe.jsx)("div",{className:(0,ze.cx)(Fk(T)),children:(0,Fe.jsxs)(Vk,{value:c,onChange:s,children:[(0,Fe.jsx)(zk,{label:"Search"}),(null===p||void 0===p?void 0:p.length)>0&&(null===p||void 0===p?void 0:p.map((function(e,n){return(0,Fe.jsx)(zk,{label:e.name},n)})))]})})]}),!E&&(0,Fe.jsxs)("div",{className:"query-tools",children:[(0,Fe.jsx)("div",{style:{display:"flex",alignItems:"center"}}),(0,Fe.jsxs)("div",{style:{display:"flex",alignItems:"center",justifySelf:"flex-end"},children:[(0,Fe.jsx)(Ui.Z,{section:"Query Toolbar",localProps:e}),!L&&(0,Fe.jsx)(Mk,{isSplit:R,open:b,side:e.name}),(0,Fe.jsx)(Oi,{id:y,onStopChange:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.stop=n)})),l(U(e.name,t))},onStartChange:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.start=n)})),l(U(e.name,t))},onLabelChange:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.label=n)})),l(U(e.name,t))},onPickerOpen:function(n){var t=(0,H.Z)(M);t.forEach((function(t){t.id===e.data.id&&(t.pickerOpen=n)})),l(U(e.name,t))},startTs:Z,stopTs:w,label:S,pickerOpen:j}),(0,Fe.jsx)(D.Z,{title:"Sync Time Ranges",children:(0,Fe.jsx)(dk.Z,{style:{fontSize:"15px",cursor:"pointer",padding:"3px",marginLeft:"10px"},onClick:function(){var e=(0,H.Z)(I),n=(0,H.Z)(N);J(e,"left"),J(n,"right")}})}),(0,Fe.jsx)(Ik,{extValue:F,value:Q,onChange:function(n){var t,r,i=n.target.value,a=O.find((function(e){return(null===e||void 0===e?void 0:e.id)===i})),o=JSON.parse(JSON.stringify(M)),s=P.find((function(e){return e.value===i})),u=function(){try{var e;return(e=localStorage.getItem("dsSelected"))?JSON.parse(e):[]}catch(n){console.log(n)}}(),c=[];(null===u||void 0===u?void 0:u.length)>0?c=(null===u||void 0===u?void 0:u.find((function(n){var t;return(null===n||void 0===n?void 0:n.queryId)===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.id)})))||!1?u.map((function(n){var t;return n.queryId===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.id)?{queryId:null===n||void 0===n?void 0:n.queryId,dataSourceId:null===a||void 0===a?void 0:a.id}:n})):[].concat((0,H.Z)(u),[{queryId:null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.id,dataSourceId:null===a||void 0===a?void 0:a.id}]):c=[].concat((0,H.Z)(u),[{queryId:null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.id,dataSourceId:null===a||void 0===a?void 0:a.id}]);localStorage.setItem("dsSelected",JSON.stringify(c)),W((function(e){return s})),o.forEach((function(n){var t;(null===n||void 0===n?void 0:n.id)===(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.id)&&(n.dataSourceId=null===a||void 0===a?void 0:a.id,n.dataSourceType=null===a||void 0===a?void 0:a.type,n.dataSourceURL=null===a||void 0===a?void 0:a.url)})),l(U(e.name,o))},opts:P,label:""}),(0,Fe.jsx)(Dw.Z,{style:{fontSize:"15px",cursor:"pointer",padding:"3px",marginLeft:"10px"},onClick:e.onAddQuery}),(0,Fe.jsx)(ut.Z,{style:{fontSize:"15px",cursor:"pointer",padding:"3px"},onClick:e.onDeleteQuery})]})]})]}),v]})}var Hk=function(e){var n=e.isEmbed,t=e.expr,r=e.isQueryOpen;return(0,Fe.jsxs)("div",{className:"query-title",children:[!n&&(0,Fe.jsx)(vk,{onClick:function(){r[1](!r[0])},children:r[0]?(0,Fe.jsx)(hk,{}):(0,Fe.jsx)(gk,{})}),(0,Fe.jsx)(xk,(0,l.Z)({},e)),n&&(0,Fe.jsx)("p",{style:{marginLeft:"20px",fontFamily:"monospace"},children:t})]})},Pk=t(4760),qk=function(e){var n=e.section,t=e.localProps,r=e.name;return(0,Fe.jsx)("div",{className:"renderer-content",children:function(e,r){return(0,Fe.jsx)(r,{localProps:t,section:n,name:e})}(r,Pk.Q$.getPlugin(n,r).Component)})},Ak=function(){try{var e=JSON.parse(localStorage.getItem("queryData")||"[]")||[];return(0,H.Z)(e)}catch(n){return[]}};function Qk(e,n){return(null===e||void 0===e?void 0:e.length)>1?null===e||void 0===e?void 0:e.filter((function(e){return(null===e||void 0===e?void 0:e.id)!==n})):e}var Wk=function(e){localStorage.setItem("queryData",JSON.stringify(e))},Uk=function(e,n){return e.filter((function(e){return function(e,n){return e.queryId!==n}(e,n)}))},Jk=function(e,n,t){var r=function(e){return e[e.length-1].lastIdx}(e),i=function(e,n){return e>n.length-1?"".concat(n[0]).concat(e):n[e]}(r,t);return function(e,n,t,r){var i=(0,l.Z)((0,l.Z)({},r),{},{id:(0,Ie.x0)(),idRef:t,labels:[],expr:"",lastIdx:e+1,cp:0});return[].concat((0,H.Z)(n),[i])}(r,e,i,n)},Gk=function(e,n){return"left"===e?(r=n,function(e){e({type:"SET_LEFT_PANEL",left:r})}):(t=n,function(e){e({type:"SET_RIGHT_PANEL",right:t})});var t,r},Kk=["children","value","index"];function Yk(e){var n=e.children,t=e.value,r=e.index,i=(0,Vo.Z)(e,Kk);return(0,Fe.jsx)("div",(0,l.Z)((0,l.Z)({role:"tabpanel",hidden:t!==r,id:"simple-tabpanel-".concat(r),"aria-labelledby":"simple-tab-".concat(r)},i),{},{children:t===r&&(0,Fe.jsx)(Fe.Fragment,{children:n})}))}var Xk,$k,eC,nC,tC,rC,iC,aC,oC=function(e){var n=e.name,t=e.data,r=t.id,a=(0,f.useState)(""),o=(0,u.Z)(a,2),s=o[0],c=o[1],d=(0,i.I0)(),p=(0,i.v9)((function(e){return e["".concat(n,"DataView")]})),v=(0,i.v9)((function(e){return e[n]})),h=(0,f.useState)(!0),g=function(e){return(0,f.useMemo)((function(){return Array.from(Array(26)).map((function(e,n){return n+65})).map((function(n){var t;return(null===e||void 0===e||null===(t=e.slice(0,1))||void 0===t?void 0:t.toUpperCase())+"-"+String.fromCharCode(n)}))}),[])}(n),m=(0,hi.F)(),x=(0,f.useState)(0),b=(0,u.Z)(x,2),y=b[0],Z=b[1],w=(0,Pk.lu)("Query Item"),S=w.activeTabs,j=w.isActiveTabs;return(0,Fe.jsx)(I.a,{theme:m,children:(0,Fe.jsx)(Bk,(0,l.Z)((0,l.Z)({},e),{},{isQueryOpen:h,onDeleteQuery:function(){var e,t=Qk(v,r),i=Qk(p,r),a=Ak();(null===a||void 0===a?void 0:a.length)>0&&function(){var e=Ak();if((null===e||void 0===e?void 0:e.length)>0){var n=Uk(e,r);Wk(n)}}(),t&&d(Gk(n,t)),i&&d(function(e,n){return"left"===e?(r=n,function(e){e({type:"SET_LEFT_DATAVIEW",leftDataView:r})}):(t=n,function(e){e({type:"SET_RIGHT_DATAVIEW",rightDataView:t})});var t,r}(n,i)),"right"===n&&0===t.length&&d((e=!1,function(n){n({type:"SET_SPLIT_VIEW",isSplit:e})}))},onAddQuery:function(){var e=Jk(v,t,g);d(Gk(n,e))},onTabChange:function(e,n){Z((function(){return n}))},tabsValue:y,isTabs:j,activeTabs:S,children:j?(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)(Yk,{value:y,index:0,children:h[0]&&(0,Fe.jsx)(ck,(0,l.Z)((0,l.Z)({},e),{},{launchQuery:s}))}),null===S||void 0===S?void 0:S.map((function(n,t){return(0,Fe.jsx)(Yk,{value:y,index:t+1,children:(0,Fe.jsx)(qk,{name:n.name,section:"Query Item",localProps:{props:e,setLaunchQuery:c}})},t)}))]}):(0,Fe.jsx)(Fe.Fragment,{children:h[0]&&(0,Fe.jsx)(ck,(0,l.Z)((0,l.Z)({},e),{},{launchQuery:s}))})}))})},lC=function(e){return(0,ze.iv)(Xk||(Xk=(0,r.Z)(["\n background: ",";\n border: 1px solid ",";\n border-radius: 3px;\n margin: 6px;\n"])),e.mainBgColor,e.buttonBorder)},sC=function(e){var n=e.queries,t=(0,hi.F)();return n&&Array.isArray(n)&&(null===n||void 0===n?void 0:n.length)>0?(0,Fe.jsxs)("div",{className:(0,ze.cx)(lC(t)),children:[null===n||void 0===n?void 0:n.map((function(n,t){return(0,f.createElement)(oC,(0,l.Z)((0,l.Z)({},e),{},{data:n,key:t}))})),(0,Fe.jsx)(Ui.Z,{section:"Queries",localProps:{queries:n,theme:t}})]}):null},uC=jt.Z.div($k||($k=(0,r.Z)(["\n display: flex;\n flex-direction: column;\n flex: 1;\n width: 100%;\n min-width:50%;\n"]))),cC=function(e){var n,t=e.name,r=(0,i.I0)(),a=(0,i.v9)((function(e){return e.isSplit})),o=(0,i.v9)((function(e){return e[t]})),s=(0,p.TH)().hash,c=(0,f.useRef)(null),d=(0,f.useState)(0),v=(0,u.Z)(d,2),h=v[0],g=v[1];return(0,f.useEffect)((function(){var e,n=new URLSearchParams(s.replace(/#/,"")).get(t),i=[];n&&(i=JSON.parse(decodeURIComponent(n))),(null===(e=i)||void 0===e?void 0:e.length)>0&&r(function(e,n){return"left"===e?(t=n,function(e){e({type:"SET_LEFT_PANEL",left:t})}):(r=n,function(e){e({type:"SET_RIGHT_PANEL",right:r})});var t,r}(t,i));var a=function(){g(c.current.clientWidth)};return window.addEventListener("resize",a),function(){window.removeEventListener("resize",a)}}),[]),(0,f.useEffect)((function(){var e;"number"===typeof(null===c||void 0===c||null===(e=c.current)||void 0===e?void 0:e.clientWidth)&&g(c.current.clientWidth)}),[null===c||void 0===c||null===(n=c.current)||void 0===n?void 0:n.clientWidth]),(0,Fe.jsx)(Fe.Fragment,{children:(0,Fe.jsxs)(uC,{isSplit:a,ref:c,children:[(0,Fe.jsx)(sC,(0,l.Z)((0,l.Z)({},e),{},{width:h,queries:o})),(0,Fe.jsx)(Ui.Z,{section:"Panel",localProps:{props:e,panel:o,width:h}}),(0,Fe.jsx)(Tx,(0,l.Z)((0,l.Z)({},e),{},{splitted:a}))]})})},dC=(0,jt.Z)(ht.Z)(eC||(eC=(0,r.Z)(["\n background: ",";\n"])),(function(e){return e.theme.inputBg})),fC=(0,jt.Z)(Ct.Z)(nC||(nC=(0,r.Z)(["\n color: ",";\n background: ",";\n border: 1px solid ",";\n cursor: pointer;\n font-size: 13px;\n background-color: transparent;\n padding: 6px 10px;\n border: none;\n border-radius: 3px 3px 0px 0px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-bottom: 1px solid transparent;\n transition: 0.2s all;\n\n &:hover {\n background-color: ",";\n }\n\n &:focus {\n color: ",";\n background: ",";\n border-radius: 3px 3px 0px 0px;\n\n outline-offset: 2px;\n }\n\n &."," {\n border-bottom: 1px solid ",";\n }\n\n &."," {\n opacity: 0.5;\n cursor: not-allowed;\n }\n @media screen and (max-width: 360px) {\n span {\n display: none;\n }\n padding: 5px 20px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.buttonHover}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonDefault}),Tt.Z.selected,(function(e){return e.theme.primaryDark}),kt.Z.disabled),pC=(jt.Z.div(tC||(tC=(0,r.Z)(["\n padding: 0px 15px;\n font-size: 13px;\n display: flex;\n align-items: center;\n color: ",";\n justify-content: space-between;\n background: ",";\n height: 37px;\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.tabHeader})),(0,jt.Z)(Mt.Z)(rC||(rC=(0,r.Z)(["\n width: 100%;\n background: ",";\n height: inherit;\n"])),(function(e){return e.theme.widgetContainer}))),vC=(0,jt.Z)(Nt.Z)(iC||(iC=(0,r.Z)(["\n min-width: 320px;\n background: ",";\n border-bottom: 4px solid ",";\n display: flex;\n align-items: center;\n align-content: space-between;\n"])),(function(e){return e.theme.tabHeader}),(function(e){return e.theme.historyRow}));function hC(){return(0,Fe.jsxs)(dC,{defaultValue:0,children:[(0,Fe.jsxs)(vC,{children:[(0,Fe.jsx)(fC,{children:(0,Fe.jsx)("span",{children:"Left"})}),(0,Fe.jsx)(fC,{children:(0,Fe.jsx)("span",{children:"Right"})})]}),(0,Fe.jsx)(pC,{value:0,children:(0,Fe.jsx)(cC,{name:"left"})}),(0,Fe.jsx)(pC,{value:1,children:(0,Fe.jsx)(cC,{name:"right"})})]})}var gC=jt.Z.div(aC||(aC=(0,r.Z)(["\n position: absolute;\n display: flex;\n flex-direction: column;\n height: inherit;\n width: 100%;\n flex: 1;\n\n background-color: "," !important;\n &::-webkit-scrollbar-corner {\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: "," !important;\n }\n .panels-container {\n display: flex;\n background: ",";\n height: calc(100vh - 45px);\n }\n"])),(function(e){return e.theme.mainBgColor}),(function(e){return e.theme.scrollbarThumb}),(function(e){return e.theme.shBgColor}));function mC(e){var n=e.theme;return(0,Fe.jsxs)(I.a,{theme:n,children:[(0,Fe.jsx)(gC,{children:(0,Fe.jsx)(hC,{})}),(0,Fe.jsx)(Wi,{})]})}function xC(e){var n=e.theme,t=(e.isEmbed,e.isSplit),r=e.settingsDialogOpen,a=(0,f.useState)(0),o=(0,u.Z)(a,2),l=o[0],s=o[1],c=(0,f.useState)(0),d=(0,u.Z)(c,2),p=d[0],v=d[1],h=(0,f.useState)(0),g=(0,u.Z)(h,2),m=g[0],x=g[1],b=(0,f.useState)(0),y=(0,u.Z)(b,2),Z=y[0],w=y[1],S=(0,f.useState)(0),j=(0,u.Z)(S,2),k=j[0],C=j[1],T=(0,f.useState)(0),_=(0,u.Z)(T,2),D=_[0],N=_[1],M=(0,f.useState)(!1),E=(0,u.Z)(M,2),R=E[0],O=E[1],L=(0,f.useState)(!1),V=(0,u.Z)(L,2),z=V[0],F=V[1],B=(0,f.useRef)(null);(0,f.useEffect)((function(){var e=B.current.clientWidth;s(B.current.clientWidth),v(e/(t?2:1)),t&&x(e/2),N(t?e/4>370?e/4:370:e)}),[v,x,s,N,D,t]),(0,f.useEffect)((function(){var e=B.current.clientWidth;w(p/e),t&&C(m/e)}),[p,m,t]),(0,f.useEffect)((function(){var e=function(){var e=B.current.clientWidth;s(e),v(e*Z),t&&x(e*k)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[l,p,m,Z,k,t]);var H=(0,i.v9)((function(e){return e.left})),P=(0,i.v9)((function(e){return e.right}));(0,f.useEffect)((function(){O(H[0].open),F(P[0].open)}),[H[0].open,P[0].open]);return(0,Fe.jsxs)(I.a,{theme:n,children:[(0,Fe.jsx)(gC,{children:function(e,n){return(0,Fe.jsxs)("div",{className:"panels-container",ref:B,children:[!0===e&&(0,Fe.jsx)(cC,{name:"left"}),!0===n&&(0,Fe.jsx)(cC,{name:"right"})]})}(R,z)}),(0,Fe.jsx)(vr.ZP,{open:r}),(0,Fe.jsx)(Wi,{})]})}var bC=t(46271);var yC=function(e){return function(n){n({type:"SHOW_DATA_SOURCE_SETTING",showDataSourceSetting:e})}};var ZC=function(e){var n={},t=(null===e||void 0===e?void 0:e.cors)||!1,r=OZ(e),i=(0,l.Z)((0,l.Z)({},r),{},{"Content-Type":"application/json",Accept:"application/json"}),a={method:"GET",headers:i};return!0===t&&(a.mode="cors"),n.options=a,n.headers=i,n.validateStatus=function(e){return e>=200&&e<400||404===e||500===e},n},wC=function(){var e=(0,F.Z)((0,z.Z)().mark((function e(n,t,r){return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q().get("".concat(n,"/ready"),t).then((function(e){var n,t;if(e&&null!==e&&void 0!==e&&e.status&&null!==e&&void 0!==e&&e.headers)return r={status:e.status,contentType:null===e||void 0===e||null===(n=e.headers)||void 0===n?void 0:n["content-type"],contentLength:null===e||void 0===e||null===(t=e.headers)||void 0===t?void 0:t["content-length"]}})).catch((function(e){return e})).finally((function(){return r}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}();function SC(e,n,t,r){return jC.apply(this,arguments)}function jC(){return jC=(0,F.Z)((0,z.Z)().mark((function e(n,t,r,i){var a,o,s;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={},o=ZC(t),s=(0,l.Z)({},o),""!==(null===r||void 0===r?void 0:r.username)&&i&&(s.auth=r),e.abrupt("return",new Promise(function(){var e=(0,F.Z)((0,z.Z)().mark((function e(t,r){var i,o,l,u;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wC(n,s,a);case 3:i=e.sent,a=i,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),r(!1);case 10:return e.prev=10,a&&200===(null===(o=a)||void 0===o?void 0:o.status)&&(null!==(l=a)&&void 0!==l&&l.contentType.includes("application/json")||"0"===(null===(u=a)||void 0===u?void 0:u.contentLength))?t(!0):r(!1),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,7,10,13]])})));return function(n,t){return e.apply(this,arguments)}}()));case 5:case"end":return e.stop()}}),e)}))),jC.apply(this,arguments)}function kC(){return(kC=(0,F.Z)((0,z.Z)().mark((function e(n,t,r){var i,a,o,u,c,d,f,p,v,h,g,m,x,b,y,Z,w,S;return(0,z.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=window.location.origin,d=n.find((function(e){return"logs"===e.type})),f=null===d||void 0===d||null===(i=d.auth)||void 0===i||null===(a=i.basicAuth)||void 0===a?void 0:a.value,p={username:"",password:""},v=null===d||void 0===d||null===(o=d.auth)||void 0===o||null===(u=o.fields)||void 0===u?void 0:u.basicAuth,h=(null===v||void 0===v?void 0:v.length)>0,f&&h){g=(0,s.Z)(v);try{for(g.s();!(m=g.n()).done;)"user"===(null===(x=m.value)||void 0===x?void 0:x.name)&&(p.username=(null===x||void 0===x?void 0:x.value)||""),"password"===(null===x||void 0===x?void 0:x.name)&&(p.password=(null===x||void 0===x?void 0:x.value)||"")}catch(j){g.e(j)}finally{g.f()}}if(b=!1,y=!1,""===(null===d||void 0===d?void 0:d.url)){e.next=18;break}return e.next=12,SC(d.url,d,p,f);case 12:if(b=e.sent){e.next=18;break}return e.next=16,SC(c,d);case 16:(y=e.sent)&&!b?(Z=(0,H.Z)(n),w=JSON.parse(JSON.stringify(Z)),S=null===w||void 0===w?void 0:w.map((function(e){return(0,l.Z)((0,l.Z)({},e),{},{url:c})})),localStorage.setItem("dataSources",JSON.stringify(S)),t((0,_y.Z)(S))):b||y||r("datasources");case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var CC,TC=t(42520),_C=function(e){return(0,ze.iv)(CC||(CC=(0,r.Z)(["\n background: ",";\n"])),e.widgetContainer)};function IC(){var e=(0,p.s0)(),n=(0,i.v9)((function(e){return e.dataSources})),t=(0,p.TH)().hash,r=(0,f.useMemo)((function(){return new URLSearchParams(t.replace(/#/,""))}),[t]);!function(){var e=(0,f.useMemo)((function(){return window.matchMedia("(prefers-color-scheme: light)").matches}),[]),n=(0,i.I0)(),t=(0,i.v9)((function(e){return e.urlQueryParams})),r=(0,i.v9)((function(e){return e.start})),a=(0,i.v9)((function(e){return e.stop})),d=(0,i.v9)((function(e){return e.label})),_=(0,i.v9)((function(e){return e.from})),I=(0,i.v9)((function(e){return e.to})),D=(0,i.v9)((function(e){return e.step})),N=(0,i.v9)((function(e){return e.isSubmit})),M=(0,i.v9)((function(e){return e.isEmbed})),E=(0,i.v9)((function(e){return e.time})),R=(0,i.v9)((function(e){return e.left})),O=(0,i.v9)((function(e){return e.right})),L=(0,i.v9)((function(e){return e.theme})),V=(0,i.v9)((function(e){return e.autoTheme})),z=(0,i.v9)((function(e){return e.isSplit})),F=(0,f.useState)(e?"light":L),B=(0,u.Z)(F,2),H=B[0],P=B[1];(0,f.useEffect)((function(){P(L)}),[L]);var q={start:r,step:D,stop:a,label:d,from:_,to:I,time:E,isSubmit:N,isEmbed:M,theme:L,autoTheme:V,left:R,right:O,isSplit:z},A={start:v.qv,step:v.F1,stop:v.wW,label:v.Xn,from:h,to:b,time:v.HN,isSubmit:v.E9,isEmbed:g,theme:v.Dc,left:m,right:x,isSplit:w,autoTheme:v.XD},Q=function(e){return(null===e||void 0===e?void 0:e.getTime())+"000000"},W=function(e,n){try{var t=JSON.parse(e);return t&&void 0!==t?t:n}catch(r){return n}},U=(0,p.TH)().hash;(0,f.useEffect)((function(){var e=new URLSearchParams(U.replace(/#/,""));if(U.length>0){var r,i=t,a=(0,s.Z)(e.entries());try{for(a.s();!(r=a.n()).done;){var d=(0,u.Z)(r.value,2),f=d[0],p=d[1];i[f]=p}}catch(v){a.e(v)}finally{a.f()}Object.keys(i).length>0&&(n(Z((0,l.Z)((0,l.Z)({},t),{},{startParams:i}))),n(y(o().sanitize(U))),Object.keys(i).forEach((function(e){if((S.includes(e)||j.includes(e))&&""!==i[e])n(A[e](o().sanitize(i[e])));else if("theme"===e)n(A[e](o().sanitize(H)));else if(C.includes(e)&&""!==i[e]){var t=i[e]/1e6,r=new Date(c(t).format("YYYY-MM-DDTHH:mm:ss.SSSZ"));n(A[e](r))}else if(T.includes(e))try{var a=W(i[e],!1);n(A[e](a))}catch(s){console.log(s)}else if(k.includes(e))try{var l=W(decodeURIComponent(i[e]),[]);(null===l||void 0===l?void 0:l.length)>0&&n(A[e](l))}catch(s){console.log(s)}})))}else S.concat(C).concat(T).concat(k).forEach((function(n){var t;if(S.includes(n))e.set(n,o().sanitize(null===(t=q[n])||void 0===t?void 0:t.toString()));else if("theme"===n)e.set(n,o().sanitize(H.toString()));else if(C.includes(n)){var r,i=1e6*(null===(r=q[n])||void 0===r?void 0:r.getTime());e.set(n,o().sanitize(i.toString()))}else if(T.includes(n))try{e.set(n,W(q[n],!1))}catch(l){console.log(l)}else if(k.includes(n))try{var a=JSON.stringify(q[n]);e.set(n,a)}catch(l){console.log(l)}})),window.location.hash=e}),[]),(0,f.useEffect)((function(){if(U.length>0){var e,n=new URLSearchParams(U.replace(/#/,"")),t={},r=(0,s.Z)(n.entries());try{for(r.s();!(e=r.n()).done;){var i=(0,u.Z)(e.value,2),a=i[0],l=i[1];t[a]=l}}catch(c){r.e(c)}finally{r.f()}Object.keys(q).forEach((function(e){if(S.includes(e)&&t[e]!==q[e]){var r=o().sanitize(q[e].toString().trim());n.set(e,r)}else if(C.includes(e)&&t[e]!==Q(q[e])){var i=Q(q[e]);n.set(e,o().sanitize(i))}else if(T.includes(e)&&t[e]!==q[e])try{n.set(e,W(q[e],!1))}catch(s){console.error(s)}else if("left"===e){var a=JSON.stringify(R);n.set("left",o().sanitize(a))}else if("right"===e){var l=JSON.stringify(O);n.set("right",o().sanitize(l))}})),window.location.hash=n}}),[q])}();var a=function(e){var n="",t=!1,r=(0,i.v9)((function(e){return e.currentUser})),a=(0,f.useMemo)((function(){return e.has("cookie")||!1}),[e]),l=(0,f.useMemo)((function(){return a?o().sanitize(e.get("cookie")):""}),[e,a]),s=(0,bC.Z)([l]),c=(0,u.Z)(s,2),d=c[0],p=(c[1],(0,bC.Z)(["user-cookie"])),v=(0,u.Z)(p,2),h=v[0],g=(v[1],r);if(null!==h&&void 0!==h&&h["user-cookie"])try{g=atob(h["user-cookie"])}catch(m){console.log("could not parse user cookie")}return d[l]&&""!==d[l]&&(n=d[l],t=!0),{cookieAuth:n,cookiesAvailable:t,cookieUser:g}}(r),d=a.cookiesAvailable,I=a.cookieAuth,D=a.cookieUser,N=function(e){var n=(0,f.useMemo)((function(){return e.has("url")}),[e]);return{url:(0,f.useMemo)((function(){return n?o().sanitize(e.get("url")):""}),[e,n]),urlAvailable:n}}(r),M=N.urlAvailable,E=N.url;(0,f.useEffect)((function(){d&&!M||!d&&M||d&&""!==I&&M&&""!==M?function(e,n,t,r,i,a){var o="",s=!1,c=!1,d={};if(r&&(c=!0),i){var f=t.split("@"),p=(0,u.Z)(f,2),v=p[0],h=(p[1],v.split(":")),g=(0,u.Z)(h,2),m=g[0],x=g[1];""!==m&&""!==x&&(d={user:m,password:x},s=!0)}!r&&s&&(o=window.location.protocol+"//"+window.location.host,c=!0),""===o&&(c=!0,o=decodeURIComponent(n));var b=(0,H.Z)(a),y=JSON.parse(JSON.stringify(b)),Z=null===y||void 0===y?void 0:y.map((function(e){var n;return(0,l.Z)((0,l.Z)({},e),{},{url:c?o:e.url,auth:(0,l.Z)((0,l.Z)({},e.auth),{},{basicAuth:(0,l.Z)((0,l.Z)({},e.auth.basicAuth),{},{value:s}),fields:(0,l.Z)((0,l.Z)({},e.auth.fields),{},{basicAuth:s?null===(n=(0,H.Z)(e.auth.fields.basicAuth))||void 0===n?void 0:n.map((function(e){return"user"===e.name?(0,l.Z)((0,l.Z)({},e),{},{value:d.user}):"password"===e.name?(0,l.Z)((0,l.Z)({},e),{},{value:d.password}):e})):(0,H.Z)(e.auth.fields.basicAuth)})})})}));t&&d&&e(yC(!1)),localStorage.setItem("dataSources",JSON.stringify(Z)),e((0,_y.Z)(Z))}(L,E,I,M,d,n):function(e,n,t){kC.apply(this,arguments)}(n,L,e)}),[]),(0,f.useEffect)((function(){if(D&&"string"===typeof D)try{L((0,TC.l)(JSON.parse(D)))}catch(e){console.log(e)}}),[D]),(0,f.useEffect)((function(){var e={url:o().sanitize(window.location.hash),cookiesAvailable:d};localStorage.setItem(btoa("cookie-location"),btoa(JSON.stringify(e)))}),[d]);var R=(0,_.useMediaQuery)({query:"(max-width: 1013px)"}),O=(0,_.useMediaQuery)({query:"(prefers-color-scheme: dark)"}),L=(0,i.I0)(),V=(0,i.v9)((function(e){return e.isSplit})),z=(0,i.v9)((function(e){return e.isEmbed})),F=(0,hi.F)(),B=(0,i.v9)((function(e){return e.autoTheme})),P=(0,i.v9)((function(e){return e.settingsDialogOpen}));(0,f.useEffect)((function(){if(B){var e=O?"dark":"light";L((0,v.Dc)(e)),localStorage.setItem("theme",JSON.stringify({theme:e,auto:B}))}}),[O,B,L]);return(0,Fe.jsx)("div",{className:(0,ze.cx)(_C(F)),children:function(e,n,t,r){return e?(0,Fe.jsx)(mC,{isEmbed:t,theme:F,settingsDialogOpen:r}):(0,Fe.jsx)(xC,{isEmbed:t,isSplit:n,theme:F,settingsDialogOpen:r})}(R,z,V,P)})}},42520:function(e,n,t){t.d(n,{l:function(){return r}});var r=function(e){return function(n){return n({type:"SET_CURRENT_USER",currentUser:e})}}}}]); \ No newline at end of file diff --git a/view/static/js/main.b5a8989c.js b/view/static/js/main.0ee7f0a7.js similarity index 99% rename from view/static/js/main.b5a8989c.js rename to view/static/js/main.0ee7f0a7.js index ef85d4eb..c1fc1872 100644 --- a/view/static/js/main.b5a8989c.js +++ b/view/static/js/main.0ee7f0a7.js @@ -1,2 +1,2 @@ -/*! For license information please see main.b5a8989c.js.LICENSE.txt */ -!function(){var e={87975:function(e,t,n){"use strict";n.d(t,{el:function(){return d},Po:function(){return s},JU:function(){return p},XD:function(){return m},E9:function(){return l},F1:function(){return a},HN:function(){return u.H},qv:function(){return r},wW:function(){return o},Dc:function(){return h},Xn:function(){return i}});var r=function(e){return function(t){t({type:"SET_START_TIME",start:e})}},o=function(e){return function(t){t({type:"SET_STOP_TIME",stop:e})}},a=function(e){return function(t){t({type:"SET_QUERY_STEP",step:e})}},i=function(e){return function(t){t({type:"SET_TIME_RANGE_LABEL",label:e})}},u=n(69059),l=function(e){return function(t){t({type:"SET_IS_SUBMIT",isSubmit:e})}},s=function(e){var t,n,r,o,a=e.request,i=e.response,u=null===e||void 0===e||null===(t=e.response)||void 0===t||null===(n=t.request)||void 0===n?void 0:n.responseURL,l=function(){switch(u){case null===u||void 0===u?void 0:u.includes("/loki/api/v1/label"):return"label";case null===u||void 0===u?void 0:u.includes("/loki/api/v1/query_range"):return"query";default:return"label"}};if(null!==i&&void 0!==i&&i.statusText){var s=null===i||void 0===i?void 0:i.status;return{message:"API "+i.statusText+", Please adjust API URL",status:s,type:l()}}return u&&!u.includes(window.location.protocol)?{message:"Mixed Content Error, your View should be over same protocol as your API",status:500,type:l()}:a?e.stack.includes("Network Error")?{message:"Invalid API URL, please adjust API URL",status:500,type:l()}:{message:"server time out",status:null===i||void 0===i?void 0:i.status,type:l()}:null!==e&&void 0!==e&&null!==(r=e.stack)&&void 0!==r&&r.includes("Invalid URL")?{message:"Invalid API URL, please adjust API URL",stauts:null===i||void 0===i?void 0:i.status,type:l()}:404===(null===e||void 0===e||null===(o=e.response)||void 0===o?void 0:o.status)?{message:"Invalid API URL, please adjust API URL",status:null===i||void 0===i?void 0:i.status,type:l()}:{message:"something went wrong with request",status:null===i||void 0===i?void 0:i.status,type:l()}},c=n(93433),f=n(21090),d=function(e){return function(t){var n=f.Z.getState().notifications;n.push({message:e.message,type:e.type,visible:!0}),t({type:"ADD_NOTIFICATION",payload:(0,c.Z)(n)})}},p=function(e){return function(t){var n=f.Z.getState().notifications;n[e].visible=!1,t({type:"REMOVE_NOTIFICATION",payload:(0,c.Z)(n)})}},h=function(e){return function(t){t({type:"SET_THEME",theme:e})}},m=function(e){return function(t){t({type:"SET_AUTO_THEME",autoTheme:e})}}},69059:function(e,t,n){"use strict";n.d(t,{H:function(){return r}});var r=function(e){return function(t){t({type:"SET_QUERY_TIME",time:e})}}},53052:function(e,t,n){"use strict";n.d(t,{DJ:function(){return d},NQ:function(){return c},bn:function(){return i},e5:function(){return s},eW:function(){return l},fP:function(){return u},fs:function(){return h},l9:function(){return f},lX:function(){return p}});var r=n(82751),o=n(47313),a=n(46417),i=[{label:"=",value:"equals"},{label:"=~",value:"regexequals"},{label:"!=",value:"excludeequals"},{label:"!~",value:"regexexclude"}],u={equals:"=",regexequals:"=~",excludeequals:"!=",regexexclude:"!~"},l={label:"",operator:"equals",values:[],metric:"",id:(0,r.x0)()},s={metric:"",label:"",operator:"equals",values:[],id:(0,r.x0)()},c={label:"",value:""},f=function(){return(0,o.useMemo)((function(){return{id:0,name:"none",header:(0,a.jsx)("div",{children:"Container Header"})}}),[])},d={operations:[],labelsState:[],binaryValue:{binaryOpt:"divide",vectOpt:"on",vectValue:""},labelValuesState:[{metric:"",label:"",operator:"equals",values:[],id:(0,r.x0)()}],builderResult:"",logsVolumeQuery:"",isBinary:!1,isMetrics:!0},p={minus:"-",plus:"+",by:"*",divide:"/",exp:"^",equals:"==",not_equals:"!=",modulo:"%",more:"<",less:">",less_equals:"<=",more_equals:">="},h={on:"on",ignoring:"ignoring"}},48268:function(e,t,n){"use strict";n.d(t,{Bp:function(){return S},FD:function(){return w},Gh:function(){return p},HA:function(){return O},Pu:function(){return y},Uc:function(){return m},c8:function(){return x},gO:function(){return b},hf:function(){return C},j6:function(){return g},jY:function(){return E},lo:function(){return h},wU:function(){return v},yv:function(){return d}});var r=n(74165),o=n(15861),a=n(93433),i=n(1413),u=n(4942),l=n(37762),s=n(53052),c=n(31881),f=n.n(c);function d(e){var t,n=[],r=(0,l.Z)(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.label){var a,i="".concat(o.label).concat(s.fP[o.operator],'"');(null===o||void 0===o||null===(a=o.values)||void 0===a?void 0:a.length)>0?i+="".concat(null===o||void 0===o?void 0:o.values.join("|"),'"'):i+="".concat((null===o||void 0===o?void 0:o.values[0])||"",'"'),n.push(i)}}}catch(u){r.e(u)}finally{r.f()}return n.join(",")}function p(e,t){var n="";return(null===t||void 0===t?void 0:t.length)>0&&(n=d(t)),""!==e&&n?"".concat(e,"{").concat(n,"}"):"".concat(e,"{}")}function h(e){var t="";return Array.isArray(e)&&(null===e||void 0===e?void 0:e.length)>0&&(t+=e[0].metric,t+="{".concat(d(e),"}")),t}function m(e){var t,n={};if((null===e||void 0===e||null===(t=e.headers)||void 0===t?void 0:t.length)>0){var r,o=(0,l.Z)(e.headers);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=(0,u.Z)({},String(a.header),a.value);n=(0,i.Z)((0,i.Z)({},n),s)}}catch(c){o.e(c)}finally{o.f()}}return n}function v(e){var t,n=m(e),r={method:"GET",headers:(0,i.Z)((0,i.Z)({},n),{},{"Content-Type":"application/json"})},o={},a={};if(null===e||void 0===e||null===(t=e.auth)||void 0===t?void 0:t.basicAuth.value){var u,s,c,f=null===e||void 0===e||null===(u=e.auth)||void 0===u||null===(s=u.fields)||void 0===s?void 0:s.basicAuth,d=(0,l.Z)(f);try{for(d.s();!(c=d.n()).done;){var p=c.value;"user"===p.name&&(a.username=p.value),"password"===p.name&&(a.password=p.value)}}catch(h){d.e(h)}finally{d.f()}o.auth=a}return o.options=r,o}function g(e,t,n){e("metric"===t?function(e){return e}:"operator"===t?function(e,t,n){return{value:e[n],label:s.fP[e[n]]}}(n,s.fP,t):"value"===t?function(e){return(0,a.Z)(e.values.map((function(e){return{label:t=e,value:t};var t})))}(n):function(e,t){return{key:e[t],label:e[t]}}(n,t))}function y(e,t){return(0,i.Z)((0,i.Z)({},e),{},{borderRadius:2,fontSize:12,colors:(0,i.Z)((0,i.Z)({},e.colors),{},{primary:t.textColor,neutral90:t.buttonBorder,neutral80:t.textColor,neutral0:t.inputBg,primary25:t.widgetContainer,neutral5:t.widgetContainer,neutral10:t.widgetContainer})})}var b=function(e){return"regexequals"===(null===e||void 0===e?void 0:e.operator)||"regexexclude"===(null===e||void 0===e?void 0:e.operator)};function w(e){return e.getTime()+"000000"}var S=function(e,t,n){return"".concat(e,"/loki/api/v1/label?start=").concat(t,"&end=").concat(n)},x=function(e,t,n,r){return"".concat(e,"/loki/api/v1/label/").concat(t,"/values?start=").concat(n,"&end=").concat(r)},k=function(e){var t,n=m(e),r={headers:(0,i.Z)((0,i.Z)({},n),{},{"Content-Type":"application/json"})},o={};if(null===e||void 0===e||null===(t=e.auth)||void 0===t?void 0:t.basicAuth.value){var a,u,s,c=null===e||void 0===e||null===(a=e.auth)||void 0===a||null===(u=a.fields)||void 0===u?void 0:u.basicAuth,f=(0,l.Z)(c);try{for(f.s();!(s=f.n()).done;){var d=s.value;"user"===d.name&&(o.username=d.value),"password"===d.name&&(o.password=d.value)}}catch(p){f.e(p)}finally{f.f()}}return{basicAuth:o,options:r}},_=function(){var e=(0,o.Z)((0,r.Z)().mark((function e(t,n,o,a,u){var l,s;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a(!0),e.prev=1,l=(0,i.Z)((0,i.Z)({},n),{},{auth:o}),e.next=5,f().get(t,l);case 5:(s=e.sent)&&u(s||[]),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),console.error("Error fetching labels"),console.error(e.t0);case 13:a(!1);case 14:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t,n,r,o,a){return e.apply(this,arguments)}}();function E(e,t,n,r){return T.apply(this,arguments)}function T(){return(T=(0,o.Z)((0,r.Z)().mark((function e(t,n,o,a){var i,u,l;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("flux"===t.type||!t.url||""===t.url){e.next=4;break}return i=k(t),u=i.basicAuth,l=i.options,e.next=4,_(n,l,u,o,a);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var C=function(e,t,n,r){var o,a;return(0,i.Z)((0,i.Z)({},s.l9),{},{header:e,range:"$__interval",name:null===e||void 0===e||null===(o=e.toLowerCase())||void 0===o||null===(a=o.split(" "))||void 0===a?void 0:a.join("_"),id:(null===r||void 0===r?void 0:r.length)+1,expressions:[],prev_args:"",after_args:"",conversion_function:"",labelValue:"",filterText:"",labelFilter:{label:"",operator:"=",value:""},binaryOperation:{value:"",bool:!1},lineFilter:"",quantile:.99,kValue:5,labels:[],labelOpts:n||[],opType:t})},O=function(e,t,n){var r=function(e){return e.some((function(e){return"Range Functions"===e.opType}))},o=(0,i.Z)((0,i.Z)({},t),{},{header:"Rate",name:"rate",id:t.id+1,opType:"Range Functions"});if("Range Functions"===e&&r(n)){var u=n.find((function(e){return"Range Functions"===e.opType})),l=null===n||void 0===n?void 0:n.map((function(e){return e.id===u.id?e=(0,i.Z)((0,i.Z)({},t),{},{id:u.id}):e}));return(0,a.Z)(l)}return"Aggregations"!==e||r(n)?[].concat((0,a.Z)(n),[t]):[].concat((0,a.Z)(n),[o,t])}},43262:function(e,t,n){"use strict";n.d(t,{Af:function(){return s},Fg:function(){return l},LS:function(){return f},QL:function(){return v},ZX:function(){return c},mm:function(){return h},qX:function(){return p},sd:function(){return d},uk:function(){return m}});var r=n(47313),o=n(56352),a=n(60065),i=n(53052),u=n(48268),l=function(){var e=(0,o.v9)((function(e){return e.theme}));return(0,r.useMemo)((function(){return a.n[e]}),[e])},s=function(e){return(0,r.useMemo)((function(){var t,n,r;return e&&(null===(t=Object.keys(e))||void 0===t?void 0:t.length)>0?null===(n=Object.keys(e))||void 0===n||null===(r=n.filter((function(e){return"__name__"!==e})))||void 0===r?void 0:r.map((function(e){return{label:e,value:e}})):[]}),[e])},c=function(e,t){return(0,r.useMemo)((function(){var n;return e[t.value]&&Array.isArray(e[t.value])?null===(n=e[t.value])||void 0===n?void 0:n.map((function(e){return{label:e,value:e}})):[{label:"",value:""}]}),[t.value,e])},f=function(e,t,n){return(0,r.useMemo)((function(){return"operator"===t?{value:e,label:i.fP[e]}:"value"===t?n.values:{key:e,label:e}}),[e])},d=function(e,t){return(0,r.useMemo)((function(){return"metrics"!==e&&!(!(0,u.gO)(t)||"value"!==e)}),[e,t])},p=function(e,t,n){return(0,r.useMemo)((function(){var r=null===t||void 0===t?void 0:t.find((function(t){return t.id===e}));return""!==n&&(r.url=n),r}),[e,t])},h=function(e){return(0,r.useMemo)((function(){return(0,u.FD)(e)}),[e])},m=function(e){return(0,r.useMemo)((function(){return(0,u.FD)(e)}),[e])},v=function(e){return(0,r.useMemo)((function(){var t,n,r;return null!==e&&void 0!==e&&null!==(t=e.data)&&void 0!==t&&t.data&&Array.isArray(null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.data)?null===(r=e.data.data)||void 0===r?void 0:r.map((function(e){return{label:e,value:e}})):[{label:"",value:""}]}),[e])}},25146:function(e,t,n){"use strict";n.d(t,{P:function(){return A}});var r=n(47313),o=n(56352),a=n(4942),i=n(63366),u=n(87462),l=n(83061),s=n(21921),c=n(17551),f=n(88564),d=n(29394),p=n(91615),h=n(70501),m=n(77430),v=n(32298);function g(e){return(0,v.Z)("MuiAlert",e)}var y=(0,m.Z)("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),b=n(47131),w=n(81171),S=n(46417),x=(0,w.Z)((0,S.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),k=(0,w.Z)((0,S.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),_=(0,w.Z)((0,S.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),E=(0,w.Z)((0,S.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),T=(0,w.Z)((0,S.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),C=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],O=(0,f.ZP)(h.Z,{name:"MuiAlert",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,t[n.variant],t["".concat(n.variant).concat((0,p.Z)(n.color||n.severity))]]}})((function(e){var t=e.theme,n=e.ownerState,r="light"===t.palette.mode?c._j:c.$n,o="light"===t.palette.mode?c.$n:c._j,i=n.color||n.severity;return(0,u.Z)({},t.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},i&&"standard"===n.variant&&(0,a.Z)({color:t.vars?t.vars.palette.Alert["".concat(i,"Color")]:r(t.palette[i].light,.6),backgroundColor:t.vars?t.vars.palette.Alert["".concat(i,"StandardBg")]:o(t.palette[i].light,.9)},"& .".concat(y.icon),t.vars?{color:t.vars.palette.Alert["".concat(i,"IconColor")]}:{color:t.palette[i].main}),i&&"outlined"===n.variant&&(0,a.Z)({color:t.vars?t.vars.palette.Alert["".concat(i,"Color")]:r(t.palette[i].light,.6),border:"1px solid ".concat((t.vars||t).palette[i].light)},"& .".concat(y.icon),t.vars?{color:t.vars.palette.Alert["".concat(i,"IconColor")]}:{color:t.palette[i].main}),i&&"filled"===n.variant&&(0,u.Z)({fontWeight:t.typography.fontWeightMedium},t.vars?{color:t.vars.palette.Alert["".concat(i,"FilledColor")],backgroundColor:t.vars.palette.Alert["".concat(i,"FilledBg")]}:{backgroundColor:"dark"===t.palette.mode?t.palette[i].dark:t.palette[i].main,color:t.palette.getContrastText(t.palette[i].main)}))})),M=(0,f.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:function(e,t){return t.icon}})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),P=(0,f.ZP)("div",{name:"MuiAlert",slot:"Message",overridesResolver:function(e,t){return t.message}})({padding:"8px 0",minWidth:0,overflow:"auto"}),N=(0,f.ZP)("div",{name:"MuiAlert",slot:"Action",overridesResolver:function(e,t){return t.action}})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),Z={success:(0,S.jsx)(x,{fontSize:"inherit"}),warning:(0,S.jsx)(k,{fontSize:"inherit"}),error:(0,S.jsx)(_,{fontSize:"inherit"}),info:(0,S.jsx)(E,{fontSize:"inherit"})},D=r.forwardRef((function(e,t){var n,r,o,a,c,f,h=(0,d.Z)({props:e,name:"MuiAlert"}),m=h.action,v=h.children,y=h.className,w=h.closeText,x=void 0===w?"Close":w,k=h.color,_=h.components,E=void 0===_?{}:_,D=h.componentsProps,R=void 0===D?{}:D,A=h.icon,L=h.iconMapping,I=void 0===L?Z:L,j=h.onClose,U=h.role,z=void 0===U?"alert":U,F=h.severity,Y=void 0===F?"success":F,W=h.slotProps,B=void 0===W?{}:W,H=h.slots,V=void 0===H?{}:H,q=h.variant,$=void 0===q?"standard":q,G=(0,i.Z)(h,C),Q=(0,u.Z)({},h,{color:k,severity:Y,variant:$}),K=function(e){var t=e.variant,n=e.color,r=e.severity,o=e.classes,a={root:["root","".concat(t).concat((0,p.Z)(n||r)),"".concat(t)],icon:["icon"],message:["message"],action:["action"]};return(0,s.Z)(a,g,o)}(Q),X=null!=(n=null!=(r=V.closeButton)?r:E.CloseButton)?n:b.Z,J=null!=(o=null!=(a=V.closeIcon)?a:E.CloseIcon)?o:T,ee=null!=(c=B.closeButton)?c:R.closeButton,te=null!=(f=B.closeIcon)?f:R.closeIcon;return(0,S.jsxs)(O,(0,u.Z)({role:z,elevation:0,ownerState:Q,className:(0,l.Z)(K.root,y),ref:t},G,{children:[!1!==A?(0,S.jsx)(M,{ownerState:Q,className:K.icon,children:A||I[Y]||Z[Y]}):null,(0,S.jsx)(P,{ownerState:Q,className:K.message,children:v}),null!=m?(0,S.jsx)(N,{ownerState:Q,className:K.action,children:m}):null,null==m&&j?(0,S.jsx)(N,{ownerState:Q,className:K.action,children:(0,S.jsx)(X,(0,u.Z)({size:"small","aria-label":x,title:x,color:"inherit",onClick:j},ee,{children:(0,S.jsx)(J,(0,u.Z)({fontSize:"small"},te))}))}):null]}))})),R=n(87975);function A(){var e=(0,o.v9)((function(e){return e})).notifications,t=(0,o.I0)(),n=function(e){return(0,r.useEffect)((function(){setTimeout((function(){t((0,R.JU)(e.index))}),e.delay)}),[e]),(0,S.jsx)("div",{children:e.children})};return(0,S.jsx)("div",{className:"alertWrapper",children:e.map((function(e,r){return e.visible?(0,S.jsx)(n,{delay:"4000",index:r,children:(0,S.jsx)("div",{className:"alert",children:(0,S.jsx)(D,{elevation:6,variant:"filled",onClose:function(){return function(e){t((0,R.JU)(e))}(r)},severity:e.type,sx:{width:"100%"},children:e.message})})},r):void 0}))})}},62256:function(e,t,n){"use strict";var r=n(1413),o=n(82751);t.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t="qryn-query",n=t+"-history-item",a=t+"-labels-item",i=[],u=function(e){return localStorage.getItem(e)||"null"},l=function(e,t){localStorage.setItem(e,t)};return{historyStore:function(){var t=function(){return JSON.parse(u(n))},a=function(e){l(n,JSON.stringify(e))},s=t();function c(){var e=JSON.parse(localStorage.getItem(n)||"null")||[];return(null===e||void 0===e?void 0:e.map((function(e){return(0,r.Z)((0,r.Z)({},e),{},{data:decodeURI(e.data)})})))||[]}return{clean:function(){return l(n,JSON.stringify(i)),c()||[]},get:t,set:a,getById:function(){return s.find((function(t){var n=t.id;return e.id===n}))||{}},update:function(e){var t=e.id,n=[];try{return n=s.map((function(n){return n.id===t?(0,r.Z)((0,r.Z)({},n),e):n})),a(n),c()}catch(o){console.log(o)}},add:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,r=t()||[];try{var i=[{id:e.id||(0,o.x0)(),timestamp:e.timestamp||Date.now(),starred:e.starred||!1,data:encodeURI(e.data)||""}].concat(r).slice(0,n);return a(i),c()}catch(u){console.log("error on add",u)}},remove:function(e){var t=s.filter((function(t){return t.id!==e.id}));return a(t),c()},getAll:c}},labelsStore:function(){return function(){return JSON.parse(localStorage.getItem(a)||"null")||[]}},setStorageItem:l,getStorageItem:u,cleanup:i,j_parse:function(e){return JSON.parse(e)},j_string:function(e){return JSON.stringify(e)},l_set:function(e,t){localStorage.setItem(e,t)},l_get:function(e){return localStorage.getItem(e)}}}},8454:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(29439),o=n(37762),a=n(1413),i=n(82751),u="qryn-query",l=u+"-url-item",s=n(62256),c=n(56410),f=function(){var e=(0,s.Z)(),t=e.l_set,n=e.l_get,u=e.j_parse,f=e.j_string,d=function(){return u(n(l)||"null")},p=function(e){return t(l,f(e))},h=d();function m(){return JSON.parse(localStorage.getItem(l)||"null")||[]}return{clean:function(){return localStorage.setItem(l,JSON.stringify([])),m()||[]},get:d,set:p,update:function(e){var t=e.id,n=[];try{return n=h.map((function(n){return n.id===t?(0,a.Z)((0,a.Z)({},n),e):n})),p(n),m()}catch(r){console.log(r)}},add:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=d()||[],a=e.data,u=a.href,l=a.url,s=a.type,f=a.queryInput,h=a.queryType,v=a.limit,g=a.panel,y=window.location.hash,b=window.location.origin,w=new URLSearchParams(y.replace(/#/,"")),S={};w.set("isSubmit","true");var x,k=(0,o.Z)(w);try{for(k.s();!(x=k.n()).done;){var _=(0,r.Z)(x.value,2),E=_[0],T=_[1];S[E]=T}}catch(P){k.e(P)}finally{k.f()}var C=(0,c.Z)(parseInt(S.start)/1e6,"yyyy-MM-dd HH:mm:ss"),O=(0,c.Z)(parseInt(S.stop)/1e6,"yyyy-MM-dd HH:mm:ss");try{var M=[{url:l,href:u,type:s,queryInput:f,queryType:h,limit:v,panel:g,id:e.id||(0,i.x0)(),timestamp:e.timestamp||Date.now(),starred:!1,description:e.description||"",params:S||{},fromDate:C,toDate:O,data:"".concat(b,"/#").concat(w.toString())||""}].concat(n).slice(0,t);return p(M),m()}catch(N){console.log(N)}},remove:function(e){var t=null===h||void 0===h?void 0:h.filter((function(t){return t.id!==e.id}));return p(t),m()},getAll:m,findById:function(e){return h.find((function(t){var n=t.id;return e.id===n}))||{}},share:function(e){var t=e.urlParams,n=e.origin;return"".concat(n,"/#").concat(t.toString())}}}},21090:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(9038);function o(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"===typeof o?o(n,r,e):t(o)}}}}var a=o();a.withExtraArgument=o;var i=a,u=n(72350),l=n(1413),s=function(e,t){switch(t.type){case"SET_LABELS":return(0,l.Z)((0,l.Z)({},e),{},{labels:t.labels});case"SET_LOADING":return(0,l.Z)((0,l.Z)({},e),{},{loading:t.loading});case"SET_LOGS":return(0,l.Z)((0,l.Z)({},e),{},{logs:t.logs});case"SET_LABEL_VALUES":return(0,l.Z)((0,l.Z)({},e),{},{labelValues:t.labelValues});case"SET_START_TIME":return(0,l.Z)((0,l.Z)({},e),{},{start:t.start});case"SET_STOP_TIME":return(0,l.Z)((0,l.Z)({},e),{},{stop:t.stop});case"SET_FROM_TIME":return(0,l.Z)((0,l.Z)({},e),{},{from:t.from});case"SET_TO_TIME":return(0,l.Z)((0,l.Z)({},e),{},{to:t.to});case"SET_TIME_RANGE_LABEL":return(0,l.Z)((0,l.Z)({},e),{},{label:t.label});case"SET_QUERY_LIMIT":return(0,l.Z)((0,l.Z)({},e),{},{limit:t.limit});case"SET_RANGE_OPEN":return(0,l.Z)((0,l.Z)({},e),{},{rangeOpen:t.rangeOpen});case"SET_BROWSER_OPEN":return(0,l.Z)((0,l.Z)({},e),{},{labelsBrowserOpen:t.labelsBrowserOpen});case"SET_SETTINGS_MENU_OPEN":return(0,l.Z)((0,l.Z)({},e),{},{settingsMenuOpen:t.settingsMenuOpen});case"SET_TIME_PICKER_OPEN":return(0,l.Z)((0,l.Z)({},e),{},{timePickerOpen:t.timePickerOpen});case"SET_SETTINGS_DIALOG_OPEN":return(0,l.Z)((0,l.Z)({},e),{},{settingsDialogOpen:t.settingsDialogOpen});case"SET_QUERY":return(0,l.Z)((0,l.Z)({},e),{},{query:t.query});case"SET_QUERY_STEP":return(0,l.Z)((0,l.Z)({},e),{},{step:t.step});case"SET_API_URL":return(0,l.Z)((0,l.Z)({},e),{},{apiUrl:t.apiUrl});case"SET_API_ERRORS":return(0,l.Z)((0,l.Z)({},e),{},{apiErrors:t.apiErrors});case"SET_URL_QUERY_PARAMS":return(0,l.Z)((0,l.Z)({},e),{},{urlQueryParams:t.urlQueryParams});case"SET_QUERY_TYPE":return(0,l.Z)((0,l.Z)({},e),{},{queryType:t.queryType});case"SET_URL_LOCATION":return(0,l.Z)((0,l.Z)({},e),{},{urlLocation:t.urlLocation});case"SET_IS_SUBMIT":return(0,l.Z)((0,l.Z)({},e),{},{isSubmit:t.isSubmit});case"SET_IS_EMBED":return(0,l.Z)((0,l.Z)({},e),{},{isEmbed:t.isEmbed});case"SET_MATRIX_DATA":return(0,l.Z)((0,l.Z)({},e),{},{matrixData:t.matrixData});case"SET_CHART_TYPE":return(0,l.Z)((0,l.Z)({},e),{},{chartType:t.setChartType});case"SET_QUERY_HISTORY":return(0,l.Z)((0,l.Z)({},e),{},{queryHistory:t.queryHistory});case"SET_LINKS_HISTORY":return(0,l.Z)((0,l.Z)({},e),{},{linksHistory:t.linksHistory});case"SET_HISTORY_OPEN":return(0,l.Z)((0,l.Z)({},e),{},{historyOpen:t.historyOpen});case"ADD_NOTIFICATION":case"REMOVE_NOTIFICATION":return(0,l.Z)((0,l.Z)({},e),{},{notifications:t.payload});case"SET_DEBUG_MODE":return(0,l.Z)((0,l.Z)({},e),{},{debugMode:t.debugMode});case"SET_THEME":return(0,l.Z)((0,l.Z)({},e),{},{theme:t.theme});case"SET_AUTO_THEME":return(0,l.Z)((0,l.Z)({},e),{},{autoTheme:t.autoTheme});case"SET_TABLE_DATA":return(0,l.Z)((0,l.Z)({},e),{},{tableData:t.tableData});case"SET_QUERY_TIME":return(0,l.Z)((0,l.Z)({},e),{},{time:t.time});case"SET_QUERY_RESOLUTION":return(0,l.Z)((0,l.Z)({},e),{},{queryResolution:t.queryResolution});case"SET_IS_EMPTY_VIEW":return(0,l.Z)((0,l.Z)({},e),{},{isEmptyView:t.isEmptyView});case"SET_VECTOR_DATA":return(0,l.Z)((0,l.Z)({},e),{},{vectorData:t.vectorData});case"SET_RESPONSE_TYPE":return(0,l.Z)((0,l.Z)({},e),{},{responseType:t.responseType});case"SET_IS_TABLE_VIEW":return(0,l.Z)((0,l.Z)({},e),{},{isTableView:t.isTableView});case"SET_SPLIT_VIEW":return(0,l.Z)((0,l.Z)({},e),{},{isSplit:t.isSplit});case"SET_PANELS_DATA":return(0,l.Z)((0,l.Z)({},e),{},{panels:t.panels});case"SET_DATA_VIEWS":return(0,l.Z)((0,l.Z)({},e),{},{dataViews:t.dataViews});case"SET_RIGHT_DATAVIEW":return(0,l.Z)((0,l.Z)({},e),{},{rightDataView:t.rightDataView});case"SET_LEFT_DATAVIEW":return(0,l.Z)((0,l.Z)({},e),{},{leftDataView:t.leftDataView});case"SET_RIGHT_PANEL":return(0,l.Z)((0,l.Z)({},e),{},{right:t.right});case"SET_LEFT_PANEL":return(0,l.Z)((0,l.Z)({},e),{},{left:t.left});case"SET_DATA_SOURCES":return(0,l.Z)((0,l.Z)({},e),{},{dataSources:t.dataSources});case"SET_IS_DATASOURCE_SAVED":return(0,l.Z)((0,l.Z)({},e),{},{isDsSaved:t.isDsSaved});case"SHOW_DATA_SOURCE_SETTING":return(0,l.Z)((0,l.Z)({},e),{},{showDataSourceSetting:t.showDataSourceSetting});case"SET_PLUGINS":return(0,l.Z)((0,l.Z)({},e),{},{plugins:t.setPlugins});case"SET_USER_TYPE":return(0,l.Z)((0,l.Z)({},e),{},{userType:t.userType});case"SET_CURRENT_USER":return(0,l.Z)((0,l.Z)({},e),{},{currentUser:t.currentUser});default:return(0,l.Z)({},e)}},c=n(70816),f=n.n(c),d={production:!1,environment:"dev",apiUrl:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_VERSION:"0.25.5"}.API_URL||window.location.protocol+"//"+window.location.host||"http://localhost:3100"},p=n(29439),h=n(37762);var m=n(82751),v=n(16806),g=n.n(v),y=["isSubmit","isSplit","autoTheme","isEmbed"],b={query:"",queryType:"range",start:"",time:"",to:"",stop:"",from:"",left:[{id:(0,m.x0)(),idRef:"L-A",lastIdx:1,panel:"left",queryType:"range",dataSourceType:"logs",dataSourceURL:"",dataSourceId:"cHI2SqPzH_kxYRXj",limit:100,step:5,tableView:!1,chartView:!1,isShowTs:!0,isBuilder:!1,isLogsVolume:!1,browserOpen:!1,expr:"",labels:[],values:[],response:{},open:!0,start:new Date(Date.now()-3e5),time:"",stop:new Date(Date.now()),label:"",pickerOpen:!1}],right:[{id:(0,m.x0)(),idRef:"R-A",lastIdx:1,panel:"right",queryType:"range",dataSourceType:"traces",dataSourceId:"32D16h5uYBqUUzhD",dataSourceURL:"",limit:100,step:5,tableView:!1,chartView:!1,isShowTs:!0,isBuilder:!1,isLogsVolume:!1,browserOpen:!1,expr:"",labels:[],values:[],response:{},open:!1,start:new Date(Date.now()-3e5),time:"",stop:new Date(Date.now()),label:"",pickerOpen:!1}],label:"",limit:100,step:5,apiUrl:"",isSubmit:!1,isEmbed:!1,autoTheme:!0,theme:"",isSplit:!1};var w=n(62256),S=n(8454),x=n(9820),k=function(){return!(!0!==(JSON.parse(localStorage.getItem("isDebug")||JSON.stringify(!1))||{isActive:!1}).isActive)||(localStorage.setItem("isDebug",JSON.stringify({isActive:!1})),!1)},_={queryType:"range",start:"",time:"",to:"",stop:"",from:"",left:[],right:[],label:"",limit:100,step:100,apiUrl:"",isSubmit:!1,isEmbed:!1,autoTheme:!0,theme:"",isSplit:!1};var E=(0,r.MT)(s,function(){var e=function(){var e=localStorage.getItem("dataSources")||void 0,t=localStorage.getItem("linkedFields")||void 0,n=!1,r=!1,o=[],a=[];if(void 0!==e){n=!0;try{o=JSON.parse(e)}catch(i){n=!1,o=[]}}if(void 0!==t){r=!0;try{a=JSON.parse(t)}catch(i){r=!1,a=[]}}return{hasDsSettings:n,hasLfSettings:r,dataSourceSettings:o,linkedFieldsSettings:a}},t=function(e){var t=JSON.parse(localStorage.getItem("dataSources")||"");return null===t||void 0===t?void 0:t.find((function(e){return"id"===e.id}))},n=function(){var e=(d.environment,!1);e&&console.group("\ud83d\udea7 LOGIC/InitialState/FromQuery");var t=window.location.hash;e&&console.log("\ud83d\udea7 LOGIC/FromQuery Hash",t);var n=new URLSearchParams(t.replace(/#/,""));if(e&&console.log("\ud83d\udea7 LOGIC/urlFromHash",n,t.length),t.length>0){var r=(0,l.Z)({},b);e&&console.log("\ud83d\udea7 LOGIC/startParams/BeforeURLFromHash",r);var o,a=(0,h.Z)(n.entries());try{for(a.s();!(o=a.n()).done;){var i=(0,p.Z)(o.value,2),u=i[0],s=i[1];if(e&&console.log("\ud83d\udea7 LOGIC/startParams/",u,s),"stop"===u||"start"===u){var c=parseInt(g().sanitize(s))/1e6;r[u]=new Date(f()(c).format("YYYY-MM-DDTHH:mm:ss.SSSZ"))}else if("left"===u||"right"===u){if("string"===typeof decodeURIComponent(g().sanitize(s))){var m=JSON.parse(decodeURIComponent(g().sanitize(s)||"[]"));r[u]=m}}else if(y.includes(u))try{r[u]=JSON.parse(g().sanitize(s||"false"))}catch(v){console.error(u),r[u]=!1}else r[u]=g().sanitize(s);r.theme&&localStorage.setItem("theme",g().sanitize(JSON.stringify({theme:r.theme,auto:!!r.autoTheme})))}}catch(w){a.e(w)}finally{a.f()}return r||b}return e&&console.groupEnd(),b}()||_,r=(0,w.Z)().historyStore(),o=(0,S.Z)(),a={debugMode:k()||!1,labels:[],labelValues:[],queryHistory:r.getAll()||[],linksHistory:o.getAll()||[],timeRange:[],queryType:n.queryType||"range",logs:[],matrixData:[],vectorData:{},loading:!1,queryResolution:1,start:new Date(Date.now()-3e5),time:n.time||"",stop:new Date(Date.now()),from:n.from||null,to:n.to||null,label:n.label,messages:[],limitLoad:!1,limit:n.limit||100,step:n.step||100,rangeOpen:!1,labelsBrowserOpen:!0,settingsMenuOpen:!1,timePickerOpen:!1,settingsDialogOpen:!1,historyOpen:!1,apiErrors:"",urlQueryParams:n||{},urlLocation:"",apiUrl:n.apiUrl||d.apiUrl||"",isSubmit:n.isSubmit||!1,isEmbed:n.isEmbed||!1,userType:"admin",currentUser:{name:"Qryn Admin",role:"admin",id:"OoH8zZt71U70W01LcgAQs",selected:!0},left:n.left||[{id:"widYlu_fXweET5D4",idRef:"L-A",lastIdx:1,panel:"left",queryType:"range",dataSourceType:"logs",dataSourceId:"cHI2SqPzH_kxYRXj",dataSourceURL:t(),limit:100,step:100,tableView:!1,chartView:!1,isShowTs:!0,isBuilder:!1,hasStats:!1,statsData:{},browserOpen:!1,isLogsVolume:!1,expr:"",labels:[],values:[],direction:"backwards",loading:!1,open:!0,start:new Date(Date.now()-3e5),time:"",stop:new Date(Date.now()),label:"",pickerOpen:!1}],right:n.right||[{id:"ndFM1zV-aow5hJ0P",idRef:"R-A",lastIdx:1,panel:"right",queryType:"range",dataSourceType:"traces",dataSourceId:"32D16h5uYBqUUzhD",dataSourceURL:t(),limit:100,step:100,tableView:!1,chartView:!1,isShowTs:!0,isBuilder:!1,browserOpen:!1,isLogsVolume:!1,expr:"",labels:[],values:[],direction:"backwards",loading:!1,open:!1,start:new Date(Date.now()-3e5),time:"",stop:new Date(Date.now()),label:"",pickerOpen:!1}],plugins:{},leftDataView:[],rightDataView:[],dataSources:e().hasDsSettings?e().dataSourceSettings:x.E7,linkedFieldTypes:x.Nr,dataSourcesFieldTypes:x.Q4,linkTypes:["logs","traces","metrics","flux"],visTypes:["chart","logs","table","trace","graph"],chartType:"line",resposeType:"",notifications:[],tableData:{},isTableView:!1,autoTheme:n.autoTheme||!0,theme:n.theme||"light",isEmptyView:!1,isSplit:!1,showDataSourceSetting:!0};return a.debugMode&&console.log("\ud83d\udea7 LOGIC/ INITIAL STATE ::: ",a),a}(),(0,u.Uo)((0,r.md)(i)))},64864:function(e,t,n){"use strict";n.d(t,{z:function(){return u}});var r,o,a=n(30168),i=n(41801),u=i.Z.button(r||(r=(0,a.Z)(["\n padding: 3px 12px;\n font-size: 12px;\n line-height: 20px;\n cursor: pointer;\n user-select: none;\n border: none;\n border-radius: 3px;\n font-weight: 500;\n white-space: nowrap;\n display: flex;\n align-items: center;\n"])));i.Z.button(o||(o=(0,a.Z)(["\n position: relative;\n display: inline-block;\n padding: 5px 16px;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n white-space: nowrap;\n vertical-align: middle;\n cursor: pointer;\n -webkit-user-select: none;\n user-select: none;\n border: 1px solid;\n border-radius: 6px;\n"])))},60065:function(e,t,n){"use strict";n.d(t,{n:function(){return ke}});var r=n(1413),o=n(68658),a=(0,o.Z)(),i={b10:"hsla(0, 0%, 7%, 0.404)",b15:"hsl(0, 0%, 7%)",b100:"hsl(0, 0%, 4%)",b200:"hsl(0, 0%, 8%)",b300:"hsl(0, 0%, 10%)",b400:"hsl(0, 0%, 16%)",b500:"hsl(0, 0%, 20%)"},u={w100:"hsl(0, 0%, 100%)",w200:"hsl(0, 0%, 96%)",w300:"hsl(0, 0%, 92%)",w400:"hsl(0, 0%, 88%)",w500:"hsl(0, 0%, 84%)"},l={lg10:"hsla(0, 0%, 90%, 0.231)",lg15:"hsla(0, 0%, 90%, 0.333)",lg100:"hsl(0, 0%, 80%)",lg200:"hsl(0, 0%, 76%)",lg300:"hsl(0, 0%, 72%)",lg400:"hsl(0, 0%, 68%)",lg500:"hsl(0, 0%, 64%)",lg600:"hsl(0, 0%, 60%)",lg700:"hsl(0, 0%, 56%)"},s={dg10:"hsla(0, 0%, 48%, 0.231)",dg15:"hsla(0, 0%, 48%, 0.333)",dg50:"hsl(0, 0%, 18%)",dg90:"hsl(0, 0%, 25%)",dg100:"hsl(0, 0%, 28%)",dg200:"hsl(0, 0%, 32%)",dg300:"hsl(0, 0%, 36%)",dg400:"hsl(0, 0%, 40%)",dg500:"hsl(0, 0%, 44%)"},c={tq1:"hsl(181, 98%, 21%);",tq100:"hsl(180, 62%, 28%)",tq200:"hsl(180, 62%, 33%)",tq300:"hsl(180, 62%, 44%)",tq400:"hsl(180, 62%, 52%)",tq500:"hsl(180, 62%, 60%)"},f="hsl(39, 100%, 50%)",d=i.b300,p=i.b400,h=i.b100,m=i.b100,v=i.b400,g=i.b200,y=l.lg200,b=s.dg500,w=u.w300,S=f,x=i.b15,k=c.tq200,_=c.tq300,E=c.tq1,T=i.b400,C=i.b300,O=s.dg90,M=l.lg700,P=s.dg100,N=s.dg15,Z=i.b400,D=s.dg300,R=u.w200,A=f,L=f,I=l.lg400,j=i.b10,U=i.b300,z=(0,r.Z)((0,r.Z)({},a),{},{black:i,white:u,lightgrey:l,textColor:y,primaryDark:k,primaryLight:_,primaryBorder:E,buttonSecondaryBg:"#4a525c",widgetContainer:T,buttonDefault:P,buttonHover:N,buttonInactive:Z,buttonBorder:D,buttonText:R,inputBg:x,inputTextFocus:A,inputLabelColor:I,inputLabelBg:j,textOff:b,textPrimary:w,textPrimaryAccent:S,viewBg:U,chartBg:"#111",historyRow:"#6c6b6b38",scrollbarThumb:"hsla(0, 0%, 48%, 0.5)",critical:"hsl(300, 100%, 25%)",error:"hsl(0, 100%, 50%)",warning:"hsl(60, 100%, 50%)",info:"hsl(120, 100%, 25%)",debug:"hsl(240, 100%, 50%)",trace:"hsl(195, 53%, 79%)",unknown:"hsl(0, 0%, 50%)",darkgrey:s,turquoise:c,logBgColor:h,tabActive:m,tabHeader:v,tabBg:g,mainBgColor:d,shBgColor:p,secondaryWidgetContainer:C,widgetTitle:O,widgetTitleBorder:M,highlitedButton:L}),F=(0,o.Z)(),Y={b10:"hsla(0, 0%, 7%, 0.404)",b15:"hsl(0, 0%, 7%)",b100:"hsl(0, 0%, 4%)",b200:"hsl(0, 0%, 8%)",b300:"hsl(0, 0%, 10%)",b400:"hsl(0, 0%, 16%)",b500:"hsl(0, 0%, 20%)"},W={w100:"hsl(0, 0%, 100%)",w200:"hsl(0, 0%, 96%)",w300:"hsl(0, 0%, 92%)",wb:"#f9f9f9",w400:"hsl(180, 5%, 96%)",w500:"hsl(0, 0%, 92%)",w600:"hsla(180,5%,96%,1)",w700:"hsl(0,0%,98%)"},B={lg10:"hsla(0, 0%, 90%, 0.231)",lg15:"hsla(0, 0%, 90%, 0.333)",lg100:"hsl(0, 0%, 80%)",lg200:"hsl(0, 0%, 76%)",lg300:"hsl(0, 0%, 72%)",lg400:"hsl(0, 0%, 68%)",lg500:"hsl(0, 0%, 64%)",lg600:"hsl(0, 0%, 60%)",lg700:"hsl(0, 0%, 56%)"},H={dg10:"hsla(0, 0%, 48%, 0.231)",dg15:"hsla(0, 0%, 48%, 0.333)",dg100:"hsl(0, 0%, 28%)",dg200:"hsl(0, 0%, 32%)",dg300:"hsl(0, 0%, 36%)",dg400:"hsl(0, 0%, 40%)",dg500:"hsl(0, 0%, 44%)"},V={tq1:"hsl(181, 98%, 21%)",tq100:"hsl(180, 62%, 28%)",tq200:"hsl(180, 62%, 33%)",tq300:"hsl(180, 62%, 44%)",tq400:"hsl(180, 62%, 52%)",tq500:"hsl(180, 62%, 60%)"},q={or100:"hsl(39, 100%, 50%)"},$=W.w100,G=W.wb,Q=W.w100,K=W.w100,X=W.w400,J=W.w200,ee=H.dg100,te=B.lg700,ne=Y.b300,re=V.tq200,oe=W.w100,ae=V.tq200,ie=V.tq300,ue=V.tq1,le=W.w200,se=W.w200,ce=B.lg300,fe=B.lg700,de=W.w100,pe=W.w700,he=B.lg10,me=B.lg100,ve=W.w200,ge=q.or100,ye=q.or100,be=B.lg400,we=W.w100,Se=W.w400,xe=q,ke={light:(0,r.Z)((0,r.Z)({},F),{},{black:Y,white:W,lightgrey:B,textColor:ee,primaryDark:ae,primaryLight:ie,primaryBorder:ue,buttonSecondaryBg:"hsl(158, 64%, 85%, 86%)",widgetContainer:le,buttonDefault:de,buttonHover:pe,buttonInactive:he,buttonText:ve,buttonBorder:me,inputBg:oe,inputTextFocus:ge,inputLabelColor:be,inputLabelBg:we,textOff:te,textPrimary:ne,textPrimaryAccent:re,historyRow:"#6c6b6b38",viewBg:Se,chartBg:"#fff",scrollbarThumb:"hsla(0, 0%, 48%, 0.122)",critical:"hsl(300, 100%, 25%)",error:"hsl(0, 100%, 50%)",warning:xe,info:"hsl(120, 100%, 25%)",debug:"hsl(240, 100%, 50%)",trace:"hsl(195, 53%, 79%)",unknown:"hsl(0, 0%, 50%)",darkgrey:H,turquoise:V,logBgColor:Q,tabActive:K,tabHeader:X,tabBg:J,mainBgColor:$,shBgColor:G,secondaryWidgetContainer:se,widgetTitle:ce,widgetTitleBorder:fe,highlitedButton:ye}),dark:z}},9820:function(e,t,n){"use strict";n.d(t,{E7:function(){return d},Nr:function(){return c},Q4:function(){return f}});var r=n(82751),o=[{header:"Content-Type",value:"application/json",id:(0,r.x0)()}],a=[{header:"Content-Type",value:"application/json",id:(0,r.x0)()}],i=[{header:"Content-Type",value:"application/json",id:(0,r.x0)()},{header:"Accept",value:"application/json",id:(0,r.x0)()}],u=[{header:"Accept",value:"application/csv",id:(0,r.x0)()},{header:"Content-Type",value:"application/vnd.flux",id:(0,r.x0)()}],l=[{id:(0,r.x0)(),dataSource:"Traces",dataSourceId:"32D16h5uYBqUUzhD",ds_id:"logs",name:"traceId",regex:"traceI[d|D]=(?\\w+)",query:"${__value.raw}",urlLabel:"",internalLink:!0,linkType:"Traces"},{id:(0,r.x0)(),dataSource:"Traces",dataSourceId:"32D16h5uYBqUUzhD",ds_id:"logs",name:"traceID",regex:"traceI[d|D]=(?\\w+)",query:"${__value.raw}",urlLabel:"",internalLink:!0,linkType:"Traces"}],s={method:{label:"Method",form_type:"select",options:["GET","POST"],value:"GET"},fields:{basicAuth:[{name:"user",cert:"basicAuth",form_type:"input",label:"User",value:"",placeholder:"default"},{name:"password",cert:"basicAuth",form_type:"password",label:"Password",placeholder:"",value:""}]},basicAuth:{form_type:"switch",label:"Basic Auth",value:!1,withFields:!0,fields:"basicAuthUserFields"}},c={logs:{id:"input",dataSource:"input",ds_id:"input",name:"input",regex:"input",query:"input",urlLabel:"input",internalLink:"switch",linkType:"select"}},f={defaultLogsDatasourceFieldTypes:{type:"readonly",name:"input",url:"input",visType:"select"}},d=[{id:"cHI2SqPzH_kxYRXj",type:"logs",value:"logs",name:"Logs",url:"",placeholder:"http://qryn:3000",icon:"logs_icon",visType:"logs",headers:o,linkedFields:l,auth:s},{id:"32D16h5uYBqUUzhD",type:"traces",value:"traces",name:"Traces",url:"",placeholder:"http://traces:3000",icon:"traces_icon",visType:"trace",headers:i,linkedFields:[],auth:s},{id:"XfqOurV-Tng1F0cc",type:"metrics",value:"metrics",name:"Metrics",url:"",placeholder:"http://metrics:3000",icon:"metrics_icon",visType:"chart",headers:a,linkedFields:[],auth:s},{id:"Swjy1SzgWuDmJpUo",type:"flux",value:"flux",name:"Flux",url:"",placeholder:"http://flux:3000",icon:"flux_icon",visType:"chart",headers:u,linkedFields:[],auth:s}]},79644:function(e,t,n){"use strict";n.d(t,{Af:function(){return T},BZ:function(){return x},EL:function(){return O},II:function(){return w},Kx:function(){return S},VJ:function(){return _},X9:function(){return E},__:function(){return b},_z:function(){return y},jy:function(){return C},zs:function(){return k}});var r,o,a,i,u,l,s,c,f,d,p,h,m=n(30168),v=n(41801),g=n(64864),y=v.Z.div(r||(r=(0,m.Z)(["\n overflow-x: hidden;\n border-radius: 3px;\n background: ",";\n color: ",";\n width: 100%;\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n align-items: center;\n\n .cont {\n max-width: 1440px;\n padding: 10px;\n margin: 10px;\n width: 100%;\n background: ",";\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow-x: hidden;\n }\n .ds-header {\n padding: 10px;\n padding-bottom: 20px;\n font-size: 24px;\n display: flex;\n\n margin: 10px;\n justify-content: space-between;\n align-items: center;\n padding-left: 0px;\n .logo {\n margin-right: 10px;\n }\n }\n .ds-cont {\n margin-bottom: 10px;\n border: 1px solid ",";\n border-radius: 3px;\n color: ",";\n }\n\n .ds-item {\n padding: 10px;\n // margin-bottom: 10px;\n border-radius: 3px 3px 0px 0px;\n padding-bottom: 14px;\n display: flex;\n color: ",";\n .logo {\n padding: 10px;\n padding-right: 20px;\n padding-left: 0px;\n }\n .ds-text {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n .ds-type {\n font-size: 18px;\n padding: 10px;\n padding-left: 0px;\n color: ",";\n }\n small {\n font-size: 12px;\n }\n .setting-icon {\n justify-self: flex-end;\n cursor: pointer;\n }\n .ds-settings {\n background: ",";\n }\n }\n .plugins-cont {\n display: flex;\n flex: 1;\n margin: 0px 10px;\n flex-direction: column;\n padding: 10px 20px;\n border: 1px solid ",";\n border-radius: 3px;\n height:fit-content;\n .title {\n font-size: 14px;\n padding: 10px 0px;\n }\n }\n"])),(function(e){return e.theme.viewBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.widgetContainer}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}),(function(e){return e.theme.textColor}),(function(e){return e.theme.textColor}),(function(e){return e.theme.viewBg}),(function(e){return e.theme.buttonBorder})),b=v.Z.div(o||(o=(0,m.Z)(["\n color: ",";\n display: flex;\n align-items: center;\n font-size: 12px;\n padding: 0px 10px;\n //flex: 0;\n white-space: nowrap;\n ","\n border-radius: 3px 0px 0px 3px;\n display: flex;\n align-items: center;\n height: 28px;\n"])),(function(e){return e.theme.textColor}),(function(e){return null!==e.width?"width:".concat(e.width,"px;"):""})),w=v.Z.input(a||(a=(0,m.Z)(["\n display: flex;\n flex: 1;\n background: ",";\n color: ",";\n border: 1px solid\n ",";\n border-radius: 3px;\n justify-self: flex-end;\n height: 26px;\n padding-left: 8px;\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.error?"#b62c14":e.theme.buttonBorder})),S=v.Z.textarea(i||(i=(0,m.Z)(["\n display: flex;\n flex: 1;\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius: 3px;\n justify-self: flex-end;\n padding-left: 8px;\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder})),x=v.Z.div(u||(u=(0,m.Z)(["\n display: flex;\n flex-direction: row;\n margin-top: 5px;\n align-items: center;\n ","\n //flex: 1;\n select {\n background: ",";\n color: ",";\n border: 1px solid ",";\n border-radius: 3px;\n font-size: 12px;\n height: 30px;\n display: flex;\n align-items: center;\n padding: 1px 2px 1px 8px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n option {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"])),(function(e){return null!==e&&void 0!==e&&e.width&&"normal"===(null===e||void 0===e?void 0:e.width)?"":"flex:1;"}),(function(e){return e.theme.inputBg}),(function(e){return e.theme.textColor}),(function(e){return e.theme.buttonBorder})),k=v.Z.div(l||(l=(0,m.Z)(["\n display: flex;\n margin: 15px 0px;\n margin-left: 14px;\n flex-wrap: wrap;\n align-items: center;\n flex: 1;\n &.internal {\n max-width: 400px;\n }\n"]))),_=(v.Z.div(s||(s=(0,m.Z)(["\n display: flex;\n margin: 15px 0px;\n margin-left: 14px;\n align-items: center;\n"]))),v.Z.div(c||(c=(0,m.Z)(["\n padding: 10px;\n"])))),E=v.Z.div(f||(f=(0,m.Z)(["\n margin: 10px 0px;\n padding-bottom: 10px;\n border-bottom: 1px solid ",";\n"])),(function(e){return e.theme.mainBgColor})),T=v.Z.div(d||(d=(0,m.Z)(["\n padding: 10px;\n border-bottom: 1px solid ",";\n border-radius: 3px;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n .edit-buttons {\n display: flex;\n align-items: center;\n &:disabled {\n display: none;\n }\n }\n"])),(function(e){return e.theme.widgetContainer})),C=v.Z.div(p||(p=(0,m.Z)(["\n background: ",";\n padding: 10px;\n border-radius: 0px 0px 3px 3px;\n border-top: 1px solid ",";\n"])),(function(e){return e.theme.inputBg}),(function(e){return e.theme.buttonBorder})),O=(0,v.Z)(g.z)(h||(h=(0,m.Z)(["\n background: ",";\n border: 1px solid ",";\n color: ",";\n margin-left: 5px;\n transition: 0.25s all;\n justify-content: center;\n padding: 3px 12px;\n height: 28px;\n display: flex;\n &:hover {\n background: ",";\n color: ",";\n }\n &:disabled {\n background: ",";\n border: 1px solid ",";\n cursor: not-allowed;\n color: ",";\n }\n @media screen and (max-width: 1070px) {\n display: flex;\n\n margin: 0;\n }\n"])),(function(e){return e.primary?e.theme.primaryDark:e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.primary?e.theme.buttonText:e.theme.textColor}),(function(e){return e.theme.primaryLight}),(function(e){return e.primary?e.theme.textColor:e.theme.buttonText}),(function(e){return e.theme.buttonDefault}),(function(e){return e.theme.buttonBorder}),(function(e){return e.theme.textColor}))},53132:function(e,t,n){"use strict";n.d(t,{zx:function(){return l},gN:function(){return v},JO:function(){return p},D8:function(){return i},ll:function(){return _},Ph:function(){return x}});var r,o=n.p+"static/media/qryn-logo.26a5a5a8cc98abd3f4b1.png",a=n(46417),i=function(e){var t=e.height;return(0,a.jsx)("img",{src:o,alt:"qryyn View",height:t||"24px",className:"logo"})},u=n(79644),l=function(e){var t=e.value,n=e.onClick,r=e.primary,o=e.title;return(0,a.jsx)(u.EL,{title:o,onClick:n,primary:r,children:t})},s=n.p+"static/media/metrics_icon.5c6e7fed7a326bf2e476.png",c=n.p+"static/media/logs_icon.09d704bc457f4670bc5d.png",f=n.p+"static/media/traces_icon.f163c9469c353d621a8b.png",d={metrics_icon:s,logs_icon:c,traces_icon:f},p=function(e){var t=e.icon,n=e.style;return(0,a.jsx)("img",{height:"40px",className:"logo",style:n,src:d[t]||c,alt:t})},h=n(16806),m=n.n(h),v=function(e){var t=e.value,n=e.label,r=e.onChange,o=e.locked,i=e.type,l=e.placeholder,s=e.error,c=e.labelWidth;return(0,a.jsxs)(u.BZ,{children:[(0,a.jsx)(u.__,{width:c||null,children:n}),(0,a.jsx)(u.II,{className:"ds-input",disabled:o,error:s||!1,onChange:r,type:i,value:m().sanitize(t),placeholder:l})]})},g=n(29439),y=n(30168),b=n(62975),w=n(47313),S=function(e){return(0,b.iv)(r||(r=(0,y.Z)(["\n display: flex;\n flex: ",";\n"])),e?1:0)},x=function(e){var t=e.value,n=e.locked,r=e.onChange,o=e.opts,i=e.label,l=e.labelWidth,s=e.name,c=e.fullWidth,f=e.width,d=(0,w.useState)(""),p=(0,g.Z)(d,2),h=p[0],v=p[1],y=(0,w.useRef)(null),x=(0,w.useMemo)((function(){return"string"===typeof o[0]?o.map((function(e){return{value:e,name:e}})):o}),[o]);return(0,w.useEffect)((function(){var e,n,r=null===x||void 0===x||null===(e=x.find((function(e){return e.name===t})))||void 0===e?void 0:e.value;r&&(null===y||void 0===y||null===(n=y.current)||void 0===n?void 0:n.value)!==r&&(v(r),y.current.value=r)}),[t]),(0,a.jsxs)(u.BZ,{width:f,children:[(null===i||void 0===i?void 0:i.length)>0&&(0,a.jsx)(u.__,{width:l||null,children:i}),(0,a.jsx)("select",{ref:y,className:(0,b.cx)(S(c)),disabled:n,defaultValue:m().sanitize(h),onChange:function(e){return r(e,s)},children:null===x||void 0===x?void 0:x.map((function(e,t){return(0,a.jsx)("option",{value:m().sanitize(e.value),children:e.name},t)}))})]})},k=n(70024),_=function(e){var t=e.value,n=e.onChange,r=e.locked,o=e.label;return(0,a.jsxs)(u.BZ,{children:[(0,a.jsx)(u.__,{children:o}),(0,a.jsx)(k.Z,{disabled:r,size:"small",checked:t,onChange:n})]})}},5296:function(e,t,n){"use strict";n.d(t,{Z:function(){return ae}});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?c(w,--y):0,v--,10===b&&(v=1,m--),b}function _(){return b=y2||O(b)>3?"":" "}function D(e,t){for(;--t&&_()&&!(b<48||b>102||b>57&&b<65||b>70&&b<97););return C(e,T()+(t<6&&32==E()&&32==_()))}function R(e){for(;_();)switch(b){case e:return y;case 34:case 39:34!==e&&39!==e&&R(b);break;case 40:41===e&&R(e);break;case 92:_()}return y}function A(e,t){for(;_()&&e+b!==57&&(e+b!==84||47!==E()););return"/*"+C(t,y-1)+"*"+a(47===e?e:_())}function L(e){for(;!O(E());)_();return C(e,y)}var I="-ms-",j="-moz-",U="-webkit-",z="comm",F="rule",Y="decl",W="@import",B="@keyframes";function H(e,t){for(var n="",r=p(e),o=0;o0&&d(j)-g&&h(b>32?K(j+";",r,n,g-1):K(l(j," ","")+";",r,n,g-2),p);break;case 59:j+=";";default:if(h(I=G(j,t,n,m,v,o,f,M,P=[],R=[],g),i),123===O)if(0===v)$(j,t,I,I,P,i,g,f,R);else switch(99===y&&110===c(j,3)?100:y){case 100:case 109:case 115:$(e,I,I,r&&h(G(e,I,I,0,0,o,f,M,o,P=[],g),R),o,R,g,f,r?P:R);break;default:$(j,I,I,I,[""],R,0,f,R)}}m=v=b=0,S=C=1,M=j="",g=u;break;case 58:g=1+d(j),b=w;default:if(S<1)if(123==O)--S;else if(125==O&&0==S++&&125==k())continue;switch(j+=a(O),O*S){case 38:C=v>0?1:(j+="\f",-1);break;case 44:f[m++]=(d(j)-1)*C,C=1;break;case 64:45===E()&&(j+=N(_())),y=E(),v=g=d(M=j+=L(T())),O++;break;case 45:45===w&&2==d(j)&&(S=0)}}return i}function G(e,t,n,r,a,i,s,c,d,h,m){for(var v=a-1,g=0===a?i:[""],y=p(g),b=0,w=0,x=0;b0?g[k]+" "+_:l(_,/&\f/g,g[k])))&&(d[x++]=E);return S(e,t,n,0===a?F:c,d,h,m)}function Q(e,t,n){return S(e,t,n,z,a(b),f(e,2,-2),0)}function K(e,t,n,r){return S(e,t,n,Y,f(e,0,r),f(e,r+1,-1),r)}var X=function(e,t,n){for(var r=0,o=0;r=o,o=E(),38===r&&12===o&&(t[n]=1),!O(o);)_();return C(e,y)},J=function(e,t){return P(function(e,t){var n=-1,r=44;do{switch(O(r)){case 0:38===r&&12===E()&&(t[n]=1),e[n]+=X(y-1,t,n);break;case 2:e[n]+=N(r);break;case 4:if(44===r){e[++n]=58===E()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=a(r)}}while(r=_());return e}(M(e),t))},ee=new WeakMap,te=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ee.get(n))&&!r){ee.set(e,!0);for(var o=[],a=J(t,o),i=n.props,u=0,l=0;u6)switch(c(e,t+1)){case 109:if(45!==c(e,t+4))break;case 102:return l(e,/(.+:)(.+)-([^]+)/,"$1"+U+"$2-$3$1"+j+(108==c(e,t+3)?"$3":"$2-$3"))+e;case 115:return~s(e,"stretch")?re(l(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==c(e,t+1))break;case 6444:switch(c(e,d(e)-3-(~s(e,"!important")&&10))){case 107:return l(e,":",":"+U)+e;case 101:return l(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+U+(45===c(e,14)?"inline-":"")+"box$3$1"+U+"$2$3$1"+I+"$2box$3")+e}break;case 5936:switch(c(e,t+11)){case 114:return U+e+I+l(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return U+e+I+l(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return U+e+I+l(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return U+e+I+e+e}return e}var oe=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Y:e.return=re(e.value,e.length);break;case B:return H([x(e,{value:l(e.value,"@","@"+U)})],r);case F:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return H([x(e,{props:[l(t,/:(read-\w+)/,":"+j+"$1")]})],r);case"::placeholder":return H([x(e,{props:[l(t,/:(plac\w+)/,":"+U+"input-$1")]}),x(e,{props:[l(t,/:(plac\w+)/,":"+j+"$1")]}),x(e,{props:[l(t,/:(plac\w+)/,I+"input-$1")]})],r)}return""}))}}],ae=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o=e.stylisPlugins||oe;var a,i,u={},l=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},a=n(91816),i=/[A-Z]|^ms/g,u=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},s=function(e){return null!=e&&"boolean"!==typeof e},c=(0,a.Z)((function(e){return l(e)?e:e.replace(i,"-$&").toLowerCase()})),f=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(u,(function(e,t,n){return p={name:t,styles:n,next:p},t}))}return 1===o[e]||l(e)||"number"!==typeof t||0===t?t:t+"px"};function d(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return p={name:n.name,styles:n.styles,next:p},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)p={name:r.name,styles:r.styles,next:p},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o96?c:f},p=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},h=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;(0,u.hC)(t,n,r);(0,s.L)((function(){return(0,u.My)(t,n,r)}));return null},m=function e(t,n){var a,s,c=t.__emotion_real===t,f=c&&t.__emotion_base||t;void 0!==n&&(a=n.label,s=n.target);var m=p(t,n,c),v=m||d(f),g=!v("as");return function(){var y=arguments,b=c&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==a&&b.push("label:"+a+";"),null==y[0]||void 0===y[0].raw)b.push.apply(b,y);else{0,b.push(y[0][0]);for(var w=y.length,S=1;S0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=t.pulsate,o=void 0!==r&&r,a=t.center,i=void 0===a?s||t.pulsate:a,u=t.fakeElement,l=void 0!==u&&u;if("mousedown"===(null==e?void 0:e.type)&&x.current)x.current=!1;else{"touchstart"===(null==e?void 0:e.type)&&(x.current=!0);var c,f,d,p=l?null:T.current,h=p?p.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(i||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(h.width/2),f=Math.round(h.height/2);else{var m=e.touches&&e.touches.length>0?e.touches[0]:e,v=m.clientX,g=m.clientY;c=Math.round(v-h.left),f=Math.round(g-h.top)}if(i)(d=Math.sqrt((2*Math.pow(h.width,2)+Math.pow(h.height,2))/3))%2===0&&(d+=1);else{var y=2*Math.max(Math.abs((p?p.clientWidth:0)-c),c)+2,b=2*Math.max(Math.abs((p?p.clientHeight:0)-f),f)+2;d=Math.sqrt(Math.pow(y,2)+Math.pow(b,2))}null!=e&&e.touches?null===_.current&&(_.current=function(){O({pulsate:o,rippleX:c,rippleY:f,rippleSize:d,cb:n})},k.current=setTimeout((function(){_.current&&(_.current(),_.current=null)}),z)):O({pulsate:o,rippleX:c,rippleY:f,rippleSize:d,cb:n})}}),[s,O]),P=u.useCallback((function(){M({},{pulsate:!0})}),[M]),N=u.useCallback((function(e,t){if(clearTimeout(k.current),"touchend"===(null==e?void 0:e.type)&&_.current)return _.current(),_.current=null,void(k.current=setTimeout((function(){N(e,t)})));_.current=null,b((function(e){return e.length>0?e.slice(1):e})),S.current=t}),[]);return u.useImperativeHandle(t,(function(){return{pulsate:P,start:M,stop:N}}),[P,M,N]),(0,C.jsx)(B,(0,a.Z)({className:(0,l.Z)(j.root,d.root,p),ref:T},h,{children:(0,C.jsx)(E,{component:null,exit:!0,children:y})}))})),q=V,$=n(32298);function G(e){return(0,$.Z)("MuiButtonBase",e)}var Q,K=(0,M.Z)("MuiButtonBase",["root","disabled","focusVisible"]),X=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],J=(0,c.ZP)("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:function(e,t){return t.root}})((Q={display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"}},(0,o.Z)(Q,"&.".concat(K.disabled),{pointerEvents:"none",cursor:"default"}),(0,o.Z)(Q,"@media print",{colorAdjust:"exact"}),Q)),ee=u.forwardRef((function(e,t){var n=(0,f.Z)({props:e,name:"MuiButtonBase"}),o=n.action,c=n.centerRipple,m=void 0!==c&&c,v=n.children,g=n.className,y=n.component,b=void 0===y?"button":y,w=n.disabled,S=void 0!==w&&w,x=n.disableRipple,k=void 0!==x&&x,_=n.disableTouchRipple,E=void 0!==_&&_,T=n.focusRipple,O=void 0!==T&&T,M=n.LinkComponent,P=void 0===M?"a":M,N=n.onBlur,Z=n.onClick,D=n.onContextMenu,R=n.onDragLeave,A=n.onFocus,L=n.onFocusVisible,I=n.onKeyDown,j=n.onKeyUp,U=n.onMouseDown,z=n.onMouseLeave,F=n.onMouseUp,Y=n.onTouchEnd,W=n.onTouchMove,B=n.onTouchStart,H=n.tabIndex,V=void 0===H?0:H,$=n.TouchRippleProps,Q=n.touchRippleRef,K=n.type,ee=(0,i.Z)(n,X),te=u.useRef(null),ne=u.useRef(null),re=(0,d.Z)(ne,Q),oe=(0,h.Z)(),ae=oe.isFocusVisibleRef,ie=oe.onFocus,ue=oe.onBlur,le=oe.ref,se=u.useState(!1),ce=(0,r.Z)(se,2),fe=ce[0],de=ce[1];S&&fe&&de(!1),u.useImperativeHandle(o,(function(){return{focusVisible:function(){de(!0),te.current.focus()}}}),[]);var pe=u.useState(!1),he=(0,r.Z)(pe,2),me=he[0],ve=he[1];u.useEffect((function(){ve(!0)}),[]);var ge=me&&!k&&!S;function ye(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;return(0,p.Z)((function(r){return t&&t(r),!n&&ne.current&&ne.current[e](r),!0}))}u.useEffect((function(){fe&&O&&!k&&me&&ne.current.pulsate()}),[k,O,fe,me]);var be=ye("start",U),we=ye("stop",D),Se=ye("stop",R),xe=ye("stop",F),ke=ye("stop",(function(e){fe&&e.preventDefault(),z&&z(e)})),_e=ye("start",B),Ee=ye("stop",Y),Te=ye("stop",W),Ce=ye("stop",(function(e){ue(e),!1===ae.current&&de(!1),N&&N(e)}),!1),Oe=(0,p.Z)((function(e){te.current||(te.current=e.currentTarget),ie(e),!0===ae.current&&(de(!0),L&&L(e)),A&&A(e)})),Me=function(){var e=te.current;return b&&"button"!==b&&!("A"===e.tagName&&e.href)},Pe=u.useRef(!1),Ne=(0,p.Z)((function(e){O&&!Pe.current&&fe&&ne.current&&" "===e.key&&(Pe.current=!0,ne.current.stop(e,(function(){ne.current.start(e)}))),e.target===e.currentTarget&&Me()&&" "===e.key&&e.preventDefault(),I&&I(e),e.target===e.currentTarget&&Me()&&"Enter"===e.key&&!S&&(e.preventDefault(),Z&&Z(e))})),Ze=(0,p.Z)((function(e){O&&" "===e.key&&ne.current&&fe&&!e.defaultPrevented&&(Pe.current=!1,ne.current.stop(e,(function(){ne.current.pulsate(e)}))),j&&j(e),Z&&e.target===e.currentTarget&&Me()&&" "===e.key&&!e.defaultPrevented&&Z(e)})),De=b;"button"===De&&(ee.href||ee.to)&&(De=P);var Re={};"button"===De?(Re.type=void 0===K?"button":K,Re.disabled=S):(ee.href||ee.to||(Re.role="button"),S&&(Re["aria-disabled"]=S));var Ae=(0,d.Z)(t,le,te);var Le=(0,a.Z)({},n,{centerRipple:m,component:b,disabled:S,disableRipple:k,disableTouchRipple:E,focusRipple:O,tabIndex:V,focusVisible:fe}),Ie=function(e){var t=e.disabled,n=e.focusVisible,r=e.focusVisibleClassName,o=e.classes,a={root:["root",t&&"disabled",n&&"focusVisible"]},i=(0,s.Z)(a,G,o);return n&&r&&(i.root+=" ".concat(r)),i}(Le);return(0,C.jsxs)(J,(0,a.Z)({as:De,className:(0,l.Z)(Ie.root,g),ownerState:Le,onBlur:Ce,onClick:Z,onContextMenu:we,onFocus:Oe,onKeyDown:Ne,onKeyUp:Ze,onMouseDown:be,onMouseLeave:ke,onMouseUp:xe,onDragLeave:Se,onTouchEnd:Ee,onTouchMove:Te,onTouchStart:_e,ref:Ae,tabIndex:S?-1:V,type:K},Re,ee,{children:[v,ge?(0,C.jsx)(q,(0,a.Z)({ref:re,center:m},$)):null]}))})),te=ee},83176:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(47313);var o=r.createContext(void 0);function a(){return r.useContext(o)}},47131:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(4942),o=n(63366),a=n(87462),i=n(47313),u=n(83061),l=n(21921),s=n(17551),c=n(88564),f=n(29394),d=n(67999),p=n(91615),h=n(77430),m=n(32298);function v(e){return(0,m.Z)("MuiIconButton",e)}var g=(0,h.Z)("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),y=n(46417),b=["edge","children","className","color","disabled","disableFocusRipple","size"],w=(0,c.ZP)(d.Z,{name:"MuiIconButton",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,"default"!==n.color&&t["color".concat((0,p.Z)(n.color))],n.edge&&t["edge".concat((0,p.Z)(n.edge))],t["size".concat((0,p.Z)(n.size))]]}})((function(e){var t=e.theme,n=e.ownerState;return(0,a.Z)({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!n.disableRipple&&{"&:hover":{backgroundColor:t.vars?"rgba(".concat(t.vars.palette.action.activeChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,s.Fq)(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===n.edge&&{marginLeft:"small"===n.size?-3:-12},"end"===n.edge&&{marginRight:"small"===n.size?-3:-12})}),(function(e){var t,n=e.theme,o=e.ownerState,i=null==(t=(n.vars||n).palette)?void 0:t[o.color];return(0,a.Z)({},"inherit"===o.color&&{color:"inherit"},"inherit"!==o.color&&"default"!==o.color&&(0,a.Z)({color:null==i?void 0:i.main},!o.disableRipple&&{"&:hover":(0,a.Z)({},i&&{backgroundColor:n.vars?"rgba(".concat(i.mainChannel," / ").concat(n.vars.palette.action.hoverOpacity,")"):(0,s.Fq)(i.main,n.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===o.size&&{padding:5,fontSize:n.typography.pxToRem(18)},"large"===o.size&&{padding:12,fontSize:n.typography.pxToRem(28)},(0,r.Z)({},"&.".concat(g.disabled),{backgroundColor:"transparent",color:(n.vars||n).palette.action.disabled}))})),S=i.forwardRef((function(e,t){var n=(0,f.Z)({props:e,name:"MuiIconButton"}),r=n.edge,i=void 0!==r&&r,s=n.children,c=n.className,d=n.color,h=void 0===d?"default":d,m=n.disabled,g=void 0!==m&&m,S=n.disableFocusRipple,x=void 0!==S&&S,k=n.size,_=void 0===k?"medium":k,E=(0,o.Z)(n,b),T=(0,a.Z)({},n,{edge:i,color:h,disabled:g,disableFocusRipple:x,size:_}),C=function(e){var t=e.classes,n=e.disabled,r=e.color,o=e.edge,a=e.size,i={root:["root",n&&"disabled","default"!==r&&"color".concat((0,p.Z)(r)),o&&"edge".concat((0,p.Z)(o)),"size".concat((0,p.Z)(a))]};return(0,l.Z)(i,v,t)}(T);return(0,y.jsx)(w,(0,a.Z)({className:(0,u.Z)(C.root,c),centerRipple:!0,focusRipple:!x,disabled:g,ref:t,ownerState:T},E,{children:s}))}))},70501:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(63366),o=n(87462),a=n(47313),i=n(83061),u=n(21921),l=n(17551),s=n(88564),c=function(e){return((e<1?5.11916*Math.pow(e,2):4.5*Math.log(e+1)+2)/100).toFixed(2)},f=n(29394),d=n(77430),p=n(32298);function h(e){return(0,p.Z)("MuiPaper",e)}(0,d.Z)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);var m=n(46417),v=["className","component","elevation","square","variant"],g=(0,s.ZP)("div",{name:"MuiPaper",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t["elevation".concat(n.elevation)]]}})((function(e){var t,n=e.theme,r=e.ownerState;return(0,o.Z)({backgroundColor:(n.vars||n).palette.background.paper,color:(n.vars||n).palette.text.primary,transition:n.transitions.create("box-shadow")},!r.square&&{borderRadius:n.shape.borderRadius},"outlined"===r.variant&&{border:"1px solid ".concat((n.vars||n).palette.divider)},"elevation"===r.variant&&(0,o.Z)({boxShadow:(n.vars||n).shadows[r.elevation]},!n.vars&&"dark"===n.palette.mode&&{backgroundImage:"linear-gradient(".concat((0,l.Fq)("#fff",c(r.elevation)),", ").concat((0,l.Fq)("#fff",c(r.elevation)),")")},n.vars&&{backgroundImage:null==(t=n.vars.overlays)?void 0:t[r.elevation]}))})),y=a.forwardRef((function(e,t){var n=(0,f.Z)({props:e,name:"MuiPaper"}),a=n.className,l=n.component,s=void 0===l?"div":l,c=n.elevation,d=void 0===c?1:c,p=n.square,y=void 0!==p&&p,b=n.variant,w=void 0===b?"elevation":b,S=(0,r.Z)(n,v),x=(0,o.Z)({},n,{component:s,elevation:d,square:y,variant:w}),k=function(e){var t=e.square,n=e.elevation,r=e.variant,o=e.classes,a={root:["root",r,!t&&"rounded","elevation"===r&&"elevation".concat(n)]};return(0,u.Z)(a,h,o)}(x);return(0,m.jsx)(g,(0,o.Z)({as:s,ownerState:x,className:(0,i.Z)(k.root,a),ref:t},S))}))},70024:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var r=n(4942),o=n(63366),a=n(87462),i=n(47313),u=n(83061),l=n(21921),s=n(17551),c=n(91615),f=n(97423),d=n(29394),p=n(88564),h=n(77430),m=n(32298);function v(e){return(0,m.Z)("MuiSwitch",e)}var g=(0,h.Z)("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),y=n(46417),b=["className","color","edge","size","sx"],w=(0,p.ZP)("span",{name:"MuiSwitch",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,n.edge&&t["edge".concat((0,c.Z)(n.edge))],t["size".concat((0,c.Z)(n.size))]]}})((function(e){var t,n=e.ownerState;return(0,a.Z)({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},"start"===n.edge&&{marginLeft:-8},"end"===n.edge&&{marginRight:-8},"small"===n.size&&(t={width:40,height:24,padding:7},(0,r.Z)(t,"& .".concat(g.thumb),{width:16,height:16}),(0,r.Z)(t,"& .".concat(g.switchBase),(0,r.Z)({padding:4},"&.".concat(g.checked),{transform:"translateX(16px)"})),t))})),S=(0,p.ZP)(f.Z,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:function(e,t){var n=e.ownerState;return[t.switchBase,(0,r.Z)({},"& .".concat(g.input),t.input),"default"!==n.color&&t["color".concat((0,c.Z)(n.color))]]}})((function(e){var t,n=e.theme;return t={position:"absolute",top:0,left:0,zIndex:1,color:n.vars?n.vars.palette.Switch.defaultColor:"".concat("light"===n.palette.mode?n.palette.common.white:n.palette.grey[300]),transition:n.transitions.create(["left","transform"],{duration:n.transitions.duration.shortest})},(0,r.Z)(t,"&.".concat(g.checked),{transform:"translateX(20px)"}),(0,r.Z)(t,"&.".concat(g.disabled),{color:n.vars?n.vars.palette.Switch.defaultDisabledColor:"".concat("light"===n.palette.mode?n.palette.grey[100]:n.palette.grey[600])}),(0,r.Z)(t,"&.".concat(g.checked," + .").concat(g.track),{opacity:.5}),(0,r.Z)(t,"&.".concat(g.disabled," + .").concat(g.track),{opacity:n.vars?n.vars.opacity.switchTrackDisabled:"".concat("light"===n.palette.mode?.12:.2)}),(0,r.Z)(t,"& .".concat(g.input),{left:"-100%",width:"300%"}),t}),(function(e){var t,n=e.theme,o=e.ownerState;return(0,a.Z)({"&:hover":{backgroundColor:n.vars?"rgba(".concat(n.vars.palette.action.activeChannel," / ").concat(n.vars.palette.action.hoverOpacity,")"):(0,s.Fq)(n.palette.action.active,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==o.color&&(t={},(0,r.Z)(t,"&.".concat(g.checked),(0,r.Z)({color:(n.vars||n).palette[o.color].main,"&:hover":{backgroundColor:n.vars?"rgba(".concat(n.vars.palette[o.color].mainChannel," / ").concat(n.vars.palette.action.hoverOpacity,")"):(0,s.Fq)(n.palette[o.color].main,n.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&.".concat(g.disabled),{color:n.vars?n.vars.palette.Switch["".concat(o.color,"DisabledColor")]:"".concat("light"===n.palette.mode?(0,s.$n)(n.palette[o.color].main,.62):(0,s._j)(n.palette[o.color].main,.55))})),(0,r.Z)(t,"&.".concat(g.checked," + .").concat(g.track),{backgroundColor:(n.vars||n).palette[o.color].main}),t))})),x=(0,p.ZP)("span",{name:"MuiSwitch",slot:"Track",overridesResolver:function(e,t){return t.track}})((function(e){var t=e.theme;return{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:"".concat("light"===t.palette.mode?t.palette.common.black:t.palette.common.white),opacity:t.vars?t.vars.opacity.switchTrack:"".concat("light"===t.palette.mode?.38:.3)}})),k=(0,p.ZP)("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:function(e,t){return t.thumb}})((function(e){var t=e.theme;return{boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}})),_=i.forwardRef((function(e,t){var n=(0,d.Z)({props:e,name:"MuiSwitch"}),r=n.className,i=n.color,s=void 0===i?"primary":i,f=n.edge,p=void 0!==f&&f,h=n.size,m=void 0===h?"medium":h,g=n.sx,_=(0,o.Z)(n,b),E=(0,a.Z)({},n,{color:s,edge:p,size:m}),T=function(e){var t=e.classes,n=e.edge,r=e.size,o=e.color,i=e.checked,u=e.disabled,s={root:["root",n&&"edge".concat((0,c.Z)(n)),"size".concat((0,c.Z)(r))],switchBase:["switchBase","color".concat((0,c.Z)(o)),i&&"checked",u&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},f=(0,l.Z)(s,v,t);return(0,a.Z)({},t,f)}(E),C=(0,y.jsx)(k,{className:T.thumb,ownerState:E});return(0,y.jsxs)(w,{className:(0,u.Z)(T.root,r),sx:g,ownerState:E,children:[(0,y.jsx)(S,(0,a.Z)({type:"checkbox",icon:C,checkedIcon:C,ref:t,ownerState:E},_,{classes:(0,a.Z)({},T,{root:T.switchBase})})),(0,y.jsx)(x,{className:T.track,ownerState:E})]})}))},97423:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var r=n(29439),o=n(63366),a=n(87462),i=n(47313),u=n(83061),l=n(21921),s=n(91615),c=n(88564),f=n(53800),d=n(83176),p=n(67999),h=n(77430),m=n(32298);function v(e){return(0,m.Z)("PrivateSwitchBase",e)}(0,h.Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var g=n(46417),y=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],b=(0,c.ZP)(p.Z)((function(e){var t=e.ownerState;return(0,a.Z)({padding:9,borderRadius:"50%"},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12})})),w=(0,c.ZP)("input")({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),S=i.forwardRef((function(e,t){var n=e.autoFocus,i=e.checked,c=e.checkedIcon,p=e.className,h=e.defaultChecked,m=e.disabled,S=e.disableFocusRipple,x=void 0!==S&&S,k=e.edge,_=void 0!==k&&k,E=e.icon,T=e.id,C=e.inputProps,O=e.inputRef,M=e.name,P=e.onBlur,N=e.onChange,Z=e.onFocus,D=e.readOnly,R=e.required,A=void 0!==R&&R,L=e.tabIndex,I=e.type,j=e.value,U=(0,o.Z)(e,y),z=(0,f.Z)({controlled:i,default:Boolean(h),name:"SwitchBase",state:"checked"}),F=(0,r.Z)(z,2),Y=F[0],W=F[1],B=(0,d.Z)(),H=m;B&&"undefined"===typeof H&&(H=B.disabled);var V="checkbox"===I||"radio"===I,q=(0,a.Z)({},e,{checked:Y,disabled:H,disableFocusRipple:x,edge:_}),$=function(e){var t=e.classes,n=e.checked,r=e.disabled,o=e.edge,a={root:["root",n&&"checked",r&&"disabled",o&&"edge".concat((0,s.Z)(o))],input:["input"]};return(0,l.Z)(a,v,t)}(q);return(0,g.jsxs)(b,(0,a.Z)({component:"span",className:(0,u.Z)($.root,p),centerRipple:!0,focusRipple:!x,disabled:H,tabIndex:null,role:void 0,onFocus:function(e){Z&&Z(e),B&&B.onFocus&&B.onFocus(e)},onBlur:function(e){P&&P(e),B&&B.onBlur&&B.onBlur(e)},ownerState:q,ref:t},U,{children:[(0,g.jsx)(w,(0,a.Z)({autoFocus:n,checked:i,defaultChecked:h,className:$.input,disabled:H,id:V?T:void 0,name:M,onChange:function(e){if(!e.nativeEvent.defaultPrevented){var t=e.target.checked;W(t),N&&N(e,t)}},readOnly:D,ref:O,required:A,ownerState:q,tabIndex:L,type:I},"checkbox"===I&&void 0===j?{}:{value:j},C)),Y?c:E]}))}))},68658:function(e,t,n){"use strict";n.d(t,{Z:function(){return B}});var r=n(87462),o=n(63366),a=n(77219),i=n(13019),u=n(9456),l=n(63232),s=n(63649),c=n(4942);function f(e,t){var n;return(0,r.Z)({toolbar:(n={minHeight:56},(0,c.Z)(n,e.up("xs"),{"@media (orientation: landscape)":{minHeight:48}}),(0,c.Z)(n,e.up("sm"),{minHeight:64}),n)},t)}var d=n(17551),p={black:"#000",white:"#fff"},h={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},m={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},v={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},y={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},b={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},w={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},S=["mode","contrastThreshold","tonalOffset"],x={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:p.white,default:p.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},k={text:{primary:p.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:p.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function _(e,t,n,r){var o=r.light||r,a=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,d.$n)(e.main,o):"dark"===t&&(e.dark=(0,d._j)(e.main,a)))}function E(e){var t=e.mode,n=void 0===t?"light":t,u=e.contrastThreshold,l=void 0===u?3:u,s=e.tonalOffset,c=void 0===s?.2:s,f=(0,o.Z)(e,S),E=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:y[200],light:y[50],dark:y[400]}:{main:y[700],light:y[400],dark:y[800]}}(n),T=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[200],light:m[50],dark:m[400]}:{main:m[500],light:m[300],dark:m[700]}}(n),C=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:v[500],light:v[300],dark:v[700]}:{main:v[700],light:v[400],dark:v[800]}}(n),O=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:b[400],light:b[300],dark:b[700]}:{main:b[700],light:b[500],dark:b[900]}}(n),M=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:w[400],light:w[300],dark:w[700]}:{main:w[800],light:w[500],dark:w[900]}}(n),P=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[400],light:g[300],dark:g[700]}:{main:"#ed6c02",light:g[500],dark:g[900]}}(n);function N(e){return(0,d.mi)(e,k.text.primary)>=l?k.text.primary:x.text.primary}var Z=function(e){var t=e.color,n=e.name,o=e.mainShade,i=void 0===o?500:o,u=e.lightShade,l=void 0===u?300:u,s=e.darkShade,f=void 0===s?700:s;if(!(t=(0,r.Z)({},t)).main&&t[i]&&(t.main=t[i]),!t.hasOwnProperty("main"))throw new Error((0,a.Z)(11,n?" (".concat(n,")"):"",i));if("string"!==typeof t.main)throw new Error((0,a.Z)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return _(t,"light",l,c),_(t,"dark",f,c),t.contrastText||(t.contrastText=N(t.main)),t},D={dark:k,light:x};return(0,i.Z)((0,r.Z)({common:(0,r.Z)({},p),mode:n,primary:Z({color:E,name:"primary"}),secondary:Z({color:T,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:Z({color:C,name:"error"}),warning:Z({color:P,name:"warning"}),info:Z({color:O,name:"info"}),success:Z({color:M,name:"success"}),grey:h,contrastThreshold:l,getContrastText:N,augmentColor:Z,tonalOffset:c},D[n]),f)}var T=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];var C={textTransform:"uppercase"},O='"Roboto", "Helvetica", "Arial", sans-serif';function M(e,t){var n="function"===typeof t?t(e):t,a=n.fontFamily,u=void 0===a?O:a,l=n.fontSize,s=void 0===l?14:l,c=n.fontWeightLight,f=void 0===c?300:c,d=n.fontWeightRegular,p=void 0===d?400:d,h=n.fontWeightMedium,m=void 0===h?500:h,v=n.fontWeightBold,g=void 0===v?700:v,y=n.htmlFontSize,b=void 0===y?16:y,w=n.allVariants,S=n.pxToRem,x=(0,o.Z)(n,T);var k=s/14,_=S||function(e){return"".concat(e/b*k,"rem")},E=function(e,t,n,o,a){return(0,r.Z)({fontFamily:u,fontWeight:e,fontSize:_(t),lineHeight:n},u===O?{letterSpacing:"".concat((i=o/t,Math.round(1e5*i)/1e5),"em")}:{},a,w);var i},M={h1:E(f,96,1.167,-1.5),h2:E(f,60,1.2,-.5),h3:E(p,48,1.167,0),h4:E(p,34,1.235,.25),h5:E(p,24,1.334,0),h6:E(m,20,1.6,.15),subtitle1:E(p,16,1.75,.15),subtitle2:E(m,14,1.57,.1),body1:E(p,16,1.5,.15),body2:E(p,14,1.43,.15),button:E(m,14,1.75,.4,C),caption:E(p,12,1.66,.4),overline:E(p,12,2.66,1,C)};return(0,i.Z)((0,r.Z)({htmlFontSize:b,pxToRem:_,fontFamily:u,fontSize:s,fontWeightLight:f,fontWeightRegular:p,fontWeightMedium:m,fontWeightBold:g},M),x,{clone:!1})}var P=.2,N=.14,Z=.12;function D(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(P,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(N,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(Z,")")].join(",")}var R=["none",D(0,2,1,-1,0,1,1,0,0,1,3,0),D(0,3,1,-2,0,2,2,0,0,1,5,0),D(0,3,3,-2,0,3,4,0,0,1,8,0),D(0,2,4,-1,0,4,5,0,0,1,10,0),D(0,3,5,-1,0,5,8,0,0,1,14,0),D(0,3,5,-1,0,6,10,0,0,1,18,0),D(0,4,5,-2,0,7,10,1,0,2,16,1),D(0,5,5,-3,0,8,10,1,0,3,14,2),D(0,5,6,-3,0,9,12,1,0,3,16,2),D(0,6,6,-3,0,10,14,1,0,4,18,3),D(0,6,7,-4,0,11,15,1,0,4,20,3),D(0,7,8,-4,0,12,17,2,0,5,22,4),D(0,7,8,-4,0,13,19,2,0,5,24,4),D(0,7,9,-4,0,14,21,2,0,5,26,4),D(0,8,9,-5,0,15,22,2,0,6,28,5),D(0,8,10,-5,0,16,24,2,0,6,30,5),D(0,8,11,-5,0,17,26,2,0,6,32,5),D(0,9,11,-5,0,18,28,2,0,7,34,6),D(0,9,12,-6,0,19,29,2,0,7,36,6),D(0,10,13,-6,0,20,31,3,0,8,38,7),D(0,10,13,-6,0,21,33,3,0,8,40,7),D(0,10,14,-6,0,22,35,3,0,8,42,7),D(0,11,14,-7,0,23,36,3,0,9,44,8),D(0,11,15,-7,0,24,38,3,0,9,46,8)],A=["duration","easing","delay"],L={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},I={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function j(e){return"".concat(Math.round(e),"ms")}function U(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}function z(e){var t=(0,r.Z)({},L,e.easing),n=(0,r.Z)({},I,e.duration);return(0,r.Z)({getAutoHeightDuration:U,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.duration,i=void 0===a?n.standard:a,u=r.easing,l=void 0===u?t.easeInOut:u,s=r.delay,c=void 0===s?0:s;(0,o.Z)(r,A);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof i?i:j(i)," ").concat(l," ").concat("string"===typeof c?c:j(c))})).join(",")}},e,{easing:t,duration:n})}var F={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Y=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mixins,n=void 0===t?{}:t,c=e.palette,d=void 0===c?{}:c,p=e.transitions,h=void 0===p?{}:p,m=e.typography,v=void 0===m?{}:m,g=(0,o.Z)(e,Y);if(e.vars)throw new Error((0,a.Z)(18));var y=E(d),b=(0,u.Z)(e),w=(0,i.Z)(b,{mixins:f(b.breakpoints,n),palette:y,shadows:R.slice(),typography:M(y,v),transitions:z(h),zIndex:(0,r.Z)({},F)});w=(0,i.Z)(w,g);for(var S=arguments.length,x=new Array(S>1?S-1:0),k=1;k0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=void 0===t?x:t,l=e.rootShouldForwardProp,s=void 0===l?S:l,c=e.slotShouldForwardProp,f=void 0===c?S:c,d=function(e){var t=g(e.theme)?n:e.theme;return(0,p.Z)((0,i.Z)({},e,{theme:t}))};return d.__mui_systemSx=!0,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,u.Co)(e,(function(e){return e.filter((function(e){return!(null!=e&&e.__mui_systemSx)}))}));var l=t.name,c=t.slot,p=t.skipVariantsResolver,x=t.skipSx,k=t.overridesResolver,_=(0,a.Z)(t,h),E=void 0!==p?p:c&&"Root"!==c||!1,T=x||!1;var C=S;"Root"===c?C=s:c?C=f:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(C=void 0);var O=(0,u.ZP)(e,(0,i.Z)({shouldForwardProp:C,label:undefined},_)),M=function(e){for(var t=arguments.length,u=new Array(t>1?t-1:0),s=1;s0){var h=new Array(p).fill("");(f=[].concat((0,r.Z)(e),(0,r.Z)(h))).raw=[].concat((0,r.Z)(e.raw),(0,r.Z)(h))}else"function"===typeof e&&e.__emotion_real!==e&&(f=function(t){var r=t.theme,o=(0,a.Z)(t,v);return e((0,i.Z)({theme:g(r)?n:r},o))});return O.apply(void 0,[f].concat((0,r.Z)(c)))};return O.withConfig&&(M.withConfig=O.withConfig),M}}({defaultTheme:k.Z,rootShouldForwardProp:_}),T=E},29394:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(29023);var o=n(86728);function a(e){var t=e.props,n=e.name,a=e.defaultTheme,i=function(e){var t=e.theme,n=e.name,o=e.props;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,r.Z)(t.components[n].defaultProps,o):o}({theme:(0,o.Z)(a),name:n,props:t});return i}var i=n(72248);function u(e){return a({props:e.props,name:e.name,defaultTheme:i.Z})}},91615:function(e,t,n){"use strict";var r=n(50114);t.Z=r.Z},81171:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(87462),o=n(47313),a=n(63366),i=n(83061),u=n(21921),l=n(91615),s=n(29394),c=n(88564),f=n(77430),d=n(32298);function p(e){return(0,d.Z)("MuiSvgIcon",e)}(0,f.Z)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var h=n(46417),m=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],v=(0,c.ZP)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,"inherit"!==n.color&&t["color".concat((0,l.Z)(n.color))],t["fontSize".concat((0,l.Z)(n.fontSize))]]}})((function(e){var t,n,r,o,a,i,u,l,s,c,f,d,p,h,m,v,g,y=e.theme,b=e.ownerState;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:null==(t=y.transitions)||null==(n=t.create)?void 0:n.call(t,"fill",{duration:null==(r=y.transitions)||null==(o=r.duration)?void 0:o.shorter}),fontSize:{inherit:"inherit",small:(null==(a=y.typography)||null==(i=a.pxToRem)?void 0:i.call(a,20))||"1.25rem",medium:(null==(u=y.typography)||null==(l=u.pxToRem)?void 0:l.call(u,24))||"1.5rem",large:(null==(s=y.typography)||null==(c=s.pxToRem)?void 0:c.call(s,35))||"2.1875rem"}[b.fontSize],color:null!=(f=null==(d=(y.vars||y).palette)||null==(p=d[b.color])?void 0:p.main)?f:{action:null==(h=(y.vars||y).palette)||null==(m=h.action)?void 0:m.active,disabled:null==(v=(y.vars||y).palette)||null==(g=v.action)?void 0:g.disabled,inherit:void 0}[b.color]}})),g=o.forwardRef((function(e,t){var n=(0,s.Z)({props:e,name:"MuiSvgIcon"}),o=n.children,c=n.className,f=n.color,d=void 0===f?"inherit":f,g=n.component,y=void 0===g?"svg":g,b=n.fontSize,w=void 0===b?"medium":b,S=n.htmlColor,x=n.inheritViewBox,k=void 0!==x&&x,_=n.titleAccess,E=n.viewBox,T=void 0===E?"0 0 24 24":E,C=(0,a.Z)(n,m),O=(0,r.Z)({},n,{color:d,component:y,fontSize:w,instanceFontSize:e.fontSize,inheritViewBox:k,viewBox:T}),M={};k||(M.viewBox=T);var P=function(e){var t=e.color,n=e.fontSize,r=e.classes,o={root:["root","inherit"!==t&&"color".concat((0,l.Z)(t)),"fontSize".concat((0,l.Z)(n))]};return(0,u.Z)(o,p,r)}(O);return(0,h.jsxs)(v,(0,r.Z)({as:y,className:(0,i.Z)(P.root,c),focusable:"false",color:S,"aria-hidden":!_||void 0,role:_?"img":void 0,ref:t},M,C,{ownerState:O,children:[o,_?(0,h.jsx)("title",{children:_}):null]}))}));g.muiName="SvgIcon";var y=g;function b(e,t){function n(n,o){return(0,h.jsx)(y,(0,r.Z)({"data-testid":"".concat(t,"Icon"),ref:o},n,{children:e}))}return n.muiName=y.muiName,o.memo(o.forwardRef(n))}},53800:function(e,t,n){"use strict";var r=n(10782);t.Z=r.Z},73236:function(e,t,n){"use strict";var r=n(42780);t.Z=r.Z},86983:function(e,t,n){"use strict";var r=n(47472);t.Z=r.Z},47037:function(e,t,n){"use strict";var r=n(95669);t.Z=r.Z},15693:function(e,t,n){"use strict";var r=n(47313).createContext(null);t.Z=r},20201:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(47313),o=n(15693);function a(){return r.useContext(o.Z)}},20564:function(e,t,n){"use strict";n.d(t,{Co:function(){return a},ZP:function(){return o}});var r=n(41801);function o(e,t){return(0,r.Z)(e,t)}var a=function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}},54929:function(e,t,n){"use strict";n.d(t,{L7:function(){return u},P$:function(){return l},VO:function(){return r},W8:function(){return i},k9:function(){return a}});var r={xs:0,sm:600,md:900,lg:1200,xl:1536},o={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(r[e],"px)")}};function a(e,t,n){var a=e.theme||{};if(Array.isArray(t)){var i=a.breakpoints||o;return t.reduce((function(e,r,o){return e[i.up(i.keys[o])]=n(t[o]),e}),{})}if("object"===typeof t){var u=a.breakpoints||o;return Object.keys(t).reduce((function(e,o){if(-1!==Object.keys(u.values||r).indexOf(o)){e[u.up(o)]=n(t[o],o)}else{var a=o;e[a]=t[a]}return e}),{})}return n(t)}function i(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null==(e=t.keys)?void 0:e.reduce((function(e,n){return e[t.up(n)]={},e}),{}))||{}}function u(e,t){return e.reduce((function(e,t){var n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function l(e){var t,n=e.values,r=e.breakpoints,o=e.base||function(e,t){if("object"!==typeof e)return{};var n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((function(t,r){r1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function a(e){if(e.type)return e;if("#"===e.charAt(0))return a(function(e){e=e.slice(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error((0,r.Z)(9,e));var o,i=e.substring(t+1,e.length-1);if("color"===n){if(o=(i=i.split(" ")).shift(),4===i.length&&"/"===i[3].charAt(0)&&(i[3]=i[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o))throw new Error((0,r.Z)(10,o))}else i=i.split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)})),colorSpace:o}}function i(e){var t=e.type,n=e.colorSpace,r=e.values;return-1!==t.indexOf("rgb")?r=r.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),r=-1!==t.indexOf("color")?"".concat(n," ").concat(r.join(" ")):"".concat(r.join(", ")),"".concat(t,"(").concat(r,")")}function u(e){var t="hsl"===(e=a(e)).type||"hsla"===e.type?a(function(e){var t=(e=a(e)).values,n=t[0],r=t[1]/100,o=t[2]/100,u=r*Math.min(o,1-o),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return o-u*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",c=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(s+="a",c.push(t[3])),i({type:s,values:c})}(e)).values:e.values;return t=t.map((function(t){return"color"!==e.type&&(t/=255),t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function l(e,t){var n=u(e),r=u(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function s(e,t){return e=a(e),t=o(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,i(e)}function c(e,t){if(e=a(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return i(e)}function f(e,t){if(e=a(e),t=o(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(var r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return i(e)}},9456:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(87462),o=n(63366),a=n(13019),i=n(4942),u=["values","unit","step"],l=function(e){var t=Object.keys(e).map((function(t){return{key:t,val:e[t]}}))||[];return t.sort((function(e,t){return e.val-t.val})),t.reduce((function(e,t){return(0,r.Z)({},e,(0,i.Z)({},t.key,t.val))}),{})};var s={borderRadius:4},c=n(86886);var f=n(63649),d=n(63232),p=["breakpoints","palette","spacing","shape"];var h=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,i=e.palette,h=void 0===i?{}:i,m=e.spacing,v=e.shape,g=void 0===v?{}:v,y=(0,o.Z)(e,p),b=function(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,a=e.unit,i=void 0===a?"px":a,s=e.step,c=void 0===s?5:s,f=(0,o.Z)(e,u),d=l(n),p=Object.keys(d);function h(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function m(e){var t="number"===typeof n[e]?n[e]:e;return"@media (max-width:".concat(t-c/100).concat(i,")")}function v(e,t){var r=p.indexOf(t);return"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[p[r]]?n[p[r]]:t)-c/100).concat(i,")")}return(0,r.Z)({keys:p,values:d,up:h,down:m,between:v,only:function(e){return p.indexOf(e)+10&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=(0,c.hB)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r1?x-1:0),_=1;_2){if(!s[e])return[e];e=s[e]}var t=e.split(""),n=(0,r.Z)(t,2),o=n[0],a=n[1],i=u[o],c=l[a]||"";return Array.isArray(c)?c.map((function(e){return i+e})):[i+c]})),f=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],d=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],p=[].concat(f,d);function h(e,t,n,r){var o,i=null!=(o=(0,a.DW)(e,t,!1))?o:n;return"number"===typeof i?function(e){return"string"===typeof e?e:i*e}:Array.isArray(i)?function(e){return"string"===typeof e?e:i[e]}:"function"===typeof i?i:function(){}}function m(e){return h(e,"spacing",8)}function v(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}function g(e,t,n,r){if(-1===t.indexOf(n))return null;var a=function(e,t){return function(n){return e.reduce((function(e,r){return e[r]=v(t,n),e}),{})}}(c(n),r),i=e[n];return(0,o.k9)(e,i,a)}function y(e,t){var n=m(e.theme);return Object.keys(e).map((function(r){return g(e,t,r,n)})).reduce(i.Z,{})}function b(e){return y(e,f)}function w(e){return y(e,d)}function S(e){return y(e,p)}b.propTypes={},b.filterProps=f,w.propTypes={},w.filterProps=d,S.propTypes={},S.filterProps=p},46428:function(e,t,n){"use strict";n.d(t,{DW:function(){return i},Jq:function(){return u}});var r=n(4942),o=n(50114),a=n(54929);function i(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&n){var r="vars.".concat(t).split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e);if(null!=r)return r}return t.split(".").reduce((function(e,t){return e&&null!=e[t]?e[t]:null}),e)}function u(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"===typeof e?e(n):Array.isArray(e)?e[n]||o:i(e,n)||o,t&&(r=t(r,o,e)),r}t.ZP=function(e){var t=e.prop,n=e.cssProperty,l=void 0===n?e.prop:n,s=e.themeKey,c=e.transform,f=function(e){if(null==e[t])return null;var n=e[t],f=i(e.theme,s)||{};return(0,a.k9)(e,n,(function(e){var n=u(f,c,e);return e===n&&"string"===typeof e&&(n=u(f,c,"".concat(t).concat("default"===e?"":(0,o.Z)(e)),e)),!1===l?n:(0,r.Z)({},l,n)}))};return f.propTypes={},f.filterProps=[t],f}},63232:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var r=n(86886),o=n(46428),a=n(77330);var i=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:a;return(0,o.Z)(e)}},14976:function(e,t,n){"use strict";var r=n(20201);t.Z=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=(0,r.Z)();return n&&(e=n,0!==Object.keys(e).length)?n:t}},41271:function(e,t){"use strict";var n=function(e){return e},r=function(){var e=n;return{configure:function(t){e=t},generate:function(t){return e(t)},reset:function(){e=n}}}();t.Z=r},50114:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(77219);function o(e){if("string"!==typeof e)throw new Error((0,r.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},21921:function(e,t,n){"use strict";function r(e,t,n){var r={};return Object.keys(e).forEach((function(o){r[o]=e[o].reduce((function(e,r){return r&&(e.push(t(r)),n&&n[r]&&e.push(n[r])),e}),[]).join(" ")})),r}n.d(t,{Z:function(){return r}})},13019:function(e,t,n){"use strict";n.d(t,{P:function(){return o},Z:function(){return i}});var r=n(87462);function o(e){return null!==e&&"object"===typeof e&&e.constructor===Object}function a(e){if(!o(e))return e;var t={};return Object.keys(e).forEach((function(n){t[n]=a(e[n])})),t}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},u=n.clone?(0,r.Z)({},e):e;return o(e)&&o(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(o(t[r])&&r in e&&o(e[r])?u[r]=i(e[r],t[r],n):n.clone?u[r]=o(t[r])?a(t[r]):t[r]:u[r]=t[r])})),u}},77219:function(e,t,n){"use strict";function r(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n2&&void 0!==arguments[2]?arguments[2]:"Mui",a=o[t];return a?"".concat(n,"-").concat(a):"".concat(r.Z.generate(e),"-").concat(t)}},77430:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(32298);function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",o={};return t.forEach((function(t){o[t]=(0,r.Z)(e,t,n)})),o}},29023:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(87462);function o(e,t){var n=(0,r.Z)({},t);return Object.keys(e).forEach((function(a){if(a.toString().match(/^(components|slots)$/))n[a]=(0,r.Z)({},e[a],n[a]);else if(a.toString().match(/^(componentsProps|slotProps)$/)){var i=e[a]||{},u=t[a];n[a]={},u&&Object.keys(u)?i&&Object.keys(i)?(n[a]=(0,r.Z)({},u),Object.keys(i).forEach((function(e){n[a][e]=o(i[e],u[e])}))):n[a]=u:n[a]=i}else void 0===n[a]&&(n[a]=e[a])})),n}},89265:function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,{Z:function(){return r}})},10782:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(29439),o=n(47313);function a(e){var t=e.controlled,n=e.default,a=(e.name,e.state,o.useRef(void 0!==t).current),i=o.useState(n),u=(0,r.Z)(i,2),l=u[0],s=u[1];return[a?t:l,o.useCallback((function(e){a||s(e)}),[])]}},2678:function(e,t,n){"use strict";var r=n(47313),o="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;t.Z=o},42780:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(47313),o=n(2678);function a(e){var t=r.useRef(e);return(0,o.Z)((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},47472:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(47313),o=n(89265);function a(){for(var e=arguments.length,t=new Array(e),n=0;n=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function M(e,t,n,r){void 0===r&&(r={});var o=r,a=o.window,i=void 0===a?document.defaultView:a,u=o.v5Compat,l=void 0!==u&&u,s=i.history,c=g.Pop,f=null,d=p();function p(){return(s.state||{idx:null}).idx}function h(){c=g.Pop;var e=p(),t=null==e?null:e-d;d=e,f&&f({action:c,location:v.location,delta:t})}function m(e){var t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"===typeof e?e:C(e);return _(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==d&&(d=0,s.replaceState(w({},s.state,{idx:d}),""));var v={get action(){return c},get location(){return e(i,s)},listen:function(e){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(x,h),f=e,function(){i.removeEventListener(x,h),f=null}},createHref:function(e){return t(i,e)},createURL:m,encodeLocation:function(e){var t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){c=g.Push;var r=T(v.location,e,t);n&&n(r,e);var o=E(r,d=p()+1),a=v.createHref(r);try{s.pushState(o,"",a)}catch(u){i.location.assign(a)}l&&f&&f({action:c,location:v.location,delta:1})},replace:function(e,t){c=g.Replace;var r=T(v.location,e,t);n&&n(r,e);var o=E(r,d=p()),a=v.createHref(r);s.replaceState(o,"",a),l&&f&&f({action:c,location:v.location,delta:0})},go:function(e){return s.go(e)}};return v}function P(e,t,n){void 0===n&&(n="/");var r=B(("string"===typeof t?O(t):t).pathname||"/",n);if(null==r)return null;var o=N(e);!function(e){e.sort((function(e,t){return e.score!==t.score?t.score-e.score:function(e,t){var n=e.length===t.length&&e.slice(0,-1).every((function(e,n){return e===t[n]}));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((function(e){return e.childrenIndex})),t.routesMeta.map((function(e){return e.childrenIndex})))}))}(o);for(var a=null,i=0;null==a&&i0&&(_(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+u+'".'),N(e.children,t,l,u)),(null!=e.path||e.index)&&t.push({path:u,score:z(u,e.index),routesMeta:l})};return e.forEach((function(e,t){var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?")){var r,a=(0,y.Z)(Z(e.path));try{for(a.s();!(r=a.n()).done;){var i=r.value;o(e,t,i)}}catch(u){a.e(u)}finally{a.f()}}else o(e,t)})),t}function Z(e){var t=e.split("/");if(0===t.length)return[];var n,r=(n=t,(0,p.Z)(n)||(0,h.Z)(n)||(0,m.Z)(n)||(0,v.Z)()),o=r[0],a=r.slice(1),i=o.endsWith("?"),u=o.replace(/\?$/,"");if(0===a.length)return i?[u,""]:[u];var l=Z(a.join("/")),s=[];return s.push.apply(s,(0,b.Z)(l.map((function(e){return""===e?u:[u,e].join("/")})))),i&&s.push.apply(s,(0,b.Z)(l)),s.map((function(t){return e.startsWith("/")&&""===t?"/":t}))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(S||(S={}));var D=/^:\w+$/,R=3,A=2,L=1,I=10,j=-2,U=function(e){return"*"===e};function z(e,t){var n=e.split("/"),r=n.length;return n.some(U)&&(r+=j),t&&(r+=A),n.filter((function(e){return!U(e)})).reduce((function(e,t){return e+(D.test(t)?R:""===t?L:I)}),r)}function F(e,t){for(var n=e.routesMeta,r={},o="/",a=[],i=0;i and the router will parse it for you.'}function q(e){return e.filter((function(e,t){return 0===t||e.route.path&&e.route.path.length>0}))}function $(e,t,n,r){var o;void 0===r&&(r=!1),"string"===typeof e?o=O(e):(_(!(o=w({},e)).pathname||!o.pathname.includes("?"),V("?","pathname","search",o)),_(!o.pathname||!o.pathname.includes("#"),V("#","pathname","hash",o)),_(!o.search||!o.search.includes("#"),V("#","search","hash",o)));var a,i=""===e||""===o.pathname,u=i?"/":o.pathname;if(r||null==u)a=n;else{var l=t.length-1;if(u.startsWith("..")){for(var s=u.split("/");".."===s[0];)s.shift(),l-=1;o.pathname=s.join("/")}a=l>=0?t[l]:"/"}var c=function(e,t){void 0===t&&(t="/");var n="string"===typeof e?O(e):e,r=n.pathname,o=n.search,a=void 0===o?"":o,i=n.hash,u=void 0===i?"":i,l=r?r.startsWith("/")?r:function(e,t){var n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((function(e){".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(r,t):t;return{pathname:l,search:K(a),hash:X(u)}}(o,a),f=u&&"/"!==u&&u.endsWith("/"),d=(i||"."===u)&&n.endsWith("/");return c.pathname.endsWith("/")||!f&&!d||(c.pathname+="/"),c}var G=function(e){return e.join("/").replace(/\/\/+/g,"/")},Q=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},K=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},X=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},J=function(e){(0,a.Z)(n,e);var t=(0,i.Z)(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n)}(f(Error));function ee(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var te=["post","put","patch","delete"],ne=(new Set(te),["get"].concat(te));new Set(ne),new Set([301,302,303,307,308]),new Set([307,308]),"undefined"!==typeof window&&"undefined"!==typeof window.document&&window.document.createElement;Symbol("deferred")},31881:function(e,t,n){e.exports=n(46948)},47570:function(e,t,n){"use strict";var r=n(899),o=n(48980),a=n(22508),i=n(43917),u=n(96551),l=n(87652),s=n(48652),c=n(50775),f=n(84685),d=n(37691);e.exports=function(e){return new Promise((function(t,n){var p,h=e.data,m=e.headers,v=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(h)&&delete m["Content-Type"];var y=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(b+":"+w)}var S=u(e.baseURL,e.url);function x(){if(y){var r="getAllResponseHeaders"in y?l(y.getAllResponseHeaders()):null,a={data:v&&"text"!==v&&"json"!==v?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y};o((function(e){t(e),g()}),(function(e){n(e),g()}),a),y=null}}if(y.open(e.method.toUpperCase(),i(S,e.params,e.paramsSerializer),!0),y.timeout=e.timeout,"onloadend"in y?y.onloadend=x:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(x)},y.onabort=function(){y&&(n(c("Request aborted",e,"ECONNABORTED",y)),y=null)},y.onerror=function(){n(c("Network Error",e,null,y)),y=null},y.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},r.isStandardBrowserEnv()){var k=(e.withCredentials||s(S))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;k&&(m[e.xsrfHeaderName]=k)}"setRequestHeader"in y&&r.forEach(m,(function(e,t){"undefined"===typeof h&&"content-type"===t.toLowerCase()?delete m[t]:y.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),v&&"json"!==v&&(y.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&y.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){y&&(n(!e||e&&e.type?new d("canceled"):e),y.abort(),y=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),h||(h=null),y.send(h)}))}},46948:function(e,t,n){"use strict";var r=n(899),o=n(28813),a=n(55141),i=n(36276);var u=function e(t){var n=new a(t),u=o(a.prototype.request,n);return r.extend(u,a.prototype,n),r.extend(u,n),u.create=function(n){return e(i(t,n))},u}(n(84685));u.Axios=a,u.Cancel=n(37691),u.CancelToken=n(13914),u.isCancel=n(17797),u.VERSION=n(2102).version,u.all=function(e){return Promise.all(e)},u.spread=n(62922),u.isAxiosError=n(60534),e.exports=u,e.exports.default=u},37691:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},13914:function(e,t,n){"use strict";var r=n(37691);function o(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){l.headers[e]=r.merge(i)})),e.exports=l},2102:function(e){e.exports={version:"0.25.0"}},28813:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i}},62922:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},87828:function(e,t,n){"use strict";var r=n(2102).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var a={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,i){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!a[r]&&(a[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}},e.exports={assertOptions:function(e,t,n){if("object"!==typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var a=r[o],i=t[a];if(i){var u=e[a],l=void 0===u||i(u,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:o}},899:function(e,t,n){"use strict";var r=n(28813),o=Object.prototype.toString;function a(e){return Array.isArray(e)}function i(e){return"undefined"===typeof e}function u(e){return"[object ArrayBuffer]"===o.call(e)}function l(e){return null!==e&&"object"===typeof e}function s(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n1?"s":"")+" required, but only "+t.length+" present")}n.d(t,{Z:function(){return r}})},68627:function(e,t,n){"use strict";function r(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n.d(t,{Z:function(){return r}})},84485:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(68627),o=n(93601),a=n(34800);function i(e,t){(0,a.Z)(2,arguments);var n=(0,o.Z)(e).getTime(),i=(0,r.Z)(t);return new Date(n+i)}},56410:function(e,t,n){"use strict";n.d(t,{Z:function(){return ne}});var r=n(8859),o=n(84485),a=n(34800),i=n(68627);var u=n(93601),l=864e5;function s(e){(0,a.Z)(1,arguments);var t=(0,u.Z)(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function c(e){(0,a.Z)(1,arguments);var t=(0,u.Z)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=s(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var l=s(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=l.getTime()?n:n-1}var f=6048e5;function d(e){(0,a.Z)(1,arguments);var t=(0,u.Z)(e),n=s(t).getTime()-function(e){(0,a.Z)(1,arguments);var t=c(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),s(n)}(t).getTime();return Math.round(n/f)+1}var p=n(73149);function h(e,t){var n,r,o,l,s,c,f,d;(0,a.Z)(1,arguments);var h=(0,p.j)(),m=(0,i.Z)(null!==(n=null!==(r=null!==(o=null!==(l=null===t||void 0===t?void 0:t.weekStartsOn)&&void 0!==l?l:null===t||void 0===t||null===(s=t.locale)||void 0===s||null===(c=s.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==o?o:h.weekStartsOn)&&void 0!==r?r:null===(f=h.locale)||void 0===f||null===(d=f.options)||void 0===d?void 0:d.weekStartsOn)&&void 0!==n?n:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var v=(0,u.Z)(e),g=v.getUTCDay(),y=(g=1&&y<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(v+1,0,y),b.setUTCHours(0,0,0,0);var w=h(b,t),S=new Date(0);S.setUTCFullYear(v,0,y),S.setUTCHours(0,0,0,0);var x=h(S,t);return m.getTime()>=w.getTime()?v+1:m.getTime()>=x.getTime()?v:v-1}var v=6048e5;function g(e,t){(0,a.Z)(1,arguments);var n=(0,u.Z)(e),r=h(n,t).getTime()-function(e,t){var n,r,o,u,l,s,c,f;(0,a.Z)(1,arguments);var d=(0,p.j)(),v=(0,i.Z)(null!==(n=null!==(r=null!==(o=null!==(u=null===t||void 0===t?void 0:t.firstWeekContainsDate)&&void 0!==u?u:null===t||void 0===t||null===(l=t.locale)||void 0===l||null===(s=l.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:d.firstWeekContainsDate)&&void 0!==r?r:null===(c=d.locale)||void 0===c||null===(f=c.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==n?n:1),g=m(e,t),y=new Date(0);return y.setUTCFullYear(g,0,v),y.setUTCHours(0,0,0,0),h(y,t)}(n,t).getTime();return Math.round(r/v)+1}function y(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length0?n:1-n;return y("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):y(n+1,2)},d:function(e,t){return y(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return y(e.getUTCHours()%12||12,t.length)},H:function(e,t){return y(e.getUTCHours(),t.length)},m:function(e,t){return y(e.getUTCMinutes(),t.length)},s:function(e,t){return y(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return y(Math.floor(r*Math.pow(10,n-3)),t.length)}},w="midnight",S="noon",x="morning",k="afternoon",_="evening",E="night",T={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return b.y(e,t)},Y:function(e,t,n,r){var o=m(e,r),a=o>0?o:1-o;return"YY"===t?y(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):y(a,t.length)},R:function(e,t){return y(c(e),t.length)},u:function(e,t){return y(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return y(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return y(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return b.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return y(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=g(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):y(o,t.length)},I:function(e,t,n){var r=d(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):y(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):b.d(e,t)},D:function(e,t,n){var r=function(e){(0,a.Z)(1,arguments);var t=(0,u.Z)(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/l)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):y(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return y(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return y(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return y(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?S:0===o?w:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?_:o>=12?k:o>=4?x:E,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return b.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):b.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):y(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):y(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):b.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):b.s(e,t)},S:function(e,t){return b.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return O(o);case"XXXX":case"XX":return M(o);default:return M(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return O(o);case"xxxx":case"xx":return M(o);default:return M(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+C(o,":");default:return"GMT"+M(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+C(o,":");default:return"GMT"+M(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return y(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return y((r._originalDate||e).getTime(),t.length)}};function C(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;if(0===a)return n+String(o);var i=t||"";return n+String(o)+i+y(a,2)}function O(e,t){return e%60===0?(e>0?"-":"+")+y(Math.abs(e)/60,2):M(e,t)}function M(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+y(Math.floor(o/60),2)+n+y(o%60,2)}var P=T,N=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Z=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},D={p:Z,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],a=r[2];if(!a)return N(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",N(o,t)).replace("{{time}}",Z(a,t))}},R=D,A=n(5025),L=["D","DD"],I=["YY","YYYY"];function j(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var U={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},z=function(e,t,n){var r,o=U[e];return r="string"===typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!==n&&void 0!==n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function F(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Y={date:F({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:F({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:F({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},W={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},B=function(e,t,n,r){return W[e]};function H(e){return function(t,n){var r;if("formatting"===(null!==n&&void 0!==n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=null!==n&&void 0!==n&&n.width?String(n.width):o;r=e.formattingValues[a]||e.formattingValues[o]}else{var i=e.defaultWidth,u=null!==n&&void 0!==n&&n.width?String(n.width):e.defaultWidth;r=e.values[u]||e.values[i]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var V={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:H({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:H({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:H({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:H({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:H({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function q(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;var i,u=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=e.match($.matchPattern);if(!n)return null;var r=n[0],o=e.match($.parsePattern);if(!o)return null;var a=$.valueCallback?$.valueCallback(o[0]):o[0];return{value:a=t.valueCallback?t.valueCallback(a):a,rest:e.slice(r.length)}}),era:q({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:q({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:q({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:q({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:q({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},Q={code:"en-US",formatDistance:z,formatLong:Y,formatRelative:B,localize:V,match:G,options:{weekStartsOn:0,firstWeekContainsDate:1}},K=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,X=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,J=/^'([^]*?)'?$/,ee=/''/g,te=/[a-zA-Z]/;function ne(e,t,n){var l,s,c,f,d,h,m,v,g,y,b,w,S,x,k,_,E,T;(0,a.Z)(2,arguments);var C=String(t),O=(0,p.j)(),M=null!==(l=null!==(s=null===n||void 0===n?void 0:n.locale)&&void 0!==s?s:O.locale)&&void 0!==l?l:Q,N=(0,i.Z)(null!==(c=null!==(f=null!==(d=null!==(h=null===n||void 0===n?void 0:n.firstWeekContainsDate)&&void 0!==h?h:null===n||void 0===n||null===(m=n.locale)||void 0===m||null===(v=m.options)||void 0===v?void 0:v.firstWeekContainsDate)&&void 0!==d?d:O.firstWeekContainsDate)&&void 0!==f?f:null===(g=O.locale)||void 0===g||null===(y=g.options)||void 0===y?void 0:y.firstWeekContainsDate)&&void 0!==c?c:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Z=(0,i.Z)(null!==(b=null!==(w=null!==(S=null!==(x=null===n||void 0===n?void 0:n.weekStartsOn)&&void 0!==x?x:null===n||void 0===n||null===(k=n.locale)||void 0===k||null===(_=k.options)||void 0===_?void 0:_.weekStartsOn)&&void 0!==S?S:O.weekStartsOn)&&void 0!==w?w:null===(E=O.locale)||void 0===E||null===(T=E.options)||void 0===T?void 0:T.weekStartsOn)&&void 0!==b?b:0);if(!(Z>=0&&Z<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!M.localize)throw new RangeError("locale must contain localize property");if(!M.formatLong)throw new RangeError("locale must contain formatLong property");var D=(0,u.Z)(e);if(!(0,r.Z)(D))throw new RangeError("Invalid time value");var U=function(e,t){(0,a.Z)(2,arguments);var n=(0,i.Z)(t);return(0,o.Z)(e,-n)}(D,(0,A.Z)(D)),z={firstWeekContainsDate:N,weekStartsOn:Z,locale:M,_originalDate:D};return C.match(X).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,R[t])(e,M.formatLong):e})).join("").match(K).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(J);if(!t)return e;return t[1].replace(ee,"'")}(r);var a,i=P[o];if(i)return null!==n&&void 0!==n&&n.useAdditionalWeekYearTokens||(a=r,-1===I.indexOf(a))||j(r,t,String(e)),null!==n&&void 0!==n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==L.indexOf(e)}(r)||j(r,t,String(e)),i(U,r,M.localize,z);if(o.match(te))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}},403:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(34800);function o(e){return o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){return(0,r.Z)(1,arguments),e instanceof Date||"object"===o(e)&&"[object Date]"===Object.prototype.toString.call(e)}},8859:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(403),o=n(93601),a=n(34800);function i(e){if((0,a.Z)(1,arguments),!(0,r.Z)(e)&&"number"!==typeof e)return!1;var t=(0,o.Z)(e);return!isNaN(Number(t))}},93601:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(34800);function o(e){return o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e){(0,r.Z)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===o(e)&&"[object Date]"===t?new Date(e.getTime()):"number"===typeof e||"[object Number]"===t?new Date(e):("string"!==typeof e&&"[object String]"!==t||"undefined"===typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}},313:function(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,o,a){return r=n()?Reflect.construct:function(e,n,r){var o=[null];o.push.apply(o,n);var a=new(Function.bind.apply(e,o));return r&&t(a,r.prototype),a},r.apply(null,arguments)}function o(e,t){return u(e)||s(e,t)||c(e,t)||p()}function a(e){return i(e)||l(e)||c(e)||d()}function i(e){if(Array.isArray(e))return f(e)}function u(e){if(Array.isArray(e))return e}function l(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function s(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,u=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==n.return||n.return()}finally{if(u)throw o}}return a}}function c(e,t){if(e){if("string"===typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(u)throw a}}}}var m=Object.entries,v=Object.setPrototypeOf,g=Object.isFrozen,y=Object.getPrototypeOf,b=Object.getOwnPropertyDescriptor,w=Object.freeze,S=Object.seal,x=Object.create,k="undefined"!==typeof Reflect&&Reflect,_=k.apply,E=k.construct;_||(_=function(e,t,n){return e.apply(t,n)}),w||(w=function(e){return e}),S||(S=function(e){return e}),E||(E=function(e,t){return r(e,a(t))});var T=I(Array.prototype.forEach),C=I(Array.prototype.pop),O=I(Array.prototype.push),M=I(String.prototype.toLowerCase),P=I(String.prototype.toString),N=I(String.prototype.match),Z=I(String.prototype.replace),D=I(String.prototype.indexOf),R=I(String.prototype.trim),A=I(RegExp.prototype.test),L=j(TypeError);function I(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o/gm),te=S(/\${[\w\W]*}/gm),ne=S(/^data-[\-\w.\u00B7-\uFFFF]/),re=S(/^aria-[\-\w]+$/),oe=S(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ae=S(/^(?:\w+script|data):/i),ie=S(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ue=S(/^html$/i),le=function(){return"undefined"===typeof window?null:window},se=function(t,n){if("object"!==e(t)||"function"!==typeof t.createPolicy)return null;var r=null,o="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(o)&&(r=n.currentScript.getAttribute(o));var a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(i){return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function ce(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:le(),n=function(e){return ce(e)};if(n.version="3.0.1",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,u=t.HTMLTemplateElement,l=t.Node,s=t.Element,c=t.NodeFilter,f=t.NamedNodeMap,d=void 0===f?t.NamedNodeMap||t.MozNamedAttrMap:f,p=t.HTMLFormElement,h=t.DOMParser,v=t.trustedTypes,g=s.prototype,y=F(g,"cloneNode"),b=F(g,"nextSibling"),S=F(g,"childNodes"),x=F(g,"parentNode");if("function"===typeof u){var k=o.createElement("template");k.content&&k.content.ownerDocument&&(o=k.content.ownerDocument)}var _=se(v,r),E=_?_.createHTML(""):"",I=o,j=I.implementation,fe=I.createNodeIterator,de=I.createDocumentFragment,pe=I.getElementsByTagName,he=r.importNode,me={};n.isSupported="function"===typeof m&&"function"===typeof x&&j&&"undefined"!==typeof j.createHTMLDocument;var ve,ge,ye=J,be=ee,we=te,Se=ne,xe=re,ke=ae,_e=ie,Ee=oe,Te=null,Ce=U({},[].concat(a(Y),a(W),a(B),a(V),a($))),Oe=null,Me=U({},[].concat(a(G),a(Q),a(K),a(X))),Pe=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ne=null,Ze=null,De=!0,Re=!0,Ae=!1,Le=!0,Ie=!1,je=!1,Ue=!1,ze=!1,Fe=!1,Ye=!1,We=!1,Be=!0,He=!1,Ve="user-content-",qe=!0,$e=!1,Ge={},Qe=null,Ke=U({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Xe=null,Je=U({},["audio","video","img","source","image","track"]),et=null,tt=U({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml",at=ot,it=!1,ut=null,lt=U({},[nt,rt,ot],P),st=["application/xhtml+xml","text/html"],ct="text/html",ft=null,dt=o.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},ht=function(t){ft&&ft===t||(t&&"object"===e(t)||(t={}),t=z(t),ve=ve=-1===st.indexOf(t.PARSER_MEDIA_TYPE)?ct:t.PARSER_MEDIA_TYPE,ge="application/xhtml+xml"===ve?P:M,Te="ALLOWED_TAGS"in t?U({},t.ALLOWED_TAGS,ge):Ce,Oe="ALLOWED_ATTR"in t?U({},t.ALLOWED_ATTR,ge):Me,ut="ALLOWED_NAMESPACES"in t?U({},t.ALLOWED_NAMESPACES,P):lt,et="ADD_URI_SAFE_ATTR"in t?U(z(tt),t.ADD_URI_SAFE_ATTR,ge):tt,Xe="ADD_DATA_URI_TAGS"in t?U(z(Je),t.ADD_DATA_URI_TAGS,ge):Je,Qe="FORBID_CONTENTS"in t?U({},t.FORBID_CONTENTS,ge):Ke,Ne="FORBID_TAGS"in t?U({},t.FORBID_TAGS,ge):{},Ze="FORBID_ATTR"in t?U({},t.FORBID_ATTR,ge):{},Ge="USE_PROFILES"in t&&t.USE_PROFILES,De=!1!==t.ALLOW_ARIA_ATTR,Re=!1!==t.ALLOW_DATA_ATTR,Ae=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Le=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Ie=t.SAFE_FOR_TEMPLATES||!1,je=t.WHOLE_DOCUMENT||!1,Fe=t.RETURN_DOM||!1,Ye=t.RETURN_DOM_FRAGMENT||!1,We=t.RETURN_TRUSTED_TYPE||!1,ze=t.FORCE_BODY||!1,Be=!1!==t.SANITIZE_DOM,He=t.SANITIZE_NAMED_PROPS||!1,qe=!1!==t.KEEP_CONTENT,$e=t.IN_PLACE||!1,Ee=t.ALLOWED_URI_REGEXP||Ee,at=t.NAMESPACE||ot,Pe=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Pe.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Pe.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Pe.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(Re=!1),Ye&&(Fe=!0),Ge&&(Te=U({},a($)),Oe=[],!0===Ge.html&&(U(Te,Y),U(Oe,G)),!0===Ge.svg&&(U(Te,W),U(Oe,Q),U(Oe,X)),!0===Ge.svgFilters&&(U(Te,B),U(Oe,Q),U(Oe,X)),!0===Ge.mathMl&&(U(Te,V),U(Oe,K),U(Oe,X))),t.ADD_TAGS&&(Te===Ce&&(Te=z(Te)),U(Te,t.ADD_TAGS,ge)),t.ADD_ATTR&&(Oe===Me&&(Oe=z(Oe)),U(Oe,t.ADD_ATTR,ge)),t.ADD_URI_SAFE_ATTR&&U(et,t.ADD_URI_SAFE_ATTR,ge),t.FORBID_CONTENTS&&(Qe===Ke&&(Qe=z(Qe)),U(Qe,t.FORBID_CONTENTS,ge)),qe&&(Te["#text"]=!0),je&&U(Te,["html","head","body"]),Te.table&&(U(Te,["tbody"]),delete Ne.tbody),w&&w(t),ft=t)},mt=U({},["mi","mo","mn","ms","mtext"]),vt=U({},["foreignobject","desc","title","annotation-xml"]),gt=U({},["title","style","font","a","script"]),yt=U({},W);U(yt,B),U(yt,H);var bt=U({},V);U(bt,q);var wt=function(e){var t=x(e);t&&t.tagName||(t={namespaceURI:at,tagName:"template"});var n=M(e.tagName),r=M(t.tagName);return!!ut[e.namespaceURI]&&(e.namespaceURI===rt?t.namespaceURI===ot?"svg"===n:t.namespaceURI===nt?"svg"===n&&("annotation-xml"===r||mt[r]):Boolean(yt[n]):e.namespaceURI===nt?t.namespaceURI===ot?"math"===n:t.namespaceURI===rt?"math"===n&&vt[r]:Boolean(bt[n]):e.namespaceURI===ot?!(t.namespaceURI===rt&&!vt[r])&&!(t.namespaceURI===nt&&!mt[r])&&!bt[n]&&(gt[n]||!yt[n]):!("application/xhtml+xml"!==ve||!ut[e.namespaceURI]))},St=function(e){O(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},xt=function(e,t){try{O(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(r){O(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Oe[e])if(Fe||Ye)try{St(t)}catch(r){}else try{t.setAttribute(e,"")}catch(r){}},kt=function(e){var t,n;if(ze)e=""+e;else{var r=N(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ve&&at===ot&&(e=''+e+"");var a=_?_.createHTML(e):e;if(at===ot)try{t=(new h).parseFromString(a,ve)}catch(u){}if(!t||!t.documentElement){t=j.createDocument(at,"template",null);try{t.documentElement.innerHTML=it?E:a}catch(u){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),at===ot?pe.call(t,je?"html":"body")[0]:je?t.documentElement:i},_t=function(e){return fe.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Et=function(e){return e instanceof p&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof d)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore||"function"!==typeof e.hasChildNodes)},Tt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"===typeof t.nodeType&&"string"===typeof t.nodeName},Ct=function(e,t,r){me[e]&&T(me[e],(function(e){e.call(n,t,r,ft)}))},Ot=function(e){var t;if(Ct("beforeSanitizeElements",e,null),Et(e))return St(e),!0;var r=ge(e.nodeName);if(Ct("uponSanitizeElement",e,{tagName:r,allowedTags:Te}),e.hasChildNodes()&&!Tt(e.firstElementChild)&&(!Tt(e.content)||!Tt(e.content.firstElementChild))&&A(/<[/\w]/g,e.innerHTML)&&A(/<[/\w]/g,e.textContent))return St(e),!0;if(!Te[r]||Ne[r]){if(!Ne[r]&&Pt(r)){if(Pe.tagNameCheck instanceof RegExp&&A(Pe.tagNameCheck,r))return!1;if(Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(r))return!1}if(qe&&!Qe[r]){var o=x(e)||e.parentNode,a=S(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(y(a[i],!0),b(e))}return St(e),!0}return e instanceof s&&!wt(e)?(St(e),!0):"noscript"!==r&&"noembed"!==r||!A(/<\/no(script|embed)/i,e.innerHTML)?(Ie&&3===e.nodeType&&(t=e.textContent,t=Z(t,ye," "),t=Z(t,be," "),t=Z(t,we," "),e.textContent!==t&&(O(n.removed,{element:e.cloneNode()}),e.textContent=t)),Ct("afterSanitizeElements",e,null),!1):(St(e),!0)},Mt=function(e,t,n){if(Be&&("id"===t||"name"===t)&&(n in o||n in dt))return!1;if(Re&&!Ze[t]&&A(Se,t));else if(De&&A(xe,t));else if(!Oe[t]||Ze[t]){if(!(Pt(e)&&(Pe.tagNameCheck instanceof RegExp&&A(Pe.tagNameCheck,e)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(e))&&(Pe.attributeNameCheck instanceof RegExp&&A(Pe.attributeNameCheck,t)||Pe.attributeNameCheck instanceof Function&&Pe.attributeNameCheck(t))||"is"===t&&Pe.allowCustomizedBuiltInElements&&(Pe.tagNameCheck instanceof RegExp&&A(Pe.tagNameCheck,n)||Pe.tagNameCheck instanceof Function&&Pe.tagNameCheck(n))))return!1}else if(et[t]);else if(A(Ee,Z(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==D(n,"data:")||!Xe[e])if(Ae&&!A(ke,Z(n,_e,"")));else if(n)return!1;return!0},Pt=function(e){return e.indexOf("-")>0},Nt=function(t){var r,o,a,i;Ct("beforeSanitizeAttributes",t,null);var u=t.attributes;if(u){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe};for(i=u.length;i--;){var s=r=u[i],c=s.name,f=s.namespaceURI;if(o="value"===c?r.value:R(r.value),a=ge(c),l.attrName=a,l.attrValue=o,l.keepAttr=!0,l.forceKeepAttr=void 0,Ct("uponSanitizeAttribute",t,l),o=l.attrValue,!l.forceKeepAttr&&(xt(c,t),l.keepAttr))if(Le||!A(/\/>/i,o)){Ie&&(o=Z(o,ye," "),o=Z(o,be," "),o=Z(o,we," "));var d=ge(t.nodeName);if(Mt(d,a,o)){if(!He||"id"!==a&&"name"!==a||(xt(c,t),o=Ve+o),_&&"object"===e(v)&&"function"===typeof v.getAttributeType)if(f);else switch(v.getAttributeType(d,a)){case"TrustedHTML":o=_.createHTML(o);break;case"TrustedScriptURL":o=_.createScriptURL(o)}try{f?t.setAttributeNS(f,c,o):t.setAttribute(c,o),C(n.removed)}catch(p){}}}else xt(c,t)}Ct("afterSanitizeAttributes",t,null)}},Zt=function e(t){var n,r=_t(t);for(Ct("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Ct("uponSanitizeShadowNode",n,null),Ot(n)||(n.content instanceof i&&e(n.content),Nt(n));Ct("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){var t,o,a,u,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((it=!e)&&(e="\x3c!--\x3e"),"string"!==typeof e&&!Tt(e)){if("function"!==typeof e.toString)throw L("toString is not a function");if("string"!==typeof(e=e.toString()))throw L("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Ue||ht(s),n.removed=[],"string"===typeof e&&($e=!1),$e){if(e.nodeName){var c=ge(e.nodeName);if(!Te[c]||Ne[c])throw L("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)1===(o=(t=kt("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?t=o:t.appendChild(o);else{if(!Fe&&!Ie&&!je&&-1===e.indexOf("<"))return _&&We?_.createHTML(e):e;if(!(t=kt(e)))return Fe?null:We?E:""}t&&ze&&St(t.firstChild);for(var f=_t($e?e:t);a=f.nextNode();)Ot(a)||(a.content instanceof i&&Zt(a.content),Nt(a));if($e)return e;if(Fe){if(Ye)for(u=de.call(t.ownerDocument);t.firstChild;)u.appendChild(t.firstChild);else u=t;return(Oe.shadowroot||Oe.shadowrootmod)&&(u=he.call(r,u,!0)),u}var d=je?t.outerHTML:t.innerHTML;return je&&Te["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&A(ue,t.ownerDocument.doctype.name)&&(d="\n"+d),Ie&&(d=Z(d,ye," "),d=Z(d,be," "),d=Z(d,we," ")),_&&We?_.createHTML(d):d},n.setConfig=function(e){ht(e),Ue=!0},n.clearConfig=function(){ft=null,Ue=!1},n.isValidAttribute=function(e,t,n){ft||ht({});var r=ge(e),o=ge(t);return Mt(r,o,n)},n.addHook=function(e,t){"function"===typeof t&&(me[e]=me[e]||[],O(me[e],t))},n.removeHook=function(e){if(me[e])return C(me[e])},n.removeHooks=function(e){me[e]&&(me[e]=[])},n.removeAllHooks=function(){me={}},n}return ce()}()},67861:function(e,t,n){"use strict";var r=n(89456),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function l(e){return r.isMemo(e)?i:u[e.$$typeof]||o}u[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[r.Memo]=i;var s=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var i=c(n);f&&(i=i.concat(f(n)));for(var u=l(t),m=l(n),v=0;v>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,I=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,j={},U={};function z(e,t,n,r){var o=r;"string"===typeof r&&(o=function(){return this[r]()}),e&&(U[e]=o),t&&(U[t[0]]=function(){return A(o.apply(this,arguments),t[1],t[2])}),n&&(U[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function F(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Y(e){var t,n,r=e.match(L);for(t=0,n=r.length;t=0&&I.test(e);)e=e.replace(I,r),I.lastIndex=0,n-=1;return e}var H={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function V(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(L).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var q="Invalid date";function $(){return this._invalidDate}var G="%d",Q=/\d{1,2}/;function K(e){return this._ordinal.replace("%d",e)}var X={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function J(e,t,n,r){var o=this._relativeTime[n];return M(o)?o(e,t,n,r):o.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return M(n)?n(t):n.replace(/%s/i,t)}var te={};function ne(e,t){var n=e.toLowerCase();te[n]=te[n+"s"]=te[t]=e}function re(e){return"string"===typeof e?te[e]||te[e.toLowerCase()]:void 0}function oe(e){var t,n,r={};for(n in e)u(e,n)&&(t=re(n))&&(r[t]=e[n]);return r}var ae={};function ie(e,t){ae[e]=t}function ue(e){var t,n=[];for(t in e)u(e,t)&&n.push({unit:t,priority:ae[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}function le(e){return e%4===0&&e%100!==0||e%400===0}function se(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ce(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=se(t)),n}function fe(e,t){return function(n){return null!=n?(pe(this,e,n),r.updateOffset(this,t),this):de(this,e)}}function de(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function pe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&le(e.year())&&1===e.month()&&29===e.date()?(n=ce(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Je(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function he(e){return M(this[e=re(e)])?this[e]():this}function me(e,t){if("object"===typeof e){var n,r=ue(e=oe(e)),o=r.length;for(n=0;n68?1900:2e3)};var vt=fe("FullYear",!0);function gt(){return le(this.year())}function yt(e,t,n,r,o,a,i){var u;return e<100&&e>=0?(u=new Date(e+400,t,n,r,o,a,i),isFinite(u.getFullYear())&&u.setFullYear(e)):u=new Date(e,t,n,r,o,a,i),u}function bt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,n){var r=7+t-n;return-(7+bt(e,0,r).getUTCDay()-t)%7+r-1}function St(e,t,n,r,o){var a,i,u=1+7*(t-1)+(7+n-r)%7+wt(e,r,o);return u<=0?i=mt(a=e-1)+u:u>mt(e)?(a=e+1,i=u-mt(e)):(a=e,i=u),{year:a,dayOfYear:i}}function xt(e,t,n){var r,o,a=wt(e.year(),t,n),i=Math.floor((e.dayOfYear()-a-1)/7)+1;return i<1?r=i+kt(o=e.year()-1,t,n):i>kt(e.year(),t,n)?(r=i-kt(e.year(),t,n),o=e.year()+1):(o=e.year(),r=i),{week:r,year:o}}function kt(e,t,n){var r=wt(e,t,n),o=wt(e+1,t,n);return(mt(e)-r+o)/7}function _t(e){return xt(e,this._week.dow,this._week.doy).week}z("w",["ww",2],"wo","week"),z("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),ie("week",5),ie("isoWeek",5),Re("w",xe),Re("ww",xe,ye),Re("W",xe),Re("WW",xe,ye),ze(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=ce(e)}));var Et={dow:0,doy:6};function Tt(){return this._week.dow}function Ct(){return this._week.doy}function Ot(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Mt(e){var t=xt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Pt(e,t){return"string"!==typeof e?e:isNaN(e)?"number"===typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Nt(e,t){return"string"===typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Zt(e,t){return e.slice(t,7).concat(e.slice(0,t))}z("d",0,"do","day"),z("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),z("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),z("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),z("e",0,0,"weekday"),z("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),ie("day",11),ie("weekday",11),ie("isoWeekday",11),Re("d",xe),Re("e",xe),Re("E",xe),Re("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Re("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Re("dddd",(function(e,t){return t.weekdaysRegex(e)})),ze(["dd","ddd","dddd"],(function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);null!=o?t.d=o:v(n).invalidWeekday=e})),ze(["d","e","E"],(function(e,t,n,r){t[r]=ce(e)}));var Dt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Rt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),At="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Lt=De,It=De,jt=De;function Ut(e,t){var n=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Zt(n,this._week.dow):e?n[e.day()]:n}function zt(e){return!0===e?Zt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Ft(e){return!0===e?Zt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Yt(e,t,n){var r,o,a,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=h([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(o=Ye.call(this._weekdaysParse,i))?o:null:"ddd"===t?-1!==(o=Ye.call(this._shortWeekdaysParse,i))?o:null:-1!==(o=Ye.call(this._minWeekdaysParse,i))?o:null:"dddd"===t?-1!==(o=Ye.call(this._weekdaysParse,i))||-1!==(o=Ye.call(this._shortWeekdaysParse,i))||-1!==(o=Ye.call(this._minWeekdaysParse,i))?o:null:"ddd"===t?-1!==(o=Ye.call(this._shortWeekdaysParse,i))||-1!==(o=Ye.call(this._weekdaysParse,i))||-1!==(o=Ye.call(this._minWeekdaysParse,i))?o:null:-1!==(o=Ye.call(this._minWeekdaysParse,i))||-1!==(o=Ye.call(this._weekdaysParse,i))||-1!==(o=Ye.call(this._shortWeekdaysParse,i))?o:null}function Wt(e,t,n){var r,o,a;if(this._weekdaysParseExact)return Yt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=h([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function Bt(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Pt(e,this.localeData()),this.add(e-t,"d")):t}function Ht(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Vt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Nt(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function qt(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Lt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function $t(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=It),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Gt(e){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Qt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=jt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qt(){function e(e,t){return t.length-e.length}var t,n,r,o,a,i=[],u=[],l=[],s=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),r=Ie(this.weekdaysMin(n,"")),o=Ie(this.weekdaysShort(n,"")),a=Ie(this.weekdays(n,"")),i.push(r),u.push(o),l.push(a),s.push(r),s.push(o),s.push(a);i.sort(e),u.sort(e),l.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Kt(){return this.hours()%12||12}function Xt(){return this.hours()||24}function Jt(e,t){z(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function en(e,t){return t._meridiemParse}function tn(e){return"p"===(e+"").toLowerCase().charAt(0)}z("H",["HH",2],0,"hour"),z("h",["hh",2],0,Kt),z("k",["kk",2],0,Xt),z("hmm",0,0,(function(){return""+Kt.apply(this)+A(this.minutes(),2)})),z("hmmss",0,0,(function(){return""+Kt.apply(this)+A(this.minutes(),2)+A(this.seconds(),2)})),z("Hmm",0,0,(function(){return""+this.hours()+A(this.minutes(),2)})),z("Hmmss",0,0,(function(){return""+this.hours()+A(this.minutes(),2)+A(this.seconds(),2)})),Jt("a",!0),Jt("A",!1),ne("hour","h"),ie("hour",13),Re("a",en),Re("A",en),Re("H",xe),Re("h",xe),Re("k",xe),Re("HH",xe,ye),Re("hh",xe,ye),Re("kk",xe,ye),Re("hmm",ke),Re("hmmss",_e),Re("Hmm",ke),Re("Hmmss",_e),Ue(["H","HH"],Ve),Ue(["k","kk"],(function(e,t,n){var r=ce(e);t[Ve]=24===r?0:r})),Ue(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),Ue(["h","hh"],(function(e,t,n){t[Ve]=ce(e),v(n).bigHour=!0})),Ue("hmm",(function(e,t,n){var r=e.length-2;t[Ve]=ce(e.substr(0,r)),t[qe]=ce(e.substr(r)),v(n).bigHour=!0})),Ue("hmmss",(function(e,t,n){var r=e.length-4,o=e.length-2;t[Ve]=ce(e.substr(0,r)),t[qe]=ce(e.substr(r,2)),t[$e]=ce(e.substr(o)),v(n).bigHour=!0})),Ue("Hmm",(function(e,t,n){var r=e.length-2;t[Ve]=ce(e.substr(0,r)),t[qe]=ce(e.substr(r))})),Ue("Hmmss",(function(e,t,n){var r=e.length-4,o=e.length-2;t[Ve]=ce(e.substr(0,r)),t[qe]=ce(e.substr(r,2)),t[$e]=ce(e.substr(o))}));var nn=/[ap]\.?m?\.?/i,rn=fe("Hours",!0);function on(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var an,un={calendar:D,longDateFormat:H,invalidDate:q,ordinal:G,dayOfMonthOrdinalParse:Q,relativeTime:X,months:et,monthsShort:tt,week:Et,weekdays:Dt,weekdaysMin:At,weekdaysShort:Rt,meridiemParse:nn},ln={},sn={};function cn(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=hn(o.slice(0,t).join("-")))return r;if(n&&n.length>=t&&cn(o,n)>=t-1)break;t--}a++}return an}function pn(e){return null!=e.match("^[^/\\\\]*$")}function hn(t){var n=null;if(void 0===ln[t]&&e&&e.exports&&pn(t))try{n=an._abbr,Object(function(){var e=new Error("Cannot find module 'undefined'");throw e.code="MODULE_NOT_FOUND",e}()),mn(n)}catch(r){ln[t]=null}return ln[t]}function mn(e,t){var n;return e&&((n=s(t)?yn(e):vn(e,t))?an=n:"undefined"!==typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),an._abbr}function vn(e,t){if(null!==t){var n,r=un;if(t.abbr=e,null!=ln[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ln[e]._config;else if(null!=t.parentLocale)if(null!=ln[t.parentLocale])r=ln[t.parentLocale]._config;else{if(null==(n=hn(t.parentLocale)))return sn[t.parentLocale]||(sn[t.parentLocale]=[]),sn[t.parentLocale].push({name:e,config:t}),null;r=n._config}return ln[e]=new Z(N(r,t)),sn[e]&&sn[e].forEach((function(e){vn(e.name,e.config)})),mn(e),ln[e]}return delete ln[e],null}function gn(e,t){if(null!=t){var n,r,o=un;null!=ln[e]&&null!=ln[e].parentLocale?ln[e].set(N(ln[e]._config,t)):(null!=(r=hn(e))&&(o=r._config),t=N(o,t),null==r&&(t.abbr=e),(n=new Z(t)).parentLocale=ln[e],ln[e]=n),mn(e)}else null!=ln[e]&&(null!=ln[e].parentLocale?(ln[e]=ln[e].parentLocale,e===mn()&&mn(e)):null!=ln[e]&&delete ln[e]);return ln[e]}function yn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return an;if(!a(e)){if(t=hn(e))return t;e=[e]}return dn(e)}function bn(){return T(ln)}function wn(e){var t,n=e._a;return n&&-2===v(e).overflow&&(t=n[Be]<0||n[Be]>11?Be:n[He]<1||n[He]>Je(n[We],n[Be])?He:n[Ve]<0||n[Ve]>24||24===n[Ve]&&(0!==n[qe]||0!==n[$e]||0!==n[Ge])?Ve:n[qe]<0||n[qe]>59?qe:n[$e]<0||n[$e]>59?$e:n[Ge]<0||n[Ge]>999?Ge:-1,v(e)._overflowDayOfYear&&(tHe)&&(t=He),v(e)._overflowWeeks&&-1===t&&(t=Qe),v(e)._overflowWeekday&&-1===t&&(t=Ke),v(e).overflow=t),e}var Sn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,xn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kn=/Z|[+-]\d\d(?::?\d\d)?/,_n=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],En=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Tn=/^\/?Date\((-?\d+)/i,Cn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,On={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Mn(e){var t,n,r,o,a,i,u=e._i,l=Sn.exec(u)||xn.exec(u),s=_n.length,c=En.length;if(l){for(v(e).iso=!0,t=0,n=s;tmt(a)||0===e._dayOfYear)&&(v(e)._overflowDayOfYear=!0),n=bt(a,0,e._dayOfYear),e._a[Be]=n.getUTCMonth(),e._a[He]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=i[t]=r[t];for(;t<7;t++)e._a[t]=i[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Ve]&&0===e._a[qe]&&0===e._a[$e]&&0===e._a[Ge]&&(e._nextDay=!0,e._a[Ve]=0),e._d=(e._useUTC?bt:yt).apply(null,i),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ve]=24),e._w&&"undefined"!==typeof e._w.d&&e._w.d!==o&&(v(e).weekdayMismatch=!0)}}function zn(e){var t,n,r,o,a,i,u,l,s;null!=(t=e._w).GG||null!=t.W||null!=t.E?(a=1,i=4,n=In(t.GG,e._a[We],xt(Gn(),1,4).year),r=In(t.W,1),((o=In(t.E,1))<1||o>7)&&(l=!0)):(a=e._locale._week.dow,i=e._locale._week.doy,s=xt(Gn(),a,i),n=In(t.gg,e._a[We],s.year),r=In(t.w,s.week),null!=t.d?((o=t.d)<0||o>6)&&(l=!0):null!=t.e?(o=t.e+a,(t.e<0||t.e>6)&&(l=!0)):o=a),r<1||r>kt(n,a,i)?v(e)._overflowWeeks=!0:null!=l?v(e)._overflowWeekday=!0:(u=St(n,r,o,a,i),e._a[We]=u.year,e._dayOfYear=u.dayOfYear)}function Fn(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],v(e).empty=!0;var t,n,o,a,i,u,l,s=""+e._i,c=s.length,f=0;for(l=(o=B(e._f,e._locale).match(L)||[]).length,t=0;t0&&v(e).unusedInput.push(i),s=s.slice(s.indexOf(n)+n.length),f+=n.length),U[a]?(n?v(e).empty=!1:v(e).unusedTokens.push(a),Fe(a,n,e)):e._strict&&!n&&v(e).unusedTokens.push(a);v(e).charsLeftOver=c-f,s.length>0&&v(e).unusedInput.push(s),e._a[Ve]<=12&&!0===v(e).bigHour&&e._a[Ve]>0&&(v(e).bigHour=void 0),v(e).parsedDateParts=e._a.slice(0),v(e).meridiem=e._meridiem,e._a[Ve]=Yn(e._locale,e._a[Ve],e._meridiem),null!==(u=v(e).era)&&(e._a[We]=e._locale.erasConvertYear(u,e._a[We])),Un(e),wn(e)}else An(e);else Mn(e)}function Yn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function Wn(e){var t,n,r,o,a,i,u=!1,l=e._f.length;if(0===l)return v(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;othis?this:e:y()}));function Xn(e,t){var n,r;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return Gn();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function xr(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e,t={};return S(t,this),(t=Vn(t))._a?(e=t._isUTC?h(t._a):Gn(t._a),this._isDSTShifted=this.isValid()&&sr(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function kr(){return!!this.isValid()&&!this._isUTC}function _r(){return!!this.isValid()&&this._isUTC}function Er(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Tr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Cr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Or(e,t){var n,r,o,a=e,i=null;return ur(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(i=Tr.exec(e))?(n="-"===i[1]?-1:1,a={y:0,d:ce(i[He])*n,h:ce(i[Ve])*n,m:ce(i[qe])*n,s:ce(i[$e])*n,ms:ce(lr(1e3*i[Ge]))*n}):(i=Cr.exec(e))?(n="-"===i[1]?-1:1,a={y:Mr(i[2],n),M:Mr(i[3],n),w:Mr(i[4],n),d:Mr(i[5],n),h:Mr(i[6],n),m:Mr(i[7],n),s:Mr(i[8],n)}):null==a?a={}:"object"===typeof a&&("from"in a||"to"in a)&&(o=Nr(Gn(a.from),Gn(a.to)),(a={}).ms=o.milliseconds,a.M=o.months),r=new ir(a),ur(e)&&u(e,"_locale")&&(r._locale=e._locale),ur(e)&&u(e,"_isValid")&&(r._isValid=e._isValid),r}function Mr(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Pr(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Nr(e,t){var n;return e.isValid()&&t.isValid()?(t=pr(t,e),e.isBefore(t)?n=Pr(e,t):((n=Pr(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Zr(e,t){return function(n,r){var o;return null===r||isNaN(+r)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),Dr(this,Or(n,r),e),this}}function Dr(e,t,n,o){var a=t._milliseconds,i=lr(t._days),u=lr(t._months);e.isValid()&&(o=null==o||o,u&&st(e,de(e,"Month")+u*n),i&&pe(e,"Date",de(e,"Date")+i*n),a&&e._d.setTime(e._d.valueOf()+a*n),o&&r.updateOffset(e,i||u))}Or.fn=ir.prototype,Or.invalid=ar;var Rr=Zr(1,"add"),Ar=Zr(-1,"subtract");function Lr(e){return"string"===typeof e||e instanceof String}function Ir(e){return k(e)||f(e)||Lr(e)||c(e)||Ur(e)||jr(e)||null===e||void 0===e}function jr(e){var t,n,r=i(e)&&!l(e),o=!1,a=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s=a.length;for(t=0;tn.valueOf():n.valueOf()9999?W(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):M(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",W(n,"Z")):W(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function eo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,o="moment",a="";return this.isLocal()||(o=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+o+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=a+'[")]',this.format(e+t+n+r)}function to(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=W(this,e);return this.localeData().postformat(t)}function no(e,t){return this.isValid()&&(k(e)&&e.isValid()||Gn(e).isValid())?Or({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ro(e){return this.from(Gn(),e)}function oo(e,t){return this.isValid()&&(k(e)&&e.isValid()||Gn(e).isValid())?Or({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ao(e){return this.to(Gn(),e)}function io(e){var t;return void 0===e?this._locale._abbr:(null!=(t=yn(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var uo=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function lo(){return this._locale}var so=1e3,co=60*so,fo=60*co,po=3506328*fo;function ho(e,t){return(e%t+t)%t}function mo(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-po:new Date(e,t,n).valueOf()}function vo(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-po:Date.UTC(e,t,n)}function go(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?vo:mo,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ho(t+(this._isUTC?0:this.utcOffset()*co),fo);break;case"minute":t=this._d.valueOf(),t-=ho(t,co);break;case"second":t=this._d.valueOf(),t-=ho(t,so)}return this._d.setTime(t),r.updateOffset(this,!0),this}function yo(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?vo:mo,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=fo-ho(t+(this._isUTC?0:this.utcOffset()*co),fo)-1;break;case"minute":t=this._d.valueOf(),t+=co-ho(t,co)-1;break;case"second":t=this._d.valueOf(),t+=so-ho(t,so)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function bo(){return this._d.valueOf()-6e4*(this._offset||0)}function wo(){return Math.floor(this.valueOf()/1e3)}function So(){return new Date(this.valueOf())}function xo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function ko(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function _o(){return this.isValid()?this.toISOString():null}function Eo(){return g(this)}function To(){return p({},v(this))}function Co(){return v(this).overflow}function Oo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Mo(e,t){var n,o,a,i=this._eras||yn("en")._eras;for(n=0,o=i.length;n=0)return l[r]}function No(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Zo(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e(a=kt(e,r,o))&&(t=a),Xo.call(this,e,t,n,r,o))}function Xo(e,t,n,r,o){var a=St(e,t,n,r,o),i=bt(a.year,0,a.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}function Jo(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}z("N",0,0,"eraAbbr"),z("NN",0,0,"eraAbbr"),z("NNN",0,0,"eraAbbr"),z("NNNN",0,0,"eraName"),z("NNNNN",0,0,"eraNarrow"),z("y",["y",1],"yo","eraYear"),z("y",["yy",2],0,"eraYear"),z("y",["yyy",3],0,"eraYear"),z("y",["yyyy",4],0,"eraYear"),Re("N",Uo),Re("NN",Uo),Re("NNN",Uo),Re("NNNN",zo),Re("NNNNN",Fo),Ue(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var o=n._locale.erasParse(e,r,n._strict);o?v(n).era=o:v(n).invalidEra=e})),Re("y",Oe),Re("yy",Oe),Re("yyy",Oe),Re("yyyy",Oe),Re("yo",Yo),Ue(["y","yy","yyy","yyyy"],We),Ue(["yo"],(function(e,t,n,r){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[We]=n._locale.eraYearOrdinalParse(e,o):t[We]=parseInt(e,10)})),z(0,["gg",2],0,(function(){return this.weekYear()%100})),z(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Bo("gggg","weekYear"),Bo("ggggg","weekYear"),Bo("GGGG","isoWeekYear"),Bo("GGGGG","isoWeekYear"),ne("weekYear","gg"),ne("isoWeekYear","GG"),ie("weekYear",1),ie("isoWeekYear",1),Re("G",Me),Re("g",Me),Re("GG",xe,ye),Re("gg",xe,ye),Re("GGGG",Te,we),Re("gggg",Te,we),Re("GGGGG",Ce,Se),Re("ggggg",Ce,Se),ze(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=ce(e)})),ze(["gg","GG"],(function(e,t,n,o){t[o]=r.parseTwoDigitYear(e)})),z("Q",0,"Qo","quarter"),ne("quarter","Q"),ie("quarter",7),Re("Q",ge),Ue("Q",(function(e,t){t[Be]=3*(ce(e)-1)})),z("D",["DD",2],"Do","date"),ne("date","D"),ie("date",9),Re("D",xe),Re("DD",xe,ye),Re("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Ue(["D","DD"],He),Ue("Do",(function(e,t){t[He]=ce(e.match(xe)[0])}));var ea=fe("Date",!0);function ta(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}z("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),ie("dayOfYear",4),Re("DDD",Ee),Re("DDDD",be),Ue(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=ce(e)})),z("m",["mm",2],0,"minute"),ne("minute","m"),ie("minute",14),Re("m",xe),Re("mm",xe,ye),Ue(["m","mm"],qe);var na=fe("Minutes",!1);z("s",["ss",2],0,"second"),ne("second","s"),ie("second",15),Re("s",xe),Re("ss",xe,ye),Ue(["s","ss"],$e);var ra,oa,aa=fe("Seconds",!1);for(z("S",0,0,(function(){return~~(this.millisecond()/100)})),z(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),z(0,["SSS",3],0,"millisecond"),z(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),z(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),z(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),z(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),z(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),z(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),ne("millisecond","ms"),ie("millisecond",16),Re("S",Ee,ge),Re("SS",Ee,ye),Re("SSS",Ee,be),ra="SSSS";ra.length<=9;ra+="S")Re(ra,Oe);function ia(e,t){t[Ge]=ce(1e3*("0."+e))}for(ra="S";ra.length<=9;ra+="S")Ue(ra,ia);function ua(){return this._isUTC?"UTC":""}function la(){return this._isUTC?"Coordinated Universal Time":""}oa=fe("Milliseconds",!1),z("z",0,0,"zoneAbbr"),z("zz",0,0,"zoneName");var sa=x.prototype;function ca(e){return Gn(1e3*e)}function fa(){return Gn.apply(null,arguments).parseZone()}function da(e){return e}sa.add=Rr,sa.calendar=Yr,sa.clone=Wr,sa.diff=Qr,sa.endOf=yo,sa.format=to,sa.from=no,sa.fromNow=ro,sa.to=oo,sa.toNow=ao,sa.get=he,sa.invalidAt=Co,sa.isAfter=Br,sa.isBefore=Hr,sa.isBetween=Vr,sa.isSame=qr,sa.isSameOrAfter=$r,sa.isSameOrBefore=Gr,sa.isValid=Eo,sa.lang=uo,sa.locale=io,sa.localeData=lo,sa.max=Kn,sa.min=Qn,sa.parsingFlags=To,sa.set=me,sa.startOf=go,sa.subtract=Ar,sa.toArray=xo,sa.toObject=ko,sa.toDate=So,sa.toISOString=Jr,sa.inspect=eo,"undefined"!==typeof Symbol&&null!=Symbol.for&&(sa[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),sa.toJSON=_o,sa.toString=Xr,sa.unix=wo,sa.valueOf=bo,sa.creationData=Oo,sa.eraName=Zo,sa.eraNarrow=Do,sa.eraAbbr=Ro,sa.eraYear=Ao,sa.year=vt,sa.isLeapYear=gt,sa.weekYear=Ho,sa.isoWeekYear=Vo,sa.quarter=sa.quarters=Jo,sa.month=ct,sa.daysInMonth=ft,sa.week=sa.weeks=Ot,sa.isoWeek=sa.isoWeeks=Mt,sa.weeksInYear=Go,sa.weeksInWeekYear=Qo,sa.isoWeeksInYear=qo,sa.isoWeeksInISOWeekYear=$o,sa.date=ea,sa.day=sa.days=Bt,sa.weekday=Ht,sa.isoWeekday=Vt,sa.dayOfYear=ta,sa.hour=sa.hours=rn,sa.minute=sa.minutes=na,sa.second=sa.seconds=aa,sa.millisecond=sa.milliseconds=oa,sa.utcOffset=mr,sa.utc=gr,sa.local=yr,sa.parseZone=br,sa.hasAlignedHourOffset=wr,sa.isDST=Sr,sa.isLocal=kr,sa.isUtcOffset=_r,sa.isUtc=Er,sa.isUTC=Er,sa.zoneAbbr=ua,sa.zoneName=la,sa.dates=E("dates accessor is deprecated. Use date instead.",ea),sa.months=E("months accessor is deprecated. Use month instead",ct),sa.years=E("years accessor is deprecated. Use year instead",vt),sa.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",vr),sa.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",xr);var pa=Z.prototype;function ha(e,t,n,r){var o=yn(),a=h().set(r,t);return o[n](a,e)}function ma(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return ha(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=ha(e,r,n,"month");return o}function va(e,t,n,r){"boolean"===typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var o,a=yn(),i=e?a._week.dow:0,u=[];if(null!=n)return ha(t,(n+i)%7,r,"day");for(o=0;o<7;o++)u[o]=ha(t,(o+i)%7,r,"day");return u}function ga(e,t){return ma(e,t,"months")}function ya(e,t){return ma(e,t,"monthsShort")}function ba(e,t,n){return va(e,t,n,"weekdays")}function wa(e,t,n){return va(e,t,n,"weekdaysShort")}function Sa(e,t,n){return va(e,t,n,"weekdaysMin")}pa.calendar=R,pa.longDateFormat=V,pa.invalidDate=$,pa.ordinal=K,pa.preparse=da,pa.postformat=da,pa.relativeTime=J,pa.pastFuture=ee,pa.set=P,pa.eras=Mo,pa.erasParse=Po,pa.erasConvertYear=No,pa.erasAbbrRegex=Io,pa.erasNameRegex=Lo,pa.erasNarrowRegex=jo,pa.months=at,pa.monthsShort=it,pa.monthsParse=lt,pa.monthsRegex=pt,pa.monthsShortRegex=dt,pa.week=_t,pa.firstDayOfYear=Ct,pa.firstDayOfWeek=Tt,pa.weekdays=Ut,pa.weekdaysMin=Ft,pa.weekdaysShort=zt,pa.weekdaysParse=Wt,pa.weekdaysRegex=qt,pa.weekdaysShortRegex=$t,pa.weekdaysMinRegex=Gt,pa.isPM=tn,pa.meridiem=on,mn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===ce(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=E("moment.lang is deprecated. Use moment.locale instead.",mn),r.langData=E("moment.langData is deprecated. Use moment.localeData instead.",yn);var xa=Math.abs;function ka(){var e=this._data;return this._milliseconds=xa(this._milliseconds),this._days=xa(this._days),this._months=xa(this._months),e.milliseconds=xa(e.milliseconds),e.seconds=xa(e.seconds),e.minutes=xa(e.minutes),e.hours=xa(e.hours),e.months=xa(e.months),e.years=xa(e.years),this}function _a(e,t,n,r){var o=Or(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function Ea(e,t){return _a(this,e,t,1)}function Ta(e,t){return _a(this,e,t,-1)}function Ca(e){return e<0?Math.floor(e):Math.ceil(e)}function Oa(){var e,t,n,r,o,a=this._milliseconds,i=this._days,u=this._months,l=this._data;return a>=0&&i>=0&&u>=0||a<=0&&i<=0&&u<=0||(a+=864e5*Ca(Pa(u)+i),i=0,u=0),l.milliseconds=a%1e3,e=se(a/1e3),l.seconds=e%60,t=se(e/60),l.minutes=t%60,n=se(t/60),l.hours=n%24,i+=se(n/24),u+=o=se(Ma(i)),i-=Ca(Pa(o)),r=se(u/12),u%=12,l.days=i,l.months=u,l.years=r,this}function Ma(e){return 4800*e/146097}function Pa(e){return 146097*e/4800}function Na(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Ma(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Pa(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function Za(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ce(this._months/12):NaN}function Da(e){return function(){return this.as(e)}}var Ra=Da("ms"),Aa=Da("s"),La=Da("m"),Ia=Da("h"),ja=Da("d"),Ua=Da("w"),za=Da("M"),Fa=Da("Q"),Ya=Da("y");function Wa(){return Or(this)}function Ba(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function Ha(e){return function(){return this.isValid()?this._data[e]:NaN}}var Va=Ha("milliseconds"),qa=Ha("seconds"),$a=Ha("minutes"),Ga=Ha("hours"),Qa=Ha("days"),Ka=Ha("months"),Xa=Ha("years");function Ja(){return se(this.days()/7)}var ei=Math.round,ti={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ni(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function ri(e,t,n,r){var o=Or(e).abs(),a=ei(o.as("s")),i=ei(o.as("m")),u=ei(o.as("h")),l=ei(o.as("d")),s=ei(o.as("M")),c=ei(o.as("w")),f=ei(o.as("y")),d=a<=n.ss&&["s",a]||a0,d[4]=r,ni.apply(null,d)}function oi(e){return void 0===e?ei:"function"===typeof e&&(ei=e,!0)}function ai(e,t){return void 0!==ti[e]&&(void 0===t?ti[e]:(ti[e]=t,"s"===e&&(ti.ss=t-1),!0))}function ii(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,o=!1,a=ti;return"object"===typeof e&&(t=e,e=!1),"boolean"===typeof e&&(o=e),"object"===typeof t&&(a=Object.assign({},ti,t),null!=t.s&&null==t.ss&&(a.ss=t.s-1)),r=ri(this,!o,a,n=this.localeData()),o&&(r=n.pastFuture(+this,r)),n.postformat(r)}var ui=Math.abs;function li(e){return(e>0)-(e<0)||+e}function si(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,o,a,i,u,l=ui(this._milliseconds)/1e3,s=ui(this._days),c=ui(this._months),f=this.asSeconds();return f?(e=se(l/60),t=se(e/60),l%=60,e%=60,n=se(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",o=f<0?"-":"",a=li(this._months)!==li(f)?"-":"",i=li(this._days)!==li(f)?"-":"",u=li(this._milliseconds)!==li(f)?"-":"",o+"P"+(n?a+n+"Y":"")+(c?a+c+"M":"")+(s?i+s+"D":"")+(t||e||l?"T":"")+(t?u+t+"H":"")+(e?u+e+"M":"")+(l?u+r+"S":"")):"P0D"}var ci=ir.prototype;return ci.isValid=or,ci.abs=ka,ci.add=Ea,ci.subtract=Ta,ci.as=Na,ci.asMilliseconds=Ra,ci.asSeconds=Aa,ci.asMinutes=La,ci.asHours=Ia,ci.asDays=ja,ci.asWeeks=Ua,ci.asMonths=za,ci.asQuarters=Fa,ci.asYears=Ya,ci.valueOf=Za,ci._bubble=Oa,ci.clone=Wa,ci.get=Ba,ci.milliseconds=Va,ci.seconds=qa,ci.minutes=$a,ci.hours=Ga,ci.days=Qa,ci.weeks=Ja,ci.months=Ka,ci.years=Xa,ci.humanize=ii,ci.toISOString=si,ci.toString=si,ci.toJSON=si,ci.locale=io,ci.localeData=lo,ci.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",si),ci.lang=uo,z("X",0,0,"unix"),z("x",0,0,"valueOf"),Re("x",Me),Re("X",Ze),Ue("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),Ue("x",(function(e,t,n){n._d=new Date(ce(e))})),r.version="2.29.4",o(Gn),r.fn=sa,r.min=Jn,r.max=er,r.now=tr,r.utc=h,r.unix=ca,r.months=ga,r.isDate=f,r.locale=mn,r.invalid=y,r.duration=Or,r.isMoment=k,r.weekdays=ba,r.parseZone=fa,r.localeData=yn,r.isDuration=ur,r.monthsShort=ya,r.weekdaysMin=Sa,r.defineLocale=vn,r.updateLocale=gn,r.locales=bn,r.weekdaysShort=wa,r.normalizeUnits=re,r.relativeTimeRounding=oi,r.relativeTimeThreshold=ai,r.calendarFormat=Fr,r.prototype=sa,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()},71843:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,o){for(var a,i,u=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l