@dipusevilla/componentes-iu 1.0.59 → 1.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -74,7 +74,7 @@ attempted value: ${i}
74
74
  border-gray-200\r
75
75
  border-t-[var(--color-ds-button-primary-bg)]\r
76
76
  animate-spin\r
77
- `}),s.jsx("span",{className:"sr-only",children:t})]}):null,ps=({items:e,selected:t,onSelect:r,level:n=0,openItems:o,onToggle:l})=>{const[i,c]=v.useState(new Set),d=o??i,u=o!==void 0&&l!==void 0,f=m=>{if(u)l(m);else{const h=new Set(i);h.has(m)?h.delete(m):h.add(m),c(h)}};return s.jsx("ul",{className:ce(n>0?"mt-1":"mt-0"),children:e.map(m=>{var p;const h=m.value===t,g=d.has(m.value),w=["pl-2","pl-2","pl-2"][n]||"pl-4",y=n===0?g||h?"bg-[var(--color-ds-background-accent)] text-[var(--color-ds-text-on-accent)] rounded-r-lg":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]":h?"bg-[var(--color-ds-background-surface)] text-[var(--color-ds-text-primary)]":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]",x=n===0&&(g||h)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",b=!!((p=m.children)!=null&&p.length);return s.jsxs("li",{children:[s.jsxs("button",{type:"button",onClick:()=>b?f(m.value):r(m.value),"aria-expanded":b?g:void 0,className:ce("w-full flex items-center justify-between h-8 transition-colors",w,y),children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[n===0&&m.icon&&s.jsx(m.icon,{className:"w-5 h-5 ml-2"}),s.jsx("span",{className:"text-ds-sm",children:m.label})]}),b&&(g?s.jsx(mn,{className:ce("w-4 h-4",x)}):s.jsx(To,{className:ce("w-4 h-4",x)}))]}),b&&s.jsx("div",{className:ce("overflow-hidden transition-[max-height] duration-300 ease-in-out","border-l-1 border-[var(--color-ds-background-accent)] ml-6",g?"max-h-screen":"max-h-0"),children:s.jsx(ps,{items:m.children,selected:t,onSelect:r,level:n+1,openItems:d,onToggle:u?l:f})})]},m.value)})})},AM="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23FFFFFF;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",SM="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23005751;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",Qi=({appName:e,orgName:t,username:r,footerText:n,navItems:o,selectedNav:l,onSelectNav:i,width:c="200px"})=>{const{theme:d}=hs(),u=d==="dark"?AM:SM;return s.jsxs("aside",{className:"flex flex-col h-screen bg-[var(--color-ds-background-page)] overflow-hidden",style:{width:c},children:[s.jsxs("div",{className:"flex gap-1 flex-col items-center py-4 space-y-1 ",children:[s.jsx("img",{src:u,alt:"Logo Diputación",className:"w-20 h-20"}),s.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-lg ",children:e}),s.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:t}),s.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:r}),s.jsx("div",{className:"w-1/5 h-0.5 rounded-full bg-[var(--color-ds-background-accent)] mt-2"})]}),s.jsx("nav",{className:"flex-1 overflow-auto pt-3",children:s.jsx(ps,{items:o,selected:l,onSelect:i})}),s.jsx("div",{className:"px-4 w-full py-3",children:s.jsx("span",{className:"text-ds-sm w-full text-center text-[var(--color-ds-text-secondary)]",children:n})})]})};function $M({hideSidebar:e=!1,sidebar:t,header:r,children:n}){const{dark:o}=hs(),l={...r,dark:o};return s.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[!e&&s.jsx(Qi,{...t}),s.jsxs("div",{className:`flex-1 flex flex-col overflow-auto [scrollbar-gutter:stable_both-edges] ${e?"px-0":"px-10"}`,children:[s.jsx(Xi,{...l}),s.jsx("main",{className:"flex-1 min-h-0",children:n})]})]})}function LM({columns:e,data:t,loadData:r,loading:n,idAccessor:o,multiSelect:l=!1,onSelectionChange:i,pageSize:c=10,initialSort:d,onSort:u,className:f,onRowDoubleClick:m}){const h=t!==void 0,[g,w]=v.useState([]),[y,x]=v.useState(!1),b=v.useRef(null);v.useEffect(()=>{var X;if(!r||h)return;(X=b.current)==null||X.abort();const $=new AbortController;return b.current=$,x(!0),r().then(_=>{$.signal.aborted||w(_)}).finally(()=>{$.signal.aborted||x(!1)}),()=>$.abort()},[r,h]);const p=v.useMemo(()=>h?t:g,[t,g,h]),E=n??(r?y:!1),[R,j]=v.useState(new Set),[A,L]=v.useState(1),[F,V]=v.useState(d==null?void 0:d.sortBy),[S,H]=v.useState((d==null?void 0:d.sortDir)??"asc"),z=$=>typeof o=="function"?o($):$[o],Y=v.useRef(null);v.useEffect(()=>{Y.current!==p&&(j(new Set),L(1),Y.current=p)},[p]);const ee=v.useMemo(()=>{if(!F)return p;const $=S==="asc"?1:-1;return[...p].sort((X,_)=>{const N=X[F],Q=_[F];return N==null?-$:Q==null||N>Q?$:N<Q?-$:0})},[p,F,S]),U=Math.max(1,Math.ceil(ee.length/c)),oe=v.useMemo(()=>{const $=(A-1)*c;return ee.slice($,$+c)},[ee,A,c]),q=$=>{const X=new Set(R);X.has($)?X.delete($):X.add($),j(X),i==null||i(p.filter(_=>X.has(z(_))))},M=()=>{const $=oe.every(_=>R.has(z(_))),X=new Set(R);oe.forEach(_=>{$?X.delete(z(_)):X.add(z(_))}),j(X),i==null||i(p.filter(_=>X.has(z(_))))},I=$=>{if(!$.sortable)return;const X=typeof $.accessor=="string"?$.accessor:$.sortKey;if(F===X){const _=S==="asc"?"desc":"asc";H(_),u==null||u(X,_)}else V(X),H("asc"),u==null||u(X,"asc");L(1)},he=()=>E?s.jsx("tbody",{children:Array.from({length:c}).map(($,X)=>s.jsxs("tr",{children:[l&&s.jsx("td",{className:"px-3 py-2",children:s.jsx(zt,{width:"1rem",height:"1rem",variant:"circle"})}),e.map((_,N)=>s.jsx("td",{className:"px-4 py-2",children:s.jsx(zt,{width:"100%",height:"1em",variant:"rect"})},N))]},X))}):oe.length?s.jsx("tbody",{className:"bg-[var(--color-ds-background-surface)]",children:oe.map($=>{const X=z($);return s.jsxs("tr",{className:ce("transition-colors","hover:bg-[var(--color-ds-border-default-50)]",m&&"cursor-pointer select-none"),onDoubleClick:m?()=>m($):void 0,title:m?"Doble clic para abrir":void 0,children:[l&&s.jsx("td",{className:"px-3 py-2",children:s.jsx("input",{type:"checkbox",className:"accent-[var(--color-ds-button-primary-bg)]",checked:R.has(X),onChange:()=>q(X),onDoubleClick:_=>_.stopPropagation()})}),e.map((_,N)=>{const Q=_.render?_.render($):typeof _.accessor=="function"?_.accessor($):$[_.accessor];return s.jsx("td",{className:ce("px-4 py-2 whitespace-nowrap text-[var(--color-ds-text-primary)] text-sm",_.width),children:Q},`${String(_.header)}-${N}`)})]},X)})}):s.jsx("tbody",{children:s.jsx("tr",{children:s.jsx("td",{className:"px-4 py-6 text-center text-[var(--color-ds-text-secondary)]",colSpan:e.length+(l?1:0),children:"No hay datos"})})});return s.jsxs("div",{className:ce("w-full overflow-auto rounded-lg border","border-[var(--color-ds-border-default-50)]",f),children:[s.jsxs("table",{className:"min-w-full",children:[s.jsx("thead",{className:"bg-[var(--color-ds-background-surface)] border-b border-[var(--color-ds-border-default-50)]",children:s.jsxs("tr",{children:[l&&s.jsx("th",{className:"px-3 py-2",children:s.jsx("input",{type:"checkbox",className:"accent-[var(--color-ds-button-primary-bg)]",checked:oe.length>0&&oe.every($=>R.has(z($))),onChange:M,onDoubleClick:$=>$.stopPropagation()})}),e.map($=>{const X=typeof $.accessor=="string"?$.accessor:$.header,_=F===(typeof $.accessor=="string"?$.accessor:$.sortKey);return s.jsx("th",{className:ce("px-4 py-2 text-left text-xs font-semibold uppercase tracking-wide select-none","text-[var(--color-ds-text-secondary)]",$.width),onClick:()=>I($),children:s.jsxs("div",{className:ce("inline-flex items-center gap-1",$.sortable&&"cursor-pointer"),children:[s.jsx("span",{children:$.header}),$.sortable&&s.jsx("span",{className:ce("text-[var(--color-ds-text-secondary)]"),children:_?S==="asc"?"▲":"▼":"⇵"})]})},X)})]})}),he()]}),s.jsxs("div",{className:"flex items-center justify-between py-2 px-4 border-t border-[var(--color-ds-border-default-50)] bg-[var(--color-ds-background-page)]/40",children:[s.jsx("span",{className:"text-sm text-[var(--color-ds-text-secondary)]",children:E?"Cargando...":`Página ${A} de ${U}`}),s.jsxs("div",{className:"space-x-2",children:[s.jsx(ie,{size:"sm",variant:"outline",disabled:E||A<=1,onClick:()=>L($=>Math.max(1,$-1)),children:"Prev"}),s.jsx(ie,{size:"sm",variant:"outline",disabled:E||A>=U,onClick:()=>L($=>Math.min(U,$+1)),children:"Next"})]})]})]})}function vs({control:e,name:t,rules:r,defaultValue:n=!1,checked:o,onChange:l,disabled:i=!1,label:c,labelPosition:d="right",errorMessage:u="",className:f}){const m=v.useId();if(e&&t)return s.jsx(Et,{name:t,control:e,rules:r,defaultValue:n,render:({field:g,fieldState:w})=>{var y;return s.jsx(vs,{checked:g.value,onChange:g.onChange,disabled:i,label:c,labelPosition:d,errorMessage:((y=w.error)==null?void 0:y.message)||"",className:f})}});const h=!!o;return s.jsxs("div",{className:ce("flex flex-col",f),children:[s.jsxs("label",{className:ce("inline-flex items-center space-x-3 select-none",i&&"opacity-50 cursor-not-allowed"),htmlFor:m,children:[c&&d==="left"&&s.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:c}),s.jsx("button",{id:m,type:"button",role:"switch","aria-checked":h,disabled:i,onClick:()=>!i&&(l==null?void 0:l(!h)),className:ce("relative inline-flex items-center h-8 w-16","bg-[var(--color-ds-background-accent)] rounded-full transition-colors duration-200","focus:outline-none "),children:s.jsx("div",{className:ce("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",h?"translate-x-9":"translate-x-1")})}),c&&d==="right"&&s.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:c})]}),s.jsx("div",{className:"pt-1 min-h-[18px] w-full",children:u?s.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:u}):s.jsx("span",{"aria-hidden":"true",children:" "})})]})}function e5({items:e,value:t,onValueChange:r,multiple:n=!0,dense:o=!1,className:l}){const i=v.useMemo(()=>e.filter(w=>w.defaultOpen&&!w.disabled).map(w=>w.id),[e]),[c,d]=v.useState(i),u=t??c,f=w=>{r?r(w):d(w)},m=(w,y)=>{y&&f(n?u.includes(w)?u.filter(x=>x!==w):[...u,w]:u.includes(w)?[]:[w])},h=(w,y,x)=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),m(y,x))},g=o?"py-1":"py-2";return s.jsx("div",{className:["divide-y","divide-[var(--color-ds-border-default-50)]",l].filter(Boolean).join(" "),children:e.map(w=>{const y=u.includes(w.id),x=!w.disabled;return s.jsxs("section",{"aria-disabled":w.disabled||void 0,children:[s.jsxs("button",{type:"button",onClick:()=>m(w.id,x),onKeyDown:b=>h(b,w.id,x),"aria-expanded":y,className:["w-full flex items-center justify-between gap-2 text-left select-none",g,"text-[var(--color-ds-text-primary)]",w.disabled?"opacity-60 cursor-not-allowed":"hover:bg-[color-mix(in_srgb,var(--color-ds-background-surface)_80%,transparent)]"].join(" "),children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[w.leftAdornment&&s.jsx("span",{className:"shrink-0",children:w.leftAdornment}),s.jsx("span",{className:"font-medium truncate",children:w.title})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[w.actions,s.jsx(mn,{className:["h-4 w-4 transition-transform",y?"rotate-180":"",w.disabled?"opacity-40":""].join(" ")})]})]}),y&&s.jsx("div",{className:[o?"py-1":"py-2"].join(" "),children:w.content})]},w.id)})})}const kl=e=>{let t;const r=new Set,n=(u,f)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const h=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(g=>g(t,h))}},o=()=>t,c={setState:n,getState:o,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u))},d=t=e(n,o,c);return c},OM=(e=>e?kl(e):kl),NM=e=>e;function FM(e,t=NM){const r=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(r),r}const Rl=e=>{const t=OM(e),r=n=>FM(t,n);return Object.assign(r,t),r},IM=(e=>e?Rl(e):Rl);var t5=Symbol.for("immer-nothing"),jl=Symbol.for("immer-draftable"),kt=Symbol.for("immer-state"),ZM=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function pt(e,...t){if(process.env.NODE_ENV!=="production"){const r=ZM[e],n=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sn=Object.getPrototypeOf;function Lr(e){return!!e&&!!e[kt]}function dr(e){var t;return e?r5(e)||Array.isArray(e)||!!e[jl]||!!((t=e.constructor)!=null&&t[jl])||xn(e)||Ma(e):!1}var BM=Object.prototype.constructor.toString(),Cl=new WeakMap;function r5(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Cl.get(r);return n===void 0&&(n=Function.toString.call(r),Cl.set(r,n)),n===BM}function ca(e,t,r=!0){Ca(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Ca(e){const t=e[kt];return t?t.type_:Array.isArray(e)?1:xn(e)?2:Ma(e)?3:0}function Co(e,t){return Ca(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function n5(e,t,r){const n=Ca(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function VM(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xn(e){return e instanceof Map}function Ma(e){return e instanceof Set}function ar(e){return e.copy_||e.base_}function Mo(e,t){if(xn(e))return new Map(e);if(Ma(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=r5(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[kt];let o=Reflect.ownKeys(n);for(let l=0;l<o.length;l++){const i=o[l],c=n[i];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(n[i]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[i]})}return Object.create(sn(e),n)}else{const n=sn(e);if(n!==null&&r)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function ws(e,t=!1){return Aa(e)||Lr(e)||!dr(e)||(Ca(e)>1&&Object.defineProperties(e,{set:Vn,add:Vn,clear:Vn,delete:Vn}),Object.freeze(e),t&&Object.values(e).forEach(r=>ws(r,!0))),e}function TM(){pt(2)}var Vn={value:TM};function Aa(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var DM={};function ur(e){const t=DM[e];return t||pt(0,e),t}var ln;function a5(){return ln}function HM(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ml(e,t){t&&(ur("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ao(e){So(e),e.drafts_.forEach(_M),e.drafts_=null}function So(e){e===ln&&(ln=e.parent_)}function Al(e){return ln=HM(ln,e)}function _M(e){const t=e[kt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Sl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[kt].modified_&&(Ao(t),pt(4)),dr(e)&&(e=da(t,e),t.parent_||ua(t,e)),t.patches_&&ur("Patches").generateReplacementPatches_(r[kt].base_,e,t.patches_,t.inversePatches_)):e=da(t,r,[]),Ao(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==t5?e:void 0}function da(e,t,r){if(Aa(t))return t;const n=e.immer_.shouldUseStrictIteration(),o=t[kt];if(!o)return ca(t,(l,i)=>$l(e,o,t,l,i,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return ua(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const l=o.copy_;let i=l,c=!1;o.type_===3&&(i=new Set(l),l.clear(),c=!0),ca(i,(d,u)=>$l(e,o,l,d,u,r,c),n),ua(e,l,!1),r&&e.patches_&&ur("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function $l(e,t,r,n,o,l,i){if(o==null||typeof o!="object"&&!i)return;const c=Aa(o);if(!(c&&!i)){if(process.env.NODE_ENV!=="production"&&o===r&&pt(5),Lr(o)){const d=l&&t&&t.type_!==3&&!Co(t.assigned_,n)?l.concat(n):void 0,u=da(e,o,d);if(n5(r,n,u),Lr(u))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(dr(o)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&c)return;da(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(xn(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&ua(e,o)}}}function ua(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ws(t,r)}function PM(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:a5(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,l=gs;r&&(o=[n],l=cn);const{revoke:i,proxy:c}=Proxy.revocable(o,l);return n.draft_=c,n.revoke_=i,c}var gs={get(e,t){if(t===kt)return e;const r=ar(e);if(!Co(r,t))return WM(e,r,t);const n=r[t];return e.finalized_||!dr(n)?n:n===Ga(e.base_,t)?(Ka(e),e.copy_[t]=Lo(n,e)):n},has(e,t){return t in ar(e)},ownKeys(e){return Reflect.ownKeys(ar(e))},set(e,t,r){const n=o5(ar(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const o=Ga(ar(e),t),l=o==null?void 0:o[kt];if(l&&l.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(VM(r,o)&&(r!==void 0||Co(e.base_,t)))return!0;Ka(e),$o(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ga(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ka(e),$o(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ar(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){pt(11)},getPrototypeOf(e){return sn(e.base_)},setPrototypeOf(){pt(12)}},cn={};ca(gs,(e,t)=>{cn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});cn.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&pt(13),cn.set.call(this,e,t,void 0)};cn.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&pt(14),gs.set.call(this,e[0],t,r,e[0])};function Ga(e,t){const r=e[kt];return(r?ar(r):e)[t]}function WM(e,t,r){var o;const n=o5(t,r);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function o5(e,t){if(!(t in e))return;let r=sn(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=sn(r)}}function $o(e){e.modified_||(e.modified_=!0,e.parent_&&$o(e.parent_))}function Ka(e){e.copy_||(e.copy_=Mo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zM=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const l=r;r=t;const i=this;return function(d=l,...u){return i.produce(d,f=>r.call(this,f,...u))}}typeof r!="function"&&pt(6),n!==void 0&&typeof n!="function"&&pt(7);let o;if(dr(t)){const l=Al(this),i=Lo(t,void 0);let c=!0;try{o=r(i),c=!1}finally{c?Ao(l):So(l)}return Ml(l,n),Sl(o,l)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===t5&&(o=void 0),this.autoFreeze_&&ws(o,!0),n){const l=[],i=[];ur("Patches").generateReplacementPatches_(t,o,l,i),n(l,i)}return o}else pt(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...c)=>this.produceWithPatches(i,d=>t(d,...c));let n,o;return[this.produce(t,r,(i,c)=>{n=i,o=c}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){dr(e)||pt(8),Lr(e)&&(e=qM(e));const t=Al(this),r=Lo(e,void 0);return r[kt].isManual_=!0,So(t),r}finishDraft(e,t){const r=e&&e[kt];(!r||!r.isManual_)&&pt(9);const{scope_:n}=r;return Ml(n,t),Sl(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));const n=ur("Patches").applyPatches_;return Lr(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Lo(e,t){const r=xn(e)?ur("MapSet").proxyMap_(e,t):Ma(e)?ur("MapSet").proxySet_(e,t):PM(e,t);return(t?t.scope_:a5()).drafts_.push(r),r}function qM(e){return Lr(e)||pt(10,e),s5(e)}function s5(e){if(!dr(e)||Aa(e))return e;const t=e[kt];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Mo(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Mo(e,!0);return ca(r,(o,l)=>{n5(r,o,s5(l))},n),t&&(t.finalized_=!1),r}var UM=new zM,GM=UM.produce;const Ya=e=>Number(e.toFixed(2)),Mr=e=>Math.max(0,Math.min(100,e??0)),KM={text:{name:"text",label:"Texto"},number:{name:"number",label:"Número"},email:{name:"email",label:"Email"},select:{name:"select",label:"Select"},checkbox:{name:"checkbox",label:"Checkbox"},date:{name:"date",label:"Fecha"},textarea:{name:"textarea",label:"Textarea"},file:{name:"file",label:"Archivo"},search:{name:"search",label:"Búsqueda"}},Pe=e=>e.layout.find(t=>t.type==="rows"),Mt=(e,t)=>{if(t==null)return Pe(e);const r=e.layout[t];return r&&r.type==="rows"?r:Pe(e)},Ja=e=>e<=1?["w-full"]:e===2?["w-1/2","w-1/2"]:e===3?["w-1/3","w-1/3","w-1/3"]:Array.from({length:e},()=>"flex-1"),Xa={1:["w-full"],2:["w-1/2","w-1/2"],3:["w-1/3","w-1/3","w-1/3"],4:["w-1/4","w-1/4","w-1/4","w-1/4"],"1/3-2/3":["w-1/3","w-2/3"],"2/3-1/3":["w-2/3","w-1/3"],"1/4-3/4":["w-1/4","w-3/4"],"3/4-1/4":["w-3/4","w-1/4"]},qe=(e,t)=>{for(let r=0;r<e.layout.length;r++){const n=e.layout[r];if((n==null?void 0:n.type)!=="tabs")continue;const o=n.tabs.findIndex(l=>l.key===t);if(o>=0)return{nodeIdx:r,tabIdx:o}}return null},YM=e=>{const t=[];return e.layout.forEach(r=>{r.type==="rows"&&r.sections.forEach(n=>n.rows.forEach(o=>o.columns.forEach(l=>(l.fields??[]).forEach(i=>t.push(i))))),r.type==="tabs"&&r.tabs.forEach(n=>n.sections.forEach(o=>o.rows.forEach(l=>l.columns.forEach(i=>(i.fields??[]).forEach(c=>t.push(c))))))}),t},JM=e=>({type:"rows",sections:[{sectionTitle:e??"Sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}),Ll=(e,t)=>Math.max(0,Math.min(e,t)),Qa=e=>!!e&&e.type==="inputGroup",Jn=(e,t)=>e.findIndex(r=>(r==null?void 0:r.name)===t),eo=(e,t)=>e[Jn(e,t)],XM=()=>({type:"tabs",tabs:[{key:`tab_${Date.now().toString(36)}_1`,label:"Pestaña 1",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]},{key:`tab_${Date.now().toString(36)}_2`,label:"Pestaña 2",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}]}),yr=(e,t)=>YM(e).includes(t),Oo=e=>e.replace(/(?:_copy)+$/i,"").replace(/_(\d+)$/i,""),l5=e=>e.replace(/\s\((\d+)\)$/i,""),ut=(e,t)=>{const r=e||"campo";if(!t.has(r))return r;let n=2;for(;t.has(`${r}_${n}`);)n++;return`${r}_${n}`},gt=(e,t)=>{const r=e||"Campo";if(!t.has(r))return r;let n=2;for(;t.has(`${r} (${n})`);)n++;return`${r} (${n})`},ft=e=>{const t=(e.type??"text").toString(),r=KM[t]??{name:"campo",label:"Campo"},n=e.name?Oo(e.name):r.name,o=e.label?l5(e.label):r.label;return{baseName:n,baseLabel:o}},QM={layout:[{type:"rows",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}],fields:[],onSubmit:async()=>{},successMessage:"Guardado",errorMessage:"Error"},K=IM((e,t)=>({schema:QM,selection:{kind:"none"},past:[],future:[],fieldPick:{armed:!1},previewMode:!1,fieldDom:{},fieldAnchors:{},showRelations:!1,relationsEnabled:!1,setPreviewMode:r=>e({previewMode:!!r}),togglePreview:()=>e(r=>{const n=!r.previewMode;return{previewMode:n,...n?{showRelations:!1,relationsEnabled:!1}:{}}}),toggleRelations:r=>e(n=>{const o=r!==void 0?r:!n.relationsEnabled;return{relationsEnabled:o,showRelations:o}}),registerFieldEl:(r,n)=>e(o=>({fieldDom:{...o.fieldDom,[r]:n}})),registerFieldAnchor:(r,n)=>e(o=>{const l=o.fieldAnchors[r];return l&&l.x===n.x&&l.y===n.y&&l.w===n.w&&l.h===n.h?o:{fieldAnchors:{...o.fieldAnchors,[r]:n}}}),unregisterFieldAnchor:r=>e(n=>{const o={...n.fieldAnchors};return delete o[r],{fieldAnchors:o}}),setSchema:r=>{const n=t().schema,o=typeof r=="function"?GM(n,r):r;e(l=>({...l,schema:o,past:[...l.past,n].slice(-50),future:[]}))},setSelection:r=>e({selection:r}),undo:()=>e(r=>r.past.length?{schema:r.past[r.past.length-1],past:r.past.slice(0,-1),future:[r.schema,...r.future]}:r),redo:()=>e(r=>r.future.length?{schema:r.future[0],past:[...r.past,r.schema],future:r.future.slice(1)}:r),resetHistory:()=>e(r=>({past:[],future:[]})),addField:r=>t().setSchema(n=>{const{baseName:o,baseLabel:l}=ft(r),i=new Set(n.fields.map(f=>f.name).filter(Boolean)),c=new Set(n.fields.map(f=>f.label??"").filter(Boolean)),d=ut(o,i),u=gt(l,c);r.name=d,r.label||(r.label=u),n.fields.push(r)}),addFieldAt:(r,n)=>t().setSchema(o=>{const{baseName:l,baseLabel:i}=ft(r),c=new Set(o.fields.map(h=>h.name).filter(Boolean)),d=new Set(o.fields.map(h=>h.label??"").filter(Boolean)),u=ut(l,c),f=gt(i,d);r.name=u,r.label||(r.label=f);const m=Math.max(0,Math.min(n??o.fields.length,o.fields.length));o.fields.splice(m,0,r)}),removeField:r=>t().setSchema(n=>{n.fields=n.fields.filter(o=>o.name!==r),n.layout.forEach(o=>{o.type==="rows"&&o.sections.forEach(l=>l.rows.forEach(i=>i.columns.forEach(c=>{c.fields=(c.fields??[]).filter(d=>d!==r)}))),o.type==="tabs"&&o.tabs.forEach(l=>l.sections.forEach(i=>i.rows.forEach(c=>c.columns.forEach(d=>{d.fields=(d.fields??[]).filter(u=>u!==r)}))))})}),updateField:(r,n)=>t().setSchema(o=>{const l=o.fields.findIndex(i=>i.name===r);l>=0&&n(o.fields[l])}),duplicateField:(r,n)=>t().setSchema(o=>{const l=o.fields.findIndex(w=>w.name===r);if(l<0)return;const i=o.fields[l],c=Oo((n==null?void 0:n.trim())||i.name||""),d=l5(i.label??""),u=new Set(o.fields.map(w=>w.name).filter(Boolean)),f=new Set(o.fields.map(w=>w.label??"").filter(Boolean)),m=ut(c||ft(i).baseName,u),h=gt(d||ft(i).baseLabel,f),g=JSON.parse(JSON.stringify(i));g.name=m,g.label=h,o.fields.splice(l+1,0,g)}),renameField:(r,n)=>t().setSchema(o=>{const l=o.fields.findIndex(u=>u.name===r);if(l<0)return;const i=Oo((n??r).trim()||"campo"),c=new Set(o.fields.map(u=>u.name).filter(Boolean));c.delete(r);const d=ut(i,c);o.fields[l].name=d,o.layout.forEach(u=>{u.type==="rows"&&u.sections.forEach(f=>f.rows.forEach(m=>m.columns.forEach(h=>{h.fields&&(h.fields=h.fields.map(g=>g===r?d:g))}))),u.type==="tabs"&&u.tabs.forEach(f=>f.sections.forEach(m=>m.rows.forEach(h=>h.columns.forEach(g=>{g.fields&&(g.fields=g.fields.map(w=>w===r?d:w))}))))})}),addSection:r=>t().setSchema(n=>{const o=Pe(n);if(!o)return;const l={sectionTitle:r??"Nueva sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]};o.sections.push(l)}),renameSection:(r,n)=>t().setSchema(o=>{const l=Pe(o);if(!l)return;const i=l.sections[r];i&&(i.sectionTitle=(n??"").trim()||"Sección")}),moveSection:(r,n,o)=>e(l=>{const i=[...l.schema.layout],c=i[r];if(!c||c.type!=="rows")return l;const d=[...c.sections],[u]=d.splice(n,1),f=Math.max(0,Math.min(o,d.length));return d.splice(f,0,u),i[r]={...c,sections:d},{schema:{...l.schema,layout:i}}}),removeSection:r=>t().setSchema(n=>{const o=Pe(n);if(!o||r<0||r>=o.sections.length)return;const l=[...o.sections];l.splice(r,1),o.sections=l}),duplicateSection:r=>t().setSchema(n=>{const o=Pe(n);if(!o)return;const l=o.sections[r];if(!l)return;const i=JSON.parse(JSON.stringify(l)),c=(l.sectionTitle||"Sección").toString(),d=o.sections.map(m=>m.sectionTitle||""),u=new Set(d);let f=c;if(u.has(f)){let m=2;for(;u.has(`${c} (${m})`);)m++;f=`${c} (${m})`}i.sectionTitle=f,o.sections.splice(r+1,0,i)}),addRowsBlockAt:(r,n)=>t().setSchema(o=>{const l=Math.max(0,Math.min(r,o.layout.length));o.layout.splice(l,0,JM(n))}),addTabsContainerAt:r=>t().setSchema(n=>{const o=Math.max(0,Math.min(r,n.layout.length));n.layout.splice(o,0,XM())}),moveLayoutNode:(r,n)=>t().setSchema(o=>{const l=o.layout.length;if(r<0||r>=l)return;const i=Math.max(0,Math.min(n,l-1));if(r===i)return;const c=[...o.layout],[d]=c.splice(r,1);c.splice(i,0,d),o.layout=c}),removeLayoutNode:r=>t().setSchema(n=>{if(r<0||r>=n.layout.length)return;const o=[...n.layout];o.splice(r,1),n.layout=o}),addTabsContainer:()=>t().setSchema(r=>{const n={type:"tabs",tabs:[{key:"tab1",label:"Pestaña 1",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]},{key:"tab2",label:"Pestaña 2",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}]};r.layout.push(n)}),addTabAfter:r=>t().setSchema(n=>{const o=qe(n,r);if(!o)return;const l=n.layout[o.nodeIdx],i="Nueva pestaña",c=new Set(l.tabs.map(m=>m.label));let d=i,u=2;for(;c.has(d);)d=`${i} (${u++})`;const f={key:`tab_${Date.now().toString(36)}`,label:d,sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]};l.tabs.splice(o.tabIdx+1,0,f)}),removeTab:r=>t().setSchema(n=>{const o=qe(n,r);if(!o)return;const l=n.layout[o.nodeIdx];l.tabs.length<=1||l.tabs.splice(o.tabIdx,1)}),renameTab:(r,n)=>t().setSchema(o=>{const l=qe(o,r);if(!l)return;const i=o.layout[l.nodeIdx];i.tabs[l.tabIdx].label=(n??"").trim()||"Pestaña"}),moveTab:(r,n,o)=>e(l=>{const i=[...l.schema.layout],c=i[r];if(!c||c.type!=="tabs")return l;const d=[...c.tabs],[u]=d.splice(n,1),f=Math.max(0,Math.min(o,d.length));return d.splice(f,0,u),i[r]={...c,tabs:d},{schema:{...l.schema,layout:i}}}),moveTabSection:(r,n,o,l)=>e(i=>{const c=[...i.schema.layout],d=c[r];if(!d||d.type!=="tabs")return i;const u=d.tabs.find(w=>w.key===n);if(!u)return i;const f=[...u.sections],[m]=f.splice(o,1),h=Math.max(0,Math.min(l,f.length));f.splice(h,0,m);const g=d.tabs.map(w=>w.key===n?{...w,sections:f}:w);return c[r]={...d,tabs:g},{schema:{...i.schema,layout:c}}}),addSectionToTab:(r,n)=>t().setSchema(o=>{const l=qe(o,r);if(!l)return;o.layout[l.nodeIdx].tabs[l.tabIdx].sections.push({sectionTitle:n??"Nueva sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]})}),addRowToTabSection:(r,n)=>t().setSchema(o=>{var c;const l=qe(o,r);if(!l)return;(c=o.layout[l.nodeIdx].tabs[l.tabIdx].sections[n])==null||c.rows.push({title:"",columns:[{width:"w-full",fields:[]}]})}),renameTabSection:(r,n,o)=>t().setSchema(l=>{const i=qe(l,r);if(!i)return;const d=l.layout[i.nodeIdx].tabs[i.tabIdx].sections[n];d&&(d.sectionTitle=(o??"").trim()||"Sección")}),setTabRowColumns:(r,n,o,l)=>t().setSchema(i=>{var g,w;const c=qe(i,r);if(!c)return;const u=(w=(g=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[n])==null?void 0:g.rows)==null?void 0:w[o];if(!u)return;const f=(u.columns??[]).flatMap(y=>y.fields??[]),m=Ja(l),h=Array.from({length:l},(y,x)=>({width:m[x],fields:[]}));f.forEach((y,x)=>h[x%l].fields.push(y)),u.columns=h}),addColumnToTabRow:(r,n,o)=>t().setSchema(l=>{var u,f;const i=qe(l,r);if(!i)return;const d=(f=(u=l.layout[i.nodeIdx].tabs[i.tabIdx].sections[n])==null?void 0:u.rows)==null?void 0:f[o];d&&d.columns.push({width:"w-1/2",fields:[]})}),removeTabColumn:(r,n,o,l)=>t().setSchema(i=>{var w,y;const c=qe(i,r);if(!c)return;const u=(y=(w=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[n])==null?void 0:w.rows)==null?void 0:y[o];if(!u)return;const f=u.columns??[];if(!f[l])return;const m=f[l],h=l>0?l-1:f[l+1]?l+1:-1,g=[...f];g.splice(l,1),h>=0&&g[h]&&(g[h].fields=[...g[h].fields??[],...m.fields??[]]),u.columns=g}),placeFieldInTabColumn:(r,n,o,l,i)=>t().setSchema(c=>{const d=qe(c,n);if(!d)return;const f=c.layout[d.nodeIdx].tabs[d.tabIdx].sections[o].rows[l].columns[i];let m=r;if(yr(c,r)){const h=c.fields.findIndex(g=>g.name===r);if(h>=0){const g=c.fields[h],{baseName:w,baseLabel:y}=ft(g),x=new Set(c.fields.map(R=>R.name).filter(Boolean)),b=new Set(c.fields.map(R=>R.label??"").filter(Boolean));m=ut(w,x);const p=gt(y,b),E=JSON.parse(JSON.stringify(g));E.name=m,E.label=p,c.fields.splice(h+1,0,E)}}f.fields=[...f.fields??[],m]}),moveFieldInTab:(r,n)=>t().setSchema(o=>{var g,w,y,x;const l=qe(o,r.tabKey);if(!l)return;const i=o.layout[l.nodeIdx],c=(w=(g=i.tabs[l.tabIdx].sections[r.s])==null?void 0:g.rows[r.r])==null?void 0:w.columns[r.c],d=(x=(y=i.tabs[l.tabIdx].sections[n.s])==null?void 0:y.rows[n.r])==null?void 0:x.columns[n.c];if(!c||!d)return;const u=[...c.fields??[]];if(r.idx<0||r.idx>=u.length)return;const[f]=u.splice(r.idx,1);c.fields=u;const m=[...d.fields??[]],h=n.idx===void 0?m.length:Math.max(0,Math.min(n.idx,m.length));m.splice(h,0,f),d.fields=m}),removeFieldFromTabLayout:r=>t().setSchema(n=>{var d,u;const o=qe(n,r.tabKey);if(!o)return;const i=(u=(d=n.layout[o.nodeIdx].tabs[o.tabIdx].sections[r.s])==null?void 0:d.rows[r.r])==null?void 0:u.columns[r.c];if(!i||!i.fields||r.idx<0||r.idx>=i.fields.length)return;const c=[...i.fields];c.splice(r.idx,1),i.fields=c}),moveRowInSection:(r,n,o)=>t().setSchema(l=>{const i=Pe(l);if(!i)return;const c=i.sections[r];if(!c)return;const d=[...c.rows];if(n<0||n>=d.length)return;const u=Math.max(0,Math.min(o,d.length-1));if(n===u)return;const[f]=d.splice(n,1);d.splice(u,0,f),c.rows=d}),duplicateRowInSection:(r,n)=>t().setSchema(o=>{const l=Pe(o);if(!l)return;const i=l.sections[r];if(!i)return;const c=i.rows[n];if(!c)return;const d=JSON.parse(JSON.stringify(c));i.rows.splice(n+1,0,d)}),removeRowFromSection:(r,n)=>t().setSchema(o=>{const l=Pe(o);if(!l)return;const i=l.sections[r];if(!i)return;const c=[...i.rows];n<0||n>=c.length||(c.splice(n,1),c.length===0&&c.push({title:"",columns:[{width:"w-full",fields:[]}]}),i.rows=c)}),setRowColumnsPreset:(r,n,o)=>t().setSchema(l=>{var u,f;const i=Pe(l);if(!i)return;const c=(f=(u=i.sections[r])==null?void 0:u.rows)==null?void 0:f[n];if(!c)return;const d=Xa[o];d&&to(c,d)}),setRowResponsive:(r,n,o)=>t().setSchema(l=>{var g,w;const i=Pe(l);if(!i)return;const c=(w=(g=i.sections[Number(r)])==null?void 0:g.rows)==null?void 0:w[Number(n)];if(!c)return;const d=Math.max(o.desktop.count??1,o.tablet.count??1,o.mobile.count??1),u=(c.columns??[]).flatMap(y=>y.fields??[]),f=no(u,d),m=(y,x,b)=>x<(b??0)?Mr((y==null?void 0:y[x])??0):null,h=Array.from({length:d},(y,x)=>{const b=m(o.mobile.widths,x,o.mobile.count),p=m(o.tablet.widths,x,o.tablet.count),E=m(o.desktop.widths,x,o.desktop.count);return{width:ro(b,p,E),fields:f[x]??[]}});c.columns=h}),setRowColumnsAt:(r,n,o,l)=>t().setSchema(i=>{var h,g;const c=Mt(i,r);if(!c)return;const d=(g=(h=c.sections[n])==null?void 0:h.rows)==null?void 0:g[o];if(!d)return;const u=(d.columns??[]).flatMap(w=>w.fields??[]),f=Ja(l),m=Array.from({length:l},(w,y)=>({width:f[y],fields:[]}));u.forEach((w,y)=>m[y%l].fields.push(w)),d.columns=m}),addColumnToRowAt:(r,n,o)=>t().setSchema(l=>{var c,d,u,f;const i=Mt(l,r);i&&((f=(u=(d=(c=i.sections[n])==null?void 0:c.rows)==null?void 0:d[o])==null?void 0:u.columns)==null||f.push({width:"w-1/2",fields:[]}))}),removeColumnAt:(r,n,o,l)=>t().setSchema(i=>{var g,w;const c=Mt(i,r);if(!c)return;const d=(w=(g=c.sections[n])==null?void 0:g.rows)==null?void 0:w[o];if(!d)return;const u=d.columns??[];if(!u[l])return;const f=u[l],m=l>0?l-1:u[l+1]?l+1:-1,h=[...u];h.splice(l,1),m>=0&&h[m]&&(h[m].fields=[...h[m].fields??[],...f.fields??[]]),d.columns=h}),setRowColumnsPresetAt:(r,n,o,l)=>t().setSchema(i=>{var f,m;const c=Mt(i,r);if(!c)return;const d=(m=(f=c.sections[n])==null?void 0:f.rows)==null?void 0:m[o];if(!d)return;const u=Xa[l];u&&to(d,u)}),setRowResponsiveAt:(r,n,o,l)=>t().setSchema(i=>{var w,y;const c=Mt(i,r);if(!c)return;const d=(y=(w=c.sections[Number(n)])==null?void 0:w.rows)==null?void 0:y[Number(o)];if(!d)return;const u=Math.max(l.desktop.count??1,l.tablet.count??1,l.mobile.count??1),f=(x,b,p)=>b<(p??0)?Mr((x==null?void 0:x[b])??0):null,m=eA(d,u),h=m.flatMap(x=>x.fields??[]),g=no(h,u);for(let x=0;x<u;x++){const b=f(l.mobile.widths,x,l.mobile.count),p=f(l.tablet.widths,x,l.tablet.count),E=f(l.desktop.widths,x,l.desktop.count);m[x].width=ro(b,p,E),m[x].fields=g[x]??[]}}),placeFieldInColumnAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var w,y,x,b;const u=Mt(d,r);if(!u)return;const f=(b=(x=(y=(w=u.sections[o])==null?void 0:w.rows)==null?void 0:y[l])==null?void 0:x.columns)==null?void 0:b[i];if(!f)return;let m=n;if(yr(d,n)){const p=d.fields.findIndex(E=>E.name===n);if(p>=0){const E=d.fields[p],{baseName:R,baseLabel:j}=ft(E),A=new Set(d.fields.map(S=>S.name).filter(Boolean)),L=new Set(d.fields.map(S=>S.label??"").filter(Boolean));m=ut(R,A);const F=gt(j,L),V=JSON.parse(JSON.stringify(E));V.name=m,V.label=F,d.fields.splice(p+1,0,V)}}const h=[...f.fields??[]],g=c===void 0?h.length:Math.max(0,Math.min(c,h.length));h.splice(g,0,m),f.fields=h}),moveFieldAt:(r,n,o,l)=>t().setSchema(i=>{var y,x,b,p,E,R,j,A;const c=Mt(i,r),d=Mt(i,o);if(!c||!d)return;const u=(p=(b=(x=(y=c.sections[n.s])==null?void 0:y.rows)==null?void 0:x[n.r])==null?void 0:b.columns)==null?void 0:p[n.c],f=(A=(j=(R=(E=d.sections[l.s])==null?void 0:E.rows)==null?void 0:R[l.r])==null?void 0:j.columns)==null?void 0:A[l.c];if(!u||!f)return;const m=[...u.fields??[]];if(n.idx<0||n.idx>=m.length)return;const[h]=m.splice(n.idx,1);u.fields=m;const g=[...f.fields??[]],w=l.idx===void 0?g.length:Math.max(0,Math.min(l.idx,g.length));g.splice(w,0,h),f.fields=g}),removeFieldFromLayoutAt:(r,n)=>t().setSchema(o=>{var d,u,f,m;const l=Mt(o,r);if(!l)return;const i=(m=(f=(u=(d=l.sections[n.s])==null?void 0:d.rows)==null?void 0:u[n.r])==null?void 0:f.columns)==null?void 0:m[n.c];if(!i||!i.fields||n.idx<0||n.idx>=i.fields.length)return;const c=[...i.fields];c.splice(n.idx,1),i.fields=c}),insertExistingFieldAtAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var w,y,x,b;const u=Mt(d,r);if(!u)return;const f=(b=(x=(y=(w=u.sections[o])==null?void 0:w.rows)==null?void 0:y[l])==null?void 0:x.columns)==null?void 0:b[i];if(!f)return;let m=n;if(yr(d,n)){const p=d.fields.findIndex(E=>E.name===n);if(p>=0){const E=d.fields[p],{baseName:R,baseLabel:j}=ft(E),A=new Set(d.fields.map(H=>H.name).filter(Boolean)),L=new Set(d.fields.map(H=>H.label??"").filter(Boolean)),F=ut(R,A),V=gt(j,L),S=JSON.parse(JSON.stringify(E));S.name=F,S.label=V,d.fields.splice(p+1,0,S),m=F}}const h=[...f.fields??[]],g=Math.max(0,Math.min(c,h.length));h.splice(g,0,m),f.fields=h}),addFieldAndPlaceAtAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var R,j,A,L;const{baseName:u,baseLabel:f}=ft(n),m=new Set(d.fields.map(F=>F.name).filter(Boolean)),h=new Set(d.fields.map(F=>F.label??"").filter(Boolean)),g=ut(u,m),w=gt(f,h),y=JSON.parse(JSON.stringify(n));y.name=g,y.label||(y.label=w),d.fields.push(y);const x=Mt(d,r);if(!x)return;const b=(L=(A=(j=(R=x.sections[o])==null?void 0:R.rows)==null?void 0:j[l])==null?void 0:A.columns)==null?void 0:L[i];if(!b)return;const p=[...b.fields??[]],E=Math.max(0,Math.min(c,p.length));p.splice(E,0,g),b.fields=p}),setTabRowResponsive:(r,n,o,l)=>t().setSchema(i=>{var y,x;const c=qe(i,r);if(!c)return;const u=(x=(y=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[Number(n)])==null?void 0:y.rows)==null?void 0:x[Number(o)];if(!u)return;const f=Math.max(l.desktop.count??1,l.tablet.count??1,l.mobile.count??1),m=(u.columns??[]).flatMap(b=>b.fields??[]),h=no(m,f),g=(b,p,E)=>p<(E??0)?Mr((b==null?void 0:b[p])??0):null,w=Array.from({length:f},(b,p)=>{const E=g(l.mobile.widths,p,l.mobile.count),R=g(l.tablet.widths,p,l.tablet.count),j=g(l.desktop.widths,p,l.desktop.count);return{width:ro(E,R,j),fields:h[p]??[]}});u.columns=w}),moveTabRow:(r,n,o,l)=>t().setSchema(i=>{const c=qe(i,r);if(!c)return;const u=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[n];if(!u)return;const f=[...u.rows];if(o<0||o>=f.length)return;const m=Math.max(0,Math.min(l,f.length-1));if(o===m)return;const[h]=f.splice(o,1);f.splice(m,0,h),u.rows=f}),duplicateTabRow:(r,n,o)=>t().setSchema(l=>{const i=qe(l,r);if(!i)return;const d=l.layout[i.nodeIdx].tabs[i.tabIdx].sections[n];if(!d)return;const u=d.rows[o];if(!u)return;const f=JSON.parse(JSON.stringify(u));d.rows.splice(o+1,0,f)}),removeTabRow:(r,n,o)=>t().setSchema(l=>{const i=qe(l,r);if(!i)return;const d=l.layout[i.nodeIdx].tabs[i.tabIdx].sections[n];if(!d)return;const u=[...d.rows];o<0||o>=u.length||(u.splice(o,1),u.length===0&&u.push({title:"",columns:[{width:"w-full",fields:[]}]}),d.rows=u)}),setTabRowColumnsPreset:(r,n,o,l)=>t().setSchema(i=>{var m,h;const c=qe(i,r);if(!c)return;const u=(h=(m=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[n])==null?void 0:m.rows)==null?void 0:h[o];if(!u)return;const f=Xa[l];f&&to(u,f)}),addRowToSection:r=>t().setSchema(n=>{const o=Pe(n);o&&o.sections[r].rows.push({title:"",columns:[{width:"w-full",fields:[]}]})}),addRowToSectionAt:(r,n)=>t().setSchema(o=>{const l=Pe(o);if(!l)return;const i=l.sections[r];if(!i)return;const c=[...i.rows??[]],d=Math.max(0,Math.min(n,c.length));c.splice(d,0,{title:"",columns:[{width:"w-full",fields:[]}]}),i.rows=c}),addColumnToRow:(r,n)=>t().setSchema(o=>{const l=Pe(o);l&&l.sections[r].rows[n].columns.push({width:"w-1/2",fields:[]})}),setRowColumns:(r,n,o)=>t().setSchema(l=>{const i=Pe(l);if(!i)return;const c=i.sections[r].rows[n],d=(c.columns??[]).flatMap(m=>m.fields??[]),u=Ja(o),f=Array.from({length:o},(m,h)=>({width:u[h],fields:[]}));d.forEach((m,h)=>f[h%o].fields.push(m)),c.columns=f}),removeColumn:(r,n,o)=>t().setSchema(l=>{const i=Pe(l);if(!i)return;const c=i.sections[r].rows[n],d=c.columns??[];if(!d[o])return;const u=d[o],f=o>0?o-1:d[o+1]?o+1:-1,m=[...d];m.splice(o,1),f>=0&&m[f]&&(m[f].fields=[...m[f].fields??[],...u.fields??[]]),c.columns=m}),placeFieldInColumn:(r,n,o,l)=>t().setSchema(i=>{const c=Pe(i);if(!c)return;const d=c.sections[n].rows[o].columns[l];let u=r;if(yr(i,r)){const f=i.fields.findIndex(m=>m.name===r);if(f>=0){const m=i.fields[f],{baseName:h,baseLabel:g}=ft(m),w=new Set(i.fields.map(E=>E.name).filter(Boolean)),y=new Set(i.fields.map(E=>E.label??"").filter(Boolean)),x=ut(h,w),b=gt(g,y),p=JSON.parse(JSON.stringify(m));p.name=x,p.label=b,i.fields.splice(f+1,0,p),u=x}}d.fields=[...d.fields??[],u]}),moveField:(r,n)=>t().setSchema(o=>{var h,g,w,y;const l=Pe(o);if(!l)return;const i=(g=(h=l.sections[r.s])==null?void 0:h.rows[r.r])==null?void 0:g.columns[r.c],c=(y=(w=l.sections[n.s])==null?void 0:w.rows[n.r])==null?void 0:y.columns[n.c];if(!i||!c)return;const d=[...i.fields??[]];if(r.idx<0||r.idx>=d.length)return;const[u]=d.splice(r.idx,1);i.fields=d;const f=[...c.fields??[]],m=n.idx===void 0?f.length:Math.max(0,Math.min(n.idx,f.length));f.splice(m,0,u),c.fields=f}),removeFieldFromLayout:r=>t().setSchema(n=>{var c,d;const o=Pe(n);if(!o)return;const l=(d=(c=o.sections[r.s])==null?void 0:c.rows[r.r])==null?void 0:d.columns[r.c];if(!l||!l.fields||r.idx<0||r.idx>=l.fields.length)return;const i=[...l.fields];i.splice(r.idx,1),l.fields=i}),addFieldAndPlace:(r,n,o,l)=>t().setSchema(i=>{const{baseName:c,baseLabel:d}=ft(r),u=new Set(i.fields.map(x=>x.name).filter(Boolean)),f=new Set(i.fields.map(x=>x.label??"").filter(Boolean)),m=ut(c,u),h=gt(d,f),g=JSON.parse(JSON.stringify(r));g.name=m,g.label||(g.label=h),i.fields.push(g);const w=Pe(i);if(!w)return;const y=w.sections[n].rows[o].columns[l];y.fields=[...y.fields??[],m]}),moveFieldWithinColumn:(r,n,o,l,i)=>t().setSchema(c=>{var g,w,y,x;const d=Pe(c);if(!d)return;const u=(x=(y=(w=(g=d.sections[r])==null?void 0:g.rows)==null?void 0:w[n])==null?void 0:y.columns)==null?void 0:x[o];if(!u)return;const f=[...u.fields??[]];if(l<0||l>=f.length)return;const[m]=f.splice(l,1),h=Math.max(0,Math.min(i,f.length));f.splice(h,0,m),u.fields=f}),insertExistingFieldAt:(r,n,o,l,i)=>t().setSchema(c=>{var g,w,y,x;const d=Pe(c);if(!d)return;const u=(x=(y=(w=(g=d.sections[n])==null?void 0:g.rows)==null?void 0:w[o])==null?void 0:y.columns)==null?void 0:x[l];if(!u)return;let f=r;if(yr(c,r)){const b=c.fields.findIndex(p=>p.name===r);if(b>=0){const p=c.fields[b],{baseName:E,baseLabel:R}=ft(p),j=new Set(c.fields.map(S=>S.name).filter(Boolean)),A=new Set(c.fields.map(S=>S.label??"").filter(Boolean)),L=ut(E,j),F=gt(R,A),V=JSON.parse(JSON.stringify(p));V.name=L,V.label=F,c.fields.splice(b+1,0,V),f=L}}const m=[...u.fields??[]],h=Math.max(0,Math.min(i,m.length));m.splice(h,0,f),u.fields=m}),addFieldAndPlaceAt:(r,n,o,l,i)=>t().setSchema(c=>{var E,R,j,A;const{baseName:d,baseLabel:u}=ft(r),f=new Set(c.fields.map(L=>L.name).filter(Boolean)),m=new Set(c.fields.map(L=>L.label??"").filter(Boolean)),h=ut(d,f),g=gt(u,m),w=JSON.parse(JSON.stringify(r));w.name=h,w.label||(w.label=g),c.fields.push(w);const y=Pe(c);if(!y)return;const x=(A=(j=(R=(E=y.sections[n])==null?void 0:E.rows)==null?void 0:R[o])==null?void 0:j.columns)==null?void 0:A[l];if(!x)return;const b=[...x.fields??[]],p=Math.max(0,Math.min(i,b.length));b.splice(p,0,h),x.fields=b}),moveFieldWithinTab:(r,n,o,l,i,c)=>t().setSchema(d=>{var w,y,x,b;const u=qe(d,r);if(!u)return;const f=(b=(x=(y=(w=d.layout[u.nodeIdx].tabs[u.tabIdx].sections[n])==null?void 0:w.rows)==null?void 0:y[o])==null?void 0:x.columns)==null?void 0:b[l];if(!f)return;const m=[...f.fields??[]];if(i<0||i>=m.length)return;const[h]=m.splice(i,1),g=Math.max(0,Math.min(c,m.length));m.splice(g,0,h),f.fields=m}),insertExistingFieldInTabAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var w,y,x,b;const u=qe(d,n);if(!u)return;const f=(b=(x=(y=(w=d.layout[u.nodeIdx].tabs[u.tabIdx].sections[o])==null?void 0:w.rows)==null?void 0:y[l])==null?void 0:x.columns)==null?void 0:b[i];if(!f)return;let m=r;if(yr(d,r)){const p=d.fields.findIndex(E=>E.name===r);if(p>=0){const E=d.fields[p],{baseName:R,baseLabel:j}=ft(E),A=new Set(d.fields.map(H=>H.name).filter(Boolean)),L=new Set(d.fields.map(H=>H.label??"").filter(Boolean)),F=ut(R,A),V=gt(j,L),S=JSON.parse(JSON.stringify(E));S.name=F,S.label=V,d.fields.splice(p+1,0,S),m=F}}const h=[...f.fields??[]],g=Math.max(0,Math.min(c,h.length));h.splice(g,0,m),f.fields=h}),addFieldAndPlaceInTabAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var R,j,A,L;const u=qe(d,n);if(!u)return;const{baseName:f,baseLabel:m}=ft(r),h=new Set(d.fields.map(F=>F.name).filter(Boolean)),g=new Set(d.fields.map(F=>F.label??"").filter(Boolean)),w=ut(f,h),y=gt(m,g),x=JSON.parse(JSON.stringify(r));x.name=w,x.label||(x.label=y),d.fields.push(x);const b=(L=(A=(j=(R=d.layout[u.nodeIdx].tabs[u.tabIdx].sections[o])==null?void 0:R.rows)==null?void 0:j[l])==null?void 0:A.columns)==null?void 0:L[i];if(!b)return;const p=[...b.fields??[]],E=Math.max(0,Math.min(c,p.length));p.splice(E,0,w),b.fields=p}),changeFieldType:(r,n)=>t().setSchema(o=>{const l=o.fields.findIndex(u=>u.name===r);if(l<0)return;const i=o.fields[l],d={...{name:i.name,label:i.label,width:i.width,size:i.size,info:i.info,disabled:i.disabled,visibleWhen:i.visibleWhen,disabledWhen:i.disabledWhen,clearWhen:i.clearWhen,validation:i.validation,placeholder:i.placeholder},type:n};switch(n){case"text":case"email":case"password":case"number":break;case"textarea":d.maxLength=i.maxLength??void 0,d.showCounter=i.showCounter??!1;break;case"select":d.options=Array.isArray(i.options)?i.options:[],d.multiple=!!i.multiple,d.loadOptions=i.loadOptions??void 0;break;case"checkbox":d.defaultValue=!!i.defaultValue,delete d.placeholder;break;case"date":d.showTime=!!i.showTime;break;case"file":d.maxFiles=i.maxFiles??1,d.accept=i.accept??"",delete d.placeholder;break}n!=="select"&&(delete d.options,delete d.multiple,delete d.loadOptions),n!=="textarea"&&(delete d.maxLength,delete d.showCounter),n!=="checkbox"&&delete d.defaultValue,n!=="date"&&delete d.showTime,n!=="file"&&(delete d.maxFiles,delete d.accept),o.fields[l]=d}),moveSectionAcrossNodes:(r,n,o,l)=>t().setSchema(i=>{const c=i.layout[r],d=i.layout[o];if(!c||c.type!=="rows"||!d||d.type!=="rows")return;const u=[...c.sections??[]];if(n<0||n>=u.length)return;const[f]=u.splice(n,1);c.sections=u;const m=[...d.sections??[]],h=Math.max(0,Math.min(l??m.length,m.length));m.splice(h,0,f),d.sections=m}),armFieldPick:(r,n)=>e(o=>({...o,fieldPick:{armed:!0,forField:r,fieldKey:n}})),cancelFieldPick:()=>e(r=>({...r,fieldPick:{armed:!1}})),completeFieldPick:r=>{const{fieldPick:n}=t();if(!n.armed||!n.forField||!n.fieldKey){e(o=>({...o,fieldPick:{armed:!1}}));return}t().setSchema(o=>{const l=o.fields.findIndex(f=>f.name===n.forField);if(l<0)return;const i=o.fields[l],c=n.fieldKey,d=i[c]??{};let u=d.rule??{op:"eq",field:r,value:!0};u={...u,field:r},i[c]={...d??{},enabled:!0,rule:u}}),e(o=>({...o,fieldPick:{armed:!1}}))},placeFieldInInputGroup:(r,n,o)=>e(l=>{const i=l.schema,c=[...i.fields],d=eo(c,n);if(!Qa(d))return l;const u=Array.isArray(d.inputs)?[...d.inputs]:[];if(u.some(w=>typeof w=="string"?w===r:w.name===r))return l;const f=typeof o=="number"?Ll(o,u.length):u.length;u.splice(f,0,r);const m=Jn(c,n),h={...d,inputs:u},g=[...c];return g.splice(m,1,h),{schema:{...i,fields:g}}}),moveFieldWithinInputGroup:(r,n,o)=>e(l=>{const i=l.schema,c=[...i.fields],d=eo(c,r);if(!Qa(d)||!Array.isArray(d.inputs))return l;const u=[...d.inputs];if(n<0||n>=u.length)return l;const f=Ll(o,u.length),[m]=u.splice(n,1),h=f>n?f-1:f;u.splice(h,0,m);const g=Jn(c,r),w={...d,inputs:u},y=[...c];return y.splice(g,1,w),{schema:{...i,fields:y}}}),removeFieldFromInputGroup:(r,n)=>e(o=>{const l=o.schema,i=[...l.fields],c=eo(i,r);if(!Qa(c)||!Array.isArray(c.inputs))return o;const d=[...c.inputs];if(n<0||n>=d.length)return o;d.splice(n,1);const u=Jn(i,r),f={...c,inputs:d},m=[...i];return m.splice(u,1,f),{schema:{...l,fields:m}}})}));function to(e,t){const r=(e.columns??[]).flatMap(l=>l.fields??[]),n=t.length,o=t.map(l=>({width:l,fields:[]}));r.forEach((l,i)=>o[i%n].fields.push(l)),e.columns=o}function ro(e,t,r){const n=[];return e===null?n.push("hidden"):n.push(`w-[${Ya(Mr(e))}%]`,"block"),t===null?n.push("md:hidden"):n.push(`md:w-[${Ya(Mr(t))}%]`,"md:block"),r===null?n.push("lg:hidden"):n.push(`lg:w-[${Ya(Mr(r))}%]`,"lg:block"),n.join(" ")}function eA(e,t){const r=e.columns??[];if(r.length===t)return r;if(r.length<t){const o=t-r.length,l=[...r];for(let i=0;i<o;i++)l.push({width:"w-[100%]",fields:[]});return e.columns=l,l}const n=r.slice(0,t);for(let o=t;o<r.length;o++)n[t-1].fields=[...n[t-1].fields??[],...r[o].fields??[]];return e.columns=n,n}function no(e,t){const r=Array.from({length:t},()=>[]);return e.forEach((n,o)=>r[o%t].push(n)),r}const tA=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:K},Symbol.toStringTag,{value:"Module"}));function rA(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return v.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Sa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ir(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function bs(e){return"nodeType"in e}function it(e){var t,r;return e?Ir(e)?e:bs(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function xs(e){const{Document:t}=it(e);return e instanceof t}function yn(e){return Ir(e)?!1:e instanceof it(e).HTMLElement}function i5(e){return e instanceof it(e).SVGElement}function Zr(e){return e?Ir(e)?e.document:bs(e)?xs(e)?e:yn(e)||i5(e)?e.ownerDocument:document:document:document}const Nt=Sa?v.useLayoutEffect:v.useEffect;function $a(e){const t=v.useRef(e);return Nt(()=>{t.current=e}),v.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function nA(){const e=v.useRef(null),t=v.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function dn(e,t){t===void 0&&(t=[e]);const r=v.useRef(e);return Nt(()=>{r.current!==e&&(r.current=e)},t),r}function En(e,t){const r=v.useRef();return v.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function fa(e){const t=$a(e),r=v.useRef(null),n=v.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function ma(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let ao={};function kn(e,t){return v.useMemo(()=>{if(t)return t;const r=ao[e]==null?0:ao[e]+1;return ao[e]=r,e+"-"+r},[e,t])}function c5(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((l,i)=>{const c=Object.entries(i);for(const[d,u]of c){const f=l[d];f!=null&&(l[d]=f+e*u)}return l},{...t})}}const Ar=c5(1),un=c5(-1);function aA(e){return"clientX"in e&&"clientY"in e}function La(e){if(!e)return!1;const{KeyboardEvent:t}=it(e.target);return t&&e instanceof t}function oA(e){if(!e)return!1;const{TouchEvent:t}=it(e.target);return t&&e instanceof t}function ha(e){if(oA(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return aA(e)?{x:e.clientX,y:e.clientY}:null}const Xt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Xt.Translate.toString(e),Xt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Ol="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function sA(e){return e.matches(Ol)?e:e.querySelector(Ol)}const lA={display:"none"};function iA(e){let{id:t,value:r}=e;return v.createElement("div",{id:t,style:lA},r)}function cA(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return v.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function dA(){const[e,t]=v.useState("");return{announce:v.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const d5=v.createContext(null);function Rn(e){const t=v.useContext(d5);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function uA(){const[e]=v.useState(()=>new Set),t=v.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[v.useCallback(n=>{let{type:o,event:l}=n;e.forEach(i=>{var c;return(c=i[o])==null?void 0:c.call(i,l)})},[e]),t]}const fA={draggable:`
77
+ `}),s.jsx("span",{className:"sr-only",children:t})]}):null,ps=({items:e,selected:t,onSelect:r,level:n=0,openItems:o,onToggle:l})=>{const[i,c]=v.useState(new Set),d=o??i,u=o!==void 0&&l!==void 0,f=m=>{if(u)l(m);else{const h=new Set(i);h.has(m)?h.delete(m):h.add(m),c(h)}};return s.jsx("ul",{className:ce(n>0?"mt-1":"mt-0"),children:e.map(m=>{var p;const h=m.value===t,g=d.has(m.value),w=["pl-2","pl-2","pl-2"][n]||"pl-4",y=n===0?g||h?"bg-[var(--color-ds-background-accent)] text-[var(--color-ds-text-on-accent)] rounded-r-lg":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]":h?"bg-[var(--color-ds-background-surface)] text-[var(--color-ds-text-primary)]":"text-[var(--color-ds-text-primary)] hover:bg-[var(--color-ds-background-surface)]",x=n===0&&(g||h)?"text-[var(--color-ds-text-on-accent)]":"text-[var(--color-ds-text-secondary)]",b=!!((p=m.children)!=null&&p.length);return s.jsxs("li",{children:[s.jsxs("button",{type:"button",onClick:()=>b?f(m.value):r(m.value),"aria-expanded":b?g:void 0,className:ce("w-full flex items-center justify-between h-8 transition-colors",w,y),children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[n===0&&m.icon&&s.jsx(m.icon,{className:"w-5 h-5 ml-2"}),s.jsx("span",{className:"text-ds-sm",children:m.label})]}),b&&(g?s.jsx(mn,{className:ce("w-4 h-4",x)}):s.jsx(To,{className:ce("w-4 h-4",x)}))]}),b&&s.jsx("div",{className:ce("overflow-hidden transition-[max-height] duration-300 ease-in-out","border-l-1 border-[var(--color-ds-background-accent)] ml-6",g?"max-h-screen":"max-h-0"),children:s.jsx(ps,{items:m.children,selected:t,onSelect:r,level:n+1,openItems:d,onToggle:u?l:f})})]},m.value)})})},AM="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23FFFFFF;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",SM="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20250%20250'%3e%3c!--%20Generator:%20Adobe%20Illustrator%2029.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.0%20Build%20186)%20--%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20fill:%20%23005751;%20}%20%3c/style%3e%3c/defs%3e%3cpath%20class='st0'%20d='M101.7,82.72c1.6.57,3.25,1.09,4.98,1.53,11.93,3.07,17.85,7.44,17.85,13.01,0,2.72-1.14,5-3.43,6.86-2.29,1.86-5.14,2.79-8.57,2.79s-6.49-1.13-8.9-3.36c-2.62,6.82-6.19,13.16-10.51,18.91,5.53,3.09,11.9,4.68,19.13,4.68,10.14,0,18.64-3,25.43-9.01,3.7-3.24,6.35-6.96,8.02-11.11,1.77,3.2,4.03,6.17,6.81,8.9,7.64,7.51,17.28,11.22,28.78,11.22,9.14,0,17.21-2.43,24.21-7.22,2.24-1.55,4.24-3.27,6.05-5.14l-14.05-13.73h-.14c-2.57,4.29-8.57,7.44-15.64,7.44-8.78,0-15.5-5.22-17.85-13.58h57.06c.36-1.57.57-3.79.57-6.58,0-11.37-3.86-20.73-11.5-28.24-7.71-7.44-17.28-11.15-28.71-11.15s-21.14,3.72-28.78,11.15c-5.19,5.09-8.59,11.03-10.26,17.78-1.11-1.42-2.37-2.71-3.78-3.83-6.07-4.79-12.07-7.36-20.64-9.73-11-2.93-16.5-7.08-16.5-12.58,0-2.51,1-4.65,3.07-6.37,2.07-1.71,4.57-2.57,7.57-2.57,3.21,0,5.93,1,8,3,2.07,2,3.14,4.5,3.14,7.5h23.21c0-8.79-3.29-16.08-9.78-21.95-6.5-5.86-14.71-8.79-24.57-8.79s-17.44,2.77-23.89,8.31C74.82,12.54,53.44.47,29.27,0v24.08c27.07.77,48.86,23.04,48.86,50.32s-21.79,49.55-48.86,50.32v24.08c37.54-.72,68.34-29.42,72.44-66.08ZM181.29,67.38c8.21,0,15,5.08,17.21,13.3h-34.5c2.57-8.22,8.93-13.3,17.28-13.3Z'/%3e%3cpath%20class='st0'%20d='M29.35,160.65v29.07h10.94c4.12,0,7.57-1.38,10.31-4.16,2.74-2.76,4.12-6.21,4.12-10.39s-1.38-7.61-4.12-10.39c-2.74-2.76-6.19-4.14-10.31-4.14h-10.94ZM52.1,175.17c0,3.46-1.14,6.34-3.39,8.64-2.25,2.3-5.07,3.46-8.46,3.46h-8.36v-24.17h8.36c3.39,0,6.21,1.15,8.46,3.46,2.25,2.3,3.39,5.18,3.39,8.62Z'/%3e%3cpath%20class='st0'%20d='M60.61,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3crect%20class='st0'%20x='57.63'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M64.15,168.24v29.48h2.41v-13.19c.85,1.77,2.09,3.17,3.69,4.18,1.6,1.01,3.41,1.52,5.44,1.52,3.11,0,5.7-1.07,7.75-3.23,2.05-2.16,3.07-4.83,3.07-8.04s-1.04-5.86-3.09-8.02c-2.05-2.14-4.63-3.21-7.73-3.21-2.03,0-3.84.49-5.44,1.5-1.6,1.01-2.84,2.41-3.69,4.18v-5.16h-2.41ZM69.06,172.62c1.64-1.69,3.73-2.53,6.23-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36c-1.66,1.71-3.73,2.55-6.23,2.55s-4.59-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33Z'/%3e%3cpath%20class='st0'%20d='M107.73,189.71v-21.48h-2.42v12.59c0,2.1-.65,3.79-1.97,5.08-1.32,1.3-3.05,1.95-5.18,1.95s-3.69-.64-4.93-1.91c-1.26-1.28-1.89-2.96-1.89-5.04v-12.67h-2.4v13.35c0,2.61.79,4.69,2.35,6.27,1.56,1.58,3.61,2.37,6.15,2.37,3.65-.02,6.27-1.52,7.85-4.53v4.01h2.42Z'/%3e%3cpolygon%20class='st0'%20points='117.35%20189.71%20117.35%20170.46%20122.55%20170.46%20122.55%20168.24%20117.35%20168.24%20117.35%20161.9%20114.94%20162.38%20114.94%20168.24%20110.01%20168.24%20110.01%20170.46%20114.94%20170.46%20114.94%20189.71%20117.35%20189.71'/%3e%3cpath%20class='st0'%20d='M144.27,189.71v-21.48h-2.42v5.12c-.87-1.75-2.13-3.13-3.73-4.14-1.6-1.01-3.41-1.5-5.4-1.5-3.08,0-5.64,1.07-7.69,3.21-2.05,2.16-3.09,4.83-3.09,8.02s1.04,5.88,3.09,8.04c2.05,2.16,4.63,3.23,7.69,3.23,1.99,0,3.79-.51,5.4-1.52,1.6-1.01,2.84-2.39,3.73-4.13v5.14h2.42ZM139.36,185.31c-1.66,1.71-3.73,2.55-6.23,2.55s-4.53-.84-6.19-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.19-2.53s4.57.84,6.23,2.53c1.66,1.71,2.5,3.8,2.5,6.33s-.83,4.65-2.5,6.36Z'/%3e%3cpath%20class='st0'%20d='M158.18,170.09c2.09,0,3.9.62,5.46,1.85,1.54,1.23,2.56,2.84,3.02,4.83h2.5c-.47-2.63-1.73-4.79-3.73-6.5-2.03-1.71-4.44-2.55-7.25-2.55-3.19,0-5.84,1.07-8,3.21-2.15,2.16-3.23,4.83-3.23,8.02s1.08,5.88,3.23,8.04c2.13,2.16,4.81,3.23,8,3.23,2.8,0,5.22-.84,7.25-2.55,2.01-1.71,3.27-3.87,3.73-6.52h-2.5c-.47,2-1.48,3.62-3.02,4.85-1.56,1.23-3.37,1.85-5.46,1.85-2.5,0-4.57-.84-6.23-2.55-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3crect%20class='st0'%20x='171.72'%20y='168.24'%20width='2.42'%20height='21.48'/%3e%3cpath%20class='st0'%20d='M174.71,161.41c0-.97-.79-1.73-1.79-1.73s-1.75.76-1.75,1.73.79,1.77,1.75,1.77,1.79-.76,1.79-1.77Z'/%3e%3cpath%20class='st0'%20d='M176.86,178.95c0,3.21,1.08,5.88,3.23,8.04,2.15,2.16,4.83,3.23,8.02,3.23s5.85-1.07,7.98-3.23c2.13-2.16,3.19-4.83,3.19-8.04s-1.06-5.86-3.19-8.02c-2.13-2.14-4.79-3.21-7.98-3.21s-5.86,1.07-8.02,3.21c-2.15,2.16-3.23,4.83-3.23,8.02ZM188.09,170.09c2.5,0,4.57.84,6.21,2.53,1.64,1.71,2.48,3.8,2.48,6.33s-.83,4.65-2.48,6.36c-1.64,1.71-3.71,2.55-6.21,2.55s-4.57-.84-6.23-2.55c-1.66-1.71-2.5-3.83-2.5-6.36s.83-4.63,2.5-6.33c1.66-1.69,3.73-2.53,6.23-2.53Z'/%3e%3cpolygon%20class='st0'%20points='194.03%20160.01%20190.83%20160.01%20186.46%20165.15%20189.08%20165.15%20194.03%20160.01'/%3e%3cpath%20class='st0'%20d='M221.5,189.71v-13.02c0-2.69-.81-4.86-2.44-6.5-1.64-1.65-3.79-2.47-6.45-2.47-3.75,0-6.68,1.67-8.22,4.71v-4.2h-2.42v21.48h2.42v-12.22c0-2.22.69-4.01,2.07-5.37,1.38-1.36,3.19-2.04,5.44-2.04s3.92.66,5.24,2c1.32,1.34,1.97,3.11,1.97,5.33v12.3h2.4Z'/%3e%3cpath%20class='st0'%20d='M57.27,225.24c-2.82-2.23-5.61-3.43-9.59-4.53-5.11-1.37-7.66-3.3-7.66-5.87,0-1.17.46-2.17,1.43-2.97.96-.8,2.12-1.2,3.52-1.2,1.49,0,2.75.47,3.72,1.4.96.93,1.46,2.1,1.46,3.5h10.78c0-4.1-1.53-7.5-4.55-10.23-3.02-2.73-6.83-4.1-11.42-4.1s-8.23,1.33-11.25,4c-3.02,2.67-4.51,6-4.51,10s1.26,7.4,3.75,9.73c2.49,2.37,5.68,4.03,9.56,5.03,5.54,1.43,8.29,3.47,8.29,6.06,0,1.27-.53,2.33-1.59,3.2-1.06.87-2.39,1.3-3.98,1.3s-3.05-.53-4.18-1.6c-1.16-1.07-1.73-2.37-1.73-3.93h-10.82c0,4.3,1.59,7.86,4.78,10.7,3.15,2.83,7.1,4.26,11.81,4.26s8.66-1.4,11.81-4.2c3.15-2.77,4.71-6.26,4.71-10.43,0-4.43-1.56-7.9-4.35-10.13Z'/%3e%3cpolygon%20class='st0'%20points='118.26%20236.54%20110.23%20214.38%2098.88%20214.38%20113.02%20249.17%20123.21%20249.17%20137.28%20214.38%20126.19%20214.38%20118.26%20236.54'/%3e%3crect%20class='st0'%20x='139.25'%20y='214.38'%20width='9.92'%20height='34.79'/%3e%3cpath%20class='st0'%20d='M144.2,199.53c-1.72,0-3.18.57-4.35,1.73-1.16,1.17-1.76,2.6-1.76,4.33s.6,3.23,1.76,4.4c1.16,1.17,2.62,1.73,4.35,1.73s3.25-.57,4.45-1.73c1.16-1.17,1.76-2.63,1.76-4.4s-.6-3.17-1.76-4.33c-1.19-1.17-2.69-1.73-4.45-1.73Z'/%3e%3crect%20class='st0'%20x='154.93'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3crect%20class='st0'%20x='170.61'%20y='200.02'%20width='9.92'%20height='49.15'/%3e%3cpath%20class='st0'%20d='M211.58,214.38v3.8c-2.82-3.1-6.34-4.63-10.49-4.63-4.75,0-8.73,1.73-11.91,5.2-3.22,3.5-4.81,7.83-4.81,13s1.59,9.53,4.81,13.03c3.19,3.5,7.17,5.23,11.91,5.23,4.18-.03,7.67-1.57,10.49-4.67v3.83h9.92v-34.79h-9.92ZM209.19,237.9c-1.63,1.63-3.65,2.47-6.11,2.47s-4.41-.83-6.01-2.47c-1.63-1.63-2.42-3.7-2.42-6.17s.8-4.5,2.42-6.13c1.59-1.63,3.58-2.43,6.01-2.43s4.45.8,6.07,2.43c1.63,1.63,2.42,3.7,2.42,6.13s-.8,4.53-2.39,6.17Z'/%3e%3cpath%20class='st0'%20d='M82.34,213.54c-5.34,0-9.82,1.73-13.37,5.2-3.55,3.5-5.34,7.83-5.34,13s1.79,9.53,5.34,13.03c3.55,3.5,8.03,5.23,13.37,5.23,4.25,0,8-1.13,11.25-3.37,1.05-.73,1.99-1.55,2.84-2.43l-6.5-6.37h-.13c-1.19,2-3.98,3.47-7.27,3.47-4.08,0-7.2-2.43-8.29-6.33h26.51c.17-.73.27-1.77.27-3.07,0-5.3-1.79-9.66-5.34-13.16-3.58-3.47-8.03-5.2-13.34-5.2ZM74.31,228.34c1.19-3.83,4.15-6.2,8.03-6.2s6.97,2.37,8,6.2h-16.03Z'/%3e%3c/svg%3e",Qi=({appName:e,orgName:t,username:r,footerText:n,navItems:o,selectedNav:l,onSelectNav:i,width:c="200px"})=>{const{theme:d}=hs(),u=d==="dark"?AM:SM;return s.jsxs("aside",{className:"flex flex-col h-screen bg-[var(--color-ds-background-page)] overflow-hidden",style:{width:c},children:[s.jsxs("div",{className:"flex gap-1 flex-col items-center py-4 space-y-1",children:[s.jsx("img",{src:u,alt:"Logo Diputación",className:"w-20 h-20"}),s.jsx("span",{className:"text-[var(--color-ds-text-primary)] text-ds-lg",children:e}),s.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:t}),s.jsx("span",{className:"text-ds-sm text-[var(--color-ds-text-secondary)]",children:r}),s.jsx("div",{className:"w-1/5 h-0.5 rounded-full bg-[var(--color-ds-background-accent)] mt-2"})]}),s.jsx("nav",{className:"flex-1 min-h-0 overflow-auto custom-scroll scrollbar-hidden pt-3",children:s.jsx(ps,{items:o,selected:l,onSelect:i})}),s.jsx("div",{className:"px-4 w-full py-3",children:s.jsx("span",{className:"text-ds-sm w-full text-center text-[var(--color-ds-text-secondary)]",children:n})})]})};function $M({hideSidebar:e=!1,sidebar:t,header:r,children:n}){const{dark:o}=hs(),l={...r,dark:o};return s.jsxs("div",{className:"flex h-screen overflow-hidden bg-[var(--color-ds-background-page)]",children:[!e&&s.jsx(Qi,{...t}),s.jsxs("div",{className:`flex-1 flex flex-col overflow-auto [scrollbar-gutter:stable_both-edges] ${e?"px-0":"px-10"}`,children:[s.jsx(Xi,{...l}),s.jsx("main",{className:"flex-1 min-h-0",children:n})]})]})}function LM({columns:e,data:t,loadData:r,loading:n,idAccessor:o,multiSelect:l=!1,onSelectionChange:i,pageSize:c=10,initialSort:d,onSort:u,className:f,onRowDoubleClick:m}){const h=t!==void 0,[g,w]=v.useState([]),[y,x]=v.useState(!1),b=v.useRef(null);v.useEffect(()=>{var X;if(!r||h)return;(X=b.current)==null||X.abort();const $=new AbortController;return b.current=$,x(!0),r().then(_=>{$.signal.aborted||w(_)}).finally(()=>{$.signal.aborted||x(!1)}),()=>$.abort()},[r,h]);const p=v.useMemo(()=>h?t:g,[t,g,h]),E=n??(r?y:!1),[R,j]=v.useState(new Set),[A,L]=v.useState(1),[F,V]=v.useState(d==null?void 0:d.sortBy),[S,H]=v.useState((d==null?void 0:d.sortDir)??"asc"),z=$=>typeof o=="function"?o($):$[o],Y=v.useRef(null);v.useEffect(()=>{Y.current!==p&&(j(new Set),L(1),Y.current=p)},[p]);const ee=v.useMemo(()=>{if(!F)return p;const $=S==="asc"?1:-1;return[...p].sort((X,_)=>{const N=X[F],Q=_[F];return N==null?-$:Q==null||N>Q?$:N<Q?-$:0})},[p,F,S]),U=Math.max(1,Math.ceil(ee.length/c)),oe=v.useMemo(()=>{const $=(A-1)*c;return ee.slice($,$+c)},[ee,A,c]),q=$=>{const X=new Set(R);X.has($)?X.delete($):X.add($),j(X),i==null||i(p.filter(_=>X.has(z(_))))},M=()=>{const $=oe.every(_=>R.has(z(_))),X=new Set(R);oe.forEach(_=>{$?X.delete(z(_)):X.add(z(_))}),j(X),i==null||i(p.filter(_=>X.has(z(_))))},I=$=>{if(!$.sortable)return;const X=typeof $.accessor=="string"?$.accessor:$.sortKey;if(F===X){const _=S==="asc"?"desc":"asc";H(_),u==null||u(X,_)}else V(X),H("asc"),u==null||u(X,"asc");L(1)},he=()=>E?s.jsx("tbody",{children:Array.from({length:c}).map(($,X)=>s.jsxs("tr",{children:[l&&s.jsx("td",{className:"px-3 py-2",children:s.jsx(zt,{width:"1rem",height:"1rem",variant:"circle"})}),e.map((_,N)=>s.jsx("td",{className:"px-4 py-2",children:s.jsx(zt,{width:"100%",height:"1em",variant:"rect"})},N))]},X))}):oe.length?s.jsx("tbody",{className:"bg-[var(--color-ds-background-surface)]",children:oe.map($=>{const X=z($);return s.jsxs("tr",{className:ce("transition-colors","hover:bg-[var(--color-ds-border-default-50)]",m&&"cursor-pointer select-none"),onDoubleClick:m?()=>m($):void 0,title:m?"Doble clic para abrir":void 0,children:[l&&s.jsx("td",{className:"px-3 py-2",children:s.jsx("input",{type:"checkbox",className:"accent-[var(--color-ds-button-primary-bg)]",checked:R.has(X),onChange:()=>q(X),onDoubleClick:_=>_.stopPropagation()})}),e.map((_,N)=>{const Q=_.render?_.render($):typeof _.accessor=="function"?_.accessor($):$[_.accessor];return s.jsx("td",{className:ce("px-4 py-2 whitespace-nowrap text-[var(--color-ds-text-primary)] text-sm",_.width),children:Q},`${String(_.header)}-${N}`)})]},X)})}):s.jsx("tbody",{children:s.jsx("tr",{children:s.jsx("td",{className:"px-4 py-6 text-center text-[var(--color-ds-text-secondary)]",colSpan:e.length+(l?1:0),children:"No hay datos"})})});return s.jsxs("div",{className:ce("w-full overflow-auto rounded-lg border","border-[var(--color-ds-border-default-50)]",f),children:[s.jsxs("table",{className:"min-w-full",children:[s.jsx("thead",{className:"bg-[var(--color-ds-background-surface)] border-b border-[var(--color-ds-border-default-50)]",children:s.jsxs("tr",{children:[l&&s.jsx("th",{className:"px-3 py-2",children:s.jsx("input",{type:"checkbox",className:"accent-[var(--color-ds-button-primary-bg)]",checked:oe.length>0&&oe.every($=>R.has(z($))),onChange:M,onDoubleClick:$=>$.stopPropagation()})}),e.map($=>{const X=typeof $.accessor=="string"?$.accessor:$.header,_=F===(typeof $.accessor=="string"?$.accessor:$.sortKey);return s.jsx("th",{className:ce("px-4 py-2 text-left text-xs font-semibold uppercase tracking-wide select-none","text-[var(--color-ds-text-secondary)]",$.width),onClick:()=>I($),children:s.jsxs("div",{className:ce("inline-flex items-center gap-1",$.sortable&&"cursor-pointer"),children:[s.jsx("span",{children:$.header}),$.sortable&&s.jsx("span",{className:ce("text-[var(--color-ds-text-secondary)]"),children:_?S==="asc"?"▲":"▼":"⇵"})]})},X)})]})}),he()]}),s.jsxs("div",{className:"flex items-center justify-between py-2 px-4 border-t border-[var(--color-ds-border-default-50)] bg-[var(--color-ds-background-page)]/40",children:[s.jsx("span",{className:"text-sm text-[var(--color-ds-text-secondary)]",children:E?"Cargando...":`Página ${A} de ${U}`}),s.jsxs("div",{className:"space-x-2",children:[s.jsx(ie,{size:"sm",variant:"outline",disabled:E||A<=1,onClick:()=>L($=>Math.max(1,$-1)),children:"Prev"}),s.jsx(ie,{size:"sm",variant:"outline",disabled:E||A>=U,onClick:()=>L($=>Math.min(U,$+1)),children:"Next"})]})]})]})}function vs({control:e,name:t,rules:r,defaultValue:n=!1,checked:o,onChange:l,disabled:i=!1,label:c,labelPosition:d="right",errorMessage:u="",className:f}){const m=v.useId();if(e&&t)return s.jsx(Et,{name:t,control:e,rules:r,defaultValue:n,render:({field:g,fieldState:w})=>{var y;return s.jsx(vs,{checked:g.value,onChange:g.onChange,disabled:i,label:c,labelPosition:d,errorMessage:((y=w.error)==null?void 0:y.message)||"",className:f})}});const h=!!o;return s.jsxs("div",{className:ce("flex flex-col",f),children:[s.jsxs("label",{className:ce("inline-flex items-center space-x-3 select-none",i&&"opacity-50 cursor-not-allowed"),htmlFor:m,children:[c&&d==="left"&&s.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:c}),s.jsx("button",{id:m,type:"button",role:"switch","aria-checked":h,disabled:i,onClick:()=>!i&&(l==null?void 0:l(!h)),className:ce("relative inline-flex items-center h-8 w-16","bg-[var(--color-ds-background-accent)] rounded-full transition-colors duration-200","focus:outline-none "),children:s.jsx("div",{className:ce("absolute h-6 w-6 bg-[var(--color-ds-background-page)] rounded-full shadow transform transition-transform duration-200",h?"translate-x-9":"translate-x-1")})}),c&&d==="right"&&s.jsx("span",{className:"text-ds-md text-[var(--color-ds-text-primary)]",children:c})]}),s.jsx("div",{className:"pt-1 min-h-[18px] w-full",children:u?s.jsx("span",{className:"text-xs text-[var(--color-ds-text-error)]",children:u}):s.jsx("span",{"aria-hidden":"true",children:" "})})]})}function e5({items:e,value:t,onValueChange:r,multiple:n=!0,dense:o=!1,className:l}){const i=v.useMemo(()=>e.filter(w=>w.defaultOpen&&!w.disabled).map(w=>w.id),[e]),[c,d]=v.useState(i),u=t??c,f=w=>{r?r(w):d(w)},m=(w,y)=>{y&&f(n?u.includes(w)?u.filter(x=>x!==w):[...u,w]:u.includes(w)?[]:[w])},h=(w,y,x)=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),m(y,x))},g=o?"py-1":"py-2";return s.jsx("div",{className:["divide-y","divide-[var(--color-ds-border-default-50)]",l].filter(Boolean).join(" "),children:e.map(w=>{const y=u.includes(w.id),x=!w.disabled;return s.jsxs("section",{"aria-disabled":w.disabled||void 0,children:[s.jsxs("button",{type:"button",onClick:()=>m(w.id,x),onKeyDown:b=>h(b,w.id,x),"aria-expanded":y,className:["w-full flex items-center justify-between gap-2 text-left select-none",g,"text-[var(--color-ds-text-primary)]",w.disabled?"opacity-60 cursor-not-allowed":"hover:bg-[color-mix(in_srgb,var(--color-ds-background-surface)_80%,transparent)]"].join(" "),children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[w.leftAdornment&&s.jsx("span",{className:"shrink-0",children:w.leftAdornment}),s.jsx("span",{className:"font-medium truncate",children:w.title})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[w.actions,s.jsx(mn,{className:["h-4 w-4 transition-transform",y?"rotate-180":"",w.disabled?"opacity-40":""].join(" ")})]})]}),y&&s.jsx("div",{className:[o?"py-1":"py-2"].join(" "),children:w.content})]},w.id)})})}const kl=e=>{let t;const r=new Set,n=(u,f)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const h=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(g=>g(t,h))}},o=()=>t,c={setState:n,getState:o,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u))},d=t=e(n,o,c);return c},OM=(e=>e?kl(e):kl),NM=e=>e;function FM(e,t=NM){const r=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(r),r}const Rl=e=>{const t=OM(e),r=n=>FM(t,n);return Object.assign(r,t),r},IM=(e=>e?Rl(e):Rl);var t5=Symbol.for("immer-nothing"),jl=Symbol.for("immer-draftable"),kt=Symbol.for("immer-state"),ZM=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function pt(e,...t){if(process.env.NODE_ENV!=="production"){const r=ZM[e],n=typeof r=="function"?r.apply(null,t):r;throw new Error(`[Immer] ${n}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var sn=Object.getPrototypeOf;function Lr(e){return!!e&&!!e[kt]}function dr(e){var t;return e?r5(e)||Array.isArray(e)||!!e[jl]||!!((t=e.constructor)!=null&&t[jl])||xn(e)||Ma(e):!1}var BM=Object.prototype.constructor.toString(),Cl=new WeakMap;function r5(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Cl.get(r);return n===void 0&&(n=Function.toString.call(r),Cl.set(r,n)),n===BM}function ca(e,t,r=!0){Ca(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Ca(e){const t=e[kt];return t?t.type_:Array.isArray(e)?1:xn(e)?2:Ma(e)?3:0}function Co(e,t){return Ca(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function n5(e,t,r){const n=Ca(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function VM(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xn(e){return e instanceof Map}function Ma(e){return e instanceof Set}function ar(e){return e.copy_||e.base_}function Mo(e,t){if(xn(e))return new Map(e);if(Ma(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=r5(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[kt];let o=Reflect.ownKeys(n);for(let l=0;l<o.length;l++){const i=o[l],c=n[i];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(n[i]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[i]})}return Object.create(sn(e),n)}else{const n=sn(e);if(n!==null&&r)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function ws(e,t=!1){return Aa(e)||Lr(e)||!dr(e)||(Ca(e)>1&&Object.defineProperties(e,{set:Vn,add:Vn,clear:Vn,delete:Vn}),Object.freeze(e),t&&Object.values(e).forEach(r=>ws(r,!0))),e}function TM(){pt(2)}var Vn={value:TM};function Aa(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var DM={};function ur(e){const t=DM[e];return t||pt(0,e),t}var ln;function a5(){return ln}function HM(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ml(e,t){t&&(ur("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ao(e){So(e),e.drafts_.forEach(_M),e.drafts_=null}function So(e){e===ln&&(ln=e.parent_)}function Al(e){return ln=HM(ln,e)}function _M(e){const t=e[kt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Sl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[kt].modified_&&(Ao(t),pt(4)),dr(e)&&(e=da(t,e),t.parent_||ua(t,e)),t.patches_&&ur("Patches").generateReplacementPatches_(r[kt].base_,e,t.patches_,t.inversePatches_)):e=da(t,r,[]),Ao(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==t5?e:void 0}function da(e,t,r){if(Aa(t))return t;const n=e.immer_.shouldUseStrictIteration(),o=t[kt];if(!o)return ca(t,(l,i)=>$l(e,o,t,l,i,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return ua(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const l=o.copy_;let i=l,c=!1;o.type_===3&&(i=new Set(l),l.clear(),c=!0),ca(i,(d,u)=>$l(e,o,l,d,u,r,c),n),ua(e,l,!1),r&&e.patches_&&ur("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function $l(e,t,r,n,o,l,i){if(o==null||typeof o!="object"&&!i)return;const c=Aa(o);if(!(c&&!i)){if(process.env.NODE_ENV!=="production"&&o===r&&pt(5),Lr(o)){const d=l&&t&&t.type_!==3&&!Co(t.assigned_,n)?l.concat(n):void 0,u=da(e,o,d);if(n5(r,n,u),Lr(u))e.canAutoFreeze_=!1;else return}else i&&r.add(o);if(dr(o)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&c)return;da(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(xn(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&ua(e,o)}}}function ua(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ws(t,r)}function PM(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:a5(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,l=gs;r&&(o=[n],l=cn);const{revoke:i,proxy:c}=Proxy.revocable(o,l);return n.draft_=c,n.revoke_=i,c}var gs={get(e,t){if(t===kt)return e;const r=ar(e);if(!Co(r,t))return WM(e,r,t);const n=r[t];return e.finalized_||!dr(n)?n:n===Ga(e.base_,t)?(Ka(e),e.copy_[t]=Lo(n,e)):n},has(e,t){return t in ar(e)},ownKeys(e){return Reflect.ownKeys(ar(e))},set(e,t,r){const n=o5(ar(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const o=Ga(ar(e),t),l=o==null?void 0:o[kt];if(l&&l.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(VM(r,o)&&(r!==void 0||Co(e.base_,t)))return!0;Ka(e),$o(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ga(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ka(e),$o(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ar(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){pt(11)},getPrototypeOf(e){return sn(e.base_)},setPrototypeOf(){pt(12)}},cn={};ca(gs,(e,t)=>{cn[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});cn.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&pt(13),cn.set.call(this,e,t,void 0)};cn.set=function(e,t,r){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&pt(14),gs.set.call(this,e[0],t,r,e[0])};function Ga(e,t){const r=e[kt];return(r?ar(r):e)[t]}function WM(e,t,r){var o;const n=o5(t,r);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function o5(e,t){if(!(t in e))return;let r=sn(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=sn(r)}}function $o(e){e.modified_||(e.modified_=!0,e.parent_&&$o(e.parent_))}function Ka(e){e.copy_||(e.copy_=Mo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zM=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const l=r;r=t;const i=this;return function(d=l,...u){return i.produce(d,f=>r.call(this,f,...u))}}typeof r!="function"&&pt(6),n!==void 0&&typeof n!="function"&&pt(7);let o;if(dr(t)){const l=Al(this),i=Lo(t,void 0);let c=!0;try{o=r(i),c=!1}finally{c?Ao(l):So(l)}return Ml(l,n),Sl(o,l)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===t5&&(o=void 0),this.autoFreeze_&&ws(o,!0),n){const l=[],i=[];ur("Patches").generateReplacementPatches_(t,o,l,i),n(l,i)}return o}else pt(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(i,...c)=>this.produceWithPatches(i,d=>t(d,...c));let n,o;return[this.produce(t,r,(i,c)=>{n=i,o=c}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){dr(e)||pt(8),Lr(e)&&(e=qM(e));const t=Al(this),r=Lo(e,void 0);return r[kt].isManual_=!0,So(t),r}finishDraft(e,t){const r=e&&e[kt];(!r||!r.isManual_)&&pt(9);const{scope_:n}=r;return Ml(n,t),Sl(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));const n=ur("Patches").applyPatches_;return Lr(e)?n(e,t):this.produce(e,o=>n(o,t))}};function Lo(e,t){const r=xn(e)?ur("MapSet").proxyMap_(e,t):Ma(e)?ur("MapSet").proxySet_(e,t):PM(e,t);return(t?t.scope_:a5()).drafts_.push(r),r}function qM(e){return Lr(e)||pt(10,e),s5(e)}function s5(e){if(!dr(e)||Aa(e))return e;const t=e[kt];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Mo(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Mo(e,!0);return ca(r,(o,l)=>{n5(r,o,s5(l))},n),t&&(t.finalized_=!1),r}var UM=new zM,GM=UM.produce;const Ya=e=>Number(e.toFixed(2)),Mr=e=>Math.max(0,Math.min(100,e??0)),KM={text:{name:"text",label:"Texto"},number:{name:"number",label:"Número"},email:{name:"email",label:"Email"},select:{name:"select",label:"Select"},checkbox:{name:"checkbox",label:"Checkbox"},date:{name:"date",label:"Fecha"},textarea:{name:"textarea",label:"Textarea"},file:{name:"file",label:"Archivo"},search:{name:"search",label:"Búsqueda"}},Pe=e=>e.layout.find(t=>t.type==="rows"),Mt=(e,t)=>{if(t==null)return Pe(e);const r=e.layout[t];return r&&r.type==="rows"?r:Pe(e)},Ja=e=>e<=1?["w-full"]:e===2?["w-1/2","w-1/2"]:e===3?["w-1/3","w-1/3","w-1/3"]:Array.from({length:e},()=>"flex-1"),Xa={1:["w-full"],2:["w-1/2","w-1/2"],3:["w-1/3","w-1/3","w-1/3"],4:["w-1/4","w-1/4","w-1/4","w-1/4"],"1/3-2/3":["w-1/3","w-2/3"],"2/3-1/3":["w-2/3","w-1/3"],"1/4-3/4":["w-1/4","w-3/4"],"3/4-1/4":["w-3/4","w-1/4"]},qe=(e,t)=>{for(let r=0;r<e.layout.length;r++){const n=e.layout[r];if((n==null?void 0:n.type)!=="tabs")continue;const o=n.tabs.findIndex(l=>l.key===t);if(o>=0)return{nodeIdx:r,tabIdx:o}}return null},YM=e=>{const t=[];return e.layout.forEach(r=>{r.type==="rows"&&r.sections.forEach(n=>n.rows.forEach(o=>o.columns.forEach(l=>(l.fields??[]).forEach(i=>t.push(i))))),r.type==="tabs"&&r.tabs.forEach(n=>n.sections.forEach(o=>o.rows.forEach(l=>l.columns.forEach(i=>(i.fields??[]).forEach(c=>t.push(c))))))}),t},JM=e=>({type:"rows",sections:[{sectionTitle:e??"Sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}),Ll=(e,t)=>Math.max(0,Math.min(e,t)),Qa=e=>!!e&&e.type==="inputGroup",Jn=(e,t)=>e.findIndex(r=>(r==null?void 0:r.name)===t),eo=(e,t)=>e[Jn(e,t)],XM=()=>({type:"tabs",tabs:[{key:`tab_${Date.now().toString(36)}_1`,label:"Pestaña 1",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]},{key:`tab_${Date.now().toString(36)}_2`,label:"Pestaña 2",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}]}),yr=(e,t)=>YM(e).includes(t),Oo=e=>e.replace(/(?:_copy)+$/i,"").replace(/_(\d+)$/i,""),l5=e=>e.replace(/\s\((\d+)\)$/i,""),ut=(e,t)=>{const r=e||"campo";if(!t.has(r))return r;let n=2;for(;t.has(`${r}_${n}`);)n++;return`${r}_${n}`},gt=(e,t)=>{const r=e||"Campo";if(!t.has(r))return r;let n=2;for(;t.has(`${r} (${n})`);)n++;return`${r} (${n})`},ft=e=>{const t=(e.type??"text").toString(),r=KM[t]??{name:"campo",label:"Campo"},n=e.name?Oo(e.name):r.name,o=e.label?l5(e.label):r.label;return{baseName:n,baseLabel:o}},QM={layout:[{type:"rows",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}],fields:[],onSubmit:async()=>{},successMessage:"Guardado",errorMessage:"Error"},K=IM((e,t)=>({schema:QM,selection:{kind:"none"},past:[],future:[],fieldPick:{armed:!1},previewMode:!1,fieldDom:{},fieldAnchors:{},showRelations:!1,relationsEnabled:!1,setPreviewMode:r=>e({previewMode:!!r}),togglePreview:()=>e(r=>{const n=!r.previewMode;return{previewMode:n,...n?{showRelations:!1,relationsEnabled:!1}:{}}}),toggleRelations:r=>e(n=>{const o=r!==void 0?r:!n.relationsEnabled;return{relationsEnabled:o,showRelations:o}}),registerFieldEl:(r,n)=>e(o=>({fieldDom:{...o.fieldDom,[r]:n}})),registerFieldAnchor:(r,n)=>e(o=>{const l=o.fieldAnchors[r];return l&&l.x===n.x&&l.y===n.y&&l.w===n.w&&l.h===n.h?o:{fieldAnchors:{...o.fieldAnchors,[r]:n}}}),unregisterFieldAnchor:r=>e(n=>{const o={...n.fieldAnchors};return delete o[r],{fieldAnchors:o}}),setSchema:r=>{const n=t().schema,o=typeof r=="function"?GM(n,r):r;e(l=>({...l,schema:o,past:[...l.past,n].slice(-50),future:[]}))},setSelection:r=>e({selection:r}),undo:()=>e(r=>r.past.length?{schema:r.past[r.past.length-1],past:r.past.slice(0,-1),future:[r.schema,...r.future]}:r),redo:()=>e(r=>r.future.length?{schema:r.future[0],past:[...r.past,r.schema],future:r.future.slice(1)}:r),resetHistory:()=>e(r=>({past:[],future:[]})),addField:r=>t().setSchema(n=>{const{baseName:o,baseLabel:l}=ft(r),i=new Set(n.fields.map(f=>f.name).filter(Boolean)),c=new Set(n.fields.map(f=>f.label??"").filter(Boolean)),d=ut(o,i),u=gt(l,c);r.name=d,r.label||(r.label=u),n.fields.push(r)}),addFieldAt:(r,n)=>t().setSchema(o=>{const{baseName:l,baseLabel:i}=ft(r),c=new Set(o.fields.map(h=>h.name).filter(Boolean)),d=new Set(o.fields.map(h=>h.label??"").filter(Boolean)),u=ut(l,c),f=gt(i,d);r.name=u,r.label||(r.label=f);const m=Math.max(0,Math.min(n??o.fields.length,o.fields.length));o.fields.splice(m,0,r)}),removeField:r=>t().setSchema(n=>{n.fields=n.fields.filter(o=>o.name!==r),n.layout.forEach(o=>{o.type==="rows"&&o.sections.forEach(l=>l.rows.forEach(i=>i.columns.forEach(c=>{c.fields=(c.fields??[]).filter(d=>d!==r)}))),o.type==="tabs"&&o.tabs.forEach(l=>l.sections.forEach(i=>i.rows.forEach(c=>c.columns.forEach(d=>{d.fields=(d.fields??[]).filter(u=>u!==r)}))))})}),updateField:(r,n)=>t().setSchema(o=>{const l=o.fields.findIndex(i=>i.name===r);l>=0&&n(o.fields[l])}),duplicateField:(r,n)=>t().setSchema(o=>{const l=o.fields.findIndex(w=>w.name===r);if(l<0)return;const i=o.fields[l],c=Oo((n==null?void 0:n.trim())||i.name||""),d=l5(i.label??""),u=new Set(o.fields.map(w=>w.name).filter(Boolean)),f=new Set(o.fields.map(w=>w.label??"").filter(Boolean)),m=ut(c||ft(i).baseName,u),h=gt(d||ft(i).baseLabel,f),g=JSON.parse(JSON.stringify(i));g.name=m,g.label=h,o.fields.splice(l+1,0,g)}),renameField:(r,n)=>t().setSchema(o=>{const l=o.fields.findIndex(u=>u.name===r);if(l<0)return;const i=Oo((n??r).trim()||"campo"),c=new Set(o.fields.map(u=>u.name).filter(Boolean));c.delete(r);const d=ut(i,c);o.fields[l].name=d,o.layout.forEach(u=>{u.type==="rows"&&u.sections.forEach(f=>f.rows.forEach(m=>m.columns.forEach(h=>{h.fields&&(h.fields=h.fields.map(g=>g===r?d:g))}))),u.type==="tabs"&&u.tabs.forEach(f=>f.sections.forEach(m=>m.rows.forEach(h=>h.columns.forEach(g=>{g.fields&&(g.fields=g.fields.map(w=>w===r?d:w))}))))})}),addSection:r=>t().setSchema(n=>{const o=Pe(n);if(!o)return;const l={sectionTitle:r??"Nueva sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]};o.sections.push(l)}),renameSection:(r,n)=>t().setSchema(o=>{const l=Pe(o);if(!l)return;const i=l.sections[r];i&&(i.sectionTitle=(n??"").trim()||"Sección")}),moveSection:(r,n,o)=>e(l=>{const i=[...l.schema.layout],c=i[r];if(!c||c.type!=="rows")return l;const d=[...c.sections],[u]=d.splice(n,1),f=Math.max(0,Math.min(o,d.length));return d.splice(f,0,u),i[r]={...c,sections:d},{schema:{...l.schema,layout:i}}}),removeSection:r=>t().setSchema(n=>{const o=Pe(n);if(!o||r<0||r>=o.sections.length)return;const l=[...o.sections];l.splice(r,1),o.sections=l}),duplicateSection:r=>t().setSchema(n=>{const o=Pe(n);if(!o)return;const l=o.sections[r];if(!l)return;const i=JSON.parse(JSON.stringify(l)),c=(l.sectionTitle||"Sección").toString(),d=o.sections.map(m=>m.sectionTitle||""),u=new Set(d);let f=c;if(u.has(f)){let m=2;for(;u.has(`${c} (${m})`);)m++;f=`${c} (${m})`}i.sectionTitle=f,o.sections.splice(r+1,0,i)}),addRowsBlockAt:(r,n)=>t().setSchema(o=>{const l=Math.max(0,Math.min(r,o.layout.length));o.layout.splice(l,0,JM(n))}),addTabsContainerAt:r=>t().setSchema(n=>{const o=Math.max(0,Math.min(r,n.layout.length));n.layout.splice(o,0,XM())}),moveLayoutNode:(r,n)=>t().setSchema(o=>{const l=o.layout.length;if(r<0||r>=l)return;const i=Math.max(0,Math.min(n,l-1));if(r===i)return;const c=[...o.layout],[d]=c.splice(r,1);c.splice(i,0,d),o.layout=c}),removeLayoutNode:r=>t().setSchema(n=>{if(r<0||r>=n.layout.length)return;const o=[...n.layout];o.splice(r,1),n.layout=o}),addTabsContainer:()=>t().setSchema(r=>{const n={type:"tabs",tabs:[{key:"tab1",label:"Pestaña 1",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]},{key:"tab2",label:"Pestaña 2",sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]}]};r.layout.push(n)}),addTabAfter:r=>t().setSchema(n=>{const o=qe(n,r);if(!o)return;const l=n.layout[o.nodeIdx],i="Nueva pestaña",c=new Set(l.tabs.map(m=>m.label));let d=i,u=2;for(;c.has(d);)d=`${i} (${u++})`;const f={key:`tab_${Date.now().toString(36)}`,label:d,sections:[{sectionTitle:"Sección 1",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]}]};l.tabs.splice(o.tabIdx+1,0,f)}),removeTab:r=>t().setSchema(n=>{const o=qe(n,r);if(!o)return;const l=n.layout[o.nodeIdx];l.tabs.length<=1||l.tabs.splice(o.tabIdx,1)}),renameTab:(r,n)=>t().setSchema(o=>{const l=qe(o,r);if(!l)return;const i=o.layout[l.nodeIdx];i.tabs[l.tabIdx].label=(n??"").trim()||"Pestaña"}),moveTab:(r,n,o)=>e(l=>{const i=[...l.schema.layout],c=i[r];if(!c||c.type!=="tabs")return l;const d=[...c.tabs],[u]=d.splice(n,1),f=Math.max(0,Math.min(o,d.length));return d.splice(f,0,u),i[r]={...c,tabs:d},{schema:{...l.schema,layout:i}}}),moveTabSection:(r,n,o,l)=>e(i=>{const c=[...i.schema.layout],d=c[r];if(!d||d.type!=="tabs")return i;const u=d.tabs.find(w=>w.key===n);if(!u)return i;const f=[...u.sections],[m]=f.splice(o,1),h=Math.max(0,Math.min(l,f.length));f.splice(h,0,m);const g=d.tabs.map(w=>w.key===n?{...w,sections:f}:w);return c[r]={...d,tabs:g},{schema:{...i.schema,layout:c}}}),addSectionToTab:(r,n)=>t().setSchema(o=>{const l=qe(o,r);if(!l)return;o.layout[l.nodeIdx].tabs[l.tabIdx].sections.push({sectionTitle:n??"Nueva sección",defaultOpen:!0,rows:[{title:"",columns:[{width:"w-full",fields:[]}]}]})}),addRowToTabSection:(r,n)=>t().setSchema(o=>{var c;const l=qe(o,r);if(!l)return;(c=o.layout[l.nodeIdx].tabs[l.tabIdx].sections[n])==null||c.rows.push({title:"",columns:[{width:"w-full",fields:[]}]})}),renameTabSection:(r,n,o)=>t().setSchema(l=>{const i=qe(l,r);if(!i)return;const d=l.layout[i.nodeIdx].tabs[i.tabIdx].sections[n];d&&(d.sectionTitle=(o??"").trim()||"Sección")}),setTabRowColumns:(r,n,o,l)=>t().setSchema(i=>{var g,w;const c=qe(i,r);if(!c)return;const u=(w=(g=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[n])==null?void 0:g.rows)==null?void 0:w[o];if(!u)return;const f=(u.columns??[]).flatMap(y=>y.fields??[]),m=Ja(l),h=Array.from({length:l},(y,x)=>({width:m[x],fields:[]}));f.forEach((y,x)=>h[x%l].fields.push(y)),u.columns=h}),addColumnToTabRow:(r,n,o)=>t().setSchema(l=>{var u,f;const i=qe(l,r);if(!i)return;const d=(f=(u=l.layout[i.nodeIdx].tabs[i.tabIdx].sections[n])==null?void 0:u.rows)==null?void 0:f[o];d&&d.columns.push({width:"w-1/2",fields:[]})}),removeTabColumn:(r,n,o,l)=>t().setSchema(i=>{var w,y;const c=qe(i,r);if(!c)return;const u=(y=(w=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[n])==null?void 0:w.rows)==null?void 0:y[o];if(!u)return;const f=u.columns??[];if(!f[l])return;const m=f[l],h=l>0?l-1:f[l+1]?l+1:-1,g=[...f];g.splice(l,1),h>=0&&g[h]&&(g[h].fields=[...g[h].fields??[],...m.fields??[]]),u.columns=g}),placeFieldInTabColumn:(r,n,o,l,i)=>t().setSchema(c=>{const d=qe(c,n);if(!d)return;const f=c.layout[d.nodeIdx].tabs[d.tabIdx].sections[o].rows[l].columns[i];let m=r;if(yr(c,r)){const h=c.fields.findIndex(g=>g.name===r);if(h>=0){const g=c.fields[h],{baseName:w,baseLabel:y}=ft(g),x=new Set(c.fields.map(R=>R.name).filter(Boolean)),b=new Set(c.fields.map(R=>R.label??"").filter(Boolean));m=ut(w,x);const p=gt(y,b),E=JSON.parse(JSON.stringify(g));E.name=m,E.label=p,c.fields.splice(h+1,0,E)}}f.fields=[...f.fields??[],m]}),moveFieldInTab:(r,n)=>t().setSchema(o=>{var g,w,y,x;const l=qe(o,r.tabKey);if(!l)return;const i=o.layout[l.nodeIdx],c=(w=(g=i.tabs[l.tabIdx].sections[r.s])==null?void 0:g.rows[r.r])==null?void 0:w.columns[r.c],d=(x=(y=i.tabs[l.tabIdx].sections[n.s])==null?void 0:y.rows[n.r])==null?void 0:x.columns[n.c];if(!c||!d)return;const u=[...c.fields??[]];if(r.idx<0||r.idx>=u.length)return;const[f]=u.splice(r.idx,1);c.fields=u;const m=[...d.fields??[]],h=n.idx===void 0?m.length:Math.max(0,Math.min(n.idx,m.length));m.splice(h,0,f),d.fields=m}),removeFieldFromTabLayout:r=>t().setSchema(n=>{var d,u;const o=qe(n,r.tabKey);if(!o)return;const i=(u=(d=n.layout[o.nodeIdx].tabs[o.tabIdx].sections[r.s])==null?void 0:d.rows[r.r])==null?void 0:u.columns[r.c];if(!i||!i.fields||r.idx<0||r.idx>=i.fields.length)return;const c=[...i.fields];c.splice(r.idx,1),i.fields=c}),moveRowInSection:(r,n,o)=>t().setSchema(l=>{const i=Pe(l);if(!i)return;const c=i.sections[r];if(!c)return;const d=[...c.rows];if(n<0||n>=d.length)return;const u=Math.max(0,Math.min(o,d.length-1));if(n===u)return;const[f]=d.splice(n,1);d.splice(u,0,f),c.rows=d}),duplicateRowInSection:(r,n)=>t().setSchema(o=>{const l=Pe(o);if(!l)return;const i=l.sections[r];if(!i)return;const c=i.rows[n];if(!c)return;const d=JSON.parse(JSON.stringify(c));i.rows.splice(n+1,0,d)}),removeRowFromSection:(r,n)=>t().setSchema(o=>{const l=Pe(o);if(!l)return;const i=l.sections[r];if(!i)return;const c=[...i.rows];n<0||n>=c.length||(c.splice(n,1),c.length===0&&c.push({title:"",columns:[{width:"w-full",fields:[]}]}),i.rows=c)}),setRowColumnsPreset:(r,n,o)=>t().setSchema(l=>{var u,f;const i=Pe(l);if(!i)return;const c=(f=(u=i.sections[r])==null?void 0:u.rows)==null?void 0:f[n];if(!c)return;const d=Xa[o];d&&to(c,d)}),setRowResponsive:(r,n,o)=>t().setSchema(l=>{var g,w;const i=Pe(l);if(!i)return;const c=(w=(g=i.sections[Number(r)])==null?void 0:g.rows)==null?void 0:w[Number(n)];if(!c)return;const d=Math.max(o.desktop.count??1,o.tablet.count??1,o.mobile.count??1),u=(c.columns??[]).flatMap(y=>y.fields??[]),f=no(u,d),m=(y,x,b)=>x<(b??0)?Mr((y==null?void 0:y[x])??0):null,h=Array.from({length:d},(y,x)=>{const b=m(o.mobile.widths,x,o.mobile.count),p=m(o.tablet.widths,x,o.tablet.count),E=m(o.desktop.widths,x,o.desktop.count);return{width:ro(b,p,E),fields:f[x]??[]}});c.columns=h}),setRowColumnsAt:(r,n,o,l)=>t().setSchema(i=>{var h,g;const c=Mt(i,r);if(!c)return;const d=(g=(h=c.sections[n])==null?void 0:h.rows)==null?void 0:g[o];if(!d)return;const u=(d.columns??[]).flatMap(w=>w.fields??[]),f=Ja(l),m=Array.from({length:l},(w,y)=>({width:f[y],fields:[]}));u.forEach((w,y)=>m[y%l].fields.push(w)),d.columns=m}),addColumnToRowAt:(r,n,o)=>t().setSchema(l=>{var c,d,u,f;const i=Mt(l,r);i&&((f=(u=(d=(c=i.sections[n])==null?void 0:c.rows)==null?void 0:d[o])==null?void 0:u.columns)==null||f.push({width:"w-1/2",fields:[]}))}),removeColumnAt:(r,n,o,l)=>t().setSchema(i=>{var g,w;const c=Mt(i,r);if(!c)return;const d=(w=(g=c.sections[n])==null?void 0:g.rows)==null?void 0:w[o];if(!d)return;const u=d.columns??[];if(!u[l])return;const f=u[l],m=l>0?l-1:u[l+1]?l+1:-1,h=[...u];h.splice(l,1),m>=0&&h[m]&&(h[m].fields=[...h[m].fields??[],...f.fields??[]]),d.columns=h}),setRowColumnsPresetAt:(r,n,o,l)=>t().setSchema(i=>{var f,m;const c=Mt(i,r);if(!c)return;const d=(m=(f=c.sections[n])==null?void 0:f.rows)==null?void 0:m[o];if(!d)return;const u=Xa[l];u&&to(d,u)}),setRowResponsiveAt:(r,n,o,l)=>t().setSchema(i=>{var w,y;const c=Mt(i,r);if(!c)return;const d=(y=(w=c.sections[Number(n)])==null?void 0:w.rows)==null?void 0:y[Number(o)];if(!d)return;const u=Math.max(l.desktop.count??1,l.tablet.count??1,l.mobile.count??1),f=(x,b,p)=>b<(p??0)?Mr((x==null?void 0:x[b])??0):null,m=eA(d,u),h=m.flatMap(x=>x.fields??[]),g=no(h,u);for(let x=0;x<u;x++){const b=f(l.mobile.widths,x,l.mobile.count),p=f(l.tablet.widths,x,l.tablet.count),E=f(l.desktop.widths,x,l.desktop.count);m[x].width=ro(b,p,E),m[x].fields=g[x]??[]}}),placeFieldInColumnAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var w,y,x,b;const u=Mt(d,r);if(!u)return;const f=(b=(x=(y=(w=u.sections[o])==null?void 0:w.rows)==null?void 0:y[l])==null?void 0:x.columns)==null?void 0:b[i];if(!f)return;let m=n;if(yr(d,n)){const p=d.fields.findIndex(E=>E.name===n);if(p>=0){const E=d.fields[p],{baseName:R,baseLabel:j}=ft(E),A=new Set(d.fields.map(S=>S.name).filter(Boolean)),L=new Set(d.fields.map(S=>S.label??"").filter(Boolean));m=ut(R,A);const F=gt(j,L),V=JSON.parse(JSON.stringify(E));V.name=m,V.label=F,d.fields.splice(p+1,0,V)}}const h=[...f.fields??[]],g=c===void 0?h.length:Math.max(0,Math.min(c,h.length));h.splice(g,0,m),f.fields=h}),moveFieldAt:(r,n,o,l)=>t().setSchema(i=>{var y,x,b,p,E,R,j,A;const c=Mt(i,r),d=Mt(i,o);if(!c||!d)return;const u=(p=(b=(x=(y=c.sections[n.s])==null?void 0:y.rows)==null?void 0:x[n.r])==null?void 0:b.columns)==null?void 0:p[n.c],f=(A=(j=(R=(E=d.sections[l.s])==null?void 0:E.rows)==null?void 0:R[l.r])==null?void 0:j.columns)==null?void 0:A[l.c];if(!u||!f)return;const m=[...u.fields??[]];if(n.idx<0||n.idx>=m.length)return;const[h]=m.splice(n.idx,1);u.fields=m;const g=[...f.fields??[]],w=l.idx===void 0?g.length:Math.max(0,Math.min(l.idx,g.length));g.splice(w,0,h),f.fields=g}),removeFieldFromLayoutAt:(r,n)=>t().setSchema(o=>{var d,u,f,m;const l=Mt(o,r);if(!l)return;const i=(m=(f=(u=(d=l.sections[n.s])==null?void 0:d.rows)==null?void 0:u[n.r])==null?void 0:f.columns)==null?void 0:m[n.c];if(!i||!i.fields||n.idx<0||n.idx>=i.fields.length)return;const c=[...i.fields];c.splice(n.idx,1),i.fields=c}),insertExistingFieldAtAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var w,y,x,b;const u=Mt(d,r);if(!u)return;const f=(b=(x=(y=(w=u.sections[o])==null?void 0:w.rows)==null?void 0:y[l])==null?void 0:x.columns)==null?void 0:b[i];if(!f)return;let m=n;if(yr(d,n)){const p=d.fields.findIndex(E=>E.name===n);if(p>=0){const E=d.fields[p],{baseName:R,baseLabel:j}=ft(E),A=new Set(d.fields.map(H=>H.name).filter(Boolean)),L=new Set(d.fields.map(H=>H.label??"").filter(Boolean)),F=ut(R,A),V=gt(j,L),S=JSON.parse(JSON.stringify(E));S.name=F,S.label=V,d.fields.splice(p+1,0,S),m=F}}const h=[...f.fields??[]],g=Math.max(0,Math.min(c,h.length));h.splice(g,0,m),f.fields=h}),addFieldAndPlaceAtAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var R,j,A,L;const{baseName:u,baseLabel:f}=ft(n),m=new Set(d.fields.map(F=>F.name).filter(Boolean)),h=new Set(d.fields.map(F=>F.label??"").filter(Boolean)),g=ut(u,m),w=gt(f,h),y=JSON.parse(JSON.stringify(n));y.name=g,y.label||(y.label=w),d.fields.push(y);const x=Mt(d,r);if(!x)return;const b=(L=(A=(j=(R=x.sections[o])==null?void 0:R.rows)==null?void 0:j[l])==null?void 0:A.columns)==null?void 0:L[i];if(!b)return;const p=[...b.fields??[]],E=Math.max(0,Math.min(c,p.length));p.splice(E,0,g),b.fields=p}),setTabRowResponsive:(r,n,o,l)=>t().setSchema(i=>{var y,x;const c=qe(i,r);if(!c)return;const u=(x=(y=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[Number(n)])==null?void 0:y.rows)==null?void 0:x[Number(o)];if(!u)return;const f=Math.max(l.desktop.count??1,l.tablet.count??1,l.mobile.count??1),m=(u.columns??[]).flatMap(b=>b.fields??[]),h=no(m,f),g=(b,p,E)=>p<(E??0)?Mr((b==null?void 0:b[p])??0):null,w=Array.from({length:f},(b,p)=>{const E=g(l.mobile.widths,p,l.mobile.count),R=g(l.tablet.widths,p,l.tablet.count),j=g(l.desktop.widths,p,l.desktop.count);return{width:ro(E,R,j),fields:h[p]??[]}});u.columns=w}),moveTabRow:(r,n,o,l)=>t().setSchema(i=>{const c=qe(i,r);if(!c)return;const u=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[n];if(!u)return;const f=[...u.rows];if(o<0||o>=f.length)return;const m=Math.max(0,Math.min(l,f.length-1));if(o===m)return;const[h]=f.splice(o,1);f.splice(m,0,h),u.rows=f}),duplicateTabRow:(r,n,o)=>t().setSchema(l=>{const i=qe(l,r);if(!i)return;const d=l.layout[i.nodeIdx].tabs[i.tabIdx].sections[n];if(!d)return;const u=d.rows[o];if(!u)return;const f=JSON.parse(JSON.stringify(u));d.rows.splice(o+1,0,f)}),removeTabRow:(r,n,o)=>t().setSchema(l=>{const i=qe(l,r);if(!i)return;const d=l.layout[i.nodeIdx].tabs[i.tabIdx].sections[n];if(!d)return;const u=[...d.rows];o<0||o>=u.length||(u.splice(o,1),u.length===0&&u.push({title:"",columns:[{width:"w-full",fields:[]}]}),d.rows=u)}),setTabRowColumnsPreset:(r,n,o,l)=>t().setSchema(i=>{var m,h;const c=qe(i,r);if(!c)return;const u=(h=(m=i.layout[c.nodeIdx].tabs[c.tabIdx].sections[n])==null?void 0:m.rows)==null?void 0:h[o];if(!u)return;const f=Xa[l];f&&to(u,f)}),addRowToSection:r=>t().setSchema(n=>{const o=Pe(n);o&&o.sections[r].rows.push({title:"",columns:[{width:"w-full",fields:[]}]})}),addRowToSectionAt:(r,n)=>t().setSchema(o=>{const l=Pe(o);if(!l)return;const i=l.sections[r];if(!i)return;const c=[...i.rows??[]],d=Math.max(0,Math.min(n,c.length));c.splice(d,0,{title:"",columns:[{width:"w-full",fields:[]}]}),i.rows=c}),addColumnToRow:(r,n)=>t().setSchema(o=>{const l=Pe(o);l&&l.sections[r].rows[n].columns.push({width:"w-1/2",fields:[]})}),setRowColumns:(r,n,o)=>t().setSchema(l=>{const i=Pe(l);if(!i)return;const c=i.sections[r].rows[n],d=(c.columns??[]).flatMap(m=>m.fields??[]),u=Ja(o),f=Array.from({length:o},(m,h)=>({width:u[h],fields:[]}));d.forEach((m,h)=>f[h%o].fields.push(m)),c.columns=f}),removeColumn:(r,n,o)=>t().setSchema(l=>{const i=Pe(l);if(!i)return;const c=i.sections[r].rows[n],d=c.columns??[];if(!d[o])return;const u=d[o],f=o>0?o-1:d[o+1]?o+1:-1,m=[...d];m.splice(o,1),f>=0&&m[f]&&(m[f].fields=[...m[f].fields??[],...u.fields??[]]),c.columns=m}),placeFieldInColumn:(r,n,o,l)=>t().setSchema(i=>{const c=Pe(i);if(!c)return;const d=c.sections[n].rows[o].columns[l];let u=r;if(yr(i,r)){const f=i.fields.findIndex(m=>m.name===r);if(f>=0){const m=i.fields[f],{baseName:h,baseLabel:g}=ft(m),w=new Set(i.fields.map(E=>E.name).filter(Boolean)),y=new Set(i.fields.map(E=>E.label??"").filter(Boolean)),x=ut(h,w),b=gt(g,y),p=JSON.parse(JSON.stringify(m));p.name=x,p.label=b,i.fields.splice(f+1,0,p),u=x}}d.fields=[...d.fields??[],u]}),moveField:(r,n)=>t().setSchema(o=>{var h,g,w,y;const l=Pe(o);if(!l)return;const i=(g=(h=l.sections[r.s])==null?void 0:h.rows[r.r])==null?void 0:g.columns[r.c],c=(y=(w=l.sections[n.s])==null?void 0:w.rows[n.r])==null?void 0:y.columns[n.c];if(!i||!c)return;const d=[...i.fields??[]];if(r.idx<0||r.idx>=d.length)return;const[u]=d.splice(r.idx,1);i.fields=d;const f=[...c.fields??[]],m=n.idx===void 0?f.length:Math.max(0,Math.min(n.idx,f.length));f.splice(m,0,u),c.fields=f}),removeFieldFromLayout:r=>t().setSchema(n=>{var c,d;const o=Pe(n);if(!o)return;const l=(d=(c=o.sections[r.s])==null?void 0:c.rows[r.r])==null?void 0:d.columns[r.c];if(!l||!l.fields||r.idx<0||r.idx>=l.fields.length)return;const i=[...l.fields];i.splice(r.idx,1),l.fields=i}),addFieldAndPlace:(r,n,o,l)=>t().setSchema(i=>{const{baseName:c,baseLabel:d}=ft(r),u=new Set(i.fields.map(x=>x.name).filter(Boolean)),f=new Set(i.fields.map(x=>x.label??"").filter(Boolean)),m=ut(c,u),h=gt(d,f),g=JSON.parse(JSON.stringify(r));g.name=m,g.label||(g.label=h),i.fields.push(g);const w=Pe(i);if(!w)return;const y=w.sections[n].rows[o].columns[l];y.fields=[...y.fields??[],m]}),moveFieldWithinColumn:(r,n,o,l,i)=>t().setSchema(c=>{var g,w,y,x;const d=Pe(c);if(!d)return;const u=(x=(y=(w=(g=d.sections[r])==null?void 0:g.rows)==null?void 0:w[n])==null?void 0:y.columns)==null?void 0:x[o];if(!u)return;const f=[...u.fields??[]];if(l<0||l>=f.length)return;const[m]=f.splice(l,1),h=Math.max(0,Math.min(i,f.length));f.splice(h,0,m),u.fields=f}),insertExistingFieldAt:(r,n,o,l,i)=>t().setSchema(c=>{var g,w,y,x;const d=Pe(c);if(!d)return;const u=(x=(y=(w=(g=d.sections[n])==null?void 0:g.rows)==null?void 0:w[o])==null?void 0:y.columns)==null?void 0:x[l];if(!u)return;let f=r;if(yr(c,r)){const b=c.fields.findIndex(p=>p.name===r);if(b>=0){const p=c.fields[b],{baseName:E,baseLabel:R}=ft(p),j=new Set(c.fields.map(S=>S.name).filter(Boolean)),A=new Set(c.fields.map(S=>S.label??"").filter(Boolean)),L=ut(E,j),F=gt(R,A),V=JSON.parse(JSON.stringify(p));V.name=L,V.label=F,c.fields.splice(b+1,0,V),f=L}}const m=[...u.fields??[]],h=Math.max(0,Math.min(i,m.length));m.splice(h,0,f),u.fields=m}),addFieldAndPlaceAt:(r,n,o,l,i)=>t().setSchema(c=>{var E,R,j,A;const{baseName:d,baseLabel:u}=ft(r),f=new Set(c.fields.map(L=>L.name).filter(Boolean)),m=new Set(c.fields.map(L=>L.label??"").filter(Boolean)),h=ut(d,f),g=gt(u,m),w=JSON.parse(JSON.stringify(r));w.name=h,w.label||(w.label=g),c.fields.push(w);const y=Pe(c);if(!y)return;const x=(A=(j=(R=(E=y.sections[n])==null?void 0:E.rows)==null?void 0:R[o])==null?void 0:j.columns)==null?void 0:A[l];if(!x)return;const b=[...x.fields??[]],p=Math.max(0,Math.min(i,b.length));b.splice(p,0,h),x.fields=b}),moveFieldWithinTab:(r,n,o,l,i,c)=>t().setSchema(d=>{var w,y,x,b;const u=qe(d,r);if(!u)return;const f=(b=(x=(y=(w=d.layout[u.nodeIdx].tabs[u.tabIdx].sections[n])==null?void 0:w.rows)==null?void 0:y[o])==null?void 0:x.columns)==null?void 0:b[l];if(!f)return;const m=[...f.fields??[]];if(i<0||i>=m.length)return;const[h]=m.splice(i,1),g=Math.max(0,Math.min(c,m.length));m.splice(g,0,h),f.fields=m}),insertExistingFieldInTabAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var w,y,x,b;const u=qe(d,n);if(!u)return;const f=(b=(x=(y=(w=d.layout[u.nodeIdx].tabs[u.tabIdx].sections[o])==null?void 0:w.rows)==null?void 0:y[l])==null?void 0:x.columns)==null?void 0:b[i];if(!f)return;let m=r;if(yr(d,r)){const p=d.fields.findIndex(E=>E.name===r);if(p>=0){const E=d.fields[p],{baseName:R,baseLabel:j}=ft(E),A=new Set(d.fields.map(H=>H.name).filter(Boolean)),L=new Set(d.fields.map(H=>H.label??"").filter(Boolean)),F=ut(R,A),V=gt(j,L),S=JSON.parse(JSON.stringify(E));S.name=F,S.label=V,d.fields.splice(p+1,0,S),m=F}}const h=[...f.fields??[]],g=Math.max(0,Math.min(c,h.length));h.splice(g,0,m),f.fields=h}),addFieldAndPlaceInTabAt:(r,n,o,l,i,c)=>t().setSchema(d=>{var R,j,A,L;const u=qe(d,n);if(!u)return;const{baseName:f,baseLabel:m}=ft(r),h=new Set(d.fields.map(F=>F.name).filter(Boolean)),g=new Set(d.fields.map(F=>F.label??"").filter(Boolean)),w=ut(f,h),y=gt(m,g),x=JSON.parse(JSON.stringify(r));x.name=w,x.label||(x.label=y),d.fields.push(x);const b=(L=(A=(j=(R=d.layout[u.nodeIdx].tabs[u.tabIdx].sections[o])==null?void 0:R.rows)==null?void 0:j[l])==null?void 0:A.columns)==null?void 0:L[i];if(!b)return;const p=[...b.fields??[]],E=Math.max(0,Math.min(c,p.length));p.splice(E,0,w),b.fields=p}),changeFieldType:(r,n)=>t().setSchema(o=>{const l=o.fields.findIndex(u=>u.name===r);if(l<0)return;const i=o.fields[l],d={...{name:i.name,label:i.label,width:i.width,size:i.size,info:i.info,disabled:i.disabled,visibleWhen:i.visibleWhen,disabledWhen:i.disabledWhen,clearWhen:i.clearWhen,validation:i.validation,placeholder:i.placeholder},type:n};switch(n){case"text":case"email":case"password":case"number":break;case"textarea":d.maxLength=i.maxLength??void 0,d.showCounter=i.showCounter??!1;break;case"select":d.options=Array.isArray(i.options)?i.options:[],d.multiple=!!i.multiple,d.loadOptions=i.loadOptions??void 0;break;case"checkbox":d.defaultValue=!!i.defaultValue,delete d.placeholder;break;case"date":d.showTime=!!i.showTime;break;case"file":d.maxFiles=i.maxFiles??1,d.accept=i.accept??"",delete d.placeholder;break}n!=="select"&&(delete d.options,delete d.multiple,delete d.loadOptions),n!=="textarea"&&(delete d.maxLength,delete d.showCounter),n!=="checkbox"&&delete d.defaultValue,n!=="date"&&delete d.showTime,n!=="file"&&(delete d.maxFiles,delete d.accept),o.fields[l]=d}),moveSectionAcrossNodes:(r,n,o,l)=>t().setSchema(i=>{const c=i.layout[r],d=i.layout[o];if(!c||c.type!=="rows"||!d||d.type!=="rows")return;const u=[...c.sections??[]];if(n<0||n>=u.length)return;const[f]=u.splice(n,1);c.sections=u;const m=[...d.sections??[]],h=Math.max(0,Math.min(l??m.length,m.length));m.splice(h,0,f),d.sections=m}),armFieldPick:(r,n)=>e(o=>({...o,fieldPick:{armed:!0,forField:r,fieldKey:n}})),cancelFieldPick:()=>e(r=>({...r,fieldPick:{armed:!1}})),completeFieldPick:r=>{const{fieldPick:n}=t();if(!n.armed||!n.forField||!n.fieldKey){e(o=>({...o,fieldPick:{armed:!1}}));return}t().setSchema(o=>{const l=o.fields.findIndex(f=>f.name===n.forField);if(l<0)return;const i=o.fields[l],c=n.fieldKey,d=i[c]??{};let u=d.rule??{op:"eq",field:r,value:!0};u={...u,field:r},i[c]={...d??{},enabled:!0,rule:u}}),e(o=>({...o,fieldPick:{armed:!1}}))},placeFieldInInputGroup:(r,n,o)=>e(l=>{const i=l.schema,c=[...i.fields],d=eo(c,n);if(!Qa(d))return l;const u=Array.isArray(d.inputs)?[...d.inputs]:[];if(u.some(w=>typeof w=="string"?w===r:w.name===r))return l;const f=typeof o=="number"?Ll(o,u.length):u.length;u.splice(f,0,r);const m=Jn(c,n),h={...d,inputs:u},g=[...c];return g.splice(m,1,h),{schema:{...i,fields:g}}}),moveFieldWithinInputGroup:(r,n,o)=>e(l=>{const i=l.schema,c=[...i.fields],d=eo(c,r);if(!Qa(d)||!Array.isArray(d.inputs))return l;const u=[...d.inputs];if(n<0||n>=u.length)return l;const f=Ll(o,u.length),[m]=u.splice(n,1),h=f>n?f-1:f;u.splice(h,0,m);const g=Jn(c,r),w={...d,inputs:u},y=[...c];return y.splice(g,1,w),{schema:{...i,fields:y}}}),removeFieldFromInputGroup:(r,n)=>e(o=>{const l=o.schema,i=[...l.fields],c=eo(i,r);if(!Qa(c)||!Array.isArray(c.inputs))return o;const d=[...c.inputs];if(n<0||n>=d.length)return o;d.splice(n,1);const u=Jn(i,r),f={...c,inputs:d},m=[...i];return m.splice(u,1,f),{schema:{...l,fields:m}}})}));function to(e,t){const r=(e.columns??[]).flatMap(l=>l.fields??[]),n=t.length,o=t.map(l=>({width:l,fields:[]}));r.forEach((l,i)=>o[i%n].fields.push(l)),e.columns=o}function ro(e,t,r){const n=[];return e===null?n.push("hidden"):n.push(`w-[${Ya(Mr(e))}%]`,"block"),t===null?n.push("md:hidden"):n.push(`md:w-[${Ya(Mr(t))}%]`,"md:block"),r===null?n.push("lg:hidden"):n.push(`lg:w-[${Ya(Mr(r))}%]`,"lg:block"),n.join(" ")}function eA(e,t){const r=e.columns??[];if(r.length===t)return r;if(r.length<t){const o=t-r.length,l=[...r];for(let i=0;i<o;i++)l.push({width:"w-[100%]",fields:[]});return e.columns=l,l}const n=r.slice(0,t);for(let o=t;o<r.length;o++)n[t-1].fields=[...n[t-1].fields??[],...r[o].fields??[]];return e.columns=n,n}function no(e,t){const r=Array.from({length:t},()=>[]);return e.forEach((n,o)=>r[o%t].push(n)),r}const tA=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:K},Symbol.toStringTag,{value:"Module"}));function rA(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return v.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Sa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ir(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function bs(e){return"nodeType"in e}function it(e){var t,r;return e?Ir(e)?e:bs(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function xs(e){const{Document:t}=it(e);return e instanceof t}function yn(e){return Ir(e)?!1:e instanceof it(e).HTMLElement}function i5(e){return e instanceof it(e).SVGElement}function Zr(e){return e?Ir(e)?e.document:bs(e)?xs(e)?e:yn(e)||i5(e)?e.ownerDocument:document:document:document}const Nt=Sa?v.useLayoutEffect:v.useEffect;function $a(e){const t=v.useRef(e);return Nt(()=>{t.current=e}),v.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function nA(){const e=v.useRef(null),t=v.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function dn(e,t){t===void 0&&(t=[e]);const r=v.useRef(e);return Nt(()=>{r.current!==e&&(r.current=e)},t),r}function En(e,t){const r=v.useRef();return v.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function fa(e){const t=$a(e),r=v.useRef(null),n=v.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function ma(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let ao={};function kn(e,t){return v.useMemo(()=>{if(t)return t;const r=ao[e]==null?0:ao[e]+1;return ao[e]=r,e+"-"+r},[e,t])}function c5(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((l,i)=>{const c=Object.entries(i);for(const[d,u]of c){const f=l[d];f!=null&&(l[d]=f+e*u)}return l},{...t})}}const Ar=c5(1),un=c5(-1);function aA(e){return"clientX"in e&&"clientY"in e}function La(e){if(!e)return!1;const{KeyboardEvent:t}=it(e.target);return t&&e instanceof t}function oA(e){if(!e)return!1;const{TouchEvent:t}=it(e.target);return t&&e instanceof t}function ha(e){if(oA(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return aA(e)?{x:e.clientX,y:e.clientY}:null}const Xt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Xt.Translate.toString(e),Xt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Ol="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function sA(e){return e.matches(Ol)?e:e.querySelector(Ol)}const lA={display:"none"};function iA(e){let{id:t,value:r}=e;return v.createElement("div",{id:t,style:lA},r)}function cA(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return v.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function dA(){const[e,t]=v.useState("");return{announce:v.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const d5=v.createContext(null);function Rn(e){const t=v.useContext(d5);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function uA(){const[e]=v.useState(()=>new Set),t=v.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[v.useCallback(n=>{let{type:o,event:l}=n;e.forEach(i=>{var c;return(c=i[o])==null?void 0:c.call(i,l)})},[e]),t]}const fA={draggable:`
78
78
  To pick up a draggable item, press the space bar.
79
79
  While dragging, use the arrow keys to move the item.
80
80
  Press space again to drop the item in its new position, or press escape to cancel.