@zauru-sdk/components 6.19.0 → 6.19.1

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/assets/{Alerts.stories-CSBQ8R_t.js → Alerts.stories-Dw0Ct9vA.js} +1 -1
  3. package/build/assets/{Button-HdDVNit0.js → Button-YPU2MaHD.js} +1 -1
  4. package/build/assets/{Button.stories-4PbdRo1_.js → Button.stories-CP6jmzaX.js} +1 -1
  5. package/build/assets/{Card.stories-QwjOcKTY.js → Card.stories-DbFqLafy.js} +1 -1
  6. package/build/assets/{Container.stories-pWk2cF23.js → Container.stories-BhnM3_6Y.js} +1 -1
  7. package/build/assets/{Form.stories-lVdn9hAH.js → Form.stories-BNB6SmSx.js} +1 -1
  8. package/build/assets/{Icons-DjqYUpg9.js → Icons-BxLN_JWC.js} +1 -1
  9. package/build/assets/{Labels.stories-FX8D89vw.js → Labels.stories-Fah6wLSi.js} +1 -1
  10. package/build/assets/Matrix.stories-Dc3-VDms.js +1 -0
  11. package/build/assets/{Modal.stories-CgG40zUJ.js → Modal.stories-D7kIP3bJ.js} +1 -1
  12. package/build/assets/{NavBar.stories-BPC2tPzi.js → NavBar.stories-DuIgKZkc.js} +1 -1
  13. package/build/assets/SidePanel.stories-Xsm8Md4K.js +1 -0
  14. package/build/assets/{Tab.stories-qL5aJzJZ.js → Tab.stories-RKI0m-pt.js} +1 -1
  15. package/build/assets/{Table.stories-JhlKDwAx.js → Table.stories-CGj0WWPk.js} +1 -1
  16. package/build/assets/{Titles.stories-BIaWnH29.js → Titles.stories-CPIRDaJs.js} +1 -1
  17. package/build/assets/{Tooltip.stories-iBejLWUg.js → Tooltip.stories-D8M6F7St.js} +1 -1
  18. package/build/assets/{axe-VDwKxXpa.js → axe-sLlwVNub.js} +1 -1
  19. package/build/assets/{components-TO4aWqdC.js → components-FzdPzEyL.js} +1 -1
  20. package/build/assets/{index-DxYjnckq.js → index-DUSjZECW.js} +3 -3
  21. package/build/assets/{index-TgOqmrBM.js → index-DonOhaBM.js} +1 -1
  22. package/build/assets/{proxy-DgkUxN7K.js → proxy-BETbFm71.js} +1 -1
  23. package/build/index.html +1 -1
  24. package/dist/esm/Matrix/CheckMatrixCards.js +2 -1
  25. package/dist/esm/SidePanel/index.js +6 -0
  26. package/package.json +2 -2
  27. package/src/Matrix/CheckMatrixCards.tsx +2 -1
  28. package/src/SidePanel/index.tsx +5 -0
  29. package/build/assets/Matrix.stories-Cxd7sZW4.js +0 -1
  30. package/build/assets/SidePanel.stories-Atykcy9h.js +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.19.1](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.19.0...@zauru-sdk/components@6.19.1) (2026-10-31)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **components:** conservar estado responsive accesible ([7ba1a9b](https://github.com/intuitiva/zauru-typescript-sdk/commit/7ba1a9be4f6a417e0162dab0999a6f244d965793))
12
+
13
+
14
+
15
+
16
+
6
17
  # [6.19.0](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.18.1...@zauru-sdk/components@6.19.0) (2026-10-31)
7
18
 
8
19
 
@@ -1 +1 @@
1
- import{j as e}from"./index-DxYjnckq.js";const d=s=>{switch(s){case"info":return{containerClassName:"text-blue-900 bg-blue-100 border border-blue-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",path:e.jsx("path",{d:"M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"})};case"success":return{containerClassName:"text-green-900 bg-green-100 border border-green-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",path:e.jsx("path",{d:"M8.445 12.6675A.9.9 0 0 0 7.1424 13.91l2.5726 2.7448c.3679.3856.9884.3689 1.335-.036l5.591-7.0366a.9.9 0 0 0-1.3674-1.1705l-4.6548 5.9132a.4.4 0 0 1-.607.0252l-1.567-1.6826zM1.9995 12c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z"})};case"warning":return{containerClassName:"text-yellow-900 bg-yellow-100 border border-yellow-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-yellow-500",path:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm.93 14.93h-1.86c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h1.86c.41 0 .75.34.75.75s-.34.75-.75.75zm.57-4.42l-.57 2.36h-1.86l-.57-2.36c-.13-.54.21-1.08.76-1.08h1.48c.55 0 .88.54.76 1.08zm0-2.36h-2.58c-.55 0-.88-.54-.76-1.08l.57-2.36h1.86l.57 2.36c.12.54-.21 1.08-.76 1.08z"})};default:return{containerClassName:"text-blue-900 bg-blue-100 border border-blue-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",path:e.jsx("path",{d:"M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"})}}},t=s=>{const{className:c,title:l,description:r,onClose:o,type:a="info",loading:i=!1}=s,n=d(a);return e.jsx("div",{className:`${c} ${n.containerClassName} ${i?" hidden":""}`,children:e.jsxs("div",{className:"flex justify-between flex-wrap",children:[e.jsxs("div",{className:"w-0 flex-1 flex",children:[e.jsx("div",{className:"mr-3 pt-1",children:e.jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:n.path})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-md leading-6 font-medium",children:l}),e.jsx("div",{className:"text-sm",children:r})]})]}),o&&e.jsx("div",{children:e.jsx("button",{type:"button",className:`${n.buttonClassName}`,onClick:o,children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:e.jsx("path",{d:"M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z"})})})})]})})},m=()=>e.jsx(t,{title:"Información",description:"Mensaje informativo.",type:"info"}),h=()=>e.jsx(t,{title:"Listo",description:"La operación se completó.",type:"success"}),x=()=>e.jsx(t,{title:"Atención",description:"Hay datos pendientes de revisar.",type:"warning"});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{m as Info,h as Success,x as Warning};
1
+ import{j as e}from"./index-DUSjZECW.js";const d=s=>{switch(s){case"info":return{containerClassName:"text-blue-900 bg-blue-100 border border-blue-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",path:e.jsx("path",{d:"M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"})};case"success":return{containerClassName:"text-green-900 bg-green-100 border border-green-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",path:e.jsx("path",{d:"M8.445 12.6675A.9.9 0 0 0 7.1424 13.91l2.5726 2.7448c.3679.3856.9884.3689 1.335-.036l5.591-7.0366a.9.9 0 0 0-1.3674-1.1705l-4.6548 5.9132a.4.4 0 0 1-.607.0252l-1.567-1.6826zM1.9995 12c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z"})};case"warning":return{containerClassName:"text-yellow-900 bg-yellow-100 border border-yellow-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-yellow-500",path:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm.93 14.93h-1.86c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h1.86c.41 0 .75.34.75.75s-.34.75-.75.75zm.57-4.42l-.57 2.36h-1.86l-.57-2.36c-.13-.54.21-1.08.76-1.08h1.48c.55 0 .88.54.76 1.08zm0-2.36h-2.58c-.55 0-.88-.54-.76-1.08l.57-2.36h1.86l.57 2.36c.12.54-.21 1.08-.76 1.08z"})};default:return{containerClassName:"text-blue-900 bg-blue-100 border border-blue-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",path:e.jsx("path",{d:"M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"})}}},t=s=>{const{className:c,title:l,description:r,onClose:o,type:a="info",loading:i=!1}=s,n=d(a);return e.jsx("div",{className:`${c} ${n.containerClassName} ${i?" hidden":""}`,children:e.jsxs("div",{className:"flex justify-between flex-wrap",children:[e.jsxs("div",{className:"w-0 flex-1 flex",children:[e.jsx("div",{className:"mr-3 pt-1",children:e.jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:n.path})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-md leading-6 font-medium",children:l}),e.jsx("div",{className:"text-sm",children:r})]})]}),o&&e.jsx("div",{children:e.jsx("button",{type:"button",className:`${n.buttonClassName}`,onClick:o,children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:e.jsx("path",{d:"M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z"})})})})]})})},m=()=>e.jsx(t,{title:"Información",description:"Mensaje informativo.",type:"info"}),h=()=>e.jsx(t,{title:"Listo",description:"La operación se completó.",type:"success"}),x=()=>e.jsx(t,{title:"Atención",description:"Hay datos pendientes de revisar.",type:"warning"});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{m as Info,h as Success,x as Warning};
@@ -1 +1 @@
1
- import{r as a,u as O,j as e}from"./index-DxYjnckq.js";const M=150,T=200,R=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=({option:s,onLeafClick:y})=>{var h,v;const r=!!((h=s.children)!=null&&h.length),[b,t]=a.useState(!1),d=a.useRef(null),g=a.useRef(null),f=()=>{d.current!=null&&(window.clearTimeout(d.current),d.current=null),g.current!=null&&(window.clearTimeout(g.current),g.current=null)};a.useEffect(()=>()=>{f()},[]);const i=(n=!1)=>{if(r){if(f(),n||R()){t(!0);return}d.current=window.setTimeout(()=>{t(!0)},M)}},p=(n=!1)=>{if(f(),n||R()){t(!1);return}g.current=window.setTimeout(()=>{t(!1)},T)},N=()=>{var n;if(r){t(c=>!c);return}(n=s.onClick)==null||n.call(s),y()},w=n=>{r&&((n.key==="ArrowRight"||n.key==="Enter")&&(n.preventDefault(),i(!0)),(n.key==="ArrowLeft"||n.key==="Escape")&&(n.preventDefault(),p(!0)))};return e.jsxs("div",{className:"relative",onMouseEnter:()=>i(),onMouseLeave:()=>p(),children:[e.jsxs("button",{type:"button",role:"menuitem","aria-haspopup":r?"menu":void 0,"aria-expanded":r?b:void 0,onClick:N,onKeyDown:w,className:"flex w-full cursor-pointer items-center justify-between gap-2 px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:ring-2 focus:ring-indigo-500 focus:ring-inset motion-reduce:transition-none",children:[e.jsx("span",{children:s.label}),r?e.jsx("svg",{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}):null]}),r&&b?e.jsx("div",{role:"menu",className:"absolute right-full top-0 z-20 mr-1 w-56 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:(v=s.children)==null?void 0:v.map(n=>e.jsx($,{option:n,onLeafClick:y},n.value))}):null]})},z=s=>{const{type:y="submit",loading:r=!1,loadingText:b="Guardando...",title:t="Guardar",name:d="save",onClickSave:g,selectedColor:f="indigo",children:i,className:p="",disabled:N=!1,enableFormErrorsValidation:w=!1,enableFormErrorsDescriptions:C=!1,dropdownOptions:h=[],dropdownTitle:v}=s,[n,c]=a.useState(!1),k=a.useRef(null),j=O(),E=j?!j.formState.isValid:!1,D=j?j.formState.errors:{},u={green:{bg900:"bg-green-900",bg700:"bg-green-700",bg600:"bg-green-600",bg500:"bg-green-500",bg200:"bg-green-200",ring600:"ring-green-600",ring500:"ring-green-500"},indigo:{bg900:"bg-indigo-900",bg700:"bg-indigo-700",bg600:"bg-indigo-600",bg500:"bg-indigo-500",bg200:"bg-indigo-200",ring600:"ring-indigo-600",ring500:"ring-indigo-500"},red:{bg900:"bg-red-900",bg700:"bg-red-700",bg600:"bg-red-600",bg500:"bg-red-500",bg200:"bg-red-200",ring600:"ring-red-600",ring500:"ring-red-500"},yellow:{bg900:"bg-yellow-900",bg700:"bg-yellow-700",bg600:"bg-yellow-600",bg500:"bg-yellow-500",bg200:"bg-yellow-200",ring600:"ring-yellow-600",ring500:"ring-yellow-500"},gray:{bg900:"bg-gray-900",bg700:"bg-gray-700",bg600:"bg-gray-600",bg500:"bg-gray-500",bg200:"bg-gray-200",ring600:"ring-gray-600",ring500:"ring-gray-500"}}[f],m=E?Object.values(D).map(o=>{var x;return(x=o==null?void 0:o.message)==null?void 0:x.toString()}).join(", "):"";a.useEffect(()=>{const o=S=>{k.current&&!k.current.contains(S.target)&&c(!1)},x=S=>{S.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",x)}},[]);const l=r||N||w&&E;if(!(h.length>0)){const o=e.jsx("button",{type:y,name:"action",value:d,disabled:l,onClick:g,className:`${l?" bg-opacity-25 ":""} ${r?" cursor-progress":`${l?" cursor-not-allowed":`cursor-pointer hover:${u.bg700}`}`} inline-flex justify-center rounded-md border border-transparent ${u.bg600} py-2 px-4 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:${u.ring500} focus:ring-offset-2 ${p}`,children:r?i??b:i??t});return e.jsxs(e.Fragment,{children:[w&&E&&m||C&&m?e.jsx("div",{className:"flex flex-col items-end mb-2",children:e.jsx("div",{className:"p-2 bg-red-100 border border-red-400 text-red-700 rounded-md shadow-sm",children:e.jsx("p",{className:"text-sm",children:m})})}):null,o]})}const L=e.jsxs("div",{className:"relative inline-block text-left",ref:k,children:[e.jsx("div",{children:e.jsxs("button",{type:"button",disabled:l,"aria-haspopup":"menu","aria-expanded":n,onClick:()=>c(!n),className:`${l?" bg-opacity-25 ":""} ${r?" cursor-progress":`${l?" cursor-not-allowed":`cursor-pointer hover:${u.bg700}`}`} inline-flex justify-center items-center rounded-md border border-transparent ${u.bg600} py-2 px-4 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:${u.ring500} focus:ring-offset-2 ${p}`,children:[r?i??b:i??v??t,e.jsx("svg",{className:`ml-2 -mr-1 h-4 w-4 transition-transform motion-reduce:transition-none ${n?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]})}),n&&!l?e.jsx("div",{role:"menu",className:"absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:e.jsx("div",{className:"py-1",children:h.map(o=>e.jsx($,{option:o,onLeafClick:()=>c(!1)},o.value))})}):null]});return e.jsxs(e.Fragment,{children:[w&&E&&m||C&&m?e.jsx("div",{className:"flex flex-col items-end mb-2",children:e.jsx("div",{className:"p-2 bg-red-100 border border-red-400 text-red-700 rounded-md shadow-sm",children:e.jsx("p",{className:"text-sm",children:m})})}):null,L]})};export{z as B};
1
+ import{r as a,u as O,j as e}from"./index-DUSjZECW.js";const M=150,T=200,R=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=({option:s,onLeafClick:y})=>{var h,v;const r=!!((h=s.children)!=null&&h.length),[b,t]=a.useState(!1),d=a.useRef(null),g=a.useRef(null),f=()=>{d.current!=null&&(window.clearTimeout(d.current),d.current=null),g.current!=null&&(window.clearTimeout(g.current),g.current=null)};a.useEffect(()=>()=>{f()},[]);const i=(n=!1)=>{if(r){if(f(),n||R()){t(!0);return}d.current=window.setTimeout(()=>{t(!0)},M)}},p=(n=!1)=>{if(f(),n||R()){t(!1);return}g.current=window.setTimeout(()=>{t(!1)},T)},N=()=>{var n;if(r){t(c=>!c);return}(n=s.onClick)==null||n.call(s),y()},w=n=>{r&&((n.key==="ArrowRight"||n.key==="Enter")&&(n.preventDefault(),i(!0)),(n.key==="ArrowLeft"||n.key==="Escape")&&(n.preventDefault(),p(!0)))};return e.jsxs("div",{className:"relative",onMouseEnter:()=>i(),onMouseLeave:()=>p(),children:[e.jsxs("button",{type:"button",role:"menuitem","aria-haspopup":r?"menu":void 0,"aria-expanded":r?b:void 0,onClick:N,onKeyDown:w,className:"flex w-full cursor-pointer items-center justify-between gap-2 px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:ring-2 focus:ring-indigo-500 focus:ring-inset motion-reduce:transition-none",children:[e.jsx("span",{children:s.label}),r?e.jsx("svg",{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}):null]}),r&&b?e.jsx("div",{role:"menu",className:"absolute right-full top-0 z-20 mr-1 w-56 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:(v=s.children)==null?void 0:v.map(n=>e.jsx($,{option:n,onLeafClick:y},n.value))}):null]})},z=s=>{const{type:y="submit",loading:r=!1,loadingText:b="Guardando...",title:t="Guardar",name:d="save",onClickSave:g,selectedColor:f="indigo",children:i,className:p="",disabled:N=!1,enableFormErrorsValidation:w=!1,enableFormErrorsDescriptions:C=!1,dropdownOptions:h=[],dropdownTitle:v}=s,[n,c]=a.useState(!1),k=a.useRef(null),j=O(),E=j?!j.formState.isValid:!1,D=j?j.formState.errors:{},u={green:{bg900:"bg-green-900",bg700:"bg-green-700",bg600:"bg-green-600",bg500:"bg-green-500",bg200:"bg-green-200",ring600:"ring-green-600",ring500:"ring-green-500"},indigo:{bg900:"bg-indigo-900",bg700:"bg-indigo-700",bg600:"bg-indigo-600",bg500:"bg-indigo-500",bg200:"bg-indigo-200",ring600:"ring-indigo-600",ring500:"ring-indigo-500"},red:{bg900:"bg-red-900",bg700:"bg-red-700",bg600:"bg-red-600",bg500:"bg-red-500",bg200:"bg-red-200",ring600:"ring-red-600",ring500:"ring-red-500"},yellow:{bg900:"bg-yellow-900",bg700:"bg-yellow-700",bg600:"bg-yellow-600",bg500:"bg-yellow-500",bg200:"bg-yellow-200",ring600:"ring-yellow-600",ring500:"ring-yellow-500"},gray:{bg900:"bg-gray-900",bg700:"bg-gray-700",bg600:"bg-gray-600",bg500:"bg-gray-500",bg200:"bg-gray-200",ring600:"ring-gray-600",ring500:"ring-gray-500"}}[f],m=E?Object.values(D).map(o=>{var x;return(x=o==null?void 0:o.message)==null?void 0:x.toString()}).join(", "):"";a.useEffect(()=>{const o=S=>{k.current&&!k.current.contains(S.target)&&c(!1)},x=S=>{S.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",x)}},[]);const l=r||N||w&&E;if(!(h.length>0)){const o=e.jsx("button",{type:y,name:"action",value:d,disabled:l,onClick:g,className:`${l?" bg-opacity-25 ":""} ${r?" cursor-progress":`${l?" cursor-not-allowed":`cursor-pointer hover:${u.bg700}`}`} inline-flex justify-center rounded-md border border-transparent ${u.bg600} py-2 px-4 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:${u.ring500} focus:ring-offset-2 ${p}`,children:r?i??b:i??t});return e.jsxs(e.Fragment,{children:[w&&E&&m||C&&m?e.jsx("div",{className:"flex flex-col items-end mb-2",children:e.jsx("div",{className:"p-2 bg-red-100 border border-red-400 text-red-700 rounded-md shadow-sm",children:e.jsx("p",{className:"text-sm",children:m})})}):null,o]})}const L=e.jsxs("div",{className:"relative inline-block text-left",ref:k,children:[e.jsx("div",{children:e.jsxs("button",{type:"button",disabled:l,"aria-haspopup":"menu","aria-expanded":n,onClick:()=>c(!n),className:`${l?" bg-opacity-25 ":""} ${r?" cursor-progress":`${l?" cursor-not-allowed":`cursor-pointer hover:${u.bg700}`}`} inline-flex justify-center items-center rounded-md border border-transparent ${u.bg600} py-2 px-4 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:${u.ring500} focus:ring-offset-2 ${p}`,children:[r?i??b:i??v??t,e.jsx("svg",{className:`ml-2 -mr-1 h-4 w-4 transition-transform motion-reduce:transition-none ${n?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]})}),n&&!l?e.jsx("div",{role:"menu",className:"absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:e.jsx("div",{className:"py-1",children:h.map(o=>e.jsx($,{option:o,onLeafClick:()=>c(!1)},o.value))})}):null]});return e.jsxs(e.Fragment,{children:[w&&E&&m||C&&m?e.jsx("div",{className:"flex flex-col items-end mb-2",children:e.jsx("div",{className:"p-2 bg-red-100 border border-red-400 text-red-700 rounded-md shadow-sm",children:e.jsx("p",{className:"text-sm",children:m})})}):null,L]})};export{z as B};
@@ -1 +1 @@
1
- import{j as e}from"./index-DxYjnckq.js";import{B as t}from"./Button-HdDVNit0.js";const d=({items:s,disabled:r=!1,className:n=""})=>e.jsx("div",{className:`flex flex-col gap-1 ${n}`,children:s.map(o=>{const l=!!o.loading,a=r||o.disabled||l;return e.jsxs("button",{type:"button",disabled:a,onClick:o.onClick,className:"flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 disabled:cursor-progress disabled:opacity-60",children:[o.badge?e.jsx("span",{className:`inline-flex min-w-[2.25rem] justify-center rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${o.badgeClassName??"bg-gray-100 text-gray-700"}`,children:o.badge}):null,e.jsx("span",{children:l?o.loadingLabel??o.label:o.label})]},o.key)})}),x=()=>e.jsx(t,{title:"Guardar"}),g=()=>e.jsx(t,{title:"Guardar",loading:!0,loadingText:"Guardando..."}),p=()=>e.jsx(t,{title:"Guardar",disabled:!0}),u=()=>e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(t,{title:"Indigo",selectedColor:"indigo"}),e.jsx(t,{title:"Green",selectedColor:"green"}),e.jsx(t,{title:"Red",selectedColor:"red"}),e.jsx(t,{title:"Yellow",selectedColor:"yellow"}),e.jsx(t,{title:"Gray",selectedColor:"gray"})]}),b=()=>e.jsx(t,{title:"Acciones",dropdownTitle:"Acciones",dropdownOptions:[{label:"Exportar",value:"export",onClick:()=>{}},{label:"Imprimir",value:"print",onClick:()=>{}}]}),f=()=>e.jsx(d,{items:[{key:"pdf",badge:"PDF",badgeClassName:"bg-red-50 text-red-700",label:"Imprimir reporte",onClick:()=>{}},{key:"xls",badge:"XLS",badgeClassName:"bg-green-50 text-green-700",label:"Exportar Excel",onClick:()=>{}}]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{f as Actions,u as Colors,x as Default,p as Disabled,b as Dropdown,g as Loading};
1
+ import{j as e}from"./index-DUSjZECW.js";import{B as t}from"./Button-YPU2MaHD.js";const d=({items:s,disabled:r=!1,className:n=""})=>e.jsx("div",{className:`flex flex-col gap-1 ${n}`,children:s.map(o=>{const l=!!o.loading,a=r||o.disabled||l;return e.jsxs("button",{type:"button",disabled:a,onClick:o.onClick,className:"flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 disabled:cursor-progress disabled:opacity-60",children:[o.badge?e.jsx("span",{className:`inline-flex min-w-[2.25rem] justify-center rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${o.badgeClassName??"bg-gray-100 text-gray-700"}`,children:o.badge}):null,e.jsx("span",{children:l?o.loadingLabel??o.label:o.label})]},o.key)})}),x=()=>e.jsx(t,{title:"Guardar"}),g=()=>e.jsx(t,{title:"Guardar",loading:!0,loadingText:"Guardando..."}),p=()=>e.jsx(t,{title:"Guardar",disabled:!0}),u=()=>e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(t,{title:"Indigo",selectedColor:"indigo"}),e.jsx(t,{title:"Green",selectedColor:"green"}),e.jsx(t,{title:"Red",selectedColor:"red"}),e.jsx(t,{title:"Yellow",selectedColor:"yellow"}),e.jsx(t,{title:"Gray",selectedColor:"gray"})]}),b=()=>e.jsx(t,{title:"Acciones",dropdownTitle:"Acciones",dropdownOptions:[{label:"Exportar",value:"export",onClick:()=>{}},{label:"Imprimir",value:"print",onClick:()=>{}}]}),f=()=>e.jsx(d,{items:[{key:"pdf",badge:"PDF",badgeClassName:"bg-red-50 text-red-700",label:"Imprimir reporte",onClick:()=>{}},{key:"xls",badge:"XLS",badgeClassName:"bg-green-50 text-green-700",label:"Exportar Excel",onClick:()=>{}}]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{f as Actions,u as Colors,x as Default,p as Disabled,b as Dropdown,g as Loading};
@@ -1 +1 @@
1
- import{j as e}from"./index-DxYjnckq.js";const s=d=>{const{children:n,title:t,className:o}=d;return e.jsxs("div",{className:`p-4 space-y-3 shadow sm:overflow-hidden sm:rounded-md ${o}`,children:[t&&e.jsx("label",{className:"inline text-lg font-medium text-gray-700",children:`${t.toUpperCase()}`}),n]})},r=()=>e.jsx(s,{title:"Tarjeta",children:e.jsx("p",{children:"Contenido de la tarjeta."})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{r as Default};
1
+ import{j as e}from"./index-DUSjZECW.js";const s=d=>{const{children:n,title:t,className:o}=d;return e.jsxs("div",{className:`p-4 space-y-3 shadow sm:overflow-hidden sm:rounded-md ${o}`,children:[t&&e.jsx("label",{className:"inline text-lg font-medium text-gray-700",children:`${t.toUpperCase()}`}),n]})},r=()=>e.jsx(s,{title:"Tarjeta",children:e.jsx("p",{children:"Contenido de la tarjeta."})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{r as Default};
@@ -1 +1 @@
1
- import{j as e}from"./index-DxYjnckq.js";import{B as p}from"./Button-HdDVNit0.js";const s=d=>{const{title:t,description:n,children:c,className:i="",rightContent:r,collapsible:m=!1,defaultOpen:x=!0}=d,l=e.jsxs(e.Fragment,{children:[t&&e.jsx("h3",{className:"text-3xl font-bold leading-8 text-gray-900",children:t}),n&&e.jsx("p",{className:"mt-1 text-md text-gray-600",children:n})]}),o=r?e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4",children:[e.jsx("div",{className:"max-w-3xl",children:l}),e.jsx("div",{className:"flex-shrink-0",children:r})]}):l,a=e.jsx("div",{className:"mt-5 space-y-5",children:c});return m?e.jsx("div",{className:`mx-2 ${i}`,children:e.jsxs("details",{className:"group",...x?{open:!0}:{},children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-start gap-3 rounded-md py-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 [&::-webkit-details-marker]:hidden",children:[e.jsx("span",{"aria-hidden":"true",className:"mt-2 inline-block h-0 w-0 shrink-0 border-y-[5px] border-l-[7px] border-y-transparent border-l-gray-700 transition-transform group-open:rotate-90"}),e.jsx("div",{className:"min-w-0 flex-1",children:o})]}),a]})}):e.jsxs("div",{className:`mx-2 ${i}`,children:[o,a]})},f=()=>e.jsx(s,{title:"Contenedor",description:"Descripción de la sección.",children:e.jsx("p",{children:"Contenido de ejemplo."})}),j=()=>e.jsx(s,{title:"Con acciones",description:"El encabezado se adapta en móvil.",rightContent:e.jsx(p,{title:"Nuevo"}),children:e.jsx("p",{children:"Cuerpo."})}),b=()=>e.jsx(s,{title:"Colapsable",collapsible:!0,defaultOpen:!0,children:e.jsx("p",{children:"Se puede contraer con el summary."})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{b as Collapsible,f as Default,j as WithRightContent};
1
+ import{j as e}from"./index-DUSjZECW.js";import{B as p}from"./Button-YPU2MaHD.js";const s=d=>{const{title:t,description:n,children:c,className:i="",rightContent:r,collapsible:m=!1,defaultOpen:x=!0}=d,l=e.jsxs(e.Fragment,{children:[t&&e.jsx("h3",{className:"text-3xl font-bold leading-8 text-gray-900",children:t}),n&&e.jsx("p",{className:"mt-1 text-md text-gray-600",children:n})]}),o=r?e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4",children:[e.jsx("div",{className:"max-w-3xl",children:l}),e.jsx("div",{className:"flex-shrink-0",children:r})]}):l,a=e.jsx("div",{className:"mt-5 space-y-5",children:c});return m?e.jsx("div",{className:`mx-2 ${i}`,children:e.jsxs("details",{className:"group",...x?{open:!0}:{},children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-start gap-3 rounded-md py-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 [&::-webkit-details-marker]:hidden",children:[e.jsx("span",{"aria-hidden":"true",className:"mt-2 inline-block h-0 w-0 shrink-0 border-y-[5px] border-l-[7px] border-y-transparent border-l-gray-700 transition-transform group-open:rotate-90"}),e.jsx("div",{className:"min-w-0 flex-1",children:o})]}),a]})}):e.jsxs("div",{className:`mx-2 ${i}`,children:[o,a]})},f=()=>e.jsx(s,{title:"Contenedor",description:"Descripción de la sección.",children:e.jsx("p",{children:"Contenido de ejemplo."})}),j=()=>e.jsx(s,{title:"Con acciones",description:"El encabezado se adapta en móvil.",rightContent:e.jsx(p,{title:"Nuevo"}),children:e.jsx("p",{children:"Cuerpo."})}),b=()=>e.jsx(s,{title:"Colapsable",collapsible:!0,defaultOpen:!0,children:e.jsx("p",{children:"Se puede contraer con el summary."})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{b as Collapsible,f as Default,j as WithRightContent};
@@ -1 +1 @@
1
- import{r as o,u as Q,j as e,_ as ve}from"./index-DxYjnckq.js";import{C as we,T as ie,S as ye}from"./index-TgOqmrBM.js";import{C as Ne,a as Ce,I as ce,D as $e}from"./Icons-DjqYUpg9.js";import{B as O}from"./Button-HdDVNit0.js";import{F as ke}from"./components-TO4aWqdC.js";const Se=p=>{var S;const{id:j,name:s,title:l,defaultValue:v="",hint:h,helpText:N,onChange:f,tabIndex:C,disabled:T=!1,className:w="",isClearable:r=!1,required:I=!1}=p,[$,V]=o.useState(v),[_,m]=o.useState(!1),{register:R,formState:{errors:y}}=Q()||{formState:{}},n=y?y[p.name??"-1"]:void 0,g=R?R(p.name??"-1",{required:I}):void 0,u=n?"red":"gray",b=T,D=b?"bg-gray-200":`bg-${u}-50`,c=b?"text-gray-500":`text-${u}-500`,k=b?"border-gray-300":`border-${u}-200`;o.useEffect(()=>{V(v)},[v]);const x=()=>{V(""),f&&f("")};return e.jsxs("div",{children:[l&&e.jsxs("label",{htmlFor:n?`${s}-error`:`${s}-success`,className:`block text-sm font-medium ${c} ${w}`,children:[l,I&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"flex relative items-center",children:[e.jsx("div",{className:"absolute left-0 flex items-center pl-3 pointer-events-none",children:e.jsx(Ne,{})}),e.jsx("input",{id:j,tabIndex:C,type:"date",value:$??"",pattern:"\\d{4}-\\d{2}-\\d{2}",className:`${D} ${k} ${c} text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5`,...g??{},name:s,onChange:E=>{V(E.target.value),f&&f(E.target.value),g&&g.onChange(E)}}),$&&r&&e.jsx("button",{type:"button",onClick:x,className:"absolute right-0 mr-10",children:e.jsx(Ce,{})}),N&&e.jsx("div",{className:"flex items-center relative ml-3",children:e.jsxs("div",{className:"relative cursor-pointer",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[e.jsx(ce,{}),_&&e.jsx("div",{className:"absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black",children:N})]})})]}),n&&e.jsxs("p",{className:`mt-2 text-sm text-${u}-600 dark:text-${u}-500`,children:[e.jsx("span",{className:"font-medium",children:"Oops!"})," ",(S=n.message)==null?void 0:S.toString()]}),!n&&h&&e.jsx("p",{className:`mt-2 italic text-sm text-${u}-500 dark:text-${u}-400`,children:h})]})},Fe=p=>{var oe;const{id:j,name:s,title:l,helpText:v,hint:h,onChange:N,readOnly:f=!1,fileTypes:C=[],showAvailableTypes:T=!1,className:w,defaultValue:r,download:I=!1,required:$=!1,optimizeImages:V=!0,zauruBaseURL:_="https://zauru.herokuapp.com",setProcessing:m,signature:R=!1,capture:y}=p,{register:n,setValue:g,formState:{errors:u}}=Q()||{formState:{}},b=u?u[s]:void 0,D=n?n(s,{required:$}):void 0,[c,k]=o.useState(!1),[x,S]=o.useState(null),[E,Z]=o.useState(!1),[ee,te]=o.useState(0),[de,H]=o.useState(!1),[se,Ve]=o.useState(!1),[ae,_e]=o.useState(0),A=o.useRef(null),M=o.useRef(null),X=o.useRef(!1),q=o.useRef(0),W=o.useRef(0),me=t=>{t.preventDefault();const a=M.current;if(!a)return;const i=a.getBoundingClientRect();q.current=t.clientX-i.left,W.current=t.clientY-i.top,X.current=!0},ue=t=>{if(t.preventDefault(),!X.current)return;const a=M.current;if(!a)return;const i=a.getContext("2d");if(!i)return;const d=a.getBoundingClientRect(),P=t.clientX-d.left,K=t.clientY-d.top;i.beginPath(),i.moveTo(q.current,W.current),i.lineTo(P,K),i.strokeStyle="black",i.lineWidth=2,i.stroke(),q.current=P,W.current=K},re=t=>{t==null||t.preventDefault(),X.current=!1},xe=()=>{const t=M.current;if(!t)return;const a=t.getContext("2d");a&&a.clearRect(0,0,t.width,t.height)},pe=()=>{const t=M.current;t&&t.toBlob(async a=>{if(a){const i=new File([a],"signature.png",{type:"image/png"}),d=URL.createObjectURL(i);S(d),await le(i),H(!1)}},"image/png")};o.useEffect(()=>()=>{x&&URL.revokeObjectURL(x)},[x]);let Y=h;T&&C.length>0&&(Y=`${h||""} Archivos permitidos: ${C.join(", ")}`);const U=b?"red":"gray",ne=f,he=ne?"bg-gray-100":`bg-${U}-50`,fe=ne?"text-gray-700":`text-${U}-900`,ge=b?"border-red-500":`border-${U}-500`,le=async(t,a)=>{let i=t;if(t&&t.type.startsWith("image/")){const d=URL.createObjectURL(t);S(d)}else S(null);if(a&&a.target){const d=new DataTransfer;d.items.add(i),a.target.files=d.files}ve(async()=>{const{DirectUpload:d}=await import("./activestorage.esm-ByWQ3T27.js");return{DirectUpload:d}},[]).then(({DirectUpload:d})=>{const P=`${_}/api/direct_uploads`;m&&m(!0),Z(!0),te(0),new d(i,P,{directUploadWillStoreFileWithXHR:L=>{L.upload.addEventListener("progress",F=>{if(F.lengthComputable){const z=Math.round(F.loaded/F.total*100);te(z)}})}}).create((L,F)=>{if(Z(!1),m&&m(!1),L)console.error("Error al subir el archivo:",L);else{g(s,F.signed_id),g(`${s}_file_type`,F.content_type);const z=document.createElement("input");z.setAttribute("type","hidden"),z.setAttribute("value",F.signed_id),z.setAttribute("name",s);const B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",F.content_type),B.setAttribute("name",`${s}_file_type`);const J=document.querySelector("form");J&&(J.appendChild(z),J.appendChild(B)),A.current&&A.current.removeAttribute("name")}})}).catch(d=>{m&&m(!1),console.error("Error al cargar DirectUpload:",d)})},be=async t=>{t.target.files&&t.target.files.length>0&&await le(t.target.files[0],t),N&&N(t)},je=()=>{S(null),A.current&&(A.current.value=""),g(s,"")};function G(t){return I?e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>window.open(t,"_blank"),onKeyDown:a=>{a.key==="Enter"&&window.open(t,"_blank")},className:"inline-flex items-center cursor-pointer",children:[e.jsx($e,{}),e.jsx("span",{className:"ml-1 text-blue-600 underline",children:"Descargar archivo"})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>window.open(t,"_blank"),onKeyDown:a=>{a.key==="Enter"&&window.open(t,"_blank")},className:"inline-block cursor-pointer",children:e.jsx("img",{src:t,alt:s,className:"h-48 w-48 inline mr-1 pb-1",style:{objectFit:"contain",backgroundColor:"transparent"}})})}return R?f?e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsx("label",{htmlFor:s,className:"block mb-1 text-sm font-medium text-gray-700",children:l}),typeof r=="string"&&r?G(r):e.jsx("div",{className:"text-sm italic text-gray-400",children:"No hay firma disponible"})]}):e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsxs("label",{htmlFor:s,className:`block mb-1 text-sm font-medium text-${U}-700`,children:[l,$&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),x?e.jsxs("div",{children:[G(x),e.jsx("button",{type:"button",onClick:()=>{S(null)},className:"ml-2 text-red-600 underline text-sm",children:"Eliminar firma"})]}):e.jsx("div",{children:e.jsx("button",{type:"button",onClick:()=>H(!0),className:"px-4 py-2 bg-blue-600 text-white rounded",children:"Firmar"})}),de&&e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-white",children:[e.jsx("div",{className:"flex-grow flex items-center justify-center",children:e.jsx("canvas",{ref:M,width:400,height:200,style:{border:"1px solid #ccc",backgroundColor:"transparent",touchAction:"none"},onPointerDown:me,onPointerMove:ue,onPointerUp:re,onPointerLeave:re})}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center space-x-4 space-y-4",children:[e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"indigo",onClickSave:xe,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:[e.jsx("path",{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}),e.jsx("path",{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"})]}),e.jsx("span",{className:"text-5xl",children:"Limpiar"})]}),e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"green",onClickSave:pe,children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:e.jsx("path",{d:"M5 21h14a2 2 0 0 0 2-2V8a1 1 0 0 0-.29-.71l-4-4A1 1 0 0 0 16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2zm10-2H9v-5h6zM13 7h-2V5h2zM5 5h2v4h8V5h.59L19 8.41V19h-2v-5a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v5H5z"})}),e.jsx("span",{className:"text-5xl",children:"Confirmar"})]}),e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"gray",onClickSave:()=>H(!1),children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:[e.jsx("path",{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}),e.jsx("path",{d:"m11 16 5-4-5-4v3.001H3v2h8z"})]}),e.jsx("span",{className:"text-5xl",children:"Cancelar"})]})]})]})]}):f?e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsx("label",{htmlFor:s,className:"block mb-1 text-sm font-medium text-gray-700",children:l}),typeof r=="string"&&r?G(r):e.jsx("div",{className:"text-sm italic text-gray-400",children:"No hay archivo disponible"})]}):e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsxs("label",{htmlFor:s,className:`block mb-1 text-sm font-medium text-${U}-700`,children:[l,$&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.jsxs("div",{className:"mb-2 flex items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:()=>{const t=x||typeof r=="string"&&r;t&&window.open(t,"_blank")},onKeyDown:t=>{const a=x||typeof r=="string"&&r;t.key==="Enter"&&a&&window.open(a,"_blank")},className:"cursor-pointer border border-gray-300 h-48 w-48 flex items-center justify-center",children:x||typeof r=="string"&&r?e.jsx("img",{src:x??(typeof r=="string"&&r?r:void 0),alt:s,className:"h-48 w-48",style:{objectFit:"contain"}}):e.jsx("span",{className:"text-gray-400",children:"No image"})}),(x||typeof r=="string"&&r)&&e.jsx("button",{type:"button",onClick:je,className:"ml-2 text-red-600 underline text-sm",children:"Eliminar archivo"})]}),e.jsxs("div",{className:"flex relative items-center",children:[e.jsx("input",{type:"file",id:j??s,accept:C.map(t=>`.${t}`).join(", "),capture:y,className:`block w-full rounded-md ${he} ${ge} ${fe} shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm`,...D??{},ref:A,name:s,onChange:be}),v&&e.jsx("div",{className:"flex items-center relative ml-3",children:e.jsxs("div",{className:"relative cursor-pointer",onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:[e.jsx(ce,{}),c&&e.jsx("div",{className:"absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black z-50",children:v})]})})]}),e.jsx("div",{className:"mt-2 min-h-[60px] flex items-center justify-center border border-dashed border-gray-200 rounded",children:se||E?e.jsxs(e.Fragment,{children:[se&&e.jsxs("div",{className:"w-full",children:[e.jsx("progress",{value:ae,max:"100",className:"w-full"}),e.jsxs("p",{className:"text-sm text-blue-600 mt-1 text-center",children:["Optimizando imagen a webp: ",ae,"%"]})]}),E&&e.jsxs("div",{className:"w-full",children:[e.jsx("progress",{value:ee,max:"100",className:"w-full"}),e.jsxs("p",{className:"text-sm text-blue-600 mt-1 text-center",children:["Subiendo archivo: ",ee,"%"]})]})]}):e.jsx("span",{className:"text-sm text-gray-500",children:"Información de progreso"})}),b&&e.jsxs("p",{className:"mt-2 text-sm text-red-600",children:[e.jsx("span",{className:"font-medium",children:"¡Oops!"})," ",(oe=b.message)==null?void 0:oe.toString()]}),!b&&Y&&e.jsx("p",{className:`mt-2 italic text-sm text-${U}-500`,children:Y})]})},Re=p=>{const{children:j,className:s,whitBg:l=!1}=p;return e.jsx("div",{className:`${l?"bg-gray-50 px-4 py-3 sm:px-6":""} mt-5 flex flex-col md:flex-row md:justify-end md:items-center space-x-0 space-y-4 md:space-y-0 md:space-x-4 ${s}`,children:j})},Te=p=>{const{title:j,children:s,buttons:l,method:v,formId:h}=p;return e.jsxs(ke,{id:h,name:h,method:v??"post",children:[j&&e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:j}),e.jsxs("div",{className:"shadow sm:overflow-hidden sm:rounded-md",children:[e.jsx("div",{className:"space-y-6 bg-white px-4 py-5 sm:p-6",children:s}),l&&e.jsx(Re,{whitBg:!0,children:l})]})]},h)},Ie=p=>{var D;const{id:j,name:s,title:l,options:v,defaultValue:h,disabled:N=!1,required:f=!1,onChange:C,helpText:T,hint:w,className:r="",orientation:I="vertical"}=p,[$,V]=o.useState(h),{register:_,formState:{errors:m},setValue:R}=Q()||{formState:{}},y=m?m[s]:void 0,n=y?"red":"gray",g=_?_(s,{required:f}):void 0,u=c=>{const k=c.target.value;V(k),g&&g.onChange(c),R&&R(s,k),C&&C(k,c)},b=I==="horizontal"?"flex items-center gap-4 flex-wrap":"";return e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${r}`,children:[l&&e.jsxs("label",{htmlFor:j??s,className:`block mb-1 text-sm font-medium text-${n}-700 dark:text-${n}-500`,children:[l,f&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("div",{className:b,children:v.map(c=>e.jsxs("div",{className:`flex items-center mb-2 ${N?"opacity-50 pointer-events-none":""}`,children:[e.jsx("input",{type:"radio",id:`${s}-${c.value}`,value:c.value,disabled:N,checked:$===c.value,className:`h-4 w-4 text-indigo-600 border-${n}-300 focus:ring-indigo-500`,...g??{},onChange:u}),e.jsx("label",{htmlFor:`${s}-${c.value}`,className:`ml-2 block text-sm font-medium text-${n}-900 dark:text-${n}-500`,children:c.label})]},c.value))}),T&&e.jsx("p",{className:`mt-2 italic text-sm text-${n}-500 dark:text-${n}-400`,children:T}),y&&e.jsxs("p",{className:`mt-2 text-sm text-${n}-600 dark:text-${n}-500`,children:[e.jsx("span",{className:"font-medium",children:"Oops!"})," ",(D=y.message)==null?void 0:D.toString()]}),!y&&w&&e.jsx("p",{className:`mt-2 italic text-sm text-${n}-500 dark:text-${n}-400`,children:w})]})},Me=()=>e.jsx(ie,{name:"nombre",title:"Nombre",hint:"Campo de texto",required:!0}),Pe=()=>e.jsx(ye,{name:"agencia",title:"Agencia",options:[{label:"Central",value:"1"},{label:"Norte",value:"2",disabled:!0,disabledLabel:"cerrada"},{label:"Sur",value:"3"}]}),Le=()=>e.jsx(we,{name:"acepta",label:"Acepto los términos",required:!0}),Be=()=>e.jsx(Se,{name:"fecha",title:"Fecha"}),Oe=()=>e.jsx(Fe,{name:"archivo",title:"Archivo",fileTypes:["pdf","png"]}),He=()=>e.jsx(Te,{formId:"demo-form",title:"Formulario de ejemplo",buttons:e.jsx(O,{title:"Enviar"}),children:e.jsx(ie,{name:"campo",title:"Campo"})}),Xe=()=>e.jsx(Ie,{name:"tipo",title:"Tipo",options:[{label:"Uno",value:"1"},{label:"Dos",value:"2"}],orientation:"horizontal"});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{Le as Checkbox,Be as DatePicker,Oe as FileUpload,He as Layout,Xe as Radios,Pe as Select,Me as Text};
1
+ import{r as o,u as Q,j as e,_ as ve}from"./index-DUSjZECW.js";import{C as we,T as ie,S as ye}from"./index-DonOhaBM.js";import{C as Ne,a as Ce,I as ce,D as $e}from"./Icons-BxLN_JWC.js";import{B as O}from"./Button-YPU2MaHD.js";import{F as ke}from"./components-FzdPzEyL.js";const Se=p=>{var S;const{id:j,name:s,title:l,defaultValue:v="",hint:h,helpText:N,onChange:f,tabIndex:C,disabled:T=!1,className:w="",isClearable:r=!1,required:I=!1}=p,[$,V]=o.useState(v),[_,m]=o.useState(!1),{register:R,formState:{errors:y}}=Q()||{formState:{}},n=y?y[p.name??"-1"]:void 0,g=R?R(p.name??"-1",{required:I}):void 0,u=n?"red":"gray",b=T,D=b?"bg-gray-200":`bg-${u}-50`,c=b?"text-gray-500":`text-${u}-500`,k=b?"border-gray-300":`border-${u}-200`;o.useEffect(()=>{V(v)},[v]);const x=()=>{V(""),f&&f("")};return e.jsxs("div",{children:[l&&e.jsxs("label",{htmlFor:n?`${s}-error`:`${s}-success`,className:`block text-sm font-medium ${c} ${w}`,children:[l,I&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"flex relative items-center",children:[e.jsx("div",{className:"absolute left-0 flex items-center pl-3 pointer-events-none",children:e.jsx(Ne,{})}),e.jsx("input",{id:j,tabIndex:C,type:"date",value:$??"",pattern:"\\d{4}-\\d{2}-\\d{2}",className:`${D} ${k} ${c} text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5`,...g??{},name:s,onChange:E=>{V(E.target.value),f&&f(E.target.value),g&&g.onChange(E)}}),$&&r&&e.jsx("button",{type:"button",onClick:x,className:"absolute right-0 mr-10",children:e.jsx(Ce,{})}),N&&e.jsx("div",{className:"flex items-center relative ml-3",children:e.jsxs("div",{className:"relative cursor-pointer",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[e.jsx(ce,{}),_&&e.jsx("div",{className:"absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black",children:N})]})})]}),n&&e.jsxs("p",{className:`mt-2 text-sm text-${u}-600 dark:text-${u}-500`,children:[e.jsx("span",{className:"font-medium",children:"Oops!"})," ",(S=n.message)==null?void 0:S.toString()]}),!n&&h&&e.jsx("p",{className:`mt-2 italic text-sm text-${u}-500 dark:text-${u}-400`,children:h})]})},Fe=p=>{var oe;const{id:j,name:s,title:l,helpText:v,hint:h,onChange:N,readOnly:f=!1,fileTypes:C=[],showAvailableTypes:T=!1,className:w,defaultValue:r,download:I=!1,required:$=!1,optimizeImages:V=!0,zauruBaseURL:_="https://zauru.herokuapp.com",setProcessing:m,signature:R=!1,capture:y}=p,{register:n,setValue:g,formState:{errors:u}}=Q()||{formState:{}},b=u?u[s]:void 0,D=n?n(s,{required:$}):void 0,[c,k]=o.useState(!1),[x,S]=o.useState(null),[E,Z]=o.useState(!1),[ee,te]=o.useState(0),[de,H]=o.useState(!1),[se,Ve]=o.useState(!1),[ae,_e]=o.useState(0),A=o.useRef(null),M=o.useRef(null),X=o.useRef(!1),q=o.useRef(0),W=o.useRef(0),me=t=>{t.preventDefault();const a=M.current;if(!a)return;const i=a.getBoundingClientRect();q.current=t.clientX-i.left,W.current=t.clientY-i.top,X.current=!0},ue=t=>{if(t.preventDefault(),!X.current)return;const a=M.current;if(!a)return;const i=a.getContext("2d");if(!i)return;const d=a.getBoundingClientRect(),P=t.clientX-d.left,K=t.clientY-d.top;i.beginPath(),i.moveTo(q.current,W.current),i.lineTo(P,K),i.strokeStyle="black",i.lineWidth=2,i.stroke(),q.current=P,W.current=K},re=t=>{t==null||t.preventDefault(),X.current=!1},xe=()=>{const t=M.current;if(!t)return;const a=t.getContext("2d");a&&a.clearRect(0,0,t.width,t.height)},pe=()=>{const t=M.current;t&&t.toBlob(async a=>{if(a){const i=new File([a],"signature.png",{type:"image/png"}),d=URL.createObjectURL(i);S(d),await le(i),H(!1)}},"image/png")};o.useEffect(()=>()=>{x&&URL.revokeObjectURL(x)},[x]);let Y=h;T&&C.length>0&&(Y=`${h||""} Archivos permitidos: ${C.join(", ")}`);const U=b?"red":"gray",ne=f,he=ne?"bg-gray-100":`bg-${U}-50`,fe=ne?"text-gray-700":`text-${U}-900`,ge=b?"border-red-500":`border-${U}-500`,le=async(t,a)=>{let i=t;if(t&&t.type.startsWith("image/")){const d=URL.createObjectURL(t);S(d)}else S(null);if(a&&a.target){const d=new DataTransfer;d.items.add(i),a.target.files=d.files}ve(async()=>{const{DirectUpload:d}=await import("./activestorage.esm-ByWQ3T27.js");return{DirectUpload:d}},[]).then(({DirectUpload:d})=>{const P=`${_}/api/direct_uploads`;m&&m(!0),Z(!0),te(0),new d(i,P,{directUploadWillStoreFileWithXHR:L=>{L.upload.addEventListener("progress",F=>{if(F.lengthComputable){const z=Math.round(F.loaded/F.total*100);te(z)}})}}).create((L,F)=>{if(Z(!1),m&&m(!1),L)console.error("Error al subir el archivo:",L);else{g(s,F.signed_id),g(`${s}_file_type`,F.content_type);const z=document.createElement("input");z.setAttribute("type","hidden"),z.setAttribute("value",F.signed_id),z.setAttribute("name",s);const B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",F.content_type),B.setAttribute("name",`${s}_file_type`);const J=document.querySelector("form");J&&(J.appendChild(z),J.appendChild(B)),A.current&&A.current.removeAttribute("name")}})}).catch(d=>{m&&m(!1),console.error("Error al cargar DirectUpload:",d)})},be=async t=>{t.target.files&&t.target.files.length>0&&await le(t.target.files[0],t),N&&N(t)},je=()=>{S(null),A.current&&(A.current.value=""),g(s,"")};function G(t){return I?e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>window.open(t,"_blank"),onKeyDown:a=>{a.key==="Enter"&&window.open(t,"_blank")},className:"inline-flex items-center cursor-pointer",children:[e.jsx($e,{}),e.jsx("span",{className:"ml-1 text-blue-600 underline",children:"Descargar archivo"})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>window.open(t,"_blank"),onKeyDown:a=>{a.key==="Enter"&&window.open(t,"_blank")},className:"inline-block cursor-pointer",children:e.jsx("img",{src:t,alt:s,className:"h-48 w-48 inline mr-1 pb-1",style:{objectFit:"contain",backgroundColor:"transparent"}})})}return R?f?e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsx("label",{htmlFor:s,className:"block mb-1 text-sm font-medium text-gray-700",children:l}),typeof r=="string"&&r?G(r):e.jsx("div",{className:"text-sm italic text-gray-400",children:"No hay firma disponible"})]}):e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsxs("label",{htmlFor:s,className:`block mb-1 text-sm font-medium text-${U}-700`,children:[l,$&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),x?e.jsxs("div",{children:[G(x),e.jsx("button",{type:"button",onClick:()=>{S(null)},className:"ml-2 text-red-600 underline text-sm",children:"Eliminar firma"})]}):e.jsx("div",{children:e.jsx("button",{type:"button",onClick:()=>H(!0),className:"px-4 py-2 bg-blue-600 text-white rounded",children:"Firmar"})}),de&&e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-white",children:[e.jsx("div",{className:"flex-grow flex items-center justify-center",children:e.jsx("canvas",{ref:M,width:400,height:200,style:{border:"1px solid #ccc",backgroundColor:"transparent",touchAction:"none"},onPointerDown:me,onPointerMove:ue,onPointerUp:re,onPointerLeave:re})}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center space-x-4 space-y-4",children:[e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"indigo",onClickSave:xe,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:[e.jsx("path",{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}),e.jsx("path",{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"})]}),e.jsx("span",{className:"text-5xl",children:"Limpiar"})]}),e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"green",onClickSave:pe,children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:e.jsx("path",{d:"M5 21h14a2 2 0 0 0 2-2V8a1 1 0 0 0-.29-.71l-4-4A1 1 0 0 0 16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2zm10-2H9v-5h6zM13 7h-2V5h2zM5 5h2v4h8V5h.59L19 8.41V19h-2v-5a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v5H5z"})}),e.jsx("span",{className:"text-5xl",children:"Confirmar"})]}),e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"gray",onClickSave:()=>H(!1),children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:[e.jsx("path",{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}),e.jsx("path",{d:"m11 16 5-4-5-4v3.001H3v2h8z"})]}),e.jsx("span",{className:"text-5xl",children:"Cancelar"})]})]})]})]}):f?e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsx("label",{htmlFor:s,className:"block mb-1 text-sm font-medium text-gray-700",children:l}),typeof r=="string"&&r?G(r):e.jsx("div",{className:"text-sm italic text-gray-400",children:"No hay archivo disponible"})]}):e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsxs("label",{htmlFor:s,className:`block mb-1 text-sm font-medium text-${U}-700`,children:[l,$&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.jsxs("div",{className:"mb-2 flex items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:()=>{const t=x||typeof r=="string"&&r;t&&window.open(t,"_blank")},onKeyDown:t=>{const a=x||typeof r=="string"&&r;t.key==="Enter"&&a&&window.open(a,"_blank")},className:"cursor-pointer border border-gray-300 h-48 w-48 flex items-center justify-center",children:x||typeof r=="string"&&r?e.jsx("img",{src:x??(typeof r=="string"&&r?r:void 0),alt:s,className:"h-48 w-48",style:{objectFit:"contain"}}):e.jsx("span",{className:"text-gray-400",children:"No image"})}),(x||typeof r=="string"&&r)&&e.jsx("button",{type:"button",onClick:je,className:"ml-2 text-red-600 underline text-sm",children:"Eliminar archivo"})]}),e.jsxs("div",{className:"flex relative items-center",children:[e.jsx("input",{type:"file",id:j??s,accept:C.map(t=>`.${t}`).join(", "),capture:y,className:`block w-full rounded-md ${he} ${ge} ${fe} shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm`,...D??{},ref:A,name:s,onChange:be}),v&&e.jsx("div",{className:"flex items-center relative ml-3",children:e.jsxs("div",{className:"relative cursor-pointer",onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:[e.jsx(ce,{}),c&&e.jsx("div",{className:"absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black z-50",children:v})]})})]}),e.jsx("div",{className:"mt-2 min-h-[60px] flex items-center justify-center border border-dashed border-gray-200 rounded",children:se||E?e.jsxs(e.Fragment,{children:[se&&e.jsxs("div",{className:"w-full",children:[e.jsx("progress",{value:ae,max:"100",className:"w-full"}),e.jsxs("p",{className:"text-sm text-blue-600 mt-1 text-center",children:["Optimizando imagen a webp: ",ae,"%"]})]}),E&&e.jsxs("div",{className:"w-full",children:[e.jsx("progress",{value:ee,max:"100",className:"w-full"}),e.jsxs("p",{className:"text-sm text-blue-600 mt-1 text-center",children:["Subiendo archivo: ",ee,"%"]})]})]}):e.jsx("span",{className:"text-sm text-gray-500",children:"Información de progreso"})}),b&&e.jsxs("p",{className:"mt-2 text-sm text-red-600",children:[e.jsx("span",{className:"font-medium",children:"¡Oops!"})," ",(oe=b.message)==null?void 0:oe.toString()]}),!b&&Y&&e.jsx("p",{className:`mt-2 italic text-sm text-${U}-500`,children:Y})]})},Re=p=>{const{children:j,className:s,whitBg:l=!1}=p;return e.jsx("div",{className:`${l?"bg-gray-50 px-4 py-3 sm:px-6":""} mt-5 flex flex-col md:flex-row md:justify-end md:items-center space-x-0 space-y-4 md:space-y-0 md:space-x-4 ${s}`,children:j})},Te=p=>{const{title:j,children:s,buttons:l,method:v,formId:h}=p;return e.jsxs(ke,{id:h,name:h,method:v??"post",children:[j&&e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:j}),e.jsxs("div",{className:"shadow sm:overflow-hidden sm:rounded-md",children:[e.jsx("div",{className:"space-y-6 bg-white px-4 py-5 sm:p-6",children:s}),l&&e.jsx(Re,{whitBg:!0,children:l})]})]},h)},Ie=p=>{var D;const{id:j,name:s,title:l,options:v,defaultValue:h,disabled:N=!1,required:f=!1,onChange:C,helpText:T,hint:w,className:r="",orientation:I="vertical"}=p,[$,V]=o.useState(h),{register:_,formState:{errors:m},setValue:R}=Q()||{formState:{}},y=m?m[s]:void 0,n=y?"red":"gray",g=_?_(s,{required:f}):void 0,u=c=>{const k=c.target.value;V(k),g&&g.onChange(c),R&&R(s,k),C&&C(k,c)},b=I==="horizontal"?"flex items-center gap-4 flex-wrap":"";return e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${r}`,children:[l&&e.jsxs("label",{htmlFor:j??s,className:`block mb-1 text-sm font-medium text-${n}-700 dark:text-${n}-500`,children:[l,f&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("div",{className:b,children:v.map(c=>e.jsxs("div",{className:`flex items-center mb-2 ${N?"opacity-50 pointer-events-none":""}`,children:[e.jsx("input",{type:"radio",id:`${s}-${c.value}`,value:c.value,disabled:N,checked:$===c.value,className:`h-4 w-4 text-indigo-600 border-${n}-300 focus:ring-indigo-500`,...g??{},onChange:u}),e.jsx("label",{htmlFor:`${s}-${c.value}`,className:`ml-2 block text-sm font-medium text-${n}-900 dark:text-${n}-500`,children:c.label})]},c.value))}),T&&e.jsx("p",{className:`mt-2 italic text-sm text-${n}-500 dark:text-${n}-400`,children:T}),y&&e.jsxs("p",{className:`mt-2 text-sm text-${n}-600 dark:text-${n}-500`,children:[e.jsx("span",{className:"font-medium",children:"Oops!"})," ",(D=y.message)==null?void 0:D.toString()]}),!y&&w&&e.jsx("p",{className:`mt-2 italic text-sm text-${n}-500 dark:text-${n}-400`,children:w})]})},Me=()=>e.jsx(ie,{name:"nombre",title:"Nombre",hint:"Campo de texto",required:!0}),Pe=()=>e.jsx(ye,{name:"agencia",title:"Agencia",options:[{label:"Central",value:"1"},{label:"Norte",value:"2",disabled:!0,disabledLabel:"cerrada"},{label:"Sur",value:"3"}]}),Le=()=>e.jsx(we,{name:"acepta",label:"Acepto los términos",required:!0}),Be=()=>e.jsx(Se,{name:"fecha",title:"Fecha"}),Oe=()=>e.jsx(Fe,{name:"archivo",title:"Archivo",fileTypes:["pdf","png"]}),He=()=>e.jsx(Te,{formId:"demo-form",title:"Formulario de ejemplo",buttons:e.jsx(O,{title:"Enviar"}),children:e.jsx(ie,{name:"campo",title:"Campo"})}),Xe=()=>e.jsx(Ie,{name:"tipo",title:"Tipo",options:[{label:"Uno",value:"1"},{label:"Dos",value:"2"}],orientation:"horizontal"});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{Le as Checkbox,Be as DatePicker,Oe as FileUpload,He as Layout,Xe as Radios,Pe as Select,Me as Text};
@@ -1,4 +1,4 @@
1
- import{r as h,a as E,b as Z,N as P,s as b,c as Q,d as q,R as X,i as V,e as T,f as Y,g as B,D as J,h as ee,m as W,j as i}from"./index-DxYjnckq.js";/**
1
+ import{r as h,a as E,b as Z,N as P,s as b,c as Q,d as q,R as X,i as V,e as T,f as Y,g as B,D as J,h as ee,m as W,j as i}from"./index-DUSjZECW.js";/**
2
2
  * React Router DOM v6.26.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
@@ -1 +1 @@
1
- import{j as e}from"./index-DxYjnckq.js";const r=t=>{const{description:l,title:a,className:s}=t;return e.jsxs("div",{className:`block ${s}`,children:[e.jsx("label",{className:"inline text-sm font-medium text-gray-700",children:`${a.toUpperCase()} `}),e.jsx("label",{className:"inline text-sm font-medium text-gray-500",children:l})]})},n=({items:t,emptyText:l="Sin filtros registrados",className:a=""})=>t!=null&&t.length?e.jsx("dl",{className:`flex flex-col gap-1 text-xs text-gray-700 ${a}`,children:t.map(s=>e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-1",children:[e.jsxs("dt",{className:"font-semibold text-gray-500",children:[s.label,":"]}),e.jsx("dd",{className:"text-gray-800",children:s.value})]},s.key))}):e.jsx("p",{className:`text-xs text-gray-400 ${a}`,children:l}),i=()=>e.jsx(r,{title:"Agencia",description:"Central"}),d=()=>e.jsx(n,{items:[{key:"dates",label:"Fechas",value:"01/01/2026 – 31/01/2026"},{key:"agency",label:"Agencia",value:"Todas"}]}),o=()=>e.jsx(n,{items:[]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{d as Filters,o as FiltersEmpty,i as Info};
1
+ import{j as e}from"./index-DUSjZECW.js";const r=t=>{const{description:l,title:a,className:s}=t;return e.jsxs("div",{className:`block ${s}`,children:[e.jsx("label",{className:"inline text-sm font-medium text-gray-700",children:`${a.toUpperCase()} `}),e.jsx("label",{className:"inline text-sm font-medium text-gray-500",children:l})]})},n=({items:t,emptyText:l="Sin filtros registrados",className:a=""})=>t!=null&&t.length?e.jsx("dl",{className:`flex flex-col gap-1 text-xs text-gray-700 ${a}`,children:t.map(s=>e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-1",children:[e.jsxs("dt",{className:"font-semibold text-gray-500",children:[s.label,":"]}),e.jsx("dd",{className:"text-gray-800",children:s.value})]},s.key))}):e.jsx("p",{className:`text-xs text-gray-400 ${a}`,children:l}),i=()=>e.jsx(r,{title:"Agencia",description:"Central"}),d=()=>e.jsx(n,{items:[{key:"dates",label:"Fechas",value:"01/01/2026 – 31/01/2026"},{key:"agency",label:"Agencia",value:"Todas"}]}),o=()=>e.jsx(n,{items:[]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{d as Filters,o as FiltersEmpty,i as Info};
@@ -0,0 +1 @@
1
+ import{r as u,j as e}from"./index-DUSjZECW.js";const R=({rows:n,columns:o,isChecked:d,isPending:a=()=>!1,onToggle:g,disabled:s=!1,renderRowAction:i,checkedLabel:l="Marcado",uncheckedLabel:p="Sin marcar",pendingLabel:c="Guardando…",emptyText:m="No hay filas para mostrar.",pageSize:w=20,showMoreLabel:C="Mostrar más",className:f=""})=>{const x=Math.max(1,w),[k,j]=u.useState(x),$=n.map(t=>t.key).join("\0");if(u.useEffect(()=>{j(x)},[$,x]),n.length===0)return e.jsx("p",{className:`p-4 text-sm text-gray-600 ${f}`,children:m});const S=n.slice(0,k);return e.jsxs("div",{className:`space-y-3 ${f}`,children:[S.map(t=>e.jsxs("fieldset",{className:"min-w-0 rounded-lg border border-gray-200 bg-white p-3 shadow-sm",children:[e.jsxs("div",{className:"mb-3 flex min-w-0 items-start justify-between gap-3",children:[e.jsxs("legend",{className:"min-w-0 flex-1 px-0 text-sm font-semibold text-gray-900",children:[e.jsx("span",{className:"block break-words",children:t.label}),t.description?e.jsx("span",{className:"mt-0.5 block break-words text-xs font-normal text-gray-600",children:t.description}):null]}),i?e.jsx("div",{className:"shrink-0",children:i(t)}):null]}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:o.map(r=>{const h=d(t.key,r.key),b=a(t.key,r.key),v=`check-matrix-${encodeURIComponent(t.key)}-${encodeURIComponent(r.key)}`;return e.jsxs("label",{htmlFor:v,className:`flex min-h-11 cursor-pointer items-center gap-3 rounded-md border px-3 py-2 text-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-1 ${h?"border-indigo-200 bg-indigo-50 text-indigo-950":"border-gray-200 bg-gray-50 text-gray-800"} ${b||s?"cursor-not-allowed opacity-70":"hover:border-indigo-300"}`,children:[e.jsx("input",{id:v,type:"checkbox",checked:h,disabled:s||b,onChange:E=>g(t.key,r.key,E.target.checked),className:"h-5 w-5 shrink-0 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{className:"min-w-0 flex-1 break-words font-medium",children:r.label}),e.jsx("span",{className:`shrink-0 text-xs font-medium ${h?"text-indigo-700":"text-gray-600"}`,"aria-live":b?"polite":void 0,children:b?c:h?l:p})]},r.key)})})]},t.key)),k<n.length?e.jsxs("button",{type:"button",onClick:()=>j(t=>t+x),className:"min-h-11 w-full cursor-pointer rounded-md border border-indigo-300 bg-white px-4 py-2 text-sm font-semibold text-indigo-700 hover:bg-indigo-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2",children:[C," (",n.length-k,")"]}):null]})},M={sm:{mobile:"sm:hidden",desktop:"hidden sm:block"},md:{mobile:"md:hidden",desktop:"hidden md:block"},lg:{mobile:"lg:hidden",desktop:"hidden lg:block"}},P=({desktop:n,desktopBreakpoint:o="md",...d})=>{const a=M[o];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.mobile,children:e.jsx(R,{...d})}),e.jsx("div",{className:a.desktop,children:n})]})},N=[{key:"129",label:"129 · Cooperativa El Progreso",description:"San Juan"},{key:"302",label:"302 · Productor con un nombre largo para validar el ajuste de texto"}],y=[{key:"brocoli",label:"Brócoli certificado"},{key:"radicchio",label:"Radicchio"},{key:"elotin",label:"Elotín"}],I=()=>{const[n,o]=u.useState(new Set(["129:radicchio"])),d=(s,i)=>!n.has(`${s}:${i}`),a=(s,i,l)=>{o(p=>{const c=new Set(p),m=`${s}:${i}`;return l?c.delete(m):c.add(m),c})},g=e.jsx("div",{className:"overflow-x-auto rounded-md border border-gray-200",children:e.jsxs("table",{className:"min-w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Proveedor"}),y.map(s=>e.jsx("th",{className:"px-3 py-2 text-center",children:s.label},s.key))]})}),e.jsx("tbody",{children:N.map(s=>e.jsxs("tr",{className:"border-t border-gray-200",children:[e.jsx("th",{className:"px-3 py-2 text-left",children:s.label}),y.map(i=>e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsx("input",{type:"checkbox","aria-label":`${String(s.label)}, ${String(i.label)}`,checked:d(s.key,i.key),onChange:l=>a(s.key,i.key,l.target.checked)})},i.key))]},s.key))})]})});return e.jsx(P,{rows:N,columns:y,desktop:g,isChecked:d,onToggle:a,checkedLabel:"Permitida",uncheckedLabel:"Bloqueada"})};typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{I as Responsive};
@@ -1 +1 @@
1
- import{j as e,r as d}from"./index-DxYjnckq.js";import{A as m,m as i}from"./proxy-DgkUxN7K.js";import{B as x}from"./Button-HdDVNit0.js";const h=({isOpen:a,onClose:s,title:o,current:r,total:n,currentItem:l,description:c})=>{const t=n>0?Math.round(r/n*100):0;return e.jsx(m,{children:a&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(i.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black bg-opacity-50",onClick:s}),e.jsxs(i.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:20,stiffness:300},className:"relative bg-white rounded-lg shadow-xl p-6 max-w-md w-full mx-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900",children:o}),t===100&&e.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"space-y-4",children:[c&&e.jsx("p",{className:"text-sm text-gray-600",children:c}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-gray-600",children:[r," de ",n," completado"]}),e.jsxs("span",{className:"font-medium text-blue-600",children:[t,"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 rounded-full h-3",children:e.jsx(i.div,{initial:{width:0},animate:{width:`${t}%`},transition:{duration:.3},className:"h-3 bg-blue-600 rounded-full flex items-center justify-end pr-1",children:t>10&&e.jsx("div",{className:"w-2 h-2 bg-white rounded-full"})})})]}),l&&e.jsx("div",{className:"bg-blue-50 border-l-4 border-blue-400 p-3 rounded",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsxs("svg",{className:"w-5 h-5 text-blue-400 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),e.jsx("div",{className:"ml-3",children:e.jsxs("p",{className:"text-sm font-medium text-blue-800",children:["Procesando: ",l]})})]})}),t===100&&e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-green-50 border-l-4 border-green-400 p-3 rounded",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("div",{className:"ml-3",children:e.jsx("p",{className:"text-sm font-medium text-green-800",children:"¡PDF generado exitosamente!"})})]})})]})]})]})})},f=()=>{const[a,s]=d.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(x,{type:"button",title:"Abrir progreso",onClickSave:()=>s(!0)}),e.jsx(h,{isOpen:a,onClose:()=>s(!1),title:"Procesando",current:3,total:10,currentItem:"Item 3",description:"Trabajo de ejemplo"})]})};typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{f as Progress};
1
+ import{j as e,r as d}from"./index-DUSjZECW.js";import{A as m,m as i}from"./proxy-BETbFm71.js";import{B as x}from"./Button-YPU2MaHD.js";const h=({isOpen:a,onClose:s,title:o,current:r,total:n,currentItem:l,description:c})=>{const t=n>0?Math.round(r/n*100):0;return e.jsx(m,{children:a&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(i.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black bg-opacity-50",onClick:s}),e.jsxs(i.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:20,stiffness:300},className:"relative bg-white rounded-lg shadow-xl p-6 max-w-md w-full mx-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900",children:o}),t===100&&e.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"space-y-4",children:[c&&e.jsx("p",{className:"text-sm text-gray-600",children:c}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-gray-600",children:[r," de ",n," completado"]}),e.jsxs("span",{className:"font-medium text-blue-600",children:[t,"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 rounded-full h-3",children:e.jsx(i.div,{initial:{width:0},animate:{width:`${t}%`},transition:{duration:.3},className:"h-3 bg-blue-600 rounded-full flex items-center justify-end pr-1",children:t>10&&e.jsx("div",{className:"w-2 h-2 bg-white rounded-full"})})})]}),l&&e.jsx("div",{className:"bg-blue-50 border-l-4 border-blue-400 p-3 rounded",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsxs("svg",{className:"w-5 h-5 text-blue-400 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),e.jsx("div",{className:"ml-3",children:e.jsxs("p",{className:"text-sm font-medium text-blue-800",children:["Procesando: ",l]})})]})}),t===100&&e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-green-50 border-l-4 border-green-400 p-3 rounded",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("div",{className:"ml-3",children:e.jsx("p",{className:"text-sm font-medium text-green-800",children:"¡PDF generado exitosamente!"})})]})})]})]})]})})},f=()=>{const[a,s]=d.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(x,{type:"button",title:"Abrir progreso",onClickSave:()=>s(!0)}),e.jsx(h,{isOpen:a,onClose:()=>s(!1),title:"Procesando",current:3,total:10,currentItem:"Item 3",description:"Trabajo de ejemplo"})]})};typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{f as Progress};
@@ -1 +1 @@
1
- import{n as b,o as ke,q as Ie,t as Ne,T as Ce,r as l,b as Fe,a as D,j as a}from"./index-DxYjnckq.js";import{b as Ee,M as Pe,E as Le,O as Re,c as Oe}from"./Icons-DjqYUpg9.js";import{L as y}from"./components-TO4aWqdC.js";const K={sky:{bg900:"bg-sky-900",bg700:"bg-sky-700",bg600:"bg-sky-600",bg500:"bg-sky-500",bg200:"bg-sky-200",ring600:"ring-sky-600",ring500:"ring-sky-500"},purple:{bg900:"bg-purple-900",bg700:"bg-purple-700",bg600:"bg-purple-600",bg500:"bg-purple-500",bg200:"bg-purple-200",ring600:"ring-purple-600",ring500:"ring-purple-500"},pink:{bg900:"bg-pink-900",bg700:"bg-pink-700",bg600:"bg-pink-600",bg500:"bg-pink-500",bg200:"bg-pink-200",ring600:"ring-pink-600",ring500:"ring-pink-500"},slate:{bg900:"bg-slate-900",bg700:"bg-slate-700",bg600:"bg-slate-600",bg500:"bg-slate-500",bg200:"bg-slate-200",ring600:"ring-slate-600",ring500:"ring-slate-500"},green:{bg900:"bg-green-900",bg700:"bg-green-700",bg600:"bg-green-600",bg500:"bg-green-500",bg200:"bg-green-200",ring600:"ring-green-600",ring500:"ring-green-500"},yellow:{bg900:"bg-yellow-900",bg700:"bg-yellow-700",bg600:"bg-yellow-600",bg500:"bg-yellow-500",bg200:"bg-yellow-200",ring600:"ring-yellow-600",ring500:"ring-yellow-500"},red:{bg900:"bg-red-900",bg700:"bg-red-700",bg600:"bg-red-600",bg500:"bg-red-500",bg200:"bg-red-200",ring600:"ring-red-600",ring500:"ring-red-500"}},Ae={agencyProfile:{},loadingAgencyProfile:!1},$e=b({name:"agency",initialState:Ae,reducers:{setAgencyProfile:(e,t)=>{e.agencyProfile=t.payload},setLoadingAgencyProfile:(e,t)=>{e.loadingAgencyProfile=t.payload,e.loadingAgencyProfile=!1}}}),{setAgencyProfile:ut,setLoadingAgencyProfile:pt}=$e.actions,Te={purchaseOrderIdNumber:{data:"",loading:!1},dischargeIdNumber:{data:"NCB00000",loading:!1}},Z=b({name:"automaticNumbers",initialState:Te,reducers:{automaticNumberFetchStart:(e,t)=>{e[t.payload].loading=!0},automaticNumberFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{automaticNumberFetchStart:mt,automaticNumberFetchSuccess:gt}=Z.actions,X=Z.reducer,o=e=>({data:e,loading:!1,reFetch:!1}),Me={agencies:o([]),suggestedPrices:o([]),providers:o([]),providerCategories:o([]),receptionTypes:o([]),tiposDeMuestra:o([]),templates:o([]),shipments:o([]),bookings:o([]),programaciones4pinos:o([]),providerReceptionBlockRules:o([]),providerReceptionExceptions:o([]),motivosRechazo:o([]),ccPorcentajesDeRechazo:o([]),solicitudesEliminacionPO:o([]),poDiscountHistory:o([]),authorizationUpdateDiscountPO:o([]),bitacoraRechazoMasivo:o([]),pesoMaximoPorCanasta:o([]),items:o([]),itemsByReception:o([]),payees:o([]),payeesForLab:o([]),itemCategoriesForLab:o([]),payeeCategoriesLabPrices:o([]),payeeCategories:o([]),clientCategories:o([]),itemsByLab:o([]),itemServicesByLab:o([]),bundlesRecipForLab:o([]),bundlesForLab:o([]),currencies:o([]),paymentTerms:o([]),employees:o([]),employeesByLab:o([]),employeesByCurrentAgency:o([]),invoicesByLab:o([]),invoicesByCurrentAgency:o([]),invoiceForms:o([]),caseForms:o([]),allForms:o([]),invoiceFormSubmissions:o([]),cases:o([]),myCaseFormSubmissions:o([]),myAgencyLotStocks:o([]),shipmentsToMyAgency:o([]),paymentMethods:o([]),printTemplates:o([]),invoiceFormSubmissionsByInvoiceId:o([]),invoiceFormSubmissionsByAgencyId:o([]),caseFormSubmissionsByCaseId:o([])},$=(e,t)=>(e[t]||(e[t]={data:[],loading:!1,reFetch:!1}),e[t]),Y=b({name:"catalogs",initialState:Me,reducers:{catalogsSetReFetch:(e,t)=>{$(e,t.payload).reFetch=!0},catalogsFetchStart:(e,t)=>{$(e,t.payload).loading=!0},catalogsFetchSuccess:(e,t)=>{const s=$(e,t.payload.name);s.data=t.payload.data,s.loading=!1,s.reFetch=!1}}}),{catalogsFetchStart:ft,catalogsFetchSuccess:bt,catalogsSetReFetch:ht}=Y.actions,ee=Y.reducer,Be={formValidations:{}},te=b({name:"formValidation",initialState:Be,reducers:{setFieldError:(e,t)=>{e.formValidations[t.payload.formName]||(e.formValidations[t.payload.formName]={}),e.formValidations[t.payload.formName][t.payload.name]=t.payload.error},clearFieldError:(e,t)=>{var s;(s=e.formValidations[t.payload.formName])==null||delete s[t.payload.name]},clearFormErrors:(e,t)=>{delete e.formValidations[t.payload.formName]}}}),{setFieldError:xt,clearFieldError:yt,clearFormErrors:St}=te.actions,ae=te.reducer,De={},oe=b({name:"formSavedData",initialState:De,reducers:{setFormFieldSavedData:(e,t)=>{e[t.payload.formName]||(e[t.payload.formName]={}),e[t.payload.formName][t.payload.name]=t.payload.value}}}),{setFormFieldSavedData:vt}=oe.actions,ne=oe.reducer,Ve={userProfile:{data:{},loading:!1},oauthProfile:{data:{},loading:!1},employeeProfile:{data:{},loading:!1},agencyProfile:{data:{},loading:!1}},se=b({name:"profile",initialState:Ve,reducers:{profileFetchStart:(e,t)=>{e[t.payload].loading=!0},profileFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{profileFetchStart:wt,profileFetchSuccess:jt}=se.actions,re=se.reducer,_e={basketLots:{data:{},loading:!1,reFetch:!1},rejectionInfo:{data:{},loading:!1,reFetch:!1},newPurchaseOrderInfo:{data:{},loading:!1,reFetch:!1},purchaseOrderGeneralInfo:{data:{},loading:!1,reFetch:!1},poReceptions:{data:[],loading:!1,reFetch:!1},queueReceptions:{data:[],loading:!1,reFetch:!1},offlineQueueReceptions:{data:[],loading:!1,reFetch:!1},offlineQueueShipments:{data:[],loading:!1,reFetch:!1}},ie=b({name:"reception",initialState:_e,reducers:{receptionFetchStart:(e,t)=>{e[t.payload].loading=!0},receptionFetchSuccess:(e,t)=>{e[t.payload.name].data?e[t.payload.name].data=t.payload.data:console.error("receptionFetchSuccess not found: ",t.payload.name),e[t.payload.name].loading=!1},receptionConcatToArray:(e,t)=>{e[t.payload.name].data?Array.isArray(e[t.payload.name].data)&&(e[t.payload.name].data=[...e[t.payload.name].data,t.payload.data]):console.error("receptionConcatToArray not found: ",t.payload.name),e[t.payload.name].loading=!1}}}),{receptionFetchStart:kt,receptionFetchSuccess:It,receptionConcatToArray:Nt}=ie.actions,le=ie.reducer,ze={},ce=b({name:"session",initialState:ze,reducers:{setSessionValue:(e,t)=>{e[t.payload.name]=t.payload.data}}}),{setSessionValue:Ct}=ce.actions,de=ce.reducer,Ue={pageTable1:1,pageTable2:1,pageTable3:1},ue=b({name:"table",initialState:Ue,reducers:{tableSetPage:(e,t)=>{e[t.payload.name]=t.payload.data}}}),{tableSetPage:Ft}=ue.actions,pe=ue.reducer,Ge={receptionTemplate:{data:"",loading:!1}},me=b({name:"template",initialState:Ge,reducers:{templateFetchStart:(e,t)=>{e[t.payload].loading=!0},templateFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{templateFetchStart:Et,templateFetchSuccess:Pt}=me.actions,ge=me.reducer,Qe={userProfile:{},loadingUserProfile:!1,oauthProfile:{},loadingOauthProfile:!1,employeeProfile:{},loadingEmployeeInfo:!1},qe=b({name:"user",initialState:Qe,reducers:{setUserProfile:(e,t)=>{e.userProfile=t.payload,e.loadingUserProfile=!1},setLoadingUserProfile:(e,t)=>{e.loadingUserProfile=t.payload},setOauthProfile:(e,t)=>{e.oauthProfile=t.payload,e.loadingOauthProfile=!1},setLoadingOauthProfile:(e,t)=>{e.loadingOauthProfile=t.payload},setEmployeeProfile:(e,t)=>{e.employeeProfile=t.payload,e.loadingEmployeeInfo=!1},setLoadingEmployeeProfile:(e,t)=>{e.loadingEmployeeInfo=t.payload}}}),{setUserProfile:Lt,setEmployeeProfile:Rt,setOauthProfile:Ot,setLoadingEmployeeProfile:At,setLoadingOauthProfile:$t,setLoadingUserProfile:Tt}=qe.actions,We={specialItems:[],loadingSpecialItems:!1},fe=b({name:"webappTables",initialState:We,reducers:{setLoadingSpecialItems:(e,t)=>{e.loadingSpecialItems=t.payload},setSpecialItems:(e,t)=>{e.specialItems=t.payload,e.loadingSpecialItems=!1}}}),{setLoadingSpecialItems:Mt,setSpecialItems:Bt}=fe.actions,be=fe.reducer,T="___redux__state__v8.0";function He(e){return e instanceof DOMException&&e.name==="QuotaExceededError"?!0:typeof e=="object"&&e!==null&&"name"in e&&e.name==="QuotaExceededError"}function Je(e){if(!(typeof document>"u"))try{localStorage.setItem(T,JSON.stringify(e))}catch(t){if(He(t)){console.warn("[@zauru-sdk/redux] localStorage quota exceeded; Redux state was not persisted.",{key:T,error:t});return}console.error("[@zauru-sdk/redux] Failed to persist Redux state to localStorage.",t)}}const Ke=e=>t=>s=>{const c=t(s);return Je(e.getState()),c},Ze=()=>({catalogs:ee(void 0,{type:"@@INIT"}),profiles:re(void 0,{type:"@@INIT"}),webappTables:be(void 0,{type:"@@INIT"}),receptions:le(void 0,{type:"@@INIT"}),session:de(void 0,{type:"@@INIT"}),templates:ge(void 0,{type:"@@INIT"}),automaticNumbers:X(void 0,{type:"@@INIT"}),tables:pe(void 0,{type:"@@INIT"}),formSavedData:ne(void 0,{type:"@@INIT"}),formValidation:ae(void 0,{type:"@@INIT"})}),H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Xe=(()=>{try{if(!(typeof document>"u")){const e=localStorage.getItem(T);if(e){const t=JSON.parse(e),s=Ze(),c={};for(const r of Object.keys(s)){const p=s[r],d=t==null?void 0:t[r];H(p)&&H(d)?c[r]={...p,...d}:c[r]=d??p}return c}}}catch{}})(),Ye="zauru/RESET_STORE",et=Ie({catalogs:ee,profiles:re,webappTables:be,receptions:le,session:de,templates:ge,automaticNumbers:X,tables:pe,formSavedData:ne,formValidation:ae}),tt=(e,t)=>t.type===Ye?t.payload:et(e,t);Ne({reducer:tt,preloadedState:Xe,middleware:e=>new Ce(Ke)});const at=ke,he=(e,t)=>e.selectedColor?K[e.selectedColor]:t,V=e=>(e.childrens??[]).filter(t=>t.hide!==!0),P=(e,t)=>t?e===t||e.startsWith(`${t}/`):!1,v="focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 focus-visible:ring-offset-transparent",_=(e,t)=>`inline-flex min-h-11 cursor-pointer items-center gap-1 rounded-full px-4 text-xs font-medium uppercase leading-none text-white transition-opacity duration-150 motion-reduce:transition-none ${t?e.bg900:e.bg700} hover:opacity-90 ${v}`,j=e=>`flex min-h-11 w-full cursor-pointer items-center gap-2 rounded-lg px-3 text-left text-sm font-medium text-white transition-colors duration-150 motion-reduce:transition-none hover:bg-white/10 ${v} ${e?"bg-white/15":""}`,M=e=>`flex min-h-11 w-full cursor-pointer items-center gap-2 px-4 text-sm transition-colors duration-150 motion-reduce:transition-none ${e?"text-red-700 hover:bg-red-50":"text-gray-700 hover:bg-gray-100"}`,J=({value:e})=>a.jsx("span",{className:"absolute -top-1.5 -right-1.5 flex h-5 min-w-5 items-center justify-center rounded-full bg-red-500 px-1 text-xs font-bold text-white",children:e}),ot=e=>{const t=at(r=>e.reduxNotificationBadge?e.reduxNotificationBadge(r):void 0),[s,c]=l.useState();return l.useEffect(()=>{c(t)},[t]),s},B=({open:e})=>a.jsx("span",{className:`inline-flex shrink-0 transition-transform duration-150 motion-reduce:transition-none ${e?"rotate-180":""}`,"aria-hidden":"true",children:a.jsx(Oe,{})}),nt=({item:e,color:t,layout:s,onNavigate:c})=>{const r=D(),p=P(r.pathname,e.link),d=ot(e),n=he(e,t);return s==="mobile"?a.jsx("li",{children:a.jsxs(y,{to:e.link,"aria-current":p?"page":void 0,onClick:c,className:`${j(p)} relative`,children:[e.icon,a.jsx("span",{className:"flex-1",children:e.name}),d!==void 0&&a.jsx(J,{value:d})]})}):a.jsx("li",{className:"relative",children:a.jsxs(y,{to:e.link,"aria-current":p?"page":void 0,className:`${_(n,p)} relative`,children:[e.icon,a.jsx("span",{children:e.name}),d!==void 0&&a.jsx(J,{value:d})]})})},st=({item:e,color:t,layout:s,open:c,onToggle:r,onNavigate:p})=>{const d=D(),n=V(e),g=n.some(m=>P(d.pathname,m.link)),u=he(e,t),h=l.useId();return n.length===0?null:s==="mobile"?a.jsxs("li",{children:[a.jsxs("button",{type:"button","aria-expanded":c,"aria-controls":h,onClick:r,className:j(g),children:[e.icon,a.jsx("span",{className:"flex-1",children:e.name}),a.jsx(B,{open:c})]}),a.jsx("ul",{id:h,hidden:!c,className:"mt-1 ml-3 space-y-1 border-l border-white/20 pl-2",children:n.map(m=>{const x=P(d.pathname,m.link);return a.jsx("li",{children:a.jsxs(y,{to:m.link,"aria-current":x?"page":void 0,onClick:p,className:j(x),children:[m.icon,a.jsx("span",{children:m.name})]})},m.link)})})]}):a.jsxs("li",{className:"relative",children:[a.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":c,"aria-controls":h,onClick:r,className:_(u,g),children:[e.icon,a.jsx("span",{children:e.name}),a.jsx(B,{open:c})]}),a.jsx("div",{id:h,role:"menu",hidden:!c,className:"absolute left-0 z-30 mt-2 min-w-[14rem] overflow-hidden rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5",children:n.map(m=>a.jsxs(y,{role:"menuitem",to:m.link,onClick:p,className:M(),children:[m.icon,a.jsx("span",{children:m.name})]},m.link))})]})},rt=({color:e,layout:t,open:s,onToggle:c,onNavigate:r,entries:p})=>{const d=l.useId();return p.length===0?null:t==="mobile"?a.jsxs("div",{className:"mt-4 border-t border-white/20 pt-4",children:[a.jsx("p",{className:"px-3 pb-2 text-xs font-semibold uppercase tracking-wide text-white/70",children:"Cuenta"}),a.jsx("ul",{className:"space-y-1",children:p.map(n=>a.jsx("li",{children:n.to?a.jsxs(y,{to:n.to,onClick:r,className:`${j(!1)} [&_svg]:!text-current ${n.danger?"text-red-100 hover:bg-red-500/20":""}`,children:[n.icon,a.jsx("span",{children:n.label})]}):a.jsxs("button",{type:"button",onClick:()=>{var g;(g=n.onClick)==null||g.call(n),r==null||r()},className:`${j(!1)} [&_svg]:!text-current`,children:[n.icon,a.jsx("span",{children:n.label})]})},n.key))})]}):a.jsxs("div",{className:"relative ml-auto",children:[a.jsxs("button",{type:"button","aria-label":"Menú de usuario","aria-haspopup":"menu","aria-expanded":s,"aria-controls":d,onClick:c,className:`${_(e,s)} p-0 px-3`,children:[a.jsx(Re,{}),a.jsx(B,{open:s})]}),a.jsx("div",{id:d,role:"menu",hidden:!s,className:"absolute right-0 z-30 mt-2 w-56 overflow-hidden rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5",children:p.map(n=>n.to?a.jsxs(y,{role:"menuitem",to:n.to,onClick:r,className:M(n.danger),children:[n.icon,a.jsx("span",{children:n.label})]},n.key):a.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{var g;(g=n.onClick)==null||g.call(n),r==null||r()},className:M(n.danger),children:[n.icon,a.jsx("span",{children:n.label})]},n.key))})]})},it=({items:e,color:t,layout:s,openMenuId:c,setOpenMenuId:r,onNavigate:p})=>a.jsx("ul",{className:s==="mobile"?"flex flex-col gap-1":"flex flex-wrap items-center gap-1",children:e.map((d,n)=>{const g=V(d),u=`${d.name}-${n}`;return g.length>0?a.jsx(st,{item:d,color:t,layout:s,open:c===u,onToggle:()=>r(h=>h===u?null:u),onNavigate:p},u):a.jsx(nt,{item:d,color:t,layout:s,onNavigate:p},u)})}),k=({title:e,loggedIn:t,items:s,selectedColor:c,version:r,reloadCatalogsOption:p,settingsOption:d,showDarkModeToggle:n=!1})=>{const g=K[c],[u,h]=l.useState(!1),[m,x]=l.useState(null),[ye,w]=l.useState(null),[L,Se]=l.useState(r),[N,ve]=l.useState(!1),we=Fe(),R=D(),U=l.useRef(null),O=l.useRef(null),G=l.useRef(!1),Q=l.useId(),C=l.useMemo(()=>s.filter(i=>i.loggedIn===t&&i.hide!==!0),[s,t]);l.useEffect(()=>{document.documentElement.classList.toggle("dark",N)},[N]),l.useEffect(()=>{r!==L&&Se(r)},[r,L]),l.useEffect(()=>{h(!1),x(null),w(null)},[R.pathname]),l.useEffect(()=>{if(!u)return;const i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=i}},[u]),l.useEffect(()=>{const i=O.current;i&&(u?i.removeAttribute("inert"):i.setAttribute("inert",""))},[u]),l.useEffect(()=>{const i=f=>{f.key==="Escape"&&(h(!1),x(null),w(null))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[]),l.useEffect(()=>{if(!m)return;const i=f=>{var F,E;const S=f.target;(F=O.current)!=null&&F.contains(S)||(E=U.current)!=null&&E.contains(S)||x(null)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[m]);const A=()=>{h(!1),x(null),w(null)},q=()=>{window.setTimeout(A,0)},je=l.useMemo(()=>{if(!t)return[];const i=[];return d&&i.push({key:"configuracion",label:"Configuración",to:"/configuracion",icon:a.jsxs("svg",{className:"h-5 w-5 shrink-0",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[a.jsx("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"}),a.jsx("path",{d:"M19.4 13a7.7 7.7 0 0 0 .06-2l2.1-1.64-2-3.46-2.55 1a7.7 7.7 0 0 0-1.73-1L14.7 2H9.3l-.58 2.9a7.7 7.7 0 0 0-1.73 1l-2.55-1-2 3.46L4.54 11a7.7 7.7 0 0 0 0 2l-2.1 1.64 2 3.46 2.55-1a7.7 7.7 0 0 0 1.73 1L9.3 22h5.4l.58-2.9a7.7 7.7 0 0 0 1.73-1l2.55 1 2-3.46Z"})]})}),p&&i.push({key:"recargar-catalogos",label:"Recargar catálogos",to:"/reload-catalogs",icon:a.jsxs("svg",{className:"h-5 w-5 shrink-0",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[a.jsx("path",{d:"M20.5 8c-1.392-3.179-4.823-5-8.522-5C7.299 3 3.453 6.552 3 11.1"}),a.jsx("path",{d:"M16.489 8.4h3.97A.54.54 0 0 0 21 7.86V3.9M3.5 16c1.392 3.179 4.823 5 8.522 5 4.679 0 8.525-3.552 8.978-8.1"}),a.jsx("path",{d:"M7.511 15.6h-3.97a.54.54 0 0 0-.541.54v3.96"})]})}),n&&i.push({key:"dark-mode-toggle",label:N?"Modo claro":"Modo oscuro",onClick:()=>ve(f=>!f)}),i.push({key:"cerrar-sesion",label:"Cerrar sesión",to:"/logout",icon:a.jsx(Ee,{}),danger:!0}),i},[t,d,p,n,N]);l.useEffect(()=>{const i=u&&!G.current;if(G.current=u,!i)return;const f=C.find(F=>V(F).some(E=>P(R.pathname,E.link)));if(!f)return;const S=C.indexOf(f);w(`${f.name}-${S}`)},[u,C,R.pathname]);const W=i=>{const f=i==="mobile";return a.jsxs(a.Fragment,{children:[a.jsx(it,{items:C,color:g,layout:i,openMenuId:f?ye:m,setOpenMenuId:f?w:x,onNavigate:q}),a.jsx(rt,{color:g,layout:i,open:m==="user",onToggle:()=>x(S=>S==="user"?null:"user"),onNavigate:q,entries:je})]})};return a.jsx("nav",{className:`py-2 ${g.bg600}`,"aria-label":"Principal",children:a.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between gap-2 lg:w-auto lg:flex-none",children:[a.jsxs(y,{className:`inline-flex min-h-11 min-w-0 cursor-pointer items-center gap-2 truncate text-sm font-bold uppercase text-white ${v}`,to:"/home",children:[a.jsx("img",{className:"h-7 w-auto shrink-0",src:"/logo.png",alt:""}),a.jsx("span",{className:"truncate",children:e})]}),r!==L&&a.jsx("button",{type:"button",className:`shrink-0 cursor-pointer rounded-full px-3 py-2 text-xs text-white ${g.bg700} hover:opacity-90 ${v}`,onClick:()=>we(0),children:"Actualizar versión"}),a.jsx("button",{type:"button",className:`inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-md text-white lg:hidden ${v} ${u?"pointer-events-none invisible":""}`,"aria-label":"Abrir menú","aria-expanded":u,"aria-controls":Q,"aria-hidden":u,tabIndex:u?-1:void 0,onClick:()=>h(!0),children:a.jsx(Pe,{open:!1})})]}),u&&a.jsx("button",{type:"button","aria-label":"Cerrar menú",className:"fixed inset-0 z-40 cursor-pointer bg-black/40 lg:hidden",onClick:A}),a.jsxs("div",{ref:O,id:Q,"aria-hidden":!u,className:`fixed inset-y-0 left-0 z-50 flex w-[min(20rem,86vw)] flex-col ${g.bg700} shadow-lg transition-transform duration-200 ease-out motion-reduce:transition-none lg:hidden ${u?"translate-x-0":"pointer-events-none -translate-x-full"}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-white/15 px-4 py-3",children:[a.jsx("p",{className:"truncate text-sm font-bold uppercase text-white",children:e}),a.jsx("button",{type:"button",className:`inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-md text-white ${v}`,"aria-label":"Cerrar menú",onClick:A,children:a.jsx(Le,{})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain p-3",children:W("mobile")})]}),a.jsx("div",{ref:U,className:"hidden min-w-0 flex-1 items-center gap-2 lg:flex",children:W("desktop")})]})})},z=[{name:"Nueva contraseña",link:"/receptions/new",loggedIn:!0,selectedColor:"green"},{name:"Cierre de turno",link:"/cierre-turno",loggedIn:!0},{name:"Contraseñas",link:"/receptions",loggedIn:!0},{name:"Procesos",link:"/processes",loggedIn:!0},{name:"Envíos",link:"/shipments",loggedIn:!0,childrens:[{name:"Listado de envíos",link:"/shipments",loggedIn:!0},{name:"Nuevo envío",link:"/shipments/new",loggedIn:!0}]}],xe=[{name:"Configuración",link:"/configuration",loggedIn:!0},{name:"Modificar costos",link:"/prices",loggedIn:!0},{name:"Bitácora",link:"/history",loggedIn:!0}],I=({children:e})=>a.jsx("div",{className:"-m-6 min-h-screen bg-slate-100",children:e}),Dt=()=>a.jsx(I,{children:a.jsx(k,{title:"Recepción de Verduras",items:z,loggedIn:!0,selectedColor:"slate",settingsOption:!0,reloadCatalogsOption:!0})}),Vt=()=>a.jsx(I,{children:a.jsx(k,{title:"Costos de verduras",items:xe,loggedIn:!0,selectedColor:"green",settingsOption:!0})}),_t=()=>a.jsx(I,{children:a.jsx(k,{title:"Control de calidad operativo",items:z.map(e=>({...e,selectedColor:void 0})),loggedIn:!0,selectedColor:"yellow",settingsOption:!0,reloadCatalogsOption:!0})}),zt=()=>a.jsx(I,{children:a.jsx(k,{title:"Agri-Food Safety Lab",items:xe,loggedIn:!0,selectedColor:"sky",settingsOption:!0})}),Ut=()=>a.jsx(I,{children:a.jsx(k,{title:"Envíos",items:z.filter(e=>e.name==="Envíos"),loggedIn:!0,selectedColor:"red",settingsOption:!0,reloadCatalogsOption:!0})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{_t as CalidadYellow,Vt as CostosGreen,Ut as EnviosRed,zt as LaboratorioSky,Dt as RecepcionesSlate};
1
+ import{n as b,o as ke,q as Ie,t as Ne,T as Ce,r as l,b as Fe,a as D,j as a}from"./index-DUSjZECW.js";import{b as Ee,M as Pe,E as Le,O as Re,c as Oe}from"./Icons-BxLN_JWC.js";import{L as y}from"./components-FzdPzEyL.js";const K={sky:{bg900:"bg-sky-900",bg700:"bg-sky-700",bg600:"bg-sky-600",bg500:"bg-sky-500",bg200:"bg-sky-200",ring600:"ring-sky-600",ring500:"ring-sky-500"},purple:{bg900:"bg-purple-900",bg700:"bg-purple-700",bg600:"bg-purple-600",bg500:"bg-purple-500",bg200:"bg-purple-200",ring600:"ring-purple-600",ring500:"ring-purple-500"},pink:{bg900:"bg-pink-900",bg700:"bg-pink-700",bg600:"bg-pink-600",bg500:"bg-pink-500",bg200:"bg-pink-200",ring600:"ring-pink-600",ring500:"ring-pink-500"},slate:{bg900:"bg-slate-900",bg700:"bg-slate-700",bg600:"bg-slate-600",bg500:"bg-slate-500",bg200:"bg-slate-200",ring600:"ring-slate-600",ring500:"ring-slate-500"},green:{bg900:"bg-green-900",bg700:"bg-green-700",bg600:"bg-green-600",bg500:"bg-green-500",bg200:"bg-green-200",ring600:"ring-green-600",ring500:"ring-green-500"},yellow:{bg900:"bg-yellow-900",bg700:"bg-yellow-700",bg600:"bg-yellow-600",bg500:"bg-yellow-500",bg200:"bg-yellow-200",ring600:"ring-yellow-600",ring500:"ring-yellow-500"},red:{bg900:"bg-red-900",bg700:"bg-red-700",bg600:"bg-red-600",bg500:"bg-red-500",bg200:"bg-red-200",ring600:"ring-red-600",ring500:"ring-red-500"}},Ae={agencyProfile:{},loadingAgencyProfile:!1},$e=b({name:"agency",initialState:Ae,reducers:{setAgencyProfile:(e,t)=>{e.agencyProfile=t.payload},setLoadingAgencyProfile:(e,t)=>{e.loadingAgencyProfile=t.payload,e.loadingAgencyProfile=!1}}}),{setAgencyProfile:ut,setLoadingAgencyProfile:pt}=$e.actions,Te={purchaseOrderIdNumber:{data:"",loading:!1},dischargeIdNumber:{data:"NCB00000",loading:!1}},Z=b({name:"automaticNumbers",initialState:Te,reducers:{automaticNumberFetchStart:(e,t)=>{e[t.payload].loading=!0},automaticNumberFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{automaticNumberFetchStart:mt,automaticNumberFetchSuccess:gt}=Z.actions,X=Z.reducer,o=e=>({data:e,loading:!1,reFetch:!1}),Me={agencies:o([]),suggestedPrices:o([]),providers:o([]),providerCategories:o([]),receptionTypes:o([]),tiposDeMuestra:o([]),templates:o([]),shipments:o([]),bookings:o([]),programaciones4pinos:o([]),providerReceptionBlockRules:o([]),providerReceptionExceptions:o([]),motivosRechazo:o([]),ccPorcentajesDeRechazo:o([]),solicitudesEliminacionPO:o([]),poDiscountHistory:o([]),authorizationUpdateDiscountPO:o([]),bitacoraRechazoMasivo:o([]),pesoMaximoPorCanasta:o([]),items:o([]),itemsByReception:o([]),payees:o([]),payeesForLab:o([]),itemCategoriesForLab:o([]),payeeCategoriesLabPrices:o([]),payeeCategories:o([]),clientCategories:o([]),itemsByLab:o([]),itemServicesByLab:o([]),bundlesRecipForLab:o([]),bundlesForLab:o([]),currencies:o([]),paymentTerms:o([]),employees:o([]),employeesByLab:o([]),employeesByCurrentAgency:o([]),invoicesByLab:o([]),invoicesByCurrentAgency:o([]),invoiceForms:o([]),caseForms:o([]),allForms:o([]),invoiceFormSubmissions:o([]),cases:o([]),myCaseFormSubmissions:o([]),myAgencyLotStocks:o([]),shipmentsToMyAgency:o([]),paymentMethods:o([]),printTemplates:o([]),invoiceFormSubmissionsByInvoiceId:o([]),invoiceFormSubmissionsByAgencyId:o([]),caseFormSubmissionsByCaseId:o([])},$=(e,t)=>(e[t]||(e[t]={data:[],loading:!1,reFetch:!1}),e[t]),Y=b({name:"catalogs",initialState:Me,reducers:{catalogsSetReFetch:(e,t)=>{$(e,t.payload).reFetch=!0},catalogsFetchStart:(e,t)=>{$(e,t.payload).loading=!0},catalogsFetchSuccess:(e,t)=>{const s=$(e,t.payload.name);s.data=t.payload.data,s.loading=!1,s.reFetch=!1}}}),{catalogsFetchStart:ft,catalogsFetchSuccess:bt,catalogsSetReFetch:ht}=Y.actions,ee=Y.reducer,Be={formValidations:{}},te=b({name:"formValidation",initialState:Be,reducers:{setFieldError:(e,t)=>{e.formValidations[t.payload.formName]||(e.formValidations[t.payload.formName]={}),e.formValidations[t.payload.formName][t.payload.name]=t.payload.error},clearFieldError:(e,t)=>{var s;(s=e.formValidations[t.payload.formName])==null||delete s[t.payload.name]},clearFormErrors:(e,t)=>{delete e.formValidations[t.payload.formName]}}}),{setFieldError:xt,clearFieldError:yt,clearFormErrors:St}=te.actions,ae=te.reducer,De={},oe=b({name:"formSavedData",initialState:De,reducers:{setFormFieldSavedData:(e,t)=>{e[t.payload.formName]||(e[t.payload.formName]={}),e[t.payload.formName][t.payload.name]=t.payload.value}}}),{setFormFieldSavedData:vt}=oe.actions,ne=oe.reducer,Ve={userProfile:{data:{},loading:!1},oauthProfile:{data:{},loading:!1},employeeProfile:{data:{},loading:!1},agencyProfile:{data:{},loading:!1}},se=b({name:"profile",initialState:Ve,reducers:{profileFetchStart:(e,t)=>{e[t.payload].loading=!0},profileFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{profileFetchStart:wt,profileFetchSuccess:jt}=se.actions,re=se.reducer,_e={basketLots:{data:{},loading:!1,reFetch:!1},rejectionInfo:{data:{},loading:!1,reFetch:!1},newPurchaseOrderInfo:{data:{},loading:!1,reFetch:!1},purchaseOrderGeneralInfo:{data:{},loading:!1,reFetch:!1},poReceptions:{data:[],loading:!1,reFetch:!1},queueReceptions:{data:[],loading:!1,reFetch:!1},offlineQueueReceptions:{data:[],loading:!1,reFetch:!1},offlineQueueShipments:{data:[],loading:!1,reFetch:!1}},ie=b({name:"reception",initialState:_e,reducers:{receptionFetchStart:(e,t)=>{e[t.payload].loading=!0},receptionFetchSuccess:(e,t)=>{e[t.payload.name].data?e[t.payload.name].data=t.payload.data:console.error("receptionFetchSuccess not found: ",t.payload.name),e[t.payload.name].loading=!1},receptionConcatToArray:(e,t)=>{e[t.payload.name].data?Array.isArray(e[t.payload.name].data)&&(e[t.payload.name].data=[...e[t.payload.name].data,t.payload.data]):console.error("receptionConcatToArray not found: ",t.payload.name),e[t.payload.name].loading=!1}}}),{receptionFetchStart:kt,receptionFetchSuccess:It,receptionConcatToArray:Nt}=ie.actions,le=ie.reducer,ze={},ce=b({name:"session",initialState:ze,reducers:{setSessionValue:(e,t)=>{e[t.payload.name]=t.payload.data}}}),{setSessionValue:Ct}=ce.actions,de=ce.reducer,Ue={pageTable1:1,pageTable2:1,pageTable3:1},ue=b({name:"table",initialState:Ue,reducers:{tableSetPage:(e,t)=>{e[t.payload.name]=t.payload.data}}}),{tableSetPage:Ft}=ue.actions,pe=ue.reducer,Ge={receptionTemplate:{data:"",loading:!1}},me=b({name:"template",initialState:Ge,reducers:{templateFetchStart:(e,t)=>{e[t.payload].loading=!0},templateFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{templateFetchStart:Et,templateFetchSuccess:Pt}=me.actions,ge=me.reducer,Qe={userProfile:{},loadingUserProfile:!1,oauthProfile:{},loadingOauthProfile:!1,employeeProfile:{},loadingEmployeeInfo:!1},qe=b({name:"user",initialState:Qe,reducers:{setUserProfile:(e,t)=>{e.userProfile=t.payload,e.loadingUserProfile=!1},setLoadingUserProfile:(e,t)=>{e.loadingUserProfile=t.payload},setOauthProfile:(e,t)=>{e.oauthProfile=t.payload,e.loadingOauthProfile=!1},setLoadingOauthProfile:(e,t)=>{e.loadingOauthProfile=t.payload},setEmployeeProfile:(e,t)=>{e.employeeProfile=t.payload,e.loadingEmployeeInfo=!1},setLoadingEmployeeProfile:(e,t)=>{e.loadingEmployeeInfo=t.payload}}}),{setUserProfile:Lt,setEmployeeProfile:Rt,setOauthProfile:Ot,setLoadingEmployeeProfile:At,setLoadingOauthProfile:$t,setLoadingUserProfile:Tt}=qe.actions,We={specialItems:[],loadingSpecialItems:!1},fe=b({name:"webappTables",initialState:We,reducers:{setLoadingSpecialItems:(e,t)=>{e.loadingSpecialItems=t.payload},setSpecialItems:(e,t)=>{e.specialItems=t.payload,e.loadingSpecialItems=!1}}}),{setLoadingSpecialItems:Mt,setSpecialItems:Bt}=fe.actions,be=fe.reducer,T="___redux__state__v8.0";function He(e){return e instanceof DOMException&&e.name==="QuotaExceededError"?!0:typeof e=="object"&&e!==null&&"name"in e&&e.name==="QuotaExceededError"}function Je(e){if(!(typeof document>"u"))try{localStorage.setItem(T,JSON.stringify(e))}catch(t){if(He(t)){console.warn("[@zauru-sdk/redux] localStorage quota exceeded; Redux state was not persisted.",{key:T,error:t});return}console.error("[@zauru-sdk/redux] Failed to persist Redux state to localStorage.",t)}}const Ke=e=>t=>s=>{const c=t(s);return Je(e.getState()),c},Ze=()=>({catalogs:ee(void 0,{type:"@@INIT"}),profiles:re(void 0,{type:"@@INIT"}),webappTables:be(void 0,{type:"@@INIT"}),receptions:le(void 0,{type:"@@INIT"}),session:de(void 0,{type:"@@INIT"}),templates:ge(void 0,{type:"@@INIT"}),automaticNumbers:X(void 0,{type:"@@INIT"}),tables:pe(void 0,{type:"@@INIT"}),formSavedData:ne(void 0,{type:"@@INIT"}),formValidation:ae(void 0,{type:"@@INIT"})}),H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Xe=(()=>{try{if(!(typeof document>"u")){const e=localStorage.getItem(T);if(e){const t=JSON.parse(e),s=Ze(),c={};for(const r of Object.keys(s)){const p=s[r],d=t==null?void 0:t[r];H(p)&&H(d)?c[r]={...p,...d}:c[r]=d??p}return c}}}catch{}})(),Ye="zauru/RESET_STORE",et=Ie({catalogs:ee,profiles:re,webappTables:be,receptions:le,session:de,templates:ge,automaticNumbers:X,tables:pe,formSavedData:ne,formValidation:ae}),tt=(e,t)=>t.type===Ye?t.payload:et(e,t);Ne({reducer:tt,preloadedState:Xe,middleware:e=>new Ce(Ke)});const at=ke,he=(e,t)=>e.selectedColor?K[e.selectedColor]:t,V=e=>(e.childrens??[]).filter(t=>t.hide!==!0),P=(e,t)=>t?e===t||e.startsWith(`${t}/`):!1,v="focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 focus-visible:ring-offset-transparent",_=(e,t)=>`inline-flex min-h-11 cursor-pointer items-center gap-1 rounded-full px-4 text-xs font-medium uppercase leading-none text-white transition-opacity duration-150 motion-reduce:transition-none ${t?e.bg900:e.bg700} hover:opacity-90 ${v}`,j=e=>`flex min-h-11 w-full cursor-pointer items-center gap-2 rounded-lg px-3 text-left text-sm font-medium text-white transition-colors duration-150 motion-reduce:transition-none hover:bg-white/10 ${v} ${e?"bg-white/15":""}`,M=e=>`flex min-h-11 w-full cursor-pointer items-center gap-2 px-4 text-sm transition-colors duration-150 motion-reduce:transition-none ${e?"text-red-700 hover:bg-red-50":"text-gray-700 hover:bg-gray-100"}`,J=({value:e})=>a.jsx("span",{className:"absolute -top-1.5 -right-1.5 flex h-5 min-w-5 items-center justify-center rounded-full bg-red-500 px-1 text-xs font-bold text-white",children:e}),ot=e=>{const t=at(r=>e.reduxNotificationBadge?e.reduxNotificationBadge(r):void 0),[s,c]=l.useState();return l.useEffect(()=>{c(t)},[t]),s},B=({open:e})=>a.jsx("span",{className:`inline-flex shrink-0 transition-transform duration-150 motion-reduce:transition-none ${e?"rotate-180":""}`,"aria-hidden":"true",children:a.jsx(Oe,{})}),nt=({item:e,color:t,layout:s,onNavigate:c})=>{const r=D(),p=P(r.pathname,e.link),d=ot(e),n=he(e,t);return s==="mobile"?a.jsx("li",{children:a.jsxs(y,{to:e.link,"aria-current":p?"page":void 0,onClick:c,className:`${j(p)} relative`,children:[e.icon,a.jsx("span",{className:"flex-1",children:e.name}),d!==void 0&&a.jsx(J,{value:d})]})}):a.jsx("li",{className:"relative",children:a.jsxs(y,{to:e.link,"aria-current":p?"page":void 0,className:`${_(n,p)} relative`,children:[e.icon,a.jsx("span",{children:e.name}),d!==void 0&&a.jsx(J,{value:d})]})})},st=({item:e,color:t,layout:s,open:c,onToggle:r,onNavigate:p})=>{const d=D(),n=V(e),g=n.some(m=>P(d.pathname,m.link)),u=he(e,t),h=l.useId();return n.length===0?null:s==="mobile"?a.jsxs("li",{children:[a.jsxs("button",{type:"button","aria-expanded":c,"aria-controls":h,onClick:r,className:j(g),children:[e.icon,a.jsx("span",{className:"flex-1",children:e.name}),a.jsx(B,{open:c})]}),a.jsx("ul",{id:h,hidden:!c,className:"mt-1 ml-3 space-y-1 border-l border-white/20 pl-2",children:n.map(m=>{const x=P(d.pathname,m.link);return a.jsx("li",{children:a.jsxs(y,{to:m.link,"aria-current":x?"page":void 0,onClick:p,className:j(x),children:[m.icon,a.jsx("span",{children:m.name})]})},m.link)})})]}):a.jsxs("li",{className:"relative",children:[a.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":c,"aria-controls":h,onClick:r,className:_(u,g),children:[e.icon,a.jsx("span",{children:e.name}),a.jsx(B,{open:c})]}),a.jsx("div",{id:h,role:"menu",hidden:!c,className:"absolute left-0 z-30 mt-2 min-w-[14rem] overflow-hidden rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5",children:n.map(m=>a.jsxs(y,{role:"menuitem",to:m.link,onClick:p,className:M(),children:[m.icon,a.jsx("span",{children:m.name})]},m.link))})]})},rt=({color:e,layout:t,open:s,onToggle:c,onNavigate:r,entries:p})=>{const d=l.useId();return p.length===0?null:t==="mobile"?a.jsxs("div",{className:"mt-4 border-t border-white/20 pt-4",children:[a.jsx("p",{className:"px-3 pb-2 text-xs font-semibold uppercase tracking-wide text-white/70",children:"Cuenta"}),a.jsx("ul",{className:"space-y-1",children:p.map(n=>a.jsx("li",{children:n.to?a.jsxs(y,{to:n.to,onClick:r,className:`${j(!1)} [&_svg]:!text-current ${n.danger?"text-red-100 hover:bg-red-500/20":""}`,children:[n.icon,a.jsx("span",{children:n.label})]}):a.jsxs("button",{type:"button",onClick:()=>{var g;(g=n.onClick)==null||g.call(n),r==null||r()},className:`${j(!1)} [&_svg]:!text-current`,children:[n.icon,a.jsx("span",{children:n.label})]})},n.key))})]}):a.jsxs("div",{className:"relative ml-auto",children:[a.jsxs("button",{type:"button","aria-label":"Menú de usuario","aria-haspopup":"menu","aria-expanded":s,"aria-controls":d,onClick:c,className:`${_(e,s)} p-0 px-3`,children:[a.jsx(Re,{}),a.jsx(B,{open:s})]}),a.jsx("div",{id:d,role:"menu",hidden:!s,className:"absolute right-0 z-30 mt-2 w-56 overflow-hidden rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5",children:p.map(n=>n.to?a.jsxs(y,{role:"menuitem",to:n.to,onClick:r,className:M(n.danger),children:[n.icon,a.jsx("span",{children:n.label})]},n.key):a.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{var g;(g=n.onClick)==null||g.call(n),r==null||r()},className:M(n.danger),children:[n.icon,a.jsx("span",{children:n.label})]},n.key))})]})},it=({items:e,color:t,layout:s,openMenuId:c,setOpenMenuId:r,onNavigate:p})=>a.jsx("ul",{className:s==="mobile"?"flex flex-col gap-1":"flex flex-wrap items-center gap-1",children:e.map((d,n)=>{const g=V(d),u=`${d.name}-${n}`;return g.length>0?a.jsx(st,{item:d,color:t,layout:s,open:c===u,onToggle:()=>r(h=>h===u?null:u),onNavigate:p},u):a.jsx(nt,{item:d,color:t,layout:s,onNavigate:p},u)})}),k=({title:e,loggedIn:t,items:s,selectedColor:c,version:r,reloadCatalogsOption:p,settingsOption:d,showDarkModeToggle:n=!1})=>{const g=K[c],[u,h]=l.useState(!1),[m,x]=l.useState(null),[ye,w]=l.useState(null),[L,Se]=l.useState(r),[N,ve]=l.useState(!1),we=Fe(),R=D(),U=l.useRef(null),O=l.useRef(null),G=l.useRef(!1),Q=l.useId(),C=l.useMemo(()=>s.filter(i=>i.loggedIn===t&&i.hide!==!0),[s,t]);l.useEffect(()=>{document.documentElement.classList.toggle("dark",N)},[N]),l.useEffect(()=>{r!==L&&Se(r)},[r,L]),l.useEffect(()=>{h(!1),x(null),w(null)},[R.pathname]),l.useEffect(()=>{if(!u)return;const i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=i}},[u]),l.useEffect(()=>{const i=O.current;i&&(u?i.removeAttribute("inert"):i.setAttribute("inert",""))},[u]),l.useEffect(()=>{const i=f=>{f.key==="Escape"&&(h(!1),x(null),w(null))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[]),l.useEffect(()=>{if(!m)return;const i=f=>{var F,E;const S=f.target;(F=O.current)!=null&&F.contains(S)||(E=U.current)!=null&&E.contains(S)||x(null)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[m]);const A=()=>{h(!1),x(null),w(null)},q=()=>{window.setTimeout(A,0)},je=l.useMemo(()=>{if(!t)return[];const i=[];return d&&i.push({key:"configuracion",label:"Configuración",to:"/configuracion",icon:a.jsxs("svg",{className:"h-5 w-5 shrink-0",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[a.jsx("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"}),a.jsx("path",{d:"M19.4 13a7.7 7.7 0 0 0 .06-2l2.1-1.64-2-3.46-2.55 1a7.7 7.7 0 0 0-1.73-1L14.7 2H9.3l-.58 2.9a7.7 7.7 0 0 0-1.73 1l-2.55-1-2 3.46L4.54 11a7.7 7.7 0 0 0 0 2l-2.1 1.64 2 3.46 2.55-1a7.7 7.7 0 0 0 1.73 1L9.3 22h5.4l.58-2.9a7.7 7.7 0 0 0 1.73-1l2.55 1 2-3.46Z"})]})}),p&&i.push({key:"recargar-catalogos",label:"Recargar catálogos",to:"/reload-catalogs",icon:a.jsxs("svg",{className:"h-5 w-5 shrink-0",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[a.jsx("path",{d:"M20.5 8c-1.392-3.179-4.823-5-8.522-5C7.299 3 3.453 6.552 3 11.1"}),a.jsx("path",{d:"M16.489 8.4h3.97A.54.54 0 0 0 21 7.86V3.9M3.5 16c1.392 3.179 4.823 5 8.522 5 4.679 0 8.525-3.552 8.978-8.1"}),a.jsx("path",{d:"M7.511 15.6h-3.97a.54.54 0 0 0-.541.54v3.96"})]})}),n&&i.push({key:"dark-mode-toggle",label:N?"Modo claro":"Modo oscuro",onClick:()=>ve(f=>!f)}),i.push({key:"cerrar-sesion",label:"Cerrar sesión",to:"/logout",icon:a.jsx(Ee,{}),danger:!0}),i},[t,d,p,n,N]);l.useEffect(()=>{const i=u&&!G.current;if(G.current=u,!i)return;const f=C.find(F=>V(F).some(E=>P(R.pathname,E.link)));if(!f)return;const S=C.indexOf(f);w(`${f.name}-${S}`)},[u,C,R.pathname]);const W=i=>{const f=i==="mobile";return a.jsxs(a.Fragment,{children:[a.jsx(it,{items:C,color:g,layout:i,openMenuId:f?ye:m,setOpenMenuId:f?w:x,onNavigate:q}),a.jsx(rt,{color:g,layout:i,open:m==="user",onToggle:()=>x(S=>S==="user"?null:"user"),onNavigate:q,entries:je})]})};return a.jsx("nav",{className:`py-2 ${g.bg600}`,"aria-label":"Principal",children:a.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between gap-2 lg:w-auto lg:flex-none",children:[a.jsxs(y,{className:`inline-flex min-h-11 min-w-0 cursor-pointer items-center gap-2 truncate text-sm font-bold uppercase text-white ${v}`,to:"/home",children:[a.jsx("img",{className:"h-7 w-auto shrink-0",src:"/logo.png",alt:""}),a.jsx("span",{className:"truncate",children:e})]}),r!==L&&a.jsx("button",{type:"button",className:`shrink-0 cursor-pointer rounded-full px-3 py-2 text-xs text-white ${g.bg700} hover:opacity-90 ${v}`,onClick:()=>we(0),children:"Actualizar versión"}),a.jsx("button",{type:"button",className:`inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-md text-white lg:hidden ${v} ${u?"pointer-events-none invisible":""}`,"aria-label":"Abrir menú","aria-expanded":u,"aria-controls":Q,"aria-hidden":u,tabIndex:u?-1:void 0,onClick:()=>h(!0),children:a.jsx(Pe,{open:!1})})]}),u&&a.jsx("button",{type:"button","aria-label":"Cerrar menú",className:"fixed inset-0 z-40 cursor-pointer bg-black/40 lg:hidden",onClick:A}),a.jsxs("div",{ref:O,id:Q,"aria-hidden":!u,className:`fixed inset-y-0 left-0 z-50 flex w-[min(20rem,86vw)] flex-col ${g.bg700} shadow-lg transition-transform duration-200 ease-out motion-reduce:transition-none lg:hidden ${u?"translate-x-0":"pointer-events-none -translate-x-full"}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-white/15 px-4 py-3",children:[a.jsx("p",{className:"truncate text-sm font-bold uppercase text-white",children:e}),a.jsx("button",{type:"button",className:`inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-md text-white ${v}`,"aria-label":"Cerrar menú",onClick:A,children:a.jsx(Le,{})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain p-3",children:W("mobile")})]}),a.jsx("div",{ref:U,className:"hidden min-w-0 flex-1 items-center gap-2 lg:flex",children:W("desktop")})]})})},z=[{name:"Nueva contraseña",link:"/receptions/new",loggedIn:!0,selectedColor:"green"},{name:"Cierre de turno",link:"/cierre-turno",loggedIn:!0},{name:"Contraseñas",link:"/receptions",loggedIn:!0},{name:"Procesos",link:"/processes",loggedIn:!0},{name:"Envíos",link:"/shipments",loggedIn:!0,childrens:[{name:"Listado de envíos",link:"/shipments",loggedIn:!0},{name:"Nuevo envío",link:"/shipments/new",loggedIn:!0}]}],xe=[{name:"Configuración",link:"/configuration",loggedIn:!0},{name:"Modificar costos",link:"/prices",loggedIn:!0},{name:"Bitácora",link:"/history",loggedIn:!0}],I=({children:e})=>a.jsx("div",{className:"-m-6 min-h-screen bg-slate-100",children:e}),Dt=()=>a.jsx(I,{children:a.jsx(k,{title:"Recepción de Verduras",items:z,loggedIn:!0,selectedColor:"slate",settingsOption:!0,reloadCatalogsOption:!0})}),Vt=()=>a.jsx(I,{children:a.jsx(k,{title:"Costos de verduras",items:xe,loggedIn:!0,selectedColor:"green",settingsOption:!0})}),_t=()=>a.jsx(I,{children:a.jsx(k,{title:"Control de calidad operativo",items:z.map(e=>({...e,selectedColor:void 0})),loggedIn:!0,selectedColor:"yellow",settingsOption:!0,reloadCatalogsOption:!0})}),zt=()=>a.jsx(I,{children:a.jsx(k,{title:"Agri-Food Safety Lab",items:xe,loggedIn:!0,selectedColor:"sky",settingsOption:!0})}),Ut=()=>a.jsx(I,{children:a.jsx(k,{title:"Envíos",items:z.filter(e=>e.name==="Envíos"),loggedIn:!0,selectedColor:"red",settingsOption:!0,reloadCatalogsOption:!0})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{_t as CalidadYellow,Vt as CostosGreen,Ut as EnviosRed,zt as LaboratorioSky,Dt as RecepcionesSlate};
@@ -0,0 +1 @@
1
+ import{r as s,j as e}from"./index-DUSjZECW.js";import{h as E,i as M,p as k,m as f,A as z}from"./proxy-BETbFm71.js";function C(){!E.current&&M();const[r]=s.useState(k.current);return r}const g=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",clipRule:"evenodd"})}),v=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"})}),L=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fillRule:"evenodd",d:"M3 6a1 1 0 011-1h16a1 1 0 110 2H4a1 1 0 01-1-1zm0 6a1 1 0 011-1h10a1 1 0 110 2H4a1 1 0 01-1-1zm0 6a1 1 0 011-1h4a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"})}),I=({children:r,closeOnClickOutside:a=!0,widthPercentage:b=25,buttonIcon:l="chevron",ariaLabel:y="Panel lateral",openButtonLabel:j="Abrir panel",closeButtonLabel:m="Cerrar panel"})=>{const[t,o]=s.useState(!1),d=s.useRef(null),h=s.useRef(null),p=s.useRef(null),c=s.useRef(!1),x=s.useId(),u=C(),w=()=>{o(n=>!n)};s.useEffect(()=>{const n=i=>{t&&a&&d.current&&!d.current.contains(i.target)&&o(!1)};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[a,t]),s.useEffect(()=>{if(!t)return;const n=i=>{i.key==="Escape"&&o(!1)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t]),s.useEffect(()=>{var n,i;if(t){c.current=!0,(n=h.current)==null||n.focus();const N=document.body.style.overflow;return window.matchMedia("(max-width: 767px)").matches&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=N}}c.current&&(c.current=!1,(i=p.current)==null||i.focus())},[t]);const R=()=>{if(typeof l=="string")switch(l){case"chevron":return t?e.jsx(v,{}):e.jsx(g,{});case"filter":return e.jsx(L,{});default:return e.jsx(g,{})}else return l};return e.jsxs(e.Fragment,{children:[e.jsxs(f.div,{id:x,ref:d,role:"dialog","aria-modal":t?"true":void 0,"aria-label":y,"aria-hidden":!t,inert:t?void 0:!0,initial:{x:"100%"},animate:{x:t?0:"100%"},transition:u?{duration:0}:{type:"spring",stiffness:300,damping:30},className:"fixed right-0 top-0 z-[9999] h-full w-[calc(100%-1rem)] overflow-y-auto bg-white shadow-lg sm:w-[min(28rem,calc(100%-2rem))] md:w-[var(--side-panel-width)]",style:{"--side-panel-width":`${b}%`},children:[e.jsx("button",{ref:h,type:"button",onClick:w,"aria-label":m,className:"absolute left-4 top-4 min-h-11 min-w-11 cursor-pointer rounded-full bg-gray-200 p-2 transition-colors hover:bg-gray-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 md:min-h-0 md:min-w-0",children:e.jsx(v,{})}),e.jsx("div",{className:"mt-16 p-4 sm:p-6",children:r})]}),e.jsxs(z,{children:[t&&a?e.jsx(f.button,{type:"button","aria-label":m,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:u?0:.15},onClick:()=>o(!1),className:"fixed inset-0 z-[9998] cursor-default bg-black/30 md:hidden"}):null,!t&&e.jsx(f.button,{ref:p,type:"button","aria-label":j,"aria-expanded":t,"aria-controls":x,initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:u?0:.2},onClick:w,className:"fixed right-0 top-1/2 z-[10000] min-h-11 min-w-11 -translate-y-1/2 cursor-pointer rounded-l-lg bg-indigo-600 p-3 text-white shadow-md transition-colors hover:bg-indigo-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2",children:R()})]})]})},A=()=>e.jsxs("div",{className:"min-h-[36rem] bg-gray-50 p-6",children:[e.jsx("p",{className:"text-sm text-gray-700",children:"Use el botón fijo para abrir los filtros."}),e.jsxs(I,{buttonIcon:"filter",ariaLabel:"Filtros de búsqueda",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Filtros de búsqueda"}),e.jsxs("label",{className:"mt-4 block text-sm font-medium text-gray-700",children:["Proveedor",e.jsx("input",{className:"mt-1 block w-full rounded-md border-gray-300",placeholder:"Nombre o código"})]})]})]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{A as Filters};
@@ -1,4 +1,4 @@
1
- var vf=Object.defineProperty;var Bn=e=>{throw TypeError(e)};var Uf=(e,t,A)=>t in e?vf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:A}):e[t]=A;var nt=(e,t,A)=>Uf(e,typeof t!="symbol"?t+"":t,A),Cn=(e,t,A)=>t.has(e)||Bn("Cannot "+A),ca=(e,t)=>Object(t)!==t?Bn('Cannot use the "in" operator on this value'):e.has(t),J=(e,t,A)=>(Cn(e,t,"read from private field"),A?A.call(e):t.get(e)),ve=(e,t,A)=>t.has(e)?Bn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,A),me=(e,t,A,n)=>(Cn(e,t,"write to private field"),n?n.call(e,A):t.set(e,A),A),Ke=(e,t,A)=>(Cn(e,t,"access private method"),A);import{y as oA,z as Mf,A as Es,B as Lf,C as Tf,E as Yf,F as Gf,s as Nl,G as vl,l as Jf,H as Hf,U as es,I as xf,w as Bs,J as ut,x as Vf,j as Et,O as Wf}from"./index-DxYjnckq.js";var or={};/*!
1
+ var vf=Object.defineProperty;var Bn=e=>{throw TypeError(e)};var Uf=(e,t,A)=>t in e?vf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:A}):e[t]=A;var nt=(e,t,A)=>Uf(e,typeof t!="symbol"?t+"":t,A),Cn=(e,t,A)=>t.has(e)||Bn("Cannot "+A),ca=(e,t)=>Object(t)!==t?Bn('Cannot use the "in" operator on this value'):e.has(t),J=(e,t,A)=>(Cn(e,t,"read from private field"),A?A.call(e):t.get(e)),ve=(e,t,A)=>t.has(e)?Bn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,A),me=(e,t,A,n)=>(Cn(e,t,"write to private field"),n?n.call(e,A):t.set(e,A),A),Ke=(e,t,A)=>(Cn(e,t,"access private method"),A);import{y as oA,z as Mf,A as Es,B as Lf,C as Tf,E as Yf,F as Gf,s as Nl,G as vl,l as Jf,H as Hf,U as es,I as xf,w as Bs,J as ut,x as Vf,j as Et,O as Wf}from"./index-DUSjZECW.js";var or={};/*!
2
2
  * cookie
3
3
  * Copyright(c) 2012-2014 Roman Shtylman
4
4
  * Copyright(c) 2015 Douglas Christopher Wilson
@@ -1,4 +1,4 @@
1
- import{v as fp,j as u,w as lp,r as W,x as p0,u as Rp,k as up}from"./index-DxYjnckq.js";import{L as cz,T as oz,C as Lp,S as Np}from"./index-TgOqmrBM.js";import{B as Az}from"./Button-HdDVNit0.js";import{T as Bp,u as Xp,S as hp}from"./Icons-DjqYUpg9.js";const mp=({title:M,description:z,okButtonText:b,showOptions:p=!0})=>new Promise(O=>{const c=()=>{O(null),t()},o=()=>{O("OK"),t()},q=()=>{O("CANCEL"),t()},t=()=>{document.body.removeChild(r),document.body.removeChild(f)},r=document.createElement("div");r.classList.add("justify-center","items-center","flex","overflow-x-hidden","overflow-y-auto","fixed","inset-0","z-50","outline-none","focus:outline-none");const f=document.createElement("div");f.classList.add("fixed","inset-0","bg-black","opacity-50","z-40"),document.body.appendChild(f),document.body.appendChild(r);const N=()=>u.jsx("div",{className:"relative w-auto my-6 mx-auto max-w-3xl",children:u.jsxs("div",{className:"border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-white outline-none focus:outline-none",children:[u.jsxs("div",{className:"flex items-start justify-between p-5 border-b border-solid border-slate-200 rounded-t",children:[u.jsx("h3",{className:"text-3xl font-semibold",children:M}),u.jsx("button",{className:"p-1 ml-auto bg-transparent border-0 text-black float-right text-3xl leading-none font-semibold outline-none focus:outline-none",children:u.jsx("span",{className:"close-button",onClick:c,children:"×"})})]}),u.jsx("div",{className:"relative p-6 flex-auto",children:z}),p&&u.jsxs("div",{className:"flex items-center justify-end p-6 border-t border-solid border-slate-200 rounded-b",children:[u.jsx("button",{className:"cancel-button text-red-700 background-transparent font-bold uppercase px-6 py-2 text-sm outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150",type:"button",onClick:q,children:"Cancelar"}),u.jsx("button",{className:"ok-button bg-emerald-700 text-white active:bg-emerald-600 font-bold uppercase text-sm px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150",type:"button",onClick:o,children:b??"Aceptar"})]})]})});fp.createRoot(r).render(u.jsx(N,{}))});//! moment.js
1
+ import{v as fp,j as u,w as lp,r as W,x as p0,u as Rp,k as up}from"./index-DUSjZECW.js";import{L as cz,T as oz,C as Lp,S as Np}from"./index-DonOhaBM.js";import{B as Az}from"./Button-YPU2MaHD.js";import{T as Bp,u as Xp,S as hp}from"./Icons-BxLN_JWC.js";const mp=({title:M,description:z,okButtonText:b,showOptions:p=!0})=>new Promise(O=>{const c=()=>{O(null),t()},o=()=>{O("OK"),t()},q=()=>{O("CANCEL"),t()},t=()=>{document.body.removeChild(r),document.body.removeChild(f)},r=document.createElement("div");r.classList.add("justify-center","items-center","flex","overflow-x-hidden","overflow-y-auto","fixed","inset-0","z-50","outline-none","focus:outline-none");const f=document.createElement("div");f.classList.add("fixed","inset-0","bg-black","opacity-50","z-40"),document.body.appendChild(f),document.body.appendChild(r);const N=()=>u.jsx("div",{className:"relative w-auto my-6 mx-auto max-w-3xl",children:u.jsxs("div",{className:"border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-white outline-none focus:outline-none",children:[u.jsxs("div",{className:"flex items-start justify-between p-5 border-b border-solid border-slate-200 rounded-t",children:[u.jsx("h3",{className:"text-3xl font-semibold",children:M}),u.jsx("button",{className:"p-1 ml-auto bg-transparent border-0 text-black float-right text-3xl leading-none font-semibold outline-none focus:outline-none",children:u.jsx("span",{className:"close-button",onClick:c,children:"×"})})]}),u.jsx("div",{className:"relative p-6 flex-auto",children:z}),p&&u.jsxs("div",{className:"flex items-center justify-end p-6 border-t border-solid border-slate-200 rounded-b",children:[u.jsx("button",{className:"cancel-button text-red-700 background-transparent font-bold uppercase px-6 py-2 text-sm outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150",type:"button",onClick:q,children:"Cancelar"}),u.jsx("button",{className:"ok-button bg-emerald-700 text-white active:bg-emerald-600 font-bold uppercase text-sm px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150",type:"button",onClick:o,children:b??"Aceptar"})]})]})});fp.createRoot(r).render(u.jsx(N,{}))});//! moment.js
2
2
  //! version : 2.30.1
3
3
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
4
4
  //! license : MIT
@@ -1 +1 @@
1
- import{j as t}from"./index-DxYjnckq.js";const n=({texto:e})=>t.jsx("div",{className:"mb-1",children:t.jsx("h1",{className:"text-4xl font-bold leading-normal mt-0 mb-2 text-zinc-800",children:e})}),s=({texto:e})=>t.jsx("div",{className:"py-1 ",children:t.jsx("h2",{className:"text-2xl font-bold leading-normal mt-0 mb-2 text-zinc-800",children:e})}),l=({texto:e})=>t.jsx("div",{className:"py-1 ",children:t.jsx("h3",{className:"text-xl leading-normal mt-0 mb-2 text-zinc-800",children:e})}),c=()=>t.jsxs("div",{className:"space-y-3",children:[t.jsx(n,{texto:"Título H1"}),t.jsx(s,{texto:"Título H2"}),t.jsx(l,{texto:"Título H3"})]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{c as Hierarchy};
1
+ import{j as t}from"./index-DUSjZECW.js";const n=({texto:e})=>t.jsx("div",{className:"mb-1",children:t.jsx("h1",{className:"text-4xl font-bold leading-normal mt-0 mb-2 text-zinc-800",children:e})}),s=({texto:e})=>t.jsx("div",{className:"py-1 ",children:t.jsx("h2",{className:"text-2xl font-bold leading-normal mt-0 mb-2 text-zinc-800",children:e})}),l=({texto:e})=>t.jsx("div",{className:"py-1 ",children:t.jsx("h3",{className:"text-xl leading-normal mt-0 mb-2 text-zinc-800",children:e})}),c=()=>t.jsxs("div",{className:"space-y-3",children:[t.jsx(n,{texto:"Título H1"}),t.jsx(s,{texto:"Título H2"}),t.jsx(l,{texto:"Título H3"})]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{c as Hierarchy};
@@ -1 +1 @@
1
- import{r as l,j as t}from"./index-DxYjnckq.js";import{B as a}from"./Button-HdDVNit0.js";const n=({children:e,text:o})=>{const[s,r]=l.useState(!1);return t.jsxs("div",{className:"relative inline-block",children:[t.jsx("div",{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:e}),s&&t.jsxs("div",{className:"absolute z-10 bg-gray-700 text-white px-2 py-1 rounded-md bottom-full left-1/2 transform -translate-x-1/2",style:{whiteSpace:"nowrap",height:"2rem"},children:[o,t.jsx("div",{className:"absolute top-full left-1/2 transform -translate-x-1/2",style:{width:"0",height:"0",borderTop:"6px solid transparent",borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderBottom:"6px solid gray"}})]})]})},i=e=>{const{children:o,text:s}=e;return t.jsxs("div",{className:"group relative inline-block",children:[o,t.jsx("div",{className:"pointer-events-none absolute left-1/2 -translate-x-1/2 bottom-full mb-2 opacity-0 transition-opacity duration-300 group-hover:opacity-100",children:t.jsxs("div",{className:"relative bg-black text-white text-sm rounded py-1 px-2 text-wrap w-40",children:[s,t.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-black"})]})})]})},c=()=>t.jsx(n,{text:"Ayuda contextual",children:t.jsx(a,{title:"Pasa el mouse",type:"button"})}),u=()=>t.jsx(i,{text:"Texto largo que se envuelve en el globo de ayuda.",children:t.jsx(a,{title:"Con tooltip CSS",type:"button"})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{u as CssTooltip,c as HoverTooltip};
1
+ import{r as l,j as t}from"./index-DUSjZECW.js";import{B as a}from"./Button-YPU2MaHD.js";const n=({children:e,text:o})=>{const[s,r]=l.useState(!1);return t.jsxs("div",{className:"relative inline-block",children:[t.jsx("div",{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:e}),s&&t.jsxs("div",{className:"absolute z-10 bg-gray-700 text-white px-2 py-1 rounded-md bottom-full left-1/2 transform -translate-x-1/2",style:{whiteSpace:"nowrap",height:"2rem"},children:[o,t.jsx("div",{className:"absolute top-full left-1/2 transform -translate-x-1/2",style:{width:"0",height:"0",borderTop:"6px solid transparent",borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderBottom:"6px solid gray"}})]})]})},i=e=>{const{children:o,text:s}=e;return t.jsxs("div",{className:"group relative inline-block",children:[o,t.jsx("div",{className:"pointer-events-none absolute left-1/2 -translate-x-1/2 bottom-full mb-2 opacity-0 transition-opacity duration-300 group-hover:opacity-100",children:t.jsxs("div",{className:"relative bg-black text-white text-sm rounded py-1 px-2 text-wrap w-40",children:[s,t.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-black"})]})})]})},c=()=>t.jsx(n,{text:"Ayuda contextual",children:t.jsx(a,{title:"Pasa el mouse",type:"button"})}),u=()=>t.jsx(i,{text:"Texto largo que se envuelve en el globo de ayuda.",children:t.jsx(a,{title:"Con tooltip CSS",type:"button"})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{u as CssTooltip,c as HoverTooltip};
@@ -1,4 +1,4 @@
1
- import{k as zT}from"./index-DxYjnckq.js";function GT(Rr,da){for(var E=0;E<da.length;E++){const dt=da[E];if(typeof dt!="string"&&!Array.isArray(dt)){for(const O in dt)if(O!=="default"&&!(O in Rr)){const _=Object.getOwnPropertyDescriptor(dt,O);_&&Object.defineProperty(Rr,O,_.get?_:{enumerable:!0,get:()=>dt[O]})}}}return Object.freeze(Object.defineProperty(Rr,Symbol.toStringTag,{value:"Module"}))}var Zi={exports:{}};/*! axe v4.13.0
1
+ import{k as zT}from"./index-DUSjZECW.js";function GT(Rr,da){for(var E=0;E<da.length;E++){const dt=da[E];if(typeof dt!="string"&&!Array.isArray(dt)){for(const O in dt)if(O!=="default"&&!(O in Rr)){const _=Object.getOwnPropertyDescriptor(dt,O);_&&Object.defineProperty(Rr,O,_.get?_:{enumerable:!0,get:()=>dt[O]})}}}return Object.freeze(Object.defineProperty(Rr,Symbol.toStringTag,{value:"Module"}))}var Zi={exports:{}};/*! axe v4.13.0
2
2
  * Copyright (c) 2015 - 2026 Deque Systems, Inc.
3
3
  *
4
4
  * Your use of this Source Code Form is subject to the terms of the Mozilla Public
@@ -1,4 +1,4 @@
1
- import{p as H,r as s,c as D,l as M,D as U,a as A,h as T}from"./index-DxYjnckq.js";import{F as z,L as I,N as B}from"./Icons-DjqYUpg9.js";/**
1
+ import{p as H,r as s,c as D,l as M,D as U,a as A,h as T}from"./index-DUSjZECW.js";import{F as z,L as I,N as B}from"./Icons-BxLN_JWC.js";/**
2
2
  * @remix-run/react v2.12.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.