momentic 2.6.6 → 2.6.8
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/bin/cli.js +73 -79
- package/npm-shrinkwrap.json +31 -31
- package/package.json +1 -1
- package/static/assets/{index-sLi_FE4X.js → index-ru4g28NP.js} +2 -2
- package/static/index.html +1 -1
|
@@ -697,7 +697,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
|
|
|
697
697
|
* LICENSE.md file in the root directory of this source tree.
|
|
698
698
|
*
|
|
699
699
|
* @license MIT
|
|
700
|
-
*/function Xhe(u,e){return u?gjt(u)?k.createElement(u,e):u:null}function gjt(u){return vjt(u)||typeof u=="function"||Cjt(u)}function vjt(u){return typeof u=="function"&&(()=>{const e=Object.getPrototypeOf(u);return e.prototype&&e.prototype.isReactComponent})()}function Cjt(u){return typeof u=="object"&&typeof u.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(u.$$typeof.description)}function yjt(u){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...u},[t]=k.useState(()=>({current:djt(e)})),[a,n]=k.useState(()=>t.current.initialState);return t.current.setOptions(r=>({...r,...u,state:{...a,...u.state},onStateChange:i=>{n(i),u.onStateChange==null||u.onStateChange(i)}})),t.current}const LRe=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{className:"relative w-full overflow-auto",children:D.jsx("div",{ref:t,className:Pe("table w-full caption-bottom border-collapse text-sm",u),...e})}));LRe.displayName="Table";const $Re=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("table-header-group [&>div]:border-b",u),...e}));$Re.displayName="TableHeader";const IRe=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("table-row-group [&>:last-child]:border-0",u),...e}));IRe.displayName="TableBody";const bjt=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("bg-muted/50 table-footer-group border-t font-medium [&>div]:last:border-b-0",u),...e}));bjt.displayName="TableFooter";const aF=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("hover:bg-muted/50 data-[state=selected]:bg-muted table-row border-b transition-colors",u),...e}));aF.displayName="TableRow";const Pq=k.forwardRef(({className:u,asChild:e,...t},a)=>{const n=e?ji:"a";return D.jsx(n,{ref:a,className:Pe("hover:bg-muted/50 data-[state=selected]:bg-muted table-row border-b transition-colors",u),...t})});Pq.displayName="TableRowLink";const KRe=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("text-muted-foreground table-cell h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",u),...e}));KRe.displayName="TableHead";const jq=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("table-cell p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",u),...e}));jq.displayName="TableCell";const kjt=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("text-muted-foreground mt-4 table-caption text-sm",u),...e}));kjt.displayName="TableCaption";function Fjt({table:u}){return D.jsx("div",{className:"flex items-center justify-end px-2",children:D.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[D.jsxs("div",{className:"flex items-center space-x-2",children:[D.jsx("p",{className:"text-sm font-medium",children:"Rows per page"}),D.jsxs(In,{value:`${u.getState().pagination.pageSize}`,onValueChange:e=>{u.setPageSize(Number(e))},children:[D.jsx(kn,{className:"h-8 w-fit space-x-2",children:D.jsx(Kn,{placeholder:u.getState().pagination.pageSize})}),D.jsx(Fn,{side:"top",children:[10,20,30,40,50].map(e=>D.jsx(Ba,{value:`${e}`,children:e},e))})]})]}),D.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",u.getState().pagination.pageIndex+1," of"," ",u.getPageCount()]}),D.jsxs("div",{className:"flex items-center space-x-2",children:[D.jsxs(ut,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>u.setPageIndex(0),disabled:!u.getCanPreviousPage(),children:[D.jsx("span",{className:"sr-only",children:"Go to first page"}),D.jsx(k7t,{})]}),D.jsxs(ut,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>u.previousPage(),disabled:!u.getCanPreviousPage(),children:[D.jsx("span",{className:"sr-only",children:"Go to previous page"}),D.jsx(C7t,{})]}),D.jsxs(ut,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>u.nextPage(),disabled:!u.getCanNextPage(),children:[D.jsx("span",{className:"sr-only",children:"Go to next page"}),D.jsx(aB,{})]}),D.jsxs(ut,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>u.setPageIndex(u.getPageCount()-1),disabled:!u.getCanNextPage(),children:[D.jsx("span",{className:"sr-only",children:"Go to last page"}),D.jsx(F7t,{})]})]})]})})}function Ajt({table:u,children:e,className:t,activeNameFilter:a,isLoading:n,hidePagination:r,RowComponent:i=aF}){const{getState:o,getSortedRowModel:s}=u,{pagination:l}=o(),c=l.pageIndex??0,d=l.pageSize??10,E=c*d,h=E+d,f=eBt(u,r?s().rows:s().rows.slice(E,h)),m=f.length;return D.jsxs("div",{className:"space-y-4",children:[e,D.jsx("div",{className:Pe("w-full overflow-auto rounded-md border",t),children:D.jsxs(LRe,{children:[D.jsx($Re,{children:u.getHeaderGroups().map(p=>D.jsx(aF,{children:p.headers.map(x=>{var g;return D.jsx(KRe,{className:(g=x.column.columnDef.meta)==null?void 0:g.className,children:x.isPlaceholder?null:Xhe(x.column.columnDef.header,x.getContext())},x.id)})},p.id))}),D.jsxs(IRe,{children:[f.map(p=>D.jsx(i,{row:p.original,"data-state":p.getIsSelected()&&"selected",className:"group h-[50px]",children:p.getVisibleCells().map(x=>{var g;return D.jsx(jq,{className:Pe("relative",(g=x.column.columnDef.meta)==null?void 0:g.className),children:Xhe(x.column.columnDef.cell,x.getContext())},x.id)})},p.id)),m===0?D.jsx(aF,{children:D.jsx(jq,{className:"h-24 text-center",children:a&&a.length>0&&a.length<3?"Continue typing for results...":n?"Loading...":"No results."})}):null]})]})}),!r&&D.jsx(Fjt,{table:u})]})}const Bjt=QD("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",plain:"border-transparent text-primary-foreground"}},defaultVariants:{variant:"default"}});function IE({className:u,variant:e,...t}){return D.jsx("div",{className:Pe(Bjt({variant:e}),u),...t})}function efe(u,e){if(typeof u=="function")return u(e);u!=null&&(u.current=e)}function Sjt(...u){return e=>{let t=!1;const a=u.map(n=>{const r=efe(n,e);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let n=0;n<a.length;n++){const r=a[n];typeof r=="function"?r():efe(u[n],null)}}}}var HRe=k.forwardRef((u,e)=>{const{children:t,...a}=u,n=k.Children.toArray(t),r=n.find(Ojt);if(r){const i=r.props.children,o=n.map(s=>s===r?k.Children.count(i)>1?k.Children.only(null):k.isValidElement(i)?i.props.children:null:s);return D.jsx(Nq,{...a,ref:e,children:k.isValidElement(i)?k.cloneElement(i,void 0,o):null})}return D.jsx(Nq,{...a,ref:e,children:t})});HRe.displayName="Slot";var Nq=k.forwardRef((u,e)=>{const{children:t,...a}=u;if(k.isValidElement(t)){const n=_jt(t),r=zjt(a,t.props);return t.type!==k.Fragment&&(r.ref=e?Sjt(e,n):n),k.cloneElement(t,r)}return k.Children.count(t)>1?k.Children.only(null):null});Nq.displayName="SlotClone";var wjt=({children:u})=>D.jsx(D.Fragment,{children:u});function Ojt(u){return k.isValidElement(u)&&u.type===wjt}function zjt(u,e){const t={...e};for(const a in e){const n=u[a],r=e[a];/^on[A-Z]/.test(a)?n&&r?t[a]=(...o)=>{r(...o),n(...o)}:n&&(t[a]=n):a==="style"?t[a]={...n,...r}:a==="className"&&(t[a]=[n,r].filter(Boolean).join(" "))}return{...u,...t}}function _jt(u){var a,n;let e=(a=Object.getOwnPropertyDescriptor(u.props,"ref"))==null?void 0:a.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?u.ref:(e=(n=Object.getOwnPropertyDescriptor(u,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?u.props.ref:u.props.ref||u.ref)}var Tjt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Mjt=Tjt.reduce((u,e)=>{const t=k.forwardRef((a,n)=>{const{asChild:r,...i}=a,o=r?HRe:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),D.jsx(o,{...i,ref:n})});return t.displayName=`Primitive.${e}`,{...u,[e]:t}},{}),Pjt="VisuallyHidden",VRe=k.forwardRef((u,e)=>D.jsx(Mjt.span,{...u,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...u.style}}));VRe.displayName=Pjt;var ufe=1,jjt=.9,Njt=.8,Rjt=.17,hH=.1,fH=.999,Ljt=.9999,$jt=.99,Ijt=/[\\\/_+.#"@\[\(\{&]/,Kjt=/[\\\/_+.#"@\[\(\{&]/g,Hjt=/[\s-]/,GRe=/[\s-]/g;function Rq(u,e,t,a,n,r,i){if(r===e.length)return n===u.length?ufe:$jt;var o=`${n},${r}`;if(i[o]!==void 0)return i[o];for(var s=a.charAt(r),l=t.indexOf(s,n),c=0,d,E,h,f;l>=0;)d=Rq(u,e,t,a,l+1,r+1,i),d>c&&(l===n?d*=ufe:Ijt.test(u.charAt(l-1))?(d*=Njt,h=u.slice(n,l-1).match(Kjt),h&&n>0&&(d*=Math.pow(fH,h.length))):Hjt.test(u.charAt(l-1))?(d*=jjt,f=u.slice(n,l-1).match(GRe),f&&n>0&&(d*=Math.pow(fH,f.length))):(d*=Rjt,n>0&&(d*=Math.pow(fH,l-n))),u.charAt(l)!==e.charAt(r)&&(d*=Ljt)),(d<hH&&t.charAt(l-1)===a.charAt(r+1)||a.charAt(r+1)===a.charAt(r)&&t.charAt(l-1)!==a.charAt(r))&&(E=Rq(u,e,t,a,l+1,r+2,i),E*hH>d&&(d=E*hH)),d>c&&(c=d),l=t.indexOf(s,l+1);return i[o]=c,c}function tfe(u){return u.toLowerCase().replace(GRe," ")}function Vjt(u,e,t){return u=t&&t.length>0?`${u+" "+t.join(" ")}`:u,Rq(u,e,tfe(u),tfe(e),0,0,{})}function Tu(){return Tu=Object.assign?Object.assign.bind():function(u){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(u[a]=t[a])}return u},Tu.apply(this,arguments)}function O6(u,e,{checkForDefaultPrevented:t=!0}={}){return function(n){if(u==null||u(n),t===!1||!n.defaultPrevented)return e==null?void 0:e(n)}}function Gjt(u,e){typeof u=="function"?u(e):u!=null&&(u.current=e)}function URe(...u){return e=>u.forEach(t=>Gjt(t,e))}function AB(...u){return k.useCallback(URe(...u),u)}function Ujt(u,e=[]){let t=[];function a(r,i){const o=k.createContext(i),s=t.length;t=[...t,i];function l(d){const{scope:E,children:h,...f}=d,m=(E==null?void 0:E[u][s])||o,p=k.useMemo(()=>f,Object.values(f));return k.createElement(m.Provider,{value:p},h)}function c(d,E){const h=(E==null?void 0:E[u][s])||o,f=k.useContext(h);if(f)return f;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${r}\``)}return l.displayName=r+"Provider",[l,c]}const n=()=>{const r=t.map(i=>k.createContext(i));return function(o){const s=(o==null?void 0:o[u])||r;return k.useMemo(()=>({[`__scope${u}`]:{...o,[u]:s}}),[o,s])}};return n.scopeName=u,[a,Wjt(n,...e)]}function Wjt(...u){const e=u[0];if(u.length===1)return e;const t=()=>{const a=u.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(r){const i=a.reduce((o,{useScope:s,scopeName:l})=>{const d=s(r)[`__scope${l}`];return{...o,...d}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}const Lq=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},Jjt=M5.useId||(()=>{});let qjt=0;function mH(u){const[e,t]=k.useState(Jjt());return Lq(()=>{u||t(a=>a??String(qjt++))},[u]),u||(e?`radix-${e}`:"")}function oD(u){const e=k.useRef(u);return k.useEffect(()=>{e.current=u}),k.useMemo(()=>(...t)=>{var a;return(a=e.current)===null||a===void 0?void 0:a.call(e,...t)},[])}function Zjt({prop:u,defaultProp:e,onChange:t=()=>{}}){const[a,n]=Qjt({defaultProp:e,onChange:t}),r=u!==void 0,i=r?u:a,o=oD(t),s=k.useCallback(l=>{if(r){const d=typeof l=="function"?l(u):l;d!==u&&o(d)}else n(l)},[r,u,n,o]);return[i,s]}function Qjt({defaultProp:u,onChange:e}){const t=k.useState(u),[a]=t,n=k.useRef(a),r=oD(e);return k.useEffect(()=>{n.current!==a&&(r(a),n.current=a)},[a,n,r]),t}const nre=k.forwardRef((u,e)=>{const{children:t,...a}=u,n=k.Children.toArray(t),r=n.find(Xjt);if(r){const i=r.props.children,o=n.map(s=>s===r?k.Children.count(i)>1?k.Children.only(null):k.isValidElement(i)?i.props.children:null:s);return k.createElement($q,Tu({},a,{ref:e}),k.isValidElement(i)?k.cloneElement(i,void 0,o):null)}return k.createElement($q,Tu({},a,{ref:e}),t)});nre.displayName="Slot";const $q=k.forwardRef((u,e)=>{const{children:t,...a}=u;return k.isValidElement(t)?k.cloneElement(t,{...eNt(a,t.props),ref:e?URe(e,t.ref):t.ref}):k.Children.count(t)>1?k.Children.only(null):null});$q.displayName="SlotClone";const Yjt=({children:u})=>k.createElement(k.Fragment,null,u);function Xjt(u){return k.isValidElement(u)&&u.type===Yjt}function eNt(u,e){const t={...e};for(const a in e){const n=u[a],r=e[a];/^on[A-Z]/.test(a)?n&&r?t[a]=(...o)=>{r(...o),n(...o)}:n&&(t[a]=n):a==="style"?t[a]={...n,...r}:a==="className"&&(t[a]=[n,r].filter(Boolean).join(" "))}return{...u,...t}}const uNt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xc=uNt.reduce((u,e)=>{const t=k.forwardRef((a,n)=>{const{asChild:r,...i}=a,o=r?nre:e;return k.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),k.createElement(o,Tu({},i,{ref:n}))});return t.displayName=`Primitive.${e}`,{...u,[e]:t}},{});function tNt(u,e){u&&n4.flushSync(()=>u.dispatchEvent(e))}function aNt(u,e=globalThis==null?void 0:globalThis.document){const t=oD(u);k.useEffect(()=>{const a=n=>{n.key==="Escape"&&t(n)};return e.addEventListener("keydown",a),()=>e.removeEventListener("keydown",a)},[t,e])}const Iq="dismissableLayer.update",nNt="dismissableLayer.pointerDownOutside",rNt="dismissableLayer.focusOutside";let afe;const iNt=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oNt=k.forwardRef((u,e)=>{var t;const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=u,c=k.useContext(iNt),[d,E]=k.useState(null),h=(t=d==null?void 0:d.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,f]=k.useState({}),m=AB(e,O=>E(O)),p=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=p.indexOf(x),v=d?p.indexOf(d):-1,C=c.layersWithOutsidePointerEventsDisabled.size>0,y=v>=g,b=sNt(O=>{const T=O.target,P=[...c.branches].some(z=>z.contains(T));!y||P||(r==null||r(O),o==null||o(O),O.defaultPrevented||s==null||s())},h),F=lNt(O=>{const T=O.target;[...c.branches].some(z=>z.contains(T))||(i==null||i(O),o==null||o(O),O.defaultPrevented||s==null||s())},h);return aNt(O=>{v===c.layers.size-1&&(n==null||n(O),!O.defaultPrevented&&s&&(O.preventDefault(),s()))},h),k.useEffect(()=>{if(d)return a&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(afe=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),nfe(),()=>{a&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=afe)}},[d,h,a,c]),k.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),nfe())},[d,c]),k.useEffect(()=>{const O=()=>f({});return document.addEventListener(Iq,O),()=>document.removeEventListener(Iq,O)},[]),k.createElement(Xc.div,Tu({},l,{ref:m,style:{pointerEvents:C?y?"auto":"none":void 0,...u.style},onFocusCapture:O6(u.onFocusCapture,F.onFocusCapture),onBlurCapture:O6(u.onBlurCapture,F.onBlurCapture),onPointerDownCapture:O6(u.onPointerDownCapture,b.onPointerDownCapture)}))});function sNt(u,e=globalThis==null?void 0:globalThis.document){const t=oD(u),a=k.useRef(!1),n=k.useRef(()=>{});return k.useEffect(()=>{const r=o=>{if(o.target&&!a.current){let c=function(){WRe(nNt,t,l,{discrete:!0})};var s=c;const l={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",n.current),n.current=c,e.addEventListener("click",n.current,{once:!0})):c()}else e.removeEventListener("click",n.current);a.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",r),e.removeEventListener("click",n.current)}},[e,t]),{onPointerDownCapture:()=>a.current=!0}}function lNt(u,e=globalThis==null?void 0:globalThis.document){const t=oD(u),a=k.useRef(!1);return k.useEffect(()=>{const n=r=>{r.target&&!a.current&&WRe(rNt,t,{originalEvent:r},{discrete:!1})};return e.addEventListener("focusin",n),()=>e.removeEventListener("focusin",n)},[e,t]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function nfe(){const u=new CustomEvent(Iq);document.dispatchEvent(u)}function WRe(u,e,t,{discrete:a}){const n=t.originalEvent.target,r=new CustomEvent(u,{bubbles:!1,cancelable:!0,detail:t});e&&n.addEventListener(u,e,{once:!0}),a?tNt(n,r):n.dispatchEvent(r)}const pH="focusScope.autoFocusOnMount",DH="focusScope.autoFocusOnUnmount",rfe={bubbles:!1,cancelable:!0},cNt=k.forwardRef((u,e)=>{const{loop:t=!1,trapped:a=!1,onMountAutoFocus:n,onUnmountAutoFocus:r,...i}=u,[o,s]=k.useState(null),l=oD(n),c=oD(r),d=k.useRef(null),E=AB(e,m=>s(m)),h=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(a){let g=function(b){if(h.paused||!o)return;const F=b.target;o.contains(F)?d.current=F:gh(d.current,{select:!0})},v=function(b){if(h.paused||!o)return;const F=b.relatedTarget;F!==null&&(o.contains(F)||gh(d.current,{select:!0}))},C=function(b){if(document.activeElement===document.body)for(const O of b)O.removedNodes.length>0&&gh(o)};var m=g,p=v,x=C;document.addEventListener("focusin",g),document.addEventListener("focusout",v);const y=new MutationObserver(C);return o&&y.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),y.disconnect()}}},[a,o,h.paused]),k.useEffect(()=>{if(o){ofe.add(h);const m=document.activeElement;if(!o.contains(m)){const x=new CustomEvent(pH,rfe);o.addEventListener(pH,l),o.dispatchEvent(x),x.defaultPrevented||(dNt(pNt(JRe(o)),{select:!0}),document.activeElement===m&&gh(o))}return()=>{o.removeEventListener(pH,l),setTimeout(()=>{const x=new CustomEvent(DH,rfe);o.addEventListener(DH,c),o.dispatchEvent(x),x.defaultPrevented||gh(m??document.body,{select:!0}),o.removeEventListener(DH,c),ofe.remove(h)},0)}}},[o,l,c,h]);const f=k.useCallback(m=>{if(!t&&!a||h.paused)return;const p=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(p&&x){const g=m.currentTarget,[v,C]=ENt(g);v&&C?!m.shiftKey&&x===C?(m.preventDefault(),t&&gh(v,{select:!0})):m.shiftKey&&x===v&&(m.preventDefault(),t&&gh(C,{select:!0})):x===g&&m.preventDefault()}},[t,a,h.paused]);return k.createElement(Xc.div,Tu({tabIndex:-1},i,{ref:E,onKeyDown:f}))});function dNt(u,{select:e=!1}={}){const t=document.activeElement;for(const a of u)if(gh(a,{select:e}),document.activeElement!==t)return}function ENt(u){const e=JRe(u),t=ife(e,u),a=ife(e.reverse(),u);return[t,a]}function JRe(u){const e=[],t=document.createTreeWalker(u,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function ife(u,e){for(const t of u)if(!hNt(t,{upTo:e}))return t}function hNt(u,{upTo:e}){if(getComputedStyle(u).visibility==="hidden")return!0;for(;u;){if(e!==void 0&&u===e)return!1;if(getComputedStyle(u).display==="none")return!0;u=u.parentElement}return!1}function fNt(u){return u instanceof HTMLInputElement&&"select"in u}function gh(u,{select:e=!1}={}){if(u&&u.focus){const t=document.activeElement;u.focus({preventScroll:!0}),u!==t&&fNt(u)&&e&&u.select()}}const ofe=mNt();function mNt(){let u=[];return{add(e){const t=u[0];e!==t&&(t==null||t.pause()),u=sfe(u,e),u.unshift(e)},remove(e){var t;u=sfe(u,e),(t=u[0])===null||t===void 0||t.resume()}}}function sfe(u,e){const t=[...u],a=t.indexOf(e);return a!==-1&&t.splice(a,1),t}function pNt(u){return u.filter(e=>e.tagName!=="A")}const DNt=k.forwardRef((u,e)=>{var t;const{container:a=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...n}=u;return a?wE.createPortal(k.createElement(Xc.div,Tu({},n,{ref:e})),a):null});function xNt(u,e){return k.useReducer((t,a)=>{const n=e[t][a];return n??t},u)}const TR=u=>{const{present:e,children:t}=u,a=gNt(e),n=typeof t=="function"?t({present:a.isPresent}):k.Children.only(t),r=AB(a.ref,n.ref);return typeof t=="function"||a.isPresent?k.cloneElement(n,{ref:r}):null};TR.displayName="Presence";function gNt(u){const[e,t]=k.useState(),a=k.useRef({}),n=k.useRef(u),r=k.useRef("none"),i=u?"mounted":"unmounted",[o,s]=xNt(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const l=rw(a.current);r.current=o==="mounted"?l:"none"},[o]),Lq(()=>{const l=a.current,c=n.current;if(c!==u){const E=r.current,h=rw(l);u?s("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?s("UNMOUNT"):s(c&&E!==h?"ANIMATION_OUT":"UNMOUNT"),n.current=u}},[u,s]),Lq(()=>{if(e){const l=d=>{const h=rw(a.current).includes(d.animationName);d.target===e&&h&&n4.flushSync(()=>s("ANIMATION_END"))},c=d=>{d.target===e&&(r.current=rw(a.current))};return e.addEventListener("animationstart",c),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",c),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else s("ANIMATION_END")},[e,s]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:k.useCallback(l=>{l&&(a.current=getComputedStyle(l)),t(l)},[])}}function rw(u){return(u==null?void 0:u.animationName)||"none"}let xH=0;function vNt(){k.useEffect(()=>{var u,e;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(u=t[0])!==null&&u!==void 0?u:lfe()),document.body.insertAdjacentElement("beforeend",(e=t[1])!==null&&e!==void 0?e:lfe()),xH++,()=>{xH===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),xH--}},[])}function lfe(){const u=document.createElement("span");return u.setAttribute("data-radix-focus-guard",""),u.tabIndex=0,u.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",u}var sz="right-scroll-bar-position",lz="width-before-scroll-bar",CNt="with-scroll-bars-hidden",yNt="--removed-body-scroll-bar-size",qRe=XMe(),gH=function(){},MR=k.forwardRef(function(u,e){var t=k.useRef(null),a=k.useState({onScrollCapture:gH,onWheelCapture:gH,onTouchMoveCapture:gH}),n=a[0],r=a[1],i=u.forwardProps,o=u.children,s=u.className,l=u.removeScrollBar,c=u.enabled,d=u.shards,E=u.sideCar,h=u.noIsolation,f=u.inert,m=u.allowPinchZoom,p=u.as,x=p===void 0?"div":p,g=rR(u,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),v=E,C=YMe([t,e]),y=jt(jt({},g),n);return k.createElement(k.Fragment,null,c&&k.createElement(v,{sideCar:qRe,removeScrollBar:l,shards:d,noIsolation:h,inert:f,setCallbacks:r,allowPinchZoom:!!m,lockRef:t}),i?k.cloneElement(k.Children.only(o),jt(jt({},y),{ref:C})):k.createElement(x,jt({},y,{className:s,ref:C}),o))});MR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};MR.classNames={fullWidth:lz,zeroRight:sz};var bNt={left:0,top:0,right:0,gap:0},vH=function(u){return parseInt(u||"",10)||0},kNt=function(u){var e=window.getComputedStyle(document.body),t=e[u==="padding"?"paddingLeft":"marginLeft"],a=e[u==="padding"?"paddingTop":"marginTop"],n=e[u==="padding"?"paddingRight":"marginRight"];return[vH(t),vH(a),vH(n)]},FNt=function(u){if(u===void 0&&(u="margin"),typeof window>"u")return bNt;var e=kNt(u),t=document.documentElement.clientWidth,a=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,a-t+e[2]-e[0])}},ANt=oR(),BNt=function(u,e,t,a){var n=u.left,r=u.top,i=u.right,o=u.gap;return t===void 0&&(t="margin"),`
|
|
700
|
+
*/function Xhe(u,e){return u?gjt(u)?k.createElement(u,e):u:null}function gjt(u){return vjt(u)||typeof u=="function"||Cjt(u)}function vjt(u){return typeof u=="function"&&(()=>{const e=Object.getPrototypeOf(u);return e.prototype&&e.prototype.isReactComponent})()}function Cjt(u){return typeof u=="object"&&typeof u.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(u.$$typeof.description)}function yjt(u){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...u},[t]=k.useState(()=>({current:djt(e)})),[a,n]=k.useState(()=>t.current.initialState);return t.current.setOptions(r=>({...r,...u,state:{...a,...u.state},onStateChange:i=>{n(i),u.onStateChange==null||u.onStateChange(i)}})),t.current}const LRe=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{className:"relative w-full overflow-auto",children:D.jsx("div",{ref:t,className:Pe("table w-full caption-bottom border-collapse text-sm",u),...e})}));LRe.displayName="Table";const $Re=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("table-header-group [&>div]:border-b",u),...e}));$Re.displayName="TableHeader";const IRe=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("table-row-group [&>:last-child]:border-0",u),...e}));IRe.displayName="TableBody";const bjt=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("bg-muted/50 table-footer-group border-t font-medium [&>div]:last:border-b-0",u),...e}));bjt.displayName="TableFooter";const aF=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("hover:bg-muted/50 data-[state=selected]:bg-muted table-row border-b transition-colors",u),...e}));aF.displayName="TableRow";const Pq=k.forwardRef(({className:u,asChild:e,...t},a)=>{const n=e?ji:"a";return D.jsx(n,{ref:a,className:Pe("hover:bg-muted/50 data-[state=selected]:bg-muted table-row border-b transition-colors",u),...t})});Pq.displayName="TableRowLink";const KRe=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("text-muted-foreground table-cell h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",u),...e}));KRe.displayName="TableHead";const jq=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("table-cell p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",u),...e}));jq.displayName="TableCell";const kjt=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{ref:t,className:Pe("text-muted-foreground mt-4 table-caption text-sm",u),...e}));kjt.displayName="TableCaption";function Fjt({table:u}){return D.jsx("div",{className:"flex items-center justify-end px-2",children:D.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[D.jsxs("div",{className:"flex items-center space-x-2",children:[D.jsx("p",{className:"text-sm font-medium",children:"Rows per page"}),D.jsxs(In,{value:`${u.getState().pagination.pageSize}`,onValueChange:e=>{u.setPageSize(Number(e))},children:[D.jsx(kn,{className:"h-8 w-fit space-x-2",children:D.jsx(Kn,{placeholder:u.getState().pagination.pageSize})}),D.jsx(Fn,{side:"top",children:[10,20,30,40,50].map(e=>D.jsx(Ba,{value:`${e}`,children:e},e))})]})]}),D.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",u.getState().pagination.pageIndex+1," of"," ",u.getPageCount()]}),D.jsxs("div",{className:"flex items-center space-x-2",children:[D.jsxs(ut,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>u.setPageIndex(0),disabled:!u.getCanPreviousPage(),children:[D.jsx("span",{className:"sr-only",children:"Go to first page"}),D.jsx(k7t,{})]}),D.jsxs(ut,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>u.previousPage(),disabled:!u.getCanPreviousPage(),children:[D.jsx("span",{className:"sr-only",children:"Go to previous page"}),D.jsx(C7t,{})]}),D.jsxs(ut,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>u.nextPage(),disabled:!u.getCanNextPage(),children:[D.jsx("span",{className:"sr-only",children:"Go to next page"}),D.jsx(aB,{})]}),D.jsxs(ut,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>u.setPageIndex(u.getPageCount()-1),disabled:!u.getCanNextPage(),children:[D.jsx("span",{className:"sr-only",children:"Go to last page"}),D.jsx(F7t,{})]})]})]})})}function Ajt({table:u,children:e,className:t,activeNameFilter:a,isLoading:n,hidePagination:r,RowComponent:i=aF,hasBackendPagination:o}){const{getState:s,getSortedRowModel:l}=u,{pagination:c}=s(),d=c.pageIndex??0,E=c.pageSize??10,h=d*E,f=h+E,m=eBt(u,r||o?l().rows:l().rows.slice(h,f)),p=m.length;return D.jsxs("div",{className:"space-y-4",children:[e,D.jsx("div",{className:Pe("w-full overflow-auto rounded-md border",t),children:D.jsxs(LRe,{children:[D.jsx($Re,{children:u.getHeaderGroups().map(x=>D.jsx(aF,{children:x.headers.map(g=>{var v;return D.jsx(KRe,{className:(v=g.column.columnDef.meta)==null?void 0:v.className,children:g.isPlaceholder?null:Xhe(g.column.columnDef.header,g.getContext())},g.id)})},x.id))}),D.jsxs(IRe,{children:[m.map(x=>D.jsx(i,{row:x.original,"data-state":x.getIsSelected()&&"selected",className:"group h-[50px]",children:x.getVisibleCells().map(g=>{var v;return D.jsx(jq,{className:Pe("relative",(v=g.column.columnDef.meta)==null?void 0:v.className),children:Xhe(g.column.columnDef.cell,g.getContext())},g.id)})},x.id)),p===0?D.jsx(aF,{children:D.jsx(jq,{className:"h-24 text-center",children:a&&a.length>0&&a.length<3?"Continue typing for results...":n?"Loading...":"No results."})}):null]})]})}),!r&&D.jsx(Fjt,{table:u})]})}const Bjt=QD("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",plain:"border-transparent text-primary-foreground"}},defaultVariants:{variant:"default"}});function IE({className:u,variant:e,...t}){return D.jsx("div",{className:Pe(Bjt({variant:e}),u),...t})}function efe(u,e){if(typeof u=="function")return u(e);u!=null&&(u.current=e)}function Sjt(...u){return e=>{let t=!1;const a=u.map(n=>{const r=efe(n,e);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let n=0;n<a.length;n++){const r=a[n];typeof r=="function"?r():efe(u[n],null)}}}}var HRe=k.forwardRef((u,e)=>{const{children:t,...a}=u,n=k.Children.toArray(t),r=n.find(Ojt);if(r){const i=r.props.children,o=n.map(s=>s===r?k.Children.count(i)>1?k.Children.only(null):k.isValidElement(i)?i.props.children:null:s);return D.jsx(Nq,{...a,ref:e,children:k.isValidElement(i)?k.cloneElement(i,void 0,o):null})}return D.jsx(Nq,{...a,ref:e,children:t})});HRe.displayName="Slot";var Nq=k.forwardRef((u,e)=>{const{children:t,...a}=u;if(k.isValidElement(t)){const n=_jt(t),r=zjt(a,t.props);return t.type!==k.Fragment&&(r.ref=e?Sjt(e,n):n),k.cloneElement(t,r)}return k.Children.count(t)>1?k.Children.only(null):null});Nq.displayName="SlotClone";var wjt=({children:u})=>D.jsx(D.Fragment,{children:u});function Ojt(u){return k.isValidElement(u)&&u.type===wjt}function zjt(u,e){const t={...e};for(const a in e){const n=u[a],r=e[a];/^on[A-Z]/.test(a)?n&&r?t[a]=(...o)=>{r(...o),n(...o)}:n&&(t[a]=n):a==="style"?t[a]={...n,...r}:a==="className"&&(t[a]=[n,r].filter(Boolean).join(" "))}return{...u,...t}}function _jt(u){var a,n;let e=(a=Object.getOwnPropertyDescriptor(u.props,"ref"))==null?void 0:a.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?u.ref:(e=(n=Object.getOwnPropertyDescriptor(u,"ref"))==null?void 0:n.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?u.props.ref:u.props.ref||u.ref)}var Tjt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Mjt=Tjt.reduce((u,e)=>{const t=k.forwardRef((a,n)=>{const{asChild:r,...i}=a,o=r?HRe:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),D.jsx(o,{...i,ref:n})});return t.displayName=`Primitive.${e}`,{...u,[e]:t}},{}),Pjt="VisuallyHidden",VRe=k.forwardRef((u,e)=>D.jsx(Mjt.span,{...u,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...u.style}}));VRe.displayName=Pjt;var ufe=1,jjt=.9,Njt=.8,Rjt=.17,hH=.1,fH=.999,Ljt=.9999,$jt=.99,Ijt=/[\\\/_+.#"@\[\(\{&]/,Kjt=/[\\\/_+.#"@\[\(\{&]/g,Hjt=/[\s-]/,GRe=/[\s-]/g;function Rq(u,e,t,a,n,r,i){if(r===e.length)return n===u.length?ufe:$jt;var o=`${n},${r}`;if(i[o]!==void 0)return i[o];for(var s=a.charAt(r),l=t.indexOf(s,n),c=0,d,E,h,f;l>=0;)d=Rq(u,e,t,a,l+1,r+1,i),d>c&&(l===n?d*=ufe:Ijt.test(u.charAt(l-1))?(d*=Njt,h=u.slice(n,l-1).match(Kjt),h&&n>0&&(d*=Math.pow(fH,h.length))):Hjt.test(u.charAt(l-1))?(d*=jjt,f=u.slice(n,l-1).match(GRe),f&&n>0&&(d*=Math.pow(fH,f.length))):(d*=Rjt,n>0&&(d*=Math.pow(fH,l-n))),u.charAt(l)!==e.charAt(r)&&(d*=Ljt)),(d<hH&&t.charAt(l-1)===a.charAt(r+1)||a.charAt(r+1)===a.charAt(r)&&t.charAt(l-1)!==a.charAt(r))&&(E=Rq(u,e,t,a,l+1,r+2,i),E*hH>d&&(d=E*hH)),d>c&&(c=d),l=t.indexOf(s,l+1);return i[o]=c,c}function tfe(u){return u.toLowerCase().replace(GRe," ")}function Vjt(u,e,t){return u=t&&t.length>0?`${u+" "+t.join(" ")}`:u,Rq(u,e,tfe(u),tfe(e),0,0,{})}function Tu(){return Tu=Object.assign?Object.assign.bind():function(u){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(u[a]=t[a])}return u},Tu.apply(this,arguments)}function O6(u,e,{checkForDefaultPrevented:t=!0}={}){return function(n){if(u==null||u(n),t===!1||!n.defaultPrevented)return e==null?void 0:e(n)}}function Gjt(u,e){typeof u=="function"?u(e):u!=null&&(u.current=e)}function URe(...u){return e=>u.forEach(t=>Gjt(t,e))}function AB(...u){return k.useCallback(URe(...u),u)}function Ujt(u,e=[]){let t=[];function a(r,i){const o=k.createContext(i),s=t.length;t=[...t,i];function l(d){const{scope:E,children:h,...f}=d,m=(E==null?void 0:E[u][s])||o,p=k.useMemo(()=>f,Object.values(f));return k.createElement(m.Provider,{value:p},h)}function c(d,E){const h=(E==null?void 0:E[u][s])||o,f=k.useContext(h);if(f)return f;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${r}\``)}return l.displayName=r+"Provider",[l,c]}const n=()=>{const r=t.map(i=>k.createContext(i));return function(o){const s=(o==null?void 0:o[u])||r;return k.useMemo(()=>({[`__scope${u}`]:{...o,[u]:s}}),[o,s])}};return n.scopeName=u,[a,Wjt(n,...e)]}function Wjt(...u){const e=u[0];if(u.length===1)return e;const t=()=>{const a=u.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(r){const i=a.reduce((o,{useScope:s,scopeName:l})=>{const d=s(r)[`__scope${l}`];return{...o,...d}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}const Lq=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},Jjt=M5.useId||(()=>{});let qjt=0;function mH(u){const[e,t]=k.useState(Jjt());return Lq(()=>{u||t(a=>a??String(qjt++))},[u]),u||(e?`radix-${e}`:"")}function oD(u){const e=k.useRef(u);return k.useEffect(()=>{e.current=u}),k.useMemo(()=>(...t)=>{var a;return(a=e.current)===null||a===void 0?void 0:a.call(e,...t)},[])}function Zjt({prop:u,defaultProp:e,onChange:t=()=>{}}){const[a,n]=Qjt({defaultProp:e,onChange:t}),r=u!==void 0,i=r?u:a,o=oD(t),s=k.useCallback(l=>{if(r){const d=typeof l=="function"?l(u):l;d!==u&&o(d)}else n(l)},[r,u,n,o]);return[i,s]}function Qjt({defaultProp:u,onChange:e}){const t=k.useState(u),[a]=t,n=k.useRef(a),r=oD(e);return k.useEffect(()=>{n.current!==a&&(r(a),n.current=a)},[a,n,r]),t}const nre=k.forwardRef((u,e)=>{const{children:t,...a}=u,n=k.Children.toArray(t),r=n.find(Xjt);if(r){const i=r.props.children,o=n.map(s=>s===r?k.Children.count(i)>1?k.Children.only(null):k.isValidElement(i)?i.props.children:null:s);return k.createElement($q,Tu({},a,{ref:e}),k.isValidElement(i)?k.cloneElement(i,void 0,o):null)}return k.createElement($q,Tu({},a,{ref:e}),t)});nre.displayName="Slot";const $q=k.forwardRef((u,e)=>{const{children:t,...a}=u;return k.isValidElement(t)?k.cloneElement(t,{...eNt(a,t.props),ref:e?URe(e,t.ref):t.ref}):k.Children.count(t)>1?k.Children.only(null):null});$q.displayName="SlotClone";const Yjt=({children:u})=>k.createElement(k.Fragment,null,u);function Xjt(u){return k.isValidElement(u)&&u.type===Yjt}function eNt(u,e){const t={...e};for(const a in e){const n=u[a],r=e[a];/^on[A-Z]/.test(a)?n&&r?t[a]=(...o)=>{r(...o),n(...o)}:n&&(t[a]=n):a==="style"?t[a]={...n,...r}:a==="className"&&(t[a]=[n,r].filter(Boolean).join(" "))}return{...u,...t}}const uNt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xc=uNt.reduce((u,e)=>{const t=k.forwardRef((a,n)=>{const{asChild:r,...i}=a,o=r?nre:e;return k.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),k.createElement(o,Tu({},i,{ref:n}))});return t.displayName=`Primitive.${e}`,{...u,[e]:t}},{});function tNt(u,e){u&&n4.flushSync(()=>u.dispatchEvent(e))}function aNt(u,e=globalThis==null?void 0:globalThis.document){const t=oD(u);k.useEffect(()=>{const a=n=>{n.key==="Escape"&&t(n)};return e.addEventListener("keydown",a),()=>e.removeEventListener("keydown",a)},[t,e])}const Iq="dismissableLayer.update",nNt="dismissableLayer.pointerDownOutside",rNt="dismissableLayer.focusOutside";let afe;const iNt=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oNt=k.forwardRef((u,e)=>{var t;const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:n,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=u,c=k.useContext(iNt),[d,E]=k.useState(null),h=(t=d==null?void 0:d.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,f]=k.useState({}),m=AB(e,O=>E(O)),p=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=p.indexOf(x),v=d?p.indexOf(d):-1,C=c.layersWithOutsidePointerEventsDisabled.size>0,y=v>=g,b=sNt(O=>{const T=O.target,P=[...c.branches].some(z=>z.contains(T));!y||P||(r==null||r(O),o==null||o(O),O.defaultPrevented||s==null||s())},h),F=lNt(O=>{const T=O.target;[...c.branches].some(z=>z.contains(T))||(i==null||i(O),o==null||o(O),O.defaultPrevented||s==null||s())},h);return aNt(O=>{v===c.layers.size-1&&(n==null||n(O),!O.defaultPrevented&&s&&(O.preventDefault(),s()))},h),k.useEffect(()=>{if(d)return a&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(afe=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),nfe(),()=>{a&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=afe)}},[d,h,a,c]),k.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),nfe())},[d,c]),k.useEffect(()=>{const O=()=>f({});return document.addEventListener(Iq,O),()=>document.removeEventListener(Iq,O)},[]),k.createElement(Xc.div,Tu({},l,{ref:m,style:{pointerEvents:C?y?"auto":"none":void 0,...u.style},onFocusCapture:O6(u.onFocusCapture,F.onFocusCapture),onBlurCapture:O6(u.onBlurCapture,F.onBlurCapture),onPointerDownCapture:O6(u.onPointerDownCapture,b.onPointerDownCapture)}))});function sNt(u,e=globalThis==null?void 0:globalThis.document){const t=oD(u),a=k.useRef(!1),n=k.useRef(()=>{});return k.useEffect(()=>{const r=o=>{if(o.target&&!a.current){let c=function(){WRe(nNt,t,l,{discrete:!0})};var s=c;const l={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",n.current),n.current=c,e.addEventListener("click",n.current,{once:!0})):c()}else e.removeEventListener("click",n.current);a.current=!1},i=window.setTimeout(()=>{e.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(i),e.removeEventListener("pointerdown",r),e.removeEventListener("click",n.current)}},[e,t]),{onPointerDownCapture:()=>a.current=!0}}function lNt(u,e=globalThis==null?void 0:globalThis.document){const t=oD(u),a=k.useRef(!1);return k.useEffect(()=>{const n=r=>{r.target&&!a.current&&WRe(rNt,t,{originalEvent:r},{discrete:!1})};return e.addEventListener("focusin",n),()=>e.removeEventListener("focusin",n)},[e,t]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function nfe(){const u=new CustomEvent(Iq);document.dispatchEvent(u)}function WRe(u,e,t,{discrete:a}){const n=t.originalEvent.target,r=new CustomEvent(u,{bubbles:!1,cancelable:!0,detail:t});e&&n.addEventListener(u,e,{once:!0}),a?tNt(n,r):n.dispatchEvent(r)}const pH="focusScope.autoFocusOnMount",DH="focusScope.autoFocusOnUnmount",rfe={bubbles:!1,cancelable:!0},cNt=k.forwardRef((u,e)=>{const{loop:t=!1,trapped:a=!1,onMountAutoFocus:n,onUnmountAutoFocus:r,...i}=u,[o,s]=k.useState(null),l=oD(n),c=oD(r),d=k.useRef(null),E=AB(e,m=>s(m)),h=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(a){let g=function(b){if(h.paused||!o)return;const F=b.target;o.contains(F)?d.current=F:gh(d.current,{select:!0})},v=function(b){if(h.paused||!o)return;const F=b.relatedTarget;F!==null&&(o.contains(F)||gh(d.current,{select:!0}))},C=function(b){if(document.activeElement===document.body)for(const O of b)O.removedNodes.length>0&&gh(o)};var m=g,p=v,x=C;document.addEventListener("focusin",g),document.addEventListener("focusout",v);const y=new MutationObserver(C);return o&&y.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),y.disconnect()}}},[a,o,h.paused]),k.useEffect(()=>{if(o){ofe.add(h);const m=document.activeElement;if(!o.contains(m)){const x=new CustomEvent(pH,rfe);o.addEventListener(pH,l),o.dispatchEvent(x),x.defaultPrevented||(dNt(pNt(JRe(o)),{select:!0}),document.activeElement===m&&gh(o))}return()=>{o.removeEventListener(pH,l),setTimeout(()=>{const x=new CustomEvent(DH,rfe);o.addEventListener(DH,c),o.dispatchEvent(x),x.defaultPrevented||gh(m??document.body,{select:!0}),o.removeEventListener(DH,c),ofe.remove(h)},0)}}},[o,l,c,h]);const f=k.useCallback(m=>{if(!t&&!a||h.paused)return;const p=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(p&&x){const g=m.currentTarget,[v,C]=ENt(g);v&&C?!m.shiftKey&&x===C?(m.preventDefault(),t&&gh(v,{select:!0})):m.shiftKey&&x===v&&(m.preventDefault(),t&&gh(C,{select:!0})):x===g&&m.preventDefault()}},[t,a,h.paused]);return k.createElement(Xc.div,Tu({tabIndex:-1},i,{ref:E,onKeyDown:f}))});function dNt(u,{select:e=!1}={}){const t=document.activeElement;for(const a of u)if(gh(a,{select:e}),document.activeElement!==t)return}function ENt(u){const e=JRe(u),t=ife(e,u),a=ife(e.reverse(),u);return[t,a]}function JRe(u){const e=[],t=document.createTreeWalker(u,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function ife(u,e){for(const t of u)if(!hNt(t,{upTo:e}))return t}function hNt(u,{upTo:e}){if(getComputedStyle(u).visibility==="hidden")return!0;for(;u;){if(e!==void 0&&u===e)return!1;if(getComputedStyle(u).display==="none")return!0;u=u.parentElement}return!1}function fNt(u){return u instanceof HTMLInputElement&&"select"in u}function gh(u,{select:e=!1}={}){if(u&&u.focus){const t=document.activeElement;u.focus({preventScroll:!0}),u!==t&&fNt(u)&&e&&u.select()}}const ofe=mNt();function mNt(){let u=[];return{add(e){const t=u[0];e!==t&&(t==null||t.pause()),u=sfe(u,e),u.unshift(e)},remove(e){var t;u=sfe(u,e),(t=u[0])===null||t===void 0||t.resume()}}}function sfe(u,e){const t=[...u],a=t.indexOf(e);return a!==-1&&t.splice(a,1),t}function pNt(u){return u.filter(e=>e.tagName!=="A")}const DNt=k.forwardRef((u,e)=>{var t;const{container:a=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...n}=u;return a?wE.createPortal(k.createElement(Xc.div,Tu({},n,{ref:e})),a):null});function xNt(u,e){return k.useReducer((t,a)=>{const n=e[t][a];return n??t},u)}const TR=u=>{const{present:e,children:t}=u,a=gNt(e),n=typeof t=="function"?t({present:a.isPresent}):k.Children.only(t),r=AB(a.ref,n.ref);return typeof t=="function"||a.isPresent?k.cloneElement(n,{ref:r}):null};TR.displayName="Presence";function gNt(u){const[e,t]=k.useState(),a=k.useRef({}),n=k.useRef(u),r=k.useRef("none"),i=u?"mounted":"unmounted",[o,s]=xNt(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const l=rw(a.current);r.current=o==="mounted"?l:"none"},[o]),Lq(()=>{const l=a.current,c=n.current;if(c!==u){const E=r.current,h=rw(l);u?s("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?s("UNMOUNT"):s(c&&E!==h?"ANIMATION_OUT":"UNMOUNT"),n.current=u}},[u,s]),Lq(()=>{if(e){const l=d=>{const h=rw(a.current).includes(d.animationName);d.target===e&&h&&n4.flushSync(()=>s("ANIMATION_END"))},c=d=>{d.target===e&&(r.current=rw(a.current))};return e.addEventListener("animationstart",c),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",c),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else s("ANIMATION_END")},[e,s]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:k.useCallback(l=>{l&&(a.current=getComputedStyle(l)),t(l)},[])}}function rw(u){return(u==null?void 0:u.animationName)||"none"}let xH=0;function vNt(){k.useEffect(()=>{var u,e;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(u=t[0])!==null&&u!==void 0?u:lfe()),document.body.insertAdjacentElement("beforeend",(e=t[1])!==null&&e!==void 0?e:lfe()),xH++,()=>{xH===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),xH--}},[])}function lfe(){const u=document.createElement("span");return u.setAttribute("data-radix-focus-guard",""),u.tabIndex=0,u.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",u}var sz="right-scroll-bar-position",lz="width-before-scroll-bar",CNt="with-scroll-bars-hidden",yNt="--removed-body-scroll-bar-size",qRe=XMe(),gH=function(){},MR=k.forwardRef(function(u,e){var t=k.useRef(null),a=k.useState({onScrollCapture:gH,onWheelCapture:gH,onTouchMoveCapture:gH}),n=a[0],r=a[1],i=u.forwardProps,o=u.children,s=u.className,l=u.removeScrollBar,c=u.enabled,d=u.shards,E=u.sideCar,h=u.noIsolation,f=u.inert,m=u.allowPinchZoom,p=u.as,x=p===void 0?"div":p,g=rR(u,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),v=E,C=YMe([t,e]),y=jt(jt({},g),n);return k.createElement(k.Fragment,null,c&&k.createElement(v,{sideCar:qRe,removeScrollBar:l,shards:d,noIsolation:h,inert:f,setCallbacks:r,allowPinchZoom:!!m,lockRef:t}),i?k.cloneElement(k.Children.only(o),jt(jt({},y),{ref:C})):k.createElement(x,jt({},y,{className:s,ref:C}),o))});MR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};MR.classNames={fullWidth:lz,zeroRight:sz};var bNt={left:0,top:0,right:0,gap:0},vH=function(u){return parseInt(u||"",10)||0},kNt=function(u){var e=window.getComputedStyle(document.body),t=e[u==="padding"?"paddingLeft":"marginLeft"],a=e[u==="padding"?"paddingTop":"marginTop"],n=e[u==="padding"?"paddingRight":"marginRight"];return[vH(t),vH(a),vH(n)]},FNt=function(u){if(u===void 0&&(u="margin"),typeof window>"u")return bNt;var e=kNt(u),t=document.documentElement.clientWidth,a=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,a-t+e[2]-e[0])}},ANt=oR(),BNt=function(u,e,t,a){var n=u.left,r=u.top,i=u.right,o=u.gap;return t===void 0&&(t="margin"),`
|
|
701
701
|
.`.concat(CNt,` {
|
|
702
702
|
overflow: hidden `).concat(a,`;
|
|
703
703
|
padding-right: `).concat(o,"px ").concat(a,`;
|
|
@@ -926,7 +926,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
926
926
|
*/var ZWe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],GM=ZWe.join(","),QWe=typeof Element>"u",BD=QWe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,UM=!QWe&&Element.prototype.getRootNode?function(u){var e;return u==null||(e=u.getRootNode)===null||e===void 0?void 0:e.call(u)}:function(u){return u==null?void 0:u.ownerDocument},WM=function u(e,t){var a;t===void 0&&(t=!0);var n=e==null||(a=e.getAttribute)===null||a===void 0?void 0:a.call(e,"inert"),r=n===""||n==="true",i=r||t&&e&&u(e.parentNode);return i},x0a=function(e){var t,a=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return a===""||a==="true"},YWe=function(e,t,a){if(WM(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(GM));return t&&BD.call(e,GM)&&n.unshift(e),n=n.filter(a),n},XWe=function u(e,t,a){for(var n=[],r=Array.from(e);r.length;){var i=r.shift();if(!WM(i,!1))if(i.tagName==="SLOT"){var o=i.assignedElements(),s=o.length?o:i.children,l=u(s,!0,a);a.flatten?n.push.apply(n,l):n.push({scopeParent:i,candidates:l})}else{var c=BD.call(i,GM);c&&a.filter(i)&&(t||!e.includes(i))&&n.push(i);var d=i.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(i),E=!WM(d,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(i));if(d&&E){var h=u(d===!0?i.children:d.children,!0,a);a.flatten?n.push.apply(n,h):n.push({scopeParent:i,candidates:h})}else r.unshift.apply(r,i.children)}}return n},eJe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Kh=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||x0a(e))&&!eJe(e)?0:e.tabIndex},g0a=function(e,t){var a=Kh(e);return a<0&&t&&!eJe(e)?0:a},v0a=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},uJe=function(e){return e.tagName==="INPUT"},C0a=function(e){return uJe(e)&&e.type==="hidden"},y0a=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(a){return a.tagName==="SUMMARY"});return t},b0a=function(e,t){for(var a=0;a<e.length;a++)if(e[a].checked&&e[a].form===t)return e[a]},k0a=function(e){if(!e.name)return!0;var t=e.form||UM(e),a=function(o){return t.querySelectorAll('input[type="radio"][name="'+o+'"]')},n;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")n=a(window.CSS.escape(e.name));else try{n=a(e.name)}catch(i){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",i.message),!1}var r=b0a(n,e.form);return!r||r===e},F0a=function(e){return uJe(e)&&e.type==="radio"},A0a=function(e){return F0a(e)&&!k0a(e)},B0a=function(e){var t,a=e&&UM(e),n=(t=a)===null||t===void 0?void 0:t.host,r=!1;if(a&&a!==e){var i,o,s;for(r=!!((i=n)!==null&&i!==void 0&&(o=i.ownerDocument)!==null&&o!==void 0&&o.contains(n)||e!=null&&(s=e.ownerDocument)!==null&&s!==void 0&&s.contains(e));!r&&n;){var l,c,d;a=UM(n),n=(l=a)===null||l===void 0?void 0:l.host,r=!!((c=n)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(n))}}return r},$De=function(e){var t=e.getBoundingClientRect(),a=t.width,n=t.height;return a===0&&n===0},S0a=function(e,t){var a=t.displayCheck,n=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var r=BD.call(e,"details>summary:first-of-type"),i=r?e.parentElement:e;if(BD.call(i,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="legacy-full"){if(typeof n=="function"){for(var o=e;e;){var s=e.parentElement,l=UM(e);if(s&&!s.shadowRoot&&n(s)===!0)return $De(e);e.assignedSlot?e=e.assignedSlot:!s&&l!==e.ownerDocument?e=l.host:e=s}e=o}if(B0a(e))return!e.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return $De(e);return!1},w0a=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var a=0;a<t.children.length;a++){var n=t.children.item(a);if(n.tagName==="LEGEND")return BD.call(t,"fieldset[disabled] *")?!0:!n.contains(e)}return!0}t=t.parentElement}return!1},JM=function(e,t){return!(t.disabled||WM(t)||C0a(t)||S0a(t,e)||y0a(t)||w0a(t))},qQ=function(e,t){return!(A0a(t)||Kh(t)<0||!JM(e,t))},O0a=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},z0a=function u(e){var t=[],a=[];return e.forEach(function(n,r){var i=!!n.scopeParent,o=i?n.scopeParent:n,s=g0a(o,i),l=i?u(n.candidates):o;s===0?i?t.push.apply(t,l):t.push(o):a.push({documentOrder:r,tabIndex:s,item:n,isScope:i,content:l})}),a.sort(v0a).reduce(function(n,r){return r.isScope?n.push.apply(n,r.content):n.push(r.content),n},[]).concat(t)},tJe=function(e,t){t=t||{};var a;return t.getShadowRoot?a=XWe([e],t.includeContainer,{filter:qQ.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:O0a}):a=YWe(e,t.includeContainer,qQ.bind(null,t)),z0a(a)},aJe=function(e,t){t=t||{};var a;return t.getShadowRoot?a=XWe([e],t.includeContainer,{filter:JM.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):a=YWe(e,t.includeContainer,JM.bind(null,t)),a},gp=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return BD.call(e,GM)===!1?!1:qQ(t,e)},_0a=ZWe.concat("iframe").join(","),Sz=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return BD.call(e,_0a)===!1?!1:JM(t,e)};const T0a=Object.freeze(Object.defineProperty({__proto__:null,focusable:aJe,getTabIndex:Kh,isFocusable:Sz,isTabbable:gp,tabbable:tJe},Symbol.toStringTag,{value:"Module"}));/*!
|
|
927
927
|
* focus-trap 7.5.4
|
|
928
928
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
929
|
-
*/function IDe(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(u);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(u,n).enumerable})),t.push.apply(t,a)}return t}function KDe(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?IDe(Object(t),!0).forEach(function(a){M0a(u,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):IDe(Object(t)).forEach(function(a){Object.defineProperty(u,a,Object.getOwnPropertyDescriptor(t,a))})}return u}function M0a(u,e,t){return e=j0a(e),e in u?Object.defineProperty(u,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):u[e]=t,u}function P0a(u,e){if(typeof u!="object"||u===null)return u;var t=u[Symbol.toPrimitive];if(t!==void 0){var a=t.call(u,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function j0a(u){var e=P0a(u,"string");return typeof e=="symbol"?e:String(e)}var HDe={activateTrap:function(e,t){if(e.length>0){var a=e[e.length-1];a!==t&&a.pause()}var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var a=e.indexOf(t);a!==-1&&e.splice(a,1),e.length>0&&e[e.length-1].unpause()}},N0a=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},R0a=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},gF=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},L0a=function(e){return gF(e)&&!e.shiftKey},$0a=function(e){return gF(e)&&e.shiftKey},VDe=function(e){return setTimeout(e,0)},GDe=function(e,t){var a=-1;return e.every(function(n,r){return t(n)?(a=r,!1):!0}),a},pb=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];return typeof e=="function"?e.apply(void 0,a):e},Hw=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},I0a=[],K0a=function(e,t){var a=(t==null?void 0:t.document)||document,n=(t==null?void 0:t.trapStack)||I0a,r=KDe({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:L0a,isKeyBackward:$0a},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(A,S,w){return A&&A[S]!==void 0?A[S]:r[w||S]},l=function(A,S){var w=typeof(S==null?void 0:S.composedPath)=="function"?S.composedPath():void 0;return i.containerGroups.findIndex(function(_){var j=_.container,K=_.tabbableNodes;return j.contains(A)||(w==null?void 0:w.includes(j))||K.find(function(M){return M===A})})},c=function(A){var S=r[A];if(typeof S=="function"){for(var w=arguments.length,_=new Array(w>1?w-1:0),j=1;j<w;j++)_[j-1]=arguments[j];S=S.apply(void 0,_)}if(S===!0&&(S=void 0),!S){if(S===void 0||S===!1)return S;throw new Error("`".concat(A,"` was specified but was not a node, or did not return a node"))}var K=S;if(typeof S=="string"&&(K=a.querySelector(S),!K))throw new Error("`".concat(A,"` as selector refers to no known node"));return K},d=function(){var A=c("initialFocus");if(A===!1)return!1;if(A===void 0||!Sz(A,r.tabbableOptions))if(l(a.activeElement)>=0)A=a.activeElement;else{var S=i.tabbableGroups[0],w=S&&S.firstTabbableNode;A=w||c("fallbackFocus")}if(!A)throw new Error("Your focus-trap needs to have at least one focusable element");return A},E=function(){if(i.containerGroups=i.containers.map(function(A){var S=tJe(A,r.tabbableOptions),w=aJe(A,r.tabbableOptions),_=S.length>0?S[0]:void 0,j=S.length>0?S[S.length-1]:void 0,K=w.find(function(G){return gp(G)}),M=w.slice().reverse().find(function(G){return gp(G)}),L=!!S.find(function(G){return Kh(G)>0});return{container:A,tabbableNodes:S,focusableNodes:w,posTabIndexesFound:L,firstTabbableNode:_,lastTabbableNode:j,firstDomTabbableNode:K,lastDomTabbableNode:M,nextTabbableNode:function(V){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,I=S.indexOf(V);return I<0?R?w.slice(w.indexOf(V)+1).find(function(U){return gp(U)}):w.slice(0,w.indexOf(V)).reverse().find(function(U){return gp(U)}):S[I+(R?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(A){return A.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(A){return A.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function z(A){var S=A.activeElement;if(S)return S.shadowRoot&&S.shadowRoot.activeElement!==null?z(S.shadowRoot):S},f=function z(A){if(A!==!1&&A!==h(document)){if(!A||!A.focus){z(d());return}A.focus({preventScroll:!!r.preventScroll}),i.mostRecentlyFocusedNode=A,N0a(A)&&A.select()}},m=function(A){var S=c("setReturnFocus",A);return S||(S===!1?!1:A)},p=function(A){var S=A.target,w=A.event,_=A.isBackward,j=_===void 0?!1:_;S=S||Hw(w),E();var K=null;if(i.tabbableGroups.length>0){var M=l(S,w),L=M>=0?i.containerGroups[M]:void 0;if(M<0)j?K=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:K=i.tabbableGroups[0].firstTabbableNode;else if(j){var G=GDe(i.tabbableGroups,function($){var q=$.firstTabbableNode;return S===q});if(G<0&&(L.container===S||Sz(S,r.tabbableOptions)&&!gp(S,r.tabbableOptions)&&!L.nextTabbableNode(S,!1))&&(G=M),G>=0){var V=G===0?i.tabbableGroups.length-1:G-1,R=i.tabbableGroups[V];K=Kh(S)>=0?R.lastTabbableNode:R.lastDomTabbableNode}else gF(w)||(K=L.nextTabbableNode(S,!1))}else{var I=GDe(i.tabbableGroups,function($){var q=$.lastTabbableNode;return S===q});if(I<0&&(L.container===S||Sz(S,r.tabbableOptions)&&!gp(S,r.tabbableOptions)&&!L.nextTabbableNode(S))&&(I=M),I>=0){var U=I===i.tabbableGroups.length-1?0:I+1,W=i.tabbableGroups[U];K=Kh(S)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else gF(w)||(K=L.nextTabbableNode(S))}}else K=c("fallbackFocus");return K},x=function(A){var S=Hw(A);if(!(l(S,A)>=0)){if(pb(r.clickOutsideDeactivates,A)){o.deactivate({returnFocus:r.returnFocusOnDeactivate});return}pb(r.allowOutsideClick,A)||A.preventDefault()}},g=function(A){var S=Hw(A),w=l(S,A)>=0;if(w||S instanceof Document)w&&(i.mostRecentlyFocusedNode=S);else{A.stopImmediatePropagation();var _,j=!0;if(i.mostRecentlyFocusedNode)if(Kh(i.mostRecentlyFocusedNode)>0){var K=l(i.mostRecentlyFocusedNode),M=i.containerGroups[K].tabbableNodes;if(M.length>0){var L=M.findIndex(function(G){return G===i.mostRecentlyFocusedNode});L>=0&&(r.isKeyForward(i.recentNavEvent)?L+1<M.length&&(_=M[L+1],j=!1):L-1>=0&&(_=M[L-1],j=!1))}}else i.containerGroups.some(function(G){return G.tabbableNodes.some(function(V){return Kh(V)>0})})||(j=!1);else j=!1;j&&(_=p({target:i.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(i.recentNavEvent)})),f(_||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},v=function(A){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=A;var w=p({event:A,isBackward:S});w&&(gF(A)&&A.preventDefault(),f(w))},C=function(A){if(R0a(A)&&pb(r.escapeDeactivates,A)!==!1){A.preventDefault(),o.deactivate();return}(r.isKeyForward(A)||r.isKeyBackward(A))&&v(A,r.isKeyBackward(A))},y=function(A){var S=Hw(A);l(S,A)>=0||pb(r.clickOutsideDeactivates,A)||pb(r.allowOutsideClick,A)||(A.preventDefault(),A.stopImmediatePropagation())},b=function(){if(i.active)return HDe.activateTrap(n,o),i.delayInitialFocusTimer=r.delayInitialFocus?VDe(function(){f(d())}):f(d()),a.addEventListener("focusin",g,!0),a.addEventListener("mousedown",x,{capture:!0,passive:!1}),a.addEventListener("touchstart",x,{capture:!0,passive:!1}),a.addEventListener("click",y,{capture:!0,passive:!1}),a.addEventListener("keydown",C,{capture:!0,passive:!1}),o},F=function(){if(i.active)return a.removeEventListener("focusin",g,!0),a.removeEventListener("mousedown",x,!0),a.removeEventListener("touchstart",x,!0),a.removeEventListener("click",y,!0),a.removeEventListener("keydown",C,!0),o},O=function(A){var S=A.some(function(w){var _=Array.from(w.removedNodes);return _.some(function(j){return j===i.mostRecentlyFocusedNode})});S&&f(d())},T=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(O):void 0,P=function(){T&&(T.disconnect(),i.active&&!i.paused&&i.containers.map(function(A){T.observe(A,{subtree:!0,childList:!0})}))};return o={get active(){return i.active},get paused(){return i.paused},activate:function(A){if(i.active)return this;var S=s(A,"onActivate"),w=s(A,"onPostActivate"),_=s(A,"checkCanFocusTrap");_||E(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=a.activeElement,S==null||S();var j=function(){_&&E(),b(),P(),w==null||w()};return _?(_(i.containers.concat()).then(j,j),this):(j(),this)},deactivate:function(A){if(!i.active)return this;var S=KDe({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},A);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,F(),i.active=!1,i.paused=!1,P(),HDe.deactivateTrap(n,o);var w=s(S,"onDeactivate"),_=s(S,"onPostDeactivate"),j=s(S,"checkCanReturnFocus"),K=s(S,"returnFocus","returnFocusOnDeactivate");w==null||w();var M=function(){VDe(function(){K&&f(m(i.nodeFocusedBeforeActivation)),_==null||_()})};return K&&j?(j(m(i.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(A){if(i.paused||!i.active)return this;var S=s(A,"onPause"),w=s(A,"onPostPause");return i.paused=!0,S==null||S(),F(),P(),w==null||w(),this},unpause:function(A){if(!i.paused||!i.active)return this;var S=s(A,"onUnpause"),w=s(A,"onPostUnpause");return i.paused=!1,S==null||S(),E(),b(),P(),w==null||w(),this},updateContainerElements:function(A){var S=[].concat(A).filter(Boolean);return i.containers=S.map(function(w){return typeof w=="string"?a.querySelector(w):w}),i.active&&E(),P(),this}},o.updateContainerElements(e),o};const H0a=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:K0a},Symbol.toStringTag,{value:"Module"})),V0a=Vl(H0a),G0a=Vl(T0a);function E2(u){"@babel/helpers - typeof";return E2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E2(u)}function U0a(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function UDe(u,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(u,nJe(a.key),a)}}function W0a(u,e,t){return e&&UDe(u.prototype,e),t&&UDe(u,t),Object.defineProperty(u,"prototype",{writable:!1}),u}function J0a(u,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(e&&e.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),e&&ZQ(u,e)}function ZQ(u,e){return ZQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},ZQ(u,e)}function q0a(u){var e=Q0a();return function(){var a=qM(u),n;if(e){var r=qM(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Z0a(this,n)}}function Z0a(u,e){if(e&&(E2(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ek(u)}function Ek(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function Q0a(){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}}function qM(u){return qM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qM(u)}function Y0a(u,e,t){return e=nJe(e),e in u?Object.defineProperty(u,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):u[e]=t,u}function nJe(u){var e=X0a(u,"string");return E2(e)==="symbol"?e:String(e)}function X0a(u,e){if(E2(u)!=="object"||u===null)return u;var t=u[Symbol.toPrimitive];if(t!==void 0){var a=t.call(u,e||"default");if(E2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}var Vw=k,xt=BR,eia=V0a,uia=eia.createFocusTrap,tia=G0a,aia=tia.isFocusable,fie=function(u){J0a(t,u);var e=q0a(t);function t(a){var n;U0a(this,t),n=e.call(this,a),Y0a(Ek(n),"getNodeForOption",function(o){var s,l=(s=this.internalOptions[o])!==null&&s!==void 0?s:this.originalOptions[o];if(typeof l=="function"){for(var c=arguments.length,d=new Array(c>1?c-1:0),E=1;E<c;E++)d[E-1]=arguments[E];l=l.apply(void 0,d)}if(l===!0&&(l=void 0),!l){if(l===void 0||l===!1)return l;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var h=l;if(typeof l=="string"){var f;if(h=(f=this.getDocument())===null||f===void 0?void 0:f.querySelector(l),!h)throw new Error("`".concat(o,"` as selector refers to no known node"))}return h}),n.handleDeactivate=n.handleDeactivate.bind(Ek(n)),n.handlePostDeactivate=n.handlePostDeactivate.bind(Ek(n)),n.handleClickOutsideDeactivates=n.handleClickOutsideDeactivates.bind(Ek(n)),n.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:n.handleDeactivate,onPostDeactivate:n.handlePostDeactivate,clickOutsideDeactivates:n.handleClickOutsideDeactivates},n.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var r=a.focusTrapOptions;for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){if(i==="returnFocusOnDeactivate"||i==="onDeactivate"||i==="onPostDeactivate"||i==="checkCanReturnFocus"||i==="clickOutsideDeactivates"){n.originalOptions[i]=r[i];continue}n.internalOptions[i]=r[i]}return n.outsideClick=null,n.focusTrapElements=a.containerElements||[],n.updatePreviousElement(),n}return W0a(t,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var n=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return n||(n===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var n=this.getDocument();n&&(this.previouslyFocusedElement=n.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(n){var r=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,n):this.originalOptions.clickOutsideDeactivates;return r&&(this.outsideClick={target:n.target,allowDeactivation:r}),r}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var n=this,r=function(){var o=n.getReturnFocusNode(),s=!!(n.originalOptions.returnFocusOnDeactivate&&o!==null&&o!==void 0&&o.focus&&(!n.outsideClick||n.outsideClick.allowDeactivation&&!aia(n.outsideClick.target,n.internalOptions.tabbableOptions))),l=n.internalOptions.preventScroll,c=l===void 0?!1:l;s&&o.focus({preventScroll:c}),n.originalOptions.onPostDeactivate&&n.originalOptions.onPostDeactivate.call(null),n.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(r,r):r()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var n=this.focusTrapElements.some(Boolean);n&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(n){if(this.focusTrap){n.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var r=!n.active&&this.props.active,i=n.active&&!this.props.active,o=!n.paused&&this.props.paused,s=n.paused&&!this.props.paused;if(r&&(this.updatePreviousElement(),this.focusTrap.activate()),i){this.deactivateTrap();return}o&&this.focusTrap.pause(),s&&this.focusTrap.unpause()}else n.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var n=this,r=this.props.children?Vw.Children.only(this.props.children):void 0;if(r){if(r.type&&r.type===Vw.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var i=function(l){var c=n.props.containerElements;r&&(typeof r.ref=="function"?r.ref(l):r.ref&&(r.ref.current=l)),n.focusTrapElements=c||[l]},o=Vw.cloneElement(r,{ref:i});return o}return null}}]),t}(Vw.Component),Db=typeof Element>"u"?Function:Element;fie.propTypes={active:xt.bool,paused:xt.bool,focusTrapOptions:xt.shape({document:xt.object,onActivate:xt.func,onPostActivate:xt.func,checkCanFocusTrap:xt.func,onPause:xt.func,onPostPause:xt.func,onUnpause:xt.func,onPostUnpause:xt.func,onDeactivate:xt.func,onPostDeactivate:xt.func,checkCanReturnFocus:xt.func,initialFocus:xt.oneOfType([xt.instanceOf(Db),xt.string,xt.bool,xt.func]),fallbackFocus:xt.oneOfType([xt.instanceOf(Db),xt.string,xt.func]),escapeDeactivates:xt.oneOfType([xt.bool,xt.func]),clickOutsideDeactivates:xt.oneOfType([xt.bool,xt.func]),returnFocusOnDeactivate:xt.bool,setReturnFocus:xt.oneOfType([xt.instanceOf(Db),xt.string,xt.bool,xt.func]),allowOutsideClick:xt.oneOfType([xt.bool,xt.func]),preventScroll:xt.bool,tabbableOptions:xt.shape({displayCheck:xt.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:xt.oneOfType([xt.bool,xt.func])}),trapStack:xt.array,isKeyForward:xt.func,isKeyBackward:xt.func}),containerElements:xt.arrayOf(xt.instanceOf(Db)),children:xt.oneOfType([xt.element,xt.instanceOf(Db)])};fie.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:uia};var nia=fie;const ria=ea(nia),iia=u=>{const e=k.useRef(null),t=ia(()=>{var o;(o=u.onActiveChange)==null||o.call(u,!1)}),a=o=>{const s=e.current;if(!s)return;const{left:l,top:c,width:d,height:E}=s.getBoundingClientRect(),h=o.clientX-l,f=o.clientY-c,m=h/d,p=f/E;return{x:h,y:f,pctX:m,pctY:p}},n=ia(o=>{var s;u.active&&(o.preventDefault(),(s=u.onKeyDown)==null||s.call(u,o.key))}),r=ia(o=>{var s;u.active&&(o.preventDefault(),(s=u.onKeyUp)==null||s.call(u,o.key))}),i=ia(o=>{var h;if(!u.active)return;o.preventDefault();const s=e.current;if(!s)return;const{offsetHeight:l,offsetWidth:c}=s,{deltaX:d,deltaY:E}=o;(h=u.onWheel)==null||h.call(u,{deltaX:d,deltaY:E,pctDeltaX:d/c,pctDeltaY:E/l})});return k.useEffect(()=>(window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}),[n]),k.useEffect(()=>(window.addEventListener("keyup",r),()=>{window.removeEventListener("keyup",r)}),[r]),k.useEffect(()=>{if(!e.current)return;const o=e.current;return o.addEventListener("wheel",i,{passive:!1}),()=>{o.removeEventListener("wheel",i)}},[i]),D.jsx(ria,{active:u.active,focusTrapOptions:{escapeDeactivates:!1,clickOutsideDeactivates:!0,onDeactivate:t},children:D.jsxs("div",{ref:e,className:"group relative",tabIndex:u.active?0:-1,onMouseDown:o=>{var l;if(!u.active)return;const s=a(o);s&&((l=u.onMouseEvent)==null||l.call(u,{event:"down",...s}))},onMouseUp:o=>{var l;if(!u.active)return;const s=a(o);s&&((l=u.onMouseEvent)==null||l.call(u,{event:"up",...s}))},onMouseMove:o=>{var l;if(!u.active)return;const s=a(o);s&&((l=u.onMouseEvent)==null||l.call(u,{event:"move",...s}))},children:[D.jsx("input",{className:"absolute h-0 w-0"}),u.active?null:D.jsx("div",{className:"bg-foreground absolute inset-0 flex cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-50",onClick:()=>{var o;return(o=u.onActiveChange)==null?void 0:o.call(u,!0)},children:D.jsx("h2",{className:"text-background text-xl font-semibold",children:"Click to turn on interactive mode"})}),u.active?D.jsx("div",{className:"shadow-frame pointer-events-none absolute inset-0 shadow-red-500"}):null,u.active?D.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 flex items-center justify-center",children:D.jsx("div",{className:"text-background bg-red-500 p-1 text-xs",children:"You are in interactive mode. Click away to exit."})}):null,u.children]})})},rJe=({aiSuggestibleCommandsOnly:u,onSelect:e,open:t,onOpenChange:a,modules:n,hideModules:r,children:i})=>{const[o,s]=k.useState(""),l=oia({aiSuggestibleCommandsOnly:u}),c=k.useMemo(()=>l.map(x=>({type:"STEP",name:Tae[x],description:HFu[x],onSelect:()=>{if(KFu(x)){e==null||e({type:Fe.PRESET_ACTION,command:x});return}e==null||e({type:x})}})),[e,l]),d=k.useMemo(()=>n.map(x=>({type:"MODULE",name:x.fileName||Cwe(x.name),containingFolderPath:x.containingFolderPath,description:x.description||void 0,onSelect:()=>{e==null||e({...x,type:"RESOLVED_MODULE"})}})),[n,e]),E=k.useMemo(()=>new dx([...d,...c],{keys:[{name:"name",weight:1},{name:"description",weight:.8},{name:"containingFolderPath",weight:.6}],threshold:.4,includeScore:!0,findAllMatches:!0,ignoreLocation:!0,useExtendedSearch:!0,shouldSort:!0,includeMatches:!0,distance:100,ignoreFieldNorm:!1}),[d,c]),h=k.useMemo(()=>{const x=o.trim().replace(/-/g," ");if(!x)return[...c,...d];const g=x.toLowerCase().split(/\s+/);return g.push(x),E.search({$and:g.map(C=>({$or:[{name:C},{description:C},{containingFolderPath:C}]}))}).map(C=>C.item)},[E,d,o,c]),f=k.useMemo(()=>h.filter(x=>x.type==="STEP"),[h]),m=k.useMemo(()=>h.filter(x=>x.type==="MODULE"),[h]),p=k.useRef(null);return k.useEffect(()=>{t||s("")},[t]),D.jsxs(pRt,{open:t,onOpenChange:a,trigger:i,commandProps:{shouldFilter:!1},dialogContentProps:{className:"max-w-2xl translate-y-0 top-[20%] data-[state=closed]:!slide-out-to-top-[0%] data-[state=open]:!slide-in-from-top-[0%]"},children:[D.jsx(PC,{ref:p,autoFocus:!0,placeholder:"Search by describing what you want to do...",value:o,onValueChange:x=>{s(x)}}),D.jsxs(bl,{defaultValue:"steps",onValueChange:()=>{window.setTimeout(()=>{var x;(x=p.current)==null||x.focus()},0)},children:[D.jsxs(Ms,{className:"m-2",children:[D.jsx(ma,{value:"all",children:"All"}),D.jsx(ma,{value:"steps",children:"Steps"}),r?null:D.jsx(ma,{value:"modules",children:"Modules"})]}),D.jsx(pa,{value:"all",className:"border-border mt-0 border-t",children:D.jsxs(kf,{className:"max-h-[500px]",children:[h.length?null:D.jsx(Ff,{children:"No items found."}),h.length?h.map(x=>D.jsx(H1,{onSelect:x.onSelect,children:D.jsxs("div",{children:[D.jsxs("div",{className:"text-base font-medium",children:[x.name,x.type==="MODULE"&&x.containingFolderPath?D.jsx("span",{className:"text-muted-foreground ml-1 text-sm font-normal",children:x.containingFolderPath}):null]}),D.jsx("div",{className:"text-muted-foreground text-sm",children:x.description})]})},x.name)):null]})}),D.jsx(pa,{value:"steps",className:"border-border mt-0 border-t",children:D.jsxs(kf,{className:"max-h-[500px]",children:[f.length?null:D.jsx(Ff,{children:"No steps found."}),f.length?f.map(x=>D.jsx(H1,{onSelect:x.onSelect,children:D.jsxs("div",{children:[D.jsx("div",{className:"text-base font-medium",children:x.name}),D.jsx("div",{className:"text-muted-foreground text-sm",children:x.description})]})},x.name)):null]})}),D.jsx(pa,{value:"modules",className:"border-border mt-0 border-t",children:D.jsxs(kf,{className:"max-h-[500px]",children:[m.length?null:D.jsx(Ff,{children:"No modules found."}),m.length?m.map(x=>D.jsx(H1,{onSelect:x.onSelect,children:D.jsxs("div",{children:[D.jsxs("div",{className:"text-base font-medium",children:[x.name,x.type==="MODULE"&&x.containingFolderPath?D.jsx("span",{className:"text-muted-foreground ml-1 text-sm font-normal",children:x.containingFolderPath}):null]}),D.jsx("div",{className:"text-muted-foreground text-sm",children:x.description})]})},x.name)):null]})})]})]})},oia=u=>{const{ai:e}=vre();return k.useMemo(()=>{const t=sia.filter(a=>!lia.has(a));return e!=null&&e.aiAction&&t.push(Fe.AI_ACTION_DYNAMIC),t.filter(a=>a===H.SUCCESS?u.aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly?Xte.options.some(n=>n.shape.type.value===a):!0)},[e==null?void 0:e.aiAction,u.aiSuggestibleCommandsOnly])},sia=[...Object.values(H)];Fe.AI_ACTION+"",Fe.AI_ACTION_DYNAMIC+"",H.AI_ASSERTION+"",H.AI_EXTRACT+"",H.SUCCESS+"",H.AUTH_LOAD+"",H.AUTH_SAVE+"",H.CAPTCHA+"",H.VISUAL_DIFF+"",H.JAVASCRIPT+"",H.ELEMENT_CHECK+"",H.PAGE_CHECK+"",H.CLICK+"",H.DRAG+"",H.FILE_UPLOAD+"",H.SELECT_OPTION+"",H.REQUEST+"",H.GRAPHQL_REQUEST+"",H.TYPE+"",H.PRESS+"",H.KEY_DOWN+"",H.KEY_UP+"",H.NAVIGATE+"",H.DIALOG+"",H.SCROLL_UP+"",H.SCROLL_DOWN+"",H.SCROLL_LEFT+"",H.SCROLL_RIGHT+"",H.GO_BACK+"",H.GO_FORWARD+"",H.WAIT+"",H.WAIT_FOR_URL+"",H.REFRESH+"",H.SWITCH_TAB+"",H.NEW_TAB+"",H.COOKIE+"",H.LOCAL_STORAGE+"",H.HOVER+"",H.FOCUS+"",H.BLUR+"",H.MOUSE_DRAG+"",H.COPY+"",H.PASTE+"",H.REGISTER_REQUEST_LISTENER+"",H.AWAIT_LISTENER+"",H.RECORD_REQUESTS+"",H.GET_RECORDED_REQUESTS+"",H.SET_HEADER+"";const lia=new Set([Fe.AI_ACTION,H.CAPTCHA]),cia=u=>{switch(u.type){case Fe.AI_ACTION:return{type:u.type};case Fe.AI_ACTION_DYNAMIC:return{type:u.type};case Fe.PRESET_ACTION:return{type:u.type,command:u.command.type};case"RESOLVED_MODULE":return u;case Fe.CONDITIONAL:case Fe.SECTION:case Fe.IFRAME:throw new Error("not implemented");default:return(t=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},dia=u=>{switch(u.type){case Fe.AI_ACTION:return Fe.AI_ACTION;case Fe.AI_ACTION_DYNAMIC:return Fe.AI_ACTION_DYNAMIC;case Fe.PRESET_ACTION:return u.command;case"RESOLVED_MODULE":return"RESOLVED_MODULE";default:return(t=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},Eia=u=>{const[e,t]=k.useState(!1),a=dia(u.value);return D.jsx(rJe,{open:e,onOpenChange:t,hideModules:u.hideModules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly,modules:u.modules,onSelect:n=>{var r;(r=u.onChange)==null||r.call(u,n),t(!1)},children:D.jsxs(ut,{variant:"outline",role:"combobox",disabled:u.disabled,className:Pe({"pointer-events-none":u.readOnly}),children:[Tae[a],D.jsx(Xae,{className:"h-4 w-4 shrink-0 opacity-50"})]})})},wz=u=>{const[e,t]=k.useState(!1);return D.jsx(rJe,{open:e,onOpenChange:t,hideModules:u.hideModules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly,modules:u.modules,onSelect:a=>{var n;(n=u.onAdd)==null||n.call(u,a),t(!1)},children:u.children??D.jsxs(ut,{variant:"outline",disabled:u.disabled,children:[D.jsx(YD,{className:"h-4 w-4"})," Add new step"]})})};var iJe=Symbol.for("immer-nothing"),WDe=Symbol.for("immer-draftable"),Kl=Symbol.for("immer-state");function M1(u,...e){throw new Error(`[Immer] minified error nr: ${u}. Full error at: https://bit.ly/3cXEKWf`)}var h2=Object.getPrototypeOf;function f2(u){return!!u&&!!u[Kl]}function SD(u){var e;return u?oJe(u)||Array.isArray(u)||!!u[WDe]||!!((e=u.constructor)!=null&&e[WDe])||PL(u)||jL(u):!1}var hia=Object.prototype.constructor.toString();function oJe(u){if(!u||typeof u!="object")return!1;const e=h2(u);if(e===null)return!0;const t=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return t===Object?!0:typeof t=="function"&&Function.toString.call(t)===hia}function ZM(u,e){ML(u)===0?Reflect.ownKeys(u).forEach(t=>{e(t,u[t],u)}):u.forEach((t,a)=>e(a,t,u))}function ML(u){const e=u[Kl];return e?e.type_:Array.isArray(u)?1:PL(u)?2:jL(u)?3:0}function QQ(u,e){return ML(u)===2?u.has(e):Object.prototype.hasOwnProperty.call(u,e)}function sJe(u,e,t){const a=ML(u);a===2?u.set(e,t):a===3?u.add(t):u[e]=t}function fia(u,e){return u===e?u!==0||1/u===1/e:u!==u&&e!==e}function PL(u){return u instanceof Map}function jL(u){return u instanceof Set}function vp(u){return u.copy_||u.base_}function YQ(u,e){if(PL(u))return new Map(u);if(jL(u))return new Set(u);if(Array.isArray(u))return Array.prototype.slice.call(u);const t=oJe(u);if(e===!0||e==="class_only"&&!t){const a=Object.getOwnPropertyDescriptors(u);delete a[Kl];let n=Reflect.ownKeys(a);for(let r=0;r<n.length;r++){const i=n[r],o=a[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(a[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:u[i]})}return Object.create(h2(u),a)}else{const a=h2(u);if(a!==null&&t)return{...u};const n=Object.create(a);return Object.assign(n,u)}}function S7(u,e=!1){return NL(u)||f2(u)||!SD(u)||(ML(u)>1&&(u.set=u.add=u.clear=u.delete=mia),Object.freeze(u),e&&Object.entries(u).forEach(([t,a])=>S7(a,!0))),u}function mia(){M1(2)}function NL(u){return Object.isFrozen(u)}var pia={};function wD(u){const e=pia[u];return e||M1(0,u),e}var w7;function lJe(){return w7}function Dia(u,e){return{drafts_:[],parent_:u,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function JDe(u,e){e&&(wD("Patches"),u.patches_=[],u.inversePatches_=[],u.patchListener_=e)}function XQ(u){eY(u),u.drafts_.forEach(xia),u.drafts_=null}function eY(u){u===w7&&(w7=u.parent_)}function qDe(u){return w7=Dia(w7,u)}function xia(u){const e=u[Kl];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function ZDe(u,e){e.unfinalizedDrafts_=e.drafts_.length;const t=e.drafts_[0];return u!==void 0&&u!==t?(t[Kl].modified_&&(XQ(e),M1(4)),SD(u)&&(u=QM(e,u),e.parent_||YM(e,u)),e.patches_&&wD("Patches").generateReplacementPatches_(t[Kl].base_,u,e.patches_,e.inversePatches_)):u=QM(e,t,[]),XQ(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),u!==iJe?u:void 0}function QM(u,e,t){if(NL(e))return e;const a=e[Kl];if(!a)return ZM(e,(n,r)=>QDe(u,a,e,n,r,t)),e;if(a.scope_!==u)return e;if(!a.modified_)return YM(u,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const n=a.copy_;let r=n,i=!1;a.type_===3&&(r=new Set(n),n.clear(),i=!0),ZM(r,(o,s)=>QDe(u,a,n,o,s,t,i)),YM(u,n,!1),t&&u.patches_&&wD("Patches").generatePatches_(a,t,u.patches_,u.inversePatches_)}return a.copy_}function QDe(u,e,t,a,n,r,i){if(f2(n)){const o=r&&e&&e.type_!==3&&!QQ(e.assigned_,a)?r.concat(a):void 0,s=QM(u,n,o);if(sJe(t,a,s),f2(s))u.canAutoFreeze_=!1;else return}else i&&t.add(n);if(SD(n)&&!NL(n)){if(!u.immer_.autoFreeze_&&u.unfinalizedDrafts_<1)return;QM(u,n),(!e||!e.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(t,a)&&YM(u,n)}}function YM(u,e,t=!1){!u.parent_&&u.immer_.autoFreeze_&&u.canAutoFreeze_&&S7(e,t)}function gia(u,e){const t=Array.isArray(u),a={type_:t?1:0,scope_:e?e.scope_:lJe(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:u,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=a,r=mie;t&&(n=[a],r=O7);const{revoke:i,proxy:o}=Proxy.revocable(n,r);return a.draft_=o,a.revoke_=i,o}var mie={get(u,e){if(e===Kl)return u;const t=vp(u);if(!QQ(t,e))return via(u,t,e);const a=t[e];return u.finalized_||!SD(a)?a:a===DV(u.base_,e)?(xV(u),u.copy_[e]=tY(a,u)):a},has(u,e){return e in vp(u)},ownKeys(u){return Reflect.ownKeys(vp(u))},set(u,e,t){const a=cJe(vp(u),e);if(a!=null&&a.set)return a.set.call(u.draft_,t),!0;if(!u.modified_){const n=DV(vp(u),e),r=n==null?void 0:n[Kl];if(r&&r.base_===t)return u.copy_[e]=t,u.assigned_[e]=!1,!0;if(fia(t,n)&&(t!==void 0||QQ(u.base_,e)))return!0;xV(u),uY(u)}return u.copy_[e]===t&&(t!==void 0||e in u.copy_)||Number.isNaN(t)&&Number.isNaN(u.copy_[e])||(u.copy_[e]=t,u.assigned_[e]=!0),!0},deleteProperty(u,e){return DV(u.base_,e)!==void 0||e in u.base_?(u.assigned_[e]=!1,xV(u),uY(u)):delete u.assigned_[e],u.copy_&&delete u.copy_[e],!0},getOwnPropertyDescriptor(u,e){const t=vp(u),a=Reflect.getOwnPropertyDescriptor(t,e);return a&&{writable:!0,configurable:u.type_!==1||e!=="length",enumerable:a.enumerable,value:t[e]}},defineProperty(){M1(11)},getPrototypeOf(u){return h2(u.base_)},setPrototypeOf(){M1(12)}},O7={};ZM(mie,(u,e)=>{O7[u]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});O7.deleteProperty=function(u,e){return O7.set.call(this,u,e,void 0)};O7.set=function(u,e,t){return mie.set.call(this,u[0],e,t,u[0])};function DV(u,e){const t=u[Kl];return(t?vp(t):u)[e]}function via(u,e,t){var n;const a=cJe(e,t);return a?"value"in a?a.value:(n=a.get)==null?void 0:n.call(u.draft_):void 0}function cJe(u,e){if(!(e in u))return;let t=h2(u);for(;t;){const a=Object.getOwnPropertyDescriptor(t,e);if(a)return a;t=h2(t)}}function uY(u){u.modified_||(u.modified_=!0,u.parent_&&uY(u.parent_))}function xV(u){u.copy_||(u.copy_=YQ(u.base_,u.scope_.immer_.useStrictShallowCopy_))}var Cia=class{constructor(u){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,a)=>{if(typeof e=="function"&&typeof t!="function"){const r=t;t=e;const i=this;return function(s=r,...l){return i.produce(s,c=>t.call(this,c,...l))}}typeof t!="function"&&M1(6),a!==void 0&&typeof a!="function"&&M1(7);let n;if(SD(e)){const r=qDe(this),i=tY(e,void 0);let o=!0;try{n=t(i),o=!1}finally{o?XQ(r):eY(r)}return JDe(r,a),ZDe(n,r)}else if(!e||typeof e!="object"){if(n=t(e),n===void 0&&(n=e),n===iJe&&(n=void 0),this.autoFreeze_&&S7(n,!0),a){const r=[],i=[];wD("Patches").generateReplacementPatches_(e,n,r,i),a(r,i)}return n}else M1(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e=="function")return(i,...o)=>this.produceWithPatches(i,s=>e(s,...o));let a,n;return[this.produce(e,t,(i,o)=>{a=i,n=o}),a,n]},typeof(u==null?void 0:u.autoFreeze)=="boolean"&&this.setAutoFreeze(u.autoFreeze),typeof(u==null?void 0:u.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(u.useStrictShallowCopy)}createDraft(u){SD(u)||M1(8),f2(u)&&(u=yia(u));const e=qDe(this),t=tY(u,void 0);return t[Kl].isManual_=!0,eY(e),t}finishDraft(u,e){const t=u&&u[Kl];(!t||!t.isManual_)&&M1(9);const{scope_:a}=t;return JDe(a,e),ZDe(void 0,a)}setAutoFreeze(u){this.autoFreeze_=u}setUseStrictShallowCopy(u){this.useStrictShallowCopy_=u}applyPatches(u,e){let t;for(t=e.length-1;t>=0;t--){const n=e[t];if(n.path.length===0&&n.op==="replace"){u=n.value;break}}t>-1&&(e=e.slice(t+1));const a=wD("Patches").applyPatches_;return f2(u)?a(u,e):this.produce(u,n=>a(n,e))}};function tY(u,e){const t=PL(u)?wD("MapSet").proxyMap_(u,e):jL(u)?wD("MapSet").proxySet_(u,e):gia(u,e);return(e?e.scope_:lJe()).drafts_.push(t),t}function yia(u){return f2(u)||M1(10,u),dJe(u)}function dJe(u){if(!SD(u)||NL(u))return u;const e=u[Kl];let t;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,t=YQ(u,e.scope_.immer_.useStrictShallowCopy_)}else t=YQ(u,!0);return ZM(t,(a,n)=>{sJe(t,a,dJe(n))}),e&&(e.finalized_=!1),t}var Hl=new Cia,EJe=Hl.produce;Hl.produceWithPatches.bind(Hl);Hl.setAutoFreeze.bind(Hl);Hl.setUseStrictShallowCopy.bind(Hl);Hl.applyPatches.bind(Hl);Hl.createDraft.bind(Hl);Hl.finishDraft.bind(Hl);const Rd=Object.create(null);Rd.open="0";Rd.close="1";Rd.ping="2";Rd.pong="3";Rd.message="4";Rd.upgrade="5";Rd.noop="6";const Oz=Object.create(null);Object.keys(Rd).forEach(u=>{Oz[Rd[u]]=u});const aY={type:"error",data:"parser error"},hJe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",fJe=typeof ArrayBuffer=="function",mJe=u=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u&&u.buffer instanceof ArrayBuffer,pie=({type:u,data:e},t,a)=>hJe&&e instanceof Blob?t?a(e):YDe(e,a):fJe&&(e instanceof ArrayBuffer||mJe(e))?t?a(e):YDe(new Blob([e]),a):a(Rd[u]+(e||"")),YDe=(u,e)=>{const t=new FileReader;return t.onload=function(){const a=t.result.split(",")[1];e("b"+(a||""))},t.readAsDataURL(u)};function XDe(u){return u instanceof Uint8Array?u:u instanceof ArrayBuffer?new Uint8Array(u):new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}let gV;function bia(u,e){if(hJe&&u.data instanceof Blob)return u.data.arrayBuffer().then(XDe).then(e);if(fJe&&(u.data instanceof ArrayBuffer||mJe(u.data)))return e(XDe(u.data));pie(u,!1,t=>{gV||(gV=new TextEncoder),e(gV.encode(t))})}const exe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hk=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let u=0;u<exe.length;u++)hk[exe.charCodeAt(u)]=u;const kia=u=>{let e=u.length*.75,t=u.length,a,n=0,r,i,o,s;u[u.length-1]==="="&&(e--,u[u.length-2]==="="&&e--);const l=new ArrayBuffer(e),c=new Uint8Array(l);for(a=0;a<t;a+=4)r=hk[u.charCodeAt(a)],i=hk[u.charCodeAt(a+1)],o=hk[u.charCodeAt(a+2)],s=hk[u.charCodeAt(a+3)],c[n++]=r<<2|i>>4,c[n++]=(i&15)<<4|o>>2,c[n++]=(o&3)<<6|s&63;return l},Fia=typeof ArrayBuffer=="function",Die=(u,e)=>{if(typeof u!="string")return{type:"message",data:pJe(u,e)};const t=u.charAt(0);return t==="b"?{type:"message",data:Aia(u.substring(1),e)}:Oz[t]?u.length>1?{type:Oz[t],data:u.substring(1)}:{type:Oz[t]}:aY},Aia=(u,e)=>{if(Fia){const t=kia(u);return pJe(t,e)}else return{base64:!0,data:u}},pJe=(u,e)=>{switch(e){case"blob":return u instanceof Blob?u:new Blob([u]);case"arraybuffer":default:return u instanceof ArrayBuffer?u:u.buffer}},DJe="",Bia=(u,e)=>{const t=u.length,a=new Array(t);let n=0;u.forEach((r,i)=>{pie(r,!1,o=>{a[i]=o,++n===t&&e(a.join(DJe))})})},Sia=(u,e)=>{const t=u.split(DJe),a=[];for(let n=0;n<t.length;n++){const r=Die(t[n],e);if(a.push(r),r.type==="error")break}return a};function wia(){return new TransformStream({transform(u,e){bia(u,t=>{const a=t.length;let n;if(a<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,a);else if(a<65536){n=new Uint8Array(3);const r=new DataView(n.buffer);r.setUint8(0,126),r.setUint16(1,a)}else{n=new Uint8Array(9);const r=new DataView(n.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(a))}u.data&&typeof u.data!="string"&&(n[0]|=128),e.enqueue(n),e.enqueue(t)})}})}let vV;function Gw(u){return u.reduce((e,t)=>e+t.length,0)}function Uw(u,e){if(u[0].length===e)return u.shift();const t=new Uint8Array(e);let a=0;for(let n=0;n<e;n++)t[n]=u[0][a++],a===u[0].length&&(u.shift(),a=0);return u.length&&a<u[0].length&&(u[0]=u[0].slice(a)),t}function Oia(u,e){vV||(vV=new TextDecoder);const t=[];let a=0,n=-1,r=!1;return new TransformStream({transform(i,o){for(t.push(i);;){if(a===0){if(Gw(t)<1)break;const s=Uw(t,1);r=(s[0]&128)===128,n=s[0]&127,n<126?a=3:n===126?a=1:a=2}else if(a===1){if(Gw(t)<2)break;const s=Uw(t,2);n=new DataView(s.buffer,s.byteOffset,s.length).getUint16(0),a=3}else if(a===2){if(Gw(t)<8)break;const s=Uw(t,8),l=new DataView(s.buffer,s.byteOffset,s.length),c=l.getUint32(0);if(c>Math.pow(2,21)-1){o.enqueue(aY);break}n=c*Math.pow(2,32)+l.getUint32(4),a=3}else{if(Gw(t)<n)break;const s=Uw(t,n);o.enqueue(Die(r?s:vV.decode(s),e)),a=0}if(n===0||n>u){o.enqueue(aY);break}}}})}const xJe=4;function E0(u){if(u)return zia(u)}function zia(u){for(var e in E0.prototype)u[e]=E0.prototype[e];return u}E0.prototype.on=E0.prototype.addEventListener=function(u,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+u]=this._callbacks["$"+u]||[]).push(e),this};E0.prototype.once=function(u,e){function t(){this.off(u,t),e.apply(this,arguments)}return t.fn=e,this.on(u,t),this};E0.prototype.off=E0.prototype.removeListener=E0.prototype.removeAllListeners=E0.prototype.removeEventListener=function(u,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+u];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+u],this;for(var a,n=0;n<t.length;n++)if(a=t[n],a===e||a.fn===e){t.splice(n,1);break}return t.length===0&&delete this._callbacks["$"+u],this};E0.prototype.emit=function(u){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+u],a=1;a<arguments.length;a++)e[a-1]=arguments[a];if(t){t=t.slice(0);for(var a=0,n=t.length;a<n;++a)t[a].apply(this,e)}return this};E0.prototype.emitReserved=E0.prototype.emit;E0.prototype.listeners=function(u){return this._callbacks=this._callbacks||{},this._callbacks["$"+u]||[]};E0.prototype.hasListeners=function(u){return!!this.listeners(u).length};const RL=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),pc=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_ia="arraybuffer";function gJe(u,...e){return e.reduce((t,a)=>(u.hasOwnProperty(a)&&(t[a]=u[a]),t),{})}const Tia=pc.setTimeout,Mia=pc.clearTimeout;function LL(u,e){e.useNativeTimers?(u.setTimeoutFn=Tia.bind(pc),u.clearTimeoutFn=Mia.bind(pc)):(u.setTimeoutFn=pc.setTimeout.bind(pc),u.clearTimeoutFn=pc.clearTimeout.bind(pc))}const Pia=1.33;function jia(u){return typeof u=="string"?Nia(u):Math.ceil((u.byteLength||u.size)*Pia)}function Nia(u){let e=0,t=0;for(let a=0,n=u.length;a<n;a++)e=u.charCodeAt(a),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(a++,t+=4);return t}function vJe(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ria(u){let e="";for(let t in u)u.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(u[t]));return e}function Lia(u){let e={},t=u.split("&");for(let a=0,n=t.length;a<n;a++){let r=t[a].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class $ia extends Error{constructor(e,t,a){super(e),this.description=t,this.context=a,this.type="TransportError"}}class xie extends E0{constructor(e){super(),this.writable=!1,LL(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,a){return super.emitReserved("error",new $ia(e,t,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Die(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Ria(e);return t.length?"?"+t:""}}class Iia extends xie{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||t()})),this.writable||(a++,this.once("drain",function(){--a||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};Sia(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Bia(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=vJe()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let CJe=!1;try{CJe=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Kia=CJe;function Hia(){}class Via extends Iia{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let a=location.port;a||(a=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||a!==e.port}}doWrite(e,t){const a=this.request({method:"POST",data:e});a.on("success",t),a.on("error",(n,r)=>{this.onError("xhr post error",n,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,a)=>{this.onError("xhr poll error",t,a)}),this.pollXhr=e}}let K6=class zz extends E0{constructor(e,t,a){super(),this.createRequest=e,LL(this,a),this._opts=a,this._method=a.method||"GET",this._uri=t,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var e;const t=gJe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(t);try{a.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&a.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(a),"withCredentials"in a&&(a.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(a.timeout=this._opts.requestTimeout),a.onreadystatechange=()=>{var n;a.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(a.getResponseHeader("set-cookie"))),a.readyState===4&&(a.status===200||a.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof a.status=="number"?a.status:0)},0))},a.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=zz.requestsCount++,zz.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Hia,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete zz.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};K6.requestsCount=0;K6.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",uxe);else if(typeof addEventListener=="function"){const u="onpagehide"in pc?"pagehide":"unload";addEventListener(u,uxe,!1)}}function uxe(){for(let u in K6.requests)K6.requests.hasOwnProperty(u)&&K6.requests[u].abort()}const Gia=function(){const u=yJe({xdomain:!1});return u&&u.responseType!==null}();class Uia extends Via{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Gia&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K6(yJe,this.uri(),e)}}function yJe(u){const e=u.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Kia))return new XMLHttpRequest}catch{}if(!e)try{return new pc[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const bJe=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Wia extends xie{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,a=bJe?{}:gJe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,a)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const a=e[t],n=t===e.length-1;pie(a,this.supportsBinary,r=>{try{this.doWrite(a,r)}catch{}n&&RL(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=vJe()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const CV=pc.WebSocket||pc.MozWebSocket;class Jia extends Wia{createSocket(e,t,a){return bJe?new CV(e,t,a):t?new CV(e,t):new CV(e)}doWrite(e,t){this.ws.send(t)}}class qia extends xie{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Oia(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=e.readable.pipeThrough(t).getReader(),n=wia();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();const r=()=>{a.read().then(({done:o,value:s})=>{o||(this.onPacket(s),r())}).catch(o=>{})};r();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const a=e[t],n=t===e.length-1;this._writer.write(a).then(()=>{n&&RL(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Zia={websocket:Jia,webtransport:qia,polling:Uia},Qia=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Yia=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function nY(u){if(u.length>8e3)throw"URI too long";const e=u,t=u.indexOf("["),a=u.indexOf("]");t!=-1&&a!=-1&&(u=u.substring(0,t)+u.substring(t,a).replace(/:/g,";")+u.substring(a,u.length));let n=Qia.exec(u||""),r={},i=14;for(;i--;)r[Yia[i]]=n[i]||"";return t!=-1&&a!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=Xia(r,r.path),r.queryKey=eoa(r,r.query),r}function Xia(u,e){const t=/\/{2,9}/g,a=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&a.splice(0,1),e.slice(-1)=="/"&&a.splice(a.length-1,1),a}function eoa(u,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,n,r){n&&(t[n]=r)}),t}const rY=typeof addEventListener=="function"&&typeof removeEventListener=="function",_z=[];rY&&addEventListener("offline",()=>{_z.forEach(u=>u())},!1);class zf extends E0{constructor(e,t){if(super(),this.binaryType=_ia,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const a=nY(e);t.hostname=a.host,t.secure=a.protocol==="https"||a.protocol==="wss",t.port=a.port,a.query&&(t.query=a.query)}else t.host&&(t.hostname=nY(t.host).host);LL(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(a=>{const n=a.prototype.name;this.transports.push(n),this._transportsByName[n]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Lia(this.opts.query)),rY&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},_z.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=xJe,t.transport=e,this.id&&(t.sid=this.id);const a=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](a)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&zf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",zf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let a=0;a<this.writeBuffer.length;a++){const n=this.writeBuffer[a].data;if(n&&(t+=jia(n)),a>0&&t>this._maxPayload)return this.writeBuffer.slice(0,a);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,RL(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,a){return this._sendPacket("message",e,t,a),this}send(e,t,a){return this._sendPacket("message",e,t,a),this}_sendPacket(e,t,a,n){if(typeof t=="function"&&(n=t,t=void 0),typeof a=="function"&&(n=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const r={type:e,data:t,options:a};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),n&&this.once("flush",n),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},a=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():e()}):this.upgrading?a():e()),this}_onError(e){if(zf.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),rY&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=_z.indexOf(this._offlineEventListener);a!==-1&&_z.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}zf.protocol=xJe;class uoa extends zf{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),a=!1;zf.priorWebsocketSuccess=!1;const n=()=>{a||(t.send([{type:"ping",data:"probe"}]),t.once("packet",d=>{if(!a)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;zf.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const E=new Error("probe error");E.transport=t.name,this.emitReserved("upgradeError",E)}}))};function r(){a||(a=!0,c(),t.close(),t=null)}const i=d=>{const E=new Error("probe error: "+d);E.transport=t.name,r(),this.emitReserved("upgradeError",E)};function o(){i("transport closed")}function s(){i("socket closed")}function l(d){t&&d.name!==t.name&&r()}const c=()=>{t.removeListener("open",n),t.removeListener("error",i),t.removeListener("close",o),this.off("close",s),this.off("upgrading",l)};t.once("open",n),t.once("error",i),t.once("close",o),this.once("close",s),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{a||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let a=0;a<e.length;a++)~this.transports.indexOf(e[a])&&t.push(e[a]);return t}}let toa=class extends uoa{constructor(e,t={}){const a=typeof e=="object"?e:t;(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(n=>Zia[n]).filter(n=>!!n)),super(e,a)}};function aoa(u,e="",t){let a=u;t=t||typeof location<"u"&&location,u==null&&(u=t.protocol+"//"+t.host),typeof u=="string"&&(u.charAt(0)==="/"&&(u.charAt(1)==="/"?u=t.protocol+u:u=t.host+u),/^(https?|wss?):\/\//.test(u)||(typeof t<"u"?u=t.protocol+"//"+u:u="https://"+u),a=nY(u)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const r=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+r+":"+a.port+e,a.href=a.protocol+"://"+r+(t&&t.port===a.port?"":":"+a.port),a}const noa=typeof ArrayBuffer=="function",roa=u=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u.buffer instanceof ArrayBuffer,kJe=Object.prototype.toString,ioa=typeof Blob=="function"||typeof Blob<"u"&&kJe.call(Blob)==="[object BlobConstructor]",ooa=typeof File=="function"||typeof File<"u"&&kJe.call(File)==="[object FileConstructor]";function gie(u){return noa&&(u instanceof ArrayBuffer||roa(u))||ioa&&u instanceof Blob||ooa&&u instanceof File}function Tz(u,e){if(!u||typeof u!="object")return!1;if(Array.isArray(u)){for(let t=0,a=u.length;t<a;t++)if(Tz(u[t]))return!0;return!1}if(gie(u))return!0;if(u.toJSON&&typeof u.toJSON=="function"&&arguments.length===1)return Tz(u.toJSON(),!0);for(const t in u)if(Object.prototype.hasOwnProperty.call(u,t)&&Tz(u[t]))return!0;return!1}function soa(u){const e=[],t=u.data,a=u;return a.data=iY(t,e),a.attachments=e.length,{packet:a,buffers:e}}function iY(u,e){if(!u)return u;if(gie(u)){const t={_placeholder:!0,num:e.length};return e.push(u),t}else if(Array.isArray(u)){const t=new Array(u.length);for(let a=0;a<u.length;a++)t[a]=iY(u[a],e);return t}else if(typeof u=="object"&&!(u instanceof Date)){const t={};for(const a in u)Object.prototype.hasOwnProperty.call(u,a)&&(t[a]=iY(u[a],e));return t}return u}function loa(u,e){return u.data=oY(u.data,e),delete u.attachments,u}function oY(u,e){if(!u)return u;if(u&&u._placeholder===!0){if(typeof u.num=="number"&&u.num>=0&&u.num<e.length)return e[u.num];throw new Error("illegal attachments")}else if(Array.isArray(u))for(let t=0;t<u.length;t++)u[t]=oY(u[t],e);else if(typeof u=="object")for(const t in u)Object.prototype.hasOwnProperty.call(u,t)&&(u[t]=oY(u[t],e));return u}const coa=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],doa=5;var Ta;(function(u){u[u.CONNECT=0]="CONNECT",u[u.DISCONNECT=1]="DISCONNECT",u[u.EVENT=2]="EVENT",u[u.ACK=3]="ACK",u[u.CONNECT_ERROR=4]="CONNECT_ERROR",u[u.BINARY_EVENT=5]="BINARY_EVENT",u[u.BINARY_ACK=6]="BINARY_ACK"})(Ta||(Ta={}));class Eoa{constructor(e){this.replacer=e}encode(e){return(e.type===Ta.EVENT||e.type===Ta.ACK)&&Tz(e)?this.encodeAsBinary({type:e.type===Ta.EVENT?Ta.BINARY_EVENT:Ta.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===Ta.BINARY_EVENT||e.type===Ta.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=soa(e),a=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(a),n}}function txe(u){return Object.prototype.toString.call(u)==="[object Object]"}class vie extends E0{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const a=t.type===Ta.BINARY_EVENT;a||t.type===Ta.BINARY_ACK?(t.type=a?Ta.EVENT:Ta.ACK,this.reconstructor=new hoa(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(gie(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const a={type:Number(e.charAt(0))};if(Ta[a.type]===void 0)throw new Error("unknown packet type "+a.type);if(a.type===Ta.BINARY_EVENT||a.type===Ta.BINARY_ACK){const r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const i=e.substring(r,t);if(i!=Number(i)||e.charAt(t)!=="-")throw new Error("Illegal attachments");a.attachments=Number(i)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););a.nsp=e.substring(r,t)}else a.nsp="/";const n=e.charAt(t+1);if(n!==""&&Number(n)==n){const r=t+1;for(;++t;){const i=e.charAt(t);if(i==null||Number(i)!=i){--t;break}if(t===e.length)break}a.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(vie.isPayloadValid(a.type,r))a.data=r;else throw new Error("invalid payload")}return a}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Ta.CONNECT:return txe(t);case Ta.DISCONNECT:return t===void 0;case Ta.CONNECT_ERROR:return typeof t=="string"||txe(t);case Ta.EVENT:case Ta.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&coa.indexOf(t[0])===-1);case Ta.ACK:case Ta.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class hoa{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=loa(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const foa=Object.freeze(Object.defineProperty({__proto__:null,Decoder:vie,Encoder:Eoa,get PacketType(){return Ta},protocol:doa},Symbol.toStringTag,{value:"Module"}));function b1(u,e,t){return u.on(e,t),function(){u.off(e,t)}}const moa=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class FJe extends E0{constructor(e,t,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[b1(e,"open",this.onopen.bind(this)),b1(e,"packet",this.onpacket.bind(this)),b1(e,"error",this.onerror.bind(this)),b1(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var a,n,r;if(moa.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const i={type:Ta.EVENT,data:t};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const c=this.ids++,d=t.pop();this._registerAckCallback(c,d),i.id=c}const o=(n=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||n===void 0?void 0:n.writable,s=this.connected&&!(!((r=this.io.engine)===null||r===void 0)&&r._hasPingExpired());return this.flags.volatile&&!o||(s?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){var a;const n=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},n),i=(...o)=>{this.io.clearTimeoutFn(r),t.apply(this,o)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((a,n)=>{const r=(i,o)=>i?n(i):a(o);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...r)=>a!==this._queue[0]?void 0:(n!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(n)):(this._queue.shift(),t&&t(null,...r)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Ta.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(a=>String(a.id)===e)){const a=this.acks[e];delete this.acks[e],a.withError&&a.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Ta.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ta.EVENT:case Ta.BINARY_EVENT:this.onevent(e);break;case Ta.ACK:case Ta.BINARY_ACK:this.onack(e);break;case Ta.DISCONNECT:this.ondisconnect();break;case Ta.CONNECT_ERROR:this.destroy();const a=new Error(e.data.message);a.data=e.data.data,this.emitReserved("connect_error",a);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const a of t)a.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let a=!1;return function(...n){a||(a=!0,t.packet({type:Ta.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ta.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let a=0;a<t.length;a++)if(e===t[a])return t.splice(a,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let a=0;a<t.length;a++)if(e===t[a])return t.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const a of t)a.apply(this,e.data)}}}function WC(u){u=u||{},this.ms=u.min||100,this.max=u.max||1e4,this.factor=u.factor||2,this.jitter=u.jitter>0&&u.jitter<=1?u.jitter:0,this.attempts=0}WC.prototype.duration=function(){var u=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*u);u=Math.floor(e*10)&1?u+t:u-t}return Math.min(u,this.max)|0};WC.prototype.reset=function(){this.attempts=0};WC.prototype.setMin=function(u){this.ms=u};WC.prototype.setMax=function(u){this.max=u};WC.prototype.setJitter=function(u){this.jitter=u};class sY extends E0{constructor(e,t){var a;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,LL(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((a=t.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new WC({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||foa;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new toa(this.uri,this.opts);const t=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const n=b1(t,"open",function(){a.onopen(),e&&e()}),r=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),e?e(o):this.maybeReconnectOnOpen()},i=b1(t,"error",r);if(this._timeout!==!1){const o=this._timeout,s=this.setTimeoutFn(()=>{n(),r(new Error("timeout")),t.close()},o);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}return this.subs.push(n),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(b1(e,"ping",this.onping.bind(this)),b1(e,"data",this.ondata.bind(this)),b1(e,"error",this.onerror.bind(this)),b1(e,"close",this.onclose.bind(this)),b1(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){RL(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let a=this.nsps[e];return a?this._autoConnect&&!a.active&&a.connect():(a=new FJe(this,e,t),this.nsps[e]=a),a}_destroy(e){const t=Object.keys(this.nsps);for(const a of t)if(this.nsps[a].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let a=0;a<t.length;a++)this.engine.write(t[a],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const a=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):e.onreconnect()}))},t);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const xb={};function Mz(u,e){typeof u=="object"&&(e=u,u=void 0),e=e||{};const t=aoa(u,e.path||"/socket.io"),a=t.source,n=t.id,r=t.path,i=xb[n]&&r in xb[n].nsps,o=e.forceNew||e["force new connection"]||e.multiplex===!1||i;let s;return o?s=new sY(a,e):(xb[n]||(xb[n]=new sY(a,e)),s=xb[n]),t.query&&!e.query&&(e.query=t.queryKey),s.socket(t.path,e)}Object.assign(Mz,{Manager:sY,Socket:FJe,io:Mz,connect:Mz});function sc(u){var e=k.useState(function(){return S7(typeof u=="function"?u():u,!0)}),t=e[1];return[e[0],k.useCallback(function(a){t(typeof a=="function"?EJe(a):S7(a))},[])]}var poa="Expected a function",axe=NaN,Doa="[object Symbol]",xoa=/^\s+|\s+$/g,goa=/^[-+]0x[0-9a-f]+$/i,voa=/^0b[01]+$/i,Coa=/^0o[0-7]+$/i,yoa=parseInt,boa=typeof Ne=="object"&&Ne&&Ne.Object===Object&&Ne,koa=typeof self=="object"&&self&&self.Object===Object&&self,Foa=boa||koa||Function("return this")(),Aoa=Object.prototype,Boa=Aoa.toString,Soa=Math.max,woa=Math.min,yV=function(){return Foa.Date.now()};function Ooa(u,e,t){var a,n,r,i,o,s,l=0,c=!1,d=!1,E=!0;if(typeof u!="function")throw new TypeError(poa);e=nxe(e)||0,lY(t)&&(c=!!t.leading,d="maxWait"in t,r=d?Soa(nxe(t.maxWait)||0,e):r,E="trailing"in t?!!t.trailing:E);function h(b){var F=a,O=n;return a=n=void 0,l=b,i=u.apply(O,F),i}function f(b){return l=b,o=setTimeout(x,e),c?h(b):i}function m(b){var F=b-s,O=b-l,T=e-F;return d?woa(T,r-O):T}function p(b){var F=b-s,O=b-l;return s===void 0||F>=e||F<0||d&&O>=r}function x(){var b=yV();if(p(b))return g(b);o=setTimeout(x,m(b))}function g(b){return o=void 0,E&&a?h(b):(a=n=void 0,i)}function v(){o!==void 0&&clearTimeout(o),l=0,a=s=n=o=void 0}function C(){return o===void 0?i:g(yV())}function y(){var b=yV(),F=p(b);if(a=arguments,n=this,s=b,F){if(o===void 0)return f(s);if(d)return o=setTimeout(x,e),h(s)}return o===void 0&&(o=setTimeout(x,e)),i}return y.cancel=v,y.flush=C,y}function lY(u){var e=typeof u;return!!u&&(e=="object"||e=="function")}function zoa(u){return!!u&&typeof u=="object"}function _oa(u){return typeof u=="symbol"||zoa(u)&&Boa.call(u)==Doa}function nxe(u){if(typeof u=="number")return u;if(_oa(u))return axe;if(lY(u)){var e=typeof u.valueOf=="function"?u.valueOf():u;u=lY(e)?e+"":e}if(typeof u!="string")return u===0?u:+u;u=u.replace(xoa,"");var t=voa.test(u);return t||Coa.test(u)?yoa(u.slice(2),t?2:8):goa.test(u)?axe:+u}var Toa=Ooa;const rxe=ea(Toa);function Moa(u){const e=k.useRef(u);e.current=u,k.useEffect(()=>()=>{e.current()},[])}function Poa(u,e=500,t){const a=k.useRef();Moa(()=>{a.current&&a.current.cancel()});const n=k.useMemo(()=>{const r=rxe(u,e,t),i=(...o)=>r(...o);return i.cancel=()=>{r.cancel()},i.isPending=()=>!!a.current,i.flush=()=>r.flush(),i},[u,e,t]);return k.useEffect(()=>{a.current=rxe(u,e,t)},[u,e,t]),n}function joa(u,e,t){const a=(t==null?void 0:t.equalityFn)??((l,c)=>l===c),n=u instanceof Function?u():u,[r,i]=k.useState(n),o=k.useRef(n),s=Poa(i,e,t);return a(o.current,n)||(s(n),o.current=n),[r,s]}const Noa=2e3,AJe=(u,e)=>{const t=(e==null?void 0:e.find(n=>n.default))??(e==null?void 0:e[0]);return u.find(n=>n.name===(t==null?void 0:t.name))},Roa=(u,e)=>{const t=AJe(u,e),a=((t==null?void 0:t.variables)??{})[SA];return typeof a=="string"?a:"about:blank"},Loa=({websocketUrl:u,test:e,environments:t,platform:a,logger:n})=>{var Ule;const[r,i]=k.useState(),[o,s]=k.useState(""),[l,c]=sc([]),[d,E]=sc({}),[h,f]=sc({}),[m,p]=sc(void 0),[x,g]=sc(!1),[v,C]=sc(void 0),[y,b]=sc(!1),[F,O]=sc(!1),[T,P]=k.useState(""),z=k.useRef([]),A=k.useRef(0),[S,w]=k.useState([]),[_,j]=k.useState(),K=k.useMemo(()=>AJe(t,e.envs),[t,e.envs]),M=k.useMemo(()=>e.baseUrl||Roa(t,e.envs),[e.baseUrl,t,e.envs]),L=((Ule=e.advanced)==null?void 0:Ule.viewport)??owe,[G,V]=k.useState(void 0),[R,I]=k.useState(!1),[U,W]=k.useState(M),[$,q]=k.useState([]),[Q,ue]=k.useState(!1),[ae,le]=k.useState(!1),[Z,Ee]=k.useState(!1),[fe,ve]=k.useState(!1),[X,ye]=k.useState(!1),[Ue,Te]=k.useState(!1),[J,Y]=k.useState(),re=k.useRef(Ue);re.current=Ue;const ee=(!Ue||ae)&&!Z&&Q,ne=!Ue&&!Z&&!ae&&!fe&&Q,oe=!Ue&&!Z&&!ae&&!fe&&Q,Oe=!Ue&&!Z&&!ae&&!fe&&Q,[$e,Xe]=k.useState(""),qe=k.useRef(Date.now()),au=k.useRef(0),eu=()=>{qe.current=Date.now()},[fu,st]=k.useState(!1),Kt=k.useRef(),Za=k.useRef(0),Ju=k.useRef({testId:e.id}),wa=Ju.current,[lr,j0]=k.useState(FE.Main),[Ha,N0]=sc(()=>N4(e.beforeSteps??[])),[ko,pe]=sc(()=>N4(e.steps??[])),[de,we]=sc(()=>N4(e.afterSteps??[])),We=k.useMemo(()=>lr===FE.Setup?Ha:lr===FE.Main?ko:de,[lr,Ha,ko,de]),Ze=lr===FE.Setup?N0:lr===FE.Main?pe:we,nt=k.useRef(We);nt.current=We;const Uu=k.useMemo(()=>mE(We),[We]),Re=k.useMemo(()=>({steps:mE(ko),beforeSteps:mE(Ha),afterSteps:mE(de)}),[ko,Ha,de]),[Nu,iu]=joa(Re,Noa);k.useEffect(()=>{iu(Re)},[iu,Re]);const[ka,Su]=k.useState(Re),Ru=k.useMemo(()=>{const se=nF(ka,Re);return Object.keys(se).length>0},[ka,Re]),ua=k.useMemo(()=>{try{bK(Re.beforeSteps??[]),bK(Re.steps),bK(Re.afterSteps??[])}catch(se){if(se instanceof Error)return{valid:!1,message:se.message}}return{valid:!0}},[Re]),Nt=k.useRef(),Le=Nt.current,R0=k.useRef(),sn=ia(({stepId:se,parentStepIdChain:me})=>{eu(),Ze(Ce=>{Zx(Ce);const _e=Gi(Ce,se,me);if(_e){if(_e.step.type===Fe.AI_ACTION){const He=_e.children.map(nu=>nu.step.type===Fe.PRESET_ACTION?nu.step.command:null).filter(nu=>!!nu);(!(He!=null&&He.length)||He[He.length-1].type!==H.SUCCESS)&&(_e.message="Generating command..."),_e.aiActionLogs=[]}else _e.step.type===Fe.AI_ACTION_DYNAMIC&&(_e.children=[],_e.aiActionLogs=[]);_e.status=sa.RUNNING}})}),Fo=ia(se=>{const me=se.numIcons===1?"A new icon":`${se.numIcons} new icons`,Ce=se.numIcons===1?"has":"have",_e=se.numIcons===1?"it":"them";nn.info(`${me} that Momentic does not recognize ${Ce} been detected on this page. Head over to the Knowledge Base to label ${_e} and improve our AI's ability to recognize ${_e} in future interactions.`)}),Ds=ia(({status:se,parentStepId:me,message:Ce})=>{Ze(_e=>{Zx(_e);const He=Gi(_e,me,[]);He&&He.step.type===Fe.AI_ACTION_DYNAMIC&&(He.expanded||(He.expanded=!0),He.aiActionLatestMessage={status:se??sa.RUNNING,message:Ce})})}),ci=ia(({tabs:se,activeTab:me})=>{w(se);const Ce=Array.from(z.current.map(nu=>nu.url)),_e=Array.from(se.map(nu=>nu.url)),He=_e.find(nu=>!Ce.includes(nu));Ce.length>0&&_e.length>Ce.length&&He&&setTimeout(()=>{Date.now()-A.current<1e4||MLt(He,me)&&(nn.info("Momentic detected that a new tab was opened. To switch to it, add a Switch Tab step. Using the tab switcher in the browser preview does not affect future test executions.",{duration:5e3}),A.current=Date.now())},2500),z.current=se,j(me)}),C4=ia(({stepId:se,message:me,status:Ce})=>{Ze(_e=>{const He=Gi(_e,se,[]);He&&(He.aiActionLogs?He.aiActionLogs.push({log:me,status:Ce}):He.aiActionLogs=[{log:me,status:Ce}])})}),o1=ia(async()=>{n.info("Churn imminent event received",wa),st(!0),nn.warning("Momentic just pushed a new application update! Please save and refresh the page to connect to an updated server. Your current session will be automatically disconnected after 30 minutes.",{duration:5*6e4}),await new Promise(me=>setTimeout(me,3e5));const se=setInterval(()=>{!Ue&&qe.current<Date.now()-15e3&&(b4(),clearInterval(se))},5e3)}),y4=ia(({parentStepId:se,step:me})=>{Ze(Ce=>{Zx(Ce);const _e=Gi(Ce,se,[]);if(!_e||_e.step.type!==Fe.AI_ACTION_DYNAMIC)return;_e.expanded||(_e.expanded=!0),_e.aiActionLatestMessage=void 0;const He=ys(me);He.readonly=!0,He.status=sa.IDLE,He.message=me.command.thoughts,_e.children.push(He)})}),Se=ia(({parentStepId:se,step:me})=>{Ze(Ce=>{Zx(Ce);const _e=Gi(Ce,se,[]);if(!_e||_e.step.type!==Fe.AI_ACTION_DYNAMIC)return;_e.aiActionLatestMessage=void 0;const He=Gi(Ce,me.id,[]);He&&(He.status=sa.RUNNING)})}),be=ia(({parentStepId:se})=>{Ze(me=>{Zx(me);const Ce=Gi(me,se,[]);Ce&&(Ce.message="Generated command...")})}),je=ia(se=>{Ze(me=>{var He,nu;const Ce=Gi(me,se.stepId,se.parentStepIdChain);if(!Ce)return;switch(se.type){case"listenersInitialized":Ce.targetRecordingState={msg:"Click an element using the interactive editor to generate a description. The description will populate a few seconds after the click.",phase:z1.WAITING_FOR_CLICK};break;case"error":Ce.targetRecordingState={phase:z1.ERROR,err:se.err};break;case"clickReceived":Ce.targetRecordingState={msg:"Generating description for click...",phase:z1.WAITING_FOR_DESCRIPTION};break;case"descriptionGenerated":{const vt=y5(((nu=(He=se.command.cache)==null?void 0:He.target)==null?void 0:nu.nodeOnlySerializedHtml)??"",500,!0);Ce.targetRecordingState={msg:vt?`Saved target: ${vt}`:"Target saved!",phase:z1.IDLE};break}}if(se.type!=="descriptionGenerated")return;const _e=se.command;_e.type===H.CLICK&&(Ce.stepPatcher=vt=>{var ih;if(vt.type!==Fe.PRESET_ACTION)return;const Ht=vt,gn=Ht.command,qs={...gn.cache??{},[se.attribute]:(ih=_e.cache)==null?void 0:ih.target},Zs=tt();Ht.command={...gn,id:Zs,cache:qs,[se.attribute]:_e.target}})})}),Ie=ia(({parentStepId:se,step:me,output:Ce,substepIndex:_e})=>{Ze(He=>{Zx(He);const nu=Gi(He,se,[]);if(!nu)return;const vt=nu.children.findIndex(gn=>gn.step.id===me.id);me.command.type===H.SUCCESS&&(nu.children=nu.children.slice(0,vt+1));const Ht=Gi(He,me.id,[]);if(Ce&&Ht){const gn=Ht.status;gn!==sa.FAILED&&gn!==sa.CANCELLED&&(Ht.status=Ce.status,Ht.output=Ce)}if(!Ht){const gn=ys(me);Ce&&(gn.output=Ce,gn.status=Ce.status),nu.children.push(gn),nu.message="Generating command...";return}if(Ht&&Ht.step.type===Fe.PRESET_ACTION&&Object.keys(nF(Ht.step??{},me??{})).length>0){const gn=ys(me);gn.status=Ht.status,Ce&&(gn.status=Ce.status,gn.output=Ce),nu.children.splice(vt,1,gn)}}),Ze(He=>{const{indices:nu}=Yb(He,se,[]);nu&&xu(He,[...nu,_e])})}),ou=ia(({message:se,step:me,output:Ce,parentStepIdChain:_e})=>{Ze(He=>{var gn;const nu=Gi(He,me.id,_e);if(!nu)return;nu.status=sa.SUCCESS,nu.message=se||me.message,nu.output=Ce;const vt="command"in me?me.command:void 0;vt&&(nu.message=vt.thoughts||nu.message),vt&&nu.step.type===Fe.PRESET_ACTION&&Object.keys(nF(nu.step.command??{},vt)).length>0&&(nu.step.command=vt),nu.step.type===Fe.AI_ACTION_DYNAMIC&&(nu.aiActionLatestMessage=void 0);const Ht=Yb(He,me.id,_e).parentChain;for(let qs=Ht.length-1;qs>=0;qs--){const Zs=Ht[qs];if(Zs.children.every(ih=>ih.status===sa.SUCCESS)&&Zs.step.type!==Fe.AI_ACTION_DYNAMIC)Zs.status=sa.SUCCESS,Zs.message="All sub-steps completely successfully.",Zs.output=(gn=Zs.children[Zs.children.length-1])==null?void 0:gn.output;else break}})}),$u=ia(({url:se,iframeSrcUrls:me,logsPerPage:Ce,context:_e,harPages:He,harEntries:nu,isInPageLoad:vt})=>{if(O(vt),W(se),q(me),Y(_e),Ce!=null&&Ce.length){const Ht=$Rt(Ce);c(gn=>{let qs=[...gn];for(const Zs of Ht)qs=qs.concat(Zs.map(ih=>({...ih,id:tt()})));return qs=qs.sort((Zs,ih)=>Zs.timestamp-ih.timestamp).slice(Math.max(0,qs.length-100),qs.length),qs})}He&&E(Ht=>({...Ht,...He})),nu&&f(Ht=>({...Ht,...nu}))}),lt=ia(({message:se,output:me,step:Ce,parentStepIdChain:_e})=>{le(!1),Ze(He=>{const nu=Gi(He,Ce.id,_e);nu&&(nu.status=sa.FAILED,nu.message=se||Ce.message,nu.output=me,nu.aiActionLatestMessage=void 0)})}),_u=ia(({message:se,output:me,step:Ce,parentStepIdChain:_e})=>{le(!1),Ze(He=>{const nu=Gi(He,Ce.id,_e);nu&&(nu.status=sa.CANCELLED,nu.message=se||Ce.message,nu.output=me,nu.aiActionLatestMessage=void 0)})}),wu=ia(({step:se,stepId:me,offset:Ce})=>{let _e,He;const nu=nt.current;if(me){const vt=Yb(nu,me,[]);if(vt.result)if(vt.indices[0]===void 0){n.error(`Starting index not found during step recording: ${JSON.stringify(vt)}`);return}else He=vt.indices[0]+1;else{n.error(`Starting step not found during step recording (${me}): ${JSON.stringify(nu.map(Ht=>Ht.step))}`);return}}else He=0;if(_e=He+Ce,_e===void 0){n.error("Insertion index not found during step recording");return}else kt(se,!1,[_e])}),gt=ia(({buffer:se},me)=>{i(se),me()}),Bt=ia(({url:se,userAgent:me,sessionId:Ce})=>{Ju.current.sessionId=Ce,ue(!0),P("initialized"),W(se),s(me)}),Oa=ia(()=>{eu(),Te(!1),le(!1)}),St=ia(()=>{n.info("Ping event received",wa)}),Wt=ia(se=>{n.error("Socket reconnect error",wa,se),!(Za.current>Date.now()-1e4)&&(Za.current=Date.now(),setTimeout(()=>nn.error("Failed to connect to Momentic's servers. Please refresh the page and try again later."),2e3))}),zt=ia(se=>{n.warn(`Socket reconnect attempt ${se}`,wa)}),cr=ia(()=>{n.info("Socket reconnected",wa),setTimeout(()=>{nn.success("Reconnected to Momentic!")},2e3),Xe("")}),Gr=ia(()=>{n.error("Socket reconnect failed",wa),Xe("It seems like you lost connection to Momentic's servers. Please ensure you have a stable connection and refresh the page.")}),an=ia(()=>{Ju.current.recovered=Le==null?void 0:Le.recovered,Xe(""),Kt.current&&window.clearInterval(Kt.current),Kt.current=window.setInterval(()=>{if(a!="local"){if(re.current){eu();return}if(!(qe.current>Date.now()-5*6e4)){if(qe.current>Date.now()-10*6e4&&Date.now()-au.current>10*6e4){nn.warning("You've been inactive for a while. Please interact with the editor to avoid being disconnected.",{duration:6e4}),au.current=Date.now();return}clearInterval(Kt.current),Le!=null&&Le.active&&!re.current&&(n.error("Disconnecting due to inactivity",wa),Xe("You've been disconnected due to inactivity. Please refresh the page to start a new session."),Le==null||Le.disconnect())}}},6e4)}),di=ia((se,me)=>{n.info("Frontend disconnecting",{reason:se,description:me,...wa}),clearInterval(Kt.current),Xe("Disconnected!"),Te(!1)}),$i=ia(se=>{n.error("Socket error",wa,new Error(se.message)),nn.error(`An unexpected error occurred: ${se.message}`,{duration:1/0})}),xs=ia(se=>{const me="description"in se&&typeof se.description=="string"?se.description:void 0;n.warn(`Socket connect error (msg: ${se.message}, description: ${me})`,{...wa,description:me}),Le!=null&&Le.active?Za.current>Date.now()-1e4&&(Za.current=Date.now(),nn.error("Failed to connect to Momentic's servers. Your internet may be unstable or you may have reached a server under heavy load. Retrying...")):Xe(se.message)}),_n=ia(()=>{const se={type:"e2e",testId:e.id},me=Mz(u,{transports:["websocket"],query:se,reconnection:!0,reconnectionAttempts:3,reconnectionDelay:5e3,autoConnect:!0});return me.io.on("ping",St),me.io.on("reconnect_error",Wt),me.io.on("reconnect_attempt",zt),me.io.on("reconnect",cr),me.io.on("reconnect_failed",Gr),me.on("newIconDetected",Fo),me.on("connect",an),me.on("disconnect",di),me.on("churnImminent",o1),me.on("error",$i),me.on("connect_error",xs),me.on("session",Bt),me.on("finished",Oa),me.on("screenshot",gt),me.on("browserState",$u),me.on("tabs",ci),me.on("started",sn),me.on("dynamicCommandStatusUpdate",Ds),me.on("dynamicCommandEvaluating",C4),me.on("dynamicCommandGenerated",y4),me.on("dynamicCommandExecuted",Se),me.on("commandGenerated",be),me.on("targetRecordingUpdate",je),me.on("commandExecuted",Ie),me.on("success",ou),me.on("failure",lt),me.on("cancelled",_u),me.on("stepRecorded",wu),me}),b4=ia(()=>{var se;n.info("Reconnecting socket",wa),(se=Nt.current)==null||se.disconnect(),Nt.current=_n()}),Ur=ia(()=>{var se,me;(se=Nt.current)!=null&&se.connected&&(n.info("Running socket cleanup function"),(me=Nt.current)==null||me.disconnect()),R0.current&&window.clearTimeout(R0.current),Kt.current&&window.clearInterval(Kt.current)});k.useEffect(()=>(window.addEventListener("beforeunload",Ur),()=>{window.removeEventListener("beforeunload",Ur)}),[Ur]),k.useEffect(()=>(Nt.current||(Nt.current=_n()),Ur),[Ur,_n]);const L0=()=>{Ru||window.location.reload()},uh=()=>{eu(),ve(!0),Le==null||Le.emit("refresh",void 0,()=>ve(!1))},Xl=()=>{eu(),Le==null||Le.emit("cancel"),le(!0)},wy=()=>{We.length&&(Te(!0),eu(),Ze(se=>{se.forEach(me=>{vh(me,sa.IDLE),Ch(me)})}),Le==null||Le.emit("execute",{reInitialize:!1,steps:Uu}))},Oy=se=>{eu(),V({x:Math.max(0,Math.round(se.pctX*L.width*100)/100),y:Math.max(0,Math.round(se.pctY*L.height*100)/100)}),se.event==="move"?Le==null||Le.emit("mouseMoveEvent",{event:"move",percentX:se.pctX,percentY:se.pctY}):Le==null||Le.emit("mouseClickEvent",{event:se.event,percentX:se.pctX,percentY:se.pctY})},Tx=se=>{eu(),Le==null||Le.emit("keyDownEvent",{key:se})},Mx=se=>{eu(),Le==null||Le.emit("keyUpEvent",{key:se})},ce=se=>{eu(),Le==null||Le.emit("mouseMoveEvent",{event:"scroll",percentX:se.pctDeltaX,percentY:se.pctDeltaY})},ke=(se,me)=>{ne&&(Te(!0),eu(),Ze(Ce=>{const _e=Gi(Ce,se,me);_e&&(vh(_e,sa.IDLE),Ch(_e))}),Le==null||Le.emit("execute",{reInitialize:!1,steps:Uu,fromStep:{fromStepId:se,parentStepIdChain:me},toStep:{toStepId:se,parentStepIdChain:me}}))},Me=(se,me)=>{if(!ne)return;Te(!0);let Ce,_e;Zq({states:We,fn:(He,nu)=>Ce||He.step.id===se&&JSON.stringify(nu)===JSON.stringify(me)?!0:He.step.skipped?!1:He.status===sa.IDLE?(Ce=He.step.id,_e=nu,!0):!1,earlyStop:!0,inOrder:!0}),eu(),Le==null||Le.emit("execute",{reInitialize:!1,steps:Uu,fromStep:Ce&&_e?{fromStepId:Ce,parentStepIdChain:_e}:void 0,toStep:{toStepId:se,parentStepIdChain:me}})},Je=(se,me)=>{ne&&(Te(!0),Ze(Ce=>{const _e=Gi(Ce,se,me);if(!_e)return;vh(_e,sa.IDLE),Ch(_e);const He=Yb(Ce,se,me);if(He.lastParent){vh(He.lastParent,sa.IDLE),Ch(He.lastParent);let vt=!1;He.lastParent.children.forEach(Ht=>{vt&&(vh(Ht,sa.IDLE),Ch(Ht)),Ht.step.id===se&&(vt=!0)})}let nu=!1;Ce.forEach(vt=>{nu&&(vh(vt,sa.IDLE),Ch(vt)),vt.step.id===se&&(nu=!0)})}),eu(),Le==null||Le.emit("execute",{reInitialize:!1,steps:Uu,fromStep:{fromStepId:se,parentStepIdChain:me}}))},xe=(se,me,Ce)=>{if(Ce.length===0)se.push(me);else if(Ce.length===1)se.splice(Ce[0],0,me);else{const _e=j4(se,Ce);let He=Ce[Ce.length-1];_e.step.type===Fe.AI_ACTION&&me.step.type===Fe.PRESET_ACTION&&me.step.command.type!==H.SUCCESS&&He===_e.children.length&&(He=_e.children.length-1),_e.children.splice(He,0,me)}},lu=(se,me)=>{Ze(Ce=>{var He;Ce.forEach(nu=>{nu.editing=!1,nu.children.forEach(vt=>{vt.editing=!1})});let _e;se.type===Fe.AI_ACTION?(_e=ys({id:tt(),type:Fe.AI_ACTION,text:""}),_e.expanded=!0,_e.editing=!0):se.type===Fe.AI_ACTION_DYNAMIC?(_e=ys({id:tt(),type:Fe.AI_ACTION_DYNAMIC,text:""}),_e.expanded=!0,_e.editing=!0,_e.aiActionLatestMessage=void 0):se.type==="RESOLVED_MODULE"?(_e=ys({...se,type:"RESOLVED_MODULE",inputs:(He=se.parameters)!=null&&He.length?{}:void 0,id:tt()}),_e.children=N4(se.steps),_e.expanded=!0,_e.editing=!1):(_e=ys({id:tt(),type:Fe.PRESET_ACTION,command:iT(se.command)}),_e.editing=!0),xe(Ce,_e,me),xu(Ce,me)})},xu=(se,me)=>{const Ce=se[me[0]];if(!Ce||Ce.step.type!=="RESOLVED_MODULE")return;const _e=Ce.step.moduleId,He=[];for(let nu=0;nu<se.length;nu++){const vt=se[nu];nu!==me[0]&&vt.step.type==="RESOLVED_MODULE"&&vt.step.moduleId===_e&&He.push(nu)}for(const nu of He){const vt=se[nu];if(me.length>1&&(vt.children=jLe(vt.children,Ce.children)),vt.step.type==="RESOLVED_MODULE"){const Ht=tSe.parse(Ce.step);Object.assign(vt.step,Ht)}vt.status=sa.IDLE,vt.output=void 0}},kt=(se,me,Ce)=>{eu();const _e=He=>{const nu=rp(He,Ce);if(!nu){const Ht=ys(se);xe(He,Ht,Ce);return}const vt=nu.step;if(nu.step=se,nu.status=sa.IDLE,nu.output=void 0,(vt.type!=="RESOLVED_MODULE"&&se.type==="RESOLVED_MODULE"||vt.type==="RESOLVED_MODULE"&&se.type==="RESOLVED_MODULE"&&vt.moduleId!==se.moduleId)&&(nu.children=se.steps.map(Ht=>ys(Ht))),se.type===Fe.AI_ACTION&&(nu.children=[],nu.message=void 0),se.type===Fe.AI_ACTION_DYNAMIC&&(nu.aiActionLatestMessage=void 0),Ce.length>1){const Ht=j4(He,Ce),gn=Ce[Ce.length-1];Ht.children[gn].step=se,Ht.status=sa.IDLE,Ht.output=void 0}xu(He,Ce)};if(Ze(_e),me){if(!ne)return;const He=EJe(We,_e);Ze(Ht=>{const gn=rp(Ht,Ce);gn&&(vh(gn,sa.IDLE),Ch(gn))});const{result:nu,parentChain:vt}=PLt(He,Ce);if(!nu)return;Te(!0),eu(),Le==null||Le.emit("execute",{reInitialize:!1,steps:mE(He),fromStep:{fromStepId:nu.step.id,parentStepIdChain:vt.map(Ht=>Ht.step.id)},toStep:{toStepId:nu.step.id,parentStepIdChain:vt.map(Ht=>Ht.step.id)}})}},ha=se=>{Ze(me=>{if(se.length===1)me.splice(se[0],1);else if(se.length>1){const Ce=j4(me,se),_e=se[se.length-1];Ce.children.splice(_e,1),xu(me,se)}})},za=se=>{Ze(me=>{if(se.length===1){const Ce=se[0];if(Ce===0)return;const[_e]=me.splice(Ce,1);me.unshift(_e)}else if(se.length>1){const Ce=se[se.length-1];if(Ce===0)return;const _e=j4(me,se),[He]=_e.children.splice(Ce,1);_e.children.unshift(He),xu(me,se)}})},Xa=se=>{Ze(me=>{if(se.length===1){const Ce=se[0];if(Ce===0)return;const _e=me[Ce];me[Ce]=me[Ce-1],me[Ce-1]=_e}else if(se.length>1){const Ce=se[se.length-1];if(Ce===0)return;const _e=j4(me,se);vfe(_e.children,Ce,Ce-1),xu(me,se)}})},ln=se=>{Ze(me=>{if(se.length===1){const Ce=se[0];if(Ce===me.length-1)return;const _e=me[Ce];me[Ce]=me[Ce+1],me[Ce+1]=_e}else if(se.length>1){const Ce=j4(me,se),_e=se[se.length-1];if(_e===Ce.children.length-1)return;vfe(Ce.children,_e,_e+1),xu(me,se)}})},Un=se=>{Ze(me=>{if(se.length===1){const Ce=se[0];if(Ce===me.length-1)return;const[_e]=me.splice(Ce,1);me.push(_e)}else if(se.length>1){const Ce=se[se.length-1],_e=j4(me,se);if(Ce===_e.children.length-1)return;const[He]=_e.children.splice(Ce,1);_e.children.push(He),xu(me,se)}})},th=se=>{Ze(me=>{if(se.length===1){const Ce=se[0],[_e]=N4(mE([me[Ce]]));_e.step.id=tt(),"command"in _e.step&&(_e.step.command.id=tt()),me.splice(Ce+1,0,_e)}else if(se.length>1){const Ce=j4(me,se),_e=se[se.length-1],[He]=N4(mE([Ce.children[_e]]));He.step.id=tt(),"command"in He.step&&(He.step.command.id=tt()),Ce.children.splice(_e+1,0,He),xu(me,se)}})},ah=se=>{Ze(me=>{const Ce=rp(me,se);if(!Ce||Ce.step.type!==Fe.AI_ACTION&&Ce.step.type!=="RESOLVED_MODULE"&&Ce.step.type!==Fe.AI_ACTION_DYNAMIC)return;const _e=Ce.children.map(He=>He.step).filter(He=>!(He.type===Fe.PRESET_ACTION&&He.command.type===H.SUCCESS));if(_e.forEach(He=>{He.id=tt(),"command"in He&&(He.command.id=tt())}),se.length===1){const He=se[0],nu=N4(_e);me.splice(He,1,...nu)}else if(se.length>1){const He=j4(me,se),nu=se[se.length-1],vt=N4(_e);He.children.splice(nu,1,...vt),xu(me,se)}})},Wm=(se,me)=>{Ze(Ce=>{const _e=rp(Ce,me);_e&&(_e.selected=se)})},nh=(se,me)=>{Ze(Ce=>{const _e=rp(Ce,me);_e&&(_e.expanded=se)})},q$=(se,me,Ce)=>{var He;if(eu(),me.type!==H.VISUAL_DIFF&&!se){Ce==null||Ce(void 0,"Cannot locate element without description");return}const _e=vm.parse(e);(He=Le==null?void 0:Le.emit)==null||He.call(Le,"locate",{description:se,command:me,testMetadata:_e,returnScreenshot:me.type===H.VISUAL_DIFF},({result:nu,err:vt})=>{Ce==null||Ce(nu,vt)})},rh=ia((se,me)=>{var Ce;eu(),(Ce=Le==null?void 0:Le.emit)==null||Ce.call(Le,"lintStep",{command:se},({result:_e})=>{me==null||me(_e)})}),zy=()=>{ye(!1),Ze(se=>{se.forEach(me=>{me.selected=!1})})},j8=se=>{const me=We.findIndex(Ce=>Ce.selected&&CA(Ce.step));Ze(Ce=>Ce.filter(_e=>!(_e.selected&&CA(_e.step)))),Ze(Ce=>{Ce.splice(me,0,{uniqueId:tt(),step:{...se,type:"RESOLVED_MODULE",id:tt()},status:sa.IDLE,selected:!1,editing:!1,expanded:!0,readonly:!1,children:N4(se.steps)})}),ye(!1)},Z$=()=>{ye(!0),Ze(se=>{se.forEach(me=>{me.editing=!1,me.children.forEach(Ce=>{Ce.editing=!1})})})},Jm=ia(se=>{Su(se)});return{logs:l,networkPages:d,networkEntries:h,a11yTree:m,isLoadingA11yTree:x,html:v,isLoadingHtml:y,validState:ua,hasDiff:Ru,screenshot:r,isInPageLoad:F,userAgent:o,viewport:L,url:U,baseUrl:M,activeEnv:K,iframeSrcUrls:$,initialized:Q,executing:Ue,canceling:ae,recording:Z,error:$e,creatingModule:X,stepsState:We,steps:Uu,testContext:J,tabs:S,activeTab:_,lastMouseLocation:G,lintTriggerKey:T,interactive:R,section:lr,stepLists:Re,debouncedStepLists:Nu,lastSavedStepLists:ka,canExecute:ne,canRefresh:Oe,canRecord:oe,canEdit:ee,handleActiveTabChange:se=>{j(se),Le==null||Le.emit("switchTab",{url:se})},handleEditChange:(se,me)=>{Ze(Ce=>{const _e=rp(Ce,me);_e&&(Ce.forEach(He=>{He.uniqueId!==_e.uniqueId&&(He.editing=!1,He.children.forEach(nu=>{nu.uniqueId!==_e.uniqueId&&(nu.editing=!1)}))}),_e.editing=se)})},handleRefresh:uh,handleReset:L0,handleRunAllSteps:wy,handleExecute:ke,handleExecuteTo:Me,handleExecuteFrom:Je,handleAdd:lu,handleStepChange:kt,handleDelete:ha,handleMoveToTop:za,handleMoveUp:Xa,handleMoveDown:ln,handleMoveToBottom:Un,handleDuplicate:th,handleUngroup:ah,handleSelectChange:Wm,handleExpandChange:nh,handleLocate:q$,handleLintStep:rh,handleStartCreatingModule:Z$,handleCreateModuleSuccess:j8,handleCancelCreateModule:zy,handleSaveTestSuccess:Jm,handleToggleRecord:()=>{if(eu(),Z)Le==null||Le.emit("recordingStop"),Ee(!1);else{const se=rp(We,[We.length-1]);Le==null||Le.emit("recordingStart",{stepId:se==null?void 0:se.step.id}),Ee(!0),I(!0)}},handleCancelExecution:Xl,handleTrapKeyDown:Tx,handleTrapKeyUp:Mx,handleTrapMouseEvent:Oy,handleTrapWheel:ce,handleStartRecordingTarget:(se,me,Ce)=>{eu(),Le==null||Le.emit("recordTargetClick",{stepId:se,parentStepIdChain:me,attribute:Ce}),I(!0),Ze(_e=>{const He=Gi(_e,se,me);He&&(He.targetRecordingState={phase:z1.INITIALIZING,msg:"Initializing recording handlers. Please wait...."})})},handleFetchA11yTree:()=>{Le&&(g(!0),Le.emit("fetchA11yTree",void 0,se=>{se.err&&nn.error(`An unexpected error occurred: ${se.err}.`,{duration:6e4}),p(se.a11yTree),g(!1)}))},handleFetchHtml:()=>{Le&&(b(!0),Le.emit("fetchDom",void 0,se=>{se.err&&nn.error(`An unexpected error occurred: ${se.err}.`,{duration:6e4}),C(se.html),b(!1)}))},handleInteractiveChange:se=>{eu(),I(se)},handleSectionChange:j0}};var BJe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ixe=N.createContext&&N.createContext(BJe),$oa=["attr","size","title"];function Ioa(u,e){if(u==null)return{};var t=Koa(u,e),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(u);for(n=0;n<r.length;n++)a=r[n],!(e.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(u,a)&&(t[a]=u[a])}return t}function Koa(u,e){if(u==null)return{};var t={},a=Object.keys(u),n,r;for(r=0;r<a.length;r++)n=a[r],!(e.indexOf(n)>=0)&&(t[n]=u[n]);return t}function XM(){return XM=Object.assign?Object.assign.bind():function(u){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(u[a]=t[a])}return u},XM.apply(this,arguments)}function oxe(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(u);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(u,n).enumerable})),t.push.apply(t,a)}return t}function eP(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oxe(Object(t),!0).forEach(function(a){Hoa(u,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):oxe(Object(t)).forEach(function(a){Object.defineProperty(u,a,Object.getOwnPropertyDescriptor(t,a))})}return u}function Hoa(u,e,t){return e=Voa(e),e in u?Object.defineProperty(u,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):u[e]=t,u}function Voa(u){var e=Goa(u,"string");return typeof e=="symbol"?e:String(e)}function Goa(u,e){if(typeof u!="object"||u===null)return u;var t=u[Symbol.toPrimitive];if(t!==void 0){var a=t.call(u,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function SJe(u){return u&&u.map((e,t)=>N.createElement(e.tag,eP({key:t},e.attr),SJe(e.child)))}function wJe(u){return e=>N.createElement(Uoa,XM({attr:eP({},u.attr)},e),SJe(u.child))}function Uoa(u){var e=t=>{var{attr:a,size:n,title:r}=u,i=Ioa(u,$oa),o=n||t.size||"1em",s;return t.className&&(s=t.className),u.className&&(s=(s?s+" ":"")+u.className),N.createElement("svg",XM({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,i,{className:s,style:eP(eP({color:u.color||t.color},t.style),u.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),r&&N.createElement("title",null,r),u.children)};return ixe!==void 0?N.createElement(ixe.Consumer,null,t=>e(t)):e(BJe)}function Woa(u){return wJe({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z"},child:[]},{tag:"path",attr:{d:"M12 15l0 4"},child:[]},{tag:"path",attr:{d:"M14 17l-4 0"},child:[]}]})(u)}function Joa(u){return wJe({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z"},child:[]},{tag:"path",attr:{d:"M12 9v-4"},child:[]},{tag:"path",attr:{d:"M10 7l4 0"},child:[]}]})(u)}const zo=k.forwardRef((u,e)=>D.jsxs(Ir,{disableHoverableContent:!0,children:[D.jsx(Kr,{asChild:!0,children:D.jsx(ut,{ref:e,variant:"plain",size:"icon",...u})}),D.jsx(yr,{children:u.tooltip})]}));zo.displayName="IconButtonWithTooltip";const qoa=u=>D.jsxs(D.Fragment,{children:[D.jsx(zo,{tooltip:"Run",onClick:u.onExecute,disabled:u.disabled||u.skipped,className:"rounded-r-none",children:D.jsx(jMe,{className:"h-4 w-4"})}),D.jsx(zo,{tooltip:"Run to",onClick:u.onExecuteTo,disabled:u.disabled||u.skipped,className:"rounded-none",children:D.jsx(E9t,{className:"h-4 w-4"})}),D.jsx(zo,{tooltip:"Run from",onClick:u.onExecuteFrom,disabled:u.disabled||u.skipped,className:"rounded-none",children:D.jsx(f9t,{className:"h-4 w-4"})}),D.jsx(zo,{tooltip:"Edit",onClick:u.onEdit,disabled:u.disabled,className:"rounded-none",children:D.jsx(rne,{className:"h-4 w-4"})}),D.jsx(zo,{tooltip:"Duplicate",onClick:u.onDuplicate,disabled:u.disabled,className:"rounded-none",children:D.jsx(une,{className:"h-4 w-4"})}),u.canUngroup&&D.jsx(zo,{tooltip:"Ungroup",className:"rounded-none",disabled:u.disabled,onClick:u.onUngroup,children:D.jsx(g9t,{className:"h-4 w-4"})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Move to the top",onClick:u.onMoveToTop,disabled:u.disabled,className:"rounded-none",children:D.jsx(x7t,{className:"h-4 w-4"})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Move up",onClick:u.onMoveUp,disabled:u.disabled,className:"rounded-none",children:D.jsx(QJ,{className:"h-4 w-4"})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Move down",onClick:u.onMoveDown,disabled:u.disabled,className:"rounded-none",children:D.jsx(ZJ,{className:"h-4 w-4"})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Move to the bottom",onClick:u.onMoveToBottom,disabled:u.disabled,className:"rounded-none",children:D.jsx(m7t,{className:"h-4 w-4"})}),D.jsx(wz,{onAdd:u.onAddBefore,hideModules:u.hideModules,modules:u.modules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly,children:D.jsx(zo,{tooltip:"Add before",className:"rounded-none",disabled:u.disabled,children:D.jsx(Joa,{className:"h-4 w-4"})})}),u.canAddAfter&&D.jsx(wz,{onAdd:u.onAddAfter,hideModules:u.hideModules,modules:u.modules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly,children:D.jsx(zo,{tooltip:"Add after",className:"rounded-none",disabled:u.disabled,children:D.jsx(Woa,{className:"h-4 w-4"})})}),u.canAddChild&&D.jsx(wz,{onAdd:u.onAddChild,hideModules:!0,modules:u.modules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsChildrenOnly,children:D.jsx(zo,{tooltip:"Add child",className:"rounded-none",disabled:u.disabled,children:D.jsx(R7t,{className:"h-4 w-4"})})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Delete",className:"rounded-l-none",disabled:u.disabled,onClick:u.onDelete,children:D.jsx(D9t,{className:"text-destructive h-4 w-4"})})]}),sxe=u=>{const e=k.useMemo(()=>u.status===sa.FAILED?D.jsx(_Me,{className:"text-destructive h-6 w-6"}):u.status===sa.CANCELLED?D.jsx(OMe,{className:"h-6 w-6 text-yellow-600"}):u.status===sa.SUCCESS?D.jsx(B7t,{className:"text-success h-6 w-6"}):D.jsx(ane,{className:"h-6 w-6 animate-spin"}),[u.status]);return D.jsxs("div",{className:"hover:border-foreground focus-visible:border-foreground bg-background grid grid-cols-[auto_1fr] gap-4 overflow-auto rounded-lg border p-4 outline-none ring-0 transition-all",children:[e,D.jsx("span",{className:"break-words",children:u.message})]})};var cY={exports:{}};(function(u,e){(function(t,a){var n="1.0.37",r="",i="?",o="function",s="undefined",l="object",c="string",d="major",E="model",h="name",f="type",m="vendor",p="version",x="architecture",g="console",v="mobile",C="tablet",y="smarttv",b="wearable",F="embedded",O=500,T="Amazon",P="Apple",z="ASUS",A="BlackBerry",S="Browser",w="Chrome",_="Edge",j="Firefox",K="Google",M="Huawei",L="LG",G="Microsoft",V="Motorola",R="Opera",I="Samsung",U="Sharp",W="Sony",$="Xiaomi",q="Zebra",Q="Facebook",ue="Chromium OS",ae="Mac OS",le=function(oe,Oe){var $e={};for(var Xe in oe)Oe[Xe]&&Oe[Xe].length%2===0?$e[Xe]=Oe[Xe].concat(oe[Xe]):$e[Xe]=oe[Xe];return $e},Z=function(oe){for(var Oe={},$e=0;$e<oe.length;$e++)Oe[oe[$e].toUpperCase()]=oe[$e];return Oe},Ee=function(oe,Oe){return typeof oe===c?fe(Oe).indexOf(fe(oe))!==-1:!1},fe=function(oe){return oe.toLowerCase()},ve=function(oe){return typeof oe===c?oe.replace(/[^\d\.]/g,r).split(".")[0]:a},X=function(oe,Oe){if(typeof oe===c)return oe=oe.replace(/^\s\s*/,r),typeof Oe===s?oe:oe.substring(0,O)},ye=function(oe,Oe){for(var $e=0,Xe,qe,au,eu,fu,st;$e<Oe.length&&!fu;){var Kt=Oe[$e],Za=Oe[$e+1];for(Xe=qe=0;Xe<Kt.length&&!fu&&Kt[Xe];)if(fu=Kt[Xe++].exec(oe),fu)for(au=0;au<Za.length;au++)st=fu[++qe],eu=Za[au],typeof eu===l&&eu.length>0?eu.length===2?typeof eu[1]==o?this[eu[0]]=eu[1].call(this,st):this[eu[0]]=eu[1]:eu.length===3?typeof eu[1]===o&&!(eu[1].exec&&eu[1].test)?this[eu[0]]=st?eu[1].call(this,st,eu[2]):a:this[eu[0]]=st?st.replace(eu[1],eu[2]):a:eu.length===4&&(this[eu[0]]=st?eu[3].call(this,st.replace(eu[1],eu[2])):a):this[eu]=st||a;$e+=2}},Ue=function(oe,Oe){for(var $e in Oe)if(typeof Oe[$e]===l&&Oe[$e].length>0){for(var Xe=0;Xe<Oe[$e].length;Xe++)if(Ee(Oe[$e][Xe],oe))return $e===i?a:$e}else if(Ee(Oe[$e],oe))return $e===i?a:$e;return oe},Te={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},J={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"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,p],[/opios[\/ ]+([\w\.]+)/i],[p,[h,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[h,R]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[h,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[h,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[h,"Smart Lenovo "+S]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+S],p],[/\bfocus\/([\w\.]+)/i],[p,[h,j+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[h,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[h,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[h,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[p,[h,j]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+S]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+S],p],[/samsungbrowser\/([\w\.]+)/i],[p,[h,I+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],p],[/metasr[\/ ]?([\d\.]+)/i],[p,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[h,p],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,Q],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[h,w+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,w+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[h,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[p,Ue,Te]],[/(webkit|khtml)\/([\w\.]+)/i],[h,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[h,j+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,p],[/(cobalt)\/([\w\.]+)/i],[h,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[x,"amd64"]],[/(ia32(?=;))/i],[[x,fe]],[/((?:i[346]|x)86)[;\)]/i],[[x,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[x,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[x,"armhf"]],[/windows (ce|mobile); ppc;/i],[[x,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[x,/ower/,r,fe]],[/(sun4\w)[;\)]/i],[[x,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[x,fe]]],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],[E,[m,I],[f,C]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[E,[m,I],[f,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[E,[m,P],[f,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[E,[m,P],[f,C]],[/(macintosh);/i],[E,[m,P]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[m,U],[f,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[E,[m,M],[f,C]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[E,[m,M],[f,v]],[/\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)?)(?: bui|\))/i],[[E,/_/g," "],[m,$],[f,v]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[E,/_/g," "],[m,$],[f,C]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[m,"OPPO"],[f,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[m,"Vivo"],[f,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[m,"Realme"],[f,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[E,[m,V],[f,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[m,V],[f,C]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[m,L],[f,C]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[m,L],[f,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[E,[m,"Lenovo"],[f,C]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[E,/_/g," "],[m,"Nokia"],[f,v]],[/(pixel c)\b/i],[E,[m,K],[f,C]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[E,[m,K],[f,v]],[/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],[E,[m,W],[f,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[m,W],[f,C]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[m,"OnePlus"],[f,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[m,T],[f,C]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[m,T],[f,v]],[/(playbook);[-\w\),; ]+(rim)/i],[E,m,[f,C]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[E,[m,A],[f,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[m,z],[f,C]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[m,z],[f,v]],[/(nexus 9)/i],[E,[m,"HTC"],[f,C]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[E,/_/g," "],[f,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[m,"Acer"],[f,C]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[m,"Meizu"],[f,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[m,"Ulefone"],[f,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[m,E,[f,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/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],[m,E,[f,C]],[/(surface duo)/i],[E,[m,G],[f,C]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[m,"Fairphone"],[f,v]],[/(u304aa)/i],[E,[m,"AT&T"],[f,v]],[/\bsie-(\w*)/i],[E,[m,"Siemens"],[f,v]],[/\b(rct\w+) b/i],[E,[m,"RCA"],[f,C]],[/\b(venue[\d ]{2,7}) b/i],[E,[m,"Dell"],[f,C]],[/\b(q(?:mv|ta)\w+) b/i],[E,[m,"Verizon"],[f,C]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[E,[m,"Barnes & Noble"],[f,C]],[/\b(tm\d{3}\w+) b/i],[E,[m,"NuVision"],[f,C]],[/\b(k88) b/i],[E,[m,"ZTE"],[f,C]],[/\b(nx\d{3}j) b/i],[E,[m,"ZTE"],[f,v]],[/\b(gen\d{3}) b.+49h/i],[E,[m,"Swiss"],[f,v]],[/\b(zur\d{3}) b/i],[E,[m,"Swiss"],[f,C]],[/\b((zeki)?tb.*\b) b/i],[E,[m,"Zeki"],[f,C]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],E,[f,C]],[/\b(ns-?\w{0,9}) b/i],[E,[m,"Insignia"],[f,C]],[/\b((nxa|next)-?\w{0,9}) b/i],[E,[m,"NextBook"],[f,C]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],E,[f,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],E,[f,v]],[/\b(ph-1) /i],[E,[m,"Essential"],[f,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[E,[m,"Envizen"],[f,C]],[/\b(trio[-\w\. ]+) b/i],[E,[m,"MachSpeed"],[f,C]],[/\btu_(1491) b/i],[E,[m,"Rotor"],[f,C]],[/(shield[\w ]+) b/i],[E,[m,"Nvidia"],[f,C]],[/(sprint) (\w+)/i],[m,E,[f,v]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[m,G],[f,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[m,q],[f,C]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[m,q],[f,v]],[/smart-tv.+(samsung)/i],[m,[f,y]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[m,I],[f,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,L],[f,y]],[/(apple) ?tv/i],[m,[E,P+" TV"],[f,y]],[/crkey/i],[[E,w+"cast"],[m,K],[f,y]],[/droid.+aft(\w+)( bui|\))/i],[E,[m,T],[f,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[m,U],[f,y]],[/(bravia[\w ]+)( bui|\))/i],[E,[m,W],[f,y]],[/(mitv-\w{5}) bui/i],[E,[m,$],[f,y]],[/Hbbtv.*(technisat) (.*);/i],[m,E,[f,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,X],[E,X],[f,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,E,[f,g]],[/droid.+; (shield) bui/i],[E,[m,"Nvidia"],[f,g]],[/(playstation [345portablevi]+)/i],[E,[m,W],[f,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[m,G],[f,g]],[/((pebble))app/i],[m,E,[f,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[m,P],[f,b]],[/droid.+; (glass) \d/i],[E,[m,K],[f,b]],[/droid.+; (wt63?0{2,3})\)/i],[E,[m,q],[f,b]],[/(quest( 2| pro)?)/i],[E,[m,Q],[f,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[f,F]],[/(aeobc)\b/i],[E,[m,T],[f,F]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[E,[f,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[E,[f,C]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,C]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,v]],[/(android[-\w\. ]{0,9});.+buil/i],[E,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[h,_+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[p,Ue,J]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,Ue,J],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,ae],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,p],[/\(bb(10);/i],[p,[h,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[h,j+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[h,w+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,ue],p],[/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) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,p],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,p]]},re=function(oe,Oe){if(typeof oe===l&&(Oe=oe,oe=a),!(this instanceof re))return new re(oe,Oe).getResult();var $e=typeof t!==s&&t.navigator?t.navigator:a,Xe=oe||($e&&$e.userAgent?$e.userAgent:r),qe=$e&&$e.userAgentData?$e.userAgentData:a,au=Oe?le(Y,Oe):Y,eu=$e&&$e.userAgent==Xe;return this.getBrowser=function(){var fu={};return fu[h]=a,fu[p]=a,ye.call(fu,Xe,au.browser),fu[d]=ve(fu[p]),eu&&$e&&$e.brave&&typeof $e.brave.isBrave==o&&(fu[h]="Brave"),fu},this.getCPU=function(){var fu={};return fu[x]=a,ye.call(fu,Xe,au.cpu),fu},this.getDevice=function(){var fu={};return fu[m]=a,fu[E]=a,fu[f]=a,ye.call(fu,Xe,au.device),eu&&!fu[f]&&qe&&qe.mobile&&(fu[f]=v),eu&&fu[E]=="Macintosh"&&$e&&typeof $e.standalone!==s&&$e.maxTouchPoints&&$e.maxTouchPoints>2&&(fu[E]="iPad",fu[f]=C),fu},this.getEngine=function(){var fu={};return fu[h]=a,fu[p]=a,ye.call(fu,Xe,au.engine),fu},this.getOS=function(){var fu={};return fu[h]=a,fu[p]=a,ye.call(fu,Xe,au.os),eu&&!fu[h]&&qe&&qe.platform!="Unknown"&&(fu[h]=qe.platform.replace(/chrome os/i,ue).replace(/macos/i,ae)),fu},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 Xe},this.setUA=function(fu){return Xe=typeof fu===c&&fu.length>O?X(fu,O):fu,this},this.setUA(Xe),this};re.VERSION=n,re.BROWSER=Z([h,p,d]),re.CPU=Z([x]),re.DEVICE=Z([E,m,f,g,v,y,C,b,F]),re.ENGINE=re.OS=Z([h,p]),u.exports&&(e=u.exports=re),e.UAParser=re;var ee=typeof t!==s&&(t.jQuery||t.Zepto);if(ee&&!ee.ua){var ne=new re;ee.ua=ne.getResult(),ee.ua.get=function(){return ne.getUA()},ee.ua.set=function(oe){ne.setUA(oe);var Oe=ne.getResult();for(var $e in Oe)ee.ua[$e]=Oe[$e]}}})(typeof window=="object"?window:Ne)})(cY,cY.exports);var Zoa=cY.exports;const Qoa=ea(Zoa);var Yoa="Toggle",OJe=k.forwardRef((u,e)=>{const{pressed:t,defaultPressed:a=!1,onPressedChange:n,...r}=u,[i=!1,o]=Is({prop:t,onChange:n,defaultProp:a});return D.jsx(Dt.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":u.disabled?"":void 0,...r,ref:e,onClick:pu(u.onClick,()=>{u.disabled||o(!i)})})});OJe.displayName=Yoa;var zJe=OJe;const Xoa=QD("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),_Je=k.forwardRef(({className:u,variant:e,size:t,...a},n)=>D.jsx(zJe,{ref:n,className:Pe(Xoa({variant:e,size:t,className:u})),...a}));_Je.displayName=zJe.displayName;const Cie=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{className:"relative w-full overflow-auto",children:D.jsx("table",{ref:t,className:Pe("w-full caption-bottom text-sm",u),...e})}));Cie.displayName="Table";const yie=k.forwardRef(({className:u,...e},t)=>D.jsx("thead",{ref:t,className:Pe("[&_tr]:border-b",u),...e}));yie.displayName="TableHeader";const bie=k.forwardRef(({className:u,...e},t)=>D.jsx("tbody",{ref:t,className:Pe("[&>:last-child]:border-0",u),...e}));bie.displayName="TableBody";const TJe=k.forwardRef(({className:u,...e},t)=>D.jsx("tfoot",{ref:t,className:Pe("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",u),...e}));TJe.displayName="TableFooter";const B5=k.forwardRef(({className:u,...e},t)=>D.jsx("tr",{ref:t,className:Pe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",u),...e}));B5.displayName="TableRow";const H6=k.forwardRef(({className:u,...e},t)=>D.jsx("th",{ref:t,className:Pe("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",u),...e}));H6.displayName="TableHead";const af=k.forwardRef(({className:u,...e},t)=>D.jsx("td",{ref:t,className:Pe("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",u),...e}));af.displayName="TableCell";const esa=k.forwardRef(({className:u,...e},t)=>D.jsx("caption",{ref:t,className:Pe("text-muted-foreground mt-4 text-sm",u),...e}));esa.displayName="TableCaption";const Zu=k.forwardRef(({className:u,tooltip:e,...t},a)=>D.jsxs(Ir,{children:[D.jsx(Kr,{asChild:!0,children:D.jsx(Et,{ref:a,className:Pe("decoration-primary/20 underline decoration-dashed underline-offset-4",u),...t})}),D.jsx(yr,{side:"right",align:"center",sideOffset:12,className:"max-w-xs break-words",children:e})]}));Zu.displayName="FormLabelWithTooltip";const h1=k.forwardRef(({className:u,...e},t)=>D.jsx("p",{ref:t,className:Pe("text-muted-foreground text-[0.8rem]",u),...e}));h1.displayName="FormDescription";const Rt=k.forwardRef(({className:u,...e},t)=>D.jsx("p",{ref:t,className:Pe("text-destructive text-[0.8rem] font-medium",u),...e}));Rt.displayName="FormMessage";const lxe=({children:u})=>D.jsx("div",{className:"space-y-2",children:u}),cxe=Et,usa=X9.pick({parameters:!0,defaultParameters:!0,parameterEnums:!0,defaultCacheKey:!0,defaultCacheTtl:!0,defaultCacheAllInvocations:!0,autoAuth:!0,advanced:!0}),tsa=({step:u,onChange:e})=>{const[t,a]=k.useState(!1),n=ex({mode:"onChange",resolver:ux(usa),defaultValues:{parameters:u.parameters,defaultParameters:u.defaultParameters,parameterEnums:u.parameterEnums,defaultCacheKey:u.defaultCacheKey,defaultCacheTtl:u.defaultCacheTtl,defaultCacheAllInvocations:u.defaultCacheAllInvocations,autoAuth:u.autoAuth,advanced:u.advanced}});function r(d){e({...u,parameters:d.parameters,defaultParameters:d.defaultParameters,parameterEnums:d.parameterEnums,defaultCacheKey:d.defaultCacheKey,defaultCacheTtl:d.defaultCacheTtl,defaultCacheAllInvocations:d.defaultCacheAllInvocations,autoAuth:d.autoAuth,advanced:d.advanced}),a(!1)}k.useEffect(()=>{n.reset({parameters:u.parameters,defaultParameters:u.defaultParameters,parameterEnums:u.parameterEnums,defaultCacheKey:u.defaultCacheKey,defaultCacheTtl:u.defaultCacheTtl,defaultCacheAllInvocations:u.defaultCacheAllInvocations,autoAuth:u.autoAuth,advanced:u.advanced})},[n,t,u]);const{isDirty:i,isValid:o}=n.formState,s=n.watch(),[l,c]=k.useState("");return D.jsxs(Vd,{open:t,onOpenChange:a,children:[D.jsx(Gd,{asChild:!0,children:D.jsxs(ut,{variant:"outline",children:[D.jsx(LMe,{className:"h-4 w-4"}),"Global module settings"]})}),D.jsxs(l4,{children:[D.jsxs(c4,{children:[D.jsx(d4,{children:"Global settings"}),D.jsx(Ud,{children:"Configure global settings for this modules. These settings will apply to all tests that use this module."})]}),D.jsx(tx,{...n,children:D.jsxs("form",{onSubmit:n.handleSubmit(r),className:"space-y-4",children:[D.jsxs(bl,{defaultValue:"parameters",children:[D.jsxs(Ms,{children:[D.jsx(ma,{value:"parameters",children:"Parameters"}),D.jsx(ma,{value:"cache",children:"Cache"})]}),D.jsxs(pa,{value:"parameters",className:"space-y-4",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx(ta,{placeholder:"PARAMETER_NAME",value:l,onChange:d=>c(d.target.value)}),D.jsxs(ut,{variant:"outline",disabled:!l,onClick:()=>{c(""),n.setValue("parameters",[...s.parameters??[],l],{shouldDirty:!0}),n.setValue("defaultParameters",{...s.defaultParameters??{},[l]:""},{shouldDirty:!0})},children:[D.jsx(YD,{}),"Add parameter"]})]}),D.jsx(asa,{value:{parameters:s.parameters,defaultParameters:s.defaultParameters},onChange:d=>{n.setValue("parameters",d.parameters,{shouldDirty:!0}),n.setValue("defaultParameters",d.defaultParameters,{shouldDirty:!0})}})]}),D.jsxs(pa,{value:"cache",className:"space-y-4",children:[D.jsx(Xt,{control:n.control,name:"defaultCacheAllInvocations",render:({field:d})=>D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Force all invocations of this module across your organization to use the cache. A 'Default cache key' must be configured to enable this setting.",children:"Enable caching globally"}),D.jsx(qt,{children:D.jsx("div",{children:D.jsx(T1,{onCheckedChange:E=>{E||n.setValue("autoAuth",!1),d.onChange(E)},checked:d.value??!1})})}),D.jsx(Zt,{})]})}),D.jsx(Xt,{control:n.control,name:"autoAuth",render:({field:d})=>D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Automatically save the current auth state, which includes cookies, local storage, and other data, at the end of the module and write it to the cache. If an invocation hits the cache, automatically load the result into the browser. Can only be enabled if global caching is on.",children:"Treat as auth module"}),D.jsx(qt,{children:D.jsx("div",{children:D.jsx(T1,{disabled:!s.defaultCacheAllInvocations,onCheckedChange:E=>{E||n.setValue("advanced",{cacheInvalidation:void 0}),d.onChange(E)},checked:d.value??!1})})}),D.jsx(Zt,{})]})}),D.jsx(Xt,{control:n.control,name:"advanced.cacheInvalidation",render:({field:d})=>{var E;return D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Automatically invalidate and re-execute the module if the page content does not contain the provided string after loading an auth module's cached state. Useful if you're not sure when your auth TTL will elapse.",children:"Invalidate with page check"}),D.jsx(qt,{children:D.jsx(et,{singleLine:!0,disableLineNumbers:!0,disabled:!s.autoAuth||!s.defaultCacheAllInvocations,value:((E=d.value)==null?void 0:E.type)==="PAGE_CHECK"&&d.value.substring?d.value.substring:"",language:"template-string",onChange:h=>{if(!h){d.onChange(void 0);return}d.onChange({type:"PAGE_CHECK",substring:h})}})}),D.jsx(Zt,{})]})}}),D.jsx(Xt,{control:n.control,name:"defaultCacheKey",render:({field:d})=>D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Default cache key for all invocations of this module that do not have a 'Cache key' option explicitly configured.",children:"Default cache key"}),D.jsx(qt,{children:D.jsx(et,{singleLine:!0,disableLineNumbers:!0,value:d.value||$J,language:"template-string",onChange:E=>{if(!E||E===$J){d.onChange(void 0);return}d.onChange(E)}})}),D.jsx(Zt,{})]})}),D.jsx(Xt,{control:n.control,name:"defaultCacheTtl",render:({field:d})=>D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Default TTL for all invocations of this module that do not have an 'Expiry seconds' option explicitly configured.",children:"Default expiry seconds"}),D.jsx(qt,{children:D.jsx(ta,{type:"number",min:1,value:d.value?Math.floor(d.value/1e3):void 0,onChange:E=>{let h=parseInt(E.target.value);Number.isNaN(h)&&(h=void 0),d.onChange(h===void 0?void 0:h*1e3)}})}),D.jsx(Zt,{})]})})]})]}),D.jsx(L3,{children:D.jsx(ut,{type:"submit",disabled:!i||!o,children:"Save global module settings"})})]})})]})]})},asa=({value:u,onChange:e})=>{var t,a;return D.jsxs(Cie,{children:[D.jsx(yie,{children:D.jsxs(B5,{children:[D.jsx(H6,{children:"Name"}),D.jsx(H6,{className:"w-full",children:"Default value"}),D.jsx(H6,{className:"w-8"})]})}),D.jsxs(bie,{children:[(t=u.parameters)==null?void 0:t.map((n,r)=>{var i;return D.jsxs(B5,{children:[D.jsx(af,{className:"whitespace-nowrap",children:n}),D.jsx(af,{children:D.jsx(et,{singleLine:!0,value:((i=u.defaultParameters)==null?void 0:i[n])||"",language:"template-string",placeholder:"JavaScript expression",onChange:o=>{e({...u,defaultParameters:{...u.defaultParameters,[n]:o}})}})}),D.jsx(af,{children:D.jsx(ut,{variant:"ghost",size:"smIcon",className:"text-destructive hover:text-destructive hover:bg-transparent",onClick:()=>{var s;const o={...u.defaultParameters};delete o[n],e({...u,parameters:(s=u.parameters)==null?void 0:s.filter(l=>l!==n),defaultParameters:o})},children:D.jsx(XD,{className:"h-4 w-4"})})})]},r)}),(a=u.parameters)!=null&&a.length?null:D.jsx(B5,{children:D.jsx(af,{colSpan:3,className:"h-24 text-center",children:"No parameters."})})]})]})};var dY={exports:{}},vr={},EY={exports:{}},mx={};function MJe(){var u={};return u["align-content"]=!1,u["align-items"]=!1,u["align-self"]=!1,u["alignment-adjust"]=!1,u["alignment-baseline"]=!1,u.all=!1,u["anchor-point"]=!1,u.animation=!1,u["animation-delay"]=!1,u["animation-direction"]=!1,u["animation-duration"]=!1,u["animation-fill-mode"]=!1,u["animation-iteration-count"]=!1,u["animation-name"]=!1,u["animation-play-state"]=!1,u["animation-timing-function"]=!1,u.azimuth=!1,u["backface-visibility"]=!1,u.background=!0,u["background-attachment"]=!0,u["background-clip"]=!0,u["background-color"]=!0,u["background-image"]=!0,u["background-origin"]=!0,u["background-position"]=!0,u["background-repeat"]=!0,u["background-size"]=!0,u["baseline-shift"]=!1,u.binding=!1,u.bleed=!1,u["bookmark-label"]=!1,u["bookmark-level"]=!1,u["bookmark-state"]=!1,u.border=!0,u["border-bottom"]=!0,u["border-bottom-color"]=!0,u["border-bottom-left-radius"]=!0,u["border-bottom-right-radius"]=!0,u["border-bottom-style"]=!0,u["border-bottom-width"]=!0,u["border-collapse"]=!0,u["border-color"]=!0,u["border-image"]=!0,u["border-image-outset"]=!0,u["border-image-repeat"]=!0,u["border-image-slice"]=!0,u["border-image-source"]=!0,u["border-image-width"]=!0,u["border-left"]=!0,u["border-left-color"]=!0,u["border-left-style"]=!0,u["border-left-width"]=!0,u["border-radius"]=!0,u["border-right"]=!0,u["border-right-color"]=!0,u["border-right-style"]=!0,u["border-right-width"]=!0,u["border-spacing"]=!0,u["border-style"]=!0,u["border-top"]=!0,u["border-top-color"]=!0,u["border-top-left-radius"]=!0,u["border-top-right-radius"]=!0,u["border-top-style"]=!0,u["border-top-width"]=!0,u["border-width"]=!0,u.bottom=!1,u["box-decoration-break"]=!0,u["box-shadow"]=!0,u["box-sizing"]=!0,u["box-snap"]=!0,u["box-suppress"]=!0,u["break-after"]=!0,u["break-before"]=!0,u["break-inside"]=!0,u["caption-side"]=!1,u.chains=!1,u.clear=!0,u.clip=!1,u["clip-path"]=!1,u["clip-rule"]=!1,u.color=!0,u["color-interpolation-filters"]=!0,u["column-count"]=!1,u["column-fill"]=!1,u["column-gap"]=!1,u["column-rule"]=!1,u["column-rule-color"]=!1,u["column-rule-style"]=!1,u["column-rule-width"]=!1,u["column-span"]=!1,u["column-width"]=!1,u.columns=!1,u.contain=!1,u.content=!1,u["counter-increment"]=!1,u["counter-reset"]=!1,u["counter-set"]=!1,u.crop=!1,u.cue=!1,u["cue-after"]=!1,u["cue-before"]=!1,u.cursor=!1,u.direction=!1,u.display=!0,u["display-inside"]=!0,u["display-list"]=!0,u["display-outside"]=!0,u["dominant-baseline"]=!1,u.elevation=!1,u["empty-cells"]=!1,u.filter=!1,u.flex=!1,u["flex-basis"]=!1,u["flex-direction"]=!1,u["flex-flow"]=!1,u["flex-grow"]=!1,u["flex-shrink"]=!1,u["flex-wrap"]=!1,u.float=!1,u["float-offset"]=!1,u["flood-color"]=!1,u["flood-opacity"]=!1,u["flow-from"]=!1,u["flow-into"]=!1,u.font=!0,u["font-family"]=!0,u["font-feature-settings"]=!0,u["font-kerning"]=!0,u["font-language-override"]=!0,u["font-size"]=!0,u["font-size-adjust"]=!0,u["font-stretch"]=!0,u["font-style"]=!0,u["font-synthesis"]=!0,u["font-variant"]=!0,u["font-variant-alternates"]=!0,u["font-variant-caps"]=!0,u["font-variant-east-asian"]=!0,u["font-variant-ligatures"]=!0,u["font-variant-numeric"]=!0,u["font-variant-position"]=!0,u["font-weight"]=!0,u.grid=!1,u["grid-area"]=!1,u["grid-auto-columns"]=!1,u["grid-auto-flow"]=!1,u["grid-auto-rows"]=!1,u["grid-column"]=!1,u["grid-column-end"]=!1,u["grid-column-start"]=!1,u["grid-row"]=!1,u["grid-row-end"]=!1,u["grid-row-start"]=!1,u["grid-template"]=!1,u["grid-template-areas"]=!1,u["grid-template-columns"]=!1,u["grid-template-rows"]=!1,u["hanging-punctuation"]=!1,u.height=!0,u.hyphens=!1,u.icon=!1,u["image-orientation"]=!1,u["image-resolution"]=!1,u["ime-mode"]=!1,u["initial-letters"]=!1,u["inline-box-align"]=!1,u["justify-content"]=!1,u["justify-items"]=!1,u["justify-self"]=!1,u.left=!1,u["letter-spacing"]=!0,u["lighting-color"]=!0,u["line-box-contain"]=!1,u["line-break"]=!1,u["line-grid"]=!1,u["line-height"]=!1,u["line-snap"]=!1,u["line-stacking"]=!1,u["line-stacking-ruby"]=!1,u["line-stacking-shift"]=!1,u["line-stacking-strategy"]=!1,u["list-style"]=!0,u["list-style-image"]=!0,u["list-style-position"]=!0,u["list-style-type"]=!0,u.margin=!0,u["margin-bottom"]=!0,u["margin-left"]=!0,u["margin-right"]=!0,u["margin-top"]=!0,u["marker-offset"]=!1,u["marker-side"]=!1,u.marks=!1,u.mask=!1,u["mask-box"]=!1,u["mask-box-outset"]=!1,u["mask-box-repeat"]=!1,u["mask-box-slice"]=!1,u["mask-box-source"]=!1,u["mask-box-width"]=!1,u["mask-clip"]=!1,u["mask-image"]=!1,u["mask-origin"]=!1,u["mask-position"]=!1,u["mask-repeat"]=!1,u["mask-size"]=!1,u["mask-source-type"]=!1,u["mask-type"]=!1,u["max-height"]=!0,u["max-lines"]=!1,u["max-width"]=!0,u["min-height"]=!0,u["min-width"]=!0,u["move-to"]=!1,u["nav-down"]=!1,u["nav-index"]=!1,u["nav-left"]=!1,u["nav-right"]=!1,u["nav-up"]=!1,u["object-fit"]=!1,u["object-position"]=!1,u.opacity=!1,u.order=!1,u.orphans=!1,u.outline=!1,u["outline-color"]=!1,u["outline-offset"]=!1,u["outline-style"]=!1,u["outline-width"]=!1,u.overflow=!1,u["overflow-wrap"]=!1,u["overflow-x"]=!1,u["overflow-y"]=!1,u.padding=!0,u["padding-bottom"]=!0,u["padding-left"]=!0,u["padding-right"]=!0,u["padding-top"]=!0,u.page=!1,u["page-break-after"]=!1,u["page-break-before"]=!1,u["page-break-inside"]=!1,u["page-policy"]=!1,u.pause=!1,u["pause-after"]=!1,u["pause-before"]=!1,u.perspective=!1,u["perspective-origin"]=!1,u.pitch=!1,u["pitch-range"]=!1,u["play-during"]=!1,u.position=!1,u["presentation-level"]=!1,u.quotes=!1,u["region-fragment"]=!1,u.resize=!1,u.rest=!1,u["rest-after"]=!1,u["rest-before"]=!1,u.richness=!1,u.right=!1,u.rotation=!1,u["rotation-point"]=!1,u["ruby-align"]=!1,u["ruby-merge"]=!1,u["ruby-position"]=!1,u["shape-image-threshold"]=!1,u["shape-outside"]=!1,u["shape-margin"]=!1,u.size=!1,u.speak=!1,u["speak-as"]=!1,u["speak-header"]=!1,u["speak-numeral"]=!1,u["speak-punctuation"]=!1,u["speech-rate"]=!1,u.stress=!1,u["string-set"]=!1,u["tab-size"]=!1,u["table-layout"]=!1,u["text-align"]=!0,u["text-align-last"]=!0,u["text-combine-upright"]=!0,u["text-decoration"]=!0,u["text-decoration-color"]=!0,u["text-decoration-line"]=!0,u["text-decoration-skip"]=!0,u["text-decoration-style"]=!0,u["text-emphasis"]=!0,u["text-emphasis-color"]=!0,u["text-emphasis-position"]=!0,u["text-emphasis-style"]=!0,u["text-height"]=!0,u["text-indent"]=!0,u["text-justify"]=!0,u["text-orientation"]=!0,u["text-overflow"]=!0,u["text-shadow"]=!0,u["text-space-collapse"]=!0,u["text-transform"]=!0,u["text-underline-position"]=!0,u["text-wrap"]=!0,u.top=!1,u.transform=!1,u["transform-origin"]=!1,u["transform-style"]=!1,u.transition=!1,u["transition-delay"]=!1,u["transition-duration"]=!1,u["transition-property"]=!1,u["transition-timing-function"]=!1,u["unicode-bidi"]=!1,u["vertical-align"]=!1,u.visibility=!1,u["voice-balance"]=!1,u["voice-duration"]=!1,u["voice-family"]=!1,u["voice-pitch"]=!1,u["voice-range"]=!1,u["voice-rate"]=!1,u["voice-stress"]=!1,u["voice-volume"]=!1,u.volume=!1,u["white-space"]=!1,u.widows=!1,u.width=!0,u["will-change"]=!1,u["word-break"]=!0,u["word-spacing"]=!0,u["word-wrap"]=!0,u["wrap-flow"]=!1,u["wrap-through"]=!1,u["writing-mode"]=!1,u["z-index"]=!1,u}function nsa(u,e,t){}function rsa(u,e,t){}var isa=/javascript\s*\:/img;function osa(u,e){return isa.test(e)?"":e}mx.whiteList=MJe();mx.getDefaultWhiteList=MJe;mx.onAttr=nsa;mx.onIgnoreAttr=rsa;mx.safeAttrValue=osa;var ssa={indexOf:function(u,e){var t,a;if(Array.prototype.indexOf)return u.indexOf(e);for(t=0,a=u.length;t<a;t++)if(u[t]===e)return t;return-1},forEach:function(u,e,t){var a,n;if(Array.prototype.forEach)return u.forEach(e,t);for(a=0,n=u.length;a<n;a++)e.call(t,u[a],a,u)},trim:function(u){return String.prototype.trim?u.trim():u.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(u){return String.prototype.trimRight?u.trimRight():u.replace(/(\s*$)/g,"")}},gb=ssa;function lsa(u,e){u=gb.trimRight(u),u[u.length-1]!==";"&&(u+=";");var t=u.length,a=!1,n=0,r=0,i="";function o(){if(!a){var c=gb.trim(u.slice(n,r)),d=c.indexOf(":");if(d!==-1){var E=gb.trim(c.slice(0,d)),h=gb.trim(c.slice(d+1));if(E){var f=e(n,i.length,E,h,c);f&&(i+=f+"; ")}}}n=r+1}for(;r<t;r++){var s=u[r];if(s==="/"&&u[r+1]==="*"){var l=u.indexOf("*/",r+2);if(l===-1)break;r=l+1,n=r+1,a=!1}else s==="("?a=!0:s===")"?a=!1:s===";"?a||o():s===`
|
|
929
|
+
*/function IDe(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(u);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(u,n).enumerable})),t.push.apply(t,a)}return t}function KDe(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?IDe(Object(t),!0).forEach(function(a){M0a(u,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):IDe(Object(t)).forEach(function(a){Object.defineProperty(u,a,Object.getOwnPropertyDescriptor(t,a))})}return u}function M0a(u,e,t){return e=j0a(e),e in u?Object.defineProperty(u,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):u[e]=t,u}function P0a(u,e){if(typeof u!="object"||u===null)return u;var t=u[Symbol.toPrimitive];if(t!==void 0){var a=t.call(u,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function j0a(u){var e=P0a(u,"string");return typeof e=="symbol"?e:String(e)}var HDe={activateTrap:function(e,t){if(e.length>0){var a=e[e.length-1];a!==t&&a.pause()}var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var a=e.indexOf(t);a!==-1&&e.splice(a,1),e.length>0&&e[e.length-1].unpause()}},N0a=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},R0a=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},gF=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},L0a=function(e){return gF(e)&&!e.shiftKey},$0a=function(e){return gF(e)&&e.shiftKey},VDe=function(e){return setTimeout(e,0)},GDe=function(e,t){var a=-1;return e.every(function(n,r){return t(n)?(a=r,!1):!0}),a},pb=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];return typeof e=="function"?e.apply(void 0,a):e},Hw=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},I0a=[],K0a=function(e,t){var a=(t==null?void 0:t.document)||document,n=(t==null?void 0:t.trapStack)||I0a,r=KDe({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:L0a,isKeyBackward:$0a},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(A,S,w){return A&&A[S]!==void 0?A[S]:r[w||S]},l=function(A,S){var w=typeof(S==null?void 0:S.composedPath)=="function"?S.composedPath():void 0;return i.containerGroups.findIndex(function(_){var j=_.container,K=_.tabbableNodes;return j.contains(A)||(w==null?void 0:w.includes(j))||K.find(function(M){return M===A})})},c=function(A){var S=r[A];if(typeof S=="function"){for(var w=arguments.length,_=new Array(w>1?w-1:0),j=1;j<w;j++)_[j-1]=arguments[j];S=S.apply(void 0,_)}if(S===!0&&(S=void 0),!S){if(S===void 0||S===!1)return S;throw new Error("`".concat(A,"` was specified but was not a node, or did not return a node"))}var K=S;if(typeof S=="string"&&(K=a.querySelector(S),!K))throw new Error("`".concat(A,"` as selector refers to no known node"));return K},d=function(){var A=c("initialFocus");if(A===!1)return!1;if(A===void 0||!Sz(A,r.tabbableOptions))if(l(a.activeElement)>=0)A=a.activeElement;else{var S=i.tabbableGroups[0],w=S&&S.firstTabbableNode;A=w||c("fallbackFocus")}if(!A)throw new Error("Your focus-trap needs to have at least one focusable element");return A},E=function(){if(i.containerGroups=i.containers.map(function(A){var S=tJe(A,r.tabbableOptions),w=aJe(A,r.tabbableOptions),_=S.length>0?S[0]:void 0,j=S.length>0?S[S.length-1]:void 0,K=w.find(function(G){return gp(G)}),M=w.slice().reverse().find(function(G){return gp(G)}),L=!!S.find(function(G){return Kh(G)>0});return{container:A,tabbableNodes:S,focusableNodes:w,posTabIndexesFound:L,firstTabbableNode:_,lastTabbableNode:j,firstDomTabbableNode:K,lastDomTabbableNode:M,nextTabbableNode:function(V){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,I=S.indexOf(V);return I<0?R?w.slice(w.indexOf(V)+1).find(function(U){return gp(U)}):w.slice(0,w.indexOf(V)).reverse().find(function(U){return gp(U)}):S[I+(R?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(A){return A.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(A){return A.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function z(A){var S=A.activeElement;if(S)return S.shadowRoot&&S.shadowRoot.activeElement!==null?z(S.shadowRoot):S},f=function z(A){if(A!==!1&&A!==h(document)){if(!A||!A.focus){z(d());return}A.focus({preventScroll:!!r.preventScroll}),i.mostRecentlyFocusedNode=A,N0a(A)&&A.select()}},m=function(A){var S=c("setReturnFocus",A);return S||(S===!1?!1:A)},p=function(A){var S=A.target,w=A.event,_=A.isBackward,j=_===void 0?!1:_;S=S||Hw(w),E();var K=null;if(i.tabbableGroups.length>0){var M=l(S,w),L=M>=0?i.containerGroups[M]:void 0;if(M<0)j?K=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:K=i.tabbableGroups[0].firstTabbableNode;else if(j){var G=GDe(i.tabbableGroups,function($){var q=$.firstTabbableNode;return S===q});if(G<0&&(L.container===S||Sz(S,r.tabbableOptions)&&!gp(S,r.tabbableOptions)&&!L.nextTabbableNode(S,!1))&&(G=M),G>=0){var V=G===0?i.tabbableGroups.length-1:G-1,R=i.tabbableGroups[V];K=Kh(S)>=0?R.lastTabbableNode:R.lastDomTabbableNode}else gF(w)||(K=L.nextTabbableNode(S,!1))}else{var I=GDe(i.tabbableGroups,function($){var q=$.lastTabbableNode;return S===q});if(I<0&&(L.container===S||Sz(S,r.tabbableOptions)&&!gp(S,r.tabbableOptions)&&!L.nextTabbableNode(S))&&(I=M),I>=0){var U=I===i.tabbableGroups.length-1?0:I+1,W=i.tabbableGroups[U];K=Kh(S)>=0?W.firstTabbableNode:W.firstDomTabbableNode}else gF(w)||(K=L.nextTabbableNode(S))}}else K=c("fallbackFocus");return K},x=function(A){var S=Hw(A);if(!(l(S,A)>=0)){if(pb(r.clickOutsideDeactivates,A)){o.deactivate({returnFocus:r.returnFocusOnDeactivate});return}pb(r.allowOutsideClick,A)||A.preventDefault()}},g=function(A){var S=Hw(A),w=l(S,A)>=0;if(w||S instanceof Document)w&&(i.mostRecentlyFocusedNode=S);else{A.stopImmediatePropagation();var _,j=!0;if(i.mostRecentlyFocusedNode)if(Kh(i.mostRecentlyFocusedNode)>0){var K=l(i.mostRecentlyFocusedNode),M=i.containerGroups[K].tabbableNodes;if(M.length>0){var L=M.findIndex(function(G){return G===i.mostRecentlyFocusedNode});L>=0&&(r.isKeyForward(i.recentNavEvent)?L+1<M.length&&(_=M[L+1],j=!1):L-1>=0&&(_=M[L-1],j=!1))}}else i.containerGroups.some(function(G){return G.tabbableNodes.some(function(V){return Kh(V)>0})})||(j=!1);else j=!1;j&&(_=p({target:i.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(i.recentNavEvent)})),f(_||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},v=function(A){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=A;var w=p({event:A,isBackward:S});w&&(gF(A)&&A.preventDefault(),f(w))},C=function(A){if(R0a(A)&&pb(r.escapeDeactivates,A)!==!1){A.preventDefault(),o.deactivate();return}(r.isKeyForward(A)||r.isKeyBackward(A))&&v(A,r.isKeyBackward(A))},y=function(A){var S=Hw(A);l(S,A)>=0||pb(r.clickOutsideDeactivates,A)||pb(r.allowOutsideClick,A)||(A.preventDefault(),A.stopImmediatePropagation())},b=function(){if(i.active)return HDe.activateTrap(n,o),i.delayInitialFocusTimer=r.delayInitialFocus?VDe(function(){f(d())}):f(d()),a.addEventListener("focusin",g,!0),a.addEventListener("mousedown",x,{capture:!0,passive:!1}),a.addEventListener("touchstart",x,{capture:!0,passive:!1}),a.addEventListener("click",y,{capture:!0,passive:!1}),a.addEventListener("keydown",C,{capture:!0,passive:!1}),o},F=function(){if(i.active)return a.removeEventListener("focusin",g,!0),a.removeEventListener("mousedown",x,!0),a.removeEventListener("touchstart",x,!0),a.removeEventListener("click",y,!0),a.removeEventListener("keydown",C,!0),o},O=function(A){var S=A.some(function(w){var _=Array.from(w.removedNodes);return _.some(function(j){return j===i.mostRecentlyFocusedNode})});S&&f(d())},T=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(O):void 0,P=function(){T&&(T.disconnect(),i.active&&!i.paused&&i.containers.map(function(A){T.observe(A,{subtree:!0,childList:!0})}))};return o={get active(){return i.active},get paused(){return i.paused},activate:function(A){if(i.active)return this;var S=s(A,"onActivate"),w=s(A,"onPostActivate"),_=s(A,"checkCanFocusTrap");_||E(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=a.activeElement,S==null||S();var j=function(){_&&E(),b(),P(),w==null||w()};return _?(_(i.containers.concat()).then(j,j),this):(j(),this)},deactivate:function(A){if(!i.active)return this;var S=KDe({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},A);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,F(),i.active=!1,i.paused=!1,P(),HDe.deactivateTrap(n,o);var w=s(S,"onDeactivate"),_=s(S,"onPostDeactivate"),j=s(S,"checkCanReturnFocus"),K=s(S,"returnFocus","returnFocusOnDeactivate");w==null||w();var M=function(){VDe(function(){K&&f(m(i.nodeFocusedBeforeActivation)),_==null||_()})};return K&&j?(j(m(i.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(A){if(i.paused||!i.active)return this;var S=s(A,"onPause"),w=s(A,"onPostPause");return i.paused=!0,S==null||S(),F(),P(),w==null||w(),this},unpause:function(A){if(!i.paused||!i.active)return this;var S=s(A,"onUnpause"),w=s(A,"onPostUnpause");return i.paused=!1,S==null||S(),E(),b(),P(),w==null||w(),this},updateContainerElements:function(A){var S=[].concat(A).filter(Boolean);return i.containers=S.map(function(w){return typeof w=="string"?a.querySelector(w):w}),i.active&&E(),P(),this}},o.updateContainerElements(e),o};const H0a=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:K0a},Symbol.toStringTag,{value:"Module"})),V0a=Vl(H0a),G0a=Vl(T0a);function E2(u){"@babel/helpers - typeof";return E2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E2(u)}function U0a(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function UDe(u,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(u,nJe(a.key),a)}}function W0a(u,e,t){return e&&UDe(u.prototype,e),t&&UDe(u,t),Object.defineProperty(u,"prototype",{writable:!1}),u}function J0a(u,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(e&&e.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),e&&ZQ(u,e)}function ZQ(u,e){return ZQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},ZQ(u,e)}function q0a(u){var e=Q0a();return function(){var a=qM(u),n;if(e){var r=qM(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Z0a(this,n)}}function Z0a(u,e){if(e&&(E2(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ek(u)}function Ek(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function Q0a(){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}}function qM(u){return qM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qM(u)}function Y0a(u,e,t){return e=nJe(e),e in u?Object.defineProperty(u,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):u[e]=t,u}function nJe(u){var e=X0a(u,"string");return E2(e)==="symbol"?e:String(e)}function X0a(u,e){if(E2(u)!=="object"||u===null)return u;var t=u[Symbol.toPrimitive];if(t!==void 0){var a=t.call(u,e||"default");if(E2(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}var Vw=k,xt=BR,eia=V0a,uia=eia.createFocusTrap,tia=G0a,aia=tia.isFocusable,fie=function(u){J0a(t,u);var e=q0a(t);function t(a){var n;U0a(this,t),n=e.call(this,a),Y0a(Ek(n),"getNodeForOption",function(o){var s,l=(s=this.internalOptions[o])!==null&&s!==void 0?s:this.originalOptions[o];if(typeof l=="function"){for(var c=arguments.length,d=new Array(c>1?c-1:0),E=1;E<c;E++)d[E-1]=arguments[E];l=l.apply(void 0,d)}if(l===!0&&(l=void 0),!l){if(l===void 0||l===!1)return l;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var h=l;if(typeof l=="string"){var f;if(h=(f=this.getDocument())===null||f===void 0?void 0:f.querySelector(l),!h)throw new Error("`".concat(o,"` as selector refers to no known node"))}return h}),n.handleDeactivate=n.handleDeactivate.bind(Ek(n)),n.handlePostDeactivate=n.handlePostDeactivate.bind(Ek(n)),n.handleClickOutsideDeactivates=n.handleClickOutsideDeactivates.bind(Ek(n)),n.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:n.handleDeactivate,onPostDeactivate:n.handlePostDeactivate,clickOutsideDeactivates:n.handleClickOutsideDeactivates},n.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var r=a.focusTrapOptions;for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){if(i==="returnFocusOnDeactivate"||i==="onDeactivate"||i==="onPostDeactivate"||i==="checkCanReturnFocus"||i==="clickOutsideDeactivates"){n.originalOptions[i]=r[i];continue}n.internalOptions[i]=r[i]}return n.outsideClick=null,n.focusTrapElements=a.containerElements||[],n.updatePreviousElement(),n}return W0a(t,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var n=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return n||(n===!1?!1:this.previouslyFocusedElement)}},{key:"updatePreviousElement",value:function(){var n=this.getDocument();n&&(this.previouslyFocusedElement=n.activeElement)}},{key:"deactivateTrap",value:function(){!this.focusTrap||!this.focusTrap.active||this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(n){var r=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,n):this.originalOptions.clickOutsideDeactivates;return r&&(this.outsideClick={target:n.target,allowDeactivation:r}),r}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var n=this,r=function(){var o=n.getReturnFocusNode(),s=!!(n.originalOptions.returnFocusOnDeactivate&&o!==null&&o!==void 0&&o.focus&&(!n.outsideClick||n.outsideClick.allowDeactivation&&!aia(n.outsideClick.target,n.internalOptions.tabbableOptions))),l=n.internalOptions.preventScroll,c=l===void 0?!1:l;s&&o.focus({preventScroll:c}),n.originalOptions.onPostDeactivate&&n.originalOptions.onPostDeactivate.call(null),n.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(r,r):r()}},{key:"setupFocusTrap",value:function(){if(this.focusTrap)this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause());else{var n=this.focusTrapElements.some(Boolean);n&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(n){if(this.focusTrap){n.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var r=!n.active&&this.props.active,i=n.active&&!this.props.active,o=!n.paused&&this.props.paused,s=n.paused&&!this.props.paused;if(r&&(this.updatePreviousElement(),this.focusTrap.activate()),i){this.deactivateTrap();return}o&&this.focusTrap.pause(),s&&this.focusTrap.unpause()}else n.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var n=this,r=this.props.children?Vw.Children.only(this.props.children):void 0;if(r){if(r.type&&r.type===Vw.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");var i=function(l){var c=n.props.containerElements;r&&(typeof r.ref=="function"?r.ref(l):r.ref&&(r.ref.current=l)),n.focusTrapElements=c||[l]},o=Vw.cloneElement(r,{ref:i});return o}return null}}]),t}(Vw.Component),Db=typeof Element>"u"?Function:Element;fie.propTypes={active:xt.bool,paused:xt.bool,focusTrapOptions:xt.shape({document:xt.object,onActivate:xt.func,onPostActivate:xt.func,checkCanFocusTrap:xt.func,onPause:xt.func,onPostPause:xt.func,onUnpause:xt.func,onPostUnpause:xt.func,onDeactivate:xt.func,onPostDeactivate:xt.func,checkCanReturnFocus:xt.func,initialFocus:xt.oneOfType([xt.instanceOf(Db),xt.string,xt.bool,xt.func]),fallbackFocus:xt.oneOfType([xt.instanceOf(Db),xt.string,xt.func]),escapeDeactivates:xt.oneOfType([xt.bool,xt.func]),clickOutsideDeactivates:xt.oneOfType([xt.bool,xt.func]),returnFocusOnDeactivate:xt.bool,setReturnFocus:xt.oneOfType([xt.instanceOf(Db),xt.string,xt.bool,xt.func]),allowOutsideClick:xt.oneOfType([xt.bool,xt.func]),preventScroll:xt.bool,tabbableOptions:xt.shape({displayCheck:xt.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:xt.oneOfType([xt.bool,xt.func])}),trapStack:xt.array,isKeyForward:xt.func,isKeyBackward:xt.func}),containerElements:xt.arrayOf(xt.instanceOf(Db)),children:xt.oneOfType([xt.element,xt.instanceOf(Db)])};fie.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:uia};var nia=fie;const ria=ea(nia),iia=u=>{const e=k.useRef(null),t=ia(()=>{var o;(o=u.onActiveChange)==null||o.call(u,!1)}),a=o=>{const s=e.current;if(!s)return;const{left:l,top:c,width:d,height:E}=s.getBoundingClientRect(),h=o.clientX-l,f=o.clientY-c,m=h/d,p=f/E;return{x:h,y:f,pctX:m,pctY:p}},n=ia(o=>{var s;u.active&&(o.preventDefault(),(s=u.onKeyDown)==null||s.call(u,o.key))}),r=ia(o=>{var s;u.active&&(o.preventDefault(),(s=u.onKeyUp)==null||s.call(u,o.key))}),i=ia(o=>{var h;if(!u.active)return;o.preventDefault();const s=e.current;if(!s)return;const{offsetHeight:l,offsetWidth:c}=s,{deltaX:d,deltaY:E}=o;(h=u.onWheel)==null||h.call(u,{deltaX:d,deltaY:E,pctDeltaX:d/c,pctDeltaY:E/l})});return k.useEffect(()=>(window.addEventListener("keydown",n),()=>{window.removeEventListener("keydown",n)}),[n]),k.useEffect(()=>(window.addEventListener("keyup",r),()=>{window.removeEventListener("keyup",r)}),[r]),k.useEffect(()=>{if(!e.current)return;const o=e.current;return o.addEventListener("wheel",i,{passive:!1}),()=>{o.removeEventListener("wheel",i)}},[i]),D.jsx(ria,{active:u.active,focusTrapOptions:{escapeDeactivates:!1,clickOutsideDeactivates:!0,onDeactivate:t},children:D.jsxs("div",{ref:e,className:"group relative",tabIndex:u.active?0:-1,onMouseDown:o=>{var l;if(!u.active)return;const s=a(o);s&&((l=u.onMouseEvent)==null||l.call(u,{event:"down",...s}))},onMouseUp:o=>{var l;if(!u.active)return;const s=a(o);s&&((l=u.onMouseEvent)==null||l.call(u,{event:"up",...s}))},onMouseMove:o=>{var l;if(!u.active)return;const s=a(o);s&&((l=u.onMouseEvent)==null||l.call(u,{event:"move",...s}))},children:[D.jsx("input",{className:"absolute h-0 w-0"}),u.active?null:D.jsx("div",{className:"bg-foreground absolute inset-0 flex cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-50",onClick:()=>{var o;return(o=u.onActiveChange)==null?void 0:o.call(u,!0)},children:D.jsx("h2",{className:"text-background text-xl font-semibold",children:"Click to turn on interactive mode"})}),u.active?D.jsx("div",{className:"shadow-frame pointer-events-none absolute inset-0 shadow-red-500"}):null,u.active?D.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 flex items-center justify-center",children:D.jsx("div",{className:"text-background bg-red-500 p-1 text-xs",children:"You are in interactive mode. Click away to exit."})}):null,u.children]})})},rJe=({aiSuggestibleCommandsOnly:u,onSelect:e,open:t,onOpenChange:a,modules:n,hideModules:r,children:i})=>{const[o,s]=k.useState(""),l=oia({aiSuggestibleCommandsOnly:u}),c=k.useMemo(()=>l.map(x=>({type:"STEP",name:Tae[x],description:HFu[x],onSelect:()=>{if(KFu(x)){e==null||e({type:Fe.PRESET_ACTION,command:x});return}e==null||e({type:x})}})),[e,l]),d=k.useMemo(()=>n.map(x=>({type:"MODULE",name:x.fileName||Cwe(x.name),containingFolderPath:x.containingFolderPath,description:x.description||void 0,onSelect:()=>{e==null||e({...x,type:"RESOLVED_MODULE"})}})),[n,e]),E=k.useMemo(()=>new dx([...d,...c],{keys:[{name:"name",weight:1},{name:"description",weight:.8},{name:"containingFolderPath",weight:.6}],threshold:.4,includeScore:!0,findAllMatches:!0,ignoreLocation:!0,useExtendedSearch:!0,shouldSort:!0,includeMatches:!0,distance:100,ignoreFieldNorm:!1}),[d,c]),h=k.useMemo(()=>{const x=o.trim().replace(/-/g," ");if(!x)return[...c,...d];const g=x.toLowerCase().split(/\s+/);return g.push(x),E.search({$and:g.map(C=>({$or:[{name:C},{description:C},{containingFolderPath:C}]}))}).map(C=>C.item)},[E,d,o,c]),f=k.useMemo(()=>h.filter(x=>x.type==="STEP"),[h]),m=k.useMemo(()=>h.filter(x=>x.type==="MODULE"),[h]),p=k.useRef(null);return k.useEffect(()=>{t||s("")},[t]),D.jsxs(pRt,{open:t,onOpenChange:a,trigger:i,commandProps:{shouldFilter:!1},dialogContentProps:{className:"max-w-2xl translate-y-0 top-[20%] data-[state=closed]:!slide-out-to-top-[0%] data-[state=open]:!slide-in-from-top-[0%]"},children:[D.jsx(PC,{ref:p,autoFocus:!0,placeholder:"Search by describing what you want to do...",value:o,onValueChange:x=>{s(x)}}),D.jsxs(bl,{defaultValue:"steps",onValueChange:()=>{window.setTimeout(()=>{var x;(x=p.current)==null||x.focus()},0)},children:[D.jsxs(Ms,{className:"m-2",children:[D.jsx(ma,{value:"all",children:"All"}),D.jsx(ma,{value:"steps",children:"Steps"}),r?null:D.jsx(ma,{value:"modules",children:"Modules"})]}),D.jsx(pa,{value:"all",className:"border-border mt-0 border-t",children:D.jsxs(kf,{className:"max-h-[500px]",children:[h.length?null:D.jsx(Ff,{children:"No items found."}),h.length?h.map(x=>D.jsx(H1,{onSelect:x.onSelect,children:D.jsxs("div",{children:[D.jsxs("div",{className:"text-base font-medium",children:[x.name,x.type==="MODULE"&&x.containingFolderPath?D.jsx("span",{className:"text-muted-foreground ml-1 text-sm font-normal",children:x.containingFolderPath}):null]}),D.jsx("div",{className:"text-muted-foreground text-sm",children:x.description})]})},x.name)):null]})}),D.jsx(pa,{value:"steps",className:"border-border mt-0 border-t",children:D.jsxs(kf,{className:"max-h-[500px]",children:[f.length?null:D.jsx(Ff,{children:"No steps found."}),f.length?f.map(x=>D.jsx(H1,{onSelect:x.onSelect,children:D.jsxs("div",{children:[D.jsx("div",{className:"text-base font-medium",children:x.name}),D.jsx("div",{className:"text-muted-foreground text-sm",children:x.description})]})},x.name)):null]})}),D.jsx(pa,{value:"modules",className:"border-border mt-0 border-t",children:D.jsxs(kf,{className:"max-h-[500px]",children:[m.length?null:D.jsx(Ff,{children:"No modules found."}),m.length?m.map(x=>D.jsx(H1,{onSelect:x.onSelect,children:D.jsxs("div",{children:[D.jsxs("div",{className:"text-base font-medium",children:[x.name,x.type==="MODULE"&&x.containingFolderPath?D.jsx("span",{className:"text-muted-foreground ml-1 text-sm font-normal",children:x.containingFolderPath}):null]}),D.jsx("div",{className:"text-muted-foreground text-sm",children:x.description})]})},x.name)):null]})})]})]})},oia=u=>{const{ai:e}=vre();return k.useMemo(()=>{const t=sia.filter(a=>!lia.has(a));return e!=null&&e.aiAction&&t.push(Fe.AI_ACTION_DYNAMIC),t.filter(a=>a===H.SUCCESS?u.aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly?Xte.options.some(n=>n.shape.type.value===a):!0)},[e==null?void 0:e.aiAction,u.aiSuggestibleCommandsOnly])},sia=[...Object.values(H)];Fe.AI_ACTION+"",Fe.AI_ACTION_DYNAMIC+"",H.AI_ASSERTION+"",H.AI_EXTRACT+"",H.SUCCESS+"",H.AUTH_LOAD+"",H.AUTH_SAVE+"",H.CAPTCHA+"",H.VISUAL_DIFF+"",H.JAVASCRIPT+"",H.ELEMENT_CHECK+"",H.PAGE_CHECK+"",H.CLICK+"",H.DRAG+"",H.FILE_UPLOAD+"",H.SELECT_OPTION+"",H.REQUEST+"",H.GRAPHQL_REQUEST+"",H.TYPE+"",H.PRESS+"",H.KEY_DOWN+"",H.KEY_UP+"",H.NAVIGATE+"",H.DIALOG+"",H.SCROLL_UP+"",H.SCROLL_DOWN+"",H.SCROLL_LEFT+"",H.SCROLL_RIGHT+"",H.GO_BACK+"",H.GO_FORWARD+"",H.WAIT+"",H.WAIT_FOR_URL+"",H.REFRESH+"",H.SWITCH_TAB+"",H.NEW_TAB+"",H.COOKIE+"",H.LOCAL_STORAGE+"",H.HOVER+"",H.FOCUS+"",H.BLUR+"",H.MOUSE_DRAG+"",H.COPY+"",H.PASTE+"",H.REGISTER_REQUEST_LISTENER+"",H.AWAIT_LISTENER+"",H.RECORD_REQUESTS+"",H.GET_RECORDED_REQUESTS+"",H.SET_HEADER+"";const lia=new Set([Fe.AI_ACTION,H.CAPTCHA]),cia=u=>{switch(u.type){case Fe.AI_ACTION:return{type:u.type};case Fe.AI_ACTION_DYNAMIC:return{type:u.type};case Fe.PRESET_ACTION:return{type:u.type,command:u.command.type};case"RESOLVED_MODULE":return u;case Fe.CONDITIONAL:case Fe.SECTION:case Fe.IFRAME:throw new Error("not implemented");default:return(t=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},dia=u=>{switch(u.type){case Fe.AI_ACTION:return Fe.AI_ACTION;case Fe.AI_ACTION_DYNAMIC:return Fe.AI_ACTION_DYNAMIC;case Fe.PRESET_ACTION:return u.command;case"RESOLVED_MODULE":return"RESOLVED_MODULE";default:return(t=>{throw"If Typescript complains about the line below, you missed a case or break in the switch above"})()}},Eia=u=>{const[e,t]=k.useState(!1),a=dia(u.value);return D.jsx(rJe,{open:e,onOpenChange:t,hideModules:u.hideModules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly,modules:u.modules,onSelect:n=>{var r;(r=u.onChange)==null||r.call(u,n),t(!1)},children:D.jsxs(ut,{variant:"outline",role:"combobox",disabled:u.disabled,className:Pe({"pointer-events-none":u.readOnly}),children:[Tae[a],D.jsx(Xae,{className:"h-4 w-4 shrink-0 opacity-50"})]})})},wz=u=>{const[e,t]=k.useState(!1);return D.jsx(rJe,{open:e,onOpenChange:t,hideModules:u.hideModules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly,modules:u.modules,onSelect:a=>{var n;(n=u.onAdd)==null||n.call(u,a),t(!1)},children:u.children??D.jsxs(ut,{variant:"outline",disabled:u.disabled,children:[D.jsx(YD,{className:"h-4 w-4"})," Add new step"]})})};var iJe=Symbol.for("immer-nothing"),WDe=Symbol.for("immer-draftable"),Kl=Symbol.for("immer-state");function M1(u,...e){throw new Error(`[Immer] minified error nr: ${u}. Full error at: https://bit.ly/3cXEKWf`)}var h2=Object.getPrototypeOf;function f2(u){return!!u&&!!u[Kl]}function SD(u){var e;return u?oJe(u)||Array.isArray(u)||!!u[WDe]||!!((e=u.constructor)!=null&&e[WDe])||PL(u)||jL(u):!1}var hia=Object.prototype.constructor.toString();function oJe(u){if(!u||typeof u!="object")return!1;const e=h2(u);if(e===null)return!0;const t=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return t===Object?!0:typeof t=="function"&&Function.toString.call(t)===hia}function ZM(u,e){ML(u)===0?Reflect.ownKeys(u).forEach(t=>{e(t,u[t],u)}):u.forEach((t,a)=>e(a,t,u))}function ML(u){const e=u[Kl];return e?e.type_:Array.isArray(u)?1:PL(u)?2:jL(u)?3:0}function QQ(u,e){return ML(u)===2?u.has(e):Object.prototype.hasOwnProperty.call(u,e)}function sJe(u,e,t){const a=ML(u);a===2?u.set(e,t):a===3?u.add(t):u[e]=t}function fia(u,e){return u===e?u!==0||1/u===1/e:u!==u&&e!==e}function PL(u){return u instanceof Map}function jL(u){return u instanceof Set}function vp(u){return u.copy_||u.base_}function YQ(u,e){if(PL(u))return new Map(u);if(jL(u))return new Set(u);if(Array.isArray(u))return Array.prototype.slice.call(u);const t=oJe(u);if(e===!0||e==="class_only"&&!t){const a=Object.getOwnPropertyDescriptors(u);delete a[Kl];let n=Reflect.ownKeys(a);for(let r=0;r<n.length;r++){const i=n[r],o=a[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(a[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:u[i]})}return Object.create(h2(u),a)}else{const a=h2(u);if(a!==null&&t)return{...u};const n=Object.create(a);return Object.assign(n,u)}}function S7(u,e=!1){return NL(u)||f2(u)||!SD(u)||(ML(u)>1&&(u.set=u.add=u.clear=u.delete=mia),Object.freeze(u),e&&Object.entries(u).forEach(([t,a])=>S7(a,!0))),u}function mia(){M1(2)}function NL(u){return Object.isFrozen(u)}var pia={};function wD(u){const e=pia[u];return e||M1(0,u),e}var w7;function lJe(){return w7}function Dia(u,e){return{drafts_:[],parent_:u,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function JDe(u,e){e&&(wD("Patches"),u.patches_=[],u.inversePatches_=[],u.patchListener_=e)}function XQ(u){eY(u),u.drafts_.forEach(xia),u.drafts_=null}function eY(u){u===w7&&(w7=u.parent_)}function qDe(u){return w7=Dia(w7,u)}function xia(u){const e=u[Kl];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function ZDe(u,e){e.unfinalizedDrafts_=e.drafts_.length;const t=e.drafts_[0];return u!==void 0&&u!==t?(t[Kl].modified_&&(XQ(e),M1(4)),SD(u)&&(u=QM(e,u),e.parent_||YM(e,u)),e.patches_&&wD("Patches").generateReplacementPatches_(t[Kl].base_,u,e.patches_,e.inversePatches_)):u=QM(e,t,[]),XQ(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),u!==iJe?u:void 0}function QM(u,e,t){if(NL(e))return e;const a=e[Kl];if(!a)return ZM(e,(n,r)=>QDe(u,a,e,n,r,t)),e;if(a.scope_!==u)return e;if(!a.modified_)return YM(u,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const n=a.copy_;let r=n,i=!1;a.type_===3&&(r=new Set(n),n.clear(),i=!0),ZM(r,(o,s)=>QDe(u,a,n,o,s,t,i)),YM(u,n,!1),t&&u.patches_&&wD("Patches").generatePatches_(a,t,u.patches_,u.inversePatches_)}return a.copy_}function QDe(u,e,t,a,n,r,i){if(f2(n)){const o=r&&e&&e.type_!==3&&!QQ(e.assigned_,a)?r.concat(a):void 0,s=QM(u,n,o);if(sJe(t,a,s),f2(s))u.canAutoFreeze_=!1;else return}else i&&t.add(n);if(SD(n)&&!NL(n)){if(!u.immer_.autoFreeze_&&u.unfinalizedDrafts_<1)return;QM(u,n),(!e||!e.scope_.parent_)&&typeof a!="symbol"&&Object.prototype.propertyIsEnumerable.call(t,a)&&YM(u,n)}}function YM(u,e,t=!1){!u.parent_&&u.immer_.autoFreeze_&&u.canAutoFreeze_&&S7(e,t)}function gia(u,e){const t=Array.isArray(u),a={type_:t?1:0,scope_:e?e.scope_:lJe(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:u,draft_:null,copy_:null,revoke_:null,isManual_:!1};let n=a,r=mie;t&&(n=[a],r=O7);const{revoke:i,proxy:o}=Proxy.revocable(n,r);return a.draft_=o,a.revoke_=i,o}var mie={get(u,e){if(e===Kl)return u;const t=vp(u);if(!QQ(t,e))return via(u,t,e);const a=t[e];return u.finalized_||!SD(a)?a:a===DV(u.base_,e)?(xV(u),u.copy_[e]=tY(a,u)):a},has(u,e){return e in vp(u)},ownKeys(u){return Reflect.ownKeys(vp(u))},set(u,e,t){const a=cJe(vp(u),e);if(a!=null&&a.set)return a.set.call(u.draft_,t),!0;if(!u.modified_){const n=DV(vp(u),e),r=n==null?void 0:n[Kl];if(r&&r.base_===t)return u.copy_[e]=t,u.assigned_[e]=!1,!0;if(fia(t,n)&&(t!==void 0||QQ(u.base_,e)))return!0;xV(u),uY(u)}return u.copy_[e]===t&&(t!==void 0||e in u.copy_)||Number.isNaN(t)&&Number.isNaN(u.copy_[e])||(u.copy_[e]=t,u.assigned_[e]=!0),!0},deleteProperty(u,e){return DV(u.base_,e)!==void 0||e in u.base_?(u.assigned_[e]=!1,xV(u),uY(u)):delete u.assigned_[e],u.copy_&&delete u.copy_[e],!0},getOwnPropertyDescriptor(u,e){const t=vp(u),a=Reflect.getOwnPropertyDescriptor(t,e);return a&&{writable:!0,configurable:u.type_!==1||e!=="length",enumerable:a.enumerable,value:t[e]}},defineProperty(){M1(11)},getPrototypeOf(u){return h2(u.base_)},setPrototypeOf(){M1(12)}},O7={};ZM(mie,(u,e)=>{O7[u]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});O7.deleteProperty=function(u,e){return O7.set.call(this,u,e,void 0)};O7.set=function(u,e,t){return mie.set.call(this,u[0],e,t,u[0])};function DV(u,e){const t=u[Kl];return(t?vp(t):u)[e]}function via(u,e,t){var n;const a=cJe(e,t);return a?"value"in a?a.value:(n=a.get)==null?void 0:n.call(u.draft_):void 0}function cJe(u,e){if(!(e in u))return;let t=h2(u);for(;t;){const a=Object.getOwnPropertyDescriptor(t,e);if(a)return a;t=h2(t)}}function uY(u){u.modified_||(u.modified_=!0,u.parent_&&uY(u.parent_))}function xV(u){u.copy_||(u.copy_=YQ(u.base_,u.scope_.immer_.useStrictShallowCopy_))}var Cia=class{constructor(u){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,a)=>{if(typeof e=="function"&&typeof t!="function"){const r=t;t=e;const i=this;return function(s=r,...l){return i.produce(s,c=>t.call(this,c,...l))}}typeof t!="function"&&M1(6),a!==void 0&&typeof a!="function"&&M1(7);let n;if(SD(e)){const r=qDe(this),i=tY(e,void 0);let o=!0;try{n=t(i),o=!1}finally{o?XQ(r):eY(r)}return JDe(r,a),ZDe(n,r)}else if(!e||typeof e!="object"){if(n=t(e),n===void 0&&(n=e),n===iJe&&(n=void 0),this.autoFreeze_&&S7(n,!0),a){const r=[],i=[];wD("Patches").generateReplacementPatches_(e,n,r,i),a(r,i)}return n}else M1(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e=="function")return(i,...o)=>this.produceWithPatches(i,s=>e(s,...o));let a,n;return[this.produce(e,t,(i,o)=>{a=i,n=o}),a,n]},typeof(u==null?void 0:u.autoFreeze)=="boolean"&&this.setAutoFreeze(u.autoFreeze),typeof(u==null?void 0:u.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(u.useStrictShallowCopy)}createDraft(u){SD(u)||M1(8),f2(u)&&(u=yia(u));const e=qDe(this),t=tY(u,void 0);return t[Kl].isManual_=!0,eY(e),t}finishDraft(u,e){const t=u&&u[Kl];(!t||!t.isManual_)&&M1(9);const{scope_:a}=t;return JDe(a,e),ZDe(void 0,a)}setAutoFreeze(u){this.autoFreeze_=u}setUseStrictShallowCopy(u){this.useStrictShallowCopy_=u}applyPatches(u,e){let t;for(t=e.length-1;t>=0;t--){const n=e[t];if(n.path.length===0&&n.op==="replace"){u=n.value;break}}t>-1&&(e=e.slice(t+1));const a=wD("Patches").applyPatches_;return f2(u)?a(u,e):this.produce(u,n=>a(n,e))}};function tY(u,e){const t=PL(u)?wD("MapSet").proxyMap_(u,e):jL(u)?wD("MapSet").proxySet_(u,e):gia(u,e);return(e?e.scope_:lJe()).drafts_.push(t),t}function yia(u){return f2(u)||M1(10,u),dJe(u)}function dJe(u){if(!SD(u)||NL(u))return u;const e=u[Kl];let t;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,t=YQ(u,e.scope_.immer_.useStrictShallowCopy_)}else t=YQ(u,!0);return ZM(t,(a,n)=>{sJe(t,a,dJe(n))}),e&&(e.finalized_=!1),t}var Hl=new Cia,EJe=Hl.produce;Hl.produceWithPatches.bind(Hl);Hl.setAutoFreeze.bind(Hl);Hl.setUseStrictShallowCopy.bind(Hl);Hl.applyPatches.bind(Hl);Hl.createDraft.bind(Hl);Hl.finishDraft.bind(Hl);const Rd=Object.create(null);Rd.open="0";Rd.close="1";Rd.ping="2";Rd.pong="3";Rd.message="4";Rd.upgrade="5";Rd.noop="6";const Oz=Object.create(null);Object.keys(Rd).forEach(u=>{Oz[Rd[u]]=u});const aY={type:"error",data:"parser error"},hJe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",fJe=typeof ArrayBuffer=="function",mJe=u=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u&&u.buffer instanceof ArrayBuffer,pie=({type:u,data:e},t,a)=>hJe&&e instanceof Blob?t?a(e):YDe(e,a):fJe&&(e instanceof ArrayBuffer||mJe(e))?t?a(e):YDe(new Blob([e]),a):a(Rd[u]+(e||"")),YDe=(u,e)=>{const t=new FileReader;return t.onload=function(){const a=t.result.split(",")[1];e("b"+(a||""))},t.readAsDataURL(u)};function XDe(u){return u instanceof Uint8Array?u:u instanceof ArrayBuffer?new Uint8Array(u):new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}let gV;function bia(u,e){if(hJe&&u.data instanceof Blob)return u.data.arrayBuffer().then(XDe).then(e);if(fJe&&(u.data instanceof ArrayBuffer||mJe(u.data)))return e(XDe(u.data));pie(u,!1,t=>{gV||(gV=new TextEncoder),e(gV.encode(t))})}const exe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hk=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let u=0;u<exe.length;u++)hk[exe.charCodeAt(u)]=u;const kia=u=>{let e=u.length*.75,t=u.length,a,n=0,r,i,o,s;u[u.length-1]==="="&&(e--,u[u.length-2]==="="&&e--);const l=new ArrayBuffer(e),c=new Uint8Array(l);for(a=0;a<t;a+=4)r=hk[u.charCodeAt(a)],i=hk[u.charCodeAt(a+1)],o=hk[u.charCodeAt(a+2)],s=hk[u.charCodeAt(a+3)],c[n++]=r<<2|i>>4,c[n++]=(i&15)<<4|o>>2,c[n++]=(o&3)<<6|s&63;return l},Fia=typeof ArrayBuffer=="function",Die=(u,e)=>{if(typeof u!="string")return{type:"message",data:pJe(u,e)};const t=u.charAt(0);return t==="b"?{type:"message",data:Aia(u.substring(1),e)}:Oz[t]?u.length>1?{type:Oz[t],data:u.substring(1)}:{type:Oz[t]}:aY},Aia=(u,e)=>{if(Fia){const t=kia(u);return pJe(t,e)}else return{base64:!0,data:u}},pJe=(u,e)=>{switch(e){case"blob":return u instanceof Blob?u:new Blob([u]);case"arraybuffer":default:return u instanceof ArrayBuffer?u:u.buffer}},DJe="",Bia=(u,e)=>{const t=u.length,a=new Array(t);let n=0;u.forEach((r,i)=>{pie(r,!1,o=>{a[i]=o,++n===t&&e(a.join(DJe))})})},Sia=(u,e)=>{const t=u.split(DJe),a=[];for(let n=0;n<t.length;n++){const r=Die(t[n],e);if(a.push(r),r.type==="error")break}return a};function wia(){return new TransformStream({transform(u,e){bia(u,t=>{const a=t.length;let n;if(a<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,a);else if(a<65536){n=new Uint8Array(3);const r=new DataView(n.buffer);r.setUint8(0,126),r.setUint16(1,a)}else{n=new Uint8Array(9);const r=new DataView(n.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(a))}u.data&&typeof u.data!="string"&&(n[0]|=128),e.enqueue(n),e.enqueue(t)})}})}let vV;function Gw(u){return u.reduce((e,t)=>e+t.length,0)}function Uw(u,e){if(u[0].length===e)return u.shift();const t=new Uint8Array(e);let a=0;for(let n=0;n<e;n++)t[n]=u[0][a++],a===u[0].length&&(u.shift(),a=0);return u.length&&a<u[0].length&&(u[0]=u[0].slice(a)),t}function Oia(u,e){vV||(vV=new TextDecoder);const t=[];let a=0,n=-1,r=!1;return new TransformStream({transform(i,o){for(t.push(i);;){if(a===0){if(Gw(t)<1)break;const s=Uw(t,1);r=(s[0]&128)===128,n=s[0]&127,n<126?a=3:n===126?a=1:a=2}else if(a===1){if(Gw(t)<2)break;const s=Uw(t,2);n=new DataView(s.buffer,s.byteOffset,s.length).getUint16(0),a=3}else if(a===2){if(Gw(t)<8)break;const s=Uw(t,8),l=new DataView(s.buffer,s.byteOffset,s.length),c=l.getUint32(0);if(c>Math.pow(2,21)-1){o.enqueue(aY);break}n=c*Math.pow(2,32)+l.getUint32(4),a=3}else{if(Gw(t)<n)break;const s=Uw(t,n);o.enqueue(Die(r?s:vV.decode(s),e)),a=0}if(n===0||n>u){o.enqueue(aY);break}}}})}const xJe=4;function E0(u){if(u)return zia(u)}function zia(u){for(var e in E0.prototype)u[e]=E0.prototype[e];return u}E0.prototype.on=E0.prototype.addEventListener=function(u,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+u]=this._callbacks["$"+u]||[]).push(e),this};E0.prototype.once=function(u,e){function t(){this.off(u,t),e.apply(this,arguments)}return t.fn=e,this.on(u,t),this};E0.prototype.off=E0.prototype.removeListener=E0.prototype.removeAllListeners=E0.prototype.removeEventListener=function(u,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+u];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+u],this;for(var a,n=0;n<t.length;n++)if(a=t[n],a===e||a.fn===e){t.splice(n,1);break}return t.length===0&&delete this._callbacks["$"+u],this};E0.prototype.emit=function(u){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+u],a=1;a<arguments.length;a++)e[a-1]=arguments[a];if(t){t=t.slice(0);for(var a=0,n=t.length;a<n;++a)t[a].apply(this,e)}return this};E0.prototype.emitReserved=E0.prototype.emit;E0.prototype.listeners=function(u){return this._callbacks=this._callbacks||{},this._callbacks["$"+u]||[]};E0.prototype.hasListeners=function(u){return!!this.listeners(u).length};const RL=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),pc=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),_ia="arraybuffer";function gJe(u,...e){return e.reduce((t,a)=>(u.hasOwnProperty(a)&&(t[a]=u[a]),t),{})}const Tia=pc.setTimeout,Mia=pc.clearTimeout;function LL(u,e){e.useNativeTimers?(u.setTimeoutFn=Tia.bind(pc),u.clearTimeoutFn=Mia.bind(pc)):(u.setTimeoutFn=pc.setTimeout.bind(pc),u.clearTimeoutFn=pc.clearTimeout.bind(pc))}const Pia=1.33;function jia(u){return typeof u=="string"?Nia(u):Math.ceil((u.byteLength||u.size)*Pia)}function Nia(u){let e=0,t=0;for(let a=0,n=u.length;a<n;a++)e=u.charCodeAt(a),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(a++,t+=4);return t}function vJe(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ria(u){let e="";for(let t in u)u.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(u[t]));return e}function Lia(u){let e={},t=u.split("&");for(let a=0,n=t.length;a<n;a++){let r=t[a].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class $ia extends Error{constructor(e,t,a){super(e),this.description=t,this.context=a,this.type="TransportError"}}class xie extends E0{constructor(e){super(),this.writable=!1,LL(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,a){return super.emitReserved("error",new $ia(e,t,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Die(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Ria(e);return t.length?"?"+t:""}}class Iia extends xie{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||t()})),this.writable||(a++,this.once("drain",function(){--a||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};Sia(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Bia(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=vJe()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let CJe=!1;try{CJe=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Kia=CJe;function Hia(){}class Via extends Iia{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let a=location.port;a||(a=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||a!==e.port}}doWrite(e,t){const a=this.request({method:"POST",data:e});a.on("success",t),a.on("error",(n,r)=>{this.onError("xhr post error",n,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,a)=>{this.onError("xhr poll error",t,a)}),this.pollXhr=e}}let K6=class zz extends E0{constructor(e,t,a){super(),this.createRequest=e,LL(this,a),this._opts=a,this._method=a.method||"GET",this._uri=t,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var e;const t=gJe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(t);try{a.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&a.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(a),"withCredentials"in a&&(a.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(a.timeout=this._opts.requestTimeout),a.onreadystatechange=()=>{var n;a.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(a.getResponseHeader("set-cookie"))),a.readyState===4&&(a.status===200||a.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof a.status=="number"?a.status:0)},0))},a.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=zz.requestsCount++,zz.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Hia,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete zz.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};K6.requestsCount=0;K6.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",uxe);else if(typeof addEventListener=="function"){const u="onpagehide"in pc?"pagehide":"unload";addEventListener(u,uxe,!1)}}function uxe(){for(let u in K6.requests)K6.requests.hasOwnProperty(u)&&K6.requests[u].abort()}const Gia=function(){const u=yJe({xdomain:!1});return u&&u.responseType!==null}();class Uia extends Via{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=Gia&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K6(yJe,this.uri(),e)}}function yJe(u){const e=u.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Kia))return new XMLHttpRequest}catch{}if(!e)try{return new pc[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const bJe=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Wia extends xie{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,a=bJe?{}:gJe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,a)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const a=e[t],n=t===e.length-1;pie(a,this.supportsBinary,r=>{try{this.doWrite(a,r)}catch{}n&&RL(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=vJe()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const CV=pc.WebSocket||pc.MozWebSocket;class Jia extends Wia{createSocket(e,t,a){return bJe?new CV(e,t,a):t?new CV(e,t):new CV(e)}doWrite(e,t){this.ws.send(t)}}class qia extends xie{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Oia(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=e.readable.pipeThrough(t).getReader(),n=wia();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();const r=()=>{a.read().then(({done:o,value:s})=>{o||(this.onPacket(s),r())}).catch(o=>{})};r();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this._writer.write(i).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const a=e[t],n=t===e.length-1;this._writer.write(a).then(()=>{n&&RL(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Zia={websocket:Jia,webtransport:qia,polling:Uia},Qia=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Yia=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function nY(u){if(u.length>8e3)throw"URI too long";const e=u,t=u.indexOf("["),a=u.indexOf("]");t!=-1&&a!=-1&&(u=u.substring(0,t)+u.substring(t,a).replace(/:/g,";")+u.substring(a,u.length));let n=Qia.exec(u||""),r={},i=14;for(;i--;)r[Yia[i]]=n[i]||"";return t!=-1&&a!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=Xia(r,r.path),r.queryKey=eoa(r,r.query),r}function Xia(u,e){const t=/\/{2,9}/g,a=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&a.splice(0,1),e.slice(-1)=="/"&&a.splice(a.length-1,1),a}function eoa(u,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,n,r){n&&(t[n]=r)}),t}const rY=typeof addEventListener=="function"&&typeof removeEventListener=="function",_z=[];rY&&addEventListener("offline",()=>{_z.forEach(u=>u())},!1);class zf extends E0{constructor(e,t){if(super(),this.binaryType=_ia,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const a=nY(e);t.hostname=a.host,t.secure=a.protocol==="https"||a.protocol==="wss",t.port=a.port,a.query&&(t.query=a.query)}else t.host&&(t.hostname=nY(t.host).host);LL(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(a=>{const n=a.prototype.name;this.transports.push(n),this._transportsByName[n]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Lia(this.opts.query)),rY&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},_z.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=xJe,t.transport=e,this.id&&(t.sid=this.id);const a=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](a)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&zf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",zf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let a=0;a<this.writeBuffer.length;a++){const n=this.writeBuffer[a].data;if(n&&(t+=jia(n)),a>0&&t>this._maxPayload)return this.writeBuffer.slice(0,a);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,RL(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,a){return this._sendPacket("message",e,t,a),this}send(e,t,a){return this._sendPacket("message",e,t,a),this}_sendPacket(e,t,a,n){if(typeof t=="function"&&(n=t,t=void 0),typeof a=="function"&&(n=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const r={type:e,data:t,options:a};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),n&&this.once("flush",n),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},a=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():e()}):this.upgrading?a():e()),this}_onError(e){if(zf.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),rY&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=_z.indexOf(this._offlineEventListener);a!==-1&&_z.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}zf.protocol=xJe;class uoa extends zf{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),a=!1;zf.priorWebsocketSuccess=!1;const n=()=>{a||(t.send([{type:"ping",data:"probe"}]),t.once("packet",d=>{if(!a)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;zf.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const E=new Error("probe error");E.transport=t.name,this.emitReserved("upgradeError",E)}}))};function r(){a||(a=!0,c(),t.close(),t=null)}const i=d=>{const E=new Error("probe error: "+d);E.transport=t.name,r(),this.emitReserved("upgradeError",E)};function o(){i("transport closed")}function s(){i("socket closed")}function l(d){t&&d.name!==t.name&&r()}const c=()=>{t.removeListener("open",n),t.removeListener("error",i),t.removeListener("close",o),this.off("close",s),this.off("upgrading",l)};t.once("open",n),t.once("error",i),t.once("close",o),this.once("close",s),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{a||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let a=0;a<e.length;a++)~this.transports.indexOf(e[a])&&t.push(e[a]);return t}}let toa=class extends uoa{constructor(e,t={}){const a=typeof e=="object"?e:t;(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(n=>Zia[n]).filter(n=>!!n)),super(e,a)}};function aoa(u,e="",t){let a=u;t=t||typeof location<"u"&&location,u==null&&(u=t.protocol+"//"+t.host),typeof u=="string"&&(u.charAt(0)==="/"&&(u.charAt(1)==="/"?u=t.protocol+u:u=t.host+u),/^(https?|wss?):\/\//.test(u)||(typeof t<"u"?u=t.protocol+"//"+u:u="https://"+u),a=nY(u)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const r=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+r+":"+a.port+e,a.href=a.protocol+"://"+r+(t&&t.port===a.port?"":":"+a.port),a}const noa=typeof ArrayBuffer=="function",roa=u=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(u):u.buffer instanceof ArrayBuffer,kJe=Object.prototype.toString,ioa=typeof Blob=="function"||typeof Blob<"u"&&kJe.call(Blob)==="[object BlobConstructor]",ooa=typeof File=="function"||typeof File<"u"&&kJe.call(File)==="[object FileConstructor]";function gie(u){return noa&&(u instanceof ArrayBuffer||roa(u))||ioa&&u instanceof Blob||ooa&&u instanceof File}function Tz(u,e){if(!u||typeof u!="object")return!1;if(Array.isArray(u)){for(let t=0,a=u.length;t<a;t++)if(Tz(u[t]))return!0;return!1}if(gie(u))return!0;if(u.toJSON&&typeof u.toJSON=="function"&&arguments.length===1)return Tz(u.toJSON(),!0);for(const t in u)if(Object.prototype.hasOwnProperty.call(u,t)&&Tz(u[t]))return!0;return!1}function soa(u){const e=[],t=u.data,a=u;return a.data=iY(t,e),a.attachments=e.length,{packet:a,buffers:e}}function iY(u,e){if(!u)return u;if(gie(u)){const t={_placeholder:!0,num:e.length};return e.push(u),t}else if(Array.isArray(u)){const t=new Array(u.length);for(let a=0;a<u.length;a++)t[a]=iY(u[a],e);return t}else if(typeof u=="object"&&!(u instanceof Date)){const t={};for(const a in u)Object.prototype.hasOwnProperty.call(u,a)&&(t[a]=iY(u[a],e));return t}return u}function loa(u,e){return u.data=oY(u.data,e),delete u.attachments,u}function oY(u,e){if(!u)return u;if(u&&u._placeholder===!0){if(typeof u.num=="number"&&u.num>=0&&u.num<e.length)return e[u.num];throw new Error("illegal attachments")}else if(Array.isArray(u))for(let t=0;t<u.length;t++)u[t]=oY(u[t],e);else if(typeof u=="object")for(const t in u)Object.prototype.hasOwnProperty.call(u,t)&&(u[t]=oY(u[t],e));return u}const coa=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],doa=5;var Ta;(function(u){u[u.CONNECT=0]="CONNECT",u[u.DISCONNECT=1]="DISCONNECT",u[u.EVENT=2]="EVENT",u[u.ACK=3]="ACK",u[u.CONNECT_ERROR=4]="CONNECT_ERROR",u[u.BINARY_EVENT=5]="BINARY_EVENT",u[u.BINARY_ACK=6]="BINARY_ACK"})(Ta||(Ta={}));class Eoa{constructor(e){this.replacer=e}encode(e){return(e.type===Ta.EVENT||e.type===Ta.ACK)&&Tz(e)?this.encodeAsBinary({type:e.type===Ta.EVENT?Ta.BINARY_EVENT:Ta.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===Ta.BINARY_EVENT||e.type===Ta.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=soa(e),a=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(a),n}}function txe(u){return Object.prototype.toString.call(u)==="[object Object]"}class vie extends E0{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const a=t.type===Ta.BINARY_EVENT;a||t.type===Ta.BINARY_ACK?(t.type=a?Ta.EVENT:Ta.ACK,this.reconstructor=new hoa(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(gie(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const a={type:Number(e.charAt(0))};if(Ta[a.type]===void 0)throw new Error("unknown packet type "+a.type);if(a.type===Ta.BINARY_EVENT||a.type===Ta.BINARY_ACK){const r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const i=e.substring(r,t);if(i!=Number(i)||e.charAt(t)!=="-")throw new Error("Illegal attachments");a.attachments=Number(i)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););a.nsp=e.substring(r,t)}else a.nsp="/";const n=e.charAt(t+1);if(n!==""&&Number(n)==n){const r=t+1;for(;++t;){const i=e.charAt(t);if(i==null||Number(i)!=i){--t;break}if(t===e.length)break}a.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(vie.isPayloadValid(a.type,r))a.data=r;else throw new Error("invalid payload")}return a}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Ta.CONNECT:return txe(t);case Ta.DISCONNECT:return t===void 0;case Ta.CONNECT_ERROR:return typeof t=="string"||txe(t);case Ta.EVENT:case Ta.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&coa.indexOf(t[0])===-1);case Ta.ACK:case Ta.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class hoa{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=loa(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const foa=Object.freeze(Object.defineProperty({__proto__:null,Decoder:vie,Encoder:Eoa,get PacketType(){return Ta},protocol:doa},Symbol.toStringTag,{value:"Module"}));function b1(u,e,t){return u.on(e,t),function(){u.off(e,t)}}const moa=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class FJe extends E0{constructor(e,t,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[b1(e,"open",this.onopen.bind(this)),b1(e,"packet",this.onpacket.bind(this)),b1(e,"error",this.onerror.bind(this)),b1(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var a,n,r;if(moa.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const i={type:Ta.EVENT,data:t};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const c=this.ids++,d=t.pop();this._registerAckCallback(c,d),i.id=c}const o=(n=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||n===void 0?void 0:n.writable,s=this.connected&&!(!((r=this.io.engine)===null||r===void 0)&&r._hasPingExpired());return this.flags.volatile&&!o||(s?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){var a;const n=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},n),i=(...o)=>{this.io.clearTimeoutFn(r),t.apply(this,o)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((a,n)=>{const r=(i,o)=>i?n(i):a(o);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((n,...r)=>a!==this._queue[0]?void 0:(n!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(n)):(this._queue.shift(),t&&t(null,...r)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Ta.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(a=>String(a.id)===e)){const a=this.acks[e];delete this.acks[e],a.withError&&a.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Ta.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ta.EVENT:case Ta.BINARY_EVENT:this.onevent(e);break;case Ta.ACK:case Ta.BINARY_ACK:this.onack(e);break;case Ta.DISCONNECT:this.ondisconnect();break;case Ta.CONNECT_ERROR:this.destroy();const a=new Error(e.data.message);a.data=e.data.data,this.emitReserved("connect_error",a);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const a of t)a.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let a=!1;return function(...n){a||(a=!0,t.packet({type:Ta.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ta.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let a=0;a<t.length;a++)if(e===t[a])return t.splice(a,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let a=0;a<t.length;a++)if(e===t[a])return t.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const a of t)a.apply(this,e.data)}}}function WC(u){u=u||{},this.ms=u.min||100,this.max=u.max||1e4,this.factor=u.factor||2,this.jitter=u.jitter>0&&u.jitter<=1?u.jitter:0,this.attempts=0}WC.prototype.duration=function(){var u=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*u);u=Math.floor(e*10)&1?u+t:u-t}return Math.min(u,this.max)|0};WC.prototype.reset=function(){this.attempts=0};WC.prototype.setMin=function(u){this.ms=u};WC.prototype.setMax=function(u){this.max=u};WC.prototype.setJitter=function(u){this.jitter=u};class sY extends E0{constructor(e,t){var a;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,LL(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((a=t.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new WC({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||foa;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new toa(this.uri,this.opts);const t=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const n=b1(t,"open",function(){a.onopen(),e&&e()}),r=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),e?e(o):this.maybeReconnectOnOpen()},i=b1(t,"error",r);if(this._timeout!==!1){const o=this._timeout,s=this.setTimeoutFn(()=>{n(),r(new Error("timeout")),t.close()},o);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}return this.subs.push(n),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(b1(e,"ping",this.onping.bind(this)),b1(e,"data",this.ondata.bind(this)),b1(e,"error",this.onerror.bind(this)),b1(e,"close",this.onclose.bind(this)),b1(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){RL(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let a=this.nsps[e];return a?this._autoConnect&&!a.active&&a.connect():(a=new FJe(this,e,t),this.nsps[e]=a),a}_destroy(e){const t=Object.keys(this.nsps);for(const a of t)if(this.nsps[a].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let a=0;a<t.length;a++)this.engine.write(t[a],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const a=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(n=>{n?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",n)):e.onreconnect()}))},t);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const xb={};function Mz(u,e){typeof u=="object"&&(e=u,u=void 0),e=e||{};const t=aoa(u,e.path||"/socket.io"),a=t.source,n=t.id,r=t.path,i=xb[n]&&r in xb[n].nsps,o=e.forceNew||e["force new connection"]||e.multiplex===!1||i;let s;return o?s=new sY(a,e):(xb[n]||(xb[n]=new sY(a,e)),s=xb[n]),t.query&&!e.query&&(e.query=t.queryKey),s.socket(t.path,e)}Object.assign(Mz,{Manager:sY,Socket:FJe,io:Mz,connect:Mz});function sc(u){var e=k.useState(function(){return S7(typeof u=="function"?u():u,!0)}),t=e[1];return[e[0],k.useCallback(function(a){t(typeof a=="function"?EJe(a):S7(a))},[])]}var poa="Expected a function",axe=NaN,Doa="[object Symbol]",xoa=/^\s+|\s+$/g,goa=/^[-+]0x[0-9a-f]+$/i,voa=/^0b[01]+$/i,Coa=/^0o[0-7]+$/i,yoa=parseInt,boa=typeof Ne=="object"&&Ne&&Ne.Object===Object&&Ne,koa=typeof self=="object"&&self&&self.Object===Object&&self,Foa=boa||koa||Function("return this")(),Aoa=Object.prototype,Boa=Aoa.toString,Soa=Math.max,woa=Math.min,yV=function(){return Foa.Date.now()};function Ooa(u,e,t){var a,n,r,i,o,s,l=0,c=!1,d=!1,E=!0;if(typeof u!="function")throw new TypeError(poa);e=nxe(e)||0,lY(t)&&(c=!!t.leading,d="maxWait"in t,r=d?Soa(nxe(t.maxWait)||0,e):r,E="trailing"in t?!!t.trailing:E);function h(b){var F=a,O=n;return a=n=void 0,l=b,i=u.apply(O,F),i}function f(b){return l=b,o=setTimeout(x,e),c?h(b):i}function m(b){var F=b-s,O=b-l,T=e-F;return d?woa(T,r-O):T}function p(b){var F=b-s,O=b-l;return s===void 0||F>=e||F<0||d&&O>=r}function x(){var b=yV();if(p(b))return g(b);o=setTimeout(x,m(b))}function g(b){return o=void 0,E&&a?h(b):(a=n=void 0,i)}function v(){o!==void 0&&clearTimeout(o),l=0,a=s=n=o=void 0}function C(){return o===void 0?i:g(yV())}function y(){var b=yV(),F=p(b);if(a=arguments,n=this,s=b,F){if(o===void 0)return f(s);if(d)return o=setTimeout(x,e),h(s)}return o===void 0&&(o=setTimeout(x,e)),i}return y.cancel=v,y.flush=C,y}function lY(u){var e=typeof u;return!!u&&(e=="object"||e=="function")}function zoa(u){return!!u&&typeof u=="object"}function _oa(u){return typeof u=="symbol"||zoa(u)&&Boa.call(u)==Doa}function nxe(u){if(typeof u=="number")return u;if(_oa(u))return axe;if(lY(u)){var e=typeof u.valueOf=="function"?u.valueOf():u;u=lY(e)?e+"":e}if(typeof u!="string")return u===0?u:+u;u=u.replace(xoa,"");var t=voa.test(u);return t||Coa.test(u)?yoa(u.slice(2),t?2:8):goa.test(u)?axe:+u}var Toa=Ooa;const rxe=ea(Toa);function Moa(u){const e=k.useRef(u);e.current=u,k.useEffect(()=>()=>{e.current()},[])}function Poa(u,e=500,t){const a=k.useRef();Moa(()=>{a.current&&a.current.cancel()});const n=k.useMemo(()=>{const r=rxe(u,e,t),i=(...o)=>r(...o);return i.cancel=()=>{r.cancel()},i.isPending=()=>!!a.current,i.flush=()=>r.flush(),i},[u,e,t]);return k.useEffect(()=>{a.current=rxe(u,e,t)},[u,e,t]),n}function joa(u,e,t){const a=(t==null?void 0:t.equalityFn)??((l,c)=>l===c),n=u instanceof Function?u():u,[r,i]=k.useState(n),o=k.useRef(n),s=Poa(i,e,t);return a(o.current,n)||(s(n),o.current=n),[r,s]}const Noa=2e3,AJe=(u,e)=>{const t=(e==null?void 0:e.find(n=>n.default))??(e==null?void 0:e[0]);return u.find(n=>n.name===(t==null?void 0:t.name))},Roa=(u,e)=>{const t=AJe(u,e),a=((t==null?void 0:t.variables)??{})[SA];return typeof a=="string"?a:"about:blank"},Loa=({websocketUrl:u,test:e,environments:t,platform:a,logger:n})=>{var Ule;const[r,i]=k.useState(),[o,s]=k.useState(""),[l,c]=sc([]),[d,E]=sc({}),[h,f]=sc({}),[m,p]=sc(void 0),[x,g]=sc(!1),[v,C]=sc(void 0),[y,b]=sc(!1),[F,O]=sc(!1),[T,P]=k.useState(""),z=k.useRef([]),A=k.useRef(0),[S,w]=k.useState([]),[_,j]=k.useState(),K=k.useMemo(()=>AJe(t,e.envs),[t,e.envs]),M=k.useMemo(()=>e.baseUrl||Roa(t,e.envs),[e.baseUrl,t,e.envs]),L=((Ule=e.advanced)==null?void 0:Ule.viewport)??owe,[G,V]=k.useState(void 0),[R,I]=k.useState(!1),[U,W]=k.useState(M),[$,q]=k.useState([]),[Q,ue]=k.useState(!1),[ae,le]=k.useState(!1),[Z,Ee]=k.useState(!1),[fe,ve]=k.useState(!1),[X,ye]=k.useState(!1),[Ue,Te]=k.useState(!1),[J,Y]=k.useState(),re=k.useRef(Ue);re.current=Ue;const ee=(!Ue||ae)&&!Z&&Q,ne=!Ue&&!Z&&!ae&&!fe&&Q,oe=!Ue&&!Z&&!ae&&!fe&&Q,Oe=!Ue&&!Z&&!ae&&!fe&&Q,[$e,Xe]=k.useState(""),qe=k.useRef(Date.now()),au=k.useRef(0),eu=()=>{qe.current=Date.now()},[fu,st]=k.useState(!1),Kt=k.useRef(),Za=k.useRef(0),Ju=k.useRef({testId:e.id}),wa=Ju.current,[lr,j0]=k.useState(FE.Main),[Ha,N0]=sc(()=>N4(e.beforeSteps??[])),[ko,pe]=sc(()=>N4(e.steps??[])),[de,we]=sc(()=>N4(e.afterSteps??[])),We=k.useMemo(()=>lr===FE.Setup?Ha:lr===FE.Main?ko:de,[lr,Ha,ko,de]),Ze=lr===FE.Setup?N0:lr===FE.Main?pe:we,nt=k.useRef(We);nt.current=We;const Uu=k.useMemo(()=>mE(We),[We]),Re=k.useMemo(()=>({steps:mE(ko),beforeSteps:mE(Ha),afterSteps:mE(de)}),[ko,Ha,de]),[Nu,iu]=joa(Re,Noa);k.useEffect(()=>{iu(Re)},[iu,Re]);const[ka,Su]=k.useState(Re),Ru=k.useMemo(()=>{const se=nF(ka,Re);return Object.keys(se).length>0},[ka,Re]),ua=k.useMemo(()=>{try{bK(Re.beforeSteps??[]),bK(Re.steps),bK(Re.afterSteps??[])}catch(se){if(se instanceof Error)return{valid:!1,message:se.message}}return{valid:!0}},[Re]),Nt=k.useRef(),Le=Nt.current,R0=k.useRef(),sn=ia(({stepId:se,parentStepIdChain:me})=>{eu(),Ze(Ce=>{Zx(Ce);const _e=Gi(Ce,se,me);if(_e){if(_e.step.type===Fe.AI_ACTION){const He=_e.children.map(nu=>nu.step.type===Fe.PRESET_ACTION?nu.step.command:null).filter(nu=>!!nu);(!(He!=null&&He.length)||He[He.length-1].type!==H.SUCCESS)&&(_e.message="Generating command..."),_e.aiActionLogs=[]}else _e.step.type===Fe.AI_ACTION_DYNAMIC&&(_e.children=[],_e.aiActionLogs=[]);_e.status=sa.RUNNING}})}),Fo=ia(se=>{const me=se.numIcons===1?"A new icon":`${se.numIcons} new icons`,Ce=se.numIcons===1?"has":"have",_e=se.numIcons===1?"it":"them";nn.info(`${me} that Momentic does not recognize ${Ce} been detected on this page. Head over to the Knowledge Base to label ${_e} and improve our AI's ability to recognize ${_e} in future interactions.`)}),Ds=ia(({status:se,parentStepId:me,message:Ce})=>{Ze(_e=>{Zx(_e);const He=Gi(_e,me,[]);He&&He.step.type===Fe.AI_ACTION_DYNAMIC&&(He.expanded||(He.expanded=!0),He.aiActionLatestMessage={status:se??sa.RUNNING,message:Ce})})}),ci=ia(({tabs:se,activeTab:me})=>{w(se);const Ce=Array.from(z.current.map(nu=>nu.url)),_e=Array.from(se.map(nu=>nu.url)),He=_e.find(nu=>!Ce.includes(nu));Ce.length>0&&_e.length>Ce.length&&He&&setTimeout(()=>{Date.now()-A.current<1e4||MLt(He,me)&&(nn.info("Momentic detected that a new tab was opened. To switch to it, add a Switch Tab step. Using the tab switcher in the browser preview does not affect future test executions.",{duration:5e3}),A.current=Date.now())},2500),z.current=se,j(me)}),C4=ia(({stepId:se,message:me,status:Ce})=>{Ze(_e=>{const He=Gi(_e,se,[]);He&&(He.aiActionLogs?He.aiActionLogs.push({log:me,status:Ce}):He.aiActionLogs=[{log:me,status:Ce}])})}),o1=ia(async()=>{n.info("Churn imminent event received",wa),st(!0),nn.warning("Momentic just pushed a new application update! Please save and refresh the page to connect to an updated server. Your current session will be automatically disconnected after 30 minutes.",{duration:5*6e4}),await new Promise(me=>setTimeout(me,3e5));const se=setInterval(()=>{!Ue&&qe.current<Date.now()-15e3&&(b4(),clearInterval(se))},5e3)}),y4=ia(({parentStepId:se,step:me})=>{Ze(Ce=>{Zx(Ce);const _e=Gi(Ce,se,[]);if(!_e||_e.step.type!==Fe.AI_ACTION_DYNAMIC)return;_e.expanded||(_e.expanded=!0),_e.aiActionLatestMessage=void 0;const He=ys(me);He.readonly=!0,He.status=sa.IDLE,He.message=me.command.thoughts,_e.children.push(He)})}),Se=ia(({parentStepId:se,step:me})=>{Ze(Ce=>{Zx(Ce);const _e=Gi(Ce,se,[]);if(!_e||_e.step.type!==Fe.AI_ACTION_DYNAMIC)return;_e.aiActionLatestMessage=void 0;const He=Gi(Ce,me.id,[]);He&&(He.status=sa.RUNNING)})}),be=ia(({parentStepId:se})=>{Ze(me=>{Zx(me);const Ce=Gi(me,se,[]);Ce&&(Ce.message="Generated command...")})}),je=ia(se=>{Ze(me=>{var He,nu;const Ce=Gi(me,se.stepId,se.parentStepIdChain);if(!Ce)return;switch(se.type){case"listenersInitialized":Ce.targetRecordingState={msg:"Click an element using the interactive editor to generate a description. The description will populate a few seconds after the click.",phase:z1.WAITING_FOR_CLICK};break;case"error":Ce.targetRecordingState={phase:z1.ERROR,err:se.err};break;case"clickReceived":Ce.targetRecordingState={msg:"Generating description for click...",phase:z1.WAITING_FOR_DESCRIPTION};break;case"descriptionGenerated":{const vt=y5(((nu=(He=se.command.cache)==null?void 0:He.target)==null?void 0:nu.nodeOnlySerializedHtml)??"",500,!0);Ce.targetRecordingState={msg:vt?`Saved target: ${vt}`:"Target saved!",phase:z1.IDLE};break}}if(se.type!=="descriptionGenerated")return;const _e=se.command;_e.type===H.CLICK&&(Ce.stepPatcher=vt=>{var ih;if(vt.type!==Fe.PRESET_ACTION)return;const Ht=vt,gn=Ht.command,qs={...gn.cache??{},[se.attribute]:(ih=_e.cache)==null?void 0:ih.target},Zs=tt();Ht.command={...gn,id:Zs,cache:qs,[se.attribute]:_e.target}})})}),Ie=ia(({parentStepId:se,step:me,output:Ce,substepIndex:_e})=>{Ze(He=>{Zx(He);const nu=Gi(He,se,[]);if(!nu)return;const vt=nu.children.findIndex(gn=>gn.step.id===me.id);me.command.type===H.SUCCESS&&(nu.children=nu.children.slice(0,vt+1));const Ht=Gi(He,me.id,[]);if(Ce&&Ht){const gn=Ht.status;gn!==sa.FAILED&&gn!==sa.CANCELLED&&(Ht.status=Ce.status,Ht.output=Ce)}if(!Ht){const gn=ys(me);Ce&&(gn.output=Ce,gn.status=Ce.status),nu.children.push(gn),nu.message="Generating command...";return}if(Ht&&Ht.step.type===Fe.PRESET_ACTION&&Object.keys(nF(Ht.step??{},me??{})).length>0){const gn=ys(me);gn.status=Ht.status,Ce&&(gn.status=Ce.status,gn.output=Ce),nu.children.splice(vt,1,gn)}}),Ze(He=>{const{indices:nu}=Yb(He,se,[]);nu&&xu(He,[...nu,_e])})}),ou=ia(({message:se,step:me,output:Ce,parentStepIdChain:_e})=>{Ze(He=>{var gn;const nu=Gi(He,me.id,_e);if(!nu)return;nu.status=sa.SUCCESS,nu.message=se||me.message,nu.output=Ce;const vt="command"in me?me.command:void 0;vt&&(nu.message=vt.thoughts||nu.message),vt&&nu.step.type===Fe.PRESET_ACTION&&Object.keys(nF(nu.step.command??{},vt)).length>0&&(nu.step.command=vt),nu.step.type===Fe.AI_ACTION_DYNAMIC&&(nu.aiActionLatestMessage=void 0);const Ht=Yb(He,me.id,_e).parentChain;for(let qs=Ht.length-1;qs>=0;qs--){const Zs=Ht[qs];if(Zs.children.every(ih=>ih.status===sa.SUCCESS)&&Zs.step.type!==Fe.AI_ACTION_DYNAMIC)Zs.status=sa.SUCCESS,Zs.message="All sub-steps completely successfully.",Zs.output=(gn=Zs.children[Zs.children.length-1])==null?void 0:gn.output;else break}})}),$u=ia(({url:se,iframeSrcUrls:me,logsPerPage:Ce,context:_e,harPages:He,harEntries:nu,isInPageLoad:vt})=>{if(O(vt),W(se),q(me),Y(_e),Ce!=null&&Ce.length){const Ht=$Rt(Ce);c(gn=>{let qs=[...gn];for(const Zs of Ht)qs=qs.concat(Zs.map(ih=>({...ih,id:tt()})));return qs=qs.sort((Zs,ih)=>Zs.timestamp-ih.timestamp).slice(Math.max(0,qs.length-100),qs.length),qs})}He&&E(Ht=>({...Ht,...He})),nu&&f(Ht=>({...Ht,...nu}))}),lt=ia(({message:se,output:me,step:Ce,parentStepIdChain:_e})=>{le(!1),Ze(He=>{const nu=Gi(He,Ce.id,_e);nu&&(nu.status=sa.FAILED,nu.message=se||Ce.message,nu.output=me,nu.aiActionLatestMessage=void 0)})}),_u=ia(({message:se,output:me,step:Ce,parentStepIdChain:_e})=>{le(!1),Ze(He=>{const nu=Gi(He,Ce.id,_e);nu&&(nu.status=sa.CANCELLED,nu.message=se||Ce.message,nu.output=me,nu.aiActionLatestMessage=void 0)})}),wu=ia(({step:se,stepId:me,offset:Ce})=>{let _e,He;const nu=nt.current;if(me){const vt=Yb(nu,me,[]);if(vt.result)if(vt.indices[0]===void 0){n.error(`Starting index not found during step recording: ${JSON.stringify(vt)}`);return}else He=vt.indices[0]+1;else{n.error(`Starting step not found during step recording (${me}): ${JSON.stringify(nu.map(Ht=>Ht.step))}`);return}}else He=0;if(_e=He+Ce,_e===void 0){n.error("Insertion index not found during step recording");return}else kt(se,!1,[_e])}),gt=ia(({buffer:se},me)=>{i(se),me()}),Bt=ia(({url:se,userAgent:me,sessionId:Ce})=>{Ju.current.sessionId=Ce,ue(!0),P("initialized"),W(se),s(me)}),Oa=ia(()=>{eu(),Te(!1),le(!1)}),St=ia(()=>{n.info("Ping event received",wa)}),Wt=ia(se=>{n.error("Socket reconnect error",wa,se),!(Za.current>Date.now()-1e4)&&(Za.current=Date.now(),setTimeout(()=>nn.error("Failed to connect to Momentic's servers. Please refresh the page and try again later."),2e3))}),zt=ia(se=>{n.warn(`Socket reconnect attempt ${se}`,wa)}),cr=ia(()=>{n.info("Socket reconnected",wa),setTimeout(()=>{nn.success("Reconnected to Momentic!")},2e3),Xe("")}),Gr=ia(()=>{n.error("Socket reconnect failed",wa),Xe("It seems like you lost connection to Momentic's servers. Please ensure you have a stable connection and refresh the page.")}),an=ia(()=>{Ju.current.recovered=Le==null?void 0:Le.recovered,Xe(""),Kt.current&&window.clearInterval(Kt.current),Kt.current=window.setInterval(()=>{if(a!="local"){if(re.current){eu();return}if(!(qe.current>Date.now()-5*6e4)){if(qe.current>Date.now()-10*6e4&&Date.now()-au.current>10*6e4){nn.warning("You've been inactive for a while. Please interact with the editor to avoid being disconnected.",{duration:6e4}),au.current=Date.now();return}clearInterval(Kt.current),Le!=null&&Le.active&&!re.current&&(n.error("Disconnecting due to inactivity",wa),Xe("You've been disconnected due to inactivity. Please refresh the page to start a new session."),Le==null||Le.disconnect())}}},6e4)}),di=ia((se,me)=>{n.info("Frontend disconnecting",{reason:se,description:me,...wa}),clearInterval(Kt.current),Xe("Disconnected!"),Te(!1)}),$i=ia(se=>{n.error("Socket error",wa,new Error(se.message)),nn.error(`An unexpected error occurred: ${se.message}`,{duration:1/0})}),xs=ia(se=>{const me="description"in se&&typeof se.description=="string"?se.description:void 0;n.warn(`Socket connect error (msg: ${se.message}, description: ${me})`,{...wa,description:me}),Le!=null&&Le.active?Za.current>Date.now()-1e4&&(Za.current=Date.now(),nn.error("Failed to connect to Momentic's servers. Your internet may be unstable or you may have reached a server under heavy load. Retrying...")):Xe(se.message)}),_n=ia(()=>{const se={type:"e2e",testId:e.id},me=Mz(u,{transports:["websocket"],query:se,reconnection:!0,reconnectionAttempts:3,reconnectionDelay:5e3,autoConnect:!0});return me.io.on("ping",St),me.io.on("reconnect_error",Wt),me.io.on("reconnect_attempt",zt),me.io.on("reconnect",cr),me.io.on("reconnect_failed",Gr),me.on("newIconDetected",Fo),me.on("connect",an),me.on("disconnect",di),me.on("churnImminent",o1),me.on("error",$i),me.on("connect_error",xs),me.on("session",Bt),me.on("finished",Oa),me.on("screenshot",gt),me.on("browserState",$u),me.on("tabs",ci),me.on("started",sn),me.on("dynamicCommandStatusUpdate",Ds),me.on("dynamicCommandEvaluating",C4),me.on("dynamicCommandGenerated",y4),me.on("dynamicCommandExecuted",Se),me.on("commandGenerated",be),me.on("targetRecordingUpdate",je),me.on("commandExecuted",Ie),me.on("success",ou),me.on("failure",lt),me.on("cancelled",_u),me.on("stepRecorded",wu),me}),b4=ia(()=>{var se;n.info("Reconnecting socket",wa),(se=Nt.current)==null||se.disconnect(),Nt.current=_n()}),Ur=ia(()=>{var se,me;(se=Nt.current)!=null&&se.connected&&(n.info("Running socket cleanup function"),(me=Nt.current)==null||me.disconnect()),R0.current&&window.clearTimeout(R0.current),Kt.current&&window.clearInterval(Kt.current)});k.useEffect(()=>(window.addEventListener("beforeunload",Ur),()=>{window.removeEventListener("beforeunload",Ur)}),[Ur]),k.useEffect(()=>(Nt.current||(Nt.current=_n()),Ur),[Ur,_n]);const L0=()=>{Ru||window.location.reload()},uh=()=>{eu(),ve(!0),Le==null||Le.emit("refresh",void 0,()=>ve(!1))},Xl=()=>{eu(),Le==null||Le.emit("cancel"),le(!0)},wy=()=>{We.length&&(Te(!0),eu(),Ze(se=>{se.forEach(me=>{vh(me,sa.IDLE),Ch(me)})}),Le==null||Le.emit("execute",{reInitialize:!1,steps:Uu}))},Oy=se=>{eu(),V({x:Math.max(0,Math.round(se.pctX*L.width*100)/100),y:Math.max(0,Math.round(se.pctY*L.height*100)/100)}),se.event==="move"?Le==null||Le.emit("mouseMoveEvent",{event:"move",percentX:se.pctX,percentY:se.pctY}):Le==null||Le.emit("mouseClickEvent",{event:se.event,percentX:se.pctX,percentY:se.pctY})},Tx=se=>{eu(),Le==null||Le.emit("keyDownEvent",{key:se})},Mx=se=>{eu(),Le==null||Le.emit("keyUpEvent",{key:se})},ce=se=>{eu(),Le==null||Le.emit("mouseMoveEvent",{event:"scroll",percentX:se.pctDeltaX,percentY:se.pctDeltaY})},ke=(se,me)=>{ne&&(Te(!0),eu(),Ze(Ce=>{const _e=Gi(Ce,se,me);_e&&(vh(_e,sa.IDLE),Ch(_e))}),Le==null||Le.emit("execute",{reInitialize:!1,steps:Uu,fromStep:{fromStepId:se,parentStepIdChain:me},toStep:{toStepId:se,parentStepIdChain:me}}))},Me=(se,me)=>{if(!ne)return;Te(!0);let Ce,_e;Zq({states:We,fn:(He,nu)=>Ce||He.step.id===se&&JSON.stringify(nu)===JSON.stringify(me)?!0:He.step.skipped?!1:He.status===sa.IDLE?(Ce=He.step.id,_e=nu,!0):!1,earlyStop:!0,inOrder:!0}),eu(),Le==null||Le.emit("execute",{reInitialize:!1,steps:Uu,fromStep:Ce&&_e?{fromStepId:Ce,parentStepIdChain:_e}:void 0,toStep:{toStepId:se,parentStepIdChain:me}})},Je=(se,me)=>{ne&&(Te(!0),Ze(Ce=>{const _e=Gi(Ce,se,me);if(!_e)return;vh(_e,sa.IDLE),Ch(_e);const He=Yb(Ce,se,me);if(He.lastParent){vh(He.lastParent,sa.IDLE),Ch(He.lastParent);let vt=!1;He.lastParent.children.forEach(Ht=>{vt&&(vh(Ht,sa.IDLE),Ch(Ht)),Ht.step.id===se&&(vt=!0)})}let nu=!1;Ce.forEach(vt=>{nu&&(vh(vt,sa.IDLE),Ch(vt)),vt.step.id===se&&(nu=!0)})}),eu(),Le==null||Le.emit("execute",{reInitialize:!1,steps:Uu,fromStep:{fromStepId:se,parentStepIdChain:me}}))},xe=(se,me,Ce)=>{if(Ce.length===0)se.push(me);else if(Ce.length===1)se.splice(Ce[0],0,me);else{const _e=j4(se,Ce);let He=Ce[Ce.length-1];_e.step.type===Fe.AI_ACTION&&me.step.type===Fe.PRESET_ACTION&&me.step.command.type!==H.SUCCESS&&He===_e.children.length&&(He=_e.children.length-1),_e.children.splice(He,0,me)}},lu=(se,me)=>{Ze(Ce=>{var He;Ce.forEach(nu=>{nu.editing=!1,nu.children.forEach(vt=>{vt.editing=!1})});let _e;se.type===Fe.AI_ACTION?(_e=ys({id:tt(),type:Fe.AI_ACTION,text:""}),_e.expanded=!0,_e.editing=!0):se.type===Fe.AI_ACTION_DYNAMIC?(_e=ys({id:tt(),type:Fe.AI_ACTION_DYNAMIC,text:""}),_e.expanded=!0,_e.editing=!0,_e.aiActionLatestMessage=void 0):se.type==="RESOLVED_MODULE"?(_e=ys({...se,type:"RESOLVED_MODULE",inputs:(He=se.parameters)!=null&&He.length?{}:void 0,id:tt()}),_e.children=N4(se.steps),_e.expanded=!0,_e.editing=!1):(_e=ys({id:tt(),type:Fe.PRESET_ACTION,command:iT(se.command)}),_e.editing=!0),xe(Ce,_e,me),xu(Ce,me)})},xu=(se,me)=>{const Ce=se[me[0]];if(!Ce||Ce.step.type!=="RESOLVED_MODULE")return;const _e=Ce.step.moduleId,He=[];for(let nu=0;nu<se.length;nu++){const vt=se[nu];nu!==me[0]&&vt.step.type==="RESOLVED_MODULE"&&vt.step.moduleId===_e&&He.push(nu)}for(const nu of He){const vt=se[nu];if(me.length>1&&(vt.children=jLe(vt.children,Ce.children)),vt.step.type==="RESOLVED_MODULE"){const Ht=tSe.parse(Ce.step);Object.assign(vt.step,Ht)}vt.status=sa.IDLE,vt.output=void 0}},kt=(se,me,Ce)=>{eu();const _e=He=>{const nu=rp(He,Ce);if(!nu){const Ht=ys(se);xe(He,Ht,Ce);return}const vt=nu.step;if(nu.step=se,nu.status=sa.IDLE,nu.output=void 0,(vt.type!=="RESOLVED_MODULE"&&se.type==="RESOLVED_MODULE"||vt.type==="RESOLVED_MODULE"&&se.type==="RESOLVED_MODULE"&&vt.moduleId!==se.moduleId)&&(nu.children=se.steps.map(Ht=>ys(Ht))),se.type===Fe.AI_ACTION&&(nu.children=[],nu.message=void 0),se.type===Fe.AI_ACTION_DYNAMIC&&(nu.aiActionLatestMessage=void 0),Ce.length>1){const Ht=j4(He,Ce),gn=Ce[Ce.length-1];Ht.children[gn].step=se,Ht.status=sa.IDLE,Ht.output=void 0}xu(He,Ce)};if(Ze(_e),me){if(!ne)return;const He=EJe(We,_e);Ze(Ht=>{const gn=rp(Ht,Ce);gn&&(vh(gn,sa.IDLE),Ch(gn))});const{result:nu,parentChain:vt}=PLt(He,Ce);if(!nu)return;Te(!0),eu(),Le==null||Le.emit("execute",{reInitialize:!1,steps:mE(He),fromStep:{fromStepId:nu.step.id,parentStepIdChain:vt.map(Ht=>Ht.step.id)},toStep:{toStepId:nu.step.id,parentStepIdChain:vt.map(Ht=>Ht.step.id)}})}},ha=se=>{Ze(me=>{if(se.length===1)me.splice(se[0],1);else if(se.length>1){const Ce=j4(me,se),_e=se[se.length-1];Ce.children.splice(_e,1),xu(me,se)}})},za=se=>{Ze(me=>{if(se.length===1){const Ce=se[0];if(Ce===0)return;const[_e]=me.splice(Ce,1);me.unshift(_e)}else if(se.length>1){const Ce=se[se.length-1];if(Ce===0)return;const _e=j4(me,se),[He]=_e.children.splice(Ce,1);_e.children.unshift(He),xu(me,se)}})},Xa=se=>{Ze(me=>{if(se.length===1){const Ce=se[0];if(Ce===0)return;const _e=me[Ce];me[Ce]=me[Ce-1],me[Ce-1]=_e}else if(se.length>1){const Ce=se[se.length-1];if(Ce===0)return;const _e=j4(me,se);vfe(_e.children,Ce,Ce-1),xu(me,se)}})},ln=se=>{Ze(me=>{if(se.length===1){const Ce=se[0];if(Ce===me.length-1)return;const _e=me[Ce];me[Ce]=me[Ce+1],me[Ce+1]=_e}else if(se.length>1){const Ce=j4(me,se),_e=se[se.length-1];if(_e===Ce.children.length-1)return;vfe(Ce.children,_e,_e+1),xu(me,se)}})},Un=se=>{Ze(me=>{if(se.length===1){const Ce=se[0];if(Ce===me.length-1)return;const[_e]=me.splice(Ce,1);me.push(_e)}else if(se.length>1){const Ce=se[se.length-1],_e=j4(me,se);if(Ce===_e.children.length-1)return;const[He]=_e.children.splice(Ce,1);_e.children.push(He),xu(me,se)}})},th=se=>{Ze(me=>{if(se.length===1){const Ce=se[0],[_e]=N4(mE([me[Ce]]));_e.step.id=tt(),"command"in _e.step&&(_e.step.command.id=tt()),me.splice(Ce+1,0,_e)}else if(se.length>1){const Ce=j4(me,se),_e=se[se.length-1],[He]=N4(mE([Ce.children[_e]]));He.step.id=tt(),"command"in He.step&&(He.step.command.id=tt()),Ce.children.splice(_e+1,0,He),xu(me,se)}})},ah=se=>{Ze(me=>{const Ce=rp(me,se);if(!Ce||Ce.step.type!==Fe.AI_ACTION&&Ce.step.type!=="RESOLVED_MODULE"&&Ce.step.type!==Fe.AI_ACTION_DYNAMIC)return;const _e=Ce.children.map(He=>He.step).filter(He=>!(He.type===Fe.PRESET_ACTION&&He.command.type===H.SUCCESS));if(_e.forEach(He=>{He.id=tt(),"command"in He&&(He.command.id=tt())}),se.length===1){const He=se[0],nu=N4(_e);me.splice(He,1,...nu)}else if(se.length>1){const He=j4(me,se),nu=se[se.length-1],vt=N4(_e);He.children.splice(nu,1,...vt),xu(me,se)}})},Wm=(se,me)=>{Ze(Ce=>{const _e=rp(Ce,me);_e&&(_e.selected=se)})},nh=(se,me)=>{Ze(Ce=>{const _e=rp(Ce,me);_e&&(_e.expanded=se)})},q$=(se,me,Ce)=>{var He;if(eu(),me.type!==H.VISUAL_DIFF&&!se){Ce==null||Ce(void 0,"Cannot locate element without description");return}const _e=vm.parse(e);(He=Le==null?void 0:Le.emit)==null||He.call(Le,"locate",{description:se,command:me,testMetadata:_e,returnScreenshot:me.type===H.VISUAL_DIFF},({result:nu,err:vt})=>{Ce==null||Ce(nu,vt)})},rh=ia((se,me)=>{var Ce;eu(),(Ce=Le==null?void 0:Le.emit)==null||Ce.call(Le,"lintStep",{command:se},({result:_e})=>{me==null||me(_e)})}),zy=()=>{ye(!1),Ze(se=>{se.forEach(me=>{me.selected=!1})})},j8=se=>{const me=We.findIndex(Ce=>Ce.selected&&CA(Ce.step));Ze(Ce=>Ce.filter(_e=>!(_e.selected&&CA(_e.step)))),Ze(Ce=>{Ce.splice(me,0,{uniqueId:tt(),step:{...se,type:"RESOLVED_MODULE",id:tt()},status:sa.IDLE,selected:!1,editing:!1,expanded:!0,readonly:!1,children:N4(se.steps)})}),ye(!1)},Z$=()=>{ye(!0),Ze(se=>{se.forEach(me=>{me.editing=!1,me.children.forEach(Ce=>{Ce.editing=!1})})})},Jm=ia(se=>{Su(se)});return{logs:l,networkPages:d,networkEntries:h,a11yTree:m,isLoadingA11yTree:x,html:v,isLoadingHtml:y,validState:ua,hasDiff:Ru,screenshot:r,isInPageLoad:F,userAgent:o,viewport:L,url:U,baseUrl:M,activeEnv:K,iframeSrcUrls:$,initialized:Q,executing:Ue,canceling:ae,recording:Z,error:$e,creatingModule:X,stepsState:We,steps:Uu,testContext:J,tabs:S,activeTab:_,lastMouseLocation:G,lintTriggerKey:T,interactive:R,section:lr,stepLists:Re,debouncedStepLists:Nu,lastSavedStepLists:ka,canExecute:ne,canRefresh:Oe,canRecord:oe,canEdit:ee,handleActiveTabChange:se=>{j(se),Le==null||Le.emit("switchTab",{url:se})},handleEditChange:(se,me)=>{Ze(Ce=>{const _e=rp(Ce,me);_e&&(Ce.forEach(He=>{He.uniqueId!==_e.uniqueId&&(He.editing=!1,He.children.forEach(nu=>{nu.uniqueId!==_e.uniqueId&&(nu.editing=!1)}))}),_e.editing=se)})},handleRefresh:uh,handleReset:L0,handleRunAllSteps:wy,handleExecute:ke,handleExecuteTo:Me,handleExecuteFrom:Je,handleAdd:lu,handleStepChange:kt,handleDelete:ha,handleMoveToTop:za,handleMoveUp:Xa,handleMoveDown:ln,handleMoveToBottom:Un,handleDuplicate:th,handleUngroup:ah,handleSelectChange:Wm,handleExpandChange:nh,handleLocate:q$,handleLintStep:rh,handleStartCreatingModule:Z$,handleCreateModuleSuccess:j8,handleCancelCreateModule:zy,handleSaveTestSuccess:Jm,handleToggleRecord:()=>{if(eu(),Z)Le==null||Le.emit("recordingStop"),Ee(!1);else{const se=rp(We,[We.length-1]);Le==null||Le.emit("recordingStart",{stepId:se==null?void 0:se.step.id}),Ee(!0),I(!0)}},handleCancelExecution:Xl,handleTrapKeyDown:Tx,handleTrapKeyUp:Mx,handleTrapMouseEvent:Oy,handleTrapWheel:ce,handleStartRecordingTarget:(se,me,Ce)=>{eu(),Le==null||Le.emit("recordTargetClick",{stepId:se,parentStepIdChain:me,attribute:Ce}),I(!0),Ze(_e=>{const He=Gi(_e,se,me);He&&(He.targetRecordingState={phase:z1.INITIALIZING,msg:"Initializing recording handlers. Please wait...."})})},handleFetchA11yTree:()=>{Le&&(g(!0),Le.emit("fetchA11yTree",void 0,se=>{se.err&&nn.error(`An unexpected error occurred: ${se.err}.`,{duration:6e4}),p(se.a11yTree),g(!1)}))},handleFetchHtml:()=>{Le&&(b(!0),Le.emit("fetchDom",void 0,se=>{se.err&&nn.error(`An unexpected error occurred: ${se.err}.`,{duration:6e4}),C(se.html),b(!1)}))},handleInteractiveChange:se=>{eu(),I(se)},handleSectionChange:j0}};var BJe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ixe=N.createContext&&N.createContext(BJe),$oa=["attr","size","title"];function Ioa(u,e){if(u==null)return{};var t=Koa(u,e),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(u);for(n=0;n<r.length;n++)a=r[n],!(e.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(u,a)&&(t[a]=u[a])}return t}function Koa(u,e){if(u==null)return{};var t={},a=Object.keys(u),n,r;for(r=0;r<a.length;r++)n=a[r],!(e.indexOf(n)>=0)&&(t[n]=u[n]);return t}function XM(){return XM=Object.assign?Object.assign.bind():function(u){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(u[a]=t[a])}return u},XM.apply(this,arguments)}function oxe(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(u);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(u,n).enumerable})),t.push.apply(t,a)}return t}function eP(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?oxe(Object(t),!0).forEach(function(a){Hoa(u,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):oxe(Object(t)).forEach(function(a){Object.defineProperty(u,a,Object.getOwnPropertyDescriptor(t,a))})}return u}function Hoa(u,e,t){return e=Voa(e),e in u?Object.defineProperty(u,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):u[e]=t,u}function Voa(u){var e=Goa(u,"string");return typeof e=="symbol"?e:String(e)}function Goa(u,e){if(typeof u!="object"||u===null)return u;var t=u[Symbol.toPrimitive];if(t!==void 0){var a=t.call(u,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(u)}function SJe(u){return u&&u.map((e,t)=>N.createElement(e.tag,eP({key:t},e.attr),SJe(e.child)))}function wJe(u){return e=>N.createElement(Uoa,XM({attr:eP({},u.attr)},e),SJe(u.child))}function Uoa(u){var e=t=>{var{attr:a,size:n,title:r}=u,i=Ioa(u,$oa),o=n||t.size||"1em",s;return t.className&&(s=t.className),u.className&&(s=(s?s+" ":"")+u.className),N.createElement("svg",XM({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,i,{className:s,style:eP(eP({color:u.color||t.color},t.style),u.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),r&&N.createElement("title",null,r),u.children)};return ixe!==void 0?N.createElement(ixe.Consumer,null,t=>e(t)):e(BJe)}function Woa(u){return wJe({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z"},child:[]},{tag:"path",attr:{d:"M12 15l0 4"},child:[]},{tag:"path",attr:{d:"M14 17l-4 0"},child:[]}]})(u)}function Joa(u){return wJe({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z"},child:[]},{tag:"path",attr:{d:"M12 9v-4"},child:[]},{tag:"path",attr:{d:"M10 7l4 0"},child:[]}]})(u)}const zo=k.forwardRef((u,e)=>D.jsxs(Ir,{disableHoverableContent:!0,children:[D.jsx(Kr,{asChild:!0,children:D.jsx(ut,{ref:e,variant:"plain",size:"icon",...u})}),D.jsx(yr,{children:u.tooltip})]}));zo.displayName="IconButtonWithTooltip";const qoa=u=>D.jsxs(D.Fragment,{children:[D.jsx(zo,{tooltip:"Run",onClick:u.onExecute,disabled:u.disabled||u.skipped,className:"rounded-r-none",children:D.jsx(jMe,{className:"h-4 w-4"})}),D.jsx(zo,{tooltip:"Run to",onClick:u.onExecuteTo,disabled:u.disabled||u.skipped,className:"rounded-none",children:D.jsx(E9t,{className:"h-4 w-4"})}),D.jsx(zo,{tooltip:"Run from",onClick:u.onExecuteFrom,disabled:u.disabled||u.skipped,className:"rounded-none",children:D.jsx(f9t,{className:"h-4 w-4"})}),D.jsx(zo,{tooltip:"Edit",onClick:u.onEdit,disabled:u.disabled,className:"rounded-none",children:D.jsx(rne,{className:"h-4 w-4"})}),D.jsx(zo,{tooltip:"Duplicate",onClick:u.onDuplicate,disabled:u.disabled,className:"rounded-none",children:D.jsx(une,{className:"h-4 w-4"})}),u.canUngroup&&D.jsx(zo,{tooltip:"Ungroup",className:"rounded-none",disabled:u.disabled,onClick:u.onUngroup,children:D.jsx(g9t,{className:"h-4 w-4"})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Move to the top",onClick:u.onMoveToTop,disabled:u.disabled,className:"rounded-none",children:D.jsx(x7t,{className:"h-4 w-4"})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Move up",onClick:u.onMoveUp,disabled:u.disabled,className:"rounded-none",children:D.jsx(QJ,{className:"h-4 w-4"})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Move down",onClick:u.onMoveDown,disabled:u.disabled,className:"rounded-none",children:D.jsx(ZJ,{className:"h-4 w-4"})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Move to the bottom",onClick:u.onMoveToBottom,disabled:u.disabled,className:"rounded-none",children:D.jsx(m7t,{className:"h-4 w-4"})}),D.jsx(wz,{onAdd:u.onAddBefore,hideModules:u.hideModules,modules:u.modules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly,children:D.jsx(zo,{tooltip:"Add before",className:"rounded-none",disabled:u.disabled,children:D.jsx(Joa,{className:"h-4 w-4"})})}),u.canAddAfter&&D.jsx(wz,{onAdd:u.onAddAfter,hideModules:u.hideModules,modules:u.modules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsOnly,children:D.jsx(zo,{tooltip:"Add after",className:"rounded-none",disabled:u.disabled,children:D.jsx(Woa,{className:"h-4 w-4"})})}),u.canAddChild&&D.jsx(wz,{onAdd:u.onAddChild,hideModules:!0,modules:u.modules,aiSuggestibleCommandsOnly:u.aiSuggestibleCommandsChildrenOnly,children:D.jsx(zo,{tooltip:"Add child",className:"rounded-none",disabled:u.disabled,children:D.jsx(R7t,{className:"h-4 w-4"})})}),!u.disableMoveAndDelete&&D.jsx(zo,{tooltip:"Delete",className:"rounded-l-none",disabled:u.disabled,onClick:u.onDelete,children:D.jsx(D9t,{className:"text-destructive h-4 w-4"})})]}),sxe=u=>{const e=k.useMemo(()=>u.status===sa.FAILED?D.jsx(_Me,{className:"text-destructive h-6 w-6"}):u.status===sa.CANCELLED?D.jsx(OMe,{className:"h-6 w-6 text-yellow-600"}):u.status===sa.SUCCESS?D.jsx(B7t,{className:"text-success h-6 w-6"}):D.jsx(ane,{className:"h-6 w-6 animate-spin"}),[u.status]);return D.jsxs("div",{className:"hover:border-foreground focus-visible:border-foreground bg-background grid grid-cols-[auto_1fr] gap-4 overflow-auto rounded-lg border p-4 outline-none ring-0 transition-all",children:[e,D.jsx("span",{className:"break-words",children:u.message})]})};var cY={exports:{}};(function(u,e){(function(t,a){var n="1.0.37",r="",i="?",o="function",s="undefined",l="object",c="string",d="major",E="model",h="name",f="type",m="vendor",p="version",x="architecture",g="console",v="mobile",C="tablet",y="smarttv",b="wearable",F="embedded",O=500,T="Amazon",P="Apple",z="ASUS",A="BlackBerry",S="Browser",w="Chrome",_="Edge",j="Firefox",K="Google",M="Huawei",L="LG",G="Microsoft",V="Motorola",R="Opera",I="Samsung",U="Sharp",W="Sony",$="Xiaomi",q="Zebra",Q="Facebook",ue="Chromium OS",ae="Mac OS",le=function(oe,Oe){var $e={};for(var Xe in oe)Oe[Xe]&&Oe[Xe].length%2===0?$e[Xe]=Oe[Xe].concat(oe[Xe]):$e[Xe]=oe[Xe];return $e},Z=function(oe){for(var Oe={},$e=0;$e<oe.length;$e++)Oe[oe[$e].toUpperCase()]=oe[$e];return Oe},Ee=function(oe,Oe){return typeof oe===c?fe(Oe).indexOf(fe(oe))!==-1:!1},fe=function(oe){return oe.toLowerCase()},ve=function(oe){return typeof oe===c?oe.replace(/[^\d\.]/g,r).split(".")[0]:a},X=function(oe,Oe){if(typeof oe===c)return oe=oe.replace(/^\s\s*/,r),typeof Oe===s?oe:oe.substring(0,O)},ye=function(oe,Oe){for(var $e=0,Xe,qe,au,eu,fu,st;$e<Oe.length&&!fu;){var Kt=Oe[$e],Za=Oe[$e+1];for(Xe=qe=0;Xe<Kt.length&&!fu&&Kt[Xe];)if(fu=Kt[Xe++].exec(oe),fu)for(au=0;au<Za.length;au++)st=fu[++qe],eu=Za[au],typeof eu===l&&eu.length>0?eu.length===2?typeof eu[1]==o?this[eu[0]]=eu[1].call(this,st):this[eu[0]]=eu[1]:eu.length===3?typeof eu[1]===o&&!(eu[1].exec&&eu[1].test)?this[eu[0]]=st?eu[1].call(this,st,eu[2]):a:this[eu[0]]=st?st.replace(eu[1],eu[2]):a:eu.length===4&&(this[eu[0]]=st?eu[3].call(this,st.replace(eu[1],eu[2])):a):this[eu]=st||a;$e+=2}},Ue=function(oe,Oe){for(var $e in Oe)if(typeof Oe[$e]===l&&Oe[$e].length>0){for(var Xe=0;Xe<Oe[$e].length;Xe++)if(Ee(Oe[$e][Xe],oe))return $e===i?a:$e}else if(Ee(Oe[$e],oe))return $e===i?a:$e;return oe},Te={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},J={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"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,p],[/opios[\/ ]+([\w\.]+)/i],[p,[h,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[h,R]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[h,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[h,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[h,"Smart Lenovo "+S]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+S],p],[/\bfocus\/([\w\.]+)/i],[p,[h,j+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[h,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[h,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[h,"MIUI "+S]],[/fxios\/([-\w\.]+)/i],[p,[h,j]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+S]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+S],p],[/samsungbrowser\/([\w\.]+)/i],[p,[h,I+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],p],[/metasr[\/ ]?([\d\.]+)/i],[p,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[h,p],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,Q],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[h,w+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,w+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[h,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[p,Ue,Te]],[/(webkit|khtml)\/([\w\.]+)/i],[h,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[h,j+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,p],[/(cobalt)\/([\w\.]+)/i],[h,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[x,"amd64"]],[/(ia32(?=;))/i],[[x,fe]],[/((?:i[346]|x)86)[;\)]/i],[[x,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[x,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[x,"armhf"]],[/windows (ce|mobile); ppc;/i],[[x,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[x,/ower/,r,fe]],[/(sun4\w)[;\)]/i],[[x,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[x,fe]]],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],[E,[m,I],[f,C]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[E,[m,I],[f,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[E,[m,P],[f,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[E,[m,P],[f,C]],[/(macintosh);/i],[E,[m,P]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[E,[m,U],[f,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[E,[m,M],[f,C]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[E,[m,M],[f,v]],[/\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)?)(?: bui|\))/i],[[E,/_/g," "],[m,$],[f,v]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[E,/_/g," "],[m,$],[f,C]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[E,[m,"OPPO"],[f,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[E,[m,"Vivo"],[f,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[E,[m,"Realme"],[f,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[E,[m,V],[f,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[E,[m,V],[f,C]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[E,[m,L],[f,C]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[E,[m,L],[f,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[E,[m,"Lenovo"],[f,C]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[E,/_/g," "],[m,"Nokia"],[f,v]],[/(pixel c)\b/i],[E,[m,K],[f,C]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[E,[m,K],[f,v]],[/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],[E,[m,W],[f,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[E,"Xperia Tablet"],[m,W],[f,C]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[E,[m,"OnePlus"],[f,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[E,[m,T],[f,C]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[E,/(.+)/g,"Fire Phone $1"],[m,T],[f,v]],[/(playbook);[-\w\),; ]+(rim)/i],[E,m,[f,C]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[E,[m,A],[f,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[E,[m,z],[f,C]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[E,[m,z],[f,v]],[/(nexus 9)/i],[E,[m,"HTC"],[f,C]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[E,/_/g," "],[f,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[E,[m,"Acer"],[f,C]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[E,[m,"Meizu"],[f,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[E,[m,"Ulefone"],[f,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[m,E,[f,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/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],[m,E,[f,C]],[/(surface duo)/i],[E,[m,G],[f,C]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[E,[m,"Fairphone"],[f,v]],[/(u304aa)/i],[E,[m,"AT&T"],[f,v]],[/\bsie-(\w*)/i],[E,[m,"Siemens"],[f,v]],[/\b(rct\w+) b/i],[E,[m,"RCA"],[f,C]],[/\b(venue[\d ]{2,7}) b/i],[E,[m,"Dell"],[f,C]],[/\b(q(?:mv|ta)\w+) b/i],[E,[m,"Verizon"],[f,C]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[E,[m,"Barnes & Noble"],[f,C]],[/\b(tm\d{3}\w+) b/i],[E,[m,"NuVision"],[f,C]],[/\b(k88) b/i],[E,[m,"ZTE"],[f,C]],[/\b(nx\d{3}j) b/i],[E,[m,"ZTE"],[f,v]],[/\b(gen\d{3}) b.+49h/i],[E,[m,"Swiss"],[f,v]],[/\b(zur\d{3}) b/i],[E,[m,"Swiss"],[f,C]],[/\b((zeki)?tb.*\b) b/i],[E,[m,"Zeki"],[f,C]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],E,[f,C]],[/\b(ns-?\w{0,9}) b/i],[E,[m,"Insignia"],[f,C]],[/\b((nxa|next)-?\w{0,9}) b/i],[E,[m,"NextBook"],[f,C]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],E,[f,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],E,[f,v]],[/\b(ph-1) /i],[E,[m,"Essential"],[f,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[E,[m,"Envizen"],[f,C]],[/\b(trio[-\w\. ]+) b/i],[E,[m,"MachSpeed"],[f,C]],[/\btu_(1491) b/i],[E,[m,"Rotor"],[f,C]],[/(shield[\w ]+) b/i],[E,[m,"Nvidia"],[f,C]],[/(sprint) (\w+)/i],[m,E,[f,v]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[m,G],[f,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[E,[m,q],[f,C]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[E,[m,q],[f,v]],[/smart-tv.+(samsung)/i],[m,[f,y]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[m,I],[f,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,L],[f,y]],[/(apple) ?tv/i],[m,[E,P+" TV"],[f,y]],[/crkey/i],[[E,w+"cast"],[m,K],[f,y]],[/droid.+aft(\w+)( bui|\))/i],[E,[m,T],[f,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[E,[m,U],[f,y]],[/(bravia[\w ]+)( bui|\))/i],[E,[m,W],[f,y]],[/(mitv-\w{5}) bui/i],[E,[m,$],[f,y]],[/Hbbtv.*(technisat) (.*);/i],[m,E,[f,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,X],[E,X],[f,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,E,[f,g]],[/droid.+; (shield) bui/i],[E,[m,"Nvidia"],[f,g]],[/(playstation [345portablevi]+)/i],[E,[m,W],[f,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[E,[m,G],[f,g]],[/((pebble))app/i],[m,E,[f,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[E,[m,P],[f,b]],[/droid.+; (glass) \d/i],[E,[m,K],[f,b]],[/droid.+; (wt63?0{2,3})\)/i],[E,[m,q],[f,b]],[/(quest( 2| pro)?)/i],[E,[m,Q],[f,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[f,F]],[/(aeobc)\b/i],[E,[m,T],[f,F]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[E,[f,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[E,[f,C]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,C]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,v]],[/(android[-\w\. ]{0,9});.+buil/i],[E,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[h,_+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[p,Ue,J]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,Ue,J],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,ae],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,p],[/\(bb(10);/i],[p,[h,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[h,j+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[h,w+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,ue],p],[/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) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,p],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,p]]},re=function(oe,Oe){if(typeof oe===l&&(Oe=oe,oe=a),!(this instanceof re))return new re(oe,Oe).getResult();var $e=typeof t!==s&&t.navigator?t.navigator:a,Xe=oe||($e&&$e.userAgent?$e.userAgent:r),qe=$e&&$e.userAgentData?$e.userAgentData:a,au=Oe?le(Y,Oe):Y,eu=$e&&$e.userAgent==Xe;return this.getBrowser=function(){var fu={};return fu[h]=a,fu[p]=a,ye.call(fu,Xe,au.browser),fu[d]=ve(fu[p]),eu&&$e&&$e.brave&&typeof $e.brave.isBrave==o&&(fu[h]="Brave"),fu},this.getCPU=function(){var fu={};return fu[x]=a,ye.call(fu,Xe,au.cpu),fu},this.getDevice=function(){var fu={};return fu[m]=a,fu[E]=a,fu[f]=a,ye.call(fu,Xe,au.device),eu&&!fu[f]&&qe&&qe.mobile&&(fu[f]=v),eu&&fu[E]=="Macintosh"&&$e&&typeof $e.standalone!==s&&$e.maxTouchPoints&&$e.maxTouchPoints>2&&(fu[E]="iPad",fu[f]=C),fu},this.getEngine=function(){var fu={};return fu[h]=a,fu[p]=a,ye.call(fu,Xe,au.engine),fu},this.getOS=function(){var fu={};return fu[h]=a,fu[p]=a,ye.call(fu,Xe,au.os),eu&&!fu[h]&&qe&&qe.platform!="Unknown"&&(fu[h]=qe.platform.replace(/chrome os/i,ue).replace(/macos/i,ae)),fu},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 Xe},this.setUA=function(fu){return Xe=typeof fu===c&&fu.length>O?X(fu,O):fu,this},this.setUA(Xe),this};re.VERSION=n,re.BROWSER=Z([h,p,d]),re.CPU=Z([x]),re.DEVICE=Z([E,m,f,g,v,y,C,b,F]),re.ENGINE=re.OS=Z([h,p]),u.exports&&(e=u.exports=re),e.UAParser=re;var ee=typeof t!==s&&(t.jQuery||t.Zepto);if(ee&&!ee.ua){var ne=new re;ee.ua=ne.getResult(),ee.ua.get=function(){return ne.getUA()},ee.ua.set=function(oe){ne.setUA(oe);var Oe=ne.getResult();for(var $e in Oe)ee.ua[$e]=Oe[$e]}}})(typeof window=="object"?window:Ne)})(cY,cY.exports);var Zoa=cY.exports;const Qoa=ea(Zoa);var Yoa="Toggle",OJe=k.forwardRef((u,e)=>{const{pressed:t,defaultPressed:a=!1,onPressedChange:n,...r}=u,[i=!1,o]=Is({prop:t,onChange:n,defaultProp:a});return D.jsx(Dt.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":u.disabled?"":void 0,...r,ref:e,onClick:pu(u.onClick,()=>{u.disabled||o(!i)})})});OJe.displayName=Yoa;var zJe=OJe;const Xoa=QD("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),_Je=k.forwardRef(({className:u,variant:e,size:t,...a},n)=>D.jsx(zJe,{ref:n,className:Pe(Xoa({variant:e,size:t,className:u})),...a}));_Je.displayName=zJe.displayName;const Cie=k.forwardRef(({className:u,...e},t)=>D.jsx("div",{className:"relative w-full overflow-auto",children:D.jsx("table",{ref:t,className:Pe("w-full caption-bottom text-sm",u),...e})}));Cie.displayName="Table";const yie=k.forwardRef(({className:u,...e},t)=>D.jsx("thead",{ref:t,className:Pe("[&_tr]:border-b",u),...e}));yie.displayName="TableHeader";const bie=k.forwardRef(({className:u,...e},t)=>D.jsx("tbody",{ref:t,className:Pe("[&>:last-child]:border-0",u),...e}));bie.displayName="TableBody";const TJe=k.forwardRef(({className:u,...e},t)=>D.jsx("tfoot",{ref:t,className:Pe("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",u),...e}));TJe.displayName="TableFooter";const B5=k.forwardRef(({className:u,...e},t)=>D.jsx("tr",{ref:t,className:Pe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",u),...e}));B5.displayName="TableRow";const H6=k.forwardRef(({className:u,...e},t)=>D.jsx("th",{ref:t,className:Pe("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",u),...e}));H6.displayName="TableHead";const af=k.forwardRef(({className:u,...e},t)=>D.jsx("td",{ref:t,className:Pe("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",u),...e}));af.displayName="TableCell";const esa=k.forwardRef(({className:u,...e},t)=>D.jsx("caption",{ref:t,className:Pe("text-muted-foreground mt-4 text-sm",u),...e}));esa.displayName="TableCaption";const Zu=k.forwardRef(({className:u,tooltip:e,...t},a)=>D.jsxs(Ir,{children:[D.jsx(Kr,{asChild:!0,children:D.jsx(Et,{ref:a,className:Pe("decoration-primary/20 underline decoration-dashed underline-offset-4",u),...t})}),D.jsx(yr,{side:"right",align:"center",sideOffset:12,className:"max-w-xs break-words",children:e})]}));Zu.displayName="FormLabelWithTooltip";const h1=k.forwardRef(({className:u,...e},t)=>D.jsx("p",{ref:t,className:Pe("text-muted-foreground text-[0.8rem]",u),...e}));h1.displayName="FormDescription";const Rt=k.forwardRef(({className:u,...e},t)=>D.jsx("p",{ref:t,className:Pe("text-destructive text-[0.8rem] font-medium",u),...e}));Rt.displayName="FormMessage";const lxe=({children:u})=>D.jsx("div",{className:"space-y-2",children:u}),cxe=Et,usa=X9.pick({parameters:!0,defaultParameters:!0,parameterEnums:!0,defaultCacheKey:!0,defaultCacheTtl:!0,defaultCacheAllInvocations:!0,autoAuth:!0,advanced:!0}),tsa=({step:u,onChange:e})=>{const[t,a]=k.useState(!1),n=ex({mode:"onChange",resolver:ux(usa),defaultValues:{parameters:u.parameters,defaultParameters:u.defaultParameters,parameterEnums:u.parameterEnums,defaultCacheKey:u.defaultCacheKey,defaultCacheTtl:u.defaultCacheTtl,defaultCacheAllInvocations:u.defaultCacheAllInvocations,autoAuth:u.autoAuth,advanced:u.advanced}});function r(d){e({...u,parameters:d.parameters,defaultParameters:d.defaultParameters,parameterEnums:d.parameterEnums,defaultCacheKey:d.defaultCacheKey,defaultCacheTtl:d.defaultCacheTtl,defaultCacheAllInvocations:d.defaultCacheAllInvocations,autoAuth:d.autoAuth,advanced:d.advanced}),a(!1)}k.useEffect(()=>{n.reset({parameters:u.parameters,defaultParameters:u.defaultParameters,parameterEnums:u.parameterEnums,defaultCacheKey:u.defaultCacheKey,defaultCacheTtl:u.defaultCacheTtl,defaultCacheAllInvocations:u.defaultCacheAllInvocations,autoAuth:u.autoAuth,advanced:u.advanced})},[n,t,u]);const{isDirty:i,isValid:o}=n.formState,s=n.watch(),[l,c]=k.useState("");return D.jsxs(Vd,{open:t,onOpenChange:a,children:[D.jsx(Gd,{asChild:!0,children:D.jsxs(ut,{variant:"outline",children:[D.jsx(LMe,{className:"h-4 w-4"}),"Global module settings"]})}),D.jsxs(l4,{children:[D.jsxs(c4,{children:[D.jsx(d4,{children:"Global settings"}),D.jsx(Ud,{children:"Configure global settings for this modules. These settings will apply to all tests that use this module."})]}),D.jsx(tx,{...n,children:D.jsxs("form",{onSubmit:n.handleSubmit(r),className:"space-y-4",children:[D.jsxs(bl,{defaultValue:"parameters",children:[D.jsxs(Ms,{children:[D.jsx(ma,{value:"parameters",children:"Parameters"}),D.jsx(ma,{value:"cache",children:"Cache"})]}),D.jsxs(pa,{value:"parameters",className:"space-y-4",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx(ta,{placeholder:"PARAMETER_NAME",value:l,onChange:d=>c(d.target.value)}),D.jsxs(ut,{variant:"outline",disabled:!l,onClick:()=>{c(""),n.setValue("parameters",[...s.parameters??[],l],{shouldDirty:!0}),n.setValue("defaultParameters",{...s.defaultParameters??{},[l]:""},{shouldDirty:!0})},children:[D.jsx(YD,{}),"Add parameter"]})]}),D.jsx(asa,{value:{parameters:s.parameters,defaultParameters:s.defaultParameters},onChange:d=>{n.setValue("parameters",d.parameters,{shouldDirty:!0}),n.setValue("defaultParameters",d.defaultParameters,{shouldDirty:!0})}})]}),D.jsxs(pa,{value:"cache",className:"space-y-4",children:[D.jsx(Xt,{control:n.control,name:"defaultCacheAllInvocations",render:({field:d})=>D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Force all invocations of this module across your organization to use the cache. A 'Default cache key' must be configured to enable this setting.",children:"Enable caching globally"}),D.jsx(qt,{children:D.jsx("div",{children:D.jsx(T1,{onCheckedChange:E=>{E||n.setValue("autoAuth",!1),d.onChange(E)},checked:d.value??!1})})}),D.jsx(Zt,{})]})}),D.jsx(Xt,{control:n.control,name:"autoAuth",render:({field:d})=>D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Automatically save the current auth state, which includes cookies, local storage, and other data, at the end of the module and write it to the cache. If an invocation hits the cache, automatically load the result into the browser. Can only be enabled if global caching is on.",children:"Treat as auth module"}),D.jsx(qt,{children:D.jsx("div",{children:D.jsx(T1,{disabled:!s.defaultCacheAllInvocations,onCheckedChange:E=>{E||n.setValue("advanced",{cacheInvalidation:void 0}),d.onChange(E)},checked:d.value??!1})})}),D.jsx(Zt,{})]})}),D.jsx(Xt,{control:n.control,name:"advanced.cacheInvalidation",render:({field:d})=>{var E;return D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Automatically invalidate and re-execute the module if the page content does not contain the provided string after loading an auth module's cached state. Useful if you're not sure when your auth TTL will elapse.",children:"Invalidate with page check"}),D.jsx(qt,{children:D.jsx(et,{singleLine:!0,disableLineNumbers:!0,disabled:!s.autoAuth||!s.defaultCacheAllInvocations,value:((E=d.value)==null?void 0:E.type)==="PAGE_CHECK"&&d.value.substring?d.value.substring:"",language:"template-string",onChange:h=>{if(!h){d.onChange(void 0);return}d.onChange({type:"PAGE_CHECK",substring:h})}})}),D.jsx(Zt,{})]})}}),D.jsx(Xt,{control:n.control,name:"defaultCacheKey",render:({field:d})=>D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Default cache key for all invocations of this module that do not have a 'Cache key' option explicitly configured.",children:"Default cache key"}),D.jsx(qt,{children:D.jsx(et,{singleLine:!0,disableLineNumbers:!0,value:d.value||$J,language:"template-string",onChange:E=>{if(!E||E===$J){d.onChange(void 0);return}d.onChange(E)}})}),D.jsx(Zt,{})]})}),D.jsx(Xt,{control:n.control,name:"defaultCacheTtl",render:({field:d})=>D.jsxs(Jt,{children:[D.jsx(Zu,{tooltip:"Default TTL for all invocations of this module that do not have an 'Expiry seconds' option explicitly configured.",children:"Default expiry seconds"}),D.jsx(qt,{children:D.jsx(ta,{type:"number",min:1,value:d.value?Math.floor(d.value/1e3):void 0,onChange:E=>{let h=parseInt(E.target.value);Number.isNaN(h)&&(h=void 0),d.onChange(h===void 0?void 0:h*1e3)}})}),D.jsx(Zt,{})]})})]})]}),D.jsx(L3,{children:D.jsx(ut,{type:"submit",disabled:!i||!o,children:"Save global module settings"})})]})})]})]})},asa=({value:u,onChange:e})=>{var t,a;return D.jsxs(Cie,{children:[D.jsx(yie,{children:D.jsxs(B5,{children:[D.jsx(H6,{children:"Name"}),D.jsx(H6,{className:"w-full",children:"Default value"}),D.jsx(H6,{className:"w-8"})]})}),D.jsxs(bie,{children:[(t=u.parameters)==null?void 0:t.map((n,r)=>{var i;return D.jsxs(B5,{children:[D.jsx(af,{className:"whitespace-nowrap",children:n}),D.jsx(af,{children:D.jsx(et,{singleLine:!0,value:((i=u.defaultParameters)==null?void 0:i[n])||"",language:"template-string",placeholder:"JavaScript expression",onChange:o=>{e({...u,defaultParameters:{...u.defaultParameters,[n]:o}})}})}),D.jsx(af,{children:D.jsx(ut,{type:"button",variant:"ghost",size:"smIcon",className:"text-destructive hover:text-destructive hover:bg-transparent",onClick:()=>{var s;const o={...u.defaultParameters};delete o[n],e({...u,parameters:(s=u.parameters)==null?void 0:s.filter(l=>l!==n),defaultParameters:o})},children:D.jsx(XD,{className:"h-4 w-4"})})})]},r)}),(a=u.parameters)!=null&&a.length?null:D.jsx(B5,{children:D.jsx(af,{colSpan:3,className:"h-24 text-center",children:"No parameters."})})]})]})};var dY={exports:{}},vr={},EY={exports:{}},mx={};function MJe(){var u={};return u["align-content"]=!1,u["align-items"]=!1,u["align-self"]=!1,u["alignment-adjust"]=!1,u["alignment-baseline"]=!1,u.all=!1,u["anchor-point"]=!1,u.animation=!1,u["animation-delay"]=!1,u["animation-direction"]=!1,u["animation-duration"]=!1,u["animation-fill-mode"]=!1,u["animation-iteration-count"]=!1,u["animation-name"]=!1,u["animation-play-state"]=!1,u["animation-timing-function"]=!1,u.azimuth=!1,u["backface-visibility"]=!1,u.background=!0,u["background-attachment"]=!0,u["background-clip"]=!0,u["background-color"]=!0,u["background-image"]=!0,u["background-origin"]=!0,u["background-position"]=!0,u["background-repeat"]=!0,u["background-size"]=!0,u["baseline-shift"]=!1,u.binding=!1,u.bleed=!1,u["bookmark-label"]=!1,u["bookmark-level"]=!1,u["bookmark-state"]=!1,u.border=!0,u["border-bottom"]=!0,u["border-bottom-color"]=!0,u["border-bottom-left-radius"]=!0,u["border-bottom-right-radius"]=!0,u["border-bottom-style"]=!0,u["border-bottom-width"]=!0,u["border-collapse"]=!0,u["border-color"]=!0,u["border-image"]=!0,u["border-image-outset"]=!0,u["border-image-repeat"]=!0,u["border-image-slice"]=!0,u["border-image-source"]=!0,u["border-image-width"]=!0,u["border-left"]=!0,u["border-left-color"]=!0,u["border-left-style"]=!0,u["border-left-width"]=!0,u["border-radius"]=!0,u["border-right"]=!0,u["border-right-color"]=!0,u["border-right-style"]=!0,u["border-right-width"]=!0,u["border-spacing"]=!0,u["border-style"]=!0,u["border-top"]=!0,u["border-top-color"]=!0,u["border-top-left-radius"]=!0,u["border-top-right-radius"]=!0,u["border-top-style"]=!0,u["border-top-width"]=!0,u["border-width"]=!0,u.bottom=!1,u["box-decoration-break"]=!0,u["box-shadow"]=!0,u["box-sizing"]=!0,u["box-snap"]=!0,u["box-suppress"]=!0,u["break-after"]=!0,u["break-before"]=!0,u["break-inside"]=!0,u["caption-side"]=!1,u.chains=!1,u.clear=!0,u.clip=!1,u["clip-path"]=!1,u["clip-rule"]=!1,u.color=!0,u["color-interpolation-filters"]=!0,u["column-count"]=!1,u["column-fill"]=!1,u["column-gap"]=!1,u["column-rule"]=!1,u["column-rule-color"]=!1,u["column-rule-style"]=!1,u["column-rule-width"]=!1,u["column-span"]=!1,u["column-width"]=!1,u.columns=!1,u.contain=!1,u.content=!1,u["counter-increment"]=!1,u["counter-reset"]=!1,u["counter-set"]=!1,u.crop=!1,u.cue=!1,u["cue-after"]=!1,u["cue-before"]=!1,u.cursor=!1,u.direction=!1,u.display=!0,u["display-inside"]=!0,u["display-list"]=!0,u["display-outside"]=!0,u["dominant-baseline"]=!1,u.elevation=!1,u["empty-cells"]=!1,u.filter=!1,u.flex=!1,u["flex-basis"]=!1,u["flex-direction"]=!1,u["flex-flow"]=!1,u["flex-grow"]=!1,u["flex-shrink"]=!1,u["flex-wrap"]=!1,u.float=!1,u["float-offset"]=!1,u["flood-color"]=!1,u["flood-opacity"]=!1,u["flow-from"]=!1,u["flow-into"]=!1,u.font=!0,u["font-family"]=!0,u["font-feature-settings"]=!0,u["font-kerning"]=!0,u["font-language-override"]=!0,u["font-size"]=!0,u["font-size-adjust"]=!0,u["font-stretch"]=!0,u["font-style"]=!0,u["font-synthesis"]=!0,u["font-variant"]=!0,u["font-variant-alternates"]=!0,u["font-variant-caps"]=!0,u["font-variant-east-asian"]=!0,u["font-variant-ligatures"]=!0,u["font-variant-numeric"]=!0,u["font-variant-position"]=!0,u["font-weight"]=!0,u.grid=!1,u["grid-area"]=!1,u["grid-auto-columns"]=!1,u["grid-auto-flow"]=!1,u["grid-auto-rows"]=!1,u["grid-column"]=!1,u["grid-column-end"]=!1,u["grid-column-start"]=!1,u["grid-row"]=!1,u["grid-row-end"]=!1,u["grid-row-start"]=!1,u["grid-template"]=!1,u["grid-template-areas"]=!1,u["grid-template-columns"]=!1,u["grid-template-rows"]=!1,u["hanging-punctuation"]=!1,u.height=!0,u.hyphens=!1,u.icon=!1,u["image-orientation"]=!1,u["image-resolution"]=!1,u["ime-mode"]=!1,u["initial-letters"]=!1,u["inline-box-align"]=!1,u["justify-content"]=!1,u["justify-items"]=!1,u["justify-self"]=!1,u.left=!1,u["letter-spacing"]=!0,u["lighting-color"]=!0,u["line-box-contain"]=!1,u["line-break"]=!1,u["line-grid"]=!1,u["line-height"]=!1,u["line-snap"]=!1,u["line-stacking"]=!1,u["line-stacking-ruby"]=!1,u["line-stacking-shift"]=!1,u["line-stacking-strategy"]=!1,u["list-style"]=!0,u["list-style-image"]=!0,u["list-style-position"]=!0,u["list-style-type"]=!0,u.margin=!0,u["margin-bottom"]=!0,u["margin-left"]=!0,u["margin-right"]=!0,u["margin-top"]=!0,u["marker-offset"]=!1,u["marker-side"]=!1,u.marks=!1,u.mask=!1,u["mask-box"]=!1,u["mask-box-outset"]=!1,u["mask-box-repeat"]=!1,u["mask-box-slice"]=!1,u["mask-box-source"]=!1,u["mask-box-width"]=!1,u["mask-clip"]=!1,u["mask-image"]=!1,u["mask-origin"]=!1,u["mask-position"]=!1,u["mask-repeat"]=!1,u["mask-size"]=!1,u["mask-source-type"]=!1,u["mask-type"]=!1,u["max-height"]=!0,u["max-lines"]=!1,u["max-width"]=!0,u["min-height"]=!0,u["min-width"]=!0,u["move-to"]=!1,u["nav-down"]=!1,u["nav-index"]=!1,u["nav-left"]=!1,u["nav-right"]=!1,u["nav-up"]=!1,u["object-fit"]=!1,u["object-position"]=!1,u.opacity=!1,u.order=!1,u.orphans=!1,u.outline=!1,u["outline-color"]=!1,u["outline-offset"]=!1,u["outline-style"]=!1,u["outline-width"]=!1,u.overflow=!1,u["overflow-wrap"]=!1,u["overflow-x"]=!1,u["overflow-y"]=!1,u.padding=!0,u["padding-bottom"]=!0,u["padding-left"]=!0,u["padding-right"]=!0,u["padding-top"]=!0,u.page=!1,u["page-break-after"]=!1,u["page-break-before"]=!1,u["page-break-inside"]=!1,u["page-policy"]=!1,u.pause=!1,u["pause-after"]=!1,u["pause-before"]=!1,u.perspective=!1,u["perspective-origin"]=!1,u.pitch=!1,u["pitch-range"]=!1,u["play-during"]=!1,u.position=!1,u["presentation-level"]=!1,u.quotes=!1,u["region-fragment"]=!1,u.resize=!1,u.rest=!1,u["rest-after"]=!1,u["rest-before"]=!1,u.richness=!1,u.right=!1,u.rotation=!1,u["rotation-point"]=!1,u["ruby-align"]=!1,u["ruby-merge"]=!1,u["ruby-position"]=!1,u["shape-image-threshold"]=!1,u["shape-outside"]=!1,u["shape-margin"]=!1,u.size=!1,u.speak=!1,u["speak-as"]=!1,u["speak-header"]=!1,u["speak-numeral"]=!1,u["speak-punctuation"]=!1,u["speech-rate"]=!1,u.stress=!1,u["string-set"]=!1,u["tab-size"]=!1,u["table-layout"]=!1,u["text-align"]=!0,u["text-align-last"]=!0,u["text-combine-upright"]=!0,u["text-decoration"]=!0,u["text-decoration-color"]=!0,u["text-decoration-line"]=!0,u["text-decoration-skip"]=!0,u["text-decoration-style"]=!0,u["text-emphasis"]=!0,u["text-emphasis-color"]=!0,u["text-emphasis-position"]=!0,u["text-emphasis-style"]=!0,u["text-height"]=!0,u["text-indent"]=!0,u["text-justify"]=!0,u["text-orientation"]=!0,u["text-overflow"]=!0,u["text-shadow"]=!0,u["text-space-collapse"]=!0,u["text-transform"]=!0,u["text-underline-position"]=!0,u["text-wrap"]=!0,u.top=!1,u.transform=!1,u["transform-origin"]=!1,u["transform-style"]=!1,u.transition=!1,u["transition-delay"]=!1,u["transition-duration"]=!1,u["transition-property"]=!1,u["transition-timing-function"]=!1,u["unicode-bidi"]=!1,u["vertical-align"]=!1,u.visibility=!1,u["voice-balance"]=!1,u["voice-duration"]=!1,u["voice-family"]=!1,u["voice-pitch"]=!1,u["voice-range"]=!1,u["voice-rate"]=!1,u["voice-stress"]=!1,u["voice-volume"]=!1,u.volume=!1,u["white-space"]=!1,u.widows=!1,u.width=!0,u["will-change"]=!1,u["word-break"]=!0,u["word-spacing"]=!0,u["word-wrap"]=!0,u["wrap-flow"]=!1,u["wrap-through"]=!1,u["writing-mode"]=!1,u["z-index"]=!1,u}function nsa(u,e,t){}function rsa(u,e,t){}var isa=/javascript\s*\:/img;function osa(u,e){return isa.test(e)?"":e}mx.whiteList=MJe();mx.getDefaultWhiteList=MJe;mx.onAttr=nsa;mx.onIgnoreAttr=rsa;mx.safeAttrValue=osa;var ssa={indexOf:function(u,e){var t,a;if(Array.prototype.indexOf)return u.indexOf(e);for(t=0,a=u.length;t<a;t++)if(u[t]===e)return t;return-1},forEach:function(u,e,t){var a,n;if(Array.prototype.forEach)return u.forEach(e,t);for(a=0,n=u.length;a<n;a++)e.call(t,u[a],a,u)},trim:function(u){return String.prototype.trim?u.trim():u.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(u){return String.prototype.trimRight?u.trimRight():u.replace(/(\s*$)/g,"")}},gb=ssa;function lsa(u,e){u=gb.trimRight(u),u[u.length-1]!==";"&&(u+=";");var t=u.length,a=!1,n=0,r=0,i="";function o(){if(!a){var c=gb.trim(u.slice(n,r)),d=c.indexOf(":");if(d!==-1){var E=gb.trim(c.slice(0,d)),h=gb.trim(c.slice(d+1));if(E){var f=e(n,i.length,E,h,c);f&&(i+=f+"; ")}}}n=r+1}for(;r<t;r++){var s=u[r];if(s==="/"&&u[r+1]==="*"){var l=u.indexOf("*/",r+2);if(l===-1)break;r=l+1,n=r+1,a=!1}else s==="("?a=!0:s===")"?a=!1:s===";"?a||o():s===`
|
|
930
930
|
`&&o()}return gb.trim(i)}var csa=lsa,Ww=mx,dsa=csa;function dxe(u){return u==null}function Esa(u){var e={};for(var t in u)e[t]=u[t];return e}function PJe(u){u=Esa(u||{}),u.whiteList=u.whiteList||Ww.whiteList,u.onAttr=u.onAttr||Ww.onAttr,u.onIgnoreAttr=u.onIgnoreAttr||Ww.onIgnoreAttr,u.safeAttrValue=u.safeAttrValue||Ww.safeAttrValue,this.options=u}PJe.prototype.process=function(u){if(u=u||"",u=u.toString(),!u)return"";var e=this,t=e.options,a=t.whiteList,n=t.onAttr,r=t.onIgnoreAttr,i=t.safeAttrValue,o=dsa(u,function(s,l,c,d,E){var h=a[c],f=!1;if(h===!0?f=h:typeof h=="function"?f=h(d):h instanceof RegExp&&(f=h.test(d)),f!==!0&&(f=!1),d=i(c,d),!!d){var m={position:l,sourcePosition:s,source:E,isWhite:f};if(f){var p=n(c,d,m);return dxe(p)?c+":"+d:p}else{var p=r(c,d,m);if(!dxe(p))return p}}});return o};var hsa=PJe;(function(u,e){var t=mx,a=hsa;function n(i,o){var s=new a(o);return s.process(i)}e=u.exports=n,e.FilterCSS=a;for(var r in t)e[r]=t[r];typeof window<"u"&&(window.filterCSS=u.exports)})(EY,EY.exports);var kie=EY.exports,Fie={indexOf:function(u,e){var t,a;if(Array.prototype.indexOf)return u.indexOf(e);for(t=0,a=u.length;t<a;t++)if(u[t]===e)return t;return-1},forEach:function(u,e,t){var a,n;if(Array.prototype.forEach)return u.forEach(e,t);for(a=0,n=u.length;a<n;a++)e.call(t,u[a],a,u)},trim:function(u){return String.prototype.trim?u.trim():u.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(u){var e=/\s|\n|\t/,t=e.exec(u);return t?t.index:-1}},fsa=kie.FilterCSS,msa=kie.getDefaultWhiteList,uP=Fie;function jJe(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var NJe=new fsa;function psa(u,e,t){}function Dsa(u,e,t){}function xsa(u,e,t){}function gsa(u,e,t){}function RJe(u){return u.replace(Csa,"<").replace(ysa,">")}function vsa(u,e,t,a){if(t=VJe(t),e==="href"||e==="src"){if(t=uP.trim(t),t==="#")return"#";if(!(t.substr(0,7)==="http://"||t.substr(0,8)==="https://"||t.substr(0,7)==="mailto:"||t.substr(0,4)==="tel:"||t.substr(0,11)==="data:image/"||t.substr(0,6)==="ftp://"||t.substr(0,2)==="./"||t.substr(0,3)==="../"||t[0]==="#"||t[0]==="/"))return""}else if(e==="background"){if(Jw.lastIndex=0,Jw.test(t))return""}else if(e==="style"){if(Exe.lastIndex=0,Exe.test(t)||(hxe.lastIndex=0,hxe.test(t)&&(Jw.lastIndex=0,Jw.test(t))))return"";a!==!1&&(a=a||NJe,t=a.process(t))}return t=GJe(t),t}var Csa=/</g,ysa=/>/g,bsa=/"/g,ksa=/"/g,Fsa=/&#([a-zA-Z0-9]*);?/gim,Asa=/:?/gim,Bsa=/&newline;?/gim,Jw=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Exe=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,hxe=/u\s*r\s*l\s*\(.*/gi;function LJe(u){return u.replace(bsa,""")}function $Je(u){return u.replace(ksa,'"')}function IJe(u){return u.replace(Fsa,function(t,a){return a[0]==="x"||a[0]==="X"?String.fromCharCode(parseInt(a.substr(1),16)):String.fromCharCode(parseInt(a,10))})}function KJe(u){return u.replace(Asa,":").replace(Bsa," ")}function HJe(u){for(var e="",t=0,a=u.length;t<a;t++)e+=u.charCodeAt(t)<32?" ":u.charAt(t);return uP.trim(e)}function VJe(u){return u=$Je(u),u=IJe(u),u=KJe(u),u=HJe(u),u}function GJe(u){return u=LJe(u),u=RJe(u),u}function Ssa(){return""}function wsa(u,e){typeof e!="function"&&(e=function(){});var t=!Array.isArray(u);function a(i){return t?!0:uP.indexOf(u,i)!==-1}var n=[],r=!1;return{onIgnoreTag:function(i,o,s){if(a(i))if(s.isClosing){var l="[/removed]",c=s.position+l.length;return n.push([r!==!1?r:s.position,c]),r=!1,l}else return r||(r=s.position),"[removed]";else return e(i,o,s)},remove:function(i){var o="",s=0;return uP.forEach(n,function(l){o+=i.slice(s,l[0]),s=l[1]}),o+=i.slice(s),o}}}function Osa(u){for(var e="",t=0;t<u.length;){var a=u.indexOf("<!--",t);if(a===-1){e+=u.slice(t);break}e+=u.slice(t,a);var n=u.indexOf("-->",a);if(n===-1)break;t=n+3}return e}function zsa(u){var e=u.split("");return e=e.filter(function(t){var a=t.charCodeAt(0);return a===127?!1:a<=31?a===10||a===13:!0}),e.join("")}vr.whiteList=jJe();vr.getDefaultWhiteList=jJe;vr.onTag=psa;vr.onIgnoreTag=Dsa;vr.onTagAttr=xsa;vr.onIgnoreTagAttr=gsa;vr.safeAttrValue=vsa;vr.escapeHtml=RJe;vr.escapeQuote=LJe;vr.unescapeQuote=$Je;vr.escapeHtmlEntities=IJe;vr.escapeDangerHtml5Entities=KJe;vr.clearNonPrintableCharacter=HJe;vr.friendlyAttrValue=VJe;vr.escapeAttrValue=GJe;vr.onIgnoreTagStripAll=Ssa;vr.StripTagBody=wsa;vr.stripCommentTag=Osa;vr.stripBlankChar=zsa;vr.attributeWrapSign='"';vr.cssFilter=NJe;vr.getDefaultCSSWhiteList=msa;var $L={},_h=Fie;function _sa(u){var e=_h.spaceIndex(u),t;return e===-1?t=u.slice(1,-1):t=u.slice(1,e+1),t=_h.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t}function Tsa(u){return u.slice(0,2)==="</"}function Msa(u,e,t){var a="",n=0,r=!1,i=!1,o=0,s=u.length,l="",c="";e:for(o=0;o<s;o++){var d=u.charAt(o);if(r===!1){if(d==="<"){r=o;continue}}else if(i===!1){if(d==="<"){a+=t(u.slice(n,o)),r=o,n=o;continue}if(d===">"||o===s-1){a+=t(u.slice(n,r)),c=u.slice(r,o+1),l=_sa(c),a+=e(r,a.length,l,c,Tsa(c)),n=o+1,r=!1;continue}if(d==='"'||d==="'")for(var E=1,h=u.charAt(o-E);h.trim()===""||h==="=";){if(h==="="){i=d;continue e}h=u.charAt(o-++E)}}else if(d===i){i=!1;continue}}return n<s&&(a+=t(u.substr(n))),a}var Psa=/[^a-zA-Z0-9\\_:.-]/gim;function jsa(u,e){var t=0,a=0,n=[],r=!1,i=u.length;function o(E,h){if(E=_h.trim(E),E=E.replace(Psa,"").toLowerCase(),!(E.length<1)){var f=e(E,h||"");f&&n.push(f)}}for(var s=0;s<i;s++){var l=u.charAt(s),c,d;if(r===!1&&l==="="){r=u.slice(t,s),t=s+1,a=u.charAt(t)==='"'||u.charAt(t)==="'"?t:Rsa(u,s+1);continue}if(r!==!1&&s===a){if(d=u.indexOf(l,s+1),d===-1)break;c=_h.trim(u.slice(a+1,d)),o(r,c),r=!1,s=d,t=s+1;continue}if(/\s|\n|\t/.test(l))if(u=u.replace(/\s|\n|\t/g," "),r===!1)if(d=Nsa(u,s),d===-1){c=_h.trim(u.slice(t,s)),o(c),r=!1,t=s+1;continue}else{s=d-1;continue}else if(d=Lsa(u,s-1),d===-1){c=_h.trim(u.slice(t,s)),c=fxe(c),o(r,c),r=!1,t=s+1;continue}else continue}return t<u.length&&(r===!1?o(u.slice(t)):o(r,fxe(_h.trim(u.slice(t))))),_h.trim(n.join(" "))}function Nsa(u,e){for(;e<u.length;e++){var t=u[e];if(t!==" ")return t==="="?e:-1}}function Rsa(u,e){for(;e<u.length;e++){var t=u[e];if(t!==" ")return t==="'"||t==='"'?e:-1}}function Lsa(u,e){for(;e>0;e--){var t=u[e];if(t!==" ")return t==="="?e:-1}}function $sa(u){return u[0]==='"'&&u[u.length-1]==='"'||u[0]==="'"&&u[u.length-1]==="'"}function fxe(u){return $sa(u)?u.substr(1,u.length-2):u}$L.parseTag=Msa;$L.parseAttr=jsa;var Isa=kie.FilterCSS,lc=vr,UJe=$L,Ksa=UJe.parseTag,Hsa=UJe.parseAttr,Pz=Fie;function qw(u){return u==null}function Vsa(u){var e=Pz.spaceIndex(u);if(e===-1)return{html:"",closing:u[u.length-2]==="/"};u=Pz.trim(u.slice(e+1,-1));var t=u[u.length-1]==="/";return t&&(u=Pz.trim(u.slice(0,-1))),{html:u,closing:t}}function Gsa(u){var e={};for(var t in u)e[t]=u[t];return e}function Usa(u){var e={};for(var t in u)Array.isArray(u[t])?e[t.toLowerCase()]=u[t].map(function(a){return a.toLowerCase()}):e[t.toLowerCase()]=u[t];return e}function WJe(u){u=Gsa(u||{}),u.stripIgnoreTag&&(u.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),u.onIgnoreTag=lc.onIgnoreTagStripAll),u.whiteList||u.allowList?u.whiteList=Usa(u.whiteList||u.allowList):u.whiteList=lc.whiteList,this.attributeWrapSign=u.singleQuotedAttributeValue===!0?"'":lc.attributeWrapSign,u.onTag=u.onTag||lc.onTag,u.onTagAttr=u.onTagAttr||lc.onTagAttr,u.onIgnoreTag=u.onIgnoreTag||lc.onIgnoreTag,u.onIgnoreTagAttr=u.onIgnoreTagAttr||lc.onIgnoreTagAttr,u.safeAttrValue=u.safeAttrValue||lc.safeAttrValue,u.escapeHtml=u.escapeHtml||lc.escapeHtml,this.options=u,u.css===!1?this.cssFilter=!1:(u.css=u.css||{},this.cssFilter=new Isa(u.css))}WJe.prototype.process=function(u){if(u=u||"",u=u.toString(),!u)return"";var e=this,t=e.options,a=t.whiteList,n=t.onTag,r=t.onIgnoreTag,i=t.onTagAttr,o=t.onIgnoreTagAttr,s=t.safeAttrValue,l=t.escapeHtml,c=e.attributeWrapSign,d=e.cssFilter;t.stripBlankChar&&(u=lc.stripBlankChar(u)),t.allowCommentTag||(u=lc.stripCommentTag(u));var E=!1;t.stripIgnoreTagBody&&(E=lc.StripTagBody(t.stripIgnoreTagBody,r),r=E.onIgnoreTag);var h=Ksa(u,function(f,m,p,x,g){var v={sourcePosition:f,position:m,isClosing:g,isWhite:Object.prototype.hasOwnProperty.call(a,p)},C=n(p,x,v);if(!qw(C))return C;if(v.isWhite){if(v.isClosing)return"</"+p+">";var y=Vsa(x),b=a[p],F=Hsa(y.html,function(O,T){var P=Pz.indexOf(b,O)!==-1,z=i(p,O,T,P);return qw(z)?P?(T=s(p,O,T,d),T?O+"="+c+T+c:O):(z=o(p,O,T,P),qw(z)?void 0:z):z});return x="<"+p,F&&(x+=" "+F),y.closing&&(x+=" /"),x+=">",x}else return C=r(p,x,v),qw(C)?l(x):C},l);return E&&(h=E.remove(h)),h};var Wsa=WJe;(function(u,e){var t=vr,a=$L,n=Wsa;function r(o,s){var l=new n(s);return l.process(o)}e=u.exports=r,e.filterXSS=r,e.FilterXSS=n,function(){for(var o in t)e[o]=t[o];for(var s in a)e[s]=a[s]}(),typeof window<"u"&&(window.filterXSS=u.exports);function i(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}i()&&(self.filterXSS=u.exports)})(dY,dY.exports);var Jsa=dY.exports;const qsa=ea(Jsa);B.object({type:B.union([B.literal("description"),B.literal("coordinates")]),x:B.string().optional(),y:B.string().optional(),description:B.string().optional()});function mxe(u){return qsa(u,{whiteList:{},stripIgnoreTag:!0,stripIgnoreTagBody:["script"]})}const Zsa=u=>!!u;function bV(u){return u.startsWith("/")&&u.endsWith("/")}function Qsa(u,e=50){if(u.length<=e)return u;const t=Math.floor((e-3)/2),a=u.slice(0,t),n=u.slice(-t);return`${a}...${n}`}const Ysa=u=>{const[e,t]=k.useState(!1),[a,n]=k.useState("url"),[r,i]=k.useState(void 0),[o,s]=k.useState(void 0),[l,c]=k.useState(void 0);k.useEffect(()=>{u.iframeUrl&&(bV(u.iframeUrl)?n("regex"):n("url"))},[u.iframeUrl]),k.useEffect(()=>{u.iframeUrl&&(bV(u.iframeUrl)&&a==="regex"?(s(u.iframeUrl),i(void 0)):a==="url"?(i(u.iframeUrl),s(void 0)):(s(void 0),i(void 0)))},[u.iframeUrl,e,a]);const d=Array.from(new Set([...u.iframeSrcUrls,u.iframeUrl].filter(Zsa)));return D.jsxs(Vd,{open:e,onOpenChange:t,children:[D.jsx(Gd,{asChild:!0,children:D.jsx(ut,{variant:"outline",className:"w-[250px]",children:D.jsx("span",{className:"max-w-full truncate",children:u.iframeUrl?u.iframeUrl:"Configure iframe"})})}),D.jsxs(l4,{children:[D.jsxs(c4,{children:[D.jsx(d4,{children:"Act within iframe"}),D.jsx(Ud,{children:"Configure the step to interact within an iframe."})]}),D.jsxs(bl,{value:a,onValueChange:n,children:[D.jsxs(Ms,{children:[D.jsx(ma,{value:"url",children:"URL"}),D.jsx(ma,{value:"regex",children:"Regex"})]}),D.jsx(pa,{value:"url",children:D.jsx("div",{className:"space-y-4",children:D.jsxs(In,{value:r,onValueChange:i,children:[D.jsx(kn,{children:D.jsx(Kn,{placeholder:"Select a url"})}),D.jsx(Fn,{children:d.map((E,h)=>D.jsx(iD,{value:E,tooltip:E,children:Qsa(E)},E+h))})]})})}),D.jsx(pa,{value:"regex",children:D.jsxs("div",{className:"space-y-4",children:[D.jsx(ta,{placeholder:"Insert your regular expression here",value:o,onChange:E=>{s(E.target.value),bV(E.target.value)?c(void 0):c("The iframe regex expression must start and end with '/'.")}}),D.jsxs("div",{className:"text-sm",children:["Here is a list of common regular expressions for common use cases:",D.jsxs("ul",{className:"my-2 ml-6 list-disc [&>li]:mt-2",children:[D.jsxs("li",{children:["Stripe:"," ",D.jsx("code",{className:"bg-muted relative rounded px-[0.3rem] py-[0.2rem] font-mono font-semibold",children:"/.*elements-inner-payment.*/"})]}),D.jsxs("li",{children:["Teller:"," ",D.jsx("code",{className:"bg-muted relative rounded px-[0.3rem] py-[0.2rem] font-mono font-semibold",children:"/.*teller\\.io.*/"})]}),D.jsxs("li",{children:["Salesforce:"," ",D.jsx("code",{className:"bg-muted relative rounded px-[0.3rem] py-[0.2rem] font-mono font-semibold",children:"/.*sandbox\\.vf\\.force./"})]})]}),"To learn more about regular expressions, check out"," ",D.jsxs("a",{href:"https://regex101.com/",target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex flex-row items-center gap-1 underline",children:["regex101",D.jsx($Me,{className:"size-4"})]})]}),l&&D.jsx("div",{className:"text-destructive text-sm",children:D.jsx("p",{children:l})})]})})]}),D.jsx(L3,{children:D.jsx(ut,{onClick:()=>{a==="url"?u.onIframeUrlChange((r==null?void 0:r.trim())||void 0):u.onIframeUrlChange((o==null?void 0:o.trim())||void 0),t(!1)},children:"Save"})})]})]})},Bo=({label:u,disabled:e,id:t,description:a,checked:n,onCheckedChange:r})=>D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsx(Zu,{id:t,tooltip:a,children:u}),D.jsx(T1,{id:t,disabled:e,checked:n,onCheckedChange:r})]}),So=({label:u,disabled:e,id:t,description:a,...n})=>D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsx("div",{className:"flex-shrink-0 flex-grow-0 basis-1/2",children:D.jsx(Zu,{id:t,tooltip:a,children:u})}),D.jsx(ta,{id:t,disabled:e,className:"h-9 w-[250px]",...n})]});function Xsa({label:u,disabled:e,id:t,description:a,value:n,options:r,onValueChange:i}){return D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsx(Zu,{id:t,tooltip:a,children:u}),D.jsxs(In,{value:n,onValueChange:o=>i(o),disabled:e,children:[D.jsx(kn,{className:"w-[250px] space-x-2",children:D.jsx(Kn,{placeholder:"Select context mode"})}),D.jsx(Fn,{children:r.map(o=>D.jsx(Ba,{value:o.value,children:o.label},o.value))})]})]})}const pxe=({step:u,disabled:e,onStepChange:t,iframeSrcUrls:a})=>{const n=k.useId(),r=k.useMemo(()=>{var o,s,l,c;const i=[];if(u.type===Fe.PRESET_ACTION&&nK(u.command)){const d=u.command;i.push(D.jsx(Bo,{id:`${n}-use-selector`,disabled:e,label:"Use CSS selector",description:"Treat the element description as a CSS selector. This is not recommended for maintainability reasons but can be useful for dynamic pages.",checked:d.useSelector??!1,onCheckedChange:E=>{const h={...d,useSelector:E};t==null||t({...u,command:h})}},"use-selector"),D.jsx(Bo,{id:`${n}-force`,disabled:e,label:"Disable stability checks",description:"Do not wait for the element to be visible, stable and actionable before interacting. Useful for elements that are constantly animating or partially obscured.",checked:d.force??!1,onCheckedChange:E=>t==null?void 0:t({...u,command:{...d,force:!!E}})},"force"))}if(u.type===Fe.PRESET_ACTION&&(nK(u.command)||u.command.type===H.AI_ASSERTION||u.command.type===H.AI_EXTRACT)){const d=u.command;i.push(D.jsx(Bo,{id:`${n}-disable-cache`,disabled:e,label:"Disable caching",description:"Never rely on cached data to find this element. Useful for steps with dynamic inputs, but will increase latency.",checked:d.disableCache??!1,onCheckedChange:E=>t==null?void 0:t({...u,command:{...d,disableCache:!!E}})},"disable-cache"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.CLICK){const d=u.command;i.push(D.jsx(Bo,{id:`${n}-dblclick`,disabled:e,label:"Double click",description:"Click twice in quick succession.",checked:d.doubleClick??!1,onCheckedChange:E=>t==null?void 0:t({id:u.id,type:Fe.PRESET_ACTION,command:{...d,doubleClick:!!E}})},"dblclick"),D.jsx(Bo,{id:`${n}-rightclick`,disabled:e,label:"Right click",description:"Use the right mouse button.",checked:d.rightClick??!1,onCheckedChange:E=>t==null?void 0:t({id:u.id,type:Fe.PRESET_ACTION,command:{...d,rightClick:!!E}})},"rightclick"),D.jsx(Bo,{id:`${n}-download`,disabled:e,label:"Wait for download",description:"Wait for the click to initiate a download. If checked, this step will return the downloaded file URI, which can be used in 'File upload' steps. Downloads are deleted after each session or 15 minutes.",checked:!!d.waitForDownload,onCheckedChange:E=>t==null?void 0:t({id:u.id,type:Fe.PRESET_ACTION,command:{...d,waitForDownload:!!E}})},"wait-for-download"),D.jsx(So,{id:`${n}-timeout-ms`,disabled:e||!d.waitForDownload,label:"Download timeout",description:"Number of milliseconds to wait for a download. Defaults to 30000ms if unset.",type:"number",max:1e5,min:0,value:d.downloadTimeoutMs??"",onChange:E=>{let h=parseFloat(E.target.value);(Number.isNaN(h)||h<0||h>1e5)&&(h=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,downloadTimeoutMs:h??void 0}})}},"download-timeout-ms"),D.jsx(So,{id:`${n}-delay-ms`,disabled:e,label:"Click delay",description:"Number of milliseconds between each mouse down and mouse up event. Defaults to 25ms if unset.",type:"number",max:1e3,min:0,value:d.delayMs??"",onChange:E=>{let h=parseFloat(E.target.value);(Number.isNaN(h)||h<0||h>1e3)&&(h=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,delayMs:h??void 0}})}},"click-delay-ms")),i.push(D.jsx(Bo,{id:`${n}-relative-position`,disabled:e,label:"Relative position",description:"Specify where the click should occur relative to the top-left corner of the element.",checked:!!d.relativePosition,onCheckedChange:E=>{t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,relativePosition:E?{x:0,y:0}:void 0}})}},"relative-position")),d.relativePosition&&i.push(D.jsx(So,{id:`${n}-relative-position-x`,disabled:e,label:"Relative position X",description:"X coordinate for the relative position in pixels.",type:"number",value:d.relativePosition.x,onChange:E=>{var f;const h=parseFloat(E.target.value);t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,relativePosition:{y:((f=d.relativePosition)==null?void 0:f.y)??0,x:Number.isNaN(h)?0:h}}})}},"relative-position-x"),D.jsx(So,{id:`${n}-relative-position-y`,disabled:e,label:"Relative position Y",description:"Y coordinate for the relative position in pixels.",type:"number",value:d.relativePosition.y,onChange:E=>{var f;const h=parseFloat(E.target.value);t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,relativePosition:{x:((f=d.relativePosition)==null?void 0:f.x)??0,y:Number.isNaN(h)?0:h}}})}},"relative-position-y"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.PRESS){const d=u.command;i.push(D.jsx(Bo,{id:`${n}-convert-meta`,disabled:e,label:"Convert platform-specific keys",description:"Automatically convert common shortcuts for selecting, copying, deleting, and navigating depending on the current operating system.",checked:d.convertMeta!==!1,onCheckedChange:E=>t==null?void 0:t({...u,command:{...d,convertMeta:!!E}})},"press-convert-meta"),D.jsx(So,{id:`${n}-delay-ms`,disabled:e,label:"Press delay",description:`Number of milliseconds after each repeated key press event. Defaults to ${Hxu}ms if unset.`,type:"number",max:1e3,min:0,value:d.delayMs??"",onChange:E=>{let h=parseFloat(E.target.value);(Number.isNaN(h)||h<0||h>1e3)&&(h=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,delayMs:h??void 0}})}},"press-delay-ms"),D.jsx(So,{id:`${n}-repeat-times`,disabled:e,label:"Repeat times",description:"Number of times to repeat the key sequence.",type:"number",max:50,min:1,value:d.repeat??"",onChange:E=>{let h=parseFloat(E.target.value);(Number.isNaN(h)||h<1)&&(h=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,repeat:h??void 0}})}},"press-repeat-times"))}if(u.type===Fe.PRESET_ACTION&&(u.command.type===H.KEY_DOWN||u.command.type===H.KEY_UP)){const d=u.command;i.push(D.jsx(Bo,{id:`${n}-convert-meta`,disabled:e,label:"Convert platform-specific keys",description:"Automatically convert common shortcuts for selecting, copying, deleting, and navigating depending on the current operating system.",checked:d.convertMeta!==!1,onCheckedChange:E=>t==null?void 0:t({...u,command:{...d,convertMeta:!!E}})},"key-convert-meta"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.TYPE){const d=u.command;i.push(D.jsx(Xsa,{id:`${n}-replace-select`,disabled:e,label:"Replace content",description:"Choose when the typed content should replace the exising content.",value:d.clearContent?d.forceClearContent?"always":"inputs-textareas":"never",options:[{label:"Only inputs and textareas",value:"inputs-textareas"},{label:"Never",value:"never"},{label:"Always",value:"always"}],onValueChange:E=>{let h,f;switch(E){case"inputs-textareas":h=!0,f=!1;break;case"always":h=!0,f=!0;break;case"never":h=!1,f=!1}t==null||t({...u,command:{...d,clearContent:h,forceClearContent:f}})}},"replace-select"),D.jsx(Bo,{id:`${n}-enter`,disabled:e,label:"Press enter",description:"Press the enter key after typing the content.",checked:!!d.pressEnter,onCheckedChange:E=>t==null?void 0:t({...u,command:{...d,pressEnter:!!E}})},"enter"),D.jsx(So,{id:`${n}-press-delay`,disabled:e,label:"Key press delay",description:"Number of milliseconds to wait after each key press. Useful for triggering events like autocomplete. Defaults to 0ms.",type:"number",max:1e3,min:0,value:d.delay??"",onChange:E=>{let h=parseFloat(E.target.value);(Number.isNaN(h)||h<0)&&(h=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,delay:h??void 0}})}},"press-delay"))}if(u.type===Fe.PRESET_ACTION&&(u.command.type===H.NAVIGATE||u.command.type===H.SWITCH_TAB||u.command.type===H.NEW_TAB||u.command.type===H.REFRESH)){const d=u.command;i.push(D.jsx(So,{id:`${n}-nav-timeout`,disabled:e,label:"Load timeout",description:"Max number of seconds to wait for the page to fire the 'load' event. Defaults to 8 seconds. Maximum is 60.",type:"number",max:60,min:0,value:d.loadTimeout||"",onChange:E=>{let h=parseFloat(E.target.value);(Number.isNaN(h)||h<=0)&&(h=0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,loadTimeout:h||void 0}})}},"nav-timeout"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.WAIT_FOR_URL){const d=u.command;i.push(D.jsx(Bo,{id:`${n}-case-insensitive`,disabled:e,label:"Case insensitive",description:"Ignore case when comparing the URL.",checked:!!d.caseInsensitive,onCheckedChange:E=>t==null?void 0:t({...u,command:{...d,caseInsensitive:!!E}})},"case-insensitive"),D.jsx(Bo,{id:`${n}-negated`,disabled:e,label:"Negate comparison",description:"Wait for the URL to NOT match the given pattern instead.",checked:!!d.negated,onCheckedChange:E=>t==null?void 0:t({...u,command:{...d,negated:!!E}})},"negated"))}if(u.type===Fe.PRESET_ACTION&&(u.command.type===H.JAVASCRIPT||u.command.type===H.AI_ASSERTION||u.command.type===H.REQUEST||u.command.type===H.GRAPHQL_REQUEST||u.command.type===H.ELEMENT_CHECK||u.command.type===H.PAGE_CHECK||u.command.type===H.WAIT_FOR_URL||u.command.type===H.AWAIT_LISTENER)){let d;u.command.type===H.JAVASCRIPT?d=`${C2t/1e3} seconds`:u.command.type===H.ELEMENT_CHECK||u.command.type===H.PAGE_CHECK?d=`${Lxu} seconds`:u.command.type===H.AI_ASSERTION?d="the smart waiting timeout, which is configurable in test options and defaults to 5 seconds":u.command.type===H.WAIT_FOR_URL?d="the page load timeout, which is configurable in test options":d="10 seconds";let E=`Maximum number of seconds for the action to finish. If unset, defaults to ${d}.`;u.command.type===H.AI_ASSERTION&&(E+=" The actual amount of time this step takes may be slightly greater than the timeout due to AI model latency.");const h=u.command;i.push(D.jsx(So,{id:`${n}-timeout`,disabled:e,label:"Timeout",description:E,type:"number",value:h.timeout||"",onChange:f=>{let m=parseInt(f.target.value);(Number.isNaN(m)||m<=0)&&(m=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...h,timeout:m}})}},"timeout"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.VISUAL_DIFF){const d=u.command;i.push(D.jsx(So,{id:`${n}-threshold`,disabled:e,label:"Threshold",description:"Percentage of total pixels that can be different before the step fails.",type:"number",value:(d.threshold??.1)*100,onChange:E=>{const h=parseInt(E.target.value);Number.isNaN(h)||h<0||h>100||t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,threshold:h/100}})}},"threshold"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.DIALOG){const d=u.command;i.push(D.jsx(Bo,{id:`${n}-dialog-action`,disabled:e,label:"Accept dialog",description:"Accept or dismiss the next browser dialog that appears. By default, all dialogs are automatically dismissed.",checked:d.action==="ACCEPT",onCheckedChange:E=>t==null?void 0:t({id:u.id,type:Fe.PRESET_ACTION,command:{...d,action:E?"ACCEPT":"DISMISS"}})},"dialog-action"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.JAVASCRIPT){const d=u.command;i.push(D.jsx(Bo,{id:`${n}-javascript-env`,disabled:e,label:"Execute in browser",description:"Execute script in the current browser instead of a NodeJS context. If enabled, your code will not be able to use third-party libraries, reference context variables, or return non-string values.",checked:d.environment==="BROWSER",onCheckedChange:E=>t==null?void 0:t({id:u.id,type:Fe.PRESET_ACTION,command:{...d,environment:E?"BROWSER":"NODE"}})},"javascript-env"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.DRAG){const d=u.command;i.push(D.jsx(So,{id:`${n}-hover-seconds`,disabled:e,label:"Hover duration",description:"Number of seconds to wait before dropping the element. This can be useful for ensuring that mouse and hover events are triggered before the drop completes.",type:"number",value:d.hoverSeconds||"",onChange:E=>{let h=parseFloat(E.target.value);(Number.isNaN(h)||h<=0)&&(h=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,hoverSeconds:h}})}},"hover-seconds"),D.jsx(So,{id:`${n}-drag-segments`,disabled:e,label:"Drag segments",description:"Number of intermediate segments to use when dragging the mouse. Increasing this value sends more incremental move events, creating a smoother drag. Defaults to 5 segments if unset.",type:"number",value:d.steps||"",onChange:E=>{let h=parseInt(E.target.value);(Number.isNaN(h)||h<=0||h>100)&&(h=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,steps:h}})}},"drag-segments"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.MOUSE_DRAG){const d=u.command;i.push(D.jsx(So,{id:`${n}-drag-segments`,disabled:e,label:"Drag segments",description:"Number of intermediate segments to use when dragging the mouse. Increasing this value sends more incremental move events, creating a smoother drag. Defaults to 5 segments if unset.",type:"number",value:d.steps||"",onChange:E=>{let h=parseInt(E.target.value);(Number.isNaN(h)||h<=0||h>100)&&(h=void 0),t==null||t({...u,type:Fe.PRESET_ACTION,command:{...d,steps:h}})}},"drag-segments"))}if(u.type===Fe.PRESET_ACTION&&u.command.type===H.AI_ASSERTION){const d=u.command;let E=d.contextChoice;E||(E="MULTIMODAL"),i.push(D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsx(Zu,{id:`${n}-context-choice`,tooltip:"Choose between a general-purpose AI model that can understand both HTML & screenshots, or an advanced vision-only model optimized for visual attributes.",children:"AI context mode"}),D.jsxs(In,{value:E,onValueChange:h=>{t==null||t({...u,command:{...d,contextChoice:h}})},disabled:e,children:[D.jsx(kn,{className:"w-[250px] space-x-2",children:D.jsx(Kn,{placeholder:"Select context mode"})}),D.jsxs(Fn,{children:[D.jsx(Ba,{value:"MULTIMODAL",children:"HTML & screenshot"}),D.jsx(Ba,{value:"VISION_ONLY",children:"Screenshot only"})]})]})]},"context-mode"))}if(u.type===Fe.PRESET_ACTION&&(nK(u.command)||u.command.type===H.AI_ASSERTION||u.command.type===H.PAGE_CHECK)){const d=u.command;i.push(D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsx(Zu,{id:`${n}-iframeUrl`,tooltip:"Specify an iframe in which this action should be performed. The URL will be matched against the 'src' attribute of all iframe elements on the page.",children:"Act within iframe"}),D.jsx(Ysa,{iframeUrl:d.iframeUrl,onIframeUrlChange:E=>{t==null||t({...u,command:{...d,iframeUrl:E}})},iframeSrcUrls:a})]},"iframe"))}return u.type==="RESOLVED_MODULE"&&i.push(D.jsx(Bo,{id:`${n}-override-cache`,disabled:e,label:"Override global cache settings",description:"Turn caching on and override the cache key and expiration for this invocation only.",checked:!!u.cacheConfig,onCheckedChange:d=>t==null?void 0:t({...u,cacheConfig:d?{cacheKey:$J,cacheExpiryMs:Lx}:void 0})},"overrideCache"),D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsx(Zu,{tooltip:"String that controls which invocations of this module can reuse the same cache, such as login-{{env.ENV_NAME}}. Module inputs are automatically appended to the key. Additional variables can be included using {{ }} syntax.",children:"Cache key"}),D.jsx(et,{singleLine:!0,disableLineNumbers:!0,disabled:e||!u.cacheConfig,className:"w-[250px]",value:((o=u.cacheConfig)==null?void 0:o.cacheKey)??"",language:"template-string",placeholder:"login-{{env.ENV_NAME}}",onChange:d=>{var E;t==null||t({...u,cacheConfig:{cacheExpiryMs:((E=u.cacheConfig)==null?void 0:E.cacheExpiryMs)??Lx,cacheKey:d}})}})]},"cacheKey"),D.jsx(So,{id:`${n}-expiry-seconds`,disabled:e||!u.cacheConfig,label:"Expiry seconds",description:`Number of seconds a cached result can be reused before it is automatically expired (TTL). If this is not provided and the default expiry seconds option is also unset, defaults to ${jyt/1e3} seconds.`,type:"number",placeholder:"300",value:((s=u.cacheConfig)==null?void 0:s.cacheExpiryMs)===void 0||((l=u.cacheConfig)==null?void 0:l.cacheExpiryMs)===Lx?void 0:Math.floor(((c=u.cacheConfig)==null?void 0:c.cacheExpiryMs)/1e3),onChange:d=>{let E=parseInt(d.target.value);Number.isNaN(E)&&(E=Lx),t==null||t({...u,cacheConfig:{cacheKey:u.cacheConfig.cacheKey,cacheExpiryMs:E===Lx?Lx:E*1e3}})}},"expirySeconds")),(u.type===Fe.PRESET_ACTION&&(u.command.type===H.AI_EXTRACT||u.command.type===H.JAVASCRIPT||u.command.type===H.REQUEST||u.command.type===H.GRAPHQL_REQUEST||u.command.type===H.AUTH_SAVE||u.command.type===H.AWAIT_LISTENER||u.command.type===H.GET_RECORDED_REQUESTS||u.command.type===H.CLICK)||u.type==="RESOLVED_MODULE")&&i.push(D.jsx(So,{id:`${n}-env-key`,disabled:e,label:"Save to environment variable",placeholder:"EXAMPLE_RESULT",description:"Store the output of this step into the environment at the given key.",value:u.envKey??"",onChange:d=>{t==null||t({...u,envKey:d.target.value||void 0})}},"env-key")),i},[n,t,e,u,a]);return r.length===0?null:D.jsx("div",{className:"space-y-2",children:r})};function Dxe(u,e){var t=Object.keys(u);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(u);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(u,n).enumerable})),t.push.apply(t,a)}return t}function ct(u){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dxe(Object(t),!0).forEach(function(a){a5(u,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(t)):Dxe(Object(t)).forEach(function(a){Object.defineProperty(u,a,Object.getOwnPropertyDescriptor(t,a))})}return u}function ela(u,e){if(!(u instanceof e))throw new TypeError("Cannot call a class as a function")}function xxe(u,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(u,SUe(a.key),a)}}function ula(u,e,t){return e&&xxe(u.prototype,e),t&&xxe(u,t),Object.defineProperty(u,"prototype",{writable:!1}),u}function tla(u,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(e&&e.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),e&&RM(u,e)}function tP(u){return tP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tP(u)}function ala(){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}}function m2(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function nla(u,e){if(e&&(yD(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return m2(u)}function rla(u){var e=ala();return function(){var a=tP(u),n;if(e){var r=tP(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return nla(this,n)}}function hY(u,e){(e==null||e>u.length)&&(e=u.length);for(var t=0,a=new Array(e);t<e;t++)a[t]=u[t];return a}function ila(u){if(Array.isArray(u))return hY(u)}function ola(u){if(typeof Symbol<"u"&&u[Symbol.iterator]!=null||u["@@iterator"]!=null)return Array.from(u)}function JJe(u,e){if(u){if(typeof u=="string")return hY(u,e);var t=Object.prototype.toString.call(u).slice(8,-1);if(t==="Object"&&u.constructor&&(t=u.constructor.name),t==="Map"||t==="Set")return Array.from(u);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return hY(u,e)}}function sla(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
931
931
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V6(u){return ila(u)||ola(u)||JJe(u)||sla()}function lla(u){if(u.sheet)return u.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===u)return document.styleSheets[e]}function cla(u){var e=document.createElement("style");return e.setAttribute("data-emotion",u.key),u.nonce!==void 0&&e.setAttribute("nonce",u.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var dla=function(){function u(t){var a=this;this._insertTag=function(n){var r;a.tags.length===0?a.insertionPoint?r=a.insertionPoint.nextSibling:a.prepend?r=a.container.firstChild:r=a.before:r=a.tags[a.tags.length-1].nextSibling,a.container.insertBefore(n,r),a.tags.push(n)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=u.prototype;return e.hydrate=function(a){a.forEach(this._insertTag)},e.insert=function(a){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(cla(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var r=lla(n);try{r.insertRule(a,r.cssRules.length)}catch{}}else n.appendChild(document.createTextNode(a));this.ctr++},e.flush=function(){this.tags.forEach(function(a){return a.parentNode&&a.parentNode.removeChild(a)}),this.tags=[],this.ctr=0},u}(),Wi="-ms-",aP="-moz-",en="-webkit-",qJe="comm",Aie="rule",Bie="decl",Ela="@import",ZJe="@keyframes",hla="@layer",fla=Math.abs,IL=String.fromCharCode,mla=Object.assign;function pla(u,e){return ki(u,0)^45?(((e<<2^ki(u,0))<<2^ki(u,1))<<2^ki(u,2))<<2^ki(u,3):0}function QJe(u){return u.trim()}function Dla(u,e){return(u=e.exec(u))?u[0]:u}function un(u,e,t){return u.replace(e,t)}function fY(u,e){return u.indexOf(e)}function ki(u,e){return u.charCodeAt(e)|0}function z7(u,e,t){return u.slice(e,t)}function W4(u){return u.length}function Sie(u){return u.length}function Zw(u,e){return e.push(u),u}function xla(u,e){return u.map(e).join("")}var KL=1,p2=1,YJe=0,Vs=0,c0=0,JC="";function HL(u,e,t,a,n,r,i){return{value:u,root:e,parent:t,type:a,props:n,children:r,line:KL,column:p2,length:i,return:""}}function vb(u,e){return mla(HL("",null,null,"",null,null,0),u,{length:-u.length},e)}function gla(){return c0}function vla(){return c0=Vs>0?ki(JC,--Vs):0,p2--,c0===10&&(p2=1,KL--),c0}function zl(){return c0=Vs<YJe?ki(JC,Vs++):0,p2++,c0===10&&(p2=1,KL++),c0}function Bd(){return ki(JC,Vs)}function jz(){return Vs}function n8(u,e){return z7(JC,u,e)}function _7(u){switch(u){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function XJe(u){return KL=p2=1,YJe=W4(JC=u),Vs=0,[]}function eqe(u){return JC="",u}function Nz(u){return QJe(n8(Vs-1,mY(u===91?u+2:u===40?u+1:u)))}function Cla(u){for(;(c0=Bd())&&c0<33;)zl();return _7(u)>2||_7(c0)>3?"":" "}function yla(u,e){for(;--e&&zl()&&!(c0<48||c0>102||c0>57&&c0<65||c0>70&&c0<97););return n8(u,jz()+(e<6&&Bd()==32&&zl()==32))}function mY(u){for(;zl();)switch(c0){case u:return Vs;case 34:case 39:u!==34&&u!==39&&mY(c0);break;case 40:u===41&&mY(u);break;case 92:zl();break}return Vs}function bla(u,e){for(;zl()&&u+c0!==57;)if(u+c0===84&&Bd()===47)break;return"/*"+n8(e,Vs-1)+"*"+IL(u===47?u:zl())}function kla(u){for(;!_7(Bd());)zl();return n8(u,Vs)}function Fla(u){return eqe(Rz("",null,null,null,[""],u=XJe(u),0,[0],u))}function Rz(u,e,t,a,n,r,i,o,s){for(var l=0,c=0,d=i,E=0,h=0,f=0,m=1,p=1,x=1,g=0,v="",C=n,y=r,b=a,F=v;p;)switch(f=g,g=zl()){case 40:if(f!=108&&ki(F,d-1)==58){fY(F+=un(Nz(g),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:F+=Nz(g);break;case 9:case 10:case 13:case 32:F+=Cla(f);break;case 92:F+=yla(jz()-1,7);continue;case 47:switch(Bd()){case 42:case 47:Zw(Ala(bla(zl(),jz()),e,t),s);break;default:F+="/"}break;case 123*m:o[l++]=W4(F)*x;case 125*m:case 59:case 0:switch(g){case 0:case 125:p=0;case 59+c:x==-1&&(F=un(F,/\f/g,"")),h>0&&W4(F)-d&&Zw(h>32?vxe(F+";",a,t,d-1):vxe(un(F," ","")+";",a,t,d-2),s);break;case 59:F+=";";default:if(Zw(b=gxe(F,e,t,l,c,n,o,v,C=[],y=[],d),r),g===123)if(c===0)Rz(F,e,b,b,C,r,d,o,y);else switch(E===99&&ki(F,3)===110?100:E){case 100:case 108:case 109:case 115:Rz(u,b,b,a&&Zw(gxe(u,b,b,0,0,n,o,v,n,C=[],d),y),n,y,d,o,a?C:y);break;default:Rz(F,b,b,b,[""],y,0,o,y)}}l=c=h=0,m=x=1,v=F="",d=i;break;case 58:d=1+W4(F),h=f;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&vla()==125)continue}switch(F+=IL(g),g*m){case 38:x=c>0?1:(F+="\f",-1);break;case 44:o[l++]=(W4(F)-1)*x,x=1;break;case 64:Bd()===45&&(F+=Nz(zl())),E=Bd(),c=d=W4(v=F+=kla(jz())),g++;break;case 45:f===45&&W4(F)==2&&(m=0)}}return r}function gxe(u,e,t,a,n,r,i,o,s,l,c){for(var d=n-1,E=n===0?r:[""],h=Sie(E),f=0,m=0,p=0;f<a;++f)for(var x=0,g=z7(u,d+1,d=fla(m=i[f])),v=u;x<h;++x)(v=QJe(m>0?E[x]+" "+g:un(g,/&\f/g,E[x])))&&(s[p++]=v);return HL(u,e,t,n===0?Aie:o,s,l,c)}function Ala(u,e,t){return HL(u,e,t,qJe,IL(gla()),z7(u,2,-2),0)}function vxe(u,e,t,a){return HL(u,e,t,Bie,z7(u,0,a),z7(u,a+1,-1),a)}function G6(u,e){for(var t="",a=Sie(u),n=0;n<a;n++)t+=e(u[n],n,u,e)||"";return t}function Bla(u,e,t,a){switch(u.type){case hla:if(u.children.length)break;case Ela:case Bie:return u.return=u.return||u.value;case qJe:return"";case ZJe:return u.return=u.value+"{"+G6(u.children,a)+"}";case Aie:u.value=u.props.join(",")}return W4(t=G6(u.children,a))?u.return=u.value+"{"+t+"}":""}function Sla(u){var e=Sie(u);return function(t,a,n,r){for(var i="",o=0;o<e;o++)i+=u[o](t,a,n,r)||"";return i}}function wla(u){return function(e){e.root||(e=e.return)&&u(e)}}function Ola(u){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=u(t)),e[t]}}var zla=function(e,t,a){for(var n=0,r=0;n=r,r=Bd(),n===38&&r===12&&(t[a]=1),!_7(r);)zl();return n8(e,Vs)},_la=function(e,t){var a=-1,n=44;do switch(_7(n)){case 0:n===38&&Bd()===12&&(t[a]=1),e[a]+=zla(Vs-1,t,a);break;case 2:e[a]+=Nz(n);break;case 4:if(n===44){e[++a]=Bd()===58?"&\f":"",t[a]=e[a].length;break}default:e[a]+=IL(n)}while(n=zl());return e},Tla=function(e,t){return eqe(_la(XJe(e),t))},Cxe=new WeakMap,Mla=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,a=e.parent,n=e.column===a.column&&e.line===a.line;a.type!=="rule";)if(a=a.parent,!a)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Cxe.get(a))&&!n){Cxe.set(e,!0);for(var r=[],i=Tla(t,r),o=a.props,s=0,l=0;s<i.length;s++)for(var c=0;c<o.length;c++,l++)e.props[l]=r[s]?i[s].replace(/&\f/g,o[c]):o[c]+" "+i[s]}}},Pla=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function uqe(u,e){switch(pla(u,e)){case 5103:return en+"print-"+u+u;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return en+u+u;case 5349:case 4246:case 4810:case 6968:case 2756:return en+u+aP+u+Wi+u+u;case 6828:case 4268:return en+u+Wi+u+u;case 6165:return en+u+Wi+"flex-"+u+u;case 5187:return en+u+un(u,/(\w+).+(:[^]+)/,en+"box-$1$2"+Wi+"flex-$1$2")+u;case 5443:return en+u+Wi+"flex-item-"+un(u,/flex-|-self/,"")+u;case 4675:return en+u+Wi+"flex-line-pack"+un(u,/align-content|flex-|-self/,"")+u;case 5548:return en+u+Wi+un(u,"shrink","negative")+u;case 5292:return en+u+Wi+un(u,"basis","preferred-size")+u;case 6060:return en+"box-"+un(u,"-grow","")+en+u+Wi+un(u,"grow","positive")+u;case 4554:return en+un(u,/([^-])(transform)/g,"$1"+en+"$2")+u;case 6187:return un(un(un(u,/(zoom-|grab)/,en+"$1"),/(image-set)/,en+"$1"),u,"")+u;case 5495:case 3959:return un(u,/(image-set\([^]*)/,en+"$1$`$1");case 4968:return un(un(u,/(.+:)(flex-)?(.*)/,en+"box-pack:$3"+Wi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+en+u+u;case 4095:case 3583:case 4068:case 2532:return un(u,/(.+)-inline(.+)/,en+"$1$2")+u;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(W4(u)-1-e>6)switch(ki(u,e+1)){case 109:if(ki(u,e+4)!==45)break;case 102:return un(u,/(.+:)(.+)-([^]+)/,"$1"+en+"$2-$3$1"+aP+(ki(u,e+3)==108?"$3":"$2-$3"))+u;case 115:return~fY(u,"stretch")?uqe(un(u,"stretch","fill-available"),e)+u:u}break;case 4949:if(ki(u,e+1)!==115)break;case 6444:switch(ki(u,W4(u)-3-(~fY(u,"!important")&&10))){case 107:return un(u,":",":"+en)+u;case 101:return un(u,/(.+:)([^;!]+)(;|!.+)?/,"$1"+en+(ki(u,14)===45?"inline-":"")+"box$3$1"+en+"$2$3$1"+Wi+"$2box$3")+u}break;case 5936:switch(ki(u,e+11)){case 114:return en+u+Wi+un(u,/[svh]\w+-[tblr]{2}/,"tb")+u;case 108:return en+u+Wi+un(u,/[svh]\w+-[tblr]{2}/,"tb-rl")+u;case 45:return en+u+Wi+un(u,/[svh]\w+-[tblr]{2}/,"lr")+u}return en+u+Wi+u+u}return u}var jla=function(e,t,a,n){if(e.length>-1&&!e.return)switch(e.type){case Bie:e.return=uqe(e.value,e.length);break;case ZJe:return G6([vb(e,{value:un(e.value,"@","@"+en)})],n);case Aie:if(e.length)return xla(e.props,function(r){switch(Dla(r,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return G6([vb(e,{props:[un(r,/:(read-\w+)/,":"+aP+"$1")]})],n);case"::placeholder":return G6([vb(e,{props:[un(r,/:(plac\w+)/,":"+en+"input-$1")]}),vb(e,{props:[un(r,/:(plac\w+)/,":"+aP+"$1")]}),vb(e,{props:[un(r,/:(plac\w+)/,Wi+"input-$1")]})],n)}return""})}},Nla=[jla],Rla=function(e){var t=e.key;if(t==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(m){var p=m.getAttribute("data-emotion");p.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var n=e.stylisPlugins||Nla,r={},i,o=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(m){for(var p=m.getAttribute("data-emotion").split(" "),x=1;x<p.length;x++)r[p[x]]=!0;o.push(m)});var s,l=[Mla,Pla];{var c,d=[Bla,wla(function(m){c.insert(m)})],E=Sla(l.concat(n,d)),h=function(p){return G6(Fla(p),E)};s=function(p,x,g,v){c=g,h(p?p+"{"+x.styles+"}":x.styles),v&&(f.inserted[x.name]=!0)}}var f={key:t,sheet:new dla({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:r,registered:{},insert:s};return f.sheet.hydrate(o),f},Lla=!0;function $la(u,e,t){var a="";return t.split(" ").forEach(function(n){u[n]!==void 0?e.push(u[n]+";"):a+=n+" "}),a}var tqe=function(e,t,a){var n=e.key+"-"+t.name;(a===!1||Lla===!1)&&e.registered[n]===void 0&&(e.registered[n]=t.styles)},Ila=function(e,t,a){tqe(e,t,a);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var r=t;do e.insert(t===r?"."+n:"",r,e.sheet,!0),r=r.next;while(r!==void 0)}};function Kla(u){for(var e=0,t,a=0,n=u.length;n>=4;++a,n-=4)t=u.charCodeAt(a)&255|(u.charCodeAt(++a)&255)<<8|(u.charCodeAt(++a)&255)<<16|(u.charCodeAt(++a)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(n){case 3:e^=(u.charCodeAt(a+2)&255)<<16;case 2:e^=(u.charCodeAt(a+1)&255)<<8;case 1:e^=u.charCodeAt(a)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var Hla={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Vla=/[A-Z]|^ms/g,Gla=/_EMO_([^_]+?)_([^]*?)_EMO_/g,aqe=function(e){return e.charCodeAt(1)===45},yxe=function(e){return e!=null&&typeof e!="boolean"},kV=Ola(function(u){return aqe(u)?u:u.replace(Vla,"-$&").toLowerCase()}),bxe=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Gla,function(a,n,r){return J4={name:n,styles:r,next:J4},n})}return Hla[e]!==1&&!aqe(e)&&typeof t=="number"&&t!==0?t+"px":t};function T7(u,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return J4={name:t.name,styles:t.styles,next:J4},t.name;if(t.styles!==void 0){var a=t.next;if(a!==void 0)for(;a!==void 0;)J4={name:a.name,styles:a.styles,next:J4},a=a.next;var n=t.styles+";";return n}return Ula(u,e,t)}case"function":{if(u!==void 0){var r=J4,i=t(u);return J4=r,T7(u,e,i)}break}}if(e==null)return t;var o=e[t];return o!==void 0?o:t}function Ula(u,e,t){var a="";if(Array.isArray(t))for(var n=0;n<t.length;n++)a+=T7(u,e,t[n])+";";else for(var r in t){var i=t[r];if(typeof i!="object")e!=null&&e[i]!==void 0?a+=r+"{"+e[i]+"}":yxe(i)&&(a+=kV(r)+":"+bxe(r,i)+";");else if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var o=0;o<i.length;o++)yxe(i[o])&&(a+=kV(r)+":"+bxe(r,i[o])+";");else{var s=T7(u,e,i);switch(r){case"animation":case"animationName":{a+=kV(r)+":"+s+";";break}default:a+=r+"{"+s+"}"}}}return a}var kxe=/label:\s*([^\s;\n{]+)\s*(;|$)/g,J4,nqe=function(e,t,a){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,r="";J4=void 0;var i=e[0];i==null||i.raw===void 0?(n=!1,r+=T7(a,t,i)):r+=i[0];for(var o=1;o<e.length;o++)r+=T7(a,t,e[o]),n&&(r+=i[o]);kxe.lastIndex=0;for(var s="",l;(l=kxe.exec(r))!==null;)s+="-"+l[1];var c=Kla(r)+s;return{name:c,styles:r,next:J4}},Wla=function(e){return e()},Jla=M5.useInsertionEffect?M5.useInsertionEffect:!1,qla=Jla||Wla,wie={}.hasOwnProperty,rqe=k.createContext(typeof HTMLElement<"u"?Rla({key:"css"}):null);rqe.Provider;var Zla=function(e){return k.forwardRef(function(t,a){var n=k.useContext(rqe);return e(t,n,a)})},Qla=k.createContext({}),pY="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Yla=function(e,t){var a={};for(var n in t)wie.call(t,n)&&(a[n]=t[n]);return a[pY]=e,a},Xla=function(e){var t=e.cache,a=e.serialized,n=e.isStringTag;return tqe(t,a,n),qla(function(){return Ila(t,a,n)}),null},eca=Zla(function(u,e,t){var a=u.css;typeof a=="string"&&e.registered[a]!==void 0&&(a=e.registered[a]);var n=u[pY],r=[a],i="";typeof u.className=="string"?i=$la(e.registered,r,u.className):u.className!=null&&(i=u.className+" ");var o=nqe(r,void 0,k.useContext(Qla));i+=e.key+"-"+o.name;var s={};for(var l in u)wie.call(u,l)&&l!=="css"&&l!==pY&&(s[l]=u[l]);return s.ref=t,s.className=i,k.createElement(k.Fragment,null,k.createElement(Xla,{cache:e,serialized:o,isStringTag:typeof n=="string"}),k.createElement(n,s))}),uca=eca,mt=function(e,t){var a=arguments;if(t==null||!wie.call(t,"css"))return k.createElement.apply(void 0,a);var n=a.length,r=new Array(n);r[0]=uca,r[1]=Yla(e,t);for(var i=2;i<n;i++)r[i]=a[i];return k.createElement.apply(null,r)};function Oie(){for(var u=arguments.length,e=new Array(u),t=0;t<u;t++)e[t]=arguments[t];return nqe(e)}var tca=function(){var e=Oie.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function aca(u){if(Array.isArray(u))return u}function nca(u,e){var t=u==null?null:typeof Symbol<"u"&&u[Symbol.iterator]||u["@@iterator"];if(t!=null){var a,n,r,i,o=[],s=!0,l=!1;try{if(r=(t=t.call(u)).next,e===0){if(Object(t)!==t)return;s=!1}else for(;!(s=(a=r.call(t)).done)&&(o.push(a.value),o.length!==e);s=!0);}catch(c){l=!0,n=c}finally{try{if(!s&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(l)throw n}}return o}}function rca(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
932
932
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JE(u,e){return aca(u)||nca(u,e)||JJe(u,e)||rca()}function OD(u,e){if(u==null)return{};var t={},a=Object.keys(u),n,r;for(r=0;r<a.length;r++)n=a[r],!(e.indexOf(n)>=0)&&(t[n]=u[n]);return t}function Zd(u,e){if(u==null)return{};var t=OD(u,e),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(u);for(n=0;n<r.length;n++)a=r[n],!(e.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(u,a)&&(t[a]=u[a])}return t}function ica(u,e){return e||(e=u.slice(0)),Object.freeze(Object.defineProperties(u,{raw:{value:Object.freeze(e)}}))}var DY=k.useLayoutEffect,oca=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],nP=function(){};function sca(u,e){return e?e[0]==="-"?u+e:u+"__"+e:u}function lca(u,e){for(var t=arguments.length,a=new Array(t>2?t-2:0),n=2;n<t;n++)a[n-2]=arguments[n];var r=[].concat(a);if(e&&u)for(var i in e)e.hasOwnProperty(i)&&e[i]&&r.push("".concat(sca(u,i)));return r.filter(function(o){return o}).map(function(o){return String(o).trim()}).join(" ")}var rP=function(e){return xca(e)?e.filter(Boolean):yD(e)==="object"&&e!==null?[e]:[]},iqe=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=Zd(e,oca);return ct({},t)},Vr=function(e,t,a){var n=e.cx,r=e.getStyles,i=e.getClassNames,o=e.className;return{css:r(t,e),className:n(a??{},i(t,e),o)}};function VL(u){return[document.documentElement,document.body,window].indexOf(u)>-1}function cca(u){return VL(u)?window.innerHeight:u.clientHeight}function oqe(u){return VL(u)?window.pageYOffset:u.scrollTop}function iP(u,e){if(VL(u)){window.scrollTo(0,e);return}u.scrollTop=e}function dca(u){var e=getComputedStyle(u),t=e.position==="absolute",a=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var n=u;n=n.parentElement;)if(e=getComputedStyle(n),!(t&&e.position==="static")&&a.test(e.overflow+e.overflowY+e.overflowX))return n;return document.documentElement}function Eca(u,e,t,a){return t*((u=u/a-1)*u*u+1)+e}function Qw(u,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nP,n=oqe(u),r=e-n,i=10,o=0;function s(){o+=i;var l=Eca(o,n,r,t);iP(u,l),o<t?window.requestAnimationFrame(s):a(u)}s()}function Fxe(u,e){var t=u.getBoundingClientRect(),a=e.getBoundingClientRect(),n=e.offsetHeight/3;a.bottom+n>t.bottom?iP(u,Math.min(e.offsetTop+e.clientHeight-u.offsetHeight+n,u.scrollHeight)):a.top-n<t.top&&iP(u,Math.max(e.offsetTop-n,0))}function hca(u){var e=u.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function Axe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function fca(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var sqe=!1,mca={get passive(){return sqe=!0}},Yw=typeof window<"u"?window:{};Yw.addEventListener&&Yw.removeEventListener&&(Yw.addEventListener("p",nP,mca),Yw.removeEventListener("p",nP,!1));var pca=sqe;function Dca(u){return u!=null}function xca(u){return Array.isArray(u)}function fk(u,e,t){return u?e:t}var gca=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n<t;n++)a[n-1]=arguments[n];var r=Object.entries(e).filter(function(i){var o=JE(i,1),s=o[0];return!a.includes(s)});return r.reduce(function(i,o){var s=JE(o,2),l=s[0],c=s[1];return i[l]=c,i},{})},vca=["children","innerProps"],Cca=["children","innerProps"];function yca(u){var e=u.maxHeight,t=u.menuEl,a=u.minHeight,n=u.placement,r=u.shouldScroll,i=u.isFixedPosition,o=u.controlHeight,s=dca(t),l={placement:"bottom",maxHeight:e};if(!t||!t.offsetParent)return l;var c=s.getBoundingClientRect(),d=c.height,E=t.getBoundingClientRect(),h=E.bottom,f=E.height,m=E.top,p=t.offsetParent.getBoundingClientRect(),x=p.top,g=i?window.innerHeight:cca(s),v=oqe(s),C=parseInt(getComputedStyle(t).marginBottom,10),y=parseInt(getComputedStyle(t).marginTop,10),b=x-y,F=g-m,O=b+v,T=d-v-m,P=h-g+v+C,z=v+m-y,A=160;switch(n){case"auto":case"bottom":if(F>=f)return{placement:"bottom",maxHeight:e};if(T>=f&&!i)return r&&Qw(s,P,A),{placement:"bottom",maxHeight:e};if(!i&&T>=a||i&&F>=a){r&&Qw(s,P,A);var S=i?F-C:T-C;return{placement:"bottom",maxHeight:S}}if(n==="auto"||i){var w=e,_=i?b:O;return _>=a&&(w=Math.min(_-C-o,e)),{placement:"top",maxHeight:w}}if(n==="bottom")return r&&iP(s,P),{placement:"bottom",maxHeight:e};break;case"top":if(b>=f)return{placement:"top",maxHeight:e};if(O>=f&&!i)return r&&Qw(s,z,A),{placement:"top",maxHeight:e};if(!i&&O>=a||i&&b>=a){var j=e;return(!i&&O>=a||i&&b>=a)&&(j=i?b-y:O-y),r&&Qw(s,z,A),{placement:"top",maxHeight:j}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return l}function bca(u){var e={bottom:"top",top:"bottom"};return u?e[u]:"bottom"}var lqe=function(e){return e==="auto"?"bottom":e},kca=function(e,t){var a,n=e.placement,r=e.theme,i=r.borderRadius,o=r.spacing,s=r.colors;return ct((a={label:"menu"},a5(a,bca(n),"100%"),a5(a,"position","absolute"),a5(a,"width","100%"),a5(a,"zIndex",1),a),t?{}:{backgroundColor:s.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:o.menuGutter,marginTop:o.menuGutter})},cqe=k.createContext(null),Fca=function(e){var t=e.children,a=e.minMenuHeight,n=e.maxMenuHeight,r=e.menuPlacement,i=e.menuPosition,o=e.menuShouldScrollIntoView,s=e.theme,l=k.useContext(cqe)||{},c=l.setPortalPlacement,d=k.useRef(null),E=k.useState(n),h=JE(E,2),f=h[0],m=h[1],p=k.useState(null),x=JE(p,2),g=x[0],v=x[1],C=s.spacing.controlHeight;return DY(function(){var y=d.current;if(y){var b=i==="fixed",F=o&&!b,O=yca({maxHeight:n,menuEl:y,minHeight:a,placement:r,shouldScroll:F,isFixedPosition:b,controlHeight:C});m(O.maxHeight),v(O.placement),c==null||c(O.placement)}},[n,r,i,o,a,c,C]),t({ref:d,placerProps:ct(ct({},e),{},{placement:g||lqe(r),maxHeight:f})})},Aca=function(e){var t=e.children,a=e.innerRef,n=e.innerProps;return mt("div",Tu({},Vr(e,"menu",{menu:!0}),{ref:a},n),t)},Bca=Aca,Sca=function(e,t){var a=e.maxHeight,n=e.theme.spacing.baseUnit;return ct({maxHeight:a,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:n,paddingTop:n})},wca=function(e){var t=e.children,a=e.innerProps,n=e.innerRef,r=e.isMulti;return mt("div",Tu({},Vr(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:n},a),t)},dqe=function(e,t){var a=e.theme,n=a.spacing.baseUnit,r=a.colors;return ct({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(n*2,"px ").concat(n*3,"px")})},Oca=dqe,zca=dqe,_ca=function(e){var t=e.children,a=t===void 0?"No options":t,n=e.innerProps,r=Zd(e,vca);return mt("div",Tu({},Vr(ct(ct({},r),{},{children:a,innerProps:n}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),a)},Tca=function(e){var t=e.children,a=t===void 0?"Loading...":t,n=e.innerProps,r=Zd(e,Cca);return mt("div",Tu({},Vr(ct(ct({},r),{},{children:a,innerProps:n}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),a)},Mca=function(e){var t=e.rect,a=e.offset,n=e.position;return{left:t.left,position:n,top:a,width:t.width,zIndex:1}},Pca=function(e){var t=e.appendTo,a=e.children,n=e.controlElement,r=e.innerProps,i=e.menuPlacement,o=e.menuPosition,s=k.useRef(null),l=k.useRef(null),c=k.useState(lqe(i)),d=JE(c,2),E=d[0],h=d[1],f=k.useMemo(function(){return{setPortalPlacement:h}},[]),m=k.useState(null),p=JE(m,2),x=p[0],g=p[1],v=k.useCallback(function(){if(n){var F=hca(n),O=o==="fixed"?0:window.pageYOffset,T=F[E]+O;(T!==(x==null?void 0:x.offset)||F.left!==(x==null?void 0:x.rect.left)||F.width!==(x==null?void 0:x.rect.width))&&g({offset:T,rect:F})}},[n,o,E,x==null?void 0:x.offset,x==null?void 0:x.rect.left,x==null?void 0:x.rect.width]);DY(function(){v()},[v]);var C=k.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),n&&s.current&&(l.current=jPe(n,s.current,v,{elementResize:"ResizeObserver"in window}))},[n,v]);DY(function(){C()},[C]);var y=k.useCallback(function(F){s.current=F,C()},[C]);if(!t&&o!=="fixed"||!x)return null;var b=mt("div",Tu({ref:y},Vr(ct(ct({},e),{},{offset:x.offset,position:o,rect:x.rect}),"menuPortal",{"menu-portal":!0}),r),a);return mt(cqe.Provider,{value:f},t?n4.createPortal(b,t):b)},jca=function(e){var t=e.isDisabled,a=e.isRtl;return{label:"container",direction:a?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},Nca=function(e){var t=e.children,a=e.innerProps,n=e.isDisabled,r=e.isRtl;return mt("div",Tu({},Vr(e,"container",{"--is-disabled":n,"--is-rtl":r}),a),t)},Rca=function(e,t){var a=e.theme.spacing,n=e.isMulti,r=e.hasValue,i=e.selectProps.controlShouldRenderValue;return ct({alignItems:"center",display:n&&r&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(a.baseUnit/2,"px ").concat(a.baseUnit*2,"px")})},Lca=function(e){var t=e.children,a=e.innerProps,n=e.isMulti,r=e.hasValue;return mt("div",Tu({},Vr(e,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":r}),a),t)},$ca=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Ica=function(e){var t=e.children,a=e.innerProps;return mt("div",Tu({},Vr(e,"indicatorsContainer",{indicators:!0}),a),t)},Bxe,Kca=["size"],Hca=["innerProps","isRtl","size"],Vca={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Eqe=function(e){var t=e.size,a=Zd(e,Kca);return mt("svg",Tu({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Vca},a))},zie=function(e){return mt(Eqe,Tu({size:20},e),mt("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},hqe=function(e){return mt(Eqe,Tu({size:20},e),mt("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},fqe=function(e,t){var a=e.isFocused,n=e.theme,r=n.spacing.baseUnit,i=n.colors;return ct({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:a?i.neutral60:i.neutral20,padding:r*2,":hover":{color:a?i.neutral80:i.neutral40}})},Gca=fqe,Uca=function(e){var t=e.children,a=e.innerProps;return mt("div",Tu({},Vr(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),a),t||mt(hqe,null))},Wca=fqe,Jca=function(e){var t=e.children,a=e.innerProps;return mt("div",Tu({},Vr(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),a),t||mt(zie,null))},qca=function(e,t){var a=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,i=n.colors;return ct({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:a?i.neutral10:i.neutral20,marginBottom:r*2,marginTop:r*2})},Zca=function(e){var t=e.innerProps;return mt("span",Tu({},t,Vr(e,"indicatorSeparator",{"indicator-separator":!0})))},Qca=tca(Bxe||(Bxe=ica([`
|