@unblind/react 0.1.0-alpha.11 → 0.1.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +42 -11
- package/dist/index.d.ts +42 -11
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import"uplot/dist/uPlot.min.css";.ub-default{display:flex;height:100%;align-items:center;justify-content:center;color:var(--ub-muted-foreground)}.ub-loading-text:before{content:attr(data-text)}.ub-empty-content{text-align:center}.ub-empty-icon-wrapper{margin:0 auto;display:flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;background-color:var(--ub-muted)}.ub-icon{width:1.25rem;height:1.25rem;color:var(--ub-muted-foreground)}.ub-empty-text{margin-top:.5rem;font-size:.875rem;color:var(--ub-muted-foreground)}.ub-empty-text:before{content:attr(data-text)}:root{--ub-radius: var(--radius, .5rem);--ub-background: var(--background, oklch(1 0 0));--ub-primary: var(--primary, oklch(.208 .042 264.541));--ub-primary-foreground: var(--primary-foreground, oklch(1 0 0));--ub-secondary: var(--secondary, oklch(.985 .002 264.542));--ub-secondary-foreground: var( --secondary-foreground, oklch(.208 .042 264.541) );--ub-muted: var(--muted, oklch(.967 .001 286.375));--ub-muted-foreground: var(--muted-foreground, oklch(.552 .016 285.938));--ub-popover: var(--popover, oklch(1 0 0));--ub-border: var( --border, oklch(.922 .005 264.542 / .8) );--ub-ring: var(--ring, oklch(.208 .042 264.541));--ub-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--ub-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ub-shadow-ring: 0 0 0 1px oklch(.922 .005 264.542 / .4);--ub-shadow-ring-sm: 0 0 0 1px rgb(0 0 0 / .05);--ub-backdrop-blur: blur(12px);--ub-opacity-subtle: .7;--ub-chart-font-size: 11px;--ub-chart-font-color: var(--ub-muted-foreground);--ub-chart-grid-color: oklch(from var(--ub-muted-foreground) l c h / .15);-webkit-font-smoothing:antialiased}.dark{--ub-background: var(--background, oklch(.236 .013 265.755));--ub-primary: var(--primary, oklch(1 0 0));--ub-primary-foreground: var( --primary-foreground, oklch(.236 .013 265.755) );--ub-secondary: var(--secondary, oklch(1 0 0 / .05));--ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));--ub-muted: var(--muted, oklch(1 0 0 / .05));--ub-muted-foreground: var(--muted-foreground, oklch(.665 .032 252.894));--ub-popover: var(--popover, oklch(.236 .013 265.755));--ub-border: var(--border, oklch(1 0 0 / .1));--ub-ring: var(--ring, oklch(1 0 0));--ub-shadow-ring: 0 0 0 1px oklch(.274 .014 265.755 / .4);--ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / .1)}@media(prefers-color-scheme:dark){.root{--ub-background: var( --background, oklch(.236 .013 265.755) );--ub-primary: var(--primary, oklch(1 0 0));--ub-primary-foreground: var( --primary-foreground, oklch(.236 .013 265.755) );--ub-secondary: var(--secondary, oklch(1 0 0 / .05));--ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));--ub-muted: var(--muted, oklch(1 0 0 / .05));--ub-muted-foreground: var(--muted-foreground, oklch(.665 .032 252.894));--ub-popover: var(--popover, oklch(.236 .013 265.755));--ub-border: var(--border, oklch(1 0 0 / .1));--ub-ring: var(--ring, oklch(1 0 0));--ub-shadow-ring: 0 0 0 1px oklch(.274 .014 265.755 / .4);--ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / .1)}}.ub-tooltip{display:flex;min-width:340px;max-width:520px;width:auto;flex-direction:column;font-size:.875rem;gap:.5rem;border-radius:var(--ub-radius);border:1px solid var(--ub-border);padding:.5rem .625rem;background-color:var(--ub-popover)}.ub-tooltip-datetime{font-weight:500;padding-left:.3rem;padding-right:.3rem}.ub-tooltip-divider{height:1px;width:100%;border:none;background:var(--ub-border);margin:0}.ub-tooltip-content{display:flex;flex-direction:column;padding-left:.35rem;padding-right:.35rem;gap:.2rem}.ub-tooltip-group{display:flex;flex-direction:column;gap:.25rem}.ub-tooltip-group-header{position:sticky;top:0;z-index:10;color:var(--ub-primary);--opacity: 50%}.ub-tooltip-group-header--separator{margin-top:.25rem}.ub-tooltip-items{display:flex;flex-direction:column;gap:.5rem}.ub-tooltip-item{display:flex;flex-direction:column;transition:background-color .15s ease}.ub-tooltip-item-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}.ub-tooltip-item-left{display:flex;flex-direction:column;--gap: .625rem;min-width:0;overflow:hidden}.ub-tooltip-item-heading{display:flex;gap:.25rem;align-items:center}.ub-tooltip-item-metric-name{opacity:100%}.ub-tooltip-item-metric-name-label{--opacity: 50%}.ub-tooltip-item-dot{width:3px;height:14px;flex-shrink:0;border-radius:9999px}.ub-tooltip-item-attributes{display:flex;gap:.25rem;margin-right:auto}.ub-tooltip-item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ub-tooltip-item-value{font-weight:500;--tw-font-weight: 500;font-variant-numeric:tabular-nums;font-size:.8rem;white-space:nowrap;margin-left:3rem}.ub-tooltip-item-value--empty{font-weight:400;color:var(--ub-text-disabled)}.ub-tooltip-attributes{margin-top:.125rem;display:flex;flex-wrap:wrap;-moz-column-gap:.75rem;column-gap:.75rem;row-gap:.125rem;padding-left:.75rem;line-height:1rem}.ub-tooltip-attribute{display:flex;align-items:center;gap:.25rem}.ub-tooltip-item-attribute-container{display:flex}.ub-tooltip-item-attribute-key{opacity:var(--ub-opacity-subtle);font-size:12px}.ub-tooltip-item-attribute{background:var(--ub-muted);border-radius:var(--ub-radius);padding:0 .25rem}.ub-tooltip-item-attribute{.ub-tooltip-item-attribute-value{color:var(--primary-foreground)}}.ub-tooltip-item-attribute-value{color:var(--ub-muted-foreground);font-weight:500;font-size:12px}.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-value{color:var(--ub-foreground);font-size:14px}.ub-tooltip-item-hidden-metric .ub-tooltip-item-hidden-attribute-key .ub-tooltip-item-attribute-value{font-weight:400}.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-key{font-size:14px}.ub-tooltip-item-attribute-divider:before{content:attr(data-text);color:var(--ub-muted-foreground)}.ub-tooltip-no-data{padding:0 .3rem;font-style:italic;color:var(--ub-placeholder);line-height:1rem}.ub-chart-container{width:100%;height:100%;min-height:0;flex:1}.ub-chart-container{width:100%;height:100%}
|
|
1
|
+
.ub-default{display:flex;height:100%;align-items:center;justify-content:center;color:var(--ub-muted-foreground)}.ub-loading-text:before{content:attr(data-text)}.ub-empty-content{text-align:center}.ub-empty-icon-wrapper{margin:0 auto;display:flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;background-color:var(--ub-muted)}.ub-icon{width:1.25rem;height:1.25rem;color:var(--ub-muted-foreground)}.ub-empty-text{margin-top:.5rem;font-size:.875rem;color:var(--ub-muted-foreground)}.ub-empty-text:before{content:attr(data-text)}.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:-moz-min-content;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}:root{--ub-radius: var(--radius, .5rem);--ub-background: var(--background, oklch(1 0 0));--ub-primary: var(--primary, oklch(.208 .042 264.541));--ub-primary-foreground: var(--primary-foreground, oklch(1 0 0));--ub-secondary: var(--secondary, oklch(.985 .002 264.542));--ub-secondary-foreground: var( --secondary-foreground, oklch(.208 .042 264.541) );--ub-muted: var(--muted, oklch(.967 .001 286.375));--ub-muted-foreground: var(--muted-foreground, oklch(.552 .016 285.938));--ub-popover: var(--popover, oklch(1 0 0));--ub-border: var( --border, oklch(.922 .005 264.542 / .8) );--ub-ring: var(--ring, oklch(.208 .042 264.541));--ub-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--ub-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--ub-shadow-ring: 0 0 0 1px oklch(.922 .005 264.542 / .4);--ub-shadow-ring-sm: 0 0 0 1px rgb(0 0 0 / .05);--ub-backdrop-blur: blur(12px);--ub-opacity-subtle: .7;--ub-chart-font-size: 11px;--ub-chart-font-color: var(--ub-muted-foreground);--ub-chart-grid-color: oklch(from var(--ub-muted-foreground) l c h / .15);--ub-chart-threshold-error: oklch(60% .2 30);--ub-chart-threshold-warning: oklch(75% .18 90);--ub-chart-threshold-ok: oklch(65% .15 145);--ub-chart-threshold-info: oklch(85% .005 240);--ub-chart-threshold-default: oklch(65% .01 0);--ub-chart-threshold-error-fill: oklch( from var(--ub-chart-threshold-error) l c h / .15 );--ub-chart-threshold-warning-fill: oklch( from var(--ub-chart-threshold-warning) l c h / .15 );--ub-chart-threshold-ok-fill: oklch( from var(--ub-chart-threshold-ok) l c h / .15 );--ub-chart-threshold-info-fill: oklch( from var(--ub-chart-threshold-info) l c h / .15 );--ub-chart-threshold-default-fill: oklch( from var(--ub-chart-threshold-default) l c h / .1 );--ub-chart-serie-color-1: var(--chart-1, oklch(.68 .214 293.418));--ub-chart-serie-color-2: var(--chart-2, oklch(.84 .151 94.621));--ub-chart-serie-color-3: var(--chart-3, oklch(.68 .2 255.485));--ub-chart-serie-color-4: var(--chart-4, oklch(.7 .245 27.325));--ub-chart-serie-color-5: var(--chart-5, oklch(.68 .18 149.579));--ub-chart-serie-color-6: var(--chart-6, oklch(.75 .159 50.554));--ub-chart-serie-color-7: var(--chart-7, oklch(.7 .14 215.355));--ub-chart-serie-color-8: var(--chart-8, oklch(.68 .25 301.364));--ub-chart-serie-color-9: var(--chart-9, oklch(.72 .16 89.872));--ub-chart-serie-color-10: var(--chart-10, oklch(.65 .2 276.652));--ub-chart-serie-color-11: var(--chart-11, oklch(.68 .14 192.803));--ub-chart-serie-color-12: var(--chart-12, oklch(.65 .22 3.555));--ub-chart-serie-fill-color-1: oklch( from var(--ub-chart-serie-color-1) l c h / .4 );--ub-chart-serie-fill-color-2: oklch( from var(--ub-chart-serie-color-2) l c h / .4 );--ub-chart-serie-fill-color-3: oklch( from var(--ub-chart-serie-color-3) l c h / .4 );--ub-chart-serie-fill-color-4: oklch( from var(--ub-chart-serie-color-4) l c h / .4 );--ub-chart-serie-fill-color-5: oklch( from var(--ub-chart-serie-color-5) l c h / .4 );--ub-chart-serie-fill-color-6: oklch( from var(--ub-chart-serie-color-6) l c h / .4 );--ub-chart-serie-fill-color-7: oklch( from var(--ub-chart-serie-color-7) l c h / .4 );--ub-chart-serie-fill-color-8: oklch( from var(--ub-chart-serie-color-8) l c h / .4 );--ub-chart-serie-fill-color-9: oklch( from var(--ub-chart-serie-color-9) l c h / .4 );--ub-chart-serie-fill-color-10: oklch( from var(--ub-chart-serie-color-10) l c h / .4 );--ub-chart-serie-fill-color-11: oklch( from var(--ub-chart-serie-color-11) l c h / .4 );--ub-chart-serie-fill-color-12: oklch( from var(--ub-chart-serie-color-12) l c h / .4 );-webkit-font-smoothing:antialiased}.dark{--ub-background: var(--background, oklch(.236 .013 265.755));--ub-primary: var(--primary, oklch(1 0 0));--ub-primary-foreground: var( --primary-foreground, oklch(.236 .013 265.755) );--ub-secondary: var(--secondary, oklch(1 0 0 / .05));--ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));--ub-muted: var(--muted, oklch(1 0 0 / .05));--ub-muted-foreground: var(--muted-foreground, oklch(.665 .032 252.894));--ub-popover: var(--popover, oklch(.236 .013 265.755));--ub-border: var(--border, oklch(1 0 0 / .1));--ub-ring: var(--ring, oklch(1 0 0));--ub-shadow-ring: 0 0 0 1px oklch(.274 .014 265.755 / .4);--ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / .1)}@media(prefers-color-scheme:dark){.root{--ub-background: var( --background, oklch(.236 .013 265.755) );--ub-primary: var(--primary, oklch(1 0 0));--ub-primary-foreground: var( --primary-foreground, oklch(.236 .013 265.755) );--ub-secondary: var(--secondary, oklch(1 0 0 / .05));--ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));--ub-muted: var(--muted, oklch(1 0 0 / .05));--ub-muted-foreground: var(--muted-foreground, oklch(.665 .032 252.894));--ub-popover: var(--popover, oklch(.236 .013 265.755));--ub-border: var(--border, oklch(1 0 0 / .1));--ub-ring: var(--ring, oklch(1 0 0));--ub-shadow-ring: 0 0 0 1px oklch(.274 .014 265.755 / .4);--ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / .1)}}@layer ub-chart{:where(.ub-chart-container){width:100%;height:100%;min-height:0;flex-grow:1}}.ub-tooltip{display:flex;min-width:340px;max-width:520px;width:auto;flex-direction:column;font-size:.875rem;gap:.5rem;border-radius:var(--ub-radius);border:1px solid var(--ub-border);padding:.5rem .625rem;background-color:var(--ub-popover)}.ub-tooltip-datetime{font-weight:500;padding-left:.3rem;padding-right:.3rem}.ub-tooltip-divider{height:1px;width:100%;border:none;background:var(--ub-border);margin:0}.ub-tooltip-content{display:flex;flex-direction:column;padding-left:.35rem;padding-right:.35rem;gap:.2rem}.ub-tooltip-group{display:flex;flex-direction:column;gap:.25rem}.ub-tooltip-group-header{position:sticky;top:0;z-index:10;color:var(--ub-primary);--opacity: 50%}.ub-tooltip-group-header--separator{margin-top:.25rem}.ub-tooltip-items{display:flex;flex-direction:column;gap:.5rem}.ub-tooltip-item{display:flex;flex-direction:column;transition:background-color .15s ease}.ub-tooltip-item-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}.ub-tooltip-item-left{display:flex;flex-direction:column;--gap: .625rem;min-width:0;overflow:hidden}.ub-tooltip-item-heading{display:flex;gap:.25rem;align-items:center}.ub-tooltip-item-metric-name{opacity:100%}.ub-tooltip-item-metric-name-label{--opacity: 50%}.ub-tooltip-item-dot{width:3px;height:14px;flex-shrink:0;border-radius:9999px}.ub-tooltip-item-attributes{display:flex;gap:.25rem;margin-right:auto}.ub-tooltip-item-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ub-tooltip-item-value{font-weight:500;--tw-font-weight: 500;font-variant-numeric:tabular-nums;font-size:.8rem;white-space:nowrap;margin-left:3rem}.ub-tooltip-item-value--empty{font-weight:400;color:var(--ub-text-disabled)}.ub-tooltip-attributes{margin-top:.125rem;display:flex;flex-wrap:wrap;-moz-column-gap:.75rem;column-gap:.75rem;row-gap:.125rem;padding-left:.75rem;line-height:1rem}.ub-tooltip-attribute{display:flex;align-items:center;gap:.25rem}.ub-tooltip-item-attribute-container{display:flex}.ub-tooltip-item-attribute-key{opacity:var(--ub-opacity-subtle);font-size:12px}.ub-tooltip-item-attribute{background:var(--ub-muted);border-radius:var(--ub-radius);padding:0 .25rem}.ub-tooltip-item-attribute{.ub-tooltip-item-attribute-value{color:var(--primary-foreground)}}.ub-tooltip-item-attribute-value{color:var(--ub-muted-foreground);font-weight:500;font-size:12px}.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-value{color:var(--ub-foreground);font-size:14px}.ub-tooltip-item-hidden-metric .ub-tooltip-item-hidden-attribute-key .ub-tooltip-item-attribute-value{font-weight:400}.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-key{font-size:14px}.ub-tooltip-item-attribute-divider:before{content:attr(data-text);color:var(--ub-muted-foreground)}.ub-tooltip-no-data{padding:0 .3rem;font-style:italic;color:var(--ub-placeholder);line-height:1rem}
|
|
2
2
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Defaults/Defaults.css","../src/styles.css","../src/components/Tooltip/Tooltip.css","../src/components/Chart/Chart.css","../src/components/TimeseriesChart/TimeseriesChart.css"],"sourcesContent":[".ub-default {\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: var(--ub-muted-foreground);\n}\n\n.ub-loading-text::before {\n content: attr(data-text);\n}\n\n.ub-empty-content {\n text-align: center;\n}\n\n.ub-empty-icon-wrapper {\n margin: 0 auto;\n display: flex;\n height: 2.5rem;\n width: 2.5rem;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n background-color: var(--ub-muted);\n}\n\n.ub-icon {\n width: 1.25rem;\n height: 1.25rem;\n color: var(--ub-muted-foreground);\n}\n\n.ub-empty-text {\n margin-top: 0.5rem;\n font-size: 0.875rem;\n color: var(--ub-muted-foreground);\n}\n\n.ub-empty-text::before {\n content: attr(data-text);\n}\n","@import \"uplot/dist/uPlot.min.css\";\n\n:root {\n --ub-radius: var(--radius, 0.5rem);\n --ub-background: var(--background, oklch(1 0 0));\n --ub-primary: var(--primary, oklch(0.208 0.042 264.541));\n --ub-primary-foreground: var(--primary-foreground, oklch(1 0 0));\n --ub-secondary: var(--secondary, oklch(0.985 0.002 264.542));\n --ub-secondary-foreground: var(\n --secondary-foreground,\n oklch(0.208 0.042 264.541)\n );\n --ub-muted: var(--muted, oklch(0.967 0.001 286.375));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.552 0.016 285.938));\n --ub-popover: var(--popover, oklch(1 0 0));\n --ub-border: var(\n --border,\n oklch(0.922 0.005 264.542 / 0.8)\n ); /* gray-200/80 */\n --ub-ring: var(--ring, oklch(0.208 0.042 264.541));\n\n /* Custom extensions */\n /* Shadows */\n --ub-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --ub-shadow-lg:\n 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --ub-shadow-ring: 0 0 0 1px oklch(0.922 0.005 264.542 / 0.4);\n --ub-shadow-ring-sm: 0 0 0 1px rgb(0 0 0 / 0.05);\n\n /* Effects */\n --ub-backdrop-blur: blur(12px);\n --ub-opacity-subtle: 0.7;\n\n --ub-chart-font-size: 11px;\n --ub-chart-font-color: var(--ub-muted-foreground);\n --ub-chart-grid-color: oklch(from var(--ub-muted-foreground) l c h / 0.15);\n -webkit-font-smoothing: antialiased;\n}\n\n/* Explicit, compatibility with shadcn */\n.dark {\n --ub-background: var(--background, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-primary: var(--primary, oklch(1 0 0));\n --ub-primary-foreground: var(\n --primary-foreground,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-secondary: var(--secondary, oklch(1 0 0 / 0.05));\n --ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));\n --ub-muted: var(--muted, oklch(1 0 0 / 0.05));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.665 0.032 252.894));\n --ub-popover: var(--popover, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-border: var(--border, oklch(1 0 0 / 0.1));\n --ub-ring: var(--ring, oklch(1 0 0));\n\n /* Custom extensions */\n --ub-shadow-ring: 0 0 0 1px oklch(0.274 0.014 265.755 / 0.4); /* zinc-800/40 */\n --ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / 0.1);\n}\n\n@media (prefers-color-scheme: dark) {\n .root {\n --ub-background: var(\n --background,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-primary: var(--primary, oklch(1 0 0));\n --ub-primary-foreground: var(\n --primary-foreground,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-secondary: var(--secondary, oklch(1 0 0 / 0.05));\n --ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));\n --ub-muted: var(--muted, oklch(1 0 0 / 0.05));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.665 0.032 252.894));\n --ub-popover: var(--popover, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-border: var(--border, oklch(1 0 0 / 0.1));\n --ub-ring: var(--ring, oklch(1 0 0));\n\n /* Custom extensions */\n --ub-shadow-ring: 0 0 0 1px oklch(0.274 0.014 265.755 / 0.4); /* zinc-800/40 */\n --ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / 0.1);\n }\n}\n","/* Container */\n.ub-tooltip {\n display: flex;\n min-width: 340px;\n max-width: 520px;\n width: auto;\n flex-direction: column;\n font-size: 0.875rem;\n gap: 0.5rem;\n border-radius: var(--ub-radius);\n border: 1px solid var(--ub-border);\n padding: 0.5rem 0.625rem 0.5rem 0.625rem;\n background-color: var(--ub-popover);\n}\n\n.ub-tooltip-datetime {\n font-weight: 500;\n padding-left: 0.3rem;\n padding-right: 0.3rem;\n}\n\n.ub-tooltip-divider {\n height: 1px;\n width: 100%;\n border: none;\n background: var(--ub-border);\n margin: 0;\n}\n\n.ub-tooltip-content {\n display: flex;\n flex-direction: column;\n padding-left: 0.35rem;\n padding-right: 0.35rem;\n gap: 0.2rem;\n}\n\n.ub-tooltip-group {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n}\n\n.ub-tooltip-group-header {\n position: sticky;\n top: 0;\n z-index: 10;\n color: var(--ub-primary);\n --opacity: 50%;\n}\n\n.ub-tooltip-group-header--separator {\n margin-top: 0.25rem;\n}\n\n.ub-tooltip-items {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.ub-tooltip-item {\n display: flex;\n flex-direction: column;\n transition: background-color 0.15s ease;\n}\n\n.ub-tooltip-item-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n}\n\n.ub-tooltip-item-left {\n display: flex;\n flex-direction: column;\n --gap: 0.625rem;\n min-width: 0;\n overflow: hidden;\n}\n\n.ub-tooltip-item-heading {\n display: flex;\n gap: 0.25rem;\n align-items: center;\n}\n\n.ub-tooltip-item-metric-name {\n opacity: 100%;\n}\n\n.ub-tooltip-item-metric-name-label {\n --opacity: 50%;\n}\n\n.ub-tooltip-item-dot {\n width: 3px;\n height: 14px;\n flex-shrink: 0;\n border-radius: 9999px;\n}\n\n.ub-tooltip-item-attributes {\n display: flex;\n gap: 0.25rem;\n margin-right: auto;\n}\n\n.ub-tooltip-item-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ub-tooltip-item-value {\n font-weight: 500;\n --tw-font-weight: 500;\n font-variant-numeric: tabular-nums;\n font-size: 0.8rem;\n white-space: nowrap;\n margin-left: 3rem;\n}\n\n.ub-tooltip-item-value--empty {\n font-weight: 400;\n color: var(--ub-text-disabled);\n}\n\n/* Attributes Container */\n.ub-tooltip-attributes {\n margin-top: 0.125rem;\n display: flex;\n flex-wrap: wrap;\n -moz-column-gap: 0.75rem;\n column-gap: 0.75rem;\n row-gap: 0.125rem;\n padding-left: 0.75rem;\n line-height: 1rem;\n}\n\n/* Attribute Item */\n.ub-tooltip-attribute {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n}\n\n.ub-tooltip-item-attribute-container {\n display: flex;\n}\n\n.ub-tooltip-item-attribute-key {\n opacity: var(--ub-opacity-subtle);\n font-size: 12px;\n}\n\n.ub-tooltip-item-attribute {\n background: var(--ub-muted);\n border-radius: var(--ub-radius);\n padding: 0 0.25rem 0 0.25rem;\n}\n\n.ub-tooltip-item-attribute {\n .ub-tooltip-item-attribute-value {\n color: var(--primary-foreground);\n }\n}\n\n.ub-tooltip-item-attribute-value {\n color: var(--ub-muted-foreground);\n font-weight: 500;\n font-size: 12px;\n}\n\n.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-value {\n color: var(--ub-foreground);\n font-size: 14px;\n}\n\n.ub-tooltip-item-hidden-metric\n .ub-tooltip-item-hidden-attribute-key\n .ub-tooltip-item-attribute-value {\n font-weight: 400;\n}\n\n.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-key {\n font-size: 14px;\n}\n\n.ub-tooltip-item-attribute-divider::before {\n content: attr(data-text);\n color: var(--ub-muted-foreground);\n}\n\n.ub-tooltip-no-data {\n padding: 0 0.3rem 0 0.3rem;\n font-style: italic;\n color: var(--ub-placeholder);\n line-height: 1rem;\n}\n",".ub-chart-container {\n width: 100%;\n height: 100%;\n min-height: 0;\n flex: 1;\n}\n",".ub-chart-container {\n width: 100%;\n height: 100%;\n}\n"],"mappings":"kCAAA,CAAC,WACC,QAAS,KACT,OAAQ,KACR,YAAa,OACb,gBAAiB,OACjB,MAAO,IAAI,sBACb,CAEA,CAAC,eAAe,QACd,QAAS,KAAK,UAChB,CAEA,CAAC,iBACC,WAAY,MACd,CAEA,CAAC,sBAhBD,OAiBU,EAAE,KACV,QAAS,KACT,OAAQ,OACR,MAAO,OACP,YAAa,OACb,gBAAiB,OAtBnB,cAuBiB,OACf,iBAAkB,IAAI,WACxB,CAEA,CAAC,QACC,MAAO,QACP,OAAQ,QACR,MAAO,IAAI,sBACb,CAEA,CAAC,cACC,WAAY,MACZ,UAAW,QACX,MAAO,IAAI,s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AAa,OACb,YAAa,IACf,CAEA,CAAC,6BACC,YAAa,IACb,MAAO,IAAI,mBACb,CAGA,CAAC,sBACC,WAAY,QACZ,QAAS,KACT,UAAW,KACX,gBAAiB,OACZ,WAAY,OACjB,QAAS,QACT,aAAc,OACd,YAAa,IACf,CAGA,CAAC,qBACC,QAAS,KACT,YAAa,OACb,IAAK,MACP,CAEA,CAAC,oCACC,QAAS,IACX,CAEA,CAAC,8BACC,QAAS,IAAI,qBACb,UAAW,IACb,CAEA,CAAC,0BACC,WAAY,IAAI,YAChB,cAAe,IAAI,aA/JrB,QAgKW,EAAE,MACb,CAEA,CANC,0BAOC,CAAC,gCACC,MAAO,IAAI,qBACb,CACF,CAEA,CALG,gCAMD,MAAO,IAAI,uBACX,YAAa,IACb,UAAW,IACb,CAEA,CAAC,8BAA8B,CAX5B,gCAYD,MAAO,IAAI,iBACX,UAAW,IACb,CAEA,CALC,8BAMC,CAAC,qCACD,CAlBC,gCAmBD,YAAa,GACf,CAEA,CAXC,8BAW8B,CAlC9B,8BAmCC,UAAW,IACb,CAEA,CAAC,iCAAiC,QAChC,QAAS,KAAK,WACd,MAAO,IAAI,sBACb,CAEA,CAAC,mBAnMD,QAoMW,EAAE,MACX,WAAY,OACZ,MAAO,IAAI,kBACX,YAAa,IACf,CCxMA,CAAC,mBACC,MAAO,KACP,OAAQ,KACR,WAAY,EACZ,KAAM,CACR,CCLA,CAAC,mBACC,MAAO,KACP,OAAQ,IACV","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/components/Defaults/Defaults.css","../../../node_modules/.pnpm/uplot@1.6.32/node_modules/uplot/dist/uPlot.min.css","../src/styles.css","../src/components/Tooltip/Tooltip.css"],"sourcesContent":[".ub-default {\n display: flex;\n height: 100%;\n align-items: center;\n justify-content: center;\n color: var(--ub-muted-foreground);\n}\n\n.ub-loading-text::before {\n content: attr(data-text);\n}\n\n.ub-empty-content {\n text-align: center;\n}\n\n.ub-empty-icon-wrapper {\n margin: 0 auto;\n display: flex;\n height: 2.5rem;\n width: 2.5rem;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n background-color: var(--ub-muted);\n}\n\n.ub-icon {\n width: 1.25rem;\n height: 1.25rem;\n color: var(--ub-muted-foreground);\n}\n\n.ub-empty-text {\n margin-top: 0.5rem;\n font-size: 0.875rem;\n color: var(--ub-muted-foreground);\n}\n\n.ub-empty-text::before {\n content: attr(data-text);\n}\n",".uplot, .uplot *, .uplot *::before, .uplot *::after {box-sizing: border-box;}.uplot {font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";line-height: 1.5;width: -moz-min-content;width: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;-webkit-user-select: none;-moz-user-select: none;user-select: none;}.u-over, .u-under {position: absolute;}.u-under {overflow: hidden;}.uplot canvas {display: block;position: relative;width: 100%;height: 100%;}.u-axis {position: absolute;}.u-legend {font-size: 14px;margin: auto;text-align: center;}.u-inline {display: block;}.u-inline * {display: inline-block;}.u-inline tr {margin-right: 16px;}.u-legend th {font-weight: 600;}.u-legend th > * {vertical-align: middle;display: inline-block;}.u-legend .u-marker {width: 1em;height: 1em;margin-right: 4px;background-clip: padding-box !important;}.u-inline.u-live th::after {content: \":\";vertical-align: middle;}.u-inline:not(.u-live) .u-value {display: none;}.u-series > * {padding: 4px;}.u-series th {cursor: pointer;}.u-legend .u-off > * {opacity: 0.3;}.u-select {background: rgba(0,0,0,0.07);position: absolute;pointer-events: none;}.u-cursor-x, .u-cursor-y {position: absolute;left: 0;top: 0;pointer-events: none;will-change: transform;}.u-hz .u-cursor-x, .u-vt .u-cursor-y {height: 100%;border-right: 1px dashed #607D8B;}.u-hz .u-cursor-y, .u-vt .u-cursor-x {width: 100%;border-bottom: 1px dashed #607D8B;}.u-cursor-pt {position: absolute;top: 0;left: 0;border-radius: 50%;border: 0 solid;pointer-events: none;will-change: transform;/*this has to be !important since we set inline \"background\" shorthand */background-clip: padding-box !important;}.u-axis.u-off, .u-select.u-off, .u-cursor-x.u-off, .u-cursor-y.u-off, .u-cursor-pt.u-off {display: none;}","@import \"uplot/dist/uPlot.min.css\";\n\n:root {\n --ub-radius: var(--radius, 0.5rem);\n --ub-background: var(--background, oklch(1 0 0));\n --ub-primary: var(--primary, oklch(0.208 0.042 264.541));\n --ub-primary-foreground: var(--primary-foreground, oklch(1 0 0));\n --ub-secondary: var(--secondary, oklch(0.985 0.002 264.542));\n --ub-secondary-foreground: var(\n --secondary-foreground,\n oklch(0.208 0.042 264.541)\n );\n --ub-muted: var(--muted, oklch(0.967 0.001 286.375));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.552 0.016 285.938));\n --ub-popover: var(--popover, oklch(1 0 0));\n --ub-border: var(\n --border,\n oklch(0.922 0.005 264.542 / 0.8)\n ); /* gray-200/80 */\n --ub-ring: var(--ring, oklch(0.208 0.042 264.541));\n\n /* Custom extensions */\n /* Shadows */\n --ub-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);\n --ub-shadow-lg:\n 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);\n --ub-shadow-ring: 0 0 0 1px oklch(0.922 0.005 264.542 / 0.4);\n --ub-shadow-ring-sm: 0 0 0 1px rgb(0 0 0 / 0.05);\n\n /* Effects */\n --ub-backdrop-blur: blur(12px);\n --ub-opacity-subtle: 0.7;\n\n /* Chart */\n --ub-chart-font-size: 11px;\n --ub-chart-font-color: var(--ub-muted-foreground);\n --ub-chart-grid-color: oklch(from var(--ub-muted-foreground) l c h / 0.15);\n\n /* Threshold colors */\n --ub-chart-threshold-error: oklch(60% 0.2 30);\n --ub-chart-threshold-warning: oklch(75% 0.18 90);\n --ub-chart-threshold-ok: oklch(65% 0.15 145);\n --ub-chart-threshold-info: oklch(85% 0.005 240);\n --ub-chart-threshold-default: oklch(65% 0.01 0);\n\n --ub-chart-threshold-error-fill: oklch(\n from var(--ub-chart-threshold-error) l c h / 0.15\n );\n --ub-chart-threshold-warning-fill: oklch(\n from var(--ub-chart-threshold-warning) l c h / 0.15\n );\n --ub-chart-threshold-ok-fill: oklch(\n from var(--ub-chart-threshold-ok) l c h / 0.15\n );\n --ub-chart-threshold-info-fill: oklch(\n from var(--ub-chart-threshold-info) l c h / 0.15\n );\n --ub-chart-threshold-default-fill: oklch(\n from var(--ub-chart-threshold-default) l c h / 0.1\n );\n\n --ub-chart-serie-color-1: var(--chart-1, oklch(0.68 0.214 293.418));\n --ub-chart-serie-color-2: var(--chart-2, oklch(0.84 0.151 94.621));\n --ub-chart-serie-color-3: var(--chart-3, oklch(0.68 0.2 255.485));\n --ub-chart-serie-color-4: var(--chart-4, oklch(0.7 0.245 27.325));\n --ub-chart-serie-color-5: var(--chart-5, oklch(0.68 0.18 149.579));\n --ub-chart-serie-color-6: var(--chart-6, oklch(0.75 0.159 50.554));\n --ub-chart-serie-color-7: var(--chart-7, oklch(0.7 0.14 215.355));\n --ub-chart-serie-color-8: var(--chart-8, oklch(0.68 0.25 301.364));\n --ub-chart-serie-color-9: var(--chart-9, oklch(0.72 0.16 89.872));\n --ub-chart-serie-color-10: var(--chart-10, oklch(0.65 0.2 276.652));\n --ub-chart-serie-color-11: var(--chart-11, oklch(0.68 0.14 192.803));\n --ub-chart-serie-color-12: var(--chart-12, oklch(0.65 0.22 3.555));\n\n --ub-chart-serie-fill-color-1: oklch(\n from var(--ub-chart-serie-color-1) l c h / 0.4\n );\n --ub-chart-serie-fill-color-2: oklch(\n from var(--ub-chart-serie-color-2) l c h / 0.4\n );\n --ub-chart-serie-fill-color-3: oklch(\n from var(--ub-chart-serie-color-3) l c h / 0.4\n );\n --ub-chart-serie-fill-color-4: oklch(\n from var(--ub-chart-serie-color-4) l c h / 0.4\n );\n --ub-chart-serie-fill-color-5: oklch(\n from var(--ub-chart-serie-color-5) l c h / 0.4\n );\n --ub-chart-serie-fill-color-6: oklch(\n from var(--ub-chart-serie-color-6) l c h / 0.4\n );\n --ub-chart-serie-fill-color-7: oklch(\n from var(--ub-chart-serie-color-7) l c h / 0.4\n );\n --ub-chart-serie-fill-color-8: oklch(\n from var(--ub-chart-serie-color-8) l c h / 0.4\n );\n --ub-chart-serie-fill-color-9: oklch(\n from var(--ub-chart-serie-color-9) l c h / 0.4\n );\n --ub-chart-serie-fill-color-10: oklch(\n from var(--ub-chart-serie-color-10) l c h / 0.4\n );\n --ub-chart-serie-fill-color-11: oklch(\n from var(--ub-chart-serie-color-11) l c h / 0.4\n );\n --ub-chart-serie-fill-color-12: oklch(\n from var(--ub-chart-serie-color-12) l c h / 0.4\n );\n\n -webkit-font-smoothing: antialiased;\n}\n\n/* Explicit, compatibility with shadcn */\n.dark {\n --ub-background: var(--background, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-primary: var(--primary, oklch(1 0 0));\n --ub-primary-foreground: var(\n --primary-foreground,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-secondary: var(--secondary, oklch(1 0 0 / 0.05));\n --ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));\n --ub-muted: var(--muted, oklch(1 0 0 / 0.05));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.665 0.032 252.894));\n --ub-popover: var(--popover, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-border: var(--border, oklch(1 0 0 / 0.1));\n --ub-ring: var(--ring, oklch(1 0 0));\n\n /* Custom extensions */\n --ub-shadow-ring: 0 0 0 1px oklch(0.274 0.014 265.755 / 0.4); /* zinc-800/40 */\n --ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / 0.1);\n}\n\n@media (prefers-color-scheme: dark) {\n .root {\n --ub-background: var(\n --background,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-primary: var(--primary, oklch(1 0 0));\n --ub-primary-foreground: var(\n --primary-foreground,\n oklch(0.236 0.013 265.755)\n ); /* zinc-900 */\n --ub-secondary: var(--secondary, oklch(1 0 0 / 0.05));\n --ub-secondary-foreground: var(--secondary-foreground, oklch(1 0 0));\n --ub-muted: var(--muted, oklch(1 0 0 / 0.05));\n --ub-muted-foreground: var(--muted-foreground, oklch(0.665 0.032 252.894));\n --ub-popover: var(--popover, oklch(0.236 0.013 265.755)); /* zinc-900 */\n --ub-border: var(--border, oklch(1 0 0 / 0.1));\n --ub-ring: var(--ring, oklch(1 0 0));\n\n /* Custom extensions */\n --ub-shadow-ring: 0 0 0 1px oklch(0.274 0.014 265.755 / 0.4); /* zinc-800/40 */\n --ub-shadow-ring-sm: 0 0 0 1px oklch(1 0 0 / 0.1);\n }\n}\n\n@layer ub-chart {\n :where(.ub-chart-container) {\n width: 100%;\n height: 100%;\n min-height: 0;\n flex-grow: 1;\n }\n}\n","/* Container */\n.ub-tooltip {\n display: flex;\n min-width: 340px;\n max-width: 520px;\n width: auto;\n flex-direction: column;\n font-size: 0.875rem;\n gap: 0.5rem;\n border-radius: var(--ub-radius);\n border: 1px solid var(--ub-border);\n padding: 0.5rem 0.625rem 0.5rem 0.625rem;\n background-color: var(--ub-popover);\n}\n\n.ub-tooltip-datetime {\n font-weight: 500;\n padding-left: 0.3rem;\n padding-right: 0.3rem;\n}\n\n.ub-tooltip-divider {\n height: 1px;\n width: 100%;\n border: none;\n background: var(--ub-border);\n margin: 0;\n}\n\n.ub-tooltip-content {\n display: flex;\n flex-direction: column;\n padding-left: 0.35rem;\n padding-right: 0.35rem;\n gap: 0.2rem;\n}\n\n.ub-tooltip-group {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n}\n\n.ub-tooltip-group-header {\n position: sticky;\n top: 0;\n z-index: 10;\n color: var(--ub-primary);\n --opacity: 50%;\n}\n\n.ub-tooltip-group-header--separator {\n margin-top: 0.25rem;\n}\n\n.ub-tooltip-items {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.ub-tooltip-item {\n display: flex;\n flex-direction: column;\n transition: background-color 0.15s ease;\n}\n\n.ub-tooltip-item-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 1rem;\n}\n\n.ub-tooltip-item-left {\n display: flex;\n flex-direction: column;\n --gap: 0.625rem;\n min-width: 0;\n overflow: hidden;\n}\n\n.ub-tooltip-item-heading {\n display: flex;\n gap: 0.25rem;\n align-items: center;\n}\n\n.ub-tooltip-item-metric-name {\n opacity: 100%;\n}\n\n.ub-tooltip-item-metric-name-label {\n --opacity: 50%;\n}\n\n.ub-tooltip-item-dot {\n width: 3px;\n height: 14px;\n flex-shrink: 0;\n border-radius: 9999px;\n}\n\n.ub-tooltip-item-attributes {\n display: flex;\n gap: 0.25rem;\n margin-right: auto;\n}\n\n.ub-tooltip-item-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ub-tooltip-item-value {\n font-weight: 500;\n --tw-font-weight: 500;\n font-variant-numeric: tabular-nums;\n font-size: 0.8rem;\n white-space: nowrap;\n margin-left: 3rem;\n}\n\n.ub-tooltip-item-value--empty {\n font-weight: 400;\n color: var(--ub-text-disabled);\n}\n\n/* Attributes Container */\n.ub-tooltip-attributes {\n margin-top: 0.125rem;\n display: flex;\n flex-wrap: wrap;\n -moz-column-gap: 0.75rem;\n column-gap: 0.75rem;\n row-gap: 0.125rem;\n padding-left: 0.75rem;\n line-height: 1rem;\n}\n\n/* Attribute Item */\n.ub-tooltip-attribute {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n}\n\n.ub-tooltip-item-attribute-container {\n display: flex;\n}\n\n.ub-tooltip-item-attribute-key {\n opacity: var(--ub-opacity-subtle);\n font-size: 12px;\n}\n\n.ub-tooltip-item-attribute {\n background: var(--ub-muted);\n border-radius: var(--ub-radius);\n padding: 0 0.25rem 0 0.25rem;\n}\n\n.ub-tooltip-item-attribute {\n .ub-tooltip-item-attribute-value {\n color: var(--primary-foreground);\n }\n}\n\n.ub-tooltip-item-attribute-value {\n color: var(--ub-muted-foreground);\n font-weight: 500;\n font-size: 12px;\n}\n\n.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-value {\n color: var(--ub-foreground);\n font-size: 14px;\n}\n\n.ub-tooltip-item-hidden-metric\n .ub-tooltip-item-hidden-attribute-key\n .ub-tooltip-item-attribute-value {\n font-weight: 400;\n}\n\n.ub-tooltip-item-hidden-metric .ub-tooltip-item-attribute-key {\n font-size: 14px;\n}\n\n.ub-tooltip-item-attribute-divider::before {\n content: attr(data-text);\n color: var(--ub-muted-foreground);\n}\n\n.ub-tooltip-no-data {\n padding: 0 0.3rem 0 0.3rem;\n font-style: italic;\n color: var(--ub-placeholder);\n line-height: 1rem;\n}\n"],"mappings":"AAAA,CAAC,WACC,QAAS,KACT,OAAQ,KACR,YAAa,OACb,gBAAiB,OACjB,MAAO,IAAI,sBACb,CAEA,CAAC,eAAe,QACd,QAAS,KAAK,UAChB,CAEA,CAAC,iBACC,WAAY,MACd,CAEA,CAAC,sBAhBD,OAiBU,EAAE,KACV,QAAS,KACT,OAAQ,OACR,MAAO,OACP,YAAa,OACb,gBAAiB,OAtBnB,cAuBiB,OACf,iBAAkB,IAAI,WACxB,CAEA,CAAC,QACC,MAAO,QACP,OAAQ,QACR,MAAO,IAAI,sBACb,CAEA,CAAC,cACC,WAAY,MACZ,UAAW,QACX,MAAO,IAAI,sBACb,CAEA,CANC,aAMa,QACZ,QAAS,KAAK,UAChB,CCzCA,CAAC,MAAO,CAAP,MAAc,EAAG,CAAjB,MAAwB,CAAC,QAAU,CAAnC,MAA0C,CAAC,OAAS,WAAY,UAAW,CAAC,CAA5E,MAAoF,YAAa,SAAS,CAAE,aAAa,CAAE,QAAU,CAAE,MAAM,CAAE,cAAgB,CAAE,KAAK,CAAE,SAAW,CAAE,UAAU,CAAE,mBAAmB,CAAE,gBAAgB,CAAE,eAAiB,CAAE,mBAAmB,YAAa,IAAI,MAAO,iBAAiB,MAAO,WAAY,CAAC,CAAC,QAAS,WAAY,OAAO,UAAW,KA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AAa,IACf,CAGA,CAAC,qBACC,QAAS,KACT,YAAa,OACb,IAAK,MACP,CAEA,CAAC,oCACC,QAAS,IACX,CAEA,CAAC,8BACC,QAAS,IAAI,qBACb,UAAW,IACb,CAEA,CAAC,0BACC,WAAY,IAAI,YAChB,cAAe,IAAI,aA/JrB,QAgKW,EAAE,MACb,CAEA,CANC,0BAOC,CAAC,gCACC,MAAO,IAAI,qBACb,CACF,CAEA,CALG,gCAMD,MAAO,IAAI,uBACX,YAAa,IACb,UAAW,IACb,CAEA,CAAC,8BAA8B,CAX5B,gCAYD,MAAO,IAAI,iBACX,UAAW,IACb,CAEA,CALC,8BAMC,CAAC,qCACD,CAlBC,gCAmBD,YAAa,GACf,CAEA,CAXC,8BAW8B,CAlC9B,8BAmCC,UAAW,IACb,CAEA,CAAC,iCAAiC,QAChC,QAAS,KAAK,WACd,MAAO,IAAI,sBACb,CAEA,CAAC,mBAnMD,QAoMW,EAAE,MACX,WAAY,OACZ,MAAO,IAAI,kBACX,YAAa,IACf","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -50,7 +50,7 @@ type UnblindClientProviderProps = {
|
|
|
50
50
|
* return (
|
|
51
51
|
* <>
|
|
52
52
|
* <button onClick={() => refresh()}>Refresh</button>
|
|
53
|
-
* <
|
|
53
|
+
* <Timeseries metrics={["cpu"]} />
|
|
54
54
|
* </>
|
|
55
55
|
* );
|
|
56
56
|
* }
|
|
@@ -260,6 +260,22 @@ type Appearance = {
|
|
|
260
260
|
Tooltip?: React.ComponentType<TooltipProps>;
|
|
261
261
|
};
|
|
262
262
|
} & ChartVisualConfig;
|
|
263
|
+
type ThresholdLevel = "info" | "warning" | "error" | "ok";
|
|
264
|
+
type ThresholdLineType = "line" | "dashed" | "bold";
|
|
265
|
+
type LineThreshold = {
|
|
266
|
+
value: number;
|
|
267
|
+
type?: ThresholdLineType;
|
|
268
|
+
level?: ThresholdLevel;
|
|
269
|
+
label?: string;
|
|
270
|
+
};
|
|
271
|
+
type RangeThreshold = {
|
|
272
|
+
from: number;
|
|
273
|
+
to?: number;
|
|
274
|
+
type?: ThresholdLineType;
|
|
275
|
+
level?: ThresholdLevel;
|
|
276
|
+
label?: string;
|
|
277
|
+
};
|
|
278
|
+
type Threshold = LineThreshold | RangeThreshold;
|
|
263
279
|
|
|
264
280
|
type UnblindScopeConfig = TimeseriesQueryConfig & {
|
|
265
281
|
/**
|
|
@@ -329,7 +345,7 @@ type UseScopeReturn = TimeseriesQueryConfig & {
|
|
|
329
345
|
Empty: React$1.ComponentType;
|
|
330
346
|
Tooltip?: React$1.ComponentType<TooltipProps>;
|
|
331
347
|
};
|
|
332
|
-
colors
|
|
348
|
+
colors?: Colors;
|
|
333
349
|
sortByValues?: boolean;
|
|
334
350
|
fill?: boolean;
|
|
335
351
|
tooltip?: TooltipConfig;
|
|
@@ -462,7 +478,7 @@ interface UseLogsReturn {
|
|
|
462
478
|
*/
|
|
463
479
|
declare function useLogs({ timeRange, filters, startTime, endTime, }: UseLogsParams): UseLogsReturn;
|
|
464
480
|
|
|
465
|
-
type
|
|
481
|
+
type TimeseriesProps = Exclude<TimeseriesQueryConfig, "startTime" | "endTime" | "timeRange"> & {
|
|
466
482
|
/**
|
|
467
483
|
* Metric name(s) to display in the chart.
|
|
468
484
|
*
|
|
@@ -473,6 +489,18 @@ type TimeseriesChartProps = Exclude<TimeseriesQueryConfig, "startTime" | "endTim
|
|
|
473
489
|
* Chart type. Defaults to "line".
|
|
474
490
|
*/
|
|
475
491
|
type?: ChartType;
|
|
492
|
+
/**
|
|
493
|
+
* Optional threshold
|
|
494
|
+
*/
|
|
495
|
+
thresholds?: Array<Threshold>;
|
|
496
|
+
/**
|
|
497
|
+
* Optional min value
|
|
498
|
+
*/
|
|
499
|
+
min?: number;
|
|
500
|
+
/**
|
|
501
|
+
* Optional max value
|
|
502
|
+
*/
|
|
503
|
+
max?: number;
|
|
476
504
|
/**
|
|
477
505
|
* Unit of measurement for the value.
|
|
478
506
|
*
|
|
@@ -495,27 +523,27 @@ type TimeseriesChartProps = Exclude<TimeseriesQueryConfig, "startTime" | "endTim
|
|
|
495
523
|
appearance?: Appearance;
|
|
496
524
|
};
|
|
497
525
|
/**
|
|
498
|
-
*
|
|
526
|
+
* Timeseries component that displays time series data for the given metrics.
|
|
499
527
|
* It uses values from the UnblindProvider for timeRange, attributes, groupBy, and operator
|
|
500
528
|
* if not explicitly provided as props.
|
|
501
529
|
*
|
|
502
530
|
* @example Using [UnblindProvider]
|
|
503
531
|
* ```tsx
|
|
504
532
|
* <UnblindProvider timeRange="1h">
|
|
505
|
-
* <
|
|
506
|
-
* <
|
|
533
|
+
* <Timeseries metrics={["host.cpu"]} />
|
|
534
|
+
* <Timeseries metrics={["host.memory"]} />
|
|
507
535
|
* </UnblindProvider>
|
|
508
536
|
* ```
|
|
509
537
|
*
|
|
510
538
|
* @example Using <UnblindScope>
|
|
511
539
|
* ```tsx
|
|
512
540
|
* <UnblindScope timeRange="1h">
|
|
513
|
-
* <
|
|
514
|
-
* <
|
|
541
|
+
* <Timeseries metrics={["host.cpu"]} />
|
|
542
|
+
* <Timeseries metrics={["host.memory"]} />
|
|
515
543
|
* </UnblindScope>
|
|
516
544
|
* ```
|
|
517
545
|
*/
|
|
518
|
-
declare function
|
|
546
|
+
declare function Timeseries({ metrics, operator: propOperator, attributes: propAttributes, groupBy: propGroupBy, interval: propInterval, type, className, appearance: propAppearance, unit: propUnit, thresholds: propThresholds, min: propMin, max: propMax, }: TimeseriesProps): react_jsx_runtime.JSX.Element;
|
|
519
547
|
|
|
520
548
|
interface ChartProps extends ChartVisualConfig {
|
|
521
549
|
times: Array<number>;
|
|
@@ -526,7 +554,10 @@ interface ChartProps extends ChartVisualConfig {
|
|
|
526
554
|
timeZone?: string;
|
|
527
555
|
options?: uPlot.Options;
|
|
528
556
|
unit?: string;
|
|
529
|
-
|
|
557
|
+
tooltipComponent?: React.ComponentType<TooltipProps>;
|
|
558
|
+
thresholds?: Array<Threshold>;
|
|
559
|
+
min?: number;
|
|
560
|
+
max?: number;
|
|
530
561
|
}
|
|
531
562
|
/**
|
|
532
563
|
* Renders a chart for time series data
|
|
@@ -537,4 +568,4 @@ declare function Empty(): react_jsx_runtime.JSX.Element;
|
|
|
537
568
|
declare function Error(): react_jsx_runtime.JSX.Element;
|
|
538
569
|
declare function Loading(): react_jsx_runtime.JSX.Element;
|
|
539
570
|
|
|
540
|
-
export { type AggregationOperator, type Appearance, type AttributeWithValue, Chart, type ChartProps, type ChartType, type ChartVisualConfig, type Colors, Empty, Error, type Interval, Loading, type Log, type MetricMetadata, type MetricMetadataList, type MetricType, type PaginatedResponse, type Serie, type Severity, type TimeConfig, type TimeRange,
|
|
571
|
+
export { type AggregationOperator, type Appearance, type AttributeWithValue, Chart, type ChartProps, type ChartType, type ChartVisualConfig, type Colors, Empty, Error, type Interval, Loading, type Log, type MetricMetadata, type MetricMetadataList, type MetricType, type PaginatedResponse, type Serie, type Severity, type TimeConfig, type TimeRange, Timeseries, type TimeseriesProps, type TimeseriesQuery, type TimeseriesQueryConfig, type TooltipProps, type UnblindClientConfig, UnblindProvider, type UnblindProviderProps, UnblindScope, type UnblindScopeConfig, type UnblindScopeProps, type Usage, type UseLogsParams, type UseLogsReturn, type UseMetricsReturn, type UseScopeReturn, type UseTimeseriesParams, type UseTimeseriesReturn, type UseUsageParams, type UseUsageReturn, useLogs, useMetrics, useRefresh, useScope, useTimeseries, useUsage };
|
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ type UnblindClientProviderProps = {
|
|
|
50
50
|
* return (
|
|
51
51
|
* <>
|
|
52
52
|
* <button onClick={() => refresh()}>Refresh</button>
|
|
53
|
-
* <
|
|
53
|
+
* <Timeseries metrics={["cpu"]} />
|
|
54
54
|
* </>
|
|
55
55
|
* );
|
|
56
56
|
* }
|
|
@@ -260,6 +260,22 @@ type Appearance = {
|
|
|
260
260
|
Tooltip?: React.ComponentType<TooltipProps>;
|
|
261
261
|
};
|
|
262
262
|
} & ChartVisualConfig;
|
|
263
|
+
type ThresholdLevel = "info" | "warning" | "error" | "ok";
|
|
264
|
+
type ThresholdLineType = "line" | "dashed" | "bold";
|
|
265
|
+
type LineThreshold = {
|
|
266
|
+
value: number;
|
|
267
|
+
type?: ThresholdLineType;
|
|
268
|
+
level?: ThresholdLevel;
|
|
269
|
+
label?: string;
|
|
270
|
+
};
|
|
271
|
+
type RangeThreshold = {
|
|
272
|
+
from: number;
|
|
273
|
+
to?: number;
|
|
274
|
+
type?: ThresholdLineType;
|
|
275
|
+
level?: ThresholdLevel;
|
|
276
|
+
label?: string;
|
|
277
|
+
};
|
|
278
|
+
type Threshold = LineThreshold | RangeThreshold;
|
|
263
279
|
|
|
264
280
|
type UnblindScopeConfig = TimeseriesQueryConfig & {
|
|
265
281
|
/**
|
|
@@ -329,7 +345,7 @@ type UseScopeReturn = TimeseriesQueryConfig & {
|
|
|
329
345
|
Empty: React$1.ComponentType;
|
|
330
346
|
Tooltip?: React$1.ComponentType<TooltipProps>;
|
|
331
347
|
};
|
|
332
|
-
colors
|
|
348
|
+
colors?: Colors;
|
|
333
349
|
sortByValues?: boolean;
|
|
334
350
|
fill?: boolean;
|
|
335
351
|
tooltip?: TooltipConfig;
|
|
@@ -462,7 +478,7 @@ interface UseLogsReturn {
|
|
|
462
478
|
*/
|
|
463
479
|
declare function useLogs({ timeRange, filters, startTime, endTime, }: UseLogsParams): UseLogsReturn;
|
|
464
480
|
|
|
465
|
-
type
|
|
481
|
+
type TimeseriesProps = Exclude<TimeseriesQueryConfig, "startTime" | "endTime" | "timeRange"> & {
|
|
466
482
|
/**
|
|
467
483
|
* Metric name(s) to display in the chart.
|
|
468
484
|
*
|
|
@@ -473,6 +489,18 @@ type TimeseriesChartProps = Exclude<TimeseriesQueryConfig, "startTime" | "endTim
|
|
|
473
489
|
* Chart type. Defaults to "line".
|
|
474
490
|
*/
|
|
475
491
|
type?: ChartType;
|
|
492
|
+
/**
|
|
493
|
+
* Optional threshold
|
|
494
|
+
*/
|
|
495
|
+
thresholds?: Array<Threshold>;
|
|
496
|
+
/**
|
|
497
|
+
* Optional min value
|
|
498
|
+
*/
|
|
499
|
+
min?: number;
|
|
500
|
+
/**
|
|
501
|
+
* Optional max value
|
|
502
|
+
*/
|
|
503
|
+
max?: number;
|
|
476
504
|
/**
|
|
477
505
|
* Unit of measurement for the value.
|
|
478
506
|
*
|
|
@@ -495,27 +523,27 @@ type TimeseriesChartProps = Exclude<TimeseriesQueryConfig, "startTime" | "endTim
|
|
|
495
523
|
appearance?: Appearance;
|
|
496
524
|
};
|
|
497
525
|
/**
|
|
498
|
-
*
|
|
526
|
+
* Timeseries component that displays time series data for the given metrics.
|
|
499
527
|
* It uses values from the UnblindProvider for timeRange, attributes, groupBy, and operator
|
|
500
528
|
* if not explicitly provided as props.
|
|
501
529
|
*
|
|
502
530
|
* @example Using [UnblindProvider]
|
|
503
531
|
* ```tsx
|
|
504
532
|
* <UnblindProvider timeRange="1h">
|
|
505
|
-
* <
|
|
506
|
-
* <
|
|
533
|
+
* <Timeseries metrics={["host.cpu"]} />
|
|
534
|
+
* <Timeseries metrics={["host.memory"]} />
|
|
507
535
|
* </UnblindProvider>
|
|
508
536
|
* ```
|
|
509
537
|
*
|
|
510
538
|
* @example Using <UnblindScope>
|
|
511
539
|
* ```tsx
|
|
512
540
|
* <UnblindScope timeRange="1h">
|
|
513
|
-
* <
|
|
514
|
-
* <
|
|
541
|
+
* <Timeseries metrics={["host.cpu"]} />
|
|
542
|
+
* <Timeseries metrics={["host.memory"]} />
|
|
515
543
|
* </UnblindScope>
|
|
516
544
|
* ```
|
|
517
545
|
*/
|
|
518
|
-
declare function
|
|
546
|
+
declare function Timeseries({ metrics, operator: propOperator, attributes: propAttributes, groupBy: propGroupBy, interval: propInterval, type, className, appearance: propAppearance, unit: propUnit, thresholds: propThresholds, min: propMin, max: propMax, }: TimeseriesProps): react_jsx_runtime.JSX.Element;
|
|
519
547
|
|
|
520
548
|
interface ChartProps extends ChartVisualConfig {
|
|
521
549
|
times: Array<number>;
|
|
@@ -526,7 +554,10 @@ interface ChartProps extends ChartVisualConfig {
|
|
|
526
554
|
timeZone?: string;
|
|
527
555
|
options?: uPlot.Options;
|
|
528
556
|
unit?: string;
|
|
529
|
-
|
|
557
|
+
tooltipComponent?: React.ComponentType<TooltipProps>;
|
|
558
|
+
thresholds?: Array<Threshold>;
|
|
559
|
+
min?: number;
|
|
560
|
+
max?: number;
|
|
530
561
|
}
|
|
531
562
|
/**
|
|
532
563
|
* Renders a chart for time series data
|
|
@@ -537,4 +568,4 @@ declare function Empty(): react_jsx_runtime.JSX.Element;
|
|
|
537
568
|
declare function Error(): react_jsx_runtime.JSX.Element;
|
|
538
569
|
declare function Loading(): react_jsx_runtime.JSX.Element;
|
|
539
570
|
|
|
540
|
-
export { type AggregationOperator, type Appearance, type AttributeWithValue, Chart, type ChartProps, type ChartType, type ChartVisualConfig, type Colors, Empty, Error, type Interval, Loading, type Log, type MetricMetadata, type MetricMetadataList, type MetricType, type PaginatedResponse, type Serie, type Severity, type TimeConfig, type TimeRange,
|
|
571
|
+
export { type AggregationOperator, type Appearance, type AttributeWithValue, Chart, type ChartProps, type ChartType, type ChartVisualConfig, type Colors, Empty, Error, type Interval, Loading, type Log, type MetricMetadata, type MetricMetadataList, type MetricType, type PaginatedResponse, type Serie, type Severity, type TimeConfig, type TimeRange, Timeseries, type TimeseriesProps, type TimeseriesQuery, type TimeseriesQueryConfig, type TooltipProps, type UnblindClientConfig, UnblindProvider, type UnblindProviderProps, UnblindScope, type UnblindScopeConfig, type UnblindScopeProps, type Usage, type UseLogsParams, type UseLogsReturn, type UseMetricsReturn, type UseScopeReturn, type UseTimeseriesParams, type UseTimeseriesReturn, type UseUsageParams, type UseUsageReturn, useLogs, useMetrics, useRefresh, useScope, useTimeseries, useUsage };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Je=Object.create;var $=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var tt=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty;var rt=(e,t)=>{for(var o in t)$(e,o,{get:t[o],enumerable:!0})},me=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of et(t))!ot.call(e,r)&&r!==o&&$(e,r,{get:()=>t[r],enumerable:!(i=Ze(t,r))||i.enumerable});return e};var W=(e,t,o)=>(o=e!=null?Je(tt(e)):{},me(t||!e||!e.__esModule?$(o,"default",{value:e,enumerable:!0}):o,e)),it=e=>me($({},"__esModule",{value:!0}),e);var St={};rt(St,{Chart:()=>re,Empty:()=>X,Error:()=>Y,Loading:()=>J,TimeseriesChart:()=>Ye,UnblindProvider:()=>ge,UnblindScope:()=>Z,useLogs:()=>ke,useMetrics:()=>ye,useRefresh:()=>ne,useScope:()=>B,useTimeseries:()=>ee,useUsage:()=>Pe});module.exports=it(St);var F=require("@tanstack/react-query"),I=require("react"),ie=require("react/jsx-runtime"),de=(0,I.createContext)(void 0);function fe({children:e,queryClient:t,queryClientConfig:o,apiBaseUrl:i="/api/unblind",fetchImpl:r}){let l=(0,I.useMemo)(()=>{if(t)return t;let n={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1},u={defaultOptions:{queries:n}};return o?new F.QueryClient({...o,defaultOptions:{...o.defaultOptions,queries:{...n,...o.defaultOptions?.queries}}}):new F.QueryClient(u)},[t,o]),s=(0,I.useMemo)(()=>({apiBaseUrl:i,fetchImpl:r}),[i,r]);return(0,ie.jsx)(F.QueryClientProvider,{client:l,children:(0,ie.jsx)(de.Provider,{value:s,children:e})})}function D(){let e=(0,I.useContext)(de);if(!e)throw new Error("useUnblindConfig must be used within an UnblindClientProvider. Please wrap your app or component tree with <UnblindClientProvider>.");return e}function ne(){let e=(0,F.useQueryClient)();return(0,I.useCallback)(async()=>{await e.refetchQueries({queryKey:["unblind","timeseries"]})},[e])}var V=require("react");var N=require("react/jsx-runtime");function X(){return(0,N.jsx)("div",{className:"ub-default",children:(0,N.jsxs)("div",{className:"ub-empty-content",children:[(0,N.jsx)("div",{className:"ub-empty-icon-wrapper",children:(0,N.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"ub-icon",children:(0,N.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}),(0,N.jsx)("p",{className:"ub-empty-text","data-text":"No data available for this time range"})]})})}function Y(){return(0,N.jsx)("div",{className:"ub-error"})}function J(){return(0,N.jsx)("div",{className:"ub-default","data-text":"Loading"})}var be=require("react/jsx-runtime"),se=(0,V.createContext)(void 0);function Z({children:e,timeRange:t,startTime:o,endTime:i,interval:r,attributes:l,groupBy:s,operator:n,appearance:u}){let a=(0,V.useContext)(se),m=u?.components?.Loading,d=u?.components?.Error,p=u?.components?.Tooltip,c=u?.tooltip?.layout,b=u?.tooltip?.format,h=u?.tooltip?.hideAttributes,g=u?.tooltip?.hideAttributeKey,f=u?.tooltip?.hideMetric,T=(0,V.useMemo)(()=>{if(!(!m&&!d&&!p))return{components:{...m&&{Loading:m},...d&&{Error:d},...p&&{Tooltip:p}},tooltip:{layout:c,format:b,hideAttributes:h,hideAttributeKey:g,hideMetric:f}}},[m,d,p,c,b,h,g,f]),v=(0,V.useMemo)(()=>({timeRange:t??a?.timeRange,startTime:o??a?.startTime,endTime:i??a?.endTime,interval:r??a?.interval,attributes:l??a?.attributes,groupBy:s??a?.groupBy,operator:n??a?.operator,appearance:T??a?.appearance}),[t,o,i,r,l,s,n,T,a]);return(0,be.jsx)(se.Provider,{value:v,children:e})}var nt=["#7c3aed","#eab308","#2563eb","#dc2626","#16a34a","#f97316","#0891b2","#9333ea","#ca8a04","#4f46e5","#0d9488","#be185d"],st="6h";function B(){let e=(0,V.useContext)(se);return{timeRange:e?.timeRange||st,startTime:e?.startTime,endTime:e?.endTime,interval:e?.interval,attributes:e?.attributes,groupBy:e?.groupBy,operator:e?.operator,appearance:{components:{Loading:e?.appearance?.components?.Loading??J,Error:e?.appearance?.components?.Error??Y,Empty:e?.appearance?.components?.Empty??X,Tooltip:e?.appearance?.components?.Tooltip},colors:e?.appearance?.colors||nt,tooltip:e?.appearance?.tooltip}}}var ae=require("react/jsx-runtime");function ge({children:e,queryClient:t,apiBaseUrl:o,fetchImpl:i,timeRange:r,startTime:l,endTime:s,interval:n,attributes:u,groupBy:a,operator:m,appearance:d}){return(0,ae.jsx)(fe,{queryClient:t,apiBaseUrl:o,fetchImpl:i,children:(0,ae.jsx)(Z,{timeRange:r,startTime:l,endTime:s,interval:n,attributes:u,groupBy:a,operator:m,appearance:d,children:e})})}var he=require("@tanstack/react-query");function ye(){let{apiBaseUrl:e,fetchImpl:t=fetch}=D(),o=(0,he.useQuery)({queryKey:["unblind","metrics"],queryFn:async()=>{let i=await t(`${e}/metrics`,{headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error("Error loading metrics metadata");if(i.status===200){let{data:r}=await i.json();return r}else throw new Error("Unexpected status code")}});return{metrics:o.data,isLoading:o.isLoading,hasError:o.isError,refetch:o.refetch}}var Te=require("@tanstack/react-query"),q=require("react");var ve=W(require("ms"));function at(e){let t=Math.floor(Date.now()/1e3);return[t-Math.floor((0,ve.default)(e)/1e3),t]}function H(e,t,o){let i,r;if(typeof t=="number"&&typeof o=="number")i=t,r=o;else if(e){let[l,s]=at(e);i=l,r=s}else throw new Error("Either timeRange or both startTime and endTime must be provided");return[i,r]}function ee({queries:e,timeRange:t,startTime:o,endTime:i,interval:r}){let{apiBaseUrl:l,fetchImpl:s=fetch}=D(),n=(0,q.useMemo)(()=>e.map(v=>v.metrics.join(",")).join(","),[e]),u=(0,q.useMemo)(()=>e.map(v=>{let C=v.attributes;if(!C)return"";let A=Object.keys(C);return A.length===0?"":A.map(P=>P+":"+C[P]?.join(",")).join(",")}).join(","),[e]),a=(0,q.useMemo)(()=>e.map(v=>v.operator),[e]),m=(0,q.useMemo)(()=>e.map(v=>v.groupBy).join(", "),[e]),p=(0,Te.useQuery)({queryKey:["unblind","timeseries",n,u,o,i,t,r,a,m],queryFn:async()=>{if(!n)throw new Error("Missing required parameters");if(n.length===0)throw new Error("No series provided");let[v,C]=H(t,o,i),A={queries:e,startTime:v,endTime:C,interval:r},P=await s(`${l}/tenants/timeseries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)});if(!P.ok)throw new Error("Error fetching metric");let{series:w,times:S,metadata:M}=await P.json();if(!w)throw console.error("Series not found"),new Error("Series not found");return{series:w,times:S,metadata:M}},enabled:!!n&&(typeof o=="number"&&typeof i=="number"||!!t)}),{metadata:c,series:b,times:h}=(0,q.useMemo)(()=>p.data?{series:p.data.series,times:p.data.times,metadata:p.data.metadata}:{series:[],times:[],metadata:{}},[p]),g=p.isLoading,f=p.isFetching,T=p.isError;return{data:{series:b,times:h,metadata:c},isLoading:g,isFetching:f,hasError:T,refetch:p.refetch}}var xe=require("@tanstack/react-query"),Ce=require("react");function Pe({timeRange:e,startTime:t,endTime:o}){let{apiBaseUrl:i,fetchImpl:r=fetch}=D(),s=(0,xe.useQuery)({queryKey:["unblind","usage",e,t,o],queryFn:async()=>{let[m,d]=H(e,t,o),p=`${i}/tenants/usage`,c=await r(p,{headers:{"Content-Type":"application/json"},body:JSON.stringify({startTime:m,endTime:d})});if(!c.ok)throw new Error("Error fetching usage");let{data:b}=await c.json();if(!b)throw new Error("usage not found");return b},enabled:typeof t=="number"&&typeof o=="number"||!!e}),n=(0,Ce.useMemo)(()=>s.data?s.data||[]:[],[s]),u=s.isLoading||s.isRefetching,a=s.isError;return{usage:n,isLoading:u,hasError:a,refetch:s.refetch}}var we=require("@tanstack/react-query"),Ue=require("react");function ke({timeRange:e,filters:t,startTime:o,endTime:i}){let{apiBaseUrl:r,fetchImpl:l=fetch}=D(),s=typeof o=="number"&&typeof i=="number"||!!e,n=(0,we.useInfiniteQuery)({queryKey:["unblind","logs",e,t.map(a=>a.name+":"+a.value).sort().join(",")],queryFn:async({pageParam:a})=>{let m=t.reduce((P,w)=>(P[w.name]||(P[w.name]=[]),P[w.name].push(w.value),P),{}),{body:d=[],severity:p=[],"service.name":c=[],"trace.id":b=[],"span.id":h=[],...g}=m,[f,T]=H(e,o,i),v=await l(`${r}/tenants/logs`,{method:"POST",body:JSON.stringify({filter:{attributes:g,body:d,severity:p,traceId:b,spanId:h,service:c},startTime:f,endTime:T,pagination:{page:a}}),headers:{"Content-Type":"application/json"}});if(!v.ok)throw new Error("Error fetching logs");let{data:C,next_page:A}=await v.json();if(!C)throw new Error("logs not found");return{data:C,next_page:A}},enabled:s,initialPageParam:void 0,getNextPageParam:a=>a.next_page});return{logs:(0,Ue.useMemo)(()=>n.data?n.data.pages.flatMap(a=>a.data||[]):[],[n.data]),isLoading:n.isLoading,hasError:n.isError,hasNextPage:n.hasNextPage??!1,fetchNextPage:n.fetchNextPage,isFetchingNextPage:n.isFetchingNextPage,refetch:n.refetch}}var Xe=require("react");var oe=require("react"),$e=W(require("uplot"));var Q=W(require("uplot")),Be=require("@unblind/units");var z=require("@unblind/units");var k={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:24192e5,year:31536e6},j={second:[1,2,5,10,15,30],minute:[1,2,5,10,15,30],hour:[1,2,3,4,6,8,12],day:[1,2,3,7,14],month:[1,2,3,6],year:[1,2,5,10,20,50,100]};function lt(e,t,o,i){if(t>7*k.day){let r=z.systemDateFormats.interval.year,l=Math.round(k.year/k.day)*k.day;return Math.round(t/k.day)*k.day===l?r=z.systemDateFormats.interval.year:t<=k.year?r=z.systemDateFormats.interval.month:r=z.systemDateFormats.interval.day,e.map(n=>(0,z.dateTimeFormat)(n,{format:r,timeZone:i}))}return e.map(r=>{let l=new Date(r),s=t<k.minute,n=t<k.second,u=l.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:i});return(u==="00:00"||u==="24:00")&&!s&&!n?l.toLocaleDateString(void 0,{day:"2-digit",month:"short",timeZone:i}):l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:s?"2-digit":void 0,fractionalSecondDigits:n?3:void 0,hour12:!1,timeZone:i})})}function Se(e){let t=[{size:k.second/1e3,increments:j.second},{size:k.minute/1e3,increments:j.minute},{size:k.hour/1e3,increments:j.hour},{size:k.day/1e3,increments:j.day},{size:k.month/1e3,increments:j.month},{size:k.year/1e3,increments:j.year}];for(let r of t)for(let l of r.increments){let s=r.size*l;if(s>=e)return{increment:s*1e3,multiplier:l}}let o=t[t.length-1],i=o.increments[o.increments.length-1];return{increment:o.size*i*1e3,multiplier:i}}function Ae(e,t,o){return[t,o]}function ut(e,t,o,i){let r=o-t,l=e.width,s=Math.floor(l/100),n=r/s,{increment:u,multiplier:a}=Se(n),m=u/1e3,d=[];if(r<12*3600){let c=Math.ceil(t/m)*m;for(;c<=o;c+=m)d.push(c);return d}if(r<3*86400){if(u>=6*3600*1e3){let b=u/1e3/3600,h=new Date(t*1e3);if(i==="UTC"){let f=h.getUTCHours(),T=Math.floor(f/b)*b;h.setUTCHours(T,0,0,0)}else{let f=h.getHours(),T=Math.floor(f/b)*b;h.setHours(T,0,0,0)}let g=h.getTime()/1e3;for(g<t&&(g+=m);g<=o;)d.push(g),g+=m;return d}let c=Math.ceil(t/m)*m;for(;c<=o;c+=m)d.push(c);return d}if(u>=k.day){let c=new Date(t*1e3);i==="UTC"?(c.setUTCHours(0,0,0,0),c.getTime()/1e3<t&&c.setUTCDate(c.getUTCDate()+a)):(c.setHours(0,0,0,0),c.getTime()/1e3<t&&c.setDate(c.getDate()+a));let b=c.getTime()/1e3;for(;b<=o;)d.push(b),i==="UTC"?c.setUTCDate(c.getUTCDate()+a):c.setDate(c.getDate()+a),b=c.getTime()/1e3;return d}let p=Math.ceil(t/m)*m;for(;p<=o;p+=m)d.push(p);return d}function Re(e,t,o){return t.length===0?[]:t.map((i,r)=>r===0||r===t.length-1?(0,z.dateTimeFormatTimeAgo)(i*1e3,{timeZone:o}):"")}function ct(e,t,o){let i=e.scales.x,r=((i?.max??0)-(i?.min??0))*1e3,l=Math.floor(e.width/100),s=r/1e3/l,{increment:n}=Se(s),u=t.map(a=>a*1e3);return lt(u,n,r,o)}function Me(e,t,o=!1){let i=o?(s,n,u,a)=>Ae(s,u,a):(s,n,u,a)=>ut(s,u,a,t),r=o?(s,n)=>Re(s,n,t):(s,n)=>ct(s,n,t),l=o?(s,n,u,a,m)=>{let p=document.createElement("canvas").getContext("2d");if(!p)return 0;p.font=K(e);let c=Re(s,Ae(s,u,a),t),b=Math.max(p.measureText(c[0]||"").width,p.measureText(c[1]||"").width);return Math.ceil(b/2)+15}:void 0;return{font:K(e),labelFont:K(e),grid:{show:!1,width:.5},ticks:{width:.5},splits:i,values:r,size:20}}var Oe=W(require("uplot"));var G=require("@floating-ui/dom"),Ee=require("react-dom/client"),pt=4,mt=8,le=class{overlay=null;reactRoot=null;renderedUplot=null;initialize(){this.overlay||(this.overlay=document.createElement("div"),this.overlay.id="unblind-tooltip-overlay",this.overlay.style.display="none",this.overlay.style.position="fixed",this.overlay.style.pointerEvents="none",this.overlay.style.zIndex="9999",document.body.appendChild(this.overlay),this.reactRoot=(0,Ee.createRoot)(this.overlay))}getOverlay(){return this.overlay}render(t,o){this.reactRoot?(this.reactRoot.render(o),this.renderedUplot=t):this.renderedUplot=null}show(){this.overlay&&(this.overlay.style.display="block")}hide(t){if(t!==this.renderedUplot){console.warn("Hide call plot");return}this.overlay&&(this.overlay.style.display="none"),this.render(null,null)}getRenderedUplot(){return this.renderedUplot}async positionTooltip(t){let o=this.getOverlay();if(o){let{x:i,y:r}=await(0,G.computePosition)({getBoundingClientRect:()=>({x:t.left,y:t.top,width:0,height:0,top:t.top,left:t.left,right:t.left,bottom:t.top})},o,{placement:"top-start",strategy:"fixed",middleware:[(0,G.offset)({mainAxis:pt,crossAxis:mt}),(0,G.flip)()]});o.style.left=`${i}px`,o.style.top=`${r}px`}}},E=new le;var ue=require("@unblind/units"),ce=require("react");var y=require("react/jsx-runtime");function ze(e){return e.metric.displayName||e.metric.name||(typeof e.serie.label=="string"?e.serie.label:e.serie.label?.textContent||"Unknown")}function Le(e){let t=e.attributes||{};if(t["service.name"])return String(t["service.name"]);let i=Object.keys(t)[0];return i?String(t[i]):"z-fallback"}function Ne(e){return[...e].sort((t,o)=>(Number(o.value)||0)-(Number(t.value)||0))}function Ie(e){return[...e].sort((t,o)=>Le(t).localeCompare(Le(o)))}function dt(e){let t={};return e.forEach(o=>{let i=ze(o);t[i]||(t[i]=[]),t[i].push(o)}),t}function ft(e,t,o,i="original"){if(o==="flat")return[{label:"",items:t?Ne(e):Ie(e)}];let r=dt(e);return Object.keys(r).sort((s,n)=>s.localeCompare(n)).map(s=>{let n=r[s];if(!n)return{label:te(s,i),items:[]};let u=t?Ne(n):Ie(n);return{label:te(s,i),items:u}})}function te(e,t,o){switch(t){case"suffix":{let i=e.split(/[._-]/),r=i[i.length-1]||"";return o?r:r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()}case"title":return e.split(/[._-]/).map(i=>o?i:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ");default:return e}}function bt(e,t){if(t&&t!=="auto")return t;let o=e.some(r=>r.attributes&&Object.keys(r.attributes).length>0),i=new Set(e.map(ze));return o&&i.size>=1?"group-by-metric":"flat"}function De({hideAttributeKey:e,attribute:t,format:o,isLastAttribute:i}){let[r,l]=t;return(0,y.jsxs)("div",{className:"ub-tooltip-item-attribute-container",children:[(0,y.jsxs)("div",{className:e?"ub-tooltip-item-hidden-attribute-key":"ub-tooltip-item-attribute-with-key",children:[!e&&(0,y.jsxs)("span",{className:"ub-tooltip-item-attribute-key",children:[te(r,o),":"]}),(0,y.jsx)("span",{className:"ub-tooltip-item-attribute-value",children:l})]}),!i&&e&&(0,y.jsx)("span",{"data-text":", ",className:"ub-tooltip-item-attribute-divider"})]})}function gt({item:e,hideMetric:t,hideAttributeKey:o,hideAttributes:i,format:r}){let s=Object.entries(e.attributes||{}),n=s.length>0&&!i;return i&&t&&console.warn("Invalid configuration. Attributes and metrics are hidden."),(0,y.jsxs)("div",{className:"ub-tooltip-item-row",children:[(0,y.jsxs)("div",{className:"ub-tooltip-item-left"+(t?" ub-tooltip-item-hidden-metric":""),children:[(0,y.jsxs)("div",{className:"ub-tooltip-item-heading",children:[(0,y.jsx)("span",{className:"ub-tooltip-item-dot",style:{backgroundColor:e.color}}),t?(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:s.map((u,a)=>(0,y.jsx)(De,{hideAttributeKey:o,attribute:u,format:r,isLastAttribute:a>=s.length-1},"attr_"+u[0]))}):(0,y.jsx)("span",{className:n?"ub-tooltip-item-metric-name-label":"ub-tooltip-item-metric-name",children:te(e.metric.name,r)})]}),n&&!t&&(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:s.map((u,a)=>(0,y.jsx)(De,{hideAttributeKey:o,attribute:u,format:r,isLastAttribute:a>=s.length-1},"attr_"+u[0]))})]}),(0,y.jsx)("div",{className:"ub-tooltip-item-value",children:e.formattedValue??(0,y.jsx)("span",{className:"ub-tooltip-item-value--empty",children:"\u2014"})})]})}function ht({className:e="ub-tooltip-divider",...t}){return(0,y.jsx)("hr",{role:"presentation",...t,className:e})}function yt({group:e,groupIdx:t,hideAttributeKey:o,hideMetric:i,hideAttributes:r,format:l,hideGroupLabel:s}){return(0,y.jsxs)("div",{className:"ub-tooltip-group",children:[!s&&(0,y.jsx)("div",{className:`ub-tooltip-group-header${t>0?" ub-tooltip-group-header--separator":""}`,children:e.label}),(0,y.jsx)("div",{className:"ub-tooltip-items",children:e.items.map((n,u)=>(0,y.jsx)(gt,{item:n,format:l,hideAttributeKey:o,hideMetric:i,hideAttributes:r},`item-${t}-${u}`))})]},e.label)}function Ve({timestamp:e,items:t,timeZone:o,spansMultipleDays:i,sortByValues:r,format:l="original",layout:s="flat",hideAttributeKey:n,hideMetric:u,hideAttributes:a}){let m=i?(0,ue.dateTimeFormat)(e*1e3,{format:"MMM DD, HH:mm",timeZone:o}):(0,ue.dateTimeFormat)(e*1e3,{format:"HH:mm",timeZone:o}),d=(0,ce.useMemo)(()=>bt(t,s),[t,s]),p=d==="flat",b=typeof u=="boolean"?u:d==="group-by-metric",h=typeof n=="boolean"?n:!1,g=typeof a=="boolean"?a:!1,f=(0,ce.useMemo)(()=>ft(t,r,d,l),[t,r,d,l]);return(0,y.jsxs)("div",{className:"ub-tooltip",children:[(0,y.jsx)("div",{className:"ub-tooltip-datetime",children:m}),(0,y.jsx)(ht,{}),f.length>0?(0,y.jsx)("div",{className:"ub-tooltip-content",children:f.map((T,v)=>(0,y.jsx)(yt,{group:T,groupIdx:v,hideAttributeKey:h,hideMetric:b,hideAttributes:g,hideGroupLabel:p,format:l},T.label))}):(0,y.jsx)("div",{className:"ub-tooltip-no-data",children:"No data available"})]})}var pe=require("react/jsx-runtime");function vt(e,t){if(!e||e.length===0)return!1;let o=e[0],i=e[e.length-1];if(o==null||i==null)return!1;let r=new Date(o*1e3),l=new Date(i*1e3),s=n=>t==="UTC"?`${n.getUTCFullYear()}-${n.getUTCMonth()}-${n.getUTCDate()}`:n.toLocaleDateString(void 0,{timeZone:t});return s(r)!==s(l)}function Tt(e,t){let o=!1;for(let r=1;r<e.series.length;r++)if(e.data[r]?.[t]!=null){o=!0;break}if(o)return t;let i=e.data[0].length;for(let r=1;t+r<i||t-r>=0;r++){let l=t-r,s=t+r;if(l>=0){for(let n=1;n<e.series.length;n++)if(e.data[n]?.[l]!=null)return l}if(s<i){for(let n=1;n<e.series.length;n++)if(e.data[n]?.[s]!=null)return s}}return t}function xt(e,t,o,i,r,l){let s=!1,n=[];for(let u=1;u<e.series.length;u++){let a=e.data[u]?.[t]??null;if(i&&a!=null&&u>1){let g=e.data[u-1]?.[t]??0;a=a-g}let m=e.series[u],d=l?.[u-1];if(!d){console.warn("Original serie not found");continue}let p=r[d.metric];if(!p){console.warn("Metric metadata not found");continue}let c=m?.stroke,b=typeof c=="function"?c(Oe.default,u):c??"#ffffff00",h=a==null?void 0:o?o(a):String(a);d?.attributes&&Object.keys(d?.attributes).length>0&&(s=!0),n.push({metric:p,color:b,value:a===null?void 0:a,formattedValue:h,attributes:d?.attributes,serie:m})}return{items:n,hasAttributes:s}}function Fe(e,t,o,i,r,l,s,n,u,a,m,d){let p,c,b,h=!1;function g(){let f=p.getBoundingClientRect();c=f.left,b=f.top}return{hooks:{init:f=>{E.initialize(),p=f.over,window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),p.onmouseenter=()=>{h=!0,E.show()},p.onmouseleave=()=>{h=!1,E.getRenderedUplot()===f&&E.hide(f)},g()},setSize:()=>{g()},setCursor:f=>{let{left:T,top:v,idx:C}=f.cursor;if(!h||C==null){E.getRenderedUplot()===f&&E.hide(f);return}let P=f.data[0],w=vt(P,r),S=Tt(f,C),M=f.data[0][S];if(M===void 0)return;let{items:U}=xt(f,S,e,t,o,s);E.show();let x=l,R=x?(0,pe.jsx)(x,{timestamp:M,items:U,timeZone:r}):(0,pe.jsx)(Ve,{timestamp:M,items:U,timeZone:r,spansMultipleDays:w,stacked:t,sortByValues:i,layout:n,format:u,hideAttributeKey:a,hideAttributes:m,hideMetric:d});E.render(f,R),E.positionTooltip({left:(T||0)+c,top:(v||0)+b})},destroy(f){window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),p&&(p.onmouseenter=null,p.onmouseleave=null),E.getRenderedUplot()===f&&E.hide(f)}}}}var K=e=>`${getComputedStyle(document.documentElement).getPropertyValue("--ub-chart-font-size").trim()} ${e}`,Ke=(e,t)=>{let o=e;return t&&t.unit&&t.unit.code&&t.unit.code!=="1"&&(!o&&t.unit?o=t.unit.code:o&&t.unit.code!==o&&(o=void 0)),o};function Ct(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Array.isArray(e.fill)&&Array.isArray(e.border)}function Pt(e){return Array.isArray(e)}var He=(e,t,o,i,r)=>Pt(o)?r&&(i==="step"||i==="line"||i==="spline")?o[t]+"66":o[t]:Ct(o)?r?o.fill[t]:o.border[t]:o(e,t,i,r),wt=e=>{let t=Q.default.paths.bars({size:[.6,100],radius:0,gap:0}),o=Q.default.paths.linear({alignGaps:0}),i=Q.default.paths.spline({alignGaps:1}),r=Q.default.paths.stepped({alignGaps:1});switch(e){case"line":return o;case"bar":return t;case"area":return o;case"step":return r;case"spline":return i;default:return o}},Ut=(e,t,o,i)=>He(e,t,o,i,!0),kt=(e,t)=>{switch(e){case"bar":return 1;case"line":return t?1.5:2;case"spline":return t?1.5:2;case"area":return 1;case"step":return 1.5;default:return 1}},At=(e,t,o)=>{if(t<0||o<0)return[t,o];let i=e.posToVal(t,"x"),r=e.data[0];if(!r||r.length===0)return[t,o];let l=0,s=0,n=r.length-1;for(;n-s>1;){let c=Math.floor((s+n)/2),b=r[c];b!=null&&b<i?s=c:n=c}let u=r[s],a=r[n];u!=null&&a!=null?l=Math.abs(u-i)<Math.abs(a-i)?s:n:u!=null?l=s:a!=null&&(l=n);let m=l;for(let c=l;c>=0;c--){let b=!1;for(let h=1;h<e.data.length;h++){let g=e.data[h];if(g&&g[c]!=null){b=!0;break}}if(b){m=c;break}}let d=r[m];return d==null?[t,o]:[e.valToPos(d,"x"),o]},qe=(e,t,o,i,r,l,s,n,u,a,m,d,p,c,b,h,g)=>{let f=window.getComputedStyle(e),T=f.fontFamily,v=f.getPropertyValue("--ub-chart-font-color").trim(),C=f.getPropertyValue("--ub-chart-grid-color").trim(),A=e?.clientWidth??1050,P=e?.clientHeight??250,w=typeof o=="string"?String(o).toLowerCase().replaceAll("by","bytes"):o,S=(0,Be.getValueFormat)(w==="1"?null:w),M=kt(r,n),U={width:A,height:P,scales:{y:{range:je(o)}},plugins:[Fe(L=>{let _=S(L,Number.isInteger(L)?0:2);return _.text+(_.suffix?.trim()||"")},l,t,u,a,m,i,c,p,b,h,g)],padding:d?[10,15,10,15]:[8,15,8,15],cursor:{y:!1,sync:{key:"_"},drag:{setScale:!0,x:!0,y:!1},move:At},series:[{},...i.map((L,_)=>({label:L.metric,stroke:He(L,_,s,r),width:M,points:{show:!1},spanGaps:!0,paths:wt(r),fill:n||l?Ut(L,_,s,r):void 0}))],axes:[Me(T,a,d),Ge(S,T)],legend:{show:!1}},x=U.axes?.[0],R=U.axes?.[1];return x&&(x.stroke=v,x.grid?x.grid.stroke=C:x.grid={stroke:C}),R&&(R.stroke=v,R.grid?R.grid.stroke=C:R.grid={stroke:C}),U};var _e=(e,t=4)=>{let o=e/t,i=Math.pow(10,Math.floor(Math.log10(o))),r=o/i,l;return r>5?l=10*i:r>2?l=5*i:r>1?l=2*i:l=i,Math.ceil(e/l)*l},je=e=>(t,o,i)=>{if(o===0&&i===0)return[0,100];let r=1,l=i*(1+r),s=o<0?o*(1+r):o*(1-r);if(e==="percent"||e==="percentunit")return i>100?o<0?[s,l]:[0,l]:o<0?[s,100]:[0,100];if(i<=.9999)return o<=0?[s,1]:[0,1];let n=_e(l),u=_e(Math.abs(s));return o<0?[-u,n]:[0,n]},Rt=(e,t,o,i)=>{let r=e.axes[o];if(i>1)return r?._size;let l=(r?.ticks?.size||0)+(r?.gap||0),s=(t??[]).reduce((n,u)=>u.length>n.length?u:n,"");return s!=""&&(e.ctx.font=r?.font?.[0]??e.ctx.font,l+=e.ctx.measureText(s).width/devicePixelRatio),Math.ceil(l)};function Ge(e,t){return{gap:0,font:K(t),labelFont:K(t),grid:{show:!0,width:.5},ticks:{width:.5},values:(o,i)=>i.map(r=>{let l=e(r);return l.text+(l.suffix?.trim()||"")}),size:Rt}}function Qe(e,t){let o=[],i=e[0],r=i.length,l=Array(r).fill(0),s=[i];return e.forEach((n,u)=>{u!==0&&(t?s.push(n):s.push(n.map((a,m)=>l[m]=l[m]+(a||0))))}),e.forEach((n,u)=>{u===0||t||o.push({series:[e.findIndex((a,m)=>m>u),u]})}),{data:s,bands:o.filter(n=>n.series[1]>-1)}}var We=require("react/jsx-runtime");function re(e){let{times:t,series:o,metadata:i,type:r,className:l,timeZone:s,options:n,tooltip:u,colors:a,tooltipAppearance:m,sortByValues:d=!1,unit:p,fill:c=!1}=e,{layout:b,format:h,hideAttributeKey:g,hideAttributes:f,hideMetric:T}=u||{},v=(0,oe.useRef)(null),C=B(),A=a||C.appearance.colors;return(0,oe.useEffect)(()=>{if(!o||o.length===0){console.warn("No series provided");return}let P=[t],w=p;o.forEach(R=>{let L=i[R.metric];p||(w=Ke(w,L)),P.push(R.values)});let S=r==="bar"||r==="area",M=Qe(P,!S),U=v.current,x=null;if(U){let R=qe(U,i,w,o,r,S,A,c,d,s,m,!1,h,b,g,f,T);R.bands=M.bands,x=new $e.default({...R,...n},M.data,U);let L=new ResizeObserver(()=>{x?.setSize({width:U.clientWidth,height:U.clientHeight})});return L.observe(U),()=>{x?.destroy(),L.disconnect()}}},[o,t,r,i,s,m,A,c,d,p,h,b,g,f,T]),(0,We.jsx)("div",{ref:v,className:"ub-chart-container"+(l?` ${l}`:"")})}var O=require("react/jsx-runtime");function Ye({metrics:e,operator:t,attributes:o,groupBy:i,interval:r,type:l="line",className:s,appearance:n,unit:u}){let a=B(),m=r??a.interval,d=o??a.attributes,p=i??a.groupBy,c=t??a.operator,b=n?.colors??a.appearance.colors,h=typeof n?.sortByValues=="boolean"?n?.sortByValues:a.appearance.sortByValues,g=typeof n?.fill=="boolean"?n.fill:a.appearance.fill,f=n?.components?.Tooltip??a.appearance.components.Tooltip,T=(0,Xe.useMemo)(()=>({layout:n?.tooltip?.layout??a.appearance.tooltip?.layout,format:n?.tooltip?.format??a.appearance.tooltip?.format,hideAttributes:n?.tooltip?.hideAttributes??a.appearance.tooltip?.hideAttributes,hideAttributeKey:n?.tooltip?.hideAttributeKey??a.appearance.tooltip?.hideAttributeKey,hideMetric:n?.tooltip?.hideMetric??a.appearance.tooltip?.hideMetric}),[n?.tooltip?.layout,n?.tooltip?.format,n?.tooltip?.hideAttributes,n?.tooltip?.hideAttributeKey,n?.tooltip?.hideMetric,a.appearance.tooltip?.layout,a.appearance.tooltip?.format,a.appearance.tooltip?.hideAttributes,a.appearance.tooltip?.hideAttributeKey,a.appearance.tooltip?.hideMetric]),{isLoading:v,data:C,hasError:A}=ee({queries:(Array.isArray(e)?e:[e]).map(x=>({metrics:[x],operator:c,attributes:d,groupBy:p})),timeRange:a.timeRange,startTime:a.startTime,endTime:a.endTime,interval:m}),{series:P,times:w,metadata:S}=C,M=P.every(x=>x.isEmpty),U=`ub-chart-container${s?` ${s}`:""}`;if(v){let x=n?.components?.Loading??a.appearance.components.Loading;return(0,O.jsx)("div",{className:U,children:(0,O.jsx)(x,{})})}if(M){let x=n?.components?.Empty??a.appearance.components.Empty;return(0,O.jsx)("div",{className:U,children:(0,O.jsx)(x,{})})}if(A){let x=n?.components?.Error??a.appearance.components.Error;return(0,O.jsx)("div",{className:U,children:(0,O.jsx)(x,{})})}return(0,O.jsx)(re,{times:w,series:P,metadata:S,type:l,className:U,tooltip:T,colors:b,sortByValues:h,unit:u,fill:g,tooltipAppearance:f})}0&&(module.exports={Chart,Empty,Error,Loading,TimeseriesChart,UnblindProvider,UnblindScope,useLogs,useMetrics,useRefresh,useScope,useTimeseries,useUsage});
|
|
1
|
+
"use strict";var it=Object.create;var J=Object.defineProperty;var nt=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var ut=(e,t)=>{for(var r in t)J(e,r,{get:t[r],enumerable:!0})},ye=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of at(t))!lt.call(e,o)&&o!==r&&J(e,o,{get:()=>t[o],enumerable:!(i=nt(t,o))||i.enumerable});return e};var Z=(e,t,r)=>(r=e!=null?it(st(e)):{},ye(t||!e||!e.__esModule?J(r,"default",{value:e,enumerable:!0}):r,e)),ct=e=>ye(J({},"__esModule",{value:!0}),e);var Gt={};ut(Gt,{Chart:()=>ue,Empty:()=>ee,Error:()=>te,Loading:()=>re,Timeseries:()=>ot,UnblindProvider:()=>Ce,UnblindScope:()=>oe,useLogs:()=>Ee,useMetrics:()=>ke,useRefresh:()=>pe,useScope:()=>G,useTimeseries:()=>ie,useUsage:()=>Ue});module.exports=ct(Gt);var q=require("@tanstack/react-query"),V=require("react"),ce=require("react/jsx-runtime"),Te=(0,V.createContext)(void 0);function ve({children:e,queryClient:t,queryClientConfig:r,apiBaseUrl:i="/api/unblind",fetchImpl:o}){let s=(0,V.useMemo)(()=>{if(t)return t;let n={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1},l={defaultOptions:{queries:n}};return r?new q.QueryClient({...r,defaultOptions:{...r.defaultOptions,queries:{...n,...r.defaultOptions?.queries}}}):new q.QueryClient(l)},[t,r]),a=(0,V.useMemo)(()=>({apiBaseUrl:i,fetchImpl:o}),[i,o]);return(0,ce.jsx)(q.QueryClientProvider,{client:s,children:(0,ce.jsx)(Te.Provider,{value:a,children:e})})}function O(){let e=(0,V.useContext)(Te);if(!e)throw new Error("useUnblindConfig must be used within an UnblindClientProvider. Please wrap your app or component tree with <UnblindClientProvider>.");return e}function pe(){let e=(0,q.useQueryClient)();return(0,V.useCallback)(async()=>{await e.refetchQueries({queryKey:["unblind","timeseries"]})},[e])}var B=require("react");var I=require("react/jsx-runtime");function ee(){return(0,I.jsx)("div",{className:"ub-default",children:(0,I.jsxs)("div",{className:"ub-empty-content",children:[(0,I.jsx)("div",{className:"ub-empty-icon-wrapper",children:(0,I.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"ub-icon",children:(0,I.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}),(0,I.jsx)("p",{className:"ub-empty-text","data-text":"No data available for this time range"})]})})}function te(){return(0,I.jsx)("div",{className:"ub-error"})}function re(){return(0,I.jsx)("div",{className:"ub-default","data-text":"Loading"})}var xe=require("react/jsx-runtime"),me=(0,B.createContext)(void 0);function oe({children:e,timeRange:t,startTime:r,endTime:i,interval:o,attributes:s,groupBy:a,operator:n,appearance:l}){let u=(0,B.useContext)(me),m=l?.components?.Loading,d=l?.components?.Error,c=l?.components?.Tooltip,p=l?.tooltip?.layout,h=l?.tooltip?.format,g=l?.tooltip?.hideAttributes,b=l?.tooltip?.hideAttributeKey,f=l?.tooltip?.hideMetric,v=(0,B.useMemo)(()=>({components:{...m&&{Loading:m},...d&&{Error:d},...c&&{Tooltip:c}},tooltip:{layout:p,format:h,hideAttributes:g,hideAttributeKey:b,hideMetric:f}}),[m,d,c,p,h,g,b,f]),T=(0,B.useMemo)(()=>({timeRange:t??u?.timeRange,startTime:r??u?.startTime,endTime:i??u?.endTime,interval:o??u?.interval,attributes:s??u?.attributes,groupBy:a??u?.groupBy,operator:n??u?.operator,appearance:v??u?.appearance}),[t,r,i,o,s,a,n,v,u]);return(0,xe.jsx)(me.Provider,{value:T,children:e})}var pt="6h";function G(){let e=(0,B.useContext)(me);return{timeRange:e?.timeRange||pt,startTime:e?.startTime,endTime:e?.endTime,interval:e?.interval,attributes:e?.attributes,groupBy:e?.groupBy,operator:e?.operator,appearance:{components:{Loading:e?.appearance?.components?.Loading??re,Error:e?.appearance?.components?.Error??te,Empty:e?.appearance?.components?.Empty??ee,Tooltip:e?.appearance?.components?.Tooltip},colors:e?.appearance?.colors,tooltip:e?.appearance?.tooltip}}}var de=require("react/jsx-runtime");function Ce({children:e,queryClient:t,apiBaseUrl:r,fetchImpl:i,timeRange:o,startTime:s,endTime:a,interval:n,attributes:l,groupBy:u,operator:m,appearance:d}){return(0,de.jsx)(ve,{queryClient:t,apiBaseUrl:r,fetchImpl:i,children:(0,de.jsx)(oe,{timeRange:o,startTime:s,endTime:a,interval:n,attributes:l,groupBy:u,operator:m,appearance:d,children:e})})}var Pe=require("@tanstack/react-query");function ke(){let{apiBaseUrl:e,fetchImpl:t=fetch}=O(),r=(0,Pe.useQuery)({queryKey:["unblind","metrics"],queryFn:async()=>{let i=await t(`${e}/metrics`,{headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error("Error loading metrics metadata");if(i.status===200){let{data:o}=await i.json();return o}else throw new Error("Unexpected status code")}});return{metrics:r.data,isLoading:r.isLoading,hasError:r.isError,refetch:r.refetch}}var Ae=require("@tanstack/react-query"),j=require("react");var we=Z(require("ms"));function mt(e){let t=Math.floor(Date.now()/1e3);return[t-Math.floor((0,we.default)(e)/1e3),t]}function _(e,t,r){let i,o;if(typeof t=="number"&&typeof r=="number")i=t,o=r;else if(e){let[s,a]=mt(e);i=s,o=a}else throw new Error("Either timeRange or both startTime and endTime must be provided");return[i,o]}function ie({queries:e,timeRange:t,startTime:r,endTime:i,interval:o}){let{apiBaseUrl:s,fetchImpl:a=fetch}=O(),n=(0,j.useMemo)(()=>e.map(T=>T.metrics.join(",")).join(","),[e]),l=(0,j.useMemo)(()=>e.map(T=>{let C=T.attributes;if(!C)return"";let k=Object.keys(C);return k.length===0?"":k.map(x=>x+":"+C[x]?.join(",")).join(",")}).join(","),[e]),u=(0,j.useMemo)(()=>e.map(T=>T.operator),[e]),m=(0,j.useMemo)(()=>e.map(T=>T.groupBy).join(", "),[e]),c=(0,Ae.useQuery)({queryKey:["unblind","timeseries",n,l,r,i,t,o,u,m],queryFn:async()=>{if(!n)throw new Error("Missing required parameters");if(n.length===0)throw new Error("No series provided");let[T,C]=_(t,r,i),k={queries:e,startTime:T,endTime:C,interval:o},x=await a(`${s}/tenants/timeseries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});if(!x.ok)throw new Error("Error fetching metric");let{series:R,times:M,metadata:w}=await x.json();if(!R)throw console.error("Series not found"),new Error("Series not found");return{series:R,times:M,metadata:w}},enabled:!!n&&(typeof r=="number"&&typeof i=="number"||!!t)}),{metadata:p,series:h,times:g}=(0,j.useMemo)(()=>c.data?{series:c.data.series,times:c.data.times,metadata:c.data.metadata}:{series:[],times:[],metadata:{}},[c]),b=c.isLoading,f=c.isFetching,v=c.isError;return{data:{series:h,times:g,metadata:p},isLoading:b,isFetching:f,hasError:v,refetch:c.refetch}}var Se=require("@tanstack/react-query"),Re=require("react");function Ue({timeRange:e,startTime:t,endTime:r}){let{apiBaseUrl:i,fetchImpl:o=fetch}=O(),a=(0,Se.useQuery)({queryKey:["unblind","usage",e,t,r],queryFn:async()=>{let[m,d]=_(e,t,r),c=`${i}/tenants/usage`,p=await o(c,{headers:{"Content-Type":"application/json"},body:JSON.stringify({startTime:m,endTime:d})});if(!p.ok)throw new Error("Error fetching usage");let{data:h}=await p.json();if(!h)throw new Error("usage not found");return h},enabled:typeof t=="number"&&typeof r=="number"||!!e}),n=(0,Re.useMemo)(()=>a.data?a.data||[]:[],[a]),l=a.isLoading||a.isRefetching,u=a.isError;return{usage:n,isLoading:l,hasError:u,refetch:a.refetch}}var Le=require("@tanstack/react-query"),Me=require("react");function Ee({timeRange:e,filters:t,startTime:r,endTime:i}){let{apiBaseUrl:o,fetchImpl:s=fetch}=O(),a=typeof r=="number"&&typeof i=="number"||!!e,n=(0,Le.useInfiniteQuery)({queryKey:["unblind","logs",e,t.map(u=>u.name+":"+u.value).sort().join(",")],queryFn:async({pageParam:u})=>{let m=t.reduce((x,R)=>(x[R.name]||(x[R.name]=[]),x[R.name].push(R.value),x),{}),{body:d=[],severity:c=[],"service.name":p=[],"trace.id":h=[],"span.id":g=[],...b}=m,[f,v]=_(e,r,i),T=await s(`${o}/tenants/logs`,{method:"POST",body:JSON.stringify({filter:{attributes:b,body:d,severity:c,traceId:h,spanId:g,service:p},startTime:f,endTime:v,pagination:{page:u}}),headers:{"Content-Type":"application/json"}});if(!T.ok)throw new Error("Error fetching logs");let{data:C,next_page:k}=await T.json();if(!C)throw new Error("logs not found");return{data:C,next_page:k}},enabled:a,initialPageParam:void 0,getNextPageParam:u=>u.next_page});return{logs:(0,Me.useMemo)(()=>n.data?n.data.pages.flatMap(u=>u.data||[]):[],[n.data]),isLoading:n.isLoading,hasError:n.isError,hasNextPage:n.hasNextPage??!1,fetchNextPage:n.fetchNextPage,isFetchingNextPage:n.isFetchingNextPage,refetch:n.refetch}}var rt=require("react");var le=require("react"),et=Z(require("uplot"));var ne=e=>"value"in e,W=e=>"from"in e&&"to"in e;var X=Z(require("uplot")),je=require("@unblind/units");var z=require("@unblind/units");var S={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:24192e5,year:31536e6},$={second:[1,2,5,10,15,30],minute:[1,2,5,10,15,30],hour:[1,2,3,4,6,8,12],day:[1,2,3,7,14],month:[1,2,3,6],year:[1,2,5,10,20,50,100]};function dt(e,t,r,i){if(t>7*S.day){let o=z.systemDateFormats.interval.year,s=Math.round(S.year/S.day)*S.day;return Math.round(t/S.day)*S.day===s?o=z.systemDateFormats.interval.year:t<=S.year?o=z.systemDateFormats.interval.month:o=z.systemDateFormats.interval.day,e.map(n=>(0,z.dateTimeFormat)(n,{format:o,timeZone:i}))}return e.map(o=>{let s=new Date(o),a=t<S.minute,n=t<S.second,l=s.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:i});return(l==="00:00"||l==="24:00")&&!a&&!n?s.toLocaleDateString(void 0,{day:"2-digit",month:"short",timeZone:i}):s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:a?"2-digit":void 0,fractionalSecondDigits:n?3:void 0,hour12:!1,timeZone:i})})}function De(e){let t=[{size:S.second/1e3,increments:$.second},{size:S.minute/1e3,increments:$.minute},{size:S.hour/1e3,increments:$.hour},{size:S.day/1e3,increments:$.day},{size:S.month/1e3,increments:$.month},{size:S.year/1e3,increments:$.year}];for(let o of t)for(let s of o.increments){let a=o.size*s;if(a>=e)return{increment:a*1e3,multiplier:s}}let r=t[t.length-1],i=r.increments[r.increments.length-1];return{increment:r.size*i*1e3,multiplier:i}}function Ne(e,t,r){return[t,r]}function ht(e,t,r,i){let o=r-t,s=e.width,a=Math.floor(s/100),n=o/a,{increment:l,multiplier:u}=De(n),m=l/1e3,d=[];if(o<12*3600){let p=Math.ceil(t/m)*m;for(;p<=r;p+=m)d.push(p);return d}if(o<3*86400){if(l>=6*3600*1e3){let h=l/1e3/3600,g=new Date(t*1e3);if(i==="UTC"){let f=g.getUTCHours(),v=Math.floor(f/h)*h;g.setUTCHours(v,0,0,0)}else{let f=g.getHours(),v=Math.floor(f/h)*h;g.setHours(v,0,0,0)}let b=g.getTime()/1e3;for(b<t&&(b+=m);b<=r;)d.push(b),b+=m;return d}let p=Math.ceil(t/m)*m;for(;p<=r;p+=m)d.push(p);return d}if(l>=S.day){let p=new Date(t*1e3);i==="UTC"?(p.setUTCHours(0,0,0,0),p.getTime()/1e3<t&&p.setUTCDate(p.getUTCDate()+u)):(p.setHours(0,0,0,0),p.getTime()/1e3<t&&p.setDate(p.getDate()+u));let h=p.getTime()/1e3;for(;h<=r;)d.push(h),i==="UTC"?p.setUTCDate(p.getUTCDate()+u):p.setDate(p.getDate()+u),h=p.getTime()/1e3;return d}let c=Math.ceil(t/m)*m;for(;c<=r;c+=m)d.push(c);return d}function Ie(e,t,r){return t.length===0?[]:t.map((i,o)=>o===0||o===t.length-1?(0,z.dateTimeFormatTimeAgo)(i*1e3,{timeZone:r}):"")}function ft(e,t,r){let i=e.scales.x,o=((i?.max??0)-(i?.min??0))*1e3,s=Math.floor(e.width/100),a=o/1e3/s,{increment:n}=De(a),l=t.map(u=>u*1e3);return dt(l,n,o,r)}function Ve(e,t,r=!1){let i=r?(a,n,l,u)=>Ne(a,l,u):(a,n,l,u)=>ht(a,l,u,t),o=r?(a,n)=>Ie(a,n,t):(a,n)=>ft(a,n,t),s=r?(a,n,l,u,m)=>{let c=document.createElement("canvas").getContext("2d");if(!c)return 0;c.font=H(e);let p=Ie(a,Ne(a,l,u),t),h=Math.max(c.measureText(p[0]||"").width,c.measureText(p[1]||"").width);return Math.ceil(h/2)+15}:void 0;return{font:H(e),labelFont:H(e),grid:{show:!1,width:.5},ticks:{width:.5},splits:i,values:o,size:20}}var He=Z(require("uplot"));var Q=require("@floating-ui/dom"),Oe=require("react-dom/client"),bt=4,gt=8,he=class{overlay=null;reactRoot=null;renderedUplot=null;initialize(){this.overlay||(this.overlay=document.createElement("div"),this.overlay.id="unblind-tooltip-overlay",this.overlay.style.display="none",this.overlay.style.position="fixed",this.overlay.style.pointerEvents="none",this.overlay.style.zIndex="9999",document.body.appendChild(this.overlay),this.reactRoot=(0,Oe.createRoot)(this.overlay))}getOverlay(){return this.overlay}render(t,r){this.reactRoot?(this.reactRoot.render(r),this.renderedUplot=t):this.renderedUplot=null}show(){this.overlay&&(this.overlay.style.display="block")}hide(t){if(t!==this.renderedUplot){console.warn("Hide call plot");return}this.overlay&&(this.overlay.style.display="none"),this.render(null,null)}getRenderedUplot(){return this.renderedUplot}async positionTooltip(t){let r=this.getOverlay();if(r){let{x:i,y:o}=await(0,Q.computePosition)({getBoundingClientRect:()=>({x:t.left,y:t.top,width:0,height:0,top:t.top,left:t.left,right:t.left,bottom:t.top})},r,{placement:"top-start",strategy:"fixed",middleware:[(0,Q.offset)({mainAxis:bt,crossAxis:gt}),(0,Q.flip)()]});r.style.left=`${i}px`,r.style.top=`${o}px`}}},L=new he;var fe=require("@unblind/units"),be=require("react");var y=require("react/jsx-runtime");function qe(e){return e.metric.displayName||e.metric.name||(typeof e.serie.label=="string"?e.serie.label:e.serie.label?.textContent||"Unknown")}function ze(e){let t=e.attributes||{};if(t["service.name"])return String(t["service.name"]);let i=Object.keys(t)[0];return i?String(t[i]):"z-fallback"}function Fe(e){return[...e].sort((t,r)=>(Number(r.value)||0)-(Number(t.value)||0))}function Be(e){return[...e].sort((t,r)=>ze(t).localeCompare(ze(r)))}function yt(e){let t={};return e.forEach(r=>{let i=qe(r);t[i]||(t[i]=[]),t[i].push(r)}),t}function Tt(e,t,r,i="original"){if(r==="flat")return[{label:"",items:t?Fe(e):Be(e)}];let o=yt(e);return Object.keys(o).sort((a,n)=>a.localeCompare(n)).map(a=>{let n=o[a];if(!n)return{label:ae(a,i),items:[]};let l=t?Fe(n):Be(n);return{label:ae(a,i),items:l}})}function ae(e,t,r){switch(t){case"suffix":{let i=e.split(/[._-]/),o=i[i.length-1]||"";return r?o:o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}case"title":return e.split(/[._-]/).map(i=>r?i:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ");default:return e}}function vt(e,t){if(t&&t!=="auto")return t;let r=e.some(o=>o.attributes&&Object.keys(o.attributes).length>0),i=new Set(e.map(qe));return r&&i.size>=1?"group-by-metric":"flat"}function Ke({hideAttributeKey:e,attribute:t,format:r,isLastAttribute:i}){let[o,s]=t;return(0,y.jsxs)("div",{className:"ub-tooltip-item-attribute-container",children:[(0,y.jsxs)("div",{className:e?"ub-tooltip-item-hidden-attribute-key":"ub-tooltip-item-attribute-with-key",children:[!e&&(0,y.jsxs)("span",{className:"ub-tooltip-item-attribute-key",children:[ae(o,r),":"]}),(0,y.jsx)("span",{className:"ub-tooltip-item-attribute-value",children:s})]}),!i&&e&&(0,y.jsx)("span",{"data-text":", ",className:"ub-tooltip-item-attribute-divider"})]})}function xt({item:e,hideMetric:t,hideAttributeKey:r,hideAttributes:i,format:o}){let a=Object.entries(e.attributes||{}),n=a.length>0&&!i;return i&&t&&console.warn("Invalid configuration. Attributes and metrics are hidden."),(0,y.jsxs)("div",{className:"ub-tooltip-item-row",children:[(0,y.jsxs)("div",{className:"ub-tooltip-item-left"+(t?" ub-tooltip-item-hidden-metric":""),children:[(0,y.jsxs)("div",{className:"ub-tooltip-item-heading",children:[(0,y.jsx)("span",{className:"ub-tooltip-item-dot",style:{backgroundColor:e.color}}),t?(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:a.map((l,u)=>(0,y.jsx)(Ke,{hideAttributeKey:r,attribute:l,format:o,isLastAttribute:u>=a.length-1},"attr_"+l[0]))}):(0,y.jsx)("span",{className:n?"ub-tooltip-item-metric-name-label":"ub-tooltip-item-metric-name",children:ae(e.metric.name,o)})]}),n&&!t&&(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:a.map((l,u)=>(0,y.jsx)(Ke,{hideAttributeKey:r,attribute:l,format:o,isLastAttribute:u>=a.length-1},"attr_"+l[0]))})]}),(0,y.jsx)("div",{className:"ub-tooltip-item-value",children:e.formattedValue??(0,y.jsx)("span",{className:"ub-tooltip-item-value--empty",children:"\u2014"})})]})}function Ct({className:e="ub-tooltip-divider",...t}){return(0,y.jsx)("hr",{role:"presentation",...t,className:e})}function Pt({group:e,groupIdx:t,hideAttributeKey:r,hideMetric:i,hideAttributes:o,format:s,hideGroupLabel:a}){return(0,y.jsxs)("div",{className:"ub-tooltip-group",children:[!a&&(0,y.jsx)("div",{className:`ub-tooltip-group-header${t>0?" ub-tooltip-group-header--separator":""}`,children:e.label}),(0,y.jsx)("div",{className:"ub-tooltip-items",children:e.items.map((n,l)=>(0,y.jsx)(xt,{item:n,format:s,hideAttributeKey:r,hideMetric:i,hideAttributes:o},`item-${t}-${l}`))})]},e.label)}function Ge({timestamp:e,items:t,timeZone:r,spansMultipleDays:i,sortByValues:o,format:s="original",layout:a="flat",hideAttributeKey:n,hideMetric:l,hideAttributes:u}){let m=i?(0,fe.dateTimeFormat)(e*1e3,{format:"MMM DD, HH:mm",timeZone:r}):(0,fe.dateTimeFormat)(e*1e3,{format:"HH:mm",timeZone:r}),d=(0,be.useMemo)(()=>vt(t,a),[t,a]),c=d==="flat",h=typeof l=="boolean"?l:d==="group-by-metric",g=typeof n=="boolean"?n:!1,b=typeof u=="boolean"?u:!1,f=(0,be.useMemo)(()=>Tt(t,o,d,s),[t,o,d,s]);return(0,y.jsxs)("div",{className:"ub-tooltip",children:[(0,y.jsx)("div",{className:"ub-tooltip-datetime",children:m}),(0,y.jsx)(Ct,{}),f.length>0?(0,y.jsx)("div",{className:"ub-tooltip-content",children:f.map((v,T)=>(0,y.jsx)(Pt,{group:v,groupIdx:T,hideAttributeKey:g,hideMetric:h,hideAttributes:b,hideGroupLabel:c,format:s},v.label))}):(0,y.jsx)("div",{className:"ub-tooltip-no-data",children:"No data available"})]})}var ge=require("react/jsx-runtime");function kt(e,t){if(!e||e.length===0)return!1;let r=e[0],i=e[e.length-1];if(r==null||i==null)return!1;let o=new Date(r*1e3),s=new Date(i*1e3),a=n=>t==="UTC"?`${n.getUTCFullYear()}-${n.getUTCMonth()}-${n.getUTCDate()}`:n.toLocaleDateString(void 0,{timeZone:t});return a(o)!==a(s)}function wt(e,t){let r=!1;for(let o=1;o<e.series.length;o++)if(e.data[o]?.[t]!=null){r=!0;break}if(r)return t;let i=e.data[0].length;for(let o=1;t+o<i||t-o>=0;o++){let s=t-o,a=t+o;if(s>=0){for(let n=1;n<e.series.length;n++)if(e.data[n]?.[s]!=null)return s}if(a<i){for(let n=1;n<e.series.length;n++)if(e.data[n]?.[a]!=null)return a}}return t}function At(e,t,r,i,o,s){let a=!1,n=[];for(let l=1;l<e.series.length;l++){let u=e.data[l]?.[t]??null;if(i&&u!=null&&l>1){let b=e.data[l-1]?.[t]??0;u=u-b}let m=e.series[l],d=s?.[l-1];if(!d){console.warn("Original serie not found");continue}let c=o[d.metric];if(!c){console.warn("Metric metadata not found");continue}let p=m?.stroke,h=typeof p=="function"?p(He.default,l):p??"#ffffff00",g=u==null?void 0:r?r(u):String(u);d?.attributes&&Object.keys(d?.attributes).length>0&&(a=!0),n.push({metric:c,color:h,value:u===null?void 0:u,formattedValue:g,attributes:d?.attributes,serie:m})}return{items:n,hasAttributes:a}}function _e(e,t,r,i,o,s,a,n,l,u,m,d){let c,p,h,g=!1;function b(){let f=c.getBoundingClientRect();p=f.left,h=f.top}return{hooks:{init:f=>{L.initialize(),c=f.over,window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),c.onmouseenter=()=>{g=!0,L.show()},c.onmouseleave=()=>{g=!1,L.getRenderedUplot()===f&&L.hide(f)},b()},setSize:()=>{b()},setCursor:f=>{let{left:v,top:T,idx:C}=f.cursor;if(!g||C==null){L.getRenderedUplot()===f&&L.hide(f);return}let x=f.data[0],R=kt(x,o),M=wt(f,C),w=f.data[0][M];if(w===void 0)return;let{items:E}=At(f,M,e,t,r,a);L.show();let D=s,F=D?(0,ge.jsx)(D,{timestamp:w,items:E,timeZone:o}):(0,ge.jsx)(Ge,{timestamp:w,items:E,timeZone:o,spansMultipleDays:R,stacked:t,sortByValues:i,layout:n,format:l,hideAttributeKey:u,hideAttributes:m,hideMetric:d});L.render(f,F),L.positionTooltip({left:(v||0)+p,top:(T||0)+h})},destroy(f){window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b),c&&(c.onmouseenter=null,c.onmouseleave=null),L.getRenderedUplot()===f&&L.hide(f)}}}}var se=["oklch(0.70 0.24 293)","oklch(0.85 0.18 95)","oklch(0.65 0.25 255)","oklch(0.72 0.26 27)","oklch(0.70 0.22 150)","oklch(0.78 0.18 50)","oklch(0.72 0.18 215)","oklch(0.70 0.27 301)","oklch(0.75 0.20 90)","oklch(0.68 0.23 277)","oklch(0.70 0.18 193)","oklch(0.68 0.25 4)"],H=e=>`${getComputedStyle(document.documentElement).getPropertyValue("--ub-chart-font-size").trim()} ${e}`,$e=(e,t)=>{let r=e;return t&&t.unit&&t.unit.code&&t.unit.code!=="1"&&(!r&&t.unit?r=t.unit.code:r&&t.unit.code!==r&&(r=void 0)),r};function St(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Array.isArray(e.fill)&&Array.isArray(e.border)}function Rt(e){return Array.isArray(e)}var Qe=(e,t,r,i,o,s)=>{if(r)return Rt(r)?r[t]:St(r)?s?r.fill[t]:r.border[t]:r(e,t,i,s);let a=s?`--ub-chart-serie-color-fill-${t+1}`:`--ub-chart-serie-color-${t+1}`,n=o.getPropertyValue(a).trim();return n||(s&&(i==="step"||i==="line"||i==="spline")?`oklch(from ${se[t%se.length]} l c h / 0.4)`:se[t%se.length])},Ut=e=>{let t=X.default.paths.bars({size:[.6,100],radius:0,gap:0}),r=X.default.paths.linear({alignGaps:0}),i=X.default.paths.spline({alignGaps:1}),o=X.default.paths.stepped({alignGaps:1});switch(e){case"line":return r;case"bar":return t;case"area":return r;case"step":return o;case"spline":return i;default:return r}},Lt=(e,t,r,i,o)=>Qe(e,t,r,i,o,!0),Mt=(e,t)=>{switch(e){case"bar":return 1;case"line":return t?1.5:2;case"spline":return t?1.5:2;case"area":return 1;case"step":return 1.5;default:return 1}},Et=(e,t,r)=>{if(t<0||r<0)return[t,r];let i=e.posToVal(t,"x"),o=e.data[0];if(!o||o.length===0)return[t,r];let s=0,a=0,n=o.length-1;for(;n-a>1;){let p=Math.floor((a+n)/2),h=o[p];h!=null&&h<i?a=p:n=p}let l=o[a],u=o[n];l!=null&&u!=null?s=Math.abs(l-i)<Math.abs(u-i)?a:n:l!=null?s=a:u!=null&&(s=n);let m=s;for(let p=s;p>=0;p--){let h=!1;for(let g=1;g<e.data.length;g++){let b=e.data[g];if(b&&b[p]!=null){h=!0;break}}if(h){m=p;break}}let d=o[m];return d==null?[t,r]:[e.valToPos(d,"x"),r]},Nt=(e,t)=>{let r=t.getPropertyValue("--ub-chart-font-color").trim(),i=t.getPropertyValue("--ub-chart-grid-color").trim(),o=e.axes?.[0],s=e.axes?.[1];return o&&(o.stroke=r,o.grid?o.grid.stroke=i:o.grid={stroke:i}),s&&(s.stroke=r,s.grid?s.grid.stroke=i:s.grid={stroke:i}),e},It=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}`).trim()||e.getPropertyValue("--ub-chart-threshold-default").trim(),Dt=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}-fill`).trim()||e.getPropertyValue("--ub-chart-threshold-default-fill").trim(),Vt=e=>{switch(e){case"bold":return 2;case"line":return 1;case"dashed":return 1;default:return 1}},Ot=e=>e==="line"?void 0:[5,5],zt=(e,t)=>{if(t){let r=[];return t.forEach(i=>{let o={label:i.label,stroke:It(e,i.level),width:Vt(),dash:Ot(i.type),points:{show:!1,size:0},spanGaps:!0,show:!0,auto:!1};ne(i)||r.push(o),r.push(o)}),r}else return[]},Ft=(e,t,r,i)=>{if(!i||!i.some(s=>W(s)))return t.bands;let o=i.map((s,a)=>W(s)?{series:[e.length+a*2+1,e.length+a*2+2],fill:Dt(r,s.level),dir:1}:null).filter(s=>s!==null);return[...t.bands,...o]},Bt=(e,t,r,i,o,s,a)=>{let n=Mt(t,i);return[{},...e.map((l,u)=>({label:l.metric,stroke:Qe(l,u,r,t,s),width:n,points:{show:!1},spanGaps:!0,paths:Ut(t),fill:i||o?Lt(l,u,r,t,s):void 0})),...zt(s,a)]},Kt=e=>{if(typeof e=="string"){let t=String(e).toLowerCase().trim();if(t==="by")return"bytes";if(t.startsWith("{")&&t.endsWith("}"))return"short"}return e},We=(e,t,r,i,o,s,a,n,l,u,m,d,c,p,h,g,b,f,v,T,C)=>{let k=window.getComputedStyle(e),x=k.fontFamily,R=e?.clientWidth??1050,M=e?.clientHeight??250,w=Kt(i),E=(0,je.getValueFormat)(w==="1"?null:w),D=U=>{let A=E(U,Number.isInteger(U)?0:2);return A.text+(A.suffix?.trim()||"")},F={width:R,height:M,scales:{y:{range:Xe(i,T,C)}},plugins:[_e(D,a,t,u,m,d,o,h,p,g,b,f)],padding:c?[10,15,10,15]:[8,15,8,15],cursor:{y:!1,sync:{key:"_"},drag:{setScale:!0,x:!0,y:!1},move:Et},series:Bt(o,s,n,l,a,k,v),bands:Ft(o,r,k,v),axes:[Ve(x,m,c),Ye(E,x)],legend:{show:!1}};return Nt(F,k)};var Je=(e,t=4)=>{let r=e/t,i=Math.pow(10,Math.floor(Math.log10(r))),o=r/i,s;return o>5?s=10*i:o>2?s=5*i:o>1?s=2*i:s=i,Math.ceil(e/s)*s},P=(e,t)=>typeof e=="number"?e:t,Xe=(e,t,r)=>(i,o,s)=>{if(o===0&&s===0)return[P(t,0),P(r,100)];let a=1,n=s*(1+a),l=o<0?o*(1+a):o*(1-a);if(e==="percent"||e==="percentunit")return s>100?o<0?[P(t,l),P(r,n)]:[P(t,0),P(r,n)]:o<0?[P(t,l),P(r,100)]:[P(t,0),P(r,100)];if(s<=.9999)return o<=0?[P(t,l),P(r,1)]:[P(t,0),P(r,1)];let u=Je(n),m=Je(Math.abs(l));return o<0?[P(r,-m),P(r,u)]:[P(t,0),P(r,u)]},qt=(e,t,r,i)=>{let o=e.axes[r];if(i>1)return o?._size;let s=(o?.ticks?.size||0)+(o?.gap||0),a=(t??[]).reduce((n,l)=>l.length>n.length?l:n,"");return a!=""&&(e.ctx.font=o?.font?.[0]??e.ctx.font,s+=e.ctx.measureText(a).width/devicePixelRatio),Math.ceil(s)};function Ye(e,t){return{gap:0,font:H(t),labelFont:H(t),grid:{show:!0,width:.5},ticks:{width:.5},values:(r,i)=>i.map(o=>{let s=e(o);return s.text+(s.suffix?.trim()||"")}),size:qt,space:60}}function Ze(e,t){let r=[],i=e[0],o=i.length,s=Array(o).fill(0),a=[i];return e.forEach((n,l)=>{l!==0&&(t?a.push(n):a.push(n.map((u,m)=>s[m]=s[m]+(u||0))))}),e.forEach((n,l)=>{l===0||t||r.push({series:[e.findIndex((u,m)=>m>l),l]})}),{data:a,bands:r.filter(n=>n.series[1]>-1)}}var tt=require("react/jsx-runtime");function ue(e){let{times:t,series:r,metadata:i,type:o,className:s,timeZone:a,options:n,tooltip:l,colors:u,tooltipComponent:m,sortByValues:d=!1,unit:c,fill:p=!1,thresholds:h,min:g,max:b}=e,{layout:f,format:v,hideAttributeKey:T,hideAttributes:C,hideMetric:k}=l||{},x=(0,le.useRef)(null),R=G(),M=u||R.appearance.colors;return(0,le.useEffect)(()=>{if(!r||r.length===0){console.warn("No series provided");return}let w=[t],E=c;r.forEach(N=>{let Y=i[N.metric];c||(E=$e(E,Y)),w.push(N.values)}),h&&h.forEach(N=>{ne(N)?w.push(new Array(t.length).fill(N.value)):W(N)&&(w.push(new Array(t.length).fill(N.from)),w.push(new Array(t.length).fill(N.to)))});let D=o==="bar"||o==="area",F=Ze(w,!D),U=x.current,A=null;if(U){let N=We(U,i,F,E,r,o,D,M,p,d,a,m,!1,v,f,T,C,k,h,g,b);A=new et.default({...N,...n},F.data,U);let Y=new ResizeObserver(()=>{A?.setSize({width:U.clientWidth,height:U.clientHeight})});return Y.observe(U),()=>{A?.destroy(),Y.disconnect()}}},[r,t,o,i,a,m,M,p,d,c,v,f,T,C,k,h,g,b]),(0,tt.jsx)("div",{ref:x,className:"ub-chart-container"+(s?` ${s}`:"")})}var K=require("react/jsx-runtime");function ot({metrics:e,operator:t,attributes:r,groupBy:i,interval:o,type:s="line",className:a,appearance:n,unit:l,thresholds:u,min:m,max:d}){let c=G(),p=o??c.interval,h=r??c.attributes,g=i??c.groupBy,b=t??c.operator,f=n?.colors??c.appearance.colors,v=typeof n?.sortByValues=="boolean"?n?.sortByValues:c.appearance.sortByValues,T=typeof n?.fill=="boolean"?n.fill:c.appearance.fill,C=n?.components?.Tooltip??c.appearance.components.Tooltip,k=(0,rt.useMemo)(()=>({layout:n?.tooltip?.layout??c.appearance.tooltip?.layout,format:n?.tooltip?.format??c.appearance.tooltip?.format,hideAttributes:n?.tooltip?.hideAttributes??c.appearance.tooltip?.hideAttributes,hideAttributeKey:n?.tooltip?.hideAttributeKey??c.appearance.tooltip?.hideAttributeKey,hideMetric:n?.tooltip?.hideMetric??c.appearance.tooltip?.hideMetric}),[n?.tooltip?.layout,n?.tooltip?.format,n?.tooltip?.hideAttributes,n?.tooltip?.hideAttributeKey,n?.tooltip?.hideMetric,c.appearance.tooltip?.layout,c.appearance.tooltip?.format,c.appearance.tooltip?.hideAttributes,c.appearance.tooltip?.hideAttributeKey,c.appearance.tooltip?.hideMetric]),{isLoading:x,data:R,hasError:M}=ie({queries:(Array.isArray(e)?e:[e]).map(A=>({metrics:[A],operator:b,attributes:h,groupBy:g})),timeRange:c.timeRange,startTime:c.startTime,endTime:c.endTime,interval:p}),{series:w,times:E,metadata:D}=R,F=w.every(A=>A.isEmpty),U=`ub-chart-container${a?` ${a}`:""}`;if(x){let A=n?.components?.Loading??c.appearance.components.Loading;return(0,K.jsx)("div",{className:U,children:(0,K.jsx)(A,{})})}if(F){let A=n?.components?.Empty??c.appearance.components.Empty;return(0,K.jsx)("div",{className:U,children:(0,K.jsx)(A,{})})}if(M){let A=n?.components?.Error??c.appearance.components.Error;return(0,K.jsx)("div",{className:U,children:(0,K.jsx)(A,{})})}return(0,K.jsx)(ue,{times:E,series:w,metadata:D,type:s,className:a,tooltip:k,colors:f,sortByValues:v,unit:l,fill:T,tooltipComponent:C,thresholds:u,min:m,max:d})}0&&(module.exports={Chart,Empty,Error,Loading,Timeseries,UnblindProvider,UnblindScope,useLogs,useMetrics,useRefresh,useScope,useTimeseries,useUsage});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|