Skip to content

The only tool you need to know what is happening and how to fix it.

15.0 KB
Raw Blame
import"./DsnmJJEf.js";import{p as N,c as C,f as b,d as l,a as E,s as T,g as e,u,e as q,h as B,r as U,x as j,aa as Et,o as It,j as G,l as d,bk as At,ar as Pt,bl as Kt,bm as St,m as Rt}from"./BKFspo1J.js";import{c as Z}from"./CWm9VMfX.js";import{p as s,r as I,s as F}from"./CARHnQ8P.js";import{c as Ht,o as Mt,F as zt,P as Lt,b as Wt,g as bt,a as Bt}from"./C2bhSnr2.js";import{u as _t,o as Ut,C as wt,a as Gt,w as mt,m as Vt,p as jt,G as qt,b as Jt,n as st,P as Qt}from"./R7BU62x2.js";import{m as V,b as v,k as Tt,a as Ot,e as Dt,d as Xt,c as xt}from"./BoImjCaE.js";import{i as R}from"./COK9M2N0.js";import{d as H,s as yt}from"./DwMHXN8q.js";import{c as Ct}from"./BXr1Q65P.js";var Yt=Et('<svg viewBox="0 0 30 10" preserveAspectRatio="none" data-arrow=""><polygon points="0,0 30,0 15,10" fill="currentColor"></polygon></svg>'),Zt=q("<span><!></span>");function $t(h,t){N(t,!0);let r=s(t,"id",19,_t),o=s(t,"width",3,10),n=s(t,"height",3,5),a=I(t,["$$slots","$$events","$$legacy","id","children","child","width","height"]);const c=u(()=>V(a,{id:r()}));var m=C(),g=b(m);{var P=p=>{var y=C(),w=b(y);T(w,()=>t.child,()=>({props:e(c)})),l(p,y)},_=p=>{var y=Zt();H(y,()=>({...e(c)}));var w=B(y);{var M=f=>{var i=C(),D=b(i);T(D,()=>t.children??j),l(f,i)},O=f=>{var i=Yt();It(()=>{yt(i,"width",o()),yt(i,"height",n())}),l(f,i)};R(w,f=>{t.children?f(M):f(O,!1)})}U(y),l(p,y)};R(g,p=>{t.child?p(P):p(_,!1)})}l(h,m),E()}function te(h,t){N(t,!0);let r=s(t,"id",19,_t),o=s(t,"ref",15,null),n=I(t,["$$slots","$$events","$$legacy","id","ref"]);const a=Ht.create({id:v(()=>r()),ref:v(()=>o(),m=>o(m))}),c=u(()=>V(n,a.props));$t(h,F(()=>e(c))),E()}class ut{#r;#e;#t=null;constructor(t,r){this.#e=t,this.#r=r,this.stop=this.stop.bind(this),this.start=this.start.bind(this),Ut(this.stop)}#o(){this.#t!==null&&(window.clearTimeout(this.#t),this.#t=null)}stop(){this.#o()}start(...t){this.#o(),this.#t=window.setTimeout(()=>{this.#t=null,this.#e(...t)},this.#r)}}const kt=Xt({component:"tooltip",parts:["content","trigger"]}),Ft=new wt("Tooltip.Provider"),pt=new wt("Tooltip.Root");class Nt{static create(t){return Ft.set(new Nt(t))}opts;#r=G(!0);get isOpenDelayed(){return e(this.#r)}set isOpenDelayed(t){d(this.#r,t,!0)}isPointerInTransit=Tt(!1);#e;#t=G(null);constructor(t){this.opts=t,this.#e=new ut(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current)}#o=()=>{this.opts.skipDelayDuration.current!==0&&this.#e.start()};#i=()=>{this.#e.stop()};onOpen=t=>{e(this.#t)&&e(this.#t)!==t&&e(this.#t).handleClose(),this.#i(),this.isOpenDelayed=!1,d(this.#t,t,!0)};onClose=t=>{e(this.#t)===t&&d(this.#t,null),this.#o()};isTooltipOpen=t=>e(this.#t)===t}class ft{static create(t){return pt.set(new ft(t,Ft.get()))}opts;provider;#r=u(()=>this.opts.delayDuration.current??this.provider.opts.delayDuration.current);get delayDuration(){return e(this.#r)}set delayDuration(t){d(this.#r,t)}#e=u(()=>this.opts.disableHoverableContent.current??this.provider.opts.disableHoverableContent.current);get disableHoverableContent(){return e(this.#e)}set disableHoverableContent(t){d(this.#e,t)}#t=u(()=>this.opts.disableCloseOnTriggerClick.current??this.provider.opts.disableCloseOnTriggerClick.current);get disableCloseOnTriggerClick(){return e(this.#t)}set disableCloseOnTriggerClick(t){d(this.#t,t)}#o=u(()=>this.opts.disabled.current??this.provider.opts.disabled.current);get disabled(){return e(this.#o)}set disabled(t){d(this.#o,t)}#i=u(()=>this.opts.ignoreNonKeyboardFocus.current??this.provider.opts.ignoreNonKeyboardFocus.current);get ignoreNonKeyboardFocus(){return e(this.#i)}set ignoreNonKeyboardFocus(t){d(this.#i,t)}#a=G(null);get contentNode(){return e(this.#a)}set contentNode(t){d(this.#a,t,!0)}contentPresence;#l=G(null);get triggerNode(){return e(this.#l)}set triggerNode(t){d(this.#l,t,!0)}#n=G(!1);#s;#d=u(()=>this.opts.open.current?e(this.#n)?"delayed-open":"instant-open":"closed");get stateAttr(){return e(this.#d)}set stateAttr(t){d(this.#d,t)}constructor(t,r){this.opts=t,this.provider=r,this.#s=new ut(()=>{d(this.#n,!0),this.opts.open.current=!0},this.delayDuration??0),this.contentPresence=new Gt({open:this.opts.open,ref:v(()=>this.contentNode),onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),mt(()=>this.delayDuration,()=>{this.delayDuration!==void 0&&(this.#s=new ut(()=>{d(this.#n,!0),this.opts.open.current=!0},this.delayDuration))}),mt(()=>this.opts.open.current,o=>{o?this.provider.onOpen(this):this.provider.onClose(this)},{lazy:!0})}handleOpen=()=>{this.#s.stop(),d(this.#n,!1),this.opts.open.current=!0};handleClose=()=>{this.#s.stop(),this.opts.open.current=!1};#h=()=>{this.#s.stop();const t=!this.provider.isOpenDelayed,r=this.delayDuration??0;t||r===0?(d(this.#n,r>0&&t,!0),this.opts.open.current=!0):this.#s.start()};onTriggerEnter=()=>{this.#h()};onTriggerLeave=()=>{this.disableHoverableContent?this.handleClose():this.#s.stop()}}class gt{static create(t){return new gt(t,pt.get())}opts;root;attachment;#r=Tt(!1);#e=G(!1);#t=u(()=>this.opts.disabled.current||this.root.disabled);domContext;#o=null;constructor(t,r){this.opts=t,this.root=r,this.domContext=new Vt(t.ref),this.attachment=Ot(this.opts.ref,o=>this.root.triggerNode=o)}#i=()=>{this.#o!==null&&(clearTimeout(this.#o),this.#o=null)};handlePointerUp=()=>{this.#r.current=!1};#a=()=>{e(this.#t)||(this.#r.current=!1)};#l=()=>{e(this.#t)||(this.#r.current=!0,this.domContext.getDocument().addEventListener("pointerup",()=>{this.handlePointerUp()},{once:!0}))};#n=t=>{if(!e(this.#t)&&t.pointerType!=="touch"){if(this.root.provider.isPointerInTransit.current){this.#i(),this.#o=window.setTimeout(()=>{this.root.provider.isPointerInTransit.current&&(this.root.provider.isPointerInTransit.current=!1,this.root.onTriggerEnter(),d(this.#e,!0))},250);return}this.root.onTriggerEnter(),d(this.#e,!0)}};#s=t=>{e(this.#t)||t.pointerType!=="touch"&&(e(this.#e)||(this.#i(),this.root.provider.isPointerInTransit.current=!1,this.root.onTriggerEnter(),d(this.#e,!0)))};#d=()=>{e(this.#t)||(this.#i(),this.root.onTriggerLeave(),d(this.#e,!1))};#h=t=>{this.#r.current||e(this.#t)||this.root.ignoreNonKeyboardFocus&&!jt(t.currentTarget)||this.root.handleOpen()};#u=()=>{e(this.#t)||this.root.handleClose()};#p=()=>{this.root.disableCloseOnTriggerClick||e(this.#t)||this.root.handleClose()};#c=u(()=>({id:this.opts.id.current,"aria-describedby":this.root.opts.open.current?this.root.contentNode?.id:void 0,"data-state":this.root.stateAttr,"data-disabled":Dt(e(this.#t)),"data-delay-duration":`${this.root.delayDuration}`,[kt.trigger]:"",tabindex:e(this.#t)?void 0:0,disabled:this.opts.disabled.current,onpointerup:this.#a,onpointerdown:this.#l,onpointerenter:this.#n,onpointermove:this.#s,onpointerleave:this.#d,onfocus:this.#h,onblur:this.#u,onclick:this.#p,...this.attachment}));get props(){return e(this.#c)}set props(t){d(this.#c,t)}}class vt{static create(t){return new vt(t,pt.get())}opts;root;attachment;constructor(t,r){this.opts=t,this.root=r,this.attachment=Ot(this.opts.ref,o=>this.root.contentNode=o),new qt({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&!this.root.disableHoverableContent,onPointerExit:()=>{this.root.provider.isTooltipOpen(this.root)&&this.root.handleClose()},setIsPointerInTransit:o=>{this.root.provider.isPointerInTransit.current=o},transitTimeout:this.root.provider.opts.skipDelayDuration.current}),Mt(()=>At(window,"scroll",o=>{const n=o.target;n&&n.contains(this.root.triggerNode)&&this.root.handleClose()}))}onInteractOutside=t=>{if(Jt(t.target)&&this.root.triggerNode?.contains(t.target)&&this.root.disableCloseOnTriggerClick){t.preventDefault();return}this.opts.onInteractOutside.current(t),!t.defaultPrevented&&this.root.handleClose()};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current?.(t),!t.defaultPrevented&&this.root.handleClose()};onOpenAutoFocus=t=>{t.preventDefault()};onCloseAutoFocus=t=>{t.preventDefault()};get shouldRender(){return this.root.contentPresence.shouldRender}#r=u(()=>({open:this.root.opts.open.current}));get snippetProps(){return e(this.#r)}set snippetProps(t){d(this.#r,t)}#e=u(()=>({id:this.opts.id.current,"data-state":this.root.stateAttr,"data-disabled":Dt(this.root.disabled),style:{pointerEvents:"auto",outline:"none"},[kt.content]:"",...this.attachment}));get props(){return e(this.#e)}set props(t){d(this.#e,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus}}function ee(h,t){N(t,!0);let r=s(t,"open",15,!1),o=s(t,"onOpenChange",3,st),n=s(t,"onOpenChangeComplete",3,st);ft.create({open:v(()=>r(),a=>{r(a),o()(a)}),delayDuration:v(()=>t.delayDuration),disableCloseOnTriggerClick:v(()=>t.disableCloseOnTriggerClick),disableHoverableContent:v(()=>t.disableHoverableContent),ignoreNonKeyboardFocus:v(()=>t.ignoreNonKeyboardFocus),disabled:v(()=>t.disabled),onOpenChangeComplete:v(()=>n())}),zt(h,{tooltip:!0,children:(a,c)=>{var m=C(),g=b(m);T(g,()=>t.children??j),l(a,m)},$$slots:{default:!0}}),E()}var re=q("<div><div><!></div></div>"),oe=q("<div><div><!></div></div>");function se(h,t){const r=Pt();N(t,!0);let o=s(t,"id",19,()=>xt(r)),n=s(t,"ref",15,null),a=s(t,"side",3,"top"),c=s(t,"sideOffset",3,0),m=s(t,"align",3,"center"),g=s(t,"avoidCollisions",3,!0),P=s(t,"arrowPadding",3,0),_=s(t,"sticky",3,"partial"),p=s(t,"hideWhenDetached",3,!1),y=s(t,"collisionPadding",3,0),w=s(t,"onInteractOutside",3,st),M=s(t,"onEscapeKeydown",3,st),O=s(t,"forceMount",3,!1),f=I(t,["$$slots","$$events","$$legacy","children","child","id","ref","side","sideOffset","align","avoidCollisions","arrowPadding","sticky","strategy","hideWhenDetached","collisionPadding","onInteractOutside","onEscapeKeydown","forceMount"]);const i=vt.create({id:v(()=>o()),ref:v(()=>n(),A=>n(A)),onInteractOutside:v(()=>w()),onEscapeKeydown:v(()=>M())}),D=u(()=>({side:a(),sideOffset:c(),align:m(),avoidCollisions:g(),arrowPadding:P(),sticky:_(),hideWhenDetached:p(),collisionPadding:y(),strategy:t.strategy})),z=u(()=>V(f,e(D),i.props));var L=C(),it=b(L);{var $=A=>{Lt(A,F(()=>e(z),()=>i.popperProps,{get enabled(){return i.root.opts.open.current},get id(){return o()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!0,get ref(){return i.opts.ref},tooltip:!0,get shouldRender(){return i.shouldRender},popper:(lt,tt)=>{let J=()=>tt?.().props,dt=()=>tt?.().wrapperProps;const et=u(()=>V(J(),{style:bt("tooltip")}));var Q=C(),ht=b(Q);{var rt=x=>{var k=C(),K=b(k);{let X=u(()=>({props:e(et),wrapperProps:dt(),...i.snippetProps}));T(K,()=>t.child,()=>e(X))}l(x,k)},ot=x=>{var k=re();H(k,()=>({...dt()}));var K=B(k);H(K,()=>({...e(et)}));var X=B(K);T(X,()=>t.children??j),U(K),U(k),l(x,k)};R(ht,x=>{t.child?x(rt):x(ot,!1)})}l(lt,Q)},$$slots:{popper:!0}}))},nt=A=>{var at=C(),lt=b(at);{var tt=J=>{Wt(J,F(()=>e(z),()=>i.popperProps,{get open(){return i.root.opts.open.current},get id(){return o()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!1,get ref(){return i.opts.ref},tooltip:!0,get shouldRender(){return i.shouldRender},popper:(et,Q)=>{let ht=()=>Q?.().props,rt=()=>Q?.().wrapperProps;const ot=u(()=>V(ht(),{style:bt("tooltip")}));var x=C(),k=b(x);{var K=W=>{var S=C(),Y=b(S);{let ct=u(()=>({props:e(ot),wrapperProps:rt(),...i.snippetProps}));T(Y,()=>t.child,()=>e(ct))}l(W,S)},X=W=>{var S=oe();H(S,()=>({...rt()}));var Y=B(S);H(Y,()=>({...e(ot)}));var ct=B(Y);T(ct,()=>t.children??j),U(Y),U(S),l(W,S)};R(k,W=>{t.child?W(K):W(X,!1)})}l(et,x)},$$slots:{popper:!0}}))};R(lt,J=>{O()||J(tt)},!0)}l(A,at)};R(it,A=>{O()?A($):A(nt,!1)})}l(h,L),E()}var ie=q("<button><!></button>");function ne(h,t){const r=Pt();N(t,!0);let o=s(t,"id",19,()=>xt(r)),n=s(t,"disabled",3,!1),a=s(t,"type",3,"button"),c=s(t,"ref",15,null),m=I(t,["$$slots","$$events","$$legacy","children","child","id","disabled","type","ref"]);const g=gt.create({id:v(()=>o()),disabled:v(()=>n()??!1),ref:v(()=>c(),_=>c(_))}),P=u(()=>V(m,g.props,{type:a()}));Bt(h,{get id(){return o()},get ref(){return g.opts.ref},tooltip:!0,children:(_,p)=>{var y=C(),w=b(y);{var M=f=>{var i=C(),D=b(i);T(D,()=>t.child,()=>({props:e(P)})),l(f,i)},O=f=>{var i=ie();H(i,()=>({...e(P)}));var D=B(i);T(D,()=>t.children??j),U(i),l(f,i)};R(w,f=>{t.child?f(M):f(O,!1)})}l(_,y)},$$slots:{default:!0}}),E()}function ae(h,t){N(t,!0);let r=s(t,"ref",15,null),o=I(t,["$$slots","$$events","$$legacy","ref"]);te(h,F(()=>o,{get ref(){return r()},set ref(n){r(n)}})),E()}function Pe(h,t){N(t,!0);let r=s(t,"open",15,!1),o=I(t,["$$slots","$$events","$$legacy","open"]),n=!1,a=null;function c(){n=!1,r(!1),a&&(a(),a=null)}function m(){if(r()&&n){c();return}n=!0,r(!0),setTimeout(()=>{const p=()=>c();document.addEventListener("pointerdown",p),a=()=>document.removeEventListener("pointerdown",p)},0)}function g(p){if(!p&&n){r(!0);return}r(p)}Kt("traceway-tooltip",{toggle:m});var P=C(),_=b(P);Z(_,()=>ee,(p,y)=>{y(p,F(()=>o,{onOpenChange:g,get open(){return r()},set open(w){r(w)}}))}),l(h,P),E()}function _e(h,t){N(t,!0);let r=s(t,"ref",15,null),o=I(t,["$$slots","$$events","$$legacy","ref"]);const n=St("traceway-tooltip");function a(g){n&&(g.preventDefault(),n.toggle())}var c=C(),m=b(c);Z(m,()=>ne,(g,P)=>{P(g,F({"data-slot":"tooltip-trigger",ontouchstart:a},()=>o,{get ref(){return r()},set ref(_){r(_)}}))}),l(h,c),E()}function le(h,t){let r=I(t,["$$slots","$$events","$$legacy"]);var o=C(),n=b(o);Z(n,()=>Qt,(a,c)=>{c(a,F(()=>r))}),l(h,o)}var de=q("<div></div>"),he=q("<!> <!>",1);function we(h,t){N(t,!0);let r=s(t,"ref",15,null),o=s(t,"sideOffset",3,0),n=s(t,"side",3,"top"),a=I(t,["$$slots","$$events","$$legacy","ref","class","sideOffset","side","children","arrowClasses","portalProps"]);le(h,F(()=>t.portalProps,{children:(c,m)=>{var g=C(),P=b(g);{let _=u(()=>Ct("z-50 max-w-[220px] origin-(--bits-tooltip-content-transform-origin) animate-in rounded-sm border border-transparent bg-foreground px-3 py-2 text-xs text-background shadow-[none] fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 dark:border-border",t.class));Z(P,()=>se,(p,y)=>{y(p,F({"data-slot":"tooltip-content",get sideOffset(){return o()},get side(){return n()},get class(){return e(_)}},()=>a,{get ref(){return r()},set ref(w){r(w)},children:(w,M)=>{var O=he(),f=b(O);T(f,()=>t.children??j);var i=Rt(f,2);{const D=(z,L)=>{let it=()=>L?.().props;var $=de();H($,nt=>({class:nt,...it()}),[()=>Ct("z-50 size-2.5 rotate-45 border-transparent bg-foreground dark:border-border","data-[side=top]:border-r data-[side=top]:border-b","data-[side=bottom]:border-t data-[side=bottom]:border-l","data-[side=left]:border-r data-[side=left]:border-b","data-[side=right]:border-r data-[side=right]:border-b","data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_3px)]","data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(50%_-_2px)] data-[side=bottom]:rotate-225","data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2","data-[side=left]:-translate-y-[calc(50%_-_3px)]",t.arrowClasses)]),l(z,$)};Z(i,()=>ae,(z,L)=>{L(z,{child:D,$$slots:{child:!0}})})}l(w,O)},$$slots:{default:!0}}))})}l(c,g)},$$slots:{default:!0}})),E()}export{Pe as T,_e as a,we as b,Nt as c};