@interopio/home-ui-react 4.6.0-next.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +2 -2
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3818 -3775
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Gb=Object.defineProperty;var qb=(e,t,n)=>t in e?Gb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var jn=(e,t,n)=>(qb(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),v=require("react"),Mo=require("react-dom"),Te=require("@interopio/react-hooks"),As=require("@interopio/workspaces-ui-react");function Dm(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const J=Dm(v),Mm=Dm(Mo);function Ea(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tl,$m={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/Xc=Rm,function(){var e={}.hasOwnProperty;function t(){for(var r="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(r=o(r,n(a)))}return r}function n(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var a in r)e.call(r,a)&&r[a]&&(i=o(i,a));return i}function o(r,i){return i?r?r+" "+i:r+i:r}Xc.exports?(t.default=t,Xc.exports=t):window.classNames=t}();var Q=Ea(Rm.exports);function jt({className:e,size:t="16",variant:n="workspace",...o}){const r=Q("icon",t&&[`icon-size-${t}`],e);return l.jsx("span",{className:r,"aria-label":`icon-${n}`,role:"presentation",...o,children:l.jsx("i",{className:`icon-${n}`})})}const Ue=v.forwardRef(({className:e,variant:t="default",icon:n="workspace",size:o="16",tooltip:r,iconSize:i="16",onClick:a,disabled:s,children:c,...u},d)=>{const f=Q("io-btn-icon",t!=="default"&&[`io-btn-icon-${t}`],[`io-btn-icon-size-${o}`],e),p=v.useCallback(h=>{if(!s)return a?a(h):void 0;h.preventDefault()},[a,s]);return l.jsx("button",{className:f,type:"button",ref:d,"aria-label":"icon button","aria-disabled":s,title:r,onClick:p,disabled:s,...u,children:c??(n&&l.jsx(jt,{variant:n,size:i}))})});Ue.displayName="ButtonIcon";const Kb={default:void 0,info:"info",success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function Gb({className:e,variant:t="default",size:n="normal",text:o,close:r=!1,closeButtonOnClick:i,append:a,...s}){const c=Q("io-alert",`io-alert-${t}`,n==="large"&&"io-alert-lg",e),u=Kb[t];return l.jsxs("div",{"data-testid":"io-alert",className:c,role:"alert","aria-label":"alert",...s,children:[u&&l.jsx(jt,{"data-testid":"io-alert-icon",variant:u,className:"icon-severity"}),o&&l.jsx("p",{"data-testid":"io-alert-text",className:"io-text-smaller",children:o}),n==="large"&&a,r&&l.jsx(Ue,{"data-testid":"io-alert-close-button",className:"ms-auto",size:"16",iconSize:"10",icon:"close",onClick:i})]})}function qb({className:e,variant:t="default",children:n,...o}){const r=Q("io-badge",t!=="default"&&[`io-badge-${t}`],e);return l.jsx("div",{className:r,...o,children:n})}function Xn({className:e,tag:t="h2",size:n="normal",text:o="Title",...r}){const i=t,a=Q(n==="small"&&"io-title-semibold",n==="normal"&&"io-title",n==="large"&&"io-title-large",e);return l.jsx(i,{className:a,...r,children:o})}function et({className:e,title:t,titleSize:n="normal",tag:o,hint:r,children:i,...a}){const s=Q("io-block",e),c=t?"block-title":void 0;return l.jsxs("section",{className:s,"aria-label":t?void 0:"Block","aria-labelledby":c,...a,children:[t&&l.jsx(Xn,{id:c,tag:o,text:t,size:n}),i,r&&l.jsx("p",{className:"io-text-smaller",children:r})]})}const Mn=e=>e.key==="Enter"||e.key===" ",lc=(e,t)=>e===void 0?{}:{tabIndex:0,onClick:e,onKeyDown:n=>{Mn(n)&&(n.preventDefault(),e==null||e(n)),t==null||t(n)}},Lm=({event:e,currentIndex:t,moveFocus:n,min:o,max:r,onClose:i})=>{switch(e.key){case"ArrowUp":n(Math.max(t-1,o));break;case"ArrowDown":n(Math.min(t+1,r));break;case"Home":n(o);break;case"End":n(r);break;case"Escape":if(i){i();break}return;default:return}e.stopPropagation(),e.preventDefault()},tt=v.forwardRef(({className:e,variant:t="default",size:n="normal",icon:o,iconSize:r="12",iconRight:i=!1,text:a,onClick:s,disabled:c,children:u,...d},f)=>{const p=Q("io-btn",(t==="primary"||t==="critical"||t==="outline"||t==="link")&&[`io-btn-${t}`],n==="large"&&"io-btn-lg",e),h=v.useCallback(g=>{if(!c)return s?s(g):void 0;g.preventDefault()},[s,c]),m=v.useCallback(g=>{c||Mn(g)&&(g.preventDefault(),h(g))},[h,c]);return l.jsxs("button",{className:p,ref:f,type:"button","aria-disabled":c,onClick:h,onKeyDown:m,disabled:c,tabIndex:0,...d,children:[o&&!i&&l.jsx(jt,{variant:o,size:r}),u??a,o&&i&&l.jsx(jt,{variant:o,size:r})]})});tt.displayName="Button";const uc=v.createContext({}),Dm=v.forwardRef(({icon:e="chevron-down",onClick:t,onKeyDown:n,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:s}=v.useContext(uc),c=v.useCallback(f=>{s==null||s(f),r&&(typeof r=="function"?r(f):r.current=f)},[r,s]),u=v.useCallback(f=>{f.stopPropagation(),t==null||t(f),f.defaultPrevented||(i==null||i())},[t,i]),d=v.useCallback(f=>{n==null||n(f),f.defaultPrevented||Mn(f)&&(f.preventDefault(),f.stopPropagation(),i==null||i())},[n,i]);return l.jsx(tt,{icon:e,iconRight:!0,onClick:u,onKeyDown:d,disabled:a,ref:c,...o})});Dm.displayName="DropdownButton";const Mm=v.forwardRef(({size:e="32",onClick:t,onKeyDown:n,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:s}=v.useContext(uc),c=v.useCallback(f=>{s==null||s(f),r&&(typeof r=="function"?r(f):r.current=f)},[r,s]),u=v.useCallback(f=>{f.stopPropagation(),t==null||t(f),f.defaultPrevented||(i==null||i())},[t,i]),d=v.useCallback(f=>{n==null||n(f),f.defaultPrevented||Mn(f)&&(f.preventDefault(),f.stopPropagation(),i==null||i())},[n,i]);return l.jsx(Ue,{size:e,onClick:u,onKeyDown:d,disabled:a,ref:c,...o})});function $m({className:e,...t}){const n=Q("io-dropdown-content",e);return l.jsx("div",{className:n,...t})}Mm.displayName="DropdownButtonIcon";const Hm=v.createContext({}),dc=v.forwardRef((e,t)=>{const{className:n,prepend:o,append:r,isSelected:i,onClick:a,description:s,disabled:c=!1,children:u,tooltip:d,...f}=e,{variant:p="default",selected:h,checkIcon:m,handleItemClick:g}=v.useContext(Hm),y=i??(h==null?void 0:h.some(S=>S.children===u)),b=p!=="default"&&!!m,k=b||o,x=Q("io-list-item",k&&"io-list-item-left",r&&"io-list-item-right",p!=="default"&&y&&"selected",s&&"io-list-item-description",c&&"io-list-item-disabled",n);return l.jsxs("li",{className:x,ref:t,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:S=>{c?S.preventDefault():(g==null||g(S,{children:u}),a==null||a(S))},...f,children:[k&&l.jsxs("div",{className:"io-list-left-column",children:[b&&l.jsx(jt,{variant:m.variant,title:y?m.tooltip:void 0,"data-testid":"list-item-check-icon"}),o]}),l.jsx("span",{className:"io-list-text",title:d,"data-testid":"list-item-title",children:u}),r&&l.jsx("div",{className:"io-list-right-column",children:r}),s&&l.jsx("div",{className:"io-list-text-description",children:s})]})});dc.displayName="ListItem";const Bm=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=Q("io-list-item-header",e);return l.jsxs("div",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});Bm.displayName="ListItemHeader";const vd=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=Q("io-list-item",t&&"io-list-item-left",n&&"io-list-item-right","io-list-item-title",e);return l.jsxs("li",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,"data-testid":"list-item-title",children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});vd.displayName="ListItemTitle";const zm=v.forwardRef(({className:e,children:t,...n},o)=>{const r=Q("io-list-item","io-list-with-sub-items",e);return l.jsx("li",{className:r,ref:o,...n,children:t})});zm.displayName="ListItemWithSubItems";const wd=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=Q("io-list-item",t&&"io-list-item-left",n&&"io-list-item-right","io-list-item-section",e);return l.jsxs("li",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});function wo({className:e,...t}){const n=Q("io-separator",e);return l.jsx("hr",{className:n,...t})}wd.displayName="ListItemSection";const Fm=e=>l.jsx(wo,{...e});Fm.displayName="ListItemSeparator";const Wm=v.forwardRef((e,t)=>{const{className:n,variant:o="default",checkIcon:r,children:i,...a}=e,[s,c]=v.useState([]),u=Q("io-list",o!=="default"&&"io-list-selectable",n),d=v.useMemo(()=>{if(r)return typeof r=="object"?r:{variant:r}},[r]),f=v.useCallback((h,m)=>{if(o==="default")return;const g=s.some(y=>{var b,k;return((b=y.children)==null?void 0:b.toString())===((k=m.children)==null?void 0:k.toString())});o==="single"?c([m]):(()=>{const y=g?s.filter(b=>b.children!==m.children):[...s,m];c(y)})()},[s,o]),p=v.useMemo(()=>({variant:o,selected:s,checkIcon:d,handleItemClick:f}),[o,s,d,f]);return l.jsx(Hm.Provider,{value:p,children:l.jsx("ul",{className:u,ref:t,...a,children:i})})});Wm.displayName="List";const vt=Wm;vt.Item=dc,vt.ItemTitle=vd,vt.ItemSection=wd,vt.ItemHeader=Bm,vt.ItemWithSubItems=zm,vt.ItemSeparator=Fm;const Um=v.forwardRef((e,t)=>l.jsx(vt,{...e,ref:t}));Um.displayName="DropdownList";const Vm=v.forwardRef((e,t)=>{const{handleClose:n}=v.useContext(uc),{onClick:o,onKeyDown:r,...i}=e,a=v.useRef(null),s=v.useCallback(c=>{a.current=c,typeof t=="function"?t(c):t&&(t.current=c)},[t]);return l.jsx(dc,{...i,ref:s,onClick:c=>{o==null||o(c),n==null||n()},onKeyDown:c=>{if(r==null||r(c),c.defaultPrevented||!Mn(c))return;c.preventDefault(),c.stopPropagation();const u=(typeof t=="function"?null:t==null?void 0:t.current)||a.current;u==null||u.click()}})});Vm.displayName="DropdownItem";const Km=v.forwardRef((e,t)=>l.jsx(vd,{...e,ref:t}));Km.displayName="DropdownItemTitle";const Gm=v.forwardRef((e,t)=>l.jsx(wd,{...e,ref:t}));Gm.displayName="DropdownItemSection";const qm=v.forwardRef((e,t)=>l.jsx(wo,{...e}));qm.displayName="DropdownSeparator";function eu(e,t,n){const o=v.useCallback(r=>{t.some(a=>r.key===a)&&(r.preventDefault(),e())},[e,t]);v.useEffect(()=>{const r=(n==null?void 0:n.current)||document;return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[o,n])}const fe=v.forwardRef(({className:e,variant:t="outline",align:n="down",disabled:o,isOpen:r,onOpenChange:i,children:a,...s},c)=>{const u=v.useRef(null),d=v.useRef(null);v.useImperativeHandle(c,()=>d.current,[]);const{isOpen:f,handleOpen:p,handleClose:h}=((y,b)=>{const[k,x]=v.useState(!1),S=y!==void 0,w=S?y:k,C=v.useCallback(N=>{S||x(N),b==null||b(N)},[S,b]),O=v.useCallback(()=>C(!0),[C]),_=v.useCallback(()=>C(!1),[C]);return{isOpen:w,setOpen:C,handleOpen:O,handleClose:_}})(r,i);((y,b,k=!0)=>{v.useEffect(()=>{if(!k)return;const x=w=>{const C=w.target;C&&y.current&&!y.current.contains(C)&&(w.composedPath&&w.composedPath().some(O=>O===y.current||y.current&&O.nodeType===Node.ELEMENT_NODE&&y.current.contains(O))||b())},S=requestAnimationFrame(()=>{document.addEventListener("mousedown",x,!0)});return()=>{cancelAnimationFrame(S),document.removeEventListener("mousedown",x,!0)}},[y,b,k])})(d,h,f),eu(()=>{f&&h()},["Escape"],d),eu(()=>{f||o||u.current!==document.activeElement||p()},["ArrowDown","ArrowUp"],d);const m=v.useMemo(()=>({variant:t,align:n,disabled:o,isOpen:f,handleOpen:p,handleClose:h,handleToggle:f?h:p,setTriggerRef:y=>u.current=y}),[t,n,o,f,p,h]),g=Q("io-dropdown",f&&"io-dropdown-open",t!=="default"&&`io-dropdown-${t}`,e);return l.jsx(uc.Provider,{value:m,children:l.jsx("div",{className:g,ref:d,...s,children:a})})});function Be({className:e,variant:t="default",align:n="left",children:o,...r}){const i=Q("io-btn-group",t!=="default"&&`io-btn-group-${t}`,n==="right"&&"io-btn-group-right",e);return l.jsx("div",{className:i,"data-testid":"button-group",...r,children:o})}function cn({className:e,draggable:t=!1,children:n,...o}){const r=Q("io-header",t&&["draggable"],e);return l.jsx("header",{className:r,...o,children:n})}function vr({className:e,children:t,...n}){const o=Q("io-dialog-header",e);return l.jsx(cn,{"data-testid":"io-dialog-header",className:o,...n,children:t})}function Gf({className:e,children:t,...n}){const o=Q("io-dialog-body",e);return l.jsx("div",{"data-testid":"io-dialog-body",className:o,...n,children:t})}function jr({className:e,children:t,...n}){const o=Q("io-footer",e);return l.jsx("footer",{className:o,...n,children:t})}function Ri({className:e,...t}){const n=Q("io-dialog-footer",e);return l.jsx(jr,{"data-testid":"io-dialog-footer",className:n,...t})}function go({className:e,variant:t="default",title:n="Dialog Title",isOpen:o=!1,draggable:r=!1,closeFn:i,children:a,...s}){const c=v.useRef(null),u=Q("io-dialog",t==="centered"&&"io-dialog-center",e);return v.useLayoutEffect(()=>{const d=c==null?void 0:c.current;d&&(o?d.showModal():typeof d.close=="function"&&d.close())},[o]),l.jsxs("dialog",{"data-testid":"io-dialog",className:u,ref:c,"data-modal":!0,onClose:()=>{o&&i&&i()},onClick:d=>{o&&i&&d.target.nodeName==="DIALOG"&&i()},onKeyDown:d=>{const f=d.target instanceof HTMLDialogElement&&d.target.nodeName==="DIALOG";o&&i&&d.key===" "&&f&&i()},...s,children:[l.jsxs(vr,{draggable:r,children:[l.jsx("h3",{"data-testid":"io-dialog-title",children:n}),l.jsx(Be,{children:l.jsx(Ue,{className:"non-draggable","data-testid":"io-dialog-close-button",size:"24",icon:"close",iconSize:"12",onClick:i,tabIndex:-1})})]}),a]})}function fc(){return typeof window<"u"}function er(e){return Jm(e)?(e.nodeName||"").toLowerCase():"#document"}function dn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jn(e){var t;return(t=(Jm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Jm(e){return!!fc()&&(e instanceof Node||e instanceof dn(e).Node)}function at(e){return!!fc()&&(e instanceof Element||e instanceof dn(e).Element)}function Ct(e){return!!fc()&&(e instanceof HTMLElement||e instanceof dn(e).HTMLElement)}function tu(e){return!(!fc()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof dn(e).ShadowRoot)}fe.Button=Dm,fe.ButtonIcon=Mm,fe.Content=$m,fe.List=Um,fe.Item=Vm,fe.ItemTitle=Km,fe.ItemSection=Gm,fe.Separator=qm,Be.Button=tt,Be.ButtonIcon=Ue,Be.Dropdown=fe,cn.Title=Xn,cn.ButtonGroup=Be,cn.Button=tt,cn.ButtonIcon=Ue,cn.Dropdown=fe,vr.Title=Xn,vr.ButtonGroup=Be,vr.Button=tt,vr.ButtonIcon=Ue,vr.Dropdown=fe,Gf.Content=function({className:e,children:t,...n}){const o=Q("io-dialog-content",e);return l.jsx("div",{className:o,...n,children:t})},jr.ButtonGroup=Be,jr.Button=tt,jr.ButtonIcon=Ue,jr.Dropdown=fe,Ri.ButtonGroup=Be,Ri.Button=tt,Ri.ButtonIcon=Ue,Ri.Dropdown=fe,go.Header=vr,go.Body=Gf,go.Footer=Ri;const Jb=new Set(["inline","contents"]);function la(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=bn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Jb.has(r)}const Zb=new Set(["table","td","th"]);function Yb(e){return Zb.has(er(e))}const Xb=[":popover-open",":modal"];function As(e){return Xb.some(t=>{try{return e.matches(t)}catch{return!1}})}const Qb=["transform","translate","scale","rotate","perspective"],ex=["transform","translate","scale","rotate","perspective","filter"],tx=["paint","layout","strict","content"];function nu(e){const t=pc(),n=at(e)?bn(e):e;return Qb.some(o=>!!n[o]&&n[o]!=="none")||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||ex.some(o=>(n.willChange||"").includes(o))||tx.some(o=>(n.contain||"").includes(o))}function pc(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const nx=new Set(["html","body","#document"]);function Ko(e){return nx.has(er(e))}function bn(e){return dn(e).getComputedStyle(e)}function hc(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ho(e){if(er(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tu(e)&&e.host||Jn(e);return tu(t)?t.host:t}function Zm(e){const t=ho(e);return Ko(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ct(t)&&la(t)?t:Zm(t)}function Go(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Zm(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=dn(r);if(i){const s=ou(a);return t.concat(a,a.visualViewport||[],la(r)?r:[],s&&n?Go(s):[])}return t.concat(r,Go(r,[],n))}function ou(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fo(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function It(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&tu(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ym(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Xm(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function Qm(e){return!(e.mozInputSource!==0||!e.isTrusted)||(ru()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType)}function eg(e){return!Xm().includes("jsdom/")&&(!ru()&&e.width===0&&e.height===0||ru()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch")}function tg(){return/apple/i.test(navigator.vendor)}function ru(){const e=/android/i;return e.test(Ym())||e.test(Xm())}function qi(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ft(e){return(e==null?void 0:e.ownerDocument)||document}function Qc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function To(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ng(e){return Ct(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Gt(e){e.preventDefault(),e.stopPropagation()}function iu(e){return!!e&&e.getAttribute("role")==="combobox"&&ng(e)}const Ps=Math.min,Or=Math.max,Ns=Math.round,Qr=Math.floor,Zn=e=>({x:e,y:e}),ox={left:"right",right:"left",bottom:"top",top:"bottom"},rx={start:"end",end:"start"};function qf(e,t,n){return Or(e,Ps(t,n))}function mc(e,t){return typeof e=="function"?e(t):e}function Ir(e){return e.split("-")[0]}function gc(e){return e.split("-")[1]}function og(e){return e==="x"?"y":"x"}function rg(e){return e==="y"?"height":"width"}const ix=new Set(["top","bottom"]);function Ho(e){return ix.has(Ir(e))?"y":"x"}function ig(e){return og(Ho(e))}function au(e){return e.replace(/start|end/g,t=>rx[t])}const Jf=["left","right"],Zf=["right","left"],ax=["top","bottom"],sx=["bottom","top"];function cx(e,t,n,o){const r=gc(e);let i=function(a,s,c){switch(a){case"top":case"bottom":return c?s?Zf:Jf:s?Jf:Zf;case"left":case"right":return s?ax:sx;default:return[]}}(Ir(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(au)))),i}function Va(e){return e.replace(/left|right|bottom|top/g,t=>ox[t])}function Ts(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
|
|
5
|
+
*/tl=$m,function(){var e={}.hasOwnProperty;function t(){for(var r="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(r=o(r,n(a)))}return r}function n(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var a in r)e.call(r,a)&&r[a]&&(i=o(i,a));return i}function o(r,i){return i?r?r+" "+i:r+i:r}tl.exports?(t.default=t,tl.exports=t):window.classNames=t}();var Q=Ea($m.exports);function xt({className:e,size:t="16",variant:n="workspace",...o}){const r=Q("icon",t&&[`icon-size-${t}`],e);return l.jsx("span",{className:r,"aria-label":`icon-${n}`,role:"presentation",...o,children:l.jsx("i",{className:`icon-${n}`})})}const We=v.forwardRef(({className:e,variant:t="default",icon:n="workspace",size:o="16",tooltip:r,iconSize:i="16",onClick:a,disabled:s,children:c,...u},d)=>{const f=Q("io-btn-icon",t!=="default"&&[`io-btn-icon-${t}`],[`io-btn-icon-size-${o}`],e),p=v.useCallback(h=>{if(!s)return a?a(h):void 0;h.preventDefault()},[a,s]);return l.jsx("button",{className:f,type:"button",ref:d,"aria-label":"icon button","aria-disabled":s,title:r,onClick:p,disabled:s,...u,children:c??(n&&l.jsx(xt,{variant:n,size:i}))})});We.displayName="ButtonIcon";const Jb={default:void 0,info:"info",success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function Zb({className:e,variant:t="default",size:n="normal",text:o,close:r=!1,closeButtonOnClick:i,append:a,...s}){const c=Q("io-alert",`io-alert-${t}`,n==="large"&&"io-alert-lg",e),u=Jb[t];return l.jsxs("div",{"data-testid":"io-alert",className:c,role:"alert","aria-label":"alert",...s,children:[u&&l.jsx(xt,{"data-testid":"io-alert-icon",variant:u,className:"icon-severity"}),o&&l.jsx("p",{"data-testid":"io-alert-text",className:"io-text-smaller",children:o}),n==="large"&&a,r&&l.jsx(We,{"data-testid":"io-alert-close-button",className:"ms-auto",size:"16",iconSize:"10",icon:"close",onClick:i})]})}function Hm({className:e,variant:t="default",children:n,...o}){const r=Q("io-badge",t!=="default"&&[`io-badge-${t}`],e);return l.jsx("div",{className:r,...o,children:n})}function Xn({className:e,tag:t="h2",size:n="normal",text:o="Title",...r}){const i=t,a=Q(n==="small"&&"io-title-semibold",n==="normal"&&"io-title",n==="large"&&"io-title-large",e);return l.jsx(i,{className:a,...r,children:o})}function et({className:e,title:t,titleSize:n="normal",tag:o,hint:r,children:i,...a}){const s=Q("io-block",e),c=t?"block-title":void 0;return l.jsxs("section",{className:s,"aria-label":t?void 0:"Block","aria-labelledby":c,...a,children:[t&&l.jsx(Xn,{id:c,tag:o,text:t,size:n}),i,r&&l.jsx("p",{className:"io-text-smaller",children:r})]})}const En=e=>e.key==="Enter"||e.key===" ",ja=(e,t)=>e===void 0?{}:{tabIndex:0,onClick:e,onKeyDown:n=>{En(n)&&(n.preventDefault(),e==null||e(n)),t==null||t(n)}},kd=({event:e,currentIndex:t,moveFocus:n,min:o,max:r,onClose:i})=>{switch(e.key){case"ArrowUp":n(Math.max(t-1,o));break;case"ArrowDown":n(Math.min(t+1,r));break;case"Home":n(o);break;case"End":n(r);break;case"Escape":if(i){i();break}return;default:return}e.stopPropagation(),e.preventDefault()};var Yb=Object.freeze({__proto__:null,isClickKeypress:En,keyboardNavigation:kd,onClickA11y:ja});const tt=v.forwardRef(({className:e,variant:t="default",size:n="normal",icon:o,iconSize:r="12",iconRight:i=!1,text:a,onClick:s,disabled:c,children:u,...d},f)=>{const p=Q("io-btn",(t==="primary"||t==="critical"||t==="outline"||t==="link")&&[`io-btn-${t}`],n==="large"&&"io-btn-lg",e),h=v.useCallback(g=>{if(!c)return s?s(g):void 0;g.preventDefault()},[s,c]),m=v.useCallback(g=>{c||En(g)&&(g.preventDefault(),h(g))},[h,c]);return l.jsxs("button",{className:p,ref:f,type:"button","aria-disabled":c,onClick:h,onKeyDown:m,disabled:c,tabIndex:0,...d,children:[o&&!i&&l.jsx(xt,{variant:o,size:r}),u??a,o&&i&&l.jsx(xt,{variant:o,size:r})]})});tt.displayName="Button";const uc=v.createContext({}),Bm=v.forwardRef(({icon:e="chevron-down",onClick:t,onKeyDown:n,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:s}=v.useContext(uc),c=v.useCallback(f=>{s==null||s(f),r&&(typeof r=="function"?r(f):r.current=f)},[r,s]),u=v.useCallback(f=>{f.stopPropagation(),t==null||t(f),f.defaultPrevented||(i==null||i())},[t,i]),d=v.useCallback(f=>{n==null||n(f),f.defaultPrevented||En(f)&&(f.preventDefault(),f.stopPropagation(),i==null||i())},[n,i]);return l.jsx(tt,{icon:e,iconRight:!0,onClick:u,onKeyDown:d,disabled:a,ref:c,...o})});Bm.displayName="DropdownButton";const zm=v.forwardRef(({size:e="32",onClick:t,onKeyDown:n,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:s}=v.useContext(uc),c=v.useCallback(f=>{s==null||s(f),r&&(typeof r=="function"?r(f):r.current=f)},[r,s]),u=v.useCallback(f=>{f.stopPropagation(),t==null||t(f),f.defaultPrevented||(i==null||i())},[t,i]),d=v.useCallback(f=>{n==null||n(f),f.defaultPrevented||En(f)&&(f.preventDefault(),f.stopPropagation(),i==null||i())},[n,i]);return l.jsx(We,{size:e,onClick:u,onKeyDown:d,disabled:a,ref:c,...o})});function Fm({className:e,...t}){const n=Q("io-dropdown-content",e);return l.jsx("div",{className:n,...t})}zm.displayName="DropdownButtonIcon";const Wm=v.createContext({}),dc=v.forwardRef((e,t)=>{const{className:n,prepend:o,append:r,isSelected:i,onClick:a,description:s,disabled:c=!1,children:u,tooltip:d,...f}=e,{variant:p="default",selected:h,checkIcon:m,handleItemClick:g}=v.useContext(Wm),y=i??(h==null?void 0:h.some(S=>S.children===u)),b=p!=="default"&&!!m,k=b||o,x=Q("io-list-item",k&&"io-list-item-left",r&&"io-list-item-right",p!=="default"&&y&&"selected",s&&"io-list-item-description",c&&"io-list-item-disabled",n);return l.jsxs("li",{className:x,ref:t,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:S=>{c?S.preventDefault():(g==null||g(S,{children:u}),a==null||a(S))},...f,children:[k&&l.jsxs("div",{className:"io-list-left-column",children:[b&&l.jsx(xt,{variant:m.variant,title:y?m.tooltip:void 0,"data-testid":"list-item-check-icon"}),o]}),l.jsx("span",{className:"io-list-text",title:d,"data-testid":"list-item-title",children:u}),r&&l.jsx("div",{className:"io-list-right-column",children:r}),s&&l.jsx("div",{className:"io-list-text-description",children:s})]})});dc.displayName="ListItem";const Um=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=Q("io-list-item-header",e);return l.jsxs("div",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});Um.displayName="ListItemHeader";const Sd=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=Q("io-list-item",t&&"io-list-item-left",n&&"io-list-item-right","io-list-item-title",e);return l.jsxs("li",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,"data-testid":"list-item-title",children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});Sd.displayName="ListItemTitle";const Vm=v.forwardRef(({className:e,children:t,...n},o)=>{const r=Q("io-list-item","io-list-with-sub-items",e);return l.jsx("li",{className:r,ref:o,...n,children:t})});Vm.displayName="ListItemWithSubItems";const Cd=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=Q("io-list-item",t&&"io-list-item-left",n&&"io-list-item-right","io-list-item-section",e);return l.jsxs("li",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});function _i({className:e,...t}){const n=Q("io-separator",e);return l.jsx("hr",{className:n,...t})}Cd.displayName="ListItemSection";const Km=e=>l.jsx(_i,{...e});Km.displayName="ListItemSeparator";const Gm=v.forwardRef((e,t)=>{const{className:n,variant:o="default",checkIcon:r,children:i,...a}=e,[s,c]=v.useState([]),u=Q("io-list",o!=="default"&&"io-list-selectable",n),d=v.useMemo(()=>{if(r)return typeof r=="object"?r:{variant:r}},[r]),f=v.useCallback((h,m)=>{if(o==="default")return;const g=s.some(y=>{var b,k;return((b=y.children)==null?void 0:b.toString())===((k=m.children)==null?void 0:k.toString())});o==="single"?c([m]):(()=>{const y=g?s.filter(b=>b.children!==m.children):[...s,m];c(y)})()},[s,o]),p=v.useMemo(()=>({variant:o,selected:s,checkIcon:d,handleItemClick:f}),[o,s,d,f]);return l.jsx(Wm.Provider,{value:p,children:l.jsx("ul",{className:u,ref:t,...a,children:i})})});Gm.displayName="List";const gt=Gm;gt.Item=dc,gt.ItemTitle=Sd,gt.ItemSection=Cd,gt.ItemHeader=Um,gt.ItemWithSubItems=Vm,gt.ItemSeparator=Km;const qm=v.forwardRef((e,t)=>l.jsx(gt,{...e,ref:t}));qm.displayName="DropdownList";const Jm=v.forwardRef((e,t)=>{const{handleClose:n}=v.useContext(uc),{onClick:o,onKeyDown:r,...i}=e,a=v.useRef(null),s=v.useCallback(c=>{a.current=c,typeof t=="function"?t(c):t&&(t.current=c)},[t]);return l.jsx(dc,{...i,ref:s,onClick:c=>{o==null||o(c),n==null||n()},onKeyDown:c=>{if(r==null||r(c),c.defaultPrevented||!En(c))return;c.preventDefault(),c.stopPropagation();const u=(typeof t=="function"?null:t==null?void 0:t.current)||a.current;u==null||u.click()}})});Jm.displayName="DropdownItem";const Zm=v.forwardRef((e,t)=>l.jsx(Sd,{...e,ref:t}));Zm.displayName="DropdownItemTitle";const Ym=v.forwardRef((e,t)=>l.jsx(Cd,{...e,ref:t}));Ym.displayName="DropdownItemSection";const Xm=v.forwardRef((e,t)=>l.jsx(_i,{...e}));Xm.displayName="DropdownSeparator";function ru(e,t,n){const o=v.useCallback(r=>{t.some(a=>r.key===a)&&(r.preventDefault(),e())},[e,t]);v.useEffect(()=>{const r=(n==null?void 0:n.current)||document;return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[o,n])}const fe=v.forwardRef(({className:e,variant:t="outline",align:n="down",disabled:o,isOpen:r,onOpenChange:i,children:a,...s},c)=>{const u=v.useRef(null),d=v.useRef(null);v.useImperativeHandle(c,()=>d.current,[]);const{isOpen:f,handleOpen:p,handleClose:h}=((y,b)=>{const[k,x]=v.useState(!1),S=y!==void 0,w=S?y:k,C=v.useCallback(N=>{S||x(N),b==null||b(N)},[S,b]),O=v.useCallback(()=>C(!0),[C]),_=v.useCallback(()=>C(!1),[C]);return{isOpen:w,setOpen:C,handleOpen:O,handleClose:_}})(r,i);((y,b,k=!0)=>{v.useEffect(()=>{if(!k)return;const x=w=>{const C=w.target;C&&y.current&&!y.current.contains(C)&&(w.composedPath&&w.composedPath().some(O=>O===y.current||y.current&&O.nodeType===Node.ELEMENT_NODE&&y.current.contains(O))||b())},S=requestAnimationFrame(()=>{document.addEventListener("mousedown",x,!0)});return()=>{cancelAnimationFrame(S),document.removeEventListener("mousedown",x,!0)}},[y,b,k])})(d,h,f),ru(()=>{f&&h()},["Escape"],d),ru(()=>{f||o||u.current!==document.activeElement||p()},["ArrowDown","ArrowUp"],d);const m=v.useMemo(()=>({variant:t,align:n,disabled:o,isOpen:f,handleOpen:p,handleClose:h,handleToggle:f?h:p,setTriggerRef:y=>u.current=y}),[t,n,o,f,p,h]),g=Q("io-dropdown",f&&"io-dropdown-open",t!=="default"&&`io-dropdown-${t}`,e);return l.jsx(uc.Provider,{value:m,children:l.jsx("div",{className:g,ref:d,...s,children:a})})});function Be({className:e,variant:t="default",align:n="left",children:o,...r}){const i=Q("io-btn-group",t!=="default"&&`io-btn-group-${t}`,n==="right"&&"io-btn-group-right",e);return l.jsx("div",{className:i,"data-testid":"button-group",...r,children:o})}function cn({className:e,draggable:t=!1,children:n,...o}){const r=Q("io-header",t&&["draggable"],e);return l.jsx("header",{className:r,...o,children:n})}function yr({className:e,children:t,...n}){const o=Q("io-dialog-header",e);return l.jsx(cn,{"data-testid":"io-dialog-header",className:o,...n,children:t})}function Xf({className:e,children:t,...n}){const o=Q("io-dialog-body",e);return l.jsx("div",{"data-testid":"io-dialog-body",className:o,...n,children:t})}function Er({className:e,children:t,...n}){const o=Q("io-footer",e);return l.jsx("footer",{className:o,...n,children:t})}function Ri({className:e,...t}){const n=Q("io-dialog-footer",e);return l.jsx(Er,{"data-testid":"io-dialog-footer",className:n,...t})}function go({className:e,variant:t="default",title:n="Dialog Title",isOpen:o=!1,draggable:r=!1,closeFn:i,children:a,...s}){const c=v.useRef(null),u=Q("io-dialog",t==="centered"&&"io-dialog-center",e);return v.useLayoutEffect(()=>{const d=c==null?void 0:c.current;d&&(o?d.showModal():typeof d.close=="function"&&d.close())},[o]),l.jsxs("dialog",{"data-testid":"io-dialog",className:u,ref:c,"data-modal":!0,onClose:()=>{o&&i&&i()},onClick:d=>{o&&i&&d.target.nodeName==="DIALOG"&&i()},onKeyDown:d=>{const f=d.target instanceof HTMLDialogElement&&d.target.nodeName==="DIALOG";o&&i&&d.key===" "&&f&&i()},...s,children:[l.jsxs(yr,{draggable:r,children:[l.jsx("h3",{"data-testid":"io-dialog-title",children:n}),l.jsx(Be,{children:l.jsx(We,{className:"non-draggable","data-testid":"io-dialog-close-button",size:"24",icon:"close",iconSize:"12",onClick:i,tabIndex:-1})})]}),a]})}function fc(){return typeof window<"u"}function Qo(e){return Qm(e)?(e.nodeName||"").toLowerCase():"#document"}function dn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jn(e){var t;return(t=(Qm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qm(e){return!!fc()&&(e instanceof Node||e instanceof dn(e).Node)}function at(e){return!!fc()&&(e instanceof Element||e instanceof dn(e).Element)}function Et(e){return!!fc()&&(e instanceof HTMLElement||e instanceof dn(e).HTMLElement)}function iu(e){return!(!fc()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof dn(e).ShadowRoot)}fe.Button=Bm,fe.ButtonIcon=zm,fe.Content=Fm,fe.List=qm,fe.Item=Jm,fe.ItemTitle=Zm,fe.ItemSection=Ym,fe.Separator=Xm,Be.Button=tt,Be.ButtonIcon=We,Be.Dropdown=fe,cn.Title=Xn,cn.ButtonGroup=Be,cn.Button=tt,cn.ButtonIcon=We,cn.Dropdown=fe,yr.Title=Xn,yr.ButtonGroup=Be,yr.Button=tt,yr.ButtonIcon=We,yr.Dropdown=fe,Xf.Content=function({className:e,children:t,...n}){const o=Q("io-dialog-content",e);return l.jsx("div",{className:o,...n,children:t})},Er.ButtonGroup=Be,Er.Button=tt,Er.ButtonIcon=We,Er.Dropdown=fe,Ri.ButtonGroup=Be,Ri.Button=tt,Ri.ButtonIcon=We,Ri.Dropdown=fe,go.Header=yr,go.Body=Xf,go.Footer=Ri;const Xb=new Set(["inline","contents"]);function la(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=bn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Xb.has(r)}const Qb=new Set(["table","td","th"]);function ex(e){return Qb.has(Qo(e))}const tx=[":popover-open",":modal"];function Ps(e){return tx.some(t=>{try{return e.matches(t)}catch{return!1}})}const nx=["transform","translate","scale","rotate","perspective"],ox=["transform","translate","scale","rotate","perspective","filter"],rx=["paint","layout","strict","content"];function au(e){const t=pc(),n=at(e)?bn(e):e;return nx.some(o=>!!n[o]&&n[o]!=="none")||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||ox.some(o=>(n.willChange||"").includes(o))||rx.some(o=>(n.contain||"").includes(o))}function pc(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ix=new Set(["html","body","#document"]);function Vo(e){return ix.has(Qo(e))}function bn(e){return dn(e).getComputedStyle(e)}function hc(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ho(e){if(Qo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||iu(e)&&e.host||Jn(e);return iu(t)?t.host:t}function eg(e){const t=ho(e);return Vo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Et(t)&&la(t)?t:eg(t)}function Ko(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=eg(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=dn(r);if(i){const s=su(a);return t.concat(a,a.visualViewport||[],la(r)?r:[],s&&n?Ko(s):[])}return t.concat(r,Ko(r,[],n))}function su(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fo(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function It(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&iu(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function tg(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ng(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function og(e){return!(e.mozInputSource!==0||!e.isTrusted)||(cu()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType)}function rg(e){return!ng().includes("jsdom/")&&(!cu()&&e.width===0&&e.height===0||cu()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch")}function ig(){return/apple/i.test(navigator.vendor)}function cu(){const e=/android/i;return e.test(tg())||e.test(ng())}function qi(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ft(e){return(e==null?void 0:e.ownerDocument)||document}function nl(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function No(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ag(e){return Et(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Gt(e){e.preventDefault(),e.stopPropagation()}function lu(e){return!!e&&e.getAttribute("role")==="combobox"&&ag(e)}const Ns=Math.min,_r=Math.max,Ts=Math.round,Xr=Math.floor,Zn=e=>({x:e,y:e}),ax={left:"right",right:"left",bottom:"top",top:"bottom"},sx={start:"end",end:"start"};function Qf(e,t,n){return _r(e,Ns(t,n))}function mc(e,t){return typeof e=="function"?e(t):e}function Tr(e){return e.split("-")[0]}function gc(e){return e.split("-")[1]}function sg(e){return e==="x"?"y":"x"}function cg(e){return e==="y"?"height":"width"}const cx=new Set(["top","bottom"]);function $o(e){return cx.has(Tr(e))?"y":"x"}function lg(e){return sg($o(e))}function uu(e){return e.replace(/start|end/g,t=>sx[t])}const ep=["left","right"],tp=["right","left"],lx=["top","bottom"],ux=["bottom","top"];function dx(e,t,n,o){const r=gc(e);let i=function(a,s,c){switch(a){case"top":case"bottom":return c?s?tp:ep:s?ep:tp;case"left":case"right":return s?lx:ux;default:return[]}}(Tr(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(uu)))),i}function Ka(e){return e.replace(/left|right|bottom|top/g,t=>ax[t])}function Is(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
|
|
6
6
|
* tabbable 6.4.0
|
|
7
7
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
8
|
-
*/var Is=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),ag=typeof Element>"u",hi=ag?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gs=!ag&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Rs=function(e,t){var n;t===void 0&&(t=!0);var o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert");return o===""||o==="true"||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):Rs(e.parentNode))},su=function(e,t,n){for(var o=[],r=Array.from(e);r.length;){var i=r.shift();if(!Rs(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),s=a.length?a:i.children,c=su(s,!0,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{hi.call(i,Is)&&n.filter(i)&&(t||!e.includes(i))&&o.push(i);var u=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),d=!Rs(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(u&&d){var f=su(u===!0?i.children:u.children,!0,n);n.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else r.unshift.apply(r,i.children)}}return o},sg=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},cg=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"}(e))&&!sg(e)?0:e.tabIndex},lx=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},lg=function(e){return e.tagName==="INPUT"},ux=function(e){return function(t){return lg(t)&&t.type==="radio"}(e)&&!function(t){if(!t.name)return!0;var n,o=t.form||gs(t),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")n=r(window.CSS.escape(t.name));else try{n=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=function(a,s){for(var c=0;c<a.length;c++)if(a[c].checked&&a[c].form===s)return a[c]}(n,t.form);return!i||i===t}(e)},Yf=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return n===0&&o===0},dx=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if(n==="full-native"&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility==="hidden")return!0;var r=hi.call(e,"details>summary:first-of-type")?e.parentElement:e;if(hi.call(r,"details:not([open]) *"))return!0;if(n&&n!=="full"&&n!=="full-native"&&n!=="legacy-full"){if(n==="non-zero-area")return Yf(e)}else{if(typeof o=="function"){for(var i=e;e;){var a=e.parentElement,s=gs(e);if(a&&!a.shadowRoot&&o(a)===!0)return Yf(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(c){var u,d,f,p,h=c&&gs(c),m=(u=h)===null||u===void 0?void 0:u.host,g=!1;if(h&&h!==c)for(g=!!((d=m)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(m)||c!=null&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(c));!g&&m;){var y,b,k;g=!((b=m=(y=h=gs(m))===null||y===void 0?void 0:y.host)===null||b===void 0||(k=b.ownerDocument)===null||k===void 0||!k.contains(m))}return g}(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}return!1},fx=function(e,t){return!(t.disabled||function(n){return lg(n)&&n.type==="hidden"}(t)||dx(t,e)||function(n){return n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"})}(t)||function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var o=n.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var r=0;r<o.children.length;r++){var i=o.children.item(r);if(i.tagName==="LEGEND")return!!hi.call(o,"fieldset[disabled] *")||!i.contains(n)}return!0}o=o.parentElement}return!1}(t))},cu=function(e,t){return!(ux(t)||cg(t)<0||!fx(e,t))},px=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ug=function(e){var t=[],n=[];return e.forEach(function(o,r){var i=!!o.scopeParent,a=i?o.scopeParent:o,s=function(u,d){var f=cg(u);return f<0&&d&&!sg(u)?0:f}(a,i),c=i?ug(o.candidates):a;s===0?i?t.push.apply(t,c):t.push(a):n.push({documentOrder:r,tabIndex:s,item:o,isScope:i,content:c})}),n.sort(lx).reduce(function(o,r){return r.isScope?o.push.apply(o,r.content):o.push(r.content),o},[]).concat(t)},bd=function(e,t){var n;return n=(t=t||{}).getShadowRoot?su([e],t.includeContainer,{filter:cu.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:px}):function(o,r,i){if(Rs(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(Is));return r&&hi.call(o,Is)&&a.unshift(o),a.filter(i)}(e,t.includeContainer,cu.bind(null,t)),ug(n)};function Xf(e,t,n){let{reference:o,floating:r}=e;const i=Ho(t),a=ig(t),s=rg(a),c=Ir(t),u=i==="y",d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2;let h;switch(c){case"top":h={x:d,y:o.y-r.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(gc(t)){case"start":h[a]-=p*(n&&u?-1:1);break;case"end":h[a]+=p*(n&&u?-1:1)}return h}async function hx(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=mc(t,e),m=function(w){return typeof w!="number"?function(C){return{top:0,right:0,bottom:0,left:0,...C}}(w):{top:w,right:w,bottom:w,left:w}}(h),g=s[p?f==="floating"?"reference":"floating":f],y=Ts(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:c})),b=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),x=await(i.isElement==null?void 0:i.isElement(k))&&await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1},S=Ts(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:k,strategy:c}):b);return{top:(y.top-S.top+m.top)/x.y,bottom:(S.bottom-y.bottom+m.bottom)/x.y,left:(y.left-S.left+m.left)/x.x,right:(S.right-y.right+m.right)/x.x}}const mx=new Set(["left","top"]);function dg(e){const t=bn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ct(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=Ns(n)!==i||Ns(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function xd(e){return at(e)?e:e.contextElement}function ci(e){const t=xd(e);if(!Ct(t))return Zn(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=dg(t);let a=(i?Ns(n.width):n.width)/o,s=(i?Ns(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const gx=Zn(0);function fg(e){const t=dn(e);return pc()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:gx}function Rr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=xd(e);let a=Zn(1);t&&(o?at(o)&&(a=ci(o)):a=ci(e));const s=function(p,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==dn(p))&&h}(i,n,o)?fg(i):Zn(0);let c=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(i){const p=dn(i),h=o&&at(o)?dn(o):o;let m=p,g=ou(m);for(;g&&o&&h!==m;){const y=ci(g),b=g.getBoundingClientRect(),k=bn(g),x=b.left+(g.clientLeft+parseFloat(k.paddingLeft))*y.x,S=b.top+(g.clientTop+parseFloat(k.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=x,u+=S,m=dn(g),g=ou(m)}}return Ts({width:d,height:f,x:c,y:u})}function Ls(e,t){const n=hc(e).scrollLeft;return t?t.left+n:Rr(Jn(e)).left+n}function pg(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ls(e,n),y:n.top+t.scrollTop}}const yx=new Set(["absolute","fixed"]);function Qf(e,t,n){let o;if(t==="viewport")o=function(r,i){const a=dn(r),s=Jn(r),c=a.visualViewport;let u=s.clientWidth,d=s.clientHeight,f=0,p=0;if(c){u=c.width,d=c.height;const m=pc();(!m||m&&i==="fixed")&&(f=c.offsetLeft,p=c.offsetTop)}const h=Ls(s);if(h<=0){const m=s.ownerDocument,g=m.body,y=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,k=Math.abs(s.clientWidth-g.clientWidth-b);k<=25&&(u-=k)}else h<=25&&(u+=h);return{width:u,height:d,x:f,y:p}}(e,n);else if(t==="document")o=function(r){const i=Jn(r),a=hc(r),s=r.ownerDocument.body,c=Or(i.scrollWidth,i.clientWidth,s.scrollWidth,s.clientWidth),u=Or(i.scrollHeight,i.clientHeight,s.scrollHeight,s.clientHeight);let d=-a.scrollLeft+Ls(r);const f=-a.scrollTop;return bn(s).direction==="rtl"&&(d+=Or(i.clientWidth,s.clientWidth)-c),{width:c,height:u,x:d,y:f}}(Jn(e));else if(at(t))o=function(r,i){const a=Rr(r,!0,i==="fixed"),s=a.top+r.clientTop,c=a.left+r.clientLeft,u=Ct(r)?ci(r):Zn(1);return{width:r.clientWidth*u.x,height:r.clientHeight*u.y,x:c*u.x,y:s*u.y}}(t,n);else{const r=fg(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ts(o)}function hg(e,t){const n=ho(e);return!(n===t||!at(n)||Ko(n))&&(bn(n).position==="fixed"||hg(n,t))}function vx(e,t,n){const o=Ct(t),r=Jn(t),i=n==="fixed",a=Rr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Zn(0);function u(){c.x=Ls(r)}if(o||!o&&!i)if((er(t)!=="body"||la(r))&&(s=hc(t)),o){const f=Rr(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&u();i&&!o&&r&&u();const d=!r||o||i?Zn(0):pg(r,s);return{x:a.left+s.scrollLeft-c.x-d.x,y:a.top+s.scrollTop-c.y-d.y,width:a.width,height:a.height}}function el(e){return bn(e).position==="static"}function ep(e,t){if(!Ct(e)||bn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Jn(e)===n&&(n=n.ownerDocument.body),n}function tp(e,t){const n=dn(e);if(As(e))return n;if(!Ct(e)){let r=ho(e);for(;r&&!Ko(r);){if(at(r)&&!el(r))return r;r=ho(r)}return n}let o=ep(e,t);for(;o&&Yb(o)&&el(o);)o=ep(o,t);return o&&Ko(o)&&el(o)&&!nu(o)?n:o||function(r){let i=ho(r);for(;Ct(i)&&!Ko(i);){if(nu(i))return i;if(As(i))return null;i=ho(i)}return null}(e)||n}const wx={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=Jn(o),s=!!t&&As(t.floating);if(o===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Zn(1);const d=Zn(0),f=Ct(o);if((f||!f&&!i)&&((er(o)!=="body"||la(a))&&(c=hc(o)),Ct(o))){const h=Rr(o);u=ci(o),d.x=h.x+o.clientLeft,d.y=h.y+o.clientTop}const p=!a||f||i?Zn(0):pg(a,c);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-c.scrollTop*u.y+d.y+p.y}},getDocumentElement:Jn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?As(t)?[]:function(c,u){const d=u.get(c);if(d)return d;let f=Go(c,[],!1).filter(g=>at(g)&&er(g)!=="body"),p=null;const h=bn(c).position==="fixed";let m=h?ho(c):c;for(;at(m)&&!Ko(m);){const g=bn(m),y=nu(m);y||g.position!=="fixed"||(p=null),(h?!y&&!p:!y&&g.position==="static"&&p&&yx.has(p.position)||la(m)&&!y&&hg(c,m))?f=f.filter(b=>b!==m):p=g,m=ho(m)}return u.set(c,f),f}(t,this._c):[].concat(n),o],a=i[0],s=i.reduce((c,u)=>{const d=Qf(t,u,r);return c.top=Or(d.top,c.top),c.right=Ps(d.right,c.right),c.bottom=Ps(d.bottom,c.bottom),c.left=Or(d.left,c.left),c},Qf(t,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:tp,getElementRects:async function(e){const t=this.getOffsetParent||tp,n=this.getDimensions,o=await n(e.floating);return{reference:vx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=dg(e);return{width:t,height:n}},getScale:ci,isElement:at,isRTL:function(e){return bn(e).direction==="rtl"}};function np(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bx(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,u=xd(e),d=r||i?[...u?Go(u):[],...Go(t)]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&s?function(y,b){let k,x=null;const S=Jn(y);function w(){var C;clearTimeout(k),(C=x)==null||C.disconnect(),x=null}return function C(O,_){O===void 0&&(O=!1),_===void 0&&(_=1),w();const N=y.getBoundingClientRect(),{left:E,top:A,width:j,height:B}=N;if(O||b(),!j||!B)return;const $={rootMargin:-Qr(A)+"px "+-Qr(S.clientWidth-(E+j))+"px "+-Qr(S.clientHeight-(A+B))+"px "+-Qr(E)+"px",threshold:Or(0,Ps(1,_))||1};let R=!0;function F(z){const V=z[0].intersectionRatio;if(V!==_){if(!R)return C();V?C(!1,V):k=setTimeout(()=>{C(!1,1e-7)},1e3)}V!==1||np(N,y.getBoundingClientRect())||C(),R=!1}try{x=new IntersectionObserver(F,{...$,root:S.ownerDocument})}catch{x=new IntersectionObserver(F,$)}x.observe(y)}(!0),w}(u,n):null;let p,h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var k;(k=m)==null||k.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g=c?Rr(e):null;return c&&function y(){const b=Rr(e);g&&!np(g,b)&&n(),g=b,p=requestAnimationFrame(y)}(),n(),()=>{var y;d.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const xx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,c=await async function(u,d){const{placement:f,platform:p,elements:h}=u,m=await(p.isRTL==null?void 0:p.isRTL(h.floating)),g=Ir(f),y=gc(f),b=Ho(f)==="y",k=mx.has(g)?-1:1,x=m&&b?-1:1,S=mc(d,u);let{mainAxis:w,crossAxis:C,alignmentAxis:O}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return y&&typeof O=="number"&&(C=y==="end"?-1*O:O),b?{x:C*x,y:w*k}:{x:w*k,y:C*x}}(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}},kx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:b=>{let{x:k,y:x}=b;return{x:k,y:x}}},...u}=mc(e,t),d={x:n,y:o},f=await i.detectOverflow(t,u),p=Ho(Ir(r)),h=og(p);let m=d[h],g=d[p];if(a){const b=h==="y"?"bottom":"right";m=qf(m+f[h==="y"?"top":"left"],m,m-f[b])}if(s){const b=p==="y"?"bottom":"right";g=qf(g+f[p==="y"?"top":"left"],g,g-f[b])}const y=c.fn({...t,[h]:m,[p]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[h]:a,[p]:s}}}}}},Sx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=mc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Ir(r),k=Ho(s),x=Ir(s)===s,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=p||(x||!g?[Va(s)]:function($){const R=Va($);return[au($),R,au(R)]}(s)),C=m!=="none";!p&&C&&w.push(...cx(s,g,m,S));const O=[s,...w],_=await c.detectOverflow(t,y),N=[];let E=((o=i.flip)==null?void 0:o.overflows)||[];if(d&&N.push(_[b]),f){const $=function(R,F,z){z===void 0&&(z=!1);const V=gc(R),L=ig(R),H=rg(L);let W=L==="x"?V===(z?"end":"start")?"right":"left":V==="start"?"bottom":"top";return F.reference[H]>F.floating[H]&&(W=Va(W)),[W,Va(W)]}(r,a,S);N.push(_[$[0]],_[$[1]])}if(E=[...E,{placement:r,overflows:N}],!N.every($=>$<=0)){var A,j;const $=(((A=i.flip)==null?void 0:A.index)||0)+1,R=O[$];if(R&&(!(f==="alignment"&&k!==Ho(R))||E.every(z=>Ho(z.placement)!==k||z.overflows[0]>0)))return{data:{index:$,overflows:E},reset:{placement:R}};let F=(j=E.filter(z=>z.overflows[0]<=0).sort((z,V)=>z.overflows[1]-V.overflows[1])[0])==null?void 0:j.placement;if(!F)switch(h){case"bestFit":{var B;const z=(B=E.filter(V=>{if(C){const L=Ho(V.placement);return L===k||L==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(L=>L>0).reduce((L,H)=>L+H,0)]).sort((V,L)=>V[1]-L[1])[0])==null?void 0:B[0];z&&(F=z);break}case"initialPlacement":F=s}if(r!==F)return{reset:{placement:F}}}return{}}}},Cx=(e,t,n)=>{const o=new Map,r={platform:wx,...n},i={...r.platform,_c:o};return(async(a,s,c)=>{const{placement:u="bottom",strategy:d="absolute",middleware:f=[],platform:p}=c,h=f.filter(Boolean),m=await(p.isRTL==null?void 0:p.isRTL(s));let g=await p.getElementRects({reference:a,floating:s,strategy:d}),{x:y,y:b}=Xf(g,u,m),k=u,x={},S=0;for(let C=0;C<h.length;C++){var w;const{name:O,fn:_}=h[C],{x:N,y:E,data:A,reset:j}=await _({x:y,y:b,initialPlacement:u,placement:k,strategy:d,middlewareData:x,rects:g,platform:{...p,detectOverflow:(w=p.detectOverflow)!=null?w:hx},elements:{reference:a,floating:s}});y=N??y,b=E??b,x={...x,[O]:{...x[O],...A}},j&&S<=50&&(S++,typeof j=="object"&&(j.placement&&(k=j.placement),j.rects&&(g=j.rects===!0?await p.getElementRects({reference:a,floating:s,strategy:d}):j.rects),{x:y,y:b}=Xf(g,k,m)),C=-1)}return{x:y,y:b,placement:k,strategy:d,middlewareData:x}})(e,t,{...r,platform:i})};var ys=typeof document<"u"?v.useLayoutEffect:function(){};function Ds(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Ds(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if((i!=="_owner"||!e.$$typeof)&&!Ds(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function mg(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function op(e,t){const n=mg(e);return Math.round(t*n)/n}function tl(e){const t=J.useRef(e);return ys(()=>{t.current=e}),t}const Ex=(e,t)=>({...kx(e),options:[e,t]}),jx=(e,t)=>({...Sx(e),options:[e,t]});function gg(e){return J.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const yg={...J},_x=yg.useInsertionEffect||(e=>e());function Yt(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _x(()=>{t.current=e}),J.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}const kd="ArrowUp",ta="ArrowDown",Io="ArrowLeft",Ro="ArrowRight";function Ka(e,t,n){return Math.floor(e/t)!==n}function Li(e,t){return t<0||t>=e.current.length}function nl(e,t){return zt(e,{disabledIndices:t})}function rp(e,t){return zt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function zt(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=t===void 0?{}:t;const a=e.current;let s=n;do s+=o?-i:i;while(s>=0&&s<=a.length-1&&vs(a,s,r));return s}function Ox(e,t,n,o,r){if(e===-1)return-1;const i=n.indexOf(e),a=t[e];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return n.lastIndexOf(e)}}function Ax(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function vs(e,t,n){if(n)return n.includes(t);const o=e[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var dt=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Px(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const vg=J.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Nx(e){const{children:t,elementsRef:n,labelsRef:o}=e,[r,i]=J.useState(()=>new Map),a=J.useCallback(c=>{i(u=>new Map(u).set(c,null))},[]),s=J.useCallback(c=>{i(u=>{const d=new Map(u);return d.delete(c),d})},[]);return dt(()=>{const c=new Map(r);Array.from(c.keys()).sort(Px).forEach((u,d)=>{c.set(u,d)}),function(u,d){if(u.size!==d.size)return!1;for(const[f,p]of u.entries())if(p!==d.get(f))return!1;return!0}(r,c)||i(c)},[r]),J.createElement(vg.Provider,{value:J.useMemo(()=>({register:a,unregister:s,map:r,elementsRef:n,labelsRef:o}),[a,s,r,n,o])},t)}function wg(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:o,map:r,elementsRef:i,labelsRef:a}=J.useContext(vg),[s,c]=J.useState(null),u=J.useRef(null),d=J.useCallback(f=>{if(u.current=f,s!==null&&(i.current[s]=f,a)){var p;const h=t!==void 0;a.current[s]=h?t:(p=f==null?void 0:f.textContent)!=null?p:null}},[s,i,a,t]);return dt(()=>{const f=u.current;if(f)return n(f),()=>{o(f)}},[n,o]),dt(()=>{const f=u.current?r.get(u.current):null;f!=null&&c(f)},[r]),J.useMemo(()=>({ref:d,index:s??-1}),[s,d])}function Ms(){return Ms=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ms.apply(this,arguments)}let ip=!1,Tx=0;const ap=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Tx++,lu=yg.useId||function(){const[e,t]=J.useState(()=>ip?ap():void 0);return dt(()=>{e==null&&t(ap())},[]),J.useEffect(()=>{ip=!0},[]),e};let ua;function ol(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");var i;(e=ua)!=null&&e.has(r)||((i=ua)==null||i.add(r),console.warn(r))}function bg(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,((o=e.get(t))==null?void 0:o.filter(r=>r!==n))||[])}}}process.env.NODE_ENV!=="production"&&(ua=new Set);const xg=J.createContext(null),kg=J.createContext(null),Bo=()=>{var e;return((e=J.useContext(xg))==null?void 0:e.id)||null},zo=()=>J.useContext(kg);function Ix(e){const{children:t,id:n}=e,o=Bo();return J.createElement(xg.Provider,{value:J.useMemo(()=>({id:n,parentId:o}),[n,o])},t)}function Rx(e){const{children:t}=e,n=J.useRef([]),o=J.useCallback(a=>{n.current=[...n.current,a]},[]),r=J.useCallback(a=>{n.current=n.current.filter(s=>s!==a)},[]),i=J.useState(()=>bg())[0];return J.createElement(kg.Provider,{value:J.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:i}),[o,r,i])},t)}function da(e){return"data-floating-ui-"+e}function Tn(e){const t=v.useRef(e);return dt(()=>{t.current=e}),t}const sp=da("safe-polygon");function rl(e,t,n){return n&&!qi(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}let cp=0;function Po(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(cp);const i=()=>e==null?void 0:e.focus({preventScroll:n});r?i():cp=requestAnimationFrame(i)}function Ar(e,t){let n=e.filter(r=>{var i;return r.parentId===t&&((i=r.context)==null?void 0:i.open)}),o=n;for(;o.length;)o=e.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var s;return r.parentId===a.id&&((s=r.context)==null?void 0:s.open)})}),n=n.concat(o);return n}let Ur=new WeakMap,Ga=new WeakSet,qa={},il=0;const Sg=e=>e&&(e.host||Sg(e.parentNode));function Lx(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,a=((f,p)=>p.map(h=>{if(f.contains(h))return h;const m=Sg(h);return f.contains(m)?m:null}).filter(h=>h!=null))(t,e),s=new Set,c=new Set(a),u=[];qa[r]||(qa[r]=new WeakMap);const d=qa[r];return a.forEach(function f(p){!p||s.has(p)||(s.add(p),p.parentNode&&f(p.parentNode))}),function f(p){!p||c.has(p)||[].forEach.call(p.children,h=>{if(er(h)!=="script")if(s.has(h))f(h);else{const m=i?h.getAttribute(i):null,g=m!==null&&m!=="false",y=(Ur.get(h)||0)+1,b=(d.get(h)||0)+1;Ur.set(h,y),d.set(h,b),u.push(h),y===1&&g&&Ga.add(h),b===1&&h.setAttribute(r,""),!g&&i&&h.setAttribute(i,"true")}})}(t),s.clear(),il++,()=>{u.forEach(f=>{const p=(Ur.get(f)||0)-1,h=(d.get(f)||0)-1;Ur.set(f,p),d.set(f,h),p||(!Ga.has(f)&&i&&f.removeAttribute(i),Ga.delete(f)),h||f.removeAttribute(r)}),il--,il||(Ur=new WeakMap,Ur=new WeakMap,Ga=new WeakSet,qa={})}}function lp(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Ft(e[0]).body;return Lx(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const $s=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function up(e,t){const n=bd(e,$s());t==="prev"&&n.reverse();const o=n.indexOf(fo(Ft(e)));return n.slice(o+1)[0]}function dp(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!It(n,o)}const Sd={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function fp(e){e.key==="Tab"&&(e.target,clearTimeout(void 0))}const pp=J.forwardRef(function(e,t){const[n,o]=J.useState();dt(()=>(tg()&&o("button"),document.addEventListener("keydown",fp),()=>{document.removeEventListener("keydown",fp)}),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[da("focus-guard")]:"",style:Sd};return J.createElement("span",Ms({},e,r))}),Dx=J.createContext(null),uu="data-floating-ui-focusable";function Cg(e){return e?e.hasAttribute(uu)?e:e.querySelector("["+uu+"]")||e:null}let wr=[];function al(e){wr=wr.filter(n=>n.isConnected);let t=e;if(t&&er(t)!=="body"){if(!function(n,o){if(o=o||{},!n)throw new Error("No node provided");return hi.call(n,Is)!==!1&&cu(o,n)}(t,$s())){const n=bd(t,$s())[0];n&&(t=n)}wr.push(t),wr.length>20&&(wr=wr.slice(-20))}}function hp(){return wr.slice().reverse().find(e=>e.isConnected)}const Mx=J.forwardRef(function(e,t){return J.createElement("button",Ms({},e,{type:"button",ref:t,tabIndex:-1,style:Sd}))});function $x(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:s=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:p,refs:h,nodeId:m,onOpenChange:g,events:y,dataRef:b,floatingId:k,elements:{domReference:x,floating:S}}=t,w=typeof a=="number"&&a<0,C=iu(x)&&w,O=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,_=Tn(r),N=Tn(a),E=Tn(s),A=zo(),j=J.useContext(Dx),B=J.useRef(null),$=J.useRef(null),R=J.useRef(!1),F=J.useRef(!1),z=J.useRef(-1),V=j!=null,L=Cg(S),H=Yt(function(D){return D===void 0&&(D=L),D?bd(D,$s()):[]}),W=Yt(D=>{const T=H(D);return _.current.map(P=>x&&P==="reference"?x:L&&P==="floating"?L:T).filter(Boolean).flat()});function U(D){return!o&&d&&u?J.createElement(Mx,{ref:D==="start"?B:$,onClick:T=>g(!1,T.nativeEvent)},typeof d=="string"?d:"Dismiss"):null}J.useEffect(()=>{if(o||!u)return;function D(P){if(P.key==="Tab"){It(L,fo(Ft(L)))&&H().length===0&&!C&&Gt(P);const I=W(),G=To(P);_.current[0]==="reference"&&G===x&&(Gt(P),P.shiftKey?Po(I[I.length-1]):Po(I[1])),_.current[1]==="floating"&&G===L&&P.shiftKey&&(Gt(P),Po(I[0]))}}const T=Ft(L);return T.addEventListener("keydown",D),()=>{T.removeEventListener("keydown",D)}},[o,x,L,u,_,C,H,W]),J.useEffect(()=>{if(!o&&S)return S.addEventListener("focusin",D),()=>{S.removeEventListener("focusin",D)};function D(T){const P=To(T),I=H().indexOf(P);I!==-1&&(z.current=I)}},[o,S,H]),J.useEffect(()=>{if(!o&&f)return S&&Ct(x)?(x.addEventListener("focusout",T),x.addEventListener("pointerdown",D),S.addEventListener("focusout",T),()=>{x.removeEventListener("focusout",T),x.removeEventListener("pointerdown",D),S.removeEventListener("focusout",T)}):void 0;function D(){F.current=!0,setTimeout(()=>{F.current=!1})}function T(P){const I=P.relatedTarget;queueMicrotask(()=>{const G=!(It(x,I)||It(S,I)||It(I,S)||It(j==null?void 0:j.portalNode,I)||I!=null&&I.hasAttribute(da("focus-guard"))||A&&(Ar(A.nodesRef.current,m).find(K=>{var X,Z;return It((X=K.context)==null?void 0:X.elements.floating,I)||It((Z=K.context)==null?void 0:Z.elements.domReference,I)})||function(K,X){var Z;let M=[],se=(Z=K.find(ce=>ce.id===X))==null?void 0:Z.parentId;for(;se;){const ce=K.find(ge=>ge.id===se);se=ce==null?void 0:ce.parentId,ce&&(M=M.concat(ce))}return M}(A.nodesRef.current,m).find(K=>{var X,Z;return((X=K.context)==null?void 0:X.elements.floating)===I||((Z=K.context)==null?void 0:Z.elements.domReference)===I})));if(c&&G&&fo(Ft(L))===Ft(L).body){Ct(L)&&L.focus();const K=z.current,X=H(),Z=X[K]||X[X.length-1]||L;Ct(Z)&&Z.focus()}!C&&u||!I||!G||F.current||I===hp()||(R.current=!0,g(!1,P,"focus-out"))})}},[o,x,S,L,u,m,A,j,g,f,c,H,C]),J.useEffect(()=>{var D;if(o)return;const T=Array.from((j==null||(D=j.portalNode)==null?void 0:D.querySelectorAll("["+da("portal")+"]"))||[]);if(S){const P=[S,...T,B.current,$.current,_.current.includes("reference")||C?x:null].filter(G=>G!=null),I=u||C?lp(P,O,!O):lp(P);return()=>{I()}}},[o,x,S,u,_,j,C,O]),dt(()=>{if(o||!Ct(L))return;const D=fo(Ft(L));queueMicrotask(()=>{const T=W(L),P=N.current,I=(typeof P=="number"?T[P]:P.current)||L,G=It(L,D);w||G||!p||Po(I,{preventScroll:I===L})})},[o,p,L,w,W,N]),dt(()=>{if(o||!L)return;let D=!1;const T=Ft(L),P=fo(T);let I=b.current.openEvent;function G(X){let{open:Z,reason:M,event:se,nested:ce}=X;Z&&(I=se),M==="escape-key"&&h.domReference.current&&al(h.domReference.current),M==="hover"&&se.type==="mouseleave"&&(R.current=!0),M==="outside-press"&&(ce?(R.current=!1,D=!0):R.current=!(Qm(se)||eg(se)))}al(P),y.on("openchange",G);const K=T.createElement("span");return K.setAttribute("tabindex","-1"),K.setAttribute("aria-hidden","true"),Object.assign(K.style,Sd),V&&x&&x.insertAdjacentElement("afterend",K),()=>{y.off("openchange",G);const X=fo(T),Z=It(S,X)||A&&Ar(A.nodesRef.current,m).some(se=>{var ce;return It((ce=se.context)==null?void 0:ce.elements.floating,X)});(Z||I&&["click","mousedown"].includes(I.type))&&h.domReference.current&&al(h.domReference.current);const M=typeof E.current=="boolean"?hp()||K:E.current.current||K;queueMicrotask(()=>{E.current&&!R.current&&Ct(M)&&(M===X||X===T.body||Z)&&M.focus({preventScroll:D}),K.remove()})}},[o,S,L,E,b,h,y,A,m,V,x]),J.useEffect(()=>{queueMicrotask(()=>{R.current=!1})},[o]),dt(()=>{if(!o&&j)return j.setFocusManagerState({modal:u,closeOnFocusOut:f,open:p,onOpenChange:g,refs:h}),()=>{j.setFocusManagerState(null)}},[o,j,u,p,g,h,f]),dt(()=>{if(o||!L||typeof MutationObserver!="function"||w)return;const D=()=>{const P=L.getAttribute("tabindex"),I=H(),G=fo(Ft(S)),K=I.indexOf(G);K!==-1&&(z.current=K),_.current.includes("floating")||G!==h.domReference.current&&I.length===0?P!=="0"&&L.setAttribute("tabindex","0"):P!=="-1"&&L.setAttribute("tabindex","-1")};D();const T=new MutationObserver(D);return T.observe(L,{childList:!0,subtree:!0,attributes:!0}),()=>{T.disconnect()}},[o,S,L,h,_,H,w]);const Y=!o&&O&&(!u||!C)&&(V||u);return J.createElement(J.Fragment,null,Y&&J.createElement(pp,{"data-type":"inside",ref:j==null?void 0:j.beforeInsideRef,onFocus:D=>{if(u){const P=W();Po(r[0]==="reference"?P[0]:P[P.length-1])}else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(R.current=!1,dp(D,j.portalNode)){const P=up(document.body,"next")||x;P==null||P.focus()}else{var T;(T=j.beforeOutsideRef.current)==null||T.focus()}}}),!C&&U("start"),n,U("end"),Y&&J.createElement(pp,{"data-type":"inside",ref:j==null?void 0:j.afterInsideRef,onFocus:D=>{if(u)Po(W()[0]);else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(f&&(R.current=!0),dp(D,j.portalNode)){const P=up(document.body,"prev")||x;P==null||P.focus()}else{var T;(T=j.afterOutsideRef.current)==null||T.focus()}}}))}function mp(e){return Ct(e.target)&&e.target.tagName==="BUTTON"}function gp(e){return ng(e)}const Hx={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Bx={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},yp=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null&&t,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)==null||n}};function zx(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=lu(),i=J.useRef({}),[a]=J.useState(()=>bg()),s=Bo()!=null;if(process.env.NODE_ENV!=="production"){const h=o.reference;h&&!at(h)&&function(){for(var m,g=arguments.length,y=new Array(g),b=0;b<g;b++)y[b]=arguments[b];const k="Floating UI: "+y.join(" ");var x;(m=ua)!=null&&m.has(k)||((x=ua)==null||x.add(k),console.error(k))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,u]=J.useState(o.reference),d=Yt((h,m,g)=>{i.current.openEvent=h?m:void 0,a.emit("openchange",{open:h,event:m,reason:g,nested:s}),n==null||n(h,m,g)}),f=J.useMemo(()=>({setPositionReference:u}),[]),p=J.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return J.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:p,events:a,floatingId:r,refs:f}),[t,d,p,a,r,f])}function Fx(e){e===void 0&&(e={});const{nodeId:t}=e,n=zx({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,a]=J.useState(null),[s,c]=J.useState(null),u=(r==null?void 0:r.domReference)||i,d=J.useRef(null),f=zo();dt(()=>{u&&(d.current=u)},[u]);const p=function(k){k===void 0&&(k={});const{placement:x="bottom",strategy:S="absolute",middleware:w=[],platform:C,elements:{reference:O,floating:_}={},transform:N=!0,whileElementsMounted:E,open:A}=k,[j,B]=J.useState({x:0,y:0,strategy:S,placement:x,middlewareData:{},isPositioned:!1}),[$,R]=J.useState(w);Ds($,w)||R(w);const[F,z]=J.useState(null),[V,L]=J.useState(null),H=J.useCallback(be=>{be!==D.current&&(D.current=be,z(be))},[]),W=J.useCallback(be=>{be!==T.current&&(T.current=be,L(be))},[]),U=O||F,Y=_||V,D=J.useRef(null),T=J.useRef(null),P=J.useRef(j),I=E!=null,G=tl(E),K=tl(C),X=tl(A),Z=J.useCallback(()=>{if(!D.current||!T.current)return;const be={placement:x,strategy:S,middleware:$};K.current&&(be.platform=K.current),Cx(D.current,T.current,be).then(Ee=>{const ne={...Ee,isPositioned:X.current!==!1};M.current&&!Ds(P.current,ne)&&(P.current=ne,Im.flushSync(()=>{B(ne)}))})},[$,x,S,K,X]);ys(()=>{A===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,B(be=>({...be,isPositioned:!1})))},[A]);const M=J.useRef(!1);ys(()=>(M.current=!0,()=>{M.current=!1}),[]),ys(()=>{if(U&&(D.current=U),Y&&(T.current=Y),U&&Y){if(G.current)return G.current(U,Y,Z);Z()}},[U,Y,Z,G,I]);const se=J.useMemo(()=>({reference:D,floating:T,setReference:H,setFloating:W}),[H,W]),ce=J.useMemo(()=>({reference:U,floating:Y}),[U,Y]),ge=J.useMemo(()=>{const be={position:S,left:0,top:0};if(!ce.floating)return be;const Ee=op(ce.floating,j.x),ne=op(ce.floating,j.y);return N?{...be,transform:"translate("+Ee+"px, "+ne+"px)",...mg(ce.floating)>=1.5&&{willChange:"transform"}}:{position:S,left:Ee,top:ne}},[S,N,ce.floating,j.x,j.y]);return J.useMemo(()=>({...j,update:Z,refs:se,elements:ce,floatingStyles:ge}),[j,Z,se,ce,ge])}({...e,elements:{...r,...s&&{reference:s}}}),h=J.useCallback(k=>{const x=at(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;c(x),p.refs.setReference(x)},[p.refs]),m=J.useCallback(k=>{(at(k)||k===null)&&(d.current=k,a(k)),(at(p.refs.reference.current)||p.refs.reference.current===null||k!==null&&!at(k))&&p.refs.setReference(k)},[p.refs]),g=J.useMemo(()=>({...p.refs,setReference:m,setPositionReference:h,domReference:d}),[p.refs,m,h]),y=J.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),b=J.useMemo(()=>({...p,...o,refs:g,elements:y,nodeId:t}),[p,g,y,t,o]);return dt(()=>{o.dataRef.current.floatingContext=b;const k=f==null?void 0:f.nodesRef.current.find(x=>x.id===t);k&&(k.context=b)}),J.useMemo(()=>({...p,context:b,refs:g,elements:y}),[p,g,y,b])}const vp="active",wp="selected";function sl(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[vp]:a,[wp]:s,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1,[uu]:""},...i,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(c=>{let[u,d]=c;var f;r&&[vp,wp].includes(u)||(u.indexOf("on")===0?(o.has(u)||o.set(u,[]),typeof d=="function"&&((f=o.get(u))==null||f.push(d),a[u]=function(){for(var p,h=arguments.length,m=new Array(h),g=0;g<h;g++)m[g]=arguments[g];return(p=o.get(u))==null?void 0:p.map(y=>y(...m)).find(y=>y!==void 0)})):a[u]=d)}),a),{})}}let bp=!1;function yc(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function xp(e,t){return yc(t,e===kd||e===ta,e===Io||e===Ro)}function cl(e,t,n){return yc(t,e===ta,n?e===Io:e===Ro)||e==="Enter"||e===" "||e===""}function kp(e,t,n){return yc(t,n?e===Ro:e===Io,e===kd)}function Wx(e,t){const{open:n,onOpenChange:o,elements:r}=e,{listRef:i,activeIndex:a,onNavigate:s=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:p=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:k,orientation:x="vertical",cols:S=1,scrollItemIntoView:w=!0,virtualItemRef:C,itemSizes:O,dense:_=!1}=t;process.env.NODE_ENV!=="production"&&(d&&(f||ol("`useListNavigation` looping must be enabled to allow escaping."),m||ol("`useListNavigation` must be virtual to allow escaping.")),x==="vertical"&&S>1&&ol("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const N=Tn(Cg(r.floating)),E=Bo(),A=zo(),j=Yt(s),B=iu(r.domReference),$=J.useRef(g),R=J.useRef(u??-1),F=J.useRef(null),z=J.useRef(!0),V=J.useRef(j),L=J.useRef(!!r.floating),H=J.useRef(n),W=J.useRef(!1),U=J.useRef(!1),Y=Tn(k),D=Tn(n),T=Tn(w),P=Tn(u),[I,G]=J.useState(),[K,X]=J.useState(),Z=Yt(function(ne,oe,te){function Se(le){m?(G(le.id),A==null||A.events.emit("virtualfocus",le),C&&(C.current=le)):Po(le,{preventScroll:!0,sync:!(!Ym().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!tg())&&(bp||W.current)})}te===void 0&&(te=!1);const Te=ne.current[oe.current];Te&&Se(Te),requestAnimationFrame(()=>{const le=ne.current[oe.current]||Te;if(!le)return;Te||Se(le);const Re=T.current;Re&&se&&(te||!z.current)&&(le.scrollIntoView==null||le.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))})});dt(()=>{document.createElement("div").focus({get preventScroll(){return bp=!0,!1}})},[]),dt(()=>{c&&(n&&r.floating?$.current&&u!=null&&(U.current=!0,R.current=u,j(u)):L.current&&(R.current=-1,V.current(null)))},[c,n,r.floating,u,j]),dt(()=>{if(c&&n&&r.floating)if(a==null){if(W.current=!1,P.current!=null)return;if(L.current&&(R.current=-1,Z(i,R)),(!H.current||!L.current)&&$.current&&(F.current!=null||$.current===!0&&F.current==null)){let ne=0;const oe=()=>{i.current[0]==null?(ne<2&&(ne?requestAnimationFrame:queueMicrotask)(oe),ne++):(R.current=F.current==null||cl(F.current,x,h)||p?nl(i,Y.current):rp(i,Y.current),F.current=null,j(R.current))};oe()}}else Li(i,a)||(R.current=a,Z(i,R,U.current),U.current=!1)},[c,n,r.floating,a,P,p,i,x,h,j,Z,Y]),dt(()=>{var ne;if(!c||r.floating||!A||m||!L.current)return;const oe=A.nodesRef.current,te=(ne=oe.find(le=>le.id===E))==null||(ne=ne.context)==null?void 0:ne.elements.floating,Se=fo(Ft(r.floating)),Te=oe.some(le=>le.context&&It(le.context.elements.floating,Se));te&&!Te&&z.current&&te.focus({preventScroll:!0})},[c,r.floating,A,E,m]),dt(()=>{if(c&&A&&m&&!E)return A.events.on("virtualfocus",ne),()=>{A.events.off("virtualfocus",ne)};function ne(oe){X(oe.id),C&&(C.current=oe)}},[c,A,m,E,C]),dt(()=>{V.current=j,L.current=!!r.floating}),dt(()=>{n||(F.current=null)},[n]),dt(()=>{H.current=n},[n]);const M=a!=null,se=J.useMemo(()=>{function ne(oe){if(!n)return;const te=i.current.indexOf(oe);te!==-1&&j(te)}return{onFocus(oe){let{currentTarget:te}=oe;ne(te)},onClick:oe=>{let{currentTarget:te}=oe;return te.focus({preventScroll:!0})},...y&&{onMouseMove(oe){let{currentTarget:te}=oe;ne(te)},onPointerLeave(oe){let{pointerType:te}=oe;z.current&&te!=="touch"&&(R.current=-1,Z(i,R),j(null),m||Po(N.current,{preventScroll:!0}))}}}},[n,N,Z,y,i,j,m]),ce=Yt(ne=>{if(z.current=!1,W.current=!0,ne.which===229||!D.current&&ne.currentTarget===N.current)return;if(p&&kp(ne.key,x,h))return Gt(ne),o(!1,ne.nativeEvent,"list-navigation"),void(Ct(r.domReference)&&(m?A==null||A.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const oe=R.current,te=nl(i,k),Se=rp(i,k);if(B||(ne.key==="Home"&&(Gt(ne),R.current=te,j(R.current)),ne.key==="End"&&(Gt(ne),R.current=Se,j(R.current))),S>1){const Te=O||Array.from({length:i.current.length},()=>({width:1,height:1})),le=function(_e,Pe,$e){const Le=[];let de=0;return _e.forEach((ye,re)=>{let{width:ve,height:He}=ye;if(ve>Pe&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+re+" is greater than grid columns");let we=!1;for($e&&(de=0);!we;){const ie=[];for(let ee=0;ee<ve;ee++)for(let ae=0;ae<He;ae++)ie.push(de+ee+ae*Pe);de%Pe+ve<=Pe&&ie.every(ee=>Le[ee]==null)?(ie.forEach(ee=>{Le[ee]=re}),we=!0):de++}}),[...Le]}(Te,S,_),Re=le.findIndex(_e=>_e!=null&&!vs(i.current,_e,k)),Ye=le.reduce((_e,Pe,$e)=>Pe==null||vs(i.current,Pe,k)?_e:$e,-1),st=le[function(_e,Pe){let{event:$e,orientation:Le,loop:de,rtl:ye,cols:re,disabledIndices:ve,minIndex:He,maxIndex:we,prevIndex:ie,stopEvent:ee=!1}=Pe,ae=ie;if($e.key===kd){if(ee&&Gt($e),ie===-1)ae=we;else if(ae=zt(_e,{startingIndex:ae,amount:re,decrement:!0,disabledIndices:ve}),de&&(ie-re<He||ae<0)){const me=ie%re,De=we%re,je=we-(De-me);ae=De===me?we:De>me?je:je-re}Li(_e,ae)&&(ae=ie)}if($e.key===ta&&(ee&&Gt($e),ie===-1?ae=He:(ae=zt(_e,{startingIndex:ie,amount:re,disabledIndices:ve}),de&&ie+re>we&&(ae=zt(_e,{startingIndex:ie%re-re,amount:re,disabledIndices:ve}))),Li(_e,ae)&&(ae=ie)),Le==="both"){const me=Qr(ie/re);$e.key===(ye?Io:Ro)&&(ee&&Gt($e),ie%re!==re-1?(ae=zt(_e,{startingIndex:ie,disabledIndices:ve}),de&&Ka(ae,re,me)&&(ae=zt(_e,{startingIndex:ie-ie%re-1,disabledIndices:ve}))):de&&(ae=zt(_e,{startingIndex:ie-ie%re-1,disabledIndices:ve})),Ka(ae,re,me)&&(ae=ie)),$e.key===(ye?Ro:Io)&&(ee&&Gt($e),ie%re!==0?(ae=zt(_e,{startingIndex:ie,decrement:!0,disabledIndices:ve}),de&&Ka(ae,re,me)&&(ae=zt(_e,{startingIndex:ie+(re-ie%re),decrement:!0,disabledIndices:ve}))):de&&(ae=zt(_e,{startingIndex:ie+(re-ie%re),decrement:!0,disabledIndices:ve})),Ka(ae,re,me)&&(ae=ie));const De=Qr(we/re)===me;Li(_e,ae)&&(ae=de&&De?$e.key===(ye?Ro:Io)?we:zt(_e,{startingIndex:ie-ie%re-1,disabledIndices:ve}):ie)}return ae}({current:le.map(_e=>_e!=null?i.current[_e]:null)},{event:ne,orientation:x,loop:f,rtl:h,cols:S,disabledIndices:Ax([...k||i.current.map((_e,Pe)=>vs(i.current,Pe)?Pe:void 0),void 0],le),minIndex:Re,maxIndex:Ye,prevIndex:Ox(R.current>Se?te:R.current,Te,le,S,ne.key===ta?"bl":ne.key===(h?Io:Ro)?"tr":"tl"),stopEvent:!0})];if(st!=null&&(R.current=st,j(R.current)),x==="both")return}if(xp(ne.key,x)){if(Gt(ne),n&&!m&&fo(ne.currentTarget.ownerDocument)===ne.currentTarget)return R.current=cl(ne.key,x,h)?te:Se,void j(R.current);cl(ne.key,x,h)?R.current=f?oe>=Se?d&&oe!==i.current.length?-1:te:zt(i,{startingIndex:oe,disabledIndices:k}):Math.min(Se,zt(i,{startingIndex:oe,disabledIndices:k})):R.current=f?oe<=te?d&&oe!==-1?i.current.length:Se:zt(i,{startingIndex:oe,decrement:!0,disabledIndices:k}):Math.max(te,zt(i,{startingIndex:oe,decrement:!0,disabledIndices:k})),Li(i,R.current)?j(null):j(R.current)}}),ge=J.useMemo(()=>m&&n&&M&&{"aria-activedescendant":K||I},[m,n,M,K,I]),be=J.useMemo(()=>({"aria-orientation":x==="both"?void 0:x,...!iu(r.domReference)&&ge,onKeyDown:ce,onPointerMove(){z.current=!0}}),[ge,ce,r.domReference,x]),Ee=J.useMemo(()=>{function ne(oe){g==="auto"&&Qm(oe.nativeEvent)&&($.current=!0)}return{...ge,onKeyDown(oe){z.current=!1;const te=oe.key.startsWith("Arrow"),Se=["Home","End"].includes(oe.key),Te=te||Se,le=function(Le,de,ye){return yc(de,ye?Le===Io:Le===Ro,Le===ta)}(oe.key,x,h),Re=kp(oe.key,x,h),Ye=xp(oe.key,x),st=(p?le:Ye)||oe.key==="Enter"||oe.key.trim()==="";if(m&&n){const Le=A==null?void 0:A.nodesRef.current.find(ye=>ye.parentId==null),de=A&&Le?function(ye,re){let ve,He=-1;return function we(ie,ee){ee>He&&(ve=ie,He=ee),Ar(ye,ie).forEach(ae=>{we(ae.id,ee+1)})}(re,0),ye.find(we=>we.id===ve)}(A.nodesRef.current,Le.id):null;if(Te&&de&&C){const ye=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(le||Re){var _e,Pe;const re=((_e=de.context)==null?void 0:_e.elements.domReference)===oe.currentTarget,ve=Re&&!re?(Pe=de.context)==null?void 0:Pe.elements.domReference:le?i.current.find(He=>(He==null?void 0:He.id)===I):null;ve&&(Gt(oe),ve.dispatchEvent(ye),X(void 0))}var $e;if((Ye||Se)&&de.context&&de.context.open&&de.parentId&&oe.currentTarget!==de.context.elements.domReference)return Gt(oe),void(($e=de.context.elements.domReference)==null||$e.dispatchEvent(ye))}return ce(oe)}(n||b||!te)&&(st&&(F.current=p&&Ye?null:oe.key),p?le&&(Gt(oe),n?(R.current=nl(i,Y.current),j(R.current)):o(!0,oe.nativeEvent,"list-navigation")):Ye&&(u!=null&&(R.current=u),Gt(oe),!n&&b?o(!0,oe.nativeEvent,"list-navigation"):ce(oe),n&&j(R.current)))},onFocus(){n&&!m&&j(null)},onPointerDown:function(oe){$.current=g,g==="auto"&&eg(oe.nativeEvent)&&($.current=!0)},onMouseDown:ne,onClick:ne}},[I,ge,ce,Y,g,i,p,j,o,n,b,x,h,u,A,m,C]);return J.useMemo(()=>c?{reference:Ee,floating:be,item:se}:{},[c,Ee,be,se])}const Ux=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Sp(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let a=0,s=i-1;a<i;s=a++){const[c,u]=t[a]||[0,0],[d,f]=t[s]||[0,0];u>=o!=f>=o&&n<=(d-c)*(o-u)/(f-u)+c&&(r=!r)}return r}function Vx(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let r,i=!1,a=null,s=null,c=performance.now();const u=d=>{let{x:f,y:p,placement:h,elements:m,onClose:g,nodeId:y,tree:b}=d;return function(k){function x(){clearTimeout(r),g()}if(clearTimeout(r),!m.domReference||!m.floating||h==null||f==null||p==null)return;const{clientX:S,clientY:w}=k,C=[S,w],O=To(k),_=k.type==="mouseleave",N=It(m.floating,O),E=It(m.domReference,O),A=m.domReference.getBoundingClientRect(),j=m.floating.getBoundingClientRect(),B=h.split("-")[0],$=f>j.right-j.width/2,R=p>j.bottom-j.height/2,F=function(D,T){return D[0]>=T.x&&D[0]<=T.x+T.width&&D[1]>=T.y&&D[1]<=T.y+T.height}(C,A),z=j.width>A.width,V=j.height>A.height,L=(z?A:j).left,H=(z?A:j).right,W=(V?A:j).top,U=(V?A:j).bottom;if(N&&(i=!0,!_))return;if(E&&(i=!1),E&&!_)return void(i=!0);if(_&&at(k.relatedTarget)&&It(m.floating,k.relatedTarget)||b&&Ar(b.nodesRef.current,y).some(D=>{let{context:T}=D;return T==null?void 0:T.open}))return;if(B==="top"&&p>=A.bottom-1||B==="bottom"&&p<=A.top+1||B==="left"&&f>=A.right-1||B==="right"&&f<=A.left+1)return x();let Y=[];switch(B){case"top":Y=[[L,A.top+1],[L,j.bottom-1],[H,j.bottom-1],[H,A.top+1]];break;case"bottom":Y=[[L,j.top+1],[L,A.bottom-1],[H,A.bottom-1],[H,j.top+1]];break;case"left":Y=[[j.right-1,U],[j.right-1,W],[A.left+1,W],[A.left+1,U]];break;case"right":Y=[[A.right-1,U],[A.right-1,W],[j.left+1,W],[j.left+1,U]]}if(!Sp([S,w],Y)){if(i&&!F)return x();if(!_&&o){const D=function(T,P){const I=performance.now(),G=I-c;if(a===null||s===null||G===0)return a=T,s=P,c=I,null;const K=T-a,X=P-s,Z=Math.sqrt(K*K+X*X);return a=T,s=P,c=I,Z/G}(k.clientX,k.clientY);if(D!==null&&D<.1)return x()}Sp([S,w],function(D){let[T,P]=D;switch(B){case"top":return[[z?T+t/2:$?T+4*t:T-4*t,P+t+1],[z?T-t/2:$?T+4*t:T-4*t,P+t+1],[j.left,$||z?j.bottom-t:j.top],[j.right,$?z?j.bottom-t:j.top:j.bottom-t]];case"bottom":return[[z?T+t/2:$?T+4*t:T-4*t,P-t],[z?T-t/2:$?T+4*t:T-4*t,P-t],[j.left,$||z?j.top+t:j.bottom],[j.right,$?z?j.top+t:j.bottom:j.top+t]];case"left":{const I=[T+t+1,V?P+t/2:R?P+4*t:P-4*t],G=[T+t+1,V?P-t/2:R?P+4*t:P-4*t];return[[R||V?j.right-t:j.left,j.top],[R?V?j.right-t:j.left:j.right-t,j.bottom],I,G]}case"right":return[[T-t,V?P+t/2:R?P+4*t:P-4*t],[T-t,V?P-t/2:R?P+4*t:P-4*t],[R||V?j.left+t:j.right,j.top],[R?V?j.left+t:j.right:j.left+t,j.bottom]]}}([f,p]))?!i&&o&&(r=window.setTimeout(x,40)):x()}}};return u.__options={blockPointerEvents:n},u}const du=v.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Eg=v.forwardRef(({className:e,disabled:t,children:n,...o},r)=>{const i=v.useContext(du),a=wg(),s=zo(),c=a.index===i.activeIndex,u=Q("io-dropdown-menu-item",t&&"io-dropdown-menu-item-disabled",e);return l.jsx("div",{ref:gg([a.ref,r]),role:"menuitem",className:u,tabIndex:c?0:-1,"aria-disabled":t,...o,...i.getItemProps({onClick(d){var f;if(t)return d.preventDefault(),void d.stopPropagation();(f=o.onClick)==null||f.call(o,d),i.setIsOpen(!1),s==null||s.events.emit("click")},onFocus(d){var f;t||((f=o.onFocus)==null||f.call(o,d),i.setHasFocusInside(!0))}}),children:n})});Eg.displayName="DropdownMenuItem";const fu=v.forwardRef(({className:e,variant:t="default",icon:n,iconRight:o,text:r="",disabled:i,children:a,...s},c)=>{const[u,d]=v.useState(!1),[f,p]=v.useState(!1),[h,m]=v.useState(null),g=v.useRef([]),y=v.useRef([]),b=v.useContext(du),k=zo(),x=function(){const T=lu(),P=zo(),I=Bo();return dt(()=>{const G={id:T,parentId:I};return P==null||P.addNode(G),()=>{P==null||P.removeNode(G)}},[P,T,I]),T}(),S=Bo(),w=wg(),C=S!=null,{floatingStyles:O,refs:_,context:N}=Fx({nodeId:x,open:u,onOpenChange:d,placement:C?"right-start":"bottom-start",middleware:[(E={mainAxis:C?0:4,alignmentAxis:C?-4:0},{...xx(E),options:[E,A]}),jx(),Ex()],whileElementsMounted:bx});var E,A;const j=function(T,P){P===void 0&&(P={});const{open:I,onOpenChange:G,dataRef:K,events:X,elements:Z}=T,{enabled:M=!0,delay:se=0,handleClose:ce=null,mouseOnly:ge=!1,restMs:be=0,move:Ee=!0}=P,ne=zo(),oe=Bo(),te=Tn(ce),Se=Tn(se),Te=Tn(I),le=J.useRef(),Re=J.useRef(-1),Ye=J.useRef(),st=J.useRef(-1),_e=J.useRef(!0),Pe=J.useRef(!1),$e=J.useRef(()=>{}),Le=J.useRef(!1),de=J.useCallback(()=>{var ee;const ae=(ee=K.current.openEvent)==null?void 0:ee.type;return(ae==null?void 0:ae.includes("mouse"))&&ae!=="mousedown"},[K]);J.useEffect(()=>{if(M)return X.on("openchange",ee),()=>{X.off("openchange",ee)};function ee(ae){let{open:me}=ae;me||(clearTimeout(Re.current),clearTimeout(st.current),_e.current=!0,Le.current=!1)}},[M,X]),J.useEffect(()=>{if(!M||!te.current||!I)return;function ee(me){de()&&G(!1,me,"hover")}const ae=Ft(Z.floating).documentElement;return ae.addEventListener("mouseleave",ee),()=>{ae.removeEventListener("mouseleave",ee)}},[Z.floating,I,G,M,te,de]);const ye=J.useCallback(function(ee,ae,me){ae===void 0&&(ae=!0),me===void 0&&(me="hover");const De=rl(Se.current,"close",le.current);De&&!Ye.current?(clearTimeout(Re.current),Re.current=window.setTimeout(()=>G(!1,ee,me),De)):ae&&(clearTimeout(Re.current),G(!1,ee,me))},[Se,G]),re=Yt(()=>{$e.current(),Ye.current=void 0}),ve=Yt(()=>{if(Pe.current){const ee=Ft(Z.floating).body;ee.style.pointerEvents="",ee.removeAttribute(sp),Pe.current=!1}}),He=Yt(()=>!!K.current.openEvent&&["click","mousedown"].includes(K.current.openEvent.type));J.useEffect(()=>{if(M&&at(Z.domReference)){var ee;const je=Z.domReference;return I&&je.addEventListener("mouseleave",De),(ee=Z.floating)==null||ee.addEventListener("mouseleave",De),Ee&&je.addEventListener("mousemove",ae,{once:!0}),je.addEventListener("mouseenter",ae),je.addEventListener("mouseleave",me),()=>{var ct;I&&je.removeEventListener("mouseleave",De),(ct=Z.floating)==null||ct.removeEventListener("mouseleave",De),Ee&&je.removeEventListener("mousemove",ae),je.removeEventListener("mouseenter",ae),je.removeEventListener("mouseleave",me)}}function ae(je){if(clearTimeout(Re.current),_e.current=!1,ge&&!qi(le.current)||be>0&&!rl(Se.current,"open"))return;const ct=rl(Se.current,"open",le.current);ct?Re.current=window.setTimeout(()=>{Te.current||G(!0,je,"hover")},ct):I||G(!0,je,"hover")}function me(je){if(He())return;$e.current();const ct=Ft(Z.floating);if(clearTimeout(st.current),Le.current=!1,te.current&&K.current.floatingContext){I||clearTimeout(Re.current),Ye.current=te.current({...K.current.floatingContext,tree:ne,x:je.clientX,y:je.clientY,onClose(){ve(),re(),He()||ye(je,!0,"safe-polygon")}});const on=Ye.current;return ct.addEventListener("mousemove",on),void($e.current=()=>{ct.removeEventListener("mousemove",on)})}(le.current!=="touch"||!It(Z.floating,je.relatedTarget))&&ye(je)}function De(je){He()||K.current.floatingContext&&(te.current==null||te.current({...K.current.floatingContext,tree:ne,x:je.clientX,y:je.clientY,onClose(){ve(),re(),He()||ye(je)}})(je))}},[Z,M,T,ge,be,Ee,ye,re,ve,G,I,Te,ne,Se,te,K,He]),dt(()=>{var ee;if(M&&I&&(ee=te.current)!=null&&ee.__options.blockPointerEvents&&de()){Pe.current=!0;const me=Z.floating;if(at(Z.domReference)&&me){var ae;const De=Ft(Z.floating).body;De.setAttribute(sp,"");const je=Z.domReference,ct=ne==null||(ae=ne.nodesRef.current.find(on=>on.id===oe))==null||(ae=ae.context)==null?void 0:ae.elements.floating;return ct&&(ct.style.pointerEvents=""),De.style.pointerEvents="none",je.style.pointerEvents="auto",me.style.pointerEvents="auto",()=>{De.style.pointerEvents="",je.style.pointerEvents="",me.style.pointerEvents=""}}}},[M,I,oe,Z,ne,te,de]),dt(()=>{I||(le.current=void 0,Le.current=!1,re(),ve())},[I,re,ve]),J.useEffect(()=>()=>{re(),clearTimeout(Re.current),clearTimeout(st.current),ve()},[M,Z.domReference,re,ve]);const we=J.useMemo(()=>{function ee(ae){le.current=ae.pointerType}return{onPointerDown:ee,onPointerEnter:ee,onMouseMove(ae){const{nativeEvent:me}=ae;function De(){_e.current||Te.current||G(!0,me,"hover")}ge&&!qi(le.current)||I||be===0||Le.current&&ae.movementX**2+ae.movementY**2<2||(clearTimeout(st.current),le.current==="touch"?De():(Le.current=!0,st.current=window.setTimeout(De,be)))}}},[ge,G,I,Te,be]),ie=J.useMemo(()=>({onMouseEnter(){clearTimeout(Re.current)},onMouseLeave(ee){He()||ye(ee.nativeEvent,!1)}}),[ye,He]);return J.useMemo(()=>M?{reference:we,floating:ie}:{},[M,we,ie])}(N,{enabled:C,delay:{open:75},handleClose:Vx({blockPointerEvents:!0})}),B=function(T,P){P===void 0&&(P={});const{open:I,onOpenChange:G,dataRef:K,elements:{domReference:X}}=T,{enabled:Z=!0,event:M="click",toggle:se=!0,ignoreMouse:ce=!1,keyboardHandlers:ge=!0,stickIfOpen:be=!0}=P,Ee=J.useRef(),ne=J.useRef(!1),oe=J.useMemo(()=>({onPointerDown(te){Ee.current=te.pointerType},onMouseDown(te){const Se=Ee.current;te.button===0&&M!=="click"&&(qi(Se,!0)&&ce||(!I||!se||K.current.openEvent&&be&&K.current.openEvent.type!=="mousedown"?(te.preventDefault(),G(!0,te.nativeEvent,"click")):G(!1,te.nativeEvent,"click")))},onClick(te){const Se=Ee.current;M==="mousedown"&&Ee.current?Ee.current=void 0:qi(Se,!0)&&ce||(!I||!se||K.current.openEvent&&be&&K.current.openEvent.type!=="click"?G(!0,te.nativeEvent,"click"):G(!1,te.nativeEvent,"click"))},onKeyDown(te){Ee.current=void 0,te.defaultPrevented||!ge||mp(te)||(te.key!==" "||gp(X)||(te.preventDefault(),ne.current=!0),te.key==="Enter"&&G(!I||!se,te.nativeEvent,"click"))},onKeyUp(te){te.defaultPrevented||!ge||mp(te)||gp(X)||te.key===" "&&ne.current&&(ne.current=!1,G(!I||!se,te.nativeEvent,"click"))}}),[K,X,M,ce,ge,G,I,be,se]);return J.useMemo(()=>Z?{reference:oe}:{},[Z,oe])}(N,{event:"mousedown",toggle:!C,ignoreMouse:C}),$=function(T,P){var I;P===void 0&&(P={});const{open:G,floatingId:K}=T,{enabled:X=!0,role:Z="dialog"}=P,M=(I=Ux.get(Z))!=null?I:Z,se=lu(),ce=Bo()!=null,ge=J.useMemo(()=>M==="tooltip"||Z==="label"?{["aria-"+(Z==="label"?"labelledby":"describedby")]:G?K:void 0}:{"aria-expanded":G?"true":"false","aria-haspopup":M==="alertdialog"?"dialog":M,"aria-controls":G?K:void 0,...M==="listbox"&&{role:"combobox"},...M==="menu"&&{id:se},...M==="menu"&&ce&&{role:"menuitem"},...Z==="select"&&{"aria-autocomplete":"none"},...Z==="combobox"&&{"aria-autocomplete":"list"}},[M,K,ce,G,se,Z]),be=J.useMemo(()=>{const ne={id:K,...M&&{role:M}};return M==="tooltip"||Z==="label"?ne:{...ne,...M==="menu"&&{"aria-labelledby":se}}},[M,K,se,Z]),Ee=J.useCallback(ne=>{let{active:oe,selected:te}=ne;const Se={role:"option",...oe&&{id:K+"-option"}};switch(Z){case"select":return{...Se,"aria-selected":oe&&te};case"combobox":return{...Se,...oe&&{"aria-selected":!0}}}return{}},[K,Z]);return J.useMemo(()=>X?{reference:ge,floating:be,item:Ee}:{},[X,ge,be,Ee])}(N,{role:"menu"}),R=function(T,P){P===void 0&&(P={});const{open:I,onOpenChange:G,elements:K,dataRef:X}=T,{enabled:Z=!0,escapeKey:M=!0,outsidePress:se=!0,outsidePressEvent:ce="pointerdown",referencePress:ge=!1,referencePressEvent:be="pointerdown",ancestorScroll:Ee=!1,bubbles:ne,capture:oe}=P,te=zo(),Se=Yt(typeof se=="function"?se:()=>!1),Te=typeof se=="function"?Se:se,le=J.useRef(!1),Re=J.useRef(!1),{escapeKey:Ye,outsidePress:st}=yp(ne),{escapeKey:_e,outsidePress:Pe}=yp(oe),$e=J.useRef(!1),Le=Yt(we=>{var ie;if(!I||!Z||!M||we.key!=="Escape"||$e.current)return;const ee=(ie=X.current.floatingContext)==null?void 0:ie.nodeId,ae=te?Ar(te.nodesRef.current,ee):[];if(!Ye&&(we.stopPropagation(),ae.length>0)){let me=!0;if(ae.forEach(De=>{var je;(je=De.context)==null||!je.open||De.context.dataRef.current.__escapeKeyBubbles||(me=!1)}),!me)return}G(!1,function(me){return"nativeEvent"in me}(we)?we.nativeEvent:we,"escape-key")}),de=Yt(we=>{var ie;const ee=()=>{var ae;Le(we),(ae=To(we))==null||ae.removeEventListener("keydown",ee)};(ie=To(we))==null||ie.addEventListener("keydown",ee)}),ye=Yt(we=>{var ie;const ee=le.current;le.current=!1;const ae=Re.current;if(Re.current=!1,ce==="click"&&ae||ee||typeof Te=="function"&&!Te(we))return;const me=To(we),De="["+da("inert")+"]",je=Ft(K.floating).querySelectorAll(De);let ct=at(me)?me:null;for(;ct&&!Ko(ct);){const Ht=ho(ct);if(Ko(Ht)||!at(Ht))break;ct=Ht}if(je.length&&at(me)&&!me.matches("html,body")&&!It(me,K.floating)&&Array.from(je).every(Ht=>!It(ct,Ht)))return;if(Ct(me)&&He){const Ht=me.clientWidth>0&&me.scrollWidth>me.clientWidth,Bt=me.clientHeight>0&&me.scrollHeight>me.clientHeight;let io=Bt&&we.offsetX>me.clientWidth;if(Bt&&bn(me).direction==="rtl"&&(io=we.offsetX<=me.offsetWidth-me.clientWidth),io||Ht&&we.offsetY>me.clientHeight)return}const on=(ie=X.current.floatingContext)==null?void 0:ie.nodeId,Ii=te&&Ar(te.nodesRef.current,on).some(Ht=>{var Bt;return Qc(we,(Bt=Ht.context)==null?void 0:Bt.elements.floating)});if(Qc(we,K.floating)||Qc(we,K.domReference)||Ii)return;const ur=te?Ar(te.nodesRef.current,on):[];if(ur.length>0){let Ht=!0;if(ur.forEach(Bt=>{var io;(io=Bt.context)==null||!io.open||Bt.context.dataRef.current.__outsidePressBubbles||(Ht=!1)}),!Ht)return}G(!1,we,"outside-press")}),re=Yt(we=>{var ie;const ee=()=>{var ae;ye(we),(ae=To(we))==null||ae.removeEventListener(ce,ee)};(ie=To(we))==null||ie.addEventListener(ce,ee)});J.useEffect(()=>{if(!I||!Z)return;X.current.__escapeKeyBubbles=Ye,X.current.__outsidePressBubbles=st;let we=-1;function ie(je){G(!1,je,"ancestor-scroll")}function ee(){window.clearTimeout(we),$e.current=!0}function ae(){we=window.setTimeout(()=>{$e.current=!1},pc()?5:0)}const me=Ft(K.floating);M&&(me.addEventListener("keydown",_e?de:Le,_e),me.addEventListener("compositionstart",ee),me.addEventListener("compositionend",ae)),Te&&me.addEventListener(ce,Pe?re:ye,Pe);let De=[];return Ee&&(at(K.domReference)&&(De=Go(K.domReference)),at(K.floating)&&(De=De.concat(Go(K.floating))),!at(K.reference)&&K.reference&&K.reference.contextElement&&(De=De.concat(Go(K.reference.contextElement)))),De=De.filter(je=>{var ct;return je!==((ct=me.defaultView)==null?void 0:ct.visualViewport)}),De.forEach(je=>{je.addEventListener("scroll",ie,{passive:!0})}),()=>{M&&(me.removeEventListener("keydown",_e?de:Le,_e),me.removeEventListener("compositionstart",ee),me.removeEventListener("compositionend",ae)),Te&&me.removeEventListener(ce,Pe?re:ye,Pe),De.forEach(je=>{je.removeEventListener("scroll",ie)}),window.clearTimeout(we)}},[X,K,M,Te,ce,I,G,Ee,Z,Ye,st,Le,_e,de,ye,Pe,re]),J.useEffect(()=>{le.current=!1},[Te,ce]);const ve=J.useMemo(()=>({onKeyDown:Le,[Hx[be]]:we=>{ge&&G(!1,we.nativeEvent,"reference-press")}}),[Le,G,ge,be]),He=J.useMemo(()=>({onKeyDown:Le,onMouseDown(){Re.current=!0},onMouseUp(){Re.current=!0},[Bx[ce]]:()=>{le.current=!0}}),[Le,ce]);return J.useMemo(()=>Z?{reference:ve,floating:He}:{},[Z,ve,He])}(N,{bubbles:!0}),F=Wx(N,{listRef:g,activeIndex:h,nested:C,onNavigate:m}),{getReferenceProps:z,getFloatingProps:V,getItemProps:L}=function(T){T===void 0&&(T=[]);const P=T.map(M=>M==null?void 0:M.reference),I=T.map(M=>M==null?void 0:M.floating),G=T.map(M=>M==null?void 0:M.item),K=J.useCallback(M=>sl(M,T,"reference"),P),X=J.useCallback(M=>sl(M,T,"floating"),I),Z=J.useCallback(M=>sl(M,T,"item"),G);return J.useMemo(()=>({getReferenceProps:K,getFloatingProps:X,getItemProps:Z}),[K,X,Z])}([j,B,$,R,F]);v.useEffect(()=>{if(k)return k.events.on("click",T),k.events.on("menuopen",P),()=>{k.events.off("click",T),k.events.off("menuopen",P)};function T(){d(!1)}function P(I){I.nodeId!==x&&I.parentId===S&&d(!1)}},[k,x,S]),v.useEffect(()=>{u&&k&&k.events.emit("menuopen",{parentId:S,nodeId:x})},[k,u,x,S]);const H={activeIndex:h,setActiveIndex:m,getItemProps:L,setHasFocusInside:p,isOpen:u,setIsOpen:d},W=v.useMemo(()=>H,[h,m,L,p,u]),U=Q("io-dropdown-menu-button",C&&"io-dropdown-menu-item",u&&!C&&"active",e),Y=gg([_.setReference,w.ref,c]),D=b.activeIndex===w.index?0:-1;return l.jsxs(Ix,{id:x,children:[l.jsx(tt,{className:U,ref:Y,variant:C?"link":t,tabIndex:C?D:void 0,role:C?"menuitem":void 0,"data-open":u?"":void 0,"data-nested":C?"":void 0,"data-focus-inside":f?"":void 0,text:r,icon:C?"chevron-right":n,iconSize:"10",iconRight:!!C||o,disabled:i,...z(b.getItemProps({onFocus(T){var P;(P=s.onFocus)==null||P.call(s,T),p(!1),b.setHasFocusInside(!0)},...s}))}),l.jsx(du.Provider,{value:W,children:l.jsx(Nx,{elementsRef:g,labelsRef:y,children:u&&l.jsx($x,{context:N,modal:!1,initialFocus:C?-1:0,returnFocus:!C,children:l.jsx("div",{ref:_.setFloating,className:"io-dropdown-menu",style:O,...V(),children:a})})})})]})});fu.displayName="DropdownMenu";const In=v.forwardRef(({...e},t)=>Bo()===null?l.jsx(Rx,{children:l.jsx(fu,{ref:t,...e})}):l.jsx(fu,{ref:t,...e}));In.displayName="DropdownMenu",In.Item=Eg,In.Separator=wo;var Cp=function(e){return e.reduce(function(t,n){var o=n[0],r=n[1];return t[o]=r,t},{})},Ep=typeof window<"u"&&window.document&&window.document.createElement?J.useLayoutEffect:J.useEffect,tn="top",xn="bottom",kn="right",nn="left",pu="auto",ja=[tn,xn,kn,nn],mi="start",fa="end",jg="viewport",Di="popper",jp=ja.reduce(function(e,t){return e.concat([t+"-"+mi,t+"-"+fa])},[]),_g=[].concat(ja,[pu]).reduce(function(e,t){return e.concat([t,t+"-"+mi,t+"-"+fa])},[]),Kx=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Yn(e){return e?(e.nodeName||"").toLowerCase():null}function hn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Lr(e){return e instanceof hn(e).Element||e instanceof Element}function wn(e){return e instanceof hn(e).HTMLElement||e instanceof HTMLElement}function Cd(e){return typeof ShadowRoot<"u"&&(e instanceof hn(e).ShadowRoot||e instanceof ShadowRoot)}var Gx={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var o=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];wn(i)&&Yn(i)&&(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var s=r[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(o){var r=t.elements[o],i=t.attributes[o]||{},a=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:n[o]).reduce(function(s,c){return s[c]="",s},{});wn(r)&&Yn(r)&&(Object.assign(r.style,a),Object.keys(i).forEach(function(s){r.removeAttribute(s)}))})}},requires:["computeStyles"]};function Gn(e){return e.split("-")[0]}var Pr=Math.max,Hs=Math.min,gi=Math.round;function hu(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Og(){return!/^((?!chrome|android).)*safari/i.test(hu())}function yi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&wn(e)&&(r=e.offsetWidth>0&&gi(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&gi(o.height)/e.offsetHeight||1);var a=(Lr(e)?hn(e):window).visualViewport,s=!Og()&&n,c=(o.left+(s&&a?a.offsetLeft:0))/r,u=(o.top+(s&&a?a.offsetTop:0))/i,d=o.width/r,f=o.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Ed(e){var t=yi(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function Ag(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Cd(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function mo(e){return hn(e).getComputedStyle(e)}function qx(e){return["table","td","th"].indexOf(Yn(e))>=0}function qo(e){return((Lr(e)?e.ownerDocument:e.document)||window.document).documentElement}function vc(e){return Yn(e)==="html"?e:e.assignedSlot||e.parentNode||(Cd(e)?e.host:null)||qo(e)}function _p(e){return wn(e)&&mo(e).position!=="fixed"?e.offsetParent:null}function _a(e){for(var t=hn(e),n=_p(e);n&&qx(n)&&mo(n).position==="static";)n=_p(n);return n&&(Yn(n)==="html"||Yn(n)==="body"&&mo(n).position==="static")?t:n||function(o){var r=/firefox/i.test(hu());if(/Trident/i.test(hu())&&wn(o)&&mo(o).position==="fixed")return null;var i=vc(o);for(Cd(i)&&(i=i.host);wn(i)&&["html","body"].indexOf(Yn(i))<0;){var a=mo(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||r&&a.willChange==="filter"||r&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}(e)||t}function jd(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ji(e,t,n){return Pr(e,Hs(t,n))}function Pg(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Ng(e,t){return t.reduce(function(n,o){return n[o]=e,n},{})}var Jx={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Gn(n.placement),c=jd(s),u=[nn,kn].indexOf(s)>=0?"height":"width";if(i&&a){var d=function(_,N){return Pg(typeof(_=typeof _=="function"?_(Object.assign({},N.rects,{placement:N.placement})):_)!="number"?_:Ng(_,ja))}(r.padding,n),f=Ed(i),p=c==="y"?tn:nn,h=c==="y"?xn:kn,m=n.rects.reference[u]+n.rects.reference[c]-a[c]-n.rects.popper[u],g=a[c]-n.rects.reference[c],y=_a(i),b=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,k=m/2-g/2,x=d[p],S=b-f[u]-d[h],w=b/2-f[u]/2+k,C=Ji(x,w,S),O=c;n.modifiersData[o]=((t={})[O]=C,t.centerOffset=C-w,t)}},effect:function(e){var t=e.state,n=e.options.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o!="string"||(o=t.elements.popper.querySelector(o)))&&Ag(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vi(e){return e.split("-")[1]}var Zx={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Op(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,g=m===void 0?0:m,y=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var b=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),x=nn,S=tn,w=window;if(u){var C=_a(n),O="clientHeight",_="clientWidth";C===hn(n)&&mo(C=qo(n)).position!=="static"&&s==="absolute"&&(O="scrollHeight",_="scrollWidth"),(r===tn||(r===nn||r===kn)&&i===fa)&&(S=xn,g-=(f&&C===w&&w.visualViewport?w.visualViewport.height:C[O])-o.height,g*=c?1:-1),(r===nn||(r===tn||r===xn)&&i===fa)&&(x=kn,h-=(f&&C===w&&w.visualViewport?w.visualViewport.width:C[_])-o.width,h*=c?1:-1)}var N,E=Object.assign({position:s},u&&Zx),A=d===!0?function(j,B){var $=j.x,R=j.y,F=B.devicePixelRatio||1;return{x:gi($*F)/F||0,y:gi(R*F)/F||0}}({x:h,y:g},hn(n)):{x:h,y:g};return h=A.x,g=A.y,c?Object.assign({},E,((N={})[S]=k?"0":"",N[x]=b?"0":"",N.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",N)):Object.assign({},E,((t={})[S]=k?g+"px":"",t[x]=b?h+"px":"",t.transform="",t))}var Ja={passive:!0},Yx={left:"right",right:"left",bottom:"top",top:"bottom"};function Za(e){return e.replace(/left|right|bottom|top/g,function(t){return Yx[t]})}var Xx={start:"end",end:"start"};function Ap(e){return e.replace(/start|end/g,function(t){return Xx[t]})}function _d(e){var t=hn(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function mu(e){return yi(qo(e)).left+_d(e).scrollLeft}function Od(e){var t=mo(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function Tg(e){return["html","body","#document"].indexOf(Yn(e))>=0?e.ownerDocument.body:wn(e)&&Od(e)?e:Tg(vc(e))}function na(e,t){var n;t===void 0&&(t=[]);var o=Tg(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=hn(o),a=r?[i].concat(i.visualViewport||[],Od(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(na(vc(a)))}function gu(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Pp(e,t,n){return t===jg?gu(function(o,r){var i=hn(o),a=qo(o),s=i.visualViewport,c=a.clientWidth,u=a.clientHeight,d=0,f=0;if(s){c=s.width,u=s.height;var p=Og();(p||!p&&r==="fixed")&&(d=s.offsetLeft,f=s.offsetTop)}return{width:c,height:u,x:d+mu(o),y:f}}(e,n)):Lr(t)?function(o,r){var i=yi(o,!1,r==="fixed");return i.top=i.top+o.clientTop,i.left=i.left+o.clientLeft,i.bottom=i.top+o.clientHeight,i.right=i.left+o.clientWidth,i.width=o.clientWidth,i.height=o.clientHeight,i.x=i.left,i.y=i.top,i}(t,n):gu(function(o){var r,i=qo(o),a=_d(o),s=(r=o.ownerDocument)==null?void 0:r.body,c=Pr(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=Pr(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),d=-a.scrollLeft+mu(o),f=-a.scrollTop;return mo(s||i).direction==="rtl"&&(d+=Pr(i.clientWidth,s?s.clientWidth:0)-c),{width:c,height:u,x:d,y:f}}(qo(e)))}function Qx(e,t,n,o){var r=t==="clippingParents"?function(c){var u=na(vc(c)),d=["absolute","fixed"].indexOf(mo(c).position)>=0&&wn(c)?_a(c):c;return Lr(d)?u.filter(function(f){return Lr(f)&&Ag(f,d)&&Yn(f)!=="body"}):[]}(e):[].concat(t),i=[].concat(r,[n]),a=i[0],s=i.reduce(function(c,u){var d=Pp(e,u,o);return c.top=Pr(d.top,c.top),c.right=Hs(d.right,c.right),c.bottom=Hs(d.bottom,c.bottom),c.left=Pr(d.left,c.left),c},Pp(e,a,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Ig(e){var t,n=e.reference,o=e.element,r=e.placement,i=r?Gn(r):null,a=r?vi(r):null,s=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(i){case tn:t={x:s,y:n.y-o.height};break;case xn:t={x:s,y:n.y+n.height};break;case kn:t={x:n.x+n.width,y:c};break;case nn:t={x:n.x-o.width,y:c};break;default:t={x:n.x,y:n.y}}var u=i?jd(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(a){case mi:t[u]=t[u]-(n[d]/2-o[d]/2);break;case fa:t[u]=t[u]+(n[d]/2-o[d]/2)}}return t}function pa(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=o===void 0?e.placement:o,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,c=s===void 0?"clippingParents":s,u=n.rootBoundary,d=u===void 0?jg:u,f=n.elementContext,p=f===void 0?Di:f,h=n.altBoundary,m=h!==void 0&&h,g=n.padding,y=g===void 0?0:g,b=Pg(typeof y!="number"?y:Ng(y,ja)),k=p===Di?"reference":Di,x=e.rects.popper,S=e.elements[m?k:p],w=Qx(Lr(S)?S:S.contextElement||qo(e.elements.popper),c,d,a),C=yi(e.elements.reference),O=Ig({reference:C,element:x,strategy:"absolute",placement:r}),_=gu(Object.assign({},x,O)),N=p===Di?_:C,E={top:w.top-N.top+b.top,bottom:N.bottom-w.bottom+b.bottom,left:w.left-N.left+b.left,right:N.right-w.right+b.right},A=e.modifiersData.offset;if(p===Di&&A){var j=A[r];Object.keys(E).forEach(function(B){var $=[kn,xn].indexOf(B)>=0?1:-1,R=[tn,xn].indexOf(B)>=0?"y":"x";E[B]+=j[R]*$})}return E}function e2(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?_g:c,d=vi(o),f=d?s?jp:jp.filter(function(m){return vi(m)===d}):ja,p=f.filter(function(m){return u.indexOf(m)>=0});p.length===0&&(p=f);var h=p.reduce(function(m,g){return m[g]=pa(e,{placement:g,boundary:r,rootBoundary:i,padding:a})[Gn(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}var t2={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=r===void 0||r,a=n.altAxis,s=a===void 0||a,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,m=h===void 0||h,g=n.allowedAutoPlacements,y=t.options.placement,b=Gn(y),k=c||(b===y||!m?[Za(y)]:function(W){if(Gn(W)===pu)return[];var U=Za(W);return[Ap(W),U,Ap(U)]}(y)),x=[y].concat(k).reduce(function(W,U){return W.concat(Gn(U)===pu?e2(t,{placement:U,boundary:d,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:g}):U)},[]),S=t.rects.reference,w=t.rects.popper,C=new Map,O=!0,_=x[0],N=0;N<x.length;N++){var E=x[N],A=Gn(E),j=vi(E)===mi,B=[tn,xn].indexOf(A)>=0,$=B?"width":"height",R=pa(t,{placement:E,boundary:d,rootBoundary:f,altBoundary:p,padding:u}),F=B?j?kn:nn:j?xn:tn;S[$]>w[$]&&(F=Za(F));var z=Za(F),V=[];if(i&&V.push(R[A]<=0),s&&V.push(R[F]<=0,R[z]<=0),V.every(function(W){return W})){_=E,O=!1;break}C.set(E,V)}if(O)for(var L=function(W){var U=x.find(function(Y){var D=C.get(Y);if(D)return D.slice(0,W).every(function(T){return T})});if(U)return _=U,"break"},H=m?3:1;H>0&&L(H)!=="break";H--);t.placement!==_&&(t.modifiersData[o]._skip=!0,t.placement=_,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Np(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Tp(e){return[tn,kn,xn,nn].some(function(t){return e[t]>=0})}var n2={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=r===void 0?[0,0]:r,a=_g.reduce(function(d,f){return d[f]=function(p,h,m){var g=Gn(p),y=[nn,tn].indexOf(g)>=0?-1:1,b=typeof m=="function"?m(Object.assign({},h,{placement:p})):m,k=b[0],x=b[1];return k=k||0,x=(x||0)*y,[nn,kn].indexOf(g)>=0?{x,y:k}:{x:k,y:x}}(f,t.rects,i),d},{}),s=a[t.placement],c=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[o]=a}},o2={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=r===void 0||r,a=n.altAxis,s=a!==void 0&&a,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0||p,m=n.tetherOffset,g=m===void 0?0:m,y=pa(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),b=Gn(t.placement),k=vi(t.placement),x=!k,S=jd(b),w=S==="x"?"y":"x",C=t.modifiersData.popperOffsets,O=t.rects.reference,_=t.rects.popper,N=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,E=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(C){if(i){var B,$=S==="y"?tn:nn,R=S==="y"?xn:kn,F=S==="y"?"height":"width",z=C[S],V=z+y[$],L=z-y[R],H=h?-_[F]/2:0,W=k===mi?O[F]:_[F],U=k===mi?-_[F]:-O[F],Y=t.elements.arrow,D=h&&Y?Ed(Y):{width:0,height:0},T=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},P=T[$],I=T[R],G=Ji(0,O[F],D[F]),K=x?O[F]/2-H-G-P-E.mainAxis:W-G-P-E.mainAxis,X=x?-O[F]/2+H+G+I+E.mainAxis:U+G+I+E.mainAxis,Z=t.elements.arrow&&_a(t.elements.arrow),M=Z?S==="y"?Z.clientTop||0:Z.clientLeft||0:0,se=(B=A==null?void 0:A[S])!=null?B:0,ce=z+X-se,ge=Ji(h?Hs(V,z+K-se-M):V,z,h?Pr(L,ce):L);C[S]=ge,j[S]=ge-z}if(s){var be,Ee=S==="x"?tn:nn,ne=S==="x"?xn:kn,oe=C[w],te=w==="y"?"height":"width",Se=oe+y[Ee],Te=oe-y[ne],le=[tn,nn].indexOf(b)!==-1,Re=(be=A==null?void 0:A[w])!=null?be:0,Ye=le?Se:oe-O[te]-_[te]-Re+E.altAxis,st=le?oe+O[te]+_[te]-Re-E.altAxis:Te,_e=h&&le?function(Pe,$e,Le){var de=Ji(Pe,$e,Le);return de>Le?Le:de}(Ye,oe,st):Ji(h?Ye:Se,oe,h?st:Te);C[w]=_e,j[w]=_e-oe}t.modifiersData[o]=j}},requiresIfExists:["offset"]};function r2(e,t,n){n===void 0&&(n=!1);var o,r,i=wn(t),a=wn(t)&&function(f){var p=f.getBoundingClientRect(),h=gi(p.width)/f.offsetWidth||1,m=gi(p.height)/f.offsetHeight||1;return h!==1||m!==1}(t),s=qo(t),c=yi(e,a,n),u={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(i||!i&&!n)&&((Yn(t)!=="body"||Od(s))&&(u=(o=t)!==hn(o)&&wn(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:_d(o)),wn(t)?((d=yi(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):s&&(d.x=mu(s))),{x:c.left+u.scrollLeft-d.x,y:c.top+u.scrollTop-d.y,width:c.width,height:c.height}}function i2(e){var t=new Map,n=new Set,o=[];function r(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach(function(a){if(!n.has(a)){var s=t.get(a);s&&r(s)}}),o.push(i)}return e.forEach(function(i){t.set(i.name,i)}),e.forEach(function(i){n.has(i.name)||r(i)}),o}var Ip={placement:"bottom",modifiers:[],strategy:"absolute"};function Rp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function a2(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,o=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?Ip:r;return function(a,s,c){c===void 0&&(c=i);var u,d,f={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ip,i),modifiersData:{},elements:{reference:a,popper:s},attributes:{},styles:{}},p=[],h=!1,m={state:f,setOptions:function(y){var b=typeof y=="function"?y(f.options):y;g(),f.options=Object.assign({},i,f.options,b),f.scrollParents={reference:Lr(a)?na(a):a.contextElement?na(a.contextElement):[],popper:na(s)};var k,x,S=function(w){var C=i2(w);return Kx.reduce(function(O,_){return O.concat(C.filter(function(N){return N.phase===_}))},[])}((k=[].concat(o,f.options.modifiers),x=k.reduce(function(w,C){var O=w[C.name];return w[C.name]=O?Object.assign({},O,C,{options:Object.assign({},O.options,C.options),data:Object.assign({},O.data,C.data)}):C,w},{}),Object.keys(x).map(function(w){return x[w]})));return f.orderedModifiers=S.filter(function(w){return w.enabled}),f.orderedModifiers.forEach(function(w){var C=w.name,O=w.options,_=O===void 0?{}:O,N=w.effect;if(typeof N=="function"){var E=N({state:f,name:C,instance:m,options:_}),A=function(){};p.push(E||A)}}),m.update()},forceUpdate:function(){if(!h){var y=f.elements,b=y.reference,k=y.popper;if(Rp(b,k)){f.rects={reference:r2(b,_a(k),f.options.strategy==="fixed"),popper:Ed(k)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(N){return f.modifiersData[N.name]=Object.assign({},N.data)});for(var x=0;x<f.orderedModifiers.length;x++)if(f.reset!==!0){var S=f.orderedModifiers[x],w=S.fn,C=S.options,O=C===void 0?{}:C,_=S.name;typeof w=="function"&&(f=w({state:f,options:O,name:_,instance:m})||f)}else f.reset=!1,x=-1}}},update:(u=function(){return new Promise(function(y){m.forceUpdate(),y(f)})},function(){return d||(d=new Promise(function(y){Promise.resolve().then(function(){d=void 0,y(u())})})),d}),destroy:function(){g(),h=!0}};if(!Rp(a,s))return m;function g(){p.forEach(function(y){return y()}),p=[]}return m.setOptions(c).then(function(y){!h&&c.onFirstUpdate&&c.onFirstUpdate(y)}),m}}var s2=a2({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=r===void 0||r,a=o.resize,s=a===void 0||a,c=hn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,Ja)}),s&&c.addEventListener("resize",n.update,Ja),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,Ja)}),s&&c.removeEventListener("resize",n.update,Ja)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Ig({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=o===void 0||o,i=n.adaptive,a=i===void 0||i,s=n.roundOffsets,c=s===void 0||s,u={placement:Gn(t.placement),variation:vi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Op(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Op(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Gx,n2,t2,o2,Jx,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=pa(t,{elementContext:"reference"}),s=pa(t,{altBoundary:!0}),c=Np(a,o),u=Np(s,r,i),d=Tp(c),f=Tp(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}}]}),c2=typeof Element<"u",l2=typeof Map=="function",u2=typeof Set=="function",d2=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ws(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,o,r,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(o=n;o--!==0;)if(!ws(e[o],t[o]))return!1;return!0}if(l2&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!t.has(o.value[0]))return!1;for(i=e.entries();!(o=i.next()).done;)if(!ws(o.value[1],t.get(o.value[0])))return!1;return!0}if(u2&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!t.has(o.value[0]))return!1;return!0}if(d2&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(o=n;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if((n=(r=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[o]))return!1;if(c2&&e instanceof Element)return!1;for(o=n;o--!==0;)if((r[o]!=="_owner"&&r[o]!=="__v"&&r[o]!=="__o"||!e.$$typeof)&&!ws(e[r[o]],t[r[o]]))return!1;return!0}return e!=e&&t!=t}var f2=function(e,t){try{return ws(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}},p2=Ea(f2),h2=[];function Ad({className:e,variant:t="default",size:n="16",src:o,alt:r,...i}){const a=Q("io-image-icon",t==="grayscale"&&[`io-image-icon-${t}`],n&&[`io-image-icon-${n}`],e);return l.jsx("img",{className:a,style:{width:`${n}px`,filter:t==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}const Rg=v.forwardRef((e,t)=>{const{title:n,actions:o,className:r,onClose:i,onActionItemClick:a,"data-testid":s="context-menu",...c}=e,u=v.useRef({}),[d,f]=v.useState(0),p=h=>{var m;(m=u.current[h])==null||m.focus(),f(h)};return v.useEffect(()=>{var h;(h=u.current[d])==null||h.focus()},[]),l.jsxs(vt,{ref:t,className:Q(r,"context-menu"),onClick:h=>h.stopPropagation(),onKeyDown:h=>Lm({event:h,currentIndex:d,min:0,max:o.length-1,moveFocus:p,onClose:i}),"data-testid":s,...c,children:[n&&l.jsx(vt.ItemSection,{children:n}),o.map((h,m)=>{const g=h.displayName||h.name,y=h.iconSrc?l.jsx(Ad,{size:"16",src:h.iconSrc,alt:`${g} icon`}):h.icon&&l.jsx(jt,{size:"16",variant:h.icon});return l.jsxs(v.Fragment,{children:[l.jsx(vt.Item,{ref:b=>u.current[m]=b,prepend:y,disabled:h.disabled,tabIndex:-1,...lc(b=>a(b,h)),"data-testid":`${s}-item-${h.name}`,children:g}),h.separatorAfter&&l.jsx("li",{className:"context-menu-separator","aria-hidden":!0,"data-testid":`${s}-separator`})]},h.name)})]})});Rg.displayName="ContextMenuActionsList";const Lg=()=>{const[e,t]=v.useState([]),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=s=>{const{name:c,title:u,caption:d,icon:f,userProperties:p}=s;return{id:c,name:c,title:u??c,caption:d,icon:f,userProperties:p}},r=n.appManager.onAppAdded(s=>{if(s.userProperties.hidden||"hidden"in s&&s.hidden)return;const c=o(s);t(u=>[...u,c])}),i=n.appManager.onAppChanged(s=>{if(s.userProperties.hidden||"hidden"in s&&s.hidden)return;const c=o(s);t(u=>[...u.filter(d=>d.id!==c.id),c])}),a=[r,n.appManager.onAppRemoved(s=>{const c=o(s);t(u=>u.filter(d=>d.id!==c.id))}),i];return()=>a.forEach(s=>s())},[n]),e},Pd=()=>{const[e,t]=v.useState(),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{var o,r;try{const i=(o=n.windows.my())!=null&&o.name?void 0:((r=window.workspacesManager)==null?void 0:r.getFrameId())||(()=>{if(!window.name)throw new Error("The frame id is not available because the platform is still initializing");return window.name})();t(i)}catch(i){console.error("Failed to get the current frame ID ",{error:i})}},[n,t]),e},Hr=()=>window.glue42gd!==void 0||window.glue42alert!==void 0||window.glue42dialog!==void 0||window.iodesktop!==void 0,Dg="openInNewWindow",Mg="openInNewWorkspace",$g=Hr()?[]:[{name:Dg,displayName:"Open in a new window",icon:"pop-out"},{name:Mg,displayName:"Open in a new Workspace",icon:"pop-out"}],Hg="openInNewWindow",Bg="delete",zg=[{name:Hg,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:Bg,displayName:"Delete",icon:"trash-can"}],Vn="success",nt="warning",m2={success:5e3,warning:1e4},Lo=e=>typeof e=="string"?e:e!=null&&e.message?typeof e.message=="string"?e.message:JSON.stringify(e.message):JSON.stringify(e),ze=async e=>{const{io:t,variant:n,text:o,error:r}=e,i=Lo(r);try{if(n===nt&&t.logger.warn(i?`${o} ${i}`:o),!("modals"in t)||!t.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:n,ttl:m2[n]};await t.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},g2={[Dg]:async e=>{var o;const{io:t,item:n}=e;try{await((o=t.appManager.application(n.id))==null?void 0:o.start())}catch(r){await ze({io:t,variant:nt,text:`Failed to start app "${n.title}" in a new window.`,error:r})}},[Mg]:async e=>{const{io:t,item:n,frameId:o}=e;if(!t.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=t.workspaces.getBuilder(r);i.addGroup().addWindow({appName:n.id});try{await i.create()}catch(a){await ze({io:t,variant:nt,text:`Failed to start app "${n.title}" in a new Workspace.`,error:a})}}},Fg=()=>{const e=v.useContext(Ie.IOConnectContext),t=Pd();return(n,o)=>{g2[o]({io:e,item:n,frameId:t})}},li={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},yu="(.|\\s)*\\S(.|\\s)*",y2={delete:async e=>{var i;const{io:t,layout:n,showDeletePromptPref:o,updateShowDeletePromptPref:r}=e;if("modals"in t&&t.modals&&o){const a="delete",s="do-not-ask-again",{isEnterPressed:c,responseButtonClicked:u,inputs:d}=await t.modals.dialogs.request({templateName:li.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${n.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:s,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=d==null?void 0:d.find(p=>p.id===s))==null?void 0:i.checked)&&r(!1),!(c||(u==null?void 0:u.id)===a))return}try{await t.layouts.remove("Global",n.name),n.isDefault&&await t.layouts.clearDefaultGlobal(),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was successfully deleted.`})}catch(a){await ze({io:t,variant:nt,text:`Failed to delete Layout "${n.name}".`,error:a})}},rename:async e=>{var d;const{io:t,layout:n,setDefaultLayout:o}=e;if(!("modals"in t)||!t.modals)return void console.error("Cannot rename Layout because io dialogs are not enabled");const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await t.modals.dialogs.request({templateName:li.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${n.name}"`,input:{id:i,initialValue:n.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:yu}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=c==null?void 0:c.find(f=>f.id===i))==null?void 0:d.value;if(u&&(a||(s==null?void 0:s.id)===r))if(u!==n.name)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u))return void await ze({io:t,variant:nt,text:`Failed to rename Layout "${n.name}" to "${u}". A Layout with name "${u}" already exists.`});const p=await t.layouts.get(n.name,"Global");if(!p)return void await ze({io:t,variant:nt,text:`Failed to rename Layout "${n.name}". The Layout wasn't found.`});await t.layouts.rename(p,u),n.isDefault&&await o({name:u}),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was successfully renamed to "${u}".`})}catch(f){await ze({io:t,variant:nt,text:`Failed to rename Layout "${n.name}".`,error:f})}else await ze({io:t,variant:nt,text:`Failed to rename Layout "${n.name}". The new Layout name must be different from the current one.`})},save:async e=>{const{io:t,layout:n}=e;try{await t.layouts.save({name:n.name,type:"Global"}),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was saved successfully.`})}catch(o){await ze({io:t,variant:nt,text:`Failed to save Layout "${n.name}".`,error:o})}},saveAs:async e=>{var d;const{io:t,layout:n,setActiveLayout:o}=e;if(!("modals"in t)||!t.modals)return void console.error("Cannot save Layout under a new name because io dialogs are not enabled");const r="save-as",i="layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await t.modals.dialogs.request({templateName:li.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${n.name}" as`,input:{id:i,initialValue:n.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:yu}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=c==null?void 0:c.find(f=>f.id===i))==null?void 0:d.value;if(u&&(a||(s==null?void 0:s.id)===r))if(u!==n.name)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u))return void await ze({io:t,variant:nt,text:`Failed to save Layout as "${u}". A Layout with this name already exists.`});const p=await t.layouts.get(n.name,"Global");if(!p)return void await ze({io:t,variant:nt,text:`Failed to save Layout "${n.name}". The Layout wasn't found.`});await t.layouts.import([{...p,name:u}],"merge"),n.isActive&&o({name:u}),await ze({io:t,variant:Vn,text:`The Layout was successfully saved as "${u}".`})}catch(f){await ze({io:t,variant:nt,text:`Failed to save Layout "${u}".`,error:f})}else await ze({io:t,variant:nt,text:`Failed to save Layout as "${u}". The new Layout must have a unique name.`})},setAsDefault:async e=>{const{io:t,layout:n,setDefaultLayout:o}=e;try{await o({name:n.name}),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was successfully set as the default Layout.`})}catch{await ze({io:t,variant:nt,text:`Failed to set Layout "${n.name}" as the default Layout.`})}},load:async e=>{const{io:t,layout:n,closeLaunchpad:o}=e;try{await t.layouts.restore({name:n.name}),o(),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was loaded successfully.`})}catch(r){await ze({io:t,variant:nt,text:`Failed to load Layout "${n.name}".`,error:r})}}};var Pt=function(e){return{ok:!0,result:e}},xt=function(e){return{ok:!1,error:e}},Lp=function(e,t,n){return t.ok===!1?t:n.ok===!1?n:Pt(e(t.result,n.result))},ll=function(e,t){return t.ok===!0?t:xt(e(t.error))},vu=function(){return vu=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},vu.apply(this,arguments)};function wu(e,t){if(e===t||e===null&&t===null)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!wu(e[n],t[n]))return!1;return!0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(n=0;n<o.length;n++)if(!t.hasOwnProperty(o[n])||!wu(e[o[n]],t[o[n]]))return!1;return!0}}var Zi=function(e){return Array.isArray(e)},Ya=function(e){return typeof e=="object"&&e!==null&&!Zi(e)},ao=function(e,t){return"expected "+e+", got "+function(n){switch(typeof n){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return n instanceof Array?"an array":n===null?"null":"an object";default:return JSON.stringify(n)}}(t)},Mi=function(e){return e.map(function(t){return typeof t=="string"?"."+t:"["+t+"]"}).join("")},$i=function(e,t){var n=t.at,o=function(r,i){var a={};for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&i.indexOf(s)<0&&(a[s]=r[s]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var c=0;for(s=Object.getOwnPropertySymbols(r);c<s.length;c++)i.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(r,s[c])&&(a[s[c]]=r[s[c]])}return a}(t,["at"]);return vu({at:e+(n||"")},o)},Et=function(){function e(t){var n=this;this.decode=t,this.run=function(o){return ll(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},n.decode(o))},this.runPromise=function(o){return function(r){return r.ok===!0?Promise.resolve(r.result):Promise.reject(r.error)}(n.run(o))},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(n.run(o))},this.map=function(o){return new e(function(r){return function(i,a){return a.ok===!0?Pt(i(a.result)):a}(o,n.decode(r))})},this.andThen=function(o){return new e(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},n.decode(r))})},this.where=function(o,r){return n.andThen(function(i){return o(i)?e.succeed(i):e.fail(r)})}}return e.string=function(){return new e(function(t){return typeof t=="string"?Pt(t):xt({message:ao("a string",t)})})},e.number=function(){return new e(function(t){return typeof t=="number"?Pt(t):xt({message:ao("a number",t)})})},e.boolean=function(){return new e(function(t){return typeof t=="boolean"?Pt(t):xt({message:ao("a boolean",t)})})},e.constant=function(t){return new e(function(n){return wu(n,t)?Pt(t):xt({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(n)})})},e.object=function(t){return new e(function(n){if(Ya(n)&&t){var o={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].decode(n[r]);if(i.ok!==!0)return n[r]===void 0?xt({message:"the key '"+r+"' is required but was not present"}):xt($i("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return Pt(o)}return Ya(n)?Pt(n):xt({message:ao("an object",n)})})},e.array=function(t){return new e(function(n){return Zi(n)&&t?n.reduce(function(o,r,i){return Lp(function(a,s){return a.concat([s])},o,function(a,s){return ll(function(c){return $i("["+s+"]",c)},t.decode(a))}(r,i))},Pt([])):Zi(n)?Pt(n):xt({message:ao("an array",n)})})},e.tuple=function(t){return new e(function(n){if(Zi(n)){if(n.length!==t.length)return xt({message:"expected a tuple of length "+t.length+", got one of length "+n.length});for(var o=[],r=0;r<t.length;r++){var i=t[r].decode(n[r]);if(!i.ok)return xt($i("["+r+"]",i.error));o[r]=i.result}return Pt(o)}return xt({message:ao("a tuple of length "+t.length,n)})})},e.union=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new e(function(i){return[t,n].concat(o).reduce(function(a,s){return Lp(Object.assign,a,s.decode(i))},Pt({}))})},e.anyJson=function(){return new e(function(t){return Pt(t)})},e.unknownJson=function(){return new e(function(t){return Pt(t)})},e.dict=function(t){return new e(function(n){if(Ya(n)){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=t.decode(n[r]);if(i.ok!==!0)return xt($i("."+r,i.error));o[r]=i.result}return Pt(o)}return xt({message:ao("an object",n)})})},e.optional=function(t){return new e(function(n){return n==null?Pt(void 0):t.decode(n)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(o){for(var r=[],i=0;i<t.length;i++){var a=t[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var s=r.map(function(c){return"at error"+(c.at||"")+": "+c.message}).join('", "');return xt({message:'expected a value matching one of the decoders, got the errors ["'+s+'"]'})})},e.withDefault=function(t,n){return new e(function(o){return Pt(function(r,i){return i.ok===!0?i.result:r}(t,n.decode(o)))})},e.valueAt=function(t,n){return new e(function(o){for(var r=o,i=0;i<t.length;i++){if(r===void 0)return xt({at:Mi(t.slice(0,i+1)),message:"path does not exist"});if(typeof t[i]=="string"&&!Ya(r))return xt({at:Mi(t.slice(0,i+1)),message:ao("an object",r)});if(typeof t[i]=="number"&&!Zi(r))return xt({at:Mi(t.slice(0,i+1)),message:ao("an array",r)});r=r[t[i]]}return ll(function(a){return r===void 0?{at:Mi(t),message:"path does not exist"}:$i(Mi(t),a)},n.decode(r))})},e.succeed=function(t){return new e(function(n){return Pt(t)})},e.fail=function(t){return new e(function(n){return xt({message:t})})},e.lazy=function(t){return new e(function(n){return t().decode(n)})},e}(),qt=Et.string,v2=Et.number,rt=Et.boolean,bu=Et.anyJson;Et.unknownJson;var q=Et.constant,Ut=Et.object,tr=Et.array;Et.tuple,Et.dict;var xe=Et.optional,Oa=Et.oneOf;Et.union,Et.intersection,Et.withDefault,Et.valueAt,Et.succeed;var w2=Et.fail;Et.lazy;const wt=qt().where(e=>e.length>0,"Expected a non-empty string"),Dp=v2().where(e=>e>=0,"Expected a non-negative number"),b2=Ut({name:wt}),Wg=(e,t,n)=>{const[o,r]=v.useState(()=>{try{const s=window[e].getItem(t);return s?JSON.parse(s):null}catch(s){return console.log(s),null}}),i=`${e}-${t}`;v.useEffect(()=>{const s=c=>{r(c.detail)};return window.addEventListener(i,s),()=>{window.removeEventListener(i,s)}},[i]);const a=v.useCallback(s=>{try{if(!s)return window[e].removeItem(t),void r(null);const c=n.run(s);if(!c.ok)return void console.warn(`Error validating the value to be stored: ${c.error.message}`);const u=c.result;r(u),window[e].setItem(t,JSON.stringify(u)),window.dispatchEvent(new CustomEvent(i,{detail:u}))}catch(c){console.log(c)}},[t,e,i,n]);return[o,a]},Ug=()=>{const[e,t]=Wg("sessionStorage","interopio_home_ui_active_layout",b2);return{activeLayout:e,setActiveLayout:t}},Nd=()=>{const e=v.useContext(Ie.IOConnectContext);return v.useCallback(async(t,n)=>{if(e)try{await e.layouts.restore({name:t}),n==null||n({name:t}),await ze({io:e,variant:Vn,text:`Layout "${t}" was loaded successfully.`})}catch(o){await ze({io:e,variant:nt,text:`Failed to load Layout "${t}".`,error:o})}},[e])},Vg="Control",Kg="Shift",Td=()=>{const e=v.useContext(Ie.IOConnectContext),t=Pd();return async({id:n,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===Vg?{newFrame:!0}:{frameId:t,reuseWorkspaceId:r};await((i=e.workspaces)==null?void 0:i.restoreWorkspace(n,a))}catch(a){await ze({io:e,variant:nt,text:`Failed to load Workspace "${n}".`,error:a})}}},Gg=e=>e.trim().length>0,qg=v.createContext(void 0),$n=()=>{const e=v.useContext(qg);if(e===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return e},x2=({children:e,close:t,isOpen:n,isGlobalLayoutsAvailable:o})=>{const[r,i]=v.useState(!1),{defaultLayout:a,activeLayout:s,setDefaultLayout:c,setActiveLayout:u}=((f,p)=>{const[h,m]=v.useState(void 0),g=v.useRef(!1),{activeLayout:y,setActiveLayout:b}=Ug(),k=Nd(),x=Td(),S=v.useContext(Ie.IOConnectContext),w=v.useCallback(async({name:C})=>{try{await S.layouts.setDefaultGlobal(C)}catch(O){console.error("Failed to set default Layout: ",{error:O})}},[S]);return v.useEffect(()=>{if(S)return S.layouts.onDefaultGlobalChanged(C=>{m(C)})},[S]),v.useEffect(()=>{if(S)return S.layouts.onRestored(C=>{b({name:C.name})})},[S]),v.useEffect(()=>{if(S)return S.layouts.onRemoved(C=>{(C==null?void 0:C.name)===(y==null?void 0:y.name)&&b(null)})},[S,y]),v.useEffect(()=>{if(S)return S.layouts.onRenamed((C,O)=>{(O==null?void 0:O.name)===(y==null?void 0:y.name)&&b({name:C.name})})},[S,y]),v.useEffect(()=>{var C;S&&((C=window.iobrowser)!=null&&C.platformStarted)&&!g.current&&(async()=>{var A;g.current=!0;const O=await S.layouts.getDefaultGlobal()??(await S.layouts.getAll("Global")).find(j=>j.name==="Welcome");if(!O||(m({name:O.name}),y))return;if(f(!0),p)return await k(O.name),void f(!1);const _=await((A=S.workspaces)==null?void 0:A.getWorkspace(j=>j.children.length===0)),N=await S.layouts.get(O.name,"Global");if(!N)throw new Error("Default Global Layout not found.");const E=N.components.reduce((j,B)=>{if(B.type==="workspaceFrame"){const $=B.state.workspaces.map(R=>R.config.name);j.push(...$)}return j},[]);Promise.all(E.map((j,B)=>x({id:j,reuseWorkspaceId:B===0?_==null?void 0:_.id:void 0}))),f(!1)})().catch(O=>console.error("Initial Global Layout setup failed. ",Lo(O)))},[S,y,k,x,p]),{defaultLayout:h,activeLayout:y,setDefaultLayout:w,setActiveLayout:b}})(i,o),d=v.useMemo(()=>({close:t,isOpen:n,defaultLayout:a,activeLayout:s,setDefaultLayout:c,setActiveLayout:u,isLayoutOperationBlocked:r,setIsLayoutOperationBlocked:i,isGlobalLayoutsAvailable:o}),[t,n,a,s,c,u,r,o]);return l.jsx(qg.Provider,{value:d,children:e})},Mp="io-connect-platform",Cr="___platform_prefs___",Jg="_launchpad_collapsedSections",Zg="_launchpad_favorites",k2="_launchpad_recent",Yg="_launchpad_isLayoutsPanelOpen",Xg="_launchpad_isCollapsed",Bs="_launchpad_isPinned",xu="_launchpad_isDocked",Qg="_launchpad_minimizeToTray",ey="_launchpad_autoCloseStartingAppsAndWorkspaces",ty="_launchpad_pinnedPosition",ny="_launchpad_allowDocking",oy="_launchpad_dockedAlwaysOnTop",ry="_launchpad_dockedClaimsSpace",Aa="_launchpad_showExtendedArea",iy="_launchpad_hideLabelsInExtendedArea",ay="_launchpad_showFavoritesInExtendedArea",Id="_launchpad_hideFavoritesSection",sy="_launchpad_showRecentAppsInExtendedArea",cy="_layouts_restoreLastSaved",ly="_layouts_saveCurrentOnExit",uy="_layouts_showUnsavedChangesPrompt",Rd="_layouts_showDeletePrompt",dy="_downloads_askForEachDownload",S2="_downloads_location",C2="_system_scheduleRestart",E2="_system_scheduleRestartTime",j2="_system_scheduleRestartFrequency",_2="_system_scheduleRestartDay",O2="_system_scheduleShutdown",A2="_system_scheduleShutdownTime",P2="_system_scheduleShutdownFrequency",N2="_system_scheduleShutdownDay",T2={[Jg]:[],[Zg]:[],[k2]:[],[Yg]:!1,[Xg]:!1,[Bs]:!1,[xu]:!1,[Qg]:!1,[ey]:!0,[ty]:"Left",[ny]:!0,[oy]:!1,[ry]:!1,[Aa]:!0,[iy]:!0,[ay]:!0,[Id]:!1,[sy]:!0,[cy]:!0,[ly]:!0,[uy]:!0,[Rd]:!0,[dy]:!0,[S2]:"",[C2]:!1,[E2]:"12:00 AM",[j2]:"daily",[_2]:"Monday",[O2]:!1,[A2]:"12:00 AM",[P2]:"daily",[N2]:"Monday"},fy=Oa(q("add"),q("align-bottom"),q("align-bottom-solid"),q("align-left"),q("align-left-bottom"),q("align-left-bottom-solid"),q("align-left-solid"),q("align-left-top"),q("align-left-top-solid"),q("align-right"),q("align-right-bottom"),q("align-right-bottom-solid"),q("align-right-solid"),q("align-right-top"),q("align-right-top-solid"),q("align-top"),q("align-top-solid"),q("always-on-top"),q("always-on-top-on"),q("application"),q("arrow-down-long"),q("arrow-down-to-bracket"),q("arrow-left-long"),q("arrow-right-from-bracket"),q("arrow-right-long"),q("arrow-right"),q("arrow-up"),q("arrow-up-long"),q("ban"),q("bell"),q("bell-solid"),q("bookmark"),q("bullseye-pointer"),q("certificate"),q("check"),q("check-light"),q("check-solid"),q("chevron-down"),q("chevron-left"),q("chevron-right"),q("chevron-up"),q("circle-info"),q("circle-xmark"),q("circle-xmark-full"),q("clock"),q("clock-rotate-left"),q("clone"),q("close"),q("cog"),q("cog-solid"),q("collapse"),q("copy"),q("download"),q("delete-left"),q("dev-tools"),q("ellipsis"),q("ellipsis-vertical"),q("expand"),q("envelope"),q("envelope-open"),q("exclamation-mark"),q("expand"),q("feedback"),q("filter"),q("floppy"),q("floppy-disk-pen"),q("folder"),q("folder-open"),q("globe"),q("group"),q("hidden"),q("home"),q("house"),q("info"),q("keyboard"),q("layout"),q("link"),q("list-ul"),q("lock"),q("logo"),q("minimize"),q("minimize-down"),q("paper-plane-top"),q("paperclip"),q("pause"),q("pen-line"),q("pen-to-square"),q("pin"),q("play"),q("pop-in"),q("pop-in-widget"),q("pop-out"),q("power-off"),q("publish"),q("refresh"),q("resize"),q("restore"),q("rotate-right"),q("search"),q("search-filled"),q("sleep"),q("sliders"),q("snooze"),q("spinner"),q("square"),q("square-arrow-down"),q("square-arrow-up"),q("star"),q("star-full"),q("sticky-off"),q("sticky-off-hover"),q("sticky-on"),q("sticky-on-hover"),q("subscribe"),q("system-close"),q("system-maximize"),q("system-minimize"),q("thumbs-down"),q("thumbs-up"),q("trash"),q("trash-can"),q("triangle-exclamation"),q("unlock"),q("unpin"),q("up-to-line"),q("user"),q("user-gear"),q("visible"),q("workspace")),I2=Ut({name:wt,displayName:xe(wt),icon:xe(fy),iconSrc:xe(wt),disabled:xe(rt()),separatorAfter:xe(rt())}),R2=Ut({id:wt,title:wt,description:xe(qt()),icon:xe(fy),iconSrc:xe(wt),contextMenuActions:xe(tr(I2)),type:wt}),L2=tr(R2),D2=Ut({name:wt,type:wt}),M2=Oa(q("Left"),q("Right")),$p=Oa(q("daily"),q("weekly")),Hp=Oa(q("Sunday"),q("Monday"),q("Tuesday"),q("Wednesday"),q("Thursday"),q("Friday"),q("Saturday")),bs=Ut({customPrefs:xe(bu()),_launchpad_collapsedSections:xe(tr(wt)),_launchpad_favorites:xe(L2),_launchpad_recent:xe(tr(D2)),_launchpad_isLayoutsPanelOpen:xe(rt()),_launchpad_isCollapsed:xe(rt()),_launchpad_isPinned:xe(rt()),_launchpad_isDocked:xe(rt()),_launchpad_minimizeToTray:xe(rt()),_launchpad_autoCloseStartingAppsAndWorkspaces:xe(rt()),_launchpad_pinnedPosition:xe(M2),_launchpad_allowDocking:xe(rt()),_launchpad_dockedAlwaysOnTop:xe(rt()),_launchpad_dockedClaimsSpace:xe(rt()),_launchpad_showExtendedArea:xe(rt()),_launchpad_hideLabelsInExtendedArea:xe(rt()),_launchpad_showFavoritesInExtendedArea:xe(rt()),_launchpad_hideFavoritesSection:xe(rt()),_launchpad_showRecentAppsInExtendedArea:xe(rt()),_layouts_restoreLastSaved:xe(rt()),_layouts_saveCurrentOnExit:xe(rt()),_layouts_showUnsavedChangesPrompt:xe(rt()),_layouts_showDeletePrompt:xe(rt()),_downloads_askForEachDownload:xe(rt()),_downloads_location:xe(qt()),_system_scheduleRestart:xe(rt()),_system_scheduleRestartTime:xe(wt),_system_scheduleRestartFrequency:xe($p),_system_scheduleRestartDay:xe(Hp),_system_scheduleShutdown:xe(rt()),_system_scheduleShutdownTime:xe(wt),_system_scheduleShutdownFrequency:xe($p),_system_scheduleShutdownDay:xe(Hp)}),Ld=v.createContext(void 0),wc=({children:e,launchpadMode:t})=>{const[n,o]=v.useState(),[r,i]=v.useState(!1),[a,s]=v.useState(),c=v.useContext(Ie.IOConnectContext),u=v.useMemo(()=>({prefs:n,isInitialSetupCompleted:r,initialSetupError:a}),[n,r,a]);return v.useEffect(()=>{if(!c)return;let d=!1;const f=c.contexts.subscribe(Cr,p=>{if(d)return;const h=bs.run(p);if(!h.ok)return void c.logger.warn(`The received data for context ${Cr} is with an invalid shape: ${Lo(h.error.message)}`);const m=h.result;o(m),c.prefs.updateFor(Mp,m).catch(g=>{c.logger.warn(`Failed to update platform prefs. Error: ${Lo(g)}`)})});return()=>{d=!0,f.then(p=>{p()})}},[c]),v.useEffect(()=>{c&&(async()=>{var d;try{const f=await c.contexts.get(Cr),p=bs.run(f);if(!p.ok)throw new Error(`The data in context ${Cr} is with an invalid shape: ${Lo(p.error.message)}`);const h=p.result;if(Object.keys(h).length>0)return;const m=((d=await c.prefs.get(Mp))==null?void 0:d.data)??{},g=bs.run(m);if(!g.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${Lo(g.error.message)}`);const y={[Bs]:t==="pinned"||(m[Bs]??!1),[xu]:t==="docked"||(m[xu]??!1)},b={...T2,...g.result,...y};await c.contexts.set(Cr,b)}catch(f){s({message:Lo(f)}),await ze({io:c,variant:nt,text:"Initial platform prefs setup failed.",error:f})}finally{i(!0)}})().catch(console.error)},[c,t]),l.jsx(Ld.Provider,{value:u,children:e})};function py(){const e=v.useContext(Ld);if(e===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return e}function Mt({prefKey:e}){var f;const t=v.useContext(Ie.IOConnectContext),n=v.useContext(Ld),o=(f=n==null?void 0:n.prefs)==null?void 0:f[e],r=(n==null?void 0:n.isInitialSetupCompleted)??!1,[i,a]=v.useState(!r),[s,c]=v.useState(),u=v.useRef(0);v.useEffect(()=>{r&&u.current===0&&a(!1)},[r]);const d=v.useCallback(async p=>{if(!t)return;const h=++u.current;a(!0),c(void 0);const m=async y=>{y&&await ze({io:t,variant:nt,text:`Failed to update prefKey "${e}".`,error:y}),h===u.current&&(a(!1),y&&c({message:Lo(y)}))};let g;if(p instanceof Function)try{g=p((await t.contexts.get(Cr))[e])}catch(y){return m(y)}else g=p;try{const y=bs.runWithException({[e]:g});await t.contexts.update(Cr,y)}catch(y){return m(y)}await m()},[t,e]);if(n===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:s,isLoading:i,update:d,value:o}}const Br=()=>{const{value:e,update:t,isLoading:n,error:o}=Mt({prefKey:Bs}),r=v.useCallback(()=>t(i=>!i),[t]);return{error:o,isLaunchpadPinned:e,isLoading:n,toggle:r}},hy=()=>{const e=v.useContext(Ie.IOConnectContext),{setActiveLayout:t,setDefaultLayout:n,close:o}=$n(),{isLaunchpadPinned:r}=Br(),{value:i,update:a}=Mt({prefKey:Rd}),s=()=>{r||(o==null||o())};return v.useCallback(async u=>{const{layout:d,actionName:f}=u;return await y2[f]({io:e,layout:d,setActiveLayout:t,setDefaultLayout:n,closeLaunchpad:s,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[e,n,t,o,i,a])},Oi=()=>{const{isLayoutOperationBlocked:e,setIsLayoutOperationBlocked:t}=$n();return async n=>{if(!e){t(!0);try{await n()}catch(o){console.error("Layout operation failed: ",{error:o})}t(!1)}}},my="createWorkspace",$2={[Hg]:async e=>{const{io:t,item:n}=e;if(t.workspaces)try{await t.workspaces.restoreWorkspace(n.id,{newFrame:!0})}catch(o){await ze({io:t,variant:nt,text:`Failed to load Workspace "${n.title}".`,error:o})}},[Bg]:async e=>{const{io:t,item:n,removeFavorite:o}=e;if(t.workspaces){if("modals"in t&&t.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await t.modals.dialogs.request({templateName:li.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${n.title}"`,text:"Are you sure you want to delete this Workspace?",actionButtons:[{variant:"critical",text:"Delete",id:r},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(!(i||(a==null?void 0:a.id)===r))return}try{await t.workspaces.layouts.delete(n.id),await o(n),await ze({io:t,variant:Vn,text:`"Workspace ${n.title}" was successfully deleted.`})}catch(r){await ze({io:t,variant:nt,text:`Failed to delete Workspace "${n.title}".`,error:r})}}},[my]:async e=>{const{io:t}=e;if(t.workspaces)try{await t.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(n){await ze({io:t,variant:nt,text:"Failed to create a new Workspace.",error:n})}}},wi="application",bi="workspace",ku="layout",Bp="action-button";class gy{constructor(){En(this,"queue",[]);En(this,"isExecutingQueue",!1)}enqueue(t){return new Promise((n,o)=>{this.queue.push({action:t,resolve:n,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const t=this.queue.shift();if(!t)return void(this.isExecutingQueue=!1);try{const n=await t.action();t.resolve(n)}catch(n){t.reject(n)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(t=>setTimeout(t,0))}}const yy=()=>{const[e,t]=v.useState([]),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!(n!=null&&n.workspaces))return;let o=!1;const r=n.workspaces.layouts.onSaved(({name:s})=>{o||e.some(({id:c})=>c===s)||t(c=>[...c,{id:s,title:s}])}),i=n.workspaces.layouts.onRemoved(({name:s})=>{o||t(c=>c.filter(({id:u})=>u!==s))}),a=n.layouts.onRenamed((s,c)=>{if(o||s.type!=="Workspace")return;const{name:u}=s;t(d=>{const f=d.findIndex(p=>p.id===(c==null?void 0:c.name));return f===-1?d:[...d.slice(0,f),{id:u,title:u},...d.slice(f+1)]})});return()=>{o=!0,a(),[r,i].forEach(async s=>{try{(await s)()}catch(c){console.error(c)}})}},[n,e]),e},zp=new gy,bc=()=>{const{value:e,update:t,isLoading:n}=Mt({prefKey:Zg}),o=Lg(),r=yy();return{favorites:v.useMemo(()=>(e??[]).filter(i=>i.type===wi?o.some(a=>a.id===i.id):i.type!==bi||r.some(a=>a.id===i.id)),[e,o,r]),toggleFavorite:v.useCallback(({openInstances:i,...a})=>zp.enqueue(()=>t((s=[])=>{const c=s.find(u=>u.id===a.id&&u.type&&a.type);return c?s.filter(u=>u!==c):[a,...s]})),[t]),removeFavorite:v.useCallback(i=>zp.enqueue(()=>t((a=[])=>a.filter(s=>!(s.id===i.id&&s.type===i.type)))),[t]),isLoading:n}},vy=()=>{const e=v.useContext(Ie.IOConnectContext),{removeFavorite:t}=bc();return(n,o)=>{$2[o]({io:e,item:n,removeFavorite:t})}},Dd=()=>{const{value:e,update:t,isLoading:n,error:o}=Mt({prefKey:Xg});return{error:o,isLaunchpadCollapsed:e,setIsLaunchpadCollapsed:t,isLoading:n}},wy=()=>{const[e,t]=v.useState([]),[n,o]=v.useState(!1),r=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!r)return;let i=!1;const a=[],s=r.layouts.onAdded(d=>{if(d.type!=="Global"||i)return;o(!0);const{name:f}=d;t(p=>[...p,{name:f}])}),c=r.layouts.onRemoved(d=>{d.type!=="Global"||i||t(f=>f.filter(p=>p.name!==d.name))}),u=r.layouts.onRenamed((d,f)=>{d.type!=="Global"||i||t(p=>{const h=p.filter(g=>g.name!==d.name),m=h.findIndex(g=>g.name===(f==null?void 0:f.name));return m===-1?p:[...h.slice(0,m),{name:d.name},...h.slice(m+1)]})});return a.push(s,c,u),()=>{i=!0,a.forEach(d=>d())}},[r]),{layouts:e,isInitialized:n}},by=e=>{const{handler:t,skip:n}=e;v.useEffect(()=>{if(n)return;const o=r=>{setTimeout(()=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&t(r)},0)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[t,n])},xy=e=>{const{eventType:t,handler:n,ref:o,skip:r}=e;v.useEffect(()=>{if(r)return;const i=a=>{const s=a.target;(Array.isArray(o)?o.every(u=>u.current&&!u.current.contains(s)):o.current&&!o.current.contains(s))&&n(a)};return document.addEventListener(t,i,!0),()=>{document.removeEventListener(t,i,!0)}},[t,n,o,r])},ky=()=>{const[e,t]=v.useState([]);return v.useEffect(()=>{const n=({key:i})=>{t(a=>a.includes(i)?a:a.concat(i))},o=i=>{t(a=>a.filter(s=>s!==i.key))},r=()=>{t([])};return document.addEventListener("keydown",n),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",n),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),e.length===1?e[0]:null},Sy=()=>{const e=v.useContext(Ie.IOConnectContext),t=async({id:o})=>{var r;await((r=e.appManager.application(o))==null?void 0:r.start())},n=async({id:o,modifier:r})=>{var c,u;const i=await((c=e.workspaces)==null?void 0:c.getWorkspace(d=>d.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===Vg||!i||(a==null?void 0:a.type)==="window")return void await((u=e.appManager.application(o))==null?void 0:u.start());await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await(Hr()?t:n)(o)}catch(r){await ze({io:e,variant:nt,text:`Failed to start app "${o.title}".`,error:r})}}};function Md(e){const{title:t,buttonSize:n="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:s,buttonVariant:c,placement:u,strategy:d,offset:f,shouldCloseOnOutsideScroll:p=!1,shouldCloseOnWindowBlur:h=!1,shouldCloseOnWindowResize:m=!1,"data-testid":g,contextMenuDataTestId:y}=e,[b,k]=v.useState(!1),[x,S]=v.useState(null),[w,C]=v.useState(null),O=v.useRef(null),_=v.useRef(null),N=v.useMemo(()=>[_,O],[]),E=v.useCallback(()=>k(!1),[]),{styles:A,attributes:j}=function(B,$,R){R===void 0&&(R={});var F=J.useRef(null),z={onFirstUpdate:R.onFirstUpdate,placement:R.placement||"bottom",strategy:R.strategy||"absolute",modifiers:R.modifiers||h2},V=J.useState({styles:{popper:{position:z.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),L=V[0],H=V[1],W=J.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(D){var T=D.state,P=Object.keys(T.elements);Im.flushSync(function(){H({styles:Cp(P.map(function(I){return[I,T.styles[I]||{}]})),attributes:Cp(P.map(function(I){return[I,T.attributes[I]]}))})})},requires:["computeStyles"]}},[]),U=J.useMemo(function(){var D={onFirstUpdate:z.onFirstUpdate,placement:z.placement,strategy:z.strategy,modifiers:[].concat(z.modifiers,[W,{name:"applyStyles",enabled:!1}])};return p2(F.current,D)?F.current||D:(F.current=D,D)},[z.onFirstUpdate,z.placement,z.strategy,z.modifiers,W]),Y=J.useRef();return Ep(function(){Y.current&&Y.current.setOptions(U)},[U]),Ep(function(){if(B!=null&&$!=null){var D=(R.createPopper||s2)(B,$,U);return Y.current=D,function(){D.destroy(),Y.current=null}}},[B,$,R.createPopper]),{state:Y.current?Y.current.state:null,styles:L.styles,attributes:L.attributes,update:Y.current?Y.current.update:null,forceUpdate:Y.current?Y.current.forceUpdate:null}}(x,w,{placement:u,strategy:d,modifiers:[{name:"offset",options:{offset:f}}]});return v.useEffect(()=>{O.current=x},[x]),v.useEffect(()=>{_.current=w},[w]),xy({eventType:"mouseup",handler:E,ref:N,skip:!b}),by({handler:E,skip:!b}),v.useEffect(()=>{if(h&&b)return window.addEventListener("blur",E),()=>{window.removeEventListener("blur",E)}},[E,b,h]),v.useEffect(()=>{if(!p||!w)return;const B=$=>{w.contains($.target)?$.preventDefault():E()};return document.addEventListener("touchmove",B,{passive:!1}),document.addEventListener("wheel",B,{passive:!1}),()=>{document.removeEventListener("touchmove",B),document.removeEventListener("wheel",B)}},[E,w,p]),v.useEffect(()=>{if(m&&b)return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[E,b,m]),l.jsxs(l.Fragment,{children:[l.jsx(Ue,{ref:S,size:n,icon:o,iconSize:r,variant:c,...lc(B=>{B.stopPropagation(),k($=>!$),w==null||w.focus()}),tabIndex:a?0:-1,"data-testid":g}),b&&l.jsx(Rg,{ref:C,title:t,actions:i,onActionItemClick:(B,$)=>{B.stopPropagation(),s(B,$),E()},onClose:()=>{x==null||x.focus(),E()},style:A.popper,"data-testid":y,...j.popper})]})}function H2({className:e,size:t="large",variant:n="default",align:o="up",text:r,...i}){const a=Q("io-loader",{[`io-loader-${n}`]:n!=="default"},t==="normal"&&"io-loader-md",t==="small"&&"io-loader-sm",o&&[`direction-${o}`],e);return l.jsxs("div",{className:a,role:"status","aria-live":"polite",...i,children:[l.jsx("div",{className:"io-loader-icon"}),r&&l.jsx("div",{className:"io-loader-text",children:r})]})}function Do({className:e,children:t,...n}){const o=Q("io-panel-header",e);return l.jsx(cn,{className:o,...n,children:t})}Do.Title=Xn,Do.ButtonGroup=Be,Do.Button=tt,Do.ButtonIcon=Ue,Do.Dropdown=fe;const xi=v.forwardRef(({className:e,children:t,...n},o)=>{const r=Q("io-panel-body",e);return l.jsx("div",{className:r,ref:o,"data-testid":"panel-body",...n,children:t})});function Zr({className:e,...t}){const n=Q("io-panel-footer",e);return l.jsx(jr,{className:n,...t})}function ot({className:e,children:t,...n}){const o=Q("io-panel",e);return l.jsx("div",{className:o,"data-testid":"panel",...n,children:t})}function xc({className:e,variant:t="default",children:n,...o}){const r=Q("io-pill",t!=="default"&&[`io-pill-${t}`],e);return l.jsx("div",{className:r,role:"status",...o,children:n})}function B2({className:e,variant:t="active",value:n=0,...o}){const r=Q("io-progress",t,e);let i;return i=n<0?0:n>100?100:n,l.jsx("div",{className:r,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...o,children:l.jsx("div",{className:"io-progress-bar",style:{width:`${i}%`}})})}/*!
|
|
8
|
+
*/var Rs=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),ug=typeof Element>"u",pi=ug?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ys=!ug&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ls=function(e,t){var n;t===void 0&&(t=!0);var o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert");return o===""||o==="true"||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):Ls(e.parentNode))},du=function(e,t,n){for(var o=[],r=Array.from(e);r.length;){var i=r.shift();if(!Ls(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),s=a.length?a:i.children,c=du(s,!0,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{pi.call(i,Rs)&&n.filter(i)&&(t||!e.includes(i))&&o.push(i);var u=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),d=!Ls(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(u&&d){var f=du(u===!0?i.children:u.children,!0,n);n.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else r.unshift.apply(r,i.children)}}return o},dg=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},fg=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"}(e))&&!dg(e)?0:e.tabIndex},fx=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},pg=function(e){return e.tagName==="INPUT"},px=function(e){return function(t){return pg(t)&&t.type==="radio"}(e)&&!function(t){if(!t.name)return!0;var n,o=t.form||ys(t),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")n=r(window.CSS.escape(t.name));else try{n=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=function(a,s){for(var c=0;c<a.length;c++)if(a[c].checked&&a[c].form===s)return a[c]}(n,t.form);return!i||i===t}(e)},np=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return n===0&&o===0},hx=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if(n==="full-native"&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility==="hidden")return!0;var r=pi.call(e,"details>summary:first-of-type")?e.parentElement:e;if(pi.call(r,"details:not([open]) *"))return!0;if(n&&n!=="full"&&n!=="full-native"&&n!=="legacy-full"){if(n==="non-zero-area")return np(e)}else{if(typeof o=="function"){for(var i=e;e;){var a=e.parentElement,s=ys(e);if(a&&!a.shadowRoot&&o(a)===!0)return np(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(c){var u,d,f,p,h=c&&ys(c),m=(u=h)===null||u===void 0?void 0:u.host,g=!1;if(h&&h!==c)for(g=!!((d=m)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(m)||c!=null&&(p=c.ownerDocument)!==null&&p!==void 0&&p.contains(c));!g&&m;){var y,b,k;g=!((b=m=(y=h=ys(m))===null||y===void 0?void 0:y.host)===null||b===void 0||(k=b.ownerDocument)===null||k===void 0||!k.contains(m))}return g}(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}return!1},mx=function(e,t){return!(t.disabled||function(n){return pg(n)&&n.type==="hidden"}(t)||hx(t,e)||function(n){return n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"})}(t)||function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var o=n.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var r=0;r<o.children.length;r++){var i=o.children.item(r);if(i.tagName==="LEGEND")return!!pi.call(o,"fieldset[disabled] *")||!i.contains(n)}return!0}o=o.parentElement}return!1}(t))},fu=function(e,t){return!(px(t)||fg(t)<0||!mx(e,t))},gx=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},hg=function(e){var t=[],n=[];return e.forEach(function(o,r){var i=!!o.scopeParent,a=i?o.scopeParent:o,s=function(u,d){var f=fg(u);return f<0&&d&&!dg(u)?0:f}(a,i),c=i?hg(o.candidates):a;s===0?i?t.push.apply(t,c):t.push(a):n.push({documentOrder:r,tabIndex:s,item:o,isScope:i,content:c})}),n.sort(fx).reduce(function(o,r){return r.isScope?o.push.apply(o,r.content):o.push(r.content),o},[]).concat(t)},Ed=function(e,t){var n;return n=(t=t||{}).getShadowRoot?du([e],t.includeContainer,{filter:fu.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:gx}):function(o,r,i){if(Ls(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(Rs));return r&&pi.call(o,Rs)&&a.unshift(o),a.filter(i)}(e,t.includeContainer,fu.bind(null,t)),hg(n)};function op(e,t,n){let{reference:o,floating:r}=e;const i=$o(t),a=lg(t),s=cg(a),c=Tr(t),u=i==="y",d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2;let h;switch(c){case"top":h={x:d,y:o.y-r.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(gc(t)){case"start":h[a]-=p*(n&&u?-1:1);break;case"end":h[a]+=p*(n&&u?-1:1)}return h}async function yx(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=mc(t,e),m=function(w){return typeof w!="number"?function(C){return{top:0,right:0,bottom:0,left:0,...C}}(w):{top:w,right:w,bottom:w,left:w}}(h),g=s[p?f==="floating"?"reference":"floating":f],y=Is(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:c})),b=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),x=await(i.isElement==null?void 0:i.isElement(k))&&await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1},S=Is(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:k,strategy:c}):b);return{top:(y.top-S.top+m.top)/x.y,bottom:(S.bottom-y.bottom+m.bottom)/x.y,left:(y.left-S.left+m.left)/x.x,right:(S.right-y.right+m.right)/x.x}}const vx=new Set(["left","top"]);function mg(e){const t=bn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Et(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=Ts(n)!==i||Ts(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function jd(e){return at(e)?e:e.contextElement}function si(e){const t=jd(e);if(!Et(t))return Zn(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=mg(t);let a=(i?Ts(n.width):n.width)/o,s=(i?Ts(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const wx=Zn(0);function gg(e){const t=dn(e);return pc()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wx}function Ir(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=jd(e);let a=Zn(1);t&&(o?at(o)&&(a=si(o)):a=si(e));const s=function(p,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==dn(p))&&h}(i,n,o)?gg(i):Zn(0);let c=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(i){const p=dn(i),h=o&&at(o)?dn(o):o;let m=p,g=su(m);for(;g&&o&&h!==m;){const y=si(g),b=g.getBoundingClientRect(),k=bn(g),x=b.left+(g.clientLeft+parseFloat(k.paddingLeft))*y.x,S=b.top+(g.clientTop+parseFloat(k.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=x,u+=S,m=dn(g),g=su(m)}}return Is({width:d,height:f,x:c,y:u})}function Ds(e,t){const n=hc(e).scrollLeft;return t?t.left+n:Ir(Jn(e)).left+n}function yg(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ds(e,n),y:n.top+t.scrollTop}}const bx=new Set(["absolute","fixed"]);function rp(e,t,n){let o;if(t==="viewport")o=function(r,i){const a=dn(r),s=Jn(r),c=a.visualViewport;let u=s.clientWidth,d=s.clientHeight,f=0,p=0;if(c){u=c.width,d=c.height;const m=pc();(!m||m&&i==="fixed")&&(f=c.offsetLeft,p=c.offsetTop)}const h=Ds(s);if(h<=0){const m=s.ownerDocument,g=m.body,y=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,k=Math.abs(s.clientWidth-g.clientWidth-b);k<=25&&(u-=k)}else h<=25&&(u+=h);return{width:u,height:d,x:f,y:p}}(e,n);else if(t==="document")o=function(r){const i=Jn(r),a=hc(r),s=r.ownerDocument.body,c=_r(i.scrollWidth,i.clientWidth,s.scrollWidth,s.clientWidth),u=_r(i.scrollHeight,i.clientHeight,s.scrollHeight,s.clientHeight);let d=-a.scrollLeft+Ds(r);const f=-a.scrollTop;return bn(s).direction==="rtl"&&(d+=_r(i.clientWidth,s.clientWidth)-c),{width:c,height:u,x:d,y:f}}(Jn(e));else if(at(t))o=function(r,i){const a=Ir(r,!0,i==="fixed"),s=a.top+r.clientTop,c=a.left+r.clientLeft,u=Et(r)?si(r):Zn(1);return{width:r.clientWidth*u.x,height:r.clientHeight*u.y,x:c*u.x,y:s*u.y}}(t,n);else{const r=gg(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Is(o)}function vg(e,t){const n=ho(e);return!(n===t||!at(n)||Vo(n))&&(bn(n).position==="fixed"||vg(n,t))}function xx(e,t,n){const o=Et(t),r=Jn(t),i=n==="fixed",a=Ir(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Zn(0);function u(){c.x=Ds(r)}if(o||!o&&!i)if((Qo(t)!=="body"||la(r))&&(s=hc(t)),o){const f=Ir(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&u();i&&!o&&r&&u();const d=!r||o||i?Zn(0):yg(r,s);return{x:a.left+s.scrollLeft-c.x-d.x,y:a.top+s.scrollTop-c.y-d.y,width:a.width,height:a.height}}function ol(e){return bn(e).position==="static"}function ip(e,t){if(!Et(e)||bn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Jn(e)===n&&(n=n.ownerDocument.body),n}function ap(e,t){const n=dn(e);if(Ps(e))return n;if(!Et(e)){let r=ho(e);for(;r&&!Vo(r);){if(at(r)&&!ol(r))return r;r=ho(r)}return n}let o=ip(e,t);for(;o&&ex(o)&&ol(o);)o=ip(o,t);return o&&Vo(o)&&ol(o)&&!au(o)?n:o||function(r){let i=ho(r);for(;Et(i)&&!Vo(i);){if(au(i))return i;if(Ps(i))return null;i=ho(i)}return null}(e)||n}const kx={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=Jn(o),s=!!t&&Ps(t.floating);if(o===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Zn(1);const d=Zn(0),f=Et(o);if((f||!f&&!i)&&((Qo(o)!=="body"||la(a))&&(c=hc(o)),Et(o))){const h=Ir(o);u=si(o),d.x=h.x+o.clientLeft,d.y=h.y+o.clientTop}const p=!a||f||i?Zn(0):yg(a,c);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-c.scrollTop*u.y+d.y+p.y}},getDocumentElement:Jn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Ps(t)?[]:function(c,u){const d=u.get(c);if(d)return d;let f=Ko(c,[],!1).filter(g=>at(g)&&Qo(g)!=="body"),p=null;const h=bn(c).position==="fixed";let m=h?ho(c):c;for(;at(m)&&!Vo(m);){const g=bn(m),y=au(m);y||g.position!=="fixed"||(p=null),(h?!y&&!p:!y&&g.position==="static"&&p&&bx.has(p.position)||la(m)&&!y&&vg(c,m))?f=f.filter(b=>b!==m):p=g,m=ho(m)}return u.set(c,f),f}(t,this._c):[].concat(n),o],a=i[0],s=i.reduce((c,u)=>{const d=rp(t,u,r);return c.top=_r(d.top,c.top),c.right=Ns(d.right,c.right),c.bottom=Ns(d.bottom,c.bottom),c.left=_r(d.left,c.left),c},rp(t,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ap,getElementRects:async function(e){const t=this.getOffsetParent||ap,n=this.getDimensions,o=await n(e.floating);return{reference:xx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=mg(e);return{width:t,height:n}},getScale:si,isElement:at,isRTL:function(e){return bn(e).direction==="rtl"}};function sp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Sx(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,u=jd(e),d=r||i?[...u?Ko(u):[],...Ko(t)]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&s?function(y,b){let k,x=null;const S=Jn(y);function w(){var C;clearTimeout(k),(C=x)==null||C.disconnect(),x=null}return function C(O,_){O===void 0&&(O=!1),_===void 0&&(_=1),w();const N=y.getBoundingClientRect(),{left:E,top:A,width:j,height:B}=N;if(O||b(),!j||!B)return;const $={rootMargin:-Xr(A)+"px "+-Xr(S.clientWidth-(E+j))+"px "+-Xr(S.clientHeight-(A+B))+"px "+-Xr(E)+"px",threshold:_r(0,Ns(1,_))||1};let R=!0;function F(z){const V=z[0].intersectionRatio;if(V!==_){if(!R)return C();V?C(!1,V):k=setTimeout(()=>{C(!1,1e-7)},1e3)}V!==1||sp(N,y.getBoundingClientRect())||C(),R=!1}try{x=new IntersectionObserver(F,{...$,root:S.ownerDocument})}catch{x=new IntersectionObserver(F,$)}x.observe(y)}(!0),w}(u,n):null;let p,h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var k;(k=m)==null||k.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g=c?Ir(e):null;return c&&function y(){const b=Ir(e);g&&!sp(g,b)&&n(),g=b,p=requestAnimationFrame(y)}(),n(),()=>{var y;d.forEach(b=>{r&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const Cx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,c=await async function(u,d){const{placement:f,platform:p,elements:h}=u,m=await(p.isRTL==null?void 0:p.isRTL(h.floating)),g=Tr(f),y=gc(f),b=$o(f)==="y",k=vx.has(g)?-1:1,x=m&&b?-1:1,S=mc(d,u);let{mainAxis:w,crossAxis:C,alignmentAxis:O}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return y&&typeof O=="number"&&(C=y==="end"?-1*O:O),b?{x:C*x,y:w*k}:{x:w*k,y:C*x}}(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}},Ex=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:b=>{let{x:k,y:x}=b;return{x:k,y:x}}},...u}=mc(e,t),d={x:n,y:o},f=await i.detectOverflow(t,u),p=$o(Tr(r)),h=sg(p);let m=d[h],g=d[p];if(a){const b=h==="y"?"bottom":"right";m=Qf(m+f[h==="y"?"top":"left"],m,m-f[b])}if(s){const b=p==="y"?"bottom":"right";g=Qf(g+f[p==="y"?"top":"left"],g,g-f[b])}const y=c.fn({...t,[h]:m,[p]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[h]:a,[p]:s}}}}}},jx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=mc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Tr(r),k=$o(s),x=Tr(s)===s,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=p||(x||!g?[Ka(s)]:function($){const R=Ka($);return[uu($),R,uu(R)]}(s)),C=m!=="none";!p&&C&&w.push(...dx(s,g,m,S));const O=[s,...w],_=await c.detectOverflow(t,y),N=[];let E=((o=i.flip)==null?void 0:o.overflows)||[];if(d&&N.push(_[b]),f){const $=function(R,F,z){z===void 0&&(z=!1);const V=gc(R),L=lg(R),H=cg(L);let W=L==="x"?V===(z?"end":"start")?"right":"left":V==="start"?"bottom":"top";return F.reference[H]>F.floating[H]&&(W=Ka(W)),[W,Ka(W)]}(r,a,S);N.push(_[$[0]],_[$[1]])}if(E=[...E,{placement:r,overflows:N}],!N.every($=>$<=0)){var A,j;const $=(((A=i.flip)==null?void 0:A.index)||0)+1,R=O[$];if(R&&(!(f==="alignment"&&k!==$o(R))||E.every(z=>$o(z.placement)!==k||z.overflows[0]>0)))return{data:{index:$,overflows:E},reset:{placement:R}};let F=(j=E.filter(z=>z.overflows[0]<=0).sort((z,V)=>z.overflows[1]-V.overflows[1])[0])==null?void 0:j.placement;if(!F)switch(h){case"bestFit":{var B;const z=(B=E.filter(V=>{if(C){const L=$o(V.placement);return L===k||L==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(L=>L>0).reduce((L,H)=>L+H,0)]).sort((V,L)=>V[1]-L[1])[0])==null?void 0:B[0];z&&(F=z);break}case"initialPlacement":F=s}if(r!==F)return{reset:{placement:F}}}return{}}}},_x=(e,t,n)=>{const o=new Map,r={platform:kx,...n},i={...r.platform,_c:o};return(async(a,s,c)=>{const{placement:u="bottom",strategy:d="absolute",middleware:f=[],platform:p}=c,h=f.filter(Boolean),m=await(p.isRTL==null?void 0:p.isRTL(s));let g=await p.getElementRects({reference:a,floating:s,strategy:d}),{x:y,y:b}=op(g,u,m),k=u,x={},S=0;for(let C=0;C<h.length;C++){var w;const{name:O,fn:_}=h[C],{x:N,y:E,data:A,reset:j}=await _({x:y,y:b,initialPlacement:u,placement:k,strategy:d,middlewareData:x,rects:g,platform:{...p,detectOverflow:(w=p.detectOverflow)!=null?w:yx},elements:{reference:a,floating:s}});y=N??y,b=E??b,x={...x,[O]:{...x[O],...A}},j&&S<=50&&(S++,typeof j=="object"&&(j.placement&&(k=j.placement),j.rects&&(g=j.rects===!0?await p.getElementRects({reference:a,floating:s,strategy:d}):j.rects),{x:y,y:b}=op(g,k,m)),C=-1)}return{x:y,y:b,placement:k,strategy:d,middlewareData:x}})(e,t,{...r,platform:i})};var vs=typeof document<"u"?v.useLayoutEffect:function(){};function Ms(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Ms(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if((i!=="_owner"||!e.$$typeof)&&!Ms(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function wg(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cp(e,t){const n=wg(e);return Math.round(t*n)/n}function rl(e){const t=J.useRef(e);return vs(()=>{t.current=e}),t}const Ox=(e,t)=>({...Ex(e),options:[e,t]}),Ax=(e,t)=>({...jx(e),options:[e,t]});function bg(e){return J.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const xg={...J},Px=xg.useInsertionEffect||(e=>e());function Yt(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Px(()=>{t.current=e}),J.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}const _d="ArrowUp",ta="ArrowDown",To="ArrowLeft",Io="ArrowRight";function Ga(e,t,n){return Math.floor(e/t)!==n}function Li(e,t){return t<0||t>=e.current.length}function il(e,t){return zt(e,{disabledIndices:t})}function lp(e,t){return zt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function zt(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=t===void 0?{}:t;const a=e.current;let s=n;do s+=o?-i:i;while(s>=0&&s<=a.length-1&&ws(a,s,r));return s}function Nx(e,t,n,o,r){if(e===-1)return-1;const i=n.indexOf(e),a=t[e];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return n.lastIndexOf(e)}}function Tx(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function ws(e,t,n){if(n)return n.includes(t);const o=e[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var dt=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Ix(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const kg=J.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Rx(e){const{children:t,elementsRef:n,labelsRef:o}=e,[r,i]=J.useState(()=>new Map),a=J.useCallback(c=>{i(u=>new Map(u).set(c,null))},[]),s=J.useCallback(c=>{i(u=>{const d=new Map(u);return d.delete(c),d})},[]);return dt(()=>{const c=new Map(r);Array.from(c.keys()).sort(Ix).forEach((u,d)=>{c.set(u,d)}),function(u,d){if(u.size!==d.size)return!1;for(const[f,p]of u.entries())if(p!==d.get(f))return!1;return!0}(r,c)||i(c)},[r]),J.createElement(kg.Provider,{value:J.useMemo(()=>({register:a,unregister:s,map:r,elementsRef:n,labelsRef:o}),[a,s,r,n,o])},t)}function Sg(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:o,map:r,elementsRef:i,labelsRef:a}=J.useContext(kg),[s,c]=J.useState(null),u=J.useRef(null),d=J.useCallback(f=>{if(u.current=f,s!==null&&(i.current[s]=f,a)){var p;const h=t!==void 0;a.current[s]=h?t:(p=f==null?void 0:f.textContent)!=null?p:null}},[s,i,a,t]);return dt(()=>{const f=u.current;if(f)return n(f),()=>{o(f)}},[n,o]),dt(()=>{const f=u.current?r.get(u.current):null;f!=null&&c(f)},[r]),J.useMemo(()=>({ref:d,index:s??-1}),[s,d])}function $s(){return $s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},$s.apply(this,arguments)}let up=!1,Lx=0;const dp=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Lx++,pu=xg.useId||function(){const[e,t]=J.useState(()=>up?dp():void 0);return dt(()=>{e==null&&t(dp())},[]),J.useEffect(()=>{up=!0},[]),e};let ua;function al(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");var i;(e=ua)!=null&&e.has(r)||((i=ua)==null||i.add(r),console.warn(r))}function Cg(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,((o=e.get(t))==null?void 0:o.filter(r=>r!==n))||[])}}}process.env.NODE_ENV!=="production"&&(ua=new Set);const Eg=J.createContext(null),jg=J.createContext(null),Ho=()=>{var e;return((e=J.useContext(Eg))==null?void 0:e.id)||null},Bo=()=>J.useContext(jg);function Dx(e){const{children:t,id:n}=e,o=Ho();return J.createElement(Eg.Provider,{value:J.useMemo(()=>({id:n,parentId:o}),[n,o])},t)}function Mx(e){const{children:t}=e,n=J.useRef([]),o=J.useCallback(a=>{n.current=[...n.current,a]},[]),r=J.useCallback(a=>{n.current=n.current.filter(s=>s!==a)},[]),i=J.useState(()=>Cg())[0];return J.createElement(jg.Provider,{value:J.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:i}),[o,r,i])},t)}function da(e){return"data-floating-ui-"+e}function In(e){const t=v.useRef(e);return dt(()=>{t.current=e}),t}const fp=da("safe-polygon");function sl(e,t,n){return n&&!qi(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}let pp=0;function Ao(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(pp);const i=()=>e==null?void 0:e.focus({preventScroll:n});r?i():pp=requestAnimationFrame(i)}function Or(e,t){let n=e.filter(r=>{var i;return r.parentId===t&&((i=r.context)==null?void 0:i.open)}),o=n;for(;o.length;)o=e.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var s;return r.parentId===a.id&&((s=r.context)==null?void 0:s.open)})}),n=n.concat(o);return n}let Wr=new WeakMap,qa=new WeakSet,Ja={},cl=0;const _g=e=>e&&(e.host||_g(e.parentNode));function $x(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,a=((f,p)=>p.map(h=>{if(f.contains(h))return h;const m=_g(h);return f.contains(m)?m:null}).filter(h=>h!=null))(t,e),s=new Set,c=new Set(a),u=[];Ja[r]||(Ja[r]=new WeakMap);const d=Ja[r];return a.forEach(function f(p){!p||s.has(p)||(s.add(p),p.parentNode&&f(p.parentNode))}),function f(p){!p||c.has(p)||[].forEach.call(p.children,h=>{if(Qo(h)!=="script")if(s.has(h))f(h);else{const m=i?h.getAttribute(i):null,g=m!==null&&m!=="false",y=(Wr.get(h)||0)+1,b=(d.get(h)||0)+1;Wr.set(h,y),d.set(h,b),u.push(h),y===1&&g&&qa.add(h),b===1&&h.setAttribute(r,""),!g&&i&&h.setAttribute(i,"true")}})}(t),s.clear(),cl++,()=>{u.forEach(f=>{const p=(Wr.get(f)||0)-1,h=(d.get(f)||0)-1;Wr.set(f,p),d.set(f,h),p||(!qa.has(f)&&i&&f.removeAttribute(i),qa.delete(f)),h||f.removeAttribute(r)}),cl--,cl||(Wr=new WeakMap,Wr=new WeakMap,qa=new WeakSet,Ja={})}}function hp(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Ft(e[0]).body;return $x(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Hs=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function mp(e,t){const n=Ed(e,Hs());t==="prev"&&n.reverse();const o=n.indexOf(fo(Ft(e)));return n.slice(o+1)[0]}function gp(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!It(n,o)}const Od={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function yp(e){e.key==="Tab"&&(e.target,clearTimeout(void 0))}const vp=J.forwardRef(function(e,t){const[n,o]=J.useState();dt(()=>(ig()&&o("button"),document.addEventListener("keydown",yp),()=>{document.removeEventListener("keydown",yp)}),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[da("focus-guard")]:"",style:Od};return J.createElement("span",$s({},e,r))}),Hx=J.createContext(null),hu="data-floating-ui-focusable";function Og(e){return e?e.hasAttribute(hu)?e:e.querySelector("["+hu+"]")||e:null}let vr=[];function ll(e){vr=vr.filter(n=>n.isConnected);let t=e;if(t&&Qo(t)!=="body"){if(!function(n,o){if(o=o||{},!n)throw new Error("No node provided");return pi.call(n,Rs)!==!1&&fu(o,n)}(t,Hs())){const n=Ed(t,Hs())[0];n&&(t=n)}vr.push(t),vr.length>20&&(vr=vr.slice(-20))}}function wp(){return vr.slice().reverse().find(e=>e.isConnected)}const Bx=J.forwardRef(function(e,t){return J.createElement("button",$s({},e,{type:"button",ref:t,tabIndex:-1,style:Od}))});function zx(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:s=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:p,refs:h,nodeId:m,onOpenChange:g,events:y,dataRef:b,floatingId:k,elements:{domReference:x,floating:S}}=t,w=typeof a=="number"&&a<0,C=lu(x)&&w,O=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,_=In(r),N=In(a),E=In(s),A=Bo(),j=J.useContext(Hx),B=J.useRef(null),$=J.useRef(null),R=J.useRef(!1),F=J.useRef(!1),z=J.useRef(-1),V=j!=null,L=Og(S),H=Yt(function(D){return D===void 0&&(D=L),D?Ed(D,Hs()):[]}),W=Yt(D=>{const T=H(D);return _.current.map(P=>x&&P==="reference"?x:L&&P==="floating"?L:T).filter(Boolean).flat()});function U(D){return!o&&d&&u?J.createElement(Bx,{ref:D==="start"?B:$,onClick:T=>g(!1,T.nativeEvent)},typeof d=="string"?d:"Dismiss"):null}J.useEffect(()=>{if(o||!u)return;function D(P){if(P.key==="Tab"){It(L,fo(Ft(L)))&&H().length===0&&!C&&Gt(P);const I=W(),G=No(P);_.current[0]==="reference"&&G===x&&(Gt(P),P.shiftKey?Ao(I[I.length-1]):Ao(I[1])),_.current[1]==="floating"&&G===L&&P.shiftKey&&(Gt(P),Ao(I[0]))}}const T=Ft(L);return T.addEventListener("keydown",D),()=>{T.removeEventListener("keydown",D)}},[o,x,L,u,_,C,H,W]),J.useEffect(()=>{if(!o&&S)return S.addEventListener("focusin",D),()=>{S.removeEventListener("focusin",D)};function D(T){const P=No(T),I=H().indexOf(P);I!==-1&&(z.current=I)}},[o,S,H]),J.useEffect(()=>{if(!o&&f)return S&&Et(x)?(x.addEventListener("focusout",T),x.addEventListener("pointerdown",D),S.addEventListener("focusout",T),()=>{x.removeEventListener("focusout",T),x.removeEventListener("pointerdown",D),S.removeEventListener("focusout",T)}):void 0;function D(){F.current=!0,setTimeout(()=>{F.current=!1})}function T(P){const I=P.relatedTarget;queueMicrotask(()=>{const G=!(It(x,I)||It(S,I)||It(I,S)||It(j==null?void 0:j.portalNode,I)||I!=null&&I.hasAttribute(da("focus-guard"))||A&&(Or(A.nodesRef.current,m).find(K=>{var X,Z;return It((X=K.context)==null?void 0:X.elements.floating,I)||It((Z=K.context)==null?void 0:Z.elements.domReference,I)})||function(K,X){var Z;let M=[],se=(Z=K.find(ce=>ce.id===X))==null?void 0:Z.parentId;for(;se;){const ce=K.find(ge=>ge.id===se);se=ce==null?void 0:ce.parentId,ce&&(M=M.concat(ce))}return M}(A.nodesRef.current,m).find(K=>{var X,Z;return((X=K.context)==null?void 0:X.elements.floating)===I||((Z=K.context)==null?void 0:Z.elements.domReference)===I})));if(c&&G&&fo(Ft(L))===Ft(L).body){Et(L)&&L.focus();const K=z.current,X=H(),Z=X[K]||X[X.length-1]||L;Et(Z)&&Z.focus()}!C&&u||!I||!G||F.current||I===wp()||(R.current=!0,g(!1,P,"focus-out"))})}},[o,x,S,L,u,m,A,j,g,f,c,H,C]),J.useEffect(()=>{var D;if(o)return;const T=Array.from((j==null||(D=j.portalNode)==null?void 0:D.querySelectorAll("["+da("portal")+"]"))||[]);if(S){const P=[S,...T,B.current,$.current,_.current.includes("reference")||C?x:null].filter(G=>G!=null),I=u||C?hp(P,O,!O):hp(P);return()=>{I()}}},[o,x,S,u,_,j,C,O]),dt(()=>{if(o||!Et(L))return;const D=fo(Ft(L));queueMicrotask(()=>{const T=W(L),P=N.current,I=(typeof P=="number"?T[P]:P.current)||L,G=It(L,D);w||G||!p||Ao(I,{preventScroll:I===L})})},[o,p,L,w,W,N]),dt(()=>{if(o||!L)return;let D=!1;const T=Ft(L),P=fo(T);let I=b.current.openEvent;function G(X){let{open:Z,reason:M,event:se,nested:ce}=X;Z&&(I=se),M==="escape-key"&&h.domReference.current&&ll(h.domReference.current),M==="hover"&&se.type==="mouseleave"&&(R.current=!0),M==="outside-press"&&(ce?(R.current=!1,D=!0):R.current=!(og(se)||rg(se)))}ll(P),y.on("openchange",G);const K=T.createElement("span");return K.setAttribute("tabindex","-1"),K.setAttribute("aria-hidden","true"),Object.assign(K.style,Od),V&&x&&x.insertAdjacentElement("afterend",K),()=>{y.off("openchange",G);const X=fo(T),Z=It(S,X)||A&&Or(A.nodesRef.current,m).some(se=>{var ce;return It((ce=se.context)==null?void 0:ce.elements.floating,X)});(Z||I&&["click","mousedown"].includes(I.type))&&h.domReference.current&&ll(h.domReference.current);const M=typeof E.current=="boolean"?wp()||K:E.current.current||K;queueMicrotask(()=>{E.current&&!R.current&&Et(M)&&(M===X||X===T.body||Z)&&M.focus({preventScroll:D}),K.remove()})}},[o,S,L,E,b,h,y,A,m,V,x]),J.useEffect(()=>{queueMicrotask(()=>{R.current=!1})},[o]),dt(()=>{if(!o&&j)return j.setFocusManagerState({modal:u,closeOnFocusOut:f,open:p,onOpenChange:g,refs:h}),()=>{j.setFocusManagerState(null)}},[o,j,u,p,g,h,f]),dt(()=>{if(o||!L||typeof MutationObserver!="function"||w)return;const D=()=>{const P=L.getAttribute("tabindex"),I=H(),G=fo(Ft(S)),K=I.indexOf(G);K!==-1&&(z.current=K),_.current.includes("floating")||G!==h.domReference.current&&I.length===0?P!=="0"&&L.setAttribute("tabindex","0"):P!=="-1"&&L.setAttribute("tabindex","-1")};D();const T=new MutationObserver(D);return T.observe(L,{childList:!0,subtree:!0,attributes:!0}),()=>{T.disconnect()}},[o,S,L,h,_,H,w]);const Y=!o&&O&&(!u||!C)&&(V||u);return J.createElement(J.Fragment,null,Y&&J.createElement(vp,{"data-type":"inside",ref:j==null?void 0:j.beforeInsideRef,onFocus:D=>{if(u){const P=W();Ao(r[0]==="reference"?P[0]:P[P.length-1])}else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(R.current=!1,gp(D,j.portalNode)){const P=mp(document.body,"next")||x;P==null||P.focus()}else{var T;(T=j.beforeOutsideRef.current)==null||T.focus()}}}),!C&&U("start"),n,U("end"),Y&&J.createElement(vp,{"data-type":"inside",ref:j==null?void 0:j.afterInsideRef,onFocus:D=>{if(u)Ao(W()[0]);else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(f&&(R.current=!0),gp(D,j.portalNode)){const P=mp(document.body,"prev")||x;P==null||P.focus()}else{var T;(T=j.afterOutsideRef.current)==null||T.focus()}}}))}function bp(e){return Et(e.target)&&e.target.tagName==="BUTTON"}function xp(e){return ag(e)}const Fx={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Wx={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kp=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null&&t,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)==null||n}};function Ux(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=pu(),i=J.useRef({}),[a]=J.useState(()=>Cg()),s=Ho()!=null;if(process.env.NODE_ENV!=="production"){const h=o.reference;h&&!at(h)&&function(){for(var m,g=arguments.length,y=new Array(g),b=0;b<g;b++)y[b]=arguments[b];const k="Floating UI: "+y.join(" ");var x;(m=ua)!=null&&m.has(k)||((x=ua)==null||x.add(k),console.error(k))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,u]=J.useState(o.reference),d=Yt((h,m,g)=>{i.current.openEvent=h?m:void 0,a.emit("openchange",{open:h,event:m,reason:g,nested:s}),n==null||n(h,m,g)}),f=J.useMemo(()=>({setPositionReference:u}),[]),p=J.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return J.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:p,events:a,floatingId:r,refs:f}),[t,d,p,a,r,f])}function Vx(e){e===void 0&&(e={});const{nodeId:t}=e,n=Ux({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,a]=J.useState(null),[s,c]=J.useState(null),u=(r==null?void 0:r.domReference)||i,d=J.useRef(null),f=Bo();dt(()=>{u&&(d.current=u)},[u]);const p=function(k){k===void 0&&(k={});const{placement:x="bottom",strategy:S="absolute",middleware:w=[],platform:C,elements:{reference:O,floating:_}={},transform:N=!0,whileElementsMounted:E,open:A}=k,[j,B]=J.useState({x:0,y:0,strategy:S,placement:x,middlewareData:{},isPositioned:!1}),[$,R]=J.useState(w);Ms($,w)||R(w);const[F,z]=J.useState(null),[V,L]=J.useState(null),H=J.useCallback(be=>{be!==D.current&&(D.current=be,z(be))},[]),W=J.useCallback(be=>{be!==T.current&&(T.current=be,L(be))},[]),U=O||F,Y=_||V,D=J.useRef(null),T=J.useRef(null),P=J.useRef(j),I=E!=null,G=rl(E),K=rl(C),X=rl(A),Z=J.useCallback(()=>{if(!D.current||!T.current)return;const be={placement:x,strategy:S,middleware:$};K.current&&(be.platform=K.current),_x(D.current,T.current,be).then(Ee=>{const ne={...Ee,isPositioned:X.current!==!1};M.current&&!Ms(P.current,ne)&&(P.current=ne,Mm.flushSync(()=>{B(ne)}))})},[$,x,S,K,X]);vs(()=>{A===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,B(be=>({...be,isPositioned:!1})))},[A]);const M=J.useRef(!1);vs(()=>(M.current=!0,()=>{M.current=!1}),[]),vs(()=>{if(U&&(D.current=U),Y&&(T.current=Y),U&&Y){if(G.current)return G.current(U,Y,Z);Z()}},[U,Y,Z,G,I]);const se=J.useMemo(()=>({reference:D,floating:T,setReference:H,setFloating:W}),[H,W]),ce=J.useMemo(()=>({reference:U,floating:Y}),[U,Y]),ge=J.useMemo(()=>{const be={position:S,left:0,top:0};if(!ce.floating)return be;const Ee=cp(ce.floating,j.x),ne=cp(ce.floating,j.y);return N?{...be,transform:"translate("+Ee+"px, "+ne+"px)",...wg(ce.floating)>=1.5&&{willChange:"transform"}}:{position:S,left:Ee,top:ne}},[S,N,ce.floating,j.x,j.y]);return J.useMemo(()=>({...j,update:Z,refs:se,elements:ce,floatingStyles:ge}),[j,Z,se,ce,ge])}({...e,elements:{...r,...s&&{reference:s}}}),h=J.useCallback(k=>{const x=at(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;c(x),p.refs.setReference(x)},[p.refs]),m=J.useCallback(k=>{(at(k)||k===null)&&(d.current=k,a(k)),(at(p.refs.reference.current)||p.refs.reference.current===null||k!==null&&!at(k))&&p.refs.setReference(k)},[p.refs]),g=J.useMemo(()=>({...p.refs,setReference:m,setPositionReference:h,domReference:d}),[p.refs,m,h]),y=J.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),b=J.useMemo(()=>({...p,...o,refs:g,elements:y,nodeId:t}),[p,g,y,t,o]);return dt(()=>{o.dataRef.current.floatingContext=b;const k=f==null?void 0:f.nodesRef.current.find(x=>x.id===t);k&&(k.context=b)}),J.useMemo(()=>({...p,context:b,refs:g,elements:y}),[p,g,y,b])}const Sp="active",Cp="selected";function ul(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[Sp]:a,[Cp]:s,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1,[hu]:""},...i,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(c=>{let[u,d]=c;var f;r&&[Sp,Cp].includes(u)||(u.indexOf("on")===0?(o.has(u)||o.set(u,[]),typeof d=="function"&&((f=o.get(u))==null||f.push(d),a[u]=function(){for(var p,h=arguments.length,m=new Array(h),g=0;g<h;g++)m[g]=arguments[g];return(p=o.get(u))==null?void 0:p.map(y=>y(...m)).find(y=>y!==void 0)})):a[u]=d)}),a),{})}}let Ep=!1;function yc(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function jp(e,t){return yc(t,e===_d||e===ta,e===To||e===Io)}function dl(e,t,n){return yc(t,e===ta,n?e===To:e===Io)||e==="Enter"||e===" "||e===""}function _p(e,t,n){return yc(t,n?e===Io:e===To,e===_d)}function Kx(e,t){const{open:n,onOpenChange:o,elements:r}=e,{listRef:i,activeIndex:a,onNavigate:s=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:p=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:k,orientation:x="vertical",cols:S=1,scrollItemIntoView:w=!0,virtualItemRef:C,itemSizes:O,dense:_=!1}=t;process.env.NODE_ENV!=="production"&&(d&&(f||al("`useListNavigation` looping must be enabled to allow escaping."),m||al("`useListNavigation` must be virtual to allow escaping.")),x==="vertical"&&S>1&&al("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const N=In(Og(r.floating)),E=Ho(),A=Bo(),j=Yt(s),B=lu(r.domReference),$=J.useRef(g),R=J.useRef(u??-1),F=J.useRef(null),z=J.useRef(!0),V=J.useRef(j),L=J.useRef(!!r.floating),H=J.useRef(n),W=J.useRef(!1),U=J.useRef(!1),Y=In(k),D=In(n),T=In(w),P=In(u),[I,G]=J.useState(),[K,X]=J.useState(),Z=Yt(function(ne,oe,te){function Se(le){m?(G(le.id),A==null||A.events.emit("virtualfocus",le),C&&(C.current=le)):Ao(le,{preventScroll:!0,sync:!(!tg().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!ig())&&(Ep||W.current)})}te===void 0&&(te=!1);const Ie=ne.current[oe.current];Ie&&Se(Ie),requestAnimationFrame(()=>{const le=ne.current[oe.current]||Ie;if(!le)return;Ie||Se(le);const Re=T.current;Re&&se&&(te||!z.current)&&(le.scrollIntoView==null||le.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))})});dt(()=>{document.createElement("div").focus({get preventScroll(){return Ep=!0,!1}})},[]),dt(()=>{c&&(n&&r.floating?$.current&&u!=null&&(U.current=!0,R.current=u,j(u)):L.current&&(R.current=-1,V.current(null)))},[c,n,r.floating,u,j]),dt(()=>{if(c&&n&&r.floating)if(a==null){if(W.current=!1,P.current!=null)return;if(L.current&&(R.current=-1,Z(i,R)),(!H.current||!L.current)&&$.current&&(F.current!=null||$.current===!0&&F.current==null)){let ne=0;const oe=()=>{i.current[0]==null?(ne<2&&(ne?requestAnimationFrame:queueMicrotask)(oe),ne++):(R.current=F.current==null||dl(F.current,x,h)||p?il(i,Y.current):lp(i,Y.current),F.current=null,j(R.current))};oe()}}else Li(i,a)||(R.current=a,Z(i,R,U.current),U.current=!1)},[c,n,r.floating,a,P,p,i,x,h,j,Z,Y]),dt(()=>{var ne;if(!c||r.floating||!A||m||!L.current)return;const oe=A.nodesRef.current,te=(ne=oe.find(le=>le.id===E))==null||(ne=ne.context)==null?void 0:ne.elements.floating,Se=fo(Ft(r.floating)),Ie=oe.some(le=>le.context&&It(le.context.elements.floating,Se));te&&!Ie&&z.current&&te.focus({preventScroll:!0})},[c,r.floating,A,E,m]),dt(()=>{if(c&&A&&m&&!E)return A.events.on("virtualfocus",ne),()=>{A.events.off("virtualfocus",ne)};function ne(oe){X(oe.id),C&&(C.current=oe)}},[c,A,m,E,C]),dt(()=>{V.current=j,L.current=!!r.floating}),dt(()=>{n||(F.current=null)},[n]),dt(()=>{H.current=n},[n]);const M=a!=null,se=J.useMemo(()=>{function ne(oe){if(!n)return;const te=i.current.indexOf(oe);te!==-1&&j(te)}return{onFocus(oe){let{currentTarget:te}=oe;ne(te)},onClick:oe=>{let{currentTarget:te}=oe;return te.focus({preventScroll:!0})},...y&&{onMouseMove(oe){let{currentTarget:te}=oe;ne(te)},onPointerLeave(oe){let{pointerType:te}=oe;z.current&&te!=="touch"&&(R.current=-1,Z(i,R),j(null),m||Ao(N.current,{preventScroll:!0}))}}}},[n,N,Z,y,i,j,m]),ce=Yt(ne=>{if(z.current=!1,W.current=!0,ne.which===229||!D.current&&ne.currentTarget===N.current)return;if(p&&_p(ne.key,x,h))return Gt(ne),o(!1,ne.nativeEvent,"list-navigation"),void(Et(r.domReference)&&(m?A==null||A.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const oe=R.current,te=il(i,k),Se=lp(i,k);if(B||(ne.key==="Home"&&(Gt(ne),R.current=te,j(R.current)),ne.key==="End"&&(Gt(ne),R.current=Se,j(R.current))),S>1){const Ie=O||Array.from({length:i.current.length},()=>({width:1,height:1})),le=function(_e,Pe,$e){const Le=[];let de=0;return _e.forEach((ye,re)=>{let{width:ve,height:He}=ye;if(ve>Pe&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+re+" is greater than grid columns");let we=!1;for($e&&(de=0);!we;){const ie=[];for(let ee=0;ee<ve;ee++)for(let ae=0;ae<He;ae++)ie.push(de+ee+ae*Pe);de%Pe+ve<=Pe&&ie.every(ee=>Le[ee]==null)?(ie.forEach(ee=>{Le[ee]=re}),we=!0):de++}}),[...Le]}(Ie,S,_),Re=le.findIndex(_e=>_e!=null&&!ws(i.current,_e,k)),Ye=le.reduce((_e,Pe,$e)=>Pe==null||ws(i.current,Pe,k)?_e:$e,-1),st=le[function(_e,Pe){let{event:$e,orientation:Le,loop:de,rtl:ye,cols:re,disabledIndices:ve,minIndex:He,maxIndex:we,prevIndex:ie,stopEvent:ee=!1}=Pe,ae=ie;if($e.key===_d){if(ee&&Gt($e),ie===-1)ae=we;else if(ae=zt(_e,{startingIndex:ae,amount:re,decrement:!0,disabledIndices:ve}),de&&(ie-re<He||ae<0)){const me=ie%re,De=we%re,je=we-(De-me);ae=De===me?we:De>me?je:je-re}Li(_e,ae)&&(ae=ie)}if($e.key===ta&&(ee&&Gt($e),ie===-1?ae=He:(ae=zt(_e,{startingIndex:ie,amount:re,disabledIndices:ve}),de&&ie+re>we&&(ae=zt(_e,{startingIndex:ie%re-re,amount:re,disabledIndices:ve}))),Li(_e,ae)&&(ae=ie)),Le==="both"){const me=Xr(ie/re);$e.key===(ye?To:Io)&&(ee&&Gt($e),ie%re!==re-1?(ae=zt(_e,{startingIndex:ie,disabledIndices:ve}),de&&Ga(ae,re,me)&&(ae=zt(_e,{startingIndex:ie-ie%re-1,disabledIndices:ve}))):de&&(ae=zt(_e,{startingIndex:ie-ie%re-1,disabledIndices:ve})),Ga(ae,re,me)&&(ae=ie)),$e.key===(ye?Io:To)&&(ee&&Gt($e),ie%re!==0?(ae=zt(_e,{startingIndex:ie,decrement:!0,disabledIndices:ve}),de&&Ga(ae,re,me)&&(ae=zt(_e,{startingIndex:ie+(re-ie%re),decrement:!0,disabledIndices:ve}))):de&&(ae=zt(_e,{startingIndex:ie+(re-ie%re),decrement:!0,disabledIndices:ve})),Ga(ae,re,me)&&(ae=ie));const De=Xr(we/re)===me;Li(_e,ae)&&(ae=de&&De?$e.key===(ye?Io:To)?we:zt(_e,{startingIndex:ie-ie%re-1,disabledIndices:ve}):ie)}return ae}({current:le.map(_e=>_e!=null?i.current[_e]:null)},{event:ne,orientation:x,loop:f,rtl:h,cols:S,disabledIndices:Tx([...k||i.current.map((_e,Pe)=>ws(i.current,Pe)?Pe:void 0),void 0],le),minIndex:Re,maxIndex:Ye,prevIndex:Nx(R.current>Se?te:R.current,Ie,le,S,ne.key===ta?"bl":ne.key===(h?To:Io)?"tr":"tl"),stopEvent:!0})];if(st!=null&&(R.current=st,j(R.current)),x==="both")return}if(jp(ne.key,x)){if(Gt(ne),n&&!m&&fo(ne.currentTarget.ownerDocument)===ne.currentTarget)return R.current=dl(ne.key,x,h)?te:Se,void j(R.current);dl(ne.key,x,h)?R.current=f?oe>=Se?d&&oe!==i.current.length?-1:te:zt(i,{startingIndex:oe,disabledIndices:k}):Math.min(Se,zt(i,{startingIndex:oe,disabledIndices:k})):R.current=f?oe<=te?d&&oe!==-1?i.current.length:Se:zt(i,{startingIndex:oe,decrement:!0,disabledIndices:k}):Math.max(te,zt(i,{startingIndex:oe,decrement:!0,disabledIndices:k})),Li(i,R.current)?j(null):j(R.current)}}),ge=J.useMemo(()=>m&&n&&M&&{"aria-activedescendant":K||I},[m,n,M,K,I]),be=J.useMemo(()=>({"aria-orientation":x==="both"?void 0:x,...!lu(r.domReference)&&ge,onKeyDown:ce,onPointerMove(){z.current=!0}}),[ge,ce,r.domReference,x]),Ee=J.useMemo(()=>{function ne(oe){g==="auto"&&og(oe.nativeEvent)&&($.current=!0)}return{...ge,onKeyDown(oe){z.current=!1;const te=oe.key.startsWith("Arrow"),Se=["Home","End"].includes(oe.key),Ie=te||Se,le=function(Le,de,ye){return yc(de,ye?Le===To:Le===Io,Le===ta)}(oe.key,x,h),Re=_p(oe.key,x,h),Ye=jp(oe.key,x),st=(p?le:Ye)||oe.key==="Enter"||oe.key.trim()==="";if(m&&n){const Le=A==null?void 0:A.nodesRef.current.find(ye=>ye.parentId==null),de=A&&Le?function(ye,re){let ve,He=-1;return function we(ie,ee){ee>He&&(ve=ie,He=ee),Or(ye,ie).forEach(ae=>{we(ae.id,ee+1)})}(re,0),ye.find(we=>we.id===ve)}(A.nodesRef.current,Le.id):null;if(Ie&&de&&C){const ye=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(le||Re){var _e,Pe;const re=((_e=de.context)==null?void 0:_e.elements.domReference)===oe.currentTarget,ve=Re&&!re?(Pe=de.context)==null?void 0:Pe.elements.domReference:le?i.current.find(He=>(He==null?void 0:He.id)===I):null;ve&&(Gt(oe),ve.dispatchEvent(ye),X(void 0))}var $e;if((Ye||Se)&&de.context&&de.context.open&&de.parentId&&oe.currentTarget!==de.context.elements.domReference)return Gt(oe),void(($e=de.context.elements.domReference)==null||$e.dispatchEvent(ye))}return ce(oe)}(n||b||!te)&&(st&&(F.current=p&&Ye?null:oe.key),p?le&&(Gt(oe),n?(R.current=il(i,Y.current),j(R.current)):o(!0,oe.nativeEvent,"list-navigation")):Ye&&(u!=null&&(R.current=u),Gt(oe),!n&&b?o(!0,oe.nativeEvent,"list-navigation"):ce(oe),n&&j(R.current)))},onFocus(){n&&!m&&j(null)},onPointerDown:function(oe){$.current=g,g==="auto"&&rg(oe.nativeEvent)&&($.current=!0)},onMouseDown:ne,onClick:ne}},[I,ge,ce,Y,g,i,p,j,o,n,b,x,h,u,A,m,C]);return J.useMemo(()=>c?{reference:Ee,floating:be,item:se}:{},[c,Ee,be,se])}const Gx=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Op(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let a=0,s=i-1;a<i;s=a++){const[c,u]=t[a]||[0,0],[d,f]=t[s]||[0,0];u>=o!=f>=o&&n<=(d-c)*(o-u)/(f-u)+c&&(r=!r)}return r}function qx(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let r,i=!1,a=null,s=null,c=performance.now();const u=d=>{let{x:f,y:p,placement:h,elements:m,onClose:g,nodeId:y,tree:b}=d;return function(k){function x(){clearTimeout(r),g()}if(clearTimeout(r),!m.domReference||!m.floating||h==null||f==null||p==null)return;const{clientX:S,clientY:w}=k,C=[S,w],O=No(k),_=k.type==="mouseleave",N=It(m.floating,O),E=It(m.domReference,O),A=m.domReference.getBoundingClientRect(),j=m.floating.getBoundingClientRect(),B=h.split("-")[0],$=f>j.right-j.width/2,R=p>j.bottom-j.height/2,F=function(D,T){return D[0]>=T.x&&D[0]<=T.x+T.width&&D[1]>=T.y&&D[1]<=T.y+T.height}(C,A),z=j.width>A.width,V=j.height>A.height,L=(z?A:j).left,H=(z?A:j).right,W=(V?A:j).top,U=(V?A:j).bottom;if(N&&(i=!0,!_))return;if(E&&(i=!1),E&&!_)return void(i=!0);if(_&&at(k.relatedTarget)&&It(m.floating,k.relatedTarget)||b&&Or(b.nodesRef.current,y).some(D=>{let{context:T}=D;return T==null?void 0:T.open}))return;if(B==="top"&&p>=A.bottom-1||B==="bottom"&&p<=A.top+1||B==="left"&&f>=A.right-1||B==="right"&&f<=A.left+1)return x();let Y=[];switch(B){case"top":Y=[[L,A.top+1],[L,j.bottom-1],[H,j.bottom-1],[H,A.top+1]];break;case"bottom":Y=[[L,j.top+1],[L,A.bottom-1],[H,A.bottom-1],[H,j.top+1]];break;case"left":Y=[[j.right-1,U],[j.right-1,W],[A.left+1,W],[A.left+1,U]];break;case"right":Y=[[A.right-1,U],[A.right-1,W],[j.left+1,W],[j.left+1,U]]}if(!Op([S,w],Y)){if(i&&!F)return x();if(!_&&o){const D=function(T,P){const I=performance.now(),G=I-c;if(a===null||s===null||G===0)return a=T,s=P,c=I,null;const K=T-a,X=P-s,Z=Math.sqrt(K*K+X*X);return a=T,s=P,c=I,Z/G}(k.clientX,k.clientY);if(D!==null&&D<.1)return x()}Op([S,w],function(D){let[T,P]=D;switch(B){case"top":return[[z?T+t/2:$?T+4*t:T-4*t,P+t+1],[z?T-t/2:$?T+4*t:T-4*t,P+t+1],[j.left,$||z?j.bottom-t:j.top],[j.right,$?z?j.bottom-t:j.top:j.bottom-t]];case"bottom":return[[z?T+t/2:$?T+4*t:T-4*t,P-t],[z?T-t/2:$?T+4*t:T-4*t,P-t],[j.left,$||z?j.top+t:j.bottom],[j.right,$?z?j.top+t:j.bottom:j.top+t]];case"left":{const I=[T+t+1,V?P+t/2:R?P+4*t:P-4*t],G=[T+t+1,V?P-t/2:R?P+4*t:P-4*t];return[[R||V?j.right-t:j.left,j.top],[R?V?j.right-t:j.left:j.right-t,j.bottom],I,G]}case"right":return[[T-t,V?P+t/2:R?P+4*t:P-4*t],[T-t,V?P-t/2:R?P+4*t:P-4*t],[R||V?j.left+t:j.right,j.top],[R?V?j.left+t:j.right:j.left+t,j.bottom]]}}([f,p]))?!i&&o&&(r=window.setTimeout(x,40)):x()}}};return u.__options={blockPointerEvents:n},u}const mu=v.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Ag=v.forwardRef(({className:e,disabled:t,children:n,...o},r)=>{const i=v.useContext(mu),a=Sg(),s=Bo(),c=a.index===i.activeIndex,u=Q("io-dropdown-menu-item",t&&"io-dropdown-menu-item-disabled",e);return l.jsx("div",{ref:bg([a.ref,r]),role:"menuitem",className:u,tabIndex:c?0:-1,"aria-disabled":t,...o,...i.getItemProps({onClick(d){var f;if(t)return d.preventDefault(),void d.stopPropagation();(f=o.onClick)==null||f.call(o,d),i.setIsOpen(!1),s==null||s.events.emit("click")},onFocus(d){var f;t||((f=o.onFocus)==null||f.call(o,d),i.setHasFocusInside(!0))}}),children:n})});Ag.displayName="DropdownMenuItem";const gu=v.forwardRef(({className:e,variant:t="default",icon:n,iconRight:o,text:r="",disabled:i,children:a,...s},c)=>{const[u,d]=v.useState(!1),[f,p]=v.useState(!1),[h,m]=v.useState(null),g=v.useRef([]),y=v.useRef([]),b=v.useContext(mu),k=Bo(),x=function(){const T=pu(),P=Bo(),I=Ho();return dt(()=>{const G={id:T,parentId:I};return P==null||P.addNode(G),()=>{P==null||P.removeNode(G)}},[P,T,I]),T}(),S=Ho(),w=Sg(),C=S!=null,{floatingStyles:O,refs:_,context:N}=Vx({nodeId:x,open:u,onOpenChange:d,placement:C?"right-start":"bottom-start",middleware:[(E={mainAxis:C?0:4,alignmentAxis:C?-4:0},{...Cx(E),options:[E,A]}),Ax(),Ox()],whileElementsMounted:Sx});var E,A;const j=function(T,P){P===void 0&&(P={});const{open:I,onOpenChange:G,dataRef:K,events:X,elements:Z}=T,{enabled:M=!0,delay:se=0,handleClose:ce=null,mouseOnly:ge=!1,restMs:be=0,move:Ee=!0}=P,ne=Bo(),oe=Ho(),te=In(ce),Se=In(se),Ie=In(I),le=J.useRef(),Re=J.useRef(-1),Ye=J.useRef(),st=J.useRef(-1),_e=J.useRef(!0),Pe=J.useRef(!1),$e=J.useRef(()=>{}),Le=J.useRef(!1),de=J.useCallback(()=>{var ee;const ae=(ee=K.current.openEvent)==null?void 0:ee.type;return(ae==null?void 0:ae.includes("mouse"))&&ae!=="mousedown"},[K]);J.useEffect(()=>{if(M)return X.on("openchange",ee),()=>{X.off("openchange",ee)};function ee(ae){let{open:me}=ae;me||(clearTimeout(Re.current),clearTimeout(st.current),_e.current=!0,Le.current=!1)}},[M,X]),J.useEffect(()=>{if(!M||!te.current||!I)return;function ee(me){de()&&G(!1,me,"hover")}const ae=Ft(Z.floating).documentElement;return ae.addEventListener("mouseleave",ee),()=>{ae.removeEventListener("mouseleave",ee)}},[Z.floating,I,G,M,te,de]);const ye=J.useCallback(function(ee,ae,me){ae===void 0&&(ae=!0),me===void 0&&(me="hover");const De=sl(Se.current,"close",le.current);De&&!Ye.current?(clearTimeout(Re.current),Re.current=window.setTimeout(()=>G(!1,ee,me),De)):ae&&(clearTimeout(Re.current),G(!1,ee,me))},[Se,G]),re=Yt(()=>{$e.current(),Ye.current=void 0}),ve=Yt(()=>{if(Pe.current){const ee=Ft(Z.floating).body;ee.style.pointerEvents="",ee.removeAttribute(fp),Pe.current=!1}}),He=Yt(()=>!!K.current.openEvent&&["click","mousedown"].includes(K.current.openEvent.type));J.useEffect(()=>{if(M&&at(Z.domReference)){var ee;const je=Z.domReference;return I&&je.addEventListener("mouseleave",De),(ee=Z.floating)==null||ee.addEventListener("mouseleave",De),Ee&&je.addEventListener("mousemove",ae,{once:!0}),je.addEventListener("mouseenter",ae),je.addEventListener("mouseleave",me),()=>{var ct;I&&je.removeEventListener("mouseleave",De),(ct=Z.floating)==null||ct.removeEventListener("mouseleave",De),Ee&&je.removeEventListener("mousemove",ae),je.removeEventListener("mouseenter",ae),je.removeEventListener("mouseleave",me)}}function ae(je){if(clearTimeout(Re.current),_e.current=!1,ge&&!qi(le.current)||be>0&&!sl(Se.current,"open"))return;const ct=sl(Se.current,"open",le.current);ct?Re.current=window.setTimeout(()=>{Ie.current||G(!0,je,"hover")},ct):I||G(!0,je,"hover")}function me(je){if(He())return;$e.current();const ct=Ft(Z.floating);if(clearTimeout(st.current),Le.current=!1,te.current&&K.current.floatingContext){I||clearTimeout(Re.current),Ye.current=te.current({...K.current.floatingContext,tree:ne,x:je.clientX,y:je.clientY,onClose(){ve(),re(),He()||ye(je,!0,"safe-polygon")}});const on=Ye.current;return ct.addEventListener("mousemove",on),void($e.current=()=>{ct.removeEventListener("mousemove",on)})}(le.current!=="touch"||!It(Z.floating,je.relatedTarget))&&ye(je)}function De(je){He()||K.current.floatingContext&&(te.current==null||te.current({...K.current.floatingContext,tree:ne,x:je.clientX,y:je.clientY,onClose(){ve(),re(),He()||ye(je)}})(je))}},[Z,M,T,ge,be,Ee,ye,re,ve,G,I,Ie,ne,Se,te,K,He]),dt(()=>{var ee;if(M&&I&&(ee=te.current)!=null&&ee.__options.blockPointerEvents&&de()){Pe.current=!0;const me=Z.floating;if(at(Z.domReference)&&me){var ae;const De=Ft(Z.floating).body;De.setAttribute(fp,"");const je=Z.domReference,ct=ne==null||(ae=ne.nodesRef.current.find(on=>on.id===oe))==null||(ae=ae.context)==null?void 0:ae.elements.floating;return ct&&(ct.style.pointerEvents=""),De.style.pointerEvents="none",je.style.pointerEvents="auto",me.style.pointerEvents="auto",()=>{De.style.pointerEvents="",je.style.pointerEvents="",me.style.pointerEvents=""}}}},[M,I,oe,Z,ne,te,de]),dt(()=>{I||(le.current=void 0,Le.current=!1,re(),ve())},[I,re,ve]),J.useEffect(()=>()=>{re(),clearTimeout(Re.current),clearTimeout(st.current),ve()},[M,Z.domReference,re,ve]);const we=J.useMemo(()=>{function ee(ae){le.current=ae.pointerType}return{onPointerDown:ee,onPointerEnter:ee,onMouseMove(ae){const{nativeEvent:me}=ae;function De(){_e.current||Ie.current||G(!0,me,"hover")}ge&&!qi(le.current)||I||be===0||Le.current&&ae.movementX**2+ae.movementY**2<2||(clearTimeout(st.current),le.current==="touch"?De():(Le.current=!0,st.current=window.setTimeout(De,be)))}}},[ge,G,I,Ie,be]),ie=J.useMemo(()=>({onMouseEnter(){clearTimeout(Re.current)},onMouseLeave(ee){He()||ye(ee.nativeEvent,!1)}}),[ye,He]);return J.useMemo(()=>M?{reference:we,floating:ie}:{},[M,we,ie])}(N,{enabled:C,delay:{open:75},handleClose:qx({blockPointerEvents:!0})}),B=function(T,P){P===void 0&&(P={});const{open:I,onOpenChange:G,dataRef:K,elements:{domReference:X}}=T,{enabled:Z=!0,event:M="click",toggle:se=!0,ignoreMouse:ce=!1,keyboardHandlers:ge=!0,stickIfOpen:be=!0}=P,Ee=J.useRef(),ne=J.useRef(!1),oe=J.useMemo(()=>({onPointerDown(te){Ee.current=te.pointerType},onMouseDown(te){const Se=Ee.current;te.button===0&&M!=="click"&&(qi(Se,!0)&&ce||(!I||!se||K.current.openEvent&&be&&K.current.openEvent.type!=="mousedown"?(te.preventDefault(),G(!0,te.nativeEvent,"click")):G(!1,te.nativeEvent,"click")))},onClick(te){const Se=Ee.current;M==="mousedown"&&Ee.current?Ee.current=void 0:qi(Se,!0)&&ce||(!I||!se||K.current.openEvent&&be&&K.current.openEvent.type!=="click"?G(!0,te.nativeEvent,"click"):G(!1,te.nativeEvent,"click"))},onKeyDown(te){Ee.current=void 0,te.defaultPrevented||!ge||bp(te)||(te.key!==" "||xp(X)||(te.preventDefault(),ne.current=!0),te.key==="Enter"&&G(!I||!se,te.nativeEvent,"click"))},onKeyUp(te){te.defaultPrevented||!ge||bp(te)||xp(X)||te.key===" "&&ne.current&&(ne.current=!1,G(!I||!se,te.nativeEvent,"click"))}}),[K,X,M,ce,ge,G,I,be,se]);return J.useMemo(()=>Z?{reference:oe}:{},[Z,oe])}(N,{event:"mousedown",toggle:!C,ignoreMouse:C}),$=function(T,P){var I;P===void 0&&(P={});const{open:G,floatingId:K}=T,{enabled:X=!0,role:Z="dialog"}=P,M=(I=Gx.get(Z))!=null?I:Z,se=pu(),ce=Ho()!=null,ge=J.useMemo(()=>M==="tooltip"||Z==="label"?{["aria-"+(Z==="label"?"labelledby":"describedby")]:G?K:void 0}:{"aria-expanded":G?"true":"false","aria-haspopup":M==="alertdialog"?"dialog":M,"aria-controls":G?K:void 0,...M==="listbox"&&{role:"combobox"},...M==="menu"&&{id:se},...M==="menu"&&ce&&{role:"menuitem"},...Z==="select"&&{"aria-autocomplete":"none"},...Z==="combobox"&&{"aria-autocomplete":"list"}},[M,K,ce,G,se,Z]),be=J.useMemo(()=>{const ne={id:K,...M&&{role:M}};return M==="tooltip"||Z==="label"?ne:{...ne,...M==="menu"&&{"aria-labelledby":se}}},[M,K,se,Z]),Ee=J.useCallback(ne=>{let{active:oe,selected:te}=ne;const Se={role:"option",...oe&&{id:K+"-option"}};switch(Z){case"select":return{...Se,"aria-selected":oe&&te};case"combobox":return{...Se,...oe&&{"aria-selected":!0}}}return{}},[K,Z]);return J.useMemo(()=>X?{reference:ge,floating:be,item:Ee}:{},[X,ge,be,Ee])}(N,{role:"menu"}),R=function(T,P){P===void 0&&(P={});const{open:I,onOpenChange:G,elements:K,dataRef:X}=T,{enabled:Z=!0,escapeKey:M=!0,outsidePress:se=!0,outsidePressEvent:ce="pointerdown",referencePress:ge=!1,referencePressEvent:be="pointerdown",ancestorScroll:Ee=!1,bubbles:ne,capture:oe}=P,te=Bo(),Se=Yt(typeof se=="function"?se:()=>!1),Ie=typeof se=="function"?Se:se,le=J.useRef(!1),Re=J.useRef(!1),{escapeKey:Ye,outsidePress:st}=kp(ne),{escapeKey:_e,outsidePress:Pe}=kp(oe),$e=J.useRef(!1),Le=Yt(we=>{var ie;if(!I||!Z||!M||we.key!=="Escape"||$e.current)return;const ee=(ie=X.current.floatingContext)==null?void 0:ie.nodeId,ae=te?Or(te.nodesRef.current,ee):[];if(!Ye&&(we.stopPropagation(),ae.length>0)){let me=!0;if(ae.forEach(De=>{var je;(je=De.context)==null||!je.open||De.context.dataRef.current.__escapeKeyBubbles||(me=!1)}),!me)return}G(!1,function(me){return"nativeEvent"in me}(we)?we.nativeEvent:we,"escape-key")}),de=Yt(we=>{var ie;const ee=()=>{var ae;Le(we),(ae=No(we))==null||ae.removeEventListener("keydown",ee)};(ie=No(we))==null||ie.addEventListener("keydown",ee)}),ye=Yt(we=>{var ie;const ee=le.current;le.current=!1;const ae=Re.current;if(Re.current=!1,ce==="click"&&ae||ee||typeof Ie=="function"&&!Ie(we))return;const me=No(we),De="["+da("inert")+"]",je=Ft(K.floating).querySelectorAll(De);let ct=at(me)?me:null;for(;ct&&!Vo(ct);){const Ht=ho(ct);if(Vo(Ht)||!at(Ht))break;ct=Ht}if(je.length&&at(me)&&!me.matches("html,body")&&!It(me,K.floating)&&Array.from(je).every(Ht=>!It(ct,Ht)))return;if(Et(me)&&He){const Ht=me.clientWidth>0&&me.scrollWidth>me.clientWidth,Bt=me.clientHeight>0&&me.scrollHeight>me.clientHeight;let io=Bt&&we.offsetX>me.clientWidth;if(Bt&&bn(me).direction==="rtl"&&(io=we.offsetX<=me.offsetWidth-me.clientWidth),io||Ht&&we.offsetY>me.clientHeight)return}const on=(ie=X.current.floatingContext)==null?void 0:ie.nodeId,Ii=te&&Or(te.nodesRef.current,on).some(Ht=>{var Bt;return nl(we,(Bt=Ht.context)==null?void 0:Bt.elements.floating)});if(nl(we,K.floating)||nl(we,K.domReference)||Ii)return;const lr=te?Or(te.nodesRef.current,on):[];if(lr.length>0){let Ht=!0;if(lr.forEach(Bt=>{var io;(io=Bt.context)==null||!io.open||Bt.context.dataRef.current.__outsidePressBubbles||(Ht=!1)}),!Ht)return}G(!1,we,"outside-press")}),re=Yt(we=>{var ie;const ee=()=>{var ae;ye(we),(ae=No(we))==null||ae.removeEventListener(ce,ee)};(ie=No(we))==null||ie.addEventListener(ce,ee)});J.useEffect(()=>{if(!I||!Z)return;X.current.__escapeKeyBubbles=Ye,X.current.__outsidePressBubbles=st;let we=-1;function ie(je){G(!1,je,"ancestor-scroll")}function ee(){window.clearTimeout(we),$e.current=!0}function ae(){we=window.setTimeout(()=>{$e.current=!1},pc()?5:0)}const me=Ft(K.floating);M&&(me.addEventListener("keydown",_e?de:Le,_e),me.addEventListener("compositionstart",ee),me.addEventListener("compositionend",ae)),Ie&&me.addEventListener(ce,Pe?re:ye,Pe);let De=[];return Ee&&(at(K.domReference)&&(De=Ko(K.domReference)),at(K.floating)&&(De=De.concat(Ko(K.floating))),!at(K.reference)&&K.reference&&K.reference.contextElement&&(De=De.concat(Ko(K.reference.contextElement)))),De=De.filter(je=>{var ct;return je!==((ct=me.defaultView)==null?void 0:ct.visualViewport)}),De.forEach(je=>{je.addEventListener("scroll",ie,{passive:!0})}),()=>{M&&(me.removeEventListener("keydown",_e?de:Le,_e),me.removeEventListener("compositionstart",ee),me.removeEventListener("compositionend",ae)),Ie&&me.removeEventListener(ce,Pe?re:ye,Pe),De.forEach(je=>{je.removeEventListener("scroll",ie)}),window.clearTimeout(we)}},[X,K,M,Ie,ce,I,G,Ee,Z,Ye,st,Le,_e,de,ye,Pe,re]),J.useEffect(()=>{le.current=!1},[Ie,ce]);const ve=J.useMemo(()=>({onKeyDown:Le,[Fx[be]]:we=>{ge&&G(!1,we.nativeEvent,"reference-press")}}),[Le,G,ge,be]),He=J.useMemo(()=>({onKeyDown:Le,onMouseDown(){Re.current=!0},onMouseUp(){Re.current=!0},[Wx[ce]]:()=>{le.current=!0}}),[Le,ce]);return J.useMemo(()=>Z?{reference:ve,floating:He}:{},[Z,ve,He])}(N,{bubbles:!0}),F=Kx(N,{listRef:g,activeIndex:h,nested:C,onNavigate:m}),{getReferenceProps:z,getFloatingProps:V,getItemProps:L}=function(T){T===void 0&&(T=[]);const P=T.map(M=>M==null?void 0:M.reference),I=T.map(M=>M==null?void 0:M.floating),G=T.map(M=>M==null?void 0:M.item),K=J.useCallback(M=>ul(M,T,"reference"),P),X=J.useCallback(M=>ul(M,T,"floating"),I),Z=J.useCallback(M=>ul(M,T,"item"),G);return J.useMemo(()=>({getReferenceProps:K,getFloatingProps:X,getItemProps:Z}),[K,X,Z])}([j,B,$,R,F]);v.useEffect(()=>{if(k)return k.events.on("click",T),k.events.on("menuopen",P),()=>{k.events.off("click",T),k.events.off("menuopen",P)};function T(){d(!1)}function P(I){I.nodeId!==x&&I.parentId===S&&d(!1)}},[k,x,S]),v.useEffect(()=>{u&&k&&k.events.emit("menuopen",{parentId:S,nodeId:x})},[k,u,x,S]);const H={activeIndex:h,setActiveIndex:m,getItemProps:L,setHasFocusInside:p,isOpen:u,setIsOpen:d},W=v.useMemo(()=>H,[h,m,L,p,u]),U=Q("io-dropdown-menu-button",C&&"io-dropdown-menu-item",u&&!C&&"active",e),Y=bg([_.setReference,w.ref,c]),D=b.activeIndex===w.index?0:-1;return l.jsxs(Dx,{id:x,children:[l.jsx(tt,{className:U,ref:Y,variant:C?"link":t,tabIndex:C?D:void 0,role:C?"menuitem":void 0,"data-open":u?"":void 0,"data-nested":C?"":void 0,"data-focus-inside":f?"":void 0,text:r,icon:C?"chevron-right":n,iconSize:"10",iconRight:!!C||o,disabled:i,...z(b.getItemProps({onFocus(T){var P;(P=s.onFocus)==null||P.call(s,T),p(!1),b.setHasFocusInside(!0)},...s}))}),l.jsx(mu.Provider,{value:W,children:l.jsx(Rx,{elementsRef:g,labelsRef:y,children:u&&l.jsx(zx,{context:N,modal:!1,initialFocus:C?-1:0,returnFocus:!C,children:l.jsx("div",{ref:_.setFloating,className:"io-dropdown-menu",style:O,...V(),children:a})})})})]})});gu.displayName="DropdownMenu";const Rn=v.forwardRef(({...e},t)=>Ho()===null?l.jsx(Mx,{children:l.jsx(gu,{ref:t,...e})}):l.jsx(gu,{ref:t,...e}));Rn.displayName="DropdownMenu",Rn.Item=Ag,Rn.Separator=_i;var Ap=function(e){return e.reduce(function(t,n){var o=n[0],r=n[1];return t[o]=r,t},{})},Pp=typeof window<"u"&&window.document&&window.document.createElement?J.useLayoutEffect:J.useEffect,tn="top",xn="bottom",kn="right",nn="left",yu="auto",_a=[tn,xn,kn,nn],hi="start",fa="end",Pg="viewport",Di="popper",Np=_a.reduce(function(e,t){return e.concat([t+"-"+hi,t+"-"+fa])},[]),Ng=[].concat(_a,[yu]).reduce(function(e,t){return e.concat([t,t+"-"+hi,t+"-"+fa])},[]),Jx=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Yn(e){return e?(e.nodeName||"").toLowerCase():null}function hn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Rr(e){return e instanceof hn(e).Element||e instanceof Element}function wn(e){return e instanceof hn(e).HTMLElement||e instanceof HTMLElement}function Ad(e){return typeof ShadowRoot<"u"&&(e instanceof hn(e).ShadowRoot||e instanceof ShadowRoot)}var Zx={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var o=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];wn(i)&&Yn(i)&&(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var s=r[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(o){var r=t.elements[o],i=t.attributes[o]||{},a=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:n[o]).reduce(function(s,c){return s[c]="",s},{});wn(r)&&Yn(r)&&(Object.assign(r.style,a),Object.keys(i).forEach(function(s){r.removeAttribute(s)}))})}},requires:["computeStyles"]};function Gn(e){return e.split("-")[0]}var Ar=Math.max,Bs=Math.min,mi=Math.round;function vu(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Tg(){return!/^((?!chrome|android).)*safari/i.test(vu())}function gi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&wn(e)&&(r=e.offsetWidth>0&&mi(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&mi(o.height)/e.offsetHeight||1);var a=(Rr(e)?hn(e):window).visualViewport,s=!Tg()&&n,c=(o.left+(s&&a?a.offsetLeft:0))/r,u=(o.top+(s&&a?a.offsetTop:0))/i,d=o.width/r,f=o.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Pd(e){var t=gi(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function Ig(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ad(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function mo(e){return hn(e).getComputedStyle(e)}function Yx(e){return["table","td","th"].indexOf(Yn(e))>=0}function Go(e){return((Rr(e)?e.ownerDocument:e.document)||window.document).documentElement}function vc(e){return Yn(e)==="html"?e:e.assignedSlot||e.parentNode||(Ad(e)?e.host:null)||Go(e)}function Tp(e){return wn(e)&&mo(e).position!=="fixed"?e.offsetParent:null}function Oa(e){for(var t=hn(e),n=Tp(e);n&&Yx(n)&&mo(n).position==="static";)n=Tp(n);return n&&(Yn(n)==="html"||Yn(n)==="body"&&mo(n).position==="static")?t:n||function(o){var r=/firefox/i.test(vu());if(/Trident/i.test(vu())&&wn(o)&&mo(o).position==="fixed")return null;var i=vc(o);for(Ad(i)&&(i=i.host);wn(i)&&["html","body"].indexOf(Yn(i))<0;){var a=mo(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||r&&a.willChange==="filter"||r&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}(e)||t}function Nd(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ji(e,t,n){return Ar(e,Bs(t,n))}function Rg(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Lg(e,t){return t.reduce(function(n,o){return n[o]=e,n},{})}var Xx={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Gn(n.placement),c=Nd(s),u=[nn,kn].indexOf(s)>=0?"height":"width";if(i&&a){var d=function(_,N){return Rg(typeof(_=typeof _=="function"?_(Object.assign({},N.rects,{placement:N.placement})):_)!="number"?_:Lg(_,_a))}(r.padding,n),f=Pd(i),p=c==="y"?tn:nn,h=c==="y"?xn:kn,m=n.rects.reference[u]+n.rects.reference[c]-a[c]-n.rects.popper[u],g=a[c]-n.rects.reference[c],y=Oa(i),b=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,k=m/2-g/2,x=d[p],S=b-f[u]-d[h],w=b/2-f[u]/2+k,C=Ji(x,w,S),O=c;n.modifiersData[o]=((t={})[O]=C,t.centerOffset=C-w,t)}},effect:function(e){var t=e.state,n=e.options.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o!="string"||(o=t.elements.popper.querySelector(o)))&&Ig(t.elements.popper,o)&&(t.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yi(e){return e.split("-")[1]}var Qx={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ip(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,g=m===void 0?0:m,y=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var b=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),x=nn,S=tn,w=window;if(u){var C=Oa(n),O="clientHeight",_="clientWidth";C===hn(n)&&mo(C=Go(n)).position!=="static"&&s==="absolute"&&(O="scrollHeight",_="scrollWidth"),(r===tn||(r===nn||r===kn)&&i===fa)&&(S=xn,g-=(f&&C===w&&w.visualViewport?w.visualViewport.height:C[O])-o.height,g*=c?1:-1),(r===nn||(r===tn||r===xn)&&i===fa)&&(x=kn,h-=(f&&C===w&&w.visualViewport?w.visualViewport.width:C[_])-o.width,h*=c?1:-1)}var N,E=Object.assign({position:s},u&&Qx),A=d===!0?function(j,B){var $=j.x,R=j.y,F=B.devicePixelRatio||1;return{x:mi($*F)/F||0,y:mi(R*F)/F||0}}({x:h,y:g},hn(n)):{x:h,y:g};return h=A.x,g=A.y,c?Object.assign({},E,((N={})[S]=k?"0":"",N[x]=b?"0":"",N.transform=(w.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",N)):Object.assign({},E,((t={})[S]=k?g+"px":"",t[x]=b?h+"px":"",t.transform="",t))}var Za={passive:!0},e2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ya(e){return e.replace(/left|right|bottom|top/g,function(t){return e2[t]})}var t2={start:"end",end:"start"};function Rp(e){return e.replace(/start|end/g,function(t){return t2[t]})}function Td(e){var t=hn(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function wu(e){return gi(Go(e)).left+Td(e).scrollLeft}function Id(e){var t=mo(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function Dg(e){return["html","body","#document"].indexOf(Yn(e))>=0?e.ownerDocument.body:wn(e)&&Id(e)?e:Dg(vc(e))}function na(e,t){var n;t===void 0&&(t=[]);var o=Dg(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=hn(o),a=r?[i].concat(i.visualViewport||[],Id(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(na(vc(a)))}function bu(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Lp(e,t,n){return t===Pg?bu(function(o,r){var i=hn(o),a=Go(o),s=i.visualViewport,c=a.clientWidth,u=a.clientHeight,d=0,f=0;if(s){c=s.width,u=s.height;var p=Tg();(p||!p&&r==="fixed")&&(d=s.offsetLeft,f=s.offsetTop)}return{width:c,height:u,x:d+wu(o),y:f}}(e,n)):Rr(t)?function(o,r){var i=gi(o,!1,r==="fixed");return i.top=i.top+o.clientTop,i.left=i.left+o.clientLeft,i.bottom=i.top+o.clientHeight,i.right=i.left+o.clientWidth,i.width=o.clientWidth,i.height=o.clientHeight,i.x=i.left,i.y=i.top,i}(t,n):bu(function(o){var r,i=Go(o),a=Td(o),s=(r=o.ownerDocument)==null?void 0:r.body,c=Ar(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=Ar(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),d=-a.scrollLeft+wu(o),f=-a.scrollTop;return mo(s||i).direction==="rtl"&&(d+=Ar(i.clientWidth,s?s.clientWidth:0)-c),{width:c,height:u,x:d,y:f}}(Go(e)))}function n2(e,t,n,o){var r=t==="clippingParents"?function(c){var u=na(vc(c)),d=["absolute","fixed"].indexOf(mo(c).position)>=0&&wn(c)?Oa(c):c;return Rr(d)?u.filter(function(f){return Rr(f)&&Ig(f,d)&&Yn(f)!=="body"}):[]}(e):[].concat(t),i=[].concat(r,[n]),a=i[0],s=i.reduce(function(c,u){var d=Lp(e,u,o);return c.top=Ar(d.top,c.top),c.right=Bs(d.right,c.right),c.bottom=Bs(d.bottom,c.bottom),c.left=Ar(d.left,c.left),c},Lp(e,a,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Mg(e){var t,n=e.reference,o=e.element,r=e.placement,i=r?Gn(r):null,a=r?yi(r):null,s=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(i){case tn:t={x:s,y:n.y-o.height};break;case xn:t={x:s,y:n.y+n.height};break;case kn:t={x:n.x+n.width,y:c};break;case nn:t={x:n.x-o.width,y:c};break;default:t={x:n.x,y:n.y}}var u=i?Nd(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(a){case hi:t[u]=t[u]-(n[d]/2-o[d]/2);break;case fa:t[u]=t[u]+(n[d]/2-o[d]/2)}}return t}function pa(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=o===void 0?e.placement:o,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,c=s===void 0?"clippingParents":s,u=n.rootBoundary,d=u===void 0?Pg:u,f=n.elementContext,p=f===void 0?Di:f,h=n.altBoundary,m=h!==void 0&&h,g=n.padding,y=g===void 0?0:g,b=Rg(typeof y!="number"?y:Lg(y,_a)),k=p===Di?"reference":Di,x=e.rects.popper,S=e.elements[m?k:p],w=n2(Rr(S)?S:S.contextElement||Go(e.elements.popper),c,d,a),C=gi(e.elements.reference),O=Mg({reference:C,element:x,strategy:"absolute",placement:r}),_=bu(Object.assign({},x,O)),N=p===Di?_:C,E={top:w.top-N.top+b.top,bottom:N.bottom-w.bottom+b.bottom,left:w.left-N.left+b.left,right:N.right-w.right+b.right},A=e.modifiersData.offset;if(p===Di&&A){var j=A[r];Object.keys(E).forEach(function(B){var $=[kn,xn].indexOf(B)>=0?1:-1,R=[tn,xn].indexOf(B)>=0?"y":"x";E[B]+=j[R]*$})}return E}function o2(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?Ng:c,d=yi(o),f=d?s?Np:Np.filter(function(m){return yi(m)===d}):_a,p=f.filter(function(m){return u.indexOf(m)>=0});p.length===0&&(p=f);var h=p.reduce(function(m,g){return m[g]=pa(e,{placement:g,boundary:r,rootBoundary:i,padding:a})[Gn(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}var r2={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=r===void 0||r,a=n.altAxis,s=a===void 0||a,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,m=h===void 0||h,g=n.allowedAutoPlacements,y=t.options.placement,b=Gn(y),k=c||(b===y||!m?[Ya(y)]:function(W){if(Gn(W)===yu)return[];var U=Ya(W);return[Rp(W),U,Rp(U)]}(y)),x=[y].concat(k).reduce(function(W,U){return W.concat(Gn(U)===yu?o2(t,{placement:U,boundary:d,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:g}):U)},[]),S=t.rects.reference,w=t.rects.popper,C=new Map,O=!0,_=x[0],N=0;N<x.length;N++){var E=x[N],A=Gn(E),j=yi(E)===hi,B=[tn,xn].indexOf(A)>=0,$=B?"width":"height",R=pa(t,{placement:E,boundary:d,rootBoundary:f,altBoundary:p,padding:u}),F=B?j?kn:nn:j?xn:tn;S[$]>w[$]&&(F=Ya(F));var z=Ya(F),V=[];if(i&&V.push(R[A]<=0),s&&V.push(R[F]<=0,R[z]<=0),V.every(function(W){return W})){_=E,O=!1;break}C.set(E,V)}if(O)for(var L=function(W){var U=x.find(function(Y){var D=C.get(Y);if(D)return D.slice(0,W).every(function(T){return T})});if(U)return _=U,"break"},H=m?3:1;H>0&&L(H)!=="break";H--);t.placement!==_&&(t.modifiersData[o]._skip=!0,t.placement=_,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Dp(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Mp(e){return[tn,kn,xn,nn].some(function(t){return e[t]>=0})}var i2={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=r===void 0?[0,0]:r,a=Ng.reduce(function(d,f){return d[f]=function(p,h,m){var g=Gn(p),y=[nn,tn].indexOf(g)>=0?-1:1,b=typeof m=="function"?m(Object.assign({},h,{placement:p})):m,k=b[0],x=b[1];return k=k||0,x=(x||0)*y,[nn,kn].indexOf(g)>=0?{x,y:k}:{x:k,y:x}}(f,t.rects,i),d},{}),s=a[t.placement],c=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[o]=a}},a2={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=r===void 0||r,a=n.altAxis,s=a!==void 0&&a,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0||p,m=n.tetherOffset,g=m===void 0?0:m,y=pa(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),b=Gn(t.placement),k=yi(t.placement),x=!k,S=Nd(b),w=S==="x"?"y":"x",C=t.modifiersData.popperOffsets,O=t.rects.reference,_=t.rects.popper,N=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,E=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(C){if(i){var B,$=S==="y"?tn:nn,R=S==="y"?xn:kn,F=S==="y"?"height":"width",z=C[S],V=z+y[$],L=z-y[R],H=h?-_[F]/2:0,W=k===hi?O[F]:_[F],U=k===hi?-_[F]:-O[F],Y=t.elements.arrow,D=h&&Y?Pd(Y):{width:0,height:0},T=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},P=T[$],I=T[R],G=Ji(0,O[F],D[F]),K=x?O[F]/2-H-G-P-E.mainAxis:W-G-P-E.mainAxis,X=x?-O[F]/2+H+G+I+E.mainAxis:U+G+I+E.mainAxis,Z=t.elements.arrow&&Oa(t.elements.arrow),M=Z?S==="y"?Z.clientTop||0:Z.clientLeft||0:0,se=(B=A==null?void 0:A[S])!=null?B:0,ce=z+X-se,ge=Ji(h?Bs(V,z+K-se-M):V,z,h?Ar(L,ce):L);C[S]=ge,j[S]=ge-z}if(s){var be,Ee=S==="x"?tn:nn,ne=S==="x"?xn:kn,oe=C[w],te=w==="y"?"height":"width",Se=oe+y[Ee],Ie=oe-y[ne],le=[tn,nn].indexOf(b)!==-1,Re=(be=A==null?void 0:A[w])!=null?be:0,Ye=le?Se:oe-O[te]-_[te]-Re+E.altAxis,st=le?oe+O[te]+_[te]-Re-E.altAxis:Ie,_e=h&&le?function(Pe,$e,Le){var de=Ji(Pe,$e,Le);return de>Le?Le:de}(Ye,oe,st):Ji(h?Ye:Se,oe,h?st:Ie);C[w]=_e,j[w]=_e-oe}t.modifiersData[o]=j}},requiresIfExists:["offset"]};function s2(e,t,n){n===void 0&&(n=!1);var o,r,i=wn(t),a=wn(t)&&function(f){var p=f.getBoundingClientRect(),h=mi(p.width)/f.offsetWidth||1,m=mi(p.height)/f.offsetHeight||1;return h!==1||m!==1}(t),s=Go(t),c=gi(e,a,n),u={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(i||!i&&!n)&&((Yn(t)!=="body"||Id(s))&&(u=(o=t)!==hn(o)&&wn(o)?{scrollLeft:(r=o).scrollLeft,scrollTop:r.scrollTop}:Td(o)),wn(t)?((d=gi(t,!0)).x+=t.clientLeft,d.y+=t.clientTop):s&&(d.x=wu(s))),{x:c.left+u.scrollLeft-d.x,y:c.top+u.scrollTop-d.y,width:c.width,height:c.height}}function c2(e){var t=new Map,n=new Set,o=[];function r(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach(function(a){if(!n.has(a)){var s=t.get(a);s&&r(s)}}),o.push(i)}return e.forEach(function(i){t.set(i.name,i)}),e.forEach(function(i){n.has(i.name)||r(i)}),o}var $p={placement:"bottom",modifiers:[],strategy:"absolute"};function Hp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function l2(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,o=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?$p:r;return function(a,s,c){c===void 0&&(c=i);var u,d,f={placement:"bottom",orderedModifiers:[],options:Object.assign({},$p,i),modifiersData:{},elements:{reference:a,popper:s},attributes:{},styles:{}},p=[],h=!1,m={state:f,setOptions:function(y){var b=typeof y=="function"?y(f.options):y;g(),f.options=Object.assign({},i,f.options,b),f.scrollParents={reference:Rr(a)?na(a):a.contextElement?na(a.contextElement):[],popper:na(s)};var k,x,S=function(w){var C=c2(w);return Jx.reduce(function(O,_){return O.concat(C.filter(function(N){return N.phase===_}))},[])}((k=[].concat(o,f.options.modifiers),x=k.reduce(function(w,C){var O=w[C.name];return w[C.name]=O?Object.assign({},O,C,{options:Object.assign({},O.options,C.options),data:Object.assign({},O.data,C.data)}):C,w},{}),Object.keys(x).map(function(w){return x[w]})));return f.orderedModifiers=S.filter(function(w){return w.enabled}),f.orderedModifiers.forEach(function(w){var C=w.name,O=w.options,_=O===void 0?{}:O,N=w.effect;if(typeof N=="function"){var E=N({state:f,name:C,instance:m,options:_}),A=function(){};p.push(E||A)}}),m.update()},forceUpdate:function(){if(!h){var y=f.elements,b=y.reference,k=y.popper;if(Hp(b,k)){f.rects={reference:s2(b,Oa(k),f.options.strategy==="fixed"),popper:Pd(k)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(N){return f.modifiersData[N.name]=Object.assign({},N.data)});for(var x=0;x<f.orderedModifiers.length;x++)if(f.reset!==!0){var S=f.orderedModifiers[x],w=S.fn,C=S.options,O=C===void 0?{}:C,_=S.name;typeof w=="function"&&(f=w({state:f,options:O,name:_,instance:m})||f)}else f.reset=!1,x=-1}}},update:(u=function(){return new Promise(function(y){m.forceUpdate(),y(f)})},function(){return d||(d=new Promise(function(y){Promise.resolve().then(function(){d=void 0,y(u())})})),d}),destroy:function(){g(),h=!0}};if(!Hp(a,s))return m;function g(){p.forEach(function(y){return y()}),p=[]}return m.setOptions(c).then(function(y){!h&&c.onFirstUpdate&&c.onFirstUpdate(y)}),m}}var u2=l2({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=r===void 0||r,a=o.resize,s=a===void 0||a,c=hn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,Za)}),s&&c.addEventListener("resize",n.update,Za),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,Za)}),s&&c.removeEventListener("resize",n.update,Za)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Mg({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=o===void 0||o,i=n.adaptive,a=i===void 0||i,s=n.roundOffsets,c=s===void 0||s,u={placement:Gn(t.placement),variation:yi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ip(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ip(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Zx,i2,r2,a2,Xx,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=pa(t,{elementContext:"reference"}),s=pa(t,{altBoundary:!0}),c=Dp(a,o),u=Dp(s,r,i),d=Mp(c),f=Mp(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}}]}),d2=typeof Element<"u",f2=typeof Map=="function",p2=typeof Set=="function",h2=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function bs(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,o,r,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(o=n;o--!==0;)if(!bs(e[o],t[o]))return!1;return!0}if(f2&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!t.has(o.value[0]))return!1;for(i=e.entries();!(o=i.next()).done;)if(!bs(o.value[1],t.get(o.value[0])))return!1;return!0}if(p2&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!t.has(o.value[0]))return!1;return!0}if(h2&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(o=n;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if((n=(r=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[o]))return!1;if(d2&&e instanceof Element)return!1;for(o=n;o--!==0;)if((r[o]!=="_owner"&&r[o]!=="__v"&&r[o]!=="__o"||!e.$$typeof)&&!bs(e[r[o]],t[r[o]]))return!1;return!0}return e!=e&&t!=t}var m2=function(e,t){try{return bs(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}},g2=Ea(m2),y2=[];function wc({className:e,variant:t="default",size:n="16",src:o,alt:r,...i}){const a=Q("io-image-icon",t==="grayscale"&&[`io-image-icon-${t}`],n&&[`io-image-icon-${n}`],e);return l.jsx("img",{className:a,style:{width:`${n}px`,filter:t==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}const $g=v.forwardRef((e,t)=>{const{title:n,actions:o,className:r,onClose:i,onActionItemClick:a,"data-testid":s="context-menu",...c}=e,u=v.useRef({}),[d,f]=v.useState(0),p=h=>{var m;(m=u.current[h])==null||m.focus(),f(h)};return v.useEffect(()=>{var h;(h=u.current[d])==null||h.focus()},[]),l.jsxs(gt,{ref:t,className:Q(r,"context-menu"),onClick:h=>h.stopPropagation(),onKeyDown:h=>kd({event:h,currentIndex:d,min:0,max:o.length-1,moveFocus:p,onClose:i}),"data-testid":s,...c,children:[n&&l.jsx(gt.ItemSection,{children:n}),o.map((h,m)=>{const g=h.displayName||h.name,y=h.iconSrc?l.jsx(wc,{size:"16",src:h.iconSrc,alt:`${g} icon`}):h.icon&&l.jsx(xt,{size:"16",variant:h.icon});return l.jsxs(v.Fragment,{children:[l.jsx(gt.Item,{ref:b=>u.current[m]=b,prepend:y,disabled:h.disabled,tabIndex:-1,...ja(b=>a(b,h)),"data-testid":`${s}-item-${h.name}`,children:g}),h.separatorAfter&&l.jsx("li",{className:"context-menu-separator","aria-hidden":!0,"data-testid":`${s}-separator`})]},h.name)})]})});$g.displayName="ContextMenuActionsList";const Rd=()=>{const[e,t]=v.useState([]),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=s=>{const{name:c,title:u,caption:d,icon:f,userProperties:p}=s;return{id:c,name:c,title:u??c,caption:d,icon:f,userProperties:p}},r=n.appManager.onAppAdded(s=>{if(s.userProperties.hidden||"hidden"in s&&s.hidden)return;const c=o(s);t(u=>[...u,c])}),i=n.appManager.onAppChanged(s=>{if(s.userProperties.hidden||"hidden"in s&&s.hidden)return;const c=o(s);t(u=>[...u.filter(d=>d.id!==c.id),c])}),a=[r,n.appManager.onAppRemoved(s=>{const c=o(s);t(u=>u.filter(d=>d.id!==c.id))}),i];return()=>a.forEach(s=>s())},[n]),e},Hg=()=>{const[e,t]=v.useState({}),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=[n.appManager.onInstanceStarted(r=>{t(i=>{const a=i[r.application.name]??[];return{...i,[r.application.name]:[...a,r.id]}})}),n.appManager.onInstanceStopped(r=>{t(i=>{const a=i[r.application.name];return a?{...i,[r.application.name]:a.filter(s=>s!==r.id)}:i})})];return()=>o.forEach(r=>r())},[n]),e},bc=()=>{const[e,t]=v.useState(),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{var o,r;try{const i=(o=n.windows.my())!=null&&o.name?void 0:((r=window.workspacesManager)==null?void 0:r.getFrameId())||(()=>{if(!window.name)throw new Error("The frame id is not available because the platform is still initializing");return window.name})();t(i)}catch(i){console.error("Failed to get the current frame ID ",{error:i})}},[n,t]),e},$r=()=>window.glue42gd!==void 0||window.glue42alert!==void 0||window.glue42dialog!==void 0||window.iodesktop!==void 0,Bg="openInNewWindow",zg="openInNewWorkspace",Fg=$r()?[]:[{name:Bg,displayName:"Open in a new window",icon:"pop-out"},{name:zg,displayName:"Open in a new Workspace",icon:"pop-out"}],Wg="openInNewWindow",Ug="delete",Vg=[{name:Wg,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:Ug,displayName:"Delete",icon:"trash-can"}],Vn="success",nt="warning",v2={success:5e3,warning:1e4},Ro=e=>typeof e=="string"?e:e!=null&&e.message?typeof e.message=="string"?e.message:JSON.stringify(e.message):JSON.stringify(e),ze=async e=>{const{io:t,variant:n,text:o,error:r}=e,i=Ro(r);try{if(n===nt&&t.logger.warn(i?`${o} ${i}`:o),!("modals"in t)||!t.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:n,ttl:v2[n]};await t.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},w2={[Bg]:async e=>{var o;const{io:t,item:n}=e;try{await((o=t.appManager.application(n.id))==null?void 0:o.start())}catch(r){await ze({io:t,variant:nt,text:`Failed to start app "${n.title}" in a new window.`,error:r})}},[zg]:async e=>{const{io:t,item:n,frameId:o}=e;if(!t.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=t.workspaces.getBuilder(r);i.addGroup().addWindow({appName:n.id});try{await i.create()}catch(a){await ze({io:t,variant:nt,text:`Failed to start app "${n.title}" in a new Workspace.`,error:a})}}},Kg=()=>{const e=v.useContext(Te.IOConnectContext),t=bc();return(n,o)=>{w2[o]({io:e,item:n,frameId:t})}},ci={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},xu="(.|\\s)*\\S(.|\\s)*",b2={delete:async e=>{var i;const{io:t,layout:n,showDeletePromptPref:o,updateShowDeletePromptPref:r}=e;if("modals"in t&&t.modals&&o){const a="delete",s="do-not-ask-again",{isEnterPressed:c,responseButtonClicked:u,inputs:d}=await t.modals.dialogs.request({templateName:ci.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${n.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:s,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=d==null?void 0:d.find(p=>p.id===s))==null?void 0:i.checked)&&r(!1),!(c||(u==null?void 0:u.id)===a))return}try{await t.layouts.remove("Global",n.name),n.isDefault&&await t.layouts.clearDefaultGlobal(),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was successfully deleted.`})}catch(a){await ze({io:t,variant:nt,text:`Failed to delete Layout "${n.name}".`,error:a})}},rename:async e=>{var d;const{io:t,layout:n,setDefaultLayout:o}=e;if(!("modals"in t)||!t.modals)return void console.error("Cannot rename Layout because io dialogs are not enabled");const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await t.modals.dialogs.request({templateName:ci.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${n.name}"`,input:{id:i,initialValue:n.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:xu}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=c==null?void 0:c.find(f=>f.id===i))==null?void 0:d.value;if(u&&(a||(s==null?void 0:s.id)===r))if(u!==n.name)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u))return void await ze({io:t,variant:nt,text:`Failed to rename Layout "${n.name}" to "${u}". A Layout with name "${u}" already exists.`});const p=await t.layouts.get(n.name,"Global");if(!p)return void await ze({io:t,variant:nt,text:`Failed to rename Layout "${n.name}". The Layout wasn't found.`});await t.layouts.rename(p,u),n.isDefault&&await o({name:u}),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was successfully renamed to "${u}".`})}catch(f){await ze({io:t,variant:nt,text:`Failed to rename Layout "${n.name}".`,error:f})}else await ze({io:t,variant:nt,text:`Failed to rename Layout "${n.name}". The new Layout name must be different from the current one.`})},save:async e=>{const{io:t,layout:n}=e;try{await t.layouts.save({name:n.name,type:"Global"}),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was saved successfully.`})}catch(o){await ze({io:t,variant:nt,text:`Failed to save Layout "${n.name}".`,error:o})}},saveAs:async e=>{var d;const{io:t,layout:n,setActiveLayout:o}=e;if(!("modals"in t)||!t.modals)return void console.error("Cannot save Layout under a new name because io dialogs are not enabled");const r="save-as",i="layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await t.modals.dialogs.request({templateName:ci.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${n.name}" as`,input:{id:i,initialValue:n.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:xu}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=c==null?void 0:c.find(f=>f.id===i))==null?void 0:d.value;if(u&&(a||(s==null?void 0:s.id)===r))if(u!==n.name)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u))return void await ze({io:t,variant:nt,text:`Failed to save Layout as "${u}". A Layout with this name already exists.`});const p=await t.layouts.get(n.name,"Global");if(!p)return void await ze({io:t,variant:nt,text:`Failed to save Layout "${n.name}". The Layout wasn't found.`});await t.layouts.import([{...p,name:u}],"merge"),n.isActive&&o({name:u}),await ze({io:t,variant:Vn,text:`The Layout was successfully saved as "${u}".`})}catch(f){await ze({io:t,variant:nt,text:`Failed to save Layout "${u}".`,error:f})}else await ze({io:t,variant:nt,text:`Failed to save Layout as "${u}". The new Layout must have a unique name.`})},setAsDefault:async e=>{const{io:t,layout:n,setDefaultLayout:o}=e;try{await o({name:n.name}),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was successfully set as the default Layout.`})}catch{await ze({io:t,variant:nt,text:`Failed to set Layout "${n.name}" as the default Layout.`})}},load:async e=>{const{io:t,layout:n,closeLaunchpad:o}=e;try{await t.layouts.restore({name:n.name}),o(),await ze({io:t,variant:Vn,text:`Layout "${n.name}" was loaded successfully.`})}catch(r){await ze({io:t,variant:nt,text:`Failed to load Layout "${n.name}".`,error:r})}}};var Pt=function(e){return{ok:!0,result:e}},kt=function(e){return{ok:!1,error:e}},Bp=function(e,t,n){return t.ok===!1?t:n.ok===!1?n:Pt(e(t.result,n.result))},fl=function(e,t){return t.ok===!0?t:kt(e(t.error))},ku=function(){return ku=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ku.apply(this,arguments)};function Su(e,t){if(e===t||e===null&&t===null)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Su(e[n],t[n]))return!1;return!0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(n=0;n<o.length;n++)if(!t.hasOwnProperty(o[n])||!Su(e[o[n]],t[o[n]]))return!1;return!0}}var Zi=function(e){return Array.isArray(e)},Xa=function(e){return typeof e=="object"&&e!==null&&!Zi(e)},ao=function(e,t){return"expected "+e+", got "+function(n){switch(typeof n){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return n instanceof Array?"an array":n===null?"null":"an object";default:return JSON.stringify(n)}}(t)},Mi=function(e){return e.map(function(t){return typeof t=="string"?"."+t:"["+t+"]"}).join("")},$i=function(e,t){var n=t.at,o=function(r,i){var a={};for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&i.indexOf(s)<0&&(a[s]=r[s]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var c=0;for(s=Object.getOwnPropertySymbols(r);c<s.length;c++)i.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(r,s[c])&&(a[s[c]]=r[s[c]])}return a}(t,["at"]);return ku({at:e+(n||"")},o)},jt=function(){function e(t){var n=this;this.decode=t,this.run=function(o){return fl(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},n.decode(o))},this.runPromise=function(o){return function(r){return r.ok===!0?Promise.resolve(r.result):Promise.reject(r.error)}(n.run(o))},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(n.run(o))},this.map=function(o){return new e(function(r){return function(i,a){return a.ok===!0?Pt(i(a.result)):a}(o,n.decode(r))})},this.andThen=function(o){return new e(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},n.decode(r))})},this.where=function(o,r){return n.andThen(function(i){return o(i)?e.succeed(i):e.fail(r)})}}return e.string=function(){return new e(function(t){return typeof t=="string"?Pt(t):kt({message:ao("a string",t)})})},e.number=function(){return new e(function(t){return typeof t=="number"?Pt(t):kt({message:ao("a number",t)})})},e.boolean=function(){return new e(function(t){return typeof t=="boolean"?Pt(t):kt({message:ao("a boolean",t)})})},e.constant=function(t){return new e(function(n){return Su(n,t)?Pt(t):kt({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(n)})})},e.object=function(t){return new e(function(n){if(Xa(n)&&t){var o={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].decode(n[r]);if(i.ok!==!0)return n[r]===void 0?kt({message:"the key '"+r+"' is required but was not present"}):kt($i("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return Pt(o)}return Xa(n)?Pt(n):kt({message:ao("an object",n)})})},e.array=function(t){return new e(function(n){return Zi(n)&&t?n.reduce(function(o,r,i){return Bp(function(a,s){return a.concat([s])},o,function(a,s){return fl(function(c){return $i("["+s+"]",c)},t.decode(a))}(r,i))},Pt([])):Zi(n)?Pt(n):kt({message:ao("an array",n)})})},e.tuple=function(t){return new e(function(n){if(Zi(n)){if(n.length!==t.length)return kt({message:"expected a tuple of length "+t.length+", got one of length "+n.length});for(var o=[],r=0;r<t.length;r++){var i=t[r].decode(n[r]);if(!i.ok)return kt($i("["+r+"]",i.error));o[r]=i.result}return Pt(o)}return kt({message:ao("a tuple of length "+t.length,n)})})},e.union=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new e(function(i){return[t,n].concat(o).reduce(function(a,s){return Bp(Object.assign,a,s.decode(i))},Pt({}))})},e.anyJson=function(){return new e(function(t){return Pt(t)})},e.unknownJson=function(){return new e(function(t){return Pt(t)})},e.dict=function(t){return new e(function(n){if(Xa(n)){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=t.decode(n[r]);if(i.ok!==!0)return kt($i("."+r,i.error));o[r]=i.result}return Pt(o)}return kt({message:ao("an object",n)})})},e.optional=function(t){return new e(function(n){return n==null?Pt(void 0):t.decode(n)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(o){for(var r=[],i=0;i<t.length;i++){var a=t[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var s=r.map(function(c){return"at error"+(c.at||"")+": "+c.message}).join('", "');return kt({message:'expected a value matching one of the decoders, got the errors ["'+s+'"]'})})},e.withDefault=function(t,n){return new e(function(o){return Pt(function(r,i){return i.ok===!0?i.result:r}(t,n.decode(o)))})},e.valueAt=function(t,n){return new e(function(o){for(var r=o,i=0;i<t.length;i++){if(r===void 0)return kt({at:Mi(t.slice(0,i+1)),message:"path does not exist"});if(typeof t[i]=="string"&&!Xa(r))return kt({at:Mi(t.slice(0,i+1)),message:ao("an object",r)});if(typeof t[i]=="number"&&!Zi(r))return kt({at:Mi(t.slice(0,i+1)),message:ao("an array",r)});r=r[t[i]]}return fl(function(a){return r===void 0?{at:Mi(t),message:"path does not exist"}:$i(Mi(t),a)},n.decode(r))})},e.succeed=function(t){return new e(function(n){return Pt(t)})},e.fail=function(t){return new e(function(n){return kt({message:t})})},e.lazy=function(t){return new e(function(n){return t().decode(n)})},e}(),qt=jt.string,x2=jt.number,rt=jt.boolean,Cu=jt.anyJson;jt.unknownJson;var q=jt.constant,Ut=jt.object,er=jt.array;jt.tuple,jt.dict;var xe=jt.optional,Aa=jt.oneOf;jt.union,jt.intersection,jt.withDefault,jt.valueAt,jt.succeed;var k2=jt.fail;jt.lazy;const wt=qt().where(e=>e.length>0,"Expected a non-empty string"),zp=x2().where(e=>e>=0,"Expected a non-negative number"),S2=Ut({name:wt}),Gg=(e,t,n)=>{const[o,r]=v.useState(()=>{try{const s=window[e].getItem(t);return s?JSON.parse(s):null}catch(s){return console.log(s),null}}),i=`${e}-${t}`;v.useEffect(()=>{const s=c=>{r(c.detail)};return window.addEventListener(i,s),()=>{window.removeEventListener(i,s)}},[i]);const a=v.useCallback(s=>{try{if(!s)return window[e].removeItem(t),void r(null);const c=n.run(s);if(!c.ok)return void console.warn(`Error validating the value to be stored: ${c.error.message}`);const u=c.result;r(u),window[e].setItem(t,JSON.stringify(u)),window.dispatchEvent(new CustomEvent(i,{detail:u}))}catch(c){console.log(c)}},[t,e,i,n]);return[o,a]},qg=()=>{const[e,t]=Gg("sessionStorage","interopio_home_ui_active_layout",S2);return{activeLayout:e,setActiveLayout:t}},Ld=()=>{const e=v.useContext(Te.IOConnectContext);return v.useCallback(async(t,n)=>{if(e)try{await e.layouts.restore({name:t}),n==null||n({name:t}),await ze({io:e,variant:Vn,text:`Layout "${t}" was loaded successfully.`})}catch(o){await ze({io:e,variant:nt,text:`Failed to load Layout "${t}".`,error:o})}},[e])},Jg="Control",Zg="Shift",xc=()=>{const e=v.useContext(Te.IOConnectContext),t=bc();return async({id:n,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===Jg?{newFrame:!0}:{frameId:t,reuseWorkspaceId:r};await((i=e.workspaces)==null?void 0:i.restoreWorkspace(n,a))}catch(a){await ze({io:e,variant:nt,text:`Failed to load Workspace "${n}".`,error:a})}}},Yg=e=>e.trim().length>0,Xg=v.createContext(void 0),$n=()=>{const e=v.useContext(Xg);if(e===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return e},C2=({children:e,close:t,isOpen:n,isGlobalLayoutsAvailable:o})=>{const[r,i]=v.useState(!1),{defaultLayout:a,activeLayout:s,setDefaultLayout:c,setActiveLayout:u}=((f,p)=>{const[h,m]=v.useState(void 0),g=v.useRef(!1),{activeLayout:y,setActiveLayout:b}=qg(),k=Ld(),x=xc(),S=v.useContext(Te.IOConnectContext),w=v.useCallback(async({name:C})=>{try{await S.layouts.setDefaultGlobal(C)}catch(O){console.error("Failed to set default Layout: ",{error:O})}},[S]);return v.useEffect(()=>{if(S)return S.layouts.onDefaultGlobalChanged(C=>{m(C)})},[S]),v.useEffect(()=>{if(S)return S.layouts.onRestored(C=>{b({name:C.name})})},[S]),v.useEffect(()=>{if(S)return S.layouts.onRemoved(C=>{(C==null?void 0:C.name)===(y==null?void 0:y.name)&&b(null)})},[S,y]),v.useEffect(()=>{if(S)return S.layouts.onRenamed((C,O)=>{(O==null?void 0:O.name)===(y==null?void 0:y.name)&&b({name:C.name})})},[S,y]),v.useEffect(()=>{var C;S&&((C=window.iobrowser)!=null&&C.platformStarted)&&!g.current&&(async()=>{var A;g.current=!0;const O=await S.layouts.getDefaultGlobal()??(await S.layouts.getAll("Global")).find(j=>j.name==="Welcome");if(!O||(m({name:O.name}),y))return;if(f(!0),p)return await k(O.name),void f(!1);const _=await((A=S.workspaces)==null?void 0:A.getWorkspace(j=>j.children.length===0)),N=await S.layouts.get(O.name,"Global");if(!N)throw new Error("Default Global Layout not found.");const E=N.components.reduce((j,B)=>{if(B.type==="workspaceFrame"){const $=B.state.workspaces.map(R=>R.config.name);j.push(...$)}return j},[]);Promise.all(E.map((j,B)=>x({id:j,reuseWorkspaceId:B===0?_==null?void 0:_.id:void 0}))),f(!1)})().catch(O=>console.error("Initial Global Layout setup failed. ",Ro(O)))},[S,y,k,x,p]),{defaultLayout:h,activeLayout:y,setDefaultLayout:w,setActiveLayout:b}})(i,o),d=v.useMemo(()=>({close:t,isOpen:n,defaultLayout:a,activeLayout:s,setDefaultLayout:c,setActiveLayout:u,isLayoutOperationBlocked:r,setIsLayoutOperationBlocked:i,isGlobalLayoutsAvailable:o}),[t,n,a,s,c,u,r,o]);return l.jsx(Xg.Provider,{value:d,children:e})},Fp="io-connect-platform",Sr="___platform_prefs___",Qg="_launchpad_collapsedSections",ey="_launchpad_favorites",E2="_launchpad_recent",ty="_launchpad_isLayoutsPanelOpen",ny="_launchpad_isCollapsed",zs="_launchpad_isPinned",Eu="_launchpad_isDocked",oy="_launchpad_minimizeToTray",ry="_launchpad_autoCloseStartingAppsAndWorkspaces",iy="_launchpad_pinnedPosition",ay="_launchpad_allowDocking",sy="_launchpad_dockedAlwaysOnTop",cy="_launchpad_dockedClaimsSpace",Pa="_launchpad_showExtendedArea",ly="_launchpad_hideLabelsInExtendedArea",uy="_launchpad_showFavoritesInExtendedArea",Dd="_launchpad_hideFavoritesSection",dy="_launchpad_showRecentAppsInExtendedArea",fy="_layouts_restoreLastSaved",py="_layouts_saveCurrentOnExit",hy="_layouts_showUnsavedChangesPrompt",Md="_layouts_showDeletePrompt",my="_downloads_askForEachDownload",j2="_downloads_location",_2="_system_scheduleRestart",O2="_system_scheduleRestartTime",A2="_system_scheduleRestartFrequency",P2="_system_scheduleRestartDay",N2="_system_scheduleShutdown",T2="_system_scheduleShutdownTime",I2="_system_scheduleShutdownFrequency",R2="_system_scheduleShutdownDay",L2={[Qg]:[],[ey]:[],[E2]:[],[ty]:!1,[ny]:!1,[zs]:!1,[Eu]:!1,[oy]:!1,[ry]:!0,[iy]:"Left",[ay]:!0,[sy]:!1,[cy]:!1,[Pa]:!0,[ly]:!0,[uy]:!0,[Dd]:!1,[dy]:!0,[fy]:!0,[py]:!0,[hy]:!0,[Md]:!0,[my]:!0,[j2]:"",[_2]:!1,[O2]:"12:00 AM",[A2]:"daily",[P2]:"Monday",[N2]:!1,[T2]:"12:00 AM",[I2]:"daily",[R2]:"Monday"},gy=Aa(q("add"),q("align-bottom"),q("align-bottom-solid"),q("align-left"),q("align-left-bottom"),q("align-left-bottom-solid"),q("align-left-solid"),q("align-left-top"),q("align-left-top-solid"),q("align-right"),q("align-right-bottom"),q("align-right-bottom-solid"),q("align-right-solid"),q("align-right-top"),q("align-right-top-solid"),q("align-top"),q("align-top-solid"),q("always-on-top"),q("always-on-top-on"),q("application"),q("arrow-down-long"),q("arrow-down-to-bracket"),q("arrow-left-long"),q("arrow-right-from-bracket"),q("arrow-right-long"),q("arrow-right"),q("arrow-up"),q("arrow-up-long"),q("ban"),q("bell"),q("bell-solid"),q("bookmark"),q("bullseye-pointer"),q("certificate"),q("check"),q("check-light"),q("check-solid"),q("chevron-down"),q("chevron-left"),q("chevron-right"),q("chevron-up"),q("circle-info"),q("circle-xmark"),q("circle-xmark-full"),q("clock"),q("clock-rotate-left"),q("clone"),q("close"),q("cog"),q("cog-solid"),q("collapse"),q("copy"),q("download"),q("delete-left"),q("dev-tools"),q("ellipsis"),q("ellipsis-vertical"),q("expand"),q("envelope"),q("envelope-open"),q("exclamation-mark"),q("expand"),q("feedback"),q("filter"),q("floppy"),q("floppy-disk-pen"),q("folder"),q("folder-open"),q("globe"),q("group"),q("hidden"),q("home"),q("house"),q("info"),q("keyboard"),q("layout"),q("link"),q("list-ul"),q("lock"),q("logo"),q("minimize"),q("minimize-down"),q("paper-plane-top"),q("paperclip"),q("pause"),q("pen-line"),q("pen-to-square"),q("pin"),q("play"),q("pop-in"),q("pop-in-widget"),q("pop-out"),q("power-off"),q("publish"),q("refresh"),q("resize"),q("restore"),q("rotate-right"),q("search"),q("search-filled"),q("sleep"),q("sliders"),q("snooze"),q("spinner"),q("square"),q("square-arrow-down"),q("square-arrow-up"),q("star"),q("star-full"),q("sticky-off"),q("sticky-off-hover"),q("sticky-on"),q("sticky-on-hover"),q("subscribe"),q("system-close"),q("system-maximize"),q("system-minimize"),q("thumbs-down"),q("thumbs-up"),q("trash"),q("trash-can"),q("triangle-exclamation"),q("unlock"),q("unpin"),q("up-to-line"),q("user"),q("user-gear"),q("visible"),q("workspace")),D2=Ut({name:wt,displayName:xe(wt),icon:xe(gy),iconSrc:xe(wt),disabled:xe(rt()),separatorAfter:xe(rt())}),M2=Ut({id:wt,title:wt,description:xe(qt()),icon:xe(gy),iconSrc:xe(wt),contextMenuActions:xe(er(D2)),type:wt}),$2=er(M2),H2=Ut({name:wt,type:wt}),B2=Aa(q("Left"),q("Right")),Wp=Aa(q("daily"),q("weekly")),Up=Aa(q("Sunday"),q("Monday"),q("Tuesday"),q("Wednesday"),q("Thursday"),q("Friday"),q("Saturday")),xs=Ut({customPrefs:xe(Cu()),_launchpad_collapsedSections:xe(er(wt)),_launchpad_favorites:xe($2),_launchpad_recent:xe(er(H2)),_launchpad_isLayoutsPanelOpen:xe(rt()),_launchpad_isCollapsed:xe(rt()),_launchpad_isPinned:xe(rt()),_launchpad_isDocked:xe(rt()),_launchpad_minimizeToTray:xe(rt()),_launchpad_autoCloseStartingAppsAndWorkspaces:xe(rt()),_launchpad_pinnedPosition:xe(B2),_launchpad_allowDocking:xe(rt()),_launchpad_dockedAlwaysOnTop:xe(rt()),_launchpad_dockedClaimsSpace:xe(rt()),_launchpad_showExtendedArea:xe(rt()),_launchpad_hideLabelsInExtendedArea:xe(rt()),_launchpad_showFavoritesInExtendedArea:xe(rt()),_launchpad_hideFavoritesSection:xe(rt()),_launchpad_showRecentAppsInExtendedArea:xe(rt()),_layouts_restoreLastSaved:xe(rt()),_layouts_saveCurrentOnExit:xe(rt()),_layouts_showUnsavedChangesPrompt:xe(rt()),_layouts_showDeletePrompt:xe(rt()),_downloads_askForEachDownload:xe(rt()),_downloads_location:xe(qt()),_system_scheduleRestart:xe(rt()),_system_scheduleRestartTime:xe(wt),_system_scheduleRestartFrequency:xe(Wp),_system_scheduleRestartDay:xe(Up),_system_scheduleShutdown:xe(rt()),_system_scheduleShutdownTime:xe(wt),_system_scheduleShutdownFrequency:xe(Wp),_system_scheduleShutdownDay:xe(Up)}),$d=v.createContext(void 0),kc=({children:e,launchpadMode:t})=>{const[n,o]=v.useState(),[r,i]=v.useState(!1),[a,s]=v.useState(),c=v.useContext(Te.IOConnectContext),u=v.useMemo(()=>({prefs:n,isInitialSetupCompleted:r,initialSetupError:a}),[n,r,a]);return v.useEffect(()=>{if(!c)return;let d=!1;const f=c.contexts.subscribe(Sr,p=>{if(d)return;const h=xs.run(p);if(!h.ok)return void c.logger.warn(`The received data for context ${Sr} is with an invalid shape: ${Ro(h.error.message)}`);const m=h.result;o(m),c.prefs.updateFor(Fp,m).catch(g=>{c.logger.warn(`Failed to update platform prefs. Error: ${Ro(g)}`)})});return()=>{d=!0,f.then(p=>{p()})}},[c]),v.useEffect(()=>{c&&(async()=>{var d;try{const f=await c.contexts.get(Sr),p=xs.run(f);if(!p.ok)throw new Error(`The data in context ${Sr} is with an invalid shape: ${Ro(p.error.message)}`);const h=p.result;if(Object.keys(h).length>0)return;const m=((d=await c.prefs.get(Fp))==null?void 0:d.data)??{},g=xs.run(m);if(!g.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${Ro(g.error.message)}`);const y={[zs]:t==="pinned"||(m[zs]??!1),[Eu]:t==="docked"||(m[Eu]??!1)},b={...L2,...g.result,...y};await c.contexts.set(Sr,b)}catch(f){s({message:Ro(f)}),await ze({io:c,variant:nt,text:"Initial platform prefs setup failed.",error:f})}finally{i(!0)}})().catch(console.error)},[c,t]),l.jsx($d.Provider,{value:u,children:e})};function yy(){const e=v.useContext($d);if(e===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return e}function Mt({prefKey:e}){var f;const t=v.useContext(Te.IOConnectContext),n=v.useContext($d),o=(f=n==null?void 0:n.prefs)==null?void 0:f[e],r=(n==null?void 0:n.isInitialSetupCompleted)??!1,[i,a]=v.useState(!r),[s,c]=v.useState(),u=v.useRef(0);v.useEffect(()=>{r&&u.current===0&&a(!1)},[r]);const d=v.useCallback(async p=>{if(!t)return;const h=++u.current;a(!0),c(void 0);const m=async y=>{y&&await ze({io:t,variant:nt,text:`Failed to update prefKey "${e}".`,error:y}),h===u.current&&(a(!1),y&&c({message:Ro(y)}))};let g;if(p instanceof Function)try{g=p((await t.contexts.get(Sr))[e])}catch(y){return m(y)}else g=p;try{const y=xs.runWithException({[e]:g});await t.contexts.update(Sr,y)}catch(y){return m(y)}await m()},[t,e]);if(n===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:s,isLoading:i,update:d,value:o}}const Hr=()=>{const{value:e,update:t,isLoading:n,error:o}=Mt({prefKey:zs}),r=v.useCallback(()=>t(i=>!i),[t]);return{error:o,isLaunchpadPinned:e,isLoading:n,toggle:r}},vy=()=>{const e=v.useContext(Te.IOConnectContext),{setActiveLayout:t,setDefaultLayout:n,close:o}=$n(),{isLaunchpadPinned:r}=Hr(),{value:i,update:a}=Mt({prefKey:Md}),s=()=>{r||(o==null||o())};return v.useCallback(async u=>{const{layout:d,actionName:f}=u;return await b2[f]({io:e,layout:d,setActiveLayout:t,setDefaultLayout:n,closeLaunchpad:s,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[e,n,t,o,i,a])},Oi=()=>{const{isLayoutOperationBlocked:e,setIsLayoutOperationBlocked:t}=$n();return async n=>{if(!e){t(!0);try{await n()}catch(o){console.error("Layout operation failed: ",{error:o})}t(!1)}}},wy="createWorkspace",z2={[Wg]:async e=>{const{io:t,item:n}=e;if(t.workspaces)try{await t.workspaces.restoreWorkspace(n.id,{newFrame:!0})}catch(o){await ze({io:t,variant:nt,text:`Failed to load Workspace "${n.title}".`,error:o})}},[Ug]:async e=>{const{io:t,item:n,removeFavorite:o}=e;if(t.workspaces){if("modals"in t&&t.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await t.modals.dialogs.request({templateName:ci.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${n.title}"`,text:"Are you sure you want to delete this Workspace?",actionButtons:[{variant:"critical",text:"Delete",id:r},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(!(i||(a==null?void 0:a.id)===r))return}try{await t.workspaces.layouts.delete(n.id),await o(n),await ze({io:t,variant:Vn,text:`"Workspace ${n.title}" was successfully deleted.`})}catch(r){await ze({io:t,variant:nt,text:`Failed to delete Workspace "${n.title}".`,error:r})}}},[wy]:async e=>{const{io:t}=e;if(t.workspaces)try{await t.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(n){await ze({io:t,variant:nt,text:"Failed to create a new Workspace.",error:n})}}},vi="application",wi="workspace",ju="layout",Vp="action-button";class by{constructor(){jn(this,"queue",[]);jn(this,"isExecutingQueue",!1)}enqueue(t){return new Promise((n,o)=>{this.queue.push({action:t,resolve:n,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const t=this.queue.shift();if(!t)return void(this.isExecutingQueue=!1);try{const n=await t.action();t.resolve(n)}catch(n){t.reject(n)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(t=>setTimeout(t,0))}}const Hd=()=>{const[e,t]=v.useState([]),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!(n!=null&&n.workspaces))return;let o=!1;const r=n.workspaces.layouts.onSaved(({name:s})=>{o||e.some(({id:c})=>c===s)||t(c=>[...c,{id:s,title:s}])}),i=n.workspaces.layouts.onRemoved(({name:s})=>{o||t(c=>c.filter(({id:u})=>u!==s))}),a=n.layouts.onRenamed((s,c)=>{if(o||s.type!=="Workspace")return;const{name:u}=s;t(d=>{const f=d.findIndex(p=>p.id===(c==null?void 0:c.name));return f===-1?d:[...d.slice(0,f),{id:u,title:u},...d.slice(f+1)]})});return()=>{o=!0,a(),[r,i].forEach(async s=>{try{(await s)()}catch(c){console.error(c)}})}},[n,e]),e},Kp=new by,Sc=()=>{const{value:e,update:t,isLoading:n}=Mt({prefKey:ey}),o=Rd(),r=Hd();return{favorites:v.useMemo(()=>(e??[]).filter(i=>i.type===vi?o.some(a=>a.id===i.id):i.type!==wi||r.some(a=>a.id===i.id)),[e,o,r]),toggleFavorite:v.useCallback(({openInstances:i,...a})=>Kp.enqueue(()=>t((s=[])=>{const c=s.find(u=>u.id===a.id&&u.type&&a.type);return c?s.filter(u=>u!==c):[a,...s]})),[t]),removeFavorite:v.useCallback(i=>Kp.enqueue(()=>t((a=[])=>a.filter(s=>!(s.id===i.id&&s.type===i.type)))),[t]),isLoading:n}},xy=()=>{const e=v.useContext(Te.IOConnectContext),{removeFavorite:t}=Sc();return(n,o)=>{z2[o]({io:e,item:n,removeFavorite:t})}},Bd=()=>{const{value:e,update:t,isLoading:n,error:o}=Mt({prefKey:ny});return{error:o,isLaunchpadCollapsed:e,setIsLaunchpadCollapsed:t,isLoading:n}},ky=()=>{const[e,t]=v.useState([]),[n,o]=v.useState(!1),r=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!r)return;let i=!1;const a=[],s=r.layouts.onAdded(d=>{if(d.type!=="Global"||i)return;o(!0);const{name:f}=d;t(p=>[...p,{name:f}])}),c=r.layouts.onRemoved(d=>{d.type!=="Global"||i||t(f=>f.filter(p=>p.name!==d.name))}),u=r.layouts.onRenamed((d,f)=>{d.type!=="Global"||i||t(p=>{const h=p.filter(g=>g.name!==d.name),m=h.findIndex(g=>g.name===(f==null?void 0:f.name));return m===-1?p:[...h.slice(0,m),{name:d.name},...h.slice(m+1)]})});return a.push(s,c,u),()=>{i=!0,a.forEach(d=>d())}},[r]),{layouts:e,isInitialized:n}},Sy=e=>{const{handler:t,skip:n}=e;v.useEffect(()=>{if(n)return;const o=r=>{setTimeout(()=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&t(r)},0)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[t,n])},Cy=e=>{const{eventType:t,handler:n,ref:o,skip:r}=e;v.useEffect(()=>{if(r)return;const i=a=>{const s=a.target;(Array.isArray(o)?o.every(u=>u.current&&!u.current.contains(s)):o.current&&!o.current.contains(s))&&n(a)};return document.addEventListener(t,i,!0),()=>{document.removeEventListener(t,i,!0)}},[t,n,o,r])},Ey=()=>{const[e,t]=v.useState([]);return v.useEffect(()=>{const n=({key:i})=>{t(a=>a.includes(i)?a:a.concat(i))},o=i=>{t(a=>a.filter(s=>s!==i.key))},r=()=>{t([])};return document.addEventListener("keydown",n),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",n),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),e.length===1?e[0]:null},zd=()=>{const e=v.useContext(Te.IOConnectContext),t=async({id:o})=>{var r;await((r=e.appManager.application(o))==null?void 0:r.start())},n=async({id:o,modifier:r})=>{var c,u;const i=await((c=e.workspaces)==null?void 0:c.getWorkspace(d=>d.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===Jg||!i||(a==null?void 0:a.type)==="window")return void await((u=e.appManager.application(o))==null?void 0:u.start());await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await($r()?t:n)(o)}catch(r){await ze({io:e,variant:nt,text:`Failed to start app "${o.title}".`,error:r})}}};function Fd(e){const{title:t,buttonSize:n="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:s,buttonVariant:c,placement:u,strategy:d,offset:f,shouldCloseOnOutsideScroll:p=!1,shouldCloseOnWindowBlur:h=!1,shouldCloseOnWindowResize:m=!1,"data-testid":g,contextMenuDataTestId:y}=e,[b,k]=v.useState(!1),[x,S]=v.useState(null),[w,C]=v.useState(null),O=v.useRef(null),_=v.useRef(null),N=v.useMemo(()=>[_,O],[]),E=v.useCallback(()=>k(!1),[]),{styles:A,attributes:j}=function(B,$,R){R===void 0&&(R={});var F=J.useRef(null),z={onFirstUpdate:R.onFirstUpdate,placement:R.placement||"bottom",strategy:R.strategy||"absolute",modifiers:R.modifiers||y2},V=J.useState({styles:{popper:{position:z.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),L=V[0],H=V[1],W=J.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(D){var T=D.state,P=Object.keys(T.elements);Mm.flushSync(function(){H({styles:Ap(P.map(function(I){return[I,T.styles[I]||{}]})),attributes:Ap(P.map(function(I){return[I,T.attributes[I]]}))})})},requires:["computeStyles"]}},[]),U=J.useMemo(function(){var D={onFirstUpdate:z.onFirstUpdate,placement:z.placement,strategy:z.strategy,modifiers:[].concat(z.modifiers,[W,{name:"applyStyles",enabled:!1}])};return g2(F.current,D)?F.current||D:(F.current=D,D)},[z.onFirstUpdate,z.placement,z.strategy,z.modifiers,W]),Y=J.useRef();return Pp(function(){Y.current&&Y.current.setOptions(U)},[U]),Pp(function(){if(B!=null&&$!=null){var D=(R.createPopper||u2)(B,$,U);return Y.current=D,function(){D.destroy(),Y.current=null}}},[B,$,R.createPopper]),{state:Y.current?Y.current.state:null,styles:L.styles,attributes:L.attributes,update:Y.current?Y.current.update:null,forceUpdate:Y.current?Y.current.forceUpdate:null}}(x,w,{placement:u,strategy:d,modifiers:[{name:"offset",options:{offset:f}}]});return v.useEffect(()=>{O.current=x},[x]),v.useEffect(()=>{_.current=w},[w]),Cy({eventType:"mouseup",handler:E,ref:N,skip:!b}),Sy({handler:E,skip:!b}),v.useEffect(()=>{if(h&&b)return window.addEventListener("blur",E),()=>{window.removeEventListener("blur",E)}},[E,b,h]),v.useEffect(()=>{if(!p||!w)return;const B=$=>{w.contains($.target)?$.preventDefault():E()};return document.addEventListener("touchmove",B,{passive:!1}),document.addEventListener("wheel",B,{passive:!1}),()=>{document.removeEventListener("touchmove",B),document.removeEventListener("wheel",B)}},[E,w,p]),v.useEffect(()=>{if(m&&b)return window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)}},[E,b,m]),l.jsxs(l.Fragment,{children:[l.jsx(We,{ref:S,size:n,icon:o,iconSize:r,variant:c,...ja(B=>{B.stopPropagation(),k($=>!$),w==null||w.focus()}),tabIndex:a?0:-1,"data-testid":g}),b&&l.jsx($g,{ref:C,title:t,actions:i,onActionItemClick:(B,$)=>{B.stopPropagation(),s(B,$),E()},onClose:()=>{x==null||x.focus(),E()},style:A.popper,"data-testid":y,...j.popper})]})}function F2({className:e,size:t="large",variant:n="default",align:o="up",text:r,...i}){const a=Q("io-loader",{[`io-loader-${n}`]:n!=="default"},t==="normal"&&"io-loader-md",t==="small"&&"io-loader-sm",o&&[`direction-${o}`],e);return l.jsxs("div",{className:a,role:"status","aria-live":"polite",...i,children:[l.jsx("div",{className:"io-loader-icon"}),r&&l.jsx("div",{className:"io-loader-text",children:r})]})}function Lo({className:e,children:t,...n}){const o=Q("io-panel-header",e);return l.jsx(cn,{className:o,...n,children:t})}Lo.Title=Xn,Lo.ButtonGroup=Be,Lo.Button=tt,Lo.ButtonIcon=We,Lo.Dropdown=fe;const bi=v.forwardRef(({className:e,children:t,...n},o)=>{const r=Q("io-panel-body",e);return l.jsx("div",{className:r,ref:o,"data-testid":"panel-body",...n,children:t})});function Jr({className:e,...t}){const n=Q("io-panel-footer",e);return l.jsx(Er,{className:n,...t})}function ot({className:e,children:t,...n}){const o=Q("io-panel",e);return l.jsx("div",{className:o,"data-testid":"panel",...n,children:t})}function Cc({className:e,variant:t="default",children:n,...o}){const r=Q("io-pill",t!=="default"&&[`io-pill-${t}`],e);return l.jsx("div",{className:r,role:"status",...o,children:n})}function W2({className:e,variant:t="active",value:n=0,...o}){const r=Q("io-progress",t,e);let i;return i=n<0?0:n>100?100:n,l.jsx("div",{className:r,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...o,children:l.jsx("div",{className:"io-progress-bar",style:{width:`${i}%`}})})}/*!
|
|
9
9
|
* OverlayScrollbars
|
|
10
10
|
* Version: 2.14.0
|
|
11
11
|
*
|
|
@@ -13,23 +13,23 @@
|
|
|
13
13
|
* https://github.com/KingSora
|
|
14
14
|
*
|
|
15
15
|
* Released under the MIT license.
|
|
16
|
-
*/xi.displayName="PanelBody",Zr.ButtonGroup=Be,Zr.Button=tt,Zr.ButtonIcon=Ue,Zr.Dropdown=fe,ot.Header=Do,ot.Body=xi,ot.Footer=Zr,xc.Icon=jt;const an=(e,t)=>{const{o:n,i:o,u:r}=e;let i,a=n;const s=(c,u)=>{const d=a,f=c,p=u||(o?!o(d,f):d!==f);return(p||r)&&(a=f,i=d),[a,p,i]};return[t?c=>s(t(a,i),c):s,c=>[a,!!c,i]]},en=typeof window<"u"&&typeof HTMLElement<"u"&&window.document?window:{},Cy=Math.max,z2=Math.min,Su=Math.round,Fo=Math.abs,Fp=Math.sign,Ey=en.cancelAnimationFrame,$d=en.requestAnimationFrame,Hd=en.setTimeout,jy=en.clearTimeout,kc=e=>en[e]!==void 0?en[e]:void 0,F2=kc("MutationObserver"),Wp=kc("IntersectionObserver"),ei=kc("ResizeObserver"),Yi=kc("ScrollTimeline"),Bd=e=>e===void 0,Sc=e=>e===null,Jo=e=>typeof e=="number",Ai=e=>typeof e=="string",Cc=e=>typeof e=="boolean",Hn=e=>typeof e=="function",Sn=e=>Array.isArray(e),zs=e=>typeof e=="object"&&!Sn(e)&&!Sc(e),zd=e=>{const t=!!e&&e.length,n=Jo(t)&&t>-1&&t%1==0;return!!(Sn(e)||!Hn(e)&&n)&&(!(t>0&&zs(e))||t-1 in e)},ha=e=>!!e&&e.constructor===Object,Fs=e=>e instanceof HTMLElement,Ec=e=>e instanceof Element;function Qe(e,t){if(zd(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Qe(Object.keys(e),n=>t(e[n],n,e));return e}const _y=(e,t)=>e.indexOf(t)>=0,ki=(e,t)=>e.concat(t),ft=(e,t,n)=>(!Ai(t)&&zd(t)?Array.prototype.push.apply(e,t):e.push(t),e),ar=e=>Array.from(e||[]),Fd=e=>Sn(e)?e:!Ai(e)&&zd(e)?ar(e):[e],Ws=e=>!!e&&!e.length,Us=e=>ar(new Set(e)),pn=(e,t,n)=>{Qe(e,o=>!o||o.apply(void 0,t||[])),n||(e.length=0)},Oy="paddingTop",Ay="paddingRight",Py="paddingLeft",Ny="paddingBottom",Ty="marginLeft",Iy="marginRight",Ry="marginBottom",Wd="overflowX",Ud="overflowY",jc="width",_c="height",po="visible",Rn="hidden",Si="scroll",Oc=(e,t,n,o)=>{if(e&&t){let r=!0;return Qe(n,i=>{e[i]!==t[i]&&(r=!1)}),r}return!1},Ly=(e,t)=>Oc(e,t,["w","h"]),xs=(e,t)=>Oc(e,t,["x","y"]),W2=(e,t)=>Oc(e,t,["t","r","b","l"]),Oe=(e,...t)=>e.bind(0,...t),ti=e=>{let t;const n=e?Hd:$d,o=e?jy:Ey;return[r=>{o(t),t=n(()=>r(),Hn(e)?e():e)},()=>o(t)]},Up=e=>{const t=Hn(e)?e():e;if(Jo(t)){const n=t?Hd:$d,o=t?jy:Ey;return r=>{const i=n(()=>r(),t);return()=>{o(i)}}}return t&&t._},Dy=(e,t)=>{const{p:n,v:o,S:r,m:i}=t||{};let a,s,c,u;const d=function(m){s&&s(),a&&a(),u=s=a=c=void 0,e.apply(this,m)},f=m=>i&&c?i(c,m):m,p=()=>{s&&c&&d(f(c)||c)},h=function(){const m=ar(arguments),g=Up(n);if(g){const y=typeof r=="function"?r():r,b=Up(o),k=f(m)||m,x=d.bind(0,k);s&&s(),y&&!u?(x(),u=!0,s=g(()=>u=void 0)):(s=g(x),b&&!a&&(a=b(p))),c=k}else d(m)};return h.O=p,h},My=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Xt=e=>e?Object.keys(e):[],We=(e,t,n,o,r,i,a)=>{const s=[t,n,o,r,i,a];return typeof e=="object"&&!Sc(e)||Hn(e)||(e={}),Qe(s,c=>{Qe(c,(u,d)=>{const f=c[d];if(e===f)return!0;const p=Sn(f);if(f&&ha(f)){const h=e[d];let m=h;p&&!Sn(h)?m=[]:p||ha(h)||(m={}),e[d]=We(m,f)}else e[d]=p?f.slice():f})}),e},$y=(e,t)=>Qe(We({},e),(n,o,r)=>{n===void 0?delete r[o]:n&&ha(n)&&(r[o]=$y(n))}),Vd=e=>!Xt(e).length,ma=()=>{},Hy=(e,t,n)=>Cy(e,z2(t,n)),Nr=e=>Us((Sn(e)?e:(e||"").split(" ")).filter(t=>t)),Kd=(e,t)=>e&&e.getAttribute(t),Vp=(e,t)=>e&&e.hasAttribute(t),lo=(e,t,n)=>{Qe(Nr(t),o=>{e&&e.setAttribute(o,String(n||""))})},Un=(e,t)=>{Qe(Nr(t),n=>e&&e.removeAttribute(n))},Ac=(e,t)=>{const n=Nr(Kd(e,t)),o=Oe(lo,e,t),r=(i,a)=>{const s=new Set(n);return Qe(Nr(i),c=>{s[a](c)}),ar(s).join(" ")};return{C:i=>o(r(i,"delete")),$:i=>o(r(i,"add")),H:i=>{const a=Nr(i);return a.reduce((s,c)=>s&&n.includes(c),a.length>0)}}},By=(e,t,n)=>(Ac(e,t).C(n),Oe(Gd,e,t,n)),Gd=(e,t,n)=>(Ac(e,t).$(n),Oe(By,e,t,n)),Vs=(e,t,n,o)=>(o?Gd:By)(e,t,n),qd=(e,t,n)=>Ac(e,t).H(n),zy=e=>Ac(e,"class"),Fy=(e,t)=>{zy(e).C(t)},Jd=(e,t)=>(zy(e).$(t),Oe(Fy,e,t)),Kp=(e,t)=>{const n=t?Ec(t)&&t:document;return n?ar(n.querySelectorAll(e)):[]},Cu=(e,t)=>Ec(e)&&e.matches(t),Wy=e=>Cu(e,"body"),Eu=e=>e?ar(e.childNodes):[],ga=e=>e&&e.parentElement,ni=(e,t)=>Ec(e)&&e.closest(t),ju=e=>document.activeElement,U2=(e,t,n)=>{const o=ni(e,t),r=e&&((a,s)=>{const c=s?Ec(s)&&s:document;return c&&c.querySelector(a)})(n,o),i=ni(r,t)===o;return!(!o||!r)&&(o===e||r===e||i&&ni(ni(e,n),t)!==o)},Ci=e=>{Qe(Fd(e),t=>{const n=ga(t);t&&n&&n.removeChild(t)})},Qt=(e,t)=>Oe(Ci,e&&t&&Qe(Fd(t),n=>{n&&e.appendChild(n)}));let Uy;const ui=e=>{const t=document.createElement("div");return lo(t,"class",e),t},Vy=e=>{const t=ui(),n=Uy,o=e.trim();return t.innerHTML=n?n.createHTML(o):o,Qe(Eu(t),r=>Ci(r))},Gp=(e,t)=>e.getPropertyValue(t)||e[t]||"",Ky=e=>{const t=e||0;return isFinite(t)?t:0},Xa=e=>Ky(parseFloat(e||"")),_u=e=>Math.round(1e4*e)/1e4,Gy=e=>`${_u(Ky(e))}px`;function ya(e,t){e&&t&&Qe(t,(n,o)=>{try{const r=e.style,i=Sc(n)||Cc(n)?"":Jo(n)?Gy(n):n;o.indexOf("--")===0?r.setProperty(o,i):r[o]=i}catch{}})}function Qn(e,t,n){const o=Ai(t);let r=o?"":{};if(e){const i=en.getComputedStyle(e,n)||e.style;r=o?Gp(i,t):ar(t).reduce((a,s)=>(a[s]=Gp(i,s),a),r)}return r}const qp=(e,t,n)=>{const o=t?`${t}-`:"",r=n?`-${n}`:"",i=`${o}top${r}`,a=`${o}right${r}`,s=`${o}bottom${r}`,c=`${o}left${r}`,u=Qn(e,[i,a,s,c]);return{t:Xa(u[i]),r:Xa(u[a]),b:Xa(u[s]),l:Xa(u[c])}},ul=(e,t)=>"translate"+(zs(e)?`(${e.x},${e.y})`:`${t?"X":"Y"}(${e})`),V2={w:0,h:0},Pc=(e,t)=>t?{w:t[`${e}Width`],h:t[`${e}Height`]}:V2,K2=e=>Pc("inner",e||en),di=Oe(Pc,"offset"),qy=Oe(Pc,"client"),Ks=Oe(Pc,"scroll"),Zd=e=>{const t=parseFloat(Qn(e,jc))||0,n=parseFloat(Qn(e,_c))||0;return{w:t-Su(t),h:n-Su(n)}},dl=e=>e.getBoundingClientRect(),Ou=e=>!(!e||!e[_c]&&!e[jc]),Jy=(e,t)=>{const n=Ou(e);return!Ou(t)&&n},Jp=(e,t,n,o)=>{Qe(Nr(t),r=>{e&&e.removeEventListener(r,n,o)})},it=(e,t,n,o)=>{var r;const i=(r=o&&o.I)==null||r,a=o&&o.A||!1,s=o&&o.T||!1,c={passive:i,capture:a};return Oe(pn,Nr(t).map(u=>{const d=s?f=>{Jp(e,u,d,a),n&&n(f)}:n;return e&&e.addEventListener(u,d,c),Oe(Jp,e,u,d,a)}))},Zy=e=>e.stopPropagation(),Au=e=>e.preventDefault(),Yy=e=>Zy(e)||Au(e),qn=(e,t)=>{const{x:n,y:o}=Jo(t)?{x:t,y:t}:t||{};Jo(n)&&(e.scrollLeft=n),Jo(o)&&(e.scrollTop=o)},ln=e=>({x:e.scrollLeft,y:e.scrollTop}),G2=(e,t)=>{const{D:n,M:o}=e,{w:r,h:i}=t,a=(f,p,h)=>{let m=Fp(f)*h,g=Fp(p)*h;if(m===g){const y=Fo(f),b=Fo(p);g=y>b?0:g,m=y<b?0:m}return m=m===g?0:m,[m+0,g+0]},[s,c]=a(n.x,o.x,r),[u,d]=a(n.y,o.y,i);return{D:{x:s,y:u},M:{x:c,y:d}}},fl=({D:e,M:t})=>{const n=(o,r)=>o===0&&o<=r;return{x:n(e.x,t.x),y:n(e.y,t.y)}},Zp=({D:e,M:t},n)=>{const o=(r,i,a)=>Hy(0,1,(r-a)/(r-i)||0);return{x:o(e.x,t.x,n.x),y:o(e.y,t.y,n.y)}},Pu=e=>{e&&e.focus&&e.focus({preventScroll:!0,focusVisible:!1})},Yp=(e,t)=>{Qe(Fd(t),e)},Nu=e=>{const t=new Map,n=(r,i)=>{if(r){const a=t.get(r);Yp(s=>{a&&a[s?"delete":"clear"](s)},i)}else t.forEach(a=>{a.clear()}),t.clear()},o=(r,i)=>{if(Ai(r)){const c=t.get(r)||new Set;return t.set(r,c),Yp(u=>{Hn(u)&&c.add(u)},i),Oe(n,r,i)}Cc(i)&&i&&n();const a=Xt(r),s=[];return Qe(a,c=>{const u=r[c];u&&ft(s,o(c,u))}),Oe(pn,s)};return o(e||{}),[o,n,(r,i)=>{Qe(ar(t.get(r)),a=>{i&&!Ws(i)?a.apply(0,i):a()})}]},Xy={},Qy={},e0=(e,t,n)=>Xt(e).map(o=>{const{static:r,instance:i}=e[o],[a,s,c]=n||[],u=n?i:r;if(u){const d=n?u(a,s,t):u(t);return(c||Qy)[o]=d}}),Pi=e=>Qy[e],Ni="data-overlayscrollbars",ks="os-environment",Qa=`${ks}-scrollbar-hidden`,pl=`${Ni}-initialize`,Ss="noClipping",Xp=`${Ni}-body`,Zo=Ni,uo=`${Ni}-viewport`,q2=Wd,J2=Ud,t0="measuring",n0="scrollbarHidden",Tu=`${Ni}-padding`,Qp=`${Ni}-content`,Yd="os-size-observer",Z2=`${Yd}-appear`,Y2=`${Yd}-listener`,gn="os-scrollbar",X2=`${gn}-rtl`,Q2=`${gn}-horizontal`,ek=`${gn}-vertical`,o0=`${gn}-track`,Xd=`${gn}-handle`,tk=`${gn}-visible`,nk=`${gn}-cornerless`,eh=`${gn}-interaction`,th=`${gn}-unusable`,Iu=`${gn}-auto-hide`,nh=`${Iu}-hidden`,oh=`${gn}-wheel`,ok=`${o0}-interactive`,rk=`${Xd}-interactive`,oi=e=>e.indexOf(po)===0,Ru=(e,t)=>{if(e==="auto")return t?Si:Rn;const n=e||Rn;return[Rn,Si,po].includes(n)?n:Rn},ik=(e,t)=>{const{overflowX:n,overflowY:o}=Qn(e,[Wd,Ud]);return{x:Ru(n,t.x),y:Ru(o,t.y)}},Qd="__osScrollbarsHidingPlugin",rh=e=>JSON.stringify(e,(t,n)=>{if(Hn(n))throw 0;return n}),ih=(e,t)=>e?`${t}`.split(".").reduce((n,o)=>n&&My(n,o)?n[o]:void 0,e):void 0,r0=[33,99],i0=[222,666,!0],ak={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:[0,33],resize:null,event:r0,env:i0},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},a0=(e,t)=>{const n={};return Qe(ki(Xt(t),Xt(e)),o=>{const r=e[o],i=t[o];if(zs(r)&&zs(i))We(n[o]={},a0(r,i)),Vd(n[o])&&delete n[o];else if(My(t,o)&&i!==r){let a=!0;if(Sn(r)||Sn(i))try{rh(r)===rh(i)&&(a=!1)}catch{}a&&(n[o]=i)}}),n},ah=(e,t,n)=>o=>[ih(e,o),n||ih(t,o)!==void 0];let s0,hl;const sk=()=>{const e=(b,k,x)=>{Qt(document.body,b),Qt(document.body,b);const S=qy(b),w=di(b),C=Zd(k);return x&&Ci(b),{x:w.h-S.h+C.h,y:w.w-S.w+C.w}},t=Vy(`<div class="${ks}"><div></div><style>${`.${ks}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${ks} div{width:200%;height:200%;margin:10px 0}.${Qa}{scrollbar-width:none!important}.${Qa}::-webkit-scrollbar,.${Qa}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`}</style></div>`)[0],n=t.firstChild,o=t.lastChild,r=s0;r&&(o.nonce=r);const[i,,a]=Nu(),[s,c]=an({o:e(t,n),i:xs},Oe(e,t,n,!0)),[u]=c(),d=(b=>{let k=!1;const x=Jd(b,Qa);try{k=Qn(b,"scrollbar-width")==="none"||Qn(b,"display","::-webkit-scrollbar")==="none"}catch{}return x(),k})(t),f={x:u.x===0,y:u.y===0},p={elements:{host:null,padding:!d,viewport:b=>d&&Wy(b)&&b,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},h=We({},ak),m=Oe(We,{},h),g=Oe(We,{},p),y={P:u,k:f,U:d,J:!!Yi,G:Oe(i,"r"),K:g,Z:b=>We(p,b)&&g(),tt:m,nt:b=>We(h,b)&&m(),ot:We({},p),st:We({},h)};if(Un(t,"style"),Ci(t),it(en,"resize",()=>{a("r",[])}),Hn(en.matchMedia)&&!d&&(!f.x||!f.y)){const b=k=>{const x=en.matchMedia(`(resolution: ${en.devicePixelRatio}dppx)`);it(x,"change",()=>{k(),b(k)},{T:!0})};b(()=>{const[k,x]=s();We(y.P,k),a("r",[x])})}return y},eo=()=>(hl||(hl=sk()),hl),sh=(e,t,n,o)=>{let r=!1;const{et:i,ct:a,rt:s,it:c,lt:u,ut:d}=o||{},[f,p]=((b,k,x)=>{let S=!1;const w=!!x&&new WeakMap,C=O=>{if(w&&x){const _=x.map(N=>{const[E,A]=N||[];return[A&&E?(O||Kp)(E,b):[],A]});Qe(_,N=>Qe(N[0],E=>{const A=N[1],j=w.get(E)||[];if(b.contains(E)&&A){const B=it(E,A,$=>{S?(B(),w.delete(E)):k($)});w.set(E,ft(j,B))}else pn(j),w.delete(E)}))}};return C(),[()=>{S=!0},C]})(e,()=>r&&n(!0),s),h=a||[],m=ki(i||[],h),g=(b,k)=>{if(!Ws(k)){const x=u||ma,S=d||ma,w=[],C=[];let O=!1,_=!1;if(Qe(k,N=>{const{attributeName:E,target:A,type:j,oldValue:B,addedNodes:$,removedNodes:R}=N,F=j==="attributes",z=j==="childList",V=e===A,L=F&&E,H=L&&Kd(A,E||""),W=Ai(H)?H:null,U=L&&B!==W,Y=_y(h,E)&&U;if(t&&(z||!V)){const D=F&&U,T=D&&c&&Cu(A,c),P=(T?!x(A,E,B,W):!F||D)&&!S(N,!!T,e,o);Qe($,I=>ft(w,I)),Qe(R,I=>ft(w,I)),_=_||P}!t&&V&&U&&!x(A,E,B,W)&&(ft(C,E),O=O||Y)}),p(N=>Us(w).reduce((E,A)=>(ft(E,Kp(N,A)),Cu(A,N)?ft(E,A):E),[])),t)return!b&&_&&n(!1),[!1];if(!Ws(C)||O){const N=[Us(C),O];return b||n.apply(0,N),N}}},y=new F2(Oe(g,!1));return[()=>(y.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:m,subtree:t,childList:t,characterData:t}),r=!0,()=>{r&&(f(),y.disconnect(),r=!1)}),()=>{if(r)return g(!0,y.takeRecords())}]};let dr=null;const c0=(e,t,n)=>{const{ft:o}=n||{},r=Pi("__osSizeObserverPlugin"),[i]=an({o:!1,u:!0});return()=>{const a=[],s=Vy(`<div class="${Yd}"><div class="${Y2}"></div></div>`)[0],c=s.firstChild,u=d=>{let f=!1,p=!1;if(Sn(d)&&!Ws(d)){const h=d[0],[m,,g]=i(h.contentRect),y=Ou(m);p=Jy(m,g),f=!p&&!y}else p=d===!0;f||t({_t:!0,ft:p})};if(ei){if(!Cc(dr)){const h=new ei(ma);h.observe(e,{get box(){dr=!0}}),dr=dr||!1,h.disconnect()}const d=Dy(u,{p:0,v:0}),f=h=>d(h),p=new ei(f);if(p.observe(dr?e:c),ft(a,[()=>{p.disconnect()},!dr&&Qt(e,s)]),dr){const h=new ei(f);h.observe(e,{box:"border-box"}),ft(a,()=>h.disconnect())}}else{if(!r)return ma;{const[d,f]=r(c,u,o);ft(a,ki([Jd(s,Z2),it(s,"animationstart",d),Qt(e,s)],f))}}return Oe(pn,a)}},ck=(e,t)=>{let n;const o=ui("os-trinsic-observer"),[r]=an({o:!1}),i=(s,c)=>{if(s){const u=r((f=>f.h===0||f.isIntersecting||f.intersectionRatio>0)(s)),[,d]=u;return d&&!c&&t(u)&&[u]}},a=(s,c)=>i(c.pop(),s);return[()=>{const s=[];if(Wp)n=new Wp(Oe(a,!1),{root:e}),n.observe(o),ft(s,()=>{n.disconnect()});else{const c=()=>{const u=di(o);i(u)};ft(s,c0(o,c)()),c()}return Oe(pn,ft(s,Qt(e,o)))},()=>n&&a(!0,n.takeRecords())]},lk=(e,t,n,o)=>{let r,i,a,s,c,u,d,f;const p=`[${Zo}]`,h=`[${uo}]`,m=["id","class","style","open","wrap","cols","rows"],{dt:g,vt:y,L:b,gt:k,ht:x,V:S,bt:w,wt:C,yt:O,St:_}=e,N=P=>Qn(P,"direction")==="rtl",E={Ot:!1,B:N(g)},A=eo(),j=Pi(Qd),[B]=an({i:Ly,o:{w:0,h:0}},()=>{const P=j&&j.R(e,t,E,A,n).Y,I=!(w&&S)&&qd(y,Zo,Ss),G=!S&&C("arrange"),K=G&&ln(k),X=K&&_(),Z=O(t0,I),M=G&&P&&P(),se=Ks(b),ce=Zd(b);return M&&M(),qn(k,K),X&&X(),I&&Z(),{w:se.w+ce.w,h:se.h+ce.h}}),$=(()=>{let P,I,G;const K=Dy(o,{p:()=>P,v:()=>I,S:()=>G,m(Z,M){const[se]=Z,[ce]=M;return[ki(Xt(se),Xt(ce)).reduce((ge,be)=>(ge[be]=se[be]||ce[be],ge),{})]}}),X=(Z,M)=>{if(Sn(M)){const[se,ce,ge]=M;P=se,I=ce,G=ge}else Jo(M)?(P=M,I=!1,G=!1):(P=!1,I=!1,G=!1);K(Z)};return X.O=K.O,X})(),R=P=>{const I=N(g);We(P,{Ct:f!==I}),We(E,{B:I}),f=I},F=(P,I)=>{const[G,K]=P,X={$t:K};return We(E,{Ot:G}),I||o(X),X},z=({_t:P,ft:I})=>{const G=I?o:$,K={_t:P||I,ft:I};R(K),G(K,i)},V=(P,I)=>{const[,G]=B(),K={xt:G};return R(K),G&&!I&&$(K,P?a:r),K},L=(P,I,G)=>{const K={Ht:I};return R(K),I&&!G&&$(K,r),K},[H,W]=x?ck(y,F):[],U=!S&&c0(y,z,{ft:!0}),[Y,D]=sh(y,!1,L,{ct:m,et:m}),T=S&&ei&&new ei(P=>{const I=P[P.length-1].contentRect;z({_t:!0,ft:Jy(I,d)}),d=I});return[()=>{T&&T.observe(y);const P=U&&U(),I=H&&H(),G=Y(),K=A.G(X=>{const[,Z]=B();$({Et:X,xt:Z,_t:w},s)});return()=>{T&&T.disconnect(),P&&P(),I&&I(),u&&u(),G(),K()}},({zt:P,It:I,At:G})=>{const K={},[X]=P("update.ignoreMutation"),[Z,M]=P("update.attributes"),[se,ce]=P("update.elementEvents"),[ge,be]=P("update.debounce"),Ee=I||G;if(ce||M){c&&c(),u&&u();const[ne,oe]=sh(x||b,!0,V,{et:ki(m,Z||[]),rt:se,it:p,ut:(te,Se)=>{const{target:Te,attributeName:le}=te;return!(Se||!le||S)&&U2(Te,p,h)||!!ni(Te,`.${gn}`)||!!(Re=>Hn(X)&&X(Re))(te)}});u=ne(),c=oe}if(be&&($.O(),Sn(ge)||Jo(ge)?(r=ge,i=!1,a=r0,s=i0):ha(ge)?(r=ge.mutation,i=ge.resize,a=ge.event,s=ge.env):(r=!1,i=!1,a=!1,s=!1)),Ee){const ne=D(),oe=W&&W(),te=c&&c();ne&&We(K,L(ne[0],ne[1],Ee)),oe&&We(K,F(oe[0],Ee)),te&&We(K,V(te[0],Ee))}return R(K),K},E]},l0=(e,t)=>Hn(t)?t.apply(0,e):t,uk=(e,t,n,o)=>{const r=Bd(o)?n:o;return l0(e,r)||t.apply(0,e)},u0=(e,t,n,o)=>{const r=Bd(o)?n:o,i=l0(e,r);return!!i&&(Fs(i)?i:t.apply(0,e))},dk=(e,t,n,o)=>{const r="--os-viewport-percent",i="--os-scroll-percent",a="--os-scroll-direction",{K:s}=eo(),{scrollbars:c}=s(),{slot:u}=c,{dt:d,vt:f,L:p,Tt:h,gt:m,bt:g,V:y}=t,{scrollbars:b}=h?{}:e,{slot:k}=b||{},x=[],S=[],w=[],C=u0([d,f,p],()=>y&&g?d:f,u,k),O=R=>{if(Yi){let F=null,z=[];const V=new Yi({source:m,axis:R}),L=()=>{F&&F.cancel(),F=null};return{kt:W=>{const{Dt:U}=n,Y=fl(U)[R],D=R==="x",T=[ul(0,D),ul(`calc(-100% + 100cq${D?"w":"h"})`,D)],P=Y?T:T.reverse();return z[0]===P[0]&&z[1]===P[1]||(z=P,L(),F=W.Mt.animate({clear:["left"],transform:P},{timeline:V})),L}}}},_={x:O("x"),y:O("y")},N=(R,F,z)=>{const V=z?Jd:Fy;Qe(R,L=>{V(L.Lt,F)})},E=(R,F)=>{Qe(R,z=>{const[V,L]=F(z);ya(V,L)})},A=(R,F,z)=>{const V=Cc(z),L=!V||!z;(!V||z)&&N(S,R,F),L&&N(w,R,F)},j=R=>{const F=R?"x":"y",z=ui(`${gn} ${R?Q2:ek}`),V=ui(o0),L=ui(Xd),H={Lt:z,Ut:V,Mt:L},W=_[F];return ft(R?S:w,H),ft(x,[Qt(z,V),Qt(V,L),Oe(Ci,z),W&&W.kt(H),o(H,A,R)]),H},B=Oe(j,!0),$=Oe(j,!1);return B(),$(),[{Pt:()=>{const R=(()=>{const{Rt:z,Vt:V}=n,L=(H,W)=>Hy(0,1,H/(H+W)||0);return{x:L(V.x,z.x),y:L(V.y,z.y)}})(),F=z=>V=>[V.Lt,{[r]:_u(z)+""}];E(S,F(R.x)),E(w,F(R.y))},Nt:()=>{if(!Yi){const{Dt:R}=n,F=Zp(R,ln(m)),z=V=>L=>[L.Lt,{[i]:_u(V)+""}];E(S,z(F.x)),E(w,z(F.y))}},qt:()=>{const{Dt:R}=n,F=fl(R),z=V=>L=>[L.Lt,{[a]:V?"0":"1"}];E(S,z(F.x)),E(w,z(F.y)),Yi&&(S.forEach(_.x.kt),w.forEach(_.y.kt))},Bt:()=>{if(y&&!g){const{Rt:R,Dt:F}=n,z=fl(F),V=Zp(F,ln(m)),L=H=>{const{Lt:W}=H,U=ga(W)===p&&W,Y=(D,T,P)=>{const I=T*D;return Gy(P?I:-I)};return[U,U&&{transform:ul({x:Y(V.x,R.x,z.x),y:Y(V.y,R.y,z.y)})}]};E(S,L),E(w,L)}},Ft:A,jt:{Xt:S,Yt:B,Wt:Oe(E,S)},Jt:{Xt:w,Yt:$,Wt:Oe(E,w)}},()=>(Qt(C,S[0].Lt),Qt(C,w[0].Lt),Oe(pn,x))]},fk=(e,t,n,o)=>(r,i,a)=>{const{vt:s,L:c,V:u,gt:d,Gt:f,St:p}=t,{Lt:h,Ut:m,Mt:g}=r,[y,b]=ti(333),[k,x]=ti(444),S=C=>{Hn(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:C.x,top:C.y})};let w=!0;return Oe(pn,[it(g,"pointermove pointerleave",o),it(h,"pointerenter",()=>{i(eh,!0)}),it(h,"pointerleave pointercancel",()=>{i(eh,!1)}),!u&&it(h,"mousedown",()=>{const C=ju();(Vp(C,uo)||Vp(C,Zo)||C===document.body)&&Hd(Oe(Pu,c),25)}),it(h,"wheel",C=>{const{deltaX:O,deltaY:_,deltaMode:N}=C;w&&N===0&&ga(h)===s&&S({x:O,y:_}),w=!1,i(oh,!0),y(()=>{w=!0,i(oh)}),Au(C)},{I:!1,A:!0}),it(h,"pointerdown",()=>{const C=it(f,"click",_=>{O(),Yy(_)},{T:!0,A:!0,I:!1}),O=it(f,"pointerup pointercancel",()=>{O(),setTimeout(C,150)},{A:!0,I:!0})},{A:!0,I:!0}),(()=>{const C="pointerup pointercancel lostpointercapture",O="client"+(a?"X":"Y"),_=a?jc:_c,N=a?"left":"top",E=a?"w":"h",A=a?"x":"y",j=($,R)=>F=>{const{Rt:z}=n,V=di(m)[E]-di(g)[E],L=R*F/V*z[A];qn(d,{[A]:$+L})},B=[];return it(m,"pointerdown",$=>{const R=ni($.target,`.${Xd}`)===g,F=R?g:m,z=e.scrollbars,V=z[R?"dragScroll":"clickScroll"],{button:L,isPrimary:H,pointerType:W}=$,{pointers:U}=z;if(L===0&&H&&V&&(U||[]).includes(W)){pn(B),x();const Y=!R&&($.shiftKey||V==="instant"),D=Oe(dl,g),T=Oe(dl,m),P=(te,Se)=>(te||D())[N]-(Se||T())[N],I=Su(dl(d)[_])/di(d)[E]||1,G=j(ln(d)[A],1/I),K=$[O],X=D(),Z=T(),M=X[_],se=P(X,Z)+M/2,ce=K-Z[N],ge=R?0:ce-se,be=te=>{pn(oe),F.releasePointerCapture(te.pointerId)},Ee=R||Y,ne=p(),oe=[it(f,C,be),it(f,"selectstart",te=>Au(te),{I:!1}),it(m,C,be),Ee&&it(m,"pointermove",te=>G(ge+(te[O]-K))),Ee&&(()=>{const te=ln(d);ne();const Se=ln(d),Te={x:Se.x-te.x,y:Se.y-te.y};(Fo(Te.x)>3||Fo(Te.y)>3)&&(p(),qn(d,te),S(Te),k(ne))})];if(F.setPointerCapture($.pointerId),Y)G(ge);else if(!R){const te=Pi("__osClickScrollPlugin");if(te){const Se=te(G,ge,M,Te=>{Te?ne():ft(oe,ne)});ft(oe,Se),ft(B,Oe(Se,!0))}}}})})(),b,x])},pk=e=>{const t=eo(),{K:n,U:o}=t,{elements:r}=n(),{padding:i,viewport:a,content:s}=r,c=Fs(e),u=c?{}:e,{elements:d}=u,{padding:f,viewport:p,content:h}=d||{},m=c?e:u.target,g=Wy(m),y=m.ownerDocument,b=y.documentElement,k=()=>y.defaultView||en,x=Oe(uk,[m]),S=Oe(u0,[m]),w=Oe(ui,""),C=Oe(x,w,a),O=Oe(S,w,s),_=C(p),N=_===m,E=N&&g,A=!N&&O(h),j=!N&&_===A,B=E?b:_,$=E?B:m,R=!N&&S(w,i,f),F=!j&&A,z=[F,B,R,$].map(Z=>Fs(Z)&&!ga(Z)&&Z),V=Z=>Z&&_y(z,Z),L=!V(B)&&(Z=>{const M=di(Z),se=Ks(Z),ce=Qn(Z,Wd),ge=Qn(Z,Ud);return se.w-M.w>0&&!oi(ce)||se.h-M.h>0&&!oi(ge)})(B)?B:m,H=E?b:B,W={dt:m,vt:$,L:B,rn:R,ht:F,gt:H,Kt:E?y:B,ln:g?b:L,Gt:y,bt:g,Tt:c,V:N,an:k,wt:Z=>qd(B,uo,Z),yt:(Z,M)=>Vs(B,uo,Z,M),St:()=>Vs(H,uo,"scrolling",!0)},{dt:U,vt:Y,rn:D,L:T,ht:P}=W,I=[()=>{Un(Y,[Zo,pl]),Un(U,pl),g&&Un(b,[pl,Zo])}];let G=Eu([P,T,D,Y,U].find(Z=>Z&&!V(Z)));const K=E?U:P||T,X=Oe(pn,I);return[W,()=>{const Z=k(),M=ju(),se=ne=>{Qt(ga(ne),Eu(ne)),Ci(ne)},ce=ne=>it(ne,"focusin focusout focus blur",Yy,{A:!0,I:!1}),ge="tabindex",be=Kd(T,ge),Ee=ce(M);return lo(Y,Zo,N?"":"host"),lo(D,Tu,""),lo(T,uo,""),lo(P,Qp,""),N||(lo(T,ge,be||"-1"),g&&lo(b,Xp,"")),Qt(K,G),Qt(Y,D),Qt(D||Y,!N&&T),Qt(T,P),ft(I,[Ee,()=>{const ne=ju(),oe=V(T),te=oe&&ne===T?U:ne,Se=ce(te);Un(D,Tu),Un(P,Qp),Un(T,uo),g&&Un(b,Xp),be?lo(T,ge,be):Un(T,ge),V(P)&&se(P),oe&&se(T),V(D)&&se(D),Pu(te),Se()}]),o&&!N&&(Gd(T,uo,n0),ft(I,Oe(Un,T,uo))),Pu(!N&&g&&M===U&&Z.top===Z?T:M),Ee(),G=0,X},X]},hk=({ht:e})=>({Qt:t,un:n,At:o})=>{const{$t:r}=t||{},{Ot:i}=n;e&&(r||o)&&ya(e,{[_c]:i&&"100%"})},mk=({vt:e,rn:t,L:n,V:o},r)=>{const[i,a]=an({i:W2,o:qp()},Oe(qp,e,"padding",""));return({zt:s,Qt:c,un:u,At:d})=>{let[f,p]=a(d);const{U:h}=eo(),{_t:m,xt:g,Ct:y}=c||{},{B:b}=u,[k,x]=s("paddingAbsolute");(m||p||d||g)&&([f,p]=i(d));const S=!o&&(x||y||p);if(S){const w=!k||!t&&!h,C=f.r+f.l,O=f.t+f.b,_={[Iy]:w&&!b?-C:0,[Ry]:w?-O:0,[Ty]:w&&b?-C:0,top:w?-f.t:0,right:w?b?-f.r:"auto":0,left:w?b?"auto":-f.l:0,[jc]:w&&`calc(100% + ${C}px)`},N={[Oy]:w?f.t:0,[Ay]:w?f.r:0,[Ny]:w?f.b:0,[Py]:w?f.l:0};ya(t||n,_),ya(n,N),We(r,{rn:f,fn:!w,F:t?N:We({},_,N)})}return{_n:S}}},gk=(e,t)=>{const n=eo(),{vt:o,rn:r,L:i,V:a,Kt:s,gt:c,bt:u,yt:d,an:f}=e,{U:p}=n,h=u&&a,m=Oe(Cy,0),g={display:()=>!1,direction:D=>D!=="ltr",flexDirection:D=>D.endsWith("-reverse"),writingMode:D=>D!=="horizontal-tb"},y=Xt(g),b={i:Ly,o:{w:0,h:0}},k={i:xs,o:{}},x=D=>{d(t0,!h&&D)},S=()=>Qn(i,y),w=(D,T)=>{const P=!Xt(D).length,I=!T&&y.some(ne=>{const oe=D[ne];return Ai(oe)&&g[ne](oe)});if(P&&!I||!(ne=>!!ne&&(oe=>!!(oe.offsetWidth||oe.offsetHeight||oe.getClientRects().length))(ne))(i))return{D:{x:0,y:0},M:{x:1,y:1}};x(!0);const G=ln(c),K=it(s,Si,ne=>{const oe=ln(c);ne.isTrusted&&oe.x===G.x&&oe.y===G.y&&Zy(ne)},{A:!0,T:!0}),X=d("noContent",!0);qn(c,{x:0,y:0}),X();const Z=ln(c),M=Ks(c);qn(c,{x:M.w,y:M.h});const se=ln(c),ce={x:se.x-Z.x,y:se.y-Z.y};qn(c,{x:-M.w,y:-M.h});const ge=ln(c),be={x:ge.x-Z.x,y:ge.y-Z.y},Ee={x:Fo(ce.x)>=Fo(be.x)?se.x:ge.x,y:Fo(ce.y)>=Fo(be.y)?se.y:ge.y};return qn(c,G),$d(()=>K()),{D:Z,M:Ee}},C=(D,T)=>{const P=en.devicePixelRatio%1!=0?1:0,I={w:m(D.w-T.w),h:m(D.h-T.h)};return{w:I.w>P?I.w:0,h:I.h>P?I.h:0}},O=(D,T)=>{const P=(I,G,K,X)=>{const Z=I===po?Rn:(ce=>ce.replace(`${po}-`,""))(I),M=oi(I),se=oi(K);return!G&&!X?Rn:M&&se?po:M?G&&X?Z:G?po:Rn:G?Z:se&&X?po:Rn};return{x:P(T.x,D.x,T.y,D.y),y:P(T.y,D.y,T.x,D.x)}},_=D=>{const T=I=>[po,Rn,Si].map(G=>Y(Ru(G),I)),P=T(!0).concat(T()).join(" ");d(P),d(Xt(D).map(I=>Y(D[I],I==="x")).join(" "),!0)},[N,E]=an(b,Oe(Zd,i)),[A,j]=an(b,Oe(Ks,i)),[B,$]=an(b),[R]=an(k),[F,z]=an(b),[V]=an(k),[L]=an({i:(D,T)=>Oc(D,T,Us(ki(Xt(D),Xt(T)))),o:{}}),[H,W]=an({i:(D,T)=>xs(D.D,T.D)&&xs(D.M,T.M),o:{D:{x:0,y:0},M:{x:0,y:0}}}),U=Pi(Qd),Y=(D,T)=>`${T?q2:J2}${(P=>{const I=String(P||"");return I?I[0].toUpperCase()+I.slice(1):""})(D)}`;return({zt:D,Qt:T,un:P,At:I},{_n:G})=>{const{_t:K,Ht:X,xt:Z,Ct:M,ft:se,Et:ce}=T||{},ge=U&&U.R(e,t,P,n,D),{X:be,Y:Ee,W:ne}=ge||{},[oe,te]=((Wr,So)=>{const{k:Fn}=So,[Co,Eo]=Wr("showNativeOverlaidScrollbars");return[Co&&Fn.x&&Fn.y,Eo]})(D,n),[Se,Te]=D("overflow"),le=oi(Se.x),Re=oi(Se.y),Ye=K||G||Z||M||ce||te;let st=E(I),_e=j(I),Pe=$(I),$e=z(I);if(te&&p&&d(n0,!oe),Ye){qd(o,Zo,Ss)&&x(!0);const Wr=Ee&&Ee(),[So]=st=N(I),[Fn]=_e=A(I),Co=qy(i),Eo=h&&K2(f()),Jc={w:m(Fn.w+So.w),h:m(Fn.h+So.h)},Ua={w:m((Eo?Eo.w:Co.w+m(Co.w-Fn.w))+So.w),h:m((Eo?Eo.h:Co.h+m(Co.h-Fn.h))+So.h)};Wr&&Wr(),$e=F(Ua),Pe=B(C(Jc,Ua),I)}const[Le,de]=$e,[ye,re]=Pe,[ve,He]=_e,[we,ie]=st,[ee,ae]=R({x:ye.w>0,y:ye.h>0}),me=le&&Re&&(ee.x||ee.y)||le&&ee.x&&!ee.y||Re&&ee.y&&!ee.x,De=G||M||ce||ie||He||de||re||Te||te||Ye||X&&h,[je]=D("update.flowDirectionStyles"),[ct,on]=L(je?je(i):S(),I),Ii=M||se||on||ae||I,[ur,Ht]=Ii?H(w(ct,!!je),I):W();let Bt=O(ee,Se);x(!1),De&&(_(Bt),Bt=ik(i,ee),ne&&be&&(be(Bt,ve,we),ya(i,ne(Bt))));const[io,qc]=V(Bt);return Vs(o,Zo,Ss,me),Vs(r,Tu,Ss,me),We(t,{cn:io,Vt:{x:Le.w,y:Le.h},Rt:{x:ye.w,y:ye.h},j:ee,Dt:G2(ur,ye)}),{sn:qc,tn:de,nn:re,en:Ht||re}}},yk=e=>{const[t,n,o]=pk(e),r={rn:{t:0,r:0,b:0,l:0},fn:!1,F:{[Iy]:0,[Ry]:0,[Ty]:0,[Oy]:0,[Ay]:0,[Ny]:0,[Py]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},cn:{x:Rn,y:Rn},j:{x:!1,y:!1},Dt:{D:{x:0,y:0},M:{x:0,y:0}}},{dt:i,gt:a,V:s,St:c}=t,{U:u,k:d}=eo(),f=!u&&(d.x||d.y),p=[hk(t),mk(t,r),gk(t,r)];return[n,h=>{const m={},g=f&&ln(a),y=g&&c();return Qe(p,b=>{We(m,b(h,m)||{})}),qn(a,g),y&&y(),s||qn(i,0),m},r,t,o]},vk=(e,t,n,o,r)=>{let i=!1;const a=ah(t,{}),[s,c,u,d,f]=yk(e),[p,h,m]=lk(d,u,a,S=>{x({},S)}),[g,y,,b]=((S,w,C,O,_,N)=>{let E,A,j,B,$,R=ma,F=0;const z=["mouse","pen"],V=le=>z.includes(le.pointerType),[L,H]=ti(),[W,U]=ti(100),[Y,D]=ti(100),[T,P]=ti(()=>F),[I,G]=dk(S,_,O,fk(w,_,O,le=>V(le)&&ne())),{vt:K,Kt:X,bt:Z}=_,{Ft:M,Pt:se,Nt:ce,qt:ge,Bt:be}=I,Ee=(le,Re)=>{if(P(),le)M(nh);else{const Ye=Oe(M,nh,!0);F>0&&!Re?T(Ye):Ye()}},ne=()=>{(j?E:B)||(Ee(!0),W(()=>{Ee(!1)}))},oe=le=>{M(Iu,le,!0),M(Iu,le,!1)},te=le=>{V(le)&&(E=j,j&&Ee(!0))},Se=[P,U,D,H,()=>R(),it(K,"pointerover",te,{T:!0}),it(K,"pointerenter",te),it(K,"pointerleave",le=>{V(le)&&(E=!1,j&&Ee(!1))}),it(K,"pointermove",le=>{V(le)&&A&&ne()}),it(X,"scroll",le=>{L(()=>{ce(),ne()}),N(le),be()})],Te=Pi(Qd);return[()=>Oe(pn,ft(Se,G())),({zt:le,At:Re,Qt:Ye,Zt:st})=>{const{tn:_e,nn:Pe,sn:$e,en:Le}=st||{},{Ct:de,ft:ye}=Ye||{},{B:re}=C,{k:ve,U:He}=eo(),{cn:we,j:ie}=O,[ee,ae]=le("showNativeOverlaidScrollbars"),[me,De]=le("scrollbars.theme"),[je,ct]=le("scrollbars.visibility"),[on,Ii]=le("scrollbars.autoHide"),[ur,Ht]=le("scrollbars.autoHideSuspend"),[Bt]=le("scrollbars.autoHideDelay"),[io,qc]=le("scrollbars.dragScroll"),[Wr,So]=le("scrollbars.clickScroll"),[Fn,Co]=le("overflow"),Eo=ye&&!Re,Jc=ie.x||ie.y,Ua=_e||Pe||Le||de||Re,Bb=$e||ct||Co,zb=ee&&ve.x&&ve.y,Uf=!He&&!Te,Fb=zb||Uf,Vf=(Zc,Yc,Wb)=>{const Kf=Zc.includes(Si)&&(je===po||je==="auto"&&Yc===Si);return M(tk,Kf,Wb),Kf};if(F=Bt,Eo&&(ur&&Jc?(oe(!1),R(),Y(()=>{R=it(X,"scroll",Oe(oe,!0),{T:!0})})):oe(!0)),(ae||Uf)&&M("os-theme-none",Fb),De&&(M($),M(me,!0),$=me),Ht&&!ur&&oe(!0),Ii&&(A=on==="move",j=on==="leave",B=on==="never",Ee(B,!0)),qc&&M(rk,io),So&&M(ok,!!Wr),Bb){const Zc=Vf(Fn.x,we.x,!0),Yc=Vf(Fn.y,we.y,!1);M(nk,!(Zc&&Yc))}Ua&&(ce(),se(),be(),Le&&ge(),M(th,!ie.x,!0),M(th,!ie.y,!1),M(X2,re&&!Z))},{},I]})(e,t,m,u,d,r),k=S=>Xt(S).some(w=>!!S[w]),x=(S,w)=>{if(n())return!1;const{dn:C,At:O,It:_,pn:N}=S,E=C||{},A=!!O||!i,j={zt:ah(t,E,A),dn:E,At:A};if(N)return y(j),!1;const B=w||h(We({},j,{It:_})),$=c(We({},j,{un:m,Qt:B}));y(We({},j,{Qt:B,Zt:$}));const R=k(B),F=k($),z=R||F||!Vd(E)||A;return i=!0,z&&o(S,{Qt:B,Zt:$}),z};return[()=>{const{ln:S,gt:w,St:C}=d,O=ln(S),_=[p(),s(),g()],N=C();return qn(w,O),N(),Oe(pn,_)},x,()=>({vn:m,gn:u}),{hn:d,bn:b},f]},Lu=new WeakMap,d0=e=>Lu.get(e),An=(e,t,n)=>{const{tt:o}=eo(),r=Fs(e),i=r?e:e.target,a=d0(i);if(t&&!a){let s=!1;const c=[],u={},d=E=>{const A=$y(E),j=Pi("__osOptionsValidationPlugin");return j?j(A,!0):A},f=We({},o(),d(t)),[p,h,m]=Nu(),[g,y,b]=Nu(n),k=(E,A)=>{b(E,A),m(E,A)},[x,S,w,C,O]=vk(e,f,()=>s,({dn:E,At:A},{Qt:j,Zt:B})=>{const{_t:$,Ct:R,$t:F,xt:z,Ht:V,ft:L}=j,{tn:H,nn:W,sn:U,en:Y}=B;k("updated",[N,{updateHints:{sizeChanged:!!$,directionChanged:!!R,heightIntrinsicChanged:!!F,overflowEdgeChanged:!!H,overflowAmountChanged:!!W,overflowStyleChanged:!!U,scrollCoordinatesChanged:!!Y,contentMutation:!!z,hostMutation:!!V,appear:!!L},changedOptions:E||{},force:!!A}])},E=>k("scroll",[N,E])),_=E=>{(A=>{Lu.delete(A)})(i),pn(c),s=!0,k("destroyed",[N,E]),h(),y()},N={options(E,A){if(E){const j=A?o():{},B=a0(f,We(j,d(E)));Vd(B)||(We(f,B),S({dn:B}))}return We({},f)},on:g,off:(E,A)=>{E&&A&&y(E,A)},state(){const{vn:E,gn:A}=w(),{B:j}=E,{Vt:B,Rt:$,cn:R,j:F,rn:z,fn:V,Dt:L}=A;return We({},{overflowEdge:B,overflowAmount:$,overflowStyle:R,hasOverflow:F,scrollCoordinates:{start:L.D,end:L.M},padding:z,paddingAbsolute:V,directionRTL:j,destroyed:s})},elements(){const{dt:E,vt:A,rn:j,L:B,ht:$,gt:R,Kt:F}=C.hn,{jt:z,Jt:V}=C.bn,L=W=>{const{Mt:U,Ut:Y,Lt:D}=W;return{scrollbar:D,track:Y,handle:U}},H=W=>{const{Xt:U,Yt:Y}=W,D=L(U[0]);return We({},D,{clone:()=>{const T=L(Y());return S({pn:!0}),T}})};return We({},{target:E,host:A,padding:j||B,viewport:B,content:$||B,scrollOffsetElement:R,scrollEventElement:F,scrollbarHorizontal:H(z),scrollbarVertical:H(V)})},update:E=>S({At:E,It:!0}),destroy:Oe(_,!1),plugin:E=>u[Xt(E)[0]]};return ft(c,[O]),((E,A)=>{Lu.set(E,A)})(i,N),e0(Xy,An,[N,p,u]),((E,A)=>{const{nativeScrollbarsOverlaid:j,body:B}=A||{},{k:$,U:R,K:F}=eo(),{nativeScrollbarsOverlaid:z,body:V}=F().cancel,L=j??z,H=Bd(B)?V:B,W=($.x||$.y)&&L,U=E&&(Sc(H)?!R:H);return!!W||!!U})(C.hn.bt,!r&&e.cancel)?(_(!0),N):(ft(c,x()),k("initialized",[N]),N.update(),N)}return a};An.plugin=e=>{const t=Sn(e),n=t?e:[e],o=n.map(r=>e0(r,An)[0]);return(r=>{Qe(r,i=>Qe(i,(a,s)=>{Xy[s]=i[s]}))})(n),t?o:o[0]},An.valid=e=>{const t=e&&e.elements,n=Hn(t)&&t();return ha(n)&&!!d0(n.target)},An.env=()=>{const{P:e,k:t,U:n,J:o,ot:r,st:i,K:a,Z:s,tt:c,nt:u}=eo();return We({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,scrollTimeline:o,staticDefaultInitialization:r,staticDefaultOptions:i,getDefaultInitialization:a,setDefaultInitialization:s,getDefaultOptions:c,setDefaultOptions:u})},An.nonce=e=>{s0=e},An.trustedTypePolicy=e=>{Uy=e};const wk=()=>{if(typeof window>"u"){const u=()=>{};return[u,u]}let e,t;const n=window,o=typeof n.requestIdleCallback=="function",r=n.requestAnimationFrame,i=n.cancelAnimationFrame,a=o?n.requestIdleCallback:r,s=o?n.cancelIdleCallback:i,c=()=>{s(e),i(t)};return[(u,d)=>{c(),e=a(o?()=>{c(),t=r(u)}:u,typeof d=="object"?d:{timeout:2233})},c]},f0=e=>{const{options:t,events:n,defer:o}=e||{},[r,i]=v.useMemo(wk,[]),a=v.useRef(null),s=v.useRef(o),c=v.useRef(t),u=v.useRef(n);return v.useEffect(()=>{s.current=o},[o]),v.useEffect(()=>{const{current:d}=a;c.current=t,An.valid(d)&&d.options(t||{},!0)},[t]),v.useEffect(()=>{const{current:d}=a;u.current=n,An.valid(d)&&d.on(n||{},!0)},[n]),v.useEffect(()=>()=>{var d;i(),(d=a.current)==null||d.destroy()},[]),v.useMemo(()=>[d=>{const f=a.current;if(An.valid(f))return;const p=s.current,h=c.current||{},m=u.current||{},g=()=>a.current=An(d,h,m);p?r(g,p):g()},()=>a.current],[])};v.forwardRef((e,t)=>{const{element:n="div",options:o,events:r,defer:i,children:a,...s}=e,c=n,u=v.useRef(null),d=v.useRef(null),[f,p]=f0({options:o,events:r,defer:i});return v.useEffect(()=>{const{current:h}=u,{current:m}=d;if(h)return f(n==="body"?{target:h,cancel:{body:null}}:{target:h,elements:{viewport:m,content:m}}),()=>{var g;return(g=p())==null?void 0:g.destroy()}},[f,n]),v.useImperativeHandle(t,()=>({osInstance:p,getElement:()=>u.current}),[]),v.createElement(c,{"data-overlayscrollbars-initialize":"",ref:u,...s},n==="body"?a:v.createElement("div",{"data-overlayscrollbars-contents":"",ref:d},a))});const sr=v.forwardRef((e,t)=>{const{children:n,element:o="div",elementProps:r,wrapperClassName:i}=e,a=v.useRef(null),s=v.useRef(null),[c,u]=f0({options:{scrollbars:{autoHide:"leave",autoHideDelay:0}},defer:!0}),d=v.useCallback(f=>{s.current=f,typeof t=="function"?t(f):t!==null&&(t.current=f)},[t]);return v.useEffect(()=>{if(s.current&&a.current)return c({target:a.current,elements:{viewport:s.current,content:s.current}}),()=>{var f;return(f=u())==null?void 0:f.destroy()}},[c,u]),l.jsx("div",{"data-overlayscrollbars-initialize":"",ref:a,className:Q("io-overlay-scrollbars-container",i),children:l.jsx(o,{"data-overlayscrollbars-contents":"",ref:d,...r,children:n})})});function Nc({text:e="Label",...t}){return l.jsx("label",{...t,children:e})}var bk=v[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],p0=0,xk=()=>p0++,ch=0;function kk(e,t){t===void 0&&(t="🅰");var[n,o]=v.useState(ch?xk:void 0);return bk(()=>{n===void 0&&o(p0++),ch=1},[]),e||(n===void 0?n:t+n)}function Pa(){return(typeof v.useId=="function"?v.useId:kk)()??""}const nr=v.forwardRef(({id:e,className:t,type:n="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:s,iconAppend:c,iconAppendOnClick:u,placeholder:d,disabled:f,readOnly:p,errorMessage:h,errorDataTestId:m,...g},y)=>{const b=Pa(),k=e||`input-${b}`,x=Q("io-control-input",a&&"io-control-leading-icon",c&&"io-control-trailing-icon",f&&"io-control-disabled",p&&"io-control-readonly",h&&"io-control-error",r&&[`direction-${r}`],t),S=v.useCallback(C=>{f?C.preventDefault():s&&s(C)},[s,f]),w=v.useCallback(C=>{f?C.preventDefault():u&&u(C)},[u,f]);return l.jsxs("div",{className:x,children:[i&&l.jsx(Nc,{htmlFor:k,text:i}),a&&l.jsx(jt,{variant:a,onClick:C=>S(C)}),l.jsx("input",{id:k,className:"io-input",ref:y,type:n,name:o,tabIndex:0,placeholder:d??(()=>{switch(n){case"email":return"Enter your email here...";case"number":return"Enter number here...";case"password":return"Enter your password here...";case"tel":return"Enter your phone number here...";case"file":return"Select a file...";default:return"Enter text here..."}})(),"aria-label":i,disabled:f,readOnly:p,...h?{"aria-invalid":!0,"aria-describedby":`${k}-error`}:{},...g}),c&&l.jsx(jt,{variant:c,onClick:C=>w(C)}),h&&l.jsxs("div",{"data-testid":m,id:`${k}-error`,className:"io-input-error",children:[l.jsx(jt,{variant:"close"}),h]})]})});nr.displayName="Input";const Tc=v.forwardRef(({id:e,className:t,name:n="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:s,readOnly:c,...u},d)=>{const f=Pa(),p=e||`textarea-${f}`,h=Q("io-control-textarea",s&&"io-control-disabled",c&&"io-control-readonly",o&&[`direction-${o}`],t);return l.jsxs("div",{className:h,children:[r&&l.jsx(Nc,{htmlFor:p,text:r}),l.jsx("textarea",{id:p,className:"io-textarea",ref:d,name:n,tabIndex:0,placeholder:a,"aria-label":r,disabled:s,readOnly:c,rows:i,...u})]})});Tc.displayName="Textarea";const Na=v.forwardRef(({id:e,className:t,name:n="checkbox",align:o="left",label:r,checked:i,disabled:a,...s},c)=>{const u=Pa(),d=e||`checkbox-${u}`,f=Q("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsxs("div",{className:f,children:[l.jsx("input",{type:"checkbox",id:d,className:"io-checkbox",ref:c,name:n,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...s}),r&&l.jsx(Nc,{htmlFor:d,text:r,"data-testid":s["data-testid"]?`${s["data-testid"]}-label`:void 0})]})});Na.displayName="Checkbox";const Sk=v.forwardRef(({id:e,className:t,name:n="radio",align:o="left",label:r,checked:i,disabled:a,...s},c)=>{const u=Pa(),d=e||`radio-${u}`,f=Q("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsxs("div",{className:f,children:[l.jsx("input",{type:"radio",id:d,className:"io-radio",ref:c,name:n,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...s}),r&&l.jsx(Nc,{htmlFor:d,text:r})]})});Sk.displayName="Radio";const Ck=()=>{const e=v.useContext(Ie.IOConnectContext),[t,n]=v.useState(null),o=v.useCallback(r=>{var i;return(i=e==null?void 0:e.themes)==null?void 0:i.select(r)},[e]);return v.useEffect(()=>{var a,s;if(!e)return;let r=!1;const i=c=>{r||n(c)};return(a=e.themes)==null||a.onChanged(i),(s=e.themes)==null||s.getCurrent().then(i).catch(console.warn),()=>{r=!0}},[e]),{currentTheme:t,selectTheme:o}};function h0(e,t=500){const[n,o]=v.useState(e);return v.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>clearTimeout(r)},[e,t]),n}function Ve(){return v.useMemo(()=>typeof window=="object"&&Hr(),[])}function Ek(e,t){v.useEffect(()=>{const n=o=>{o.code===e&&t()};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},[e,t])}const jk=()=>{const e=v.useContext(Ie.IOConnectContext),[t,n]=v.useState([]);return v.useEffect(()=>{var o;e&&((o=e.themes)==null||o.list().then(n).catch(console.warn))},[e]),t},_t=v.forwardRef(({id:e,className:t,name:n="toggle",align:o="left",label:r,checked:i,disabled:a,onKeyDown:s,"data-testid":c="toggle",...u},d)=>{const f=Pa(),p=e||`toggle-${f}`,h=Q("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsx("div",{className:h,children:l.jsxs("label",{className:"io-toggle",htmlFor:p,tabIndex:a?-1:0,onKeyDown:s,"data-testid":`${c}-label`,children:[l.jsx("input",{type:"checkbox",id:p,className:"io-checkbox",ref:d,name:n,checked:i,disabled:a,"aria-checked":i,tabIndex:-1,"data-testid":c,...u}),l.jsx("span",{className:"slider","data-testid":`${c}-slider`}),r]})})});function es(e){return{name:e.name,title:e.title,hidden:e.isHidden,userProperties:e.customProperties}}function ts(e){return{name:e.name,title:e.title,hidden:e.hidden,userProperties:e.userProperties}}_t.displayName="Toggle";const Wo={getMyApplication:async function(e){var t,n;if(e)try{const o=e.apps;if(o){const i=(t=o.my)==null?void 0:t.appName;if(!i)return;const a=await o.registry.get({name:i});return a?es(a):void 0}const r=(n=e.appManager)==null?void 0:n.myApplication;return r?ts(r):void 0}catch(o){return void console.error("Failed to get my application",o)}},getApplications:async function(e){var t,n;if(!e)return[];try{const o=(t=e.apps)==null?void 0:t.registry;return o?(await o.getMany()??[]).map(a=>es(a)):(((n=e.appManager)==null?void 0:n.applications())??[]).map(i=>ts(i))}catch(o){console.error("Failed to get applications",o)}return[]},startApplication:async function(e,t,n){var o,r;if(e)try{const i=e.apps;if(i){await((o=i.registry)==null?void 0:o.get({name:t}))||console.error(`Application "${t}" not found in registry`);const s=i.instances;return s?void await s.start({name:t,...n}):void console.error("io.apps.instances API is not available")}const a=(r=e.appManager)==null?void 0:r.application(t);if(!a)return void console.error(`Application "${t}" not found`);await a.start(n)}catch(i){return void console.error(`Failed to start application "${t}"`,i)}},stopApplication:async function(e,t,n){if(e)try{const o=e.apps;if(o){const i=o.instances;return i?void await i.stop({id:t.id,force:n==null?void 0:n.force,reason:n==null?void 0:n.reason,timeout:n==null?void 0:n.timeout}):void console.error("io.apps.instances API is not available")}const r=e.appManager.instances().find(i=>i.id===t.id);if(!r)return void console.error(`Instance "${t.id}" not found`);await r.stop()}catch(o){return void console.error(`Failed to stop application instance "${t.id}"`,o)}},onAppAdded:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onAdded(({app:a})=>{const s=es(a);t(s)}):(o=e.appManager)==null?void 0:o.onAppAdded(a=>{const s=ts(a);t(s)})}catch(r){return void console.error("Failed to subscribe to app added events",r)}},onAppRemoved:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onRemoved(({appName:a})=>{t({name:a})}):(o=e.appManager)==null?void 0:o.onAppRemoved(a=>{t({name:a.name})})}catch(r){return void console.error("Failed to subscribe to app removed events",r)}},onAppChanged:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onUpdated(a=>{const s=es(a.app);t(s)}):(o=e.appManager)==null?void 0:o.onAppChanged(a=>{const s=ts(a);t(s)})}catch(r){return void console.error("Failed to subscribe to app changed events",r)}},restartPlatform:async function(e,t=!0){var o,r;if(!e)return;const n={autoSave:t,showDialog:!0};try{if((o=e.platform)!=null&&o.restart)return void await e.platform.restart(n);await((r=e.appManager)==null?void 0:r.restart(n))}catch(i){console.error("Failed to restart platform",i)}},shutdownPlatform:async function(e,t=!0){var o,r;if(!e)return;const n={autoSave:t,showDialog:!0};try{if((o=e.platform)!=null&&o.shutdown)return void await e.platform.shutdown(n);await((r=e.appManager)==null?void 0:r.exit(n))}catch(i){console.error("Failed to shutdown platform",i)}}},_k={minimizeWindow:async function(e){var t;if(e)try{const n=(t=e.windows)==null?void 0:t.my();await(n==null?void 0:n.minimize())}catch(n){console.error("Failed to minimize window",n)}},closeWindow:async function(e,t){var n;if(e)try{const o=(n=e.windows)==null?void 0:n.my();await(o==null?void 0:o.close(t))}catch(o){console.error("Failed to close window",o)}},restartPlatform:Wo.restartPlatform,shutdownPlatform:Wo.shutdownPlatform};v.createContext({theme:"dark"});const m0=v.createContext(void 0),lh=()=>{const e=v.useContext(m0);if(!e)throw new Error("usePanelManagerContext must be used within a PanelManagerContext.Provider");return e},g0=e=>{const{General:t,Launchpad:n,Docking:o,ExtendedArea:r,Layouts:i,Downloads:a,System:s}=yo(),c=[[{key:"general",Component:t}],[{key:"launchpad",Component:n},{key:"docking",Component:o},{key:"extended-area",Component:r}],[{key:"layouts",Component:i}],[{key:"downloads",Component:a}],[{key:"system",Component:s}]];return l.jsx(sr,{element:xi,elementProps:e,children:c.map((u,d)=>l.jsxs(v.Fragment,{children:[u.map(({key:f,Component:p})=>l.jsx(p,{},f)),d<c.length-1&&l.jsx(wo,{})]},u[0].key))})},y0=({title:e="General",...t})=>{const{Theme:n}=yo();return l.jsx(et,{title:e,...t,children:l.jsx(n,{})})},Ic=({className:e,title:t="Theme",...n})=>{const{currentTheme:o,selectTheme:r}=Ck(),i=jk();return l.jsxs("div",{className:Q("flex jc-between ai-center",e),"data-testid":"theme-container",...n,children:[l.jsx("label",{className:"io-text-clipper","data-testid":"theme-label",children:t}),l.jsxs(fe,{variant:"light","data-testid":"theme-dropdown",children:[l.jsx(fe.Button,{text:(o==null?void 0:o.displayName)??"Dark","data-testid":"theme-dropdown-button"}),l.jsx(fe.Content,{"data-testid":"theme-dropdown-content",children:l.jsx(fe.List,{children:i.map(({displayName:a,name:s})=>l.jsx(fe.Item,{onClick:()=>r(s),"data-testid":`theme-dropdown-item-${s}`,children:a},s))})})]})]})},Zt=({prefKey:e,...t})=>{const{isLoading:n,value:o=!1,update:r}=Mt({prefKey:e});return l.jsx(_t,{checked:o,disabled:n,onChange:i=>r(i.target.checked),...t})},v0=({align:e="right",label:t="Minimize to tray",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:Qg,...n}),Ok=({prefKey:e,options:t,disabled:n,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Mt({prefKey:e});return l.jsxs(fe,{variant:"light",disabled:r||n,...o,children:[l.jsx(fe.Button,{children:i}),l.jsx(fe.Content,{children:l.jsx(fe.List,{children:t.map(s=>l.jsx(fe.Item,{onClick:()=>(async c=>{if(c!==i)try{await a(c)}catch(u){console.error("Failed to update platform preference:",u)}})(s),children:s},s))})})]})},w0=({className:e,label:t="Pinned position",...n})=>l.jsx(et,{className:Q("io-block-list-gap",e),...n,children:l.jsxs("div",{className:"flex jc-between ai-center",children:[l.jsx("label",{className:"io-text-clipper",children:t}),l.jsx(Ok,{className:e,prefKey:ty,options:["Left","Right"],...n})]})}),b0=({align:e="right",label:t='Hide "Favorites"',...n})=>l.jsx(Zt,{align:e,label:t,prefKey:Id,...n}),x0=({align:e="right",label:t="Allow docking to top",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:ny,...n}),k0=({align:e="right",label:t="Always on top",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:oy,...n}),S0=({align:e="right",label:t="Claim occupied space",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:ry,...n}),C0=({align:e="right",label:t="Show the extended Launchpad area",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:Aa,...n}),E0=({align:e="right",label:t="Hide labels",...n})=>{const{value:o}=Mt({prefKey:Aa});return l.jsx(Zt,{align:e,label:t,prefKey:iy,disabled:!o,...n})},j0=({align:e="right",label:t='Show "Favorites"',...n})=>{const{value:o}=Mt({prefKey:Aa});return l.jsx(Zt,{align:e,label:t,prefKey:ay,disabled:!o,...n})},_0=({align:e="right",label:t='Show "Recent"',...n})=>{const{value:o}=Mt({prefKey:Aa});return l.jsx(Zt,{align:e,label:t,prefKey:sy,disabled:!o,...n})},O0=({title:e="Layouts",...t})=>{const{LayoutsSaveCurrentOnExit:n,LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=yo();return l.jsxs(et,{title:e,...t,children:[l.jsx(n,{}),l.jsx(r,{}),l.jsx(o,{})]})},A0=({align:e="right",label:t="Save current on exit",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:ly,...n}),Rc=({align:e="right",label:t="Show prompt for unsaved changes",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:uy,"data-testid":"layouts-show-unsaved-changes-prompt-toggle-button",...n}),Lc=({align:e="right",label:t="Show prompt for deleting",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:Rd,"data-testid":"layouts-show-delete-prompt-toggle",...n}),P0=({title:e="Downloads",...t})=>{const{DownloadsLocation:n}=yo();return l.jsx(et,{title:e,...t,children:l.jsx(n,{})})};function N0({title:e="Downloads"}){const{ItemSearch:t,HeaderButtons:n}=Ta();return l.jsxs("div",{className:"io-dm-header",children:[l.jsxs(cn,{draggable:!0,children:[l.jsx(cn.Title,{tag:"h1",text:e,size:"large"}),l.jsx(n,{className:"non-draggable"})]}),l.jsx(t,{})]})}const rn=window.glue42gd,T0=v.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),bo=()=>v.useContext(T0);function I0({className:e,placeholder:t="Search",iconPrepend:n="search",iconAppend:o="close",...r}){const i=Q("io-header-search",e),a=v.useRef(null),{searchQuery:s,setSearch:c,itemsCount:u}=bo(),d=s.length>0,f=v.useCallback(()=>{c(""),a.current&&a.current.focus()},[c]);return l.jsxs("div",{className:i,children:[l.jsx(nr,{ref:a,value:s,iconPrepend:n,iconAppend:d?o:void 0,iconAppendOnClick:d?f:void 0,placeholder:t,onChange:p=>c(p.target.value),...r}),d&&l.jsx("p",{className:"io-header-search-count",children:`${u} results`})]})}function R0({className:e,...t}){const{MoreButton:n,CloseButton:o,ExternalButton:r}=Ta();return l.jsxs(Be,{className:e,align:"right",...t,children:[l.jsx(n,{}),l.jsx(r,{}),l.jsx(o,{})]})}function L0({icon:e="ellipsis-vertical",...t}){const{items:n,clearItems:o,showSettings:r}=bo(),i=n.length===0;return l.jsxs(fe,{variant:"light",...t,children:[l.jsx(fe.ButtonIcon,{icon:e,variant:"circle",size:"32"}),l.jsx(fe.Content,{children:l.jsxs(fe.List,{children:[l.jsx(fe.Item,{onClick:a=>(s=>{i?s.stopPropagation():o()})(a),disabled:i,children:"Clear All"}),l.jsx(fe.Item,{onClick:r,children:"Settings"})]})})]})}function D0({className:e,icon:t="pop-out",...n}){const o=v.useContext(Ie.IOConnectContext),r=v.useCallback(()=>{Wo.startApplication(o,"io-connect-download-manager").catch(i=>{console.error("Failed to open Download Manager",i)})},[o]);return l.jsx(Ue,{className:Q("io-dm-compact-mode-only",e),icon:t,variant:"circle",size:"32",onClick:r,...n})}function M0({icon:e="close",size:t="32",variant:n="circle",onClick:o,...r}){const i=v.useContext(Ie.IOConnectContext);return l.jsx(Ue,{icon:e,size:t,variant:n,onClick:a=>{o?o(a):_k.closeWindow(i).catch(s=>{console.error("Failed to close window:",s)})},...r})}function Vr(e,t=!1,n=!1,o=!1){const r=e.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],a=e.getFullYear(),s=e.getHours(),c=e.getMinutes();let u="";return u=c<10?`0${c}`:`${c}`,t?t==="Today"?n?"Today":`Today at ${s}:${u}`:t==="Yesterday"?n?"Yesterday":`Yesterday at ${s}:${u}`:`${s}:${u}`:o?n?`${i} ${r}`:`${i} ${r} at ${s}:${u}`:n?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${s}:${u}`}function $0(e,t={showTime:!0}){const n=new Date(1e3*e),o=new Date,r=Math.round((o-n)/1e3),i=Math.round(r/60),a=o.toDateString()===n.toDateString(),s=new Date(o.setDate(o.getDate()-1)).toDateString()===n.toDateString(),c=o.getFullYear()===n.getFullYear();return t.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?Vr(n,"Today",!1,!0):s?Vr(n,"Yesterday",!1,!0):c?Vr(n,!1,!1,!0):Vr(n):a?"Today":s?"Yesterday":c?Vr(n,!1,!0,!0):Vr(n,!1,!0)}function H0({className:e,...t}){const n=Q("io-dm-body","io-panel-body",e),{DownloadListEmpty:o,ItemGroup:r,Item:i}=Ta(),{items:a,searchQuery:s,setCount:c,sortItems:u}=bo(),d=u(a),f=h0(s),p=v.useMemo(()=>d.filter(g=>g.displayInfo.filename.toLowerCase().includes(f.toLowerCase())||g.displayInfo.url.toLowerCase().includes(f.toLowerCase())),[d,f]),h=v.useMemo(()=>p.map(g=>({...g,displayInfo:{...g.displayInfo,startTime:$0(g.displayInfo.startTime,{showTime:!1})}})),[p]),m=v.useMemo(()=>Object.values(h.reduce((g={},y)=>{var b;return g[y.displayInfo.startTime]=((b=g[y.displayInfo.startTime])==null?void 0:b.concat([]))??[],g[y.displayInfo.startTime].push(y),g},{})),[h]);return v.useEffect(()=>{c(p.length)},[p,c]),l.jsx(sr,{elementProps:{className:n,...t},children:m&&m.length!==0?m.map(g=>l.jsx(r,{title:String(g[0].displayInfo.startTime)??null,children:g.map(y=>l.jsx(i,{item:y},y.id))},g[0].id??"")):l.jsx(o,{})})}function B0({className:e,icon:t="download",text:n="No downloads to display.",...o}){const r=Q("io-dm-no-items",e);return l.jsxs("div",{className:r,...o,children:[l.jsx(jt,{variant:t}),l.jsx("p",{children:n})]})}function z0({className:e,title:t,children:n,...o}){const r=Q("io-dm-item-group",e);return l.jsxs("div",{className:r,...o,children:[t&&l.jsx("p",{className:"io-dm-items-group-title",children:t}),n]})}function F0({className:e,item:t,...n}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=Ta(),{state:a,url:s,filename:c,receivedBytes:u,totalBytes:d,speed:f,timeRemaining:p}=t.displayInfo;if(!t)return l.jsx(l.Fragment,{});const h=Q("io-dm-item",t.displayInfo.state&&[a],e);return l.jsxs("div",{className:h,...n,children:[l.jsx(o,{itemID:t.id,filename:c,state:a}),l.jsx(r,{state:a,url:s,bytesReceived:u,bytesTotal:d,speed:f,timeRemaining:p}),l.jsx(i,{itemID:t.id,state:a})]})}function ef({bytesReceived:e=0,bytesTotal:t=0,...n}){const o=v.useCallback(()=>e&&t?Math.round(e/t*100):0,[e,t]);return l.jsx(B2,{value:o(),...n})}function W0({className:e,itemID:t,filename:n,state:o,pauseResume:r,showInFolder:i,cancel:a,remove:s,...c}){const u=Q("io-dm-item-header",e),{pauseResumeItem:d,showItemInFolder:f,cancelItem:p,removeItem:h}=bo(),m=o==="progressing"||o==="paused",g=o==="interrupted"||o==="cancelled",y=m?"Cancel Download":"Remove Download",b=a??p,k=s??h,x=function(w,C,O,_){return w==="paused"||w==="progressing"?{statusIcon:w==="paused"?"play":"pause",onStatusActionClick:()=>O(C)}:w==="completed"?{statusIcon:"folder",onStatusActionClick:()=>_(C)}:null}(o,t,r??d,i??f),S=v.useCallback(()=>{m?b(t):k(t)},[m,b,t,k]);return l.jsxs("div",{className:u,...c,children:[l.jsx(Xn,{text:n,style:{textDecoration:g?"line-through":"none"}}),l.jsxs(Be,{children:[x&&l.jsx(Ue,{icon:x.statusIcon,iconSize:"12",onClick:x.onStatusActionClick,className:"io-dm-compact-mode-only"}),l.jsx(Ue,{icon:"close",iconSize:"12",title:y,onClick:S})]})]})}function U0({className:e,state:t,url:n,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...s}){const c=Q("io-dm-item-body",e),u=p=>{const h=["Bytes","KB","MB","GB","TB"];if(p===0)return"0";const m=Math.floor(Math.log(p)/Math.log(1024));return m===0?`${p}${h[m]}`:`${(p/1024**m).toFixed(1)}${h[m]}`};return l.jsxs("div",{className:c,...s,children:[l.jsx("p",{className:"io-text-small",children:n}),(f=t,f==="cancelled"||f==="interrupted"||f==="completed"?null:l.jsx(ef,{variant:f==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),l.jsx("p",{className:"io-text-default-lh16",children:t==="completed"?`${u(o??0)} - Done`:t==="cancelled"||t==="interrupted"?`${u(o??0)}/${u(r??0)} - Failed`:`${u(o??0)}/${u(r??0)} (${d=i,(d?`${(d/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(p=>{const h=Math.floor(p/3600),m=Math.floor(p%3600/60);let g="";return h>0&&(g+=`${h} hour${h>1?"s":""}, `),m>0&&(g+=`${m} min${m>1?"s":""}, `),((p=Math.floor(p%60))>0||g==="")&&(g+=`${p} sec${p===1?"":"s"}`),`${g.trim()} left`})(a)??0}`})]});var d,f}const Ak={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function ml({className:e,variant:t,text:n}){const o=Q("io-dm-item-status",`io-dm-item-status-${t}`,e);return l.jsxs("div",{className:o,children:[t&&l.jsx(jt,{variant:Ak[t],className:"icon-severity",size:"10"}),n&&l.jsx("p",{className:"io-text-smaller",children:n})]})}function V0({className:e,itemID:t,state:n,pauseResume:o,showInFolder:r,cancel:i,...a}){const s=Q("io-dm-item-footer",e),{pauseResumeItem:c,showItemInFolder:u,cancelItem:d}=bo(),f=v.useCallback(m=>{o?o(m):c(m)},[o,c]),p=v.useCallback(m=>{r?r(m):u(m)},[r,u]),h=v.useCallback(m=>{i?i(m):d(m)},[i,d]);return l.jsx("div",{className:s,...a,children:(()=>{switch(n){case"progressing":return l.jsxs(Be,{align:"right",children:[l.jsx(Be.Button,{variant:"primary",text:"Pause",onClick:()=>f(t)}),l.jsx(Be.Button,{variant:"link",text:"Cancel",onClick:()=>h(t)})]});case"paused":return l.jsx(Be,{align:"right",children:l.jsx(Be.Button,{variant:"primary",text:"Resume",onClick:()=>f(t)})});case"completed":return l.jsxs(l.Fragment,{children:[l.jsx(ml,{variant:"success",text:"Complete"}),l.jsx(Be,{align:"right",children:l.jsx(Be.Button,{variant:"primary",text:"Show in Folder",onClick:()=>p(t)})})]});case"cancelled":return l.jsx(ml,{variant:"warning",text:"Cancelled"});case"interrupted":return l.jsxs(l.Fragment,{children:[l.jsx(ml,{variant:"critical",text:"Failed"}),l.jsx(Be,{align:"right",children:l.jsx(Be.Button,{variant:"primary",text:"Retry",onClick:()=>f(t)})})]});default:return null}})()})}function K0({className:e,title:t="Download Settings",...n}){const o=Q("io-dm-settings-panel",e),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:s,isDownloadLocationDialogVisible:c,downloadLocationList:u}=bo();return l.jsxs(ot,{className:o,...n,children:[l.jsxs(ot.Header,{children:[l.jsx(ot.Header.Title,{size:"large",text:t,tag:"h1"}),l.jsx(ot.Header.ButtonGroup,{children:l.jsx(Ue,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:c})})]}),l.jsx(ot.Body,{children:l.jsxs(Be,{children:[l.jsxs(fe,{variant:"light",disabled:c,children:[l.jsx(fe.Button,{children:l.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??u[0]})}),u.length>1&&l.jsx(fe.Content,{children:l.jsx(fe.List,{children:u.map((d,f)=>!d||f===0||f>3?null:l.jsx(fe.Item,{onClick:()=>{a(d)},children:d},d))})})]}),l.jsx(tt,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{s()},disabled:c})]})})]})}const G0={Header:N0,ItemSearch:I0,HeaderButtons:R0,MoreButton:L0,ExternalButton:D0,CloseButton:M0,Body:H0,DownloadListEmpty:B0,ItemGroup:z0,Item:F0,ItemProgress:ef,ItemHeader:W0,ItemBody:U0,ItemFooter:V0,Settings:K0},q0=v.createContext(G0),J0=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...G0,...t}),[t]);return l.jsx(q0.Provider,{value:n,children:e})});J0.displayName="ComponentsStore";const Ta=()=>v.useContext(q0);function Pk({className:e,...t}){const n=Q("io-dm",e),{Header:o,Body:r,Settings:i}=Ta(),{isSettingsVisible:a}=bo();return l.jsxs(ot,{className:n,...t,children:[l.jsx(o,{}),l.jsx(r,{}),a&&l.jsx(i,{})]})}var Nk=Object.freeze({__proto__:null,Body:H0,CloseButton:M0,DownloadListEmpty:B0,DownloadManager:function({components:e,...t}){return l.jsx(J0,{components:e,children:l.jsx(Pk,{...t})})},DownloadManagerProvider:({children:e})=>{const{configuration:t,items:n,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:s,isSettingsVisible:c,showSettings:u,hideSettings:d,searchQuery:f,setSearch:p,itemsCount:h,setCount:m,setDownloadLocation:g,setDownloadLocationWithDialog:y,sortItems:b,isDownloadLocationDialogVisible:k,downloadLocationList:x}=function(){const[w,C]=v.useState({}),[O,_]=v.useState([]),[N,E]=v.useState(0),[A,j]=v.useState([]),[B,$]=v.useState(""),[R,F]=v.useState(!1),[z,V]=v.useState(!1),[L,H]=v.useState({filePaths:[],canceled:!1});v.useEffect(()=>{if(!rn)return;const U=rn.downloads.onUpdate(D=>_(T=>W(T,D))),Y=rn.downloads.onConfigurationChanged(D=>{C(D)});return rn.downloads.list().then(_).catch(console.error),rn.downloads.getSavePathList().then(D=>{let T=null;const P=D==null?void 0:D.pathList;Array.isArray(D)?T=D.filter(I=>typeof I=="string"):Array.isArray(P)&&(T=P.filter(I=>typeof I=="string")),T!==null&&j(T)}).catch(console.error),()=>{U(),Y()}},[]),v.useEffect(()=>{V(!1)},[L]);const W=(U,Y)=>{const D=U.findIndex(P=>P.id===Y.id);if(D===-1)return[Y,...U];const T=[...U];return T[D]=Y,T};return{items:O,setCount:U=>{E(U)},sortItems:(U,Y=!0)=>[...U].sort((D,T)=>{const P=D.displayInfo.startTime-T.displayInfo.startTime;return Y?-P:P}),setSearch:U=>{$(U)},cancelItem:async U=>{try{await rn.downloads.cancel(U)}catch(Y){console.error(Y)}},removeItem:async U=>{try{_(Y=>Y.filter(D=>D.id!==U)),await rn.downloads.removeItem(U)}catch(Y){console.error(Y)}},clearItems:async()=>{try{_([]),await rn.downloads.clearDownloadList()}catch(U){console.error(U)}},itemsCount:N,searchQuery:B,showSettings:()=>{F(!0)},hideSettings:()=>{F(!1)},configuration:w,isSettingsVisible:R,pauseResumeItem:async U=>{try{await rn.downloads.pauseResume(U)}catch(Y){console.error(Y)}},showItemInFolder:async U=>{try{await rn.downloads.showInFolder(U)}catch(Y){console.error(Y)}},setDownloadLocation:async U=>{try{await rn.downloads.setSavePath(U),j(Y=>{if(Y.includes(U)){const D=Y.filter(T=>T!==U);return[U,...D]}return[U,...Y]})}catch(Y){console.error(Y)}},downloadLocationList:A,isDownloadLocationDialogVisible:z,setDownloadLocationWithDialog:async()=>{V(!0);try{const U=await rn.downloads.showOpenDialog();if(H(U),!(U!=null&&U.filePaths)||U.filePaths.length===0)return;await rn.downloads.setSavePath(U.filePaths[0]),j(Y=>{if(Y.includes(U.filePaths[0])){const D=Y.filter(T=>T!==U.filePaths[0]);return[U.filePaths[0],...D]}return[U.filePaths[0],...Y]})}catch(U){console.error(U)}}}}(),S=v.useMemo(()=>({configuration:t,items:n,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:s,isSettingsVisible:c,showSettings:u,hideSettings:d,searchQuery:f,setSearch:p,itemsCount:h,setCount:m,setDownloadLocation:g,setDownloadLocationWithDialog:y,sortItems:b,isDownloadLocationDialogVisible:k,downloadLocationList:x}),[t,n,o,r,i,s,a,c,u,d,f,p,h,m,g,y,b,k,x]);return l.jsx(T0.Provider,{value:S,children:e})},ExternalButton:D0,Header:N0,HeaderButtons:R0,Item:F0,ItemBody:U0,ItemFooter:V0,ItemGroup:z0,ItemHeader:W0,ItemProgress:ef,ItemSearch:I0,MoreButton:L0,Settings:K0,useDownloadManagerContext:bo});const Z0=({className:e,label:t="Location",...n})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=bo();return l.jsxs(et,{className:Q("io-preferences-download-section",e),...n,children:[l.jsxs("div",{className:"flex jc-between ai-center",children:[l.jsx("label",{className:"io-text-clipper",children:t}),l.jsx(tt,{text:"Change",onClick:r,disabled:i})]}),l.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},Y0=({align:e="right",label:t="Ask where to save each file before downloading",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:dy,...n}),X0=({title:e="System",...t})=>{const{SystemRestartSection:n,SystemShutdownSection:o}=yo();return l.jsxs(et,{title:e,...t,children:[l.jsx(n,{}),l.jsx(o,{})]})},uh="T42.GD.Execute",Q0=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ev=(e,t)=>e in t;function Tk({time:e,frequency:t,day:n}){const[o,r]=e.split(":"),i=Number.parseInt(o,10),a=Number.parseInt(r,10);let s="*";return t==="weekly"&&n&&(s=function(c){const u={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!ev(c,u))throw new Error(`Invalid day: ${c}`);return u[c]}(n).toString()),`${a} ${i} * * ${s}`}function Ik(e){const t=v.useContext(Ie.IOConnectContext),{value:n,update:o}=Mt({prefKey:ns(e)}),{value:r,update:i}=Mt({prefKey:ns(e,"Time")}),{value:a,update:s}=Mt({prefKey:ns(e,"Frequency")}),{value:c,update:u}=Mt({prefKey:ns(e,"Day")}),d=v.useCallback(async()=>{try{await t.interop.invoke(uh,{command:`cancel-${e}`})}catch(p){console.error(p)}},[t,e]),f=v.useCallback(async()=>{try{const p=Tk({time:r??"12:00",frequency:a??"daily",day:a==="weekly"?c:"*"});await t.interop.invoke(uh,{command:`schedule-${e}`,args:{cronTime:p,discardUnsavedLayoutChanges:!1}})}catch(p){console.error(`Failed to update cron job for ${e}:`,p)}},[t,e,r,a,c]);return v.useEffect(()=>{t&&n&&f()},[t,n,r,a,c,f]),{enabled:n??!1,time:r??"12:00",frequency:a??"daily",day:c??"Monday",setEnabled:async p=>{p||await d();try{await o(p)}catch(h){console.error("Failed to update enabled state:",h)}},setTime:async p=>{try{await i(p)}catch(h){console.error("Failed to update time:",h)}},setFrequency:async p=>{try{await s(p),p==="daily"&&await u(void 0)}catch(h){console.error("Failed to update frequency:",h)}},setDay:async p=>{var h;if(h=p,Q0.includes(h))try{await u(p)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function ns(e,t){const n=e==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return t?`${n}${t}`:n}function tv({className:e,variant:t,...n}){const o=Q("io-block-list-gap",t,e),{enabled:r,time:i,frequency:a,day:s,setEnabled:c,setTime:u,setFrequency:d,setDay:f}=Ik(t);return l.jsxs(et,{className:o,...n,children:[l.jsx(_t,{label:`Schedule ${t}`,align:"right",onChange:p=>c(p.target.checked),checked:r}),l.jsxs("div",{className:"scheduler-controls",children:[l.jsx("div",{className:"io-control-input io-control-leading-icon direction-up",children:l.jsx("input",{type:"time",className:"io-input",value:i,onChange:p=>u(p.target.value)})}),l.jsxs(In,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[l.jsx(In.Item,{onClick:()=>d("daily"),children:"Daily"}),l.jsx(In.Item,{onClick:()=>d("weekly"),children:"Weekly"})]}),a==="weekly"&&l.jsx(In,{text:s,icon:"chevron-down",iconRight:!0,children:Q0.map(p=>l.jsx(In.Item,{onClick:()=>f(p),children:p},p))})]})]})}function nv({className:e,...t}){return l.jsx(tv,{...t,className:e,variant:"restart"})}function ov({className:e,...t}){return l.jsx(tv,{...t,className:e,variant:"shutdown"})}const rv={Body:g0,General:y0,Theme:Ic,Launchpad:({title:e="Launchpad",...t})=>{const{MinimizeToTray:n,PinnedPosition:o,HideFavoritesFromLaunchpad:r}=yo();return l.jsxs(et,{title:e,...t,children:[l.jsx(n,{}),l.jsx(o,{}),l.jsx(r,{})]})},MinimizeToTray:v0,PinnedPosition:w0,HideFavoritesFromLaunchpad:b0,Docking:({className:e,title:t="Docking",...n})=>{const o=Q("io-preferences-panel-docking",e),{AllowDocking:r,DockedAlwaysOnTop:i,DockedClaimsSpace:a}=yo();return l.jsxs(et,{className:o,title:t,...n,children:[l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{})]})},AllowDocking:x0,DockedAlwaysOnTop:k0,DockedClaimsSpace:S0,ExtendedArea:({className:e,title:t="Extended Area",...n})=>{const o=Q("io-preferences-panel-extended-area",e),{ShowExtendedArea:r,HideLabelsInExtendedArea:i,ShowFavoritesInExtendedArea:a,ShowRecentAppsInExtendedArea:s}=yo();return l.jsxs(et,{className:o,title:t,...n,children:[l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{}),l.jsx(s,{})]})},ShowExtendedArea:C0,HideLabelsInExtendedArea:E0,ShowFavoritesInExtendedArea:j0,ShowRecentAppsInExtendedArea:_0,Layouts:O0,LayoutsSaveCurrentOnExit:A0,LayoutsShowUnsavedChangesPrompt:Rc,LayoutsShowDeletePrompt:Lc,Downloads:P0,DownloadsLocation:Z0,DownloadsAskForEachDownload:Y0,System:X0,SystemRestartSection:nv,SystemShutdownSection:ov},iv=v.createContext(rv),av=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...rv,...t}),[t]);return l.jsx(iv.Provider,{value:n,children:e})});av.displayName="PreferencesPanelComponentsStoreProvider";const yo=()=>v.useContext(iv),sv=({className:e,onClose:t,title:n="Platform Preferences",children:o,...r})=>l.jsxs(ot,{className:Q("io-preferences-panel",e),"data-testid":"preferences-panel",...r,children:[l.jsxs(ot.Header,{"data-testid":"preferences-panel-header",children:[l.jsx(ot.Header.Title,{size:"large",text:n,tag:"h1","data-testid":"preferences-panel-title"}),l.jsx(ot.Header.ButtonGroup,{children:l.jsx(ot.Header.ButtonIcon,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:t,"data-testid":"preferences-panel-close-button"})})]}),o]}),Rk=({onClose:e,title:t="Platform Preferences",...n})=>{const{Body:o}=yo();return l.jsx(sv,{title:t,onClose:e,...n,children:l.jsx(o,{})})},cv=({components:e,...t})=>l.jsx(av,{components:e,children:l.jsx(Rk,{...t})});function Du(e){if(e&&e.errorHandling&&typeof e.errorHandling!="function"&&e.errorHandling!=="log"&&e.errorHandling!=="silent"&&e.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof e.errorHandling+" was passed");var t=e&&typeof e.errorHandling=="function"&&e.errorHandling,n={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(t)t(a);else{var s='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(e)switch(e.errorHandling){case"log":return console.error(s);case"silent":return;case"throw":throw new Error(s)}console.error(s)}}return{add:function(r,i,a){var s=n[r];return s||(s=[],n[r]=s),s.push(i),a&&setTimeout(function(){a.forEach(function(c){var u;if(!((u=n[r])===null||u===void 0)&&u.includes(i))try{Array.isArray(c)?i.apply(void 0,c):i.apply(void 0,[c])}catch(d){o(d,r)}})},0),function(){var c=n[r];c&&(c=c.reduce(function(u,d,f){return d===i&&u.length===f||u.push(d),u},[]),c.length===0?delete n[r]:n[r]=c)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var s=n[r];if(!s||s.length===0)return[];var c=[];return s.forEach(function(u){try{var d=u.apply(void 0,i);c.push(d)}catch(f){c.push(void 0),o(f,r)}}),c},clear:function(){n={}},clearKey:function(r){n[r]&&delete n[r]}}}Du.default=Du;var Lk=Ea(Du),mt=new class{constructor(){En(this,"subscribed",!1);En(this,"io");En(this,"registry",Lk());En(this,"logger");En(this,"isPanelVisible");En(this,"notifications",[]);En(this,"bulkActionsSupported",!1);En(this,"initPromise")}init(e){return this.initPromise!==void 0||(this.initPromise=(async()=>{var t;if(!this.subscribed){this.subscribed=!0,this.io=e,this.logger=this.io.logger.subLogger("notifications");try{await this.initializeLogger()}catch(n){console.error("Failed to initialize logger with app configuration",n)}this.getBulkActionsSupport();try{await this.subscribe()}catch(n){throw(t=this.logger)==null||t.error("Error during subscription:",n),n}}})()),this.initPromise}async initializeLogger(){var o,r,i,a,s,c;const e=await Wo.getMyApplication(this.io),t=((r=(o=e==null?void 0:e.userProperties)==null?void 0:o.logger)==null?void 0:r.publishLevel)??"error",n=((a=(i=e==null?void 0:e.userProperties)==null?void 0:i.logger)==null?void 0:a.consoleLevel)??"info";(s=this.logger)==null||s.publishLevel(t),(c=this.logger)==null||c.consoleLevel(n)}onPanelVisibilityChanged(e){return this.registry.add("on-panel-visibility-changed",e)}onConfigurationChanged(e){return this.registry.add("on-configuration-changed",e)}onNotificationsChanged(e){return this.registry.add("on-notifications-changed",e)}onCounterChanged(e){return this.registry.add("on-counter-changed",e)}async getNotificationsList(){var t;const e=await((t=this.io)==null?void 0:t.notifications.list());if(!e)throw new Error("io.notifications.list is not supported in this environment.");return e.map(n=>this.attachHandlers(n))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){var e;if(this.isDesktopEnvironment())return(e=this.io)==null?void 0:e.notifications.panel.show()}hidePanel(){var e;if(this.isDesktopEnvironment())return(e=this.io)==null?void 0:e.notifications.panel.hide()}clearAll(){var e,t;return(e=this.logger)==null||e.trace("clearing all notifications"),(t=this.io)==null?void 0:t.notifications.clearAll()}clearAllOld(){var e,t;return(e=this.logger)==null||e.trace("clearing all old notifications"),(t=this.io)==null?void 0:t.notifications.clearOld()}clearMany(e){var n,o,r,i;const t=(n=this.io)==null?void 0:n.notifications;return this.isBulkActionSupported("clearMany")?e.length<1?((o=this.logger)==null||o.trace("no ids provided to clear notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`clearing notifications with ids ${JSON.stringify(e.join(", "))}`),((i=t.clearMany)==null?void 0:i.call(t,e))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(e){var t,n;return(t=this.logger)==null||t.trace(`closing notification with id ${e}`),(n=this.io)==null?void 0:n.notifications.clear(e)}snooze(e,t){var n,o;return(n=this.logger)==null||n.trace(`snoozing notification with id ${e} for ${t}ms`),(o=this.io)==null?void 0:o.notifications.snooze(e,t)}snoozeMany(e,t){var o,r,i,a;const n=(o=this.io)==null?void 0:o.notifications;return this.isBulkActionSupported("snoozeMany")?e.length<1?((r=this.logger)==null||r.trace("no ids provided to snooze notifications"),Promise.resolve()):((i=this.logger)==null||i.trace(`snoozing notifications with ids ${JSON.stringify(e.join(", "))} for ${t}ms`),((a=n.snoozeMany)==null?void 0:a.call(n,e,t))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(e,t){var n,o;return(n=this.logger)==null||n.trace(`setting state of ${e} to ${t}`),(o=this.io)==null?void 0:o.notifications.setState(e,t)}setStates(e,t){var o,r,i,a;const n=(o=this.io)==null?void 0:o.notifications;return this.isBulkActionSupported("setStates")?e.length<1?((r=this.logger)==null||r.trace(`no ids provided to change state to ${t} for notifications`),Promise.resolve()):((i=this.logger)==null||i.trace(`setting state of ${JSON.stringify(e.join(", "))} to ${t}`),((a=n.setStates)==null?void 0:a.call(n,e,t))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){this.bulkActionsSupported=this.isBulkActionSupported("clearMany")&&this.isBulkActionSupported("setStates")&&this.isBulkActionSupported("snoozeMany")}setFilter(e){var t,n;return(t=this.logger)==null||t.trace(`setting filter to ${JSON.stringify(e)}`),(n=this.io)==null?void 0:n.notifications.setFilter(e)}configure(e){var t;return(t=this.io)==null?void 0:t.notifications.configure(e)}async resyncNotifications(){var e,t;try{const n=await this.getNotificationsList();this.notifications=n,this.registry.execute("on-notifications-changed",[...this.notifications]),(e=this.logger)==null||e.trace(`resynced notifications array with ${this.notifications.length} notifications`)}catch(n){(t=this.logger)==null||t.error("Error resyncing notifications list:",n)}}async subscribe(){var t,n,o,r,i,a,s,c,u;(t=this.io)==null||t.notifications.onRaised(d=>{var f;(f=this.logger)==null||f.trace(`received event indicating notification raise: ${JSON.stringify(d)}`),this.attachHandlers(d),this.notifications.unshift(d),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:d},f)=>{var p;(p=this.logger)==null||p.trace(`received event for notification state is changed - "${d}" - "${f==null?void 0:f.toString()}"`),this.notifications=this.notifications.map(h=>{var m;return h.id===d?((m=this.logger)==null||m.trace(`${h.id} - the state is changed from "${h.state}" to "${f==null?void 0:f.toString()}"`),{...h,state:f}):h}),this.registry.execute("on-notifications-changed",this.notifications)});const e=(o=this.io)==null?void 0:o.notifications;e!=null&&e.onDataChanged&&e.onDataChanged((d,f)=>{var h;const p=d.id;(h=this.logger)==null||h.trace(`received event for notification data is changed - "${p}" - "${JSON.stringify(f)}"`),this.notifications=this.notifications.map(m=>{var g;return m.id===p?((g=this.logger)==null||g.trace(`${m.id} - the data is changed from "${JSON.stringify(m.data)}" to "${JSON.stringify(f)}"`),{...m,data:f}):m}),this.registry.execute("on-notifications-changed",this.notifications)}),(r=this.io)==null||r.notifications.onClosed(({id:d})=>{var f;(f=this.logger)==null||f.trace(`received event for notification is closed - "${d}".`),this.notifications=this.notifications.filter(p=>p.id!==d),this.registry.execute("on-notifications-changed",this.notifications)});try{const d=await this.getNotificationsList(),f=new Set(d.map(h=>h.id)),p=this.notifications.filter(h=>!f.has(h.id));this.notifications=[...p,...d],(i=this.logger)==null||i.trace(`initialized with ${d.length} fetched + ${p.length} from events = ${this.notifications.length} total`)}catch(d){(a=this.logger)==null||a.error("Error fetching initial notifications list:",d),(s=this.logger)==null||s.trace(`continuing with ${this.notifications.length} notifications from events`)}(c=this.io)==null||c.notifications.onConfigurationChanged(d=>{var f;(f=this.logger)==null||f.trace(`received event for configuration changed - ${JSON.stringify(d)}.`),this.registry.execute("on-configuration-changed",d)}),this.isDesktopEnvironment()&&((u=this.io)==null||u.notifications.panel.onVisibilityChanged(d=>{var f;(f=this.logger)==null||f.trace(`received event for panel visibility changed to "${d}".`),this.isPanelVisible=d,d&&this.resyncNotifications().catch(p=>{var h;(h=this.logger)==null||h.error("Error resyncing notifications on panel visibility:",p)}),this.registry.execute("on-panel-visibility-changed",d)}))}isDesktopEnvironment(){return typeof globalThis.window=="object"&&(!!globalThis.window.iodesktop||!!globalThis.window.glue42gd)}isBulkActionSupported(e){var n;const t=(n=this.io)==null?void 0:n.notifications;return typeof(t==null?void 0:t[e])=="function"}attachHandlers(e){var n;return(n=e.actions)==null||n.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,s;try{(i=this.logger)==null||i.info(`${e.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(e.id,o.action,r))}catch(c){(s=this.logger)==null||s.error("Error while clicking on action:",c)}}})}),Object.assign(e,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${e.id} - request to change the state from ${e.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(e.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${e.id} - request to change the state from ${e.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(e.id,o)},updateData:async o=>{var i,a,s;(i=this.logger)==null||i.trace(`${e.id} - request to change the data to ${JSON.stringify(o)}`);const r=(a=this.io)==null?void 0:a.notifications;r!=null&&r.updateData?await r.updateData(e.id,o):(s=this.logger)==null||s.warn("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${e.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(e.id,void 0,o))}catch(s){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${e.id}`,s)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${e.id} - was closed.`),this.close(e.id)}})}};function tf(e){const t=v.useContext(Ie.IOConnectContext),n=Ve(),[o,r]=v.useState([]),[i,a]=v.useState(0),s="Platform",c=v.useCallback((f="asc")=>{if(n===null)return[];const p=[...o].sort((h,m)=>{const g=(h.title??h.name).toLowerCase(),y=(m.title??m.name).toLowerCase();return f==="asc"?g.localeCompare(y):y.localeCompare(g)});if(!n){const h=p.findIndex(m=>m.name===s);if(h!==-1){const[m]=p.splice(h,1);p.unshift(m)}}return p},[o,n]),u=v.useMemo(()=>c("asc"),[c]),d=v.useMemo(()=>c("desc"),[c]);return v.useEffect(()=>{if(n===null||n)return;const f={title:"System",name:s,hidden:!1,userProperties:{hidden:!1}};r(p=>p.some(h=>h.name===f.name)?p:[...p,f])},[n]),v.useEffect(()=>{if(!t)return;let f,p,h,m=!1;const g=k=>{r(x=>[...x.filter(S=>S.name!==k.name),{title:k.title??k.name,name:k.name,hidden:k.hidden,userProperties:k.userProperties}])},y=k=>{r(x=>x.filter(S=>S.name!==k.name))},b=k=>{r(x=>x.find(S=>S.name===k.name)?x.map(S=>S.name===k.name?{...S,title:k.title??S.title,hidden:k.hidden??S.hidden,userProperties:k.userProperties??S.userProperties}:S):x)};return(async()=>{const k=await Wo.getApplications(t);if(m)return;r(C=>{const O=new Map;return C.forEach(_=>O.set(_.name,_)),k.forEach(_=>{O.set(_.name,{title:_.title??_.name,name:_.name,hidden:_.hidden,userProperties:_.userProperties})}),Array.from(O.values())});const[x,S,w]=await Promise.all([Wo.onAppAdded(t,g),Wo.onAppRemoved(t,y),Wo.onAppChanged(t,b)]);if(m)return x==null||x(),S==null||S(),void(w==null?void 0:w());f=x,p=S,h=w})().catch(k=>{console.error("Failed to initialize apps",k)}),()=>{m=!0,f==null||f(),p==null||p(),h==null||h()}},[t]),{apps:v.useMemo(()=>{if(!(e!=null&&e.sourceFilter)||!Array.isArray(o))return o;const{allowed:f=[],blocked:p=[]}=e.sourceFilter,h=f.includes("*"),m=p.includes("*");let g=0;const y=o.map(b=>{const k=h||f.includes(b.name),x=!m&&k;return x&&g++,{...b,allowed:x}});return a(g),y},[e,o]),allowedApps:i,sortedAppsAsc:u,sortedAppsDesc:d,sortAppsAlphabetically:c}}function lv(e,t,n){var r;return{notificationStacks:v.useMemo(()=>{var u,d,f,p;if(!t.toastStacking)return[];const i=(a=t.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const s=e.filter(h=>h.state==="Active"),c=new Map;for(const h of s){const m=h[i]??"";if(h.source&&((d=(u=n==null?void 0:n.sourceFilter)==null?void 0:u.muted)!=null&&d.includes(h.source))||(p=(f=n==null?void 0:n.sourceFilter)==null?void 0:f.muted)!=null&&p.includes("*"))continue;c.has(m)||c.set(m,{key:m,items:[]});const g=c.get(m);g&&g.items.unshift(h)}return Array.from(c.values()).filter(h=>h.items.some(m=>m.state==="Active"||m.state==="Stale"))},[e,t.toastStacking,t.stackBy,(r=n==null?void 0:n.sourceFilter)==null?void 0:r.muted])}}function uv(e){const[t,n]=v.useState([]);return{selectedNotifications:t,selectNotification:(o,r)=>{const i=t;n(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=e.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=e.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=e.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=e.map(a=>a.id)}n(i)}else n([])}}}const dh=e=>{var t,n;return{enabledNotifications:e.enable,enabledToasts:e.enableToasts,toastStacking:((t=e.toasts)==null?void 0:t.mode)==="stacked",stackBy:(n=e.toasts)==null?void 0:n.stackBy,toastExpiry:e.toastExpiry,showNotificationBadge:e.showNotificationBadge,placement:e.placement,snooze:e.snooze,closeNotificationOnClick:e.closeNotificationOnClick,autoHidePanel:e.autoHidePanel}},fh=e=>Array.from(e.reduce((t,n)=>t.set(n.id,n),new Map).values());function Dk(){const e=v.useContext(Ie.IOConnectContext),[t,n]=v.useState({}),[o,r]=v.useState({}),[i,a]=v.useState([]),[s,c]=v.useState(0),[u,d]=v.useState(!0),{apps:f,allowedApps:p}=tf(t),{notificationStacks:h}=lv(i,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:t.sourceFilter}),{selectedNotifications:m,selectNotification:g,selectAllNotifications:y}=uv(i);v.useEffect(()=>{(async()=>{await mt.init(e),await(async()=>{try{const x=await mt.getConfiguration();n(x),r(S=>({...S,...dh(x)}))}catch(x){console.error("Error fetching configuration:",x)}})(),await(async()=>{try{const x=await mt.getNotificationsList();a(fh(x))}catch(x){console.error("Error fetching notifications:",x)}})()})().catch(x=>{console.error("Error in useNotifications fetch:",x)}),b()},[e]),v.useEffect(()=>{const x=mt.onNotificationsChanged(C=>{a(fh(C))}),S=mt.onConfigurationChanged(C=>{const O=dh(C);n(_=>({..._,...C})),r(_=>({..._,...O}))}),w=mt.onCounterChanged(C=>{c(C)});return()=>{x(),S(),w()}},[]);const b=()=>{d(mt.bulkActionsSupported)},k=async x=>{await mt.setFilter(x)};return{close:x=>mt.close(x),clearAll:()=>mt.clearAll(),settings:o,hidePanel:async()=>{await mt.hidePanel()},showPanel:async()=>{await mt.showPanel()},saveFilter:k,clearAllOld:()=>mt.clearAllOld(),saveSetting:async x=>{const S=((w,C)=>{const O=(E=>({enabledNotifications:A=>({enable:A}),enabledToasts:A=>({enableToasts:A}),toastStacking:A=>{var j;return{toasts:{mode:A?"stacked":"single",stackBy:(j=E.toasts)==null?void 0:j.stackBy}}},stackBy:A=>{var j;return{toasts:{mode:(j=E.toasts)==null?void 0:j.mode,stackBy:A}}},showNotificationBadge:A=>({showNotificationBadge:A}),toastExpiry:A=>({toastExpiry:A}),placement:A=>({placement:A}),snooze:A=>({snooze:A}),closeNotificationOnClick:A=>({closeNotificationOnClick:A}),autoHidePanel:A=>({autoHidePanel:A})}))(C),_=Object.keys(w)[0],N=w[_];return _&&N!==void 0&&O[_]?O[_](N):{}})(x,t);S&&await mt.configure(S)},allApps:f,saveAllFilter:async x=>{"subscribe"in x?await k({allowed:x.subscribe?["*"]:[],blocked:x.subscribe?[]:["*"]}):"mute"in x&&await k({muted:x.mute?["*"]:[]})},configuration:t,notifications:i,notificationStacks:h,notificationsCount:s,allApplications:t.allApplications??0,allowedApplications:p,isBulkActionsSupported:u,selectedNotifications:m,selectNotification:g,selectAllNotifications:y,clearMany:async x=>{await mt.clearMany(x)},snooze:async(x,S)=>{await mt.snooze(x,S)},snoozeMany:async(x,S)=>{await mt.snoozeMany(x,S)},setState:async(x,S)=>{await mt.setState(x,S)},setStates:async(x,S)=>{await mt.setStates(x,S)},setCount:x=>{c(x)},getNotificationsList:async()=>await mt.getNotificationsList()}}const dv=v.createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),Ce=()=>v.useContext(dv);function fv({className:e,title:t="General",...n}){const o=Q("io-notifications-settings-panel-general",e),{AllowNotifications:r,AllowNotificationToasts:i,ShowNotificationBadge:a,CloseNotificationOnClick:s,PanelAutoHide:c,HideToastsAfter:u}=zr(),d=Ve();return l.jsx("div",{className:o,...n,children:l.jsxs(et,{title:t,children:[d&&l.jsx(r,{}),d&&l.jsx(i,{}),l.jsx(a,{}),d&&l.jsx(c,{}),d&&l.jsx(s,{}),d&&l.jsx(u,{})]})})}function pv({label:e="Allow notifications",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=v.useCallback(s=>{r({enabledNotifications:s.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:a,checked:o.enabledNotifications??!1,...n}):null}function hv({label:e="Allow notification toasts",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({enabledToasts:c.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:s,checked:o.enabledToasts??!1,disabled:a,...n}):null}function mv({label:e="Show notification badge",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve()&&!o.enabledNotifications,a=v.useCallback(s=>{r({showNotificationBadge:s.target.checked})},[r]);return l.jsx(_t,{label:e,align:t,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...n})}function gv({label:e="Close notification on click",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({closeNotificationOnClick:c.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:s,checked:o.closeNotificationOnClick??!1,disabled:a,...n}):null}function yv({label:e="Auto hide panel",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=v.useCallback(s=>{r({autoHidePanel:s.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:a,checked:o.autoHidePanel??!1,...n}):null}const ph=(e,t)=>e?`${e} ${t}${e!==1?"s":""}`:"",Gs=e=>{const t=Math.floor(e/60),n=e%60,o=ph(t,"minute"),r=ph(n,"second");return o+(o&&r?" ":"")+r};function vv({className:e,title:t="Hide toasts after",items:n=[15,30,45,60],...o}){const r=Q("flex","jc-between","ai-center",e),{settings:i,saveSetting:a}=Ce(),s=Ve(),c=s&&!i.enabledNotifications,u=v.useCallback((d=15e3)=>{i.toastExpiry!==d&&a({toastExpiry:1e3*d})},[i.toastExpiry,a]);return s?l.jsxs("div",{className:r,...o,children:[l.jsx("div",{className:"io-text-clipper "+(c?"io-text-disabled":""),children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",disabled:c,children:[l.jsx(fe.Button,{text:Gs((i.toastExpiry??0)/1e3)}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:n.map(d=>l.jsx(fe.Item,{onClick:()=>{u(d)},children:Gs(d)},d))})})]})]}):null}function wv({className:e,title:t="Stacking",...n}){const o=Q("io-notifications-settings-panel-stacking",e),{ToastStacking:r,ToastStackBy:i}=zr();return Ve()?l.jsx("div",{className:o,...n,children:l.jsxs(et,{title:t,children:[l.jsx(r,{}),l.jsx(i,{})]})}):null}function bv({label:e="Allow toast stacking",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({toastStacking:c.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:s,checked:o.toastStacking??!1,disabled:a,...n}):null}const Mu={application:"Application",severity:"Priority"},Mk=Object.fromEntries(Object.entries(Mu).map(([e,t])=>[t,e]));function xv({className:e,title:t="Group by",...n}){const o=Q("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ve(),s=a&&!r.enabledNotifications,c=v.useCallback((d="severity")=>{r.stackBy!==d&&i({stackBy:d.toLowerCase()})},[r.stackBy,i]);if(!a)return null;const u=Object.values(Mu);return l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:Q("io-text-clipper",{"io-text-disabled":s}),children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",disabled:s,children:[l.jsx(fe.Button,{text:Mu[r.stackBy??"severity"]}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:u.map(d=>l.jsx(fe.Item,{onClick:()=>{const f=Mk[d];c(f)},children:d},d))})})]})]})}function kv({className:e,title:t="Placement",...n}){const o=Q("io-notifications-settings-panel-placement",e),{PlacementPanel:r,PlacementToasts:i}=zr();return Ve()?l.jsx("div",{className:o,...n,children:l.jsxs(et,{title:t,children:[l.jsx(r,{}),l.jsx(i,{})]})}):null}const Sv=e=>e.replace(/(^|-)\w/g,t=>t.toUpperCase().replace("-"," "));function Cv({className:e,title:t="Panel position",...n}){var c,u;const o=Q("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ve(),s=v.useCallback(d=>{var f;d||(d="right"),((f=r.placement)==null?void 0:f.panel)!==d&&i({placement:{...r.placement,panel:d.toLowerCase()}})},[r.placement,i]);return a?l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:"io-text-clipper",children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",children:[l.jsx(fe.Button,{text:(c=r.placement)!=null&&c.panel?Sv((u=r.placement)==null?void 0:u.panel):"Right"}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:["Right","Left"].map(d=>l.jsx(fe.Item,{onClick:()=>{s(d)},children:d},d))})})]})]}):null}function Ev({className:e,title:t="Toasts position",...n}){var c,u;const o=Q("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ve(),s=v.useCallback(d=>{var p;if(d||(d="bottom-right"),((p=r.placement)==null?void 0:p.toasts)===d)return;const f=d.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:f}})},[r.placement,i]);return a?l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:"io-text-clipper",children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",children:[l.jsx(fe.Button,{text:(c=r.placement)!=null&&c.toasts?Sv((u=r.placement)==null?void 0:u.toasts):"Bottom Right"}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(d=>l.jsx(fe.Item,{onClick:()=>{s(d)},children:d},d))})})]})]}):null}function jv({className:e,title:t="Snooze",...n}){var a;const o=Q("io-notifications-settings-panel-snooze",e),{SnoozeDuration:r}=zr(),{settings:i}=Ce();return Ve()&&((a=i.snooze)!=null&&a.enabled)?l.jsx("div",{className:o,...n,children:l.jsx(et,{title:t,children:l.jsx(r,{})})}):null}function _v({className:e,title:t="Default duration",items:n=[60,120,180,300],...o}){var d,f;const r=Q("flex","jc-between","ai-center",e),{settings:i,saveSetting:a}=Ce(),s=Ve(),c=s&&!i.enabledNotifications,u=v.useCallback((p=6e4)=>{var h;i.snooze&&((h=i.snooze)==null?void 0:h.duration)!==p&&a({snooze:{...i.snooze,duration:1e3*p}})},[i.snooze,a]);return s&&((d=i.snooze)!=null&&d.enabled)?l.jsxs("div",{className:r,...o,children:[l.jsx("div",{className:Q("io-text-clipper",{"io-text-disabled":c}),children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",disabled:c,children:[l.jsx(fe.Button,{text:Gs((((f=i.snooze)==null?void 0:f.duration)??0)/1e3)}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:n.map(p=>l.jsx(fe.Item,{onClick:()=>{u(p)},children:Gs(p)},p))})})]})]}):null}function Ov({className:e,title:t,...n}){const o=Q("io-notifications-settings-panel-subscriptions",e),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:s}=zr(),{sortAppsAlphabetically:c}=tf(),u=Ve(),d=c(),f="io-notifications-subscriptions-grid "+(u?"with-three-columns":"with-two-columns");return l.jsx("div",{className:o,...n,children:l.jsxs(et,{title:t??(u?"Subscribe & Mute":"Subscribe"),children:[l.jsxs("div",{className:f,children:[l.jsx("p",{className:"io-text-section",children:"Sources"}),l.jsx("p",{className:"io-text-section",children:"Subscribe"}),u&&l.jsx("p",{className:"io-text-section",children:"Mute"})]}),l.jsxs("div",{className:f,children:[l.jsx("p",{children:"All Sources"}),l.jsx(r,{label:""}),u&&l.jsx(a,{label:""})]}),d.map(p=>{var h;return!p||p.hidden||(h=p==null?void 0:p.userProperties)!=null&&h.hidden?null:l.jsxs("div",{className:f,children:[l.jsx("p",{children:p.title??p.name}),l.jsx(i,{app:p,label:""}),u&&l.jsx(s,{app:p,label:""})]},p.name)})]})})}function Av({label:e="All apps",align:t="right",...n}){var c,u,d,f;const{settings:o,configuration:r,saveAllFilter:i}=Ce(),a=Ve()&&!o.enabledNotifications,s=v.useCallback(p=>{i({subscribe:p.target.checked})},[i]);return l.jsx(_t,{align:t,label:e,onChange:s,checked:(((u=(c=r.sourceFilter)==null?void 0:c.allowed)==null?void 0:u.includes("*"))&&((f=(d=r.sourceFilter)==null?void 0:d.blocked)==null?void 0:f.length)===0)??!1,disabled:a,...n})}function Pv({label:e="App",align:t="right",app:n,...o}){var d,f,p,h,m,g;const{allApps:r,settings:i,configuration:a,saveFilter:s}=Ce(),c=Ve()&&!i.enabledNotifications,u=v.useCallback((y,b)=>{var S,w,C,O,_,N;const k={...a.sourceFilter},x=(S=k.allowed)==null?void 0:S.indexOf("*");typeof x=="number"&&x>-1&&((w=k.allowed)==null||w.splice(x,1),r.forEach(E=>{var A;E.name!==b.name&&((A=k.allowed)==null||A.push(E.name))})),y?(k.allowed=[...new Set([...k.allowed??[],b.name])],k.blocked=(C=k.blocked)==null?void 0:C.filter(E=>E!==b.name)):(k.allowed=(O=k.allowed)==null?void 0:O.filter(E=>E!==b.name),k.blocked=[...new Set([...k.blocked??[],b.name])]),(_=k.allowed)!=null&&_.length&&((N=k.blocked)!=null&&N.includes("*"))&&k.blocked.splice(k.blocked.indexOf("*"),1),s(k)},[r,a.sourceFilter,s]);return l.jsx(_t,{id:`subscribe-${n.name}`,label:e,align:t,onChange:y=>u(y.target.checked,n),checked:(((f=(d=a.sourceFilter)==null?void 0:d.allowed)==null?void 0:f.includes("*"))&&!((h=(p=a.sourceFilter)==null?void 0:p.blocked)!=null&&h.includes(n.name))||((g=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:g.includes(n.name)))??!1,disabled:c,...o})}function Nv({label:e="Mute all",align:t="right",...n}){var u,d,f,p;const{settings:o,configuration:r,saveAllFilter:i}=Ce(),a=Ve(),s=a&&(!o.enabledNotifications||((d=(u=r.sourceFilter)==null?void 0:u.allowed)==null?void 0:d.indexOf("*"))===-1),c=v.useCallback(h=>{i({mute:h.target.checked})},[i]);return a?l.jsx(_t,{align:t,label:e,onChange:c,checked:((p=(f=r.sourceFilter)==null?void 0:f.muted)==null?void 0:p.includes("*"))??!1,disabled:s??!1,...n}):null}function Tv({label:e="App",align:t="right",app:n,...o}){var f,p,h,m,g,y,b,k,x,S,w,C,O,_,N,E;const{allApps:r,settings:i,configuration:a,saveFilter:s}=Ce(),c=Ve(),u=c&&(!i.enabledNotifications||((p=(f=a.sourceFilter)==null?void 0:f.blocked)==null?void 0:p.includes("*"))||((m=(h=a.sourceFilter)==null?void 0:h.blocked)==null?void 0:m.includes(n.name))||((y=(g=a.sourceFilter)==null?void 0:g.allowed)==null?void 0:y.length)===0||((k=(b=a.sourceFilter)==null?void 0:b.allowed)==null?void 0:k.indexOf(n.name))===-1&&((S=(x=a.sourceFilter)==null?void 0:x.allowed)==null?void 0:S.indexOf("*"))===-1&&((C=(w=a.sourceFilter)==null?void 0:w.blocked)==null?void 0:C.length)===0),d=v.useCallback((A,j)=>{var R,F,z,V;const B={...a.sourceFilter},$=(R=B==null?void 0:B.muted)==null?void 0:R.indexOf("*");typeof $=="number"&&$>-1&&((F=B.muted)==null||F.splice($,1),r.forEach(L=>{var H;L.name===j.name||L.hidden||((H=B.muted)==null||H.push(L.name))})),A?(z=B.muted)==null||z.push(j.name):B.muted=(V=B.muted)==null?void 0:V.filter(L=>L!==j.name),s(B)},[r,a.sourceFilter,s]);return!c||n.hidden?null:l.jsx(_t,{id:`mute-${n.name}`,label:e,align:t,onChange:A=>d(A.target.checked,n),checked:(((_=(O=a.sourceFilter)==null?void 0:O.muted)==null?void 0:_.includes("*"))||((E=(N=a.sourceFilter)==null?void 0:N.muted)==null?void 0:E.includes(n.name)))??!1,disabled:u??!1,...o})}const Iv={Body:e=>{var c;const{General:t,Placement:n,Stacking:o,Snooze:r,Subscriptions:i}=zr(),{settings:a}=Ce(),s=[{key:"general",Component:t},{key:"stacking",Component:o},{key:"placement",Component:n},...Ve()&&((c=a.snooze)!=null&&c.enabled)?[{key:"snooze",Component:r}]:[],{key:"subscriptions",Component:i}];return l.jsx(sr,{element:xi,elementProps:e,children:s.map(({key:u,Component:d},f)=>l.jsxs(v.Fragment,{children:[l.jsx(d,{}),f<s.length-1&&l.jsx(wo,{})]},u))})},General:fv,AllowNotifications:pv,AllowNotificationToasts:hv,ShowNotificationBadge:mv,CloseNotificationOnClick:gv,PanelAutoHide:yv,HideToastsAfter:vv,Stacking:wv,ToastStacking:bv,ToastStackBy:xv,Placement:kv,PlacementPanel:Cv,PlacementToasts:Ev,Snooze:jv,SnoozeDuration:_v,Subscriptions:Ov,SubscribeAll:Av,SubscribeApp:Pv,SubscribeMuteAll:Nv,SubscribeMuteApp:Tv},Rv=v.createContext(Iv),nf=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Iv,...t}),[t]);return l.jsx(Rv.Provider,{value:n,children:e})});nf.displayName="NotificationsSettingsPanelComponentsStoreProvider";const zr=()=>v.useContext(Rv),$k=({className:e,onClose:t,title:n="Notification Settings",...o})=>{const{Body:r}=zr();return l.jsxs(ot,{className:Q("io-notifications-settings-panel",e),"data-testid":"notifications-settings-panel",...o,children:[l.jsxs(ot.Header,{children:[l.jsx(ot.Header.Title,{size:"large",text:n,tag:"h1"}),l.jsx(ot.Header.ButtonGroup,{children:l.jsx(ot.Header.ButtonIcon,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:t})})]}),l.jsx(r,{})]})},of=({components:e,...t})=>l.jsx(nf,{components:e,children:l.jsx($k,{...t})}),Hk=({name:e,value:t})=>l.jsxs("div",{className:"io-profile-section-item",children:[l.jsx("div",{className:"io-profile-section-item-name",children:e}),l.jsx("div",{className:"io-profile-section-item-value",children:t})]}),Lv=({className:e,items:t,title:n})=>l.jsxs("div",{className:Q("io-profile-section-body",e),children:[n&&l.jsx(Xn,{className:"io-profile-section-title",text:n}),t.map(({name:o,value:r})=>l.jsx(Hk,{name:o,value:r},o))]}),rf=({className:e,items:t,title:n})=>l.jsxs("section",{className:Q("io-profile-section",e),children:[l.jsx(Lv,{items:t,title:n}),l.jsx(wo,{className:"mt-8"})]}),Dv=({title:e="License",...t})=>l.jsx(rf,{title:e,...t}),Mv=({title:e="Version",...t})=>l.jsx(rf,{title:e,...t}),$v=({title:e="Plugins",...t})=>l.jsx(rf,{title:e,...t}),Hv=({className:e})=>{const t=Hr()?"io.Connect Desktop":"io.Connect Browser";return l.jsxs("div",{className:Q("io-trademark-container",e),children:[l.jsx("h4",{className:"io-trademark-title",children:t}),l.jsxs("p",{className:"io-trademark-text",children:[t,"® is a registered trademark of"," ",l.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},Bv=({avatarInitials:e=Hr()?"CD":"CB",className:t,items:n,onLogout:o,title:r})=>l.jsxs("section",{className:Q("io-profile-section",t),children:[l.jsxs("div",{className:"io-user-details-container",children:[l.jsx("div",{className:"io-user-avatar",children:e}),l.jsx(Lv,{className:"mt-12",items:n,title:r})]}),o&&l.jsx(tt,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),l.jsx(wo,{className:"mt-8"})]}),zv={LicenseSection:Dv,ProductsInfoSection:Mv,PluginsSection:$v,Trademark:Hv,UserSection:Bv},Fv=v.createContext(zv),Wv=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...zv,...t}),[t]);return l.jsx(Fv.Provider,{value:n,children:e})});Wv.displayName="ProfilePanelComponentsStoreProvider";const Bk=e=>{const t=new Date(e);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(n=>t.toLocaleDateString("en",n)).join(" ")},zk=e=>{if(!e)return{items:[]};const t=[...e.email?[{name:"Email",value:e.email}]:[],...e.type?[{name:"User Type",value:e.type}]:[],...e.role?[{name:"User Role",value:e.role}]:[],{name:"User ID",value:e.id}];if(e.firstName||e.lastName){const n=[e.firstName,e.lastName].filter(o=>!!o);return{avatarInitials:n.map(o=>o.charAt(0)).join(""),items:t,title:n.join(" ")}}return e.username?{avatarInitials:e.username.charAt(0),items:t,title:e.username}:e.email?{avatarInitials:e.email.charAt(0),items:t}:{items:t}},Fk=e=>{const t=new Date(2023,5,6),n=e.expiration<t.getTime()?1e3:1;return{items:[{name:"Type",value:e.type},{name:"Expiration Date",value:Bk(e.expiration*n)}]}},Wk=e=>({items:e.map(t=>({name:t.name,value:t.version}))}),Uk=e=>{var n;const t={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:e.platform.apiVersion},{name:"io.Connect Browser client",value:e.client.apiVersion},...e.workspaces?[{name:"Workspaces API",value:e.workspaces.apiVersion}]:[],...(n=e.workspaces)!=null&&n.container&&ev(e.workspaces.container.type,t)?[{name:t[e.workspaces.container.type],value:e.workspaces.container.version}]:[],...e.home?[{name:"Home UI",value:e.home.version}]:[],...e.search?[{name:"Search API",value:e.search.apiVersion}]:[],...e.modals?[{name:"Modals API",value:e.modals.apiVersion}]:[]]}},Vk=()=>{const e=window.glue42gd??window.iodesktop;if(!e)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:t,env:n}=e,o=[{name:"Environment",value:n.env},{name:"Region",value:n.region}];return t?{avatarInitials:t.charAt(0),items:o,title:t}:{items:o}},Kk=e=>({items:Object.entries(e??{}).map(([n,o])=>({name:n,value:o}))}),Gk=(e=[])=>({items:e.map(({product:t,version:n})=>({name:t,value:n}))}),qk=e=>Hr()?(async t=>{const{licInfo:n,productInfo:o}=(await t.interop.invoke("T42.GD.GetInfo")).returned;return{user:Vk(),license:Kk(n),productsInfo:Gk(o)}})(e):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const t=await window.iobrowser.system.getProfileData();return{user:zk(t.user),license:Fk(t.license),plugins:Wk(t.plugins),productsInfo:Uk(t.productsInfo)}})(),Jk=({className:e,onClose:t,onLogout:n,title:o="Profile",...r})=>{var h;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:s,Trademark:c,UserSection:u}=v.useContext(Fv),d=v.useContext(Ie.IOConnectContext),[f,p]=v.useState(null);return v.useEffect(()=>{d&&(async()=>{const m=await qk(d);p(m)})().catch(console.error)},[d]),l.jsxs(ot,{className:Q("io-profile-panel",e),"data-testid":"profile-panel",...r,children:[l.jsxs(ot.Header,{children:[l.jsx(ot.Header.Title,{size:"large",text:o}),l.jsx(ot.Header.ButtonGroup,{children:l.jsx(ot.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:t})})]}),l.jsxs(sr,{element:ot.Body,children:[f!=null&&f.user.items.length||f!=null&&f.user.title?l.jsx(u,{avatarInitials:f.user.avatarInitials,items:f.user.items,onLogout:n,title:f.user.title}):null,l.jsxs("div",{className:"io-profile-sections-container",children:[f!=null&&f.license.items.length?l.jsx(i,{items:f.license.items}):null,f!=null&&f.productsInfo.items.length?l.jsx(a,{items:f.productsInfo.items}):null,(h=f==null?void 0:f.plugins)!=null&&h.items.length?l.jsx(s,{items:f.plugins.items}):null]}),l.jsx(c,{className:"mt-auto"})]})]})},Uv=({components:e,...t})=>l.jsx(Wv,{components:e,children:l.jsx(Jk,{...t})}),Zk=document.querySelector("#root")??document.body,Yk={preferences:cv,"notification-settings":of,profile:Uv};var Xk=Object.freeze({__proto__:null,ActivePanelRenderer:()=>{const{panel:e,deselectPanel:t}=lh();eu(()=>{e&&t()},["Escape"]);const n=e?Yk[e]:null;return n?$o.createPortal(l.jsx("div",{className:"io-panel-overlay",children:l.jsx(n,{onClose:t})}),Zk):null},PanelManagerProvider:({children:e})=>{const[t,n]=v.useState(null),o=v.useCallback(a=>{n(a)},[]),r=v.useCallback(()=>{n(null)},[]),i=v.useMemo(()=>({panel:t,selectPanel:o,deselectPanel:r}),[t,o,r]);return l.jsx(m0.Provider,{value:i,children:e})},usePanelManagerContext:lh});v.createContext({theme:"dark"});const Qk="var(--io-neutrals-0)",gl="var(--io-neutrals-900)";function Vv(e){var r;let t,n,o;if(e.startsWith("#")){let i=e.slice(1);i.length===3&&(i=i.split("").map(a=>a+a).join("")),t=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16)}else{if(!e.startsWith("rgb")){const i=document.createElement("canvas").getContext("2d");return i?(i.fillStyle=e,Vv(i.fillStyle)):gl}{const i=(r=e.match(/\d+/g))==null?void 0:r.map(Number);if(!i||i.length<3)return gl;[t,n,o]=i}}return(.2126*t+.7152*n+.0722*o)/255>.5?gl:Qk}function e3({className:e,channel:t,...n}){const o=Q("io-channel-badge",e),r=v.useMemo(()=>Vv(t.color),[t.color]);return l.jsx("div",{className:o,style:{color:r,backgroundColor:t.color},"data-testid":`channel-selector-badge-${t.color}`,...n,children:l.jsx("span",{className:"io-channel-selector-badge-label","data-testid":"channel-selector-label",children:t.label})})}function t3(){return l.jsx(jt,{variant:"check","data-testid":"channel-selector-channel-selected"})}function n3({channel:e,handleChannelRestricted:t,lockedChannelRestriction:n}){const o=(r,i)=>a=>{a.stopPropagation(),Mn(a)&&(a.preventDefault(),i||t({...e,[r]:!e[r]}))};return l.jsxs(l.Fragment,{children:[l.jsx("div",{children:e.isSelected&&l.jsx("span",{"data-testid":"channel-selector-channel-selected",children:"Active"})}),l.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-publish-toggle-container",children:l.jsx(_t,{label:"Publish",checked:e.write,onChange:()=>{t({...e,write:!e.write})},onKeyDown:o("write",!e.isSelected||(n==null?void 0:n.write)),onClick:r=>r.stopPropagation(),disabled:!e.isSelected||(n==null?void 0:n.write)})}),l.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-subscribe-toggle-container",children:l.jsx(_t,{label:"Subscribe",checked:e.read,onChange:()=>{t({...e,read:!e.read})},onKeyDown:o("read",!e.isSelected||(n==null?void 0:n.read)),disabled:!e.isSelected||(n==null?void 0:n.read)})})]})}const Kv=v.createContext({});function o3({channel:e,isSelected:t,onChannelSelect:n,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,lockedChannelRestrictions:s}=v.useContext(Kv),c=t||e.isSelected||(a==null?void 0:a.includes(e)),u=s==null?void 0:s.find(h=>h.name===e.name),d=v.useCallback(()=>n==null?void 0:n({...e,isSelected:!c}),[e,n,c]),f=v.useCallback(h=>{const m=h.target;m.closest(".io-toggle")||m.classList.contains("io-toggle")||Mn(h)&&(h.preventDefault(),n==null||n({...e,isSelected:!c}))},[e,n,c]),p=v.useCallback(h=>{o==null||o(h)},[o]);return l.jsx(dc,{prepend:l.jsx(e3,{channel:e}),append:i==="single"||i==="multi"?c&&l.jsx(t3,{}):l.jsx(n3,{channel:e,handleChannelRestricted:p,lockedChannelRestriction:u}),isSelected:c,onClick:d,onKeyDown:f,...r,children:e.name},e.name)}function r3({variant:e,onVariantChange:t,disabled:n=!1}){const o=e==="directionalSingle"||e==="directionalMulti",r=v.useCallback(()=>{t==null||t(!o)},[o,t]),i=v.useCallback(s=>{s.stopPropagation()},[]),a=v.useCallback(s=>{s.stopPropagation(),Mn(s)&&(s.preventDefault(),n||r())},[n,r]);return l.jsx(_t,{label:"Directional",align:"right",checked:o,onChange:r,onClick:i,onKeyDown:a,disabled:n,"data-testid":`channel-selector-toggle-${e}`})}const i3=v.forwardRef(({className:e,variant:t="single",variantToggle:n=!1,channels:o=[],lockedChannelRestrictions:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:s,...c},u)=>{const d=Q("io-list-channels","io-channel-selector-panel",(t==="directionalSingle"||t==="directionalMulti")&&"io-list-channels-directional io-channel-selector-panel-directional",e),f=v.useMemo(()=>({variant:t,selectedChannels:o.filter(p=>p.isSelected),lockedChannelRestrictions:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:s}),[o,t,r,i,a,s]);return l.jsx(Kv.Provider,{value:f,children:l.jsx("div",{className:d,ref:u,children:l.jsxs(vt,{...c,children:[l.jsx(vt.ItemTitle,{"data-testid":"channel-selector-title",append:n&&l.jsx(r3,{variant:t,onVariantChange:i}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[t]}),o==null?void 0:o.map(p=>l.jsx(o3,{channel:p,isSelected:p.isSelected,onChannelSelect:a,onChannelRestrict:s,"data-testid":`channel-selector-channel-${p.name}`},p.name))]})})})});i3.displayName="ChannelSelector";const a3=v.forwardRef(({className:e,title:t,ariaLabel:n,onClick:o,onKeyDown:r,children:i,disabled:a=!1,...s},c)=>l.jsx("div",{ref:c,className:Q(e,{disabled:a}),title:t,role:"button",tabIndex:a?-1:0,"aria-label":n,"aria-disabled":a,onClick:u=>{!a&&o&&o(u)},onKeyDown:u=>{!a&&r&&r(u)},...s,children:i}));a3.displayName="ChannelSelectorButtonWrapper";function s3({actionButtons:e,actionButtonElementsRefs:t,isAutofocusButton:n,isButtonDisabled:o,onButtonClick:r}){return l.jsx(Be,{"data-testid":"io-dialog-action-buttons-group",align:"right",children:e.map((i,a)=>{const{id:s,text:c,variant:u}=i,d=n(s);return l.jsx(tt,{"data-testid":`io-dialog-action-button-${s}`,id:s,ref:f=>{a===0&&(t.current=[]),t.current[a]=f},className:d?"io-focus-button":void 0,disabled:o(s),onClick:()=>r(i),variant:u,children:c},s)})})}function af({actionButtons:e,children:t,onCompletion:n,size:o,title:r=Hr()?"io.Connect Desktop":"io.Connect Browser",validationErrors:i=[]}){const{actionButtonElementsRefs:a,autofocusButtonId:s,hasAutofocusButtonLostInitialFocus:c}=(f=>{const p=v.useRef([]),h=v.useMemo(()=>{var b;return((b=f.find(k=>k.autofocus))==null?void 0:b.id)??null},[f]),m=v.useRef(h),[g,y]=v.useState(!m.current);return v.useLayoutEffect(()=>{if(g)return;if(h!==m.current)return void y(!0);const b=p.current.find(x=>(x==null?void 0:x.id)===h);if(!b)return;b.focus();const k=()=>{y(!0)};return b.addEventListener("blur",k),()=>{b.removeEventListener("blur",k)}},[h,g]),{actionButtonElementsRefs:p,autofocusButtonId:h,hasAutofocusButtonLostInitialFocus:g}})(e),u=()=>{n({isClosed:!0})},d={...o};return l.jsxs(go,{className:"io-dialog-template",closeFn:u,isOpen:!0,onCancel:f=>{f.preventDefault(),u()},onKeyDown:f=>{!Mn(f)||i.length||f.target instanceof HTMLButtonElement||f.key===" "&&f.target instanceof HTMLInputElement||n({isEnterPressed:!0})},style:d,title:r,draggable:!0,children:[l.jsx(go.Body,{children:t}),l.jsx(go.Footer,{children:l.jsx(s3,{actionButtonElementsRefs:a,actionButtons:e,isAutofocusButton:f=>s===f&&!c,isButtonDisabled:f=>i.some(p=>p.disabledButtonIds.some(h=>h===f)),onButtonClick:({id:f,text:p})=>{n({responseButtonClicked:{id:f,text:p}})}})})]})}function sf({children:e}){return l.jsx("h1",{"data-testid":"io-dialog-heading",className:"io-dialog-template-heading",children:e})}function c3({onCompletion:e,size:t,variables:n}){const{actionButtons:o,heading:r,text:i,title:a}=n;return l.jsx(af,{actionButtons:o,onCompletion:e,size:t,title:a,children:l.jsx(go.Body.Content,{children:l.jsxs("div",{children:[l.jsx(sf,{children:r}),l.jsx("p",{"data-testid":"io-dialog-text",children:i})]})})})}function l3({onCompletion:e,size:t,variables:n}){const{actionButtons:o,checkbox:r,heading:i,text:a,title:s}=n,[c,u]=v.useState(r.initialValue),d=v.useCallback(()=>u(p=>!p),[]),f=[{id:r.id,type:"checkbox",checked:c}];return l.jsxs(af,{actionButtons:o,onCompletion:p=>e({...p,inputs:f}),size:t,title:s,children:[l.jsx(go.Body.Content,{children:l.jsxs("div",{children:[l.jsx(sf,{children:i}),l.jsx("p",{"data-testid":"io-dialog-text",children:a})]})}),l.jsx(Na,{"data-testid":`io-dialog-checkbox-${r.id}`,checked:c,id:r.id,label:r.label,name:r.id,onChange:d})]})}function u3({onCompletion:e,size:t,variables:n}){const{actionButtons:o,heading:r,input:i,title:a}=n,[s,c]=v.useState(i.initialValue??""),u=v.useRef(null),d=(f=s,!(p=i.validation)||new RegExp(p.regexPattern).test(f)?null:{disabledButtonIds:p.disabledButtonIds,message:p.errorMessage});var f,p;const h=[{id:i.id,type:"text",value:s}];return v.useLayoutEffect(()=>{var m;(m=u.current)==null||m.select()},[]),l.jsxs(af,{actionButtons:o,onCompletion:m=>e({...m,inputs:h}),size:t,title:a,validationErrors:d?[d]:[],children:[l.jsx(go.Body.Content,{children:l.jsx(sf,{children:r})}),l.jsx(nr,{"data-testid":`io-dialog-input-${i.id}`,ref:u,errorDataTestId:`io-dialog-input-${i.id}-error-message`,errorMessage:d==null?void 0:d.message,id:i.id,label:i.label,name:i.id,onChange:m=>c(m.target.value),placeholder:i.placeholder,type:"text",value:s})]})}const cf=Ut({width:Dp,height:Dp}),lf=bu().andThen(e=>((t,n)=>{const o=typeof t;return o==="function"?bu():w2(`The argument provided as "${n}" must be a function, received: ${o}`)})(e,"onCompletion")),uf=Ut({autofocus:xe(rt()),id:wt,text:wt,variant:Oa(q("default"),q("primary"),q("critical"),q("outline"),q("link"))}),d3=Ut({disabledButtonIds:tr(wt),errorMessage:wt,regexPattern:wt}),f3=Ut({actionButtons:tr(uf),heading:qt(),text:qt(),title:xe(qt())}),p3=Ut({templateName:q("noInputsConfirmationDialog"),onCompletion:lf,size:xe(cf),variables:f3}),h3=Ut({actionButtons:tr(uf),checkbox:Ut({id:wt,initialValue:xe(rt()),label:xe(qt())}),heading:qt(),text:qt(),title:xe(qt())}),m3=Ut({templateName:q("singleCheckboxDialog"),onCompletion:lf,size:xe(cf),variables:h3}),g3=Ut({actionButtons:tr(uf),heading:qt(),input:Ut({id:wt,initialValue:xe(qt()),label:xe(qt()),placeholder:xe(qt()),validation:xe(d3)}),title:xe(qt())}),y3=Ut({templateName:q("singleTextInputDialog"),onCompletion:lf,size:xe(cf),variables:g3});p3.runWithException,m3.runWithException,y3.runWithException;v.createContext({config:{message:""},theme:"dark",setResult:()=>{}});const v3={env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},w3=v.createContext({config:v3,onThemeChanged:()=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:()=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Bn=()=>v.useContext(w3);function b3({...e}){const{config:t,close:n}=Bn(),{applicationTitle:o}=t;return l.jsxs(cn,{draggable:!0,...e,children:[l.jsx(cn.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),l.jsx(cn.ButtonGroup,{className:"non-draggable",children:l.jsx(cn.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>n()})})]})}function x3({className:e,handleSubmit:t,...n}){const o=Q("io-panel-body",e),{config:r,submitFeedback:i}=Bn(),{IntroField:a,DescriptionField:s,TechInfoField:c,EnvInfoField:u,FileAttachmentsField:d,CategoryAttachmentsField:f,MailListField:p}=Dc(),h=t??i,m=`Your feedback will be submitted to the ${r.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return l.jsxs("form",{className:o,id:"feedback",onSubmit:h,...n,children:[l.jsx(a,{children:l.jsx("p",{children:m})}),l.jsx(p,{}),l.jsx(s,{}),l.jsx(c,{readOnly:!0}),l.jsx(u,{readOnly:!0}),r.attachmentsViewMode==="file"?l.jsx(d,{}):l.jsx(f,{})]})}function k3({...e}){const{FooterButtons:t}=Dc(),{openUrl:n,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=Bn();return l.jsx(jr,{...e,children:l.jsxs("div",o?{className:"flex ai-center jc-between",children:[l.jsx(et,{children:l.jsx("p",{children:r.title})}),l.jsx(H2,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[l.jsxs(et,{children:[l.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&l.jsx("a",{href:i,onClick:a=>{a.preventDefault(),n(i)},children:i})]}),l.jsx(t,{})]})})}function S3({className:e,...t}){const{CloseButton:n}=Dc(),{close:o}=Bn(),r=Q("non-draggable",e);return l.jsx(Be,{className:r,...t,children:l.jsx(n,{onClick:()=>o()})})}function C3({className:e,...t}){const{SubmitButton:n,CancelButton:o,CloseButton:r}=Dc(),{close:i,submitCompleted:a}=Bn();return a?l.jsx(Be,{className:e,...t,children:l.jsx(r,{text:"Close",onClick:()=>i()})}):l.jsxs(Be,{className:e,...t,children:[l.jsx(n,{}),l.jsx(o,{onClick:()=>i()})]})}function E3({text:e="Submit",...t}){return l.jsx(tt,{form:"feedback",type:"submit",variant:"primary",text:e,...t})}function j3({text:e="Cancel",...t}){return l.jsx(tt,{variant:"link",text:e,...t})}function _3({...e}){return l.jsx(tt,{variant:"primary",...e})}function O3({showField:e=!0,className:t,title:n,hint:o,children:r,...i}){return e?l.jsx(et,{className:t,title:n,hint:o,...i,children:r}):null}function A3({showField:e=!0,className:t,title:n="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return e?l.jsx(et,{className:t,hint:o,title:"",...a,children:l.jsx(Tc,{id:"description",name:"description",label:n,readOnly:r,disabled:i})}):null}function P3({showField:e,className:t,title:n="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...s}){const{config:c}=Bn(),u=e??c.errorMessage,d=r??c.errorMessage;return u&&d?l.jsx(et,{className:t,hint:o,...s,children:l.jsx(Tc,{id:"errorMessage",name:"errorMessage",label:n,value:d,readOnly:i,disabled:a})}):null}function N3({showField:e,className:t,title:n="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...s}){const{config:c}=Bn(),u=e??c.showEnvironmentInfo,d=r??c.environmentInfo;return u&&d?l.jsx(et,{className:t,hint:o,...s,children:l.jsx(Tc,{id:"environmentInfo",name:"environmentInfo",label:n,value:d,readOnly:i,disabled:a})}):null}function T3({showField:e=!0,className:t,title:n="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:s,...c}){const u=Q("io-block-list-gap",t),{config:d}=Bn(),f=a??d.attachments,p=s??d.selectedCategories,h=v.useCallback(m=>!!p&&p.indexOf(m)!==-1,[p]);return e?!f||f.length<=0?l.jsx(et,{title:"Attachments",children:l.jsx("p",{children:"No Attachments"})}):l.jsx(et,{className:u,title:n,hint:o,...c,children:l.jsx("div",{className:"file-attachments",children:f.map(m=>l.jsx(Na,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:h(m.category)},m.id))})}):null}function I3({showField:e=!0,className:t,title:n="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:s,...c}){const{config:u,attachmentCategories:d}=Bn(),f=a??d,p=s??u.selectedCategories,h=v.useCallback(m=>!!p&&p.indexOf(m)!==-1,[p]);return e?!f||f.length<=0?l.jsx("p",{children:"No Attachments"}):l.jsx(et,{className:t,title:n,hint:o,...c,children:l.jsx("div",{className:"category-attachments",children:f.map(m=>l.jsx(_t,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:h(m)},m))})}):null}function R3({className:e,title:t,hint:n,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:s="Send Email",readOnly:c=!1,disabled:u,...d}){const f=Q("io-block-list-gap",e),{config:p,showMailingList:h,setShowMailingList:m}=Bn();if(!o)return null;const g=r??p.createJiraTicket,y=a??p.sendEmail;return l.jsxs(et,{className:f,hint:n,title:t,...d,children:[g&&l.jsx(_t,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:c,disabled:u,defaultChecked:g}),y&&l.jsx(_t,{onChange:()=>{m(!h)},id:"sendEmail",name:"sendEmail",label:s,align:"right",readOnly:c,disabled:u,defaultChecked:y})]})}function L3({showField:e=!0,className:t,title:n="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...s}){const{config:c,showMailingList:u}=Bn(),d=e??c.sendEmail,f=i??c.allowEditRecipients===!1;return d&&u?l.jsx(et,{className:t,hint:o,...s,children:l.jsx(nr,{id:"mailingList",name:"mailingList",label:n,placeholder:r,readOnly:f,disabled:a,defaultValue:c.mailingList??""})}):null}const Gv={Header:b3,Body:x3,Footer:k3,HeaderButtons:S3,FooterButtons:C3,SubmitButton:E3,CancelButton:j3,CloseButton:_3,IntroField:O3,DescriptionField:A3,TechInfoField:P3,EnvInfoField:N3,FileAttachmentsField:T3,CategoryAttachmentsField:I3,SettingsField:R3,MailListField:L3},qv=v.createContext(Gv),D3=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Gv,...t}),[t]);return l.jsx(qv.Provider,{value:n,children:e})});function Dc(e){return{...v.useContext(qv),...e}}D3.displayName="ComponentsStore";const oa=e=>"items"in e,va={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Mc=new Intl.Collator(void 0,{sensitivity:"base"}),Jv=(e,t)=>Mc.compare(e.title,t.title),Zv=(e,t)=>Mc.compare(t.title,e.title),df=e=>{const{items:t,sortOrder:n,ascendingCompare:o,descendingCompare:r}=e;if(n===va.DISABLED)return t;const i=n===va.ASCENDING?o:r;return[...t].sort(i)},Yv="favorites-section",Xv="workspaces-section",Qv="applications-section",$u=e=>{var h;const{items:t,newItem:n,settings:o,path:r,accumulatedPath:i=""}=e,{isFolderCollapsible:a}=o,[s,...c]=r.split("/"),u=i?`${i}/${s}`:s,d=t.findIndex(m=>oa(m)&&m.title===s),f=d!==-1?t[d]:null;if(!f){const m=c.length>0?$u({items:[],newItem:n,settings:o,path:c.join("/"),accumulatedPath:u}):[n];return[...t,{id:s,title:s,items:m,isCollapsible:a,getIcon:(h=o.folderIconGetters)==null?void 0:h[u]}]}const p=c.length>0?$u({items:f.items,newItem:n,settings:o,path:c.join("/"),accumulatedPath:u}):[...f.items,n];return[...t.slice(0,d),{...f,items:p},...t.slice(d+1)]},qs=e=>{const{title:t,userProperties:n}=e,{folder:o}=n;return o?`${o}/${t}`:t},M3=(e,t)=>Mc.compare(qs(e),qs(t)),$3=(e,t)=>Mc.compare(qs(t),qs(e));var hh,Hu={exports:{}},yl={exports:{}},Ke={},mh,gh,vl,yh,vh,wh,bh,xh,kh,Sh,wl,Ch,bl,Eh,Ze={};/** @license React v16.13.1
|
|
16
|
+
*/bi.displayName="PanelBody",Jr.ButtonGroup=Be,Jr.Button=tt,Jr.ButtonIcon=We,Jr.Dropdown=fe,ot.Header=Lo,ot.Body=bi,ot.Footer=Jr,Cc.Icon=xt;const an=(e,t)=>{const{o:n,i:o,u:r}=e;let i,a=n;const s=(c,u)=>{const d=a,f=c,p=u||(o?!o(d,f):d!==f);return(p||r)&&(a=f,i=d),[a,p,i]};return[t?c=>s(t(a,i),c):s,c=>[a,!!c,i]]},en=typeof window<"u"&&typeof HTMLElement<"u"&&window.document?window:{},jy=Math.max,U2=Math.min,_u=Math.round,zo=Math.abs,Gp=Math.sign,_y=en.cancelAnimationFrame,Wd=en.requestAnimationFrame,Ud=en.setTimeout,Oy=en.clearTimeout,Ec=e=>en[e]!==void 0?en[e]:void 0,V2=Ec("MutationObserver"),qp=Ec("IntersectionObserver"),Qr=Ec("ResizeObserver"),Yi=Ec("ScrollTimeline"),Vd=e=>e===void 0,jc=e=>e===null,qo=e=>typeof e=="number",Ai=e=>typeof e=="string",_c=e=>typeof e=="boolean",Hn=e=>typeof e=="function",Sn=e=>Array.isArray(e),Fs=e=>typeof e=="object"&&!Sn(e)&&!jc(e),Kd=e=>{const t=!!e&&e.length,n=qo(t)&&t>-1&&t%1==0;return!!(Sn(e)||!Hn(e)&&n)&&(!(t>0&&Fs(e))||t-1 in e)},ha=e=>!!e&&e.constructor===Object,Ws=e=>e instanceof HTMLElement,Oc=e=>e instanceof Element;function Qe(e,t){if(Kd(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Qe(Object.keys(e),n=>t(e[n],n,e));return e}const Ay=(e,t)=>e.indexOf(t)>=0,xi=(e,t)=>e.concat(t),ft=(e,t,n)=>(!Ai(t)&&Kd(t)?Array.prototype.push.apply(e,t):e.push(t),e),ir=e=>Array.from(e||[]),Gd=e=>Sn(e)?e:!Ai(e)&&Kd(e)?ir(e):[e],Us=e=>!!e&&!e.length,Vs=e=>ir(new Set(e)),pn=(e,t,n)=>{Qe(e,o=>!o||o.apply(void 0,t||[])),n||(e.length=0)},Py="paddingTop",Ny="paddingRight",Ty="paddingLeft",Iy="paddingBottom",Ry="marginLeft",Ly="marginRight",Dy="marginBottom",qd="overflowX",Jd="overflowY",Ac="width",Pc="height",po="visible",Ln="hidden",ki="scroll",Nc=(e,t,n,o)=>{if(e&&t){let r=!0;return Qe(n,i=>{e[i]!==t[i]&&(r=!1)}),r}return!1},My=(e,t)=>Nc(e,t,["w","h"]),ks=(e,t)=>Nc(e,t,["x","y"]),K2=(e,t)=>Nc(e,t,["t","r","b","l"]),Oe=(e,...t)=>e.bind(0,...t),ei=e=>{let t;const n=e?Ud:Wd,o=e?Oy:_y;return[r=>{o(t),t=n(()=>r(),Hn(e)?e():e)},()=>o(t)]},Jp=e=>{const t=Hn(e)?e():e;if(qo(t)){const n=t?Ud:Wd,o=t?Oy:_y;return r=>{const i=n(()=>r(),t);return()=>{o(i)}}}return t&&t._},$y=(e,t)=>{const{p:n,v:o,S:r,m:i}=t||{};let a,s,c,u;const d=function(m){s&&s(),a&&a(),u=s=a=c=void 0,e.apply(this,m)},f=m=>i&&c?i(c,m):m,p=()=>{s&&c&&d(f(c)||c)},h=function(){const m=ir(arguments),g=Jp(n);if(g){const y=typeof r=="function"?r():r,b=Jp(o),k=f(m)||m,x=d.bind(0,k);s&&s(),y&&!u?(x(),u=!0,s=g(()=>u=void 0)):(s=g(x),b&&!a&&(a=b(p))),c=k}else d(m)};return h.O=p,h},Hy=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Xt=e=>e?Object.keys(e):[],Ue=(e,t,n,o,r,i,a)=>{const s=[t,n,o,r,i,a];return typeof e=="object"&&!jc(e)||Hn(e)||(e={}),Qe(s,c=>{Qe(c,(u,d)=>{const f=c[d];if(e===f)return!0;const p=Sn(f);if(f&&ha(f)){const h=e[d];let m=h;p&&!Sn(h)?m=[]:p||ha(h)||(m={}),e[d]=Ue(m,f)}else e[d]=p?f.slice():f})}),e},By=(e,t)=>Qe(Ue({},e),(n,o,r)=>{n===void 0?delete r[o]:n&&ha(n)&&(r[o]=By(n))}),Zd=e=>!Xt(e).length,ma=()=>{},zy=(e,t,n)=>jy(e,U2(t,n)),Pr=e=>Vs((Sn(e)?e:(e||"").split(" ")).filter(t=>t)),Yd=(e,t)=>e&&e.getAttribute(t),Zp=(e,t)=>e&&e.hasAttribute(t),lo=(e,t,n)=>{Qe(Pr(t),o=>{e&&e.setAttribute(o,String(n||""))})},Un=(e,t)=>{Qe(Pr(t),n=>e&&e.removeAttribute(n))},Tc=(e,t)=>{const n=Pr(Yd(e,t)),o=Oe(lo,e,t),r=(i,a)=>{const s=new Set(n);return Qe(Pr(i),c=>{s[a](c)}),ir(s).join(" ")};return{C:i=>o(r(i,"delete")),$:i=>o(r(i,"add")),H:i=>{const a=Pr(i);return a.reduce((s,c)=>s&&n.includes(c),a.length>0)}}},Fy=(e,t,n)=>(Tc(e,t).C(n),Oe(Xd,e,t,n)),Xd=(e,t,n)=>(Tc(e,t).$(n),Oe(Fy,e,t,n)),Ks=(e,t,n,o)=>(o?Xd:Fy)(e,t,n),Qd=(e,t,n)=>Tc(e,t).H(n),Wy=e=>Tc(e,"class"),Uy=(e,t)=>{Wy(e).C(t)},ef=(e,t)=>(Wy(e).$(t),Oe(Uy,e,t)),Yp=(e,t)=>{const n=t?Oc(t)&&t:document;return n?ir(n.querySelectorAll(e)):[]},Ou=(e,t)=>Oc(e)&&e.matches(t),Vy=e=>Ou(e,"body"),Au=e=>e?ir(e.childNodes):[],ga=e=>e&&e.parentElement,ti=(e,t)=>Oc(e)&&e.closest(t),Pu=e=>document.activeElement,G2=(e,t,n)=>{const o=ti(e,t),r=e&&((a,s)=>{const c=s?Oc(s)&&s:document;return c&&c.querySelector(a)})(n,o),i=ti(r,t)===o;return!(!o||!r)&&(o===e||r===e||i&&ti(ti(e,n),t)!==o)},Si=e=>{Qe(Gd(e),t=>{const n=ga(t);t&&n&&n.removeChild(t)})},Qt=(e,t)=>Oe(Si,e&&t&&Qe(Gd(t),n=>{n&&e.appendChild(n)}));let Ky;const li=e=>{const t=document.createElement("div");return lo(t,"class",e),t},Gy=e=>{const t=li(),n=Ky,o=e.trim();return t.innerHTML=n?n.createHTML(o):o,Qe(Au(t),r=>Si(r))},Xp=(e,t)=>e.getPropertyValue(t)||e[t]||"",qy=e=>{const t=e||0;return isFinite(t)?t:0},Qa=e=>qy(parseFloat(e||"")),Nu=e=>Math.round(1e4*e)/1e4,Jy=e=>`${Nu(qy(e))}px`;function ya(e,t){e&&t&&Qe(t,(n,o)=>{try{const r=e.style,i=jc(n)||_c(n)?"":qo(n)?Jy(n):n;o.indexOf("--")===0?r.setProperty(o,i):r[o]=i}catch{}})}function Qn(e,t,n){const o=Ai(t);let r=o?"":{};if(e){const i=en.getComputedStyle(e,n)||e.style;r=o?Xp(i,t):ir(t).reduce((a,s)=>(a[s]=Xp(i,s),a),r)}return r}const Qp=(e,t,n)=>{const o=t?`${t}-`:"",r=n?`-${n}`:"",i=`${o}top${r}`,a=`${o}right${r}`,s=`${o}bottom${r}`,c=`${o}left${r}`,u=Qn(e,[i,a,s,c]);return{t:Qa(u[i]),r:Qa(u[a]),b:Qa(u[s]),l:Qa(u[c])}},pl=(e,t)=>"translate"+(Fs(e)?`(${e.x},${e.y})`:`${t?"X":"Y"}(${e})`),q2={w:0,h:0},Ic=(e,t)=>t?{w:t[`${e}Width`],h:t[`${e}Height`]}:q2,J2=e=>Ic("inner",e||en),ui=Oe(Ic,"offset"),Zy=Oe(Ic,"client"),Gs=Oe(Ic,"scroll"),tf=e=>{const t=parseFloat(Qn(e,Ac))||0,n=parseFloat(Qn(e,Pc))||0;return{w:t-_u(t),h:n-_u(n)}},hl=e=>e.getBoundingClientRect(),Tu=e=>!(!e||!e[Pc]&&!e[Ac]),Yy=(e,t)=>{const n=Tu(e);return!Tu(t)&&n},eh=(e,t,n,o)=>{Qe(Pr(t),r=>{e&&e.removeEventListener(r,n,o)})},it=(e,t,n,o)=>{var r;const i=(r=o&&o.I)==null||r,a=o&&o.A||!1,s=o&&o.T||!1,c={passive:i,capture:a};return Oe(pn,Pr(t).map(u=>{const d=s?f=>{eh(e,u,d,a),n&&n(f)}:n;return e&&e.addEventListener(u,d,c),Oe(eh,e,u,d,a)}))},Xy=e=>e.stopPropagation(),Iu=e=>e.preventDefault(),Qy=e=>Xy(e)||Iu(e),qn=(e,t)=>{const{x:n,y:o}=qo(t)?{x:t,y:t}:t||{};qo(n)&&(e.scrollLeft=n),qo(o)&&(e.scrollTop=o)},ln=e=>({x:e.scrollLeft,y:e.scrollTop}),Z2=(e,t)=>{const{D:n,M:o}=e,{w:r,h:i}=t,a=(f,p,h)=>{let m=Gp(f)*h,g=Gp(p)*h;if(m===g){const y=zo(f),b=zo(p);g=y>b?0:g,m=y<b?0:m}return m=m===g?0:m,[m+0,g+0]},[s,c]=a(n.x,o.x,r),[u,d]=a(n.y,o.y,i);return{D:{x:s,y:u},M:{x:c,y:d}}},ml=({D:e,M:t})=>{const n=(o,r)=>o===0&&o<=r;return{x:n(e.x,t.x),y:n(e.y,t.y)}},th=({D:e,M:t},n)=>{const o=(r,i,a)=>zy(0,1,(r-a)/(r-i)||0);return{x:o(e.x,t.x,n.x),y:o(e.y,t.y,n.y)}},Ru=e=>{e&&e.focus&&e.focus({preventScroll:!0,focusVisible:!1})},nh=(e,t)=>{Qe(Gd(t),e)},Lu=e=>{const t=new Map,n=(r,i)=>{if(r){const a=t.get(r);nh(s=>{a&&a[s?"delete":"clear"](s)},i)}else t.forEach(a=>{a.clear()}),t.clear()},o=(r,i)=>{if(Ai(r)){const c=t.get(r)||new Set;return t.set(r,c),nh(u=>{Hn(u)&&c.add(u)},i),Oe(n,r,i)}_c(i)&&i&&n();const a=Xt(r),s=[];return Qe(a,c=>{const u=r[c];u&&ft(s,o(c,u))}),Oe(pn,s)};return o(e||{}),[o,n,(r,i)=>{Qe(ir(t.get(r)),a=>{i&&!Us(i)?a.apply(0,i):a()})}]},e0={},t0={},n0=(e,t,n)=>Xt(e).map(o=>{const{static:r,instance:i}=e[o],[a,s,c]=n||[],u=n?i:r;if(u){const d=n?u(a,s,t):u(t);return(c||t0)[o]=d}}),Pi=e=>t0[e],Ni="data-overlayscrollbars",Ss="os-environment",es=`${Ss}-scrollbar-hidden`,gl=`${Ni}-initialize`,Cs="noClipping",oh=`${Ni}-body`,Jo=Ni,uo=`${Ni}-viewport`,Y2=qd,X2=Jd,o0="measuring",r0="scrollbarHidden",Du=`${Ni}-padding`,rh=`${Ni}-content`,nf="os-size-observer",Q2=`${nf}-appear`,ek=`${nf}-listener`,gn="os-scrollbar",tk=`${gn}-rtl`,nk=`${gn}-horizontal`,ok=`${gn}-vertical`,i0=`${gn}-track`,of=`${gn}-handle`,rk=`${gn}-visible`,ik=`${gn}-cornerless`,ih=`${gn}-interaction`,ah=`${gn}-unusable`,Mu=`${gn}-auto-hide`,sh=`${Mu}-hidden`,ch=`${gn}-wheel`,ak=`${i0}-interactive`,sk=`${of}-interactive`,ni=e=>e.indexOf(po)===0,$u=(e,t)=>{if(e==="auto")return t?ki:Ln;const n=e||Ln;return[Ln,ki,po].includes(n)?n:Ln},ck=(e,t)=>{const{overflowX:n,overflowY:o}=Qn(e,[qd,Jd]);return{x:$u(n,t.x),y:$u(o,t.y)}},rf="__osScrollbarsHidingPlugin",lh=e=>JSON.stringify(e,(t,n)=>{if(Hn(n))throw 0;return n}),uh=(e,t)=>e?`${t}`.split(".").reduce((n,o)=>n&&Hy(n,o)?n[o]:void 0,e):void 0,a0=[33,99],s0=[222,666,!0],lk={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:[0,33],resize:null,event:a0,env:s0},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},c0=(e,t)=>{const n={};return Qe(xi(Xt(t),Xt(e)),o=>{const r=e[o],i=t[o];if(Fs(r)&&Fs(i))Ue(n[o]={},c0(r,i)),Zd(n[o])&&delete n[o];else if(Hy(t,o)&&i!==r){let a=!0;if(Sn(r)||Sn(i))try{lh(r)===lh(i)&&(a=!1)}catch{}a&&(n[o]=i)}}),n},dh=(e,t,n)=>o=>[uh(e,o),n||uh(t,o)!==void 0];let l0,yl;const uk=()=>{const e=(b,k,x)=>{Qt(document.body,b),Qt(document.body,b);const S=Zy(b),w=ui(b),C=tf(k);return x&&Si(b),{x:w.h-S.h+C.h,y:w.w-S.w+C.w}},t=Gy(`<div class="${Ss}"><div></div><style>${`.${Ss}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${Ss} div{width:200%;height:200%;margin:10px 0}.${es}{scrollbar-width:none!important}.${es}::-webkit-scrollbar,.${es}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`}</style></div>`)[0],n=t.firstChild,o=t.lastChild,r=l0;r&&(o.nonce=r);const[i,,a]=Lu(),[s,c]=an({o:e(t,n),i:ks},Oe(e,t,n,!0)),[u]=c(),d=(b=>{let k=!1;const x=ef(b,es);try{k=Qn(b,"scrollbar-width")==="none"||Qn(b,"display","::-webkit-scrollbar")==="none"}catch{}return x(),k})(t),f={x:u.x===0,y:u.y===0},p={elements:{host:null,padding:!d,viewport:b=>d&&Vy(b)&&b,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},h=Ue({},lk),m=Oe(Ue,{},h),g=Oe(Ue,{},p),y={P:u,k:f,U:d,J:!!Yi,G:Oe(i,"r"),K:g,Z:b=>Ue(p,b)&&g(),tt:m,nt:b=>Ue(h,b)&&m(),ot:Ue({},p),st:Ue({},h)};if(Un(t,"style"),Si(t),it(en,"resize",()=>{a("r",[])}),Hn(en.matchMedia)&&!d&&(!f.x||!f.y)){const b=k=>{const x=en.matchMedia(`(resolution: ${en.devicePixelRatio}dppx)`);it(x,"change",()=>{k(),b(k)},{T:!0})};b(()=>{const[k,x]=s();Ue(y.P,k),a("r",[x])})}return y},eo=()=>(yl||(yl=uk()),yl),fh=(e,t,n,o)=>{let r=!1;const{et:i,ct:a,rt:s,it:c,lt:u,ut:d}=o||{},[f,p]=((b,k,x)=>{let S=!1;const w=!!x&&new WeakMap,C=O=>{if(w&&x){const _=x.map(N=>{const[E,A]=N||[];return[A&&E?(O||Yp)(E,b):[],A]});Qe(_,N=>Qe(N[0],E=>{const A=N[1],j=w.get(E)||[];if(b.contains(E)&&A){const B=it(E,A,$=>{S?(B(),w.delete(E)):k($)});w.set(E,ft(j,B))}else pn(j),w.delete(E)}))}};return C(),[()=>{S=!0},C]})(e,()=>r&&n(!0),s),h=a||[],m=xi(i||[],h),g=(b,k)=>{if(!Us(k)){const x=u||ma,S=d||ma,w=[],C=[];let O=!1,_=!1;if(Qe(k,N=>{const{attributeName:E,target:A,type:j,oldValue:B,addedNodes:$,removedNodes:R}=N,F=j==="attributes",z=j==="childList",V=e===A,L=F&&E,H=L&&Yd(A,E||""),W=Ai(H)?H:null,U=L&&B!==W,Y=Ay(h,E)&&U;if(t&&(z||!V)){const D=F&&U,T=D&&c&&Ou(A,c),P=(T?!x(A,E,B,W):!F||D)&&!S(N,!!T,e,o);Qe($,I=>ft(w,I)),Qe(R,I=>ft(w,I)),_=_||P}!t&&V&&U&&!x(A,E,B,W)&&(ft(C,E),O=O||Y)}),p(N=>Vs(w).reduce((E,A)=>(ft(E,Yp(N,A)),Ou(A,N)?ft(E,A):E),[])),t)return!b&&_&&n(!1),[!1];if(!Us(C)||O){const N=[Vs(C),O];return b||n.apply(0,N),N}}},y=new V2(Oe(g,!1));return[()=>(y.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:m,subtree:t,childList:t,characterData:t}),r=!0,()=>{r&&(f(),y.disconnect(),r=!1)}),()=>{if(r)return g(!0,y.takeRecords())}]};let ur=null;const u0=(e,t,n)=>{const{ft:o}=n||{},r=Pi("__osSizeObserverPlugin"),[i]=an({o:!1,u:!0});return()=>{const a=[],s=Gy(`<div class="${nf}"><div class="${ek}"></div></div>`)[0],c=s.firstChild,u=d=>{let f=!1,p=!1;if(Sn(d)&&!Us(d)){const h=d[0],[m,,g]=i(h.contentRect),y=Tu(m);p=Yy(m,g),f=!p&&!y}else p=d===!0;f||t({_t:!0,ft:p})};if(Qr){if(!_c(ur)){const h=new Qr(ma);h.observe(e,{get box(){ur=!0}}),ur=ur||!1,h.disconnect()}const d=$y(u,{p:0,v:0}),f=h=>d(h),p=new Qr(f);if(p.observe(ur?e:c),ft(a,[()=>{p.disconnect()},!ur&&Qt(e,s)]),ur){const h=new Qr(f);h.observe(e,{box:"border-box"}),ft(a,()=>h.disconnect())}}else{if(!r)return ma;{const[d,f]=r(c,u,o);ft(a,xi([ef(s,Q2),it(s,"animationstart",d),Qt(e,s)],f))}}return Oe(pn,a)}},dk=(e,t)=>{let n;const o=li("os-trinsic-observer"),[r]=an({o:!1}),i=(s,c)=>{if(s){const u=r((f=>f.h===0||f.isIntersecting||f.intersectionRatio>0)(s)),[,d]=u;return d&&!c&&t(u)&&[u]}},a=(s,c)=>i(c.pop(),s);return[()=>{const s=[];if(qp)n=new qp(Oe(a,!1),{root:e}),n.observe(o),ft(s,()=>{n.disconnect()});else{const c=()=>{const u=ui(o);i(u)};ft(s,u0(o,c)()),c()}return Oe(pn,ft(s,Qt(e,o)))},()=>n&&a(!0,n.takeRecords())]},fk=(e,t,n,o)=>{let r,i,a,s,c,u,d,f;const p=`[${Jo}]`,h=`[${uo}]`,m=["id","class","style","open","wrap","cols","rows"],{dt:g,vt:y,L:b,gt:k,ht:x,V:S,bt:w,wt:C,yt:O,St:_}=e,N=P=>Qn(P,"direction")==="rtl",E={Ot:!1,B:N(g)},A=eo(),j=Pi(rf),[B]=an({i:My,o:{w:0,h:0}},()=>{const P=j&&j.R(e,t,E,A,n).Y,I=!(w&&S)&&Qd(y,Jo,Cs),G=!S&&C("arrange"),K=G&&ln(k),X=K&&_(),Z=O(o0,I),M=G&&P&&P(),se=Gs(b),ce=tf(b);return M&&M(),qn(k,K),X&&X(),I&&Z(),{w:se.w+ce.w,h:se.h+ce.h}}),$=(()=>{let P,I,G;const K=$y(o,{p:()=>P,v:()=>I,S:()=>G,m(Z,M){const[se]=Z,[ce]=M;return[xi(Xt(se),Xt(ce)).reduce((ge,be)=>(ge[be]=se[be]||ce[be],ge),{})]}}),X=(Z,M)=>{if(Sn(M)){const[se,ce,ge]=M;P=se,I=ce,G=ge}else qo(M)?(P=M,I=!1,G=!1):(P=!1,I=!1,G=!1);K(Z)};return X.O=K.O,X})(),R=P=>{const I=N(g);Ue(P,{Ct:f!==I}),Ue(E,{B:I}),f=I},F=(P,I)=>{const[G,K]=P,X={$t:K};return Ue(E,{Ot:G}),I||o(X),X},z=({_t:P,ft:I})=>{const G=I?o:$,K={_t:P||I,ft:I};R(K),G(K,i)},V=(P,I)=>{const[,G]=B(),K={xt:G};return R(K),G&&!I&&$(K,P?a:r),K},L=(P,I,G)=>{const K={Ht:I};return R(K),I&&!G&&$(K,r),K},[H,W]=x?dk(y,F):[],U=!S&&u0(y,z,{ft:!0}),[Y,D]=fh(y,!1,L,{ct:m,et:m}),T=S&&Qr&&new Qr(P=>{const I=P[P.length-1].contentRect;z({_t:!0,ft:Yy(I,d)}),d=I});return[()=>{T&&T.observe(y);const P=U&&U(),I=H&&H(),G=Y(),K=A.G(X=>{const[,Z]=B();$({Et:X,xt:Z,_t:w},s)});return()=>{T&&T.disconnect(),P&&P(),I&&I(),u&&u(),G(),K()}},({zt:P,It:I,At:G})=>{const K={},[X]=P("update.ignoreMutation"),[Z,M]=P("update.attributes"),[se,ce]=P("update.elementEvents"),[ge,be]=P("update.debounce"),Ee=I||G;if(ce||M){c&&c(),u&&u();const[ne,oe]=fh(x||b,!0,V,{et:xi(m,Z||[]),rt:se,it:p,ut:(te,Se)=>{const{target:Ie,attributeName:le}=te;return!(Se||!le||S)&&G2(Ie,p,h)||!!ti(Ie,`.${gn}`)||!!(Re=>Hn(X)&&X(Re))(te)}});u=ne(),c=oe}if(be&&($.O(),Sn(ge)||qo(ge)?(r=ge,i=!1,a=a0,s=s0):ha(ge)?(r=ge.mutation,i=ge.resize,a=ge.event,s=ge.env):(r=!1,i=!1,a=!1,s=!1)),Ee){const ne=D(),oe=W&&W(),te=c&&c();ne&&Ue(K,L(ne[0],ne[1],Ee)),oe&&Ue(K,F(oe[0],Ee)),te&&Ue(K,V(te[0],Ee))}return R(K),K},E]},d0=(e,t)=>Hn(t)?t.apply(0,e):t,pk=(e,t,n,o)=>{const r=Vd(o)?n:o;return d0(e,r)||t.apply(0,e)},f0=(e,t,n,o)=>{const r=Vd(o)?n:o,i=d0(e,r);return!!i&&(Ws(i)?i:t.apply(0,e))},hk=(e,t,n,o)=>{const r="--os-viewport-percent",i="--os-scroll-percent",a="--os-scroll-direction",{K:s}=eo(),{scrollbars:c}=s(),{slot:u}=c,{dt:d,vt:f,L:p,Tt:h,gt:m,bt:g,V:y}=t,{scrollbars:b}=h?{}:e,{slot:k}=b||{},x=[],S=[],w=[],C=f0([d,f,p],()=>y&&g?d:f,u,k),O=R=>{if(Yi){let F=null,z=[];const V=new Yi({source:m,axis:R}),L=()=>{F&&F.cancel(),F=null};return{kt:W=>{const{Dt:U}=n,Y=ml(U)[R],D=R==="x",T=[pl(0,D),pl(`calc(-100% + 100cq${D?"w":"h"})`,D)],P=Y?T:T.reverse();return z[0]===P[0]&&z[1]===P[1]||(z=P,L(),F=W.Mt.animate({clear:["left"],transform:P},{timeline:V})),L}}}},_={x:O("x"),y:O("y")},N=(R,F,z)=>{const V=z?ef:Uy;Qe(R,L=>{V(L.Lt,F)})},E=(R,F)=>{Qe(R,z=>{const[V,L]=F(z);ya(V,L)})},A=(R,F,z)=>{const V=_c(z),L=!V||!z;(!V||z)&&N(S,R,F),L&&N(w,R,F)},j=R=>{const F=R?"x":"y",z=li(`${gn} ${R?nk:ok}`),V=li(i0),L=li(of),H={Lt:z,Ut:V,Mt:L},W=_[F];return ft(R?S:w,H),ft(x,[Qt(z,V),Qt(V,L),Oe(Si,z),W&&W.kt(H),o(H,A,R)]),H},B=Oe(j,!0),$=Oe(j,!1);return B(),$(),[{Pt:()=>{const R=(()=>{const{Rt:z,Vt:V}=n,L=(H,W)=>zy(0,1,H/(H+W)||0);return{x:L(V.x,z.x),y:L(V.y,z.y)}})(),F=z=>V=>[V.Lt,{[r]:Nu(z)+""}];E(S,F(R.x)),E(w,F(R.y))},Nt:()=>{if(!Yi){const{Dt:R}=n,F=th(R,ln(m)),z=V=>L=>[L.Lt,{[i]:Nu(V)+""}];E(S,z(F.x)),E(w,z(F.y))}},qt:()=>{const{Dt:R}=n,F=ml(R),z=V=>L=>[L.Lt,{[a]:V?"0":"1"}];E(S,z(F.x)),E(w,z(F.y)),Yi&&(S.forEach(_.x.kt),w.forEach(_.y.kt))},Bt:()=>{if(y&&!g){const{Rt:R,Dt:F}=n,z=ml(F),V=th(F,ln(m)),L=H=>{const{Lt:W}=H,U=ga(W)===p&&W,Y=(D,T,P)=>{const I=T*D;return Jy(P?I:-I)};return[U,U&&{transform:pl({x:Y(V.x,R.x,z.x),y:Y(V.y,R.y,z.y)})}]};E(S,L),E(w,L)}},Ft:A,jt:{Xt:S,Yt:B,Wt:Oe(E,S)},Jt:{Xt:w,Yt:$,Wt:Oe(E,w)}},()=>(Qt(C,S[0].Lt),Qt(C,w[0].Lt),Oe(pn,x))]},mk=(e,t,n,o)=>(r,i,a)=>{const{vt:s,L:c,V:u,gt:d,Gt:f,St:p}=t,{Lt:h,Ut:m,Mt:g}=r,[y,b]=ei(333),[k,x]=ei(444),S=C=>{Hn(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:C.x,top:C.y})};let w=!0;return Oe(pn,[it(g,"pointermove pointerleave",o),it(h,"pointerenter",()=>{i(ih,!0)}),it(h,"pointerleave pointercancel",()=>{i(ih,!1)}),!u&&it(h,"mousedown",()=>{const C=Pu();(Zp(C,uo)||Zp(C,Jo)||C===document.body)&&Ud(Oe(Ru,c),25)}),it(h,"wheel",C=>{const{deltaX:O,deltaY:_,deltaMode:N}=C;w&&N===0&&ga(h)===s&&S({x:O,y:_}),w=!1,i(ch,!0),y(()=>{w=!0,i(ch)}),Iu(C)},{I:!1,A:!0}),it(h,"pointerdown",()=>{const C=it(f,"click",_=>{O(),Qy(_)},{T:!0,A:!0,I:!1}),O=it(f,"pointerup pointercancel",()=>{O(),setTimeout(C,150)},{A:!0,I:!0})},{A:!0,I:!0}),(()=>{const C="pointerup pointercancel lostpointercapture",O="client"+(a?"X":"Y"),_=a?Ac:Pc,N=a?"left":"top",E=a?"w":"h",A=a?"x":"y",j=($,R)=>F=>{const{Rt:z}=n,V=ui(m)[E]-ui(g)[E],L=R*F/V*z[A];qn(d,{[A]:$+L})},B=[];return it(m,"pointerdown",$=>{const R=ti($.target,`.${of}`)===g,F=R?g:m,z=e.scrollbars,V=z[R?"dragScroll":"clickScroll"],{button:L,isPrimary:H,pointerType:W}=$,{pointers:U}=z;if(L===0&&H&&V&&(U||[]).includes(W)){pn(B),x();const Y=!R&&($.shiftKey||V==="instant"),D=Oe(hl,g),T=Oe(hl,m),P=(te,Se)=>(te||D())[N]-(Se||T())[N],I=_u(hl(d)[_])/ui(d)[E]||1,G=j(ln(d)[A],1/I),K=$[O],X=D(),Z=T(),M=X[_],se=P(X,Z)+M/2,ce=K-Z[N],ge=R?0:ce-se,be=te=>{pn(oe),F.releasePointerCapture(te.pointerId)},Ee=R||Y,ne=p(),oe=[it(f,C,be),it(f,"selectstart",te=>Iu(te),{I:!1}),it(m,C,be),Ee&&it(m,"pointermove",te=>G(ge+(te[O]-K))),Ee&&(()=>{const te=ln(d);ne();const Se=ln(d),Ie={x:Se.x-te.x,y:Se.y-te.y};(zo(Ie.x)>3||zo(Ie.y)>3)&&(p(),qn(d,te),S(Ie),k(ne))})];if(F.setPointerCapture($.pointerId),Y)G(ge);else if(!R){const te=Pi("__osClickScrollPlugin");if(te){const Se=te(G,ge,M,Ie=>{Ie?ne():ft(oe,ne)});ft(oe,Se),ft(B,Oe(Se,!0))}}}})})(),b,x])},gk=e=>{const t=eo(),{K:n,U:o}=t,{elements:r}=n(),{padding:i,viewport:a,content:s}=r,c=Ws(e),u=c?{}:e,{elements:d}=u,{padding:f,viewport:p,content:h}=d||{},m=c?e:u.target,g=Vy(m),y=m.ownerDocument,b=y.documentElement,k=()=>y.defaultView||en,x=Oe(pk,[m]),S=Oe(f0,[m]),w=Oe(li,""),C=Oe(x,w,a),O=Oe(S,w,s),_=C(p),N=_===m,E=N&&g,A=!N&&O(h),j=!N&&_===A,B=E?b:_,$=E?B:m,R=!N&&S(w,i,f),F=!j&&A,z=[F,B,R,$].map(Z=>Ws(Z)&&!ga(Z)&&Z),V=Z=>Z&&Ay(z,Z),L=!V(B)&&(Z=>{const M=ui(Z),se=Gs(Z),ce=Qn(Z,qd),ge=Qn(Z,Jd);return se.w-M.w>0&&!ni(ce)||se.h-M.h>0&&!ni(ge)})(B)?B:m,H=E?b:B,W={dt:m,vt:$,L:B,rn:R,ht:F,gt:H,Kt:E?y:B,ln:g?b:L,Gt:y,bt:g,Tt:c,V:N,an:k,wt:Z=>Qd(B,uo,Z),yt:(Z,M)=>Ks(B,uo,Z,M),St:()=>Ks(H,uo,"scrolling",!0)},{dt:U,vt:Y,rn:D,L:T,ht:P}=W,I=[()=>{Un(Y,[Jo,gl]),Un(U,gl),g&&Un(b,[gl,Jo])}];let G=Au([P,T,D,Y,U].find(Z=>Z&&!V(Z)));const K=E?U:P||T,X=Oe(pn,I);return[W,()=>{const Z=k(),M=Pu(),se=ne=>{Qt(ga(ne),Au(ne)),Si(ne)},ce=ne=>it(ne,"focusin focusout focus blur",Qy,{A:!0,I:!1}),ge="tabindex",be=Yd(T,ge),Ee=ce(M);return lo(Y,Jo,N?"":"host"),lo(D,Du,""),lo(T,uo,""),lo(P,rh,""),N||(lo(T,ge,be||"-1"),g&&lo(b,oh,"")),Qt(K,G),Qt(Y,D),Qt(D||Y,!N&&T),Qt(T,P),ft(I,[Ee,()=>{const ne=Pu(),oe=V(T),te=oe&&ne===T?U:ne,Se=ce(te);Un(D,Du),Un(P,rh),Un(T,uo),g&&Un(b,oh),be?lo(T,ge,be):Un(T,ge),V(P)&&se(P),oe&&se(T),V(D)&&se(D),Ru(te),Se()}]),o&&!N&&(Xd(T,uo,r0),ft(I,Oe(Un,T,uo))),Ru(!N&&g&&M===U&&Z.top===Z?T:M),Ee(),G=0,X},X]},yk=({ht:e})=>({Qt:t,un:n,At:o})=>{const{$t:r}=t||{},{Ot:i}=n;e&&(r||o)&&ya(e,{[Pc]:i&&"100%"})},vk=({vt:e,rn:t,L:n,V:o},r)=>{const[i,a]=an({i:K2,o:Qp()},Oe(Qp,e,"padding",""));return({zt:s,Qt:c,un:u,At:d})=>{let[f,p]=a(d);const{U:h}=eo(),{_t:m,xt:g,Ct:y}=c||{},{B:b}=u,[k,x]=s("paddingAbsolute");(m||p||d||g)&&([f,p]=i(d));const S=!o&&(x||y||p);if(S){const w=!k||!t&&!h,C=f.r+f.l,O=f.t+f.b,_={[Ly]:w&&!b?-C:0,[Dy]:w?-O:0,[Ry]:w&&b?-C:0,top:w?-f.t:0,right:w?b?-f.r:"auto":0,left:w?b?"auto":-f.l:0,[Ac]:w&&`calc(100% + ${C}px)`},N={[Py]:w?f.t:0,[Ny]:w?f.r:0,[Iy]:w?f.b:0,[Ty]:w?f.l:0};ya(t||n,_),ya(n,N),Ue(r,{rn:f,fn:!w,F:t?N:Ue({},_,N)})}return{_n:S}}},wk=(e,t)=>{const n=eo(),{vt:o,rn:r,L:i,V:a,Kt:s,gt:c,bt:u,yt:d,an:f}=e,{U:p}=n,h=u&&a,m=Oe(jy,0),g={display:()=>!1,direction:D=>D!=="ltr",flexDirection:D=>D.endsWith("-reverse"),writingMode:D=>D!=="horizontal-tb"},y=Xt(g),b={i:My,o:{w:0,h:0}},k={i:ks,o:{}},x=D=>{d(o0,!h&&D)},S=()=>Qn(i,y),w=(D,T)=>{const P=!Xt(D).length,I=!T&&y.some(ne=>{const oe=D[ne];return Ai(oe)&&g[ne](oe)});if(P&&!I||!(ne=>!!ne&&(oe=>!!(oe.offsetWidth||oe.offsetHeight||oe.getClientRects().length))(ne))(i))return{D:{x:0,y:0},M:{x:1,y:1}};x(!0);const G=ln(c),K=it(s,ki,ne=>{const oe=ln(c);ne.isTrusted&&oe.x===G.x&&oe.y===G.y&&Xy(ne)},{A:!0,T:!0}),X=d("noContent",!0);qn(c,{x:0,y:0}),X();const Z=ln(c),M=Gs(c);qn(c,{x:M.w,y:M.h});const se=ln(c),ce={x:se.x-Z.x,y:se.y-Z.y};qn(c,{x:-M.w,y:-M.h});const ge=ln(c),be={x:ge.x-Z.x,y:ge.y-Z.y},Ee={x:zo(ce.x)>=zo(be.x)?se.x:ge.x,y:zo(ce.y)>=zo(be.y)?se.y:ge.y};return qn(c,G),Wd(()=>K()),{D:Z,M:Ee}},C=(D,T)=>{const P=en.devicePixelRatio%1!=0?1:0,I={w:m(D.w-T.w),h:m(D.h-T.h)};return{w:I.w>P?I.w:0,h:I.h>P?I.h:0}},O=(D,T)=>{const P=(I,G,K,X)=>{const Z=I===po?Ln:(ce=>ce.replace(`${po}-`,""))(I),M=ni(I),se=ni(K);return!G&&!X?Ln:M&&se?po:M?G&&X?Z:G?po:Ln:G?Z:se&&X?po:Ln};return{x:P(T.x,D.x,T.y,D.y),y:P(T.y,D.y,T.x,D.x)}},_=D=>{const T=I=>[po,Ln,ki].map(G=>Y($u(G),I)),P=T(!0).concat(T()).join(" ");d(P),d(Xt(D).map(I=>Y(D[I],I==="x")).join(" "),!0)},[N,E]=an(b,Oe(tf,i)),[A,j]=an(b,Oe(Gs,i)),[B,$]=an(b),[R]=an(k),[F,z]=an(b),[V]=an(k),[L]=an({i:(D,T)=>Nc(D,T,Vs(xi(Xt(D),Xt(T)))),o:{}}),[H,W]=an({i:(D,T)=>ks(D.D,T.D)&&ks(D.M,T.M),o:{D:{x:0,y:0},M:{x:0,y:0}}}),U=Pi(rf),Y=(D,T)=>`${T?Y2:X2}${(P=>{const I=String(P||"");return I?I[0].toUpperCase()+I.slice(1):""})(D)}`;return({zt:D,Qt:T,un:P,At:I},{_n:G})=>{const{_t:K,Ht:X,xt:Z,Ct:M,ft:se,Et:ce}=T||{},ge=U&&U.R(e,t,P,n,D),{X:be,Y:Ee,W:ne}=ge||{},[oe,te]=((Fr,ko)=>{const{k:Fn}=ko,[So,Co]=Fr("showNativeOverlaidScrollbars");return[So&&Fn.x&&Fn.y,Co]})(D,n),[Se,Ie]=D("overflow"),le=ni(Se.x),Re=ni(Se.y),Ye=K||G||Z||M||ce||te;let st=E(I),_e=j(I),Pe=$(I),$e=z(I);if(te&&p&&d(r0,!oe),Ye){Qd(o,Jo,Cs)&&x(!0);const Fr=Ee&&Ee(),[ko]=st=N(I),[Fn]=_e=A(I),So=Zy(i),Co=h&&J2(f()),Xc={w:m(Fn.w+ko.w),h:m(Fn.h+ko.h)},Va={w:m((Co?Co.w:So.w+m(So.w-Fn.w))+ko.w),h:m((Co?Co.h:So.h+m(So.h-Fn.h))+ko.h)};Fr&&Fr(),$e=F(Va),Pe=B(C(Xc,Va),I)}const[Le,de]=$e,[ye,re]=Pe,[ve,He]=_e,[we,ie]=st,[ee,ae]=R({x:ye.w>0,y:ye.h>0}),me=le&&Re&&(ee.x||ee.y)||le&&ee.x&&!ee.y||Re&&ee.y&&!ee.x,De=G||M||ce||ie||He||de||re||Ie||te||Ye||X&&h,[je]=D("update.flowDirectionStyles"),[ct,on]=L(je?je(i):S(),I),Ii=M||se||on||ae||I,[lr,Ht]=Ii?H(w(ct,!!je),I):W();let Bt=O(ee,Se);x(!1),De&&(_(Bt),Bt=ck(i,ee),ne&&be&&(be(Bt,ve,we),ya(i,ne(Bt))));const[io,Yc]=V(Bt);return Ks(o,Jo,Cs,me),Ks(r,Du,Cs,me),Ue(t,{cn:io,Vt:{x:Le.w,y:Le.h},Rt:{x:ye.w,y:ye.h},j:ee,Dt:Z2(lr,ye)}),{sn:Yc,tn:de,nn:re,en:Ht||re}}},bk=e=>{const[t,n,o]=gk(e),r={rn:{t:0,r:0,b:0,l:0},fn:!1,F:{[Ly]:0,[Dy]:0,[Ry]:0,[Py]:0,[Ny]:0,[Iy]:0,[Ty]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},cn:{x:Ln,y:Ln},j:{x:!1,y:!1},Dt:{D:{x:0,y:0},M:{x:0,y:0}}},{dt:i,gt:a,V:s,St:c}=t,{U:u,k:d}=eo(),f=!u&&(d.x||d.y),p=[yk(t),vk(t,r),wk(t,r)];return[n,h=>{const m={},g=f&&ln(a),y=g&&c();return Qe(p,b=>{Ue(m,b(h,m)||{})}),qn(a,g),y&&y(),s||qn(i,0),m},r,t,o]},xk=(e,t,n,o,r)=>{let i=!1;const a=dh(t,{}),[s,c,u,d,f]=bk(e),[p,h,m]=fk(d,u,a,S=>{x({},S)}),[g,y,,b]=((S,w,C,O,_,N)=>{let E,A,j,B,$,R=ma,F=0;const z=["mouse","pen"],V=le=>z.includes(le.pointerType),[L,H]=ei(),[W,U]=ei(100),[Y,D]=ei(100),[T,P]=ei(()=>F),[I,G]=hk(S,_,O,mk(w,_,O,le=>V(le)&&ne())),{vt:K,Kt:X,bt:Z}=_,{Ft:M,Pt:se,Nt:ce,qt:ge,Bt:be}=I,Ee=(le,Re)=>{if(P(),le)M(sh);else{const Ye=Oe(M,sh,!0);F>0&&!Re?T(Ye):Ye()}},ne=()=>{(j?E:B)||(Ee(!0),W(()=>{Ee(!1)}))},oe=le=>{M(Mu,le,!0),M(Mu,le,!1)},te=le=>{V(le)&&(E=j,j&&Ee(!0))},Se=[P,U,D,H,()=>R(),it(K,"pointerover",te,{T:!0}),it(K,"pointerenter",te),it(K,"pointerleave",le=>{V(le)&&(E=!1,j&&Ee(!1))}),it(K,"pointermove",le=>{V(le)&&A&&ne()}),it(X,"scroll",le=>{L(()=>{ce(),ne()}),N(le),be()})],Ie=Pi(rf);return[()=>Oe(pn,ft(Se,G())),({zt:le,At:Re,Qt:Ye,Zt:st})=>{const{tn:_e,nn:Pe,sn:$e,en:Le}=st||{},{Ct:de,ft:ye}=Ye||{},{B:re}=C,{k:ve,U:He}=eo(),{cn:we,j:ie}=O,[ee,ae]=le("showNativeOverlaidScrollbars"),[me,De]=le("scrollbars.theme"),[je,ct]=le("scrollbars.visibility"),[on,Ii]=le("scrollbars.autoHide"),[lr,Ht]=le("scrollbars.autoHideSuspend"),[Bt]=le("scrollbars.autoHideDelay"),[io,Yc]=le("scrollbars.dragScroll"),[Fr,ko]=le("scrollbars.clickScroll"),[Fn,So]=le("overflow"),Co=ye&&!Re,Xc=ie.x||ie.y,Va=_e||Pe||Le||de||Re,Wb=$e||ct||So,Ub=ee&&ve.x&&ve.y,Jf=!He&&!Ie,Vb=Ub||Jf,Zf=(Qc,el,Kb)=>{const Yf=Qc.includes(ki)&&(je===po||je==="auto"&&el===ki);return M(rk,Yf,Kb),Yf};if(F=Bt,Co&&(lr&&Xc?(oe(!1),R(),Y(()=>{R=it(X,"scroll",Oe(oe,!0),{T:!0})})):oe(!0)),(ae||Jf)&&M("os-theme-none",Vb),De&&(M($),M(me,!0),$=me),Ht&&!lr&&oe(!0),Ii&&(A=on==="move",j=on==="leave",B=on==="never",Ee(B,!0)),Yc&&M(sk,io),ko&&M(ak,!!Fr),Wb){const Qc=Zf(Fn.x,we.x,!0),el=Zf(Fn.y,we.y,!1);M(ik,!(Qc&&el))}Va&&(ce(),se(),be(),Le&&ge(),M(ah,!ie.x,!0),M(ah,!ie.y,!1),M(tk,re&&!Z))},{},I]})(e,t,m,u,d,r),k=S=>Xt(S).some(w=>!!S[w]),x=(S,w)=>{if(n())return!1;const{dn:C,At:O,It:_,pn:N}=S,E=C||{},A=!!O||!i,j={zt:dh(t,E,A),dn:E,At:A};if(N)return y(j),!1;const B=w||h(Ue({},j,{It:_})),$=c(Ue({},j,{un:m,Qt:B}));y(Ue({},j,{Qt:B,Zt:$}));const R=k(B),F=k($),z=R||F||!Zd(E)||A;return i=!0,z&&o(S,{Qt:B,Zt:$}),z};return[()=>{const{ln:S,gt:w,St:C}=d,O=ln(S),_=[p(),s(),g()],N=C();return qn(w,O),N(),Oe(pn,_)},x,()=>({vn:m,gn:u}),{hn:d,bn:b},f]},Hu=new WeakMap,p0=e=>Hu.get(e),Pn=(e,t,n)=>{const{tt:o}=eo(),r=Ws(e),i=r?e:e.target,a=p0(i);if(t&&!a){let s=!1;const c=[],u={},d=E=>{const A=By(E),j=Pi("__osOptionsValidationPlugin");return j?j(A,!0):A},f=Ue({},o(),d(t)),[p,h,m]=Lu(),[g,y,b]=Lu(n),k=(E,A)=>{b(E,A),m(E,A)},[x,S,w,C,O]=xk(e,f,()=>s,({dn:E,At:A},{Qt:j,Zt:B})=>{const{_t:$,Ct:R,$t:F,xt:z,Ht:V,ft:L}=j,{tn:H,nn:W,sn:U,en:Y}=B;k("updated",[N,{updateHints:{sizeChanged:!!$,directionChanged:!!R,heightIntrinsicChanged:!!F,overflowEdgeChanged:!!H,overflowAmountChanged:!!W,overflowStyleChanged:!!U,scrollCoordinatesChanged:!!Y,contentMutation:!!z,hostMutation:!!V,appear:!!L},changedOptions:E||{},force:!!A}])},E=>k("scroll",[N,E])),_=E=>{(A=>{Hu.delete(A)})(i),pn(c),s=!0,k("destroyed",[N,E]),h(),y()},N={options(E,A){if(E){const j=A?o():{},B=c0(f,Ue(j,d(E)));Zd(B)||(Ue(f,B),S({dn:B}))}return Ue({},f)},on:g,off:(E,A)=>{E&&A&&y(E,A)},state(){const{vn:E,gn:A}=w(),{B:j}=E,{Vt:B,Rt:$,cn:R,j:F,rn:z,fn:V,Dt:L}=A;return Ue({},{overflowEdge:B,overflowAmount:$,overflowStyle:R,hasOverflow:F,scrollCoordinates:{start:L.D,end:L.M},padding:z,paddingAbsolute:V,directionRTL:j,destroyed:s})},elements(){const{dt:E,vt:A,rn:j,L:B,ht:$,gt:R,Kt:F}=C.hn,{jt:z,Jt:V}=C.bn,L=W=>{const{Mt:U,Ut:Y,Lt:D}=W;return{scrollbar:D,track:Y,handle:U}},H=W=>{const{Xt:U,Yt:Y}=W,D=L(U[0]);return Ue({},D,{clone:()=>{const T=L(Y());return S({pn:!0}),T}})};return Ue({},{target:E,host:A,padding:j||B,viewport:B,content:$||B,scrollOffsetElement:R,scrollEventElement:F,scrollbarHorizontal:H(z),scrollbarVertical:H(V)})},update:E=>S({At:E,It:!0}),destroy:Oe(_,!1),plugin:E=>u[Xt(E)[0]]};return ft(c,[O]),((E,A)=>{Hu.set(E,A)})(i,N),n0(e0,Pn,[N,p,u]),((E,A)=>{const{nativeScrollbarsOverlaid:j,body:B}=A||{},{k:$,U:R,K:F}=eo(),{nativeScrollbarsOverlaid:z,body:V}=F().cancel,L=j??z,H=Vd(B)?V:B,W=($.x||$.y)&&L,U=E&&(jc(H)?!R:H);return!!W||!!U})(C.hn.bt,!r&&e.cancel)?(_(!0),N):(ft(c,x()),k("initialized",[N]),N.update(),N)}return a};Pn.plugin=e=>{const t=Sn(e),n=t?e:[e],o=n.map(r=>n0(r,Pn)[0]);return(r=>{Qe(r,i=>Qe(i,(a,s)=>{e0[s]=i[s]}))})(n),t?o:o[0]},Pn.valid=e=>{const t=e&&e.elements,n=Hn(t)&&t();return ha(n)&&!!p0(n.target)},Pn.env=()=>{const{P:e,k:t,U:n,J:o,ot:r,st:i,K:a,Z:s,tt:c,nt:u}=eo();return Ue({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,scrollTimeline:o,staticDefaultInitialization:r,staticDefaultOptions:i,getDefaultInitialization:a,setDefaultInitialization:s,getDefaultOptions:c,setDefaultOptions:u})},Pn.nonce=e=>{l0=e},Pn.trustedTypePolicy=e=>{Ky=e};const kk=()=>{if(typeof window>"u"){const u=()=>{};return[u,u]}let e,t;const n=window,o=typeof n.requestIdleCallback=="function",r=n.requestAnimationFrame,i=n.cancelAnimationFrame,a=o?n.requestIdleCallback:r,s=o?n.cancelIdleCallback:i,c=()=>{s(e),i(t)};return[(u,d)=>{c(),e=a(o?()=>{c(),t=r(u)}:u,typeof d=="object"?d:{timeout:2233})},c]},h0=e=>{const{options:t,events:n,defer:o}=e||{},[r,i]=v.useMemo(kk,[]),a=v.useRef(null),s=v.useRef(o),c=v.useRef(t),u=v.useRef(n);return v.useEffect(()=>{s.current=o},[o]),v.useEffect(()=>{const{current:d}=a;c.current=t,Pn.valid(d)&&d.options(t||{},!0)},[t]),v.useEffect(()=>{const{current:d}=a;u.current=n,Pn.valid(d)&&d.on(n||{},!0)},[n]),v.useEffect(()=>()=>{var d;i(),(d=a.current)==null||d.destroy()},[]),v.useMemo(()=>[d=>{const f=a.current;if(Pn.valid(f))return;const p=s.current,h=c.current||{},m=u.current||{},g=()=>a.current=Pn(d,h,m);p?r(g,p):g()},()=>a.current],[])};v.forwardRef((e,t)=>{const{element:n="div",options:o,events:r,defer:i,children:a,...s}=e,c=n,u=v.useRef(null),d=v.useRef(null),[f,p]=h0({options:o,events:r,defer:i});return v.useEffect(()=>{const{current:h}=u,{current:m}=d;if(h)return f(n==="body"?{target:h,cancel:{body:null}}:{target:h,elements:{viewport:m,content:m}}),()=>{var g;return(g=p())==null?void 0:g.destroy()}},[f,n]),v.useImperativeHandle(t,()=>({osInstance:p,getElement:()=>u.current}),[]),v.createElement(c,{"data-overlayscrollbars-initialize":"",ref:u,...s},n==="body"?a:v.createElement("div",{"data-overlayscrollbars-contents":"",ref:d},a))});const ar=v.forwardRef((e,t)=>{const{children:n,element:o="div",elementProps:r,wrapperClassName:i}=e,a=v.useRef(null),s=v.useRef(null),[c,u]=h0({options:{scrollbars:{autoHide:"leave",autoHideDelay:0}},defer:!0}),d=v.useCallback(f=>{s.current=f,typeof t=="function"?t(f):t!==null&&(t.current=f)},[t]);return v.useEffect(()=>{var f;if(s.current&&a.current&&(f=s.current)&&typeof f=="object"&&f.nodeType===Node.ELEMENT_NODE)return c({target:a.current,elements:{viewport:s.current,content:!1}}),()=>{var p;return(p=u())==null?void 0:p.destroy()}},[c,u]),l.jsx("div",{"data-overlayscrollbars-initialize":"",ref:a,className:Q("io-overlay-scrollbars-container",i),children:l.jsx(o,{"data-overlayscrollbars-contents":"",ref:d,...r,children:n})})});function Rc({text:e="Label",...t}){return l.jsx("label",{...t,children:e})}var Sk=v[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],m0=0,Ck=()=>m0++,ph=0;function Ek(e,t){t===void 0&&(t="🅰");var[n,o]=v.useState(ph?Ck:void 0);return Sk(()=>{n===void 0&&o(m0++),ph=1},[]),e||(n===void 0?n:t+n)}function Na(){return(typeof v.useId=="function"?v.useId:Ek)()??""}const tr=v.forwardRef(({id:e,className:t,type:n="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:s,iconAppend:c,iconAppendOnClick:u,placeholder:d,disabled:f,readOnly:p,errorMessage:h,errorDataTestId:m,...g},y)=>{const b=Na(),k=e||`input-${b}`,x=Q("io-control-input",a&&"io-control-leading-icon",c&&"io-control-trailing-icon",f&&"io-control-disabled",p&&"io-control-readonly",h&&"io-control-error",r&&[`direction-${r}`],t),S=v.useCallback(C=>{f?C.preventDefault():s&&s(C)},[s,f]),w=v.useCallback(C=>{f?C.preventDefault():u&&u(C)},[u,f]);return l.jsxs("div",{className:x,children:[i&&l.jsx(Rc,{htmlFor:k,text:i}),a&&l.jsx(xt,{variant:a,onClick:C=>S(C)}),l.jsx("input",{id:k,className:"io-input",ref:y,type:n,name:o,tabIndex:0,placeholder:d??(()=>{switch(n){case"email":return"Enter your email here...";case"number":return"Enter number here...";case"password":return"Enter your password here...";case"tel":return"Enter your phone number here...";case"file":return"Select a file...";default:return"Enter text here..."}})(),"aria-label":i,disabled:f,readOnly:p,...h?{"aria-invalid":!0,"aria-describedby":`${k}-error`}:{},...g}),c&&l.jsx(xt,{variant:c,onClick:C=>w(C)}),h&&l.jsxs("div",{"data-testid":m,id:`${k}-error`,className:"io-input-error",children:[l.jsx(xt,{variant:"close"}),h]})]})});tr.displayName="Input";const Lc=v.forwardRef(({id:e,className:t,name:n="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:s,readOnly:c,...u},d)=>{const f=Na(),p=e||`textarea-${f}`,h=Q("io-control-textarea",s&&"io-control-disabled",c&&"io-control-readonly",o&&[`direction-${o}`],t);return l.jsxs("div",{className:h,children:[r&&l.jsx(Rc,{htmlFor:p,text:r}),l.jsx("textarea",{id:p,className:"io-textarea",ref:d,name:n,tabIndex:0,placeholder:a,"aria-label":r,disabled:s,readOnly:c,rows:i,...u})]})});Lc.displayName="Textarea";const Ta=v.forwardRef(({id:e,className:t,name:n="checkbox",align:o="left",label:r,checked:i,disabled:a,...s},c)=>{const u=Na(),d=e||`checkbox-${u}`,f=Q("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsxs("div",{className:f,children:[l.jsx("input",{type:"checkbox",id:d,className:"io-checkbox",ref:c,name:n,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...s}),r&&l.jsx(Rc,{htmlFor:d,text:r,"data-testid":s["data-testid"]?`${s["data-testid"]}-label`:void 0})]})});Ta.displayName="Checkbox";const jk=v.forwardRef(({id:e,className:t,name:n="radio",align:o="left",label:r,checked:i,disabled:a,...s},c)=>{const u=Na(),d=e||`radio-${u}`,f=Q("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsxs("div",{className:f,children:[l.jsx("input",{type:"radio",id:d,className:"io-radio",ref:c,name:n,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...s}),r&&l.jsx(Rc,{htmlFor:d,text:r})]})});jk.displayName="Radio";const _k=()=>{const e=v.useContext(Te.IOConnectContext),[t,n]=v.useState(null),o=v.useCallback(r=>{var i;return(i=e==null?void 0:e.themes)==null?void 0:i.select(r)},[e]);return v.useEffect(()=>{var a,s;if(!e)return;let r=!1;const i=c=>{r||n(c)};return(a=e.themes)==null||a.onChanged(i),(s=e.themes)==null||s.getCurrent().then(i).catch(console.warn),()=>{r=!0}},[e]),{currentTheme:t,selectTheme:o}};function g0(e,t=500){const[n,o]=v.useState(e);return v.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>clearTimeout(r)},[e,t]),n}function Ve(){return v.useMemo(()=>typeof window=="object"&&$r(),[])}function Ok(e,t){v.useEffect(()=>{const n=o=>{o.code===e&&t()};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},[e,t])}const Ak=()=>{const e=v.useContext(Te.IOConnectContext),[t,n]=v.useState([]);return v.useEffect(()=>{var o;e&&((o=e.themes)==null||o.list().then(n).catch(console.warn))},[e]),t},_t=v.forwardRef(({id:e,className:t,name:n="toggle",align:o="left",label:r,checked:i,disabled:a,onKeyDown:s,"data-testid":c="toggle",...u},d)=>{const f=Na(),p=e||`toggle-${f}`,h=Q("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsx("div",{className:h,children:l.jsxs("label",{className:"io-toggle",htmlFor:p,tabIndex:a?-1:0,onKeyDown:s,"data-testid":`${c}-label`,children:[l.jsx("input",{type:"checkbox",id:p,className:"io-checkbox",ref:d,name:n,checked:i,disabled:a,"aria-checked":i,tabIndex:-1,"data-testid":c,...u}),l.jsx("span",{className:"slider","data-testid":`${c}-slider`}),r]})})});function ts(e){return{name:e.name,title:e.title,hidden:e.isHidden,userProperties:e.customProperties}}function ns(e){return{name:e.name,title:e.title,hidden:e.hidden,userProperties:e.userProperties}}_t.displayName="Toggle";const Fo={getMyApplication:async function(e){var t,n;if(e)try{const o=e.apps;if(o){const i=(t=o.my)==null?void 0:t.appName;if(!i)return;const a=await o.registry.get({name:i});return a?ts(a):void 0}const r=(n=e.appManager)==null?void 0:n.myApplication;return r?ns(r):void 0}catch(o){return void console.error("Failed to get my application",o)}},getApplications:async function(e){var t,n;if(!e)return[];try{const o=(t=e.apps)==null?void 0:t.registry;return o?(await o.getMany()??[]).map(a=>ts(a)):(((n=e.appManager)==null?void 0:n.applications())??[]).map(i=>ns(i))}catch(o){console.error("Failed to get applications",o)}return[]},startApplication:async function(e,t,n){var o,r;if(e)try{const i=e.apps;if(i){await((o=i.registry)==null?void 0:o.get({name:t}))||console.error(`Application "${t}" not found in registry`);const s=i.instances;return s?void await s.start({name:t,...n}):void console.error("io.apps.instances API is not available")}const a=(r=e.appManager)==null?void 0:r.application(t);if(!a)return void console.error(`Application "${t}" not found`);await a.start(n)}catch(i){return void console.error(`Failed to start application "${t}"`,i)}},stopApplication:async function(e,t,n){if(e)try{const o=e.apps;if(o){const i=o.instances;return i?void await i.stop({id:t.id,force:n==null?void 0:n.force,reason:n==null?void 0:n.reason,timeout:n==null?void 0:n.timeout}):void console.error("io.apps.instances API is not available")}const r=e.appManager.instances().find(i=>i.id===t.id);if(!r)return void console.error(`Instance "${t.id}" not found`);await r.stop()}catch(o){return void console.error(`Failed to stop application instance "${t.id}"`,o)}},onAppAdded:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onAdded(({app:a})=>{const s=ts(a);t(s)}):(o=e.appManager)==null?void 0:o.onAppAdded(a=>{const s=ns(a);t(s)})}catch(r){return void console.error("Failed to subscribe to app added events",r)}},onAppRemoved:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onRemoved(({appName:a})=>{t({name:a})}):(o=e.appManager)==null?void 0:o.onAppRemoved(a=>{t({name:a.name})})}catch(r){return void console.error("Failed to subscribe to app removed events",r)}},onAppChanged:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onUpdated(a=>{const s=ts(a.app);t(s)}):(o=e.appManager)==null?void 0:o.onAppChanged(a=>{const s=ns(a);t(s)})}catch(r){return void console.error("Failed to subscribe to app changed events",r)}},restartPlatform:async function(e,t=!0){var o,r;if(!e)return;const n={autoSave:t,showDialog:!0};try{if((o=e.platform)!=null&&o.restart)return void await e.platform.restart(n);await((r=e.appManager)==null?void 0:r.restart(n))}catch(i){console.error("Failed to restart platform",i)}},shutdownPlatform:async function(e,t=!0){var o,r;if(!e)return;const n={autoSave:t,showDialog:!0};try{if((o=e.platform)!=null&&o.shutdown)return void await e.platform.shutdown(n);await((r=e.appManager)==null?void 0:r.exit(n))}catch(i){console.error("Failed to shutdown platform",i)}}},Pk={minimizeWindow:async function(e){var t;if(e)try{const n=(t=e.windows)==null?void 0:t.my();await(n==null?void 0:n.minimize())}catch(n){console.error("Failed to minimize window",n)}},closeWindow:async function(e,t){var n;if(e)try{const o=(n=e.windows)==null?void 0:n.my();await(o==null?void 0:o.close(t))}catch(o){console.error("Failed to close window",o)}},restartPlatform:Fo.restartPlatform,shutdownPlatform:Fo.shutdownPlatform};v.createContext({theme:"dark"});const y0=v.createContext(void 0),v0=()=>{const e=v.useContext(y0);if(!e)throw new Error("usePanelManagerContext must be used within a PanelManagerContext.Provider");return e},w0=e=>{const{General:t,Launchpad:n,Layouts:o,Downloads:r,System:i}=yo();return l.jsxs(ar,{element:bi,elementProps:e,children:[l.jsx(t,{}),l.jsx(n,{}),l.jsx(o,{}),l.jsx(r,{}),l.jsx(i,{})]})},b0=({title:e="General",...t})=>{const{Theme:n}=yo();return l.jsx(et,{title:e,...t,children:l.jsx(n,{})})},Dc=({className:e,title:t="Theme",...n})=>{const{currentTheme:o,selectTheme:r}=_k(),i=Ak();return l.jsxs("div",{className:Q("flex jc-between ai-center",e),"data-testid":"theme-container",...n,children:[l.jsx("label",{className:"io-text-clipper","data-testid":"theme-label",children:t}),l.jsxs(fe,{variant:"light","data-testid":"theme-dropdown",children:[l.jsx(fe.Button,{text:(o==null?void 0:o.displayName)??"Dark","data-testid":"theme-dropdown-button"}),l.jsx(fe.Content,{"data-testid":"theme-dropdown-content",children:l.jsx(fe.List,{children:i.map(({displayName:a,name:s})=>l.jsx(fe.Item,{onClick:()=>r(s),"data-testid":`theme-dropdown-item-${s}`,children:a},s))})})]})]})},Zt=({prefKey:e,...t})=>{const{isLoading:n,value:o=!1,update:r}=Mt({prefKey:e});return l.jsx(_t,{checked:o,disabled:n,onChange:i=>r(i.target.checked),...t})},x0=({align:e="right",label:t="Minimize to tray",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:oy,...n}),Nk=({prefKey:e,options:t,disabled:n,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Mt({prefKey:e});return l.jsxs(fe,{variant:"light",disabled:r||n,...o,children:[l.jsx(fe.Button,{children:i}),l.jsx(fe.Content,{children:l.jsx(fe.List,{children:t.map(s=>l.jsx(fe.Item,{onClick:()=>(async c=>{if(c!==i)try{await a(c)}catch(u){console.error("Failed to update platform preference:",u)}})(s),children:s},s))})})]})},k0=({className:e,label:t="Pinned position",...n})=>l.jsx(et,{className:Q("io-block-list-gap",e),...n,children:l.jsxs("div",{className:"flex jc-between ai-center",children:[l.jsx("label",{className:"io-text-clipper",children:t}),l.jsx(Nk,{className:e,prefKey:iy,options:["Left","Right"],...n})]})}),S0=({align:e="right",label:t='Hide "Favorites"',...n})=>l.jsx(Zt,{align:e,label:t,prefKey:Dd,...n}),C0=({align:e="right",label:t="Allow docking to top",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:ay,...n}),E0=({align:e="right",label:t="Always on top",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:sy,...n}),j0=({align:e="right",label:t="Claim occupied space",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:cy,...n}),_0=({align:e="right",label:t="Show the extended Launchpad area",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:Pa,...n}),O0=({align:e="right",label:t="Hide labels",...n})=>{const{value:o}=Mt({prefKey:Pa});return l.jsx(Zt,{align:e,label:t,prefKey:ly,disabled:!o,...n})},A0=({align:e="right",label:t='Show "Favorites"',...n})=>{const{value:o}=Mt({prefKey:Pa});return l.jsx(Zt,{align:e,label:t,prefKey:uy,disabled:!o,...n})},P0=({align:e="right",label:t='Show "Recent"',...n})=>{const{value:o}=Mt({prefKey:Pa});return l.jsx(Zt,{align:e,label:t,prefKey:dy,disabled:!o,...n})},N0=({title:e="Layouts",...t})=>{const{LayoutsSaveCurrentOnExit:n,LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=yo();return l.jsxs(et,{title:e,...t,children:[l.jsx(n,{}),l.jsx(r,{}),l.jsx(o,{})]})},T0=({align:e="right",label:t="Save current on exit",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:py,...n}),Mc=({align:e="right",label:t="Show prompt for unsaved changes",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:hy,"data-testid":"layouts-show-unsaved-changes-prompt-toggle-button",...n}),$c=({align:e="right",label:t="Show prompt for deleting",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:Md,"data-testid":"layouts-show-delete-prompt-toggle",...n}),I0=({title:e="Downloads",...t})=>{const{DownloadsLocation:n}=yo();return l.jsx(et,{title:e,...t,children:l.jsx(n,{})})};function R0({title:e="Downloads"}){const{ItemSearch:t,HeaderButtons:n}=Ia();return l.jsxs("div",{className:"io-dm-header",children:[l.jsxs(cn,{draggable:!0,children:[l.jsx(cn.Title,{tag:"h1",text:e,size:"large"}),l.jsx(n,{className:"non-draggable"})]}),l.jsx(t,{})]})}const rn=window.glue42gd,L0=v.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),wo=()=>v.useContext(L0);function D0({className:e,placeholder:t="Search",iconPrepend:n="search",iconAppend:o="close",...r}){const i=Q("io-header-search",e),a=v.useRef(null),{searchQuery:s,setSearch:c,itemsCount:u}=wo(),d=s.length>0,f=v.useCallback(()=>{c(""),a.current&&a.current.focus()},[c]);return l.jsxs("div",{className:i,children:[l.jsx(tr,{ref:a,value:s,iconPrepend:n,iconAppend:d?o:void 0,iconAppendOnClick:d?f:void 0,placeholder:t,onChange:p=>c(p.target.value),...r}),d&&l.jsx("p",{className:"io-header-search-count",children:`${u} results`})]})}function M0({className:e,...t}){const{MoreButton:n,CloseButton:o,ExternalButton:r}=Ia();return l.jsxs(Be,{className:e,align:"right",...t,children:[l.jsx(n,{}),l.jsx(r,{}),l.jsx(o,{})]})}function $0({icon:e="ellipsis-vertical",...t}){const{items:n,clearItems:o,showSettings:r}=wo(),i=n.length===0;return l.jsxs(fe,{variant:"light",...t,children:[l.jsx(fe.ButtonIcon,{icon:e,variant:"circle",size:"32"}),l.jsx(fe.Content,{children:l.jsxs(fe.List,{children:[l.jsx(fe.Item,{onClick:a=>(s=>{i?s.stopPropagation():o()})(a),disabled:i,children:"Clear All"}),l.jsx(fe.Item,{onClick:r,children:"Settings"})]})})]})}function H0({className:e,icon:t="pop-out",...n}){const o=v.useContext(Te.IOConnectContext),r=v.useCallback(()=>{Fo.startApplication(o,"io-connect-download-manager").catch(i=>{console.error("Failed to open Download Manager",i)})},[o]);return l.jsx(We,{className:Q("io-dm-compact-mode-only",e),icon:t,variant:"circle",size:"32",onClick:r,...n})}function B0({icon:e="close",size:t="32",variant:n="circle",onClick:o,...r}){const i=v.useContext(Te.IOConnectContext);return l.jsx(We,{icon:e,size:t,variant:n,onClick:a=>{o?o(a):Pk.closeWindow(i).catch(s=>{console.error("Failed to close window:",s)})},...r})}function Ur(e,t=!1,n=!1,o=!1){const r=e.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],a=e.getFullYear(),s=e.getHours(),c=e.getMinutes();let u="";return u=c<10?`0${c}`:`${c}`,t?t==="Today"?n?"Today":`Today at ${s}:${u}`:t==="Yesterday"?n?"Yesterday":`Yesterday at ${s}:${u}`:`${s}:${u}`:o?n?`${i} ${r}`:`${i} ${r} at ${s}:${u}`:n?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${s}:${u}`}function z0(e,t={showTime:!0}){const n=new Date(1e3*e),o=new Date,r=Math.round((o-n)/1e3),i=Math.round(r/60),a=o.toDateString()===n.toDateString(),s=new Date(o.setDate(o.getDate()-1)).toDateString()===n.toDateString(),c=o.getFullYear()===n.getFullYear();return t.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?Ur(n,"Today",!1,!0):s?Ur(n,"Yesterday",!1,!0):c?Ur(n,!1,!1,!0):Ur(n):a?"Today":s?"Yesterday":c?Ur(n,!1,!0,!0):Ur(n,!1,!0)}function F0({className:e,...t}){const n=Q("io-dm-body","io-panel-body",e),{DownloadListEmpty:o,ItemGroup:r,Item:i}=Ia(),{items:a,searchQuery:s,setCount:c,sortItems:u}=wo(),d=u(a),f=g0(s),p=v.useMemo(()=>d.filter(g=>g.displayInfo.filename.toLowerCase().includes(f.toLowerCase())||g.displayInfo.url.toLowerCase().includes(f.toLowerCase())),[d,f]),h=v.useMemo(()=>p.map(g=>({...g,displayInfo:{...g.displayInfo,startTime:z0(g.displayInfo.startTime,{showTime:!1})}})),[p]),m=v.useMemo(()=>Object.values(h.reduce((g={},y)=>{var b;return g[y.displayInfo.startTime]=((b=g[y.displayInfo.startTime])==null?void 0:b.concat([]))??[],g[y.displayInfo.startTime].push(y),g},{})),[h]);return v.useEffect(()=>{c(p.length)},[p,c]),l.jsx(ar,{elementProps:{className:n,...t},children:m&&m.length!==0?m.map(g=>l.jsx(r,{title:String(g[0].displayInfo.startTime)??null,children:g.map(y=>l.jsx(i,{item:y},y.id))},g[0].id??"")):l.jsx(o,{})})}function W0({className:e,icon:t="download",text:n="No downloads to display.",...o}){const r=Q("io-dm-no-items",e);return l.jsxs("div",{className:r,...o,children:[l.jsx(xt,{variant:t}),l.jsx("p",{children:n})]})}function U0({className:e,title:t,children:n,...o}){const r=Q("io-dm-item-group",e);return l.jsxs("div",{className:r,...o,children:[t&&l.jsx("p",{className:"io-dm-items-group-title",children:t}),n]})}function V0({className:e,item:t,...n}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=Ia(),{state:a,url:s,filename:c,receivedBytes:u,totalBytes:d,speed:f,timeRemaining:p}=t.displayInfo;if(!t)return l.jsx(l.Fragment,{});const h=Q("io-dm-item",t.displayInfo.state&&[a],e);return l.jsxs("div",{className:h,...n,children:[l.jsx(o,{itemID:t.id,filename:c,state:a}),l.jsx(r,{state:a,url:s,bytesReceived:u,bytesTotal:d,speed:f,timeRemaining:p}),l.jsx(i,{itemID:t.id,state:a})]})}function af({bytesReceived:e=0,bytesTotal:t=0,...n}){const o=v.useCallback(()=>e&&t?Math.round(e/t*100):0,[e,t]);return l.jsx(W2,{value:o(),...n})}function K0({className:e,itemID:t,filename:n,state:o,pauseResume:r,showInFolder:i,cancel:a,remove:s,...c}){const u=Q("io-dm-item-header",e),{pauseResumeItem:d,showItemInFolder:f,cancelItem:p,removeItem:h}=wo(),m=o==="progressing"||o==="paused",g=o==="interrupted"||o==="cancelled",y=m?"Cancel Download":"Remove Download",b=a??p,k=s??h,x=function(w,C,O,_){return w==="paused"||w==="progressing"?{statusIcon:w==="paused"?"play":"pause",onStatusActionClick:()=>O(C)}:w==="completed"?{statusIcon:"folder",onStatusActionClick:()=>_(C)}:null}(o,t,r??d,i??f),S=v.useCallback(()=>{m?b(t):k(t)},[m,b,t,k]);return l.jsxs("div",{className:u,...c,children:[l.jsx(Xn,{text:n,style:{textDecoration:g?"line-through":"none"}}),l.jsxs(Be,{children:[x&&l.jsx(We,{icon:x.statusIcon,iconSize:"12",onClick:x.onStatusActionClick,className:"io-dm-compact-mode-only"}),l.jsx(We,{icon:"close",iconSize:"12",title:y,onClick:S})]})]})}function G0({className:e,state:t,url:n,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...s}){const c=Q("io-dm-item-body",e),u=p=>{const h=["Bytes","KB","MB","GB","TB"];if(p===0)return"0";const m=Math.floor(Math.log(p)/Math.log(1024));return m===0?`${p}${h[m]}`:`${(p/1024**m).toFixed(1)}${h[m]}`};return l.jsxs("div",{className:c,...s,children:[l.jsx("p",{className:"io-text-small",children:n}),(f=t,f==="cancelled"||f==="interrupted"||f==="completed"?null:l.jsx(af,{variant:f==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),l.jsx("p",{className:"io-text-default-lh16",children:t==="completed"?`${u(o??0)} - Done`:t==="cancelled"||t==="interrupted"?`${u(o??0)}/${u(r??0)} - Failed`:`${u(o??0)}/${u(r??0)} (${d=i,(d?`${(d/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(p=>{const h=Math.floor(p/3600),m=Math.floor(p%3600/60);let g="";return h>0&&(g+=`${h} hour${h>1?"s":""}, `),m>0&&(g+=`${m} min${m>1?"s":""}, `),((p=Math.floor(p%60))>0||g==="")&&(g+=`${p} sec${p===1?"":"s"}`),`${g.trim()} left`})(a)??0}`})]});var d,f}const Tk={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function vl({className:e,variant:t,text:n}){const o=Q("io-dm-item-status",`io-dm-item-status-${t}`,e);return l.jsxs("div",{className:o,children:[t&&l.jsx(xt,{variant:Tk[t],className:"icon-severity",size:"10"}),n&&l.jsx("p",{className:"io-text-smaller",children:n})]})}function q0({className:e,itemID:t,state:n,pauseResume:o,showInFolder:r,cancel:i,...a}){const s=Q("io-dm-item-footer",e),{pauseResumeItem:c,showItemInFolder:u,cancelItem:d}=wo(),f=v.useCallback(m=>{o?o(m):c(m)},[o,c]),p=v.useCallback(m=>{r?r(m):u(m)},[r,u]),h=v.useCallback(m=>{i?i(m):d(m)},[i,d]);return l.jsx("div",{className:s,...a,children:(()=>{switch(n){case"progressing":return l.jsxs(Be,{align:"right",children:[l.jsx(Be.Button,{variant:"primary",text:"Pause",onClick:()=>f(t)}),l.jsx(Be.Button,{variant:"link",text:"Cancel",onClick:()=>h(t)})]});case"paused":return l.jsx(Be,{align:"right",children:l.jsx(Be.Button,{variant:"primary",text:"Resume",onClick:()=>f(t)})});case"completed":return l.jsxs(l.Fragment,{children:[l.jsx(vl,{variant:"success",text:"Complete"}),l.jsx(Be,{align:"right",children:l.jsx(Be.Button,{variant:"primary",text:"Show in Folder",onClick:()=>p(t)})})]});case"cancelled":return l.jsx(vl,{variant:"warning",text:"Cancelled"});case"interrupted":return l.jsxs(l.Fragment,{children:[l.jsx(vl,{variant:"critical",text:"Failed"}),l.jsx(Be,{align:"right",children:l.jsx(Be.Button,{variant:"primary",text:"Retry",onClick:()=>f(t)})})]});default:return null}})()})}function J0({className:e,title:t="Download Settings",...n}){const o=Q("io-dm-settings-panel",e),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:s,isDownloadLocationDialogVisible:c,downloadLocationList:u}=wo();return l.jsxs(ot,{className:o,...n,children:[l.jsxs(ot.Header,{children:[l.jsx(ot.Header.Title,{size:"large",text:t,tag:"h1"}),l.jsx(ot.Header.ButtonGroup,{children:l.jsx(We,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:c})})]}),l.jsx(ot.Body,{children:l.jsxs(Be,{children:[l.jsxs(fe,{variant:"light",disabled:c,children:[l.jsx(fe.Button,{children:l.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??u[0]})}),u.length>1&&l.jsx(fe.Content,{children:l.jsx(fe.List,{children:u.map((d,f)=>!d||f===0||f>3?null:l.jsx(fe.Item,{onClick:()=>{a(d)},children:d},d))})})]}),l.jsx(tt,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{s()},disabled:c})]})})]})}const Z0={Header:R0,ItemSearch:D0,HeaderButtons:M0,MoreButton:$0,ExternalButton:H0,CloseButton:B0,Body:F0,DownloadListEmpty:W0,ItemGroup:U0,Item:V0,ItemProgress:af,ItemHeader:K0,ItemBody:G0,ItemFooter:q0,Settings:J0},Y0=v.createContext(Z0),X0=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Z0,...t}),[t]);return l.jsx(Y0.Provider,{value:n,children:e})});X0.displayName="ComponentsStore";const Ia=()=>v.useContext(Y0);function Ik({className:e,...t}){const n=Q("io-dm",e),{Header:o,Body:r,Settings:i}=Ia(),{isSettingsVisible:a}=wo();return l.jsxs(ot,{className:n,...t,children:[l.jsx(o,{}),l.jsx(r,{}),a&&l.jsx(i,{})]})}var Rk=Object.freeze({__proto__:null,Body:F0,CloseButton:B0,DownloadListEmpty:W0,DownloadManager:function({components:e,...t}){return l.jsx(X0,{components:e,children:l.jsx(Ik,{...t})})},DownloadManagerProvider:({children:e})=>{const{configuration:t,items:n,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:s,isSettingsVisible:c,showSettings:u,hideSettings:d,searchQuery:f,setSearch:p,itemsCount:h,setCount:m,setDownloadLocation:g,setDownloadLocationWithDialog:y,sortItems:b,isDownloadLocationDialogVisible:k,downloadLocationList:x}=function(){const[w,C]=v.useState({}),[O,_]=v.useState([]),[N,E]=v.useState(0),[A,j]=v.useState([]),[B,$]=v.useState(""),[R,F]=v.useState(!1),[z,V]=v.useState(!1),[L,H]=v.useState({filePaths:[],canceled:!1});v.useEffect(()=>{if(!rn)return;const U=rn.downloads.onUpdate(D=>_(T=>W(T,D))),Y=rn.downloads.onConfigurationChanged(D=>{C(D)});return rn.downloads.list().then(_).catch(console.error),rn.downloads.getSavePathList().then(D=>{let T=null;const P=D==null?void 0:D.pathList;Array.isArray(D)?T=D.filter(I=>typeof I=="string"):Array.isArray(P)&&(T=P.filter(I=>typeof I=="string")),T!==null&&j(T)}).catch(console.error),()=>{U(),Y()}},[]),v.useEffect(()=>{V(!1)},[L]);const W=(U,Y)=>{const D=U.findIndex(P=>P.id===Y.id);if(D===-1)return[Y,...U];const T=[...U];return T[D]=Y,T};return{items:O,setCount:U=>{E(U)},sortItems:(U,Y=!0)=>[...U].sort((D,T)=>{const P=D.displayInfo.startTime-T.displayInfo.startTime;return Y?-P:P}),setSearch:U=>{$(U)},cancelItem:async U=>{try{await rn.downloads.cancel(U)}catch(Y){console.error(Y)}},removeItem:async U=>{try{_(Y=>Y.filter(D=>D.id!==U)),await rn.downloads.removeItem(U)}catch(Y){console.error(Y)}},clearItems:async()=>{try{_([]),await rn.downloads.clearDownloadList()}catch(U){console.error(U)}},itemsCount:N,searchQuery:B,showSettings:()=>{F(!0)},hideSettings:()=>{F(!1)},configuration:w,isSettingsVisible:R,pauseResumeItem:async U=>{try{await rn.downloads.pauseResume(U)}catch(Y){console.error(Y)}},showItemInFolder:async U=>{try{await rn.downloads.showInFolder(U)}catch(Y){console.error(Y)}},setDownloadLocation:async U=>{try{await rn.downloads.setSavePath(U),j(Y=>{if(Y.includes(U)){const D=Y.filter(T=>T!==U);return[U,...D]}return[U,...Y]})}catch(Y){console.error(Y)}},downloadLocationList:A,isDownloadLocationDialogVisible:z,setDownloadLocationWithDialog:async()=>{V(!0);try{const U=await rn.downloads.showOpenDialog();if(H(U),!(U!=null&&U.filePaths)||U.filePaths.length===0)return;await rn.downloads.setSavePath(U.filePaths[0]),j(Y=>{if(Y.includes(U.filePaths[0])){const D=Y.filter(T=>T!==U.filePaths[0]);return[U.filePaths[0],...D]}return[U.filePaths[0],...Y]})}catch(U){console.error(U)}}}}(),S=v.useMemo(()=>({configuration:t,items:n,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:s,isSettingsVisible:c,showSettings:u,hideSettings:d,searchQuery:f,setSearch:p,itemsCount:h,setCount:m,setDownloadLocation:g,setDownloadLocationWithDialog:y,sortItems:b,isDownloadLocationDialogVisible:k,downloadLocationList:x}),[t,n,o,r,i,s,a,c,u,d,f,p,h,m,g,y,b,k,x]);return l.jsx(L0.Provider,{value:S,children:e})},ExternalButton:H0,Header:R0,HeaderButtons:M0,Item:V0,ItemBody:G0,ItemFooter:q0,ItemGroup:U0,ItemHeader:K0,ItemProgress:af,ItemSearch:D0,MoreButton:$0,Settings:J0,useDownloadManagerContext:wo});const Q0=({className:e,label:t="Location",...n})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=wo();return l.jsxs(et,{className:Q("io-preferences-download-section",e),...n,children:[l.jsxs("div",{className:"flex jc-between ai-center",children:[l.jsx("label",{className:"io-text-clipper",children:t}),l.jsx(tt,{text:"Change",onClick:r,disabled:i})]}),l.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},ev=({align:e="right",label:t="Ask where to save each file before downloading",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:my,...n}),tv=({title:e="System",...t})=>{const{SystemRestartSection:n,SystemShutdownSection:o}=yo();return l.jsxs(et,{title:e,...t,children:[l.jsx(n,{}),l.jsx(o,{})]})},hh="T42.GD.Execute",nv=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ov=(e,t)=>e in t;function Lk({time:e,frequency:t,day:n}){const[o,r]=e.split(":"),i=Number.parseInt(o,10),a=Number.parseInt(r,10);let s="*";return t==="weekly"&&n&&(s=function(c){const u={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!ov(c,u))throw new Error(`Invalid day: ${c}`);return u[c]}(n).toString()),`${a} ${i} * * ${s}`}function Dk(e){const t=v.useContext(Te.IOConnectContext),{value:n,update:o}=Mt({prefKey:os(e)}),{value:r,update:i}=Mt({prefKey:os(e,"Time")}),{value:a,update:s}=Mt({prefKey:os(e,"Frequency")}),{value:c,update:u}=Mt({prefKey:os(e,"Day")}),d=v.useCallback(async()=>{try{await t.interop.invoke(hh,{command:`cancel-${e}`})}catch(p){console.error(p)}},[t,e]),f=v.useCallback(async()=>{try{const p=Lk({time:r??"12:00",frequency:a??"daily",day:a==="weekly"?c:"*"});await t.interop.invoke(hh,{command:`schedule-${e}`,args:{cronTime:p,discardUnsavedLayoutChanges:!1}})}catch(p){console.error(`Failed to update cron job for ${e}:`,p)}},[t,e,r,a,c]);return v.useEffect(()=>{t&&n&&f()},[t,n,r,a,c,f]),{enabled:n??!1,time:r??"12:00",frequency:a??"daily",day:c??"Monday",setEnabled:async p=>{p||await d();try{await o(p)}catch(h){console.error("Failed to update enabled state:",h)}},setTime:async p=>{try{await i(p)}catch(h){console.error("Failed to update time:",h)}},setFrequency:async p=>{try{await s(p),p==="daily"&&await u(void 0)}catch(h){console.error("Failed to update frequency:",h)}},setDay:async p=>{var h;if(h=p,nv.includes(h))try{await u(p)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function os(e,t){const n=e==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return t?`${n}${t}`:n}function rv({className:e,variant:t,...n}){const o=Q("io-block-list-gap",t,e),{enabled:r,time:i,frequency:a,day:s,setEnabled:c,setTime:u,setFrequency:d,setDay:f}=Dk(t);return l.jsxs(et,{className:o,...n,children:[l.jsx(_t,{label:`Schedule ${t}`,align:"right",onChange:p=>c(p.target.checked),checked:r}),l.jsxs("div",{className:"scheduler-controls",children:[l.jsx("div",{className:"io-control-input io-control-leading-icon direction-up",children:l.jsx("input",{type:"time",className:"io-input",value:i,onChange:p=>u(p.target.value)})}),l.jsxs(Rn,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[l.jsx(Rn.Item,{onClick:()=>d("daily"),children:"Daily"}),l.jsx(Rn.Item,{onClick:()=>d("weekly"),children:"Weekly"})]}),a==="weekly"&&l.jsx(Rn,{text:s,icon:"chevron-down",iconRight:!0,children:nv.map(p=>l.jsx(Rn.Item,{onClick:()=>f(p),children:p},p))})]})]})}function iv({className:e,...t}){return l.jsx(rv,{...t,className:e,variant:"restart"})}function av({className:e,...t}){return l.jsx(rv,{...t,className:e,variant:"shutdown"})}const sv={Body:w0,General:b0,Theme:Dc,Launchpad:({title:e="Launchpad",...t})=>{const{MinimizeToTray:n,PinnedPosition:o,HideFavoritesFromLaunchpad:r,Docking:i,ExtendedArea:a}=yo();return l.jsxs(et,{title:e,...t,children:[l.jsx(n,{}),l.jsx(o,{}),l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{})]})},MinimizeToTray:x0,PinnedPosition:k0,HideFavoritesFromLaunchpad:S0,Docking:({className:e,title:t="Docking",...n})=>{const o=Q("io-preferences-panel-docking",e),{AllowDocking:r,DockedAlwaysOnTop:i,DockedClaimsSpace:a}=yo();return l.jsxs(et,{className:o,title:t,...n,children:[l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{})]})},AllowDocking:C0,DockedAlwaysOnTop:E0,DockedClaimsSpace:j0,ExtendedArea:({className:e,title:t="Extended Area",...n})=>{const o=Q("io-preferences-panel-extended-area",e),{ShowExtendedArea:r,HideLabelsInExtendedArea:i,ShowFavoritesInExtendedArea:a,ShowRecentAppsInExtendedArea:s}=yo();return l.jsxs(et,{className:o,title:t,...n,children:[l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{}),l.jsx(s,{})]})},ShowExtendedArea:_0,HideLabelsInExtendedArea:O0,ShowFavoritesInExtendedArea:A0,ShowRecentAppsInExtendedArea:P0,Layouts:N0,LayoutsSaveCurrentOnExit:T0,LayoutsShowUnsavedChangesPrompt:Mc,LayoutsShowDeletePrompt:$c,Downloads:I0,DownloadsLocation:Q0,DownloadsAskForEachDownload:ev,System:tv,SystemRestartSection:iv,SystemShutdownSection:av},cv=v.createContext(sv),lv=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...sv,...t}),[t]);return l.jsx(cv.Provider,{value:n,children:e})});lv.displayName="PreferencesPanelComponentsStoreProvider";const yo=()=>v.useContext(cv),uv=({className:e,onClose:t,title:n="Platform Preferences",children:o,...r})=>l.jsxs(ot,{className:Q("io-preferences-panel",e),"data-testid":"preferences-panel",...r,children:[l.jsxs(ot.Header,{"data-testid":"preferences-panel-header",children:[l.jsx(ot.Header.Title,{size:"large",text:n,tag:"h1","data-testid":"preferences-panel-title"}),l.jsx(ot.Header.ButtonGroup,{children:l.jsx(ot.Header.ButtonIcon,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:t,"data-testid":"preferences-panel-close-button"})})]}),o]}),Mk=({onClose:e,title:t="Platform Preferences",...n})=>{const{Body:o}=yo();return l.jsx(uv,{title:t,onClose:e,...n,children:l.jsx(o,{})})},dv=({components:e,...t})=>l.jsx(lv,{components:e,children:l.jsx(Mk,{...t})});function fv({className:e,title:t="General",...n}){const o=Q("io-notifications-settings-panel-general",e),{AllowNotifications:r,AllowNotificationToasts:i,ShowNotificationBadge:a,CloseNotificationOnClick:s,PanelAutoHide:c,HideToastsAfter:u}=Br(),d=Ve();return l.jsx("div",{className:o,...n,children:l.jsxs(et,{title:t,children:[d&&l.jsx(r,{}),d&&l.jsx(i,{}),l.jsx(a,{}),d&&l.jsx(c,{}),d&&l.jsx(s,{}),d&&l.jsx(u,{})]})})}function Bu(e){if(e&&e.errorHandling&&typeof e.errorHandling!="function"&&e.errorHandling!=="log"&&e.errorHandling!=="silent"&&e.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof e.errorHandling+" was passed");var t=e&&typeof e.errorHandling=="function"&&e.errorHandling,n={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(t)t(a);else{var s='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(e)switch(e.errorHandling){case"log":return console.error(s);case"silent":return;case"throw":throw new Error(s)}console.error(s)}}return{add:function(r,i,a){var s=n[r];return s||(s=[],n[r]=s),s.push(i),a&&setTimeout(function(){a.forEach(function(c){var u;if(!((u=n[r])===null||u===void 0)&&u.includes(i))try{Array.isArray(c)?i.apply(void 0,c):i.apply(void 0,[c])}catch(d){o(d,r)}})},0),function(){var c=n[r];c&&(c=c.reduce(function(u,d,f){return d===i&&u.length===f||u.push(d),u},[]),c.length===0?delete n[r]:n[r]=c)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var s=n[r];if(!s||s.length===0)return[];var c=[];return s.forEach(function(u){try{var d=u.apply(void 0,i);c.push(d)}catch(f){c.push(void 0),o(f,r)}}),c},clear:function(){n={}},clearKey:function(r){n[r]&&delete n[r]}}}Bu.default=Bu;var $k=Ea(Bu),mt=new class{constructor(){jn(this,"subscribed",!1);jn(this,"io");jn(this,"registry",$k());jn(this,"logger");jn(this,"isPanelVisible");jn(this,"notifications",[]);jn(this,"bulkActionsSupported",!1);jn(this,"initPromise")}init(e){return this.initPromise!==void 0||(this.initPromise=(async()=>{var t;if(!this.subscribed){this.subscribed=!0,this.io=e,this.logger=this.io.logger.subLogger("notifications");try{await this.initializeLogger()}catch(n){console.error("Failed to initialize logger with app configuration",n)}this.getBulkActionsSupport();try{await this.subscribe()}catch(n){throw(t=this.logger)==null||t.error("Error during subscription:",n),n}}})()),this.initPromise}async initializeLogger(){var o,r,i,a,s,c;const e=await Fo.getMyApplication(this.io),t=((r=(o=e==null?void 0:e.userProperties)==null?void 0:o.logger)==null?void 0:r.publishLevel)??"error",n=((a=(i=e==null?void 0:e.userProperties)==null?void 0:i.logger)==null?void 0:a.consoleLevel)??"info";(s=this.logger)==null||s.publishLevel(t),(c=this.logger)==null||c.consoleLevel(n)}onPanelVisibilityChanged(e){return this.registry.add("on-panel-visibility-changed",e)}onConfigurationChanged(e){return this.registry.add("on-configuration-changed",e)}onNotificationsChanged(e){return this.registry.add("on-notifications-changed",e)}onCounterChanged(e){return this.registry.add("on-counter-changed",e)}async getNotificationsList(){var t;const e=await((t=this.io)==null?void 0:t.notifications.list());if(!e)throw new Error("io.notifications.list is not supported in this environment.");return e.map(n=>this.attachHandlers(n))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){var e;if(this.isDesktopEnvironment())return(e=this.io)==null?void 0:e.notifications.panel.show()}hidePanel(){var e;if(this.isDesktopEnvironment())return(e=this.io)==null?void 0:e.notifications.panel.hide()}clearAll(){var e,t;return(e=this.logger)==null||e.trace("clearing all notifications"),(t=this.io)==null?void 0:t.notifications.clearAll()}clearAllOld(){var e,t;return(e=this.logger)==null||e.trace("clearing all old notifications"),(t=this.io)==null?void 0:t.notifications.clearOld()}clearMany(e){var n,o,r,i;const t=(n=this.io)==null?void 0:n.notifications;return this.isBulkActionSupported("clearMany")?e.length<1?((o=this.logger)==null||o.trace("no ids provided to clear notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`clearing notifications with ids ${JSON.stringify(e.join(", "))}`),((i=t.clearMany)==null?void 0:i.call(t,e))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(e){var t,n;return(t=this.logger)==null||t.trace(`closing notification with id ${e}`),(n=this.io)==null?void 0:n.notifications.clear(e)}snooze(e,t){var n,o;return(n=this.logger)==null||n.trace(`snoozing notification with id ${e} for ${t}ms`),(o=this.io)==null?void 0:o.notifications.snooze(e,t)}snoozeMany(e,t){var o,r,i,a;const n=(o=this.io)==null?void 0:o.notifications;return this.isBulkActionSupported("snoozeMany")?e.length<1?((r=this.logger)==null||r.trace("no ids provided to snooze notifications"),Promise.resolve()):((i=this.logger)==null||i.trace(`snoozing notifications with ids ${JSON.stringify(e.join(", "))} for ${t}ms`),((a=n.snoozeMany)==null?void 0:a.call(n,e,t))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(e,t){var n,o;return(n=this.logger)==null||n.trace(`setting state of ${e} to ${t}`),(o=this.io)==null?void 0:o.notifications.setState(e,t)}setStates(e,t){var o,r,i,a;const n=(o=this.io)==null?void 0:o.notifications;return this.isBulkActionSupported("setStates")?e.length<1?((r=this.logger)==null||r.trace(`no ids provided to change state to ${t} for notifications`),Promise.resolve()):((i=this.logger)==null||i.trace(`setting state of ${JSON.stringify(e.join(", "))} to ${t}`),((a=n.setStates)==null?void 0:a.call(n,e,t))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){this.bulkActionsSupported=this.isBulkActionSupported("clearMany")&&this.isBulkActionSupported("setStates")&&this.isBulkActionSupported("snoozeMany")}setFilter(e){var t,n;return(t=this.logger)==null||t.trace(`setting filter to ${JSON.stringify(e)}`),(n=this.io)==null?void 0:n.notifications.setFilter(e)}configure(e){var t;return(t=this.io)==null?void 0:t.notifications.configure(e)}async resyncNotifications(){var e,t;try{const n=await this.getNotificationsList();this.notifications=n,this.registry.execute("on-notifications-changed",[...this.notifications]),(e=this.logger)==null||e.trace(`resynced notifications array with ${this.notifications.length} notifications`)}catch(n){(t=this.logger)==null||t.error("Error resyncing notifications list:",n)}}async subscribe(){var t,n,o,r,i,a,s,c,u;(t=this.io)==null||t.notifications.onRaised(d=>{var f;(f=this.logger)==null||f.trace(`received event indicating notification raise: ${JSON.stringify(d)}`),this.attachHandlers(d),this.notifications.unshift(d),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:d},f)=>{var p;(p=this.logger)==null||p.trace(`received event for notification state is changed - "${d}" - "${f==null?void 0:f.toString()}"`),this.notifications=this.notifications.map(h=>{var m;return h.id===d?((m=this.logger)==null||m.trace(`${h.id} - the state is changed from "${h.state}" to "${f==null?void 0:f.toString()}"`),{...h,state:f}):h}),this.registry.execute("on-notifications-changed",this.notifications)});const e=(o=this.io)==null?void 0:o.notifications;e!=null&&e.onDataChanged&&e.onDataChanged((d,f)=>{var h;const p=d.id;(h=this.logger)==null||h.trace(`received event for notification data is changed - "${p}" - "${JSON.stringify(f)}"`),this.notifications=this.notifications.map(m=>{var g;return m.id===p?((g=this.logger)==null||g.trace(`${m.id} - the data is changed from "${JSON.stringify(m.data)}" to "${JSON.stringify(f)}"`),{...m,data:f}):m}),this.registry.execute("on-notifications-changed",this.notifications)}),(r=this.io)==null||r.notifications.onClosed(({id:d})=>{var f;(f=this.logger)==null||f.trace(`received event for notification is closed - "${d}".`),this.notifications=this.notifications.filter(p=>p.id!==d),this.registry.execute("on-notifications-changed",this.notifications)});try{const d=await this.getNotificationsList(),f=new Set(d.map(h=>h.id)),p=this.notifications.filter(h=>!f.has(h.id));this.notifications=[...p,...d],(i=this.logger)==null||i.trace(`initialized with ${d.length} fetched + ${p.length} from events = ${this.notifications.length} total`)}catch(d){(a=this.logger)==null||a.error("Error fetching initial notifications list:",d),(s=this.logger)==null||s.trace(`continuing with ${this.notifications.length} notifications from events`)}(c=this.io)==null||c.notifications.onConfigurationChanged(d=>{var f;(f=this.logger)==null||f.trace(`received event for configuration changed - ${JSON.stringify(d)}.`),this.registry.execute("on-configuration-changed",d)}),this.isDesktopEnvironment()&&((u=this.io)==null||u.notifications.panel.onVisibilityChanged(d=>{var f;(f=this.logger)==null||f.trace(`received event for panel visibility changed to "${d}".`),this.isPanelVisible=d,d&&this.resyncNotifications().catch(p=>{var h;(h=this.logger)==null||h.error("Error resyncing notifications on panel visibility:",p)}),this.registry.execute("on-panel-visibility-changed",d)}))}isDesktopEnvironment(){return typeof globalThis.window=="object"&&(!!globalThis.window.iodesktop||!!globalThis.window.glue42gd)}isBulkActionSupported(e){var n;const t=(n=this.io)==null?void 0:n.notifications;return typeof(t==null?void 0:t[e])=="function"}attachHandlers(e){var n;return(n=e.actions)==null||n.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,s;try{(i=this.logger)==null||i.info(`${e.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(e.id,o.action,r))}catch(c){(s=this.logger)==null||s.error("Error while clicking on action:",c)}}})}),Object.assign(e,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${e.id} - request to change the state from ${e.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(e.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${e.id} - request to change the state from ${e.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(e.id,o)},updateData:async o=>{var i,a,s;(i=this.logger)==null||i.trace(`${e.id} - request to change the data to ${JSON.stringify(o)}`);const r=(a=this.io)==null?void 0:a.notifications;r!=null&&r.updateData?await r.updateData(e.id,o):(s=this.logger)==null||s.warn("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${e.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(e.id,void 0,o))}catch(s){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${e.id}`,s)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${e.id} - was closed.`),this.close(e.id)}})}};function sf(e){const t=v.useContext(Te.IOConnectContext),n=Ve(),[o,r]=v.useState([]),[i,a]=v.useState(0),s="Platform",c=v.useCallback((f="asc")=>{if(n===null)return[];const p=[...o].sort((h,m)=>{const g=(h.title??h.name).toLowerCase(),y=(m.title??m.name).toLowerCase();return f==="asc"?g.localeCompare(y):y.localeCompare(g)});if(!n){const h=p.findIndex(m=>m.name===s);if(h!==-1){const[m]=p.splice(h,1);p.unshift(m)}}return p},[o,n]),u=v.useMemo(()=>c("asc"),[c]),d=v.useMemo(()=>c("desc"),[c]);return v.useEffect(()=>{if(n===null||n)return;const f={title:"System",name:s,hidden:!1,userProperties:{hidden:!1}};r(p=>p.some(h=>h.name===f.name)?p:[...p,f])},[n]),v.useEffect(()=>{if(!t)return;let f,p,h,m=!1;const g=k=>{r(x=>[...x.filter(S=>S.name!==k.name),{title:k.title??k.name,name:k.name,hidden:k.hidden,userProperties:k.userProperties}])},y=k=>{r(x=>x.filter(S=>S.name!==k.name))},b=k=>{r(x=>x.find(S=>S.name===k.name)?x.map(S=>S.name===k.name?{...S,title:k.title??S.title,hidden:k.hidden??S.hidden,userProperties:k.userProperties??S.userProperties}:S):x)};return(async()=>{const k=await Fo.getApplications(t);if(m)return;r(C=>{const O=new Map;return C.forEach(_=>O.set(_.name,_)),k.forEach(_=>{O.set(_.name,{title:_.title??_.name,name:_.name,hidden:_.hidden,userProperties:_.userProperties})}),Array.from(O.values())});const[x,S,w]=await Promise.all([Fo.onAppAdded(t,g),Fo.onAppRemoved(t,y),Fo.onAppChanged(t,b)]);if(m)return x==null||x(),S==null||S(),void(w==null?void 0:w());f=x,p=S,h=w})().catch(k=>{console.error("Failed to initialize apps",k)}),()=>{m=!0,f==null||f(),p==null||p(),h==null||h()}},[t]),{apps:v.useMemo(()=>{if(!(e!=null&&e.sourceFilter)||!Array.isArray(o))return o;const{allowed:f=[],blocked:p=[]}=e.sourceFilter,h=f.includes("*"),m=p.includes("*");let g=0;const y=o.map(b=>{const k=h||f.includes(b.name),x=!m&&k;return x&&g++,{...b,allowed:x}});return a(g),y},[e,o]),allowedApps:i,sortedAppsAsc:u,sortedAppsDesc:d,sortAppsAlphabetically:c}}function pv(e,t,n){var r;return{notificationStacks:v.useMemo(()=>{var u,d,f,p;if(!t.toastStacking)return[];const i=(a=t.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const s=e.filter(h=>h.state==="Active"),c=new Map;for(const h of s){const m=h[i]??"";if(h.source&&((d=(u=n==null?void 0:n.sourceFilter)==null?void 0:u.muted)!=null&&d.includes(h.source))||(p=(f=n==null?void 0:n.sourceFilter)==null?void 0:f.muted)!=null&&p.includes("*"))continue;c.has(m)||c.set(m,{key:m,items:[]});const g=c.get(m);g&&g.items.unshift(h)}return Array.from(c.values()).filter(h=>h.items.some(m=>m.state==="Active"||m.state==="Stale"))},[e,t.toastStacking,t.stackBy,(r=n==null?void 0:n.sourceFilter)==null?void 0:r.muted])}}function hv(e){const[t,n]=v.useState([]);return{selectedNotifications:t,selectNotification:(o,r)=>{const i=t;n(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=e.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=e.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=e.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=e.map(a=>a.id)}n(i)}else n([])}}}const mh=e=>{var t,n;return{enabledNotifications:e.enable,enabledToasts:e.enableToasts,toastStacking:((t=e.toasts)==null?void 0:t.mode)==="stacked",stackBy:(n=e.toasts)==null?void 0:n.stackBy,toastExpiry:e.toastExpiry,showNotificationBadge:e.showNotificationBadge,placement:e.placement,snooze:e.snooze,closeNotificationOnClick:e.closeNotificationOnClick,autoHidePanel:e.autoHidePanel}},gh=e=>Array.from(e.reduce((t,n)=>t.set(n.id,n),new Map).values());function Hk(){const e=v.useContext(Te.IOConnectContext),[t,n]=v.useState({}),[o,r]=v.useState({}),[i,a]=v.useState([]),[s,c]=v.useState(0),[u,d]=v.useState(!0),{apps:f,allowedApps:p}=sf(t),{notificationStacks:h}=pv(i,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:t.sourceFilter}),{selectedNotifications:m,selectNotification:g,selectAllNotifications:y}=hv(i);v.useEffect(()=>{(async()=>{await mt.init(e),await(async()=>{try{const x=await mt.getConfiguration();n(x),r(S=>({...S,...mh(x)}))}catch(x){console.error("Error fetching configuration:",x)}})(),await(async()=>{try{const x=await mt.getNotificationsList();a(gh(x))}catch(x){console.error("Error fetching notifications:",x)}})()})().catch(x=>{console.error("Error in useNotifications fetch:",x)}),b()},[e]),v.useEffect(()=>{const x=mt.onNotificationsChanged(C=>{a(gh(C))}),S=mt.onConfigurationChanged(C=>{const O=mh(C);n(_=>({..._,...C})),r(_=>({..._,...O}))}),w=mt.onCounterChanged(C=>{c(C)});return()=>{x(),S(),w()}},[]);const b=()=>{d(mt.bulkActionsSupported)},k=async x=>{await mt.setFilter(x)};return{close:x=>mt.close(x),clearAll:()=>mt.clearAll(),settings:o,hidePanel:async()=>{await mt.hidePanel()},showPanel:async()=>{await mt.showPanel()},saveFilter:k,clearAllOld:()=>mt.clearAllOld(),saveSetting:async x=>{const S=((w,C)=>{const O=(E=>({enabledNotifications:A=>({enable:A}),enabledToasts:A=>({enableToasts:A}),toastStacking:A=>{var j;return{toasts:{mode:A?"stacked":"single",stackBy:(j=E.toasts)==null?void 0:j.stackBy}}},stackBy:A=>{var j;return{toasts:{mode:(j=E.toasts)==null?void 0:j.mode,stackBy:A}}},showNotificationBadge:A=>({showNotificationBadge:A}),toastExpiry:A=>({toastExpiry:A}),placement:A=>({placement:A}),snooze:A=>({snooze:A}),closeNotificationOnClick:A=>({closeNotificationOnClick:A}),autoHidePanel:A=>({autoHidePanel:A})}))(C),_=Object.keys(w)[0],N=w[_];return _&&N!==void 0&&O[_]?O[_](N):{}})(x,t);S&&await mt.configure(S)},allApps:f,saveAllFilter:async x=>{"subscribe"in x?await k({allowed:x.subscribe?["*"]:[],blocked:x.subscribe?[]:["*"]}):"mute"in x&&await k({muted:x.mute?["*"]:[]})},configuration:t,notifications:i,notificationStacks:h,notificationsCount:s,allApplications:t.allApplications??0,allowedApplications:p,isBulkActionsSupported:u,selectedNotifications:m,selectNotification:g,selectAllNotifications:y,clearMany:async x=>{await mt.clearMany(x)},snooze:async(x,S)=>{await mt.snooze(x,S)},snoozeMany:async(x,S)=>{await mt.snoozeMany(x,S)},setState:async(x,S)=>{await mt.setState(x,S)},setStates:async(x,S)=>{await mt.setStates(x,S)},setCount:x=>{c(x)},getNotificationsList:async()=>await mt.getNotificationsList()}}const mv=v.createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),Ce=()=>v.useContext(mv);function gv({label:e="Allow notifications",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=v.useCallback(s=>{r({enabledNotifications:s.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:a,checked:o.enabledNotifications??!1,...n}):null}function yv({label:e="Allow notification toasts",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({enabledToasts:c.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:s,checked:o.enabledToasts??!1,disabled:a,...n}):null}function vv({label:e="Show notification badge",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve()&&!o.enabledNotifications,a=v.useCallback(s=>{r({showNotificationBadge:s.target.checked})},[r]);return l.jsx(_t,{label:e,align:t,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...n})}function wv({label:e="Close notification on click",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({closeNotificationOnClick:c.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:s,checked:o.closeNotificationOnClick??!1,disabled:a,...n}):null}function bv({label:e="Auto hide panel",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=v.useCallback(s=>{r({autoHidePanel:s.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:a,checked:o.autoHidePanel??!1,...n}):null}const yh=(e,t)=>e?`${e} ${t}${e!==1?"s":""}`:"",qs=e=>{const t=Math.floor(e/60),n=e%60,o=yh(t,"minute"),r=yh(n,"second");return o+(o&&r?" ":"")+r};function xv({className:e,title:t="Hide toasts after",items:n=[15,30,45,60],...o}){const r=Q("flex","jc-between","ai-center",e),{settings:i,saveSetting:a}=Ce(),s=Ve(),c=s&&!i.enabledNotifications,u=v.useCallback((d=15e3)=>{i.toastExpiry!==d&&a({toastExpiry:1e3*d})},[i.toastExpiry,a]);return s?l.jsxs("div",{className:r,...o,children:[l.jsx("div",{className:"io-text-clipper "+(c?"io-text-disabled":""),children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",disabled:c,children:[l.jsx(fe.Button,{text:qs((i.toastExpiry??0)/1e3)}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:n.map(d=>l.jsx(fe.Item,{onClick:()=>{u(d)},children:qs(d)},d))})})]})]}):null}function kv({className:e,title:t="Stacking",...n}){const o=Q("io-notifications-settings-panel-stacking",e),{ToastStacking:r,ToastStackBy:i}=Br();return Ve()?l.jsx("div",{className:o,...n,children:l.jsxs(et,{title:t,children:[l.jsx(r,{}),l.jsx(i,{})]})}):null}function Sv({label:e="Allow toast stacking",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ve(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({toastStacking:c.target.checked})},[r]);return i?l.jsx(_t,{label:e,align:t,onChange:s,checked:o.toastStacking??!1,disabled:a,...n}):null}const zu={application:"Application",severity:"Priority"},Bk=Object.fromEntries(Object.entries(zu).map(([e,t])=>[t,e]));function Cv({className:e,title:t="Group by",...n}){const o=Q("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ve(),s=a&&!r.enabledNotifications,c=v.useCallback((d="severity")=>{r.stackBy!==d&&i({stackBy:d.toLowerCase()})},[r.stackBy,i]);if(!a)return null;const u=Object.values(zu);return l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:Q("io-text-clipper",{"io-text-disabled":s}),children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",disabled:s,children:[l.jsx(fe.Button,{text:zu[r.stackBy??"severity"]}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:u.map(d=>l.jsx(fe.Item,{onClick:()=>{const f=Bk[d];c(f)},children:d},d))})})]})]})}function Ev({className:e,title:t="Placement",...n}){const o=Q("io-notifications-settings-panel-placement",e),{PlacementPanel:r,PlacementToasts:i}=Br();return Ve()?l.jsx("div",{className:o,...n,children:l.jsxs(et,{title:t,children:[l.jsx(r,{}),l.jsx(i,{})]})}):null}const jv=e=>e.replace(/(^|-)\w/g,t=>t.toUpperCase().replace("-"," "));function _v({className:e,title:t="Panel position",...n}){var c,u;const o=Q("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ve(),s=v.useCallback(d=>{var f;d||(d="right"),((f=r.placement)==null?void 0:f.panel)!==d&&i({placement:{...r.placement,panel:d.toLowerCase()}})},[r.placement,i]);return a?l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:"io-text-clipper",children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",children:[l.jsx(fe.Button,{text:(c=r.placement)!=null&&c.panel?jv((u=r.placement)==null?void 0:u.panel):"Right"}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:["Right","Left"].map(d=>l.jsx(fe.Item,{onClick:()=>{s(d)},children:d},d))})})]})]}):null}function Ov({className:e,title:t="Toasts position",...n}){var c,u;const o=Q("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ve(),s=v.useCallback(d=>{var p;if(d||(d="bottom-right"),((p=r.placement)==null?void 0:p.toasts)===d)return;const f=d.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:f}})},[r.placement,i]);return a?l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:"io-text-clipper",children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",children:[l.jsx(fe.Button,{text:(c=r.placement)!=null&&c.toasts?jv((u=r.placement)==null?void 0:u.toasts):"Bottom Right"}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(d=>l.jsx(fe.Item,{onClick:()=>{s(d)},children:d},d))})})]})]}):null}function Av({className:e,title:t="Snooze",...n}){var a;const o=Q("io-notifications-settings-panel-snooze",e),{SnoozeDuration:r}=Br(),{settings:i}=Ce();return Ve()&&((a=i.snooze)!=null&&a.enabled)?l.jsx("div",{className:o,...n,children:l.jsx(et,{title:t,children:l.jsx(r,{})})}):null}function Pv({className:e,title:t="Default duration",items:n=[60,120,180,300],...o}){var d,f;const r=Q("flex","jc-between","ai-center",e),{settings:i,saveSetting:a}=Ce(),s=Ve(),c=s&&!i.enabledNotifications,u=v.useCallback((p=6e4)=>{var h;i.snooze&&((h=i.snooze)==null?void 0:h.duration)!==p&&a({snooze:{...i.snooze,duration:1e3*p}})},[i.snooze,a]);return s&&((d=i.snooze)!=null&&d.enabled)?l.jsxs("div",{className:r,...o,children:[l.jsx("div",{className:Q("io-text-clipper",{"io-text-disabled":c}),children:l.jsx("span",{children:t})}),l.jsxs(fe,{variant:"light",disabled:c,children:[l.jsx(fe.Button,{text:qs((((f=i.snooze)==null?void 0:f.duration)??0)/1e3)}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",children:n.map(p=>l.jsx(fe.Item,{onClick:()=>{u(p)},children:qs(p)},p))})})]})]}):null}function Nv({className:e,title:t,...n}){const o=Q("io-notifications-settings-panel-subscriptions",e),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:s}=Br(),{sortAppsAlphabetically:c}=sf(),u=Ve(),d=c(),f="io-notifications-subscriptions-grid "+(u?"with-three-columns":"with-two-columns");return l.jsx("div",{className:o,...n,children:l.jsxs(et,{title:t??(u?"Subscribe & Mute":"Subscribe"),children:[l.jsxs("div",{className:f,children:[l.jsx("p",{className:"io-text-section",children:"Sources"}),l.jsx("p",{className:"io-text-section",children:"Subscribe"}),u&&l.jsx("p",{className:"io-text-section",children:"Mute"})]}),l.jsxs("div",{className:f,children:[l.jsx("p",{children:"All Sources"}),l.jsx(r,{label:""}),u&&l.jsx(a,{label:""})]}),d.map(p=>{var h;return!p||p.hidden||(h=p==null?void 0:p.userProperties)!=null&&h.hidden?null:l.jsxs("div",{className:f,children:[l.jsx("p",{children:p.title??p.name}),l.jsx(i,{app:p,label:""}),u&&l.jsx(s,{app:p,label:""})]},p.name)})]})})}function Tv({label:e="All apps",align:t="right",...n}){var c,u,d,f;const{settings:o,configuration:r,saveAllFilter:i}=Ce(),a=Ve()&&!o.enabledNotifications,s=v.useCallback(p=>{i({subscribe:p.target.checked})},[i]);return l.jsx(_t,{align:t,label:e,onChange:s,checked:(((u=(c=r.sourceFilter)==null?void 0:c.allowed)==null?void 0:u.includes("*"))&&((f=(d=r.sourceFilter)==null?void 0:d.blocked)==null?void 0:f.length)===0)??!1,disabled:a,...n})}function Iv({label:e="App",align:t="right",app:n,...o}){var d,f,p,h,m,g;const{allApps:r,settings:i,configuration:a,saveFilter:s}=Ce(),c=Ve()&&!i.enabledNotifications,u=v.useCallback((y,b)=>{var S,w,C,O,_,N;const k={...a.sourceFilter},x=(S=k.allowed)==null?void 0:S.indexOf("*");typeof x=="number"&&x>-1&&((w=k.allowed)==null||w.splice(x,1),r.forEach(E=>{var A;E.name!==b.name&&((A=k.allowed)==null||A.push(E.name))})),y?(k.allowed=[...new Set([...k.allowed??[],b.name])],k.blocked=(C=k.blocked)==null?void 0:C.filter(E=>E!==b.name)):(k.allowed=(O=k.allowed)==null?void 0:O.filter(E=>E!==b.name),k.blocked=[...new Set([...k.blocked??[],b.name])]),(_=k.allowed)!=null&&_.length&&((N=k.blocked)!=null&&N.includes("*"))&&k.blocked.splice(k.blocked.indexOf("*"),1),s(k)},[r,a.sourceFilter,s]);return l.jsx(_t,{id:`subscribe-${n.name}`,label:e,align:t,onChange:y=>u(y.target.checked,n),checked:(((f=(d=a.sourceFilter)==null?void 0:d.allowed)==null?void 0:f.includes("*"))&&!((h=(p=a.sourceFilter)==null?void 0:p.blocked)!=null&&h.includes(n.name))||((g=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:g.includes(n.name)))??!1,disabled:c,...o})}function Rv({label:e="Mute all",align:t="right",...n}){var u,d,f,p;const{settings:o,configuration:r,saveAllFilter:i}=Ce(),a=Ve(),s=a&&(!o.enabledNotifications||((d=(u=r.sourceFilter)==null?void 0:u.allowed)==null?void 0:d.indexOf("*"))===-1),c=v.useCallback(h=>{i({mute:h.target.checked})},[i]);return a?l.jsx(_t,{align:t,label:e,onChange:c,checked:((p=(f=r.sourceFilter)==null?void 0:f.muted)==null?void 0:p.includes("*"))??!1,disabled:s??!1,...n}):null}function Lv({label:e="App",align:t="right",app:n,...o}){var f,p,h,m,g,y,b,k,x,S,w,C,O,_,N,E;const{allApps:r,settings:i,configuration:a,saveFilter:s}=Ce(),c=Ve(),u=c&&(!i.enabledNotifications||((p=(f=a.sourceFilter)==null?void 0:f.blocked)==null?void 0:p.includes("*"))||((m=(h=a.sourceFilter)==null?void 0:h.blocked)==null?void 0:m.includes(n.name))||((y=(g=a.sourceFilter)==null?void 0:g.allowed)==null?void 0:y.length)===0||((k=(b=a.sourceFilter)==null?void 0:b.allowed)==null?void 0:k.indexOf(n.name))===-1&&((S=(x=a.sourceFilter)==null?void 0:x.allowed)==null?void 0:S.indexOf("*"))===-1&&((C=(w=a.sourceFilter)==null?void 0:w.blocked)==null?void 0:C.length)===0),d=v.useCallback((A,j)=>{var R,F,z,V;const B={...a.sourceFilter},$=(R=B==null?void 0:B.muted)==null?void 0:R.indexOf("*");typeof $=="number"&&$>-1&&((F=B.muted)==null||F.splice($,1),r.forEach(L=>{var H;L.name===j.name||L.hidden||((H=B.muted)==null||H.push(L.name))})),A?(z=B.muted)==null||z.push(j.name):B.muted=(V=B.muted)==null?void 0:V.filter(L=>L!==j.name),s(B)},[r,a.sourceFilter,s]);return!c||n.hidden?null:l.jsx(_t,{id:`mute-${n.name}`,label:e,align:t,onChange:A=>d(A.target.checked,n),checked:(((_=(O=a.sourceFilter)==null?void 0:O.muted)==null?void 0:_.includes("*"))||((E=(N=a.sourceFilter)==null?void 0:N.muted)==null?void 0:E.includes(n.name)))??!1,disabled:u??!1,...o})}const Dv={Body:e=>{const{General:t,Placement:n,Stacking:o,Snooze:r,Subscriptions:i}=Br();return l.jsxs(ar,{element:bi,elementProps:e,children:[l.jsx(t,{}),l.jsx(o,{}),l.jsx(n,{}),l.jsx(r,{}),l.jsx(i,{})]})},General:fv,AllowNotifications:gv,AllowNotificationToasts:yv,ShowNotificationBadge:vv,CloseNotificationOnClick:wv,PanelAutoHide:bv,HideToastsAfter:xv,Stacking:kv,ToastStacking:Sv,ToastStackBy:Cv,Placement:Ev,PlacementPanel:_v,PlacementToasts:Ov,Snooze:Av,SnoozeDuration:Pv,Subscriptions:Nv,SubscribeAll:Tv,SubscribeApp:Iv,SubscribeMuteAll:Rv,SubscribeMuteApp:Lv},Mv=v.createContext(Dv),cf=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Dv,...t}),[t]);return l.jsx(Mv.Provider,{value:n,children:e})});cf.displayName="NotificationsSettingsPanelComponentsStoreProvider";const Br=()=>v.useContext(Mv),zk=({className:e,onClose:t,title:n="Notification Settings",...o})=>{const{Body:r}=Br();return l.jsxs(ot,{className:Q("io-notifications-settings-panel",e),"data-testid":"notifications-settings-panel",...o,children:[l.jsxs(ot.Header,{children:[l.jsx(ot.Header.Title,{size:"large",text:n,tag:"h1"}),l.jsx(ot.Header.ButtonGroup,{children:l.jsx(ot.Header.ButtonIcon,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:t})})]}),l.jsx(r,{})]})},lf=({components:e,...t})=>l.jsx(cf,{components:e,children:l.jsx(zk,{...t})}),Fk=({name:e,value:t})=>l.jsxs("div",{className:"io-profile-section-item",children:[l.jsx("div",{className:"io-profile-section-item-name",children:e}),l.jsx("div",{className:"io-profile-section-item-value",children:t})]}),$v=({className:e,items:t,title:n})=>l.jsxs("div",{className:Q("io-profile-section-body",e),children:[n&&l.jsx(Xn,{className:"io-profile-section-title",text:n}),t.map(({name:o,value:r})=>l.jsx(Fk,{name:o,value:r},o))]}),uf=({className:e,items:t,title:n})=>l.jsxs("section",{className:Q("io-profile-section",e),children:[l.jsx($v,{items:t,title:n}),l.jsx(_i,{className:"mt-8"})]}),Hv=({title:e="License",...t})=>l.jsx(uf,{title:e,...t}),Bv=({title:e="Version",...t})=>l.jsx(uf,{title:e,...t}),zv=({title:e="Plugins",...t})=>l.jsx(uf,{title:e,...t}),Fv=({className:e})=>{const t=$r()?"io.Connect Desktop":"io.Connect Browser";return l.jsxs("div",{className:Q("io-trademark-container",e),children:[l.jsx("h4",{className:"io-trademark-title",children:t}),l.jsxs("p",{className:"io-trademark-text",children:[t,"® is a registered trademark of"," ",l.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},Wv=({avatarInitials:e=$r()?"CD":"CB",className:t,items:n,onLogout:o,title:r})=>l.jsxs("section",{className:Q("io-profile-section",t),children:[l.jsxs("div",{className:"io-user-details-container",children:[l.jsx("div",{className:"io-user-avatar",children:e}),l.jsx($v,{className:"mt-12",items:n,title:r})]}),o&&l.jsx(tt,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),l.jsx(_i,{className:"mt-8"})]}),Uv={LicenseSection:Hv,ProductsInfoSection:Bv,PluginsSection:zv,Trademark:Fv,UserSection:Wv},Vv=v.createContext(Uv),Kv=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Uv,...t}),[t]);return l.jsx(Vv.Provider,{value:n,children:e})});Kv.displayName="ProfilePanelComponentsStoreProvider";const Wk=e=>{const t=new Date(e);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(n=>t.toLocaleDateString("en",n)).join(" ")},Uk=e=>{if(!e)return{items:[]};const t=[...e.email?[{name:"Email",value:e.email}]:[],...e.type?[{name:"User Type",value:e.type}]:[],...e.role?[{name:"User Role",value:e.role}]:[],{name:"User ID",value:e.id}];if(e.firstName||e.lastName){const n=[e.firstName,e.lastName].filter(o=>!!o);return{avatarInitials:n.map(o=>o.charAt(0)).join(""),items:t,title:n.join(" ")}}return e.username?{avatarInitials:e.username.charAt(0),items:t,title:e.username}:e.email?{avatarInitials:e.email.charAt(0),items:t}:{items:t}},Vk=e=>{const t=new Date(2023,5,6),n=e.expiration<t.getTime()?1e3:1;return{items:[{name:"Type",value:e.type},{name:"Expiration Date",value:Wk(e.expiration*n)}]}},Kk=e=>({items:e.map(t=>({name:t.name,value:t.version}))}),Gk=e=>{var n;const t={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:e.platform.apiVersion},{name:"io.Connect Browser client",value:e.client.apiVersion},...e.workspaces?[{name:"Workspaces API",value:e.workspaces.apiVersion}]:[],...(n=e.workspaces)!=null&&n.container&&ov(e.workspaces.container.type,t)?[{name:t[e.workspaces.container.type],value:e.workspaces.container.version}]:[],...e.home?[{name:"Home UI",value:e.home.version}]:[],...e.search?[{name:"Search API",value:e.search.apiVersion}]:[],...e.modals?[{name:"Modals API",value:e.modals.apiVersion}]:[]]}},qk=()=>{const e=window.glue42gd??window.iodesktop;if(!e)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:t,env:n}=e,o=[{name:"Environment",value:n.env},{name:"Region",value:n.region}];return t?{avatarInitials:t.charAt(0),items:o,title:t}:{items:o}},Jk=e=>({items:Object.entries(e??{}).map(([n,o])=>({name:n,value:o}))}),Zk=(e=[])=>({items:e.map(({product:t,version:n})=>({name:t,value:n}))}),Yk=e=>$r()?(async t=>{const{licInfo:n,productInfo:o}=(await t.interop.invoke("T42.GD.GetInfo")).returned;return{user:qk(),license:Jk(n),productsInfo:Zk(o)}})(e):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const t=await window.iobrowser.system.getProfileData();return{user:Uk(t.user),license:Vk(t.license),plugins:Kk(t.plugins),productsInfo:Gk(t.productsInfo)}})(),Xk=({className:e,onClose:t,onLogout:n,title:o="Profile",...r})=>{var h;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:s,Trademark:c,UserSection:u}=v.useContext(Vv),d=v.useContext(Te.IOConnectContext),[f,p]=v.useState(null);return v.useEffect(()=>{d&&(async()=>{const m=await Yk(d);p(m)})().catch(console.error)},[d]),l.jsxs(ot,{className:Q("io-profile-panel",e),"data-testid":"profile-panel",...r,children:[l.jsxs(ot.Header,{children:[l.jsx(ot.Header.Title,{size:"large",text:o}),l.jsx(ot.Header.ButtonGroup,{children:l.jsx(ot.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:t})})]}),l.jsxs(ar,{element:ot.Body,children:[f!=null&&f.user.items.length||f!=null&&f.user.title?l.jsx(u,{avatarInitials:f.user.avatarInitials,items:f.user.items,onLogout:n,title:f.user.title}):null,l.jsxs("div",{className:"io-profile-sections-container",children:[f!=null&&f.license.items.length?l.jsx(i,{items:f.license.items}):null,f!=null&&f.productsInfo.items.length?l.jsx(a,{items:f.productsInfo.items}):null,(h=f==null?void 0:f.plugins)!=null&&h.items.length?l.jsx(s,{items:f.plugins.items}):null]}),l.jsx(c,{className:"mt-auto"})]})]})},Gv=({components:e,...t})=>l.jsx(Kv,{components:e,children:l.jsx(Xk,{...t})}),Qk=document.querySelector("#root")??document.body,e3={preferences:dv,"notification-settings":lf,profile:Gv},t3=()=>{const{panel:e,deselectPanel:t}=v0();ru(()=>{e&&t()},["Escape"]);const n=e?e3[e]:null;return n?Mo.createPortal(l.jsx("div",{className:"io-panel-overlay",children:l.jsx(n,{onClose:t})}),Qk):null};var n3=Object.freeze({__proto__:null,ActivePanelRenderer:t3,PanelManagerProvider:({children:e})=>{const[t,n]=v.useState(null),o=v.useCallback(a=>{n(a)},[]),r=v.useCallback(()=>{n(null)},[]),i=v.useMemo(()=>({panel:t,selectPanel:o,deselectPanel:r}),[t,o,r]);return l.jsx(y0.Provider,{value:i,children:e})},usePanelManagerContext:v0});v.createContext({theme:"dark"});const o3="var(--io-neutrals-0)",wl="var(--io-neutrals-900)";function qv(e){var r;let t,n,o;if(e.startsWith("#")){let i=e.slice(1);i.length===3&&(i=i.split("").map(a=>a+a).join("")),t=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16)}else{if(!e.startsWith("rgb")){const i=document.createElement("canvas").getContext("2d");return i?(i.fillStyle=e,qv(i.fillStyle)):wl}{const i=(r=e.match(/\d+/g))==null?void 0:r.map(Number);if(!i||i.length<3)return wl;[t,n,o]=i}}return(.2126*t+.7152*n+.0722*o)/255>.5?wl:o3}function r3({className:e,channel:t,...n}){const o=Q("io-channel-badge",e),r=v.useMemo(()=>qv(t.color),[t.color]);return l.jsx("div",{className:o,style:{color:r,backgroundColor:t.color},"data-testid":`channel-selector-badge-${t.color}`,...n,children:l.jsx("span",{className:"io-channel-selector-badge-label","data-testid":"channel-selector-label",children:t.label})})}function i3(){return l.jsx(xt,{variant:"check","data-testid":"channel-selector-channel-selected"})}function a3({channel:e,handleChannelRestricted:t,lockedChannelRestriction:n}){const o=(r,i)=>a=>{a.stopPropagation(),En(a)&&(a.preventDefault(),i||t({...e,[r]:!e[r]}))};return l.jsxs(l.Fragment,{children:[l.jsx("div",{children:e.isSelected&&l.jsx("span",{"data-testid":"channel-selector-channel-selected",children:"Active"})}),l.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-publish-toggle-container",children:l.jsx(_t,{label:"Publish",checked:e.write,onChange:()=>{t({...e,write:!e.write})},onKeyDown:o("write",!e.isSelected||(n==null?void 0:n.write)),onClick:r=>r.stopPropagation(),disabled:!e.isSelected||(n==null?void 0:n.write)})}),l.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-subscribe-toggle-container",children:l.jsx(_t,{label:"Subscribe",checked:e.read,onChange:()=>{t({...e,read:!e.read})},onKeyDown:o("read",!e.isSelected||(n==null?void 0:n.read)),disabled:!e.isSelected||(n==null?void 0:n.read)})})]})}const Jv=v.createContext({});function s3({channel:e,isSelected:t,onChannelSelect:n,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,lockedChannelRestrictions:s}=v.useContext(Jv),c=t||e.isSelected||(a==null?void 0:a.includes(e)),u=s==null?void 0:s.find(h=>h.name===e.name),d=v.useCallback(()=>n==null?void 0:n({...e,isSelected:!c}),[e,n,c]),f=v.useCallback(h=>{const m=h.target;m.closest(".io-toggle")||m.classList.contains("io-toggle")||En(h)&&(h.preventDefault(),n==null||n({...e,isSelected:!c}))},[e,n,c]),p=v.useCallback(h=>{o==null||o(h)},[o]);return l.jsx(dc,{prepend:l.jsx(r3,{channel:e}),append:i==="single"||i==="multi"?c&&l.jsx(i3,{}):l.jsx(a3,{channel:e,handleChannelRestricted:p,lockedChannelRestriction:u}),isSelected:c,onClick:d,onKeyDown:f,...r,children:e.name},e.name)}function c3({variant:e,onVariantChange:t,disabled:n=!1}){const o=e==="directionalSingle"||e==="directionalMulti",r=v.useCallback(()=>{t==null||t(!o)},[o,t]),i=v.useCallback(s=>{s.stopPropagation()},[]),a=v.useCallback(s=>{s.stopPropagation(),En(s)&&(s.preventDefault(),n||r())},[n,r]);return l.jsx(_t,{label:"Directional",align:"right",checked:o,onChange:r,onClick:i,onKeyDown:a,disabled:n,"data-testid":`channel-selector-toggle-${e}`})}const l3=v.forwardRef(({className:e,variant:t="single",variantToggle:n=!1,channels:o=[],lockedChannelRestrictions:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:s,...c},u)=>{const d=Q("io-list-channels","io-channel-selector-panel",(t==="directionalSingle"||t==="directionalMulti")&&"io-list-channels-directional io-channel-selector-panel-directional",e),f=v.useMemo(()=>({variant:t,selectedChannels:o.filter(p=>p.isSelected),lockedChannelRestrictions:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:s}),[o,t,r,i,a,s]);return l.jsx(Jv.Provider,{value:f,children:l.jsx("div",{className:d,ref:u,children:l.jsxs(gt,{...c,children:[l.jsx(gt.ItemTitle,{"data-testid":"channel-selector-title",append:n&&l.jsx(c3,{variant:t,onVariantChange:i}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[t]}),o==null?void 0:o.map(p=>l.jsx(s3,{channel:p,isSelected:p.isSelected,onChannelSelect:a,onChannelRestrict:s,"data-testid":`channel-selector-channel-${p.name}`},p.name))]})})})});l3.displayName="ChannelSelector";const u3=v.forwardRef(({className:e,title:t,ariaLabel:n,onClick:o,onKeyDown:r,children:i,disabled:a=!1,...s},c)=>l.jsx("div",{ref:c,className:Q(e,{disabled:a}),title:t,role:"button",tabIndex:a?-1:0,"aria-label":n,"aria-disabled":a,onClick:u=>{!a&&o&&o(u)},onKeyDown:u=>{!a&&r&&r(u)},...s,children:i}));u3.displayName="ChannelSelectorButtonWrapper";function d3({actionButtons:e,actionButtonElementsRefs:t,isAutofocusButton:n,isButtonDisabled:o,onButtonClick:r}){return l.jsx(Be,{"data-testid":"io-dialog-action-buttons-group",align:"right",children:e.map((i,a)=>{const{id:s,text:c,variant:u}=i,d=n(s);return l.jsx(tt,{"data-testid":`io-dialog-action-button-${s}`,id:s,ref:f=>{a===0&&(t.current=[]),t.current[a]=f},className:d?"io-focus-button":void 0,disabled:o(s),onClick:()=>r(i),variant:u,children:c},s)})})}function df({actionButtons:e,children:t,onCompletion:n,size:o,title:r=$r()?"io.Connect Desktop":"io.Connect Browser",validationErrors:i=[]}){const{actionButtonElementsRefs:a,autofocusButtonId:s,hasAutofocusButtonLostInitialFocus:c}=(f=>{const p=v.useRef([]),h=v.useMemo(()=>{var b;return((b=f.find(k=>k.autofocus))==null?void 0:b.id)??null},[f]),m=v.useRef(h),[g,y]=v.useState(!m.current);return v.useLayoutEffect(()=>{if(g)return;if(h!==m.current)return void y(!0);const b=p.current.find(x=>(x==null?void 0:x.id)===h);if(!b)return;b.focus();const k=()=>{y(!0)};return b.addEventListener("blur",k),()=>{b.removeEventListener("blur",k)}},[h,g]),{actionButtonElementsRefs:p,autofocusButtonId:h,hasAutofocusButtonLostInitialFocus:g}})(e),u=()=>{n({isClosed:!0})},d={...o};return l.jsxs(go,{className:"io-dialog-template",closeFn:u,isOpen:!0,onCancel:f=>{f.preventDefault(),u()},onKeyDown:f=>{!En(f)||i.length||f.target instanceof HTMLButtonElement||f.key===" "&&f.target instanceof HTMLInputElement||n({isEnterPressed:!0})},style:d,title:r,draggable:!0,children:[l.jsx(go.Body,{children:t}),l.jsx(go.Footer,{children:l.jsx(d3,{actionButtonElementsRefs:a,actionButtons:e,isAutofocusButton:f=>s===f&&!c,isButtonDisabled:f=>i.some(p=>p.disabledButtonIds.some(h=>h===f)),onButtonClick:({id:f,text:p})=>{n({responseButtonClicked:{id:f,text:p}})}})})]})}function ff({children:e}){return l.jsx("h1",{"data-testid":"io-dialog-heading",className:"io-dialog-template-heading",children:e})}function f3({onCompletion:e,size:t,variables:n}){const{actionButtons:o,heading:r,text:i,title:a}=n;return l.jsx(df,{actionButtons:o,onCompletion:e,size:t,title:a,children:l.jsx(go.Body.Content,{children:l.jsxs("div",{children:[l.jsx(ff,{children:r}),l.jsx("p",{"data-testid":"io-dialog-text",children:i})]})})})}function p3({onCompletion:e,size:t,variables:n}){const{actionButtons:o,checkbox:r,heading:i,text:a,title:s}=n,[c,u]=v.useState(r.initialValue),d=v.useCallback(()=>u(p=>!p),[]),f=[{id:r.id,type:"checkbox",checked:c}];return l.jsxs(df,{actionButtons:o,onCompletion:p=>e({...p,inputs:f}),size:t,title:s,children:[l.jsx(go.Body.Content,{children:l.jsxs("div",{children:[l.jsx(ff,{children:i}),l.jsx("p",{"data-testid":"io-dialog-text",children:a})]})}),l.jsx(Ta,{"data-testid":`io-dialog-checkbox-${r.id}`,checked:c,id:r.id,label:r.label,name:r.id,onChange:d})]})}function h3({onCompletion:e,size:t,variables:n}){const{actionButtons:o,heading:r,input:i,title:a}=n,[s,c]=v.useState(i.initialValue??""),u=v.useRef(null),d=(f=s,!(p=i.validation)||new RegExp(p.regexPattern).test(f)?null:{disabledButtonIds:p.disabledButtonIds,message:p.errorMessage});var f,p;const h=[{id:i.id,type:"text",value:s}];return v.useLayoutEffect(()=>{var m;(m=u.current)==null||m.select()},[]),l.jsxs(df,{actionButtons:o,onCompletion:m=>e({...m,inputs:h}),size:t,title:a,validationErrors:d?[d]:[],children:[l.jsx(go.Body.Content,{children:l.jsx(ff,{children:r})}),l.jsx(tr,{"data-testid":`io-dialog-input-${i.id}`,ref:u,errorDataTestId:`io-dialog-input-${i.id}-error-message`,errorMessage:d==null?void 0:d.message,id:i.id,label:i.label,name:i.id,onChange:m=>c(m.target.value),placeholder:i.placeholder,type:"text",value:s})]})}const pf=Ut({width:zp,height:zp}),hf=Cu().andThen(e=>((t,n)=>{const o=typeof t;return o==="function"?Cu():k2(`The argument provided as "${n}" must be a function, received: ${o}`)})(e,"onCompletion")),mf=Ut({autofocus:xe(rt()),id:wt,text:wt,variant:Aa(q("default"),q("primary"),q("critical"),q("outline"),q("link"))}),m3=Ut({disabledButtonIds:er(wt),errorMessage:wt,regexPattern:wt}),g3=Ut({actionButtons:er(mf),heading:qt(),text:qt(),title:xe(qt())}),y3=Ut({templateName:q("noInputsConfirmationDialog"),onCompletion:hf,size:xe(pf),variables:g3}),v3=Ut({actionButtons:er(mf),checkbox:Ut({id:wt,initialValue:xe(rt()),label:xe(qt())}),heading:qt(),text:qt(),title:xe(qt())}),w3=Ut({templateName:q("singleCheckboxDialog"),onCompletion:hf,size:xe(pf),variables:v3}),b3=Ut({actionButtons:er(mf),heading:qt(),input:Ut({id:wt,initialValue:xe(qt()),label:xe(qt()),placeholder:xe(qt()),validation:xe(m3)}),title:xe(qt())}),x3=Ut({templateName:q("singleTextInputDialog"),onCompletion:hf,size:xe(pf),variables:b3});y3.runWithException,w3.runWithException,x3.runWithException;v.createContext({config:{message:""},theme:"dark",setResult:()=>{}});const k3={env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},S3=v.createContext({config:k3,onThemeChanged:()=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:()=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Bn=()=>v.useContext(S3);function C3({...e}){const{config:t,close:n}=Bn(),{applicationTitle:o}=t;return l.jsxs(cn,{draggable:!0,...e,children:[l.jsx(cn.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),l.jsx(cn.ButtonGroup,{className:"non-draggable",children:l.jsx(cn.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>n()})})]})}function E3({className:e,handleSubmit:t,...n}){const o=Q("io-panel-body",e),{config:r,submitFeedback:i}=Bn(),{IntroField:a,DescriptionField:s,TechInfoField:c,EnvInfoField:u,FileAttachmentsField:d,CategoryAttachmentsField:f,MailListField:p}=Hc(),h=t??i,m=`Your feedback will be submitted to the ${r.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return l.jsxs("form",{className:o,id:"feedback",onSubmit:h,...n,children:[l.jsx(a,{children:l.jsx("p",{children:m})}),l.jsx(p,{}),l.jsx(s,{}),l.jsx(c,{readOnly:!0}),l.jsx(u,{readOnly:!0}),r.attachmentsViewMode==="file"?l.jsx(d,{}):l.jsx(f,{})]})}function j3({...e}){const{FooterButtons:t}=Hc(),{openUrl:n,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=Bn();return l.jsx(Er,{...e,children:l.jsxs("div",o?{className:"flex ai-center jc-between",children:[l.jsx(et,{children:l.jsx("p",{children:r.title})}),l.jsx(F2,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[l.jsxs(et,{children:[l.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&l.jsx("a",{href:i,onClick:a=>{a.preventDefault(),n(i)},children:i})]}),l.jsx(t,{})]})})}function _3({className:e,...t}){const{CloseButton:n}=Hc(),{close:o}=Bn(),r=Q("non-draggable",e);return l.jsx(Be,{className:r,...t,children:l.jsx(n,{onClick:()=>o()})})}function O3({className:e,...t}){const{SubmitButton:n,CancelButton:o,CloseButton:r}=Hc(),{close:i,submitCompleted:a}=Bn();return a?l.jsx(Be,{className:e,...t,children:l.jsx(r,{text:"Close",onClick:()=>i()})}):l.jsxs(Be,{className:e,...t,children:[l.jsx(n,{}),l.jsx(o,{onClick:()=>i()})]})}function A3({text:e="Submit",...t}){return l.jsx(tt,{form:"feedback",type:"submit",variant:"primary",text:e,...t})}function P3({text:e="Cancel",...t}){return l.jsx(tt,{variant:"link",text:e,...t})}function N3({...e}){return l.jsx(tt,{variant:"primary",...e})}function T3({showField:e=!0,className:t,title:n,hint:o,children:r,...i}){return e?l.jsx(et,{className:t,title:n,hint:o,...i,children:r}):null}function I3({showField:e=!0,className:t,title:n="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return e?l.jsx(et,{className:t,hint:o,title:"",...a,children:l.jsx(Lc,{id:"description",name:"description",label:n,readOnly:r,disabled:i})}):null}function R3({showField:e,className:t,title:n="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...s}){const{config:c}=Bn(),u=e??c.errorMessage,d=r??c.errorMessage;return u&&d?l.jsx(et,{className:t,hint:o,...s,children:l.jsx(Lc,{id:"errorMessage",name:"errorMessage",label:n,value:d,readOnly:i,disabled:a})}):null}function L3({showField:e,className:t,title:n="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...s}){const{config:c}=Bn(),u=e??c.showEnvironmentInfo,d=r??c.environmentInfo;return u&&d?l.jsx(et,{className:t,hint:o,...s,children:l.jsx(Lc,{id:"environmentInfo",name:"environmentInfo",label:n,value:d,readOnly:i,disabled:a})}):null}function D3({showField:e=!0,className:t,title:n="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:s,...c}){const u=Q("io-block-list-gap",t),{config:d}=Bn(),f=a??d.attachments,p=s??d.selectedCategories,h=v.useCallback(m=>!!p&&p.indexOf(m)!==-1,[p]);return e?!f||f.length<=0?l.jsx(et,{title:"Attachments",children:l.jsx("p",{children:"No Attachments"})}):l.jsx(et,{className:u,title:n,hint:o,...c,children:l.jsx("div",{className:"file-attachments",children:f.map(m=>l.jsx(Ta,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:h(m.category)},m.id))})}):null}function M3({showField:e=!0,className:t,title:n="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:s,...c}){const{config:u,attachmentCategories:d}=Bn(),f=a??d,p=s??u.selectedCategories,h=v.useCallback(m=>!!p&&p.indexOf(m)!==-1,[p]);return e?!f||f.length<=0?l.jsx("p",{children:"No Attachments"}):l.jsx(et,{className:t,title:n,hint:o,...c,children:l.jsx("div",{className:"category-attachments",children:f.map(m=>l.jsx(_t,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:h(m)},m))})}):null}function $3({className:e,title:t,hint:n,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:s="Send Email",readOnly:c=!1,disabled:u,...d}){const f=Q("io-block-list-gap",e),{config:p,showMailingList:h,setShowMailingList:m}=Bn();if(!o)return null;const g=r??p.createJiraTicket,y=a??p.sendEmail;return l.jsxs(et,{className:f,hint:n,title:t,...d,children:[g&&l.jsx(_t,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:c,disabled:u,defaultChecked:g}),y&&l.jsx(_t,{onChange:()=>{m(!h)},id:"sendEmail",name:"sendEmail",label:s,align:"right",readOnly:c,disabled:u,defaultChecked:y})]})}function H3({showField:e=!0,className:t,title:n="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...s}){const{config:c,showMailingList:u}=Bn(),d=e??c.sendEmail,f=i??c.allowEditRecipients===!1;return d&&u?l.jsx(et,{className:t,hint:o,...s,children:l.jsx(tr,{id:"mailingList",name:"mailingList",label:n,placeholder:r,readOnly:f,disabled:a,defaultValue:c.mailingList??""})}):null}const Zv={Header:C3,Body:E3,Footer:j3,HeaderButtons:_3,FooterButtons:O3,SubmitButton:A3,CancelButton:P3,CloseButton:N3,IntroField:T3,DescriptionField:I3,TechInfoField:R3,EnvInfoField:L3,FileAttachmentsField:D3,CategoryAttachmentsField:M3,SettingsField:$3,MailListField:H3},Yv=v.createContext(Zv),B3=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Zv,...t}),[t]);return l.jsx(Yv.Provider,{value:n,children:e})});function Hc(e){return{...v.useContext(Yv),...e}}B3.displayName="ComponentsStore";const oa=e=>"items"in e,va={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Bc=new Intl.Collator(void 0,{sensitivity:"base"}),Xv=(e,t)=>Bc.compare(e.title,t.title),Qv=(e,t)=>Bc.compare(t.title,e.title),gf=e=>{const{items:t,sortOrder:n,ascendingCompare:o,descendingCompare:r}=e;if(n===va.DISABLED)return t;const i=n===va.ASCENDING?o:r;return[...t].sort(i)},e1="favorites-section",t1="workspaces-section",n1="applications-section",Fu=e=>{var h;const{items:t,newItem:n,settings:o,path:r,accumulatedPath:i=""}=e,{isFolderCollapsible:a}=o,[s,...c]=r.split("/"),u=i?`${i}/${s}`:s,d=t.findIndex(m=>oa(m)&&m.title===s),f=d!==-1?t[d]:null;if(!f){const m=c.length>0?Fu({items:[],newItem:n,settings:o,path:c.join("/"),accumulatedPath:u}):[n];return[...t,{id:s,title:s,items:m,isCollapsible:a,getIcon:(h=o.folderIconGetters)==null?void 0:h[u]}]}const p=c.length>0?Fu({items:f.items,newItem:n,settings:o,path:c.join("/"),accumulatedPath:u}):[...f.items,n];return[...t.slice(0,d),{...f,items:p},...t.slice(d+1)]},Js=e=>{const{title:t,userProperties:n}=e,{folder:o}=n;return o?`${o}/${t}`:t},z3=(e,t)=>Bc.compare(Js(e),Js(t)),F3=(e,t)=>Bc.compare(Js(t),Js(e));var vh,Wu={exports:{}},bl={exports:{}},Ke={},wh,bh,xl,xh,kh,Sh,Ch,Eh,jh,_h,kl,Oh,Sl,Ah,Ze={};/** @license React v16.13.1
|
|
17
17
|
* react-is.development.js
|
|
18
18
|
*
|
|
19
19
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the MIT license found in the
|
|
22
22
|
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/function
|
|
23
|
+
*/function Ph(){return bh||(bh=1,process.env.NODE_ENV==="production"?bl.exports=function(){if(vh)return Ke;vh=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function x(w){if(typeof w=="object"&&w!==null){var C=w.$$typeof;switch(C){case t:switch(w=w.type){case c:case u:case o:case i:case r:case f:return w;default:switch(w=w&&w.$$typeof){case s:case d:case m:case h:case a:return w;default:return C}}case n:return C}}}function S(w){return x(w)===u}return Ke.AsyncMode=c,Ke.ConcurrentMode=u,Ke.ContextConsumer=s,Ke.ContextProvider=a,Ke.Element=t,Ke.ForwardRef=d,Ke.Fragment=o,Ke.Lazy=m,Ke.Memo=h,Ke.Portal=n,Ke.Profiler=i,Ke.StrictMode=r,Ke.Suspense=f,Ke.isAsyncMode=function(w){return S(w)||x(w)===c},Ke.isConcurrentMode=S,Ke.isContextConsumer=function(w){return x(w)===s},Ke.isContextProvider=function(w){return x(w)===a},Ke.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},Ke.isForwardRef=function(w){return x(w)===d},Ke.isFragment=function(w){return x(w)===o},Ke.isLazy=function(w){return x(w)===m},Ke.isMemo=function(w){return x(w)===h},Ke.isPortal=function(w){return x(w)===n},Ke.isProfiler=function(w){return x(w)===i},Ke.isStrictMode=function(w){return x(w)===r},Ke.isSuspense=function(w){return x(w)===f},Ke.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===o||w===u||w===i||w===r||w===f||w===p||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===h||w.$$typeof===a||w.$$typeof===s||w.$$typeof===d||w.$$typeof===y||w.$$typeof===b||w.$$typeof===k||w.$$typeof===g)},Ke.typeOf=x,Ke}():bl.exports=(wh||(wh=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function x(L){if(typeof L=="object"&&L!==null){var H=L.$$typeof;switch(H){case t:var W=L.type;switch(W){case c:case u:case o:case i:case r:case f:return W;default:var U=W&&W.$$typeof;switch(U){case s:case d:case m:case h:case a:return U;default:return H}}case n:return H}}}var S=c,w=u,C=s,O=a,_=t,N=d,E=o,A=m,j=h,B=n,$=i,R=r,F=f,z=!1;function V(L){return x(L)===u}Ze.AsyncMode=S,Ze.ConcurrentMode=w,Ze.ContextConsumer=C,Ze.ContextProvider=O,Ze.Element=_,Ze.ForwardRef=N,Ze.Fragment=E,Ze.Lazy=A,Ze.Memo=j,Ze.Portal=B,Ze.Profiler=$,Ze.StrictMode=R,Ze.Suspense=F,Ze.isAsyncMode=function(L){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),V(L)||x(L)===c},Ze.isConcurrentMode=V,Ze.isContextConsumer=function(L){return x(L)===s},Ze.isContextProvider=function(L){return x(L)===a},Ze.isElement=function(L){return typeof L=="object"&&L!==null&&L.$$typeof===t},Ze.isForwardRef=function(L){return x(L)===d},Ze.isFragment=function(L){return x(L)===o},Ze.isLazy=function(L){return x(L)===m},Ze.isMemo=function(L){return x(L)===h},Ze.isPortal=function(L){return x(L)===n},Ze.isProfiler=function(L){return x(L)===i},Ze.isStrictMode=function(L){return x(L)===r},Ze.isSuspense=function(L){return x(L)===f},Ze.isValidElementType=function(L){return typeof L=="string"||typeof L=="function"||L===o||L===u||L===i||L===r||L===f||L===p||typeof L=="object"&&L!==null&&(L.$$typeof===m||L.$$typeof===h||L.$$typeof===a||L.$$typeof===s||L.$$typeof===d||L.$$typeof===y||L.$$typeof===b||L.$$typeof===k||L.$$typeof===g)},Ze.typeOf=x}()),Ze)),bl.exports}/*
|
|
24
24
|
object-assign
|
|
25
25
|
(c) Sindre Sorhus
|
|
26
26
|
@license MIT
|
|
27
|
-
*/function
|
|
28
|
-
Valid keys: `+JSON.stringify(Object.keys(w),null," "));var F=R(A,$,_,N,E+"."+$,n);if(F)return F}return null})}};function p(w,C){return w===C?w!==0||1/w==1/C:w!=w&&C!=C}function h(w,C){this.message=w,this.data=C&&typeof C=="object"?C:{},this.stack=""}function m(w){if(process.env.NODE_ENV!=="production")var C={},O=0;function _(E,A,j,B,$,R,F){if(B=B||d,R=R||j,F!==n){if(c){var z=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw z.name="Invariant Violation",z}if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var V=B+":"+j;!C[V]&&O<3&&(i("You are manually calling a React.PropTypes validation function for the `"+R+"` prop on `"+B+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),C[V]=!0,O++)}}return A[j]==null?E?A[j]===null?new h("The "+$+" `"+R+"` is marked as required in `"+B+"`, but its value is `null`."):new h("The "+$+" `"+R+"` is marked as required in `"+B+"`, but its value is `undefined`."):null:w(A,j,B,$,R)}var N=_.bind(null,!1);return N.isRequired=_.bind(null,!0),N}function g(w){return m(function(C,O,_,N,E,A){var j=C[O];return k(j)!==w?new h("Invalid "+N+" `"+E+"` of type `"+x(j)+"` supplied to `"+_+"`, expected `"+w+"`.",{expectedType:w}):null})}function y(w,C,O,_,N){return new h((w||"React class")+": "+C+" type `"+O+"."+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function b(w){switch(typeof w){case"number":case"string":case"undefined":return!0;case"boolean":return!w;case"object":if(Array.isArray(w))return w.every(b);if(w===null||s(w))return!0;var C=function(E){var A=E&&(u&&E[u]||E["@@iterator"]);if(typeof A=="function")return A}(w);if(!C)return!1;var O,_=C.call(w);if(C!==w.entries){for(;!(O=_.next()).done;)if(!b(O.value))return!1}else for(;!(O=_.next()).done;){var N=O.value;if(N&&!b(N[1]))return!1}return!0;default:return!1}}function k(w){var C=typeof w;return Array.isArray(w)?"array":w instanceof RegExp?"object":function(O,_){return O==="symbol"||!!_&&(_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol)}(C,w)?"symbol":C}function x(w){if(w==null)return""+w;var C=k(w);if(C==="object"){if(w instanceof Date)return"date";if(w instanceof RegExp)return"regexp"}return C}function S(w){var C=x(w);switch(C){case"array":case"object":return"an "+C;case"boolean":case"date":case"regexp":return"a "+C;default:return C}}return h.prototype=Error.prototype,f.checkPropTypes=r,f.resetWarningCache=r.resetWarningCache,f.PropTypes=f,f},wl}()(B3.isElement,!0)}else Hu.exports=function(){if(Eh)return bl;Eh=1;var e=xl();function t(){}function n(){}return n.resetWarningCache=t,bl=function(){function o(a,s,c,u,d,f){if(f!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}function r(){return o}o.isRequired=o;var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},bl}()();var pe=Ea(Hu.exports);function Bu(e){return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bu(e)}function e1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;return t?e.split(" ").map(function(n){return t[n]||n}).join(" "):e}var z3=(typeof window>"u"?"undefined":Bu(window))==="object"&&window.Element||function(){};pe.oneOfType([pe.string,pe.func,function(e,t,n){if(!(e[t]instanceof z3))return new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected prop to be an instance of Element. Validation failed.")},pe.shape({current:pe.any})]);var t1=pe.oneOfType([pe.func,pe.string,pe.shape({$$typeof:pe.symbol,render:pe.func}),pe.arrayOf(pe.oneOfType([pe.func,pe.string,pe.shape({$$typeof:pe.symbol,render:pe.func})]))]),Oh=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],F3="entering",W3="entered",U3="exiting",V3="exited",K3=["className","cssModule","size","vertical","tag"];function zu(){return zu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},zu.apply(this,arguments)}function Ah(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function G3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q3(e,t){if(e==null)return{};var n,o,r=function(a,s){if(a==null)return{};var c,u,d={},f=Object.keys(a);for(u=0;u<f.length;u++)c=f[u],s.indexOf(c)>=0||(d[c]=a[c]);return d}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var J3={"aria-label":pe.string,className:pe.string,cssModule:pe.object,role:pe.string,size:pe.string,tag:t1,vertical:pe.bool};function n1(e){var t=e.className,n=e.cssModule,o=e.size,r=e.vertical,i=e.tag,a=i===void 0?"div":i,s=q3(e,K3),c=e1(Q(t,!!o&&"btn-group-"+o,r?"btn-group-vertical":"btn-group"),n);return v.createElement(a,zu({},function(u){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?Ah(Object(f),!0).forEach(function(p){G3(u,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(f)):Ah(Object(f)).forEach(function(p){Object.defineProperty(u,p,Object.getOwnPropertyDescriptor(f,p))})}return u}({role:"group"},s),{className:c}))}function Fu(e,t){return Fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Fu(e,t)}n1.propTypes=J3;var Ph=!1,Z3=process.env.NODE_ENV!=="production"?pe.oneOfType([pe.number,pe.shape({enter:pe.number,exit:pe.number,appear:pe.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&pe.oneOfType([pe.string,pe.shape({enter:pe.string,exit:pe.string,active:pe.string}),pe.shape({enter:pe.string,enterDone:pe.string,enterActive:pe.string,exit:pe.string,exitDone:pe.string,exitActive:pe.string})]);var o1=v.createContext(null),Xi="unmounted",br="exited",xr="entering",Yr="entered",Wu="exiting",_n=function(e){function t(o,r){var i;i=e.call(this,o,r)||this;var a,s=r&&!r.isMounting?o.enter:o.appear;return i.appearStatus=null,o.in?s?(a=br,i.appearStatus=xr):a=Yr:a=o.unmountOnExit||o.mountOnEnter?Xi:br,i.state={status:a},i.nextCallback=null,i}(function(o,r){o.prototype=Object.create(r.prototype),o.prototype.constructor=o,Fu(o,r)})(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===Xi?{status:br}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==xr&&i!==Yr&&(r=xr):i!==xr&&i!==Yr||(r=Wu)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o,r,i,a=this.props.timeout;return o=r=i=a,a!=null&&typeof a!="number"&&(o=a.exit,r=a.enter,i=a.appear!==void 0?a.appear:r),{exit:o,enter:r,appear:i}},n.updateStatus=function(o,r){if(o===void 0&&(o=!1),r!==null)if(this.cancelNextCallback(),r===xr){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:$o.findDOMNode(this);i&&function(a){a.scrollTop}(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===br&&this.setState({status:Xi})},n.performEnter=function(o){var r=this,i=this.props.enter,a=this.context?this.context.isMounting:o,s=this.props.nodeRef?[a]:[$o.findDOMNode(this),a],c=s[0],u=s[1],d=this.getTimeouts(),f=a?d.appear:d.enter;!o&&!i||Ph?this.safeSetState({status:Yr},function(){r.props.onEntered(c)}):(this.props.onEnter(c,u),this.safeSetState({status:xr},function(){r.props.onEntering(c,u),r.onTransitionEnd(f,function(){r.safeSetState({status:Yr},function(){r.props.onEntered(c,u)})})}))},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:$o.findDOMNode(this);r&&!Ph?(this.props.onExit(a),this.safeSetState({status:Wu},function(){o.props.onExiting(a),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:br},function(){o.props.onExited(a)})})})):this.safeSetState({status:br},function(){o.props.onExited(a)})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,r.nextCallback=null,o(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=this.props.nodeRef?this.props.nodeRef.current:$o.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=s[0],u=s[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)}else setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===Xi)return null;var r=this.props,i=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var a=function(s,c){if(s==null)return{};var u={};for(var d in s)if({}.hasOwnProperty.call(s,d)){if(c.indexOf(d)!==-1)continue;u[d]=s[d]}return u}(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(o1.Provider,{value:null},typeof i=="function"?i(o,a):v.cloneElement(v.Children.only(i),a))},t}(v.Component);function Kr(){}function Uu(e){return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}_n.contextType=o1,_n.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:pe.shape({current:typeof Element>"u"?pe.any:function(e,t,n,o,r,i){var a=e[t];return pe.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(e,t,n,o,r,i)}}),children:pe.oneOfType([pe.func.isRequired,pe.element.isRequired]).isRequired,in:pe.bool,mountOnEnter:pe.bool,unmountOnExit:pe.bool,appear:pe.bool,enter:pe.bool,exit:pe.bool,timeout:function(e){var t=Z3;e.addEndListener||(t=t.isRequired);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return t.apply(void 0,[e].concat(o))},addEndListener:pe.func,onEnter:pe.func,onEntering:pe.func,onEntered:pe.func,onExit:pe.func,onExiting:pe.func,onExited:pe.func}:{},_n.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Kr,onEntering:Kr,onEntered:Kr,onExit:Kr,onExiting:Kr,onExited:Kr},_n.UNMOUNTED=Xi,_n.EXITED=br,_n.ENTERING=xr,_n.ENTERED=Yr,_n.EXITING=Wu;var Hi,Y3=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"];function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Js.apply(this,arguments)}function X3(e,t){if(e==null)return{};var n,o,r=function(a,s){if(a==null)return{};var c,u,d={},f=Object.keys(a);for(u=0;u<f.length;u++)c=f[u],s.indexOf(c)>=0||(d[c]=a[c]);return d}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Q3(e,t,n){return t&&function(o,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vu(e,t){return Vu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Vu(e,t)}function eS(e){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,o=Zs(e);if(t){var r=Zs(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(i,a){if(a&&(Uu(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return r1(i)}(this,n)}}function r1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zs(e){return Zs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zs(e)}function Nh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nh(Object(n),!0).forEach(function(o){ri(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nh(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function ri(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tS=Ei(Ei({},_n.propTypes),{},{horizontal:pe.bool,isOpen:pe.bool,children:pe.oneOfType([pe.arrayOf(pe.node),pe.node]),tag:t1,className:pe.node,navbar:pe.bool,cssModule:pe.object,innerRef:pe.shape({current:pe.object})}),nS=Ei(Ei({},_n.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:350}),oS=(ri(Hi={},F3,"collapsing"),ri(Hi,W3,"collapse show"),ri(Hi,U3,"collapsing"),ri(Hi,V3,"collapse"),Hi),Ys=function(){(function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(o&&o.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),o&&Vu(n,o)})(t,v.Component);var e=eS(t);function t(n){var o;return function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),(o=e.call(this,n)).state={dimension:null},o.nodeRef=n.innerRef||v.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(r){o[r]=o[r].bind(r1(o))}),o}return Q3(t,[{key:"onEntering",value:function(n,o){var r=this.getNode();this.setState({dimension:this.getDimension(r)}),this.props.onEntering(r,o)}},{key:"onEntered",value:function(n,o){var r=this.getNode();this.setState({dimension:null}),this.props.onEntered(r,o)}},{key:"onExit",value:function(){var n=this.getNode();this.setState({dimension:this.getDimension(n)}),this.props.onExit(n)}},{key:"onExiting",value:function(){var n=this.getNode();this.getDimension(n),this.setState({dimension:0}),this.props.onExiting(n)}},{key:"onExited",value:function(){var n=this.getNode();this.setState({dimension:null}),this.props.onExited(n)}},{key:"getNode",value:function(){return this.nodeRef.current}},{key:"getDimension",value:function(n){return this.props.horizontal?n.scrollWidth:n.scrollHeight}},{key:"render",value:function(){var n=this,o=this.props,r=o.tag,i=o.horizontal,a=o.isOpen,s=o.className,c=o.navbar,u=o.cssModule,d=o.children;o.innerRef;var f,p,h,m=X3(o,Y3),g=this.state.dimension,y=function(k,x){for(var S,w=Array.isArray(x)?x:[x],C=w.length,O={};C>0;)O[S=w[C-=1]]=k[S];return O}(m,Oh),b=(f=m,p=Oh,h={},Object.keys(f).forEach(function(k){p.indexOf(k)===-1&&(h[k]=f[k])}),h);return v.createElement(_n,Js({},y,{in:a,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(k){var x=function(C){return oS[C]||"collapse"}(k),S=e1(Q(s,i&&"collapse-horizontal",x,c&&"navbar-collapse"),u),w=g===null?null:ri({},i?"width":"height",g);return v.createElement(r,Js({},b,{style:Ei(Ei({},b.style),w),className:S,ref:n.nodeRef}),d)})}}]),t}();Ys.propTypes=tS,Ys.defaultProps=nS;const rS=e=>{const{className:t,isOpen:n,getIcon:o,showCollapseIcon:r,showFolderIcon:i,title:a,...s}=e;return l.jsx(vt.ItemHeader,{className:Q("io-base-section-header",t),prepend:i&&(o?l.jsx(Ad,{size:"16",src:o(n),alt:`${a} icon`,"data-testid":`base-section-header-${a}-folder-custom-icon`}):l.jsx(jt,{size:"16",variant:n?"folder-open":"folder","data-testid":`base-section-header-${a}-folder-default-icon`})),append:r&&l.jsx(Ue,{className:Q("collapse-icon",!n&&"collapsed"),iconSize:"10",size:"16",icon:"expand","data-testid":"base-section-header-collapse-icon"}),tooltip:a,...s,children:a})},iS=e=>{const{isFavoritismEnabled:t=!0,item:n,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...s}=e,{favorites:c,toggleFavorite:u,isLoading:d}=bc(),{description:f,icon:p="application",iconSrc:h,openInstances:m=0,title:g,tooltip:y,className:b,contextMenuActions:k=[]}=n,x=t&&c.some(C=>C.type===n.type&&C.title===n.title),S=h?l.jsx(Ad,{size:"16",src:h,alt:`${g} icon`,"data-testid":"base-section-item-icon"}):l.jsx(jt,{size:"16",variant:p,"data-testid":"base-section-item-icon"}),w=l.jsxs(l.Fragment,{children:[m!==0&&l.jsx("span",{className:"open-instances io-text-smaller","data-testid":"base-section-item-open-instances",children:m===1?"Opened":`${m} opened`}),(t||k.length>0)&&l.jsxs(Be,{className:"item-actions",children:[t&&l.jsx(Ue,{...lc(C=>{C.stopPropagation(),u(n)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:x?"star-full":"star",disabled:d,"data-testid":"base-section-item-favorite-button"}),k.length>0&&l.jsx(Md,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:g,actions:k,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[0,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,shouldCloseOnWindowResize:!0,"data-testid":"base-section-item-context-menu-button"})]})]});return l.jsx(vt.Item,{ref:a,tabIndex:i?0:-1,className:Q("io-base-section-item",b),onKeyDown:C=>{if(Mn(C))return o(C),C.preventDefault(),void C.stopPropagation();r(C)},onClick:o,prepend:S,append:w,description:f,tooltip:y??g,"data-testid":`base-section-item-${n.id}`,...s,children:g})},aS=new gy,ff=e=>{const{config:t,level:n=1,path:o=t.id,onItemClick:r}=e,{isCollapsible:i=!0,getIcon:a}=t,s=ky(),[c,u]=v.useState(0),d=v.useRef({}),{collapsedSections:f,toggleSection:p}=(()=>{const{value:y,update:b}=Mt({prefKey:Jg});return{collapsedSections:y,toggleSection:v.useCallback(k=>aS.enqueue(()=>b((x=[])=>x.includes(k)?x.filter(S=>S!==k):[...x,k])),[b])}})(),h=!i||!(f!=null&&f.includes(o)),m=[...t.items.filter(y=>oa(y)),...t.items.filter(y=>!oa(y))],g=y=>{var b,k;(k=(b=d.current[y])==null?void 0:b.querySelector("[tabIndex]"))==null||k.focus(),u(y)};return l.jsxs(vt.ItemWithSubItems,{className:n===1?"main-section":void 0,"data-testid":`base-section-${t.id}`,children:[l.jsx(rS,{className:n===1?"io-list-item-title main-section-header":void 0,isOpen:h,onClick:async()=>{i&&await p(o)},showCollapseIcon:i,showFolderIcon:n!==1,getIcon:a,style:{paddingLeft:16+24*Math.max(0,n-2)+"px"},"data-testid":`base-section-header-${t.id}`,title:t.title}),l.jsx(Ys,{isOpen:h,tag:vt,children:m.map((y,b)=>oa(y)?l.jsx(ff,{config:y,level:n+1,onItemClick:r,path:`${o}/${y.id}`},y.id):l.jsx(iS,{style:{paddingLeft:16+24*(n-1)+"px"},liRef:k=>d.current[b]=k,isFavoritismEnabled:y.type===wi||y.type===bi,item:y,onClick:(k,x)=>r==null?void 0:r(k,{item:y,modifier:s,selectedContextMenuActionName:x==null?void 0:x.name}),onKeyDown:k=>{Lm({event:k,moveFocus:g,currentIndex:c,min:0,max:m.length-1})},isFocused:c===b},y.id))})]})},i1=e=>`${e.type}-${e.id}`,a1=e=>e.reduce((t,n)=>oa(n)?{...t,...a1(n.items)}:{...t,[i1(n)]:n},{}),s1=v.createContext(void 0),sS=({children:e})=>{const[t,n]=v.useState(null),o=v.useMemo(()=>[t,n],[t]);return l.jsx(s1.Provider,{value:o,children:e})},$c=({config:e,onItemClick:t})=>{const[n,o]=(()=>{const a=v.useContext(s1);if(a===void 0)throw new Error("useSection must be used within a SectionProvider");return a})(),r=$n(),{isLaunchpadPinned:i}=Br();return v.useEffect(()=>{var p;if(!t||!n)return;const{itemName:a,modifier:s,selectedContextMenuActionName:c}=n,u=(d=e.items,f=a,a1(d)[f]);var d,f;u&&(t({item:u,modifier:s,selectedContextMenuActionName:c}),o(null),s===Kg||i||((p=r.close)==null||p.call(r)))},[n,e.items,r,t,o,i]),l.jsx(ff,{config:e,onItemClick:(a,s)=>{const{item:c,modifier:u,selectedContextMenuActionName:d}=s;o({itemName:i1(c),modifier:u,selectedContextMenuActionName:d})}})};function c1(e){const{isFolderCollapsible:t,isSectionCollapsible:n,sortOrder:o,folderIconGetters:r}=e,i=Lg(),a=(()=>{const[d,f]=v.useState({}),p=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!p)return;const h=[p.appManager.onInstanceStarted(m=>{f(g=>{const y=g[m.application.name]??[];return{...g,[m.application.name]:[...y,m.id]}})}),p.appManager.onInstanceStopped(m=>{f(g=>{const y=g[m.application.name];return y?{...g,[m.application.name]:y.filter(b=>b!==m.id)}:g})})];return()=>h.forEach(m=>m())},[p]),d})(),s=Sy(),c=Fg(),u=v.useMemo(()=>((d,f,p)=>{const{isSectionCollapsible:h,sortOrder:m=va.ASCENDING}=p,g=df({items:d,sortOrder:m,ascendingCompare:M3,descendingCompare:$3}).reduce((y,b)=>{var S;const k={id:b.id,title:b.title,description:b.caption,type:wi,icon:"application",iconSrc:b.icon,openInstances:(S=f[b.name])==null?void 0:S.length,contextMenuActions:$g},x=b.userProperties.folder;return x?$u({items:y,newItem:k,settings:p,path:x}):[...y,k]},[]);return{id:Qv,title:"Apps",items:g,isCollapsible:h}})(i,a,{isFolderCollapsible:t,isSectionCollapsible:n,sortOrder:o,folderIconGetters:r}),[i,a,t,n,o,r]);return l.jsx($c,{config:u,onItemClick:d=>{const{item:f,modifier:p,selectedContextMenuActionName:h}=d;return h?c(f,h):s({id:f.id,title:f.title,modifier:p})}})}const l1=e=>{const{isSectionCollapsible:t,sortOrder:n}=e,{favorites:o}=bc(),{isFavoritesSectionHidden:r}=(()=>{const{value:a,update:s,isLoading:c,error:u}=Mt({prefKey:Id}),d=v.useCallback(()=>s(f=>!f),[s]);return{error:u,isFavoritesSectionHidden:a,isLoading:c,toggle:d}})(),i=v.useMemo(()=>((a,s)=>{const{isSectionCollapsible:c,sortOrder:u=va.DISABLED}=s,d=df({items:a,sortOrder:u,ascendingCompare:Jv,descendingCompare:Zv});return{id:Yv,title:"Favorites",items:d,isCollapsible:c}})(o,{isSectionCollapsible:t,sortOrder:n}),[o,t,n]);return o.length>0&&!r?l.jsx($c,{config:i}):null},u1=v.createContext(void 0),d1=()=>{const e=v.useContext(u1);if(e===void 0)throw new Error("useLaunchpadConfig must be used within an LaunchpadConfigProvider");return e},cS=({children:e,settings:t,components:n})=>{const o=v.useMemo(()=>({settings:t,components:n}),[t,n]);return l.jsx(u1.Provider,{value:o,children:e})},f1=v.createContext(void 0),p1=()=>{const e=v.useContext(f1);if(e===void 0)throw new Error("useLaunchpadSearch must be used within a LaunchpadSearchProvider");return e},lS=({children:e})=>{const[t,n]=v.useState(""),o=v.useMemo(()=>({searchTerm:t,setSearchTerm:n}),[t]);return l.jsx(f1.Provider,{value:o,children:e})},h1=e=>{const{isSectionCollapsible:t,sortOrder:n}=e,o=yy(),r=(()=>{const[c,u]=v.useState({}),d=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{const f=d.workspaces,p=[];if(f)return(async()=>{try{const h=await f.onWorkspaceOpened(g=>u(y=>{const b={...y};return b[g.title]=b[g.title]??new Set,b[g.title].add(g.id),b})),m=await f.onWorkspaceClosed(({workspaceId:g})=>u(y=>{const b={...y};for(const k in b)if(b[k].has(g)){b[k].delete(g);break}return b}));p.push(h,m)}catch(h){console.error(h)}})(),()=>p.forEach(h=>h==null?void 0:h())},[d]),c})(),i=Td(),a=vy(),s=v.useMemo(()=>((c,u,d)=>{const{isSectionCollapsible:f,sortOrder:p=va.ASCENDING}=d,h=df({items:c,sortOrder:p,ascendingCompare:Jv,descendingCompare:Zv}).map(m=>{var g;return{...m,type:bi,icon:"workspace",openInstances:(g=u[m.title])==null?void 0:g.size,contextMenuActions:zg}});return{id:Xv,title:"Workspaces",items:[...h,{id:my,icon:"add",title:"Create Workspace",type:Bp,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:f}})(o,r,{isSectionCollapsible:t,sortOrder:n}),[o,r,t,n]);return l.jsx($c,{config:s,onItemClick:c=>{const{item:u,modifier:d,selectedContextMenuActionName:f}=c;return f?a(u,f):u.type===Bp?a(u,u.id):i({id:u.id,modifier:d})}})},uS=[{placementId:Yv,Component:l1},{placementId:Xv,Component:h1},{placementId:Qv,Component:c1}],dS="getScreenDetails"in window,fS={header:{showHeader:!0,showSearch:!0},mode:"default"},m1=()=>{const{defaultLayout:e,activeLayout:t}=$n();return n=>({name:n,isDefault:n===(e==null?void 0:e.name),isActive:n===(t==null?void 0:t.name)})},pS=()=>{const e=Fg(),t=vy(),n=(()=>{const o=hy(),r=m1(),i=Oi();return async(a,s)=>{const{id:c}=a,u=r(c);await i(()=>o({layout:u,actionName:s}))}})();return o=>o===wi?e:o===bi?t:o===ku?n:void 0},hS="rename",mS="save",gS="saveAs",yS="delete",vS="setAsDefault",wS="load",g1=e=>[{name:hS,displayName:"Rename",icon:"pen-line"},{name:mS,displayName:"Save",disabled:!e.isActive,icon:"floppy"},{name:gS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:yS,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:vS,displayName:"Set as Default",disabled:e.isDefault,icon:"user-gear",separatorAfter:!0},{name:wS,displayName:"Load",icon:"spinner"}];function bS(e){const{resultsToRender:t,isLoading:n}=(h=>{const[m,g]=v.useState([]),[y,b]=v.useState(!0),k=v.useRef(null),x=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{const S=x==null?void 0:x.search;if(!S)return;const w=[],C=[];return(async O=>{b(!0),g([]);const _=await S.query({search:O.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(_===k.current)return;k.current=_;const N=_.onResults(j=>{j.results.forEach(B=>{C.find($=>$.id===B.id&&$.type.name===B.type.name)||C.push(B)}),b(!1),g([...C])}),E=_.onCompleted(()=>{b(!1)}),A=_.onError(j=>{console.error(`Query failed. Provider: ${j.provider}; Error: ${j.error}`)});w.push(N,E,A)})(h),()=>{w.forEach(O=>O())}},[x,h]),{resultsToRender:m,isLoading:y}})(e.searchTerm),{close:o}=$n(),r=(()=>{const h=v.useContext(Ie.IOConnectContext);return async m=>h.interop.methods().every(g=>g.name!==(m==null?void 0:m.method))?console.error("Interop method not found."):await h.interop.invoke(m.method,m.params,m.target).catch(g=>console.error({error:g}))})(),i=Td(),a=Sy(),s=Nd(),c=pS(),u=(h=>{const m=m1();return h.reduce((g,y)=>{const{type:b}=y,k=y.id||y.displayName;if(!k)return g;let x=[];if(b.name===wi)x=$g;else if(b.name===bi)x=zg;else if(b.name===ku){const O=m(k);x=g1(O)}else y.secondaryActions&&(x=y.secondaryActions.map(({name:O,method:_,params:N,target:E})=>({name:O,interopParams:{method:_,params:N,target:E}})));const S={id:k,title:y.displayName||k,description:y.description,type:b.name,iconSrc:y.iconURL,mainAction:y.action,contextMenuActions:x},w=g.findIndex(({title:O})=>b.displayName?O===b.displayName:O===b.name),C=g[w];return C?[...g.slice(0,w),{...C,items:[...C.items,S]},...g.slice(w+1)]:[...g,{id:b.name,title:b.displayName||b.name,items:[S]}]},[])})(t),d=Oi(),{isLaunchpadPinned:f}=Br(),p=async(h,m)=>{var O;const{item:g,modifier:y,selectedContextMenuActionName:b}=m,{type:k,id:x,title:S,mainAction:w}=g,C=b?(O=g.contextMenuActions)==null?void 0:O.find(_=>_.name===b):null;C!=null&&C.interopParams?r(C.interopParams):b?((_,N)=>{const E=c(_.type);E==null||E(_,N)})(g,b):w?r(w):k===wi?a({id:x,title:S,modifier:y}):k===bi?i({id:x,modifier:y}):k===ku&&d(()=>s(x)),y===Kg||f||(o==null||o())};return n?l.jsx("p",{className:"search-loading",children:"Loading..."}):t.length===0?l.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):l.jsx(vt,{children:u.map((h,m)=>l.jsx(ff,{config:h,onItemClick:p},h.id||m))})}const xS=({layoutName:e})=>{const t=v.useContext(Ie.IOConnectContext),n=Oi();return l.jsx(Ue,{icon:"floppy",size:"24",iconSize:"12",onClick:o=>{o.stopPropagation(),n(async()=>{try{await t.layouts.save({name:e,type:"Global"}),await ze({io:t,variant:Vn,text:`Layout "${e}" was saved successfully.`})}catch(r){await ze({io:t,variant:nt,text:`Failed to save Layout "${e}".`,error:r})}})},title:"Save Layout","data-testid":"save-layout-button"})},kS=({layout:e})=>{const t=hy(),n=Oi();return l.jsx(Md,{buttonSize:"24",iconSize:"12",title:e.name,icon:"ellipsis-vertical",actions:g1(e),onActionItemClick:async(o,r)=>{o.stopPropagation(),await n(()=>t({layout:e,actionName:r.name}))},placement:"top-end",strategy:"fixed",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,shouldCloseOnWindowResize:!0,"data-testid":"layout-context-menu-button",contextMenuDataTestId:"layout-context-menu"})},y1=({layouts:e,className:t,...n})=>{const{isLaunchpadPinned:o}=Br(),{close:r}=$n(),i=Nd(),a=Oi(),s=()=>{o||(r==null||r())};return l.jsx(sr,{element:vt,elementProps:{className:Q("layouts-list",t),variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},...n},wrapperClassName:"layouts-list-scrollable-container",children:e.map(c=>l.jsx(vt.Item,{className:"layouts-list-item",onClick:()=>(u=>a(()=>i(u.name,s)))(c),append:l.jsxs(l.Fragment,{children:[c.isDefault&&l.jsx(xc,{variant:"default",title:"Default Layout","data-testid":"default-layout-pill",children:"Default"}),l.jsxs(n1,{children:[c.isActive&&l.jsx(xS,{layoutName:c.name}),l.jsx(kS,{layout:c})]})]}),isSelected:c.isActive,tooltip:c.name,"data-testid":`layout-item-${c.name}`,children:c.name},c.name))})},SS=()=>{const{layouts:e}=wy(),{activeLayout:t,defaultLayout:n}=$n(),o=v.useMemo(()=>e.map(r=>({...r,isActive:r.name===(t==null?void 0:t.name),isDefault:r.name===(n==null?void 0:n.name)})),[e,t,n]);return l.jsx(y1,{layouts:o,"data-testid":"all-layouts"})},CS=()=>{const{defaultLayout:e,activeLayout:t}=$n();return t?l.jsx(y1,{layouts:[{...t,isDefault:t.name===(e==null?void 0:e.name),isActive:!0}],"data-testid":"active-layout"}):l.jsx("p",{className:"io-text-small no-active-layout","data-testid":"choose-layout-message",children:"Choose which Layout to load"})},ES=()=>{const e=v.useContext(Ie.IOConnectContext),{setActiveLayout:t}=$n(),n=Oi(),o=async()=>{var d;if(!("modals"in e)||!e.modals)return void console.error("Cannot create Layout because io dialogs are not enabled");const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await e.modals.dialogs.request({templateName:li.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:yu}},actionButtons:[{variant:"primary",text:"Create",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=c==null?void 0:c.find(f=>f.id===i))==null?void 0:d.value;if(a||(s==null?void 0:s.id)===r)try{if((await e.layouts.getAll("Global")).find(f=>f.name===u))return void await ze({io:e,variant:nt,text:`Failed to create Layout "${u}". A Layout with this name already exists.`});await e.layouts.save({name:u}),t({name:u}),await ze({io:e,variant:Vn,text:`Layout "${u}" was created successfully.`})}catch(f){await ze({io:e,variant:nt,text:`Failed to create Layout "${u}".`,error:f})}};return l.jsx(Be,{variant:"fullwidth",className:"create-layout-btn-group",children:l.jsx(tt,{variant:"primary",text:"Create Layout",onClick:()=>n(o),"data-testid":"create-layout-button"})})},jS=()=>{const e=v.useRef(null),{layouts:t,isInitialized:n}=wy(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=(()=>{const{value:a,update:s,isLoading:c,error:u}=Mt({prefKey:Yg});return{error:u,isLayoutsPanelOpen:a,setIsLayoutsPanelOpen:s,isLoading:c}})();v.useEffect(()=>{!n||t.length>0||!o||r(!1)},[t,n,o,r]);const i=v.useCallback(()=>r(a=>!a),[r]);return l.jsxs("footer",{className:"layouts-panel",ref:e,"data-testid":"layouts-panel",children:[l.jsx(wo,{className:"layouts-panel-separator"}),l.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button","data-testid":"layouts-panel-header",...lc(t.length?i:void 0),children:[l.jsx(Xn,{tag:"h2",size:"normal",text:t.length>0?"Layouts":"Start using Layouts"}),t.length>0&&l.jsx(Ue,{className:Q("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24","data-testid":"layouts-panel-toggle-button"})]}),l.jsx(Ys,{isOpen:o,tag:"div",children:l.jsx(SS,{})}),t.length>0&&!o?l.jsx(CS,{}):l.jsx(ES,{})]})},Th=({className:e})=>{const{isLaunchpadCollapsed:t}=Dd(),{isGlobalLayoutsAvailable:n}=$n(),{components:o}=d1(),{searchTerm:r}=p1(),{sections:i=uS}=o;return l.jsxs("div",{className:Q("launchpad-body",t?"collapsed":void 0,e),children:[l.jsx(sr,{wrapperClassName:"launchpad-main-scrollable-container",element:"main",elementProps:{className:"launchpad-main"},children:Gg(r)?l.jsx(bS,{searchTerm:r}):l.jsx(sS,{children:l.jsx(vt,{children:i.map(({Component:a,placementId:s})=>l.jsx(a,{},s))})})}),n&&l.jsx(jS,{})]})};var _S=function(e){return function(t){return!!t&&typeof t=="object"}(e)&&!function(t){var n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||function(o){return o.$$typeof===OS}(t)}(e)},OS=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function wa(e,t){return t.clone!==!1&&t.isMergeableObject(e)?ji((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function AS(e,t,n){return e.concat(t).map(function(o){return wa(o,n)})}function Ih(e){return Object.keys(e).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}(e))}function Rh(e,t){try{return t in e}catch{return!1}}function PS(e,t,n){var o={};return n.isMergeableObject(e)&&Ih(e).forEach(function(r){o[r]=wa(e[r],n)}),Ih(t).forEach(function(r){(function(i,a){return Rh(i,a)&&!(Object.hasOwnProperty.call(i,a)&&Object.propertyIsEnumerable.call(i,a))})(e,r)||(Rh(e,r)&&n.isMergeableObject(t[r])?o[r]=function(i,a){if(!a.customMerge)return ji;var s=a.customMerge(i);return typeof s=="function"?s:ji}(r,n)(e[r],t[r],n):o[r]=wa(t[r],n))}),o}function ji(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||AS,n.isMergeableObject=n.isMergeableObject||_S,n.cloneUnlessOtherwiseSpecified=wa;var o=Array.isArray(t);return o===Array.isArray(e)?o?n.arrayMerge(e,t,n):PS(e,t,n):wa(t,n)}ji.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return ji(n,o,t)},{})};var NS=Ea(ji);const Lh=({settings:e={},components:t={},isOpen:n=!0,onClose:o,windowManagementPermissionState:r="granted",children:i,className:a,...s})=>{const c=dS&&r==="granted",u=v.useMemo(()=>NS(fS,e),[e]);return l.jsx(x2,{close:o,isOpen:n,isGlobalLayoutsAvailable:c,children:l.jsx(cS,{settings:u,components:t,children:l.jsx(lS,{children:l.jsx("div",{className:Q("launchpad",a),"data-testid":"launchpad",...s,children:i})})})})},v1=v.forwardRef((e,t)=>{const{onSearch:n,searchTerm:o,onClear:r,className:i}=e,a=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{var s;a&&"search"in a&&((s=a.search)==null||s.setDebounceMS(450))},[a]),l.jsx(nr,{id:"search-input",className:Q("search-bar",i),ref:t,placeholder:"Find anything",value:o,onChange:n,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})});v1.displayName="SearchBar";const w1=({className:e})=>{const{isLaunchpadPinned:t,isLoading:n,toggle:o}=Br();return l.jsx(Ue,{className:e,size:"32",variant:"circle",icon:t?"unpin":"pin",onClick:o,disabled:n})},Dh=({className:e})=>{const t=Pd(),{isOpen:n}=$n(),{settings:o,components:r}=d1(),{isLaunchpadPinned:i}=Br(),{isLaunchpadCollapsed:a,setIsLaunchpadCollapsed:s}=Dd(),{searchTerm:c,setSearchTerm:u}=p1(),d=v.useRef(null),{showSearch:f,showHeader:p}=o.header??{},{BeforeSearch:h,AfterSearch:m}=r.header??{};return v.useEffect(()=>{var g;n&&((g=d.current)==null||g.focus())},[n]),v.useEffect(()=>{i&&s(!1)},[s,i]),p?l.jsxs("div",{className:Q("launchpad-header",t||i?void 0:"draggable",e),"data-testid":"launchpad-header",children:[h&&l.jsx(h,{}),f&&l.jsx(v1,{ref:d,searchTerm:c,onSearch:g=>{const y=g.target.value;Gg(y)&&a&&s(!1),u(y)},onClear:()=>{var g;u(""),(g=d.current)==null||g.focus()},className:t?void 0:"non-draggable"}),m&&l.jsx(m,{}),m===void 0&&(o==null?void 0:o.mode)!=="pinned"&&l.jsx(w1,{className:"ms-auto"})]}):null};var Ot=Object.freeze({__proto__:null,ApplicationsSection:c1,Body:Th,ContentsContainer:Lh,DIALOG_TEMPLATE_NAMES:li,FavoritesSection:l1,Header:Dh,Panel:e=>l.jsxs(Lh,{...e,children:[l.jsx(Dh,{}),l.jsx(Th,{})]}),PinButton:w1,Section:$c,WorkspacesSection:h1,useActiveLayout:Ug,useFavorites:bc,useIsLaunchpadCollapsed:Dd,useIsLaunchpadPinned:Br,useOnIframeFocus:by,useOnOutsideClick:xy,usePressedKeys:ky,useStorage:Wg});function TS({isOpen:e,onClose:t,container:n}){return e?$o.createPortal(l.jsx(of,{onClose:t}),n??document.querySelector("#root")??document.body):null}const b1=v.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Wt=()=>v.useContext(b1);function x1({title:e,onOpenSettings:t,onClose:n,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:s,HeaderActions:c,HeaderBulkActions:u,HeaderSearch:d}=Dr(),{isBulkActionsSupported:f,notificationsCount:p}=Ce(),{isBulkActionsVisible:h}=Wt(),m=Ve();return l.jsxs(Do,{...o,children:[l.jsxs("div",{className:"io-panel-header-caption",children:[l.jsx(r,{title:e}),l.jsx(i,{}),l.jsxs(Do.ButtonGroup,{children:[m&&l.jsx(a,{onClick:t}),l.jsx(s,{onClick:n})]})]}),l.jsx(d,{}),f?l.jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&p>0?"io-panel-header-bulk-actions-opened":""} `,children:[l.jsx(c,{}),l.jsx(u,{})]}):l.jsx(c,{})]})}function k1({text:e="Notifications",counter:t,...n}){const{notificationsCount:o}=Ce();return l.jsx(Xn,{text:e,size:"large",...n,children:(t??!0)&&l.jsxs("span",{children:["(",o,")"]})})}const S1="newest",IS="oldest",RS="severity",kl=["None","Low","Medium","High","Critical"],Mh={key:S1,descending:!0},C1=e=>[...e].sort((t,n)=>(n.timestamp||0)-(t.timestamp||0)),E1=e=>[...e].sort((t,n)=>(t.timestamp||0)-(n.timestamp||0)),j1=(e,t)=>{const n=kl[0];return[...e].sort((o,r)=>{const i=kl.indexOf(o.severity||n),a=kl.indexOf(r.severity||n);return(t?-1:1)*(i-a)})},LS={[S1]:C1,[IS]:E1,[RS]:j1},DS={severity:"Priority",newest:"Newest",oldest:"Oldest"};function _1({...e}){const[t,n]=v.useState([]),{NotificationsList:o,Notification:r}=Dr(),{notifications:i,setCount:a,notificationsCount:s}=Ce(),{sortNotificationsBy:c,viewNotificationsBy:u,searchQuery:d}=Wt(),f=v.useRef(null),p=h0(d),h=v.useMemo(()=>((g,y)=>{if(!g)return[];switch(y){case"all":default:return g;case"unread":return g.filter(b=>b.state==="Active"||b.state==="Stale");case"read":return g.filter(b=>b.state==="Acknowledged"||b.state==="Seen");case"snoozed":return g.filter(b=>b.state==="Snoozed")}})(i,u).filter(g=>{var y,b;return g.title.toLowerCase().includes(p.toLowerCase())||((y=g.source)==null?void 0:y.toLowerCase().includes(p.toLowerCase()))||((b=g.body)==null?void 0:b.toLowerCase().includes(p.toLowerCase()))}),[p,i,u]);return v.useEffect(()=>{switch(c){case"newest":n(C1(h));break;case"oldest":n(E1(h));break;case"severity":n(j1(h,!0));break;default:n(h)}a(h.length)},[h,c,a]),v.useEffect(()=>{var m;f.current&&((m=f.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[p,s,c,u]),l.jsx(sr,{ref:f,element:xi,elementProps:e,children:l.jsx(o,{notifications:t,Notification:r})})}function O1({...e}){const{FooterButtons:t}=Dr();return l.jsx(Zr,{...e,children:l.jsx(t,{})})}function A1({className:e,...t}){const{FooterButtonClearAll:n,FooterButtonClearAllOld:o}=Dr(),{notifications:r}=Ce(),[i,a]=v.useState(!1);return v.useEffect(()=>{r.filter(s=>s.state==="Stale"||s.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),l.jsxs(Be,{className:e,align:"right",...t,children:[l.jsx(o,{disabled:!i}),l.jsx(n,{disabled:r.length<=0})]})}function P1({text:e="Clear All",...t}){const{clearAll:n}=Ce();return l.jsx(tt,{text:e,onClick:()=>{n()},...t})}function N1({text:e="Clear Old",...t}){const{clearAllOld:n}=Ce();return l.jsx(tt,{text:e,onClick:()=>{n()},...t})}function pf(e){const t=Ve(),{onClose:n,settings:o}=Ce(),{isPanelVisible:r}=Wt(),{id:i,onClick:a,updateState:s}=e,c=v.useCallback(async()=>{if(!a)return;if(!t){try{await a({close:!0})}catch(p){console.error(p)}return void n(i)}const d=(o==null?void 0:o.toastStacking)??!1;let f;f=r?(o==null?void 0:o.closeNotificationOnClick)??!0:!d&&null;try{f!==null?await a({close:f}):(await a({close:!1}),await s("Acknowledged"))}catch(p){console.error(p)}},[t,i,r,a,n,s,o==null?void 0:o.closeNotificationOnClick,o==null?void 0:o.toastStacking]),u=v.useCallback(async d=>{const f=d.target;f.closest("button")||f.closest("[role='button']")||f.closest("a")||f.closest(".io-dropdown-menu")||await c()},[c]);return{handleClick:c,handleWrapperClick:u}}function T1({className:e,notification:t,onClick:n,...o}){const r=Q("io-notification-header",e),{HeaderCount:i,HeaderBadge:a,HeaderTitle:s,HeaderTimestamp:c,HeaderButtonSnooze:u,HeaderButtonClose:d}=Hc(),{handleWrapperClick:f}=pf(t);return l.jsxs("div",{className:r,onClick:async p=>{await f(p),n==null||n(p)},...o,children:[l.jsx(a,{notification:t}),l.jsx(i,{notification:t}),l.jsx(s,{notification:t}),l.jsx(c,{notification:t}),l.jsxs(Be,{children:[l.jsx(u,{notification:t}),l.jsx(d,{notification:t})]})]})}function I1({notification:e,...t}){const{settings:n,notificationStacks:o}=Ce(),{isPanelVisible:r}=Wt(),{toastStacking:i,stackBy:a}=n,s=a==="application"?"source":a??"source";let c=0;if(i){const u=o.find(d=>d.key===e[s]);c=(u==null?void 0:u.items.length)??0}return r||!i||c<=1?null:l.jsx(xc,{...t,children:c>9?"9+":c})}function R1({className:e,notification:t,...n}){if(!(t!=null&&t.severity)||t.severity==="None")return null;const o=Q("io-notification-header-badge",e);return l.jsx(xc,{className:o,...n,children:t.severity})}function L1({className:e,state:t,severity:n="None",icon:o,...r}){const i=Q("io-notification-header-icon",e),{isPanelVisible:a}=Wt();return l.jsxs("div",{className:i,...r,children:[o&&l.jsx("span",{className:"io-notification-header-icon-image",children:l.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),l.jsx("span",{className:`io-notification-header-icon-badge color-${n.toLowerCase()}`,children:a&&t!=="Acknowledged"&&"New"})]})}function D1({className:e,notification:{appTitle:t},...n}){const o=Q("io-notification-header-title",e);return l.jsx("div",{className:o,...n,children:t})}function M1({className:e,notification:{timestamp:t,state:n,snooze:o},...r}){const i=Q("io-notification-timestamp",e);return l.jsx("small",o&&n==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:$0(t??0)??"Just Now"})}function $1({notification:{id:e,state:t},...n}){var a,s;const{settings:o,snooze:r}=Ce(),i=v.useCallback(c=>{var u;c.stopPropagation(),r&&r(e,((u=o.snooze)==null?void 0:u.duration)??0)},[e,r,(a=o.snooze)==null?void 0:a.duration]);return r&&t!=="Snoozed"&&((s=o.snooze)!=null&&s.enabled)?l.jsx(tt,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...n}):null}function H1({notification:{id:e,updateState:t},...n}){const o=Ve(),{onClose:r}=Ce(),{isPanelVisible:i}=Wt(),a=v.useCallback(s=>{s.stopPropagation(),!o||i?r(e):t("Acknowledged").catch(console.error)},[o,e,r,i,t]);return l.jsx(Ue,{icon:"close",iconSize:"10",tabIndex:-1,onClick:a,...n})}function B1({className:e,notification:t,...n}){const o=Q("io-notification-body",e),{BodyIcon:r,BodyTitle:i,BodyDescription:a}=Hc(),{icon:s,title:c,body:u}=t,{handleClick:d}=pf(t);return l.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async f=>{Mn(f)&&await d()},onClick:d,...n,children:[l.jsx(r,{icon:s}),l.jsxs("div",{className:"io-notification-body-content",children:[l.jsx(i,{text:c}),l.jsx(a,{text:u})]})]})}function z1({className:e,icon:t,altText:n="notification icon",...o}){if(!t)return null;const r=Q("io-notification-body-icon",e);return l.jsx("div",{className:r,...o,children:l.jsx("img",{src:t,alt:n})})}function F1({text:e,...t}){return l.jsx(Xn,{text:e,...t})}function W1({className:e,text:t,...n}){const o=Q("io-notification-body-description",e);return l.jsx("p",{className:o,...n,children:t})}function U1({className:e,notification:t}){const n=Q("io-notification-footer",e),{FooterButton:o}=Hc(),{handleWrapperClick:r}=pf(t),i=v.useMemo(()=>function(s){const c=[],u={};if(!s)return;s.forEach(f=>{var g;const{displayId:p,displayPath:h}=f,m={...f,children:[]};if(h&&h.length>0){let y;h.forEach((b,k)=>{var x;k===0?y=u[b]:y&&(y=(x=y.children)==null?void 0:x.find(S=>S.displayId===b))}),y&&((g=y.children)==null||g.push(m))}else p?(c.push(m),u[p]=m):c.push(m);p&&(u[p]=m)});const d=f=>{f.forEach(p=>{var h;((h=p.children)==null?void 0:h.length)===0?delete p.children:p.children&&d(p.children)})};return d(c),c}(t.actions),[t.actions]),a=(s,c)=>s.children?l.jsx(In,{text:s.title,children:s.children.map(a)},`${s.title}-${c}`):((u,d)=>l.jsx(In.Item,{children:l.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:u})},`${u.title}-${d}`))(s,c);return l.jsx("div",{className:n,onClick:r,children:l.jsx(Be,{align:"right",children:i==null?void 0:i.map((s,c)=>s.children?l.jsxs(Be,{variant:"append",children:[l.jsx(o,{notificationAction:s,variant:c===0?"primary":"default"}),l.jsx(In,{variant:c===0?"primary":"default",icon:"ellipsis",children:s.children.map(a)})]},`${s.title}-${c}`):l.jsx(o,{notificationAction:s,variant:c===0?"primary":"link"},`${s.title}-${c}`))})})}function V1({notificationAction:e,...t}){const n=v.useCallback(o=>{o.stopPropagation(),e.onClick({close:!0})},[e]);return l.jsx(tt,{text:e.title,onClick:n,...t})}const K1={Header:T1,HeaderCount:I1,HeaderBadge:R1,HeaderIcon:L1,HeaderTitle:D1,HeaderTimestamp:M1,HeaderButtonSnooze:$1,HeaderButtonClose:H1,Body:B1,BodyIcon:z1,BodyTitle:F1,BodyDescription:W1,Footer:U1,FooterButton:V1},G1=v.createContext(K1),q1=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...K1,...t}),[t]);return l.jsx(G1.Provider,{value:n,children:e})});function Hc(e){return{...v.useContext(G1),...e}}function MS({className:e,notification:t,...n}){const{Header:o,Body:r,Footer:i}=Hc(),{severity:a}=t,s=Q("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,t.state!=="Acknowledged"&&"state-new",e);return l.jsxs("div",{className:s,...n,children:[l.jsx(o,{notification:t}),l.jsx(r,{notification:t}),l.jsx(i,{notification:t})]})}function Bc({components:e,notification:t,...n}){return l.jsx(q1,{components:e,children:l.jsx(MS,{notification:t,...n})})}function J1({className:e,notifications:t,...n}){const[o,r]=v.useState(!1),i=t.length>=3?"large":"normal",a=t.length===2?"small":i,s=t[0].severity,c=Q("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],s&&s!=="None"&&[`io-notification-stack-${s.toLowerCase()}`],e),u=v.useCallback(()=>{r(!0)},[]),d=v.useCallback(f=>{f.stopPropagation(),t.forEach(p=>{p.close()})},[t]);return l.jsxs("div",{className:c,onClick:u,...n,children:[o&&a!=="normal"&&l.jsx("div",{className:"io-notification-stack-btn",children:l.jsx(tt,{icon:"close",onClick:f=>d(f),children:l.jsx("span",{className:"io-btn-text",children:"Clear Stack"})})}),t.map(f=>l.jsx(Bc,{notification:f},f.id))]})}function $S({...e}){const{notificationStacks:t}=Ce();return l.jsx(l.Fragment,{children:t.map(n=>l.jsx(J1,{notifications:n.items,...e},n.key))})}q1.displayName="ComponentsStoreProvider";const HS=({notification:e,Notification:t,...n})=>{var h;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=Ce(),{isPanelVisible:s,isBulkActionsVisible:c}=Wt(),u=((h=o.sourceFilter)==null?void 0:h.muted)??[],d=e.source&&u.includes(e.source)||u.includes("*");if(!s&&d)return null;const f=s&&r&&c,p=i.includes(e.id);return f?l.jsxs("div",{className:Q("io-notification-list-bulk-action-item",{selected:p}),children:[l.jsx(Na,{checked:p,onChange:m=>a(e.id,m.target.checked)}),l.jsx(t,{notification:e,...n})]}):l.jsx(t,{notification:e,...n})};function hf({className:e,Notification:t,notifications:n=[],noNotificationText:o="No notifications to display",...r}){const i=Q("io-notification-list",e),{settings:a}=Ce(),{isPanelVisible:s}=Wt(),{toastStacking:c}=a,u=c&&!s,d=n.length>0;return l.jsxs("div",{className:i,...r,children:[u&&l.jsx($S,{}),!u&&(d?n.map(f=>l.jsx(HS,{notification:f,Notification:t,...r},f.id)):l.jsx("div",{className:"io-notification-list-no-notifications",children:o}))]})}const Z1={Header:x1,HeaderCaptionTitle:k1,HeaderCaptionCount:function({variant:e="primary",...t}){const{notificationsCount:n=0}=Ce();return n===0?null:l.jsx(qb,{variant:e,...t,children:n>99?"99+":n})},HeaderCaptionButtonSettings:function({icon:e="cog",size:t="32",variant:n="circle",...o}){return Ve()?l.jsx(Ue,{icon:e,size:t,variant:n,...o}):null},HeaderCaptionButtonClose:function({icon:e="close",size:t="32",variant:n="circle",onClick:o,...r}){const{hidePanel:i}=Ce(),a=Ve();return l.jsx(Ue,{icon:e,size:t,variant:n,onClick:s=>{o?o(s):a&&i()},...r})},HeaderActions:function({className:e,...t}){const n=Q("io-panel-header-actions",e),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=Dr();return l.jsxs("div",{className:n,...t,children:[l.jsxs(Be,{children:[l.jsx(o,{}),l.jsx(r,{})]}),l.jsxs(Be,{children:[l.jsx(i,{}),l.jsx(a,{})]})]})},HeaderActionSort:function({text:e="Sort by",...t}){const{sortNotificationsBy:n,setSortBy:o}=Wt(),{onNotificationsSort:r}=(()=>{const{notifications:i}=Ce(),[a,s]=v.useState(Mh),{key:c,descending:u}=a,d=v.useMemo(()=>LS[c](i,u),[i,c,u]);return{onNotificationsSort:v.useCallback(p=>{s(h=>({key:p,descending:h.key!==p?Mh.descending:!h.descending}))},[]),sortedNotifications:d}})();return l.jsxs(fe,{variant:"light",...t,children:[l.jsxs(fe.Button,{variant:"link",children:[e," ",l.jsx("strong",{children:DS[n].toLowerCase()})]}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(i=>{const a=i==="Priority"?"severity":i.toLowerCase();return l.jsx(fe.Item,{isSelected:n===a,onClick:()=>{o(a),r(a)},children:i},i)})})})]})},HeaderActionView:function({text:e="View",...t}){var a;const{settings:n}=Ce(),{viewNotificationsBy:o,setViewBy:r}=Wt(),i=(a=n.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return l.jsxs(fe,{variant:"light",...t,children:[l.jsxs(fe.Button,{variant:"link",children:[e," ",l.jsx("strong",{children:o})]}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",checkIcon:"check",children:i.map(s=>l.jsx(fe.Item,{isSelected:o===s.toLowerCase(),onClick:()=>r(s.toLowerCase()),children:s},s))})})]})},HeaderActionClear:function({text:e="Clear All",...t}){const{clearAll:n,notificationsCount:o}=Ce();return l.jsx(tt,{variant:"link",text:e,onClick:n,disabled:o===0,...t})},HeaderActionEdit:function({tooltip:e="Bulk Edit",...t}){const{isBulkActionsSupported:n,notificationsCount:o}=Ce(),{showBulkActions:r}=Wt();return n?l.jsx(Ue,{icon:"pen-to-square",title:e,size:"32",onClick:r,disabled:o===0,...t}):null},HeaderBulkActions:function({className:e,...t}){const n=Q("io-panel-header-bulk-actions",e),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:s,HeaderBulkActionClear:c,HeaderBulkActionClose:u}=Dr(),{isBulkActionsSupported:d}=Ce();return d?l.jsx("div",{className:n,...t,children:l.jsxs(Be,{children:[l.jsx(o,{}),l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{}),l.jsx(s,{}),l.jsx(c,{}),l.jsx(u,{})]})}):null},HeaderBulkActionSelect:function({...e}){const{isBulkActionsSupported:t,selectedNotifications:n,selectAllNotifications:o,notificationsCount:r}=Ce();return t?l.jsx(Na,{checked:r===n.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...e}):null},HeaderBulkActionSelectDropdown:function({...e}){const{isBulkActionsSupported:t,selectAllNotifications:n,notificationsCount:o}=Ce();return t?l.jsxs(fe,{variant:"light",...e,children:[l.jsx(fe.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),l.jsx($m,{children:l.jsxs(fe.List,{variant:"single",checkIcon:"check",children:[l.jsx(fe.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>l.jsx(fe.Item,{onClick:()=>n(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:e="envelope-open",size:t="32",variant:n="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:s,notificationsCount:c}=Ce(),u=v.useCallback(()=>{s(a,"Seen")},[a,s]);return i?l.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:e="envelope",size:t="32",variant:n="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:s,notificationsCount:c}=Ce(),u=v.useCallback(()=>{s(a,"Active")},[a,s]);return i?l.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionSnooze:function({icon:e="snooze",size:t="32",variant:n="circle",tooltip:o="Snooze",...r}){var f,p;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:s,settings:c,notificationsCount:u}=Ce(),d=v.useCallback(()=>{var h;s(a,((h=c.snooze)==null?void 0:h.duration)??0)},[a,s,(f=c.snooze)==null?void 0:f.duration]);return i&&((p=c.snooze)!=null&&p.enabled)?l.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:d,disabled:u===0,...r}):null},HeaderBulkActionClear:function({icon:e="trash",size:t="32",variant:n="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:s,notificationsCount:c}=Ce(),u=v.useCallback(()=>{s(a)},[a,s]);return i?l.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionClose:function({text:e="Done",variant:t="primary",...n}){const{isBulkActionsSupported:o,notificationsCount:r}=Ce(),{hideBulkActions:i}=Wt();return o?l.jsx(tt,{variant:t,text:e,onClick:i,disabled:r===0,...n}):null},HeaderSearch:function({className:e,placeholder:t="Search",iconPrepend:n="search",iconAppend:o="close",...r}){const i=Q("io-panel-header-search",e),a=v.useRef(null),{notificationsCount:s}=Ce(),{searchQuery:c,setSearch:u}=Wt(),d=c.length>0,f=v.useCallback(()=>{u(""),a.current&&a.current.focus()},[u]);return l.jsxs("div",{className:i,children:[l.jsx(nr,{ref:a,value:c,iconPrepend:n,iconAppend:d?o:void 0,iconAppendOnClick:d?f:void 0,placeholder:t,onChange:p=>u(p.target.value),...r}),d&&l.jsx("p",{className:"io-panel-header-search-count",children:`${s} results`})]})},Body:_1,Footer:O1,FooterButtons:A1,FooterButtonClearAll:P1,FooterButtonClearAllOld:N1,Notification:Bc,NotificationsList:hf},Y1=v.createContext(Z1),X1=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Z1,...t}),[t]);return l.jsx(Y1.Provider,{value:n,children:e})});function Dr(e){return{...v.useContext(Y1),...e}}X1.displayName="ComponentsStoreProvider";function Q1(){var r,i;const e=v.useContext(Ie.IOConnectContext),{settings:t}=Ce(),n=Ve(),o=v.useCallback(async()=>{var c,u,d;const a=e.windows.my();if(!e||!a||!n)return;const s=a.placementSettings;await a.place({...s,snapped:!0,top:12,left:((c=t.placement)==null?void 0:c.panel)==="left"?12:void 0,right:((u=t.placement)==null?void 0:u.panel)==="right"?12:void 0,bottom:12,width:400,horizontalAlignment:(d=t.placement)==null?void 0:d.panel})},[e,n,(r=t.placement)==null?void 0:r.panel]);v.useEffect(()=>{var a;e&&((a=t.placement)!=null&&a.panel)&&n&&o().catch(console.error)},[e,n,o,(i=t.placement)==null?void 0:i.panel])}function BS({className:e,onClose:t,title:n="Notifications",...o}){var p,h;const{Header:r,Body:i}=Dr(),{settings:a}=Ce(),{isPanelVisible:s}=Wt(),[c,u]=v.useState(!1),d=Ve(),f=Q("io-notifications-panel",((p=a.placement)==null?void 0:p.panel)==="left"&&"io-panel-left",((h=a.placement)==null?void 0:h.panel)==="right"&&"io-panel-right",e);return Q1(),v.useEffect(()=>{s||u(!1)},[s]),l.jsxs(l.Fragment,{children:[l.jsxs(ot,{className:f,...o,children:[l.jsx(r,{title:n,onClose:t,onOpenSettings:()=>u(!0)}),l.jsx(i,{})]}),d&&s&&l.jsx(TS,{isOpen:c,onClose:()=>u(!1)})]})}const ew=({className:e,notifications:t,maxToasts:n=1,...o})=>{const r=Q("io-toasts-body",e),{NotificationsList:i,Notification:a}=rw(),[s,c]=v.useState([]);return v.useEffect(()=>{const u=n<0?t.length:n,d=t.filter(f=>f.state==="Active").slice(0,u);for(const f of d)f.onShow();c(d)},[t,n]),l.jsx("div",{className:r,...o,children:l.jsx(i,{Notification:a,notifications:s,noNotificationText:""})})};ew.displayName="Body";const tw={Body:ew,Notification:Bc,NotificationsList:hf},nw=v.createContext(tw),ow=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...tw,...t}),[t]);return l.jsx(nw.Provider,{value:n,children:e})});function rw(e){return{...v.useContext(nw),...e}}ow.displayName="ComponentsStoreProvider";function iw(){var r;const e=v.useContext(Ie.IOConnectContext),{settings:t}=Ce(),n=(r=t.placement)==null?void 0:r.toasts,o=v.useCallback(async()=>{const i=e.windows.my();if(!e||!i)return;const a=i.placementSettings;await i.place({...a,snapped:!0,left:n==="top-left"||n==="bottom-left"?12:void 0,right:n==="top-right"||n==="bottom-right"?12:void 0,width:400,verticalAlignment:n==="top-left"||n==="top-right"?"top":"bottom",horizontalAlignment:n==="top-right"||n==="bottom-right"?"right":"left"})},[e,n]);v.useEffect(()=>{e&&n&&o().catch(console.error)},[e,o,n])}function zS({className:e,maxToasts:t=10,...n}){var p;const{Header:o,Body:r,Footer:i}=rw(),{notifications:a,settings:s}=Ce(),c=v.useRef(null),u=function(h){const m=v.useContext(Ie.IOConnectContext),g=v.useRef(null),y=v.useRef(0),[b,k]=v.useState(!1),x=v.useCallback(async S=>{if(!m)return;const w=m.windows.my();if(!w)return;let C=1080;try{C=(await m.displays.getPrimary()).workArea.height}catch(_){console.warn("Could not get primary display, using fallback height:",_)}const O=Math.min(Math.max(S,92),C);if(k(S>=C),!(Math.abs(O-y.current)<5)){y.current=O;try{const _=w.placementSettings;await w.place({..._,height:O})}catch(_){console.error("Error updating toasts window height:",_)}}},[m]);return v.useEffect(()=>{if(!h.current||!m)return;const S=h.current,w=new ResizeObserver(C=>{const O=C.at(-1);if(!O)return;const{height:_}=O.contentRect,N=getComputedStyle(S),E=Number.parseInt(N.paddingTop,10),A=Number.parseInt(N.paddingBottom,10),j=(Number.isNaN(E)?0:E)+_+(Number.isNaN(A)?0:A);g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{x(j).catch(console.error)},100)});return w.observe(S),()=>{w.disconnect(),g.current&&clearTimeout(g.current)}},[m,x]),b}(c),d=(p=s.placement)==null?void 0:p.toasts,f=Q("io-toasts",(d==="top-left"||d==="top-right")&&"io-toasts-top",(d==="top-right"||d==="bottom-right")&&"io-toasts-right",(d==="bottom-left"||d==="bottom-right")&&"io-toasts-bottom",(d==="top-left"||d==="bottom-left")&&"io-toasts-left",u&&"io-toasts-max-height",e);return iw(),l.jsxs("div",{className:f,...n,children:[o&&l.jsx(o,{}),l.jsx("div",{ref:c,children:l.jsx(r,{notifications:a,maxToasts:t})}),i&&l.jsx(i,{})]})}var mf=Object.freeze({__proto__:null,Notification:Bc,NotificationBody:B1,NotificationBodyDescription:W1,NotificationBodyIcon:z1,NotificationBodyTitle:F1,NotificationFooter:U1,NotificationFooterButton:V1,NotificationHeader:T1,NotificationHeaderBadge:R1,NotificationHeaderButtonClose:H1,NotificationHeaderButtonSnooze:$1,NotificationHeaderCount:I1,NotificationHeaderIcon:L1,NotificationHeaderTimestamp:M1,NotificationHeaderTitle:D1,NotificationStack:J1,NotificationsList:hf,NotificationsPanelProvider:({children:e})=>{const{searchQuery:t,setSearch:n,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:s,isBulkActionsVisible:c,showBulkActions:u,hideBulkActions:d}=function(){const p=v.useContext(Ie.IOConnectContext),[h,m]=v.useState(!1),[g,y]=v.useState("newest"),[b,k]=v.useState("all"),[x,S]=v.useState(""),[w,C]=v.useState(!1),O=Ve(),{isBulkActionsSupported:_}=Ce();return v.useEffect(()=>{const N=mt.onPanelVisibilityChanged(E=>m(E));return()=>{N()}},[]),v.useEffect(()=>{O!==null&&O&&(async()=>{const N=await p.notifications.panel.isVisible();m(N)})()},[p.notifications.panel,O]),v.useEffect(()=>{h||(C(!1),k("all"))},[h]),{isPanelVisible:h,sortNotificationsBy:g,setSortBy:N=>{y(N)},viewNotificationsBy:b,setViewBy:N=>{k(N)},searchQuery:x,setSearch:N=>{S(N)},isBulkActionsVisible:w,showBulkActions:()=>{_&&C(!0)},hideBulkActions:()=>{_&&C(!1)}}}(),f=v.useMemo(()=>({searchQuery:t,setSearch:n,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:s,isBulkActionsVisible:c,showBulkActions:u,hideBulkActions:d}),[t,n,o,r,i,a,s,c,u,d]);return l.jsx(b1.Provider,{value:f,children:e})},NotificationsProvider:({children:e})=>{const{notifications:t,notificationStacks:n,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:s,allowedApplications:c,clearAll:u,clearAllOld:d,close:f,hidePanel:p,showPanel:h,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:b,selectedNotifications:k,selectNotification:x,selectAllNotifications:S,clearMany:w,snooze:C,snoozeMany:O,setState:_,setStates:N,setCount:E}=Dk(),A=v.useMemo(()=>({notifications:t,notificationStacks:n,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:s,allowedApplications:c,clearAll:u,clearAllOld:d,onClose:f,hidePanel:p,showPanel:h,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:b,selectedNotifications:k,selectNotification:x,selectAllNotifications:S,clearMany:w,snooze:C,snoozeMany:O,setState:_,setStates:N,setCount:E}),[t,n,o,r,i,a,s,c,u,d,f,p,h,m,g,y,b,k,x,S,w,C,O,_,N,E]);return l.jsx(dv.Provider,{value:A,children:e})},Panel:function({components:e,settings:t,...n}){return l.jsx(nf,{components:t,children:l.jsx(X1,{components:e,children:l.jsx(BS,{...n})})})},PanelBody:_1,PanelFooter:O1,PanelFooterButtonClearAll:P1,PanelFooterButtonClearAllOld:N1,PanelFooterButtons:A1,PanelHeader:x1,PanelHeaderCaptionTitle:k1,SettingsAllowNotificationToasts:hv,SettingsAllowNotifications:pv,SettingsCloseNotificationOnClick:gv,SettingsGeneral:fv,SettingsHideToastsAfter:vv,SettingsPanel:of,SettingsPanelAutoHide:yv,SettingsPlacement:kv,SettingsPlacementPanel:Cv,SettingsPlacementToasts:Ev,SettingsShowNotificationBadge:mv,SettingsSnooze:jv,SettingsSnoozeDuration:_v,SettingsStacking:wv,SettingsSubscribeAll:Av,SettingsSubscribeApp:Pv,SettingsSubscribeMuteAll:Nv,SettingsSubscribeMuteApp:Tv,SettingsSubscriptions:Ov,SettingsToastStackBy:xv,SettingsToastStacking:bv,Toasts:function({components:e,...t}){return l.jsx(ow,{components:e,children:l.jsx(zS,{...t})})},useAddRemoveApps:tf,useHidePanelOnFocusLost:function(e=!0){const t=v.useContext(Ie.IOConnectContext),n=Ve();return v.useEffect(()=>{var r;if(!t||!e||n===null||!n)return;const o=(r=t.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||t.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[t,n,e]),t},useHidePanelOnKeyUp:function(e="Escape"){const{hidePanel:t}=Ce();Ek(e,t)},useNotificationStacking:lv,useNotificationsContext:Ce,useNotificationsPanelContext:Wt,usePanelWindowPlacement:Q1,useSelectNotifications:uv,useShowHidePanelWindow:function(e=!0){const t=v.useContext(Ie.IOConnectContext),n=t==null?void 0:t.windows.my(),o=Ve(),{isPanelVisible:r}=Wt();return v.useEffect(()=>{t&&n&&o&&(r?n.show().then(()=>{e&&n.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):n.hide().catch(i=>console.error("Error hiding window:",i)))},[t,n,o,r,e]),{myWindow:n}},useToastsWindowPlacement:iw}),FS=Object.freeze({__proto__:null,AllowDocking:x0,AutoClose:({align:e="right",label:t="Auto-close on starting apps and workspaces",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:ey,disabled:!0,...n}),DockedAlwaysOnTop:k0,DockedClaimsSpace:S0,Downloads:P0,DownloadsAskForEachDownload:Y0,DownloadsLocation:Z0,General:y0,HideFavoritesFromLaunchpad:b0,HideLabelsInExtendedArea:E0,Layouts:O0,LayoutsRestoreLastSaved:({align:e="right",label:t="Restore last saved on startup",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:cy,...n}),LayoutsSaveCurrentOnExit:A0,LayoutsShowDeletePrompt:Lc,LayoutsShowUnsavedChangesPrompt:Rc,MinimizeToTray:v0,Panel:cv,PanelBody:g0,PinnedPosition:w0,ShowExtendedArea:C0,ShowFavoritesInExtendedArea:j0,ShowRecentAppsInExtendedArea:_0,System:X0,SystemRestartSection:nv,SystemShutdownSection:ov,Theme:Ic});const aw=e=>{const{General:t,Layouts:n}=zc(),o=[{key:"general",Component:t},{key:"layouts",Component:n}];return l.jsx(sr,{element:xi,elementProps:e,children:o.map(({key:r,Component:i},a)=>l.jsxs(v.Fragment,{children:[l.jsx(i,{}),a<o.length-1&&l.jsx(wo,{})]},r))})},sw=({title:e="General",...t})=>{const{Theme:n}=zc();return l.jsx(et,{title:e,"data-testid":"preferences-panel-general-block",...t,children:l.jsx(n,{})})},cw=({title:e="Layouts",...t})=>{const{LayoutsShowDeletePrompt:n}=zc();return l.jsx(et,{title:e,"data-testid":"preferences-panel-layouts-block",...t,children:l.jsx(n,{})})},lw={Body:aw,General:sw,Theme:Ic,Layouts:cw,LayoutsShowUnsavedChangesPrompt:Rc,LayoutsShowDeletePrompt:Lc},uw=v.createContext(lw),dw=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...lw,...t}),[t]);return l.jsx(uw.Provider,{value:n,children:e})});dw.displayName="PreferencesPanelComponentsStoreProvider";const zc=()=>v.useContext(uw),WS=({onClose:e,title:t="Platform Preferences",...n})=>{const{Body:o}=zc();return l.jsx(sv,{title:t,onClose:e,...n,children:l.jsx(o,{})})};var US=Object.freeze({__proto__:null,General:sw,Layouts:cw,LayoutsShowDeletePrompt:Lc,LayoutsShowUnsavedChangesPrompt:Rc,Panel:({components:e,...t})=>l.jsx(dw,{components:e,children:l.jsx(WS,{...t})}),PanelBody:aw,Theme:Ic}),fw=Object.freeze({__proto__:null,LicenseSection:Dv,Panel:Uv,PluginsSection:$v,ProductsInfoSection:Mv,Trademark:Hv,UserSection:Bv}),VS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hw={exports:{}};/*!
|
|
27
|
+
*/function W3(){if(xh)return xl;xh=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return xl=function(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var r={},i=0;i<10;i++)r["_"+String.fromCharCode(i)]=i;var a=Object.getOwnPropertyNames(r).map(function(c){return r[c]});if(a.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(c){s[c]=c}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(o,r){for(var i,a,s=function(f){if(f==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(f)}(o),c=1;c<arguments.length;c++){for(var u in i=Object(arguments[c]))t.call(i,u)&&(s[u]=i[u]);if(e){a=e(i);for(var d=0;d<a.length;d++)n.call(i,a[d])&&(s[a[d]]=i[a[d]])}}return s},xl}function Cl(){return Sh?kh:(Sh=1,kh="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}function Nh(){return Eh?Ch:(Eh=1,Ch=Function.call.bind(Object.prototype.hasOwnProperty))}if(process.env.NODE_ENV!=="production"){var U3=Ph();Wu.exports=function(){if(Oh)return kl;Oh=1;var e=Ph(),t=W3(),n=Cl(),o=Nh(),r=function(){if(_h)return jh;_h=1;var s=function(){};if(process.env.NODE_ENV!=="production"){var c=Cl(),u={},d=Nh();s=function(p){var h="Warning: "+p;typeof console<"u"&&console.error(h);try{throw new Error(h)}catch{}}}function f(p,h,m,g,y){if(process.env.NODE_ENV!=="production"){for(var b in p)if(d(p,b)){var k;try{if(typeof p[b]!="function"){var x=Error((g||"React class")+": "+m+" type `"+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[b]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}k=p[b](h,b,g,m,null,c)}catch(w){k=w}if(!k||k instanceof Error||s((g||"React class")+": type specification of "+m+" `"+b+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof k+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),k instanceof Error&&!(k.message in u)){u[k.message]=!0;var S=y?y():"";s("Failed "+m+" type: "+k.message+(S??""))}}}}return f.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(u={})},jh=f}(),i=function(){};function a(){return null}return process.env.NODE_ENV!=="production"&&(i=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}}),kl=function(s,c){var u=typeof Symbol=="function"&&Symbol.iterator,d="<<anonymous>>",f={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:m(a),arrayOf:function(w){return m(function(C,O,_,N,E){if(typeof w!="function")return new h("Property `"+E+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var A=C[O];if(!Array.isArray(A))return new h("Invalid "+N+" `"+E+"` of type `"+k(A)+"` supplied to `"+_+"`, expected an array.");for(var j=0;j<A.length;j++){var B=w(A,j,_,N,E+"["+j+"]",n);if(B instanceof Error)return B}return null})},element:m(function(w,C,O,_,N){var E=w[C];return s(E)?null:new h("Invalid "+_+" `"+N+"` of type `"+k(E)+"` supplied to `"+O+"`, expected a single ReactElement.")}),elementType:m(function(w,C,O,_,N){var E=w[C];return e.isValidElementType(E)?null:new h("Invalid "+_+" `"+N+"` of type `"+k(E)+"` supplied to `"+O+"`, expected a single ReactElement type.")}),instanceOf:function(w){return m(function(C,O,_,N,E){if(!(C[O]instanceof w)){var A=w.name||d;return new h("Invalid "+N+" `"+E+"` of type `"+((j=C[O]).constructor&&j.constructor.name?j.constructor.name:d)+"` supplied to `"+_+"`, expected instance of `"+A+"`.")}var j;return null})},node:m(function(w,C,O,_,N){return b(w[C])?null:new h("Invalid "+_+" `"+N+"` supplied to `"+O+"`, expected a ReactNode.")}),objectOf:function(w){return m(function(C,O,_,N,E){if(typeof w!="function")return new h("Property `"+E+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var A=C[O],j=k(A);if(j!=="object")return new h("Invalid "+N+" `"+E+"` of type `"+j+"` supplied to `"+_+"`, expected an object.");for(var B in A)if(o(A,B)){var $=w(A,B,_,N,E+"."+B,n);if($ instanceof Error)return $}return null})},oneOf:function(w){return Array.isArray(w)?m(function(C,O,_,N,E){for(var A=C[O],j=0;j<w.length;j++)if(p(A,w[j]))return null;var B=JSON.stringify(w,function($,R){return x(R)==="symbol"?String(R):R});return new h("Invalid "+N+" `"+E+"` of value `"+String(A)+"` supplied to `"+_+"`, expected one of "+B+".")}):(process.env.NODE_ENV!=="production"&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a)},oneOfType:function(w){if(!Array.isArray(w))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var C=0;C<w.length;C++){var O=w[C];if(typeof O!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+S(O)+" at index "+C+"."),a}return m(function(_,N,E,A,j){for(var B=[],$=0;$<w.length;$++){var R=(0,w[$])(_,N,E,A,j,n);if(R==null)return null;R.data&&o(R.data,"expectedType")&&B.push(R.data.expectedType)}return new h("Invalid "+A+" `"+j+"` supplied to `"+E+"`"+(B.length>0?", expected one of type ["+B.join(", ")+"]":"")+".")})},shape:function(w){return m(function(C,O,_,N,E){var A=C[O],j=k(A);if(j!=="object")return new h("Invalid "+N+" `"+E+"` of type `"+j+"` supplied to `"+_+"`, expected `object`.");for(var B in w){var $=w[B];if(typeof $!="function")return y(_,N,E,B,x($));var R=$(A,B,_,N,E+"."+B,n);if(R)return R}return null})},exact:function(w){return m(function(C,O,_,N,E){var A=C[O],j=k(A);if(j!=="object")return new h("Invalid "+N+" `"+E+"` of type `"+j+"` supplied to `"+_+"`, expected `object`.");var B=t({},C[O],w);for(var $ in B){var R=w[$];if(o(w,$)&&typeof R!="function")return y(_,N,E,$,x(R));if(!R)return new h("Invalid "+N+" `"+E+"` key `"+$+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(C[O],null," ")+`
|
|
28
|
+
Valid keys: `+JSON.stringify(Object.keys(w),null," "));var F=R(A,$,_,N,E+"."+$,n);if(F)return F}return null})}};function p(w,C){return w===C?w!==0||1/w==1/C:w!=w&&C!=C}function h(w,C){this.message=w,this.data=C&&typeof C=="object"?C:{},this.stack=""}function m(w){if(process.env.NODE_ENV!=="production")var C={},O=0;function _(E,A,j,B,$,R,F){if(B=B||d,R=R||j,F!==n){if(c){var z=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw z.name="Invariant Violation",z}if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var V=B+":"+j;!C[V]&&O<3&&(i("You are manually calling a React.PropTypes validation function for the `"+R+"` prop on `"+B+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),C[V]=!0,O++)}}return A[j]==null?E?A[j]===null?new h("The "+$+" `"+R+"` is marked as required in `"+B+"`, but its value is `null`."):new h("The "+$+" `"+R+"` is marked as required in `"+B+"`, but its value is `undefined`."):null:w(A,j,B,$,R)}var N=_.bind(null,!1);return N.isRequired=_.bind(null,!0),N}function g(w){return m(function(C,O,_,N,E,A){var j=C[O];return k(j)!==w?new h("Invalid "+N+" `"+E+"` of type `"+x(j)+"` supplied to `"+_+"`, expected `"+w+"`.",{expectedType:w}):null})}function y(w,C,O,_,N){return new h((w||"React class")+": "+C+" type `"+O+"."+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function b(w){switch(typeof w){case"number":case"string":case"undefined":return!0;case"boolean":return!w;case"object":if(Array.isArray(w))return w.every(b);if(w===null||s(w))return!0;var C=function(E){var A=E&&(u&&E[u]||E["@@iterator"]);if(typeof A=="function")return A}(w);if(!C)return!1;var O,_=C.call(w);if(C!==w.entries){for(;!(O=_.next()).done;)if(!b(O.value))return!1}else for(;!(O=_.next()).done;){var N=O.value;if(N&&!b(N[1]))return!1}return!0;default:return!1}}function k(w){var C=typeof w;return Array.isArray(w)?"array":w instanceof RegExp?"object":function(O,_){return O==="symbol"||!!_&&(_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol)}(C,w)?"symbol":C}function x(w){if(w==null)return""+w;var C=k(w);if(C==="object"){if(w instanceof Date)return"date";if(w instanceof RegExp)return"regexp"}return C}function S(w){var C=x(w);switch(C){case"array":case"object":return"an "+C;case"boolean":case"date":case"regexp":return"a "+C;default:return C}}return h.prototype=Error.prototype,f.checkPropTypes=r,f.resetWarningCache=r.resetWarningCache,f.PropTypes=f,f},kl}()(U3.isElement,!0)}else Wu.exports=function(){if(Ah)return Sl;Ah=1;var e=Cl();function t(){}function n(){}return n.resetWarningCache=t,Sl=function(){function o(a,s,c,u,d,f){if(f!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}function r(){return o}o.isRequired=o;var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Sl}()();var pe=Ea(Wu.exports);function Uu(e){return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uu(e)}function o1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;return t?e.split(" ").map(function(n){return t[n]||n}).join(" "):e}var V3=(typeof window>"u"?"undefined":Uu(window))==="object"&&window.Element||function(){};pe.oneOfType([pe.string,pe.func,function(e,t,n){if(!(e[t]instanceof V3))return new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected prop to be an instance of Element. Validation failed.")},pe.shape({current:pe.any})]);var r1=pe.oneOfType([pe.func,pe.string,pe.shape({$$typeof:pe.symbol,render:pe.func}),pe.arrayOf(pe.oneOfType([pe.func,pe.string,pe.shape({$$typeof:pe.symbol,render:pe.func})]))]),Th=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],K3="entering",G3="entered",q3="exiting",J3="exited",Z3=["className","cssModule","size","vertical","tag"];function Vu(){return Vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Vu.apply(this,arguments)}function Ih(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Y3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X3(e,t){if(e==null)return{};var n,o,r=function(a,s){if(a==null)return{};var c,u,d={},f=Object.keys(a);for(u=0;u<f.length;u++)c=f[u],s.indexOf(c)>=0||(d[c]=a[c]);return d}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Q3={"aria-label":pe.string,className:pe.string,cssModule:pe.object,role:pe.string,size:pe.string,tag:r1,vertical:pe.bool};function i1(e){var t=e.className,n=e.cssModule,o=e.size,r=e.vertical,i=e.tag,a=i===void 0?"div":i,s=X3(e,Z3),c=o1(Q(t,!!o&&"btn-group-"+o,r?"btn-group-vertical":"btn-group"),n);return v.createElement(a,Vu({},function(u){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?Ih(Object(f),!0).forEach(function(p){Y3(u,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(f)):Ih(Object(f)).forEach(function(p){Object.defineProperty(u,p,Object.getOwnPropertyDescriptor(f,p))})}return u}({role:"group"},s),{className:c}))}function Ku(e,t){return Ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ku(e,t)}i1.propTypes=Q3;var Rh=!1,eS=process.env.NODE_ENV!=="production"?pe.oneOfType([pe.number,pe.shape({enter:pe.number,exit:pe.number,appear:pe.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&pe.oneOfType([pe.string,pe.shape({enter:pe.string,exit:pe.string,active:pe.string}),pe.shape({enter:pe.string,enterDone:pe.string,enterActive:pe.string,exit:pe.string,exitDone:pe.string,exitActive:pe.string})]);var a1=v.createContext(null),Xi="unmounted",wr="exited",br="entering",Zr="entered",Gu="exiting",On=function(e){function t(o,r){var i;i=e.call(this,o,r)||this;var a,s=r&&!r.isMounting?o.enter:o.appear;return i.appearStatus=null,o.in?s?(a=wr,i.appearStatus=br):a=Zr:a=o.unmountOnExit||o.mountOnEnter?Xi:wr,i.state={status:a},i.nextCallback=null,i}(function(o,r){o.prototype=Object.create(r.prototype),o.prototype.constructor=o,Ku(o,r)})(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===Xi?{status:wr}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==br&&i!==Zr&&(r=br):i!==br&&i!==Zr||(r=Gu)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o,r,i,a=this.props.timeout;return o=r=i=a,a!=null&&typeof a!="number"&&(o=a.exit,r=a.enter,i=a.appear!==void 0?a.appear:r),{exit:o,enter:r,appear:i}},n.updateStatus=function(o,r){if(o===void 0&&(o=!1),r!==null)if(this.cancelNextCallback(),r===br){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Mo.findDOMNode(this);i&&function(a){a.scrollTop}(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===wr&&this.setState({status:Xi})},n.performEnter=function(o){var r=this,i=this.props.enter,a=this.context?this.context.isMounting:o,s=this.props.nodeRef?[a]:[Mo.findDOMNode(this),a],c=s[0],u=s[1],d=this.getTimeouts(),f=a?d.appear:d.enter;!o&&!i||Rh?this.safeSetState({status:Zr},function(){r.props.onEntered(c)}):(this.props.onEnter(c,u),this.safeSetState({status:br},function(){r.props.onEntering(c,u),r.onTransitionEnd(f,function(){r.safeSetState({status:Zr},function(){r.props.onEntered(c,u)})})}))},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:Mo.findDOMNode(this);r&&!Rh?(this.props.onExit(a),this.safeSetState({status:Gu},function(){o.props.onExiting(a),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:wr},function(){o.props.onExited(a)})})})):this.safeSetState({status:wr},function(){o.props.onExited(a)})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,r.nextCallback=null,o(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=this.props.nodeRef?this.props.nodeRef.current:Mo.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var s=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=s[0],u=s[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)}else setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===Xi)return null;var r=this.props,i=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var a=function(s,c){if(s==null)return{};var u={};for(var d in s)if({}.hasOwnProperty.call(s,d)){if(c.indexOf(d)!==-1)continue;u[d]=s[d]}return u}(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(a1.Provider,{value:null},typeof i=="function"?i(o,a):v.cloneElement(v.Children.only(i),a))},t}(v.Component);function Vr(){}function qu(e){return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qu(e)}On.contextType=a1,On.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:pe.shape({current:typeof Element>"u"?pe.any:function(e,t,n,o,r,i){var a=e[t];return pe.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(e,t,n,o,r,i)}}),children:pe.oneOfType([pe.func.isRequired,pe.element.isRequired]).isRequired,in:pe.bool,mountOnEnter:pe.bool,unmountOnExit:pe.bool,appear:pe.bool,enter:pe.bool,exit:pe.bool,timeout:function(e){var t=eS;e.addEndListener||(t=t.isRequired);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return t.apply(void 0,[e].concat(o))},addEndListener:pe.func,onEnter:pe.func,onEntering:pe.func,onEntered:pe.func,onExit:pe.func,onExiting:pe.func,onExited:pe.func}:{},On.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vr,onEntering:Vr,onEntered:Vr,onExit:Vr,onExiting:Vr,onExited:Vr},On.UNMOUNTED=Xi,On.EXITED=wr,On.ENTERING=br,On.ENTERED=Zr,On.EXITING=Gu;var Hi,tS=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"];function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Zs.apply(this,arguments)}function nS(e,t){if(e==null)return{};var n,o,r=function(a,s){if(a==null)return{};var c,u,d={},f=Object.keys(a);for(u=0;u<f.length;u++)c=f[u],s.indexOf(c)>=0||(d[c]=a[c]);return d}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oS(e,t,n){return t&&function(o,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,a.key,a)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ju(e,t){return Ju=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ju(e,t)}function rS(e){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,o=Ys(e);if(t){var r=Ys(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(i,a){if(a&&(qu(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s1(i)}(this,n)}}function s1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ys(e){return Ys=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ys(e)}function Lh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Ci(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lh(Object(n),!0).forEach(function(o){oi(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lh(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function oi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var iS=Ci(Ci({},On.propTypes),{},{horizontal:pe.bool,isOpen:pe.bool,children:pe.oneOfType([pe.arrayOf(pe.node),pe.node]),tag:r1,className:pe.node,navbar:pe.bool,cssModule:pe.object,innerRef:pe.shape({current:pe.object})}),aS=Ci(Ci({},On.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:350}),sS=(oi(Hi={},K3,"collapsing"),oi(Hi,G3,"collapse show"),oi(Hi,q3,"collapsing"),oi(Hi,J3,"collapse"),Hi),Xs=function(){(function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(o&&o.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),o&&Ju(n,o)})(t,v.Component);var e=rS(t);function t(n){var o;return function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),(o=e.call(this,n)).state={dimension:null},o.nodeRef=n.innerRef||v.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(r){o[r]=o[r].bind(s1(o))}),o}return oS(t,[{key:"onEntering",value:function(n,o){var r=this.getNode();this.setState({dimension:this.getDimension(r)}),this.props.onEntering(r,o)}},{key:"onEntered",value:function(n,o){var r=this.getNode();this.setState({dimension:null}),this.props.onEntered(r,o)}},{key:"onExit",value:function(){var n=this.getNode();this.setState({dimension:this.getDimension(n)}),this.props.onExit(n)}},{key:"onExiting",value:function(){var n=this.getNode();this.getDimension(n),this.setState({dimension:0}),this.props.onExiting(n)}},{key:"onExited",value:function(){var n=this.getNode();this.setState({dimension:null}),this.props.onExited(n)}},{key:"getNode",value:function(){return this.nodeRef.current}},{key:"getDimension",value:function(n){return this.props.horizontal?n.scrollWidth:n.scrollHeight}},{key:"render",value:function(){var n=this,o=this.props,r=o.tag,i=o.horizontal,a=o.isOpen,s=o.className,c=o.navbar,u=o.cssModule,d=o.children;o.innerRef;var f,p,h,m=nS(o,tS),g=this.state.dimension,y=function(k,x){for(var S,w=Array.isArray(x)?x:[x],C=w.length,O={};C>0;)O[S=w[C-=1]]=k[S];return O}(m,Th),b=(f=m,p=Th,h={},Object.keys(f).forEach(function(k){p.indexOf(k)===-1&&(h[k]=f[k])}),h);return v.createElement(On,Zs({},y,{in:a,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(k){var x=function(C){return sS[C]||"collapse"}(k),S=o1(Q(s,i&&"collapse-horizontal",x,c&&"navbar-collapse"),u),w=g===null?null:oi({},i?"width":"height",g);return v.createElement(r,Zs({},b,{style:Ci(Ci({},b.style),w),className:S,ref:n.nodeRef}),d)})}}]),t}();Xs.propTypes=iS,Xs.defaultProps=aS;const cS=e=>{const{className:t,isOpen:n,getIcon:o,showCollapseIcon:r,showFolderIcon:i,title:a,...s}=e;return l.jsx(gt.ItemHeader,{className:Q("io-base-section-header",t),prepend:i&&(o?l.jsx(wc,{size:"16",src:o(n),alt:`${a} icon`,"data-testid":`base-section-header-${a}-folder-custom-icon`}):l.jsx(xt,{size:"16",variant:n?"folder-open":"folder","data-testid":`base-section-header-${a}-folder-default-icon`})),append:r&&l.jsx(We,{className:Q("collapse-icon",!n&&"collapsed"),iconSize:"10",size:"16",icon:"expand","data-testid":"base-section-header-collapse-icon"}),tooltip:a,...s,children:a})},lS=e=>{const{isFavoritismEnabled:t=!0,item:n,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...s}=e,{favorites:c,toggleFavorite:u,isLoading:d}=Sc(),{description:f,icon:p="application",iconSrc:h,openInstances:m=0,title:g,tooltip:y,className:b,contextMenuActions:k=[]}=n,x=t&&c.some(C=>C.type===n.type&&C.title===n.title),S=h?l.jsx(wc,{size:"16",src:h,alt:`${g} icon`,"data-testid":"base-section-item-icon"}):l.jsx(xt,{size:"16",variant:p,"data-testid":"base-section-item-icon"}),w=l.jsxs(l.Fragment,{children:[m!==0&&l.jsx("span",{className:"open-instances io-text-smaller","data-testid":"base-section-item-open-instances",children:m===1?"Opened":`${m} opened`}),(t||k.length>0)&&l.jsxs(Be,{className:"item-actions",children:[t&&l.jsx(We,{...ja(C=>{C.stopPropagation(),u(n)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:x?"star-full":"star",disabled:d,"data-testid":"base-section-item-favorite-button"}),k.length>0&&l.jsx(Fd,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:g,actions:k,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[0,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,shouldCloseOnWindowResize:!0,"data-testid":"base-section-item-context-menu-button"})]})]});return l.jsx(gt.Item,{ref:a,tabIndex:i?0:-1,className:Q("io-base-section-item",b),onKeyDown:C=>{if(En(C))return o(C),C.preventDefault(),void C.stopPropagation();r(C)},onClick:o,prepend:S,append:w,description:f,tooltip:y??g,"data-testid":`base-section-item-${n.id}`,...s,children:g})},uS=new by,yf=e=>{const{config:t,level:n=1,path:o=t.id,onItemClick:r}=e,{isCollapsible:i=!0,getIcon:a}=t,s=Ey(),[c,u]=v.useState(0),d=v.useRef({}),{collapsedSections:f,toggleSection:p}=(()=>{const{value:y,update:b}=Mt({prefKey:Qg});return{collapsedSections:y,toggleSection:v.useCallback(k=>uS.enqueue(()=>b((x=[])=>x.includes(k)?x.filter(S=>S!==k):[...x,k])),[b])}})(),h=!i||!(f!=null&&f.includes(o)),m=[...t.items.filter(y=>oa(y)),...t.items.filter(y=>!oa(y))],g=y=>{var b,k;(k=(b=d.current[y])==null?void 0:b.querySelector("[tabIndex]"))==null||k.focus(),u(y)};return l.jsxs(gt.ItemWithSubItems,{className:n===1?"main-section":void 0,"data-testid":`base-section-${t.id}`,children:[l.jsx(cS,{className:n===1?"io-list-item-title main-section-header":void 0,isOpen:h,onClick:async()=>{i&&await p(o)},showCollapseIcon:i,showFolderIcon:n!==1,getIcon:a,style:{paddingLeft:16+24*Math.max(0,n-2)+"px"},"data-testid":`base-section-header-${t.id}`,title:t.title}),l.jsx(Xs,{isOpen:h,tag:gt,children:m.map((y,b)=>oa(y)?l.jsx(yf,{config:y,level:n+1,onItemClick:r,path:`${o}/${y.id}`},y.id):l.jsx(lS,{style:{paddingLeft:16+24*(n-1)+"px"},liRef:k=>d.current[b]=k,isFavoritismEnabled:y.type===vi||y.type===wi,item:y,onClick:(k,x)=>r==null?void 0:r(k,{item:y,modifier:s,selectedContextMenuActionName:x==null?void 0:x.name}),onKeyDown:k=>{kd({event:k,moveFocus:g,currentIndex:c,min:0,max:m.length-1})},isFocused:c===b},y.id))})]})},c1=e=>`${e.type}-${e.id}`,l1=e=>e.reduce((t,n)=>oa(n)?{...t,...l1(n.items)}:{...t,[c1(n)]:n},{}),u1=v.createContext(void 0),dS=({children:e})=>{const[t,n]=v.useState(null),o=v.useMemo(()=>[t,n],[t]);return l.jsx(u1.Provider,{value:o,children:e})},zc=({config:e,onItemClick:t})=>{const[n,o]=(()=>{const a=v.useContext(u1);if(a===void 0)throw new Error("useSection must be used within a SectionProvider");return a})(),r=$n(),{isLaunchpadPinned:i}=Hr();return v.useEffect(()=>{var p;if(!t||!n)return;const{itemName:a,modifier:s,selectedContextMenuActionName:c}=n,u=(d=e.items,f=a,l1(d)[f]);var d,f;u&&(t({item:u,modifier:s,selectedContextMenuActionName:c}),o(null),s===Zg||i||((p=r.close)==null||p.call(r)))},[n,e.items,r,t,o,i]),l.jsx(yf,{config:e,onItemClick:(a,s)=>{const{item:c,modifier:u,selectedContextMenuActionName:d}=s;o({itemName:c1(c),modifier:u,selectedContextMenuActionName:d})}})};function d1(e){const{isFolderCollapsible:t,isSectionCollapsible:n,sortOrder:o,folderIconGetters:r}=e,i=Rd(),a=Hg(),s=zd(),c=Kg(),u=v.useMemo(()=>((d,f,p)=>{const{isSectionCollapsible:h,sortOrder:m=va.ASCENDING}=p,g=gf({items:d,sortOrder:m,ascendingCompare:z3,descendingCompare:F3}).reduce((y,b)=>{var S;const k={id:b.id,title:b.title,description:b.caption,type:vi,icon:"application",iconSrc:b.icon,openInstances:(S=f[b.name])==null?void 0:S.length,contextMenuActions:Fg},x=b.userProperties.folder;return x?Fu({items:y,newItem:k,settings:p,path:x}):[...y,k]},[]);return{id:n1,title:"Apps",items:g,isCollapsible:h}})(i,a,{isFolderCollapsible:t,isSectionCollapsible:n,sortOrder:o,folderIconGetters:r}),[i,a,t,n,o,r]);return l.jsx(zc,{config:u,onItemClick:d=>{const{item:f,modifier:p,selectedContextMenuActionName:h}=d;return h?c(f,h):s({id:f.id,title:f.title,modifier:p})}})}const f1=e=>{const{isSectionCollapsible:t,sortOrder:n}=e,{favorites:o}=Sc(),{isFavoritesSectionHidden:r}=(()=>{const{value:a,update:s,isLoading:c,error:u}=Mt({prefKey:Dd}),d=v.useCallback(()=>s(f=>!f),[s]);return{error:u,isFavoritesSectionHidden:a,isLoading:c,toggle:d}})(),i=v.useMemo(()=>((a,s)=>{const{isSectionCollapsible:c,sortOrder:u=va.DISABLED}=s,d=gf({items:a,sortOrder:u,ascendingCompare:Xv,descendingCompare:Qv});return{id:e1,title:"Favorites",items:d,isCollapsible:c}})(o,{isSectionCollapsible:t,sortOrder:n}),[o,t,n]);return o.length>0&&!r?l.jsx(zc,{config:i}):null},p1=v.createContext(void 0),h1=()=>{const e=v.useContext(p1);if(e===void 0)throw new Error("useLaunchpadConfig must be used within an LaunchpadConfigProvider");return e},fS=({children:e,settings:t,components:n})=>{const o=v.useMemo(()=>({settings:t,components:n}),[t,n]);return l.jsx(p1.Provider,{value:o,children:e})},m1=v.createContext(void 0),g1=()=>{const e=v.useContext(m1);if(e===void 0)throw new Error("useLaunchpadSearch must be used within a LaunchpadSearchProvider");return e},pS=({children:e})=>{const[t,n]=v.useState(""),o=v.useMemo(()=>({searchTerm:t,setSearchTerm:n}),[t]);return l.jsx(m1.Provider,{value:o,children:e})},y1=e=>{const{isSectionCollapsible:t,sortOrder:n}=e,o=Hd(),r=(()=>{const[c,u]=v.useState({}),d=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{const f=d.workspaces,p=[];if(f)return(async()=>{try{const h=await f.onWorkspaceOpened(g=>u(y=>{const b={...y};return b[g.title]=b[g.title]??new Set,b[g.title].add(g.id),b})),m=await f.onWorkspaceClosed(({workspaceId:g})=>u(y=>{const b={...y};for(const k in b)if(b[k].has(g)){b[k].delete(g);break}return b}));p.push(h,m)}catch(h){console.error(h)}})(),()=>p.forEach(h=>h==null?void 0:h())},[d]),c})(),i=xc(),a=xy(),s=v.useMemo(()=>((c,u,d)=>{const{isSectionCollapsible:f,sortOrder:p=va.ASCENDING}=d,h=gf({items:c,sortOrder:p,ascendingCompare:Xv,descendingCompare:Qv}).map(m=>{var g;return{...m,type:wi,icon:"workspace",openInstances:(g=u[m.title])==null?void 0:g.size,contextMenuActions:Vg}});return{id:t1,title:"Workspaces",items:[...h,{id:wy,icon:"add",title:"Create Workspace",type:Vp,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:f}})(o,r,{isSectionCollapsible:t,sortOrder:n}),[o,r,t,n]);return l.jsx(zc,{config:s,onItemClick:c=>{const{item:u,modifier:d,selectedContextMenuActionName:f}=c;return f?a(u,f):u.type===Vp?a(u,u.id):i({id:u.id,modifier:d})}})},hS=[{placementId:e1,Component:f1},{placementId:t1,Component:y1},{placementId:n1,Component:d1}],mS="getScreenDetails"in window,gS={header:{showHeader:!0,showSearch:!0},mode:"default"},v1=()=>{const{defaultLayout:e,activeLayout:t}=$n();return n=>({name:n,isDefault:n===(e==null?void 0:e.name),isActive:n===(t==null?void 0:t.name)})},yS=()=>{const e=Kg(),t=xy(),n=(()=>{const o=vy(),r=v1(),i=Oi();return async(a,s)=>{const{id:c}=a,u=r(c);await i(()=>o({layout:u,actionName:s}))}})();return o=>o===vi?e:o===wi?t:o===ju?n:void 0},vS="rename",wS="save",bS="saveAs",xS="delete",kS="setAsDefault",SS="load",w1=e=>[{name:vS,displayName:"Rename",icon:"pen-line"},{name:wS,displayName:"Save",disabled:!e.isActive,icon:"floppy"},{name:bS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:xS,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:kS,displayName:"Set as Default",disabled:e.isDefault,icon:"user-gear",separatorAfter:!0},{name:SS,displayName:"Load",icon:"spinner"}];function CS(e){const{resultsToRender:t,isLoading:n}=(h=>{const[m,g]=v.useState([]),[y,b]=v.useState(!0),k=v.useRef(null),x=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{const S=x==null?void 0:x.search;if(!S)return;const w=[],C=[];return(async O=>{b(!0),g([]);const _=await S.query({search:O.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(_===k.current)return;k.current=_;const N=_.onResults(j=>{j.results.forEach(B=>{C.find($=>$.id===B.id&&$.type.name===B.type.name)||C.push(B)}),b(!1),g([...C])}),E=_.onCompleted(()=>{b(!1)}),A=_.onError(j=>{console.error(`Query failed. Provider: ${j.provider}; Error: ${j.error}`)});w.push(N,E,A)})(h),()=>{w.forEach(O=>O())}},[x,h]),{resultsToRender:m,isLoading:y}})(e.searchTerm),{close:o}=$n(),r=(()=>{const h=v.useContext(Te.IOConnectContext);return async m=>h.interop.methods().every(g=>g.name!==(m==null?void 0:m.method))?console.error("Interop method not found."):await h.interop.invoke(m.method,m.params,m.target).catch(g=>console.error({error:g}))})(),i=xc(),a=zd(),s=Ld(),c=yS(),u=(h=>{const m=v1();return h.reduce((g,y)=>{const{type:b}=y,k=y.id||y.displayName;if(!k)return g;let x=[];if(b.name===vi)x=Fg;else if(b.name===wi)x=Vg;else if(b.name===ju){const O=m(k);x=w1(O)}else y.secondaryActions&&(x=y.secondaryActions.map(({name:O,method:_,params:N,target:E})=>({name:O,interopParams:{method:_,params:N,target:E}})));const S={id:k,title:y.displayName||k,description:y.description,type:b.name,iconSrc:y.iconURL,mainAction:y.action,contextMenuActions:x},w=g.findIndex(({title:O})=>b.displayName?O===b.displayName:O===b.name),C=g[w];return C?[...g.slice(0,w),{...C,items:[...C.items,S]},...g.slice(w+1)]:[...g,{id:b.name,title:b.displayName||b.name,items:[S]}]},[])})(t),d=Oi(),{isLaunchpadPinned:f}=Hr(),p=async(h,m)=>{var O;const{item:g,modifier:y,selectedContextMenuActionName:b}=m,{type:k,id:x,title:S,mainAction:w}=g,C=b?(O=g.contextMenuActions)==null?void 0:O.find(_=>_.name===b):null;C!=null&&C.interopParams?r(C.interopParams):b?((_,N)=>{const E=c(_.type);E==null||E(_,N)})(g,b):w?r(w):k===vi?a({id:x,title:S,modifier:y}):k===wi?i({id:x,modifier:y}):k===ju&&d(()=>s(x)),y===Zg||f||(o==null||o())};return n?l.jsx("p",{className:"search-loading",children:"Loading..."}):t.length===0?l.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):l.jsx(gt,{children:u.map((h,m)=>l.jsx(yf,{config:h,onItemClick:p},h.id||m))})}const ES=({layoutName:e})=>{const t=v.useContext(Te.IOConnectContext),n=Oi();return l.jsx(We,{icon:"floppy",size:"24",iconSize:"12",onClick:o=>{o.stopPropagation(),n(async()=>{try{await t.layouts.save({name:e,type:"Global"}),await ze({io:t,variant:Vn,text:`Layout "${e}" was saved successfully.`})}catch(r){await ze({io:t,variant:nt,text:`Failed to save Layout "${e}".`,error:r})}})},title:"Save Layout","data-testid":"save-layout-button"})},jS=({layout:e})=>{const t=vy(),n=Oi();return l.jsx(Fd,{buttonSize:"24",iconSize:"12",title:e.name,icon:"ellipsis-vertical",actions:w1(e),onActionItemClick:async(o,r)=>{o.stopPropagation(),await n(()=>t({layout:e,actionName:r.name}))},placement:"top-end",strategy:"fixed",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,shouldCloseOnWindowResize:!0,"data-testid":"layout-context-menu-button",contextMenuDataTestId:"layout-context-menu"})},b1=({layouts:e,className:t,...n})=>{const{isLaunchpadPinned:o}=Hr(),{close:r}=$n(),i=Ld(),a=Oi(),s=()=>{o||(r==null||r())};return l.jsx(ar,{element:gt,elementProps:{className:Q("layouts-list",t),variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},...n},wrapperClassName:"layouts-list-scrollable-container",children:e.map(c=>l.jsx(gt.Item,{className:"layouts-list-item",onClick:()=>(u=>a(()=>i(u.name,s)))(c),append:l.jsxs(l.Fragment,{children:[c.isDefault&&l.jsx(Cc,{variant:"default",title:"Default Layout","data-testid":"default-layout-pill",children:"Default"}),l.jsxs(i1,{children:[c.isActive&&l.jsx(ES,{layoutName:c.name}),l.jsx(jS,{layout:c})]})]}),isSelected:c.isActive,tooltip:c.name,"data-testid":`layout-item-${c.name}`,children:c.name},c.name))})},_S=()=>{const{layouts:e}=ky(),{activeLayout:t,defaultLayout:n}=$n(),o=v.useMemo(()=>e.map(r=>({...r,isActive:r.name===(t==null?void 0:t.name),isDefault:r.name===(n==null?void 0:n.name)})),[e,t,n]);return l.jsx(b1,{layouts:o,"data-testid":"all-layouts"})},OS=()=>{const{defaultLayout:e,activeLayout:t}=$n();return t?l.jsx(b1,{layouts:[{...t,isDefault:t.name===(e==null?void 0:e.name),isActive:!0}],"data-testid":"active-layout"}):l.jsx("p",{className:"io-text-small no-active-layout","data-testid":"choose-layout-message",children:"Choose which Layout to load"})},AS=()=>{const e=v.useContext(Te.IOConnectContext),{setActiveLayout:t}=$n(),n=Oi(),o=async()=>{var d;if(!("modals"in e)||!e.modals)return void console.error("Cannot create Layout because io dialogs are not enabled");const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await e.modals.dialogs.request({templateName:ci.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:xu}},actionButtons:[{variant:"primary",text:"Create",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=c==null?void 0:c.find(f=>f.id===i))==null?void 0:d.value;if(a||(s==null?void 0:s.id)===r)try{if((await e.layouts.getAll("Global")).find(f=>f.name===u))return void await ze({io:e,variant:nt,text:`Failed to create Layout "${u}". A Layout with this name already exists.`});await e.layouts.save({name:u}),t({name:u}),await ze({io:e,variant:Vn,text:`Layout "${u}" was created successfully.`})}catch(f){await ze({io:e,variant:nt,text:`Failed to create Layout "${u}".`,error:f})}};return l.jsx(Be,{variant:"fullwidth",className:"create-layout-btn-group",children:l.jsx(tt,{variant:"primary",text:"Create Layout",onClick:()=>n(o),"data-testid":"create-layout-button"})})},PS=()=>{const e=v.useRef(null),{layouts:t,isInitialized:n}=ky(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=(()=>{const{value:a,update:s,isLoading:c,error:u}=Mt({prefKey:ty});return{error:u,isLayoutsPanelOpen:a,setIsLayoutsPanelOpen:s,isLoading:c}})();v.useEffect(()=>{!n||t.length>0||!o||r(!1)},[t,n,o,r]);const i=v.useCallback(()=>r(a=>!a),[r]);return l.jsxs("footer",{className:"layouts-panel",ref:e,"data-testid":"layouts-panel",children:[l.jsx(_i,{className:"layouts-panel-separator"}),l.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button","data-testid":"layouts-panel-header",...ja(t.length?i:void 0),children:[l.jsx(Xn,{tag:"h2",size:"normal",text:t.length>0?"Layouts":"Start using Layouts"}),t.length>0&&l.jsx(We,{className:Q("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24","data-testid":"layouts-panel-toggle-button"})]}),l.jsx(Xs,{isOpen:o,tag:"div",children:l.jsx(_S,{})}),t.length>0&&!o?l.jsx(OS,{}):l.jsx(AS,{})]})},Dh=({className:e})=>{const{isLaunchpadCollapsed:t}=Bd(),{isGlobalLayoutsAvailable:n}=$n(),{components:o}=h1(),{searchTerm:r}=g1(),{sections:i=hS}=o;return l.jsxs("div",{className:Q("launchpad-body",t?"collapsed":void 0,e),children:[l.jsx(ar,{wrapperClassName:"launchpad-main-scrollable-container",element:"main",elementProps:{className:"launchpad-main"},children:Yg(r)?l.jsx(CS,{searchTerm:r}):l.jsx(dS,{children:l.jsx(gt,{children:i.map(({Component:a,placementId:s})=>l.jsx(a,{},s))})})}),n&&l.jsx(PS,{})]})};var NS=function(e){return function(t){return!!t&&typeof t=="object"}(e)&&!function(t){var n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||function(o){return o.$$typeof===TS}(t)}(e)},TS=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function wa(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ei((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function IS(e,t,n){return e.concat(t).map(function(o){return wa(o,n)})}function Mh(e){return Object.keys(e).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}(e))}function $h(e,t){try{return t in e}catch{return!1}}function RS(e,t,n){var o={};return n.isMergeableObject(e)&&Mh(e).forEach(function(r){o[r]=wa(e[r],n)}),Mh(t).forEach(function(r){(function(i,a){return $h(i,a)&&!(Object.hasOwnProperty.call(i,a)&&Object.propertyIsEnumerable.call(i,a))})(e,r)||($h(e,r)&&n.isMergeableObject(t[r])?o[r]=function(i,a){if(!a.customMerge)return Ei;var s=a.customMerge(i);return typeof s=="function"?s:Ei}(r,n)(e[r],t[r],n):o[r]=wa(t[r],n))}),o}function Ei(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||IS,n.isMergeableObject=n.isMergeableObject||NS,n.cloneUnlessOtherwiseSpecified=wa;var o=Array.isArray(t);return o===Array.isArray(e)?o?n.arrayMerge(e,t,n):RS(e,t,n):wa(t,n)}Ei.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,o){return Ei(n,o,t)},{})};var LS=Ea(Ei);const Hh=({settings:e={},components:t={},isOpen:n=!0,onClose:o,windowManagementPermissionState:r="granted",children:i,className:a,...s})=>{const c=mS&&r==="granted",u=v.useMemo(()=>LS(gS,e),[e]);return l.jsx(C2,{close:o,isOpen:n,isGlobalLayoutsAvailable:c,children:l.jsx(fS,{settings:u,components:t,children:l.jsx(pS,{children:l.jsx("div",{className:Q("launchpad",a),"data-testid":"launchpad",...s,children:i})})})})},x1=v.forwardRef((e,t)=>{const{onSearch:n,searchTerm:o,onClear:r,className:i}=e,a=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{var s;a&&"search"in a&&((s=a.search)==null||s.setDebounceMS(450))},[a]),l.jsx(tr,{id:"search-input",className:Q("search-bar",i),ref:t,placeholder:"Find anything",value:o,onChange:n,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})});x1.displayName="SearchBar";const k1=({className:e})=>{const{isLaunchpadPinned:t,isLoading:n,toggle:o}=Hr();return l.jsx(We,{className:e,size:"32",variant:"circle",icon:t?"unpin":"pin",onClick:o,disabled:n})},Bh=({className:e})=>{const t=bc(),{isOpen:n}=$n(),{settings:o,components:r}=h1(),{isLaunchpadPinned:i}=Hr(),{isLaunchpadCollapsed:a,setIsLaunchpadCollapsed:s}=Bd(),{searchTerm:c,setSearchTerm:u}=g1(),d=v.useRef(null),{showSearch:f,showHeader:p}=o.header??{},{BeforeSearch:h,AfterSearch:m}=r.header??{};return v.useEffect(()=>{var g;n&&((g=d.current)==null||g.focus())},[n]),v.useEffect(()=>{i&&s(!1)},[s,i]),p?l.jsxs("div",{className:Q("launchpad-header",t||i?void 0:"draggable",e),"data-testid":"launchpad-header",children:[h&&l.jsx(h,{}),f&&l.jsx(x1,{ref:d,searchTerm:c,onSearch:g=>{const y=g.target.value;Yg(y)&&a&&s(!1),u(y)},onClear:()=>{var g;u(""),(g=d.current)==null||g.focus()},className:t?void 0:"non-draggable"}),m&&l.jsx(m,{}),m===void 0&&(o==null?void 0:o.mode)!=="pinned"&&l.jsx(k1,{className:"ms-auto"})]}):null};var Ot=Object.freeze({__proto__:null,ApplicationsSection:d1,Body:Dh,ContentsContainer:Hh,DIALOG_TEMPLATE_NAMES:ci,FavoritesSection:f1,Header:Bh,Panel:e=>l.jsxs(Hh,{...e,children:[l.jsx(Bh,{}),l.jsx(Dh,{})]}),PinButton:k1,Section:zc,WorkspacesSection:y1,useActiveLayout:qg,useApplications:Rd,useApplicationsInstances:Hg,useFavorites:Sc,useFrameId:bc,useIsLaunchpadCollapsed:Bd,useIsLaunchpadPinned:Hr,useOnIframeFocus:Sy,useOnOutsideClick:Cy,usePressedKeys:Ey,useRestoreWorkspace:xc,useStartApplication:zd,useStorage:Gg,useWorkspaces:Hd});v.createContext(null);const El={APPLICATION:"application",WORKSPACE:"workspace"};v.createContext(null);function DS({isOpen:e,onClose:t,container:n}){return e?Mo.createPortal(l.jsx(lf,{onClose:t}),n??document.querySelector("#root")??document.body):null}const S1=v.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Wt=()=>v.useContext(S1);function C1({title:e,onOpenSettings:t,onClose:n,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:s,HeaderActions:c,HeaderBulkActions:u,HeaderSearch:d}=Lr(),{isBulkActionsSupported:f,notificationsCount:p}=Ce(),{isBulkActionsVisible:h}=Wt(),m=Ve();return l.jsxs(Lo,{...o,children:[l.jsxs("div",{className:"io-panel-header-caption",children:[l.jsx(r,{title:e}),l.jsx(i,{}),l.jsxs(Lo.ButtonGroup,{children:[m&&l.jsx(a,{onClick:t}),l.jsx(s,{onClick:n})]})]}),l.jsx(d,{}),f?l.jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&p>0?"io-panel-header-bulk-actions-opened":""} `,children:[l.jsx(c,{}),l.jsx(u,{})]}):l.jsx(c,{})]})}function E1({text:e="Notifications",counter:t,...n}){const{notificationsCount:o}=Ce();return l.jsx(Xn,{text:e,size:"large",...n,children:(t??!0)&&l.jsxs("span",{children:["(",o,")"]})})}const j1="newest",MS="oldest",$S="severity",jl=["None","Low","Medium","High","Critical"],zh={key:j1,descending:!0},_1=e=>[...e].sort((t,n)=>(n.timestamp||0)-(t.timestamp||0)),O1=e=>[...e].sort((t,n)=>(t.timestamp||0)-(n.timestamp||0)),A1=(e,t)=>{const n=jl[0];return[...e].sort((o,r)=>{const i=jl.indexOf(o.severity||n),a=jl.indexOf(r.severity||n);return(t?-1:1)*(i-a)})},HS={[j1]:_1,[MS]:O1,[$S]:A1},BS={severity:"Priority",newest:"Newest",oldest:"Oldest"};function P1({...e}){const[t,n]=v.useState([]),{NotificationsList:o,Notification:r}=Lr(),{notifications:i,setCount:a,notificationsCount:s}=Ce(),{sortNotificationsBy:c,viewNotificationsBy:u,searchQuery:d}=Wt(),f=v.useRef(null),p=g0(d),h=v.useMemo(()=>((g,y)=>{if(!g)return[];switch(y){case"all":default:return g;case"unread":return g.filter(b=>b.state==="Active"||b.state==="Stale");case"read":return g.filter(b=>b.state==="Acknowledged"||b.state==="Seen");case"snoozed":return g.filter(b=>b.state==="Snoozed")}})(i,u).filter(g=>{var y,b;return g.title.toLowerCase().includes(p.toLowerCase())||((y=g.source)==null?void 0:y.toLowerCase().includes(p.toLowerCase()))||((b=g.body)==null?void 0:b.toLowerCase().includes(p.toLowerCase()))}),[p,i,u]);return v.useEffect(()=>{switch(c){case"newest":n(_1(h));break;case"oldest":n(O1(h));break;case"severity":n(A1(h,!0));break;default:n(h)}a(h.length)},[h,c,a]),v.useEffect(()=>{var m;f.current&&((m=f.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[p,s,c,u]),l.jsx(ar,{ref:f,element:bi,elementProps:e,children:l.jsx(o,{notifications:t,Notification:r})})}function N1({...e}){const{FooterButtons:t}=Lr();return l.jsx(Jr,{...e,children:l.jsx(t,{})})}function T1({className:e,...t}){const{FooterButtonClearAll:n,FooterButtonClearAllOld:o}=Lr(),{notifications:r}=Ce(),[i,a]=v.useState(!1);return v.useEffect(()=>{r.filter(s=>s.state==="Stale"||s.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),l.jsxs(Be,{className:e,align:"right",...t,children:[l.jsx(o,{disabled:!i}),l.jsx(n,{disabled:r.length<=0})]})}function I1({text:e="Clear All",...t}){const{clearAll:n}=Ce();return l.jsx(tt,{text:e,onClick:()=>{n()},...t})}function R1({text:e="Clear Old",...t}){const{clearAllOld:n}=Ce();return l.jsx(tt,{text:e,onClick:()=>{n()},...t})}function vf(e){const t=Ve(),{onClose:n,settings:o}=Ce(),{isPanelVisible:r}=Wt(),{id:i,onClick:a,updateState:s}=e,c=v.useCallback(async()=>{if(!a)return;if(!t){try{await a({close:!0})}catch(p){console.error(p)}return void n(i)}const d=(o==null?void 0:o.toastStacking)??!1;let f;f=r?(o==null?void 0:o.closeNotificationOnClick)??!0:!d&&null;try{f!==null?await a({close:f}):(await a({close:!1}),await s("Acknowledged"))}catch(p){console.error(p)}},[t,i,r,a,n,s,o==null?void 0:o.closeNotificationOnClick,o==null?void 0:o.toastStacking]),u=v.useCallback(async d=>{const f=d.target;f.closest("button")||f.closest("[role='button']")||f.closest("a")||f.closest(".io-dropdown-menu")||await c()},[c]);return{handleClick:c,handleWrapperClick:u}}function L1({className:e,notification:t,onClick:n,...o}){const r=Q("io-notification-header",e),{HeaderCount:i,HeaderBadge:a,HeaderTitle:s,HeaderTimestamp:c,HeaderButtonSnooze:u,HeaderButtonClose:d}=Fc(),{handleWrapperClick:f}=vf(t);return l.jsxs("div",{className:r,onClick:async p=>{await f(p),n==null||n(p)},...o,children:[l.jsx(a,{notification:t}),l.jsx(i,{notification:t}),l.jsx(s,{notification:t}),l.jsx(c,{notification:t}),l.jsxs(Be,{children:[l.jsx(u,{notification:t}),l.jsx(d,{notification:t})]})]})}function D1({notification:e,...t}){const{settings:n,notificationStacks:o}=Ce(),{isPanelVisible:r}=Wt(),{toastStacking:i,stackBy:a}=n,s=a==="application"?"source":a??"source";let c=0;if(i){const u=o.find(d=>d.key===e[s]);c=(u==null?void 0:u.items.length)??0}return r||!i||c<=1?null:l.jsx(Cc,{...t,children:c>9?"9+":c})}function M1({className:e,notification:t,...n}){if(!(t!=null&&t.severity)||t.severity==="None")return null;const o=Q("io-notification-header-badge",e);return l.jsx(Cc,{className:o,...n,children:t.severity})}function $1({className:e,state:t,severity:n="None",icon:o,...r}){const i=Q("io-notification-header-icon",e),{isPanelVisible:a}=Wt();return l.jsxs("div",{className:i,...r,children:[o&&l.jsx("span",{className:"io-notification-header-icon-image",children:l.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),l.jsx("span",{className:`io-notification-header-icon-badge color-${n.toLowerCase()}`,children:a&&t!=="Acknowledged"&&"New"})]})}function H1({className:e,notification:{appTitle:t},...n}){const o=Q("io-notification-header-title",e);return l.jsx("div",{className:o,...n,children:t})}function B1({className:e,notification:{timestamp:t,state:n,snooze:o},...r}){const i=Q("io-notification-timestamp",e);return l.jsx("small",o&&n==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:z0(t??0)??"Just Now"})}function z1({notification:{id:e,state:t},...n}){var a,s;const{settings:o,snooze:r}=Ce(),i=v.useCallback(c=>{var u;c.stopPropagation(),r&&r(e,((u=o.snooze)==null?void 0:u.duration)??0)},[e,r,(a=o.snooze)==null?void 0:a.duration]);return r&&t!=="Snoozed"&&((s=o.snooze)!=null&&s.enabled)?l.jsx(tt,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...n}):null}function F1({notification:{id:e,updateState:t},...n}){const o=Ve(),{onClose:r}=Ce(),{isPanelVisible:i}=Wt(),a=v.useCallback(s=>{s.stopPropagation(),!o||i?r(e):t("Acknowledged").catch(console.error)},[o,e,r,i,t]);return l.jsx(We,{icon:"close",iconSize:"10",tabIndex:-1,onClick:a,...n})}function W1({className:e,notification:t,...n}){const o=Q("io-notification-body",e),{BodyIcon:r,BodyTitle:i,BodyDescription:a}=Fc(),{icon:s,title:c,body:u}=t,{handleClick:d}=vf(t);return l.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async f=>{En(f)&&await d()},onClick:d,...n,children:[l.jsx(r,{icon:s}),l.jsxs("div",{className:"io-notification-body-content",children:[l.jsx(i,{text:c}),l.jsx(a,{text:u})]})]})}function U1({className:e,icon:t,altText:n="notification icon",...o}){if(!t)return null;const r=Q("io-notification-body-icon",e);return l.jsx("div",{className:r,...o,children:l.jsx("img",{src:t,alt:n})})}function V1({text:e,...t}){return l.jsx(Xn,{text:e,...t})}function K1({className:e,text:t,...n}){const o=Q("io-notification-body-description",e);return l.jsx("p",{className:o,...n,children:t})}function G1({className:e,notification:t}){const n=Q("io-notification-footer",e),{FooterButton:o}=Fc(),{handleWrapperClick:r}=vf(t),i=v.useMemo(()=>function(s){const c=[],u={};if(!s)return;s.forEach(f=>{var g;const{displayId:p,displayPath:h}=f,m={...f,children:[]};if(h&&h.length>0){let y;h.forEach((b,k)=>{var x;k===0?y=u[b]:y&&(y=(x=y.children)==null?void 0:x.find(S=>S.displayId===b))}),y&&((g=y.children)==null||g.push(m))}else p?(c.push(m),u[p]=m):c.push(m);p&&(u[p]=m)});const d=f=>{f.forEach(p=>{var h;((h=p.children)==null?void 0:h.length)===0?delete p.children:p.children&&d(p.children)})};return d(c),c}(t.actions),[t.actions]),a=(s,c)=>s.children?l.jsx(Rn,{text:s.title,children:s.children.map(a)},`${s.title}-${c}`):((u,d)=>l.jsx(Rn.Item,{children:l.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:u})},`${u.title}-${d}`))(s,c);return l.jsx("div",{className:n,onClick:r,children:l.jsx(Be,{align:"right",children:i==null?void 0:i.map((s,c)=>s.children?l.jsxs(Be,{variant:"append",children:[l.jsx(o,{notificationAction:s,variant:c===0?"primary":"default"}),l.jsx(Rn,{variant:c===0?"primary":"default",icon:"ellipsis",children:s.children.map(a)})]},`${s.title}-${c}`):l.jsx(o,{notificationAction:s,variant:c===0?"primary":"link"},`${s.title}-${c}`))})})}function q1({notificationAction:e,...t}){const n=v.useCallback(o=>{o.stopPropagation(),e.onClick({close:!0})},[e]);return l.jsx(tt,{text:e.title,onClick:n,...t})}const J1={Header:L1,HeaderCount:D1,HeaderBadge:M1,HeaderIcon:$1,HeaderTitle:H1,HeaderTimestamp:B1,HeaderButtonSnooze:z1,HeaderButtonClose:F1,Body:W1,BodyIcon:U1,BodyTitle:V1,BodyDescription:K1,Footer:G1,FooterButton:q1},Z1=v.createContext(J1),Y1=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...J1,...t}),[t]);return l.jsx(Z1.Provider,{value:n,children:e})});function Fc(e){return{...v.useContext(Z1),...e}}function zS({className:e,notification:t,...n}){const{Header:o,Body:r,Footer:i}=Fc(),{severity:a}=t,s=Q("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,t.state!=="Acknowledged"&&"state-new",e);return l.jsxs("div",{className:s,...n,children:[l.jsx(o,{notification:t}),l.jsx(r,{notification:t}),l.jsx(i,{notification:t})]})}function Wc({components:e,notification:t,...n}){return l.jsx(Y1,{components:e,children:l.jsx(zS,{notification:t,...n})})}function X1({className:e,notifications:t,...n}){const[o,r]=v.useState(!1),i=t.length>=3?"large":"normal",a=t.length===2?"small":i,s=t[0].severity,c=Q("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],s&&s!=="None"&&[`io-notification-stack-${s.toLowerCase()}`],e),u=v.useCallback(()=>{r(!0)},[]),d=v.useCallback(f=>{f.stopPropagation(),t.forEach(p=>{p.close()})},[t]);return l.jsxs("div",{className:c,onClick:u,...n,children:[o&&a!=="normal"&&l.jsx("div",{className:"io-notification-stack-btn",children:l.jsx(tt,{icon:"close",onClick:f=>d(f),children:l.jsx("span",{className:"io-btn-text",children:"Clear Stack"})})}),t.map(f=>l.jsx(Wc,{notification:f},f.id))]})}function FS({...e}){const{notificationStacks:t}=Ce();return l.jsx(l.Fragment,{children:t.map(n=>l.jsx(X1,{notifications:n.items,...e},n.key))})}Y1.displayName="ComponentsStoreProvider";const WS=({notification:e,Notification:t,...n})=>{var h;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=Ce(),{isPanelVisible:s,isBulkActionsVisible:c}=Wt(),u=((h=o.sourceFilter)==null?void 0:h.muted)??[],d=e.source&&u.includes(e.source)||u.includes("*");if(!s&&d)return null;const f=s&&r&&c,p=i.includes(e.id);return f?l.jsxs("div",{className:Q("io-notification-list-bulk-action-item",{selected:p}),children:[l.jsx(Ta,{checked:p,onChange:m=>a(e.id,m.target.checked)}),l.jsx(t,{notification:e,...n})]}):l.jsx(t,{notification:e,...n})};function wf({className:e,Notification:t,notifications:n=[],noNotificationText:o="No notifications to display",...r}){const i=Q("io-notification-list",e),{settings:a}=Ce(),{isPanelVisible:s}=Wt(),{toastStacking:c}=a,u=c&&!s,d=n.length>0;return l.jsxs("div",{className:i,...r,children:[u&&l.jsx(FS,{}),!u&&(d?n.map(f=>l.jsx(WS,{notification:f,Notification:t,...r},f.id)):l.jsx("div",{className:"io-notification-list-no-notifications",children:o}))]})}const Q1={Header:C1,HeaderCaptionTitle:E1,HeaderCaptionCount:function({variant:e="primary",...t}){const{notificationsCount:n=0}=Ce();return n===0?null:l.jsx(Hm,{variant:e,...t,children:n>99?"99+":n})},HeaderCaptionButtonSettings:function({icon:e="cog",size:t="32",variant:n="circle",...o}){return Ve()?l.jsx(We,{icon:e,size:t,variant:n,...o}):null},HeaderCaptionButtonClose:function({icon:e="close",size:t="32",variant:n="circle",onClick:o,...r}){const{hidePanel:i}=Ce(),a=Ve();return l.jsx(We,{icon:e,size:t,variant:n,onClick:s=>{o?o(s):a&&i()},...r})},HeaderActions:function({className:e,...t}){const n=Q("io-panel-header-actions",e),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=Lr();return l.jsxs("div",{className:n,...t,children:[l.jsxs(Be,{children:[l.jsx(o,{}),l.jsx(r,{})]}),l.jsxs(Be,{children:[l.jsx(i,{}),l.jsx(a,{})]})]})},HeaderActionSort:function({text:e="Sort by",...t}){const{sortNotificationsBy:n,setSortBy:o}=Wt(),{onNotificationsSort:r}=(()=>{const{notifications:i}=Ce(),[a,s]=v.useState(zh),{key:c,descending:u}=a,d=v.useMemo(()=>HS[c](i,u),[i,c,u]);return{onNotificationsSort:v.useCallback(p=>{s(h=>({key:p,descending:h.key!==p?zh.descending:!h.descending}))},[]),sortedNotifications:d}})();return l.jsxs(fe,{variant:"light",...t,children:[l.jsxs(fe.Button,{variant:"link",children:[e," ",l.jsx("strong",{children:BS[n].toLowerCase()})]}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(i=>{const a=i==="Priority"?"severity":i.toLowerCase();return l.jsx(fe.Item,{isSelected:n===a,onClick:()=>{o(a),r(a)},children:i},i)})})})]})},HeaderActionView:function({text:e="View",...t}){var a;const{settings:n}=Ce(),{viewNotificationsBy:o,setViewBy:r}=Wt(),i=(a=n.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return l.jsxs(fe,{variant:"light",...t,children:[l.jsxs(fe.Button,{variant:"link",children:[e," ",l.jsx("strong",{children:o})]}),l.jsx(fe.Content,{children:l.jsx(fe.List,{variant:"single",checkIcon:"check",children:i.map(s=>l.jsx(fe.Item,{isSelected:o===s.toLowerCase(),onClick:()=>r(s.toLowerCase()),children:s},s))})})]})},HeaderActionClear:function({text:e="Clear All",...t}){const{clearAll:n,notificationsCount:o}=Ce();return l.jsx(tt,{variant:"link",text:e,onClick:n,disabled:o===0,...t})},HeaderActionEdit:function({tooltip:e="Bulk Edit",...t}){const{isBulkActionsSupported:n,notificationsCount:o}=Ce(),{showBulkActions:r}=Wt();return n?l.jsx(We,{icon:"pen-to-square",title:e,size:"32",onClick:r,disabled:o===0,...t}):null},HeaderBulkActions:function({className:e,...t}){const n=Q("io-panel-header-bulk-actions",e),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:s,HeaderBulkActionClear:c,HeaderBulkActionClose:u}=Lr(),{isBulkActionsSupported:d}=Ce();return d?l.jsx("div",{className:n,...t,children:l.jsxs(Be,{children:[l.jsx(o,{}),l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{}),l.jsx(s,{}),l.jsx(c,{}),l.jsx(u,{})]})}):null},HeaderBulkActionSelect:function({...e}){const{isBulkActionsSupported:t,selectedNotifications:n,selectAllNotifications:o,notificationsCount:r}=Ce();return t?l.jsx(Ta,{checked:r===n.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...e}):null},HeaderBulkActionSelectDropdown:function({...e}){const{isBulkActionsSupported:t,selectAllNotifications:n,notificationsCount:o}=Ce();return t?l.jsxs(fe,{variant:"light",...e,children:[l.jsx(fe.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),l.jsx(Fm,{children:l.jsxs(fe.List,{variant:"single",checkIcon:"check",children:[l.jsx(fe.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>l.jsx(fe.Item,{onClick:()=>n(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:e="envelope-open",size:t="32",variant:n="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:s,notificationsCount:c}=Ce(),u=v.useCallback(()=>{s(a,"Seen")},[a,s]);return i?l.jsx(We,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:e="envelope",size:t="32",variant:n="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:s,notificationsCount:c}=Ce(),u=v.useCallback(()=>{s(a,"Active")},[a,s]);return i?l.jsx(We,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionSnooze:function({icon:e="snooze",size:t="32",variant:n="circle",tooltip:o="Snooze",...r}){var f,p;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:s,settings:c,notificationsCount:u}=Ce(),d=v.useCallback(()=>{var h;s(a,((h=c.snooze)==null?void 0:h.duration)??0)},[a,s,(f=c.snooze)==null?void 0:f.duration]);return i&&((p=c.snooze)!=null&&p.enabled)?l.jsx(We,{icon:e,size:t,variant:n,title:o,onClick:d,disabled:u===0,...r}):null},HeaderBulkActionClear:function({icon:e="trash",size:t="32",variant:n="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:s,notificationsCount:c}=Ce(),u=v.useCallback(()=>{s(a)},[a,s]);return i?l.jsx(We,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionClose:function({text:e="Done",variant:t="primary",...n}){const{isBulkActionsSupported:o,notificationsCount:r}=Ce(),{hideBulkActions:i}=Wt();return o?l.jsx(tt,{variant:t,text:e,onClick:i,disabled:r===0,...n}):null},HeaderSearch:function({className:e,placeholder:t="Search",iconPrepend:n="search",iconAppend:o="close",...r}){const i=Q("io-panel-header-search",e),a=v.useRef(null),{notificationsCount:s}=Ce(),{searchQuery:c,setSearch:u}=Wt(),d=c.length>0,f=v.useCallback(()=>{u(""),a.current&&a.current.focus()},[u]);return l.jsxs("div",{className:i,children:[l.jsx(tr,{ref:a,value:c,iconPrepend:n,iconAppend:d?o:void 0,iconAppendOnClick:d?f:void 0,placeholder:t,onChange:p=>u(p.target.value),...r}),d&&l.jsx("p",{className:"io-panel-header-search-count",children:`${s} results`})]})},Body:P1,Footer:N1,FooterButtons:T1,FooterButtonClearAll:I1,FooterButtonClearAllOld:R1,Notification:Wc,NotificationsList:wf},ew=v.createContext(Q1),tw=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Q1,...t}),[t]);return l.jsx(ew.Provider,{value:n,children:e})});function Lr(e){return{...v.useContext(ew),...e}}tw.displayName="ComponentsStoreProvider";function nw(){var r,i;const e=v.useContext(Te.IOConnectContext),{settings:t}=Ce(),n=Ve(),o=v.useCallback(async()=>{var c,u,d;const a=e.windows.my();if(!e||!a||!n)return;const s=a.placementSettings;await a.place({...s,snapped:!0,top:12,left:((c=t.placement)==null?void 0:c.panel)==="left"?12:void 0,right:((u=t.placement)==null?void 0:u.panel)==="right"?12:void 0,bottom:12,width:400,horizontalAlignment:(d=t.placement)==null?void 0:d.panel})},[e,n,(r=t.placement)==null?void 0:r.panel]);v.useEffect(()=>{var a;e&&((a=t.placement)!=null&&a.panel)&&n&&o().catch(console.error)},[e,n,o,(i=t.placement)==null?void 0:i.panel])}function US({className:e,onClose:t,title:n="Notifications",...o}){var p,h;const{Header:r,Body:i}=Lr(),{settings:a}=Ce(),{isPanelVisible:s}=Wt(),[c,u]=v.useState(!1),d=Ve(),f=Q("io-notifications-panel",((p=a.placement)==null?void 0:p.panel)==="left"&&"io-panel-left",((h=a.placement)==null?void 0:h.panel)==="right"&&"io-panel-right",e);return nw(),v.useEffect(()=>{s||u(!1)},[s]),l.jsxs(l.Fragment,{children:[l.jsxs(ot,{className:f,...o,children:[l.jsx(r,{title:n,onClose:t,onOpenSettings:()=>u(!0)}),l.jsx(i,{})]}),d&&s&&l.jsx(DS,{isOpen:c,onClose:()=>u(!1)})]})}const ow=({className:e,notifications:t,maxToasts:n=1,...o})=>{const r=Q("io-toasts-body",e),{NotificationsList:i,Notification:a}=sw(),[s,c]=v.useState([]);return v.useEffect(()=>{const u=n<0?t.length:n,d=t.filter(f=>f.state==="Active").slice(0,u);for(const f of d)f.onShow();c(d)},[t,n]),l.jsx("div",{className:r,...o,children:l.jsx(i,{Notification:a,notifications:s,noNotificationText:""})})};ow.displayName="Body";const rw={Body:ow,Notification:Wc,NotificationsList:wf},iw=v.createContext(rw),aw=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...rw,...t}),[t]);return l.jsx(iw.Provider,{value:n,children:e})});function sw(e){return{...v.useContext(iw),...e}}aw.displayName="ComponentsStoreProvider";function cw(){var r;const e=v.useContext(Te.IOConnectContext),{settings:t}=Ce(),n=(r=t.placement)==null?void 0:r.toasts,o=v.useCallback(async()=>{const i=e.windows.my();if(!e||!i)return;const a=i.placementSettings;await i.place({...a,snapped:!0,left:n==="top-left"||n==="bottom-left"?12:void 0,right:n==="top-right"||n==="bottom-right"?12:void 0,width:400,verticalAlignment:n==="top-left"||n==="top-right"?"top":"bottom",horizontalAlignment:n==="top-right"||n==="bottom-right"?"right":"left"})},[e,n]);v.useEffect(()=>{e&&n&&o().catch(console.error)},[e,o,n])}function VS({className:e,maxToasts:t=10,...n}){var p;const{Header:o,Body:r,Footer:i}=sw(),{notifications:a,settings:s}=Ce(),c=v.useRef(null),u=function(h){const m=v.useContext(Te.IOConnectContext),g=v.useRef(null),y=v.useRef(0),[b,k]=v.useState(!1),x=v.useCallback(async S=>{if(!m)return;const w=m.windows.my();if(!w)return;let C=1080;try{C=(await m.displays.getPrimary()).workArea.height}catch(_){console.warn("Could not get primary display, using fallback height:",_)}const O=Math.min(Math.max(S,92),C);if(k(S>=C),!(Math.abs(O-y.current)<5)){y.current=O;try{const _=w.placementSettings;await w.place({..._,height:O})}catch(_){console.error("Error updating toasts window height:",_)}}},[m]);return v.useEffect(()=>{if(!h.current||!m)return;const S=h.current,w=new ResizeObserver(C=>{const O=C.at(-1);if(!O)return;const{height:_}=O.contentRect,N=getComputedStyle(S),E=Number.parseInt(N.paddingTop,10),A=Number.parseInt(N.paddingBottom,10),j=(Number.isNaN(E)?0:E)+_+(Number.isNaN(A)?0:A);g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{x(j).catch(console.error)},100)});return w.observe(S),()=>{w.disconnect(),g.current&&clearTimeout(g.current)}},[m,x]),b}(c),d=(p=s.placement)==null?void 0:p.toasts,f=Q("io-toasts",(d==="top-left"||d==="top-right")&&"io-toasts-top",(d==="top-right"||d==="bottom-right")&&"io-toasts-right",(d==="bottom-left"||d==="bottom-right")&&"io-toasts-bottom",(d==="top-left"||d==="bottom-left")&&"io-toasts-left",u&&"io-toasts-max-height",e);return cw(),l.jsxs("div",{className:f,...n,children:[o&&l.jsx(o,{}),l.jsx("div",{ref:c,children:l.jsx(r,{notifications:a,maxToasts:t})}),i&&l.jsx(i,{})]})}var bf=Object.freeze({__proto__:null,Notification:Wc,NotificationBody:W1,NotificationBodyDescription:K1,NotificationBodyIcon:U1,NotificationBodyTitle:V1,NotificationFooter:G1,NotificationFooterButton:q1,NotificationHeader:L1,NotificationHeaderBadge:M1,NotificationHeaderButtonClose:F1,NotificationHeaderButtonSnooze:z1,NotificationHeaderCount:D1,NotificationHeaderIcon:$1,NotificationHeaderTimestamp:B1,NotificationHeaderTitle:H1,NotificationStack:X1,NotificationsList:wf,NotificationsPanelProvider:({children:e})=>{const{searchQuery:t,setSearch:n,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:s,isBulkActionsVisible:c,showBulkActions:u,hideBulkActions:d}=function(){const p=v.useContext(Te.IOConnectContext),[h,m]=v.useState(!1),[g,y]=v.useState("newest"),[b,k]=v.useState("all"),[x,S]=v.useState(""),[w,C]=v.useState(!1),O=Ve(),{isBulkActionsSupported:_}=Ce();return v.useEffect(()=>{const N=mt.onPanelVisibilityChanged(E=>m(E));return()=>{N()}},[]),v.useEffect(()=>{O!==null&&O&&(async()=>{const N=await p.notifications.panel.isVisible();m(N)})()},[p.notifications.panel,O]),v.useEffect(()=>{h||(C(!1),k("all"))},[h]),{isPanelVisible:h,sortNotificationsBy:g,setSortBy:N=>{y(N)},viewNotificationsBy:b,setViewBy:N=>{k(N)},searchQuery:x,setSearch:N=>{S(N)},isBulkActionsVisible:w,showBulkActions:()=>{_&&C(!0)},hideBulkActions:()=>{_&&C(!1)}}}(),f=v.useMemo(()=>({searchQuery:t,setSearch:n,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:s,isBulkActionsVisible:c,showBulkActions:u,hideBulkActions:d}),[t,n,o,r,i,a,s,c,u,d]);return l.jsx(S1.Provider,{value:f,children:e})},NotificationsProvider:({children:e})=>{const{notifications:t,notificationStacks:n,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:s,allowedApplications:c,clearAll:u,clearAllOld:d,close:f,hidePanel:p,showPanel:h,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:b,selectedNotifications:k,selectNotification:x,selectAllNotifications:S,clearMany:w,snooze:C,snoozeMany:O,setState:_,setStates:N,setCount:E}=Hk(),A=v.useMemo(()=>({notifications:t,notificationStacks:n,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:s,allowedApplications:c,clearAll:u,clearAllOld:d,onClose:f,hidePanel:p,showPanel:h,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:b,selectedNotifications:k,selectNotification:x,selectAllNotifications:S,clearMany:w,snooze:C,snoozeMany:O,setState:_,setStates:N,setCount:E}),[t,n,o,r,i,a,s,c,u,d,f,p,h,m,g,y,b,k,x,S,w,C,O,_,N,E]);return l.jsx(mv.Provider,{value:A,children:e})},Panel:function({components:e,settings:t,...n}){return l.jsx(cf,{components:t,children:l.jsx(tw,{components:e,children:l.jsx(US,{...n})})})},PanelBody:P1,PanelFooter:N1,PanelFooterButtonClearAll:I1,PanelFooterButtonClearAllOld:R1,PanelFooterButtons:T1,PanelHeader:C1,PanelHeaderCaptionTitle:E1,SettingsAllowNotificationToasts:yv,SettingsAllowNotifications:gv,SettingsCloseNotificationOnClick:wv,SettingsGeneral:fv,SettingsHideToastsAfter:xv,SettingsPanel:lf,SettingsPanelAutoHide:bv,SettingsPlacement:Ev,SettingsPlacementPanel:_v,SettingsPlacementToasts:Ov,SettingsShowNotificationBadge:vv,SettingsSnooze:Av,SettingsSnoozeDuration:Pv,SettingsStacking:kv,SettingsSubscribeAll:Tv,SettingsSubscribeApp:Iv,SettingsSubscribeMuteAll:Rv,SettingsSubscribeMuteApp:Lv,SettingsSubscriptions:Nv,SettingsToastStackBy:Cv,SettingsToastStacking:Sv,Toasts:function({components:e,...t}){return l.jsx(aw,{components:e,children:l.jsx(VS,{...t})})},useAddRemoveApps:sf,useHidePanelOnFocusLost:function(e=!0){const t=v.useContext(Te.IOConnectContext),n=Ve();return v.useEffect(()=>{var r;if(!t||!e||n===null||!n)return;const o=(r=t.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||t.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[t,n,e]),t},useHidePanelOnKeyUp:function(e="Escape"){const{hidePanel:t}=Ce();Ok(e,t)},useNotificationStacking:pv,useNotificationsContext:Ce,useNotificationsPanelContext:Wt,usePanelWindowPlacement:nw,useSelectNotifications:hv,useShowHidePanelWindow:function(e=!0){const t=v.useContext(Te.IOConnectContext),n=t==null?void 0:t.windows.my(),o=Ve(),{isPanelVisible:r}=Wt();return v.useEffect(()=>{t&&n&&o&&(r?n.show().then(()=>{e&&n.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):n.hide().catch(i=>console.error("Error hiding window:",i)))},[t,n,o,r,e]),{myWindow:n}},useToastsWindowPlacement:cw}),KS=Object.freeze({__proto__:null,AllowDocking:C0,AutoClose:({align:e="right",label:t="Auto-close on starting apps and workspaces",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:ry,disabled:!0,...n}),DockedAlwaysOnTop:E0,DockedClaimsSpace:j0,Downloads:I0,DownloadsAskForEachDownload:ev,DownloadsLocation:Q0,General:b0,HideFavoritesFromLaunchpad:S0,HideLabelsInExtendedArea:O0,Layouts:N0,LayoutsRestoreLastSaved:({align:e="right",label:t="Restore last saved on startup",...n})=>l.jsx(Zt,{align:e,label:t,prefKey:fy,...n}),LayoutsSaveCurrentOnExit:T0,LayoutsShowDeletePrompt:$c,LayoutsShowUnsavedChangesPrompt:Mc,MinimizeToTray:x0,Panel:dv,PanelBody:w0,PinnedPosition:k0,ShowExtendedArea:_0,ShowFavoritesInExtendedArea:A0,ShowRecentAppsInExtendedArea:P0,System:tv,SystemRestartSection:iv,SystemShutdownSection:av,Theme:Dc}),lw=Object.freeze({__proto__:null,LicenseSection:Hv,Panel:Gv,PluginsSection:zv,ProductsInfoSection:Bv,Trademark:Fv,UserSection:Wv});v.createContext(null);v.memo(function({className:e,...t}){const{notificationsCount:n,showNotificationBadge:o,toggleNotificationPanel:r}=(()=>{const s=v.useContext(Te.IOConnectContext),{settings:c}=Ce(),[u,d]=v.useState(0);v.useEffect(()=>{const p=s==null?void 0:s.notifications;if(!p)return;const h=p.onCounterChanged(m=>{d(m.count)});return()=>h==null?void 0:h()},[s==null?void 0:s.notifications]);const f=v.useCallback(async()=>{var p;if((p=s==null?void 0:s.notifications)!=null&&p.panel)try{await s.notifications.panel.isVisible()?await s.notifications.panel.hide():await s.notifications.panel.show()}catch(h){console.error("Failed to toggle notifications panel:",h)}else console.error("Notifications panel API not available")},[s]);return{showNotificationBadge:c.showNotificationBadge,notificationsCount:u,toggleNotificationPanel:f}})(),i=o&&n>0,a=n>99?"99+":n;return l.jsxs("div",{className:Q("notifications-button","non-draggable",e),...t,children:[i&&l.jsx(Hm,{variant:"primary",children:a}),l.jsx(We,{variant:"circle",icon:"bell",size:"32",title:"Notifications",onClick:r})]})});const{isClickKeypress:GS}=Yb;v.memo(function({id:e,title:t,type:n,icon:o,iconSrc:r,hasOpenInstance:i,onItemClick:a,onPerformAction:s}){const c=v.useCallback(async()=>{const f=n===El.APPLICATION?{kind:El.APPLICATION,id:e,modifier:null,title:t}:{kind:El.WORKSPACE,id:e,modifier:null};await s({type:n,id:e,title:t}),a==null||a(f)},[e,t,n,a,s]),u=t,d=r?l.jsx(wc,{size:"16",src:r,alt:`${t} icon`}):l.jsx(xt,{size:"16",variant:o});return l.jsx(gt.Item,{className:Q({"io-list-item-active":i}),prepend:d,tooltip:u??t,title:t,onClick:c,tabIndex:0,"aria-label":t,onKeyDown:f=>{GS(f)&&(f.preventDefault(),c())},children:l.jsx("span",{className:"launchpad-category-item-title",children:t})})});const uw=e=>{const{General:t,Layouts:n}=Uc();return l.jsxs(ar,{element:bi,elementProps:e,children:[l.jsx(t,{}),l.jsx(n,{})]})},dw=({title:e="General",...t})=>{const{Theme:n}=Uc();return l.jsx(et,{title:e,"data-testid":"preferences-panel-general-block",...t,children:l.jsx(n,{})})},fw=({title:e="Layouts",...t})=>{const{LayoutsShowDeletePrompt:n}=Uc();return l.jsx(et,{title:e,"data-testid":"preferences-panel-layouts-block",...t,children:l.jsx(n,{})})},pw={Body:uw,General:dw,Theme:Dc,Layouts:fw,LayoutsShowUnsavedChangesPrompt:Mc,LayoutsShowDeletePrompt:$c},hw=v.createContext(pw),mw=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...pw,...t}),[t]);return l.jsx(hw.Provider,{value:n,children:e})});mw.displayName="PreferencesPanelComponentsStoreProvider";const Uc=()=>v.useContext(hw),qS=({onClose:e,title:t="Platform Preferences",...n})=>{const{Body:o}=Uc();return l.jsx(uv,{title:t,onClose:e,...n,children:l.jsx(o,{})})};var JS=Object.freeze({__proto__:null,General:dw,Layouts:fw,LayoutsShowDeletePrompt:$c,LayoutsShowUnsavedChangesPrompt:Mc,Panel:({components:e,...t})=>l.jsx(mw,{components:e,children:l.jsx(qS,{...t})}),PanelBody:uw,Theme:Dc}),ZS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yw={exports:{}};/*!
|
|
29
29
|
Copyright (c) 2018 Jed Watson.
|
|
30
30
|
Licensed under the MIT License (MIT), see
|
|
31
31
|
http://jedwatson.github.io/classnames
|
|
32
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(hw);var KS=hw.exports;const ro=pw(KS),GS=e=>{const{active:t,className:n,...o}=e;return l.jsx(Ue,{className:ro("launchpad-button",{active:t},n),"aria-label":"Launchpad",icon:"logo",variant:"circle",size:"32",title:t?"Close Launchpad":"Open Launchpad","data-testid":"launchpad-button",...o})},mw=v.createContext(void 0),gw=()=>{const e=v.useContext(mw);if(e===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return e},Yo={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},gf="getScreenDetails"in window,qS=()=>{const e=gf?[Yo.NOTIFICATIONS,Yo.WINDOW_MANAGEMENT]:[Yo.NOTIFICATIONS];return Promise.all(e.map(async t=>{const n=await navigator.permissions.query({name:t});return n.stableName=t,n}))},JS=e=>{v.useEffect(()=>{var n;if(!((n=window.iobrowser)!=null&&n.platformStarted)||e)return;const t=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[e])},ZS=()=>{const[e,t]=v.useState(!1),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;let o;return(async()=>{var r;try{o=await((r=n.workspaces)==null?void 0:r.onWorkspaceOpened(()=>t(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[n]),e};var Ku={exports:{}};(function(e,t){(function(n,o){var r="1.0.41",i="",a="?",s="function",c="undefined",u="object",d="string",f="major",p="model",h="name",m="type",g="vendor",y="version",b="architecture",k="console",x="mobile",S="tablet",w="smarttv",C="wearable",O="embedded",_=500,N="Amazon",E="Apple",A="ASUS",j="BlackBerry",B="Browser",$="Chrome",R="Edge",F="Firefox",z="Google",V="Honor",L="Huawei",H="Lenovo",W="LG",U="Microsoft",Y="Motorola",D="Nvidia",T="OnePlus",P="Opera",I="OPPO",G="Samsung",K="Sharp",X="Sony",Z="Xiaomi",M="Zebra",se="Facebook",ce="Chromium OS",ge="Mac OS",be=" Browser",Ee=function(de,ye){var re={};for(var ve in de)ye[ve]&&ye[ve].length%2===0?re[ve]=ye[ve].concat(de[ve]):re[ve]=de[ve];return re},ne=function(de){for(var ye={},re=0;re<de.length;re++)ye[de[re].toUpperCase()]=de[re];return ye},oe=function(de,ye){return typeof de===d?te(ye).indexOf(te(de))!==-1:!1},te=function(de){return de.toLowerCase()},Se=function(de){return typeof de===d?de.replace(/[^\d\.]/g,i).split(".")[0]:o},Te=function(de,ye){if(typeof de===d)return de=de.replace(/^\s\s*/,i),typeof ye===c?de:de.substring(0,_)},le=function(de,ye){for(var re=0,ve,He,we,ie,ee,ae;re<ye.length&&!ee;){var me=ye[re],De=ye[re+1];for(ve=He=0;ve<me.length&&!ee&&me[ve];)if(ee=me[ve++].exec(de),ee)for(we=0;we<De.length;we++)ae=ee[++He],ie=De[we],typeof ie===u&&ie.length>0?ie.length===2?typeof ie[1]==s?this[ie[0]]=ie[1].call(this,ae):this[ie[0]]=ie[1]:ie.length===3?typeof ie[1]===s&&!(ie[1].exec&&ie[1].test)?this[ie[0]]=ae?ie[1].call(this,ae,ie[2]):o:this[ie[0]]=ae?ae.replace(ie[1],ie[2]):o:ie.length===4&&(this[ie[0]]=ae?ie[3].call(this,ae.replace(ie[1],ie[2])):o):this[ie]=ae||o;re+=2}},Re=function(de,ye){for(var re in ye)if(typeof ye[re]===u&&ye[re].length>0){for(var ve=0;ve<ye[re].length;ve++)if(oe(ye[re][ve],de))return re===a?o:re}else if(oe(ye[re],de))return re===a?o:re;return ye.hasOwnProperty("*")?ye["*"]:de},Ye={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},st={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},_e={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,P+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,P+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,P]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+B]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+B]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+B],y],[/\bfocus\/([\w\.]+)/i],[y,[h,F+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,P+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,P+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI"+be]],[/fxios\/([\w\.-]+)/i],[y,[h,F]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+be],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,G+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,se],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,$+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,$+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+B]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,Re,Ye]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,F+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[h,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[b,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[b,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[b,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[b,/ower/,i,te]],[/ sun4\w[;\)]/i],[[b,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[b,te]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[g,G],[m,S]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[g,G],[m,x]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[g,E],[m,x]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[g,E],[m,S]],[/(macintosh);/i],[p,[g,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[g,K],[m,x]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[g,V],[m,S]],[/honor([-\w ]+)[;\)]/i],[p,[g,V],[m,x]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[p,[g,L],[m,S]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[g,L],[m,x]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g," "],[g,Z],[m,S]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[p,/_/g," "],[g,Z],[m,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[g,I],[m,x]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[g,Re,{OnePlus:["304","403","203"],"*":I}],[m,S]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[g,"Vivo"],[m,x]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[g,"Realme"],[m,x]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[g,Y],[m,x]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[g,Y],[m,S]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[g,W],[m,S]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[g,W],[m,x]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[p,[g,H],[m,S]],[/(nokia) (t[12][01])/i],[g,p,[m,S]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g," "],[m,x],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[p,[g,z],[m,S]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[g,z],[m,x]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[g,X],[m,x]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[g,X],[m,S]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[g,T],[m,x]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[g,N],[m,S]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[g,N],[m,x]],[/(playbook);[-\w\),; ]+(rim)/i],[p,g,[m,S]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[g,j],[m,x]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[g,A],[m,S]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[g,A],[m,x]],[/(nexus 9)/i],[p,[g,"HTC"],[m,S]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[p,/_/g," "],[m,x]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[p,[g,"TCL"],[m,S]],[/(itel) ((\w+))/i],[[g,te],p,[m,Re,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[g,"Acer"],[m,S]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[g,"Meizu"],[m,x]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[g,"Ulefone"],[m,x]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[g,"Energizer"],[m,x]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[g,"Cat"],[m,x]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[g,"Smartfren"],[m,x]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[g,"Nothing"],[m,x]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[g,"Archos"],[m,S]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[g,"Archos"],[m,x]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[g,p,[m,S]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[g,p,[m,x]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,p,[m,S]],[/(surface duo)/i],[p,[g,U],[m,S]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[g,"Fairphone"],[m,x]],[/(u304aa)/i],[p,[g,"AT&T"],[m,x]],[/\bsie-(\w*)/i],[p,[g,"Siemens"],[m,x]],[/\b(rct\w+) b/i],[p,[g,"RCA"],[m,S]],[/\b(venue[\d ]{2,7}) b/i],[p,[g,"Dell"],[m,S]],[/\b(q(?:mv|ta)\w+) b/i],[p,[g,"Verizon"],[m,S]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[g,"Barnes & Noble"],[m,S]],[/\b(tm\d{3}\w+) b/i],[p,[g,"NuVision"],[m,S]],[/\b(k88) b/i],[p,[g,"ZTE"],[m,S]],[/\b(nx\d{3}j) b/i],[p,[g,"ZTE"],[m,x]],[/\b(gen\d{3}) b.+49h/i],[p,[g,"Swiss"],[m,x]],[/\b(zur\d{3}) b/i],[p,[g,"Swiss"],[m,S]],[/\b((zeki)?tb.*\b) b/i],[p,[g,"Zeki"],[m,S]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],p,[m,S]],[/\b(ns-?\w{0,9}) b/i],[p,[g,"Insignia"],[m,S]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[g,"NextBook"],[m,S]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],p,[m,x]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],p,[m,x]],[/\b(ph-1) /i],[p,[g,"Essential"],[m,x]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[g,"Envizen"],[m,S]],[/\b(trio[-\w\. ]+) b/i],[p,[g,"MachSpeed"],[m,S]],[/\btu_(1491) b/i],[p,[g,"Rotor"],[m,S]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[g,D],[m,S]],[/(sprint) (\w+)/i],[g,p,[m,x]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[g,U],[m,x]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[g,M],[m,S]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[g,M],[m,x]],[/smart-tv.+(samsung)/i],[g,[m,w]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[g,G],[m,w]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,W],[m,w]],[/(apple) ?tv/i],[g,[p,E+" TV"],[m,w]],[/crkey/i],[[p,$+"cast"],[g,z],[m,w]],[/droid.+aft(\w+)( bui|\))/i],[p,[g,N],[m,w]],[/(shield \w+ tv)/i],[p,[g,D],[m,w]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[g,K],[m,w]],[/(bravia[\w ]+)( bui|\))/i],[p,[g,X],[m,w]],[/(mi(tv|box)-?\w+) bui/i],[p,[g,Z],[m,w]],[/Hbbtv.*(technisat) (.*);/i],[g,p,[m,w]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,Te],[p,Te],[m,w]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[p,[m,w]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,w]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,p,[m,k]],[/droid.+; (shield)( bui|\))/i],[p,[g,D],[m,k]],[/(playstation \w+)/i],[p,[g,X],[m,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[g,U],[m,k]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[g,G],[m,C]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,p,[m,C]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[g,I],[m,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[g,E],[m,C]],[/(opwwe\d{3})/i],[p,[g,T],[m,C]],[/(moto 360)/i],[p,[g,Y],[m,C]],[/(smartwatch 3)/i],[p,[g,X],[m,C]],[/(g watch r)/i],[p,[g,W],[m,C]],[/droid.+; (wt63?0{2,3})\)/i],[p,[g,M],[m,C]],[/droid.+; (glass) \d/i],[p,[g,z],[m,C]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,p,[m,C]],[/; (quest( \d| pro)?)/i],[p,[g,se],[m,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[m,O]],[/(aeobc)\b/i],[p,[g,N],[m,O]],[/(homepod).+mac os/i],[p,[g,E],[m,O]],[/windows iot/i],[[m,O]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[m,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[m,S]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,S]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,x]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,R+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/ladybird\//i],[[h,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[h,[y,Re,st]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,Re,st],[h,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,ge],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(ubuntu) ([\w\.]+) like android/i],[[h,/(.+)/,"$1 Touch"],y],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[h,y],[/\(bb(10);/i],[y,[h,j]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,F+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,$+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,ce],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},Pe=function(de,ye){if(typeof de===u&&(ye=de,de=o),!(this instanceof Pe))return new Pe(de,ye).getResult();var re=typeof n!==c&&n.navigator?n.navigator:o,ve=de||(re&&re.userAgent?re.userAgent:i),He=re&&re.userAgentData?re.userAgentData:o,we=ye?Ee(_e,ye):_e,ie=re&&re.userAgent==ve;return this.getBrowser=function(){var ee={};return ee[h]=o,ee[y]=o,le.call(ee,ve,we.browser),ee[f]=Se(ee[y]),ie&&re&&re.brave&&typeof re.brave.isBrave==s&&(ee[h]="Brave"),ee},this.getCPU=function(){var ee={};return ee[b]=o,le.call(ee,ve,we.cpu),ee},this.getDevice=function(){var ee={};return ee[g]=o,ee[p]=o,ee[m]=o,le.call(ee,ve,we.device),ie&&!ee[m]&&He&&He.mobile&&(ee[m]=x),ie&&ee[p]=="Macintosh"&&re&&typeof re.standalone!==c&&re.maxTouchPoints&&re.maxTouchPoints>2&&(ee[p]="iPad",ee[m]=S),ee},this.getEngine=function(){var ee={};return ee[h]=o,ee[y]=o,le.call(ee,ve,we.engine),ee},this.getOS=function(){var ee={};return ee[h]=o,ee[y]=o,le.call(ee,ve,we.os),ie&&!ee[h]&&He&&He.platform&&He.platform!="Unknown"&&(ee[h]=He.platform.replace(/chrome os/i,ce).replace(/macos/i,ge)),ee},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ve},this.setUA=function(ee){return ve=typeof ee===d&&ee.length>_?Te(ee,_):ee,this},this.setUA(ve),this};Pe.VERSION=r,Pe.BROWSER=ne([h,y,f]),Pe.CPU=ne([b]),Pe.DEVICE=ne([p,g,m,k,x,w,S,C,O]),Pe.ENGINE=Pe.OS=ne([h,y]),e.exports&&(t=e.exports=Pe),t.UAParser=Pe;var $e=typeof n!==c&&(n.jQuery||n.Zepto);if($e&&!$e.ua){var Le=new Pe;$e.ua=Le.getResult(),$e.ua.get=function(){return Le.getUA()},$e.ua.set=function(de){Le.setUA(de);var ye=Le.getResult();for(var re in ye)$e.ua[re]=ye[re]}}})(typeof window=="object"?window:VS)})(Ku,Ku.exports);var YS=Ku.exports;const kr=new YS.UAParser,XS=()=>J.useMemo(()=>({os:kr.getOS(),browser:kr.getBrowser(),cpu:kr.getCPU(),device:kr.getDevice(),engine:kr.getEngine(),ua:kr.getUA()}),[]),QS=()=>J.useMemo(()=>kr.getBrowser(),[]),yf=()=>{const{ua:e}=XS();return e.includes("io-connect-desktop")},yw=()=>{const[e,t]=v.useState([]),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.notifications.onRaised(a=>t(s=>[...s,a])),r=n.notifications.onClosed(a=>t(s=>s.filter(c=>c.id!==a.id))),i=n.notifications.onStateChanged(({id:a},s)=>{t(c=>{const u=c.findIndex(d=>d.id===a);return u===-1?c:[...c.slice(0,u),{...c[u],state:s},...c.slice(u+1)]})});return n.notifications.list().then(t).catch(console.error),()=>{o(),r(),i()}},[n]),e},eC=()=>{const[e,t]=v.useState({}),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.notifications.onConfigurationChanged(r=>t(r));return()=>{o()}},[n]),e},tC="interopio_home_ui_auth0_validation_error",nC="interopio_home_ui_user",oC="interopio_home_ui_platform_window",Ia="interopio_home_ui_platform_setup";var Nt=function(e){return{ok:!0,result:e}},kt=function(e){return{ok:!1,error:e}},rC=function(e){return e.ok===!0?Promise.resolve(e.result):Promise.reject(e.error)},iC=function(e,t){return t.ok===!0?t.result:e},aC=function(e){if(e.ok===!0)return e.result;throw e.error},sC=function(e,t){return t.ok===!0?Nt(e(t.result)):t},$h=function(e,t,n){return t.ok===!1?t:n.ok===!1?n:Nt(e(t.result,n.result))},Sl=function(e,t){return t.ok===!0?t:kt(e(t.error))},cC=function(e,t){return t.ok===!0?e(t.result):t};/*! *****************************************************************************
|
|
32
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(yw);var YS=yw.exports;const ro=gw(YS),XS=e=>{const{active:t,className:n,...o}=e;return l.jsx(We,{className:ro("launchpad-button",{active:t},n),"aria-label":"Launchpad",icon:"logo",variant:"circle",size:"32",title:t?"Close Launchpad":"Open Launchpad","data-testid":"launchpad-button",...o})},vw=v.createContext(void 0),ww=()=>{const e=v.useContext(vw);if(e===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return e},Zo={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},xf="getScreenDetails"in window,QS=()=>{const e=xf?[Zo.NOTIFICATIONS,Zo.WINDOW_MANAGEMENT]:[Zo.NOTIFICATIONS];return Promise.all(e.map(async t=>{const n=await navigator.permissions.query({name:t});return n.stableName=t,n}))},eC=e=>{v.useEffect(()=>{var n;if(!((n=window.iobrowser)!=null&&n.platformStarted)||e)return;const t=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[e])},tC=()=>{const[e,t]=v.useState(!1),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;let o;return(async()=>{var r;try{o=await((r=n.workspaces)==null?void 0:r.onWorkspaceOpened(()=>t(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[n]),e};var Zu={exports:{}};(function(e,t){(function(n,o){var r="1.0.41",i="",a="?",s="function",c="undefined",u="object",d="string",f="major",p="model",h="name",m="type",g="vendor",y="version",b="architecture",k="console",x="mobile",S="tablet",w="smarttv",C="wearable",O="embedded",_=500,N="Amazon",E="Apple",A="ASUS",j="BlackBerry",B="Browser",$="Chrome",R="Edge",F="Firefox",z="Google",V="Honor",L="Huawei",H="Lenovo",W="LG",U="Microsoft",Y="Motorola",D="Nvidia",T="OnePlus",P="Opera",I="OPPO",G="Samsung",K="Sharp",X="Sony",Z="Xiaomi",M="Zebra",se="Facebook",ce="Chromium OS",ge="Mac OS",be=" Browser",Ee=function(de,ye){var re={};for(var ve in de)ye[ve]&&ye[ve].length%2===0?re[ve]=ye[ve].concat(de[ve]):re[ve]=de[ve];return re},ne=function(de){for(var ye={},re=0;re<de.length;re++)ye[de[re].toUpperCase()]=de[re];return ye},oe=function(de,ye){return typeof de===d?te(ye).indexOf(te(de))!==-1:!1},te=function(de){return de.toLowerCase()},Se=function(de){return typeof de===d?de.replace(/[^\d\.]/g,i).split(".")[0]:o},Ie=function(de,ye){if(typeof de===d)return de=de.replace(/^\s\s*/,i),typeof ye===c?de:de.substring(0,_)},le=function(de,ye){for(var re=0,ve,He,we,ie,ee,ae;re<ye.length&&!ee;){var me=ye[re],De=ye[re+1];for(ve=He=0;ve<me.length&&!ee&&me[ve];)if(ee=me[ve++].exec(de),ee)for(we=0;we<De.length;we++)ae=ee[++He],ie=De[we],typeof ie===u&&ie.length>0?ie.length===2?typeof ie[1]==s?this[ie[0]]=ie[1].call(this,ae):this[ie[0]]=ie[1]:ie.length===3?typeof ie[1]===s&&!(ie[1].exec&&ie[1].test)?this[ie[0]]=ae?ie[1].call(this,ae,ie[2]):o:this[ie[0]]=ae?ae.replace(ie[1],ie[2]):o:ie.length===4&&(this[ie[0]]=ae?ie[3].call(this,ae.replace(ie[1],ie[2])):o):this[ie]=ae||o;re+=2}},Re=function(de,ye){for(var re in ye)if(typeof ye[re]===u&&ye[re].length>0){for(var ve=0;ve<ye[re].length;ve++)if(oe(ye[re][ve],de))return re===a?o:re}else if(oe(ye[re],de))return re===a?o:re;return ye.hasOwnProperty("*")?ye["*"]:de},Ye={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},st={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},_e={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,P+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,P+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,P]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+B]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+B]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+B],y],[/\bfocus\/([\w\.]+)/i],[y,[h,F+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,P+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,P+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI"+be]],[/fxios\/([\w\.-]+)/i],[y,[h,F]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+be],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,G+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,se],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,$+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,$+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+B]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,Re,Ye]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,F+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[h,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[b,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[b,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[b,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[b,/ower/,i,te]],[/ sun4\w[;\)]/i],[[b,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[b,te]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[g,G],[m,S]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[g,G],[m,x]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[g,E],[m,x]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[g,E],[m,S]],[/(macintosh);/i],[p,[g,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[g,K],[m,x]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[g,V],[m,S]],[/honor([-\w ]+)[;\)]/i],[p,[g,V],[m,x]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[p,[g,L],[m,S]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[g,L],[m,x]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g," "],[g,Z],[m,S]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[p,/_/g," "],[g,Z],[m,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[g,I],[m,x]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[g,Re,{OnePlus:["304","403","203"],"*":I}],[m,S]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[g,"Vivo"],[m,x]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[g,"Realme"],[m,x]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[g,Y],[m,x]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[g,Y],[m,S]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[g,W],[m,S]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[g,W],[m,x]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[p,[g,H],[m,S]],[/(nokia) (t[12][01])/i],[g,p,[m,S]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g," "],[m,x],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[p,[g,z],[m,S]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[g,z],[m,x]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[g,X],[m,x]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[g,X],[m,S]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[g,T],[m,x]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[g,N],[m,S]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[g,N],[m,x]],[/(playbook);[-\w\),; ]+(rim)/i],[p,g,[m,S]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[g,j],[m,x]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[g,A],[m,S]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[g,A],[m,x]],[/(nexus 9)/i],[p,[g,"HTC"],[m,S]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[p,/_/g," "],[m,x]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[p,[g,"TCL"],[m,S]],[/(itel) ((\w+))/i],[[g,te],p,[m,Re,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[g,"Acer"],[m,S]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[g,"Meizu"],[m,x]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[g,"Ulefone"],[m,x]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[g,"Energizer"],[m,x]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[g,"Cat"],[m,x]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[g,"Smartfren"],[m,x]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[g,"Nothing"],[m,x]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[g,"Archos"],[m,S]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[g,"Archos"],[m,x]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[g,p,[m,S]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[g,p,[m,x]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,p,[m,S]],[/(surface duo)/i],[p,[g,U],[m,S]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[g,"Fairphone"],[m,x]],[/(u304aa)/i],[p,[g,"AT&T"],[m,x]],[/\bsie-(\w*)/i],[p,[g,"Siemens"],[m,x]],[/\b(rct\w+) b/i],[p,[g,"RCA"],[m,S]],[/\b(venue[\d ]{2,7}) b/i],[p,[g,"Dell"],[m,S]],[/\b(q(?:mv|ta)\w+) b/i],[p,[g,"Verizon"],[m,S]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[g,"Barnes & Noble"],[m,S]],[/\b(tm\d{3}\w+) b/i],[p,[g,"NuVision"],[m,S]],[/\b(k88) b/i],[p,[g,"ZTE"],[m,S]],[/\b(nx\d{3}j) b/i],[p,[g,"ZTE"],[m,x]],[/\b(gen\d{3}) b.+49h/i],[p,[g,"Swiss"],[m,x]],[/\b(zur\d{3}) b/i],[p,[g,"Swiss"],[m,S]],[/\b((zeki)?tb.*\b) b/i],[p,[g,"Zeki"],[m,S]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],p,[m,S]],[/\b(ns-?\w{0,9}) b/i],[p,[g,"Insignia"],[m,S]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[g,"NextBook"],[m,S]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],p,[m,x]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],p,[m,x]],[/\b(ph-1) /i],[p,[g,"Essential"],[m,x]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[g,"Envizen"],[m,S]],[/\b(trio[-\w\. ]+) b/i],[p,[g,"MachSpeed"],[m,S]],[/\btu_(1491) b/i],[p,[g,"Rotor"],[m,S]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[g,D],[m,S]],[/(sprint) (\w+)/i],[g,p,[m,x]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[g,U],[m,x]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[g,M],[m,S]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[g,M],[m,x]],[/smart-tv.+(samsung)/i],[g,[m,w]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[g,G],[m,w]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,W],[m,w]],[/(apple) ?tv/i],[g,[p,E+" TV"],[m,w]],[/crkey/i],[[p,$+"cast"],[g,z],[m,w]],[/droid.+aft(\w+)( bui|\))/i],[p,[g,N],[m,w]],[/(shield \w+ tv)/i],[p,[g,D],[m,w]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[g,K],[m,w]],[/(bravia[\w ]+)( bui|\))/i],[p,[g,X],[m,w]],[/(mi(tv|box)-?\w+) bui/i],[p,[g,Z],[m,w]],[/Hbbtv.*(technisat) (.*);/i],[g,p,[m,w]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,Ie],[p,Ie],[m,w]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[p,[m,w]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,w]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,p,[m,k]],[/droid.+; (shield)( bui|\))/i],[p,[g,D],[m,k]],[/(playstation \w+)/i],[p,[g,X],[m,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[g,U],[m,k]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[g,G],[m,C]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,p,[m,C]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[g,I],[m,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[g,E],[m,C]],[/(opwwe\d{3})/i],[p,[g,T],[m,C]],[/(moto 360)/i],[p,[g,Y],[m,C]],[/(smartwatch 3)/i],[p,[g,X],[m,C]],[/(g watch r)/i],[p,[g,W],[m,C]],[/droid.+; (wt63?0{2,3})\)/i],[p,[g,M],[m,C]],[/droid.+; (glass) \d/i],[p,[g,z],[m,C]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,p,[m,C]],[/; (quest( \d| pro)?)/i],[p,[g,se],[m,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[m,O]],[/(aeobc)\b/i],[p,[g,N],[m,O]],[/(homepod).+mac os/i],[p,[g,E],[m,O]],[/windows iot/i],[[m,O]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[m,x]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[m,S]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,S]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,x]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,R+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/ladybird\//i],[[h,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[h,[y,Re,st]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,Re,st],[h,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,ge],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(ubuntu) ([\w\.]+) like android/i],[[h,/(.+)/,"$1 Touch"],y],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[h,y],[/\(bb(10);/i],[y,[h,j]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,F+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,$+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,ce],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},Pe=function(de,ye){if(typeof de===u&&(ye=de,de=o),!(this instanceof Pe))return new Pe(de,ye).getResult();var re=typeof n!==c&&n.navigator?n.navigator:o,ve=de||(re&&re.userAgent?re.userAgent:i),He=re&&re.userAgentData?re.userAgentData:o,we=ye?Ee(_e,ye):_e,ie=re&&re.userAgent==ve;return this.getBrowser=function(){var ee={};return ee[h]=o,ee[y]=o,le.call(ee,ve,we.browser),ee[f]=Se(ee[y]),ie&&re&&re.brave&&typeof re.brave.isBrave==s&&(ee[h]="Brave"),ee},this.getCPU=function(){var ee={};return ee[b]=o,le.call(ee,ve,we.cpu),ee},this.getDevice=function(){var ee={};return ee[g]=o,ee[p]=o,ee[m]=o,le.call(ee,ve,we.device),ie&&!ee[m]&&He&&He.mobile&&(ee[m]=x),ie&&ee[p]=="Macintosh"&&re&&typeof re.standalone!==c&&re.maxTouchPoints&&re.maxTouchPoints>2&&(ee[p]="iPad",ee[m]=S),ee},this.getEngine=function(){var ee={};return ee[h]=o,ee[y]=o,le.call(ee,ve,we.engine),ee},this.getOS=function(){var ee={};return ee[h]=o,ee[y]=o,le.call(ee,ve,we.os),ie&&!ee[h]&&He&&He.platform&&He.platform!="Unknown"&&(ee[h]=He.platform.replace(/chrome os/i,ce).replace(/macos/i,ge)),ee},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ve},this.setUA=function(ee){return ve=typeof ee===d&&ee.length>_?Ie(ee,_):ee,this},this.setUA(ve),this};Pe.VERSION=r,Pe.BROWSER=ne([h,y,f]),Pe.CPU=ne([b]),Pe.DEVICE=ne([p,g,m,k,x,w,S,C,O]),Pe.ENGINE=Pe.OS=ne([h,y]),e.exports&&(t=e.exports=Pe),t.UAParser=Pe;var $e=typeof n!==c&&(n.jQuery||n.Zepto);if($e&&!$e.ua){var Le=new Pe;$e.ua=Le.getResult(),$e.ua.get=function(){return Le.getUA()},$e.ua.set=function(de){Le.setUA(de);var ye=Le.getResult();for(var re in ye)$e.ua[re]=ye[re]}}})(typeof window=="object"?window:ZS)})(Zu,Zu.exports);var nC=Zu.exports;const xr=new nC.UAParser,oC=()=>J.useMemo(()=>({os:xr.getOS(),browser:xr.getBrowser(),cpu:xr.getCPU(),device:xr.getDevice(),engine:xr.getEngine(),ua:xr.getUA()}),[]),rC=()=>J.useMemo(()=>xr.getBrowser(),[]),kf=()=>{const{ua:e}=oC();return e.includes("io-connect-desktop")},bw=()=>{const[e,t]=v.useState([]),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.notifications.onRaised(a=>t(s=>[...s,a])),r=n.notifications.onClosed(a=>t(s=>s.filter(c=>c.id!==a.id))),i=n.notifications.onStateChanged(({id:a},s)=>{t(c=>{const u=c.findIndex(d=>d.id===a);return u===-1?c:[...c.slice(0,u),{...c[u],state:s},...c.slice(u+1)]})});return n.notifications.list().then(t).catch(console.error),()=>{o(),r(),i()}},[n]),e},iC=()=>{const[e,t]=v.useState({}),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.notifications.onConfigurationChanged(r=>t(r));return()=>{o()}},[n]),e},aC="interopio_home_ui_auth0_validation_error",sC="interopio_home_ui_user",cC="interopio_home_ui_platform_window",Ra="interopio_home_ui_platform_setup";var Nt=function(e){return{ok:!0,result:e}},St=function(e){return{ok:!1,error:e}},lC=function(e){return e.ok===!0?Promise.resolve(e.result):Promise.reject(e.error)},uC=function(e,t){return t.ok===!0?t.result:e},dC=function(e){if(e.ok===!0)return e.result;throw e.error},fC=function(e,t){return t.ok===!0?Nt(e(t.result)):t},Fh=function(e,t,n){return t.ok===!1?t:n.ok===!1?n:Nt(e(t.result,n.result))},_l=function(e,t){return t.ok===!0?t:St(e(t.error))},pC=function(e,t){return t.ok===!0?e(t.result):t};/*! *****************************************************************************
|
|
33
33
|
Copyright (c) Microsoft Corporation.
|
|
34
34
|
|
|
35
35
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -42,36 +42,36 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
42
42
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
43
43
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
44
44
|
PERFORMANCE OF THIS SOFTWARE.
|
|
45
|
-
***************************************************************************** */var Gu=function(){return Gu=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Gu.apply(this,arguments)};function lC(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function qu(e,t){if(e===t||e===null&&t===null)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!qu(e[n],t[n]))return!1;return!0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(var n=0;n<o.length;n++)if(!t.hasOwnProperty(o[n])||!qu(e[o[n]],t[o[n]]))return!1;return!0}}var Qi=function(e){return Array.isArray(e)},os=function(e){return typeof e=="object"&&e!==null&&!Qi(e)},uC=function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}},so=function(e,t){return"expected "+e+", got "+uC(t)},Bi=function(e){return e.map(function(t){return typeof t=="string"?"."+t:"["+t+"]"}).join("")},zi=function(e,t){var n=t.at,o=lC(t,["at"]);return Gu({at:e+(n||"")},o)},At=function(){function e(t){var n=this;this.decode=t,this.run=function(o){return Sl(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},n.decode(o))},this.runPromise=function(o){return rC(n.run(o))},this.runWithException=function(o){return aC(n.run(o))},this.map=function(o){return new e(function(r){return sC(o,n.decode(r))})},this.andThen=function(o){return new e(function(r){return cC(function(i){return o(i).decode(r)},n.decode(r))})},this.where=function(o,r){return n.andThen(function(i){return o(i)?e.succeed(i):e.fail(r)})}}return e.string=function(){return new e(function(t){return typeof t=="string"?Nt(t):kt({message:so("a string",t)})})},e.number=function(){return new e(function(t){return typeof t=="number"?Nt(t):kt({message:so("a number",t)})})},e.boolean=function(){return new e(function(t){return typeof t=="boolean"?Nt(t):kt({message:so("a boolean",t)})})},e.constant=function(t){return new e(function(n){return qu(n,t)?Nt(t):kt({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(n)})})},e.object=function(t){return new e(function(n){if(os(n)&&t){var o={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].decode(n[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return n[r]===void 0?kt({message:"the key '"+r+"' is required but was not present"}):kt(zi("."+r,i.error))}return Nt(o)}else return os(n)?Nt(n):kt({message:so("an object",n)})})},e.array=function(t){return new e(function(n){if(Qi(n)&&t){var o=function(r,i){return Sl(function(a){return zi("["+i+"]",a)},t.decode(r))};return n.reduce(function(r,i,a){return $h(function(s,c){return s.concat([c])},r,o(i,a))},Nt([]))}else return Qi(n)?Nt(n):kt({message:so("an array",n)})})},e.tuple=function(t){return new e(function(n){if(Qi(n)){if(n.length!==t.length)return kt({message:"expected a tuple of length "+t.length+", got one of length "+n.length});for(var o=[],r=0;r<t.length;r++){var i=t[r].decode(n[r]);if(i.ok)o[r]=i.result;else return kt(zi("["+r+"]",i.error))}return Nt(o)}else return kt({message:so("a tuple of length "+t.length,n)})})},e.union=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new e(function(i){return[t,n].concat(o).reduce(function(a,s){return $h(Object.assign,a,s.decode(i))},Nt({}))})},e.anyJson=function(){return new e(function(t){return Nt(t)})},e.unknownJson=function(){return new e(function(t){return Nt(t)})},e.dict=function(t){return new e(function(n){if(os(n)){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=t.decode(n[r]);if(i.ok===!0)o[r]=i.result;else return kt(zi("."+r,i.error))}return Nt(o)}else return kt({message:so("an object",n)})})},e.optional=function(t){return new e(function(n){return n==null?Nt(void 0):t.decode(n)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(o){for(var r=[],i=0;i<t.length;i++){var a=t[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var s=r.map(function(c){return"at error"+(c.at||"")+": "+c.message}).join('", "');return kt({message:'expected a value matching one of the decoders, got the errors ["'+s+'"]'})})},e.withDefault=function(t,n){return new e(function(o){return Nt(iC(t,n.decode(o)))})},e.valueAt=function(t,n){return new e(function(o){for(var r=o,i=0;i<t.length;i++){if(r===void 0)return kt({at:Bi(t.slice(0,i+1)),message:"path does not exist"});if(typeof t[i]=="string"&&!os(r))return kt({at:Bi(t.slice(0,i+1)),message:so("an object",r)});if(typeof t[i]=="number"&&!Qi(r))return kt({at:Bi(t.slice(0,i+1)),message:so("an array",r)});r=r[t[i]]}return Sl(function(a){return r===void 0?{at:Bi(t),message:"path does not exist"}:zi(Bi(t),a)},n.decode(r))})},e.succeed=function(t){return new e(function(n){return Nt(t)})},e.fail=function(t){return new e(function(n){return kt({message:t})})},e.lazy=function(t){return new e(function(n){return t().decode(n)})},e}(),dC=At.string,fC=At.number,ba=At.boolean,Vt=At.anyJson;At.unknownJson;var or=At.constant,ht=At.object,pC=At.array;At.tuple;At.dict;var Me=At.optional,xa=At.oneOf;At.union;At.intersection;At.withDefault;At.valueAt;At.succeed;var hC=At.fail;At.lazy;const sn=dC().where(e=>e.length>0,"Expected a non-empty string"),mC=fC().where(e=>e>=0,"Expected a non-negative number"),mn=(e,t)=>{const n=typeof e;return n==="function"?Vt():hC(`The provided argument as ${t} should be of type function, provided: ${typeof n}`)},gC=ht({name:sn}),Ra=ht({isCompleted:ba()}),yC=Ot.useStorage,vf=()=>{const[e,t]=yC("sessionStorage",oC,gC);return{isPlatformWindow:!e||window.name===e.name,setPlatformWindow:t}},vC=Ot.useIsLaunchpadPinned,vw=Ot.useOnIframeFocus,ww=Ot.useOnOutsideClick,wC=Ot.usePressedKeys,Mr=Ot.useStorage,bw=v.createContext(void 0),cr=()=>{const e=v.useContext(bw);if(e===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return e},bC=({children:e})=>{const[t,n]=Mr("localStorage",Ia,Ra),[o,r]=v.useState([]),i=v.useMemo(()=>o.reduce((f,p)=>({...f,[p.stableName]:{state:p.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[s,c]=v.useState(!1),u={isLoggingOut:s,setIsLoggingOut:c};v.useEffect(()=>{let f=!1;const p=qS().then(h=>{if(f)return;r(h);const m=[];let g=!1;return h.forEach((y,b)=>{const k=x=>{if(f||!x.target||g)return;const S=x.target;if(S.state==="prompt")return n({isCompleted:!1}),g=!0,window.location.reload();r(C=>[...C.slice(0,b),S,...C.slice(b+1)])};y.addEventListener("change",k),m.push(()=>y.removeEventListener("change",k))}),m}).catch(console.warn);return()=>{f=!0,p.then(h=>{h==null||h.forEach(m=>m())})}},[n]);const d=v.useMemo(()=>({permission:a,login:u}),[a,u]);return l.jsx(bw.Provider,{value:d,children:e})},xC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,fill:"#3C3E3F",rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),l.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,stroke:"#4B4E4F",strokeMiterlimit:10,rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),l.jsx("path",{fill:"#36A86B",d:"M125.31 100.086c-1.656 0-3-1.41-3-3.149 0-1.74 1.344-3.15 3-3.15 1.657 0 3 1.41 3 3.15s-1.343 3.149-3 3.149Z"}),l.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),l.jsx("path",{fill:"#fff",d:"M84.068 42.02c0-.466.408-.932.932-.932.466 0 .932.466.932.932v.99c4.66.467 8.388 4.428 8.388 9.262v1.748a9.57 9.57 0 0 0 2.796 6.756l.174.175c.466.466.758 1.165.758 1.806a2.61 2.61 0 0 1-2.621 2.621H74.514c-1.456-.058-2.563-1.165-2.563-2.621 0-.7.233-1.34.758-1.806l.116-.175c1.806-1.805 2.854-4.252 2.854-6.757v-1.747a9.3 9.3 0 0 1 8.388-9.261v-.99ZM85 44.816c-4.136 0-7.456 3.379-7.456 7.456v1.748c0 3.028-1.223 5.94-3.378 8.096l-.175.117a.94.94 0 0 0-.175.524c0 .408.291.699.7.699h20.91c.408 0 .758-.291.758-.7 0-.174-.117-.349-.233-.523l-.175-.117a11.502 11.502 0 0 1-3.378-8.155v-1.689c0-4.077-3.32-7.456-7.456-7.456H85Zm-1.806 23.008c.291.758.99 1.224 1.806 1.224.757 0 1.456-.466 1.747-1.224.175-.466.7-.757 1.165-.582a.976.976 0 0 1 .583 1.223A3.717 3.717 0 0 1 85 70.912c-1.631 0-3.029-.99-3.553-2.447a.976.976 0 0 1 .582-1.223c.466-.175.99.116 1.165.582Z"}),l.jsx("path",{fill:"#36A86B",d:"M113.791 86.146c-1.922 0-3.48-1.62-3.48-3.62 0-1.999 1.558-3.62 3.48-3.62s3.481 1.621 3.481 3.62c0 2-1.559 3.62-3.481 3.62Z"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),kC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("path",{fill:"#3C3E3F",stroke:"#5D5D5D",strokeMiterlimit:10,d:"M22.338.5h125.324c2.746 0 4.941 2.144 4.941 4.75v76.938c0 2.608-2.195 4.751-4.941 4.751H22.338c-2.746 0-4.94-2.143-4.94-4.75V5.25c0-2.607 2.194-4.751 4.94-4.751Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M116.905 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533ZM127.206 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M137.505 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),l.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),l.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M45.501 53.17a1 1 0 0 1 1.414 0l6.364 6.363a1 1 0 0 1-1.414 1.415l-4.657-4.657v48.23a1 1 0 0 1-2 0v-48.23l-4.657 4.657a1 1 0 0 1-1.414-1.415l6.364-6.364Z",clipRule:"evenodd"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),SC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeLinejoin:"round",strokeMiterlimit:10,d:"M27.449 103.584a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.495 1.495 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5V88.6h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V66.37h.5V64.35h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V42.12h.5V40.1h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5V19.89h-.5V17.87h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5V40.1h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5V88.6h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),l.jsx("path",{fill:"#5A5C5C",d:"M128 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),l.jsx("path",{fill:"#DDD",d:"M143.015 89.758a6.667 6.667 0 0 0 5.823-3.379c1.237-2.082 1.237-4.646 0-6.758-1.207-2.082-3.409-3.38-5.823-3.38a6.742 6.742 0 0 0-5.853 3.38c-1.237 2.112-1.237 4.676 0 6.758 1.207 2.112 3.409 3.38 5.853 3.38Zm0-14.482c2.746 0 5.28 1.479 6.668 3.862 1.388 2.414 1.388 5.34 0 7.724a7.666 7.666 0 0 1-6.668 3.862 7.678 7.678 0 0 1-6.698-3.862c-1.388-2.384-1.388-5.31 0-7.724a7.741 7.741 0 0 1 6.698-3.862Zm.724 2.897a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-1.689 7.723c0 .543.422.966.965.966a.973.973 0 0 0 .966-.966.993.993 0 0 0-.966-.965.972.972 0 0 0-.965.965Zm-.966 0c0-1.056.845-1.93 1.931-1.93.513 0 .996.21 1.328.573l3.228-1.931a.478.478 0 0 1 .664.15c.15.242.06.544-.151.664l-3.228 1.931c.06.181.09.362.09.543 0 1.087-.875 1.931-1.931 1.931a1.906 1.906 0 0 1-1.931-1.93Zm6.034-6.275a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-8.93 2.655c.392 0 .724.332.724.724a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.301-.724.724-.724Zm2.172-2.655a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Z"}),l.jsx("path",{fill:"#5A5C5C",d:"M12 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),l.jsx("path",{fill:"#DDD",d:"M27.351 76.62a.804.804 0 0 0-.73 0L21.45 78.81c-.322.117-.556.438-.526.789 0 2.746 1.139 7.596 5.697 9.787a.804.804 0 0 0 .73 0c4.558-2.19 5.697-7.04 5.727-9.787a.855.855 0 0 0-.556-.789l-5.17-2.191Zm-1.08-.877a1.816 1.816 0 0 1 1.46 0l5.142 2.192c.643.292 1.14.905 1.14 1.665-.03 2.922-1.228 8.21-6.253 10.635a1.798 1.798 0 0 1-1.548 0c-5.026-2.425-6.223-7.713-6.223-10.635-.03-.76.467-1.373 1.11-1.665l5.171-2.192Z"}),l.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),l.jsx("path",{fill:"#DDD",d:"M18.653 23.886c.132-.184.422-.237.58-.079l16.033 12.657a.394.394 0 0 1 .08.58c-.133.185-.396.212-.58.08L18.732 24.466a.42.42 0 0 1-.08-.58Zm10.416 6.065-1.45-1.16a7.74 7.74 0 0 1 4.746 2.189c.159.184.159.448 0 .606a.447.447 0 0 1-.606 0 6.555 6.555 0 0 0-2.69-1.635Zm-5.01.343a6.346 6.346 0 0 0-1.82 1.292.447.447 0 0 1-.606 0 .414.414 0 0 1 0-.58 7.975 7.975 0 0 1 1.688-1.292l.738.58Zm-.184-4.43-.791-.633a11.395 11.395 0 0 1 3.928-.686c3.218 0 6.17 1.319 8.307 3.428.158.159.158.422 0 .607-.158.158-.422.158-.607 0a10.84 10.84 0 0 0-7.7-3.19c-1.107 0-2.135.157-3.137.474ZM19.84 26.97l.686.528c-.449.343-.844.685-1.24 1.08a.447.447 0 0 1-.606 0c-.159-.184-.159-.447 0-.606.369-.369.765-.685 1.16-1.002Zm5.801 8.702a1.699 1.699 0 0 1-.21-1.687c.263-.554.79-.95 1.397-1.002a1.662 1.662 0 0 1 1.53.712c.369.5.448 1.134.21 1.687-.263.554-.79.95-1.397 1.002a1.662 1.662 0 0 1-1.53-.712Zm2.215-1.002a.868.868 0 0 0-.844-.843.85.85 0 0 0-.843.843c0 .475.369.844.843.844a.85.85 0 0 0 .844-.844Z"}),l.jsx("path",{fill:"#5A5C5C",d:"M128 30c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),l.jsx("path",{fill:"#DDD",d:"m142.001 23.885-.424 1.457c-.091.364-.364.637-.668.789-.243.121-.455.242-.667.364a1.232 1.232 0 0 1-1.032.212l-1.456-.364h-.122a3.276 3.276 0 0 0-.455.668l-.152.212a7.838 7.838 0 0 0-.333.728c0 .03.03.091.06.122l1.062 1.061c.243.273.364.668.334 1.002v.758c.03.334-.091.698-.334.971l-1.062 1.092a.231.231 0 0 0-.06.122c.091.242.212.485.333.728l.122.212c.152.213.303.456.455.668h.152l1.456-.364c.364-.091.759 0 1.032.182.212.151.424.273.667.394.304.152.577.425.668.79l.424 1.456c0 .03.031.06.061.09.304.061.607.061.941.061.303 0 .607 0 .91-.06.03-.03.061-.061.061-.091l.424-1.457c.091-.364.364-.637.668-.789a4.79 4.79 0 0 0 .667-.394c.304-.182.668-.273 1.032-.182l1.456.364h.152c.152-.212.304-.455.455-.668l.122-.212c.121-.243.242-.486.333-.728 0-.03-.03-.091-.06-.122l-1.062-1.092a1.316 1.316 0 0 1-.334-.97c0-.122.03-.244.03-.395 0-.122-.03-.243-.03-.364-.03-.334.091-.729.334-1.002l1.062-1.061c.03-.03.06-.092.06-.122a7.838 7.838 0 0 0-.333-.728l-.122-.212a12.155 12.155 0 0 0-.455-.668h-.152l-1.456.364c-.364.091-.728 0-1.032-.182a4.789 4.789 0 0 0-.667-.394c-.304-.152-.577-.425-.668-.79l-.424-1.456a.233.233 0 0 0-.061-.121 9.146 9.146 0 0 0-.91-.06c-.334 0-.637.03-.941.06a.233.233 0 0 0-.061.121Zm1.002-1.153c.394 0 .758.03 1.153.091.06.03.091.03.151.061.273.152.516.425.607.728l.425 1.457c0 .06.061.151.152.182.273.121.546.273.789.455.091.06.182.09.242.06l1.487-.364c.303-.09.668-.03.941.152l.121.122c.212.242.394.546.576.849l.152.212v.03c.152.304.304.608.425.911.03.06.03.091.03.152.031.334-.091.667-.333.91l-1.062 1.092c-.031.03-.061.122-.061.213 0 .151.03.303.03.455 0 .151-.03.303-.03.455 0 .121.03.212.061.243l1.062 1.092c.242.243.364.576.333.91 0 .03 0 .091-.03.152-.121.303-.273.607-.425.91l-.152.243a5.476 5.476 0 0 1-.606.85c-.031.06-.061.09-.091.12a1.206 1.206 0 0 1-.971.152l-1.457-.364c-.06-.03-.151 0-.242.061-.243.152-.516.303-.789.455-.091.03-.152.121-.152.182l-.425 1.426a1.277 1.277 0 0 1-.607.759c-.06.03-.091.03-.151.06-.395.03-.759.061-1.153.061-.395 0-.789-.03-1.184-.06-.06-.03-.091-.03-.151-.061a1.277 1.277 0 0 1-.607-.759l-.425-1.426c0-.06-.061-.151-.152-.182a4.11 4.11 0 0 1-.789-.455c-.091-.06-.182-.06-.242-.06l-1.457.363c-.333.091-.667.03-.94-.151-.061-.03-.091-.06-.122-.091-.242-.273-.424-.577-.606-.88l-.122-.213-.03-.03a11.98 11.98 0 0 1-.425-.91c0-.06-.03-.091-.03-.152 0-.334.091-.667.334-.91l1.061-1.092c.031-.03.061-.122.061-.243v-.91c0-.091-.03-.182-.061-.213l-1.061-1.092c-.243-.243-.334-.576-.334-.91 0-.061.03-.091.03-.152.121-.303.273-.607.425-.91l.03-.03.122-.213a6.09 6.09 0 0 1 .606-.85.24.24 0 0 1 .122-.12c.273-.183.607-.244.94-.153l1.457.364c.06.03.151 0 .242-.06.243-.152.516-.334.789-.455.091-.03.152-.122.152-.182l.425-1.457c.091-.303.334-.576.607-.728.06-.03.091-.03.151-.06.395-.061.789-.092 1.184-.092Zm-1.699 7.768c0 .637.303 1.183.849 1.486.516.304 1.153.304 1.699 0 .516-.303.85-.85.85-1.486 0-.607-.334-1.153-.85-1.457-.546-.303-1.183-.303-1.699 0-.546.304-.849.85-.849 1.457Zm4.369 0c0 .97-.516 1.85-1.335 2.336a2.781 2.781 0 0 1-2.67 0c-.85-.485-1.335-1.365-1.335-2.336 0-.94.485-1.82 1.335-2.306a2.781 2.781 0 0 1 2.67 0 2.702 2.702 0 0 1 1.335 2.306Z"}),l.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),l.jsx("path",{fill:"#fff",d:"M72.313 42.777h9.968v1.812h-9.969c-1.019 0-1.812.85-1.812 1.813v16.312a1.79 1.79 0 0 0 1.813 1.813h25.374c.963 0 1.813-.793 1.813-1.813V46.402c0-.963-.85-1.813-1.813-1.813H87.72v-1.812h9.969c1.982 0 3.624 1.642 3.624 3.625v16.312a3.613 3.613 0 0 1-3.624 3.625H89.19l.623 3.625h3.342c.453 0 .906.453.906.907 0 .51-.453.906-.906.906H76.844a.895.895 0 0 1-.906-.906c0-.454.396-.907.906-.907h3.285l.623-3.625h-8.44c-2.039 0-3.624-1.586-3.624-3.625V46.402a3.614 3.614 0 0 1 3.624-3.625Zm10.251 23.562-.623 3.625h6.061l-.623-3.625h-4.815Zm3.342-22.656v12.348l2.946-3.002c.34-.34.962-.34 1.302 0 .34.34.34.963 0 1.302l-4.531 4.532c-.34.34-.963.34-1.303 0l-4.53-4.532c-.34-.34-.34-.962 0-1.302.339-.34.962-.34 1.302 0l3.002 3.002V43.683c0-.453.396-.906.906-.906.453 0 .906.453.906.906Z"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),CC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeMiterlimit:10,d:"M27.449 103.138a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.493 1.493 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.022h-.5v-2.02h.5V80.07h-.5V78.05h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V57.84h.5v-2.02h-.5V53.8h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V33.59h.5V31.57h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5V53.8h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.029v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("path",{fill:"#36AA6C",d:"M114.756 28.708H55.244c-1.427 0-2.584 1.512-2.584 3.377v49.491c0 1.866 1.157 3.378 2.584 3.378h59.512c1.427 0 2.584-1.512 2.584-3.378v-49.49c0-1.866-1.157-3.378-2.584-3.378Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M98.8 37.185a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM104.076 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M109.351 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),l.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 18.367H43.32c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H10.803c-.193 0-.41-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.13-.808.317-1.06.186-.254.402-.36.595-.36Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M26.192 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM31.468 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M36.743 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 18.367h32.517c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H126.63c-.193 0-.409-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.131-.808.317-1.06.186-.254.402-.36.595-.36Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M142.019 26.344a1.416 1.416 0 1 0 0-2.832 1.416 1.416 0 0 0 0 2.832ZM147.294 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M152.569 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 63.694H43.32c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H10.803c-.193 0-.41-.106-.595-.359-.186-.253-.317-.626-.317-1.06V65.113c0-.435.13-.808.317-1.061.186-.253.402-.358.595-.358Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M27.192 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM32.468 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M37.743 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 63.694h32.517c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H126.63c-.193 0-.409-.106-.595-.359s-.317-.626-.317-1.06V65.113c0-.435.131-.808.317-1.061.186-.253.402-.358.595-.358Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M143.019 71.672a1.416 1.416 0 1 0 0-2.833 1.416 1.416 0 0 0 0 2.833ZM148.294 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M153.569 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#fff",d:"M49.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),l.jsx("path",{fill:"#fff",d:"M44.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),l.jsx("path",{fill:"#fff",d:"M44.482 40.488h-5.836a.486.486 0 1 1 0-.973h5.836a.486.486 0 1 1 0 .973ZM60.597 40.004l-3.255-3.255a.486.486 0 1 1 .688-.688l3.6 3.6c.19.19.19.497 0 .687l-3.594 3.593a.486.486 0 1 1-.688-.688l3.25-3.249Z"}),l.jsx("path",{fill:"#3BB272",d:"M32.147 36.709a3.375 3.375 0 1 1 0 6.75 3.375 3.375 0 0 1 0-6.75Z"}),l.jsx("path",{fill:"#fff",d:"M134.062 65.808v-5.836a.487.487 0 0 0-.973 0v5.836a.486.486 0 1 0 .973 0Z"}),l.jsx("path",{fill:"#fff",d:"M134.062 70.808v-5.836a.487.487 0 0 0-.973 0v5.837a.486.486 0 1 0 .973 0Z"}),l.jsx("path",{fill:"#fff",d:"M134.062 70.644v5.836a.487.487 0 0 1-.973 0v-5.836a.486.486 0 1 1 .973 0ZM133.578 54.529l-3.255 3.255a.487.487 0 0 1-.688-.688l3.599-3.599c.19-.19.498-.19.688 0l3.593 3.593a.486.486 0 1 1-.688.688l-3.249-3.249Z"}),l.jsx("path",{fill:"#AAB0B0",d:"M130.282 82.98a3.376 3.376 0 1 1 6.752 0 3.376 3.376 0 0 1-6.752 0Z"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),EC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("path",{fill:"#DE2122",d:"M79.593 28.399c2.403-4.163 8.411-4.163 10.814 0l29.741 51.512c2.403 4.162-.601 9.366-5.407 9.366H55.259c-4.806 0-7.81-5.204-5.407-9.366l29.74-51.512Z"}),l.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M81.84 42.528h6.321a1 1 0 0 1 .994 1.113l-2.691 23.67a1 1 0 0 1-.994.887h-1.033a1 1 0 0 1-.994-.89l-2.596-23.671a1 1 0 0 1 .994-1.11Zm3.128 30.366a3.547 3.547 0 1 0 0 7.093 3.547 3.547 0 0 0 0-7.093Z",clipRule:"evenodd"}),l.jsx("path",{fill:"#5A5C5C",d:"M115.69 27.082 132.459.185l17.514-.151-25.545 24.389 17.858 23.176-25.076 13.678L131.267 47.6 115.69 27.082Z"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),jC={edgeNotificationsPermissionTimeout:15e3},pt={WINDOW_MANAGEMENT:Yo.WINDOW_MANAGEMENT,NOTIFICATIONS:Yo.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},_C={name:pt.WINDOW_MANAGEMENT,label:`Allow window management${gf?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
|
|
45
|
+
***************************************************************************** */var Yu=function(){return Yu=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Yu.apply(this,arguments)};function hC(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Xu(e,t){if(e===t||e===null&&t===null)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Xu(e[n],t[n]))return!1;return!0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(var n=0;n<o.length;n++)if(!t.hasOwnProperty(o[n])||!Xu(e[o[n]],t[o[n]]))return!1;return!0}}var Qi=function(e){return Array.isArray(e)},rs=function(e){return typeof e=="object"&&e!==null&&!Qi(e)},mC=function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}},so=function(e,t){return"expected "+e+", got "+mC(t)},Bi=function(e){return e.map(function(t){return typeof t=="string"?"."+t:"["+t+"]"}).join("")},zi=function(e,t){var n=t.at,o=hC(t,["at"]);return Yu({at:e+(n||"")},o)},At=function(){function e(t){var n=this;this.decode=t,this.run=function(o){return _l(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},n.decode(o))},this.runPromise=function(o){return lC(n.run(o))},this.runWithException=function(o){return dC(n.run(o))},this.map=function(o){return new e(function(r){return fC(o,n.decode(r))})},this.andThen=function(o){return new e(function(r){return pC(function(i){return o(i).decode(r)},n.decode(r))})},this.where=function(o,r){return n.andThen(function(i){return o(i)?e.succeed(i):e.fail(r)})}}return e.string=function(){return new e(function(t){return typeof t=="string"?Nt(t):St({message:so("a string",t)})})},e.number=function(){return new e(function(t){return typeof t=="number"?Nt(t):St({message:so("a number",t)})})},e.boolean=function(){return new e(function(t){return typeof t=="boolean"?Nt(t):St({message:so("a boolean",t)})})},e.constant=function(t){return new e(function(n){return Xu(n,t)?Nt(t):St({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(n)})})},e.object=function(t){return new e(function(n){if(rs(n)&&t){var o={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].decode(n[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return n[r]===void 0?St({message:"the key '"+r+"' is required but was not present"}):St(zi("."+r,i.error))}return Nt(o)}else return rs(n)?Nt(n):St({message:so("an object",n)})})},e.array=function(t){return new e(function(n){if(Qi(n)&&t){var o=function(r,i){return _l(function(a){return zi("["+i+"]",a)},t.decode(r))};return n.reduce(function(r,i,a){return Fh(function(s,c){return s.concat([c])},r,o(i,a))},Nt([]))}else return Qi(n)?Nt(n):St({message:so("an array",n)})})},e.tuple=function(t){return new e(function(n){if(Qi(n)){if(n.length!==t.length)return St({message:"expected a tuple of length "+t.length+", got one of length "+n.length});for(var o=[],r=0;r<t.length;r++){var i=t[r].decode(n[r]);if(i.ok)o[r]=i.result;else return St(zi("["+r+"]",i.error))}return Nt(o)}else return St({message:so("a tuple of length "+t.length,n)})})},e.union=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new e(function(i){return[t,n].concat(o).reduce(function(a,s){return Fh(Object.assign,a,s.decode(i))},Nt({}))})},e.anyJson=function(){return new e(function(t){return Nt(t)})},e.unknownJson=function(){return new e(function(t){return Nt(t)})},e.dict=function(t){return new e(function(n){if(rs(n)){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=t.decode(n[r]);if(i.ok===!0)o[r]=i.result;else return St(zi("."+r,i.error))}return Nt(o)}else return St({message:so("an object",n)})})},e.optional=function(t){return new e(function(n){return n==null?Nt(void 0):t.decode(n)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(o){for(var r=[],i=0;i<t.length;i++){var a=t[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var s=r.map(function(c){return"at error"+(c.at||"")+": "+c.message}).join('", "');return St({message:'expected a value matching one of the decoders, got the errors ["'+s+'"]'})})},e.withDefault=function(t,n){return new e(function(o){return Nt(uC(t,n.decode(o)))})},e.valueAt=function(t,n){return new e(function(o){for(var r=o,i=0;i<t.length;i++){if(r===void 0)return St({at:Bi(t.slice(0,i+1)),message:"path does not exist"});if(typeof t[i]=="string"&&!rs(r))return St({at:Bi(t.slice(0,i+1)),message:so("an object",r)});if(typeof t[i]=="number"&&!Qi(r))return St({at:Bi(t.slice(0,i+1)),message:so("an array",r)});r=r[t[i]]}return _l(function(a){return r===void 0?{at:Bi(t),message:"path does not exist"}:zi(Bi(t),a)},n.decode(r))})},e.succeed=function(t){return new e(function(n){return Nt(t)})},e.fail=function(t){return new e(function(n){return St({message:t})})},e.lazy=function(t){return new e(function(n){return t().decode(n)})},e}(),gC=At.string,yC=At.number,ba=At.boolean,Vt=At.anyJson;At.unknownJson;var nr=At.constant,ht=At.object,vC=At.array;At.tuple;At.dict;var Me=At.optional,xa=At.oneOf;At.union;At.intersection;At.withDefault;At.valueAt;At.succeed;var wC=At.fail;At.lazy;const sn=gC().where(e=>e.length>0,"Expected a non-empty string"),bC=yC().where(e=>e>=0,"Expected a non-negative number"),mn=(e,t)=>{const n=typeof e;return n==="function"?Vt():wC(`The provided argument as ${t} should be of type function, provided: ${typeof n}`)},xC=ht({name:sn}),La=ht({isCompleted:ba()}),kC=Ot.useStorage,Sf=()=>{const[e,t]=kC("sessionStorage",cC,xC);return{isPlatformWindow:!e||window.name===e.name,setPlatformWindow:t}},SC=Ot.useIsLaunchpadPinned,xw=Ot.useOnIframeFocus,kw=Ot.useOnOutsideClick,CC=Ot.usePressedKeys,Dr=Ot.useStorage,Sw=v.createContext(void 0),sr=()=>{const e=v.useContext(Sw);if(e===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return e},EC=({children:e})=>{const[t,n]=Dr("localStorage",Ra,La),[o,r]=v.useState([]),i=v.useMemo(()=>o.reduce((f,p)=>({...f,[p.stableName]:{state:p.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[s,c]=v.useState(!1),u={isLoggingOut:s,setIsLoggingOut:c};v.useEffect(()=>{let f=!1;const p=QS().then(h=>{if(f)return;r(h);const m=[];let g=!1;return h.forEach((y,b)=>{const k=x=>{if(f||!x.target||g)return;const S=x.target;if(S.state==="prompt")return n({isCompleted:!1}),g=!0,window.location.reload();r(C=>[...C.slice(0,b),S,...C.slice(b+1)])};y.addEventListener("change",k),m.push(()=>y.removeEventListener("change",k))}),m}).catch(console.warn);return()=>{f=!0,p.then(h=>{h==null||h.forEach(m=>m())})}},[n]);const d=v.useMemo(()=>({permission:a,login:u}),[a,u]);return l.jsx(Sw.Provider,{value:d,children:e})},jC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,fill:"#3C3E3F",rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),l.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,stroke:"#4B4E4F",strokeMiterlimit:10,rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),l.jsx("path",{fill:"#36A86B",d:"M125.31 100.086c-1.656 0-3-1.41-3-3.149 0-1.74 1.344-3.15 3-3.15 1.657 0 3 1.41 3 3.15s-1.343 3.149-3 3.149Z"}),l.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),l.jsx("path",{fill:"#fff",d:"M84.068 42.02c0-.466.408-.932.932-.932.466 0 .932.466.932.932v.99c4.66.467 8.388 4.428 8.388 9.262v1.748a9.57 9.57 0 0 0 2.796 6.756l.174.175c.466.466.758 1.165.758 1.806a2.61 2.61 0 0 1-2.621 2.621H74.514c-1.456-.058-2.563-1.165-2.563-2.621 0-.7.233-1.34.758-1.806l.116-.175c1.806-1.805 2.854-4.252 2.854-6.757v-1.747a9.3 9.3 0 0 1 8.388-9.261v-.99ZM85 44.816c-4.136 0-7.456 3.379-7.456 7.456v1.748c0 3.028-1.223 5.94-3.378 8.096l-.175.117a.94.94 0 0 0-.175.524c0 .408.291.699.7.699h20.91c.408 0 .758-.291.758-.7 0-.174-.117-.349-.233-.523l-.175-.117a11.502 11.502 0 0 1-3.378-8.155v-1.689c0-4.077-3.32-7.456-7.456-7.456H85Zm-1.806 23.008c.291.758.99 1.224 1.806 1.224.757 0 1.456-.466 1.747-1.224.175-.466.7-.757 1.165-.582a.976.976 0 0 1 .583 1.223A3.717 3.717 0 0 1 85 70.912c-1.631 0-3.029-.99-3.553-2.447a.976.976 0 0 1 .582-1.223c.466-.175.99.116 1.165.582Z"}),l.jsx("path",{fill:"#36A86B",d:"M113.791 86.146c-1.922 0-3.48-1.62-3.48-3.62 0-1.999 1.558-3.62 3.48-3.62s3.481 1.621 3.481 3.62c0 2-1.559 3.62-3.481 3.62Z"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),_C=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("path",{fill:"#3C3E3F",stroke:"#5D5D5D",strokeMiterlimit:10,d:"M22.338.5h125.324c2.746 0 4.941 2.144 4.941 4.75v76.938c0 2.608-2.195 4.751-4.941 4.751H22.338c-2.746 0-4.94-2.143-4.94-4.75V5.25c0-2.607 2.194-4.751 4.94-4.751Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M116.905 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533ZM127.206 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M137.505 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),l.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),l.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M45.501 53.17a1 1 0 0 1 1.414 0l6.364 6.363a1 1 0 0 1-1.414 1.415l-4.657-4.657v48.23a1 1 0 0 1-2 0v-48.23l-4.657 4.657a1 1 0 0 1-1.414-1.415l6.364-6.364Z",clipRule:"evenodd"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),OC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeLinejoin:"round",strokeMiterlimit:10,d:"M27.449 103.584a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.495 1.495 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5V88.6h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V66.37h.5V64.35h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V42.12h.5V40.1h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5V19.89h-.5V17.87h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5V40.1h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5V88.6h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),l.jsx("path",{fill:"#5A5C5C",d:"M128 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),l.jsx("path",{fill:"#DDD",d:"M143.015 89.758a6.667 6.667 0 0 0 5.823-3.379c1.237-2.082 1.237-4.646 0-6.758-1.207-2.082-3.409-3.38-5.823-3.38a6.742 6.742 0 0 0-5.853 3.38c-1.237 2.112-1.237 4.676 0 6.758 1.207 2.112 3.409 3.38 5.853 3.38Zm0-14.482c2.746 0 5.28 1.479 6.668 3.862 1.388 2.414 1.388 5.34 0 7.724a7.666 7.666 0 0 1-6.668 3.862 7.678 7.678 0 0 1-6.698-3.862c-1.388-2.384-1.388-5.31 0-7.724a7.741 7.741 0 0 1 6.698-3.862Zm.724 2.897a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-1.689 7.723c0 .543.422.966.965.966a.973.973 0 0 0 .966-.966.993.993 0 0 0-.966-.965.972.972 0 0 0-.965.965Zm-.966 0c0-1.056.845-1.93 1.931-1.93.513 0 .996.21 1.328.573l3.228-1.931a.478.478 0 0 1 .664.15c.15.242.06.544-.151.664l-3.228 1.931c.06.181.09.362.09.543 0 1.087-.875 1.931-1.931 1.931a1.906 1.906 0 0 1-1.931-1.93Zm6.034-6.275a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-8.93 2.655c.392 0 .724.332.724.724a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.301-.724.724-.724Zm2.172-2.655a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Z"}),l.jsx("path",{fill:"#5A5C5C",d:"M12 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),l.jsx("path",{fill:"#DDD",d:"M27.351 76.62a.804.804 0 0 0-.73 0L21.45 78.81c-.322.117-.556.438-.526.789 0 2.746 1.139 7.596 5.697 9.787a.804.804 0 0 0 .73 0c4.558-2.19 5.697-7.04 5.727-9.787a.855.855 0 0 0-.556-.789l-5.17-2.191Zm-1.08-.877a1.816 1.816 0 0 1 1.46 0l5.142 2.192c.643.292 1.14.905 1.14 1.665-.03 2.922-1.228 8.21-6.253 10.635a1.798 1.798 0 0 1-1.548 0c-5.026-2.425-6.223-7.713-6.223-10.635-.03-.76.467-1.373 1.11-1.665l5.171-2.192Z"}),l.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),l.jsx("path",{fill:"#DDD",d:"M18.653 23.886c.132-.184.422-.237.58-.079l16.033 12.657a.394.394 0 0 1 .08.58c-.133.185-.396.212-.58.08L18.732 24.466a.42.42 0 0 1-.08-.58Zm10.416 6.065-1.45-1.16a7.74 7.74 0 0 1 4.746 2.189c.159.184.159.448 0 .606a.447.447 0 0 1-.606 0 6.555 6.555 0 0 0-2.69-1.635Zm-5.01.343a6.346 6.346 0 0 0-1.82 1.292.447.447 0 0 1-.606 0 .414.414 0 0 1 0-.58 7.975 7.975 0 0 1 1.688-1.292l.738.58Zm-.184-4.43-.791-.633a11.395 11.395 0 0 1 3.928-.686c3.218 0 6.17 1.319 8.307 3.428.158.159.158.422 0 .607-.158.158-.422.158-.607 0a10.84 10.84 0 0 0-7.7-3.19c-1.107 0-2.135.157-3.137.474ZM19.84 26.97l.686.528c-.449.343-.844.685-1.24 1.08a.447.447 0 0 1-.606 0c-.159-.184-.159-.447 0-.606.369-.369.765-.685 1.16-1.002Zm5.801 8.702a1.699 1.699 0 0 1-.21-1.687c.263-.554.79-.95 1.397-1.002a1.662 1.662 0 0 1 1.53.712c.369.5.448 1.134.21 1.687-.263.554-.79.95-1.397 1.002a1.662 1.662 0 0 1-1.53-.712Zm2.215-1.002a.868.868 0 0 0-.844-.843.85.85 0 0 0-.843.843c0 .475.369.844.843.844a.85.85 0 0 0 .844-.844Z"}),l.jsx("path",{fill:"#5A5C5C",d:"M128 30c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),l.jsx("path",{fill:"#DDD",d:"m142.001 23.885-.424 1.457c-.091.364-.364.637-.668.789-.243.121-.455.242-.667.364a1.232 1.232 0 0 1-1.032.212l-1.456-.364h-.122a3.276 3.276 0 0 0-.455.668l-.152.212a7.838 7.838 0 0 0-.333.728c0 .03.03.091.06.122l1.062 1.061c.243.273.364.668.334 1.002v.758c.03.334-.091.698-.334.971l-1.062 1.092a.231.231 0 0 0-.06.122c.091.242.212.485.333.728l.122.212c.152.213.303.456.455.668h.152l1.456-.364c.364-.091.759 0 1.032.182.212.151.424.273.667.394.304.152.577.425.668.79l.424 1.456c0 .03.031.06.061.09.304.061.607.061.941.061.303 0 .607 0 .91-.06.03-.03.061-.061.061-.091l.424-1.457c.091-.364.364-.637.668-.789a4.79 4.79 0 0 0 .667-.394c.304-.182.668-.273 1.032-.182l1.456.364h.152c.152-.212.304-.455.455-.668l.122-.212c.121-.243.242-.486.333-.728 0-.03-.03-.091-.06-.122l-1.062-1.092a1.316 1.316 0 0 1-.334-.97c0-.122.03-.244.03-.395 0-.122-.03-.243-.03-.364-.03-.334.091-.729.334-1.002l1.062-1.061c.03-.03.06-.092.06-.122a7.838 7.838 0 0 0-.333-.728l-.122-.212a12.155 12.155 0 0 0-.455-.668h-.152l-1.456.364c-.364.091-.728 0-1.032-.182a4.789 4.789 0 0 0-.667-.394c-.304-.152-.577-.425-.668-.79l-.424-1.456a.233.233 0 0 0-.061-.121 9.146 9.146 0 0 0-.91-.06c-.334 0-.637.03-.941.06a.233.233 0 0 0-.061.121Zm1.002-1.153c.394 0 .758.03 1.153.091.06.03.091.03.151.061.273.152.516.425.607.728l.425 1.457c0 .06.061.151.152.182.273.121.546.273.789.455.091.06.182.09.242.06l1.487-.364c.303-.09.668-.03.941.152l.121.122c.212.242.394.546.576.849l.152.212v.03c.152.304.304.608.425.911.03.06.03.091.03.152.031.334-.091.667-.333.91l-1.062 1.092c-.031.03-.061.122-.061.213 0 .151.03.303.03.455 0 .151-.03.303-.03.455 0 .121.03.212.061.243l1.062 1.092c.242.243.364.576.333.91 0 .03 0 .091-.03.152-.121.303-.273.607-.425.91l-.152.243a5.476 5.476 0 0 1-.606.85c-.031.06-.061.09-.091.12a1.206 1.206 0 0 1-.971.152l-1.457-.364c-.06-.03-.151 0-.242.061-.243.152-.516.303-.789.455-.091.03-.152.121-.152.182l-.425 1.426a1.277 1.277 0 0 1-.607.759c-.06.03-.091.03-.151.06-.395.03-.759.061-1.153.061-.395 0-.789-.03-1.184-.06-.06-.03-.091-.03-.151-.061a1.277 1.277 0 0 1-.607-.759l-.425-1.426c0-.06-.061-.151-.152-.182a4.11 4.11 0 0 1-.789-.455c-.091-.06-.182-.06-.242-.06l-1.457.363c-.333.091-.667.03-.94-.151-.061-.03-.091-.06-.122-.091-.242-.273-.424-.577-.606-.88l-.122-.213-.03-.03a11.98 11.98 0 0 1-.425-.91c0-.06-.03-.091-.03-.152 0-.334.091-.667.334-.91l1.061-1.092c.031-.03.061-.122.061-.243v-.91c0-.091-.03-.182-.061-.213l-1.061-1.092c-.243-.243-.334-.576-.334-.91 0-.061.03-.091.03-.152.121-.303.273-.607.425-.91l.03-.03.122-.213a6.09 6.09 0 0 1 .606-.85.24.24 0 0 1 .122-.12c.273-.183.607-.244.94-.153l1.457.364c.06.03.151 0 .242-.06.243-.152.516-.334.789-.455.091-.03.152-.122.152-.182l.425-1.457c.091-.303.334-.576.607-.728.06-.03.091-.03.151-.06.395-.061.789-.092 1.184-.092Zm-1.699 7.768c0 .637.303 1.183.849 1.486.516.304 1.153.304 1.699 0 .516-.303.85-.85.85-1.486 0-.607-.334-1.153-.85-1.457-.546-.303-1.183-.303-1.699 0-.546.304-.849.85-.849 1.457Zm4.369 0c0 .97-.516 1.85-1.335 2.336a2.781 2.781 0 0 1-2.67 0c-.85-.485-1.335-1.365-1.335-2.336 0-.94.485-1.82 1.335-2.306a2.781 2.781 0 0 1 2.67 0 2.702 2.702 0 0 1 1.335 2.306Z"}),l.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),l.jsx("path",{fill:"#fff",d:"M72.313 42.777h9.968v1.812h-9.969c-1.019 0-1.812.85-1.812 1.813v16.312a1.79 1.79 0 0 0 1.813 1.813h25.374c.963 0 1.813-.793 1.813-1.813V46.402c0-.963-.85-1.813-1.813-1.813H87.72v-1.812h9.969c1.982 0 3.624 1.642 3.624 3.625v16.312a3.613 3.613 0 0 1-3.624 3.625H89.19l.623 3.625h3.342c.453 0 .906.453.906.907 0 .51-.453.906-.906.906H76.844a.895.895 0 0 1-.906-.906c0-.454.396-.907.906-.907h3.285l.623-3.625h-8.44c-2.039 0-3.624-1.586-3.624-3.625V46.402a3.614 3.614 0 0 1 3.624-3.625Zm10.251 23.562-.623 3.625h6.061l-.623-3.625h-4.815Zm3.342-22.656v12.348l2.946-3.002c.34-.34.962-.34 1.302 0 .34.34.34.963 0 1.302l-4.531 4.532c-.34.34-.963.34-1.303 0l-4.53-4.532c-.34-.34-.34-.962 0-1.302.339-.34.962-.34 1.302 0l3.002 3.002V43.683c0-.453.396-.906.906-.906.453 0 .906.453.906.906Z"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),AC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeMiterlimit:10,d:"M27.449 103.138a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.493 1.493 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.022h-.5v-2.02h.5V80.07h-.5V78.05h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V57.84h.5v-2.02h-.5V53.8h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V33.59h.5V31.57h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5V53.8h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.029v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("path",{fill:"#36AA6C",d:"M114.756 28.708H55.244c-1.427 0-2.584 1.512-2.584 3.377v49.491c0 1.866 1.157 3.378 2.584 3.378h59.512c1.427 0 2.584-1.512 2.584-3.378v-49.49c0-1.866-1.157-3.378-2.584-3.378Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M98.8 37.185a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM104.076 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M109.351 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),l.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 18.367H43.32c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H10.803c-.193 0-.41-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.13-.808.317-1.06.186-.254.402-.36.595-.36Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M26.192 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM31.468 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M36.743 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 18.367h32.517c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H126.63c-.193 0-.409-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.131-.808.317-1.06.186-.254.402-.36.595-.36Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M142.019 26.344a1.416 1.416 0 1 0 0-2.832 1.416 1.416 0 0 0 0 2.832ZM147.294 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M152.569 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 63.694H43.32c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H10.803c-.193 0-.41-.106-.595-.359-.186-.253-.317-.626-.317-1.06V65.113c0-.435.13-.808.317-1.061.186-.253.402-.358.595-.358Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M27.192 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM32.468 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M37.743 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 63.694h32.517c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H126.63c-.193 0-.409-.106-.595-.359s-.317-.626-.317-1.06V65.113c0-.435.131-.808.317-1.061.186-.253.402-.358.595-.358Z"}),l.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M143.019 71.672a1.416 1.416 0 1 0 0-2.833 1.416 1.416 0 0 0 0 2.833ZM148.294 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#F0F6FE",d:"M153.569 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),l.jsx("path",{fill:"#fff",d:"M49.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),l.jsx("path",{fill:"#fff",d:"M44.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),l.jsx("path",{fill:"#fff",d:"M44.482 40.488h-5.836a.486.486 0 1 1 0-.973h5.836a.486.486 0 1 1 0 .973ZM60.597 40.004l-3.255-3.255a.486.486 0 1 1 .688-.688l3.6 3.6c.19.19.19.497 0 .687l-3.594 3.593a.486.486 0 1 1-.688-.688l3.25-3.249Z"}),l.jsx("path",{fill:"#3BB272",d:"M32.147 36.709a3.375 3.375 0 1 1 0 6.75 3.375 3.375 0 0 1 0-6.75Z"}),l.jsx("path",{fill:"#fff",d:"M134.062 65.808v-5.836a.487.487 0 0 0-.973 0v5.836a.486.486 0 1 0 .973 0Z"}),l.jsx("path",{fill:"#fff",d:"M134.062 70.808v-5.836a.487.487 0 0 0-.973 0v5.837a.486.486 0 1 0 .973 0Z"}),l.jsx("path",{fill:"#fff",d:"M134.062 70.644v5.836a.487.487 0 0 1-.973 0v-5.836a.486.486 0 1 1 .973 0ZM133.578 54.529l-3.255 3.255a.487.487 0 0 1-.688-.688l3.599-3.599c.19-.19.498-.19.688 0l3.593 3.593a.486.486 0 1 1-.688.688l-3.249-3.249Z"}),l.jsx("path",{fill:"#AAB0B0",d:"M130.282 82.98a3.376 3.376 0 1 1 6.752 0 3.376 3.376 0 0 1-6.752 0Z"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),PC=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("path",{fill:"#DE2122",d:"M79.593 28.399c2.403-4.163 8.411-4.163 10.814 0l29.741 51.512c2.403 4.162-.601 9.366-5.407 9.366H55.259c-4.806 0-7.81-5.204-5.407-9.366l29.74-51.512Z"}),l.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M81.84 42.528h6.321a1 1 0 0 1 .994 1.113l-2.691 23.67a1 1 0 0 1-.994.887h-1.033a1 1 0 0 1-.994-.89l-2.596-23.671a1 1 0 0 1 .994-1.11Zm3.128 30.366a3.547 3.547 0 1 0 0 7.093 3.547 3.547 0 0 0 0-7.093Z",clipRule:"evenodd"}),l.jsx("path",{fill:"#5A5C5C",d:"M115.69 27.082 132.459.185l17.514-.151-25.545 24.389 17.858 23.176-25.076 13.678L131.267 47.6 115.69 27.082Z"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),NC={edgeNotificationsPermissionTimeout:15e3},pt={WINDOW_MANAGEMENT:Zo.WINDOW_MANAGEMENT,NOTIFICATIONS:Zo.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},TC={name:pt.WINDOW_MANAGEMENT,label:`Allow window management${xf?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
|
|
46
46
|
windows and share context data between opened windows.`,instructions:{initial:"Click “Allow” when the browser prompt appears.",additional:`It seems that you closed the permission prompt.
|
|
47
47
|
Click the "Open permissions prompt" button again and grant the Window Management
|
|
48
|
-
permission to allow the platform to function properly.`},Image:
|
|
48
|
+
permission to allow the platform to function properly.`},Image:AC,actionBtnText:"Open permission prompt"},IC={name:pt.NOTIFICATIONS,label:"Allow browser notifications",heading:"Allow Browser Notifications",description:`By granting this permission you will be able to receive platform notifications in the notification center of your
|
|
49
49
|
operating system.`,instructions:{initial:"Click “Allow” when the browser prompt appears.",additional:`It seems that you closed the permission prompt or your browser automatically blocks notifications.
|
|
50
50
|
To allow browser notifications, go to your browser settings or click the "Bell" icon
|
|
51
|
-
in the address bar and allow notifications for this site.`},Image:
|
|
51
|
+
in the address bar and allow notifications for this site.`},Image:jC,actionBtnText:"Open permission prompt"},RC={name:pt.POPUPS,label:"Allow pop-ups",heading:"Allow Pop-ups",description:"By granting this permission you will be able to eject apps from Workspaces and save them as part of a Layout.",instructions:{initial:`Click the "Test Pop-Up Settings" button. It should open two pop-ups in order to test the
|
|
52
52
|
browser pop-up settings.`,additional:`It seems that pop-ups are disabled in your browser.
|
|
53
53
|
To allow pop-ups, go to your browser settings or click the "Pop-up blocked" icon
|
|
54
|
-
in the address bar and allow pop-ups for this site.`},Image:kC,actionBtnText:"Test pop-up settings"},PC={name:pt.PWA_INSTALL,label:"Install as a PWA",heading:"Install as a PWA (optional)",description:"By installing the platform as a Progressive Web App you will get a similar experience as with native desktop apps.",instructions:{initial:"If your browser supports Progressive Web Apps, you can now install the platform as a PWA."},Image:SC,actionBtnText:"Continue to the platform"},Cs=[_C,OC,AC,PC],rs={isCompleted:!1,state:"prompt"},NC={[pt.WINDOW_MANAGEMENT]:rs,[pt.NOTIFICATIONS]:rs,[pt.POPUPS]:rs,[pt.PWA_INSTALL]:rs};const TC=({isOpen:e,onClose:t})=>{var s;const{launchpadComponents:n,launchpadSettings:o}=gw(),{permission:r}=cr(),i=(s=r.statuses[pt.WINDOW_MANAGEMENT])==null?void 0:s.state,{Panel:a}=Ot;return l.jsx(a,{components:n,isOpen:e,onClose:t,settings:o,windowManagementPermissionState:i})};const xw=v.forwardRef((e,t)=>{const{className:n,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:s="left"}=e;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),l.jsx("div",{className:ro(n,"panel-wrapper",s,{open:o,pinned:a}),ref:t,children:i&&l.jsx(i,{isOpen:o,onClose:r})})}),wf=e=>{const{Button:t,Panel:n,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:s}=e,[c,u]=v.useState(!1),d=v.useRef(null),f=v.useCallback(async()=>{u(!1),await(s==null?void 0:s())},[s]),p=()=>{if(c){f();return}u(!0)},h=!c||r;return ww({eventType:"mouseup",handler:f,ref:d,skip:h}),vw({handler:f,skip:h}),l.jsxs(a,{ref:d,children:[l.jsx(t,{active:c,onClick:p}),l.jsx(xw,{className:o,isOpen:c,onClose:f,Panel:n,pinned:r,position:i})]})};const kw=({Button:e=GS})=>{const{isLaunchpadPinned:t}=vC();return l.jsx(wf,{Button:e,Panel:TC,panelWrapperClassName:"launchpad-panel-wrapper",pinned:t})};var Ju=function(e,t){return Ju=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},Ju(e,t)};function IC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ju(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rt=function(){return Rt=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Rt.apply(this,arguments)};function Hh(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function jo(e,t,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(d){try{u(o.next(d))}catch(f){a(f)}}function c(d){try{u(o.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):r(d.value).then(s,c)}u((o=o.apply(e,t||[])).next())})}function _o(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(d){return c([u,d])}}function c(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(o=1,r&&(i=u[0]&2?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function RC(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}function On(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}var $r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Sw={},bf={};Object.defineProperty(bf,"__esModule",{value:!0});var LC=function(){function e(){var t=this;this.locked=new Map,this.addToLocked=function(n,o){var r=t.locked.get(n);r===void 0?o===void 0?t.locked.set(n,[]):t.locked.set(n,[o]):o!==void 0&&(r.unshift(o),t.locked.set(n,r))},this.isLocked=function(n){return t.locked.has(n)},this.lock=function(n){return new Promise(function(o,r){t.isLocked(n)?t.addToLocked(n,o):(t.addToLocked(n),o())})},this.unlock=function(n){var o=t.locked.get(n);if(o!==void 0&&o.length!==0){var r=o.pop();t.locked.set(n,o),r!==void 0&&setTimeout(r,0)}else t.locked.delete(n)}}return e.getInstance=function(){return e.instance===void 0&&(e.instance=new e),e.instance},e}();bf.default=function(){return LC.getInstance()};var Pn=$r&&$r.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(u){try{c(o.next(u))}catch(d){i(d)}}function s(u){try{c(o.throw(u))}catch(d){i(d)}}function c(u){u.done?r(u.value):new n(function(d){d(u.value)}).then(a,s)}c((o=o.apply(e,t||[])).next())})},Nn=$r&&$r.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&d[0]?o.return:d[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,d[1])).done)return r;switch(o=0,r&&(d=[2&d[0],r.value]),d[0]){case 0:case 1:r=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,o=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!r||d[1]>r[0]&&d[1]<r[3])){a.label=d[1];break}if(d[0]===6&&a.label<r[1]){a.label=r[1],r=d;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(d);break}r[2]&&a.ops.pop(),a.trys.pop();continue}d=t.call(e,a)}catch(f){d=[6,f],o=0}finally{n=r=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},Fi=$r;Object.defineProperty(Sw,"__esModule",{value:!0});var Gr=bf,is={key:function(e){return Pn(Fi,void 0,void 0,function(){return Nn(this,function(t){throw new Error("Unsupported")})})},getItem:function(e){return Pn(Fi,void 0,void 0,function(){return Nn(this,function(t){throw new Error("Unsupported")})})},clear:function(){return Pn(Fi,void 0,void 0,function(){return Nn(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return Pn(Fi,void 0,void 0,function(){return Nn(this,function(t){throw new Error("Unsupported")})})},setItem:function(e,t){return Pn(Fi,void 0,void 0,function(){return Nn(this,function(n){throw new Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function Cl(e){return new Promise(function(t){return setTimeout(t,e)})}function El(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}var DC=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+El(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,e.waiters===void 0&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return n===void 0&&(n=5e3),Pn(this,void 0,void 0,function(){var o,r,i,a,s,c,u;return Nn(this,function(d){switch(d.label){case 0:o=Date.now()+El(4),r=Date.now()+n,i="browser-tabs-lock-key-"+t,a=this.storageHandler===void 0?is:this.storageHandler,d.label=1;case 1:return Date.now()<r?[4,Cl(30)]:[3,8];case 2:return d.sent(),a.getItemSync(i)!==null?[3,5]:(s=this.id+"-"+t+"-"+o,[4,Cl(Math.floor(25*Math.random()))]);case 3:return d.sent(),a.setItemSync(i,JSON.stringify({id:this.id,iat:o,timeoutKey:s,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,Cl(30)];case 4:return d.sent(),(c=a.getItemSync(i))!==null&&(u=JSON.parse(c)).id===this.id&&u.iat===o?(this.acquiredIatSet.add(o),this.refreshLockWhileAcquired(i,o),[2,!0]):[3,7];case 5:return e.lockCorrector(this.storageHandler===void 0?is:this.storageHandler),[4,this.waitForSomethingToChange(r)];case 6:d.sent(),d.label=7;case 7:return o=Date.now()+El(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(t,n){return Pn(this,void 0,void 0,function(){var o=this;return Nn(this,function(r){return setTimeout(function(){return Pn(o,void 0,void 0,function(){var i,a,s;return Nn(this,function(c){switch(c.label){case 0:return[4,Gr.default().lock(n)];case 1:return c.sent(),this.acquiredIatSet.has(n)?(i=this.storageHandler===void 0?is:this.storageHandler,(a=i.getItemSync(t))===null?(Gr.default().unlock(n),[2]):((s=JSON.parse(a)).timeRefreshed=Date.now(),i.setItemSync(t,JSON.stringify(s)),Gr.default().unlock(n),this.refreshLockWhileAcquired(t,n),[2])):(Gr.default().unlock(n),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return Pn(this,void 0,void 0,function(){return Nn(this,function(n){switch(n.label){case 0:return[4,new Promise(function(o){var r=!1,i=Date.now(),a=!1;function s(){if(a||(window.removeEventListener("storage",s),e.removeFromWaiting(s),clearTimeout(c),a=!0),!r){r=!0;var u=50-(Date.now()-i);u>0?setTimeout(o,u):o(null)}}window.addEventListener("storage",s),e.addToWaiting(s);var c=setTimeout(s,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),e.waiters!==void 0&&e.waiters.push(t)},e.removeFromWaiting=function(t){e.waiters!==void 0&&(e.waiters=e.waiters.filter(function(n){return n!==t}))},e.notifyWaiters=function(){e.waiters!==void 0&&e.waiters.slice().forEach(function(t){return t()})},e.prototype.releaseLock=function(t){return Pn(this,void 0,void 0,function(){return Nn(this,function(n){switch(n.label){case 0:return[4,this.releaseLock__private__(t)];case 1:return[2,n.sent()]}})})},e.prototype.releaseLock__private__=function(t){return Pn(this,void 0,void 0,function(){var n,o,r,i;return Nn(this,function(a){switch(a.label){case 0:return n=this.storageHandler===void 0?is:this.storageHandler,o="browser-tabs-lock-key-"+t,(r=n.getItemSync(o))===null?[2]:(i=JSON.parse(r)).id!==this.id?[3,2]:[4,Gr.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(o),Gr.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,o=t,r=[],i=0;;){var a=o.keySync(i);if(a===null)break;r.push(a),i++}for(var s=!1,c=0;c<r.length;c++){var u=r[c];if(u.includes("browser-tabs-lock-key")){var d=o.getItemSync(u);if(d!==null){var f=JSON.parse(d);(f.timeRefreshed===void 0&&f.timeAcquired<n||f.timeRefreshed!==void 0&&f.timeRefreshed<n)&&(o.removeItemSync(u),s=!0)}}}s&&e.notifyWaiters()},e.waiters=void 0,e}(),MC=Sw.default=DC;const $C={timeoutInSeconds:60},Cw={name:"auth0-spa-js",version:"2.14.0"},Ew=()=>Date.now();class ut extends Error{constructor(t,n){super(n),this.error=t,this.error_description=n,Object.setPrototypeOf(this,ut.prototype)}static fromPayload(t){let{error:n,error_description:o}=t;return new ut(n,o)}}class xf extends ut{constructor(t,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;super(t,n),this.state=o,this.appState=r,Object.setPrototypeOf(this,xf.prototype)}}class kf extends ut{constructor(t,n,o,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;super(t,n),this.connection=o,this.state=r,this.appState=i,Object.setPrototypeOf(this,kf.prototype)}}class fi extends ut{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,fi.prototype)}}class Sf extends fi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Sf.prototype)}}class Cf extends ut{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Cf.prototype)}}class Ef extends ut{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,Ef.prototype)}}class La extends ut{constructor(t,n,o,r){super(t,n),this.mfa_token=o,this.mfa_requirements=r,Object.setPrototypeOf(this,La.prototype)}}class Fc extends ut{constructor(t,n){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(Xs(t,["default"]),"', scope: '").concat(Xs(n),"')")),this.audience=t,this.scope=n,Object.setPrototypeOf(this,Fc.prototype)}}class jf extends ut{constructor(t,n){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(Xs(t,["default"]),"', missing scope: '").concat(Xs(n),"')")),this.audience=t,this.scope=n,Object.setPrototypeOf(this,jf.prototype)}}class Wc extends ut{constructor(t){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=t,Object.setPrototypeOf(this,Wc.prototype)}}function Xs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e&&!t.includes(e)?e:""}const Qs=()=>window.crypto,Wi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Qs().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%e.length]),t},jl=e=>btoa(e),HC=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],jw=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Object.keys(e).reduce((n,o)=>{if(t&&o==="env")return n;const r=HC.find(i=>i.key===o);return r&&r.type.includes(typeof e[o])&&(n[o]=e[o]),n},{})},Zu=e=>{var{clientId:t}=e,n=On(e,["clientId"]);return new URLSearchParams((o=>Object.keys(o).filter(r=>o[r]!==void 0).reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:o[i]}),{}))(Object.assign({client_id:t},n))).toString()},Bh=async e=>await Qs().subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),zh=e=>(t=>decodeURIComponent(atob(t).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),Fh=e=>{const t=new Uint8Array(e);return(n=>{const o={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,r=>o[r])})(window.btoa(String.fromCharCode(...Array.from(t))))},BC=new TextEncoder,zC=new TextDecoder;function ra(e){return typeof e=="string"?BC.encode(e):zC.decode(e)}function Wh(e){if(typeof e.modulusLength!="number"||e.modulusLength<2048)throw new WC(`${e.name} modulusLength must be at least 2048 bits`)}async function FC(e,t,n){if(n.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const o=`${ia(ra(JSON.stringify(e)))}.${ia(ra(JSON.stringify(t)))}`;return`${o}.${ia(await crypto.subtle.sign(function(r){switch(r.algorithm.name){case"ECDSA":return{name:r.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return Wh(r.algorithm),{name:r.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return Wh(r.algorithm),{name:r.algorithm.name};case"Ed25519":return{name:r.algorithm.name}}throw new _r}(n),n,ra(o)))}`}let Yu;Uint8Array.prototype.toBase64?Yu=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):Yu=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o<t.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function ia(e){return Yu(e)}class _r extends Error{constructor(t){var n;super(t??"operation not supported"),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class WC extends Error{constructor(t){var n;super(t),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}function UC(e){switch(e.algorithm.name){case"RSA-PSS":return function(t){if(t.algorithm.hash.name==="SHA-256")return"PS256";throw new _r("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(t){if(t.algorithm.hash.name==="SHA-256")return"RS256";throw new _r("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(t){if(t.algorithm.namedCurve==="P-256")return"ES256";throw new _r("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new _r("unsupported CryptoKey algorithm name")}}function _w(e){return e instanceof CryptoKey}function Ow(e){return _w(e)&&e.type==="public"}async function VC(e,t,n,o,r,i){const a=e==null?void 0:e.privateKey,s=e==null?void 0:e.publicKey;if(!_w(c=a)||c.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!Ow(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof t!="string")throw new TypeError('"htu" must be a string');if(typeof n!="string")throw new TypeError('"htm" must be a string');if(o!==void 0&&typeof o!="string")throw new TypeError('"nonce" must be a string or undefined');if(r!==void 0&&typeof r!="string")throw new TypeError('"accessToken" must be a string or undefined');if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new TypeError('"additional" must be an object');return FC({alg:UC(a),typ:"dpop+jwt",jwk:await Aw(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:o,htu:t,ath:r?ia(await crypto.subtle.digest("SHA-256",ra(r))):void 0}),a)}async function Aw(e){const{kty:t,e:n,n:o,x:r,y:i,crv:a}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:a,e:n,n:o,x:r,y:i}}const KC=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"];function GC(){return async function(e,t){var n;let o;if(typeof e!="string"||e.length===0)throw new TypeError('"alg" must be a non-empty string');switch(e){case"PS256":o={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":o={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":o={name:"Ed25519"};break;default:throw new _r}return crypto.subtle.generateKey(o,(n=t==null?void 0:t.extractable)!==null&&n!==void 0&&n,["sign","verify"])}("ES256",{extractable:!1})}function qC(e){return async function(t){if(!Ow(t))throw new TypeError('"publicKey" must be a public CryptoKey');if(t.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const n=await Aw(t);let o;switch(n.kty){case"EC":o={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case"OKP":o={crv:n.crv,kty:n.kty,x:n.x};break;case"RSA":o={e:n.e,kty:n.kty,n:n.n};break;default:throw new _r("unsupported JWK kty")}return ia(await crypto.subtle.digest({name:"SHA-256"},ra(JSON.stringify(o))))}(e.publicKey)}function JC(e){let{keyPair:t,url:n,method:o,nonce:r,accessToken:i}=e;const a=function(s){const c=new URL(s);return c.search="",c.hash="",c.href}(n);return VC(t,a,o,r,i)}const ZC=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(o=n.headers,[...o].reduce((r,i)=>{let[a,s]=i;return r[a]=s,r},{}))};var o},YC=async(e,t,n)=>{const o=new AbortController;let r;return t.signal=o.signal,Promise.race([ZC(e,t),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},XC=async(e,t,n,o,r,i,a,s)=>((c,u)=>new Promise(function(d,f){const p=new MessageChannel;p.port1.onmessage=function(h){h.data.error?f(new Error(h.data.error)):d(h.data),p.port1.close()},u.postMessage(c,[p.port2])}))({auth:{audience:t,scope:n},timeout:r,fetchUrl:e,fetchOptions:o,useFormData:a,useMrrt:s},i),QC=async function(e,t,n,o,r,i){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1e4,s=arguments.length>7?arguments[7]:void 0;return r?XC(e,t,n,o,a,r,i,s):YC(e,o,a)};async function Pw(e,t,n,o,r,i,a,s,c,u){if(c){const x=await c.generateProof({url:e,method:r.method||"GET",nonce:await c.getNonce()});r.headers=Object.assign(Object.assign({},r.headers),{dpop:x})}let d,f=null;for(let x=0;x<3;x++)try{d=await QC(e,n,o,r,i,a,t,s),f=null;break}catch(S){f=S}if(f)throw f;const p=d.json,{error:h,error_description:m}=p,g=On(p,["error","error_description"]),{headers:y,ok:b}=d;let k;if(c&&(k=y["dpop-nonce"],k&&await c.setNonce(k)),!b){const x=m||"HTTP error. Unable to fetch ".concat(e);if(h==="mfa_required")throw new La(h,x,g.mfa_token,g.mfa_requirements);if(h==="missing_refresh_token")throw new Fc(n,o);if(h==="use_dpop_nonce"){if(!c||!k||u)throw new Wc(k);return Pw(e,t,n,o,r,i,a,s,c,!0)}throw new ut(h||"request_error",x)}return g}async function e5(e,t){var{baseUrl:n,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:s,useMrrt:c,dpop:u}=e,d=On(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=d.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",p=d.grant_type==="refresh_token"&&c,h=Object.assign(Object.assign(Object.assign(Object.assign({},d),f&&r&&{audience:r}),f&&i&&{scope:i}),p&&{audience:r,scope:i}),m=s?Zu(h):JSON.stringify(h),g=(y=d.grant_type,KC.includes(y));var y;return await Pw("".concat(n,"/oauth/token"),o,r||"default",i,{method:"POST",body:m,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(jw(a||Cw)))}},t,s,c,g?u:void 0)}const t5=e=>Array.from(new Set(e)),Es=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t5(t.filter(Boolean).join(" ").trim().split(/\s+/)).join(" ")},as=(e,t,n)=>{let o;return n&&(o=e[n]),o||(o=e.default),Es(o,t)};class vn{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"@@auth0spajs@@",o=arguments.length>2?arguments[2]:void 0;this.prefix=n,this.suffix=o,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[n,o,r,i]=t.split("::");return new vn({clientId:o,scope:i,audience:r},n)}static fromCacheEntry(t){const{scope:n,audience:o,client_id:r}=t;return new vn({scope:n,audience:o,clientId:r})}}class n5{set(t,n){localStorage.setItem(t,JSON.stringify(n))}get(t){const n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}}class Nw{constructor(){this.enclosedCache=function(){let t={};return{set(n,o){t[n]=o},get(n){const o=t[n];if(o)return o},remove(n){delete t[n]},allKeys:()=>Object.keys(t)}}()}}class o5{constructor(t,n,o){this.cache=t,this.keyManifest=n,this.nowProvider=o||Ew}async setIdToken(t,n,o){var r;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:n,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(t){const n=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!n&&t.scope&&t.audience){const o=await this.get(t);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3?arguments[3]:void 0;var i;let a=await this.cache.get(t.toKey());if(!a){const u=await this.getCacheKeys();if(!u)return;const d=this.matchExistingCacheKey(t,u);if(d&&(a=await this.cache.get(d)),!a&&o&&r!=="cache-only")return this.getEntryWithRefreshToken(t,u)}if(!a)return;const s=await this.nowProvider(),c=Math.floor(s/1e3);return a.expiresAt-n<c?a.body.refresh_token?this.modifiedCachedEntry(a,t):(await this.cache.remove(t.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(t.toKey()))):a.body}async modifiedCachedEntry(t,n){return t.body={refresh_token:t.body.refresh_token,audience:t.body.audience,scope:t.body.scope},await this.cache.set(n.toKey(),t),{refresh_token:t.body.refresh_token,audience:t.body.audience,scope:t.body.scope}}async set(t){var n;const o=new vn({clientId:t.client_id,scope:t.scope,audience:t.audience}),r=await this.wrapCacheEntry(t);await this.cache.set(o.toKey(),r),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(o.toKey()))}async remove(t,n,o){const r=new vn({clientId:t,scope:o,audience:n});await this.cache.remove(r.toKey())}async clear(t){var n;const o=await this.getCacheKeys();o&&(await o.filter(r=>!t||r.includes(t)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(t){const n=await this.nowProvider();return{body:t,expiresAt:Math.floor(n/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new vn({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,n){return n.filter(o=>{var r;const i=vn.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),s=((r=t.scope)===null||r===void 0?void 0:r.split(" "))||[],c=i.scope&&s.reduce((u,d)=>u&&a.has(d),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&c})[0]}async getEntryWithRefreshToken(t,n){var o;for(const r of n){const i=vn.fromKey(r);if(i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId){const a=await this.cache.get(r);if(!((o=a==null?void 0:a.body)===null||o===void 0)&&o.refresh_token)return this.modifiedCachedEntry(a,t)}}}async updateEntry(t,n){var o;const r=await this.getCacheKeys();if(r)for(const i of r){const a=await this.cache.get(i);if(((o=a==null?void 0:a.body)===null||o===void 0?void 0:o.refresh_token)===t){const s=Object.assign(Object.assign({},a.body),{refresh_token:n});await this.set(s)}}}}class r5{constructor(t,n,o){this.storage=t,this.clientId=n,this.cookieDomain=o,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Ui=e=>typeof e=="number",i5=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],a5=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const a=i.split("."),[s,c,u]=a;if(a.length!==3||!s||!c||!u)throw new Error("ID token could not be decoded");const d=JSON.parse(zh(c)),f={__raw:i},p={};return Object.keys(d).forEach(h=>{f[h]=d[h],i5.includes(h)||(p[h]=d[h])}),{encoded:{header:s,payload:c,signature:u},header:JSON.parse(zh(s)),claims:f,user:p}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Ui(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!Ui(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ui(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,o=new Date(e.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(t.claims.exp+n),o>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(o,") is after expiration time (").concat(r,")"));if(t.claims.nbf!=null&&Ui(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-n),o<i)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(o,") is before ").concat(i))}if(t.claims.auth_time!=null&&Ui(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),o>i)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (".concat(o,") is after last auth at ").concat(i))}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const a=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(t.claims.org_id,'"'))}else{const a=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==t.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(t.claims.org_name,'"'))}}return t};var ka=$r&&$r.__assign||function(){return ka=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ka.apply(this,arguments)};function Vi(e,t){if(!t)return"";var n="; "+e;return t===!0?n:n+"="+t}function s5(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(o){if(typeof o.expires=="number"){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*o.expires),o.expires=r}return Vi("Expires",o.expires?o.expires.toUTCString():"")+Vi("Domain",o.domain)+Vi("Path",o.path)+Vi("Secure",o.secure)+Vi("SameSite",o.sameSite)}(n)}function c5(){return function(e){for(var t={},n=e?e.split("; "):[],o=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var i=n[r].split("="),a=i.slice(1).join("=");a.charAt(0)==='"'&&(a=a.slice(1,-1));try{t[i[0].replace(o,decodeURIComponent)]=a.replace(o,decodeURIComponent)}catch{}}return t}(document.cookie)}var l5=function(e){return c5()[e]};function Tw(e,t,n){document.cookie=s5(e,t,ka({path:"/"},n))}var Iw=Tw,Rw=function(e,t){Tw(e,"",ka(ka({},t),{expires:-1}))};const Xr={get(e){const t=l5(e);if(t!==void 0)return JSON.parse(t)},save(e,t,n){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),n!=null&&n.daysUntilExpire&&(o.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(o.domain=n.cookieDomain),Iw(e,JSON.stringify(t),o)},remove(e,t){let n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Rw(e,n)}},u5={get(e){return Xr.get(e)||Xr.get("".concat("_legacy_").concat(e))},save(e,t,n){let o={};window.location.protocol==="https:"&&(o={secure:!0}),n!=null&&n.daysUntilExpire&&(o.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(o.domain=n.cookieDomain),Iw("".concat("_legacy_").concat(e),JSON.stringify(t),o),Xr.save(e,t,n)},remove(e,t){let n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Rw(e,n),Xr.remove(e,t),Xr.remove("".concat("_legacy_").concat(e),t)}},d5={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var Mo;(function(e){e.Code="code",e.ConnectCode="connect_code"})(Mo||(Mo={}));function f5(e,t,n){var o=t===void 0?null:t,r=function(c,u){var d=atob(c);if(u){for(var f=new Uint8Array(d.length),p=0,h=d.length;p<h;++p)f[p]=d.charCodeAt(p);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return d}(e,n!==void 0&&n),i=r.indexOf(`
|
|
55
|
-
`,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var Uh,Vh,Kh,_l,p5=(Uh="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHQpe2xldHtlcnJvcjpyLGVycm9yX2Rlc2NyaXB0aW9uOnN9PXQ7cmV0dXJuIG5ldyBlKHIscyl9fWNsYXNzIHQgZXh0ZW5kcyBle2NvbnN0cnVjdG9yKGUscyl7c3VwZXIoIm1pc3NpbmdfcmVmcmVzaF90b2tlbiIsIk1pc3NpbmcgUmVmcmVzaCBUb2tlbiAoYXVkaWVuY2U6ICciLmNvbmNhdChyKGUsWyJkZWZhdWx0Il0pLCInLCBzY29wZTogJyIpLmNvbmNhdChyKHMpLCInKSIpKSx0aGlzLmF1ZGllbmNlPWUsdGhpcy5zY29wZT1zLE9iamVjdC5zZXRQcm90b3R5cGVPZih0aGlzLHQucHJvdG90eXBlKX19ZnVuY3Rpb24gcihlKXtsZXQgdD1hcmd1bWVudHMubGVuZ3RoPjEmJnZvaWQgMCE9PWFyZ3VtZW50c1sxXT9hcmd1bWVudHNbMV06W107cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+IiIuY29uY2F0KGUsInwiKS5jb25jYXQodCk7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jIGU9PntsZXQgcixjLHtkYXRhOnt0aW1lb3V0OmksYXV0aDphLGZldGNoVXJsOmYsZmV0Y2hPcHRpb25zOmwsdXNlRm9ybURhdGE6cCx1c2VNcnJ0Omh9LHBvcnRzOlt1XX09ZSxkPXt9O2NvbnN0e2F1ZGllbmNlOmcsc2NvcGU6eX09YXx8e307dHJ5e2NvbnN0IGU9cD8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShsLmJvZHkpOkpTT04ucGFyc2UobC5ib2R5KTtpZighZS5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1lLmdyYW50X3R5cGUpe2lmKGM9KChlLHQpPT5vW24oZSx0KV0pKGcseSksIWMmJmgpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKCIiLmNvbmNhdChlLCJ8IikpKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxnKTtlJiYhdCYmKGM9ZSl9aWYoIWMpdGhyb3cgbmV3IHQoZyx5KTtsLmJvZHk9cD9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpjfSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpjfSkpfWxldCBhLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGE9bmV3IEFib3J0Q29udHJvbGxlcixsLnNpZ25hbD1hLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoaj1pLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsaikpKSksZmV0Y2goZixPYmplY3QuYXNzaWduKHt9LGwpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHUucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBhJiZhLmFib3J0KCksdm9pZCB1LnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO189ay5oZWFkZXJzLGQ9Wy4uLl9dLnJlZHVjZSgoKGUsdCk9PntsZXRbcixzXT10O3JldHVybiBlW3JdPXMsZX0pLHt9KSxyPWF3YWl0IGsuanNvbigpLHIucmVmcmVzaF90b2tlbj8oaCYmKG8ubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLE89YyxiPXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhvKS5mb3JFYWNoKChlPT57bGV0W3Qscl09ZTtyPT09TyYmKG9bdF09Yil9KSkpLCgoZSx0LHIpPT57b1tuKHQscildPWV9KShyLnJlZnJlc2hfdG9rZW4sZyx5KSxkZWxldGUgci5yZWZyZXNoX3Rva2VuKTooKGUsdCk9PntkZWxldGUgb1tuKGUsdCldfSkoZyx5KSx1LnBvc3RNZXNzYWdlKHtvazprLm9rLGpzb246cixoZWFkZXJzOmR9KX1jYXRjaChlKXt1LnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjplLmVycm9yLGVycm9yX2Rlc2NyaXB0aW9uOmUubWVzc2FnZX0saGVhZGVyczpkfSl9dmFyIE8sYixfLGp9KSl9KCk7Cgo=",Vh=null,Kh=!1,function(e){return _l=_l||f5(Uh,Vh,Kh),new Worker(_l,e)});const Ol={},Gh=async function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3;for(let n=0;n<t;n++)if(await e())return!0;return!1};class h5{constructor(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var n;const o=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);o.add(t),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(t){const n=await this.cache.get(this.manifestKey);if(n){const o=new Set(n.keys);return o.delete(t),o.size>0?await this.cache.set(this.manifestKey,{keys:[...o]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return"".concat("@@auth0spajs@@","::").concat(t)}}const m5={memory:()=>new Nw().enclosedCache,localstorage:()=>new n5},qh=e=>m5[e],Jh=e=>{const{openUrl:t,onRedirect:n}=e,o=On(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:t===!1||t?t:n})},Zh=(e,t)=>{const n=(t==null?void 0:t.split(" "))||[];return((e==null?void 0:e.split(" "))||[]).every(o=>n.includes(o))},fr={NONCE:"nonce",KEYPAIR:"keypair"};class g5{constructor(t){this.clientId=t}getVersion(){return 1}createDbHandle(){const t=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((n,o)=>{t.onupgradeneeded=()=>Object.values(fr).forEach(r=>t.result.createObjectStore(r)),t.onerror=()=>o(t.error),t.onsuccess=()=>n(t.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(t,n,o){const r=o((await this.getDbHandle()).transaction(t,n).objectStore(t));return new Promise((i,a)=>{r.onsuccess=()=>i(r.result),r.onerror=()=>a(r.error)})}buildKey(t){const n=t?"_".concat(t):"auth0";return"".concat(this.clientId,"::").concat(n)}setNonce(t,n){return this.save(fr.NONCE,this.buildKey(n),t)}setKeyPair(t){return this.save(fr.KEYPAIR,this.buildKey(),t)}async save(t,n,o){await this.executeDbRequest(t,"readwrite",r=>r.put(o,n))}findNonce(t){return this.find(fr.NONCE,this.buildKey(t))}findKeyPair(){return this.find(fr.KEYPAIR,this.buildKey())}find(t,n){return this.executeDbRequest(t,"readonly",o=>o.get(n))}async deleteBy(t,n){const o=await this.executeDbRequest(t,"readonly",r=>r.getAllKeys());o==null||o.filter(n).map(r=>this.executeDbRequest(t,"readwrite",i=>i.delete(r)))}deleteByClientId(t,n){return this.deleteBy(t,o=>typeof o=="string"&&o.startsWith("".concat(n,"::")))}clearNonces(){return this.deleteByClientId(fr.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(fr.KEYPAIR,this.clientId)}}class y5{constructor(t){this.storage=new g5(t)}getNonce(t){return this.storage.findNonce(t)}setNonce(t,n){return this.storage.setNonce(t,n)}async getOrGenerateKeyPair(){let t=await this.storage.findKeyPair();return t||(t=await GC(),await this.storage.setKeyPair(t)),t}async generateProof(t){const n=await this.getOrGenerateKeyPair();return JC(Object.assign({keyPair:n},t))}async calculateThumbprint(){return qC(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var ii;(function(e){e.Bearer="Bearer",e.DPoP="DPoP"})(ii||(ii={}));class v5{constructor(t,n){this.hooks=n,this.config=Object.assign(Object.assign({},t),{fetch:t.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(t){return/^(https?:)?\/\//i.test(t)}buildUrl(t,n){if(n){if(this.isAbsoluteUrl(n))return n;if(t)return"".concat(t.replace(/\/?\/$/,""),"/").concat(n.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(t){return this.config.getAccessToken?this.config.getAccessToken(t):this.hooks.getAccessToken(t)}extractUrl(t){return typeof t=="string"?t:t instanceof URL?t.href:t.url}buildBaseRequest(t,n){if(!this.config.baseUrl)return new Request(t,n);const o=this.buildUrl(this.config.baseUrl,this.extractUrl(t)),r=t instanceof Request?new Request(o,t):o;return new Request(r,n)}setAuthorizationHeader(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ii.Bearer;t.headers.set("authorization","".concat(o," ").concat(n))}async setDpopProofHeader(t,n){if(!this.config.dpopNonceId)return;const o=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:n,method:t.method,nonce:o,url:t.url});t.headers.set("dpop",r)}async prepareRequest(t,n){const o=await this.getAccessToken(n);let r,i;typeof o=="string"?(r=this.config.dpopNonceId?ii.DPoP:ii.Bearer,i=o):(r=o.token_type,i=o.access_token),this.setAuthorizationHeader(t,i,r),r===ii.DPoP&&await this.setDpopProofHeader(t,i)}getHeader(t,n){return Array.isArray(t)?new Headers(t).get(n)||"":typeof t.get=="function"?t.get(n)||"":t[n]||""}hasUseDpopNonceError(t){if(t.status!==401)return!1;const n=this.getHeader(t.headers,"www-authenticate");return n.includes("invalid_dpop_nonce")||n.includes("use_dpop_nonce")}async handleResponse(t,n){const o=this.getHeader(t.headers,"dpop-nonce");if(o&&await this.hooks.setDpopNonce(o),!this.hasUseDpopNonceError(t))return t;if(!o||!n.onUseDpopNonceError)throw new Wc(o);return n.onUseDpopNonceError()}async internalFetchWithAuth(t,n,o,r){const i=this.buildBaseRequest(t,n);await this.prepareRequest(i,r);const a=await this.config.fetch(i);return this.handleResponse(a,o)}fetchWithAuth(t,n,o){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(t,n,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),o)};return this.internalFetchWithAuth(t,n,r,o)}}class w5{constructor(t,n){this.myAccountFetcher=t,this.apiBase=n}async connectAccount(t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async completeAccount(t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async _handleResponse(t){let n;try{n=await t.text(),n=JSON.parse(n)}catch(o){throw new ec({type:"invalid_json",status:t.status,title:"Invalid JSON response",detail:n||String(o)})}if(t.ok)return n;throw new ec(n)}}class ec extends Error{constructor(t){let{type:n,status:o,title:r,detail:i,validation_errors:a}=t;super(i),this.name="MyAccountApiError",this.type=n,this.status=o,this.title=r,this.detail=i,this.validation_errors=a,Object.setPrototypeOf(this,ec.prototype)}}const b5={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}},x5="http://auth0.com/oauth/grant-type/mfa-otp",k5="http://auth0.com/oauth/grant-type/mfa-oob",S5="http://auth0.com/oauth/grant-type/mfa-recovery-code";function Lw(e,t){this.v=e,this.k=t}function yt(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function C5(e){return new Lw(e,0)}function Dw(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ue(e,t){return e.get(yt(e,t))}function St(e,t,n){Dw(e,t),t.set(e,n)}function lt(e,t,n){return e.set(yt(e,t),n),n}function he(e,t,n){return(t=function(o){var r=function(i,a){if(typeof i!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var c=s.call(i,a||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(o,"string");return typeof r=="symbol"?r:r+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yh(Object(n),!0).forEach(function(o){he(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yh(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Xh(e,t){if(e==null)return{};var n,o,r=function(a,s){if(a==null)return{};var c={};for(var u in a)if({}.hasOwnProperty.call(a,u)){if(s.indexOf(u)!==-1)continue;c[u]=a[u]}return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function E5(e){return function(){return new ea(e.apply(this,arguments))}}function ea(e){var t,n;function o(i,a){try{var s=e[i](a),c=s.value,u=c instanceof Lw;Promise.resolve(u?c.v:c).then(function(d){if(u){var f=i==="return"?"return":"next";if(!c.k||d.done)return o(f,d);d=e[f](d).value}r(s.done?"return":"normal",d)},function(d){o("throw",d)})}catch(d){r("throw",d)}}function r(i,a){switch(i){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(i,a){return new Promise(function(s,c){var u={key:i,arg:a,resolve:s,reject:c,next:null};n?n=n.next=u:(t=n=u,o(i,a))})},typeof e.return!="function"&&(this.return=void 0)}var ss,Al;let Xu;if(ea.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ea.prototype.next=function(e){return this._invoke("next",e)},ea.prototype.throw=function(e){return this._invoke("throw",e)},ea.prototype.return=function(e){return this._invoke("return",e)},typeof navigator>"u"||(ss=navigator.userAgent)===null||ss===void 0||(Al=ss.startsWith)===null||Al===void 0||!Al.call(ss,"Mozilla/5.0 ")){const e="v3.8.3";Xu="".concat("oauth4webapi","/").concat(e)}function Ti(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}function Je(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}const Cn=Symbol(),Qu=Symbol(),ed=Symbol(),zn=Symbol(),j5=Symbol(),to=Symbol(),_5=new TextEncoder,O5=new TextDecoder;function pi(e){return typeof e=="string"?_5.encode(e):O5.decode(e)}let td,Mw;Uint8Array.prototype.toBase64?td=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):td=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o<t.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Tr(e){return typeof e=="string"?Mw(e):td(e)}Mw=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(t){throw Je("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",t)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}catch(t){throw Je("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",t)}};class fn extends Error{constructor(t,n){var o;super(t,n),he(this,"code",void 0),this.name=this.constructor.name,this.code=rd,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class _f extends Error{constructor(t,n){var o;super(t,n),he(this,"code",void 0),this.name=this.constructor.name,n!=null&&n.code&&(this.code=n==null?void 0:n.code),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function Ae(e,t,n){return new _f(e,{code:t,cause:n})}function A5(e,t){if(function(n,o){if(!(n instanceof CryptoKey))throw Je("".concat(o," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),e.type!=="private")throw Je("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}function tc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Uc(e){Ti(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(e??{});if(Xu&&!t.has("user-agent")&&t.set("user-agent",Xu),t.has("authorization"))throw Je('"options.headers" must not include the "authorization" header name',"ERR_INVALID_ARG_VALUE");return t}function $w(e,t){if(t!==void 0){if(typeof t=="function"&&(t=t(e.href)),!(t instanceof AbortSignal))throw Je('"options.signal" must return or be an instance of AbortSignal',"ERR_INVALID_ARG_TYPE");return t}}function Qh(e){return e.includes("//")?e.replace("//","/"):e}async function P5(e,t){return async function(n,o,r,i){if(!(n instanceof URL))throw Je('"'.concat(o,'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");Of(n,(i==null?void 0:i[Cn])!==!0);const a=r(new URL(n.href)),s=Uc(i==null?void 0:i.headers);return s.set("accept","application/json"),((i==null?void 0:i[zn])||fetch)(a.href,{body:void 0,headers:Object.fromEntries(s.entries()),method:"GET",redirect:"manual",signal:$w(a,i==null?void 0:i.signal)})}(e,"issuerIdentifier",n=>{switch(t==null?void 0:t.algorithm){case void 0:case"oidc":(function(o,r){o.pathname=Qh("".concat(o.pathname,"/").concat(r))})(n,".well-known/openid-configuration");break;case"oauth2":(function(o,r){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];o.pathname==="/"?o.pathname=r:o.pathname=Qh("".concat(r,"/").concat(i?o.pathname:o.pathname.replace(/(\/)$/,"")))})(n,".well-known/oauth-authorization-server");break;default:throw Je('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return n},t)}function Xo(e,t,n,o,r){try{if(typeof e!="number"||!Number.isFinite(e))throw Je("".concat(n," must be a number"),"ERR_INVALID_ARG_TYPE",r);if(e>0)return;if(t){if(e!==0)throw Je("".concat(n," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",r);return}throw Je("".concat(n," must be a positive number"),"ERR_INVALID_ARG_VALUE",r)}catch(i){throw o?Ae(i.message,o,r):i}}function bt(e,t,n,o){try{if(typeof e!="string")throw Je("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",o);if(e.length===0)throw Je("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",o)}catch(r){throw n?Ae(r.message,n,o):r}}function Hw(e){(function(t,n){if(Ww(t)!==n)throw function(o){let r='"response" content-type must be ';for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if(a.length>2){const c=a.pop();r+="".concat(a.join(", "),", or ").concat(c)}else a.length===2?r+="".concat(a[0]," or ").concat(a[1]):r+=a[0];return Ae(r,Vw,o)}(t,n)})(e,"application/json")}function Bw(){return Tr(crypto.getRandomValues(new Uint8Array(32)))}function N5(e){switch(e.algorithm.name){case"RSA-PSS":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new fn("unsupported RsaHashedKeyAlgorithm hash name",{cause:t})}}(e);case"RSASSA-PKCS1-v1_5":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new fn("unsupported RsaHashedKeyAlgorithm hash name",{cause:t})}}(e);case"ECDSA":return function(t){switch(t.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new fn("unsupported EcKeyAlgorithm namedCurve",{cause:t})}}(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new fn("unsupported CryptoKey algorithm name",{cause:e})}}function nc(e){const t=e==null?void 0:e[Qu];return typeof t=="number"&&Number.isFinite(t)?t:0}function nd(e){const t=e==null?void 0:e[ed];return typeof t=="number"&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function oc(){return Math.floor(Date.now()/1e3)}function Ln(e){if(typeof e!="object"||e===null)throw Je('"as" must be an object',"ERR_INVALID_ARG_TYPE");bt(e.issuer,'"as.issuer"')}function Dn(e){if(typeof e!="object"||e===null)throw Je('"client" must be an object',"ERR_INVALID_ARG_TYPE");bt(e.client_id,'"client.client_id"')}function em(e){return bt(e,'"clientSecret"'),(t,n,o,r)=>{o.set("client_id",n.client_id),o.set("client_secret",e)}}function T5(e,t){const{key:n,kid:o}=(r=e)instanceof CryptoKey?{key:r}:(r==null?void 0:r.key)instanceof CryptoKey?(r.kid!==void 0&&bt(r.kid,'"kid"'),{key:r.key,kid:r.kid}):{};var r;return A5(n,'"clientPrivateKey.key"'),async(i,a,s,c)=>{var u;const d={alg:N5(n),kid:o},f=function(p,h){const m=oc()+nc(h);return{jti:Bw(),aud:p.issuer,exp:m+60,iat:m,nbf:m,iss:h.client_id,sub:h.client_id}}(i,a);t==null||(u=t[j5])===null||u===void 0||u.call(t,d,f),s.set("client_id",a.client_id),s.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),s.set("client_assertion",await async function(p,h,m){if(!m.usages.includes("sign"))throw Je('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const g="".concat(Tr(pi(JSON.stringify(p))),".").concat(Tr(pi(JSON.stringify(h)))),y=Tr(await crypto.subtle.sign(function(b){switch(b.algorithm.name){case"ECDSA":return{name:b.algorithm.name,hash:Z5(b)};case"RSA-PSS":switch(om(b),b.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:b.algorithm.name,saltLength:parseInt(b.algorithm.hash.name.slice(-3),10)>>3};default:throw new fn("unsupported RSA-PSS hash name",{cause:b})}case"RSASSA-PKCS1-v1_5":return om(b),b.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return b.algorithm.name}throw new fn("unsupported CryptoKey algorithm name",{cause:b})}(m),m,pi(g)));return"".concat(g,".").concat(y)}(d,f,n))}}const I5=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function Of(e,t){if(t&&e.protocol!=="https:")throw Ae("only requests to HTTPS are allowed",Kw,e);if(e.protocol!=="https:"&&e.protocol!=="http:")throw Ae("only HTTP and HTTPS requests are allowed",Gw,e)}function tm(e,t,n,o){let r;if(typeof e!="string"||!(r=I5(e)))throw Ae("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),e===void 0?q5:J5,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return Of(r,o),r}function Da(e,t,n,o){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?tm(e.mtls_endpoint_aliases[t],t,n,o):tm(e[t],t,n,o)}class Vc extends Error{constructor(t,n){var o;super(t,n),he(this,"cause",void 0),he(this,"code",void 0),he(this,"error",void 0),he(this,"status",void 0),he(this,"error_description",void 0),he(this,"response",void 0),this.name=this.constructor.name,this.code=K5,this.cause=n.cause,this.error=n.cause.error,this.status=n.response.status,this.error_description=n.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class zw extends Error{constructor(t,n){var o,r;super(t,n),he(this,"cause",void 0),he(this,"code",void 0),he(this,"error",void 0),he(this,"error_description",void 0),this.name=this.constructor.name,this.code=G5,this.cause=n.cause,this.error=n.cause.get("error"),this.error_description=(o=n.cause.get("error_description"))!==null&&o!==void 0?o:void 0,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class Af extends Error{constructor(t,n){var o;super(t,n),he(this,"cause",void 0),he(this,"code",void 0),he(this,"response",void 0),he(this,"status",void 0),this.name=this.constructor.name,this.code=V5,this.cause=n.cause,this.status=n.response.status,this.response=n.response,Object.defineProperty(this,"response",{enumerable:!1}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}const R5="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",L5=new RegExp("^[,\\s]*("+R5+")"),D5=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),M5=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),$5=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Pf(e,t,n){if(e.status!==t){let r;var o;throw function(i){let a;if(a=function(s){if(!Ti(s,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");const c=s.headers.get("www-authenticate");if(c===null)return;const u=[];let d=c;for(;d;){var f;let p=d.match(L5);const h=(f=p)===null||f===void 0?void 0:f[1].toLowerCase();if(!h)return;const m=d.substring(p[0].length);if(m&&!m.match(/^[\s,]/))return;const g=m.match(/^\s+(.*)$/),y=!!g;d=g?g[1]:void 0;const b={};let k;if(y)for(;d;){let S,w;if(p=d.match(D5)){if([,S,w,d]=p,w.includes("\\"))try{w=JSON.parse('"'.concat(w,'"'))}catch{}b[S.toLowerCase()]=w}else{if(!(p=d.match(M5))){if(p=d.match($5)){if(Object.keys(b).length)break;[,k,d]=p;break}return}[,S,w,d]=p,b[S.toLowerCase()]=w}}else d=m||void 0;const x={scheme:h,parameters:b};k&&(x.token68=k),u.push(x)}return u.length?u:void 0}(i))throw new Af("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:a,response:i})}(e),(r=await async function(i){if(i.status>399&&i.status<500){$a(i),Hw(i);try{const a=await i.clone().json();if(tc(a)&&typeof a.error=="string"&&a.error.length)return a}catch{}}}(e))?(await((o=e.body)===null||o===void 0?void 0:o.cancel()),new Vc("server responded with an error in the response body",{cause:r,response:e})):Ae('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),If,e)}}function Fw(e){if(!Tf.has(e))throw Je('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function Ww(e){var t;return(t=e.headers.get("content-type"))===null||t===void 0?void 0:t.split(";")[0]}async function Nf(e,t,n,o,r,i,a){return await n(e,t,r,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((a==null?void 0:a[zn])||fetch)(o.href,{body:r,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:$w(o,a==null?void 0:a.signal)})}async function Ma(e,t,n,o,r,i){var a;const s=Da(e,"token_endpoint",t.use_mtls_endpoint_aliases,(i==null?void 0:i[Cn])!==!0);r.set("grant_type",o);const c=Uc(i==null?void 0:i.headers);c.set("accept","application/json"),(i==null?void 0:i.DPoP)!==void 0&&(Fw(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await Nf(e,t,n,s,r,c,i);return i==null||(a=i.DPoP)===null||a===void 0||a.cacheNonce(u,s),u}const Uw=new WeakMap,H5=new WeakMap;function od(e){if(!e.id_token)return;const t=Uw.get(e);if(!t)throw Je('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function _i(e,t,n,o,r,i){if(Ln(e),Dn(t),!Ti(n,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Pf(n,200,"Token Endpoint"),$a(n);const a=await Kc(n);if(bt(a.access_token,'"response" body "access_token" property',Fe,{body:a}),bt(a.token_type,'"response" body "token_type" property',Fe,{body:a}),a.token_type=a.token_type.toLowerCase(),a.expires_in!==void 0){let s=typeof a.expires_in!="number"?parseFloat(a.expires_in):a.expires_in;Xo(s,!0,'"response" body "expires_in" property',Fe,{body:a}),a.expires_in=s}if(a.refresh_token!==void 0&&bt(a.refresh_token,'"response" body "refresh_token" property',Fe,{body:a}),a.scope!==void 0&&typeof a.scope!="string")throw Ae('"response" body "scope" property must be a string',Fe,{body:a});if(a.id_token!==void 0){bt(a.id_token,'"response" body "id_token" property',Fe,{body:a});const s=["aud","exp","iat","iss","sub"];t.require_auth_time===!0&&s.push("auth_time"),t.default_max_age!==void 0&&(Xo(t.default_max_age,!0,'"client.default_max_age"'),s.push("auth_time")),o!=null&&o.length&&s.push(...o);const{claims:c,jwt:u}=await async function(d,f,p,h,m){let g,y,{0:b,1:k,length:x}=d.split(".");if(x===5){if(m===void 0)throw new fn("JWE decryption is not configured",{cause:d});d=await m(d),{0:b,1:k,length:x}=d.split(".")}if(x!==3)throw Ae("Invalid JWT",Fe,d);try{g=JSON.parse(pi(Tr(b)))}catch(w){throw Ae("failed to parse JWT Header body as base64url encoded JSON",rc,w)}if(!tc(g))throw Ae("JWT Header must be a top level object",Fe,d);if(f(g),g.crit!==void 0)throw new fn('no JWT "crit" header parameter extensions are supported',{cause:{header:g}});try{y=JSON.parse(pi(Tr(k)))}catch(w){throw Ae("failed to parse JWT Payload body as base64url encoded JSON",rc,w)}if(!tc(y))throw Ae("JWT Payload must be a top level object",Fe,d);const S=oc()+p;if(y.exp!==void 0){if(typeof y.exp!="number")throw Ae('unexpected JWT "exp" (expiration time) claim type',Fe,{claims:y});if(y.exp<=S-h)throw Ae('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Sa,{claims:y,now:S,tolerance:h,claim:"exp"})}if(y.iat!==void 0&&typeof y.iat!="number")throw Ae('unexpected JWT "iat" (issued at) claim type',Fe,{claims:y});if(y.iss!==void 0&&typeof y.iss!="string")throw Ae('unexpected JWT "iss" (issuer) claim type',Fe,{claims:y});if(y.nbf!==void 0){if(typeof y.nbf!="number")throw Ae('unexpected JWT "nbf" (not before) claim type',Fe,{claims:y});if(y.nbf>S+h)throw Ae('unexpected JWT "nbf" (not before) claim value',Sa,{claims:y,now:S,tolerance:h,claim:"nbf"})}if(y.aud!==void 0&&typeof y.aud!="string"&&!Array.isArray(y.aud))throw Ae('unexpected JWT "aud" (audience) claim type',Fe,{claims:y});return{header:g,claims:y,jwt:d}}(a.id_token,X5.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),nc(t),nd(t),r).then(W5.bind(void 0,s)).then(z5.bind(void 0,e)).then(B5.bind(void 0,t.client_id));if(Array.isArray(c.aud)&&c.aud.length!==1){if(c.azp===void 0)throw Ae('ID Token "aud" (audience) claim includes additional untrusted audiences',vo,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw Ae('unexpected ID Token "azp" (authorized party) claim value',vo,{expected:t.client_id,claims:c,claim:"azp"})}c.auth_time!==void 0&&Xo(c.auth_time,!0,'ID Token "auth_time" (authentication time)',Fe,{claims:c}),H5.set(n,u),Uw.set(a,c)}if((i==null?void 0:i[a.token_type])!==void 0)i[a.token_type](n,a);else if(a.token_type!=="dpop"&&a.token_type!=="bearer")throw new fn("unsupported `token_type` value",{cause:{body:a}});return a}function B5(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw Ae('unexpected JWT "aud" (audience) claim value',vo,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw Ae('unexpected JWT "aud" (audience) claim value',vo,{expected:e,claims:t.claims,claim:"aud"});return t}function z5(e,t){var n,o;const r=(n=(o=e[qw])===null||o===void 0?void 0:o.call(e,t))!==null&&n!==void 0?n:e.issuer;if(t.claims.iss!==r)throw Ae('unexpected JWT "iss" (issuer) claim value',vo,{expected:r,claims:t.claims,claim:"iss"});return t}const Tf=new WeakSet,nm=Symbol(),F5={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function W5(e,t){for(const n of e)if(t.claims[n]===void 0)throw Ae('JWT "'.concat(n,'" (').concat(F5[n],") claim missing"),Fe,{claims:t.claims});return t}const Pl=Symbol(),Nl=Symbol();async function U5(e,t,n,o){return typeof(o==null?void 0:o.expectedNonce)=="string"||typeof(o==null?void 0:o.maxAge)=="number"||o!=null&&o.requireIdToken?async function(r,i,a,s,c,u,d){const f=[];switch(s){case void 0:s=Pl;break;case Pl:break;default:bt(s,'"expectedNonce" argument'),f.push("nonce")}switch(c!=null||(c=i.default_max_age),c){case void 0:c=Nl;break;case Nl:break;default:Xo(c,!0,'"maxAge" argument'),f.push("auth_time")}const p=await _i(r,i,a,f,u,d);bt(p.id_token,'"response" body "id_token" property',Fe,{body:p});const h=od(p);if(c!==Nl){const m=oc()+nc(i),g=nd(i);if(h.auth_time+c<m-g)throw Ae("too much time has elapsed since the last End-User authentication",Sa,{claims:h,now:m,tolerance:g,claim:"auth_time"})}if(s===Pl){if(h.nonce!==void 0)throw Ae('unexpected ID Token "nonce" claim value',vo,{expected:void 0,claims:h,claim:"nonce"})}else if(h.nonce!==s)throw Ae('unexpected ID Token "nonce" claim value',vo,{expected:s,claims:h,claim:"nonce"});return p}(e,t,n,o.expectedNonce,o.maxAge,o[to],o.recognizedTokenTypes):async function(r,i,a,s,c){const u=await _i(r,i,a,void 0,s,c),d=od(u);if(d){if(i.default_max_age!==void 0){Xo(i.default_max_age,!0,'"client.default_max_age"');const f=oc()+nc(i),p=nd(i);if(d.auth_time+i.default_max_age<f-p)throw Ae("too much time has elapsed since the last End-User authentication",Sa,{claims:d,now:f,tolerance:p,claim:"auth_time"})}if(d.nonce!==void 0)throw Ae('unexpected ID Token "nonce" claim value',vo,{expected:void 0,claims:d,claim:"nonce"})}return u}(e,t,n,o==null?void 0:o[to],o==null?void 0:o.recognizedTokenTypes)}const V5="OAUTH_WWW_AUTHENTICATE_CHALLENGE",K5="OAUTH_RESPONSE_BODY_ERROR",rd="OAUTH_UNSUPPORTED_OPERATION",G5="OAUTH_AUTHORIZATION_RESPONSE_ERROR",rc="OAUTH_PARSE_ERROR",Fe="OAUTH_INVALID_RESPONSE",Vw="OAUTH_RESPONSE_IS_NOT_JSON",If="OAUTH_RESPONSE_IS_NOT_CONFORM",Kw="OAUTH_HTTP_REQUEST_FORBIDDEN",Gw="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Sa="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",vo="OAUTH_JWT_CLAIM_COMPARISON_FAILED",id="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",q5="OAUTH_MISSING_SERVER_METADATA",J5="OAUTH_INVALID_SERVER_METADATA";function $a(e){if(e.bodyUsed)throw Je('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function om(e){const{algorithm:t}=e;if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new fn("unsupported ".concat(t.name," modulusLength"),{cause:e})}function Z5(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new fn("unsupported ECDSA namedCurve",{cause:e})}}async function Y5(e){if(e.method!=="POST")throw Je("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if(Ww(e)!=="application/x-www-form-urlencoded")throw Je("form_post responses are expected to use the application/x-www-form-urlencoded content-type","ERR_INVALID_ARG_VALUE",{cause:e});return async function(t){if(t.bodyUsed)throw Je("form_post Request instances must contain a readable body","ERR_INVALID_ARG_VALUE",{cause:t});return t.text()}(e)}function X5(e,t,n,o){if(e===void 0)if(Array.isArray(t)){if(!t.includes(o.alg))throw Ae('unexpected JWT "alg" header parameter',Fe,{header:o,expected:t,reason:"authorization server metadata"})}else{if(n===void 0)throw Ae('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if(typeof n=="string"?o.alg!==n:typeof n=="function"?!n(o.alg):!n.includes(o.alg))throw Ae('unexpected JWT "alg" header parameter',Fe,{header:o,expected:n,reason:"default value"})}else if(typeof e=="string"?o.alg!==e:!e.includes(o.alg))throw Ae('unexpected JWT "alg" header parameter',Fe,{header:o,expected:e,reason:"client configuration"})}function Sr(e,t){const{0:n,length:o}=e.getAll(t);if(o>1)throw Ae('"'.concat(t,'" parameter must be provided only once'),Fe);return n}const Q5=Symbol(),eE=Symbol();function tE(e,t,n,o){if(Ln(e),Dn(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Je('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(Sr(n,"response"))throw Ae('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Fe,{parameters:n});const r=Sr(n,"iss"),i=Sr(n,"state");if(!r&&e.authorization_response_iss_parameter_supported)throw Ae('response parameter "iss" (issuer) missing',Fe,{parameters:n});if(r&&r!==e.issuer)throw Ae('unexpected "iss" (issuer) response parameter value',Fe,{expected:e.issuer,parameters:n});switch(o){case void 0:case eE:if(i!==void 0)throw Ae('unexpected "state" response parameter encountered',Fe,{expected:void 0,parameters:n});break;case Q5:break;default:if(bt(o,'"expectedState" argument'),i!==o)throw Ae(i===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',Fe,{expected:o,parameters:n})}if(Sr(n,"error"))throw new zw("authorization response from the server is an error",{cause:n});const a=Sr(n,"id_token"),s=Sr(n,"token");if(a!==void 0||s!==void 0)throw new fn("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),Tf.add(c),c;var c}async function Kc(e){let t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hw;try{t=await e.json()}catch(o){throw n(e),Ae('failed to parse "response" body as JSON',rc,o)}if(!tc(t))throw Ae('"response" body must be a top level object',Fe,{body:t});return t}const Tl=Symbol(),qw=Symbol(),rm=new TextEncoder,Ca=new TextDecoder;function Il(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=o}return t}function Jw(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function aa(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:Ca.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=Ca.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Jw(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}class $t extends Error{constructor(t,n){var o;super(t,n),he(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}he($t,"code","ERR_JOSE_GENERIC");class jn extends $t{constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(t,{cause:{claim:o,reason:r,payload:n}}),he(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),he(this,"claim",void 0),he(this,"reason",void 0),he(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}he(jn,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class ad extends $t{constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(t,{cause:{claim:o,reason:r,payload:n}}),he(this,"code","ERR_JWT_EXPIRED"),he(this,"claim",void 0),he(this,"reason",void 0),he(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}he(ad,"code","ERR_JWT_EXPIRED");class Zw extends $t{constructor(){super(...arguments),he(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}he(Zw,"code","ERR_JOSE_ALG_NOT_ALLOWED");class un extends $t{constructor(){super(...arguments),he(this,"code","ERR_JOSE_NOT_SUPPORTED")}}he(un,"code","ERR_JOSE_NOT_SUPPORTED");he(class extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),he(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");he(class extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Tt extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWS_INVALID")}}he(Tt,"code","ERR_JWS_INVALID");class sd extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWT_INVALID")}}he(sd,"code","ERR_JWT_INVALID");he(class extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Rf extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWKS_INVALID")}}he(Rf,"code","ERR_JWKS_INVALID");class Lf extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),he(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}he(Lf,"code","ERR_JWKS_NO_MATCHING_KEY");class Yw extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),he(this,Symbol.asyncIterator,void 0),he(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}he(Yw,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Xw extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),he(this,"code","ERR_JWKS_TIMEOUT")}}he(Xw,"code","ERR_JWKS_TIMEOUT");class Qw extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),he(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}he(Qw,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Wn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"algorithm.name";return new TypeError("CryptoKey does not support this operation, its ".concat(t," must be ").concat(e))},qr=(e,t)=>e.name===t;function Rl(e){return parseInt(e.name.slice(4),10)}function nE(e,t,n){switch(t){case"HS256":case"HS384":case"HS512":{if(!qr(e.algorithm,"HMAC"))throw Wn("HMAC");const o=parseInt(t.slice(2),10);if(Rl(e.algorithm.hash)!==o)throw Wn("SHA-".concat(o),"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!qr(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Wn("RSASSA-PKCS1-v1_5");const o=parseInt(t.slice(2),10);if(Rl(e.algorithm.hash)!==o)throw Wn("SHA-".concat(o),"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!qr(e.algorithm,"RSA-PSS"))throw Wn("RSA-PSS");const o=parseInt(t.slice(2),10);if(Rl(e.algorithm.hash)!==o)throw Wn("SHA-".concat(o),"algorithm.hash");break}case"Ed25519":case"EdDSA":if(!qr(e.algorithm,"Ed25519"))throw Wn("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!qr(e.algorithm,t))throw Wn(t);break;case"ES256":case"ES384":case"ES512":{if(!qr(e.algorithm,"ECDSA"))throw Wn("ECDSA");const o=function(r){switch(r){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==o)throw Wn(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}(function(o,r){if(r&&!o.usages.includes(r))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(r,"."))})(e,n)}function eb(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];if((o=o.filter(Boolean)).length>2){const a=o.pop();e+="one of type ".concat(o.join(", "),", or ").concat(a,".")}else o.length===2?e+="one of type ".concat(o[0]," or ").concat(o[1],"."):e+="of type ".concat(o[0],".");if(t==null)e+=" Received ".concat(t);else if(typeof t=="function"&&t.name)e+=" Received function ".concat(t.name);else if(typeof t=="object"&&t!=null){var i;(i=t.constructor)!==null&&i!==void 0&&i.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const im=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return eb("Key for the ".concat(e," algorithm must be "),t,...o)},tb=e=>{if((e==null?void 0:e[Symbol.toStringTag])==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},nb=e=>(e==null?void 0:e[Symbol.toStringTag])==="KeyObject",am=e=>tb(e)||nb(e);function rr(e){if(typeof(t=e)!="object"||t===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t;if(Object.getPrototypeOf(e)===null)return!0;let n=e;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const Ll=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0},sa=e=>{const t=e.data[e.pos++];if(128&t){const n=127&t;let o=0;for(let r=0;r<n;r++)o=o<<8|e.data[e.pos++];return o}return t},ca=(e,t,n)=>{if(e.data[e.pos++]!==t)throw new Error(n)},sm=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},oE=e=>{const t=(r=>{ca(r,6,"Expected algorithm OID");const i=sa(r);return sm(r,i)})(e);if(Ll(t,[43,101,110]))return"X25519";if(!Ll(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");ca(e,6,"Expected curve OID");const n=sa(e),o=sm(e,n);for(const{name:r,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(Ll(o,i))return r;throw new Error("Unsupported named curve")},rE=async(e,t,n,o)=>{var r;let i,a;const s=e==="spki",c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const u=o.getNamedCurve(t);i=u==="X25519"?{name:"X25519"}:{name:"ECDH",namedCurve:u}}catch{throw new un("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new un('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,(r=o==null?void 0:o.extractable)!==null&&r!==void 0?r:!!s,a)},iE=(e,t,n)=>{var o;const r=((a,s)=>Jw(a.replace(s,"")))(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);let i=n;return t!=null&&(o=t.startsWith)!==null&&o!==void 0&&o.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=a=>{const s={data:a,pos:0};return function(c){ca(c,48,"Invalid PKCS#8 structure"),sa(c),ca(c,2,"Expected version field");const u=sa(c);c.pos+=u,ca(c,48,"Expected algorithm identifier"),sa(c),c.pos}(s),oE(s)}),rE("pkcs8",r,t,i)};async function js(e){var t,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:o,keyUsages:r}=function(a){let s,c;switch(a.kty){case"AKP":switch(a.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":s={name:a.alg},c=a.priv?["sign"]:["verify"];break;default:throw new un('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(a.alg){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:"SHA-".concat(a.alg.slice(-3))},c=a.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(a.alg.slice(-3))},c=a.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(a.alg.slice(-3),10)||1)},c=a.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new un('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(a.alg){case"ES256":s={name:"ECDSA",namedCurve:"P-256"},c=a.d?["sign"]:["verify"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},c=a.d?["sign"]:["verify"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},c=a.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":s={name:"ECDH",namedCurve:a.crv},c=a.d?["deriveBits"]:[];break;default:throw new un('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(a.alg){case"Ed25519":case"EdDSA":s={name:"Ed25519"},c=a.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":s={name:a.crv},c=a.d?["deriveBits"]:[];break;default:throw new un('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new un('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:s,keyUsages:c}}(e),i=ke({},e);return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,o,(t=e.ext)!==null&&t!==void 0?t:!e.d&&!e.priv,(n=e.key_ops)!==null&&n!==void 0?n:r)}const cd=e=>rr(e)&&typeof e.kty=="string";let Uo;const cm=async function(e,t,n){let o=arguments.length>3&&arguments[3]!==void 0&&arguments[3];Uo||(Uo=new WeakMap);let r=Uo.get(e);if(r!=null&&r[n])return r[n];const i=await js(ke(ke({},t),{},{alg:n}));return o&&Object.freeze(e),r?r[n]=i:Uo.set(e,{[n]:i}),i};async function aE(e,t){if(e instanceof Uint8Array||tb(e))return e;if(nb(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return((o,r)=>{Uo||(Uo=new WeakMap);let i=Uo.get(o);if(i!=null&&i[r])return i[r];const a=o.type==="public",s=!!a;let c;if(o.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}c=o.toCryptoKey(o.asymmetricKeyType,s,a?[]:["deriveBits"])}if(o.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}switch(o.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(r!==o.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="rsa"){let d;switch(r){case"RSA-OAEP":d="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":d="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":d="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":d="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(r.startsWith("RSA-OAEP"))return o.toCryptoKey({name:"RSA-OAEP",hash:d},s,a?["encrypt"]:["decrypt"]);c=o.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:d},s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="ec"){var u;const d=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get((u=o.asymmetricKeyDetails)===null||u===void 0?void 0:u.namedCurve);if(!d)throw new TypeError("given KeyObject instance cannot be used for this algorithm");r==="ES256"&&d==="P-256"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r==="ES384"&&d==="P-384"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r==="ES512"&&d==="P-521"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r.startsWith("ECDH-ES")&&(c=o.toCryptoKey({name:"ECDH",namedCurve:d},s,a?[]:["deriveBits"]))}if(!c)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return i?i[r]=c:Uo.set(o,{[r]:c}),c})(e,t)}catch(o){if(o instanceof TypeError)throw o}let n=e.export({format:"jwk"});return cm(e,n,t)}if(cd(e))return e.k?aa(e.k):cm(e,e,t,!0);throw new Error("unreachable")}const Jr=e=>e==null?void 0:e[Symbol.toStringTag],Dl=(e,t,n)=>{if(t.use!==void 0){let i;switch(n){case"sign":case"verify":i="sig";break;case"encrypt":case"decrypt":i="enc"}if(t.use!==i)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(i,'" when present'))}if(t.alg!==void 0&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var o,r;let i;switch(!0){case(n==="sign"||n==="verify"):case e==="dir":case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?n==="encrypt"?"wrapKey":"unwrapKey":n;break;case(n==="encrypt"&&e.startsWith("RSA")):i="wrapKey";break;case n==="decrypt":i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&((o=t.key_ops)===null||o===void 0||(r=o.includes)===null||r===void 0?void 0:r.call(o,i))===!1)throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};function sE(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((o,r,i)=>{if(!(r instanceof Uint8Array)){if(cd(r)){if((a=>a.kty==="oct"&&typeof a.k=="string")(r)&&Dl(o,r,i))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!am(r))throw new TypeError(im(o,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError("".concat(Jr(r),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((o,r,i)=>{if(cd(r))switch(i){case"decrypt":case"sign":if((a=>a.kty!=="oct"&&(a.kty==="AKP"&&typeof a.priv=="string"||typeof a.d=="string"))(r)&&Dl(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((a=>a.kty!=="oct"&&a.d===void 0&&a.priv===void 0)(r)&&Dl(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!am(r))throw new TypeError(im(o,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError("".concat(Jr(r),' instances for asymmetric algorithms must not be of type "secret"'));if(r.type==="public")switch(i){case"sign":throw new TypeError("".concat(Jr(r),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(Jr(r),' instances for asymmetric algorithm decryption must be of type "private"'))}if(r.type==="private")switch(i){case"verify":throw new TypeError("".concat(Jr(r),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(Jr(r),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}var cs,Ml;let no,lm;if(typeof navigator>"u"||(cs=navigator.userAgent)===null||cs===void 0||(Ml=cs.startsWith)===null||Ml===void 0||!Ml.call(cs,"Mozilla/5.0 ")){const e="v6.8.1";lm="".concat("openid-client","/").concat(e),no={"user-agent":lm}}const Dt=e=>_s.get(e);let _s,ls;function ob(e){return e!==void 0?em(e):(ls||(ls=new WeakMap),(t,n,o,r)=>{let i;return(i=ls.get(n))||(function(a,s){if(typeof a!="string")throw oo("".concat(s," must be a string"),Ba);if(a.length===0)throw oo("".concat(s," must not be empty"),Ha)}(n.client_secret,'"metadata.client_secret"'),i=em(n.client_secret),ls.set(n,i)),i(t,n,o,r)})}const Vo=zn,Ha="ERR_INVALID_ARG_VALUE",Ba="ERR_INVALID_ARG_TYPE";function oo(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}function cE(e){return async function(t){return bt(t,"codeVerifier"),Tr(await crypto.subtle.digest("SHA-256",pi(t)))}(e)}function lE(){return Bw()}class ic extends Error{constructor(t,n){var o;super(t,n),he(this,"code",void 0),this.name=this.constructor.name,this.code=n==null?void 0:n.code,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function Kt(e,t,n){return new ic(e,{cause:t,code:n})}function Jt(e){if(e instanceof TypeError||e instanceof ic||e instanceof Vc||e instanceof zw||e instanceof Af)throw e;if(e instanceof _f)switch(e.code){case Kw:throw Kt("only requests to HTTPS are allowed",e,e.code);case Gw:throw Kt("only requests to HTTP or HTTPS are allowed",e,e.code);case If:throw Kt("unexpected HTTP response status code",e.cause,e.code);case Vw:throw Kt("unexpected response content-type",e.cause,e.code);case rc:throw Kt("parsing error occured",e,e.code);case Fe:throw Kt("invalid response encountered",e,e.code);case vo:throw Kt("unexpected JWT claim value encountered",e,e.code);case id:throw Kt("unexpected JSON attribute value encountered",e,e.code);case Sa:throw Kt("JWT timestamp claim value failed validation",e,e.code);default:throw Kt(e.message,e,e.code)}if(e instanceof fn)throw Kt("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Kt("runtime operation error",e,rd);case"NotSupportedError":throw Kt("runtime unsupported operation",e,rd);case"TimeoutError":throw Kt("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Kt("operation aborted",e,"OAUTH_ABORT")}throw new ic("something went wrong",{cause:e})}async function uE(e,t,n,o,r){const i=await async function(c,u){var d,f;if(!(c instanceof URL))throw oo('"server" must be an instance of URL',Ba);const p=!c.href.includes("/.well-known/"),h=(d=u==null?void 0:u.timeout)!==null&&d!==void 0?d:30,m=AbortSignal.timeout(1e3*h),g=await(p?P5(c,{algorithm:u==null?void 0:u.algorithm,[zn]:u==null?void 0:u[Vo],[Cn]:u==null||(f=u.execute)===null||f===void 0?void 0:f.includes(fm),signal:m,headers:new Headers(no)}):((u==null?void 0:u[Vo])||fetch)((Of(c,u==null||(y=u.execute)===null||y===void 0||!y.includes(fm)),c.href),{headers:Object.fromEntries(new Headers(ke({accept:"application/json"},no)).entries()),body:void 0,method:"GET",redirect:"manual",signal:m})).then(b=>async function(k,x){const S=k;if(!(S instanceof URL)&&S!==Tl)throw Je('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!Ti(x,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");if(x.status!==200)throw Ae('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',If,x);$a(x);const w=await Kc(x);if(bt(w.issuer,'"response" body "issuer" property',Fe,{body:w}),S!==Tl&&new URL(w.issuer).href!==S.href)throw Ae('"response" body "issuer" property does not match the expected value',id,{expected:S.href,body:w,attribute:"issuer"});return w}(Tl,b)).catch(Jt);var y;return p&&new URL(g.issuer).href!==c.href&&(function(b,k,x){return!(b.origin!=="https://login.microsoftonline.com"||x!=null&&x.algorithm&&x.algorithm!=="oidc"||(k[rb]=!0,0))}(c,g,u)||function(b,k){return!(!b.hostname.endsWith(".b2clogin.com")||k!=null&&k.algorithm&&k.algorithm!=="oidc")}(c,u)||(()=>{throw new ic("discovered metadata issuer does not match the expected issuer",{code:id,cause:{expected:c.href,body:g,attribute:"issuer"}})})()),g}(e,r),a=new ac(i,t,n,o);let s=Dt(a);if(r!=null&&r[Vo]&&(s.fetch=r[Vo]),r!=null&&r.timeout&&(s.timeout=r.timeout),r!=null&&r.execute)for(const c of r.execute)c(a);return a}new TextDecoder;const rb=Symbol();class ac{constructor(t,n,o,r){var i,a,s,c,u;if(typeof n!="string"||!n.length)throw oo('"clientId" must be a non-empty string',Ba);if(typeof o=="string"&&(o={client_secret:o}),((i=o)===null||i===void 0?void 0:i.client_id)!==void 0&&n!==o.client_id)throw oo('"clientId" and "metadata.client_id" must be the same',Ha);const d=ke(ke({},structuredClone(o)),{},{client_id:n});let f;d[Qu]=(a=(s=o)===null||s===void 0?void 0:s[Qu])!==null&&a!==void 0?a:0,d[ed]=(c=(u=o)===null||u===void 0?void 0:u[ed])!==null&&c!==void 0?c:30,f=r||(typeof d.client_secret=="string"&&d.client_secret.length?ob(d.client_secret):(g,y,b,k)=>{b.set("client_id",y.client_id)});let p=Object.freeze(d);const h=structuredClone(t);rb in t&&(h[qw]=g=>{let{claims:{tid:y}}=g;return t.issuer.replace("{tenantid}",y)});let m=Object.freeze(h);_s||(_s=new WeakMap),_s.set(this,{__proto__:null,as:m,c:p,auth:f,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const t=structuredClone(Dt(this).as);return function(n){Object.defineProperties(n,function(o){return{supportsPKCE:{__proto__:null,value(){var r;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"S256";return((r=o.code_challenge_methods_supported)===null||r===void 0?void 0:r.includes(i))===!0}}}}(n))}(t),t}clientMetadata(){return structuredClone(Dt(this).c)}get timeout(){return Dt(this).timeout}set timeout(t){Dt(this).timeout=t}get[Vo](){return Dt(this).fetch}set[Vo](t){Dt(this).fetch=t}}function za(e){Object.defineProperties(e,function(t){let n;if(t.expires_in!==void 0){const o=new Date;o.setSeconds(o.getSeconds()+t.expires_in),n=o.getTime()}return{expiresIn:{__proto__:null,value(){if(n){const o=Date.now();return n>o?Math.floor((n-o)/1e3):0}}},claims:{__proto__:null,value(){try{return od(this)}catch{return}}}}}(e))}async function um(e,t,n){var o;let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const i=(o=e.headers.get("retry-after"))===null||o===void 0?void 0:o.trim();if(i===void 0)return;let a;if(/^\d+$/.test(i))a=parseInt(i,10);else{const s=new Date(i);if(Number.isFinite(s.getTime())){const c=new Date,u=s.getTime()-c.getTime();u>0&&(a=Math.ceil(u/1e3))}}if(r&&!Number.isFinite(a))throw new _f("invalid Retry-After header value",{cause:e});a>t&&await ib(a-t,n)}function ib(e,t){return new Promise((n,o)=>{const r=i=>{try{t.throwIfAborted()}catch(s){return void o(s)}if(i<=0)return void n();const a=Math.min(i,5);setTimeout(()=>r(i-a),1e3*a)};r(e)})}async function dm(e,t){xo(e);const{as:n,c:o,auth:r,fetch:i,tlsOnly:a,timeout:s}=Dt(e);return async function(c,u,d,f,p){Ln(c),Dn(u);const h=Da(c,"backchannel_authentication_endpoint",u.use_mtls_endpoint_aliases,(p==null?void 0:p[Cn])!==!0),m=new URLSearchParams(f);m.set("client_id",u.client_id);const g=Uc(p==null?void 0:p.headers);return g.set("accept","application/json"),Nf(c,u,d,h,m,g,p)}(n,o,r,t,{[zn]:i,[Cn]:!a,headers:new Headers(no),signal:Fr(s)}).then(c=>async function(u,d,f){if(Ln(u),Dn(d),!Ti(f,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Pf(f,200,"Backchannel Authentication Endpoint"),$a(f);const p=await Kc(f);bt(p.auth_req_id,'"response" body "auth_req_id" property',Fe,{body:p});let h=typeof p.expires_in!="number"?parseFloat(p.expires_in):p.expires_in;return Xo(h,!0,'"response" body "expires_in" property',Fe,{body:p}),p.expires_in=h,p.interval!==void 0&&Xo(p.interval,!1,'"response" body "interval" property',Fe,{body:p}),p}(n,o,c)).catch(Jt)}async function ab(e,t,n,o){var r,i;xo(e),n=new URLSearchParams(n);let a=(r=t.interval)!==null&&r!==void 0?r:5;const s=(i=o==null?void 0:o.signal)!==null&&i!==void 0?i:AbortSignal.timeout(1e3*t.expires_in);try{await ib(a,s)}catch(w){Jt(w)}const{as:c,c:u,auth:d,fetch:f,tlsOnly:p,nonRepudiation:h,timeout:m,decrypt:g}=Dt(e),y=(w,C)=>ab(e,ke(ke({},t),{},{interval:w}),n,ke(ke({},o),{},{signal:s,flag:C})),b=await async function(w,C,O,_,N){Ln(w),Dn(C),bt(_,'"authReqId"');const E=new URLSearchParams(N==null?void 0:N.additionalParameters);return E.set("auth_req_id",_),Ma(w,C,O,"urn:openid:params:grant-type:ciba",E,N)}(c,u,d,t.auth_req_id,{[zn]:f,[Cn]:!p,additionalParameters:n,DPoP:o==null?void 0:o.DPoP,headers:new Headers(no),signal:s.aborted?s:Fr(m)}).catch(Jt);var k;if(b.status===503&&b.headers.has("retry-after"))return await um(b,a,s,!0),await((k=b.body)===null||k===void 0?void 0:k.cancel()),y(a);const x=async function(w,C,O,_){return _i(w,C,O,void 0,_==null?void 0:_[to],_==null?void 0:_.recognizedTokenTypes)}(c,u,b,{[to]:g});let S;try{S=await x}catch(w){if(Fa(w,o))return y(a,Qo);if(w instanceof Vc)switch(w.error){case"slow_down":a+=5;case"authorization_pending":return await um(w.response,a,s),y(a)}Jt(w)}return S.id_token&&await(h==null?void 0:h(b)),za(S),S}function fm(e){Dt(e).tlsOnly=!1}async function sb(e,t,n,o,r){if(xo(e),!((r==null?void 0:r.flag)===Qo||t instanceof URL||function(w,C){try{return Object.getPrototypeOf(w)[Symbol.toStringTag]===C}catch{return!1}}(t,"Request")))throw oo('"currentUrl" must be an instance of URL, or Request',Ba);let i,a;const{as:s,c,auth:u,fetch:d,tlsOnly:f,jarm:p,hybrid:h,nonRepudiation:m,timeout:g,decrypt:y,implicit:b}=Dt(e);if((r==null?void 0:r.flag)===Qo)i=r.authResponse,a=r.redirectUri;else{if(!(t instanceof URL)){const w=t;switch(t=new URL(t.url),w.method){case"GET":break;case"POST":const C=new URLSearchParams(await Y5(w));if(h)t.hash=C.toString();else for(const[O,_]of C.entries())t.searchParams.append(O,_);break;default:throw oo("unexpected Request HTTP method",Ha)}}switch(a=function(w){return(w=new URL(w)).search="",w.hash="",w.href}(t),!0){case!!p:i=await p(t,n==null?void 0:n.expectedState);break;case!!h:i=await h(t,n==null?void 0:n.expectedNonce,n==null?void 0:n.expectedState,n==null?void 0:n.maxAge);break;case!!b:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{i=tE(s,c,t.searchParams,n==null?void 0:n.expectedState)}catch(w){Jt(w)}}}const k=await async function(w,C,O,_,N,E,A){if(Ln(w),Dn(C),!Tf.has(_))throw Je('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");bt(N,'"redirectUri"');const j=Sr(_,"code");if(!j)throw Ae('no authorization code in "callbackParameters"',Fe);const B=new URLSearchParams(A==null?void 0:A.additionalParameters);return B.set("redirect_uri",N),B.set("code",j),E!==nm&&(bt(E,'"codeVerifier"'),B.set("code_verifier",E)),Ma(w,C,O,"authorization_code",B,A)}(s,c,u,i,a,(n==null?void 0:n.pkceCodeVerifier)||nm,{additionalParameters:o,[zn]:d,[Cn]:!f,DPoP:r==null?void 0:r.DPoP,headers:new Headers(no),signal:Fr(g)}).catch(Jt);typeof(n==null?void 0:n.expectedNonce)!="string"&&typeof(n==null?void 0:n.maxAge)!="number"||(n.idTokenExpected=!0);const x=U5(s,c,k,{expectedNonce:n==null?void 0:n.expectedNonce,maxAge:n==null?void 0:n.maxAge,requireIdToken:n==null?void 0:n.idTokenExpected,[to]:y});let S;try{S=await x}catch(w){if(Fa(w,r))return sb(e,void 0,n,o,ke(ke({},r),{},{flag:Qo,authResponse:i,redirectUri:a}));Jt(w)}return S.id_token&&await(m==null?void 0:m(k)),za(S),S}async function cb(e,t,n,o){xo(e),n=new URLSearchParams(n);const{as:r,c:i,auth:a,fetch:s,tlsOnly:c,nonRepudiation:u,timeout:d,decrypt:f}=Dt(e),p=await async function(g,y,b,k,x){Ln(g),Dn(y),bt(k,'"refreshToken"');const S=new URLSearchParams(x==null?void 0:x.additionalParameters);return S.set("refresh_token",k),Ma(g,y,b,"refresh_token",S,x)}(r,i,a,t,{[zn]:s,[Cn]:!c,additionalParameters:n,DPoP:o==null?void 0:o.DPoP,headers:new Headers(no),signal:Fr(d)}).catch(Jt),h=async function(g,y,b,k){return _i(g,y,b,void 0,k==null?void 0:k[to],k==null?void 0:k.recognizedTokenTypes)}(r,i,p,{[to]:f});let m;try{m=await h}catch(g){if(Fa(g,o))return cb(e,t,n,ke(ke({},o),{},{flag:Qo}));Jt(g)}return m.id_token&&await(u==null?void 0:u(p)),za(m),m}async function lb(e,t,n){xo(e),t=new URLSearchParams(t);const{as:o,c:r,auth:i,fetch:a,tlsOnly:s,timeout:c}=Dt(e),u=await async function(p,h,m,g,y){return Ln(p),Dn(h),Ma(p,h,m,"client_credentials",new URLSearchParams(g),y)}(o,r,i,t,{[zn]:a,[Cn]:!s,DPoP:n==null?void 0:n.DPoP,headers:new Headers(no),signal:Fr(c)}).catch(Jt),d=async function(p,h,m,g){return _i(p,h,m,void 0,g==null?void 0:g[to],g==null?void 0:g.recognizedTokenTypes)}(o,r,u);let f;try{f=await d}catch(p){if(Fa(p,n))return lb(e,t,ke(ke({},n),{},{flag:Qo}));Jt(p)}return za(f),f}function ld(e,t){xo(e);const{as:n,c:o,tlsOnly:r,hybrid:i,jarm:a,implicit:s}=Dt(e),c=Da(n,"authorization_endpoint",!1,r);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id),!t.has("request_uri")&&!t.has("request")){if(t.has("response_type")||t.set("response_type",i?"code id_token":s?"id_token":"code"),s&&!t.has("nonce"))throw oo("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",Ha);a&&t.set("response_mode","jwt")}for(const[u,d]of t.entries())c.searchParams.append(u,d);return c}async function ub(e,t,n){xo(e);const o=ld(e,t),{as:r,c:i,auth:a,fetch:s,tlsOnly:c,timeout:u}=Dt(e),d=await async function(h,m,g,y,b){var k;Ln(h),Dn(m);const x=Da(h,"pushed_authorization_request_endpoint",m.use_mtls_endpoint_aliases,(b==null?void 0:b[Cn])!==!0),S=new URLSearchParams(y);S.set("client_id",m.client_id);const w=Uc(b==null?void 0:b.headers);w.set("accept","application/json"),(b==null?void 0:b.DPoP)!==void 0&&(Fw(b.DPoP),await b.DPoP.addProof(x,w,"POST"));const C=await Nf(h,m,g,x,S,w,b);return b==null||(k=b.DPoP)===null||k===void 0||k.cacheNonce(C,x),C}(r,i,a,o.searchParams,{[zn]:s,[Cn]:!c,DPoP:n==null?void 0:n.DPoP,headers:new Headers(no),signal:Fr(u)}).catch(Jt),f=async function(h,m,g){if(Ln(h),Dn(m),!Ti(g,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Pf(g,201,"Pushed Authorization Request Endpoint"),$a(g);const y=await Kc(g);bt(y.request_uri,'"response" body "request_uri" property',Fe,{body:y});let b=typeof y.expires_in!="number"?parseFloat(y.expires_in):y.expires_in;return Xo(b,!0,'"response" body "expires_in" property',Fe,{body:y}),y.expires_in=b,y}(r,i,d);let p;try{p=await f}catch(h){if(Fa(h,n))return ub(e,t,ke(ke({},n),{},{flag:Qo}));Jt(h)}return ld(e,{request_uri:p.request_uri})}function xo(e){if(!(e instanceof ac))throw oo('"config" must be an instance of Configuration',Ba);if(Object.getPrototypeOf(e)!==ac.prototype)throw oo("subclassing Configuration is not allowed",Ha)}function Fr(e){return e?AbortSignal.timeout(1e3*e):void 0}function Fa(e,t){return!(t==null||!t.DPoP||t.flag===Qo)&&function(n){if(n instanceof Af){const{0:o,length:r}=n.cause;return r===1&&o.scheme==="dpop"&&o.parameters.error==="use_dpop_nonce"}return n instanceof Vc&&n.error==="use_dpop_nonce"}(e)}Object.freeze(ac.prototype);const Qo=Symbol();async function Df(e,t,n,o){xo(e);const{as:r,c:i,auth:a,fetch:s,tlsOnly:c,timeout:u,decrypt:d}=Dt(e),f=await async function(p,h,m,g,y,b){return Ln(p),Dn(h),bt(g,'"grantType"'),Ma(p,h,m,g,new URLSearchParams(y),b)}(r,i,a,t,new URLSearchParams(n),{[zn]:s,[Cn]:!c,DPoP:o==null?void 0:o.DPoP,headers:new Headers(no),signal:Fr(u)}).then(p=>{let h;return t==="urn:ietf:params:oauth:grant-type:token-exchange"&&(h={n_a:()=>{}}),async function(m,g,y,b){return _i(m,g,y,void 0,b==null?void 0:b[to],b==null?void 0:b.recognizedTokenTypes)}(r,i,p,{[to]:d,recognizedTokenTypes:h})}).catch(Jt);return za(f),f}async function dE(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(o){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return eb("Key must be ",o,...i)}(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:"SHA-".concat(e.slice(-3)),name:"HMAC"},!1,[n])}return nE(t,e,n),t}async function fE(e,t,n,o){const r=await dE(e,t,"verify");(function(a,s){if(a.startsWith("RS")||a.startsWith("PS")){const{modulusLength:c}=s.algorithm;if(typeof c!="number"||c<2048)throw new TypeError("".concat(a," requires key modulusLength to be 2048 bits or larger"))}})(e,r);const i=function(a,s){const c="SHA-".concat(a.slice(-3));switch(a){case"HS256":case"HS384":case"HS512":return{hash:c,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:c,name:"RSA-PSS",saltLength:parseInt(a.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:c,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:c,name:"ECDSA",namedCurve:s.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:a};default:throw new un("alg ".concat(a," is not supported either by JOSE or your javascript runtime"))}}(e,r.algorithm);try{return await crypto.subtle.verify(i,r,n,o)}catch{return!1}}async function pE(e,t,n){if(!rr(e))throw new Tt("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new Tt('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new Tt("JWS Protected Header incorrect type");if(e.payload===void 0)throw new Tt("JWS Payload missing");if(typeof e.signature!="string")throw new Tt("JWS Signature missing or incorrect type");if(e.header!==void 0&&!rr(e.header))throw new Tt("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const g=aa(e.protected);o=JSON.parse(Ca.decode(g))}catch{throw new Tt("JWS Protected Header is invalid")}if(!function(){for(var g=arguments.length,y=new Array(g),b=0;b<g;b++)y[b]=arguments[b];const k=y.filter(Boolean);if(k.length===0||k.length===1)return!0;let x;for(const S of k){const w=Object.keys(S);if(x&&x.size!==0)for(const C of w){if(x.has(C))return!1;x.add(C)}else x=new Set(w)}return!0}(o,e.header))throw new Tt("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r=ke(ke({},o),e.header),i=function(g,y,b,k,x){if(x.crit!==void 0&&(k==null?void 0:k.crit)===void 0)throw new g('"crit" (Critical) Header Parameter MUST be integrity protected');if(!k||k.crit===void 0)return new Set;if(!Array.isArray(k.crit)||k.crit.length===0||k.crit.some(w=>typeof w!="string"||w.length===0))throw new g('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let S;S=b!==void 0?new Map([...Object.entries(b),...y.entries()]):y;for(const w of k.crit){if(!S.has(w))throw new un('Extension Header Parameter "'.concat(w,'" is not recognized'));if(x[w]===void 0)throw new g('Extension Header Parameter "'.concat(w,'" is missing'));if(S.get(w)&&k[w]===void 0)throw new g('Extension Header Parameter "'.concat(w,'" MUST be integrity protected'))}return new Set(k.crit)}(Tt,new Map([["b64",!0]]),n==null?void 0:n.crit,o,r);let a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new Tt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=r;if(typeof s!="string"||!s)throw new Tt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&function(g,y){if(y!==void 0&&(!Array.isArray(y)||y.some(b=>typeof b!="string")))throw new TypeError('"'.concat(g,'" option must be an array of strings'));if(y)return new Set(y)}("algorithms",n.algorithms);if(c&&!c.has(s))throw new Zw('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new Tt("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new Tt("JWS Payload must be a string or an Uint8Array instance");let u=!1;typeof t=="function"&&(t=await t(o,e),u=!0),sE(s,t,"verify");const d=function(){for(var g=arguments.length,y=new Array(g),b=0;b<g;b++)y[b]=arguments[b];const k=y.reduce((w,C)=>{let{length:O}=C;return w+O},0),x=new Uint8Array(k);let S=0;for(const w of y)x.set(w,S),S+=w.length;return x}(e.protected!==void 0?Il(e.protected):new Uint8Array,Il("."),typeof e.payload=="string"?a?Il(e.payload):rm.encode(e.payload):e.payload);let f;try{f=aa(e.signature)}catch{throw new Tt("Failed to base64url decode the signature")}const p=await aE(t,s);if(!await fE(s,p,f,d))throw new Qw;let h;if(a)try{h=aa(e.payload)}catch{throw new Tt("Failed to base64url decode the payload")}else h=typeof e.payload=="string"?rm.encode(e.payload):e.payload;const m={payload:h};return e.protected!==void 0&&(m.protectedHeader=o),e.header!==void 0&&(m.unprotectedHeader=e.header),u?ke(ke({},m),{},{key:p}):m}const hE=e=>Math.floor(e.getTime()/1e3),mE=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function pm(e){const t=mE.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let o;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(3600*n);break;case"day":case"days":case"d":o=Math.round(86400*n);break;case"week":case"weeks":case"w":o=Math.round(604800*n);break;default:o=Math.round(31557600*n)}return t[1]==="-"||t[4]==="ago"?-o:o}const hm=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase()),gE=(e,t)=>typeof e=="string"?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e)));async function yE(e,t,n){var o;const r=await async function(s,c,u){if(s instanceof Uint8Array&&(s=Ca.decode(s)),typeof s!="string")throw new Tt("Compact JWS must be a string or Uint8Array");const{0:d,1:f,2:p,length:h}=s.split(".");if(h!==3)throw new Tt("Invalid Compact JWS");const m=await pE({payload:f,protected:d,signature:p},c,u),g={payload:m.payload,protectedHeader:m.protectedHeader};return typeof c=="function"?ke(ke({},g),{},{key:m.key}):g}(e,t,n);if((o=r.protectedHeader.crit)!==null&&o!==void 0&&o.includes("b64")&&r.protectedHeader.b64===!1)throw new sd("JWTs MUST NOT use unencoded payload");const i=function(s,c){let u,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{u=JSON.parse(Ca.decode(c))}catch{}if(!rr(u))throw new sd("JWT Claims Set must be a top-level JSON object");const{typ:f}=d;if(f&&(typeof s.typ!="string"||hm(s.typ)!==hm(f)))throw new jn('unexpected "typ" JWT header value',u,"typ","check_failed");const{requiredClaims:p=[],issuer:h,subject:m,audience:g,maxTokenAge:y}=d,b=[...p];y!==void 0&&b.push("iat"),g!==void 0&&b.push("aud"),m!==void 0&&b.push("sub"),h!==void 0&&b.push("iss");for(const w of new Set(b.reverse()))if(!(w in u))throw new jn('missing required "'.concat(w,'" claim'),u,w,"missing");if(h&&!(Array.isArray(h)?h:[h]).includes(u.iss))throw new jn('unexpected "iss" claim value',u,"iss","check_failed");if(m&&u.sub!==m)throw new jn('unexpected "sub" claim value',u,"sub","check_failed");if(g&&!gE(u.aud,typeof g=="string"?[g]:g))throw new jn('unexpected "aud" claim value',u,"aud","check_failed");let k;switch(typeof d.clockTolerance){case"string":k=pm(d.clockTolerance);break;case"number":k=d.clockTolerance;break;case"undefined":k=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:x}=d,S=hE(x||new Date);if((u.iat!==void 0||y)&&typeof u.iat!="number")throw new jn('"iat" claim must be a number',u,"iat","invalid");if(u.nbf!==void 0){if(typeof u.nbf!="number")throw new jn('"nbf" claim must be a number',u,"nbf","invalid");if(u.nbf>S+k)throw new jn('"nbf" claim timestamp check failed',u,"nbf","check_failed")}if(u.exp!==void 0){if(typeof u.exp!="number")throw new jn('"exp" claim must be a number',u,"exp","invalid");if(u.exp<=S-k)throw new ad('"exp" claim timestamp check failed',u,"exp","check_failed")}if(y){const w=S-u.iat;if(w-k>(typeof y=="number"?y:pm(y)))throw new ad('"iat" claim timestamp check failed (too far in the past)',u,"iat","check_failed");if(w<0-k)throw new jn('"iat" claim timestamp check failed (it should be in the past)',u,"iat","check_failed")}return u}(r.protectedHeader,r.payload,n),a={payload:i,protectedHeader:r.protectedHeader};return typeof t=="function"?ke(ke({},a),{},{key:r.key}):a}function vE(e){return rr(e)}var us,$l,ds=new WeakMap,Hl=new WeakMap;class wE{constructor(t){if(St(this,ds,void 0),St(this,Hl,new WeakMap),!function(n){return n&&typeof n=="object"&&Array.isArray(n.keys)&&n.keys.every(vE)}(t))throw new Rf("JSON Web Key Set malformed");lt(ds,this,structuredClone(t))}jwks(){return ue(ds,this)}async getKey(t,n){const{alg:o,kid:r}=ke(ke({},t),n==null?void 0:n.header),i=function(u){switch(typeof u=="string"&&u.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new un('Unsupported "alg" value for a JSON Web Key Set')}}(o),a=ue(ds,this).keys.filter(u=>{let d=i===u.kty;if(d&&typeof r=="string"&&(d=r===u.kid),!d||typeof u.alg!="string"&&i!=="AKP"||(d=o===u.alg),d&&typeof u.use=="string"&&(d=u.use==="sig"),d&&Array.isArray(u.key_ops)&&(d=u.key_ops.includes("verify")),d)switch(o){case"ES256":d=u.crv==="P-256";break;case"ES384":d=u.crv==="P-384";break;case"ES512":d=u.crv==="P-521";break;case"Ed25519":case"EdDSA":d=u.crv==="Ed25519"}return d}),{0:s,length:c}=a;if(c===0)throw new Lf;if(c!==1){const u=new Yw,d=ue(Hl,this);throw u[Symbol.asyncIterator]=E5(function*(){for(const f of a)try{yield yield C5(mm(d,f,o))}catch{}}),u}return mm(ue(Hl,this),s,o)}}async function mm(e,t,n){const o=e.get(t)||e.set(t,{}).get(t);if(o[n]===void 0){const r=await async function(i,a,s){var c;if(!rr(i))throw new TypeError("JWK must be an object");let u;switch(a!=null||(a=i.alg),u!=null||(u=(c=s==null?void 0:s.extractable)!==null&&c!==void 0?c:i.ext),i.kty){case"oct":if(typeof i.k!="string"||!i.k)throw new TypeError('missing "k" (Key Value) Parameter value');return aa(i.k);case"RSA":if("oth"in i&&i.oth!==void 0)throw new un('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return js(ke(ke({},i),{},{alg:a,ext:u}));case"AKP":if(typeof i.alg!="string"||!i.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(a!==void 0&&a!==i.alg)throw new TypeError("JWK alg and alg option value mismatch");return js(ke(ke({},i),{},{ext:u}));case"EC":case"OKP":return js(ke(ke({},i),{},{alg:a,ext:u}));default:throw new un('Unsupported "kty" (Key Type) Parameter value')}}(ke(ke({},t),{},{ext:!0}),n);if(r instanceof Uint8Array||r.type!=="public")throw new Rf("JSON Web Key Set members must be public keys");o[n]=r}return o[n]}function gm(e){const t=new wE(e),n=async(o,r)=>t.getKey(o,r);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let ud;if(typeof navigator>"u"||(us=navigator.userAgent)===null||us===void 0||($l=us.startsWith)===null||$l===void 0||!$l.call(us,"Mozilla/5.0 ")){const e="v6.1.3";ud="".concat("jose","/").concat(e)}const db=Symbol(),Bl=Symbol();var zl=new WeakMap,Fl=new WeakMap,Wl=new WeakMap,fs=new WeakMap,pr=new WeakMap,co=new WeakMap,Oo=new WeakMap,Ul=new WeakMap,hr=new WeakMap,mr=new WeakMap;class bE{constructor(t,n){if(St(this,zl,void 0),St(this,Fl,void 0),St(this,Wl,void 0),St(this,fs,void 0),St(this,pr,void 0),St(this,co,void 0),St(this,Oo,void 0),St(this,Ul,void 0),St(this,hr,void 0),St(this,mr,void 0),!(t instanceof URL))throw new TypeError("url must be an instance of URL");var o,r;lt(zl,this,new URL(t.href)),lt(Fl,this,typeof(n==null?void 0:n.timeoutDuration)=="number"?n==null?void 0:n.timeoutDuration:5e3),lt(Wl,this,typeof(n==null?void 0:n.cooldownDuration)=="number"?n==null?void 0:n.cooldownDuration:3e4),lt(fs,this,typeof(n==null?void 0:n.cacheMaxAge)=="number"?n==null?void 0:n.cacheMaxAge:6e5),lt(Oo,this,new Headers(n==null?void 0:n.headers)),ud&&!ue(Oo,this).has("User-Agent")&&ue(Oo,this).set("User-Agent",ud),ue(Oo,this).has("accept")||(ue(Oo,this).set("accept","application/json"),ue(Oo,this).append("accept","application/jwk-set+json")),lt(Ul,this,n==null?void 0:n[db]),(n==null?void 0:n[Bl])!==void 0&&(lt(mr,this,n==null?void 0:n[Bl]),o=n==null?void 0:n[Bl],r=ue(fs,this),typeof o=="object"&&o!==null&&"uat"in o&&typeof o.uat=="number"&&!(Date.now()-o.uat>=r)&&"jwks"in o&&rr(o.jwks)&&Array.isArray(o.jwks.keys)&&Array.prototype.every.call(o.jwks.keys,rr)&&(lt(pr,this,ue(mr,this).uat),lt(hr,this,gm(ue(mr,this).jwks))))}pendingFetch(){return!!ue(co,this)}coolingDown(){return typeof ue(pr,this)=="number"&&Date.now()<ue(pr,this)+ue(Wl,this)}fresh(){return typeof ue(pr,this)=="number"&&Date.now()<ue(pr,this)+ue(fs,this)}jwks(){var t;return(t=ue(hr,this))===null||t===void 0?void 0:t.jwks()}async getKey(t,n){ue(hr,this)&&this.fresh()||await this.reload();try{return await ue(hr,this).call(this,t,n)}catch(o){if(o instanceof Lf&&this.coolingDown()===!1)return await this.reload(),ue(hr,this).call(this,t,n);throw o}}async reload(){ue(co,this)&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel")&<(co,this,void 0),ue(co,this)||lt(co,this,async function(t,n,o){const i=await(arguments.length>3&&arguments[3]!==void 0?arguments[3]:fetch)(t,{method:"GET",signal:o,redirect:"manual",headers:n}).catch(a=>{throw a.name==="TimeoutError"?new Xw:a});if(i.status!==200)throw new $t("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new $t("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(ue(zl,this).href,ue(Oo,this),AbortSignal.timeout(ue(Fl,this)),ue(Ul,this)).then(t=>{lt(hr,this,gm(t)),ue(mr,this)&&(ue(mr,this).uat=Date.now(),ue(mr,this).jwks=t),lt(pr,this,Date.now()),lt(co,this,void 0)}).catch(t=>{throw lt(co,this,void 0),t})),await ue(co,this)}}const xE=["mfaToken"],kE=["mfaToken"];var gr,ps,yr,No,ai,Xe,Ki,gt,ym=class extends Error{constructor(e,t){super(t),he(this,"code",void 0),this.name="NotSupportedError",this.code=e}},ko=class extends Error{constructor(e,t,n){super(t),he(this,"cause",void 0),he(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},SE=class extends ko{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},CE=class extends ko{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},EE=class extends ko{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Vl=class extends ko{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Kn=class extends ko{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Ao=class extends Error{constructor(e){super(e),he(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Kl=class extends ko{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),he(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},jE=class extends ko{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},_E=class extends ko{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},OE=class extends ko{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},AE=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),he(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function dd(e){return Object.entries(e).filter(t=>{let[,n]=t;return n!==void 0}).reduce((t,n)=>ke(ke({},t),{},{[n[0]]:n[1]}),{})}var Gc=class extends Error{constructor(e,t,n){super(t),he(this,"cause",void 0),he(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},fb=class extends Gc{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},pb=class extends Gc{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},PE=class extends Gc{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},hb=class extends Gc{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function NE(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var TE=(gr=new WeakMap,ps=new WeakMap,yr=new WeakMap,class{constructor(e){var t;St(this,gr,void 0),St(this,ps,void 0),St(this,yr,void 0),lt(gr,this,"https://".concat(e.domain)),lt(ps,this,e.clientId),lt(yr,this,(t=e.customFetch)!==null&&t!==void 0?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(ue(gr,this),"/mfa/authenticators"),{mfaToken:n}=e,o=await ue(yr,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const r=await o.json();throw new fb(r.error_description||"Failed to list authenticators",r)}return(await o.json()).map(NE)}async enrollAuthenticator(e){const t="".concat(ue(gr,this),"/mfa/associate"),{mfaToken:n}=e,o=Xh(e,xE),r={authenticator_types:o.authenticatorTypes};"oobChannels"in o&&(r.oob_channels=o.oobChannels),"phoneNumber"in o&&o.phoneNumber&&(r.phone_number=o.phoneNumber),"email"in o&&o.email&&(r.email=o.email);const i=await ue(yr,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new pb(a.error_description||"Failed to enroll authenticator",a)}return function(a){if(a.authenticator_type==="otp")return{authenticatorType:"otp",secret:a.secret,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes,id:a.id};if(a.authenticator_type==="oob")return{authenticatorType:"oob",oobChannel:a.oob_channel,oobCode:a.oob_code,bindingMethod:a.binding_method,id:a.id};throw new Error("Unexpected authenticator type: ".concat(a.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,o="".concat(ue(gr,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),r=await ue(yr,this).call(this,o,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const i=await r.json();throw new PE(i.error_description||"Failed to delete authenticator",i)}}async challengeAuthenticator(e){const t="".concat(ue(gr,this),"/mfa/challenge"),{mfaToken:n}=e,o=Xh(e,kE),r={mfa_token:n,client_id:ue(ps,this),challenge_type:o.challengeType};o.authenticatorId&&(r.authenticator_id=o.authenticatorId);const i=await ue(yr,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new hb(a.error_description||"Failed to challenge authenticator",a)}return function(a){const s={challengeType:a.challenge_type};return a.oob_code!==void 0&&(s.oobCode=a.oob_code),a.binding_method!==void 0&&(s.bindingMethod=a.binding_method),s}(await i.json())}}),Er=class mb{constructor(t,n,o,r,i,a,s){he(this,"accessToken",void 0),he(this,"idToken",void 0),he(this,"refreshToken",void 0),he(this,"expiresAt",void 0),he(this,"scope",void 0),he(this,"claims",void 0),he(this,"authorizationDetails",void 0),he(this,"tokenType",void 0),he(this,"issuedTokenType",void 0),this.accessToken=t,this.idToken=o,this.refreshToken=r,this.expiresAt=n,this.scope=i,this.claims=a,this.authorizationDetails=s}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,o=new mb(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return o.tokenType=t.token_type,o.issuedTokenType=t.issued_token_type,o}},fd="openid profile email offline_access",IE=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function gb(e){if(e==null)throw new Kn("subject_token is required");if(typeof e!="string")throw new Kn("subject_token must be a string");if(e.trim().length===0)throw new Kn("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Kn("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Kn("subject_token must not include the 'Bearer ' prefix")}function yb(e,t){if(t){for(const[n,o]of Object.entries(t))if(!IE.has(n))if(Array.isArray(o)){if(o.length>20)throw new Kn("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));o.forEach(r=>{e.append(n,r)})}else e.append(n,o)}}var RE=(No=new WeakMap,ai=new WeakMap,Xe=new WeakMap,Ki=new WeakMap,gt=new WeakSet,class{constructor(e){if(function(t,n){Dw(t,n),n.add(t)}(this,gt),St(this,No,void 0),St(this,ai,void 0),St(this,Xe,void 0),St(this,Ki,void 0),he(this,"mfa",void 0),lt(Xe,this,e),e.useMtls&&!e.customFetch)throw new ym("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");this.mfa=new TE({domain:ue(Xe,this).domain,clientId:ue(Xe,this).clientId,customFetch:ue(Xe,this).customFetch})}async buildAuthorizationUrl(e){const{serverMetadata:t}=await yt(gt,this,yn).call(this);if(e!=null&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new ym("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await yt(gt,this,Gl).call(this,e)}catch(n){throw new jE(n)}}async buildLinkUserUrl(e){try{const t=await yt(gt,this,Gl).call(this,{authorizationParams:ke(ke({},e.authorizationParams),{},{requested_connection:e.connection,requested_connection_scope:e.connectionScope,scope:"openid link_account offline_access",id_token_hint:e.idToken})});return{linkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(t){throw new _E(t)}}async buildUnlinkUserUrl(e){try{const t=await yt(gt,this,Gl).call(this,{authorizationParams:ke(ke({},e.authorizationParams),{},{requested_connection:e.connection,scope:"openid unlink_account",id_token_hint:e.idToken})});return{unlinkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(t){throw new OE(t)}}async backchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await yt(gt,this,yn).call(this),o=dd(ke(ke({},ue(Xe,this).authorizationParams),e==null?void 0:e.authorizationParams)),r=new URLSearchParams(ke(ke({scope:fd},o),{},{client_id:ue(Xe,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const i=await dm(t,r),a=await ab(t,i);return Er.fromTokenEndpointResponse(a)}catch(i){throw new Kl(i)}}async initiateBackchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await yt(gt,this,yn).call(this),o=dd(ke(ke({},ue(Xe,this).authorizationParams),e==null?void 0:e.authorizationParams)),r=new URLSearchParams(ke(ke({scope:fd},o),{},{client_id:ue(Xe,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const i=await dm(t,r);return{authReqId:i.auth_req_id,expiresIn:i.expires_in,interval:i.interval}}catch(i){throw new Kl(i)}}async backchannelAuthenticationGrant(e){let{authReqId:t}=e;const{configuration:n}=await yt(gt,this,yn).call(this),o=new URLSearchParams({auth_req_id:t});try{const r=await Df(n,"urn:openid:params:grant-type:ciba",o);return Er.fromTokenEndpointResponse(r)}catch(r){throw new Kl(r)}}async getTokenForConnection(e){var t;if(e.refreshToken&&e.accessToken)throw new Vl("Either a refresh or access token should be specified, but not both.");const n=(t=e.accessToken)!==null&&t!==void 0?t:e.refreshToken;if(!n)throw new Vl("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:e.connection,subjectToken:n,subjectTokenType:e.accessToken?"urn:ietf:params:oauth:token-type:access_token":"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint})}catch(o){throw o instanceof Kn?new Vl(o.message,o.cause):o}}async exchangeToken(e){return"connection"in e?yt(gt,this,LE).call(this,e):yt(gt,this,DE).call(this,e)}async getTokenByCode(e,t){const{configuration:n}=await yt(gt,this,yn).call(this);try{const o=await sb(n,e,{pkceCodeVerifier:t.codeVerifier});return Er.fromTokenEndpointResponse(o)}catch(o){throw new SE("There was an error while trying to request a token.",o)}}async getTokenByRefreshToken(e){const{configuration:t}=await yt(gt,this,yn).call(this);try{const n=await cb(t,e.refreshToken);return Er.fromTokenEndpointResponse(n)}catch(n){throw new EE("The access token has expired and there was an error while trying to refresh it.",n)}}async getTokenByClientCredentials(e){const{configuration:t}=await yt(gt,this,yn).call(this);try{const n=new URLSearchParams({audience:e.audience});e.organization&&n.append("organization",e.organization);const o=await lb(t,n);return Er.fromTokenEndpointResponse(o)}catch(n){throw new CE("There was an error while trying to request a token.",n)}}async buildLogoutUrl(e){const{configuration:t,serverMetadata:n}=await yt(gt,this,yn).call(this);if(!n.end_session_endpoint){const o=new URL("https://".concat(ue(Xe,this).domain,"/v2/logout"));return o.searchParams.set("returnTo",e.returnTo),o.searchParams.set("client_id",ue(Xe,this).clientId),o}return function(o,r){xo(o);const{as:i,c:a,tlsOnly:s}=Dt(o),c=Da(i,"end_session_endpoint",!1,s);(r=new URLSearchParams(r)).has("client_id")||r.set("client_id",a.client_id);for(const[u,d]of r.entries())c.searchParams.append(u,d);return c}(t,{post_logout_redirect_uri:e.returnTo})}async verifyLogoutToken(e){const{serverMetadata:t}=await yt(gt,this,yn).call(this);ue(Ki,this)||lt(Ki,this,function(o,r){const i=new bE(o,r),a=async(s,c)=>i.getKey(s,c);return Object.defineProperties(a,{coolingDown:{get:()=>i.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>i.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>i.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>i.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>i.jwks(),enumerable:!0,configurable:!1,writable:!1}}),a}(new URL(t.jwks_uri),{[db]:ue(Xe,this).customFetch}));const{payload:n}=await yE(e.logoutToken,ue(Ki,this),{issuer:t.issuer,audience:ue(Xe,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]});if(!("sid"in n)&&!("sub"in n))throw new Ao('either "sid" or "sub" (or both) claims must be present');if("sid"in n&&typeof n.sid!="string")throw new Ao('"sid" claim must be a string');if("sub"in n&&typeof n.sub!="string")throw new Ao('"sub" claim must be a string');if("nonce"in n)throw new Ao('"nonce" claim is prohibited');if(!("events"in n))throw new Ao('"events" claim is missing');if(typeof n.events!="object"||n.events===null)throw new Ao('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in n.events))throw new Ao('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if(typeof n.events["http://schemas.openid.net/event/backchannel-logout"]!="object")throw new Ao('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:n.sid,sub:n.sub}}});async function yn(){if(ue(No,this)&&ue(ai,this))return{configuration:ue(No,this),serverMetadata:ue(ai,this)};const e=await yt(gt,this,ME).call(this);return lt(No,this,await uE(new URL("https://".concat(ue(Xe,this).domain)),ue(Xe,this).clientId,{use_mtls_endpoint_aliases:ue(Xe,this).useMtls},e,{[Vo]:ue(Xe,this).customFetch})),lt(ai,this,ue(No,this).serverMetadata()),ue(No,this)[Vo]=ue(Xe,this).customFetch||fetch,{configuration:ue(No,this),serverMetadata:ue(ai,this)}}async function LE(e){var t,n;const{configuration:o}=await yt(gt,this,yn).call(this);if("audience"in e||"resource"in e)throw new Kn("audience and resource parameters are not supported for Token Vault exchanges");gb(e.subjectToken);const r=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:(t=e.subjectTokenType)!==null&&t!==void 0?t:"urn:ietf:params:oauth:token-type:access_token",requested_token_type:(n=e.requestedTokenType)!==null&&n!==void 0?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&r.append("login_hint",e.loginHint),e.scope&&r.append("scope",e.scope),yb(r,e.extra);try{const i=await Df(o,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",r);return Er.fromTokenEndpointResponse(i)}catch(i){throw new Kn("Failed to exchange token for connection '".concat(e.connection,"'."),i)}}async function DE(e){const{configuration:t}=await yt(gt,this,yn).call(this);gb(e.subjectToken);const n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),yb(n,e.extra);try{const o=await Df(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return Er.fromTokenEndpointResponse(o)}catch(o){throw new Kn("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),o)}}async function ME(){if(!ue(Xe,this).clientSecret&&!ue(Xe,this).clientAssertionSigningKey&&!ue(Xe,this).useMtls)throw new AE;if(ue(Xe,this).useMtls)return(t,n,o,r)=>{o.set("client_id",n.client_id)};let e=ue(Xe,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await async function(t,n,o){if(typeof t!="string"||t.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return iE(t,n,o)}(e,ue(Xe,this).clientAssertionSigningAlg||"RS256")),e?function(t,n){return T5(t,n)}(e):ob(ue(Xe,this).clientSecret)}async function Gl(e){const{configuration:t}=await yt(gt,this,yn).call(this),n=lE(),o=await cE(n),r=dd(ke(ke({},ue(Xe,this).authorizationParams),e==null?void 0:e.authorizationParams)),i=new URLSearchParams(ke(ke({scope:fd},r),{},{client_id:ue(Xe,this).clientId,code_challenge:o,code_challenge_method:"S256"}));return{authorizationUrl:e!=null&&e.pushedAuthorizationRequests?await ub(t,i):await ld(t,i),codeVerifier:n}}class ir extends ut{constructor(t,n){super(t,n),Object.setPrototypeOf(this,ir.prototype)}static fromPayload(t){let{error:n,error_description:o}=t;return new ir(n,o)}}class sc extends ir{constructor(t,n){super(t,n),Object.setPrototypeOf(this,sc.prototype)}}class Mf extends ir{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Mf.prototype)}}class $f extends ir{constructor(t,n){super(t,n),Object.setPrototypeOf(this,$f.prototype)}}class si extends ir{constructor(t,n){super(t,n),Object.setPrototypeOf(this,si.prototype)}}class Hf extends ir{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Hf.prototype)}}class $E{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=t}set(t,n){this.cleanup(),this.contexts.set(t,Object.assign(Object.assign({},n),{createdAt:Date.now()}))}get(t){const n=this.contexts.get(t);if(n){if(!(Date.now()-n.createdAt>this.ttlMs))return n;this.contexts.delete(t)}}remove(t){this.contexts.delete(t)}cleanup(){const t=Date.now();for(const[n,o]of this.contexts)t-o.createdAt>this.ttlMs&&this.contexts.delete(n)}get size(){return this.contexts.size}}class HE{constructor(t,n){this.authJsMfaClient=t,this.auth0Client=n,this.contextManager=new $E}setMFAAuthDetails(t,n,o,r){this.contextManager.set(t,{scope:n,audience:o,mfaRequirements:r})}async getAuthenticators(t){var n,o;const r=this.contextManager.get(t);if(!(!((n=r==null?void 0:r.mfaRequirements)===null||n===void 0)&&n.challenge)||r.mfaRequirements.challenge.length===0)throw new sc("invalid_request","challengeType is required and must contain at least one challenge type, please check mfa_required error payload");const i=r.mfaRequirements.challenge.map(a=>a.type);try{return(await this.authJsMfaClient.listAuthenticators({mfaToken:t})).filter(a=>!!a.type&&i.includes(a.type))}catch(a){throw a instanceof fb?new sc((o=a.cause)===null||o===void 0?void 0:o.error,a.message):a}}async enroll(t){var n;const o=function(r){const i=b5[r.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:r.mfaToken,authenticatorTypes:i.authenticatorTypes},i.oobChannels&&{oobChannels:i.oobChannels}),"phoneNumber"in r&&{phoneNumber:r.phoneNumber}),"email"in r&&{email:r.email})}(t);try{return await this.authJsMfaClient.enrollAuthenticator(o)}catch(r){throw r instanceof pb?new Mf((n=r.cause)===null||n===void 0?void 0:n.error,r.message):r}}async challenge(t){var n;try{const o={challengeType:t.challengeType,mfaToken:t.mfaToken};return t.authenticatorId&&(o.authenticatorId=t.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(o)}catch(o){throw o instanceof hb?new $f((n=o.cause)===null||n===void 0?void 0:n.error,o.message):o}}async getEnrollmentFactors(t){const n=this.contextManager.get(t);if(!n||!n.mfaRequirements)throw new Hf("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return n.mfaRequirements.enroll&&n.mfaRequirements.enroll.length!==0?n.mfaRequirements.enroll:[]}async verify(t){const n=this.contextManager.get(t.mfaToken);if(!n)throw new si("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const o=function(a){return"otp"in a&&a.otp?x5:"oobCode"in a&&a.oobCode?k5:"recoveryCode"in a&&a.recoveryCode?S5:void 0}(t);if(!o)throw new si("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const r=n.scope,i=n.audience;try{const a=await this.auth0Client._requestTokenForMfa({grant_type:o,mfaToken:t.mfaToken,scope:r,audience:i,otp:t.otp,oob_code:t.oobCode,binding_code:t.bindingCode,recovery_code:t.recoveryCode});return this.contextManager.remove(t.mfaToken),a}catch(a){if(a instanceof La)this.setMFAAuthDetails(a.mfa_token,r,i,a.mfa_requirements);else if(a instanceof si)throw new si(a.error,a.error_description);throw a}}}const Gi=new MC;class BE{constructor(t){let n,o;if(this.userCache=new Nw().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const d of u)await Gi.releaseLock(d);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!Qs())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Qs().subtle===void 0)throw new Error(`
|
|
54
|
+
in the address bar and allow pop-ups for this site.`},Image:_C,actionBtnText:"Test pop-up settings"},LC={name:pt.PWA_INSTALL,label:"Install as a PWA",heading:"Install as a PWA (optional)",description:"By installing the platform as a Progressive Web App you will get a similar experience as with native desktop apps.",instructions:{initial:"If your browser supports Progressive Web Apps, you can now install the platform as a PWA."},Image:OC,actionBtnText:"Continue to the platform"},Es=[TC,IC,RC,LC],is={isCompleted:!1,state:"prompt"},DC={[pt.WINDOW_MANAGEMENT]:is,[pt.NOTIFICATIONS]:is,[pt.POPUPS]:is,[pt.PWA_INSTALL]:is};const MC=({isOpen:e,onClose:t})=>{var s;const{launchpadComponents:n,launchpadSettings:o}=ww(),{permission:r}=sr(),i=(s=r.statuses[pt.WINDOW_MANAGEMENT])==null?void 0:s.state,{Panel:a}=Ot;return l.jsx(a,{components:n,isOpen:e,onClose:t,settings:o,windowManagementPermissionState:i})};const Cw=v.forwardRef((e,t)=>{const{className:n,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:s="left"}=e;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),l.jsx("div",{className:ro(n,"panel-wrapper",s,{open:o,pinned:a}),ref:t,children:i&&l.jsx(i,{isOpen:o,onClose:r})})}),Cf=e=>{const{Button:t,Panel:n,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:s}=e,[c,u]=v.useState(!1),d=v.useRef(null),f=v.useCallback(async()=>{u(!1),await(s==null?void 0:s())},[s]),p=()=>{if(c){f();return}u(!0)},h=!c||r;return kw({eventType:"mouseup",handler:f,ref:d,skip:h}),xw({handler:f,skip:h}),l.jsxs(a,{ref:d,children:[l.jsx(t,{active:c,onClick:p}),l.jsx(Cw,{className:o,isOpen:c,onClose:f,Panel:n,pinned:r,position:i})]})};const Ew=({Button:e=XS})=>{const{isLaunchpadPinned:t}=SC();return l.jsx(Cf,{Button:e,Panel:MC,panelWrapperClassName:"launchpad-panel-wrapper",pinned:t})};var Qu=function(e,t){return Qu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},Qu(e,t)};function $C(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Qu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rt=function(){return Rt=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Rt.apply(this,arguments)};function Wh(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Eo(e,t,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(d){try{u(o.next(d))}catch(f){a(f)}}function c(d){try{u(o.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):r(d.value).then(s,c)}u((o=o.apply(e,t||[])).next())})}function jo(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(d){return c([u,d])}}function c(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(o=1,r&&(i=u[0]&2?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function HC(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}function An(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}var Mr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jw={},Ef={};Object.defineProperty(Ef,"__esModule",{value:!0});var BC=function(){function e(){var t=this;this.locked=new Map,this.addToLocked=function(n,o){var r=t.locked.get(n);r===void 0?o===void 0?t.locked.set(n,[]):t.locked.set(n,[o]):o!==void 0&&(r.unshift(o),t.locked.set(n,r))},this.isLocked=function(n){return t.locked.has(n)},this.lock=function(n){return new Promise(function(o,r){t.isLocked(n)?t.addToLocked(n,o):(t.addToLocked(n),o())})},this.unlock=function(n){var o=t.locked.get(n);if(o!==void 0&&o.length!==0){var r=o.pop();t.locked.set(n,o),r!==void 0&&setTimeout(r,0)}else t.locked.delete(n)}}return e.getInstance=function(){return e.instance===void 0&&(e.instance=new e),e.instance},e}();Ef.default=function(){return BC.getInstance()};var Nn=Mr&&Mr.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(u){try{c(o.next(u))}catch(d){i(d)}}function s(u){try{c(o.throw(u))}catch(d){i(d)}}function c(u){u.done?r(u.value):new n(function(d){d(u.value)}).then(a,s)}c((o=o.apply(e,t||[])).next())})},Tn=Mr&&Mr.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&d[0]?o.return:d[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,d[1])).done)return r;switch(o=0,r&&(d=[2&d[0],r.value]),d[0]){case 0:case 1:r=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,o=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!r||d[1]>r[0]&&d[1]<r[3])){a.label=d[1];break}if(d[0]===6&&a.label<r[1]){a.label=r[1],r=d;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(d);break}r[2]&&a.ops.pop(),a.trys.pop();continue}d=t.call(e,a)}catch(f){d=[6,f],o=0}finally{n=r=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},Fi=Mr;Object.defineProperty(jw,"__esModule",{value:!0});var Kr=Ef,as={key:function(e){return Nn(Fi,void 0,void 0,function(){return Tn(this,function(t){throw new Error("Unsupported")})})},getItem:function(e){return Nn(Fi,void 0,void 0,function(){return Tn(this,function(t){throw new Error("Unsupported")})})},clear:function(){return Nn(Fi,void 0,void 0,function(){return Tn(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return Nn(Fi,void 0,void 0,function(){return Tn(this,function(t){throw new Error("Unsupported")})})},setItem:function(e,t){return Nn(Fi,void 0,void 0,function(){return Tn(this,function(n){throw new Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function Ol(e){return new Promise(function(t){return setTimeout(t,e)})}function Al(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}var zC=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+Al(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,e.waiters===void 0&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return n===void 0&&(n=5e3),Nn(this,void 0,void 0,function(){var o,r,i,a,s,c,u;return Tn(this,function(d){switch(d.label){case 0:o=Date.now()+Al(4),r=Date.now()+n,i="browser-tabs-lock-key-"+t,a=this.storageHandler===void 0?as:this.storageHandler,d.label=1;case 1:return Date.now()<r?[4,Ol(30)]:[3,8];case 2:return d.sent(),a.getItemSync(i)!==null?[3,5]:(s=this.id+"-"+t+"-"+o,[4,Ol(Math.floor(25*Math.random()))]);case 3:return d.sent(),a.setItemSync(i,JSON.stringify({id:this.id,iat:o,timeoutKey:s,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,Ol(30)];case 4:return d.sent(),(c=a.getItemSync(i))!==null&&(u=JSON.parse(c)).id===this.id&&u.iat===o?(this.acquiredIatSet.add(o),this.refreshLockWhileAcquired(i,o),[2,!0]):[3,7];case 5:return e.lockCorrector(this.storageHandler===void 0?as:this.storageHandler),[4,this.waitForSomethingToChange(r)];case 6:d.sent(),d.label=7;case 7:return o=Date.now()+Al(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(t,n){return Nn(this,void 0,void 0,function(){var o=this;return Tn(this,function(r){return setTimeout(function(){return Nn(o,void 0,void 0,function(){var i,a,s;return Tn(this,function(c){switch(c.label){case 0:return[4,Kr.default().lock(n)];case 1:return c.sent(),this.acquiredIatSet.has(n)?(i=this.storageHandler===void 0?as:this.storageHandler,(a=i.getItemSync(t))===null?(Kr.default().unlock(n),[2]):((s=JSON.parse(a)).timeRefreshed=Date.now(),i.setItemSync(t,JSON.stringify(s)),Kr.default().unlock(n),this.refreshLockWhileAcquired(t,n),[2])):(Kr.default().unlock(n),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return Nn(this,void 0,void 0,function(){return Tn(this,function(n){switch(n.label){case 0:return[4,new Promise(function(o){var r=!1,i=Date.now(),a=!1;function s(){if(a||(window.removeEventListener("storage",s),e.removeFromWaiting(s),clearTimeout(c),a=!0),!r){r=!0;var u=50-(Date.now()-i);u>0?setTimeout(o,u):o(null)}}window.addEventListener("storage",s),e.addToWaiting(s);var c=setTimeout(s,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),e.waiters!==void 0&&e.waiters.push(t)},e.removeFromWaiting=function(t){e.waiters!==void 0&&(e.waiters=e.waiters.filter(function(n){return n!==t}))},e.notifyWaiters=function(){e.waiters!==void 0&&e.waiters.slice().forEach(function(t){return t()})},e.prototype.releaseLock=function(t){return Nn(this,void 0,void 0,function(){return Tn(this,function(n){switch(n.label){case 0:return[4,this.releaseLock__private__(t)];case 1:return[2,n.sent()]}})})},e.prototype.releaseLock__private__=function(t){return Nn(this,void 0,void 0,function(){var n,o,r,i;return Tn(this,function(a){switch(a.label){case 0:return n=this.storageHandler===void 0?as:this.storageHandler,o="browser-tabs-lock-key-"+t,(r=n.getItemSync(o))===null?[2]:(i=JSON.parse(r)).id!==this.id?[3,2]:[4,Kr.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(o),Kr.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,o=t,r=[],i=0;;){var a=o.keySync(i);if(a===null)break;r.push(a),i++}for(var s=!1,c=0;c<r.length;c++){var u=r[c];if(u.includes("browser-tabs-lock-key")){var d=o.getItemSync(u);if(d!==null){var f=JSON.parse(d);(f.timeRefreshed===void 0&&f.timeAcquired<n||f.timeRefreshed!==void 0&&f.timeRefreshed<n)&&(o.removeItemSync(u),s=!0)}}}s&&e.notifyWaiters()},e.waiters=void 0,e}(),FC=jw.default=zC;const WC={timeoutInSeconds:60},_w={name:"auth0-spa-js",version:"2.14.0"},Ow=()=>Date.now();class ut extends Error{constructor(t,n){super(n),this.error=t,this.error_description=n,Object.setPrototypeOf(this,ut.prototype)}static fromPayload(t){let{error:n,error_description:o}=t;return new ut(n,o)}}class jf extends ut{constructor(t,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;super(t,n),this.state=o,this.appState=r,Object.setPrototypeOf(this,jf.prototype)}}class _f extends ut{constructor(t,n,o,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;super(t,n),this.connection=o,this.state=r,this.appState=i,Object.setPrototypeOf(this,_f.prototype)}}class di extends ut{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,di.prototype)}}class Of extends di{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Of.prototype)}}class Af extends ut{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Af.prototype)}}class Pf extends ut{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,Pf.prototype)}}class Da extends ut{constructor(t,n,o,r){super(t,n),this.mfa_token=o,this.mfa_requirements=r,Object.setPrototypeOf(this,Da.prototype)}}class Vc extends ut{constructor(t,n){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(Qs(t,["default"]),"', scope: '").concat(Qs(n),"')")),this.audience=t,this.scope=n,Object.setPrototypeOf(this,Vc.prototype)}}class Nf extends ut{constructor(t,n){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(Qs(t,["default"]),"', missing scope: '").concat(Qs(n),"')")),this.audience=t,this.scope=n,Object.setPrototypeOf(this,Nf.prototype)}}class Kc extends ut{constructor(t){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=t,Object.setPrototypeOf(this,Kc.prototype)}}function Qs(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e&&!t.includes(e)?e:""}const ec=()=>window.crypto,Wi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(ec().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%e.length]),t},Pl=e=>btoa(e),UC=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Aw=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Object.keys(e).reduce((n,o)=>{if(t&&o==="env")return n;const r=UC.find(i=>i.key===o);return r&&r.type.includes(typeof e[o])&&(n[o]=e[o]),n},{})},ed=e=>{var{clientId:t}=e,n=An(e,["clientId"]);return new URLSearchParams((o=>Object.keys(o).filter(r=>o[r]!==void 0).reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:o[i]}),{}))(Object.assign({client_id:t},n))).toString()},Uh=async e=>await ec().subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),Vh=e=>(t=>decodeURIComponent(atob(t).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),Kh=e=>{const t=new Uint8Array(e);return(n=>{const o={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,r=>o[r])})(window.btoa(String.fromCharCode(...Array.from(t))))},VC=new TextEncoder,KC=new TextDecoder;function ra(e){return typeof e=="string"?VC.encode(e):KC.decode(e)}function Gh(e){if(typeof e.modulusLength!="number"||e.modulusLength<2048)throw new qC(`${e.name} modulusLength must be at least 2048 bits`)}async function GC(e,t,n){if(n.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const o=`${ia(ra(JSON.stringify(e)))}.${ia(ra(JSON.stringify(t)))}`;return`${o}.${ia(await crypto.subtle.sign(function(r){switch(r.algorithm.name){case"ECDSA":return{name:r.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return Gh(r.algorithm),{name:r.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return Gh(r.algorithm),{name:r.algorithm.name};case"Ed25519":return{name:r.algorithm.name}}throw new jr}(n),n,ra(o)))}`}let td;Uint8Array.prototype.toBase64?td=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):td=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o<t.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function ia(e){return td(e)}class jr extends Error{constructor(t){var n;super(t??"operation not supported"),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class qC extends Error{constructor(t){var n;super(t),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}function JC(e){switch(e.algorithm.name){case"RSA-PSS":return function(t){if(t.algorithm.hash.name==="SHA-256")return"PS256";throw new jr("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(t){if(t.algorithm.hash.name==="SHA-256")return"RS256";throw new jr("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(t){if(t.algorithm.namedCurve==="P-256")return"ES256";throw new jr("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new jr("unsupported CryptoKey algorithm name")}}function Pw(e){return e instanceof CryptoKey}function Nw(e){return Pw(e)&&e.type==="public"}async function ZC(e,t,n,o,r,i){const a=e==null?void 0:e.privateKey,s=e==null?void 0:e.publicKey;if(!Pw(c=a)||c.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!Nw(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof t!="string")throw new TypeError('"htu" must be a string');if(typeof n!="string")throw new TypeError('"htm" must be a string');if(o!==void 0&&typeof o!="string")throw new TypeError('"nonce" must be a string or undefined');if(r!==void 0&&typeof r!="string")throw new TypeError('"accessToken" must be a string or undefined');if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new TypeError('"additional" must be an object');return GC({alg:JC(a),typ:"dpop+jwt",jwk:await Tw(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:o,htu:t,ath:r?ia(await crypto.subtle.digest("SHA-256",ra(r))):void 0}),a)}async function Tw(e){const{kty:t,e:n,n:o,x:r,y:i,crv:a}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:a,e:n,n:o,x:r,y:i}}const YC=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"];function XC(){return async function(e,t){var n;let o;if(typeof e!="string"||e.length===0)throw new TypeError('"alg" must be a non-empty string');switch(e){case"PS256":o={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":o={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":o={name:"Ed25519"};break;default:throw new jr}return crypto.subtle.generateKey(o,(n=t==null?void 0:t.extractable)!==null&&n!==void 0&&n,["sign","verify"])}("ES256",{extractable:!1})}function QC(e){return async function(t){if(!Nw(t))throw new TypeError('"publicKey" must be a public CryptoKey');if(t.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const n=await Tw(t);let o;switch(n.kty){case"EC":o={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case"OKP":o={crv:n.crv,kty:n.kty,x:n.x};break;case"RSA":o={e:n.e,kty:n.kty,n:n.n};break;default:throw new jr("unsupported JWK kty")}return ia(await crypto.subtle.digest({name:"SHA-256"},ra(JSON.stringify(o))))}(e.publicKey)}function e5(e){let{keyPair:t,url:n,method:o,nonce:r,accessToken:i}=e;const a=function(s){const c=new URL(s);return c.search="",c.hash="",c.href}(n);return ZC(t,a,o,r,i)}const t5=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(o=n.headers,[...o].reduce((r,i)=>{let[a,s]=i;return r[a]=s,r},{}))};var o},n5=async(e,t,n)=>{const o=new AbortController;let r;return t.signal=o.signal,Promise.race([t5(e,t),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},o5=async(e,t,n,o,r,i,a,s)=>((c,u)=>new Promise(function(d,f){const p=new MessageChannel;p.port1.onmessage=function(h){h.data.error?f(new Error(h.data.error)):d(h.data),p.port1.close()},u.postMessage(c,[p.port2])}))({auth:{audience:t,scope:n},timeout:r,fetchUrl:e,fetchOptions:o,useFormData:a,useMrrt:s},i),r5=async function(e,t,n,o,r,i){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1e4,s=arguments.length>7?arguments[7]:void 0;return r?o5(e,t,n,o,a,r,i,s):n5(e,o,a)};async function Iw(e,t,n,o,r,i,a,s,c,u){if(c){const x=await c.generateProof({url:e,method:r.method||"GET",nonce:await c.getNonce()});r.headers=Object.assign(Object.assign({},r.headers),{dpop:x})}let d,f=null;for(let x=0;x<3;x++)try{d=await r5(e,n,o,r,i,a,t,s),f=null;break}catch(S){f=S}if(f)throw f;const p=d.json,{error:h,error_description:m}=p,g=An(p,["error","error_description"]),{headers:y,ok:b}=d;let k;if(c&&(k=y["dpop-nonce"],k&&await c.setNonce(k)),!b){const x=m||"HTTP error. Unable to fetch ".concat(e);if(h==="mfa_required")throw new Da(h,x,g.mfa_token,g.mfa_requirements);if(h==="missing_refresh_token")throw new Vc(n,o);if(h==="use_dpop_nonce"){if(!c||!k||u)throw new Kc(k);return Iw(e,t,n,o,r,i,a,s,c,!0)}throw new ut(h||"request_error",x)}return g}async function i5(e,t){var{baseUrl:n,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:s,useMrrt:c,dpop:u}=e,d=An(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=d.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",p=d.grant_type==="refresh_token"&&c,h=Object.assign(Object.assign(Object.assign(Object.assign({},d),f&&r&&{audience:r}),f&&i&&{scope:i}),p&&{audience:r,scope:i}),m=s?ed(h):JSON.stringify(h),g=(y=d.grant_type,YC.includes(y));var y;return await Iw("".concat(n,"/oauth/token"),o,r||"default",i,{method:"POST",body:m,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Aw(a||_w)))}},t,s,c,g?u:void 0)}const a5=e=>Array.from(new Set(e)),js=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a5(t.filter(Boolean).join(" ").trim().split(/\s+/)).join(" ")},ss=(e,t,n)=>{let o;return n&&(o=e[n]),o||(o=e.default),js(o,t)};class vn{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"@@auth0spajs@@",o=arguments.length>2?arguments[2]:void 0;this.prefix=n,this.suffix=o,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[n,o,r,i]=t.split("::");return new vn({clientId:o,scope:i,audience:r},n)}static fromCacheEntry(t){const{scope:n,audience:o,client_id:r}=t;return new vn({scope:n,audience:o,clientId:r})}}class s5{set(t,n){localStorage.setItem(t,JSON.stringify(n))}get(t){const n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}}class Rw{constructor(){this.enclosedCache=function(){let t={};return{set(n,o){t[n]=o},get(n){const o=t[n];if(o)return o},remove(n){delete t[n]},allKeys:()=>Object.keys(t)}}()}}class c5{constructor(t,n,o){this.cache=t,this.keyManifest=n,this.nowProvider=o||Ow}async setIdToken(t,n,o){var r;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:n,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(t){const n=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!n&&t.scope&&t.audience){const o=await this.get(t);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3?arguments[3]:void 0;var i;let a=await this.cache.get(t.toKey());if(!a){const u=await this.getCacheKeys();if(!u)return;const d=this.matchExistingCacheKey(t,u);if(d&&(a=await this.cache.get(d)),!a&&o&&r!=="cache-only")return this.getEntryWithRefreshToken(t,u)}if(!a)return;const s=await this.nowProvider(),c=Math.floor(s/1e3);return a.expiresAt-n<c?a.body.refresh_token?this.modifiedCachedEntry(a,t):(await this.cache.remove(t.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(t.toKey()))):a.body}async modifiedCachedEntry(t,n){return t.body={refresh_token:t.body.refresh_token,audience:t.body.audience,scope:t.body.scope},await this.cache.set(n.toKey(),t),{refresh_token:t.body.refresh_token,audience:t.body.audience,scope:t.body.scope}}async set(t){var n;const o=new vn({clientId:t.client_id,scope:t.scope,audience:t.audience}),r=await this.wrapCacheEntry(t);await this.cache.set(o.toKey(),r),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(o.toKey()))}async remove(t,n,o){const r=new vn({clientId:t,scope:o,audience:n});await this.cache.remove(r.toKey())}async clear(t){var n;const o=await this.getCacheKeys();o&&(await o.filter(r=>!t||r.includes(t)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(t){const n=await this.nowProvider();return{body:t,expiresAt:Math.floor(n/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new vn({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,n){return n.filter(o=>{var r;const i=vn.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),s=((r=t.scope)===null||r===void 0?void 0:r.split(" "))||[],c=i.scope&&s.reduce((u,d)=>u&&a.has(d),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&c})[0]}async getEntryWithRefreshToken(t,n){var o;for(const r of n){const i=vn.fromKey(r);if(i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId){const a=await this.cache.get(r);if(!((o=a==null?void 0:a.body)===null||o===void 0)&&o.refresh_token)return this.modifiedCachedEntry(a,t)}}}async updateEntry(t,n){var o;const r=await this.getCacheKeys();if(r)for(const i of r){const a=await this.cache.get(i);if(((o=a==null?void 0:a.body)===null||o===void 0?void 0:o.refresh_token)===t){const s=Object.assign(Object.assign({},a.body),{refresh_token:n});await this.set(s)}}}}class l5{constructor(t,n,o){this.storage=t,this.clientId=n,this.cookieDomain=o,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Ui=e=>typeof e=="number",u5=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],d5=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const a=i.split("."),[s,c,u]=a;if(a.length!==3||!s||!c||!u)throw new Error("ID token could not be decoded");const d=JSON.parse(Vh(c)),f={__raw:i},p={};return Object.keys(d).forEach(h=>{f[h]=d[h],u5.includes(h)||(p[h]=d[h])}),{encoded:{header:s,payload:c,signature:u},header:JSON.parse(Vh(s)),claims:f,user:p}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Ui(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!Ui(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ui(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,o=new Date(e.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(t.claims.exp+n),o>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(o,") is after expiration time (").concat(r,")"));if(t.claims.nbf!=null&&Ui(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-n),o<i)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(o,") is before ").concat(i))}if(t.claims.auth_time!=null&&Ui(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),o>i)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (".concat(o,") is after last auth at ").concat(i))}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const a=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(t.claims.org_id,'"'))}else{const a=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==t.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(t.claims.org_name,'"'))}}return t};var ka=Mr&&Mr.__assign||function(){return ka=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ka.apply(this,arguments)};function Vi(e,t){if(!t)return"";var n="; "+e;return t===!0?n:n+"="+t}function f5(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(o){if(typeof o.expires=="number"){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*o.expires),o.expires=r}return Vi("Expires",o.expires?o.expires.toUTCString():"")+Vi("Domain",o.domain)+Vi("Path",o.path)+Vi("Secure",o.secure)+Vi("SameSite",o.sameSite)}(n)}function p5(){return function(e){for(var t={},n=e?e.split("; "):[],o=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var i=n[r].split("="),a=i.slice(1).join("=");a.charAt(0)==='"'&&(a=a.slice(1,-1));try{t[i[0].replace(o,decodeURIComponent)]=a.replace(o,decodeURIComponent)}catch{}}return t}(document.cookie)}var h5=function(e){return p5()[e]};function Lw(e,t,n){document.cookie=f5(e,t,ka({path:"/"},n))}var Dw=Lw,Mw=function(e,t){Lw(e,"",ka(ka({},t),{expires:-1}))};const Yr={get(e){const t=h5(e);if(t!==void 0)return JSON.parse(t)},save(e,t,n){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),n!=null&&n.daysUntilExpire&&(o.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(o.domain=n.cookieDomain),Dw(e,JSON.stringify(t),o)},remove(e,t){let n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Mw(e,n)}},m5={get(e){return Yr.get(e)||Yr.get("".concat("_legacy_").concat(e))},save(e,t,n){let o={};window.location.protocol==="https:"&&(o={secure:!0}),n!=null&&n.daysUntilExpire&&(o.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(o.domain=n.cookieDomain),Dw("".concat("_legacy_").concat(e),JSON.stringify(t),o),Yr.save(e,t,n)},remove(e,t){let n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Mw(e,n),Yr.remove(e,t),Yr.remove("".concat("_legacy_").concat(e),t)}},g5={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var Do;(function(e){e.Code="code",e.ConnectCode="connect_code"})(Do||(Do={}));function y5(e,t,n){var o=t===void 0?null:t,r=function(c,u){var d=atob(c);if(u){for(var f=new Uint8Array(d.length),p=0,h=d.length;p<h;++p)f[p]=d.charCodeAt(p);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return d}(e,n!==void 0&&n),i=r.indexOf(`
|
|
55
|
+
`,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var qh,Jh,Zh,Nl,v5=(qh="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHQpe2xldHtlcnJvcjpyLGVycm9yX2Rlc2NyaXB0aW9uOnN9PXQ7cmV0dXJuIG5ldyBlKHIscyl9fWNsYXNzIHQgZXh0ZW5kcyBle2NvbnN0cnVjdG9yKGUscyl7c3VwZXIoIm1pc3NpbmdfcmVmcmVzaF90b2tlbiIsIk1pc3NpbmcgUmVmcmVzaCBUb2tlbiAoYXVkaWVuY2U6ICciLmNvbmNhdChyKGUsWyJkZWZhdWx0Il0pLCInLCBzY29wZTogJyIpLmNvbmNhdChyKHMpLCInKSIpKSx0aGlzLmF1ZGllbmNlPWUsdGhpcy5zY29wZT1zLE9iamVjdC5zZXRQcm90b3R5cGVPZih0aGlzLHQucHJvdG90eXBlKX19ZnVuY3Rpb24gcihlKXtsZXQgdD1hcmd1bWVudHMubGVuZ3RoPjEmJnZvaWQgMCE9PWFyZ3VtZW50c1sxXT9hcmd1bWVudHNbMV06W107cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+IiIuY29uY2F0KGUsInwiKS5jb25jYXQodCk7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jIGU9PntsZXQgcixjLHtkYXRhOnt0aW1lb3V0OmksYXV0aDphLGZldGNoVXJsOmYsZmV0Y2hPcHRpb25zOmwsdXNlRm9ybURhdGE6cCx1c2VNcnJ0Omh9LHBvcnRzOlt1XX09ZSxkPXt9O2NvbnN0e2F1ZGllbmNlOmcsc2NvcGU6eX09YXx8e307dHJ5e2NvbnN0IGU9cD8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShsLmJvZHkpOkpTT04ucGFyc2UobC5ib2R5KTtpZighZS5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1lLmdyYW50X3R5cGUpe2lmKGM9KChlLHQpPT5vW24oZSx0KV0pKGcseSksIWMmJmgpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKCIiLmNvbmNhdChlLCJ8IikpKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxnKTtlJiYhdCYmKGM9ZSl9aWYoIWMpdGhyb3cgbmV3IHQoZyx5KTtsLmJvZHk9cD9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpjfSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpjfSkpfWxldCBhLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGE9bmV3IEFib3J0Q29udHJvbGxlcixsLnNpZ25hbD1hLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoaj1pLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsaikpKSksZmV0Y2goZixPYmplY3QuYXNzaWduKHt9LGwpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHUucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBhJiZhLmFib3J0KCksdm9pZCB1LnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO189ay5oZWFkZXJzLGQ9Wy4uLl9dLnJlZHVjZSgoKGUsdCk9PntsZXRbcixzXT10O3JldHVybiBlW3JdPXMsZX0pLHt9KSxyPWF3YWl0IGsuanNvbigpLHIucmVmcmVzaF90b2tlbj8oaCYmKG8ubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLE89YyxiPXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhvKS5mb3JFYWNoKChlPT57bGV0W3Qscl09ZTtyPT09TyYmKG9bdF09Yil9KSkpLCgoZSx0LHIpPT57b1tuKHQscildPWV9KShyLnJlZnJlc2hfdG9rZW4sZyx5KSxkZWxldGUgci5yZWZyZXNoX3Rva2VuKTooKGUsdCk9PntkZWxldGUgb1tuKGUsdCldfSkoZyx5KSx1LnBvc3RNZXNzYWdlKHtvazprLm9rLGpzb246cixoZWFkZXJzOmR9KX1jYXRjaChlKXt1LnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjplLmVycm9yLGVycm9yX2Rlc2NyaXB0aW9uOmUubWVzc2FnZX0saGVhZGVyczpkfSl9dmFyIE8sYixfLGp9KSl9KCk7Cgo=",Jh=null,Zh=!1,function(e){return Nl=Nl||y5(qh,Jh,Zh),new Worker(Nl,e)});const Tl={},Yh=async function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3;for(let n=0;n<t;n++)if(await e())return!0;return!1};class w5{constructor(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var n;const o=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);o.add(t),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(t){const n=await this.cache.get(this.manifestKey);if(n){const o=new Set(n.keys);return o.delete(t),o.size>0?await this.cache.set(this.manifestKey,{keys:[...o]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return"".concat("@@auth0spajs@@","::").concat(t)}}const b5={memory:()=>new Rw().enclosedCache,localstorage:()=>new s5},Xh=e=>b5[e],Qh=e=>{const{openUrl:t,onRedirect:n}=e,o=An(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:t===!1||t?t:n})},em=(e,t)=>{const n=(t==null?void 0:t.split(" "))||[];return((e==null?void 0:e.split(" "))||[]).every(o=>n.includes(o))},dr={NONCE:"nonce",KEYPAIR:"keypair"};class x5{constructor(t){this.clientId=t}getVersion(){return 1}createDbHandle(){const t=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((n,o)=>{t.onupgradeneeded=()=>Object.values(dr).forEach(r=>t.result.createObjectStore(r)),t.onerror=()=>o(t.error),t.onsuccess=()=>n(t.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(t,n,o){const r=o((await this.getDbHandle()).transaction(t,n).objectStore(t));return new Promise((i,a)=>{r.onsuccess=()=>i(r.result),r.onerror=()=>a(r.error)})}buildKey(t){const n=t?"_".concat(t):"auth0";return"".concat(this.clientId,"::").concat(n)}setNonce(t,n){return this.save(dr.NONCE,this.buildKey(n),t)}setKeyPair(t){return this.save(dr.KEYPAIR,this.buildKey(),t)}async save(t,n,o){await this.executeDbRequest(t,"readwrite",r=>r.put(o,n))}findNonce(t){return this.find(dr.NONCE,this.buildKey(t))}findKeyPair(){return this.find(dr.KEYPAIR,this.buildKey())}find(t,n){return this.executeDbRequest(t,"readonly",o=>o.get(n))}async deleteBy(t,n){const o=await this.executeDbRequest(t,"readonly",r=>r.getAllKeys());o==null||o.filter(n).map(r=>this.executeDbRequest(t,"readwrite",i=>i.delete(r)))}deleteByClientId(t,n){return this.deleteBy(t,o=>typeof o=="string"&&o.startsWith("".concat(n,"::")))}clearNonces(){return this.deleteByClientId(dr.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(dr.KEYPAIR,this.clientId)}}class k5{constructor(t){this.storage=new x5(t)}getNonce(t){return this.storage.findNonce(t)}setNonce(t,n){return this.storage.setNonce(t,n)}async getOrGenerateKeyPair(){let t=await this.storage.findKeyPair();return t||(t=await XC(),await this.storage.setKeyPair(t)),t}async generateProof(t){const n=await this.getOrGenerateKeyPair();return e5(Object.assign({keyPair:n},t))}async calculateThumbprint(){return QC(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var ri;(function(e){e.Bearer="Bearer",e.DPoP="DPoP"})(ri||(ri={}));class S5{constructor(t,n){this.hooks=n,this.config=Object.assign(Object.assign({},t),{fetch:t.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(t){return/^(https?:)?\/\//i.test(t)}buildUrl(t,n){if(n){if(this.isAbsoluteUrl(n))return n;if(t)return"".concat(t.replace(/\/?\/$/,""),"/").concat(n.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(t){return this.config.getAccessToken?this.config.getAccessToken(t):this.hooks.getAccessToken(t)}extractUrl(t){return typeof t=="string"?t:t instanceof URL?t.href:t.url}buildBaseRequest(t,n){if(!this.config.baseUrl)return new Request(t,n);const o=this.buildUrl(this.config.baseUrl,this.extractUrl(t)),r=t instanceof Request?new Request(o,t):o;return new Request(r,n)}setAuthorizationHeader(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ri.Bearer;t.headers.set("authorization","".concat(o," ").concat(n))}async setDpopProofHeader(t,n){if(!this.config.dpopNonceId)return;const o=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:n,method:t.method,nonce:o,url:t.url});t.headers.set("dpop",r)}async prepareRequest(t,n){const o=await this.getAccessToken(n);let r,i;typeof o=="string"?(r=this.config.dpopNonceId?ri.DPoP:ri.Bearer,i=o):(r=o.token_type,i=o.access_token),this.setAuthorizationHeader(t,i,r),r===ri.DPoP&&await this.setDpopProofHeader(t,i)}getHeader(t,n){return Array.isArray(t)?new Headers(t).get(n)||"":typeof t.get=="function"?t.get(n)||"":t[n]||""}hasUseDpopNonceError(t){if(t.status!==401)return!1;const n=this.getHeader(t.headers,"www-authenticate");return n.includes("invalid_dpop_nonce")||n.includes("use_dpop_nonce")}async handleResponse(t,n){const o=this.getHeader(t.headers,"dpop-nonce");if(o&&await this.hooks.setDpopNonce(o),!this.hasUseDpopNonceError(t))return t;if(!o||!n.onUseDpopNonceError)throw new Kc(o);return n.onUseDpopNonceError()}async internalFetchWithAuth(t,n,o,r){const i=this.buildBaseRequest(t,n);await this.prepareRequest(i,r);const a=await this.config.fetch(i);return this.handleResponse(a,o)}fetchWithAuth(t,n,o){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(t,n,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),o)};return this.internalFetchWithAuth(t,n,r,o)}}class C5{constructor(t,n){this.myAccountFetcher=t,this.apiBase=n}async connectAccount(t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async completeAccount(t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async _handleResponse(t){let n;try{n=await t.text(),n=JSON.parse(n)}catch(o){throw new tc({type:"invalid_json",status:t.status,title:"Invalid JSON response",detail:n||String(o)})}if(t.ok)return n;throw new tc(n)}}class tc extends Error{constructor(t){let{type:n,status:o,title:r,detail:i,validation_errors:a}=t;super(i),this.name="MyAccountApiError",this.type=n,this.status=o,this.title=r,this.detail=i,this.validation_errors=a,Object.setPrototypeOf(this,tc.prototype)}}const E5={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}},j5="http://auth0.com/oauth/grant-type/mfa-otp",_5="http://auth0.com/oauth/grant-type/mfa-oob",O5="http://auth0.com/oauth/grant-type/mfa-recovery-code";function $w(e,t){this.v=e,this.k=t}function vt(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function A5(e){return new $w(e,0)}function Hw(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ue(e,t){return e.get(vt(e,t))}function Ct(e,t,n){Hw(e,t),t.set(e,n)}function lt(e,t,n){return e.set(vt(e,t),n),n}function he(e,t,n){return(t=function(o){var r=function(i,a){if(typeof i!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var c=s.call(i,a||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(o,"string");return typeof r=="symbol"?r:r+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tm(Object(n),!0).forEach(function(o){he(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tm(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function nm(e,t){if(e==null)return{};var n,o,r=function(a,s){if(a==null)return{};var c={};for(var u in a)if({}.hasOwnProperty.call(a,u)){if(s.indexOf(u)!==-1)continue;c[u]=a[u]}return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function P5(e){return function(){return new ea(e.apply(this,arguments))}}function ea(e){var t,n;function o(i,a){try{var s=e[i](a),c=s.value,u=c instanceof $w;Promise.resolve(u?c.v:c).then(function(d){if(u){var f=i==="return"?"return":"next";if(!c.k||d.done)return o(f,d);d=e[f](d).value}r(s.done?"return":"normal",d)},function(d){o("throw",d)})}catch(d){r("throw",d)}}function r(i,a){switch(i){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(i,a){return new Promise(function(s,c){var u={key:i,arg:a,resolve:s,reject:c,next:null};n?n=n.next=u:(t=n=u,o(i,a))})},typeof e.return!="function"&&(this.return=void 0)}var cs,Il;let nd;if(ea.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ea.prototype.next=function(e){return this._invoke("next",e)},ea.prototype.throw=function(e){return this._invoke("throw",e)},ea.prototype.return=function(e){return this._invoke("return",e)},typeof navigator>"u"||(cs=navigator.userAgent)===null||cs===void 0||(Il=cs.startsWith)===null||Il===void 0||!Il.call(cs,"Mozilla/5.0 ")){const e="v3.8.3";nd="".concat("oauth4webapi","/").concat(e)}function Ti(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}function Je(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}const Cn=Symbol(),od=Symbol(),rd=Symbol(),zn=Symbol(),N5=Symbol(),to=Symbol(),T5=new TextEncoder,I5=new TextDecoder;function fi(e){return typeof e=="string"?T5.encode(e):I5.decode(e)}let id,Bw;Uint8Array.prototype.toBase64?id=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):id=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o<t.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Nr(e){return typeof e=="string"?Bw(e):id(e)}Bw=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(t){throw Je("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",t)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}catch(t){throw Je("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",t)}};class fn extends Error{constructor(t,n){var o;super(t,n),he(this,"code",void 0),this.name=this.constructor.name,this.code=cd,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class Tf extends Error{constructor(t,n){var o;super(t,n),he(this,"code",void 0),this.name=this.constructor.name,n!=null&&n.code&&(this.code=n==null?void 0:n.code),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function Ae(e,t,n){return new Tf(e,{code:t,cause:n})}function R5(e,t){if(function(n,o){if(!(n instanceof CryptoKey))throw Je("".concat(o," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),e.type!=="private")throw Je("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}function nc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Gc(e){Ti(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(e??{});if(nd&&!t.has("user-agent")&&t.set("user-agent",nd),t.has("authorization"))throw Je('"options.headers" must not include the "authorization" header name',"ERR_INVALID_ARG_VALUE");return t}function zw(e,t){if(t!==void 0){if(typeof t=="function"&&(t=t(e.href)),!(t instanceof AbortSignal))throw Je('"options.signal" must return or be an instance of AbortSignal',"ERR_INVALID_ARG_TYPE");return t}}function om(e){return e.includes("//")?e.replace("//","/"):e}async function L5(e,t){return async function(n,o,r,i){if(!(n instanceof URL))throw Je('"'.concat(o,'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");If(n,(i==null?void 0:i[Cn])!==!0);const a=r(new URL(n.href)),s=Gc(i==null?void 0:i.headers);return s.set("accept","application/json"),((i==null?void 0:i[zn])||fetch)(a.href,{body:void 0,headers:Object.fromEntries(s.entries()),method:"GET",redirect:"manual",signal:zw(a,i==null?void 0:i.signal)})}(e,"issuerIdentifier",n=>{switch(t==null?void 0:t.algorithm){case void 0:case"oidc":(function(o,r){o.pathname=om("".concat(o.pathname,"/").concat(r))})(n,".well-known/openid-configuration");break;case"oauth2":(function(o,r){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];o.pathname==="/"?o.pathname=r:o.pathname=om("".concat(r,"/").concat(i?o.pathname:o.pathname.replace(/(\/)$/,"")))})(n,".well-known/oauth-authorization-server");break;default:throw Je('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return n},t)}function Yo(e,t,n,o,r){try{if(typeof e!="number"||!Number.isFinite(e))throw Je("".concat(n," must be a number"),"ERR_INVALID_ARG_TYPE",r);if(e>0)return;if(t){if(e!==0)throw Je("".concat(n," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",r);return}throw Je("".concat(n," must be a positive number"),"ERR_INVALID_ARG_VALUE",r)}catch(i){throw o?Ae(i.message,o,r):i}}function bt(e,t,n,o){try{if(typeof e!="string")throw Je("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",o);if(e.length===0)throw Je("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",o)}catch(r){throw n?Ae(r.message,n,o):r}}function Fw(e){(function(t,n){if(Kw(t)!==n)throw function(o){let r='"response" content-type must be ';for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if(a.length>2){const c=a.pop();r+="".concat(a.join(", "),", or ").concat(c)}else a.length===2?r+="".concat(a[0]," or ").concat(a[1]):r+=a[0];return Ae(r,qw,o)}(t,n)})(e,"application/json")}function Ww(){return Nr(crypto.getRandomValues(new Uint8Array(32)))}function D5(e){switch(e.algorithm.name){case"RSA-PSS":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new fn("unsupported RsaHashedKeyAlgorithm hash name",{cause:t})}}(e);case"RSASSA-PKCS1-v1_5":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new fn("unsupported RsaHashedKeyAlgorithm hash name",{cause:t})}}(e);case"ECDSA":return function(t){switch(t.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new fn("unsupported EcKeyAlgorithm namedCurve",{cause:t})}}(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new fn("unsupported CryptoKey algorithm name",{cause:e})}}function oc(e){const t=e==null?void 0:e[od];return typeof t=="number"&&Number.isFinite(t)?t:0}function ad(e){const t=e==null?void 0:e[rd];return typeof t=="number"&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function rc(){return Math.floor(Date.now()/1e3)}function Dn(e){if(typeof e!="object"||e===null)throw Je('"as" must be an object',"ERR_INVALID_ARG_TYPE");bt(e.issuer,'"as.issuer"')}function Mn(e){if(typeof e!="object"||e===null)throw Je('"client" must be an object',"ERR_INVALID_ARG_TYPE");bt(e.client_id,'"client.client_id"')}function rm(e){return bt(e,'"clientSecret"'),(t,n,o,r)=>{o.set("client_id",n.client_id),o.set("client_secret",e)}}function M5(e,t){const{key:n,kid:o}=(r=e)instanceof CryptoKey?{key:r}:(r==null?void 0:r.key)instanceof CryptoKey?(r.kid!==void 0&&bt(r.kid,'"kid"'),{key:r.key,kid:r.kid}):{};var r;return R5(n,'"clientPrivateKey.key"'),async(i,a,s,c)=>{var u;const d={alg:D5(n),kid:o},f=function(p,h){const m=rc()+oc(h);return{jti:Ww(),aud:p.issuer,exp:m+60,iat:m,nbf:m,iss:h.client_id,sub:h.client_id}}(i,a);t==null||(u=t[N5])===null||u===void 0||u.call(t,d,f),s.set("client_id",a.client_id),s.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),s.set("client_assertion",await async function(p,h,m){if(!m.usages.includes("sign"))throw Je('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const g="".concat(Nr(fi(JSON.stringify(p))),".").concat(Nr(fi(JSON.stringify(h)))),y=Nr(await crypto.subtle.sign(function(b){switch(b.algorithm.name){case"ECDSA":return{name:b.algorithm.name,hash:tE(b)};case"RSA-PSS":switch(sm(b),b.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:b.algorithm.name,saltLength:parseInt(b.algorithm.hash.name.slice(-3),10)>>3};default:throw new fn("unsupported RSA-PSS hash name",{cause:b})}case"RSASSA-PKCS1-v1_5":return sm(b),b.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return b.algorithm.name}throw new fn("unsupported CryptoKey algorithm name",{cause:b})}(m),m,fi(g)));return"".concat(g,".").concat(y)}(d,f,n))}}const $5=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function If(e,t){if(t&&e.protocol!=="https:")throw Ae("only requests to HTTPS are allowed",Jw,e);if(e.protocol!=="https:"&&e.protocol!=="http:")throw Ae("only HTTP and HTTPS requests are allowed",Zw,e)}function im(e,t,n,o){let r;if(typeof e!="string"||!(r=$5(e)))throw Ae("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),e===void 0?Q5:eE,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return If(r,o),r}function Ma(e,t,n,o){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?im(e.mtls_endpoint_aliases[t],t,n,o):im(e[t],t,n,o)}class qc extends Error{constructor(t,n){var o;super(t,n),he(this,"cause",void 0),he(this,"code",void 0),he(this,"error",void 0),he(this,"status",void 0),he(this,"error_description",void 0),he(this,"response",void 0),this.name=this.constructor.name,this.code=Y5,this.cause=n.cause,this.error=n.cause.error,this.status=n.response.status,this.error_description=n.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class Uw extends Error{constructor(t,n){var o,r;super(t,n),he(this,"cause",void 0),he(this,"code",void 0),he(this,"error",void 0),he(this,"error_description",void 0),this.name=this.constructor.name,this.code=X5,this.cause=n.cause,this.error=n.cause.get("error"),this.error_description=(o=n.cause.get("error_description"))!==null&&o!==void 0?o:void 0,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class Rf extends Error{constructor(t,n){var o;super(t,n),he(this,"cause",void 0),he(this,"code",void 0),he(this,"response",void 0),he(this,"status",void 0),this.name=this.constructor.name,this.code=Z5,this.cause=n.cause,this.status=n.response.status,this.response=n.response,Object.defineProperty(this,"response",{enumerable:!1}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}const H5="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",B5=new RegExp("^[,\\s]*("+H5+")"),z5=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),F5=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),W5=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Lf(e,t,n){if(e.status!==t){let r;var o;throw function(i){let a;if(a=function(s){if(!Ti(s,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");const c=s.headers.get("www-authenticate");if(c===null)return;const u=[];let d=c;for(;d;){var f;let p=d.match(B5);const h=(f=p)===null||f===void 0?void 0:f[1].toLowerCase();if(!h)return;const m=d.substring(p[0].length);if(m&&!m.match(/^[\s,]/))return;const g=m.match(/^\s+(.*)$/),y=!!g;d=g?g[1]:void 0;const b={};let k;if(y)for(;d;){let S,w;if(p=d.match(z5)){if([,S,w,d]=p,w.includes("\\"))try{w=JSON.parse('"'.concat(w,'"'))}catch{}b[S.toLowerCase()]=w}else{if(!(p=d.match(F5))){if(p=d.match(W5)){if(Object.keys(b).length)break;[,k,d]=p;break}return}[,S,w,d]=p,b[S.toLowerCase()]=w}}else d=m||void 0;const x={scheme:h,parameters:b};k&&(x.token68=k),u.push(x)}return u.length?u:void 0}(i))throw new Rf("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:a,response:i})}(e),(r=await async function(i){if(i.status>399&&i.status<500){Ha(i),Fw(i);try{const a=await i.clone().json();if(nc(a)&&typeof a.error=="string"&&a.error.length)return a}catch{}}}(e))?(await((o=e.body)===null||o===void 0?void 0:o.cancel()),new qc("server responded with an error in the response body",{cause:r,response:e})):Ae('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),$f,e)}}function Vw(e){if(!Mf.has(e))throw Je('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function Kw(e){var t;return(t=e.headers.get("content-type"))===null||t===void 0?void 0:t.split(";")[0]}async function Df(e,t,n,o,r,i,a){return await n(e,t,r,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((a==null?void 0:a[zn])||fetch)(o.href,{body:r,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:zw(o,a==null?void 0:a.signal)})}async function $a(e,t,n,o,r,i){var a;const s=Ma(e,"token_endpoint",t.use_mtls_endpoint_aliases,(i==null?void 0:i[Cn])!==!0);r.set("grant_type",o);const c=Gc(i==null?void 0:i.headers);c.set("accept","application/json"),(i==null?void 0:i.DPoP)!==void 0&&(Vw(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await Df(e,t,n,s,r,c,i);return i==null||(a=i.DPoP)===null||a===void 0||a.cacheNonce(u,s),u}const Gw=new WeakMap,U5=new WeakMap;function sd(e){if(!e.id_token)return;const t=Gw.get(e);if(!t)throw Je('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function ji(e,t,n,o,r,i){if(Dn(e),Mn(t),!Ti(n,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Lf(n,200,"Token Endpoint"),Ha(n);const a=await Jc(n);if(bt(a.access_token,'"response" body "access_token" property',Fe,{body:a}),bt(a.token_type,'"response" body "token_type" property',Fe,{body:a}),a.token_type=a.token_type.toLowerCase(),a.expires_in!==void 0){let s=typeof a.expires_in!="number"?parseFloat(a.expires_in):a.expires_in;Yo(s,!0,'"response" body "expires_in" property',Fe,{body:a}),a.expires_in=s}if(a.refresh_token!==void 0&&bt(a.refresh_token,'"response" body "refresh_token" property',Fe,{body:a}),a.scope!==void 0&&typeof a.scope!="string")throw Ae('"response" body "scope" property must be a string',Fe,{body:a});if(a.id_token!==void 0){bt(a.id_token,'"response" body "id_token" property',Fe,{body:a});const s=["aud","exp","iat","iss","sub"];t.require_auth_time===!0&&s.push("auth_time"),t.default_max_age!==void 0&&(Yo(t.default_max_age,!0,'"client.default_max_age"'),s.push("auth_time")),o!=null&&o.length&&s.push(...o);const{claims:c,jwt:u}=await async function(d,f,p,h,m){let g,y,{0:b,1:k,length:x}=d.split(".");if(x===5){if(m===void 0)throw new fn("JWE decryption is not configured",{cause:d});d=await m(d),{0:b,1:k,length:x}=d.split(".")}if(x!==3)throw Ae("Invalid JWT",Fe,d);try{g=JSON.parse(fi(Nr(b)))}catch(w){throw Ae("failed to parse JWT Header body as base64url encoded JSON",ic,w)}if(!nc(g))throw Ae("JWT Header must be a top level object",Fe,d);if(f(g),g.crit!==void 0)throw new fn('no JWT "crit" header parameter extensions are supported',{cause:{header:g}});try{y=JSON.parse(fi(Nr(k)))}catch(w){throw Ae("failed to parse JWT Payload body as base64url encoded JSON",ic,w)}if(!nc(y))throw Ae("JWT Payload must be a top level object",Fe,d);const S=rc()+p;if(y.exp!==void 0){if(typeof y.exp!="number")throw Ae('unexpected JWT "exp" (expiration time) claim type',Fe,{claims:y});if(y.exp<=S-h)throw Ae('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Sa,{claims:y,now:S,tolerance:h,claim:"exp"})}if(y.iat!==void 0&&typeof y.iat!="number")throw Ae('unexpected JWT "iat" (issued at) claim type',Fe,{claims:y});if(y.iss!==void 0&&typeof y.iss!="string")throw Ae('unexpected JWT "iss" (issuer) claim type',Fe,{claims:y});if(y.nbf!==void 0){if(typeof y.nbf!="number")throw Ae('unexpected JWT "nbf" (not before) claim type',Fe,{claims:y});if(y.nbf>S+h)throw Ae('unexpected JWT "nbf" (not before) claim value',Sa,{claims:y,now:S,tolerance:h,claim:"nbf"})}if(y.aud!==void 0&&typeof y.aud!="string"&&!Array.isArray(y.aud))throw Ae('unexpected JWT "aud" (audience) claim type',Fe,{claims:y});return{header:g,claims:y,jwt:d}}(a.id_token,oE.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),oc(t),ad(t),r).then(q5.bind(void 0,s)).then(K5.bind(void 0,e)).then(V5.bind(void 0,t.client_id));if(Array.isArray(c.aud)&&c.aud.length!==1){if(c.azp===void 0)throw Ae('ID Token "aud" (audience) claim includes additional untrusted audiences',vo,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw Ae('unexpected ID Token "azp" (authorized party) claim value',vo,{expected:t.client_id,claims:c,claim:"azp"})}c.auth_time!==void 0&&Yo(c.auth_time,!0,'ID Token "auth_time" (authentication time)',Fe,{claims:c}),U5.set(n,u),Gw.set(a,c)}if((i==null?void 0:i[a.token_type])!==void 0)i[a.token_type](n,a);else if(a.token_type!=="dpop"&&a.token_type!=="bearer")throw new fn("unsupported `token_type` value",{cause:{body:a}});return a}function V5(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw Ae('unexpected JWT "aud" (audience) claim value',vo,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw Ae('unexpected JWT "aud" (audience) claim value',vo,{expected:e,claims:t.claims,claim:"aud"});return t}function K5(e,t){var n,o;const r=(n=(o=e[Yw])===null||o===void 0?void 0:o.call(e,t))!==null&&n!==void 0?n:e.issuer;if(t.claims.iss!==r)throw Ae('unexpected JWT "iss" (issuer) claim value',vo,{expected:r,claims:t.claims,claim:"iss"});return t}const Mf=new WeakSet,am=Symbol(),G5={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function q5(e,t){for(const n of e)if(t.claims[n]===void 0)throw Ae('JWT "'.concat(n,'" (').concat(G5[n],") claim missing"),Fe,{claims:t.claims});return t}const Rl=Symbol(),Ll=Symbol();async function J5(e,t,n,o){return typeof(o==null?void 0:o.expectedNonce)=="string"||typeof(o==null?void 0:o.maxAge)=="number"||o!=null&&o.requireIdToken?async function(r,i,a,s,c,u,d){const f=[];switch(s){case void 0:s=Rl;break;case Rl:break;default:bt(s,'"expectedNonce" argument'),f.push("nonce")}switch(c!=null||(c=i.default_max_age),c){case void 0:c=Ll;break;case Ll:break;default:Yo(c,!0,'"maxAge" argument'),f.push("auth_time")}const p=await ji(r,i,a,f,u,d);bt(p.id_token,'"response" body "id_token" property',Fe,{body:p});const h=sd(p);if(c!==Ll){const m=rc()+oc(i),g=ad(i);if(h.auth_time+c<m-g)throw Ae("too much time has elapsed since the last End-User authentication",Sa,{claims:h,now:m,tolerance:g,claim:"auth_time"})}if(s===Rl){if(h.nonce!==void 0)throw Ae('unexpected ID Token "nonce" claim value',vo,{expected:void 0,claims:h,claim:"nonce"})}else if(h.nonce!==s)throw Ae('unexpected ID Token "nonce" claim value',vo,{expected:s,claims:h,claim:"nonce"});return p}(e,t,n,o.expectedNonce,o.maxAge,o[to],o.recognizedTokenTypes):async function(r,i,a,s,c){const u=await ji(r,i,a,void 0,s,c),d=sd(u);if(d){if(i.default_max_age!==void 0){Yo(i.default_max_age,!0,'"client.default_max_age"');const f=rc()+oc(i),p=ad(i);if(d.auth_time+i.default_max_age<f-p)throw Ae("too much time has elapsed since the last End-User authentication",Sa,{claims:d,now:f,tolerance:p,claim:"auth_time"})}if(d.nonce!==void 0)throw Ae('unexpected ID Token "nonce" claim value',vo,{expected:void 0,claims:d,claim:"nonce"})}return u}(e,t,n,o==null?void 0:o[to],o==null?void 0:o.recognizedTokenTypes)}const Z5="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Y5="OAUTH_RESPONSE_BODY_ERROR",cd="OAUTH_UNSUPPORTED_OPERATION",X5="OAUTH_AUTHORIZATION_RESPONSE_ERROR",ic="OAUTH_PARSE_ERROR",Fe="OAUTH_INVALID_RESPONSE",qw="OAUTH_RESPONSE_IS_NOT_JSON",$f="OAUTH_RESPONSE_IS_NOT_CONFORM",Jw="OAUTH_HTTP_REQUEST_FORBIDDEN",Zw="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Sa="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",vo="OAUTH_JWT_CLAIM_COMPARISON_FAILED",ld="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",Q5="OAUTH_MISSING_SERVER_METADATA",eE="OAUTH_INVALID_SERVER_METADATA";function Ha(e){if(e.bodyUsed)throw Je('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function sm(e){const{algorithm:t}=e;if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new fn("unsupported ".concat(t.name," modulusLength"),{cause:e})}function tE(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new fn("unsupported ECDSA namedCurve",{cause:e})}}async function nE(e){if(e.method!=="POST")throw Je("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if(Kw(e)!=="application/x-www-form-urlencoded")throw Je("form_post responses are expected to use the application/x-www-form-urlencoded content-type","ERR_INVALID_ARG_VALUE",{cause:e});return async function(t){if(t.bodyUsed)throw Je("form_post Request instances must contain a readable body","ERR_INVALID_ARG_VALUE",{cause:t});return t.text()}(e)}function oE(e,t,n,o){if(e===void 0)if(Array.isArray(t)){if(!t.includes(o.alg))throw Ae('unexpected JWT "alg" header parameter',Fe,{header:o,expected:t,reason:"authorization server metadata"})}else{if(n===void 0)throw Ae('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if(typeof n=="string"?o.alg!==n:typeof n=="function"?!n(o.alg):!n.includes(o.alg))throw Ae('unexpected JWT "alg" header parameter',Fe,{header:o,expected:n,reason:"default value"})}else if(typeof e=="string"?o.alg!==e:!e.includes(o.alg))throw Ae('unexpected JWT "alg" header parameter',Fe,{header:o,expected:e,reason:"client configuration"})}function kr(e,t){const{0:n,length:o}=e.getAll(t);if(o>1)throw Ae('"'.concat(t,'" parameter must be provided only once'),Fe);return n}const rE=Symbol(),iE=Symbol();function aE(e,t,n,o){if(Dn(e),Mn(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw Je('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(kr(n,"response"))throw Ae('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',Fe,{parameters:n});const r=kr(n,"iss"),i=kr(n,"state");if(!r&&e.authorization_response_iss_parameter_supported)throw Ae('response parameter "iss" (issuer) missing',Fe,{parameters:n});if(r&&r!==e.issuer)throw Ae('unexpected "iss" (issuer) response parameter value',Fe,{expected:e.issuer,parameters:n});switch(o){case void 0:case iE:if(i!==void 0)throw Ae('unexpected "state" response parameter encountered',Fe,{expected:void 0,parameters:n});break;case rE:break;default:if(bt(o,'"expectedState" argument'),i!==o)throw Ae(i===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',Fe,{expected:o,parameters:n})}if(kr(n,"error"))throw new Uw("authorization response from the server is an error",{cause:n});const a=kr(n,"id_token"),s=kr(n,"token");if(a!==void 0||s!==void 0)throw new fn("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),Mf.add(c),c;var c}async function Jc(e){let t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fw;try{t=await e.json()}catch(o){throw n(e),Ae('failed to parse "response" body as JSON',ic,o)}if(!nc(t))throw Ae('"response" body must be a top level object',Fe,{body:t});return t}const Dl=Symbol(),Yw=Symbol(),cm=new TextEncoder,Ca=new TextDecoder;function Ml(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=o}return t}function Xw(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function aa(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:Ca.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=Ca.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Xw(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}class $t extends Error{constructor(t,n){var o;super(t,n),he(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}he($t,"code","ERR_JOSE_GENERIC");class _n extends $t{constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(t,{cause:{claim:o,reason:r,payload:n}}),he(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),he(this,"claim",void 0),he(this,"reason",void 0),he(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}he(_n,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class ud extends $t{constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(t,{cause:{claim:o,reason:r,payload:n}}),he(this,"code","ERR_JWT_EXPIRED"),he(this,"claim",void 0),he(this,"reason",void 0),he(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}he(ud,"code","ERR_JWT_EXPIRED");class Qw extends $t{constructor(){super(...arguments),he(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}he(Qw,"code","ERR_JOSE_ALG_NOT_ALLOWED");class un extends $t{constructor(){super(...arguments),he(this,"code","ERR_JOSE_NOT_SUPPORTED")}}he(un,"code","ERR_JOSE_NOT_SUPPORTED");he(class extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),he(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");he(class extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Tt extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWS_INVALID")}}he(Tt,"code","ERR_JWS_INVALID");class dd extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWT_INVALID")}}he(dd,"code","ERR_JWT_INVALID");he(class extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Hf extends $t{constructor(){super(...arguments),he(this,"code","ERR_JWKS_INVALID")}}he(Hf,"code","ERR_JWKS_INVALID");class Bf extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),he(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}he(Bf,"code","ERR_JWKS_NO_MATCHING_KEY");class eb extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),he(this,Symbol.asyncIterator,void 0),he(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}he(eb,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class tb extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),he(this,"code","ERR_JWKS_TIMEOUT")}}he(tb,"code","ERR_JWKS_TIMEOUT");class nb extends $t{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),he(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}he(nb,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Wn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"algorithm.name";return new TypeError("CryptoKey does not support this operation, its ".concat(t," must be ").concat(e))},Gr=(e,t)=>e.name===t;function $l(e){return parseInt(e.name.slice(4),10)}function sE(e,t,n){switch(t){case"HS256":case"HS384":case"HS512":{if(!Gr(e.algorithm,"HMAC"))throw Wn("HMAC");const o=parseInt(t.slice(2),10);if($l(e.algorithm.hash)!==o)throw Wn("SHA-".concat(o),"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Gr(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Wn("RSASSA-PKCS1-v1_5");const o=parseInt(t.slice(2),10);if($l(e.algorithm.hash)!==o)throw Wn("SHA-".concat(o),"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Gr(e.algorithm,"RSA-PSS"))throw Wn("RSA-PSS");const o=parseInt(t.slice(2),10);if($l(e.algorithm.hash)!==o)throw Wn("SHA-".concat(o),"algorithm.hash");break}case"Ed25519":case"EdDSA":if(!Gr(e.algorithm,"Ed25519"))throw Wn("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!Gr(e.algorithm,t))throw Wn(t);break;case"ES256":case"ES384":case"ES512":{if(!Gr(e.algorithm,"ECDSA"))throw Wn("ECDSA");const o=function(r){switch(r){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==o)throw Wn(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}(function(o,r){if(r&&!o.usages.includes(r))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(r,"."))})(e,n)}function ob(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];if((o=o.filter(Boolean)).length>2){const a=o.pop();e+="one of type ".concat(o.join(", "),", or ").concat(a,".")}else o.length===2?e+="one of type ".concat(o[0]," or ").concat(o[1],"."):e+="of type ".concat(o[0],".");if(t==null)e+=" Received ".concat(t);else if(typeof t=="function"&&t.name)e+=" Received function ".concat(t.name);else if(typeof t=="object"&&t!=null){var i;(i=t.constructor)!==null&&i!==void 0&&i.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const lm=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return ob("Key for the ".concat(e," algorithm must be "),t,...o)},rb=e=>{if((e==null?void 0:e[Symbol.toStringTag])==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},ib=e=>(e==null?void 0:e[Symbol.toStringTag])==="KeyObject",um=e=>rb(e)||ib(e);function or(e){if(typeof(t=e)!="object"||t===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t;if(Object.getPrototypeOf(e)===null)return!0;let n=e;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const Hl=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0},sa=e=>{const t=e.data[e.pos++];if(128&t){const n=127&t;let o=0;for(let r=0;r<n;r++)o=o<<8|e.data[e.pos++];return o}return t},ca=(e,t,n)=>{if(e.data[e.pos++]!==t)throw new Error(n)},dm=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},cE=e=>{const t=(r=>{ca(r,6,"Expected algorithm OID");const i=sa(r);return dm(r,i)})(e);if(Hl(t,[43,101,110]))return"X25519";if(!Hl(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");ca(e,6,"Expected curve OID");const n=sa(e),o=dm(e,n);for(const{name:r,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(Hl(o,i))return r;throw new Error("Unsupported named curve")},lE=async(e,t,n,o)=>{var r;let i,a;const s=e==="spki",c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const u=o.getNamedCurve(t);i=u==="X25519"?{name:"X25519"}:{name:"ECDH",namedCurve:u}}catch{throw new un("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new un('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,(r=o==null?void 0:o.extractable)!==null&&r!==void 0?r:!!s,a)},uE=(e,t,n)=>{var o;const r=((a,s)=>Xw(a.replace(s,"")))(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);let i=n;return t!=null&&(o=t.startsWith)!==null&&o!==void 0&&o.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=a=>{const s={data:a,pos:0};return function(c){ca(c,48,"Invalid PKCS#8 structure"),sa(c),ca(c,2,"Expected version field");const u=sa(c);c.pos+=u,ca(c,48,"Expected algorithm identifier"),sa(c),c.pos}(s),cE(s)}),lE("pkcs8",r,t,i)};async function _s(e){var t,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:o,keyUsages:r}=function(a){let s,c;switch(a.kty){case"AKP":switch(a.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":s={name:a.alg},c=a.priv?["sign"]:["verify"];break;default:throw new un('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(a.alg){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:"SHA-".concat(a.alg.slice(-3))},c=a.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(a.alg.slice(-3))},c=a.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(a.alg.slice(-3),10)||1)},c=a.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new un('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(a.alg){case"ES256":s={name:"ECDSA",namedCurve:"P-256"},c=a.d?["sign"]:["verify"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},c=a.d?["sign"]:["verify"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},c=a.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":s={name:"ECDH",namedCurve:a.crv},c=a.d?["deriveBits"]:[];break;default:throw new un('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(a.alg){case"Ed25519":case"EdDSA":s={name:"Ed25519"},c=a.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":s={name:a.crv},c=a.d?["deriveBits"]:[];break;default:throw new un('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new un('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:s,keyUsages:c}}(e),i=ke({},e);return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,o,(t=e.ext)!==null&&t!==void 0?t:!e.d&&!e.priv,(n=e.key_ops)!==null&&n!==void 0?n:r)}const fd=e=>or(e)&&typeof e.kty=="string";let Wo;const fm=async function(e,t,n){let o=arguments.length>3&&arguments[3]!==void 0&&arguments[3];Wo||(Wo=new WeakMap);let r=Wo.get(e);if(r!=null&&r[n])return r[n];const i=await _s(ke(ke({},t),{},{alg:n}));return o&&Object.freeze(e),r?r[n]=i:Wo.set(e,{[n]:i}),i};async function dE(e,t){if(e instanceof Uint8Array||rb(e))return e;if(ib(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return((o,r)=>{Wo||(Wo=new WeakMap);let i=Wo.get(o);if(i!=null&&i[r])return i[r];const a=o.type==="public",s=!!a;let c;if(o.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}c=o.toCryptoKey(o.asymmetricKeyType,s,a?[]:["deriveBits"])}if(o.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}switch(o.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(r!==o.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="rsa"){let d;switch(r){case"RSA-OAEP":d="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":d="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":d="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":d="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(r.startsWith("RSA-OAEP"))return o.toCryptoKey({name:"RSA-OAEP",hash:d},s,a?["encrypt"]:["decrypt"]);c=o.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:d},s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="ec"){var u;const d=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get((u=o.asymmetricKeyDetails)===null||u===void 0?void 0:u.namedCurve);if(!d)throw new TypeError("given KeyObject instance cannot be used for this algorithm");r==="ES256"&&d==="P-256"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r==="ES384"&&d==="P-384"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r==="ES512"&&d==="P-521"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r.startsWith("ECDH-ES")&&(c=o.toCryptoKey({name:"ECDH",namedCurve:d},s,a?[]:["deriveBits"]))}if(!c)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return i?i[r]=c:Wo.set(o,{[r]:c}),c})(e,t)}catch(o){if(o instanceof TypeError)throw o}let n=e.export({format:"jwk"});return fm(e,n,t)}if(fd(e))return e.k?aa(e.k):fm(e,e,t,!0);throw new Error("unreachable")}const qr=e=>e==null?void 0:e[Symbol.toStringTag],Bl=(e,t,n)=>{if(t.use!==void 0){let i;switch(n){case"sign":case"verify":i="sig";break;case"encrypt":case"decrypt":i="enc"}if(t.use!==i)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(i,'" when present'))}if(t.alg!==void 0&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var o,r;let i;switch(!0){case(n==="sign"||n==="verify"):case e==="dir":case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?n==="encrypt"?"wrapKey":"unwrapKey":n;break;case(n==="encrypt"&&e.startsWith("RSA")):i="wrapKey";break;case n==="decrypt":i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&((o=t.key_ops)===null||o===void 0||(r=o.includes)===null||r===void 0?void 0:r.call(o,i))===!1)throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};function fE(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((o,r,i)=>{if(!(r instanceof Uint8Array)){if(fd(r)){if((a=>a.kty==="oct"&&typeof a.k=="string")(r)&&Bl(o,r,i))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!um(r))throw new TypeError(lm(o,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError("".concat(qr(r),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((o,r,i)=>{if(fd(r))switch(i){case"decrypt":case"sign":if((a=>a.kty!=="oct"&&(a.kty==="AKP"&&typeof a.priv=="string"||typeof a.d=="string"))(r)&&Bl(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((a=>a.kty!=="oct"&&a.d===void 0&&a.priv===void 0)(r)&&Bl(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!um(r))throw new TypeError(lm(o,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError("".concat(qr(r),' instances for asymmetric algorithms must not be of type "secret"'));if(r.type==="public")switch(i){case"sign":throw new TypeError("".concat(qr(r),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(qr(r),' instances for asymmetric algorithm decryption must be of type "private"'))}if(r.type==="private")switch(i){case"verify":throw new TypeError("".concat(qr(r),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(qr(r),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}var ls,zl;let no,pm;if(typeof navigator>"u"||(ls=navigator.userAgent)===null||ls===void 0||(zl=ls.startsWith)===null||zl===void 0||!zl.call(ls,"Mozilla/5.0 ")){const e="v6.8.1";pm="".concat("openid-client","/").concat(e),no={"user-agent":pm}}const Dt=e=>Os.get(e);let Os,us;function ab(e){return e!==void 0?rm(e):(us||(us=new WeakMap),(t,n,o,r)=>{let i;return(i=us.get(n))||(function(a,s){if(typeof a!="string")throw oo("".concat(s," must be a string"),za);if(a.length===0)throw oo("".concat(s," must not be empty"),Ba)}(n.client_secret,'"metadata.client_secret"'),i=rm(n.client_secret),us.set(n,i)),i(t,n,o,r)})}const Uo=zn,Ba="ERR_INVALID_ARG_VALUE",za="ERR_INVALID_ARG_TYPE";function oo(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}function pE(e){return async function(t){return bt(t,"codeVerifier"),Nr(await crypto.subtle.digest("SHA-256",fi(t)))}(e)}function hE(){return Ww()}class ac extends Error{constructor(t,n){var o;super(t,n),he(this,"code",void 0),this.name=this.constructor.name,this.code=n==null?void 0:n.code,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function Kt(e,t,n){return new ac(e,{cause:t,code:n})}function Jt(e){if(e instanceof TypeError||e instanceof ac||e instanceof qc||e instanceof Uw||e instanceof Rf)throw e;if(e instanceof Tf)switch(e.code){case Jw:throw Kt("only requests to HTTPS are allowed",e,e.code);case Zw:throw Kt("only requests to HTTP or HTTPS are allowed",e,e.code);case $f:throw Kt("unexpected HTTP response status code",e.cause,e.code);case qw:throw Kt("unexpected response content-type",e.cause,e.code);case ic:throw Kt("parsing error occured",e,e.code);case Fe:throw Kt("invalid response encountered",e,e.code);case vo:throw Kt("unexpected JWT claim value encountered",e,e.code);case ld:throw Kt("unexpected JSON attribute value encountered",e,e.code);case Sa:throw Kt("JWT timestamp claim value failed validation",e,e.code);default:throw Kt(e.message,e,e.code)}if(e instanceof fn)throw Kt("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Kt("runtime operation error",e,cd);case"NotSupportedError":throw Kt("runtime unsupported operation",e,cd);case"TimeoutError":throw Kt("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Kt("operation aborted",e,"OAUTH_ABORT")}throw new ac("something went wrong",{cause:e})}async function mE(e,t,n,o,r){const i=await async function(c,u){var d,f;if(!(c instanceof URL))throw oo('"server" must be an instance of URL',za);const p=!c.href.includes("/.well-known/"),h=(d=u==null?void 0:u.timeout)!==null&&d!==void 0?d:30,m=AbortSignal.timeout(1e3*h),g=await(p?L5(c,{algorithm:u==null?void 0:u.algorithm,[zn]:u==null?void 0:u[Uo],[Cn]:u==null||(f=u.execute)===null||f===void 0?void 0:f.includes(gm),signal:m,headers:new Headers(no)}):((u==null?void 0:u[Uo])||fetch)((If(c,u==null||(y=u.execute)===null||y===void 0||!y.includes(gm)),c.href),{headers:Object.fromEntries(new Headers(ke({accept:"application/json"},no)).entries()),body:void 0,method:"GET",redirect:"manual",signal:m})).then(b=>async function(k,x){const S=k;if(!(S instanceof URL)&&S!==Dl)throw Je('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!Ti(x,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");if(x.status!==200)throw Ae('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',$f,x);Ha(x);const w=await Jc(x);if(bt(w.issuer,'"response" body "issuer" property',Fe,{body:w}),S!==Dl&&new URL(w.issuer).href!==S.href)throw Ae('"response" body "issuer" property does not match the expected value',ld,{expected:S.href,body:w,attribute:"issuer"});return w}(Dl,b)).catch(Jt);var y;return p&&new URL(g.issuer).href!==c.href&&(function(b,k,x){return!(b.origin!=="https://login.microsoftonline.com"||x!=null&&x.algorithm&&x.algorithm!=="oidc"||(k[sb]=!0,0))}(c,g,u)||function(b,k){return!(!b.hostname.endsWith(".b2clogin.com")||k!=null&&k.algorithm&&k.algorithm!=="oidc")}(c,u)||(()=>{throw new ac("discovered metadata issuer does not match the expected issuer",{code:ld,cause:{expected:c.href,body:g,attribute:"issuer"}})})()),g}(e,r),a=new sc(i,t,n,o);let s=Dt(a);if(r!=null&&r[Uo]&&(s.fetch=r[Uo]),r!=null&&r.timeout&&(s.timeout=r.timeout),r!=null&&r.execute)for(const c of r.execute)c(a);return a}new TextDecoder;const sb=Symbol();class sc{constructor(t,n,o,r){var i,a,s,c,u;if(typeof n!="string"||!n.length)throw oo('"clientId" must be a non-empty string',za);if(typeof o=="string"&&(o={client_secret:o}),((i=o)===null||i===void 0?void 0:i.client_id)!==void 0&&n!==o.client_id)throw oo('"clientId" and "metadata.client_id" must be the same',Ba);const d=ke(ke({},structuredClone(o)),{},{client_id:n});let f;d[od]=(a=(s=o)===null||s===void 0?void 0:s[od])!==null&&a!==void 0?a:0,d[rd]=(c=(u=o)===null||u===void 0?void 0:u[rd])!==null&&c!==void 0?c:30,f=r||(typeof d.client_secret=="string"&&d.client_secret.length?ab(d.client_secret):(g,y,b,k)=>{b.set("client_id",y.client_id)});let p=Object.freeze(d);const h=structuredClone(t);sb in t&&(h[Yw]=g=>{let{claims:{tid:y}}=g;return t.issuer.replace("{tenantid}",y)});let m=Object.freeze(h);Os||(Os=new WeakMap),Os.set(this,{__proto__:null,as:m,c:p,auth:f,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const t=structuredClone(Dt(this).as);return function(n){Object.defineProperties(n,function(o){return{supportsPKCE:{__proto__:null,value(){var r;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"S256";return((r=o.code_challenge_methods_supported)===null||r===void 0?void 0:r.includes(i))===!0}}}}(n))}(t),t}clientMetadata(){return structuredClone(Dt(this).c)}get timeout(){return Dt(this).timeout}set timeout(t){Dt(this).timeout=t}get[Uo](){return Dt(this).fetch}set[Uo](t){Dt(this).fetch=t}}function Fa(e){Object.defineProperties(e,function(t){let n;if(t.expires_in!==void 0){const o=new Date;o.setSeconds(o.getSeconds()+t.expires_in),n=o.getTime()}return{expiresIn:{__proto__:null,value(){if(n){const o=Date.now();return n>o?Math.floor((n-o)/1e3):0}}},claims:{__proto__:null,value(){try{return sd(this)}catch{return}}}}}(e))}async function hm(e,t,n){var o;let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const i=(o=e.headers.get("retry-after"))===null||o===void 0?void 0:o.trim();if(i===void 0)return;let a;if(/^\d+$/.test(i))a=parseInt(i,10);else{const s=new Date(i);if(Number.isFinite(s.getTime())){const c=new Date,u=s.getTime()-c.getTime();u>0&&(a=Math.ceil(u/1e3))}}if(r&&!Number.isFinite(a))throw new Tf("invalid Retry-After header value",{cause:e});a>t&&await cb(a-t,n)}function cb(e,t){return new Promise((n,o)=>{const r=i=>{try{t.throwIfAborted()}catch(s){return void o(s)}if(i<=0)return void n();const a=Math.min(i,5);setTimeout(()=>r(i-a),1e3*a)};r(e)})}async function mm(e,t){bo(e);const{as:n,c:o,auth:r,fetch:i,tlsOnly:a,timeout:s}=Dt(e);return async function(c,u,d,f,p){Dn(c),Mn(u);const h=Ma(c,"backchannel_authentication_endpoint",u.use_mtls_endpoint_aliases,(p==null?void 0:p[Cn])!==!0),m=new URLSearchParams(f);m.set("client_id",u.client_id);const g=Gc(p==null?void 0:p.headers);return g.set("accept","application/json"),Df(c,u,d,h,m,g,p)}(n,o,r,t,{[zn]:i,[Cn]:!a,headers:new Headers(no),signal:zr(s)}).then(c=>async function(u,d,f){if(Dn(u),Mn(d),!Ti(f,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Lf(f,200,"Backchannel Authentication Endpoint"),Ha(f);const p=await Jc(f);bt(p.auth_req_id,'"response" body "auth_req_id" property',Fe,{body:p});let h=typeof p.expires_in!="number"?parseFloat(p.expires_in):p.expires_in;return Yo(h,!0,'"response" body "expires_in" property',Fe,{body:p}),p.expires_in=h,p.interval!==void 0&&Yo(p.interval,!1,'"response" body "interval" property',Fe,{body:p}),p}(n,o,c)).catch(Jt)}async function lb(e,t,n,o){var r,i;bo(e),n=new URLSearchParams(n);let a=(r=t.interval)!==null&&r!==void 0?r:5;const s=(i=o==null?void 0:o.signal)!==null&&i!==void 0?i:AbortSignal.timeout(1e3*t.expires_in);try{await cb(a,s)}catch(w){Jt(w)}const{as:c,c:u,auth:d,fetch:f,tlsOnly:p,nonRepudiation:h,timeout:m,decrypt:g}=Dt(e),y=(w,C)=>lb(e,ke(ke({},t),{},{interval:w}),n,ke(ke({},o),{},{signal:s,flag:C})),b=await async function(w,C,O,_,N){Dn(w),Mn(C),bt(_,'"authReqId"');const E=new URLSearchParams(N==null?void 0:N.additionalParameters);return E.set("auth_req_id",_),$a(w,C,O,"urn:openid:params:grant-type:ciba",E,N)}(c,u,d,t.auth_req_id,{[zn]:f,[Cn]:!p,additionalParameters:n,DPoP:o==null?void 0:o.DPoP,headers:new Headers(no),signal:s.aborted?s:zr(m)}).catch(Jt);var k;if(b.status===503&&b.headers.has("retry-after"))return await hm(b,a,s,!0),await((k=b.body)===null||k===void 0?void 0:k.cancel()),y(a);const x=async function(w,C,O,_){return ji(w,C,O,void 0,_==null?void 0:_[to],_==null?void 0:_.recognizedTokenTypes)}(c,u,b,{[to]:g});let S;try{S=await x}catch(w){if(Wa(w,o))return y(a,Xo);if(w instanceof qc)switch(w.error){case"slow_down":a+=5;case"authorization_pending":return await hm(w.response,a,s),y(a)}Jt(w)}return S.id_token&&await(h==null?void 0:h(b)),Fa(S),S}function gm(e){Dt(e).tlsOnly=!1}async function ub(e,t,n,o,r){if(bo(e),!((r==null?void 0:r.flag)===Xo||t instanceof URL||function(w,C){try{return Object.getPrototypeOf(w)[Symbol.toStringTag]===C}catch{return!1}}(t,"Request")))throw oo('"currentUrl" must be an instance of URL, or Request',za);let i,a;const{as:s,c,auth:u,fetch:d,tlsOnly:f,jarm:p,hybrid:h,nonRepudiation:m,timeout:g,decrypt:y,implicit:b}=Dt(e);if((r==null?void 0:r.flag)===Xo)i=r.authResponse,a=r.redirectUri;else{if(!(t instanceof URL)){const w=t;switch(t=new URL(t.url),w.method){case"GET":break;case"POST":const C=new URLSearchParams(await nE(w));if(h)t.hash=C.toString();else for(const[O,_]of C.entries())t.searchParams.append(O,_);break;default:throw oo("unexpected Request HTTP method",Ba)}}switch(a=function(w){return(w=new URL(w)).search="",w.hash="",w.href}(t),!0){case!!p:i=await p(t,n==null?void 0:n.expectedState);break;case!!h:i=await h(t,n==null?void 0:n.expectedNonce,n==null?void 0:n.expectedState,n==null?void 0:n.maxAge);break;case!!b:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{i=aE(s,c,t.searchParams,n==null?void 0:n.expectedState)}catch(w){Jt(w)}}}const k=await async function(w,C,O,_,N,E,A){if(Dn(w),Mn(C),!Mf.has(_))throw Je('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");bt(N,'"redirectUri"');const j=kr(_,"code");if(!j)throw Ae('no authorization code in "callbackParameters"',Fe);const B=new URLSearchParams(A==null?void 0:A.additionalParameters);return B.set("redirect_uri",N),B.set("code",j),E!==am&&(bt(E,'"codeVerifier"'),B.set("code_verifier",E)),$a(w,C,O,"authorization_code",B,A)}(s,c,u,i,a,(n==null?void 0:n.pkceCodeVerifier)||am,{additionalParameters:o,[zn]:d,[Cn]:!f,DPoP:r==null?void 0:r.DPoP,headers:new Headers(no),signal:zr(g)}).catch(Jt);typeof(n==null?void 0:n.expectedNonce)!="string"&&typeof(n==null?void 0:n.maxAge)!="number"||(n.idTokenExpected=!0);const x=J5(s,c,k,{expectedNonce:n==null?void 0:n.expectedNonce,maxAge:n==null?void 0:n.maxAge,requireIdToken:n==null?void 0:n.idTokenExpected,[to]:y});let S;try{S=await x}catch(w){if(Wa(w,r))return ub(e,void 0,n,o,ke(ke({},r),{},{flag:Xo,authResponse:i,redirectUri:a}));Jt(w)}return S.id_token&&await(m==null?void 0:m(k)),Fa(S),S}async function db(e,t,n,o){bo(e),n=new URLSearchParams(n);const{as:r,c:i,auth:a,fetch:s,tlsOnly:c,nonRepudiation:u,timeout:d,decrypt:f}=Dt(e),p=await async function(g,y,b,k,x){Dn(g),Mn(y),bt(k,'"refreshToken"');const S=new URLSearchParams(x==null?void 0:x.additionalParameters);return S.set("refresh_token",k),$a(g,y,b,"refresh_token",S,x)}(r,i,a,t,{[zn]:s,[Cn]:!c,additionalParameters:n,DPoP:o==null?void 0:o.DPoP,headers:new Headers(no),signal:zr(d)}).catch(Jt),h=async function(g,y,b,k){return ji(g,y,b,void 0,k==null?void 0:k[to],k==null?void 0:k.recognizedTokenTypes)}(r,i,p,{[to]:f});let m;try{m=await h}catch(g){if(Wa(g,o))return db(e,t,n,ke(ke({},o),{},{flag:Xo}));Jt(g)}return m.id_token&&await(u==null?void 0:u(p)),Fa(m),m}async function fb(e,t,n){bo(e),t=new URLSearchParams(t);const{as:o,c:r,auth:i,fetch:a,tlsOnly:s,timeout:c}=Dt(e),u=await async function(p,h,m,g,y){return Dn(p),Mn(h),$a(p,h,m,"client_credentials",new URLSearchParams(g),y)}(o,r,i,t,{[zn]:a,[Cn]:!s,DPoP:n==null?void 0:n.DPoP,headers:new Headers(no),signal:zr(c)}).catch(Jt),d=async function(p,h,m,g){return ji(p,h,m,void 0,g==null?void 0:g[to],g==null?void 0:g.recognizedTokenTypes)}(o,r,u);let f;try{f=await d}catch(p){if(Wa(p,n))return fb(e,t,ke(ke({},n),{},{flag:Xo}));Jt(p)}return Fa(f),f}function pd(e,t){bo(e);const{as:n,c:o,tlsOnly:r,hybrid:i,jarm:a,implicit:s}=Dt(e),c=Ma(n,"authorization_endpoint",!1,r);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id),!t.has("request_uri")&&!t.has("request")){if(t.has("response_type")||t.set("response_type",i?"code id_token":s?"id_token":"code"),s&&!t.has("nonce"))throw oo("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",Ba);a&&t.set("response_mode","jwt")}for(const[u,d]of t.entries())c.searchParams.append(u,d);return c}async function pb(e,t,n){bo(e);const o=pd(e,t),{as:r,c:i,auth:a,fetch:s,tlsOnly:c,timeout:u}=Dt(e),d=await async function(h,m,g,y,b){var k;Dn(h),Mn(m);const x=Ma(h,"pushed_authorization_request_endpoint",m.use_mtls_endpoint_aliases,(b==null?void 0:b[Cn])!==!0),S=new URLSearchParams(y);S.set("client_id",m.client_id);const w=Gc(b==null?void 0:b.headers);w.set("accept","application/json"),(b==null?void 0:b.DPoP)!==void 0&&(Vw(b.DPoP),await b.DPoP.addProof(x,w,"POST"));const C=await Df(h,m,g,x,S,w,b);return b==null||(k=b.DPoP)===null||k===void 0||k.cacheNonce(C,x),C}(r,i,a,o.searchParams,{[zn]:s,[Cn]:!c,DPoP:n==null?void 0:n.DPoP,headers:new Headers(no),signal:zr(u)}).catch(Jt),f=async function(h,m,g){if(Dn(h),Mn(m),!Ti(g,Response))throw Je('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Lf(g,201,"Pushed Authorization Request Endpoint"),Ha(g);const y=await Jc(g);bt(y.request_uri,'"response" body "request_uri" property',Fe,{body:y});let b=typeof y.expires_in!="number"?parseFloat(y.expires_in):y.expires_in;return Yo(b,!0,'"response" body "expires_in" property',Fe,{body:y}),y.expires_in=b,y}(r,i,d);let p;try{p=await f}catch(h){if(Wa(h,n))return pb(e,t,ke(ke({},n),{},{flag:Xo}));Jt(h)}return pd(e,{request_uri:p.request_uri})}function bo(e){if(!(e instanceof sc))throw oo('"config" must be an instance of Configuration',za);if(Object.getPrototypeOf(e)!==sc.prototype)throw oo("subclassing Configuration is not allowed",Ba)}function zr(e){return e?AbortSignal.timeout(1e3*e):void 0}function Wa(e,t){return!(t==null||!t.DPoP||t.flag===Xo)&&function(n){if(n instanceof Rf){const{0:o,length:r}=n.cause;return r===1&&o.scheme==="dpop"&&o.parameters.error==="use_dpop_nonce"}return n instanceof qc&&n.error==="use_dpop_nonce"}(e)}Object.freeze(sc.prototype);const Xo=Symbol();async function zf(e,t,n,o){bo(e);const{as:r,c:i,auth:a,fetch:s,tlsOnly:c,timeout:u,decrypt:d}=Dt(e),f=await async function(p,h,m,g,y,b){return Dn(p),Mn(h),bt(g,'"grantType"'),$a(p,h,m,g,new URLSearchParams(y),b)}(r,i,a,t,new URLSearchParams(n),{[zn]:s,[Cn]:!c,DPoP:o==null?void 0:o.DPoP,headers:new Headers(no),signal:zr(u)}).then(p=>{let h;return t==="urn:ietf:params:oauth:grant-type:token-exchange"&&(h={n_a:()=>{}}),async function(m,g,y,b){return ji(m,g,y,void 0,b==null?void 0:b[to],b==null?void 0:b.recognizedTokenTypes)}(r,i,p,{[to]:d,recognizedTokenTypes:h})}).catch(Jt);return Fa(f),f}async function gE(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(o){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return ob("Key must be ",o,...i)}(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:"SHA-".concat(e.slice(-3)),name:"HMAC"},!1,[n])}return sE(t,e,n),t}async function yE(e,t,n,o){const r=await gE(e,t,"verify");(function(a,s){if(a.startsWith("RS")||a.startsWith("PS")){const{modulusLength:c}=s.algorithm;if(typeof c!="number"||c<2048)throw new TypeError("".concat(a," requires key modulusLength to be 2048 bits or larger"))}})(e,r);const i=function(a,s){const c="SHA-".concat(a.slice(-3));switch(a){case"HS256":case"HS384":case"HS512":return{hash:c,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:c,name:"RSA-PSS",saltLength:parseInt(a.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:c,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:c,name:"ECDSA",namedCurve:s.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:a};default:throw new un("alg ".concat(a," is not supported either by JOSE or your javascript runtime"))}}(e,r.algorithm);try{return await crypto.subtle.verify(i,r,n,o)}catch{return!1}}async function vE(e,t,n){if(!or(e))throw new Tt("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new Tt('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new Tt("JWS Protected Header incorrect type");if(e.payload===void 0)throw new Tt("JWS Payload missing");if(typeof e.signature!="string")throw new Tt("JWS Signature missing or incorrect type");if(e.header!==void 0&&!or(e.header))throw new Tt("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const g=aa(e.protected);o=JSON.parse(Ca.decode(g))}catch{throw new Tt("JWS Protected Header is invalid")}if(!function(){for(var g=arguments.length,y=new Array(g),b=0;b<g;b++)y[b]=arguments[b];const k=y.filter(Boolean);if(k.length===0||k.length===1)return!0;let x;for(const S of k){const w=Object.keys(S);if(x&&x.size!==0)for(const C of w){if(x.has(C))return!1;x.add(C)}else x=new Set(w)}return!0}(o,e.header))throw new Tt("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r=ke(ke({},o),e.header),i=function(g,y,b,k,x){if(x.crit!==void 0&&(k==null?void 0:k.crit)===void 0)throw new g('"crit" (Critical) Header Parameter MUST be integrity protected');if(!k||k.crit===void 0)return new Set;if(!Array.isArray(k.crit)||k.crit.length===0||k.crit.some(w=>typeof w!="string"||w.length===0))throw new g('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let S;S=b!==void 0?new Map([...Object.entries(b),...y.entries()]):y;for(const w of k.crit){if(!S.has(w))throw new un('Extension Header Parameter "'.concat(w,'" is not recognized'));if(x[w]===void 0)throw new g('Extension Header Parameter "'.concat(w,'" is missing'));if(S.get(w)&&k[w]===void 0)throw new g('Extension Header Parameter "'.concat(w,'" MUST be integrity protected'))}return new Set(k.crit)}(Tt,new Map([["b64",!0]]),n==null?void 0:n.crit,o,r);let a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new Tt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=r;if(typeof s!="string"||!s)throw new Tt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&function(g,y){if(y!==void 0&&(!Array.isArray(y)||y.some(b=>typeof b!="string")))throw new TypeError('"'.concat(g,'" option must be an array of strings'));if(y)return new Set(y)}("algorithms",n.algorithms);if(c&&!c.has(s))throw new Qw('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new Tt("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new Tt("JWS Payload must be a string or an Uint8Array instance");let u=!1;typeof t=="function"&&(t=await t(o,e),u=!0),fE(s,t,"verify");const d=function(){for(var g=arguments.length,y=new Array(g),b=0;b<g;b++)y[b]=arguments[b];const k=y.reduce((w,C)=>{let{length:O}=C;return w+O},0),x=new Uint8Array(k);let S=0;for(const w of y)x.set(w,S),S+=w.length;return x}(e.protected!==void 0?Ml(e.protected):new Uint8Array,Ml("."),typeof e.payload=="string"?a?Ml(e.payload):cm.encode(e.payload):e.payload);let f;try{f=aa(e.signature)}catch{throw new Tt("Failed to base64url decode the signature")}const p=await dE(t,s);if(!await yE(s,p,f,d))throw new nb;let h;if(a)try{h=aa(e.payload)}catch{throw new Tt("Failed to base64url decode the payload")}else h=typeof e.payload=="string"?cm.encode(e.payload):e.payload;const m={payload:h};return e.protected!==void 0&&(m.protectedHeader=o),e.header!==void 0&&(m.unprotectedHeader=e.header),u?ke(ke({},m),{},{key:p}):m}const wE=e=>Math.floor(e.getTime()/1e3),bE=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function ym(e){const t=bE.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let o;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(3600*n);break;case"day":case"days":case"d":o=Math.round(86400*n);break;case"week":case"weeks":case"w":o=Math.round(604800*n);break;default:o=Math.round(31557600*n)}return t[1]==="-"||t[4]==="ago"?-o:o}const vm=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase()),xE=(e,t)=>typeof e=="string"?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e)));async function kE(e,t,n){var o;const r=await async function(s,c,u){if(s instanceof Uint8Array&&(s=Ca.decode(s)),typeof s!="string")throw new Tt("Compact JWS must be a string or Uint8Array");const{0:d,1:f,2:p,length:h}=s.split(".");if(h!==3)throw new Tt("Invalid Compact JWS");const m=await vE({payload:f,protected:d,signature:p},c,u),g={payload:m.payload,protectedHeader:m.protectedHeader};return typeof c=="function"?ke(ke({},g),{},{key:m.key}):g}(e,t,n);if((o=r.protectedHeader.crit)!==null&&o!==void 0&&o.includes("b64")&&r.protectedHeader.b64===!1)throw new dd("JWTs MUST NOT use unencoded payload");const i=function(s,c){let u,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{u=JSON.parse(Ca.decode(c))}catch{}if(!or(u))throw new dd("JWT Claims Set must be a top-level JSON object");const{typ:f}=d;if(f&&(typeof s.typ!="string"||vm(s.typ)!==vm(f)))throw new _n('unexpected "typ" JWT header value',u,"typ","check_failed");const{requiredClaims:p=[],issuer:h,subject:m,audience:g,maxTokenAge:y}=d,b=[...p];y!==void 0&&b.push("iat"),g!==void 0&&b.push("aud"),m!==void 0&&b.push("sub"),h!==void 0&&b.push("iss");for(const w of new Set(b.reverse()))if(!(w in u))throw new _n('missing required "'.concat(w,'" claim'),u,w,"missing");if(h&&!(Array.isArray(h)?h:[h]).includes(u.iss))throw new _n('unexpected "iss" claim value',u,"iss","check_failed");if(m&&u.sub!==m)throw new _n('unexpected "sub" claim value',u,"sub","check_failed");if(g&&!xE(u.aud,typeof g=="string"?[g]:g))throw new _n('unexpected "aud" claim value',u,"aud","check_failed");let k;switch(typeof d.clockTolerance){case"string":k=ym(d.clockTolerance);break;case"number":k=d.clockTolerance;break;case"undefined":k=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:x}=d,S=wE(x||new Date);if((u.iat!==void 0||y)&&typeof u.iat!="number")throw new _n('"iat" claim must be a number',u,"iat","invalid");if(u.nbf!==void 0){if(typeof u.nbf!="number")throw new _n('"nbf" claim must be a number',u,"nbf","invalid");if(u.nbf>S+k)throw new _n('"nbf" claim timestamp check failed',u,"nbf","check_failed")}if(u.exp!==void 0){if(typeof u.exp!="number")throw new _n('"exp" claim must be a number',u,"exp","invalid");if(u.exp<=S-k)throw new ud('"exp" claim timestamp check failed',u,"exp","check_failed")}if(y){const w=S-u.iat;if(w-k>(typeof y=="number"?y:ym(y)))throw new ud('"iat" claim timestamp check failed (too far in the past)',u,"iat","check_failed");if(w<0-k)throw new _n('"iat" claim timestamp check failed (it should be in the past)',u,"iat","check_failed")}return u}(r.protectedHeader,r.payload,n),a={payload:i,protectedHeader:r.protectedHeader};return typeof t=="function"?ke(ke({},a),{},{key:r.key}):a}function SE(e){return or(e)}var ds,Fl,fs=new WeakMap,Wl=new WeakMap;class CE{constructor(t){if(Ct(this,fs,void 0),Ct(this,Wl,new WeakMap),!function(n){return n&&typeof n=="object"&&Array.isArray(n.keys)&&n.keys.every(SE)}(t))throw new Hf("JSON Web Key Set malformed");lt(fs,this,structuredClone(t))}jwks(){return ue(fs,this)}async getKey(t,n){const{alg:o,kid:r}=ke(ke({},t),n==null?void 0:n.header),i=function(u){switch(typeof u=="string"&&u.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new un('Unsupported "alg" value for a JSON Web Key Set')}}(o),a=ue(fs,this).keys.filter(u=>{let d=i===u.kty;if(d&&typeof r=="string"&&(d=r===u.kid),!d||typeof u.alg!="string"&&i!=="AKP"||(d=o===u.alg),d&&typeof u.use=="string"&&(d=u.use==="sig"),d&&Array.isArray(u.key_ops)&&(d=u.key_ops.includes("verify")),d)switch(o){case"ES256":d=u.crv==="P-256";break;case"ES384":d=u.crv==="P-384";break;case"ES512":d=u.crv==="P-521";break;case"Ed25519":case"EdDSA":d=u.crv==="Ed25519"}return d}),{0:s,length:c}=a;if(c===0)throw new Bf;if(c!==1){const u=new eb,d=ue(Wl,this);throw u[Symbol.asyncIterator]=P5(function*(){for(const f of a)try{yield yield A5(wm(d,f,o))}catch{}}),u}return wm(ue(Wl,this),s,o)}}async function wm(e,t,n){const o=e.get(t)||e.set(t,{}).get(t);if(o[n]===void 0){const r=await async function(i,a,s){var c;if(!or(i))throw new TypeError("JWK must be an object");let u;switch(a!=null||(a=i.alg),u!=null||(u=(c=s==null?void 0:s.extractable)!==null&&c!==void 0?c:i.ext),i.kty){case"oct":if(typeof i.k!="string"||!i.k)throw new TypeError('missing "k" (Key Value) Parameter value');return aa(i.k);case"RSA":if("oth"in i&&i.oth!==void 0)throw new un('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return _s(ke(ke({},i),{},{alg:a,ext:u}));case"AKP":if(typeof i.alg!="string"||!i.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(a!==void 0&&a!==i.alg)throw new TypeError("JWK alg and alg option value mismatch");return _s(ke(ke({},i),{},{ext:u}));case"EC":case"OKP":return _s(ke(ke({},i),{},{alg:a,ext:u}));default:throw new un('Unsupported "kty" (Key Type) Parameter value')}}(ke(ke({},t),{},{ext:!0}),n);if(r instanceof Uint8Array||r.type!=="public")throw new Hf("JSON Web Key Set members must be public keys");o[n]=r}return o[n]}function bm(e){const t=new CE(e),n=async(o,r)=>t.getKey(o,r);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let hd;if(typeof navigator>"u"||(ds=navigator.userAgent)===null||ds===void 0||(Fl=ds.startsWith)===null||Fl===void 0||!Fl.call(ds,"Mozilla/5.0 ")){const e="v6.1.3";hd="".concat("jose","/").concat(e)}const hb=Symbol(),Ul=Symbol();var Vl=new WeakMap,Kl=new WeakMap,Gl=new WeakMap,ps=new WeakMap,fr=new WeakMap,co=new WeakMap,_o=new WeakMap,ql=new WeakMap,pr=new WeakMap,hr=new WeakMap;class EE{constructor(t,n){if(Ct(this,Vl,void 0),Ct(this,Kl,void 0),Ct(this,Gl,void 0),Ct(this,ps,void 0),Ct(this,fr,void 0),Ct(this,co,void 0),Ct(this,_o,void 0),Ct(this,ql,void 0),Ct(this,pr,void 0),Ct(this,hr,void 0),!(t instanceof URL))throw new TypeError("url must be an instance of URL");var o,r;lt(Vl,this,new URL(t.href)),lt(Kl,this,typeof(n==null?void 0:n.timeoutDuration)=="number"?n==null?void 0:n.timeoutDuration:5e3),lt(Gl,this,typeof(n==null?void 0:n.cooldownDuration)=="number"?n==null?void 0:n.cooldownDuration:3e4),lt(ps,this,typeof(n==null?void 0:n.cacheMaxAge)=="number"?n==null?void 0:n.cacheMaxAge:6e5),lt(_o,this,new Headers(n==null?void 0:n.headers)),hd&&!ue(_o,this).has("User-Agent")&&ue(_o,this).set("User-Agent",hd),ue(_o,this).has("accept")||(ue(_o,this).set("accept","application/json"),ue(_o,this).append("accept","application/jwk-set+json")),lt(ql,this,n==null?void 0:n[hb]),(n==null?void 0:n[Ul])!==void 0&&(lt(hr,this,n==null?void 0:n[Ul]),o=n==null?void 0:n[Ul],r=ue(ps,this),typeof o=="object"&&o!==null&&"uat"in o&&typeof o.uat=="number"&&!(Date.now()-o.uat>=r)&&"jwks"in o&&or(o.jwks)&&Array.isArray(o.jwks.keys)&&Array.prototype.every.call(o.jwks.keys,or)&&(lt(fr,this,ue(hr,this).uat),lt(pr,this,bm(ue(hr,this).jwks))))}pendingFetch(){return!!ue(co,this)}coolingDown(){return typeof ue(fr,this)=="number"&&Date.now()<ue(fr,this)+ue(Gl,this)}fresh(){return typeof ue(fr,this)=="number"&&Date.now()<ue(fr,this)+ue(ps,this)}jwks(){var t;return(t=ue(pr,this))===null||t===void 0?void 0:t.jwks()}async getKey(t,n){ue(pr,this)&&this.fresh()||await this.reload();try{return await ue(pr,this).call(this,t,n)}catch(o){if(o instanceof Bf&&this.coolingDown()===!1)return await this.reload(),ue(pr,this).call(this,t,n);throw o}}async reload(){ue(co,this)&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel")&<(co,this,void 0),ue(co,this)||lt(co,this,async function(t,n,o){const i=await(arguments.length>3&&arguments[3]!==void 0?arguments[3]:fetch)(t,{method:"GET",signal:o,redirect:"manual",headers:n}).catch(a=>{throw a.name==="TimeoutError"?new tb:a});if(i.status!==200)throw new $t("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new $t("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(ue(Vl,this).href,ue(_o,this),AbortSignal.timeout(ue(Kl,this)),ue(ql,this)).then(t=>{lt(pr,this,bm(t)),ue(hr,this)&&(ue(hr,this).uat=Date.now(),ue(hr,this).jwks=t),lt(fr,this,Date.now()),lt(co,this,void 0)}).catch(t=>{throw lt(co,this,void 0),t})),await ue(co,this)}}const jE=["mfaToken"],_E=["mfaToken"];var mr,hs,gr,Po,ii,Xe,Ki,yt,xm=class extends Error{constructor(e,t){super(t),he(this,"code",void 0),this.name="NotSupportedError",this.code=e}},xo=class extends Error{constructor(e,t,n){super(t),he(this,"cause",void 0),he(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},OE=class extends xo{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},AE=class extends xo{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},PE=class extends xo{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Jl=class extends xo{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},Kn=class extends xo{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Oo=class extends Error{constructor(e){super(e),he(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Zl=class extends xo{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),he(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},NE=class extends xo{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},TE=class extends xo{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},IE=class extends xo{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},RE=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),he(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function md(e){return Object.entries(e).filter(t=>{let[,n]=t;return n!==void 0}).reduce((t,n)=>ke(ke({},t),{},{[n[0]]:n[1]}),{})}var Zc=class extends Error{constructor(e,t,n){super(t),he(this,"cause",void 0),he(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},mb=class extends Zc{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},gb=class extends Zc{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},LE=class extends Zc{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},yb=class extends Zc{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function DE(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var ME=(mr=new WeakMap,hs=new WeakMap,gr=new WeakMap,class{constructor(e){var t;Ct(this,mr,void 0),Ct(this,hs,void 0),Ct(this,gr,void 0),lt(mr,this,"https://".concat(e.domain)),lt(hs,this,e.clientId),lt(gr,this,(t=e.customFetch)!==null&&t!==void 0?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(ue(mr,this),"/mfa/authenticators"),{mfaToken:n}=e,o=await ue(gr,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const r=await o.json();throw new mb(r.error_description||"Failed to list authenticators",r)}return(await o.json()).map(DE)}async enrollAuthenticator(e){const t="".concat(ue(mr,this),"/mfa/associate"),{mfaToken:n}=e,o=nm(e,jE),r={authenticator_types:o.authenticatorTypes};"oobChannels"in o&&(r.oob_channels=o.oobChannels),"phoneNumber"in o&&o.phoneNumber&&(r.phone_number=o.phoneNumber),"email"in o&&o.email&&(r.email=o.email);const i=await ue(gr,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new gb(a.error_description||"Failed to enroll authenticator",a)}return function(a){if(a.authenticator_type==="otp")return{authenticatorType:"otp",secret:a.secret,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes,id:a.id};if(a.authenticator_type==="oob")return{authenticatorType:"oob",oobChannel:a.oob_channel,oobCode:a.oob_code,bindingMethod:a.binding_method,id:a.id};throw new Error("Unexpected authenticator type: ".concat(a.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,o="".concat(ue(mr,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),r=await ue(gr,this).call(this,o,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const i=await r.json();throw new LE(i.error_description||"Failed to delete authenticator",i)}}async challengeAuthenticator(e){const t="".concat(ue(mr,this),"/mfa/challenge"),{mfaToken:n}=e,o=nm(e,_E),r={mfa_token:n,client_id:ue(hs,this),challenge_type:o.challengeType};o.authenticatorId&&(r.authenticator_id=o.authenticatorId);const i=await ue(gr,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new yb(a.error_description||"Failed to challenge authenticator",a)}return function(a){const s={challengeType:a.challenge_type};return a.oob_code!==void 0&&(s.oobCode=a.oob_code),a.binding_method!==void 0&&(s.bindingMethod=a.binding_method),s}(await i.json())}}),Cr=class vb{constructor(t,n,o,r,i,a,s){he(this,"accessToken",void 0),he(this,"idToken",void 0),he(this,"refreshToken",void 0),he(this,"expiresAt",void 0),he(this,"scope",void 0),he(this,"claims",void 0),he(this,"authorizationDetails",void 0),he(this,"tokenType",void 0),he(this,"issuedTokenType",void 0),this.accessToken=t,this.idToken=o,this.refreshToken=r,this.expiresAt=n,this.scope=i,this.claims=a,this.authorizationDetails=s}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,o=new vb(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return o.tokenType=t.token_type,o.issuedTokenType=t.issued_token_type,o}},gd="openid profile email offline_access",$E=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function wb(e){if(e==null)throw new Kn("subject_token is required");if(typeof e!="string")throw new Kn("subject_token must be a string");if(e.trim().length===0)throw new Kn("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new Kn("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new Kn("subject_token must not include the 'Bearer ' prefix")}function bb(e,t){if(t){for(const[n,o]of Object.entries(t))if(!$E.has(n))if(Array.isArray(o)){if(o.length>20)throw new Kn("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));o.forEach(r=>{e.append(n,r)})}else e.append(n,o)}}var HE=(Po=new WeakMap,ii=new WeakMap,Xe=new WeakMap,Ki=new WeakMap,yt=new WeakSet,class{constructor(e){if(function(t,n){Hw(t,n),n.add(t)}(this,yt),Ct(this,Po,void 0),Ct(this,ii,void 0),Ct(this,Xe,void 0),Ct(this,Ki,void 0),he(this,"mfa",void 0),lt(Xe,this,e),e.useMtls&&!e.customFetch)throw new xm("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");this.mfa=new ME({domain:ue(Xe,this).domain,clientId:ue(Xe,this).clientId,customFetch:ue(Xe,this).customFetch})}async buildAuthorizationUrl(e){const{serverMetadata:t}=await vt(yt,this,yn).call(this);if(e!=null&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new xm("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await vt(yt,this,Yl).call(this,e)}catch(n){throw new NE(n)}}async buildLinkUserUrl(e){try{const t=await vt(yt,this,Yl).call(this,{authorizationParams:ke(ke({},e.authorizationParams),{},{requested_connection:e.connection,requested_connection_scope:e.connectionScope,scope:"openid link_account offline_access",id_token_hint:e.idToken})});return{linkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(t){throw new TE(t)}}async buildUnlinkUserUrl(e){try{const t=await vt(yt,this,Yl).call(this,{authorizationParams:ke(ke({},e.authorizationParams),{},{requested_connection:e.connection,scope:"openid unlink_account",id_token_hint:e.idToken})});return{unlinkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(t){throw new IE(t)}}async backchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await vt(yt,this,yn).call(this),o=md(ke(ke({},ue(Xe,this).authorizationParams),e==null?void 0:e.authorizationParams)),r=new URLSearchParams(ke(ke({scope:gd},o),{},{client_id:ue(Xe,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const i=await mm(t,r),a=await lb(t,i);return Cr.fromTokenEndpointResponse(a)}catch(i){throw new Zl(i)}}async initiateBackchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await vt(yt,this,yn).call(this),o=md(ke(ke({},ue(Xe,this).authorizationParams),e==null?void 0:e.authorizationParams)),r=new URLSearchParams(ke(ke({scope:gd},o),{},{client_id:ue(Xe,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const i=await mm(t,r);return{authReqId:i.auth_req_id,expiresIn:i.expires_in,interval:i.interval}}catch(i){throw new Zl(i)}}async backchannelAuthenticationGrant(e){let{authReqId:t}=e;const{configuration:n}=await vt(yt,this,yn).call(this),o=new URLSearchParams({auth_req_id:t});try{const r=await zf(n,"urn:openid:params:grant-type:ciba",o);return Cr.fromTokenEndpointResponse(r)}catch(r){throw new Zl(r)}}async getTokenForConnection(e){var t;if(e.refreshToken&&e.accessToken)throw new Jl("Either a refresh or access token should be specified, but not both.");const n=(t=e.accessToken)!==null&&t!==void 0?t:e.refreshToken;if(!n)throw new Jl("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:e.connection,subjectToken:n,subjectTokenType:e.accessToken?"urn:ietf:params:oauth:token-type:access_token":"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint})}catch(o){throw o instanceof Kn?new Jl(o.message,o.cause):o}}async exchangeToken(e){return"connection"in e?vt(yt,this,BE).call(this,e):vt(yt,this,zE).call(this,e)}async getTokenByCode(e,t){const{configuration:n}=await vt(yt,this,yn).call(this);try{const o=await ub(n,e,{pkceCodeVerifier:t.codeVerifier});return Cr.fromTokenEndpointResponse(o)}catch(o){throw new OE("There was an error while trying to request a token.",o)}}async getTokenByRefreshToken(e){const{configuration:t}=await vt(yt,this,yn).call(this);try{const n=await db(t,e.refreshToken);return Cr.fromTokenEndpointResponse(n)}catch(n){throw new PE("The access token has expired and there was an error while trying to refresh it.",n)}}async getTokenByClientCredentials(e){const{configuration:t}=await vt(yt,this,yn).call(this);try{const n=new URLSearchParams({audience:e.audience});e.organization&&n.append("organization",e.organization);const o=await fb(t,n);return Cr.fromTokenEndpointResponse(o)}catch(n){throw new AE("There was an error while trying to request a token.",n)}}async buildLogoutUrl(e){const{configuration:t,serverMetadata:n}=await vt(yt,this,yn).call(this);if(!n.end_session_endpoint){const o=new URL("https://".concat(ue(Xe,this).domain,"/v2/logout"));return o.searchParams.set("returnTo",e.returnTo),o.searchParams.set("client_id",ue(Xe,this).clientId),o}return function(o,r){bo(o);const{as:i,c:a,tlsOnly:s}=Dt(o),c=Ma(i,"end_session_endpoint",!1,s);(r=new URLSearchParams(r)).has("client_id")||r.set("client_id",a.client_id);for(const[u,d]of r.entries())c.searchParams.append(u,d);return c}(t,{post_logout_redirect_uri:e.returnTo})}async verifyLogoutToken(e){const{serverMetadata:t}=await vt(yt,this,yn).call(this);ue(Ki,this)||lt(Ki,this,function(o,r){const i=new EE(o,r),a=async(s,c)=>i.getKey(s,c);return Object.defineProperties(a,{coolingDown:{get:()=>i.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>i.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>i.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>i.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>i.jwks(),enumerable:!0,configurable:!1,writable:!1}}),a}(new URL(t.jwks_uri),{[hb]:ue(Xe,this).customFetch}));const{payload:n}=await kE(e.logoutToken,ue(Ki,this),{issuer:t.issuer,audience:ue(Xe,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]});if(!("sid"in n)&&!("sub"in n))throw new Oo('either "sid" or "sub" (or both) claims must be present');if("sid"in n&&typeof n.sid!="string")throw new Oo('"sid" claim must be a string');if("sub"in n&&typeof n.sub!="string")throw new Oo('"sub" claim must be a string');if("nonce"in n)throw new Oo('"nonce" claim is prohibited');if(!("events"in n))throw new Oo('"events" claim is missing');if(typeof n.events!="object"||n.events===null)throw new Oo('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in n.events))throw new Oo('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if(typeof n.events["http://schemas.openid.net/event/backchannel-logout"]!="object")throw new Oo('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:n.sid,sub:n.sub}}});async function yn(){if(ue(Po,this)&&ue(ii,this))return{configuration:ue(Po,this),serverMetadata:ue(ii,this)};const e=await vt(yt,this,FE).call(this);return lt(Po,this,await mE(new URL("https://".concat(ue(Xe,this).domain)),ue(Xe,this).clientId,{use_mtls_endpoint_aliases:ue(Xe,this).useMtls},e,{[Uo]:ue(Xe,this).customFetch})),lt(ii,this,ue(Po,this).serverMetadata()),ue(Po,this)[Uo]=ue(Xe,this).customFetch||fetch,{configuration:ue(Po,this),serverMetadata:ue(ii,this)}}async function BE(e){var t,n;const{configuration:o}=await vt(yt,this,yn).call(this);if("audience"in e||"resource"in e)throw new Kn("audience and resource parameters are not supported for Token Vault exchanges");wb(e.subjectToken);const r=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:(t=e.subjectTokenType)!==null&&t!==void 0?t:"urn:ietf:params:oauth:token-type:access_token",requested_token_type:(n=e.requestedTokenType)!==null&&n!==void 0?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&r.append("login_hint",e.loginHint),e.scope&&r.append("scope",e.scope),bb(r,e.extra);try{const i=await zf(o,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",r);return Cr.fromTokenEndpointResponse(i)}catch(i){throw new Kn("Failed to exchange token for connection '".concat(e.connection,"'."),i)}}async function zE(e){const{configuration:t}=await vt(yt,this,yn).call(this);wb(e.subjectToken);const n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),bb(n,e.extra);try{const o=await zf(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return Cr.fromTokenEndpointResponse(o)}catch(o){throw new Kn("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),o)}}async function FE(){if(!ue(Xe,this).clientSecret&&!ue(Xe,this).clientAssertionSigningKey&&!ue(Xe,this).useMtls)throw new RE;if(ue(Xe,this).useMtls)return(t,n,o,r)=>{o.set("client_id",n.client_id)};let e=ue(Xe,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await async function(t,n,o){if(typeof t!="string"||t.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return uE(t,n,o)}(e,ue(Xe,this).clientAssertionSigningAlg||"RS256")),e?function(t,n){return M5(t,n)}(e):ab(ue(Xe,this).clientSecret)}async function Yl(e){const{configuration:t}=await vt(yt,this,yn).call(this),n=hE(),o=await pE(n),r=md(ke(ke({},ue(Xe,this).authorizationParams),e==null?void 0:e.authorizationParams)),i=new URLSearchParams(ke(ke({scope:gd},r),{},{client_id:ue(Xe,this).clientId,code_challenge:o,code_challenge_method:"S256"}));return{authorizationUrl:e!=null&&e.pushedAuthorizationRequests?await pb(t,i):await pd(t,i),codeVerifier:n}}class rr extends ut{constructor(t,n){super(t,n),Object.setPrototypeOf(this,rr.prototype)}static fromPayload(t){let{error:n,error_description:o}=t;return new rr(n,o)}}class cc extends rr{constructor(t,n){super(t,n),Object.setPrototypeOf(this,cc.prototype)}}class Ff extends rr{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Ff.prototype)}}class Wf extends rr{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Wf.prototype)}}class ai extends rr{constructor(t,n){super(t,n),Object.setPrototypeOf(this,ai.prototype)}}class Uf extends rr{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Uf.prototype)}}class WE{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=t}set(t,n){this.cleanup(),this.contexts.set(t,Object.assign(Object.assign({},n),{createdAt:Date.now()}))}get(t){const n=this.contexts.get(t);if(n){if(!(Date.now()-n.createdAt>this.ttlMs))return n;this.contexts.delete(t)}}remove(t){this.contexts.delete(t)}cleanup(){const t=Date.now();for(const[n,o]of this.contexts)t-o.createdAt>this.ttlMs&&this.contexts.delete(n)}get size(){return this.contexts.size}}class UE{constructor(t,n){this.authJsMfaClient=t,this.auth0Client=n,this.contextManager=new WE}setMFAAuthDetails(t,n,o,r){this.contextManager.set(t,{scope:n,audience:o,mfaRequirements:r})}async getAuthenticators(t){var n,o;const r=this.contextManager.get(t);if(!(!((n=r==null?void 0:r.mfaRequirements)===null||n===void 0)&&n.challenge)||r.mfaRequirements.challenge.length===0)throw new cc("invalid_request","challengeType is required and must contain at least one challenge type, please check mfa_required error payload");const i=r.mfaRequirements.challenge.map(a=>a.type);try{return(await this.authJsMfaClient.listAuthenticators({mfaToken:t})).filter(a=>!!a.type&&i.includes(a.type))}catch(a){throw a instanceof mb?new cc((o=a.cause)===null||o===void 0?void 0:o.error,a.message):a}}async enroll(t){var n;const o=function(r){const i=E5[r.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:r.mfaToken,authenticatorTypes:i.authenticatorTypes},i.oobChannels&&{oobChannels:i.oobChannels}),"phoneNumber"in r&&{phoneNumber:r.phoneNumber}),"email"in r&&{email:r.email})}(t);try{return await this.authJsMfaClient.enrollAuthenticator(o)}catch(r){throw r instanceof gb?new Ff((n=r.cause)===null||n===void 0?void 0:n.error,r.message):r}}async challenge(t){var n;try{const o={challengeType:t.challengeType,mfaToken:t.mfaToken};return t.authenticatorId&&(o.authenticatorId=t.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(o)}catch(o){throw o instanceof yb?new Wf((n=o.cause)===null||n===void 0?void 0:n.error,o.message):o}}async getEnrollmentFactors(t){const n=this.contextManager.get(t);if(!n||!n.mfaRequirements)throw new Uf("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return n.mfaRequirements.enroll&&n.mfaRequirements.enroll.length!==0?n.mfaRequirements.enroll:[]}async verify(t){const n=this.contextManager.get(t.mfaToken);if(!n)throw new ai("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const o=function(a){return"otp"in a&&a.otp?j5:"oobCode"in a&&a.oobCode?_5:"recoveryCode"in a&&a.recoveryCode?O5:void 0}(t);if(!o)throw new ai("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const r=n.scope,i=n.audience;try{const a=await this.auth0Client._requestTokenForMfa({grant_type:o,mfaToken:t.mfaToken,scope:r,audience:i,otp:t.otp,oob_code:t.oobCode,binding_code:t.bindingCode,recovery_code:t.recoveryCode});return this.contextManager.remove(t.mfaToken),a}catch(a){if(a instanceof Da)this.setMFAAuthDetails(a.mfa_token,r,i,a.mfa_requirements);else if(a instanceof ai)throw new ai(a.error,a.error_description);throw a}}}const Gi=new FC;class VE{constructor(t){let n,o;if(this.userCache=new Rw().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const d of u)await Gi.releaseLock(d);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!ec())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(ec().subtle===void 0)throw new Error(`
|
|
56
56
|
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
|
|
57
|
-
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)o=t.cache;else{if(n=t.cacheLocation||"memory",!qh(n))throw new Error('Invalid cache location "'.concat(n,'"'));o=qh(n)()}var r;this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Xr:u5,this.orgHintCookieName=(r=this.options.clientId,"auth0.".concat(r,".organization_hint")),this.isAuthenticatedCookieName=(u=>"auth0.".concat(u,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const i=t.useCookiesForTransactions?this.cookieStorage:d5;var a;this.scope=function(u,d){for(var f=arguments.length,p=new Array(f>2?f-2:0),h=2;h<f;h++)p[h-2]=arguments[h];if(typeof u!="object")return{default:Es(d,u,...p)};let m={default:Es(d,...p)};return Object.keys(u).forEach(g=>{const y=u[g];m[g]=Es(d,y,...p)}),m}(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new r5(i,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Ew,this.cacheManager=new o5(o,o.allKeys?void 0:new h5(o,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new y5(this.options.clientId):void 0,this.domainUrl=(a=this.options.domain,/^https?:\/\//.test(a)?a:"https://".concat(a)),this.tokenIssuer=((u,d)=>u?u.startsWith("https://")?u:"https://".concat(u,"/"):"".concat(d,"/"))(this.options.issuer,this.domainUrl);const s="".concat(this.domainUrl,"/me/"),c=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:s},detailedResponse:!0})}));this.myAccountApi=new w5(c,s),this.authJsClient=new RE({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new HE(this.authJsClient.mfa,this),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new p5)}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(t){const n=this.options.auth0Client||Cw,o=jw(n,!0),r=encodeURIComponent(btoa(JSON.stringify(o)));return"".concat(this.domainUrl).concat(t,"&auth0Client=").concat(r)}_authorizeUrl(t){return this._url("/authorize?".concat(Zu(t)))}async _verifyIdToken(t,n,o){const r=await this.nowProvider();return a5({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,organization:o,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:r});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,o){var r;const i=jl(Wi()),a=jl(Wi()),s=Wi(),c=await Bh(s),u=Fh(c),d=await((r=this.dpop)===null||r===void 0?void 0:r.calculateThumbprint()),f=((h,m,g,y,b,k,x,S,w)=>Object.assign(Object.assign(Object.assign({client_id:h.clientId},h.authorizationParams),g),{scope:as(m,g.scope,g.audience),response_type:"code",response_mode:S||"query",state:y,nonce:b,redirect_uri:x||h.authorizationParams.redirect_uri,code_challenge:k,code_challenge_method:"S256",dpop_jkt:w}))(this.options,this.scope,t,i,a,u,t.redirect_uri||this.options.authorizationParams.redirect_uri||o,n==null?void 0:n.response_mode,d),p=this._authorizeUrl(f);return{nonce:a,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:p}}async loginWithPopup(t,n){var o;if(t=t||{},!(n=n||{}).popup&&(n.popup=(s=>{const c=window.screenX+(window.innerWidth-400)/2,u=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup","left=".concat(c,",top=").concat(u,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(""),!n.popup))throw new Ef;const r=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=r.url;const i=await(s=>new Promise((c,u)=>{let d;const f=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(p),window.removeEventListener("message",d,!1),u(new Cf(s.popup)))},1e3),p=setTimeout(()=>{clearInterval(f),u(new Sf(s.popup)),window.removeEventListener("message",d,!1)},1e3*(s.timeoutInSeconds||60));d=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(f),window.removeEventListener("message",d,!1),s.closePopup!==!1&&s.popup.close(),h.data.response.error)return u(ut.fromPayload(h.data.response));c(h.data.response)}},window.addEventListener("message",d)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==i.state)throw new ut("state_mismatch","Invalid state");const a=((o=t.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(){var t;const n=Jh(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),{openUrl:o,fragment:r,appState:i}=n,a=On(n,["openUrl","fragment","appState"]),s=((t=a.authorizationParams)===null||t===void 0?void 0:t.organization)||this.options.authorizationParams.organization,c=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:u}=c,d=On(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:i,response_type:Mo.Code}),s&&{organization:s}));const f=r?"".concat(u,"#").concat(r):u;o?await o(f):window.location.assign(f)}async handleRedirectCallback(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location.href).split("?").slice(1);if(t.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new ut("missing_transaction","Invalid state");this.transactionManager.remove();const o=(r=>{r.indexOf("#")>-1&&(r=r.substring(0,r.indexOf("#")));const i=new URLSearchParams(r);return{state:i.get("state"),code:i.get("code")||void 0,connect_code:i.get("connect_code")||void 0,error:i.get("error")||void 0,error_description:i.get("error_description")||void 0}})(t.join(""));return n.response_type===Mo.ConnectCode?this._handleConnectAccountRedirectCallback(o,n):this._handleLoginRedirectCallback(o,n)}async _handleLoginRedirectCallback(t,n){const{code:o,state:r,error:i,error_description:a}=t;if(i)throw new xf(i,a||i,r,n.appState);if(!n.code_verifier||n.state&&n.state!==r)throw new ut("state_mismatch","Invalid state");const s=n.organization,c=n.nonce,u=n.redirect_uri;return await this._requestToken(Object.assign({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:o},u?{redirect_uri:u}:{}),{nonceIn:c,organization:s}),{appState:n.appState,response_type:Mo.Code}}async _handleConnectAccountRedirectCallback(t,n){const{connect_code:o,state:r,error:i,error_description:a}=t;if(i)throw new kf(i,a||i,n.connection,r,n.appState);if(!o)throw new ut("missing_connect_code","Missing connect code");if(!(n.code_verifier&&n.state&&n.auth_session&&n.redirect_uri&&n.state===r))throw new ut("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:n.auth_session,connect_code:o,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier});return Object.assign(Object.assign({},s),{appState:n.appState,response_type:Mo.ConnectCode})}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n,o;const r=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:as(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,((o=t.authorizationParams)===null||o===void 0?void 0:o.audience)||this.options.authorizationParams.audience)})}),i=await((a,s)=>{let c=Ol[s];return c||(c=a().finally(()=>{delete Ol[s],c=null}),Ol[s]=c),c})(()=>this._getTokenSilently(r),"".concat(this.options.clientId,"::").concat(r.authorizationParams.audience,"::").concat(r.authorizationParams.scope));return t.detailedResponse?i:i==null?void 0:i.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,o=On(t,["cacheMode"]);if(n!=="off"){const s=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:n});if(s)return s}if(n==="cache-only")return;const r=(i=this.options.clientId,a=o.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(i,".").concat(a));var i,a;if(!await Gh(()=>Gi.acquireLock(r,5e3),10))throw new fi;this.activeLockKeys.add(r),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(n!=="off"){const h=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(h)return h}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:c,token_type:u,access_token:d,oauthTokenScope:f,expires_in:p}=s;return Object.assign(Object.assign({id_token:c,token_type:u,access_token:d},f?{scope:f}:null),{expires_in:p})}finally{await Gi.releaseLock(r),this.activeLockKeys.delete(r),this.activeLockKeys.size===0&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var o,r;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:as(this.scope,(o=t.authorizationParams)===null||o===void 0?void 0:o.scope,((r=t.authorizationParams)===null||r===void 0?void 0:r.audience)||this.options.authorizationParams.audience)})});return n=Object.assign(Object.assign({},$C),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new vn({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:o}=n,r=On(n,["federated"]),i=o?"&federated":"";return this._url("/v2/logout?".concat(Zu(Object.assign({clientId:t.clientId},r))))+i}async logout(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n;const o=Jh(t),{openUrl:r}=o,i=On(o,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await((n=this.dpop)===null||n===void 0?void 0:n.clear());const a=this._buildLogoutUrl(i);r?await r(a):r!==!1&&window.location.assign(a)}async _getTokenFromIFrame(t){const n=(o=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(o));var o;if(!await Gh(()=>Gi.acquireLock(n,5e3),10))throw new fi;try{const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),i=this.cookieStorage.get(this.orgHintCookieName);i&&!r.organization&&(r.organization=i);const{url:a,state:s,nonce:c,code_verifier:u,redirect_uri:d,scope:f,audience:p}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new ut("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const h=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let m;try{m=new URL(this.domainUrl).origin}catch{m=this.domainUrl}const g=await function(b,k){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60;return new Promise((S,w)=>{const C=window.document.createElement("iframe");C.setAttribute("width","0"),C.setAttribute("height","0"),C.style.display="none";const O=()=>{window.document.body.contains(C)&&(window.document.body.removeChild(C),window.removeEventListener("message",_,!1))};let _;const N=setTimeout(()=>{w(new fi),O()},1e3*x);_=function(E){if(E.origin!=k||!E.data||E.data.type!=="authorization_response")return;const A=E.source;A&&A.close(),E.data.response.error?w(ut.fromPayload(E.data.response)):S(E.data.response),clearTimeout(N),window.removeEventListener("message",_,!1),setTimeout(O,2e3)},window.addEventListener("message",_,!1),window.document.body.appendChild(C),C.setAttribute("src",b)})}(a,m,h);if(s!==g.state)throw new ut("state_mismatch","Invalid state");const y=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:u,code:g.code,grant_type:"authorization_code",redirect_uri:d,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:c,organization:r.organization});return Object.assign(Object.assign({},y),{scope:f,oauthTokenScope:y.scope,audience:p})}catch(r){throw r.error==="login_required"&&this.logout({openUrl:!1}),r}finally{await Gi.releaseLock(n)}}async _getTokenUsingRefreshToken(t){var n,o;const r=await this.cacheManager.get(new vn({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new Fc(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const i=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null,s=((p,h,m,g)=>{var y;if(p&&m&&g){if(h.audience!==m)return h.scope;const b=g.split(" "),k=((y=h.scope)===null||y===void 0?void 0:y.split(" "))||[],x=k.every(S=>b.includes(S));return b.length>=k.length&&x?g:h.scope}return h.scope})(this.options.useMrrt,t.authorizationParams,r==null?void 0:r.audience,r==null?void 0:r.scope);try{const p=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:i}),a&&{timeout:a}),{scopesToRequest:s});if(p.refresh_token&&(r!=null&&r.refresh_token)&&await this.cacheManager.updateEntry(r.refresh_token,p.refresh_token),this.options.useMrrt&&(c=r==null?void 0:r.audience,u=r==null?void 0:r.scope,d=t.authorizationParams.audience,f=t.authorizationParams.scope,(c!==d||!Zh(f,u))&&!Zh(s,p.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);await this.cacheManager.remove(this.options.clientId,t.authorizationParams.audience,t.authorizationParams.scope);const h=((m,g)=>{const y=(m==null?void 0:m.split(" "))||[],b=(g==null?void 0:g.split(" "))||[];return y.filter(k=>b.indexOf(k)==-1).join(",")})(s,p.scope);throw new jf(t.authorizationParams.audience||"default",h)}return Object.assign(Object.assign({},p),{scope:t.authorizationParams.scope,oauthTokenScope:p.scope,audience:t.authorizationParams.audience||"default"})}catch(p){if(p.message){if(p.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),p;if((p.message.includes("Missing Refresh Token")||p.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t)}throw p instanceof La&&this.mfa.setMFAAuthDetails(p.mfa_token,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,(o=t.authorizationParams)===null||o===void 0?void 0:o.audience,p.mfa_requirements),p}var c,u,d,f}async _saveEntryInCache(t){const{id_token:n,decodedToken:o}=t,r=On(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=this.scope[t],o=await this.cacheManager.getIdToken(new vn({clientId:this.options.clientId,audience:t,scope:n})),r=this.userCache.get("@@user@@");return o&&o.id_token===(r==null?void 0:r.id_token)?r:(this.userCache.set("@@user@@",o),o)}async _getEntryFromCache(t){let{scope:n,audience:o,clientId:r,cacheMode:i}=t;const a=await this.cacheManager.get(new vn({scope:n,audience:o,clientId:r}),60,this.options.useMrrt,i);if(a&&a.access_token){const{token_type:s,access_token:c,oauthTokenScope:u,expires_in:d}=a,f=await this._getIdTokenFromCache();return f&&Object.assign(Object.assign({id_token:f.id_token,token_type:s||"Bearer",access_token:c},u?{scope:u}:null),{expires_in:d})}}async _requestToken(t,n){var o,r;const{nonceIn:i,organization:a,scopesToRequest:s}=n||{},c=await e5(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},t),{scope:s||t.scope}),this.worker),u=await this._verifyIdToken(c.id_token,i,a);if(t.grant_type==="authorization_code"){const d=await this._getIdTokenFromCache();!((r=(o=d==null?void 0:d.decodedToken)===null||o===void 0?void 0:o.claims)===null||r===void 0)&&r.sub&&d.decodedToken.claims.sub!==u.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove("@@user@@"))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},c),{decodedToken:u,scope:t.scope,audience:t.audience||"default"}),c.scope?{oauthTokenScope:c.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||u.claims.org_id),Object.assign(Object.assign({},c),{decodedToken:u})}async loginWithCustomTokenExchange(t){return this._requestToken(Object.assign(Object.assign({},t),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:t.subject_token,subject_token_type:t.subject_token_type,scope:as(this.scope,t.scope,t.audience||this.options.authorizationParams.audience),audience:t.audience||this.options.authorizationParams.audience,organization:t.organization||this.options.authorizationParams.organization}))}async exchangeToken(t){return this.loginWithCustomTokenExchange(t)}_assertDpop(t){if(!t)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(t){return this._assertDpop(this.dpop),this.dpop.getNonce(t)}setDpopNonce(t,n){return this._assertDpop(this.dpop),this.dpop.setNonce(t,n)}generateDpopProof(t){return this._assertDpop(this.dpop),this.dpop.generateProof(t)}createFetcher(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new v5(t,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:n=>{var o;return this.getTokenSilently({authorizationParams:{scope:(o=n==null?void 0:n.scope)===null||o===void 0?void 0:o.join(" "),audience:n==null?void 0:n.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(t.dpopNonceId),setDpopNonce:n=>this.setDpopNonce(n,t.dpopNonceId),generateDpopProof:n=>this.generateDpopProof(n)})}async connectAccountWithRedirect(t){const{openUrl:n,appState:o,connection:r,scopes:i,authorization_params:a,redirectUri:s=this.options.authorizationParams.redirect_uri||window.location.origin}=t;if(!r)throw new Error("connection is required");const c=jl(Wi()),u=Wi(),d=await Bh(u),f=Fh(d),{connect_uri:p,connect_params:h,auth_session:m}=await this.myAccountApi.connectAccount({connection:r,scopes:i,redirect_uri:s,state:c,code_challenge:f,code_challenge_method:"S256",authorization_params:a});this.transactionManager.create({state:c,code_verifier:u,auth_session:m,redirect_uri:s,appState:o,connection:r,response_type:Mo.ConnectCode});const g=new URL(p);g.searchParams.set("ticket",h.ticket),n?await n(g.toString()):window.location.assign(g)}async _requestTokenForMfa(t,n){const{mfaToken:o}=t,r=On(t,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},r),{mfa_token:o}),n)}}var vb={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},Lt=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},zE=Rt(Rt({},vb),{buildAuthorizeUrl:Lt,buildLogoutUrl:Lt,getAccessTokenSilently:Lt,getAccessTokenWithPopup:Lt,getIdTokenClaims:Lt,loginWithCustomTokenExchange:Lt,exchangeToken:Lt,loginWithRedirect:Lt,loginWithPopup:Lt,connectAccountWithRedirect:Lt,logout:Lt,handleRedirectCallback:Lt,getDpopNonce:Lt,setDpopNonce:Lt,generateDpopProof:Lt,createFetcher:Lt,getConfiguration:Lt}),wb=v.createContext(zE),vm=function(e){IC(t,e);function t(n,o){var r=e.call(this,o??n)||this;return r.error=n,r.error_description=o,Object.setPrototypeOf(r,t.prototype),r}return t}(Error),FE=/[?&](?:connect_)?code=[^&]+/,WE=/[?&]state=[^&]+/,UE=/[?&]error=[^&]+/,VE=function(e){return e===void 0&&(e=window.location.search),(FE.test(e)||UE.test(e))&&WE.test(e)},bb=function(e){return function(t){if(t instanceof Error)return t;if(t!==null&&typeof t=="object"&&"error"in t&&typeof t.error=="string"){if("error_description"in t&&typeof t.error_description=="string"){var n=t;return new vm(n.error,n.error_description)}var o=t;return new vm(o.error)}return new Error(e)}},wm=bb("Login failed"),hs=bb("Get access token failed"),xb=function(e){var t,n;e!=null&&e.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),e.authorizationParams=(t=e.authorizationParams)!==null&&t!==void 0?t:{},e.authorizationParams.redirect_uri=e.redirectUri,delete e.redirectUri),!((n=e==null?void 0:e.authorizationParams)===null||n===void 0)&&n.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),e.authorizationParams.redirect_uri=e.authorizationParams.redirectUri,delete e.authorizationParams.redirectUri)},KE=function(e,t){switch(t.type){case"LOGIN_POPUP_STARTED":return Rt(Rt({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return Rt(Rt({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return e.user===t.user?e:Rt(Rt({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return Rt(Rt({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return Rt(Rt({},e),{isLoading:!1,error:t.error})}},GE=function(e){return xb(e),Rt(Rt({},e),{auth0Client:{name:"auth0-react",version:"2.13.0"}})},qE=function(e){var t;window.history.replaceState({},document.title,(t=e.returnTo)!==null&&t!==void 0?t:window.location.pathname)},JE=function(e){var t=e.children,n=e.skipRedirectCallback,o=e.onRedirectCallback,r=o===void 0?qE:o,i=e.context,a=i===void 0?wb:i,s=Hh(e,["children","skipRedirectCallback","onRedirectCallback","context"]),c=v.useState(function(){return new BE(GE(s))})[0],u=v.useReducer(KE,vb),d=u[0],f=u[1],p=v.useRef(!1),h=v.useCallback(function($){return f({type:"ERROR",error:$}),$},[]);v.useEffect(function(){p.current||(p.current=!0,function(){return jo(void 0,void 0,void 0,function(){var $,R,F,z,V,L,H;return _o(this,function(W){switch(W.label){case 0:return W.trys.push([0,7,,8]),$=void 0,VE()&&!n?[4,c.handleRedirectCallback()]:[3,3];case 1:return R=W.sent(),F=R.appState,z=F===void 0?{}:F,V=R.response_type,L=Hh(R,["appState","response_type"]),[4,c.getUser()];case 2:return $=W.sent(),z.response_type=V,V===Mo.ConnectCode&&(z.connectedAccount=L),r(z,$),[3,6];case 3:return[4,c.checkSession()];case 4:return W.sent(),[4,c.getUser()];case 5:$=W.sent(),W.label=6;case 6:return f({type:"INITIALISED",user:$}),[3,8];case 7:return H=W.sent(),h(wm(H)),[3,8];case 8:return[2]}})})}())},[c,r,n,h]);var m=v.useCallback(function($){return xb($),c.loginWithRedirect($)},[c]),g=v.useCallback(function($,R){return jo(void 0,void 0,void 0,function(){var F,z;return _o(this,function(V){switch(V.label){case 0:f({type:"LOGIN_POPUP_STARTED"}),V.label=1;case 1:return V.trys.push([1,3,,4]),[4,c.loginWithPopup($,R)];case 2:return V.sent(),[3,4];case 3:return F=V.sent(),h(wm(F)),[2];case 4:return[4,c.getUser()];case 5:return z=V.sent(),f({type:"LOGIN_POPUP_COMPLETE",user:z}),[2]}})})},[c,h]),y=v.useCallback(function(){for(var $=[],R=0;R<arguments.length;R++)$[R]=arguments[R];return jo(void 0,RC([],$,!0),void 0,function(F){return F===void 0&&(F={}),_o(this,function(z){switch(z.label){case 0:return[4,c.logout(F)];case 1:return z.sent(),(F.openUrl||F.openUrl===!1)&&f({type:"LOGOUT"}),[2]}})})},[c]),b=v.useCallback(function($){return jo(void 0,void 0,void 0,function(){var R,F,z,V;return _o(this,function(L){switch(L.label){case 0:return L.trys.push([0,2,3,5]),[4,c.getTokenSilently($)];case 1:return R=L.sent(),[3,5];case 2:throw F=L.sent(),hs(F);case 3:return z=f,V={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return z.apply(void 0,[(V.user=L.sent(),V)]),[7];case 5:return[2,R]}})})},[c]),k=v.useCallback(function($,R){return jo(void 0,void 0,void 0,function(){var F,z,V,L;return _o(this,function(H){switch(H.label){case 0:return H.trys.push([0,2,3,5]),[4,c.getTokenWithPopup($,R)];case 1:return F=H.sent(),[3,5];case 2:throw z=H.sent(),hs(z);case 3:return V=f,L={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return V.apply(void 0,[(L.user=H.sent(),L)]),[7];case 5:return[2,F]}})})},[c]),x=v.useCallback(function($){return c.connectAccountWithRedirect($)},[c]),S=v.useCallback(function(){return c.getIdTokenClaims()},[c]),w=v.useCallback(function($){return jo(void 0,void 0,void 0,function(){var R,F,z,V;return _o(this,function(L){switch(L.label){case 0:return L.trys.push([0,2,3,5]),[4,c.loginWithCustomTokenExchange($)];case 1:return R=L.sent(),[3,5];case 2:throw F=L.sent(),hs(F);case 3:return z=f,V={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return z.apply(void 0,[(V.user=L.sent(),V)]),[7];case 5:return[2,R]}})})},[c]),C=v.useCallback(function($){return jo(void 0,void 0,void 0,function(){return _o(this,function(R){return[2,w($)]})})},[w]),O=v.useCallback(function($){return jo(void 0,void 0,void 0,function(){var R,F,z;return _o(this,function(V){switch(V.label){case 0:return V.trys.push([0,2,3,5]),[4,c.handleRedirectCallback($)];case 1:return[2,V.sent()];case 2:throw R=V.sent(),hs(R);case 3:return F=f,z={type:"HANDLE_REDIRECT_COMPLETE"},[4,c.getUser()];case 4:return F.apply(void 0,[(z.user=V.sent(),z)]),[7];case 5:return[2]}})})},[c]),_=v.useCallback(function($){return c.getDpopNonce($)},[c]),N=v.useCallback(function($,R){return c.setDpopNonce($,R)},[c]),E=v.useCallback(function($){return c.generateDpopProof($)},[c]),A=v.useCallback(function($){return c.createFetcher($)},[c]),j=v.useCallback(function(){return c.getConfiguration()},[c]),B=v.useMemo(function(){return Rt(Rt({},d),{getAccessTokenSilently:b,getAccessTokenWithPopup:k,getIdTokenClaims:S,loginWithCustomTokenExchange:w,exchangeToken:C,loginWithRedirect:m,loginWithPopup:g,connectAccountWithRedirect:x,logout:y,handleRedirectCallback:O,getDpopNonce:_,setDpopNonce:N,generateDpopProof:E,createFetcher:A,getConfiguration:j})},[d,b,k,S,w,C,m,g,x,y,O,_,N,E,A,j]);return v.createElement(a.Provider,{value:B},t)},kb=function(e){return e===void 0&&(e=wb),v.useContext(e)};const Sb=({className:e,children:t,Logo:n})=>l.jsxs("div",{className:ro("info-page-container",e),children:[l.jsx(n,{className:"info-page-logo"}),l.jsx("div",{className:"info-page-wrapper",children:t})]}),ZE={value:"data:image/svg+xml,%3Csvg width='5041' height='1232' viewBox='0 0 5041 1232' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_879_362)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M548.6 178H439.6C368.7 178 310 199.5 269.3 244.5C228.6 289.3 206.7 356 206.7 444.3C206.7 532.6 228.6 599.5 269.3 644.2C310.2 689.2 368.7 710.7 439.6 710.7H548.6C619 710.7 677.6 689.2 718.6 644.2C759.5 599.4 781.6 532.6 781.6 444.2C781.6 355.8 759.5 289 718.6 244.2C677.7 199.3 619 177.7 548.6 177.7V178ZM449.5 293.8H538.9C582.2 293.8 611.9 305.2 631.1 328.3C650.5 351.8 660.5 389.2 660.5 444.4C660.5 499.6 650.5 536.7 631.1 560C612 583 582.2 594.1 538.9 594.1H449.5C405.6 594.1 375.9 583 356.9 560C337.6 536.8 327.7 499.7 327.7 444.5C327.7 389.3 337.4 351.9 356.8 328.4C375.9 305.2 405.6 293.8 449.5 293.8Z' fill='white'/%3E%3Cpath d='M0.700195 189.8C0.700195 183.1 6.10017 177.7 12.8002 177.7H108.6C115.3 177.7 120.7 183.1 120.7 189.8V698.6C120.7 705.3 115.3 710.7 108.6 710.7H12.8002C6.10017 710.7 0.700195 705.3 0.700195 698.6V189.8Z' fill='white'/%3E%3Cpath d='M0.700195 11.9002C0.700195 5.7002 5.70018 0.700195 11.9002 0.700195H109.6C115.7 0.700195 120.7 5.7002 120.7 11.9002V109.5C120.7 115.7 115.7 120.7 109.5 120.7H11.9002C5.70018 120.7 0.700195 115.7 0.700195 109.5V11.9002Z' fill='%23007BE5'/%3E%3Cpath d='M827.7 601.9C827.7 595.7 832.7 590.7 838.9 590.7H936.6C942.8 590.7 947.8 595.7 947.8 601.9V699.5C947.8 705.7 942.8 710.7 936.6 710.7H838.9C832.7 710.7 827.7 705.7 827.7 699.5V601.9Z' fill='%23007BE5'/%3E%3Cpath d='M4363.9 293.2C4320.2 293.2 4290.6 304.6 4271.6 327.8C4252.3 351.4 4242.5 388.8 4242.5 444C4242.5 499.2 4252.3 536.4 4271.5 559.7C4290.5 582.6 4320 593.8 4363.8 593.8H4614.7C4622.4 593.8 4628.7 600.1 4628.7 607.8V696.7C4628.7 704.4 4622.4 710.7 4614.7 710.7H4354.1C4283.3 710.7 4224.9 689.1 4184.1 644.1C4143.5 599.3 4121.6 532.4 4121.6 444C4121.6 355.6 4143.5 288.7 4184.1 243.9C4224.8 199 4283.3 177.3 4354.1 177.3H4614.7C4622.4 177.3 4628.7 183.6 4628.7 191.3V279.3C4628.7 287 4622.4 293.3 4614.7 293.3H4363.9V293.2Z' fill='white'/%3E%3Cpath d='M1302.6 165.3C1240.1 165.3 1197 180.9 1169.3 213.3C1141.3 246 1127.4 297.6 1127.4 372.9C1127.4 447.7 1141.1 499 1169 531.6C1196.6 563.9 1239.7 579.5 1302.7 579.5H1552.5C1560.2 579.5 1566.5 585.8 1566.5 593.5V697.1C1566.5 704.8 1560.2 711.1 1552.5 711.1H1302.7C1204.7 711.1 1127.5 683.4 1075 626.4C1022.4 569.7 995.7 484.8 995.7 372.9C995.7 260.5 1022.7 175.4 1075.2 118.4C1127.9 61.3001 1205 33.6001 1302.6 33.6001H1552.4C1560.1 33.6001 1566.4 39.9001 1566.4 47.6001V151.2C1566.4 158.9 1560.1 165.2 1552.4 165.2H1302.6V165.3Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1953.6 177.7H1844.8C1774 177.7 1715.6 199.3 1674.8 244.3C1634.2 289.1 1612.3 356 1612.3 444.4C1612.3 532.8 1634.2 599.7 1674.8 644.5C1715.5 689.4 1774 711.1 1844.8 711.1H1953.6C2023.9 711.1 2082.4 689.5 2123.2 644.5C2163.9 599.7 2186 532.8 2186 444.3C2186 355.8 2163.9 289 2123.2 244.1C2082.3 199.3 2023.9 177.7 1953.6 177.7ZM1854.6 293.7H1943.8C1987 293.7 2016.6 305.1 2035.8 328.3C2055.2 351.9 2065.2 389.3 2065.2 444.5C2065.2 499.7 2055.2 536.8 2035.8 560.2C2016.7 583.2 1987.1 594.3 1943.8 594.3H1854.6C1810.8 594.3 1781.3 583.1 1762.3 560.2C1743 536.9 1733.3 499.8 1733.3 444.5C1733.3 389.3 1743.1 351.9 1762.4 328.3C1781.3 305 1810.9 293.7 1854.6 293.7Z' fill='white'/%3E%3Cpath d='M2679.7 411.6C2679.7 372.5 2668.5 343.5 2645.4 324C2622.1 304.3 2585.3 293.2 2531.9 293.2H2378.4C2375.5 293.2 2374.9 293.9 2374.8 294C2374.5 294.4 2373.6 295.8 2373.6 299.8V696.7C2373.6 704.4 2367.3 710.7 2359.6 710.7H2267.7C2260 710.7 2253.7 704.4 2253.7 696.7V265.6C2253.7 234.7 2258.8 212 2272.6 197.2C2286.5 182.2 2307.5 177.3 2334.2 177.3H2531.8C2620.7 177.3 2688 198.4 2733.3 238.9C2778.7 279.5 2800.5 338.6 2800.5 411.7V696.7C2800.5 704.4 2794.2 710.7 2786.5 710.7H2693.7C2686 710.7 2679.7 704.4 2679.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M3304.7 411.6C3304.7 372.5 3293.5 343.5 3270.4 324C3247.1 304.3 3210.3 293.2 3156.9 293.2H3003.4C3000.5 293.2 2999.9 293.9 2999.8 294C2999.5 294.4 2998.6 295.8 2998.6 299.8V696.7C2998.6 704.4 2992.3 710.7 2984.6 710.7H2892.7C2885 710.7 2878.7 704.4 2878.7 696.7V265.6C2878.7 234.7 2883.8 212 2897.6 197.2C2911.5 182.2 2932.5 177.3 2959.2 177.3H3156.8C3245.7 177.3 3313 198.4 3358.3 238.9C3403.7 279.5 3425.5 338.6 3425.5 411.7V696.7C3425.5 704.4 3419.2 710.7 3411.5 710.7H3318.7C3311 710.7 3304.7 704.4 3304.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M4906.1 292.2C4898.4 292.2 4892.1 298.5 4892.1 306.2V529.2C4892.1 557.5 4897.2 574.3 4906.4 584.1C4915.4 593.8 4930 598.6 4953.7 598.6H5019.2C5026.9 598.6 5033.2 604.9 5033.2 612.6V695.7C5033.2 703.4 5026.9 709.7 5019.2 709.7H4932.1C4877.9 709.7 4836.8 698.8 4809.7 668.6C4782.8 638.6 4771.3 591.5 4771.3 523.4V306.2C4771.3 298.5 4765 292.2 4757.3 292.2H4714.7C4707 292.2 4700.7 285.9 4700.7 278.2V190.2C4700.7 182.5 4707 176.2 4714.7 176.2H4757.3C4765 176.2 4771.3 169.9 4771.3 162.2V67.7002C4771.3 60.0002 4777.6 53.7002 4785.3 53.7002H4878.2C4885.9 53.7002 4892.2 60.0002 4892.2 67.7002V162.2C4892.2 169.9 4898.5 176.2 4906.2 176.2H5021.3C5029 176.2 5035.3 182.5 5035.3 190.2V278.2C5035.3 285.9 5029 292.2 5021.3 292.2H4906.1Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4024.4 607.2C4024.4 599.5 4018.1 593.2 4010.4 593.2H3699.9C3672.9 593.2 3655.3 586 3644.6 575.2C3633.8 564.4 3628.6 548.8 3628.6 529.7V514.5C3628.6 506.8 3634.9 500.5 3642.6 500.5H3866.6C3931.2 500.5 3977.4 486.9 4007.5 459.6C4037.7 432.2 4050.1 392.3 4050.1 343.5C4050.1 292.2 4036.8 250.1 4006.4 220.9C3976.1 191.7 3930.1 176.8 3867.7 176.8H3700.1C3633.9 176.8 3586.5 195.4 3555.6 227.8C3524.8 260.1 3511.8 305 3511.8 355.3V531.7C3511.8 582 3524.9 626.9 3555.6 659.2C3586.5 691.6 3633.9 710.2 3700.1 710.2H4010.6C4018.3 710.2 4024.6 703.9 4024.6 696.2V607.2H4024.4ZM3863.5 403.1H3642.5C3634.8 403.1 3628.5 396.8 3628.5 389.1V356.2C3628.5 337.6 3633.7 321.9 3644.6 311C3655.4 300.1 3672.9 292.7 3699.9 292.7H3866.5C3890.7 292.7 3906.9 298.8 3916.9 308.2C3926.9 317.5 3932 331.3 3932 349.4C3932 367.1 3927.3 380 3917.4 388.6C3907.4 397.4 3890.5 403.1 3863.5 403.1Z' fill='white'/%3E%3Cpath d='M2918.9 872.3C3001.9 872.3 3036.9 909.9 3036.9 966.3C3036.9 1012.2 3013.9 1036.8 2973.2 1047.2C3014.4 1058.2 3037.9 1083.7 3037.9 1129.7C3037.9 1186.1 3003.5 1224.7 2920.5 1224.7H2755.6C2741.5 1224.7 2734.2 1217.9 2734.2 1203.8V893.2C2734.2 879.1 2741.5 872.3 2755.6 872.3H2918.9ZM2765.4 1033.1H2918.9C2976.8 1033.1 3005 1014.8 3005 970.5C3005 929.8 2979.4 903.7 2919.4 903.7H2771.2C2767.5 903.7 2765.5 905.3 2765.5 909.4V1033.1H2765.4ZM2765.4 1187.6C2765.4 1191.8 2767.5 1193.3 2771.1 1193.3H2921C2979.5 1193.3 3006.1 1168.2 3006.1 1125.4C3006.1 1081 2976.9 1060.2 2921 1060.2H2765.5V1187.6H2765.4Z' fill='white'/%3E%3Cpath d='M3294 956.9V985.6H3182.8C3148.9 985.6 3135.3 1000.7 3135.3 1033.6V1224.6H3106.1V1029.9C3106.1 979.8 3125.4 956.8 3176.6 956.8H3294V956.9Z' fill='white'/%3E%3Cpath d='M3489.1 956.9C3562.2 956.9 3608.6 1001.3 3608.6 1091C3608.6 1181.3 3562.1 1224.6 3489.1 1224.6H3431.2C3357.6 1224.6 3311.7 1181.3 3311.7 1091C3311.7 1001.2 3357.6 956.9 3431.2 956.9H3489.1ZM3433.3 985.6C3374.3 985.6 3340.9 1019 3340.9 1091C3340.9 1163.5 3374.3 1196.4 3433.3 1196.4H3487.1C3546.1 1196.4 3579.5 1163.5 3579.5 1091C3579.5 1019 3546.1 985.6 3487.1 985.6H3433.3Z' fill='white'/%3E%3Cpath d='M3674.4 956.9L3706.8 1176.6C3709.4 1195.4 3716.2 1204.3 3737.1 1204.3C3758.5 1204.3 3767.4 1195.4 3771.5 1180.3L3821.6 995.5C3829.4 966.8 3849.3 951.7 3884.2 951.7C3919.1 951.7 3937.4 966.8 3945.3 995.5L3994.9 1180.3C3999.1 1195.4 4007.9 1204.3 4029.3 1204.3C4050.2 1204.3 4056.4 1195.4 4059.6 1176.6L4093.5 956.9H4125.3L4089.3 1179.8C4084.6 1210.6 4069.5 1231 4028.2 1231C3992.7 1231 3975 1216.4 3966.6 1185.1L3917 1000.9C3912.8 985.2 3900.8 978.5 3883.6 978.5C3865.9 978.5 3854.9 985.3 3850.7 1000.9L3799.6 1185.1C3790.7 1216.4 3773.5 1231 3737.5 1231C3695.2 1231 3682.2 1210.1 3677.5 1179.8L3643.1 956.9H3674.4Z' fill='white'/%3E%3Cpath d='M4417.6 956.9V985.6H4260C4219.8 985.6 4203.6 1003.3 4203.6 1032.1C4203.6 1057.2 4216.1 1077.5 4263.6 1077.5H4338.8C4410.8 1077.5 4428.6 1110.9 4428.6 1149.5C4428.6 1194.9 4404.6 1224.7 4344 1224.7H4178V1196.5H4344C4384.2 1196.5 4399.8 1178.2 4399.8 1149.5C4399.8 1124.4 4387.8 1103.6 4339.8 1103.6H4264.6C4193.1 1103.6 4174.8 1069.2 4174.8 1030C4174.8 985.1 4198.8 956.9 4259.4 956.9H4417.6Z' fill='white'/%3E%3Cpath d='M4685.4 956.9C4749.1 956.9 4775.7 986.6 4775.7 1036.8C4775.7 1084.8 4751.2 1111.4 4684.9 1111.4H4526.2V1135.9C4526.2 1170.3 4545 1196.4 4593.5 1196.4H4762.1V1224.6H4593.5C4524.6 1224.6 4497.5 1187.5 4497.5 1136.4V1045.1C4497.5 995 4524.6 956.9 4593.5 956.9H4685.4ZM4526.2 1087.4H4684.3C4729.7 1087.4 4746.9 1069.7 4746.9 1037.8C4746.9 1005.4 4728.6 985.6 4685.3 985.6H4593.4C4544.9 985.6 4526.1 1011.2 4526.1 1045.6V1087.4H4526.2Z' fill='white'/%3E%3Cpath d='M5040.3 956.9V985.6H4929.1C4895.2 985.6 4881.6 1000.7 4881.6 1033.6V1224.6H4852.4V1029.9C4852.4 979.8 4871.7 956.8 4922.9 956.8H5040.3V956.9Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_879_362'%3E%3Crect width='5041' height='1231' fill='white' transform='translate(0 0.700195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"},YE={loginPageLogo:ZE},XE="200px",Wa=({logoSrc:e=YE.loginPageLogo.value,width:t=XE,className:n="logo"})=>l.jsx("img",{width:t,src:e,className:n,alt:"Login logo"}),Cb=()=>l.jsx("span",{className:"spinner"});const lr=({Logo:e=Wa,text:t="Loading..."})=>l.jsx("div",{className:"system-loader-background",children:l.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[l.jsx(e,{}),l.jsx("h1",{className:"system-loader-text io-title",children:t}),l.jsx(Cb,{})]})});var pd={exports:{}},ms={exports:{}},Ge={};/** @license React v16.13.1
|
|
57
|
+
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)o=t.cache;else{if(n=t.cacheLocation||"memory",!Xh(n))throw new Error('Invalid cache location "'.concat(n,'"'));o=Xh(n)()}var r;this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Yr:m5,this.orgHintCookieName=(r=this.options.clientId,"auth0.".concat(r,".organization_hint")),this.isAuthenticatedCookieName=(u=>"auth0.".concat(u,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const i=t.useCookiesForTransactions?this.cookieStorage:g5;var a;this.scope=function(u,d){for(var f=arguments.length,p=new Array(f>2?f-2:0),h=2;h<f;h++)p[h-2]=arguments[h];if(typeof u!="object")return{default:js(d,u,...p)};let m={default:js(d,...p)};return Object.keys(u).forEach(g=>{const y=u[g];m[g]=js(d,y,...p)}),m}(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new l5(i,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Ow,this.cacheManager=new c5(o,o.allKeys?void 0:new w5(o,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new k5(this.options.clientId):void 0,this.domainUrl=(a=this.options.domain,/^https?:\/\//.test(a)?a:"https://".concat(a)),this.tokenIssuer=((u,d)=>u?u.startsWith("https://")?u:"https://".concat(u,"/"):"".concat(d,"/"))(this.options.issuer,this.domainUrl);const s="".concat(this.domainUrl,"/me/"),c=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:s},detailedResponse:!0})}));this.myAccountApi=new C5(c,s),this.authJsClient=new HE({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new UE(this.authJsClient.mfa,this),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new v5)}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(t){const n=this.options.auth0Client||_w,o=Aw(n,!0),r=encodeURIComponent(btoa(JSON.stringify(o)));return"".concat(this.domainUrl).concat(t,"&auth0Client=").concat(r)}_authorizeUrl(t){return this._url("/authorize?".concat(ed(t)))}async _verifyIdToken(t,n,o){const r=await this.nowProvider();return d5({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,organization:o,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:r});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,o){var r;const i=Pl(Wi()),a=Pl(Wi()),s=Wi(),c=await Uh(s),u=Kh(c),d=await((r=this.dpop)===null||r===void 0?void 0:r.calculateThumbprint()),f=((h,m,g,y,b,k,x,S,w)=>Object.assign(Object.assign(Object.assign({client_id:h.clientId},h.authorizationParams),g),{scope:ss(m,g.scope,g.audience),response_type:"code",response_mode:S||"query",state:y,nonce:b,redirect_uri:x||h.authorizationParams.redirect_uri,code_challenge:k,code_challenge_method:"S256",dpop_jkt:w}))(this.options,this.scope,t,i,a,u,t.redirect_uri||this.options.authorizationParams.redirect_uri||o,n==null?void 0:n.response_mode,d),p=this._authorizeUrl(f);return{nonce:a,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:p}}async loginWithPopup(t,n){var o;if(t=t||{},!(n=n||{}).popup&&(n.popup=(s=>{const c=window.screenX+(window.innerWidth-400)/2,u=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup","left=".concat(c,",top=").concat(u,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(""),!n.popup))throw new Pf;const r=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=r.url;const i=await(s=>new Promise((c,u)=>{let d;const f=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(p),window.removeEventListener("message",d,!1),u(new Af(s.popup)))},1e3),p=setTimeout(()=>{clearInterval(f),u(new Of(s.popup)),window.removeEventListener("message",d,!1)},1e3*(s.timeoutInSeconds||60));d=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(f),window.removeEventListener("message",d,!1),s.closePopup!==!1&&s.popup.close(),h.data.response.error)return u(ut.fromPayload(h.data.response));c(h.data.response)}},window.addEventListener("message",d)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==i.state)throw new ut("state_mismatch","Invalid state");const a=((o=t.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(){var t;const n=Qh(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),{openUrl:o,fragment:r,appState:i}=n,a=An(n,["openUrl","fragment","appState"]),s=((t=a.authorizationParams)===null||t===void 0?void 0:t.organization)||this.options.authorizationParams.organization,c=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:u}=c,d=An(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:i,response_type:Do.Code}),s&&{organization:s}));const f=r?"".concat(u,"#").concat(r):u;o?await o(f):window.location.assign(f)}async handleRedirectCallback(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location.href).split("?").slice(1);if(t.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new ut("missing_transaction","Invalid state");this.transactionManager.remove();const o=(r=>{r.indexOf("#")>-1&&(r=r.substring(0,r.indexOf("#")));const i=new URLSearchParams(r);return{state:i.get("state"),code:i.get("code")||void 0,connect_code:i.get("connect_code")||void 0,error:i.get("error")||void 0,error_description:i.get("error_description")||void 0}})(t.join(""));return n.response_type===Do.ConnectCode?this._handleConnectAccountRedirectCallback(o,n):this._handleLoginRedirectCallback(o,n)}async _handleLoginRedirectCallback(t,n){const{code:o,state:r,error:i,error_description:a}=t;if(i)throw new jf(i,a||i,r,n.appState);if(!n.code_verifier||n.state&&n.state!==r)throw new ut("state_mismatch","Invalid state");const s=n.organization,c=n.nonce,u=n.redirect_uri;return await this._requestToken(Object.assign({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:o},u?{redirect_uri:u}:{}),{nonceIn:c,organization:s}),{appState:n.appState,response_type:Do.Code}}async _handleConnectAccountRedirectCallback(t,n){const{connect_code:o,state:r,error:i,error_description:a}=t;if(i)throw new _f(i,a||i,n.connection,r,n.appState);if(!o)throw new ut("missing_connect_code","Missing connect code");if(!(n.code_verifier&&n.state&&n.auth_session&&n.redirect_uri&&n.state===r))throw new ut("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:n.auth_session,connect_code:o,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier});return Object.assign(Object.assign({},s),{appState:n.appState,response_type:Do.ConnectCode})}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n,o;const r=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:ss(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,((o=t.authorizationParams)===null||o===void 0?void 0:o.audience)||this.options.authorizationParams.audience)})}),i=await((a,s)=>{let c=Tl[s];return c||(c=a().finally(()=>{delete Tl[s],c=null}),Tl[s]=c),c})(()=>this._getTokenSilently(r),"".concat(this.options.clientId,"::").concat(r.authorizationParams.audience,"::").concat(r.authorizationParams.scope));return t.detailedResponse?i:i==null?void 0:i.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,o=An(t,["cacheMode"]);if(n!=="off"){const s=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:n});if(s)return s}if(n==="cache-only")return;const r=(i=this.options.clientId,a=o.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(i,".").concat(a));var i,a;if(!await Yh(()=>Gi.acquireLock(r,5e3),10))throw new di;this.activeLockKeys.add(r),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(n!=="off"){const h=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(h)return h}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:c,token_type:u,access_token:d,oauthTokenScope:f,expires_in:p}=s;return Object.assign(Object.assign({id_token:c,token_type:u,access_token:d},f?{scope:f}:null),{expires_in:p})}finally{await Gi.releaseLock(r),this.activeLockKeys.delete(r),this.activeLockKeys.size===0&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var o,r;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:ss(this.scope,(o=t.authorizationParams)===null||o===void 0?void 0:o.scope,((r=t.authorizationParams)===null||r===void 0?void 0:r.audience)||this.options.authorizationParams.audience)})});return n=Object.assign(Object.assign({},WC),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new vn({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:o}=n,r=An(n,["federated"]),i=o?"&federated":"";return this._url("/v2/logout?".concat(ed(Object.assign({clientId:t.clientId},r))))+i}async logout(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n;const o=Qh(t),{openUrl:r}=o,i=An(o,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await((n=this.dpop)===null||n===void 0?void 0:n.clear());const a=this._buildLogoutUrl(i);r?await r(a):r!==!1&&window.location.assign(a)}async _getTokenFromIFrame(t){const n=(o=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(o));var o;if(!await Yh(()=>Gi.acquireLock(n,5e3),10))throw new di;try{const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),i=this.cookieStorage.get(this.orgHintCookieName);i&&!r.organization&&(r.organization=i);const{url:a,state:s,nonce:c,code_verifier:u,redirect_uri:d,scope:f,audience:p}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new ut("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const h=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let m;try{m=new URL(this.domainUrl).origin}catch{m=this.domainUrl}const g=await function(b,k){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60;return new Promise((S,w)=>{const C=window.document.createElement("iframe");C.setAttribute("width","0"),C.setAttribute("height","0"),C.style.display="none";const O=()=>{window.document.body.contains(C)&&(window.document.body.removeChild(C),window.removeEventListener("message",_,!1))};let _;const N=setTimeout(()=>{w(new di),O()},1e3*x);_=function(E){if(E.origin!=k||!E.data||E.data.type!=="authorization_response")return;const A=E.source;A&&A.close(),E.data.response.error?w(ut.fromPayload(E.data.response)):S(E.data.response),clearTimeout(N),window.removeEventListener("message",_,!1),setTimeout(O,2e3)},window.addEventListener("message",_,!1),window.document.body.appendChild(C),C.setAttribute("src",b)})}(a,m,h);if(s!==g.state)throw new ut("state_mismatch","Invalid state");const y=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:u,code:g.code,grant_type:"authorization_code",redirect_uri:d,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:c,organization:r.organization});return Object.assign(Object.assign({},y),{scope:f,oauthTokenScope:y.scope,audience:p})}catch(r){throw r.error==="login_required"&&this.logout({openUrl:!1}),r}finally{await Gi.releaseLock(n)}}async _getTokenUsingRefreshToken(t){var n,o;const r=await this.cacheManager.get(new vn({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new Vc(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const i=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null,s=((p,h,m,g)=>{var y;if(p&&m&&g){if(h.audience!==m)return h.scope;const b=g.split(" "),k=((y=h.scope)===null||y===void 0?void 0:y.split(" "))||[],x=k.every(S=>b.includes(S));return b.length>=k.length&&x?g:h.scope}return h.scope})(this.options.useMrrt,t.authorizationParams,r==null?void 0:r.audience,r==null?void 0:r.scope);try{const p=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:i}),a&&{timeout:a}),{scopesToRequest:s});if(p.refresh_token&&(r!=null&&r.refresh_token)&&await this.cacheManager.updateEntry(r.refresh_token,p.refresh_token),this.options.useMrrt&&(c=r==null?void 0:r.audience,u=r==null?void 0:r.scope,d=t.authorizationParams.audience,f=t.authorizationParams.scope,(c!==d||!em(f,u))&&!em(s,p.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);await this.cacheManager.remove(this.options.clientId,t.authorizationParams.audience,t.authorizationParams.scope);const h=((m,g)=>{const y=(m==null?void 0:m.split(" "))||[],b=(g==null?void 0:g.split(" "))||[];return y.filter(k=>b.indexOf(k)==-1).join(",")})(s,p.scope);throw new Nf(t.authorizationParams.audience||"default",h)}return Object.assign(Object.assign({},p),{scope:t.authorizationParams.scope,oauthTokenScope:p.scope,audience:t.authorizationParams.audience||"default"})}catch(p){if(p.message){if(p.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),p;if((p.message.includes("Missing Refresh Token")||p.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t)}throw p instanceof Da&&this.mfa.setMFAAuthDetails(p.mfa_token,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,(o=t.authorizationParams)===null||o===void 0?void 0:o.audience,p.mfa_requirements),p}var c,u,d,f}async _saveEntryInCache(t){const{id_token:n,decodedToken:o}=t,r=An(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=this.scope[t],o=await this.cacheManager.getIdToken(new vn({clientId:this.options.clientId,audience:t,scope:n})),r=this.userCache.get("@@user@@");return o&&o.id_token===(r==null?void 0:r.id_token)?r:(this.userCache.set("@@user@@",o),o)}async _getEntryFromCache(t){let{scope:n,audience:o,clientId:r,cacheMode:i}=t;const a=await this.cacheManager.get(new vn({scope:n,audience:o,clientId:r}),60,this.options.useMrrt,i);if(a&&a.access_token){const{token_type:s,access_token:c,oauthTokenScope:u,expires_in:d}=a,f=await this._getIdTokenFromCache();return f&&Object.assign(Object.assign({id_token:f.id_token,token_type:s||"Bearer",access_token:c},u?{scope:u}:null),{expires_in:d})}}async _requestToken(t,n){var o,r;const{nonceIn:i,organization:a,scopesToRequest:s}=n||{},c=await i5(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},t),{scope:s||t.scope}),this.worker),u=await this._verifyIdToken(c.id_token,i,a);if(t.grant_type==="authorization_code"){const d=await this._getIdTokenFromCache();!((r=(o=d==null?void 0:d.decodedToken)===null||o===void 0?void 0:o.claims)===null||r===void 0)&&r.sub&&d.decodedToken.claims.sub!==u.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove("@@user@@"))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},c),{decodedToken:u,scope:t.scope,audience:t.audience||"default"}),c.scope?{oauthTokenScope:c.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||u.claims.org_id),Object.assign(Object.assign({},c),{decodedToken:u})}async loginWithCustomTokenExchange(t){return this._requestToken(Object.assign(Object.assign({},t),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:t.subject_token,subject_token_type:t.subject_token_type,scope:ss(this.scope,t.scope,t.audience||this.options.authorizationParams.audience),audience:t.audience||this.options.authorizationParams.audience,organization:t.organization||this.options.authorizationParams.organization}))}async exchangeToken(t){return this.loginWithCustomTokenExchange(t)}_assertDpop(t){if(!t)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(t){return this._assertDpop(this.dpop),this.dpop.getNonce(t)}setDpopNonce(t,n){return this._assertDpop(this.dpop),this.dpop.setNonce(t,n)}generateDpopProof(t){return this._assertDpop(this.dpop),this.dpop.generateProof(t)}createFetcher(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new S5(t,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:n=>{var o;return this.getTokenSilently({authorizationParams:{scope:(o=n==null?void 0:n.scope)===null||o===void 0?void 0:o.join(" "),audience:n==null?void 0:n.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(t.dpopNonceId),setDpopNonce:n=>this.setDpopNonce(n,t.dpopNonceId),generateDpopProof:n=>this.generateDpopProof(n)})}async connectAccountWithRedirect(t){const{openUrl:n,appState:o,connection:r,scopes:i,authorization_params:a,redirectUri:s=this.options.authorizationParams.redirect_uri||window.location.origin}=t;if(!r)throw new Error("connection is required");const c=Pl(Wi()),u=Wi(),d=await Uh(u),f=Kh(d),{connect_uri:p,connect_params:h,auth_session:m}=await this.myAccountApi.connectAccount({connection:r,scopes:i,redirect_uri:s,state:c,code_challenge:f,code_challenge_method:"S256",authorization_params:a});this.transactionManager.create({state:c,code_verifier:u,auth_session:m,redirect_uri:s,appState:o,connection:r,response_type:Do.ConnectCode});const g=new URL(p);g.searchParams.set("ticket",h.ticket),n?await n(g.toString()):window.location.assign(g)}async _requestTokenForMfa(t,n){const{mfaToken:o}=t,r=An(t,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},r),{mfa_token:o}),n)}}var xb={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},Lt=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},KE=Rt(Rt({},xb),{buildAuthorizeUrl:Lt,buildLogoutUrl:Lt,getAccessTokenSilently:Lt,getAccessTokenWithPopup:Lt,getIdTokenClaims:Lt,loginWithCustomTokenExchange:Lt,exchangeToken:Lt,loginWithRedirect:Lt,loginWithPopup:Lt,connectAccountWithRedirect:Lt,logout:Lt,handleRedirectCallback:Lt,getDpopNonce:Lt,setDpopNonce:Lt,generateDpopProof:Lt,createFetcher:Lt,getConfiguration:Lt}),kb=v.createContext(KE),km=function(e){$C(t,e);function t(n,o){var r=e.call(this,o??n)||this;return r.error=n,r.error_description=o,Object.setPrototypeOf(r,t.prototype),r}return t}(Error),GE=/[?&](?:connect_)?code=[^&]+/,qE=/[?&]state=[^&]+/,JE=/[?&]error=[^&]+/,ZE=function(e){return e===void 0&&(e=window.location.search),(GE.test(e)||JE.test(e))&&qE.test(e)},Sb=function(e){return function(t){if(t instanceof Error)return t;if(t!==null&&typeof t=="object"&&"error"in t&&typeof t.error=="string"){if("error_description"in t&&typeof t.error_description=="string"){var n=t;return new km(n.error,n.error_description)}var o=t;return new km(o.error)}return new Error(e)}},Sm=Sb("Login failed"),ms=Sb("Get access token failed"),Cb=function(e){var t,n;e!=null&&e.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),e.authorizationParams=(t=e.authorizationParams)!==null&&t!==void 0?t:{},e.authorizationParams.redirect_uri=e.redirectUri,delete e.redirectUri),!((n=e==null?void 0:e.authorizationParams)===null||n===void 0)&&n.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),e.authorizationParams.redirect_uri=e.authorizationParams.redirectUri,delete e.authorizationParams.redirectUri)},YE=function(e,t){switch(t.type){case"LOGIN_POPUP_STARTED":return Rt(Rt({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return Rt(Rt({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return e.user===t.user?e:Rt(Rt({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return Rt(Rt({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return Rt(Rt({},e),{isLoading:!1,error:t.error})}},XE=function(e){return Cb(e),Rt(Rt({},e),{auth0Client:{name:"auth0-react",version:"2.13.0"}})},QE=function(e){var t;window.history.replaceState({},document.title,(t=e.returnTo)!==null&&t!==void 0?t:window.location.pathname)},ej=function(e){var t=e.children,n=e.skipRedirectCallback,o=e.onRedirectCallback,r=o===void 0?QE:o,i=e.context,a=i===void 0?kb:i,s=Wh(e,["children","skipRedirectCallback","onRedirectCallback","context"]),c=v.useState(function(){return new VE(XE(s))})[0],u=v.useReducer(YE,xb),d=u[0],f=u[1],p=v.useRef(!1),h=v.useCallback(function($){return f({type:"ERROR",error:$}),$},[]);v.useEffect(function(){p.current||(p.current=!0,function(){return Eo(void 0,void 0,void 0,function(){var $,R,F,z,V,L,H;return jo(this,function(W){switch(W.label){case 0:return W.trys.push([0,7,,8]),$=void 0,ZE()&&!n?[4,c.handleRedirectCallback()]:[3,3];case 1:return R=W.sent(),F=R.appState,z=F===void 0?{}:F,V=R.response_type,L=Wh(R,["appState","response_type"]),[4,c.getUser()];case 2:return $=W.sent(),z.response_type=V,V===Do.ConnectCode&&(z.connectedAccount=L),r(z,$),[3,6];case 3:return[4,c.checkSession()];case 4:return W.sent(),[4,c.getUser()];case 5:$=W.sent(),W.label=6;case 6:return f({type:"INITIALISED",user:$}),[3,8];case 7:return H=W.sent(),h(Sm(H)),[3,8];case 8:return[2]}})})}())},[c,r,n,h]);var m=v.useCallback(function($){return Cb($),c.loginWithRedirect($)},[c]),g=v.useCallback(function($,R){return Eo(void 0,void 0,void 0,function(){var F,z;return jo(this,function(V){switch(V.label){case 0:f({type:"LOGIN_POPUP_STARTED"}),V.label=1;case 1:return V.trys.push([1,3,,4]),[4,c.loginWithPopup($,R)];case 2:return V.sent(),[3,4];case 3:return F=V.sent(),h(Sm(F)),[2];case 4:return[4,c.getUser()];case 5:return z=V.sent(),f({type:"LOGIN_POPUP_COMPLETE",user:z}),[2]}})})},[c,h]),y=v.useCallback(function(){for(var $=[],R=0;R<arguments.length;R++)$[R]=arguments[R];return Eo(void 0,HC([],$,!0),void 0,function(F){return F===void 0&&(F={}),jo(this,function(z){switch(z.label){case 0:return[4,c.logout(F)];case 1:return z.sent(),(F.openUrl||F.openUrl===!1)&&f({type:"LOGOUT"}),[2]}})})},[c]),b=v.useCallback(function($){return Eo(void 0,void 0,void 0,function(){var R,F,z,V;return jo(this,function(L){switch(L.label){case 0:return L.trys.push([0,2,3,5]),[4,c.getTokenSilently($)];case 1:return R=L.sent(),[3,5];case 2:throw F=L.sent(),ms(F);case 3:return z=f,V={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return z.apply(void 0,[(V.user=L.sent(),V)]),[7];case 5:return[2,R]}})})},[c]),k=v.useCallback(function($,R){return Eo(void 0,void 0,void 0,function(){var F,z,V,L;return jo(this,function(H){switch(H.label){case 0:return H.trys.push([0,2,3,5]),[4,c.getTokenWithPopup($,R)];case 1:return F=H.sent(),[3,5];case 2:throw z=H.sent(),ms(z);case 3:return V=f,L={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return V.apply(void 0,[(L.user=H.sent(),L)]),[7];case 5:return[2,F]}})})},[c]),x=v.useCallback(function($){return c.connectAccountWithRedirect($)},[c]),S=v.useCallback(function(){return c.getIdTokenClaims()},[c]),w=v.useCallback(function($){return Eo(void 0,void 0,void 0,function(){var R,F,z,V;return jo(this,function(L){switch(L.label){case 0:return L.trys.push([0,2,3,5]),[4,c.loginWithCustomTokenExchange($)];case 1:return R=L.sent(),[3,5];case 2:throw F=L.sent(),ms(F);case 3:return z=f,V={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return z.apply(void 0,[(V.user=L.sent(),V)]),[7];case 5:return[2,R]}})})},[c]),C=v.useCallback(function($){return Eo(void 0,void 0,void 0,function(){return jo(this,function(R){return[2,w($)]})})},[w]),O=v.useCallback(function($){return Eo(void 0,void 0,void 0,function(){var R,F,z;return jo(this,function(V){switch(V.label){case 0:return V.trys.push([0,2,3,5]),[4,c.handleRedirectCallback($)];case 1:return[2,V.sent()];case 2:throw R=V.sent(),ms(R);case 3:return F=f,z={type:"HANDLE_REDIRECT_COMPLETE"},[4,c.getUser()];case 4:return F.apply(void 0,[(z.user=V.sent(),z)]),[7];case 5:return[2]}})})},[c]),_=v.useCallback(function($){return c.getDpopNonce($)},[c]),N=v.useCallback(function($,R){return c.setDpopNonce($,R)},[c]),E=v.useCallback(function($){return c.generateDpopProof($)},[c]),A=v.useCallback(function($){return c.createFetcher($)},[c]),j=v.useCallback(function(){return c.getConfiguration()},[c]),B=v.useMemo(function(){return Rt(Rt({},d),{getAccessTokenSilently:b,getAccessTokenWithPopup:k,getIdTokenClaims:S,loginWithCustomTokenExchange:w,exchangeToken:C,loginWithRedirect:m,loginWithPopup:g,connectAccountWithRedirect:x,logout:y,handleRedirectCallback:O,getDpopNonce:_,setDpopNonce:N,generateDpopProof:E,createFetcher:A,getConfiguration:j})},[d,b,k,S,w,C,m,g,x,y,O,_,N,E,A,j]);return v.createElement(a.Provider,{value:B},t)},Eb=function(e){return e===void 0&&(e=kb),v.useContext(e)};const jb=({className:e,children:t,Logo:n})=>l.jsxs("div",{className:ro("info-page-container",e),children:[l.jsx(n,{className:"info-page-logo"}),l.jsx("div",{className:"info-page-wrapper",children:t})]}),tj={value:"data:image/svg+xml,%3Csvg width='5041' height='1232' viewBox='0 0 5041 1232' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_879_362)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M548.6 178H439.6C368.7 178 310 199.5 269.3 244.5C228.6 289.3 206.7 356 206.7 444.3C206.7 532.6 228.6 599.5 269.3 644.2C310.2 689.2 368.7 710.7 439.6 710.7H548.6C619 710.7 677.6 689.2 718.6 644.2C759.5 599.4 781.6 532.6 781.6 444.2C781.6 355.8 759.5 289 718.6 244.2C677.7 199.3 619 177.7 548.6 177.7V178ZM449.5 293.8H538.9C582.2 293.8 611.9 305.2 631.1 328.3C650.5 351.8 660.5 389.2 660.5 444.4C660.5 499.6 650.5 536.7 631.1 560C612 583 582.2 594.1 538.9 594.1H449.5C405.6 594.1 375.9 583 356.9 560C337.6 536.8 327.7 499.7 327.7 444.5C327.7 389.3 337.4 351.9 356.8 328.4C375.9 305.2 405.6 293.8 449.5 293.8Z' fill='white'/%3E%3Cpath d='M0.700195 189.8C0.700195 183.1 6.10017 177.7 12.8002 177.7H108.6C115.3 177.7 120.7 183.1 120.7 189.8V698.6C120.7 705.3 115.3 710.7 108.6 710.7H12.8002C6.10017 710.7 0.700195 705.3 0.700195 698.6V189.8Z' fill='white'/%3E%3Cpath d='M0.700195 11.9002C0.700195 5.7002 5.70018 0.700195 11.9002 0.700195H109.6C115.7 0.700195 120.7 5.7002 120.7 11.9002V109.5C120.7 115.7 115.7 120.7 109.5 120.7H11.9002C5.70018 120.7 0.700195 115.7 0.700195 109.5V11.9002Z' fill='%23007BE5'/%3E%3Cpath d='M827.7 601.9C827.7 595.7 832.7 590.7 838.9 590.7H936.6C942.8 590.7 947.8 595.7 947.8 601.9V699.5C947.8 705.7 942.8 710.7 936.6 710.7H838.9C832.7 710.7 827.7 705.7 827.7 699.5V601.9Z' fill='%23007BE5'/%3E%3Cpath d='M4363.9 293.2C4320.2 293.2 4290.6 304.6 4271.6 327.8C4252.3 351.4 4242.5 388.8 4242.5 444C4242.5 499.2 4252.3 536.4 4271.5 559.7C4290.5 582.6 4320 593.8 4363.8 593.8H4614.7C4622.4 593.8 4628.7 600.1 4628.7 607.8V696.7C4628.7 704.4 4622.4 710.7 4614.7 710.7H4354.1C4283.3 710.7 4224.9 689.1 4184.1 644.1C4143.5 599.3 4121.6 532.4 4121.6 444C4121.6 355.6 4143.5 288.7 4184.1 243.9C4224.8 199 4283.3 177.3 4354.1 177.3H4614.7C4622.4 177.3 4628.7 183.6 4628.7 191.3V279.3C4628.7 287 4622.4 293.3 4614.7 293.3H4363.9V293.2Z' fill='white'/%3E%3Cpath d='M1302.6 165.3C1240.1 165.3 1197 180.9 1169.3 213.3C1141.3 246 1127.4 297.6 1127.4 372.9C1127.4 447.7 1141.1 499 1169 531.6C1196.6 563.9 1239.7 579.5 1302.7 579.5H1552.5C1560.2 579.5 1566.5 585.8 1566.5 593.5V697.1C1566.5 704.8 1560.2 711.1 1552.5 711.1H1302.7C1204.7 711.1 1127.5 683.4 1075 626.4C1022.4 569.7 995.7 484.8 995.7 372.9C995.7 260.5 1022.7 175.4 1075.2 118.4C1127.9 61.3001 1205 33.6001 1302.6 33.6001H1552.4C1560.1 33.6001 1566.4 39.9001 1566.4 47.6001V151.2C1566.4 158.9 1560.1 165.2 1552.4 165.2H1302.6V165.3Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1953.6 177.7H1844.8C1774 177.7 1715.6 199.3 1674.8 244.3C1634.2 289.1 1612.3 356 1612.3 444.4C1612.3 532.8 1634.2 599.7 1674.8 644.5C1715.5 689.4 1774 711.1 1844.8 711.1H1953.6C2023.9 711.1 2082.4 689.5 2123.2 644.5C2163.9 599.7 2186 532.8 2186 444.3C2186 355.8 2163.9 289 2123.2 244.1C2082.3 199.3 2023.9 177.7 1953.6 177.7ZM1854.6 293.7H1943.8C1987 293.7 2016.6 305.1 2035.8 328.3C2055.2 351.9 2065.2 389.3 2065.2 444.5C2065.2 499.7 2055.2 536.8 2035.8 560.2C2016.7 583.2 1987.1 594.3 1943.8 594.3H1854.6C1810.8 594.3 1781.3 583.1 1762.3 560.2C1743 536.9 1733.3 499.8 1733.3 444.5C1733.3 389.3 1743.1 351.9 1762.4 328.3C1781.3 305 1810.9 293.7 1854.6 293.7Z' fill='white'/%3E%3Cpath d='M2679.7 411.6C2679.7 372.5 2668.5 343.5 2645.4 324C2622.1 304.3 2585.3 293.2 2531.9 293.2H2378.4C2375.5 293.2 2374.9 293.9 2374.8 294C2374.5 294.4 2373.6 295.8 2373.6 299.8V696.7C2373.6 704.4 2367.3 710.7 2359.6 710.7H2267.7C2260 710.7 2253.7 704.4 2253.7 696.7V265.6C2253.7 234.7 2258.8 212 2272.6 197.2C2286.5 182.2 2307.5 177.3 2334.2 177.3H2531.8C2620.7 177.3 2688 198.4 2733.3 238.9C2778.7 279.5 2800.5 338.6 2800.5 411.7V696.7C2800.5 704.4 2794.2 710.7 2786.5 710.7H2693.7C2686 710.7 2679.7 704.4 2679.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M3304.7 411.6C3304.7 372.5 3293.5 343.5 3270.4 324C3247.1 304.3 3210.3 293.2 3156.9 293.2H3003.4C3000.5 293.2 2999.9 293.9 2999.8 294C2999.5 294.4 2998.6 295.8 2998.6 299.8V696.7C2998.6 704.4 2992.3 710.7 2984.6 710.7H2892.7C2885 710.7 2878.7 704.4 2878.7 696.7V265.6C2878.7 234.7 2883.8 212 2897.6 197.2C2911.5 182.2 2932.5 177.3 2959.2 177.3H3156.8C3245.7 177.3 3313 198.4 3358.3 238.9C3403.7 279.5 3425.5 338.6 3425.5 411.7V696.7C3425.5 704.4 3419.2 710.7 3411.5 710.7H3318.7C3311 710.7 3304.7 704.4 3304.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M4906.1 292.2C4898.4 292.2 4892.1 298.5 4892.1 306.2V529.2C4892.1 557.5 4897.2 574.3 4906.4 584.1C4915.4 593.8 4930 598.6 4953.7 598.6H5019.2C5026.9 598.6 5033.2 604.9 5033.2 612.6V695.7C5033.2 703.4 5026.9 709.7 5019.2 709.7H4932.1C4877.9 709.7 4836.8 698.8 4809.7 668.6C4782.8 638.6 4771.3 591.5 4771.3 523.4V306.2C4771.3 298.5 4765 292.2 4757.3 292.2H4714.7C4707 292.2 4700.7 285.9 4700.7 278.2V190.2C4700.7 182.5 4707 176.2 4714.7 176.2H4757.3C4765 176.2 4771.3 169.9 4771.3 162.2V67.7002C4771.3 60.0002 4777.6 53.7002 4785.3 53.7002H4878.2C4885.9 53.7002 4892.2 60.0002 4892.2 67.7002V162.2C4892.2 169.9 4898.5 176.2 4906.2 176.2H5021.3C5029 176.2 5035.3 182.5 5035.3 190.2V278.2C5035.3 285.9 5029 292.2 5021.3 292.2H4906.1Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4024.4 607.2C4024.4 599.5 4018.1 593.2 4010.4 593.2H3699.9C3672.9 593.2 3655.3 586 3644.6 575.2C3633.8 564.4 3628.6 548.8 3628.6 529.7V514.5C3628.6 506.8 3634.9 500.5 3642.6 500.5H3866.6C3931.2 500.5 3977.4 486.9 4007.5 459.6C4037.7 432.2 4050.1 392.3 4050.1 343.5C4050.1 292.2 4036.8 250.1 4006.4 220.9C3976.1 191.7 3930.1 176.8 3867.7 176.8H3700.1C3633.9 176.8 3586.5 195.4 3555.6 227.8C3524.8 260.1 3511.8 305 3511.8 355.3V531.7C3511.8 582 3524.9 626.9 3555.6 659.2C3586.5 691.6 3633.9 710.2 3700.1 710.2H4010.6C4018.3 710.2 4024.6 703.9 4024.6 696.2V607.2H4024.4ZM3863.5 403.1H3642.5C3634.8 403.1 3628.5 396.8 3628.5 389.1V356.2C3628.5 337.6 3633.7 321.9 3644.6 311C3655.4 300.1 3672.9 292.7 3699.9 292.7H3866.5C3890.7 292.7 3906.9 298.8 3916.9 308.2C3926.9 317.5 3932 331.3 3932 349.4C3932 367.1 3927.3 380 3917.4 388.6C3907.4 397.4 3890.5 403.1 3863.5 403.1Z' fill='white'/%3E%3Cpath d='M2918.9 872.3C3001.9 872.3 3036.9 909.9 3036.9 966.3C3036.9 1012.2 3013.9 1036.8 2973.2 1047.2C3014.4 1058.2 3037.9 1083.7 3037.9 1129.7C3037.9 1186.1 3003.5 1224.7 2920.5 1224.7H2755.6C2741.5 1224.7 2734.2 1217.9 2734.2 1203.8V893.2C2734.2 879.1 2741.5 872.3 2755.6 872.3H2918.9ZM2765.4 1033.1H2918.9C2976.8 1033.1 3005 1014.8 3005 970.5C3005 929.8 2979.4 903.7 2919.4 903.7H2771.2C2767.5 903.7 2765.5 905.3 2765.5 909.4V1033.1H2765.4ZM2765.4 1187.6C2765.4 1191.8 2767.5 1193.3 2771.1 1193.3H2921C2979.5 1193.3 3006.1 1168.2 3006.1 1125.4C3006.1 1081 2976.9 1060.2 2921 1060.2H2765.5V1187.6H2765.4Z' fill='white'/%3E%3Cpath d='M3294 956.9V985.6H3182.8C3148.9 985.6 3135.3 1000.7 3135.3 1033.6V1224.6H3106.1V1029.9C3106.1 979.8 3125.4 956.8 3176.6 956.8H3294V956.9Z' fill='white'/%3E%3Cpath d='M3489.1 956.9C3562.2 956.9 3608.6 1001.3 3608.6 1091C3608.6 1181.3 3562.1 1224.6 3489.1 1224.6H3431.2C3357.6 1224.6 3311.7 1181.3 3311.7 1091C3311.7 1001.2 3357.6 956.9 3431.2 956.9H3489.1ZM3433.3 985.6C3374.3 985.6 3340.9 1019 3340.9 1091C3340.9 1163.5 3374.3 1196.4 3433.3 1196.4H3487.1C3546.1 1196.4 3579.5 1163.5 3579.5 1091C3579.5 1019 3546.1 985.6 3487.1 985.6H3433.3Z' fill='white'/%3E%3Cpath d='M3674.4 956.9L3706.8 1176.6C3709.4 1195.4 3716.2 1204.3 3737.1 1204.3C3758.5 1204.3 3767.4 1195.4 3771.5 1180.3L3821.6 995.5C3829.4 966.8 3849.3 951.7 3884.2 951.7C3919.1 951.7 3937.4 966.8 3945.3 995.5L3994.9 1180.3C3999.1 1195.4 4007.9 1204.3 4029.3 1204.3C4050.2 1204.3 4056.4 1195.4 4059.6 1176.6L4093.5 956.9H4125.3L4089.3 1179.8C4084.6 1210.6 4069.5 1231 4028.2 1231C3992.7 1231 3975 1216.4 3966.6 1185.1L3917 1000.9C3912.8 985.2 3900.8 978.5 3883.6 978.5C3865.9 978.5 3854.9 985.3 3850.7 1000.9L3799.6 1185.1C3790.7 1216.4 3773.5 1231 3737.5 1231C3695.2 1231 3682.2 1210.1 3677.5 1179.8L3643.1 956.9H3674.4Z' fill='white'/%3E%3Cpath d='M4417.6 956.9V985.6H4260C4219.8 985.6 4203.6 1003.3 4203.6 1032.1C4203.6 1057.2 4216.1 1077.5 4263.6 1077.5H4338.8C4410.8 1077.5 4428.6 1110.9 4428.6 1149.5C4428.6 1194.9 4404.6 1224.7 4344 1224.7H4178V1196.5H4344C4384.2 1196.5 4399.8 1178.2 4399.8 1149.5C4399.8 1124.4 4387.8 1103.6 4339.8 1103.6H4264.6C4193.1 1103.6 4174.8 1069.2 4174.8 1030C4174.8 985.1 4198.8 956.9 4259.4 956.9H4417.6Z' fill='white'/%3E%3Cpath d='M4685.4 956.9C4749.1 956.9 4775.7 986.6 4775.7 1036.8C4775.7 1084.8 4751.2 1111.4 4684.9 1111.4H4526.2V1135.9C4526.2 1170.3 4545 1196.4 4593.5 1196.4H4762.1V1224.6H4593.5C4524.6 1224.6 4497.5 1187.5 4497.5 1136.4V1045.1C4497.5 995 4524.6 956.9 4593.5 956.9H4685.4ZM4526.2 1087.4H4684.3C4729.7 1087.4 4746.9 1069.7 4746.9 1037.8C4746.9 1005.4 4728.6 985.6 4685.3 985.6H4593.4C4544.9 985.6 4526.1 1011.2 4526.1 1045.6V1087.4H4526.2Z' fill='white'/%3E%3Cpath d='M5040.3 956.9V985.6H4929.1C4895.2 985.6 4881.6 1000.7 4881.6 1033.6V1224.6H4852.4V1029.9C4852.4 979.8 4871.7 956.8 4922.9 956.8H5040.3V956.9Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_879_362'%3E%3Crect width='5041' height='1231' fill='white' transform='translate(0 0.700195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"},nj={loginPageLogo:tj},oj="200px",Ua=({logoSrc:e=nj.loginPageLogo.value,width:t=oj,className:n="logo"})=>l.jsx("img",{width:t,src:e,className:n,alt:"Login logo"}),_b=()=>l.jsx("span",{className:"spinner"});const cr=({Logo:e=Ua,text:t="Loading..."})=>l.jsx("div",{className:"system-loader-background",children:l.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[l.jsx(e,{}),l.jsx("h1",{className:"system-loader-text io-title",children:t}),l.jsx(_b,{})]})});var yd={exports:{}},gs={exports:{}},Ge={};/** @license React v16.13.1
|
|
58
58
|
* react-is.production.min.js
|
|
59
59
|
*
|
|
60
60
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
61
61
|
*
|
|
62
62
|
* This source code is licensed under the MIT license found in the
|
|
63
63
|
* LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/var
|
|
64
|
+
*/var Cm;function rj(){if(Cm)return Ge;Cm=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function x(w){if(typeof w=="object"&&w!==null){var C=w.$$typeof;switch(C){case t:switch(w=w.type,w){case c:case u:case o:case i:case r:case f:return w;default:switch(w=w&&w.$$typeof,w){case s:case d:case m:case h:case a:return w;default:return C}}case n:return C}}}function S(w){return x(w)===u}return Ge.AsyncMode=c,Ge.ConcurrentMode=u,Ge.ContextConsumer=s,Ge.ContextProvider=a,Ge.Element=t,Ge.ForwardRef=d,Ge.Fragment=o,Ge.Lazy=m,Ge.Memo=h,Ge.Portal=n,Ge.Profiler=i,Ge.StrictMode=r,Ge.Suspense=f,Ge.isAsyncMode=function(w){return S(w)||x(w)===c},Ge.isConcurrentMode=S,Ge.isContextConsumer=function(w){return x(w)===s},Ge.isContextProvider=function(w){return x(w)===a},Ge.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===t},Ge.isForwardRef=function(w){return x(w)===d},Ge.isFragment=function(w){return x(w)===o},Ge.isLazy=function(w){return x(w)===m},Ge.isMemo=function(w){return x(w)===h},Ge.isPortal=function(w){return x(w)===n},Ge.isProfiler=function(w){return x(w)===i},Ge.isStrictMode=function(w){return x(w)===r},Ge.isSuspense=function(w){return x(w)===f},Ge.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===o||w===u||w===i||w===r||w===f||w===p||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===h||w.$$typeof===a||w.$$typeof===s||w.$$typeof===d||w.$$typeof===y||w.$$typeof===b||w.$$typeof===k||w.$$typeof===g)},Ge.typeOf=x,Ge}var qe={};/** @license React v16.13.1
|
|
65
65
|
* react-is.development.js
|
|
66
66
|
*
|
|
67
67
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the MIT license found in the
|
|
70
70
|
* LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/var
|
|
71
|
+
*/var Em;function ij(){return Em||(Em=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,k=e?Symbol.for("react.scope"):60119;function x(M){return typeof M=="string"||typeof M=="function"||M===o||M===u||M===i||M===r||M===f||M===p||typeof M=="object"&&M!==null&&(M.$$typeof===m||M.$$typeof===h||M.$$typeof===a||M.$$typeof===s||M.$$typeof===d||M.$$typeof===y||M.$$typeof===b||M.$$typeof===k||M.$$typeof===g)}function S(M){if(typeof M=="object"&&M!==null){var se=M.$$typeof;switch(se){case t:var ce=M.type;switch(ce){case c:case u:case o:case i:case r:case f:return ce;default:var ge=ce&&ce.$$typeof;switch(ge){case s:case d:case m:case h:case a:return ge;default:return se}}case n:return se}}}var w=c,C=u,O=s,_=a,N=t,E=d,A=o,j=m,B=h,$=n,R=i,F=r,z=f,V=!1;function L(M){return V||(V=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(M)||S(M)===c}function H(M){return S(M)===u}function W(M){return S(M)===s}function U(M){return S(M)===a}function Y(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function D(M){return S(M)===d}function T(M){return S(M)===o}function P(M){return S(M)===m}function I(M){return S(M)===h}function G(M){return S(M)===n}function K(M){return S(M)===i}function X(M){return S(M)===r}function Z(M){return S(M)===f}qe.AsyncMode=w,qe.ConcurrentMode=C,qe.ContextConsumer=O,qe.ContextProvider=_,qe.Element=N,qe.ForwardRef=E,qe.Fragment=A,qe.Lazy=j,qe.Memo=B,qe.Portal=$,qe.Profiler=R,qe.StrictMode=F,qe.Suspense=z,qe.isAsyncMode=L,qe.isConcurrentMode=H,qe.isContextConsumer=W,qe.isContextProvider=U,qe.isElement=Y,qe.isForwardRef=D,qe.isFragment=T,qe.isLazy=P,qe.isMemo=I,qe.isPortal=G,qe.isProfiler=K,qe.isStrictMode=X,qe.isSuspense=Z,qe.isValidElementType=x,qe.typeOf=S}()),qe}var jm;function Ob(){return jm||(jm=1,process.env.NODE_ENV==="production"?gs.exports=rj():gs.exports=ij()),gs.exports}/*
|
|
72
72
|
object-assign
|
|
73
73
|
(c) Sindre Sorhus
|
|
74
74
|
@license MIT
|
|
75
|
-
*/var
|
|
76
|
-
Valid keys: `+JSON.stringify(Object.keys(H),null," "));var M=Z(I,X,D,T,P+"."+X,n);if(M)return M}return null}return y(W)}function $(H){switch(typeof H){case"number":case"string":case"undefined":return!0;case"boolean":return!H;case"object":if(Array.isArray(H))return H.every($);if(H===null||s(H))return!0;var W=f(H);if(W){var U=W.call(H),Y;if(W!==H.entries){for(;!(Y=U.next()).done;)if(!$(Y.value))return!1}else for(;!(Y=U.next()).done;){var D=Y.value;if(D&&!$(D[1]))return!1}}else return!1;return!0;default:return!1}}function R(H,W){return H==="symbol"?!0:W?W["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&W instanceof Symbol:!1}function F(H){var W=typeof H;return Array.isArray(H)?"array":H instanceof RegExp?"object":R(W,H)?"symbol":W}function z(H){if(typeof H>"u"||H===null)return""+H;var W=F(H);if(W==="object"){if(H instanceof Date)return"date";if(H instanceof RegExp)return"regexp"}return W}function V(H){var W=z(H);switch(W){case"array":case"object":return"an "+W;case"boolean":case"date":case"regexp":return"a "+W;default:return W}}function L(H){return!H.constructor||!H.constructor.name?p:H.constructor.name}return h.checkPropTypes=r,h.resetWarningCache=r.resetWarningCache,h.PropTypes=h,h},Xl}var Ql,Om;function rj(){if(Om)return Ql;Om=1;var e=Bf();function t(){}function n(){}return n.resetWarningCache=t,Ql=function(){function o(a,s,c,u,d,f){if(f!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}o.isRequired=o;function r(){return o}var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ql}if(process.env.NODE_ENV!=="production"){var ij=Eb(),aj=!0;pd.exports=oj()(ij.isElement,aj)}else pd.exports=rj()();var sj=pd.exports;const Ne=pw(sj);function hd(e){"@babel/helpers - typeof";return hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hd(e)}var cj;function _b(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:cj;return t?e.split(" ").map(function(n){return t[n]||n}).join(" "):e}var lj=(typeof window>"u"?"undefined":hd(window))==="object"&&window.Element||function(){};function uj(e,t,n){if(!(e[t]instanceof lj))return new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected prop to be an instance of Element. Validation failed.")}Ne.oneOfType([Ne.string,Ne.func,uj,Ne.shape({current:Ne.any})]);var dj=Ne.oneOfType([Ne.func,Ne.string,Ne.shape({$$typeof:Ne.symbol,render:Ne.func}),Ne.arrayOf(Ne.oneOfType([Ne.func,Ne.string,Ne.shape({$$typeof:Ne.symbol,render:Ne.func})]))]),fj=["className","cssModule","variant","innerRef"];function md(){return md=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},md.apply(this,arguments)}function Am(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function pj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Am(Object(n),!0).forEach(function(o){hj(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Am(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function hj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mj(e,t){if(e==null)return{};var n=gj(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function gj(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var yj={active:Ne.bool,"aria-label":Ne.string,onClick:Ne.func,variant:Ne.oneOf(["white"]),className:Ne.string,cssModule:Ne.object,innerRef:Ne.oneOfType([Ne.object,Ne.string,Ne.func])};function Ob(e){var t=e.className;e.cssModule;var n=e.variant,o=e.innerRef,r=mj(e,fj),i=_b(ro(t,"btn-close",n&&"btn-close-".concat(n)));return v.createElement("button",md({ref:o,type:"button",className:i},pj({"aria-label":"close"},r)))}Ob.propTypes=yj;var vj=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function gd(){return gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},gd.apply(this,arguments)}function wj(e,t){if(e==null)return{};var n=bj(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function bj(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var xj={active:Ne.bool,"aria-label":Ne.string,block:Ne.bool,children:Ne.node,className:Ne.string,cssModule:Ne.object,close:Ne.bool,color:Ne.string,disabled:Ne.bool,innerRef:Ne.oneOfType([Ne.object,Ne.func,Ne.string]),onClick:Ne.func,outline:Ne.bool,size:Ne.string,tag:dj};function cc(e){var t=v.useCallback(function(k){if(e.disabled){k.preventDefault();return}if(e.onClick)return e.onClick(k)},[e.onClick,e.disabled]),n=e.active,o=e["aria-label"],r=e.block,i=e.className,a=e.close,s=e.cssModule,c=e.color,u=c===void 0?"secondary":c,d=e.outline,f=e.size,p=e.tag,h=p===void 0?"button":p,m=e.innerRef,g=wj(e,vj);if(a)return v.createElement(Ob,g);var y="btn".concat(d?"-outline":"","-").concat(u),b=_b(ro(i,"btn",y,f?"btn-".concat(f):!1,r?"d-block w-100":!1,{active:n,disabled:e.disabled}),s);return g.href&&h==="button"&&(h="a"),v.createElement(h,gd({type:h==="button"&&g.onClick?"button":void 0},g,{className:b,ref:m,onClick:t,"aria-label":o}))}cc.propTypes=xj;const Ab=({children:e,description:t,heading:n,Image:o,title:r,className:i})=>l.jsxs("div",{className:ro("info-card",i),children:[r&&l.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&l.jsx("div",{className:"info-card-image",children:l.jsx(o,{})}),n&&l.jsx("h3",{className:"info-card-heading io-title",children:n}),l.jsx("p",{className:"info-card-description io-text-default-lh16",children:t}),e]}),kj=({activeStepName:e,showWarnIcon:t,stepsStatuses:n})=>l.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:Cs.map(({name:o,label:r},i)=>{const a=o===e,s=n[o].state,c=t&&a?l.jsx(jt,{variant:"exclamation-mark",size:"12"}):l.jsxs("span",{children:[i+1,"."]});return l.jsx("li",{className:ro(a&&"active"),children:l.jsxs("div",{className:"setup-flow-list-item",children:[l.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[s==="prompt"&&c,s==="granted"&&l.jsx(jt,{variant:"check-solid",size:"12"}),s==="denied"&&l.jsx(jt,{variant:"close",size:"12"})]}),r]})},o)})}),Sj=({edgeNotificationsPermissionTimeout:e,isNotificationsPermissionPromptOpen:t})=>{const{name:n}=QS(),[o,r]=v.useState(!1);return v.useEffect(()=>{if(!t||n!=="Edge")return;const i=setTimeout(()=>r(!0),e);return()=>clearTimeout(i)},[n,e,t]),v.useEffect(()=>{t&&!o||r(!1)},[t,o,r]),{hasEdgeNotificationsPermissionError:o}},Cj=(e,t)=>{const{type:n,payload:o}=t;switch(n){case"completed":return{...e,[o.stepName]:{...e[o.stepName],isCompleted:!0}};case"skipped":return{...e,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...e,[o.stepName]:{isCompleted:o.stepName===pt.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+n)}},Ej=e=>{const{handleDeferredStep:t,handleOperationComplete:n}=e;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:Yo.WINDOW_MANAGEMENT});o==="prompt"&&t()}).finally(n)},jj=e=>{const{handleDeferredStep:t,handleOperationComplete:n}=e;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:Yo.NOTIFICATIONS});o==="prompt"&&t()}).finally(n)},_j=e=>{const{handleDeferredStep:t,handleOperationComplete:n,dispatchAction:o}=e,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),s=window.open(r,void 0,i);a==null||a.close(),s==null||s.close();const c=!(a&&s);c&&t(),o({type:"stateUpdated",payload:{stepName:pt.POPUPS,state:c?"denied":"granted"}}),n()},Oj=e=>{const{dispatchAction:t}=e;t({type:"completed",payload:{stepName:pt.PWA_INSTALL}})},Aj={[pt.WINDOW_MANAGEMENT]:Ej,[pt.NOTIFICATIONS]:jj,[pt.POPUPS]:_j,[pt.PWA_INSTALL]:Oj},Pj=({settings:e})=>{const{permission:t}=cr(),[n,o]=Mr("localStorage",Ia,Ra),[r,i]=v.useReducer(Cj,NC),[a,s]=v.useState(!1),[c,u]=v.useState(!1),d=Cs.find(y=>!r[y.name].isCompleted);if(!d)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const f=d.name,p=Cs[Cs.length-1].name,{hasEdgeNotificationsPermissionError:h}=Sj({edgeNotificationsPermissionTimeout:e.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:c&&f===Yo.NOTIFICATIONS}),m=()=>{s(!1),u(!0),Aj[f]({handleDeferredStep:()=>s(!0),handleOperationComplete:()=>u(!1),dispatchAction:y=>i(y)}),f===p&&o({isCompleted:!0})},g=()=>{s(!1),i({type:"skipped",payload:{stepName:f}})};return v.useEffect(()=>{h&&(u(!1),s(!0))},[h]),v.useEffect(()=>{var y,b;s(!1),i({type:"stateUpdated",payload:{stepName:pt.WINDOW_MANAGEMENT,state:gf?(y=t.statuses[pt.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:pt.NOTIFICATIONS,state:(b=t.statuses[pt.NOTIFICATIONS])==null?void 0:b.state}})},[t.statuses]),l.jsxs(Ab,{description:d.description,heading:d.heading,Image:d.Image,title:"Platform Setup",children:[l.jsx(kj,{activeStepName:f,showWarnIcon:a&&f!==pt.POPUPS,stepsStatuses:r}),l.jsx("p",{className:"io-text-default-lh16",children:a?d.instructions.additional:d.instructions.initial}),l.jsxs(Be,{children:[l.jsx(cc,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:c,onClick:m,children:d.actionBtnText}),f!==p&&f!==pt.WINDOW_MANAGEMENT&&l.jsx(cc,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:c,onClick:g,children:"Skip"})]}),c&&l.jsx(Cb,{})]})};const zf=({components:{Logo:e=Wa,Loader:t=lr}={},settings:n={}})=>{const{permission:o}=cr();return o.isLoading?l.jsx(t,{text:"Checking browser permissions..."}):l.jsx(Sb,{Logo:e,children:l.jsx(Pj,{settings:{...jC,...n}})})};const Ff=({errorMessage:e})=>{const t="https://support.interop.io",n=l.jsxs(l.Fragment,{children:["It seems that the following error prevents io.Connect Browser",l.jsx("br",{}),"from operating properly:",l.jsxs("span",{className:"browser-start-failed-error",children:["“",e,"”"]}),l.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",l.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),l.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return l.jsx(Sb,{Logo:Wa,children:l.jsx(Ab,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:n,Image:EC,children:l.jsx(cc,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(t,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},Pb=()=>l.jsxs(l.Fragment,{children:[l.jsx(Xn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),l.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",l.jsx("br",{}),"digital transformation."]})]}),Nb=({Logo:e,children:t,className:n})=>l.jsx("div",{className:"login-page-background",children:l.jsxs("div",{className:ro(n,"login-form-container flex flex-column ai-center"),children:[l.jsx(e,{}),t]})}),Nj=({onLogin:e,isLoading:t,validationError:n,components:{Logo:o=Wa,Heading:r=Pb,Loader:i=lr}={}})=>t?l.jsx(i,{text:"Verifying credentials..."}):l.jsxs(Nb,{Logo:o,children:[l.jsx(r,{}),l.jsx(tt,{className:"auth0-login-btn",onClick:e,size:"large",variant:"primary",children:"Log In"}),n&&l.jsx(Gb,{variant:"critical",text:n.message})]}),Pm=(e,t)=>{const n=t.value,o=n.trim().length>3;return{value:n,isValid:o}},Tj=({onLogin:e,setIsLoading:t,loginError:n,setLoginError:o,userInputName:r="email"})=>{const[i,a]=v.useReducer(Pm,{value:"",isValid:!1}),[s,c]=v.useReducer(Pm,{value:"",isValid:!1}),[u,d]=v.useState(!1),[f,p]=v.useState(!1),{isValid:h}=i,{isValid:m}=s,g=h&&m,y=w=>a({value:w.target.value}),b=w=>c({value:w.target.value}),k=()=>{h||d(!0)},x=()=>{m||p(!0)},S=async w=>{if(w.preventDefault(),!!g){t(!0);try{await e(i.value,s.value)}catch(C){o(C)}t(!1)}};return l.jsxs("form",{className:"simple-login-form",onSubmit:S,children:[l.jsx(nr,{id:"user",errorMessage:u?`The ${r} is too short`:void 0,autoFocus:!0,autoComplete:"off",type:"text",placeholder:`Enter your ${r}`,value:i.value,onChange:y,onBlur:k,onFocus:()=>d(!1)}),l.jsx(nr,{id:"password",errorMessage:f?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:s.value,onChange:b,onBlur:x,onFocus:()=>p(!1)}),l.jsx(tt,{type:"submit",size:"large",variant:"primary",children:"Log In"}),n&&l.jsxs("div",{className:"login-error-feedback",children:[l.jsx(jt,{className:"error-icon",variant:"close",size:"12"}),n.message]})]})};const Ij=({onLogin:e,userInputName:t,components:{Logo:n=Wa,Heading:o=Pb,Loader:r=lr}={}})=>{const[i,a]=v.useState(!1),[s,c]=v.useState(null);return i?l.jsx(r,{text:"Verifying credentials..."}):l.jsxs(Nb,{Logo:n,children:[l.jsx(o,{}),l.jsx(Tj,{onLogin:e,setIsLoading:a,loginError:s,setLoginError:c,userInputName:t})]})};function Rj(e,t){const[n,o]=v.useState(!0),r=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(e)}catch(c){console.warn(c);return}const s=a.getAllGroups().find(c=>c.id===t);s&&(i=await s.onLockConfigurationChanged(({showAddWindowButton:c})=>{c!==void 0&&o(c)}),o(!!s.showAddWindowButton))})(),()=>i==null?void 0:i()},[e,t,r.workspaces]),n}const Lj=({groupId:e,workspaceId:t})=>{const n=Rj(t,e),o=v.useCallback(r=>{Os.showAddApplicationPopup({bounds:r,groupId:e,workspaceId:t})},[e,t]);return n&&l.jsx(Os.AddWindowButton,{title:"Add App",visible:n,showPopup:o})},Dj=e=>l.jsx(Os.GroupHeaderButtons,{...e,addWindow:{visible:!1,showPopup:e.addWindow.showPopup}}),Mj=()=>null;const Tb=({className:e,components:t,onClose:n,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=mf;return l.jsx(r,{children:l.jsx(i,{children:l.jsx(a,{className:e,components:t,onClose:n,title:o})})})};const Ib=US.Panel;const{DIALOG_TEMPLATE_NAMES:$j,useActiveLayout:Hj}=Ot,Rb=({className:e,components:t,onClose:n,title:o})=>{const r=v.useContext(Ie.IOConnectContext),{onLogout:i}=gw(),{setActiveLayout:a}=Hj(),{login:{setIsLoggingOut:s}}=cr(),c=v.useCallback(async()=>{var u;if("modals"in r&&r.modals){const d="log-out",{isEnterPressed:f,responseButtonClicked:p}=await r.modals.dialogs.request({templateName:$j.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:"Logging out of io.Connect Browser",text:"This will terminate your session.",actionButtons:[{variant:"primary",text:"Log out",id:d,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(f||(p==null?void 0:p.id)===d))return}$o.flushSync(()=>s(!0)),a(null),await((u=r.webPlatform)==null?void 0:u.system.shutdown());try{i==null||i()}catch(d){console.error(d)}},[r,i]);return l.jsx(fw.Panel,{className:e,components:t,onClose:n,onLogout:c,title:o})},Bj=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:e=>e(Ib)},{name:"notificationSettings",displayName:"Notification Settings",icon:"bell",onClick:e=>e(Tb),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:e=>e(Rb)}],zj=e=>({onClose:t})=>l.jsx(e,{className:"system-menu-panel",onClose:t});const Lb=({actions:e,panelWrapperClassName:t})=>{const[n,o]=v.useState(),r=v.useRef(null),i=wC(),a=v.useCallback(()=>o(void 0),[]),s=!!n;v.useEffect(()=>{!s||i!=="Escape"||a()},[s,i]);const c=v.useCallback((u,d)=>{const f=e.find(({name:h})=>h===d.name);if(!f){console.error(`Action named ${d.name} is not part of the provided list of actions: ${JSON.stringify(e)}!`);return}const p=h=>{const m=zj(h);o(()=>m)};f.onClick(p)},[e]);return ww({eventType:"mouseup",handler:a,ref:r,skip:!s}),vw({handler:a,skip:!s}),l.jsxs(l.Fragment,{children:[l.jsx(Md,{buttonSize:"32",iconSize:"16",actions:e,onActionItemClick:c,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8],"data-testid":"system-menu-button",contextMenuDataTestId:"system-menu"}),l.jsx(xw,{className:ro("system-menu-panel-wrapper",t),isOpen:s,onClose:a,Panel:n,position:"right",ref:r})]})},Fj=()=>l.jsx("li",{className:"default-header-system-menu",children:l.jsx(Lb,{actions:Bj})}),Wj=()=>{const{showNotificationBadge:e}=eC(),t=yw(),o=v.useMemo(()=>t.filter(({state:r})=>r==="Active"||r==="Stale"),[t]).length;return o>0&&e?l.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const Db=e=>{const{className:t,active:n,...o}=e;return l.jsxs("div",{className:ro(t,"notifications-panel-button"),...o,children:[l.jsx(Ue,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),l.jsx(Wj,{})]})},Mb=({className:e,components:t,onClose:n,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:s}=mf;return l.jsx(i,{children:l.jsx(a,{children:l.jsx(s,{className:e,components:t,onClose:n,settings:o,title:r})})})},$b=({Button:e=Db,Panel:t=Mb,position:n="right",...o})=>{const r=yw(),i=v.useContext(Ie.IOConnectContext),a=v.useCallback(async()=>{await Promise.all(r.map(({id:s})=>i.notifications.setState(s,"Seen")))},[r]);return l.jsx(wf,{Button:e,Panel:t,position:n,onClose:a,...o})};const Uj=()=>l.jsxs(l.Fragment,{children:[l.jsx($b,{tag:"li"}),l.jsx(Fj,{})]}),Wf=({onLogout:e,workspaces:t,launchpad:n,Loader:o=lr,isBeforeunloadDialogEnabled:r})=>{var g,y,b,k;const{LogoComponent:i,SystemButtonsComponent:a}=((g=t==null?void 0:t.components)==null?void 0:g.header)??{},{setPlatformWindow:s}=vf(),{isInitialSetupCompleted:c}=py(),u=(y=window.iobrowser)==null?void 0:y.platformStarted,d=i??(u?kw:Mj),f=a??(u?Uj:void 0),p=ZS(),{login:{isLoggingOut:h}}=cr();JS(r===!1||h),v.useEffect(()=>{u&&s({name:window.name})},[u,s]);const m=v.useMemo(()=>({onLogout:e,launchpadSettings:n==null?void 0:n.settings,launchpadComponents:n==null?void 0:n.components}),[e,n==null?void 0:n.settings,n==null?void 0:n.components]);return l.jsxs(mw.Provider,{value:m,children:[(!p||!c)&&l.jsx(o,{text:"Loading io.Connect Home..."}),l.jsx(Os,{components:{...t==null?void 0:t.components,header:{...(b=t==null?void 0:t.components)==null?void 0:b.header,LogoComponent:d,SystemButtonsComponent:f},groupHeader:{AfterTabsComponent:Lj,ButtonsComponent:Dj,...(k=t==null?void 0:t.components)==null?void 0:k.groupHeader}}})]})},Vj=ht({id:sn,username:Me(sn),email:Me(sn),firstName:Me(sn),lastName:Me(sn),token:Me(sn),password:Me(sn)}),Kj=({config:e})=>{var b,k,x,S;const{setupFlow:t,login:n,workspaces:o,launchpad:r,getIOConnectConfig:i}=e,[a,s]=Mr("localStorage",nC,Vj),[c]=Mr("localStorage",Ia,Ra),[u,d]=v.useState(null),{login:{isLoggingOut:f}}=cr(),p=yf(),h=((b=e.components)==null?void 0:b.SystemLoader)??lr,m=((k=e.components)==null?void 0:k.IOInitErrorScreen)??Ff,g=v.useCallback(async(w,C)=>{const O=await n.onLogin(w,C);s(O)},[n,s]),y=v.useCallback(()=>{var w;(w=n.onLogout)==null||w.call(n),s(null),window.location.reload()},[n.onLogout,s]);return f?l.jsx(h,{text:"Logging out..."}):a?!(c!=null&&c.isCompleted)&&(t==null?void 0:t.enabled)!==!1&&!p?l.jsx(zf,{settings:t==null?void 0:t.settings,components:{...t==null?void 0:t.components,Loader:h}}):u&&!u.message.includes("has already been started")?l.jsx(m,{errorMessage:u.message}):l.jsx(Ie.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:d,fallback:l.jsx(h,{text:"Initializing the platform..."}),children:l.jsx(wc,{launchpadMode:(x=r==null?void 0:r.settings)==null?void 0:x.mode,children:l.jsx(Wf,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(S=e.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:h})})}):l.jsx(Ij,{onLogin:g,userInputName:n.userInputName,components:{...n.components,Loader:h}})},Gj=ht({message:sn}),qj=e=>{const t=kb(),[n,o]=v.useState(void 0),[r,i]=Mr("sessionStorage",tC,Gj),a=v.useMemo(()=>t.user?(e==null?void 0:e(t.user))??{ok:!0}:null,[t.user,e]),s=(a==null?void 0:a.ok)===!1,c=t.isLoading||t.isAuthenticated&&!n,u=s||c,d=v.useMemo(()=>{var f;return a!=null&&a.ok&&((f=t.user)!=null&&f.email)&&n?{username:t.user.name,id:t.user.email,token:n}:null},[t.user,n,a==null?void 0:a.ok]);return v.useEffect(()=>{t.isAuthenticated&&t.getAccessTokenSilently().then(o).catch(console.warn)},[t]),v.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),t.logout()}},[t,i,a]),{isLoading:u,validationError:r,user:d}},yd={POPUP:"popup",REDIRECT:"redirect"},Jj=({config:e})=>{var x,S,w,C;const t=kb(),{setupFlow:n,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=e,{isLoading:s,validationError:c,user:u}=qj(o.validateUser),f=(o.loginType??yd.REDIRECT)===yd.REDIRECT?t.loginWithRedirect:t.loginWithPopup,[p]=Mr("localStorage",Ia,Ra),[h,m]=v.useState(null),{login:{isLoggingOut:g}}=cr(),y=yf(),b=((x=e.components)==null?void 0:x.SystemLoader)??lr,k=((S=e.components)==null?void 0:S.IOInitErrorScreen)??Ff;return g?l.jsx(b,{text:"Logging out..."}):u?!(p!=null&&p.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!y?l.jsx(zf,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:b}}):h&&!h.message.includes("has already been started")?l.jsx(k,{errorMessage:h.message}):l.jsx(Ie.IOConnectProvider,{settings:a({type:"auth0",user:{...t.user,id:u.id,token:u.token}}),onInitError:m,fallback:l.jsx(b,{text:"Initializing the platform..."}),children:l.jsx(wc,{launchpadMode:(w=r==null?void 0:r.settings)==null?void 0:w.mode,children:l.jsx(Wf,{workspaces:i,launchpad:r,onLogout:t.logout,isBeforeunloadDialogEnabled:(C=e.settings)==null?void 0:C.isBeforeunloadDialogEnabled,Loader:b})})}):l.jsx(Nj,{onLogin:f,isLoading:s,validationError:c,components:{...o.components,Loader:b}})},Nm=({config:e})=>{var g,y,b,k;const{setupFlow:t,launchpad:n,workspaces:o,getIOConnectConfig:r}=e,{onLogout:i,user:a}=e.login??{},{isPlatformWindow:s}=vf(),[c]=Mr("localStorage",Ia,Ra),[u,d]=v.useState(null),{login:{isLoggingOut:f}}=cr(),p=yf(),h=((g=e.components)==null?void 0:g.SystemLoader)??lr,m=((y=e.components)==null?void 0:y.IOInitErrorScreen)??Ff;return f?l.jsx(h,{text:"Logging out..."}):!(c!=null&&c.isCompleted)&&(t==null?void 0:t.enabled)!==!1&&s&&!p?l.jsx(zf,{settings:t==null?void 0:t.settings,components:{...t==null?void 0:t.components,Loader:h}}):u&&!u.message.includes("has already been started")?l.jsx(m,{errorMessage:u.message}):l.jsx(Ie.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:d,fallback:l.jsx(h,{text:"Initializing the platform..."}),children:l.jsx(wc,{launchpadMode:(b=n==null?void 0:n.settings)==null?void 0:b.mode,children:l.jsx(Wf,{workspaces:o,launchpad:n,onLogout:i,isBeforeunloadDialogEnabled:(k=e.settings)==null?void 0:k.isBeforeunloadDialogEnabled,Loader:h})})})},Hb=ht({Logo:Me(Vt().andThen(e=>mn(e,"Logo"))),Heading:Me(Vt().andThen(e=>mn(e,"Heading")))}),Zj=xa(...Object.values(yd).map(e=>or(e))),Yj=ht({type:or("auth0"),validateUser:Me(Vt().andThen(e=>mn(e,"validateUser"))),loginType:Me(Zj),providerOptions:Vt(),components:Me(Hb)}),Xj=ht({type:or("simple"),onLogin:Vt().andThen(e=>mn(e,"onLogin")),onLogout:Me(Vt().andThen(e=>mn(e,"onLogout"))),userInputName:Me(sn),components:Me(Hb)}),Qj=ht({id:sn,username:sn}),e4=ht({type:or("custom"),onLogout:Vt().andThen(e=>mn(e,"onLogout")),user:Qj}),t4=xa(Yj,Xj,e4),n4=ht({edgeNotificationsPermissionTimeout:Me(mC)}),o4=ht({Logo:Me(Vt().andThen(e=>mn(e,"Logo")))}),r4=ht({enabled:Me(ba()),components:Me(o4),settings:Me(n4)}),i4=ht({components:Me(Vt())}),a4=ht({BeforeSearch:xa(or(null),Me(Vt().andThen(e=>mn(e,"BeforeSearch")))),AfterSearch:xa(or(null),Me(Vt().andThen(e=>mn(e,"AfterSearch"))))}),s4=ht({Component:Vt().andThen(e=>mn(e,"Component")),placementId:sn}),c4=ht({header:Me(a4),sections:Me(pC(s4))}),l4=ht({showHeader:Me(ba()),showSearch:Me(ba())}),u4=ht({header:Me(l4),mode:Me(xa(or("pinned"),or("default")))}),d4=ht({components:Me(c4),settings:Me(u4)}),f4=ht({SystemLoader:Me(Vt().andThen(e=>mn(e,"SystemLoader"))),IOInitErrorScreen:Me(Vt().andThen(e=>mn(e,"IOInitErrorScreen")))}),p4=ht({isBeforeunloadDialogEnabled:Me(ba())}),h4=ht({getIOConnectConfig:Vt().andThen(e=>mn(e,"getIOConnectConfig")),login:Me(t4),setupFlow:Me(r4),workspaces:Me(i4),launchpad:Me(d4),components:Me(f4),settings:Me(p4)}),m4=({config:e})=>{var i;const t=v.useMemo(()=>h4.runWithException(e),[e]),n=t.login,{isPlatformWindow:o}=vf();if(!n||!o){const{login:a,...s}=t;return l.jsx(Nm,{config:s})}if(n.type==="custom")return l.jsx(Nm,{config:t});if(n.type==="simple")return l.jsx(Kj,{config:t});const{providerOptions:r}=n;return l.jsx(JE,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:l.jsx(Jj,{config:t})})};const g4=({config:e})=>l.jsx(bC,{children:l.jsx(m4,{config:e})}),y4=Ot.ApplicationsSection,v4=Ot.FavoritesSection,w4=Ot.Panel,b4=Ot.Body,x4=Ot.ContentsContainer,k4=Ot.Header,S4=Ot.PinButton,C4=Ot.Section,E4=Ot.WorkspacesSection,j4=Ot.useFavorites,_4=Ot.useIsLaunchpadCollapsed;exports.ApplicationsSection=y4;exports.FavoritesSection=v4;exports.IOActivePanelRenderer=Xk;exports.IOConnectHome=g4;exports.IODownloadManager=Nk;exports.IONotifications=mf;exports.IOPreferencesDesktop=FS;exports.IOProfile=fw;exports.Launchpad=w4;exports.LaunchpadAccess=kw;exports.LaunchpadBody=b4;exports.LaunchpadContentsContainer=x4;exports.LaunchpadHeader=k4;exports.LaunchpadPinButton=S4;exports.NotificationSettingsPanel=Tb;exports.NotificationsPanel=Mb;exports.NotificationsPanelButton=Db;exports.NotificationsPanelWithToggleButton=$b;exports.PanelWithToggleButton=wf;exports.PlatformPrefsProvider=wc;exports.PreferencesPanel=Ib;exports.ProfilePanel=Rb;exports.Section=C4;exports.SystemLoader=lr;exports.SystemMenu=Lb;exports.WorkspacesSection=E4;exports.useFavorites=j4;exports.useIsLaunchpadCollapsed=_4;exports.usePlatformPref=Mt;exports.usePlatformPrefs=py;
|
|
75
|
+
*/var Xl,_m;function aj(){if(_m)return Xl;_m=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function r(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var c=Object.getOwnPropertyNames(a).map(function(d){return a[d]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Xl=r()?Object.assign:function(i,a){for(var s,c=o(i),u,d=1;d<arguments.length;d++){s=Object(arguments[d]);for(var f in s)t.call(s,f)&&(c[f]=s[f]);if(e){u=e(s);for(var p=0;p<u.length;p++)n.call(s,u[p])&&(c[u[p]]=s[u[p]])}}return c},Xl}var Ql,Om;function Vf(){if(Om)return Ql;Om=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ql=e,Ql}var eu,Am;function Ab(){return Am||(Am=1,eu=Function.call.bind(Object.prototype.hasOwnProperty)),eu}var tu,Pm;function sj(){if(Pm)return tu;Pm=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Vf(),n={},o=Ab();e=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function r(i,a,s,c,u){if(process.env.NODE_ENV!=="production"){for(var d in i)if(o(i,d)){var f;try{if(typeof i[d]!="function"){var p=Error((c||"React class")+": "+s+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}f=i[d](a,d,c,s,null,t)}catch(m){f=m}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+s+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var h=u?u():"";e("Failed "+s+" type: "+f.message+(h??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},tu=r,tu}var nu,Nm;function cj(){if(Nm)return nu;Nm=1;var e=Ob(),t=aj(),n=Vf(),o=Ab(),r=sj(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function a(){return null}return nu=function(s,c){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(H){var W=H&&(u&&H[u]||H[d]);if(typeof W=="function")return W}var p="<<anonymous>>",h={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:k(),arrayOf:x,element:S(),elementType:w(),instanceOf:C,node:E(),objectOf:_,oneOf:O,oneOfType:N,shape:j,exact:B};function m(H,W){return H===W?H!==0||1/H===1/W:H!==H&&W!==W}function g(H,W){this.message=H,this.data=W&&typeof W=="object"?W:{},this.stack=""}g.prototype=Error.prototype;function y(H){if(process.env.NODE_ENV!=="production")var W={},U=0;function Y(T,P,I,G,K,X,Z){if(G=G||p,X=X||I,Z!==n){if(c){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var se=G+":"+I;!W[se]&&U<3&&(i("You are manually calling a React.PropTypes validation function for the `"+X+"` prop on `"+G+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),W[se]=!0,U++)}}return P[I]==null?T?P[I]===null?new g("The "+K+" `"+X+"` is marked as required "+("in `"+G+"`, but its value is `null`.")):new g("The "+K+" `"+X+"` is marked as required in "+("`"+G+"`, but its value is `undefined`.")):null:H(P,I,G,K,X)}var D=Y.bind(null,!1);return D.isRequired=Y.bind(null,!0),D}function b(H){function W(U,Y,D,T,P,I){var G=U[Y],K=F(G);if(K!==H){var X=z(G);return new g("Invalid "+T+" `"+P+"` of type "+("`"+X+"` supplied to `"+D+"`, expected ")+("`"+H+"`."),{expectedType:H})}return null}return y(W)}function k(){return y(a)}function x(H){function W(U,Y,D,T,P){if(typeof H!="function")return new g("Property `"+P+"` of component `"+D+"` has invalid PropType notation inside arrayOf.");var I=U[Y];if(!Array.isArray(I)){var G=F(I);return new g("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+D+"`, expected an array."))}for(var K=0;K<I.length;K++){var X=H(I,K,D,T,P+"["+K+"]",n);if(X instanceof Error)return X}return null}return y(W)}function S(){function H(W,U,Y,D,T){var P=W[U];if(!s(P)){var I=F(P);return new g("Invalid "+D+" `"+T+"` of type "+("`"+I+"` supplied to `"+Y+"`, expected a single ReactElement."))}return null}return y(H)}function w(){function H(W,U,Y,D,T){var P=W[U];if(!e.isValidElementType(P)){var I=F(P);return new g("Invalid "+D+" `"+T+"` of type "+("`"+I+"` supplied to `"+Y+"`, expected a single ReactElement type."))}return null}return y(H)}function C(H){function W(U,Y,D,T,P){if(!(U[Y]instanceof H)){var I=H.name||p,G=L(U[Y]);return new g("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+D+"`, expected ")+("instance of `"+I+"`."))}return null}return y(W)}function O(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function W(U,Y,D,T,P){for(var I=U[Y],G=0;G<H.length;G++)if(m(I,H[G]))return null;var K=JSON.stringify(H,function(Z,M){var se=z(M);return se==="symbol"?String(M):M});return new g("Invalid "+T+" `"+P+"` of value `"+String(I)+"` "+("supplied to `"+D+"`, expected one of "+K+"."))}return y(W)}function _(H){function W(U,Y,D,T,P){if(typeof H!="function")return new g("Property `"+P+"` of component `"+D+"` has invalid PropType notation inside objectOf.");var I=U[Y],G=F(I);if(G!=="object")return new g("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+D+"`, expected an object."));for(var K in I)if(o(I,K)){var X=H(I,K,D,T,P+"."+K,n);if(X instanceof Error)return X}return null}return y(W)}function N(H){if(!Array.isArray(H))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var W=0;W<H.length;W++){var U=H[W];if(typeof U!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+V(U)+" at index "+W+"."),a}function Y(D,T,P,I,G){for(var K=[],X=0;X<H.length;X++){var Z=H[X],M=Z(D,T,P,I,G,n);if(M==null)return null;M.data&&o(M.data,"expectedType")&&K.push(M.data.expectedType)}var se=K.length>0?", expected one of type ["+K.join(", ")+"]":"";return new g("Invalid "+I+" `"+G+"` supplied to "+("`"+P+"`"+se+"."))}return y(Y)}function E(){function H(W,U,Y,D,T){return $(W[U])?null:new g("Invalid "+D+" `"+T+"` supplied to "+("`"+Y+"`, expected a ReactNode."))}return y(H)}function A(H,W,U,Y,D){return new g((H||"React class")+": "+W+" type `"+U+"."+Y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+D+"`.")}function j(H){function W(U,Y,D,T,P){var I=U[Y],G=F(I);if(G!=="object")return new g("Invalid "+T+" `"+P+"` of type `"+G+"` "+("supplied to `"+D+"`, expected `object`."));for(var K in H){var X=H[K];if(typeof X!="function")return A(D,T,P,K,z(X));var Z=X(I,K,D,T,P+"."+K,n);if(Z)return Z}return null}return y(W)}function B(H){function W(U,Y,D,T,P){var I=U[Y],G=F(I);if(G!=="object")return new g("Invalid "+T+" `"+P+"` of type `"+G+"` "+("supplied to `"+D+"`, expected `object`."));var K=t({},U[Y],H);for(var X in K){var Z=H[X];if(o(H,X)&&typeof Z!="function")return A(D,T,P,X,z(Z));if(!Z)return new g("Invalid "+T+" `"+P+"` key `"+X+"` supplied to `"+D+"`.\nBad object: "+JSON.stringify(U[Y],null," ")+`
|
|
76
|
+
Valid keys: `+JSON.stringify(Object.keys(H),null," "));var M=Z(I,X,D,T,P+"."+X,n);if(M)return M}return null}return y(W)}function $(H){switch(typeof H){case"number":case"string":case"undefined":return!0;case"boolean":return!H;case"object":if(Array.isArray(H))return H.every($);if(H===null||s(H))return!0;var W=f(H);if(W){var U=W.call(H),Y;if(W!==H.entries){for(;!(Y=U.next()).done;)if(!$(Y.value))return!1}else for(;!(Y=U.next()).done;){var D=Y.value;if(D&&!$(D[1]))return!1}}else return!1;return!0;default:return!1}}function R(H,W){return H==="symbol"?!0:W?W["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&W instanceof Symbol:!1}function F(H){var W=typeof H;return Array.isArray(H)?"array":H instanceof RegExp?"object":R(W,H)?"symbol":W}function z(H){if(typeof H>"u"||H===null)return""+H;var W=F(H);if(W==="object"){if(H instanceof Date)return"date";if(H instanceof RegExp)return"regexp"}return W}function V(H){var W=z(H);switch(W){case"array":case"object":return"an "+W;case"boolean":case"date":case"regexp":return"a "+W;default:return W}}function L(H){return!H.constructor||!H.constructor.name?p:H.constructor.name}return h.checkPropTypes=r,h.resetWarningCache=r.resetWarningCache,h.PropTypes=h,h},nu}var ou,Tm;function lj(){if(Tm)return ou;Tm=1;var e=Vf();function t(){}function n(){}return n.resetWarningCache=t,ou=function(){function o(a,s,c,u,d,f){if(f!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}o.isRequired=o;function r(){return o}var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},ou}if(process.env.NODE_ENV!=="production"){var uj=Ob(),dj=!0;yd.exports=cj()(uj.isElement,dj)}else yd.exports=lj()();var fj=yd.exports;const Ne=gw(fj);function vd(e){"@babel/helpers - typeof";return vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vd(e)}var pj;function Pb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pj;return t?e.split(" ").map(function(n){return t[n]||n}).join(" "):e}var hj=(typeof window>"u"?"undefined":vd(window))==="object"&&window.Element||function(){};function mj(e,t,n){if(!(e[t]instanceof hj))return new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected prop to be an instance of Element. Validation failed.")}Ne.oneOfType([Ne.string,Ne.func,mj,Ne.shape({current:Ne.any})]);var gj=Ne.oneOfType([Ne.func,Ne.string,Ne.shape({$$typeof:Ne.symbol,render:Ne.func}),Ne.arrayOf(Ne.oneOfType([Ne.func,Ne.string,Ne.shape({$$typeof:Ne.symbol,render:Ne.func})]))]),yj=["className","cssModule","variant","innerRef"];function wd(){return wd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},wd.apply(this,arguments)}function Im(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function vj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Im(Object(n),!0).forEach(function(o){wj(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Im(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function wj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bj(e,t){if(e==null)return{};var n=xj(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function xj(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var kj={active:Ne.bool,"aria-label":Ne.string,onClick:Ne.func,variant:Ne.oneOf(["white"]),className:Ne.string,cssModule:Ne.object,innerRef:Ne.oneOfType([Ne.object,Ne.string,Ne.func])};function Nb(e){var t=e.className;e.cssModule;var n=e.variant,o=e.innerRef,r=bj(e,yj),i=Pb(ro(t,"btn-close",n&&"btn-close-".concat(n)));return v.createElement("button",wd({ref:o,type:"button",className:i},vj({"aria-label":"close"},r)))}Nb.propTypes=kj;var Sj=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function bd(){return bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},bd.apply(this,arguments)}function Cj(e,t){if(e==null)return{};var n=Ej(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Ej(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var jj={active:Ne.bool,"aria-label":Ne.string,block:Ne.bool,children:Ne.node,className:Ne.string,cssModule:Ne.object,close:Ne.bool,color:Ne.string,disabled:Ne.bool,innerRef:Ne.oneOfType([Ne.object,Ne.func,Ne.string]),onClick:Ne.func,outline:Ne.bool,size:Ne.string,tag:gj};function lc(e){var t=v.useCallback(function(k){if(e.disabled){k.preventDefault();return}if(e.onClick)return e.onClick(k)},[e.onClick,e.disabled]),n=e.active,o=e["aria-label"],r=e.block,i=e.className,a=e.close,s=e.cssModule,c=e.color,u=c===void 0?"secondary":c,d=e.outline,f=e.size,p=e.tag,h=p===void 0?"button":p,m=e.innerRef,g=Cj(e,Sj);if(a)return v.createElement(Nb,g);var y="btn".concat(d?"-outline":"","-").concat(u),b=Pb(ro(i,"btn",y,f?"btn-".concat(f):!1,r?"d-block w-100":!1,{active:n,disabled:e.disabled}),s);return g.href&&h==="button"&&(h="a"),v.createElement(h,bd({type:h==="button"&&g.onClick?"button":void 0},g,{className:b,ref:m,onClick:t,"aria-label":o}))}lc.propTypes=jj;const Tb=({children:e,description:t,heading:n,Image:o,title:r,className:i})=>l.jsxs("div",{className:ro("info-card",i),children:[r&&l.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&l.jsx("div",{className:"info-card-image",children:l.jsx(o,{})}),n&&l.jsx("h3",{className:"info-card-heading io-title",children:n}),l.jsx("p",{className:"info-card-description io-text-default-lh16",children:t}),e]}),_j=({activeStepName:e,showWarnIcon:t,stepsStatuses:n})=>l.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:Es.map(({name:o,label:r},i)=>{const a=o===e,s=n[o].state,c=t&&a?l.jsx(xt,{variant:"exclamation-mark",size:"12"}):l.jsxs("span",{children:[i+1,"."]});return l.jsx("li",{className:ro(a&&"active"),children:l.jsxs("div",{className:"setup-flow-list-item",children:[l.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[s==="prompt"&&c,s==="granted"&&l.jsx(xt,{variant:"check-solid",size:"12"}),s==="denied"&&l.jsx(xt,{variant:"close",size:"12"})]}),r]})},o)})}),Oj=({edgeNotificationsPermissionTimeout:e,isNotificationsPermissionPromptOpen:t})=>{const{name:n}=rC(),[o,r]=v.useState(!1);return v.useEffect(()=>{if(!t||n!=="Edge")return;const i=setTimeout(()=>r(!0),e);return()=>clearTimeout(i)},[n,e,t]),v.useEffect(()=>{t&&!o||r(!1)},[t,o,r]),{hasEdgeNotificationsPermissionError:o}},Aj=(e,t)=>{const{type:n,payload:o}=t;switch(n){case"completed":return{...e,[o.stepName]:{...e[o.stepName],isCompleted:!0}};case"skipped":return{...e,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...e,[o.stepName]:{isCompleted:o.stepName===pt.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+n)}},Pj=e=>{const{handleDeferredStep:t,handleOperationComplete:n}=e;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:Zo.WINDOW_MANAGEMENT});o==="prompt"&&t()}).finally(n)},Nj=e=>{const{handleDeferredStep:t,handleOperationComplete:n}=e;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:Zo.NOTIFICATIONS});o==="prompt"&&t()}).finally(n)},Tj=e=>{const{handleDeferredStep:t,handleOperationComplete:n,dispatchAction:o}=e,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),s=window.open(r,void 0,i);a==null||a.close(),s==null||s.close();const c=!(a&&s);c&&t(),o({type:"stateUpdated",payload:{stepName:pt.POPUPS,state:c?"denied":"granted"}}),n()},Ij=e=>{const{dispatchAction:t}=e;t({type:"completed",payload:{stepName:pt.PWA_INSTALL}})},Rj={[pt.WINDOW_MANAGEMENT]:Pj,[pt.NOTIFICATIONS]:Nj,[pt.POPUPS]:Tj,[pt.PWA_INSTALL]:Ij},Lj=({settings:e})=>{const{permission:t}=sr(),[n,o]=Dr("localStorage",Ra,La),[r,i]=v.useReducer(Aj,DC),[a,s]=v.useState(!1),[c,u]=v.useState(!1),d=Es.find(y=>!r[y.name].isCompleted);if(!d)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const f=d.name,p=Es[Es.length-1].name,{hasEdgeNotificationsPermissionError:h}=Oj({edgeNotificationsPermissionTimeout:e.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:c&&f===Zo.NOTIFICATIONS}),m=()=>{s(!1),u(!0),Rj[f]({handleDeferredStep:()=>s(!0),handleOperationComplete:()=>u(!1),dispatchAction:y=>i(y)}),f===p&&o({isCompleted:!0})},g=()=>{s(!1),i({type:"skipped",payload:{stepName:f}})};return v.useEffect(()=>{h&&(u(!1),s(!0))},[h]),v.useEffect(()=>{var y,b;s(!1),i({type:"stateUpdated",payload:{stepName:pt.WINDOW_MANAGEMENT,state:xf?(y=t.statuses[pt.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:pt.NOTIFICATIONS,state:(b=t.statuses[pt.NOTIFICATIONS])==null?void 0:b.state}})},[t.statuses]),l.jsxs(Tb,{description:d.description,heading:d.heading,Image:d.Image,title:"Platform Setup",children:[l.jsx(_j,{activeStepName:f,showWarnIcon:a&&f!==pt.POPUPS,stepsStatuses:r}),l.jsx("p",{className:"io-text-default-lh16",children:a?d.instructions.additional:d.instructions.initial}),l.jsxs(Be,{children:[l.jsx(lc,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:c,onClick:m,children:d.actionBtnText}),f!==p&&f!==pt.WINDOW_MANAGEMENT&&l.jsx(lc,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:c,onClick:g,children:"Skip"})]}),c&&l.jsx(_b,{})]})};const Kf=({components:{Logo:e=Ua,Loader:t=cr}={},settings:n={}})=>{const{permission:o}=sr();return o.isLoading?l.jsx(t,{text:"Checking browser permissions..."}):l.jsx(jb,{Logo:e,children:l.jsx(Lj,{settings:{...NC,...n}})})};const Gf=({errorMessage:e})=>{const t="https://support.interop.io",n=l.jsxs(l.Fragment,{children:["It seems that the following error prevents io.Connect Browser",l.jsx("br",{}),"from operating properly:",l.jsxs("span",{className:"browser-start-failed-error",children:["“",e,"”"]}),l.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",l.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),l.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return l.jsx(jb,{Logo:Ua,children:l.jsx(Tb,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:n,Image:PC,children:l.jsx(lc,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(t,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},Ib=()=>l.jsxs(l.Fragment,{children:[l.jsx(Xn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),l.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",l.jsx("br",{}),"digital transformation."]})]}),Rb=({Logo:e,children:t,className:n})=>l.jsx("div",{className:"login-page-background",children:l.jsxs("div",{className:ro(n,"login-form-container flex flex-column ai-center"),children:[l.jsx(e,{}),t]})}),Dj=({onLogin:e,isLoading:t,validationError:n,components:{Logo:o=Ua,Heading:r=Ib,Loader:i=cr}={}})=>t?l.jsx(i,{text:"Verifying credentials..."}):l.jsxs(Rb,{Logo:o,children:[l.jsx(r,{}),l.jsx(tt,{className:"auth0-login-btn",onClick:e,size:"large",variant:"primary",children:"Log In"}),n&&l.jsx(Zb,{variant:"critical",text:n.message})]}),Rm=(e,t)=>{const n=t.value,o=n.trim().length>3;return{value:n,isValid:o}},Mj=({onLogin:e,setIsLoading:t,loginError:n,setLoginError:o,userInputName:r="email"})=>{const[i,a]=v.useReducer(Rm,{value:"",isValid:!1}),[s,c]=v.useReducer(Rm,{value:"",isValid:!1}),[u,d]=v.useState(!1),[f,p]=v.useState(!1),{isValid:h}=i,{isValid:m}=s,g=h&&m,y=w=>a({value:w.target.value}),b=w=>c({value:w.target.value}),k=()=>{h||d(!0)},x=()=>{m||p(!0)},S=async w=>{if(w.preventDefault(),!!g){t(!0);try{await e(i.value,s.value)}catch(C){o(C)}t(!1)}};return l.jsxs("form",{className:"simple-login-form",onSubmit:S,children:[l.jsx(tr,{id:"user",errorMessage:u?`The ${r} is too short`:void 0,autoFocus:!0,autoComplete:"off",type:"text",placeholder:`Enter your ${r}`,value:i.value,onChange:y,onBlur:k,onFocus:()=>d(!1)}),l.jsx(tr,{id:"password",errorMessage:f?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:s.value,onChange:b,onBlur:x,onFocus:()=>p(!1)}),l.jsx(tt,{type:"submit",size:"large",variant:"primary",children:"Log In"}),n&&l.jsxs("div",{className:"login-error-feedback",children:[l.jsx(xt,{className:"error-icon",variant:"close",size:"12"}),n.message]})]})};const $j=({onLogin:e,userInputName:t,components:{Logo:n=Ua,Heading:o=Ib,Loader:r=cr}={}})=>{const[i,a]=v.useState(!1),[s,c]=v.useState(null);return i?l.jsx(r,{text:"Verifying credentials..."}):l.jsxs(Rb,{Logo:n,children:[l.jsx(o,{}),l.jsx(Mj,{onLogin:e,setIsLoading:a,loginError:s,setLoginError:c,userInputName:t})]})};function Hj(e,t){const[n,o]=v.useState(!0),r=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(e)}catch(c){console.warn(c);return}const s=a.getAllGroups().find(c=>c.id===t);s&&(i=await s.onLockConfigurationChanged(({showAddWindowButton:c})=>{c!==void 0&&o(c)}),o(!!s.showAddWindowButton))})(),()=>i==null?void 0:i()},[e,t,r.workspaces]),n}const Bj=({groupId:e,workspaceId:t})=>{const n=Hj(t,e),o=v.useCallback(r=>{As.showAddApplicationPopup({bounds:r,groupId:e,workspaceId:t})},[e,t]);return n&&l.jsx(As.AddWindowButton,{title:"Add App",visible:n,showPopup:o})},zj=e=>l.jsx(As.GroupHeaderButtons,{...e,addWindow:{visible:!1,showPopup:e.addWindow.showPopup}}),Fj=()=>null;const Lb=({className:e,components:t,onClose:n,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=bf;return l.jsx(r,{children:l.jsx(i,{children:l.jsx(a,{className:e,components:t,onClose:n,title:o})})})};const Db=JS.Panel;const{DIALOG_TEMPLATE_NAMES:Wj,useActiveLayout:Uj}=Ot,Mb=({className:e,components:t,onClose:n,title:o})=>{const r=v.useContext(Te.IOConnectContext),{onLogout:i}=ww(),{setActiveLayout:a}=Uj(),{login:{setIsLoggingOut:s}}=sr(),c=v.useCallback(async()=>{var u;if("modals"in r&&r.modals){const d="log-out",{isEnterPressed:f,responseButtonClicked:p}=await r.modals.dialogs.request({templateName:Wj.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:"Logging out of io.Connect Browser",text:"This will terminate your session.",actionButtons:[{variant:"primary",text:"Log out",id:d,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(f||(p==null?void 0:p.id)===d))return}Mo.flushSync(()=>s(!0)),a(null),await((u=r.webPlatform)==null?void 0:u.system.shutdown());try{i==null||i()}catch(d){console.error(d)}},[r,i]);return l.jsx(lw.Panel,{className:e,components:t,onClose:n,onLogout:c,title:o})},Vj=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:e=>e(Db)},{name:"notificationSettings",displayName:"Notification Settings",icon:"bell",onClick:e=>e(Lb),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:e=>e(Mb)}],Kj=e=>({onClose:t})=>l.jsx(e,{className:"system-menu-panel",onClose:t});const $b=({actions:e,panelWrapperClassName:t})=>{const[n,o]=v.useState(),r=v.useRef(null),i=CC(),a=v.useCallback(()=>o(void 0),[]),s=!!n;v.useEffect(()=>{!s||i!=="Escape"||a()},[s,i]);const c=v.useCallback((u,d)=>{const f=e.find(({name:h})=>h===d.name);if(!f){console.error(`Action named ${d.name} is not part of the provided list of actions: ${JSON.stringify(e)}!`);return}const p=h=>{const m=Kj(h);o(()=>m)};f.onClick(p)},[e]);return kw({eventType:"mouseup",handler:a,ref:r,skip:!s}),xw({handler:a,skip:!s}),l.jsxs(l.Fragment,{children:[l.jsx(Fd,{buttonSize:"32",iconSize:"16",actions:e,onActionItemClick:c,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8],"data-testid":"system-menu-button",contextMenuDataTestId:"system-menu"}),l.jsx(Cw,{className:ro("system-menu-panel-wrapper",t),isOpen:s,onClose:a,Panel:n,position:"right",ref:r})]})},Gj=()=>l.jsx("li",{className:"default-header-system-menu",children:l.jsx($b,{actions:Vj})}),qj=()=>{const{showNotificationBadge:e}=iC(),t=bw(),o=v.useMemo(()=>t.filter(({state:r})=>r==="Active"||r==="Stale"),[t]).length;return o>0&&e?l.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const Hb=e=>{const{className:t,active:n,...o}=e;return l.jsxs("div",{className:ro(t,"notifications-panel-button"),...o,children:[l.jsx(We,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),l.jsx(qj,{})]})},Bb=({className:e,components:t,onClose:n,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:s}=bf;return l.jsx(i,{children:l.jsx(a,{children:l.jsx(s,{className:e,components:t,onClose:n,settings:o,title:r})})})},zb=({Button:e=Hb,Panel:t=Bb,position:n="right",...o})=>{const r=bw(),i=v.useContext(Te.IOConnectContext),a=v.useCallback(async()=>{await Promise.all(r.map(({id:s})=>i.notifications.setState(s,"Seen")))},[r]);return l.jsx(Cf,{Button:e,Panel:t,position:n,onClose:a,...o})};const Jj=()=>l.jsxs(l.Fragment,{children:[l.jsx(zb,{tag:"li"}),l.jsx(Gj,{})]}),qf=({onLogout:e,workspaces:t,launchpad:n,Loader:o=cr,isBeforeunloadDialogEnabled:r})=>{var g,y,b,k;const{LogoComponent:i,SystemButtonsComponent:a}=((g=t==null?void 0:t.components)==null?void 0:g.header)??{},{setPlatformWindow:s}=Sf(),{isInitialSetupCompleted:c}=yy(),u=(y=window.iobrowser)==null?void 0:y.platformStarted,d=i??(u?Ew:Fj),f=a??(u?Jj:void 0),p=tC(),{login:{isLoggingOut:h}}=sr();eC(r===!1||h),v.useEffect(()=>{u&&s({name:window.name})},[u,s]);const m=v.useMemo(()=>({onLogout:e,launchpadSettings:n==null?void 0:n.settings,launchpadComponents:n==null?void 0:n.components}),[e,n==null?void 0:n.settings,n==null?void 0:n.components]);return l.jsxs(vw.Provider,{value:m,children:[(!p||!c)&&l.jsx(o,{text:"Loading io.Connect Home..."}),l.jsx(As,{components:{...t==null?void 0:t.components,header:{...(b=t==null?void 0:t.components)==null?void 0:b.header,LogoComponent:d,SystemButtonsComponent:f},groupHeader:{AfterTabsComponent:Bj,ButtonsComponent:zj,...(k=t==null?void 0:t.components)==null?void 0:k.groupHeader}}})]})},Zj=ht({id:sn,username:Me(sn),email:Me(sn),firstName:Me(sn),lastName:Me(sn),token:Me(sn),password:Me(sn)}),Yj=({config:e})=>{var b,k,x,S;const{setupFlow:t,login:n,workspaces:o,launchpad:r,getIOConnectConfig:i}=e,[a,s]=Dr("localStorage",sC,Zj),[c]=Dr("localStorage",Ra,La),[u,d]=v.useState(null),{login:{isLoggingOut:f}}=sr(),p=kf(),h=((b=e.components)==null?void 0:b.SystemLoader)??cr,m=((k=e.components)==null?void 0:k.IOInitErrorScreen)??Gf,g=v.useCallback(async(w,C)=>{const O=await n.onLogin(w,C);s(O)},[n,s]),y=v.useCallback(()=>{var w;(w=n.onLogout)==null||w.call(n),s(null),window.location.reload()},[n.onLogout,s]);return f?l.jsx(h,{text:"Logging out..."}):a?!(c!=null&&c.isCompleted)&&(t==null?void 0:t.enabled)!==!1&&!p?l.jsx(Kf,{settings:t==null?void 0:t.settings,components:{...t==null?void 0:t.components,Loader:h}}):u&&!u.message.includes("has already been started")?l.jsx(m,{errorMessage:u.message}):l.jsx(Te.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:d,fallback:l.jsx(h,{text:"Initializing the platform..."}),children:l.jsx(kc,{launchpadMode:(x=r==null?void 0:r.settings)==null?void 0:x.mode,children:l.jsx(qf,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(S=e.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:h})})}):l.jsx($j,{onLogin:g,userInputName:n.userInputName,components:{...n.components,Loader:h}})},Xj=ht({message:sn}),Qj=e=>{const t=Eb(),[n,o]=v.useState(void 0),[r,i]=Dr("sessionStorage",aC,Xj),a=v.useMemo(()=>t.user?(e==null?void 0:e(t.user))??{ok:!0}:null,[t.user,e]),s=(a==null?void 0:a.ok)===!1,c=t.isLoading||t.isAuthenticated&&!n,u=s||c,d=v.useMemo(()=>{var f;return a!=null&&a.ok&&((f=t.user)!=null&&f.email)&&n?{username:t.user.name,id:t.user.email,token:n}:null},[t.user,n,a==null?void 0:a.ok]);return v.useEffect(()=>{t.isAuthenticated&&t.getAccessTokenSilently().then(o).catch(console.warn)},[t]),v.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),t.logout()}},[t,i,a]),{isLoading:u,validationError:r,user:d}},xd={POPUP:"popup",REDIRECT:"redirect"},e4=({config:e})=>{var x,S,w,C;const t=Eb(),{setupFlow:n,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=e,{isLoading:s,validationError:c,user:u}=Qj(o.validateUser),f=(o.loginType??xd.REDIRECT)===xd.REDIRECT?t.loginWithRedirect:t.loginWithPopup,[p]=Dr("localStorage",Ra,La),[h,m]=v.useState(null),{login:{isLoggingOut:g}}=sr(),y=kf(),b=((x=e.components)==null?void 0:x.SystemLoader)??cr,k=((S=e.components)==null?void 0:S.IOInitErrorScreen)??Gf;return g?l.jsx(b,{text:"Logging out..."}):u?!(p!=null&&p.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!y?l.jsx(Kf,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:b}}):h&&!h.message.includes("has already been started")?l.jsx(k,{errorMessage:h.message}):l.jsx(Te.IOConnectProvider,{settings:a({type:"auth0",user:{...t.user,id:u.id,token:u.token}}),onInitError:m,fallback:l.jsx(b,{text:"Initializing the platform..."}),children:l.jsx(kc,{launchpadMode:(w=r==null?void 0:r.settings)==null?void 0:w.mode,children:l.jsx(qf,{workspaces:i,launchpad:r,onLogout:t.logout,isBeforeunloadDialogEnabled:(C=e.settings)==null?void 0:C.isBeforeunloadDialogEnabled,Loader:b})})}):l.jsx(Dj,{onLogin:f,isLoading:s,validationError:c,components:{...o.components,Loader:b}})},Lm=({config:e})=>{var g,y,b,k;const{setupFlow:t,launchpad:n,workspaces:o,getIOConnectConfig:r}=e,{onLogout:i,user:a}=e.login??{},{isPlatformWindow:s}=Sf(),[c]=Dr("localStorage",Ra,La),[u,d]=v.useState(null),{login:{isLoggingOut:f}}=sr(),p=kf(),h=((g=e.components)==null?void 0:g.SystemLoader)??cr,m=((y=e.components)==null?void 0:y.IOInitErrorScreen)??Gf;return f?l.jsx(h,{text:"Logging out..."}):!(c!=null&&c.isCompleted)&&(t==null?void 0:t.enabled)!==!1&&s&&!p?l.jsx(Kf,{settings:t==null?void 0:t.settings,components:{...t==null?void 0:t.components,Loader:h}}):u&&!u.message.includes("has already been started")?l.jsx(m,{errorMessage:u.message}):l.jsx(Te.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:d,fallback:l.jsx(h,{text:"Initializing the platform..."}),children:l.jsx(kc,{launchpadMode:(b=n==null?void 0:n.settings)==null?void 0:b.mode,children:l.jsx(qf,{workspaces:o,launchpad:n,onLogout:i,isBeforeunloadDialogEnabled:(k=e.settings)==null?void 0:k.isBeforeunloadDialogEnabled,Loader:h})})})},Fb=ht({Logo:Me(Vt().andThen(e=>mn(e,"Logo"))),Heading:Me(Vt().andThen(e=>mn(e,"Heading")))}),t4=xa(...Object.values(xd).map(e=>nr(e))),n4=ht({type:nr("auth0"),validateUser:Me(Vt().andThen(e=>mn(e,"validateUser"))),loginType:Me(t4),providerOptions:Vt(),components:Me(Fb)}),o4=ht({type:nr("simple"),onLogin:Vt().andThen(e=>mn(e,"onLogin")),onLogout:Me(Vt().andThen(e=>mn(e,"onLogout"))),userInputName:Me(sn),components:Me(Fb)}),r4=ht({id:sn,username:sn}),i4=ht({type:nr("custom"),onLogout:Vt().andThen(e=>mn(e,"onLogout")),user:r4}),a4=xa(n4,o4,i4),s4=ht({edgeNotificationsPermissionTimeout:Me(bC)}),c4=ht({Logo:Me(Vt().andThen(e=>mn(e,"Logo")))}),l4=ht({enabled:Me(ba()),components:Me(c4),settings:Me(s4)}),u4=ht({components:Me(Vt())}),d4=ht({BeforeSearch:xa(nr(null),Me(Vt().andThen(e=>mn(e,"BeforeSearch")))),AfterSearch:xa(nr(null),Me(Vt().andThen(e=>mn(e,"AfterSearch"))))}),f4=ht({Component:Vt().andThen(e=>mn(e,"Component")),placementId:sn}),p4=ht({header:Me(d4),sections:Me(vC(f4))}),h4=ht({showHeader:Me(ba()),showSearch:Me(ba())}),m4=ht({header:Me(h4),mode:Me(xa(nr("pinned"),nr("default")))}),g4=ht({components:Me(p4),settings:Me(m4)}),y4=ht({SystemLoader:Me(Vt().andThen(e=>mn(e,"SystemLoader"))),IOInitErrorScreen:Me(Vt().andThen(e=>mn(e,"IOInitErrorScreen")))}),v4=ht({isBeforeunloadDialogEnabled:Me(ba())}),w4=ht({getIOConnectConfig:Vt().andThen(e=>mn(e,"getIOConnectConfig")),login:Me(a4),setupFlow:Me(l4),workspaces:Me(u4),launchpad:Me(g4),components:Me(y4),settings:Me(v4)}),b4=({config:e})=>{var i;const t=v.useMemo(()=>w4.runWithException(e),[e]),n=t.login,{isPlatformWindow:o}=Sf();if(!n||!o){const{login:a,...s}=t;return l.jsx(Lm,{config:s})}if(n.type==="custom")return l.jsx(Lm,{config:t});if(n.type==="simple")return l.jsx(Yj,{config:t});const{providerOptions:r}=n;return l.jsx(ej,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:l.jsx(e4,{config:t})})};const x4=({config:e})=>l.jsx(EC,{children:l.jsx(b4,{config:e})}),k4=Ot.ApplicationsSection,S4=Ot.FavoritesSection,C4=Ot.Panel,E4=Ot.Body,j4=Ot.ContentsContainer,_4=Ot.Header,O4=Ot.PinButton,A4=Ot.Section,P4=Ot.WorkspacesSection,N4=Ot.useFavorites,T4=Ot.useIsLaunchpadCollapsed;exports.ApplicationsSection=k4;exports.FavoritesSection=S4;exports.IOActivePanelRenderer=n3;exports.IOConnectHome=x4;exports.IODownloadManager=Rk;exports.IONotifications=bf;exports.IOPreferencesDesktop=KS;exports.IOProfile=lw;exports.Launchpad=C4;exports.LaunchpadAccess=Ew;exports.LaunchpadBody=E4;exports.LaunchpadContentsContainer=j4;exports.LaunchpadHeader=_4;exports.LaunchpadPinButton=O4;exports.NotificationSettingsPanel=Lb;exports.NotificationsPanel=Bb;exports.NotificationsPanelButton=Hb;exports.NotificationsPanelWithToggleButton=zb;exports.PanelWithToggleButton=Cf;exports.PlatformPrefsProvider=kc;exports.PreferencesPanel=Db;exports.ProfilePanel=Mb;exports.Section=A4;exports.SystemLoader=cr;exports.SystemMenu=$b;exports.WorkspacesSection=P4;exports.useFavorites=N4;exports.useIsLaunchpadCollapsed=T4;exports.usePlatformPref=Mt;exports.usePlatformPrefs=yy;
|
|
77
77
|
//# sourceMappingURL=index.js.map
|