import{a as e,l as t}from"./preact.module-CNakwbc9.js";import{d as n,p as r}from"./hooks.module-BrXTvcfS.js";import{t as i}from"./jsxRuntime.module-Cao1NCKs.js";import{r as a}from"./react_utils-Bz0ffU2Y.js";import{M as o,j as s}from"./hooks-ClTXKdUl.js";import{a as c,n as l,o as u,t as d}from"./FormList-CnuOJg6b.js";import{t as f}from"./FormTextBox-BLQGoABI.js";t(),n();function p(e,t){return!(`isVisible`in e)||(e.isVisible?.(t)??!0)}function m({note:e,property:t}){if(!p(t,e))return null;switch(t.type){case`button`:return i(_,{note:e,property:t});case`split-button`:return i(v,{note:e,property:t});case`checkbox`:return i(x,{note:e,property:t});case`number`:return i(y,{note:e,property:t});case`combobox`:return i(b,{note:e,property:t});case`submenu`:return i(h,{note:e,property:t});case`option-group`:return i(g,{note:e,property:t});case`separator`:return i(d,{})}}function h({note:e,property:t}){return i(l,{title:t.label,icon:t.icon??`bx bx-empty`,children:t.children.map((t,n)=>i(m,{note:e,property:t},n))})}function g({note:t,property:n}){let[r,a]=s(t,n.bindToLabel),o=r??n.defaultValue??null;return i(e,{children:[i(c,{disabled:!0,children:n.label}),n.options.map(e=>i(c,{checked:o===e.value,onClick:t=>{t.stopPropagation(),a(e.value)},children:e.label},e.value))]})}function _({note:e,property:t}){let n=r(a);return i(c,{icon:t.icon,title:t.title,onClick:()=>{n&&t.onClick({note:e,triggerCommand:n.triggerCommand.bind(n)})},children:t.label})}function v({note:e,property:t}){let n=r(a),o=t.items,s=n&&{note:e,triggerCommand:n.triggerCommand.bind(n)};return n&&i(l,{icon:t.icon??`bx bx-empty`,title:t.label,onDropdownToggleClicked:()=>s&&t.onClick(s),children:i(o,{note:e,parentComponent:n})})}function y({note:e,property:t}){let[n,r]=s(e,t.bindToLabel),a=t.disabled?.(e);return i(c,{icon:t.icon,disabled:a,onClick:e=>e.stopPropagation(),children:[t.label,i(f,{type:`number`,currentValue:n??``,onChange:r,style:{width:t.width??100},min:t.min??0,disabled:a})]})}function b({note:t,property:n}){let[r,a]=s(t,n.bindToLabel),o=r??n.defaultValue??null;function u(e){return i(c,{checked:o===e.value,onClick:()=>a(e.value),children:e.label},e.value)}return i(l,{title:n.label,icon:n.icon??`bx bx-empty`,dropStart:n.dropStart,children:n.options.map((t,r)=>`items`in t?i(e,{children:[i(c,{disabled:!0,children:t.title},t.title),t.items.map(u),r<n.options.length-1&&i(d,{})]},t.title):`type`in t?i(d,{},r):u(t))})}function x({note:e,property:t}){let[n,r]=o(e,t.bindToLabel);return i(u,{icon:t.icon,title:t.label,currentValue:t.reverseValue?!n:n,onChange:e=>r(t.reverseValue?!e:e)})}export{m as t};