UNPKG

@tomorrowevening/ux-lib

Version:

React components extracted from Hermes editor

23 lines (22 loc) 20.8 kB
(function(_,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],t):(_=typeof globalThis<"u"?globalThis:_||self,t(_.UXLib={},_.React))})(this,function(_,t){"use strict";function q(x){return x.substring(0,1).toUpperCase()+x.substring(1)}function de(x){const o=JSON.stringify(x);return navigator.clipboard.writeText(o),o}function me(){return Math.round(Math.random()*1e6).toString()}var J={exports:{}},G={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $;function pe(){if($)return G;$=1;var x=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function a(s,r,l){var b=null;if(l!==void 0&&(b=""+l),r.key!==void 0&&(b=""+r.key),"key"in r){l={};for(var d in r)d!=="key"&&(l[d]=r[d])}else l=r;return r=l.ref,{$$typeof:x,type:s,key:b,ref:r!==void 0?r:null,props:l}}return G.Fragment=o,G.jsx=a,G.jsxs=a,G}var U={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ee;function ve(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){function x(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case g:return"Profiler";case c:return"StrictMode";case p:return"Suspense";case y:return"SuspenseList";case S:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case u:return"Portal";case L:return(e.displayName||"Context")+".Provider";case C:return(e._context.displayName||"Context")+".Consumer";case f:var h=e.render;return e=e.displayName,e||(e=h.displayName||h.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return h=e.displayName||null,h!==null?h:x(e.type)||"Memo";case P:h=e._payload,e=e._init;try{return x(e(h))}catch{}}return null}function o(e){return""+e}function a(e){try{o(e);var h=!1}catch{h=!0}if(h){h=console;var k=h.error,O=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return k.call(h,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",O),o(e)}}function s(e){if(e===m)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===P)return"<...>";try{var h=x(e);return h?"<"+h+">":"<...>"}catch{return"<...>"}}function r(){var e=w.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function b(e){if(I.call(e,"key")){var h=Object.getOwnPropertyDescriptor(e,"key").get;if(h&&h.isReactWarning)return!1}return e.key!==void 0}function d(e,h){function k(){V||(V=!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)",h))}k.isReactWarning=!0,Object.defineProperty(e,"key",{get:k,configurable:!0})}function N(){var e=x(this.type);return oe[e]||(oe[e]=!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.")),e=this.props.ref,e!==void 0?e:null}function E(e,h,k,O,X,F,H,Q){return k=F.ref,e={$$typeof:v,type:e,key:h,props:F,_owner:X},(k!==void 0?k:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:N}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function j(e,h,k,O,X,F,H,Q){var A=h.children;if(A!==void 0)if(O)if(W(A)){for(O=0;O<A.length;O++)R(A[O]);Object.freeze&&Object.freeze(A)}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 R(A);if(I.call(h,"key")){A=x(e);var D=Object.keys(h).filter(function(Re){return Re!=="key"});O=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",fe[A+O]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,O,A,D,A),fe[A+O]=!0)}if(A=null,k!==void 0&&(a(k),A=""+k),b(h)&&(a(h.key),A=""+h.key),"key"in h){k={};for(var K in h)K!=="key"&&(k[K]=h[K])}else k=h;return A&&d(k,typeof e=="function"?e.displayName||e.name||"Unknown":e),E(e,A,F,X,r(),k,H,Q)}function R(e){typeof e=="object"&&e!==null&&e.$$typeof===v&&e._store&&(e._store.validated=1)}var i=t,v=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),L=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),z=Symbol.for("react.client.reference"),w=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,W=Array.isArray,Y=console.createTask?console.createTask:function(){return null};i={"react-stack-bottom-frame":function(e){return e()}};var V,oe={},ue=i["react-stack-bottom-frame"].bind(i,l)(),ie=Y(s(l)),fe={};U.Fragment=m,U.jsx=function(e,h,k,O,X){var F=1e4>w.recentlyCreatedOwnerStacks++;return j(e,h,k,!1,O,X,F?Error("react-stack-top-frame"):ue,F?Y(s(e)):ie)},U.jsxs=function(e,h,k,O,X){var F=1e4>w.recentlyCreatedOwnerStacks++;return j(e,h,k,!0,O,X,F?Error("react-stack-top-frame"):ue,F?Y(s(e)):ie)}}()),U}var te;function be(){return te||(te=1,process.env.NODE_ENV==="production"?J.exports=pe():J.exports=ve()),J.exports}var n=be();function M(x){const[o,a]=t.useState(x.defaultValue),s=t.useRef(x);return s.current=x,t.useEffect(()=>{a(x.defaultValue)},[x.defaultValue]),t.useEffect(()=>{let r=!1,l=-1,b=0,d=x.defaultValue,N=!1;const E=c=>{N=c.ctrlKey},j=c=>{if(!r)return;const g=s.current,C=g.step!==void 0?g.step:1,L=(c.clientX-l)*C*(N?10:1);d=Number((b+L).toFixed(4)),g.min!==void 0&&(d=Math.max(d,g.min)),g.max!==void 0&&(d=Math.min(d,g.max)),g.onChange!==void 0&&g.onChange(d),a(d)},R=()=>{r=!1},i=c=>{r=!0;const g=s.current;b=Number(g.input.current?.value),l=c.clientX},v=c=>{const g=s.current,C=Number(c.target.value);g.onChange!==void 0&&g.onChange(C),a(C)},u=x.label.current,m=x.sliderRef?.current;return u?.addEventListener("mousedown",i,!1),m?.addEventListener("input",v),document.addEventListener("keydown",E,!1),document.addEventListener("keyup",E,!1),document.addEventListener("mouseup",R,!1),document.addEventListener("mousemove",j,!1),document.addEventListener("contextmenu",R,!1),()=>{u?.removeEventListener("mousedown",i),m?.removeEventListener("input",v),document.removeEventListener("keydown",E),document.removeEventListener("keyup",E),document.removeEventListener("mouseup",R),document.removeEventListener("mousemove",j),document.removeEventListener("contextmenu",R)}},[]),o}const Z=t.memo(function({label:o,value:a,onChange:s,min:r,max:l,step:b=.01,type:d="number",disabled:N=!1}){const E=t.useRef(null),j=t.useRef(null),R=t.useRef(null),i=t.useCallback(m=>{s(m)},[s]),v=t.useCallback(m=>{const c=parseFloat(m.target.value)||0;i(c)},[i]),u=M({label:E,input:j,sliderRef:d==="range"?R:void 0,defaultValue:a,min:r,max:l,step:b,onChange:i});return n.jsxs(n.Fragment,{children:[n.jsx("label",{ref:E,className:"field-label",children:o}),n.jsx("div",{className:"field-control",children:d==="range"?n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:j,type:"text",value:u,className:"field-input min",disabled:N,onChange:v}),n.jsx("input",{ref:R,type:"range",value:u,min:r,max:l,step:b,className:"field-range",disabled:N,onChange:()=>{}})]}):n.jsx("input",{ref:j,type:"number",value:u,disabled:N,onChange:v,min:r,max:l,step:b,className:"field-input"})})]})}),ne=t.memo(function({value:o,onChange:a,min:s=0,max:r=1,step:l=.01}){const b=t.useRef(null),d=t.useRef(null),[N,E]=t.useState(!1),[j,R]=t.useState(o.x),[i,v]=t.useState(o.y),u=t.useRef(j),m=t.useRef(i);t.useEffect(()=>{u.current=j,m.current=i},[j,i]),t.useEffect(()=>{R(o.x),v(o.y)},[o]);const c=t.useRef(null),g=t.useRef(null),C=t.useRef(null),L=t.useRef(null);return M({label:c,input:C,defaultValue:j,min:s,max:r,step:l,onChange:f=>{R(f),a({x:f,y:m.current})}}),M({label:g,input:L,defaultValue:i,min:s,max:r,step:l,onChange:f=>{v(f),a({x:u.current,y:f})}}),t.useEffect(()=>{const f=b.current;if(!f)return;const p=f.getContext("2d");if(!p)return;p.clearRect(0,0,f.width,f.height),p.strokeStyle="#444",p.lineWidth=1;for(let S=0;S<=f.width;S+=20)p.beginPath(),p.moveTo(S,0),p.lineTo(S,f.height),p.stroke();for(let S=0;S<=f.height;S+=20)p.beginPath(),p.moveTo(0,S),p.lineTo(f.width,S),p.stroke();const y=(j-s)/(r-s)*f.width,T=f.height-(i-s)/(r-s)*f.height,P="#fff";p.fillStyle=P,p.beginPath(),p.arc(y,T,4,0,Math.PI*2),p.fill(),p.strokeStyle=P,p.lineWidth=1,p.beginPath(),p.moveTo(y-10,T),p.lineTo(y+10,T),p.moveTo(y,T-10),p.lineTo(y,T+10),p.stroke()},[j,i,s,r]),t.useEffect(()=>{const f=b.current;if(!f)return;const p=P=>{const S=f.getBoundingClientRect(),z=Math.round(P.clientX-S.left),w=Math.round(P.clientY-S.top),I=s+z/f.width*(r-s),W=s+(f.height-w)/f.height*(r-s),Y=Math.max(s,Math.min(r,I)),V=Math.max(s,Math.min(r,W));R(Y),v(V),a({x:Y,y:V}),E(!0)},y=P=>{if(!N)return;const S=f.getBoundingClientRect(),z=Math.round(P.clientX-S.left),w=Math.round(P.clientY-S.top),I=s+z/f.width*(r-s),W=s+(f.height-w)/f.height*(r-s),Y=Math.max(s,Math.min(r,I)),V=Math.max(s,Math.min(r,W));R(Y),v(V),a({x:Y,y:V})},T=()=>{E(!1)};return f.addEventListener("mousedown",p),document.addEventListener("mousemove",y),document.addEventListener("mouseup",T),()=>{f.removeEventListener("mousedown",p),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",T)}},[N,s,r,a]),n.jsxs("div",{className:"vector2-field",children:[n.jsxs("div",{className:"vector2-inputs",children:[n.jsxs("div",{className:"vector2-input",children:[n.jsx("label",{ref:c,className:"field-label",children:"X"}),n.jsx("input",{ref:C,type:"number",value:j,min:s,max:r,step:l,className:"field-input",onChange:f=>{const p=parseFloat(f.target.value);R(p),a({x:p,y:m.current})}})]}),n.jsxs("div",{className:"vector2-input",children:[n.jsx("label",{ref:g,className:"field-label",children:"Y"}),n.jsx("input",{ref:L,type:"number",value:i,min:s,max:r,step:l,className:"field-input",onChange:f=>{const p=parseFloat(f.target.value);v(p),a({x:u.current,y:p})}})]})]}),n.jsx("div",{ref:d,className:"vector2-canvas-container",children:n.jsx("canvas",{ref:b,width:200,height:200,className:"vector2-canvas"})})]})}),se=t.memo(function({value:o,onChange:a,min:s,max:r,step:l=.01,disabled:b=!1}){const[d,N]=t.useState(o.x),[E,j]=t.useState(o.y),[R,i]=t.useState(o.z),v=t.useRef(d),u=t.useRef(E),m=t.useRef(R);t.useEffect(()=>{v.current=d,u.current=E,m.current=R},[d,E,R]),t.useEffect(()=>{N(o.x),j(o.y),i(o.z)},[o]);const c=t.useRef(null),g=t.useRef(null),C=t.useRef(null),L=t.useRef(null),f=t.useRef(null),p=t.useRef(null);return M({label:c,input:L,defaultValue:d,min:s,max:r,step:l,onChange:y=>{N(y),a({x:y,y:u.current,z:m.current})}}),M({label:g,input:f,defaultValue:E,min:s,max:r,step:l,onChange:y=>{j(y),a({x:v.current,y,z:m.current})}}),M({label:C,input:p,defaultValue:R,min:s,max:r,step:l,onChange:y=>{i(y),a({x:v.current,y:u.current,z:y})}}),n.jsx("div",{className:"grid3-field",children:n.jsxs("div",{className:"grid3-inputs",children:[n.jsxs("div",{className:"grid3-input",children:[n.jsx("label",{ref:c,className:"field-label",children:"X"}),n.jsx("input",{ref:L,type:"number",value:d,min:s,max:r,step:l,className:"field-input",disabled:b,onChange:y=>{const T=parseFloat(y.target.value)||0;N(T),a({x:T,y:u.current,z:m.current})}})]}),n.jsxs("div",{className:"grid3-input",children:[n.jsx("label",{ref:g,className:"field-label",children:"Y"}),n.jsx("input",{ref:f,type:"number",value:E,min:s,max:r,step:l,className:"field-input",disabled:b,onChange:y=>{const T=parseFloat(y.target.value)||0;j(T),a({x:v.current,y:T,z:m.current})}})]}),n.jsxs("div",{className:"grid3-input",children:[n.jsx("label",{ref:C,className:"field-label",children:"Z"}),n.jsx("input",{ref:p,type:"number",value:R,min:s,max:r,step:l,className:"field-input",disabled:b,onChange:y=>{const T=parseFloat(y.target.value)||0;i(T),a({x:v.current,y:u.current,z:T})}})]})]})})}),re=t.memo(function({value:o,onChange:a,min:s,max:r,step:l=.01,disabled:b=!1}){const[d,N]=t.useState(o.x),[E,j]=t.useState(o.y),[R,i]=t.useState(o.z),[v,u]=t.useState(o.w),m=t.useRef(d),c=t.useRef(E),g=t.useRef(R),C=t.useRef(v);t.useEffect(()=>{m.current=d,c.current=E,g.current=R,C.current=v},[d,E,R,v]),t.useEffect(()=>{N(o.x),j(o.y),i(o.z),u(o.w)},[o]);const L=t.useRef(null),f=t.useRef(null),p=t.useRef(null),y=t.useRef(null),T=t.useRef(null),P=t.useRef(null),S=t.useRef(null),z=t.useRef(null);return M({label:L,input:T,defaultValue:d,min:s,max:r,step:l,onChange:w=>{N(w),a({x:w,y:c.current,z:g.current,w:C.current})}}),M({label:f,input:P,defaultValue:E,min:s,max:r,step:l,onChange:w=>{j(w),a({x:m.current,y:w,z:g.current,w:C.current})}}),M({label:p,input:S,defaultValue:R,min:s,max:r,step:l,onChange:w=>{i(w),a({x:m.current,y:c.current,z:w,w:C.current})}}),M({label:y,input:z,defaultValue:v,min:s,max:r,step:l,onChange:w=>{u(w),a({x:m.current,y:c.current,z:g.current,w})}}),n.jsx("div",{className:"grid4-field",children:n.jsxs("div",{className:"grid4-inputs",children:[n.jsxs("div",{className:"grid4-input",children:[n.jsx("label",{ref:L,className:"field-label",children:"X"}),n.jsx("input",{ref:T,type:"number",value:d,min:s,max:r,step:l,className:"field-input",disabled:b,onChange:w=>{const I=parseFloat(w.target.value)||0;N(I),a({x:I,y:c.current,z:g.current,w:C.current})}})]}),n.jsxs("div",{className:"grid4-input",children:[n.jsx("label",{ref:f,className:"field-label",children:"Y"}),n.jsx("input",{ref:P,type:"number",value:E,min:s,max:r,step:l,className:"field-input",disabled:b,onChange:w=>{const I=parseFloat(w.target.value)||0;j(I),a({x:m.current,y:I,z:g.current,w:C.current})}})]}),n.jsxs("div",{className:"grid4-input",children:[n.jsx("label",{ref:p,className:"field-label",children:"Z"}),n.jsx("input",{ref:S,type:"number",value:R,min:s,max:r,step:l,className:"field-input",disabled:b,onChange:w=>{const I=parseFloat(w.target.value)||0;i(I),a({x:m.current,y:c.current,z:I,w:C.current})}})]}),n.jsxs("div",{className:"grid4-input",children:[n.jsx("label",{ref:y,className:"field-label",children:"W"}),n.jsx("input",{ref:z,type:"number",value:v,min:s,max:r,step:l,className:"field-input",disabled:b,onChange:w=>{const I=parseFloat(w.target.value)||0;u(I),a({x:m.current,y:c.current,z:g.current,w:I})}})]})]})})}),ae=t.memo(function({value:o,onChange:a}){const s=t.useRef(null),[r,l]=t.useState(""),[b,d]=t.useState(o),N=t.useCallback(R=>{const i=R.target.files?.[0];if(i){l(i.name);const v=URL.createObjectURL(i);d(v);const u=new FileReader;u.onload=m=>{const c=m.target?.result;a(c)},u.readAsDataURL(i)}},[a]),E=t.useCallback(()=>{s.current?.click()},[]),j=t.useCallback(()=>{l(""),d(""),a(""),s.current&&(s.current.value="")},[a]);return n.jsxs("div",{className:"inspector-field image-field",children:[n.jsx("input",{ref:s,type:"file",accept:"image/*",onChange:N,style:{display:"none"}}),n.jsxs("div",{className:"image-controls",children:[n.jsx("button",{onClick:E,className:"field-button image-button",children:r?"Change Image":"Choose Image"}),r&&n.jsx("button",{onClick:j,className:"field-button image-clear-button",children:"Clear"})]}),r&&n.jsx("div",{className:"image-info",children:n.jsx("span",{className:"image-filename",children:r})}),b&&n.jsx("div",{className:"image-preview",children:n.jsx("img",{src:b,alt:"Preview",className:"preview-image"})})]})}),B=t.memo(function({label:o,type:a,value:s,onChange:r,onClick:l,min:b,max:d,step:N,options:E,block:j=!1,disabled:R=!1}){const i=t.useCallback(c=>{r?.(c)},[r]),v=t.useCallback(()=>{l?.()},[l]),m=(()=>{switch(a){case"string":return n.jsx("input",{type:"text",value:s||"",onChange:c=>i(c.target.value),className:"field-input",disabled:R});case"number":return n.jsx(Z,{label:o,value:s||0,onChange:i,min:b,max:d,step:N,disabled:R});case"range":return n.jsx(Z,{label:o,value:s||0,onChange:i,min:b,max:d,step:N,type:"range",disabled:R});case"boolean":return n.jsx("input",{type:"checkbox",checked:s||!1,onChange:c=>i(c.target.checked),className:"field-checkbox"});case"color":return n.jsx("input",{type:"color",value:s||"#ffffff",onChange:c=>i(c.target.value),className:"field-color"});case"vector2":return n.jsx(ne,{value:s||{x:0,y:0},min:b,max:d,step:N,onChange:i});case"grid3":return n.jsx(se,{value:s||{x:0,y:0,z:0},min:b,max:d,step:N,onChange:i});case"grid4":return n.jsx(re,{value:s||{x:0,y:0,z:0,w:0},min:b,max:d,step:N,onChange:i});case"image":return n.jsx(ae,{value:s||"",onChange:i});case"option":return n.jsx("select",{value:JSON.stringify(s),onChange:c=>{try{const g=JSON.parse(c.target.value);i(g)}catch{i(c.target.value)}},className:"field-select",children:E?.map((c,g)=>n.jsx("option",{value:JSON.stringify(c.value),children:c.label},g))});case"button":return n.jsx("button",{onClick:v,className:"field-button",children:o});default:return null}})();return a==="button"?n.jsx("div",{className:"inspector-field button-field",children:m}):a==="number"||a==="range"?n.jsx("div",{className:`inspector-field ${j?"block":""}`,children:m}):n.jsxs("div",{className:`inspector-field ${j?"block":""}`,children:[n.jsx("label",{className:`field-label ${a==="vector2"||a==="grid3"||a==="grid4"||a==="boolean"||a==="color"||a==="option"||a==="string"||a==="image"?"non-draggable":""}`,children:o}),n.jsx("div",{className:"field-control",children:m})]})}),ce=t.memo(function({title:o,children:a,defaultOpen:s=!1,className:r=""}){const[l,b]=t.useState(s),d=t.useRef(null),N=!l||a===void 0,E=t.useCallback(()=>{b(j=>!j)},[]);return n.jsxs("div",{className:`accordion ${N?"hide":""} ${r}`,children:[n.jsxs("button",{className:`accordion-header ${l?"open":""}`,onClick:E,type:"button",children:[n.jsx("span",{className:"accordion-title",children:o}),n.jsx("span",{className:`accordion-arrow ${l?"open":""}`,children:"▼"})]}),n.jsx("div",{ref:d,className:`accordion-content ${l?"open":""}`,children:n.jsx("div",{className:"accordion-body",children:a})})]})});function he(x){return"items"in x}const ge=t.forwardRef(function({title:o,defaultOpen:a=!1,items:s},r){const[l,b]=t.useState([]),[d,N]=t.useState(new Map),E=t.useCallback(v=>(console.warn("Nested groups not yet supported in memoized version"),t.createRef()),[]),j=t.useCallback(v=>{b(u=>u.filter(m=>m.name!==v))},[]),R=t.useCallback((v,u)=>{N(m=>{const c=new Map(m);return c.set(v,u),c})},[]);t.useImperativeHandle(r,()=>({addGroup:E,removeGroup:j,setField:R}));const i=()=>{const v=[];return s.forEach((u,m)=>{if(he(u))v.push(n.jsxs("div",{style:{marginLeft:"10px"},children:[n.jsx("h4",{children:q(u.title)}),u.items.map((c,g)=>n.jsx(B,{label:c.label,type:c.type,value:c.value,onChange:c.onChange,onClick:c.onClick},`nested-field-${g}`))]},`group-${m}`));else{const c=d.get(u.label),g=c!==void 0?c:u.value;v.push(n.jsx(B,{label:u.label,type:u.type,value:g,min:u.min,max:u.max,step:u.step,disabled:u.disabled,options:u.options,onChange:C=>{u.onChange!==void 0&&(N(L=>{const f=new Map(L);return f.delete(u.label),f}),u.onChange(C))},onClick:u.onClick},`field-${m}`))}}),l.forEach(u=>{v.push(u.element)}),v};return n.jsx(ce,{title:o,defaultOpen:a,children:i()})}),le=t.memo(ge,(x,o)=>JSON.stringify(x.items)===JSON.stringify(o.items)&&x.title===o.title&&x.defaultOpen===o.defaultOpen);le.displayName="InspectorGroup",_.Accordion=ce,_.InspectGrid3=se,_.InspectGrid4=re,_.InspectImage=ae,_.InspectNumber=Z,_.InspectVector2=ne,_.InspectorField=B,_.InspectorGroup=le,_.capitalize=q,_.copyToClipboard=de,_.randomID=me,_.useDragNumber=M,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});