@unblind/react 0.1.0-alpha.17 → 0.1.0-alpha.18

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 CHANGED
@@ -1,2 +1,2 @@
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:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;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);overflow:hidden}.ub-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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:start;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:start}.ub-tooltip-item-metric-name{opacity:100%}.ub-tooltip-item-metric-name-label{--opacity: 50%}.ub-tooltip-item-dot{width:3px;height:12px;flex-shrink:0;border-radius:9999px;margin-top:3px}.ub-tooltip-item-attributes{display:flex;gap:.25rem;margin-right:auto;flex-wrap:wrap;overflow:hidden}.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;margin-top:2px}.ub-tooltip-item-value--empty{font-weight:400;color:var(--ub-text-disabled)}.ub-tooltip-attributes{margin-top:.125rem;display:flex;flex-wrap:wrap;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;flex-shrink:0;min-width:0px;max-width:100%}.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;margin-left:2px}.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}
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:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;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}.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);overflow:hidden}.ub-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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)}.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:start;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:start}.ub-tooltip-item-metric-name-without-attributes{opacity:100%}.ub-tooltip-item-metric-name-with-attributes{--opacity: 50%}.ub-tooltip-item-dot{width:3px;height:12px;flex-shrink:0;border-radius:9999px;margin-top:3.5px}.ub-tooltip-item-attributes{display:flex;gap:.25rem;margin-right:auto;flex-wrap:wrap;overflow:hidden}.ub-tooltip-item-value{font-weight:500;--tw-font-weight: 500;font-variant-numeric:tabular-nums;font-size:.8rem;white-space:nowrap;margin-top:2px}.ub-tooltip-item-value--empty{font-weight:400;color:var(--ub-text-disabled)}.ub-tooltip-attributes{margin-top:.125rem;display:flex;flex-wrap:wrap;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;flex-shrink:0;min-width:0px;max-width:100%}.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:400;font-size:12px;margin-left:2px}.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}: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}}
2
2
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
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: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;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 overflow: hidden;\n}\n\n.ub-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\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: start;\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: start;\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: 12px;\n flex-shrink: 0;\n border-radius: 9999px;\n margin-top: 3px;\n}\n\n.ub-tooltip-item-attributes {\n display: flex;\n gap: 0.25rem;\n margin-right: auto;\n flex-wrap: wrap;\n overflow: hidden;\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 margin-top: 2px;\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 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 flex-shrink: 0;\n min-width: 0px;\n max-width: 100%;\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 margin-left: 2px;\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-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X,YAAa,GACf,CAEA,CAAC,8BAA8B,CAZ5B,gCAaD,MAAO,IAAI,iBACX,UAAW,IACb,CAEA,CALC,8BAMC,CAAC,qCACD,CAnBC,gCAoBD,YAAa,GACf,CAEA,CAXC,8BAW8B,CAnC9B,8BAoCC,UAAW,IACb,CAEA,CAAC,iCAAiC,QAChC,QAAS,KAAK,WACd,MAAO,IAAI,sBACb,CAEA,CAAC,mBA3MD,QA4MW,EAAE,MACX,WAAY,OACZ,MAAO,IAAI,kBACX,YAAa,IACf","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/components/Tooltip/Tooltip.css","../src/styles.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: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;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;}","/* 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 overflow: hidden;\n}\n\n.ub-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\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}\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: start;\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: start;\n}\n\n.ub-tooltip-item-metric-name-without-attributes {\n opacity: 100%;\n}\n\n.ub-tooltip-item-metric-name-with-attributes {\n --opacity: 50%;\n}\n\n.ub-tooltip-item-dot {\n width: 3px;\n height: 12px;\n flex-shrink: 0;\n border-radius: 9999px;\n margin-top: 3.5px;\n}\n\n.ub-tooltip-item-attributes {\n display: flex;\n gap: 0.25rem;\n margin-right: auto;\n flex-wrap: wrap;\n overflow: hidden;\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-top: 2px;\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 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 flex-shrink: 0;\n min-width: 0px;\n max-width: 100%;\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: 400;\n font-size: 12px;\n margin-left: 2px;\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","@import \"uplot/dist/uPlot.min.css\";\n@import \"./components/Tooltip/Tooltip.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"],"mappings":"AAAA,CAAC,WACC,QAAS,KACT,OAAQ,KACR,YAAa,OACb,gBAAiB,OACjB,MAAO,IAAI,sBACb,C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AM,EAAE,EAAE,EAAE,EAAE,GAC/C,CACF,CAEA,gBACE,OAAO,CAAC,oBACN,MAAO,KACP,OAAQ,KACR,WAAY,EACZ,UAAW,CACb,CACF","names":[]}
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
3
3
  import React$1, { ReactNode } from 'react';
4
4
  import { StringValue } from 'ms';
5
- import uPlot from 'uplot';
5
+ import uPlot$1 from 'uplot';
6
6
 
7
7
  type UnblindClientConfig = {
8
8
  /**
@@ -58,26 +58,6 @@ type UnblindClientProviderProps = {
58
58
  */
59
59
  declare function useRefresh(): () => Promise<void>;
60
60
 
61
- interface TooltipItem {
62
- metric: MetricMetadata;
63
- serie: uPlot.Series;
64
- color: string;
65
- value?: number;
66
- formattedValue?: string;
67
- attributes?: Record<string, string>;
68
- }
69
- type TooltipLayout = "auto" | "group-by-metric" | "flat";
70
- /**
71
- * Formats for rendering attribute and metric names.
72
- * @example
73
- * nodejs.eventloop.p50
74
- * ```
75
- * original: "nodejs.eventloop.p50"
76
- * suffix: "p50"
77
- * title: "Nodejs Eventloop P50"
78
- * ```
79
- */
80
- type TooltipFormat = "original" | "suffix" | "title";
81
61
  interface TooltipProps {
82
62
  timestamp: number;
83
63
  items: TooltipItem[];
@@ -245,7 +225,7 @@ interface ChartVisualConfig {
245
225
  }
246
226
  interface TooltipConfig {
247
227
  layout?: TooltipLayout;
248
- format?: TooltipFormat;
228
+ labelFormat?: TooltipLabelFormat;
249
229
  hideAttributeKey?: boolean;
250
230
  hideAttributes?: boolean;
251
231
  hideMetric?: boolean;
@@ -286,6 +266,26 @@ type RangeThreshold = {
286
266
  label?: string;
287
267
  };
288
268
  type Threshold = LineThreshold | RangeThreshold;
269
+ type TooltipLayout = "auto" | "group-by-metric" | "flat";
270
+ /**
271
+ * Formats for rendering attribute and metric names.
272
+ * @example
273
+ * nodejs.eventloop.p50
274
+ * ```
275
+ * original: "nodejs.eventloop.p50"
276
+ * suffix: "p50"
277
+ * title: "Nodejs Eventloop P50"
278
+ * ```
279
+ */
280
+ type TooltipLabelFormat = "original" | "suffix" | "title";
281
+ interface TooltipItem {
282
+ metric: MetricMetadata;
283
+ serie: uPlot.Series;
284
+ color: string;
285
+ value?: number;
286
+ formattedValue?: string;
287
+ attributes?: Record<string, string>;
288
+ }
289
289
 
290
290
  type ScopeConfig = TimeseriesQueryConfig & ChartVisualConfig & {
291
291
  /**
@@ -568,7 +568,7 @@ interface ChartProps extends ChartVisualConfig {
568
568
  type: ChartType;
569
569
  className?: string;
570
570
  timeZone?: string;
571
- options?: uPlot.Options;
571
+ options?: uPlot$1.Options;
572
572
  unit?: string;
573
573
  tooltipComponent?: React.ComponentType<TooltipProps>;
574
574
  thresholds?: Array<Threshold>;
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
3
3
  import React$1, { ReactNode } from 'react';
4
4
  import { StringValue } from 'ms';
5
- import uPlot from 'uplot';
5
+ import uPlot$1 from 'uplot';
6
6
 
7
7
  type UnblindClientConfig = {
8
8
  /**
@@ -58,26 +58,6 @@ type UnblindClientProviderProps = {
58
58
  */
59
59
  declare function useRefresh(): () => Promise<void>;
60
60
 
61
- interface TooltipItem {
62
- metric: MetricMetadata;
63
- serie: uPlot.Series;
64
- color: string;
65
- value?: number;
66
- formattedValue?: string;
67
- attributes?: Record<string, string>;
68
- }
69
- type TooltipLayout = "auto" | "group-by-metric" | "flat";
70
- /**
71
- * Formats for rendering attribute and metric names.
72
- * @example
73
- * nodejs.eventloop.p50
74
- * ```
75
- * original: "nodejs.eventloop.p50"
76
- * suffix: "p50"
77
- * title: "Nodejs Eventloop P50"
78
- * ```
79
- */
80
- type TooltipFormat = "original" | "suffix" | "title";
81
61
  interface TooltipProps {
82
62
  timestamp: number;
83
63
  items: TooltipItem[];
@@ -245,7 +225,7 @@ interface ChartVisualConfig {
245
225
  }
246
226
  interface TooltipConfig {
247
227
  layout?: TooltipLayout;
248
- format?: TooltipFormat;
228
+ labelFormat?: TooltipLabelFormat;
249
229
  hideAttributeKey?: boolean;
250
230
  hideAttributes?: boolean;
251
231
  hideMetric?: boolean;
@@ -286,6 +266,26 @@ type RangeThreshold = {
286
266
  label?: string;
287
267
  };
288
268
  type Threshold = LineThreshold | RangeThreshold;
269
+ type TooltipLayout = "auto" | "group-by-metric" | "flat";
270
+ /**
271
+ * Formats for rendering attribute and metric names.
272
+ * @example
273
+ * nodejs.eventloop.p50
274
+ * ```
275
+ * original: "nodejs.eventloop.p50"
276
+ * suffix: "p50"
277
+ * title: "Nodejs Eventloop P50"
278
+ * ```
279
+ */
280
+ type TooltipLabelFormat = "original" | "suffix" | "title";
281
+ interface TooltipItem {
282
+ metric: MetricMetadata;
283
+ serie: uPlot.Series;
284
+ color: string;
285
+ value?: number;
286
+ formattedValue?: string;
287
+ attributes?: Record<string, string>;
288
+ }
289
289
 
290
290
  type ScopeConfig = TimeseriesQueryConfig & ChartVisualConfig & {
291
291
  /**
@@ -568,7 +568,7 @@ interface ChartProps extends ChartVisualConfig {
568
568
  type: ChartType;
569
569
  className?: string;
570
570
  timeZone?: string;
571
- options?: uPlot.Options;
571
+ options?: uPlot$1.Options;
572
572
  unit?: string;
573
573
  tooltipComponent?: React.ComponentType<TooltipProps>;
574
574
  thresholds?: Array<Threshold>;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var ot=Object.create;var Z=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var lt=(e,t)=>{for(var r in t)Z(e,r,{get:t[r],enumerable:!0})},ve=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nt(t))!st.call(e,o)&&o!==r&&Z(e,o,{get:()=>t[o],enumerable:!(i=it(t,o))||i.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?ot(at(e)):{},ve(t||!e||!e.__esModule?Z(r,"default",{value:e,enumerable:!0}):r,e)),ut=e=>ve(Z({},"__esModule",{value:!0}),e);var _t={};lt(_t,{Chart:()=>ue,Empty:()=>ee,Error:()=>te,Loading:()=>re,Scope:()=>oe,Timeseries:()=>rt,UnblindProvider:()=>we,useLogs:()=>Ie,useMetrics:()=>ke,useRefresh:()=>de,useScope:()=>_,useTimeseries:()=>ie,useUsage:()=>Ee});module.exports=ut(_t);var H=require("@tanstack/react-query"),z=require("react"),me=require("react/jsx-runtime"),xe=(0,z.createContext)(void 0);function Ce({children:e,queryClient:t,queryClientConfig:r,apiBaseUrl:i="/api/unblind",fetchImpl:o}){let n=(0,z.useMemo)(()=>{if(t)return t;let a={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1},u={defaultOptions:{queries:a}};return r?new H.QueryClient({...r,defaultOptions:{...r.defaultOptions,queries:{...a,...r.defaultOptions?.queries}}}):new H.QueryClient(u)},[t,r]),s=(0,z.useMemo)(()=>({apiBaseUrl:i,fetchImpl:o}),[i,o]);return(0,me.jsx)(H.QueryClientProvider,{client:n,children:(0,me.jsx)(xe.Provider,{value:s,children:e})})}function O(){let e=(0,z.useContext)(xe);if(!e)throw new Error("useUnblindConfig must be used within an UnblindClientProvider. Please wrap your app or component tree with <UnblindClientProvider>.");return e}function de(){let e=(0,H.useQueryClient)();return(0,z.useCallback)(async()=>{await e.refetchQueries({queryKey:["unblind","timeseries"]})},[e])}var I=require("react");var N=require("react/jsx-runtime");function ee(){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 te(){return(0,N.jsx)("div",{className:"ub-error"})}function re(){return(0,N.jsx)("div",{className:"ub-default","data-text":"Loading"})}var Pe=require("react/jsx-runtime"),he=(0,I.createContext)(void 0);function oe({children:e,timeRange:t,startTime:r,endTime:i,interval:o,attributes:n,groupBy:s,operator:a,appearance:u,tooltip:c,colors:m,fill:h,sortByValues:d}){let l=(0,I.useContext)(he),f=u?.components?.Loading||l?.appearance?.components?.Loading,g=u?.components?.Error||l?.appearance?.components?.Error,p=u?.components?.Tooltip||l?.appearance?.components?.Tooltip,b=u?.components?.Empty||l?.appearance?.components?.Empty,v=c?.layout||l?.tooltip?.layout,T=c?.format||l?.tooltip?.format,C=typeof c?.hideAttributes=="boolean"?c?.hideAttributes:l?.tooltip?.hideAttributes,P=typeof c?.hideAttributeKey=="boolean"?c?.hideAttributeKey:l?.tooltip?.hideAttributeKey,x=typeof c?.hideMetric=="boolean"?c?.hideMetric:l?.tooltip?.hideMetric,w=(0,I.useMemo)(()=>({components:{...f&&{Loading:f},...g&&{Error:g},...p&&{Tooltip:p},...b&&{Empty:b}}}),[f,g,p,b]),R=(0,I.useMemo)(()=>({layout:v,format:T,hideAttributes:C,hideAttributeKey:P,hideMetric:x}),[v,T,C,P,x]),A=(0,I.useMemo)(()=>({timeRange:t??l?.timeRange,startTime:r??l?.startTime,endTime:i??l?.endTime,interval:o??l?.interval,attributes:n??l?.attributes,groupBy:s??l?.groupBy,operator:a??l?.operator,colors:m??l?.colors,sortByValues:typeof d=="boolean"?d:l?.sortByValues,fill:typeof h=="boolean"?h:l?.fill,appearance:w,tooltip:R}),[t,r,i,o,n,s,a,m,d,h,w,R,l]);return(0,Pe.jsx)(he.Provider,{value:A,children:e})}var ct="6h";function _(){let e=(0,I.useContext)(he);return(0,I.useMemo)(()=>({...e,timeRange:e?.timeRange||ct,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}}}),[e])}var fe=require("react/jsx-runtime");function we({children:e,queryClient:t,apiBaseUrl:r,fetchImpl:i,timeRange:o,startTime:n,endTime:s,interval:a,attributes:u,groupBy:c,operator:m,appearance:h,tooltip:d,colors:l,sortByValues:f}){return(0,fe.jsx)(Ce,{queryClient:t,apiBaseUrl:r,fetchImpl:i,children:(0,fe.jsx)(oe,{timeRange:o,startTime:n,endTime:s,interval:a,attributes:u,groupBy:c,operator:m,appearance:h,tooltip:d,colors:l,sortByValues:f,children:e})})}var Ae=require("@tanstack/react-query");function ke(){let{apiBaseUrl:e,fetchImpl:t=fetch}=O(),r=(0,Ae.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 Re=require("@tanstack/react-query"),j=require("react");var Se=pe(require("ms"));function pt(e){let t=Math.floor(Date.now()/1e3);return[t-Math.floor((0,Se.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[n,s]=pt(e);i=n,o=s}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:n,fetchImpl:s=fetch}=O(),a=(0,j.useMemo)(()=>e.map(T=>T.metrics.join(",")).join(","),[e]),u=(0,j.useMemo)(()=>e.map(T=>{let C=T.attributes;if(!C)return"";let P=Object.keys(C);return P.length===0?"":P.map(x=>x+":"+C[x]?.join(",")).join(",")}).join(","),[e]),c=(0,j.useMemo)(()=>e.map(T=>T.operator),[e]),m=(0,j.useMemo)(()=>e.map(T=>T.groupBy).join(", "),[e]),d=(0,Re.useQuery)({queryKey:["unblind","timeseries",a,u,r,i,t,o,c,m],queryFn:async()=>{if(!a)throw new Error("Missing required parameters");if(a.length===0)throw new Error("No series provided");let[T,C]=$(t,r,i),P={queries:e,startTime:T,endTime:C,interval:o},x=await s(`${n}/tenants/timeseries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)});if(!x.ok)throw new Error("Error fetching metric");let{series:w,times:R,metadata:A}=await x.json();if(!w)throw console.error("Series not found"),new Error("Series not found");return{series:w,times:R,metadata:A}},enabled:!!a&&(typeof r=="number"&&typeof i=="number"||!!t)}),{metadata:l,series:f,times:g}=(0,j.useMemo)(()=>d.data?{series:d.data.series,times:d.data.times,metadata:d.data.metadata}:{series:[],times:[],metadata:{}},[d]),p=d.isLoading,b=d.isFetching,v=d.isError;return{data:{series:f,times:g,metadata:l},isLoading:p,isFetching:b,hasError:v,refetch:d.refetch}}var Le=require("@tanstack/react-query"),Ue=require("react");function Ee({timeRange:e,startTime:t,endTime:r}){let{apiBaseUrl:i,fetchImpl:o=fetch}=O(),s=(0,Le.useQuery)({queryKey:["unblind","usage",e,t,r],queryFn:async()=>{let[m,h]=$(e,t,r),d=`${i}/tenants/usage`,l=await o(d,{headers:{"Content-Type":"application/json"},body:JSON.stringify({startTime:m,endTime:h})});if(!l.ok)throw new Error("Error fetching usage");let{data:f}=await l.json();if(!f)throw new Error("usage not found");return f},enabled:typeof t=="number"&&typeof r=="number"||!!e}),a=(0,Ue.useMemo)(()=>s.data?s.data||[]:[],[s]),u=s.isLoading||s.isRefetching,c=s.isError;return{usage:a,isLoading:u,hasError:c,refetch:s.refetch}}var Me=require("@tanstack/react-query"),Ne=require("react");function Ie({timeRange:e,filters:t,startTime:r,endTime:i}){let{apiBaseUrl:o,fetchImpl:n=fetch}=O(),s=typeof r=="number"&&typeof i=="number"||!!e,a=(0,Me.useInfiniteQuery)({queryKey:["unblind","logs",e,t.map(c=>c.name+":"+c.value).sort().join(",")],queryFn:async({pageParam:c})=>{let m=t.reduce((x,w)=>(x[w.name]||(x[w.name]=[]),x[w.name].push(w.value),x),{}),{body:h=[],severity:d=[],"service.name":l=[],"trace.id":f=[],"span.id":g=[],...p}=m,[b,v]=$(e,r,i),T=await n(`${o}/tenants/logs`,{method:"POST",body:JSON.stringify({filter:{attributes:p,body:h,severity:d,traceId:f,spanId:g,service:l},startTime:b,endTime:v,pagination:{page:c}}),headers:{"Content-Type":"application/json"}});if(!T.ok)throw new Error("Error fetching logs");let{data:C,next_page:P}=await T.json();if(!C)throw new Error("data not found");return{data:C,next_page:P}},enabled:s,initialPageParam:void 0,getNextPageParam:c=>c.next_page});return{logs:(0,Ne.useMemo)(()=>a.data?a.data.pages.flatMap(c=>c.data||[]):[],[a.data]),isLoading:a.isLoading,hasError:a.isError,hasNextPage:a.hasNextPage??!1,fetchNextPage:a.fetchNextPage,isFetchingNextPage:a.isFetchingNextPage,refetch:a.refetch}}var tt=require("react");var le=require("react"),Ze=pe(require("uplot"));var ne=e=>"value"in e,Y=e=>"from"in e&&"to"in e;var J=pe(require("uplot")),Ge=require("@unblind/units");var F=require("@unblind/units");var S={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:24192e5,year:31536e6},Q={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 mt(e,t,r,i){if(t>7*S.day){let o=F.systemDateFormats.interval.year,n=Math.round(S.year/S.day)*S.day;return Math.round(t/S.day)*S.day===n?o=F.systemDateFormats.interval.year:t<=S.year?o=F.systemDateFormats.interval.month:o=F.systemDateFormats.interval.day,e.map(a=>(0,F.dateTimeFormat)(a,{format:o,timeZone:i}))}return e.map(o=>{let n=new Date(o),s=t<S.minute,a=t<S.second,u=n.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:i});return(u==="00:00"||u==="24:00")&&!s&&!a?n.toLocaleDateString(void 0,{day:"2-digit",month:"short",timeZone:i}):n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:s?"2-digit":void 0,fractionalSecondDigits:a?3:void 0,hour12:!1,timeZone:i})})}function De(e){let t=[{size:S.second/1e3,increments:Q.second},{size:S.minute/1e3,increments:Q.minute},{size:S.hour/1e3,increments:Q.hour},{size:S.day/1e3,increments:Q.day},{size:S.month/1e3,increments:Q.month},{size:S.year/1e3,increments:Q.year}];for(let o of t)for(let n of o.increments){let s=o.size*n;if(s>=e)return{increment:s*1e3,multiplier:n}}let r=t[t.length-1],i=r.increments[r.increments.length-1];return{increment:r.size*i*1e3,multiplier:i}}function dt(e,t,r){return[t,r]}function ht(e,t,r,i){let o=r-t,n=e.width,s=Math.floor(n/100),a=o/s,{increment:u,multiplier:c}=De(a),m=u/1e3,h=[];if(o<12*3600){let l=Math.ceil(t/m)*m;for(;l<=r;l+=m)h.push(l);return h}if(o<3*86400){if(u>=6*3600*1e3){let f=u/1e3/3600,g=new Date(t*1e3);if(i==="UTC"){let b=g.getUTCHours(),v=Math.floor(b/f)*f;g.setUTCHours(v,0,0,0)}else{let b=g.getHours(),v=Math.floor(b/f)*f;g.setHours(v,0,0,0)}let p=g.getTime()/1e3;for(p<t&&(p+=m);p<=r;)h.push(p),p+=m;return h}let l=Math.ceil(t/m)*m;for(;l<=r;l+=m)h.push(l);return h}if(u>=S.day){let l=new Date(t*1e3);i==="UTC"?(l.setUTCHours(0,0,0,0),l.getTime()/1e3<t&&l.setUTCDate(l.getUTCDate()+c)):(l.setHours(0,0,0,0),l.getTime()/1e3<t&&l.setDate(l.getDate()+c));let f=l.getTime()/1e3;for(;f<=r;)h.push(f),i==="UTC"?l.setUTCDate(l.getUTCDate()+c):l.setDate(l.getDate()+c),f=l.getTime()/1e3;return h}let d=Math.ceil(t/m)*m;for(;d<=r;d+=m)h.push(d);return h}function ft(e,t,r){return t.length===0?[]:t.map((i,o)=>o===0||o===t.length-1?(0,F.dateTimeFormatTimeAgo)(i*1e3,{timeZone:r}):"")}function bt(e,t,r){let i=e.scales.x,o=((i?.max??0)-(i?.min??0))*1e3,n=Math.floor(e.width/100),s=o/1e3/n,{increment:a}=De(s),u=t.map(c=>c*1e3);return mt(u,a,o,r)}function Ve(e,t,r=!1){let i=r?(n,s,a,u)=>dt(n,a,u):(n,s,a,u)=>ht(n,a,u,t),o=r?(n,s)=>ft(n,s,t):(n,s)=>bt(n,s,t);return{font:W(e),labelFont:W(e),grid:{show:!1,width:.5},ticks:{width:.5},splits:i,values:o,size:20}}var X=require("@floating-ui/dom"),ze=require("react-dom/client"),gt=4,yt=8,be=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,ze.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,X.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,X.offset)({mainAxis:gt,crossAxis:yt}),(0,X.flip)()]});r.style.left=`${i}px`,r.style.top=`${o}px`}}},E=new be;var ge=require("@unblind/units"),ye=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 Oe(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)=>Oe(t).localeCompare(Oe(r)))}function Tt(e){let t={};return e.forEach(r=>{let i=qe(r);t[i]||(t[i]=[]),t[i].push(r)}),t}function vt(e,t,r,i="original"){if(r==="flat")return[{label:"",items:t?Fe(e):Be(e)}];let o=Tt(e);return Object.keys(o).sort((s,a)=>s.localeCompare(a)).map(s=>{let a=o[s];if(!a)return{label:ae(s,i),items:[]};let u=t?Fe(a):Be(a);return{label:ae(s,i),items:u}})}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 xt(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,n]=t;return(0,y.jsxs)("div",{className:"ub-tooltip-item-attribute-container",children:[(0,y.jsxs)("div",{className:"ub-truncate"+(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 ub-truncate",children:n})]}),!i&&e&&(0,y.jsx)("span",{"data-text":", ",className:"ub-tooltip-item-attribute-divider"})]})}function Ct({item:e,hideMetric:t,hideAttributeKey:r,hideAttributes:i,format:o}){let s=Object.entries(e.attributes||{}),a=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,c)=>(0,y.jsx)(Ke,{hideAttributeKey:r,attribute:u,format:o,isLastAttribute:c>=s.length-1},"attr_"+u[0]))}):(0,y.jsx)("span",{className:"ub-truncate"+(a?" ub-tooltip-item-metric-name-label":" ub-tooltip-item-metric-name"),children:ae(e.metric.name,o)})]}),a&&!t&&(0,y.jsx)("div",{className:"ub-tooltip-item-attributes",children:s.map((u,c)=>(0,y.jsx)(Ke,{hideAttributeKey:r,attribute:u,format:o,isLastAttribute:c>=s.length-1},"attr_"+u[0]))})]}),(0,y.jsx)("div",{className:"ub-tooltip-item-value ub-truncate",children:e.formattedValue??(0,y.jsx)("span",{className:"ub-tooltip-item-value--empty",children:"\u2014"})})]})}function Pt({className:e="ub-tooltip-divider",...t}){return(0,y.jsx)("hr",{role:"presentation",...t,className:e})}function wt({group:e,groupIdx:t,hideAttributeKey:r,hideMetric:i,hideAttributes:o,format:n,hideGroupLabel:s}){return(0,y.jsxs)("div",{className:"ub-tooltip-group",children:[!s&&(0,y.jsx)("div",{className:`ub-tooltip-group-header ub-truncate${t>0?" ub-tooltip-group-header--separator":""}`,children:e.label}),(0,y.jsx)("div",{className:"ub-tooltip-items",children:e.items.map((a,u)=>(0,y.jsx)(Ct,{item:a,format:n,hideAttributeKey:r,hideMetric:i,hideAttributes:o},`item-${t}-${u}`))})]},e.label)}function He({timestamp:e,items:t,timeZone:r,spansMultipleDays:i,sortByValues:o,format:n="original",layout:s="flat",hideAttributeKey:a,hideMetric:u,hideAttributes:c}){let m=i?(0,ge.dateTimeFormat)(e*1e3,{format:"MMM DD, HH:mm",timeZone:r}):(0,ge.dateTimeFormat)(e*1e3,{format:"HH:mm",timeZone:r}),h=(0,ye.useMemo)(()=>xt(t,s),[t,s]),d=h==="flat",f=typeof u=="boolean"?u:h==="group-by-metric",g=typeof a=="boolean"?a:!1,p=typeof c=="boolean"?c:!1,b=(0,ye.useMemo)(()=>vt(t,o,h,n),[t,o,h,n]);return(0,y.jsxs)("div",{className:"ub-tooltip",children:[(0,y.jsx)("div",{className:"ub-tooltip-datetime",children:m}),(0,y.jsx)(Pt,{}),b.length>0?(0,y.jsx)("div",{className:"ub-tooltip-content",children:b.map((v,T)=>(0,y.jsx)(wt,{group:v,groupIdx:T,hideAttributeKey:g,hideMetric:f,hideAttributes:p,hideGroupLabel:d,format:n},v.label))}):(0,y.jsx)("div",{className:"ub-tooltip-no-data",children:"No data available"})]})}var Te=require("react/jsx-runtime");function At(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),n=new Date(i*1e3),s=a=>t==="UTC"?`${a.getUTCFullYear()}-${a.getUTCMonth()}-${a.getUTCDate()}`:a.toLocaleDateString(void 0,{timeZone:t});return s(o)!==s(n)}function kt(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 n=t-o,s=t+o;if(n>=0){for(let a=1;a<e.series.length;a++)if(e.data[a]?.[n]!=null)return n}if(s<i){for(let a=1;a<e.series.length;a++)if(e.data[a]?.[s]!=null)return s}}return t}function St(e,t,r,i,o,n){let s=!1,a=[];for(let u=1;u<e.series.length;u++){let c=e.data[u]?.[t]??null;if(i&&c!=null&&u>1){let p=e.data[u-1]?.[t]??0;c=c-p}let m=e.series[u],h=n?.[u-1];if(!h){console.warn("Original serie not found");continue}let d=o[h.metric];if(!d){console.warn("Metric metadata not found");continue}let l=m?.stroke,f=typeof l=="function"?l(e,u):l??"#ffffff00",g=c==null?void 0:r?r(c):String(c);h?.attributes&&Object.keys(h?.attributes).length>0&&(s=!0),a.push({metric:d,color:f,value:c===null?void 0:c,formattedValue:g,attributes:h?.attributes,serie:m})}return{items:a,hasAttributes:s}}function _e(e,t,r,i,o,n,s,a,u,c,m,h){let d,l,f,g=!1;function p(){let b=d.getBoundingClientRect();l=b.left,f=b.top}return{hooks:{init:b=>{E.initialize(),d=b.over,window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),d.onmouseenter=()=>{g=!0,E.show()},d.onmouseleave=()=>{g=!1,E.getRenderedUplot()===b&&E.hide(b)},p()},setSize:()=>{p()},setCursor:b=>{let{left:v,top:T,idx:C}=b.cursor;if(!g||C==null){E.getRenderedUplot()===b&&E.hide(b);return}let x=b.data[0],w=At(x,o),R=kt(b,C),A=b.data[0][R];if(A===void 0)return;let{items:M}=St(b,R,e,t,r,s);E.show();let D=n,B=D?(0,Te.jsx)(D,{timestamp:A,items:M,timeZone:o}):(0,Te.jsx)(He,{timestamp:A,items:M,timeZone:o,spansMultipleDays:w,stacked:t,sortByValues:i,layout:a,format:u,hideAttributeKey:c,hideAttributes:m,hideMetric:h});E.render(b,B),E.positionTooltip({left:(v||0)+l,top:(T||0)+f})},destroy(b){window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p),d&&(d.onmouseenter=null,d.onmouseleave=null),E.getRenderedUplot()===b&&E.hide(b)}}}}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)"],W=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 Rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Array.isArray(e.fill)&&Array.isArray(e.border)}function Lt(e){return Array.isArray(e)}var je=(e,t,r,i,o,n)=>{if(r)return Lt(r)?r[t]:Rt(r)?n?r.fill[t]:r.border[t]:r(e,t,i,n);let s=n?`--ub-chart-serie-color-fill-${t+1}`:`--ub-chart-serie-color-${t+1}`,a=o.getPropertyValue(s).trim();return a||(n&&(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=J.default.paths.bars({size:[.6,100],radius:0,gap:0}),r=J.default.paths.linear({alignGaps:0}),i=J.default.paths.spline({alignGaps:1}),o=J.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}},Et=(e,t,r,i,o)=>je(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}},Nt=(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 n=0,s=0,a=o.length-1;for(;a-s>1;){let l=Math.floor((s+a)/2),f=o[l];f!=null&&f<i?s=l:a=l}let u=o[s],c=o[a];u!=null&&c!=null?n=Math.abs(u-i)<Math.abs(c-i)?s:a:u!=null?n=s:c!=null&&(n=a);let m=n;for(let l=n;l>=0;l--){let f=!1;for(let g=1;g<e.data.length;g++){let p=e.data[g];if(p&&p[l]!=null){f=!0;break}}if(f){m=l;break}}let h=o[m];return h==null?[t,r]:[e.valToPos(h,"x"),r]},It=(e,t)=>{let r=t.getPropertyValue("--ub-chart-font-color").trim(),i=t.getPropertyValue("--ub-chart-grid-color").trim(),o=e.axes?.[0],n=e.axes?.[1];return o&&(o.stroke=r,o.grid?o.grid.stroke=i:o.grid={stroke:i}),n&&(n.stroke=r,n.grid?n.grid.stroke=i:n.grid={stroke:i}),e},Dt=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}`).trim()||e.getPropertyValue("--ub-chart-threshold-default").trim(),Vt=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}-fill`).trim()||e.getPropertyValue("--ub-chart-threshold-default-fill").trim(),zt=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],Ft=(e,t)=>{if(t){let r=[];return t.forEach(i=>{let o={label:i.label,stroke:Dt(e,i.level),width:zt(),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[]},Bt=(e,t,r,i)=>{if(!i||!i.some(n=>Y(n)))return t.bands;let o=i.map((n,s)=>Y(n)?{series:[e.length+s*2+1,e.length+s*2+2],fill:Vt(r,n.level),dir:1}:null).filter(n=>n!==null);return[...t.bands,...o]},Kt=(e,t,r,i,o,n,s)=>{let a=Mt(t,i);return[{},...e.map((u,c)=>({label:u.metric,stroke:je(u,c,r,t,n),width:a,points:{show:!1},spanGaps:!0,paths:Ut(t),fill:i||o?Et(u,c,r,t,n):void 0})),...Ft(n,s)]},qt=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},Qe=(e,t,r,i,o,n,s,a,u,c,m,h,d,l,f,g,p,b,v,T,C)=>{let P=window.getComputedStyle(e),x=P.fontFamily,w=e?.clientWidth??1050,R=e?.clientHeight??250,A=qt(i),M=(0,Ge.getValueFormat)(A==="1"?null:A),D=L=>{let K=M(L,Number.isInteger(L)?0:2);return K.text+(K.suffix?.trim()||"")},B={width:w,height:R,scales:{y:{range:We(i,T,C)}},plugins:[_e(D,s,t,c,m,h,o,f,l,g,p,b)],padding:d?[10,15,10,15]:[8,15,8,15],cursor:{y:!1,sync:{key:"_"},drag:{setScale:!0,x:!0,y:!1},move:Nt},series:Kt(o,n,a,u,s,P,v),bands:Bt(o,r,P,v),axes:[Ve(x,m,d),Xe(M,x)],legend:{show:!1}};return It(B,P)};var Ye=(e,t=4)=>{let r=e/t,i=Math.pow(10,Math.floor(Math.log10(r))),o=r/i,n;return o>5?n=10*i:o>2?n=5*i:o>1?n=2*i:n=i,Math.ceil(e/n)*n},k=(e,t)=>typeof e=="number"?e:t,We=(e,t,r)=>(i,o,n)=>{if(o===0&&n===0)return[k(t,0),k(r,100)];let s=1,a=n*(1+s),u=o<0?o*(1+s):o*(1-s);if(e==="percent"||e==="percentunit")return n>100?o<0?[k(t,u),k(r,a)]:[k(t,0),k(r,a)]:o<0?[k(t,u),k(r,100)]:[k(t,0),k(r,100)];if(n<=.9999)return o<=0?[k(t,u),k(r,1)]:[k(t,0),k(r,1)];let c=Ye(a),m=Ye(Math.abs(u));return o<0?[k(r,-m),k(r,c)]:[k(t,0),k(r,c)]},Ht=(e,t,r,i)=>{let o=e.axes[r];if(i>1)return o?._size||0;let n=(o?.ticks?.size||0)+(o?.gap||0),s=(t??[]).reduce((a,u)=>u.length>a.length?u:a,"");return s!=""&&(e.ctx.font=o?.font?.[0]??e.ctx.font,n+=e.ctx.measureText(s).width/devicePixelRatio),Math.ceil(n)};function Xe(e,t){return{gap:0,font:W(t),labelFont:W(t),grid:{show:!0,width:.5},ticks:{width:.5},values:(r,i)=>i.map(o=>{let n=e(o);return n.text+(n.suffix?.trim()||"")}),size:Ht,space:60}}function Je(e,t){let r=[],i=e[0],o=i.length,n=Array(o).fill(0),s=[i];return e.forEach((a,u)=>{u!==0&&(t?s.push(a):s.push(a.map((c,m)=>n[m]=n[m]+(c||0))))}),e.forEach((a,u)=>{u===0||t||r.push({series:[e.findIndex((c,m)=>m>u),u]})}),{data:s,bands:r.filter(a=>a.series[1]>-1)}}var et=require("react/jsx-runtime");function ue(e){let{times:t,series:r,metadata:i,type:o,className:n,timeZone:s,options:a,tooltip:u,colors:c,tooltipComponent:m,sortByValues:h=!1,unit:d,fill:l=!1,thresholds:f,min:g,max:p}=e,{layout:b,format:v,hideAttributeKey:T,hideAttributes:C,hideMetric:P}=u||{},x=(0,le.useRef)(null),w=_(),R=c||w.colors;return(0,le.useEffect)(()=>{if(!r||r.length===0){console.warn("No series provided");return}let A=[t],M=d;r.forEach(U=>{let G=i[U.metric];d||(M=$e(M,G)),A.push(U.values)}),f&&f.forEach(U=>{ne(U)?A.push(new Array(t.length).fill(U.value)):Y(U)&&(A.push(new Array(t.length).fill(U.from)),A.push(new Array(t.length).fill(U.to)))});let D=o==="bar"||o==="area",B=Je(A,!D),L=x.current,K=null;if(L){let U=Qe(L,i,B,M,r,o,D,R,l,h,s,m,!1,v,b,T,C,P,f,g,p);K=new Ze.default({...U,...a},B.data,L);let G=new ResizeObserver(()=>{K?.setSize({width:L.clientWidth,height:L.clientHeight})});return G.observe(L),()=>{K?.destroy(),G.disconnect()}}},[r,t,o,i,s,m,R,l,h,d,v,b,T,C,P,f,g,p,a]),(0,et.jsx)("div",{ref:x,className:"ub-chart-container"+(n?` ${n}`:"")})}var q=require("react/jsx-runtime");function rt({metrics:e,operator:t,attributes:r,groupBy:i,interval:o,type:n="line",className:s,appearance:a,unit:u,thresholds:c,min:m,max:h,colors:d,tooltip:l,sortByValues:f,fill:g}){let p=_(),b=o??p.interval,v=r??p.attributes,T=i??p.groupBy,C=t??p.operator,P=d??p.colors,x=typeof f=="boolean"?f:p.sortByValues,w=typeof g=="boolean"?g:p.fill,R=a?.components?.Tooltip??p.appearance.components.Tooltip,A=(0,tt.useMemo)(()=>({layout:l?.layout??p.tooltip?.layout,format:l?.format??p.tooltip?.format,hideAttributes:l?.hideAttributes??p.tooltip?.hideAttributes,hideAttributeKey:l?.hideAttributeKey??p.tooltip?.hideAttributeKey,hideMetric:l?.hideMetric??p.tooltip?.hideMetric}),[l?.layout,l?.format,l?.hideAttributes,l?.hideAttributeKey,l?.hideMetric,p.tooltip?.layout,p.tooltip?.format,p.tooltip?.hideAttributes,p.tooltip?.hideAttributeKey,p.tooltip?.hideMetric]),{isLoading:M,data:D,hasError:B}=ie({queries:(Array.isArray(e)?e:[e]).map(V=>({metrics:[V],operator:C,attributes:v,groupBy:T})),timeRange:p.timeRange,startTime:p.startTime,endTime:p.endTime,interval:b}),{series:L,times:K,metadata:U}=D,G=L.every(V=>V.isEmpty),ce=`ub-chart-container${s?` ${s}`:""}`;if(M){let V=a?.components?.Loading??p.appearance.components.Loading;return(0,q.jsx)("div",{className:ce,children:(0,q.jsx)(V,{})})}if(B){let V=a?.components?.Error??p.appearance.components.Error;return(0,q.jsx)("div",{className:ce,children:(0,q.jsx)(V,{})})}if(G){let V=a?.components?.Empty??p.appearance.components.Empty;return(0,q.jsx)("div",{className:ce,children:(0,q.jsx)(V,{})})}return(0,q.jsx)(ue,{times:K,series:L,metadata:U,type:n,className:s,tooltip:A,colors:P,sortByValues:x,unit:u,fill:w,tooltipComponent:R,thresholds:c,min:m,max:h})}0&&(module.exports={Chart,Empty,Error,Loading,Scope,Timeseries,UnblindProvider,useLogs,useMetrics,useRefresh,useScope,useTimeseries,useUsage});
1
+ "use strict";var it=Object.create;var ee=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var st=Object.getOwnPropertyNames;var lt=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty;var ct=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})},ve=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of st(t))!ut.call(e,o)&&o!==r&&ee(e,o,{get:()=>t[o],enumerable:!(n=at(t,o))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?it(lt(e)):{},ve(t||!e||!e.__esModule?ee(r,"default",{value:e,enumerable:!0}):r,e)),pt=e=>ve(ee({},"__esModule",{value:!0}),e);var Wt={};ct(Wt,{Chart:()=>ue,Empty:()=>te,Error:()=>re,Loading:()=>oe,Scope:()=>ne,Timeseries:()=>nt,UnblindProvider:()=>Pe,useLogs:()=>Ie,useMetrics:()=>Se,useRefresh:()=>de,useScope:()=>G,useTimeseries:()=>ie,useUsage:()=>Ee});module.exports=pt(Wt);var H=require("@tanstack/react-query"),O=require("react"),me=require("react/jsx-runtime"),Ce=(0,O.createContext)(void 0);function xe({children:e,queryClient:t,queryClientConfig:r,apiBaseUrl:n="/api/unblind",fetchImpl:o}){let i=(0,O.useMemo)(()=>{if(t)return t;let a={refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1},u={defaultOptions:{queries:a}};return r?new H.QueryClient({...r,defaultOptions:{...r.defaultOptions,queries:{...a,...r.defaultOptions?.queries}}}):new H.QueryClient(u)},[t,r]),s=(0,O.useMemo)(()=>({apiBaseUrl:n,fetchImpl:o}),[n,o]);return(0,me.jsx)(H.QueryClientProvider,{client:i,children:(0,me.jsx)(Ce.Provider,{value:s,children:e})})}function z(){let e=(0,O.useContext)(Ce);if(!e)throw new Error("useUnblindConfig must be used within an UnblindClientProvider. Please wrap your app or component tree with <UnblindClientProvider>.");return e}function de(){let e=(0,H.useQueryClient)();return(0,O.useCallback)(async()=>{await e.refetchQueries({queryKey:["unblind","timeseries"]})},[e])}var F=require("react");var D=require("react/jsx-runtime");function te(){return(0,D.jsx)("div",{className:"ub-default",children:(0,D.jsxs)("div",{className:"ub-empty-content",children:[(0,D.jsx)("div",{className:"ub-empty-icon-wrapper",children:(0,D.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,D.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,D.jsx)("p",{className:"ub-empty-text","data-text":"No data available for this time range"})]})})}function re(){return(0,D.jsx)("div",{className:"ub-error"})}function oe(){return(0,D.jsx)("div",{className:"ub-default","data-text":"Loading"})}var Ae=require("react/jsx-runtime"),he=(0,F.createContext)(void 0);function ne({children:e,timeRange:t,startTime:r,endTime:n,interval:o,attributes:i,groupBy:s,operator:a,appearance:u,tooltip:c,colors:h,fill:m,sortByValues:d}){let l=(0,F.useContext)(he),f=u?.components?.Loading||l?.appearance?.components?.Loading,y=u?.components?.Error||l?.appearance?.components?.Error,p=u?.components?.Tooltip||l?.appearance?.components?.Tooltip,b=u?.components?.Empty||l?.appearance?.components?.Empty,C=c?.layout||l?.tooltip?.layout,T=c?.labelFormat||l?.tooltip?.labelFormat,x=typeof c?.hideAttributes=="boolean"?c?.hideAttributes:l?.tooltip?.hideAttributes,k=typeof c?.hideAttributeKey=="boolean"?c?.hideAttributeKey:l?.tooltip?.hideAttributeKey,v=typeof c?.hideMetric=="boolean"?c?.hideMetric:l?.tooltip?.hideMetric,A=(0,F.useMemo)(()=>({components:{...f&&{Loading:f},...y&&{Error:y},...p&&{Tooltip:p},...b&&{Empty:b}}}),[f,y,p,b]),L=(0,F.useMemo)(()=>({layout:C,labelFormat:T,hideAttributes:x,hideAttributeKey:k,hideMetric:v}),[C,T,x,k,v]),R=(0,F.useMemo)(()=>({timeRange:t??l?.timeRange,startTime:r??l?.startTime,endTime:n??l?.endTime,interval:o??l?.interval,attributes:i??l?.attributes,groupBy:s??l?.groupBy,operator:a??l?.operator,colors:h??l?.colors,sortByValues:typeof d=="boolean"?d:l?.sortByValues,fill:typeof m=="boolean"?m:l?.fill,appearance:A,tooltip:L}),[t,r,n,o,i,s,a,h,d,m,A,L,l]);return(0,Ae.jsx)(he.Provider,{value:R,children:e})}var mt="6h";function G(){let e=(0,F.useContext)(he);return(0,F.useMemo)(()=>({...e,timeRange:e?.timeRange||mt,appearance:{components:{Loading:e?.appearance?.components?.Loading??oe,Error:e?.appearance?.components?.Error??re,Empty:e?.appearance?.components?.Empty??te,Tooltip:e?.appearance?.components?.Tooltip}}}),[e])}var fe=require("react/jsx-runtime");function Pe({children:e,queryClient:t,apiBaseUrl:r,fetchImpl:n,timeRange:o,startTime:i,endTime:s,interval:a,attributes:u,groupBy:c,operator:h,appearance:m,tooltip:d,colors:l,sortByValues:f}){return(0,fe.jsx)(xe,{queryClient:t,apiBaseUrl:r,fetchImpl:n,children:(0,fe.jsx)(ne,{timeRange:o,startTime:i,endTime:s,interval:a,attributes:u,groupBy:c,operator:h,appearance:m,tooltip:d,colors:l,sortByValues:f,children:e})})}var ke=require("@tanstack/react-query");function Se(){let{apiBaseUrl:e,fetchImpl:t=fetch}=z(),r=(0,ke.useQuery)({queryKey:["unblind","metrics"],queryFn:async()=>{let n=await t(`${e}/metrics`,{headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error("Error loading metrics metadata");if(n.status===200){let{data:o}=await n.json();return o}else throw new Error("Unexpected status code")}});return{metrics:r.data,isLoading:r.isLoading,hasError:r.isError,refetch:r.refetch}}var Le=require("@tanstack/react-query"),Q=require("react");var we=pe(require("ms"));function dt(e){let t=Math.floor(Date.now()/1e3);return[t-Math.floor((0,we.default)(e)/1e3),t]}function $(e,t,r){let n,o;if(typeof t=="number"&&typeof r=="number")n=t,o=r;else if(e){let[i,s]=dt(e);n=i,o=s}else throw new Error("Either timeRange or both startTime and endTime must be provided");return[n,o]}function ie({queries:e,timeRange:t,startTime:r,endTime:n,interval:o}){let{apiBaseUrl:i,fetchImpl:s=fetch}=z(),a=(0,Q.useMemo)(()=>e.map(T=>T.metrics.join(",")).join(","),[e]),u=(0,Q.useMemo)(()=>e.map(T=>{let x=T.attributes;if(!x)return"";let k=Object.keys(x);return k.length===0?"":k.map(v=>v+":"+x[v]?.join(",")).join(",")}).join(","),[e]),c=(0,Q.useMemo)(()=>e.map(T=>T.operator),[e]),h=(0,Q.useMemo)(()=>e.map(T=>T.groupBy).join(", "),[e]),d=(0,Le.useQuery)({queryKey:["unblind","timeseries",a,u,r,n,t,o,c,h],queryFn:async()=>{if(!a)throw new Error("Missing required parameters");if(a.length===0)throw new Error("No series provided");let[T,x]=$(t,r,n),k={queries:e,startTime:T,endTime:x,interval:o},v=await s(`${i}/tenants/timeseries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});if(!v.ok)throw new Error("Error fetching metric");let{series:A,times:L,metadata:R}=await v.json();if(!A)throw console.error("Series not found"),new Error("Series not found");return{series:A,times:L,metadata:R}},enabled:!!a&&(typeof r=="number"&&typeof n=="number"||!!t)}),{metadata:l,series:f,times:y}=(0,Q.useMemo)(()=>d.data?{series:d.data.series,times:d.data.times,metadata:d.data.metadata}:{series:[],times:[],metadata:{}},[d]),p=d.isLoading,b=d.isFetching,C=d.isError;return{data:{series:f,times:y,metadata:l},isLoading:p,isFetching:b,hasError:C,refetch:d.refetch}}var Re=require("@tanstack/react-query"),Ue=require("react");function Ee({timeRange:e,startTime:t,endTime:r}){let{apiBaseUrl:n,fetchImpl:o=fetch}=z(),s=(0,Re.useQuery)({queryKey:["unblind","usage",e,t,r],queryFn:async()=>{let[h,m]=$(e,t,r),d=`${n}/tenants/usage`,l=await o(d,{headers:{"Content-Type":"application/json"},body:JSON.stringify({startTime:h,endTime:m})});if(!l.ok)throw new Error("Error fetching usage");let{data:f}=await l.json();if(!f)throw new Error("usage not found");return f},enabled:typeof t=="number"&&typeof r=="number"||!!e}),a=(0,Ue.useMemo)(()=>s.data?s.data||[]:[],[s]),u=s.isLoading||s.isRefetching,c=s.isError;return{usage:a,isLoading:u,hasError:c,refetch:s.refetch}}var Me=require("@tanstack/react-query"),Ne=require("react");function Ie({timeRange:e,filters:t,startTime:r,endTime:n}){let{apiBaseUrl:o,fetchImpl:i=fetch}=z(),s=typeof r=="number"&&typeof n=="number"||!!e,a=(0,Me.useInfiniteQuery)({queryKey:["unblind","logs",e,t.map(c=>c.name+":"+c.value).sort().join(",")],queryFn:async({pageParam:c})=>{let h=t.reduce((v,A)=>(v[A.name]||(v[A.name]=[]),v[A.name].push(A.value),v),{}),{body:m=[],severity:d=[],"service.name":l=[],"trace.id":f=[],"span.id":y=[],...p}=h,[b,C]=$(e,r,n),T=await i(`${o}/tenants/logs`,{method:"POST",body:JSON.stringify({filter:{attributes:p,body:m,severity:d,traceId:f,spanId:y,service:l},startTime:b,endTime:C,pagination:{page:c}}),headers:{"Content-Type":"application/json"}});if(!T.ok)throw new Error("Error fetching logs");let{data:x,next_page:k}=await T.json();if(!x)throw new Error("data not found");return{data:x,next_page:k}},enabled:s,initialPageParam:void 0,getNextPageParam:c=>c.next_page});return{logs:(0,Ne.useMemo)(()=>a.data?a.data.pages.flatMap(c=>c.data||[]):[],[a.data]),isLoading:a.isLoading,hasError:a.isError,hasNextPage:a.hasNextPage??!1,fetchNextPage:a.fetchNextPage,isFetchingNextPage:a.isFetchingNextPage,refetch:a.refetch}}var ot=require("react");var le=require("react"),tt=pe(require("uplot"));var Y=e=>"value"in e,ae=e=>"from"in e&&"to"in e;var Z=pe(require("uplot")),Qe=require("@unblind/units");var B=require("@unblind/units");var S={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 ht(e,t,r,n){if(t>7*S.day){let o=B.systemDateFormats.interval.year,i=Math.round(S.year/S.day)*S.day;return Math.round(t/S.day)*S.day===i?o=B.systemDateFormats.interval.year:t<=S.year?o=B.systemDateFormats.interval.month:o=B.systemDateFormats.interval.day,e.map(a=>(0,B.dateTimeFormat)(a,{format:o,timeZone:n}))}return e.map(o=>{let i=new Date(o),s=t<S.minute,a=t<S.second,u=i.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:n});return(u==="00:00"||u==="24:00")&&!s&&!a?i.toLocaleDateString(void 0,{day:"2-digit",month:"short",timeZone:n}):i.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:s?"2-digit":void 0,fractionalSecondDigits:a?3:void 0,hour12:!1,timeZone:n})})}function De(e){let t=[{size:S.second/1e3,increments:j.second},{size:S.minute/1e3,increments:j.minute},{size:S.hour/1e3,increments:j.hour},{size:S.day/1e3,increments:j.day},{size:S.month/1e3,increments:j.month},{size:S.year/1e3,increments:j.year}];for(let o of t)for(let i of o.increments){let s=o.size*i;if(s>=e)return{increment:s*1e3,multiplier:i}}let r=t[t.length-1],n=r.increments[r.increments.length-1];return{increment:r.size*n*1e3,multiplier:n}}function ft(e,t,r){return[t,r]}function bt(e,t,r,n){let o=r-t,i=e.width,s=Math.floor(i/100),a=o/s,{increment:u,multiplier:c}=De(a),h=u/1e3,m=[];if(o<12*3600){let l=Math.ceil(t/h)*h;for(;l<=r;l+=h)m.push(l);return m}if(o<3*86400){if(u>=6*3600*1e3){let f=u/1e3/3600,y=new Date(t*1e3);if(n==="UTC"){let b=y.getUTCHours(),C=Math.floor(b/f)*f;y.setUTCHours(C,0,0,0)}else{let b=y.getHours(),C=Math.floor(b/f)*f;y.setHours(C,0,0,0)}let p=y.getTime()/1e3;for(p<t&&(p+=h);p<=r;)m.push(p),p+=h;return m}let l=Math.ceil(t/h)*h;for(;l<=r;l+=h)m.push(l);return m}if(u>=S.day){let l=new Date(t*1e3);n==="UTC"?(l.setUTCHours(0,0,0,0),l.getTime()/1e3<t&&l.setUTCDate(l.getUTCDate()+c)):(l.setHours(0,0,0,0),l.getTime()/1e3<t&&l.setDate(l.getDate()+c));let f=l.getTime()/1e3;for(;f<=r;)m.push(f),n==="UTC"?l.setUTCDate(l.getUTCDate()+c):l.setDate(l.getDate()+c),f=l.getTime()/1e3;return m}let d=Math.ceil(t/h)*h;for(;d<=r;d+=h)m.push(d);return m}function gt(e,t,r){return t.length===0?[]:t.map((n,o)=>o===0||o===t.length-1?(0,B.dateTimeFormatTimeAgo)(n*1e3,{timeZone:r}):"")}function yt(e,t,r){let n=e.scales.x,o=((n?.max??0)-(n?.min??0))*1e3,i=Math.floor(e.width/100),s=o/1e3/i,{increment:a}=De(s),u=t.map(c=>c*1e3);return ht(u,a,o,r)}function Fe(e,t,r=!1){let n=r?(i,s,a,u)=>ft(i,a,u):(i,s,a,u)=>bt(i,a,u,t),o=r?(i,s)=>gt(i,s,t):(i,s)=>yt(i,s,t);return{font:W(e),labelFont:W(e),grid:{show:!1,width:.5},ticks:{width:.5},splits:n,values:o,size:20}}var X=require("@floating-ui/dom"),Ve=require("react-dom/client"),Tt=4,vt=8,be=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,Ve.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:n,y:o}=await(0,X.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,X.offset)({mainAxis:Tt,crossAxis:vt}),(0,X.flip)()]});r.style.left=`${n}px`,r.style.top=`${o}px`}}},U=new be;var ge=require("@unblind/units"),ye=require("react");function Ke(e){return e.metric.displayName||e.metric.name||(typeof e.serie.label=="string"?e.serie.label:e.serie.label?.textContent||"Unknown")}function Oe(e){let t=e.attributes||{};if(t["service.name"])return String(t["service.name"]);let n=Object.keys(t)[0];return n?String(t[n]):"z-fallback"}function ze(e){return[...e].sort((t,r)=>(Number(r.value)||0)-(Number(t.value)||0))}function Be(e){return[...e].sort((t,r)=>Oe(t).localeCompare(Oe(r)))}function Ct(e){let t={};return e.forEach(r=>{let n=Ke(r);t[n]||(t[n]=[]),t[n].push(r)}),t}function qe(e,t,r,n="original"){if(r==="flat")return[{label:"",items:t?ze(e):Be(e)}];let o=Ct(e);return Object.keys(o).sort((s,a)=>s.localeCompare(a)).map(s=>{let a=o[s];if(!a)return{label:J(s,n),items:[]};let u=t?ze(a):Be(a);return{label:J(s,n),items:u}})}function J(e,t,r){switch(t){case"suffix":{let n=e.split(/[._-]/),o=n[n.length-1]||"";return r?o:o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}case"title":return e.split(/[._-]/).map(n=>r?n:n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join(" ");default:return e}}function He(e,t){if(t&&t!=="auto")return t;let r=e.some(o=>o.attributes&&Object.keys(o.attributes).length>0),n=new Set(e.map(Ke));return r&&n.size>=1?"group-by-metric":"flat"}var g=require("react/jsx-runtime");function xt(){return(0,g.jsx)("span",{"data-text":", ",className:"ub-tooltip-item-attribute-divider"})}function At({value:e}){return(0,g.jsx)("span",{className:"ub-tooltip-item-attribute-value ub-truncate",children:e})}function Pt({keyValue:e,labelFormat:t}){return(0,g.jsxs)("span",{className:"ub-tooltip-item-attribute-key",children:[J(e,t),":"]})}function kt({children:e}){return(0,g.jsx)("div",{className:"ub-tooltip-item-attribute-container",children:e})}function St({hideAttributeKey:e,children:t}){return(0,g.jsx)("div",{className:"ub-truncate"+(e?" ub-tooltip-item-hidden-attribute-key":" ub-tooltip-item-attribute-with-key"),children:t})}function Ge({hideAttributeKey:e,attribute:t,labelFormat:r,isLastAttribute:n}){let[o,i]=t;return(0,g.jsxs)(kt,{children:[(0,g.jsxs)(St,{hideAttributeKey:e,children:[!e&&(0,g.jsx)(Pt,{keyValue:o,labelFormat:r}),(0,g.jsx)(At,{value:i})]}),!n&&e&&(0,g.jsx)(xt,{})]})}function wt({item:e,hideMetric:t,hideAttributeKey:r,hideAttributes:n,labelFormat:o}){let s=Object.entries(e.attributes||{}),a=s.length>0&&!n;return n&&t&&console.warn("Invalid configuration. Attributes and metrics are hidden."),(0,g.jsxs)("div",{className:"ub-tooltip-item-row",children:[(0,g.jsxs)("div",{className:"ub-tooltip-item-left"+(t?" ub-tooltip-item-hidden-metric":""),children:[(0,g.jsxs)("div",{className:"ub-tooltip-item-heading",children:[(0,g.jsx)("span",{className:"ub-tooltip-item-dot",style:{backgroundColor:e.color}}),t?(0,g.jsx)("div",{className:"ub-tooltip-item-attributes",children:s.map((u,c)=>(0,g.jsx)(Ge,{hideAttributeKey:r,attribute:u,labelFormat:o,isLastAttribute:c>=s.length-1},"attr_"+u[0]))}):(0,g.jsx)("span",{className:"ub-truncate"+(a?" ub-tooltip-item-metric-name-with-attributes":" ub-tooltip-item-metric-name-without-attributes"),children:J(e.metric.name,o)})]}),a&&!t&&(0,g.jsx)("div",{className:"ub-tooltip-item-attributes",children:s.map((u,c)=>(0,g.jsx)(Ge,{hideAttributeKey:r,attribute:u,labelFormat:o,isLastAttribute:c>=s.length-1},"attr_"+u[0]))})]}),(0,g.jsx)("div",{className:"ub-tooltip-item-value",children:e.formattedValue??(0,g.jsx)("span",{className:"ub-tooltip-item-value--empty",children:"\u2014"})})]})}function Lt({className:e="ub-tooltip-divider",...t}){return(0,g.jsx)("hr",{role:"presentation",...t,className:e})}function Rt({group:e,groupIdx:t,hideAttributeKey:r,hideMetric:n,hideAttributes:o,labelFormat:i,hideGroupLabel:s}){return(0,g.jsxs)("div",{className:"ub-tooltip-group",children:[!s&&(0,g.jsx)("div",{className:`ub-tooltip-group-header ub-truncate${t>0?" ub-tooltip-group-header--separator":""}`,children:e.label}),(0,g.jsx)("div",{className:"ub-tooltip-items",children:e.items.map((a,u)=>(0,g.jsx)(wt,{item:a,labelFormat:i,hideAttributeKey:r,hideMetric:n,hideAttributes:o},`item-${t}-${u}`))})]},e.label)}function _e({timestamp:e,items:t,timeZone:r,spansMultipleDays:n,sortByValues:o,labelFormat:i="original",layout:s="flat",hideAttributeKey:a,hideMetric:u,hideAttributes:c}){let h=n?(0,ge.dateTimeFormat)(e*1e3,{format:"MMM DD, HH:mm",timeZone:r}):(0,ge.dateTimeFormat)(e*1e3,{format:"HH:mm",timeZone:r}),m=(0,ye.useMemo)(()=>He(t,s),[t,s]),d=m==="flat",f=typeof u=="boolean"?u:m==="group-by-metric",y=typeof a=="boolean"?a:!1,p=typeof c=="boolean"?c:!1,b=(0,ye.useMemo)(()=>qe(t,o,m,i),[t,o,m,i]);return(0,g.jsxs)("div",{className:"ub-tooltip",children:[(0,g.jsx)("div",{className:"ub-tooltip-datetime",children:h}),(0,g.jsx)(Lt,{}),b.length>0?(0,g.jsx)("div",{className:"ub-tooltip-content",children:b.map((C,T)=>(0,g.jsx)(Rt,{group:C,groupIdx:T,hideAttributeKey:y,hideMetric:f,hideAttributes:p,hideGroupLabel:d,labelFormat:i},C.label))}):(0,g.jsx)("div",{className:"ub-tooltip-no-data",children:"No data available"})]})}var Te=require("react/jsx-runtime");function Ut(e,t){if(!e||e.length===0)return!1;let r=e[0],n=e[e.length-1];if(r==null||n==null)return!1;let o=new Date(r*1e3),i=new Date(n*1e3),s=a=>t==="UTC"?`${a.getUTCFullYear()}-${a.getUTCMonth()}-${a.getUTCDate()}`:a.toLocaleDateString(void 0,{timeZone:t});return s(o)!==s(i)}function Et(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 n=e.data[0].length;for(let o=1;t+o<n||t-o>=0;o++){let i=t-o,s=t+o;if(i>=0){for(let a=1;a<e.series.length;a++)if(e.data[a]?.[i]!=null)return i}if(s<n){for(let a=1;a<e.series.length;a++)if(e.data[a]?.[s]!=null)return s}}return t}function Mt(e,t,r,n,o,i){let s=!1,a=[];for(let u=1;u<e.series.length;u++){let c=e.data[u]?.[t]??null;if(n&&c!=null&&u>1){let p=e.data[u-1]?.[t]??0;c=c-p}let h=e.series[u],m=i?.[u-1];if(!m){console.warn("Original serie not found");continue}let d=o[m.metric];if(!d){console.warn("Metric metadata not found");continue}let l=h?.stroke,f=typeof l=="function"?l(e,u):l??"#ffffff00",y=c==null?void 0:r?r(c):String(c);m?.attributes&&Object.keys(m?.attributes).length>0&&(s=!0),a.push({metric:d,color:f,value:c===null?void 0:c,formattedValue:y,attributes:m?.attributes,serie:h})}return{items:a,hasAttributes:s}}function $e(e,t,r,n,o,i,s,a,u,c,h,m){let d,l,f,y=!1;function p(){let b=d.getBoundingClientRect();l=b.left,f=b.top}return{hooks:{init:b=>{U.initialize(),d=b.over,window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),d.onmouseenter=()=>{y=!0,U.show()},d.onmouseleave=()=>{y=!1,U.getRenderedUplot()===b&&U.hide(b)},p()},setSize:()=>{p()},setCursor:b=>{let{left:C,top:T,idx:x}=b.cursor;if(!y||x==null){U.getRenderedUplot()===b&&U.hide(b);return}let v=b.data[0],A=Ut(v,o),L=Et(b,x),R=b.data[0][L];if(R===void 0)return;let{items:E}=Mt(b,L,e,t,r,s);U.show();let I=i,M=I?(0,Te.jsx)(I,{timestamp:R,items:E,timeZone:o}):(0,Te.jsx)(_e,{timestamp:R,items:E,timeZone:o,spansMultipleDays:A,stacked:t,sortByValues:n,layout:a,labelFormat:u,hideAttributeKey:c,hideAttributes:h,hideMetric:m});U.render(b,M),U.positionTooltip({left:(C||0)+l,top:(T||0)+f})},destroy(b){window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p),d&&(d.onmouseenter=null,d.onmouseleave=null),U.getRenderedUplot()===b&&U.hide(b)}}}}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)"],W=e=>`${getComputedStyle(document.documentElement).getPropertyValue("--ub-chart-font-size").trim()} ${e}`,je=(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 Nt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Array.isArray(e.fill)&&Array.isArray(e.border)}function It(e){return Array.isArray(e)}var We=(e,t,r,n,o,i)=>{if(r)return It(r)?r[t]:Nt(r)?i?r.fill[t]:r.border[t]:r(e,t,n,i);let s=i?`--ub-chart-serie-color-fill-${t+1}`:`--ub-chart-serie-color-${t+1}`,a=o.getPropertyValue(s).trim();return a||(i&&(n==="step"||n==="line"||n==="spline")?`oklch(from ${se[t%se.length]} l c h / 0.4)`:se[t%se.length])},Dt=e=>{let t=Z.default.paths.bars({size:[.6,100],radius:0,gap:0}),r=Z.default.paths.linear({alignGaps:0}),n=Z.default.paths.spline({alignGaps:1}),o=Z.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 n;default:return r}},Ft=(e,t,r,n,o)=>We(e,t,r,n,o,!0),Vt=(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}},Ot=(e,t,r)=>{if(t<0||r<0)return[t,r];let n=e.posToVal(t,"x"),o=e.data[0];if(!o||o.length===0)return[t,r];let i=0,s=0,a=o.length-1;for(;a-s>1;){let l=Math.floor((s+a)/2),f=o[l];f!=null&&f<n?s=l:a=l}let u=o[s],c=o[a];u!=null&&c!=null?i=Math.abs(u-n)<Math.abs(c-n)?s:a:u!=null?i=s:c!=null&&(i=a);let h=i;for(let l=i;l>=0;l--){let f=!1;for(let y=1;y<e.data.length;y++){let p=e.data[y];if(p&&p[l]!=null){f=!0;break}}if(f){h=l;break}}let m=o[h];return m==null?[t,r]:[e.valToPos(m,"x"),r]},zt=(e,t)=>{let r=t.getPropertyValue("--ub-chart-font-color").trim(),n=t.getPropertyValue("--ub-chart-grid-color").trim(),o=e.axes?.[0],i=e.axes?.[1];return o&&(o.stroke=r,o.grid?o.grid.stroke=n:o.grid={stroke:n}),i&&(i.stroke=r,i.grid?i.grid.stroke=n:i.grid={stroke:n}),e},Bt=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}`).trim()||e.getPropertyValue("--ub-chart-threshold-default").trim(),Kt=(e,t)=>e.getPropertyValue(`--ub-chart-threshold-${t}-fill`).trim()||e.getPropertyValue("--ub-chart-threshold-default-fill").trim(),qt=e=>{switch(e){case"bold":return 2;case"line":return 1;case"dashed":return 1;default:return 1}},Ht=e=>e==="line"?void 0:[5,5],Gt=(e,t)=>{if(t){let r=[];return t.forEach(n=>{let o={label:n.label,stroke:Bt(e,n.level),width:qt(),dash:Ht(n.type),points:{show:!1,size:0},spanGaps:!0,show:!0,auto:!1};Y(n)||r.push(o),r.push(o)}),r}else return[]},_t=(e,t,r,n)=>{if(!n||!n.some(i=>ae(i)))return t.bands;let o=n.map((i,s)=>Y(i)?null:{series:[e.length+s*2+1,e.length+s*2+2],fill:Kt(r,i.level),dir:1}).filter(i=>i!==null);return[...t.bands,...o]},$t=(e,t,r,n,o,i,s)=>{let a=Vt(t,n);return[{},...e.map((u,c)=>({label:u.metric,stroke:We(u,c,r,t,i),width:a,points:{show:!1},spanGaps:!0,paths:Dt(t),fill:n||o?Ft(u,c,r,t,i):void 0})),...Gt(i,s)]},Qt=e=>typeof e=="string"&&String(e).toLowerCase().trim()==="by"?"bytes":e,Xe=(e,t,r,n,o,i,s,a,u,c,h,m,d,l,f,y,p,b,C,T,x,k)=>{let v=window.getComputedStyle(e),A=v.fontFamily,L=e?.clientWidth??1050,R=e?.clientHeight??250,E=Qt(n),I=(0,Qe.getValueFormat)(E==="1"?null:E),M=q=>{let w=I(q,k);return w.text+(w.suffix?.trim()||"")},N={width:L,height:R,scales:{y:{range:Ye(n,T,x)}},plugins:[$e(M,s,t,c,h,m,o,f,l,y,p,b)],padding:d?[10,15,10,15]:[8,15,8,15],cursor:{y:!1,sync:{key:"_"},drag:{setScale:!0,x:!0,y:!1},move:Ot},series:$t(o,i,a,u,s,v,C),bands:_t(o,r,v,C),axes:[Fe(A,h,d),Je(I,A)],legend:{show:!1}};return zt(N,v)};var Ze=(e,t=4)=>{let r=e/t,n=Math.pow(10,Math.floor(Math.log10(r))),o=r/n,i;return o>5?i=10*n:o>2?i=5*n:o>1?i=2*n:i=n,Math.ceil(e/i)*i},P=(e,t)=>typeof e=="number"?e:t,Ye=(e,t,r)=>(n,o,i)=>{if(o===0&&i===0)return[P(t,0),P(r,100)];let s=1,a=i*(1+s),u=o<0?o*(1+s):o*(1-s);if(e==="percent"||e==="percentunit"){let m=e==="percent"?100:1;return i>m?o<0?[P(t,u),P(r,a)]:[P(t,0),P(r,a)]:o<0?[P(t,u),P(r,m)]:[P(t,0),P(r,m)]}if(i<=.9999)return o<=0?[P(t,u),P(r,1)]:[P(t,0),P(r,1)];let c=Ze(a),h=Ze(Math.abs(u));return o<0?[P(r,-h),P(r,c)]:[P(t,0),P(r,c)]},jt=(e,t,r,n)=>{let o=e.axes[r];if(n>1)return o?._size||0;let i=(o?.ticks?.size||0)+(o?.gap||0),s=(t??[]).reduce((a,u)=>u.length>a.length?u:a,"");return s!=""&&(e.ctx.font=o?.font?.[0]??e.ctx.font,i+=e.ctx.measureText(s).width/devicePixelRatio),Math.ceil(i)};function Je(e,t){return{gap:0,font:W(t),labelFont:W(t),grid:{show:!0,width:.5},ticks:{width:.5},values:(r,n)=>n.map(o=>{let i=e(o);return i.text+(i.suffix?.trim()||"")}),size:jt,space:60}}function et(e,t){let r=[],n=e[0],o=n.length,i=Array(o).fill(0),s=[n];if(e.forEach((a,u)=>{u!==0&&(t?s.push(a):s.push(a.map((c,h)=>i[h]=i[h]+(c||0))))}),!t)for(let a=1;a<e.length-1;a++)r.push({series:[a+1,a]});return{data:s,bands:r.filter(a=>a.series[1]>-1)}}var rt=require("react/jsx-runtime");function ue(e){let{times:t,series:r,metadata:n,type:o,className:i,timeZone:s,options:a,tooltip:u,colors:c,tooltipComponent:h,sortByValues:m=!1,unit:d,fill:l=!1,thresholds:f,min:y,max:p}=e,{layout:b,labelFormat:C,hideAttributeKey:T,hideAttributes:x,hideMetric:k}=u||{},v=(0,le.useRef)(null),A=G(),L=c||A.colors;return(0,le.useEffect)(()=>{if(!r||r.length===0){console.warn("No series provided");return}let R=[t],E=d;r.forEach(w=>{let _=n[w.metric];d||(E=je(E,_)),R.push(w.values)});let I=o==="bar"||o==="area",M=et(R,!I);f&&f.forEach(w=>{Y(w)?M.data.push(new Array(t.length).fill(w.value)):ae(w)&&(M.data.push(new Array(t.length).fill(w.from)),M.data.push(new Array(t.length).fill(w.to)))});let N=v.current,q=null;if(N){let w=Xe(N,n,M,E,r,o,I,L,l,m,s,h,!1,C,b,T,x,k,f,y,p);q=new tt.default({...w,...a},M.data,N);let _=new ResizeObserver(()=>{q?.setSize({width:N.clientWidth,height:N.clientHeight})});return _.observe(N),()=>{q?.destroy(),_.disconnect()}}},[r,t,o,n,s,h,L,l,m,d,C,b,T,x,k,f,y,p,a]),(0,rt.jsx)("div",{ref:v,className:"ub-chart-container"+(i?` ${i}`:"")})}var K=require("react/jsx-runtime");function nt({metrics:e,operator:t,attributes:r,groupBy:n,interval:o,type:i="line",className:s,appearance:a,unit:u,thresholds:c,min:h,max:m,colors:d,tooltip:l,sortByValues:f,fill:y}){let p=G(),b=o??p.interval,C=r??p.attributes,T=n??p.groupBy,x=t??p.operator,k=d??p.colors,v=typeof f=="boolean"?f:p.sortByValues,A=typeof y=="boolean"?y:p.fill,L=a?.components?.Tooltip??p.appearance.components.Tooltip,R=(0,ot.useMemo)(()=>({layout:l?.layout??p.tooltip?.layout,format:l?.labelFormat??p.tooltip?.labelFormat,hideAttributes:l?.hideAttributes??p.tooltip?.hideAttributes,hideAttributeKey:l?.hideAttributeKey??p.tooltip?.hideAttributeKey,hideMetric:l?.hideMetric??p.tooltip?.hideMetric}),[l?.layout,l?.labelFormat,l?.hideAttributes,l?.hideAttributeKey,l?.hideMetric,p.tooltip?.layout,p.tooltip?.labelFormat,p.tooltip?.hideAttributes,p.tooltip?.hideAttributeKey,p.tooltip?.hideMetric]),{isLoading:E,data:I,hasError:M}=ie({queries:(Array.isArray(e)?e:[e]).map(V=>({metrics:[V],operator:x,attributes:C,groupBy:T})),timeRange:p.timeRange,startTime:p.startTime,endTime:p.endTime,interval:b}),{series:N,times:q,metadata:w}=I,_=N.every(V=>V.isEmpty),ce=`ub-chart-container${s?` ${s}`:""}`;if(E){let V=a?.components?.Loading??p.appearance.components.Loading;return(0,K.jsx)("div",{className:ce,children:(0,K.jsx)(V,{})})}if(M){let V=a?.components?.Error??p.appearance.components.Error;return(0,K.jsx)("div",{className:ce,children:(0,K.jsx)(V,{})})}if(_){let V=a?.components?.Empty??p.appearance.components.Empty;return(0,K.jsx)("div",{className:ce,children:(0,K.jsx)(V,{})})}return(0,K.jsx)(ue,{times:q,series:N,metadata:w,type:i,className:s,tooltip:R,colors:k,sortByValues:v,unit:u,fill:A,tooltipComponent:L,thresholds:c,min:h,max:m})}0&&(module.exports={Chart,Empty,Error,Loading,Scope,Timeseries,UnblindProvider,useLogs,useMetrics,useRefresh,useScope,useTimeseries,useUsage});
2
2
  //# sourceMappingURL=index.js.map