@protonradio/proton-ui 0.10.13-beta.5 → 0.10.13-beta.6
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/constants.cjs.js +1 -1
- package/dist/constants.es.js +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +3 -3
- package/dist/index.es.js.map +1 -1
- package/dist/palettes-DUXikaiS.js +2 -0
- package/dist/palettes-DUXikaiS.js.map +1 -0
- package/dist/{palettes-BDp2VnQU.mjs → palettes-z3K7XIpT.mjs} +2 -2
- package/dist/palettes-z3K7XIpT.mjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/{utils-B6kgnxF2.js → utils-C9pal-xj.js} +2 -2
- package/dist/{utils-B6kgnxF2.js.map → utils-C9pal-xj.js.map} +1 -1
- package/dist/{utils-CRsxDkRV.mjs → utils-vY_RWAmK.mjs} +2 -2
- package/dist/{utils-CRsxDkRV.mjs.map → utils-vY_RWAmK.mjs.map} +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +1 -1
- package/package.json +1 -1
- package/dist/palettes-BDp2VnQU.mjs.map +0 -1
- package/dist/palettes-BZQ9UVED.js +0 -2
- package/dist/palettes-BZQ9UVED.js.map +0 -1
package/dist/constants.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./palettes-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./palettes-DUXikaiS.js"),o={DARK:"dark",CUSTOM_DARK:"custom-dark",LIGHT:"light"},e=["bottom","bottom left","bottom right","bottom start","bottom end","top","top left","top right","top start","top end","left","left top","left bottom","start","start top","start bottom","right","right top","right bottom","end","end top","end bottom"],r={SMALL:576,MEDIUM:768,LARGE:992,X_LARGE:1200};exports.COLORS=t.colors;exports.DARK_MODE=t.DARK_MODE;exports.DEFAULT_BLACK_BACKGROUND=t.DEFAULT_BLACK_BACKGROUND;exports.DEFAULT_WHITE_BACKGROUND=t.DEFAULT_WHITE_BACKGROUND;exports.LIGHT_MODE=t.LIGHT_MODE;exports.BREAKPOINTS=r;exports.THEMES=o;exports.placements=e;
|
|
2
2
|
//# sourceMappingURL=constants.cjs.js.map
|
package/dist/constants.es.js
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),Ee=require("./constants.cjs.js"),Se=require("color2k"),W=require("./palettes-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),Ee=require("./constants.cjs.js"),Se=require("color2k"),W=require("./palettes-DUXikaiS.js"),L=require("./utils-C9pal-xj.js"),$t=require("./useBreakpoint-Du8PkzTj.js"),xt=require("react-dom");var Jn={exports:{}},wt={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -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 Gl;function hv(){return Gl||(Gl=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=u,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var w=arguments.length,S=new Array(w>1?w-1:0),A=1;A<w;A++)S[A-1]=arguments[A];r("error",x,S)}}function r(x,w,S){{var A=e.ReactDebugCurrentFrame,I=A.getStackAddendum();I!==""&&(w+="%s",S=S.concat([I]));var h=S.map(function(T){return String(T)});h.unshift("Warning: "+w),Function.prototype.apply.call(console[x],console,h)}}function l(x,w){return x===w&&(x!==0||1/x===1/w)||x!==x&&w!==w}var o=typeof Object.is=="function"?Object.is:l,i=t.useState,s=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,d=!1,f=!1;function p(x,w,S){d||t.startTransition!==void 0&&(d=!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 A=w();if(!f){var I=w();o(A,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var h=i({inst:{value:A,getSnapshot:w}}),T=h[0].inst,C=h[1];return a(function(){T.value=A,T.getSnapshot=w,v(T)&&C({inst:T})},[x,A,w]),s(function(){v(T)&&C({inst:T});var B=function(){v(T)&&C({inst:T})};return x(B)},[x]),c(A),A}function v(x){var w=x.getSnapshot,S=x.value;try{var A=w();return!o(S,A)}catch{return!0}}function m(x,w,S){return w()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$=!y,D=$?m:p,E=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:D;Zn.useSyncExternalStore=E,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Zn}process.env.NODE_ENV==="production"?yr.exports=vv():yr.exports=hv();var bv=yr.exports;const Ku=u.createContext(!1),Ot=u.createContext(null);function mv(t){if(u.useContext(Ot))return t.content;let{collection:n,document:r}=xv(t.createCollection);return u.createElement(u.Fragment,null,u.createElement(fv,null,u.createElement(Ot.Provider,{value:r},t.content)),u.createElement(gv,{render:t.children,collection:n}))}function gv({collection:t,render:e}){return e(t)}function yv(t,e,n){let r=Ze(),l=u.useRef(r);l.current=r;let o=u.useCallback(()=>l.current?n():e(),[e,n]);return bv.useSyncExternalStore(t,o)}const $v=typeof u.useSyncExternalStore=="function"?u.useSyncExternalStore:yv;function xv(t){let[e]=u.useState(()=>new cv((t==null?void 0:t())||new uv)),n=u.useCallback(i=>e.subscribe(i),[e]),r=u.useCallback(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),l=u.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),o=$v(n,r,l);return Y(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:o,document:e}}const $r=u.createContext(null);function Ev(t,e,n,r,l,o){let i=u.useCallback(a=>{a==null||a.setProps(e,n,r,o)},[e,n,r,o]),s=u.useContext($r);if(s){let a=s.ownerDocument.nodesByProps.get(e);return a||(a=s.ownerDocument.createElement(t),a.setProps(e,n,r,o),s.appendChild(a),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,a)),l?u.createElement($r.Provider,{value:a},l):null}return u.createElement(t,{ref:i},l)}function Cv(t,e){let n=({node:l})=>e(l.props,l.props.ref,l),r=u.forwardRef((l,o)=>{if(!u.useContext(Ku)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(l,o)}return Ev(t,l,o,"children"in l?l.children:null,null,s=>u.createElement(n,{node:s}))});return r.displayName=e.name,r}function Sv(t){return Ru({...t,addIdAndValue:!0})}const ql=u.createContext(null);function Pv(t){let e=u.useContext(ql),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),l=Sv({...t,idScope:r,dependencies:n});return u.useContext(Ot)&&(l=u.createElement(Dv,null,l)),e=u.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),u.createElement(ql.Provider,{value:e},l)}function Dv({children:t}){let e=u.useContext(Ot),n=u.useMemo(()=>u.createElement(Ot.Provider,{value:null},u.createElement(Ku.Provider,{value:!0},t)),[t]);return Ze()?u.createElement($r.Provider,{value:e},n):xt.createPortal(n,e)}const wv=u.createContext(null),Av={CollectionRoot({collection:t,renderDropIndicator:e}){return Xl(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return Xl(t,e,n)}};function Xl(t,e,n){return Ru({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){var l;let o=r.render(r);if(!n||r.type!=="item")return o;let i=r.key,s=t.getKeyAfter(i);return u.createElement(u.Fragment,null,n({type:"item",key:i,dropPosition:"before"}),o,(s==null||((l=t.getItem(s))===null||l===void 0?void 0:l.type)!=="item")&&n({type:"item",key:i,dropPosition:"after"}))}})}const Mu=u.createContext(Av);function Tv(t){return u.useMemo(()=>t!=null?new Set([t]):null,[t])}const Zl=Symbol("default");function Tn({values:t,children:e}){for(let[n,r]of t)e=u.createElement(n.Provider,{value:r},e);return e}function St(t){let{className:e,style:n,children:r,defaultClassName:l,defaultChildren:o,defaultStyle:i,values:s}=t;return u.useMemo(()=>{let a,c,d;return typeof e=="function"?a=e({...s,defaultClassName:l}):a=e,typeof n=="function"?c=n({...s,defaultStyle:i||{}}):c=n,typeof r=="function"?d=r({...s,defaultChildren:o}):r==null?d=o:d=r,{className:a??l,style:c||i?{...i,...c}:void 0,children:d??o,"data-rac":""}},[e,n,r,l,o,i,s])}function _u(t,e){let n=u.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(o=>`"${o}"`));if(!e&&!n.slots[Zl])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let l=e||Zl;if(!n.slots[l])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[l]}return n}function Yt(t,e,n){let r=_u(n,t.slot)||{},{ref:l,...o}=r,i=gn(u.useMemo(()=>Bc(e,l),[e,l])),s=z(o,t);return"style"in o&&o.style&&"style"in t&&t.style&&(typeof o.style=="function"||typeof t.style=="function"?s.style=a=>{let c=typeof o.style=="function"?o.style(a):o.style,d={...a.defaultStyle,...c},f=typeof t.style=="function"?t.style({...a,defaultStyle:d}):t.style;return{...d,...f}}:s.style={...o.style,...t.style}),[s,i]}function kv(){let[t,e]=u.useState(!0),n=u.useRef(!1),r=u.useCallback(l=>{n.current=!0,e(!!l)},[]);return Y(()=>{n.current||e(!1)},[]),[r,t]}function Bv(t,e=!0){let[n,r]=u.useState(!0);return Iu(t,n&&e,u.useCallback(()=>r(!1),[])),n&&e}function Rv(t,e){let[n,r]=u.useState(!1),[l,o]=u.useState("idle");return!e&&t.current&&l==="idle"&&(n=!0,r(!0),o("exiting")),!t.current&&l==="exited"&&o("idle"),Iu(t,n,u.useCallback(()=>{o("exited"),r(!1)},[])),n}function Iu(t,e,n){let r=u.useRef(null);e&&t.current&&(r.current=window.getComputedStyle(t.current).animation),Y(()=>{if(e&&t.current){let l=window.getComputedStyle(t.current);if(l.animationName&&l.animationName!=="none"&&l.animation!==r.current){let o=s=>{s.target===t.current&&(i.removeEventListener("animationend",o),xt.flushSync(()=>{n()}))},i=t.current;return i.addEventListener("animationend",o),()=>{i.removeEventListener("animationend",o)}}else n()}},[t,e,n])}const Kv=u.createContext(null),Mv=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),_v=u.createContext({});function Iv(t,e){[t,e]=Yt(t,e,_v),t=Fv(t);let n=t,{isPending:r}=n,{buttonProps:l,isPressed:o}=Wt(t,e),{focusProps:i,isFocused:s,isFocusVisible:a}=Ht(t),{hoverProps:c,isHovered:d}=Et({...t,isDisabled:t.isDisabled||r}),f={isHovered:d,isPressed:(n.isPressed||o)&&!r,isFocused:s,isFocusVisible:a,isDisabled:t.isDisabled||!1,isPending:r??!1},p=St({...t,values:f,defaultClassName:"react-aria-Button"}),v=ce(l.id),m=ce(),y=l["aria-labelledby"];r&&(y?y=`${y} ${m}`:l["aria-label"]&&(y=`${v} ${m}`));let $=u.useRef(r);return u.useEffect(()=>{let D={"aria-labelledby":y||v};(!$.current&&s&&r||$.current&&s&&!r)&&pn(D,"assertive"),$.current=r},[r,s,y,v]),u.createElement("button",{...ie(t,{propNames:Mv}),...z(l,i,c),...p,id:v,ref:e,"aria-labelledby":y,slot:t.slot||void 0,"aria-disabled":r?"true":l["aria-disabled"],"data-disabled":t.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":s||void 0,"data-pending":r||void 0,"data-focus-visible":a||void 0},u.createElement(Kv.Provider,{value:{id:m}},p.children))}function Fv(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 Fu=pv(Iv),Nv=u.createContext({}),Lv=u.createContext({}),Ov=u.createContext({}),Nu=u.createContext({placement:"bottom"});function jv(t,e){[t,e]=Yt(t,e,Nu);let n=t.placement,r={position:"absolute",[n]:"100%",transform:n==="top"||n==="bottom"?"translateX(-50%)":"translateY(-50%)"},l=St({...t,defaultClassName:"react-aria-OverlayArrow",values:{placement:n}});return l.style&&Object.keys(l.style).forEach(o=>l.style[o]===void 0&&delete l.style[o]),u.createElement("div",{...t,...l,style:{...r,...l.style},ref:e,"data-placement":n})}const zv=u.forwardRef(jv),xr=u.createContext(null),Vv=u.createContext(null),Hv=u.createContext({}),Lu=u.createContext(null),Ur=u.createContext(null),Ou=u.createContext(null);function Wv(t){let e=mp(t),n=u.useRef(null),{menuTriggerProps:r,menuProps:l}=ps({...t,type:"menu"},e,n),[o,i]=u.useState(null),s=u.useCallback(()=>{n.current&&i(n.current.offsetWidth+"px")},[n]);er({ref:n,onResize:s});let a=u.useRef(null);return u.createElement(Tn,{values:[[Lu,{...l,ref:a}],[Vv,e],[Ou,e],[xr,{trigger:"MenuTrigger",triggerRef:n,scrollRef:a,placement:"bottom start",style:{"--trigger-width":o}}]]},u.createElement(sd,{...r,ref:n,isPressed:e.isOpen},t.children))}const Uv=u.createContext(null);function Yv(t,e){return[t,e]=Yt(t,e,Lu),u.createElement(mv,{content:u.createElement(Pv,t)},n=>n.size>0&&u.createElement(Gv,{props:t,collection:n,menuRef:e}))}function Gv({props:t,collection:e,menuRef:n}){let r=Su({...t,collection:e,children:void 0}),[l,o]=u.useState(null),{isVirtualized:i,CollectionRoot:s}=u.useContext(Mu),{menuProps:a}=hs({...t,isVirtualized:i},r,n),c=u.useContext(Ou),d=u.useContext(xr),f=(d==null?void 0:d.trigger)==="SubmenuTrigger";$o({ref:n,onInteractOutside:$=>{c&&!(l!=null&&l.contains($.target))&&c.close()},isDisabled:f||(c==null?void 0:c.expandedKeysStack.length)===0});let p=u.useRef(null),[v,m]=u.useState({left:0});u.useEffect(()=>{if(l&&p.current!==l&&v.left===0){p.current=l;let{left:$}=l.getBoundingClientRect();m({left:-1*$})}},[v,l]);let y=St({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return u.createElement(Vt,null,u.createElement("div",{...ie(t),...a,...y,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},u.createElement(Tn,{values:[[Ur,r],[Ov,{elementType:"div"}],[xr,{UNSTABLE_portalContainer:l||void 0}],[wv,{render:Xv}],[Uv,{parentMenuRef:n}],[Er,null]]},u.createElement(s,{collection:e,persistedKeys:Tv(r.selectionManager.focusedKey),scrollRef:n}))),u.createElement("div",{ref:o,style:{width:"100vw",position:"absolute",top:0,...v}}))}const qv=u.forwardRef(Yv);function Xv(t,e,n){var r,l;let o=u.useContext(Ur),{CollectionBranch:i}=u.useContext(Mu),[s,a]=kv();var c;let{headingProps:d,groupProps:f}=Ff({heading:a,"aria-label":(c=n.props["aria-label"])!==null&&c!==void 0?c:void 0}),p=St({defaultClassName:"react-aria-Section",className:(r=n.props)===null||r===void 0?void 0:r.className,style:(l=n.props)===null||l===void 0?void 0:l.style,values:{}});return u.createElement("section",{...ie(t),...f,...p,ref:e},u.createElement(Lv.Provider,{value:{...d,ref:s}},u.createElement(i,{collection:o.collection,parent:n})))}const Er=u.createContext(null),Zv=Cv("item",function(e,n,r){var l;[e,n]=Yt(e,n,Er);let o=(l=_u(Er))===null||l===void 0?void 0:l.id,i=u.useContext(Ur),s=gn(n),{menuItemProps:a,labelProps:c,descriptionProps:d,keyboardShortcutProps:f,...p}=bs({...e,id:o,key:r.key},i,s),{isFocusVisible:v,focusProps:m}=Ht(),{hoverProps:y,isHovered:$}=Et({isDisabled:p.isDisabled}),D=St({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...p,isHovered:$,isFocusVisible:v,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),E=e.href?"a":"div";return u.createElement(E,{...z(a,m,y),...D,ref:s,"data-disabled":p.isDisabled||void 0,"data-hovered":$||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":v||void 0,"data-pressed":p.isPressed||void 0,"data-selected":p.isSelected||void 0,"data-selection-mode":i.selectionManager.selectionMode==="none"?void 0:i.selectionManager.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},u.createElement(Tn,{values:[[Nv,{slots:{label:c,description:d}}],[Hv,f]]},D.children))}),Yr=u.createContext(null),ju=u.createContext(null);function Jv(t){let e=Cu(t),n=u.useRef(null),{triggerProps:r,tooltipProps:l}=pp(t,e,n);return u.createElement(Tn,{values:[[Yr,e],[ju,{...l,triggerRef:n}]]},u.createElement(Bd,{...r,ref:n},t.children))}function Qv({UNSTABLE_portalContainer:t,...e},n){[e,n]=Yt(e,n,ju);let r=u.useContext(Yr),l=Cu(e),o=e.isOpen!=null||e.defaultOpen!=null||!r?l:r,i=Rv(n,o.isOpen)||e.isExiting||!1;return!o.isOpen&&!i?null:u.createElement(yf,{portalContainer:t},u.createElement(th,{...e,tooltipRef:n,isExiting:i}))}const eh=u.forwardRef(Qv);function th(t){let e=u.useContext(Yr),n=u.useRef(null),[r,l]=u.useState(0);Y(()=>{n.current&&e.isOpen&&l(n.current.getBoundingClientRect().width)},[e.isOpen,n]);let{overlayProps:o,arrowProps:i,placement:s}=Io({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}),a=Bv(t.tooltipRef,!!s)||t.isEntering||!1,c=St({...t,defaultClassName:"react-aria-Tooltip",values:{placement:s,isEntering:a,isExiting:t.isExiting,state:e}});t=z(t,o);let{tooltipProps:d}=fp(t,e);return u.createElement("div",{...d,ref:t.tooltipRef,...c,style:{...o.style,...c.style},"data-placement":s,"data-entering":a||void 0,"data-exiting":t.isExiting||void 0},u.createElement(Nu.Provider,{value:{...i,placement:s,ref:n}},c.children))}const nh=({size:t})=>g.jsx("svg",{viewBox:"0 0 24 24",width:t,height:t,children:g.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 rh({renderTrigger:t,menuId:e,size:n=24,actions:r,disabled:l,onClose:o,testId:i,menuTestId:s}){const{className:a}=pe(),c=$t.useBreakpoint(Ee.BREAKPOINTS.SMALL),[d,f]=u.useState(!1),p=u.useRef(null),v={disabled:l,"data-testid":i,"aria-label":"Menu"},m=g.jsx(Fu,{...v,ref:p,onPress:()=>f($=>!$),isDisabled:l,className:`proton-ResponsiveMenuTrigger__button ${a}`,children:g.jsx(nh,{size:n})}),y=t?t({...v,onClick:()=>f($=>!$)},d):m;return u.useEffect(()=>()=>{d&&(o==null||o())},[d,o]),c?g.jsxs(g.Fragment,{children:[y,d&&g.jsx(Vr,{id:e,actions:r,isOpen:d,onClose:()=>{f(!1)},showCancel:!0,"data-testid":s})]}):g.jsxs(Wv,{children:[y,d&&g.jsx(Hr,{state:{isOpen:d,setOpen:f,open:()=>f(!0),close:()=>f(!1),toggle:()=>f(!d)},triggerRef:p,arrow:!1,children:g.jsx(qv,{className:"proton-ListBox proton-ResponsiveMenuTrigger__menu",id:e,autoFocus:!0,"data-testid":s,children:r.map($=>g.jsx(Zv,{href:$.to,target:"_blank",rel:"noopener noreferrer",onAction:()=>{var D;(D=$.onAction)==null||D.call($,$.key),setTimeout(()=>{f(!1)},200)},className:"proton-ListBox__item proton-ResponsiveMenuTrigger__menu-item",children:$.label},$.key))})})]})}const lh=t=>{let e=u.useRef(null),{state:n}=t,{listBoxProps:r}=kf(t,n,e);return g.jsx("ul",{...r,ref:e,"data-testid":"listbox",className:"proton-ListBox",children:[...n.collection].map(l=>g.jsx(oh,{item:l,state:n},l.key))})};function oh({item:t,state:e}){let n=u.useRef(null),{optionProps:r,isSelected:l,isFocused:o,isDisabled:i}=_f({key:t.key},e,n);return g.jsx("li",{...r,className:L.csx("proton-ListBox__item",o&&"proton-ListBox__item--focused",l&&"proton-ListBox__item--selected",i&&"proton-ListBox__item--disabled"),ref:n,children:t.rendered})}const ih=u.forwardRef((t,e)=>{let{buttonProps:n}=Wt({...t,isDisabled:t.disabled},e);return g.jsx("button",{...n,ref:e,className:L.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 sh({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpen:i,onClose:s,items:a,"data-testid":c}){const d={label:t,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpenChange:w=>{w?i==null||i():s==null||s()},"data-testid":c,children:a.map(w=>g.jsx(Ti,{textValue:w.label,children:w.label},w.key))},f=Ep(d),p=$t.useBreakpoint(Ee.BREAKPOINTS.MEDIUM),v=u.useRef(null),m=u.useRef(null),{labelProps:y,triggerProps:$,valueProps:D,menuProps:E}=Xf({...d,label:t||e},f,v);u.useEffect(()=>{f.isOpen&&m.current&&v.current&&!m.current.style.minWidth&&(m.current.style.minWidth=`${v.current.offsetWidth}px`)},[f.isOpen]);const x=a.map(w=>({key:w.key,label:w.label,to:w.to,onAction:S=>{var A;o==null||o(S),(A=w.onAction)==null||A.call(w,S),f.close()}}));return g.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?g.jsx("div",{...y,className:"proton-Select__label","data-testid":"select-label",children:t}):g.jsx("div",{...y}),g.jsx(Jf,{isDisabled:n,state:f,triggerRef:v,label:t||e,name:e,"data-testid":"hidden-select-container"}),g.jsxs(ih,{...$,isOpen:f.isOpen,ref:v,disabled:n,"data-testid":c,children:[g.jsx("div",{...D,className:"proton-Select__value",children:f.selectedItem?f.selectedItem.rendered:"Select an option"}),g.jsx("div",{className:L.csx("proton-Select__trigger_icon",f.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:g.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[g.jsx("title",{children:f.isOpen?"caret down":"caret up"}),g.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"})]})})]}),f.isOpen&&g.jsx(g.Fragment,{children:p?g.jsx(Vr,{isOpen:f.isOpen,onClose:()=>f.close(),actions:x,selectedKeys:l?[l]:void 0}):g.jsx("div",{className:"proton-Select__popover",children:g.jsx(Hr,{state:f,triggerRef:v,popoverRef:m,placement:"bottom start","data-testid":"select-popover",children:g.jsx(lh,{...E,state:f})})})})]})}const ah={Menu:sh};function uh(t){let e={...t,isSelected:t.isOn,"data-testid":void 0},n=u.useRef(null),r=ef(e),{inputProps:l}=Qf(e,r,n);return g.jsxs("label",{className:L.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:[g.jsx(Kr,{children:g.jsx("input",{...l,ref:n})}),t.label&&g.jsx("div",{className:"proton-Switch__label",children:t.label}),g.jsxs("div",{className:"proton-Switch__wrapper",children:[g.jsx("div",{className:"proton-Switch__toggle",children:g.jsx("div",{className:"proton-Switch__slider"})}),t.children&&g.jsx("div",{className:"proton-Switch__description",children:t.children})]})]})}function ch({item:t,state:e,children:n}){let r=u.useRef(),{rowProps:l}=up({node:t},e);return g.jsx("tr",{className:L.csx("proton-Table__headerRow"),...l,ref:r,children:n})}function dh({column:t,state:e}){var a,c;let n=u.useRef(),{columnHeaderProps:r}=sp({node:t},e,n);const{align:l="left"}=t.props;let{isFocusVisible:o,focusProps:i}=Ht(),s=((a=e.sortDescriptor)==null?void 0:a.direction)==="ascending"?"▲":"▼";return g.jsxs("th",{...z(r,i),colSpan:t.colspan,className:L.csx("proton-Table__header",`proton-Table__header--${l}`,o?"proton-Table__header--focused":null),ref:n,children:[t.rendered,t.props.allowsSorting&&g.jsx("span",{"aria-hidden":"true",className:L.csx("proton-Table__headerSortIcon"),style:{visibility:((c=e.sortDescriptor)==null?void 0:c.column)===t.key?"visible":"hidden"},children:s})]})}function Jl({type:t,children:e,isHidden:n=!1}){let{rowGroupProps:r}=dp();return g.jsx(t,{...r,className:L.csx("proton-Table__rowGroup",t==="thead"?"proton-Table__rowGroup--header":"proton-Table__rowGroup--body"),style:n?{display:"none"}:void 0,children:e})}function fh({item:t,children:e,state:n,backgroundColor:r,onClick:l,showLines:o=!0}){let i=u.useRef(),s=n.selectionManager.isSelected(t.key),{rowProps:a,isPressed:c}=ap({node:t},n,i),{isFocusVisible:d,focusProps:f}=Ht();return g.jsx("tr",{className:L.csx("proton-Table__row",s?"proton-Table__row--selected":null,c?"proton-Table__row--pressed":null,d?"proton-Table__row--focused":null,o&&"proton-Table__row--showLines",l&&"proton-Table--clickable"),style:r?{backgroundColor:r}:void 0,...z(a,f),ref:i,onClick:l?()=>l(t.key):void 0,children:e})}function ph({cell:t,state:e,width:n,onClick:r}){let l=u.useRef(),{gridCellProps:o}=cp({node:t},e,l),{isFocusVisible:i,focusProps:s}=Ht();const{align:a="left"}=t.props;return g.jsx("td",{...z(o,s),className:L.csx("proton-Table__cell",i?"proton-Table__cell--focused":null,`proton-Table__cell--${a}`,r&&"proton-Table--clickable"),style:n?{width:n}:void 0,ref:l,onClick:r?()=>r(t.key):void 0,children:t.rendered})}const vh=Bp,hh=Kp,bh=Rp,mh=kp;function gh(t){var o;let e=Ap({...t}),n=u.useRef(),{collection:r}=e,{gridProps:l}=op({...t,"aria-label":t["aria-label"]||"Table"},e,n);return g.jsxs("table",{...l,ref:n,className:L.csx("proton-Table"),children:[g.jsx(Jl,{type:"thead",isHidden:(o=t.headerProps)==null?void 0:o.isHidden,children:r.headerRows.map(i=>g.jsx(ch,{item:i,state:e,children:Array.from(r.getChildren(i.key)).map(s=>g.jsx(dh,{column:s,state:e},s.key))},i.key))}),g.jsx(Jl,{type:"tbody",children:Array.from(r.body.childNodes).map(i=>g.jsx(fh,{item:i,state:e,backgroundColor:i.props.backgroundColor,showLines:r.body.props.showLines,onClick:i.props.onClick,children:Array.from(r.getChildren(i.key)).map(s=>g.jsx(ph,{cell:s,state:e,width:s.props.width,onClick:s.props.onClick},s.key))},i.key))})]})}const yh=({children:t,maxWidth:e,singleLine:n=!0,lines:r=1,title:l,"data-testid":o})=>g.jsx("div",{className:L.csx("proton-TextEllipsis",n||r===1?"proton-TextEllipsis--single-line":r>1?"proton-TextEllipsis--multi-line":""),style:{maxWidth:e,WebkitLineClamp:r},title:l,"data-testid":o,children:t});function zu({children:t,arrow:e,...n}){const{style:r,className:l}=pe();return g.jsxs(eh,{...n,className:L.csx("proton__Tooltip","proton-Dialog",l),style:r,children:[e&&g.jsx(zv,{className:L.csx("proton__TooltipArrow",l),children:g.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",children:g.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})}function Vu({children:t,delay:e=500,closeDelay:n=500,isDisabled:r,defaultOpen:l,onOpenChange:o,disableTriggerClick:i,content:s,...a}){const[c,d]=u.useState(!1),f=u.useRef(!1),p=u.useRef(!1);return s===""?null:g.jsxs(Jv,{delay:e,closeDelay:n,isDisabled:r,isOpen:c,defaultOpen:l,onOpenChange:v=>{v&&!f.current&&(p.current=!0),o&&o(v),f.current||d(v),f.current=!1},children:[i?g.jsx("span",{className:"proton__TooltipTrigger","aria-label":"Show tooltip",children:t}):g.jsx(Fu,{className:"proton__TooltipTrigger","aria-label":"Show tooltip",onPress:()=>{i||r||p.current||(f.current=!0,d(!c))},children:t}),g.jsx(zu,{...a,children:s})]})}const $h=({to:t,children:e,tooltipProps:n,"data-testid":r})=>{const{className:l}=pe(),o=n?g.jsx(Vu,{delay:50,closeDelay:75,...n,children:e}):e;if(t){const i=L.isUrlExternal(t);return g.jsx("span",{className:L.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",l),children:g.jsx("a",{"data-testid":r,href:t,target:i?"_blank":void 0,rel:i?"noopener noreferrer":void 0,onClick:i?void 0:s=>L.handleInternalNavigation(s,t),children:o})})}return g.jsx("span",{className:L.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",l),"data-testid":r,children:o})},xh=({width:t="100%",height:e="1.5rem",borderRadius:n="4px"})=>{const{theme:r,palette:l}=pe(),o={"--tombstone-custom-background":l.PRIMARY.PRIMARY_MEDIUM,"--tombstone-custom-primary":L.transparentize(l.PRIMARY.PRIMARY_DARK,.9),"--tombstone-custom-secondary":L.transparentize(l.SECONDARY.SECONDARY_DARK,.7)};return g.jsx("div",{className:`tombstone ${r}`,style:{...o,width:t,height:e,borderRadius:n}})};function Eh({amplitude:t,isDisabled:e,isPlayed:n,isHovered:r,isVisible:l,hasAnimated:o,resolution:i,spacing:s,index:a}){const c=l?`${Math.max(t*100,4)}%`:"0%";return g.jsxs("div",{className:L.csx("proton-Waveform__bar-wrapper"),style:{width:`${i}px`,marginRight:`${s}px`},children:[g.jsx("div",{className:L.csx("proton-Waveform__bar","proton-Waveform__bar--upper",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",l&&"proton-Waveform__bar--visible",o&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${c} / 2)`,"--index":a}}),g.jsx("div",{className:L.csx("proton-Waveform__bar","proton-Waveform__bar--lower",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",l&&"proton-Waveform__bar--visible",o&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${c} / 2)`,"--index":a}}),r&&!e&&!n&&g.jsx("div",{className:"proton-Waveform__bar--hover",style:{"--hover-height":c}})]})}const Ch=Ah(100);function Sh({data:t,resolution:e=2,startDuration:n,endDuration:r,currentTime:l=0,showTimestamps:o=!1,totalDuration:i,disabled:s,disabledMessage:a,onClick:c,"data-testid":d}){var P;const{className:f}=pe(),p=u.useRef(null),[v,m]=u.useState([]),[y,$]=u.useState(null),[D,E]=u.useState(!1),[x,w]=u.useState(!1),S=t||Ch,A=e;u.useEffect(()=>{if(!p.current)return;const M=K=>{const Z=Math.floor(K/(e+A)),le=Dh(S,Z);m(le)},k=p.current.clientWidth;M(k);const j=new ResizeObserver(K=>{K&&K[0]&&M(K[0].contentRect.width)});return j.observe(p.current),()=>j.disconnect()},[S,e,A]),u.useEffect(()=>{const M=setTimeout(()=>E(!0),50),k=setTimeout(()=>w(!0),500);return()=>{clearTimeout(M),clearTimeout(k)}},[]);const I=M=>{if(!p.current)return;const k=p.current.getBoundingClientRect(),K=(M.clientX-k.left)/k.width*i;$(K)},h=()=>{$(null)},T=e+A,C=(M,k)=>{var Z;const j=M/i*100;return(k==="start"?Math.floor(j/100*v.length):Math.ceil(j/100*v.length))*T/((Z=p.current)==null?void 0:Z.clientWidth)*100},B=(P=p.current)==null?void 0:P.clientWidth,F=u.useMemo(()=>s&&a?a:t?null:"Waveform Unavailable",[s,a,t]);return g.jsxs("div",{className:L.csx("proton-Waveform",f),"data-testid":d,children:[o&&g.jsx(Ql,{direction:"left",seconds:l}),g.jsxs("div",{ref:p,className:"proton-Waveform__container",onMouseMove:I,onMouseLeave:h,onClick:M=>{if(!p.current||s)return;const k=p.current.getBoundingClientRect(),K=(M.clientX-k.left)/k.width*i;c==null||c(K,M)},"data-disabled":s,"data-testid":"waveform-container",children:[n!==void 0&&r!==void 0&&g.jsx("div",{className:"proton-Waveform__active-region",style:{left:p.current?`calc(${C(n,"start")}%`:"0%",right:p.current?`calc(${100-C(r,"end")}% - 2px)`:"0%"}}),y!==null&&g.jsx("div",{className:"proton-Waveform__hover-line",style:{left:`${y/i*100}%`}}),v.map((M,k)=>{const j=k/v.length*i,K=n!==void 0&&r!==void 0&&(j<n||j>r),Z=l===0?!1:j<=l,le=y!==null&&j<=y;return g.jsx(Eh,{amplitude:M,isDisabled:s||K,isPlayed:Z,isHovered:le,isVisible:D,hasAnimated:x,resolution:e,spacing:A,index:k},k)})]}),F&&g.jsx("div",{className:"proton-Waveform__bar-unavailable",style:{fontSize:B<325?"0.85rem":"1rem"},children:F}),o&&g.jsx(Ql,{direction:"right",seconds:i})]})}function Ql({direction:t,seconds:e}){return g.jsx("div",{className:L.csx("proton-Waveform__timestamp",`proton-Waveform__timestamp--${t}`),children:Ph(e)})}function Ph(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?"0":""}${n.toFixed(0)}`}function Dh(t,e){const n=t.length,r=n/e,l=new Array(e).fill(0).map((o,i)=>{const s=i*r,a=Math.floor(s),c=Math.min(a+1,n-1),d=s-a;return t[a]*(1-d)+t[c]*d});return wh(l)}function wh(t){const e=Math.min(...t),n=Math.max(...t);return t.map(r=>{const l=(r-e)/(n-e);return Math.max(l*.8+.1,.1)})}function Ah(t){return Array.from({length:t},(e,n)=>{const l=n/(t-1)*6*2*Math.PI-Math.PI/2;return Math.sin(l)*.5+.5})}const Hu=({children:t})=>g.jsx("h2",{className:"proton-Modal__title",children:t}),Wu=({children:t})=>g.jsx("h3",{className:"proton-Modal__subtitle",children:t}),Uu=({children:t})=>g.jsx("div",{className:"proton-Modal__body",children:t}),Th=t=>g.jsx("div",{className:"proton-Modal__action",children:g.jsx(Pn,{...t})}),kh=({children:t})=>g.jsx(Vt,{autoFocus:!0,children:g.jsx("div",{className:"proton-Modal__actions",children:t})}),Bh=({title:t,subtitle:e,body:n,onClose:r,children:l,isClosing:o,"data-testid":i})=>{const s=u.useRef(null),a=Ut({isOpen:!0,onOpenChange:r}),{modalProps:c}=Pf({isDismissable:!1},a,s),{dialogProps:d}=ms({role:"dialog"},s);Mr();const f=u.useRef(null),{buttonProps:p}=Wt({onPress:r,"aria-label":"Close"},f);return g.jsx(Vt,{contain:!0,restoreFocus:!0,autoFocus:!0,children:g.jsxs("div",{"data-testid":i,className:L.csx("proton-Modal",o&&"proton-Modal--closing"),...z(c,d),ref:s,children:[g.jsx("button",{name:"Close",className:"proton-Modal__close-button",...p,ref:f,children:"×"}),t&&g.jsx(Hu,{children:t}),e&&g.jsx(Wu,{children:e}),n&&g.jsx(Uu,{children:n}),g.jsx("div",{className:"proton-Modal__content",children:l})]})})},Rh=({isOpen:t,onClose:e,title:n,subtitle:r,body:l,children:o,isOverlay:i=!0,"data-testid":s})=>{const a=u.useRef(null),{isClosing:c,handleClose:d}=$t.useIsClosing({onClose:e,overlayRef:a}),f=$t.useBreakpoint(Ee.BREAKPOINTS.MEDIUM);if(!t)return null;const p=g.jsx(Bh,{isOpen:t,title:n,subtitle:r,body:l,onClose:d,isClosing:c,"data-testid":s,children:o});return i||f?g.jsx(Dn,{fadeIn:!0,ref:a,onClose:d,children:p}):p},Kh=Object.assign(Rh,{Title:Hu,Subtitle:Wu,Body:Uu,Action:Th,Actions:kh});exports.ActionMenu=Vr;exports.Badge=Vp;exports.BadgeVariants=zp;exports.Banner=Oe;exports.Button=Pn;exports.ButtonGroup=Tu;exports.Cell=hh;exports.Column=vh;exports.CopyInput=ov;exports.Dialog=Zp;exports.Elevation=sv;exports.Icon=ev;exports.ImageBackground=nv;exports.Input=An;exports.Modal=Kh;exports.Popover=Hr;exports.ResponsiveMenuTrigger=rh;exports.Row=bh;exports.ScreenOverlay=Dn;exports.SearchInput=lv;exports.Section=Rf;exports.Select=ah;exports.Switch=uh;exports.Table=gh;exports.TableBody=mh;exports.TableHeader=Tp;exports.TextEllipsis=yh;exports.TextEmphasis=$h;exports.ThemeProvider=Du;exports.Tombstone=xh;exports.Tooltip=zu;exports.TooltipTrigger=Vu;exports.Waveform=Sh;exports.usePopoverTrigger=av;exports.useTheme=pe;
|
|
46
|
+
*/var Gl;function hv(){return Gl||(Gl=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=u,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var w=arguments.length,S=new Array(w>1?w-1:0),A=1;A<w;A++)S[A-1]=arguments[A];r("error",x,S)}}function r(x,w,S){{var A=e.ReactDebugCurrentFrame,I=A.getStackAddendum();I!==""&&(w+="%s",S=S.concat([I]));var h=S.map(function(T){return String(T)});h.unshift("Warning: "+w),Function.prototype.apply.call(console[x],console,h)}}function l(x,w){return x===w&&(x!==0||1/x===1/w)||x!==x&&w!==w}var o=typeof Object.is=="function"?Object.is:l,i=t.useState,s=t.useEffect,a=t.useLayoutEffect,c=t.useDebugValue,d=!1,f=!1;function p(x,w,S){d||t.startTransition!==void 0&&(d=!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 A=w();if(!f){var I=w();o(A,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var h=i({inst:{value:A,getSnapshot:w}}),T=h[0].inst,C=h[1];return a(function(){T.value=A,T.getSnapshot=w,v(T)&&C({inst:T})},[x,A,w]),s(function(){v(T)&&C({inst:T});var B=function(){v(T)&&C({inst:T})};return x(B)},[x]),c(A),A}function v(x){var w=x.getSnapshot,S=x.value;try{var A=w();return!o(S,A)}catch{return!0}}function m(x,w,S){return w()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$=!y,D=$?m:p,E=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:D;Zn.useSyncExternalStore=E,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Zn}process.env.NODE_ENV==="production"?yr.exports=vv():yr.exports=hv();var bv=yr.exports;const Ku=u.createContext(!1),Ot=u.createContext(null);function mv(t){if(u.useContext(Ot))return t.content;let{collection:n,document:r}=xv(t.createCollection);return u.createElement(u.Fragment,null,u.createElement(fv,null,u.createElement(Ot.Provider,{value:r},t.content)),u.createElement(gv,{render:t.children,collection:n}))}function gv({collection:t,render:e}){return e(t)}function yv(t,e,n){let r=Ze(),l=u.useRef(r);l.current=r;let o=u.useCallback(()=>l.current?n():e(),[e,n]);return bv.useSyncExternalStore(t,o)}const $v=typeof u.useSyncExternalStore=="function"?u.useSyncExternalStore:yv;function xv(t){let[e]=u.useState(()=>new cv((t==null?void 0:t())||new uv)),n=u.useCallback(i=>e.subscribe(i),[e]),r=u.useCallback(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),l=u.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),o=$v(n,r,l);return Y(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:o,document:e}}const $r=u.createContext(null);function Ev(t,e,n,r,l,o){let i=u.useCallback(a=>{a==null||a.setProps(e,n,r,o)},[e,n,r,o]),s=u.useContext($r);if(s){let a=s.ownerDocument.nodesByProps.get(e);return a||(a=s.ownerDocument.createElement(t),a.setProps(e,n,r,o),s.appendChild(a),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,a)),l?u.createElement($r.Provider,{value:a},l):null}return u.createElement(t,{ref:i},l)}function Cv(t,e){let n=({node:l})=>e(l.props,l.props.ref,l),r=u.forwardRef((l,o)=>{if(!u.useContext(Ku)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(l,o)}return Ev(t,l,o,"children"in l?l.children:null,null,s=>u.createElement(n,{node:s}))});return r.displayName=e.name,r}function Sv(t){return Ru({...t,addIdAndValue:!0})}const ql=u.createContext(null);function Pv(t){let e=u.useContext(ql),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),l=Sv({...t,idScope:r,dependencies:n});return u.useContext(Ot)&&(l=u.createElement(Dv,null,l)),e=u.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),u.createElement(ql.Provider,{value:e},l)}function Dv({children:t}){let e=u.useContext(Ot),n=u.useMemo(()=>u.createElement(Ot.Provider,{value:null},u.createElement(Ku.Provider,{value:!0},t)),[t]);return Ze()?u.createElement($r.Provider,{value:e},n):xt.createPortal(n,e)}const wv=u.createContext(null),Av={CollectionRoot({collection:t,renderDropIndicator:e}){return Xl(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return Xl(t,e,n)}};function Xl(t,e,n){return Ru({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){var l;let o=r.render(r);if(!n||r.type!=="item")return o;let i=r.key,s=t.getKeyAfter(i);return u.createElement(u.Fragment,null,n({type:"item",key:i,dropPosition:"before"}),o,(s==null||((l=t.getItem(s))===null||l===void 0?void 0:l.type)!=="item")&&n({type:"item",key:i,dropPosition:"after"}))}})}const Mu=u.createContext(Av);function Tv(t){return u.useMemo(()=>t!=null?new Set([t]):null,[t])}const Zl=Symbol("default");function Tn({values:t,children:e}){for(let[n,r]of t)e=u.createElement(n.Provider,{value:r},e);return e}function St(t){let{className:e,style:n,children:r,defaultClassName:l,defaultChildren:o,defaultStyle:i,values:s}=t;return u.useMemo(()=>{let a,c,d;return typeof e=="function"?a=e({...s,defaultClassName:l}):a=e,typeof n=="function"?c=n({...s,defaultStyle:i||{}}):c=n,typeof r=="function"?d=r({...s,defaultChildren:o}):r==null?d=o:d=r,{className:a??l,style:c||i?{...i,...c}:void 0,children:d??o,"data-rac":""}},[e,n,r,l,o,i,s])}function _u(t,e){let n=u.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(o=>`"${o}"`));if(!e&&!n.slots[Zl])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let l=e||Zl;if(!n.slots[l])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[l]}return n}function Yt(t,e,n){let r=_u(n,t.slot)||{},{ref:l,...o}=r,i=gn(u.useMemo(()=>Bc(e,l),[e,l])),s=z(o,t);return"style"in o&&o.style&&"style"in t&&t.style&&(typeof o.style=="function"||typeof t.style=="function"?s.style=a=>{let c=typeof o.style=="function"?o.style(a):o.style,d={...a.defaultStyle,...c},f=typeof t.style=="function"?t.style({...a,defaultStyle:d}):t.style;return{...d,...f}}:s.style={...o.style,...t.style}),[s,i]}function kv(){let[t,e]=u.useState(!0),n=u.useRef(!1),r=u.useCallback(l=>{n.current=!0,e(!!l)},[]);return Y(()=>{n.current||e(!1)},[]),[r,t]}function Bv(t,e=!0){let[n,r]=u.useState(!0);return Iu(t,n&&e,u.useCallback(()=>r(!1),[])),n&&e}function Rv(t,e){let[n,r]=u.useState(!1),[l,o]=u.useState("idle");return!e&&t.current&&l==="idle"&&(n=!0,r(!0),o("exiting")),!t.current&&l==="exited"&&o("idle"),Iu(t,n,u.useCallback(()=>{o("exited"),r(!1)},[])),n}function Iu(t,e,n){let r=u.useRef(null);e&&t.current&&(r.current=window.getComputedStyle(t.current).animation),Y(()=>{if(e&&t.current){let l=window.getComputedStyle(t.current);if(l.animationName&&l.animationName!=="none"&&l.animation!==r.current){let o=s=>{s.target===t.current&&(i.removeEventListener("animationend",o),xt.flushSync(()=>{n()}))},i=t.current;return i.addEventListener("animationend",o),()=>{i.removeEventListener("animationend",o)}}else n()}},[t,e,n])}const Kv=u.createContext(null),Mv=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),_v=u.createContext({});function Iv(t,e){[t,e]=Yt(t,e,_v),t=Fv(t);let n=t,{isPending:r}=n,{buttonProps:l,isPressed:o}=Wt(t,e),{focusProps:i,isFocused:s,isFocusVisible:a}=Ht(t),{hoverProps:c,isHovered:d}=Et({...t,isDisabled:t.isDisabled||r}),f={isHovered:d,isPressed:(n.isPressed||o)&&!r,isFocused:s,isFocusVisible:a,isDisabled:t.isDisabled||!1,isPending:r??!1},p=St({...t,values:f,defaultClassName:"react-aria-Button"}),v=ce(l.id),m=ce(),y=l["aria-labelledby"];r&&(y?y=`${y} ${m}`:l["aria-label"]&&(y=`${v} ${m}`));let $=u.useRef(r);return u.useEffect(()=>{let D={"aria-labelledby":y||v};(!$.current&&s&&r||$.current&&s&&!r)&&pn(D,"assertive"),$.current=r},[r,s,y,v]),u.createElement("button",{...ie(t,{propNames:Mv}),...z(l,i,c),...p,id:v,ref:e,"aria-labelledby":y,slot:t.slot||void 0,"aria-disabled":r?"true":l["aria-disabled"],"data-disabled":t.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":s||void 0,"data-pending":r||void 0,"data-focus-visible":a||void 0},u.createElement(Kv.Provider,{value:{id:m}},p.children))}function Fv(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 Fu=pv(Iv),Nv=u.createContext({}),Lv=u.createContext({}),Ov=u.createContext({}),Nu=u.createContext({placement:"bottom"});function jv(t,e){[t,e]=Yt(t,e,Nu);let n=t.placement,r={position:"absolute",[n]:"100%",transform:n==="top"||n==="bottom"?"translateX(-50%)":"translateY(-50%)"},l=St({...t,defaultClassName:"react-aria-OverlayArrow",values:{placement:n}});return l.style&&Object.keys(l.style).forEach(o=>l.style[o]===void 0&&delete l.style[o]),u.createElement("div",{...t,...l,style:{...r,...l.style},ref:e,"data-placement":n})}const zv=u.forwardRef(jv),xr=u.createContext(null),Vv=u.createContext(null),Hv=u.createContext({}),Lu=u.createContext(null),Ur=u.createContext(null),Ou=u.createContext(null);function Wv(t){let e=mp(t),n=u.useRef(null),{menuTriggerProps:r,menuProps:l}=ps({...t,type:"menu"},e,n),[o,i]=u.useState(null),s=u.useCallback(()=>{n.current&&i(n.current.offsetWidth+"px")},[n]);er({ref:n,onResize:s});let a=u.useRef(null);return u.createElement(Tn,{values:[[Lu,{...l,ref:a}],[Vv,e],[Ou,e],[xr,{trigger:"MenuTrigger",triggerRef:n,scrollRef:a,placement:"bottom start",style:{"--trigger-width":o}}]]},u.createElement(sd,{...r,ref:n,isPressed:e.isOpen},t.children))}const Uv=u.createContext(null);function Yv(t,e){return[t,e]=Yt(t,e,Lu),u.createElement(mv,{content:u.createElement(Pv,t)},n=>n.size>0&&u.createElement(Gv,{props:t,collection:n,menuRef:e}))}function Gv({props:t,collection:e,menuRef:n}){let r=Su({...t,collection:e,children:void 0}),[l,o]=u.useState(null),{isVirtualized:i,CollectionRoot:s}=u.useContext(Mu),{menuProps:a}=hs({...t,isVirtualized:i},r,n),c=u.useContext(Ou),d=u.useContext(xr),f=(d==null?void 0:d.trigger)==="SubmenuTrigger";$o({ref:n,onInteractOutside:$=>{c&&!(l!=null&&l.contains($.target))&&c.close()},isDisabled:f||(c==null?void 0:c.expandedKeysStack.length)===0});let p=u.useRef(null),[v,m]=u.useState({left:0});u.useEffect(()=>{if(l&&p.current!==l&&v.left===0){p.current=l;let{left:$}=l.getBoundingClientRect();m({left:-1*$})}},[v,l]);let y=St({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return u.createElement(Vt,null,u.createElement("div",{...ie(t),...a,...y,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},u.createElement(Tn,{values:[[Ur,r],[Ov,{elementType:"div"}],[xr,{UNSTABLE_portalContainer:l||void 0}],[wv,{render:Xv}],[Uv,{parentMenuRef:n}],[Er,null]]},u.createElement(s,{collection:e,persistedKeys:Tv(r.selectionManager.focusedKey),scrollRef:n}))),u.createElement("div",{ref:o,style:{width:"100vw",position:"absolute",top:0,...v}}))}const qv=u.forwardRef(Yv);function Xv(t,e,n){var r,l;let o=u.useContext(Ur),{CollectionBranch:i}=u.useContext(Mu),[s,a]=kv();var c;let{headingProps:d,groupProps:f}=Ff({heading:a,"aria-label":(c=n.props["aria-label"])!==null&&c!==void 0?c:void 0}),p=St({defaultClassName:"react-aria-Section",className:(r=n.props)===null||r===void 0?void 0:r.className,style:(l=n.props)===null||l===void 0?void 0:l.style,values:{}});return u.createElement("section",{...ie(t),...f,...p,ref:e},u.createElement(Lv.Provider,{value:{...d,ref:s}},u.createElement(i,{collection:o.collection,parent:n})))}const Er=u.createContext(null),Zv=Cv("item",function(e,n,r){var l;[e,n]=Yt(e,n,Er);let o=(l=_u(Er))===null||l===void 0?void 0:l.id,i=u.useContext(Ur),s=gn(n),{menuItemProps:a,labelProps:c,descriptionProps:d,keyboardShortcutProps:f,...p}=bs({...e,id:o,key:r.key},i,s),{isFocusVisible:v,focusProps:m}=Ht(),{hoverProps:y,isHovered:$}=Et({isDisabled:p.isDisabled}),D=St({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...p,isHovered:$,isFocusVisible:v,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),E=e.href?"a":"div";return u.createElement(E,{...z(a,m,y),...D,ref:s,"data-disabled":p.isDisabled||void 0,"data-hovered":$||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":v||void 0,"data-pressed":p.isPressed||void 0,"data-selected":p.isSelected||void 0,"data-selection-mode":i.selectionManager.selectionMode==="none"?void 0:i.selectionManager.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},u.createElement(Tn,{values:[[Nv,{slots:{label:c,description:d}}],[Hv,f]]},D.children))}),Yr=u.createContext(null),ju=u.createContext(null);function Jv(t){let e=Cu(t),n=u.useRef(null),{triggerProps:r,tooltipProps:l}=pp(t,e,n);return u.createElement(Tn,{values:[[Yr,e],[ju,{...l,triggerRef:n}]]},u.createElement(Bd,{...r,ref:n},t.children))}function Qv({UNSTABLE_portalContainer:t,...e},n){[e,n]=Yt(e,n,ju);let r=u.useContext(Yr),l=Cu(e),o=e.isOpen!=null||e.defaultOpen!=null||!r?l:r,i=Rv(n,o.isOpen)||e.isExiting||!1;return!o.isOpen&&!i?null:u.createElement(yf,{portalContainer:t},u.createElement(th,{...e,tooltipRef:n,isExiting:i}))}const eh=u.forwardRef(Qv);function th(t){let e=u.useContext(Yr),n=u.useRef(null),[r,l]=u.useState(0);Y(()=>{n.current&&e.isOpen&&l(n.current.getBoundingClientRect().width)},[e.isOpen,n]);let{overlayProps:o,arrowProps:i,placement:s}=Io({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}),a=Bv(t.tooltipRef,!!s)||t.isEntering||!1,c=St({...t,defaultClassName:"react-aria-Tooltip",values:{placement:s,isEntering:a,isExiting:t.isExiting,state:e}});t=z(t,o);let{tooltipProps:d}=fp(t,e);return u.createElement("div",{...d,ref:t.tooltipRef,...c,style:{...o.style,...c.style},"data-placement":s,"data-entering":a||void 0,"data-exiting":t.isExiting||void 0},u.createElement(Nu.Provider,{value:{...i,placement:s,ref:n}},c.children))}const nh=({size:t})=>g.jsx("svg",{viewBox:"0 0 24 24",width:t,height:t,children:g.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 rh({renderTrigger:t,menuId:e,size:n=24,actions:r,disabled:l,onClose:o,testId:i,menuTestId:s}){const{className:a}=pe(),c=$t.useBreakpoint(Ee.BREAKPOINTS.SMALL),[d,f]=u.useState(!1),p=u.useRef(null),v={disabled:l,"data-testid":i,"aria-label":"Menu"},m=g.jsx(Fu,{...v,ref:p,onPress:()=>f($=>!$),isDisabled:l,className:`proton-ResponsiveMenuTrigger__button ${a}`,children:g.jsx(nh,{size:n})}),y=t?t({...v,onClick:()=>f($=>!$)},d):m;return u.useEffect(()=>()=>{d&&(o==null||o())},[d,o]),c?g.jsxs(g.Fragment,{children:[y,d&&g.jsx(Vr,{id:e,actions:r,isOpen:d,onClose:()=>{f(!1)},showCancel:!0,"data-testid":s})]}):g.jsxs(Wv,{children:[y,d&&g.jsx(Hr,{state:{isOpen:d,setOpen:f,open:()=>f(!0),close:()=>f(!1),toggle:()=>f(!d)},triggerRef:p,arrow:!1,children:g.jsx(qv,{className:"proton-ListBox proton-ResponsiveMenuTrigger__menu",id:e,autoFocus:!0,"data-testid":s,children:r.map($=>g.jsx(Zv,{href:$.to,target:"_blank",rel:"noopener noreferrer",onAction:()=>{var D;(D=$.onAction)==null||D.call($,$.key),setTimeout(()=>{f(!1)},200)},className:"proton-ListBox__item proton-ResponsiveMenuTrigger__menu-item",children:$.label},$.key))})})]})}const lh=t=>{let e=u.useRef(null),{state:n}=t,{listBoxProps:r}=kf(t,n,e);return g.jsx("ul",{...r,ref:e,"data-testid":"listbox",className:"proton-ListBox",children:[...n.collection].map(l=>g.jsx(oh,{item:l,state:n},l.key))})};function oh({item:t,state:e}){let n=u.useRef(null),{optionProps:r,isSelected:l,isFocused:o,isDisabled:i}=_f({key:t.key},e,n);return g.jsx("li",{...r,className:L.csx("proton-ListBox__item",o&&"proton-ListBox__item--focused",l&&"proton-ListBox__item--selected",i&&"proton-ListBox__item--disabled"),ref:n,children:t.rendered})}const ih=u.forwardRef((t,e)=>{let{buttonProps:n}=Wt({...t,isDisabled:t.disabled},e);return g.jsx("button",{...n,ref:e,className:L.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 sh({label:t,name:e,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpen:i,onClose:s,items:a,"data-testid":c}){const d={label:t,isDisabled:n,disabledKeys:r,selectedKey:l,onSelectionChange:o,onOpenChange:w=>{w?i==null||i():s==null||s()},"data-testid":c,children:a.map(w=>g.jsx(Ti,{textValue:w.label,children:w.label},w.key))},f=Ep(d),p=$t.useBreakpoint(Ee.BREAKPOINTS.MEDIUM),v=u.useRef(null),m=u.useRef(null),{labelProps:y,triggerProps:$,valueProps:D,menuProps:E}=Xf({...d,label:t||e},f,v);u.useEffect(()=>{f.isOpen&&m.current&&v.current&&!m.current.style.minWidth&&(m.current.style.minWidth=`${v.current.offsetWidth}px`)},[f.isOpen]);const x=a.map(w=>({key:w.key,label:w.label,to:w.to,onAction:S=>{var A;o==null||o(S),(A=w.onAction)==null||A.call(w,S),f.close()}}));return g.jsxs("div",{className:"proton-Select","aria-label":t||e,"aria-disabled":n,children:[t?g.jsx("div",{...y,className:"proton-Select__label","data-testid":"select-label",children:t}):g.jsx("div",{...y}),g.jsx(Jf,{isDisabled:n,state:f,triggerRef:v,label:t||e,name:e,"data-testid":"hidden-select-container"}),g.jsxs(ih,{...$,isOpen:f.isOpen,ref:v,disabled:n,"data-testid":c,children:[g.jsx("div",{...D,className:"proton-Select__value",children:f.selectedItem?f.selectedItem.rendered:"Select an option"}),g.jsx("div",{className:L.csx("proton-Select__trigger_icon",f.isOpen&&"proton-Select__trigger_icon--flipped"),"aria-hidden":"true",children:g.jsxs("svg",{id:"caret-down",viewBox:"0 0 512 512",children:[g.jsx("title",{children:f.isOpen?"caret down":"caret up"}),g.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"})]})})]}),f.isOpen&&g.jsx(g.Fragment,{children:p?g.jsx(Vr,{isOpen:f.isOpen,onClose:()=>f.close(),actions:x,selectedKeys:l?[l]:void 0}):g.jsx("div",{className:"proton-Select__popover",children:g.jsx(Hr,{state:f,triggerRef:v,popoverRef:m,placement:"bottom start","data-testid":"select-popover",children:g.jsx(lh,{...E,state:f})})})})]})}const ah={Menu:sh};function uh(t){let e={...t,isSelected:t.isOn,"data-testid":void 0},n=u.useRef(null),r=ef(e),{inputProps:l}=Qf(e,r,n);return g.jsxs("label",{className:L.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:[g.jsx(Kr,{children:g.jsx("input",{...l,ref:n})}),t.label&&g.jsx("div",{className:"proton-Switch__label",children:t.label}),g.jsxs("div",{className:"proton-Switch__wrapper",children:[g.jsx("div",{className:"proton-Switch__toggle",children:g.jsx("div",{className:"proton-Switch__slider"})}),t.children&&g.jsx("div",{className:"proton-Switch__description",children:t.children})]})]})}function ch({item:t,state:e,children:n}){let r=u.useRef(),{rowProps:l}=up({node:t},e);return g.jsx("tr",{className:L.csx("proton-Table__headerRow"),...l,ref:r,children:n})}function dh({column:t,state:e}){var a,c;let n=u.useRef(),{columnHeaderProps:r}=sp({node:t},e,n);const{align:l="left"}=t.props;let{isFocusVisible:o,focusProps:i}=Ht(),s=((a=e.sortDescriptor)==null?void 0:a.direction)==="ascending"?"▲":"▼";return g.jsxs("th",{...z(r,i),colSpan:t.colspan,className:L.csx("proton-Table__header",`proton-Table__header--${l}`,o?"proton-Table__header--focused":null),ref:n,children:[t.rendered,t.props.allowsSorting&&g.jsx("span",{"aria-hidden":"true",className:L.csx("proton-Table__headerSortIcon"),style:{visibility:((c=e.sortDescriptor)==null?void 0:c.column)===t.key?"visible":"hidden"},children:s})]})}function Jl({type:t,children:e,isHidden:n=!1}){let{rowGroupProps:r}=dp();return g.jsx(t,{...r,className:L.csx("proton-Table__rowGroup",t==="thead"?"proton-Table__rowGroup--header":"proton-Table__rowGroup--body"),style:n?{display:"none"}:void 0,children:e})}function fh({item:t,children:e,state:n,backgroundColor:r,onClick:l,showLines:o=!0}){let i=u.useRef(),s=n.selectionManager.isSelected(t.key),{rowProps:a,isPressed:c}=ap({node:t},n,i),{isFocusVisible:d,focusProps:f}=Ht();return g.jsx("tr",{className:L.csx("proton-Table__row",s?"proton-Table__row--selected":null,c?"proton-Table__row--pressed":null,d?"proton-Table__row--focused":null,o&&"proton-Table__row--showLines",l&&"proton-Table--clickable"),style:r?{backgroundColor:r}:void 0,...z(a,f),ref:i,onClick:l?()=>l(t.key):void 0,children:e})}function ph({cell:t,state:e,width:n,onClick:r}){let l=u.useRef(),{gridCellProps:o}=cp({node:t},e,l),{isFocusVisible:i,focusProps:s}=Ht();const{align:a="left"}=t.props;return g.jsx("td",{...z(o,s),className:L.csx("proton-Table__cell",i?"proton-Table__cell--focused":null,`proton-Table__cell--${a}`,r&&"proton-Table--clickable"),style:n?{width:n}:void 0,ref:l,onClick:r?()=>r(t.key):void 0,children:t.rendered})}const vh=Bp,hh=Kp,bh=Rp,mh=kp;function gh(t){var o;let e=Ap({...t}),n=u.useRef(),{collection:r}=e,{gridProps:l}=op({...t,"aria-label":t["aria-label"]||"Table"},e,n);return g.jsxs("table",{...l,ref:n,className:L.csx("proton-Table"),children:[g.jsx(Jl,{type:"thead",isHidden:(o=t.headerProps)==null?void 0:o.isHidden,children:r.headerRows.map(i=>g.jsx(ch,{item:i,state:e,children:Array.from(r.getChildren(i.key)).map(s=>g.jsx(dh,{column:s,state:e},s.key))},i.key))}),g.jsx(Jl,{type:"tbody",children:Array.from(r.body.childNodes).map(i=>g.jsx(fh,{item:i,state:e,backgroundColor:i.props.backgroundColor,showLines:r.body.props.showLines,onClick:i.props.onClick,children:Array.from(r.getChildren(i.key)).map(s=>g.jsx(ph,{cell:s,state:e,width:s.props.width,onClick:s.props.onClick},s.key))},i.key))})]})}const yh=({children:t,maxWidth:e,singleLine:n=!0,lines:r=1,title:l,"data-testid":o})=>g.jsx("div",{className:L.csx("proton-TextEllipsis",n||r===1?"proton-TextEllipsis--single-line":r>1?"proton-TextEllipsis--multi-line":""),style:{maxWidth:e,WebkitLineClamp:r},title:l,"data-testid":o,children:t});function zu({children:t,arrow:e,...n}){const{style:r,className:l}=pe();return g.jsxs(eh,{...n,className:L.csx("proton__Tooltip","proton-Dialog",l),style:r,children:[e&&g.jsx(zv,{className:L.csx("proton__TooltipArrow",l),children:g.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",children:g.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})}function Vu({children:t,delay:e=500,closeDelay:n=500,isDisabled:r,defaultOpen:l,onOpenChange:o,disableTriggerClick:i,content:s,...a}){const[c,d]=u.useState(!1),f=u.useRef(!1),p=u.useRef(!1);return s===""?null:g.jsxs(Jv,{delay:e,closeDelay:n,isDisabled:r,isOpen:c,defaultOpen:l,onOpenChange:v=>{v&&!f.current&&(p.current=!0),o&&o(v),f.current||d(v),f.current=!1},children:[i?g.jsx("span",{className:"proton__TooltipTrigger","aria-label":"Show tooltip",children:t}):g.jsx(Fu,{className:"proton__TooltipTrigger","aria-label":"Show tooltip",onPress:()=>{i||r||p.current||(f.current=!0,d(!c))},children:t}),g.jsx(zu,{...a,children:s})]})}const $h=({to:t,children:e,tooltipProps:n,"data-testid":r})=>{const{className:l}=pe(),o=n?g.jsx(Vu,{delay:50,closeDelay:75,...n,children:e}):e;if(t){const i=L.isUrlExternal(t);return g.jsx("span",{className:L.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",l),children:g.jsx("a",{"data-testid":r,href:t,target:i?"_blank":void 0,rel:i?"noopener noreferrer":void 0,onClick:i?void 0:s=>L.handleInternalNavigation(s,t),children:o})})}return g.jsx("span",{className:L.csx("proton-TextEmphasis",n&&"proton-TextEmphasis--tooltip",l),"data-testid":r,children:o})},xh=({width:t="100%",height:e="1.5rem",borderRadius:n="4px"})=>{const{theme:r,palette:l}=pe(),o={"--tombstone-custom-background":l.PRIMARY.PRIMARY_MEDIUM,"--tombstone-custom-primary":L.transparentize(l.PRIMARY.PRIMARY_DARK,.9),"--tombstone-custom-secondary":L.transparentize(l.SECONDARY.SECONDARY_DARK,.7)};return g.jsx("div",{className:`tombstone ${r}`,style:{...o,width:t,height:e,borderRadius:n}})};function Eh({amplitude:t,isDisabled:e,isPlayed:n,isHovered:r,isVisible:l,hasAnimated:o,resolution:i,spacing:s,index:a}){const c=l?`${Math.max(t*100,4)}%`:"0%";return g.jsxs("div",{className:L.csx("proton-Waveform__bar-wrapper"),style:{width:`${i}px`,marginRight:`${s}px`},children:[g.jsx("div",{className:L.csx("proton-Waveform__bar","proton-Waveform__bar--upper",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",l&&"proton-Waveform__bar--visible",o&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${c} / 2)`,"--index":a}}),g.jsx("div",{className:L.csx("proton-Waveform__bar","proton-Waveform__bar--lower",e&&"proton-Waveform__bar--disabled",n&&"proton-Waveform__bar--played",l&&"proton-Waveform__bar--visible",o&&"proton-Waveform__bar--animated"),style:{"--target-height":`calc(${c} / 2)`,"--index":a}}),r&&!e&&!n&&g.jsx("div",{className:"proton-Waveform__bar--hover",style:{"--hover-height":c}})]})}const Ch=Ah(100);function Sh({data:t,resolution:e=2,startDuration:n,endDuration:r,currentTime:l=0,showTimestamps:o=!1,totalDuration:i,disabled:s,disabledMessage:a,onClick:c,"data-testid":d}){var P;const{className:f}=pe(),p=u.useRef(null),[v,m]=u.useState([]),[y,$]=u.useState(null),[D,E]=u.useState(!1),[x,w]=u.useState(!1),S=t||Ch,A=e;u.useEffect(()=>{if(!p.current)return;const M=K=>{const Z=Math.floor(K/(e+A)),le=Dh(S,Z);m(le)},k=p.current.clientWidth;M(k);const j=new ResizeObserver(K=>{K&&K[0]&&M(K[0].contentRect.width)});return j.observe(p.current),()=>j.disconnect()},[S,e,A]),u.useEffect(()=>{const M=setTimeout(()=>E(!0),50),k=setTimeout(()=>w(!0),500);return()=>{clearTimeout(M),clearTimeout(k)}},[]);const I=M=>{if(!p.current)return;const k=p.current.getBoundingClientRect(),K=(M.clientX-k.left)/k.width*i;$(K)},h=()=>{$(null)},T=e+A,C=(M,k)=>{var Z;const j=M/i*100;return(k==="start"?Math.floor(j/100*v.length):Math.ceil(j/100*v.length))*T/((Z=p.current)==null?void 0:Z.clientWidth)*100},B=(P=p.current)==null?void 0:P.clientWidth,F=u.useMemo(()=>s&&a?a:t?null:"Waveform Unavailable",[s,a,t]);return g.jsxs("div",{className:L.csx("proton-Waveform",f),"data-testid":d,children:[o&&g.jsx(Ql,{direction:"left",seconds:l}),g.jsxs("div",{ref:p,className:"proton-Waveform__container",onMouseMove:I,onMouseLeave:h,onClick:M=>{if(!p.current||s)return;const k=p.current.getBoundingClientRect(),K=(M.clientX-k.left)/k.width*i;c==null||c(K,M)},"data-disabled":s,"data-testid":"waveform-container",children:[n!==void 0&&r!==void 0&&g.jsx("div",{className:"proton-Waveform__active-region",style:{left:p.current?`calc(${C(n,"start")}%`:"0%",right:p.current?`calc(${100-C(r,"end")}% - 2px)`:"0%"}}),y!==null&&g.jsx("div",{className:"proton-Waveform__hover-line",style:{left:`${y/i*100}%`}}),v.map((M,k)=>{const j=k/v.length*i,K=n!==void 0&&r!==void 0&&(j<n||j>r),Z=l===0?!1:j<=l,le=y!==null&&j<=y;return g.jsx(Eh,{amplitude:M,isDisabled:s||K,isPlayed:Z,isHovered:le,isVisible:D,hasAnimated:x,resolution:e,spacing:A,index:k},k)})]}),F&&g.jsx("div",{className:"proton-Waveform__bar-unavailable",style:{fontSize:B<325?"0.85rem":"1rem"},children:F}),o&&g.jsx(Ql,{direction:"right",seconds:i})]})}function Ql({direction:t,seconds:e}){return g.jsx("div",{className:L.csx("proton-Waveform__timestamp",`proton-Waveform__timestamp--${t}`),children:Ph(e)})}function Ph(t){const e=Math.floor(t/60),n=Math.floor(t%60);return`${e}:${n<10?"0":""}${n.toFixed(0)}`}function Dh(t,e){const n=t.length,r=n/e,l=new Array(e).fill(0).map((o,i)=>{const s=i*r,a=Math.floor(s),c=Math.min(a+1,n-1),d=s-a;return t[a]*(1-d)+t[c]*d});return wh(l)}function wh(t){const e=Math.min(...t),n=Math.max(...t);return t.map(r=>{const l=(r-e)/(n-e);return Math.max(l*.8+.1,.1)})}function Ah(t){return Array.from({length:t},(e,n)=>{const l=n/(t-1)*6*2*Math.PI-Math.PI/2;return Math.sin(l)*.5+.5})}const Hu=({children:t})=>g.jsx("h2",{className:"proton-Modal__title",children:t}),Wu=({children:t})=>g.jsx("h3",{className:"proton-Modal__subtitle",children:t}),Uu=({children:t})=>g.jsx("div",{className:"proton-Modal__body",children:t}),Th=t=>g.jsx("div",{className:"proton-Modal__action",children:g.jsx(Pn,{...t})}),kh=({children:t})=>g.jsx(Vt,{autoFocus:!0,children:g.jsx("div",{className:"proton-Modal__actions",children:t})}),Bh=({title:t,subtitle:e,body:n,onClose:r,children:l,isClosing:o,"data-testid":i})=>{const s=u.useRef(null),a=Ut({isOpen:!0,onOpenChange:r}),{modalProps:c}=Pf({isDismissable:!1},a,s),{dialogProps:d}=ms({role:"dialog"},s);Mr();const f=u.useRef(null),{buttonProps:p}=Wt({onPress:r,"aria-label":"Close"},f);return g.jsx(Vt,{contain:!0,restoreFocus:!0,autoFocus:!0,children:g.jsxs("div",{"data-testid":i,className:L.csx("proton-Modal",o&&"proton-Modal--closing"),...z(c,d),ref:s,children:[g.jsx("button",{name:"Close",className:"proton-Modal__close-button",...p,ref:f,children:"×"}),t&&g.jsx(Hu,{children:t}),e&&g.jsx(Wu,{children:e}),n&&g.jsx(Uu,{children:n}),g.jsx("div",{className:"proton-Modal__content",children:l})]})})},Rh=({isOpen:t,onClose:e,title:n,subtitle:r,body:l,children:o,isOverlay:i=!0,"data-testid":s})=>{const a=u.useRef(null),{isClosing:c,handleClose:d}=$t.useIsClosing({onClose:e,overlayRef:a}),f=$t.useBreakpoint(Ee.BREAKPOINTS.MEDIUM);if(!t)return null;const p=g.jsx(Bh,{isOpen:t,title:n,subtitle:r,body:l,onClose:d,isClosing:c,"data-testid":s,children:o});return i||f?g.jsx(Dn,{fadeIn:!0,ref:a,onClose:d,children:p}):p},Kh=Object.assign(Rh,{Title:Hu,Subtitle:Wu,Body:Uu,Action:Th,Actions:kh});exports.ActionMenu=Vr;exports.Badge=Vp;exports.BadgeVariants=zp;exports.Banner=Oe;exports.Button=Pn;exports.ButtonGroup=Tu;exports.Cell=hh;exports.Column=vh;exports.CopyInput=ov;exports.Dialog=Zp;exports.Elevation=sv;exports.Icon=ev;exports.ImageBackground=nv;exports.Input=An;exports.MenuTrigger=rh;exports.Modal=Kh;exports.Popover=Hr;exports.Row=bh;exports.ScreenOverlay=Dn;exports.SearchInput=lv;exports.Section=Rf;exports.Select=ah;exports.Switch=uh;exports.Table=gh;exports.TableBody=mh;exports.TableHeader=Tp;exports.TextEllipsis=yh;exports.TextEmphasis=$h;exports.ThemeProvider=Du;exports.Tombstone=xh;exports.Tooltip=zu;exports.TooltipTrigger=Vu;exports.Waveform=Sh;exports.usePopoverTrigger=av;exports.useTheme=pe;
|
|
47
47
|
//# sourceMappingURL=index.cjs.js.map
|