@billgangcom/theme-lib 1.26.0 → 1.27.0
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/App.d.ts +1 -1
- package/dist/abstractions/Variable.d.ts +4 -1
- package/dist/{components → builder/components}/Sidebar/AddSections/RenderBlockSettings/settings.d.ts +1 -1
- package/dist/{constants → builder/constants}/blocks.d.ts +1 -1
- package/dist/{store → builder/store}/useBlocksStore.d.ts +1 -1
- package/dist/{store → builder/store}/useDeviceStore.d.ts +1 -1
- package/dist/{store → builder/store}/useLayersStore.d.ts +1 -1
- package/dist/{store → builder/store}/useLayoutStore.d.ts +1 -1
- package/dist/{store → builder/store}/useNavbarStore.d.ts +1 -1
- package/dist/{store → builder/store}/useNotificationStore.d.ts +1 -1
- package/dist/{store → builder/store}/usePagesStore.d.ts +2 -2
- package/dist/{store → builder/store}/useSettingsStore.d.ts +1 -1
- package/dist/{store → builder/store}/useThemeSettingsStore.d.ts +1 -1
- package/dist/{shared → builder}/ui/Icon/index.d.ts +1 -1
- package/dist/{shared → builder}/ui/Picker/index.d.ts +1 -1
- package/dist/builder/ui/index.d.ts +6 -0
- package/dist/{shared/lib → builder/utils}/api.d.ts +9 -25
- package/dist/builder/utils/index.d.ts +2 -0
- package/dist/builder.cjs.js +8 -8
- package/dist/builder.es.js +1274 -1060
- package/dist/{index-CeRgFjoD.js → index-BJq5RiR5.js} +10036 -10260
- package/dist/index-BlxXgV9a.cjs +146 -0
- package/dist/lib/api.d.ts +16 -0
- package/dist/{shared/lib → lib}/index.d.ts +0 -1
- package/dist/ui/Button/index.d.ts +13 -0
- package/dist/ui/ButtonsSettings/index.d.ts +1 -1
- package/dist/ui/Input/index.d.ts +21 -0
- package/dist/ui/ListingSelector/index.d.ts +8 -3
- package/dist/ui/ListingSelector/popup.d.ts +11 -4
- package/dist/ui/Textarea/index.d.ts +11 -0
- package/dist/ui/index.d.ts +7 -2
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1038 -880
- package/package.json +1 -1
- package/dist/index-ChU5WGPr.cjs +0 -146
- package/dist/shared/ui/index.d.ts +0 -16
- /package/dist/{components → builder/components}/Header/Buttons/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/Devices/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/PreviewButton/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/Settings/Language/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/Settings/Pages/ModifyPage/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/Settings/Pages/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/Settings/Zoom/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/Settings/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/SwitchTheme/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Header/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Navbar/ExitButton/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Navbar/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Preview/PreviewBlockSidebar/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Preview/PreviewContent/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Preview/PreviewHeader/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Preview/Render/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Preview/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/AddSections/RenderBlockSettings/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/AddSections/SearchSections/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/AddSections/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Layers/FooterLayer/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Layers/HeaderLayer/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Layers/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Settings/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/ThemeSettings/Colors/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/ThemeSettings/Fonts/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/ThemeSettings/Inputs/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/ThemeSettings/Item/Border/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/ThemeSettings/Item/Button/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/ThemeSettings/Item/Font/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/ThemeSettings/Item/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/ThemeSettings/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/Theme/index.d.ts +0 -0
- /package/dist/{components → builder/components}/Sidebar/index.d.ts +0 -0
- /package/dist/{components → builder/components}/index.d.ts +0 -0
- /package/dist/{components → builder/components}/layout.d.ts +0 -0
- /package/dist/{constants → builder/constants}/api.d.ts +0 -0
- /package/dist/{constants → builder/constants}/device.d.ts +0 -0
- /package/dist/{constants → builder/constants}/font.d.ts +0 -0
- /package/dist/{constants → builder/constants}/icon.d.ts +0 -0
- /package/dist/{constants → builder/constants}/index.d.ts +0 -0
- /package/dist/{constants → builder/constants}/navbar.d.ts +0 -0
- /package/dist/{constants → builder/constants}/notification.d.ts +0 -0
- /package/dist/{constants → builder/constants}/pages.d.ts +0 -0
- /package/dist/{constants → builder/constants}/theme-settings.d.ts +0 -0
- /package/dist/{store → builder/store}/index.d.ts +0 -0
- /package/dist/{store → builder/store}/useChooseImageStore.d.ts +0 -0
- /package/dist/{store → builder/store}/useColorPickerStore.d.ts +0 -0
- /package/dist/{store → builder/store}/useFontsStore.d.ts +0 -0
- /package/dist/{store → builder/store}/useHistoryState.d.ts +0 -0
- /package/dist/{store → builder/store}/usePreviewStore.d.ts +0 -0
- /package/dist/{store → builder/store}/useShareLinkStore.d.ts +0 -0
- /package/dist/{store → builder/store}/useSubmodalStore.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Button/index.d.ts +0 -0
- /package/dist/{ui → builder/ui}/ChooseImage/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/ColorPicker/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/ColorPicker/modal.d.ts +0 -0
- /package/dist/{shared → builder}/ui/ErrorableBlock/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Input/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Loader/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Modal/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Radio/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Select/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Submodal/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Switch/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Textarea/index.d.ts +0 -0
- /package/dist/{shared → builder}/ui/Tip/index.d.ts +0 -0
- /package/dist/{shared/lib → builder/utils}/formatLabel.d.ts +0 -0
- /package/dist/{shared/lib → lib}/checkAuth.d.ts +0 -0
- /package/dist/{shared/lib → lib}/clearQueryParams.d.ts +0 -0
- /package/dist/{shared/lib → lib}/generateDynamicStyles.d.ts +0 -0
- /package/dist/{shared/lib → lib}/getDynamicRoutes.d.ts +0 -0
- /package/dist/{shared/lib → lib}/injectStylesToDOM.d.ts +0 -0
- /package/dist/{shared/ui → ui}/Accordion/index.d.ts +0 -0
- /package/dist/{shared/ui → ui}/Checkbox/index.d.ts +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const getImages: () => Promise<{
|
|
2
|
+
data: any;
|
|
3
|
+
status: number;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const updateImages: (formData: FormData) => Promise<{
|
|
6
|
+
data: any;
|
|
7
|
+
status: number;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getDynamicPage: (route: string) => Promise<{
|
|
10
|
+
data: any;
|
|
11
|
+
status: number;
|
|
12
|
+
} | null>;
|
|
13
|
+
export declare const getThemeAndSettings: () => Promise<{
|
|
14
|
+
data: any;
|
|
15
|
+
status: number;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Size = 's' | 'm' | 'l';
|
|
2
|
+
export type TypeButton = 'Primary' | 'Secondary' | 'Tertiary';
|
|
3
|
+
interface Props {
|
|
4
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
size?: Size;
|
|
10
|
+
type?: TypeButton;
|
|
11
|
+
}
|
|
12
|
+
export declare const Button: React.FC<Props>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from '../../builder/ui';
|
|
3
|
+
interface Props {
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
label?: string;
|
|
8
|
+
value: string;
|
|
9
|
+
type?: 'text' | 'number';
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
regex?: string;
|
|
15
|
+
paddingless?: boolean;
|
|
16
|
+
borderless?: boolean;
|
|
17
|
+
editable?: boolean;
|
|
18
|
+
isSearch?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const Input: React.FC<Props>;
|
|
21
|
+
export { Icon };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Other } from '../OtherSettings';
|
|
2
|
-
import { Listing } from '../../abstractions';
|
|
3
2
|
export interface ProductData {
|
|
4
3
|
id: number;
|
|
5
4
|
link: {
|
|
@@ -77,8 +76,14 @@ export type ListingData<T extends 'GROUP' | 'PRODUCT' | 'POST' = 'PRODUCT'> = T
|
|
|
77
76
|
interface Props {
|
|
78
77
|
isActiveItems?: boolean;
|
|
79
78
|
setIsActiveItems?: (value: boolean) => void;
|
|
80
|
-
items:
|
|
81
|
-
|
|
79
|
+
items: {
|
|
80
|
+
listingId: number;
|
|
81
|
+
image: string;
|
|
82
|
+
}[];
|
|
83
|
+
setItems: (value: {
|
|
84
|
+
listingId: number;
|
|
85
|
+
image: string;
|
|
86
|
+
}[]) => void;
|
|
82
87
|
title?: string;
|
|
83
88
|
subtitle?: string;
|
|
84
89
|
editable?: boolean;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListingData } from '.';
|
|
2
2
|
interface Props {
|
|
3
|
-
activeItem:
|
|
4
|
-
|
|
3
|
+
activeItem: {
|
|
4
|
+
listingId: number;
|
|
5
|
+
image: string;
|
|
6
|
+
};
|
|
7
|
+
setActiveItem: (value: {
|
|
8
|
+
listingId: number;
|
|
9
|
+
image: string;
|
|
10
|
+
} | null) => void;
|
|
5
11
|
setIsOpenModal: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
12
|
popupPosition: {
|
|
7
13
|
top: number;
|
|
8
14
|
left: number;
|
|
9
15
|
};
|
|
16
|
+
itemsOptions: ListingData[];
|
|
10
17
|
}
|
|
11
|
-
export declare const ListingPopup: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const ListingPopup: (props: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
19
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
label?: string;
|
|
7
|
+
value: string;
|
|
8
|
+
maxLength?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const Textarea: React.FC<Props>;
|
|
11
|
+
export {};
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
export * from '../shared/ui';
|
|
2
1
|
export * from './LayoutSettings';
|
|
3
2
|
export * from './TextSettings';
|
|
4
3
|
export * from './ItemsSettings';
|
|
5
4
|
export * from './ButtonsSettings';
|
|
6
5
|
export * from './TypesText';
|
|
7
|
-
export * from './ChooseImage';
|
|
8
6
|
export * from './ButtonTypeSettings';
|
|
9
7
|
export * from './RangeSelector';
|
|
10
8
|
export * from './ListingSelector';
|
|
11
9
|
export * from './ProductOptions';
|
|
12
10
|
export * from './HeaderButtons';
|
|
13
11
|
export * from './ShareLink';
|
|
12
|
+
export * from './Accordion';
|
|
13
|
+
export * from './Button';
|
|
14
|
+
export * from '../builder/ui';
|
|
15
|
+
export { Input as InputSettings } from '../builder/ui/Input';
|
|
16
|
+
export { Input as InputUI } from './Input';
|
|
17
|
+
export { Textarea as TextareaSettings } from '../builder/ui/Textarea';
|
|
18
|
+
export { Textarea as TextareaUI } from './Textarea';
|
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-ChU5WGPr.cjs"),h=require("react"),ut="_accordion_9e4oa_1",xt="_header_9e4oa_9",dt="_icon_9e4oa_18",pt="_open_9e4oa_21",mt="_content_9e4oa_25",G={accordion:ut,header:xt,icon:dt,open:pt,content:mt},_t=({title:u,content:n})=>{const[e,i]=h.useState(!1),[o,a]=h.useState(0),s=h.useRef(null),c=()=>{i(!e)};return h.useEffect(()=>{s.current&&a(e?s.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:G.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,onClick:c,children:[t.jsxRuntimeExports.jsx("h3",{children:u}),t.jsxRuntimeExports.jsx("div",{className:t.clx(G.icon,{[G.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:s,className:G.content,style:{height:`${o}px`},children:t.jsxRuntimeExports.jsx("p",{children:n})})]})},jt="_wrapper_9rr5j_2",ht="_alignmentBlock_9rr5j_8",gt="_title_9rr5j_15",ft="_subtitle_9rr5j_22",Et="_alignmentContent_9rr5j_29",bt="_alignments_9rr5j_37",Rt="_alignment_9rr5j_8",vt="_circle_9rr5j_58",kt="_paddings_9rr5j_65",yt="_padding_9rr5j_65",It="_input_9rr5j_84",w={wrapper:jt,alignmentBlock:ht,title:gt,subtitle:ft,alignmentContent:Et,alignments:bt,alignment:Rt,circle:vt,paddings:kt,padding:yt,input:It},Nt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],$t=["left","top","right","bottom"],Ct=u=>{const{alignment:n,padding:e,setPadding:i,setAlignment:o}=u;function a(){switch(n){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function s(c){switch(c){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}return t.jsxRuntimeExports.jsxs("div",{className:w.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:w.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:w.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:w.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:w.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:w.alignments,children:Nt.map(c=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{o(c)},className:w.alignment,children:[c!==n&&t.jsxRuntimeExports.jsx("div",{className:w.circle}),c===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:a(),fill:"#FF3F19",width:22,height:22})]},c))}),t.jsxRuntimeExports.jsx("div",{className:w.paddings,children:$t.map(c=>t.jsxRuntimeExports.jsxs("label",{className:w.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(c),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(e[c]),onChange:p=>i({...e,[c]:Number(p)}),paddingless:!0,borderless:!0})]},c))})]})]})]})},St="_subtitle_1qrz9_1",Pt="_header_1qrz9_8",Bt="_text_1qrz9_9",Tt="_top_1qrz9_17",wt="_itemsBlock_1qrz9_26",W={subtitle:St,header:Pt,text:Bt,top:Tt,itemsBlock:wt},qt="_typeTexts_rcw8p_1",At="_block_rcw8p_8",Ot="_active_rcw8p_21",J={typeTexts:qt,block:At,active:Ot},Lt=["bold","italic","underline","strike-through","code"],Z=u=>{const{typesText:n,setTypesText:e}=u;function i(o){switch(o){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:J.typeTexts,children:Lt.map(o=>t.jsxRuntimeExports.jsx("div",{className:t.clx(J.block,{[J.active]:n.includes(o)}),onClick:()=>{const a=[...n];if(a.includes(o)){const s=a.filter(c=>c!==o);e(s)}else a.push(o),e(a)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:i(o),fill:n.includes(o)?"#252525":"#757575",width:20,height:20})},String(o)))})},et=u=>{const{typesText:n,isActiveText:e,setIsActiveText:i,text:o,setText:a,setTypesText:s,title:c,subtitle:p="Items"}=u;return t.jsxRuntimeExports.jsxs("div",{className:W.text,children:[(c||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:W.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:W.title,children:c}),e!==void 0&&i&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:E=>i(E)})]}),t.jsxRuntimeExports.jsxs("div",{className:W.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:p}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:E=>a(E),value:o,maxLength:150}),t.jsxRuntimeExports.jsx(Z,{typesText:n,setTypesText:s})]})]})},Mt="_subtitle_cuny2_1",Dt="_header_cuny2_8",zt="_text_cuny2_9",Ht="_productsBlock_cuny2_10",Vt="_top_cuny2_22",Ft="_itemsBlock_cuny2_31",Ut="_typeTexts_cuny2_37",Gt="_block_cuny2_44",Wt="_active_cuny2_57",Xt="_products_cuny2_10",Yt="_product_cuny2_10",Qt="_button_cuny2_76",Jt="_disabled_cuny2_87",Kt="_image_cuny2_91",Zt="_info_cuny2_98",te="_name_cuny2_110",ee="_buttons_cuny2_114",se="_modal_cuny2_121",ne="_link_cuny2_141",oe="_modalOptions_cuny2_147",N={subtitle:Mt,header:Dt,text:zt,productsBlock:Ht,top:Vt,itemsBlock:Ft,typeTexts:Ut,block:Gt,active:Wt,products:Xt,product:Yt,button:Qt,disabled:Jt,image:Kt,info:Zt,name:te,buttons:ee,modal:se,link:ne,modalOptions:oe},ie=u=>{const{activeItem:n,setActiveItem:e,popupPosition:i,modalOptions:o,setIsOpenModal:a}=u;return t.jsxRuntimeExports.jsxs("div",{className:N.modal,onClick:s=>{s.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{e(null),a(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:N.modalOptions,children:o.map(s=>{if(s.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:c=>{const p={...n,[s.field]:c};e(p)}},String(s.field));if(s.type==="text")return t.jsxRuntimeExports.jsx(et,{typesText:n[s.field.type],setTypesText:c=>{const p={...n,[s.field.type]:c};e(p)},text:n[s.field.text]||"",setText:c=>{const p={...n,[s.field.text]:c};e(p)},subtitle:s.label});if(s.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const p={...n,[s.field]:c};e(p)},value:n[s.field]||"",label:s.label,placeholder:s.placeholder});if(s.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:N.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const p={...n,[s.field.text]:c};e(p)},value:n[s.field.text]||"",label:s.inputLabel,placeholder:s.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!n[s.field.switch]||!1,label:s.switchLabel,onChange:c=>{const p={...n,[s.field.switch]:c};e(p)}})]});if(s.type==="list")return t.jsxRuntimeExports.jsx(nt,{items:n[s.field]||[],setItems:c=>{const p={...n,[s.field]:c};e(p)},itemsType:"select",draggable:s.draggable||!1,itemsOptions:s.itemsOptions,deletable:s.deletable||!1,editable:!1,subtitle:s.label});if(s.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:s.itemsOptions,onChange:c=>{const p={...n,[s.field]:c};e(p)},label:s.label,value:n[s.field]||"String",leftAddon:s.leftAddon&&s.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:n[s.field]})})})})]})},ce="_other_g74jx_1",re="_subtitle_g74jx_7",ae="_items_g74jx_14",K={other:ce,subtitle:re,items:ae},st=u=>{const{items:n,title:e="Other"}=u;return t.jsxRuntimeExports.jsxs("div",{className:K.other,children:[t.jsxRuntimeExports.jsx("h5",{className:K.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:K.items,children:n.map((i,o)=>t.jsxRuntimeExports.jsx(t.Switch,{current:i.isItem,onChange:a=>i.setIsItem(a),label:i.label,hasBackground:!0,paddingless:!1},o))})]})},le=u=>{const{index:n,moveProduct:e,children:i}=u,[,o]=t.useDrop({accept:"product",hover(c){c.index!==n&&(e(c.index,n),c.index=n)}}),[{isDragging:a},s]=t.useDrag({type:"product",item:{index:n},collect:c=>({isDragging:c.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:c=>s(o(c)),className:`${N.product} ${a?N.dragging:""}`,children:i})},nt=u=>{const{isActiveItems:n,setIsActiveItems:e,items:i,setItems:o,other:a,title:s,subtitle:c,editable:p=!0,draggable:E=!1,withImage:x=!1,deletable:r=!0,addable:m=!0,itemsType:k,itemsPlaceholder:g="",itemsOptions:l,hasRangeSelector:S=!1,rangeSelectorOptions:V,modalOptions:F,addableOptions:D={},limit:R}=u,[O,L]=h.useState(null),[Q,Y]=h.useState({top:0,left:0}),[_,b]=h.useState(!1),P=(d,$)=>{const B=[...i],[v]=B.splice(d,1);B.splice($,0,v),o(B)};h.useEffect(()=>{const d=()=>{L(null),b(!1)};return document.body.addEventListener("click",d),L(null),b(!1),()=>{L(null),b(!1),document.body.removeEventListener("click",d)}},[]),h.useEffect(()=>{if(O){const d=[...i].map($=>$.id===O.id?O:$);o(d)}},[O]);const y=(d,$)=>{d.stopPropagation(),b(!0);const B=d.target.getBoundingClientRect(),v=500,U=window.innerHeight;let A=B.top+window.scrollY;A+v>U&&(A=U-v-20),Y({top:A-80,left:B.left-30}),L($)};function z(d){if(x)return d?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${d[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const T=(d,$)=>{const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[E&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),k==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const A=[...i].map(M=>M.id===d.id?{...d,name:v}:M);L({...d,name:v}),o([...A])},value:d.name,options:l,leftAddon:z(d.images)}),k==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:v=>{const A=[...i].map(M=>M.id===d.id?{...d,name:v}:M);o([...A])},value:d.name,placeholder:g}),k==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:v=>{const A=[...i].map(M=>M.id===d.id?{...d,images:v}:M);o([...A])}}),t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[p&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:v=>y(v,d)}),r&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(i.filter(v=>v.id!==d.id))})]})]});return E?t.jsxRuntimeExports.jsx(le,{product:d,index:$,moveProduct:P,children:B},d.id):t.jsxRuntimeExports.jsx("div",{className:N.product,children:B},d.id)};return t.jsxRuntimeExports.jsxs("div",{className:N.productsBlock,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:N.title,children:s}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:d=>e==null?void 0:e(d)})]}),O&&p&&F&&_&&t.jsxRuntimeExports.jsx(ie,{activeItem:O,setActiveItem:L,popupPosition:Q,modalOptions:F,setIsOpenModal:b}),S&&V&&t.jsxRuntimeExports.jsx(it,{...V}),t.jsxRuntimeExports.jsxs("div",{className:N.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:N.subtitle,children:c}),E?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:i.map((d,$)=>T(d,$))}):i.map((d,$)=>T(d,$)),m&&t.jsxRuntimeExports.jsxs(t.Button,{className:t.clx(N.button,{[N.disabled]:!!(R&&R<=i.length)}),size:"s",disabled:!!(R&&R<=i.length),onClick:()=>{const d=[...i];k==="select"?d.push({name:l[0]||`Product ${i.length+1}`,id:t.v4(),...D}):k==="input"?d.push({name:"",id:t.v4(),...D}):d.push({name:`Image ${i.length+1}`,id:t.v4(),...D}),o(d)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),a!==void 0&&t.jsxRuntimeExports.jsx(st,{items:a})]})},ue="_subtitle_1fb9q_1",xe="_header_1fb9q_8",de="_text_1fb9q_9",pe="_productsBlock_1fb9q_10",me="_buttonsBlock_1fb9q_11",_e="_top_1fb9q_22",je="_itemsBlock_1fb9q_31",he="_typeTexts_1fb9q_37",ge="_block_1fb9q_44",fe="_active_1fb9q_56",Ee="_products_1fb9q_10",be="_product_1fb9q_10",Re="_button_1fb9q_11",ve="_image_1fb9q_86",ke="_info_1fb9q_93",ye="_name_1fb9q_105",Ie="_buttons_1fb9q_11",Ne="_modal_1fb9q_116",$e="_other_1fb9q_135",Ce="_options_1fb9q_141",H={subtitle:ue,header:xe,text:de,productsBlock:pe,buttonsBlock:me,top:_e,itemsBlock:je,typeTexts:he,block:ge,active:fe,products:Ee,product:be,button:Re,image:ve,info:ke,name:ye,buttons:Ie,modal:Ne,other:$e,options:Ce},Se=u=>{const{activeButton:n,setActiveButton:e,popupPosition:i}=u,[o,a]=h.useState(n.typesText),[s,c]=h.useState(n.destination),[p,E]=h.useState(n.link||""),[x,r]=h.useState(n.text||"");return h.useEffect(()=>{e({...n,...{text:x,link:p,destination:s,typesText:o}})},[o,s,p,x]),t.jsxRuntimeExports.jsxs("div",{className:H.modal,onClick:m=>{m.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>e(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:H.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:m=>c(m),options:["Go to Page","Open Link"],value:s}),s==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:m=>E(m),value:p,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:m=>r(m),value:x,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(Z,{typesText:o,setTypesText:a})]})]})},Pe="_subtitle_m8qel_1",Be="_header_m8qel_8",Te="_text_m8qel_9",we="_productsBlock_m8qel_10",qe="_buttonsBlock_m8qel_11",Ae="_top_m8qel_23",Oe="_itemsBlock_m8qel_32",Le="_typeTexts_m8qel_38",Me="_block_m8qel_45",De="_active_m8qel_58",ze="_products_m8qel_10",He="_product_m8qel_10",Ve="_button_m8qel_11",Fe="_image_m8qel_88",Ue="_info_m8qel_95",Ge="_name_m8qel_107",We="_buttons_m8qel_11",Xe="_modal_m8qel_118",Ye="_other_m8qel_137",Qe="_options_m8qel_143",X={subtitle:Pe,header:Be,text:Te,productsBlock:we,buttonsBlock:qe,top:Ae,itemsBlock:Oe,typeTexts:Le,block:Me,active:De,products:ze,product:He,button:Ve,image:Fe,info:Ue,name:Ge,buttons:We,modal:Xe,other:Ye,options:Qe},ot=u=>{const{buttons:n,setButtons:e,deletable:i=!0,addable:o=!0}=u,[a,s]=h.useState(null),[c,p]=h.useState({top:0,left:0});h.useEffect(()=>{const x=()=>{s(null)};return document.body.addEventListener("click",x),s(null),()=>{s(null),document.body.removeEventListener("click",x)}},[]),h.useEffect(()=>{if(a){const x=[...n].map(r=>r.id===a.id?a:r);e(x)}},[a]);const E=(x,r)=>{x.stopPropagation();const m=x.target.getBoundingClientRect(),k=490,g=window.innerHeight;let l=m.top+window.scrollY;l+k>g&&(l=g-k-20),p({top:l,left:m.left-30}),s(r)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),n.map(x=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:r=>{const k=[...n].map(g=>g.id===x.id?{...x,type:r}:g);e(k)},value:x.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:r=>{E(r,x)}}),i&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const r=n.filter(m=>m.id!==x.id);e(r)},width:20,height:20,fill:"#C12A2A"})]})]},x.id)),a&&t.jsxRuntimeExports.jsx(Se,{activeButton:a,setActiveButton:s,popupPosition:c}),o&&t.jsxRuntimeExports.jsxs(t.Button,{className:X.button,size:"s",onClick:()=>{const x=[...n];x.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name"}),e(x)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Je=u=>{const{isActiveButtons:n,setIsActiveButtons:e,buttons:i,setButtons:o}=u;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:H.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:a=>e(a)})]}),t.jsxRuntimeExports.jsx(ot,{buttons:i,setButtons:o})]})})},Ke="_wrapper_m18qi_1",Ze="_subtitle_m18qi_7",ts="_content_m18qi_14",es="_range_m18qi_22",ss="_track_m18qi_27",ns="_progress_m18qi_36",os="_dots_m18qi_46",is="_dot_m18qi_46",cs="_active_m18qi_65",rs="_input_m18qi_77",as="_countBlock_m18qi_91",ls="_count_m18qi_91",us="_controls_m18qi_107",xs="_button_m18qi_113",I={wrapper:Ke,subtitle:Ze,content:ts,range:es,track:ss,progress:ns,dots:os,dot:is,active:cs,input:rs,countBlock:as,count:ls,controls:us,button:xs},it=u=>{const{label:n,min:e=1,max:i=4,step:o=1,count:a,setCount:s}=u,[c,p]=h.useState(!1),E=Array.from({length:(i-e)/o+1}),x=(a-e)/(i-e)*100,r=()=>{a<i&&s(a+o)},m=()=>{a>e&&s(a-o)},k=g=>{const l=e+g*o;s(l)};return t.jsxRuntimeExports.jsxs("div",{className:I.wrapper,children:[n&&t.jsxRuntimeExports.jsx("h5",{className:I.subtitle,children:n}),t.jsxRuntimeExports.jsxs("div",{className:I.content,children:[t.jsxRuntimeExports.jsxs("div",{className:I.range,children:[t.jsxRuntimeExports.jsx("div",{className:I.track}),t.jsxRuntimeExports.jsx("div",{className:I.progress,style:{width:`${x}%`}}),t.jsxRuntimeExports.jsx("div",{className:I.dots,children:E.map((g,l)=>{const S=l<=(a-e)/o;return t.jsxRuntimeExports.jsx("button",{onClick:()=>k(l),className:t.clx(I.dot,{[I.active]:S,[I.inactive]:!S,[I.dragging]:c}),"aria-label":`Set value to ${e+l*o}`},l)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:i,step:o,value:a,onChange:g=>s(Number(g.target.value)),onMouseDown:()=>p(!0),onMouseUp:()=>p(!1),onTouchStart:()=>p(!0),onTouchEnd:()=>p(!1),className:I.input})]}),t.jsxRuntimeExports.jsxs("div",{className:I.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:i,paddingless:!0,onChange:g=>{const l=Number(g);l>i?s(i):l<e?s(e):s(l)},value:String(a)}),t.jsxRuntimeExports.jsxs("div",{className:I.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:r,disabled:a>=i,className:I.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:m,disabled:a<=e,className:I.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},ds="_subtitle_16rdk_1",ps="_header_16rdk_8",ms="_text_16rdk_9",_s="_productsBlock_16rdk_10",js="_top_16rdk_22",hs="_itemsBlock_16rdk_31",gs="_typeTexts_16rdk_37",fs="_block_16rdk_44",Es="_active_16rdk_57",bs="_products_16rdk_10",Rs="_product_16rdk_10",vs="_button_16rdk_76",ks="_image_16rdk_87",ys="_info_16rdk_94",Is="_name_16rdk_106",Ns="_buttons_16rdk_110",$s="_modal_16rdk_117",Cs="_link_16rdk_137",Ss="_modalOptions_16rdk_143",C={subtitle:ds,header:ps,text:ms,productsBlock:_s,top:js,itemsBlock:hs,typeTexts:gs,block:fs,active:Es,products:bs,product:Rs,button:vs,image:ks,info:ys,name:Is,buttons:Ns,modal:$s,link:Cs,modalOptions:Ss},Ps=u=>{const{activeItem:n,setActiveItem:e,popupPosition:i,setIsOpenModal:o}=u;return t.jsxRuntimeExports.jsxs("div",{className:C.modal,onClick:a=>{a.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:C.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{o(!1),e(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:C.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:a=>{const s={...n,images:a,imagePath:a[0]};e(s)}})})]})},Bs=u=>{const{index:n,moveProduct:e,children:i}=u,[,o]=t.useDrop({accept:"product",hover(c){c.index!==n&&(e(c.index,n),c.index=n)}}),[{isDragging:a},s]=t.useDrag({type:"product",item:{index:n},collect:c=>({isDragging:c.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:c=>s(o(c)),className:`${C.product} ${a?C.dragging:""}`,children:i})},Ts=u=>{const{isActiveItems:n,setIsActiveItems:e,items:i,setItems:o,other:a,title:s,subtitle:c,editable:p=!0,draggable:E=!1,withImage:x=!1,deletable:r=!0,addable:m=!0,itemsType:k,itemsOptions:g}=u,[l,S]=h.useState(null),[V,F]=h.useState({top:0,left:0}),[D,R]=h.useState(!1),O=(_,b)=>{const P=[...i],[y]=P.splice(_,1);P.splice(b,0,y),o(P)};h.useEffect(()=>{const _=()=>{S(null),R(!1)};return document.body.addEventListener("click",_),S(null),R(!1),()=>{S(null),R(!1),document.body.removeEventListener("click",_)}},[]),h.useEffect(()=>{if(l){const _=[...i].map(b=>b.id===l.id?l:b);o(_)}},[l]);const L=(_,b)=>{_.stopPropagation();const P=_.target.getBoundingClientRect(),y=100,z=window.innerHeight;let T=P.top+window.scrollY;T+y>z&&(T=z-y-20),R(!0),F({top:T-80,left:P.left-30}),S(b)};function Q(_){if(x)return _?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${_}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const Y=(_,b)=>{const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[E&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})},b),k==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const z=[...i],T=Number(y.split(" ")[1]),d=g.find(v=>v.id===T);if(!d)return;const $={...d.productData.stats,newPrice:d.productData.minPrice.amount,oldPrice:d.productData.compareAtPrice.amount},B=z.map(v=>v.id===_.id?{..._,name:y,listingId:T,stats:$}:v);S({..._,name:y,listingId:T}),o([...B])},value:_.name,options:[...g.map(y=>`Product ${y.id}`)],leftAddon:Q(_.images[0])},b),t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[p&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>L(y,_)}),r&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>o(i.filter(y=>y.id!==_.id))})]})]});return E?t.jsxRuntimeExports.jsx(Bs,{product:_,index:b,moveProduct:O,children:P},_.id):t.jsxRuntimeExports.jsx("div",{className:C.product,children:P},_.id)};return t.jsxRuntimeExports.jsxs("div",{className:C.productsBlock,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:C.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:C.title,children:s}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:_=>e==null?void 0:e(_)})]}),D&&l&&t.jsxRuntimeExports.jsx(Ps,{activeItem:l,setActiveItem:S,setIsOpenModal:R,popupPosition:V}),t.jsxRuntimeExports.jsxs("div",{className:C.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:C.subtitle,children:c}),E?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:i.map((_,b)=>Y(_,b))}):i.map((_,b)=>Y(_,b)),m&&t.jsxRuntimeExports.jsxs(t.Button,{className:C.button,size:"s",onClick:()=>{const _=[...i],b=g[0].id;_.push({name:`Product ${b}`,id:t.v4(),listingId:b,imagePath:"",images:[],stats:{...g[0].productData.stats,newPrice:g[0].productData.minPrice.amount,oldPrice:g[0].productData.compareAtPrice.amount}}),o(_)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),a!==void 0&&t.jsxRuntimeExports.jsx(st,{items:a})]})},ws="_options_11lki_1",qs="_price_11lki_12",As="_oldPrice_11lki_19",Os="_newPrice_11lki_27",Ls="_meta_11lki_34",Ms="_info_11lki_40",Ds="_infoRight_11lki_48",zs="_buttons_11lki_55",Hs="_variants_11lki_62",Vs="_variant_11lki_62",Fs="_stock_11lki_79",Us="_variantInfo_11lki_86",Gs="_quantity_11lki_92",Ws="_count_11lki_99",Xs="_button_11lki_55",Ys="_activeVariant_11lki_120",Qs="_chargeTypes_11lki_124",Js="_charge_11lki_124",Ks="_chargeActive_11lki_145",Zs="_title_11lki_150",f={options:ws,price:qs,oldPrice:As,newPrice:Os,meta:Ls,info:Ms,infoRight:Ds,buttons:zs,variants:Hs,variant:Vs,stock:Fs,variantInfo:Us,quantity:Gs,count:Ws,button:Xs,activeVariant:Ys,chargeTypes:Qs,charge:Js,chargeActive:Ks,title:Zs};var ct=(u=>(u.ONE_TIME="One-Time",u.RECURRING="Subscribe & Save",u))(ct||{});const tn=u=>{const{variants:n}=u,[e,i]=h.useState(n[0]),[o,a]=h.useState(e.chargeTypes[0]),s=t.useNavigate(),[c,p]=h.useState(1),{reset:E,addProductToCart:x,getProducts:r}=t.useCart();async function m(){await r(),await x({productId:u.id,productVariantId:e.id,quantity:c})}function k(){E(),m(),s("/checkout")}function g(l){if(l>=864e5){const R=Math.floor(l/864e5);return`${R} ${R===1?"day":"days"}`}else if(l>=36e5){const R=Math.floor(l/36e5);return`${R} ${R===1?"hour":"hours"}`}else if(l>=6e4){const R=Math.floor(l/6e4);return`${R} ${R===1?"minute":"minutes"}`}else{const R=Math.floor(l/1e3);return`${R} ${R===1?"second":"seconds"}`}}return t.jsxRuntimeExports.jsxs("div",{className:f.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:f.chargeTypes,children:e.chargeTypes.map(l=>t.jsxRuntimeExports.jsx("div",{className:t.clx(f.charge,{[f.chargeActive]:o===l}),onClick:()=>a(l),children:ct[l]},l))}),t.jsxRuntimeExports.jsx("div",{className:f.variants,children:n.map(l=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(f.variant,{[f.activeVariant]:e.id===l.id}),onClick:()=>i(l),children:[t.jsxRuntimeExports.jsxs("div",{className:f.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:f.title,children:l.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?l.price.amount:l.subscriptionSettings.price.amount]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:f.stock,children:[l.quantity.restrictions.max||0," in stock"]})})]},l.id))}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:f.quantity,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{c>1?p(l=>l-1):p(1)},className:f.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("div",{className:f.count,children:c}),t.jsxRuntimeExports.jsx("div",{onClick:()=>{p(l=>l+1)},className:f.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:f.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:f.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:f.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:e.deliveryTime===0?"Instant":g(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:f.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:f.infoRight,children:o==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:f.price,children:[t.jsxRuntimeExports.jsxs("span",{className:f.newPrice,children:["$ ",(e.price.amount||0)*c]}),t.jsxRuntimeExports.jsxs("span",{className:f.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*c]})]}):t.jsxRuntimeExports.jsxs("span",{className:f.newPrice,children:["$ ",(e.price.amount||0)*c]}):e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:f.price,children:[t.jsxRuntimeExports.jsxs("span",{className:f.newPrice,children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:f.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):t.jsxRuntimeExports.jsxs("span",{className:f.newPrice,children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:f.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>k(),children:t.jsxRuntimeExports.jsx("span",{children:o==="ONE_TIME"?"Buy Now":"Subscribe Now"})}),o==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>m(),children:"Add to Cart"})]})]})},en="_button_1kcpz_1",sn="_login_1kcpz_14",nn="_signUp_1kcpz_18",on="_buttons_1kcpz_23",cn="_modal_1kcpz_32",rn="_info_1kcpz_48",an="_top_1kcpz_55",ln="_title_1kcpz_66",un="_clear_1kcpz_72",xn="_activeClear_1kcpz_79",dn="_count_1kcpz_83",pn="_cart_1kcpz_98",mn="_empty_1kcpz_106",_n="_product_1kcpz_132",jn="_products_1kcpz_141",hn="_image_1kcpz_149",gn="_productInfo_1kcpz_155",fn="_content_1kcpz_162",En="_name_1kcpz_168",bn="_price_1kcpz_174",Rn="_productButtons_1kcpz_180",vn="_productButton_1kcpz_180",kn="_productCount_1kcpz_200",yn="_bottom_1kcpz_216",In="_subtotal_1kcpz_224",Nn="_block_1kcpz_232",$n="_shoppingCount_1kcpz_239",Cn="_total_1kcpz_259",Sn="_link_1kcpz_265",j={button:en,login:sn,signUp:nn,buttons:on,modal:cn,info:rn,top:an,title:ln,clear:un,activeClear:xn,count:dn,cart:pn,empty:mn,product:_n,products:jn,image:hn,productInfo:gn,content:fn,name:En,price:bn,productButtons:Rn,productButton:vn,productCount:kn,bottom:yn,subtotal:In,block:Nn,shoppingCount:$n,total:Cn,link:Sn},Pn=u=>{const{shopping:n,signUp:e}=u,i=t.useNavigate();function o(a){i(a)}return t.jsxRuntimeExports.jsxs("div",{className:j.buttons,children:[n&&t.jsxRuntimeExports.jsx(rt,{}),t.jsxRuntimeExports.jsx("div",{className:t.clx(j.button,j.login),onClick:()=>o("/customer-dash"),children:"Login"}),e&&t.jsxRuntimeExports.jsx("div",{className:t.clx(j.button,j.login,j.signUp),onClick:()=>o("/customer-dash"),children:"Sign Up"})]})},rt=()=>{const[u,n]=h.useState(!1),[e,i]=h.useState([]),{cart:o,getProducts:a}=t.useCart();function s(x){for(let r=0;r<o.parts.length;r++)for(let m=0;m<x.variants.length;m++)if(o.parts[r].productVariantId===x.variants[r].id)return o.parts[r].productVariantId}function c(x){for(let r=0;r<o.parts.length;r++)for(let m=0;m<x.variants.length;m++)if(o.parts[r].productVariantId===x.variants[r].id)return o.parts[r].quantity}h.useEffect(()=>{(async()=>{const r=o.parts.map(g=>String(g.productId)),k=(await a([...r])).map(g=>({...g,activeVariantId:s(g),quantity:c(g)}));i(k)})()},[o]);function p(x){var r;return!x||!(x!=null&&x.variants)?!1:(r=x.variants.find(m=>m.id===x.activeVariantId))==null?void 0:r.subscriptionSettings}const E=o.parts.length>0&&e.length>0&&!p(e[0]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:j.button,onClick:x=>{x.stopPropagation(),n(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),E&&t.jsxRuntimeExports.jsx("div",{className:j.shoppingCount,children:o.parts.length})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:n,children:t.jsxRuntimeExports.jsx(at,{activeProducts:e,isCartNotEmpty:E})})]})},at=u=>{const{activeProducts:n,isCartNotEmpty:e}=u,{cart:i,reset:o,getTotalAndDiscount:a,updateQuantityOfProduct:s}=t.useCart(),c=t.useNavigate();function p(r){c(r)}function E(r){s({productId:r.id,productVariantId:r.activeVariantId,quantity:r.quantity+1})}function x(r){s({productId:r.id,productVariantId:r.activeVariantId,quantity:r.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:j.modal,onClick:r=>r.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:j.top,children:[t.jsxRuntimeExports.jsxs("div",{className:j.info,children:[t.jsxRuntimeExports.jsx("span",{className:j.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:j.count,children:i.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(j.clear,{[j.activeClear]:e}),disabled:!e,onClick:()=>o(),children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:j.cart,children:[t.jsxRuntimeExports.jsx("div",{className:j.products,children:n.map(r=>t.jsxRuntimeExports.jsxs("div",{className:j.product,children:[t.jsxRuntimeExports.jsxs("div",{className:j.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${r.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:j.image}),t.jsxRuntimeExports.jsxs("div",{className:j.content,children:[t.jsxRuntimeExports.jsx("div",{className:j.name,children:r.name}),t.jsxRuntimeExports.jsxs("div",{className:j.price,children:["$",r.variants.find(m=>m.id===r.activeVariantId).price.amount*((r==null?void 0:r.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:j.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{r.quantity!==1&&x(r)},className:j.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:j.productCount,children:r.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>E(r),className:j.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},r.id))}),t.jsxRuntimeExports.jsxs("div",{className:j.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:j.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:j.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:j.total,children:["$",a().total]})]}),t.jsxRuntimeExports.jsx(t.Button,{onClick:()=>p("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(lt,{})]})},lt=()=>t.jsxRuntimeExports.jsxs("div",{className:j.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"})}),t.jsxRuntimeExports.jsx("span",{children:"Your cart is empty"}),t.jsxRuntimeExports.jsxs("span",{children:["Check out the store's products and add them"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:j.link,children:"here"})]})]}),Bn="_share_9g414_1",Tn="_modal_9g414_8",wn="_header_9g414_14",qn="_socials_9g414_24",An="_social_9g414_24",On="_copy_9g414_34",Ln="_title_9g414_41",Mn="_copyWrapper_9g414_47",Dn="_copyText_9g414_56",q={share:Bn,modal:Tn,header:wn,socials:qn,social:An,copy:On,title:Ln,copyWrapper:Mn,copyText:Dn},zn=()=>{const{isOpenModal:u,setIsOpenModal:n}=t.useShareLinkStore();function e(){n(!0)}return console.log(u),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:q.share,onClick:i=>{i.stopPropagation(),e()},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575"})}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:n,children:t.jsxRuntimeExports.jsx(Hn,{})})]})},tt={facebook:"FacebookLogo","x.com":"TwitterLogo",telegram:"TelegramLogo",instagram:"InstagramLogo",discord:"MessengerLogo",tiktok:"TiktokLogo"},Hn=()=>{const{setIsOpenModal:u}=t.useShareLinkStore(),n=window.location.href;function e(){navigator.clipboard.writeText(n)}return t.jsxRuntimeExports.jsxs("div",{className:q.modal,onClick:i=>i.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:q.header,children:[t.jsxRuntimeExports.jsx("div",{className:q.title,children:"Share this Post"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:()=>u(!1)})]}),t.jsxRuntimeExports.jsx("div",{className:q.socials,children:Object.keys(tt).map(i=>t.jsxRuntimeExports.jsx("div",{className:q.social,children:t.jsxRuntimeExports.jsx(t.Icon,{name:tt[i]})}))}),t.jsxRuntimeExports.jsxs("div",{className:q.copyWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(q.copy,q.copyText),onClick:e,children:n}),t.jsxRuntimeExports.jsx("div",{onClick:e,className:q.copy,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})};exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.ErrorableBlock=t.ErrorableBlock;exports.Icon=t.Icon;exports.Input=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.Accordion=_t;exports.ButtonTypeSettings=ot;exports.ButtonsSettings=Je;exports.EmptyCart=lt;exports.HeaderButtons=Pn;exports.ItemsSettings=nt;exports.LayoutSettings=Ct;exports.ListingSelector=Ts;exports.ProductOptions=tn;exports.RangeSelector=it;exports.ShareLink=zn;exports.ShoppingButton=rt;exports.ShoppingModalCart=at;exports.TextSettings=et;exports.TypesText=Z;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BlxXgV9a.cjs"),g=require("react"),mt="_wrapper_9rr5j_2",_t="_alignmentBlock_9rr5j_8",ht="_title_9rr5j_15",jt="_subtitle_9rr5j_22",gt="_alignmentContent_9rr5j_29",ft="_alignments_9rr5j_37",bt="_alignment_9rr5j_8",Et="_circle_9rr5j_58",Rt="_paddings_9rr5j_65",vt="_padding_9rr5j_65",kt="_input_9rr5j_84",q={wrapper:mt,alignmentBlock:_t,title:ht,subtitle:jt,alignmentContent:gt,alignments:ft,alignment:bt,circle:Et,paddings:Rt,padding:vt,input:kt},yt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],It=["left","top","right","bottom"],Nt=l=>{const{alignment:n,padding:e,setPadding:c,setAlignment:i}=l;function r(){switch(n){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function s(o){switch(o){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}return t.jsxRuntimeExports.jsxs("div",{className:q.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:q.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:q.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:q.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:q.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:q.alignments,children:yt.map(o=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(o)},className:q.alignment,children:[o!==n&&t.jsxRuntimeExports.jsx("div",{className:q.circle}),o===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(),fill:"#FF3F19",width:22,height:22})]},o))}),t.jsxRuntimeExports.jsx("div",{className:q.paddings,children:It.map(o=>t.jsxRuntimeExports.jsxs("label",{className:q.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(o),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(e[o]),onChange:x=>c({...e,[o]:Number(x)}),paddingless:!0,borderless:!0})]},o))})]})]})]})},$t="_subtitle_1qrz9_1",Ct="_header_1qrz9_8",St="_text_1qrz9_9",wt="_top_1qrz9_17",Tt="_itemsBlock_1qrz9_26",W={subtitle:$t,header:Ct,text:St,top:wt,itemsBlock:Tt},Bt="_typeTexts_rcw8p_1",Pt="_block_rcw8p_8",qt="_active_rcw8p_21",et={typeTexts:Bt,block:Pt,active:qt},At=["bold","italic","underline","strike-through","code"],nt=l=>{const{typesText:n,setTypesText:e}=l;function c(i){switch(i){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:et.typeTexts,children:At.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(et.block,{[et.active]:n.includes(i)}),onClick:()=>{const r=[...n];if(r.includes(i)){const s=r.filter(o=>o!==i);e(s)}else r.push(i),e(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(i),fill:n.includes(i)?"#252525":"#757575",width:20,height:20})},String(i)))})},it=l=>{const{typesText:n,isActiveText:e,setIsActiveText:c,text:i,setText:r,setTypesText:s,title:o,subtitle:x="Items"}=l;return t.jsxRuntimeExports.jsxs("div",{className:W.text,children:[(o||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:W.top,children:[o&&t.jsxRuntimeExports.jsx("h3",{className:W.title,children:o}),e!==void 0&&c&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:R=>c(R)})]}),t.jsxRuntimeExports.jsxs("div",{className:W.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:x}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>r(R),value:i,maxLength:150}),t.jsxRuntimeExports.jsx(nt,{typesText:n,setTypesText:s})]})]})},Ot="_subtitle_cuny2_1",Lt="_header_cuny2_8",Dt="_text_cuny2_9",Mt="_productsBlock_cuny2_10",zt="_top_cuny2_22",Ht="_itemsBlock_cuny2_31",Vt="_typeTexts_cuny2_37",Ft="_block_cuny2_44",Ut="_active_cuny2_57",Gt="_products_cuny2_10",Wt="_product_cuny2_10",Xt="_button_cuny2_76",Yt="_disabled_cuny2_87",Qt="_image_cuny2_91",Jt="_info_cuny2_98",Kt="_name_cuny2_110",Zt="_buttons_cuny2_114",te="_modal_cuny2_121",ee="_link_cuny2_141",se="_modalOptions_cuny2_147",C={subtitle:Ot,header:Lt,text:Dt,productsBlock:Mt,top:zt,itemsBlock:Ht,typeTexts:Vt,block:Ft,active:Ut,products:Gt,product:Wt,button:Xt,disabled:Yt,image:Qt,info:Jt,name:Kt,buttons:Zt,modal:te,link:ee,modalOptions:se},ne=l=>{const{activeItem:n,setActiveItem:e,popupPosition:c,modalOptions:i,setIsOpenModal:r}=l;return t.jsxRuntimeExports.jsxs("div",{className:C.modal,onClick:s=>{s.stopPropagation()},style:{top:`${c.top}px`,left:`${c.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:C.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{e(null),r(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:C.modalOptions,children:i.map(s=>{if(s.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:o=>{const x={...n,[s.field]:o};e(x)}},String(s.field));if(s.type==="text")return t.jsxRuntimeExports.jsx(it,{typesText:n[s.field.type],setTypesText:o=>{const x={...n,[s.field.type]:o};e(x)},text:n[s.field.text]||"",setText:o=>{const x={...n,[s.field.text]:o};e(x)},subtitle:s.label});if(s.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const x={...n,[s.field]:o};e(x)},value:n[s.field]||"",label:s.label,placeholder:s.placeholder});if(s.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:C.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const x={...n,[s.field.text]:o};e(x)},value:n[s.field.text]||"",label:s.inputLabel,placeholder:s.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!n[s.field.switch]||!1,label:s.switchLabel,onChange:o=>{const x={...n,[s.field.switch]:o};e(x)}})]});if(s.type==="list")return t.jsxRuntimeExports.jsx(rt,{items:n[s.field]||[],setItems:o=>{const x={...n,[s.field]:o};e(x)},itemsType:"select",draggable:s.draggable||!1,itemsOptions:s.itemsOptions,deletable:s.deletable||!1,editable:!1,subtitle:s.label});if(s.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:s.itemsOptions,onChange:o=>{const x={...n,[s.field]:o};e(x)},label:s.label,value:n[s.field]||"String",leftAddon:s.leftAddon&&s.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:n[s.field]})})})})]})},oe="_other_g74jx_1",ie="_subtitle_g74jx_7",ce="_items_g74jx_14",st={other:oe,subtitle:ie,items:ce},ct=l=>{const{items:n,title:e="Other"}=l;return t.jsxRuntimeExports.jsxs("div",{className:st.other,children:[t.jsxRuntimeExports.jsx("h5",{className:st.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:st.items,children:n.map((c,i)=>t.jsxRuntimeExports.jsx(t.Switch,{current:c.isItem,onChange:r=>c.setIsItem(r),label:c.label,hasBackground:!0,paddingless:!1},i))})]})},re=l=>{const{index:n,moveProduct:e,children:c}=l,[,i]=t.useDrop({accept:"product",hover(o){o.index!==n&&(e(o.index,n),o.index=n)}}),[{isDragging:r},s]=t.useDrag({type:"product",item:{index:n},collect:o=>({isDragging:o.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:o=>s(i(o)),className:`${C.product} ${r?C.dragging:""}`,children:c})},rt=l=>{const{isActiveItems:n,setIsActiveItems:e,items:c,setItems:i,other:r,title:s,subtitle:o,editable:x=!0,draggable:R=!1,withImage:d=!1,deletable:a=!0,addable:m=!0,itemsType:v,itemsPlaceholder:_="",itemsOptions:u,hasRangeSelector:S=!1,rangeSelectorOptions:V,modalOptions:F,addableOptions:D={},limit:f}=l,[T,M]=g.useState(null),[tt,J]=g.useState({top:0,left:0}),[j,E]=g.useState(!1),N=(p,$)=>{const B=[...c],[k]=B.splice(p,1);B.splice($,0,k),i(B)};g.useEffect(()=>{const p=()=>{M(null),E(!1)};return document.body.addEventListener("click",p),M(null),E(!1),()=>{M(null),E(!1),document.body.removeEventListener("click",p)}},[]),g.useEffect(()=>{if(T){const p=[...c].map($=>$.id===T.id?T:$);i(p)}},[T]);const O=(p,$)=>{p.stopPropagation(),E(!0);const B=p.target.getBoundingClientRect(),k=500,G=window.innerHeight;let L=B.top+window.scrollY;L+k>G&&(L=G-k-20),J({top:L-80,left:B.left-30}),M($)};function y(p){if(d)return p?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${p[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=(p,$)=>{const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),v==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:k=>{const L=[...c].map(z=>z.id===p.id?{...p,name:k}:z);M({...p,name:k}),i([...L])},value:p.name,options:u,leftAddon:y(p.images)}),v==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:k=>{const L=[...c].map(z=>z.id===p.id?{...p,name:k}:z);i([...L])},value:p.name,placeholder:_}),v==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:k=>{const L=[...c].map(z=>z.id===p.id?{...p,images:k}:z);i([...L])}}),t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[x&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:k=>O(k,p)}),a&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(c.filter(k=>k.id!==p.id))})]})]});return R?t.jsxRuntimeExports.jsx(re,{product:p,index:$,moveProduct:N,children:B},p.id):t.jsxRuntimeExports.jsx("div",{className:C.product,children:B},p.id)};return t.jsxRuntimeExports.jsxs("div",{className:C.productsBlock,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:C.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:C.title,children:s}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:p=>e==null?void 0:e(p)})]}),T&&x&&F&&j&&t.jsxRuntimeExports.jsx(ne,{activeItem:T,setActiveItem:M,popupPosition:tt,modalOptions:F,setIsOpenModal:E}),S&&V&&t.jsxRuntimeExports.jsx(lt,{...V}),t.jsxRuntimeExports.jsxs("div",{className:C.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:C.subtitle,children:o}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:c.map((p,$)=>P(p,$))}):c.map((p,$)=>P(p,$)),m&&t.jsxRuntimeExports.jsxs(t.Button,{className:t.clx(C.button,{[C.disabled]:!!(f&&f<=c.length)}),size:"s",disabled:!!(f&&f<=c.length),onClick:()=>{const p=[...c];v==="select"?p.push({name:u[0]||`Product ${c.length+1}`,id:t.v4(),...D}):v==="input"?p.push({name:"",id:t.v4(),...D}):p.push({name:`Image ${c.length+1}`,id:t.v4(),...D}),i(p)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(ct,{items:r})]})},ae="_subtitle_1fb9q_1",le="_header_1fb9q_8",ue="_text_1fb9q_9",xe="_productsBlock_1fb9q_10",de="_buttonsBlock_1fb9q_11",pe="_top_1fb9q_22",me="_itemsBlock_1fb9q_31",_e="_typeTexts_1fb9q_37",he="_block_1fb9q_44",je="_active_1fb9q_56",ge="_products_1fb9q_10",fe="_product_1fb9q_10",be="_button_1fb9q_11",Ee="_image_1fb9q_86",Re="_info_1fb9q_93",ve="_name_1fb9q_105",ke="_buttons_1fb9q_11",ye="_modal_1fb9q_116",Ie="_other_1fb9q_135",Ne="_options_1fb9q_141",U={subtitle:ae,header:le,text:ue,productsBlock:xe,buttonsBlock:de,top:pe,itemsBlock:me,typeTexts:_e,block:he,active:je,products:ge,product:fe,button:be,image:Ee,info:Re,name:ve,buttons:ke,modal:ye,other:Ie,options:Ne},$e=l=>{const{activeButton:n,setActiveButton:e,popupPosition:c}=l,[i,r]=g.useState(n.typesText),[s,o]=g.useState(n.destination),[x,R]=g.useState(n.link||""),[d,a]=g.useState(n.text||"");return g.useEffect(()=>{e({...n,...{text:d,link:x,destination:s,typesText:i}})},[i,s,x,d]),t.jsxRuntimeExports.jsxs("div",{className:U.modal,onClick:m=>{m.stopPropagation()},style:{top:`${c.top}px`,left:`${c.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>e(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:U.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:m=>o(m),options:["Go to Page","Open Link"],value:s}),s==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:m=>R(m),value:x,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:m=>a(m),value:d,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(nt,{typesText:i,setTypesText:r})]})]})},Ce="_subtitle_m8qel_1",Se="_header_m8qel_8",we="_text_m8qel_9",Te="_productsBlock_m8qel_10",Be="_buttonsBlock_m8qel_11",Pe="_top_m8qel_23",qe="_itemsBlock_m8qel_32",Ae="_typeTexts_m8qel_38",Oe="_block_m8qel_45",Le="_active_m8qel_58",De="_products_m8qel_10",Me="_product_m8qel_10",ze="_button_m8qel_11",He="_image_m8qel_88",Ve="_info_m8qel_95",Fe="_name_m8qel_107",Ue="_buttons_m8qel_11",Ge="_modal_m8qel_118",We="_other_m8qel_137",Xe="_options_m8qel_143",X={subtitle:Ce,header:Se,text:we,productsBlock:Te,buttonsBlock:Be,top:Pe,itemsBlock:qe,typeTexts:Ae,block:Oe,active:Le,products:De,product:Me,button:ze,image:He,info:Ve,name:Fe,buttons:Ue,modal:Ge,other:We,options:Xe},at=l=>{const{buttons:n,setButtons:e,deletable:c=!0,addable:i=!0}=l,[r,s]=g.useState(null),[o,x]=g.useState({top:0,left:0});g.useEffect(()=>{const d=()=>{s(null)};return document.body.addEventListener("click",d),s(null),()=>{s(null),document.body.removeEventListener("click",d)}},[]),g.useEffect(()=>{if(r){const d=[...n].map(a=>a.id===r.id?r:a);e(d)}},[r]);const R=(d,a)=>{d.stopPropagation();const m=d.target.getBoundingClientRect(),v=490,_=window.innerHeight;let u=m.top+window.scrollY;u+v>_&&(u=_-v-20),x({top:u,left:m.left-30}),s(a)};return t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:"Button Type"}),n.map(d=>t.jsxRuntimeExports.jsxs("div",{className:X.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:a=>{const v=[...n].map(_=>_.id===d.id?{...d,type:a}:_);e(v)},value:d.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:a=>{R(a,d)}}),c&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const a=n.filter(m=>m.id!==d.id);e(a)},width:20,height:20,fill:"#C12A2A"})]})]},d.id)),r&&t.jsxRuntimeExports.jsx($e,{activeButton:r,setActiveButton:s,popupPosition:o}),i&&t.jsxRuntimeExports.jsxs(t.Button,{className:X.button,size:"s",onClick:()=>{const d=[...n];d.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name"}),e(d)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Ye=l=>{const{isActiveButtons:n,setIsActiveButtons:e,buttons:c,setButtons:i}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:U.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[t.jsxRuntimeExports.jsx("h3",{className:U.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:r=>e(r)})]}),t.jsxRuntimeExports.jsx(at,{buttons:c,setButtons:i})]})})},Qe="_wrapper_m18qi_1",Je="_subtitle_m18qi_7",Ke="_content_m18qi_14",Ze="_range_m18qi_22",ts="_track_m18qi_27",es="_progress_m18qi_36",ss="_dots_m18qi_46",ns="_dot_m18qi_46",os="_active_m18qi_65",is="_input_m18qi_77",cs="_countBlock_m18qi_91",rs="_count_m18qi_91",as="_controls_m18qi_107",ls="_button_m18qi_113",I={wrapper:Qe,subtitle:Je,content:Ke,range:Ze,track:ts,progress:es,dots:ss,dot:ns,active:os,input:is,countBlock:cs,count:rs,controls:as,button:ls},lt=l=>{const{label:n,min:e=1,max:c=4,step:i=1,count:r,setCount:s}=l,[o,x]=g.useState(!1),R=Array.from({length:(c-e)/i+1}),d=(r-e)/(c-e)*100,a=()=>{r<c&&s(r+i)},m=()=>{r>e&&s(r-i)},v=_=>{const u=e+_*i;s(u)};return t.jsxRuntimeExports.jsxs("div",{className:I.wrapper,children:[n&&t.jsxRuntimeExports.jsx("h5",{className:I.subtitle,children:n}),t.jsxRuntimeExports.jsxs("div",{className:I.content,children:[t.jsxRuntimeExports.jsxs("div",{className:I.range,children:[t.jsxRuntimeExports.jsx("div",{className:I.track}),t.jsxRuntimeExports.jsx("div",{className:I.progress,style:{width:`${d}%`}}),t.jsxRuntimeExports.jsx("div",{className:I.dots,children:R.map((_,u)=>{const S=u<=(r-e)/i;return t.jsxRuntimeExports.jsx("button",{onClick:()=>v(u),className:t.clx(I.dot,{[I.active]:S,[I.inactive]:!S,[I.dragging]:o}),"aria-label":`Set value to ${e+u*i}`},u)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:c,step:i,value:r,onChange:_=>s(Number(_.target.value)),onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),onTouchStart:()=>x(!0),onTouchEnd:()=>x(!1),className:I.input})]}),t.jsxRuntimeExports.jsxs("div",{className:I.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:c,paddingless:!0,onChange:_=>{const u=Number(_);u>c?s(c):u<e?s(e):s(u)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:I.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:a,disabled:r>=c,className:I.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:m,disabled:r<=e,className:I.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},us="_subtitle_16rdk_1",xs="_header_16rdk_8",ds="_text_16rdk_9",ps="_productsBlock_16rdk_10",ms="_top_16rdk_22",_s="_itemsBlock_16rdk_31",hs="_typeTexts_16rdk_37",js="_block_16rdk_44",gs="_active_16rdk_57",fs="_products_16rdk_10",bs="_product_16rdk_10",Es="_button_16rdk_76",Rs="_image_16rdk_87",vs="_info_16rdk_94",ks="_name_16rdk_106",ys="_buttons_16rdk_110",Is="_modal_16rdk_117",Ns="_link_16rdk_137",$s="_modalOptions_16rdk_143",w={subtitle:us,header:xs,text:ds,productsBlock:ps,top:ms,itemsBlock:_s,typeTexts:hs,block:js,active:gs,products:fs,product:bs,button:Es,image:Rs,info:vs,name:ks,buttons:ys,modal:Is,link:Ns,modalOptions:$s},Cs=l=>{const{activeItem:n,setActiveItem:e,popupPosition:c,setIsOpenModal:i,itemsOptions:r}=l,s=r.find(o=>o.id===n.listingId);return s?t.jsxRuntimeExports.jsxs("div",{className:w.modal,onClick:o=>{o.stopPropagation()},style:{top:`${c.top}px`,left:`${c.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:w.top,children:[t.jsxRuntimeExports.jsx("h3",{children:s.productData.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{i(!1),e(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:w.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:o=>{const x={...n,image:o[0]};e(x)}})})]}):null},Ss=l=>{const{index:n,moveProduct:e,children:c}=l,[,i]=t.useDrop({accept:"product",hover(o){o.index!==n&&(e(o.index,n),o.index=n)}}),[{isDragging:r},s]=t.useDrag({type:"product",item:{index:n},collect:o=>({isDragging:o.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:o=>s(i(o)),className:`${w.product} ${r?w.dragging:""}`,children:c})},ws=l=>{const{isActiveItems:n,setIsActiveItems:e,items:c,setItems:i,other:r,title:s,subtitle:o,editable:x=!0,draggable:R=!1,withImage:d=!1,deletable:a=!0,addable:m=!0,itemsType:v,itemsOptions:_}=l,[u,S]=g.useState(null),[V,F]=g.useState({top:0,left:0}),[D,f]=g.useState(!1),T=(j,E)=>{const N=[...c],[O]=N.splice(j,1);N.splice(E,0,O),i(N)};g.useEffect(()=>{const j=()=>{S(null),f(!1)};return document.body.addEventListener("click",j),S(null),f(!1),()=>{S(null),f(!1),document.body.removeEventListener("click",j)}},[]),g.useEffect(()=>{if(u){const j=[...c].map(E=>E.listingId===u.listingId?u:E);i(j)}},[u]);const M=(j,E)=>{j.stopPropagation();const N=j.target.getBoundingClientRect(),O=100,y=window.innerHeight;let P=N.top+window.scrollY;P+O>y&&(P=y-O-20),f(!0),F({top:P-80,left:N.left-30}),S(E)};function tt(j){if(d)return j?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${j}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const J=(j,E)=>{const N=_.find(y=>j.listingId===y.id);if(!N)return null;const O=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})},E),v==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const P=[...c],p=_.find(k=>k.productData.name===y);if(!p)return;const $={listingId:p.id,image:p.productData.images.length>0?p.productData.images[0].cfId:""},B=P.map(k=>k.listingId===j.listingId?$:k);S($),i([...B])},value:N.productData.name,options:[..._.filter(y=>!c.find(P=>P.listingId===y.id)).map(y=>y.productData.name)],leftAddon:tt(j.image||N.productData.images.length>0&&N.productData.images[0].cfId||"")},E),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[x&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>M(y,j)}),a&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(c.filter(y=>y!==j))})]})]});return R?t.jsxRuntimeExports.jsx(Ss,{product:j,index:E,moveProduct:T,children:O},j.listingId):t.jsxRuntimeExports.jsx("div",{className:w.product,children:O},j.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:w.productsBlock,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:w.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:w.title,children:s}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:j=>e==null?void 0:e(j)})]}),D&&u&&t.jsxRuntimeExports.jsx(Cs,{activeItem:u,setActiveItem:S,setIsOpenModal:f,popupPosition:V,itemsOptions:_}),t.jsxRuntimeExports.jsxs("div",{className:w.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:w.subtitle,children:o}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:c.map((j,E)=>J(j,E))}):c.map((j,E)=>J(j,E)),m&&t.jsxRuntimeExports.jsxs(t.Button,{className:w.button,size:"s",onClick:()=>{const j=[...c];for(let E=0;E<_.length;E++)if(!c.find(N=>N.listingId===_[E].id)){j.push({listingId:_[E].id,image:_[E].productData.images.length>0?_[E].productData.images[0].cfId:""});break}i(j)},disabled:c.length===_.length,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),r!==void 0&&t.jsxRuntimeExports.jsx(ct,{items:r})]})},Ts="_options_11lki_1",Bs="_price_11lki_12",Ps="_oldPrice_11lki_19",qs="_newPrice_11lki_27",As="_meta_11lki_34",Os="_info_11lki_40",Ls="_infoRight_11lki_48",Ds="_buttons_11lki_55",Ms="_variants_11lki_62",zs="_variant_11lki_62",Hs="_stock_11lki_79",Vs="_variantInfo_11lki_86",Fs="_quantity_11lki_92",Us="_count_11lki_99",Gs="_button_11lki_55",Ws="_activeVariant_11lki_120",Xs="_chargeTypes_11lki_124",Ys="_charge_11lki_124",Qs="_chargeActive_11lki_145",Js="_title_11lki_150",b={options:Ts,price:Bs,oldPrice:Ps,newPrice:qs,meta:As,info:Os,infoRight:Ls,buttons:Ds,variants:Ms,variant:zs,stock:Hs,variantInfo:Vs,quantity:Fs,count:Us,button:Gs,activeVariant:Ws,chargeTypes:Xs,charge:Ys,chargeActive:Qs,title:Js},Ks="_button_143au_1",Zs="_primary_143au_13",tn="_secondary_143au_18",en="_tertiary_143au_23",sn="_content_143au_28",Y={button:Ks,primary:Zs,secondary:tn,tertiary:en,content:sn},Z=l=>{const{children:n,onClick:e,style:c,className:i,disabled:r=!1,size:s="m",type:o="Primary"}=l;return t.jsxRuntimeExports.jsx("button",{className:t.clx(Y.button,i,{[Y.primary]:o==="Primary",[Y.secondary]:o==="Secondary",[Y.tertiary]:o==="Tertiary"}),onClick:e,style:{...c,fontSize:s==="m"?14:s==="s"?12:16},disabled:r,children:o==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:Y.content,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"#757575",width:20,height:20}),n]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:n})})};var ut=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(ut||{});const nn=l=>{const{variants:n}=l,[e,c]=g.useState(n[0]),[i,r]=g.useState(e.chargeTypes[0]),s=t.useNavigate(),[o,x]=g.useState(1),{reset:R,addProductToCart:d,getProducts:a}=t.useCart();async function m(){await a(),await d({productId:l.id,productVariantId:e.id,quantity:o})}function v(){R(),m(),s("/checkout")}function _(u){if(u>=864e5){const f=Math.floor(u/864e5);return`${f} ${f===1?"day":"days"}`}else if(u>=36e5){const f=Math.floor(u/36e5);return`${f} ${f===1?"hour":"hours"}`}else if(u>=6e4){const f=Math.floor(u/6e4);return`${f} ${f===1?"minute":"minutes"}`}else{const f=Math.floor(u/1e3);return`${f} ${f===1?"second":"seconds"}`}}return t.jsxRuntimeExports.jsxs("div",{className:b.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:b.chargeTypes,children:e.chargeTypes.map(u=>t.jsxRuntimeExports.jsx("div",{className:t.clx(b.charge,{[b.chargeActive]:i===u}),onClick:()=>r(u),children:ut[u]},u))}),t.jsxRuntimeExports.jsx("div",{className:b.variants,children:n.map(u=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(b.variant,{[b.activeVariant]:e.id===u.id}),onClick:()=>c(u),children:[t.jsxRuntimeExports.jsxs("div",{className:b.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:b.title,children:u.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?u.price.amount:u.subscriptionSettings.price.amount]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:b.stock,children:[u.quantity.restrictions.max||0," in stock"]})})]},u.id))}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:b.quantity,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{o>1?x(u=>u-1):x(1)},className:b.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("div",{className:b.count,children:o}),t.jsxRuntimeExports.jsx("div",{onClick:()=>{x(u=>u+1)},className:b.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:b.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:b.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:b.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:e.deliveryTime===0?"Instant":_(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:b.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:b.price,children:[t.jsxRuntimeExports.jsxs("span",{className:b.newPrice,children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:b.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:b.newPrice,children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:b.price,children:[t.jsxRuntimeExports.jsxs("span",{className:b.newPrice,children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:b.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):t.jsxRuntimeExports.jsxs("span",{className:b.newPrice,children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.buttons,children:[t.jsxRuntimeExports.jsx(Z,{type:"Primary",onClick:()=>v(),children:t.jsxRuntimeExports.jsx("span",{children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(Z,{type:"Secondary",onClick:()=>m(),children:"Add to Cart"})]})]})},on="_button_1kcpz_1",cn="_login_1kcpz_14",rn="_signUp_1kcpz_18",an="_buttons_1kcpz_23",ln="_modal_1kcpz_32",un="_info_1kcpz_48",xn="_top_1kcpz_55",dn="_title_1kcpz_66",pn="_clear_1kcpz_72",mn="_activeClear_1kcpz_79",_n="_count_1kcpz_83",hn="_cart_1kcpz_98",jn="_empty_1kcpz_106",gn="_product_1kcpz_132",fn="_products_1kcpz_141",bn="_image_1kcpz_149",En="_productInfo_1kcpz_155",Rn="_content_1kcpz_162",vn="_name_1kcpz_168",kn="_price_1kcpz_174",yn="_productButtons_1kcpz_180",In="_productButton_1kcpz_180",Nn="_productCount_1kcpz_200",$n="_bottom_1kcpz_216",Cn="_subtotal_1kcpz_224",Sn="_block_1kcpz_232",wn="_shoppingCount_1kcpz_239",Tn="_total_1kcpz_259",Bn="_link_1kcpz_265",h={button:on,login:cn,signUp:rn,buttons:an,modal:ln,info:un,top:xn,title:dn,clear:pn,activeClear:mn,count:_n,cart:hn,empty:jn,product:gn,products:fn,image:bn,productInfo:En,content:Rn,name:vn,price:kn,productButtons:yn,productButton:In,productCount:Nn,bottom:$n,subtotal:Cn,block:Sn,shoppingCount:wn,total:Tn,link:Bn},Pn=l=>{const{shopping:n,signUp:e}=l,c=t.useNavigate();function i(r){c(r)}return t.jsxRuntimeExports.jsxs("div",{className:h.buttons,children:[n&&t.jsxRuntimeExports.jsx(xt,{}),t.jsxRuntimeExports.jsx("div",{className:t.clx(h.button,h.login),onClick:()=>i("/customer-dash"),children:"Login"}),e&&t.jsxRuntimeExports.jsx("div",{className:t.clx(h.button,h.login,h.signUp),onClick:()=>i("/customer-dash"),children:"Sign Up"})]})},xt=()=>{const[l,n]=g.useState(!1),[e,c]=g.useState([]),{cart:i,getProducts:r}=t.useCart();function s(d){for(let a=0;a<i.parts.length;a++)for(let m=0;m<d.variants.length;m++)if(i.parts[a].productVariantId===d.variants[a].id)return i.parts[a].productVariantId}function o(d){for(let a=0;a<i.parts.length;a++)for(let m=0;m<d.variants.length;m++)if(i.parts[a].productVariantId===d.variants[a].id)return i.parts[a].quantity}g.useEffect(()=>{(async()=>{const a=i.parts.map(_=>String(_.productId)),v=(await r([...a])).map(_=>({..._,activeVariantId:s(_),quantity:o(_)}));c(v)})()},[i]);function x(d){var a;return!d||!(d!=null&&d.variants)?!1:(a=d.variants.find(m=>m.id===d.activeVariantId))==null?void 0:a.subscriptionSettings}const R=i.parts.length>0&&e.length>0&&!x(e[0]);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:h.button,onClick:d=>{d.stopPropagation(),n(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),R&&t.jsxRuntimeExports.jsx("div",{className:h.shoppingCount,children:i.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:n,children:t.jsxRuntimeExports.jsx(dt,{activeProducts:e,isCartNotEmpty:R})})]})},dt=l=>{const{activeProducts:n,isCartNotEmpty:e}=l,{cart:c,reset:i,getTotalAndDiscount:r,updateQuantityOfProduct:s}=t.useCart(),o=t.useNavigate();function x(a){o(a)}function R(a){s({productId:a.id,productVariantId:a.activeVariantId,quantity:a.quantity+1})}function d(a){s({productId:a.id,productVariantId:a.activeVariantId,quantity:a.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:h.modal,onClick:a=>a.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:h.top,children:[t.jsxRuntimeExports.jsxs("div",{className:h.info,children:[t.jsxRuntimeExports.jsx("span",{className:h.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:h.count,children:c.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(h.clear,{[h.activeClear]:e}),disabled:!e,onClick:()=>i(),children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:h.cart,children:[t.jsxRuntimeExports.jsx("div",{className:h.products,children:n.map(a=>t.jsxRuntimeExports.jsxs("div",{className:h.product,children:[t.jsxRuntimeExports.jsxs("div",{className:h.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:h.image}),t.jsxRuntimeExports.jsxs("div",{className:h.content,children:[t.jsxRuntimeExports.jsx("div",{className:h.name,children:a.name}),t.jsxRuntimeExports.jsxs("div",{className:h.price,children:["$",a.variants.find(m=>m.id===a.activeVariantId).price.amount*((a==null?void 0:a.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:h.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{a.quantity!==1&&d(a)},className:h.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:h.productCount,children:a.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>R(a),className:h.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},a.id))}),t.jsxRuntimeExports.jsxs("div",{className:h.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:h.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:h.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:h.total,children:["$",r().total]})]}),t.jsxRuntimeExports.jsx(Z,{onClick:()=>x("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(pt,{})]})},pt=()=>t.jsxRuntimeExports.jsxs("div",{className:h.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"})}),t.jsxRuntimeExports.jsx("span",{children:"Your cart is empty"}),t.jsxRuntimeExports.jsxs("span",{children:["Check out the store's products and add them"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:h.link,children:"here"})]})]}),qn="_share_9g414_1",An="_modal_9g414_8",On="_header_9g414_14",Ln="_socials_9g414_24",Dn="_social_9g414_24",Mn="_copy_9g414_34",zn="_title_9g414_41",Hn="_copyWrapper_9g414_47",Vn="_copyText_9g414_56",A={share:qn,modal:An,header:On,socials:Ln,social:Dn,copy:Mn,title:zn,copyWrapper:Hn,copyText:Vn},Fn=()=>{const{isOpenModal:l,setIsOpenModal:n}=t.useShareLinkStore();function e(){n(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:A.share,onClick:c=>{c.stopPropagation(),e()},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575"})}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:n,children:t.jsxRuntimeExports.jsx(Un,{})})]})},ot={facebook:"FacebookLogo","x.com":"TwitterLogo",telegram:"TelegramLogo",instagram:"InstagramLogo",discord:"MessengerLogo",tiktok:"TiktokLogo"},Un=()=>{const{setIsOpenModal:l}=t.useShareLinkStore(),n=window.location.href;function e(){navigator.clipboard.writeText(n)}return t.jsxRuntimeExports.jsxs("div",{className:A.modal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:A.header,children:[t.jsxRuntimeExports.jsx("div",{className:A.title,children:"Share this Post"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:()=>l(!1)})]}),t.jsxRuntimeExports.jsx("div",{className:A.socials,children:Object.keys(ot).map(c=>t.jsxRuntimeExports.jsx("div",{className:A.social,children:t.jsxRuntimeExports.jsx(t.Icon,{name:ot[c]})}))}),t.jsxRuntimeExports.jsxs("div",{className:A.copyWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(A.copy,A.copyText),onClick:e,children:n}),t.jsxRuntimeExports.jsx("div",{onClick:e,className:A.copy,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},Gn="_accordion_9e4oa_1",Wn="_header_9e4oa_9",Xn="_icon_9e4oa_18",Yn="_open_9e4oa_21",Qn="_content_9e4oa_25",Q={accordion:Gn,header:Wn,icon:Xn,open:Yn,content:Qn},Jn=({title:l,content:n})=>{const[e,c]=g.useState(!1),[i,r]=g.useState(0),s=g.useRef(null),o=()=>{c(!e)};return g.useEffect(()=>{s.current&&r(e?s.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:Q.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,onClick:o,children:[t.jsxRuntimeExports.jsx("h3",{children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(Q.icon,{[Q.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:s,className:Q.content,style:{height:`${i}px`},children:t.jsxRuntimeExports.jsx("p",{children:n})})]})},Kn="_wrapper_1mken_1",Zn="_label_1mken_9",to="_input_1mken_17",eo="_required_1mken_36",so="_paddingless_1mken_40",no="_content_1mken_44",oo="_borderless_1mken_52",io="_rightIcon_1mken_57",H={wrapper:Kn,label:Zn,input:to,required:eo,paddingless:so,content:no,borderless:oo,rightIcon:io},co=l=>{const{onChange:n,style:e,label:c,value:i,type:r,min:s,max:o,placeholder:x,disabled:R=!1,required:d=!1,regex:a,paddingless:m=!1,borderless:v=!1,editable:_=!1,isSearch:u=!1}=l,[S,V]=g.useState(!1);function F(f){return Number(f)<0?String(s):f}function D(f){return!d||!a?!0:new RegExp(a).test(f)}return t.jsxRuntimeExports.jsxs("div",{className:H.wrapper,children:[c&&t.jsxRuntimeExports.jsx("label",{className:H.label,htmlFor:c,children:c}),t.jsxRuntimeExports.jsxs("div",{className:H.content,children:[t.jsxRuntimeExports.jsx("input",{id:c,type:r||"text",onChange:f=>{if(r==="text")n(f.target.value);else{const T=F(f.target.value);n(T)}},value:i,autoComplete:"off",placeholder:x||"Type something...",className:t.clx(H.input,{[H.required]:S&&d&&!D(i),[H.paddingless]:m,[H.borderless]:v}),min:r==="number"?s:void 0,max:r==="number"?o:void 0,disabled:R,onFocus:()=>V(!0),style:e}),u&&t.jsxRuntimeExports.jsx("div",{className:H.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:20,height:20})}),_&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},ro="_wrapper_st58d_1",ao="_label_st58d_10",lo="_textarea_st58d_18",uo="_length_st58d_33",K={wrapper:ro,label:ao,textarea:lo,length:uo},xo=l=>{const{onChange:n,label:e,value:c,maxLength:i,placeholder:r="Type something..."}=l,[s,o]=g.useState(c.length);return t.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:K.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:c,onChange:x=>{o(x.target.value.length),n(x.target.value)},placeholder:r,className:K.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:K.length,children:[s,"/",i]})]})};exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextareaSettings=t.Textarea;exports.Accordion=Jn;exports.Button=Z;exports.ButtonTypeSettings=at;exports.ButtonsSettings=Ye;exports.EmptyCart=pt;exports.HeaderButtons=Pn;exports.InputUI=co;exports.ItemsSettings=rt;exports.LayoutSettings=Nt;exports.ListingSelector=ws;exports.ProductOptions=nn;exports.RangeSelector=lt;exports.ShareLink=Fn;exports.ShoppingButton=xt;exports.ShoppingModalCart=dt;exports.TextSettings=it;exports.TextareaUI=xo;exports.TypesText=nt;
|