@customafk/lunas-ui 0.1.40 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{button-CPSR8ewr.d.mts → button-B47JL9_X.d.cts} +6 -6
- package/dist/{button-DM5NJ-7F.d.cts → button-BVyGOvsM.d.mts} +6 -6
- package/dist/cards/simple-card.d.mts +2 -2
- package/dist/{close-BuQ2DHur.mjs → close-CCf5pMYu.mjs} +1 -1
- package/dist/{close-BuQ2DHur.mjs.map → close-CCf5pMYu.mjs.map} +1 -1
- package/dist/{close-DvsVM8lM.cjs → close-D_Ge7gnP.cjs} +1 -1
- package/dist/{close-DvsVM8lM.cjs.map → close-D_Ge7gnP.cjs.map} +1 -1
- package/dist/{command-BKiAU1oU.mjs → command-CLjGZB-7.mjs} +2 -2
- package/dist/{command-BKiAU1oU.mjs.map → command-CLjGZB-7.mjs.map} +1 -1
- package/dist/{command-BqSzRw6j.cjs → command-D5zGkxau.cjs} +2 -2
- package/dist/{command-BqSzRw6j.cjs.map → command-D5zGkxau.cjs.map} +1 -1
- package/dist/data-display/country.d.mts +1 -1
- package/dist/data-display/role-badge.d.mts +1 -1
- package/dist/data-display/statistic.d.mts +2 -2
- package/dist/{dialog-EzJiDxrJ.d.mts → dialog-B9Dvd4Fh.d.mts} +12 -12
- package/dist/{dialog-bd77jxcu.mjs → dialog-BbNb9Lr8.mjs} +2 -2
- package/dist/{dialog-bd77jxcu.mjs.map → dialog-BbNb9Lr8.mjs.map} +1 -1
- package/dist/{dialog-DVwvHuQB.cjs → dialog-DeIMaQO0.cjs} +2 -2
- package/dist/{dialog-DVwvHuQB.cjs.map → dialog-DeIMaQO0.cjs.map} +1 -1
- package/dist/{dialog-B2-c4OTw.d.cts → dialog-WNb5xgv8.d.cts} +12 -12
- package/dist/dialogs/detail-dialog/components/sidebar.cjs +2 -0
- package/dist/dialogs/detail-dialog/components/sidebar.cjs.map +1 -0
- package/dist/dialogs/detail-dialog/{component/sidebar.d.mts → components/sidebar.d.cts} +30 -35
- package/dist/dialogs/detail-dialog/{component/sidebar.d.cts → components/sidebar.d.mts} +31 -36
- package/dist/dialogs/detail-dialog/components/sidebar.mjs +2 -0
- package/dist/dialogs/detail-dialog/components/sidebar.mjs.map +1 -0
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
- package/dist/dialogs/detail-dialog/index.d.cts +9 -8
- package/dist/dialogs/detail-dialog/index.d.mts +9 -8
- package/dist/dialogs/detail-dialog/index.mjs +1 -1
- package/dist/dialogs/detail-dialog/index.mjs.map +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.mjs +1 -1
- package/dist/{drawer-ClbO_Gt0.mjs → drawer-272Fecsq.mjs} +1 -1
- package/dist/{drawer-ClbO_Gt0.mjs.map → drawer-272Fecsq.mjs.map} +1 -1
- package/dist/{drawer-DluJOnDX.cjs → drawer-y-Yrqskp.cjs} +1 -1
- package/dist/{drawer-DluJOnDX.cjs.map → drawer-y-Yrqskp.cjs.map} +1 -1
- package/dist/{dropdown-menu-DQs_Lvq7.cjs → dropdown-menu-BuyuU6uF.cjs} +1 -1
- package/dist/{dropdown-menu-DQs_Lvq7.cjs.map → dropdown-menu-BuyuU6uF.cjs.map} +1 -1
- package/dist/{dropdown-menu-DPhbyDEo.mjs → dropdown-menu-DsWYP0bL.mjs} +1 -1
- package/dist/{dropdown-menu-DPhbyDEo.mjs.map → dropdown-menu-DsWYP0bL.mjs.map} +1 -1
- package/dist/features/search-modal/index.cjs +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.mts +2 -2
- package/dist/features/search-modal/index.mjs +1 -1
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.d.cts +7 -7
- package/dist/features/tables/index.d.mts +7 -7
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tables/index.mjs.map +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/{input-LDpzfNmy.d.mts → input-BSE6jQaF.d.mts} +3 -3
- package/dist/{input-C1K2wbv1.mjs → input-DD17n9Bv.mjs} +1 -1
- package/dist/{input-C1K2wbv1.mjs.map → input-DD17n9Bv.mjs.map} +1 -1
- package/dist/{input-CMXa_99w.d.cts → input-Dh7Ny5P9.d.cts} +5 -5
- package/dist/{input-C1BXP8dd.cjs → input-qnlHzDDm.cjs} +1 -1
- package/dist/{input-C1BXP8dd.cjs.map → input-qnlHzDDm.cjs.map} +1 -1
- package/dist/{label-CkTb259R.cjs → label-CaBktIhh.cjs} +1 -1
- package/dist/{label-CkTb259R.cjs.map → label-CaBktIhh.cjs.map} +1 -1
- package/dist/{label-DwmJnk4H.mjs → label-DVfxfyG5.mjs} +1 -1
- package/dist/{label-DwmJnk4H.mjs.map → label-DVfxfyG5.mjs.map} +1 -1
- package/dist/layouts/app-layout/index.cjs +1 -1
- package/dist/layouts/app-layout/index.d.cts +28 -28
- package/dist/layouts/app-layout/index.d.mts +28 -28
- package/dist/layouts/app-layout/index.mjs +1 -1
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.mjs +1 -1
- package/dist/layouts/flex.d.cts +2 -2
- package/dist/layouts/flex.d.mts +2 -2
- package/dist/layouts/service-layout/index.cjs +1 -1
- package/dist/layouts/service-layout/index.d.cts +13 -13
- package/dist/layouts/service-layout/index.d.mts +15 -15
- package/dist/layouts/service-layout/index.mjs +1 -1
- package/dist/layouts/service-layout/index.mjs.map +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/{resizable-C2-dXaDM.cjs → resizable-BS63Xwia.cjs} +1 -1
- package/dist/{resizable-C2-dXaDM.cjs.map → resizable-BS63Xwia.cjs.map} +1 -1
- package/dist/{resizable-LConLbS6.mjs → resizable-Dp4eTFXj.mjs} +1 -1
- package/dist/{resizable-LConLbS6.mjs.map → resizable-Dp4eTFXj.mjs.map} +1 -1
- package/dist/{scroll-area-6xusEFm6.mjs → scroll-area-CiMS2UY7.mjs} +1 -1
- package/dist/{scroll-area-6xusEFm6.mjs.map → scroll-area-CiMS2UY7.mjs.map} +1 -1
- package/dist/{scroll-area-D61j6n8I.cjs → scroll-area-qE6GqGkn.cjs} +1 -1
- package/dist/{scroll-area-D61j6n8I.cjs.map → scroll-area-qE6GqGkn.cjs.map} +1 -1
- package/dist/{separator-Crr30ZHa.cjs → separator-C3ip6sbh.cjs} +1 -1
- package/dist/{separator-Crr30ZHa.cjs.map → separator-C3ip6sbh.cjs.map} +1 -1
- package/dist/{separator-yTKDuMWb.mjs → separator-CZM2q-Ac.mjs} +1 -1
- package/dist/{separator-yTKDuMWb.mjs.map → separator-CZM2q-Ac.mjs.map} +1 -1
- package/dist/{separator-D9m7b_32.d.mts → separator-D6YkFSv3.d.cts} +3 -3
- package/dist/{separator-HDjiaARy.d.cts → separator-DVJtN08T.d.mts} +3 -3
- package/dist/{sheet-BYKV6xT_.cjs → sheet-5MJRtrfG.cjs} +1 -1
- package/dist/{sheet-BYKV6xT_.cjs.map → sheet-5MJRtrfG.cjs.map} +1 -1
- package/dist/{sheet-BSeiP8S8.mjs → sheet-CUMpo5F_.mjs} +1 -1
- package/dist/{sheet-BSeiP8S8.mjs.map → sheet-CUMpo5F_.mjs.map} +1 -1
- package/dist/{tabs-XrUcxpL1.mjs → tabs-Cjh2jtUZ.mjs} +1 -1
- package/dist/{tabs-XrUcxpL1.mjs.map → tabs-Cjh2jtUZ.mjs.map} +1 -1
- package/dist/{tabs-DldSJjLy.cjs → tabs-DSofRReg.cjs} +1 -1
- package/dist/{tabs-DldSJjLy.cjs.map → tabs-DSofRReg.cjs.map} +1 -1
- package/dist/{tooltip-B5gO2RGs.d.cts → tooltip-CVLw9F2s.d.cts} +6 -6
- package/dist/{tooltip-WI0fJ7gP.d.mts → tooltip-Cu2-ZHAv.d.mts} +6 -6
- package/dist/{types-DWnJKJ5r.d.mts → types-D2kMOc_b.d.mts} +1 -1
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.mts +2 -2
- package/dist/typography/title.cjs +2 -1
- package/dist/typography/title.cjs.map +1 -0
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/typography/title.mjs +2 -1
- package/dist/typography/title.mjs.map +1 -0
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert.d.cts +7 -7
- package/dist/ui/alert.d.mts +7 -7
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/badge.d.cts +2 -2
- package/dist/ui/badge.d.mts +4 -4
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/button-group.cjs +1 -1
- package/dist/ui/button-group.d.cts +5 -5
- package/dist/ui/button-group.d.mts +7 -7
- package/dist/ui/button-group.mjs +1 -1
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.cjs +1 -1
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/command.mjs +1 -1
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.cjs +1 -1
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/dialog.mjs +1 -1
- package/dist/ui/drawer.cjs +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/drawer.mjs +1 -1
- package/dist/ui/dropdown-menu.cjs +1 -1
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/dropdown-menu.mjs +1 -1
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +7 -7
- package/dist/ui/field.cjs +1 -1
- package/dist/ui/field.d.cts +24 -24
- package/dist/ui/field.d.mts +11 -11
- package/dist/ui/field.mjs +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/form.cjs +1 -1
- package/dist/ui/form.d.cts +11 -11
- package/dist/ui/form.d.mts +7 -7
- package/dist/ui/form.mjs +1 -1
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input.cjs +1 -1
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/input.mjs +1 -1
- package/dist/ui/inputs/search-input.cjs +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/inputs/search-input.mjs +1 -1
- package/dist/ui/item.cjs +1 -1
- package/dist/ui/item.d.cts +15 -15
- package/dist/ui/item.d.mts +12 -12
- package/dist/ui/item.mjs +1 -1
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/label.mjs +1 -1
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.mts +17 -17
- package/dist/ui/multi-select.cjs +1 -1
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.mts +1 -1
- package/dist/ui/multi-select.mjs +1 -1
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.mts +9 -9
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.mts +5 -5
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.mts +4 -4
- package/dist/ui/resizable.mjs +1 -1
- package/dist/ui/scroll-area.cjs +1 -1
- package/dist/ui/scroll-area.d.cts +3 -3
- package/dist/ui/scroll-area.d.mts +3 -3
- package/dist/ui/scroll-area.mjs +1 -1
- package/dist/ui/select.d.cts +11 -11
- package/dist/ui/select.d.mts +11 -11
- package/dist/ui/separator.cjs +1 -1
- package/dist/ui/separator.d.cts +1 -1
- package/dist/ui/separator.d.mts +1 -1
- package/dist/ui/separator.mjs +1 -1
- package/dist/ui/sheet.cjs +1 -1
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sheet.mjs +1 -1
- package/dist/ui/sidebar.cjs +1 -1
- package/dist/ui/sidebar.d.cts +28 -28
- package/dist/ui/sidebar.d.mts +28 -28
- package/dist/ui/sidebar.mjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.mts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.mts +2 -2
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.mts +2 -2
- package/dist/ui/table.d.cts +18 -18
- package/dist/ui/table.d.mts +9 -9
- package/dist/ui/tabs.cjs +1 -1
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.mts +5 -5
- package/dist/ui/tabs.mjs +1 -1
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/toggle-group.d.cts +3 -3
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle.d.cts +4 -4
- package/dist/ui/toggle.d.mts +2 -2
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.mts +1 -1
- package/package.json +1 -1
- package/dist/dialogs/detail-dialog/component/sidebar.cjs +0 -2
- package/dist/dialogs/detail-dialog/component/sidebar.cjs.map +0 -1
- package/dist/dialogs/detail-dialog/component/sidebar.mjs +0 -2
- package/dist/dialogs/detail-dialog/component/sidebar.mjs.map +0 -1
- package/dist/title-BK1YcXjX.mjs +0 -2
- package/dist/title-BK1YcXjX.mjs.map +0 -1
- package/dist/title-BNv6aAfA.cjs +0 -2
- package/dist/title-BNv6aAfA.cjs.map +0 -1
package/dist/layouts/flex.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
2
2
|
import * as react0 from "react";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
@@ -28,7 +28,7 @@ declare const Flex: react0.MemoExoticComponent<({
|
|
|
28
28
|
align,
|
|
29
29
|
className,
|
|
30
30
|
children
|
|
31
|
-
}: React.PropsWithChildren<Props>) =>
|
|
31
|
+
}: React.PropsWithChildren<Props>) => react_jsx_runtime2.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(`../../card-wGoU4Xiq.cjs`);require(`../../button.variants-C--cfyfH.cjs`);const n=require(`../../button-DtFiUaY7.cjs`);require(`../../skeleton-C4suljHP.cjs`);const r=require(`../../image-D5vQS72z.cjs`),i=require(`../../tooltip-BimfNium.cjs`),a=require(`../../avatar-aVxo69zP.cjs`);require(`../../close-DvsVM8lM.cjs`);const o=require(`../../dialog-DVwvHuQB.cjs`),s=require(`../../input-C1BXP8dd.cjs`),c=require(`../../separator-Crr30ZHa.cjs`),l=require(`../../sheet-BYKV6xT_.cjs`),u=require(`../../dropdown-menu-DQs_Lvq7.cjs`),d=require(`../../drawer-DluJOnDX.cjs`),f=require(`../../tabs-DldSJjLy.cjs`),p=require(`../../scroll-area-D61j6n8I.cjs`);let m=require(`@customafk/react-toolkit/utils`),h=require(`react/jsx-runtime`),g=require(`lucide-react`),_=require(`react`),v=require(`class-variance-authority`),y=require(`radix-ui`),b=require(`@customafk/react-toolkit/hooks/useMobile`),x=require(`@customafk/react-toolkit/hooks/useMediaQuery`),S=require(`@react-oauth/google`),C=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const w=(0,_.createContext)(null),T=()=>{let e=(0,_.use)(w);if(!e)throw Error(`useServiceLayoutContext must be used within a ServiceLayoutProvider`);return e},E=({id:e,type:i,productName:a,imageUrl:o,quantity:c,price:l,options:u})=>{let{onDeletingCart:d,onUpdatingCart:f}=T(),[p,m]=(0,_.useState)(c),[v,y]=(0,_.useState)(!1),b=(0,C.useDebounceCallback)((0,_.useCallback)(()=>{f?.(e,p,i)},[f,e,p,i]),500),x=(0,_.useCallback)(e=>{e<1&&(e=1),e>99&&(e=99),m(e)},[]),S=(0,_.useCallback)(async()=>{y(!0),await d?.(e),y(!1)},[e,d]);return(0,_.useEffect)(()=>(p!==c&&b(),()=>{b.cancel()}),[p,c,b]),(0,h.jsxs)(t.t,{className:`border-border-weak relative mb-3 overflow-x-auto border p-4 shadow-none`,children:[v&&(0,h.jsx)(`div`,{className:`bg-muted-muted/80 absolute inset-0 z-10 flex items-center justify-center`,children:(0,h.jsx)(`div`,{className:`loader-dots`})}),(0,h.jsxs)(t.r,{className:`p-0`,children:[(0,h.jsxs)(n.t,{variant:`ghost`,size:`icon`,color:`muted`,disabled:v,className:`text-text-positive-weak absolute top-2 right-2 z-10`,onClick:S,children:[(0,h.jsx)(g.Trash2,{className:`h-4 w-4`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Remove item`})]}),(0,h.jsxs)(`div`,{className:`flex gap-3`,children:[(0,h.jsx)(`div`,{className:`relative size-20 flex-shrink-0`,children:o?(0,h.jsx)(r.t,{src:o,alt:a,className:`rounded-md border-none shadow-xs`,width:80,height:80}):(0,h.jsx)(`div`,{className:`bg-muted text-muted-foreground flex size-full items-center justify-center text-xs`,children:`No image`})}),(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,h.jsx)(`div`,{className:`flex justify-between`,children:(0,h.jsx)(`h3`,{className:`text-text-positive line-clamp-1 text-sm font-medium`,children:a})}),(0,h.jsx)(`p`,{className:`text-text-positive-weak mb-1 text-xs`,children:u.map((e,t)=>(0,h.jsxs)(`span`,{children:[e.label,`: `,e.value,t<u.length-1&&`, `]},e.label))}),(0,h.jsxs)(`div`,{className:`mt-auto flex items-center justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center space-x-1`,children:[(0,h.jsx)(`button`,{disabled:p<=1,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>x(p-1),children:(0,h.jsx)(g.Minus,{size:12})}),(0,h.jsx)(s.t,{value:p,onChange:e=>x(parseInt(e.target.value||`1`)),className:`border-border h-6.5 w-14 rounded-md border p-1 text-center text-sm`,min:1}),(0,h.jsx)(`button`,{disabled:p>=99,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>x(p+1),children:(0,h.jsx)(g.Plus,{size:12})})]}),(0,h.jsxs)(`div`,{className:`text-sm font-semibold`,children:[(l*p).toLocaleString(),` ₫`]})]})]})]})]})]})},D=({items:e=[],cartType:t,className:r})=>{let i=e.reduce((e,t)=>e+t.price*t.quantity,0);return e.length===0?(0,h.jsxs)(`div`,{className:(0,m.cn)(`bg-muted-muted flex size-full max-h-80 flex-col items-center justify-center rounded-lg p-8`,r),children:[(0,h.jsx)(`div`,{className:`text-text-positive-weak bg-card shadow-card mb-4 flex size-20 items-center justify-center rounded-full text-5xl`,children:(0,h.jsx)(g.ShoppingBasketIcon,{size:42,strokeWidth:1})}),(0,h.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,h.jsx)(`p`,{className:`text-text-positive text-center text-base font-semibold`,children:`Giỏ hàng trống`}),(0,h.jsx)(`p`,{className:`text-text-positive-weak mb-4 text-center text-sm`,children:t===`in_stock`?`Thêm sản phẩm có sẵn vào giỏ hàng của bạn!`:`Thêm sản phẩm đặt trước vào giỏ hàng của bạn!`})]})]}):(0,h.jsxs)(`div`,{className:(0,m.cn)(`flex h-full flex-col space-y-4 overflow-y-auto`,r),children:[(0,h.jsx)(p.t,{className:`h-full flex-1`,children:e.map(e=>(0,h.jsx)(E,{...e,type:t},e.id))}),(0,h.jsxs)(`div`,{className:`flex-0 space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-text-positive-weak text-sm`,children:`Tạm tính:`}),(0,h.jsxs)(`span`,{className:`text-sm`,children:[i.toLocaleString(),` ₫`]})]}),(0,h.jsx)(c.t,{}),(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-text-positive font-medium`,children:`Tổng cộng:`}),(0,h.jsxs)(`span`,{className:`text-lg font-semibold`,children:[i.toLocaleString(),` ₫`]})]}),(0,h.jsx)(n.t,{className:`mt-2 w-full`,children:`Thanh toán ngay`}),t===`pre_order`&&(0,h.jsx)(`p`,{className:`text-text-positive-weak text-center text-xs italic`,children:`* Sản phẩm đặt trước sẽ được giao sau khi có hàng`})]})]})},O=(0,_.createContext)(null),k=()=>{let e=(0,_.use)(O);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e},ee=`sidebar_state`,te=3600*24*7,ne=`16rem`,re=`16rem`,ie=`3rem`,ae=`b`;function A({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=(0,b.useIsMobile)(),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(e),p=t??d,g=(0,_.useCallback)(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]),v=(0,_.useCallback)(()=>c?u(e=>!e):g(e=>!e),[c,g]);(0,_.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=p?`expanded`:`collapsed`,x=(0,_.useMemo)(()=>({state:y,isMobile:c,toggleSidebar:v,open:p,setOpen:g,openMobile:l,setOpenMobile:u}),[y,p,g,c,l,v]);return(0,h.jsx)(O.Provider,{value:x,children:(0,h.jsx)(i.r,{delayDuration:0,children:(0,h.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:(0,m.cn)(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,r),...s,children:o})})})}function j({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:u}=k();return n===`none`?(0,h.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,m.cn)(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?(0,h.jsx)(l.t,{open:c,onOpenChange:u,children:(0,h.jsxs)(l.r,{side:`left`,"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":`16rem`},children:[(0,h.jsxs)(l.o,{className:`sr-only`,children:[(0,h.jsx)(l.s,{children:`Sidebar`}),(0,h.jsx)(l.i,{children:`Displays the mobile sidebar.`})]}),(0,h.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,h.jsx)(M,{}),(0,h.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,h.jsx)(g.ShoppingCartIcon,{size:20})}),(0,h.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,h.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:i})]})]})}):(0,h.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,h.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,m.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,h.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,m.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`,r),...a,children:(0,h.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,m.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:i})})]})}function M({className:e,onClick:t,...r}){let{toggleSidebar:i}=k();return(0,h.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,m.cn)(`size-10 rounded-full`,e),onClick:e=>{t?.(e),i()},...r,children:[(0,h.jsx)(g.MenuIcon,{className:`size-6!`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function N({className:e,children:t,...n}){return(0,h.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,m.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,h.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,h.jsx)(`div`,{className:(0,m.cn)(`inset-shadow-sm flex-1`),children:t})]})}function P({className:e,children:t,...n}){let{open:r}=k(),{onLogout:i}=T();return(0,h.jsxs)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,m.cn)(`flex flex-col gap-2`,e),...n,children:[t,(0,h.jsxs)(z,{children:[(0,h.jsx)(B,{children:(0,h.jsxs)(H,{className:`border border-border`,onClick:i,children:[(0,h.jsx)(g.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),r&&(0,h.jsx)(B,{className:`mt-2 border-t border-t-border`,children:(0,h.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})]})}function F({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,m.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function I({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,m.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function L({className:e,asChild:t=!1,...n}){return(0,h.jsx)(t?y.Slot.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,m.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-xs outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function R({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,m.cn)(`w-full text-sm`,e),...t})}function z({className:e,...t}){return(0,h.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,m.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function B({className:e,...t}){return(0,h.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,m.cn)(`group/menu-item relative`,e),...t})}const V=(0,v.cva)(`peer/menu-button.cursor-pointer.flex w-full items-center gap-2.overflow-hidden rounded-md p-2 outline-hidden.truncate text-left.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]:font-medium.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`.split(`.`),{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 H({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:a,className:o,...s}){let c=e?y.Slot.Slot:`button`,{isMobile:l,state:u}=k(),d=(0,h.jsx)(c,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:(0,m.cn)(V({variant:n,size:r}),o),...s});return a?(typeof a==`string`&&(a={children:a}),(0,h.jsxs)(i.t,{children:[(0,h.jsx)(i.i,{asChild:!0,children:d}),(0,h.jsx)(i.n,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...a})]})):d}const U=({isLoggedIn:e=!1,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c,children:l})=>(0,h.jsx)(w.Provider,{value:{isLoggedIn:e,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c},children:l}),W=({children:e})=>(0,h.jsx)(A,{children:e}),G=({userName:e=`Keith Kennedy`,userEmail:t=`k.kennedy@originui.com`,onLogout:r})=>(0,h.jsxs)(u.t,{children:[(0,h.jsx)(u.h,{asChild:!0,children:(0,h.jsx)(n.t,{size:`icon`,variant:`ghost`,color:`secondary`,className:`size-10 rounded-full`,children:(0,h.jsxs)(a.t,{className:`size-10`,children:[(0,h.jsx)(a.r,{}),(0,h.jsx)(a.n,{className:`size-full bg-muted-muted`,children:(0,h.jsx)(g.UserIcon,{})})]})})}),(0,h.jsxs)(u.r,{align:`end`,className:`max-w-64`,children:[(0,h.jsxs)(u.o,{className:`flex min-w-0 flex-col`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium text-sm text-text-positive`,children:e}),(0,h.jsx)(`span`,{className:`truncate font-normal text-text-positive-weak text-xs`,children:t})]}),(0,h.jsx)(u.u,{}),(0,h.jsxs)(u.a,{onClick:r,children:[(0,h.jsx)(g.LogOutIcon,{size:16,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`text-text-positive`,children:`Logout`})]})]})]}),K=()=>{let{inStockCarts:e=[],orderedCarts:t=[]}=T(),r=e.length,i=t.length,a=r+i;return(0,h.jsxs)(l.t,{children:[(0,h.jsx)(l.c,{asChild:!0,children:(0,h.jsx)(n.t,{size:`icon`,variant:`ghost`,color:`secondary`,className:`relative size-10 rounded-full`,children:(0,h.jsx)(g.ShoppingCartIcon,{})})}),(0,h.jsxs)(l.r,{className:`w-[95vw] sm:max-w-md`,children:[(0,h.jsx)(l.o,{className:`flex-0 border-border-weak border-b pb-3`,children:(0,h.jsxs)(l.s,{className:`flex items-center gap-2`,children:[(0,h.jsx)(g.ShoppingBag,{size:20}),(0,h.jsx)(`span`,{children:`Giỏ hàng của bạn`}),a>0&&(0,h.jsxs)(`span`,{className:`font-normal text-sm text-text-positive-weak`,children:[`(`,a,` sản phẩm)`]})]})}),(0,h.jsxs)(f.t,{defaultValue:i>0?`pre_order`:`in_stock`,className:`h-full flex-1 overflow-y-auto p-4 pt-0`,children:[(0,h.jsxs)(f.r,{className:`w-full flex-0`,children:[(0,h.jsxs)(f.i,{value:`in_stock`,className:`relative`,children:[`Có sẵn`,r>0&&(0,h.jsxs)(`span`,{children:[`(`,r,`)`]})]}),(0,h.jsxs)(f.i,{value:`pre_order`,className:`relative`,children:[`Đặt trước`,i>0&&(0,h.jsxs)(`span`,{children:[`(`,i,`)`]})]})]}),(0,h.jsx)(f.n,{value:`pre_order`,className:`flex-1 overflow-y-auto`,children:(0,h.jsx)(D,{items:t,cartType:`pre_order`})}),(0,h.jsx)(f.n,{value:`in_stock`,className:`flex-1 overflow-y-auto`,children:(0,h.jsx)(D,{items:e,cartType:`in_stock`})})]})]})]})},q=()=>{let{isLoggedIn:e,username:t,email:r,onGoogleLoginSuccess:i,onLogout:a}=T(),s=(0,x.useMediaQuery)(`(min-width: 640px)`),[l,u]=(0,_.useState)(!1);return(0,h.jsxs)(`header`,{className:(0,m.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:[e&&(0,h.jsx)(M,{}),(0,h.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,h.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,h.jsx)(g.ShoppingCartIcon,{size:20})}),(0,h.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,h.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,h.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-x-2`,children:[!e&&(0,h.jsxs)(n.t,{className:`w-8 sm:w-fit`,onClick:()=>u(!0),children:[(0,h.jsx)(g.LogInIcon,{}),(0,h.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:`Đăng nhập`})]}),e&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(G,{userName:t,userEmail:r,onLogout:a}),(0,h.jsx)(c.t,{orientation:`vertical`,className:`min-h-6 w-px`}),(0,h.jsx)(K,{})]})]}),s&&(0,h.jsx)(o.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(o.r,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,h.jsx)(o.o,{className:`flex-0 gap-2 p-6`,children:(0,h.jsx)(o.l,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,h.jsx)(o.a,{className:`p-2`})]})}),!s&&(0,h.jsx)(d.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(d.r,{children:[(0,h.jsx)(d.o,{className:`text-left`,children:(0,h.jsx)(d.l,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,h.jsx)(d.a,{})]})})]})},J=({children:e,...t})=>{let{isLoggedIn:n}=T();return n?(0,h.jsx)(j,{variant:`inset`,collapsible:`icon`,...t,children:e}):null},Y=({children:e})=>{let{isLoggedIn:t,onGoogleLoginSuccess:r}=T(),i=(0,x.useMediaQuery)(`(min-width: 640px)`),[a,s]=(0,_.useState)(!1);return t?(0,h.jsx)(N,{children:(0,h.jsx)(`section`,{className:`relative size-full`,children:(0,h.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}):(0,h.jsx)(`div`,{className:`size-full p-4 pt-[calc(var(--header-height)+1.5rem)]`,children:(0,h.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-6 rounded-lg bg-card p-8 text-center shadow-card`,children:[(0,h.jsx)(`div`,{className:`flex size-20 items-center justify-center rounded-full bg-muted-foreground/10`,children:(0,h.jsx)(g.LockIcon,{className:`size-10 text-primary`})}),(0,h.jsxs)(`div`,{className:`flex max-w-md flex-col gap-2`,children:[(0,h.jsx)(`h2`,{className:`font-semibold text-2xl`,children:`Bạn chưa đăng nhập`}),(0,h.jsx)(`p`,{className:`text-text-positive-weak`,children:`Đăng nhập để khám phá đầy đủ các tính năng của Lunas Store và truy cập vào tài khoản của bạn.`})]}),(0,h.jsxs)(n.t,{size:`lg`,className:`gap-2`,onClick:()=>s(!0),children:[(0,h.jsx)(g.LogInIcon,{size:18}),(0,h.jsx)(`span`,{children:`Đăng nhập ngay`})]}),i&&(0,h.jsx)(o.t,{open:a,onOpenChange:s,children:(0,h.jsxs)(o.r,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,h.jsx)(o.o,{className:`flex-0 gap-2 p-6`,children:(0,h.jsx)(o.l,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),s(!1))}})]})})}),(0,h.jsx)(o.a,{className:`p-2`})]})}),!i&&(0,h.jsx)(d.t,{open:a,onOpenChange:s,children:(0,h.jsxs)(d.r,{children:[(0,h.jsx)(d.o,{className:`text-left`,children:(0,h.jsx)(d.l,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),s(!1))}})]})})}),(0,h.jsx)(d.a,{})]})})]})})},X=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-header`,className:(0,m.cn)(`flex-0 snap-start`,e),children:t}),Z=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-content`,className:(0,m.cn)(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),Q=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-footer`,className:(0,m.cn)(`hidden w-full flex-0 border-border-weak border-t pt-2 sm:flex`,e),children:t}),$=({children:e,className:t})=>(0,h.jsx)(`div`,{"data-slot":`main-group`,className:(0,m.cn)(`flex size-full flex-col gap-4`,t),children:e}),oe=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-group-content`,className:(0,m.cn)(`size-full max-w-8xl flex-1 rounded-md bg-card p-4 shadow-card`,e),children:t});exports.ServiceLayoutCartInfo=K,exports.ServiceLayoutHeader=q,exports.ServiceLayoutMain=Y,exports.ServiceLayoutMainContent=Z,exports.ServiceLayoutMainFooter=Q,exports.ServiceLayoutMainGroup=$,exports.ServiceLayoutMainGroupContent=oe,exports.ServiceLayoutMainHeader=X,exports.ServiceLayoutProvider=U,exports.ServiceLayoutSidebar=J,exports.ServiceLayoutSidebarContent=F,exports.ServiceLayoutSidebarFooter=P,exports.ServiceLayoutSidebarGroup=I,exports.ServiceLayoutSidebarGroupContent=R,exports.ServiceLayoutSidebarGroupLabel=L,exports.ServiceLayoutSidebarMenu=z,exports.ServiceLayoutSidebarMenuButton=H,exports.ServiceLayoutSidebarMenuItem=B,exports.ServiceLayoutUserInfo=G,exports.ServiceLayoutWrapper=W;
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../card-wGoU4Xiq.cjs`);require(`../../button.variants-C--cfyfH.cjs`);const n=require(`../../button-DtFiUaY7.cjs`);require(`../../skeleton-C4suljHP.cjs`);const r=require(`../../image-D5vQS72z.cjs`),i=require(`../../tooltip-BimfNium.cjs`),a=require(`../../avatar-aVxo69zP.cjs`),o=require(`../../separator-C3ip6sbh.cjs`),s=require(`../../sheet-5MJRtrfG.cjs`);require(`../../close-D_Ge7gnP.cjs`);const c=require(`../../dialog-DeIMaQO0.cjs`),l=require(`../../dropdown-menu-BuyuU6uF.cjs`),u=require(`../../input-qnlHzDDm.cjs`),d=require(`../../drawer-y-Yrqskp.cjs`),f=require(`../../tabs-DSofRReg.cjs`),p=require(`../../scroll-area-qE6GqGkn.cjs`);let m=require(`@customafk/react-toolkit/utils`),h=require(`react/jsx-runtime`),g=require(`lucide-react`),_=require(`react`),v=require(`class-variance-authority`),y=require(`radix-ui`),b=require(`@customafk/react-toolkit/hooks/useMobile`),x=require(`@customafk/react-toolkit/hooks/useMediaQuery`),S=require(`@react-oauth/google`),C=require(`@customafk/react-toolkit/hooks/useDebounceCallback`);const w=(0,_.createContext)(null),T=()=>{let e=(0,_.use)(w);if(!e)throw Error(`useServiceLayoutContext must be used within a ServiceLayoutProvider`);return e},E=({id:e,type:i,productName:a,imageUrl:o,quantity:s,price:c,options:l})=>{let{onDeletingCart:d,onUpdatingCart:f}=T(),[p,m]=(0,_.useState)(s),[v,y]=(0,_.useState)(!1),b=(0,C.useDebounceCallback)((0,_.useCallback)(()=>{f?.(e,p,i)},[f,e,p,i]),500),x=(0,_.useCallback)(e=>{e<1&&(e=1),e>99&&(e=99),m(e)},[]),S=(0,_.useCallback)(async()=>{y(!0),await d?.(e),y(!1)},[e,d]);return(0,_.useEffect)(()=>(p!==s&&b(),()=>{b.cancel()}),[p,s,b]),(0,h.jsxs)(t.t,{className:`border-border-weak relative mb-3 overflow-x-auto border p-4 shadow-none`,children:[v&&(0,h.jsx)(`div`,{className:`bg-muted-muted/80 absolute inset-0 z-10 flex items-center justify-center`,children:(0,h.jsx)(`div`,{className:`loader-dots`})}),(0,h.jsxs)(t.r,{className:`p-0`,children:[(0,h.jsxs)(n.t,{variant:`ghost`,size:`icon`,color:`muted`,disabled:v,className:`text-text-positive-weak absolute top-2 right-2 z-10`,onClick:S,children:[(0,h.jsx)(g.Trash2,{className:`h-4 w-4`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Remove item`})]}),(0,h.jsxs)(`div`,{className:`flex gap-3`,children:[(0,h.jsx)(`div`,{className:`relative size-20 flex-shrink-0`,children:o?(0,h.jsx)(r.t,{src:o,alt:a,className:`rounded-md border-none shadow-xs`,width:80,height:80}):(0,h.jsx)(`div`,{className:`bg-muted text-muted-foreground flex size-full items-center justify-center text-xs`,children:`No image`})}),(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,h.jsx)(`div`,{className:`flex justify-between`,children:(0,h.jsx)(`h3`,{className:`text-text-positive line-clamp-1 text-sm font-medium`,children:a})}),(0,h.jsx)(`p`,{className:`text-text-positive-weak mb-1 text-xs`,children:l.map((e,t)=>(0,h.jsxs)(`span`,{children:[e.label,`: `,e.value,t<l.length-1&&`, `]},e.label))}),(0,h.jsxs)(`div`,{className:`mt-auto flex items-center justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center space-x-1`,children:[(0,h.jsx)(`button`,{disabled:p<=1,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>x(p-1),children:(0,h.jsx)(g.Minus,{size:12})}),(0,h.jsx)(u.t,{value:p,onChange:e=>x(parseInt(e.target.value||`1`)),className:`border-border h-6.5 w-14 rounded-md border p-1 text-center text-sm`,min:1}),(0,h.jsx)(`button`,{disabled:p>=99,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>x(p+1),children:(0,h.jsx)(g.Plus,{size:12})})]}),(0,h.jsxs)(`div`,{className:`text-sm font-semibold`,children:[(c*p).toLocaleString(),` ₫`]})]})]})]})]})]})},D=({items:e=[],cartType:t,className:r})=>{let i=e.reduce((e,t)=>e+t.price*t.quantity,0);return e.length===0?(0,h.jsxs)(`div`,{className:(0,m.cn)(`bg-muted-muted flex size-full max-h-80 flex-col items-center justify-center rounded-lg p-8`,r),children:[(0,h.jsx)(`div`,{className:`text-text-positive-weak bg-card shadow-card mb-4 flex size-20 items-center justify-center rounded-full text-5xl`,children:(0,h.jsx)(g.ShoppingBasketIcon,{size:42,strokeWidth:1})}),(0,h.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,h.jsx)(`p`,{className:`text-text-positive text-center text-base font-semibold`,children:`Giỏ hàng trống`}),(0,h.jsx)(`p`,{className:`text-text-positive-weak mb-4 text-center text-sm`,children:t===`in_stock`?`Thêm sản phẩm có sẵn vào giỏ hàng của bạn!`:`Thêm sản phẩm đặt trước vào giỏ hàng của bạn!`})]})]}):(0,h.jsxs)(`div`,{className:(0,m.cn)(`flex h-full flex-col space-y-4 overflow-y-auto`,r),children:[(0,h.jsx)(p.t,{className:`h-full flex-1`,children:e.map(e=>(0,h.jsx)(E,{...e,type:t},e.id))}),(0,h.jsxs)(`div`,{className:`flex-0 space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-text-positive-weak text-sm`,children:`Tạm tính:`}),(0,h.jsxs)(`span`,{className:`text-sm`,children:[i.toLocaleString(),` ₫`]})]}),(0,h.jsx)(o.t,{}),(0,h.jsxs)(`div`,{className:`flex justify-between`,children:[(0,h.jsx)(`span`,{className:`text-text-positive font-medium`,children:`Tổng cộng:`}),(0,h.jsxs)(`span`,{className:`text-lg font-semibold`,children:[i.toLocaleString(),` ₫`]})]}),(0,h.jsx)(n.t,{className:`mt-2 w-full`,children:`Thanh toán ngay`}),t===`pre_order`&&(0,h.jsx)(`p`,{className:`text-text-positive-weak text-center text-xs italic`,children:`* Sản phẩm đặt trước sẽ được giao sau khi có hàng`})]})]})},O=(0,_.createContext)(null),k=()=>{let e=(0,_.use)(O);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e},ee=`sidebar_state`,te=3600*24*7,ne=`16rem`,re=`16rem`,ie=`3rem`,ae=`b`;function A({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...s}){let c=(0,b.useIsMobile)(),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(e),p=t??d,g=(0,_.useCallback)(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]),v=(0,_.useCallback)(()=>c?u(e=>!e):g(e=>!e),[c,g]);(0,_.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=p?`expanded`:`collapsed`,x=(0,_.useMemo)(()=>({state:y,isMobile:c,toggleSidebar:v,open:p,setOpen:g,openMobile:l,setOpenMobile:u}),[y,p,g,c,l,v]);return(0,h.jsx)(O.Provider,{value:x,children:(0,h.jsx)(i.r,{delayDuration:0,children:(0,h.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...a},className:(0,m.cn)(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,r),...s,children:o})})})}function j({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:c,openMobile:l,setOpenMobile:u}=k();return n===`none`?(0,h.jsx)(`aside`,{"data-slot":`sidebar`,className:(0,m.cn)(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?(0,h.jsx)(s.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(s.r,{side:`left`,"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":`16rem`},children:[(0,h.jsxs)(s.o,{className:`sr-only`,children:[(0,h.jsx)(s.s,{children:`Sidebar`}),(0,h.jsx)(s.i,{children:`Displays the mobile sidebar.`})]}),(0,h.jsxs)(`div`,{className:`flex size-full flex-col`,children:[(0,h.jsxs)(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[(0,h.jsx)(M,{}),(0,h.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,h.jsx)(g.ShoppingCartIcon,{size:20})}),(0,h.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,h.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col p-2`,children:i})]})]})}):(0,h.jsxs)(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,h.jsx)(`div`,{"data-slot":`sidebar-gap`,className:(0,m.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,h.jsx)(`div`,{"data-slot":`sidebar-container`,className:(0,m.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`,r),...a,children:(0,h.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:(0,m.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:i})})]})}function M({className:e,onClick:t,...r}){let{toggleSidebar:i}=k();return(0,h.jsxs)(n.t,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:(0,m.cn)(`size-10 rounded-full`,e),onClick:e=>{t?.(e),i()},...r,children:[(0,h.jsx)(g.MenuIcon,{className:`size-6!`}),(0,h.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function N({className:e,children:t,...n}){return(0,h.jsxs)(`main`,{"data-slot":`sidebar-inset`,className:(0,m.cn)(`relative flex w-full flex-1 flex-col`,e),...n,children:[(0,h.jsx)(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),(0,h.jsx)(`div`,{className:(0,m.cn)(`inset-shadow-sm flex-1`),children:t})]})}function P({className:e,children:t,...n}){let{open:r}=k(),{onLogout:i}=T();return(0,h.jsxs)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:(0,m.cn)(`flex flex-col gap-2`,e),...n,children:[t,(0,h.jsxs)(z,{children:[(0,h.jsx)(B,{children:(0,h.jsxs)(H,{className:`border border-border`,onClick:i,children:[(0,h.jsx)(g.LogOutIcon,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),r&&(0,h.jsx)(B,{className:`mt-2 border-t border-t-border`,children:(0,h.jsx)(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})]})}function F({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:(0,m.cn)(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function I({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:(0,m.cn)(`relative flex w-full min-w-0 flex-col`,e),...t})}function L({className:e,asChild:t=!1,...n}){return(0,h.jsx)(t?y.Slot.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:(0,m.cn)(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-xs outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function R({className:e,...t}){return(0,h.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:(0,m.cn)(`w-full text-sm`,e),...t})}function z({className:e,...t}){return(0,h.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:(0,m.cn)(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function B({className:e,...t}){return(0,h.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:(0,m.cn)(`group/menu-item relative`,e),...t})}const V=(0,v.cva)(`peer/menu-button.cursor-pointer.flex w-full items-center gap-2.overflow-hidden rounded-md p-2 outline-hidden.truncate text-left.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]:font-medium.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`.split(`.`),{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 H({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:a,className:o,...s}){let c=e?y.Slot.Slot:`button`,{isMobile:l,state:u}=k(),d=(0,h.jsx)(c,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:(0,m.cn)(V({variant:n,size:r}),o),...s});return a?(typeof a==`string`&&(a={children:a}),(0,h.jsxs)(i.t,{children:[(0,h.jsx)(i.i,{asChild:!0,children:d}),(0,h.jsx)(i.n,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...a})]})):d}const U=({isLoggedIn:e=!1,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c,children:l})=>(0,h.jsx)(w.Provider,{value:{isLoggedIn:e,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c},children:l}),W=({children:e})=>(0,h.jsx)(A,{children:e}),G=({userName:e=`Keith Kennedy`,userEmail:t=`k.kennedy@originui.com`,onLogout:r})=>(0,h.jsxs)(l.t,{children:[(0,h.jsx)(l.h,{asChild:!0,children:(0,h.jsx)(n.t,{size:`icon`,variant:`ghost`,color:`secondary`,className:`size-10 rounded-full`,children:(0,h.jsxs)(a.t,{className:`size-10`,children:[(0,h.jsx)(a.r,{}),(0,h.jsx)(a.n,{className:`size-full bg-muted-muted`,children:(0,h.jsx)(g.UserIcon,{})})]})})}),(0,h.jsxs)(l.r,{align:`end`,className:`max-w-64`,children:[(0,h.jsxs)(l.o,{className:`flex min-w-0 flex-col`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium text-sm text-text-positive`,children:e}),(0,h.jsx)(`span`,{className:`truncate font-normal text-text-positive-weak text-xs`,children:t})]}),(0,h.jsx)(l.u,{}),(0,h.jsxs)(l.a,{onClick:r,children:[(0,h.jsx)(g.LogOutIcon,{size:16,"aria-hidden":`true`}),(0,h.jsx)(`span`,{className:`text-text-positive`,children:`Logout`})]})]})]}),K=()=>{let{inStockCarts:e=[],orderedCarts:t=[]}=T(),r=e.length,i=t.length,a=r+i;return(0,h.jsxs)(s.t,{children:[(0,h.jsx)(s.c,{asChild:!0,children:(0,h.jsx)(n.t,{size:`icon`,variant:`ghost`,color:`secondary`,className:`relative size-10 rounded-full`,children:(0,h.jsx)(g.ShoppingCartIcon,{})})}),(0,h.jsxs)(s.r,{className:`w-[95vw] sm:max-w-md`,children:[(0,h.jsx)(s.o,{className:`flex-0 border-border-weak border-b pb-3`,children:(0,h.jsxs)(s.s,{className:`flex items-center gap-2`,children:[(0,h.jsx)(g.ShoppingBag,{size:20}),(0,h.jsx)(`span`,{children:`Giỏ hàng của bạn`}),a>0&&(0,h.jsxs)(`span`,{className:`font-normal text-sm text-text-positive-weak`,children:[`(`,a,` sản phẩm)`]})]})}),(0,h.jsxs)(f.t,{defaultValue:i>0?`pre_order`:`in_stock`,className:`h-full flex-1 overflow-y-auto p-4 pt-0`,children:[(0,h.jsxs)(f.r,{className:`w-full flex-0`,children:[(0,h.jsxs)(f.i,{value:`in_stock`,className:`relative`,children:[`Có sẵn`,r>0&&(0,h.jsxs)(`span`,{children:[`(`,r,`)`]})]}),(0,h.jsxs)(f.i,{value:`pre_order`,className:`relative`,children:[`Đặt trước`,i>0&&(0,h.jsxs)(`span`,{children:[`(`,i,`)`]})]})]}),(0,h.jsx)(f.n,{value:`pre_order`,className:`flex-1 overflow-y-auto`,children:(0,h.jsx)(D,{items:t,cartType:`pre_order`})}),(0,h.jsx)(f.n,{value:`in_stock`,className:`flex-1 overflow-y-auto`,children:(0,h.jsx)(D,{items:e,cartType:`in_stock`})})]})]})]})},q=()=>{let{isLoggedIn:e,username:t,email:r,onGoogleLoginSuccess:i,onLogout:a}=T(),s=(0,x.useMediaQuery)(`(min-width: 640px)`),[l,u]=(0,_.useState)(!1);return(0,h.jsxs)(`header`,{className:(0,m.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:[e&&(0,h.jsx)(M,{}),(0,h.jsxs)(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[(0,h.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,h.jsx)(g.ShoppingCartIcon,{size:20})}),(0,h.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,h.jsx)(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),(0,h.jsx)(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),(0,h.jsxs)(`div`,{className:`flex flex-1 items-center justify-end gap-x-2`,children:[!e&&(0,h.jsxs)(n.t,{className:`w-8 sm:w-fit`,onClick:()=>u(!0),children:[(0,h.jsx)(g.LogInIcon,{}),(0,h.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:`Đăng nhập`})]}),e&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(G,{userName:t,userEmail:r,onLogout:a}),(0,h.jsx)(o.t,{orientation:`vertical`,className:`min-h-6 w-px`}),(0,h.jsx)(K,{})]})]}),s&&(0,h.jsx)(c.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(c.r,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,h.jsx)(c.o,{className:`flex-0 gap-2 p-6`,children:(0,h.jsx)(c.l,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,h.jsx)(c.a,{className:`p-2`})]})}),!s&&(0,h.jsx)(d.t,{open:l,onOpenChange:u,children:(0,h.jsxs)(d.r,{children:[(0,h.jsx)(d.o,{className:`text-left`,children:(0,h.jsx)(d.l,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),(0,h.jsx)(d.a,{})]})})]})},J=({children:e,...t})=>{let{isLoggedIn:n}=T();return n?(0,h.jsx)(j,{variant:`inset`,collapsible:`icon`,...t,children:e}):null},Y=({children:e})=>{let{isLoggedIn:t,onGoogleLoginSuccess:r}=T(),i=(0,x.useMediaQuery)(`(min-width: 640px)`),[a,o]=(0,_.useState)(!1);return t?(0,h.jsx)(N,{children:(0,h.jsx)(`section`,{className:`relative size-full`,children:(0,h.jsx)(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}):(0,h.jsx)(`div`,{className:`size-full p-4 pt-[calc(var(--header-height)+1.5rem)]`,children:(0,h.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-6 rounded-lg bg-card p-8 text-center shadow-card`,children:[(0,h.jsx)(`div`,{className:`flex size-20 items-center justify-center rounded-full bg-muted-foreground/10`,children:(0,h.jsx)(g.LockIcon,{className:`size-10 text-primary`})}),(0,h.jsxs)(`div`,{className:`flex max-w-md flex-col gap-2`,children:[(0,h.jsx)(`h2`,{className:`font-semibold text-2xl`,children:`Bạn chưa đăng nhập`}),(0,h.jsx)(`p`,{className:`text-text-positive-weak`,children:`Đăng nhập để khám phá đầy đủ các tính năng của Lunas Store và truy cập vào tài khoản của bạn.`})]}),(0,h.jsxs)(n.t,{size:`lg`,className:`gap-2`,onClick:()=>o(!0),children:[(0,h.jsx)(g.LogInIcon,{size:18}),(0,h.jsx)(`span`,{children:`Đăng nhập ngay`})]}),i&&(0,h.jsx)(c.t,{open:a,onOpenChange:o,children:(0,h.jsxs)(c.r,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[(0,h.jsx)(c.o,{className:`flex-0 gap-2 p-6`,children:(0,h.jsx)(c.l,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),(0,h.jsx)(c.a,{className:`p-2`})]})}),!i&&(0,h.jsx)(d.t,{open:a,onOpenChange:o,children:(0,h.jsxs)(d.r,{children:[(0,h.jsx)(d.o,{className:`text-left`,children:(0,h.jsx)(d.l,{children:`Chào mừng bạn đến với Lunas Store!`})}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-y-1`,children:[(0,h.jsx)(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),(0,h.jsx)(S.GoogleLogin,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),(0,h.jsx)(d.a,{})]})})]})})},X=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-header`,className:(0,m.cn)(`flex-0 snap-start`,e),children:t}),Z=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-content`,className:(0,m.cn)(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),Q=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-footer`,className:(0,m.cn)(`hidden w-full flex-0 border-border-weak border-t pt-2 sm:flex`,e),children:t}),$=({children:e,className:t})=>(0,h.jsx)(`div`,{"data-slot":`main-group`,className:(0,m.cn)(`flex size-full flex-col gap-4`,t),children:e}),oe=({className:e,children:t})=>(0,h.jsx)(`div`,{"data-slot":`main-group-content`,className:(0,m.cn)(`size-full max-w-8xl flex-1 rounded-md bg-card p-4 shadow-card`,e),children:t});exports.ServiceLayoutCartInfo=K,exports.ServiceLayoutHeader=q,exports.ServiceLayoutMain=Y,exports.ServiceLayoutMainContent=Z,exports.ServiceLayoutMainFooter=Q,exports.ServiceLayoutMainGroup=$,exports.ServiceLayoutMainGroupContent=oe,exports.ServiceLayoutMainHeader=X,exports.ServiceLayoutProvider=U,exports.ServiceLayoutSidebar=J,exports.ServiceLayoutSidebarContent=F,exports.ServiceLayoutSidebarFooter=P,exports.ServiceLayoutSidebarGroup=I,exports.ServiceLayoutSidebarGroupContent=R,exports.ServiceLayoutSidebarGroupLabel=L,exports.ServiceLayoutSidebarMenu=z,exports.ServiceLayoutSidebarMenuButton=H,exports.ServiceLayoutSidebarMenuItem=B,exports.ServiceLayoutUserInfo=G,exports.ServiceLayoutWrapper=W;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as TooltipContent } from "../../tooltip-
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
1
|
+
import { n as TooltipContent } from "../../tooltip-CVLw9F2s.cjs";
|
|
2
|
+
import * as react_jsx_runtime313 from "react/jsx-runtime";
|
|
3
|
+
import * as class_variance_authority_types13 from "class-variance-authority/types";
|
|
4
4
|
import { VariantProps } from "class-variance-authority";
|
|
5
5
|
import { CredentialResponse } from "@react-oauth/google";
|
|
6
6
|
|
|
@@ -43,43 +43,43 @@ declare function ServiceLayoutSidebar$1({
|
|
|
43
43
|
side?: 'left' | 'right';
|
|
44
44
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
45
45
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
46
|
-
}):
|
|
46
|
+
}): react_jsx_runtime313.JSX.Element;
|
|
47
47
|
declare function ServiceLayoutSidebarFooter({
|
|
48
48
|
className,
|
|
49
49
|
children,
|
|
50
50
|
...props
|
|
51
|
-
}: React.ComponentProps<'div'>):
|
|
51
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime313.JSX.Element;
|
|
52
52
|
declare function ServiceLayoutSidebarContent({
|
|
53
53
|
className,
|
|
54
54
|
...props
|
|
55
|
-
}: React.ComponentProps<'div'>):
|
|
55
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime313.JSX.Element;
|
|
56
56
|
declare function ServiceLayoutSidebarGroup({
|
|
57
57
|
className,
|
|
58
58
|
...props
|
|
59
|
-
}: React.ComponentProps<'div'>):
|
|
59
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime313.JSX.Element;
|
|
60
60
|
declare function ServiceLayoutSidebarGroupLabel({
|
|
61
61
|
className,
|
|
62
62
|
asChild,
|
|
63
63
|
...props
|
|
64
64
|
}: React.ComponentProps<'div'> & {
|
|
65
65
|
asChild?: boolean;
|
|
66
|
-
}):
|
|
66
|
+
}): react_jsx_runtime313.JSX.Element;
|
|
67
67
|
declare function ServiceLayoutSidebarGroupContent({
|
|
68
68
|
className,
|
|
69
69
|
...props
|
|
70
|
-
}: React.ComponentProps<'div'>):
|
|
70
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime313.JSX.Element;
|
|
71
71
|
declare function ServiceLayoutSidebarMenu({
|
|
72
72
|
className,
|
|
73
73
|
...props
|
|
74
|
-
}: React.ComponentProps<'ul'>):
|
|
74
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime313.JSX.Element;
|
|
75
75
|
declare function ServiceLayoutSidebarMenuItem({
|
|
76
76
|
className,
|
|
77
77
|
...props
|
|
78
|
-
}: React.ComponentProps<'li'>):
|
|
78
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime313.JSX.Element;
|
|
79
79
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
80
80
|
variant?: "default" | "outline" | null | undefined;
|
|
81
81
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
82
|
-
} &
|
|
82
|
+
} & class_variance_authority_types13.ClassProp) | undefined) => string;
|
|
83
83
|
declare function ServiceLayoutSidebarMenuButton({
|
|
84
84
|
asChild,
|
|
85
85
|
isActive,
|
|
@@ -92,7 +92,7 @@ declare function ServiceLayoutSidebarMenuButton({
|
|
|
92
92
|
asChild?: boolean;
|
|
93
93
|
isActive?: boolean;
|
|
94
94
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
95
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
95
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime313.JSX.Element;
|
|
96
96
|
//#endregion
|
|
97
97
|
//#region packages/components/layouts/service-layout/service-layout.d.ts
|
|
98
98
|
declare const ServiceLayoutProvider: React.FC<React.PropsWithChildren<ServiceLayoutContextProps>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "../../button-
|
|
2
|
-
import "../../separator-
|
|
3
|
-
import { n as TooltipContent } from "../../tooltip-
|
|
4
|
-
import * as
|
|
1
|
+
import "../../button-BVyGOvsM.mjs";
|
|
2
|
+
import "../../separator-DVJtN08T.mjs";
|
|
3
|
+
import { n as TooltipContent } from "../../tooltip-Cu2-ZHAv.mjs";
|
|
4
|
+
import * as react_jsx_runtime291 from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import { VariantProps } from "class-variance-authority";
|
|
7
7
|
import { CredentialResponse } from "@react-oauth/google";
|
|
8
|
-
import * as
|
|
8
|
+
import * as class_variance_authority_types14 from "class-variance-authority/types";
|
|
9
9
|
|
|
10
10
|
//#region packages/components/layouts/service-layout/hooks/use-service-layout.d.ts
|
|
11
11
|
type Cart = {
|
|
@@ -46,43 +46,43 @@ declare function ServiceLayoutSidebar$1({
|
|
|
46
46
|
side?: 'left' | 'right';
|
|
47
47
|
variant?: 'sidebar' | 'floating' | 'inset';
|
|
48
48
|
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
49
|
-
}):
|
|
49
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
50
50
|
declare function ServiceLayoutSidebarFooter({
|
|
51
51
|
className,
|
|
52
52
|
children,
|
|
53
53
|
...props
|
|
54
|
-
}: React.ComponentProps<'div'>):
|
|
54
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
55
55
|
declare function ServiceLayoutSidebarContent({
|
|
56
56
|
className,
|
|
57
57
|
...props
|
|
58
|
-
}: React.ComponentProps<'div'>):
|
|
58
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
59
59
|
declare function ServiceLayoutSidebarGroup({
|
|
60
60
|
className,
|
|
61
61
|
...props
|
|
62
|
-
}: React.ComponentProps<'div'>):
|
|
62
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
63
63
|
declare function ServiceLayoutSidebarGroupLabel({
|
|
64
64
|
className,
|
|
65
65
|
asChild,
|
|
66
66
|
...props
|
|
67
67
|
}: React.ComponentProps<'div'> & {
|
|
68
68
|
asChild?: boolean;
|
|
69
|
-
}):
|
|
69
|
+
}): react_jsx_runtime291.JSX.Element;
|
|
70
70
|
declare function ServiceLayoutSidebarGroupContent({
|
|
71
71
|
className,
|
|
72
72
|
...props
|
|
73
|
-
}: React.ComponentProps<'div'>):
|
|
73
|
+
}: React.ComponentProps<'div'>): react_jsx_runtime291.JSX.Element;
|
|
74
74
|
declare function ServiceLayoutSidebarMenu({
|
|
75
75
|
className,
|
|
76
76
|
...props
|
|
77
|
-
}: React.ComponentProps<'ul'>):
|
|
77
|
+
}: React.ComponentProps<'ul'>): react_jsx_runtime291.JSX.Element;
|
|
78
78
|
declare function ServiceLayoutSidebarMenuItem({
|
|
79
79
|
className,
|
|
80
80
|
...props
|
|
81
|
-
}: React.ComponentProps<'li'>):
|
|
81
|
+
}: React.ComponentProps<'li'>): react_jsx_runtime291.JSX.Element;
|
|
82
82
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
83
83
|
variant?: "default" | "outline" | null | undefined;
|
|
84
84
|
size?: "sm" | "lg" | "default" | null | undefined;
|
|
85
|
-
} &
|
|
85
|
+
} & class_variance_authority_types14.ClassProp) | undefined) => string;
|
|
86
86
|
declare function ServiceLayoutSidebarMenuButton({
|
|
87
87
|
asChild,
|
|
88
88
|
isActive,
|
|
@@ -95,7 +95,7 @@ declare function ServiceLayoutSidebarMenuButton({
|
|
|
95
95
|
asChild?: boolean;
|
|
96
96
|
isActive?: boolean;
|
|
97
97
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
98
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>):
|
|
98
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime291.JSX.Element;
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region packages/components/layouts/service-layout/service-layout.d.ts
|
|
101
101
|
declare const ServiceLayoutProvider: React.FC<React.PropsWithChildren<ServiceLayoutContextProps>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,t}from"../../card-CWAdGhMr.mjs";import"../../button.variants-DmUzMbB8.mjs";import{t as n}from"../../button-DIEXNBpi.mjs";import"../../skeleton-CvZncisJ.mjs";import{t as r}from"../../image-CbKDFah7.mjs";import{i,n as a,r as o,t as s}from"../../tooltip-BDaKTFKI.mjs";import{n as c,r as l,t as u}from"../../avatar-DCbv3HzU.mjs";import"../../close-BuQ2DHur.mjs";import{a as d,l as f,o as p,r as m,t as h}from"../../dialog-bd77jxcu.mjs";import{t as g}from"../../input-C1K2wbv1.mjs";import{t as _}from"../../separator-yTKDuMWb.mjs";import{c as v,i as y,o as b,r as x,s as S,t as C}from"../../sheet-BSeiP8S8.mjs";import{a as ee,h as te,o as ne,r as re,t as ie,u as ae}from"../../dropdown-menu-DPhbyDEo.mjs";import{a as w,l as T,o as oe,r as E,t as D}from"../../drawer-ClbO_Gt0.mjs";import{i as O,n as k,r as se,t as ce}from"../../tabs-XrUcxpL1.mjs";import{t as le}from"../../scroll-area-6xusEFm6.mjs";import{cn as A}from"@customafk/react-toolkit/utils";import{Fragment as ue,jsx as j,jsxs as M}from"react/jsx-runtime";import{LockIcon as de,LogInIcon as N,LogOutIcon as P,MenuIcon as fe,Minus as pe,Plus as me,ShoppingBag as he,ShoppingBasketIcon as ge,ShoppingCartIcon as F,Trash2 as _e,UserIcon as ve}from"lucide-react";import{createContext as I,use as L,useCallback as R,useEffect as z,useMemo as ye,useState as B}from"react";import{cva as be}from"class-variance-authority";import{Slot as V}from"radix-ui";import{useIsMobile as xe}from"@customafk/react-toolkit/hooks/useMobile";import{useMediaQuery as H}from"@customafk/react-toolkit/hooks/useMediaQuery";import{GoogleLogin as U}from"@react-oauth/google";import{useDebounceCallback as Se}from"@customafk/react-toolkit/hooks/useDebounceCallback";const W=I(null),G=()=>{let e=L(W);if(!e)throw Error(`useServiceLayoutContext must be used within a ServiceLayoutProvider`);return e},Ce=({id:i,type:a,productName:o,imageUrl:s,quantity:c,price:l,options:u})=>{let{onDeletingCart:d,onUpdatingCart:f}=G(),[p,m]=B(c),[h,_]=B(!1),v=Se(R(()=>{f?.(i,p,a)},[f,i,p,a]),500),y=R(e=>{e<1&&(e=1),e>99&&(e=99),m(e)},[]),b=R(async()=>{_(!0),await d?.(i),_(!1)},[i,d]);return z(()=>(p!==c&&v(),()=>{v.cancel()}),[p,c,v]),M(t,{className:`border-border-weak relative mb-3 overflow-x-auto border p-4 shadow-none`,children:[h&&j(`div`,{className:`bg-muted-muted/80 absolute inset-0 z-10 flex items-center justify-center`,children:j(`div`,{className:`loader-dots`})}),M(e,{className:`p-0`,children:[M(n,{variant:`ghost`,size:`icon`,color:`muted`,disabled:h,className:`text-text-positive-weak absolute top-2 right-2 z-10`,onClick:b,children:[j(_e,{className:`h-4 w-4`}),j(`span`,{className:`sr-only`,children:`Remove item`})]}),M(`div`,{className:`flex gap-3`,children:[j(`div`,{className:`relative size-20 flex-shrink-0`,children:s?j(r,{src:s,alt:o,className:`rounded-md border-none shadow-xs`,width:80,height:80}):j(`div`,{className:`bg-muted text-muted-foreground flex size-full items-center justify-center text-xs`,children:`No image`})}),M(`div`,{className:`flex flex-1 flex-col`,children:[j(`div`,{className:`flex justify-between`,children:j(`h3`,{className:`text-text-positive line-clamp-1 text-sm font-medium`,children:o})}),j(`p`,{className:`text-text-positive-weak mb-1 text-xs`,children:u.map((e,t)=>M(`span`,{children:[e.label,`: `,e.value,t<u.length-1&&`, `]},e.label))}),M(`div`,{className:`mt-auto flex items-center justify-between`,children:[M(`div`,{className:`flex items-center space-x-1`,children:[j(`button`,{disabled:p<=1,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>y(p-1),children:j(pe,{size:12})}),j(g,{value:p,onChange:e=>y(parseInt(e.target.value||`1`)),className:`border-border h-6.5 w-14 rounded-md border p-1 text-center text-sm`,min:1}),j(`button`,{disabled:p>=99,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>y(p+1),children:j(me,{size:12})})]}),M(`div`,{className:`text-sm font-semibold`,children:[(l*p).toLocaleString(),` ₫`]})]})]})]})]})]})},K=({items:e=[],cartType:t,className:r})=>{let i=e.reduce((e,t)=>e+t.price*t.quantity,0);return e.length===0?M(`div`,{className:A(`bg-muted-muted flex size-full max-h-80 flex-col items-center justify-center rounded-lg p-8`,r),children:[j(`div`,{className:`text-text-positive-weak bg-card shadow-card mb-4 flex size-20 items-center justify-center rounded-full text-5xl`,children:j(ge,{size:42,strokeWidth:1})}),M(`div`,{className:`flex flex-col space-y-1`,children:[j(`p`,{className:`text-text-positive text-center text-base font-semibold`,children:`Giỏ hàng trống`}),j(`p`,{className:`text-text-positive-weak mb-4 text-center text-sm`,children:t===`in_stock`?`Thêm sản phẩm có sẵn vào giỏ hàng của bạn!`:`Thêm sản phẩm đặt trước vào giỏ hàng của bạn!`})]})]}):M(`div`,{className:A(`flex h-full flex-col space-y-4 overflow-y-auto`,r),children:[j(le,{className:`h-full flex-1`,children:e.map(e=>j(Ce,{...e,type:t},e.id))}),M(`div`,{className:`flex-0 space-y-3`,children:[M(`div`,{className:`flex justify-between`,children:[j(`span`,{className:`text-text-positive-weak text-sm`,children:`Tạm tính:`}),M(`span`,{className:`text-sm`,children:[i.toLocaleString(),` ₫`]})]}),j(_,{}),M(`div`,{className:`flex justify-between`,children:[j(`span`,{className:`text-text-positive font-medium`,children:`Tổng cộng:`}),M(`span`,{className:`text-lg font-semibold`,children:[i.toLocaleString(),` ₫`]})]}),j(n,{className:`mt-2 w-full`,children:`Thanh toán ngay`}),t===`pre_order`&&j(`p`,{className:`text-text-positive-weak text-center text-xs italic`,children:`* Sản phẩm đặt trước sẽ được giao sau khi có hàng`})]})]})},q=I(null),J=()=>{let e=L(q);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e};function we({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...s}){let c=xe(),[l,u]=B(!1),[d,f]=B(e),p=t??d,m=R(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=R(()=>c?u(e=>!e):m(e=>!e),[c,m]);z(()=>{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`,_=ye(()=>({state:g,isMobile:c,toggleSidebar:h,open:p,setOpen:m,openMobile:l,setOpenMobile:u}),[g,p,m,c,l,h]);return j(q.Provider,{value:_,children:j(o,{delayDuration:0,children:j(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...i},className:A(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,r),...s,children:a})})})}function Te({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:l}=J();return n===`none`?j(`aside`,{"data-slot":`sidebar`,className:A(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?j(C,{open:c,onOpenChange:l,children:M(x,{side:`left`,"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":`16rem`},children:[M(b,{className:`sr-only`,children:[j(S,{children:`Sidebar`}),j(y,{children:`Displays the mobile sidebar.`})]}),M(`div`,{className:`flex size-full flex-col`,children:[M(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[j(Y,{}),j(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:j(F,{size:20})}),M(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[j(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),j(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),j(`div`,{className:`flex flex-1 flex-col p-2`,children:i})]})]})}):M(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[j(`div`,{"data-slot":`sidebar-gap`,className:A(`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)`)}),j(`div`,{"data-slot":`sidebar-container`,className:A(`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`,r),...a,children:j(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:A(`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:i})})]})}function Y({className:e,onClick:t,...r}){let{toggleSidebar:i}=J();return M(n,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:A(`size-10 rounded-full`,e),onClick:e=>{t?.(e),i()},...r,children:[j(fe,{className:`size-6!`}),j(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Ee({className:e,children:t,...n}){return M(`main`,{"data-slot":`sidebar-inset`,className:A(`relative flex w-full flex-1 flex-col`,e),...n,children:[j(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),j(`div`,{className:A(`inset-shadow-sm flex-1`),children:t})]})}function De({className:e,children:t,...n}){let{open:r}=J(),{onLogout:i}=G();return M(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:A(`flex flex-col gap-2`,e),...n,children:[t,M(X,{children:[j(Z,{children:M(Q,{className:`border border-border`,onClick:i,children:[j(P,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),r&&j(Z,{className:`mt-2 border-t border-t-border`,children:j(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})]})}function Oe({className:e,...t}){return j(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:A(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function ke({className:e,...t}){return j(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:A(`relative flex w-full min-w-0 flex-col`,e),...t})}function Ae({className:e,asChild:t=!1,...n}){return j(t?V.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:A(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-xs outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function je({className:e,...t}){return j(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:A(`w-full text-sm`,e),...t})}function X({className:e,...t}){return j(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:A(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function Z({className:e,...t}){return j(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:A(`group/menu-item relative`,e),...t})}const Me=be(`peer/menu-button.cursor-pointer.flex w-full items-center gap-2.overflow-hidden rounded-md p-2 outline-hidden.truncate text-left.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]:font-medium.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`.split(`.`),{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 Q({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:o,className:c,...l}){let u=e?V.Slot:`button`,{isMobile:d,state:f}=J(),p=j(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:A(Me({variant:n,size:r}),c),...l});return o?(typeof o==`string`&&(o={children:o}),M(s,{children:[j(i,{asChild:!0,children:p}),j(a,{side:`right`,align:`center`,hidden:f!==`collapsed`||d,...o})]})):p}const Ne=({isLoggedIn:e=!1,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c,children:l})=>j(W.Provider,{value:{isLoggedIn:e,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c},children:l}),Pe=({children:e})=>j(we,{children:e}),$=({userName:e=`Keith Kennedy`,userEmail:t=`k.kennedy@originui.com`,onLogout:r})=>M(ie,{children:[j(te,{asChild:!0,children:j(n,{size:`icon`,variant:`ghost`,color:`secondary`,className:`size-10 rounded-full`,children:M(u,{className:`size-10`,children:[j(l,{}),j(c,{className:`size-full bg-muted-muted`,children:j(ve,{})})]})})}),M(re,{align:`end`,className:`max-w-64`,children:[M(ne,{className:`flex min-w-0 flex-col`,children:[j(`span`,{className:`truncate font-medium text-sm text-text-positive`,children:e}),j(`span`,{className:`truncate font-normal text-text-positive-weak text-xs`,children:t})]}),j(ae,{}),M(ee,{onClick:r,children:[j(P,{size:16,"aria-hidden":`true`}),j(`span`,{className:`text-text-positive`,children:`Logout`})]})]})]}),Fe=()=>{let{inStockCarts:e=[],orderedCarts:t=[]}=G(),r=e.length,i=t.length,a=r+i;return M(C,{children:[j(v,{asChild:!0,children:j(n,{size:`icon`,variant:`ghost`,color:`secondary`,className:`relative size-10 rounded-full`,children:j(F,{})})}),M(x,{className:`w-[95vw] sm:max-w-md`,children:[j(b,{className:`flex-0 border-border-weak border-b pb-3`,children:M(S,{className:`flex items-center gap-2`,children:[j(he,{size:20}),j(`span`,{children:`Giỏ hàng của bạn`}),a>0&&M(`span`,{className:`font-normal text-sm text-text-positive-weak`,children:[`(`,a,` sản phẩm)`]})]})}),M(ce,{defaultValue:i>0?`pre_order`:`in_stock`,className:`h-full flex-1 overflow-y-auto p-4 pt-0`,children:[M(se,{className:`w-full flex-0`,children:[M(O,{value:`in_stock`,className:`relative`,children:[`Có sẵn`,r>0&&M(`span`,{children:[`(`,r,`)`]})]}),M(O,{value:`pre_order`,className:`relative`,children:[`Đặt trước`,i>0&&M(`span`,{children:[`(`,i,`)`]})]})]}),j(k,{value:`pre_order`,className:`flex-1 overflow-y-auto`,children:j(K,{items:t,cartType:`pre_order`})}),j(k,{value:`in_stock`,className:`flex-1 overflow-y-auto`,children:j(K,{items:e,cartType:`in_stock`})})]})]})]})},Ie=()=>{let{isLoggedIn:e,username:t,email:r,onGoogleLoginSuccess:i,onLogout:a}=G(),o=H(`(min-width: 640px)`),[s,c]=B(!1);return M(`header`,{className:A(`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:[e&&j(Y,{}),M(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[j(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:j(F,{size:20})}),M(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[j(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),j(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),M(`div`,{className:`flex flex-1 items-center justify-end gap-x-2`,children:[!e&&M(n,{className:`w-8 sm:w-fit`,onClick:()=>c(!0),children:[j(N,{}),j(`span`,{className:`sr-only sm:not-sr-only`,children:`Đăng nhập`})]}),e&&M(ue,{children:[j($,{userName:t,userEmail:r,onLogout:a}),j(_,{orientation:`vertical`,className:`min-h-6 w-px`}),j(Fe,{})]})]}),o&&j(h,{open:s,onOpenChange:c,children:M(m,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[j(p,{className:`flex-0 gap-2 p-6`,children:j(f,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),j(`div`,{className:`flex flex-1 flex-col`,children:j(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:M(`div`,{className:`flex flex-col items-center gap-y-1`,children:[j(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),j(U,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),j(d,{className:`p-2`})]})}),!o&&j(D,{open:s,onOpenChange:c,children:M(E,{children:[j(oe,{className:`text-left`,children:j(T,{children:`Chào mừng bạn đến với Lunas Store!`})}),j(`div`,{className:`flex flex-1 flex-col`,children:j(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:M(`div`,{className:`flex flex-col items-center gap-y-1`,children:[j(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),j(U,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),j(w,{})]})})]})},Le=({children:e,...t})=>{let{isLoggedIn:n}=G();return n?j(Te,{variant:`inset`,collapsible:`icon`,...t,children:e}):null},Re=({children:e})=>{let{isLoggedIn:t,onGoogleLoginSuccess:r}=G(),i=H(`(min-width: 640px)`),[a,o]=B(!1);return t?j(Ee,{children:j(`section`,{className:`relative size-full`,children:j(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}):j(`div`,{className:`size-full p-4 pt-[calc(var(--header-height)+1.5rem)]`,children:M(`div`,{className:`flex size-full flex-col items-center justify-center gap-6 rounded-lg bg-card p-8 text-center shadow-card`,children:[j(`div`,{className:`flex size-20 items-center justify-center rounded-full bg-muted-foreground/10`,children:j(de,{className:`size-10 text-primary`})}),M(`div`,{className:`flex max-w-md flex-col gap-2`,children:[j(`h2`,{className:`font-semibold text-2xl`,children:`Bạn chưa đăng nhập`}),j(`p`,{className:`text-text-positive-weak`,children:`Đăng nhập để khám phá đầy đủ các tính năng của Lunas Store và truy cập vào tài khoản của bạn.`})]}),M(n,{size:`lg`,className:`gap-2`,onClick:()=>o(!0),children:[j(N,{size:18}),j(`span`,{children:`Đăng nhập ngay`})]}),i&&j(h,{open:a,onOpenChange:o,children:M(m,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[j(p,{className:`flex-0 gap-2 p-6`,children:j(f,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),j(`div`,{className:`flex flex-1 flex-col`,children:j(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:M(`div`,{className:`flex flex-col items-center gap-y-1`,children:[j(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),j(U,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),j(d,{className:`p-2`})]})}),!i&&j(D,{open:a,onOpenChange:o,children:M(E,{children:[j(oe,{className:`text-left`,children:j(T,{children:`Chào mừng bạn đến với Lunas Store!`})}),j(`div`,{className:`flex flex-1 flex-col`,children:j(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:M(`div`,{className:`flex flex-col items-center gap-y-1`,children:[j(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),j(U,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),j(w,{})]})})]})})},ze=({className:e,children:t})=>j(`div`,{"data-slot":`main-header`,className:A(`flex-0 snap-start`,e),children:t}),Be=({className:e,children:t})=>j(`div`,{"data-slot":`main-content`,className:A(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),Ve=({className:e,children:t})=>j(`div`,{"data-slot":`main-footer`,className:A(`hidden w-full flex-0 border-border-weak border-t pt-2 sm:flex`,e),children:t}),He=({children:e,className:t})=>j(`div`,{"data-slot":`main-group`,className:A(`flex size-full flex-col gap-4`,t),children:e}),Ue=({className:e,children:t})=>j(`div`,{"data-slot":`main-group-content`,className:A(`size-full max-w-8xl flex-1 rounded-md bg-card p-4 shadow-card`,e),children:t});export{Fe as ServiceLayoutCartInfo,Ie as ServiceLayoutHeader,Re as ServiceLayoutMain,Be as ServiceLayoutMainContent,Ve as ServiceLayoutMainFooter,He as ServiceLayoutMainGroup,Ue as ServiceLayoutMainGroupContent,ze as ServiceLayoutMainHeader,Ne as ServiceLayoutProvider,Le as ServiceLayoutSidebar,Oe as ServiceLayoutSidebarContent,De as ServiceLayoutSidebarFooter,ke as ServiceLayoutSidebarGroup,je as ServiceLayoutSidebarGroupContent,Ae as ServiceLayoutSidebarGroupLabel,X as ServiceLayoutSidebarMenu,Q as ServiceLayoutSidebarMenuButton,Z as ServiceLayoutSidebarMenuItem,$ as ServiceLayoutUserInfo,Pe as ServiceLayoutWrapper};
|
|
1
|
+
import{r as e,t}from"../../card-CWAdGhMr.mjs";import"../../button.variants-DmUzMbB8.mjs";import{t as n}from"../../button-DIEXNBpi.mjs";import"../../skeleton-CvZncisJ.mjs";import{t as r}from"../../image-CbKDFah7.mjs";import{i,n as a,r as o,t as s}from"../../tooltip-BDaKTFKI.mjs";import{n as c,r as l,t as u}from"../../avatar-DCbv3HzU.mjs";import{t as d}from"../../separator-CZM2q-Ac.mjs";import{c as f,i as p,o as m,r as h,s as g,t as _}from"../../sheet-CUMpo5F_.mjs";import"../../close-CCf5pMYu.mjs";import{a as v,l as y,o as b,r as x,t as S}from"../../dialog-BbNb9Lr8.mjs";import{a as ee,h as te,o as ne,r as re,t as ie,u as ae}from"../../dropdown-menu-DsWYP0bL.mjs";import{t as oe}from"../../input-DD17n9Bv.mjs";import{a as C,l as se,o as w,r as T,t as E}from"../../drawer-272Fecsq.mjs";import{i as D,n as O,r as ce,t as le}from"../../tabs-Cjh2jtUZ.mjs";import{t as ue}from"../../scroll-area-CiMS2UY7.mjs";import{cn as k}from"@customafk/react-toolkit/utils";import{Fragment as de,jsx as A,jsxs as j}from"react/jsx-runtime";import{LockIcon as fe,LogInIcon as M,LogOutIcon as N,MenuIcon as pe,Minus as me,Plus as he,ShoppingBag as ge,ShoppingBasketIcon as _e,ShoppingCartIcon as P,Trash2 as ve,UserIcon as ye}from"lucide-react";import{createContext as F,use as I,useCallback as L,useEffect as R,useMemo as be,useState as z}from"react";import{cva as xe}from"class-variance-authority";import{Slot as B}from"radix-ui";import{useIsMobile as Se}from"@customafk/react-toolkit/hooks/useMobile";import{useMediaQuery as V}from"@customafk/react-toolkit/hooks/useMediaQuery";import{GoogleLogin as H}from"@react-oauth/google";import{useDebounceCallback as Ce}from"@customafk/react-toolkit/hooks/useDebounceCallback";const U=F(null),W=()=>{let e=I(U);if(!e)throw Error(`useServiceLayoutContext must be used within a ServiceLayoutProvider`);return e},we=({id:i,type:a,productName:o,imageUrl:s,quantity:c,price:l,options:u})=>{let{onDeletingCart:d,onUpdatingCart:f}=W(),[p,m]=z(c),[h,g]=z(!1),_=Ce(L(()=>{f?.(i,p,a)},[f,i,p,a]),500),v=L(e=>{e<1&&(e=1),e>99&&(e=99),m(e)},[]),y=L(async()=>{g(!0),await d?.(i),g(!1)},[i,d]);return R(()=>(p!==c&&_(),()=>{_.cancel()}),[p,c,_]),j(t,{className:`border-border-weak relative mb-3 overflow-x-auto border p-4 shadow-none`,children:[h&&A(`div`,{className:`bg-muted-muted/80 absolute inset-0 z-10 flex items-center justify-center`,children:A(`div`,{className:`loader-dots`})}),j(e,{className:`p-0`,children:[j(n,{variant:`ghost`,size:`icon`,color:`muted`,disabled:h,className:`text-text-positive-weak absolute top-2 right-2 z-10`,onClick:y,children:[A(ve,{className:`h-4 w-4`}),A(`span`,{className:`sr-only`,children:`Remove item`})]}),j(`div`,{className:`flex gap-3`,children:[A(`div`,{className:`relative size-20 flex-shrink-0`,children:s?A(r,{src:s,alt:o,className:`rounded-md border-none shadow-xs`,width:80,height:80}):A(`div`,{className:`bg-muted text-muted-foreground flex size-full items-center justify-center text-xs`,children:`No image`})}),j(`div`,{className:`flex flex-1 flex-col`,children:[A(`div`,{className:`flex justify-between`,children:A(`h3`,{className:`text-text-positive line-clamp-1 text-sm font-medium`,children:o})}),A(`p`,{className:`text-text-positive-weak mb-1 text-xs`,children:u.map((e,t)=>j(`span`,{children:[e.label,`: `,e.value,t<u.length-1&&`, `]},e.label))}),j(`div`,{className:`mt-auto flex items-center justify-between`,children:[j(`div`,{className:`flex items-center space-x-1`,children:[A(`button`,{disabled:p<=1,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>v(p-1),children:A(me,{size:12})}),A(oe,{value:p,onChange:e=>v(parseInt(e.target.value||`1`)),className:`border-border h-6.5 w-14 rounded-md border p-1 text-center text-sm`,min:1}),A(`button`,{disabled:p>=99,className:`border-border active:bg-muted-muted flex size-6 cursor-pointer items-center justify-center rounded-full border transition-all disabled:opacity-60`,onClick:()=>v(p+1),children:A(he,{size:12})})]}),j(`div`,{className:`text-sm font-semibold`,children:[(l*p).toLocaleString(),` ₫`]})]})]})]})]})]})},G=({items:e=[],cartType:t,className:r})=>{let i=e.reduce((e,t)=>e+t.price*t.quantity,0);return e.length===0?j(`div`,{className:k(`bg-muted-muted flex size-full max-h-80 flex-col items-center justify-center rounded-lg p-8`,r),children:[A(`div`,{className:`text-text-positive-weak bg-card shadow-card mb-4 flex size-20 items-center justify-center rounded-full text-5xl`,children:A(_e,{size:42,strokeWidth:1})}),j(`div`,{className:`flex flex-col space-y-1`,children:[A(`p`,{className:`text-text-positive text-center text-base font-semibold`,children:`Giỏ hàng trống`}),A(`p`,{className:`text-text-positive-weak mb-4 text-center text-sm`,children:t===`in_stock`?`Thêm sản phẩm có sẵn vào giỏ hàng của bạn!`:`Thêm sản phẩm đặt trước vào giỏ hàng của bạn!`})]})]}):j(`div`,{className:k(`flex h-full flex-col space-y-4 overflow-y-auto`,r),children:[A(ue,{className:`h-full flex-1`,children:e.map(e=>A(we,{...e,type:t},e.id))}),j(`div`,{className:`flex-0 space-y-3`,children:[j(`div`,{className:`flex justify-between`,children:[A(`span`,{className:`text-text-positive-weak text-sm`,children:`Tạm tính:`}),j(`span`,{className:`text-sm`,children:[i.toLocaleString(),` ₫`]})]}),A(d,{}),j(`div`,{className:`flex justify-between`,children:[A(`span`,{className:`text-text-positive font-medium`,children:`Tổng cộng:`}),j(`span`,{className:`text-lg font-semibold`,children:[i.toLocaleString(),` ₫`]})]}),A(n,{className:`mt-2 w-full`,children:`Thanh toán ngay`}),t===`pre_order`&&A(`p`,{className:`text-text-positive-weak text-center text-xs italic`,children:`* Sản phẩm đặt trước sẽ được giao sau khi có hàng`})]})]})},K=F(null),q=()=>{let e=I(K);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e};function Te({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...s}){let c=Se(),[l,u]=z(!1),[d,f]=z(e),p=t??d,m=L(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=L(()=>c?u(e=>!e):m(e=>!e),[c,m]);R(()=>{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`,_=be(()=>({state:g,isMobile:c,toggleSidebar:h,open:p,setOpen:m,openMobile:l,setOpenMobile:u}),[g,p,m,c,l,h]);return A(K.Provider,{value:_,children:A(o,{delayDuration:0,children:A(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...i},className:k(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex h-dvh w-full`,r),...s,children:a})})})}function Ee({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:l}=q();return n===`none`?A(`aside`,{"data-slot":`sidebar`,className:k(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?A(_,{open:c,onOpenChange:l,children:j(h,{side:`left`,"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":`16rem`},children:[j(m,{className:`sr-only`,children:[A(g,{children:`Sidebar`}),A(p,{children:`Displays the mobile sidebar.`})]}),j(`div`,{className:`flex size-full flex-col`,children:[j(`div`,{className:`flex flex-0 items-center gap-x-2 border-border-weak border-b p-2 pr-4`,children:[A(J,{}),A(`div`,{className:`ml-2 flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:A(P,{size:20})}),j(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[A(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),A(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),A(`div`,{className:`flex flex-1 flex-col p-2`,children:i})]})]})}):j(`aside`,{className:`group peer hidden bg-card text-sidebar-foreground md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[A(`div`,{"data-slot":`sidebar-gap`,className:k(`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)`)}),A(`div`,{"data-slot":`sidebar-container`,className:k(`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`,r),...a,children:A(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:k(`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:i})})]})}function J({className:e,onClick:t,...r}){let{toggleSidebar:i}=q();return j(n,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,color:`muted`,size:`icon`,className:k(`size-10 rounded-full`,e),onClick:e=>{t?.(e),i()},...r,children:[A(pe,{className:`size-6!`}),A(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function De({className:e,children:t,...n}){return j(`main`,{"data-slot":`sidebar-inset`,className:k(`relative flex w-full flex-1 flex-col`,e),...n,children:[A(`div`,{className:`h-(--header-height) w-full sm:h-[calc(var(--header-height)+0.5rem)]`}),A(`div`,{className:k(`inset-shadow-sm flex-1`),children:t})]})}function Oe({className:e,children:t,...n}){let{open:r}=q(),{onLogout:i}=W();return j(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:k(`flex flex-col gap-2`,e),...n,children:[t,j(Y,{children:[A(X,{children:j(Z,{className:`border border-border`,onClick:i,children:[A(N,{className:`text-text-positive-weak`}),`Đăng xuất`]})}),r&&A(X,{className:`mt-2 border-t border-t-border`,children:A(`p`,{className:`pt-2 text-center text-muted-foreground text-xs`,children:`Copyright © 2025, Lunas.`})})]})]})}function ke({className:e,...t}){return A(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:k(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function Ae({className:e,...t}){return A(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:k(`relative flex w-full min-w-0 flex-col`,e),...t})}function je({className:e,asChild:t=!1,...n}){return A(t?B.Slot:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:k(`flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-xs outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2`,`text-sidebar-foreground/70`,`ring-sidebar-ring`,`[&>svg]:size-4`,`[&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8`,`group-data-[collapsible=icon]:opacity-0`,e),...n})}function Me({className:e,...t}){return A(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:k(`w-full text-sm`,e),...t})}function Y({className:e,...t}){return A(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:k(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function X({className:e,...t}){return A(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:k(`group/menu-item relative`,e),...t})}const Ne=xe(`peer/menu-button.cursor-pointer.flex w-full items-center gap-2.overflow-hidden rounded-md p-2 outline-hidden.truncate text-left.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]:font-medium.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`.split(`.`),{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 Z({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:o,className:c,...l}){let u=e?B.Slot:`button`,{isMobile:d,state:f}=q(),p=A(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:k(Ne({variant:n,size:r}),c),...l});return o?(typeof o==`string`&&(o={children:o}),j(s,{children:[A(i,{asChild:!0,children:p}),A(a,{side:`right`,align:`center`,hidden:f!==`collapsed`||d,...o})]})):p}const Pe=({isLoggedIn:e=!1,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c,children:l})=>A(U.Provider,{value:{isLoggedIn:e,username:t,email:n,inStockCarts:r,orderedCarts:i,onGoogleLoginSuccess:a,onUpdatingCart:o,onDeletingCart:s,onLogout:c},children:l}),Fe=({children:e})=>A(Te,{children:e}),Q=({userName:e=`Keith Kennedy`,userEmail:t=`k.kennedy@originui.com`,onLogout:r})=>j(ie,{children:[A(te,{asChild:!0,children:A(n,{size:`icon`,variant:`ghost`,color:`secondary`,className:`size-10 rounded-full`,children:j(u,{className:`size-10`,children:[A(l,{}),A(c,{className:`size-full bg-muted-muted`,children:A(ye,{})})]})})}),j(re,{align:`end`,className:`max-w-64`,children:[j(ne,{className:`flex min-w-0 flex-col`,children:[A(`span`,{className:`truncate font-medium text-sm text-text-positive`,children:e}),A(`span`,{className:`truncate font-normal text-text-positive-weak text-xs`,children:t})]}),A(ae,{}),j(ee,{onClick:r,children:[A(N,{size:16,"aria-hidden":`true`}),A(`span`,{className:`text-text-positive`,children:`Logout`})]})]})]}),$=()=>{let{inStockCarts:e=[],orderedCarts:t=[]}=W(),r=e.length,i=t.length,a=r+i;return j(_,{children:[A(f,{asChild:!0,children:A(n,{size:`icon`,variant:`ghost`,color:`secondary`,className:`relative size-10 rounded-full`,children:A(P,{})})}),j(h,{className:`w-[95vw] sm:max-w-md`,children:[A(m,{className:`flex-0 border-border-weak border-b pb-3`,children:j(g,{className:`flex items-center gap-2`,children:[A(ge,{size:20}),A(`span`,{children:`Giỏ hàng của bạn`}),a>0&&j(`span`,{className:`font-normal text-sm text-text-positive-weak`,children:[`(`,a,` sản phẩm)`]})]})}),j(le,{defaultValue:i>0?`pre_order`:`in_stock`,className:`h-full flex-1 overflow-y-auto p-4 pt-0`,children:[j(ce,{className:`w-full flex-0`,children:[j(D,{value:`in_stock`,className:`relative`,children:[`Có sẵn`,r>0&&j(`span`,{children:[`(`,r,`)`]})]}),j(D,{value:`pre_order`,className:`relative`,children:[`Đặt trước`,i>0&&j(`span`,{children:[`(`,i,`)`]})]})]}),A(O,{value:`pre_order`,className:`flex-1 overflow-y-auto`,children:A(G,{items:t,cartType:`pre_order`})}),A(O,{value:`in_stock`,className:`flex-1 overflow-y-auto`,children:A(G,{items:e,cartType:`in_stock`})})]})]})]})},Ie=()=>{let{isLoggedIn:e,username:t,email:r,onGoogleLoginSuccess:i,onLogout:a}=W(),o=V(`(min-width: 640px)`),[s,c]=z(!1);return j(`header`,{className:k(`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:[e&&A(J,{}),j(`div`,{className:`flex gap-x-2 sm:ml-2.5`,children:[A(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:A(P,{size:20})}),j(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[A(`span`,{className:`truncate font-medium`,children:`Lunas Store`}),A(`span`,{className:`truncate text-xs`,children:`Established 2023`})]})]}),j(`div`,{className:`flex flex-1 items-center justify-end gap-x-2`,children:[!e&&j(n,{className:`w-8 sm:w-fit`,onClick:()=>c(!0),children:[A(M,{}),A(`span`,{className:`sr-only sm:not-sr-only`,children:`Đăng nhập`})]}),e&&j(de,{children:[A(Q,{userName:t,userEmail:r,onLogout:a}),A(d,{orientation:`vertical`,className:`min-h-6 w-px`}),A($,{})]})]}),o&&A(S,{open:s,onOpenChange:c,children:j(x,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[A(b,{className:`flex-0 gap-2 p-6`,children:A(y,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),A(`div`,{className:`flex flex-1 flex-col`,children:A(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:j(`div`,{className:`flex flex-col items-center gap-y-1`,children:[A(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),A(H,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),A(v,{className:`p-2`})]})}),!o&&A(E,{open:s,onOpenChange:c,children:j(T,{children:[A(w,{className:`text-left`,children:A(se,{children:`Chào mừng bạn đến với Lunas Store!`})}),A(`div`,{className:`flex flex-1 flex-col`,children:A(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:j(`div`,{className:`flex flex-col items-center gap-y-1`,children:[A(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),A(H,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||await i?.(e)}})]})})}),A(C,{})]})})]})},Le=({children:e,...t})=>{let{isLoggedIn:n}=W();return n?A(Ee,{variant:`inset`,collapsible:`icon`,...t,children:e}):null},Re=({children:e})=>{let{isLoggedIn:t,onGoogleLoginSuccess:r}=W(),i=V(`(min-width: 640px)`),[a,o]=z(!1);return t?A(De,{children:A(`section`,{className:`relative size-full`,children:A(`div`,{className:`absolute inset-0 flex flex-col`,children:e})})}):A(`div`,{className:`size-full p-4 pt-[calc(var(--header-height)+1.5rem)]`,children:j(`div`,{className:`flex size-full flex-col items-center justify-center gap-6 rounded-lg bg-card p-8 text-center shadow-card`,children:[A(`div`,{className:`flex size-20 items-center justify-center rounded-full bg-muted-foreground/10`,children:A(fe,{className:`size-10 text-primary`})}),j(`div`,{className:`flex max-w-md flex-col gap-2`,children:[A(`h2`,{className:`font-semibold text-2xl`,children:`Bạn chưa đăng nhập`}),A(`p`,{className:`text-text-positive-weak`,children:`Đăng nhập để khám phá đầy đủ các tính năng của Lunas Store và truy cập vào tài khoản của bạn.`})]}),j(n,{size:`lg`,className:`gap-2`,onClick:()=>o(!0),children:[A(M,{size:18}),A(`span`,{children:`Đăng nhập ngay`})]}),i&&A(S,{open:a,onOpenChange:o,children:j(x,{showCloseButton:!1,className:`flex flex-col gap-0 border-none p-0 sm:max-w-sm`,children:[A(b,{className:`flex-0 gap-2 p-6`,children:A(y,{className:`text-center`,children:`Chào mừng bạn đến với Lunas Store!`})}),A(`div`,{className:`flex flex-1 flex-col`,children:A(`main`,{className:`size-full flex-1 bg-card p-4 pt-0`,children:j(`div`,{className:`flex flex-col items-center gap-y-1`,children:[A(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),A(H,{size:`large`,theme:`outline`,width:240,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),A(v,{className:`p-2`})]})}),!i&&A(E,{open:a,onOpenChange:o,children:j(T,{children:[A(w,{className:`text-left`,children:A(se,{children:`Chào mừng bạn đến với Lunas Store!`})}),A(`div`,{className:`flex flex-1 flex-col`,children:A(`main`,{className:`flex size-full flex-1 flex-col p-4 pt-0`,children:j(`div`,{className:`flex flex-col items-center gap-y-1`,children:[A(`p`,{className:`text-sm text-text-positive-weak`,children:`Đăng nhập với Google`}),A(H,{size:`large`,theme:`outline`,onSuccess:async e=>{!e.clientId||!e.credential||!e.select_by||(await r?.(e),o(!1))}})]})})}),A(C,{})]})})]})})},ze=({className:e,children:t})=>A(`div`,{"data-slot":`main-header`,className:k(`flex-0 snap-start`,e),children:t}),Be=({className:e,children:t})=>A(`div`,{"data-slot":`main-content`,className:k(`flex w-full flex-1 flex-col gap-4 overflow-y-auto px-2 sm:px-4`,e),children:t}),Ve=({className:e,children:t})=>A(`div`,{"data-slot":`main-footer`,className:k(`hidden w-full flex-0 border-border-weak border-t pt-2 sm:flex`,e),children:t}),He=({children:e,className:t})=>A(`div`,{"data-slot":`main-group`,className:k(`flex size-full flex-col gap-4`,t),children:e}),Ue=({className:e,children:t})=>A(`div`,{"data-slot":`main-group-content`,className:k(`size-full max-w-8xl flex-1 rounded-md bg-card p-4 shadow-card`,e),children:t});export{$ as ServiceLayoutCartInfo,Ie as ServiceLayoutHeader,Re as ServiceLayoutMain,Be as ServiceLayoutMainContent,Ve as ServiceLayoutMainFooter,He as ServiceLayoutMainGroup,Ue as ServiceLayoutMainGroupContent,ze as ServiceLayoutMainHeader,Pe as ServiceLayoutProvider,Le as ServiceLayoutSidebar,ke as ServiceLayoutSidebarContent,Oe as ServiceLayoutSidebarFooter,Ae as ServiceLayoutSidebarGroup,Me as ServiceLayoutSidebarGroupContent,je as ServiceLayoutSidebarGroupLabel,Y as ServiceLayoutSidebarMenu,Z as ServiceLayoutSidebarMenuButton,X as ServiceLayoutSidebarMenuItem,Q as ServiceLayoutUserInfo,Fe as ServiceLayoutWrapper};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|