@protonradio/proton-ui 0.6.18-beta.14 → 0.6.18-beta.16

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.cjs.js CHANGED
@@ -43,5 +43,5 @@ React keys must be passed directly to JSX without using spread:
43
43
  *
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
- */var Nt;function Br(){return Nt||(Nt=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=i,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(M){{for(var P=arguments.length,O=new Array(P>1?P-1:0),j=1;j<P;j++)O[j-1]=arguments[j];r("error",M,O)}}function r(M,P,O){{var j=e.ReactDebugCurrentFrame,W=j.getStackAddendum();W!==""&&(P+="%s",O=O.concat([W]));var F=O.map(function(V){return String(V)});F.unshift("Warning: "+P),Function.prototype.apply.call(console[M],console,F)}}function o(M,P){return M===P&&(M!==0||1/M===1/P)||M!==M&&P!==P}var s=typeof Object.is=="function"?Object.is:o,l=t.useState,u=t.useEffect,d=t.useLayoutEffect,p=t.useDebugValue,f=!1,v=!1;function h(M,P,O){f||t.startTransition!==void 0&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var j=P();if(!v){var W=P();s(j,W)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),v=!0)}var F=l({inst:{value:j,getSnapshot:P}}),V=F[0].inst,ee=F[1];return d(function(){V.value=j,V.getSnapshot=P,m(V)&&ee({inst:V})},[M,j,P]),u(function(){m(V)&&ee({inst:V});var ie=function(){m(V)&&ee({inst:V})};return M(ie)},[M]),p(j),j}function m(M){var P=M.getSnapshot,O=M.value;try{var j=P();return!s(O,j)}catch{return!0}}function x(M,P,O){return P()}var S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$=!S,C=$?x:h,R=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:C;Fe.useSyncExternalStore=R,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Fe}process.env.NODE_ENV==="production"?Ue.exports=Dr():Ue.exports=Br();var Hr=Ue.exports;const qt=i.createContext(!1),be=i.createContext(null);function Vr(t){if(i.useContext(be))return t.content;let{collection:n,document:r}=Gr(t.createCollection);return i.createElement(i.Fragment,null,i.createElement(Er,null,i.createElement(be.Provider,{value:r},t.content)),i.createElement(Wr,{render:t.children,collection:n}))}function Wr({collection:t,render:e}){return e(t)}function Kr(t,e,n){let r=Te(),o=i.useRef(r);o.current=r;let s=i.useCallback(()=>o.current?n():e(),[e,n]);return Hr.useSyncExternalStore(t,s)}const Fr=typeof i.useSyncExternalStore=="function"?i.useSyncExternalStore:Kr;function Gr(t){let[e]=i.useState(()=>new hr((t==null?void 0:t())||new pr)),n=i.useCallback(l=>e.subscribe(l),[e]),r=i.useCallback(()=>{let l=e.getCollection();return e.isSSR&&e.resetAfterSSR(),l},[e]),o=i.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),s=Fr(n,r,o);return ue(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:s,document:e}}const qe=i.createContext(null);function Yr(t,e,n,r,o,s){let l=i.useCallback(d=>{d==null||d.setProps(e,n,r,s)},[e,n,r,s]),u=i.useContext(qe);if(u){let d=u.ownerDocument.nodesByProps.get(e);return d||(d=u.ownerDocument.createElement(t),d.setProps(e,n,r,s),u.appendChild(d),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(e,d)),o?i.createElement(qe.Provider,{value:d},o):null}return i.createElement(t,{ref:l},o)}function zr(t,e){let n=({node:o})=>e(o.props,o.props.ref,o),r=i.forwardRef((o,s)=>{if(!i.useContext(qt)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(o,s)}return Yr(t,o,s,"children"in o?o.children:null,null,u=>i.createElement(n,{node:u}))});return r.displayName=e.name,r}function Ur(t){return Gt({...t,addIdAndValue:!0})}const jt=i.createContext(null);function qr(t){let e=i.useContext(jt),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),o=Ur({...t,idScope:r,dependencies:n});return i.useContext(be)&&(o=i.createElement(Jr,null,o)),e=i.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),i.createElement(jt.Provider,{value:e},o)}function Jr({children:t}){let e=i.useContext(be),n=i.useMemo(()=>i.createElement(be.Provider,{value:null},i.createElement(qt.Provider,{value:!0},t)),[t]);return Te()?i.createElement(qe.Provider,{value:e},n):we.createPortal(n,e)}const Xr=i.createContext(null),Zr={CollectionRoot({collection:t,renderDropIndicator:e}){return At(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return At(t,e,n)}};function At(t,e,n){return Gt({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){var o;let s=r.render(r);if(!n||r.type!=="item")return s;let l=r.key,u=t.getKeyAfter(l);return i.createElement(i.Fragment,null,n({type:"item",key:l,dropPosition:"before"}),s,(u==null||((o=t.getItem(u))===null||o===void 0?void 0:o.type)!=="item")&&n({type:"item",key:l,dropPosition:"after"}))}})}const Jt=i.createContext(Zr);function Qr(t){return i.useMemo(()=>t!=null?new Set([t]):null,[t])}const kt=Symbol("default");function Ne({values:t,children:e}){for(let[n,r]of t)e=i.createElement(n.Provider,{value:r},e);return e}function de(t){let{className:e,style:n,children:r,defaultClassName:o,defaultChildren:s,defaultStyle:l,values:u}=t;return i.useMemo(()=>{let d,p,f;return typeof e=="function"?d=e({...u,defaultClassName:o}):d=e,typeof n=="function"?p=n({...u,defaultStyle:l||{}}):p=n,typeof r=="function"?f=r({...u,defaultChildren:s}):r==null?f=s:f=r,{className:d??o,style:p||l?{...l,...p}:void 0,children:f??s,"data-rac":""}},[e,n,r,o,s,l,u])}function Xt(t,e){let n=i.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`));if(!e&&!n.slots[kt])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let o=e||kt;if(!n.slots[o])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[o]}return n}function ge(t,e,n){let r=Xt(n,t.slot)||{},{ref:o,...s}=r,l=Me(i.useMemo(()=>Mr(e,o),[e,o])),u=Ut(s,t);return"style"in s&&s.style&&"style"in t&&t.style&&(typeof s.style=="function"||typeof t.style=="function"?u.style=d=>{let p=typeof s.style=="function"?s.style(d):s.style,f={...d.defaultStyle,...p},v=typeof t.style=="function"?t.style({...d,defaultStyle:f}):t.style;return{...f,...v}}:u.style={...s.style,...t.style}),[u,l]}function eo(){let[t,e]=i.useState(!0),n=i.useRef(!1),r=i.useCallback(o=>{n.current=!0,e(!!o)},[]);return ue(()=>{n.current||e(!1)},[]),[r,t]}function to(t,e=!0){let[n,r]=i.useState(!0);return Zt(t,n&&e,i.useCallback(()=>r(!1),[])),n&&e}function no(t,e){let[n,r]=i.useState(!1),[o,s]=i.useState("idle");return!e&&t.current&&o==="idle"&&(n=!0,r(!0),s("exiting")),!t.current&&o==="exited"&&s("idle"),Zt(t,n,i.useCallback(()=>{s("exited"),r(!1)},[])),n}function Zt(t,e,n){let r=i.useRef(null);e&&t.current&&(r.current=window.getComputedStyle(t.current).animation),ue(()=>{if(e&&t.current){let o=window.getComputedStyle(t.current);if(o.animationName&&o.animationName!=="none"&&o.animation!==r.current){let s=u=>{u.target===t.current&&(l.removeEventListener("animationend",s),we.flushSync(()=>{n()}))},l=t.current;return l.addEventListener("animationend",s),()=>{l.removeEventListener("animationend",s)}}else n()}},[t,e,n])}const ro=i.createContext(null),Qt=7e3;let ne=null;function It(t,e="assertive",n=Qt){ne?ne.announce(t,e,n):(ne=new oo,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?ne.announce(t,e,n):setTimeout(()=>{ne!=null&&ne.isAttached()&&(ne==null||ne.announce(t,e,n))},100))}class oo{isAttached(){var e;return(e=this.node)===null||e===void 0?void 0:e.isConnected}createLog(e){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",e),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,n="assertive",r=Qt){var o,s;if(!this.node)return;let l=document.createElement("div");typeof e=="object"?(l.setAttribute("role","img"),l.setAttribute("aria-labelledby",e["aria-labelledby"])):l.textContent=e,n==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(l):(s=this.politeLog)===null||s===void 0||s.appendChild(l),e!==""&&setTimeout(()=>{l.remove()},r)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}const io=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),so=i.createContext({});function ao(t,e){[t,e]=ge(t,e,so),t=lo(t);let n=t,{isPending:r}=n,{buttonProps:o,isPressed:s}=y.useButton(t,e),{focusProps:l,isFocused:u,isFocusVisible:d}=y.useFocusRing(t),{hoverProps:p,isHovered:f}=y.useHover({...t,isDisabled:t.isDisabled||r}),v={isHovered:f,isPressed:(n.isPressed||s)&&!r,isFocused:u,isFocusVisible:d,isDisabled:t.isDisabled||!1,isPending:r??!1},h=de({...t,values:v,defaultClassName:"react-aria-Button"}),m=y.useId(o.id),x=y.useId(),S=o["aria-labelledby"];r&&(S?S=`${S} ${x}`:o["aria-label"]&&(S=`${m} ${x}`));let $=i.useRef(r);return i.useEffect(()=>{let C={"aria-labelledby":S||m};(!$.current&&u&&r||$.current&&u&&!r)&&It(C,"assertive"),$.current=r},[r,u,S,m]),i.createElement("button",{...it(t,{propNames:io}),...y.mergeProps(o,l,p),...h,id:m,ref:e,"aria-labelledby":S,slot:t.slot||void 0,"aria-disabled":r?"true":o["aria-disabled"],"data-disabled":t.isDisabled||void 0,"data-pressed":v.isPressed||void 0,"data-hovered":f||void 0,"data-focused":u||void 0,"data-pending":r||void 0,"data-focus-visible":d||void 0},i.createElement(ro.Provider,{value:{id:x}},h.children))}function lo(t){return t.isPending&&(t.onPress=void 0,t.onPressStart=void 0,t.onPressEnd=void 0,t.onPressChange=void 0,t.onPressUp=void 0,t.onKeyDown=void 0,t.onKeyUp=void 0,t.onClick=void 0,t.href=void 0),t}const en=Cr(ao),co=i.createContext({}),Je=i.createContext({register:()=>{}});Je.displayName="PressResponderContext";const uo=i.forwardRef(({children:t,...e},n)=>{let r=i.useRef(!1),o=i.useContext(Je);n=Me(n||(o==null?void 0:o.ref));let s=Ut(o||{},{...e,ref:n,register(){r.current=!0,o&&o.register()}});return Lr(o,n),i.useEffect(()=>{r.current||(console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component."),r.current=!0)},[]),i.createElement(Je.Provider,{value:s},t)});let Ce=!1,Ge=0;function Xe(){Ce=!0,setTimeout(()=>{Ce=!1},50)}function Ot(t){t.pointerType==="touch"&&Xe()}function fo(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Ot):document.addEventListener("touchend",Xe),Ge++,()=>{Ge--,!(Ge>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Ot):document.removeEventListener("touchend",Xe))}}function po(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:o}=t,[s,l]=i.useState(!1),u=i.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;i.useEffect(fo,[]);let{hoverProps:d,triggerHoverEnd:p}=i.useMemo(()=>{let f=(m,x)=>{if(u.pointerType=x,o||x==="touch"||u.isHovered||!m.currentTarget.contains(m.target))return;u.isHovered=!0;let S=m.currentTarget;u.target=S,e&&e({type:"hoverstart",target:S,pointerType:x}),n&&n(!0),l(!0)},v=(m,x)=>{if(u.pointerType="",u.target=null,x==="touch"||!u.isHovered)return;u.isHovered=!1;let S=m.currentTarget;r&&r({type:"hoverend",target:S,pointerType:x}),n&&n(!1),l(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=m=>{Ce&&m.pointerType==="mouse"||f(m,m.pointerType)},h.onPointerLeave=m=>{!o&&m.currentTarget.contains(m.target)&&v(m,m.pointerType)}):(h.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=m=>{!u.ignoreEmulatedMouseEvents&&!Ce&&f(m,"mouse"),u.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=m=>{!o&&m.currentTarget.contains(m.target)&&v(m,"mouse")}),{hoverProps:h,triggerHoverEnd:v}},[e,n,r,o,u]);return i.useEffect(()=>{o&&p({currentTarget:u.target},u.pointerType)},[o]),{hoverProps:d,isHovered:s}}function ho(t){let{ref:e,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:o}=t,s=i.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),l=Pt(d=>{n&&_e(d,e)&&(o&&o(d),s.current.isPointerDown=!0)}),u=Pt(d=>{n&&n(d)});i.useEffect(()=>{let d=s.current;if(r)return;const p=e.current,f=Pr(p);if(typeof PointerEvent<"u"){let v=h=>{d.isPointerDown&&_e(h,e)&&u(h),d.isPointerDown=!1};return f.addEventListener("pointerdown",l,!0),f.addEventListener("pointerup",v,!0),()=>{f.removeEventListener("pointerdown",l,!0),f.removeEventListener("pointerup",v,!0)}}else{let v=m=>{d.ignoreEmulatedMouseEvents?d.ignoreEmulatedMouseEvents=!1:d.isPointerDown&&_e(m,e)&&u(m),d.isPointerDown=!1},h=m=>{d.ignoreEmulatedMouseEvents=!0,d.isPointerDown&&_e(m,e)&&u(m),d.isPointerDown=!1};return f.addEventListener("mousedown",l,!0),f.addEventListener("mouseup",v,!0),f.addEventListener("touchstart",l,!0),f.addEventListener("touchend",h,!0),()=>{f.removeEventListener("mousedown",l,!0),f.removeEventListener("mouseup",v,!0),f.removeEventListener("touchstart",l,!0),f.removeEventListener("touchend",h,!0)}}},[e,r,l,u])}function _e(t,e){if(t.button>0)return!1;if(t.target){const n=t.target.ownerDocument;if(!n||!n.documentElement.contains(t.target)||t.target.closest("[data-react-aria-top-layer]"))return!1}return e.current&&!e.current.contains(t.target)}let vo=i.createContext(null);function mo(t,e){let{children:n,...r}=t,o=Me(e),s={...r,ref:o};return i.createElement(vo.Provider,{value:s},n)}let bo=i.forwardRef(mo);const go=i.createContext({}),yo=i.createContext({}),tn=i.createContext({placement:"bottom"});function xo(t,e){[t,e]=ge(t,e,tn);let n=t.placement,r={position:"absolute",[n]:"100%",transform:n==="top"||n==="bottom"?"translateX(-50%)":"translateY(-50%)"},o=de({...t,defaultClassName:"react-aria-OverlayArrow",values:{placement:n}});return o.style&&Object.keys(o.style).forEach(s=>o.style[s]===void 0&&delete o.style[s]),i.createElement("div",{...t,...o,style:{...r,...o.style},ref:e,"data-placement":n})}const So=i.forwardRef(xo),Ze=i.createContext(null),$o=i.createContext(null),_o=i.createContext({});function nn(t){return null}nn.getCollectionNode=function*(e){let{children:n,title:r,items:o}=e;yield{type:"section",props:e,hasChildNodes:!0,rendered:r,"aria-label":e["aria-label"],*childNodes(){if(typeof n=="function"){if(!o)throw new Error("props.children was a function but props.items is missing");for(let s of o)yield{type:"item",value:s,renderer:n}}else{let s=[];i.Children.forEach(n,l=>{s.push({type:"item",element:l})}),yield*s}}}};let Eo=nn;const rn=i.createContext(null),st=i.createContext(null),on=i.createContext(null);function Co(t){let e=q.useMenuTriggerState(t),n=i.useRef(null),{menuTriggerProps:r,menuProps:o}=y.useMenuTrigger({...t,type:"menu"},e,n),[s,l]=i.useState(null),u=i.useCallback(()=>{n.current&&l(n.current.offsetWidth+"px")},[n]);Or({ref:n,onResize:u});let d=i.useRef(null);return i.createElement(Ne,{values:[[rn,{...o,ref:d}],[$o,e],[on,e],[Ze,{trigger:"MenuTrigger",triggerRef:n,scrollRef:d,placement:"bottom start",style:{"--trigger-width":s}}]]},i.createElement(uo,{...r,ref:n,isPressed:e.isOpen},t.children))}const wo=i.createContext(null);function Ro(t,e){return[t,e]=ge(t,e,rn),i.createElement(Vr,{content:i.createElement(qr,t)},n=>n.size>0&&i.createElement(Po,{props:t,collection:n,menuRef:e}))}function Po({props:t,collection:e,menuRef:n}){let r=q.useTreeState({...t,collection:e,children:void 0}),[o,s]=i.useState(null),{isVirtualized:l,CollectionRoot:u}=i.useContext(Jt),{menuProps:d}=y.useMenu({...t,isVirtualized:l},r,n),p=i.useContext(on),f=i.useContext(Ze),v=(f==null?void 0:f.trigger)==="SubmenuTrigger";ho({ref:n,onInteractOutside:$=>{p&&!(o!=null&&o.contains($.target))&&p.close()},isDisabled:v||(p==null?void 0:p.expandedKeysStack.length)===0});let h=i.useRef(null),[m,x]=i.useState({left:0});i.useEffect(()=>{if(o&&h.current!==o&&m.left===0){h.current=o;let{left:$}=o.getBoundingClientRect();x({left:-1*$})}},[m,o]);let S=de({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return i.createElement(y.FocusScope,null,i.createElement("div",{...it(t),...d,...S,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},i.createElement(Ne,{values:[[st,r],[yo,{elementType:"div"}],[Ze,{UNSTABLE_portalContainer:o||void 0}],[Xr,{render:Mo}],[wo,{parentMenuRef:n}],[Qe,null]]},i.createElement(u,{collection:e,persistedKeys:Qr(r.selectionManager.focusedKey),scrollRef:n}))),i.createElement("div",{ref:s,style:{width:"100vw",position:"absolute",top:0,...m}}))}const To=i.forwardRef(Ro);function Mo(t,e,n){var r,o;let s=i.useContext(st),{CollectionBranch:l}=i.useContext(Jt),[u,d]=eo();var p;let{headingProps:f,groupProps:v}=y.useMenuSection({heading:d,"aria-label":(p=n.props["aria-label"])!==null&&p!==void 0?p:void 0}),h=de({defaultClassName:"react-aria-Section",className:(r=n.props)===null||r===void 0?void 0:r.className,style:(o=n.props)===null||o===void 0?void 0:o.style,values:{}});return i.createElement("section",{...it(t),...v,...h,ref:e},i.createElement(go.Provider,{value:{...f,ref:u}},i.createElement(l,{collection:s.collection,parent:n})))}const Qe=i.createContext(null),No=zr("item",function(e,n,r){var o;[e,n]=ge(e,n,Qe);let s=(o=Xt(Qe))===null||o===void 0?void 0:o.id,l=i.useContext(st),u=Me(n),{menuItemProps:d,labelProps:p,descriptionProps:f,keyboardShortcutProps:v,...h}=y.useMenuItem({...e,id:s,key:r.key},l,u),{isFocusVisible:m,focusProps:x}=y.useFocusRing(),{hoverProps:S,isHovered:$}=po({isDisabled:h.isDisabled}),C=de({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...h,isHovered:$,isFocusVisible:m,selectionMode:l.selectionManager.selectionMode,selectionBehavior:l.selectionManager.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),R=e.href?"a":"div";return i.createElement(R,{...y.mergeProps(d,x,S),...C,ref:u,"data-disabled":h.isDisabled||void 0,"data-hovered":$||void 0,"data-focused":h.isFocused||void 0,"data-focus-visible":m||void 0,"data-pressed":h.isPressed||void 0,"data-selected":h.isSelected||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},i.createElement(Ne,{values:[[co,{slots:{label:p,description:f}}],[_o,v]]},C.children))});function sn(t){return null}sn.getCollectionNode=function*(e,n){let{children:r,columns:o}=e;if(n.columns=[],typeof r=="function"){if(!o)throw new Error("props.children was a function but props.columns is missing");for(let s of o)yield{type:"column",value:s,renderer:r}}else{let s=[];i.Children.forEach(r,l=>{s.push({type:"column",element:l})}),yield*s}};let jo=sn;function an(t){return null}an.getCollectionNode=function*(e){let{children:n,items:r}=e;yield{type:"body",hasChildNodes:!0,props:e,*childNodes(){if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");for(let o of r)yield{type:"item",value:o,renderer:n}}else{let o=[];i.Children.forEach(n,s=>{o.push({type:"item",element:s})}),yield*o}}}};let Ao=an;function ln(t){return null}ln.getCollectionNode=function*(e,n){let{title:r,children:o,childColumns:s}=e,l=r||o,u=e.textValue||(typeof l=="string"?l:"")||e["aria-label"],d=yield{type:"column",hasChildNodes:!!s||r&&i.Children.count(o)>0,rendered:l,textValue:u,props:e,*childNodes(){if(s)for(let f of s)yield{type:"column",value:f};else if(r){let f=[];i.Children.forEach(o,v=>{f.push({type:"column",element:v})}),yield*f}},shouldInvalidate(f){return p(f),!1}},p=f=>{for(let v of d)v.hasChildNodes||f.columns.push(v)};p(n)};let ko=ln;function et(t){return null}et.getCollectionNode=function*(e,n){let{children:r,textValue:o,UNSTABLE_childItems:s}=e;yield{type:"item",props:e,textValue:o,"aria-label":e["aria-label"],hasChildNodes:!0,*childNodes(){if(n.showDragButtons&&(yield{type:"cell",key:"header-drag",props:{isDragButtonCell:!0}}),n.showSelectionCheckboxes&&n.selectionMode!=="none"&&(yield{type:"cell",key:"header",props:{isSelectionCell:!0}}),typeof r=="function"){for(let l of n.columns)yield{type:"cell",element:r(l.key),key:l.key};if(s)for(let l of s)yield{type:"item",value:l}}else{let l=[],u=[];if(i.Children.forEach(r,d=>{if(d.type===et){if(l.length<n.columns.length)throw new Error("All of a Row's child Cells must be positioned before any child Rows.");u.push({type:"item",element:d})}else l.push({type:"cell",element:d})}),l.length!==n.columns.length)throw new Error(`Cell count must match column count. Found ${l.length} cells and ${n.columns.length} columns.`);yield*l,yield*u}},shouldInvalidate(l){return l.columns.length!==n.columns.length||l.columns.some((u,d)=>u.key!==n.columns[d].key)||l.showSelectionCheckboxes!==n.showSelectionCheckboxes||l.showDragButtons!==n.showDragButtons||l.selectionMode!==n.selectionMode}}};let Io=et;function cn(t){return null}cn.getCollectionNode=function*(e){let{children:n}=e,r=e.textValue||(typeof n=="string"?n:"")||e["aria-label"]||"";yield{type:"cell",props:e,rendered:n,textValue:r,"aria-label":e["aria-label"],hasChildNodes:!1}};let Oo=cn;const at=i.createContext(null),un=i.createContext(null);function Lo(t){let e=q.useTooltipTriggerState(t),n=i.useRef(null),{triggerProps:r,tooltipProps:o}=y.useTooltipTrigger(t,e,n);return i.createElement(Ne,{values:[[at,e],[un,{...o,triggerRef:n}]]},i.createElement(bo,{...r,ref:n},t.children))}function Do({UNSTABLE_portalContainer:t,...e},n){[e,n]=ge(e,n,un);let r=i.useContext(at),o=q.useTooltipTriggerState(e),s=e.isOpen!=null||e.defaultOpen!=null||!r?o:r,l=no(n,s.isOpen)||e.isExiting||!1;return!s.isOpen&&!l?null:i.createElement(y.OverlayContainer,{portalContainer:t},i.createElement(Ho,{...e,tooltipRef:n,isExiting:l}))}const Bo=i.forwardRef(Do);function Ho(t){let e=i.useContext(at),n=i.useRef(null),[r,o]=i.useState(0);ue(()=>{n.current&&e.isOpen&&o(n.current.getBoundingClientRect().width)},[e.isOpen,n]);let{overlayProps:s,arrowProps:l,placement:u}=y.useOverlayPosition({placement:t.placement||"top",targetRef:t.triggerRef,overlayRef:t.tooltipRef,offset:t.offset,crossOffset:t.crossOffset,isOpen:e.isOpen,arrowSize:r,arrowBoundaryOffset:t.arrowBoundaryOffset,shouldFlip:t.shouldFlip}),d=to(t.tooltipRef,!!u)||t.isEntering||!1,p=de({...t,defaultClassName:"react-aria-Tooltip",values:{placement:u,isEntering:d,isExiting:t.isExiting,state:e}});t=y.mergeProps(t,s);let{tooltipProps:f}=y.useTooltip(t,e);return i.createElement("div",{...f,ref:t.tooltipRef,...p,style:{...s.style,...p.style},"data-placement":u,"data-entering":d||void 0,"data-exiting":t.isExiting||void 0},i.createElement(tn.Provider,{value:{...l,placement:u,ref:n}},p.children))}function dn(t,e="down"){const n=e==="down"?`(max-width: ${t}px)`:`(min-width: ${t}px)`,[r,o]=i.useState(()=>typeof window<"u"?window.matchMedia(n).matches:!1);return i.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(n),l=u=>{o(u.matches)};return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[n]),r}const Vo=({size:t})=>c.jsx("svg",{viewBox:"0 0 24 24",width:t,height:t,children:c.jsx("path",{fill:"currentColor",d:"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})});function Wo({renderTrigger:t,menuId:e,size:n=24,actions:r,disabled:o,onClose:s,testId:l,menuTestId:u}){const{className:d}=te(),p=dn(Q.BREAKPOINTS.SMALL),[f,v]=i.useState(!1),h=i.useRef(null),m={disabled:o,"data-testid":l,"aria-label":"Menu"},x=c.jsx(en,{...m,ref:h,onPress:()=>v($=>!$),isDisabled:o,className:`proton-ResponsiveMenuTrigger__button ${d}`,children:c.jsx(Vo,{size:n})}),S=t?t({...m,onClick:()=>v($=>!$)},f):x;return i.useEffect(()=>()=>{f&&(s==null||s())},[f,s]),p?c.jsxs(c.Fragment,{children:[S,f&&c.jsx(nt,{id:e,actions:r,isOpen:f,onClose:()=>{v(!1)},showCancel:!0,"data-testid":u})]}):c.jsxs(Co,{children:[S,f&&c.jsx(Pe,{state:{isOpen:f,setOpen:v,open:()=>v(!0),close:()=>v(!1),toggle:()=>v(!f)},triggerRef:h,arrow:!1,children:c.jsx(To,{className:"proton-ListBox proton-ResponsiveMenuTrigger__menu",id:e,autoFocus:!0,"data-testid":u,children:r.map($=>c.jsx(No,{href:$.to,target:"_blank",rel:"noopener noreferrer",onAction:()=>{var C;(C=$.onAction)==null||C.call($,$.key),setTimeout(()=>{v(!1)},200)},className:"proton-ListBox__item proton-ResponsiveMenuTrigger__menu-item",children:$.label},$.key))})})]})}const tt=t=>{let e=i.useRef(null),{state:n}=t,{listBoxProps:r}=y.useListBox(t,n,e);return c.jsx(y.FocusScope,{contain:!0,restoreFocus:!0,autoFocus:!0,children:c.jsx("ul",{...r,ref:e,"data-testid":"listbox",className:"proton-ListBox",children:[...n.collection].map(o=>c.jsx(Ko,{item:o,state:n},o.key))})})};function Ko({item:t,state:e}){let n=i.useRef(null),{optionProps:r,isSelected:o,isFocused:s,isDisabled:l}=y.useOption({key:t.key},e,n);return c.jsx("li",{...r,className:E.csx("proton-ListBox__item",s&&"proton-ListBox__item--focused",o&&"proton-ListBox__item--selected",l&&"proton-ListBox__item--disabled"),ref:n,children:t.rendered})}const fn=i.forwardRef((t,e)=>{let{buttonProps:n}=y.useButton({...t,isDisabled:t.disabled},e);return c.jsx("button",{...n,ref:e,className:E.csx("proton-Select__trigger",t.disabled&&"proton-Select__trigger--disabled",!t.isOpen&&"proton-Select__trigger--closed",t.isOpen&&"proton-Select__trigger--opened"),children:t.children})});function Fo({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:o,onSelectionChange:s,onOpen:l,onClose:u,items:d,"data-testid":p,children:f}){const v={label:t,isDisabled:n,disabledKeys:r,selectedKey:o,items:d,"data-testid":p,children:f,onSelectionChange:s,onOpenChange:M=>{M?l==null||l():u==null||u()}},h=q.useSelectState(v),m=i.useRef(null),x=i.useRef(null),{labelProps:S,triggerProps:$,valueProps:C,menuProps:R}=y.useSelect({...v,label:t||e},h,m);return i.useEffect(()=>{h.isOpen&&x.current&&m.current&&!x.current.style.minWidth&&(x.current.style.minWidth=`${m.current.offsetWidth}px`)}),c.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?c.jsx("div",{...S,className:"proton-Select__label","data-testid":"select-label",children:t}):c.jsx("div",{...S}),c.jsx(y.HiddenSelect,{isDisabled:n,state:h,triggerRef:m,label:t||e,name:e,"data-testid":"hidden-select-container"}),c.jsxs(fn,{...$,isOpen:h.isOpen,ref:m,disabled:n,"data-testid":p,children:[c.jsx("div",{...C,className:"proton-Select__value",children:h.selectedItem?h.selectedItem.rendered:"Select an option"}),c.jsx("div",{className:E.csx("proton-Select__trigger_icon",h.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:c.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[c.jsx("title",{children:h.isOpen?"caret down":"caret up"}),c.jsx("path",{fill:"currentColor",d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})]})})]}),h.isOpen&&c.jsx("div",{className:"proton-Select__popover",children:c.jsx(Pe,{state:h,triggerRef:m,popoverRef:x,placement:"bottom start","data-testid":"select-popover",children:c.jsx(tt,{...R,state:h})})})]})}const Go={Menu:Fo,Option:q.Item};function Yo({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:o,onSelectionChange:s,onOpen:l,onClose:u,items:d,"data-testid":p,children:f}){const v={label:t,isDisabled:n,disabledKeys:r,selectedKey:o,onSelectionChange:s,onOpenChange:P=>{P?l==null||l():u==null||u()},items:d,"data-testid":p,children:f},h=q.useSelectState(v),m=dn(Q.BREAKPOINTS.MEDIUM),x=i.useRef(null),S=i.useRef(null),{labelProps:$,triggerProps:C,valueProps:R,menuProps:M}=y.useSelect({...v,label:t||e},h,x);return i.useEffect(()=>{h.isOpen&&S.current&&x.current&&!S.current.style.minWidth&&(S.current.style.minWidth=`${x.current.offsetWidth}px`)}),c.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?c.jsx("div",{...$,className:"proton-Select__label","data-testid":"select-label",children:t}):c.jsx("div",{...$}),c.jsx(y.HiddenSelect,{isDisabled:n,state:h,triggerRef:x,label:t||e,name:e,"data-testid":"hidden-select-container"}),c.jsxs(fn,{...C,isOpen:h.isOpen,ref:x,disabled:n,"data-testid":p,children:[c.jsx("div",{...R,children:h.selectedItem?h.selectedItem.rendered:"Select an option"}),c.jsx("div",{className:E.csx("proton-Select__trigger_icon",h.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:c.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[c.jsx("title",{children:h.isOpen?"caret down":"caret up"}),c.jsx("path",{fill:"currentColor",d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})]})})]}),h.isOpen&&c.jsx(c.Fragment,{children:m?c.jsx(nt,{isOpen:h.isOpen,onClose:()=>h.close(),children:c.jsx(tt,{...M,state:h})}):c.jsx("div",{className:"proton-Select__popover",children:c.jsx(Pe,{state:h,triggerRef:x,popoverRef:S,placement:"bottom start","data-testid":"select-popover",children:c.jsx(tt,{...M,state:h})})})})]})}const zo={Menu:Yo,Option:q.Item};function Uo(t){let e={...t,isSelected:t.isOn,"data-testid":void 0},n=i.useRef(null),r=q.useToggleState(e),{inputProps:o}=y.useSwitch(e,r,n);return c.jsxs("label",{className:E.csx("proton-Switch",t.isDisabled&&"proton-Switch--disabled",r.isSelected&&"proton-Switch--on"),"data-on":r.isSelected||void 0,"data-disabled":t.isDisabled||void 0,"data-testid":t["data-testid"]||void 0,"aria-label":t.label||void 0,children:[c.jsx(y.VisuallyHidden,{children:c.jsx("input",{...o,ref:n})}),t.label&&c.jsx("div",{className:"proton-Switch__label",children:t.label}),c.jsxs("div",{className:"proton-Switch__wrapper",children:[c.jsx("div",{className:"proton-Switch__toggle",children:c.jsx("div",{className:"proton-Switch__slider"})}),t.children&&c.jsx("div",{className:"proton-Switch__description",children:t.children})]})]})}function qo({item:t,state:e,children:n}){let r=i.useRef(),{rowProps:o}=y.useTableHeaderRow({node:t},e,r);return c.jsx("tr",{className:E.csx("proton-Table__headerRow"),...o,ref:r,children:n})}function Jo({column:t,state:e}){var d,p;let n=i.useRef(),{columnHeaderProps:r}=y.useTableColumnHeader({node:t},e,n);const{align:o="left"}=t.props;let{isFocusVisible:s,focusProps:l}=y.useFocusRing(),u=((d=e.sortDescriptor)==null?void 0:d.direction)==="ascending"?"▲":"▼";return c.jsxs("th",{...y.mergeProps(r,l),colSpan:t.colspan,className:E.csx("proton-Table__header",`proton-Table__header--${o}`,s?"proton-Table__header--focused":null),ref:n,children:[t.rendered,t.props.allowsSorting&&c.jsx("span",{"aria-hidden":"true",className:E.csx("proton-Table__headerSortIcon"),style:{visibility:((p=e.sortDescriptor)==null?void 0:p.column)===t.key?"visible":"hidden"},children:u})]})}function Lt({type:t,children:e}){let{rowGroupProps:n}=y.useTableRowGroup();return c.jsx(t,{...n,className:E.csx("proton-Table__rowGroup",t==="thead"?"proton-Table__rowGroup--header":"proton-Table__rowGroup--body"),children:e})}function Xo({item:t,children:e,state:n}){let r=i.useRef(),o=n.selectionManager.isSelected(t.key),{rowProps:s,isPressed:l}=y.useTableRow({node:t},n,r),{isFocusVisible:u,focusProps:d}=y.useFocusRing();return c.jsx("tr",{className:E.csx("proton-Table__row",o?"proton-Table__row--selected":null,l?"proton-Table__row--pressed":null,u?"proton-Table__row--focused":null),...y.mergeProps(s,d),ref:r,children:e})}function Zo({cell:t,state:e,...n}){let r=i.useRef(),{gridCellProps:o}=y.useTableCell({node:t},e,r),{isFocusVisible:s,focusProps:l}=y.useFocusRing();const{align:u}=t.props;return c.jsx("td",{...y.mergeProps(o,l),className:E.csx("proton-Table__cell",s?"proton-Table__cell--focused":null,`proton-Table__cell--${u}`),ref:r,children:t.rendered})}const Qo=ko,ei=Oo;function ti(t){let e=q.useTableState({...t}),n=i.useRef(),{collection:r}=e,{gridProps:o}=y.useTable({...t,"aria-label":t["aria-label"]||"Table"},e,n);return c.jsxs("table",{...o,ref:n,className:E.csx("proton-Table"),children:[c.jsx(Lt,{type:"thead",children:r.headerRows.map(s=>c.jsx(qo,{item:s,state:e,children:Array.from(r.getChildren(s.key)).map(l=>c.jsx(Jo,{column:l,state:e},l.key))},s.key))}),c.jsx(Lt,{type:"tbody",children:Array.from(r.body.childNodes).map(s=>c.jsx(Xo,{item:s,state:e,children:Array.from(r.getChildren(s.key)).map(l=>c.jsx(Zo,{cell:l,state:e},l.key))},s.key))})]})}function pn({children:t,arrow:e,...n}){const{className:r,style:o}=te();return console.log(n),c.jsxs(Bo,{...n,className:`proton__Tooltip proton-Dialog ${r}`,style:o,children:[e&&c.jsx(So,{className:"proton__TooltipArrow",children:c.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",children:c.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})}function hn({children:t,delay:e=500,closeDelay:n=500,isDisabled:r,defaultOpen:o,onOpenChange:s,disableTriggerClick:l,content:u,...d}){const[p,f]=i.useState(!1),v=i.useRef(!1),h=i.useRef(!1);return console.log({tooltipProps:d}),c.jsxs(Lo,{delay:e,closeDelay:n,isDisabled:r,isOpen:p,defaultOpen:o,onOpenChange:m=>{m&&!v.current&&(h.current=!0),s&&s(m),v.current||f(m),v.current=!1},children:[c.jsx(en,{className:"proton__TooltipTrigger","aria-label":"Show tooltip",onPress:()=>{l||h.current||(v.current=!0,f(!p))},children:t}),c.jsx(pn,{...d,children:u})]})}const ni=({to:t,children:e,tooltipProps:n,"data-testid":r})=>{const{className:o,palette:s,theme:l}=te(),u=n?c.jsx(hn,{delay:50,closeDelay:75,...n,children:e}):e,d={"--text-emphasis-highlight":l===Q.THEMES.CUSTOM_DARK?Z.transparentize(s.SECONDARY.SECONDARY_LIGHT,.3):Z.transparentize(k.BRAND.PRIMARY,.5)};if(t){const p=E.isUrlExternal(t);return c.jsx("span",{className:E.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",o),style:d,children:c.jsx("a",{"data-testid":r,href:t,target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,onClick:p?void 0:f=>E.handleInternalNavigation(f,t),children:u})})}return c.jsx("span",{className:E.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",o),style:d,"data-testid":r,children:u})};function ri({amplitude:t,isDisabled:e,isPlayed:n,isHovered:r,isVisible:o,hasAnimated:s,resolution:l,spacing:u,index:d}){const p=o?`${Math.max(t*100,4)}%`:"0%";return c.jsxs("div",{className:E.csx("proton-Waveform__bar-wrapper"),style:{width:`${l}px`,marginRight:`${u}px`},children:[c.jsx("div",{className:E.csx("proton-Waveform__bar","proton-Waveform__bar--upper",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",o&&"proton-Waveform__bar--visible",s&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${p} / 2)`,"--index":d}}),c.jsx("div",{className:E.csx("proton-Waveform__bar","proton-Waveform__bar--lower",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",o&&"proton-Waveform__bar--visible",s&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${p} / 2)`,"--index":d}}),r&&!e&&!n&&c.jsx("div",{className:"proton-Waveform__bar--hover",style:{"--hover-height":p}})]})}const oi=ci(100);function ii({data:t,resolution:e=2,startDuration:n,endDuration:r,currentTime:o=0,showTimestamps:s=!1,totalDuration:l,onClick:u,timestampColor:d,"data-testid":p}){var J;const{className:f,palette:v,theme:h}=te(),m=i.useRef(null),[x,S]=i.useState([]),[$,C]=i.useState(null),[R,M]=i.useState(!1),[P,O]=i.useState(!1),j=t||oi,W=d||(h==="custom-dark"?v.BRAND.PRIMARY:void 0),F=e;i.useEffect(()=>{if(!m.current)return;const L=Y=>{const oe=Math.floor(Y/(e+F)),ae=ai(j,oe);S(ae)},K=m.current.clientWidth;L(K);const G=new ResizeObserver(Y=>{Y&&Y[0]&&L(Y[0].contentRect.width)});return G.observe(m.current),()=>G.disconnect()},[j,e,F]),i.useEffect(()=>{const L=setTimeout(()=>M(!0),50),K=setTimeout(()=>O(!0),500);return()=>{clearTimeout(L),clearTimeout(K)}},[]);const V=L=>{if(!m.current)return;const K=m.current.getBoundingClientRect(),Y=(L.clientX-K.left)/K.width*l;C(Y)},ee=()=>{C(null)},ie=e+F,I=(L,K)=>{var oe;const G=L/l*100;return(K==="start"?Math.floor(G/100*x.length):Math.ceil(G/100*x.length))*ie/((oe=m.current)==null?void 0:oe.clientWidth)*100},B=(J=m.current)==null?void 0:J.clientWidth;return c.jsxs("div",{className:E.csx("proton-Waveform",f),"data-testid":p,children:[s&&c.jsx(Dt,{direction:"left",seconds:o,color:W}),c.jsxs("div",{ref:m,className:"proton-Waveform__container",onMouseMove:V,onMouseLeave:ee,onClick:L=>{if(!m.current)return;const K=m.current.getBoundingClientRect(),Y=(L.clientX-K.left)/K.width*l;u==null||u(Y,L)},children:[n!==void 0&&r!==void 0&&c.jsx("div",{className:"proton-Waveform__active-region",style:{left:m.current?`calc(${I(n,"start")}%`:"0%",right:m.current?`calc(${100-I(r,"end")}% - 2px)`:"0%"}}),$!==null&&c.jsx("div",{className:"proton-Waveform__hover-line",style:{left:`${$/l*100}%`}}),x.map((L,K)=>{const G=K/x.length*l,Y=n!==void 0&&r!==void 0&&(G<n||G>r),oe=o===0?!1:G<=o,ae=$!==null&&G<=$;return c.jsx(ri,{amplitude:L,isDisabled:Y,isPlayed:oe,isHovered:ae,isVisible:R,hasAnimated:P,resolution:e,spacing:F,index:K},K)})]}),!t&&c.jsx("div",{className:"proton-Waveform__bar-unavailable",style:{backgroundColor:W,fontSize:B<325?"0.85rem":"1rem"},children:B<277?"Unavailable":"Waveform Unavailable"}),s&&c.jsx(Dt,{direction:"right",seconds:l,color:W})]})}function Dt({direction:t,color:e,seconds:n}){return c.jsx("div",{className:E.csx("proton-Waveform__timestamp",`proton-Waveform__timestamp--${t}`),style:{backgroundColor:e},children:si(n)})}function si(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?"0":""}${n.toFixed(0)}`}function ai(t,e){const n=t.length,r=n/e,o=new Array(e).fill(0).map((s,l)=>{const u=l*r,d=Math.floor(u),p=Math.min(d+1,n-1),f=u-d;return t[d]*(1-f)+t[p]*f});return li(o)}function li(t){const e=Math.min(...t),n=Math.max(...t);return t.map(r=>{const o=(r-e)/(n-e);return Math.max(o*.8+.1,.1)})}function ci(t){return Array.from({length:t},(e,n)=>{const o=n/(t-1)*6*2*Math.PI-Math.PI/2;return Math.sin(o)*.5+.5})}exports.THEMES=Q.THEMES;exports.COLORS=k.colors;exports.ActionMenu=nt;exports.Badge=Xn;exports.BadgeVariants=Jn;exports.Banner=re;exports.Button=rt;exports.ButtonGroup=Wt;exports.Cell=ei;exports.Column=Qo;exports.Dialog=ir;exports.Icon=lr;exports.Input=Kt;exports.Popover=Pe;exports.ResponsiveMenuTrigger=Wo;exports.ResponsiveSelect=zo;exports.Row=Io;exports.SearchInput=dr;exports.Section=Eo;exports.Select=Go;exports.Switch=Uo;exports.Table=ti;exports.TableBody=Ao;exports.TableHeader=jo;exports.TextEmphasis=ni;exports.ThemeProvider=Un;exports.Tooltip=pn;exports.TooltipTrigger=hn;exports.Waveform=ii;exports.usePopoverTrigger=fr;exports.useTheme=te;
46
+ */var Nt;function Br(){return Nt||(Nt=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=i,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(M){{for(var P=arguments.length,O=new Array(P>1?P-1:0),j=1;j<P;j++)O[j-1]=arguments[j];r("error",M,O)}}function r(M,P,O){{var j=e.ReactDebugCurrentFrame,W=j.getStackAddendum();W!==""&&(P+="%s",O=O.concat([W]));var F=O.map(function(V){return String(V)});F.unshift("Warning: "+P),Function.prototype.apply.call(console[M],console,F)}}function o(M,P){return M===P&&(M!==0||1/M===1/P)||M!==M&&P!==P}var s=typeof Object.is=="function"?Object.is:o,l=t.useState,u=t.useEffect,d=t.useLayoutEffect,p=t.useDebugValue,f=!1,v=!1;function h(M,P,O){f||t.startTransition!==void 0&&(f=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var j=P();if(!v){var W=P();s(j,W)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),v=!0)}var F=l({inst:{value:j,getSnapshot:P}}),V=F[0].inst,ee=F[1];return d(function(){V.value=j,V.getSnapshot=P,m(V)&&ee({inst:V})},[M,j,P]),u(function(){m(V)&&ee({inst:V});var ie=function(){m(V)&&ee({inst:V})};return M(ie)},[M]),p(j),j}function m(M){var P=M.getSnapshot,O=M.value;try{var j=P();return!s(O,j)}catch{return!0}}function x(M,P,O){return P()}var S=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$=!S,C=$?x:h,R=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:C;Fe.useSyncExternalStore=R,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Fe}process.env.NODE_ENV==="production"?Ue.exports=Dr():Ue.exports=Br();var Hr=Ue.exports;const qt=i.createContext(!1),be=i.createContext(null);function Vr(t){if(i.useContext(be))return t.content;let{collection:n,document:r}=Gr(t.createCollection);return i.createElement(i.Fragment,null,i.createElement(Er,null,i.createElement(be.Provider,{value:r},t.content)),i.createElement(Wr,{render:t.children,collection:n}))}function Wr({collection:t,render:e}){return e(t)}function Kr(t,e,n){let r=Te(),o=i.useRef(r);o.current=r;let s=i.useCallback(()=>o.current?n():e(),[e,n]);return Hr.useSyncExternalStore(t,s)}const Fr=typeof i.useSyncExternalStore=="function"?i.useSyncExternalStore:Kr;function Gr(t){let[e]=i.useState(()=>new hr((t==null?void 0:t())||new pr)),n=i.useCallback(l=>e.subscribe(l),[e]),r=i.useCallback(()=>{let l=e.getCollection();return e.isSSR&&e.resetAfterSSR(),l},[e]),o=i.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),s=Fr(n,r,o);return ue(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:s,document:e}}const qe=i.createContext(null);function Yr(t,e,n,r,o,s){let l=i.useCallback(d=>{d==null||d.setProps(e,n,r,s)},[e,n,r,s]),u=i.useContext(qe);if(u){let d=u.ownerDocument.nodesByProps.get(e);return d||(d=u.ownerDocument.createElement(t),d.setProps(e,n,r,s),u.appendChild(d),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(e,d)),o?i.createElement(qe.Provider,{value:d},o):null}return i.createElement(t,{ref:l},o)}function zr(t,e){let n=({node:o})=>e(o.props,o.props.ref,o),r=i.forwardRef((o,s)=>{if(!i.useContext(qt)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(o,s)}return Yr(t,o,s,"children"in o?o.children:null,null,u=>i.createElement(n,{node:u}))});return r.displayName=e.name,r}function Ur(t){return Gt({...t,addIdAndValue:!0})}const jt=i.createContext(null);function qr(t){let e=i.useContext(jt),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),o=Ur({...t,idScope:r,dependencies:n});return i.useContext(be)&&(o=i.createElement(Jr,null,o)),e=i.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),i.createElement(jt.Provider,{value:e},o)}function Jr({children:t}){let e=i.useContext(be),n=i.useMemo(()=>i.createElement(be.Provider,{value:null},i.createElement(qt.Provider,{value:!0},t)),[t]);return Te()?i.createElement(qe.Provider,{value:e},n):we.createPortal(n,e)}const Xr=i.createContext(null),Zr={CollectionRoot({collection:t,renderDropIndicator:e}){return At(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return At(t,e,n)}};function At(t,e,n){return Gt({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){var o;let s=r.render(r);if(!n||r.type!=="item")return s;let l=r.key,u=t.getKeyAfter(l);return i.createElement(i.Fragment,null,n({type:"item",key:l,dropPosition:"before"}),s,(u==null||((o=t.getItem(u))===null||o===void 0?void 0:o.type)!=="item")&&n({type:"item",key:l,dropPosition:"after"}))}})}const Jt=i.createContext(Zr);function Qr(t){return i.useMemo(()=>t!=null?new Set([t]):null,[t])}const kt=Symbol("default");function Ne({values:t,children:e}){for(let[n,r]of t)e=i.createElement(n.Provider,{value:r},e);return e}function de(t){let{className:e,style:n,children:r,defaultClassName:o,defaultChildren:s,defaultStyle:l,values:u}=t;return i.useMemo(()=>{let d,p,f;return typeof e=="function"?d=e({...u,defaultClassName:o}):d=e,typeof n=="function"?p=n({...u,defaultStyle:l||{}}):p=n,typeof r=="function"?f=r({...u,defaultChildren:s}):r==null?f=s:f=r,{className:d??o,style:p||l?{...l,...p}:void 0,children:f??s,"data-rac":""}},[e,n,r,o,s,l,u])}function Xt(t,e){let n=i.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`));if(!e&&!n.slots[kt])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let o=e||kt;if(!n.slots[o])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[o]}return n}function ge(t,e,n){let r=Xt(n,t.slot)||{},{ref:o,...s}=r,l=Me(i.useMemo(()=>Mr(e,o),[e,o])),u=Ut(s,t);return"style"in s&&s.style&&"style"in t&&t.style&&(typeof s.style=="function"||typeof t.style=="function"?u.style=d=>{let p=typeof s.style=="function"?s.style(d):s.style,f={...d.defaultStyle,...p},v=typeof t.style=="function"?t.style({...d,defaultStyle:f}):t.style;return{...f,...v}}:u.style={...s.style,...t.style}),[u,l]}function eo(){let[t,e]=i.useState(!0),n=i.useRef(!1),r=i.useCallback(o=>{n.current=!0,e(!!o)},[]);return ue(()=>{n.current||e(!1)},[]),[r,t]}function to(t,e=!0){let[n,r]=i.useState(!0);return Zt(t,n&&e,i.useCallback(()=>r(!1),[])),n&&e}function no(t,e){let[n,r]=i.useState(!1),[o,s]=i.useState("idle");return!e&&t.current&&o==="idle"&&(n=!0,r(!0),s("exiting")),!t.current&&o==="exited"&&s("idle"),Zt(t,n,i.useCallback(()=>{s("exited"),r(!1)},[])),n}function Zt(t,e,n){let r=i.useRef(null);e&&t.current&&(r.current=window.getComputedStyle(t.current).animation),ue(()=>{if(e&&t.current){let o=window.getComputedStyle(t.current);if(o.animationName&&o.animationName!=="none"&&o.animation!==r.current){let s=u=>{u.target===t.current&&(l.removeEventListener("animationend",s),we.flushSync(()=>{n()}))},l=t.current;return l.addEventListener("animationend",s),()=>{l.removeEventListener("animationend",s)}}else n()}},[t,e,n])}const ro=i.createContext(null),Qt=7e3;let ne=null;function It(t,e="assertive",n=Qt){ne?ne.announce(t,e,n):(ne=new oo,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?ne.announce(t,e,n):setTimeout(()=>{ne!=null&&ne.isAttached()&&(ne==null||ne.announce(t,e,n))},100))}class oo{isAttached(){var e;return(e=this.node)===null||e===void 0?void 0:e.isConnected}createLog(e){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",e),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,n="assertive",r=Qt){var o,s;if(!this.node)return;let l=document.createElement("div");typeof e=="object"?(l.setAttribute("role","img"),l.setAttribute("aria-labelledby",e["aria-labelledby"])):l.textContent=e,n==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(l):(s=this.politeLog)===null||s===void 0||s.appendChild(l),e!==""&&setTimeout(()=>{l.remove()},r)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}const io=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),so=i.createContext({});function ao(t,e){[t,e]=ge(t,e,so),t=lo(t);let n=t,{isPending:r}=n,{buttonProps:o,isPressed:s}=y.useButton(t,e),{focusProps:l,isFocused:u,isFocusVisible:d}=y.useFocusRing(t),{hoverProps:p,isHovered:f}=y.useHover({...t,isDisabled:t.isDisabled||r}),v={isHovered:f,isPressed:(n.isPressed||s)&&!r,isFocused:u,isFocusVisible:d,isDisabled:t.isDisabled||!1,isPending:r??!1},h=de({...t,values:v,defaultClassName:"react-aria-Button"}),m=y.useId(o.id),x=y.useId(),S=o["aria-labelledby"];r&&(S?S=`${S} ${x}`:o["aria-label"]&&(S=`${m} ${x}`));let $=i.useRef(r);return i.useEffect(()=>{let C={"aria-labelledby":S||m};(!$.current&&u&&r||$.current&&u&&!r)&&It(C,"assertive"),$.current=r},[r,u,S,m]),i.createElement("button",{...it(t,{propNames:io}),...y.mergeProps(o,l,p),...h,id:m,ref:e,"aria-labelledby":S,slot:t.slot||void 0,"aria-disabled":r?"true":o["aria-disabled"],"data-disabled":t.isDisabled||void 0,"data-pressed":v.isPressed||void 0,"data-hovered":f||void 0,"data-focused":u||void 0,"data-pending":r||void 0,"data-focus-visible":d||void 0},i.createElement(ro.Provider,{value:{id:x}},h.children))}function lo(t){return t.isPending&&(t.onPress=void 0,t.onPressStart=void 0,t.onPressEnd=void 0,t.onPressChange=void 0,t.onPressUp=void 0,t.onKeyDown=void 0,t.onKeyUp=void 0,t.onClick=void 0,t.href=void 0),t}const en=Cr(ao),co=i.createContext({}),Je=i.createContext({register:()=>{}});Je.displayName="PressResponderContext";const uo=i.forwardRef(({children:t,...e},n)=>{let r=i.useRef(!1),o=i.useContext(Je);n=Me(n||(o==null?void 0:o.ref));let s=Ut(o||{},{...e,ref:n,register(){r.current=!0,o&&o.register()}});return Lr(o,n),i.useEffect(()=>{r.current||(console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component."),r.current=!0)},[]),i.createElement(Je.Provider,{value:s},t)});let Ce=!1,Ge=0;function Xe(){Ce=!0,setTimeout(()=>{Ce=!1},50)}function Ot(t){t.pointerType==="touch"&&Xe()}function fo(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",Ot):document.addEventListener("touchend",Xe),Ge++,()=>{Ge--,!(Ge>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Ot):document.removeEventListener("touchend",Xe))}}function po(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:o}=t,[s,l]=i.useState(!1),u=i.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;i.useEffect(fo,[]);let{hoverProps:d,triggerHoverEnd:p}=i.useMemo(()=>{let f=(m,x)=>{if(u.pointerType=x,o||x==="touch"||u.isHovered||!m.currentTarget.contains(m.target))return;u.isHovered=!0;let S=m.currentTarget;u.target=S,e&&e({type:"hoverstart",target:S,pointerType:x}),n&&n(!0),l(!0)},v=(m,x)=>{if(u.pointerType="",u.target=null,x==="touch"||!u.isHovered)return;u.isHovered=!1;let S=m.currentTarget;r&&r({type:"hoverend",target:S,pointerType:x}),n&&n(!1),l(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=m=>{Ce&&m.pointerType==="mouse"||f(m,m.pointerType)},h.onPointerLeave=m=>{!o&&m.currentTarget.contains(m.target)&&v(m,m.pointerType)}):(h.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=m=>{!u.ignoreEmulatedMouseEvents&&!Ce&&f(m,"mouse"),u.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=m=>{!o&&m.currentTarget.contains(m.target)&&v(m,"mouse")}),{hoverProps:h,triggerHoverEnd:v}},[e,n,r,o,u]);return i.useEffect(()=>{o&&p({currentTarget:u.target},u.pointerType)},[o]),{hoverProps:d,isHovered:s}}function ho(t){let{ref:e,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:o}=t,s=i.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),l=Pt(d=>{n&&_e(d,e)&&(o&&o(d),s.current.isPointerDown=!0)}),u=Pt(d=>{n&&n(d)});i.useEffect(()=>{let d=s.current;if(r)return;const p=e.current,f=Pr(p);if(typeof PointerEvent<"u"){let v=h=>{d.isPointerDown&&_e(h,e)&&u(h),d.isPointerDown=!1};return f.addEventListener("pointerdown",l,!0),f.addEventListener("pointerup",v,!0),()=>{f.removeEventListener("pointerdown",l,!0),f.removeEventListener("pointerup",v,!0)}}else{let v=m=>{d.ignoreEmulatedMouseEvents?d.ignoreEmulatedMouseEvents=!1:d.isPointerDown&&_e(m,e)&&u(m),d.isPointerDown=!1},h=m=>{d.ignoreEmulatedMouseEvents=!0,d.isPointerDown&&_e(m,e)&&u(m),d.isPointerDown=!1};return f.addEventListener("mousedown",l,!0),f.addEventListener("mouseup",v,!0),f.addEventListener("touchstart",l,!0),f.addEventListener("touchend",h,!0),()=>{f.removeEventListener("mousedown",l,!0),f.removeEventListener("mouseup",v,!0),f.removeEventListener("touchstart",l,!0),f.removeEventListener("touchend",h,!0)}}},[e,r,l,u])}function _e(t,e){if(t.button>0)return!1;if(t.target){const n=t.target.ownerDocument;if(!n||!n.documentElement.contains(t.target)||t.target.closest("[data-react-aria-top-layer]"))return!1}return e.current&&!e.current.contains(t.target)}let vo=i.createContext(null);function mo(t,e){let{children:n,...r}=t,o=Me(e),s={...r,ref:o};return i.createElement(vo.Provider,{value:s},n)}let bo=i.forwardRef(mo);const go=i.createContext({}),yo=i.createContext({}),tn=i.createContext({placement:"bottom"});function xo(t,e){[t,e]=ge(t,e,tn);let n=t.placement,r={position:"absolute",[n]:"100%",transform:n==="top"||n==="bottom"?"translateX(-50%)":"translateY(-50%)"},o=de({...t,defaultClassName:"react-aria-OverlayArrow",values:{placement:n}});return o.style&&Object.keys(o.style).forEach(s=>o.style[s]===void 0&&delete o.style[s]),i.createElement("div",{...t,...o,style:{...r,...o.style},ref:e,"data-placement":n})}const So=i.forwardRef(xo),Ze=i.createContext(null),$o=i.createContext(null),_o=i.createContext({});function nn(t){return null}nn.getCollectionNode=function*(e){let{children:n,title:r,items:o}=e;yield{type:"section",props:e,hasChildNodes:!0,rendered:r,"aria-label":e["aria-label"],*childNodes(){if(typeof n=="function"){if(!o)throw new Error("props.children was a function but props.items is missing");for(let s of o)yield{type:"item",value:s,renderer:n}}else{let s=[];i.Children.forEach(n,l=>{s.push({type:"item",element:l})}),yield*s}}}};let Eo=nn;const rn=i.createContext(null),st=i.createContext(null),on=i.createContext(null);function Co(t){let e=q.useMenuTriggerState(t),n=i.useRef(null),{menuTriggerProps:r,menuProps:o}=y.useMenuTrigger({...t,type:"menu"},e,n),[s,l]=i.useState(null),u=i.useCallback(()=>{n.current&&l(n.current.offsetWidth+"px")},[n]);Or({ref:n,onResize:u});let d=i.useRef(null);return i.createElement(Ne,{values:[[rn,{...o,ref:d}],[$o,e],[on,e],[Ze,{trigger:"MenuTrigger",triggerRef:n,scrollRef:d,placement:"bottom start",style:{"--trigger-width":s}}]]},i.createElement(uo,{...r,ref:n,isPressed:e.isOpen},t.children))}const wo=i.createContext(null);function Ro(t,e){return[t,e]=ge(t,e,rn),i.createElement(Vr,{content:i.createElement(qr,t)},n=>n.size>0&&i.createElement(Po,{props:t,collection:n,menuRef:e}))}function Po({props:t,collection:e,menuRef:n}){let r=q.useTreeState({...t,collection:e,children:void 0}),[o,s]=i.useState(null),{isVirtualized:l,CollectionRoot:u}=i.useContext(Jt),{menuProps:d}=y.useMenu({...t,isVirtualized:l},r,n),p=i.useContext(on),f=i.useContext(Ze),v=(f==null?void 0:f.trigger)==="SubmenuTrigger";ho({ref:n,onInteractOutside:$=>{p&&!(o!=null&&o.contains($.target))&&p.close()},isDisabled:v||(p==null?void 0:p.expandedKeysStack.length)===0});let h=i.useRef(null),[m,x]=i.useState({left:0});i.useEffect(()=>{if(o&&h.current!==o&&m.left===0){h.current=o;let{left:$}=o.getBoundingClientRect();x({left:-1*$})}},[m,o]);let S=de({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return i.createElement(y.FocusScope,null,i.createElement("div",{...it(t),...d,...S,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},i.createElement(Ne,{values:[[st,r],[yo,{elementType:"div"}],[Ze,{UNSTABLE_portalContainer:o||void 0}],[Xr,{render:Mo}],[wo,{parentMenuRef:n}],[Qe,null]]},i.createElement(u,{collection:e,persistedKeys:Qr(r.selectionManager.focusedKey),scrollRef:n}))),i.createElement("div",{ref:s,style:{width:"100vw",position:"absolute",top:0,...m}}))}const To=i.forwardRef(Ro);function Mo(t,e,n){var r,o;let s=i.useContext(st),{CollectionBranch:l}=i.useContext(Jt),[u,d]=eo();var p;let{headingProps:f,groupProps:v}=y.useMenuSection({heading:d,"aria-label":(p=n.props["aria-label"])!==null&&p!==void 0?p:void 0}),h=de({defaultClassName:"react-aria-Section",className:(r=n.props)===null||r===void 0?void 0:r.className,style:(o=n.props)===null||o===void 0?void 0:o.style,values:{}});return i.createElement("section",{...it(t),...v,...h,ref:e},i.createElement(go.Provider,{value:{...f,ref:u}},i.createElement(l,{collection:s.collection,parent:n})))}const Qe=i.createContext(null),No=zr("item",function(e,n,r){var o;[e,n]=ge(e,n,Qe);let s=(o=Xt(Qe))===null||o===void 0?void 0:o.id,l=i.useContext(st),u=Me(n),{menuItemProps:d,labelProps:p,descriptionProps:f,keyboardShortcutProps:v,...h}=y.useMenuItem({...e,id:s,key:r.key},l,u),{isFocusVisible:m,focusProps:x}=y.useFocusRing(),{hoverProps:S,isHovered:$}=po({isDisabled:h.isDisabled}),C=de({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...h,isHovered:$,isFocusVisible:m,selectionMode:l.selectionManager.selectionMode,selectionBehavior:l.selectionManager.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),R=e.href?"a":"div";return i.createElement(R,{...y.mergeProps(d,x,S),...C,ref:u,"data-disabled":h.isDisabled||void 0,"data-hovered":$||void 0,"data-focused":h.isFocused||void 0,"data-focus-visible":m||void 0,"data-pressed":h.isPressed||void 0,"data-selected":h.isSelected||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},i.createElement(Ne,{values:[[co,{slots:{label:p,description:f}}],[_o,v]]},C.children))});function sn(t){return null}sn.getCollectionNode=function*(e,n){let{children:r,columns:o}=e;if(n.columns=[],typeof r=="function"){if(!o)throw new Error("props.children was a function but props.columns is missing");for(let s of o)yield{type:"column",value:s,renderer:r}}else{let s=[];i.Children.forEach(r,l=>{s.push({type:"column",element:l})}),yield*s}};let jo=sn;function an(t){return null}an.getCollectionNode=function*(e){let{children:n,items:r}=e;yield{type:"body",hasChildNodes:!0,props:e,*childNodes(){if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");for(let o of r)yield{type:"item",value:o,renderer:n}}else{let o=[];i.Children.forEach(n,s=>{o.push({type:"item",element:s})}),yield*o}}}};let Ao=an;function ln(t){return null}ln.getCollectionNode=function*(e,n){let{title:r,children:o,childColumns:s}=e,l=r||o,u=e.textValue||(typeof l=="string"?l:"")||e["aria-label"],d=yield{type:"column",hasChildNodes:!!s||r&&i.Children.count(o)>0,rendered:l,textValue:u,props:e,*childNodes(){if(s)for(let f of s)yield{type:"column",value:f};else if(r){let f=[];i.Children.forEach(o,v=>{f.push({type:"column",element:v})}),yield*f}},shouldInvalidate(f){return p(f),!1}},p=f=>{for(let v of d)v.hasChildNodes||f.columns.push(v)};p(n)};let ko=ln;function et(t){return null}et.getCollectionNode=function*(e,n){let{children:r,textValue:o,UNSTABLE_childItems:s}=e;yield{type:"item",props:e,textValue:o,"aria-label":e["aria-label"],hasChildNodes:!0,*childNodes(){if(n.showDragButtons&&(yield{type:"cell",key:"header-drag",props:{isDragButtonCell:!0}}),n.showSelectionCheckboxes&&n.selectionMode!=="none"&&(yield{type:"cell",key:"header",props:{isSelectionCell:!0}}),typeof r=="function"){for(let l of n.columns)yield{type:"cell",element:r(l.key),key:l.key};if(s)for(let l of s)yield{type:"item",value:l}}else{let l=[],u=[];if(i.Children.forEach(r,d=>{if(d.type===et){if(l.length<n.columns.length)throw new Error("All of a Row's child Cells must be positioned before any child Rows.");u.push({type:"item",element:d})}else l.push({type:"cell",element:d})}),l.length!==n.columns.length)throw new Error(`Cell count must match column count. Found ${l.length} cells and ${n.columns.length} columns.`);yield*l,yield*u}},shouldInvalidate(l){return l.columns.length!==n.columns.length||l.columns.some((u,d)=>u.key!==n.columns[d].key)||l.showSelectionCheckboxes!==n.showSelectionCheckboxes||l.showDragButtons!==n.showDragButtons||l.selectionMode!==n.selectionMode}}};let Io=et;function cn(t){return null}cn.getCollectionNode=function*(e){let{children:n}=e,r=e.textValue||(typeof n=="string"?n:"")||e["aria-label"]||"";yield{type:"cell",props:e,rendered:n,textValue:r,"aria-label":e["aria-label"],hasChildNodes:!1}};let Oo=cn;const at=i.createContext(null),un=i.createContext(null);function Lo(t){let e=q.useTooltipTriggerState(t),n=i.useRef(null),{triggerProps:r,tooltipProps:o}=y.useTooltipTrigger(t,e,n);return i.createElement(Ne,{values:[[at,e],[un,{...o,triggerRef:n}]]},i.createElement(bo,{...r,ref:n},t.children))}function Do({UNSTABLE_portalContainer:t,...e},n){[e,n]=ge(e,n,un);let r=i.useContext(at),o=q.useTooltipTriggerState(e),s=e.isOpen!=null||e.defaultOpen!=null||!r?o:r,l=no(n,s.isOpen)||e.isExiting||!1;return!s.isOpen&&!l?null:i.createElement(y.OverlayContainer,{portalContainer:t},i.createElement(Ho,{...e,tooltipRef:n,isExiting:l}))}const Bo=i.forwardRef(Do);function Ho(t){let e=i.useContext(at),n=i.useRef(null),[r,o]=i.useState(0);ue(()=>{n.current&&e.isOpen&&o(n.current.getBoundingClientRect().width)},[e.isOpen,n]);let{overlayProps:s,arrowProps:l,placement:u}=y.useOverlayPosition({placement:t.placement||"top",targetRef:t.triggerRef,overlayRef:t.tooltipRef,offset:t.offset,crossOffset:t.crossOffset,isOpen:e.isOpen,arrowSize:r,arrowBoundaryOffset:t.arrowBoundaryOffset,shouldFlip:t.shouldFlip}),d=to(t.tooltipRef,!!u)||t.isEntering||!1,p=de({...t,defaultClassName:"react-aria-Tooltip",values:{placement:u,isEntering:d,isExiting:t.isExiting,state:e}});t=y.mergeProps(t,s);let{tooltipProps:f}=y.useTooltip(t,e);return i.createElement("div",{...f,ref:t.tooltipRef,...p,style:{...s.style,...p.style},"data-placement":u,"data-entering":d||void 0,"data-exiting":t.isExiting||void 0},i.createElement(tn.Provider,{value:{...l,placement:u,ref:n}},p.children))}function dn(t,e="down"){const n=e==="down"?`(max-width: ${t}px)`:`(min-width: ${t}px)`,[r,o]=i.useState(()=>typeof window<"u"?window.matchMedia(n).matches:!1);return i.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(n),l=u=>{o(u.matches)};return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[n]),r}const Vo=({size:t})=>c.jsx("svg",{viewBox:"0 0 24 24",width:t,height:t,children:c.jsx("path",{fill:"currentColor",d:"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})});function Wo({renderTrigger:t,menuId:e,size:n=24,actions:r,disabled:o,onClose:s,testId:l,menuTestId:u}){const{className:d}=te(),p=dn(Q.BREAKPOINTS.SMALL),[f,v]=i.useState(!1),h=i.useRef(null),m={disabled:o,"data-testid":l,"aria-label":"Menu"},x=c.jsx(en,{...m,ref:h,onPress:()=>v($=>!$),isDisabled:o,className:`proton-ResponsiveMenuTrigger__button ${d}`,children:c.jsx(Vo,{size:n})}),S=t?t({...m,onClick:()=>v($=>!$)},f):x;return i.useEffect(()=>()=>{f&&(s==null||s())},[f,s]),p?c.jsxs(c.Fragment,{children:[S,f&&c.jsx(nt,{id:e,actions:r,isOpen:f,onClose:()=>{v(!1)},showCancel:!0,"data-testid":u})]}):c.jsxs(Co,{children:[S,f&&c.jsx(Pe,{state:{isOpen:f,setOpen:v,open:()=>v(!0),close:()=>v(!1),toggle:()=>v(!f)},triggerRef:h,arrow:!1,children:c.jsx(To,{className:"proton-ListBox proton-ResponsiveMenuTrigger__menu",id:e,autoFocus:!0,"data-testid":u,children:r.map($=>c.jsx(No,{href:$.to,target:"_blank",rel:"noopener noreferrer",onAction:()=>{var C;(C=$.onAction)==null||C.call($,$.key),setTimeout(()=>{v(!1)},200)},className:"proton-ListBox__item proton-ResponsiveMenuTrigger__menu-item",children:$.label},$.key))})})]})}const tt=t=>{let e=i.useRef(null),{state:n}=t,{listBoxProps:r}=y.useListBox(t,n,e);return c.jsx(y.FocusScope,{contain:!0,restoreFocus:!0,autoFocus:!0,children:c.jsx("ul",{...r,ref:e,"data-testid":"listbox",className:"proton-ListBox",children:[...n.collection].map(o=>c.jsx(Ko,{item:o,state:n},o.key))})})};function Ko({item:t,state:e}){let n=i.useRef(null),{optionProps:r,isSelected:o,isFocused:s,isDisabled:l}=y.useOption({key:t.key},e,n);return c.jsx("li",{...r,className:E.csx("proton-ListBox__item",s&&"proton-ListBox__item--focused",o&&"proton-ListBox__item--selected",l&&"proton-ListBox__item--disabled"),ref:n,children:t.rendered})}const fn=i.forwardRef((t,e)=>{let{buttonProps:n}=y.useButton({...t,isDisabled:t.disabled},e);return c.jsx("button",{...n,ref:e,className:E.csx("proton-Select__trigger",t.disabled&&"proton-Select__trigger--disabled",!t.isOpen&&"proton-Select__trigger--closed",t.isOpen&&"proton-Select__trigger--opened"),children:t.children})});function Fo({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:o,onSelectionChange:s,onOpen:l,onClose:u,items:d,"data-testid":p,children:f}){const v={label:t,isDisabled:n,disabledKeys:r,selectedKey:o,items:d,"data-testid":p,children:f,onSelectionChange:s,onOpenChange:M=>{M?l==null||l():u==null||u()}},h=q.useSelectState(v),m=i.useRef(null),x=i.useRef(null),{labelProps:S,triggerProps:$,valueProps:C,menuProps:R}=y.useSelect({...v,label:t||e},h,m);return i.useEffect(()=>{h.isOpen&&x.current&&m.current&&!x.current.style.minWidth&&(x.current.style.minWidth=`${m.current.offsetWidth}px`)}),c.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?c.jsx("div",{...S,className:"proton-Select__label","data-testid":"select-label",children:t}):c.jsx("div",{...S}),c.jsx(y.HiddenSelect,{isDisabled:n,state:h,triggerRef:m,label:t||e,name:e,"data-testid":"hidden-select-container"}),c.jsxs(fn,{...$,isOpen:h.isOpen,ref:m,disabled:n,"data-testid":p,children:[c.jsx("div",{...C,className:"proton-Select__value",children:h.selectedItem?h.selectedItem.rendered:"Select an option"}),c.jsx("div",{className:E.csx("proton-Select__trigger_icon",h.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:c.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[c.jsx("title",{children:h.isOpen?"caret down":"caret up"}),c.jsx("path",{fill:"currentColor",d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})]})})]}),h.isOpen&&c.jsx("div",{className:"proton-Select__popover",children:c.jsx(Pe,{state:h,triggerRef:m,popoverRef:x,placement:"bottom start","data-testid":"select-popover",children:c.jsx(tt,{...R,state:h})})})]})}const Go={Menu:Fo,Option:q.Item};function Yo({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:o,onSelectionChange:s,onOpen:l,onClose:u,items:d,"data-testid":p,children:f}){const v={label:t,isDisabled:n,disabledKeys:r,selectedKey:o,onSelectionChange:s,onOpenChange:P=>{P?l==null||l():u==null||u()},items:d,"data-testid":p,children:f},h=q.useSelectState(v),m=dn(Q.BREAKPOINTS.MEDIUM),x=i.useRef(null),S=i.useRef(null),{labelProps:$,triggerProps:C,valueProps:R,menuProps:M}=y.useSelect({...v,label:t||e},h,x);return i.useEffect(()=>{h.isOpen&&S.current&&x.current&&!S.current.style.minWidth&&(S.current.style.minWidth=`${x.current.offsetWidth}px`)}),c.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?c.jsx("div",{...$,className:"proton-Select__label","data-testid":"select-label",children:t}):c.jsx("div",{...$}),c.jsx(y.HiddenSelect,{isDisabled:n,state:h,triggerRef:x,label:t||e,name:e,"data-testid":"hidden-select-container"}),c.jsxs(fn,{...C,isOpen:h.isOpen,ref:x,disabled:n,"data-testid":p,children:[c.jsx("div",{...R,children:h.selectedItem?h.selectedItem.rendered:"Select an option"}),c.jsx("div",{className:E.csx("proton-Select__trigger_icon",h.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:c.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[c.jsx("title",{children:h.isOpen?"caret down":"caret up"}),c.jsx("path",{fill:"currentColor",d:"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"})]})})]}),h.isOpen&&c.jsx(c.Fragment,{children:m?c.jsx(nt,{isOpen:h.isOpen,onClose:()=>h.close(),children:c.jsx(tt,{...M,state:h})}):c.jsx("div",{className:"proton-Select__popover",children:c.jsx(Pe,{state:h,triggerRef:x,popoverRef:S,placement:"bottom start","data-testid":"select-popover",children:c.jsx(tt,{...M,state:h})})})})]})}const zo={Menu:Yo,Option:q.Item};function Uo(t){let e={...t,isSelected:t.isOn,"data-testid":void 0},n=i.useRef(null),r=q.useToggleState(e),{inputProps:o}=y.useSwitch(e,r,n);return c.jsxs("label",{className:E.csx("proton-Switch",t.isDisabled&&"proton-Switch--disabled",r.isSelected&&"proton-Switch--on"),"data-on":r.isSelected||void 0,"data-disabled":t.isDisabled||void 0,"data-testid":t["data-testid"]||void 0,"aria-label":t.label||void 0,children:[c.jsx(y.VisuallyHidden,{children:c.jsx("input",{...o,ref:n})}),t.label&&c.jsx("div",{className:"proton-Switch__label",children:t.label}),c.jsxs("div",{className:"proton-Switch__wrapper",children:[c.jsx("div",{className:"proton-Switch__toggle",children:c.jsx("div",{className:"proton-Switch__slider"})}),t.children&&c.jsx("div",{className:"proton-Switch__description",children:t.children})]})]})}function qo({item:t,state:e,children:n}){let r=i.useRef(),{rowProps:o}=y.useTableHeaderRow({node:t},e,r);return c.jsx("tr",{className:E.csx("proton-Table__headerRow"),...o,ref:r,children:n})}function Jo({column:t,state:e}){var d,p;let n=i.useRef(),{columnHeaderProps:r}=y.useTableColumnHeader({node:t},e,n);const{align:o="left"}=t.props;let{isFocusVisible:s,focusProps:l}=y.useFocusRing(),u=((d=e.sortDescriptor)==null?void 0:d.direction)==="ascending"?"▲":"▼";return c.jsxs("th",{...y.mergeProps(r,l),colSpan:t.colspan,className:E.csx("proton-Table__header",`proton-Table__header--${o}`,s?"proton-Table__header--focused":null),ref:n,children:[t.rendered,t.props.allowsSorting&&c.jsx("span",{"aria-hidden":"true",className:E.csx("proton-Table__headerSortIcon"),style:{visibility:((p=e.sortDescriptor)==null?void 0:p.column)===t.key?"visible":"hidden"},children:u})]})}function Lt({type:t,children:e}){let{rowGroupProps:n}=y.useTableRowGroup();return c.jsx(t,{...n,className:E.csx("proton-Table__rowGroup",t==="thead"?"proton-Table__rowGroup--header":"proton-Table__rowGroup--body"),children:e})}function Xo({item:t,children:e,state:n}){let r=i.useRef(),o=n.selectionManager.isSelected(t.key),{rowProps:s,isPressed:l}=y.useTableRow({node:t},n,r),{isFocusVisible:u,focusProps:d}=y.useFocusRing();return c.jsx("tr",{className:E.csx("proton-Table__row",o?"proton-Table__row--selected":null,l?"proton-Table__row--pressed":null,u?"proton-Table__row--focused":null),...y.mergeProps(s,d),ref:r,children:e})}function Zo({cell:t,state:e,...n}){let r=i.useRef(),{gridCellProps:o}=y.useTableCell({node:t},e,r),{isFocusVisible:s,focusProps:l}=y.useFocusRing();const{align:u}=t.props;return c.jsx("td",{...y.mergeProps(o,l),className:E.csx("proton-Table__cell",s?"proton-Table__cell--focused":null,`proton-Table__cell--${u}`),ref:r,children:t.rendered})}const Qo=ko,ei=Oo;function ti(t){let e=q.useTableState({...t}),n=i.useRef(),{collection:r}=e,{gridProps:o}=y.useTable({...t,"aria-label":t["aria-label"]||"Table"},e,n);return c.jsxs("table",{...o,ref:n,className:E.csx("proton-Table"),children:[c.jsx(Lt,{type:"thead",children:r.headerRows.map(s=>c.jsx(qo,{item:s,state:e,children:Array.from(r.getChildren(s.key)).map(l=>c.jsx(Jo,{column:l,state:e},l.key))},s.key))}),c.jsx(Lt,{type:"tbody",children:Array.from(r.body.childNodes).map(s=>c.jsx(Xo,{item:s,state:e,children:Array.from(r.getChildren(s.key)).map(l=>c.jsx(Zo,{cell:l,state:e},l.key))},s.key))})]})}function pn({children:t,arrow:e,placement:n="top",...r}){const{className:o,style:s}=te();return console.log(n),c.jsxs(Bo,{...r,placement:n,className:E.csx("proton__Tooltip","proton-Dialog",o),style:s,children:[e&&c.jsx(So,{className:E.csx("proton__TooltipArrow",o),children:c.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",children:c.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})}function hn({children:t,delay:e=500,closeDelay:n=500,isDisabled:r,defaultOpen:o,onOpenChange:s,disableTriggerClick:l,content:u,...d}){const[p,f]=i.useState(!1),v=i.useRef(!1),h=i.useRef(!1);return console.log({tooltipProps:d}),c.jsxs(Lo,{delay:e,closeDelay:n,isDisabled:r,isOpen:p,defaultOpen:o,onOpenChange:m=>{m&&!v.current&&(h.current=!0),s&&s(m),v.current||f(m),v.current=!1},children:[c.jsx(en,{className:"proton__TooltipTrigger","aria-label":"Show tooltip",onPress:()=>{l||h.current||(v.current=!0,f(!p))},children:t}),c.jsx(pn,{...d,children:u})]})}const ni=({to:t,children:e,tooltipProps:n,"data-testid":r})=>{const{className:o,palette:s,theme:l}=te(),u=n?c.jsx(hn,{delay:50,closeDelay:75,...n,children:e}):e,d={"--text-emphasis-highlight":l===Q.THEMES.CUSTOM_DARK?Z.transparentize(s.SECONDARY.SECONDARY_LIGHT,.3):Z.transparentize(k.BRAND.PRIMARY,.5)};if(t){const p=E.isUrlExternal(t);return c.jsx("span",{className:E.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",o),style:d,children:c.jsx("a",{"data-testid":r,href:t,target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,onClick:p?void 0:f=>E.handleInternalNavigation(f,t),children:u})})}return c.jsx("span",{className:E.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",o),style:d,"data-testid":r,children:u})};function ri({amplitude:t,isDisabled:e,isPlayed:n,isHovered:r,isVisible:o,hasAnimated:s,resolution:l,spacing:u,index:d}){const p=o?`${Math.max(t*100,4)}%`:"0%";return c.jsxs("div",{className:E.csx("proton-Waveform__bar-wrapper"),style:{width:`${l}px`,marginRight:`${u}px`},children:[c.jsx("div",{className:E.csx("proton-Waveform__bar","proton-Waveform__bar--upper",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",o&&"proton-Waveform__bar--visible",s&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${p} / 2)`,"--index":d}}),c.jsx("div",{className:E.csx("proton-Waveform__bar","proton-Waveform__bar--lower",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",o&&"proton-Waveform__bar--visible",s&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${p} / 2)`,"--index":d}}),r&&!e&&!n&&c.jsx("div",{className:"proton-Waveform__bar--hover",style:{"--hover-height":p}})]})}const oi=ci(100);function ii({data:t,resolution:e=2,startDuration:n,endDuration:r,currentTime:o=0,showTimestamps:s=!1,totalDuration:l,onClick:u,timestampColor:d,"data-testid":p}){var J;const{className:f,palette:v,theme:h}=te(),m=i.useRef(null),[x,S]=i.useState([]),[$,C]=i.useState(null),[R,M]=i.useState(!1),[P,O]=i.useState(!1),j=t||oi,W=d||(h==="custom-dark"?v.BRAND.PRIMARY:void 0),F=e;i.useEffect(()=>{if(!m.current)return;const L=Y=>{const oe=Math.floor(Y/(e+F)),ae=ai(j,oe);S(ae)},K=m.current.clientWidth;L(K);const G=new ResizeObserver(Y=>{Y&&Y[0]&&L(Y[0].contentRect.width)});return G.observe(m.current),()=>G.disconnect()},[j,e,F]),i.useEffect(()=>{const L=setTimeout(()=>M(!0),50),K=setTimeout(()=>O(!0),500);return()=>{clearTimeout(L),clearTimeout(K)}},[]);const V=L=>{if(!m.current)return;const K=m.current.getBoundingClientRect(),Y=(L.clientX-K.left)/K.width*l;C(Y)},ee=()=>{C(null)},ie=e+F,I=(L,K)=>{var oe;const G=L/l*100;return(K==="start"?Math.floor(G/100*x.length):Math.ceil(G/100*x.length))*ie/((oe=m.current)==null?void 0:oe.clientWidth)*100},B=(J=m.current)==null?void 0:J.clientWidth;return c.jsxs("div",{className:E.csx("proton-Waveform",f),"data-testid":p,children:[s&&c.jsx(Dt,{direction:"left",seconds:o,color:W}),c.jsxs("div",{ref:m,className:"proton-Waveform__container",onMouseMove:V,onMouseLeave:ee,onClick:L=>{if(!m.current)return;const K=m.current.getBoundingClientRect(),Y=(L.clientX-K.left)/K.width*l;u==null||u(Y,L)},children:[n!==void 0&&r!==void 0&&c.jsx("div",{className:"proton-Waveform__active-region",style:{left:m.current?`calc(${I(n,"start")}%`:"0%",right:m.current?`calc(${100-I(r,"end")}% - 2px)`:"0%"}}),$!==null&&c.jsx("div",{className:"proton-Waveform__hover-line",style:{left:`${$/l*100}%`}}),x.map((L,K)=>{const G=K/x.length*l,Y=n!==void 0&&r!==void 0&&(G<n||G>r),oe=o===0?!1:G<=o,ae=$!==null&&G<=$;return c.jsx(ri,{amplitude:L,isDisabled:Y,isPlayed:oe,isHovered:ae,isVisible:R,hasAnimated:P,resolution:e,spacing:F,index:K},K)})]}),!t&&c.jsx("div",{className:"proton-Waveform__bar-unavailable",style:{backgroundColor:W,fontSize:B<325?"0.85rem":"1rem"},children:B<277?"Unavailable":"Waveform Unavailable"}),s&&c.jsx(Dt,{direction:"right",seconds:l,color:W})]})}function Dt({direction:t,color:e,seconds:n}){return c.jsx("div",{className:E.csx("proton-Waveform__timestamp",`proton-Waveform__timestamp--${t}`),style:{backgroundColor:e},children:si(n)})}function si(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?"0":""}${n.toFixed(0)}`}function ai(t,e){const n=t.length,r=n/e,o=new Array(e).fill(0).map((s,l)=>{const u=l*r,d=Math.floor(u),p=Math.min(d+1,n-1),f=u-d;return t[d]*(1-f)+t[p]*f});return li(o)}function li(t){const e=Math.min(...t),n=Math.max(...t);return t.map(r=>{const o=(r-e)/(n-e);return Math.max(o*.8+.1,.1)})}function ci(t){return Array.from({length:t},(e,n)=>{const o=n/(t-1)*6*2*Math.PI-Math.PI/2;return Math.sin(o)*.5+.5})}exports.THEMES=Q.THEMES;exports.COLORS=k.colors;exports.ActionMenu=nt;exports.Badge=Xn;exports.BadgeVariants=Jn;exports.Banner=re;exports.Button=rt;exports.ButtonGroup=Wt;exports.Cell=ei;exports.Column=Qo;exports.Dialog=ir;exports.Icon=lr;exports.Input=Kt;exports.Popover=Pe;exports.ResponsiveMenuTrigger=Wo;exports.ResponsiveSelect=zo;exports.Row=Io;exports.SearchInput=dr;exports.Section=Eo;exports.Select=Go;exports.Switch=Uo;exports.Table=ti;exports.TableBody=Ao;exports.TableHeader=jo;exports.TextEmphasis=ni;exports.ThemeProvider=Un;exports.Tooltip=pn;exports.TooltipTrigger=hn;exports.Waveform=ii;exports.usePopoverTrigger=fr;exports.useTheme=te;
47
47
  //# sourceMappingURL=index.cjs.js.map