@vuu-ui/vuu-shell 0.8.13 → 0.8.14-debug

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/esm/index.js CHANGED
@@ -1,4 +1,3029 @@
1
- import{useCallback as ko}from"react";import Fo from"classnames";import{Toolbar as $o}from"@vuu-ui/vuu-layout";import{useCallback as it,useEffect as So,useRef as No,useState as at}from"react";import{Button as Ro,FormField as ut,FormFieldLabel as lt}from"@salt-ds/core";import{VuuInput as ct}from"@vuu-ui/vuu-ui-controls";import{useMemo as wo}from"react";import{jsx as H,jsxs as Z}from"react/jsx-runtime";var st=()=>wo(()=>Z("svg",{width:"184",height:"90",viewBox:"0 0 184 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Z("g",{clipPath:"url(#clip0_1173_59965)",children:[H("path",{d:"M77.0775 31.1019L69.4572 15.1795L66.3997 13.7093L47.6353 44.165L75.7224 61.2361L81.8124 51.2694L77.0775 31.1019Z",fill:"url(#paint0_linear_1173_59965)"}),H("path",{d:"M82.4101 49.7431C81.0488 51.8314 79.1993 53.648 76.8897 54.9809C74.2954 56.4792 71.4601 57.194 68.6623 57.194C63.3422 57.194 58.1597 54.6188 55.0209 49.971L30.5358 7.8193L30.5232 7.84116C25.8791 0.274825 16.0118 -2.26289 8.27258 2.21011C0.411306 6.74866 -2.26753 16.7872 2.28587 24.625L35.5054 81.8189C36.9856 84.3691 39.0542 86.3668 41.4358 87.7527C41.4545 87.7652 41.4733 87.7777 41.4921 87.7902C41.5015 87.7964 41.514 87.8027 41.5234 87.8089C42.6312 88.4457 43.8079 88.942 45.0253 89.3072C45.116 89.3353 45.2099 89.3634 45.3007 89.3883C45.7388 89.5101 46.1801 89.6193 46.6276 89.7067C46.7121 89.7223 46.7966 89.7317 46.8811 89.7473C47.241 89.8097 47.604 89.8628 47.967 89.9003C48.111 89.9159 48.2549 89.9315 48.3989 89.9408C48.8151 89.9752 49.2313 89.997 49.6507 90.0001C49.6726 90.0001 49.6945 90.0001 49.7132 90.0001C49.7195 90.0001 49.7226 90.0001 49.7289 90.0001C49.7352 90.0001 49.7383 90.0001 49.7445 90.0001C50.1983 90.0001 50.6552 89.9752 51.109 89.9377C51.2123 89.9283 51.3155 89.919 51.422 89.9065C51.8663 89.8597 52.3107 89.8004 52.7551 89.7192C52.7614 89.7192 52.7676 89.7192 52.7739 89.7192C53.2621 89.6287 53.7503 89.5101 54.2322 89.3727C54.2635 89.3634 54.2917 89.354 54.323 89.3446C55.024 89.1418 55.7156 88.8889 56.3978 88.5861C56.4104 88.5799 56.426 88.5736 56.4385 88.5674C56.958 88.3364 57.4712 88.0836 57.9751 87.7933C58.4852 87.4999 58.9703 87.1815 59.4334 86.8413C59.8371 86.5478 60.2252 86.2357 60.6039 85.9048C61.0639 85.499 61.4989 85.0745 61.9026 84.6282C62.2062 84.2942 62.4972 83.9446 62.7757 83.5825C62.8665 83.4639 62.951 83.3421 63.0355 83.2235C63.2264 82.9613 63.4079 82.6929 63.5831 82.4182C63.6739 82.2746 63.7646 82.1342 63.8523 81.9906C63.8867 81.9344 63.9242 81.8813 63.9555 81.8251L82.5854 49.7525H82.4039L82.4101 49.7431Z",fill:"url(#paint1_linear_1173_59965)"}),H("path",{d:"M82.8264 32.8436L81.4181 30.4464L75.3375 19.1687L72.5178 14.3929C71.9858 13.1225 70.7309 12.2266 69.26 12.2266C67.3104 12.2266 65.7331 13.8029 65.7331 15.7445C65.7331 16.4031 65.924 17.0086 66.2401 17.5362L66.2025 17.5611L77.1557 36.1617C78.4764 38.4372 78.83 41.0873 78.1509 43.6281C77.4718 46.169 75.8445 48.2915 73.5631 49.6119C72.0609 50.4797 70.3553 50.9385 68.6341 50.9385C65.1166 50.9385 61.84 49.0563 60.0812 46.0285L44.3368 19.2654H44.3681L37.7179 7.81917L37.7054 7.84102C37.5896 7.65061 37.455 7.47893 37.333 7.29477L37.1452 6.97326C37.1452 6.97326 37.1296 6.98262 37.1233 6.98887C34.0001 2.55332 29.0054 0.0780356 23.8512 0.0187285V0H15.3515V0.0436999C21.2881 -0.368328 27.2247 2.46593 30.5232 7.84102L30.5357 7.81917L55.0177 49.974C58.1566 54.6187 63.3422 57.197 68.6592 57.197C71.4569 57.197 74.2922 56.4853 76.8866 54.9839C79.1961 53.651 81.0425 51.8312 82.407 49.7461H82.5885L82.5259 49.8523C83.399 48.4695 84.0687 46.9462 84.5006 45.3231C85.6304 41.0904 85.042 36.6705 82.8201 32.8467L82.8264 32.8436Z",fill:"#F37880"}),Z("g",{opacity:"0.86",children:[H("path",{d:"M66.1994 17.5642L77.1526 36.1648C78.4732 38.4403 78.8269 41.0904 78.1478 43.6313C77.7347 45.1795 76.9648 46.5716 75.9133 47.7234C77.2903 46.4686 78.2823 44.8486 78.7737 43.007C79.4527 40.4661 79.0991 37.816 77.7785 35.5405L66.8253 16.94L66.8628 16.915C66.5467 16.3875 66.3558 15.7819 66.3558 15.1233C66.3558 14.3117 66.6344 13.5657 67.0975 12.9695C66.2651 13.6125 65.7299 14.6176 65.7299 15.7476C65.7299 16.4062 65.9208 17.0118 66.2369 17.5393L66.1994 17.5642Z",fill:"white"}),H("path",{d:"M82.5382 49.8335L82.5291 49.8487C82.5291 49.8487 82.5352 49.8365 82.5413 49.8304C82.5413 49.8304 82.5413 49.8304 82.5413 49.8335H82.5382Z",fill:"white"}),H("path",{d:"M77.5156 54.3596C74.9213 55.8579 72.0859 56.5727 69.2882 56.5727C63.9681 56.5727 58.7856 53.9975 55.6467 49.3497L31.1616 7.19488L31.1491 7.21673C28.9053 3.56154 25.4441 1.08626 21.5917 0H15.3515V0.0436999C21.2881 -0.368328 27.2247 2.46593 30.5232 7.84102L30.5357 7.81917L55.0177 49.974C58.1566 54.6187 63.3422 57.197 68.6592 57.197C71.4569 57.197 74.2922 56.4853 76.8866 54.9839C78.2698 54.1848 79.4809 53.2109 80.5293 52.1122C79.6311 52.9581 78.6266 53.7166 77.5125 54.3596H77.5156Z",fill:"white"})]})]}),H("path",{d:"M117.046 58.661C116.362 58.661 115.792 58.509 115.336 58.205C114.906 57.8757 114.551 57.3943 114.272 56.761L104.354 34.493C104.076 33.8597 104 33.3023 104.126 32.821C104.253 32.3397 104.519 31.9597 104.924 31.681C105.33 31.4023 105.811 31.263 106.368 31.263C107.103 31.263 107.648 31.4277 108.002 31.757C108.382 32.061 108.699 32.5297 108.952 33.163L117.958 54.025H116.324L125.292 33.125C125.571 32.517 125.9 32.061 126.28 31.757C126.66 31.4277 127.192 31.263 127.876 31.263C128.434 31.263 128.89 31.4023 129.244 31.681C129.624 31.9597 129.865 32.3397 129.966 32.821C130.068 33.3023 129.979 33.8597 129.7 34.493L119.782 56.761C119.504 57.3943 119.149 57.8757 118.718 58.205C118.313 58.509 117.756 58.661 117.046 58.661Z",fill:"white"}),H("path",{d:"M144.63 58.737C142.781 58.737 141.147 58.4963 139.728 58.015C138.335 57.5337 137.157 56.8243 136.194 55.887C135.232 54.9243 134.51 53.7337 134.028 52.315C133.547 50.8963 133.306 49.2497 133.306 47.375V33.733C133.306 32.897 133.509 32.2763 133.914 31.871C134.345 31.4657 134.953 31.263 135.738 31.263C136.524 31.263 137.119 31.4657 137.524 31.871C137.955 32.2763 138.17 32.897 138.17 33.733V47.337C138.17 49.7437 138.715 51.555 139.804 52.771C140.919 53.9617 142.528 54.557 144.63 54.557C146.733 54.557 148.329 53.9617 149.418 52.771C150.508 51.555 151.052 49.7437 151.052 47.337V33.733C151.052 32.897 151.255 32.2763 151.66 31.871C152.091 31.4657 152.699 31.263 153.484 31.263C154.244 31.263 154.827 31.4657 155.232 31.871C155.663 32.2763 155.878 32.897 155.878 33.733V47.375C155.878 49.8577 155.448 51.9477 154.586 53.645C153.75 55.3423 152.496 56.6217 150.824 57.483C149.152 58.319 147.088 58.737 144.63 58.737Z",fill:"white"}),H("path",{d:"M172.685 58.737C170.836 58.737 169.202 58.4963 167.783 58.015C166.39 57.5337 165.212 56.8243 164.249 55.887C163.286 54.9243 162.564 53.7337 162.083 52.315C161.602 50.8963 161.361 49.2497 161.361 47.375V33.733C161.361 32.897 161.564 32.2763 161.969 31.871C162.4 31.4657 163.008 31.263 163.793 31.263C164.578 31.263 165.174 31.4657 165.579 31.871C166.01 32.2763 166.225 32.897 166.225 33.733V47.337C166.225 49.7437 166.77 51.555 167.859 52.771C168.974 53.9617 170.582 54.557 172.685 54.557C174.788 54.557 176.384 53.9617 177.473 52.771C178.562 51.555 179.107 49.7437 179.107 47.337V33.733C179.107 32.897 179.31 32.2763 179.715 31.871C180.146 31.4657 180.754 31.263 181.539 31.263C182.299 31.263 182.882 31.4657 183.287 31.871C183.718 32.2763 183.933 32.897 183.933 33.733V47.375C183.933 49.8577 183.502 51.9477 182.641 53.645C181.805 55.3423 180.551 56.6217 178.879 57.483C177.207 58.319 175.142 58.737 172.685 58.737Z",fill:"white"}),Z("defs",{children:[Z("linearGradient",{id:"paint0_linear_1173_59965",x1:"47.6353",y1:"37.4727",x2:"81.8124",y2:"37.4727",gradientUnits:"userSpaceOnUse",children:[H("stop",{stopColor:"#4906A5"}),H("stop",{offset:"1",stopColor:"#D3423A"})]}),Z("linearGradient",{id:"paint1_linear_1173_59965",x1:"0.0670626",y1:"45.0017",x2:"82.5916",y2:"45.0017",gradientUnits:"userSpaceOnUse",children:[H("stop",{stopColor:"#7C06A5"}),H("stop",{offset:"1",stopColor:"#D3423A"})]}),H("clipPath",{id:"clip0_1173_59965",children:H("rect",{width:"85",height:"90",fill:"white",transform:"translate(0.0670471)"})})]})]}),[]);import Ho from"classnames";import{jsx as V,jsxs as ee}from"react/jsx-runtime";var _="vuuLoginPanel",ui=({appName:e="Demo App",className:t,requirePassword:o=!0,onSubmit:n,...s})=>{let[r,a]=at(""),[l,i]=at(""),c=No(null),f=()=>{n(r,l)},M=m=>{a(m.target.value)},h=m=>{i(m.target.value)},d=it(()=>{o||n(r)},[n,o,r]),g=it(()=>{r&&n(r,l)},[n,l,r]),p=r.trim()!==""&&(o===!1||l.trim()!=="");return So(()=>{var m;console.log("inputRef",{input:c.current}),(m=c.current)==null||m.focus()},[]),ee("div",{...s,className:Ho(_,t),children:[ee("div",{className:`${_}-branding`,children:[V(st,{}),V("div",{className:`${_}-appName`,children:e})]}),ee("div",{className:`${_}-form`,children:[V("div",{className:`${_}-title`,children:"Welcome Back"}),ee(ut,{children:[V(lt,{children:"Username"}),V(ct,{value:r,id:"text-username",inputRef:c,onChange:M,onCommit:d})]}),o?ee(ut,{children:[V(lt,{children:"Password"}),V(ct,{className:`${_}-password`,inputProps:{type:"password"},value:l,id:"text-password",onChange:h,onCommit:g,endAdornment:V("span",{"data-icon":"eye",style:{cursor:"pointer"}})})]}):null,V(Ro,{className:`${_}-login`,disabled:!p,onClick:f,variant:"cta",children:"Login"})]})]})};import{getCookieValue as we}from"@vuu-ui/vuu-utils";var Do=()=>{let e=we("vuu-auth-mode");return e!=null?e:""},di=()=>{let e=we("vuu-username"),t=we("vuu-auth-token");return[e,t]},Ao=()=>Do()==="login"?"login.html":"demo.html",Io=(e=Ao())=>{window.location.href=e},pt=e=>{document.cookie="vuu-username= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",document.cookie="vuu-auth-token= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",Io(e)};import{Button as ie}from"@salt-ds/core";import{jsx as ae,jsxs as Se}from"react/jsx-runtime";var te="vuuAppHeader",dt=({className:e,layoutId:t,loginUrl:o,onNavigate:n,onSwitchTheme:s,themeMode:r="light",user:a,...l})=>{let i=Fo(te,e),c=ko(()=>{pt(o)},[o]);return Se($o,{alignItems:"end",className:i,height:36,showSeparators:!0,...l,children:[ae(ie,{className:`${te}-menuItem`,variant:"secondary",children:"Help"}),Se(ie,{className:`${te}-menuItem`,variant:"secondary",children:["History ",ae("span",{"data-icon":"history"})]}),Se(ie,{className:`${te}-menuItem`,variant:"secondary",children:["View ",ae("span",{"data-icon":"settings"})]}),ae(ie,{className:`${te}-menuItem`,onClick:c,variant:"secondary",children:"Log out"})]})};import Bo,{useEffect as Vo,useState as Oo}from"react";import Uo from"classnames";import{Fragment as Ko,jsx as Go,jsxs as mt}from"react/jsx-runtime";var ki=({connectionStatus:e,className:t,element:o="span",...n})=>{let[s,r]=Oo("vuuConnectingStatus");Vo(()=>{switch(e){case"connected":case"reconnected":r("vuuActiveStatus");break;case"connecting":r("vuuConnectingStatus");break;case"disconnected":r("vuuDisconnectedStatus");break;default:break}},[e]);let a=Bo.createElement(o,{...n,className:Uo("vuuStatus vuuIcon",s,t)});return Go(Ko,{children:mt("div",{className:"vuuStatus-container salt-theme",children:[a,mt("div",{className:"vuuStatus-text",children:["Status: ",e.toUpperCase()]})]})})};import{Dropdown as Jo}from"@salt-ds/lab";import{useCallback as _o}from"react";import zo from"classnames";import{jsx as Xo}from"react/jsx-runtime";var Wo="vuuDensitySwitch",qo=["high","medium","low","touch"],Zo="high",Ji=({className:e,defaultDensity:t=Zo,onChange:o})=>{let n=_o((r,a)=>{o(a)},[o]),s=zo(Wo,e);return Xo(Jo,{className:s,source:qo,defaultSelected:t,onSelectionChange:n})};import yt,{Suspense as tn,useEffect as on}from"react";import{registerComponent as nn}from"@vuu-ui/vuu-layout";import Yo from"react";import{Fragment as Qo,jsx as ft,jsxs as jo}from"react/jsx-runtime";var ue=class extends Yo.Component{constructor(t){super(t),this.state={errorMessage:null}}static getDerivedStateFromError(t){return{errorMessage:t.message}}componentDidCatch(t,o){console.log(`error creating component at ${this.props.url}`),console.log(t,o)}render(){return this.state.errorMessage?jo(Qo,{children:[ft("h1",{children:"An error occured while creating component."}),ft("p",{children:this.state.errorMessage})]}):this.props.children}};import{jsx as en}from"react/jsx-runtime";var ht=()=>en("div",{className:"hwLoader"});var gt=async e=>{let t=new CSSStyleSheet;return fetch(e).then(o=>o.text()).then(o=>t.replace(o))};import{jsx as ce}from"react/jsx-runtime";var le=new Map,rn=e=>{on(()=>()=>{le.delete(e)},[e]),le.has(e)||le.set(e,yt.lazy(()=>import(e)));let t=le.get(e);if(t)return t;throw Error(`Unable to load Lazy Feature at url ${e}`)};function sn({url:e,css:t,ComponentProps:o,...n}){t&&gt(t).then(r=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]});let s=rn(e);return ce(ue,{url:e,children:ce(tn,{fallback:ce(ht,{}),children:ce(s,{...n,...o})})})}var pe=yt.memo(sn);pe.displayName="Feature";nn("Feature",pe,"view");import{useEffect as an,useState as oe}from"react";import{Input as un,Button as vt,FormField as de,FormFieldLabel as me,Text as ln}from"@salt-ds/core";import{ComboBox as cn,Checkbox as pn,RadioButton as dn}from"@vuu-ui/vuu-ui-controls";import{takeScreenshot as mn}from"@vuu-ui/vuu-utils";import{jsx as D,jsxs as K}from"react/jsx-runtime";var A="saveLayoutPanel",fe=`${A}-formField`,fn=["Group 1","Group 2","Group 3","Group 4","Group 5"],hn=["Value 1","Value 2","Value 3"],Ct=["Value 1","Value 2","Value 3"],ba=e=>{let{defaultTitle:t="",onCancel:o,onSave:n,componentId:s}=e,[r,a]=oe(t),[l,i]=oe(""),[c,f]=oe([]),[M,h]=oe(Ct[0]),[d,g]=oe();an(()=>{s&&mn(document.getElementById(s)).then(m=>g(m))},[s]);let p=()=>{n({name:r,group:l,screenshot:d!=null?d:"",user:"User"})};return K("div",{className:`${A}-panelContainer`,children:[K("div",{className:`${A}-panelContent`,children:[K("div",{className:`${A}-formContainer`,children:[K(de,{className:fe,children:[D(me,{children:"Group"}),D(cn,{source:fn,allowFreeText:!0,InputProps:{inputProps:{className:`${A}-inputText`,placeholder:"Select Group or Enter New Name",onChange:m=>i(m.target.value)}},width:"100%",onSelectionChange:(m,P)=>i(P||"")})]}),K(de,{className:fe,children:[D(me,{children:"Layout Name"}),D(un,{inputProps:{className:`${A}-inputText`,placeholder:"Enter Layout Name"},onChange:m=>a(m.target.value),value:r})]}),K(de,{className:fe,children:[D(me,{children:"Some Layout Setting"}),D("div",{className:`${A}-settingsGroup`,children:hn.map((m,P)=>D(pn,{onToggle:()=>f(S=>S.includes(m)?S.filter(w=>w!==m):[...S,m]),checked:c.includes(m),label:m},P))})]}),K(de,{className:fe,children:[D(me,{children:"Some Layout Setting"}),D("div",{className:`${A}-settingsGroup`,children:Ct.map((m,P)=>D(dn,{onClick:()=>h(m),checked:M===m,label:m,groupName:"radioGroup"},P))})]})]}),D("div",{className:`${A}-screenshotContainer`,children:d?D("img",{className:`${A}-screenshot`,src:d,alt:"screenshot of current layout"}):D(ln,{className:"screenshot",children:"No screenshot available"})})]}),K("div",{className:`${A}-buttonsContainer`,children:[D(vt,{className:`${A}-cancelButton`,onClick:o,children:"Cancel"}),D(vt,{className:`${A}-saveButton`,onClick:p,disabled:r===""||l==="",children:"Save"})]})]})};import{List as Fr}from"@vuu-ui/vuu-ui-controls";import Er,{useCallback as z,useContext as wr,useEffect as Sr,useRef as Nr,useState as Xt}from"react";import{loadingApplicationJson as Rr,LocalLayoutPersistenceManager as Hr,resolveJSONPath as Dr,defaultApplicationJson as Ar}from"@vuu-ui/vuu-layout";import{Scrim as En}from"@salt-ds/lab";import wn from"classnames";import{useCallback as Sn,useRef as Nn}from"react";import{useLayoutEffect as Mt,useRef as gn,useState as yn}from"react";import{createPortal as vn}from"react-dom";function Cn(e){return typeof e=="function"?e():e}var Mn="vuu-portal-root",X=({children:e,container:t=document.body,id:o=Mn,onRender:n,open:s=!0,themeAttributes:r})=>{var d;let[a,l]=yn(!1),i=gn(null),c=(d=Cn(t))!=null?d:document.body,[f,M,h]=G(r);return Mt(()=>{let g=document.getElementById(o);g?i.current=g:(i.current=document.createElement("div"),i.current.id=o);let p=i.current;c.contains(p)||c.appendChild(p),p.classList.add(f,M),p.dataset.mode=h,l(!0)},[o,c,f,M,h]),Mt(()=>{requestAnimationFrame(()=>{n==null||n()})},[n]),s&&a&&i.current&&e?vn(e,i.current):null};import{Button as bn,Text as xn}from"@salt-ds/core";import Ln from"classnames";import{jsx as bt,jsxs as Tn}from"react/jsx-runtime";var Pn="vuuDialogHeader",xt=({hideCloseButton:e=!1,title:t,onClose:o,...n})=>Tn("div",{...n,className:Ln(Pn,"vuuToolbarProxy"),children:[bt(xn,{className:"dialogHeader",children:t}),!e&&bt(bn,{onClick:o,"data-align":"end","data-icon":"close",variant:"secondary"},"close")]});import{jsx as he,jsxs as Rn}from"react/jsx-runtime";var Ne="vuuDialog",Lt=({children:e,className:t,isOpen:o=!1,onClose:n,title:s,hideCloseButton:r=!1,...a})=>{let l=Nn(null),i=Sn(()=>{n==null||n()},[n]);return o?he(X,{children:he(En,{className:`${Ne}-scrim`,open:o,autoFocusRef:l,children:Rn("div",{...a,className:wn(Ne,t),ref:l,children:[he(xt,{hideCloseButton:r,onClose:i,title:s}),he("div",{className:`${Ne}-body`,children:e})]})})}):null};import{useCallback as Hn,useState as Dn}from"react";import{jsx as An}from"react/jsx-runtime";var Pt=()=>{let[e,t]=Dn(),o=Hn(()=>{t(void 0)},[]);return{dialog:e?An(Lt,{className:"vuDialog",isOpen:!0,onClose:o,style:{maxHeight:500},title:e.title,hideCloseButton:e.hideCloseButton,children:e.content}):null,setDialogState:t}};import{useCallback as Kt,useRef as Be}from"react";import kt,{useLayoutEffect as qn,useMemo as Zn,useRef as Xn}from"react";import Ft from"classnames";import{useId as Yn}from"@vuu-ui/vuu-layout";import{useCallback as ge,useMemo as Un,useRef as Re,useState as Kn}from"react";var Tt=e=>e.closest("[data-root='true']")!==null,Et=(e,t)=>{var o;return e.ariaHasPopup==="true"&&((o=e.dataset)==null?void 0:o.idx)===`${t}`||e.querySelector(`:scope > [data-index='${t}'][aria-haspopup='true']`)!==null};function In(e,...t){let o=new Set(e);for(let n of t)for(let s of n)o.add(s);return o}var kn="Enter";var Fn="Delete",$n=new Set([kn,Fn]),Bn=new Set(["Tab"]),Vn=new Set(["ArrowRight","ArrowLeft"]),wt=new Set(["Home","End","ArrowDown","ArrowUp"]),St=new Set(["Home","End","ArrowRight","ArrowLeft"]),On=new Set(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),cu=In($n,St,wt,Vn,On,Bn);var Nt=({key:e},t="vertical")=>(t==="vertical"?wt:St).has(e);import{isValidNumber as He}from"@vuu-ui/vuu-utils";var Rt=({autoHighlightFirstItem:e=!1,count:t,defaultHighlightedIdx:o,highlightedIndex:n,onActivate:s,onHighlight:r,onCloseMenu:a,onOpenMenu:l})=>{var N;if(He(n)&&He(o))throw Error("useKeyboardNavigation do not pass values for both highlightedIndex and defaultHighlightedIdx");let i=He(n),c=Re((N=o!=null?o:n)!=null?N:e?0:-1),[,f]=Kn(null),M=ge(L=>{c.current=L,r==null||r(L),f({})},[r]),h=ge(L=>{L!==c.current&&(i||M(L))},[i,M]),d=Re(!0),g=Re(!1),p=L=>g.current=L,m=i?n:c.current,P=ge(L=>{let y=Gn(t,L.key,c.current);y!==c.current&&h(y)},[t,h]),S=ge(L=>{if(Nt(L))L.preventDefault(),L.stopPropagation(),d.current=!0,P(L);else if((L.key==="ArrowRight"||L.key==="Enter")&&Et(L.target,m)){let v=L.target.querySelector(`:scope > [data-index='${m}']`);v&&(l==null||l(v,!0))}else L.key==="ArrowLeft"&&!Tt(L.target)?a(m):L.key==="Enter"?(L.preventDefault(),L.stopPropagation(),s&&s(m)):L.key==="Tab"&&a(-1)},[m,P,s,a,l]),w=Un(()=>({onFocus:()=>{m===-1&&M(0)},onKeyDown:S,onMouseDownCapture:()=>{d.current=!1,p(!0)},onMouseMove:()=>{d.current&&(d.current=!1)},onMouseLeave:()=>{d.current=!0,p(!1),h(-1)}}),[S,m,M,h]);return{focusVisible:d.current?m:-1,controlledHighlighting:i,highlightedIndex:m,setHighlightedIndex:h,listProps:w,setIgnoreFocus:p}};function Gn(e,t,o){return t==="ArrowUp"?o>0?o-1:o:o===null?0:o===e-1?o:o+1}import Ht,{useCallback as Jn,useMemo as _n}from"react";var De=e=>e.type===Ae||!!e.props["data-group"],zn=e=>{if(Array.isArray(e)&&Ie(e[0]))return e[0]},Wn=(e,t,o,n=!1)=>{let{props:{children:s}}=e;return{childWithId:Ht.cloneElement(e,{hasSeparator:n,id:`${t}`,key:t,children:o?zn(s):s}),grandChildren:o?s:void 0}},Dt=(e,t)=>{let o=Jn(()=>{let r=(a,l=t,i={},c={})=>{let f=i[l]=[],M=0,h=!1;return Ht.Children.forEach(a,d=>{if(!Ie(d))if(d.type===At)h=!0;else{let g=De(d),p=`${l}-${M}`,{props:{action:m,options:P}}=d,{childWithId:S,grandChildren:w}=Wn(d,p,g,h);f.push(S),w?r(w,p,i,c):c[p]={action:m,options:P},M+=1,h=!1}}),[i,c]};return r(e)},[t,e]),[n,s]=_n(()=>o(),[o]);return[n,s]};import{Fragment as tr,jsx as Y}from"react/jsx-runtime";var It="vuuMenuList",At=()=>Y("li",{className:"vuuMenuItem-divider"}),Ae=()=>null,ke=({children:e,idx:t,options:o,...n})=>Y("div",{...n,children:e}),$t=({children:e})=>Y(tr,{children:e});$t.displayName="MenuItemLabel";ke.Label=$t;var Qn=e=>kt.isValidElement(e)&&typeof e.type!="string"&&"displayName"in e.type?e.type.displayName:void 0,Ie=e=>Qn(e)==="MenuItemLabel",jn=e=>e.props["data-icon"],Fe=({activatedByKeyboard:e,childMenuShowing:t,children:o,className:n,defaultHighlightedIdx:s,highlightedIdx:r,id:a,isRoot:l,listItemProps:i,onHighlightMenuItem:c,onActivate:f,onCloseMenu:M,openMenu:h,...d})=>{let g=Yn(a),p=Xn(null),m=Zn(()=>new Map,[]),P=C=>{var b;let u=(b=p.current)==null?void 0:b.querySelector(`:scope > [data-index='${C}']`);u!=null&&u.id&&(f==null||f(u.id))},{focusVisible:S,highlightedIndex:w,listProps:N}=Rt({count:kt.Children.count(o),defaultHighlightedIdx:s,highlightedIndex:r,onActivate:P,onHighlight:c,onOpenMenu:h,onCloseMenu:M}),L=t==null?S:-1;qn(()=>{var C;t===void 0&&e&&((C=p.current)==null||C.focus())},[e,t]);let y=()=>w===void 0||w===-1?void 0:m.get(w);function v(){let C={...i,role:"menuitem"},u=(E,x,R)=>x?[Y("span",{className:"vuuIconContainer","data-icon":R},"icon")].concat(E):E;function b(E,x,R,k){var rt;let{children:B,className:Lo,"data-icon":ot,id:se,hasSeparator:Po,label:Te,...To}=x.props,Ee=De(x),nt=Ee&&t===se,Eo=nt?`${g}-${se}`:void 0;E.push(Y(ke,{...To,...C,...er(se,R,(rt=x.key)!=null?rt:se,w,L,Lo,Po),"aria-controls":Eo,"aria-haspopup":Ee||void 0,"aria-expanded":nt||void 0,children:u(Ee&&Te!=null?Te:B,k,ot)}))}let T=[];if(o.length>0){let E=o.some(jn);o.forEach((x,R)=>{b(T,x,R,E)})}return T}return Y("div",{...d,...N,"aria-activedescendant":y(),className:Ft(It,n,{[`${It}-childMenuShowing`]:t!==void 0}),"data-root":l||void 0,id:g,ref:p,role:"menu",children:v()})},er=(e,t,o,n,s,r,a)=>({id:`menuitem-${e}`,key:o!=null?o:t,"data-index":t,"data-highlighted":t===n||void 0,className:Ft("vuuMenuItem",r,{"vuuMenuItem-separator":a,focusVisible:s===t})});Fe.displayName="MenuList";import{useCallback as F,useMemo as or,useRef as ye,useState as nr}from"react";var $e=e=>e==null?void 0:e.closest("[data-index],[aria-posinset]");var Vt=(e,t,o)=>e.map((n,s)=>s===e.length-1?{...n,[o]:n[o]-t}:n),rr=(e,t)=>Vt(e,t,"left"),sr=(e,t)=>Vt(e,t,"top"),ir=(e,t)=>{let[o,n]=t.slice(-2),s=document.getElementById(`${e}-${n.id}`);if(s===null)throw Error(`useCascade.flipSides element with id ${n.id} not found`);let{width:r}=s.getBoundingClientRect();return t.map(a=>a===n?{...a,left:o.left-(r-2)}:a)},ar=(e,t)=>{let[{left:o,top:n}]=t.slice(-1),{offsetWidth:s,offsetTop:r}=e;return{left:o+s,top:r+n}},Ot=(e,t)=>{let o=e.lastIndexOf("-");return e.startsWith("menuitem")?o>-1?e.slice(9,o):t:o>-1?e.slice(0,o):t},ur=e=>e.slice(9),Bt=({ariaExpanded:e,ariaHasPopup:t,id:o},n)=>{if(o.startsWith("menuitem"))return{hostMenuId:Ot(o,n),targetMenuId:ur(o),menuItemId:o,isGroup:t==="true",isOpen:e==="true"};throw Error(`getMenuItemDetails #${o} is not a menuitem`)},Ut=({id:e,onActivate:t,onMouseEnterItem:o,position:{x:n,y:s}})=>{let[,r]=nr({}),a=ye([{id:e,left:n,top:s}]),l=F(y=>a.current.findIndex(v=>v.id===y)!==-1,[]),i=F(y=>{let v=h.current[y];if(v===void 0)throw Error(`getOpenMenuState no entry for menu ${y}`);return v},[]),c=F(y=>{a.current=y,r({})},[]),f=ye(),M=ye(),h=ye({[e]:"no-popup"}),d=F((y=e,v,C=null)=>{if(y===e&&C===null)c([{id:e,left:n,top:s}]);else{h.current[y]="popup-open";let u=document.getElementById(C);if(u!==null){let{left:b,top:T}=ar(u,a.current);c(a.current.concat({id:v,left:b,top:T}))}else throw Error(`openMenu no menuItem ${C}`)}},[e,n,s,c]),g=F(y=>{if(y===e)c([]);else{let v=a.current.slice(),C=v.pop();h.current[C.id]="no-popup";let u=v.at(-1);u&&(h.current[u.id]="no-popup"),c(v)}},[e,c]),p=F(y=>{let v=a.current.slice(),C=y.slice(9),{id:u}=v.at(-1);for(;v.length>1&&!C.startsWith(u);){let b=Ot(u,e);v.pop(),h.current[u]="no-popup",h.current[b]="no-popup",{id:u}=v[v.length-1]}v.length<a.current.length&&c(v)},[e,c]),m=F(()=>{f.current&&(clearTimeout(f.current),f.current=void 0)},[]),P=F((y,v,C,u=300)=>{m(),f.current=window.setTimeout(()=>{p(C),h.current[y]="popup-open",h.current[v]="no-popup",d(y,v,C)},u)},[m,p,d]),S=F((y,v,C)=>{h.current[v]="pending-close",M.current=window.setTimeout(()=>{p(C)},400)},[p]),w=F(()=>{let{current:y}=a,v=y.at(-1),C=v?document.getElementById(v.id):void 0;if(C){let{right:u,bottom:b}=C.getBoundingClientRect(),{clientHeight:T,clientWidth:E}=document.body;if(u>E){let x=y.length>1?ir(e,y):rr(y,u-E);c(x)}else if(b>T){let x=sr(y,b-T);c(x)}typeof C.tabIndex=="number"&&C.focus()}},[e,c]),N=F((y,v=!1)=>{let{hostMenuId:C,targetMenuId:u,menuItemId:b,isGroup:T,isOpen:E}=Bt(y,e),{current:{[C]:x}}=h,R=v?0:void 0;if(x==="no-popup"&&T)h.current[C]="popup-pending",P(C,u,b,R);else if(x==="popup-pending"&&!T)h.current[C]="no-popup",clearTimeout(f.current),f.current=void 0;else if(x==="popup-pending"&&T)clearTimeout(f.current),P(C,u,b,R);else if(x==="popup-open")if(l(u)){let k=i(u);switch(p(b),k){case"pending-close":clearTimeout(M.current),M.current=void 0,h.current[u]="no-popup",m();break;default:}}else{let[k,B]=a.current.slice(-2);k.id===C&&h.current[B.id]!=="pending-close"?(S(C,B.id,b),T&&!E&&P(C,u,b,R)):k.id===C&&T&&b!==B.id&&h.current[B.id]==="pending-close"||T?P(C,u,b,R):h.current[B.id]!=="pending-close"&&p(b)}x==="pending-close"&&(m(),clearTimeout(M.current),M.current=void 0,h.current[C]="popup-open")},[m,p,i,l,e,S,P]),L=or(()=>({onMouseEnter:y=>{let v=$e(y.target);N(v),o(y,v.id)},onClick:y=>{let v=$e(y.target),{isGroup:C,menuItemId:u}=Bt(v,e);C?N(v):t(u)}}),[t,o,e,N]);return{closeMenu:g,handleRender:w,listItemProps:L,openMenu:N,openMenus:a.current}};import{useId as lr}from"@vuu-ui/vuu-layout";import{Fragment as pr,jsx as Jt}from"react/jsx-runtime";import{createElement as Gt}from"react";var cr=()=>{},_t=({PortalProps:e,activatedByKeyboard:t,children:o,className:n,id:s,onClose:r=()=>{},position:a={x:0,y:0},style:l,...i})=>{let c=Be(r);c.current=r;let f=lr(s),M=Be(cr),[h,d]=Dt(o,f),g=Be(t),p=Kt(()=>{g.current=!1},[]),m=Kt(b=>{let T=b.slice(9),{action:E,options:x}=d[T];M.current(f),r({type:"menu-action",menuId:E,options:x})},[d,f,r]),{closeMenu:P,listItemProps:S,openMenu:w,openMenus:N,handleRender:L}=Ut({id:`${f}`,onActivate:m,onMouseEnterItem:p,position:a});M.current=P;let y=()=>{g.current=!0,P()},v=()=>{},C=N.length-1,u=b=>{if(!(b>=C)){let{id:T}=N[b+1];return T}};return Jt(pr,{children:N.map(({id:b,left:T,top:E},x,R)=>{let k=u(x);return Gt(X,{...e,key:x,onRender:L},Jt(zt,{anchorElement:{current:document.body},placement:"absolute",position:{left:T,top:E},children:Gt(Fe,{...i,activatedByKeyboard:g.current,childMenuShowing:k,className:n,id:b,isRoot:x===0,key:x,listItemProps:S,onActivate:m,onHighlightMenuItem:v,onCloseMenu:y,openMenu:w,style:l,tabIndex:x===R.length-1?0:void 0},h[b])}))})})};_t.displayName="ContextMenu";import{createContext as dr,useCallback as mr,useMemo as fr}from"react";import{jsx as Ve}from"react/jsx-runtime";var Oe=dr(null),hr=({children:e,context:t,menuActionHandler:o,menuBuilder:n})=>{let s=fr(()=>t!=null&&t.menuBuilders&&n?t.menuBuilders.concat(n):n?[n]:(t==null?void 0:t.menuBuilders)||[],[t,n]),r=mr(a=>{var l;if(o!=null&&o(a)||(l=t==null?void 0:t.menuActionHandler)!=null&&l.call(t,a))return!0},[t,o]);return Ve(Oe.Provider,{value:{menuActionHandler:r,menuBuilders:s},children:e})},Wt=({children:e,label:t,menuActionHandler:o,menuBuilder:n})=>Ve(Oe.Consumer,{children:s=>Ve(hr,{context:s,label:t,menuActionHandler:o,menuBuilder:n,children:e})});import{isGroupMenuItemDescriptor as Gl}from"@vuu-ui/vuu-utils";import{cloneElement as _l,useCallback as zl,useContext as Wl,useMemo as ql}from"react";import fl from"classnames";import gl,{createElement as yl}from"react";import xl from"react-dom";import*as gr from"react-dom";import il from"classnames";import br from"classnames";import{useCallback as yr,useLayoutEffect as vr,useRef as Cr,useState as Mr}from"react";var qt=(e,t,o,n,s,r)=>{let{bottom:a,height:l,left:i,right:c,top:f,width:M}=e.getBoundingClientRect();switch(t){case"below":return{left:i+o,top:a+n};case"right":return{left:c+o,top:f+n};case"below-center":return{left:i+M/2+o,top:a+n};case"below-right":return{left:i,minWidth:s,top:a+n};case"below-full-width":return{left:i+o,minWidth:s,top:a+n,width:M};case"center":return r?{left:M/2-r.width/2+o,top:l/2-r.height/2+n,visibility:"visible"}:{left:M/2+o,top:l/2+n,visibility:"hidden"};default:throw Error("Popup getPositionRelativeToAnchor only supported placement values are below and right")}},Ue=({anchorElement:e,minWidth:t,offsetLeft:o=0,offsetTop:n=0,placement:s,position:r})=>{let a=Cr(null),[l,i]=Mr(r);vr(()=>{if(s==="absolute"&&r)i(r);else if(e.current){let f=a.current===null?void 0:a.current.getBoundingClientRect(),M=qt(e.current,s,o,n,t,f);i(M)}},[e,t,o,n,s,r]);let c=yr(f=>{if(a.current=f,f&&s==="center"&&e.current){let{height:M,width:h}=f.getBoundingClientRect();i(qt(e.current,s,o,n,void 0,{height:M,width:h}))}},[e,o,n,s]);return{position:l,popupRef:s==="center"?c:void 0}};import{jsx as xr}from"react/jsx-runtime";var zt=({children:e,className:t,anchorElement:o,minWidth:n,placement:s,position:r})=>{let{popupRef:a,position:l}=Ue({anchorElement:o,minWidth:n,placement:s,position:r});return l===void 0?null:xr("div",{className:br("vuuPortal",t),ref:a,style:l,children:e})};import{jsx as rc}from"react/jsx-runtime";import{useCallback as vc,useRef as Cc,useState as Mc}from"react";import Ec from"classnames";import{Button as Sc}from"@salt-ds/core";import{useId as Rc}from"@vuu-ui/vuu-layout";import{jsx as Ac}from"react/jsx-runtime";import{Button as Uc}from"@salt-ds/core";import Gc from"classnames";import{useLayoutEffect as zc,useRef as Wc}from"react";import{jsx as jc,jsxs as ep}from"react/jsx-runtime";var Yc={current:document.body};import{useLayoutEffect as ip,useState as ap}from"react";import gp from"classnames";import{jsx as Cp}from"react/jsx-runtime";import{useCallback as Pp,useRef as Tp,useState as Ep}from"react";import{useId as Sp}from"@vuu-ui/vuu-layout";import Lr,{useState as Fp,useContext as Pr,useCallback as $p,useEffect as Bp}from"react";import Op from"classnames";import{getUniqueId as Kp}from"@vuu-ui/vuu-utils";import{jsx as zp,jsxs as Wp}from"react/jsx-runtime";var Tr=Lr.createContext({notify:()=>"have you forgotten to provide a NotificationProvider?"});var Zt=()=>Pr(Tr);import{jsx as kr}from"react/jsx-runtime";var Ke,ne=()=>(Ke===void 0&&(Ke=new Hr),Ke),Yt=Er.createContext({layoutMetadata:[],saveLayout:()=>{},applicationJson:Ar,saveApplicationLayout:()=>{},saveApplicationSettings:()=>{},loadLayoutById:()=>{}}),Ir=(e,t)=>{var o;return((o=e.props)==null?void 0:o.title)!==void 0?e:{...e,props:{...e.props,title:t.name}}},yd=e=>{let[t,o]=Xt([]),[,n]=Xt({}),{notify:s}=Zt(),r=Nr(Rr),a=z((d,g=!0)=>{r.current=d,g&&n({})},[]),l=z((d,g=!0)=>{a({...r.current,layout:d},g)},[a]),i=z(d=>{a({...r.current,settings:{...r.current.settings,...d}},!1)},[a]);Sr(()=>{let d=ne();d.loadMetadata().then(g=>{o(g)}).catch(g=>{s({type:"error",header:"Failed to Load Layouts",body:"Could not load list of available layouts"}),console.error("Error occurred while retrieving metadata",g)}),d.loadApplicationJSON().then(g=>{a(g)}).catch(g=>{s({type:"error",header:"Failed to Load Layout",body:"Could not load your latest view"}),console.error("Error occurred while retrieving application layout",g)})},[s,a]);let c=z(d=>{l(d,!1),ne().saveApplicationJSON(r.current)},[l]),f=z(d=>{let g=Dr(r.current.layout,"#main-tabs.ACTIVE_CHILD");g?ne().createLayout(d,Ir(g,d)).then(p=>{s({type:"success",header:"Layout Saved Successfully",body:`${p.name} saved successfully`}),o(m=>[...m,p])}).catch(p=>{s({type:"error",header:"Failed to Save Layout",body:`Failed to save layout ${d.name}`}),console.error("Error occurred while saving layout",p)}):s({type:"error",header:"Failed to Save Layout",body:"Cannot save undefined layout"})},[s]),M=z(d=>{i(d),ne().saveApplicationJSON(r.current)},[i]),h=z(d=>{ne().loadLayout(d).then(g=>{var m,P;let{layout:p}=r.current;l({...p,children:(p.children||[]).concat(g),props:{...p.props,active:(P=(m=p.children)==null?void 0:m.length)!=null?P:0}})}).catch(g=>{s({type:"error",header:"Failed to Load Layout",body:"Failed to load the requested layout"}),console.error("Error occurred while loading layout",g)})},[s,l]);return kr(Yt.Provider,{value:{layoutMetadata:t,saveLayout:f,applicationJson:r.current,saveApplicationLayout:c,saveApplicationSettings:M,loadLayoutById:h},children:e.children})},ve=()=>wr(Yt);import{Fragment as Qt,jsx as J,jsxs as Ce}from"react/jsx-runtime";var W="vuuLayoutList",jt=e=>{let{layoutMetadata:t,loadLayoutById:o}=ve(),n=r=>{r&&o(r)},s=t.reduce((r,a)=>r[a.group]?{...r,[a.group]:[...r[a.group],a]}:{...r,[a.group]:[a]},{});return Ce("div",{className:W,...e,children:[J("div",{className:`${W}-header`,children:"My Layouts"}),J(Fr,{height:"auto",source:Object.entries(s),ListItem:({item:r})=>{if(!r)return J(Qt,{});let[a,l]=r;return Ce(Qt,{children:[J("div",{className:`${W}-groupName`,children:a}),l.map(i=>Ce("div",{className:`${W}-layoutContainer`,onClick:()=>n(i==null?void 0:i.id),children:[J("img",{className:`${W}-screenshot`,src:i==null?void 0:i.screenshot}),Ce("div",{children:[J("div",{className:`${W}-layoutName`,children:i==null?void 0:i.name}),J("div",{className:`${W}-layoutDetails`,children:J("div",{children:`${i==null?void 0:i.user}, ${i==null?void 0:i.created}`})})]})]},i==null?void 0:i.id))]})}})]})};import{VuuLogo as Xr}from"@vuu-ui/vuu-icons";import{Stack as Yr,useLayoutProviderDispatch as Qr}from"@vuu-ui/vuu-layout";import{Tab as Me,Tabstrip as jr}from"@vuu-ui/vuu-ui-controls";import We from"classnames";import{useCallback as qe,useState as es}from"react";import{Palette as $r,PaletteItem as Br}from"@vuu-ui/vuu-layout";import{jsx as re,jsxs as Vr}from"react/jsx-runtime";var Ge="vuuFeatureList",Je=({features:e,title:t="VUU TABLES",...o})=>{let n={},s={height:"100%"};return Vr("div",{...o,className:Ge,children:[re("div",{className:`${Ge}-header`,children:t}),re("div",{className:`${Ge}-content`,children:re($r,{orientation:"vertical",ListProps:s,ViewProps:n,children:e.map((r,a)=>re(Br,{closeable:!0,label:r.title,resizeable:!0,resize:"defer",header:!0,children:re(pe,{...r})},a))})})]})};import{createContext as Or,isValidElement as Ur,cloneElement as Kr,useContext as eo}from"react";import Gr from"classnames";import{jsx as Zr}from"react/jsx-runtime";var Jr="medium",_r="salt-theme",zr="light",_e=Or({density:"high",theme:"vuu",themeMode:"light"}),Wr=["vuu","vuu-density-high","light"],G=e=>{let t=eo(_e);return e?[e.themeClass,e.densityClass,e.dataMode]:t?[`${t.theme}-theme`,`${t.theme}-density-${t.density}`,t.themeMode]:Wr},qr=(e,t,o,n)=>{var s;return Ur(e)?Kr(e,{className:Gr((s=e.props)==null?void 0:s.className,`${t}-theme`,`${t}-density-${n}`),"data-mode":o}):(console.warn(`
1
+ // src/app-header/AppHeader.tsx
2
+ import { useCallback as useCallback2 } from "react";
3
+ import cx2 from "classnames";
4
+ import { Toolbar } from "@vuu-ui/vuu-layout";
5
+
6
+ // src/login/LoginPanel.tsx
7
+ import {
8
+ useCallback,
9
+ useEffect,
10
+ useRef,
11
+ useState
12
+ } from "react";
13
+ import { Button, FormField, FormFieldLabel } from "@salt-ds/core";
14
+ import { VuuInput } from "@vuu-ui/vuu-ui-controls";
15
+
16
+ // src/login/VuuLogo.tsx
17
+ import { useMemo } from "react";
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ var VuuLogo = () => {
20
+ const logo = useMemo(
21
+ () => /* @__PURE__ */ jsxs(
22
+ "svg",
23
+ {
24
+ width: "184",
25
+ height: "90",
26
+ viewBox: "0 0 184 90",
27
+ fill: "none",
28
+ xmlns: "http://www.w3.org/2000/svg",
29
+ children: [
30
+ /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_1173_59965)", children: [
31
+ /* @__PURE__ */ jsx(
32
+ "path",
33
+ {
34
+ d: "M77.0775 31.1019L69.4572 15.1795L66.3997 13.7093L47.6353 44.165L75.7224 61.2361L81.8124 51.2694L77.0775 31.1019Z",
35
+ fill: "url(#paint0_linear_1173_59965)"
36
+ }
37
+ ),
38
+ /* @__PURE__ */ jsx(
39
+ "path",
40
+ {
41
+ d: "M82.4101 49.7431C81.0488 51.8314 79.1993 53.648 76.8897 54.9809C74.2954 56.4792 71.4601 57.194 68.6623 57.194C63.3422 57.194 58.1597 54.6188 55.0209 49.971L30.5358 7.8193L30.5232 7.84116C25.8791 0.274825 16.0118 -2.26289 8.27258 2.21011C0.411306 6.74866 -2.26753 16.7872 2.28587 24.625L35.5054 81.8189C36.9856 84.3691 39.0542 86.3668 41.4358 87.7527C41.4545 87.7652 41.4733 87.7777 41.4921 87.7902C41.5015 87.7964 41.514 87.8027 41.5234 87.8089C42.6312 88.4457 43.8079 88.942 45.0253 89.3072C45.116 89.3353 45.2099 89.3634 45.3007 89.3883C45.7388 89.5101 46.1801 89.6193 46.6276 89.7067C46.7121 89.7223 46.7966 89.7317 46.8811 89.7473C47.241 89.8097 47.604 89.8628 47.967 89.9003C48.111 89.9159 48.2549 89.9315 48.3989 89.9408C48.8151 89.9752 49.2313 89.997 49.6507 90.0001C49.6726 90.0001 49.6945 90.0001 49.7132 90.0001C49.7195 90.0001 49.7226 90.0001 49.7289 90.0001C49.7352 90.0001 49.7383 90.0001 49.7445 90.0001C50.1983 90.0001 50.6552 89.9752 51.109 89.9377C51.2123 89.9283 51.3155 89.919 51.422 89.9065C51.8663 89.8597 52.3107 89.8004 52.7551 89.7192C52.7614 89.7192 52.7676 89.7192 52.7739 89.7192C53.2621 89.6287 53.7503 89.5101 54.2322 89.3727C54.2635 89.3634 54.2917 89.354 54.323 89.3446C55.024 89.1418 55.7156 88.8889 56.3978 88.5861C56.4104 88.5799 56.426 88.5736 56.4385 88.5674C56.958 88.3364 57.4712 88.0836 57.9751 87.7933C58.4852 87.4999 58.9703 87.1815 59.4334 86.8413C59.8371 86.5478 60.2252 86.2357 60.6039 85.9048C61.0639 85.499 61.4989 85.0745 61.9026 84.6282C62.2062 84.2942 62.4972 83.9446 62.7757 83.5825C62.8665 83.4639 62.951 83.3421 63.0355 83.2235C63.2264 82.9613 63.4079 82.6929 63.5831 82.4182C63.6739 82.2746 63.7646 82.1342 63.8523 81.9906C63.8867 81.9344 63.9242 81.8813 63.9555 81.8251L82.5854 49.7525H82.4039L82.4101 49.7431Z",
42
+ fill: "url(#paint1_linear_1173_59965)"
43
+ }
44
+ ),
45
+ /* @__PURE__ */ jsx(
46
+ "path",
47
+ {
48
+ d: "M82.8264 32.8436L81.4181 30.4464L75.3375 19.1687L72.5178 14.3929C71.9858 13.1225 70.7309 12.2266 69.26 12.2266C67.3104 12.2266 65.7331 13.8029 65.7331 15.7445C65.7331 16.4031 65.924 17.0086 66.2401 17.5362L66.2025 17.5611L77.1557 36.1617C78.4764 38.4372 78.83 41.0873 78.1509 43.6281C77.4718 46.169 75.8445 48.2915 73.5631 49.6119C72.0609 50.4797 70.3553 50.9385 68.6341 50.9385C65.1166 50.9385 61.84 49.0563 60.0812 46.0285L44.3368 19.2654H44.3681L37.7179 7.81917L37.7054 7.84102C37.5896 7.65061 37.455 7.47893 37.333 7.29477L37.1452 6.97326C37.1452 6.97326 37.1296 6.98262 37.1233 6.98887C34.0001 2.55332 29.0054 0.0780356 23.8512 0.0187285V0H15.3515V0.0436999C21.2881 -0.368328 27.2247 2.46593 30.5232 7.84102L30.5357 7.81917L55.0177 49.974C58.1566 54.6187 63.3422 57.197 68.6592 57.197C71.4569 57.197 74.2922 56.4853 76.8866 54.9839C79.1961 53.651 81.0425 51.8312 82.407 49.7461H82.5885L82.5259 49.8523C83.399 48.4695 84.0687 46.9462 84.5006 45.3231C85.6304 41.0904 85.042 36.6705 82.8201 32.8467L82.8264 32.8436Z",
49
+ fill: "#F37880"
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsxs("g", { opacity: "0.86", children: [
53
+ /* @__PURE__ */ jsx(
54
+ "path",
55
+ {
56
+ d: "M66.1994 17.5642L77.1526 36.1648C78.4732 38.4403 78.8269 41.0904 78.1478 43.6313C77.7347 45.1795 76.9648 46.5716 75.9133 47.7234C77.2903 46.4686 78.2823 44.8486 78.7737 43.007C79.4527 40.4661 79.0991 37.816 77.7785 35.5405L66.8253 16.94L66.8628 16.915C66.5467 16.3875 66.3558 15.7819 66.3558 15.1233C66.3558 14.3117 66.6344 13.5657 67.0975 12.9695C66.2651 13.6125 65.7299 14.6176 65.7299 15.7476C65.7299 16.4062 65.9208 17.0118 66.2369 17.5393L66.1994 17.5642Z",
57
+ fill: "white"
58
+ }
59
+ ),
60
+ /* @__PURE__ */ jsx(
61
+ "path",
62
+ {
63
+ d: "M82.5382 49.8335L82.5291 49.8487C82.5291 49.8487 82.5352 49.8365 82.5413 49.8304C82.5413 49.8304 82.5413 49.8304 82.5413 49.8335H82.5382Z",
64
+ fill: "white"
65
+ }
66
+ ),
67
+ /* @__PURE__ */ jsx(
68
+ "path",
69
+ {
70
+ d: "M77.5156 54.3596C74.9213 55.8579 72.0859 56.5727 69.2882 56.5727C63.9681 56.5727 58.7856 53.9975 55.6467 49.3497L31.1616 7.19488L31.1491 7.21673C28.9053 3.56154 25.4441 1.08626 21.5917 0H15.3515V0.0436999C21.2881 -0.368328 27.2247 2.46593 30.5232 7.84102L30.5357 7.81917L55.0177 49.974C58.1566 54.6187 63.3422 57.197 68.6592 57.197C71.4569 57.197 74.2922 56.4853 76.8866 54.9839C78.2698 54.1848 79.4809 53.2109 80.5293 52.1122C79.6311 52.9581 78.6266 53.7166 77.5125 54.3596H77.5156Z",
71
+ fill: "white"
72
+ }
73
+ )
74
+ ] })
75
+ ] }),
76
+ /* @__PURE__ */ jsx(
77
+ "path",
78
+ {
79
+ d: "M117.046 58.661C116.362 58.661 115.792 58.509 115.336 58.205C114.906 57.8757 114.551 57.3943 114.272 56.761L104.354 34.493C104.076 33.8597 104 33.3023 104.126 32.821C104.253 32.3397 104.519 31.9597 104.924 31.681C105.33 31.4023 105.811 31.263 106.368 31.263C107.103 31.263 107.648 31.4277 108.002 31.757C108.382 32.061 108.699 32.5297 108.952 33.163L117.958 54.025H116.324L125.292 33.125C125.571 32.517 125.9 32.061 126.28 31.757C126.66 31.4277 127.192 31.263 127.876 31.263C128.434 31.263 128.89 31.4023 129.244 31.681C129.624 31.9597 129.865 32.3397 129.966 32.821C130.068 33.3023 129.979 33.8597 129.7 34.493L119.782 56.761C119.504 57.3943 119.149 57.8757 118.718 58.205C118.313 58.509 117.756 58.661 117.046 58.661Z",
80
+ fill: "white"
81
+ }
82
+ ),
83
+ /* @__PURE__ */ jsx(
84
+ "path",
85
+ {
86
+ d: "M144.63 58.737C142.781 58.737 141.147 58.4963 139.728 58.015C138.335 57.5337 137.157 56.8243 136.194 55.887C135.232 54.9243 134.51 53.7337 134.028 52.315C133.547 50.8963 133.306 49.2497 133.306 47.375V33.733C133.306 32.897 133.509 32.2763 133.914 31.871C134.345 31.4657 134.953 31.263 135.738 31.263C136.524 31.263 137.119 31.4657 137.524 31.871C137.955 32.2763 138.17 32.897 138.17 33.733V47.337C138.17 49.7437 138.715 51.555 139.804 52.771C140.919 53.9617 142.528 54.557 144.63 54.557C146.733 54.557 148.329 53.9617 149.418 52.771C150.508 51.555 151.052 49.7437 151.052 47.337V33.733C151.052 32.897 151.255 32.2763 151.66 31.871C152.091 31.4657 152.699 31.263 153.484 31.263C154.244 31.263 154.827 31.4657 155.232 31.871C155.663 32.2763 155.878 32.897 155.878 33.733V47.375C155.878 49.8577 155.448 51.9477 154.586 53.645C153.75 55.3423 152.496 56.6217 150.824 57.483C149.152 58.319 147.088 58.737 144.63 58.737Z",
87
+ fill: "white"
88
+ }
89
+ ),
90
+ /* @__PURE__ */ jsx(
91
+ "path",
92
+ {
93
+ d: "M172.685 58.737C170.836 58.737 169.202 58.4963 167.783 58.015C166.39 57.5337 165.212 56.8243 164.249 55.887C163.286 54.9243 162.564 53.7337 162.083 52.315C161.602 50.8963 161.361 49.2497 161.361 47.375V33.733C161.361 32.897 161.564 32.2763 161.969 31.871C162.4 31.4657 163.008 31.263 163.793 31.263C164.578 31.263 165.174 31.4657 165.579 31.871C166.01 32.2763 166.225 32.897 166.225 33.733V47.337C166.225 49.7437 166.77 51.555 167.859 52.771C168.974 53.9617 170.582 54.557 172.685 54.557C174.788 54.557 176.384 53.9617 177.473 52.771C178.562 51.555 179.107 49.7437 179.107 47.337V33.733C179.107 32.897 179.31 32.2763 179.715 31.871C180.146 31.4657 180.754 31.263 181.539 31.263C182.299 31.263 182.882 31.4657 183.287 31.871C183.718 32.2763 183.933 32.897 183.933 33.733V47.375C183.933 49.8577 183.502 51.9477 182.641 53.645C181.805 55.3423 180.551 56.6217 178.879 57.483C177.207 58.319 175.142 58.737 172.685 58.737Z",
94
+ fill: "white"
95
+ }
96
+ ),
97
+ /* @__PURE__ */ jsxs("defs", { children: [
98
+ /* @__PURE__ */ jsxs(
99
+ "linearGradient",
100
+ {
101
+ id: "paint0_linear_1173_59965",
102
+ x1: "47.6353",
103
+ y1: "37.4727",
104
+ x2: "81.8124",
105
+ y2: "37.4727",
106
+ gradientUnits: "userSpaceOnUse",
107
+ children: [
108
+ /* @__PURE__ */ jsx("stop", { stopColor: "#4906A5" }),
109
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#D3423A" })
110
+ ]
111
+ }
112
+ ),
113
+ /* @__PURE__ */ jsxs(
114
+ "linearGradient",
115
+ {
116
+ id: "paint1_linear_1173_59965",
117
+ x1: "0.0670626",
118
+ y1: "45.0017",
119
+ x2: "82.5916",
120
+ y2: "45.0017",
121
+ gradientUnits: "userSpaceOnUse",
122
+ children: [
123
+ /* @__PURE__ */ jsx("stop", { stopColor: "#7C06A5" }),
124
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#D3423A" })
125
+ ]
126
+ }
127
+ ),
128
+ /* @__PURE__ */ jsx("clipPath", { id: "clip0_1173_59965", children: /* @__PURE__ */ jsx(
129
+ "rect",
130
+ {
131
+ width: "85",
132
+ height: "90",
133
+ fill: "white",
134
+ transform: "translate(0.0670471)"
135
+ }
136
+ ) })
137
+ ] })
138
+ ]
139
+ }
140
+ ),
141
+ []
142
+ );
143
+ return logo;
144
+ };
145
+
146
+ // src/login/LoginPanel.tsx
147
+ import cx from "classnames";
148
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
149
+ var classBase = "vuuLoginPanel";
150
+ var LoginPanel = ({
151
+ appName = "Demo App",
152
+ className,
153
+ requirePassword = true,
154
+ onSubmit,
155
+ ...htmlAttributes
156
+ }) => {
157
+ const [username, setUserName] = useState("");
158
+ const [password, setPassword] = useState("");
159
+ const inputRef = useRef(null);
160
+ const login = () => {
161
+ onSubmit(username, password);
162
+ };
163
+ const handleUsername = (evt) => {
164
+ setUserName(evt.target.value);
165
+ };
166
+ const handlePassword = (evt) => {
167
+ setPassword(evt.target.value);
168
+ };
169
+ const handleCommitName = useCallback(() => {
170
+ if (!requirePassword) {
171
+ onSubmit(username);
172
+ }
173
+ }, [onSubmit, requirePassword, username]);
174
+ const handleCommitPassword = useCallback(() => {
175
+ if (username) {
176
+ onSubmit(username, password);
177
+ }
178
+ }, [onSubmit, password, username]);
179
+ const dataIsValid = username.trim() !== "" && (requirePassword === false || password.trim() !== "");
180
+ useEffect(() => {
181
+ var _a;
182
+ console.log(`inputRef`, {
183
+ input: inputRef.current
184
+ });
185
+ (_a = inputRef.current) == null ? void 0 : _a.focus();
186
+ }, []);
187
+ return /* @__PURE__ */ jsxs2("div", { ...htmlAttributes, className: cx(classBase, className), children: [
188
+ /* @__PURE__ */ jsxs2("div", { className: `${classBase}-branding`, children: [
189
+ /* @__PURE__ */ jsx2(VuuLogo, {}),
190
+ /* @__PURE__ */ jsx2("div", { className: `${classBase}-appName`, children: appName })
191
+ ] }),
192
+ /* @__PURE__ */ jsxs2("div", { className: `${classBase}-form`, children: [
193
+ /* @__PURE__ */ jsx2("div", { className: `${classBase}-title`, children: "Welcome Back" }),
194
+ /* @__PURE__ */ jsxs2(FormField, { children: [
195
+ /* @__PURE__ */ jsx2(FormFieldLabel, { children: "Username" }),
196
+ /* @__PURE__ */ jsx2(
197
+ VuuInput,
198
+ {
199
+ value: username,
200
+ id: "text-username",
201
+ inputRef,
202
+ onChange: handleUsername,
203
+ onCommit: handleCommitName
204
+ }
205
+ )
206
+ ] }),
207
+ requirePassword ? /* @__PURE__ */ jsxs2(FormField, { children: [
208
+ /* @__PURE__ */ jsx2(FormFieldLabel, { children: "Password" }),
209
+ /* @__PURE__ */ jsx2(
210
+ VuuInput,
211
+ {
212
+ className: `${classBase}-password`,
213
+ inputProps: {
214
+ type: "password"
215
+ },
216
+ value: password,
217
+ id: "text-password",
218
+ onChange: handlePassword,
219
+ onCommit: handleCommitPassword,
220
+ endAdornment: /* @__PURE__ */ jsx2("span", { "data-icon": "eye", style: { cursor: "pointer" } })
221
+ }
222
+ )
223
+ ] }) : null,
224
+ /* @__PURE__ */ jsx2(
225
+ Button,
226
+ {
227
+ className: `${classBase}-login`,
228
+ disabled: !dataIsValid,
229
+ onClick: login,
230
+ variant: "cta",
231
+ children: "Login"
232
+ }
233
+ )
234
+ ] })
235
+ ] });
236
+ };
237
+
238
+ // src/login/login-utils.ts
239
+ import { getCookieValue } from "@vuu-ui/vuu-utils";
240
+ var getAuthModeFromCookies = () => {
241
+ const mode = getCookieValue("vuu-auth-mode");
242
+ return mode != null ? mode : "";
243
+ };
244
+ var getAuthDetailsFromCookies = () => {
245
+ const username = getCookieValue("vuu-username");
246
+ const token = getCookieValue("vuu-auth-token");
247
+ return [username, token];
248
+ };
249
+ var getDefaultLoginUrl = () => {
250
+ const authMode = getAuthModeFromCookies();
251
+ return authMode === "login" ? "login.html" : "demo.html";
252
+ };
253
+ var redirectToLogin = (loginUrl = getDefaultLoginUrl()) => {
254
+ window.location.href = loginUrl;
255
+ };
256
+ var logout = (loginUrl) => {
257
+ document.cookie = "vuu-username= ; expires = Thu, 01 Jan 1970 00:00:00 GMT";
258
+ document.cookie = "vuu-auth-token= ; expires = Thu, 01 Jan 1970 00:00:00 GMT";
259
+ redirectToLogin(loginUrl);
260
+ };
261
+
262
+ // src/app-header/AppHeader.tsx
263
+ import { Button as Button2 } from "@salt-ds/core";
264
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
265
+ var classBase2 = "vuuAppHeader";
266
+ var AppHeader = ({
267
+ className: classNameProp,
268
+ layoutId,
269
+ loginUrl,
270
+ onNavigate,
271
+ onSwitchTheme,
272
+ themeMode = "light",
273
+ user,
274
+ ...htmlAttributes
275
+ }) => {
276
+ const className = cx2(classBase2, classNameProp);
277
+ const handleLogout = useCallback2(() => {
278
+ logout(loginUrl);
279
+ }, [loginUrl]);
280
+ return /* @__PURE__ */ jsxs3(
281
+ Toolbar,
282
+ {
283
+ alignItems: "end",
284
+ className,
285
+ height: 36,
286
+ showSeparators: true,
287
+ ...htmlAttributes,
288
+ children: [
289
+ /* @__PURE__ */ jsx3(Button2, { className: `${classBase2}-menuItem`, variant: "secondary", children: "Help" }),
290
+ /* @__PURE__ */ jsxs3(Button2, { className: `${classBase2}-menuItem`, variant: "secondary", children: [
291
+ "History ",
292
+ /* @__PURE__ */ jsx3("span", { "data-icon": "history" })
293
+ ] }),
294
+ /* @__PURE__ */ jsxs3(Button2, { className: `${classBase2}-menuItem`, variant: "secondary", children: [
295
+ "View ",
296
+ /* @__PURE__ */ jsx3("span", { "data-icon": "settings" })
297
+ ] }),
298
+ /* @__PURE__ */ jsx3(
299
+ Button2,
300
+ {
301
+ className: `${classBase2}-menuItem`,
302
+ onClick: handleLogout,
303
+ variant: "secondary",
304
+ children: "Log out"
305
+ }
306
+ )
307
+ ]
308
+ }
309
+ );
310
+ };
311
+
312
+ // src/connection-status/ConnectionStatusIcon.tsx
313
+ import React, { useEffect as useEffect2, useState as useState2 } from "react";
314
+ import cx3 from "classnames";
315
+ import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
316
+ var ConnectionStatusIcon = ({ connectionStatus, className, element = "span", ...props }) => {
317
+ const [classBase15, setClassBase] = useState2("vuuConnectingStatus");
318
+ useEffect2(() => {
319
+ switch (connectionStatus) {
320
+ case "connected":
321
+ case "reconnected":
322
+ setClassBase("vuuActiveStatus");
323
+ break;
324
+ case "connecting":
325
+ setClassBase("vuuConnectingStatus");
326
+ break;
327
+ case "disconnected":
328
+ setClassBase("vuuDisconnectedStatus");
329
+ break;
330
+ default:
331
+ break;
332
+ }
333
+ }, [connectionStatus]);
334
+ const statusIcon = React.createElement(
335
+ element,
336
+ {
337
+ ...props,
338
+ className: cx3("vuuStatus vuuIcon", classBase15, className)
339
+ }
340
+ );
341
+ return /* @__PURE__ */ jsx4(Fragment, { children: /* @__PURE__ */ jsxs4("div", { className: "vuuStatus-container salt-theme", children: [
342
+ statusIcon,
343
+ /* @__PURE__ */ jsxs4("div", { className: "vuuStatus-text", children: [
344
+ "Status: ",
345
+ connectionStatus.toUpperCase()
346
+ ] })
347
+ ] }) });
348
+ };
349
+
350
+ // src/density-switch/DensitySwitch.tsx
351
+ import { Dropdown } from "@salt-ds/lab";
352
+ import { useCallback as useCallback3 } from "react";
353
+ import cx4 from "classnames";
354
+ import { jsx as jsx5 } from "react/jsx-runtime";
355
+ var classBase3 = "vuuDensitySwitch";
356
+ var densities = ["high", "medium", "low", "touch"];
357
+ var DEFAULT_DENSITY = "high";
358
+ var DensitySwitch = ({
359
+ className: classNameProp,
360
+ defaultDensity = DEFAULT_DENSITY,
361
+ onChange
362
+ }) => {
363
+ const handleSelectionChange = useCallback3(
364
+ (_event, selectedItem) => {
365
+ onChange(selectedItem);
366
+ },
367
+ [onChange]
368
+ );
369
+ const className = cx4(classBase3, classNameProp);
370
+ return /* @__PURE__ */ jsx5(
371
+ Dropdown,
372
+ {
373
+ className,
374
+ source: densities,
375
+ defaultSelected: defaultDensity,
376
+ onSelectionChange: handleSelectionChange
377
+ }
378
+ );
379
+ };
380
+
381
+ // src/feature/Feature.tsx
382
+ import React3, { Suspense, useEffect as useEffect3 } from "react";
383
+ import { registerComponent } from "@vuu-ui/vuu-layout";
384
+
385
+ // src/feature/FeatureErrorBoundary.tsx
386
+ import React2 from "react";
387
+ import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
388
+ var FeatureErrorBoundary = class extends React2.Component {
389
+ constructor(props) {
390
+ super(props);
391
+ this.state = { errorMessage: null };
392
+ }
393
+ static getDerivedStateFromError(error2) {
394
+ return { errorMessage: error2.message };
395
+ }
396
+ componentDidCatch(error2, errorInfo) {
397
+ console.log(`error creating component at ${this.props.url}`);
398
+ console.log(error2, errorInfo);
399
+ }
400
+ render() {
401
+ if (this.state.errorMessage) {
402
+ return /* @__PURE__ */ jsxs5(Fragment2, { children: [
403
+ /* @__PURE__ */ jsx6("h1", { children: "An error occured while creating component." }),
404
+ /* @__PURE__ */ jsx6("p", { children: this.state.errorMessage })
405
+ ] });
406
+ }
407
+ return this.props.children;
408
+ }
409
+ };
410
+
411
+ // src/feature/Loader.tsx
412
+ import { jsx as jsx7 } from "react/jsx-runtime";
413
+ var Loader = () => /* @__PURE__ */ jsx7("div", { className: "hwLoader" });
414
+
415
+ // src/feature/css-module-loader.ts
416
+ var importCSS = async (path) => {
417
+ const container = new CSSStyleSheet();
418
+ return fetch(path).then((x) => x.text()).then((x) => container.replace(x));
419
+ };
420
+
421
+ // src/feature/Feature.tsx
422
+ import { jsx as jsx8 } from "react/jsx-runtime";
423
+ var componentsMap = /* @__PURE__ */ new Map();
424
+ var useCachedFeature = (url) => {
425
+ useEffect3(
426
+ () => () => {
427
+ componentsMap.delete(url);
428
+ },
429
+ [url]
430
+ );
431
+ if (!componentsMap.has(url)) {
432
+ componentsMap.set(
433
+ url,
434
+ React3.lazy(() => import(
435
+ /* @vite-ignore */
436
+ url
437
+ ))
438
+ );
439
+ }
440
+ const lazyFeature = componentsMap.get(url);
441
+ if (!lazyFeature) {
442
+ throw Error(`Unable to load Lazy Feature at url ${url}`);
443
+ } else {
444
+ return lazyFeature;
445
+ }
446
+ };
447
+ function RawFeature({
448
+ url,
449
+ css,
450
+ ComponentProps: params,
451
+ ...props
452
+ }) {
453
+ if (css) {
454
+ importCSS(css).then((styleSheet) => {
455
+ document.adoptedStyleSheets = [
456
+ ...document.adoptedStyleSheets,
457
+ styleSheet
458
+ ];
459
+ });
460
+ }
461
+ const LazyFeature = useCachedFeature(url);
462
+ return /* @__PURE__ */ jsx8(FeatureErrorBoundary, { url, children: /* @__PURE__ */ jsx8(Suspense, { fallback: /* @__PURE__ */ jsx8(Loader, {}), children: /* @__PURE__ */ jsx8(LazyFeature, { ...props, ...params }) }) });
463
+ }
464
+ var Feature = React3.memo(RawFeature);
465
+ Feature.displayName = "Feature";
466
+ registerComponent("Feature", Feature, "view");
467
+
468
+ // src/layout-management/SaveLayoutPanel.tsx
469
+ import { useEffect as useEffect4, useState as useState3 } from "react";
470
+ import { Input, Button as Button3, FormField as FormField2, FormFieldLabel as FormFieldLabel2, Text } from "@salt-ds/core";
471
+ import { ComboBox, Checkbox, RadioButton } from "@vuu-ui/vuu-ui-controls";
472
+ import { takeScreenshot } from "@vuu-ui/vuu-utils";
473
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
474
+ var classBase4 = "saveLayoutPanel";
475
+ var formField = `${classBase4}-formField`;
476
+ var groups = ["Group 1", "Group 2", "Group 3", "Group 4", "Group 5"];
477
+ var checkboxValues = ["Value 1", "Value 2", "Value 3"];
478
+ var radioValues = ["Value 1", "Value 2", "Value 3"];
479
+ var SaveLayoutPanel = (props) => {
480
+ const { defaultTitle = "", onCancel, onSave, componentId } = props;
481
+ const [layoutName, setLayoutName] = useState3(defaultTitle);
482
+ const [group, setGroup] = useState3("");
483
+ const [checkValues, setCheckValues] = useState3([]);
484
+ const [radioValue, setRadioValue] = useState3(radioValues[0]);
485
+ const [screenshot, setScreenshot] = useState3();
486
+ useEffect4(() => {
487
+ if (componentId) {
488
+ takeScreenshot(document.getElementById(componentId)).then(
489
+ (screenshot2) => setScreenshot(screenshot2)
490
+ );
491
+ }
492
+ }, [componentId]);
493
+ const handleSubmit = () => {
494
+ onSave({
495
+ name: layoutName,
496
+ group,
497
+ screenshot: screenshot != null ? screenshot : "",
498
+ user: "User"
499
+ });
500
+ };
501
+ return /* @__PURE__ */ jsxs6("div", { className: `${classBase4}-panelContainer`, children: [
502
+ /* @__PURE__ */ jsxs6("div", { className: `${classBase4}-panelContent`, children: [
503
+ /* @__PURE__ */ jsxs6("div", { className: `${classBase4}-formContainer`, children: [
504
+ /* @__PURE__ */ jsxs6(FormField2, { className: formField, children: [
505
+ /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Group" }),
506
+ /* @__PURE__ */ jsx9(
507
+ ComboBox,
508
+ {
509
+ source: groups,
510
+ allowFreeText: true,
511
+ InputProps: {
512
+ inputProps: {
513
+ className: `${classBase4}-inputText`,
514
+ placeholder: "Select Group or Enter New Name",
515
+ onChange: (event) => setGroup(event.target.value)
516
+ }
517
+ },
518
+ width: "100%",
519
+ onSelectionChange: (_, value) => setGroup(value || "")
520
+ }
521
+ )
522
+ ] }),
523
+ /* @__PURE__ */ jsxs6(FormField2, { className: formField, children: [
524
+ /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Layout Name" }),
525
+ /* @__PURE__ */ jsx9(
526
+ Input,
527
+ {
528
+ inputProps: {
529
+ className: `${classBase4}-inputText`,
530
+ placeholder: "Enter Layout Name"
531
+ },
532
+ onChange: (event) => setLayoutName(event.target.value),
533
+ value: layoutName
534
+ }
535
+ )
536
+ ] }),
537
+ /* @__PURE__ */ jsxs6(FormField2, { className: formField, children: [
538
+ /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Some Layout Setting" }),
539
+ /* @__PURE__ */ jsx9("div", { className: `${classBase4}-settingsGroup`, children: checkboxValues.map((value, i) => /* @__PURE__ */ jsx9(
540
+ Checkbox,
541
+ {
542
+ onToggle: () => setCheckValues(
543
+ (prev) => prev.includes(value) ? prev.filter((entry) => entry !== value) : [...prev, value]
544
+ ),
545
+ checked: checkValues.includes(value),
546
+ label: value
547
+ },
548
+ i
549
+ )) })
550
+ ] }),
551
+ /* @__PURE__ */ jsxs6(FormField2, { className: formField, children: [
552
+ /* @__PURE__ */ jsx9(FormFieldLabel2, { children: "Some Layout Setting" }),
553
+ /* @__PURE__ */ jsx9("div", { className: `${classBase4}-settingsGroup`, children: radioValues.map((value, i) => /* @__PURE__ */ jsx9(
554
+ RadioButton,
555
+ {
556
+ onClick: () => setRadioValue(value),
557
+ checked: radioValue === value,
558
+ label: value,
559
+ groupName: "radioGroup"
560
+ },
561
+ i
562
+ )) })
563
+ ] })
564
+ ] }),
565
+ /* @__PURE__ */ jsx9("div", { className: `${classBase4}-screenshotContainer`, children: screenshot ? /* @__PURE__ */ jsx9(
566
+ "img",
567
+ {
568
+ className: `${classBase4}-screenshot`,
569
+ src: screenshot,
570
+ alt: "screenshot of current layout"
571
+ }
572
+ ) : /* @__PURE__ */ jsx9(Text, { className: "screenshot", children: "No screenshot available" }) })
573
+ ] }),
574
+ /* @__PURE__ */ jsxs6("div", { className: `${classBase4}-buttonsContainer`, children: [
575
+ /* @__PURE__ */ jsx9(Button3, { className: `${classBase4}-cancelButton`, onClick: onCancel, children: "Cancel" }),
576
+ /* @__PURE__ */ jsx9(
577
+ Button3,
578
+ {
579
+ className: `${classBase4}-saveButton`,
580
+ onClick: handleSubmit,
581
+ disabled: layoutName === "" || group === "",
582
+ children: "Save"
583
+ }
584
+ )
585
+ ] })
586
+ ] });
587
+ };
588
+
589
+ // src/layout-management/LayoutList.tsx
590
+ import { List } from "@vuu-ui/vuu-ui-controls";
591
+
592
+ // src/layout-management/useLayoutManager.tsx
593
+ import React8, {
594
+ useCallback as useCallback16,
595
+ useContext as useContext3,
596
+ useEffect as useEffect6,
597
+ useRef as useRef12,
598
+ useState as useState13
599
+ } from "react";
600
+ import {
601
+ loadingApplicationJson,
602
+ LocalLayoutPersistenceManager,
603
+ resolveJSONPath,
604
+ defaultApplicationJson
605
+ } from "@vuu-ui/vuu-layout";
606
+
607
+ // ../vuu-popups/src/dialog/Dialog.tsx
608
+ import { Scrim } from "@salt-ds/lab";
609
+ import cx6 from "classnames";
610
+ import { useCallback as useCallback4, useRef as useRef3 } from "react";
611
+
612
+ // ../vuu-popups/src/portal/Portal.tsx
613
+ import { useLayoutEffect, useRef as useRef2, useState as useState4 } from "react";
614
+ import { createPortal } from "react-dom";
615
+ function getContainer(container) {
616
+ return typeof container === "function" ? container() : container;
617
+ }
618
+ var DEFAULT_ID = "vuu-portal-root";
619
+ var Portal = ({
620
+ children,
621
+ container: containerProp = document.body,
622
+ id = DEFAULT_ID,
623
+ onRender,
624
+ open = true,
625
+ themeAttributes
626
+ }) => {
627
+ var _a;
628
+ const [mounted, setMounted] = useState4(false);
629
+ const portalRef = useRef2(null);
630
+ const container = (_a = getContainer(containerProp)) != null ? _a : document.body;
631
+ const [themeClass, densityClass, dataMode] = useThemeAttributes(themeAttributes);
632
+ useLayoutEffect(() => {
633
+ const root = document.getElementById(id);
634
+ if (root) {
635
+ portalRef.current = root;
636
+ } else {
637
+ portalRef.current = document.createElement("div");
638
+ portalRef.current.id = id;
639
+ }
640
+ const el = portalRef.current;
641
+ if (!container.contains(el)) {
642
+ container.appendChild(el);
643
+ }
644
+ el.classList.add(themeClass, densityClass);
645
+ el.dataset.mode = dataMode;
646
+ setMounted(true);
647
+ }, [id, container, themeClass, densityClass, dataMode]);
648
+ useLayoutEffect(() => {
649
+ requestAnimationFrame(() => {
650
+ onRender == null ? void 0 : onRender();
651
+ });
652
+ }, [onRender]);
653
+ if (open && mounted && portalRef.current && children) {
654
+ return createPortal(children, portalRef.current);
655
+ }
656
+ return null;
657
+ };
658
+
659
+ // ../vuu-popups/src/dialog-header/DialogHeader.tsx
660
+ import { Button as Button4, Text as Text2 } from "@salt-ds/core";
661
+ import cx5 from "classnames";
662
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
663
+ var classBase5 = "vuuDialogHeader";
664
+ var DialogHeader = ({
665
+ hideCloseButton = false,
666
+ title,
667
+ onClose,
668
+ ...htmlAttributes
669
+ }) => {
670
+ return /* @__PURE__ */ jsxs7("div", { ...htmlAttributes, className: cx5(classBase5, "vuuToolbarProxy"), children: [
671
+ /* @__PURE__ */ jsx10(Text2, { className: "dialogHeader", children: title }),
672
+ !hideCloseButton && /* @__PURE__ */ jsx10(
673
+ Button4,
674
+ {
675
+ onClick: onClose,
676
+ "data-align": "end",
677
+ "data-icon": "close",
678
+ variant: "secondary"
679
+ },
680
+ "close"
681
+ )
682
+ ] });
683
+ };
684
+
685
+ // ../vuu-popups/src/dialog/Dialog.tsx
686
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
687
+ var classBase6 = "vuuDialog";
688
+ var Dialog = ({
689
+ children,
690
+ className,
691
+ isOpen = false,
692
+ onClose,
693
+ title,
694
+ hideCloseButton = false,
695
+ ...props
696
+ }) => {
697
+ const root = useRef3(null);
698
+ const close = useCallback4(() => {
699
+ onClose == null ? void 0 : onClose();
700
+ }, [onClose]);
701
+ if (!isOpen) {
702
+ return null;
703
+ }
704
+ return /* @__PURE__ */ jsx11(Portal, { children: /* @__PURE__ */ jsx11(Scrim, { className: `${classBase6}-scrim`, open: isOpen, autoFocusRef: root, children: /* @__PURE__ */ jsxs8("div", { ...props, className: cx6(classBase6, className), ref: root, children: [
705
+ /* @__PURE__ */ jsx11(
706
+ DialogHeader,
707
+ {
708
+ hideCloseButton,
709
+ onClose: close,
710
+ title
711
+ }
712
+ ),
713
+ /* @__PURE__ */ jsx11("div", { className: `${classBase6}-body`, children })
714
+ ] }) }) });
715
+ };
716
+
717
+ // ../vuu-popups/src/dialog/useDialog.tsx
718
+ import { useCallback as useCallback5, useState as useState5 } from "react";
719
+ import { jsx as jsx12 } from "react/jsx-runtime";
720
+ var useDialog = () => {
721
+ const [dialogState, setDialogState] = useState5();
722
+ const handleClose = useCallback5(() => {
723
+ setDialogState(void 0);
724
+ }, []);
725
+ const dialog = dialogState ? /* @__PURE__ */ jsx12(
726
+ Dialog,
727
+ {
728
+ className: "vuDialog",
729
+ isOpen: true,
730
+ onClose: handleClose,
731
+ style: { maxHeight: 500 },
732
+ title: dialogState.title,
733
+ hideCloseButton: dialogState.hideCloseButton,
734
+ children: dialogState.content
735
+ }
736
+ ) : null;
737
+ return {
738
+ dialog,
739
+ setDialogState
740
+ };
741
+ };
742
+
743
+ // ../vuu-popups/src/menu/ContextMenu.tsx
744
+ import { useCallback as useCallback9, useRef as useRef7 } from "react";
745
+
746
+ // ../vuu-popups/src/menu/MenuList.tsx
747
+ import React5, {
748
+ useLayoutEffect as useLayoutEffect2,
749
+ useMemo as useMemo4,
750
+ useRef as useRef5
751
+ } from "react";
752
+ import cx7 from "classnames";
753
+ import { useId } from "@vuu-ui/vuu-layout";
754
+
755
+ // ../vuu-popups/src/menu/use-keyboard-navigation.ts
756
+ import {
757
+ useCallback as useCallback6,
758
+ useMemo as useMemo2,
759
+ useRef as useRef4,
760
+ useState as useState6
761
+ } from "react";
762
+
763
+ // ../vuu-popups/src/menu/utils.ts
764
+ var isRoot = (el) => el.closest(`[data-root='true']`) !== null;
765
+ var hasPopup = (el, idx) => {
766
+ var _a;
767
+ return el.ariaHasPopup === "true" && ((_a = el.dataset) == null ? void 0 : _a.idx) === `${idx}` || el.querySelector(`:scope > [data-index='${idx}'][aria-haspopup='true']`) !== null;
768
+ };
769
+
770
+ // ../vuu-popups/src/menu/key-code.ts
771
+ function union(set1, ...sets) {
772
+ const result = new Set(set1);
773
+ for (const set of sets) {
774
+ for (const element of set) {
775
+ result.add(element);
776
+ }
777
+ }
778
+ return result;
779
+ }
780
+ var Enter = "Enter";
781
+ var Delete = "Delete";
782
+ var actionKeys = /* @__PURE__ */ new Set([Enter, Delete]);
783
+ var focusKeys = /* @__PURE__ */ new Set(["Tab"]);
784
+ var arrowLeftRightKeys = /* @__PURE__ */ new Set(["ArrowRight", "ArrowLeft"]);
785
+ var verticalNavigationKeys = /* @__PURE__ */ new Set(["Home", "End", "ArrowDown", "ArrowUp"]);
786
+ var horizontalNavigationKeys = /* @__PURE__ */ new Set([
787
+ "Home",
788
+ "End",
789
+ "ArrowRight",
790
+ "ArrowLeft"
791
+ ]);
792
+ var functionKeys = /* @__PURE__ */ new Set([
793
+ "F1",
794
+ "F2",
795
+ "F3",
796
+ "F4",
797
+ "F5",
798
+ "F6",
799
+ "F7",
800
+ "F8",
801
+ "F9",
802
+ "F10",
803
+ "F11",
804
+ "F12"
805
+ ]);
806
+ var specialKeys = union(
807
+ actionKeys,
808
+ horizontalNavigationKeys,
809
+ verticalNavigationKeys,
810
+ arrowLeftRightKeys,
811
+ functionKeys,
812
+ focusKeys
813
+ );
814
+ var isNavigationKey = ({ key }, orientation = "vertical") => {
815
+ const navigationKeys = orientation === "vertical" ? verticalNavigationKeys : horizontalNavigationKeys;
816
+ return navigationKeys.has(key);
817
+ };
818
+
819
+ // ../vuu-popups/src/menu/use-keyboard-navigation.ts
820
+ import { isValidNumber } from "@vuu-ui/vuu-utils";
821
+ var useKeyboardNavigation = ({
822
+ autoHighlightFirstItem = false,
823
+ count,
824
+ defaultHighlightedIdx,
825
+ highlightedIndex: highlightedIndexProp,
826
+ onActivate,
827
+ onHighlight,
828
+ // onKeyDown,
829
+ onCloseMenu,
830
+ onOpenMenu
831
+ }) => {
832
+ var _a;
833
+ if (isValidNumber(highlightedIndexProp) && isValidNumber(defaultHighlightedIdx)) {
834
+ throw Error(
835
+ "useKeyboardNavigation do not pass values for both highlightedIndex and defaultHighlightedIdx"
836
+ );
837
+ }
838
+ const controlledHighlighting = isValidNumber(highlightedIndexProp);
839
+ const highlightedIndexRef = useRef4(
840
+ (_a = defaultHighlightedIdx != null ? defaultHighlightedIdx : highlightedIndexProp) != null ? _a : autoHighlightFirstItem ? 0 : -1
841
+ );
842
+ const [, forceRender] = useState6(null);
843
+ const setHighlightedIdx = useCallback6(
844
+ (idx) => {
845
+ highlightedIndexRef.current = idx;
846
+ onHighlight == null ? void 0 : onHighlight(idx);
847
+ forceRender({});
848
+ },
849
+ [onHighlight]
850
+ );
851
+ const setHighlightedIndex = useCallback6(
852
+ (idx) => {
853
+ if (idx !== highlightedIndexRef.current) {
854
+ if (!controlledHighlighting) {
855
+ setHighlightedIdx(idx);
856
+ }
857
+ }
858
+ },
859
+ [controlledHighlighting, setHighlightedIdx]
860
+ );
861
+ const keyBoardNavigation = useRef4(true);
862
+ const ignoreFocus = useRef4(false);
863
+ const setIgnoreFocus = (value) => ignoreFocus.current = value;
864
+ const highlightedIndex = controlledHighlighting ? highlightedIndexProp : highlightedIndexRef.current;
865
+ const navigateChildldItems = useCallback6(
866
+ (e) => {
867
+ const nextIdx = nextItemIdx(count, e.key, highlightedIndexRef.current);
868
+ if (nextIdx !== highlightedIndexRef.current) {
869
+ setHighlightedIndex(nextIdx);
870
+ }
871
+ },
872
+ [count, setHighlightedIndex]
873
+ );
874
+ const handleKeyDown = useCallback6(
875
+ (e) => {
876
+ if (isNavigationKey(e)) {
877
+ e.preventDefault();
878
+ e.stopPropagation();
879
+ keyBoardNavigation.current = true;
880
+ navigateChildldItems(e);
881
+ } else if ((e.key === "ArrowRight" || e.key === "Enter") && hasPopup(e.target, highlightedIndex)) {
882
+ const menuEl = e.target;
883
+ const menuItemEl = menuEl.querySelector(
884
+ `:scope > [data-index='${highlightedIndex}']`
885
+ );
886
+ if (menuItemEl) {
887
+ onOpenMenu == null ? void 0 : onOpenMenu(menuItemEl, true);
888
+ }
889
+ } else if (e.key === "ArrowLeft" && !isRoot(e.target)) {
890
+ onCloseMenu(highlightedIndex);
891
+ } else if (e.key === "Enter") {
892
+ e.preventDefault();
893
+ e.stopPropagation();
894
+ onActivate && onActivate(highlightedIndex);
895
+ } else if (e.key === "Tab") {
896
+ onCloseMenu(-1);
897
+ }
898
+ },
899
+ [
900
+ highlightedIndex,
901
+ navigateChildldItems,
902
+ onActivate,
903
+ onCloseMenu,
904
+ onOpenMenu
905
+ ]
906
+ );
907
+ const listProps = useMemo2(
908
+ () => ({
909
+ onFocus: () => {
910
+ if (highlightedIndex === -1) {
911
+ setHighlightedIdx(0);
912
+ }
913
+ },
914
+ onKeyDown: handleKeyDown,
915
+ onMouseDownCapture: () => {
916
+ keyBoardNavigation.current = false;
917
+ setIgnoreFocus(true);
918
+ },
919
+ // onMouseEnter would seem less expensive but it misses some cases
920
+ onMouseMove: () => {
921
+ if (keyBoardNavigation.current) {
922
+ keyBoardNavigation.current = false;
923
+ }
924
+ },
925
+ onMouseLeave: () => {
926
+ keyBoardNavigation.current = true;
927
+ setIgnoreFocus(false);
928
+ setHighlightedIndex(-1);
929
+ }
930
+ }),
931
+ [handleKeyDown, highlightedIndex, setHighlightedIdx, setHighlightedIndex]
932
+ );
933
+ return {
934
+ focusVisible: keyBoardNavigation.current ? highlightedIndex : -1,
935
+ controlledHighlighting,
936
+ highlightedIndex,
937
+ setHighlightedIndex,
938
+ // keyBoardNavigation,
939
+ listProps,
940
+ setIgnoreFocus
941
+ };
942
+ };
943
+ function nextItemIdx(count, key, idx) {
944
+ if (key === "ArrowUp") {
945
+ if (idx > 0) {
946
+ return idx - 1;
947
+ } else {
948
+ return idx;
949
+ }
950
+ } else {
951
+ if (idx === null) {
952
+ return 0;
953
+ } else if (idx === count - 1) {
954
+ return idx;
955
+ } else {
956
+ return idx + 1;
957
+ }
958
+ }
959
+ }
960
+
961
+ // ../vuu-popups/src/menu/use-items-with-ids-next.ts
962
+ import React4, { useCallback as useCallback7, useMemo as useMemo3 } from "react";
963
+ var isMenuItemGroup = (child) => child.type === MenuItemGroup || !!child.props["data-group"];
964
+ var getLabelFromChildren = (children) => {
965
+ if (Array.isArray(children) && isMenuItemLabel(children[0])) {
966
+ return children[0];
967
+ }
968
+ };
969
+ var assignId = (child, path, group, hasSeparator = false) => {
970
+ const {
971
+ props: { children }
972
+ } = child;
973
+ return {
974
+ childWithId: React4.cloneElement(child, {
975
+ hasSeparator,
976
+ id: `${path}`,
977
+ key: path,
978
+ children: group ? getLabelFromChildren(children) : children
979
+ }),
980
+ grandChildren: group ? children : void 0
981
+ };
982
+ };
983
+ var useItemsWithIdsNext = (childrenProp, rootId) => {
984
+ const normalizeChildren = useCallback7(() => {
985
+ const collectChildren = (children, path = rootId, menus2 = {}, actions2 = {}) => {
986
+ const list = menus2[path] = [];
987
+ let idx = 0;
988
+ let hasSeparator = false;
989
+ React4.Children.forEach(children, (child) => {
990
+ if (isMenuItemLabel(child)) {
991
+ } else if (child.type === Separator) {
992
+ hasSeparator = true;
993
+ } else {
994
+ const hasChildItems = isMenuItemGroup(child);
995
+ const childPath = `${path}-${idx}`;
996
+ const {
997
+ props: { action, options }
998
+ } = child;
999
+ const { childWithId, grandChildren } = assignId(
1000
+ child,
1001
+ childPath,
1002
+ hasChildItems,
1003
+ hasSeparator
1004
+ );
1005
+ list.push(childWithId);
1006
+ if (grandChildren) {
1007
+ collectChildren(grandChildren, childPath, menus2, actions2);
1008
+ } else {
1009
+ actions2[childPath] = { action, options };
1010
+ }
1011
+ idx += 1;
1012
+ hasSeparator = false;
1013
+ }
1014
+ });
1015
+ return [menus2, actions2];
1016
+ };
1017
+ return collectChildren(childrenProp);
1018
+ }, [rootId, childrenProp]);
1019
+ const [menus, actions] = useMemo3(
1020
+ () => normalizeChildren(),
1021
+ [normalizeChildren]
1022
+ );
1023
+ return [menus, actions];
1024
+ };
1025
+
1026
+ // ../vuu-popups/src/menu/MenuList.tsx
1027
+ import { Fragment as Fragment3, jsx as jsx13 } from "react/jsx-runtime";
1028
+ var classBase7 = "vuuMenuList";
1029
+ var Separator = () => /* @__PURE__ */ jsx13("li", { className: "vuuMenuItem-divider" });
1030
+ var MenuItemGroup = () => null;
1031
+ var MenuItem = ({
1032
+ children,
1033
+ idx,
1034
+ options,
1035
+ ...props
1036
+ }) => {
1037
+ return /* @__PURE__ */ jsx13("div", { ...props, children });
1038
+ };
1039
+ var MenuItemLabel = ({ children }) => /* @__PURE__ */ jsx13(Fragment3, { children });
1040
+ MenuItemLabel.displayName = "MenuItemLabel";
1041
+ MenuItem.Label = MenuItemLabel;
1042
+ var getDisplayName = (item) => React5.isValidElement(item) && typeof item.type !== "string" && "displayName" in item.type ? item.type.displayName : void 0;
1043
+ var isMenuItemLabel = (item) => getDisplayName(item) === "MenuItemLabel";
1044
+ var hasIcon = (child) => child.props["data-icon"];
1045
+ var MenuList = ({
1046
+ activatedByKeyboard,
1047
+ childMenuShowing,
1048
+ children,
1049
+ className,
1050
+ defaultHighlightedIdx,
1051
+ highlightedIdx: highlightedIdxProp,
1052
+ id: idProp,
1053
+ isRoot: isRoot2,
1054
+ listItemProps,
1055
+ onHighlightMenuItem,
1056
+ onActivate,
1057
+ onCloseMenu,
1058
+ openMenu: onOpenMenu,
1059
+ ...props
1060
+ }) => {
1061
+ const id = useId(idProp);
1062
+ const root = useRef5(null);
1063
+ const mapIdxToId = useMemo4(() => /* @__PURE__ */ new Map(), []);
1064
+ const handleActivate = (idx) => {
1065
+ var _a;
1066
+ const el = (_a = root.current) == null ? void 0 : _a.querySelector(`:scope > [data-index='${idx}']`);
1067
+ (el == null ? void 0 : el.id) && (onActivate == null ? void 0 : onActivate(el.id));
1068
+ };
1069
+ const { focusVisible, highlightedIndex, listProps } = useKeyboardNavigation({
1070
+ count: React5.Children.count(children),
1071
+ defaultHighlightedIdx,
1072
+ highlightedIndex: highlightedIdxProp,
1073
+ onActivate: handleActivate,
1074
+ onHighlight: onHighlightMenuItem,
1075
+ onOpenMenu,
1076
+ onCloseMenu
1077
+ });
1078
+ const appliedFocusVisible = childMenuShowing == void 0 ? focusVisible : -1;
1079
+ useLayoutEffect2(() => {
1080
+ var _a;
1081
+ if (childMenuShowing === void 0 && activatedByKeyboard) {
1082
+ (_a = root.current) == null ? void 0 : _a.focus();
1083
+ }
1084
+ }, [activatedByKeyboard, childMenuShowing]);
1085
+ const getActiveDescendant = () => highlightedIndex === void 0 || highlightedIndex === -1 ? void 0 : mapIdxToId.get(highlightedIndex);
1086
+ function renderContent() {
1087
+ const propsCommonToAllListItems = {
1088
+ ...listItemProps,
1089
+ role: "menuitem"
1090
+ };
1091
+ const maybeIcon = (childElement, withIcon, iconName) => withIcon ? [
1092
+ /* @__PURE__ */ jsx13(
1093
+ "span",
1094
+ {
1095
+ className: "vuuIconContainer",
1096
+ "data-icon": iconName
1097
+ },
1098
+ "icon"
1099
+ )
1100
+ ].concat(childElement) : childElement;
1101
+ function addClonedChild(list, child, idx, withIcon) {
1102
+ var _a;
1103
+ const {
1104
+ children: children2,
1105
+ className: className2,
1106
+ "data-icon": iconName,
1107
+ id: itemId,
1108
+ hasSeparator,
1109
+ label,
1110
+ ...props2
1111
+ } = child.props;
1112
+ const hasSubMenu = isMenuItemGroup(child);
1113
+ const subMenuShowing = hasSubMenu && childMenuShowing === itemId;
1114
+ const ariaControls = subMenuShowing ? `${id}-${itemId}` : void 0;
1115
+ list.push(
1116
+ /* @__PURE__ */ jsx13(
1117
+ MenuItem,
1118
+ {
1119
+ ...props2,
1120
+ ...propsCommonToAllListItems,
1121
+ ...getMenuItemProps(
1122
+ itemId,
1123
+ idx,
1124
+ (_a = child.key) != null ? _a : itemId,
1125
+ highlightedIndex,
1126
+ appliedFocusVisible,
1127
+ className2,
1128
+ hasSeparator
1129
+ ),
1130
+ "aria-controls": ariaControls,
1131
+ "aria-haspopup": hasSubMenu || void 0,
1132
+ "aria-expanded": subMenuShowing || void 0,
1133
+ children: hasSubMenu ? maybeIcon(label != null ? label : children2, withIcon, iconName) : maybeIcon(children2, withIcon, iconName)
1134
+ }
1135
+ )
1136
+ );
1137
+ }
1138
+ const listItems = [];
1139
+ if (children.length > 0) {
1140
+ const withIcon = children.some(hasIcon);
1141
+ children.forEach((child, idx) => {
1142
+ addClonedChild(listItems, child, idx, withIcon);
1143
+ });
1144
+ }
1145
+ return listItems;
1146
+ }
1147
+ return /* @__PURE__ */ jsx13(
1148
+ "div",
1149
+ {
1150
+ ...props,
1151
+ ...listProps,
1152
+ "aria-activedescendant": getActiveDescendant(),
1153
+ className: cx7(classBase7, className, {
1154
+ [`${classBase7}-childMenuShowing`]: childMenuShowing !== void 0
1155
+ }),
1156
+ "data-root": isRoot2 || void 0,
1157
+ id,
1158
+ ref: root,
1159
+ role: "menu",
1160
+ children: renderContent()
1161
+ }
1162
+ );
1163
+ };
1164
+ var getMenuItemProps = (itemId, idx, key, highlightedIdx, focusVisible, className, hasSeparator) => ({
1165
+ id: `menuitem-${itemId}`,
1166
+ key: key != null ? key : idx,
1167
+ "data-index": idx,
1168
+ "data-highlighted": idx === highlightedIdx || void 0,
1169
+ className: cx7("vuuMenuItem", className, {
1170
+ "vuuMenuItem-separator": hasSeparator,
1171
+ focusVisible: focusVisible === idx
1172
+ })
1173
+ });
1174
+ MenuList.displayName = "MenuList";
1175
+
1176
+ // ../vuu-popups/src/menu/use-cascade.ts
1177
+ import {
1178
+ useCallback as useCallback8,
1179
+ useMemo as useMemo5,
1180
+ useRef as useRef6,
1181
+ useState as useState7
1182
+ } from "react";
1183
+
1184
+ // ../vuu-popups/src/menu/list-dom-utils.ts
1185
+ var closestListItem = (el) => el == null ? void 0 : el.closest("[data-index],[aria-posinset]");
1186
+
1187
+ // ../vuu-popups/src/menu/use-cascade.ts
1188
+ var nudge = (menus, distance, pos) => {
1189
+ return menus.map(
1190
+ (m, i) => i === menus.length - 1 ? {
1191
+ ...m,
1192
+ [pos]: m[pos] - distance
1193
+ } : m
1194
+ );
1195
+ };
1196
+ var nudgeLeft = (menus, distance) => nudge(menus, distance, "left");
1197
+ var nudgeUp = (menus, distance) => nudge(menus, distance, "top");
1198
+ var flipSides = (id, menus) => {
1199
+ const [parentMenu, menu] = menus.slice(-2);
1200
+ const el = document.getElementById(`${id}-${menu.id}`);
1201
+ if (el === null) {
1202
+ throw Error(`useCascade.flipSides element with id ${menu.id} not found`);
1203
+ }
1204
+ const { width } = el.getBoundingClientRect();
1205
+ return menus.map(
1206
+ (m) => m === menu ? {
1207
+ ...m,
1208
+ left: parentMenu.left - (width - 2)
1209
+ } : m
1210
+ );
1211
+ };
1212
+ var getPosition = (el, openMenus) => {
1213
+ const [{ left, top: menuTop }] = openMenus.slice(-1);
1214
+ const { offsetWidth: width, offsetTop: top } = el;
1215
+ return { left: left + width, top: top + menuTop };
1216
+ };
1217
+ var getHostMenuId = (id, rootId) => {
1218
+ const pos = id.lastIndexOf("-");
1219
+ if (id.startsWith("menuitem")) {
1220
+ return pos > -1 ? id.slice(9, pos) : rootId;
1221
+ } else {
1222
+ return pos > -1 ? id.slice(0, pos) : rootId;
1223
+ }
1224
+ };
1225
+ var getTargetMenuId = (id) => id.slice(9);
1226
+ var getMenuItemDetails = ({ ariaExpanded, ariaHasPopup, id }, rootId) => {
1227
+ if (id.startsWith("menuitem")) {
1228
+ return {
1229
+ hostMenuId: getHostMenuId(id, rootId),
1230
+ targetMenuId: getTargetMenuId(id),
1231
+ menuItemId: id,
1232
+ isGroup: ariaHasPopup === "true",
1233
+ isOpen: ariaExpanded === "true"
1234
+ };
1235
+ } else {
1236
+ throw Error(`getMenuItemDetails #${id} is not a menuitem`);
1237
+ }
1238
+ };
1239
+ var useCascade = ({
1240
+ id: rootId,
1241
+ onActivate,
1242
+ onMouseEnterItem,
1243
+ position: { x: posX, y: posY }
1244
+ }) => {
1245
+ const [, forceRefresh] = useState7({});
1246
+ const openMenus = useRef6([
1247
+ { id: rootId, left: posX, top: posY }
1248
+ ]);
1249
+ const menuIsOpen = useCallback8(
1250
+ (menuId) => openMenus.current.findIndex((menu) => menu.id === menuId) !== -1,
1251
+ []
1252
+ );
1253
+ const getOpenMenuStatus = useCallback8((menuId) => {
1254
+ const state = menuState.current[menuId];
1255
+ if (state === void 0) {
1256
+ throw Error(`getOpenMenuState no entry for menu ${menuId}`);
1257
+ }
1258
+ return state;
1259
+ }, []);
1260
+ const setOpenMenus = useCallback8((menus) => {
1261
+ openMenus.current = menus;
1262
+ forceRefresh({});
1263
+ }, []);
1264
+ const menuOpenPendingTimeout = useRef6();
1265
+ const menuClosePendingTimeout = useRef6();
1266
+ const menuState = useRef6({ [rootId]: "no-popup" });
1267
+ const openMenu = useCallback8(
1268
+ (hostMenuId = rootId, targetMenuId, itemId = null) => {
1269
+ if (hostMenuId === rootId && itemId === null) {
1270
+ setOpenMenus([{ id: rootId, left: posX, top: posY }]);
1271
+ } else {
1272
+ menuState.current[hostMenuId] = "popup-open";
1273
+ const el = document.getElementById(itemId);
1274
+ if (el !== null) {
1275
+ const { left, top } = getPosition(el, openMenus.current);
1276
+ setOpenMenus(
1277
+ openMenus.current.concat({ id: targetMenuId, left, top })
1278
+ );
1279
+ } else {
1280
+ throw Error(`openMenu no menuItem ${itemId}`);
1281
+ }
1282
+ }
1283
+ },
1284
+ [rootId, posX, posY, setOpenMenus]
1285
+ );
1286
+ const closeMenu = useCallback8(
1287
+ (menuId) => {
1288
+ if (menuId === rootId) {
1289
+ setOpenMenus([]);
1290
+ } else {
1291
+ const menus = openMenus.current.slice();
1292
+ const lastMenu = menus.pop();
1293
+ menuState.current[lastMenu.id] = "no-popup";
1294
+ const parentMenu = menus.at(-1);
1295
+ if (parentMenu) {
1296
+ menuState.current[parentMenu.id] = "no-popup";
1297
+ }
1298
+ setOpenMenus(menus);
1299
+ }
1300
+ },
1301
+ [rootId, setOpenMenus]
1302
+ );
1303
+ const closeMenus = useCallback8(
1304
+ (menuItemId) => {
1305
+ const menus = openMenus.current.slice();
1306
+ const menuItemMenuId = menuItemId.slice(9);
1307
+ let { id: lastMenuId } = menus.at(-1);
1308
+ while (menus.length > 1 && !menuItemMenuId.startsWith(lastMenuId)) {
1309
+ const parentMenuId = getHostMenuId(lastMenuId, rootId);
1310
+ menus.pop();
1311
+ menuState.current[lastMenuId] = "no-popup";
1312
+ menuState.current[parentMenuId] = "no-popup";
1313
+ ({ id: lastMenuId } = menus[menus.length - 1]);
1314
+ }
1315
+ if (menus.length < openMenus.current.length) {
1316
+ setOpenMenus(menus);
1317
+ }
1318
+ },
1319
+ [rootId, setOpenMenus]
1320
+ );
1321
+ const clearAnyScheduledOpenTasks = useCallback8(() => {
1322
+ if (menuOpenPendingTimeout.current) {
1323
+ clearTimeout(menuOpenPendingTimeout.current);
1324
+ menuOpenPendingTimeout.current = void 0;
1325
+ }
1326
+ }, []);
1327
+ const scheduleOpen = useCallback8(
1328
+ (hostMenuId, targetMenuId, menuItemId, delay = 300) => {
1329
+ clearAnyScheduledOpenTasks();
1330
+ menuOpenPendingTimeout.current = window.setTimeout(() => {
1331
+ closeMenus(menuItemId);
1332
+ menuState.current[hostMenuId] = "popup-open";
1333
+ menuState.current[targetMenuId] = "no-popup";
1334
+ openMenu(hostMenuId, targetMenuId, menuItemId);
1335
+ }, delay);
1336
+ },
1337
+ [clearAnyScheduledOpenTasks, closeMenus, openMenu]
1338
+ );
1339
+ const scheduleClose = useCallback8(
1340
+ (hostMenuId, openMenuId, itemId) => {
1341
+ menuState.current[openMenuId] = "pending-close";
1342
+ menuClosePendingTimeout.current = window.setTimeout(() => {
1343
+ closeMenus(itemId);
1344
+ }, 400);
1345
+ },
1346
+ [closeMenus]
1347
+ );
1348
+ const handleRender = useCallback8(() => {
1349
+ const { current: menus } = openMenus;
1350
+ const menu = menus.at(-1);
1351
+ const el = menu ? document.getElementById(menu.id) : void 0;
1352
+ if (el) {
1353
+ const { right, bottom } = el.getBoundingClientRect();
1354
+ const { clientHeight, clientWidth } = document.body;
1355
+ if (right > clientWidth) {
1356
+ const newMenus = menus.length > 1 ? flipSides(rootId, menus) : nudgeLeft(menus, right - clientWidth);
1357
+ setOpenMenus(newMenus);
1358
+ } else if (bottom > clientHeight) {
1359
+ const newMenus = nudgeUp(menus, bottom - clientHeight);
1360
+ setOpenMenus(newMenus);
1361
+ }
1362
+ if (typeof el.tabIndex === "number") {
1363
+ el.focus();
1364
+ }
1365
+ }
1366
+ }, [rootId, setOpenMenus]);
1367
+ const triggerChildMenu = useCallback8(
1368
+ (menuItemEl, immediate = false) => {
1369
+ const { hostMenuId, targetMenuId, menuItemId, isGroup, isOpen } = getMenuItemDetails(menuItemEl, rootId);
1370
+ const {
1371
+ current: { [hostMenuId]: state }
1372
+ } = menuState;
1373
+ const delay = immediate ? 0 : void 0;
1374
+ if (state === "no-popup" && isGroup) {
1375
+ menuState.current[hostMenuId] = "popup-pending";
1376
+ scheduleOpen(hostMenuId, targetMenuId, menuItemId, delay);
1377
+ } else if (state === "popup-pending" && !isGroup) {
1378
+ menuState.current[hostMenuId] = "no-popup";
1379
+ clearTimeout(menuOpenPendingTimeout.current);
1380
+ menuOpenPendingTimeout.current = void 0;
1381
+ } else if (state === "popup-pending" && isGroup) {
1382
+ clearTimeout(menuOpenPendingTimeout.current);
1383
+ scheduleOpen(hostMenuId, targetMenuId, menuItemId, delay);
1384
+ } else if (state === "popup-open") {
1385
+ if (menuIsOpen(targetMenuId)) {
1386
+ const menuStatus = getOpenMenuStatus(targetMenuId);
1387
+ closeMenus(menuItemId);
1388
+ switch (menuStatus) {
1389
+ case "pending-close":
1390
+ clearTimeout(menuClosePendingTimeout.current);
1391
+ menuClosePendingTimeout.current = void 0;
1392
+ menuState.current[targetMenuId] = "no-popup";
1393
+ clearAnyScheduledOpenTasks();
1394
+ break;
1395
+ default:
1396
+ }
1397
+ } else {
1398
+ const [parentOfLastOpenedMenu, lastOpenedMenu] = openMenus.current.slice(-2);
1399
+ if (parentOfLastOpenedMenu.id === hostMenuId && menuState.current[lastOpenedMenu.id] !== "pending-close") {
1400
+ scheduleClose(hostMenuId, lastOpenedMenu.id, menuItemId);
1401
+ if (isGroup && !isOpen) {
1402
+ scheduleOpen(hostMenuId, targetMenuId, menuItemId, delay);
1403
+ }
1404
+ } else if (parentOfLastOpenedMenu.id === hostMenuId && isGroup && menuItemId !== lastOpenedMenu.id && menuState.current[lastOpenedMenu.id] === "pending-close") {
1405
+ scheduleOpen(hostMenuId, targetMenuId, menuItemId, delay);
1406
+ } else if (isGroup) {
1407
+ scheduleOpen(hostMenuId, targetMenuId, menuItemId, delay);
1408
+ } else if (!(menuState.current[lastOpenedMenu.id] === "pending-close")) {
1409
+ closeMenus(menuItemId);
1410
+ }
1411
+ }
1412
+ }
1413
+ if (state === "pending-close") {
1414
+ clearAnyScheduledOpenTasks();
1415
+ clearTimeout(menuClosePendingTimeout.current);
1416
+ menuClosePendingTimeout.current = void 0;
1417
+ menuState.current[hostMenuId] = "popup-open";
1418
+ }
1419
+ },
1420
+ [
1421
+ clearAnyScheduledOpenTasks,
1422
+ closeMenus,
1423
+ getOpenMenuStatus,
1424
+ menuIsOpen,
1425
+ rootId,
1426
+ scheduleClose,
1427
+ scheduleOpen
1428
+ ]
1429
+ );
1430
+ const listItemProps = useMemo5(
1431
+ () => ({
1432
+ onMouseEnter: (evt) => {
1433
+ const menuItemEl = closestListItem(evt.target);
1434
+ triggerChildMenu(menuItemEl);
1435
+ onMouseEnterItem(evt, menuItemEl.id);
1436
+ },
1437
+ onClick: (evt) => {
1438
+ const listItemEl = closestListItem(evt.target);
1439
+ const { isGroup, menuItemId } = getMenuItemDetails(listItemEl, rootId);
1440
+ if (isGroup) {
1441
+ triggerChildMenu(listItemEl);
1442
+ } else {
1443
+ onActivate(menuItemId);
1444
+ }
1445
+ }
1446
+ }),
1447
+ [onActivate, onMouseEnterItem, rootId, triggerChildMenu]
1448
+ );
1449
+ return {
1450
+ closeMenu,
1451
+ handleRender,
1452
+ listItemProps,
1453
+ openMenu: triggerChildMenu,
1454
+ openMenus: openMenus.current
1455
+ };
1456
+ };
1457
+
1458
+ // ../vuu-popups/src/menu/ContextMenu.tsx
1459
+ import { useId as useId2 } from "@vuu-ui/vuu-layout";
1460
+ import { Fragment as Fragment4, jsx as jsx14 } from "react/jsx-runtime";
1461
+ import { createElement } from "react";
1462
+ var noop = () => void 0;
1463
+ var ContextMenu = ({
1464
+ PortalProps: PortalProps2,
1465
+ activatedByKeyboard,
1466
+ children: childrenProp,
1467
+ className,
1468
+ id: idProp,
1469
+ onClose = () => void 0,
1470
+ position = { x: 0, y: 0 },
1471
+ style,
1472
+ ...menuListProps
1473
+ }) => {
1474
+ const closeHandlerRef = useRef7(onClose);
1475
+ closeHandlerRef.current = onClose;
1476
+ const id = useId2(idProp);
1477
+ const closeMenuRef = useRef7(noop);
1478
+ const [menus, actions] = useItemsWithIdsNext(childrenProp, id);
1479
+ const navigatingWithKeyboard = useRef7(activatedByKeyboard);
1480
+ const handleMouseEnterItem = useCallback9(() => {
1481
+ navigatingWithKeyboard.current = false;
1482
+ }, []);
1483
+ const handleActivate = useCallback9(
1484
+ (menuItemId) => {
1485
+ const actionId = menuItemId.slice(9);
1486
+ const { action, options } = actions[actionId];
1487
+ closeMenuRef.current(id);
1488
+ onClose({
1489
+ type: "menu-action",
1490
+ menuId: action,
1491
+ options
1492
+ });
1493
+ },
1494
+ [actions, id, onClose]
1495
+ );
1496
+ const {
1497
+ closeMenu,
1498
+ listItemProps,
1499
+ openMenu: onOpenMenu,
1500
+ openMenus,
1501
+ handleRender
1502
+ } = useCascade({
1503
+ // FIXME
1504
+ id: `${id}`,
1505
+ onActivate: handleActivate,
1506
+ onMouseEnterItem: handleMouseEnterItem,
1507
+ position
1508
+ });
1509
+ closeMenuRef.current = closeMenu;
1510
+ const handleCloseMenu = () => {
1511
+ navigatingWithKeyboard.current = true;
1512
+ closeMenu();
1513
+ };
1514
+ const handleHighlightMenuItem = () => {
1515
+ };
1516
+ const lastMenu = openMenus.length - 1;
1517
+ const getChildMenuId = (i) => {
1518
+ if (i >= lastMenu) {
1519
+ return void 0;
1520
+ } else {
1521
+ const { id: id2 } = openMenus[i + 1];
1522
+ return id2;
1523
+ }
1524
+ };
1525
+ return /* @__PURE__ */ jsx14(Fragment4, { children: openMenus.map(({ id: menuId, left, top }, i, all) => {
1526
+ const childMenuId = getChildMenuId(i);
1527
+ return /* @__PURE__ */ createElement(Portal, { ...PortalProps2, key: i, onRender: handleRender }, /* @__PURE__ */ jsx14(
1528
+ PopupComponent,
1529
+ {
1530
+ anchorElement: { current: document.body },
1531
+ placement: "absolute",
1532
+ position: { left, top },
1533
+ children: /* @__PURE__ */ createElement(
1534
+ MenuList,
1535
+ {
1536
+ ...menuListProps,
1537
+ activatedByKeyboard: navigatingWithKeyboard.current,
1538
+ childMenuShowing: childMenuId,
1539
+ className,
1540
+ id: menuId,
1541
+ isRoot: i === 0,
1542
+ key: i,
1543
+ listItemProps,
1544
+ onActivate: handleActivate,
1545
+ onHighlightMenuItem: handleHighlightMenuItem,
1546
+ onCloseMenu: handleCloseMenu,
1547
+ openMenu: onOpenMenu,
1548
+ style,
1549
+ tabIndex: i === all.length - 1 ? 0 : void 0
1550
+ },
1551
+ menus[menuId]
1552
+ )
1553
+ }
1554
+ ));
1555
+ }) });
1556
+ };
1557
+ ContextMenu.displayName = "ContextMenu";
1558
+
1559
+ // ../vuu-popups/src/menu/context-menu-provider.tsx
1560
+ import { createContext, useCallback as useCallback10, useMemo as useMemo6 } from "react";
1561
+ import { jsx as jsx15 } from "react/jsx-runtime";
1562
+ var ContextMenuContext = createContext(
1563
+ null
1564
+ );
1565
+ var Provider = ({
1566
+ children,
1567
+ context,
1568
+ menuActionHandler,
1569
+ menuBuilder
1570
+ }) => {
1571
+ const menuBuilders = useMemo6(() => {
1572
+ if ((context == null ? void 0 : context.menuBuilders) && menuBuilder) {
1573
+ return context.menuBuilders.concat(menuBuilder);
1574
+ } else if (menuBuilder) {
1575
+ return [menuBuilder];
1576
+ } else {
1577
+ return (context == null ? void 0 : context.menuBuilders) || [];
1578
+ }
1579
+ }, [context, menuBuilder]);
1580
+ const handleMenuAction = useCallback10(
1581
+ (reason) => {
1582
+ var _a;
1583
+ if (menuActionHandler == null ? void 0 : menuActionHandler(reason)) {
1584
+ return true;
1585
+ }
1586
+ if ((_a = context == null ? void 0 : context.menuActionHandler) == null ? void 0 : _a.call(context, reason)) {
1587
+ return true;
1588
+ }
1589
+ },
1590
+ [context, menuActionHandler]
1591
+ );
1592
+ return /* @__PURE__ */ jsx15(
1593
+ ContextMenuContext.Provider,
1594
+ {
1595
+ value: {
1596
+ menuActionHandler: handleMenuAction,
1597
+ menuBuilders
1598
+ },
1599
+ children
1600
+ }
1601
+ );
1602
+ };
1603
+ var ContextMenuProvider = ({
1604
+ children,
1605
+ label,
1606
+ menuActionHandler,
1607
+ menuBuilder
1608
+ }) => {
1609
+ return /* @__PURE__ */ jsx15(ContextMenuContext.Consumer, { children: (parentContext) => /* @__PURE__ */ jsx15(
1610
+ Provider,
1611
+ {
1612
+ context: parentContext,
1613
+ label,
1614
+ menuActionHandler,
1615
+ menuBuilder,
1616
+ children
1617
+ }
1618
+ ) });
1619
+ };
1620
+
1621
+ // ../vuu-popups/src/menu/useContextMenu.tsx
1622
+ import { isGroupMenuItemDescriptor } from "@vuu-ui/vuu-utils";
1623
+ import { cloneElement, useCallback as useCallback12, useContext, useMemo as useMemo7 } from "react";
1624
+
1625
+ // ../vuu-popups/src/popup/popup-service.ts
1626
+ import cx9 from "classnames";
1627
+ import React6, {
1628
+ createElement as createElement2
1629
+ } from "react";
1630
+ import ReactDOM2 from "react-dom";
1631
+
1632
+ // ../vuu-popups/src/portal-deprecated/render-portal.tsx
1633
+ import * as ReactDOM from "react-dom";
1634
+ import cx8 from "classnames";
1635
+
1636
+ // ../vuu-popups/src/popup/Popup.tsx
1637
+ import cx10 from "classnames";
1638
+
1639
+ // ../vuu-popups/src/popup/useAnchoredPosition.ts
1640
+ import { useCallback as useCallback11, useLayoutEffect as useLayoutEffect3, useRef as useRef8, useState as useState8 } from "react";
1641
+ var getPositionRelativeToAnchor = (anchorElement, placement, offsetLeft, offsetTop, minWidth, dimensions) => {
1642
+ const { bottom, height, left, right, top, width } = anchorElement.getBoundingClientRect();
1643
+ switch (placement) {
1644
+ case "below":
1645
+ return { left: left + offsetLeft, top: bottom + offsetTop };
1646
+ case "right":
1647
+ return { left: right + offsetLeft, top: top + offsetTop };
1648
+ case "below-center":
1649
+ return { left: left + width / 2 + offsetLeft, top: bottom + offsetTop };
1650
+ case "below-right":
1651
+ return { left, minWidth, top: bottom + offsetTop };
1652
+ case "below-full-width":
1653
+ return {
1654
+ left: left + offsetLeft,
1655
+ minWidth,
1656
+ top: bottom + offsetTop,
1657
+ width
1658
+ };
1659
+ case "center":
1660
+ if (dimensions) {
1661
+ return {
1662
+ left: width / 2 - dimensions.width / 2 + offsetLeft,
1663
+ top: height / 2 - dimensions.height / 2 + offsetTop,
1664
+ visibility: "visible"
1665
+ };
1666
+ } else {
1667
+ return {
1668
+ left: width / 2 + offsetLeft,
1669
+ top: height / 2 + offsetTop,
1670
+ visibility: "hidden"
1671
+ };
1672
+ }
1673
+ default:
1674
+ throw Error(
1675
+ "Popup getPositionRelativeToAnchor only supported placement values are below and right"
1676
+ );
1677
+ }
1678
+ };
1679
+ var useAnchoredPosition = ({
1680
+ anchorElement,
1681
+ minWidth,
1682
+ offsetLeft = 0,
1683
+ offsetTop = 0,
1684
+ placement,
1685
+ position: positionProp
1686
+ }) => {
1687
+ const popupRef = useRef8(null);
1688
+ const [position, setPosition] = useState8(positionProp);
1689
+ useLayoutEffect3(() => {
1690
+ if (placement === "absolute" && positionProp) {
1691
+ setPosition(positionProp);
1692
+ } else if (anchorElement.current) {
1693
+ const dimensions = popupRef.current === null ? void 0 : popupRef.current.getBoundingClientRect();
1694
+ const position2 = getPositionRelativeToAnchor(
1695
+ anchorElement.current,
1696
+ placement,
1697
+ offsetLeft,
1698
+ offsetTop,
1699
+ minWidth,
1700
+ dimensions
1701
+ );
1702
+ setPosition(position2);
1703
+ }
1704
+ }, [anchorElement, minWidth, offsetLeft, offsetTop, placement, positionProp]);
1705
+ const popupCallbackRef = useCallback11(
1706
+ (el) => {
1707
+ popupRef.current = el;
1708
+ if (el && placement === "center" && anchorElement.current) {
1709
+ const { height, width } = el.getBoundingClientRect();
1710
+ setPosition(
1711
+ getPositionRelativeToAnchor(
1712
+ anchorElement.current,
1713
+ placement,
1714
+ offsetLeft,
1715
+ offsetTop,
1716
+ void 0,
1717
+ { height, width }
1718
+ )
1719
+ );
1720
+ }
1721
+ },
1722
+ [anchorElement, offsetLeft, offsetTop, placement]
1723
+ );
1724
+ return {
1725
+ position,
1726
+ popupRef: placement === "center" ? popupCallbackRef : void 0
1727
+ };
1728
+ };
1729
+
1730
+ // ../vuu-popups/src/popup/Popup.tsx
1731
+ import { jsx as jsx16 } from "react/jsx-runtime";
1732
+ var PopupComponent = ({
1733
+ children,
1734
+ className,
1735
+ anchorElement,
1736
+ minWidth,
1737
+ placement,
1738
+ position: positionProp
1739
+ }) => {
1740
+ const { popupRef, position } = useAnchoredPosition({
1741
+ anchorElement,
1742
+ minWidth,
1743
+ placement,
1744
+ position: positionProp
1745
+ });
1746
+ return position === void 0 ? null : /* @__PURE__ */ jsx16("div", { className: cx10(`vuuPortal`, className), ref: popupRef, style: position, children });
1747
+ };
1748
+
1749
+ // ../vuu-popups/src/menu/useContextMenu.tsx
1750
+ import { jsx as jsx17 } from "react/jsx-runtime";
1751
+
1752
+ // ../vuu-popups/src/popup-menu/PopupMenu.tsx
1753
+ import {
1754
+ useCallback as useCallback13,
1755
+ useRef as useRef9,
1756
+ useState as useState9
1757
+ } from "react";
1758
+ import cx11 from "classnames";
1759
+ import { Button as Button5 } from "@salt-ds/core";
1760
+ import { useId as useId3 } from "@vuu-ui/vuu-layout";
1761
+ import { jsx as jsx18 } from "react/jsx-runtime";
1762
+
1763
+ // ../vuu-popups/src/prompt/Prompt.tsx
1764
+ import { Button as Button6 } from "@salt-ds/core";
1765
+ import cx12 from "classnames";
1766
+ import { useLayoutEffect as useLayoutEffect4, useRef as useRef10 } from "react";
1767
+ import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
1768
+ var AnchorBody = { current: document.body };
1769
+
1770
+ // ../vuu-popups/src/tooltip/useAnchoredPosition.ts
1771
+ import { useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
1772
+
1773
+ // ../vuu-popups/src/tooltip/Tooltip.tsx
1774
+ import cx13 from "classnames";
1775
+ import { jsx as jsx20 } from "react/jsx-runtime";
1776
+
1777
+ // ../vuu-popups/src/tooltip/useTooltip.ts
1778
+ import { useCallback as useCallback14, useRef as useRef11, useState as useState11 } from "react";
1779
+ import { useId as useId4 } from "@vuu-ui/vuu-layout";
1780
+
1781
+ // ../vuu-popups/src/notifications/NotificationsProvider.tsx
1782
+ import React7, { useState as useState12, useContext as useContext2, useCallback as useCallback15, useEffect as useEffect5 } from "react";
1783
+ import classNames from "classnames";
1784
+ import { getUniqueId } from "@vuu-ui/vuu-utils";
1785
+ import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
1786
+ var NotificationsContext = React7.createContext({
1787
+ notify: () => "have you forgotten to provide a NotificationProvider?"
1788
+ });
1789
+ var useNotifications = () => useContext2(NotificationsContext);
1790
+
1791
+ // src/layout-management/useLayoutManager.tsx
1792
+ import { jsx as jsx22 } from "react/jsx-runtime";
1793
+ var _persistenceManager;
1794
+ var getPersistenceManager = () => {
1795
+ if (_persistenceManager === void 0) {
1796
+ _persistenceManager = true ? new LocalLayoutPersistenceManager() : new RemoteLayoutPersistenceManager();
1797
+ }
1798
+ return _persistenceManager;
1799
+ };
1800
+ var LayoutManagementContext = React8.createContext({
1801
+ layoutMetadata: [],
1802
+ saveLayout: () => void 0,
1803
+ // The default Application JSON will be served if no LayoutManagementProvider
1804
+ applicationJson: defaultApplicationJson,
1805
+ saveApplicationLayout: () => void 0,
1806
+ saveApplicationSettings: () => void 0,
1807
+ loadLayoutById: () => void 0
1808
+ });
1809
+ var ensureLayoutHasTitle = (layout, layoutMetadata) => {
1810
+ var _a;
1811
+ if (((_a = layout.props) == null ? void 0 : _a.title) !== void 0) {
1812
+ return layout;
1813
+ } else {
1814
+ return {
1815
+ ...layout,
1816
+ props: {
1817
+ ...layout.props,
1818
+ title: layoutMetadata.name
1819
+ }
1820
+ };
1821
+ }
1822
+ };
1823
+ var LayoutManagementProvider = (props) => {
1824
+ const [layoutMetadata, setLayoutMetadata] = useState13([]);
1825
+ const [, forceRefresh] = useState13({});
1826
+ const { notify } = useNotifications();
1827
+ const applicationJSONRef = useRef12(loadingApplicationJson);
1828
+ const setApplicationJSON = useCallback16(
1829
+ (applicationJSON, rerender = true) => {
1830
+ applicationJSONRef.current = applicationJSON;
1831
+ if (rerender) {
1832
+ forceRefresh({});
1833
+ }
1834
+ },
1835
+ []
1836
+ );
1837
+ const setApplicationLayout = useCallback16(
1838
+ (layout, rerender = true) => {
1839
+ setApplicationJSON(
1840
+ {
1841
+ ...applicationJSONRef.current,
1842
+ layout
1843
+ },
1844
+ rerender
1845
+ );
1846
+ },
1847
+ [setApplicationJSON]
1848
+ );
1849
+ const setApplicationSettings = useCallback16(
1850
+ (settings) => {
1851
+ setApplicationJSON(
1852
+ {
1853
+ ...applicationJSONRef.current,
1854
+ settings: {
1855
+ ...applicationJSONRef.current.settings,
1856
+ ...settings
1857
+ }
1858
+ },
1859
+ false
1860
+ );
1861
+ },
1862
+ [setApplicationJSON]
1863
+ );
1864
+ useEffect6(() => {
1865
+ const persistenceManager = getPersistenceManager();
1866
+ persistenceManager.loadMetadata().then((metadata) => {
1867
+ setLayoutMetadata(metadata);
1868
+ }).catch((error2) => {
1869
+ notify({
1870
+ type: "error" /* Error */,
1871
+ header: "Failed to Load Layouts",
1872
+ body: "Could not load list of available layouts"
1873
+ });
1874
+ console.error("Error occurred while retrieving metadata", error2);
1875
+ });
1876
+ persistenceManager.loadApplicationJSON().then((applicationJSON) => {
1877
+ setApplicationJSON(applicationJSON);
1878
+ }).catch((error2) => {
1879
+ notify({
1880
+ type: "error" /* Error */,
1881
+ header: "Failed to Load Layout",
1882
+ body: "Could not load your latest view"
1883
+ });
1884
+ console.error(
1885
+ "Error occurred while retrieving application layout",
1886
+ error2
1887
+ );
1888
+ });
1889
+ }, [notify, setApplicationJSON]);
1890
+ const saveApplicationLayout = useCallback16(
1891
+ (layout) => {
1892
+ setApplicationLayout(layout, false);
1893
+ getPersistenceManager().saveApplicationJSON(applicationJSONRef.current);
1894
+ },
1895
+ [setApplicationLayout]
1896
+ );
1897
+ const saveLayout = useCallback16(
1898
+ (metadata) => {
1899
+ const layoutToSave = resolveJSONPath(
1900
+ applicationJSONRef.current.layout,
1901
+ "#main-tabs.ACTIVE_CHILD"
1902
+ );
1903
+ if (layoutToSave) {
1904
+ getPersistenceManager().createLayout(metadata, ensureLayoutHasTitle(layoutToSave, metadata)).then((metadata2) => {
1905
+ notify({
1906
+ type: "success" /* Success */,
1907
+ header: "Layout Saved Successfully",
1908
+ body: `${metadata2.name} saved successfully`
1909
+ });
1910
+ setLayoutMetadata((prev) => [...prev, metadata2]);
1911
+ }).catch((error2) => {
1912
+ notify({
1913
+ type: "error" /* Error */,
1914
+ header: "Failed to Save Layout",
1915
+ body: `Failed to save layout ${metadata.name}`
1916
+ });
1917
+ console.error("Error occurred while saving layout", error2);
1918
+ });
1919
+ } else {
1920
+ notify({
1921
+ type: "error" /* Error */,
1922
+ header: "Failed to Save Layout",
1923
+ body: "Cannot save undefined layout"
1924
+ });
1925
+ }
1926
+ },
1927
+ [notify]
1928
+ );
1929
+ const saveApplicationSettings = useCallback16(
1930
+ (settings) => {
1931
+ setApplicationSettings(settings);
1932
+ getPersistenceManager().saveApplicationJSON(applicationJSONRef.current);
1933
+ },
1934
+ [setApplicationSettings]
1935
+ );
1936
+ const loadLayoutById = useCallback16(
1937
+ (id) => {
1938
+ getPersistenceManager().loadLayout(id).then((layoutJson) => {
1939
+ var _a, _b;
1940
+ const { layout: currentLayout } = applicationJSONRef.current;
1941
+ setApplicationLayout({
1942
+ ...currentLayout,
1943
+ children: (currentLayout.children || []).concat(layoutJson),
1944
+ props: {
1945
+ ...currentLayout.props,
1946
+ active: (_b = (_a = currentLayout.children) == null ? void 0 : _a.length) != null ? _b : 0
1947
+ }
1948
+ });
1949
+ }).catch((error2) => {
1950
+ notify({
1951
+ type: "error" /* Error */,
1952
+ header: "Failed to Load Layout",
1953
+ body: "Failed to load the requested layout"
1954
+ });
1955
+ console.error("Error occurred while loading layout", error2);
1956
+ });
1957
+ },
1958
+ [notify, setApplicationLayout]
1959
+ );
1960
+ return /* @__PURE__ */ jsx22(
1961
+ LayoutManagementContext.Provider,
1962
+ {
1963
+ value: {
1964
+ layoutMetadata,
1965
+ saveLayout,
1966
+ applicationJson: applicationJSONRef.current,
1967
+ saveApplicationLayout,
1968
+ saveApplicationSettings,
1969
+ loadLayoutById
1970
+ },
1971
+ children: props.children
1972
+ }
1973
+ );
1974
+ };
1975
+ var useLayoutManager = () => useContext3(LayoutManagementContext);
1976
+
1977
+ // src/layout-management/LayoutList.tsx
1978
+ import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
1979
+ var classBase8 = "vuuLayoutList";
1980
+ var LayoutsList = (props) => {
1981
+ const { layoutMetadata, loadLayoutById } = useLayoutManager();
1982
+ const handleLoadLayout = (layoutId) => {
1983
+ if (layoutId) {
1984
+ loadLayoutById(layoutId);
1985
+ }
1986
+ };
1987
+ const layoutsByGroup = layoutMetadata.reduce((acc, cur) => {
1988
+ if (acc[cur.group]) {
1989
+ return {
1990
+ ...acc,
1991
+ [cur.group]: [...acc[cur.group], cur]
1992
+ };
1993
+ }
1994
+ return {
1995
+ ...acc,
1996
+ [cur.group]: [cur]
1997
+ };
1998
+ }, {});
1999
+ return /* @__PURE__ */ jsxs11("div", { className: classBase8, ...props, children: [
2000
+ /* @__PURE__ */ jsx23("div", { className: `${classBase8}-header`, children: "My Layouts" }),
2001
+ /* @__PURE__ */ jsx23(
2002
+ List,
2003
+ {
2004
+ height: "auto",
2005
+ source: Object.entries(layoutsByGroup),
2006
+ ListItem: ({ item }) => {
2007
+ if (!item)
2008
+ return /* @__PURE__ */ jsx23(Fragment5, {});
2009
+ const [groupName, layoutMetadata2] = item;
2010
+ return /* @__PURE__ */ jsxs11(Fragment5, { children: [
2011
+ /* @__PURE__ */ jsx23("div", { className: `${classBase8}-groupName`, children: groupName }),
2012
+ layoutMetadata2.map((metadata) => /* @__PURE__ */ jsxs11(
2013
+ "div",
2014
+ {
2015
+ className: `${classBase8}-layoutContainer`,
2016
+ onClick: () => handleLoadLayout(metadata == null ? void 0 : metadata.id),
2017
+ children: [
2018
+ /* @__PURE__ */ jsx23(
2019
+ "img",
2020
+ {
2021
+ className: `${classBase8}-screenshot`,
2022
+ src: metadata == null ? void 0 : metadata.screenshot
2023
+ }
2024
+ ),
2025
+ /* @__PURE__ */ jsxs11("div", { children: [
2026
+ /* @__PURE__ */ jsx23("div", { className: `${classBase8}-layoutName`, children: metadata == null ? void 0 : metadata.name }),
2027
+ /* @__PURE__ */ jsx23("div", { className: `${classBase8}-layoutDetails`, children: /* @__PURE__ */ jsx23("div", { children: `${metadata == null ? void 0 : metadata.user}, ${metadata == null ? void 0 : metadata.created}` }) })
2028
+ ] })
2029
+ ]
2030
+ },
2031
+ metadata == null ? void 0 : metadata.id
2032
+ ))
2033
+ ] });
2034
+ }
2035
+ }
2036
+ )
2037
+ ] });
2038
+ };
2039
+
2040
+ // src/left-nav/LeftNav.tsx
2041
+ import { VuuLogo as VuuLogo2 } from "@vuu-ui/vuu-icons";
2042
+ import { Stack, useLayoutProviderDispatch } from "@vuu-ui/vuu-layout";
2043
+ import { Tab, Tabstrip } from "@vuu-ui/vuu-ui-controls";
2044
+ import cx15 from "classnames";
2045
+ import { useCallback as useCallback17, useState as useState14 } from "react";
2046
+
2047
+ // src/feature-list/FeatureList.tsx
2048
+ import { Palette, PaletteItem } from "@vuu-ui/vuu-layout";
2049
+ import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
2050
+ var classBase9 = "vuuFeatureList";
2051
+ var FeatureList = ({
2052
+ features,
2053
+ title = "VUU TABLES",
2054
+ ...htmlAttributes
2055
+ }) => {
2056
+ const ViewProps2 = {};
2057
+ const listProps = {
2058
+ height: "100%"
2059
+ };
2060
+ return /* @__PURE__ */ jsxs12("div", { ...htmlAttributes, className: classBase9, children: [
2061
+ /* @__PURE__ */ jsx24("div", { className: `${classBase9}-header`, children: title }),
2062
+ /* @__PURE__ */ jsx24("div", { className: `${classBase9}-content`, children: /* @__PURE__ */ jsx24(
2063
+ Palette,
2064
+ {
2065
+ orientation: "vertical",
2066
+ ListProps: listProps,
2067
+ ViewProps: ViewProps2,
2068
+ children: features.map((featureProps, i) => /* @__PURE__ */ jsx24(
2069
+ PaletteItem,
2070
+ {
2071
+ closeable: true,
2072
+ label: featureProps.title,
2073
+ resizeable: true,
2074
+ resize: "defer",
2075
+ header: true,
2076
+ children: /* @__PURE__ */ jsx24(Feature, { ...featureProps })
2077
+ },
2078
+ i
2079
+ ))
2080
+ }
2081
+ ) })
2082
+ ] });
2083
+ };
2084
+
2085
+ // src/theme-provider/ThemeProvider.tsx
2086
+ import {
2087
+ createContext as createContext2,
2088
+ isValidElement,
2089
+ cloneElement as cloneElement2,
2090
+ useContext as useContext4
2091
+ } from "react";
2092
+ import cx14 from "classnames";
2093
+ import { jsx as jsx25 } from "react/jsx-runtime";
2094
+ var DEFAULT_DENSITY2 = "medium";
2095
+ var DEFAULT_THEME = "salt-theme";
2096
+ var DEFAULT_THEME_MODE = "light";
2097
+ var ThemeContext = createContext2({
2098
+ density: "high",
2099
+ theme: "vuu",
2100
+ themeMode: "light"
2101
+ });
2102
+ var DEFAULT_THEME_ATTRIBUTES = [
2103
+ "vuu",
2104
+ "vuu-density-high",
2105
+ "light"
2106
+ ];
2107
+ var useThemeAttributes = (themeAttributes) => {
2108
+ const context = useContext4(ThemeContext);
2109
+ if (themeAttributes) {
2110
+ return [
2111
+ themeAttributes.themeClass,
2112
+ themeAttributes.densityClass,
2113
+ themeAttributes.dataMode
2114
+ ];
2115
+ } else if (context) {
2116
+ return [
2117
+ `${context.theme}-theme`,
2118
+ `${context.theme}-density-${context.density}`,
2119
+ context.themeMode
2120
+ ];
2121
+ }
2122
+ return DEFAULT_THEME_ATTRIBUTES;
2123
+ };
2124
+ var createThemedChildren = (children, theme, themeMode, density) => {
2125
+ var _a;
2126
+ if (isValidElement(children)) {
2127
+ return cloneElement2(children, {
2128
+ className: cx14(
2129
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2130
+ (_a = children.props) == null ? void 0 : _a.className,
2131
+ `${theme}-theme`,
2132
+ `${theme}-density-${density}`
2133
+ ),
2134
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2135
+ // @ts-expect-error
2136
+ "data-mode": themeMode
2137
+ });
2138
+ } else {
2139
+ console.warn(
2140
+ `
2
2141
  ThemeProvider can only apply CSS classes for theming to a single nested child element of the ThemeProvider.
3
- Wrap elements with a single container`),e)},ze=({applyThemeClasses:e=!1,children:t,theme:o,themeMode:n,density:s})=>{var h,d,g;let{density:r,themeMode:a,theme:l}=eo(_e),i=(h=s!=null?s:r)!=null?h:Jr,c=(d=n!=null?n:a)!=null?d:zr,f=(g=o!=null?o:l)!=null?g:_r,M=e?qr(t,f,c,i):t;return Zr(_e.Provider,{value:{themeMode:c,density:i,theme:f},children:M})};ze.displayName="ThemeProvider";import{jsx as I,jsxs as be}from"react/jsx-runtime";var Q="vuuLeftNav",ts=(e,t)=>e===0?t?"menu-full":"menu-icons":t?"menu-full-content":"menu-icons-content",cm=e=>{let t=Qr(),[o]=G(),{"data-path":n,defaultExpanded:s=!0,defaultActiveTabIndex:r=0,features:a,onActiveChange:l,onTogglePrimaryMenu:i,sizeCollapsed:c=80,sizeContent:f=300,sizeExpanded:M=240,style:h,tableFeatures:d,...g}=e,[p,m]=es({activeTabIndex:r,expanded:s}),P=qe((y,v)=>y===0?v?M:c:v?M+f:c+f,[c,f,M]),S=qe(y=>{let{activeTabIndex:v,expanded:C}=p;if(m({activeTabIndex:y,expanded:C}),y===0||v===0){let b=P(y,C);t({type:"layout-resize",path:"#vuu-side-panel",size:b})}l==null||l(y)},[t,P,p,l]),w=ts(p.activeTabIndex,p.expanded),N=qe(()=>{let{activeTabIndex:y,expanded:v}=p,C=!v;m({activeTabIndex:y,expanded:C}),t({type:"layout-resize",path:"#vuu-side-panel",size:P(y,C)}),i==null||i(C)},[t,P,p,i]),L={...h,"--nav-menu-collapsed-width":`${c}px`,"--nav-menu-expanded-width":`${M}px`,"--nav-menu-content-width":`${f}px`};return be("div",{...g,className:We(Q,`${Q}-${w}`),style:L,children:[be("div",{className:We(`${Q}-menu-primary`,o),"data-mode":"dark",children:[I("div",{className:"vuuLeftNav-logo",children:I(Xr,{})}),I("div",{className:`${Q}-main`,children:be(jr,{activeTabIndex:p.activeTabIndex,animateSelectionThumb:!1,className:`${Q}-Tabstrip`,onActiveChange:S,orientation:"vertical",children:[I(Me,{"data-icon":"demo",label:"DEMO"}),I(Me,{"data-icon":"features",label:"VUU FEATURES"}),I(Me,{"data-icon":"tables",label:"VUU TABLES"}),I(Me,{"data-icon":"layouts",label:"MY LAYOUTS"})]})}),I("div",{className:"vuuLeftNav-buttonBar",children:I("button",{className:We("vuuLeftNav-toggleButton",{"vuuLeftNav-toggleButton-open":w.startsWith("menu-full"),"vuuLeftNav-toggleButton-closed":w.startsWith("menu-icons")}),"data-icon":w.startsWith("menu-full")?"chevron-left":"chevron-right",onClick:N})})]}),be(Yr,{active:p.activeTabIndex-1,className:`${Q}-menu-secondary`,showTabs:!1,children:[I(Je,{features:a,title:"VUU FEATURES"}),I(Je,{features:d,title:"VUU TABLES"}),I("div",{className:"vuuLeftNav-drawer",children:I(jt,{})})]})]})};import{useCallback as j,useEffect as to,useMemo as os,useRef as Ze,useState as oo}from"react";import no from"classnames";import{useIdMemo as ns}from"@salt-ds/core";import{Button as ro}from"@salt-ds/core";import{hasAction as rs,isErrorResponse as ss,RemoteDataSource as is}from"@vuu-ui/vuu-data";import{buildColumnMap as as,isValidNumber as so,shallowEquals as us}from"@vuu-ui/vuu-utils";import{jsx as q,jsxs as Xe}from"react/jsx-runtime";var O="vuuSessionEditingForm",io=(e,t)=>{let o=e.find(n=>n.name===t);if(o)return o;throw Error(`SessionEditingForm, no field '${t}' found`)},ao=e=>{let{dataset:{field:t},value:o}=e.target;if(t===void 0)throw Error("SessionEditingForm, form field has no field name");return[t,o]},U={uninitialised:0,unchanged:1,changed:2,invalid:3};function uo(e,t,o=!1){switch(t){case"int":case"long":{let n=parseInt(e,10);if(so(n))return n;if(o)throw Error("SessionEditingForm getTypedValue");return}case"double":{let n=parseFloat(e);return so(n)?n:void 0}case"boolean":return e==="true";default:return e}}var ls=(e,t)=>{if(e)return e;if(t)return new is({bufferSize:0,table:t.table,columns:t.columns.map(o=>o.name)});throw Error("SessionEditingForm: either a DataSource or a TableSchema must be provided")},Nm=({className:e,config:{fields:t,key:o},dataSource:n,id:s,onClose:r,schema:a,...l})=>{let[i,c]=oo(),[f,M]=oo(""),h=Ze(null),d=Ze(),g=Ze(U.uninitialised),p=os(()=>{let u=E=>{if(T){let x={};for(let R of p.columns)x[R]=E[T[R]];g.current===U.uninitialised&&(g.current=U.unchanged,d.current=x),c(x)}},b=ls(n,a),T=as(b.columns);return b.subscribe({range:{from:0,to:5}},E=>{E.type==="viewport-update"&&E.rows&&(g.current===U.uninitialised?u(E.rows[0]):console.log("what do we do with server updates"))}),b},[n,a]),m=ns(s),P=j(u=>{let[b,T]=ao(u),{type:E}=io(t,b),x=uo(T,E);c((R={})=>{let k={...R,[b]:x},B=us(k,d.current);return g.current=B?U.unchanged:x!==void 0?U.changed:U.invalid,k})},[t]),S=j(u=>{let[b,T]=ao(u),{type:E}=io(t,b),x=i==null?void 0:i[o],R=uo(T,E,!0);typeof x=="string"&&p.menuRpcCall({rowKey:x,field:b,value:R,type:"VP_EDIT_CELL_RPC"})},[p,t,o,i]),w=j(u=>{typeof u=="object"&&u!==null&&"type"in u&&u.type==="CLOSE_DIALOG_ACTION"&&r()},[r]),N=j(async()=>{let u=await p.menuRpcCall({type:"VP_EDIT_SUBMIT_FORM_RPC"});ss(u)?M(u.error):rs(u)&&w(u.action)},[w,p]),L=j(u=>{u.key==="Enter"&&g.current===U.changed&&N()},[N]),y=j(()=>{r()},[r]),v=u=>{var T;let b=String((T=i==null?void 0:i[u.name])!=null?T:"");return u.readonly||u.name===o?q("div",{className:`${O}-fieldValue vuuReadOnly`,children:b}):q("input",{className:`${O}-fieldValue`,"data-field":u.name,onBlur:S,onChange:P,type:"text",value:b,id:`${m}-input-${u.name}`})};to(()=>{if(h.current){let u=h.current.querySelector("input");u&&setTimeout(()=>{u.focus(),u.select()},100)}},[]),to(()=>()=>{p&&p.unsubscribe()},[p]);let C=g.current===U.changed;return Xe("div",{...l,className:no(O,e),children:[f?q("div",{className:`${O}-errorBanner`,"data-icon":"error",title:f,children:"Error, edit(s) not saved"}):void 0,q("div",{className:`${O}-content`,ref:h,onKeyDown:L,children:t.map(u=>{var b;return Xe("div",{className:`${O}-field`,children:[q("label",{className:no(`${O}-fieldLabel`,{[`${O}-required`]:u.required}),htmlFor:`${m}-input-${u.name}`,children:(b=u==null?void 0:u.label)!=null?b:u.description}),v(u)]},u.name)})}),Xe("div",{className:`${O}-buttonbar salt-theme salt-density-high`,children:[q(ro,{type:"submit",variant:"cta",disabled:!C,onClick:N,children:"Submit"}),q(ro,{variant:"secondary",onClick:y,children:"Cancel"})]})]})};import{connectToServer as Ns}from"@vuu-ui/vuu-data";import{DraggableLayout as Rs,LayoutProvider as Hs,loadingApplicationJson as Ds,useLayoutContextMenuItems as As}from"@vuu-ui/vuu-layout";import{logger as Is}from"@vuu-ui/vuu-utils";import ks from"classnames";import{useCallback as Qe,useEffect as Fs,useRef as Mo}from"react";import{Button as cs}from"@salt-ds/core";import lo from"classnames";import{useCallback as ps,useMemo as ds}from"react";import{layoutFromJson as ms,View as fs,useLayoutProviderDispatch as hs}from"@vuu-ui/vuu-layout";import{jsx as xe,jsxs as co}from"react/jsx-runtime";var $="vuuContextPanel",po=({className:e,expanded:t=!1,content:o,overlay:n=!1,title:s})=>{let r=hs(),a=ps(()=>{r({path:"#context-panel",propName:"expanded",propValue:!1,type:"set-prop"})},[r]),l=lo($,e,{[`${$}-expanded`]:t,[`${$}-inline`]:n!==!0,[`${$}-overlay`]:n}),i=ds(()=>o&&t?ms(o,"context-0"):null,[o,t]);return xe("div",{className:lo($,l,{[`${$}-expanded`]:t}),children:co(fs,{className:`${$}-inner`,header:!1,id:"context-panel",children:[co("div",{className:`${$}-header`,children:[xe("h2",{className:`${$}-title`,children:s}),xe(cs,{className:`${$}-close`,"data-icon":"close",onClick:a,variant:"secondary"})]}),xe("div",{className:`${$}-content`,children:i})]})})};import{DraggableLayout as Ms,Flexbox as fo}from"@vuu-ui/vuu-layout";import{useMemo as gs}from"react";import ys from"classnames";import{jsx as Cs}from"react/jsx-runtime";var vs="vuuShellSidePanel",mo=({children:e,open:t=!0,sizeClosed:o=90,sizeOpen:n=200,style:s,...r})=>{let a=gs(()=>({...s,"--shell-left-nav-size":t?`${n}px`:`${o}px`}),[t,o,n,s]);return Cs("div",{...r,className:ys(vs),style:a,children:e})};import{jsx as Ye,jsxs as ho}from"react/jsx-runtime";var go=({appHeader:e,LeftSidePanelProps:t})=>ho(fo,{className:"App",style:{flexDirection:"row",height:"100%",width:"100%"},children:[Ye(mo,{...t,id:"vuu-side-panel"}),ho(fo,{className:"vuuShell-content",style:{flex:1,flexDirection:"column"},children:[e,Ye(Ms,{dropTarget:!0,style:{flex:1}},"main-content")]}),Ye(po,{id:"context-panel",overlay:!0})]});import{DockLayout as bs,DraggableLayout as xs,Drawer as Ls,Flexbox as Ps,View as Ts}from"@vuu-ui/vuu-layout";import{useCallback as yo,useRef as Es,useState as ws}from"react";import{jsx as Le,jsxs as Ss}from"react/jsx-runtime";var vo=({appHeader:e,LeftSidePanelProps:t})=>{let o=Es(null),[n,s]=ws(!0),r=yo(l=>{var c;let i=l.target;(c=o.current)!=null&&c.contains(i)||s(!n)},[n]),a=yo(l=>{let i=[];return i.push(Le(Ls,{onClick:r,open:n,position:"left",inline:!0,peekaboo:!0,sizeOpen:200,toggleButton:"end",children:Le(Ts,{className:"vuuShell-palette",id:"vw-app-palette",ref:o,style:{height:"100%"},children:l},"app-palette")},"left-panel")),i},[r,n]);return Ss(Ps,{className:"App",style:{flexDirection:"column",height:"100%",width:"100%"},children:[e,Le(bs,{style:{flex:1},children:a(t==null?void 0:t.children).concat(Le(xs,{dropTarget:!0,style:{width:"100%",height:"100%"}},"main-content"))})]})};var Co=({leftSidePanelLayout:e="inlay",...t})=>(e==="inlay"?vo:go)(t);import{jsx as Pe,jsxs as Bs}from"react/jsx-runtime";var{error:je}=Is("Shell"),$s={},Uf=({LayoutProps:e,LeftSidePanelProps:t=$s,children:o,className:n,leftSidePanelLayout:s,loginUrl:r,saveLocation:a="remote",saveUrl:l,serverUrl:i,user:c,...f})=>{let M=Mo(null),{dialog:h,setDialogState:d}=Pt(),g=Mo("latest"),{applicationJson:p,saveApplicationLayout:m,loadLayoutById:P}=ve(),{buildMenuOptions:S,handleMenuAction:w}=As(d),N=Qe((x,R)=>{try{m(x)}catch{je==null||je("Failed to save layout")}},[m]),L=Qe(x=>{M.current&&(M.current.dataset.mode=x)},[]),y=Qe(x=>{g.current=x,P(x)},[P]);Fs(()=>{i&&c.token&&Ns({authToken:c.token,url:i,username:c.username})},[i,c.token,c.username]);let[v,C,u]=G(),b=ks("vuuShell",n,v,C),T=p===Ds,E=Co({LeftSidePanelProps:t,leftSidePanelLayout:s,appHeader:Pe(dt,{layoutId:g.current,loginUrl:r,user:c,onNavigate:y,onSwitchTheme:L})});return T?null:Pe(ze,{children:Bs(Wt,{menuActionHandler:w,menuBuilder:S,children:[Pe(Hs,{...e,layout:p.layout,onLayoutChange:N,children:Pe(Rs,{className:b,"data-mode":u,ref:M,...f,children:E})}),o||h]})})};var Jf=e=>e==="*",_f=e=>typeof e=="object"&&typeof e.module=="string"&&typeof e.table=="string";import{createContext as Vs,useContext as Os}from"react";import{jsx as et}from"react/jsx-runtime";var Us={},tt=Vs(Us),Ks=({children:e,context:t,inheritedContext:o})=>{let n={...o,...t};return et(tt.Provider,{value:n,children:e})},Xf=({children:e,value:t})=>et(tt.Consumer,{children:o=>et(Ks,{context:t,inheritedContext:o,children:e})}),Yf=()=>Os(tt);import Gs from"classnames";import{ToggleButton as bo,ToggleButtonGroup as Js,useControlled as _s}from"@salt-ds/core";import{useCallback as zs}from"react";import{jsx as xo,jsxs as qs}from"react/jsx-runtime";var Ws="vuuThemeSwitch",u1=({className:e,defaultMode:t,mode:o,onChange:n,...s})=>{let[r,a]=_s({controlled:o,default:t!=null?t:"light",name:"ThemeSwitch",state:"mode"}),l=zs(c=>{let{value:f}=c.target;a(f),n(f)},[n,a]),i=Gs(Ws,e);return qs(Js,{className:i,...s,onChange:l,value:r,children:[xo(bo,{"aria-label":"alert","data-icon":"light",value:"dark"}),xo(bo,{"aria-label":"home","data-icon":"dark",value:"light"})]})};export{dt as AppHeader,ki as ConnectionStatusIcon,po as ContextPanel,Jr as DEFAULT_DENSITY,_r as DEFAULT_THEME,zr as DEFAULT_THEME_MODE,Ji as DensitySwitch,pe as Feature,Je as FeatureList,Yt as LayoutManagementContext,yd as LayoutManagementProvider,jt as LayoutsList,cm as LeftNav,ui as LoginPanel,ba as SaveLayoutPanel,Nm as SessionEditingForm,Uf as Shell,Xf as ShellContextProvider,mo as SidePanel,_e as ThemeContext,ze as ThemeProvider,u1 as ThemeSwitch,di as getAuthDetailsFromCookies,Do as getAuthModeFromCookies,_f as isTableSchema,Jf as isWildcardSchema,pt as logout,Io as redirectToLogin,ve as useLayoutManager,Yf as useShellContext,Co as useShellLayout,G as useThemeAttributes};
2142
+ Wrap elements with a single container`
2143
+ );
2144
+ return children;
2145
+ }
2146
+ };
2147
+ var ThemeProvider = ({
2148
+ applyThemeClasses = false,
2149
+ children,
2150
+ theme: themeProp,
2151
+ themeMode: themeModeProp,
2152
+ density: densityProp
2153
+ }) => {
2154
+ var _a, _b, _c;
2155
+ const {
2156
+ density: inheritedDensity,
2157
+ themeMode: inheritedThemeMode,
2158
+ theme: inheritedTheme
2159
+ } = useContext4(ThemeContext);
2160
+ const density = (_a = densityProp != null ? densityProp : inheritedDensity) != null ? _a : DEFAULT_DENSITY2;
2161
+ const themeMode = (_b = themeModeProp != null ? themeModeProp : inheritedThemeMode) != null ? _b : DEFAULT_THEME_MODE;
2162
+ const theme = (_c = themeProp != null ? themeProp : inheritedTheme) != null ? _c : DEFAULT_THEME;
2163
+ const themedChildren = applyThemeClasses ? createThemedChildren(children, theme, themeMode, density) : children;
2164
+ return /* @__PURE__ */ jsx25(ThemeContext.Provider, { value: { themeMode, density, theme }, children: themedChildren });
2165
+ };
2166
+ ThemeProvider.displayName = "ThemeProvider";
2167
+
2168
+ // src/left-nav/LeftNav.tsx
2169
+ import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
2170
+ var classBase10 = "vuuLeftNav";
2171
+ var getDisplayStatus = (activeTabIndex, expanded) => {
2172
+ if (activeTabIndex === 0) {
2173
+ return expanded ? "menu-full" : "menu-icons";
2174
+ } else {
2175
+ return expanded ? "menu-full-content" : "menu-icons-content";
2176
+ }
2177
+ };
2178
+ var LeftNav = (props) => {
2179
+ const dispatch = useLayoutProviderDispatch();
2180
+ const [themeClass] = useThemeAttributes();
2181
+ const {
2182
+ "data-path": path,
2183
+ defaultExpanded = true,
2184
+ defaultActiveTabIndex = 0,
2185
+ features,
2186
+ onActiveChange,
2187
+ onTogglePrimaryMenu,
2188
+ sizeCollapsed = 80,
2189
+ sizeContent = 300,
2190
+ sizeExpanded = 240,
2191
+ style: styleProp,
2192
+ tableFeatures,
2193
+ ...htmlAttributes
2194
+ } = props;
2195
+ const [navState, setNavState] = useState14({
2196
+ activeTabIndex: defaultActiveTabIndex,
2197
+ expanded: defaultExpanded
2198
+ });
2199
+ const getFullWidth = useCallback17(
2200
+ (tabIndex, expanded) => {
2201
+ if (tabIndex === 0) {
2202
+ return expanded ? sizeExpanded : sizeCollapsed;
2203
+ } else {
2204
+ return expanded ? sizeExpanded + sizeContent : sizeCollapsed + sizeContent;
2205
+ }
2206
+ },
2207
+ [sizeCollapsed, sizeContent, sizeExpanded]
2208
+ );
2209
+ const handleTabSelection = useCallback17(
2210
+ (activeTabIndex) => {
2211
+ const { activeTabIndex: currentIndex, expanded } = navState;
2212
+ const newState = { activeTabIndex, expanded };
2213
+ setNavState(newState);
2214
+ if (activeTabIndex === 0 || currentIndex === 0) {
2215
+ const width = getFullWidth(activeTabIndex, expanded);
2216
+ dispatch({
2217
+ type: "layout-resize",
2218
+ path: "#vuu-side-panel",
2219
+ size: width
2220
+ });
2221
+ }
2222
+ onActiveChange == null ? void 0 : onActiveChange(activeTabIndex);
2223
+ },
2224
+ [dispatch, getFullWidth, navState, onActiveChange]
2225
+ );
2226
+ const displayStatus = getDisplayStatus(
2227
+ navState.activeTabIndex,
2228
+ navState.expanded
2229
+ );
2230
+ const toggleExpanded = useCallback17(() => {
2231
+ const { activeTabIndex, expanded } = navState;
2232
+ const primaryMenuExpanded = !expanded;
2233
+ const newState = { activeTabIndex, expanded: primaryMenuExpanded };
2234
+ setNavState(newState);
2235
+ dispatch({
2236
+ type: "layout-resize",
2237
+ path: "#vuu-side-panel",
2238
+ size: getFullWidth(activeTabIndex, primaryMenuExpanded)
2239
+ });
2240
+ onTogglePrimaryMenu == null ? void 0 : onTogglePrimaryMenu(primaryMenuExpanded);
2241
+ }, [dispatch, getFullWidth, navState, onTogglePrimaryMenu]);
2242
+ const style = {
2243
+ ...styleProp,
2244
+ "--nav-menu-collapsed-width": `${sizeCollapsed}px`,
2245
+ "--nav-menu-expanded-width": `${sizeExpanded}px`,
2246
+ "--nav-menu-content-width": `${sizeContent}px`
2247
+ };
2248
+ return /* @__PURE__ */ jsxs13(
2249
+ "div",
2250
+ {
2251
+ ...htmlAttributes,
2252
+ className: cx15(classBase10, `${classBase10}-${displayStatus}`),
2253
+ style,
2254
+ children: [
2255
+ /* @__PURE__ */ jsxs13(
2256
+ "div",
2257
+ {
2258
+ className: cx15(`${classBase10}-menu-primary`, themeClass),
2259
+ "data-mode": "dark",
2260
+ children: [
2261
+ /* @__PURE__ */ jsx26("div", { className: "vuuLeftNav-logo", children: /* @__PURE__ */ jsx26(VuuLogo2, {}) }),
2262
+ /* @__PURE__ */ jsx26("div", { className: `${classBase10}-main`, children: /* @__PURE__ */ jsxs13(
2263
+ Tabstrip,
2264
+ {
2265
+ activeTabIndex: navState.activeTabIndex,
2266
+ animateSelectionThumb: false,
2267
+ className: `${classBase10}-Tabstrip`,
2268
+ onActiveChange: handleTabSelection,
2269
+ orientation: "vertical",
2270
+ children: [
2271
+ /* @__PURE__ */ jsx26(Tab, { "data-icon": "demo", label: "DEMO" }),
2272
+ /* @__PURE__ */ jsx26(Tab, { "data-icon": "features", label: "VUU FEATURES" }),
2273
+ /* @__PURE__ */ jsx26(Tab, { "data-icon": "tables", label: "VUU TABLES" }),
2274
+ /* @__PURE__ */ jsx26(Tab, { "data-icon": "layouts", label: "MY LAYOUTS" })
2275
+ ]
2276
+ }
2277
+ ) }),
2278
+ /* @__PURE__ */ jsx26("div", { className: "vuuLeftNav-buttonBar", children: /* @__PURE__ */ jsx26(
2279
+ "button",
2280
+ {
2281
+ className: cx15("vuuLeftNav-toggleButton", {
2282
+ "vuuLeftNav-toggleButton-open": displayStatus.startsWith("menu-full"),
2283
+ "vuuLeftNav-toggleButton-closed": displayStatus.startsWith("menu-icons")
2284
+ }),
2285
+ "data-icon": displayStatus.startsWith("menu-full") ? "chevron-left" : "chevron-right",
2286
+ onClick: toggleExpanded
2287
+ }
2288
+ ) })
2289
+ ]
2290
+ }
2291
+ ),
2292
+ /* @__PURE__ */ jsxs13(
2293
+ Stack,
2294
+ {
2295
+ active: navState.activeTabIndex - 1,
2296
+ className: `${classBase10}-menu-secondary`,
2297
+ showTabs: false,
2298
+ children: [
2299
+ /* @__PURE__ */ jsx26(FeatureList, { features, title: "VUU FEATURES" }),
2300
+ /* @__PURE__ */ jsx26(FeatureList, { features: tableFeatures, title: "VUU TABLES" }),
2301
+ /* @__PURE__ */ jsx26("div", { className: "vuuLeftNav-drawer", children: /* @__PURE__ */ jsx26(LayoutsList, {}) })
2302
+ ]
2303
+ }
2304
+ )
2305
+ ]
2306
+ }
2307
+ );
2308
+ };
2309
+
2310
+ // src/session-editing-form/SessionEditingForm.tsx
2311
+ import {
2312
+ useCallback as useCallback18,
2313
+ useEffect as useEffect7,
2314
+ useMemo as useMemo8,
2315
+ useRef as useRef13,
2316
+ useState as useState15
2317
+ } from "react";
2318
+ import cx16 from "classnames";
2319
+ import { useIdMemo } from "@salt-ds/core";
2320
+ import { Button as Button7 } from "@salt-ds/core";
2321
+ import {
2322
+ hasAction,
2323
+ isErrorResponse,
2324
+ RemoteDataSource
2325
+ } from "@vuu-ui/vuu-data";
2326
+ import {
2327
+ buildColumnMap,
2328
+ isValidNumber as isValidNumber2,
2329
+ shallowEquals
2330
+ } from "@vuu-ui/vuu-utils";
2331
+ import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
2332
+ var classBase11 = "vuuSessionEditingForm";
2333
+ var getField = (fields, name) => {
2334
+ const field = fields.find((f) => f.name === name);
2335
+ if (field) {
2336
+ return field;
2337
+ } else {
2338
+ throw Error(`SessionEditingForm, no field '${name}' found`);
2339
+ }
2340
+ };
2341
+ var getFieldNameAndValue = (evt) => {
2342
+ const {
2343
+ dataset: { field },
2344
+ value
2345
+ } = evt.target;
2346
+ if (field === void 0) {
2347
+ throw Error("SessionEditingForm, form field has no field name");
2348
+ }
2349
+ return [field, value];
2350
+ };
2351
+ var Status = {
2352
+ uninitialised: 0,
2353
+ unchanged: 1,
2354
+ changed: 2,
2355
+ invalid: 3
2356
+ };
2357
+ function getTypedValue(value, type, throwIfUndefined = false) {
2358
+ switch (type) {
2359
+ case "int":
2360
+ case "long": {
2361
+ const typedValue = parseInt(value, 10);
2362
+ if (isValidNumber2(typedValue)) {
2363
+ return typedValue;
2364
+ } else if (throwIfUndefined) {
2365
+ throw Error("SessionEditingForm getTypedValue");
2366
+ } else {
2367
+ return void 0;
2368
+ }
2369
+ }
2370
+ case "double": {
2371
+ const typedValue = parseFloat(value);
2372
+ if (isValidNumber2(typedValue)) {
2373
+ return typedValue;
2374
+ }
2375
+ return void 0;
2376
+ }
2377
+ case "boolean":
2378
+ return value === "true" ? true : false;
2379
+ default:
2380
+ return value;
2381
+ }
2382
+ }
2383
+ var getDataSource = (dataSource, schema) => {
2384
+ if (dataSource) {
2385
+ return dataSource;
2386
+ } else if (schema) {
2387
+ return new RemoteDataSource({
2388
+ bufferSize: 0,
2389
+ table: schema.table,
2390
+ columns: schema.columns.map((col) => col.name)
2391
+ });
2392
+ } else {
2393
+ throw Error(
2394
+ "SessionEditingForm: either a DataSource or a TableSchema must be provided"
2395
+ );
2396
+ }
2397
+ };
2398
+ var SessionEditingForm = ({
2399
+ className,
2400
+ config: { fields, key: keyField },
2401
+ dataSource: dataSourceProp,
2402
+ id: idProp,
2403
+ onClose,
2404
+ schema,
2405
+ ...htmlAttributes
2406
+ }) => {
2407
+ const [values, setValues] = useState15();
2408
+ const [errorMessage, setErrorMessage] = useState15("");
2409
+ const formContentRef = useRef13(null);
2410
+ const initialDataRef = useRef13();
2411
+ const dataStatusRef = useRef13(Status.uninitialised);
2412
+ const dataSource = useMemo8(() => {
2413
+ const applyServerData = (data) => {
2414
+ if (columnMap) {
2415
+ const values2 = {};
2416
+ for (const column of dataSource.columns) {
2417
+ values2[column] = data[columnMap[column]];
2418
+ }
2419
+ if (dataStatusRef.current === Status.uninitialised) {
2420
+ dataStatusRef.current = Status.unchanged;
2421
+ initialDataRef.current = values2;
2422
+ }
2423
+ setValues(values2);
2424
+ }
2425
+ };
2426
+ const ds = getDataSource(dataSourceProp, schema);
2427
+ const columnMap = buildColumnMap(ds.columns);
2428
+ ds.subscribe({ range: { from: 0, to: 5 } }, (message) => {
2429
+ if (message.type === "viewport-update" && message.rows) {
2430
+ if (dataStatusRef.current === Status.uninitialised) {
2431
+ applyServerData(message.rows[0]);
2432
+ } else {
2433
+ console.log("what do we do with server updates");
2434
+ }
2435
+ }
2436
+ });
2437
+ return ds;
2438
+ }, [dataSourceProp, schema]);
2439
+ const id = useIdMemo(idProp);
2440
+ const handleChange = useCallback18(
2441
+ (evt) => {
2442
+ const [field, value] = getFieldNameAndValue(evt);
2443
+ const { type } = getField(fields, field);
2444
+ const typedValue = getTypedValue(value, type);
2445
+ setValues((values2 = {}) => {
2446
+ const newValues = {
2447
+ ...values2,
2448
+ [field]: typedValue
2449
+ };
2450
+ const notUpdated = shallowEquals(newValues, initialDataRef.current);
2451
+ dataStatusRef.current = notUpdated ? Status.unchanged : typedValue !== void 0 ? Status.changed : Status.invalid;
2452
+ return newValues;
2453
+ });
2454
+ },
2455
+ [fields]
2456
+ );
2457
+ const handleBlur = useCallback18(
2458
+ (evt) => {
2459
+ const [field, value] = getFieldNameAndValue(evt);
2460
+ const { type } = getField(fields, field);
2461
+ const rowKey = values == null ? void 0 : values[keyField];
2462
+ const typedValue = getTypedValue(value, type, true);
2463
+ if (typeof rowKey === "string") {
2464
+ dataSource.menuRpcCall({
2465
+ rowKey,
2466
+ field,
2467
+ value: typedValue,
2468
+ type: "VP_EDIT_CELL_RPC"
2469
+ });
2470
+ }
2471
+ },
2472
+ [dataSource, fields, keyField, values]
2473
+ );
2474
+ const applyAction = useCallback18(
2475
+ (action) => {
2476
+ if (typeof action === "object" && action !== null) {
2477
+ if ("type" in action && action.type === "CLOSE_DIALOG_ACTION") {
2478
+ onClose();
2479
+ }
2480
+ }
2481
+ },
2482
+ [onClose]
2483
+ );
2484
+ const handleSubmit = useCallback18(async () => {
2485
+ const response = await dataSource.menuRpcCall({
2486
+ type: "VP_EDIT_SUBMIT_FORM_RPC"
2487
+ });
2488
+ if (isErrorResponse(response)) {
2489
+ setErrorMessage(response.error);
2490
+ } else if (hasAction(response)) {
2491
+ applyAction(response.action);
2492
+ }
2493
+ }, [applyAction, dataSource]);
2494
+ const handleKeyDown = useCallback18(
2495
+ (evt) => {
2496
+ if (evt.key === "Enter" && dataStatusRef.current === Status.changed) {
2497
+ handleSubmit();
2498
+ }
2499
+ },
2500
+ [handleSubmit]
2501
+ );
2502
+ const handleCancel = useCallback18(() => {
2503
+ onClose();
2504
+ }, [onClose]);
2505
+ const getFormControl = (field) => {
2506
+ var _a;
2507
+ const value = String((_a = values == null ? void 0 : values[field.name]) != null ? _a : "");
2508
+ if (field.readonly || field.name === keyField) {
2509
+ return /* @__PURE__ */ jsx27("div", { className: `${classBase11}-fieldValue vuuReadOnly`, children: value });
2510
+ } else {
2511
+ return /* @__PURE__ */ jsx27(
2512
+ "input",
2513
+ {
2514
+ className: `${classBase11}-fieldValue`,
2515
+ "data-field": field.name,
2516
+ onBlur: handleBlur,
2517
+ onChange: handleChange,
2518
+ type: "text",
2519
+ value,
2520
+ id: `${id}-input-${field.name}`
2521
+ }
2522
+ );
2523
+ }
2524
+ };
2525
+ useEffect7(() => {
2526
+ if (formContentRef.current) {
2527
+ const firstInput = formContentRef.current.querySelector(
2528
+ "input"
2529
+ );
2530
+ if (firstInput) {
2531
+ setTimeout(() => {
2532
+ firstInput.focus();
2533
+ firstInput.select();
2534
+ }, 100);
2535
+ }
2536
+ }
2537
+ }, []);
2538
+ useEffect7(() => {
2539
+ return () => {
2540
+ if (dataSource) {
2541
+ dataSource.unsubscribe();
2542
+ }
2543
+ };
2544
+ }, [dataSource]);
2545
+ const isDirty = dataStatusRef.current === Status.changed;
2546
+ return /* @__PURE__ */ jsxs14("div", { ...htmlAttributes, className: cx16(classBase11, className), children: [
2547
+ errorMessage ? /* @__PURE__ */ jsx27(
2548
+ "div",
2549
+ {
2550
+ className: `${classBase11}-errorBanner`,
2551
+ "data-icon": "error",
2552
+ title: errorMessage,
2553
+ children: "Error, edit(s) not saved"
2554
+ }
2555
+ ) : void 0,
2556
+ /* @__PURE__ */ jsx27(
2557
+ "div",
2558
+ {
2559
+ className: `${classBase11}-content`,
2560
+ ref: formContentRef,
2561
+ onKeyDown: handleKeyDown,
2562
+ children: fields.map((field) => {
2563
+ var _a;
2564
+ return /* @__PURE__ */ jsxs14("div", { className: `${classBase11}-field`, children: [
2565
+ /* @__PURE__ */ jsx27(
2566
+ "label",
2567
+ {
2568
+ className: cx16(`${classBase11}-fieldLabel`, {
2569
+ [`${classBase11}-required`]: field.required
2570
+ }),
2571
+ htmlFor: `${id}-input-${field.name}`,
2572
+ children: (_a = field == null ? void 0 : field.label) != null ? _a : field.description
2573
+ }
2574
+ ),
2575
+ getFormControl(field)
2576
+ ] }, field.name);
2577
+ })
2578
+ }
2579
+ ),
2580
+ /* @__PURE__ */ jsxs14("div", { className: `${classBase11}-buttonbar salt-theme salt-density-high`, children: [
2581
+ /* @__PURE__ */ jsx27(
2582
+ Button7,
2583
+ {
2584
+ type: "submit",
2585
+ variant: "cta",
2586
+ disabled: !isDirty,
2587
+ onClick: handleSubmit,
2588
+ children: "Submit"
2589
+ }
2590
+ ),
2591
+ /* @__PURE__ */ jsx27(Button7, { variant: "secondary", onClick: handleCancel, children: "Cancel" })
2592
+ ] })
2593
+ ] });
2594
+ };
2595
+
2596
+ // src/shell.tsx
2597
+ import { connectToServer } from "@vuu-ui/vuu-data";
2598
+ import {
2599
+ DraggableLayout as DraggableLayout3,
2600
+ LayoutProvider,
2601
+ loadingApplicationJson as loadingApplicationJson2,
2602
+ useLayoutContextMenuItems
2603
+ } from "@vuu-ui/vuu-layout";
2604
+ import { logger } from "@vuu-ui/vuu-utils";
2605
+ import cx19 from "classnames";
2606
+ import {
2607
+ useCallback as useCallback21,
2608
+ useEffect as useEffect8,
2609
+ useRef as useRef15
2610
+ } from "react";
2611
+
2612
+ // src/shell-layouts/context-panel/ContextPanel.tsx
2613
+ import { Button as Button8 } from "@salt-ds/core";
2614
+ import cx17 from "classnames";
2615
+ import { useCallback as useCallback19, useMemo as useMemo9 } from "react";
2616
+ import {
2617
+ layoutFromJson,
2618
+ View,
2619
+ useLayoutProviderDispatch as useLayoutProviderDispatch2
2620
+ } from "@vuu-ui/vuu-layout";
2621
+ import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
2622
+ var classBase12 = "vuuContextPanel";
2623
+ var ContextPanel = ({
2624
+ className: classNameProp,
2625
+ expanded = false,
2626
+ content: contentProp,
2627
+ overlay = false,
2628
+ title
2629
+ }) => {
2630
+ const dispatchLayoutAction = useLayoutProviderDispatch2();
2631
+ const handleClose = useCallback19(() => {
2632
+ dispatchLayoutAction({
2633
+ path: "#context-panel",
2634
+ propName: "expanded",
2635
+ propValue: false,
2636
+ type: "set-prop"
2637
+ });
2638
+ }, [dispatchLayoutAction]);
2639
+ const className = cx17(classBase12, classNameProp, {
2640
+ [`${classBase12}-expanded`]: expanded,
2641
+ [`${classBase12}-inline`]: overlay !== true,
2642
+ [`${classBase12}-overlay`]: overlay
2643
+ });
2644
+ const content = useMemo9(
2645
+ () => contentProp && expanded ? layoutFromJson(contentProp, "context-0") : null,
2646
+ [contentProp, expanded]
2647
+ );
2648
+ return /* @__PURE__ */ jsx28(
2649
+ "div",
2650
+ {
2651
+ className: cx17(classBase12, className, {
2652
+ [`${classBase12}-expanded`]: expanded
2653
+ }),
2654
+ children: /* @__PURE__ */ jsxs15(View, { className: `${classBase12}-inner`, header: false, id: "context-panel", children: [
2655
+ /* @__PURE__ */ jsxs15("div", { className: `${classBase12}-header`, children: [
2656
+ /* @__PURE__ */ jsx28("h2", { className: `${classBase12}-title`, children: title }),
2657
+ /* @__PURE__ */ jsx28(
2658
+ Button8,
2659
+ {
2660
+ className: `${classBase12}-close`,
2661
+ "data-icon": "close",
2662
+ onClick: handleClose,
2663
+ variant: "secondary"
2664
+ }
2665
+ )
2666
+ ] }),
2667
+ /* @__PURE__ */ jsx28("div", { className: `${classBase12}-content`, children: content })
2668
+ ] })
2669
+ }
2670
+ );
2671
+ };
2672
+
2673
+ // src/shell-layouts/useFullHeightLeftPanel.tsx
2674
+ import { DraggableLayout, Flexbox } from "@vuu-ui/vuu-layout";
2675
+
2676
+ // src/shell-layouts/side-panel/SidePanel.tsx
2677
+ import { useMemo as useMemo10 } from "react";
2678
+ import cx18 from "classnames";
2679
+ import { jsx as jsx29 } from "react/jsx-runtime";
2680
+ var classBase13 = "vuuShellSidePanel";
2681
+ var SidePanel = ({
2682
+ children,
2683
+ open = true,
2684
+ sizeClosed = 90,
2685
+ sizeOpen = 200,
2686
+ style: styleProp,
2687
+ ...htmlAttributes
2688
+ }) => {
2689
+ const style = useMemo10(
2690
+ () => ({
2691
+ ...styleProp,
2692
+ "--shell-left-nav-size": open ? `${sizeOpen}px` : `${sizeClosed}px`
2693
+ }),
2694
+ [open, sizeClosed, sizeOpen, styleProp]
2695
+ );
2696
+ return /* @__PURE__ */ jsx29("div", { ...htmlAttributes, className: cx18(classBase13), style, children });
2697
+ };
2698
+
2699
+ // src/shell-layouts/useFullHeightLeftPanel.tsx
2700
+ import { jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
2701
+ var useFullHeightLeftPanel = ({
2702
+ appHeader,
2703
+ LeftSidePanelProps
2704
+ }) => {
2705
+ return /* @__PURE__ */ jsxs16(
2706
+ Flexbox,
2707
+ {
2708
+ className: "App",
2709
+ style: {
2710
+ flexDirection: "row",
2711
+ height: "100%",
2712
+ width: "100%"
2713
+ },
2714
+ children: [
2715
+ /* @__PURE__ */ jsx30(SidePanel, { ...LeftSidePanelProps, id: "vuu-side-panel" }),
2716
+ /* @__PURE__ */ jsxs16(
2717
+ Flexbox,
2718
+ {
2719
+ className: "vuuShell-content",
2720
+ style: { flex: 1, flexDirection: "column" },
2721
+ children: [
2722
+ appHeader,
2723
+ /* @__PURE__ */ jsx30(DraggableLayout, { dropTarget: true, style: { flex: 1 } }, "main-content")
2724
+ ]
2725
+ }
2726
+ ),
2727
+ /* @__PURE__ */ jsx30(ContextPanel, { id: "context-panel", overlay: true })
2728
+ ]
2729
+ }
2730
+ );
2731
+ };
2732
+
2733
+ // src/shell-layouts/useInlayLeftPanel.tsx
2734
+ import {
2735
+ DockLayout,
2736
+ DraggableLayout as DraggableLayout2,
2737
+ Drawer,
2738
+ Flexbox as Flexbox2,
2739
+ View as View2
2740
+ } from "@vuu-ui/vuu-layout";
2741
+ import { useCallback as useCallback20, useRef as useRef14, useState as useState16 } from "react";
2742
+ import { jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
2743
+ var useInlayLeftPanel = ({
2744
+ appHeader,
2745
+ LeftSidePanelProps
2746
+ }) => {
2747
+ const paletteView = useRef14(null);
2748
+ const [open, setOpen] = useState16(true);
2749
+ const handleDrawerClick = useCallback20(
2750
+ (e) => {
2751
+ var _a;
2752
+ const target = e.target;
2753
+ if (!((_a = paletteView.current) == null ? void 0 : _a.contains(target))) {
2754
+ setOpen(!open);
2755
+ }
2756
+ },
2757
+ [open]
2758
+ );
2759
+ const getDrawers = useCallback20(
2760
+ (leftSidePanel) => {
2761
+ const drawers = [];
2762
+ drawers.push(
2763
+ /* @__PURE__ */ jsx31(
2764
+ Drawer,
2765
+ {
2766
+ onClick: handleDrawerClick,
2767
+ open,
2768
+ position: "left",
2769
+ inline: true,
2770
+ peekaboo: true,
2771
+ sizeOpen: 200,
2772
+ toggleButton: "end",
2773
+ children: /* @__PURE__ */ jsx31(
2774
+ View2,
2775
+ {
2776
+ className: "vuuShell-palette",
2777
+ id: "vw-app-palette",
2778
+ ref: paletteView,
2779
+ style: { height: "100%" },
2780
+ children: leftSidePanel
2781
+ },
2782
+ "app-palette"
2783
+ )
2784
+ },
2785
+ "left-panel"
2786
+ )
2787
+ );
2788
+ return drawers;
2789
+ },
2790
+ [handleDrawerClick, open]
2791
+ );
2792
+ return /* @__PURE__ */ jsxs17(
2793
+ Flexbox2,
2794
+ {
2795
+ className: "App",
2796
+ style: { flexDirection: "column", height: "100%", width: "100%" },
2797
+ children: [
2798
+ appHeader,
2799
+ /* @__PURE__ */ jsx31(DockLayout, { style: { flex: 1 }, children: getDrawers(LeftSidePanelProps == null ? void 0 : LeftSidePanelProps.children).concat(
2800
+ /* @__PURE__ */ jsx31(
2801
+ DraggableLayout2,
2802
+ {
2803
+ dropTarget: true,
2804
+ style: { width: "100%", height: "100%" }
2805
+ },
2806
+ "main-content"
2807
+ )
2808
+ ) })
2809
+ ]
2810
+ }
2811
+ );
2812
+ };
2813
+
2814
+ // src/shell-layouts/useShellLayout.ts
2815
+ var useShellLayout = ({
2816
+ leftSidePanelLayout = "inlay",
2817
+ ...props
2818
+ }) => {
2819
+ const useLayoutHook = leftSidePanelLayout === "inlay" ? useInlayLeftPanel : useFullHeightLeftPanel;
2820
+ return useLayoutHook(props);
2821
+ };
2822
+
2823
+ // src/shell.tsx
2824
+ import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
2825
+ var { error } = logger("Shell");
2826
+ var defaultLeftSidePanel = {};
2827
+ var Shell = ({
2828
+ LayoutProps,
2829
+ LeftSidePanelProps = defaultLeftSidePanel,
2830
+ children,
2831
+ className: classNameProp,
2832
+ leftSidePanelLayout,
2833
+ loginUrl,
2834
+ saveLocation = "remote",
2835
+ saveUrl,
2836
+ serverUrl,
2837
+ user,
2838
+ ...htmlAttributes
2839
+ }) => {
2840
+ const rootRef = useRef15(null);
2841
+ const { dialog, setDialogState } = useDialog();
2842
+ const layoutId = useRef15("latest");
2843
+ const { applicationJson, saveApplicationLayout, loadLayoutById } = useLayoutManager();
2844
+ const { buildMenuOptions, handleMenuAction } = useLayoutContextMenuItems(setDialogState);
2845
+ const handleLayoutChange = useCallback21(
2846
+ (layout, layoutChangeReason) => {
2847
+ try {
2848
+ saveApplicationLayout(layout);
2849
+ } catch {
2850
+ error == null ? void 0 : error("Failed to save layout");
2851
+ }
2852
+ },
2853
+ [saveApplicationLayout]
2854
+ );
2855
+ const handleSwitchTheme = useCallback21((mode) => {
2856
+ if (rootRef.current) {
2857
+ rootRef.current.dataset.mode = mode;
2858
+ }
2859
+ }, []);
2860
+ const handleNavigate = useCallback21(
2861
+ (id) => {
2862
+ layoutId.current = id;
2863
+ loadLayoutById(id);
2864
+ },
2865
+ [loadLayoutById]
2866
+ );
2867
+ useEffect8(() => {
2868
+ if (serverUrl && user.token) {
2869
+ connectToServer({
2870
+ authToken: user.token,
2871
+ url: serverUrl,
2872
+ username: user.username
2873
+ });
2874
+ }
2875
+ }, [serverUrl, user.token, user.username]);
2876
+ const [themeClass, densityClass, dataMode] = useThemeAttributes();
2877
+ const className = cx19("vuuShell", classNameProp, themeClass, densityClass);
2878
+ const isLoading = applicationJson === loadingApplicationJson2;
2879
+ const shellLayout = useShellLayout({
2880
+ LeftSidePanelProps,
2881
+ leftSidePanelLayout,
2882
+ appHeader: /* @__PURE__ */ jsx32(
2883
+ AppHeader,
2884
+ {
2885
+ layoutId: layoutId.current,
2886
+ loginUrl,
2887
+ user,
2888
+ onNavigate: handleNavigate,
2889
+ onSwitchTheme: handleSwitchTheme
2890
+ }
2891
+ )
2892
+ });
2893
+ return isLoading ? null : /* @__PURE__ */ jsx32(ThemeProvider, { children: /* @__PURE__ */ jsxs18(
2894
+ ContextMenuProvider,
2895
+ {
2896
+ menuActionHandler: handleMenuAction,
2897
+ menuBuilder: buildMenuOptions,
2898
+ children: [
2899
+ /* @__PURE__ */ jsx32(
2900
+ LayoutProvider,
2901
+ {
2902
+ ...LayoutProps,
2903
+ layout: applicationJson.layout,
2904
+ onLayoutChange: handleLayoutChange,
2905
+ children: /* @__PURE__ */ jsx32(
2906
+ DraggableLayout3,
2907
+ {
2908
+ className,
2909
+ "data-mode": dataMode,
2910
+ ref: rootRef,
2911
+ ...htmlAttributes,
2912
+ children: shellLayout
2913
+ }
2914
+ )
2915
+ }
2916
+ ),
2917
+ children || dialog
2918
+ ]
2919
+ }
2920
+ ) });
2921
+ };
2922
+
2923
+ // src/shellTypes.ts
2924
+ var isWildcardSchema = (schema) => schema === "*";
2925
+ var isTableSchema = (schema) => typeof schema === "object" && typeof schema.module === "string" && typeof schema.table === "string";
2926
+
2927
+ // src/ShellContextProvider.tsx
2928
+ import { createContext as createContext3, useContext as useContext5 } from "react";
2929
+ import { jsx as jsx33 } from "react/jsx-runtime";
2930
+ var defaultConfig = {};
2931
+ var ShellContext = createContext3(defaultConfig);
2932
+ var Provider2 = ({
2933
+ children,
2934
+ context,
2935
+ inheritedContext
2936
+ }) => {
2937
+ const mergedContext = {
2938
+ ...inheritedContext,
2939
+ ...context
2940
+ };
2941
+ return /* @__PURE__ */ jsx33(ShellContext.Provider, { value: mergedContext, children });
2942
+ };
2943
+ var ShellContextProvider = ({
2944
+ children,
2945
+ value
2946
+ }) => {
2947
+ return /* @__PURE__ */ jsx33(ShellContext.Consumer, { children: (context) => /* @__PURE__ */ jsx33(Provider2, { context: value, inheritedContext: context, children }) });
2948
+ };
2949
+ var useShellContext = () => {
2950
+ return useContext5(ShellContext);
2951
+ };
2952
+
2953
+ // src/theme-switch/ThemeSwitch.tsx
2954
+ import cx20 from "classnames";
2955
+ import { ToggleButton, ToggleButtonGroup, useControlled } from "@salt-ds/core";
2956
+ import { useCallback as useCallback22 } from "react";
2957
+ import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
2958
+ var classBase14 = "vuuThemeSwitch";
2959
+ var ThemeSwitch = ({
2960
+ className: classNameProp,
2961
+ defaultMode: defaultModeProp,
2962
+ mode: modeProp,
2963
+ onChange,
2964
+ ...htmlAttributes
2965
+ }) => {
2966
+ const [mode, setMode] = useControlled({
2967
+ controlled: modeProp,
2968
+ default: defaultModeProp != null ? defaultModeProp : "light",
2969
+ name: "ThemeSwitch",
2970
+ state: "mode"
2971
+ });
2972
+ const handleChangeSecondary = useCallback22(
2973
+ (evt) => {
2974
+ const { value } = evt.target;
2975
+ setMode(value);
2976
+ onChange(value);
2977
+ },
2978
+ [onChange, setMode]
2979
+ );
2980
+ const className = cx20(classBase14, classNameProp);
2981
+ return /* @__PURE__ */ jsxs19(
2982
+ ToggleButtonGroup,
2983
+ {
2984
+ className,
2985
+ ...htmlAttributes,
2986
+ onChange: handleChangeSecondary,
2987
+ value: mode,
2988
+ children: [
2989
+ /* @__PURE__ */ jsx34(ToggleButton, { "aria-label": "alert", "data-icon": "light", value: "dark" }),
2990
+ /* @__PURE__ */ jsx34(ToggleButton, { "aria-label": "home", "data-icon": "dark", value: "light" })
2991
+ ]
2992
+ }
2993
+ );
2994
+ };
2995
+ export {
2996
+ AppHeader,
2997
+ ConnectionStatusIcon,
2998
+ ContextPanel,
2999
+ DEFAULT_DENSITY2 as DEFAULT_DENSITY,
3000
+ DEFAULT_THEME,
3001
+ DEFAULT_THEME_MODE,
3002
+ DensitySwitch,
3003
+ Feature,
3004
+ FeatureList,
3005
+ LayoutManagementContext,
3006
+ LayoutManagementProvider,
3007
+ LayoutsList,
3008
+ LeftNav,
3009
+ LoginPanel,
3010
+ SaveLayoutPanel,
3011
+ SessionEditingForm,
3012
+ Shell,
3013
+ ShellContextProvider,
3014
+ SidePanel,
3015
+ ThemeContext,
3016
+ ThemeProvider,
3017
+ ThemeSwitch,
3018
+ getAuthDetailsFromCookies,
3019
+ getAuthModeFromCookies,
3020
+ isTableSchema,
3021
+ isWildcardSchema,
3022
+ logout,
3023
+ redirectToLogin,
3024
+ useLayoutManager,
3025
+ useShellContext,
3026
+ useShellLayout,
3027
+ useThemeAttributes
3028
+ };
4
3029
  //# sourceMappingURL=index.js.map