@customafk/lunas-ui 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/dist/{button-IfNjnUO-.d.mts → button-C6s_h0K3.d.mts} +4 -4
  2. package/dist/{button-BnFROtRM.d.cts → button-CcOrQc7g.d.cts} +4 -4
  3. package/dist/button-CpEejahy.cjs +2 -0
  4. package/dist/{button-CYw2AqT0.cjs.map → button-CpEejahy.cjs.map} +1 -1
  5. package/dist/{button-B2FJrOBP.mjs → button-D54KOmb7.mjs} +2 -2
  6. package/dist/{button-B2FJrOBP.mjs.map → button-D54KOmb7.mjs.map} +1 -1
  7. package/dist/button.variants-CS-Cmarr.cjs +2 -0
  8. package/dist/button.variants-CS-Cmarr.cjs.map +1 -0
  9. package/dist/button.variants-DRWf66hR.mjs +2 -0
  10. package/dist/button.variants-DRWf66hR.mjs.map +1 -0
  11. package/dist/{calendar-BwWfk_Zk.cjs → calendar-dhPqb3aZ.cjs} +2 -2
  12. package/dist/{calendar-BwWfk_Zk.cjs.map → calendar-dhPqb3aZ.cjs.map} +1 -1
  13. package/dist/{calendar-Bt6qXSZb.mjs → calendar-qHQsMOj9.mjs} +2 -2
  14. package/dist/{calendar-Bt6qXSZb.mjs.map → calendar-qHQsMOj9.mjs.map} +1 -1
  15. package/dist/cards/grid-product-card.cjs +1 -1
  16. package/dist/cards/grid-product-card.mjs +1 -1
  17. package/dist/cards/product-card.cjs +1 -1
  18. package/dist/cards/product-card.mjs +1 -1
  19. package/dist/data-display/empty.d.mts +2 -2
  20. package/dist/data-display/statistic.d.cts +2 -2
  21. package/dist/data-display/statistic.d.mts +2 -2
  22. package/dist/{dialog-CyLgmqny.d.cts → dialog-CsM9bEo6.d.cts} +12 -12
  23. package/dist/{dialog-lFDfcYPP.d.mts → dialog-NsKYcQwE.d.mts} +12 -12
  24. package/dist/dialogs/confirm-dialog.cjs +1 -1
  25. package/dist/dialogs/confirm-dialog.mjs +1 -1
  26. package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
  27. package/dist/dialogs/detail-dialog/components/sidebar.d.cts +25 -25
  28. package/dist/dialogs/detail-dialog/components/sidebar.d.mts +25 -25
  29. package/dist/dialogs/detail-dialog/components/sidebar.mjs +1 -1
  30. package/dist/dialogs/detail-dialog/index.cjs +1 -1
  31. package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
  32. package/dist/dialogs/detail-dialog/index.mjs +1 -1
  33. package/dist/dialogs/detail-dialog/index.mjs.map +1 -1
  34. package/dist/dialogs/error-dialog.cjs +1 -1
  35. package/dist/dialogs/error-dialog.mjs +1 -1
  36. package/dist/features/search-modal/index.d.mts +2 -2
  37. package/dist/features/tables/index.cjs +1 -1
  38. package/dist/features/tables/index.d.cts +1 -1
  39. package/dist/features/tables/index.d.mts +23 -23
  40. package/dist/features/tables/index.mjs +1 -1
  41. package/dist/features/tanstack-form/index.cjs +1 -1
  42. package/dist/features/tanstack-form/index.d.cts +42 -42
  43. package/dist/features/tanstack-form/index.d.mts +266 -266
  44. package/dist/features/tanstack-form/index.mjs +1 -1
  45. package/dist/{input-CLlVXOR2.d.mts → input-B65h-l45.d.cts} +7 -7
  46. package/dist/{input-Bm0YXroi.d.cts → input-C6Q4vGNC.d.mts} +6 -6
  47. package/dist/layouts/cms-layout/index.cjs +1 -1
  48. package/dist/layouts/cms-layout/index.mjs +1 -1
  49. package/dist/layouts/flex.d.cts +5 -5
  50. package/dist/layouts/flex.d.mts +9 -9
  51. package/dist/layouts/payment-layout/index.cjs +1 -1
  52. package/dist/layouts/payment-layout/index.mjs +1 -1
  53. package/dist/pages/FeatureDeveloping.cjs +1 -1
  54. package/dist/pages/FeatureDeveloping.d.cts +2 -2
  55. package/dist/pages/FeatureDeveloping.d.mts +2 -2
  56. package/dist/pages/FeatureDeveloping.mjs +1 -1
  57. package/dist/pages/FeatureFixing.cjs +1 -1
  58. package/dist/pages/FeatureFixing.d.cts +2 -2
  59. package/dist/pages/FeatureFixing.d.mts +2 -2
  60. package/dist/pages/FeatureFixing.mjs +1 -1
  61. package/dist/pages/NotAuthorized.cjs +1 -1
  62. package/dist/pages/NotAuthorized.d.cts +2 -2
  63. package/dist/pages/NotAuthorized.d.mts +2 -2
  64. package/dist/pages/NotAuthorized.mjs +1 -1
  65. package/dist/pages/NotFound.cjs +1 -1
  66. package/dist/pages/NotFound.d.cts +2 -2
  67. package/dist/pages/NotFound.d.mts +2 -2
  68. package/dist/pages/NotFound.mjs +1 -1
  69. package/dist/typography/paragraph.d.cts +3 -3
  70. package/dist/typography/paragraph.d.mts +5 -5
  71. package/dist/typography/title.d.cts +2 -2
  72. package/dist/typography/title.d.mts +2 -2
  73. package/dist/ui/alert-dialog.cjs +1 -1
  74. package/dist/ui/alert-dialog.d.cts +12 -12
  75. package/dist/ui/alert-dialog.d.mts +12 -12
  76. package/dist/ui/alert-dialog.mjs +1 -1
  77. package/dist/ui/alert.d.cts +4 -4
  78. package/dist/ui/alert.d.mts +4 -4
  79. package/dist/ui/aspect-ratio.d.cts +2 -2
  80. package/dist/ui/aspect-ratio.d.mts +2 -2
  81. package/dist/ui/avatar.d.cts +4 -4
  82. package/dist/ui/avatar.d.mts +4 -4
  83. package/dist/ui/badge.d.cts +5 -5
  84. package/dist/ui/badge.d.mts +5 -5
  85. package/dist/ui/breadcrumb.d.cts +8 -8
  86. package/dist/ui/breadcrumb.d.mts +8 -8
  87. package/dist/ui/button-group.d.cts +6 -6
  88. package/dist/ui/button-group.d.mts +4 -4
  89. package/dist/ui/button.cjs +1 -1
  90. package/dist/ui/button.d.cts +1 -1
  91. package/dist/ui/button.d.mts +1 -1
  92. package/dist/ui/button.mjs +1 -1
  93. package/dist/ui/buttons/add-new.cjs +1 -1
  94. package/dist/ui/buttons/add-new.mjs +1 -1
  95. package/dist/ui/buttons/edit.cjs +1 -1
  96. package/dist/ui/buttons/edit.mjs +1 -1
  97. package/dist/ui/buttons/refresh.cjs +1 -1
  98. package/dist/ui/buttons/refresh.mjs +1 -1
  99. package/dist/ui/buttons/trash.cjs +1 -1
  100. package/dist/ui/buttons/trash.mjs +1 -1
  101. package/dist/ui/buttons/upload-image.cjs +1 -1
  102. package/dist/ui/buttons/upload-image.mjs +1 -1
  103. package/dist/ui/calendar.cjs +1 -1
  104. package/dist/ui/calendar.d.cts +4 -4
  105. package/dist/ui/calendar.d.mts +4 -4
  106. package/dist/ui/calendar.mjs +1 -1
  107. package/dist/ui/card.d.cts +8 -8
  108. package/dist/ui/card.d.mts +8 -8
  109. package/dist/ui/carousel.cjs +1 -1
  110. package/dist/ui/carousel.d.cts +7 -7
  111. package/dist/ui/carousel.d.mts +7 -7
  112. package/dist/ui/carousel.mjs +1 -1
  113. package/dist/ui/checkbox.d.cts +2 -2
  114. package/dist/ui/checkbox.d.mts +2 -2
  115. package/dist/ui/collapsible.d.cts +4 -4
  116. package/dist/ui/collapsible.d.mts +4 -4
  117. package/dist/ui/command.d.cts +11 -11
  118. package/dist/ui/command.d.mts +11 -11
  119. package/dist/ui/context-menu.d.cts +16 -16
  120. package/dist/ui/context-menu.d.mts +16 -16
  121. package/dist/ui/dialog.d.cts +1 -1
  122. package/dist/ui/dialog.d.mts +1 -1
  123. package/dist/ui/drawer.d.cts +11 -11
  124. package/dist/ui/drawer.d.mts +11 -11
  125. package/dist/ui/dropdown-menu.d.cts +16 -16
  126. package/dist/ui/dropdown-menu.d.mts +16 -16
  127. package/dist/ui/empty.d.cts +9 -9
  128. package/dist/ui/empty.d.mts +9 -9
  129. package/dist/ui/field.d.cts +13 -13
  130. package/dist/ui/field.d.mts +24 -24
  131. package/dist/ui/file-uploader.cjs +1 -1
  132. package/dist/ui/file-uploader.d.cts +2 -2
  133. package/dist/ui/file-uploader.d.mts +2 -2
  134. package/dist/ui/file-uploader.mjs +1 -1
  135. package/dist/ui/form.d.cts +11 -11
  136. package/dist/ui/form.d.mts +11 -11
  137. package/dist/ui/hover-card.d.cts +4 -4
  138. package/dist/ui/hover-card.d.mts +4 -4
  139. package/dist/ui/input-otp.d.cts +5 -5
  140. package/dist/ui/input-otp.d.mts +5 -5
  141. package/dist/ui/input.d.cts +1 -1
  142. package/dist/ui/input.d.mts +1 -1
  143. package/dist/ui/inputs/search-input.d.cts +3 -3
  144. package/dist/ui/inputs/search-input.d.mts +3 -3
  145. package/dist/ui/item.d.cts +13 -13
  146. package/dist/ui/item.d.mts +16 -16
  147. package/dist/ui/label.d.cts +2 -2
  148. package/dist/ui/label.d.mts +2 -2
  149. package/dist/ui/menubar.d.cts +17 -17
  150. package/dist/ui/menubar.d.mts +17 -17
  151. package/dist/ui/multi-select.cjs +1 -1
  152. package/dist/ui/multi-select.d.cts +2 -2
  153. package/dist/ui/multi-select.d.mts +3 -3
  154. package/dist/ui/multi-select.mjs +1 -1
  155. package/dist/ui/navigation-menu.d.cts +11 -11
  156. package/dist/ui/navigation-menu.d.mts +9 -9
  157. package/dist/ui/pagination.cjs +1 -1
  158. package/dist/ui/pagination.d.cts +9 -9
  159. package/dist/ui/pagination.d.mts +9 -9
  160. package/dist/ui/pagination.mjs +1 -1
  161. package/dist/ui/popover.d.cts +6 -6
  162. package/dist/ui/popover.d.mts +6 -6
  163. package/dist/ui/progress.d.cts +2 -2
  164. package/dist/ui/progress.d.mts +2 -2
  165. package/dist/ui/radio-group.d.cts +3 -3
  166. package/dist/ui/radio-group.d.mts +3 -3
  167. package/dist/ui/resizable.d.cts +9 -9
  168. package/dist/ui/resizable.d.mts +9 -9
  169. package/dist/ui/scroll-area.d.cts +6 -6
  170. package/dist/ui/scroll-area.d.mts +6 -6
  171. package/dist/ui/select.d.cts +9 -9
  172. package/dist/ui/select.d.mts +9 -9
  173. package/dist/ui/separator.d.cts +2 -2
  174. package/dist/ui/separator.d.mts +2 -2
  175. package/dist/ui/sheet.d.cts +9 -9
  176. package/dist/ui/sheet.d.mts +9 -9
  177. package/dist/ui/sidebar.cjs +1 -1
  178. package/dist/ui/sidebar.d.cts +3 -3
  179. package/dist/ui/sidebar.d.mts +29 -29
  180. package/dist/ui/sidebar.mjs +1 -1
  181. package/dist/ui/skeleton.d.cts +2 -2
  182. package/dist/ui/skeleton.d.mts +2 -2
  183. package/dist/ui/slider.d.cts +2 -2
  184. package/dist/ui/slider.d.mts +2 -2
  185. package/dist/ui/sonner.d.cts +2 -2
  186. package/dist/ui/sonner.d.mts +2 -2
  187. package/dist/ui/spinner.d.cts +2 -2
  188. package/dist/ui/spinner.d.mts +2 -2
  189. package/dist/ui/switch.d.cts +2 -2
  190. package/dist/ui/switch.d.mts +2 -2
  191. package/dist/ui/table.d.cts +18 -18
  192. package/dist/ui/table.d.mts +18 -18
  193. package/dist/ui/tabs.d.cts +5 -5
  194. package/dist/ui/tabs.d.mts +5 -5
  195. package/dist/ui/textarea.d.cts +2 -2
  196. package/dist/ui/textarea.d.mts +2 -2
  197. package/dist/ui/toggle-group.d.cts +3 -3
  198. package/dist/ui/toggle-group.d.mts +3 -3
  199. package/dist/ui/toggle.d.cts +5 -5
  200. package/dist/ui/toggle.d.mts +5 -5
  201. package/dist/ui/tooltip.d.cts +5 -5
  202. package/dist/ui/tooltip.d.mts +5 -5
  203. package/package.json +1 -1
  204. package/dist/button-CYw2AqT0.cjs +0 -2
  205. package/dist/button.variants-DuuH1O0_.mjs +0 -2
  206. package/dist/button.variants-DuuH1O0_.mjs.map +0 -1
  207. package/dist/button.variants-rdXrPUao.cjs +0 -2
  208. package/dist/button.variants-rdXrPUao.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- import"../../heading--VmdIi7C.mjs";import"../../paragraph-moBSTPmT.mjs";import"../../button.variants-DuuH1O0_.mjs";import{t as e}from"../../button-B2FJrOBP.mjs";import{t}from"../../separator-Bf0gymN4.mjs";import{t as n}from"../../close-DfuHB7kq.mjs";import{c as r,l as i,r as a,s as o,t as s}from"../../dialog-CxELDK98.mjs";import{t as c}from"../../checkbox-Bg2FiuQw.mjs";import{t as l}from"../../input-DBtIgQB6.mjs";import{a as u,i as d,t as f}from"../../popover-BckwBuuD.mjs";import{t as p}from"../../calendar-Bt6qXSZb.mjs";import{n as m,t as h}from"../../radio-group-Cem8O6BK.mjs";import{c as g,i as _,n as v,s as y,t as b}from"../../select-CivtMKTM.mjs";import{t as x}from"../../textarea-bLtmb71c.mjs";import{cn as S}from"@customafk/react-toolkit/utils";import{cva as C}from"class-variance-authority";import{memo as w,useCallback as T,useEffect as E,useId as D,useMemo as O,useRef as k,useState as A}from"react";import{jsx as j,jsxs as M}from"react/jsx-runtime";import{ArrowDownToLine as N,AtSignIcon as P,BanIcon as F,CalendarDaysIcon as I,EyeIcon as ee,EyeOffIcon as te,Loader2 as ne,Loader2Icon as L,PackagePlusIcon as re,PlusIcon as ie,Trash2Icon as ae,XIcon as oe}from"lucide-react";import{endOfToday as R,endOfTomorrow as se,endOfYesterday as ce,format as le,lastDayOfMonth as ue,startOfMonth as de,subDays as z}from"@customafk/react-toolkit/date-fns";import{Dialog as B,Label as fe,Separator as pe,Switch as me}from"radix-ui";import{createFormHook as he,createFormHookContexts as ge,useStore as V}from"@tanstack/react-form";const _e=C([`flex w-fit items-center justify-center rounded-full font-bold text-text-negative-strong`],{variants:{color:{default:`bg-primary-strong`,secondary:`bg-secondary-strong`,success:`bg-success-strong`,info:`bg-info-strong`,warning:`bg-warning-strong`,danger:`border border-danger-strong bg-linear-to-b from-danger-strong/90 via-danger-strong to-danger-strong/90`},size:{xs:`px-1.5 py-0.5 text-xs`,sm:`px-2 py-0.75 text-xs`,md:`px-2.5 py-0.75 text-sm`,lg:`px-3 py-1 text-sm`}},defaultVariants:{color:`default`,size:`sm`}}),ve=({label:e,color:t,size:n,className:r,children:i})=>j(`div`,{"data-slot":`required-indicator`,className:_e({color:t,size:n,className:r}),children:e||i});function ye({className:e,children:t,...n}){return M(fe.Root,{"data-slot":`label`,className:S(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[t,j(ve,{label:`Required`,color:`danger`,size:`sm`,className:`hidden`})]})}const be=C(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0`,{variants:{orientation:{vertical:[`flex-col *:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`*:data-[slot=field-label]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col *:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@md/field-group:*:data-[slot=field-label]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}}),xe=w(({className:e,...t})=>j(`fieldset`,{"data-slot":`field-set`,className:S(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));xe.displayName=`FieldSet`;const Se=w(({className:e,variant:t=`legend`,...n})=>j(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:S(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));Se.displayName=`FieldLegend`;const H=w(({className:e,...t})=>j(`div`,{"data-slot":`field-group`,className:S(`group/field-group @container/field-group`,`flex flex-col gap-7`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));H.displayName=`FieldGroup`;const U=w(({className:e,orientation:t=`vertical`,...n})=>j(`div`,{"data-slot":`field`,"data-orientation":t,className:S(be({orientation:t}),e),...n}));U.displayName=`Field`;const W=w(({className:e,...t})=>j(`div`,{"data-slot":`field-content`,className:S(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));W.displayName=`FieldContent`;const G=w(({className:e,...t})=>j(`div`,{"data-slot":`field-content-main`,className:S(`relative`,e),...t})),K=w(({className:e,...t})=>j(ye,{"data-slot":`field-label`,className:S(`group/field-label peer/field-label flex h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));K.displayName=`FieldLabel`;const q=w(({className:e,...t})=>j(`div`,{"data-slot":`field-label`,className:S(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));q.displayName=`FieldTitle`;const J=w(({className:e,...t})=>j(`p`,{"data-slot":`field-description`,className:S(`nth-last-2:-mt-1 font-normal text-text-positive-weak text-xs leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));J.displayName=`FieldDescription`;const Y=w(({isShow:e=!0,className:t,...n})=>e===!1?null:j(`div`,{"data-slot":`field-note`,className:S(`text-wrap rounded border border-primary-muted bg-primary-bg-subtle p-2 text-text-positive-weak text-xs`,t),...n}));Y.displayName=`FieldNote`;const X=w(({children:e,className:n,...r})=>M(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:S(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,n),...r,children:[j(t,{className:`absolute inset-0 top-1/2`}),e&&j(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));X.displayName=`FieldSeparator`;const Z=w(({className:e,children:t,errors:n,...r})=>{let i=O(()=>t||(n?n?.length===1&&n[0]?.message?j(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:j(`p`,{children:n[0]?.code===`invalid_type`?`Không đúng định dạng`:n[0].message})}):j(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?j(`li`,{children:e},e):e?.message?j(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?j(`div`,{role:`alert`,"data-slot":`field-error`,className:S(`w-full font-semibold text-danger-strong text-xs`,e),...r,children:i}):null});Z.displayName=`FieldError`;const Ce=({label:e,description:t,options:n,helperText:r,orientation:i})=>{let a=Q(),o=V(a.form.store,({isSubmitting:e})=>e);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:i,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t}),j(Y,{isShow:!!r,children:r})]}),j(G,{children:j(H,{className:`flex flex-col gap-y-2`,children:n.map(e=>M(U,{orientation:`horizontal`,children:[j(c,{id:`${a.name}-${e.value}`,name:a.name,checked:a.state.value?.includes(e.value)??!1,disabled:o,onCheckedChange:t=>{if(t&&a.state.value!==null)a.pushValue(e.value);else if(t&&a.state.value===null)a.setValue([e.value]);else if(!t&&a.state.value!==null){let t=a.state.value.indexOf(e.value);t>-1&&a.removeValue(t)}else !t&&a.state.value===null&&a.setValue(null)}}),j(K,{htmlFor:`${a.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),j(X,{})]})},we=({label:t,description:n,placeholder:r,orientation:i=`responsive`,helperText:a,minDate:o,maxDate:s,required:c})=>{let l=Q(),m=O(()=>c?l.state.value===null:!1,[c,l.state.value]),h=O(()=>l.state.meta.isTouched&&!l.state.meta.isValid,[l.state.meta.isTouched,l.state.meta.isValid]);return M(H,{className:`px-4`,children:[M(U,{orientation:i,"data-invalid":h,children:[M(W,{children:[j(K,{htmlFor:l.name,"aria-required":m,children:t}),j(J,{children:n})]}),M(G,{className:`flex flex-col space-y-1`,children:[j(`div`,{className:`flex w-full flex-col`,children:M(f,{children:[j(u,{asChild:!0,children:M(e,{variant:`outline`,color:`muted`,size:`lg`,className:S(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,l.state.value===null&&`text-text-positive-muted`),children:[j(`p`,{children:l.state.value===null?r||`Select date`:le(l.state.value,`PPPP`)}),j(I,{strokeWidth:1})]})}),M(d,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:l.handleBlur,children:[M(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(R())},children:`Today`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(se())},children:`Tomorrow`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(ce())},children:`Yesterday`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),3))},children:`Last 3 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),7))},children:`Last 7 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),30))},children:`Last 30 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(de(R()))},children:`This Month`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(ue(R()))},children:`Last Month`})]}),j(`div`,{className:`flex flex-1 flex-col`,children:j(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:j(p,{mode:`single`,selected:l.state.value??void 0,hidden:{before:o??new Date(1900,0,1),after:s??new Date(2100,11,31)},onSelect:e=>{e&&l.handleChange(e)}})})})]})]})}),j(Y,{isShow:!!a,children:a})]})]}),j(X,{})]})},Te=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,maxLength:o})=>{let{form:s,name:c,state:u,handleBlur:d,handleChange:f}=Q(),p=V(s.store,({isSubmitting:e})=>e),m=O(()=>u.meta.isDirty&&u.meta.isTouched&&!u.meta.isValid,[u.meta.isDirty,u.meta.isTouched,u.meta.isValid]),h=T(({target:{value:e}})=>{p||o&&e.length>o||f(e||null)},[p,o,f]),g=T(()=>{p||f(null)},[p,f]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{"data-invalid":m,orientation:i,children:[M(W,{children:[j(K,{htmlFor:c,children:e}),j(J,{children:t})]}),M(G,{children:[j(l,{id:c,name:c,value:u.value===null?``:u.value,"aria-invalid":m,autoComplete:`email`,placeholder:n,className:S(`pl-9`,p&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:d,onChange:h}),j(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:j(P,{size:14})}),j(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:g,children:j(oe,{size:14,"aria-hidden":`true`})}),j(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&u.meta.isDirty&&j(Z,{errors:u.meta.errors})}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},Ee=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,De=e=>Number(e).toLocaleString(),Oe=(e,t,n)=>{if(n===`none`)return e;let r=10**t,i=e*r;switch(n){case`up`:return Math.ceil(i)/r;case`down`:return Math.floor(i)/r;case`nearest`:return i%1<.1?Math.floor(i)/r:i%1>=.59?Math.ceil(i)/r:(Math.floor(i)+.5)/r;default:return e}},ke=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:o,decimal:s,placeholder:c,precision:u,wrapperClassName:d,className:f,onChange:p,onValueChange:m,onFocus:h,onBlur:g,..._})=>{let v=k(null),y=k(null),[b,x]=A(a?.toString()??null),C=O(()=>s?.[1]??r,[s,r]),w=O(()=>s&&s[0]-s[1],[s]),D=O(()=>Ee(n),[n]),N=T(e=>{if(!C||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=C&&r<=(w??1/0)},[C,w]),P=T(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=Oe(parseFloat(e),Math.min(C-1,u||0),i).toString().split(`.`),r=De(t);return n?`${r}.${n}`:r},[C,u,i]),F=T(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){m?.(0),x(e);return}if(n){x(()=>(m?.(0),e));return}},[m]),I=T(e=>{p?.(e);let{value:t}=e.target;if(t===``||t===void 0){m?.(null),x(null);return}F(t),!(!D.test(t)||!N(t))&&(m?.(parseFloat(t)||0),x(t))},[N,p,m,F,D]),ee=T(e=>{t||(h?.(e),x(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,h]),te=T(e=>{t||(g?.(e),x(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?P(e):null))},[t,P,g]);return E(()=>{let e=document.activeElement===y.current;if(a==null||!D.test(a.toString())||!N(a.toString())){x(null);return}x(t=>e?t:P(a.toString()))},[P,a,N,D]),E(()=>{if(!v.current||!y.current||!o)return;let e=v.current.offsetWidth;y.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),M(`div`,{className:S(`relative`,d),children:[j(l,{..._,ref:y,value:b||(t?`0`:``),placeholder:c,disabled:e,readOnly:t,className:S(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,f),onChange:I,onFocus:ee,onBlur:te}),o&&j(`span`,{ref:v,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},Ae=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,rounding:o,decimalPlaces:s,percision:c,unit:l,required:u,allowNegative:d})=>{let f=Q(),p=V(f.form.store,({isSubmitting:e})=>e),m=O(()=>f.state.meta.errors,[f.state.meta.errors]),h=O(()=>u?f.state.value===null:!1,[u,f.state.value]),g=T(e=>{p||f.handleChange(e)},[p,f.handleChange]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:i,"data-invalid":f.state.meta.isTouched&&!f.state.meta.isValid,children:[M(W,{children:[j(K,{htmlFor:f.name,"aria-required":h,children:e}),j(J,{children:t})]}),M(G,{children:[M(`div`,{className:`relative w-full`,children:[j(ke,{id:f.name,value:f.state.value,"aria-invalid":f.state.meta.isTouched&&!f.state.meta.isValid&&f.state.meta.isDirty,placeholder:n,roundingRule:o,numberAfterDecimalPoint:s,precision:c,unitText:l,allowNegative:d,className:S(p&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:f.handleBlur,onValueChange:g}),p&&j(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:j(L,{className:`animate-spin text-primary-strong`})}),f.state.meta.isDirty&&a&&!!m.length&&j(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:j(F,{})}),j(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:f.state.meta.isDirty&&a&&j(Z,{errors:m})})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},je=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0})=>{let{form:o,name:s,state:c,handleBlur:u,handleChange:d}=Q(),f=V(o.store,({isSubmitting:e})=>e),[p,m]=A(!1),h=O(()=>c.meta.isDirty&&c.meta.isTouched&&!c.meta.isValid,[c.meta.isDirty,c.meta.isTouched,c.meta.isValid]),g=T(()=>m(e=>!e),[]),_=T(({target:{value:e}})=>{f||d(e||null)},[f,d]);return j(H,{className:`gap-y-4 px-4`,children:M(U,{"data-invalid":h,orientation:r,children:[M(W,{children:[j(K,{htmlFor:s,children:e}),j(J,{children:t})]}),M(G,{children:[j(l,{id:s,type:p?`text`:`password`,placeholder:n,value:c.value??``,"aria-invalid":h,autoComplete:`new-password`,onBlur:u,onChange:_}),j(`button`,{className:`absolute inset-e-0 inset-y-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:g,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":`password`,children:j(p?te:ee,{size:16,"aria-hidden":`true`})}),j(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&c.meta.isDirty&&j(Z,{errors:c.meta.errors})}),j(Y,{isShow:!!i,children:i})]})]})})},Me=({label:e,description:t,orientation:n,options:r,helperText:i})=>{let a=Q(),o=V(a.form.store,({isSubmitting:e})=>e);return M(H,{className:`px-4`,children:[M(U,{orientation:n,className:`flex-col gap-2`,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t}),j(Y,{isShow:!!i,children:i})]}),j(G,{children:j(h,{defaultValue:a.state.value??void 0,className:`w-full`,onValueChange:a.handleChange,children:r.map(e=>j(K,{className:S(`h-fit`,a.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,o&&`pointer-events-none bg-muted-muted opacity-60`,a.state.value===e.value&&o&&`border-border-strong!`),children:M(U,{orientation:`horizontal`,className:`justify-between rounded p-2!`,children:[M(W,{className:`gap-1!`,children:[j(q,{children:e.label}),j(J,{className:`text-xs`,children:e.description})]}),j(m,{value:e.value})]})},e.value))})})]}),j(X,{})]})},Ne=({label:e,description:t,placeholder:n,orientation:r=`responsive`,options:i,helperText:a,required:o=!1})=>{let s=Q(),c=O(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),l=O(()=>o?s.state.value===null:!1,[o,s.state.value]),u=O(()=>s.state.meta.errors,[s.state.meta.errors]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:r,"data-invalid":s.state.meta.isTouched&&!s.state.meta.isValid,children:[M(W,{children:[j(K,{htmlFor:s.name,"aria-required":l,children:e}),j(J,{children:t})]}),M(G,{className:`flex flex-col`,children:[M(b,{defaultValue:s.state.value||void 0,onValueChange:s.handleChange,children:[j(y,{"aria-invalid":c?`true`:void 0,onBlur:s.handleBlur,children:j(g,{placeholder:n})}),M(v,{children:[!!i.length&&i.map(e=>j(_,{value:e.value,children:e.label},e.value)),!i.length&&M(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[j(re,{strokeWidth:1}),`No options available`]})]})]}),j(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:j(Z,{errors:u})}),j(Y,{isShow:!!a,children:a})]})]}),j(X,{})]})};function Pe({className:e,...t}){return j(me.Root,{"data-slot":`switch`,className:S(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:j(me.Thumb,{"data-slot":`switch-thumb`,className:S(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const Fe=({label:e,description:t,helperText:n})=>{let r=Q();return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[M(W,{children:[j(q,{className:`cursor-pointer`,children:j(`label`,{htmlFor:r.name,children:e})}),j(J,{children:t}),j(Pe,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),j(Y,{isShow:!!n,children:n})]}),j(X,{})]})},Ie=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showClearButton:o=!1,showErrorMessage:s=!0,required:c=!1,maxLength:u})=>{let d=D(),f=k(null),{form:p,name:m,state:h,handleBlur:g,handleChange:_}=Q(),v=V(p.store,({isSubmitting:e})=>e),y=o&&!v&&!!h.value&&!h.meta.errors.length,b=h.value?h.value.length:0,x=O(()=>{if(!i)return``;let e=`character${[0,1].includes(b)?``:`s`}`;return i&&u?`${b} / ${u} character${b?`s`:``}`:`${b} ${e}`},[b,i,u]),C=h.meta.isDirty&&h.meta.isTouched&&!h.meta.isValid,w=c?h.value===null:!1,E=u&&b>=u*.8,A=u&&b>=u,N=T(({target:{value:e}})=>{v||i&&u&&e.length>u||_(e||null)},[v,i,u,_]),P=T(()=>{v||(_(null),f.current?.focus())},[v,_]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:a,"data-invalid":C,children:[M(W,{children:[j(K,{"aria-required":w,htmlFor:d,children:M(`p`,{children:[e,c&&j(`span`,{className:`text-danger-strong`,children:` *`})]})}),j(J,{children:t})]}),M(G,{children:[j(l,{ref:f,id:d,name:m,value:h.value??``,"aria-invalid":C,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:S(`pr-6`,v&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:g,onChange:N}),y&&j(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-intense [&>svg]:size-3.5`,onClick:P,children:j(oe,{"aria-hidden":`true`})}),v&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:j(L,{size:14,className:`animate-spin text-primary-strong`})}),h.meta.isDirty&&s&&!!h.meta.errors.length&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:j(F,{"aria-hidden":`true`,size:14})}),M(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[h.meta.isDirty&&s?j(Z,{className:`flex-1`,errors:h.meta.errors}):j(`div`,{}),!!i&&j(`p`,{className:S(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,A?`font-medium text-danger-strong`:E?`text-warning-strong`:`text-text-positive-weak`),children:x})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},Le=w(({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let l=D(),{form:u,state:d,name:f,handleBlur:p,handleChange:m}=Q(),h=V(u.store,({isSubmitting:e})=>e),g=d.value?d.value.length:0,_=O(()=>{if(!i)return``;let e=`character${[0,1].includes(g)?``:`s`}`;return i&&c?`${g} / ${c} character${g?`s`:``}`:`${g} ${e}`},[g,i,c]),v=d.meta.isDirty&&d.meta.isTouched&&!d.meta.isValid,y=s?d.value===null:!1,b=d.meta.errors,C=c&&g>=c*.8,w=c&&g>=c,E=T(({target:{value:e}})=>{h||i&&c&&e.length>c||m(e||null)},[h,i,c,m]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:a,"data-invalid":v,children:[M(W,{children:[j(K,{"aria-required":y,htmlFor:l,children:M(`p`,{children:[e,s&&j(`span`,{className:`text-danger-strong`,children:` *`})]})}),j(J,{children:t})]}),M(G,{children:[j(x,{id:l,name:f,value:d.value===null?``:d.value,"aria-invalid":v,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:S(h&&`pointer-events-none bg-muted-muted opacity-60`),onChange:E,onBlur:p}),h&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:j(L,{size:14,className:`animate-spin text-primary-strong`})}),d.meta.isDirty&&o&&!!b.length&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:j(F,{size:14})}),M(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[d.meta.isDirty&&o?j(Z,{className:`flex-1`,errors:d.meta.errors}):j(`div`,{}),!!i&&j(`p`,{className:S(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,w?`font-medium text-danger-strong`:C?`text-warning-strong`:`text-text-positive-weak`),children:_})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})}),Re=({label:t,className:n})=>{let r=$(),i=T(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return j(r.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:r,isSubmitting:a})=>j(e,{type:`button`,size:`md`,disabled:r,isLoading:a,className:S(`min-h-8 min-w-32`,n),onClick:i,children:t??`Submit`})})},ze=({type:t=`create`})=>{let n=$();return M(`div`,{className:`flex h-8 items-center justify-between`,children:[j(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>j(e,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),t===`create`&&j(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>M(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[j(ie,{}),`Add New`]})}),t===`update`&&j(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>M(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[j(N,{}),`Update`]})})]})};function Be({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return j(pe.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:S(`shrink-0 bg-border-weak`,`data-[orientation=horizontal]:h-px`,`data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full`,`data-[orientation=vertical]:w-px`,e),...r})}const Ve=({title:t,description:n,onDelete:r,children:i})=>M(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-4 ring-border-weak`,children:[M(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-1 p-4`,children:[j(`p`,{className:`font-semibold text-lg`,children:t}),!!n&&j(`p`,{className:`text-muted text-sm`,children:n})]}),j(Be,{}),j(`div`,{"data-slot":`card-form-main`,className:`flex flex-col space-y-4 py-4`,children:i}),!!r&&M(e,{color:`danger`,variant:`outline`,size:`sm`,className:`absolute top-2 right-2`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[j(ae,{}),`Remove`]})]}),He=({children:e})=>j(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),Ue=({...e})=>j(`button`,{...e,type:`button`,className:`min-w-40 cursor-pointer rounded-sm border border-border bg-card px-4 py-2 font-semibold text-sm text-text-positive shadow-xs outline-none transition-all hover:opacity-90 focus:border-border focus:ring-3 focus:ring-border/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none`,children:`Hủy`}),We=({isSubmitting:e,submitText:t=`Submit`,...n})=>j(`button`,{...n,type:`button`,"data-loading":e?`true`:void 0,className:`relative min-h-9.5 min-w-40 cursor-pointer rounded-sm border border-primary-strong bg-primary px-4 py-2 font-semibold text-sm text-text-negative shadow-card outline-none transition-all hover:opacity-90 focus:border-transparent focus:ring-3 focus:ring-primary/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none data-[loading=true]:pointer-events-none data-[loading=true]:opacity-80`,children:e?j(ne,{size:16,strokeWidth:3,className:`absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 animate-spin`}):t}),Ge=({title:e,submitText:n,open:c,onOpenChange:l,children:u})=>{let d=$(),f=T(e=>{e||d.reset(),l?.(e)},[d.reset,l]);return j(s,{open:c,onOpenChange:f,children:M(r,{"data-slot":`dialog-portal`,children:[j(o,{}),M(a,{className:`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-2xl sm:rounded-sm`,children:[j(`div`,{"data-slot":`dialog-header`,className:`flex flex-col items-center justify-center gap-2 px-4 py-6 text-center shadow-sm sm:text-left`,children:j(i,{"data-slot":`dialog-title`,children:e})}),j(t,{}),j(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col space-y-4 overflow-y-auto p-0 pt-6 max-sm:flex-1 sm:p-4`,children:u}),j(t,{}),M(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-between gap-2 px-6 py-4 shadow-sm sm:flex-row sm:justify-end max-sm:[&>button]:w-full`,children:[j(d.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>j(Ue,{disabled:e,onClick:()=>{d.reset(),f(!1)}})}),j(d.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>j(We,{isSubmitting:e,disabled:t,submitText:n,onClick:()=>d.handleSubmit()})})]})]})]})})},Ke=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:r,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t})]}),M(G,{children:[i,j(Y,{isShow:!!n,children:n})]})]}),j(X,{})]}),qe=({title:e,open:t,contentClassName:r,onOpenChange:i,children:a})=>{let o=$();return j(B.Root,{"data-slot":`dialog`,open:t,onOpenChange:i,children:M(B.Portal,{"data-slot":`dialog-portal`,children:[j(B.Overlay,{"data-slot":`dialog-overlay`,className:S(`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`)}),j(B.Content,{"data-slot":`dialog-content`,className:S(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background drop-shadow-lg`,`duration-300`,`data-[state=open]:animate-in`,`data-[state=open]:slide-in-from-right`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:slide-out-to-right`,`data-[state=closed]:fade-out`),children:M(`section`,{className:`relative flex size-full flex-col`,children:[j(`header`,{className:`flex h-14 items-center border-border border-b px-4`,children:j(`h2`,{className:`font-semibold text-lg text-primary-strong`,children:e})}),j(`div`,{className:S(`flex flex-1 flex-col overflow-y-auto py-4`,r),children:a}),M(`div`,{className:`flex flex-col space-y-4 border-border border-t px-4 py-2`,children:[j(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>j(We,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),j(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>j(Ue,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),i?.(!1)}})})]}),j(B.Close,{asChild:!0,children:j(n,{className:`absolute top-2 right-2`})})]})})]})})},Je=({children:e})=>j(`header`,{"data-slot":`section-header`,className:`px-4 pt-2.5 pb-2 font-medium text-base text-text-positive`,children:e}),Ye=({children:e})=>j(`main`,{"data-slot":`section-main`,className:`relative flex flex-col space-y-4 py-4`,children:e}),Xe=({title:e,children:t})=>M(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-4 ring-border-weak`,children:[j(Je,{children:e}),j(Be,{}),j(Ye,{children:t})]}),Ze=({title:e,description:t,helperText:n})=>M(H,{className:`gap-y-4 px-4`,children:[M(U,{className:`gap-0`,children:[M(W,{children:[j(Se,{className:`mb-1`,children:e}),j(J,{children:t})]}),j(Y,{isShow:!!n,children:n})]}),j(X,{})]}),{fieldContext:Qe,formContext:$e,useFieldContext:Q,useFormContext:$}=ge(),{useAppForm:et,withForm:tt,withFieldGroup:nt}=he({fieldContext:Qe,formContext:$e,fieldComponents:{TextField:Ie,TextareaField:Le,NumberField:Ae,EmailField:Te,PasswordField:je,SelectField:Ne,DateField:we,SwitchField:Fe,RadioGroupField:Me,CheckboxField:Ce,FieldGroup:H,Field:U,FieldContent:W,FieldLabel:K,FieldContentMain:G,FieldSeparator:X,FieldError:Z},formComponents:{TanStackDialogForm:Ge,TanStackPopoverForm:qe,TanStackContainerForm:He,TanStackSectionForm:Xe,TanStackCardForm:Ve,TanStackFieldGroup:Ke,TanStackTitleField:Ze,TanStackActionsForm:ze,TanStackActionSubmit:Re}});export{U as Field,W as FieldContent,G as FieldContentMain,Z as FieldError,H as FieldGroup,K as FieldLabel,X as FieldSeparator,Q as useTanStackFieldContext,et as useTanStackForm,$ as useTanStackFormContext,nt as withTanStackFieldGroup,tt as withTanStackForm};
1
+ import"../../heading--VmdIi7C.mjs";import"../../paragraph-moBSTPmT.mjs";import"../../button.variants-DRWf66hR.mjs";import{t as e}from"../../button-D54KOmb7.mjs";import{t}from"../../separator-Bf0gymN4.mjs";import{t as n}from"../../close-DfuHB7kq.mjs";import{c as r,l as i,r as a,s as o,t as s}from"../../dialog-CxELDK98.mjs";import{t as c}from"../../checkbox-Bg2FiuQw.mjs";import{t as l}from"../../input-DBtIgQB6.mjs";import{a as u,i as d,t as f}from"../../popover-BckwBuuD.mjs";import{t as p}from"../../calendar-qHQsMOj9.mjs";import{n as m,t as h}from"../../radio-group-Cem8O6BK.mjs";import{c as g,i as _,n as v,s as y,t as b}from"../../select-CivtMKTM.mjs";import{t as x}from"../../textarea-bLtmb71c.mjs";import{cn as S}from"@customafk/react-toolkit/utils";import{cva as C}from"class-variance-authority";import{memo as w,useCallback as T,useEffect as E,useId as D,useMemo as O,useRef as k,useState as A}from"react";import{jsx as j,jsxs as M}from"react/jsx-runtime";import{ArrowDownToLine as N,AtSignIcon as P,BanIcon as F,CalendarDaysIcon as I,EyeIcon as ee,EyeOffIcon as te,Loader2 as ne,Loader2Icon as L,PackagePlusIcon as re,PlusIcon as ie,Trash2Icon as ae,XIcon as oe}from"lucide-react";import{endOfToday as R,endOfTomorrow as se,endOfYesterday as ce,format as le,lastDayOfMonth as ue,startOfMonth as de,subDays as z}from"@customafk/react-toolkit/date-fns";import{Dialog as B,Label as fe,Separator as pe,Switch as me}from"radix-ui";import{createFormHook as he,createFormHookContexts as ge,useStore as V}from"@tanstack/react-form";const _e=C([`flex w-fit items-center justify-center rounded-full font-bold text-text-negative-strong`],{variants:{color:{default:`bg-primary-strong`,secondary:`bg-secondary-strong`,success:`bg-success-strong`,info:`bg-info-strong`,warning:`bg-warning-strong`,danger:`border border-danger-strong bg-linear-to-b from-danger-strong/90 via-danger-strong to-danger-strong/90`},size:{xs:`px-1.5 py-0.5 text-xs`,sm:`px-2 py-0.75 text-xs`,md:`px-2.5 py-0.75 text-sm`,lg:`px-3 py-1 text-sm`}},defaultVariants:{color:`default`,size:`sm`}}),ve=({label:e,color:t,size:n,className:r,children:i})=>j(`div`,{"data-slot":`required-indicator`,className:_e({color:t,size:n,className:r}),children:e||i});function ye({className:e,children:t,...n}){return M(fe.Root,{"data-slot":`label`,className:S(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[t,j(ve,{label:`Required`,color:`danger`,size:`sm`,className:`hidden`})]})}const be=C(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0`,{variants:{orientation:{vertical:[`flex-col *:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`*:data-[slot=field-label]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col *:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@md/field-group:*:data-[slot=field-label]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}}),xe=w(({className:e,...t})=>j(`fieldset`,{"data-slot":`field-set`,className:S(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));xe.displayName=`FieldSet`;const Se=w(({className:e,variant:t=`legend`,...n})=>j(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:S(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));Se.displayName=`FieldLegend`;const H=w(({className:e,...t})=>j(`div`,{"data-slot":`field-group`,className:S(`group/field-group @container/field-group`,`flex flex-col gap-7`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));H.displayName=`FieldGroup`;const U=w(({className:e,orientation:t=`vertical`,...n})=>j(`div`,{"data-slot":`field`,"data-orientation":t,className:S(be({orientation:t}),e),...n}));U.displayName=`Field`;const W=w(({className:e,...t})=>j(`div`,{"data-slot":`field-content`,className:S(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));W.displayName=`FieldContent`;const G=w(({className:e,...t})=>j(`div`,{"data-slot":`field-content-main`,className:S(`relative`,e),...t})),K=w(({className:e,...t})=>j(ye,{"data-slot":`field-label`,className:S(`group/field-label peer/field-label flex h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));K.displayName=`FieldLabel`;const q=w(({className:e,...t})=>j(`div`,{"data-slot":`field-label`,className:S(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));q.displayName=`FieldTitle`;const J=w(({className:e,...t})=>j(`p`,{"data-slot":`field-description`,className:S(`nth-last-2:-mt-1 font-normal text-text-positive-weak text-xs leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));J.displayName=`FieldDescription`;const Y=w(({isShow:e=!0,className:t,...n})=>e===!1?null:j(`div`,{"data-slot":`field-note`,className:S(`text-wrap rounded border border-primary-muted bg-primary-bg-subtle p-2 text-text-positive-weak text-xs`,t),...n}));Y.displayName=`FieldNote`;const X=w(({children:e,className:n,...r})=>M(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:S(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,n),...r,children:[j(t,{className:`absolute inset-0 top-1/2`}),e&&j(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));X.displayName=`FieldSeparator`;const Z=w(({className:e,children:t,errors:n,...r})=>{let i=O(()=>t||(n?n?.length===1&&n[0]?.message?j(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:j(`p`,{children:n[0]?.code===`invalid_type`?`Không đúng định dạng`:n[0].message})}):j(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?j(`li`,{children:e},e):e?.message?j(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?j(`div`,{role:`alert`,"data-slot":`field-error`,className:S(`w-full font-semibold text-danger-strong text-xs`,e),...r,children:i}):null});Z.displayName=`FieldError`;const Ce=({label:e,description:t,options:n,helperText:r,orientation:i})=>{let a=Q(),o=V(a.form.store,({isSubmitting:e})=>e);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:i,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t}),j(Y,{isShow:!!r,children:r})]}),j(G,{children:j(H,{className:`flex flex-col gap-y-2`,children:n.map(e=>M(U,{orientation:`horizontal`,children:[j(c,{id:`${a.name}-${e.value}`,name:a.name,checked:a.state.value?.includes(e.value)??!1,disabled:o,onCheckedChange:t=>{if(t&&a.state.value!==null)a.pushValue(e.value);else if(t&&a.state.value===null)a.setValue([e.value]);else if(!t&&a.state.value!==null){let t=a.state.value.indexOf(e.value);t>-1&&a.removeValue(t)}else !t&&a.state.value===null&&a.setValue(null)}}),j(K,{htmlFor:`${a.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),j(X,{})]})},we=({label:t,description:n,placeholder:r,orientation:i=`responsive`,helperText:a,minDate:o,maxDate:s,required:c})=>{let l=Q(),m=O(()=>c?l.state.value===null:!1,[c,l.state.value]),h=O(()=>l.state.meta.isTouched&&!l.state.meta.isValid,[l.state.meta.isTouched,l.state.meta.isValid]);return M(H,{className:`px-4`,children:[M(U,{orientation:i,"data-invalid":h,children:[M(W,{children:[j(K,{htmlFor:l.name,"aria-required":m,children:t}),j(J,{children:n})]}),M(G,{className:`flex flex-col space-y-1`,children:[j(`div`,{className:`flex w-full flex-col`,children:M(f,{children:[j(u,{asChild:!0,children:M(e,{variant:`outline`,color:`muted`,size:`lg`,className:S(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,l.state.value===null&&`text-text-positive-muted`),children:[j(`p`,{children:l.state.value===null?r||`Select date`:le(l.state.value,`PPPP`)}),j(I,{strokeWidth:1})]})}),M(d,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:l.handleBlur,children:[M(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(R())},children:`Today`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(se())},children:`Tomorrow`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(ce())},children:`Yesterday`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),3))},children:`Last 3 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),7))},children:`Last 7 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(z(R(),30))},children:`Last 30 Days`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(de(R()))},children:`This Month`}),j(e,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{l.handleChange(ue(R()))},children:`Last Month`})]}),j(`div`,{className:`flex flex-1 flex-col`,children:j(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:j(p,{mode:`single`,selected:l.state.value??void 0,hidden:{before:o??new Date(1900,0,1),after:s??new Date(2100,11,31)},onSelect:e=>{e&&l.handleChange(e)}})})})]})]})}),j(Y,{isShow:!!a,children:a})]})]}),j(X,{})]})},Te=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,maxLength:o})=>{let{form:s,name:c,state:u,handleBlur:d,handleChange:f}=Q(),p=V(s.store,({isSubmitting:e})=>e),m=O(()=>u.meta.isDirty&&u.meta.isTouched&&!u.meta.isValid,[u.meta.isDirty,u.meta.isTouched,u.meta.isValid]),h=T(({target:{value:e}})=>{p||o&&e.length>o||f(e||null)},[p,o,f]),g=T(()=>{p||f(null)},[p,f]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{"data-invalid":m,orientation:i,children:[M(W,{children:[j(K,{htmlFor:c,children:e}),j(J,{children:t})]}),M(G,{children:[j(l,{id:c,name:c,value:u.value===null?``:u.value,"aria-invalid":m,autoComplete:`email`,placeholder:n,className:S(`pl-9`,p&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:d,onChange:h}),j(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:j(P,{size:14})}),j(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:g,children:j(oe,{size:14,"aria-hidden":`true`})}),j(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&u.meta.isDirty&&j(Z,{errors:u.meta.errors})}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},Ee=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,De=e=>Number(e).toLocaleString(),Oe=(e,t,n)=>{if(n===`none`)return e;let r=10**t,i=e*r;switch(n){case`up`:return Math.ceil(i)/r;case`down`:return Math.floor(i)/r;case`nearest`:return i%1<.1?Math.floor(i)/r:i%1>=.59?Math.ceil(i)/r:(Math.floor(i)+.5)/r;default:return e}},ke=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:o,decimal:s,placeholder:c,precision:u,wrapperClassName:d,className:f,onChange:p,onValueChange:m,onFocus:h,onBlur:g,..._})=>{let v=k(null),y=k(null),[b,x]=A(a?.toString()??null),C=O(()=>s?.[1]??r,[s,r]),w=O(()=>s&&s[0]-s[1],[s]),D=O(()=>Ee(n),[n]),N=T(e=>{if(!C||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=C&&r<=(w??1/0)},[C,w]),P=T(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=Oe(parseFloat(e),Math.min(C-1,u||0),i).toString().split(`.`),r=De(t);return n?`${r}.${n}`:r},[C,u,i]),F=T(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){m?.(0),x(e);return}if(n){x(()=>(m?.(0),e));return}},[m]),I=T(e=>{p?.(e);let{value:t}=e.target;if(t===``||t===void 0){m?.(null),x(null);return}F(t),!(!D.test(t)||!N(t))&&(m?.(parseFloat(t)||0),x(t))},[N,p,m,F,D]),ee=T(e=>{t||(h?.(e),x(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,h]),te=T(e=>{t||(g?.(e),x(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?P(e):null))},[t,P,g]);return E(()=>{let e=document.activeElement===y.current;if(a==null||!D.test(a.toString())||!N(a.toString())){x(null);return}x(t=>e?t:P(a.toString()))},[P,a,N,D]),E(()=>{if(!v.current||!y.current||!o)return;let e=v.current.offsetWidth;y.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[o]),M(`div`,{className:S(`relative`,d),children:[j(l,{..._,ref:y,value:b||(t?`0`:``),placeholder:c,disabled:e,readOnly:t,className:S(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,f),onChange:I,onFocus:ee,onBlur:te}),o&&j(`span`,{ref:v,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:o})]})},Ae=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,rounding:o,decimalPlaces:s,percision:c,unit:l,required:u,allowNegative:d})=>{let f=Q(),p=V(f.form.store,({isSubmitting:e})=>e),m=O(()=>f.state.meta.errors,[f.state.meta.errors]),h=O(()=>u?f.state.value===null:!1,[u,f.state.value]),g=T(e=>{p||f.handleChange(e)},[p,f.handleChange]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:i,"data-invalid":f.state.meta.isTouched&&!f.state.meta.isValid,children:[M(W,{children:[j(K,{htmlFor:f.name,"aria-required":h,children:e}),j(J,{children:t})]}),M(G,{children:[M(`div`,{className:`relative w-full`,children:[j(ke,{id:f.name,value:f.state.value,"aria-invalid":f.state.meta.isTouched&&!f.state.meta.isValid&&f.state.meta.isDirty,placeholder:n,roundingRule:o,numberAfterDecimalPoint:s,precision:c,unitText:l,allowNegative:d,className:S(p&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:f.handleBlur,onValueChange:g}),p&&j(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:j(L,{className:`animate-spin text-primary-strong`})}),f.state.meta.isDirty&&a&&!!m.length&&j(`div`,{className:`absolute inset-s-2 inset-y-0 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:j(F,{})}),j(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:f.state.meta.isDirty&&a&&j(Z,{errors:m})})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},je=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0})=>{let{form:o,name:s,state:c,handleBlur:u,handleChange:d}=Q(),f=V(o.store,({isSubmitting:e})=>e),[p,m]=A(!1),h=O(()=>c.meta.isDirty&&c.meta.isTouched&&!c.meta.isValid,[c.meta.isDirty,c.meta.isTouched,c.meta.isValid]),g=T(()=>m(e=>!e),[]),_=T(({target:{value:e}})=>{f||d(e||null)},[f,d]);return j(H,{className:`gap-y-4 px-4`,children:M(U,{"data-invalid":h,orientation:r,children:[M(W,{children:[j(K,{htmlFor:s,children:e}),j(J,{children:t})]}),M(G,{children:[j(l,{id:s,type:p?`text`:`password`,placeholder:n,value:c.value??``,"aria-invalid":h,autoComplete:`new-password`,onBlur:u,onChange:_}),j(`button`,{className:`absolute inset-e-0 inset-y-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:g,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":`password`,children:j(p?te:ee,{size:16,"aria-hidden":`true`})}),j(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&c.meta.isDirty&&j(Z,{errors:c.meta.errors})}),j(Y,{isShow:!!i,children:i})]})]})})},Me=({label:e,description:t,orientation:n,options:r,helperText:i})=>{let a=Q(),o=V(a.form.store,({isSubmitting:e})=>e);return M(H,{className:`px-4`,children:[M(U,{orientation:n,className:`flex-col gap-2`,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t}),j(Y,{isShow:!!i,children:i})]}),j(G,{children:j(h,{defaultValue:a.state.value??void 0,className:`w-full`,onValueChange:a.handleChange,children:r.map(e=>j(K,{className:S(`h-fit`,a.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,o&&`pointer-events-none bg-muted-muted opacity-60`,a.state.value===e.value&&o&&`border-border-strong!`),children:M(U,{orientation:`horizontal`,className:`justify-between rounded p-2!`,children:[M(W,{className:`gap-1!`,children:[j(q,{children:e.label}),j(J,{className:`text-xs`,children:e.description})]}),j(m,{value:e.value})]})},e.value))})})]}),j(X,{})]})},Ne=({label:e,description:t,placeholder:n,orientation:r=`responsive`,options:i,helperText:a,required:o=!1})=>{let s=Q(),c=O(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),l=O(()=>o?s.state.value===null:!1,[o,s.state.value]),u=O(()=>s.state.meta.errors,[s.state.meta.errors]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:r,"data-invalid":s.state.meta.isTouched&&!s.state.meta.isValid,children:[M(W,{children:[j(K,{htmlFor:s.name,"aria-required":l,children:e}),j(J,{children:t})]}),M(G,{className:`flex flex-col`,children:[M(b,{defaultValue:s.state.value||void 0,onValueChange:s.handleChange,children:[j(y,{"aria-invalid":c?`true`:void 0,onBlur:s.handleBlur,children:j(g,{placeholder:n})}),M(v,{children:[!!i.length&&i.map(e=>j(_,{value:e.value,children:e.label},e.value)),!i.length&&M(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[j(re,{strokeWidth:1}),`No options available`]})]})]}),j(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:j(Z,{errors:u})}),j(Y,{isShow:!!a,children:a})]})]}),j(X,{})]})};function Pe({className:e,...t}){return j(me.Root,{"data-slot":`switch`,className:S(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:j(me.Thumb,{"data-slot":`switch-thumb`,className:S(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const Fe=({label:e,description:t,helperText:n})=>{let r=Q();return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[M(W,{children:[j(q,{className:`cursor-pointer`,children:j(`label`,{htmlFor:r.name,children:e})}),j(J,{children:t}),j(Pe,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),j(Y,{isShow:!!n,children:n})]}),j(X,{})]})},Ie=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showClearButton:o=!1,showErrorMessage:s=!0,required:c=!1,maxLength:u})=>{let d=D(),f=k(null),{form:p,name:m,state:h,handleBlur:g,handleChange:_}=Q(),v=V(p.store,({isSubmitting:e})=>e),y=o&&!v&&!!h.value&&!h.meta.errors.length,b=h.value?h.value.length:0,x=O(()=>{if(!i)return``;let e=`character${[0,1].includes(b)?``:`s`}`;return i&&u?`${b} / ${u} character${b?`s`:``}`:`${b} ${e}`},[b,i,u]),C=h.meta.isDirty&&h.meta.isTouched&&!h.meta.isValid,w=c?h.value===null:!1,E=u&&b>=u*.8,A=u&&b>=u,N=T(({target:{value:e}})=>{v||i&&u&&e.length>u||_(e||null)},[v,i,u,_]),P=T(()=>{v||(_(null),f.current?.focus())},[v,_]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:a,"data-invalid":C,children:[M(W,{children:[j(K,{"aria-required":w,htmlFor:d,children:M(`p`,{children:[e,c&&j(`span`,{className:`text-danger-strong`,children:` *`})]})}),j(J,{children:t})]}),M(G,{children:[j(l,{ref:f,id:d,name:m,value:h.value??``,"aria-invalid":C,autoComplete:`off`,placeholder:n,autoCapitalize:`none`,autoCorrect:`off`,className:S(`pr-6`,v&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:g,onChange:N}),y&&j(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-e-0 inset-y-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-intense [&>svg]:size-3.5`,onClick:P,children:j(oe,{"aria-hidden":`true`})}),v&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:j(L,{size:14,className:`animate-spin text-primary-strong`})}),h.meta.isDirty&&s&&!!h.meta.errors.length&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:j(F,{"aria-hidden":`true`,size:14})}),M(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[h.meta.isDirty&&s?j(Z,{className:`flex-1`,errors:h.meta.errors}):j(`div`,{}),!!i&&j(`p`,{className:S(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,A?`font-medium text-danger-strong`:E?`text-warning-strong`:`text-text-positive-weak`),children:x})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})},Le=w(({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let l=D(),{form:u,state:d,name:f,handleBlur:p,handleChange:m}=Q(),h=V(u.store,({isSubmitting:e})=>e),g=d.value?d.value.length:0,_=O(()=>{if(!i)return``;let e=`character${[0,1].includes(g)?``:`s`}`;return i&&c?`${g} / ${c} character${g?`s`:``}`:`${g} ${e}`},[g,i,c]),v=d.meta.isDirty&&d.meta.isTouched&&!d.meta.isValid,y=s?d.value===null:!1,b=d.meta.errors,C=c&&g>=c*.8,w=c&&g>=c,E=T(({target:{value:e}})=>{h||i&&c&&e.length>c||m(e||null)},[h,i,c,m]);return M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:a,"data-invalid":v,children:[M(W,{children:[j(K,{"aria-required":y,htmlFor:l,children:M(`p`,{children:[e,s&&j(`span`,{className:`text-danger-strong`,children:` *`})]})}),j(J,{children:t})]}),M(G,{children:[j(x,{id:l,name:f,value:d.value===null?``:d.value,"aria-invalid":v,autoCapitalize:`none`,autoComplete:`off`,placeholder:n,className:S(h&&`pointer-events-none bg-muted-muted opacity-60`),onChange:E,onBlur:p}),h&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-muted-weak`,children:j(L,{size:14,className:`animate-spin text-primary-strong`})}),d.meta.isDirty&&o&&!!b.length&&j(`div`,{className:`absolute inset-e-2 inset-y-0 top-2.5 text-danger-strong`,children:j(F,{size:14})}),M(`div`,{className:`my-1 flex w-full items-start justify-between gap-x-2`,children:[d.meta.isDirty&&o?j(Z,{className:`flex-1`,errors:d.meta.errors}):j(`div`,{}),!!i&&j(`p`,{className:S(`h-4 flex-0 text-nowrap text-end text-xs tabular-nums transition-colors`,w?`font-medium text-danger-strong`:C?`text-warning-strong`:`text-text-positive-weak`),children:_})]}),j(Y,{isShow:!!r,children:r})]})]}),j(X,{})]})}),Re=({label:t,className:n})=>{let r=$(),i=T(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return j(r.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:r,isSubmitting:a})=>j(e,{type:`button`,size:`md`,disabled:r,isLoading:a,className:S(`min-h-8 min-w-32`,n),onClick:i,children:t??`Submit`})})},ze=({type:t=`create`})=>{let n=$();return M(`div`,{className:`flex h-8 items-center justify-between`,children:[j(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:t})=>j(e,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:t,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),t===`create`&&j(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>M(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[j(ie,{}),`Add New`]})}),t===`update`&&j(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:t,isSubmitting:r})=>M(e,{type:`submit`,size:`md`,disabled:t,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[j(N,{}),`Update`]})})]})};function Be({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return j(pe.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:S(`shrink-0 bg-border-weak`,`data-[orientation=horizontal]:h-px`,`data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full`,`data-[orientation=vertical]:w-px`,e),...r})}const Ve=({title:t,description:n,onDelete:r,children:i})=>M(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-4 ring-border-weak`,children:[M(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-1 p-4`,children:[j(`p`,{className:`font-semibold text-lg`,children:t}),!!n&&j(`p`,{className:`text-muted text-sm`,children:n})]}),j(Be,{}),j(`div`,{"data-slot":`card-form-main`,className:`flex flex-col space-y-4 py-4`,children:i}),!!r&&M(e,{color:`danger`,variant:`outline`,size:`sm`,className:`absolute top-2 right-2`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[j(ae,{}),`Remove`]})]}),He=({children:e})=>j(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),Ue=({...e})=>j(`button`,{...e,type:`button`,className:`min-w-40 cursor-pointer rounded-sm border border-border bg-card px-4 py-2 font-semibold text-sm text-text-positive shadow-xs outline-none transition-all hover:opacity-90 focus:border-border focus:ring-3 focus:ring-border/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none`,children:`Hủy`}),We=({isSubmitting:e,submitText:t=`Submit`,...n})=>j(`button`,{...n,type:`button`,"data-loading":e?`true`:void 0,className:`relative min-h-9.5 min-w-40 cursor-pointer rounded-sm border border-primary-strong bg-primary px-4 py-2 font-semibold text-sm text-text-negative shadow-card outline-none transition-all hover:opacity-90 focus:border-transparent focus:ring-3 focus:ring-primary/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none data-[loading=true]:pointer-events-none data-[loading=true]:opacity-80`,children:e?j(ne,{size:16,strokeWidth:3,className:`absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 animate-spin`}):t}),Ge=({title:e,submitText:n,open:c,onOpenChange:l,children:u})=>{let d=$(),f=T(e=>{e||d.reset(),l?.(e)},[d.reset,l]);return j(s,{open:c,onOpenChange:f,children:M(r,{"data-slot":`dialog-portal`,children:[j(o,{}),M(a,{className:`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-2xl sm:rounded-sm`,children:[j(`div`,{"data-slot":`dialog-header`,className:`flex flex-col items-center justify-center gap-2 px-4 py-6 text-center shadow-sm sm:text-left`,children:j(i,{"data-slot":`dialog-title`,children:e})}),j(t,{}),j(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col space-y-4 overflow-y-auto p-0 pt-6 max-sm:flex-1 sm:p-4`,children:u}),j(t,{}),M(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-between gap-2 px-6 py-4 shadow-sm sm:flex-row sm:justify-end max-sm:[&>button]:w-full`,children:[j(d.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>j(Ue,{disabled:e,onClick:()=>{d.reset(),f(!1)}})}),j(d.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>j(We,{isSubmitting:e,disabled:t,submitText:n,onClick:()=>d.handleSubmit()})})]})]})]})})},Ke=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>M(H,{className:`gap-y-4 px-4`,children:[M(U,{orientation:r,children:[M(W,{children:[j(K,{children:e}),j(J,{children:t})]}),M(G,{children:[i,j(Y,{isShow:!!n,children:n})]})]}),j(X,{})]}),qe=({title:e,open:t,contentClassName:r,onOpenChange:i,children:a})=>{let o=$();return j(B.Root,{"data-slot":`dialog`,open:t,onOpenChange:i,children:M(B.Portal,{"data-slot":`dialog-portal`,children:[j(B.Overlay,{"data-slot":`dialog-overlay`,className:S(`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`)}),j(B.Content,{"data-slot":`dialog-content`,className:S(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background drop-shadow-lg`,`duration-300`,`data-[state=open]:animate-in`,`data-[state=open]:slide-in-from-right`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:slide-out-to-right`,`data-[state=closed]:fade-out`),children:M(`section`,{className:`relative flex size-full flex-col`,children:[j(`header`,{className:`flex h-14 items-center border-border border-b px-4`,children:j(`h2`,{className:`font-semibold text-lg text-primary-strong`,children:e})}),j(`div`,{className:S(`flex flex-1 flex-col overflow-y-auto py-4`,r),children:a}),M(`div`,{className:`flex flex-col space-y-4 border-border border-t px-4 py-2`,children:[j(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>j(We,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),j(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>j(Ue,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),i?.(!1)}})})]}),j(B.Close,{asChild:!0,children:j(n,{className:`absolute top-2 right-2`})})]})})]})})},Je=({children:e})=>j(`header`,{"data-slot":`section-header`,className:`px-4 pt-2.5 pb-2 font-medium text-base text-text-positive`,children:e}),Ye=({children:e})=>j(`main`,{"data-slot":`section-main`,className:`relative flex flex-col space-y-4 py-4`,children:e}),Xe=({title:e,children:t})=>M(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-4 ring-border-weak`,children:[j(Je,{children:e}),j(Be,{}),j(Ye,{children:t})]}),Ze=({title:e,description:t,helperText:n})=>M(H,{className:`gap-y-4 px-4`,children:[M(U,{className:`gap-0`,children:[M(W,{children:[j(Se,{className:`mb-1`,children:e}),j(J,{children:t})]}),j(Y,{isShow:!!n,children:n})]}),j(X,{})]}),{fieldContext:Qe,formContext:$e,useFieldContext:Q,useFormContext:$}=ge(),{useAppForm:et,withForm:tt,withFieldGroup:nt}=he({fieldContext:Qe,formContext:$e,fieldComponents:{TextField:Ie,TextareaField:Le,NumberField:Ae,EmailField:Te,PasswordField:je,SelectField:Ne,DateField:we,SwitchField:Fe,RadioGroupField:Me,CheckboxField:Ce,FieldGroup:H,Field:U,FieldContent:W,FieldLabel:K,FieldContentMain:G,FieldSeparator:X,FieldError:Z},formComponents:{TanStackDialogForm:Ge,TanStackPopoverForm:qe,TanStackContainerForm:He,TanStackSectionForm:Xe,TanStackCardForm:Ve,TanStackFieldGroup:Ke,TanStackTitleField:Ze,TanStackActionsForm:ze,TanStackActionSubmit:Re}});export{U as Field,W as FieldContent,G as FieldContentMain,Z as FieldError,H as FieldGroup,K as FieldLabel,X as FieldSeparator,Q as useTanStackFieldContext,et as useTanStackForm,$ as useTanStackFormContext,nt as withTanStackFieldGroup,tt as withTanStackForm};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,12 +1,12 @@
1
+ import * as react_jsx_runtime261 from "react/jsx-runtime";
2
+ import * as class_variance_authority_types10 from "class-variance-authority/types";
1
3
  import { VariantProps } from "class-variance-authority";
2
- import * as react_jsx_runtime225 from "react/jsx-runtime";
3
- import * as class_variance_authority_types9 from "class-variance-authority/types";
4
4
 
5
5
  //#region packages/components/ui/input.d.ts
6
6
  declare const inputVariants: (props?: ({
7
- variant?: "none" | "outline" | "ghost" | "soft" | "subtle" | null | undefined;
8
- size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
9
- } & class_variance_authority_types9.ClassProp) | undefined) => string;
7
+ variant?: "outline" | "none" | "ghost" | "soft" | "subtle" | null | undefined;
8
+ size?: "lg" | "sm" | "xs" | "md" | "xl" | null | undefined;
9
+ } & class_variance_authority_types10.ClassProp) | undefined) => string;
10
10
  type InputVariantProps = VariantProps<typeof inputVariants>;
11
11
  declare function Input({
12
12
  className,
@@ -19,7 +19,7 @@ declare function Input({
19
19
  variant?: InputVariantProps['variant'];
20
20
  size?: InputVariantProps['size'];
21
21
  onValueChange?: (value: string) => void;
22
- }): react_jsx_runtime225.JSX.Element;
22
+ }): react_jsx_runtime261.JSX.Element;
23
23
  //#endregion
24
24
  export { InputVariantProps as n, inputVariants as r, Input as t };
25
- //# sourceMappingURL=input-CLlVXOR2.d.mts.map
25
+ //# sourceMappingURL=input-B65h-l45.d.cts.map
@@ -1,11 +1,11 @@
1
- import * as react_jsx_runtime137 from "react/jsx-runtime";
2
- import * as class_variance_authority_types8 from "class-variance-authority/types";
3
1
  import { VariantProps } from "class-variance-authority";
2
+ import * as react_jsx_runtime267 from "react/jsx-runtime";
3
+ import * as class_variance_authority_types8 from "class-variance-authority/types";
4
4
 
5
5
  //#region packages/components/ui/input.d.ts
6
6
  declare const inputVariants: (props?: ({
7
- variant?: "none" | "outline" | "ghost" | "soft" | "subtle" | null | undefined;
8
- size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
7
+ variant?: "outline" | "none" | "ghost" | "soft" | "subtle" | null | undefined;
8
+ size?: "lg" | "sm" | "xs" | "md" | "xl" | null | undefined;
9
9
  } & class_variance_authority_types8.ClassProp) | undefined) => string;
10
10
  type InputVariantProps = VariantProps<typeof inputVariants>;
11
11
  declare function Input({
@@ -19,7 +19,7 @@ declare function Input({
19
19
  variant?: InputVariantProps['variant'];
20
20
  size?: InputVariantProps['size'];
21
21
  onValueChange?: (value: string) => void;
22
- }): react_jsx_runtime137.JSX.Element;
22
+ }): react_jsx_runtime267.JSX.Element;
23
23
  //#endregion
24
24
  export { InputVariantProps as n, inputVariants as r, Input as t };
25
- //# sourceMappingURL=input-Bm0YXroi.d.cts.map
25
+ //# sourceMappingURL=input-C6Q4vGNC.d.mts.map
@@ -1,2 +1,2 @@
1
- const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../dist-BudM04oj.cjs`);require(`../../button.variants-rdXrPUao.cjs`);const n=require(`../../button-CYw2AqT0.cjs`);require(`../../skeleton-CHympz8k.cjs`);const r=require(`../../tooltip-DC6i1A25.cjs`),i=require(`../../separator-C3ip6sbh.cjs`),a=require(`../../sheet-5MJRtrfG.cjs`),o=require(`../../dropdown-menu-BuyuU6uF.cjs`),s=require(`../../input-BFWWaN-v.cjs`);let c=require(`@customafk/react-toolkit/utils`),l=require(`class-variance-authority`),u=require(`react`),d=require(`react/jsx-runtime`),f=require(`lucide-react`),p=require(`@customafk/react-toolkit/hooks/useMobile`);const m=`sidebar_state`,h=3600*24*7,g=`16rem`,_=`18rem`,v=`3rem`,y=`b`,b=(0,u.createContext)(null);function x(){let e=(0,u.useContext)(b);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function S({defaultOpen:e=!0,open:t,onOpenChange:n,className:i,style:a,children:o,...s}){let c=(0,p.useIsMobile)(),[l,f]=(0,u.useState)(!1),[m,h]=(0,u.useState)(e),g=t??m,_=(0,u.useCallback)(e=>{let t=typeof e==`function`?e(g):e;n?n(t):h(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,g]),v=(0,u.useCallback)(()=>c?f(e=>!e):_(e=>!e),[c,_]);(0,u.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v]);let y=g?`expanded`:`collapsed`,x=(0,u.useMemo)(()=>({state:y,open:g,setOpen:_,isMobile:c,openMobile:l,setOpenMobile:f,toggleSidebar:v}),[y,g,_,c,l,v]);return(0,d.jsx)(b.Provider,{value:x,children:(0,d.jsx)(r.r,{delayDuration:0,children:(0,d.jsx)(`section`,{"data-slot":`layout-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:`relative group/sidebar-wrapper flex h-dvh bg-sidebar`,...s,children:o})})})}const C=(0,u.memo)(({side:e=`left`,variant:t=`sidebar`,collapsible:r=`offcanvas`,className:i,children:o,...s})=>{let{isMobile:l,state:p,openMobile:m,setOpenMobile:h,toggleSidebar:g}=x(),_=(0,u.useCallback)(e=>{g(),e.preventDefault(),e.stopPropagation()},[g]);return r===`none`?(0,d.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,c.cn)(`flex w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,i),...s,children:o}):l?(0,d.jsx)(a.t,{open:m,onOpenChange:h,...s,children:(0,d.jsxs)(a.r,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,style:{"--sidebar-width":`18rem`},side:e,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,children:[(0,d.jsxs)(a.o,{className:`sr-only`,children:[(0,d.jsx)(a.s,{children:`Sidebar`}),(0,d.jsx)(a.i,{children:`Displays the mobile sidebar.`})]}),(0,d.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,d.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,d.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,c.cn)(`size-10 rounded-full`,i),onClick:_,children:[(0,d.jsx)(f.MenuIcon,{className:`size-6!`}),(0,d.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,d.jsx)(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,d.jsx)(f.ShoppingCartIcon,{size:20})}),(0,d.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,d.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,d.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,d.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:o})]})]})}):(0,d.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":p,"data-collapsible":p===`collapsed`?r:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,d.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,c.cn)(`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) sm:h-[calc(var(--header-height)+0.5rem)]`,`w-(--sidebar-width)`,`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`)}),(0,d.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,c.cn)(`hidden md:flex shadow-nav`,`fixed left-0 inset-y-0 p-2`,`top-[calc(var(--header-height)+0.5rem)] z-10`,`w-(--sidebar-width)`,`transition-all duration-200 ease-linear`,`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`,i),...s,children:(0,d.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`relative flex size-full flex-col`,children:o})})]})});C.displayName=`CMSLayoutSidebar`;const w=(0,u.memo)(({className:e,children:t,...n})=>(0,d.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,c.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,d.jsx)(`section`,{className:`h-(--header-height) sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,d.jsx)(`section`,{className:`flex-1 relative size-full overflow-auto`,children:t})]}));w.displayName=`CMSLayoutMain`;const T=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(s.t,{"data-slot":`sidebar-input`,"data-sidebar":`input`,className:(0,c.cn)(`h-8 w-full bg-background shadow-none`,e),...t}));T.displayName=`SidebarInput`;const E=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:(0,c.cn)(`flex flex-col gap-2 p-2`,e),...t}));E.displayName=`SidebarHeader`;const D=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,c.cn)(`flex flex-col gap-2`,e),...t}));D.displayName=`SidebarFooter`;const O=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(i.t,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:(0,c.cn)(`mx-2 w-auto bg-sidebar-border`,e),...t}));O.displayName=`SidebarSeparator`;const k=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,c.cn)(`flex flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));k.displayName=`SidebarContent`;const A=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,c.cn)(`relative flex w-full flex-col`,e),...t}));A.displayName=`SidebarGroup`;const j=(0,u.memo)(({className:e,asChild:n=!1,...r})=>(0,d.jsx)(n?t.t:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,c.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...r}));j.displayName=`SidebarGroupLabel`;const M=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,c.cn)(`w-full text-sm`,e),...t}));M.displayName=`SidebarGroupContent`;const N=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,c.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t}));N.displayName=`SidebarMenu`;const P=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,c.cn)(`group/menu-item relative`,e),...t}));P.displayName=`SidebarMenuItem`;const F=(0,l.cva)([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}}),I=(0,u.memo)(({asChild:e=!1,isActive:n=!1,variant:i=`default`,size:a=`default`,tooltip:o,className:s,...l})=>{let f=e?t.t:`button`,{isMobile:p,state:m}=x(),h=(0,u.useCallback)(e=>{l.onClick?.(),e.preventDefault(),e.stopPropagation()},[l]),g=(0,d.jsx)(f,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":a,"data-active":n,className:(0,c.cn)(F({variant:i,size:a}),s),onClick:h,...l});return o?(typeof o==`string`&&(o={children:o}),(0,d.jsxs)(r.t,{children:[(0,d.jsx)(r.i,{asChild:!0,children:g}),(0,d.jsx)(r.n,{side:`right`,align:`center`,hidden:m!==`collapsed`||p,...o})]})):g});I.displayName=`SidebarMenuButton`;const L=({i18nText:e,onChangeToEnLocale:t,onChangeToViLocale:r})=>{let{toggleSidebar:i}=x();return(0,d.jsxs)(`header`,{"data-slot":`cms-layout-header`,className:(0,c.cn)(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[(0,d.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full transition-all hover:text-text-positive`,onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},children:[(0,d.jsx)(f.MenuIcon,{className:`size-6!`}),(0,d.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,d.jsxs)(`div`,{className:`flex flex-1 gap-x-2 sm:ml-2.5`,children:[(0,d.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,d.jsx)(f.ShoppingCartIcon,{size:20})}),(0,d.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,d.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),(0,d.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]}),(0,d.jsxs)(o.t,{children:[(0,d.jsx)(o.h,{asChild:!0,children:(0,d.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,className:`gap-x-1 rounded-full transition-all hover:text-text-positive`,children:[(0,d.jsx)(f.EarthIcon,{className:`size-6!`}),e]})}),(0,d.jsx)(o.r,{align:`end`,children:(0,d.jsxs)(o.i,{children:[(0,d.jsx)(o.a,{onClick:e=>{t?.(),e.preventDefault(),e.stopPropagation()},children:`EN - English`}),(0,d.jsx)(o.a,{onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:`VI - Vietnamese`})]})})]})]})},R=(0,u.memo)(({id:e,label:t,icon:n,activeNavItemId:r,onClick:i})=>(0,d.jsx)(P,{children:(0,d.jsxs)(I,{isActive:e===r,onClick:i,children:[n,t]})},e));R.displayName=`SidebarContentGroupItem`;const z=(0,u.memo)(({id:e,label:t,children:n})=>(0,d.jsxs)(A,{children:[(0,d.jsx)(j,{children:t}),(0,d.jsx)(M,{children:(0,d.jsx)(N,{children:n})})]},e));z.displayName=`SidebarContentGroup`;const B=({i18nText:e,activeNavItemId:t,sidebar:n,children:r,onChangeToEnLocale:i,onChangeToViLocale:a,onLogout:o})=>{let s=(0,u.useMemo)(()=>n?.groupcontent||[],[n]);return(0,d.jsxs)(S,{children:[(0,d.jsx)(L,{i18nText:e,onChangeToEnLocale:i,onChangeToViLocale:a}),(0,d.jsxs)(C,{variant:`inset`,collapsible:`icon`,children:[(0,d.jsx)(k,{children:s.map(e=>(0,d.jsx)(z,{id:e.id,label:e.label,children:e.items.map(e=>(0,d.jsx)(R,{activeNavItemId:t,id:e.id,label:e.label,icon:e.icon,onClick:e.onClick},e.id))},e.id))}),(0,d.jsx)(D,{children:(0,d.jsxs)(N,{children:[(0,d.jsx)(P,{children:(0,d.jsxs)(I,{className:`border border-border`,onClick:o,children:[(0,d.jsx)(f.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),(0,d.jsx)(P,{className:`mt-2 border-t border-t-border`,children:(0,d.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})]}),(0,d.jsx)(w,{children:r})]})};exports.CMSLayout=B;
1
+ const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../dist-BudM04oj.cjs`);require(`../../button.variants-CS-Cmarr.cjs`);const n=require(`../../button-CpEejahy.cjs`);require(`../../skeleton-CHympz8k.cjs`);const r=require(`../../tooltip-DC6i1A25.cjs`),i=require(`../../separator-C3ip6sbh.cjs`),a=require(`../../sheet-5MJRtrfG.cjs`),o=require(`../../dropdown-menu-BuyuU6uF.cjs`),s=require(`../../input-BFWWaN-v.cjs`);let c=require(`@customafk/react-toolkit/utils`),l=require(`class-variance-authority`),u=require(`react`),d=require(`react/jsx-runtime`),f=require(`lucide-react`),p=require(`@customafk/react-toolkit/hooks/useMobile`);const m=`sidebar_state`,h=3600*24*7,g=`16rem`,_=`18rem`,v=`3rem`,y=`b`,b=(0,u.createContext)(null);function x(){let e=(0,u.useContext)(b);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function S({defaultOpen:e=!0,open:t,onOpenChange:n,className:i,style:a,children:o,...s}){let c=(0,p.useIsMobile)(),[l,f]=(0,u.useState)(!1),[m,h]=(0,u.useState)(e),g=t??m,_=(0,u.useCallback)(e=>{let t=typeof e==`function`?e(g):e;n?n(t):h(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,g]),v=(0,u.useCallback)(()=>c?f(e=>!e):_(e=>!e),[c,_]);(0,u.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v]);let y=g?`expanded`:`collapsed`,x=(0,u.useMemo)(()=>({state:y,open:g,setOpen:_,isMobile:c,openMobile:l,setOpenMobile:f,toggleSidebar:v}),[y,g,_,c,l,v]);return(0,d.jsx)(b.Provider,{value:x,children:(0,d.jsx)(r.r,{delayDuration:0,children:(0,d.jsx)(`section`,{"data-slot":`layout-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:`relative group/sidebar-wrapper flex h-dvh bg-sidebar`,...s,children:o})})})}const C=(0,u.memo)(({side:e=`left`,variant:t=`sidebar`,collapsible:r=`offcanvas`,className:i,children:o,...s})=>{let{isMobile:l,state:p,openMobile:m,setOpenMobile:h,toggleSidebar:g}=x(),_=(0,u.useCallback)(e=>{g(),e.preventDefault(),e.stopPropagation()},[g]);return r===`none`?(0,d.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,c.cn)(`flex w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,i),...s,children:o}):l?(0,d.jsx)(a.t,{open:m,onOpenChange:h,...s,children:(0,d.jsxs)(a.r,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,style:{"--sidebar-width":`18rem`},side:e,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,children:[(0,d.jsxs)(a.o,{className:`sr-only`,children:[(0,d.jsx)(a.s,{children:`Sidebar`}),(0,d.jsx)(a.i,{children:`Displays the mobile sidebar.`})]}),(0,d.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,d.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,d.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,c.cn)(`size-10 rounded-full`,i),onClick:_,children:[(0,d.jsx)(f.MenuIcon,{className:`size-6!`}),(0,d.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,d.jsx)(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,d.jsx)(f.ShoppingCartIcon,{size:20})}),(0,d.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,d.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,d.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,d.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:o})]})]})}):(0,d.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":p,"data-collapsible":p===`collapsed`?r:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,d.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,c.cn)(`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) sm:h-[calc(var(--header-height)+0.5rem)]`,`w-(--sidebar-width)`,`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`)}),(0,d.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,c.cn)(`hidden md:flex shadow-nav`,`fixed left-0 inset-y-0 p-2`,`top-[calc(var(--header-height)+0.5rem)] z-10`,`w-(--sidebar-width)`,`transition-all duration-200 ease-linear`,`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`,i),...s,children:(0,d.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`relative flex size-full flex-col`,children:o})})]})});C.displayName=`CMSLayoutSidebar`;const w=(0,u.memo)(({className:e,children:t,...n})=>(0,d.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,c.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,d.jsx)(`section`,{className:`h-(--header-height) sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,d.jsx)(`section`,{className:`flex-1 relative size-full overflow-auto`,children:t})]}));w.displayName=`CMSLayoutMain`;const T=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(s.t,{"data-slot":`sidebar-input`,"data-sidebar":`input`,className:(0,c.cn)(`h-8 w-full bg-background shadow-none`,e),...t}));T.displayName=`SidebarInput`;const E=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:(0,c.cn)(`flex flex-col gap-2 p-2`,e),...t}));E.displayName=`SidebarHeader`;const D=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,c.cn)(`flex flex-col gap-2`,e),...t}));D.displayName=`SidebarFooter`;const O=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(i.t,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:(0,c.cn)(`mx-2 w-auto bg-sidebar-border`,e),...t}));O.displayName=`SidebarSeparator`;const k=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,c.cn)(`flex flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));k.displayName=`SidebarContent`;const A=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,c.cn)(`relative flex w-full flex-col`,e),...t}));A.displayName=`SidebarGroup`;const j=(0,u.memo)(({className:e,asChild:n=!1,...r})=>(0,d.jsx)(n?t.t:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,c.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...r}));j.displayName=`SidebarGroupLabel`;const M=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,c.cn)(`w-full text-sm`,e),...t}));M.displayName=`SidebarGroupContent`;const N=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,c.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t}));N.displayName=`SidebarMenu`;const P=(0,u.memo)(({className:e,...t})=>(0,d.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,c.cn)(`group/menu-item relative`,e),...t}));P.displayName=`SidebarMenuItem`;const F=(0,l.cva)([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}}),I=(0,u.memo)(({asChild:e=!1,isActive:n=!1,variant:i=`default`,size:a=`default`,tooltip:o,className:s,...l})=>{let f=e?t.t:`button`,{isMobile:p,state:m}=x(),h=(0,u.useCallback)(e=>{l.onClick?.(),e.preventDefault(),e.stopPropagation()},[l]),g=(0,d.jsx)(f,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":a,"data-active":n,className:(0,c.cn)(F({variant:i,size:a}),s),onClick:h,...l});return o?(typeof o==`string`&&(o={children:o}),(0,d.jsxs)(r.t,{children:[(0,d.jsx)(r.i,{asChild:!0,children:g}),(0,d.jsx)(r.n,{side:`right`,align:`center`,hidden:m!==`collapsed`||p,...o})]})):g});I.displayName=`SidebarMenuButton`;const L=({i18nText:e,onChangeToEnLocale:t,onChangeToViLocale:r})=>{let{toggleSidebar:i}=x();return(0,d.jsxs)(`header`,{"data-slot":`cms-layout-header`,className:(0,c.cn)(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[(0,d.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full transition-all hover:text-text-positive`,onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},children:[(0,d.jsx)(f.MenuIcon,{className:`size-6!`}),(0,d.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,d.jsxs)(`div`,{className:`flex flex-1 gap-x-2 sm:ml-2.5`,children:[(0,d.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,d.jsx)(f.ShoppingCartIcon,{size:20})}),(0,d.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,d.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),(0,d.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]}),(0,d.jsxs)(o.t,{children:[(0,d.jsx)(o.h,{asChild:!0,children:(0,d.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,className:`gap-x-1 rounded-full transition-all hover:text-text-positive`,children:[(0,d.jsx)(f.EarthIcon,{className:`size-6!`}),e]})}),(0,d.jsx)(o.r,{align:`end`,children:(0,d.jsxs)(o.i,{children:[(0,d.jsx)(o.a,{onClick:e=>{t?.(),e.preventDefault(),e.stopPropagation()},children:`EN - English`}),(0,d.jsx)(o.a,{onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:`VI - Vietnamese`})]})})]})]})},R=(0,u.memo)(({id:e,label:t,icon:n,activeNavItemId:r,onClick:i})=>(0,d.jsx)(P,{children:(0,d.jsxs)(I,{isActive:e===r,onClick:i,children:[n,t]})},e));R.displayName=`SidebarContentGroupItem`;const z=(0,u.memo)(({id:e,label:t,children:n})=>(0,d.jsxs)(A,{children:[(0,d.jsx)(j,{children:t}),(0,d.jsx)(M,{children:(0,d.jsx)(N,{children:n})})]},e));z.displayName=`SidebarContentGroup`;const B=({i18nText:e,activeNavItemId:t,sidebar:n,children:r,onChangeToEnLocale:i,onChangeToViLocale:a,onLogout:o})=>{let s=(0,u.useMemo)(()=>n?.groupcontent||[],[n]);return(0,d.jsxs)(S,{children:[(0,d.jsx)(L,{i18nText:e,onChangeToEnLocale:i,onChangeToViLocale:a}),(0,d.jsxs)(C,{variant:`inset`,collapsible:`icon`,children:[(0,d.jsx)(k,{children:s.map(e=>(0,d.jsx)(z,{id:e.id,label:e.label,children:e.items.map(e=>(0,d.jsx)(R,{activeNavItemId:t,id:e.id,label:e.label,icon:e.icon,onClick:e.onClick},e.id))},e.id))}),(0,d.jsx)(D,{children:(0,d.jsxs)(N,{children:[(0,d.jsx)(P,{children:(0,d.jsxs)(I,{className:`border border-border`,onClick:o,children:[(0,d.jsx)(f.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),(0,d.jsx)(P,{className:`mt-2 border-t border-t-border`,children:(0,d.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})]}),(0,d.jsx)(w,{children:r})]})};exports.CMSLayout=B;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"../../dist-CvmzZ_6C.mjs";import"../../button.variants-DuuH1O0_.mjs";import{t}from"../../button-B2FJrOBP.mjs";import"../../skeleton-Ba6koCVf.mjs";import{i as n,n as r,r as i,t as a}from"../../tooltip-B3dTcgcc.mjs";import{t as o}from"../../separator-Bf0gymN4.mjs";import{i as s,o as c,r as l,s as u,t as d}from"../../sheet-oadGRiie.mjs";import{a as f,h as p,i as m,r as h,t as g}from"../../dropdown-menu-B8GUTfTp.mjs";import{t as _}from"../../input-DBtIgQB6.mjs";import{cn as v}from"@customafk/react-toolkit/utils";import{cva as y}from"class-variance-authority";import{createContext as b,memo as x,useCallback as S,useContext as C,useEffect as w,useMemo as T,useState as E}from"react";import{jsx as D,jsxs as O}from"react/jsx-runtime";import{EarthIcon as k,LogOutIcon as A,MenuIcon as j,ShoppingCartIcon as M}from"lucide-react";import{useIsMobile as N}from"@customafk/react-toolkit/hooks/useMobile";const P=b(null);function F(){let e=C(P);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function I({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=N(),[l,u]=E(!1),[d,f]=E(e),p=t??d,m=S(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,p]),h=S(()=>c?u(e=>!e):m(e=>!e),[c,m]);w(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=T(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,h]);return D(P.Provider,{value:_,children:D(i,{delayDuration:0,children:D(`section`,{"data-slot":`layout-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:`relative group/sidebar-wrapper flex h-dvh bg-sidebar`,...s,children:o})})})}const L=x(({side:e=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...o})=>{let{isMobile:f,state:p,openMobile:m,setOpenMobile:h,toggleSidebar:g}=F(),_=S(e=>{g(),e.preventDefault(),e.stopPropagation()},[g]);return r===`none`?D(`aside`,{"data-slot":`sidebar`,className:v(`flex w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,i),...o,children:a}):f?D(d,{open:m,onOpenChange:h,...o,children:O(l,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,style:{"--sidebar-width":`18rem`},side:e,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,children:[O(c,{className:`sr-only`,children:[D(u,{children:`Sidebar`}),D(s,{children:`Displays the mobile sidebar.`})]}),O(`div`,{className:`flex size-full flex-col`,children:[O(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[O(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:v(`size-10 rounded-full`,i),onClick:_,children:[D(j,{className:`size-6!`}),D(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),D(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:D(M,{size:20})}),O(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[D(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),D(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),D(`div`,{className:`flex flex-1 flex-col p-2`,children:a})]})]})}):O(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":p,"data-collapsible":p===`collapsed`?r:``,"data-variant":n,"data-side":e,"data-slot":`sidebar`,children:[D(`div`,{"data-slot":`sidebar-gap`,className:v(`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) sm:h-[calc(var(--header-height)+0.5rem)]`,`w-(--sidebar-width)`,`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`)}),D(`div`,{"data-slot":`sidebar-container`,className:v(`hidden md:flex shadow-nav`,`fixed left-0 inset-y-0 p-2`,`top-[calc(var(--header-height)+0.5rem)] z-10`,`w-(--sidebar-width)`,`transition-all duration-200 ease-linear`,`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`,i),...o,children:D(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`relative flex size-full flex-col`,children:a})})]})});L.displayName=`CMSLayoutSidebar`;const R=x(({className:e,children:t,...n})=>O(`main`,{"data-slot":`sidebar-inset`,className:v(`relative flex w-full flex-1 flex-col`,e),...n,children:[D(`section`,{className:`h-(--header-height) sm:h-[calc(var(--header-height)+0.5rem)]`}),D(`section`,{className:`flex-1 relative size-full overflow-auto`,children:t})]}));R.displayName=`CMSLayoutMain`;const z=x(({className:e,...t})=>D(_,{"data-slot":`sidebar-input`,"data-sidebar":`input`,className:v(`h-8 w-full bg-background shadow-none`,e),...t}));z.displayName=`SidebarInput`;const B=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:v(`flex flex-col gap-2 p-2`,e),...t}));B.displayName=`SidebarHeader`;const V=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:v(`flex flex-col gap-2`,e),...t}));V.displayName=`SidebarFooter`;const H=x(({className:e,...t})=>D(o,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:v(`mx-2 w-auto bg-sidebar-border`,e),...t}));H.displayName=`SidebarSeparator`;const U=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:v(`flex flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));U.displayName=`SidebarContent`;const W=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:v(`relative flex w-full flex-col`,e),...t}));W.displayName=`SidebarGroup`;const G=x(({className:t,asChild:n=!1,...r})=>D(n?e:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:v(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,t),...r}));G.displayName=`SidebarGroupLabel`;const K=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:v(`w-full text-sm`,e),...t}));K.displayName=`SidebarGroupContent`;const q=x(({className:e,...t})=>D(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:v(`flex w-full min-w-0 flex-col gap-1`,e),...t}));q.displayName=`SidebarMenu`;const J=x(({className:e,...t})=>D(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:v(`group/menu-item relative`,e),...t}));J.displayName=`SidebarMenuItem`;const Y=y([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}}),X=x(({asChild:t=!1,isActive:i=!1,variant:o=`default`,size:s=`default`,tooltip:c,className:l,...u})=>{let d=t?e:`button`,{isMobile:f,state:p}=F(),m=S(e=>{u.onClick?.(),e.preventDefault(),e.stopPropagation()},[u]),h=D(d,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":i,className:v(Y({variant:o,size:s}),l),onClick:m,...u});return c?(typeof c==`string`&&(c={children:c}),O(a,{children:[D(n,{asChild:!0,children:h}),D(r,{side:`right`,align:`center`,hidden:p!==`collapsed`||f,...c})]})):h});X.displayName=`SidebarMenuButton`;const Z=({i18nText:e,onChangeToEnLocale:n,onChangeToViLocale:r})=>{let{toggleSidebar:i}=F();return O(`header`,{"data-slot":`cms-layout-header`,className:v(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[O(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full transition-all hover:text-text-positive`,onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},children:[D(j,{className:`size-6!`}),D(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),O(`div`,{className:`flex flex-1 gap-x-2 sm:ml-2.5`,children:[D(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:D(M,{size:20})}),O(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[D(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),D(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]}),O(g,{children:[D(p,{asChild:!0,children:O(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,className:`gap-x-1 rounded-full transition-all hover:text-text-positive`,children:[D(k,{className:`size-6!`}),e]})}),D(h,{align:`end`,children:O(m,{children:[D(f,{onClick:e=>{n?.(),e.preventDefault(),e.stopPropagation()},children:`EN - English`}),D(f,{onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:`VI - Vietnamese`})]})})]})]})},Q=x(({id:e,label:t,icon:n,activeNavItemId:r,onClick:i})=>D(J,{children:O(X,{isActive:e===r,onClick:i,children:[n,t]})},e));Q.displayName=`SidebarContentGroupItem`;const $=x(({id:e,label:t,children:n})=>O(W,{children:[D(G,{children:t}),D(K,{children:D(q,{children:n})})]},e));$.displayName=`SidebarContentGroup`;const ee=({i18nText:e,activeNavItemId:t,sidebar:n,children:r,onChangeToEnLocale:i,onChangeToViLocale:a,onLogout:o})=>{let s=T(()=>n?.groupcontent||[],[n]);return O(I,{children:[D(Z,{i18nText:e,onChangeToEnLocale:i,onChangeToViLocale:a}),O(L,{variant:`inset`,collapsible:`icon`,children:[D(U,{children:s.map(e=>D($,{id:e.id,label:e.label,children:e.items.map(e=>D(Q,{activeNavItemId:t,id:e.id,label:e.label,icon:e.icon,onClick:e.onClick},e.id))},e.id))}),D(V,{children:O(q,{children:[D(J,{children:O(X,{className:`border border-border`,onClick:o,children:[D(A,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),D(J,{className:`mt-2 border-t border-t-border`,children:D(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})]}),D(R,{children:r})]})};export{ee as CMSLayout};
1
+ import{t as e}from"../../dist-CvmzZ_6C.mjs";import"../../button.variants-DRWf66hR.mjs";import{t}from"../../button-D54KOmb7.mjs";import"../../skeleton-Ba6koCVf.mjs";import{i as n,n as r,r as i,t as a}from"../../tooltip-B3dTcgcc.mjs";import{t as o}from"../../separator-Bf0gymN4.mjs";import{i as s,o as c,r as l,s as u,t as d}from"../../sheet-oadGRiie.mjs";import{a as f,h as p,i as m,r as h,t as g}from"../../dropdown-menu-B8GUTfTp.mjs";import{t as _}from"../../input-DBtIgQB6.mjs";import{cn as v}from"@customafk/react-toolkit/utils";import{cva as y}from"class-variance-authority";import{createContext as b,memo as x,useCallback as S,useContext as C,useEffect as w,useMemo as T,useState as E}from"react";import{jsx as D,jsxs as O}from"react/jsx-runtime";import{EarthIcon as k,LogOutIcon as A,MenuIcon as j,ShoppingCartIcon as M}from"lucide-react";import{useIsMobile as N}from"@customafk/react-toolkit/hooks/useMobile";const P=b(null);function F(){let e=C(P);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function I({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=N(),[l,u]=E(!1),[d,f]=E(e),p=t??d,m=S(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,p]),h=S(()=>c?u(e=>!e):m(e=>!e),[c,m]);w(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=T(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,h]);return D(P.Provider,{value:_,children:D(i,{delayDuration:0,children:D(`section`,{"data-slot":`layout-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:`relative group/sidebar-wrapper flex h-dvh bg-sidebar`,...s,children:o})})})}const L=x(({side:e=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...o})=>{let{isMobile:f,state:p,openMobile:m,setOpenMobile:h,toggleSidebar:g}=F(),_=S(e=>{g(),e.preventDefault(),e.stopPropagation()},[g]);return r===`none`?D(`aside`,{"data-slot":`sidebar`,className:v(`flex w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,i),...o,children:a}):f?D(d,{open:m,onOpenChange:h,...o,children:O(l,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,style:{"--sidebar-width":`18rem`},side:e,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,children:[O(c,{className:`sr-only`,children:[D(u,{children:`Sidebar`}),D(s,{children:`Displays the mobile sidebar.`})]}),O(`div`,{className:`flex size-full flex-col`,children:[O(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[O(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:v(`size-10 rounded-full`,i),onClick:_,children:[D(j,{className:`size-6!`}),D(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),D(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:D(M,{size:20})}),O(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[D(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),D(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),D(`div`,{className:`flex flex-1 flex-col p-2`,children:a})]})]})}):O(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":p,"data-collapsible":p===`collapsed`?r:``,"data-variant":n,"data-side":e,"data-slot":`sidebar`,children:[D(`div`,{"data-slot":`sidebar-gap`,className:v(`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) sm:h-[calc(var(--header-height)+0.5rem)]`,`w-(--sidebar-width)`,`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`)}),D(`div`,{"data-slot":`sidebar-container`,className:v(`hidden md:flex shadow-nav`,`fixed left-0 inset-y-0 p-2`,`top-[calc(var(--header-height)+0.5rem)] z-10`,`w-(--sidebar-width)`,`transition-all duration-200 ease-linear`,`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`,i),...o,children:D(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`relative flex size-full flex-col`,children:a})})]})});L.displayName=`CMSLayoutSidebar`;const R=x(({className:e,children:t,...n})=>O(`main`,{"data-slot":`sidebar-inset`,className:v(`relative flex w-full flex-1 flex-col`,e),...n,children:[D(`section`,{className:`h-(--header-height) sm:h-[calc(var(--header-height)+0.5rem)]`}),D(`section`,{className:`flex-1 relative size-full overflow-auto`,children:t})]}));R.displayName=`CMSLayoutMain`;const z=x(({className:e,...t})=>D(_,{"data-slot":`sidebar-input`,"data-sidebar":`input`,className:v(`h-8 w-full bg-background shadow-none`,e),...t}));z.displayName=`SidebarInput`;const B=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:v(`flex flex-col gap-2 p-2`,e),...t}));B.displayName=`SidebarHeader`;const V=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:v(`flex flex-col gap-2`,e),...t}));V.displayName=`SidebarFooter`;const H=x(({className:e,...t})=>D(o,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:v(`mx-2 w-auto bg-sidebar-border`,e),...t}));H.displayName=`SidebarSeparator`;const U=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:v(`flex flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));U.displayName=`SidebarContent`;const W=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:v(`relative flex w-full flex-col`,e),...t}));W.displayName=`SidebarGroup`;const G=x(({className:t,asChild:n=!1,...r})=>D(n?e:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:v(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,t),...r}));G.displayName=`SidebarGroupLabel`;const K=x(({className:e,...t})=>D(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:v(`w-full text-sm`,e),...t}));K.displayName=`SidebarGroupContent`;const q=x(({className:e,...t})=>D(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:v(`flex w-full min-w-0 flex-col gap-1`,e),...t}));q.displayName=`SidebarMenu`;const J=x(({className:e,...t})=>D(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:v(`group/menu-item relative`,e),...t}));J.displayName=`SidebarMenuItem`;const Y=y([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}}),X=x(({asChild:t=!1,isActive:i=!1,variant:o=`default`,size:s=`default`,tooltip:c,className:l,...u})=>{let d=t?e:`button`,{isMobile:f,state:p}=F(),m=S(e=>{u.onClick?.(),e.preventDefault(),e.stopPropagation()},[u]),h=D(d,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":i,className:v(Y({variant:o,size:s}),l),onClick:m,...u});return c?(typeof c==`string`&&(c={children:c}),O(a,{children:[D(n,{asChild:!0,children:h}),D(r,{side:`right`,align:`center`,hidden:p!==`collapsed`||f,...c})]})):h});X.displayName=`SidebarMenuButton`;const Z=({i18nText:e,onChangeToEnLocale:n,onChangeToViLocale:r})=>{let{toggleSidebar:i}=F();return O(`header`,{"data-slot":`cms-layout-header`,className:v(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[O(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full transition-all hover:text-text-positive`,onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},children:[D(j,{className:`size-6!`}),D(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),O(`div`,{className:`flex flex-1 gap-x-2 sm:ml-2.5`,children:[D(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:D(M,{size:20})}),O(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[D(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),D(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]}),O(g,{children:[D(p,{asChild:!0,children:O(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,className:`gap-x-1 rounded-full transition-all hover:text-text-positive`,children:[D(k,{className:`size-6!`}),e]})}),D(h,{align:`end`,children:O(m,{children:[D(f,{onClick:e=>{n?.(),e.preventDefault(),e.stopPropagation()},children:`EN - English`}),D(f,{onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:`VI - Vietnamese`})]})})]})]})},Q=x(({id:e,label:t,icon:n,activeNavItemId:r,onClick:i})=>D(J,{children:O(X,{isActive:e===r,onClick:i,children:[n,t]})},e));Q.displayName=`SidebarContentGroupItem`;const $=x(({id:e,label:t,children:n})=>O(W,{children:[D(G,{children:t}),D(K,{children:D(q,{children:n})})]},e));$.displayName=`SidebarContentGroup`;const ee=({i18nText:e,activeNavItemId:t,sidebar:n,children:r,onChangeToEnLocale:i,onChangeToViLocale:a,onLogout:o})=>{let s=T(()=>n?.groupcontent||[],[n]);return O(I,{children:[D(Z,{i18nText:e,onChangeToEnLocale:i,onChangeToViLocale:a}),O(L,{variant:`inset`,collapsible:`icon`,children:[D(U,{children:s.map(e=>D($,{id:e.id,label:e.label,children:e.items.map(e=>D(Q,{activeNavItemId:t,id:e.id,label:e.label,icon:e.icon,onClick:e.onClick},e.id))},e.id))}),D(V,{children:O(q,{children:[D(J,{children:O(X,{className:`border border-border`,onClick:o,children:[D(A,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),D(J,{className:`mt-2 border-t border-t-border`,children:D(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})})]}),D(R,{children:r})]})};export{ee as CMSLayout};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime25 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
2
2
  import * as react0 from "react";
3
3
  import * as class_variance_authority_types0 from "class-variance-authority/types";
4
4
  import { VariantProps } from "class-variance-authority";
@@ -8,9 +8,9 @@ declare const flexVariants: (props?: ({
8
8
  vertical?: boolean | null | undefined;
9
9
  width?: "full" | "auto" | "fit" | "screen" | "min" | "max" | "null" | null | undefined;
10
10
  wrap?: boolean | null | undefined;
11
- margin?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
12
- padding?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
13
- gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
11
+ margin?: "lg" | "sm" | "md" | "xl" | "none" | null | undefined;
12
+ padding?: "lg" | "sm" | "md" | "xl" | "none" | null | undefined;
13
+ gap?: "lg" | "sm" | "xs" | "md" | "xl" | "none" | null | undefined;
14
14
  justify?: "start" | "center" | "end" | "between" | "around" | "evenly" | "stretch" | null | undefined;
15
15
  align?: "start" | "center" | "end" | "stretch" | "baseline" | null | undefined;
16
16
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
@@ -28,7 +28,7 @@ declare const Flex: react0.MemoExoticComponent<({
28
28
  align,
29
29
  className,
30
30
  children
31
- }: React.PropsWithChildren<Props>) => react_jsx_runtime25.JSX.Element>;
31
+ }: React.PropsWithChildren<Props>) => react_jsx_runtime3.JSX.Element>;
32
32
  //#endregion
33
33
  export { Flex };
34
34
  //# sourceMappingURL=flex.d.cts.map
@@ -1,23 +1,23 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
- import * as react0 from "react";
3
- import * as react_jsx_runtime3 from "react/jsx-runtime";
4
- import * as class_variance_authority_types0 from "class-variance-authority/types";
2
+ import * as react25 from "react";
3
+ import * as react_jsx_runtime266 from "react/jsx-runtime";
4
+ import * as class_variance_authority_types7 from "class-variance-authority/types";
5
5
 
6
6
  //#region packages/components/layouts/flex.d.ts
7
7
  declare const flexVariants: (props?: ({
8
8
  vertical?: boolean | null | undefined;
9
9
  width?: "full" | "auto" | "fit" | "screen" | "min" | "max" | "null" | null | undefined;
10
10
  wrap?: boolean | null | undefined;
11
- margin?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
12
- padding?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
13
- gap?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
11
+ margin?: "lg" | "sm" | "md" | "xl" | "none" | null | undefined;
12
+ padding?: "lg" | "sm" | "md" | "xl" | "none" | null | undefined;
13
+ gap?: "lg" | "sm" | "xs" | "md" | "xl" | "none" | null | undefined;
14
14
  justify?: "start" | "center" | "end" | "between" | "around" | "evenly" | "stretch" | null | undefined;
15
15
  align?: "start" | "center" | "end" | "stretch" | "baseline" | null | undefined;
16
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
16
+ } & class_variance_authority_types7.ClassProp) | undefined) => string;
17
17
  type Props = {
18
18
  className?: string;
19
19
  } & VariantProps<typeof flexVariants>;
20
- declare const Flex: react0.MemoExoticComponent<({
20
+ declare const Flex: react25.MemoExoticComponent<({
21
21
  vertical,
22
22
  wrap,
23
23
  width,
@@ -28,7 +28,7 @@ declare const Flex: react0.MemoExoticComponent<({
28
28
  align,
29
29
  className,
30
30
  children
31
- }: React.PropsWithChildren<Props>) => react_jsx_runtime3.JSX.Element>;
31
+ }: React.PropsWithChildren<Props>) => react_jsx_runtime266.JSX.Element>;
32
32
  //#endregion
33
33
  export { Flex };
34
34
  //# sourceMappingURL=flex.d.mts.map
@@ -1,2 +1,2 @@
1
- const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../dist-BudM04oj.cjs`);require(`../../button.variants-rdXrPUao.cjs`);const n=require(`../../button-CYw2AqT0.cjs`);require(`../../skeleton-CHympz8k.cjs`);const r=require(`../../tooltip-DC6i1A25.cjs`);require(`../../separator-C3ip6sbh.cjs`);const i=require(`../../sheet-5MJRtrfG.cjs`);require(`../../input-BFWWaN-v.cjs`);let a=require(`@customafk/react-toolkit/utils`),o=require(`class-variance-authority`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`lucide-react`),u=require(`@customafk/react-toolkit/hooks/useMobile`);const d=`sidebar_state`,f=3600*24*7,p=`16rem`,m=`18rem`,h=`3rem`,g=`b`,_=(0,s.createContext)(null);function v(){let e=(0,s.useContext)(_);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function y({defaultOpen:e=!0,open:t,onOpenChange:n,className:i,style:o,children:l,...d}){let f=(0,u.useIsMobile)(),[p,m]=(0,s.useState)(!1),[h,g]=(0,s.useState)(e),v=t??h,y=(0,s.useCallback)(e=>{let t=typeof e==`function`?e(v):e;n?n(t):g(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,v]),b=(0,s.useCallback)(()=>f?m(e=>!e):y(e=>!e),[f,y]);(0,s.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]);let x=v?`expanded`:`collapsed`,S=(0,s.useMemo)(()=>({state:x,open:v,setOpen:y,isMobile:f,openMobile:p,setOpenMobile:m,toggleSidebar:b}),[x,v,y,f,p,b]);return(0,c.jsx)(_.Provider,{value:S,children:(0,c.jsx)(r.r,{delayDuration:0,children:(0,c.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...o},className:(0,a.cn)(`group/sidebar-wrapper flex h-dvh w-full`,i),...d,children:l})})})}function b({side:e=`left`,variant:t=`sidebar`,collapsible:r=`offcanvas`,className:o,children:s,...u}){let{isMobile:d,state:f,openMobile:p,setOpenMobile:m,toggleSidebar:h}=v();return r===`none`?(0,c.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,a.cn)(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,o),...u,children:s}):d?(0,c.jsx)(i.t,{open:p,onOpenChange:m,...u,children:(0,c.jsxs)(i.r,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[(0,c.jsxs)(i.o,{className:`sr-only`,children:[(0,c.jsx)(i.s,{children:`Sidebar`}),(0,c.jsx)(i.i,{children:`Displays the mobile sidebar.`})]}),(0,c.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,c.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,c.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,a.cn)(`size-10 rounded-full`,o),onClick:e=>{h(),e.preventDefault(),e.stopPropagation()},children:[(0,c.jsx)(l.MenuIcon,{className:`size-6!`}),(0,c.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,c.jsx)(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,c.jsx)(l.ShoppingCartIcon,{size:20})}),(0,c.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,c.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,c.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,c.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:s})]})]})}):(0,c.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":f,"data-collapsible":f===`collapsed`?r:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,c.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,a.cn)(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,c.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,a.cn)(`hidden md:flex`,`fixed inset-y-0 top-14 z-10 shadow-nav`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,o),...u,children:(0,c.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,a.cn)(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:s})})]})}function x({className:e,children:t,...n}){return(0,c.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,a.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,c.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,c.jsx)(`div`,{className:`inset-shadow-sm flex-1`,children:t})]})}function S({className:e,...t}){return(0,c.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,a.cn)(`flex flex-col gap-2 p-2`,e),...t})}function C({className:e,...t}){return(0,c.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,a.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function w({className:e,...t}){return(0,c.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,a.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function T({className:e,asChild:n=!1,...r}){return(0,c.jsx)(n?t.t:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,a.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...r})}function E({className:e,...t}){return(0,c.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,a.cn)(`w-full text-sm`,e),...t})}function D({className:e,...t}){return(0,c.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,a.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function O({className:e,...t}){return(0,c.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,a.cn)(`group/menu-item relative`,e),...t})}const k=(0,o.cva)([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function A({asChild:e=!1,isActive:n=!1,variant:i=`default`,size:o=`default`,tooltip:s,className:l,...u}){let d=e?t.t:`button`,{isMobile:f,state:p}=v(),m=(0,c.jsx)(d,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":o,"data-active":n,className:(0,a.cn)(k({variant:i,size:o}),l),...u});return s?(typeof s==`string`&&(s={children:s}),(0,c.jsxs)(r.t,{children:[(0,c.jsx)(r.i,{asChild:!0,children:m}),(0,c.jsx)(r.n,{side:`right`,align:`center`,hidden:p!==`collapsed`||f,...s})]})):m}const j=()=>{let{toggleSidebar:e}=v();return(0,c.jsxs)(`header`,{"data-slot":`payment-layout-header`,className:(0,a.cn)(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[(0,c.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full transition-all hover:text-text-positive`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:[(0,c.jsx)(l.MenuIcon,{className:`size-6!`}),(0,c.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,c.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,c.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,c.jsx)(l.ShoppingCartIcon,{size:20})}),(0,c.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,c.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),(0,c.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]})]})},M=({activeNavItemId:e,sidebar:t,children:n})=>{let r=(0,s.useMemo)(()=>t?.groupcontent||[],[t]);return(0,c.jsxs)(y,{children:[(0,c.jsx)(j,{}),(0,c.jsxs)(b,{variant:`inset`,collapsible:`icon`,children:[(0,c.jsx)(C,{children:r.map(t=>(0,c.jsxs)(w,{children:[(0,c.jsx)(T,{children:t.label}),(0,c.jsx)(E,{children:(0,c.jsx)(D,{children:t.items.map(t=>(0,c.jsx)(O,{children:(0,c.jsxs)(A,{isActive:t.id===e,onClick:e=>{t.onClick?.(),e.preventDefault(),e.stopPropagation()},children:[t.icon,t.label]})},t.id))})})]},t.id))}),(0,c.jsx)(S,{children:(0,c.jsx)(D,{children:(0,c.jsx)(O,{className:`mt-2 border-t border-t-border`,children:(0,c.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})})})]}),(0,c.jsx)(x,{children:(0,c.jsx)(`section`,{className:`relative size-full`,children:(0,c.jsx)(`div`,{className:`absolute inset-0`,children:n})})})]})};exports.PaymentLayout=M;
1
+ const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../dist-BudM04oj.cjs`);require(`../../button.variants-CS-Cmarr.cjs`);const n=require(`../../button-CpEejahy.cjs`);require(`../../skeleton-CHympz8k.cjs`);const r=require(`../../tooltip-DC6i1A25.cjs`);require(`../../separator-C3ip6sbh.cjs`);const i=require(`../../sheet-5MJRtrfG.cjs`);require(`../../input-BFWWaN-v.cjs`);let a=require(`@customafk/react-toolkit/utils`),o=require(`class-variance-authority`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`lucide-react`),u=require(`@customafk/react-toolkit/hooks/useMobile`);const d=`sidebar_state`,f=3600*24*7,p=`16rem`,m=`18rem`,h=`3rem`,g=`b`,_=(0,s.createContext)(null);function v(){let e=(0,s.useContext)(_);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function y({defaultOpen:e=!0,open:t,onOpenChange:n,className:i,style:o,children:l,...d}){let f=(0,u.useIsMobile)(),[p,m]=(0,s.useState)(!1),[h,g]=(0,s.useState)(e),v=t??h,y=(0,s.useCallback)(e=>{let t=typeof e==`function`?e(v):e;n?n(t):g(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,v]),b=(0,s.useCallback)(()=>f?m(e=>!e):y(e=>!e),[f,y]);(0,s.useEffect)(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),b())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b]);let x=v?`expanded`:`collapsed`,S=(0,s.useMemo)(()=>({state:x,open:v,setOpen:y,isMobile:f,openMobile:p,setOpenMobile:m,toggleSidebar:b}),[x,v,y,f,p,b]);return(0,c.jsx)(_.Provider,{value:S,children:(0,c.jsx)(r.r,{delayDuration:0,children:(0,c.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...o},className:(0,a.cn)(`group/sidebar-wrapper flex h-dvh w-full`,i),...d,children:l})})})}function b({side:e=`left`,variant:t=`sidebar`,collapsible:r=`offcanvas`,className:o,children:s,...u}){let{isMobile:d,state:f,openMobile:p,setOpenMobile:m,toggleSidebar:h}=v();return r===`none`?(0,c.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,a.cn)(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,o),...u,children:s}):d?(0,c.jsx)(i.t,{open:p,onOpenChange:m,...u,children:(0,c.jsxs)(i.r,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[(0,c.jsxs)(i.o,{className:`sr-only`,children:[(0,c.jsx)(i.s,{children:`Sidebar`}),(0,c.jsx)(i.i,{children:`Displays the mobile sidebar.`})]}),(0,c.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,c.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,c.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,a.cn)(`size-10 rounded-full`,o),onClick:e=>{h(),e.preventDefault(),e.stopPropagation()},children:[(0,c.jsx)(l.MenuIcon,{className:`size-6!`}),(0,c.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,c.jsx)(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,c.jsx)(l.ShoppingCartIcon,{size:20})}),(0,c.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,c.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,c.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,c.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:s})]})]})}):(0,c.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":f,"data-collapsible":f===`collapsed`?r:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,c.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,a.cn)(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,c.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,a.cn)(`hidden md:flex`,`fixed inset-y-0 top-14 z-10 shadow-nav`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,o),...u,children:(0,c.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,a.cn)(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:s})})]})}function x({className:e,children:t,...n}){return(0,c.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,a.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,c.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,c.jsx)(`div`,{className:`inset-shadow-sm flex-1`,children:t})]})}function S({className:e,...t}){return(0,c.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,a.cn)(`flex flex-col gap-2 p-2`,e),...t})}function C({className:e,...t}){return(0,c.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,a.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function w({className:e,...t}){return(0,c.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,a.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function T({className:e,asChild:n=!1,...r}){return(0,c.jsx)(n?t.t:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,a.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...r})}function E({className:e,...t}){return(0,c.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,a.cn)(`w-full text-sm`,e),...t})}function D({className:e,...t}){return(0,c.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,a.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function O({className:e,...t}){return(0,c.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,a.cn)(`group/menu-item relative`,e),...t})}const k=(0,o.cva)([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function A({asChild:e=!1,isActive:n=!1,variant:i=`default`,size:o=`default`,tooltip:s,className:l,...u}){let d=e?t.t:`button`,{isMobile:f,state:p}=v(),m=(0,c.jsx)(d,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":o,"data-active":n,className:(0,a.cn)(k({variant:i,size:o}),l),...u});return s?(typeof s==`string`&&(s={children:s}),(0,c.jsxs)(r.t,{children:[(0,c.jsx)(r.i,{asChild:!0,children:m}),(0,c.jsx)(r.n,{side:`right`,align:`center`,hidden:p!==`collapsed`||f,...s})]})):m}const j=()=>{let{toggleSidebar:e}=v();return(0,c.jsxs)(`header`,{"data-slot":`payment-layout-header`,className:(0,a.cn)(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[(0,c.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full transition-all hover:text-text-positive`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:[(0,c.jsx)(l.MenuIcon,{className:`size-6!`}),(0,c.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),(0,c.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,c.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,c.jsx)(l.ShoppingCartIcon,{size:20})}),(0,c.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,c.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),(0,c.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]})]})},M=({activeNavItemId:e,sidebar:t,children:n})=>{let r=(0,s.useMemo)(()=>t?.groupcontent||[],[t]);return(0,c.jsxs)(y,{children:[(0,c.jsx)(j,{}),(0,c.jsxs)(b,{variant:`inset`,collapsible:`icon`,children:[(0,c.jsx)(C,{children:r.map(t=>(0,c.jsxs)(w,{children:[(0,c.jsx)(T,{children:t.label}),(0,c.jsx)(E,{children:(0,c.jsx)(D,{children:t.items.map(t=>(0,c.jsx)(O,{children:(0,c.jsxs)(A,{isActive:t.id===e,onClick:e=>{t.onClick?.(),e.preventDefault(),e.stopPropagation()},children:[t.icon,t.label]})},t.id))})})]},t.id))}),(0,c.jsx)(S,{children:(0,c.jsx)(D,{children:(0,c.jsx)(O,{className:`mt-2 border-t border-t-border`,children:(0,c.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})})})]}),(0,c.jsx)(x,{children:(0,c.jsx)(`section`,{className:`relative size-full`,children:(0,c.jsx)(`div`,{className:`absolute inset-0`,children:n})})})]})};exports.PaymentLayout=M;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"../../dist-CvmzZ_6C.mjs";import"../../button.variants-DuuH1O0_.mjs";import{t}from"../../button-B2FJrOBP.mjs";import"../../skeleton-Ba6koCVf.mjs";import{i as n,n as r,r as i,t as a}from"../../tooltip-B3dTcgcc.mjs";import"../../separator-Bf0gymN4.mjs";import{i as o,o as s,r as c,s as l,t as u}from"../../sheet-oadGRiie.mjs";import"../../input-DBtIgQB6.mjs";import{cn as d}from"@customafk/react-toolkit/utils";import{cva as f}from"class-variance-authority";import{createContext as p,useCallback as m,useContext as h,useEffect as g,useMemo as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{MenuIcon as x,ShoppingCartIcon as S}from"lucide-react";import{useIsMobile as C}from"@customafk/react-toolkit/hooks/useMobile";const w=p(null);function T(){let e=h(w);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function E({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=C(),[l,u]=v(!1),[f,p]=v(e),h=t??f,b=m(e=>{let t=typeof e==`function`?e(h):e;n?n(t):p(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,h]),x=m(()=>c?u(e=>!e):b(e=>!e),[c,b]);g(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x]);let S=h?`expanded`:`collapsed`,T=_(()=>({state:S,open:h,setOpen:b,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:x}),[S,h,b,c,l,x]);return y(w.Provider,{value:T,children:y(i,{delayDuration:0,children:y(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:d(`group/sidebar-wrapper flex h-dvh w-full`,r),...s,children:o})})})}function D({side:e=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...f}){let{isMobile:p,state:m,openMobile:h,setOpenMobile:g,toggleSidebar:_}=T();return r===`none`?y(`aside`,{"data-slot":`sidebar`,className:d(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,i),...f,children:a}):p?y(u,{open:h,onOpenChange:g,...f,children:b(c,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[b(s,{className:`sr-only`,children:[y(l,{children:`Sidebar`}),y(o,{children:`Displays the mobile sidebar.`})]}),b(`div`,{className:`flex size-full flex-col`,children:[b(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[b(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:d(`size-10 rounded-full`,i),onClick:e=>{_(),e.preventDefault(),e.stopPropagation()},children:[y(x,{className:`size-6!`}),y(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),y(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:y(S,{size:20})}),b(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[y(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),y(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),y(`div`,{className:`flex flex-1 flex-col p-2`,children:a})]})]})}):b(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":m,"data-collapsible":m===`collapsed`?r:``,"data-variant":n,"data-side":e,"data-slot":`sidebar`,children:[y(`div`,{"data-slot":`sidebar-gap`,className:d(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,n===`floating`||n===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),y(`div`,{"data-slot":`sidebar-container`,className:d(`hidden md:flex`,`fixed inset-y-0 top-14 z-10 shadow-nav`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,n===`floating`||n===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,i),...f,children:y(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:d(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:a})})]})}function O({className:e,children:t,...n}){return b(`main`,{"data-slot":`sidebar-inset`,className:d(`relative flex w-full flex-1 flex-col`,e),...n,children:[y(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),y(`div`,{className:`inset-shadow-sm flex-1`,children:t})]})}function k({className:e,...t}){return y(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:d(`flex flex-col gap-2 p-2`,e),...t})}function A({className:e,...t}){return y(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:d(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function j({className:e,...t}){return y(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:d(`relative flex w-full min-w-0 flex-col`,e),...t})}function M({className:t,asChild:n=!1,...r}){return y(n?e:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:d(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,t),...r})}function N({className:e,...t}){return y(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:d(`w-full text-sm`,e),...t})}function P({className:e,...t}){return y(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:d(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function F({className:e,...t}){return y(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:d(`group/menu-item relative`,e),...t})}const I=f([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function L({asChild:t=!1,isActive:i=!1,variant:o=`default`,size:s=`default`,tooltip:c,className:l,...u}){let f=t?e:`button`,{isMobile:p,state:m}=T(),h=y(f,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":i,className:d(I({variant:o,size:s}),l),...u});return c?(typeof c==`string`&&(c={children:c}),b(a,{children:[y(n,{asChild:!0,children:h}),y(r,{side:`right`,align:`center`,hidden:m!==`collapsed`||p,...c})]})):h}const R=()=>{let{toggleSidebar:e}=T();return b(`header`,{"data-slot":`payment-layout-header`,className:d(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[b(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full transition-all hover:text-text-positive`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:[y(x,{className:`size-6!`}),y(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),b(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[y(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:y(S,{size:20})}),b(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[y(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),y(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]})]})},z=({activeNavItemId:e,sidebar:t,children:n})=>{let r=_(()=>t?.groupcontent||[],[t]);return b(E,{children:[y(R,{}),b(D,{variant:`inset`,collapsible:`icon`,children:[y(A,{children:r.map(t=>b(j,{children:[y(M,{children:t.label}),y(N,{children:y(P,{children:t.items.map(t=>y(F,{children:b(L,{isActive:t.id===e,onClick:e=>{t.onClick?.(),e.preventDefault(),e.stopPropagation()},children:[t.icon,t.label]})},t.id))})})]},t.id))}),y(k,{children:y(P,{children:y(F,{className:`mt-2 border-t border-t-border`,children:y(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})})})]}),y(O,{children:y(`section`,{className:`relative size-full`,children:y(`div`,{className:`absolute inset-0`,children:n})})})]})};export{z as PaymentLayout};
1
+ import{t as e}from"../../dist-CvmzZ_6C.mjs";import"../../button.variants-DRWf66hR.mjs";import{t}from"../../button-D54KOmb7.mjs";import"../../skeleton-Ba6koCVf.mjs";import{i as n,n as r,r as i,t as a}from"../../tooltip-B3dTcgcc.mjs";import"../../separator-Bf0gymN4.mjs";import{i as o,o as s,r as c,s as l,t as u}from"../../sheet-oadGRiie.mjs";import"../../input-DBtIgQB6.mjs";import{cn as d}from"@customafk/react-toolkit/utils";import{cva as f}from"class-variance-authority";import{createContext as p,useCallback as m,useContext as h,useEffect as g,useMemo as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{MenuIcon as x,ShoppingCartIcon as S}from"lucide-react";import{useIsMobile as C}from"@customafk/react-toolkit/hooks/useMobile";const w=p(null);function T(){let e=h(w);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function E({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=C(),[l,u]=v(!1),[f,p]=v(e),h=t??f,b=m(e=>{let t=typeof e==`function`?e(h):e;n?n(t):p(t),document.cookie=`sidebar_state=${t}; path=/; max-age=604800`},[n,h]),x=m(()=>c?u(e=>!e):b(e=>!e),[c,b]);g(()=>{let e=e=>{e.key===`b`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),x())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x]);let S=h?`expanded`:`collapsed`,T=_(()=>({state:S,open:h,setOpen:b,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:x}),[S,h,b,c,l,x]);return y(w.Provider,{value:T,children:y(i,{delayDuration:0,children:y(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:d(`group/sidebar-wrapper flex h-dvh w-full`,r),...s,children:o})})})}function D({side:e=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...f}){let{isMobile:p,state:m,openMobile:h,setOpenMobile:g,toggleSidebar:_}=T();return r===`none`?y(`aside`,{"data-slot":`sidebar`,className:d(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,i),...f,children:a}):p?y(u,{open:h,onOpenChange:g,...f,children:b(c,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground sm:max-w-3xs [&>button]:hidden`,style:{"--sidebar-width":`18rem`},side:e,children:[b(s,{className:`sr-only`,children:[y(l,{children:`Sidebar`}),y(o,{children:`Displays the mobile sidebar.`})]}),b(`div`,{className:`flex size-full flex-col`,children:[b(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[b(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:d(`size-10 rounded-full`,i),onClick:e=>{_(),e.preventDefault(),e.stopPropagation()},children:[y(x,{className:`size-6!`}),y(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),y(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:y(S,{size:20})}),b(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[y(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),y(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),y(`div`,{className:`flex flex-1 flex-col p-2`,children:a})]})]})}):b(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":m,"data-collapsible":m===`collapsed`?r:``,"data-variant":n,"data-side":e,"data-slot":`sidebar`,children:[y(`div`,{"data-slot":`sidebar-gap`,className:d(`relative`,`bg-transparent`,`transition-[width] duration-200 ease-linear`,`h-(--header-height) w-(--sidebar-width)`,`sm:h-[calc(var(--header-height)+0.5rem)]`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,n===`floating`||n===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),y(`div`,{"data-slot":`sidebar-container`,className:d(`hidden md:flex`,`fixed inset-y-0 top-14 z-10 shadow-nav`,`h-[calc(100dvh-3.5rem)] w-(--sidebar-width)`,`transition-[left,right,width] duration-200 ease-linear`,e===`left`&&`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`,e===`right`&&`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,n===`floating`||n===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,i),...f,children:y(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:d(`flex size-full flex-col`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:shadow-sm`),children:a})})]})}function O({className:e,children:t,...n}){return b(`main`,{"data-slot":`sidebar-inset`,className:d(`relative flex w-full flex-1 flex-col`,e),...n,children:[y(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),y(`div`,{className:`inset-shadow-sm flex-1`,children:t})]})}function k({className:e,...t}){return y(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:d(`flex flex-col gap-2 p-2`,e),...t})}function A({className:e,...t}){return y(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:d(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function j({className:e,...t}){return y(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:d(`relative flex w-full min-w-0 flex-col`,e),...t})}function M({className:t,asChild:n=!1,...r}){return y(n?e:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:d(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-hidden ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,t),...r})}function N({className:e,...t}){return y(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:d(`w-full text-sm`,e),...t})}function P({className:e,...t}){return y(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:d(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function F({className:e,...t}){return y(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:d(`group/menu-item relative`,e),...t})}const I=f([`peer/menu-button`,`cursor-pointer`,`flex w-full items-center gap-2`,`overflow-hidden rounded-md p-2 outline-hidden`,`truncate text-left font-normal`,`transition-[color,width,height,padding]`,`hover:bg-sidebar-accent`,`hover:text-sidebar-accent-foreground`,`active:bg-sidebar-accent`,`active:text-sidebar-accent-foreground`,`disabled:pointer-events-none`,`disabled:opacity-50`,`group-has-data-[sidebar=menu-action]/menu-item:pr-8`,`aria-disabled:pointer-events-none`,`aria-disabled:opacity-50`,`data-[active=true]:bg-sidebar-primary-muted`,`data-[active=true]:text-sidebar-primary`,`data-[state=open]:hover:bg-sidebar-accent`,`data-[state=open]:hover:text-sidebar-accent-foreground`,`group-data-[collapsible=icon]:size-12!`,`group-data-[collapsible=icon]:p-3!`,`group-data-[collapsible=icon]:gap-3!`,`[&>svg]:size-6`,`[&>svg]:shrink-0`,`[&>span:last-child]:truncate`],{variants:{variant:{default:`hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground/80`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-10 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function L({asChild:t=!1,isActive:i=!1,variant:o=`default`,size:s=`default`,tooltip:c,className:l,...u}){let f=t?e:`button`,{isMobile:p,state:m}=T(),h=y(f,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":i,className:d(I({variant:o,size:s}),l),...u});return c?(typeof c==`string`&&(c={children:c}),b(a,{children:[y(n,{asChild:!0,children:h}),y(r,{side:`right`,align:`center`,hidden:m!==`collapsed`||p,...c})]})):h}const R=()=>{let{toggleSidebar:e}=T();return b(`header`,{"data-slot":`payment-layout-header`,className:d(`bg-card`,`h-(--header-height)`,`sm:h-[calc(var(--header-height)+0.5rem)] sm:px-4 sm:pr-6`,`absolute inset-x-0 top-0 z-20 gap-2 px-2 pr-4.5`,`flex items-center shadow-nav`,`transition-[width,height] ease-linear`),children:[b(t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:`size-10 rounded-full transition-all hover:text-text-positive`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e()},children:[y(x,{className:`size-6!`}),y(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]}),b(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[y(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:y(S,{size:20})}),b(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[y(`span`,{className:`truncate font-medium`,children:`Lunas Enterprise`}),y(`span`,{className:`truncate text-xs`,children:`Established 2025`})]})]})]})},z=({activeNavItemId:e,sidebar:t,children:n})=>{let r=_(()=>t?.groupcontent||[],[t]);return b(E,{children:[y(R,{}),b(D,{variant:`inset`,collapsible:`icon`,children:[y(A,{children:r.map(t=>b(j,{children:[y(M,{children:t.label}),y(N,{children:y(P,{children:t.items.map(t=>y(F,{children:b(L,{isActive:t.id===e,onClick:e=>{t.onClick?.(),e.preventDefault(),e.stopPropagation()},children:[t.icon,t.label]})},t.id))})})]},t.id))}),y(k,{children:y(P,{children:y(F,{className:`mt-2 border-t border-t-border`,children:y(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})})})]}),y(O,{children:y(`section`,{className:`relative size-full`,children:y(`div`,{className:`absolute inset-0`,children:n})})})]})};export{z as PaymentLayout};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../button.variants-rdXrPUao.cjs`);const t=require(`../button-CYw2AqT0.cjs`);let n=require(`@customafk/react-toolkit/utils`),r=require(`react/jsx-runtime`),i=require(`lucide-react`);const a=({title:e=`Tính năng đang phát triển`,subtitle:a=`Chúng tôi đang phát triển tính năng này. Vui lòng quay lại sau.`,buttonText:o=`Quay lại`,onButtonClick:s=()=>window.history.back(),className:c,iconClassName:l})=>(0,r.jsxs)(`div`,{className:(0,n.cn)(`flex flex-col items-center justify-center min-h-[50vh] gap-4 sm:gap-6 py-8 sm:py-10 px-4 text-center w-full`,c),children:[(0,r.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,r.jsx)(i.Construction,{className:(0,n.cn)(`size-16 sm:size-24 text-yellow-500`,l)}),(0,r.jsx)(`div`,{className:`text-3xl sm:text-5xl font-bold text-yellow-500`})]}),(0,r.jsx)(`h1`,{className:`text-xl sm:text-2xl font-semibold mt-2`,children:e}),(0,r.jsx)(`p`,{className:`text-muted-foreground max-w-md text-sm sm:text-base`,children:a}),(0,r.jsx)(t.t,{onClick:s,variant:`default`,className:`mt-2`,size:`sm`,children:o})]});var o=a;exports.FeatureDeveloping=a,exports.default=o;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../button.variants-CS-Cmarr.cjs`);const t=require(`../button-CpEejahy.cjs`);let n=require(`@customafk/react-toolkit/utils`),r=require(`react/jsx-runtime`),i=require(`lucide-react`);const a=({title:e=`Tính năng đang phát triển`,subtitle:a=`Chúng tôi đang phát triển tính năng này. Vui lòng quay lại sau.`,buttonText:o=`Quay lại`,onButtonClick:s=()=>window.history.back(),className:c,iconClassName:l})=>(0,r.jsxs)(`div`,{className:(0,n.cn)(`flex flex-col items-center justify-center min-h-[50vh] gap-4 sm:gap-6 py-8 sm:py-10 px-4 text-center w-full`,c),children:[(0,r.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,r.jsx)(i.Construction,{className:(0,n.cn)(`size-16 sm:size-24 text-yellow-500`,l)}),(0,r.jsx)(`div`,{className:`text-3xl sm:text-5xl font-bold text-yellow-500`})]}),(0,r.jsx)(`h1`,{className:`text-xl sm:text-2xl font-semibold mt-2`,children:e}),(0,r.jsx)(`p`,{className:`text-muted-foreground max-w-md text-sm sm:text-base`,children:a}),(0,r.jsx)(t.t,{onClick:s,variant:`default`,className:`mt-2`,size:`sm`,children:o})]});var o=a;exports.FeatureDeveloping=a,exports.default=o;
2
2
  //# sourceMappingURL=FeatureDeveloping.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime28 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
2
2
 
3
3
  //#region packages/components/pages/FeatureDeveloping.d.ts
4
4
  interface FeatureDevelopingProps {
@@ -19,7 +19,7 @@ declare const FeatureDeveloping: ({
19
19
  onButtonClick,
20
20
  className,
21
21
  iconClassName
22
- }: FeatureDevelopingProps) => react_jsx_runtime28.JSX.Element;
22
+ }: FeatureDevelopingProps) => react_jsx_runtime5.JSX.Element;
23
23
  //#endregion
24
24
  export { FeatureDeveloping, FeatureDeveloping as default, FeatureDevelopingProps };
25
25
  //# sourceMappingURL=FeatureDeveloping.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime30 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime80 from "react/jsx-runtime";
2
2
 
3
3
  //#region packages/components/pages/FeatureDeveloping.d.ts
4
4
  interface FeatureDevelopingProps {
@@ -19,7 +19,7 @@ declare const FeatureDeveloping: ({
19
19
  onButtonClick,
20
20
  className,
21
21
  iconClassName
22
- }: FeatureDevelopingProps) => react_jsx_runtime30.JSX.Element;
22
+ }: FeatureDevelopingProps) => react_jsx_runtime80.JSX.Element;
23
23
  //#endregion
24
24
  export { FeatureDeveloping, FeatureDeveloping as default, FeatureDevelopingProps };
25
25
  //# sourceMappingURL=FeatureDeveloping.d.mts.map
@@ -1,2 +1,2 @@
1
- import"../button.variants-DuuH1O0_.mjs";import{t as e}from"../button-B2FJrOBP.mjs";import{cn as t}from"@customafk/react-toolkit/utils";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{Construction as i}from"lucide-react";const a=({title:a=`Tính năng đang phát triển`,subtitle:o=`Chúng tôi đang phát triển tính năng này. Vui lòng quay lại sau.`,buttonText:s=`Quay lại`,onButtonClick:c=()=>window.history.back(),className:l,iconClassName:u})=>r(`div`,{className:t(`flex flex-col items-center justify-center min-h-[50vh] gap-4 sm:gap-6 py-8 sm:py-10 px-4 text-center w-full`,l),children:[r(`div`,{className:`flex flex-col items-center gap-2`,children:[n(i,{className:t(`size-16 sm:size-24 text-yellow-500`,u)}),n(`div`,{className:`text-3xl sm:text-5xl font-bold text-yellow-500`})]}),n(`h1`,{className:`text-xl sm:text-2xl font-semibold mt-2`,children:a}),n(`p`,{className:`text-muted-foreground max-w-md text-sm sm:text-base`,children:o}),n(e,{onClick:c,variant:`default`,className:`mt-2`,size:`sm`,children:s})]});var o=a;export{a as FeatureDeveloping,o as default};
1
+ import"../button.variants-DRWf66hR.mjs";import{t as e}from"../button-D54KOmb7.mjs";import{cn as t}from"@customafk/react-toolkit/utils";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{Construction as i}from"lucide-react";const a=({title:a=`Tính năng đang phát triển`,subtitle:o=`Chúng tôi đang phát triển tính năng này. Vui lòng quay lại sau.`,buttonText:s=`Quay lại`,onButtonClick:c=()=>window.history.back(),className:l,iconClassName:u})=>r(`div`,{className:t(`flex flex-col items-center justify-center min-h-[50vh] gap-4 sm:gap-6 py-8 sm:py-10 px-4 text-center w-full`,l),children:[r(`div`,{className:`flex flex-col items-center gap-2`,children:[n(i,{className:t(`size-16 sm:size-24 text-yellow-500`,u)}),n(`div`,{className:`text-3xl sm:text-5xl font-bold text-yellow-500`})]}),n(`h1`,{className:`text-xl sm:text-2xl font-semibold mt-2`,children:a}),n(`p`,{className:`text-muted-foreground max-w-md text-sm sm:text-base`,children:o}),n(e,{onClick:c,variant:`default`,className:`mt-2`,size:`sm`,children:s})]});var o=a;export{a as FeatureDeveloping,o as default};
2
2
  //# sourceMappingURL=FeatureDeveloping.mjs.map
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../button.variants-rdXrPUao.cjs`);const t=require(`../button-CYw2AqT0.cjs`);let n=require(`@customafk/react-toolkit/utils`),r=require(`react/jsx-runtime`),i=require(`lucide-react`);const a=({title:e=`Tính năng đang bảo trì`,subtitle:a=`Chúng tôi đang khắc phục vấn đề với tính năng này. Vui lòng quay lại sau.`,buttonText:o=`Quay lại`,onButtonClick:s=()=>window.history.back(),className:c,iconClassName:l})=>(0,r.jsxs)(`div`,{className:(0,n.cn)(`flex flex-col items-center justify-center min-h-[50vh] gap-4 sm:gap-6 py-8 sm:py-10 px-4 text-center w-full`,c),children:[(0,r.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,r.jsx)(i.Wrench,{className:(0,n.cn)(`size-16 sm:size-24 text-orange-500`,l)}),(0,r.jsx)(`div`,{className:`text-3xl sm:text-5xl font-bold text-orange-500`})]}),(0,r.jsx)(`h1`,{className:`text-xl sm:text-2xl font-semibold mt-2`,children:e}),(0,r.jsx)(`p`,{className:`text-muted-foreground max-w-md text-sm sm:text-base`,children:a}),(0,r.jsx)(t.t,{onClick:s,variant:`default`,className:`mt-2`,size:`sm`,children:o})]});var o=a;exports.FeatureFixing=a,exports.default=o;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../chunk-Bmb41Sf3.cjs`);require(`../button.variants-CS-Cmarr.cjs`);const t=require(`../button-CpEejahy.cjs`);let n=require(`@customafk/react-toolkit/utils`),r=require(`react/jsx-runtime`),i=require(`lucide-react`);const a=({title:e=`Tính năng đang bảo trì`,subtitle:a=`Chúng tôi đang khắc phục vấn đề với tính năng này. Vui lòng quay lại sau.`,buttonText:o=`Quay lại`,onButtonClick:s=()=>window.history.back(),className:c,iconClassName:l})=>(0,r.jsxs)(`div`,{className:(0,n.cn)(`flex flex-col items-center justify-center min-h-[50vh] gap-4 sm:gap-6 py-8 sm:py-10 px-4 text-center w-full`,c),children:[(0,r.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,r.jsx)(i.Wrench,{className:(0,n.cn)(`size-16 sm:size-24 text-orange-500`,l)}),(0,r.jsx)(`div`,{className:`text-3xl sm:text-5xl font-bold text-orange-500`})]}),(0,r.jsx)(`h1`,{className:`text-xl sm:text-2xl font-semibold mt-2`,children:e}),(0,r.jsx)(`p`,{className:`text-muted-foreground max-w-md text-sm sm:text-base`,children:a}),(0,r.jsx)(t.t,{onClick:s,variant:`default`,className:`mt-2`,size:`sm`,children:o})]});var o=a;exports.FeatureFixing=a,exports.default=o;
2
2
  //# sourceMappingURL=FeatureFixing.cjs.map