@alextheman/components 6.20.0 → 6.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -246,6 +246,10 @@ type QueryBoundaryContextValue<DataType> = QueryBoundaryProviderPropsWithNoError
246
246
  type QueryBoundaryProviderProps<DataType> = QueryBoundaryContextValue<DataType> & {
247
247
  children: ReactNode;
248
248
  };
249
+ /** Access the QueryBoundary context directly. */
250
+ declare function useQueryBoundary<DataType, Strict extends boolean = true>({
251
+ strict
252
+ }?: ContextHookOptions<Strict>): OptionalOnCondition<Strict, QueryBoundaryContextValue<DataType>>;
249
253
  /**
250
254
  * A provider for a context that deals with state management when fetching data from an API.
251
255
  * This may be used over QueryBoundary if you require more control over the placement of the error message and data display.
@@ -883,6 +887,19 @@ declare function createQueryBoundary<DataType>({
883
887
  query
884
888
  }: CreateQueryBoundaryParameters<DataType>): DefaultQueryBoundaryComponents<DataType>;
885
889
  //#endregion
890
+ //#region src/hooks/useDebounce.d.ts
891
+ /**
892
+ * Assign a variable a given value after a given amount of milliseconds.
893
+ *
894
+ * @template ValueType The type of the value to set.
895
+ *
896
+ * @param value - The value to assign.
897
+ * @param delay - The amount of milliseconds to wait before assigning the value.
898
+ *
899
+ * @returns The input value after a given number of seconds.
900
+ */
901
+ declare function useDebounce<ValueType>(value: ValueType, delay?: number): ValueType;
902
+ //#endregion
886
903
  //#region src/hooks/useHash.d.ts
887
904
  /**
888
905
  * Stores changes to the window hash as React state.
@@ -895,5 +912,5 @@ declare function createQueryBoundary<DataType>({
895
912
  */
896
913
  declare function useHash<StateType extends string>(initialHash: StateType | undefined): [StateType, Dispatch<SetStateAction<StateType>>];
897
914
  //#endregion
898
- export { Artwork, CollapsableItem, type CollapsableItemProps, ContextHookOptions, type CreateQueryBoundaryParameters, DarkModeToggle, type DefaultQueryBoundaryComponents, DropdownMenu, DropdownMenu2, type DropdownMenu2Props, DropdownMenuExternalLink, DropdownMenuInternalLink, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, ExternalLink, type ExternalLinkProps, FileInput, FileInputList, type FileInputListProps, type FileInputProps, FileType, IconWithPopover, type IconWithPopoverProps, InternalLink, type InternalLinkProps, ListItemInternalLink, Loader, type LoaderContextValue, LoaderData, type LoaderDataProps, LoaderError, type LoaderErrorBaseProps, type LoaderErrorProps, type LoaderErrorPropsWithNullable, type LoaderErrorPropsWithUndefinedOrNull, LoaderProvider, type LoaderProviderBaseProps, type LoaderProviderProps, type LoaderProviderPropsWithError, type LoaderProviderPropsWithNoError, ModeProvider, type ModeProviderProps, ModeToggle, type NavItemBottom, type NavMenuItem, NavigationBottom, type NavigationBottomProps, NavigationDrawer, type NavigationDrawerProps, Page, PopoverText, type PopoverTextProps, type Query, type QueryBase, QueryBoundary, QueryBoundaryData, QueryBoundaryDataMap, type QueryBoundaryDataMapBaseProps, type QueryBoundaryDataMapProps, type QueryBoundaryDataMapPropsWithDataParser, type QueryBoundaryDataMapPropsWithItemParser, type QueryBoundaryDataMapPropsWithNoParser, type QueryBoundaryDataProps, QueryBoundaryError, type QueryBoundaryErrorProps, QueryBoundaryFallback, type QueryBoundaryFallbackProps, QueryBoundaryMap, type QueryBoundaryMapProps, QueryBoundaryNullable, type QueryBoundaryNullableProps, type QueryBoundaryNullablePropsWithNullable, type QueryBoundaryNullablePropsWithUndefinedOrNull, type QueryBoundaryProps, QueryBoundaryProvider, type QueryBoundaryProviderBaseProps, type QueryBoundaryProviderProps, type QueryBoundaryProviderPropsWithError, type QueryBoundaryProviderPropsWithNoError, QueryBoundaryWrapper, type QueryBoundaryWrapperProps, type QueryMultiple, type QuerySingle, ReactPlayground, type ReactPlaygroundProps, type ScreenSizeContextValue, type ScreenSizeProps, ScreenSizeProvider, SkeletonRow, type SkeletonRowProps, SnackbarProvider, type SnackbarProviderProps, SubmitButton, type SubmitButtonProps, SwitchWithIcons, type SwitchWithIconsProps, createQueryBoundary, useDropdownMenu, useHash, useMode, useScreenSize, useSnackbar };
915
+ export { Artwork, CollapsableItem, type CollapsableItemProps, ContextHookOptions, type CreateQueryBoundaryParameters, DarkModeToggle, type DefaultQueryBoundaryComponents, DropdownMenu, DropdownMenu2, type DropdownMenu2Props, DropdownMenuExternalLink, DropdownMenuInternalLink, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, ExternalLink, type ExternalLinkProps, FileInput, FileInputList, type FileInputListProps, type FileInputProps, FileType, IconWithPopover, type IconWithPopoverProps, InternalLink, type InternalLinkProps, ListItemInternalLink, Loader, type LoaderContextValue, LoaderData, type LoaderDataProps, LoaderError, type LoaderErrorBaseProps, type LoaderErrorProps, type LoaderErrorPropsWithNullable, type LoaderErrorPropsWithUndefinedOrNull, LoaderProvider, type LoaderProviderBaseProps, type LoaderProviderProps, type LoaderProviderPropsWithError, type LoaderProviderPropsWithNoError, ModeProvider, type ModeProviderProps, ModeToggle, type NavItemBottom, type NavMenuItem, NavigationBottom, type NavigationBottomProps, NavigationDrawer, type NavigationDrawerProps, Page, PopoverText, type PopoverTextProps, type Query, type QueryBase, QueryBoundary, QueryBoundaryData, QueryBoundaryDataMap, type QueryBoundaryDataMapBaseProps, type QueryBoundaryDataMapProps, type QueryBoundaryDataMapPropsWithDataParser, type QueryBoundaryDataMapPropsWithItemParser, type QueryBoundaryDataMapPropsWithNoParser, type QueryBoundaryDataProps, QueryBoundaryError, type QueryBoundaryErrorProps, QueryBoundaryFallback, type QueryBoundaryFallbackProps, QueryBoundaryMap, type QueryBoundaryMapProps, QueryBoundaryNullable, type QueryBoundaryNullableProps, type QueryBoundaryNullablePropsWithNullable, type QueryBoundaryNullablePropsWithUndefinedOrNull, type QueryBoundaryProps, QueryBoundaryProvider, type QueryBoundaryProviderBaseProps, type QueryBoundaryProviderProps, type QueryBoundaryProviderPropsWithError, type QueryBoundaryProviderPropsWithNoError, QueryBoundaryWrapper, type QueryBoundaryWrapperProps, type QueryMultiple, type QuerySingle, ReactPlayground, type ReactPlaygroundProps, type ScreenSizeContextValue, type ScreenSizeProps, ScreenSizeProvider, SkeletonRow, type SkeletonRowProps, SnackbarProvider, type SnackbarProviderProps, SubmitButton, type SubmitButtonProps, SwitchWithIcons, type SwitchWithIconsProps, createQueryBoundary, useDebounce, useDropdownMenu, useHash, useMode, useQueryBoundary, useScreenSize, useSnackbar };
899
916
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -246,6 +246,10 @@ type QueryBoundaryContextValue<DataType> = QueryBoundaryProviderPropsWithNoError
246
246
  type QueryBoundaryProviderProps<DataType> = QueryBoundaryContextValue<DataType> & {
247
247
  children: ReactNode;
248
248
  };
249
+ /** Access the QueryBoundary context directly. */
250
+ declare function useQueryBoundary<DataType, Strict extends boolean = true>({
251
+ strict
252
+ }?: ContextHookOptions<Strict>): OptionalOnCondition<Strict, QueryBoundaryContextValue<DataType>>;
249
253
  /**
250
254
  * A provider for a context that deals with state management when fetching data from an API.
251
255
  * This may be used over QueryBoundary if you require more control over the placement of the error message and data display.
@@ -883,6 +887,19 @@ declare function createQueryBoundary<DataType>({
883
887
  query
884
888
  }: CreateQueryBoundaryParameters<DataType>): DefaultQueryBoundaryComponents<DataType>;
885
889
  //#endregion
890
+ //#region src/hooks/useDebounce.d.ts
891
+ /**
892
+ * Assign a variable a given value after a given amount of milliseconds.
893
+ *
894
+ * @template ValueType The type of the value to set.
895
+ *
896
+ * @param value - The value to assign.
897
+ * @param delay - The amount of milliseconds to wait before assigning the value.
898
+ *
899
+ * @returns The input value after a given number of seconds.
900
+ */
901
+ declare function useDebounce<ValueType>(value: ValueType, delay?: number): ValueType;
902
+ //#endregion
886
903
  //#region src/hooks/useHash.d.ts
887
904
  /**
888
905
  * Stores changes to the window hash as React state.
@@ -895,5 +912,5 @@ declare function createQueryBoundary<DataType>({
895
912
  */
896
913
  declare function useHash<StateType extends string>(initialHash: StateType | undefined): [StateType, Dispatch<SetStateAction<StateType>>];
897
914
  //#endregion
898
- export { Artwork, CollapsableItem, type CollapsableItemProps, ContextHookOptions, type CreateQueryBoundaryParameters, DarkModeToggle, type DefaultQueryBoundaryComponents, DropdownMenu, DropdownMenu2, type DropdownMenu2Props, DropdownMenuExternalLink, DropdownMenuInternalLink, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, ExternalLink, type ExternalLinkProps, FileInput, FileInputList, type FileInputListProps, type FileInputProps, FileType, IconWithPopover, type IconWithPopoverProps, InternalLink, type InternalLinkProps, ListItemInternalLink, Loader, type LoaderContextValue, LoaderData, type LoaderDataProps, LoaderError, type LoaderErrorBaseProps, type LoaderErrorProps, type LoaderErrorPropsWithNullable, type LoaderErrorPropsWithUndefinedOrNull, LoaderProvider, type LoaderProviderBaseProps, type LoaderProviderProps, type LoaderProviderPropsWithError, type LoaderProviderPropsWithNoError, ModeProvider, type ModeProviderProps, ModeToggle, type NavItemBottom, type NavMenuItem, NavigationBottom, type NavigationBottomProps, NavigationDrawer, type NavigationDrawerProps, Page, PopoverText, type PopoverTextProps, type Query, type QueryBase, QueryBoundary, QueryBoundaryData, QueryBoundaryDataMap, type QueryBoundaryDataMapBaseProps, type QueryBoundaryDataMapProps, type QueryBoundaryDataMapPropsWithDataParser, type QueryBoundaryDataMapPropsWithItemParser, type QueryBoundaryDataMapPropsWithNoParser, type QueryBoundaryDataProps, QueryBoundaryError, type QueryBoundaryErrorProps, QueryBoundaryFallback, type QueryBoundaryFallbackProps, QueryBoundaryMap, type QueryBoundaryMapProps, QueryBoundaryNullable, type QueryBoundaryNullableProps, type QueryBoundaryNullablePropsWithNullable, type QueryBoundaryNullablePropsWithUndefinedOrNull, type QueryBoundaryProps, QueryBoundaryProvider, type QueryBoundaryProviderBaseProps, type QueryBoundaryProviderProps, type QueryBoundaryProviderPropsWithError, type QueryBoundaryProviderPropsWithNoError, QueryBoundaryWrapper, type QueryBoundaryWrapperProps, type QueryMultiple, type QuerySingle, ReactPlayground, type ReactPlaygroundProps, type ScreenSizeContextValue, type ScreenSizeProps, ScreenSizeProvider, SkeletonRow, type SkeletonRowProps, SnackbarProvider, type SnackbarProviderProps, SubmitButton, type SubmitButtonProps, SwitchWithIcons, type SwitchWithIconsProps, createQueryBoundary, useDropdownMenu, useHash, useMode, useScreenSize, useSnackbar };
915
+ export { Artwork, CollapsableItem, type CollapsableItemProps, ContextHookOptions, type CreateQueryBoundaryParameters, DarkModeToggle, type DefaultQueryBoundaryComponents, DropdownMenu, DropdownMenu2, type DropdownMenu2Props, DropdownMenuExternalLink, DropdownMenuInternalLink, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, ExternalLink, type ExternalLinkProps, FileInput, FileInputList, type FileInputListProps, type FileInputProps, FileType, IconWithPopover, type IconWithPopoverProps, InternalLink, type InternalLinkProps, ListItemInternalLink, Loader, type LoaderContextValue, LoaderData, type LoaderDataProps, LoaderError, type LoaderErrorBaseProps, type LoaderErrorProps, type LoaderErrorPropsWithNullable, type LoaderErrorPropsWithUndefinedOrNull, LoaderProvider, type LoaderProviderBaseProps, type LoaderProviderProps, type LoaderProviderPropsWithError, type LoaderProviderPropsWithNoError, ModeProvider, type ModeProviderProps, ModeToggle, type NavItemBottom, type NavMenuItem, NavigationBottom, type NavigationBottomProps, NavigationDrawer, type NavigationDrawerProps, Page, PopoverText, type PopoverTextProps, type Query, type QueryBase, QueryBoundary, QueryBoundaryData, QueryBoundaryDataMap, type QueryBoundaryDataMapBaseProps, type QueryBoundaryDataMapProps, type QueryBoundaryDataMapPropsWithDataParser, type QueryBoundaryDataMapPropsWithItemParser, type QueryBoundaryDataMapPropsWithNoParser, type QueryBoundaryDataProps, QueryBoundaryError, type QueryBoundaryErrorProps, QueryBoundaryFallback, type QueryBoundaryFallbackProps, QueryBoundaryMap, type QueryBoundaryMapProps, QueryBoundaryNullable, type QueryBoundaryNullableProps, type QueryBoundaryNullablePropsWithNullable, type QueryBoundaryNullablePropsWithUndefinedOrNull, type QueryBoundaryProps, QueryBoundaryProvider, type QueryBoundaryProviderBaseProps, type QueryBoundaryProviderProps, type QueryBoundaryProviderPropsWithError, type QueryBoundaryProviderPropsWithNoError, QueryBoundaryWrapper, type QueryBoundaryWrapperProps, type QueryMultiple, type QuerySingle, ReactPlayground, type ReactPlaygroundProps, type ScreenSizeContextValue, type ScreenSizeProps, ScreenSizeProvider, SkeletonRow, type SkeletonRowProps, SnackbarProvider, type SnackbarProviderProps, SubmitButton, type SubmitButtonProps, SwitchWithIcons, type SwitchWithIconsProps, createQueryBoundary, useDebounce, useDropdownMenu, useHash, useMode, useQueryBoundary, useScreenSize, useSnackbar };
899
916
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import e from"@mui/material/Box";import t from"@mui/material/Card";import n from"@mui/material/CardContent";import r from"@mui/material/CardHeader";import i from"@mui/material/Chip";import a from"@mui/material/Divider";import o from"@mui/material/Stack";import s from"@mui/material/Typography";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import d from"@mui/material/ButtonBase";import f from"@mui/material/Collapse";import{Fragment as p,createContext as m,useCallback as h,useContext as g,useEffect as _,useId as v,useMemo as y,useRef as ee,useState as b}from"react";import{MdArrowDropDown as te,MdArrowDropUp as ne,MdChevronLeft as re,MdChevronRight as ie,MdCloudUpload as ae,MdDelete as oe,MdMenu as se,MdOutlineDarkMode as ce,MdOutlineLightMode as le,MdVisibility as ue}from"react-icons/md";import x from"@mui/material/Link";import S from"@mui/material/Button";import{ThemeProvider as de,createTheme as fe,styled as C,useTheme as pe}from"@mui/material/styles";import w from"@mui/material/IconButton";import me from"@mui/material/List";import he from"@mui/material/ListItem";import ge from"@mui/material/ListItemText";import _e from"@mui/material/Tooltip";import ve from"@mui/material/Switch";import{DataError as T}from"@alextheman/utility/v6";import E from"@mui/material/CssBaseline";import D from"@mui/material/CircularProgress";import O from"@mui/material/Alert";import{fillArray as ye,truncate as k,wait as be}from"@alextheman/utility";import xe from"@mui/material/Snackbar";import Se from"@mui/material/BottomNavigation";import Ce from"@mui/material/BottomNavigationAction";import we from"@mui/material/Paper";import{Link as A,useLocation as Te}from"react-router-dom";import{stripIndent as Ee}from"common-tags";import{LiveEditor as De,LiveError as Oe,LivePreview as ke,LiveProvider as Ae}from"react-live";import je from"@mui/material/Skeleton";import Me from"@mui/material/TableCell";import Ne from"@mui/material/TableRow";import j from"@mui/material/Menu";import Pe from"@mui/material/AppBar";import Fe from"@mui/material/Drawer";import M from"@mui/material/ListItemButton";import Ie from"@mui/material/ListItemIcon";import Le from"@mui/material/Toolbar";import N from"@mui/material/MenuItem";import Re from"@mui/material/Popover";import{useFormContext as ze}from"react-hook-form";function P({containerLabel:e,chipLabels:r}){return l(t,{sx:{width:320,height:420,backgroundColor:`rgba(255,255,255,0.07)`,backdropFilter:`blur(8px)`,border:`1px solid rgba(255,255,255,0.06)`,boxShadow:`0 10px 40px rgba(0,0,0,0.35)`},children:u(n,{children:[l(s,{variant:`h6`,gutterBottom:!0,sx:{color:`#f8fafc`},children:e}),l(o,{spacing:1,children:r.map(e=>l(i,{label:e,sx:{backgroundColor:`rgba(255,255,255,0.11)`,color:`rgba(255,255,255,0.88)`,border:`1px solid rgba(255,255,255,0.06)`}},e))})]})})}function Be(){return l(e,{sx:{width:120,height:6,borderRadius:3,background:`linear-gradient(90deg, #f43f5e, #a78bfa, #22d3ee)`,boxShadow:`0 0 24px rgba(167,139,250,0.55)`}})}function Ve(){return u(t,{sx:{width:1e3,height:1e3,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,p:4,background:`radial-gradient(circle at 20% 10%, rgba(167,139,250,0.35) 0%, rgba(167,139,250,0.12) 35%, rgba(0,0,0,0) 55%), linear-gradient(135deg, #3a3380 0%, #1d2e5f 40%, #2d3f55 100%)`,color:`white`},elevation:0,children:[l(r,{title:`An Interface For You And I`,sx:{color:`#f8fafc`,textAlign:`center`,"& .MuiCardHeader-title":{fontSize:40,fontWeight:600,letterSpacing:2}}}),l(a,{sx:{borderColor:`rgba(255,255,255,0.2)`}}),l(n,{sx:{flex:1,display:`flex`,alignItems:`center`},children:u(o,{direction:`row`,spacing:4,sx:{width:`100%`,justifyContent:`center`,alignItems:`center`},children:[l(P,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),l(Be,{}),l(P,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function He({isInitiallyOpen:t,onOpen:n,onClose:r,children:i,buttonStyles:a,buttonContents:o,buttonComponent:s=d,collapseProps:c,openIcon:p=l(ne,{}),closedIcon:m=l(te,{}),useDefaultStyling:h=s===d}){let[g,v]=b(!!t);return _(()=>{g&&n?n():!g&&r&&r()},[g]),u(e,{children:[u(s,{onClick:()=>{v(e=>!e)},sx:h?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":s===d?{backgroundColor:`action.hover`}:null,...a}:a,"aria-expanded":g,children:[o,g?p:m]}),l(f,{in:g,...c,children:i})]})}function F({href:e,children:t,ref:n,...r}){return l(x,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const Ue={PDF:`application/pdf`,PNG:`image/png`,JPEG:`image/jpeg`,JPG:`image/jpg`,XLSX:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,DOCX:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,MP3:`audio/mp3`,MP4:`video/mp4`,WAV:`audio/wav`},We=C(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),Ge=C(`div`)(({theme:e,$dragging:t})=>({border:`2px dashed`,borderColor:t?e.palette.primary.main:`#ccc`,backgroundColor:t?e.palette.action.hover:`transparent`,borderRadius:8,padding:`1.5rem`,textAlign:`center`,transition:`border-color 0.2s`,cursor:`pointer`}));function I({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=b(!1),c=v(),d=u(S,{variant:`contained`,component:`label`,"aria-label":`File input button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(c)?.click())},...a,startIcon:a.startIcon??l(ae,{}),children:[t,l(We,{id:c,type:`file`,onChange:t=>{let n=t.target;e(Array.from(n.files??[])),n.value=``},multiple:n,accept:r?.join(`,`),disabled:a.disabled})]});return i?l(Ge,{$dragging:o,onDragOver:e=>{e.preventDefault(),!a.disabled&&s(!0)},onDragLeave:e=>{e.preventDefault(),s(!1)},onDrop:t=>{t.preventDefault(),s(!1),!a.disabled&&e(Array.from(t.dataTransfer.files??[]))},children:d}):d}function Ke({files:t,setFiles:n,multiple:r=!0,...i}){function a(e){n(t=>[...t,...e])}return u(e,{children:[l(I,{...i,multiple:r,onFileInput:a}),l(me,{children:t.map(e=>l(he,{secondaryAction:l(w,{"aria-label":`Delete`,edge:`end`,onClick:()=>{n(t=>t.filter(t=>t!==e))},children:l(oe,{})}),children:l(ge,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const qe=C(ve)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function L({checkedIcon:t,checkedIconStyles:n,uncheckedIcon:r,uncheckedIconStyles:i,...a}){let o={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},s={color:`black`,maxWidth:16.5,maxHeight:16.5};return l(qe,{checkedIcon:l(e,{sx:o,children:l(t,{style:{...s,...n}})}),icon:l(e,{sx:o,children:l(r,{style:{...s,...i}})}),...a})}const R=m({toggleMode:()=>{},mode:`dark`});function z({strict:e=!0}={}){let t=g(R);if(e&&!t)throw new T({strict:e,context:t},`MODE_PROVIDER_NOT_FOUND`,`Could not find the ModeProvider context. Please double-check that it is present.`);return t}function Je({children:e,mode:t=`dark`}){let[n,r]=b(t),i=y(()=>fe({palette:{mode:n},components:{MuiPaper:{styleOverrides:{root:({theme:e})=>({border:1,borderStyle:`solid`,borderColor:e.palette.divider})}}}}),[n]);return l(R.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:u(de,{theme:i,children:[l(E,{}),e]})})}const B=m(void 0);function V({strict:e=!0}={}){let t=g(B);if(e&&!t)throw new T({strict:e,context:t},`QUERY_BOUNDARY_PROVIDER_NOT_FOUND`,`Could not find the QueryBoundaryProvider context. Please double-check that it is present.`);return t}function Ye({children:e,loadingComponent:t=l(D,{}),...n}){return l(B.Provider,{value:{loadingComponent:t,...n},children:e})}function H({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=V(),u=t??a;return r?l(c,{children:n??o}):s||i==null?null:l(c,{children:typeof e==`function`?e(u?u(i):i):e})}function U({children:e,loadingComponent:t,itemKey:n,itemParser:r,dataParser:i,emptyComponent:a=l(s,{children:`No data present`}),strictlyRequireArray:o=!0}){let{isLoading:u,data:d,dataParser:f,loadingComponent:m,error:h}=V(),g=i??f,_=t??m;if(u)return l(c,{children:_});if(h||d==null)return null;if(!Array.isArray(d)){if(o)throw new T({data:d,strictlyRequireArray:o},`NOT_AN_ARRAY`,`Expected the data to be an array but it was not an array.`);return null}if(d.length===0)return l(c,{children:a});let v;return v=g?g(d):r?d.map(r):d,l(c,{children:v.map((t,r)=>l(p,{children:typeof e==`function`?e(t):e},n?n(t,r):r))})}function W({children:e,logError:t}){let{data:n,error:r,errorComponent:i,logError:a}=V(),o=t??a,s=ee(!1),u=e??i;return r?(o&&!s.current&&(n!=null&&console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:n,error:r}),console.error(r),s.current=!0),typeof u==`function`?u(r):u?l(c,{children:u}):l(O,{severity:`error`,children:typeof r==`object`&&`message`in r&&typeof r.message==`string`?r.message:`An unknown error has occured. Please try again later.`})):null}function G({undefinedComponent:e,nullComponent:t,nullableComponent:n}){let{isLoading:r,data:i,error:a}=V();return r||a?null:i==null?n?l(c,{children:n}):i===void 0&&e?l(c,{children:e}):i===null&&t?l(c,{children:t}):l(O,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}function K({errorComponent:e,logError:t,...n}){return u(c,{children:[l(W,{logError:t,children:e}),l(G,{...n})]})}var q=Ye;const Xe=m({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Ze({strict:e=!0}={}){let t=g(Xe);if(e&&!t)throw new T({strict:e,context:t},`SCREEN_SIZE_PROVIDER_NOT_FOUND`,`Could not find the ScreenSizeProvider context. Please double-check that it is present.`);return t}function Qe({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=b(window.innerWidth),[a,o]=b(window.innerHeight);_(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=y(()=>r>t&&a>n,[r,a,t,n]);return l(Xe.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const $e=m(void 0);function et({strict:e=!0}={}){let t=g($e);if(e&&!t)throw new T({strict:e,context:t},`SNACKBAR_PROVIDER_NOT_FOUND`,`Could not find the SnackbarProvider context. Please double-check that it is present.`);return t}function tt({children:e,autoHideDuration:t=5e3}){let[n,r]=b(!1),[i,a]=b(t),[o,s]=b(``),[c,d]=b(`info`);function f(e,n,i){r(!0),a(i??t),d(n??`info`),s(e)}async function p(){r(!1),await be(.2),s(``)}return u($e.Provider,{value:{addSnackbar:f},children:[l(xe,{open:n,autoHideDuration:i,onClose:p,children:l(O,{onClose:p,severity:c,children:o})}),e]})}function nt(){let{mode:e,toggleMode:t}=z(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return l(_e,{title:r,children:l(L,{uncheckedIcon:le,checkedIcon:ce,checked:n,onChange:t,"aria-label":r})})}function rt({children:t,navItems:n}){let[r,i]=b(``);return u(c,{children:[l(e,{sx:{paddingBottom:7},children:t}),l(we,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:l(Se,{showLabels:!0,value:r,onChange:(e,t)=>{i(t)},children:n.map(e=>l(Ce,{...e,component:A},e.value))})})]})}function it({title:e,subtitle:i,action:o,children:d,tabs:f,disablePadding:p}){return u(t,{children:[l(r,{title:u(c,{children:[typeof e==`string`?l(s,{variant:`h6`,children:e}):e,i?typeof i==`string`?l(s,{variant:`body2`,color:`text.secondary`,children:i}):i:null]}),action:o}),f,l(a,{}),p?d:l(n,{children:d})]})}function J({query:e}){return{Context:({children:t})=>l(q,{isLoading:e.isLoading,error:e.error,data:e.data??e.dataCollection,children:t}),Error:W,Data:H,DataMap:U,Fallback:K,Nullable:G}}function at(e){let[t,n]=b(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=h(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return _(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,h(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}function ot({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:d,dataParser:f,itemParser:p,itemKey:m}){let h=J({query:{isLoading:s,error:c,dataCollection:d}}),g=l(h.Fallback,{logError:i,errorComponent:a});r?g=l(h.Fallback,{nullableComponent:r,logError:i,errorComponent:a}):(t||n)&&(g=l(h.Fallback,{undefinedComponent:t,nullComponent:n,logError:i,errorComponent:a}));let _=l(h.DataMap,{loadingComponent:e,itemKey:m,children:o});return f?_=l(h.DataMap,{loadingComponent:e,itemKey:m,dataParser:f,children:o}):p&&(_=l(h.DataMap,{loadingComponent:e,itemKey:m,itemParser:p,children:o})),u(h.Context,{children:[g,_]})}function Y({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=l(D,{}),isLoading:s,error:c,data:d,dataParser:f}){let p=J({query:{isLoading:s,error:c,data:d}}),m=l(p.Fallback,{logError:a,errorComponent:t});return i?m=l(p.Fallback,{nullableComponent:i,logError:a,errorComponent:t}):(n||r)&&(m=l(p.Fallback,{undefinedComponent:n,nullComponent:r,logError:a,errorComponent:t})),u(p.Context,{children:[m,l(p.Data,{loadingComponent:o,dataParser:f,children:e})]})}function st({code:t,previewStyles:n,...r}){let{mode:i}=z(),a={backgroundColor:i===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},o=n?{...a,...n}:{...a};return l(e,{sx:{borderRadius:1,border:.5,padding:2},children:u(Ae,{...r,code:Ee(t??``),children:[l(s,{variant:`h5`,children:`Code`}),l(e,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:l(De,{})}),l(`br`,{}),l(s,{variant:`h5`,children:`Result`}),u(e,{sx:o,children:[l(ke,{}),l(Oe,{})]})]})})}function ct({columns:e}){return l(Ne,{children:ye(e=>l(Me,{children:l(je,{})},e),e)})}const lt=nt;function ut({children:t,button:n=S,buttonChildren:r=`Menu`,buttonProps:i,isOpenIcon:a=l(ne,{}),isClosedIcon:o=l(te,{}),onOpen:s,onClose:c}){let[d,f]=b(null),p=y(()=>!!d,[d]),m={...i,onClick:e=>{f(e.currentTarget)},"aria-controls":p?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":p};return n===S&&(m.endIcon=p?a:o),_(()=>{p&&s?s():!p&&c&&c()},[p,s,c]),u(e,{children:[l(n,{...m,children:r}),l(j,{id:`dropdown-menu`,anchorEl:d,open:p,onClose:()=>{f(null)},children:typeof t==`function`?l(e,{children:t(()=>{f(null)})}):t})]})}const dt=m(void 0);function X({strict:e=!0}={}){let t=g(dt);if(e&&!t)throw new T({strict:e,context:t},`DROPDOWN_MENU_NOT_FOUND`,`Could not find the DropdownMenu context. Please double-check that it is present.`);return t}function ft({strict:e=!0}={}){return X({strict:e})}function pt({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=ft();return l(j,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function mt({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=X();return l(N,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Z=X,ht=pt,gt=mt;var _t=ht;function vt({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Z();return l(N,{component:F,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Q({to:e,component:t=A,children:n,ref:r,...i}){return l(x,{component:t,to:e,ref:r,...i,children:n})}function yt({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Z();return l(N,{component:Q,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function bt({icon:t=ue,onOpen:n,onClose:r,iconProps:i,children:a}){let[o,s]=b(null),c=!!o,d=v();function f(e){s(e.currentTarget),n&&n()}function p(){s(null),r&&r()}return u(e,{children:[l(t,{"aria-owns":c?d:void 0,"aria-haspopup":`true`,onMouseEnter:f,onMouseLeave:p,...i}),l(Re,{id:d,disablePortal:!0,disableScrollLock:!0,slotProps:{root:{disableEnforceFocus:!0,disableAutoFocus:!0,disableRestoreFocus:!0}},sx:{pointerEvents:`none`},open:c,anchorEl:o,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:p,disableRestoreFocus:!0,children:a})]})}function xt({children:e,...t}){return l(M,{component:Q,...t,children:e})}const St=Y,Ct=H,wt=K,Tt=q;function Et(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function Dt(e){return{transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:`hidden`,width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up(`sm`)]:{width:`calc(${e.spacing(8)} + 1px)`}}}const $=C(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),Ot=C(Pe,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),kt=C(Fe,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...Et(e),"& .MuiDrawer-paper":Et(e)}},{props:({open:e})=>!e,style:{...Dt(e),"& .MuiDrawer-paper":Dt(e)}}]}));function At({title:t,navItems:n,children:r,headerElements:i}){let o=pe(),[c,d]=b(!0),f=Te();function m(){d(!0)}function h(){d(!1)}return u(e,{sx:{display:`flex`},children:[l(E,{}),l(Ot,{position:`fixed`,open:c,children:u(Le,{children:[l(w,{color:`inherit`,"aria-label":`open drawer`,onClick:m,edge:`start`,sx:[{marginRight:5},c&&{display:`none`}],children:l(se,{})}),l(s,{variant:`h6`,noWrap:!0,component:`div`,children:t}),i]})}),u(kt,{variant:`permanent`,open:c,children:[l($,{children:l(w,{onClick:h,children:o.direction===`rtl`?l(ie,{}):l(re,{})})}),l(a,{}),n.map(e=>u(p,{children:[u(me,{children:[l(s,{variant:c?`h5`:`h6`,sx:{paddingLeft:c?2:1},children:c?e.category:k(e.category,4)}),e.options.map(e=>l(he,{disablePadding:!0,sx:{display:`block`},children:u(M,{sx:[{minHeight:48,px:2.5},c?{justifyContent:`initial`}:{justifyContent:`center`}],component:A,to:e.to,selected:f.pathname===e.to,children:[l(Ie,{sx:[{minWidth:0,justifyContent:`center`},c?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:c?null:l(s,{children:k(e.label,4)})}),l(ge,{primary:e.label,sx:[c?{opacity:1}:{opacity:0}]})]})},e.to))]}),l(a,{})]},e.category))]}),u(e,{component:`main`,sx:{flexGrow:1,p:3},children:[l($,{}),r]})]})}function jt({text:e,sx:t,...n}){return l(c,{children:e.split(`
2
- `).map((e,r)=>l(s,{sx:{margin:1,...t},...n,children:e},r))})}const Mt=Y;function Nt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=ze();return l(S,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}export{Ve as Artwork,He as CollapsableItem,lt as DarkModeToggle,ut as DropdownMenu,_t as DropdownMenu2,vt as DropdownMenuExternalLink,yt as DropdownMenuInternalLink,gt as DropdownMenuItem,F as ExternalLink,I as FileInput,Ke as FileInputList,Ue as FileType,bt as IconWithPopover,Q as InternalLink,xt as ListItemInternalLink,St as Loader,Ct as LoaderData,wt as LoaderError,Tt as LoaderProvider,Je as ModeProvider,nt as ModeToggle,rt as NavigationBottom,At as NavigationDrawer,it as Page,jt as PopoverText,Mt as QueryBoundary,H as QueryBoundaryData,U as QueryBoundaryDataMap,W as QueryBoundaryError,K as QueryBoundaryFallback,ot as QueryBoundaryMap,G as QueryBoundaryNullable,q as QueryBoundaryProvider,Y as QueryBoundaryWrapper,st as ReactPlayground,Qe as ScreenSizeProvider,ct as SkeletonRow,tt as SnackbarProvider,Nt as SubmitButton,L as SwitchWithIcons,J as createQueryBoundary,Z as useDropdownMenu,at as useHash,z as useMode,Ze as useScreenSize,et as useSnackbar};
1
+ import e from"@mui/material/Box";import t from"@mui/material/Card";import n from"@mui/material/CardContent";import r from"@mui/material/CardHeader";import i from"@mui/material/Chip";import a from"@mui/material/Divider";import o from"@mui/material/Stack";import s from"@mui/material/Typography";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import d from"@mui/material/ButtonBase";import f from"@mui/material/Collapse";import{Fragment as p,createContext as m,useCallback as h,useContext as g,useEffect as _,useId as v,useMemo as y,useRef as ee,useState as b}from"react";import{MdArrowDropDown as te,MdArrowDropUp as ne,MdChevronLeft as re,MdChevronRight as ie,MdCloudUpload as ae,MdDelete as oe,MdMenu as se,MdOutlineDarkMode as ce,MdOutlineLightMode as le,MdVisibility as ue}from"react-icons/md";import x from"@mui/material/Link";import S from"@mui/material/Button";import{ThemeProvider as de,createTheme as fe,styled as C,useTheme as pe}from"@mui/material/styles";import w from"@mui/material/IconButton";import me from"@mui/material/List";import he from"@mui/material/ListItem";import ge from"@mui/material/ListItemText";import _e from"@mui/material/Tooltip";import ve from"@mui/material/Switch";import{DataError as T}from"@alextheman/utility/v6";import E from"@mui/material/CssBaseline";import D from"@mui/material/CircularProgress";import O from"@mui/material/Alert";import{fillArray as ye,truncate as k,wait as be}from"@alextheman/utility";import xe from"@mui/material/Snackbar";import Se from"@mui/material/BottomNavigation";import Ce from"@mui/material/BottomNavigationAction";import we from"@mui/material/Paper";import{Link as A,useLocation as Te}from"react-router-dom";import{stripIndent as Ee}from"common-tags";import{LiveEditor as De,LiveError as Oe,LivePreview as ke,LiveProvider as Ae}from"react-live";import je from"@mui/material/Skeleton";import Me from"@mui/material/TableCell";import Ne from"@mui/material/TableRow";import j from"@mui/material/Menu";import Pe from"@mui/material/AppBar";import Fe from"@mui/material/Drawer";import M from"@mui/material/ListItemButton";import Ie from"@mui/material/ListItemIcon";import Le from"@mui/material/Toolbar";import N from"@mui/material/MenuItem";import Re from"@mui/material/Popover";import{useFormContext as ze}from"react-hook-form";function P({containerLabel:e,chipLabels:r}){return l(t,{sx:{width:320,height:420,backgroundColor:`rgba(255,255,255,0.07)`,backdropFilter:`blur(8px)`,border:`1px solid rgba(255,255,255,0.06)`,boxShadow:`0 10px 40px rgba(0,0,0,0.35)`},children:u(n,{children:[l(s,{variant:`h6`,gutterBottom:!0,sx:{color:`#f8fafc`},children:e}),l(o,{spacing:1,children:r.map(e=>l(i,{label:e,sx:{backgroundColor:`rgba(255,255,255,0.11)`,color:`rgba(255,255,255,0.88)`,border:`1px solid rgba(255,255,255,0.06)`}},e))})]})})}function Be(){return l(e,{sx:{width:120,height:6,borderRadius:3,background:`linear-gradient(90deg, #f43f5e, #a78bfa, #22d3ee)`,boxShadow:`0 0 24px rgba(167,139,250,0.55)`}})}function Ve(){return u(t,{sx:{width:1e3,height:1e3,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,p:4,background:`radial-gradient(circle at 20% 10%, rgba(167,139,250,0.35) 0%, rgba(167,139,250,0.12) 35%, rgba(0,0,0,0) 55%), linear-gradient(135deg, #3a3380 0%, #1d2e5f 40%, #2d3f55 100%)`,color:`white`},elevation:0,children:[l(r,{title:`An Interface For You And I`,sx:{color:`#f8fafc`,textAlign:`center`,"& .MuiCardHeader-title":{fontSize:40,fontWeight:600,letterSpacing:2}}}),l(a,{sx:{borderColor:`rgba(255,255,255,0.2)`}}),l(n,{sx:{flex:1,display:`flex`,alignItems:`center`},children:u(o,{direction:`row`,spacing:4,sx:{width:`100%`,justifyContent:`center`,alignItems:`center`},children:[l(P,{containerLabel:`You`,chipLabels:[`state`,`context`,`input`,`event`,`focus`,`value`,`history`]}),l(Be,{}),l(P,{containerLabel:`I`,chipLabels:[`render`,`effect`,`response`,`update`,`history`,`layout`,`provider`]})]})})]})}function He({isInitiallyOpen:t,onOpen:n,onClose:r,children:i,buttonStyles:a,buttonContents:o,buttonComponent:s=d,collapseProps:c,openIcon:p=l(ne,{}),closedIcon:m=l(te,{}),useDefaultStyling:h=s===d}){let[g,v]=b(!!t);return _(()=>{g&&n?n():!g&&r&&r()},[g]),u(e,{children:[u(s,{onClick:()=>{v(e=>!e)},sx:h?{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,paddingY:1.5,paddingX:2,textAlign:`center`,"&:hover":s===d?{backgroundColor:`action.hover`}:null,...a}:a,"aria-expanded":g,children:[o,g?p:m]}),l(f,{in:g,...c,children:i})]})}function F({href:e,children:t,ref:n,...r}){return l(x,{component:`a`,href:e,ref:n,target:`_blank`,rel:`noopener noreferrer`,...r,children:t})}const Ue={PDF:`application/pdf`,PNG:`image/png`,JPEG:`image/jpeg`,JPG:`image/jpg`,XLSX:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,DOCX:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,MP3:`audio/mp3`,MP4:`video/mp4`,WAV:`audio/wav`},We=C(`input`)({clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:1,overflow:`hidden`,position:`absolute`,bottom:0,left:0,whiteSpace:`nowrap`,width:1}),Ge=C(`div`)(({theme:e,$dragging:t})=>({border:`2px dashed`,borderColor:t?e.palette.primary.main:`#ccc`,backgroundColor:t?e.palette.action.hover:`transparent`,borderRadius:8,padding:`1.5rem`,textAlign:`center`,transition:`border-color 0.2s`,cursor:`pointer`}));function I({onFileInput:e,label:t=`Upload files`,multiple:n,accept:r,useDropzone:i,...a}){let[o,s]=b(!1),c=v(),d=u(S,{variant:`contained`,component:`label`,"aria-label":`File input button`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),document.getElementById(c)?.click())},...a,startIcon:a.startIcon??l(ae,{}),children:[t,l(We,{id:c,type:`file`,onChange:t=>{let n=t.target;e(Array.from(n.files??[])),n.value=``},multiple:n,accept:r?.join(`,`),disabled:a.disabled})]});return i?l(Ge,{$dragging:o,onDragOver:e=>{e.preventDefault(),!a.disabled&&s(!0)},onDragLeave:e=>{e.preventDefault(),s(!1)},onDrop:t=>{t.preventDefault(),s(!1),!a.disabled&&e(Array.from(t.dataTransfer.files??[]))},children:d}):d}function Ke({files:t,setFiles:n,multiple:r=!0,...i}){function a(e){n(t=>[...t,...e])}return u(e,{children:[l(I,{...i,multiple:r,onFileInput:a}),l(me,{children:t.map(e=>l(he,{secondaryAction:l(w,{"aria-label":`Delete`,edge:`end`,onClick:()=>{n(t=>t.filter(t=>t!==e))},children:l(oe,{})}),children:l(ge,{primary:e.name})},`${e.name}-${e.lastModified}`))})]})}const qe=C(ve)(()=>({padding:8,"& .MuiSwitch-track":{borderRadius:11,"&::before, &::after":{content:`""`,position:`absolute`,top:`50%`,transform:`translateY(-50%)`,fontSize:16,width:28,height:28}}}));function L({checkedIcon:t,checkedIconStyles:n,uncheckedIcon:r,uncheckedIconStyles:i,...a}){let o={borderRadius:`50%`,borderColor:`white`,backgroundColor:`white`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:.25},s={color:`black`,maxWidth:16.5,maxHeight:16.5};return l(qe,{checkedIcon:l(e,{sx:o,children:l(t,{style:{...s,...n}})}),icon:l(e,{sx:o,children:l(r,{style:{...s,...i}})}),...a})}const R=m({toggleMode:()=>{},mode:`dark`});function z({strict:e=!0}={}){let t=g(R);if(e&&!t)throw new T({strict:e,context:t},`MODE_PROVIDER_NOT_FOUND`,`Could not find the ModeProvider context. Please double-check that it is present.`);return t}function Je({children:e,mode:t=`dark`}){let[n,r]=b(t),i=y(()=>fe({palette:{mode:n},components:{MuiPaper:{styleOverrides:{root:({theme:e})=>({border:1,borderStyle:`solid`,borderColor:e.palette.divider})}}}}),[n]);return l(R.Provider,{value:{mode:n,toggleMode:()=>{r(e=>e===`light`?`dark`:`light`)}},children:u(de,{theme:i,children:[l(E,{}),e]})})}const B=m(void 0);function V({strict:e=!0}={}){let t=g(B);if(e&&!t)throw new T({strict:e,context:t},`QUERY_BOUNDARY_PROVIDER_NOT_FOUND`,`Could not find the QueryBoundaryProvider context. Please double-check that it is present.`);return t}function Ye({children:e,loadingComponent:t=l(D,{}),...n}){return l(B.Provider,{value:{loadingComponent:t,...n},children:e})}function H({children:e,dataParser:t,loadingComponent:n}){let{isLoading:r,data:i,dataParser:a,loadingComponent:o,error:s}=V(),u=t??a;return s?null:r?l(c,{children:n??o}):i==null?null:l(c,{children:typeof e==`function`?e(u?u(i):i):e})}function U({children:e,loadingComponent:t,itemKey:n,itemParser:r,dataParser:i,emptyComponent:a=l(s,{children:`No data present`}),strictlyRequireArray:o=!0}){let{isLoading:u,data:d,dataParser:f,loadingComponent:m,error:h}=V(),g=i??f,_=t??m;if(u)return l(c,{children:_});if(h||d==null)return null;if(!Array.isArray(d)){if(o)throw new T({data:d,strictlyRequireArray:o},`NOT_AN_ARRAY`,`Expected the data to be an array but it was not an array.`);return null}if(d.length===0)return l(c,{children:a});let v;return v=g?g(d):r?d.map(r):d,l(c,{children:v.map((t,r)=>l(p,{children:typeof e==`function`?e(t):e},n?n(t,r):r))})}function W({children:e,logError:t}){let{data:n,error:r,errorComponent:i,logError:a}=V(),o=t??a,s=ee(!1),u=e??i;return r?(o&&!s.current&&(n!=null&&console.error(`An error has occurred but data is still present. This may indicate an invalid query state.`,{data:n,error:r}),console.error(r),s.current=!0),typeof u==`function`?u(r):u?l(c,{children:u}):l(O,{severity:`error`,children:typeof r==`object`&&`message`in r&&typeof r.message==`string`?r.message:`An unknown error has occured. Please try again later.`})):null}function G({undefinedComponent:e,nullComponent:t,nullableComponent:n}){let{isLoading:r,data:i,error:a}=V();return r||a?null:i==null?n?l(c,{children:n}):i===void 0&&e?l(c,{children:e}):i===null&&t?l(c,{children:t}):l(O,{severity:`error`,children:`Failed to load data. Please try again later.`}):null}function K({errorComponent:e,logError:t,...n}){return u(c,{children:[l(W,{logError:t,children:e}),l(G,{...n})]})}var q=Ye;const Xe=m({windowWidth:0,windowHeight:0,isLargeScreen:!1});function Ze({strict:e=!0}={}){let t=g(Xe);if(e&&!t)throw new T({strict:e,context:t},`SCREEN_SIZE_PROVIDER_NOT_FOUND`,`Could not find the ScreenSizeProvider context. Please double-check that it is present.`);return t}function Qe({children:e,largeScreenWidth:t=669,largeScreenHeight:n=660}){let[r,i]=b(window.innerWidth),[a,o]=b(window.innerHeight);_(()=>{function e(){i(window.innerWidth),o(window.innerHeight)}return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]);let s=y(()=>r>t&&a>n,[r,a,t,n]);return l(Xe.Provider,{value:{isLargeScreen:s,windowWidth:r,windowHeight:a},children:e})}const $e=m(void 0);function et({strict:e=!0}={}){let t=g($e);if(e&&!t)throw new T({strict:e,context:t},`SNACKBAR_PROVIDER_NOT_FOUND`,`Could not find the SnackbarProvider context. Please double-check that it is present.`);return t}function tt({children:e,autoHideDuration:t=5e3}){let[n,r]=b(!1),[i,a]=b(t),[o,s]=b(``),[c,d]=b(`info`);function f(e,n,i){r(!0),a(i??t),d(n??`info`),s(e)}async function p(){r(!1),await be(.2),s(``)}return u($e.Provider,{value:{addSnackbar:f},children:[l(xe,{open:n,autoHideDuration:i,onClose:p,children:l(O,{onClose:p,severity:c,children:o})}),e]})}function nt(){let{mode:e,toggleMode:t}=z(),n=e===`dark`,r=`Enable ${n?`light`:`dark`} mode`;return l(_e,{title:r,children:l(L,{uncheckedIcon:le,checkedIcon:ce,checked:n,onChange:t,"aria-label":r})})}function rt({children:t,navItems:n}){let[r,i]=b(``);return u(c,{children:[l(e,{sx:{paddingBottom:7},children:t}),l(we,{sx:{position:`fixed`,bottom:0,left:0,right:0},children:l(Se,{showLabels:!0,value:r,onChange:(e,t)=>{i(t)},children:n.map(e=>l(Ce,{...e,component:A},e.value))})})]})}function it({title:e,subtitle:i,action:o,children:d,tabs:f,disablePadding:p}){return u(t,{children:[l(r,{title:u(c,{children:[typeof e==`string`?l(s,{variant:`h6`,children:e}):e,i?typeof i==`string`?l(s,{variant:`body2`,color:`text.secondary`,children:i}):i:null]}),action:o}),f,l(a,{}),p?d:l(n,{children:d})]})}function J({query:e}){return{Context:({children:t})=>l(q,{isLoading:e.isLoading,error:e.error,data:e.data??e.dataCollection,children:t}),Error:W,Data:H,DataMap:U,Fallback:K,Nullable:G}}function at(e,t=500){let[n,r]=b(e);return _(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function ot(e){let[t,n]=b(()=>{let t=window.location.hash.replace(`#`,``);return e&&t===``?e:t}),r=h(()=>{let t=window.location.hash.replace(`#`,``);n(e&&t===``?e:t)},[n,e]);return _(()=>(window.addEventListener(`hashchange`,r),()=>{window.removeEventListener(`hashchange`,r)}),[r]),[t,h(e=>{let n=typeof e==`function`?e(t):e;n!==t&&(window.location.hash=n)},[t])]}function st({loadingComponent:e,undefinedComponent:t,nullComponent:n,nullableComponent:r,logError:i,errorComponent:a,children:o,isLoading:s,error:c,data:d,dataParser:f,itemParser:p,itemKey:m}){let h=J({query:{isLoading:s,error:c,dataCollection:d}}),g=l(h.Fallback,{logError:i,errorComponent:a});r?g=l(h.Fallback,{nullableComponent:r,logError:i,errorComponent:a}):(t||n)&&(g=l(h.Fallback,{undefinedComponent:t,nullComponent:n,logError:i,errorComponent:a}));let _=l(h.DataMap,{loadingComponent:e,itemKey:m,children:o});return f?_=l(h.DataMap,{loadingComponent:e,itemKey:m,dataParser:f,children:o}):p&&(_=l(h.DataMap,{loadingComponent:e,itemKey:m,itemParser:p,children:o})),u(h.Context,{children:[g,_]})}function Y({children:e,errorComponent:t,undefinedComponent:n,nullComponent:r,nullableComponent:i,logError:a,loadingComponent:o=l(D,{}),isLoading:s,error:c,data:d,dataParser:f}){let p=J({query:{isLoading:s,error:c,data:d}}),m=l(p.Fallback,{logError:a,errorComponent:t});return i?m=l(p.Fallback,{nullableComponent:i,logError:a,errorComponent:t}):(n||r)&&(m=l(p.Fallback,{undefinedComponent:n,nullComponent:r,logError:a,errorComponent:t})),u(p.Context,{children:[m,l(p.Data,{loadingComponent:o,dataParser:f,children:e})]})}function ct({code:t,previewStyles:n,...r}){let{mode:i}=z(),a={backgroundColor:i===`dark`?`black`:`white`,border:.3,borderRadius:1,padding:2,borderColor:`darkgray`},o=n?{...a,...n}:{...a};return l(e,{sx:{borderRadius:1,border:.5,padding:2},children:u(Ae,{...r,code:Ee(t??``),children:[l(s,{variant:`h5`,children:`Code`}),l(e,{sx:{border:.3,borderRadius:.3,borderColor:`darkgray`},children:l(De,{})}),l(`br`,{}),l(s,{variant:`h5`,children:`Result`}),u(e,{sx:o,children:[l(ke,{}),l(Oe,{})]})]})})}function lt({columns:e}){return l(Ne,{children:ye(e=>l(Me,{children:l(je,{})},e),e)})}const ut=nt;function dt({children:t,button:n=S,buttonChildren:r=`Menu`,buttonProps:i,isOpenIcon:a=l(ne,{}),isClosedIcon:o=l(te,{}),onOpen:s,onClose:c}){let[d,f]=b(null),p=y(()=>!!d,[d]),m={...i,onClick:e=>{f(e.currentTarget)},"aria-controls":p?`dropdown-menu`:void 0,"aria-haspopup":`true`,"aria-expanded":p};return n===S&&(m.endIcon=p?a:o),_(()=>{p&&s?s():!p&&c&&c()},[p,s,c]),u(e,{children:[l(n,{...m,children:r}),l(j,{id:`dropdown-menu`,anchorEl:d,open:p,onClose:()=>{f(null)},children:typeof t==`function`?l(e,{children:t(()=>{f(null)})}):t})]})}const ft=m(void 0);function X({strict:e=!0}={}){let t=g(ft);if(e&&!t)throw new T({strict:e,context:t},`DROPDOWN_MENU_NOT_FOUND`,`Could not find the DropdownMenu context. Please double-check that it is present.`);return t}function pt({strict:e=!0}={}){return X({strict:e})}function mt({children:e,onClose:t,...n}){let{anchorElement:r,isDropdownOpen:i,closeMenu:a}=pt();return l(j,{anchorEl:r,open:i,onClose:(e,n)=>{e.defaultPrevented||a(),t&&t(e,n)},...n,children:e})}function ht({component:e,children:t,ref:n,onClick:r,...i}){let{closeMenu:a}=X();return l(N,{component:e,ref:n,...i,onClick:e=>{r&&r(e),!e.defaultPrevented&&a()},children:t})}const Z=X,gt=mt,_t=ht;var vt=gt;function yt({ref:e,href:t,children:n,onClick:r,...i}){let{closeMenu:a}=Z();return l(N,{component:F,href:t,ref:e,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function Q({to:e,component:t=A,children:n,ref:r,...i}){return l(x,{component:t,to:e,ref:r,...i,children:n})}function bt({to:e,ref:t,children:n,onClick:r,...i}){let{closeMenu:a}=Z();return l(N,{component:Q,to:e,ref:t,...i,onClick:e=>{e.defaultPrevented||a(),r&&r(e)},children:n})}function xt({icon:t=ue,onOpen:n,onClose:r,iconProps:i,children:a}){let[o,s]=b(null),c=!!o,d=v();function f(e){s(e.currentTarget),n&&n()}function p(){s(null),r&&r()}return u(e,{children:[l(t,{"aria-owns":c?d:void 0,"aria-haspopup":`true`,onMouseEnter:f,onMouseLeave:p,...i}),l(Re,{id:d,disablePortal:!0,disableScrollLock:!0,slotProps:{root:{disableEnforceFocus:!0,disableAutoFocus:!0,disableRestoreFocus:!0}},sx:{pointerEvents:`none`},open:c,anchorEl:o,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},onClose:p,disableRestoreFocus:!0,children:a})]})}function St({children:e,...t}){return l(M,{component:Q,...t,children:e})}const Ct=Y,wt=H,Tt=K,Et=q;function Dt(e){return{width:240,transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:`hidden`}}function Ot(e){return{transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:`hidden`,width:`calc(${e.spacing(7)} + 1px)`,[e.breakpoints.up(`sm`)]:{width:`calc(${e.spacing(8)} + 1px)`}}}const $=C(`div`)(({theme:e})=>({display:`flex`,alignItems:`center`,justifyContent:`flex-end`,padding:e.spacing(0,1),...e.mixins.toolbar})),kt=C(Pe,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({zIndex:e.zIndex.drawer+1,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{marginLeft:240,width:`calc(100% - 240px)`,transition:e.transitions.create([`width`,`margin`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}}]})),At=C(Fe,{shouldForwardProp:e=>e!==`open`})(({theme:e})=>({width:240,flexShrink:0,whiteSpace:`nowrap`,boxSizing:`border-box`,variants:[{props:({open:e})=>e,style:{...Dt(e),"& .MuiDrawer-paper":Dt(e)}},{props:({open:e})=>!e,style:{...Ot(e),"& .MuiDrawer-paper":Ot(e)}}]}));function jt({title:t,navItems:n,children:r,headerElements:i}){let o=pe(),[c,d]=b(!0),f=Te();function m(){d(!0)}function h(){d(!1)}return u(e,{sx:{display:`flex`},children:[l(E,{}),l(kt,{position:`fixed`,open:c,children:u(Le,{children:[l(w,{color:`inherit`,"aria-label":`open drawer`,onClick:m,edge:`start`,sx:[{marginRight:5},c&&{display:`none`}],children:l(se,{})}),l(s,{variant:`h6`,noWrap:!0,component:`div`,children:t}),i]})}),u(At,{variant:`permanent`,open:c,children:[l($,{children:l(w,{onClick:h,children:o.direction===`rtl`?l(ie,{}):l(re,{})})}),l(a,{}),n.map(e=>u(p,{children:[u(me,{children:[l(s,{variant:c?`h5`:`h6`,sx:{paddingLeft:c?2:1},children:c?e.category:k(e.category,4)}),e.options.map(e=>l(he,{disablePadding:!0,sx:{display:`block`},children:u(M,{sx:[{minHeight:48,px:2.5},c?{justifyContent:`initial`}:{justifyContent:`center`}],component:A,to:e.to,selected:f.pathname===e.to,children:[l(Ie,{sx:[{minWidth:0,justifyContent:`center`},c?{mr:3}:{mr:`auto`}],children:e.icon?e.icon:c?null:l(s,{children:k(e.label,4)})}),l(ge,{primary:e.label,sx:[c?{opacity:1}:{opacity:0}]})]})},e.to))]}),l(a,{})]},e.category))]}),u(e,{component:`main`,sx:{flexGrow:1,p:3},children:[l($,{}),r]})]})}function Mt({text:e,sx:t,...n}){return l(c,{children:e.split(`
2
+ `).map((e,r)=>l(s,{sx:{margin:1,...t},...n,children:e},r))})}const Nt=Y;function Pt({disableClean:e,label:t,...n}){let{formState:{disabled:r,isDirty:i,isSubmitting:a}}=ze();return l(S,{color:`primary`,disabled:n.disabled||e&&!i||r,loading:a,type:`submit`,variant:`contained`,...n,children:t})}export{Ve as Artwork,He as CollapsableItem,ut as DarkModeToggle,dt as DropdownMenu,vt as DropdownMenu2,yt as DropdownMenuExternalLink,bt as DropdownMenuInternalLink,_t as DropdownMenuItem,F as ExternalLink,I as FileInput,Ke as FileInputList,Ue as FileType,xt as IconWithPopover,Q as InternalLink,St as ListItemInternalLink,Ct as Loader,wt as LoaderData,Tt as LoaderError,Et as LoaderProvider,Je as ModeProvider,nt as ModeToggle,rt as NavigationBottom,jt as NavigationDrawer,it as Page,Mt as PopoverText,Nt as QueryBoundary,H as QueryBoundaryData,U as QueryBoundaryDataMap,W as QueryBoundaryError,K as QueryBoundaryFallback,st as QueryBoundaryMap,G as QueryBoundaryNullable,q as QueryBoundaryProvider,Y as QueryBoundaryWrapper,ct as ReactPlayground,Qe as ScreenSizeProvider,lt as SkeletonRow,tt as SnackbarProvider,Pt as SubmitButton,L as SwitchWithIcons,J as createQueryBoundary,at as useDebounce,Z as useDropdownMenu,ot as useHash,z as useMode,V as useQueryBoundary,Ze as useScreenSize,et as useSnackbar};
3
3
  //# sourceMappingURL=index.js.map