@opennsw/jsonforms-renderers 0.3.1 → 0.5.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/README.md +3 -3
- package/dist/index.d.ts +37 -3
- package/dist/jsonforms-renderers.css +1 -1
- package/dist/renderers.cjs.js +2 -2
- package/dist/renderers.es.js +1350 -819
- package/package.json +37 -12
package/README.md
CHANGED
|
@@ -37,14 +37,14 @@ To use the custom renderers, register them inside the `<JsonForms>` provider in
|
|
|
37
37
|
|
|
38
38
|
```tsx
|
|
39
39
|
import { JsonForms } from '@jsonforms/react'
|
|
40
|
-
import {
|
|
41
|
-
materialCells, // fallback cells
|
|
40
|
+
import {
|
|
41
|
+
materialCells, // fallback cells
|
|
42
42
|
} from '@jsonforms/material-renderers' // or other fallbacks
|
|
43
43
|
import openNswRenderers from '@opennsw/jsonforms-renderers'
|
|
44
44
|
|
|
45
45
|
function App() {
|
|
46
46
|
const [data, setData] = useState({})
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
return (
|
|
49
49
|
<JsonForms
|
|
50
50
|
schema={schema}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
import { ControlProps } from '@jsonforms/core';
|
|
3
3
|
import { JsonSchema } from '@jsonforms/core';
|
|
4
|
-
import { JSX } from 'react
|
|
4
|
+
import { JSX } from 'react';
|
|
5
5
|
import { LayoutProps } from '@jsonforms/core';
|
|
6
6
|
import { OwnPropsOfControl } from '@jsonforms/core';
|
|
7
7
|
import { RankedTester } from '@jsonforms/core';
|
|
@@ -41,8 +41,6 @@ export declare const FileControlTester: (uischema: UISchemaElement, schema: Json
|
|
|
41
41
|
|
|
42
42
|
export declare type GetDownloadUrl = (key: string) => Promise<DownloadUrlResult>;
|
|
43
43
|
|
|
44
|
-
export declare const getErrorMessage: (errors: string, label?: string) => string;
|
|
45
|
-
|
|
46
44
|
export declare const GroupLayoutRenderer: ({ uischema, schema, path, renderers, cells, enabled, visible, }: LayoutProps) => JSX.Element | null;
|
|
47
45
|
|
|
48
46
|
export declare const GroupLayoutTester: RankedTester;
|
|
@@ -71,10 +69,44 @@ export declare const radixRenderers: ({
|
|
|
71
69
|
renderer: ({ uischema, schema, path, renderers, cells, enabled, visible, }: CategorizationLayoutProps) => JSX.Element | null;
|
|
72
70
|
})[];
|
|
73
71
|
|
|
72
|
+
export declare interface SearchOption {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare interface SearchResult {
|
|
78
|
+
options: SearchOption[];
|
|
79
|
+
nextCursor?: unknown;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare const SearchSelectControl: React_2.ComponentType<OwnPropsOfControl>;
|
|
83
|
+
|
|
84
|
+
export declare const SearchSelectControlTester: (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
85
|
+
|
|
86
|
+
export declare interface SearchService {
|
|
87
|
+
search(args: {
|
|
88
|
+
query: string;
|
|
89
|
+
cursor?: unknown;
|
|
90
|
+
signal: AbortSignal;
|
|
91
|
+
}): Promise<SearchResult>;
|
|
92
|
+
resolve?(value: string): Promise<SearchOption | undefined>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export declare function SearchServiceProvider({ children, services, }: {
|
|
96
|
+
children: ReactNode;
|
|
97
|
+
services: SearchServiceRegistry;
|
|
98
|
+
}): JSX.Element;
|
|
99
|
+
|
|
100
|
+
export declare type SearchServiceRegistry = Record<string, SearchService>;
|
|
101
|
+
|
|
74
102
|
export declare const SelectControl: ({ data, handleChange, path, label, required, errors, schema, uischema, enabled, visible, }: ControlProps) => JSX.Element | null;
|
|
75
103
|
|
|
76
104
|
export declare const SelectControlTester: RankedTester;
|
|
77
105
|
|
|
106
|
+
export declare const SpreadsheetControl: ComponentType<OwnPropsOfControl>;
|
|
107
|
+
|
|
108
|
+
export declare const SpreadsheetControlTester: (uischema: UISchemaElement, schema: JsonSchema, context: TesterContext) => number;
|
|
109
|
+
|
|
78
110
|
export declare const TextControl: ({ data, handleChange, path, label, required, errors, uischema, schema, enabled, visible, }: ControlProps) => JSX.Element | null;
|
|
79
111
|
|
|
80
112
|
export declare const TextControlTester: RankedTester;
|
|
@@ -101,6 +133,8 @@ export declare interface UploadResponse {
|
|
|
101
133
|
name?: string;
|
|
102
134
|
}
|
|
103
135
|
|
|
136
|
+
export declare function useSearchService(name: string | undefined): SearchService | null;
|
|
137
|
+
|
|
104
138
|
export declare function useUpload(): UploadContextValue | null;
|
|
105
139
|
|
|
106
140
|
export declare const VerticalLayoutRenderer: ({ uischema, schema, path, renderers, cells, enabled, visible, }: LayoutProps) => JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tailwindcss v4.1
|
|
1
|
+
/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-300:oklch(80.8% .114 19.571);--color-blue-50:oklch(97% .014 254.604);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--spacing:.25rem;--font-weight-semibold:600;--tracking-wide:.025em;--radius-lg:.5rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-1{margin-top:var(--spacing)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-blue-500{border-color:var(--color-blue-500)}.border-gray-300{border-color:var(--color-gray-300)}.border-red-300{border-color:var(--color-red-300)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-red-50{background-color:var(--color-red-50)}.p-6{padding:calc(var(--spacing) * 6)}.text-center{text-align:center}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-gray-500{color:var(--color-gray-500)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}@media(hover:hover){.hover\:border-blue-400:hover{border-color:var(--color-blue-400)}.hover\:bg-\(--gray-3\):hover{background-color:var(--gray-3)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}
|
package/dist/renderers.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";var ct=Object.create;var ge=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var ft=(e,n,r)=>n in e?ge(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var ht=(e,n,r,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let h of ut(n))!xt.call(e,h)&&h!==r&&ge(e,h,{get:()=>n[h],enumerable:!(a=at(n,h))||a.enumerable});return e};var ve=(e,n,r)=>(r=e!=null?ct(dt(e)):{},ht(n||!e||!e.__esModule?ge(r,"default",{value:e,enumerable:!0}):r,e));var be=(e,n,r)=>ft(e,typeof n!="symbol"?n+"":n,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),v=require("react"),y=require("@jsonforms/core"),W=require("@jsonforms/react"),o=require("@radix-ui/themes"),_=require("@radix-ui/react-icons"),pt=require("dayjs"),je=require("@e965/xlsx"),Se=v.createContext(null);function gt({children:e,onUpload:n,getDownloadUrl:r}){const a={onUpload:n,getDownloadUrl:r};return t.jsx(Se.Provider,{value:a,children:e})}function Ae(){return v.useContext(Se)}const Fe=v.createContext(null);function mt({children:e,services:n}){const r=v.useMemo(()=>n,[n]);return t.jsx(Fe.Provider,{value:r,children:e})}function Ne(e){const n=v.useContext(Fe);return!n||!e?null:n[e]??null}const ce=(e,n,r,a=void 0)=>{v.useEffect(()=>{e===!1&&r(n,a)},[e,n,r,a])},ne=(e,n)=>e?e.split(`
|
|
2
2
|
`).map(r=>r.trim()==="is a required property"?`${n||"This field"} is required`:r).join(`
|
|
3
|
-
`):"",ue=({data:s,handleChange:n,path:r,label:y,required:F,errors:w,uischema:u,schema:S,enabled:h,visible:x=!0})=>{var D;if(R.useEffect(()=>{x===!1&&n(r,void 0)},[x,r,n]),x===!1)return null;const f=w.length===0;return e.jsx(t.Box,{mb:"4",children:e.jsxs(t.Flex,{direction:"column",gap:"1",children:[e.jsxs(t.Text,{as:"label",size:"2",weight:"bold",htmlFor:r,children:[y," ",F&&e.jsx(t.Text,{color:"red",children:"*"})]}),e.jsx(t.TextField.Root,{value:s||"",onChange:b=>n(r,b.target.value),disabled:!h,placeholder:(D=u.options)==null?void 0:D.placeholder,color:f?void 0:"red",id:r}),!f&&e.jsx(t.Text,{color:"red",size:"1",children:q(w,y)}),S.description&&e.jsx(t.Text,{size:"1",color:"gray",children:S.description})]})})},de=C.rankWith(1,C.isStringControl),Be=E.withJsonFormsControlProps(ue),fe=({data:s,handleChange:n,path:r,label:y,required:F,errors:w,uischema:u,schema:S,enabled:h,visible:x=!0})=>{var b;if(R.useEffect(()=>{x===!1&&n(r,void 0)},[x,r,n]),x===!1)return null;const f=w.length===0,D=v=>{if(v===""){n(r,void 0);return}const m=Number(v);isNaN(m)||n(r,m)};return e.jsx(t.Box,{mb:"4",children:e.jsxs(t.Flex,{direction:"column",gap:"1",children:[e.jsxs(t.Text,{as:"label",size:"2",weight:"bold",htmlFor:r,children:[y," ",F&&e.jsx(t.Text,{color:"red",children:"*"})]}),e.jsx(t.TextField.Root,{type:"number",value:s??"",onChange:v=>D(v.target.value),disabled:!h,placeholder:(b=u.options)==null?void 0:b.placeholder,color:f?void 0:"red",id:r}),!f&&e.jsx(t.Text,{color:"red",size:"1",children:q(w,y)}),S.description&&e.jsx(t.Text,{size:"1",color:"gray",children:S.description})]})})},xe=C.rankWith(2,C.or(C.isNumberControl,C.isIntegerControl)),Ie=E.withJsonFormsControlProps(fe),he=({data:s,handleChange:n,path:r,label:y,required:F,errors:w,schema:u,enabled:S,visible:h=!0})=>{if(R.useEffect(()=>{h===!1&&n(r,void 0)},[h,r,n]),h===!1)return null;const x=w.length===0;return e.jsxs(t.Box,{mb:"4",children:[e.jsxs(t.Flex,{gap:"2",align:"center",children:[e.jsx(t.Checkbox,{checked:!!s,onCheckedChange:f=>n(r,f===!0),disabled:!S,id:r}),e.jsxs(t.Text,{as:"label",size:"2",htmlFor:r,children:[y," ",F&&"*"]})]}),!x&&e.jsx(t.Text,{color:"red",size:"1",className:"block mt-1",children:q(w,y)}),u.description&&e.jsx(t.Text,{size:"1",color:"gray",className:"block mt-1",children:u.description})]})},me=C.rankWith(2,C.isBooleanControl),Ue=E.withJsonFormsControlProps(he),pe=({data:s,handleChange:n,path:r,label:y,required:F,errors:w,schema:u,enabled:S,visible:h=!0})=>{if(R.useEffect(()=>{h===!1&&n(r,void 0)},[h,r,n]),h===!1)return null;const x=w.length===0;let f=[];u.enum?f=u.enum.map(b=>({value:b,label:String(b)})):u.oneOf&&(f=u.oneOf.map(b=>({value:b.const,label:b.title||String(b.const)})));const D=s;return e.jsx(t.Box,{mb:"4",children:e.jsxs(t.Flex,{direction:"column",gap:"1",children:[e.jsxs(t.Text,{as:"div",size:"2",weight:"bold",children:[y," ",F&&e.jsx(t.Text,{color:"red",children:"*"})]}),e.jsx(t.RadioGroup.Root,{value:D!==void 0?String(D):"",onValueChange:b=>{const v=f.find(m=>String(m.value)===b);v&&n(r,v.value)},disabled:!S,children:e.jsx(t.Flex,{direction:"row",style:{flexWrap:"wrap",columnGap:"clamp(14px, 3vw, 36px)",rowGap:"clamp(8px, 1.6vw, 14px)"},children:f.map(b=>e.jsxs(t.Flex,{align:"center",gap:"2",style:{minWidth:"max-content"},children:[e.jsx(t.RadioGroup.Item,{value:String(b.value)}),e.jsx(t.Text,{size:"2",color:S?void 0:"gray",children:b.label})]},String(b.value)))})}),!x&&e.jsx(t.Text,{color:"red",size:"1",children:q(w,y)}),u.description&&e.jsx(t.Text,{size:"1",color:"gray",children:u.description})]})})},ge=(s,n,r)=>{var F;return C.or(C.isEnumControl,C.isOneOfControl)(s,n,r)&&((F=s==null?void 0:s.options)==null?void 0:F.format)==="radio"?3:-1},We=E.withJsonFormsControlProps(pe),ye=({data:s,handleChange:n,path:r,label:y,required:F,errors:w,schema:u,uischema:S,enabled:h,visible:x=!0})=>{var v;if(R.useEffect(()=>{x===!1&&n(r,void 0)},[x,r,n]),x===!1)return null;const f=w.length===0;let D=[];u.enum?D=u.enum.map(m=>({value:String(m),label:String(m)})):u.oneOf&&(D=u.oneOf.map(m=>({value:String(m.const),label:m.title||String(m.const)})));const b=s!==void 0?String(s):"";return e.jsx(t.Box,{mb:"4",children:e.jsxs(t.Flex,{direction:"column",gap:"1",children:[e.jsxs(t.Text,{as:"label",size:"2",weight:"bold",htmlFor:r,children:[y," ",F&&e.jsx(t.Text,{color:"red",children:"*"})]}),e.jsxs(t.Select.Root,{value:b,onValueChange:m=>n(r,m),disabled:!h,children:[e.jsx(t.Select.Trigger,{placeholder:((v=S.options)==null?void 0:v.placeholder)||"Select an option",color:f?void 0:"red",id:r}),e.jsx(t.Select.Content,{children:D.map(m=>e.jsx(t.Select.Item,{value:m.value,children:m.label},m.value))})]}),!f&&e.jsx(t.Text,{color:"red",size:"1",children:q(w,y)}),u.description&&e.jsx(t.Text,{size:"1",color:"gray",children:u.description})]})})},je=C.rankWith(2,C.or(C.isEnumControl,C.isOneOfControl)),_e=E.withJsonFormsControlProps(ye);function Ee(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var se={exports:{}},Ve=se.exports,le;function Pe(){return le||(le=1,(function(s,n){(function(r,y){s.exports=y()})(Ve,(function(){var r=1e3,y=6e4,F=36e5,w="millisecond",u="second",S="minute",h="hour",x="day",f="week",D="month",b="quarter",v="year",m="date",A="Invalid Date",B=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,M=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(d){var a=["th","st","nd","rd"],o=d%100;return"["+d+(a[(o-20)%10]||a[o]||a[0])+"]"}},Y=function(d,a,o){var c=String(d);return!c||c.length>=a?d:""+Array(a+1-c.length).join(o)+d},G={s:Y,z:function(d){var a=-d.utcOffset(),o=Math.abs(a),c=Math.floor(o/60),i=o%60;return(a<=0?"+":"-")+Y(c,2,"0")+":"+Y(i,2,"0")},m:function d(a,o){if(a.date()<o.date())return-d(o,a);var c=12*(o.year()-a.year())+(o.month()-a.month()),i=a.clone().add(c,D),p=o-i<0,g=a.clone().add(c+(p?-1:1),D);return+(-(c+(o-i)/(p?i-g:g-i))||0)},a:function(d){return d<0?Math.ceil(d)||0:Math.floor(d)},p:function(d){return{M:D,y:v,w:f,d:x,D:m,h,m:S,s:u,ms:w,Q:b}[d]||String(d||"").toLowerCase().replace(/s$/,"")},u:function(d){return d===void 0}},P="en",I={};I[P]=O;var X="$isDayjsObject",Q=function(d){return d instanceof H||!(!d||!d[X])},N=function d(a,o,c){var i;if(!a)return P;if(typeof a=="string"){var p=a.toLowerCase();I[p]&&(i=p),o&&(I[p]=o,i=p);var g=a.split("-");if(!i&&g.length>1)return d(g[0])}else{var l=a.name;I[l]=a,i=l}return!c&&i&&(P=i),i||!c&&P},z=function(d,a){if(Q(d))return d.clone();var o=typeof a=="object"?a:{};return o.date=d,o.args=arguments,new H(o)},T=G;T.l=N,T.i=Q,T.w=function(d,a){return z(d,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var H=(function(){function d(o){this.$L=N(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[X]=!0}var a=d.prototype;return a.parse=function(o){this.$d=(function(c){var i=c.date,p=c.utc;if(i===null)return new Date(NaN);if(T.u(i))return new Date;if(i instanceof Date)return new Date(i);if(typeof i=="string"&&!/Z$/i.test(i)){var g=i.match(B);if(g){var l=g[2]-1||0,j=(g[7]||"0").substring(0,3);return p?new Date(Date.UTC(g[1],l,g[3]||1,g[4]||0,g[5]||0,g[6]||0,j)):new Date(g[1],l,g[3]||1,g[4]||0,g[5]||0,g[6]||0,j)}}return new Date(i)})(o),this.init()},a.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},a.$utils=function(){return T},a.isValid=function(){return this.$d.toString()!==A},a.isSame=function(o,c){var i=z(o);return this.startOf(c)<=i&&i<=this.endOf(c)},a.isAfter=function(o,c){return z(o)<this.startOf(c)},a.isBefore=function(o,c){return this.endOf(c)<z(o)},a.$g=function(o,c,i){return T.u(o)?this[c]:this.set(i,o)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(o,c){var i=this,p=!!T.u(c)||c,g=T.p(o),l=function(K,W){var J=T.w(i.$u?Date.UTC(i.$y,W,K):new Date(i.$y,W,K),i);return p?J:J.endOf(x)},j=function(K,W){return T.w(i.toDate()[K].apply(i.toDate("s"),(p?[0,0,0,0]:[23,59,59,999]).slice(W)),i)},k=this.$W,$=this.$M,L=this.$D,U="set"+(this.$u?"UTC":"");switch(g){case v:return p?l(1,0):l(31,11);case D:return p?l(1,$):l(0,$+1);case f:var _=this.$locale().weekStart||0,V=(k<_?k+7:k)-_;return l(p?L-V:L+(6-V),$);case x:case m:return j(U+"Hours",0);case h:return j(U+"Minutes",1);case S:return j(U+"Seconds",2);case u:return j(U+"Milliseconds",3);default:return this.clone()}},a.endOf=function(o){return this.startOf(o,!1)},a.$set=function(o,c){var i,p=T.p(o),g="set"+(this.$u?"UTC":""),l=(i={},i[x]=g+"Date",i[m]=g+"Date",i[D]=g+"Month",i[v]=g+"FullYear",i[h]=g+"Hours",i[S]=g+"Minutes",i[u]=g+"Seconds",i[w]=g+"Milliseconds",i)[p],j=p===x?this.$D+(c-this.$W):c;if(p===D||p===v){var k=this.clone().set(m,1);k.$d[l](j),k.init(),this.$d=k.set(m,Math.min(this.$D,k.daysInMonth())).$d}else l&&this.$d[l](j);return this.init(),this},a.set=function(o,c){return this.clone().$set(o,c)},a.get=function(o){return this[T.p(o)]()},a.add=function(o,c){var i,p=this;o=Number(o);var g=T.p(c),l=function($){var L=z(p);return T.w(L.date(L.date()+Math.round($*o)),p)};if(g===D)return this.set(D,this.$M+o);if(g===v)return this.set(v,this.$y+o);if(g===x)return l(1);if(g===f)return l(7);var j=(i={},i[S]=y,i[h]=F,i[u]=r,i)[g]||1,k=this.$d.getTime()+o*j;return T.w(k,this)},a.subtract=function(o,c){return this.add(-1*o,c)},a.format=function(o){var c=this,i=this.$locale();if(!this.isValid())return i.invalidDate||A;var p=o||"YYYY-MM-DDTHH:mm:ssZ",g=T.z(this),l=this.$H,j=this.$m,k=this.$M,$=i.weekdays,L=i.months,U=i.meridiem,_=function(W,J,te,re){return W&&(W[J]||W(c,p))||te[J].slice(0,re)},V=function(W){return T.s(l%12||12,W,"0")},K=U||function(W,J,te){var re=W<12?"AM":"PM";return te?re.toLowerCase():re};return p.replace(M,(function(W,J){return J||(function(te){switch(te){case"YY":return String(c.$y).slice(-2);case"YYYY":return T.s(c.$y,4,"0");case"M":return k+1;case"MM":return T.s(k+1,2,"0");case"MMM":return _(i.monthsShort,k,L,3);case"MMMM":return _(L,k);case"D":return c.$D;case"DD":return T.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return _(i.weekdaysMin,c.$W,$,2);case"ddd":return _(i.weekdaysShort,c.$W,$,3);case"dddd":return $[c.$W];case"H":return String(l);case"HH":return T.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return K(l,j,!0);case"A":return K(l,j,!1);case"m":return String(j);case"mm":return T.s(j,2,"0");case"s":return String(c.$s);case"ss":return T.s(c.$s,2,"0");case"SSS":return T.s(c.$ms,3,"0");case"Z":return g}return null})(W)||g.replace(":","")}))},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(o,c,i){var p,g=this,l=T.p(c),j=z(o),k=(j.utcOffset()-this.utcOffset())*y,$=this-j,L=function(){return T.m(g,j)};switch(l){case v:p=L()/12;break;case D:p=L();break;case b:p=L()/3;break;case f:p=($-k)/6048e5;break;case x:p=($-k)/864e5;break;case h:p=$/F;break;case S:p=$/y;break;case u:p=$/r;break;default:p=$}return i?p:T.a(p)},a.daysInMonth=function(){return this.endOf(D).$D},a.$locale=function(){return I[this.$L]},a.locale=function(o,c){if(!o)return this.$L;var i=this.clone(),p=N(o,c,!0);return p&&(i.$L=p),i},a.clone=function(){return T.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},d})(),ee=H.prototype;return z.prototype=ee,[["$ms",w],["$s",u],["$m",S],["$H",h],["$W",x],["$M",D],["$y",v],["$D",m]].forEach((function(d){ee[d[1]]=function(a){return this.$g(a,d[0],d[1])}})),z.extend=function(d,a){return d.$i||(d(a,H,z),d.$i=!0),z},z.locale=N,z.isDayjs=Q,z.unix=function(d){return z(1e3*d)},z.en=I[P],z.Ls=I,z.p={},z}))})(se)),se.exports}var Ne=Pe();const He=Ee(Ne),Ye=(s,n)=>He(`${s}T${n}`).format(),Je=({path:s,label:n,required:r,errors:y,description:F,children:w})=>{const u=y.length===0;return e.jsx(t.Box,{mb:"4",children:e.jsxs(t.Flex,{direction:"column",gap:"1",children:[e.jsxs(t.Text,{as:"label",size:"2",weight:"bold",htmlFor:s,children:[n," ",r&&e.jsx(t.Text,{color:"red",children:"*"})]}),w,!u&&e.jsx(t.Text,{color:"red",size:"1",children:q(y,n)}),F&&e.jsx(t.Text,{size:"1",color:"gray",children:F})]})})},ve=({data:s,handleChange:n,path:r,label:y,required:F,errors:w,schema:u,enabled:S,visible:h=!0})=>{if(R.useEffect(()=>{h===!1&&n(r,void 0)},[h,r,n]),h===!1)return null;const x=w.length===0,f=typeof s=="string"?s:"",D=M=>e.jsx(Je,{path:r,label:y,required:F,errors:w,description:u.description,children:M});if(u.format==="time")return D(e.jsx(t.TextField.Root,{type:"time",value:f,onChange:M=>n(r,M.target.value),disabled:!S,color:x?void 0:"red",id:r}));const b=u.format==="date-time",[v="",m=""]=f.split("T"),A=m.slice(0,5),B=(M,O)=>{if(!M){n(r,void 0);return}n(r,b?Ye(M,O||"00:00"):M)};return D(e.jsxs(t.Flex,{gap:"2",align:"center",children:[e.jsx(t.TextField.Root,{type:"date",value:v,disabled:!S,color:x?void 0:"red",onChange:M=>B(M.target.value,A),id:r,style:{flex:1}}),b&&e.jsx(t.TextField.Root,{type:"time",value:A,disabled:!S||!v,color:x?void 0:"red",onChange:M=>B(v,M.target.value),style:{flex:1}})]}))},$e=C.rankWith(2,C.or(C.isDateControl,C.isDateTimeControl,C.isTimeControl)),qe=E.withJsonFormsControlProps(ve),be=({uischema:s,schema:n,path:r,renderers:y,cells:F,enabled:w,visible:u=!0})=>{const h=s.elements;return u===!1?null:e.jsx(t.Flex,{direction:"column",gap:"4",children:h.map((x,f)=>e.jsx(E.JsonFormsDispatch,{uischema:x,schema:n,path:r,renderers:y,cells:F,enabled:w},`${r}-${f}`))})},Te=C.rankWith(1,C.uiTypeIs("VerticalLayout")),Ce=({uischema:s,schema:n,path:r,renderers:y,cells:F,enabled:w,visible:u=!0})=>{const h=s.elements;return u===!1?null:e.jsx(t.Flex,{direction:"row",gap:"4",children:h.map((x,f)=>e.jsx(t.Box,{style:{flex:1},children:e.jsx(E.JsonFormsDispatch,{uischema:x,schema:n,path:r,renderers:y,cells:F,enabled:w})},`${r}-${f}`))})},we=C.rankWith(1,C.uiTypeIs("HorizontalLayout")),Se=({uischema:s,schema:n,path:r,renderers:y,cells:F,enabled:w,visible:u=!0})=>{const S=s,h=S.elements;return u===!1?null:e.jsxs(t.Box,{mb:"6",children:[S.label&&e.jsx(t.Heading,{size:"3",mb:"3",className:"text-gray-500 uppercase tracking-wide font-semibold",children:S.label}),e.jsx(t.Flex,{direction:"column",gap:"4",children:h.map((x,f)=>e.jsx(E.JsonFormsDispatch,{uischema:x,schema:n,path:r,renderers:y,cells:F,enabled:w},`${r}-${f}`))})]})},Fe=C.rankWith(1,C.uiTypeIs("Group")),De=({uischema:s,schema:n,path:r,renderers:y,cells:F,enabled:w,visible:u=!0})=>{var b;const h=s.elements.filter(v=>v.type==="Category"),[x,f]=R.useState(((b=h[0])==null?void 0:b.label)||"");if(u===!1||!h.length)return null;const D=h.find(v=>v.label===x)?x:h[0].label;return e.jsxs(t.Tabs.Root,{value:D,onValueChange:f,children:[e.jsx(t.Tabs.List,{children:h.map((v,m)=>e.jsx(t.Tabs.Trigger,{value:v.label,children:v.label},`${r}-${m}`))}),e.jsx(t.Box,{pt:"3",children:h.map((v,m)=>e.jsx(t.Tabs.Content,{value:v.label,children:e.jsx(t.Flex,{direction:"column",gap:"4",children:v.elements.map((A,B)=>e.jsx(E.JsonFormsDispatch,{uischema:A,schema:n,path:r,renderers:y,cells:F,enabled:w},`${r}-${m}-${B}`))})},`${r}-${m}`))})]})},ke=C.rankWith(1,C.uiTypeIs("Categorization"));function Ge(s){return s?Array.isArray(s)?s:[s]:[]}function ne(s){return s>=1024*1024?`${(s/(1024*1024)).toFixed(0)} MB`:s>=1024?`${(s/1024).toFixed(0)} KB`:`${s} B`}function oe(s){return s.split(",").map(n=>{if(n=n.trim(),n.endsWith("/*"))return n.split("/")[0].toUpperCase()+"S";if(n.startsWith("."))return n.slice(1).toUpperCase();const r=n.split("/")[1];return r?r.toUpperCase():n}).join(", ")}const Ke=({data:s,handleChange:n,path:r,label:y,required:F,uischema:w,schema:u,enabled:S,errors:h,visible:x=!0})=>{const f=ce();if(R.useEffect(()=>{x===!1&&n(r,null)},[x,r,n]),x===!1)return null;const D=!h||h.length===0,b=(u==null?void 0:u["x-file"])??{},v=(w==null?void 0:w.options)??{},m=b.maxFiles??v.maxFiles??1,A=b.maxSize??v.maxSize??5*1024*1024,B=b.accept??v.accept??"image/*,application/pdf",M=m>1,O=S!==!1,[Y,G]=R.useState(!1),[P,I]=R.useState(null),[X,Q]=R.useState({}),N=R.useRef(new Set),z=R.useRef(null),T=Ge(s),H=T.length>=m;R.useEffect(()=>()=>{N.current.forEach(l=>URL.revokeObjectURL(l)),N.current.clear()},[]);const ee=R.useCallback(async l=>{if(I(null),T.length>=m){I(`Maximum ${m} file${m>1?"s":""} allowed.`);return}if(l.size>A){I(`File exceeds the ${ne(A)} limit.`);return}if(!B.split(",").map($=>$.trim()).some($=>$==="*"||$==="*/*"?!0:$.endsWith("/*")?l.type.startsWith($.slice(0,-1)):$.startsWith(".")?l.name.toLowerCase().endsWith($.toLowerCase()):l.type===$)){I(`Invalid type. Accepted: ${oe(B)}`);return}if(!(f!=null&&f.onUpload)){I("Upload service not configured.");return}try{const $=await f.onUpload(l),L=URL.createObjectURL(l);N.current.add(L);const U={key:$.key,name:$.name??l.name,blobUrl:L};Q(V=>({...V,[$.key]:U}));const _=[...T,$.key];n(r,M?_:_[0])}catch{I("Upload failed. Please try again."),z.current&&(z.current.value="")}},[T,m,A,B,f,r,n,M]),d=l=>{l.preventDefault(),l.stopPropagation(),!(!O||H)&&G(l.type==="dragenter"||l.type==="dragover")},a=l=>{var j;l.preventDefault(),l.stopPropagation(),G(!1),!(!O||H)&&(j=l.dataTransfer.files)!=null&&j[0]&&ee(l.dataTransfer.files[0])},o=l=>{var j;(j=l.target.files)!=null&&j[0]&&(ee(l.target.files[0]),l.target.value="")},c=l=>{if(!O)return;Q(k=>{var U;const $={...k},L=(U=$[l])==null?void 0:U.blobUrl;return L&&(URL.revokeObjectURL(L),N.current.delete(L)),delete $[l],$});const j=T.filter(k=>k!==l);n(r,M?j.length>0?j:null:j[0]??null)},i=async(l,j)=>{var L,U,_;l.preventDefault();const k=(L=X[j])==null?void 0:L.blobUrl;if(k){(U=window.open(k,"_blank","noopener,noreferrer"))==null||U.focus();return}const $=window.open("","_blank");if($)try{const V=await((_=f==null?void 0:f.getDownloadUrl)==null?void 0:_.call(f,j));V!=null&&V.url?$.location.href=V.url:$.close()}catch{$.close()}};if(!O&&T.length===0)return null;const p=m-T.length,g=O&&!H;return e.jsxs(t.Box,{mb:"4",children:[e.jsxs(t.Flex,{align:"center",justify:"between",mb:"2",children:[e.jsxs(t.Text,{as:"label",size:"2",weight:"bold",children:[y,F&&e.jsx(t.Text,{color:"red",children:" *"})]}),e.jsx(t.Text,{size:"1",color:"gray",children:M?`Up to ${m} files · ${ne(A)} each · ${oe(B)}`:`${ne(A)} · ${oe(B)}`})]}),T.map(l=>{var j;return e.jsx(t.Card,{size:"2",variant:"surface",mb:"2",children:e.jsxs(t.Flex,{align:"center",gap:"3",children:[e.jsx(t.Box,{style:{background:"var(--blue-3)",padding:8,borderRadius:6,color:"var(--blue-9)",flexShrink:0},children:e.jsx(Z.FileTextIcon,{width:"20",height:"20"})}),e.jsx(t.Box,{style:{flex:1,overflow:"hidden"},children:e.jsx(t.Text,{size:"2",weight:"bold",style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:((j=X[l])==null?void 0:j.name)??"Uploaded File"})}),e.jsxs(t.Flex,{align:"center",gap:"2",style:{flexShrink:0},children:[e.jsx(t.Button,{variant:"soft",color:"blue",size:"1",onClick:k=>i(k,l),children:"View"}),e.jsx(Z.CheckCircledIcon,{style:{color:"var(--green-9)",width:18,height:18}}),O&&e.jsx(t.IconButton,{variant:"ghost",color:"gray",onClick:()=>c(l),children:e.jsx(Z.Cross2Icon,{})})]})]})},l)}),g&&e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>{var l;return(l=z.current)==null?void 0:l.click()},onKeyDown:l=>{var j;(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),(j=z.current)==null||j.click())},onDragEnter:d,onDragLeave:d,onDragOver:d,onDrop:a,style:{cursor:"pointer"},className:["border-2 border-dashed rounded-lg p-6 text-center","transition-all duration-200 ease-in-out",Y?"border-blue-500 bg-blue-50":P?"border-red-300 bg-red-50":"border-gray-300 hover:border-blue-400 hover:bg-gray-50"].join(" "),children:[e.jsx("input",{ref:z,type:"file",style:{display:"none"},accept:B,onChange:o}),e.jsx(t.Flex,{direction:"column",align:"center",gap:"2",children:P?e.jsxs(e.Fragment,{children:[e.jsx(Z.ExclamationTriangleIcon,{style:{width:32,height:32,color:"var(--red-9)"}}),e.jsx(t.Text,{size:"2",color:"red",weight:"medium",children:P}),e.jsx(t.Text,{size:"1",color:"gray",children:"Click to try again"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Z.UploadIcon,{style:{width:32,height:32,color:"var(--gray-8)"}}),e.jsx(t.Text,{size:"2",weight:"medium",children:T.length>0?`Add another file (${p} remaining)`:"Click to upload or drag and drop"}),e.jsxs(t.Text,{size:"1",color:"gray",children:[ne(A)," max · ",oe(B)]})]})})]}),O&&H&&M&&e.jsxs(t.Text,{size:"1",color:"gray",mt:"1",style:{display:"block",textAlign:"center"},children:["Maximum ",m," files uploaded. Remove one to replace it."]}),!D&&e.jsx(t.Text,{color:"red",size:"1",mt:"2",style:{display:"block"},children:q(h,y)})]})},Me=E.withJsonFormsControlProps(Ke),ze=C.rankWith(10,C.and(C.schemaMatches(s=>{if(s.type==="string"&&s.format==="file")return!0;if(s.type==="array"){const n=s.items;return(n==null?void 0:n.type)==="string"&&(n==null?void 0:n.format)==="file"}return!1}))),Ze=({data:s,path:n,schema:r,uischema:y,enabled:F,visible:w,addItem:u,removeItems:S,rootSchema:h,arraySchema:x})=>{const f=x?r:r.items,D=x||r;if(w===!1||!f||typeof f!="object"||Array.isArray(f))return null;const b=f,v=Array.isArray(s)?s:[],m=D.title||"Array Items",A=()=>{const M=C.createDefaultValue(b,h);u&&u(n,M)()},B=M=>{if(S){const O=S(n,[M]);O&&O()}};return e.jsx(t.Box,{mb:"6",children:e.jsxs(t.Flex,{direction:"column",gap:"4",children:[e.jsx(t.Text,{as:"div",size:"4",weight:"bold",children:m}),v.length===0&&e.jsx(t.Box,{py:"4",px:"4",style:{backgroundColor:"var(--gray-3)",borderRadius:"var(--radius-3)"},children:e.jsx(t.Text,{size:"2",color:"gray",children:"No items have been added yet."})}),v.map((M,O)=>{var G;const Y=`${n}.${O}`;return e.jsx(t.Card,{size:"3",variant:"surface",children:e.jsxs(t.Flex,{direction:"column",gap:"4",children:[e.jsxs(t.Flex,{justify:"between",align:"center",children:[e.jsxs(t.Text,{size:"3",weight:"bold",children:["Item ",O+1]}),F&&e.jsxs(t.Button,{type:"button",color:"red",variant:"soft",onClick:()=>B(O),title:"Remove item",children:[e.jsx(Z.TrashIcon,{}),"Remove"]})]}),e.jsx(t.Box,{children:e.jsx(E.JsonFormsDispatch,{schema:b,uischema:((G=y.options)==null?void 0:G.detail)||(b.type==="object"||b.properties?{type:"VerticalLayout",elements:Object.keys(b.properties||{}).map(P=>({type:"Control",scope:`#/properties/${P}`}))}:{type:"Control",scope:"#"}),path:Y,enabled:F,renderers:void 0,cells:void 0})})]})},Y)}),F&&e.jsx(t.Box,{mt:"2",children:e.jsxs(t.Button,{type:"button",variant:"surface",onClick:A,children:[e.jsx(Z.PlusIcon,{}),"Add Item"]})})]})})},ie=E.withJsonFormsArrayControlProps(Ze),Le=C.rankWith(3,C.isObjectArrayControl),Oe=({uischema:s,visible:n})=>{const r=s;return n===!1?null:e.jsx(t.Box,{mb:"4",children:e.jsx(t.Heading,{size:"4",children:r.text})})},Re=C.rankWith(1,C.uiTypeIs("Label")),Qe=C.rankWith(3,C.isPrimitiveArrayControl),Xe=[{tester:de,renderer:Be},{tester:xe,renderer:Ie},{tester:me,renderer:Ue},{tester:ge,renderer:We},{tester:je,renderer:_e},{tester:$e,renderer:qe},{tester:Te,renderer:be},{tester:we,renderer:Ce},{tester:Fe,renderer:Se},{tester:ke,renderer:De},{tester:ze,renderer:Me},{tester:Le,renderer:ie},{tester:Qe,renderer:ie},{tester:Re,renderer:Oe}];exports.ArrayControl=ie;exports.ArrayControlTester=Le;exports.BooleanControl=he;exports.BooleanControlTester=me;exports.CategorizationLayoutRenderer=De;exports.CategorizationLayoutTester=ke;exports.DateControl=ve;exports.DateControlTester=$e;exports.FileControl=Me;exports.FileControlTester=ze;exports.GroupLayoutRenderer=Se;exports.GroupLayoutTester=Fe;exports.HorizontalLayoutRenderer=Ce;exports.HorizontalLayoutTester=we;exports.LabelRenderer=Oe;exports.LabelTester=Re;exports.NumberControl=fe;exports.NumberControlTester=xe;exports.RadioControl=pe;exports.RadioControlTester=ge;exports.SelectControl=ye;exports.SelectControlTester=je;exports.TextControl=ue;exports.TextControlTester=de;exports.UploadProvider=Ae;exports.VerticalLayoutRenderer=be;exports.VerticalLayoutTester=Te;exports.getErrorMessage=q;exports.radixRenderers=Xe;exports.useUpload=ce;
|
|
3
|
+
`):"",Ie=({data:e,handleChange:n,path:r,label:a,required:h,errors:d,uischema:u,schema:c,enabled:s,visible:i=!0})=>{var g;if(ce(i,r,n),i===!1)return null;const l=d.length===0;return t.jsx(o.Box,{mb:"4",children:t.jsxs(o.Flex,{direction:"column",gap:"1",children:[t.jsxs(o.Text,{as:"label",size:"2",weight:"bold",htmlFor:r,children:[a," ",h&&t.jsx(o.Text,{color:"red",children:"*"})]}),t.jsx(o.TextField.Root,{value:e||"",onChange:p=>n(r,p.target.value),disabled:!s,placeholder:(g=u.options)==null?void 0:g.placeholder,color:l?void 0:"red",id:r}),!l&&t.jsx(o.Text,{color:"red",size:"1",children:ne(d,a)}),c.description&&t.jsx(o.Text,{size:"1",color:"gray",children:c.description})]})})},Oe=y.rankWith(1,y.isStringControl),Tt=W.withJsonFormsControlProps(Ie),Le=({data:e,handleChange:n,path:r,label:a,required:h,errors:d,uischema:u,schema:c,enabled:s,visible:i=!0})=>{var p;if(ce(i,r,n),i===!1)return null;const l=d.length===0,g=f=>{if(f===""){n(r,void 0);return}const m=Number(f);isNaN(m)||n(r,m)};return t.jsx(o.Box,{mb:"4",children:t.jsxs(o.Flex,{direction:"column",gap:"1",children:[t.jsxs(o.Text,{as:"label",size:"2",weight:"bold",htmlFor:r,children:[a," ",h&&t.jsx(o.Text,{color:"red",children:"*"})]}),t.jsx(o.TextField.Root,{type:"number",value:e??"",onChange:f=>g(f.target.value),disabled:!s,placeholder:(p=u.options)==null?void 0:p.placeholder,color:l?void 0:"red",id:r}),!l&&t.jsx(o.Text,{color:"red",size:"1",children:ne(d,a)}),c.description&&t.jsx(o.Text,{size:"1",color:"gray",children:c.description})]})})},ke=y.rankWith(2,y.or(y.isNumberControl,y.isIntegerControl)),yt=W.withJsonFormsControlProps(Le),De=({data:e,handleChange:n,path:r,label:a,required:h,errors:d,schema:u,enabled:c,visible:s=!0})=>{if(ce(s,r,n),s===!1)return null;const i=d.length===0;return t.jsxs(o.Box,{mb:"4",children:[t.jsxs(o.Flex,{gap:"2",align:"center",children:[t.jsx(o.Checkbox,{checked:!!e,onCheckedChange:l=>n(r,l===!0),disabled:!c,id:r}),t.jsxs(o.Text,{as:"label",size:"2",htmlFor:r,children:[a," ",h&&"*"]})]}),!i&&t.jsx(o.Text,{color:"red",size:"1",className:"block mt-1",children:ne(d,a)}),u.description&&t.jsx(o.Text,{size:"1",color:"gray",className:"block mt-1",children:u.description})]})},Me=y.rankWith(2,y.isBooleanControl),vt=W.withJsonFormsControlProps(De),ze=({data:e,handleChange:n,path:r,label:a,required:h,errors:d,schema:u,enabled:c,visible:s=!0})=>{if(ce(s,r,n),s===!1)return null;const i=d.length===0;let l=[];u.enum?l=u.enum.map(p=>({value:p,label:String(p)})):u.oneOf&&(l=u.oneOf.map(p=>({value:p.const,label:p.title||String(p.const)})));const g=e;return t.jsx(o.Box,{mb:"4",children:t.jsxs(o.Flex,{direction:"column",gap:"1",children:[t.jsxs(o.Text,{as:"div",size:"2",weight:"bold",children:[a," ",h&&t.jsx(o.Text,{color:"red",children:"*"})]}),t.jsx(o.RadioGroup.Root,{value:g!==void 0?String(g):"",onValueChange:p=>{const f=l.find(m=>String(m.value)===p);f&&n(r,f.value)},disabled:!c,children:t.jsx(o.Flex,{direction:"row",style:{flexWrap:"wrap",columnGap:"clamp(14px, 3vw, 36px)",rowGap:"clamp(8px, 1.6vw, 14px)"},children:l.map(p=>t.jsxs(o.Flex,{align:"center",gap:"2",style:{minWidth:"max-content"},children:[t.jsx(o.RadioGroup.Item,{value:String(p.value)}),t.jsx(o.Text,{size:"2",color:c?void 0:"gray",children:p.label})]},String(p.value)))})}),!i&&t.jsx(o.Text,{color:"red",size:"1",children:ne(d,a)}),u.description&&t.jsx(o.Text,{size:"1",color:"gray",children:u.description})]})})},Ue=(e,n,r)=>{var h;return y.or(y.isEnumControl,y.isOneOfControl)(e,n,r)&&((h=e==null?void 0:e.options)==null?void 0:h.format)==="radio"?3:-1},bt=W.withJsonFormsControlProps(ze),Be=({data:e,handleChange:n,path:r,label:a,required:h,errors:d,schema:u,uischema:c,enabled:s,visible:i=!0})=>{var f;if(ce(i,r,n),i===!1)return null;const l=d.length===0;let g=[];u.enum?g=u.enum.map(m=>({value:String(m),label:String(m)})):u.oneOf&&(g=u.oneOf.map(m=>({value:String(m.const),label:m.title||String(m.const)})));const p=e!==void 0?String(e):"";return t.jsx(o.Box,{mb:"4",children:t.jsxs(o.Flex,{direction:"column",gap:"1",children:[t.jsxs(o.Text,{as:"label",size:"2",weight:"bold",htmlFor:r,children:[a," ",h&&t.jsx(o.Text,{color:"red",children:"*"})]}),t.jsxs(o.Select.Root,{value:p,onValueChange:m=>n(r,m),disabled:!s,children:[t.jsx(o.Select.Trigger,{placeholder:((f=c.options)==null?void 0:f.placeholder)||"Select an option",color:l?void 0:"red",id:r}),t.jsx(o.Select.Content,{children:g.map(m=>t.jsx(o.Select.Item,{value:m.value,children:m.label},m.value))})]}),!l&&t.jsx(o.Text,{color:"red",size:"1",children:ne(d,a)}),u.description&&t.jsx(o.Text,{size:"1",color:"gray",children:u.description})]})})},Pe=y.rankWith(2,y.or(y.isEnumControl,y.isOneOfControl)),jt=W.withJsonFormsControlProps(Be),Ct={"small-list":{fetchOnOpen:!0,searchable:!1,paginated:!1},"large-searchable-list":{fetchOnOpen:!0,searchable:!0,paginated:!1},"large-paginated-list":{fetchOnOpen:!1,searchable:!0,paginated:!0}},Et=({data:e,handleChange:n,path:r,label:a,required:h,errors:d,enabled:u,visible:c=!0,schema:s,uischema:i})=>{var xe;const l=(s==null?void 0:s["x-search"])??{service:""},g=l.service??"",p=l.mode??"large-paginated-list",f=Ct[p],m=(f==null?void 0:f.fetchOnOpen)??!1,R=Ne(g),F=g?R?f?null:`Invalid x-search.mode "${p}". Expected "small-list", "large-searchable-list", or "large-paginated-list".`:`Search service "${g}" is not registered.`:"Search not configured.",C=u!==!1,A=!d||d.length===0,[N,S]=v.useState(!1),[D,M]=v.useState(""),[ee,z]=v.useState([]),[oe,$]=v.useState(!1),[U,G]=v.useState(!1),[te,I]=v.useState(!1),[se,H]=v.useState(null),[le,J]=v.useState(void 0),q=v.useRef(void 0),re=v.useRef(null),T=v.useRef(null),w=v.useRef(null),L=v.useRef(void 0);v.useEffect(()=>{if(!e){J(void 0),L.current=void 0;return}if(L.current===e||(L.current=e,J({id:e,name:e}),!(R!=null&&R.resolve)))return;let x=!1;return R.resolve(e).then(j=>{!x&&j&&J(j)}).catch(()=>{}),()=>{x=!0}},[e,R]);const b=v.useCallback(async(x,j=!1)=>{var Z;if(!R){H("Search service not configured.");return}(Z=T.current)==null||Z.abort();const ie=new AbortController;T.current=ie,j?I(!0):(G(!0),I(!1),H(null));try{const Q=await R.search({query:x,cursor:j?q.current:void 0,signal:ie.signal}),k=Q.options??[];z(j?it=>[...it,...k]:k),q.current=Q.nextCursor,$(((f==null?void 0:f.paginated)??!1)&&Q.nextCursor!=null)}catch{if(ie.signal.aborted)return;H("Failed to load results. Please try again.")}finally{ie.signal.aborted||(j?I(!1):G(!1))}},[R,f==null?void 0:f.paginated]);if(v.useEffect(()=>{if(!N)return;const x=j=>{w.current&&!w.current.contains(j.target)&&S(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[N]),v.useEffect(()=>{var x;N||((x=T.current)==null||x.abort(),M(""),z([]),$(!1),H(null),G(!1),I(!1),q.current=void 0)},[N]),v.useEffect(()=>{if(!N)return;if(!D&&!m){z([]),$(!1),H(null),q.current=void 0;return}re.current&&clearTimeout(re.current);const x=D?300:0;return re.current=setTimeout(()=>{z([]),$(!1),q.current=void 0,b(D)},x),()=>{re.current&&clearTimeout(re.current)}},[D,N,m,b]),ce(c,r,n,null),c===!1)return null;const B=()=>{M(""),z([]),$(!1),H(null),q.current=void 0,S(!0)},K=x=>{n(r,x.id),J(x),L.current=x.id,S(!1)},X=x=>{x.stopPropagation(),n(r,null),J(void 0)},Y=x=>{(x.key==="Enter"||x.key===" ")&&X(x)},pe=((xe=i==null?void 0:i.options)==null?void 0:xe.placeholder)??"Select an option";return t.jsx(o.Box,{mb:"4",children:t.jsxs(o.Flex,{direction:"column",gap:"1",children:[t.jsxs(o.Text,{as:"label",size:"2",weight:"bold",htmlFor:r,children:[a," ",h&&t.jsx(o.Text,{color:"red",children:"*"})]}),t.jsxs("div",{ref:w,style:{position:"relative"},children:[t.jsx(o.TextField.Root,{id:r,value:N?D:(le==null?void 0:le.name)??"",placeholder:N&&(f!=null&&f.searchable)?"Search...":pe,disabled:!C,readOnly:N&&!(f!=null&&f.searchable),style:A?void 0:{outline:"2px solid var(--red-7)",outlineOffset:"-1px"},onChange:x=>{f!=null&&f.searchable&&(M(x.target.value),N||B())},onFocus:()=>{C&&!N&&B()},onKeyDown:x=>{x.key==="Escape"&&S(!1)},children:t.jsx(o.TextField.Slot,{side:"right",children:t.jsxs(o.Flex,{align:"center",gap:"1",children:[e&&C&&t.jsx("span",{role:"button",tabIndex:0,onMouseDown:x=>x.preventDefault(),onClick:X,onKeyDown:Y,style:{lineHeight:1,color:"var(--gray-9)",padding:"0 2px",cursor:"pointer"},"aria-label":"Clear selection",children:"×"}),t.jsx(_.ChevronDownIcon,{style:{transform:N?"rotate(180deg)":void 0,transition:"transform 150ms"}})]})})}),N&&t.jsx(o.Box,{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:50,background:"var(--color-panel-solid)",borderRadius:"var(--radius-3)",boxShadow:"var(--shadow-5)",border:"1px solid var(--gray-a6)",overflow:"hidden"},children:F?t.jsx(o.Box,{p:"3",children:t.jsx(o.Text,{size:"2",color:"gray",children:F})}):t.jsx(o.ScrollArea,{style:{maxHeight:240},children:t.jsxs(o.Box,{p:"1",children:[U&&t.jsx(o.Flex,{justify:"center",p:"4",children:t.jsx(o.Spinner,{})}),!U&&se&&t.jsx(o.Box,{px:"3",py:"2",children:t.jsx(o.Text,{size:"2",color:"red",children:se})}),!U&&!se&&ee.length===0&&t.jsx(o.Box,{px:"3",py:"2",children:t.jsx(o.Text,{size:"2",color:"gray",children:D||m?"No results found.":"Type to search…"})}),ee.map(x=>t.jsx(o.Box,{px:"3",py:"2",onMouseDown:j=>j.preventDefault(),onClick:()=>K(x),style:{cursor:"pointer",borderRadius:"var(--radius-2)",backgroundColor:x.id===e?"var(--accent-3)":void 0},className:"hover:bg-(--gray-3)",children:t.jsx(o.Text,{size:"2",children:x.name})},x.id)),(f==null?void 0:f.paginated)&&oe&&!te&&t.jsx(o.Box,{px:"3",py:"2",children:t.jsx(o.Button,{variant:"ghost",size:"1",style:{width:"100%"},onMouseDown:x=>x.preventDefault(),onClick:()=>void b(D,!0),children:"Load more"})}),te&&t.jsx(o.Flex,{justify:"center",p:"2",children:t.jsx(o.Spinner,{})})]})})})]}),!A&&t.jsx(o.Text,{color:"red",size:"1",children:ne(d,a)}),s.description&&t.jsx(o.Text,{size:"1",color:"gray",children:s.description})]})})},We=W.withJsonFormsControlProps(Et),$e=y.rankWith(3,y.schemaMatches(e=>{const n=e["x-search"];return e.type==="string"&&typeof(n==null?void 0:n.service)=="string"&&n.service!==""})),Rt=(e,n)=>pt(`${e}T${n}`).format(),wt=({path:e,label:n,required:r,errors:a,description:h,children:d})=>{const u=a.length===0;return t.jsx(o.Box,{mb:"4",children:t.jsxs(o.Flex,{direction:"column",gap:"1",children:[t.jsxs(o.Text,{as:"label",size:"2",weight:"bold",htmlFor:e,children:[n," ",r&&t.jsx(o.Text,{color:"red",children:"*"})]}),d,!u&&t.jsx(o.Text,{color:"red",size:"1",children:ne(a,n)}),h&&t.jsx(o.Text,{size:"1",color:"gray",children:h})]})})},_e=({data:e,handleChange:n,path:r,label:a,required:h,errors:d,schema:u,enabled:c,visible:s=!0})=>{if(v.useEffect(()=>{s===!1&&n(r,void 0)},[s,r,n]),s===!1)return null;const i=d.length===0,l=typeof e=="string"?e:"",g=C=>t.jsx(wt,{path:r,label:a,required:h,errors:d,description:u.description,children:C});if(u.format==="time")return g(t.jsx(o.TextField.Root,{type:"time",value:l,onChange:C=>n(r,C.target.value),disabled:!c,color:i?void 0:"red",id:r}));const p=u.format==="date-time",[f="",m=""]=l.split("T"),R=m.slice(0,5),F=(C,A)=>{if(!C){n(r,void 0);return}n(r,p?Rt(C,A||"00:00"):C)};return g(t.jsxs(o.Flex,{gap:"2",align:"center",children:[t.jsx(o.TextField.Root,{type:"date",value:f,disabled:!c,color:i?void 0:"red",onChange:C=>F(C.target.value,R),id:r,style:{flex:1}}),p&&t.jsx(o.TextField.Root,{type:"time",value:R,disabled:!c||!f,color:i?void 0:"red",onChange:C=>F(f,C.target.value),style:{flex:1}})]}))},Ve=y.rankWith(2,y.or(y.isDateControl,y.isDateTimeControl,y.isTimeControl)),St=W.withJsonFormsControlProps(_e),He=({uischema:e,schema:n,path:r,renderers:a,cells:h,enabled:d,visible:u=!0})=>{const s=e.elements;return u===!1?null:t.jsx(o.Flex,{direction:"column",gap:"4",children:s.map((i,l)=>t.jsx(W.JsonFormsDispatch,{uischema:i,schema:n,path:r,renderers:a,cells:h,enabled:d},`${r}-${l}`))})},Ge=y.rankWith(1,y.uiTypeIs("VerticalLayout")),Je=({uischema:e,schema:n,path:r,renderers:a,cells:h,enabled:d,visible:u=!0})=>{const s=e.elements;return u===!1?null:t.jsx(o.Flex,{direction:"row",gap:"4",children:s.map((i,l)=>t.jsx(o.Box,{style:{flex:1},children:t.jsx(W.JsonFormsDispatch,{uischema:i,schema:n,path:r,renderers:a,cells:h,enabled:d})},`${r}-${l}`))})},Ke=y.rankWith(1,y.uiTypeIs("HorizontalLayout")),Xe=({uischema:e,schema:n,path:r,renderers:a,cells:h,enabled:d,visible:u=!0})=>{const c=e,s=c.elements;return u===!1?null:t.jsxs(o.Box,{mb:"6",children:[c.label&&t.jsx(o.Heading,{size:"3",mb:"3",className:"text-gray-500 uppercase tracking-wide font-semibold",children:c.label}),t.jsx(o.Flex,{direction:"column",gap:"4",children:s.map((i,l)=>t.jsx(W.JsonFormsDispatch,{uischema:i,schema:n,path:r,renderers:a,cells:h,enabled:d},`${r}-${l}`))})]})},qe=y.rankWith(1,y.uiTypeIs("Group")),Ye=({uischema:e,schema:n,path:r,renderers:a,cells:h,enabled:d,visible:u=!0})=>{var p;const s=e.elements.filter(f=>f.type==="Category"),[i,l]=v.useState(((p=s[0])==null?void 0:p.label)||"");if(u===!1||!s.length)return null;const g=s.find(f=>f.label===i)?i:s[0].label;return t.jsxs(o.Tabs.Root,{value:g,onValueChange:l,children:[t.jsx(o.Tabs.List,{children:s.map((f,m)=>t.jsx(o.Tabs.Trigger,{value:f.label,children:f.label},`${r}-${m}`))}),t.jsx(o.Box,{pt:"3",children:s.map((f,m)=>t.jsx(o.Tabs.Content,{value:f.label,children:t.jsx(o.Flex,{direction:"column",gap:"4",children:f.elements.map((R,F)=>t.jsx(W.JsonFormsDispatch,{uischema:R,schema:n,path:r,renderers:a,cells:h,enabled:d},`${r}-${m}-${F}`))})},`${r}-${m}`))})]})},Ze=y.rankWith(1,y.uiTypeIs("Categorization"));function ue(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(0)} MB`:e>=1024?`${(e/1024).toFixed(0)} KB`:`${e} B`}function de(e){return e.split(",").map(n=>{if(n=n.trim(),n.endsWith("/*"))return n.split("/")[0].toUpperCase()+"S";if(n.startsWith("."))return n.slice(1).toUpperCase();const r=n.split("/")[1];return r?r.toUpperCase():n}).join(", ")}function At(e){return e?Array.isArray(e)?e:[e]:[]}const Ft=({data:e,handleChange:n,path:r,label:a,required:h,uischema:d,schema:u,enabled:c,errors:s,visible:i=!0})=>{const l=Ae();ce(i,r,n,null);const g=!s||s.length===0,p=(u==null?void 0:u["x-file"])??{},f=(d==null?void 0:d.options)??{},m=p.maxFiles??f.maxFiles??1,R=p.maxSize??f.maxSize??5*1024*1024,F=p.accept??f.accept??"image/*,application/pdf",C=m>1,A=c!==!1,[N,S]=v.useState(!1),[D,M]=v.useState(null),[ee,z]=v.useState({}),oe=v.useRef(new Set),$=v.useRef(null),U=At(e),G=U.length>=m;v.useEffect(()=>()=>{oe.current.forEach(T=>URL.revokeObjectURL(T)),oe.current.clear()},[]);const te=v.useCallback(async T=>{if(M(null),U.length>=m){M(`Maximum ${m} file${m>1?"s":""} allowed.`);return}if(T.size>R){M(`File exceeds the ${ue(R)} limit.`);return}if(!F.split(",").map(b=>b.trim()).some(b=>b==="*"||b==="*/*"?!0:b.endsWith("/*")?T.type.startsWith(b.slice(0,-1)):b.startsWith(".")?T.name.toLowerCase().endsWith(b.toLowerCase()):T.type===b)){M(`Invalid type. Accepted: ${de(F)}`);return}if(!(l!=null&&l.onUpload)){M("Upload service not configured.");return}try{const b=await l.onUpload(T),B=URL.createObjectURL(T);oe.current.add(B);const K={key:b.key,name:b.name??T.name,blobUrl:B};z(Y=>({...Y,[b.key]:K}));const X=[...U,b.key];n(r,C?X:X[0])}catch{M("Upload failed. Please try again."),$.current&&($.current.value="")}},[U,m,R,F,l,r,n,C]);if(i===!1)return null;const I=T=>{T.preventDefault(),T.stopPropagation(),!(!A||G)&&S(T.type==="dragenter"||T.type==="dragover")},se=T=>{var w;T.preventDefault(),T.stopPropagation(),S(!1),!(!A||G)&&(w=T.dataTransfer.files)!=null&&w[0]&&te(T.dataTransfer.files[0])},H=T=>{var w;(w=T.target.files)!=null&&w[0]&&(te(T.target.files[0]),T.target.value="")},le=T=>{if(!A)return;z(L=>{var K;const b={...L},B=(K=b[T])==null?void 0:K.blobUrl;return B&&(URL.revokeObjectURL(B),oe.current.delete(B)),delete b[T],b});const w=U.filter(L=>L!==T);n(r,C?w.length>0?w:null:w[0]??null)},J=async(T,w)=>{var B,K,X;T.preventDefault();const L=(B=ee[w])==null?void 0:B.blobUrl;if(L){(K=window.open(L,"_blank","noopener,noreferrer"))==null||K.focus();return}const b=window.open("","_blank");if(b)try{const Y=await((X=l==null?void 0:l.getDownloadUrl)==null?void 0:X.call(l,w));Y!=null&&Y.url?b.location.href=Y.url:b.close()}catch{b.close()}};if(!A&&U.length===0)return null;const q=m-U.length,re=A&&!G;return t.jsxs(o.Box,{mb:"4",children:[t.jsxs(o.Flex,{align:"center",justify:"between",mb:"2",children:[t.jsxs(o.Text,{as:"label",size:"2",weight:"bold",children:[a,h&&t.jsx(o.Text,{color:"red",children:" *"})]}),t.jsx(o.Text,{size:"1",color:"gray",children:C?`Up to ${m} files · ${ue(R)} each · ${de(F)}`:`${ue(R)} · ${de(F)}`})]}),U.map(T=>{var w;return t.jsx(o.Card,{size:"2",variant:"surface",mb:"2",children:t.jsxs(o.Flex,{align:"center",gap:"3",children:[t.jsx(o.Box,{style:{background:"var(--blue-3)",padding:8,borderRadius:6,color:"var(--blue-9)",flexShrink:0},children:t.jsx(_.FileTextIcon,{width:"20",height:"20"})}),t.jsx(o.Box,{style:{flex:1,overflow:"hidden"},children:t.jsx(o.Text,{size:"2",weight:"bold",style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:((w=ee[T])==null?void 0:w.name)??"Uploaded File"})}),t.jsxs(o.Flex,{align:"center",gap:"2",style:{flexShrink:0},children:[t.jsx(o.Button,{variant:"soft",color:"blue",size:"1",onClick:L=>J(L,T),children:"View"}),t.jsx(_.CheckCircledIcon,{style:{color:"var(--green-9)",width:18,height:18}}),A&&t.jsx(o.IconButton,{variant:"ghost",color:"gray",onClick:()=>le(T),children:t.jsx(_.Cross2Icon,{})})]})]})},T)}),re&&t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>{var T;return(T=$.current)==null?void 0:T.click()},onKeyDown:T=>{var w;(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),(w=$.current)==null||w.click())},onDragEnter:I,onDragLeave:I,onDragOver:I,onDrop:se,style:{cursor:"pointer"},className:["border-2 border-dashed rounded-lg p-6 text-center","transition-all duration-200 ease-in-out",N?"border-blue-500 bg-blue-50":D?"border-red-300 bg-red-50":"border-gray-300 hover:border-blue-400 hover:bg-gray-50"].join(" "),children:[t.jsx("input",{ref:$,type:"file",style:{display:"none"},accept:F,onChange:H}),t.jsx(o.Flex,{direction:"column",align:"center",gap:"2",children:D?t.jsxs(t.Fragment,{children:[t.jsx(_.ExclamationTriangleIcon,{style:{width:32,height:32,color:"var(--red-9)"}}),t.jsx(o.Text,{size:"2",color:"red",weight:"medium",children:D}),t.jsx(o.Text,{size:"1",color:"gray",children:"Click to try again"})]}):t.jsxs(t.Fragment,{children:[t.jsx(_.UploadIcon,{style:{width:32,height:32,color:"var(--gray-8)"}}),t.jsx(o.Text,{size:"2",weight:"medium",children:U.length>0?`Add another file (${q} remaining)`:"Click to upload or drag and drop"}),t.jsxs(o.Text,{size:"1",color:"gray",children:[ue(R)," max · ",de(F)]})]})})]}),A&&G&&C&&t.jsxs(o.Text,{size:"1",color:"gray",mt:"1",style:{display:"block",textAlign:"center"},children:["Maximum ",m," files uploaded. Remove one to replace it."]}),!g&&t.jsx(o.Text,{color:"red",size:"1",mt:"2",style:{display:"block"},children:ne(s,a)})]})},Qe=W.withJsonFormsControlProps(Ft),et=y.rankWith(10,y.and(y.schemaMatches(e=>{if(e.type==="string"&&e.format==="file")return!0;if(e.type==="array"){const n=e.items;return(n==null?void 0:n.type)==="string"&&(n==null?void 0:n.format)==="file"}return!1})));class Te extends Error{}function Nt(e,n){const r=je.read(e,{type:"array",cellDates:!0});if(r.SheetNames.length===0)throw new Te("This file has no sheets.");const a=n??r.SheetNames[0],h=r.Sheets[a];if(!h)throw new Te(`This file doesn't have a sheet named "${a}".`);const d=je.utils.sheet_to_json(h,{header:1,raw:!0,defval:null});return{sheetName:a,matrix:d,rowCount:d.length,colCount:Math.max(0,...d.map(u=>u.length))}}function It(e){let n=e+1,r="";for(;n>0;){const a=(n-1)%26;r=String.fromCharCode(65+a)+r,n=Math.floor((n-1)/26)}return r}class V extends Error{constructor(r,a){super(a??r);be(this,"code");this.code=r,this.name="FormulaError"}}const Ot=["IFS","IFERROR","AND","OR","NOT","ROUND","ROUNDUP","ROUNDDOWN","INDEX","VLOOKUP","HLOOKUP","SUM","AVERAGE","COUNT","DATE","TODAY"],Lt=["MAX","MIN","MAXA","MINA","MEDIAN","LARGE","SMALL","PERMUT","PERMUTATIONA","MATCH","SWITCH","SUBSTITUTE","TEXTJOIN","COUNTA","UPPER"],kt=["YEAR","MONTH","DAY","WEEKDAY"],Dt=["IF"],Mt=["CONCATENATE","CONCAT","LEN","TRIM","LOWER","LEFT","RIGHT","MID","FIND","SEARCH"],zt=new Set([...Ot,...Lt,...kt,...Mt,...Dt]),Ut=/"(?:[^"]|"")*"/g,Ce=new RegExp("(?<![A-Za-z0-9_.])([A-Za-z_][A-Za-z0-9_.]*)\\s*\\(","g");function Bt(e){const n=e.replace(Ut,a=>" ".repeat(a.length));Ce.lastIndex=0;let r;for(;(r=Ce.exec(n))!==null;){const a=r[1].toUpperCase();if(!zt.has(a))throw new V("NAME",`Function ${a} is not allowed.`)}}function Pt(e,n,r){let a=e;if(a==null)throw r.NA;if(typeof a=="object"&&!(a instanceof r)&&(a=n.retrieveRef(a)),a instanceof r)throw a;if(typeof a=="boolean")return a;if(typeof a=="number")return a!==0;throw r.VALUE}function tt(e){return e!==null&&typeof e=="object"&&"value"in e?e.value:e}function ae(e){const n=tt(e);return Array.isArray(n)?n.flat(1/0):[n]}function E(e){const n=tt(e);return Array.isArray(n)?n.flat(1/0)[0]:n}function he(e){return e===void 0?void 0:E(e)}function P(e){return e==null||e===""?"":typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof Date?e.toLocaleDateString():String(e)}function Wt(e,n){return e instanceof n?e:new n(e.message||"#ERROR!")}function O(e){return e.find(n=>n instanceof Error)}function $t(e,n){const r=d=>{throw Wt(d,n)},a=(d,{checkArgsForErrors:u=!0}={})=>(...c)=>{const s=c.flatMap(ae);if(u){const l=O(s);l&&r(l)}const i=d(...s);return i instanceof Error?r(i):i},h=(d,{toText:u=!1}={})=>c=>{const s=E(c),i=O([s]);i&&r(i);const l=d(u?P(s):s);return l instanceof Error?r(l):l};return{IF:(d,u,c,s)=>{const i=Pt(u,d,n);if(c==null)throw n.NA;return i?c:s??!1},MAX:a(e.MAX),MIN:a(e.MIN),MAXA:a(e.MAXA),MINA:a(e.MINA),MEDIAN:a(e.MEDIAN),COUNTA:a(e.COUNTA,{checkArgsForErrors:!1}),LARGE:(d,u)=>{const c=ae(d),s=E(u),i=O([...c,s]);i&&r(i);const l=e.LARGE(c,s);return l instanceof Error?r(l):l},SMALL:(d,u)=>{const c=ae(d),s=E(u),i=O([...c,s]);i&&r(i);const l=e.SMALL(c,s);return l instanceof Error?r(l):l},PERMUT:(d,u)=>{const c=[E(d),E(u)],s=O(c);s&&r(s);const i=e.PERMUT(c[0],c[1]);return i instanceof Error?r(i):i},PERMUTATIONA:(d,u)=>{const c=[E(d),E(u)],s=O(c);s&&r(s);const i=e.PERMUTATIONA(c[0],c[1]);return i instanceof Error?r(i):i},MATCH:(d,u)=>{const c=E(d),s=ae(u),i=O([c,...s]);i&&r(i);const l=e.MATCH(c,s,0);return l instanceof Error?r(l):l},SWITCH:(...d)=>{const u=d.map(E),c=O(u);c&&r(c);const s=e.SWITCH(...u);return s instanceof Error?r(s):s},SUBSTITUTE:(d,u,c,s)=>{const i=[P(E(d)),P(E(u)),P(E(c))];s!==void 0&&i.push(E(s));const l=O(i);l&&r(l);const g=e.SUBSTITUTE(...i);return g instanceof Error?r(g):g},TEXTJOIN:(d,u,...c)=>{const s=P(E(d)),i=E(u),l=c.flatMap(ae).map(P),g=O([s,i]);g&&r(g);const p=e.TEXTJOIN(s,i,l);return p instanceof Error?r(p):p},UPPER:h(e.UPPER),YEAR:h(e.YEAR),MONTH:h(e.MONTH),DAY:h(e.DAY),WEEKDAY:(d,u)=>{const c=E(d),s=E(u),i=O([c]);i&&r(i);const l=e.WEEKDAY(c,s);return l instanceof Error?r(l):l},CONCATENATE:(...d)=>{const u=d.flatMap(ae),c=O(u);c&&r(c);const s=e.CONCATENATE(...u.map(P));return s instanceof Error?r(s):s},CONCAT:(...d)=>{const u=d.flatMap(ae),c=O(u);c&&r(c);const s=e.CONCAT(...u.map(P));return s instanceof Error?r(s):s},LEN:h(e.LEN,{toText:!0}),TRIM:h(e.TRIM,{toText:!0}),LOWER:h(e.LOWER,{toText:!0}),LEFT:(d,u)=>{const c=E(d),s=he(u),i=O([c]);i&&r(i);const l=e.LEFT(P(c),s);return l instanceof Error?r(l):l},RIGHT:(d,u)=>{const c=E(d),s=he(u),i=O([c]);i&&r(i);const l=e.RIGHT(P(c),s);return l instanceof Error?r(l):l},MID:(d,u,c)=>{const s=E(d),i=E(u),l=E(c),g=O([s,i,l]);g&&r(g);const p=e.MID(P(s),i,l);return p instanceof Error?r(p):p},FIND:(d,u,c)=>{const s=E(d),i=E(u),l=he(c),g=O([s,i]);g&&r(g);const p=e.FIND(P(s),P(i),l);return p instanceof Error?r(p):p},SEARCH:(d,u,c)=>{const s=E(d),i=E(u),l=he(c),g=O([s,i]);g&&r(g);const p=e.SEARCH(P(s),P(i),l);return p instanceof Error?r(p):p}}}const _t={"#REF!":"REF","#VALUE!":"VALUE","#DIV/0!":"DIV0","#NAME?":"NAME","#N/A":"NA","#NUM!":"NUM","#NULL!":"NULL"};function Ee(e){return _t[e.error]??"ERROR"}function Re(e,n){if(e instanceof V)return e;if(e instanceof n){const r=e.details;return r instanceof V?r:r instanceof n?new V(Ee(r),r.message):new V(Ee(e),e.message)}return new V("ERROR",e instanceof Error?e.message:void 0)}function Vt(e){return Math.max(0,...e.map(n=>(n==null?void 0:n.length)??0))}function Ht(e){return n=>{const r=e[n.row-1];if(n.row<1||n.col<1||r==null||n.col-1>=r.length)throw new V("REF");const a=r[n.col-1];return a==null||a===""?null:a}}function Gt(e){return n=>{const r=Math.min(n.from.row,n.to.row),a=Math.min(n.from.col,n.to.col),h=Math.max(n.from.row,n.to.row),d=Math.max(n.from.col,n.to.col),u=Vt(e);if(r>e.length||a>u)throw new V("REF");const c=Math.min(h,e.length),s=[];for(let i=r;i<=c;i++){const l=e[i-1],g=[];if(l!=null){const p=Math.min(d,l.length);for(let f=a;f<=p;f++){const m=l[f-1];g.push(m==null||m===""?null:m)}}s.push(g)}return s}}function Jt(e){if(e==null||e==="")return null;if(typeof e=="number"||typeof e=="string"||typeof e=="boolean"||e instanceof Date)return e;throw new V("VALUE")}async function Kt(e,n){if(typeof n!="string")throw new V("ERROR");const r=n.trim();if(r==="")throw new V("ERROR");const a=r.startsWith("=")?r.slice(1):r;Bt(a);const[h,d]=await Promise.all([import("fast-formula-parser"),import("@formulajs/formulajs")]),u=h.default??h,c=u.FormulaError,s=new u({onCell:Ht(e),onRange:Gt(e),functions:$t(d,c)});let i;try{i=s.parse(a,{row:1,col:1,sheet:"Sheet1"})}catch(l){throw Re(l,c)}if(i instanceof c)throw Re(i,c);return Jt(i)}const we={REF:"#REF!",VALUE:"#VALUE!",DIV0:"#DIV/0!",NAME:"#NAME?",ERROR:"#ERROR!",NA:"#N/A",NUM:"#NUM!",NULL:"#NULL!"};async function Xt(e,n){return e.length===0?n.map(r=>({label:(r==null?void 0:r.label)??"(unknown)",value:null,error:we.ERROR})):Promise.all(n.map(async r=>{try{if(!r||typeof r.label!="string"||typeof r.expression!="string")throw new V("ERROR");return{label:r.label,value:await Kt(e,r.expression)}}catch(a){const h=a instanceof V?a.code:"ERROR";return{label:(r==null?void 0:r.label)??"(unknown)",value:null,error:we[h]}}}))}const qt=".xlsx,.xls,.csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/csv",Yt=10*1024*1024,me=200,Zt=50,Qt=[];function fe(e){return e==null||e===""?"":e instanceof Date?e.toLocaleDateString():String(e)}const er=({data:e,handleChange:n,path:r,label:a,required:h,schema:d,enabled:u,errors:c,visible:s=!0})=>{var xe;ce(s,r,n,null);const i=!c||c.length===0,l=u!==!1,g=(d==null?void 0:d["x-spreadsheet"])??{},p=(d==null?void 0:d["x-evaluate"])??Qt,f=g.accept??qt,m=g.maxSize??Yt,R=g.persistSheet!==!1,F=g.columnHeader===!0,C=g.rowHeader===!0,A=g.showSheet!==!1,N=g.sheetName,S=e??null,[D,M]=v.useState(()=>{var x;return S!=null&&S.sheet||(((x=S==null?void 0:S.derivations)==null?void 0:x.length)??0)>0?"ready":"empty"}),[ee,z]=v.useState(null),[oe,$]=v.useState(!1),[U,G]=v.useState(null),te=v.useRef(null),I=U??(S==null?void 0:S.sheet)??null,se=(S==null?void 0:S.derivations)??[],H=I!=null||S!=null,le=v.useCallback(async x=>{if(z(null),x.size>m){z(`File exceeds the ${ue(m)} limit.`);return}if(!f.split(",").map(k=>k.trim()).some(k=>k==="*"||k==="*/*"?!0:k.endsWith("/*")?x.type.startsWith(k.slice(0,-1)):k.startsWith(".")?x.name.toLowerCase().endsWith(k.toLowerCase()):x.type===k)){z(`Invalid type. Accepted: ${de(f)}`);return}M("parsing");let Z;try{const k=await x.arrayBuffer();Z=Nt(k,N).matrix}catch(k){M("error"),z(k instanceof Te?k.message:"This doesn't look like a valid spreadsheet. Please check the file and try again.");return}G(Z);const Q=await Xt(Z,p);n(r,R?{sheet:Z,derivations:Q}:{derivations:Q}),M("ready")},[f,m,R,N,p,r,n]);if(s===!1||!l&&!H)return null;const J=x=>{x.preventDefault(),x.stopPropagation(),l&&$(x.type==="dragenter"||x.type==="dragover")},q=x=>{var j;x.preventDefault(),x.stopPropagation(),$(!1),l&&(j=x.dataTransfer.files)!=null&&j[0]&&le(x.dataTransfer.files[0])},re=x=>{var j;(j=x.target.files)!=null&&j[0]&&(le(x.target.files[0]),x.target.value="")},T=()=>{l&&(G(null),z(null),M("empty"),n(r,null))},w=F?1:0,L=C?1:0,b=I?I.slice(w):[],B=b.slice(0,me),K=Math.min(Zt,Math.max(0,...B.map(x=>Math.max(0,x.length-L)))),X=Array.from({length:K},(x,j)=>j+L),Y=A&&I==null&&S!=null,pe=F&&C?fe((xe=I==null?void 0:I[0])==null?void 0:xe[0]):"";return t.jsxs(o.Box,{mb:"4",children:[t.jsxs(o.Flex,{align:"center",justify:"between",mb:"2",children:[t.jsxs(o.Text,{as:"label",size:"2",weight:"bold",children:[a,h&&t.jsx(o.Text,{color:"red",children:" *"})]}),t.jsxs(o.Text,{size:"1",color:"gray",children:[ue(m)," max · ",de(f)]})]}),H&&t.jsx(o.Card,{size:"2",variant:"surface",mb:"2",children:t.jsxs(o.Flex,{align:"center",gap:"3",children:[t.jsx(o.Box,{style:{background:"var(--blue-3)",padding:8,borderRadius:6,color:"var(--blue-9)",flexShrink:0},children:t.jsx(_.FileTextIcon,{width:"20",height:"20"})}),t.jsx(o.Box,{style:{flex:1},children:t.jsx(o.Text,{size:"2",weight:"bold",children:"Spreadsheet uploaded"})}),t.jsx(_.CheckCircledIcon,{style:{color:"var(--green-9)",width:18,height:18}}),l&&t.jsx(o.IconButton,{variant:"ghost",color:"gray",onClick:T,"aria-label":"Remove spreadsheet",children:t.jsx(_.Cross2Icon,{})})]})}),l&&t.jsxs("div",{role:"button",tabIndex:0,onClick:()=>{var x;return(x=te.current)==null?void 0:x.click()},onKeyDown:x=>{var j;(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),(j=te.current)==null||j.click())},onDragEnter:J,onDragLeave:J,onDragOver:J,onDrop:q,style:{cursor:"pointer"},className:["border-2 border-dashed rounded-lg p-6 text-center","transition-all duration-200 ease-in-out",oe?"border-blue-500 bg-blue-50":ee?"border-red-300 bg-red-50":"border-gray-300 hover:border-blue-400 hover:bg-gray-50"].join(" "),children:[t.jsx("input",{ref:te,type:"file",style:{display:"none"},accept:f,onChange:re}),t.jsx(o.Flex,{direction:"column",align:"center",gap:"2",children:D==="parsing"?t.jsxs(t.Fragment,{children:[t.jsx(o.Spinner,{size:"3"}),t.jsx(o.Text,{size:"2",color:"gray",children:"Parsing spreadsheet…"})]}):ee?t.jsxs(t.Fragment,{children:[t.jsx(_.ExclamationTriangleIcon,{style:{width:32,height:32,color:"var(--red-9)"}}),t.jsx(o.Text,{size:"2",color:"red",weight:"medium",children:ee}),t.jsx(o.Text,{size:"1",color:"gray",children:"Click to try again"})]}):t.jsxs(t.Fragment,{children:[t.jsx(_.UploadIcon,{style:{width:32,height:32,color:"var(--gray-8)"}}),t.jsx(o.Text,{size:"2",weight:"medium",children:H?"Click to upload a replacement":"Click to upload or drag and drop"}),t.jsxs(o.Text,{size:"1",color:"gray",children:[ue(m)," max · ",de(f)]})]})})]}),I&&A&&t.jsxs(o.Box,{mt:"3",children:[t.jsx(o.Box,{style:{overflow:"auto",maxHeight:420},children:t.jsxs(o.Table.Root,{variant:"surface",size:"1",children:[t.jsx(o.Table.Header,{children:t.jsxs(o.Table.Row,{children:[t.jsx(o.Table.ColumnHeaderCell,{children:pe}),X.map(x=>{var j;return t.jsx(o.Table.ColumnHeaderCell,{children:F?fe((j=I[0])==null?void 0:j[x]):It(x)},x)})]})}),t.jsx(o.Table.Body,{children:B.map((x,j)=>{var Z;const ie=w+j;return t.jsxs(o.Table.Row,{children:[t.jsx(o.Table.RowHeaderCell,{children:C?fe((Z=I[ie])==null?void 0:Z[0]):ie+1}),X.map(Q=>t.jsx(o.Table.Cell,{children:fe(x[Q])},Q))]},j)})})]})}),b.length>me&&t.jsxs(o.Text,{size:"1",color:"gray",mt:"1",style:{display:"block"},children:["Showing first ",me," of ",b.length," rows"]})]}),Y&&t.jsx(o.Text,{size:"2",color:"gray",mt:"3",style:{display:"block"},children:"Sheet preview not stored for this field — re-upload to view contents."}),se.length>0&&t.jsxs(o.Box,{mt:"3",children:[t.jsx(o.Text,{size:"2",weight:"bold",as:"div",mb:"1",children:"Computed values"}),t.jsx(o.Flex,{direction:"column",gap:"1",children:se.map((x,j)=>t.jsxs(o.Flex,{justify:"between",children:[t.jsx(o.Text,{size:"2",children:x.label}),x.error?t.jsx(o.Text,{size:"2",color:"red",children:x.error}):t.jsx(o.Text,{size:"2",children:fe(x.value)})]},j))})]}),!i&&t.jsx(o.Text,{color:"red",size:"1",mt:"2",style:{display:"block"},children:ne(c,a)})]})},rt=W.withJsonFormsControlProps(er),nt=y.rankWith(10,y.schemaMatches(e=>e.type==="object"&&typeof e["x-spreadsheet"]=="object")),tr=({data:e,path:n,schema:r,uischema:a,enabled:h,visible:d,addItem:u,removeItems:c,rootSchema:s,arraySchema:i})=>{const l=i?r:r.items,g=i||r;if(d===!1||!l||typeof l!="object"||Array.isArray(l))return null;const p=l,f=Array.isArray(e)?e:[],m=g.title||"Array Items",R=()=>{const C=y.createDefaultValue(p,s);u&&u(n,C)()},F=C=>{if(c){const A=c(n,[C]);A&&A()}};return t.jsx(o.Box,{mb:"6",children:t.jsxs(o.Flex,{direction:"column",gap:"4",children:[t.jsx(o.Text,{as:"div",size:"4",weight:"bold",children:m}),f.length===0&&t.jsx(o.Box,{py:"4",px:"4",style:{backgroundColor:"var(--gray-3)",borderRadius:"var(--radius-3)"},children:t.jsx(o.Text,{size:"2",color:"gray",children:"No items have been added yet."})}),f.map((C,A)=>{var S;const N=`${n}.${A}`;return t.jsx(o.Card,{size:"3",variant:"surface",children:t.jsxs(o.Flex,{direction:"column",gap:"4",children:[t.jsxs(o.Flex,{justify:"between",align:"center",children:[t.jsxs(o.Text,{size:"3",weight:"bold",children:["Item ",A+1]}),h&&t.jsxs(o.Button,{type:"button",color:"red",variant:"soft",onClick:()=>F(A),title:"Remove item",children:[t.jsx(_.TrashIcon,{}),"Remove"]})]}),t.jsx(o.Box,{children:t.jsx(W.JsonFormsDispatch,{schema:p,uischema:((S=a.options)==null?void 0:S.detail)||(p.type==="object"||p.properties?{type:"VerticalLayout",elements:Object.keys(p.properties||{}).map(D=>({type:"Control",scope:`#/properties/${D}`}))}:{type:"Control",scope:"#"}),path:N,enabled:h,renderers:void 0,cells:void 0})})]})},N)}),h&&t.jsx(o.Box,{mt:"2",children:t.jsxs(o.Button,{type:"button",variant:"surface",onClick:R,children:[t.jsx(_.PlusIcon,{}),"Add Item"]})})]})})},ye=W.withJsonFormsArrayControlProps(tr),ot=y.rankWith(3,y.isObjectArrayControl),st=({uischema:e,visible:n})=>{const r=e;return n===!1?null:t.jsx(o.Box,{mb:"4",children:t.jsx(o.Heading,{size:"4",children:r.text})})},lt=y.rankWith(1,y.uiTypeIs("Label")),rr=y.rankWith(3,y.isPrimitiveArrayControl),nr=[{tester:Oe,renderer:Tt},{tester:ke,renderer:yt},{tester:Me,renderer:vt},{tester:Ue,renderer:bt},{tester:$e,renderer:We},{tester:Pe,renderer:jt},{tester:Ve,renderer:St},{tester:Ge,renderer:He},{tester:Ke,renderer:Je},{tester:qe,renderer:Xe},{tester:Ze,renderer:Ye},{tester:et,renderer:Qe},{tester:nt,renderer:rt},{tester:ot,renderer:ye},{tester:rr,renderer:ye},{tester:lt,renderer:st}];exports.ArrayControl=ye;exports.ArrayControlTester=ot;exports.BooleanControl=De;exports.BooleanControlTester=Me;exports.CategorizationLayoutRenderer=Ye;exports.CategorizationLayoutTester=Ze;exports.DateControl=_e;exports.DateControlTester=Ve;exports.FileControl=Qe;exports.FileControlTester=et;exports.GroupLayoutRenderer=Xe;exports.GroupLayoutTester=qe;exports.HorizontalLayoutRenderer=Je;exports.HorizontalLayoutTester=Ke;exports.LabelRenderer=st;exports.LabelTester=lt;exports.NumberControl=Le;exports.NumberControlTester=ke;exports.RadioControl=ze;exports.RadioControlTester=Ue;exports.SearchSelectControl=We;exports.SearchSelectControlTester=$e;exports.SearchServiceProvider=mt;exports.SelectControl=Be;exports.SelectControlTester=Pe;exports.SpreadsheetControl=rt;exports.SpreadsheetControlTester=nt;exports.TextControl=Ie;exports.TextControlTester=Oe;exports.UploadProvider=gt;exports.VerticalLayoutRenderer=He;exports.VerticalLayoutTester=Ge;exports.radixRenderers=nr;exports.useSearchService=Ne;exports.useUpload=Ae;
|