@object-ui/fields 3.1.1 → 3.1.3

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.
@@ -9,6 +9,13 @@ export interface CellRendererProps {
9
9
  isEditing?: boolean;
10
10
  onChange?: (value: any) => void;
11
11
  }
12
+ /**
13
+ * Coerce a value to a safe primitive for rendering.
14
+ * Handles MongoDB wrapper types ($numberDecimal, $oid, $date), expanded
15
+ * reference objects, and arrays so that no raw object is ever passed as
16
+ * a React child — preventing React error #310.
17
+ */
18
+ export declare function coerceToSafeValue(value: unknown): string | number | boolean | null | undefined;
12
19
  /**
13
20
  * Format currency value
14
21
  */
@@ -1,6 +1,17 @@
1
1
  import { FieldWidgetProps } from './types';
2
+ export interface LookupOption {
3
+ value: string | number;
4
+ label: string;
5
+ description?: string;
6
+ [key: string]: any;
7
+ }
2
8
  /**
3
- * Lookup field for selecting related records
4
- * Supports single and multi-select with search
9
+ * Lookup field for selecting related records.
10
+ * Supports single and multi-select with search.
11
+ *
12
+ * When a `dataSource` is provided (either via props, via `field.dataSource`,
13
+ * or via SchemaRendererContext), the dialog will dynamically load records
14
+ * from the referenced object using `DataSource.find()`.
15
+ * Falls back to static `options` when no DataSource is available.
5
16
  */
6
17
  export declare function LookupField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): import("react/jsx-runtime").JSX.Element;
package/dist/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),b=require("@object-ui/core"),d=require("@object-ui/components"),_=require("lucide-react");var X={exports:{}},V={};var Ge;function ht(){if(Ge)return V;Ge=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(a,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:i}}return V.Fragment=r,V.jsx=n,V.jsxs=n,V}var Y={};var Je;function bt(){return Je||(Je=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===I?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case k:return"Fragment";case P:return"Profiler";case v:return"StrictMode";case j:return"Suspense";case S:return"SuspenseList";case O:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case F:return"Portal";case B:return u.displayName||"Context";case z:return(u._context.displayName||"Context")+".Consumer";case W:var y=u.render;return u=u.displayName,u||(u=y.displayName||y.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case A:return y=u.displayName||null,y!==null?y:e(u.type)||"Memo";case $:y=u._payload,u=u._init;try{return e(u(y))}catch{}}return null}function r(u){return""+u}function n(u){try{r(u);var y=!1}catch{y=!0}if(y){y=console;var w=y.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return w.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),r(u)}}function a(u){if(u===k)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===$)return"<...>";try{var y=e(u);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var u=L.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function l(u){if(D.call(u,"key")){var y=Object.getOwnPropertyDescriptor(u,"key").get;if(y&&y.isReactWarning)return!1}return u.key!==void 0}function o(u,y){function w(){Ue||(Ue=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}w.isReactWarning=!0,Object.defineProperty(u,"key",{get:w,configurable:!0})}function c(){var u=e(this.type);return Be[u]||(Be[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function f(u,y,w,R,Q,re){var T=w.ref;return u={$$typeof:h,type:u,key:y,props:w,_owner:R},(T!==void 0?T:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:c}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function g(u,y,w,R,Q,re){var T=y.children;if(T!==void 0)if(R)if(xt(T)){for(R=0;R<T.length;R++)p(T[R]);Object.freeze&&Object.freeze(T)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(T);if(D.call(y,"key")){T=e(u);var U=Object.keys(y).filter(function(gt){return gt!=="key"});R=0<U.length?"{key: someKey, "+U.join(": ..., ")+": ...}":"{key: someKey}",qe[T+R]||(U=0<U.length?"{"+U.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),v=require("@object-ui/core"),d=require("@object-ui/components"),S=require("lucide-react");var ie={exports:{}},re={};var Xe;function vt(){if(Xe)return re;Xe=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(l,n,a){var i=null;if(a!==void 0&&(i=""+a),n.key!==void 0&&(i=""+n.key),"key"in n){a={};for(var o in n)o!=="key"&&(a[o]=n[o])}else a=n;return n=a.ref,{$$typeof:e,type:l,key:i,ref:n!==void 0?n:null,props:a}}return re.Fragment=r,re.jsx=s,re.jsxs=s,re}var se={};var He;function Ft(){return He||(He=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===V?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case A:return"Fragment";case M:return"Profiler";case z:return"StrictMode";case y:return"Suspense";case w:return"SuspenseList";case P:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case C:return"Portal";case Q:return u.displayName||"Context";case G:return(u._context.displayName||"Context")+".Consumer";case L:var N=u.render;return u=u.displayName,u||(u=N.displayName||N.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case $:return N=u.displayName||null,N!==null?N:e(u.type)||"Memo";case k:N=u._payload,u=u._init;try{return e(u(N))}catch{}}return null}function r(u){return""+u}function s(u){try{r(u);var N=!1}catch{N=!0}if(N){N=console;var T=N.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return T.call(N,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),r(u)}}function l(u){if(u===A)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===k)return"<...>";try{var N=e(u);return N?"<"+N+">":"<...>"}catch{return"<...>"}}function n(){var u=Y.A;return u===null?null:u.getOwner()}function a(){return Error("react-stack-top-frame")}function i(u){if(I.call(u,"key")){var N=Object.getOwnPropertyDescriptor(u,"key").get;if(N&&N.isReactWarning)return!1}return u.key!==void 0}function o(u,N){function T(){J||(J=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",N))}T.isReactWarning=!0,Object.defineProperty(u,"key",{get:T,configurable:!0})}function c(){var u=e(this.type);return B[u]||(B[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function f(u,N,T,R,W,te){var O=T.ref;return u={$$typeof:b,type:u,key:N,props:T,_owner:R},(O!==void 0?O:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:c}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function g(u,N,T,R,W,te){var O=N.children;if(O!==void 0)if(R)if(Qe(O)){for(R=0;R<O.length;R++)p(O[R]);Object.freeze&&Object.freeze(O)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(O);if(I.call(N,"key")){O=e(u);var h=Object.keys(N).filter(function(E){return E!=="key"});R=0<h.length?"{key: someKey, "+h.join(": ..., ")+": ...}":"{key: someKey}",D[O+R]||(h=0<h.length?"{"+h.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,R,T,U,T),qe[T+R]=!0)}if(T=null,w!==void 0&&(n(w),T=""+w),l(y)&&(n(y.key),T=""+y.key),"key"in y){w={};for(var se in y)se!=="key"&&(w[se]=y[se])}else w=y;return T&&o(w,typeof u=="function"?u.displayName||u.name||"Unknown":u),f(u,T,w,s(),Q,re)}function p(u){m(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===$&&(u._payload.status==="fulfilled"?m(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function m(u){return typeof u=="object"&&u!==null&&u.$$typeof===h}var x=C,h=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),B=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),L=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,xt=Array.isArray,te=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(u){return u()}};var Ue,Be={},Ve=x.react_stack_bottom_frame.bind(x,i)(),Ye=te(a(i)),qe={};Y.Fragment=k,Y.jsx=function(u,y,w){var R=1e4>L.recentlyCreatedOwnerStacks++;return g(u,y,w,!1,R?Error("react-stack-top-frame"):Ve,R?te(a(u)):Ye)},Y.jsxs=function(u,y,w){var R=1e4>L.recentlyCreatedOwnerStacks++;return g(u,y,w,!0,R?Error("react-stack-top-frame"):Ve,R?te(a(u)):Ye)}})()),Y}var We;function jt(){return We||(We=1,process.env.NODE_ENV==="production"?X.exports=ht():X.exports=bt()),X.exports}var t=jt();function ie({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema;if(a)return t.jsx("span",{className:"text-sm",children:e||"-"});const l=i?.rows,{inputType:o,...c}=s;return l&&l>1?t.jsx(d.Textarea,{...c,value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder,disabled:a||c.disabled}):t.jsx(d.Input,{...c,type:i?.type==="password"?"password":"text",value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder,disabled:a||c.disabled})}const yt=Object.freeze(Object.defineProperty({__proto__:null,TextField:ie},Symbol.toStringTag,{value:"Module"}));function oe({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e??"-"});const i=n||s.schema,l=i?.precision,{inputType:o,...c}=s;return t.jsx(d.Input,{...c,type:"number",value:e??"",onChange:f=>{const g=f.target.value;r(g===""?null:Number(g))},placeholder:i?.placeholder,disabled:a||c.disabled,step:l?Math.pow(10,-l):"any"})}const Nt=Object.freeze(Object.defineProperty({__proto__:null,NumberField:oe},Symbol.toStringTag,{value:"Module"}));function ce({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.widget,o=C.useId(),c=i?.name||o,f=i?.label||"Checkbox";if(a)return t.jsx("span",{className:"text-sm",children:e?"Yes":"No"});const{inputType:g,...p}=s;return l==="checkbox"?t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d.Checkbox,{...p,id:c,checked:!!e,onCheckedChange:m=>r(!!m),disabled:a||p.disabled}),t.jsx(d.Label,{htmlFor:c,children:f})]}):t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d.Switch,{...p,id:c,checked:!!e,onCheckedChange:r,disabled:a||p.disabled}),t.jsx(d.Label,{htmlFor:c,children:f})]})}const vt=Object.freeze(Object.defineProperty({__proto__:null,BooleanField:ce},Symbol.toStringTag,{value:"Module"}));function de({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.options||[];if(a){const o=l.find(c=>c.value===e);return t.jsx("span",{className:"text-sm",children:o?.label||e||"-"})}return t.jsxs(d.Select,{...s,value:e,onValueChange:r,disabled:a||s.disabled,children:[t.jsx(d.SelectTrigger,{className:s.className,id:s.id,children:t.jsx(d.SelectValue,{placeholder:i?.placeholder||"Select an option"})}),t.jsx(d.SelectContent,{position:"popper",children:l.map(o=>t.jsx(d.SelectItem,{value:o.value,children:o.label},o.value))})]})}const Ft=Object.freeze(Object.defineProperty({__proto__:null,SelectField:de},Symbol.toStringTag,{value:"Module"}));function ue({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e?new Date(e).toLocaleDateString():"-"});const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"date",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const _t=Object.freeze(Object.defineProperty({__proto__:null,DateField:ue},Symbol.toStringTag,{value:"Module"}));function me({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?t.jsx("a",{href:`mailto:${e}`,className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"email",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"email@example.com",disabled:a||c.disabled,"aria-invalid":!!s})}const Ct=Object.freeze(Object.defineProperty({__proto__:null,EmailField:me},Symbol.toStringTag,{value:"Module"}));function fe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?t.jsx("a",{href:`tel:${e}`,className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"tel",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"(555) 123-4567",disabled:a||c.disabled,"aria-invalid":!!s})}const wt=Object.freeze(Object.defineProperty({__proto__:null,PhoneField:fe},Symbol.toStringTag,{value:"Module"}));function pe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){const l=n||i.schema;if(a)return e?e.startsWith("http://")||e.startsWith("https://")?t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=i;return t.jsx(d.Input,{...c,type:"url",value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"https://example.com",disabled:a||c.disabled,"aria-invalid":!!s})}const St=Object.freeze(Object.defineProperty({__proto__:null,UrlField:pe},Symbol.toStringTag,{value:"Module"}));function Rt(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}catch{return`${r} ${e.toFixed(2)}`}}function xe({value:e,onChange:r,field:n,readonly:a,errorMessage:s,className:i,...l}){const o=n||l.schema,c=o?.currency||"USD",f=o?.precision??2;if(a)return e==null?t.jsx("span",{className:"text-sm",children:"-"}):t.jsx("span",{className:"text-sm font-medium tabular-nums",children:Rt(Number(e),c)});const g=p=>{const m=parseFloat(p.target.value);isNaN(m)||r(parseFloat(m.toFixed(f)))};return t.jsxs("div",{className:"relative",children:[t.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:c==="USD"?"$":c}),t.jsx(d.Input,{...l,type:"number",value:e??"",onChange:p=>{const m=p.target.value===""?null:parseFloat(p.target.value);r(m)},onBlur:g,placeholder:o?.placeholder||"0.00",disabled:a||l.disabled,className:`pl-8 ${i||""}`,step:Math.pow(10,-f).toFixed(f),"aria-invalid":!!s})]})}const Tt=Object.freeze(Object.defineProperty({__proto__:null,CurrencyField:xe},Symbol.toStringTag,{value:"Module"}));function ge({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){if(a)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:e||"-"});const l=n||i.schema,o=l?.rows||4,c=l?.max_length,{inputType:f,...g}=i;return t.jsxs("div",{className:"relative",children:[t.jsx(d.Textarea,{...g,value:e||"",onChange:p=>r(p.target.value),placeholder:l?.placeholder,disabled:a||g.disabled,rows:o,maxLength:c,"aria-invalid":!!s}),c&&t.jsxs("div",{className:"absolute bottom-2 right-2 text-xs text-gray-400","aria-live":"polite","aria-label":`Character count: ${(e||"").length} of ${c}`,children:[(e||"").length,"/",c]})]})}const Pt=Object.freeze(Object.defineProperty({__proto__:null,TextAreaField:ge},Symbol.toStringTag,{value:"Module"}));function H({value:e,onChange:r,field:n,readonly:a,errorMessage:s,...i}){if(a)return t.jsx("div",{className:"text-sm prose prose-sm max-w-none",children:e||"-"});const l=n||i.schema,o=l?.rows||8,c=l?.format||"markdown";return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[t.jsxs("span",{children:["Format: ",c]}),t.jsx("span",{className:"italic",children:"Rich text editor (basic)"})]}),t.jsx(d.Textarea,{value:e||"",onChange:f=>r(f.target.value),placeholder:l?.placeholder||"Enter text...",disabled:a||i.disabled,rows:o,className:`font-mono text-sm ${i.className||""}`,"aria-invalid":!!s})]})}const Qe=Object.freeze(Object.defineProperty({__proto__:null,RichTextField:H},Symbol.toStringTag,{value:"Module"}));function he({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),[o,c]=C.useState(""),f=n||s.schema,g=f?.options||[],p=f.multiple||!1,m=f.display_field||"label",x=g.filter(v=>v.label.toLowerCase().includes(o.toLowerCase())),h=p?(Array.isArray(e)?e:[]).map(v=>g.find(P=>P.value===v)).filter(Boolean):e?[g.find(v=>v.value===e)].filter(Boolean):[],F=v=>{if(p){const P=Array.isArray(e)?e:[],z=P.includes(v.value);r(z?P.filter(B=>B!==v.value):[...P,v.value])}else r(v.value),l(!1)},k=v=>{if(p){const P=Array.isArray(e)?e:[];r(P.filter(z=>z!==v))}else r(null)};return a?h.length?p?t.jsx("div",{className:"flex flex-wrap gap-1",children:h.map((v,P)=>t.jsx(d.Badge,{variant:"outline",children:v?.[m]||v?.label},P))}):t.jsx("span",{className:"text-sm",children:h[0]?.[m]||h[0]?.label}):t.jsx("span",{className:"text-sm",children:"-"}):t.jsxs("div",{className:"space-y-2",children:[h.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1",children:h.map((v,P)=>t.jsxs(d.Badge,{variant:"outline",className:"gap-1",children:[v?.[m]||v?.label,t.jsx("button",{onClick:()=>k(v?.value),className:"ml-1 hover:text-destructive",type:"button","aria-label":`Remove ${v?.[m]||v?.label}`,children:t.jsx(_.X,{className:"size-3"})})]},P))}),t.jsxs(d.Dialog,{open:i,onOpenChange:l,children:[t.jsx(d.DialogTrigger,{asChild:!0,children:t.jsxs(d.Button,{variant:"outline",className:"w-full justify-start text-left font-normal",type:"button",children:[t.jsx(_.Search,{className:"mr-2 size-4"}),h.length===0?f?.placeholder||"Select...":p?`${h.length} selected`:"Change selection"]})}),t.jsxs(d.DialogContent,{className:"max-w-md",children:[t.jsx(d.DialogHeader,{children:t.jsxs(d.DialogTitle,{children:[f?.label||"Select"," ",p&&"(multiple)"]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(d.Input,{placeholder:"Search...",value:o,onChange:v=>c(v.target.value),className:"w-full"}),t.jsx("div",{className:"max-h-64 overflow-y-auto space-y-1",children:x.length===0?t.jsx("p",{className:"text-sm text-gray-500 text-center py-4",children:"No options found"}):x.map(v=>{const P=p?(Array.isArray(e)?e:[]).includes(v.value):e===v.value;return t.jsxs("button",{onClick:()=>F(v),className:`w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-100 flex items-center justify-between ${P?"bg-blue-50 text-blue-700":""}`,type:"button",children:[t.jsx("span",{children:v.label}),P&&t.jsx(d.Badge,{variant:"default",className:"ml-2",children:"Selected"})]},v.value)})})]})]})]})]})}const Ot=Object.freeze(Object.defineProperty({__proto__:null,LookupField:he},Symbol.toStringTag,{value:"Module"}));function be({value:e,onChange:r,field:n,readonly:a,...s}){if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const o=new Date(e);return t.jsxs("span",{className:"text-sm",children:[o.toLocaleDateString()," ",o.toLocaleTimeString()]})}const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"datetime-local",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const kt=Object.freeze(Object.defineProperty({__proto__:null,DateTimeField:be},Symbol.toStringTag,{value:"Module"}));function je({value:e,onChange:r,field:n,readonly:a,...s}){if(a)return t.jsx("span",{className:"text-sm",children:e||"-"});const{inputType:i,...l}=s;return t.jsx(d.Input,{...l,type:"time",value:e||"",onChange:o=>r(o.target.value),disabled:a||l.disabled})}const At=Object.freeze(Object.defineProperty({__proto__:null,TimeField:je},Symbol.toStringTag,{value:"Module"}));function ye({value:e,onChange:r,field:n,readonly:a,errorMessage:s,className:i,...l}){const o=n||l.schema,c=o?.precision??2;if(a)return e==null?t.jsx("span",{className:"text-sm",children:"-"}):t.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[(e*100).toFixed(c),"%"]});const f=e!=null?e*100:"",g=e!=null?e*100:0,p=h=>{if(h.target.value===""){r(null);return}const F=parseFloat(h.target.value),k=isNaN(F)?null:F/100;r(k)},m=h=>{if(a||l.disabled)return;if(!Array.isArray(h)||h.length===0){r(null);return}const F=h[0],k=typeof F=="number"?F/100:null;r(k)},x=Math.pow(10,-c);return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"relative",children:[t.jsx(d.Input,{...l,type:"number",value:f,onChange:p,placeholder:o?.placeholder||"0",disabled:a||l.disabled,className:`pr-8 ${i||""}`,step:Math.pow(10,-c).toFixed(c),"aria-invalid":!!s}),t.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:"%"})]}),t.jsx(d.Slider,{value:[g],onValueChange:m,min:0,max:100,step:x,disabled:a||l.disabled,className:"w-full","aria-label":"Percentage","data-testid":"percent-slider"})]})}const $t=Object.freeze(Object.defineProperty({__proto__:null,PercentField:ye},Symbol.toStringTag,{value:"Module"}));function Ne({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const[l,o]=C.useState(!1),c=n||i.schema;if(a)return t.jsx("span",{className:"text-sm",children:"••••••••"});const{inputType:f,...g}=i;return t.jsxs("div",{className:"relative",children:[t.jsx(d.Input,{...g,type:l?"text":"password",value:e||"",onChange:p=>r(p.target.value),placeholder:c?.placeholder,disabled:a||g.disabled,className:`pr-10 ${s||""}`}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>o(!l),tabIndex:-1,children:l?t.jsx(_.EyeOff,{className:"size-4 text-gray-500"}):t.jsx(_.Eye,{className:"size-4 text-gray-500"})})]})}const Et=Object.freeze(Object.defineProperty({__proto__:null,PasswordField:Ne},Symbol.toStringTag,{value:"Module"}));function ve({value:e,onChange:r,field:n,readonly:a,...s}){const i=C.useRef(null),l=n||s.schema,o=l?.multiple||!1,c=l?.accept?l.accept.join(","):void 0,f=l?.maxSize,[g,p]=C.useState(!1),[m,x]=C.useState([]),h=e?Array.isArray(e)?e:[e]:[],F=C.useCallback(j=>{if(j.length===0)return;const S=[],A=j.filter(O=>{if(f&&O.size>f){const I=(f/1048576).toFixed(1);return S.push(`"${O.name}" exceeds max size (${I} MB)`),!1}return!0});if(x(S),A.length===0)return;const $=A.map(O=>({name:O.name,original_name:O.name,size:O.size,mime_type:O.type,url:URL.createObjectURL(O)}));r(o?[...h,...$]:$[0])},[h,o,r,f]),k=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!0)},[]),v=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!1)},[]),P=C.useCallback(j=>{j.preventDefault(),j.stopPropagation(),p(!1);const S=Array.from(j.dataTransfer.files);if(c){const A=c.split(",").map(O=>O.trim().toLowerCase()),$=S.filter(O=>{const I=O.name.split("."),L=I.length>1?"."+I.pop()?.toLowerCase():"";return A.some(D=>D===O.type||L&&D===L||D.endsWith("/*")&&O.type.startsWith(D.replace("/*","/")))});F($)}else F(S)},[c,F]);if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const j=Array.isArray(e)?e:[e];return t.jsx("div",{className:"flex flex-wrap gap-2",children:j.map((S,A)=>t.jsx("span",{className:"text-sm truncate max-w-xs",children:S.name||S.original_name||"File"},A))})}const z=j=>{F(Array.from(j.target.files||[]))},B=j=>{if(o){const S=h.filter((A,$)=>$!==j);r(S.length>0?S:null)}else r(null)},W=j=>(j.mime_type||"").startsWith("image/");return t.jsxs("div",{className:s.className,children:[t.jsx("input",{ref:i,type:"file",multiple:o,accept:c,onChange:z,className:"hidden"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{onDragOver:k,onDragLeave:v,onDrop:P,onClick:()=>i.current?.click(),className:`
6
+ <%s key={someKey} {...props} />`,R,O,h,O),D[O+R]=!0)}if(O=null,T!==void 0&&(s(T),O=""+T),i(N)&&(s(N.key),O=""+N.key),"key"in N){T={};for(var F in N)F!=="key"&&(T[F]=N[F])}else T=N;return O&&o(T,typeof u=="function"?u.displayName||u.name||"Unknown":u),f(u,O,T,n(),W,te)}function p(u){m(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===k&&(u._payload.status==="fulfilled"?m(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function m(u){return typeof u=="object"&&u!==null&&u.$$typeof===b}var x=j,b=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),Y=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,Qe=Array.isArray,ee=console.createTask?console.createTask:function(){return null};x={react_stack_bottom_frame:function(u){return u()}};var J,B={},X=x.react_stack_bottom_frame.bind(x,a)(),H=ee(l(a)),D={};se.Fragment=A,se.jsx=function(u,N,T){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(u,N,T,!1,R?Error("react-stack-top-frame"):X,R?ee(l(u)):H)},se.jsxs=function(u,N,T){var R=1e4>Y.recentlyCreatedOwnerStacks++;return g(u,N,T,!0,R?Error("react-stack-top-frame"):X,R?ee(l(u)):H)}})()),se}var Ke;function _t(){return Ke||(Ke=1,process.env.NODE_ENV==="production"?ie.exports=vt():ie.exports=Ft()),ie.exports}var t=_t();function xe({value:e,onChange:r,field:s,readonly:l,...n}){const a=s||n.schema;if(l)return t.jsx("span",{className:"text-sm",children:e||"-"});const i=a?.rows,{inputType:o,...c}=n;return i&&i>1?t.jsx(d.Textarea,{...c,value:e||"",onChange:f=>r(f.target.value),placeholder:a?.placeholder,disabled:l||c.disabled}):t.jsx(d.Input,{...c,type:a?.type==="password"?"password":"text",value:e||"",onChange:f=>r(f.target.value),placeholder:a?.placeholder,disabled:l||c.disabled})}const St=Object.freeze(Object.defineProperty({__proto__:null,TextField:xe},Symbol.toStringTag,{value:"Module"}));function ge({value:e,onChange:r,field:s,readonly:l,...n}){if(l)return t.jsx("span",{className:"text-sm",children:e??"-"});const a=s||n.schema,i=a?.precision,{inputType:o,...c}=n;return t.jsx(d.Input,{...c,type:"number",value:e??"",onChange:f=>{const g=f.target.value;r(g===""?null:Number(g))},placeholder:a?.placeholder,disabled:l||c.disabled,step:i?Math.pow(10,-i):"any"})}const Ct=Object.freeze(Object.defineProperty({__proto__:null,NumberField:ge},Symbol.toStringTag,{value:"Module"}));function he({value:e,onChange:r,field:s,readonly:l,...n}){const a=s||n.schema,i=a?.widget,o=j.useId(),c=a?.name||o,f=a?.label||"Checkbox";if(l)return t.jsx("span",{className:"text-sm",children:e?"Yes":"No"});const{inputType:g,...p}=n;return i==="checkbox"?t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d.Checkbox,{...p,id:c,checked:!!e,onCheckedChange:m=>r(!!m),disabled:l||p.disabled}),t.jsx(d.Label,{htmlFor:c,children:f})]}):t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(d.Switch,{...p,id:c,checked:!!e,onCheckedChange:r,disabled:l||p.disabled}),t.jsx(d.Label,{htmlFor:c,children:f})]})}const wt=Object.freeze(Object.defineProperty({__proto__:null,BooleanField:he},Symbol.toStringTag,{value:"Module"}));function be({value:e,onChange:r,field:s,readonly:l,...n}){const a=s||n.schema,i=a?.options||[];if(l){const o=i.find(c=>c.value===e);return t.jsx("span",{className:"text-sm",children:o?.label||e||"-"})}return t.jsxs(d.Select,{...n,value:e,onValueChange:r,disabled:l||n.disabled,children:[t.jsx(d.SelectTrigger,{className:n.className,id:n.id,children:t.jsx(d.SelectValue,{placeholder:a?.placeholder||"Select an option"})}),t.jsx(d.SelectContent,{position:"popper",children:i.map(o=>t.jsx(d.SelectItem,{value:o.value,children:o.label},o.value))})]})}const Rt=Object.freeze(Object.defineProperty({__proto__:null,SelectField:be},Symbol.toStringTag,{value:"Module"}));function je({value:e,onChange:r,field:s,readonly:l,...n}){if(l)return t.jsx("span",{className:"text-sm",children:e?new Date(e).toLocaleDateString():"-"});const{inputType:a,...i}=n;return t.jsx(d.Input,{...i,type:"date",value:e||"",onChange:o=>r(o.target.value),disabled:l||i.disabled})}const Tt=Object.freeze(Object.defineProperty({__proto__:null,DateField:je},Symbol.toStringTag,{value:"Module"}));function ye({value:e,onChange:r,field:s,readonly:l,errorMessage:n,...a}){const i=s||a.schema;if(l)return e?t.jsx("a",{href:`mailto:${e}`,className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=a;return t.jsx(d.Input,{...c,type:"email",value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder||"email@example.com",disabled:l||c.disabled,"aria-invalid":!!n})}const Pt=Object.freeze(Object.defineProperty({__proto__:null,EmailField:ye},Symbol.toStringTag,{value:"Module"}));function Ne({value:e,onChange:r,field:s,readonly:l,errorMessage:n,...a}){const i=s||a.schema;if(l)return e?t.jsx("a",{href:`tel:${e}`,className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=a;return t.jsx(d.Input,{...c,type:"tel",value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder||"(555) 123-4567",disabled:l||c.disabled,"aria-invalid":!!n})}const Ot=Object.freeze(Object.defineProperty({__proto__:null,PhoneField:Ne},Symbol.toStringTag,{value:"Module"}));function ve({value:e,onChange:r,field:s,readonly:l,errorMessage:n,...a}){const i=s||a.schema;if(l)return e?e.startsWith("http://")||e.startsWith("https://")?t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 hover:underline",children:e}):t.jsx("span",{className:"text-sm",children:e}):t.jsx("span",{className:"text-sm",children:"-"});const{inputType:o,...c}=a;return t.jsx(d.Input,{...c,type:"url",value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder||"https://example.com",disabled:l||c.disabled,"aria-invalid":!!n})}const kt=Object.freeze(Object.defineProperty({__proto__:null,UrlField:ve},Symbol.toStringTag,{value:"Module"}));function At(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}catch{return`${r} ${e.toFixed(2)}`}}function Fe({value:e,onChange:r,field:s,readonly:l,errorMessage:n,className:a,...i}){const o=s||i.schema,c=o?.currency||"USD",f=o?.precision??2;if(l)return e==null?t.jsx("span",{className:"text-sm",children:"-"}):t.jsx("span",{className:"text-sm font-medium tabular-nums",children:At(Number(e),c)});const g=p=>{const m=parseFloat(p.target.value);isNaN(m)||r(parseFloat(m.toFixed(f)))};return t.jsxs("div",{className:"relative",children:[t.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:c==="USD"?"$":c}),t.jsx(d.Input,{...i,type:"number",value:e??"",onChange:p=>{const m=p.target.value===""?null:parseFloat(p.target.value);r(m)},onBlur:g,placeholder:o?.placeholder||"0.00",disabled:l||i.disabled,className:`pl-8 ${a||""}`,step:Math.pow(10,-f).toFixed(f),"aria-invalid":!!n})]})}const $t=Object.freeze(Object.defineProperty({__proto__:null,CurrencyField:Fe},Symbol.toStringTag,{value:"Module"}));function _e({value:e,onChange:r,field:s,readonly:l,errorMessage:n,...a}){if(l)return t.jsx("div",{className:"text-sm whitespace-pre-wrap",children:e||"-"});const i=s||a.schema,o=i?.rows||4,c=i?.max_length,{inputType:f,...g}=a;return t.jsxs("div",{className:"relative",children:[t.jsx(d.Textarea,{...g,value:e||"",onChange:p=>r(p.target.value),placeholder:i?.placeholder,disabled:l||g.disabled,rows:o,maxLength:c,"aria-invalid":!!n}),c&&t.jsxs("div",{className:"absolute bottom-2 right-2 text-xs text-gray-400","aria-live":"polite","aria-label":`Character count: ${(e||"").length} of ${c}`,children:[(e||"").length,"/",c]})]})}const Et=Object.freeze(Object.defineProperty({__proto__:null,TextAreaField:_e},Symbol.toStringTag,{value:"Module"}));function oe({value:e,onChange:r,field:s,readonly:l,errorMessage:n,...a}){if(l)return t.jsx("div",{className:"text-sm prose prose-sm max-w-none",children:e||"-"});const i=s||a.schema,o=i?.rows||8,c=i?.format||"markdown";return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[t.jsxs("span",{children:["Format: ",c]}),t.jsx("span",{className:"italic",children:"Rich text editor (basic)"})]}),t.jsx(d.Textarea,{value:e||"",onChange:f=>r(f.target.value),placeholder:i?.placeholder||"Enter text...",disabled:l||a.disabled,rows:o,className:`font-mono text-sm ${a.className||""}`,"aria-invalid":!!n})]})}const Ze=Object.freeze(Object.defineProperty({__proto__:null,RichTextField:oe},Symbol.toStringTag,{value:"Module"})),Dt=50,zt=j.createContext(null);let rt=zt;try{const e=require("@object-ui/react");e.SchemaRendererContext&&(rt=e.SchemaRendererContext)}catch{}function Mt(e,r,s,l){const n=e[s]??e.id??e._id,a=e[r]??e.label??e.name??String(n),i=l?e[l]:void 0;return{value:n,label:String(a),description:i,...e}}function Se({value:e,onChange:r,field:s,readonly:l,...n}){const[a,i]=j.useState(!1),[o,c]=j.useState(""),[f,g]=j.useState([]),[p,m]=j.useState(!1),[x,b]=j.useState(null),[C,A]=j.useState(0),z=j.useRef(null),[M,G]=j.useState(-1),Q=j.useRef(null),L=s||n.schema,y=L?.field,w=y&&typeof y=="object"&&("reference_to"in y||"reference"in y||"type"in y)?y:L,$=w?.options||[],k=w?.multiple||!1,P=w?.display_field||w?.reference_field||"name",V=w?.description_field,Y=w?.id_field||"id",I=w?.reference_to||w?.reference,ee=j.useContext(rt)?.dataSource??null,J=n.dataSource??L?.dataSource??w?.dataSource??ee,B=J!=null&&typeof J.find=="function"&&!!I,X=n.onCreateNew??L?.onCreateNew,H=B?f:$,D=j.useMemo(()=>{if(B||!o)return H;const h=o.toLowerCase();return H.filter(F=>F.label.toLowerCase().includes(h)||F.description&&F.description.toLowerCase().includes(h))},[B,H,o]);j.useEffect(()=>{G(-1)},[D.length]);const u=j.useCallback(async h=>{if(!(!J||!I)){m(!0),b(null);try{const F={$top:Dt};h&&h.trim()&&(F.$search=h.trim());const E=await J.find(I,F),Z=E?.data??E??[],yt=Z.map(Nt=>Mt(Nt,P,Y,V));g(yt),A(E?.total??Z.length)}catch(F){const E=F instanceof Error?F.message:String(F);b(E),g([])}finally{m(!1)}}},[J,I,P,Y,V]);j.useEffect(()=>{a&&B&&u(o||void 0),a||(c(""),b(null),G(-1))},[a]);const N=j.useCallback(h=>{c(h),B&&(z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{u(h||void 0)},300))},[B,u]);j.useEffect(()=>()=>{z.current&&clearTimeout(z.current)},[]);const T=j.useCallback(h=>$.find(F=>F.value===h)??f.find(F=>F.value===h),[$,f]),R=k?(Array.isArray(e)?e:[]).map(T).filter(Boolean):e?[T(e)].filter(Boolean):[],W=j.useCallback(h=>{if(k){const F=Array.isArray(e)?e:[],E=F.includes(h.value);r(E?F.filter(Z=>Z!==h.value):[...F,h.value])}else r(h.value),i(!1)},[k,e,r]),te=h=>{if(k){const F=Array.isArray(e)?e:[];r(F.filter(E=>E!==h))}else r(null)},O=j.useCallback(h=>{h.key==="ArrowDown"?(h.preventDefault(),G(F=>F<D.length-1?F+1:F)):h.key==="ArrowUp"?(h.preventDefault(),G(F=>F>0?F-1:0)):h.key==="Enter"&&(h.preventDefault(),M>=0&&M<D.length&&W(D[M]))},[D,M,W]);return j.useEffect(()=>{M>=0&&Q.current&&Q.current.querySelector(`[data-lookup-index="${M}"]`)?.scrollIntoView({block:"nearest"})},[M]),l?R.length?k?t.jsx("div",{className:"flex flex-wrap gap-1",children:R.map((h,F)=>t.jsx(d.Badge,{variant:"outline",children:h?.[P]||h?.label},F))}):t.jsx("span",{className:"text-sm",children:R[0]?.[P]||R[0]?.label}):t.jsx("span",{className:"text-sm",children:"-"}):t.jsxs("div",{className:"space-y-2",children:[R.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1",children:R.map((h,F)=>t.jsxs(d.Badge,{variant:"outline",className:"gap-1",children:[h?.[P]||h?.label,t.jsx("button",{onClick:()=>te(h?.value),className:"ml-1 hover:text-destructive",type:"button","aria-label":`Remove ${h?.[P]||h?.label}`,children:t.jsx(S.X,{className:"size-3"})})]},F))}),t.jsxs(d.Dialog,{open:a,onOpenChange:i,children:[t.jsx(d.DialogTrigger,{asChild:!0,children:t.jsxs(d.Button,{variant:"outline",className:"w-full justify-start text-left font-normal",type:"button",children:[t.jsx(S.Search,{className:"mr-2 size-4"}),R.length===0?L?.placeholder||"Select...":k?`${R.length} selected`:"Change selection"]})}),t.jsxs(d.DialogContent,{className:"max-w-md",children:[t.jsx(d.DialogHeader,{children:t.jsxs(d.DialogTitle,{children:[L?.label||"Select"," ",k&&"(multiple)"]})}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"relative",children:[t.jsx(S.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),t.jsx(d.Input,{placeholder:"Search...",value:o,onChange:h=>N(h.target.value),onKeyDown:O,className:"w-full pl-9"}),p&&t.jsx(S.Loader2,{className:"absolute right-3 top-1/2 -translate-y-1/2 size-4 animate-spin text-muted-foreground","data-testid":"lookup-loading"})]}),x&&t.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",role:"alert",children:[t.jsx(S.AlertCircle,{className:"size-5 text-destructive"}),t.jsx("p",{className:"text-sm text-destructive",children:x}),t.jsx(d.Button,{variant:"outline",size:"sm",onClick:()=>u(o||void 0),type:"button",children:"Retry"})]}),p&&D.length===0&&!x&&t.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",role:"status","aria-live":"polite",children:[t.jsx(S.Loader2,{className:"size-6 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"})]}),!x&&!(p&&D.length===0)&&t.jsx("div",{ref:Q,className:"max-h-64 overflow-y-auto space-y-1",role:"listbox",children:D.length===0?t.jsxs("div",{className:"py-4 text-center",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"No options found"}),X&&t.jsxs(d.Button,{variant:"ghost",size:"sm",className:"mt-2 gap-1",type:"button",onClick:()=>{X(o),i(!1)},children:[t.jsx(S.Plus,{className:"size-4"}),"Create new"]})]}):t.jsxs(t.Fragment,{children:[D.map((h,F)=>{const E=k?(Array.isArray(e)?e:[]).includes(h.value):e===h.value,Z=F===M;return t.jsxs("button",{"data-lookup-index":F,role:"option","aria-selected":E,onClick:()=>W(h),className:`w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center justify-between ${Z?"bg-accent text-accent-foreground":E?"bg-accent/50 text-accent-foreground":""}`,type:"button",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate",children:h.label}),h.description&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:h.description})]}),E&&t.jsx(d.Badge,{variant:"default",className:"ml-2 shrink-0",children:"Selected"})]},h.value)}),B&&C>D.length&&t.jsxs("p",{className:"text-xs text-muted-foreground text-center py-2",children:["Showing ",D.length," of ",C," results. Refine your search to find more."]}),X&&t.jsxs("button",{type:"button",className:"w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center gap-1.5 text-muted-foreground",onClick:()=>{X(o),i(!1)},children:[t.jsx(S.Plus,{className:"size-3.5"}),"Create new",o?` "${o}"`:""]})]})})]})]})]})]})}const It=Object.freeze(Object.defineProperty({__proto__:null,LookupField:Se},Symbol.toStringTag,{value:"Module"}));function Ce({value:e,onChange:r,field:s,readonly:l,...n}){if(l){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const o=new Date(e);return t.jsxs("span",{className:"text-sm",children:[o.toLocaleDateString()," ",o.toLocaleTimeString()]})}const{inputType:a,...i}=n;return t.jsx(d.Input,{...i,type:"datetime-local",value:e||"",onChange:o=>r(o.target.value),disabled:l||i.disabled})}const Lt=Object.freeze(Object.defineProperty({__proto__:null,DateTimeField:Ce},Symbol.toStringTag,{value:"Module"}));function we({value:e,onChange:r,field:s,readonly:l,...n}){if(l)return t.jsx("span",{className:"text-sm",children:e||"-"});const{inputType:a,...i}=n;return t.jsx(d.Input,{...i,type:"time",value:e||"",onChange:o=>r(o.target.value),disabled:l||i.disabled})}const Ut=Object.freeze(Object.defineProperty({__proto__:null,TimeField:we},Symbol.toStringTag,{value:"Module"}));function Re({value:e,onChange:r,field:s,readonly:l,errorMessage:n,className:a,...i}){const o=s||i.schema,c=o?.precision??2;if(l)return e==null?t.jsx("span",{className:"text-sm",children:"-"}):t.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[(e*100).toFixed(c),"%"]});const f=e!=null?e*100:"",g=e!=null?e*100:0,p=b=>{if(b.target.value===""){r(null);return}const C=parseFloat(b.target.value),A=isNaN(C)?null:C/100;r(A)},m=b=>{if(l||i.disabled)return;if(!Array.isArray(b)||b.length===0){r(null);return}const C=b[0],A=typeof C=="number"?C/100:null;r(A)},x=Math.pow(10,-c);return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"relative",children:[t.jsx(d.Input,{...i,type:"number",value:f,onChange:p,placeholder:o?.placeholder||"0",disabled:l||i.disabled,className:`pr-8 ${a||""}`,step:Math.pow(10,-c).toFixed(c),"aria-invalid":!!n}),t.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:"%"})]}),t.jsx(d.Slider,{value:[g],onValueChange:m,min:0,max:100,step:x,disabled:l||i.disabled,className:"w-full","aria-label":"Percentage","data-testid":"percent-slider"})]})}const Bt=Object.freeze(Object.defineProperty({__proto__:null,PercentField:Re},Symbol.toStringTag,{value:"Module"}));function Te({value:e,onChange:r,field:s,readonly:l,className:n,...a}){const[i,o]=j.useState(!1),c=s||a.schema;if(l)return t.jsx("span",{className:"text-sm",children:"••••••••"});const{inputType:f,...g}=a;return t.jsxs("div",{className:"relative",children:[t.jsx(d.Input,{...g,type:i?"text":"password",value:e||"",onChange:p=>r(p.target.value),placeholder:c?.placeholder,disabled:l||g.disabled,className:`pr-10 ${n||""}`}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>o(!i),tabIndex:-1,children:i?t.jsx(S.EyeOff,{className:"size-4 text-gray-500"}):t.jsx(S.Eye,{className:"size-4 text-gray-500"})})]})}const Vt=Object.freeze(Object.defineProperty({__proto__:null,PasswordField:Te},Symbol.toStringTag,{value:"Module"}));function Pe({value:e,onChange:r,field:s,readonly:l,...n}){const a=j.useRef(null),i=s||n.schema,o=i?.multiple||!1,c=i?.accept?i.accept.join(","):void 0,f=i?.maxSize,[g,p]=j.useState(!1),[m,x]=j.useState([]),b=e?Array.isArray(e)?e:[e]:[],C=j.useCallback(y=>{if(y.length===0)return;const w=[],$=y.filter(P=>{if(f&&P.size>f){const V=(f/1048576).toFixed(1);return w.push(`"${P.name}" exceeds max size (${V} MB)`),!1}return!0});if(x(w),$.length===0)return;const k=$.map(P=>({name:P.name,original_name:P.name,size:P.size,mime_type:P.type,url:URL.createObjectURL(P)}));r(o?[...b,...k]:k[0])},[b,o,r,f]),A=j.useCallback(y=>{y.preventDefault(),y.stopPropagation(),p(!0)},[]),z=j.useCallback(y=>{y.preventDefault(),y.stopPropagation(),p(!1)},[]),M=j.useCallback(y=>{y.preventDefault(),y.stopPropagation(),p(!1);const w=Array.from(y.dataTransfer.files);if(c){const $=c.split(",").map(P=>P.trim().toLowerCase()),k=w.filter(P=>{const V=P.name.split("."),Y=V.length>1?"."+V.pop()?.toLowerCase():"";return $.some(I=>I===P.type||Y&&I===Y||I.endsWith("/*")&&P.type.startsWith(I.replace("/*","/")))});C(k)}else C(w)},[c,C]);if(l){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const y=Array.isArray(e)?e:[e];return t.jsx("div",{className:"flex flex-wrap gap-2",children:y.map((w,$)=>t.jsx("span",{className:"text-sm truncate max-w-xs",children:w.name||w.original_name||"File"},$))})}const G=y=>{C(Array.from(y.target.files||[]))},Q=y=>{if(o){const w=b.filter(($,k)=>k!==y);r(w.length>0?w:null)}else r(null)},L=y=>(y.mime_type||"").startsWith("image/");return t.jsxs("div",{className:n.className,children:[t.jsx("input",{ref:a,type:"file",multiple:o,accept:c,onChange:G,className:"hidden"}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{onDragOver:A,onDragLeave:z,onDrop:M,onClick:()=>a.current?.click(),className:`
7
7
  flex flex-col items-center justify-center gap-2 p-6
8
8
  border-2 border-dashed rounded-lg cursor-pointer
9
9
  transition-colors duration-200
10
10
  ${g?"border-primary bg-primary/5 text-primary":"border-muted-foreground/25 hover:border-primary/50 text-muted-foreground hover:text-foreground"}
11
- `,role:"button",tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),i.current?.click())},children:[t.jsx(_.Upload,{className:`size-8 ${g?"text-primary":"text-muted-foreground"}`}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium",children:g?"Drop files here":"Drag & drop files here"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"or click to browse"})]})]}),m.length>0&&t.jsx("div",{className:"space-y-0.5",children:m.map((j,S)=>t.jsx("p",{className:"text-xs text-destructive",children:j},S))}),h.length>0&&t.jsx("div",{className:"space-y-1",children:h.map((j,S)=>t.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[W(j)&&j.url?t.jsx("img",{src:j.url,alt:j.name,className:"size-8 object-cover rounded flex-shrink-0"}):W(j)?t.jsx(_.ImageIcon,{className:"size-4 text-muted-foreground flex-shrink-0"}):t.jsx(_.File,{className:"size-4 text-muted-foreground flex-shrink-0"}),t.jsx("span",{className:"text-sm truncate",children:j.name||j.original_name||"File"}),j.size&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",(j.size/1024).toFixed(1)," KB)"]})]}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:A=>{A.stopPropagation(),B(S)},className:"h-6 w-6 p-0",children:t.jsx(_.X,{className:"size-3"})})]},S))})]})]})}const zt=Object.freeze(Object.defineProperty({__proto__:null,FileField:ve},Symbol.toStringTag,{value:"Module"}));function Fe({value:e,onChange:r,field:n,readonly:a,...s}){const i=C.useRef(null),l=n||s.schema,o=l?.multiple||!1,c=l?.accept?l.accept.join(","):"image/*";if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const m=Array.isArray(e)?e:[e];return t.jsx("div",{className:"flex flex-wrap gap-2",children:m.map((x,h)=>t.jsx("img",{src:x.url||"",alt:x.name||`Image ${h+1}`,className:"size-20 rounded-md object-cover border border-gray-200"},h))})}const f=e?Array.isArray(e)?e:[e]:[],g=m=>{const x=Array.from(m.target.files||[]);if(x.length===0)return;const h=x.map(F=>({name:F.name,original_name:F.name,size:F.size,mime_type:F.type,url:URL.createObjectURL(F)}));r(o?[...f,...h]:h[0])},p=m=>{if(o){const x=f.filter((h,F)=>F!==m);r(x.length>0?x:null)}else r(null)};return t.jsxs("div",{className:s.className,children:[t.jsx("input",{ref:i,type:"file",multiple:o,accept:c,onChange:g,className:"hidden"}),t.jsxs("div",{className:"space-y-2",children:[f.length>0&&t.jsx("div",{className:"grid grid-cols-4 gap-2",children:f.map((m,x)=>t.jsxs("div",{className:"relative group",children:[t.jsx("img",{src:m.url||"",alt:m.name||`Image ${x+1}`,className:"size-20 rounded-md object-cover border border-gray-200"}),t.jsx(d.Button,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(x),className:"absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(_.X,{className:"size-3"})})]},x))}),t.jsxs(d.Button,{type:"button",variant:"outline",onClick:()=>i.current?.click(),className:"w-full",children:[t.jsx(_.Image,{className:"size-4 mr-2"}),f.length>0?"Add More Images":"Upload Image"]})]})]})}const Dt=Object.freeze(Object.defineProperty({__proto__:null,ImageField:Fe},Symbol.toStringTag,{value:"Module"}));function _e({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=e&&typeof e=="object"?`${e.latitude||0}, ${e.longitude||0}`:"";if(a)return t.jsx("span",{className:"text-sm",children:l||"-"});const o=c=>{const f=c.target.value;if(!f.trim()){r(null);return}const g=f.split(",").map(p=>p.trim());if(g.length===2){const p=parseFloat(g[0]),m=parseFloat(g[1]);!isNaN(p)&&!isNaN(m)&&r({latitude:p,longitude:m})}};return t.jsx(d.Input,{type:"text",value:l,onChange:o,placeholder:i?.placeholder||"latitude, longitude",disabled:a||s.disabled,className:s.className})}const Mt=Object.freeze(Object.defineProperty({__proto__:null,LocationField:_e},Symbol.toStringTag,{value:"Module"}));function Ce({value:e,field:r,...n}){const s=(r||n.schema)?.return_type||"text";let i="-";return e!=null&&(s==="number"||s==="currency"?i=typeof e=="number"?e.toFixed(2):String(e):s==="boolean"?i=e?"Yes":"No":s==="date"?i=new Date(e).toLocaleDateString():i=String(e)),t.jsx("span",{className:`text-sm font-mono text-gray-700 ${n.className||""}`,children:i})}const It=Object.freeze(Object.defineProperty({__proto__:null,FormulaField:Ce},Symbol.toStringTag,{value:"Module"}));function we({value:e,field:r,...n}){const s=(r||n.schema)?.summary_type||"count";let i="-";return e!=null&&(s==="count"?i=String(e):["sum","avg","min","max"].includes(s)?i=typeof e=="number"?e.toFixed(2):String(e):i=String(e)),t.jsx("span",{className:`text-sm font-medium tabular-nums text-gray-700 ${n.className||""}`,children:i})}const Lt=Object.freeze(Object.defineProperty({__proto__:null,SummaryField:we},Symbol.toStringTag,{value:"Module"}));function Se({value:e,field:r,...n}){const a=e!=null?String(e):"-";return t.jsx("span",{className:`text-sm font-mono text-gray-700 ${n.className||""}`,children:a})}const Ut=Object.freeze(Object.defineProperty({__proto__:null,AutoNumberField:Se},Symbol.toStringTag,{value:"Module"}));function Z({value:e,onChange:r,field:n,readonly:a,...s}){const l=(n||s.schema)?.multiple||!1;if(a){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const f=Array.isArray(e)?e:[e];return t.jsxs("div",{className:"flex -space-x-2",children:[f.slice(0,3).map((g,p)=>{const m=g.name||g.username||"User",x=m.split(" ").map(h=>h[0]).join("").toUpperCase().slice(0,2);return t.jsx(d.Avatar,{className:"size-8 border-2 border-white",title:m,children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:x})},p)}),f.length>3&&t.jsx(d.Avatar,{className:"size-8 border-2 border-white",children:t.jsxs(d.AvatarFallback,{className:"bg-gray-200 text-gray-600 text-xs",children:["+",f.length-3]})})]})}const o=e?Array.isArray(e)?e:[e]:[],c=f=>{if(l){const g=o.filter((p,m)=>m!==f);r(g.length>0?g:null)}else r(null)};return t.jsxs("div",{className:s.className,children:[o.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:o.map((f,g)=>{const p=f.name||f.username||"User",m=p.split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2);return t.jsxs(d.Badge,{variant:"outline",className:"gap-2 pr-1",children:[t.jsx(d.Avatar,{className:"size-5",children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:m})}),t.jsx("span",{className:"text-sm",children:p}),t.jsx("button",{type:"button",onClick:()=>c(g),className:"ml-1 rounded-full hover:bg-gray-200 p-0.5",children:t.jsx(_.X,{className:"size-3"})})]},g)})}),t.jsx("div",{className:"text-sm text-gray-500 italic",children:"User selection component requires integration with user management system"})]})}const Xe=Object.freeze(Object.defineProperty({__proto__:null,UserField:Z},Symbol.toStringTag,{value:"Module"}));function Re({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=()=>e==null?"":JSON.stringify(e,null,2),[o,c]=C.useState(l),[f,g]=C.useState(null);if(C.useEffect(()=>{try{if(e==null){c("");return}const m=o?JSON.parse(o):null;JSON.stringify(m)!==JSON.stringify(e)&&c(JSON.stringify(e,null,2))}catch{c(JSON.stringify(e,null,2))}},[e,o]),a)return e?t.jsx("pre",{className:d.cn("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40",s.className),children:JSON.stringify(e,null,2)}):t.jsx("span",{className:"text-sm",children:"-"});const p=m=>{const x=m.target.value;if(c(x),g(null),!x.trim()){r(null);return}try{const h=JSON.parse(x);r(h)}catch{g("Invalid JSON")}};return t.jsxs("div",{className:"space-y-1",children:[t.jsx(d.Textarea,{value:o,onChange:p,placeholder:i?.placeholder||`{
11
+ `,role:"button",tabIndex:0,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),a.current?.click())},children:[t.jsx(S.Upload,{className:`size-8 ${g?"text-primary":"text-muted-foreground"}`}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium",children:g?"Drop files here":"Drag & drop files here"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"or click to browse"})]})]}),m.length>0&&t.jsx("div",{className:"space-y-0.5",children:m.map((y,w)=>t.jsx("p",{className:"text-xs text-destructive",children:y},w))}),b.length>0&&t.jsx("div",{className:"space-y-1",children:b.map((y,w)=>t.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 bg-muted/50 rounded-md border",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[L(y)&&y.url?t.jsx("img",{src:y.url,alt:y.name,className:"size-8 object-cover rounded flex-shrink-0"}):L(y)?t.jsx(S.ImageIcon,{className:"size-4 text-muted-foreground flex-shrink-0"}):t.jsx(S.File,{className:"size-4 text-muted-foreground flex-shrink-0"}),t.jsx("span",{className:"text-sm truncate",children:y.name||y.original_name||"File"}),y.size&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",(y.size/1024).toFixed(1)," KB)"]})]}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:$=>{$.stopPropagation(),Q(w)},className:"h-6 w-6 p-0",children:t.jsx(S.X,{className:"size-3"})})]},w))})]})]})}const Yt=Object.freeze(Object.defineProperty({__proto__:null,FileField:Pe},Symbol.toStringTag,{value:"Module"}));function Oe({value:e,onChange:r,field:s,readonly:l,...n}){const a=j.useRef(null),i=s||n.schema,o=i?.multiple||!1,c=i?.accept?i.accept.join(","):"image/*";if(l){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const m=Array.isArray(e)?e:[e];return t.jsx("div",{className:"flex flex-wrap gap-2",children:m.map((x,b)=>t.jsx("img",{src:x.url||"",alt:x.name||`Image ${b+1}`,className:"size-20 rounded-md object-cover border border-gray-200"},b))})}const f=e?Array.isArray(e)?e:[e]:[],g=m=>{const x=Array.from(m.target.files||[]);if(x.length===0)return;const b=x.map(C=>({name:C.name,original_name:C.name,size:C.size,mime_type:C.type,url:URL.createObjectURL(C)}));r(o?[...f,...b]:b[0])},p=m=>{if(o){const x=f.filter((b,C)=>C!==m);r(x.length>0?x:null)}else r(null)};return t.jsxs("div",{className:n.className,children:[t.jsx("input",{ref:a,type:"file",multiple:o,accept:c,onChange:g,className:"hidden"}),t.jsxs("div",{className:"space-y-2",children:[f.length>0&&t.jsx("div",{className:"grid grid-cols-4 gap-2",children:f.map((m,x)=>t.jsxs("div",{className:"relative group",children:[t.jsx("img",{src:m.url||"",alt:m.name||`Image ${x+1}`,className:"size-20 rounded-md object-cover border border-gray-200"}),t.jsx(d.Button,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(x),className:"absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(S.X,{className:"size-3"})})]},x))}),t.jsxs(d.Button,{type:"button",variant:"outline",onClick:()=>a.current?.click(),className:"w-full",children:[t.jsx(S.Image,{className:"size-4 mr-2"}),f.length>0?"Add More Images":"Upload Image"]})]})]})}const qt=Object.freeze(Object.defineProperty({__proto__:null,ImageField:Oe},Symbol.toStringTag,{value:"Module"}));function ke({value:e,onChange:r,field:s,readonly:l,...n}){const a=s||n.schema,i=e&&typeof e=="object"?`${e.latitude||0}, ${e.longitude||0}`:"";if(l)return t.jsx("span",{className:"text-sm",children:i||"-"});const o=c=>{const f=c.target.value;if(!f.trim()){r(null);return}const g=f.split(",").map(p=>p.trim());if(g.length===2){const p=parseFloat(g[0]),m=parseFloat(g[1]);!isNaN(p)&&!isNaN(m)&&r({latitude:p,longitude:m})}};return t.jsx(d.Input,{type:"text",value:i,onChange:o,placeholder:a?.placeholder||"latitude, longitude",disabled:l||n.disabled,className:n.className})}const Gt=Object.freeze(Object.defineProperty({__proto__:null,LocationField:ke},Symbol.toStringTag,{value:"Module"}));function Ae({value:e,field:r,...s}){const n=(r||s.schema)?.return_type||"text";let a="-";return e!=null&&(n==="number"||n==="currency"?a=typeof e=="number"?e.toFixed(2):String(e):n==="boolean"?a=e?"Yes":"No":n==="date"?a=new Date(e).toLocaleDateString():a=String(e)),t.jsx("span",{className:`text-sm font-mono text-gray-700 ${s.className||""}`,children:a})}const Jt=Object.freeze(Object.defineProperty({__proto__:null,FormulaField:Ae},Symbol.toStringTag,{value:"Module"}));function $e({value:e,field:r,...s}){const n=(r||s.schema)?.summary_type||"count";let a="-";return e!=null&&(n==="count"?a=String(e):["sum","avg","min","max"].includes(n)?a=typeof e=="number"?e.toFixed(2):String(e):a=String(e)),t.jsx("span",{className:`text-sm font-medium tabular-nums text-gray-700 ${s.className||""}`,children:a})}const Wt=Object.freeze(Object.defineProperty({__proto__:null,SummaryField:$e},Symbol.toStringTag,{value:"Module"}));function Ee({value:e,field:r,...s}){const l=e!=null?String(e):"-";return t.jsx("span",{className:`text-sm font-mono text-gray-700 ${s.className||""}`,children:l})}const Qt=Object.freeze(Object.defineProperty({__proto__:null,AutoNumberField:Ee},Symbol.toStringTag,{value:"Module"}));function ce({value:e,onChange:r,field:s,readonly:l,...n}){const i=(s||n.schema)?.multiple||!1;if(l){if(!e)return t.jsx("span",{className:"text-sm",children:"-"});const f=Array.isArray(e)?e:[e];return t.jsxs("div",{className:"flex -space-x-2",children:[f.slice(0,3).map((g,p)=>{const m=g.name||g.username||"User",x=m.split(" ").map(b=>b[0]).join("").toUpperCase().slice(0,2);return t.jsx(d.Avatar,{className:"size-8 border-2 border-white",title:m,children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:x})},p)}),f.length>3&&t.jsx(d.Avatar,{className:"size-8 border-2 border-white",children:t.jsxs(d.AvatarFallback,{className:"bg-gray-200 text-gray-600 text-xs",children:["+",f.length-3]})})]})}const o=e?Array.isArray(e)?e:[e]:[],c=f=>{if(i){const g=o.filter((p,m)=>m!==f);r(g.length>0?g:null)}else r(null)};return t.jsxs("div",{className:n.className,children:[o.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:o.map((f,g)=>{const p=f.name||f.username||"User",m=p.split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2);return t.jsxs(d.Badge,{variant:"outline",className:"gap-2 pr-1",children:[t.jsx(d.Avatar,{className:"size-5",children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:m})}),t.jsx("span",{className:"text-sm",children:p}),t.jsx("button",{type:"button",onClick:()=>c(g),className:"ml-1 rounded-full hover:bg-gray-200 p-0.5",children:t.jsx(S.X,{className:"size-3"})})]},g)})}),t.jsx("div",{className:"text-sm text-gray-500 italic",children:"User selection component requires integration with user management system"})]})}const et=Object.freeze(Object.defineProperty({__proto__:null,UserField:ce},Symbol.toStringTag,{value:"Module"}));function De({value:e,onChange:r,field:s,readonly:l,...n}){const a=s||n.schema,i=()=>e==null?"":JSON.stringify(e,null,2),[o,c]=j.useState(i),[f,g]=j.useState(null);if(j.useEffect(()=>{try{if(e==null){c("");return}const m=o?JSON.parse(o):null;JSON.stringify(m)!==JSON.stringify(e)&&c(JSON.stringify(e,null,2))}catch{c(JSON.stringify(e,null,2))}},[e,o]),l)return e?t.jsx("pre",{className:d.cn("text-xs bg-gray-50 p-2 rounded border border-gray-200 overflow-auto max-h-40",n.className),children:JSON.stringify(e,null,2)}):t.jsx("span",{className:"text-sm",children:"-"});const p=m=>{const x=m.target.value;if(c(x),g(null),!x.trim()){r(null);return}try{const b=JSON.parse(x);r(b)}catch{g("Invalid JSON")}};return t.jsxs("div",{className:"space-y-1",children:[t.jsx(d.Textarea,{value:o,onChange:p,placeholder:a?.placeholder||`{
12
12
  "key": "value"
13
- }`,disabled:a||s.disabled,className:d.cn("font-mono text-xs",f?"border-red-500 focus-visible:ring-red-500":"",s.className),rows:6}),f&&t.jsx("p",{className:"text-xs text-red-500",children:f})]})}const Bt=Object.freeze(Object.defineProperty({__proto__:null,ObjectField:Re},Symbol.toStringTag,{value:"Module"}));function Te({value:e,field:r,...n}){const s=(r||n.schema)?.dimensions||(Array.isArray(e)?e.length:0);if(!e||!Array.isArray(e))return t.jsx("span",{className:"text-sm text-gray-500",children:"-"});const i=e.slice(0,3).map(l=>{const o=Number(l);return isNaN(o)?"0":o.toFixed(4)}).join(", ");return t.jsxs("div",{className:`text-sm ${n.className||""}`,children:[t.jsxs("span",{className:"font-mono text-gray-700",children:["[",i,"...]"]}),t.jsxs("span",{className:"text-gray-500 ml-2",children:["(",s,"D)"]})]})}const Vt=Object.freeze(Object.defineProperty({__proto__:null,VectorField:Te},Symbol.toStringTag,{value:"Module"}));function Pe({value:e,field:r,readonly:n,...a}){const i=(r||a.schema)?.columns||[];return!e||!Array.isArray(e)?t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"}):n?t.jsx("div",{className:d.cn("text-sm",a.className),children:t.jsxs("span",{className:"text-foreground",children:[e.length," rows"]})}):t.jsxs("div",{className:d.cn("border border-border rounded-lg overflow-hidden",a.className),children:[t.jsx("div",{className:"overflow-auto max-h-60",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted border-b border-border",children:t.jsx("tr",{children:i.map((l,o)=>t.jsx("th",{className:"px-3 py-2 text-left text-xs font-medium text-muted-foreground",children:l.label||l.name},o))})}),t.jsx("tbody",{className:"divide-y divide-border",children:e.slice(0,5).map((l,o)=>t.jsx("tr",{className:"hover:bg-muted/50 transition-colors",children:i.map((c,f)=>t.jsx("td",{className:"px-3 py-2 text-foreground",children:l[c.name]!=null?String(l[c.name]):"-"},f))},o))})]})}),e.length>5&&t.jsxs("div",{className:"bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border",children:["Showing 5 of ",e.length," rows"]})]})}const Yt=Object.freeze(Object.defineProperty({__proto__:null,GridField:Pe},Symbol.toStringTag,{value:"Module"}));function Oe({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema;return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded border border-input",style:{backgroundColor:e||"#000000"}}),t.jsx("span",{className:"text-sm",children:e||"-"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"color",value:e||"#000000",onChange:l=>r(l.target.value),disabled:a||s.disabled,className:"w-10 h-10 rounded border border-input cursor-pointer"}),t.jsx(d.Input,{type:"text",value:e||"",onChange:l=>r(l.target.value),placeholder:i?.placeholder||"#000000",disabled:a||s.disabled,className:s.className,pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"})]})}const qt=Object.freeze(Object.defineProperty({__proto__:null,ColorField:Oe},Symbol.toStringTag,{value:"Module"}));function ke({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.min??0,o=i?.max??100,c=i?.step??1;return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium",children:e??l}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",o]})]}):t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(d.Slider,{value:[e??l],onValueChange:f=>r(f[0]),min:l,max:o,step:c,disabled:a||s.disabled,className:s.className}),t.jsx("span",{className:"text-sm font-medium w-12 text-right",children:e??l})]})}const Gt=Object.freeze(Object.defineProperty({__proto__:null,SliderField:ke},Symbol.toStringTag,{value:"Module"}));function Ae({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const o=(n||i.schema)?.max??5,c=e??0,[f,g]=C.useState(null),p=f!==null?f:c;return a?t.jsxs("div",{className:d.cn("flex items-center gap-1",s),children:[Array.from({length:o},(m,x)=>t.jsx(_.Star,{className:`w-5 h-5 ${x<c?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},x)),t.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[c," / ",o]})]}):t.jsxs("div",{className:d.cn("flex items-center gap-1",s),children:[Array.from({length:o},(m,x)=>t.jsx("button",{type:"button",onClick:()=>r(x+1),onMouseEnter:()=>g(x+1),onMouseLeave:()=>g(null),className:"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",disabled:a||i.disabled,children:t.jsx(_.Star,{className:`w-5 h-5 transition-colors ${x<p?"fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500":"text-muted-foreground hover:text-yellow-400"}`})},x)),t.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[c," / ",o]})]})}const Jt=Object.freeze(Object.defineProperty({__proto__:null,RatingField:Ae},Symbol.toStringTag,{value:"Module"}));function $e({value:e,onChange:r,field:n,readonly:a,...s}){const i=n||s.schema,l=i?.language??"javascript";return a?t.jsx("pre",{className:d.cn("text-sm bg-muted p-2 rounded overflow-x-auto border",s.className),children:t.jsx("code",{children:e||"-"})}):t.jsx(d.Textarea,{value:e||"",onChange:o=>r(o.target.value),placeholder:i?.placeholder||`// Write ${l} code here...`,disabled:a||s.disabled,className:d.cn("font-mono text-sm",s.className),rows:12,spellCheck:!1})}const Wt=Object.freeze(Object.defineProperty({__proto__:null,CodeField:$e},Symbol.toStringTag,{value:"Module"}));function Ee({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=C.useRef(null),c=n||s.schema,f=m=>{const x=m.target.files?.[0];if(!x)return;if(!x.type.startsWith("image/")){console.error("Please select an image file");return}if(x.size>5*1024*1024){console.error("File size must be less than 5MB");return}const h=new FileReader;h.onloadend=()=>{r(h.result)},h.readAsDataURL(x)},g=()=>{r("")},p=()=>(c?.defaultName||c?.label||"User").split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2);return a?t.jsxs(d.Avatar,{className:"w-16 h-16",children:[e&&t.jsx(d.AvatarImage,{src:e,alt:c?.label}),t.jsx(d.AvatarFallback,{children:p()})]}):t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t.jsxs(d.Avatar,{className:"w-16 h-16",children:[e&&t.jsx(d.AvatarImage,{src:e,alt:c?.label}),t.jsx(d.AvatarFallback,{children:p()})]}),!a&&i&&e&&t.jsx("button",{type:"button",onClick:g,className:"absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",children:t.jsx(_.X,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:f,className:"hidden"}),t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>o.current?.click(),disabled:a||s.disabled,children:[t.jsx(_.Upload,{className:"w-4 h-4 mr-2"}),e?"Change":"Upload"," Avatar"]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG up to 5MB"})]})]})}const Qt=Object.freeze(Object.defineProperty({__proto__:null,AvatarField:Ee},Symbol.toStringTag,{value:"Module"}));function ze({value:e,onChange:r,field:n,readonly:a,...s}){const i=e||{},l=(c,f)=>{r({...i,[c]:f})},o=c=>[c.street,c.city,[c.state,c.zipCode].filter(Boolean).join(" "),c.country].filter(Boolean).join(", ")||"-";return a?t.jsx("span",{className:"text-sm",children:o(i)}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"street",className:"text-xs",children:"Street Address"}),t.jsx(d.Input,{id:"street",type:"text",value:i.street||"",onChange:c=>l("street",c.target.value),placeholder:"123 Main St",disabled:a||s.disabled,className:s.className})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"city",className:"text-xs",children:"City"}),t.jsx(d.Input,{id:"city",type:"text",value:i.city||"",onChange:c=>l("city",c.target.value),placeholder:"San Francisco",disabled:a||s.disabled})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"state",className:"text-xs",children:"State / Province"}),t.jsx(d.Input,{id:"state",type:"text",value:i.state||"",onChange:c=>l("state",c.target.value),placeholder:"CA",disabled:a||s.disabled})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"zipCode",className:"text-xs",children:"ZIP / Postal Code"}),t.jsx(d.Input,{id:"zipCode",type:"text",value:i.zipCode||"",onChange:c=>l("zipCode",c.target.value),placeholder:"94102",disabled:a||s.disabled})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"country",className:"text-xs",children:"Country"}),t.jsx(d.Input,{id:"country",type:"text",value:i.country||"",onChange:c=>l("country",c.target.value),placeholder:"United States",disabled:a||s.disabled})]})]})]})}const Xt=Object.freeze(Object.defineProperty({__proto__:null,AddressField:ze},Symbol.toStringTag,{value:"Module"}));function De({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=e||{},c=(m,x)=>{r({...o,[m]:x?Number(x):void 0})},f=()=>{if(!navigator.geolocation){console.error("Geolocation is not supported by this browser");return}l(!0),navigator.geolocation.getCurrentPosition(m=>{r({latitude:m.coords.latitude,longitude:m.coords.longitude,accuracy:m.coords.accuracy}),l(!1)},m=>{console.error("Error getting location:",m.message),l(!1)},{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})},g=m=>!m.latitude||!m.longitude?"-":`${m.latitude.toFixed(6)}, ${m.longitude.toFixed(6)}`,p=()=>{if(!o.latitude||!o.longitude)return;const m=`https://www.google.com/maps?q=${o.latitude},${o.longitude}`;window.open(m,"_blank")};return a?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(_.MapPin,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:g(o)}),o.latitude&&o.longitude&&t.jsx(d.Button,{type:"button",variant:"link",size:"sm",onClick:p,className:"p-0 h-auto",children:"View on map"})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:a||i,children:[t.jsx(_.Crosshair,{className:"w-4 h-4 mr-2"}),i?"Getting location...":"Use Current Location"]}),o.latitude&&o.longitude&&t.jsxs(d.Button,{type:"button",variant:"link",size:"sm",onClick:p,children:[t.jsx(_.MapPin,{className:"w-4 h-4 mr-2"}),"View on map"]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"latitude",className:"text-xs",children:"Latitude"}),t.jsx(d.Input,{id:"latitude",type:"number",value:o.latitude??"",onChange:m=>c("latitude",m.target.value),placeholder:"37.7749",disabled:a||s.disabled,step:"any",className:s.className})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"longitude",className:"text-xs",children:"Longitude"}),t.jsx(d.Input,{id:"longitude",type:"number",value:o.longitude??"",onChange:m=>c("longitude",m.target.value),placeholder:"-122.4194",disabled:a||s.disabled,step:"any"})]})]}),o.accuracy&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Accuracy: ±",o.accuracy.toFixed(0),"m"]})]})}const Ht=Object.freeze(Object.defineProperty({__proto__:null,GeolocationField:De},Symbol.toStringTag,{value:"Module"}));function Me({value:e,onChange:r,readonly:n}){const a=C.useRef(null),[s,i]=C.useState(!1),[l,o]=C.useState(!e);C.useEffect(()=>{if(e&&a.current){const x=a.current.getContext("2d");if(x){const h=new Image;h.onload=()=>{x.drawImage(h,0,0),o(!1)},h.src=e}}},[e]);const c=m=>{if(n)return;i(!0),o(!1);const x=a.current;if(!x)return;const h=x.getContext("2d");if(!h)return;const F=x.getBoundingClientRect(),k="touches"in m?m.touches[0].clientX-F.left:m.clientX-F.left,v="touches"in m?m.touches[0].clientY-F.top:m.clientY-F.top;h.beginPath(),h.moveTo(k,v)},f=m=>{if(!s||n)return;const x=a.current;if(!x)return;const h=x.getContext("2d");if(!h)return;const F=x.getBoundingClientRect(),k="touches"in m?m.touches[0].clientX-F.left:m.clientX-F.left,v="touches"in m?m.touches[0].clientY-F.top:m.clientY-F.top;h.lineTo(k,v),h.strokeStyle="#000",h.lineWidth=2,h.lineCap="round",h.lineJoin="round",h.stroke()},g=()=>{if(!s)return;i(!1);const m=a.current;if(!m)return;const x=m.toDataURL("image/png");r(x)},p=()=>{const m=a.current;if(!m)return;const x=m.getContext("2d");x&&(x.clearRect(0,0,m.width,m.height),o(!0),r(""))};return n&&e?t.jsx("div",{className:"border rounded p-2 bg-white",children:t.jsx("img",{src:e,alt:"Signature",loading:"lazy",className:"max-w-full h-auto"})}):n&&!e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"No signature"}):t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"border rounded bg-white",children:t.jsx("canvas",{ref:a,width:400,height:200,className:"w-full touch-none cursor-crosshair",onMouseDown:c,onMouseMove:f,onMouseUp:g,onMouseLeave:g,onTouchStart:c,onTouchMove:f,onTouchEnd:g})}),t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:l?"Sign above":"Signature captured"}),t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:p,disabled:n||l,children:[t.jsx(_.Eraser,{className:"w-4 h-4 mr-2"}),"Clear"]})]})]})}const Zt=Object.freeze(Object.defineProperty({__proto__:null,SignatureField:Me},Symbol.toStringTag,{value:"Module"}));function Ie({value:e,onChange:r,field:n,readonly:a,...s}){const[i,l]=C.useState(!1),o=n||s.schema,c=g=>`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(g)}`,f=()=>{e&&navigator.clipboard.writeText(e)};return a?t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-sm flex-1 truncate",children:e||"-"}),e&&t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!i),children:[t.jsx(_.QrCode,{className:"w-4 h-4 mr-2"}),i?"Hide":"Show"," QR"]})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(d.Input,{type:"text",value:e||"",onChange:g=>r(g.target.value),placeholder:o?.placeholder||"Enter text for QR code",disabled:a||s.disabled,className:s.className}),e&&t.jsxs(t.Fragment,{children:[t.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:f,children:t.jsx(_.Copy,{className:"w-4 h-4"})}),t.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>l(!i),children:t.jsx(_.QrCode,{className:"w-4 h-4"})})]})]}),i&&e&&t.jsx("div",{className:"border rounded p-4 bg-white flex justify-center",children:t.jsx("img",{src:c(e),alt:"QR Code",className:"w-48 h-48"})}),e&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["QR code contains: ",e.length," characters"]})]})}const Kt=Object.freeze(Object.defineProperty({__proto__:null,QRCodeField:Ie},Symbol.toStringTag,{value:"Module"}));function Le({value:e,onChange:r,field:n,readonly:a,className:s,...i}){const l=e||[],o=n||i.schema,c=()=>{const p={id:`new-${Date.now()}`,label:"New Related Record"};r([...l,p])},f=p=>{r(l.filter(m=>m.id!==p))},g=p=>{console.log("View detail:",p)};return a?t.jsxs("div",{className:d.cn("space-y-2",s),children:[l.length===0?t.jsx("span",{className:"text-sm text-muted-foreground",children:"No related records"}):l.map(p=>t.jsxs("div",{className:"flex items-center justify-between p-2 border rounded hover:bg-muted/50",children:[t.jsx("span",{className:"text-sm",children:p.label}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>g(p),children:t.jsx(_.ExternalLink,{className:"w-4 h-4"})})]},p.id)),t.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.length," ",l.length===1?"record":"records"]})]}):t.jsxs("div",{className:d.cn("space-y-3",s),children:[t.jsxs("div",{className:"space-y-2",children:[l.map(p=>t.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[t.jsx(d.Badge,{variant:"outline",children:p.id}),t.jsx("span",{className:"text-sm flex-1",children:p.label})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>g(p),children:t.jsx(_.ExternalLink,{className:"w-4 h-4"})}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(p.id),disabled:i.disabled,children:t.jsx(_.X,{className:"w-4 h-4"})})]})]},p.id)),l.length===0&&t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20",children:"No related records"})]}),t.jsxs(d.Button,{type:"button",variant:"outline",className:"w-full",onClick:c,disabled:i.disabled,children:[t.jsx(_.Plus,{className:"w-4 h-4 mr-2"}),"Add ",o?.label||"Record"]})]})}const er=Object.freeze(Object.defineProperty({__proto__:null,MasterDetailField:Le},Symbol.toStringTag,{value:"Module"}));function Ze(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}catch{return`${r} ${e.toFixed(2)}`}}function tr(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r,notation:"compact",maximumFractionDigits:1}).format(e).replace(/\.0(?=[KMBT])/,"")}catch{return`${r} ${e}`}}function Ke(e,r=0){return`${(e>-1&&e<1?e*100:e).toFixed(r)}%`}function K(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function et(e){if(!e)return"-";const r=typeof e=="string"?new Date(e):e;if(isNaN(r.getTime()))return"-";const n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()-a.getTime(),l=Math.round(i/(1e3*60*60*24));if(l===0)return"Today";if(l===1)return"Tomorrow";if(l===-1)return"Yesterday";if(l<-1){const o=Math.abs(l);return o<=7?`Overdue ${o}d`:ee(r)}return l>1&&l<=7?`In ${l} days`:ee(r)}function ee(e,r){if(!e)return"-";const n=typeof e=="string"?new Date(e):e;if(isNaN(n.getTime()))return"-";if(r==="short"){const a=n.toLocaleDateString("en-US",{month:"short"}),s=n.getDate(),i=String(n.getFullYear()).slice(-2);return`${a} ${s}, '${i}`}return r==="relative"?et(n):n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function rr(e){if(!e)return"-";const r=typeof e=="string"?new Date(e):e;return isNaN(r.getTime())?"-":r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function E({value:e}){return t.jsx("span",{className:"truncate",children:e!=null&&e!==""?String(e):"-"})}function tt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.precision??0,s=typeof e=="number"?new Intl.NumberFormat("en-US",{minimumFractionDigits:a,maximumFractionDigits:a}).format(e):e;return t.jsx("span",{className:"tabular-nums",children:s})}function rt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.currency||"USD",s=Ze(Number(e),a);return t.jsx("span",{className:"tabular-nums font-medium whitespace-nowrap",children:s})}const sr=/progress|completion/;function st({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.precision??0,s=Number(e),i=sr.test(r?.name?.toLowerCase()||""),l=i?s:s>-1&&s<1?s*100:s,o=i?`${s.toFixed(a)}%`:Ke(s,a),c=Math.max(0,Math.min(100,l));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-1.5 w-16 rounded-full bg-muted overflow-hidden flex-shrink-0",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,children:t.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${c}%`}})}),t.jsx("span",{className:"tabular-nums whitespace-nowrap",children:o})]})}const nr=new Set(["active","is_active","enabled","is_enabled","verified","is_verified"]);function nt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground/50 text-xs italic flex items-center justify-center",children:"—"});const n=r?.name?.toLowerCase()||"";return n==="completed"||n==="is_completed"||n==="done"||n==="is_done"?t.jsx("div",{className:"flex items-center justify-center",children:e?t.jsx("div",{className:"size-5 rounded-full bg-green-500 flex items-center justify-center",role:"img","aria-label":"Completed","data-testid":"completion-indicator",children:t.jsx(_.Check,{className:"size-3 text-white"})}):t.jsx("div",{className:"size-5 rounded-full border-2 border-muted-foreground/30",role:"img","aria-label":"Not completed","data-testid":"completion-indicator"})}):nr.has(n)&&!e?t.jsxs(d.Badge,{variant:"destructive",className:"text-xs","data-testid":"boolean-warning-badge",children:[r?.label||K(n)," — Off"]}):t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(d.Checkbox,{checked:!!e,disabled:!0,className:"pointer-events-none"})})}function at({value:e,field:r}){if(!e)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const a=r.format||"relative",s=ee(e,a),i=typeof e=="string"?new Date(e):e,l=i instanceof Date&&!isNaN(i.getTime()),o=new Date;o.setHours(0,0,0,0);const c=l&&i<o,f=l?i.toISOString():String(e);return t.jsx("span",{className:`tabular-nums${c?" text-red-600":""}`,title:f,children:s})}function lt({value:e}){if(!e)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const r=typeof e=="string"?new Date(e):e;if(isNaN(r.getTime()))return t.jsx("span",{className:"text-muted-foreground",children:"-"});const n=r.toLocaleDateString(void 0,{month:"numeric",day:"numeric",year:"numeric"}),a=r.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",hour12:!0}).toLowerCase();return t.jsxs("span",{className:"tabular-nums text-sm whitespace-nowrap",children:[t.jsx("span",{children:n}),t.jsx("span",{className:"ml-2 text-muted-foreground",children:a})]})}const ar={critical:"red",urgent:"red",high:"orange",medium:"yellow",normal:"blue",low:"gray",none:"gray",paid:"green",completed:"green",done:"green",active:"green",approved:"green",resolved:"green",pending:"yellow",waiting:"yellow",on_hold:"yellow",shipped:"blue",in_progress:"blue",open:"blue",processing:"blue",draft:"gray",new:"gray",inactive:"gray",closed:"gray",cancelled:"red",canceled:"red",rejected:"red",failed:"red",overdue:"red",delivered:"purple",archived:"indigo"},lr={gray:"bg-gray-100 text-gray-800 border-gray-300",red:"bg-red-100 text-red-800 border-red-300",orange:"bg-orange-100 text-orange-800 border-orange-300",yellow:"bg-yellow-100 text-yellow-800 border-yellow-300",green:"bg-green-100 text-green-800 border-green-300",blue:"bg-blue-100 text-blue-800 border-blue-300",indigo:"bg-indigo-100 text-indigo-800 border-indigo-300",purple:"bg-purple-100 text-purple-800 border-purple-300",pink:"bg-pink-100 text-pink-800 border-pink-300"};function He(e,r){const n=e||(r?ar[String(r).toLowerCase().replace(/[\s-]/g,"_")]:void 0);return lr[n||""]||"bg-muted text-muted-foreground border-border"}function q({value:e,field:r}){const a=r.options||[];if(!e)return t.jsx("span",{children:"-"});if(Array.isArray(e))return t.jsx("div",{className:"flex flex-wrap gap-1",children:e.map((o,c)=>{const f=a.find(m=>m.value===o),g=f?.label||K(String(o)),p=He(f?.color,o);return t.jsx(d.Badge,{variant:"outline",className:p,children:g},c)})});const s=a.find(o=>o.value===e),i=s?.label||K(String(e)),l=He(s?.color,e);return t.jsx(d.Badge,{variant:"outline",className:l,children:i})}function it({value:e}){if(!e)return t.jsx("span",{children:"-"});const[r,n]=C.useState(!1),a=s=>{s.stopPropagation(),s.preventDefault(),navigator.clipboard.writeText(String(e)).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return t.jsxs("span",{className:"inline-flex items-center gap-1 group/email",children:[t.jsx(d.Button,{variant:"link",className:"p-0 h-auto font-normal text-blue-600 hover:text-blue-800",asChild:!0,children:t.jsx("a",{href:`mailto:${e}`,onClick:s=>s.stopPropagation(),children:e})}),t.jsx("button",{type:"button",className:"opacity-0 group-hover/email:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",onClick:a,"aria-label":"Copy email",children:r?t.jsx(_.Check,{className:"h-3 w-3 text-green-600"}):t.jsx(_.Copy,{className:"h-3 w-3 text-muted-foreground"})})]})}function ot({value:e}){return e?t.jsx(d.Button,{variant:"link",className:"p-0 h-auto font-normal text-blue-600 hover:text-blue-800",asChild:!0,children:t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:e})}):t.jsx("span",{children:"-"})}function ct({value:e}){if(!e)return t.jsx("span",{children:"-"});const[r,n]=C.useState(!1),a=s=>{s.stopPropagation(),s.preventDefault(),navigator.clipboard.writeText(String(e)).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})};return t.jsxs("span",{className:"inline-flex items-center gap-1 group/phone",children:[t.jsxs("a",{href:`tel:${e}`,className:"inline-flex items-center gap-1 text-blue-600 hover:text-blue-800",onClick:s=>s.stopPropagation(),children:[t.jsx(_.Phone,{className:"h-3 w-3"}),e]}),t.jsx("button",{type:"button",className:"opacity-0 group-hover/phone:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",onClick:a,"aria-label":"Copy phone number",children:r?t.jsx(_.Check,{className:"h-3 w-3 text-green-600"}):t.jsx(_.Copy,{className:"h-3 w-3 text-muted-foreground"})})]})}function dt({value:e,field:r}){if(!e)return t.jsx("span",{children:"-"});if(r.multiple,Array.isArray(e)){const s=e.length;return t.jsxs("span",{className:"text-sm text-gray-600",children:[s," ",s===1?"file":"files"]})}const a=e.name||e.original_name||"File";return t.jsx("span",{className:"text-sm truncate",children:a})}function ut({value:e}){return e?Array.isArray(e)?t.jsxs("div",{className:"flex -space-x-2",children:[e.slice(0,3).map((r,n)=>t.jsx("img",{src:r.url||"",alt:r.name||`Image ${n+1}`,className:"size-8 rounded-md border-2 border-white object-cover"},n)),e.length>3&&t.jsxs("div",{className:"size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600",children:["+",e.length-3]})]}):t.jsx("img",{src:e.url||"",alt:e.name||"Image",className:"size-10 rounded-md object-cover"}):t.jsx("span",{children:"-"})}function G({value:e,field:r}){if(e==null||e==="")return t.jsx("span",{children:"-"});const n=r.options||[],a=s=>{if(n.length>0){const i=n.find(l=>String(l.value)===String(s));if(i)return i.label}return String(s)};if(Array.isArray(e))return t.jsx("div",{className:"flex flex-wrap gap-1",children:e.map((s,i)=>{let l;return s!=null&&typeof s=="object"?l=s.name||s.label||s._id||String(s):l=a(s),t.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",children:l},i)})});if(typeof e=="object"&&e!==null){const s=e.name||e.label||e._id||"[Object]";return t.jsx("span",{className:"truncate",children:s})}return t.jsx("span",{className:"truncate",children:a(e)})}function ne({value:e}){return t.jsx("span",{className:"text-gray-700 font-mono text-sm",children:e!=null?String(e):"-"})}function J({value:e}){if(!e)return t.jsx("span",{children:"-"});if(typeof e!="object")return t.jsx("span",{className:"truncate",children:String(e)});if(Array.isArray(e))return t.jsxs("div",{className:"flex -space-x-2",children:[e.slice(0,3).map((a,s)=>{if(typeof a!="object"||a===null)return t.jsx("span",{className:"truncate text-sm",children:String(a)},s);const i=a.name||a.username||"User",l=i.split(" ").map(o=>o[0]).join("").toUpperCase().slice(0,2);return t.jsx(d.Avatar,{className:"size-8 border-2 border-white",title:i,children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:l})},s)}),e.length>3&&t.jsx(d.Avatar,{className:"size-8 border-2 border-white",children:t.jsxs(d.AvatarFallback,{className:"bg-gray-200 text-gray-600 text-xs",children:["+",e.length-3]})})]});const r=e.name||e.username||"User",n=r.split(" ").map(a=>a[0]).join("").toUpperCase().slice(0,2);return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(d.Avatar,{className:"size-8",children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:n})}),t.jsx("span",{className:"truncate",children:r})]})}const ae=new Map;function M(e,r){ae.set(e,r)}function ir(e){return ae.has(e)?ae.get(e):{text:E,textarea:E,markdown:E,html:E,number:tt,currency:rt,percent:st,boolean:nt,date:at,datetime:lt,time:E,select:q,status:q,lookup:G,master_detail:G,email:it,url:ot,phone:ct,file:dt,image:ut,formula:ne,summary:ne,auto_number:E,user:J,owner:J,password:()=>t.jsx("span",{children:"••••••"}),location:E,object:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Object]"}),vector:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Vector]"}),grid:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Grid]"})}[e]||E}M("lookup",G);M("master_detail",G);M("select",q);M("status",q);M("user",J);M("owner",J);function or(e){return{text:"field:text",textarea:"field:textarea",markdown:"field:markdown",html:"field:html",number:"field:number",currency:"field:currency",percent:"field:percent",date:"field:date",datetime:"field:datetime",time:"field:time",boolean:"field:boolean",select:"field:select",lookup:"field:lookup",master_detail:"field:master_detail",email:"field:email",phone:"field:phone",url:"field:url",file:"field:file",image:"field:image",password:"field:password",location:"field:location",formula:"field:formula",summary:"field:summary",auto_number:"field:auto_number"}[e]||"field:text"}function cr(e){if(e<0||!Number.isFinite(e)||e===0)return"0 B";const r=["B","KB","MB","GB","TB"];let n=e,a=0;for(;n>=1024&&a<r.length-1;)n/=1024,a++;return`${n.toFixed(a>0?1:0)} ${r[a]}`}function dr(e){const r={};return e.required&&(r.required=typeof e.required_message=="string"?e.required_message:`${e.label||e.name} is required`),e.min_length&&(r.minLength={value:e.min_length,message:e.min_length_message||`Minimum length is ${e.min_length} characters`}),e.max_length&&(r.maxLength={value:e.max_length,message:e.max_length_message||`Maximum length is ${e.max_length} characters`}),e.min!==void 0&&(r.min={value:e.min,message:e.min_message||`Minimum value is ${e.min}`}),e.max!==void 0&&(r.max={value:e.max,message:e.max_message||`Maximum value is ${e.max}`}),e.pattern&&(r.pattern={value:typeof e.pattern=="string"?new RegExp(e.pattern):e.pattern,message:e.pattern_message||"Invalid format"}),e.type==="email"&&(r.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Please enter a valid email address"}),e.type==="url"&&(r.pattern={value:/^https?:\/\/.+/,message:"Please enter a valid URL"}),e.validate&&(r.validate=e.validate),Object.keys(r).length>0?r:void 0}function le(e,r){if(!e)return!0;if(e.field&&e.value!==void 0){const n=r[e.field];if(e.operator==="="||e.operator==="==")return n===e.value;if(e.operator==="!=")return n!==e.value;if(e.operator===">")return n>e.value;if(e.operator===">=")return n>=e.value;if(e.operator==="<")return n<e.value;if(e.operator==="<=")return n<=e.value;if(e.operator==="in")return Array.isArray(e.value)&&e.value.includes(n)}return e.and&&Array.isArray(e.and)?e.and.every(n=>le(n,r)):e.or&&Array.isArray(e.or)?e.or.some(n=>le(n,r)):!0}function N(e){const r=({schema:n,className:a,value:s,...i})=>{const[l,o]=C.useState(s??n?.value??""),c={name:n?.name||"field",label:n?.label,type:n?.type,placeholder:n?.placeholder,required:n?.required,readonly:n?.readonly||n?.readOnly,help:n?.help,description:n?.description,defaultValue:n?.defaultValue||n?.value,...n},f=C.useCallback(p=>{o(p),i.onChange&&i.onChange(p)},[i]),g=n?.readonly||n?.readOnly||!1;return t.jsxs("div",{className:"grid w-full items-center gap-1.5","data-obj-id":n?.id,"data-obj-type":n?.type,children:[n?.label&&t.jsx("label",{htmlFor:n.id,className:n.required?"after:content-['*'] after:ml-0.5 after:text-red-500":"",children:n.label}),t.jsx(e,{value:l,onChange:f,field:c,readonly:g,className:a}),n?.description&&t.jsx("p",{className:"text-sm text-gray-500",children:n.description})]})};return r.displayName=`FieldRenderer(${e.displayName||e.name||"Component"})`,r}const mt={text:()=>Promise.resolve().then(()=>yt).then(e=>({default:e.TextField})),textarea:()=>Promise.resolve().then(()=>Pt).then(e=>({default:e.TextAreaField})),number:()=>Promise.resolve().then(()=>Nt).then(e=>({default:e.NumberField})),boolean:()=>Promise.resolve().then(()=>vt).then(e=>({default:e.BooleanField})),select:()=>Promise.resolve().then(()=>Ft).then(e=>({default:e.SelectField})),date:()=>Promise.resolve().then(()=>_t).then(e=>({default:e.DateField})),datetime:()=>Promise.resolve().then(()=>kt).then(e=>({default:e.DateTimeField})),time:()=>Promise.resolve().then(()=>At).then(e=>({default:e.TimeField})),email:()=>Promise.resolve().then(()=>Ct).then(e=>({default:e.EmailField})),phone:()=>Promise.resolve().then(()=>wt).then(e=>({default:e.PhoneField})),url:()=>Promise.resolve().then(()=>St).then(e=>({default:e.UrlField})),currency:()=>Promise.resolve().then(()=>Tt).then(e=>({default:e.CurrencyField})),percent:()=>Promise.resolve().then(()=>$t).then(e=>({default:e.PercentField})),password:()=>Promise.resolve().then(()=>Et).then(e=>({default:e.PasswordField})),markdown:()=>Promise.resolve().then(()=>Qe).then(e=>({default:e.RichTextField})),html:()=>Promise.resolve().then(()=>Qe).then(e=>({default:e.RichTextField})),lookup:()=>Promise.resolve().then(()=>Ot).then(e=>({default:e.LookupField})),master_detail:()=>Promise.resolve().then(()=>er).then(e=>({default:e.MasterDetailField})),file:()=>Promise.resolve().then(()=>zt).then(e=>({default:e.FileField})),image:()=>Promise.resolve().then(()=>Dt).then(e=>({default:e.ImageField})),location:()=>Promise.resolve().then(()=>Mt).then(e=>({default:e.LocationField})),formula:()=>Promise.resolve().then(()=>It).then(e=>({default:e.FormulaField})),summary:()=>Promise.resolve().then(()=>Lt).then(e=>({default:e.SummaryField})),auto_number:()=>Promise.resolve().then(()=>Ut).then(e=>({default:e.AutoNumberField})),user:()=>Promise.resolve().then(()=>Xe).then(e=>({default:e.UserField})),owner:()=>Promise.resolve().then(()=>Xe).then(e=>({default:e.UserField})),object:()=>Promise.resolve().then(()=>Bt).then(e=>({default:e.ObjectField})),vector:()=>Promise.resolve().then(()=>Vt).then(e=>({default:e.VectorField})),grid:()=>Promise.resolve().then(()=>Yt).then(e=>({default:e.GridField})),color:()=>Promise.resolve().then(()=>qt).then(e=>({default:e.ColorField})),slider:()=>Promise.resolve().then(()=>Gt).then(e=>({default:e.SliderField})),rating:()=>Promise.resolve().then(()=>Jt).then(e=>({default:e.RatingField})),code:()=>Promise.resolve().then(()=>Wt).then(e=>({default:e.CodeField})),avatar:()=>Promise.resolve().then(()=>Qt).then(e=>({default:e.AvatarField})),address:()=>Promise.resolve().then(()=>Xt).then(e=>({default:e.AddressField})),geolocation:()=>Promise.resolve().then(()=>Ht).then(e=>({default:e.GeolocationField})),signature:()=>Promise.resolve().then(()=>Zt).then(e=>({default:e.SignatureField})),qrcode:()=>Promise.resolve().then(()=>Kt).then(e=>({default:e.QRCodeField}))};function ft(e){const r=mt[e];if(!r){console.warn(`Unknown field type: ${e}`);return}const n=C.lazy(r);b.ComponentRegistry.register(e,n,{namespace:"field"})}function pt(){Object.keys(mt).forEach(e=>{ft(e)})}function ur(){b.ComponentRegistry.register("text",N(ie),{namespace:"field"}),b.ComponentRegistry.register("textarea",N(ge),{namespace:"field"}),b.ComponentRegistry.register("number",N(oe),{namespace:"field"}),b.ComponentRegistry.register("boolean",N(ce),{namespace:"field"}),b.ComponentRegistry.register("select",N(de),{namespace:"field"}),b.ComponentRegistry.register("date",N(ue),{namespace:"field"}),b.ComponentRegistry.register("datetime",N(be),{namespace:"field"}),b.ComponentRegistry.register("time",N(je),{namespace:"field"}),b.ComponentRegistry.register("email",N(me),{namespace:"field"}),b.ComponentRegistry.register("phone",N(fe),{namespace:"field"}),b.ComponentRegistry.register("url",N(pe),{namespace:"field"}),b.ComponentRegistry.register("currency",N(xe),{namespace:"field"}),b.ComponentRegistry.register("percent",N(ye),{namespace:"field"}),b.ComponentRegistry.register("password",N(Ne),{namespace:"field"}),b.ComponentRegistry.register("markdown",N(H),{namespace:"field"}),b.ComponentRegistry.register("html",N(H),{namespace:"field"}),b.ComponentRegistry.register("lookup",N(he),{namespace:"field"}),b.ComponentRegistry.register("master_detail",N(Le),{namespace:"field"}),b.ComponentRegistry.register("file",N(ve),{namespace:"field"}),b.ComponentRegistry.register("image",N(Fe),{namespace:"field"}),b.ComponentRegistry.register("location",N(_e),{namespace:"field"}),b.ComponentRegistry.register("formula",N(Ce),{namespace:"field"}),b.ComponentRegistry.register("summary",N(we),{namespace:"field"}),b.ComponentRegistry.register("auto_number",N(Se),{namespace:"field"}),b.ComponentRegistry.register("user",N(Z),{namespace:"field"}),b.ComponentRegistry.register("owner",N(Z),{namespace:"field"}),b.ComponentRegistry.register("object",N(Re),{namespace:"field"}),b.ComponentRegistry.register("vector",N(Te),{namespace:"field"}),b.ComponentRegistry.register("grid",N(Pe),{namespace:"field"}),b.ComponentRegistry.register("color",N(Oe),{namespace:"field"}),b.ComponentRegistry.register("slider",N(ke),{namespace:"field"}),b.ComponentRegistry.register("rating",N(Ae),{namespace:"field"}),b.ComponentRegistry.register("code",N($e),{namespace:"field"}),b.ComponentRegistry.register("avatar",N(Ee),{namespace:"field"}),b.ComponentRegistry.register("address",N(ze),{namespace:"field"}),b.ComponentRegistry.register("geolocation",N(De),{namespace:"field"}),b.ComponentRegistry.register("signature",N(Me),{namespace:"field"}),b.ComponentRegistry.register("qrcode",N(Ie),{namespace:"field"})}pt();exports.AddressField=ze;exports.AutoNumberField=Se;exports.AvatarField=Ee;exports.BooleanCellRenderer=nt;exports.BooleanField=ce;exports.CodeField=$e;exports.ColorField=Oe;exports.CurrencyCellRenderer=rt;exports.CurrencyField=xe;exports.DateCellRenderer=at;exports.DateField=ue;exports.DateTimeCellRenderer=lt;exports.DateTimeField=be;exports.EmailCellRenderer=it;exports.EmailField=me;exports.FileCellRenderer=dt;exports.FileField=ve;exports.FormulaCellRenderer=ne;exports.FormulaField=Ce;exports.GeolocationField=De;exports.GridField=Pe;exports.ImageCellRenderer=ut;exports.ImageField=Fe;exports.LocationField=_e;exports.LookupCellRenderer=G;exports.LookupField=he;exports.MasterDetailField=Le;exports.NumberCellRenderer=tt;exports.NumberField=oe;exports.ObjectField=Re;exports.PasswordField=Ne;exports.PercentCellRenderer=st;exports.PercentField=ye;exports.PhoneCellRenderer=ct;exports.PhoneField=fe;exports.QRCodeField=Ie;exports.RatingField=Ae;exports.RichTextField=H;exports.SelectCellRenderer=q;exports.SelectField=de;exports.SignatureField=Me;exports.SliderField=ke;exports.SummaryField=we;exports.TextAreaField=ge;exports.TextCellRenderer=E;exports.TextField=ie;exports.TimeField=je;exports.UrlCellRenderer=ot;exports.UrlField=pe;exports.UserCellRenderer=J;exports.UserField=Z;exports.VectorField=Te;exports.buildValidationRules=dr;exports.evaluateCondition=le;exports.formatCompactCurrency=tr;exports.formatCurrency=Ze;exports.formatDate=ee;exports.formatDateTime=rr;exports.formatFileSize=cr;exports.formatPercent=Ke;exports.formatRelativeDate=et;exports.getCellRenderer=ir;exports.humanizeLabel=K;exports.mapFieldTypeToFormType=or;exports.registerAllFields=pt;exports.registerField=ft;exports.registerFieldRenderer=M;exports.registerFields=ur;
13
+ }`,disabled:l||n.disabled,className:d.cn("font-mono text-xs",f?"border-red-500 focus-visible:ring-red-500":"",n.className),rows:6}),f&&t.jsx("p",{className:"text-xs text-red-500",children:f})]})}const Xt=Object.freeze(Object.defineProperty({__proto__:null,ObjectField:De},Symbol.toStringTag,{value:"Module"}));function ze({value:e,field:r,...s}){const n=(r||s.schema)?.dimensions||(Array.isArray(e)?e.length:0);if(!e||!Array.isArray(e))return t.jsx("span",{className:"text-sm text-gray-500",children:"-"});const a=e.slice(0,3).map(i=>{const o=Number(i);return isNaN(o)?"0":o.toFixed(4)}).join(", ");return t.jsxs("div",{className:`text-sm ${s.className||""}`,children:[t.jsxs("span",{className:"font-mono text-gray-700",children:["[",a,"...]"]}),t.jsxs("span",{className:"text-gray-500 ml-2",children:["(",n,"D)"]})]})}const Ht=Object.freeze(Object.defineProperty({__proto__:null,VectorField:ze},Symbol.toStringTag,{value:"Module"}));function Me({value:e,field:r,readonly:s,...l}){const a=(r||l.schema)?.columns||[];return!e||!Array.isArray(e)?t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"}):s?t.jsx("div",{className:d.cn("text-sm",l.className),children:t.jsxs("span",{className:"text-foreground",children:[e.length," rows"]})}):t.jsxs("div",{className:d.cn("border border-border rounded-lg overflow-hidden",l.className),children:[t.jsx("div",{className:"overflow-auto max-h-60",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{className:"bg-muted border-b border-border",children:t.jsx("tr",{children:a.map((i,o)=>t.jsx("th",{className:"px-3 py-2 text-left text-xs font-medium text-muted-foreground",children:i.label||i.name},o))})}),t.jsx("tbody",{className:"divide-y divide-border",children:e.slice(0,5).map((i,o)=>t.jsx("tr",{className:"hover:bg-muted/50 transition-colors",children:a.map((c,f)=>t.jsx("td",{className:"px-3 py-2 text-foreground",children:i[c.name]!=null?String(i[c.name]):"-"},f))},o))})]})}),e.length>5&&t.jsxs("div",{className:"bg-muted px-3 py-2 text-xs text-muted-foreground border-t border-border",children:["Showing 5 of ",e.length," rows"]})]})}const Kt=Object.freeze(Object.defineProperty({__proto__:null,GridField:Me},Symbol.toStringTag,{value:"Module"}));function Ie({value:e,onChange:r,field:s,readonly:l,...n}){const a=s||n.schema;return l?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded border border-input",style:{backgroundColor:e||"#000000"}}),t.jsx("span",{className:"text-sm",children:e||"-"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"color",value:e||"#000000",onChange:i=>r(i.target.value),disabled:l||n.disabled,className:"w-10 h-10 rounded border border-input cursor-pointer"}),t.jsx(d.Input,{type:"text",value:e||"",onChange:i=>r(i.target.value),placeholder:a?.placeholder||"#000000",disabled:l||n.disabled,className:n.className,pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"})]})}const Zt=Object.freeze(Object.defineProperty({__proto__:null,ColorField:Ie},Symbol.toStringTag,{value:"Module"}));function Le({value:e,onChange:r,field:s,readonly:l,...n}){const a=s||n.schema,i=a?.min??0,o=a?.max??100,c=a?.step??1;return l?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium",children:e??i}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:["/ ",o]})]}):t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(d.Slider,{value:[e??i],onValueChange:f=>r(f[0]),min:i,max:o,step:c,disabled:l||n.disabled,className:n.className}),t.jsx("span",{className:"text-sm font-medium w-12 text-right",children:e??i})]})}const er=Object.freeze(Object.defineProperty({__proto__:null,SliderField:Le},Symbol.toStringTag,{value:"Module"}));function Ue({value:e,onChange:r,field:s,readonly:l,className:n,...a}){const o=(s||a.schema)?.max??5,c=e??0,[f,g]=j.useState(null),p=f!==null?f:c;return l?t.jsxs("div",{className:d.cn("flex items-center gap-1",n),children:[Array.from({length:o},(m,x)=>t.jsx(S.Star,{className:`w-5 h-5 ${x<c?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},x)),t.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[c," / ",o]})]}):t.jsxs("div",{className:d.cn("flex items-center gap-1",n),children:[Array.from({length:o},(m,x)=>t.jsx("button",{type:"button",onClick:()=>r(x+1),onMouseEnter:()=>g(x+1),onMouseLeave:()=>g(null),className:"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 rounded",disabled:l||a.disabled,children:t.jsx(S.Star,{className:`w-5 h-5 transition-colors ${x<p?"fill-yellow-400 text-yellow-400 hover:fill-yellow-500 hover:text-yellow-500":"text-muted-foreground hover:text-yellow-400"}`})},x)),t.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:[c," / ",o]})]})}const tr=Object.freeze(Object.defineProperty({__proto__:null,RatingField:Ue},Symbol.toStringTag,{value:"Module"}));function Be({value:e,onChange:r,field:s,readonly:l,...n}){const a=s||n.schema,i=a?.language??"javascript";return l?t.jsx("pre",{className:d.cn("text-sm bg-muted p-2 rounded overflow-x-auto border",n.className),children:t.jsx("code",{children:e||"-"})}):t.jsx(d.Textarea,{value:e||"",onChange:o=>r(o.target.value),placeholder:a?.placeholder||`// Write ${i} code here...`,disabled:l||n.disabled,className:d.cn("font-mono text-sm",n.className),rows:12,spellCheck:!1})}const rr=Object.freeze(Object.defineProperty({__proto__:null,CodeField:Be},Symbol.toStringTag,{value:"Module"}));function Ve({value:e,onChange:r,field:s,readonly:l,...n}){const[a,i]=j.useState(!1),o=j.useRef(null),c=s||n.schema,f=m=>{const x=m.target.files?.[0];if(!x)return;if(!x.type.startsWith("image/")){console.error("Please select an image file");return}if(x.size>5*1024*1024){console.error("File size must be less than 5MB");return}const b=new FileReader;b.onloadend=()=>{r(b.result)},b.readAsDataURL(x)},g=()=>{r("")},p=()=>(c?.defaultName||c?.label||"User").split(" ").map(x=>x[0]).join("").toUpperCase().slice(0,2);return l?t.jsxs(d.Avatar,{className:"w-16 h-16",children:[e&&t.jsx(d.AvatarImage,{src:e,alt:c?.label}),t.jsx(d.AvatarFallback,{children:p()})]}):t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"relative",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[t.jsxs(d.Avatar,{className:"w-16 h-16",children:[e&&t.jsx(d.AvatarImage,{src:e,alt:c?.label}),t.jsx(d.AvatarFallback,{children:p()})]}),!l&&a&&e&&t.jsx("button",{type:"button",onClick:g,className:"absolute -top-1 -right-1 bg-destructive text-destructive-foreground rounded-full p-1 hover:bg-destructive/90",children:t.jsx(S.X,{className:"w-3 h-3"})})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:f,className:"hidden"}),t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>o.current?.click(),disabled:l||n.disabled,children:[t.jsx(S.Upload,{className:"w-4 h-4 mr-2"}),e?"Change":"Upload"," Avatar"]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG up to 5MB"})]})]})}const sr=Object.freeze(Object.defineProperty({__proto__:null,AvatarField:Ve},Symbol.toStringTag,{value:"Module"}));function Ye({value:e,onChange:r,field:s,readonly:l,...n}){const a=e||{},i=(c,f)=>{r({...a,[c]:f})},o=c=>[c.street,c.city,[c.state,c.zipCode].filter(Boolean).join(" "),c.country].filter(Boolean).join(", ")||"-";return l?t.jsx("span",{className:"text-sm",children:o(a)}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"street",className:"text-xs",children:"Street Address"}),t.jsx(d.Input,{id:"street",type:"text",value:a.street||"",onChange:c=>i("street",c.target.value),placeholder:"123 Main St",disabled:l||n.disabled,className:n.className})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"city",className:"text-xs",children:"City"}),t.jsx(d.Input,{id:"city",type:"text",value:a.city||"",onChange:c=>i("city",c.target.value),placeholder:"San Francisco",disabled:l||n.disabled})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"state",className:"text-xs",children:"State / Province"}),t.jsx(d.Input,{id:"state",type:"text",value:a.state||"",onChange:c=>i("state",c.target.value),placeholder:"CA",disabled:l||n.disabled})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"zipCode",className:"text-xs",children:"ZIP / Postal Code"}),t.jsx(d.Input,{id:"zipCode",type:"text",value:a.zipCode||"",onChange:c=>i("zipCode",c.target.value),placeholder:"94102",disabled:l||n.disabled})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"country",className:"text-xs",children:"Country"}),t.jsx(d.Input,{id:"country",type:"text",value:a.country||"",onChange:c=>i("country",c.target.value),placeholder:"United States",disabled:l||n.disabled})]})]})]})}const nr=Object.freeze(Object.defineProperty({__proto__:null,AddressField:Ye},Symbol.toStringTag,{value:"Module"}));function qe({value:e,onChange:r,field:s,readonly:l,...n}){const[a,i]=j.useState(!1),o=e||{},c=(m,x)=>{r({...o,[m]:x?Number(x):void 0})},f=()=>{if(!navigator.geolocation){console.error("Geolocation is not supported by this browser");return}i(!0),navigator.geolocation.getCurrentPosition(m=>{r({latitude:m.coords.latitude,longitude:m.coords.longitude,accuracy:m.coords.accuracy}),i(!1)},m=>{console.error("Error getting location:",m.message),i(!1)},{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})},g=m=>!m.latitude||!m.longitude?"-":`${m.latitude.toFixed(6)}, ${m.longitude.toFixed(6)}`,p=()=>{if(!o.latitude||!o.longitude)return;const m=`https://www.google.com/maps?q=${o.latitude},${o.longitude}`;window.open(m,"_blank")};return l?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(S.MapPin,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:g(o)}),o.latitude&&o.longitude&&t.jsx(d.Button,{type:"button",variant:"link",size:"sm",onClick:p,className:"p-0 h-auto",children:"View on map"})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:l||a,children:[t.jsx(S.Crosshair,{className:"w-4 h-4 mr-2"}),a?"Getting location...":"Use Current Location"]}),o.latitude&&o.longitude&&t.jsxs(d.Button,{type:"button",variant:"link",size:"sm",onClick:p,children:[t.jsx(S.MapPin,{className:"w-4 h-4 mr-2"}),"View on map"]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"latitude",className:"text-xs",children:"Latitude"}),t.jsx(d.Input,{id:"latitude",type:"number",value:o.latitude??"",onChange:m=>c("latitude",m.target.value),placeholder:"37.7749",disabled:l||n.disabled,step:"any",className:n.className})]}),t.jsxs("div",{children:[t.jsx(d.Label,{htmlFor:"longitude",className:"text-xs",children:"Longitude"}),t.jsx(d.Input,{id:"longitude",type:"number",value:o.longitude??"",onChange:m=>c("longitude",m.target.value),placeholder:"-122.4194",disabled:l||n.disabled,step:"any"})]})]}),o.accuracy&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Accuracy: ±",o.accuracy.toFixed(0),"m"]})]})}const ar=Object.freeze(Object.defineProperty({__proto__:null,GeolocationField:qe},Symbol.toStringTag,{value:"Module"}));function Ge({value:e,onChange:r,readonly:s}){const l=j.useRef(null),[n,a]=j.useState(!1),[i,o]=j.useState(!e);j.useEffect(()=>{if(e&&l.current){const x=l.current.getContext("2d");if(x){const b=new Image;b.onload=()=>{x.drawImage(b,0,0),o(!1)},b.src=e}}},[e]);const c=m=>{if(s)return;a(!0),o(!1);const x=l.current;if(!x)return;const b=x.getContext("2d");if(!b)return;const C=x.getBoundingClientRect(),A="touches"in m?m.touches[0].clientX-C.left:m.clientX-C.left,z="touches"in m?m.touches[0].clientY-C.top:m.clientY-C.top;b.beginPath(),b.moveTo(A,z)},f=m=>{if(!n||s)return;const x=l.current;if(!x)return;const b=x.getContext("2d");if(!b)return;const C=x.getBoundingClientRect(),A="touches"in m?m.touches[0].clientX-C.left:m.clientX-C.left,z="touches"in m?m.touches[0].clientY-C.top:m.clientY-C.top;b.lineTo(A,z),b.strokeStyle="#000",b.lineWidth=2,b.lineCap="round",b.lineJoin="round",b.stroke()},g=()=>{if(!n)return;a(!1);const m=l.current;if(!m)return;const x=m.toDataURL("image/png");r(x)},p=()=>{const m=l.current;if(!m)return;const x=m.getContext("2d");x&&(x.clearRect(0,0,m.width,m.height),o(!0),r(""))};return s&&e?t.jsx("div",{className:"border rounded p-2 bg-white",children:t.jsx("img",{src:e,alt:"Signature",loading:"lazy",className:"max-w-full h-auto"})}):s&&!e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"No signature"}):t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"border rounded bg-white",children:t.jsx("canvas",{ref:l,width:400,height:200,className:"w-full touch-none cursor-crosshair",onMouseDown:c,onMouseMove:f,onMouseUp:g,onMouseLeave:g,onTouchStart:c,onTouchMove:f,onTouchEnd:g})}),t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("p",{className:"text-xs text-muted-foreground",children:i?"Sign above":"Signature captured"}),t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:p,disabled:s||i,children:[t.jsx(S.Eraser,{className:"w-4 h-4 mr-2"}),"Clear"]})]})]})}const lr=Object.freeze(Object.defineProperty({__proto__:null,SignatureField:Ge},Symbol.toStringTag,{value:"Module"}));function Je({value:e,onChange:r,field:s,readonly:l,...n}){const[a,i]=j.useState(!1),o=s||n.schema,c=g=>`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(g)}`,f=()=>{e&&navigator.clipboard.writeText(e)};return l?t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-sm flex-1 truncate",children:e||"-"}),e&&t.jsxs(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!a),children:[t.jsx(S.QrCode,{className:"w-4 h-4 mr-2"}),a?"Hide":"Show"," QR"]})]}):t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(d.Input,{type:"text",value:e||"",onChange:g=>r(g.target.value),placeholder:o?.placeholder||"Enter text for QR code",disabled:l||n.disabled,className:n.className}),e&&t.jsxs(t.Fragment,{children:[t.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:f,children:t.jsx(S.Copy,{className:"w-4 h-4"})}),t.jsx(d.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!a),children:t.jsx(S.QrCode,{className:"w-4 h-4"})})]})]}),a&&e&&t.jsx("div",{className:"border rounded p-4 bg-white flex justify-center",children:t.jsx("img",{src:c(e),alt:"QR Code",className:"w-48 h-48"})}),e&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["QR code contains: ",e.length," characters"]})]})}const ir=Object.freeze(Object.defineProperty({__proto__:null,QRCodeField:Je},Symbol.toStringTag,{value:"Module"}));function We({value:e,onChange:r,field:s,readonly:l,className:n,...a}){const i=e||[],o=s||a.schema,c=()=>{const p={id:`new-${Date.now()}`,label:"New Related Record"};r([...i,p])},f=p=>{r(i.filter(m=>m.id!==p))},g=p=>{console.log("View detail:",p)};return l?t.jsxs("div",{className:d.cn("space-y-2",n),children:[i.length===0?t.jsx("span",{className:"text-sm text-muted-foreground",children:"No related records"}):i.map(p=>t.jsxs("div",{className:"flex items-center justify-between p-2 border rounded hover:bg-muted/50",children:[t.jsx("span",{className:"text-sm",children:p.label}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>g(p),children:t.jsx(S.ExternalLink,{className:"w-4 h-4"})})]},p.id)),t.jsxs("p",{className:"text-xs text-muted-foreground",children:[i.length," ",i.length===1?"record":"records"]})]}):t.jsxs("div",{className:d.cn("space-y-3",n),children:[t.jsxs("div",{className:"space-y-2",children:[i.map(p=>t.jsxs("div",{className:"flex items-center justify-between gap-2 p-2 border rounded hover:bg-muted/50",children:[t.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[t.jsx(d.Badge,{variant:"outline",children:p.id}),t.jsx("span",{className:"text-sm flex-1",children:p.label})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>g(p),children:t.jsx(S.ExternalLink,{className:"w-4 h-4"})}),t.jsx(d.Button,{type:"button",variant:"ghost",size:"sm",onClick:()=>f(p.id),disabled:a.disabled,children:t.jsx(S.X,{className:"w-4 h-4"})})]})]},p.id)),i.length===0&&t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4 border border-dashed rounded bg-muted/20",children:"No related records"})]}),t.jsxs(d.Button,{type:"button",variant:"outline",className:"w-full",onClick:c,disabled:a.disabled,children:[t.jsx(S.Plus,{className:"w-4 h-4 mr-2"}),"Add ",o?.label||"Record"]})]})}const or=Object.freeze(Object.defineProperty({__proto__:null,MasterDetailField:We},Symbol.toStringTag,{value:"Module"}));function U(e){if(e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(r=>{if(r!=null&&typeof r=="object"){const s=r;return String(s.name||s.label||s.id||s._id||"[Object]")}return String(r)}).join(", ");if(typeof e=="object"){const r=e;return"$numberDecimal"in r?Number(r.$numberDecimal):"$oid"in r?String(r.$oid):"$date"in r?String(r.$date):String(r.name||r.label||r.id||r._id||"[Object]")}return String(e)}function st(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e)}catch{return`${r} ${e.toFixed(2)}`}}function cr(e,r="USD"){try{return new Intl.NumberFormat("en-US",{style:"currency",currency:r,notation:"compact",maximumFractionDigits:1}).format(e).replace(/\.0(?=[KMBT])/,"")}catch{return`${r} ${e}`}}function nt(e,r=0){return`${(e>-1&&e<1?e*100:e).toFixed(r)}%`}function de(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function at(e){if(!e)return"-";const r=typeof e=="string"?new Date(e):e;if(isNaN(r.getTime()))return"-";const s=new Date,l=new Date(s.getFullYear(),s.getMonth(),s.getDate()),a=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()-l.getTime(),i=Math.round(a/(1e3*60*60*24));if(i===0)return"Today";if(i===1)return"Tomorrow";if(i===-1)return"Yesterday";if(i<-1){const o=Math.abs(i);return o<=7?`Overdue ${o}d`:ue(r)}return i>1&&i<=7?`In ${i} days`:ue(r)}function ue(e,r){if(!e)return"-";const s=typeof e=="string"?new Date(e):e;if(isNaN(s.getTime()))return"-";if(r==="short"){const l=s.toLocaleDateString("en-US",{month:"short"}),n=s.getDate(),a=String(s.getFullYear()).slice(-2);return`${l} ${n}, '${a}`}return r==="relative"?at(s):s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function dr(e){if(!e)return"-";const r=typeof e=="string"?new Date(e):e;return isNaN(r.getTime())?"-":r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function q({value:e}){const r=U(e);return t.jsx("span",{className:"truncate",children:r!=null&&r!==""?String(r):"-"})}function lt({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const s=U(e),n=r.precision??0,a=Number(s),i=isNaN(a)?String(s):new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).format(a);return t.jsx("span",{className:"tabular-nums",children:i})}function it({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const s=U(e),n=r.currency||"USD",a=Number(s),i=isNaN(a)?String(s):st(a,n);return t.jsx("span",{className:"tabular-nums font-medium whitespace-nowrap",children:i})}const ur=/progress|completion/;function ot({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const s=U(e),n=r.precision??0,a=Number(s);if(isNaN(a))return t.jsx("span",{className:"tabular-nums whitespace-nowrap",children:String(s)});const i=ur.test(r?.name?.toLowerCase()||""),o=i?a:a>-1&&a<1?a*100:a,c=i?`${a.toFixed(n)}%`:nt(a,n),f=Math.max(0,Math.min(100,o));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-1.5 w-16 rounded-full bg-muted overflow-hidden flex-shrink-0",role:"progressbar","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":100,children:t.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${f}%`}})}),t.jsx("span",{className:"tabular-nums whitespace-nowrap",children:c})]})}const mr=new Set(["active","is_active","enabled","is_enabled","verified","is_verified"]);function ct({value:e,field:r}){if(e==null)return t.jsx("span",{className:"text-muted-foreground/50 text-xs italic flex items-center justify-center",children:"—"});const s=r?.name?.toLowerCase()||"";return s==="completed"||s==="is_completed"||s==="done"||s==="is_done"?t.jsx("div",{className:"flex items-center justify-center",children:e?t.jsx("div",{className:"size-5 rounded-full bg-green-500 flex items-center justify-center",role:"img","aria-label":"Completed","data-testid":"completion-indicator",children:t.jsx(S.Check,{className:"size-3 text-white"})}):t.jsx("div",{className:"size-5 rounded-full border-2 border-muted-foreground/30",role:"img","aria-label":"Not completed","data-testid":"completion-indicator"})}):mr.has(s)&&!e?t.jsxs(d.Badge,{variant:"destructive",className:"text-xs","data-testid":"boolean-warning-badge",children:[r?.label||de(s)," — Off"]}):t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(d.Checkbox,{checked:!!e,disabled:!0,className:"pointer-events-none"})})}function dt({value:e,field:r}){if(!e)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const s=U(e),n=r.format||"relative",a=ue(s,n),i=typeof s=="string"?new Date(s):s,o=i instanceof Date&&!isNaN(i.getTime()),c=new Date;c.setHours(0,0,0,0);const f=o&&i<c,g=o?i.toISOString():String(s);return t.jsx("span",{className:`tabular-nums${f?" text-red-600":""}`,title:g,children:a})}function ut({value:e}){if(!e)return t.jsx("span",{className:"text-muted-foreground",children:"-"});const r=U(e),s=typeof r=="string"?new Date(r):r;if(!(s instanceof Date)||isNaN(s.getTime()))return t.jsx("span",{className:"text-muted-foreground",children:"-"});const l=s.toLocaleDateString(void 0,{month:"numeric",day:"numeric",year:"numeric"}),n=s.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",hour12:!0}).toLowerCase();return t.jsxs("span",{className:"tabular-nums text-sm whitespace-nowrap",children:[t.jsx("span",{children:l}),t.jsx("span",{className:"ml-2 text-muted-foreground",children:n})]})}const fr={critical:"red",urgent:"red",high:"orange",medium:"yellow",normal:"blue",low:"gray",none:"gray",paid:"green",completed:"green",done:"green",active:"green",approved:"green",resolved:"green",pending:"yellow",waiting:"yellow",on_hold:"yellow",shipped:"blue",in_progress:"blue",open:"blue",processing:"blue",draft:"gray",new:"gray",inactive:"gray",closed:"gray",cancelled:"red",canceled:"red",rejected:"red",failed:"red",overdue:"red",delivered:"purple",archived:"indigo"},pr={gray:"bg-gray-100 text-gray-800 border-gray-300",red:"bg-red-100 text-red-800 border-red-300",orange:"bg-orange-100 text-orange-800 border-orange-300",yellow:"bg-yellow-100 text-yellow-800 border-yellow-300",green:"bg-green-100 text-green-800 border-green-300",blue:"bg-blue-100 text-blue-800 border-blue-300",indigo:"bg-indigo-100 text-indigo-800 border-indigo-300",purple:"bg-purple-100 text-purple-800 border-purple-300",pink:"bg-pink-100 text-pink-800 border-pink-300"};function tt(e,r){const s=e||(r?fr[String(r).toLowerCase().replace(/[\s-]/g,"_")]:void 0);return pr[s||""]||"bg-muted text-muted-foreground border-border"}function ne({value:e,field:r}){const l=r.options||[];if(!e)return t.jsx("span",{children:"-"});if(Array.isArray(e))return t.jsx("div",{className:"flex flex-wrap gap-1",children:e.map((o,c)=>{const f=l.find(m=>m.value===o),g=f?.label||de(String(o)),p=tt(f?.color,o);return t.jsx(d.Badge,{variant:"outline",className:p,children:g},c)})});const n=l.find(o=>o.value===e),a=n?.label||de(String(e)),i=tt(n?.color,e);return t.jsx(d.Badge,{variant:"outline",className:i,children:a})}function mt({value:e}){if(!e)return t.jsx("span",{children:"-"});const r=String(U(e)??""),[s,l]=j.useState(!1),n=a=>{a.stopPropagation(),a.preventDefault(),navigator.clipboard.writeText(r).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)}).catch(()=>{})};return t.jsxs("span",{className:"inline-flex items-center gap-1 group/email",children:[t.jsx(d.Button,{variant:"link",className:"p-0 h-auto font-normal text-blue-600 hover:text-blue-800",asChild:!0,children:t.jsx("a",{href:`mailto:${r}`,onClick:a=>a.stopPropagation(),children:r})}),t.jsx("button",{type:"button",className:"opacity-0 group-hover/email:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",onClick:n,"aria-label":"Copy email",children:s?t.jsx(S.Check,{className:"h-3 w-3 text-green-600"}):t.jsx(S.Copy,{className:"h-3 w-3 text-muted-foreground"})})]})}function ft({value:e}){if(!e)return t.jsx("span",{children:"-"});const r=String(U(e)??"");return t.jsx(d.Button,{variant:"link",className:"p-0 h-auto font-normal text-blue-600 hover:text-blue-800",asChild:!0,children:t.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:s=>s.stopPropagation(),children:r})})}function pt({value:e}){if(!e)return t.jsx("span",{children:"-"});const r=String(U(e)??""),[s,l]=j.useState(!1),n=a=>{a.stopPropagation(),a.preventDefault(),navigator.clipboard.writeText(r).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)}).catch(()=>{})};return t.jsxs("span",{className:"inline-flex items-center gap-1 group/phone",children:[t.jsxs("a",{href:`tel:${r}`,className:"inline-flex items-center gap-1 text-blue-600 hover:text-blue-800",onClick:a=>a.stopPropagation(),children:[t.jsx(S.Phone,{className:"h-3 w-3"}),r]}),t.jsx("button",{type:"button",className:"opacity-0 group-hover/phone:opacity-100 transition-opacity p-0.5 rounded hover:bg-muted",onClick:n,"aria-label":"Copy phone number",children:s?t.jsx(S.Check,{className:"h-3 w-3 text-green-600"}):t.jsx(S.Copy,{className:"h-3 w-3 text-muted-foreground"})})]})}function xt({value:e,field:r}){if(!e)return t.jsx("span",{children:"-"});if(r.multiple,Array.isArray(e)){const n=e.length;return t.jsxs("span",{className:"text-sm text-gray-600",children:[n," ",n===1?"file":"files"]})}const l=e.name||e.original_name||"File";return t.jsx("span",{className:"text-sm truncate",children:l})}function gt({value:e}){return e?Array.isArray(e)?t.jsxs("div",{className:"flex -space-x-2",children:[e.slice(0,3).map((r,s)=>t.jsx("img",{src:r.url||"",alt:r.name||`Image ${s+1}`,className:"size-8 rounded-md border-2 border-white object-cover"},s)),e.length>3&&t.jsxs("div",{className:"size-8 rounded-md border-2 border-white bg-gray-100 flex items-center justify-center text-xs font-medium text-gray-600",children:["+",e.length-3]})]}):t.jsx("img",{src:e.url||"",alt:e.name||"Image",className:"size-10 rounded-md object-cover"}):t.jsx("span",{children:"-"})}function ae({value:e,field:r}){if(e==null||e==="")return t.jsx("span",{children:"-"});const s=r.options||[],l=n=>{if(s.length>0){const a=s.find(i=>String(i.value)===String(n));if(a)return a.label}return String(n)};if(Array.isArray(e))return t.jsx("div",{className:"flex flex-wrap gap-1",children:e.map((n,a)=>{let i;return n!=null&&typeof n=="object"?i=n.name||n.label||n.id||n._id||String(n):i=l(n),t.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800",children:i},a)})});if(typeof e=="object"&&e!==null){const n=e.name||e.label||e.id||e._id||"[Object]";return t.jsx("span",{className:"truncate",children:n})}return t.jsx("span",{className:"truncate",children:l(e)})}function me({value:e}){const r=U(e);return t.jsx("span",{className:"text-gray-700 font-mono text-sm",children:r!=null?String(r):"-"})}function le({value:e}){if(!e)return t.jsx("span",{children:"-"});if(typeof e!="object")return t.jsx("span",{className:"truncate",children:String(e)});if(Array.isArray(e))return t.jsxs("div",{className:"flex -space-x-2",children:[e.slice(0,3).map((l,n)=>{if(typeof l!="object"||l===null)return t.jsx("span",{className:"truncate text-sm",children:String(l)},n);const a=l.name||l.username||"User",i=a.split(" ").map(o=>o[0]).join("").toUpperCase().slice(0,2);return t.jsx(d.Avatar,{className:"size-8 border-2 border-white",title:a,children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:i})},n)}),e.length>3&&t.jsx(d.Avatar,{className:"size-8 border-2 border-white",children:t.jsxs(d.AvatarFallback,{className:"bg-gray-200 text-gray-600 text-xs",children:["+",e.length-3]})})]});const r=e.name||e.username||"User",s=r.split(" ").map(l=>l[0]).join("").toUpperCase().slice(0,2);return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(d.Avatar,{className:"size-8",children:t.jsx(d.AvatarFallback,{className:"bg-blue-500 text-white text-xs",children:s})}),t.jsx("span",{className:"truncate",children:r})]})}const fe=new Map;function K(e,r){fe.set(e,r)}function xr(e){return fe.has(e)?fe.get(e):{text:q,textarea:q,markdown:q,html:q,number:lt,currency:it,percent:ot,boolean:ct,date:dt,datetime:ut,time:q,select:ne,status:ne,lookup:ae,master_detail:ae,email:mt,url:ft,phone:pt,file:xt,image:gt,formula:me,summary:me,auto_number:q,user:le,owner:le,password:()=>t.jsx("span",{children:"••••••"}),location:q,object:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Object]"}),vector:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Vector]"}),grid:()=>t.jsx("span",{className:"text-gray-500 italic",children:"[Grid]"})}[e]||q}K("lookup",ae);K("master_detail",ae);K("select",ne);K("status",ne);K("user",le);K("owner",le);function gr(e){return{text:"field:text",textarea:"field:textarea",markdown:"field:markdown",html:"field:html",number:"field:number",currency:"field:currency",percent:"field:percent",date:"field:date",datetime:"field:datetime",time:"field:time",boolean:"field:boolean",select:"field:select",lookup:"field:lookup",master_detail:"field:master_detail",email:"field:email",phone:"field:phone",url:"field:url",file:"field:file",image:"field:image",password:"field:password",location:"field:location",formula:"field:formula",summary:"field:summary",auto_number:"field:auto_number"}[e]||"field:text"}function hr(e){if(e<0||!Number.isFinite(e)||e===0)return"0 B";const r=["B","KB","MB","GB","TB"];let s=e,l=0;for(;s>=1024&&l<r.length-1;)s/=1024,l++;return`${s.toFixed(l>0?1:0)} ${r[l]}`}function br(e){const r={};return e.required&&(r.required=typeof e.required_message=="string"?e.required_message:`${e.label||e.name} is required`),e.min_length&&(r.minLength={value:e.min_length,message:e.min_length_message||`Minimum length is ${e.min_length} characters`}),e.max_length&&(r.maxLength={value:e.max_length,message:e.max_length_message||`Maximum length is ${e.max_length} characters`}),e.min!==void 0&&(r.min={value:e.min,message:e.min_message||`Minimum value is ${e.min}`}),e.max!==void 0&&(r.max={value:e.max,message:e.max_message||`Maximum value is ${e.max}`}),e.pattern&&(r.pattern={value:typeof e.pattern=="string"?new RegExp(e.pattern):e.pattern,message:e.pattern_message||"Invalid format"}),e.type==="email"&&(r.pattern={value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Please enter a valid email address"}),e.type==="url"&&(r.pattern={value:/^https?:\/\/.+/,message:"Please enter a valid URL"}),e.validate&&(r.validate=e.validate),Object.keys(r).length>0?r:void 0}function pe(e,r){if(!e)return!0;if(e.field&&e.value!==void 0){const s=r[e.field];if(e.operator==="="||e.operator==="==")return s===e.value;if(e.operator==="!=")return s!==e.value;if(e.operator===">")return s>e.value;if(e.operator===">=")return s>=e.value;if(e.operator==="<")return s<e.value;if(e.operator==="<=")return s<=e.value;if(e.operator==="in")return Array.isArray(e.value)&&e.value.includes(s)}return e.and&&Array.isArray(e.and)?e.and.every(s=>pe(s,r)):e.or&&Array.isArray(e.or)?e.or.some(s=>pe(s,r)):!0}function _(e){const r=({schema:s,className:l,value:n,...a})=>{const[i,o]=j.useState(n??s?.value??""),c={name:s?.name||"field",label:s?.label,type:s?.type,placeholder:s?.placeholder,required:s?.required,readonly:s?.readonly||s?.readOnly,help:s?.help,description:s?.description,defaultValue:s?.defaultValue||s?.value,...s},f=j.useCallback(p=>{o(p),a.onChange&&a.onChange(p)},[a]),g=s?.readonly||s?.readOnly||!1;return t.jsxs("div",{className:"grid w-full items-center gap-1.5","data-obj-id":s?.id,"data-obj-type":s?.type,children:[s?.label&&t.jsx("label",{htmlFor:s.id,className:s.required?"after:content-['*'] after:ml-0.5 after:text-red-500":"",children:s.label}),t.jsx(e,{value:i,onChange:f,field:c,readonly:g,className:l}),s?.description&&t.jsx("p",{className:"text-sm text-gray-500",children:s.description})]})};return r.displayName=`FieldRenderer(${e.displayName||e.name||"Component"})`,r}const ht={text:()=>Promise.resolve().then(()=>St).then(e=>({default:e.TextField})),textarea:()=>Promise.resolve().then(()=>Et).then(e=>({default:e.TextAreaField})),number:()=>Promise.resolve().then(()=>Ct).then(e=>({default:e.NumberField})),boolean:()=>Promise.resolve().then(()=>wt).then(e=>({default:e.BooleanField})),select:()=>Promise.resolve().then(()=>Rt).then(e=>({default:e.SelectField})),date:()=>Promise.resolve().then(()=>Tt).then(e=>({default:e.DateField})),datetime:()=>Promise.resolve().then(()=>Lt).then(e=>({default:e.DateTimeField})),time:()=>Promise.resolve().then(()=>Ut).then(e=>({default:e.TimeField})),email:()=>Promise.resolve().then(()=>Pt).then(e=>({default:e.EmailField})),phone:()=>Promise.resolve().then(()=>Ot).then(e=>({default:e.PhoneField})),url:()=>Promise.resolve().then(()=>kt).then(e=>({default:e.UrlField})),currency:()=>Promise.resolve().then(()=>$t).then(e=>({default:e.CurrencyField})),percent:()=>Promise.resolve().then(()=>Bt).then(e=>({default:e.PercentField})),password:()=>Promise.resolve().then(()=>Vt).then(e=>({default:e.PasswordField})),markdown:()=>Promise.resolve().then(()=>Ze).then(e=>({default:e.RichTextField})),html:()=>Promise.resolve().then(()=>Ze).then(e=>({default:e.RichTextField})),lookup:()=>Promise.resolve().then(()=>It).then(e=>({default:e.LookupField})),master_detail:()=>Promise.resolve().then(()=>or).then(e=>({default:e.MasterDetailField})),file:()=>Promise.resolve().then(()=>Yt).then(e=>({default:e.FileField})),image:()=>Promise.resolve().then(()=>qt).then(e=>({default:e.ImageField})),location:()=>Promise.resolve().then(()=>Gt).then(e=>({default:e.LocationField})),formula:()=>Promise.resolve().then(()=>Jt).then(e=>({default:e.FormulaField})),summary:()=>Promise.resolve().then(()=>Wt).then(e=>({default:e.SummaryField})),auto_number:()=>Promise.resolve().then(()=>Qt).then(e=>({default:e.AutoNumberField})),user:()=>Promise.resolve().then(()=>et).then(e=>({default:e.UserField})),owner:()=>Promise.resolve().then(()=>et).then(e=>({default:e.UserField})),object:()=>Promise.resolve().then(()=>Xt).then(e=>({default:e.ObjectField})),vector:()=>Promise.resolve().then(()=>Ht).then(e=>({default:e.VectorField})),grid:()=>Promise.resolve().then(()=>Kt).then(e=>({default:e.GridField})),color:()=>Promise.resolve().then(()=>Zt).then(e=>({default:e.ColorField})),slider:()=>Promise.resolve().then(()=>er).then(e=>({default:e.SliderField})),rating:()=>Promise.resolve().then(()=>tr).then(e=>({default:e.RatingField})),code:()=>Promise.resolve().then(()=>rr).then(e=>({default:e.CodeField})),avatar:()=>Promise.resolve().then(()=>sr).then(e=>({default:e.AvatarField})),address:()=>Promise.resolve().then(()=>nr).then(e=>({default:e.AddressField})),geolocation:()=>Promise.resolve().then(()=>ar).then(e=>({default:e.GeolocationField})),signature:()=>Promise.resolve().then(()=>lr).then(e=>({default:e.SignatureField})),qrcode:()=>Promise.resolve().then(()=>ir).then(e=>({default:e.QRCodeField}))};function bt(e){const r=ht[e];if(!r){console.warn(`Unknown field type: ${e}`);return}const s=j.lazy(r);v.ComponentRegistry.register(e,s,{namespace:"field"})}function jt(){Object.keys(ht).forEach(e=>{bt(e)})}function jr(){v.ComponentRegistry.register("text",_(xe),{namespace:"field"}),v.ComponentRegistry.register("textarea",_(_e),{namespace:"field"}),v.ComponentRegistry.register("number",_(ge),{namespace:"field"}),v.ComponentRegistry.register("boolean",_(he),{namespace:"field"}),v.ComponentRegistry.register("select",_(be),{namespace:"field"}),v.ComponentRegistry.register("date",_(je),{namespace:"field"}),v.ComponentRegistry.register("datetime",_(Ce),{namespace:"field"}),v.ComponentRegistry.register("time",_(we),{namespace:"field"}),v.ComponentRegistry.register("email",_(ye),{namespace:"field"}),v.ComponentRegistry.register("phone",_(Ne),{namespace:"field"}),v.ComponentRegistry.register("url",_(ve),{namespace:"field"}),v.ComponentRegistry.register("currency",_(Fe),{namespace:"field"}),v.ComponentRegistry.register("percent",_(Re),{namespace:"field"}),v.ComponentRegistry.register("password",_(Te),{namespace:"field"}),v.ComponentRegistry.register("markdown",_(oe),{namespace:"field"}),v.ComponentRegistry.register("html",_(oe),{namespace:"field"}),v.ComponentRegistry.register("lookup",_(Se),{namespace:"field"}),v.ComponentRegistry.register("master_detail",_(We),{namespace:"field"}),v.ComponentRegistry.register("file",_(Pe),{namespace:"field"}),v.ComponentRegistry.register("image",_(Oe),{namespace:"field"}),v.ComponentRegistry.register("location",_(ke),{namespace:"field"}),v.ComponentRegistry.register("formula",_(Ae),{namespace:"field"}),v.ComponentRegistry.register("summary",_($e),{namespace:"field"}),v.ComponentRegistry.register("auto_number",_(Ee),{namespace:"field"}),v.ComponentRegistry.register("user",_(ce),{namespace:"field"}),v.ComponentRegistry.register("owner",_(ce),{namespace:"field"}),v.ComponentRegistry.register("object",_(De),{namespace:"field"}),v.ComponentRegistry.register("vector",_(ze),{namespace:"field"}),v.ComponentRegistry.register("grid",_(Me),{namespace:"field"}),v.ComponentRegistry.register("color",_(Ie),{namespace:"field"}),v.ComponentRegistry.register("slider",_(Le),{namespace:"field"}),v.ComponentRegistry.register("rating",_(Ue),{namespace:"field"}),v.ComponentRegistry.register("code",_(Be),{namespace:"field"}),v.ComponentRegistry.register("avatar",_(Ve),{namespace:"field"}),v.ComponentRegistry.register("address",_(Ye),{namespace:"field"}),v.ComponentRegistry.register("geolocation",_(qe),{namespace:"field"}),v.ComponentRegistry.register("signature",_(Ge),{namespace:"field"}),v.ComponentRegistry.register("qrcode",_(Je),{namespace:"field"})}jt();exports.AddressField=Ye;exports.AutoNumberField=Ee;exports.AvatarField=Ve;exports.BooleanCellRenderer=ct;exports.BooleanField=he;exports.CodeField=Be;exports.ColorField=Ie;exports.CurrencyCellRenderer=it;exports.CurrencyField=Fe;exports.DateCellRenderer=dt;exports.DateField=je;exports.DateTimeCellRenderer=ut;exports.DateTimeField=Ce;exports.EmailCellRenderer=mt;exports.EmailField=ye;exports.FileCellRenderer=xt;exports.FileField=Pe;exports.FormulaCellRenderer=me;exports.FormulaField=Ae;exports.GeolocationField=qe;exports.GridField=Me;exports.ImageCellRenderer=gt;exports.ImageField=Oe;exports.LocationField=ke;exports.LookupCellRenderer=ae;exports.LookupField=Se;exports.MasterDetailField=We;exports.NumberCellRenderer=lt;exports.NumberField=ge;exports.ObjectField=De;exports.PasswordField=Te;exports.PercentCellRenderer=ot;exports.PercentField=Re;exports.PhoneCellRenderer=pt;exports.PhoneField=Ne;exports.QRCodeField=Je;exports.RatingField=Ue;exports.RichTextField=oe;exports.SelectCellRenderer=ne;exports.SelectField=be;exports.SignatureField=Ge;exports.SliderField=Le;exports.SummaryField=$e;exports.TextAreaField=_e;exports.TextCellRenderer=q;exports.TextField=xe;exports.TimeField=we;exports.UrlCellRenderer=ft;exports.UrlField=ve;exports.UserCellRenderer=le;exports.UserField=ce;exports.VectorField=ze;exports.buildValidationRules=br;exports.coerceToSafeValue=U;exports.evaluateCondition=pe;exports.formatCompactCurrency=cr;exports.formatCurrency=st;exports.formatDate=ue;exports.formatDateTime=dr;exports.formatFileSize=hr;exports.formatPercent=nt;exports.formatRelativeDate=at;exports.getCellRenderer=xr;exports.humanizeLabel=de;exports.mapFieldTypeToFormType=gr;exports.registerAllFields=jt;exports.registerField=bt;exports.registerFieldRenderer=K;exports.registerFields=jr;