@sledge-app/js 1.0.22 → 1.0.24
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/sledge.min.js +1 -1
- package/package.json +1 -1
package/dist/sledge.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as React,r as reactExports,C as CryptoES,j as jsxRuntimeExports,$ as $905f4ae918aab1aa$export$be92b6f5f03c0fe9,a as $905f4ae918aab1aa$export$602eac185826482c,b as $905f4ae918aab1aa$export$c6fdb837b070b4ff,c as $905f4ae918aab1aa$export$7c6e2c02157bb7d2,d as $905f4ae918aab1aa$export$f99233281efd08a0,e as $905f4ae918aab1aa$export$393edc798c47379d,f as $905f4ae918aab1aa$export$848c9b7ead0df967,g as $905f4ae918aab1aa$export$e19cd5f9376f8cee,h as client,i as $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,k as $5d3850c4d0b4e6c7$export$602eac185826482c,l as $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,m as $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,n as $5d3850c4d0b4e6c7$export$f99233281efd08a0,o as $5d3850c4d0b4e6c7$export$393edc798c47379d,p as $054eb8030ebde76e$export$2881499e37b75b9a,q as $054eb8030ebde76e$export$be92b6f5f03c0fe9,s as $054eb8030ebde76e$export$f99233281efd08a0,t as $054eb8030ebde76e$export$393edc798c47379d,u as $054eb8030ebde76e$export$e19cd5f9376f8cee,v as $054eb8030ebde76e$export$d5c6c08dc2d3ca7,w as $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,x as $cb5cc270b50c6fcd$export$41fb9f06171c75f4,y as $cb5cc270b50c6fcd$export$602eac185826482c,z as $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,A as $cb5cc270b50c6fcd$export$f39c2d165cd861fe,B as $cb5cc270b50c6fcd$export$21b07c8f274aebd5,D as $67824d98245208a0$export$be92b6f5f03c0fe9,E as $67824d98245208a0$export$adb584737d712b70,F as $e698a72e93240346$export$be92b6f5f03c0fe9,G as $e698a72e93240346$export$adb584737d712b70,H as $faa2e61a3361514f$export$be92b6f5f03c0fe9,I as $faa2e61a3361514f$export$13921ac0cc260818,J as $faa2e61a3361514f$export$9a58ef0d7ad3278c,K as $faa2e61a3361514f$export$6521433ed15a34db,L as $f99a8c78507165f7$export$be92b6f5f03c0fe9,M as $f99a8c78507165f7$export$6d08773d2e66f8f2,N as $f99a8c78507165f7$export$adb584737d712b70,O as $cc7e05a45900e73f$export$6d08773d2e66f8f2,P as $cc7e05a45900e73f$export$d6e5bf9c43ea9319,Q as $cc7e05a45900e73f$export$c3468e2714d175fa,S as $cc7e05a45900e73f$export$be92b6f5f03c0fe9,T as $cc7e05a45900e73f$export$41fb9f06171c75f4,U as $cc7e05a45900e73f$export$4c8d1a57a761ef94,V as $cc7e05a45900e73f$export$f04a61298a47a40f,W as $cc7e05a45900e73f$export$602eac185826482c,X as $cc7e05a45900e73f$export$7c6e2c02157bb7d2,Y as $cc7e05a45900e73f$export$2f60d3ec9ad468f2,Z as $cc7e05a45900e73f$export$d5c6c08dc2d3ca7,_ as $cc7e05a45900e73f$export$bf1aedc3039c8d63,a0 as motion,a1 as MasonryResponsive,a2 as Masonry,a3 as $d94698215c4408a7$export$be92b6f5f03c0fe9,a4 as $d94698215c4408a7$export$2c4cf1f7b42ef78c,a5 as $d94698215c4408a7$export$a455218a85c89869,a6 as $d94698215c4408a7$export$7a7fa4424cb20976,a7 as $d94698215c4408a7$export$f69c19e57285b83a,a8 as $a093c7e1ec25a057$export$2881499e37b75b9a,a9 as $a093c7e1ec25a057$export$be92b6f5f03c0fe9,aa as $a093c7e1ec25a057$export$41fb9f06171c75f4,ab as $a093c7e1ec25a057$export$602eac185826482c,ac as $a093c7e1ec25a057$export$7c6e2c02157bb7d2,ad as $a093c7e1ec25a057$export$21b07c8f274aebd5,ae as $57acba87d6e25586$export$be92b6f5f03c0fe9,af as $57acba87d6e25586$export$d5c6c08dc2d3ca7,ag as $57acba87d6e25586$export$9a4e88b92edfce6b,ah as $57acba87d6e25586$export$6521433ed15a34db}from"./assets/vendor-eabe6dd2.js";const root="",API_URL="https://api.sledge-app.com",INSTANT_SEARCH_ENGINE_URL="https://instant-search-engine.sledge-app.com",SCRIPT_EMBED_ID="sledge-embed-script",SELECTOR_ATTRIBUTE_KEY="data-component",DATASET_ATTRIBUTE_KEY={GLOBAL:{ON_AFTER_ADD_WISHLIST:"data-on-after-add-wishlist",ON_AFTER_REMOVE_WISHLIST:"data-on-after-remove-wishlist",ON_AFTER_ADD_TO_CART:"data-on-after-add-to-cart",ON_AFTER_ADD_REVIEW:"data-on-after-add-review",ON_AFTER_RENDER_PRODUCT:"data-on-after-render-product",PRODUCT_ID:"data-product-id",PRODUCT_VARIANT_ID:"data-product-variant-id",PRODUCT_NAME:"data-product-name",PRODUCT_VENDOR:"data-product-vendor",PRODUCT_SKU:"data-product-sku",PRODUCT_VARIANT_NAME:"data-product-variant-name",PRODUCT_LINK:"data-product-link",PRODUCT_IMAGE:"data-product-image",PRODUCT_CURRENCY:"data-product-currency",PRODUCT_PRICE:"data-product-price",USER_ID:"data-user-id",USER_EMAIL:"data-user-email",USER_FULLNAME:"data-user-fullname",COLLECTION_ID:"data-collection-id",WIDTH_ELEMENT:"data-width-element",ICON_SIZE:"data-icon-size",API_KEY:"data-api-key",INSTANT_SEARCH_API_KEY:"data-instant-search-api-key",RENDER_PRODUCT_CARD:"data-render-product-card",WITH_SKELETON_LOADING:"data-with-skeleton-loading"},WISHLIST:{SHARE_ID:"data-share-id",QUERY_SHARE_ID:"data-query-share-id",CUSTOM_ROUTE_PAGE:"data-custom-route-page",RENDER_WISHLIST_WIDGET_ALERT:"data-render-wishlist-widget-alert",USE_PROXY_URL:"data-use-proxy-url",LIMIT_OPTIONS:"data-limit-options"},PRODUCT_REVIEW:{RATING_SIZE:"data-rating-size",RATING_TOTAL:"data-rating-total",RATING_AVERAGE:"data-rating-average"},INSTANT_SEARCH:{ON_AFTER_RENDER_COLLECTION:"data-on-after-render-collection",ON_AFTER_RENDER_PAGE:"data-on-after-render-page",ON_AFTER_RENDER_BLOG:"data-on-after-render-blog",ON_AFTER_RENDER_ARTICLE:"data-on-after-render-article",QUERY_KEYWORD:"data-query-keyword",RENDER_SUGGESTION_KEYWORD_LIST:"data-render-suggestion-keyword-list",RENDER_OTHER_INDEX_LIST:"data-render-other-index-list",RENDER_SEARCH_VIEW_MORE_RESULT:"data-render-search-view-more-result",RENDER_COLLECTION_CARD:"data-render-collection-card",RENDER_PAGE_CARD:"data-render-page-card",RENDER_BLOG_CARD:"data-render-blog-card",RENDER_ARTICLE_CARD:"data-render-article-card"}},LOCAL_STORAGE_KEY={ANONYM_ID:"sledge-anonym-id",AUTH_APP:"sledge-auth-app",AUTH_APP_VERIFY:"sledge-auth-app-verify",INSTANT_SEARCH_AUTH_APP:"sledge-instant-search-auth-app",GENERAL_SETTING:"sledge-general-setting",WISHLIST_SETTING:"sledge-wishlist-setting",PRODUCT_REVIEW_SETTING:"sledge-product-review-setting",INSTANT_SEARCH_SETTING:"sledge-instant-search-setting",ISSUED_AUTH_APP:"sledge-issued-auth-app",EXPIRED_AUTH_APP:"sledge-expired-auth-app"},INTERNAL_SELECTOR_VALUE={ELEMENT_TOAST_NOTIFICATION:"toast-notification",ELEMENT_CONFIRMATION_POPUP:"confirmation-popup",ELEMENT_INFO_POPUP:"info-popup",ELEMENT_CONTAINER_WIDGET:"container-widget",WISHLIST:{ELEMENT_BADGE_FLOATING_ICON:"wishlist-badge-floating-icon",ELEMENT_BADGE_FLOATING_FULL:"wishlist-badge-floating-full",ELEMENT_WIDGET_POPUP:"wishlist-widget-popup"},PRODUCT_REVIEW:{ELEMENT_WIDGET_POPUP_DETAIL:"product-review-widget-popup-detail",ELEMENT_WIDGET_FORM_ADD:"product-review-widget-form-add"},INSTANT_SEARCH:{ELEMENT_SEARCH_ICON_WIDGET_POPUP:"instant-search-icon-widget-popup"}},SELECTOR={GLOBAL:{ELEMENT_CUSTOM_COMPONENTS:`[${SELECTOR_ATTRIBUTE_KEY}="custom-components"]`},WISHLIST:{ELEMENT_BADGE:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-badge"]`,ELEMENT_BADGE_MENU_ITEM:'[href="#sledge-wishlist-badge-menu-item"]',ELEMENT_TRIGGER:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-trigger"]`,ELEMENT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-widget"]`,ELEMENT_BUTTON_DETAIL:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-button-detail"]`},PRODUCT_REVIEW:{ELEMENT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="product-review-widget"]`,ELEMENT_RATING:`[${SELECTOR_ATTRIBUTE_KEY}="product-review-rating"]`},INSTANT_SEARCH:{ELEMENT_SEARCH_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-widget"]`,ELEMENT_SEARCH_ICON_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-icon-widget"]`,ELEMENT_SEARCH_RESULT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-result-widget"]`,ELEMENT_PLP_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-product-filter-widget"]`}},DEFAULT_LIMIT_VALUE=[12,24,36,48,120],SEARCH_RESULT_URL="/pages/search-result",OBJECT_DATA_STRING_KEY={STORE:{NAME:"{{ shop.name }}"}},ELEMENT_ID={PRODUCT_REVIEW:{ELEMENT_WIDGET:"product-review-widget"}},SHOPIFY_GID="gid://shopify/",SHOPIFY_GID_PRODUCT_ID=`${SHOPIFY_GID}Product/`,PAYLOAD_API_ALIASES={Authorization:"zbNTHXQpW7OmI",Method:"Gba2Tb9Ys7JGu",GET:"JniUtw5dNfeKW",POST:"a9Dmw0qP9hvQE",PUT:"dEnOjbvTzULLK",DELETE:"pLC93Tvsu6g7H"},AES_SECRET_KEY="5l3ge1nt36124ti0n";async function swr(e,t){if("undefined"!=typeof localStorage&&"undefined"!=typeof caches&&"GET"===t.method){const t=await getData(e);return await t.json()}return fetch(e,t).then((e=>e.json()))}async function getData(e){return caches.open("sledge-1").then((t=>t.match(e).then((s=>{const i=fetch(e).then((async s=>{const i=e.split("?")[0],n=await t.matchAll(),o=await n.filter((t=>t.url.includes(i)&&t.url!==e));for(const e of o)await t.delete(e.url);return t.put(e,s.clone()),s}));return s||i}))))}const usePrevious=e=>{const t=React.useRef();return React.useEffect((()=>{t.current=e})),t.current};function useMediaQuery(e){const t=e=>"undefined"!=typeof window&&window.matchMedia(e).matches,[s,i]=reactExports.useState(t(e));function n(){i(t(e))}return reactExports.useEffect((()=>{const t=window.matchMedia(e);return n(),t.addListener?t.addListener(n):t.addEventListener("change",n),()=>{t.removeListener?t.removeListener(n):t.removeEventListener("change",n)}}),[e]),s}const sanitizeDataId=e=>{if(!e)return"";let t=String(e);if(t.includes("shopify")&&t.includes("/")){let e=t.split("/");return e[e.length-1]||t}return t},documentReady=e=>{document.addEventListener("DOMContentLoaded",e)},getTextBetween=e=>{const{start:t,end:s,text:i}=e;if(t&&i.includes(t)&&s&&i.includes(s)){let e=i.indexOf(t)+t.length;return i.substring(e,i.indexOf(s,e))}return i},isFunction=e=>"function"==typeof e,scrollToElement=e=>{const{element:t,headerOffset:s}=e;if(t){var i=(null==t?void 0:t.getBoundingClientRect().top)+window.scrollY-s;window.scrollTo({top:i,behavior:"smooth"})}},getUnixTimestamp=e=>{const{addMoreTime:t=0,addMoreTimeBy:s="day"}=e||{};let i=0;return t&&("day"===s&&(i=60*t*60*24),"hour"===s&&(i=60*t*60),"minute"===s&&(i=60*t),"second"===s&&(i=t)),Math.floor(Date.now()/1e3)+i},fetchApi=async e=>{const{url:t,method:s,authorization:i="",payload:n={},headers:o={},isSimpleRequest:r=!0,isUploadFile:l=!1}=e;var a=new Headers;r||(i&&a.append("Authorization",`Bearer ${i}`),Object.keys(o).length&&Object.keys(o).forEach((function(e){a.append(e,o[e])})));var d=new FormData;(r||l)&&(i&&r&&d.append(PAYLOAD_API_ALIASES.Authorization,i),d.append(PAYLOAD_API_ALIASES.Method,PAYLOAD_API_ALIASES[s]),Object.keys(n).length&&Object.keys(n).forEach((function(e){l&&(null==n?void 0:n.files)&&[...n.files].map((e=>{d.append("files",e,e.name)})),d.append(e,n[e])})));const c=r?"POST":s;var u={method:c,redirect:"follow",headers:a,body:"GET"===c?null:r||l?d:JSON.stringify(n)};return await swr(`${t}`,u)},convertDate=(e,t={timeZone:"Asia/Jakarta",year:"numeric",month:"numeric",day:"numeric"})=>new Date(e).toLocaleString("en-US",t),currentMediaQuery=()=>{let e="xs";return useMediaQuery("(min-width: 425px)")&&(e="sm"),useMediaQuery("(min-width: 768px)")&&(e="md"),useMediaQuery("(min-width: 1024px)")&&(e="lg"),useMediaQuery("(min-width: 1280px)")&&(e="xs"),e},encryptText=e=>CryptoES.AES.encrypt(e,AES_SECRET_KEY).toString(),decryptText=e=>CryptoES.AES.decrypt(e,AES_SECRET_KEY).toString(CryptoES.enc.Utf8),getSettings=async e=>{let t=e||("undefined"!=typeof localStorage?localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP):""),s=`${API_URL}/app/settings?${PAYLOAD_API_ALIASES.Authorization}=${t}`;return await fetchApi({url:s,method:"GET",authorization:t,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getToken=async e=>{const{API_KEY:t,INSTANT_SEARCH_API_KEY:s,USER_ID:i,USER_EMAIL:n,USER_FULLNAME:o,ANONYM_ID:r}=e;let l="",a="",d="",c=0;"undefined"!=typeof localStorage&&(l=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",a=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP_VERIFY)||"",d=localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",c=Number(localStorage.getItem(LOCAL_STORAGE_KEY.EXPIRED_AUTH_APP)));let u=Boolean(String(d.toLowerCase()).includes("anonymous")&&i),x=Boolean(!String(d.toLowerCase()).includes("anonymous")&&!i),p=getUnixTimestamp()<=c,m=!!a&&Boolean(decryptText(a)===t);if(l&&p&&!u&&!x&&m)return{data:{token:l}};let g=`${API_URL}/app/token`,_={user:JSON.stringify({id:i||"",email:n||"",name:o||"",anonym:r||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"")})};return await fetchApi({url:g,method:"POST",authorization:t||"",payload:_}).then((e=>{const{data:i}=e||{},{anonym:n,token:o,iat:r,exp:l}=i||{};return"undefined"!=typeof localStorage&&(localStorage.setItem(LOCAL_STORAGE_KEY.ANONYM_ID,n||""),localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP,o||""),localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP_VERIFY,encryptText(t||"")||""),localStorage.setItem(LOCAL_STORAGE_KEY.ISSUED_AUTH_APP,r||""),localStorage.setItem(LOCAL_STORAGE_KEY.EXPIRED_AUTH_APP,l||""),localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP,s||"")),e})).catch((e=>e))},Loading="",ConfirmationPopup$1="",ConfirmationPopup=()=>{const[e,t]=React.useState(""),[s,i]=React.useState(""),[n,o]=React.useState(null),[r,l]=React.useState(null),[a,d]=React.useState(""),[c,u]=React.useState(!1),[x,p]=React.useState({onSubmit:()=>{}});return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeConfirmationPopup=({title:e,message:s,textSubmit:n,textCancel:r,buttonSubmitType:a,onSubmit:c})=>{u(!0),t(e),i(s),o(n),l(r),d(a),p({onSubmit:c})})}),[]),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$be92b6f5f03c0fe9,{open:c,onOpenChange:u,children:jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($905f4ae918aab1aa$export$c6fdb837b070b4ff,{className:"sledge__alert-dialog-overlay"}),jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$7c6e2c02157bb7d2,{className:"sledge__alert-dialog-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__alert-dialog-content-close",onClick:()=>u(!1),children:jsxRuntimeExports.jsx(CloseIcon,{width:17,height:17,color:"#77757e"})}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$f99233281efd08a0,{className:"sledge__alert-dialog-title",dangerouslySetInnerHTML:{__html:e}}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$393edc798c47379d,{className:"sledge__alert-dialog-description",dangerouslySetInnerHTML:{__html:s}}),jsxRuntimeExports.jsxs("div",{className:"sledge__alert-dialog-footer",children:[jsxRuntimeExports.jsx($905f4ae918aab1aa$export$848c9b7ead0df967,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{role:"button",className:"sledge__alert-dialog-button-cancel",onClick:()=>u(!1),children:r})}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$e19cd5f9376f8cee,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{role:"button",colorType:a,className:"sledge__alert-dialog-button",onClick:()=>{x.onSubmit(),u(!1)},children:n})})]})]})]})})},ConfirmationPopupInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONFIRMATION_POPUP}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONFIRMATION_POPUP),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(ConfirmationPopup,{})})))},InfoPopup$1="",InfoPopup=()=>{const[e,t]=React.useState(""),[s,i]=React.useState(""),[n,o]=React.useState(""),[r,l]=React.useState(!1);return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInfoPopup=({title:e,message:s,textCancel:n})=>{l(!0),t(e),i(s),o(n)})}),[]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:r,onOpenChange:l,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__dialog-overlay"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge__dialog-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__alert-dialog-content-close",onClick:()=>l(!1),children:jsxRuntimeExports.jsx(CloseIcon,{width:17,height:17,color:"#77757e"})}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0,{className:"sledge__dialog-title",dangerouslySetInnerHTML:{__html:e}}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$393edc798c47379d,{className:"sledge__dialog-description",dangerouslySetInnerHTML:{__html:s}}),jsxRuntimeExports.jsx("div",{className:"sledge__dialog-close-button",children:jsxRuntimeExports.jsx("button",{className:"sledge__dialog-button sledge__dialog-button-cancel",onClick:()=>l(!1),children:n})})]})]})})},InfoPopupInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_INFO_POPUP}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_INFO_POPUP),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(InfoPopup,{})})))},ToastNotification$1="",ToastNotification=()=>{const[e,t]=React.useState(!1),[s,i]=React.useState(""),[n,o]=React.useState(""),[r,l]=React.useState(""),[a,d]=React.useState(null),[c,u]=React.useState(""),x=React.useRef(0);return React.useEffect((()=>("undefined"!=typeof window&&(window.sledgeToastNotification=({title:e,message:s,location:n="bottom-right",icon:r=null,type:a})=>{i(e),o(s),l(n),d(r),u(a),t(!1),window.clearTimeout(x.current),x.current=window.setTimeout((()=>{t(!0)}),10)}),()=>clearTimeout(x.current))),[]),jsxRuntimeExports.jsxs($054eb8030ebde76e$export$2881499e37b75b9a,{children:[jsxRuntimeExports.jsxs($054eb8030ebde76e$export$be92b6f5f03c0fe9,{className:"sledge__toast-root",open:e,onOpenChange:t,children:[jsxRuntimeExports.jsxs("div",{className:"sledge__toast-icon-wrapper",children:[a?"string"==typeof a?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:a}}):a:null,jsxRuntimeExports.jsx("div",{className:"sledge__toast-type","data-notification-type":c,children:"success"===c?jsxRuntimeExports.jsx(CheckIcon,{width:15,height:15,color:"white"}):jsxRuntimeExports.jsx(CloseIcon,{width:13.65,height:13.65,color:"white"})})]}),jsxRuntimeExports.jsxs("div",{className:"sledge__toast-message-wrapper",children:[jsxRuntimeExports.jsx($054eb8030ebde76e$export$f99233281efd08a0,{className:"sledge__toast-title",children:s}),jsxRuntimeExports.jsx($054eb8030ebde76e$export$393edc798c47379d,{asChild:!0,children:jsxRuntimeExports.jsx("p",{className:"sledge__toast-description",children:n})})]}),jsxRuntimeExports.jsx("div",{className:"sledge__toast-action-wrapper",children:jsxRuntimeExports.jsx($054eb8030ebde76e$export$e19cd5f9376f8cee,{className:"sledge__toast-action",asChild:!0,altText:"Close notification",children:jsxRuntimeExports.jsx(Button,{colorType:"outlined-danger",children:"Dismiss"})})})]}),jsxRuntimeExports.jsx($054eb8030ebde76e$export$d5c6c08dc2d3ca7,{className:"sledge__toast-viewport","data-location":r})]})},ToastNotificationInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_TOAST_NOTIFICATION}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_TOAST_NOTIFICATION),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(ToastNotification,{})})))},Popover$1="",Popover=({trigger:e,content:t,isOpen:s,setIsOpen:i,hideCloseIcon:n,align:o,className:r,withOpenState:l=!0,withArrow:a=!0,customArrow:d="",sideOffset:c=5,alignOffset:u=0})=>{const[x,p]=React.useState(!!l&&s);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==d?void 0:d.length)&&(t.style.display="inline-flex",t.innerHTML=d)}),[x]),jsxRuntimeExports.jsxs($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{...l&&{open:s},...i&&{onOpenChange:e=>{p(e),i(e)}},children:[jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$41fb9f06171c75f4,{asChild:!0,children:e}),jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{className:`sledge__popover-content ${r||""}`,sideOffset:c,alignOffset:u,align:o,...i&&{onOpenAutoFocus:()=>i(!0),onCloseAutoFocus:()=>i(!1)},children:[t,!n&&jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$f39c2d165cd861fe,{className:"PopoverClose","aria-label":"Close",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),a?jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$21b07c8f274aebd5,{className:"PopoverArrow"}):null]})})]})},Progress$1="",Progress=({value:e,total:t,fillColor:s="",outlineColor:i=""})=>{const[n,o]=React.useState(0);return React.useEffect((()=>{const s=setTimeout((()=>o(+e/t*100)),150);return()=>clearTimeout(s)}),[]),jsxRuntimeExports.jsx($67824d98245208a0$export$be92b6f5f03c0fe9,{className:"sledge__progress",value:n,style:i?{borderWidth:"1px",borderStyle:"solid",borderColor:i}:{},children:jsxRuntimeExports.jsx($67824d98245208a0$export$adb584737d712b70,{className:"ProgressIndicator",style:{transform:`translateX(-${100-n}%)`,...s&&{backgroundColor:s}}})})},Checkbox$1="",Checkbox=({id:e,name:t,value:s,required:i,label:n,checked:o,labelStyle:r={},onClick:l})=>jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",checked:o,id:e,name:t,value:s,required:i,onClick:l,children:jsxRuntimeExports.jsx($e698a72e93240346$export$adb584737d712b70,{className:"sledge__checkbox-indicator",children:jsxRuntimeExports.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.72318 0.237414C10.0707 0.574491 10.0942 1.14584 9.77561 1.51356L4.40976 7.70711C4.25243 7.88871 4.03181 7.99443 3.79903 7.99979C3.56625 8.00514 3.3415 7.90965 3.17686 7.73545L0.250031 4.63868C-0.0833435 4.28595 -0.0833435 3.71406 0.250031 3.36133C0.583405 3.00859 1.12391 3.00859 1.45729 3.36133L3.75367 5.79105L8.51706 0.292899C8.83564 -0.0748211 9.37564 -0.0996624 9.72318 0.237414Z",fill:"white"})})})}),n&&jsxRuntimeExports.jsx("label",{className:"sledge__checkbox-label",htmlFor:e,style:r,children:n})]}),Slider$1="",Slider=e=>{const{defaultValue:t,min:s,max:i,step:n=1,setValueCommit:o,setValueChange:r}=e,[l,a]=React.useState(t);return jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsxs($faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:t,...void 0!==s?{min:s}:{},max:i,step:n,"aria-label":"Volume",onValueCommit:e=>{o&&o(e),a(e)},onValueChange:e=>{r&&r(e),a(e)},children:[jsxRuntimeExports.jsx($faa2e61a3361514f$export$13921ac0cc260818,{className:"sledge__SliderTrack",children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$9a58ef0d7ad3278c,{className:"sledge__SliderRange"})}),jsxRuntimeExports.jsx(Tooltip,{content:l[0],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#43c6ac"/></svg>',wrapTrigger:!1,children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),jsxRuntimeExports.jsx(Tooltip,{content:l[1],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#43c6ac"/></svg>',wrapTrigger:!1,children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})})]})})},Pagination$1="",Pagination=({currentPage:e,totalPage:t,totalResult:s,onChange:i})=>{const n=1===e,o=e===t;return jsxRuntimeExports.jsxs("div",{className:"sledge__pagination",children:[jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...n?{disabled:!0}:{onClick:()=>i(e-1)},children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"black"})}),jsxRuntimeExports.jsxs("span",{children:["Page ",e," of ",t," - total ",s," result"]}),jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...o?{disabled:!0}:{onClick:()=>i(e+1)},children:jsxRuntimeExports.jsx(ChevronArrowRightIcon,{width:16,height:16,color:"black"})})]})},RadioGroup$1="",RadioGroup=({id:e,name:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:r})=>jsxRuntimeExports.jsx("div",{className:"sledge__radio-group-wrapper",children:jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsx($f99a8c78507165f7$export$be92b6f5f03c0fe9,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:i,id:e,name:t,required:s,onValueChange:r,children:n.map(((t,s)=>{const{label:i,value:n}=t;return jsxRuntimeExports.jsxs("div",{className:"sledge__radio-group-item-flex",children:[jsxRuntimeExports.jsx($f99a8c78507165f7$export$6d08773d2e66f8f2,{className:"sledge__radio-group-item",value:n,id:`${e}${s}`,children:jsxRuntimeExports.jsx($f99a8c78507165f7$export$adb584737d712b70,{className:"sledge__radio-group-indicator"})}),jsxRuntimeExports.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${e}${s}`,style:o,children:i})]},s)}))})})}),ColorSwatch$1="",ColorSwatch=({id:e,name:t,value:s,rgb:i,image:n,required:o,defaultChecked:r,onClick:l})=>{const a={...(null==n?void 0:n.length)?{backgroundImage:`url(${n})`}:{backgroundColor:i}};return jsxRuntimeExports.jsx("div",{className:"sledge__color-swatch-wrapper",children:jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__color-swatch-root",defaultChecked:r,id:e,name:t,value:s,required:o,onClick:l,style:a})})},Select$1="",Select=({name:e,placeholder:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:r})=>jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:e,required:s,onValueChange:r,children:[jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$41fb9f06171c75f4,{className:"sledge__select-trigger",children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$4c8d1a57a761ef94,{placeholder:t}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$f04a61298a47a40f,{className:"sledge__select-icon",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$7c6e2c02157bb7d2,{className:"sledge__select-content",children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$2f60d3ec9ad468f2,{className:"sledge__select-scroll-button",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d5c6c08dc2d3ca7,{className:"sledge__select-viewport",children:n.map(((e,t)=>{const{label:s,value:i}=e;return jsxRuntimeExports.jsx(SelectItemComponent,{value:i,children:s},t)}))}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$bf1aedc3039c8d63,{className:"sledge__select-scroll-button",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]})})]})}),SelectItemComponent=React.forwardRef((({children:e,className:t="",...s},i)=>jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$6d08773d2e66f8f2,{className:`sledge__select-item ${t}`,...s,ref:i,children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d6e5bf9c43ea9319,{children:e}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$c3468e2714d175fa,{className:"sledge__select-item-indicator",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}))),HeartIcon=({width:e,height:t,type:s,color:i})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__heart",children:"outline"===s?jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:i,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.19515 0.86581C10.5501 0.00914308 12.3501 -0.227524 13.9051 0.27081C17.2876 1.36164 18.3376 5.04914 17.3985 7.98331C15.9493 12.5916 9.76015 16.0291 9.49765 16.1733C9.40431 16.225 9.30098 16.2508 9.19765 16.2508C9.09431 16.2508 8.99181 16.2258 8.89848 16.175C8.63765 16.0325 2.49348 12.6458 0.995979 7.98414L0.995146 7.98331C0.0551462 5.04831 1.10181 1.35998 4.48098 0.27081C6.06765 -0.242524 7.79681 -0.0166903 9.19515 0.86581ZM4.86431 1.46081C2.13015 2.34248 1.44348 5.28331 2.18598 7.60248C3.35431 11.2375 7.97015 14.1766 9.19681 14.9041C10.4276 14.1691 15.0768 11.1975 16.2076 7.60581C16.9501 5.28414 16.261 2.34331 13.5226 1.46081C12.196 1.03498 10.6485 1.29414 9.58015 2.12081C9.35681 2.29248 9.04681 2.29581 8.82181 2.12581C7.69015 1.27498 6.21181 1.02581 4.86431 1.46081ZM12.7226 3.11573C13.8585 3.48323 14.6543 4.48906 14.7518 5.67823C14.7793 6.02239 14.5235 6.32406 14.1793 6.35156C14.1618 6.35323 14.1451 6.35406 14.1276 6.35406C13.8051 6.35406 13.5318 6.10656 13.5051 5.77989C13.4501 5.09489 12.9918 4.51656 12.3393 4.30573C12.0101 4.19906 11.8301 3.84656 11.936 3.51906C12.0435 3.19073 12.3926 3.01239 12.7226 3.11573Z"})}):jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:i,children:jsxRuntimeExports.jsx("path",{d:"M5.89936 0.0838691C6.42436 0.0998355 6.9327 0.191502 7.4252 0.359002H7.47436C7.5077 0.374836 7.5327 0.392336 7.54936 0.408169C7.73353 0.467336 7.9077 0.534002 8.07436 0.625669L8.39103 0.767336C8.51603 0.834002 8.66603 0.958169 8.74936 1.009C8.8327 1.05817 8.92436 1.109 8.99936 1.1665C9.9252 0.459002 11.0494 0.0756688 12.2077 0.0838691C12.7335 0.0838691 13.2585 0.158169 13.7577 0.325669C16.8335 1.32567 17.9419 4.70067 17.016 7.65067C16.491 9.15817 15.6327 10.534 14.5085 11.6582C12.8994 13.2165 11.1335 14.5998 9.2327 15.7915L9.02436 15.9173L8.8077 15.7832C6.9002 14.5998 5.12436 13.2165 3.5002 11.6498C2.38353 10.5257 1.52436 9.15817 0.991029 7.65067C0.0493627 4.70067 1.1577 1.32567 4.26686 0.308169C4.50853 0.224836 4.7577 0.166502 5.0077 0.134002H5.1077C5.34186 0.0998355 5.57436 0.0838691 5.8077 0.0838691H5.89936ZM13.3244 2.71734C12.9827 2.59984 12.6077 2.784 12.4827 3.134C12.366 3.484 12.5494 3.86734 12.8994 3.9915C13.4335 4.1915 13.791 4.71734 13.791 5.29984V5.32567C13.7752 5.5165 13.8327 5.70067 13.9494 5.84234C14.066 5.984 14.241 6.0665 14.4244 6.084C14.766 6.07484 15.0577 5.80067 15.0827 5.44984V5.35067C15.1077 4.18317 14.4002 3.12567 13.3244 2.71734Z"})})}),ChevronArrowDownIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-down",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Arrow - Down 2",children:jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:jsxRuntimeExports.jsx("g",{id:"Arrow---Down-2",children:jsxRuntimeExports.jsx("path",{id:"Stroke-1",d:"M3.72407 6.6414C3.94596 6.41951 4.29318 6.39934 4.53786 6.58089L4.60796 6.6414L9.99935 12.0325L15.3907 6.6414C15.6126 6.41951 15.9598 6.39934 16.2045 6.58089L16.2746 6.6414C16.4965 6.86329 16.5167 7.21051 16.3351 7.45519L16.2746 7.52529L10.4413 13.3586C10.2194 13.5805 9.87218 13.6007 9.62751 13.4191L9.55741 13.3586L3.72407 7.52529C3.48 7.28121 3.48 6.88548 3.72407 6.6414Z",fill:s})})})})})}),ChevronArrowLeftIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-left",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M10.6875 2.97945C10.865 3.15697 10.8812 3.43474 10.7359 3.63048L10.6875 3.68656L6.37465 7.99967L10.6875 12.3128C10.865 12.4903 10.8812 12.7681 10.7359 12.9638L10.6875 13.0199C10.51 13.1974 10.2323 13.2135 10.0365 13.0683L9.98043 13.0199L5.31377 8.35323C5.13625 8.17572 5.12012 7.89794 5.26535 7.7022L5.31377 7.64612L9.98043 2.97945C10.1757 2.78419 10.4923 2.78419 10.6875 2.97945Z",fill:s})})}),ChevronArrowRightIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.60738 13.1302C5.42987 12.9527 5.41374 12.675 5.55897 12.4792L5.60738 12.4231L9.92027 8.11002L5.60738 3.79691C5.42987 3.6194 5.41374 3.34162 5.55897 3.14588L5.60738 3.0898C5.7849 2.91229 6.06267 2.89615 6.25841 3.04139L6.31449 3.0898L10.9812 7.75647C11.1587 7.93398 11.1748 8.21175 11.0296 8.4075L10.9812 8.46357L6.31449 13.1302C6.11923 13.3255 5.80265 13.3255 5.60738 13.1302Z",fill:s})})}),ArrowRightIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3 8.79429C3 8.50952 3.21162 8.27418 3.48617 8.23693L3.5625 8.23179L13.4505 8.23224L9.87826 4.6746C9.65812 4.4554 9.65735 4.09925 9.87655 3.8791C10.0758 3.67897 10.3883 3.66015 10.6088 3.82306L10.672 3.87739L15.2095 8.39539C15.2386 8.42428 15.2638 8.45555 15.2852 8.48858C15.2912 8.49852 15.2973 8.50869 15.3032 8.51906C15.3085 8.52795 15.3134 8.53718 15.318 8.54652C15.3243 8.5601 15.3305 8.57413 15.3361 8.58845C15.3407 8.59949 15.3445 8.61023 15.348 8.62105C15.3522 8.63447 15.3562 8.64877 15.3597 8.66329C15.3622 8.67343 15.3643 8.68319 15.3661 8.69298C15.3686 8.70755 15.3707 8.72263 15.3722 8.73789C15.3735 8.74953 15.3743 8.76106 15.3747 8.77261C15.3749 8.77961 15.375 8.78693 15.375 8.79429L15.3747 8.81608C15.3743 8.82712 15.3735 8.83815 15.3725 8.84916L15.375 8.79429C15.375 8.82979 15.3717 8.86452 15.3654 8.89819C15.364 8.90623 15.3622 8.91449 15.3603 8.92271C15.3563 8.93964 15.3517 8.95595 15.3464 8.97194C15.3438 8.97988 15.3407 8.98837 15.3375 8.99679C15.3309 9.01371 15.3238 9.02985 15.3159 9.04557C15.3122 9.05296 15.3082 9.06069 15.3039 9.06835C15.2968 9.08084 15.2896 9.09272 15.2819 9.10429C15.2765 9.11248 15.2706 9.12101 15.2643 9.1294L15.2594 9.13588C15.2443 9.15568 15.2278 9.17444 15.2102 9.19204L15.2096 9.19256L10.6721 13.7113C10.4519 13.9305 10.0958 13.9298 9.87658 13.7097C9.67729 13.5096 9.65979 13.197 9.82363 12.9771L9.87823 12.9142L13.449 9.35724L3.5625 9.35679C3.25184 9.35679 3 9.10495 3 8.79429Z",fill:s})})}),BagIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__bag",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"vuesax/bold/bag-2",children:jsxRuntimeExports.jsx("g",{id:"bag-2",children:jsxRuntimeExports.jsx("path",{id:"Vector",d:"M14.3711 6.04627C13.919 5.54693 13.2374 5.25677 12.2927 5.15555V4.64271C12.2927 3.71824 11.9013 2.82752 11.2131 2.20671C10.518 1.57241 9.6138 1.2755 8.67584 1.36322C7.06309 1.51842 5.70676 3.07719 5.70676 4.76417V5.15555C4.76205 5.25677 4.08051 5.54693 3.6284 6.04627C2.97385 6.77505 2.9941 7.74674 3.06833 8.42154L3.54068 12.1801C3.68238 13.496 4.21547 14.8455 7.11707 14.8455H10.8824C13.784 14.8455 14.3171 13.496 14.4588 12.1869L14.9312 8.41479C15.0054 7.74674 15.0189 6.77505 14.3711 6.04627ZM8.77031 2.30118C9.4451 2.24045 10.0862 2.44963 10.5855 2.90174C11.0781 3.34711 11.3548 3.98141 11.3548 4.64271V5.11506H6.64472V4.76417C6.64472 3.56304 7.63666 2.40915 8.77031 2.30118ZM6.58399 8.87365H6.57724C6.2061 8.87365 5.90245 8.56999 5.90245 8.19885C5.90245 7.82772 6.2061 7.52406 6.57724 7.52406C6.95512 7.52406 7.25878 7.82772 7.25878 8.19885C7.25878 8.56999 6.95512 8.87365 6.58399 8.87365ZM11.3075 8.87365H11.3008C10.9296 8.87365 10.626 8.56999 10.626 8.19885C10.626 7.82772 10.9296 7.52406 11.3008 7.52406C11.6787 7.52406 11.9823 7.82772 11.9823 8.19885C11.9823 8.56999 11.6787 8.87365 11.3075 8.87365Z",fill:s})})})})}),CheckIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__check",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.90625 11.1562L2.40625 7.65625L3.07812 6.98438L5.90625 9.8125L11.9062 3.8125L12.5781 4.48438L5.90625 11.1562Z",fill:s})})}),CloseIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__close",children:jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:e,height:t,children:jsxRuntimeExports.jsx("path",{d:"m11.414 10 6.293-6.293a1 1 0 1 0-1.414-1.414l-6.293 6.293-6.293-6.293a1 1 0 0 0-1.414 1.414l6.293 6.293-6.293 6.293a1 1 0 1 0 1.414 1.414l6.293-6.293 6.293 6.293a.998.998 0 0 0 1.707-.707.999.999 0 0 0-.293-.707l-6.293-6.293z",fill:s})})}),StarIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__star",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M8.68841 19.8162L8.75567 19.4179L8.44456 19.1604L2.64616 14.3604L2.64622 14.3603L2.63697 14.3529C2.02964 13.8672 2.28424 12.8955 3.04396 12.7636L11.2293 12.3989L11.6809 12.3788L11.8484 11.959L15.3475 3.18648C15.4773 2.94796 15.7259 2.79961 15.9982 2.79961C16.2692 2.79961 16.5188 2.94848 16.6491 3.18698L20.148 11.959L20.3155 12.3788L20.767 12.3989L28.9524 12.7636C29.7121 12.8955 29.9667 13.8672 29.3594 14.3529L29.3593 14.3528L29.3502 14.3604L23.5518 19.1604L23.2407 19.4179L23.308 19.8162L24.8887 29.1774C24.9836 29.8833 24.2616 30.4104 23.6226 30.1159L16.3737 25.5088L15.9983 25.2702L15.6228 25.5088L8.37397 30.1141C7.73341 30.409 7.01273 29.8817 7.1077 29.1758L8.68841 19.8162Z",stroke:s,strokeWidth:"1.4"})})}),UploadIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__upload",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.8253 11.7254C10.3773 11.7254 10.8253 12.1734 10.8253 12.7254C10.8253 13.2774 10.3773 13.7254 9.8253 13.7254H8.5813C6.42264 13.7254 4.66797 15.4801 4.66797 17.6374V24.1374C4.66797 26.2961 6.42264 28.0507 8.5813 28.0507H23.4213C25.5786 28.0507 27.3346 26.2961 27.3346 24.1374V17.6254C27.3346 15.4747 25.5853 13.7254 23.436 13.7254H22.1786C21.6266 13.7254 21.1786 13.2774 21.1786 12.7254C21.1786 12.1734 21.6266 11.7254 22.1786 11.7254H23.436C26.688 11.7254 29.3346 14.3721 29.3346 17.6254V24.1374C29.3346 27.3987 26.6813 30.0507 23.4213 30.0507H8.5813C5.3213 30.0507 2.66797 27.3987 2.66797 24.1374V17.6374C2.66797 14.3774 5.3213 11.7254 8.5813 11.7254H9.8253ZM16.7088 2.9622L20.5968 6.8662C20.9861 7.2582 20.9848 7.8902 20.5941 8.27953C20.2021 8.66887 19.5701 8.66887 19.1808 8.27687L17 6.08853L17.0008 20.7213H15.0008L15 6.08853L12.8221 8.27687C12.6274 8.4742 12.3701 8.57153 12.1141 8.57153C11.8594 8.57153 11.6034 8.4742 11.4088 8.27953C11.0181 7.8902 11.0154 7.2582 11.4061 6.8662L15.2928 2.9622C15.6674 2.58487 16.3341 2.58487 16.7088 2.9622Z",fill:s})})}),SearchIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__search",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.78283 2.16669C14.2578 2.16669 17.8978 5.80669 17.8978 10.2817C17.8978 12.393 17.0876 14.3186 15.7617 15.7638L18.3707 18.3673C18.6148 18.6114 18.6157 19.0064 18.3715 19.2506C18.2498 19.3739 18.089 19.4348 17.929 19.4348C17.7698 19.4348 17.6098 19.3739 17.4873 19.2523L14.8469 16.6192C13.4579 17.7316 11.6967 18.3975 9.78283 18.3975C5.30783 18.3975 1.66699 14.7567 1.66699 10.2817C1.66699 5.80669 5.30783 2.16669 9.78283 2.16669ZM9.78283 3.41669C5.99699 3.41669 2.91699 6.49585 2.91699 10.2817C2.91699 14.0675 5.99699 17.1475 9.78283 17.1475C13.5678 17.1475 16.6478 14.0675 16.6478 10.2817C16.6478 6.49585 13.5678 3.41669 9.78283 3.41669Z",fill:s})})}),MessageAddIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__message-add",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"vuesax/bold/message-add",children:jsxRuntimeExports.jsx("g",{id:"message-add",children:jsxRuntimeExports.jsx("path",{id:"Vector",d:"M11.1666 1.33301H5.83325C3.16659 1.33301 1.83325 2.66634 1.83325 5.33301V13.9997C1.83325 14.3663 2.13325 14.6663 2.49992 14.6663H11.1666C13.8333 14.6663 15.1666 13.333 15.1666 10.6663V5.33301C15.1666 2.66634 13.8333 1.33301 11.1666 1.33301ZM10.8333 8.49967H8.99992V10.333C8.99992 10.6063 8.77325 10.833 8.49992 10.833C8.22658 10.833 7.99992 10.6063 7.99992 10.333V8.49967H6.16658C5.89325 8.49967 5.66658 8.27301 5.66658 7.99967C5.66658 7.72634 5.89325 7.49967 6.16658 7.49967H7.99992V5.66634C7.99992 5.39301 8.22658 5.16634 8.49992 5.16634C8.77325 5.16634 8.99992 5.39301 8.99992 5.66634V7.49967H10.8333C11.1066 7.49967 11.3333 7.72634 11.3333 7.99967C11.3333 8.27301 11.1066 8.49967 10.8333 8.49967Z",fill:s})})})})}),SwapIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__swap",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Swap",children:jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Swap",children:jsxRuntimeExports.jsx("g",{id:"Swap_2",children:jsxRuntimeExports.jsx("path",{id:"Combined-Shape",d:"M11.7263 3.864C11.9795 3.864 12.1887 4.0521 12.2218 4.29616L12.2263 4.364L12.2262 12.2307L14.0904 10.359C14.2852 10.1633 14.6018 10.1626 14.7975 10.3574C14.9754 10.5345 14.9922 10.8122 14.8474 11.0083L14.7991 11.0645L12.0806 13.7956C12.0642 13.8117 12.0476 13.8263 12.03 13.8398L12.0806 13.7956C12.0561 13.8203 12.0296 13.8418 12.0017 13.8603C11.992 13.8663 11.9819 13.8725 11.9715 13.8784C11.9619 13.8842 11.9522 13.8892 11.9423 13.894C11.9325 13.8983 11.9226 13.9027 11.9125 13.9067C11.8998 13.9122 11.8866 13.9168 11.8734 13.9209C11.8656 13.9229 11.8576 13.9252 11.8495 13.9272C11.8351 13.9312 11.8206 13.9342 11.8061 13.9365C11.7993 13.9373 11.7921 13.9383 11.7849 13.9391C11.7685 13.9414 11.7522 13.9425 11.7359 13.9428C11.7327 13.9425 11.7295 13.9425 11.7263 13.9425L11.7166 13.9428C11.7003 13.9425 11.684 13.9414 11.6678 13.9395L11.7263 13.9425C11.6991 13.9425 11.6724 13.9403 11.6463 13.9362C11.6319 13.9342 11.6174 13.9312 11.6031 13.9276C11.5955 13.9253 11.5879 13.9232 11.5804 13.9209C11.566 13.9169 11.5518 13.9118 11.5378 13.9061C11.5301 13.9026 11.5227 13.8994 11.5154 13.896C11.5038 13.891 11.4923 13.8851 11.4809 13.8787C11.4707 13.8725 11.4606 13.8663 11.4508 13.8598C11.4431 13.8552 11.4355 13.8499 11.428 13.8443L11.4227 13.8398C11.4051 13.8263 11.3884 13.8117 11.3728 13.7961L11.3719 13.7956L8.65336 11.0645C8.45855 10.8688 8.45928 10.5522 8.65499 10.3574C8.83292 10.1803 9.11073 10.1648 9.30613 10.3105L9.3621 10.359L11.2262 12.232L11.2263 4.364C11.2263 4.08786 11.4502 3.864 11.7263 3.864ZM5.10736 2.05497L5.1171 2.05469C5.13339 2.055 5.14967 2.05611 5.16588 2.058L5.10736 2.05497C5.1346 2.05497 5.16133 2.05714 5.18739 2.06133C5.20164 2.06328 5.21594 2.06623 5.23012 2.0698C5.23846 2.07225 5.24696 2.07463 5.25536 2.07723C5.26849 2.08093 5.2812 2.08543 5.29374 2.09046C5.30281 2.0945 5.31199 2.09851 5.32103 2.10279C5.33176 2.10743 5.34234 2.11289 5.35274 2.11876C5.36166 2.12425 5.37048 2.12959 5.37912 2.1352C5.38801 2.14048 5.39691 2.14667 5.40565 2.15318L5.4618 2.20186L8.18032 4.93297C8.37513 5.12868 8.3744 5.44527 8.17869 5.64008C8.00077 5.81718 7.72295 5.83267 7.52755 5.68698L7.47158 5.63844L5.60692 3.76469L5.60736 11.6335C5.60736 11.9096 5.3835 12.1335 5.10736 12.1335C4.85423 12.1335 4.64503 11.9454 4.61192 11.7013L4.60736 11.6335L4.60692 3.76535L2.74329 5.63844C2.56618 5.81636 2.28845 5.83314 2.09237 5.68836L2.03618 5.64008C1.85826 5.46298 1.84148 5.18524 1.98626 4.98916L2.03455 4.93297L4.75306 2.20186L4.78251 2.17486C4.78942 2.16895 4.7965 2.16322 4.80373 2.15768L4.75306 2.20186C4.77759 2.17722 4.80405 2.15567 4.83195 2.13721C4.84168 2.13115 4.8518 2.12496 4.86214 2.11912C4.87175 2.11333 4.88152 2.10825 4.8914 2.10352C4.90117 2.0992 4.91107 2.09484 4.92114 2.09079C4.93393 2.08533 4.94704 2.0807 4.9603 2.07663C4.96836 2.07446 4.97662 2.07215 4.98496 2.07006C4.99839 2.06637 5.01197 2.06355 5.02562 2.06129C5.03383 2.06027 5.04188 2.05915 5.04999 2.05822C5.06542 2.0561 5.08126 2.05503 5.0971 2.0547C5.1006 2.055 5.10398 2.05497 5.10736 2.05497Z",fill:s})})})})})}),NoteIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__note",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"vuesax/bold/note-2",children:[jsxRuntimeExports.jsx("path",{id:"Vector",d:"M8.95178 13.3046C9.13494 13.3473 9.15172 13.5871 8.97332 13.6466L7.91998 13.9933C5.27332 14.8466 3.87998 14.1333 3.01998 11.4866L2.16665 8.85328C1.31332 6.20661 2.01998 4.80661 4.66665 3.95328L4.67731 3.94975C5.08018 3.81633 5.48102 4.22359 5.37901 4.63553C5.37264 4.66126 5.3663 4.68718 5.35998 4.71328L4.70665 7.50661C3.97332 10.6466 5.04665 12.3799 8.18665 13.1266L8.95178 13.3046Z",fill:s}),jsxRuntimeExports.jsx("path",{id:"Vector_2",d:"M11.9467 2.14033L10.8334 1.88033C8.6067 1.35366 7.28004 1.787 6.50004 3.40033C6.30004 3.807 6.14004 4.30033 6.00671 4.867L5.35337 7.66033C4.70004 10.447 5.56004 11.8203 8.34004 12.4803L9.46004 12.747C9.8467 12.8403 10.2067 12.9003 10.54 12.927C12.62 13.127 13.7267 12.1537 14.2867 9.747L14.94 6.96033C15.5934 4.17366 14.74 2.79366 11.9467 2.14033ZM10.6934 8.887C10.6334 9.11366 10.4334 9.26033 10.2067 9.26033C10.1667 9.26033 10.1267 9.25366 10.08 9.247L8.14004 8.75366C7.87337 8.687 7.71337 8.41366 7.78004 8.147C7.84671 7.88033 8.12004 7.72033 8.38671 7.787L10.3267 8.28033C10.6 8.347 10.76 8.62033 10.6934 8.887ZM12.6467 6.63366C12.5867 6.86033 12.3867 7.007 12.16 7.007C12.12 7.007 12.08 7.00033 12.0334 6.99366L8.80004 6.17366C8.53337 6.107 8.37337 5.83366 8.44004 5.567C8.50671 5.30033 8.78004 5.14033 9.04671 5.207L12.28 6.027C12.5534 6.087 12.7134 6.36033 12.6467 6.63366Z",fill:s})]})})}),Button$1="",Button=React.forwardRef(((e,t)=>{const{className:s="",children:i,colorType:n="light",fullWidth:o=!1,elementType:r="button",link:l="",...a}=e;return"hyperlink"===r&&(null==l?void 0:l.length)?jsxRuntimeExports.jsx("a",{href:l,className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":o,ref:t,...a,children:i}):jsxRuntimeExports.jsx("button",{className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":o,ref:t,...a,children:i})})),SearchInputField$1="",SearchInputField=e=>{const{className:t="",icon:s,value:i="",withClearField:n,onChange:o,onResetField:r,fieldRef:l,...a}=e,[d,c]=React.useState(!1);return React.useEffect((()=>{c(Boolean(i))}),[i]),jsxRuntimeExports.jsxs("div",{className:`sledge__search-input-field-wrapper ${t||""}`,children:[s?jsxRuntimeExports.jsx("div",{className:"sledge__search-input-field-icon",children:s}):null,jsxRuntimeExports.jsx("input",{className:"sledge__search-input-field",value:i,onChange:e=>(e=>{o&&o({value:e.target.value})})(e),ref:l,...a}),d&&n?jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==l?void 0:l.current)&&l.current.focus(),o&&o({value:""}),r&&r()},children:jsxRuntimeExports.jsx(CloseIcon,{width:14,height:14,color:"#393d4e"})})}):null]})},SelectField$1="",ROTATE_FILTER_ARROW_ANIMATION={open:{rotate:180},closed:{rotate:0},transition:{type:"spring",duration:.2}},VISIBLE_ANIMATION={hidden:{opacity:0,scale:0},visible:e=>{const{duration:t}=e||{};return{opacity:1,scale:1,transition:{type:"spring",duration:t||.7}}}},SelectField=e=>{var t;const{className:s="",placeholder:i=null,prefixLabel:n=null,prefixSelectedLabel:o="",align:r="end",onChange:l,value:a="",options:d=[],LinkComponent:c,link:u}=e,[x,p]=React.useState(!1),m=i&&!a?i:null==(t=null==d?void 0:d.filter((({value:e})=>e===a))[0])?void 0:t.label;return jsxRuntimeExports.jsx("div",{className:`sledge__select-field-wrapper ${s||""}`,children:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs("button",{type:"button",className:"sledge__button sledge__select-field","data-button-color-type":"light","data-button-full-width":"true",children:[n?jsxRuntimeExports.jsx("span",{className:"sledge__select-field-icon",children:n}):null,jsxRuntimeExports.jsx("span",{children:(null==o?void 0:o.length)?`${o} ${m}`:m}),jsxRuntimeExports.jsx(motion.div,{initial:"closed",animate:x?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,className:"sort-trigger-icon",children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:18,height:18,color:"#000000"})})]}),content:jsxRuntimeExports.jsx("ul",{className:"sledge__select-field-option",children:null==d?void 0:d.map(((e,t)=>{const{label:s,value:i}=e,n=()=>jsxRuntimeExports.jsx("li",{onClick:()=>((e,t)=>{l&&l({label:e,value:t}),p(!1)})(s,i),...i===a&&{"data-selected":!0},children:s},t);return c?jsxRuntimeExports.jsx(c,{scroll:!1,to:null==u?void 0:u.replace("value",i),href:null==u?void 0:u.replace("value",i),children:jsxRuntimeExports.jsx(n,{})},t):jsxRuntimeExports.jsx(n,{},t)}))}),isOpen:x,setIsOpen:p,hideCloseIcon:!0,align:r,className:"sledge__select-field-option-content",withArrow:!1})})},ProductGrid$1="",addToCart=async e=>{var t,s;let i=[];if(e.map((e=>{const{id:t,quantity:s}=e;i.push({id:sanitizeDataId(t),quantity:s})})),"undefined"==typeof window||!(null==(s=null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)?void 0:s.root))return;let n=`${window.Shopify.routes.root}cart/add.js`,o={items:i};return await fetchApi({url:n,method:"POST",payload:o,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getReview=async(e,t,s)=>{const{page:i,limit:n,sort:o,keyword:r,rating:l}=t||{};let a=sanitizeDataId(e),d=s||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||""),c="?"+new URLSearchParams({[PAYLOAD_API_ALIASES.Authorization]:d,page:i||"",limit:n||"",sort:o||"",keyword:r||"",rating:l||""}).toString(),u=`${API_URL}/review/${a}${c}`;return await fetchApi({url:u,method:"GET",authorization:d,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getReviewInfo=async e=>{let t=sanitizeDataId(e),s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",i=`${API_URL}/review/info/${t}?${PAYLOAD_API_ALIASES.Authorization}=${s}`;return await fetchApi({url:i,method:"GET",authorization:s,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getProductsReviewInfo=async(e,t)=>{let s=e.map((e=>sanitizeDataId(e))),i=t||("undefined"!=typeof localStorage&&(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP))||""),n=`${API_URL}/review/info/ids/${s.join(",")}?${PAYLOAD_API_ALIASES.Authorization}=${i}`;return await fetchApi({url:n,method:"GET",authorization:i,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getReviewMedia=async()=>{let e="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",t=`${API_URL}/review/usermedia`;return await fetchApi({url:t,method:"GET",authorization:e}).then((e=>e)).catch((()=>{}))},addReviewMedia=async e=>{let t="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=`${API_URL}/review/media`,i={files:e};return await fetchApi({url:s,method:"POST",authorization:t,payload:i,headers:{},isSimpleRequest:!1,isUploadFile:!0}).then((e=>e)).catch((()=>{}))},deleteReviewMedia=async e=>{let t="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=`${API_URL}/review/usermedia/${e}`;return await fetchApi({url:s,method:"DELETE",authorization:t}).then((e=>e)).catch((()=>{}))},addReview=async e=>{const{userFirstName:t,userLastName:s,userEmail:i,productId:n,productVariantId:o,rating:r,title:l,review:a,mediaIds:d}=e;let c="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",u=`${API_URL}/review`,x={user:JSON.stringify({name:`${t}${s?` ${s}`:""}`,email:i}),product:JSON.stringify({id:sanitizeDataId(n),variant_id:sanitizeDataId(o)}),review:JSON.stringify({rating:r,title:l,review:a,media_ids:d})};return await fetchApi({url:u,method:"POST",authorization:c,payload:x}).then((e=>e)).catch((()=>{}))},Rating=e=>{var t,s,i;const{total:n,average:o,size:r="sm",params:l,withSkeletonLoading:a=!0,withTotal:d=!0,isScrollToElementWidget:c=!0,data:u,sledgeSettings:x}=e,{productId:p}=l||{},{isRenderApp:m,triggerRenderMultipleComponent:g}=React.useContext(SledgeContext),{productReview:_}=m||{},{value:R,trigger:E}=(null==(t=null==g?void 0:g.productReview)?void 0:t.rating)||{},h=!u&&void 0===n&&void 0===o,[j,v]=React.useState(h),[T,w]=React.useState(h),[S,A]=React.useState(u||void 0!==n||void 0!==o?r&&"string"==typeof r?getSizing(r):{width:null==r?void 0:r.width,height:null==r?void 0:r.height}:{width:0,height:0}),[f,C]=React.useState((null==u?void 0:u.review_count)||n||0),[L,I]=React.useState((null==(s=null==u?void 0:u.rating)?void 0:s.average)||o||"0"),[N,O]=React.useState((null==x?void 0:x.review)||{}),[y,b]=React.useState(!0),D=usePrevious({productId:p}),{fill_color:P="#23BC45",outline_color:$="#8D9196"}=(null==(i=null==N?void 0:N.display)?void 0:i.rating)||{},U=async(e,t=!1)=>{var s;if(e!==p)return;let i,n,o,r=!1,l=0;if(u&&y)o=u,r=!0,b(!1);else{if(i=await getReviewInfo(e),!i)return;const{status:t}=i;o=i.data;const{code:s}=t;r=200===s||!1}l=(null==o?void 0:o.review_count)?o.review_count:0,n=(null==(s=null==o?void 0:o.rating)?void 0:s.average)?o.rating.average:0,r&&(C(l),I(n),w(!1),v(!1),t&&R&&E&&E(""))},W=async e=>{let t;w(!0),t=JSON.parse(e),t&&(O(t),await(async()=>{void 0!==n||void 0!==o?w(!1):U(p)})())};return React.useEffect((()=>{if(!_)return;"xs"===r?A({width:14,height:14}):"sm"===r?A({width:20,height:20}):"md"===r&&A({width:32,height:32}),Boolean(D&&(null==D?void 0:D.productId)!==p)&&v(!0),W(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||null)}),[_,p]),React.useEffect((()=>{!p||p&&R!==p||(E&&E(""),v(!0),U(R,!0))}),[p,R]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{c&&setTimeout((()=>{scrollToElement({element:document.getElementById(ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET),headerOffset:50})}),200)},"data-rating-size":r,children:j&&a?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"230px",height:"28px",color:"lighten",rounded:"md"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},id:"sledge-product-review-rating-icon-svg-store",children:[jsxRuntimeExports.jsx("symbol",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",id:"sledge-product-review-icons-rating-icon-fill",children:jsxRuntimeExports.jsx("g",{id:"favorite_major",children:jsxRuntimeExports.jsx("path",{id:"Primary fill",fillRule:"evenodd",clipRule:"evenodd",d:"M5.00009 12L1.37609 9C0.692087 8.453 0.992087 7.353 1.86009 7.229L7.00009 7L9.19509 1.497C9.34809 1.192 9.65909 1 10.0001 1C10.3411 1 10.6521 1.193 10.8051 1.497L13.0001 7L18.1401 7.229C19.0081 7.353 19.3081 8.453 18.6241 9L15.0001 12L15.9891 17.857C16.1031 18.656 15.2731 19.254 14.5521 18.893L10.0001 16L5.44809 18.892C4.72609 19.253 3.89709 18.655 4.01109 17.856L5.00009 12Z",fill:P})})}),jsxRuntimeExports.jsx("symbol",{viewBox:"0 0 33 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",id:"sledge-product-review-icons-rating-icon-line",children:jsxRuntimeExports.jsx("g",{id:"favorite_major",children:jsxRuntimeExports.jsx("path",{id:"Primary fill",d:"M9.18817 19.8162L9.25542 19.4179L8.94431 19.1604L3.14591 14.3604L3.14598 14.3603L3.13673 14.3529C2.5294 13.8672 2.784 12.8955 3.54372 12.7636L11.7291 12.3989L12.1807 12.3788L12.3481 11.959L15.8472 3.18648C15.977 2.94796 16.2257 2.79961 16.4979 2.79961C16.769 2.79961 17.0185 2.94848 17.1489 3.18698L20.6478 11.959L20.8152 12.3788L21.2668 12.3989L29.4522 12.7636C30.2119 12.8955 30.4665 13.8672 29.8592 14.3529L29.8591 14.3528L29.85 14.3604L24.0516 19.1604L23.7405 19.4179L23.8077 19.8162L25.3884 29.1774C25.4834 29.8833 24.7613 30.4104 24.1224 30.1159L16.8734 25.5088L16.498 25.2702L16.1226 25.5088L8.87373 30.1141C8.23317 30.409 7.51248 29.8817 7.60746 29.1758L9.18817 19.8162Z",stroke:$,strokeWidth:"1.4"})})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("g",{id:"sledge-product-review-icons-rating-icon",children:[jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-line",className:"sledge-product-review__rating-icon-line"}),jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-fill",className:"sledge-product-review__rating-icon-fill"})]})})]}),!T&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((e,t)=>{let s=Math.floor(parseFloat(L)),i=String(L).includes(",")?String(L).split(","):[],n=String(L).includes(".")?String(L).split("."):[],o=i.length||n.length?i[1]||n[1]:0,r="fill-0";return e>s&&s+1===e&&(r=`fill-${o}`),reactExports.createElement("svg",{...S,viewBox:"0 0 33 33","data-product-review-rating-fill":e<=s?"full":r,key:t},jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),d?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",f,")"]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]})]})})},getSizing=e=>"xs"===e?{width:14.4,height:14.4}:"sm"===e?{width:18,height:18}:{width:28.8,height:28.8},ElementInit$1=e=>{const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),s=e.getAttribute(DATASET_ATTRIBUTE_KEY.PRODUCT_REVIEW.RATING_SIZE),i=e.getAttribute(DATASET_ATTRIBUTE_KEY.PRODUCT_REVIEW.RATING_TOTAL),n=e.getAttribute(DATASET_ATTRIBUTE_KEY.PRODUCT_REVIEW.RATING_AVERAGE),o=e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.WITH_SKELETON_LOADING);e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`)&&e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`).remove();let r=document.createElement("div");r.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET),e.appendChild(r),client.createRoot(r).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Rating,{params:{productId:t||""},withSkeletonLoading:!Boolean(o&&"false"===o),...s?{size:s}:{},...null!=i?{total:i}:{},...null!=n?{average:n}:{}})})}))},RatingInitSelector=e=>{new MutationObserver((function(e){e.forEach((function(e){Array.prototype.slice.call(e.addedNodes).forEach((function(e){if(1===e.nodeType&&e.querySelector(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)){let t=Array.from(e.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING));t.length&&t.map((e=>ElementInit$1(e)))}}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1});let t=Array.from(document.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING));!t||t&&!t.length||t.map((t=>{const s=t.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID);e&&e!==s||ElementInit$1(t)}))},WidgetHeaderAddTrigger=({isFirstLoading:e,text:t,dataSettings:s,params:i,onAfterAddReview:n})=>{var o,r,l;const{text_color:a,border_color:d,border_radius:c,padding_top:u,padding_bottom:x,padding_left:p,padding_right:m,background_color:g,font_size:_,font_weight:R,text_transform:E}=(null==(r=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:r.button_write_review)||{},{button_write_review:h}=(null==(l=null==s?void 0:s.languages)?void 0:l.widget)||{},j={...a&&{color:a},...d&&{borderColor:d},...c&&{borderRadius:c},...u&&{paddingTop:u},...x&&{paddingBottom:x},...p&&{paddingLeft:p},...m&&{paddingRight:m},...g&&{backgroundColor:g},..._&&{fontSize:_},...R&&{fontWeight:R},...E&&{textTransform:E}};return jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"lighten"}):jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"success",className:"sledge-product-review__widget-header-add-trigger",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(i,n),style:j,children:[jsxRuntimeExports.jsx(MessageAddIcon,{width:16,height:16,color:"currentColor"}),t||(h||"Add review")]})})},WidgetHeaderSort$1=({isFirstLoading:e,productReviewSort:t,dataSettings:s,setSelectedSort:i,setIsRefreshWidgetList:n})=>{var o,r;const{default_sort:l,show_sorting_options:a}=(null==(o=null==s?void 0:s.display)?void 0:o.widget)||{},[d,c]=React.useState(l||null),u=d||(null==(r=t[0])?void 0:r.value);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"lighten"}):jsxRuntimeExports.jsx(SelectField,{align:"end",prefixLabel:jsxRuntimeExports.jsx(SwapIcon,{width:16,height:16,color:"currentColor"}),prefixSelectedLabel:"Sort by",options:t.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:u,onChange:({value:e})=>(e=>{c(e),n&&n(!0),i&&i(e)})(e),link:"?page=1&sort=value"})}):null})},WidgetHeaderSummary=e=>{var t,s,i,n;const{params:o,dataSettings:r,summaryData:l,sledgeSettings:a}=e,{productId:d}=o||{},{fill_color:c,outline_color:u}=(null==(s=null==(t=null==r?void 0:r.display)?void 0:t.widget)?void 0:s.summary_bar)||{},{review_singular:x,review_plural:p}=(null==(i=null==r?void 0:r.languages)?void 0:i.widget)||{},[m,g]=React.useState(!0),[_,R]=React.useState(!0),[E,h]=React.useState(!0),[j,v]=React.useState(!l),[T,w]=React.useState(!1),[S,A]=React.useState(0|(null==l?void 0:l.review_count)),[f,C]=React.useState((null==l?void 0:l.rating)||{5:0,4:0,3:0,2:0,1:0}),[L,I]=React.useState((null==(n=null==l?void 0:l.rating)?void 0:n.average)||"0"),[N,O]=React.useState(!0),y=usePrevious({productId:d}),b=async()=>{var e;let t,s,i,n,o=!1,r=0;if(l&&N)s=l,o=!0,O(!1);else{if(t=await getReviewInfo(d),!t)return;const{status:e}=t,{code:i}=e;s=t.data,o=200===i||!1}r=(null==s?void 0:s.review_count)?s.review_count:0,i=(null==s?void 0:s.rating)?{5:s.rating[5]||0,4:s.rating[4]||0,3:s.rating[3]||0,2:s.rating[2]||0,1:s.rating[1]||0}:f,n=(null==(e=null==s?void 0:s.rating)?void 0:e.average)?s.rating.average:"0",o&&(A(r),C(i),I(n),h(!1),v(!1),g(!1),T&&R(!1))};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{v(!0),b()}),Boolean(y&&(null==y?void 0:y.productId)!==d)&&g(!0),b()}),[T,d]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:m&&!l?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"630px",height:"42px",color:"lighten",rounded:"md"}):E&&!l?null:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(motion.div,{initial:!1,animate:T?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:L}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!j&&jsxRuntimeExports.jsx(Rating,{data:l,sledgeSettings:a,average:String(L),size:"md",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[S,jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-summary-total-desc",children:S>1?p||"Reviews":x||"Review"})]}),jsxRuntimeExports.jsx(motion.div,{variants:ROTATE_FILTER_ARROW_ANIMATION,className:"summary-trigger-icon",children:jsxRuntimeExports.jsx("svg",{width:20,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),content:_?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map((e=>jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"108px",height:"22px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"128px",height:"22px",color:"lighten",rounded:"md",style:{marginLeft:"13px",marginRight:"12px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"38px",height:"22px",color:"lighten",rounded:"md"})]},e)))}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist",children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map(((e,t)=>jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[jsxRuntimeExports.jsx(Rating,{data:l,sledgeSettings:a,average:e,size:"sm",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1}),jsxRuntimeExports.jsx(Progress,{value:String(f[e]),total:S,fillColor:c,outlineColor:u}),jsxRuntimeExports.jsxs("small",{children:["(",f[e],")"]})]},t)))})}),setIsOpen:w,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})},WidgetHeader$1=e=>{const[t,s]=React.useState(!e.data);return React.useEffect((()=>{s(!1)}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!t&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header",children:React.Children.count(e.children)&&React.Children.map(e.children,(t=>React.cloneElement(t,{...e})))})})};WidgetHeader$1.Sort=WidgetHeaderSort$1,WidgetHeader$1.AddTrigger=WidgetHeaderAddTrigger,WidgetHeader$1.Summary=WidgetHeaderSummary;const WidgetList$1=e=>{var t,s,i;const{isFirstLoading:n,isLoading:o,productReviewData:r,dataSettings:l,currentPage:a,setCurrentPage:d,totalPage:c,totalData:u,setIsReplaceWidgetList:x,widgetWrapperRef:p,data:m,sledgeSettings:g}=e||{},{type:_}=(null==(s=null==(t=(null==g?void 0:g.review)||l)?void 0:t.display)?void 0:s.widget)||{},R="list"===_?jsxRuntimeExports.jsx(Pagination,{currentPage:a||1,totalPage:c||1,totalResult:u||0,onChange:e=>(e=>{d&&d(e),x&&x(!0),setTimeout((()=>{scrollToElement({element:p.current,headerOffset:50})}),200)})(e)}):null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o&&!m?_&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.ReviewGrid,{count:"grid"===_?8:10,type:_,gridItemHeights:["252px","342px","196px","398px","342px","252px","398px","196px"]}),n?null:R]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-wrapper","data-layout-type":_,children:(null==(i=null==m?void 0:m.data)?void 0:i.length)||(null==r?void 0:r.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReviewWrapper,{...e,data:m}),R]}):jsxRuntimeExports.jsx(WidgetListEmpty$1,{...e})})})},WidgetListEmpty$1=e=>{var t,s;const{params:i,dataSettings:n,onAfterAddReview:o}=e||{},{title_no_result:r,text_no_result:l}=(null==(t=null==n?void 0:n.languages)?void 0:t.widget)||{};null==(s=null==n?void 0:n.languages)||s.widget;const[a,d]=React.useState(""),[c,u]=React.useState("");return React.useEffect((()=>{d(r||"No reviews for this item yet!"),u(l||'Click "write a review" button to add a review on this product')}),[]),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-product-empty",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-icon",children:jsxRuntimeExports.jsx(MessageAddIcon,{width:32,height:32,color:"#767676"})}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-title",dangerouslySetInnerHTML:{__html:a}}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-description",dangerouslySetInnerHTML:{__html:c}}),jsxRuntimeExports.jsx(WidgetHeaderAddTrigger,{...e})]})},ReviewWrapper=e=>{var t,s,i,n,o,r,l,a;let{productReviewData:d,currentPage:c,setCurrentPage:u,totalPage:x,totalData:p,dataSettings:m,setIsRefreshWidgetList:g,setIsReplaceWidgetList:_,LinkComponent:R,selectedSort:E,data:h,sledgeSettings:j}=e||{};m=(null==j?void 0:j.review)||m;const{type:v,rating_size:T,show_review_date:w}=(null==(t=null==m?void 0:m.display)?void 0:t.widget)||{},{text_color:S,border_color:A,border_radius:f,padding_top:C,padding_bottom:L,padding_left:I,padding_right:N,background_color:O,font_size:y,font_weight:b,text_transform:D}=(null==(i=null==(s=null==m?void 0:m.display)?void 0:s.widget)?void 0:i.button_load_more)||{},{text_color:P,border_color:$,border_radius:U,padding_top:W,padding_bottom:k,padding_left:M,padding_right:F,background_color:B,font_size:H,font_weight:G,text_transform:V}=(null==(o=null==(n=null==m?void 0:m.display)?void 0:n.widget)?void 0:o.verified)||{},{button_load_more:Y,verified:K}=(null==(r=null==m?void 0:m.languages)?void 0:r.widget)||{},{name:q,image:z}=(null==(a=null==(l=null==m?void 0:m.display)?void 0:l.widget)?void 0:a.replier)||{},J={...S&&{color:S},...A&&{borderColor:A},...f&&{borderRadius:f},...C&&{paddingTop:C},...L&&{paddingBottom:L},...I&&{paddingLeft:I},...N&&{paddingRight:N},...O&&{backgroundColor:O},...y&&{fontSize:y},...b&&{fontWeight:b},...D&&{textTransform:D}},Z={...P&&{color:P},...$&&{borderWidth:"1px",borderStyle:"solid",borderColor:$},...U&&{borderRadius:U},...W&&{paddingTop:W},...k&&{paddingBottom:k},...M&&{paddingLeft:M},...F&&{paddingRight:F},...B&&{backgroundColor:B},...H&&{fontSize:H},...G&&{fontWeight:G},...V&&{textTransform:V}};let Q=c||0,X=x||0;const[ee,te]=React.useState(!1),[se,ie]=React.useState(!1),ne=()=>{u&&c&&u(c+1),te(!0)};React.useEffect((()=>{ie(!(X===Q&&!ee)&&X>=Q)}),[ee]),React.useEffect((()=>{te(!1)}),[d]);const oe=()=>jsxRuntimeExports.jsx(Button,{type:"button",role:"button",colorType:"light",disabled:ee,onClick:ne,style:{...J,...ee&&{cursor:"wait"}},children:ee?"Loading...":Y||"Load More"}),re=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==d?void 0:d.length)?jsxRuntimeExports.jsx(MasonryResponsive,{columnsCountBreakPoints:{350:1,750:3,1024:4},className:"sledge-product-review__widget-review-grid",children:jsxRuntimeExports.jsx(Masonry,{gutter:"md"===currentMediaQuery()?"30px":"16px",children:d.map(((e,t)=>{var s,i;const{user:{name:n},review:{rating:o,review:r,media:l,reply:a,is_verified:d},created_at:c}=e;let u=new Intl.DateTimeFormat("en-US").format(new Date(c)),x=q?String(String(q).includes("<span>")?String(q).split("<span>")[0]:String(q)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=a[0])?void 0:s.name):null==(i=a[0])?void 0:i.name,p=q?getTextBetween({start:"<span>",end:"</span>",text:q}):"Admin";return jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetPopupDetail&&window.sledgeProductReviewWidgetPopupDetail({...e,settings:m}),children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-desc-wrapper",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-desc",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-customer",children:[jsxRuntimeExports.jsx("span",{children:n}),d?jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:K}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-column",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-rating",children:jsxRuntimeExports.jsx(Rating,{average:o,size:T,withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),w?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:u}):null]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:r.length>=250?`${r.slice(0,250)}...`:r})]}),(null==l?void 0:l.length)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:l.slice(0,4).map(((e,t)=>{const{type:s,file:i}=e;let n="image"===s?jsxRuntimeExports.jsx("img",{src:i||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy"},t):jsxRuntimeExports.jsx("video",{controls:!1,children:jsxRuntimeExports.jsx("source",{src:i})},t);return t<3?n:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-media sledge-product-review__widget-review-card-media-more-element",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-media-more",children:"More+"}),n]},t)}))}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]}),(null==a?void 0:a.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("img",{src:z||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy",className:"sledge-product-review__widget-review-card-reply-profile-image"},t),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:x}),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:p})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-reply-message",dangerouslySetInnerHTML:{__html:a[0].text}})]}):null]})},t)}))})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),se&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-button-load-more",children:R?jsxRuntimeExports.jsx(R,{scroll:!1,to:`?page=${(c||1)+1}&sort=${E}`,href:`?page=${(c||1)+1}&sort=${E}`,children:jsxRuntimeExports.jsx(oe,{})}):jsxRuntimeExports.jsx(oe,{})})]}),le=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==d?void 0:d.length)?jsxRuntimeExports.jsx(MasonryResponsive,{columnsCountBreakPoints:{350:1},className:"sledge-product-review__widget-review-grid",children:jsxRuntimeExports.jsx(Masonry,{children:d.map(((e,t)=>{var s,i;const{id:n,user:{name:o},review:{rating:r,review:l,media:a,reply:d,is_verified:c},created_at:u}=e;let x=new Intl.DateTimeFormat("en-US").format(new Date(u)),p=q?String(String(q).includes("<span>")?String(q).split("<span>")[0]:String(q)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=d[0])?void 0:s.name):null==(i=d[0])?void 0:i.name,g=q?getTextBetween({start:"<span>",end:"</span>",text:q}):"Admin";return jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetPopupDetail&&window.sledgeProductReviewWidgetPopupDetail({...e,settings:m}),children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-customer-wrapper",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-customer",children:[jsxRuntimeExports.jsx("span",{children:o}),c?jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:K}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-column",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-rating",children:jsxRuntimeExports.jsx(Rating,{average:r,size:T,withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),w?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:x}):null]})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-content",children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-desc-wrapper",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-desc",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:l.length>=350?`${l.slice(0,350)}...`:l}),(null==d?void 0:d.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("svg",{width:18,height:16,viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M0.5625 15.5C0.764999 15.5 0.955502 15.3905 1.056 15.2068L1.07175 15.1783C2.754 12.14 5.9595 10.25 9.4365 10.25H10.5V13.4375C10.5 13.6633 10.6358 13.8673 10.8435 13.9558C11.0498 14.0428 11.2928 13.9993 11.454 13.841L17.829 7.65351C17.9385 7.54776 18 7.40226 18 7.25001C18 7.09776 17.9385 6.95226 17.829 6.84651L11.454 0.659013C11.292 0.501513 11.0498 0.456513 10.8435 0.544263C10.6358 0.632763 10.5 0.836763 10.5 1.06251V4.25151C4.69275 4.35201 0 9.10701 0 14.9375C0 15.1948 0.174 15.419 0.423 15.4828C0.4695 15.4948 0.516001 15.5 0.5625 15.5ZM11.0625 9.12501H9.4365C6.3045 9.12501 3.36975 10.4968 1.3635 12.8083C2.334 8.55651 6.14625 5.37501 10.6875 5.37501H11.0625C11.373 5.37501 11.625 5.12301 11.625 4.81251V2.39226L16.6298 7.25001L11.625 12.1078V9.68751C11.625 9.37701 11.373 9.12501 11.0625 9.12501Z",fill:"#677487"})}),jsxRuntimeExports.jsx("img",{src:z||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy",className:"sledge-product-review__widget-review-card-reply-profile-image"},t),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:p}),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:g})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-reply-message",dangerouslySetInnerHTML:{__html:d[0].text}})]}):null]})})}),(null==a?void 0:a.length)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:a.slice(0,4).map(((e,t)=>{const{type:s,file:i}=e;let n="image"===s?jsxRuntimeExports.jsx("img",{src:i||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy"},t):jsxRuntimeExports.jsx("video",{controls:!1,children:jsxRuntimeExports.jsx("source",{src:i})},t);return t<3?n:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-media sledge-product-review__widget-review-card-media-more-element",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-media-more",children:"More+"}),n]},t)}))}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]},t)}))})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})});return"list"===v?le:re},WidgetRoot$1=e=>{var t,s,i,n;const{children:o,params:r,onAfterAddReview:l,data:a,sledgeSettings:d}=e,{productId:c}=r||{},{isRenderApp:u}=React.useContext(SledgeContext),{productReview:x}=u||{},[p,m]=React.useState(!a),[g,_]=React.useState(!a),[R,E]=React.useState(!1),[h,j]=React.useState(!1),[v,T]=React.useState((null==a?void 0:a.data)||[]),[w,S]=React.useState((null==a?void 0:a.sorts)||[]),[A,f]=React.useState((null==(s=null==(t=null==d?void 0:d.display)?void 0:t.widget)?void 0:s.default_sort)||""),[C,L]=React.useState(1),[I,N]=React.useState((null==(i=null==a?void 0:a.page)?void 0:i.total_page)||0),[O,y]=React.useState((null==(n=null==a?void 0:a.page)?void 0:n.total_data)||0),[b,D]=React.useState((null==d?void 0:d.review)||{}),[P,$]=React.useState(!0),U=React.useRef(null),W=usePrevious({currentPage:C,isReplaceWidgetList:h,productId:c}),k=async(e=!1,t=!1,s)=>{var i;let n,o=10,r=A;if(_(!(!t&&!R)||!e),!e||t){let e=await M(s);const{review_per_page:n,default_sort:l}=(null==(i=null==e?void 0:e.display)?void 0:i.widget)||{};o=n||o,r=A||l,t||L(1),t&&T([]),f(r)}let l,d,u=!1,x=0,p=0,g={page:e?C:1,limit:o,sort:r};if(a&&P?($(!1),n=a):n=await getReview(c,g),!n)return;const{status:h,data:w,page:I,sorts:O}=n,{code:b}=h;u=200===b||!1,l=(null==w?void 0:w.length)?t=>(null==v?void 0:v.length)&&e?[...t,...w]:w:[],d=(null==O?void 0:O.length)?O:[],x=(null==I?void 0:I.total_page)||1,p=(null==I?void 0:I.total_data)||1,u&&(T(l),S(d),N(x),y(p),_(!1),E(!1),j(!1),m(!1))},M=async e=>{let t;if(t=JSON.parse(e),t)return D(t),t};return React.useEffect((()=>{if(!x&&!a)return;let e=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";"undefined"!=typeof window&&(window.sledgeProductReviewWidgetListUpdate=()=>{k(!1,!0,e)}),Boolean(W&&(null==W?void 0:W.productId)!==c)&&(m(!0),k(!1,!0,e)),M(e)}),[x,c]),React.useEffect((()=>{if(!x||R)return;let e=Boolean(W&&(null==W?void 0:W.currentPage)!==C),t=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";Boolean(W&&(null==W?void 0:W.isReplaceWidgetList)!==h)?k(!0,!0,t):k(e,h,t)}),[C,h,x,a]),React.useEffect((()=>{if(!x||!R)return;let e=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";k(!1,!1,e)}),[R]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-wrapper",ref:U,id:ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET,children:React.Children.count(o)&&React.Children.map(o,(e=>React.cloneElement(e,{params:r,isFirstLoading:p,isLoading:g,productReviewData:v,productReviewSort:w,selectedSort:A,currentPage:C,totalPage:I,totalData:O,dataSettings:b,setIsLoading:_,setIsRefreshWidgetList:E,setIsReplaceWidgetList:j,setSelectedSort:f,setCurrentPage:L,onAfterAddReview:l,widgetWrapperRef:U,data:P?a:null,sledgeSettings:d})))})})},Widget$1=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Widget$1.Root=WidgetRoot$1,Widget$1.Header=WidgetHeader$1,Widget$1.List=WidgetList$1;const WidgetPopupDetail=()=>{var e,t,s;const[i,n]=React.useState(!1),[o,r]=React.useState(""),[l,a]=React.useState(""),[d,c]=React.useState(""),[u,x]=React.useState(""),[p,m]=React.useState([]),[g,_]=React.useState([]),[R,E]=React.useState(""),[h,j]=React.useState(""),[v,T]=React.useState(!1),[w,S]=React.useState(""),[A,f]=React.useState({}),[C,L]=React.useState(0),[I,N]=React.useState({}),{text_color:O,border_color:y,border_radius:b,padding_top:D,padding_bottom:P,padding_left:$,padding_right:U,background_color:W,font_size:k,font_weight:M,text_transform:F}=(null==(t=null==(e=null==A?void 0:A.display)?void 0:e.widget)?void 0:t.verified)||{},{verified:B}=(null==(s=null==A?void 0:A.languages)?void 0:s.widget)||{},H={...O&&{color:O},...y&&{borderWidth:"1px",borderStyle:"solid",borderColor:y},...b&&{borderRadius:b},...D&&{paddingTop:D},...P&&{paddingBottom:P},...$&&{paddingLeft:$},...U&&{paddingRight:U},...W&&{backgroundColor:W},...k&&{fontSize:k},...M&&{fontWeight:M},...F&&{textTransform:F}},G=0===C,V=C===(null==p?void 0:p.length)-1;return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetPopupDetail=e=>{var t,s,i,o;const{user:{name:l},review:{rating:d,title:u,review:p,media:g,reply:R,is_verified:h},created_at:v,settings:w}=e,{name:A,image:C}=(null==(s=null==(t=null==w?void 0:w.display)?void 0:t.widget)?void 0:s.replier)||{};r(l),a(d),c(u),x(p),m(g),_(R),E(A?String(String(A).includes("<span>")?String(A).split("<span>")[0]:String(A)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(i=R[0])?void 0:i.name):null==(o=R[0])?void 0:o.name),j(A?getTextBetween({start:"<span>",end:"</span>",text:A}):"Admin"),T(h),S(new Intl.DateTimeFormat("en-US").format(new Date(v))),n(!0),f(w),L(0),N({name:A,image:C})})}),[]),React.useEffect((()=>{i?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[i]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:i,onOpenChange:n,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-product-review__widget-popup-detail-content",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-flex",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-image",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-close",onClick:()=>n(!1),children:jsxRuntimeExports.jsx(CloseIcon,{width:17,height:17,color:"#c9c9c9"})}),(null==p?void 0:p.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[p.map(((e,t)=>{const{type:s,file:i}=e,n={hidden:{opacity:0,visibility:"hidden"},show:{opacity:1,visibility:"visible"}};let o="image"===s?jsxRuntimeExports.jsx("img",{src:i||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy",style:n[C!==t?"hidden":"show"]}):jsxRuntimeExports.jsx("video",{controls:!0,style:n[C!==t?"hidden":"show"],children:jsxRuntimeExports.jsx("source",{src:i})});return jsxRuntimeExports.jsx(React.Fragment,{children:o},t)})),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-media-nav",children:[!G&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-prev",onClick:()=>L(C-1),children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"white"})}),!V&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-next",onClick:()=>L(C+1),children:jsxRuntimeExports.jsx(ChevronArrowRightIcon,{width:16,height:16,color:"white"})})]})]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-no-media",children:"No Media Upload"})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-heading",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-title",children:o}),v?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-verified-text",style:H,children:B}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-subheading",children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{average:l,size:"sm",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-date",children:w})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-title-description",children:d}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-description",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-message",dangerouslySetInnerHTML:{__html:u}}),(null==g?void 0:g.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-reply-wrapper",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("img",{src:(null==I?void 0:I.image)||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy",className:"sledge-product-review__widget-review-card-reply-profile-image"}),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:R}),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:H,children:h})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-message",dangerouslySetInnerHTML:{__html:g[0].text}})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]})]})]})})]})})},WidgetFormAdd=()=>{var e,t,s,i,n,o,r;const{sledgeAnonymId:l,triggerRenderMultipleComponent:a}=React.useContext(SledgeContext),{trigger:d}=(null==(e=null==a?void 0:a.productReview)?void 0:e.rating)||{},[c,u]=React.useState(!1),[x,p]=React.useState([{key:"Step_SelectRate",isDone:!0,component:Step_SelectRate},{key:"Step_WriteReview",isDone:!1,component:Step_WriteReview},{key:"Step_PersonalData",isDone:!1,component:Step_PersonalData}]),[m,g]=React.useState(x[0]),[_,R]=React.useState(!1),[E,h]=React.useState(!0),[j,v]=React.useState(null),[T,w]=React.useState(!1),[S,A]=React.useState(!1),[f,C]=React.useState(!1),[L,I]=React.useState(null),[N,O]=React.useState({}),[y,b]=React.useState({onAfterAddReview:e=>{}}),[D,P]=React.useState(""),[$,U]=React.useState(""),[W,k]=React.useState(""),[M,F]=React.useState(""),[B,H]=React.useState(""),[G,V]=React.useState(0),[Y,K]=React.useState(""),[q,z]=React.useState(""),[J,Z]=React.useState([]),[Q,X]=React.useState([]),{title_added_to_review:ee,text_added_to_review:te}=(null==(t=null==N?void 0:N.languages)?void 0:t.notification)||{},{title_confirm_add_review:se,text_confirm_add_review:ie,button_submit_confirm_add_review:ne,button_cancel_confirm_add_review:oe}=(null==(s=null==N?void 0:N.languages)?void 0:s.popup)||{},{navigation_previous:re,navigation_next:le,button_submit:ae}=(null==(i=null==N?void 0:N.languages)?void 0:i.write_review_form)||{},de=async()=>{let e;w(!0);let t=!1;if(e=await addReview({userFirstName:D,userLastName:$,userEmail:W,productId:M,productVariantId:B,rating:G,title:Y,review:q,mediaIds:J}),!e)return;const{status:{code:s}}=e;t=200===s,t?(y.onAfterAddReview("success"),setTimeout((()=>{w(!1),u(!1),g(x[0]),P(""),U(""),k(""),V(0),K(""),z(""),Z([]),X([]),ue&&ue(),"undefined"!=typeof window&&(d&&d(M),RatingInitSelector(M),window.sledgeProductReviewWidgetListUpdate&&window.sledgeProductReviewWidgetListUpdate(),window.sledgeProductReviewWidgetSummaryUpdate&&window.sledgeProductReviewWidgetSummaryUpdate(),window.sledgeToastNotification&&window.sledgeToastNotification({title:ee,message:te,type:"success",icon:jsxRuntimeExports.jsx(StarIcon,{width:40,height:40,color:"black"})}))}),500)):(y.onAfterAddReview("failed"),w(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to review",type:"failed",icon:jsxRuntimeExports.jsx(StarIcon,{width:40,height:40,color:"black"})}))},ce=()=>{const e=x.findIndex((e=>e.key===m.key));p((e=>e.map((e=>(e.key===m.key&&(e.isDone=!0),e))))),g(x[e+1])},ue=async()=>{let e,t=!1,s=[],i=[];if(e=await getReviewMedia(),!e)return;const{status:n,data:o}=e,{code:r}=n;t=200===r||!1,s=(null==o?void 0:o.ids)||[],i=(null==o?void 0:o.media)||[],t&&(Z(s),X(i),A(!1),C(!1),I(null))},xe=()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:se,message:ie,textSubmit:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(MessageAddIcon,{width:16,height:16,color:"currentColor"})," ",jsxRuntimeExports.jsx("span",{children:ne})]}),textCancel:oe,buttonSubmitType:"success",onSubmit:de||{}})};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetFormAdd=(e,t)=>{const{productId:s,productVariantId:i}=e||{};u(!0),F(s||""),H(i||""),t&&b({onAfterAddReview:t})}),(async e=>{let t;t=JSON.parse(e),t&&(O(t),await ue())})(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||null)}),[]),React.useEffect((()=>{g(x[0])}),[l]),React.useEffect((()=>{if(c)switch(null==m?void 0:m.key){case"Step_SelectRate":h(!G),v(le),R(!0);break;case"Step_WriteReview":h(!q),v(l?le:ae),R(!!l);break;case"Step_PersonalData":h(!D||!W),v(ae),R(!1)}}),[m,G,q,D,W,l,c]),React.useEffect((()=>{c?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[c]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:c,onOpenChange:u,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-product-review__widget-form-add-content",children:[(null==(n=x[0])?void 0:n.key)===(null==m?void 0:m.key)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step-close",onClick:()=>u(!1),children:jsxRuntimeExports.jsx(CloseIcon,{width:17,height:17,color:"#77757e"})}):null,jsxRuntimeExports.jsxs($d94698215c4408a7$export$be92b6f5f03c0fe9,{className:"sledge-product-review__widget-form-review FormRoot",onSubmit:e=>(e=>{e.preventDefault(),"Step_SelectRate"===(null==m?void 0:m.key)?ce():l&&"Step_WriteReview"===(null==m?void 0:m.key)?ce&&ce():xe&&xe()})(e),"data-active-step":(null==m?void 0:m.key)||"","data-has-visible-next":_,children:[(null==(o=x[0])?void 0:o.key)===(null==m?void 0:m.key)?null:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step-back",onClick:()=>{const e=x.findIndex((e=>e.key===m.key));0!==e&&(p((e=>e.map((e=>(e.key===m.key&&(e.isDone=!1),e))))),g(x[e-1]))},children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:19,height:19,color:"#393d4e"})}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step",children:(null==m?void 0:m.component)&&React.cloneElement(jsxRuntimeExports.jsx(m.component,{}),{steps:x,activeStep:m,isLoadingAddReview:T,isLoadingUploadMedia:S,isLoadingDeleteMedia:f,selectedDeleteMediaId:L,dataSettings:N,postUserFirstName:D,postUserLastName:$,postUserEmail:W,postRating:G,postReview:q,postMedia:Q,setIsDisableNextStep:h,setIsLoadingUploadMedia:A,setIsLoadingDeleteMedia:C,setSelectedDeleteMediaId:I,handleNext:ce,handleProductReviewMedia:ue,handleAddReview:de,setPostUserFirstName:P,setPostUserLastName:U,setPostUserEmail:k,setPostRating:V,setPostTitle:K,setPostReview:z,confirmAddReview:xe})}),"Step_SelectRate"===(null==(r=x[0])?void 0:r.key)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step-navigator",children:jsxRuntimeExports.jsx($d94698215c4408a7$export$2c4cf1f7b42ef78c,{asChild:!0,disabled:T||E,children:jsxRuntimeExports.jsxs(Button,{role:"button",colorType:"success",style:{...T&&{cursor:"wait"}},disabled:E,children:[T?jsxRuntimeExports.jsx(LoadingDots,{}):null,j]})})}):null]})]})]})})},Step_SelectRate=e=>{var t,s,i,n;const{postRating:o,setPostRating:r,setPostTitle:l,dataSettings:a}=e,{text_color:d,border_color:c,border_radius:u,padding_top:x,padding_bottom:p,padding_left:m,padding_right:g,background_color:_,selected_background_color:R,font_size:E,font_weight:h,text_transform:j}=(null==(s=null==(t=null==a?void 0:a.display)?void 0:t.write_review_form)?void 0:s.button_select_rating)||{},{title:v,ratings:T}=(null==(n=null==(i=null==a?void 0:a.languages)?void 0:i.write_review_form)?void 0:n.select_rating)||{},{rating_5:w,rating_4:S,rating_3:A,rating_2:f,rating_1:C}=T||{},L={...d&&{color:d},...c&&{borderColor:c},...u&&{borderRadius:u},...x&&{paddingTop:x},...p&&{paddingBottom:p},...m&&{paddingLeft:m},...g&&{paddingRight:g},...E&&{fontSize:E},...h&&{fontWeight:h},...j&&{textTransform:j}},I=[{rate:5,title:w},{rate:4,title:S},{rate:3,title:A},{rate:2,title:f},{rate:1,title:C}];return jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-title",children:v}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-select-rate-list",children:I.map(((e,t)=>jsxRuntimeExports.jsxs("button",{type:"button",className:"sledge-product-review__widget-form-select-rate-list-item "+(e.rate===o?"selected":""),onClick:()=>{return t=e.rate,s=e.title,r&&r(t),void(l&&l(s));var t,s},style:{...L,..._&&R?{backgroundColor:e.rate===o?R:_,...e.rate===o?{borderColor:R}:{}}:{}},children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{average:e.rate,size:{width:24,height:24},withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})})," ",jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-form-select-rate-text",children:e.title})]},t)))})]})},Step_WriteReview=e=>{var t;const{isLoadingUploadMedia:s,isLoadingDeleteMedia:i,selectedDeleteMediaId:n,dataSettings:o,postMedia:r,postReview:l,setIsDisableNextStep:a,setIsLoadingUploadMedia:d,setIsLoadingDeleteMedia:c,setSelectedDeleteMediaId:u,handleProductReviewMedia:x,setPostMediaIds:p,setPostMedia:m,setPostReview:g}=e,{description:_}=(null==(t=null==o?void 0:o.languages)?void 0:t.write_review_form)||{},{title:R,form_placeholder:E}=_||{},[h,j]=React.useState(!1),v=async()=>{if(!n)return;let e;c&&c(!0);let t=!1;if(e=await deleteReviewMedia(n),!e)return;const{status:s}=e,{code:i}=s;t=200===i,t?(x&&x(),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Media removed",message:"successfully removed from media",type:"success",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})})):(c&&c(!1),u&&u(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed delete to media",type:"failed",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})}))};React.useEffect((()=>{j(!1)}),[]),React.useEffect((()=>{n&&h&&(j(!1),"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Are you sure want to delete this media?",message:"This action cannot be undone. This will permanently delete this media.",textSubmit:"Delete",textCancel:"Cancel",buttonSubmitType:"danger",onSubmit:v||{}}))}),[n,h]);const T=jsxRuntimeExports.jsx("label",{htmlFor:"file-upload",className:"sledge-product-review__widget-form-upload-media-file",children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-description",children:[jsxRuntimeExports.jsx(UploadIcon,{width:32,height:32,color:"currentColor"}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-text",children:s?jsxRuntimeExports.jsx("span",{children:"Uploading..."}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:"Upload a file PNG, JPG max 5MB"}),jsxRuntimeExports.jsx("input",{id:"file-upload",name:"file-upload",type:"file",multiple:!0,onChange:e=>{e.target.files&&(async e=>{let t;d&&d(!0);let s=!1,i=[],n=[];t=await addReviewMedia(e),t||(d&&d(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to media",type:"failed",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})}));const{status:o,data:r}=t||{},{code:l}=o||{};s=200===l,i=(null==r?void 0:r.ids)||[],n=(null==r?void 0:r.media)||[],s?(p&&p(i),m&&m(n),x&&x(),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Media added",message:"successfully added to media",type:"success",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})})):(d&&d(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to media",type:"failed",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})}))})(e.target.files)},className:"sledge-product-review__widget-form-sr-only"})]})})]})})});return jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-title",children:R}),jsxRuntimeExports.jsx(TextAreaField,{className:"Textarea",required:!0,placeholder:E,value:l,onChange:e=>{var t;a&&a(!(null==(t=null==e?void 0:e.target)?void 0:t.value)),g&&g(e.target.value)}}),(null==r?void 0:r.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-filled",children:[r.map(((e,t)=>{const{id:s,file:o,type:r}=e;let l=i&&s==n;return jsxRuntimeExports.jsxs(motion.div,{initial:"hidden",animate:"visible",variants:VISIBLE_ANIMATION,className:"sledge-product-review__widget-form-upload-media-filled-item",children:[l?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-loading",children:"Deleting..."}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-item",onClick:()=>{j(!0),u&&u(s)},children:jsxRuntimeExports.jsx("svg",{width:25,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:"#fff",fillRule:"evenodd",clipRule:"evenodd"})})}),"image"===r?jsxRuntimeExports.jsx("img",{src:o||`${API_URL}/img/blank-image.png`,className:"sledge-product-review__widget-form-upload-media-filled-item-file",alt:"sledge-review-uploaded-image",loading:"lazy"}):jsxRuntimeExports.jsx("video",{controls:!l,className:"sledge-product-review__widget-form-upload-media-filled-item-file",children:jsxRuntimeExports.jsx("source",{src:o})})]},t)})),T]})}):T]})},Step_PersonalData=e=>{var t;const{dataSettings:s,postUserFirstName:i,postUserLastName:n,postUserEmail:o,setIsDisableNextStep:r,setPostUserFirstName:l,setPostUserLastName:a,setPostUserEmail:d}=e,{user:c}=(null==(t=null==s?void 0:s.languages)?void 0:t.write_review_form)||{},{title:u,first_name_form_placeholder:x,last_name_form_placeholder:p,email_form_placeholder:m}=c||{},g=()=>{r&&r(!i||!o)};return jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-personal-data",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-title",children:u}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-group-flex",children:[jsxRuntimeExports.jsx(InputField,{name:"userFirstName",type:"text",required:!0,placeholder:x,onChange:e=>{g(),l&&l(e.target.value)},value:i}),jsxRuntimeExports.jsx(InputField,{name:"userLastName",type:"text",placeholder:p,onChange:e=>a&&a(e.target.value),value:n})]}),jsxRuntimeExports.jsx(InputField,{name:"userEmail",type:"email",required:!0,placeholder:m,onChange:e=>{g(),d&&d(e.target.value)},value:o}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-review-description",children:["By submitting, I acknowledge the ",jsxRuntimeExports.jsx("a",{href:"#",children:"Terms of Service"})," and ",jsxRuntimeExports.jsx("a",{href:"#",children:"Privacy Policy"})," and that my review will be publicly posted and shared online"]})]})})},WidgetInitSelector$1=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_WIDGET));!element||element&&!element.length||element.map((item=>{if(item){const PRODUCT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),ON_AFTER_ADD_REVIEW=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_REVIEW);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsxs(Widget$1.Root,{params:{productId:PRODUCT_ID||"",productVariantId:PRODUCT_VARIANT_ID||""},onAfterAddReview:state=>{item&&ON_AFTER_ADD_REVIEW&&eval(ON_AFTER_ADD_REVIEW)&&eval(ON_AFTER_ADD_REVIEW)({state:state})},children:[jsxRuntimeExports.jsxs(Widget$1.Header,{children:[jsxRuntimeExports.jsx(WidgetHeader$1.Summary,{}),jsxRuntimeExports.jsx(WidgetHeader$1.AddTrigger,{}),jsxRuntimeExports.jsx(WidgetHeader$1.Sort,{})]}),jsxRuntimeExports.jsx(Widget$1.List,{})]})})}))}}))},WidgetPopupDetailInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.PRODUCT_REVIEW.ELEMENT_WIDGET_POPUP_DETAIL}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.PRODUCT_REVIEW.ELEMENT_WIDGET_POPUP_DETAIL),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(WidgetPopupDetail,{})})})))},WidgetFormAddInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.PRODUCT_REVIEW.ELEMENT_WIDGET_FORM_ADD}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.PRODUCT_REVIEW.ELEMENT_WIDGET_FORM_ADD),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(WidgetFormAdd,{})})})))},ProductReviewInitSelector=()=>{WidgetInitSelector$1(),WidgetPopupDetailInitSelector(),WidgetFormAddInitSelector(),RatingInitSelector()},ProductFilterWidget=e=>jsxRuntimeExports.jsx(SearchResultWidget,{layoutType:"product-filter",...e}),ProductFilterWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_PLP_WIDGET));!element||element&&!element.length||element.map((item=>{var _a;if(item){const QUERY_KEYWORD=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.QUERY_KEYWORD),COLLECTION_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.COLLECTION_ID),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(ProductFilterWidget,{query:{keyword:QUERY_KEYWORD||""},params:{collectionId:Number(COLLECTION_ID)||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null})})})}))}}))},SearchIconWidget=e=>{const{isRenderApp:t,isJsVersion:s}=React.useContext(SledgeContext),{instantSearch:i}=t||{},{size:n="sm",children:o,onAfterAddToCart:r,onAfterAddWishlist:l,onAfterRemoveWishlist:a,onAfterRenderProduct:d}=e||{};let c=null,u=null,x=null,p=null;React.Children.map(o,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(c=t),s&&isFunction(s)&&(u=s),i&&isFunction(i)&&(x=i),n&&isFunction(n)&&(p=n)}}));const[m,g]=React.useState({width:0,height:0});React.useEffect((()=>{i&&g("xs"===n?{width:14,height:14}:"sm"===n?{width:20,height:20}:{width:25,height:25})}),[i]);return jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup({onAfterAddToCart:r,onAfterAddWishlist:l,onAfterRemoveWishlist:a,onAfterRenderProduct:d,isJsVersion:s,productCardsComponent:c,suggestionKeywordListsComponent:u,otherIndexListsComponent:x,searchViewMoreResultComponent:p})},children:jsxRuntimeExports.jsx(SearchIcon,{...m,color:"currentColor"})})},search=async(e,t)=>{let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP)||"",i=`${INSTANT_SEARCH_ENGINE_URL}/indexes/${e}/search`;return await fetchApi({url:i,method:"POST",authorization:s,payload:t,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},multiSearch=async(e,t)=>{let s=t||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP)||""),i=`${INSTANT_SEARCH_ENGINE_URL}/multi-search`;return await fetchApi({url:i,method:"POST",authorization:s,payload:e,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},searchTrigger=async e=>{const{keyword:t,resultCount:s}=e;let i="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",n=`${API_URL}/instantsearch/statistics/search`,o={keyword:t,result_count:s};return await fetchApi({url:n,method:"POST",authorization:i,payload:o,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},productClickTrigger=async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",i=`${API_URL}/instantsearch/statistics/click`,n={product:{id:sanitizeDataId(t)}};return await fetchApi({url:i,method:"POST",authorization:s,payload:n,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},addToCartTrigger$1=async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",i=`${API_URL}/instantsearch/statistics/cart`,n={product:{id:sanitizeDataId(t)}};return await fetchApi({url:i,method:"POST",authorization:s,payload:n,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},OtherIndexLists=({listsComponent:e,name:t,items:s,isComponentJsVersion:i,showPopupComponent:n,setShowPopupComponent:o})=>{if(e){const r={name:t,items:s,showPopupComponent:n,setShowPopupComponent:o};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e({...r})}}):jsxRuntimeExports.jsx(e,{...r})})}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:t}),(null==s?void 0:s.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:s.map(((e,t)=>{const{title:s,url:i}=e;return jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx("a",{href:i,className:"sledge-instant-search__icon-widget-search-form-result-list-link",children:s})},t)}))}):jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:jsxRuntimeExports.jsxs("li",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:["No ",null==t?void 0:t.toLowerCase()," were found"]})})]})},SuggestionKeywordLists=({listsComponent:e,keywords:t,isComponentJsVersion:s=!1,showPopupComponent:i,setShowPopupComponent:n})=>{var o;if(e){const{triggerRenderMultipleComponent:r}=React.useContext(SledgeContext),{trigger:l}=(null==(o=null==r?void 0:r.instantSearch)?void 0:o.searchResult)||{},a={keywords:t,showPopupComponent:i,setShowPopupComponent:n,setRenderSearchResult:e=>{l&&l(e)}};return jsxRuntimeExports.jsx(React.Fragment,{children:s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e({...a})}}):jsxRuntimeExports.jsx(e,{...a})})}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Suggestions"}),jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:null==t?void 0:t.map(((e,t)=>jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsxs("a",{href:`${SEARCH_RESULT_URL}?q=${e}`,className:"sledge-instant-search__icon-widget-search-form-result-list-link sledge-instant-search__icon-widget-search-form-result-list-link-suggestion",children:[jsxRuntimeExports.jsx(SearchIcon,{width:12,height:12,color:"#677487"})," ",e]})},t)))})]})},SearchViewMoreResult=({component:e,keyword:t,isComponentJsVersion:s=!1,showPopupComponent:i,setShowPopupComponent:n})=>{var o;if(e){const{triggerRenderMultipleComponent:r}=React.useContext(SledgeContext),{trigger:l}=(null==(o=null==r?void 0:r.instantSearch)?void 0:o.searchResult)||{},a={keyword:t,showPopupComponent:i,setShowPopupComponent:n,setRenderSearchResult:e=>{l&&l(e)}};return jsxRuntimeExports.jsx(React.Fragment,{children:s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e({...a})}}):jsxRuntimeExports.jsx(e,{...a})})}return jsxRuntimeExports.jsx("a",{href:`${SEARCH_RESULT_URL}?q=${t}`,className:"sledge-instant-search__icon-widget-button-more",children:"View More Result"})},Global={OtherIndexLists:OtherIndexLists,SuggestionKeywordLists:SuggestionKeywordLists,SearchViewMoreResult:SearchViewMoreResult},SearchIconWidgetPopup=()=>{var e,t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,E,h,j,v;const{isRenderApp:T}=React.useContext(SledgeContext),{instantSearch:w}=T||{},[S,A]=React.useState(!0),[f,C]=React.useState(!1),[L,I]=React.useState(""),[N,O]=React.useState([]),[y,b]=React.useState([]),[D,P]=React.useState({}),[$,U]=React.useState({}),[W,k]=React.useState({}),[M,F]=React.useState(""),[B,H]=React.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),G=React.useRef(null),V=usePrevious({keyword:L}),Y=async e=>{var t,s,i,n,o,r,l,a,d,c,u,x;const{data:p,onSearch:m=!1,withFetchReviewInfo:g=!1}=e;A(!0);const{index_product:_,tabs:R,hidden_tags:E,display:h,show_out_of_stock:j}=p,v=(null==(t=null==h?void 0:h.search)?void 0:t.suggestion)||{};let T,w={queries:R.map((e=>{const{index:t}=e;let s=t.includes(_),i=[];return(null==E?void 0:E.length)&&i.push(`tags NOT IN [${E}]`),j||i.push("variants.inventory_quantity > 0"),{indexUid:t,q:L,hitsPerPage:s?6:4,filter:s?i.join(" AND "):""}}))};if(T=await multiSearch(w),!T)return;const{results:S}=T;let f=null==S?void 0:S.filter((({indexUid:e})=>null==e?void 0:e.includes(_)));m&&(null==L?void 0:L.length)&&searchTrigger({keyword:L,resultCount:(null==(s=f[0])?void 0:s.totalHits)||0});let C=(null==(i=null==S?void 0:S.filter((({indexUid:e})=>!(null==e?void 0:e.includes(_)))))?void 0:i.map((e=>{const{indexUid:t}=e,{name:s}=null==R?void 0:R.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],I=(null==f?void 0:f.length)?null==(n=f[0])?void 0:n.hits:[],N=L.length?(null==I?void 0:I.length)?"":"no_result":"zero_character",y=Boolean(!L.length&&Object.keys(v).length&&(null==(r=null==(o=v[N])?void 0:o.products)?void 0:r.active)&&(null==(d=null==(a=null==(l=v[N])?void 0:l.products)?void 0:a.list)?void 0:d.length))?null==(u=null==(c=v[N])?void 0:c.products)?void 0:u.list:I;if(g){let e=y.map((({id:e})=>e)),t=await getProductsReviewInfo(e);200===(null==(x=null==t?void 0:t.status)?void 0:x.code)&&P(null==t?void 0:t.data)}else P({});O(y),b(C),F(N),A(!1)};return React.useEffect((()=>{w&&("undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:o=(()=>{}),suggestionKeywordListsComponent:r=(()=>{}),otherIndexListsComponent:l=(()=>{}),searchViewMoreResultComponent:a=(()=>{})})=>{C(!0),H({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:o,suggestionKeywordListsComponent:r,otherIndexListsComponent:l,searchViewMoreResultComponent:a})}),(async e=>{var t;let s;if(s=JSON.parse(e),!s)return;const{display:i}=s;U(i),k(null==(t=null==i?void 0:i.search)?void 0:t.suggestion),await Y({data:s,withFetchReviewInfo:!0})})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null))}),[w]),React.useEffect((()=>{f?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[f]),React.useEffect((()=>{if(Boolean(V&&(null==V?void 0:V.keyword)!==L)){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&Y({data:e,onSearch:!0})}),500);return()=>clearTimeout(t)}}),[L]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:f,onOpenChange:C,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-instant-search__icon-widget-popup-detail-content","data-layout-type":(null==(e=null==$?void 0:$.search)?void 0:e.layout)||"",children:[jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:20,height:20,color:"#000000"}),placeholder:"Search anything...",value:L,fieldRef:G,onChange:({value:e})=>I(e),className:"sledge-instant-search__icon-widget-search-form-field",withClearField:!0}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result",children:S?jsxRuntimeExports.jsx(ScrollArea,{children:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other sledge-instant-search__icon-widget-search-form-result-flex-item-other-skeleton",children:[0,1,2].map((e=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"md",...Boolean(e)&&{style:{marginTop:"12px"}}}),jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"140px"}},e)))})]},e)))}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:6,type:"medium"})})]})})}):jsxRuntimeExports.jsx(ScrollArea,{children:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other",children:[Object.keys(W).length&&(null==(s=null==(t=W[M])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=W[M])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:B.suggestionKeywordListsComponent,keywords:W[M].keywords.list,isComponentJsVersion:B.isJsVersion,showPopupComponent:f,setShowPopupComponent:C}):null,y&&y.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:B.otherIndexListsComponent,name:i,items:s,isComponentJsVersion:B.isJsVersion,showPopupComponent:f,setShowPopupComponent:C})},t)}))]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==N?void 0:N.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:N.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(r=null==$?void 0:$.search)?void 0:r.show_vendor,show_sku:null==(l=null==$?void 0:$.search)?void 0:l.show_sku,show_price:null==(a=null==$?void 0:$.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:B.isJsVersion,cards:B.productCardsComponent,onAfterAddToCart:B.onAfterAddToCart,onAfterAddWishlist:B.onAfterAddWishlist,onAfterRemoveWishlist:B.onAfterRemoveWishlist,onAfterRenderProduct:B.onAfterRenderProduct,showPopupComponent:f,setShowPopupComponent:C,dataReviews:D})}):Object.keys(W).length&&(null==(c=null==(d=W[M])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=W[M])?void 0:u.products)?void 0:x.list)?void 0:p.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-product-suggestion-no-result-text",children:[jsxRuntimeExports.jsx("span",{children:"Sorry"}),", nothing found for ",jsxRuntimeExports.jsx("span",{children:L}),". Did you mean:"]}),jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:W[M].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==$?void 0:$.search)?void 0:m.show_vendor,show_sku:null==(g=null==$?void 0:$.search)?void 0:g.show_sku,show_price:null==(_=null==$?void 0:$.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:B.isJsVersion,cards:B.productCardsComponent,onAfterAddToCart:B.onAfterAddToCart,onAfterAddWishlist:B.onAfterAddWishlist,onAfterRemoveWishlist:B.onAfterRemoveWishlist,onAfterRenderProduct:B.onAfterRenderProduct,showPopupComponent:f,setShowPopupComponent:C})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Products"}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:"No product were found"})]}),(null==N?void 0:N.length)||Object.keys(W).length&&(null==(E=null==(R=W[M])?void 0:R.products)?void 0:E.active)&&(null==(v=null==(j=null==(h=W[M])?void 0:h.products)?void 0:j.list)?void 0:v.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:B.searchViewMoreResultComponent,keyword:L,isComponentJsVersion:B.isJsVersion,showPopupComponent:f,setShowPopupComponent:C})}):null]})]})})})})]})]})})},SearchIconWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET));!element||element&&!element.length||element.map((item=>{var _a,_b,_c,_d;if(item){const ICON_SIZE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ICON_SIZE),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_OTHER_INDEX_LIST),SEARCH_VIEW_MORE_RESULT=null==(_d=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchIconWidget,{size:ICON_SIZE||"sm",onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{suggestionKeywordList:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,otherIndexList:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,searchViewMoreResult:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null})})})}))}}))},SearchIconWidgetPopupInitSelector=()=>{let e=document.createElement("div");e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET_POPUP),document.body.appendChild(e),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchIconWidgetPopup,{})})})))},SearchResultWidget=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,E,h,j;const{layoutType:v="default",query:T,params:w,children:S,onAfterAddToCart:A,onAfterAddWishlist:f,onAfterRemoveWishlist:C,onAfterRenderProduct:L,onAfterRenderCollection:I,onAfterRenderPage:N,onAfterRenderBlog:O,onAfterRenderArticle:y,data:b,sledgeSettings:D}=e,P=(null==T?void 0:T.keyword)?T.keyword:"q",{collectionId:$}=w||{},U="undefined"!=typeof document?new URLSearchParams(null==(t=null==document?void 0:document.location)?void 0:t.search):null,[W]=React.useState("undefined"!=typeof localStorage?JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"{}"):{}),[k,M]=React.useState(!b),[F,B]=React.useState(!b),[H,G]=React.useState(null==U?void 0:U.get(P)),[V,Y]=React.useState(null),[K,q]=React.useState(),[z,J]=React.useState(),[Z,Q]=React.useState(jsxRuntimeExports.jsx(ResultProduct,{})),[X,ee]=React.useState(!b),[te,se]=React.useState((null==(s=null==D?void 0:D.instantsearch)?void 0:s.allowed_sorts)||[]),[ie,ne]=React.useState((null==(i=null==D?void 0:D.instantsearch)?void 0:i.filters)||[]),[oe,re]=React.useState([]),[le,ae]=React.useState([]),[de,ce]=React.useState((null==(n=null==D?void 0:D.instantsearch)?void 0:n.index_product)||""),[ue,xe]=React.useState((null==(o=null==D?void 0:D.instantsearch)?void 0:o.hidden_tags)||[]),[pe,me]=React.useState((null==(r=null==D?void 0:D.instantsearch)?void 0:r.display)||{}),[ge,_e]=React.useState((null==(l=null==D?void 0:D.instantsearch)?void 0:l.colors)||[]),[Re,Ee]=React.useState((null==(a=null==D?void 0:D.instantsearch)?void 0:a.default_sort)||""),[he,je]=React.useState(null==(d=null==D?void 0:D.instantsearch)?void 0:d.show_out_of_stock),[ve,Te]=React.useState(!0),[we,Se]=React.useState({}),[Ae,fe]=React.useState(!1);let Ce=null,Le=null,Ie=null,Ne=null,Oe=null;React.Children.map(S,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,collectionCard:s,pageCard:i,blogCard:n,articleCard:o}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(Ce=t),s&&isFunction(s)&&(Le=s),i&&isFunction(i)&&(Ie=i),n&&isFunction(n)&&(Ne=n),o&&isFunction(o)&&(Oe=o)}}));const{isRenderApp:ye,isJsVersion:be,triggerRenderMultipleComponent:De}=React.useContext(SledgeContext),{instantSearch:Pe}=ye||{},{value:$e,trigger:Ue}=(null==(c=null==De?void 0:De.instantSearch)?void 0:c.searchResult)||{},We=React.useRef(null),ke=usePrevious({keyword:H}),Me=async(e,t)=>{var s;const{filters:i,index_product:n,tabs:o,hidden_tags:r,show_out_of_stock:l,display:a}=e;let d,c={queries:("product-filter"===v?o.filter((({index:e})=>null==e?void 0:e.includes(n))):o).map((e=>{const{index:s}=e;let o=!1,a=o?[]:null==i?void 0:i.map((e=>{const{collections:t,items:s}=e;return $&&(null==t?void 0:t.includes(Number($)))||(null==t?void 0:t.includes("all"))?(o=!0,null==s?void 0:s.map((({value:e})=>e))):void 0})),d=s.includes(n),c=d&&a.length,u=[];return(null==r?void 0:r.length)&&u.push(`tags NOT IN [${r}]`),l||u.push("variants.inventory_quantity > 0"),$&&u.push(`collections.id = '${$}'`),c&&ae(a[0]),{indexUid:s,q:"default"===t?"":H,hitsPerPage:1,facets:c?a[0]:[],filter:d?u.join(" AND "):""}}))};if(b&&ve?(d=b.result,Te(!1)):d=await multiSearch(c),!d)return;const{results:u}=d;if(M(!1),ee(!1),B(!1),"totalDataPerIndex"===t)re(null==o?void 0:o.map((e=>{const{index:t}=e,{totalHits:s}=(null==u?void 0:u.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetStats:e,totalHits:t}=(null==u?void 0:u.find((({indexUid:e})=>e.includes(n))))||{};Se(e),fe((null==(s=null==a?void 0:a.filter)?void 0:s.hide_when_one_value)&&t<=1)}};React.useEffect((()=>{if(!Pe)return;const e=new URLSearchParams(document.location.search);G((null==e?void 0:e.get(P))||""),(async e=>{let t,s;if(ee(!0),t=JSON.parse(e),!t)return;const{allowed_sorts:i,default_sort:n,filters:o,index_product:r,tabs:l,hidden_tags:a,display:d,colors:c,show_out_of_stock:u}=t;se((null==i?void 0:i.length)?i:[]),ne((null==o?void 0:o.length)?o:[]),ce(r),xe(a),me(d),_e(c),Ee(n),je(u),s=l.find((({index:e})=>e.includes(r))),Object.keys(s).length&&(Y(s.index),q(s.name),J(s.type)),await Me(t,"default"),"default"===v&&await Me(t,"totalDataPerIndex")})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null)}),[Pe]),React.useEffect((()=>{$e&&(Ue&&Ue(""),G($e))}),[$e]),React.useEffect((()=>{if(Boolean(ke&&(null==ke?void 0:ke.keyword)!==H)&&"default"===v){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&Me(e,"totalDataPerIndex")}),500);return()=>clearTimeout(t)}}),[H]);const Fe="default"===v?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-tab-list sledge-instant-search__result-tab-list-skeleton",children:[1,2,3,4,5].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"122px",height:"28px",rounded:"md",color:"lighten"},e)))}):null,Be=(null==(u=null==pe?void 0:pe.filter)?void 0:u.enable_on_search)&&"horizontal"===(null==(x=null==pe?void 0:pe.filter)?void 0:x.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-skeleton",children:[1,2,3,4,5,6,7].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"106px",height:"42px",rounded:"md",color:"lighten"},e)))}):null,He=(null==(p=null==pe?void 0:pe.filter)?void 0:p.enable_on_search)&&"vertical"===(null==(m=null==pe?void 0:pe.filter)?void 0:m.layout)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",justifyContent:"space-between",marginBottom:"23px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"80px",height:"28px",color:"lighten",rounded:"md"})]}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"11px"}}),jsxRuntimeExports.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px"},children:[1,2,3,4,5,6,7,8,9].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"34px",height:"34px",color:"lighten",rounded:"full"},e)))})]}):null,Ge=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(g=null==pe?void 0:pe.filter)?void 0:g.show_total_products)&&"vertical"===(null==(_=null==pe?void 0:pe.filter)?void 0:_.layout)?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md",style:{marginBottom:"21px"}}):null,jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:12,type:"large"})]}),Ve=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(R=null==pe?void 0:pe.filter)?void 0:R.show_total_products)&&"horizontal"===(null==(E=null==pe?void 0:pe.filter)?void 0:E.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}):null,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"lg",style:{maxWidth:"630px"}})}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"150px",height:"42px",color:"lighten",rounded:"lg"})}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"150px",height:"42px",color:"lighten",rounded:"lg"})})]})]});return jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-container",ref:We,children:[k?null:jsxRuntimeExports.jsx("div",{className:""+("default"===v&&(null==oe?void 0:oe.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===v&&(null==oe?void 0:oe.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:oe.map((e=>{const{name:t,index:s,type:i,total:n}=e;let o=V===s;return jsxRuntimeExports.jsxs("li",{onClick:e=>(e=>{const{id:t,name:s,type:i}=e;Y(t),q(s),J(i),Q(t.includes(de)?jsxRuntimeExports.jsx(ResultProduct,{}):jsxRuntimeExports.jsx(ResultCategory,{}))})({id:s,name:t,type:i}),className:""+(o?"sledge-instant-search__result-tab-list-item-active":""),children:[t,jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-tab-total",children:n||0})]},s)}))}):null}),k&&(null==v?void 0:v.length)&&!b?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Fe,Be,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(h=null==pe?void 0:pe.filter)?void 0:h.enable_on_search)&&"vertical"===(null==(j=null==pe?void 0:pe.filter)?void 0:j.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:He}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[Ve,Ge]})]})]}):React.cloneElement(Z,{isLoading:F,keyword:H,clickedTabIndexId:V,clickedTabIndexName:K,clickedTabIndexType:z,isLoadingSetting:X,allowedSorts:te,allowedFilters:ie,facets:le,defaultFacetStats:we,hideFilterWhenOneValue:Ae,hiddenTags:ue,displaySettings:pe,colorSwatches:ge,defaultSort:Re,showOutOfStock:he,query:T,params:w,isJsVersion:be,productCardsComponent:Ce,collectionCardsComponent:Le,pageCardsComponent:Ie,blogCardsComponent:Ne,articleCardsComponent:Oe,onAfterAddToCart:A,onAfterAddWishlist:f,onAfterRemoveWishlist:C,onAfterRenderProduct:L,onAfterRenderCollection:I,onAfterRenderPage:N,onAfterRenderBlog:O,onAfterRenderArticle:y,setIsLoading:B,setKeyword:G,filterHorizontalSkeleton:Be,filterVerticalSkeleton:He,productGridSkeleton:Ge,searchAndSelectOptionSkeleton:Ve,searchResultContainerRef:We,data:b,settings:W})]})},ResultProduct=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,E,h,j,v,T,w,S,A,f;const{keyword:C,clickedTabIndexId:L,isLoadingSetting:I,allowedSorts:N,allowedFilters:O,facets:y,defaultFacetStats:b,hideFilterWhenOneValue:D,hiddenTags:P,displaySettings:$,colorSwatches:U,defaultSort:W,showOutOfStock:k,query:M,params:F,isJsVersion:B,productCardsComponent:H,setKeyword:G,filterHorizontalSkeleton:V,filterVerticalSkeleton:Y,productGridSkeleton:K,searchAndSelectOptionSkeleton:q,onAfterAddToCart:z,onAfterAddWishlist:J,onAfterRemoveWishlist:Z,onAfterRenderProduct:Q,searchResultContainerRef:X,data:ee,settings:te}=e||{},se=(null==M?void 0:M.keyword)?M.keyword:"q",{collectionId:ie}=F||{},[ne,oe]=React.useState(!ee),[re,le]=React.useState(!ee),[ae,de]=React.useState(!1),[ce,ue]=React.useState(!1),[xe,pe]=React.useState(W||""),[me,ge]=React.useState(N&&Boolean(null==N?void 0:N.length)?null==(t=N.find((({value:e})=>e===W)))?void 0:t.label:""),[_e,Re]=React.useState((null==(s=null==$?void 0:$.search)?void 0:s.limit)||10),[Ee,he]=React.useState(null),[je,ve]=React.useState([]),[Te,we]=React.useState({...k?{}:{"variants.inventory_quantity":"> 0"}}),[Se,Ae]=React.useState(!1),[fe,Ce]=React.useState((null==(o=null==(n=null==(i=null==ee?void 0:ee.result)?void 0:i.results)?void 0:n[0])?void 0:o.hits)||[]),[Le,Ie]=React.useState(0),[Ne,Oe]=React.useState(1),[ye,be]=React.useState(0),[De,Pe]=React.useState((null==(a=null==(l=null==(r=null==ee?void 0:ee.result)?void 0:r.results)?void 0:l[0])?void 0:a.totalHits)||0),[$e,Ue]=React.useState([]),[We,ke]=React.useState([]),[Me,Fe]=React.useState(!1),[Be,He]=React.useState(!0),[Ge,Ve]=React.useState({}),[Ye,Ke]=React.useState(ee?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(qe=null==$?void 0:$.filter)?void 0:qe.show_total_products)?jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[De," result"," ",(null==C?void 0:C.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',C,'"']})]}):null]}):null}):null);var qe;const ze=usePrevious({keyword:C,clickedLimitId:_e,clickedFacets:Te}),{color:Je,font_size:Ze,font_weight:Qe,text_transform:Xe}=(null==(d=null==$?void 0:$.filter)?void 0:d.title)||{},{color:et,font_size:tt,font_weight:st,text_transform:it}=(null==(c=null==$?void 0:$.filter)?void 0:c.option)||{},{text_color:nt,border_color:ot,border_radius:rt,padding_top:lt,padding_bottom:at,padding_left:dt,padding_right:ct,background_color:ut,font_size:xt,font_weight:pt,text_transform:mt}=(null==(u=null==$?void 0:$.filter)?void 0:u.button)||{},gt={...Je&&{color:Je},...Ze&&{fontSize:Ze},...Qe&&{fontWeight:Qe},...Xe&&{textTransform:Xe}},_t={...et&&{color:et},...tt&&{fontSize:tt},...st&&{fontWeight:st},...it&&{textTransform:it}},Rt=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const r in i){(null==y?void 0:y.length)&&!y.includes(r)&&(n[r]=i[r])}for(const r in e)(null==(t=e[r])?void 0:t.length)&&(n[r]=e[r]);const o=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==o?void 0:o.length)?`?${o}`:""}`)},Et=()=>{Fe(!0),we({}),Ae(!Se),Rt({}),Ue([]),setTimeout((()=>{Fe(!1)}),10)},ht=(e,t,s=!1)=>{var i;Fe(!0);let n=[t],o=["variants.price"].includes(e);Te&&(s?n=[t]:(null==(i=Te[e])?void 0:i.includes(t))?n=Te[e].filter((e=>e!==t)):o?(Te[e],Te[e]===t?(n=[],Ue([])):n=t):n=Te[e]?[...Te[e],t]:[t]);let r={...Te,[e]:n};Rt(r),we(r),Ae(!Se),setTimeout((()=>{Fe(!1)}),10)},jt=async(e=!1,t=!1)=>{var s,i;if(!L)return;e&&Oe(1),le(!0);let n,o=(e=>{const t=new URLSearchParams(document.location.search),s=Object.fromEntries(t);for(const i in s)(null==y?void 0:y.length)&&y.includes(i)&&(e[i]=s[i].split(","));return Object.keys(e).length&&we(e),e})(Te),r=Object.entries(o).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0],n=["variants.inventory_quantity"].includes(i),o=["variants.price"].includes(i),r=["tags"].includes(i);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?o?`${i} >= ${e[1][0]} AND ${i} <= ${e[1][1]}`:r?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:r?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==P?void 0:P.length)&&r.push(`tags NOT IN [${P}]`),ie&&r.push(`collections.id = '${ie}'`);let l={q:C,sort:xe?[xe]:[],page:e?1:Ne,hitsPerPage:_e,facets:y,filter:r.join(" AND ")};ee&&Be?(n=null==(i=null==(s=null==ee?void 0:ee.result)?void 0:s.results)?void 0:i[0],He(!1)):n=await search(L,l),((e,t)=>{var s;if(!e)return;const{hits:i,processingTimeMs:n,totalHits:o,totalPages:r,facetDistribution:l}=e;t&&(null==C?void 0:C.length)&&searchTrigger({keyword:C,resultCount:o||0}),oe(!1),le(!1),Ce(i),Ie(n||0),be(r),Pe(o||0),Ke(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(s=null==$?void 0:$.filter)?void 0:s.show_total_products)?jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[o," result"," ",(null==C?void 0:C.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',C,'"']})]}):null]}):null})),Ve(l?Object.fromEntries(Object.entries(l).map((e=>{let t=e[0],s=[];return"variants.inventory_quantity"===t?(Object.keys(l[t]).map((e=>Boolean(Number(e))?l[t][e]:0)),s=[{name:"In Stock",value:"> 0"}]):s=Object.keys(l[t]).map((e=>({name:e,value:e,total:l[t][e]||0}))),[t,s]}))):{})})(n,t)},vt=e=>{const t=new URLSearchParams(document.location.search);t.set(se,e),G&&G(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};React.useEffect((()=>{let e=Boolean(ze&&((null==ze?void 0:ze.keyword)!==C||(null==ze?void 0:ze.clickedLimitId)!==_e||(null==ze?void 0:ze.clickedFacets)!==Te));if(Boolean(ze&&(null==ze?void 0:ze.keyword)!==C)){const e=setTimeout((()=>{jt(!0,!0)}),500);return()=>clearTimeout(e)}jt(e)}),[xe,_e,Se,C,Ne,L,ie]),React.useEffect((()=>{(()=>{var e;if(!(null==(e=null==$?void 0:$.filter)?void 0:e.enable_on_search)||D)return;let t=!1;t||null==O||O.map((e=>{const{collections:s,items:i}=e;(ie&&(null==s?void 0:s.includes(Number(ie)))||(null==s?void 0:s.includes("all")))&&(t=!0,ke(i))}))})()}),[O,Ge,De]);const Tt=({label:e,name:t,value:s,index:i})=>{var n;let o=s;return["variants.price"].includes(t)&&(o=null==s?void 0:s.join(" - ")),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-refine-selected",style:_t,children:[jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-filter-item-title-refine-list",children:[e,": ",null==(n=String(o))?void 0:n.replaceAll("_"," ")]}),jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-refine-title-clear",onClick:()=>ht(t,s),children:jsxRuntimeExports.jsx("svg",{width:12,height:12,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]},i)},wt=e=>{var t,s;const{value:i,label:n,display:o}=e;let r=null,l=Ge[i],a=null==(t=null==$?void 0:$.filter)?void 0:t.show_number_matching_product;if("slider"===o.toLowerCase()){let e=b[i]&&Object.keys(b[i]).length?b[i]:{},t=$e[0]||(null==e?void 0:e.min),s=$e[1]||(null==e?void 0:e.max);r=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[jsxRuntimeExports.jsx(Slider,{defaultValue:t===s?[s]:[t,s],...(null==e?void 0:e.min)===(null==e?void 0:e.max)?{}:{min:null==e?void 0:e.min},max:null==e?void 0:e.max,step:1,setValueCommit:e=>ht(i,e),setValueChange:e=>Ue(e)}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider-minmax",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:$e[0]||(null==e?void 0:e.min)}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:$e[1]||(null==e?void 0:e.max)})]})]})}else"checkbox"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var s;return jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Checkbox,{id:`${i}_${t}`,name:i,value:e.value,label:`${e.name}${void 0!==e.total&&a?` (${e.total})`:""}`,onClick:e=>ht(i,e.currentTarget.value),checked:Te&&(null==(s=Te[i])?void 0:s.includes(e.value)),labelStyle:_t})},t)}))}):"radio"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(RadioGroup,{id:i,name:i,onValueChange:e=>ht(i,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:Te&&(null==(s=Te[i])?void 0:s.length)?Te[i][0]:"",labelStyle:_t})}):"select"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Select,{placeholder:`Select ${n}`,name:i,onValueChange:e=>ht(i,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:_t})}):"swatch"===o.toLowerCase()&&(null==l?void 0:l.length)&&(r=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var s;let n=(null==U?void 0:U.filter((({name:t})=>null==t?void 0:t.includes(e.value)))[0])||{};return jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(ColorSwatch,{id:`${i}_${t}`,name:i,value:e.value,rgb:null==n?void 0:n.rgb,image:null==n?void 0:n.image,onClick:e=>ht(i,e.currentTarget.value),defaultChecked:Te&&(null==(s=Te[i])?void 0:s.includes(e.value))})},t)}))}));return r},St=We.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=Ge[s],r=Boolean("slider"===n.toLowerCase()?o:null==o?void 0:o.length),l=["select"].includes(n.toLowerCase())&&(null==o?void 0:o.length),a=["sledge-instant-search__result-filter-item-list"],d=wt(e);return"swatch"===n.toLowerCase()&&(null==o?void 0:o.length)&&a.push("sledge-instant-search__result-filter-item-color-swatches"),r?jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>(e=>{he(e===Ee?"":e);let t=je;if(t.includes(e)){const s=t.indexOf(e);s>-1&&t.splice(s,1)}else t.push(e);ve(t)})(s),children:[jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:gt,children:i}),jsxRuntimeExports.jsx(motion.div,{initial:!1,animate:je.includes(s)?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:15,height:15,color:"#000000"})})]}),je.includes(s)&&jsxRuntimeExports.jsx("ul",{className:a.join(" "),children:l?d:Me?null:d})]},t):null})),At=We.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=Ee===s,r=Ge[s],l=Boolean("slider"===n.toLowerCase()?r:null==r?void 0:r.length),a=["radio","select"].includes(n.toLowerCase())&&(null==r?void 0:r.length),d=["sledge-instant-search__result-filter-item-list"],c=wt(e);return"swatch"===n.toLowerCase()&&(null==r?void 0:r.length)&&d.push("sledge-instant-search__result-filter-item-color-swatches"),l?jsxRuntimeExports.jsx("div",{className:"",children:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(Button,{type:"button",onClick:()=>he(s),children:[i,jsxRuntimeExports.jsx(motion.div,{initial:"closed",animate:o?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,className:"sort-trigger-icon",children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:20,height:20,color:"#000000"})})]}),content:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-facet",children:o&&jsxRuntimeExports.jsx("ul",{className:d.join(" "),children:a?c:Me?null:c})}),withOpenState:!1,setIsOpen:e=>he(e?s:""),hideCloseIcon:!0,align:"center",className:"sledge-instant-search__filter-horizontal-facet-content",customArrow:'<svg style="transform: rotate(180deg); margin-bottom: 3px; stroke-dasharray: 0,0,36;" width="44" height="12" viewBox="0 0 44 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.2222 1.99825e-06C23.2222 11.9998 4.88979 11.9999 0.000354767 12L23.2222 12L44 12C23.2222 12 23.2222 1.99825e-06 23.2222 1.99825e-06Z" fill="white" stroke="#393d4e" stroke-width="1px" /></svg>'})},t):null}));let ft=[];Object.entries(Te).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0];if(["variants.inventory_quantity"].includes(i))return;let n=["variants.price"].includes(i),o=We.filter((({value:e})=>null==e?void 0:e.includes(i))),r=(null==o?void 0:o.length)?o[0].label:i;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?ft.push({label:r,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{ft.push({label:r,name:i,value:e})})):ft.push({label:r,name:i,value:e[1][0]})}}));const Ct=jsxRuntimeExports.jsx(Pagination,{currentPage:Ne,totalPage:ye,totalResult:De,onChange:e=>(e=>{Oe(e),setTimeout((()=>{scrollToElement({element:X.current,headerOffset:50})}),200)})(e)});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(x=null==$?void 0:$.filter)?void 0:x.enable_on_search)&&"horizontal"===(null==(p=null==$?void 0:$.filter)?void 0:p.layout)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne&&!ee?V:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:I&&!ee?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:V}):jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:At}),Boolean((null==ft?void 0:ft.length)&&(null==(m=null==$?void 0:$.filter)?void 0:m.show_refine_by_block))?jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all",onClick:Et,children:"Clear All"}),ft.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Tt({label:s,name:i,value:n,index:t})}))]}):null]})})}):null,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(g=null==$?void 0:$.filter)?void 0:g.layout,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(_=null==$?void 0:$.filter)?void 0:_.enable_on_search)&&"vertical"===(null==(R=null==$?void 0:$.filter)?void 0:R.layout)?ne?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:Y}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:I?Y:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Boolean((null==ft?void 0:ft.length)&&(null==(E=null==$?void 0:$.filter)?void 0:E.show_refine_by_block))?jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title-refine",children:[jsxRuntimeExports.jsx("strong",{className:"sledge-instant-search__result-filter-item-title-refine-heading",children:"Filter"}),jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-title-refine-clear",onClick:Et,children:"Clear All"})]}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:ft.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Tt({label:s,name:i,value:n,index:t})}))})]}):null,St]})}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[ne?q:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(h=null==$?void 0:$.filter)?void 0:h.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:Ye}),jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:C,onChange:({value:e})=>vt(e),onResetField:()=>vt(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[jsxRuntimeExports.jsx("span",{children:"Sort by:"}),N&&Boolean(null==N?void 0:N.length)&&jsxRuntimeExports.jsx(SelectField,{align:"end",prefixLabel:jsxRuntimeExports.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M12.6296 4.34737C12.9144 4.34737 13.1497 4.55898 13.1869 4.83354L13.1921 4.90987L13.192 13.7599L15.2892 11.6543C15.5083 11.4341 15.8645 11.4333 16.0847 11.6525C16.2848 11.8517 16.3037 12.1641 16.1408 12.3847L16.0865 12.4479L13.0282 15.5204C13.0097 15.5386 12.991 15.555 12.9712 15.5701L13.0282 15.5204C13.0006 15.5482 12.9708 15.5724 12.9394 15.5932C12.9285 15.6 12.9171 15.607 12.9055 15.6135C12.8946 15.62 12.8837 15.6258 12.8725 15.6311C12.8615 15.6359 12.8504 15.6408 12.8391 15.6454C12.8247 15.6515 12.8099 15.6568 12.795 15.6613C12.7862 15.6637 12.7772 15.6662 12.7681 15.6685C12.7519 15.673 12.7357 15.6763 12.7193 15.6789C12.7116 15.6798 12.7036 15.6809 12.6955 15.6819C12.677 15.6844 12.6587 15.6857 12.6404 15.686C12.6368 15.6857 12.6332 15.6857 12.6296 15.6857L12.6186 15.686C12.6003 15.6857 12.582 15.6844 12.5637 15.6823L12.6296 15.6857C12.5989 15.6857 12.5689 15.6833 12.5396 15.6785C12.5233 15.6763 12.5071 15.673 12.4909 15.6689C12.4824 15.6663 12.4738 15.6639 12.4654 15.6614C12.4493 15.6569 12.4332 15.6512 12.4174 15.6448C12.4088 15.6408 12.4005 15.6372 12.3922 15.6333C12.3793 15.6278 12.3663 15.6211 12.3535 15.6139C12.342 15.6069 12.3307 15.6 12.3196 15.5926C12.3109 15.5875 12.3024 15.5815 12.294 15.5752L12.288 15.5701C12.2682 15.555 12.2494 15.5386 12.2318 15.5209L12.2308 15.5204L9.1725 12.4479C8.95334 12.2278 8.95416 11.8716 9.17434 11.6525C9.3745 11.4532 9.68704 11.4358 9.90687 11.5997L9.96983 11.6543L12.067 13.7614L12.0671 4.90987C12.0671 4.59921 12.3189 4.34737 12.6296 4.34737ZM5.18325 2.3122L5.19421 2.31189C5.21254 2.31224 5.23085 2.31348 5.24908 2.31562L5.18325 2.3122C5.21389 2.3122 5.24396 2.31465 5.27328 2.31937C5.28931 2.32156 5.3054 2.32487 5.32136 2.32889C5.33074 2.33164 5.3403 2.33433 5.34975 2.33725C5.36452 2.34142 5.37882 2.34648 5.39293 2.35213C5.40313 2.35668 5.41346 2.36119 5.42362 2.366C5.4357 2.37123 5.4476 2.37737 5.45931 2.38397C5.46933 2.39014 5.47926 2.39616 5.48898 2.40246C5.49898 2.40841 5.50899 2.41537 5.51882 2.42269L5.582 2.47746L8.64033 5.54996C8.85949 5.77013 8.85867 6.12629 8.63849 6.34545C8.43833 6.54469 8.12579 6.56212 7.90596 6.39822L7.843 6.34361L5.74525 4.23564L5.74575 13.088C5.74575 13.3987 5.49391 13.6505 5.18325 13.6505C4.89848 13.6505 4.66313 13.4389 4.62588 13.1644L4.62075 13.088L4.62025 4.23639L2.52367 6.34361C2.32443 6.54377 2.01197 6.56265 1.79139 6.39977L1.72817 6.34545C1.52801 6.14621 1.50914 5.83376 1.67202 5.61317L1.72633 5.54996L4.78467 2.47746L4.81779 2.44709C4.82557 2.44043 4.83353 2.43399 4.84167 2.42776L4.78467 2.47746C4.81226 2.44974 4.84202 2.42549 4.87341 2.40473C4.88436 2.39791 4.89574 2.39094 4.90738 2.38438C4.91819 2.37787 4.92917 2.37215 4.9403 2.36682C4.95128 2.36196 4.96242 2.35706 4.97375 2.35251C4.98814 2.34636 5.00289 2.34115 5.0178 2.33657C5.02687 2.33414 5.03616 2.33154 5.04555 2.32918C5.06066 2.32503 5.07593 2.32186 5.09129 2.31932C5.10053 2.31817 5.10959 2.31691 5.11871 2.31586C5.13607 2.31348 5.15388 2.31227 5.17171 2.3119C5.17564 2.31224 5.17944 2.3122 5.18325 2.3122Z",fill:"black"})}),options:N.map((e=>{const{label:t,value:s}=e;return{label:t,value:s}})),value:xe||(null==te?void 0:te.default_sort),onChange:({label:e,value:t})=>((e,t)=>{de(!1),ge(e),pe(t)})(e,t)})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(j=null==$?void 0:$.search)?void 0:j.allowed_limit)&&Boolean(null==(T=null==(v=null==$?void 0:$.search)?void 0:v.allowed_limit)?void 0:T.length)&&jsxRuntimeExports.jsx(SelectField,{align:"end",options:$.search.allowed_limit.map((e=>({label:e,value:e}))),value:_e,onChange:({value:e})=>(e=>{ue(!1),Re(e)})(e)})]})]})]}),re?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K,(null==fe?void 0:fe.length)?Ct:null]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["vertical"===(null==(w=null==$?void 0:$.filter)?void 0:w.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:Ye}),(null==fe?void 0:fe.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"large",data:fe.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(S=null==$?void 0:$.search)?void 0:S.show_vendor,show_sku:null==(A=null==$?void 0:$.search)?void 0:A.show_sku,show_price:null==(f=null==$?void 0:$.search)?void 0:f.show_price},isComponentJsVersion:B,cards:H,showOptionOutOfStock:!0,onAfterAddToCart:z,onAfterAddWishlist:J,onAfterRemoveWishlist:Z,onAfterRenderProduct:Q,dataWishlists:null==ee?void 0:ee.wishlists,dataReviews:null==ee?void 0:ee.reviews}),Ct]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})]})]})})]})},ResultCategory=e=>{const{keyword:t,clickedTabIndexId:s,clickedTabIndexName:i,clickedTabIndexType:n,isJsVersion:o,collectionCardsComponent:r,pageCardsComponent:l,blogCardsComponent:a,articleCardsComponent:d,setKeyword:c,searchResultContainerRef:u,onAfterRenderCollection:x,onAfterRenderPage:p,onAfterRenderBlog:m,onAfterRenderArticle:g}=e||{},[_,R]=React.useState(!0),[E,h]=React.useState(!0),[j,v]=React.useState(""),[T,w]=React.useState([]),[S,A]=React.useState(0),[f,C]=React.useState(1),[L,I]=React.useState(0),[N,O]=React.useState(0),[y,b]=React.useState(null),D=usePrevious({keyword:t}),P=async()=>{if(!s)return;let e;h(!0);let i={q:t,sort:j?[j]:[],page:f,hitsPerPage:12};e=await search(s,i),(e=>{if(!e)return;const{hits:s,processingTimeMs:i,totalHits:n,totalPages:o}=e;R(!1),h(!1),w(s),A(i||0),I(o),O(n||0),b(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[n," result"," ",(null==t?void 0:t.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',t,'"']})]}):null]})}))})(e)};React.useEffect((()=>{if(Boolean(D&&(null==D?void 0:D.keyword)!==t)){const e=setTimeout((()=>{P()}),500);return()=>clearTimeout(e)}P()}),[j,t,f,s]);const $=jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword sledge-instant-search__result-data-keyword-category",children:jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:`Search ${i?i.toLowerCase():""}...`,value:t,onChange:({value:e})=>c&&c(e),onResetField:()=>c&&c(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),U=jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}),W="collection"===n?jsxRuntimeExports.jsx(SkeletonLoading.CollectionGrid,{count:6}):"page"===n?jsxRuntimeExports.jsx(SkeletonLoading.PageGrid,{count:6}):"blog"===n?jsxRuntimeExports.jsx(SkeletonLoading.BlogGrid,{count:12}):"article"===n?jsxRuntimeExports.jsx(SkeletonLoading.ArticleGrid,{count:12}):null,k=()=>jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[$,U,W]}),M=()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[$,U,W]}),F=e=>"collection"===n?jsxRuntimeExports.jsx(CollectionGrid,{cards:r,onAfterRenderCollection:x,...e}):"page"===n?jsxRuntimeExports.jsx(PageGrid,{cards:l,onAfterRenderPage:p,...e}):"blog"===n?jsxRuntimeExports.jsx(BlogGrid,{cards:a,onAfterRenderBlog:m,...e}):"article"===n?jsxRuntimeExports.jsx(ArticleGrid,{cards:d,onAfterRenderArticle:g,...e}):null;return jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:_?jsxRuntimeExports.jsx(k,{}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:E?jsxRuntimeExports.jsx(M,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[$,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:y}),(null==T?void 0:T.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(F,{data:T,isComponentJsVersion:o}),jsxRuntimeExports.jsx(Pagination,{currentPage:f,totalPage:L,totalResult:N,onChange:e=>(e=>{C(e),setTimeout((()=>{scrollToElement({element:u.current,headerOffset:50})}),200)})(e)})]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})})})},ResultEmpty=e=>{const[t,s]=React.useState(""),[i,n]=React.useState("");return React.useEffect((()=>{s("No results found"),n("Your search did not match any results. <br/> Please try again")}),[]),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-empty",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-title",dangerouslySetInnerHTML:{__html:t}}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-description",dangerouslySetInnerHTML:{__html:i}})]})},SearchResultWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_RESULT_WIDGET));!element||element&&!element.length||element.map((item=>{var _a,_b,_c,_d,_e;if(item){const QUERY_KEYWORD=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.QUERY_KEYWORD),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),ON_AFTER_RENDER_COLLECTION=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.ON_AFTER_RENDER_COLLECTION),ON_AFTER_RENDER_PAGE=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.ON_AFTER_RENDER_PAGE),ON_AFTER_RENDER_BLOG=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.ON_AFTER_RENDER_BLOG),ON_AFTER_RENDER_ARTICLE=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.ON_AFTER_RENDER_ARTICLE),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),COLLECTION_CARDS=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_COLLECTION_CARD),PAGE_CARDS=null==(_c=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_PAGE_CARD),BLOG_CARDS=null==(_d=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_BLOG_CARD),ARTICLE_CARDS=null==(_e=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_e.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_ARTICLE_CARD);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchResultWidget,{query:{keyword:QUERY_KEYWORD||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},onAfterRenderCollection:state=>{item&&ON_AFTER_RENDER_COLLECTION&&eval(ON_AFTER_RENDER_COLLECTION)&&eval(ON_AFTER_RENDER_COLLECTION)({state:state})},onAfterRenderPage:state=>{item&&ON_AFTER_RENDER_PAGE&&eval(ON_AFTER_RENDER_PAGE)&&eval(ON_AFTER_RENDER_PAGE)({state:state})},onAfterRenderBlog:state=>{item&&ON_AFTER_RENDER_BLOG&&eval(ON_AFTER_RENDER_BLOG)&&eval(ON_AFTER_RENDER_BLOG)({state:state})},onAfterRenderArticle:state=>{item&&ON_AFTER_RENDER_ARTICLE&&eval(ON_AFTER_RENDER_ARTICLE)&&eval(ON_AFTER_RENDER_ARTICLE)({state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,collectionCard:COLLECTION_CARDS?eval(COLLECTION_CARDS):null,pageCard:PAGE_CARDS?eval(PAGE_CARDS):null,blogCard:BLOG_CARDS?eval(BLOG_CARDS):null,articleCard:ARTICLE_CARDS?eval(ARTICLE_CARDS):null})})})}))}}))},SearchWidget=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,E,h,j,v;const{isRenderApp:T,isJsVersion:w}=React.useContext(SledgeContext),{instantSearch:S}=T||{},{width:A="400px",children:f,onAfterAddToCart:C,onAfterAddWishlist:L,onAfterRemoveWishlist:I,onAfterRenderProduct:N}=e;let O=null,y=null,b=null,D=null;React.Children.map(f,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(O=t),s&&isFunction(s)&&(y=s),i&&isFunction(i)&&(b=i),n&&isFunction(n)&&(D=n)}}));const[P,$]=React.useState(!0),[U,W]=React.useState(""),[k,M]=React.useState([]),[F,B]=React.useState([]),[H,G]=React.useState({}),[V,Y]=React.useState({}),[K,q]=React.useState(""),z=usePrevious({keyword:U}),J=async(e,t=!1)=>{var s,i,n,o,r,l,a,d,c,u,x;if(!U.length)return;$(!0);const{index_product:p,tabs:m,hidden_tags:g,display:_,show_out_of_stock:R}=e,E=(null==(s=null==_?void 0:_.search)?void 0:s.suggestion)||{};let h,j={queries:m.map((e=>{const{index:t}=e;let s=t.includes(p),i=[];return(null==g?void 0:g.length)&&i.push(`tags NOT IN [${g}]`),R||i.push("variants.inventory_quantity > 0"),{indexUid:t,q:U,hitsPerPage:s?6:4,filter:s?i.join(" AND "):""}}))};if(h=await multiSearch(j),!h)return;const{results:v}=h;let T=null==v?void 0:v.filter((({indexUid:e})=>null==e?void 0:e.includes(p)));t&&(null==U?void 0:U.length)&&searchTrigger({keyword:U,resultCount:(null==(i=T[0])?void 0:i.totalHits)||0});let w=(null==(n=null==v?void 0:v.filter((({indexUid:e})=>!(null==e?void 0:e.includes(p)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==m?void 0:m.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],S=(null==T?void 0:T.length)?null==(o=T[0])?void 0:o.hits:[],A=U.length?(null==S?void 0:S.length)?"":"no_result":"zero_character",f=Boolean(!U.length&&Object.keys(E).length&&(null==(l=null==(r=E[A])?void 0:r.products)?void 0:l.active)&&(null==(c=null==(d=null==(a=E[A])?void 0:a.products)?void 0:d.list)?void 0:c.length));M(f?null==(x=null==(u=E[A])?void 0:u.products)?void 0:x.list:S),B(w),q(A),$(!1)};React.useEffect((()=>{S&&(async e=>{var t;if(!U.length)return;let s;if(s=JSON.parse(e),!s)return;const{display:i}=s;G(i),Y(null==(t=null==i?void 0:i.search)?void 0:t.suggestion),await J(s)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null)}),[S]),React.useEffect((()=>{if(Boolean(z&&(null==z?void 0:z.keyword)!==U)){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&J(e,!0)}),500);return()=>clearTimeout(t)}}),[U]);const Z={maxWidth:A};return jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:Z,children:[jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:U,onChange:({value:e})=>W(e),onResetField:()=>W(""),withClearField:!0}),jsxRuntimeExports.jsx(motion.div,{initial:"hidden",animate:U.length?"visible":"hidden",variants:VISIBLE_ANIMATION,className:"sledge-instant-search__widget-search-form-result",children:P?jsxRuntimeExports.jsx(ScrollArea,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other sledge-instant-search__widget-search-form-result-flex-item-other-skeleton",children:[0,1,2].map((e=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"md",...Boolean(e)&&{style:{marginTop:"12px"}}}),jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"140px"}},e)))})]},e)))}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:6,type:"small"})})]})}):jsxRuntimeExports.jsx(ScrollArea,{isLoading:P,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other",children:[Object.keys(V).length&&(null==(s=null==(t=V[K])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=V[K])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:y,keywords:V[K].keywords.list,isComponentJsVersion:w}):null,F.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:b,name:i,items:s,isComponentJsVersion:w})},t)}))]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-title-product",children:"Products"}),(null==k?void 0:k.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:k.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(r=null==H?void 0:H.search)?void 0:r.show_vendor,show_sku:null==(l=null==H?void 0:H.search)?void 0:l.show_sku,show_price:null==(a=null==H?void 0:H.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:w,cards:O,onAfterAddToCart:C,onAfterAddWishlist:L,onAfterRemoveWishlist:I,onAfterRenderProduct:N})}):Object.keys(V).length&&(null==(c=null==(d=V[K])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=V[K])?void 0:u.products)?void 0:x.list)?void 0:p.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-product-suggestion-no-result-text",children:[jsxRuntimeExports.jsx("span",{children:"Sorry, nothing found for"})," ",jsxRuntimeExports.jsx("strong",{children:U}),". ",jsxRuntimeExports.jsx("span",{children:"Did you mean:"})]}),jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:V[K].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==H?void 0:H.search)?void 0:m.show_vendor,show_sku:null==(g=null==H?void 0:H.search)?void 0:g.show_sku,show_price:null==(_=null==H?void 0:H.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:w,cards:O,onAfterAddToCart:C,onAfterAddWishlist:L,onAfterRemoveWishlist:I,onAfterRenderProduct:N})]}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product-disabled",children:"No product were found"})]})]}),(null==k?void 0:k.length)||Object.keys(V).length&&(null==(E=null==(R=V[K])?void 0:R.products)?void 0:E.active)&&(null==(v=null==(j=null==(h=V[K])?void 0:h.products)?void 0:j.list)?void 0:v.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:D,keyword:U,isComponentJsVersion:w})}):null]})})})]})},SearchWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_WIDGET));!element||element&&!element.length||element.map((item=>{var _a,_b,_c,_d;if(item){const WIDTH_ELEMENT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.WIDTH_ELEMENT),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_OTHER_INDEX_LIST),SEARCH_VIEW_MORE_RESULT=null==(_d=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchWidget,{width:WIDTH_ELEMENT||"",onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{suggestionKeywordList:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,otherIndexList:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,searchViewMoreResult:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null})})})}))}}))},InstantSearchInitSelector=()=>{ProductFilterWidgetInitSelector(),SearchResultWidgetInitSelector(),SearchIconWidgetInitSelector(),SearchIconWidgetPopupInitSelector(),SearchWidgetInitSelector()},SledgeContext=React.createContext({apiKey:"",instantSearchApiKey:"",userId:"",userEmail:"",userFullname:"",isRenderApp:{wishlist:!1,productReview:!1,instantSearch:!1},triggerRenderMultipleComponent:{wishlist:{badge:{trigger:()=>{},value:!1}},productReview:{rating:{trigger:()=>{},value:""}},instantSearch:{searchResult:{trigger:()=>{},value:""}}},sledgeAnonymId:"",isJsVersion:!1}),CustomComponents=e=>null,BadgeFloatingFull=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,position:a="left",dataSettings:d,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},[x,p]=React.useState(!1);React.useEffect((()=>{p(s&&u)}),[s]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating sledge-wishlist__badge-floating-${a}`,children:jsxRuntimeExports.jsxs("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:[jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-floating-text",children:"My Wishlist"}),jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[jsxRuntimeExports.jsx(HeartIcon,{width:18,height:18,type:"fill",color:"#000000"}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(r?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${r?"99+":o}`||0})]})]})})},BadgeFloatingIcon=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,position:a="bottom-right",dataSettings:d,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},[x,p]=React.useState(!1);React.useEffect((()=>{p(s&&u)}),[s]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating-icon sledge-wishlist__badge-floating-${a}`,children:jsxRuntimeExports.jsx("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[jsxRuntimeExports.jsx(HeartIcon,{width:27.01,height:25.73,type:"outline",color:"#000000"}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(r?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${r?"99+":o}`||0})]})})})},BadgeHeaderMenu=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,dataSettings:a,useProxyUrl:d}=e||{},{is_required_login:c}=(null==(t=null==a?void 0:a.display)?void 0:t.global)||{},u="#000000",[x,p]=React.useState(u),[m,g]=React.useState(!1);React.useEffect((()=>{g(s&&c)}),[s]);return jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge",onClick:e=>{m&&(e.preventDefault(),e.stopPropagation()),m?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):d&&(window.location.href=l||"/")},onMouseEnter:()=>p("#F85538"),onMouseLeave:()=>p(u),children:[jsxRuntimeExports.jsx(HeartIcon,{width:20,height:20,type:"outline",color:x}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-header-menu "+(r?"sledge-wishlist__badge-fit-content":""),children:n||m?0:`${r?"99+":o}`||0})]})},getWishlist=async(e,t)=>{const{page:s,limit:i,sort:n,keyword:o,shareId:r}=e||{};let l=t||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||""),a="?"+new URLSearchParams({page:s||"",limit:i||"",sort:n||"",keyword:o||"",share_id:r||""}).toString(),d=`${API_URL}/wishlist${a}`;return await fetchApi({url:d,method:"GET",authorization:l}).then((e=>e)).catch((()=>{}))},addWishlist=async e=>{const{productId:t,productVariantId:s,productName:i,productVendor:n,productSku:o,productVariantName:r,productLink:l,productImage:a,productCurrency:d,productPrice:c}=e;let u="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",x=`${API_URL}/wishlist`,p={product:JSON.stringify({id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,vendor:n,sku:o,variant_name:r,url:l,image_url:a,currency:d,price:c})};return await fetchApi({url:x,method:"POST",authorization:u,payload:p}).then((e=>e)).catch((()=>{}))},bulkAddWishlist=async e=>{let t="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:r,productCurrency:l,productPrice:a}=e;return{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,variant_name:n,url:o,image_url:r,currency:l,price:a}})),i=`${API_URL}/wishlist/bulk`,n={products:s};return await fetchApi({url:i,method:"POST",authorization:t,payload:n,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getWishlistInfo=async e=>{let t=e||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||""),s=`${API_URL}/wishlist/info`;return await fetchApi({url:s,method:"GET",authorization:t}).then((e=>e)).catch((()=>{}))},checkWishlist=async(e,t)=>{let s=sanitizeDataId(e),i=t?sanitizeDataId(t):"",n="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",o="?"+new URLSearchParams({variant_id:i}).toString(),r=`${API_URL}/wishlist/check/${s}${o}`;return await fetchApi({url:r,method:"GET",authorization:n}).then((e=>Boolean(e.data))).catch((()=>{}))},clearWishlist=async()=>{let e="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",t=`${API_URL}/wishlist/clear`;return await fetchApi({url:t,method:"DELETE",authorization:e}).then((e=>e)).catch((()=>{}))},addToCartTrigger=async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",i=`${API_URL}/wishlist/cart`,n={product:JSON.stringify({id:sanitizeDataId(t)})};return await fetchApi({url:i,method:"POST",authorization:s,payload:n}).then((e=>e)).catch((()=>{}))},BadgeRoot=e=>{var t;const{children:s,useProxyUrl:i=!1,data:n}=e,{isRenderApp:o,triggerRenderMultipleComponent:r}=React.useContext(SledgeContext),{wishlist:l}=o||{},{value:a,trigger:d}=(null==(t=null==r?void 0:r.wishlist)?void 0:t.badge)||{},[c,u]=React.useState((null==n?void 0:n.total_data)||0),[x,p]=React.useState(!n),[m,g]=React.useState(!n),[_,R]=React.useState(!1),[E,h]=React.useState((null==n?void 0:n.proxy_url)||""),[j,v]=React.useState({}),T=async()=>{var e,t,s;let i,n,o,r=!1;i=await getWishlistInfo(),r=200===(null==(e=null==i?void 0:i.status)?void 0:e.code)||!1,n=(null==(t=null==i?void 0:i.data)?void 0:t.total_data)?i.data.total_data:0,o=(null==(s=null==i?void 0:i.data)?void 0:s.proxy_url)||"",r&&(u(n),R(n>99),h(o),p(!1),g(!1))};return React.useEffect((()=>{l&&(async e=>{let t;t=JSON.parse(e),t&&(v(t),await T())})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null)}),[l]),React.useEffect((()=>{a&&(d&&d(!1),T())}),[a]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(s)&&React.Children.map(s,(e=>React.cloneElement(e,{isFirstLoading:x,isLoading:m,totalWishlist:c,isMaximizeTotalWishlist:_,proxyUrl:E,dataSettings:j,useProxyUrl:i})))})},Badge=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Badge.Root=BadgeRoot,Badge.HeaderMenu=BadgeHeaderMenu,Badge.FloatingFull=BadgeFloatingFull,Badge.FloatingIcon=BadgeFloatingIcon;const BadgeInitSelector=()=>{const e=localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)?JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""):null;if(!e)return;const{floating_button_type:t}=(null==e?void 0:e.launch_point)||{},s=String(t).includes("bottom");if("none"!==t)if(s){let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_ICON),document.body.appendChild(e),e){e.innerHTML="";const s=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(s&&"true"===s),children:jsxRuntimeExports.jsx(Badge.FloatingIcon,{position:t})})})}))}}else{let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_FULL),document.body.appendChild(e),e){e.innerHTML="";const s=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(s&&"true"===s),children:jsxRuntimeExports.jsx(Badge.FloatingFull,{position:t})})})}))}}else{let e=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BADGE));if(!e||e&&!e.length)return;e.map((e=>{if(e){const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`)&&e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`).remove();let s=document.createElement("div");s.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET),e.appendChild(s),client.createRoot(s).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(t&&"true"===t),children:jsxRuntimeExports.jsx(Badge.HeaderMenu,{})})})}))}}))}},ButtonDetail=e=>{var t,s,i,n,o,r;const{params:l,onAfterAddWishlist:a,onAfterRemoveWishlist:d}=e,{productId:c,productVariantId:u}=l||{},{isRenderApp:x,triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{wishlist:g}=x||{},{trigger:_}=(null==(t=null==p?void 0:p.wishlist)?void 0:t.badge)||{},[R,E]=React.useState(!0),[h,j]=React.useState(!0),[v,T]=React.useState(!1),[w,S]=React.useState({}),[A,f]=React.useState(!1),[C,L]=React.useState(!1),{is_required_login:I}=(null==(s=null==w?void 0:w.display)?void 0:s.global)||{},{type:N,icon:O,click_again_action:y,text_color:b,border_color:D,border_radius:P,padding_top:$,padding_bottom:U,padding_left:W,padding_right:k,background_color:M,font_size:F,font_weight:B,text_transform:H}=(null==(i=null==w?void 0:w.display)?void 0:i.button_detail)||{},{show:G,location:V}=(null==(n=null==w?void 0:w.display)?void 0:n.notification)||{},{before_adding_wishlist:Y,after_adding_wishlist:K,remove_from_wishlist:q}=(null==(o=null==w?void 0:w.languages)?void 0:o.button_detail)||{},{title_added_to_wishlist:z,text_added_to_wishlist:J,title_removed_to_wishlist:Z,text_removed_to_wishlist:Q}=(null==(r=null==w?void 0:w.languages)?void 0:r.notification)||{},X={...b&&{color:b},...D&&{borderColor:D},...P&&{borderRadius:P},...$&&{paddingTop:$},...U&&{paddingBottom:U},...W&&{paddingLeft:W},...k&&{paddingRight:k},...M&&{backgroundColor:M},...F&&{fontSize:F},...B&&{fontWeight:B},...H&&{textTransform:H}},ee=async()=>{let e;e=await checkWishlist(c,u),T(e)},te=async e=>{var t;if(e.preventDefault(),e.stopPropagation(),C)return void("undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}));f(!0),T(!v);let s=await addWishlist(l);200===(null==(t=null==s?void 0:s.status)?void 0:t.code)?(f(!1),_&&_(!0),BadgeInitSelector(),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistTriggerUpdate&&window.sledgeWishlistTriggerUpdate()),ee(),v?d&&d("success"):a&&a("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&G&&window.sledgeToastNotification({title:v?Z:z,message:v?Q:J,location:V,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(v?d&&d("failed"):a&&a("failed"),f(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&G&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:V,type:"failed"}))};React.useEffect((()=>{g&&("undefined"!=typeof window&&(window.sledgeWishlistButtonDetailUpdate=()=>{ee()}),(async e=>{let t;j(!0),t=JSON.parse(e),t&&(S(t),j(!1),E(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null))}),[g]),React.useEffect((()=>{L(m&&I)}),[m]),React.useEffect((()=>{ee()}),[u]);const se=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[N&&String(N).toLowerCase().includes("icon")&&(null==O?void 0:O.length)?jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail-icon",dangerouslySetInnerHTML:{__html:O},style:{fill:b}}):null,C?Y:N&&String(N).toLowerCase().includes("text")?A?v?"Adding...":"Removing...":v&&!y?K:v?q:Y:null]});return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-detail-wrapper",children:R?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"44px",rounded:"md",color:"lighten"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:N&&String(N).toLowerCase().includes("button")?jsxRuntimeExports.jsxs(Button,{type:"button",fullWidth:!0,style:X,...A||v&&!y?{disabled:!0}:{onClick:e=>te(e)},children:[A?jsxRuntimeExports.jsx(LoadingDots,{}):null,se]}):jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__widget-button-detail",style:X,...A||v&&!y?{disabled:!0}:{onClick:e=>te(e)},children:[A?jsxRuntimeExports.jsx(LoadingDots,{}):null,se]})})})},ButtonDetailInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BUTTON_DETAIL));!element||element&&!element.length||element.map((item=>{if(item){const PRODUCT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),PRODUCT_NAME=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_NAME),PRODUCT_VENDOR=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VENDOR),PRODUCT_SKU=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_SKU),PRODUCT_VARIANT_NAME=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_NAME),PRODUCT_LINK=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_LINK),PRODUCT_IMAGE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_IMAGE),PRODUCT_CURRENCY=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_CURRENCY),PRODUCT_PRICE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_PRICE),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(ButtonDetail,{params:{productId:PRODUCT_ID||"",productVariantId:PRODUCT_VARIANT_ID||"",productName:PRODUCT_NAME||"",productVendor:PRODUCT_VENDOR||"",productSku:PRODUCT_SKU||"",productVariantName:PRODUCT_VARIANT_NAME||"",productLink:PRODUCT_LINK||"",productImage:PRODUCT_IMAGE||"",productCurrency:PRODUCT_CURRENCY||"",productPrice:PRODUCT_PRICE||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})}})})}))}}))},Trigger=e=>{var t,s,i,n;const{params:o,forceActive:r=!1,hidden:l=!1,onAfterAddWishlist:a,onAfterRemoveWishlist:d,wishlistChecked:c}=e,{productId:u,productVariantId:x}=o||{},{isRenderApp:p,triggerRenderMultipleComponent:m,sledgeAnonymId:g}=React.useContext(SledgeContext),{wishlist:_}=p||{},{trigger:R}=(null==(t=null==m?void 0:m.wishlist)?void 0:t.badge)||{},E="#767676",h="outline",j="#F85538",v="fill",T="boolean"==typeof c,w=!!T&&c,[S,A]=React.useState(w?j:E),[f,C]=React.useState(w?v:h),[L,I]=React.useState(!!c),[N,O]=React.useState(!T),[y,b]=React.useState({}),[D,P]=React.useState({onAfterAddWishlist:a,onAfterRemoveWishlist:d}),[$,U]=React.useState(!1),[W,k]=React.useState(!0),{is_required_login:M}=(null==(s=null==y?void 0:y.display)?void 0:s.global)||{},{show:F,location:B}=(null==(i=null==y?void 0:y.display)?void 0:i.notification)||{},{title_added_to_wishlist:H,text_added_to_wishlist:G,title_removed_to_wishlist:V,text_removed_to_wishlist:Y}=(null==(n=null==y?void 0:y.languages)?void 0:n.notification)||{},K=async()=>{let e;"boolean"==typeof c&&W?(e=c,k(!1)):e=await checkWishlist(u,x),I(r||e)};React.useEffect((()=>{_&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{K()}),(async e=>{let t;O(!0),t=JSON.parse(e),t&&(b(t),O(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null))}),[_]),React.useEffect((()=>{U(g&&M)}),[g]),React.useEffect((()=>{_&&K()}),[_,x]);const q=(L||r)&&!$;return React.useEffect((()=>{q?(A(j),C(v)):(A(E),C(h))}),[L]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!N&&!l&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>(async e=>{if(e.preventDefault(),e.stopPropagation(),$)return void("undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}));I(!L);let t=await addWishlist(o);const{status:s,data:i}=t||{},{code:n}=s||{};200===n?(R&&R(!0),BadgeInitSelector(),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),K(),L?D.onAfterRemoveWishlist&&D.onAfterRemoveWishlist("success"):D.onAfterAddWishlist&&D.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&F&&window.sledgeToastNotification({title:L?V:H,message:L?Y:G,location:B,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(L?D.onAfterRemoveWishlist&&D.onAfterRemoveWishlist("failed"):D.onAfterAddWishlist&&D.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&F&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:B,type:"failed",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})}))})(e),onMouseEnter:()=>{q||(A(j),C(v))},onMouseLeave:()=>{q||(A(E),C(h))},children:jsxRuntimeExports.jsx(HeartIcon,{width:16.67,height:15.83,type:f,color:S})})})})},ElementInit=item=>{item.parentNode&&item.parentNode.classList.add("sledge-wishlist__trigger-parent-element"),item.classList.add("sledge-wishlist__trigger-wrapper");const PRODUCT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),PRODUCT_NAME=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_NAME),PRODUCT_VENDOR=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VENDOR),PRODUCT_SKU=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_SKU),PRODUCT_VARIANT_NAME=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_NAME),PRODUCT_LINK=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_LINK),PRODUCT_IMAGE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_IMAGE),PRODUCT_CURRENCY=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_CURRENCY),PRODUCT_PRICE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_PRICE),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Trigger,{params:{productId:PRODUCT_ID||"",productVariantId:PRODUCT_VARIANT_ID||"",productName:PRODUCT_NAME||"",productVendor:PRODUCT_VENDOR||"",productSku:PRODUCT_SKU||"",productVariantName:PRODUCT_VARIANT_NAME||"",productLink:PRODUCT_LINK||"",productImage:PRODUCT_IMAGE||"",productCurrency:PRODUCT_CURRENCY||"",productPrice:PRODUCT_PRICE||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})}})})}))},TriggerInitSelector=()=>{new MutationObserver((function(e){e.forEach((function(e){Array.prototype.slice.call(e.addedNodes).forEach((function(e){if(1===e.nodeType&&e.querySelector(SELECTOR.WISHLIST.ELEMENT_TRIGGER)){let t=Array.from(e.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_TRIGGER));t.length&&t.map((e=>{ElementInit(e)}))}}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1});let e=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_TRIGGER));!e||e&&!e.length||e.map((e=>{ElementInit(e)}))},WidgetHeaderClearTrigger=({buttonText:e,shareId:t,dataSettings:s,isFirstLoading:i})=>{var n,o,r,l,a;const{sledgeAnonymId:d}=React.useContext(SledgeContext),{is_required_login:c}=(null==(n=null==s?void 0:s.display)?void 0:n.global)||{},{text_color:u,border_color:x,border_radius:p,padding_top:m,padding_bottom:g,padding_left:_,padding_right:R,background_color:E,font_size:h,font_weight:j,text_transform:v}=(null==(r=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:r.button_clear_all)||{},{title_confirm_clear_all_wishlist:T,text_confirm_clear_all_wishlist:w,button_submit_confirm_clear_all_wishlist:S,button_cancel_confirm_clear_all_wishlist:A}=(null==(l=null==s?void 0:s.languages)?void 0:l.popup)||{},{button_clear_all:f}=(null==(a=null==s?void 0:s.languages)?void 0:a.widget)||{},[C,L]=React.useState(!1),I={...u&&{color:u},...x&&{borderColor:x},...p&&{borderRadius:p},...m&&{paddingTop:m},...g&&{paddingBottom:g},..._&&{paddingLeft:_},...R&&{paddingRight:R},...E&&{backgroundColor:E},...h&&{fontSize:h},...j&&{fontWeight:j},...v&&{textTransform:v}};React.useEffect((()=>{L(d&&c)}),[d]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!C&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!t&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"lighten",rounded:"md"}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"danger",onClick:()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:T,message:w,textSubmit:S,textCancel:A,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:I,children:e||(f||"Clear Wishlist")})})})})})},WidgetHeaderShareTrigger=({wishlistData:e,buttonText:t,showShareTrigger:s,shareLink:i,shareId:n,dataSettings:o,isFirstLoading:r})=>{var l,a,d,c,u,x,p;const{triggerRenderMultipleComponent:m,sledgeAnonymId:g}=React.useContext(SledgeContext),{trigger:_}=(null==(l=null==m?void 0:m.wishlist)?void 0:l.badge)||{},{is_required_login:R}=(null==(a=null==o?void 0:o.display)?void 0:a.global)||{},{text_color:E,border_color:h,border_radius:j,padding_top:v,padding_bottom:T,padding_left:w,padding_right:S,background_color:A,font_size:f,font_weight:C,text_transform:L}=(null==(c=null==(d=null==o?void 0:o.display)?void 0:d.widget)?void 0:c.button_share)||{},{title_share_wishlist:I}=(null==(u=null==o?void 0:o.languages)?void 0:u.popup)||{},{button_share:N}=(null==(x=null==o?void 0:o.languages)?void 0:x.widget)||{},{title_added_all_to_wishlist:O,text_added_all_to_wishlist:y}=(null==(p=null==o?void 0:o.languages)?void 0:p.notification)||{},[b,D]=React.useState(!1),P={...E&&{color:E},...h&&{borderColor:h},...j&&{borderRadius:j},...v&&{paddingTop:v},...T&&{paddingBottom:T},...w&&{paddingLeft:w},...S&&{paddingRight:S},...A&&{backgroundColor:A},...f&&{fontSize:f},...C&&{fontWeight:C},...L&&{textTransform:L}},[$,U]=React.useState(!1);let W='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="vuesax/linear/copy">\n <g id="copy">\n <path id="Vector" d="M16 12.9V17.1C16 20.6 14.6 22 11.1 22H6.9C3.4 22 2 20.6 2 17.1V12.9C2 9.4 3.4 8 6.9 8H11.1C14.6 8 16 9.4 16 12.9Z" stroke="#767676" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path id="Vector_2" d="M22 6.9V11.1C22 14.6 20.6 16 17.1 16H16V12.9C16 9.4 14.6 8 11.1 8H8V6.9C8 3.4 9.4 2 12.9 2H17.1C20.6 2 22 3.4 22 6.9Z" stroke="#767676" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </g>\n </g>\n </svg>\n ';const k=async()=>{var t;U(!0);let s=e.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:r,currency:l,price:a}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:r,productCurrency:l,productPrice:a}})),i=await bulkAddWishlist(s);200===(null==(t=null==i?void 0:i.status)?void 0:t.code)?("undefined"!=typeof window&&(_&&_(!0),BadgeInitSelector(),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:O,message:y,textCancel:"Cancel"})),U(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return React.useEffect((()=>{D(g&&R)}),[g]),new MutationObserver((function(e){e.forEach((function(e){Array.prototype.slice.call(e.addedNodes).forEach((function(e){1===e.nodeType&&e.querySelector(".sledge-wishlist__widget-box-copy")&&(()=>{let e=!0;if(document.querySelector(".sledge-wishlist__widget-box-copy")&&e){e=!1;let t=document.querySelector(".sledge-wishlist__widget-box-copy-icon");null==t||t.addEventListener("click",(()=>{var e;let s=null==(e=document.querySelector(".sledge-wishlist__widget-box-copy-content"))?void 0:e.textContent;s&&(navigator.clipboard.writeText(s),t&&(t.classList.add("active"),t.innerHTML='<svg width="20" height="20" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>',setTimeout((()=>{t&&(t.classList.remove("active"),t.innerHTML=W)}),2500)))}))}})()}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!b&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:s&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:r?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"lighten",rounded:"md"}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:jsxRuntimeExports.jsx(Button,{type:"button",style:P,...n&&!e.length||$?{disabled:!0}:{onClick:async()=>{n&&e.length?window.sledgeConfirmationPopup({title:"Are you sure want to add this to your wishlist item?",message:`This action cannot be undone. This will adding <strong>${e.length}</strong> item to your wishlist page.`,textSubmit:"Add to your wishlist",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:k||{}}):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:I,message:i?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${W}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${i}</div>\n </div>`:"",textCancel:"Cancel"})}},children:n?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:e.length}),$?jsxRuntimeExports.jsx(LoadingDots,{}):null,"Add to your wishlist"]}):t||(N||"Share Wishlist")})})})})})},WidgetHeaderSearchForm=({setIsLoading:e,setKeyword:t,keyword:s,placeholder:i,dataSettings:n})=>{var o,r;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},{search_form_placeholder:d}=(null==(r=null==n?void 0:n.languages)?void 0:r.widget)||{},[c,u]=React.useState(!1),x=React.useRef(null);return React.useEffect((()=>{u(l&&a)}),[l]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!c&&jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:i||(d||"Search product..."),value:s,fieldRef:x,onChange:({value:e})=>(e=>{t&&t(e)})(e),onResetField:()=>{var s;e&&e(!0),t&&t(""),null==(s=null==x?void 0:x.current)||s.focus()},className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-search-form",withClearField:!0})})},WidgetHeaderTitle=({text:e,dataSettings:t})=>{var s,i,n;const{color:o,font_size:r,font_weight:l,text_transform:a}=(null==(i=null==(s=null==t?void 0:t.display)?void 0:s.widget)?void 0:i.header_title)||{},{header_title:d}=(null==(n=null==t?void 0:t.languages)?void 0:n.widget)||{},c={...o&&{color:o},...r&&{fontSize:r},...l&&{fontWeight:l},...a&&{textTransform:a}};return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx("h1",{style:c,children:e||(d||"My Wishlist")})})},WidgetHeaderLimit=({limitOptions:e,selectedLimit:t,setSelectedLimit:s,setIsRefreshWidgetList:i,dataSettings:n})=>{var o;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:l}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(r&&l)}),[r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&Boolean(null==e?void 0:e.length)&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx(SelectField,{align:"end",options:e.map((e=>({label:e,value:e}))),value:t||e[0],onChange:({value:e})=>(e=>{s&&s(e),i&&i(!0)})(e)})})})})},WidgetHeaderSort=({wishlistSort:e,selectedSort:t,setSelectedSort:s,setIsRefreshWidgetList:i,dataSettings:n})=>{var o;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:l}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(r&&l)}),[r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&Boolean(null==e?void 0:e.length)&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx(SelectField,{align:"end",options:e.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:t,onChange:({value:e})=>(e=>{s&&s(e),i&&i(!0)})(e),placeholder:"- Select -"})})})})},WidgetHeader=({isFirstLoading:e,...t})=>jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header",children:e?jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px",width:"100%",justifyContent:"space-between"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"440px",height:"46px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"lighten",rounded:"md"})]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"26px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"})]})]}):React.Children.count(t.children)&&React.Children.map(t.children,(e=>React.cloneElement(e,{...t})))});WidgetHeader.Title=WidgetHeaderTitle,WidgetHeader.SearchForm=WidgetHeaderSearchForm,WidgetHeader.ShareTrigger=WidgetHeaderShareTrigger,WidgetHeader.ClearTrigger=WidgetHeaderClearTrigger,WidgetHeader.Sort=WidgetHeaderSort,WidgetHeader.Limit=WidgetHeaderLimit;const defaultGridType="large",WidgetList=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isLoading:i,wishlistData:n,dataSettings:o,gridType:r=defaultGridType}=e||{},{is_required_login:l}=(null==(t=null==o?void 0:o.display)?void 0:t.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(s&&l)}),[s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:8,type:r}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-wrapper",children:!(null==n?void 0:n.length)||a?jsxRuntimeExports.jsx(WidgetListEmpty,{...e,isRequiredLogin:a}):jsxRuntimeExports.jsx(ProductWrapper,{...e})})})},WidgetListEmpty=e=>{var t;const{onSearch:s,keyword:i,dataSettings:n,isRequiredLogin:o}=e||{},{title_no_result:r,text_no_result:l}=(null==(t=null==n?void 0:n.languages)?void 0:t.widget)||{},[a,d]=React.useState(""),[c,u]=React.useState(""),[x,p]=React.useState(!1),[m,g]=React.useState(""),[_,R]=React.useState("");return React.useEffect((()=>{o?(d("Login required!"),u("Please login to save your wishlist across devices."),p(!0),g("Login"),R("/account/login")):s||(d(i?"No products found":r),u(i?"Your search did not match any products. <br/> Please try again":l),p(!i),g("Continue Shopping"),R("/"))}),[s,n]),jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-product-empty",children:[jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-empty-icon",children:jsxRuntimeExports.jsx(HeartIcon,{width:32,height:32,type:"outline",color:"#000000"})}),jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-empty-title",dangerouslySetInnerHTML:{__html:a}}),jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-empty-description",dangerouslySetInnerHTML:{__html:c}}),x&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-wrapper",children:jsxRuntimeExports.jsxs("a",{href:_,className:"sledge__button sledge-wishlist__widget-product-empty-button-shopping","data-button-color-type":"light",children:[jsxRuntimeExports.jsx("span",{children:m})," ",jsxRuntimeExports.jsx(ArrowRightIcon,{width:16.195,height:16.195,color:"black"})]})})]})},ProductWrapper=e=>{var t,s,i,n,o,r,l,a;const{isJsVersion:d}=React.useContext(SledgeContext),{wishlistData:c,currentPage:u,setCurrentPage:x,totalPage:p,shareId:m,dataSettings:g,gridType:_=defaultGridType,productCardsComponent:R,onAfterAddToCart:E,onAfterAddWishlist:h,onAfterRemoveWishlist:j,onAfterRenderProduct:v,dataReviews:T}=e||{},{show_add_to_cart:w,redirect_add_to_cart:S}=(null==(t=null==g?void 0:g.display)?void 0:t.widget)||{},{text_color:A,border_color:f,border_radius:C,padding_top:L,padding_bottom:I,padding_left:N,padding_right:O,background_color:y,font_size:b,font_weight:D,text_transform:P}=(null==(i=null==(s=null==g?void 0:g.display)?void 0:s.widget)?void 0:i.button_add_to_cart)||{},{color:$,font_size:U,font_weight:W,text_transform:k}=(null==(o=null==(n=null==g?void 0:g.display)?void 0:n.widget)?void 0:o.price)||{},{color:M,font_size:F,font_weight:B,text_transform:H}=(null==(l=null==(r=null==g?void 0:g.display)?void 0:r.widget)?void 0:l.product_name)||{},{button_add_to_cart:G}=(null==(a=null==g?void 0:g.languages)?void 0:a.widget)||{},V={...A&&{color:A},...f&&{borderColor:f},...C&&{borderRadius:C},...L&&{paddingTop:L},...I&&{paddingBottom:I},...N&&{paddingLeft:N},...O&&{paddingRight:O},...y&&{backgroundColor:y},...b&&{fontSize:b},...D&&{fontWeight:D},...P&&{textTransform:P}},Y={...$&&{color:$},...U&&{fontSize:U},...W&&{fontWeight:W},...k&&{textTransform:k}},K={...M&&{color:M},...F&&{fontSize:F},...B&&{fontWeight:B},...H&&{textTransform:H}};let q=u||0,z=p||0;const[J,Z]=React.useState(!1),[Q,X]=React.useState(!1);React.useEffect((()=>{X(!(z===q&&!J)&&z>=q)}),[J]),React.useEffect((()=>{Z(!1)}),[c]);let ee={};for(const te of c)ee[te.product.id]=!0;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==c?void 0:c.length)?jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"wishlist",type:_,data:c.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:r,currency:l,price:a,vendor:d,sku:c,variants:u,...x}=(null==e?void 0:e.product)||{},p=new URL(o).pathname.split("/"),m=p[p.length-1];return{product:{id:t,admin_graphql_api_id:`${SHOPIFY_GID_PRODUCT_ID}${t}`,handle:m,title:i,image:{src:r},url:o,vendor:d,currency:l,...x},variants:u}})),setting:{show_vendor:!0,show_sku:!0,show_price:!0,show_add_to_cart:w,redirect_add_to_cart:S,language_button_add_to_cart:G,display_product_name_style:K,display_price_style:Y,display_button_add_to_cart_style:V},showOptionOutOfStock:!1,triggerPropAdditional:{forceActive:!0,...m&&{hidden:!0}},isComponentJsVersion:d,cards:R,onAfterAddToCart:E,onAfterAddWishlist:h,onAfterRemoveWishlist:j,onAfterRenderProduct:v,dataReviews:T,dataWishlists:ee}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),Q&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-load-more",children:jsxRuntimeExports.jsx(Button,{type:"button",role:"button",colorType:"light",disabled:J,onClick:()=>{x&&u&&x(u+1),Z(!0)},style:{...J&&{cursor:"wait"}},children:J?"Loading...":"Load More"})})]})},WidgetRoot=e=>{var t,s;const{children:i,query:n,params:o,customRoutePage:r,onAfterAddToCart:l,onAfterAddWishlist:a,onAfterRemoveWishlist:d,onAfterRenderProduct:c,data:u,dataInfo:x,dataReviews:p,limitOptions:m=DEFAULT_LIMIT_VALUE}=e,{shareId:g="share"}=n||{},{isRenderApp:_,triggerRenderMultipleComponent:R,sledgeAnonymId:E,isJsVersion:h}=React.useContext(SledgeContext),{wishlist:j}=_||{},{trigger:v}=(null==(t=null==R?void 0:R.wishlist)?void 0:t.badge)||{},[T,w]=React.useState(!u),[S,A]=React.useState(!u),[f,C]=React.useState((null==u?void 0:u.data)||[]),[L,I]=React.useState((null==u?void 0:u.sorts)||[]),[N,O]=React.useState(!1),[y,b]=React.useState(""),[D,P]=React.useState(m[0]),[$,U]=React.useState(""),[W,k]=React.useState(1),[M,F]=React.useState((null==(s=null==u?void 0:u.page)?void 0:s.total_page)||0),[B,H]=React.useState(!1),[G,V]=React.useState(!!u),[Y,K]=React.useState(""),[q,z]=React.useState(null),[J,Z]=React.useState(""),[Q,X]=React.useState({}),[ee,te]=React.useState(!!u),se=usePrevious({keyword:$,currentPage:W}),ie=async(e=!1,t=!1)=>{var s,i,n,r;const l=new URLSearchParams(document.location.search),a=(null==o?void 0:o.shareId)?o.shareId:(null==l?void 0:l.get(g))||"";let d;A(!!N||!e),e||(k(1),C([]));let c,x,p=!1,m=0,_={page:e?W:1,limit:D,sort:y,keyword:$,shareId:a};d=u&&t?u:await getWishlist(_),p=200===(null==(s=null==d?void 0:d.status)?void 0:s.code)||!1,c=(null==(i=d.data)?void 0:i.length)?t=>(null==f?void 0:f.length)&&e?[...t,...d.data]:d.data:[],x=(null==(n=d.sorts)?void 0:n.length)?d.sorts:[],m=(null==(r=null==d?void 0:d.page)?void 0:r.total_page)||1,p&&(C(c),I(x),F(m),A(!1),O(!1))};React.useEffect((()=>{if(!j)return;let e=Boolean(se&&(null==se?void 0:se.currentPage)!==W);if(se&&(null==se?void 0:se.keyword)!==$){H(!0);const e=setTimeout((()=>{H(!1),ie()}),500);return()=>clearTimeout(e)}ie(e,!0)}),[j,$,W]),React.useEffect((()=>{j&&N&&ie()}),[N]),React.useEffect((()=>{if(!j)return;const e=new URLSearchParams(document.location.search);z((null==o?void 0:o.shareId)?o.shareId:(null==e?void 0:e.get(g))||""),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate=()=>{ie()},window.sledgeWishlistWidgetClearList=()=>{(async()=>{var e;let t;A(!0);let s=!1;t=await clearWishlist(),s=200===(null==(e=null==t?void 0:t.status)?void 0:e.code),s?(await ie(),v&&v(!0),BadgeInitSelector()):"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed clear all wishlist",type:"failed"})})()}),(async()=>{var e,t,s,i;let n;V(!1);let o,l,a,d=!1;x?(n={data:x},d=!0):(n=await getWishlistInfo(),d=200===(null==(e=null==n?void 0:n.status)?void 0:e.code)||!1),o=(null==(t=null==n?void 0:n.data)?void 0:t.proxy_url)||"",a=(null==(s=null==n?void 0:n.data)?void 0:s.share_id)||"",l=r?`${r}?${g}=${a}`:null==(i=null==n?void 0:n.data)?void 0:i.share_link,d&&(Z(o),K(window.location.origin+l),V(!0))})(),(async e=>{let t;t=JSON.parse(e),t&&X(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null),w(!1)}),[j]),React.useEffect((()=>{var e;const{is_required_login:t}=(null==(e=null==Q?void 0:Q.display)?void 0:e.global)||{};te(E&&!t)}),[E,Q]);let ne=null,oe=null;React.Children.map(i,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,wishlistWidgetAlert:s}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(ne=t),s&&isFunction(s)&&(oe=s)}}));const re=oe;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-wrapper",children:[ee&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:T?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"99.5%",height:"72px",color:"lighten",rounded:"none",style:{margin:"0 auto"}}):re?jsxRuntimeExports.jsx(React.Fragment,{children:h?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:re()}}):jsxRuntimeExports.jsx(re,{})}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-alert",children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-alert-text",children:["Please login to save your wishlist across devices."," ",jsxRuntimeExports.jsx("a",{href:"/account/login",className:"sledge-wishlist__widget-alert-link",children:"Login Here"})]})})}),React.Children.count(i)&&React.Children.map(i,(e=>React.cloneElement(e,{isLoading:S,isFirstLoading:T,wishlistData:f,wishlistSort:L,selectedSort:y,selectedLimit:D,keyword:$,currentPage:W,totalPage:M,limitOptions:m,onSearch:B,showShareTrigger:G,shareLink:Y,shareId:q,proxyUrl:J,dataSettings:Q,productCardsComponent:ne,query:n,setIsLoading:A,setIsRefreshWidgetList:O,setSelectedSort:b,setSelectedLimit:P,setKeyword:U,setCurrentPage:k,onAfterAddToCart:l,onAfterAddWishlist:a,onAfterRemoveWishlist:d,onAfterRenderProduct:c,dataReviews:p})))]})})},Widget=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Widget.Root=WidgetRoot,Widget.Header=WidgetHeader,Widget.List=WidgetList;const WidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_WIDGET));!element||element&&!element.length||element.map((item=>{var _a,_b;if(item){const SHARE_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.SHARE_ID),QUERY_SHARE_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.QUERY_SHARE_ID),CUSTOM_ROUTE_PAGE=item.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.CUSTOM_ROUTE_PAGE),LIMIT_OPTIONS=item.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.LIMIT_OPTIONS),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),WISHLIST_WIDGET_ALERT=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.RENDER_WISHLIST_WIDGET_ALERT);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsxs(Widget.Root,{customRoutePage:CUSTOM_ROUTE_PAGE||"",query:{shareId:QUERY_SHARE_ID||""},params:{shareId:SHARE_ID||""},...LIMIT_OPTIONS&&String(LIMIT_OPTIONS).includes(",")?{limitOptions:String(LIMIT_OPTIONS).replaceAll(" ","").split(",")}:{},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:[jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,wishlistWidgetAlert:WISHLIST_WIDGET_ALERT?eval(WISHLIST_WIDGET_ALERT):null}),jsxRuntimeExports.jsxs(Widget.Header,{children:[jsxRuntimeExports.jsx(WidgetHeader.Title,{text:"My Wishlist"}),jsxRuntimeExports.jsx(WidgetHeader.SearchForm,{placeholder:"Search product"}),jsxRuntimeExports.jsx(WidgetHeader.ClearTrigger,{buttonText:"Clear Wishlist"}),jsxRuntimeExports.jsx(WidgetHeader.ShareTrigger,{buttonText:"Share Wishlist"}),jsxRuntimeExports.jsx(WidgetHeader.Sort,{}),jsxRuntimeExports.jsx(WidgetHeader.Limit,{})]}),jsxRuntimeExports.jsx(Widget.List,{gridType:"large"})]})})}))}}))},WishlistInitSelector=()=>{BadgeInitSelector(),TriggerInitSelector(),WidgetInitSelector(),ButtonDetailInitSelector()},ProductCard=e=>{var t,s,i;const{item:n,handleAddToCart:o,clickedAddToCartId:r,setting:l,showOptionOutOfStock:a=!1,triggerPropAdditional:d,sourceApp:c=null,isComponentJsVersion:u=!1,cards:x,onAfterAddWishlist:p,onAfterRemoveWishlist:m,showPopupComponent:g,setShowPopupComponent:_,dataReviews:R,dataWishlists:E}=e,{show_vendor:h=!0,show_sku:j=!0,show_price:v=!0,show_add_to_cart:T=!0,language_button_add_to_cart:w="Add To Cart",display_product_name_style:S={},display_price_style:A={},display_button_add_to_cart_style:f={}}=l||{},{product:C,variants:L}=n||{},{id:I,title:N,image:O,url:y,vendor:b="",currency:D,handle:P}=C||{},{id:$="",admin_graphql_api_id:U="",title:W="",price:k="",sku:M=""}=(null==L?void 0:L.length)?L[0]:{},F=U||"",[B,H]=React.useState(F);let G=r==B,V=!(!(null==L?void 0:L.length)||!Object.hasOwn(L[0],"inventory_quantity"))&&(!L[0].inventory_quantity&&a),Y=null;if(x){const e={product:{...C,variants:L.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(L[t],"inventory_quantity")&&!s}})),...R&&Object.keys(R).length?{review:{total:(null==(t=null==R?void 0:R[I])?void 0:t.review_count)?null==R?void 0:R[I].review_count:0,average:(null==(i=null==(s=null==R?void 0:R[I])?void 0:s.rating)?void 0:i.average)?null==R?void 0:R[I].rating.average:0}}:{}},showPopupComponent:g,setShowPopupComponent:_,sourceApp:c};Y=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:u?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:x({...e})}}):jsxRuntimeExports.jsx(x,{...e})})}else{let e=function(){(null==L?void 0:L.length)&&(r["data-product-id"]=I,r["data-product-handle"]=P,r["data-selected-option1"]=L[0].option1,L[0].option2&&(r["data-selected-option2"]=L[0].option2),r["data-variant-id"]=L[0].admin_graphql_api_id)},t=function(e,t){const s=e.target.offsetParent.querySelector(`.options-button-${t}`).querySelectorAll("button"),i=()=>{s.forEach(((t,s)=>{t.classList.remove("sledge__product-variant-size-swatch-active"),e.target.className+=" sledge__product-variant-size-swatch-active"}))};if("Color"===t)s.forEach(((t,s)=>{t.classList.remove("sledge__product-variant-color-swatch-active"),e.target.className+=" sledge__product-variant-color-swatch-active"}));else i()},s=function(e,t,s){var i;const n=e.target.offsetParent,o=n.querySelector(`.sledge__product-grid-card-selected-option[data-product-id='${I}']`);o.attributes[`data-selected-option${s}`].value=t;const r=`[data-option-1="${o.attributes["data-selected-option1"].value}"]`,l=""+(o.attributes["data-selected-option2"]?`[data-option-2="${o.attributes["data-selected-option2"].value}"]`:""),a=n.querySelector(`select option${r}${l}`),d=a.attributes["data-graphql-id"].value,c=null==(i=a.attributes["data-image-id"])?void 0:i.value;o.attributes["data-variant-id"].value=a.attributes["data-graphql-id"].value,d&&H(d),c&&(n.querySelector("img.sledge__product-grid-card-image-featured-image").src=n.querySelector(`div.sledge__product-grid-card-variant-images img[id="${c}"]`).src);return{variantId:d,imageId:c}};const i=(null==C?void 0:C.options)?Object.entries(C.options):[],n=(null==C?void 0:C.images)??[],r={};e(),Y=jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image",children:[jsxRuntimeExports.jsxs("a",{href:y,onClick:()=>"instant-search"===c&&productClickTrigger({productId:I}),children:[jsxRuntimeExports.jsx(Trigger,{params:{productId:I,productVariantId:$,productName:N,productVendor:b,productSku:M,productVariantName:W,productLink:y,productImage:(null==O?void 0:O.src)||`${API_URL}/img/blank-image.png`,productCurrency:D,productPrice:k},...d,onAfterAddWishlist:p,onAfterRemoveWishlist:m,wishlistChecked:null==E?void 0:E[I]}),jsxRuntimeExports.jsx("img",{src:(null==O?void 0:O.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy",className:"sledge__product-grid-card-image-featured-image"}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-variant-images",children:null==n?void 0:n.map((e=>jsxRuntimeExports.jsx("img",{decoding:"async",id:null==e?void 0:e.id,height:"270",loading:"lazy",src:null==e?void 0:e.src,alt:null==C?void 0:C.title,width:269.92,style:{aspectRatio:269.92/270}},null==e?void 0:e.id)))})]}),V?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-out-of-stock",children:"Sold out"}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[v?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:jsxRuntimeExports.jsxs("p",{style:A,children:[D,k]})}):null,h&&b?jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-badge-vendor",title:b,children:["Vendor: ",b]}):null]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(Rating,{params:{productId:I},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1,data:null==R?void 0:R[I]})}),N?jsxRuntimeExports.jsx("a",{href:y,onClick:()=>"instant-search"===c&&productClickTrigger({productId:I}),children:jsxRuntimeExports.jsx("h3",{className:"sledge__product-grid-card-product-name",style:S,children:N})}):null,jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:j&&M?jsxRuntimeExports.jsxs("div",{children:["SKU: ",M]}):null}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-variant-swatch",children:[jsxRuntimeExports.jsx("input",{type:"hidden",...r,className:"sledge__product-grid-card-selected-option"}),jsxRuntimeExports.jsx("select",{className:"variant-picker sledge__product-grid-card-variant-picker",children:null==L?void 0:L.map((e=>{const{title:t,option1:s,option2:i,position:n,id:o,admin_graphql_api_id:r,image_id:l}=e;let a={"data-option-1":s,"data-option-2":i,"data-position":n,"data-id":o,"data-graphql-id":r,"data-image-id":l};return jsxRuntimeExports.jsx("option",{...a,children:t},o)}))}),null==i?void 0:i.map(((e,i)=>{const n=e[0],o=e[1];let r=o[0];return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"Default Title"!==o[0]&&jsxRuntimeExports.jsx("div",{className:`sledge__product-variant-size-swatch-flex options-button-${n}`,children:o.map(((e,o)=>{const l=`\n${r===e?"sledge__product-variant-size-swatch-active":""} sledge__product-variant-size-swatch`,a=(r===e?"sledge__product-variant-color-swatch-active":"")+" sledge__product-variant-color-swatch";return jsxRuntimeExports.jsx("button",{type:"button",className:"Color"===n?a:l,style:{backgroundColor:"Color"===n?e:null},onClick:o=>{s(o,e,i+1),t(o,n)},title:"Color"===n?null:e,children:"Color"===n?null:e},o)}))},i)})}))]})]})]}),T?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",style:{...f,...G&&{cursor:"wait"}},...G||V?{disabled:!0}:{onClick:()=>{o&&o({id:B,quantity:1})}},children:V?"Sold out":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[G?jsxRuntimeExports.jsx(LoadingDots,{}):null,jsxRuntimeExports.jsx("span",{children:w||"Add To Cart"})]})})}):null]})}return jsxRuntimeExports.jsx(React.Fragment,{children:Y},I)},ProductGrid=e=>{const{type:t,className:s="",data:i,setting:n,sourceApp:o=null,onAfterAddToCart:r,onAfterRenderProduct:l}=e,{redirect_add_to_cart:a=!0}=n||{},[d,c]=React.useState(null),u=async e=>{var t;const{id:s,quantity:i}=e;c(s);let n=await addToCart([{id:s,quantity:i}]);(null==(t=null==n?void 0:n.items)?void 0:t.length)?("wishlist"===o?await addToCartTrigger({productId:s}):"instant-search"===o&&await addToCartTrigger$1({productId:s}),c(null),r&&r("success"),a?window.location.href="/cart":window.sledgeToastNotification({title:"Cart added",message:"Successfully added to wishlist",type:"success",icon:jsxRuntimeExports.jsx(BagIcon,{width:40,height:40,color:"black"})})):(r&&r("failed"),setTimeout((()=>{var e;c(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:(null==(e=null==n?void 0:n.description)?void 0:e.length)?n.description:"failed add to cart, please try again",type:"failed",icon:jsxRuntimeExports.jsx(BagIcon,{width:40,height:40,color:"black"})})}),1e3))};return React.useEffect((()=>{l&&l("success")}),[]),jsxRuntimeExports.jsx("div",{className:`sledge__product-grid ${s}`,"data-grid-type":t,children:null==i?void 0:i.map(((t,s)=>jsxRuntimeExports.jsx(ProductCard,{item:t,handleAddToCart:u,clickedAddToCartId:d,...e},`sledge-product-card_${s}`)))})},TextAreaField$1="",TextAreaField=e=>{const{className:t="",value:s="",onChange:i,required:n,...o}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__text-area-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField FormTextArea",name:"review",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__text-area-field-control",children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("textarea",{className:"sledge__text-area-field",value:s,onChange:e=>(e=>{i&&i(e)})(e),rows:6,maxLength:1e3,required:n,...o})}),jsxRuntimeExports.jsxs("div",{className:"sledge__text-area-field-counter",children:[null==s?void 0:s.length,"/",1e3]})]}),n&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"valueMissing",children:"Required field"})]})})},InputField$1="",InputField=e=>{const{className:t="",value:s="",onChange:i,required:n,type:o,name:r="",...l}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__input-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField",name:r,children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("input",{className:"sledge__input-field",type:o,value:s,onChange:e=>(e=>{i&&i(e)})(e),...n?{required:n}:{},...l})}),n&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"valueMissing",children:"Required field"}),"email"===o&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"typeMismatch",children:"Please fill a valid email address"})]})})},CollectionGrid$1="",CollectionGrid=({className:e="",data:t,cards:s,isComponentJsVersion:i,onAfterRenderCollection:n})=>(React.useEffect((()=>{n&&n("success")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?jsxRuntimeExports.jsx("div",{className:`sledge__collection-grid ${e}`,children:t.map(((e,t)=>{const{id:n,title:o,body_html:r,url:l,image:a}=e;if(s){const n={data:e};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s({...n})}}):jsxRuntimeExports.jsx(s,{...n})},t)}return jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image-wrapper",children:jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:(null==a?void 0:a.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:o}),r?jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",dangerouslySetInnerHTML:{__html:r}}):null]})]})},t)}))}):null})),PageGrid$1="",PageGrid=({className:e="",data:t,cards:s,isComponentJsVersion:i,onAfterRenderPage:n})=>(React.useEffect((()=>{n&&n("success")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?jsxRuntimeExports.jsx("div",{className:`sledge__page-grid ${e}`,children:t.map(((e,t)=>{const{id:n,title:o,body_html:r,url:l,image:a}=e;if(s){const n={data:e};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s({...n})}}):jsxRuntimeExports.jsx(s,{...n})},t)}return jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image-wrapper",children:jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:(null==a?void 0:a.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:o}),r?jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",dangerouslySetInnerHTML:{__html:r}}):null]})]})},t)}))}):null})),BlogGrid$1="",BlogGrid=({className:e="",data:t,cards:s,isComponentJsVersion:i,onAfterRenderBlog:n})=>(React.useEffect((()=>{n&&n("success")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?jsxRuntimeExports.jsx("div",{className:`sledge__blog-grid ${e}`,children:null==t?void 0:t.map(((e,t)=>{const{id:n,title:o,created_at:r,url:l,image:a}=e;if(s){const n={data:e};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s({...n})}}):jsxRuntimeExports.jsx(s,{...n})},t)}return jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image",children:jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsx("img",{src:(null==a?void 0:a.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-title",children:o})}),r?jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-badge-vendor",children:convertDate(r)}):null]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"light",children:[jsxRuntimeExports.jsx(NoteIcon,{width:16,height:16,color:"#000000"}),jsxRuntimeExports.jsx("span",{children:"View Blog"})]})})})]},t)}))}):null})),ArticleGrid$1="",ArticleGrid=({className:e="",data:t,cards:s,isComponentJsVersion:i,onAfterRenderArticle:n})=>(React.useEffect((()=>{n&&n("success")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?jsxRuntimeExports.jsx("div",{className:`sledge__article-grid ${e}`,children:null==t?void 0:t.map(((e,t)=>{const{id:n,title:o,created_at:r,summary_html:l,url:a,image:d}=e;if(s){const n={data:e};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s({...n})}}):jsxRuntimeExports.jsx(s,{...n})},t)}return jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-image",children:jsxRuntimeExports.jsx("a",{href:a,children:jsxRuntimeExports.jsx("img",{src:(null==d?void 0:d.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card-desc",children:[jsxRuntimeExports.jsx("a",{href:a,children:jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-title",children:o})}),r?jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-badge-vendor",children:convertDate(r)}):null,l?jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-text",dangerouslySetInnerHTML:{__html:l}}):null]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-button-wrapper",children:jsxRuntimeExports.jsx("a",{href:a,children:jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"light",children:[jsxRuntimeExports.jsx(NoteIcon,{width:16,height:16,color:"#000000"}),jsxRuntimeExports.jsx("span",{children:"View Article"})]})})})]},t)}))}):null})),Tooltip$1="",Tooltip=({children:e,content:t,withArrow:s=!0,customArrow:i="",sideOffset:n=5,alignOffset:o=0,wrapTrigger:r=!0})=>{const[l,a]=React.useState(!1);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".sledge__tooltip-arrow"))?void 0:e.parentElement;t&&(null==i?void 0:i.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=i)}),[l]),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:a,children:[jsxRuntimeExports.jsx($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:r?jsxRuntimeExports.jsx("span",{children:e}):e}),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:n,alignOffset:o,children:[t,s?jsxRuntimeExports.jsx($a093c7e1ec25a057$export$21b07c8f274aebd5,{className:"sledge__tooltip-arrow"}):null]})})]})})},ScrollArea$1="",ScrollArea=({children:e,isLoading:t=!1,className:s=""})=>jsxRuntimeExports.jsxs($57acba87d6e25586$export$be92b6f5f03c0fe9,{className:`sledge__scroll-area-root ${s}`,children:[jsxRuntimeExports.jsx($57acba87d6e25586$export$d5c6c08dc2d3ca7,{className:"sledge__scroll-area-viewport "+(t?"sledge__scroll-area-viewport-loading":""),children:e}),!t&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx($57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"vertical",children:jsxRuntimeExports.jsx($57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})}),jsxRuntimeExports.jsx($57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"horizontal",children:jsxRuntimeExports.jsx($57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})})]})]}),SkeletonLoading$1="",SkeletonItem=({width:e,height:t,rounded:s,color:i,style:n={},className:o="",...r})=>{var l,a,d,c,u;const[x,p]=React.useState({});return React.useEffect((()=>{(async e=>{let t;t=JSON.parse(e),t&&p(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING)||null)}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==(l=null==x?void 0:x.skeleton)?void 0:l.enable)?jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item sledge__skeleton-item-animation ${o}`,style:{width:e,height:t,...(null==(d=null==(a=null==x?void 0:x.skeleton)?void 0:a.colors)?void 0:d.main_color)&&{background:null==(u=null==(c=null==x?void 0:x.skeleton)?void 0:c.colors)?void 0:u.main_color},...n},"data-skeleton-rounded":s,"data-skeleton-color":i,...r}):null})},SkeletonProductGrid=({count:e,type:t})=>{let s=[];for(let i=0;i<e;i++)s.push(jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image sledge__skeleton-product-grid-card-image",children:[jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"32px",height:"32px",color:"darken",rounded:"sm"})}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"28px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonItem,{width:"80px",height:"28px",color:"lighten",rounded:"md"})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"134px",height:"25px",color:"lighten",rounded:"md"})}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"35px",color:"lighten",rounded:"md",style:{marginBottom:"16px"}})})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},i));return jsxRuntimeExports.jsx("div",{className:"sledge__product-grid sledge__skeleton-product-grid sledge__skeleton-pointer-events-none","data-grid-type":t,children:s})},SkeletonReviewGrid=({count:e,type:t,gridItemHeights:s=[]})=>{let i=[];for(let n=0;n<e;n++)i.push(jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"list"===t||"grid"===t&&!(null==s?void 0:s.length)?"111px":s[n],color:"lighten",rounded:"md"})},n));return jsxRuntimeExports.jsx(MasonryResponsive,{columnsCountBreakPoints:"grid"===t?{350:1,750:3,1024:4}:{350:1},className:"sledge-product-review__widget-review-grid sledge__skeleton-review-grid sledge__skeleton-pointer-events-none",children:jsxRuntimeExports.jsx(Masonry,{gutter:"30px",children:i})})},SkeletonCollectionGrid=({count:e})=>{let t=[];for(let s=0;s<e;s++)t.push(jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card",children:jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"139px",height:"32px",color:"darken",rounded:"md"})}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"238px",height:"48px",color:"darken",rounded:"md"})})]})},s));return jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid sledge__skeleton-collection-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonPageGrid=({count:e})=>{let t=[];for(let s=0;s<e;s++)t.push(jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card",children:jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"139px",height:"32px",color:"darken",rounded:"md"})}),jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"238px",height:"48px",color:"darken",rounded:"md"})})]})},s));return jsxRuntimeExports.jsx("div",{className:"sledge__page-grid sledge__skeleton-page-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonBlogGrid=({count:e})=>{let t=[];for(let s=0;s<e;s++)t.push(jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image sledge__skeleton-blog-grid-card-image",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"26px",color:"lighten",rounded:"md",style:{marginTop:"12px",marginBottom:"16px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"72px",color:"lighten",rounded:"md"})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},s));return jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonArticleGrid=({count:e})=>{let t=[];for(let s=0;s<e;s++)t.push(jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-image sledge__skeleton-article-grid-card-image",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})}),jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card-desc",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"26px",color:"lighten",rounded:"md",style:{marginTop:"12px",marginBottom:"16px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"72px",color:"lighten",rounded:"md"})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},s));return jsxRuntimeExports.jsx("div",{className:"sledge__article-grid sledge__skeleton-article-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonLoading={Item:SkeletonItem,ReviewGrid:SkeletonReviewGrid,ProductGrid:SkeletonProductGrid,CollectionGrid:SkeletonCollectionGrid,PageGrid:SkeletonPageGrid,BlogGrid:SkeletonBlogGrid,ArticleGrid:SkeletonArticleGrid},LoadingDots$1="",LoadingDots=()=>jsxRuntimeExports.jsxs("div",{className:"sledge__loading-dots",children:[jsxRuntimeExports.jsx("div",{className:"sledge__loading-icon-dot"}),jsxRuntimeExports.jsx("div",{className:"sledge__loading-icon-dot"}),jsxRuntimeExports.jsx("div",{className:"sledge__loading-icon-dot"})]});let countFetchToken=3,runApps=!1;const consoleErrorStyle="color: white; background: black; border: 1px solid white; padding: 2px 5px; border-radius: 360px;";documentReady((async()=>{var e,t,s;"undefined"!=typeof window&&(window.sledgeCommonModule={addToCartTrigger:async({sourceApp:e,productId:t})=>{var s;let i={};return"wishlist"===e?i=await addToCartTrigger({productId:t}):"instant-search"===e&&(i=await addToCartTrigger$1({productId:t})),200===(null==(s=null==i?void 0:i.status)?void 0:s.code)},productClickTrigger:async({sourceApp:e,productId:t})=>{var s;let i={};return"instant-search"===e&&(i=await productClickTrigger({productId:t})),200===(null==(s=null==i?void 0:i.status)?void 0:s.code)}});let i=document.querySelector(`script[id="${SCRIPT_EMBED_ID}"]`);const n=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.API_KEY),o=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.INSTANT_SEARCH_API_KEY),r=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_ID),l=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_EMAIL),a=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_FULLNAME);let d=await getToken({API_KEY:n||"",INSTANT_SEARCH_API_KEY:o||"",USER_ID:r||"",USER_EMAIL:l||"",USER_FULLNAME:a||""});for(let c=1;c<=countFetchToken;c++)if(runApps||(null==(e=null==d?void 0:d.data)?void 0:e.token))runApps=!0;else{if(console.error("%cSledge",consoleErrorStyle,`${(null==(t=null==d?void 0:d.status)?void 0:t.code)?null==(s=null==d?void 0:d.status)?void 0:s.message:d}`),c===countFetchToken)return;localStorage.removeItem(LOCAL_STORAGE_KEY.AUTH_APP),d=await getToken({API_KEY:n||"",INSTANT_SEARCH_API_KEY:o||"",USER_ID:r||"",USER_EMAIL:l||"",USER_FULLNAME:a||""})}runApps&&(ConfirmationPopupInitSelector(),InfoPopupInitSelector(),ToastNotificationInitSelector(),getSettings().then((e=>{var t,s,i,n,o,r,l,a,d;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?((null==(s=null==e?void 0:e.data)?void 0:s.general)&&localStorage.setItem(LOCAL_STORAGE_KEY.GENERAL_SETTING,JSON.stringify(null==(i=null==e?void 0:e.data)?void 0:i.general)),(null==(n=null==e?void 0:e.data)?void 0:n.wishlist)&&(localStorage.setItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING,JSON.stringify(null==(o=null==e?void 0:e.data)?void 0:o.wishlist)),WishlistInitSelector()),(null==(r=null==e?void 0:e.data)?void 0:r.review)&&(localStorage.setItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING,JSON.stringify(null==(l=null==e?void 0:e.data)?void 0:l.review)),ProductReviewInitSelector()),(null==(a=null==e?void 0:e.data)?void 0:a.instantsearch)&&(localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING,JSON.stringify(null==(d=null==e?void 0:e.data)?void 0:d.instantsearch)),InstantSearchInitSelector())):console.error("%cSledge",consoleErrorStyle,"Error app settings")})))}));
|
|
1
|
+
import{R as React,r as reactExports,C as CryptoES,j as jsxRuntimeExports,$ as $905f4ae918aab1aa$export$be92b6f5f03c0fe9,a as $905f4ae918aab1aa$export$602eac185826482c,b as $905f4ae918aab1aa$export$c6fdb837b070b4ff,c as $905f4ae918aab1aa$export$7c6e2c02157bb7d2,d as $905f4ae918aab1aa$export$f99233281efd08a0,e as $905f4ae918aab1aa$export$393edc798c47379d,f as $905f4ae918aab1aa$export$848c9b7ead0df967,g as $905f4ae918aab1aa$export$e19cd5f9376f8cee,h as client,i as $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,k as $5d3850c4d0b4e6c7$export$602eac185826482c,l as $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,m as $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,n as $5d3850c4d0b4e6c7$export$f99233281efd08a0,o as $5d3850c4d0b4e6c7$export$393edc798c47379d,p as $054eb8030ebde76e$export$2881499e37b75b9a,q as $054eb8030ebde76e$export$be92b6f5f03c0fe9,s as $054eb8030ebde76e$export$f99233281efd08a0,t as $054eb8030ebde76e$export$393edc798c47379d,u as $054eb8030ebde76e$export$e19cd5f9376f8cee,v as $054eb8030ebde76e$export$d5c6c08dc2d3ca7,w as $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,x as $cb5cc270b50c6fcd$export$41fb9f06171c75f4,y as $cb5cc270b50c6fcd$export$602eac185826482c,z as $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,A as $cb5cc270b50c6fcd$export$f39c2d165cd861fe,B as $cb5cc270b50c6fcd$export$21b07c8f274aebd5,D as $67824d98245208a0$export$be92b6f5f03c0fe9,E as $67824d98245208a0$export$adb584737d712b70,F as $e698a72e93240346$export$be92b6f5f03c0fe9,G as $e698a72e93240346$export$adb584737d712b70,H as $faa2e61a3361514f$export$be92b6f5f03c0fe9,I as $faa2e61a3361514f$export$13921ac0cc260818,J as $faa2e61a3361514f$export$9a58ef0d7ad3278c,K as $faa2e61a3361514f$export$6521433ed15a34db,L as $f99a8c78507165f7$export$be92b6f5f03c0fe9,M as $f99a8c78507165f7$export$6d08773d2e66f8f2,N as $f99a8c78507165f7$export$adb584737d712b70,O as $cc7e05a45900e73f$export$6d08773d2e66f8f2,P as $cc7e05a45900e73f$export$d6e5bf9c43ea9319,Q as $cc7e05a45900e73f$export$c3468e2714d175fa,S as $cc7e05a45900e73f$export$be92b6f5f03c0fe9,T as $cc7e05a45900e73f$export$41fb9f06171c75f4,U as $cc7e05a45900e73f$export$4c8d1a57a761ef94,V as $cc7e05a45900e73f$export$f04a61298a47a40f,W as $cc7e05a45900e73f$export$602eac185826482c,X as $cc7e05a45900e73f$export$7c6e2c02157bb7d2,Y as $cc7e05a45900e73f$export$2f60d3ec9ad468f2,Z as $cc7e05a45900e73f$export$d5c6c08dc2d3ca7,_ as $cc7e05a45900e73f$export$bf1aedc3039c8d63,a0 as motion,a1 as MasonryResponsive,a2 as Masonry,a3 as $d94698215c4408a7$export$be92b6f5f03c0fe9,a4 as $d94698215c4408a7$export$2c4cf1f7b42ef78c,a5 as $d94698215c4408a7$export$a455218a85c89869,a6 as $d94698215c4408a7$export$7a7fa4424cb20976,a7 as $d94698215c4408a7$export$f69c19e57285b83a,a8 as $a093c7e1ec25a057$export$2881499e37b75b9a,a9 as $a093c7e1ec25a057$export$be92b6f5f03c0fe9,aa as $a093c7e1ec25a057$export$41fb9f06171c75f4,ab as $a093c7e1ec25a057$export$602eac185826482c,ac as $a093c7e1ec25a057$export$7c6e2c02157bb7d2,ad as $a093c7e1ec25a057$export$21b07c8f274aebd5,ae as $57acba87d6e25586$export$be92b6f5f03c0fe9,af as $57acba87d6e25586$export$d5c6c08dc2d3ca7,ag as $57acba87d6e25586$export$9a4e88b92edfce6b,ah as $57acba87d6e25586$export$6521433ed15a34db}from"./assets/vendor-eabe6dd2.js";const root="",API_URL="https://api.sledge-app.com",INSTANT_SEARCH_ENGINE_URL="https://instant-search-engine.sledge-app.com",SCRIPT_EMBED_ID="sledge-embed-script",SELECTOR_ATTRIBUTE_KEY="data-component",DATASET_ATTRIBUTE_KEY={GLOBAL:{ON_AFTER_ADD_WISHLIST:"data-on-after-add-wishlist",ON_AFTER_REMOVE_WISHLIST:"data-on-after-remove-wishlist",ON_AFTER_ADD_TO_CART:"data-on-after-add-to-cart",ON_AFTER_ADD_REVIEW:"data-on-after-add-review",ON_AFTER_RENDER_PRODUCT:"data-on-after-render-product",PRODUCT_ID:"data-product-id",PRODUCT_VARIANT_ID:"data-product-variant-id",PRODUCT_NAME:"data-product-name",PRODUCT_VENDOR:"data-product-vendor",PRODUCT_SKU:"data-product-sku",PRODUCT_VARIANT_NAME:"data-product-variant-name",PRODUCT_LINK:"data-product-link",PRODUCT_IMAGE:"data-product-image",PRODUCT_CURRENCY:"data-product-currency",PRODUCT_PRICE:"data-product-price",USER_ID:"data-user-id",USER_EMAIL:"data-user-email",USER_FULLNAME:"data-user-fullname",COLLECTION_ID:"data-collection-id",WIDTH_ELEMENT:"data-width-element",ICON_SIZE:"data-icon-size",API_KEY:"data-api-key",INSTANT_SEARCH_API_KEY:"data-instant-search-api-key",RENDER_PRODUCT_CARD:"data-render-product-card",WITH_SKELETON_LOADING:"data-with-skeleton-loading"},WISHLIST:{SHARE_ID:"data-share-id",QUERY_SHARE_ID:"data-query-share-id",CUSTOM_ROUTE_PAGE:"data-custom-route-page",RENDER_WISHLIST_WIDGET_ALERT:"data-render-wishlist-widget-alert",USE_PROXY_URL:"data-use-proxy-url",LIMIT_OPTIONS:"data-limit-options"},PRODUCT_REVIEW:{RATING_SIZE:"data-rating-size",RATING_TOTAL:"data-rating-total",RATING_AVERAGE:"data-rating-average"},INSTANT_SEARCH:{ON_AFTER_RENDER_COLLECTION:"data-on-after-render-collection",ON_AFTER_RENDER_PAGE:"data-on-after-render-page",ON_AFTER_RENDER_BLOG:"data-on-after-render-blog",ON_AFTER_RENDER_ARTICLE:"data-on-after-render-article",QUERY_KEYWORD:"data-query-keyword",RENDER_SUGGESTION_KEYWORD_LIST:"data-render-suggestion-keyword-list",RENDER_OTHER_INDEX_LIST:"data-render-other-index-list",RENDER_SEARCH_VIEW_MORE_RESULT:"data-render-search-view-more-result",RENDER_COLLECTION_CARD:"data-render-collection-card",RENDER_PAGE_CARD:"data-render-page-card",RENDER_BLOG_CARD:"data-render-blog-card",RENDER_ARTICLE_CARD:"data-render-article-card"}},LOCAL_STORAGE_KEY={ANONYM_ID:"sledge-anonym-id",AUTH_APP:"sledge-auth-app",AUTH_APP_VERIFY:"sledge-auth-app-verify",INSTANT_SEARCH_AUTH_APP:"sledge-instant-search-auth-app",GENERAL_SETTING:"sledge-general-setting",WISHLIST_SETTING:"sledge-wishlist-setting",PRODUCT_REVIEW_SETTING:"sledge-product-review-setting",INSTANT_SEARCH_SETTING:"sledge-instant-search-setting",ISSUED_AUTH_APP:"sledge-issued-auth-app",EXPIRED_AUTH_APP:"sledge-expired-auth-app"},INTERNAL_SELECTOR_VALUE={ELEMENT_TOAST_NOTIFICATION:"toast-notification",ELEMENT_CONFIRMATION_POPUP:"confirmation-popup",ELEMENT_INFO_POPUP:"info-popup",ELEMENT_CONTAINER_WIDGET:"container-widget",WISHLIST:{ELEMENT_BADGE_FLOATING_ICON:"wishlist-badge-floating-icon",ELEMENT_BADGE_FLOATING_FULL:"wishlist-badge-floating-full",ELEMENT_WIDGET_POPUP:"wishlist-widget-popup"},PRODUCT_REVIEW:{ELEMENT_WIDGET_POPUP_DETAIL:"product-review-widget-popup-detail",ELEMENT_WIDGET_FORM_ADD:"product-review-widget-form-add"},INSTANT_SEARCH:{ELEMENT_SEARCH_ICON_WIDGET_POPUP:"instant-search-icon-widget-popup"}},SELECTOR={GLOBAL:{ELEMENT_CUSTOM_COMPONENTS:`[${SELECTOR_ATTRIBUTE_KEY}="custom-components"]`},WISHLIST:{ELEMENT_BADGE:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-badge"]`,ELEMENT_BADGE_MENU_ITEM:'[href="#sledge-wishlist-badge-menu-item"]',ELEMENT_TRIGGER:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-trigger"]`,ELEMENT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-widget"]`,ELEMENT_BUTTON_DETAIL:`[${SELECTOR_ATTRIBUTE_KEY}="wishlist-button-detail"]`},PRODUCT_REVIEW:{ELEMENT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="product-review-widget"]`,ELEMENT_RATING:`[${SELECTOR_ATTRIBUTE_KEY}="product-review-rating"]`},INSTANT_SEARCH:{ELEMENT_SEARCH_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-widget"]`,ELEMENT_SEARCH_ICON_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-icon-widget"]`,ELEMENT_SEARCH_RESULT_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-result-widget"]`,ELEMENT_PLP_WIDGET:`[${SELECTOR_ATTRIBUTE_KEY}="instant-search-product-filter-widget"]`}},DEFAULT_LIMIT_VALUE=[12,24,36,48,120],SEARCH_RESULT_URL="/pages/search-result",OBJECT_DATA_STRING_KEY={STORE:{NAME:"{{ shop.name }}"}},ELEMENT_ID={PRODUCT_REVIEW:{ELEMENT_WIDGET:"product-review-widget"}},SHOPIFY_GID="gid://shopify/",SHOPIFY_GID_PRODUCT_ID=`${SHOPIFY_GID}Product/`,PAYLOAD_API_ALIASES={Authorization:"zbNTHXQpW7OmI",Method:"Gba2Tb9Ys7JGu",GET:"JniUtw5dNfeKW",POST:"a9Dmw0qP9hvQE",PUT:"dEnOjbvTzULLK",DELETE:"pLC93Tvsu6g7H"},AES_SECRET_KEY="5l3ge1nt36124ti0n";async function swr(e,t){if("undefined"!=typeof localStorage&&"undefined"!=typeof caches&&"GET"===t.method){const t=await getData(e);return await t.json()}return fetch(e,t).then((e=>e.json()))}async function getData(e){return caches.open("sledge-1").then((t=>t.match(e).then((s=>{const i=fetch(e).then((async s=>{const i=e.split("?")[0],n=await t.matchAll(),o=await n.filter((t=>t.url.includes(i)&&t.url!==e));for(const e of o)await t.delete(e.url);return t.put(e,s.clone()),s}));return s||i}))))}const usePrevious=e=>{const t=React.useRef();return React.useEffect((()=>{t.current=e})),t.current};function useMediaQuery(e){const t=e=>"undefined"!=typeof window&&window.matchMedia(e).matches,[s,i]=reactExports.useState(t(e));function n(){i(t(e))}return reactExports.useEffect((()=>{const t=window.matchMedia(e);return n(),t.addListener?t.addListener(n):t.addEventListener("change",n),()=>{t.removeListener?t.removeListener(n):t.removeEventListener("change",n)}}),[e]),s}const sanitizeDataId=e=>{if(!e)return"";let t=String(e);if(t.includes("shopify")&&t.includes("/")){let e=t.split("/");return e[e.length-1]||t}return t},documentReady=e=>{document.addEventListener("DOMContentLoaded",e)},getTextBetween=e=>{const{start:t,end:s,text:i}=e;if(t&&i.includes(t)&&s&&i.includes(s)){let e=i.indexOf(t)+t.length;return i.substring(e,i.indexOf(s,e))}return i},isFunction=e=>"function"==typeof e,scrollToElement=e=>{const{element:t,headerOffset:s}=e;if(t){var i=(null==t?void 0:t.getBoundingClientRect().top)+window.scrollY-s;window.scrollTo({top:i,behavior:"smooth"})}},getUnixTimestamp=e=>{const{addMoreTime:t=0,addMoreTimeBy:s="day"}=e||{};let i=0;return t&&("day"===s&&(i=60*t*60*24),"hour"===s&&(i=60*t*60),"minute"===s&&(i=60*t),"second"===s&&(i=t)),Math.floor(Date.now()/1e3)+i},fetchApi=async e=>{const{url:t,method:s,authorization:i="",payload:n={},headers:o={},isSimpleRequest:r=!0,isUploadFile:l=!1}=e;var a=new Headers;r||(i&&a.append("Authorization",`Bearer ${i}`),Object.keys(o).length&&Object.keys(o).forEach((function(e){a.append(e,o[e])})));var d=new FormData;(r||l)&&(i&&r&&d.append(PAYLOAD_API_ALIASES.Authorization,i),d.append(PAYLOAD_API_ALIASES.Method,PAYLOAD_API_ALIASES[s]),Object.keys(n).length&&Object.keys(n).forEach((function(e){l&&(null==n?void 0:n.files)&&[...n.files].map((e=>{d.append("files",e,e.name)})),d.append(e,n[e])})));const c=r?"POST":s;var u={method:c,redirect:"follow",headers:a,body:"GET"===c?null:r||l?d:JSON.stringify(n)};return await swr(`${t}`,u)},convertDate=(e,t={timeZone:"Asia/Jakarta",year:"numeric",month:"numeric",day:"numeric"})=>new Date(e).toLocaleString("en-US",t),currentMediaQuery=()=>{let e="xs";return useMediaQuery("(min-width: 425px)")&&(e="sm"),useMediaQuery("(min-width: 768px)")&&(e="md"),useMediaQuery("(min-width: 1024px)")&&(e="lg"),useMediaQuery("(min-width: 1280px)")&&(e="xs"),e},encryptText=e=>CryptoES.AES.encrypt(e,AES_SECRET_KEY).toString(),decryptText=e=>CryptoES.AES.decrypt(e,AES_SECRET_KEY).toString(CryptoES.enc.Utf8),getSettings=async e=>{let t=e||("undefined"!=typeof localStorage?localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP):""),s=`${API_URL}/app/settings?${PAYLOAD_API_ALIASES.Authorization}=${t}`;return await fetchApi({url:s,method:"GET",authorization:t,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getToken=async e=>{const{API_KEY:t,INSTANT_SEARCH_API_KEY:s,USER_ID:i,USER_EMAIL:n,USER_FULLNAME:o,ANONYM_ID:r}=e;let l="",a="",d="",c=0;"undefined"!=typeof localStorage&&(l=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",a=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP_VERIFY)||"",d=localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",c=Number(localStorage.getItem(LOCAL_STORAGE_KEY.EXPIRED_AUTH_APP)));let u=Boolean(String(d.toLowerCase()).includes("anonymous")&&i),x=Boolean(!String(d.toLowerCase()).includes("anonymous")&&!i),p=getUnixTimestamp()<=c,m=!!a&&Boolean(decryptText(a)===t);if(l&&p&&!u&&!x&&m)return{data:{token:l}};let g=`${API_URL}/app/token`,_={user:JSON.stringify({id:i||"",email:n||"",name:o||"",anonym:r||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"")})};return await fetchApi({url:g,method:"POST",authorization:t||"",payload:_}).then((e=>{const{data:i}=e||{},{anonym:n,token:o,iat:r,exp:l}=i||{};return"undefined"!=typeof localStorage&&(localStorage.setItem(LOCAL_STORAGE_KEY.ANONYM_ID,n||""),localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP,o||""),localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP_VERIFY,encryptText(t||"")||""),localStorage.setItem(LOCAL_STORAGE_KEY.ISSUED_AUTH_APP,r||""),localStorage.setItem(LOCAL_STORAGE_KEY.EXPIRED_AUTH_APP,l||""),localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP,s||"")),e})).catch((e=>e))},Loading="",ConfirmationPopup$1="",ConfirmationPopup=()=>{const[e,t]=React.useState(""),[s,i]=React.useState(""),[n,o]=React.useState(null),[r,l]=React.useState(null),[a,d]=React.useState(""),[c,u]=React.useState(!1),[x,p]=React.useState({onSubmit:()=>{}});return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeConfirmationPopup=({title:e,message:s,textSubmit:n,textCancel:r,buttonSubmitType:a,onSubmit:c})=>{u(!0),t(e),i(s),o(n),l(r),d(a),p({onSubmit:c})})}),[]),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$be92b6f5f03c0fe9,{open:c,onOpenChange:u,children:jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($905f4ae918aab1aa$export$c6fdb837b070b4ff,{className:"sledge__alert-dialog-overlay"}),jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$7c6e2c02157bb7d2,{className:"sledge__alert-dialog-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__alert-dialog-content-close",onClick:()=>u(!1),children:jsxRuntimeExports.jsx(CloseIcon,{width:17,height:17,color:"#77757e"})}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$f99233281efd08a0,{className:"sledge__alert-dialog-title",dangerouslySetInnerHTML:{__html:e}}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$393edc798c47379d,{className:"sledge__alert-dialog-description",dangerouslySetInnerHTML:{__html:s}}),jsxRuntimeExports.jsxs("div",{className:"sledge__alert-dialog-footer",children:[jsxRuntimeExports.jsx($905f4ae918aab1aa$export$848c9b7ead0df967,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{role:"button",className:"sledge__alert-dialog-button-cancel",onClick:()=>u(!1),children:r})}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$e19cd5f9376f8cee,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{role:"button",colorType:a,className:"sledge__alert-dialog-button",onClick:()=>{x.onSubmit(),u(!1)},children:n})})]})]})]})})},ConfirmationPopupInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONFIRMATION_POPUP}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONFIRMATION_POPUP),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(ConfirmationPopup,{})})))},InfoPopup$1="",InfoPopup=()=>{const[e,t]=React.useState(""),[s,i]=React.useState(""),[n,o]=React.useState(""),[r,l]=React.useState(!1);return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInfoPopup=({title:e,message:s,textCancel:n})=>{l(!0),t(e),i(s),o(n)})}),[]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:r,onOpenChange:l,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__dialog-overlay"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge__dialog-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__alert-dialog-content-close",onClick:()=>l(!1),children:jsxRuntimeExports.jsx(CloseIcon,{width:17,height:17,color:"#77757e"})}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0,{className:"sledge__dialog-title",dangerouslySetInnerHTML:{__html:e}}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$393edc798c47379d,{className:"sledge__dialog-description",dangerouslySetInnerHTML:{__html:s}}),jsxRuntimeExports.jsx("div",{className:"sledge__dialog-close-button",children:jsxRuntimeExports.jsx("button",{className:"sledge__dialog-button sledge__dialog-button-cancel",onClick:()=>l(!1),children:n})})]})]})})},InfoPopupInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_INFO_POPUP}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_INFO_POPUP),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(InfoPopup,{})})))},ToastNotification$1="",ToastNotification=()=>{const[e,t]=React.useState(!1),[s,i]=React.useState(""),[n,o]=React.useState(""),[r,l]=React.useState(""),[a,d]=React.useState(null),[c,u]=React.useState(""),x=React.useRef(0);return React.useEffect((()=>("undefined"!=typeof window&&(window.sledgeToastNotification=({title:e,message:s,location:n="bottom-right",icon:r=null,type:a})=>{i(e),o(s),l(n),d(r),u(a),t(!1),window.clearTimeout(x.current),x.current=window.setTimeout((()=>{t(!0)}),10)}),()=>clearTimeout(x.current))),[]),jsxRuntimeExports.jsxs($054eb8030ebde76e$export$2881499e37b75b9a,{children:[jsxRuntimeExports.jsxs($054eb8030ebde76e$export$be92b6f5f03c0fe9,{className:"sledge__toast-root",open:e,onOpenChange:t,children:[jsxRuntimeExports.jsxs("div",{className:"sledge__toast-icon-wrapper",children:[a?"string"==typeof a?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:a}}):a:null,jsxRuntimeExports.jsx("div",{className:"sledge__toast-type","data-notification-type":c,children:"success"===c?jsxRuntimeExports.jsx(CheckIcon,{width:15,height:15,color:"white"}):jsxRuntimeExports.jsx(CloseIcon,{width:13.65,height:13.65,color:"white"})})]}),jsxRuntimeExports.jsxs("div",{className:"sledge__toast-message-wrapper",children:[jsxRuntimeExports.jsx($054eb8030ebde76e$export$f99233281efd08a0,{className:"sledge__toast-title",children:s}),jsxRuntimeExports.jsx($054eb8030ebde76e$export$393edc798c47379d,{asChild:!0,children:jsxRuntimeExports.jsx("p",{className:"sledge__toast-description",children:n})})]}),jsxRuntimeExports.jsx("div",{className:"sledge__toast-action-wrapper",children:jsxRuntimeExports.jsx($054eb8030ebde76e$export$e19cd5f9376f8cee,{className:"sledge__toast-action",asChild:!0,altText:"Close notification",children:jsxRuntimeExports.jsx(Button,{colorType:"outlined-danger",children:"Dismiss"})})})]}),jsxRuntimeExports.jsx($054eb8030ebde76e$export$d5c6c08dc2d3ca7,{className:"sledge__toast-viewport","data-location":r})]})},ToastNotificationInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_TOAST_NOTIFICATION}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_TOAST_NOTIFICATION),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(ToastNotification,{})})))},Popover$1="",Popover=({trigger:e,content:t,isOpen:s,setIsOpen:i,hideCloseIcon:n,align:o,className:r,withOpenState:l=!0,withArrow:a=!0,customArrow:d="",sideOffset:c=5,alignOffset:u=0})=>{const[x,p]=React.useState(!!l&&s);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==d?void 0:d.length)&&(t.style.display="inline-flex",t.innerHTML=d)}),[x]),jsxRuntimeExports.jsxs($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{...l&&{open:s},...i&&{onOpenChange:e=>{p(e),i(e)}},children:[jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$41fb9f06171c75f4,{asChild:!0,children:e}),jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{className:`sledge__popover-content ${r||""}`,sideOffset:c,alignOffset:u,align:o,...i&&{onOpenAutoFocus:()=>i(!0),onCloseAutoFocus:()=>i(!1)},children:[t,!n&&jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$f39c2d165cd861fe,{className:"PopoverClose","aria-label":"Close",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),a?jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$21b07c8f274aebd5,{className:"PopoverArrow"}):null]})})]})},Progress$1="",Progress=({value:e,total:t,fillColor:s="",outlineColor:i=""})=>{const[n,o]=React.useState(0);return React.useEffect((()=>{const s=setTimeout((()=>o(+e/t*100)),150);return()=>clearTimeout(s)}),[]),jsxRuntimeExports.jsx($67824d98245208a0$export$be92b6f5f03c0fe9,{className:"sledge__progress",value:n,style:i?{borderWidth:"1px",borderStyle:"solid",borderColor:i}:{},children:jsxRuntimeExports.jsx($67824d98245208a0$export$adb584737d712b70,{className:"ProgressIndicator",style:{transform:`translateX(-${100-n}%)`,...s&&{backgroundColor:s}}})})},Checkbox$1="",Checkbox=({id:e,name:t,value:s,required:i,label:n,checked:o,labelStyle:r={},onClick:l})=>jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",checked:o,id:e,name:t,value:s,required:i,onClick:l,children:jsxRuntimeExports.jsx($e698a72e93240346$export$adb584737d712b70,{className:"sledge__checkbox-indicator",children:jsxRuntimeExports.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.72318 0.237414C10.0707 0.574491 10.0942 1.14584 9.77561 1.51356L4.40976 7.70711C4.25243 7.88871 4.03181 7.99443 3.79903 7.99979C3.56625 8.00514 3.3415 7.90965 3.17686 7.73545L0.250031 4.63868C-0.0833435 4.28595 -0.0833435 3.71406 0.250031 3.36133C0.583405 3.00859 1.12391 3.00859 1.45729 3.36133L3.75367 5.79105L8.51706 0.292899C8.83564 -0.0748211 9.37564 -0.0996624 9.72318 0.237414Z",fill:"white"})})})}),n&&jsxRuntimeExports.jsx("label",{className:"sledge__checkbox-label",htmlFor:e,style:r,children:n})]}),Slider$1="",Slider=e=>{const{defaultValue:t,min:s,max:i,step:n=1,setValueCommit:o,setValueChange:r}=e,[l,a]=React.useState(t);return jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsxs($faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:t,...void 0!==s?{min:s}:{},max:i,step:n,"aria-label":"Volume",onValueCommit:e=>{o&&o(e),a(e)},onValueChange:e=>{r&&r(e),a(e)},children:[jsxRuntimeExports.jsx($faa2e61a3361514f$export$13921ac0cc260818,{className:"sledge__SliderTrack",children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$9a58ef0d7ad3278c,{className:"sledge__SliderRange"})}),jsxRuntimeExports.jsx(Tooltip,{content:l[0],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#43c6ac"/></svg>',wrapTrigger:!1,children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),jsxRuntimeExports.jsx(Tooltip,{content:l[1],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#43c6ac"/></svg>',wrapTrigger:!1,children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})})]})})},Pagination$1="",Pagination=({currentPage:e,totalPage:t,totalResult:s,onChange:i})=>{const n=1===e,o=e===t;return jsxRuntimeExports.jsxs("div",{className:"sledge__pagination",children:[jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...n?{disabled:!0}:{onClick:()=>i(e-1)},children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"black"})}),jsxRuntimeExports.jsxs("span",{children:["Page ",e," of ",t," - total ",s," result"]}),jsxRuntimeExports.jsx("button",{type:"button",className:"sledge__pagination-navigation",...o?{disabled:!0}:{onClick:()=>i(e+1)},children:jsxRuntimeExports.jsx(ChevronArrowRightIcon,{width:16,height:16,color:"black"})})]})},RadioGroup$1="",RadioGroup=({id:e,name:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:r})=>jsxRuntimeExports.jsx("div",{className:"sledge__radio-group-wrapper",children:jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsx($f99a8c78507165f7$export$be92b6f5f03c0fe9,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:i,id:e,name:t,required:s,onValueChange:r,children:n.map(((t,s)=>{const{label:i,value:n}=t;return jsxRuntimeExports.jsxs("div",{className:"sledge__radio-group-item-flex",children:[jsxRuntimeExports.jsx($f99a8c78507165f7$export$6d08773d2e66f8f2,{className:"sledge__radio-group-item",value:n,id:`${e}${s}`,children:jsxRuntimeExports.jsx($f99a8c78507165f7$export$adb584737d712b70,{className:"sledge__radio-group-indicator"})}),jsxRuntimeExports.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${e}${s}`,style:o,children:i})]},s)}))})})}),ColorSwatch$1="",ColorSwatch=({id:e,name:t,value:s,rgb:i,image:n,required:o,defaultChecked:r,onClick:l})=>{const a={...(null==n?void 0:n.length)?{backgroundImage:`url(${n})`}:{backgroundColor:i}};return jsxRuntimeExports.jsx("div",{className:"sledge__color-swatch-wrapper",children:jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__color-swatch-root",defaultChecked:r,id:e,name:t,value:s,required:o,onClick:l,style:a})})},Select$1="",Select=({name:e,placeholder:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:r})=>jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:e,required:s,onValueChange:r,children:[jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$41fb9f06171c75f4,{className:"sledge__select-trigger",children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$4c8d1a57a761ef94,{placeholder:t}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$f04a61298a47a40f,{className:"sledge__select-icon",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$7c6e2c02157bb7d2,{className:"sledge__select-content",children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$2f60d3ec9ad468f2,{className:"sledge__select-scroll-button",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d5c6c08dc2d3ca7,{className:"sledge__select-viewport",children:n.map(((e,t)=>{const{label:s,value:i}=e;return jsxRuntimeExports.jsx(SelectItemComponent,{value:i,children:s},t)}))}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$bf1aedc3039c8d63,{className:"sledge__select-scroll-button",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]})})]})}),SelectItemComponent=React.forwardRef((({children:e,className:t="",...s},i)=>jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$6d08773d2e66f8f2,{className:`sledge__select-item ${t}`,...s,ref:i,children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d6e5bf9c43ea9319,{children:e}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$c3468e2714d175fa,{className:"sledge__select-item-indicator",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}))),HeartIcon=({width:e,height:t,type:s,color:i})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__heart",children:"outline"===s?jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:i,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.19515 0.86581C10.5501 0.00914308 12.3501 -0.227524 13.9051 0.27081C17.2876 1.36164 18.3376 5.04914 17.3985 7.98331C15.9493 12.5916 9.76015 16.0291 9.49765 16.1733C9.40431 16.225 9.30098 16.2508 9.19765 16.2508C9.09431 16.2508 8.99181 16.2258 8.89848 16.175C8.63765 16.0325 2.49348 12.6458 0.995979 7.98414L0.995146 7.98331C0.0551462 5.04831 1.10181 1.35998 4.48098 0.27081C6.06765 -0.242524 7.79681 -0.0166903 9.19515 0.86581ZM4.86431 1.46081C2.13015 2.34248 1.44348 5.28331 2.18598 7.60248C3.35431 11.2375 7.97015 14.1766 9.19681 14.9041C10.4276 14.1691 15.0768 11.1975 16.2076 7.60581C16.9501 5.28414 16.261 2.34331 13.5226 1.46081C12.196 1.03498 10.6485 1.29414 9.58015 2.12081C9.35681 2.29248 9.04681 2.29581 8.82181 2.12581C7.69015 1.27498 6.21181 1.02581 4.86431 1.46081ZM12.7226 3.11573C13.8585 3.48323 14.6543 4.48906 14.7518 5.67823C14.7793 6.02239 14.5235 6.32406 14.1793 6.35156C14.1618 6.35323 14.1451 6.35406 14.1276 6.35406C13.8051 6.35406 13.5318 6.10656 13.5051 5.77989C13.4501 5.09489 12.9918 4.51656 12.3393 4.30573C12.0101 4.19906 11.8301 3.84656 11.936 3.51906C12.0435 3.19073 12.3926 3.01239 12.7226 3.11573Z"})}):jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:i,children:jsxRuntimeExports.jsx("path",{d:"M5.89936 0.0838691C6.42436 0.0998355 6.9327 0.191502 7.4252 0.359002H7.47436C7.5077 0.374836 7.5327 0.392336 7.54936 0.408169C7.73353 0.467336 7.9077 0.534002 8.07436 0.625669L8.39103 0.767336C8.51603 0.834002 8.66603 0.958169 8.74936 1.009C8.8327 1.05817 8.92436 1.109 8.99936 1.1665C9.9252 0.459002 11.0494 0.0756688 12.2077 0.0838691C12.7335 0.0838691 13.2585 0.158169 13.7577 0.325669C16.8335 1.32567 17.9419 4.70067 17.016 7.65067C16.491 9.15817 15.6327 10.534 14.5085 11.6582C12.8994 13.2165 11.1335 14.5998 9.2327 15.7915L9.02436 15.9173L8.8077 15.7832C6.9002 14.5998 5.12436 13.2165 3.5002 11.6498C2.38353 10.5257 1.52436 9.15817 0.991029 7.65067C0.0493627 4.70067 1.1577 1.32567 4.26686 0.308169C4.50853 0.224836 4.7577 0.166502 5.0077 0.134002H5.1077C5.34186 0.0998355 5.57436 0.0838691 5.8077 0.0838691H5.89936ZM13.3244 2.71734C12.9827 2.59984 12.6077 2.784 12.4827 3.134C12.366 3.484 12.5494 3.86734 12.8994 3.9915C13.4335 4.1915 13.791 4.71734 13.791 5.29984V5.32567C13.7752 5.5165 13.8327 5.70067 13.9494 5.84234C14.066 5.984 14.241 6.0665 14.4244 6.084C14.766 6.07484 15.0577 5.80067 15.0827 5.44984V5.35067C15.1077 4.18317 14.4002 3.12567 13.3244 2.71734Z"})})}),ChevronArrowDownIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-down",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Arrow - Down 2",children:jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:jsxRuntimeExports.jsx("g",{id:"Arrow---Down-2",children:jsxRuntimeExports.jsx("path",{id:"Stroke-1",d:"M3.72407 6.6414C3.94596 6.41951 4.29318 6.39934 4.53786 6.58089L4.60796 6.6414L9.99935 12.0325L15.3907 6.6414C15.6126 6.41951 15.9598 6.39934 16.2045 6.58089L16.2746 6.6414C16.4965 6.86329 16.5167 7.21051 16.3351 7.45519L16.2746 7.52529L10.4413 13.3586C10.2194 13.5805 9.87218 13.6007 9.62751 13.4191L9.55741 13.3586L3.72407 7.52529C3.48 7.28121 3.48 6.88548 3.72407 6.6414Z",fill:s})})})})})}),ChevronArrowLeftIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-left",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M10.6875 2.97945C10.865 3.15697 10.8812 3.43474 10.7359 3.63048L10.6875 3.68656L6.37465 7.99967L10.6875 12.3128C10.865 12.4903 10.8812 12.7681 10.7359 12.9638L10.6875 13.0199C10.51 13.1974 10.2323 13.2135 10.0365 13.0683L9.98043 13.0199L5.31377 8.35323C5.13625 8.17572 5.12012 7.89794 5.26535 7.7022L5.31377 7.64612L9.98043 2.97945C10.1757 2.78419 10.4923 2.78419 10.6875 2.97945Z",fill:s})})}),ChevronArrowRightIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.60738 13.1302C5.42987 12.9527 5.41374 12.675 5.55897 12.4792L5.60738 12.4231L9.92027 8.11002L5.60738 3.79691C5.42987 3.6194 5.41374 3.34162 5.55897 3.14588L5.60738 3.0898C5.7849 2.91229 6.06267 2.89615 6.25841 3.04139L6.31449 3.0898L10.9812 7.75647C11.1587 7.93398 11.1748 8.21175 11.0296 8.4075L10.9812 8.46357L6.31449 13.1302C6.11923 13.3255 5.80265 13.3255 5.60738 13.1302Z",fill:s})})}),ArrowRightIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3 8.79429C3 8.50952 3.21162 8.27418 3.48617 8.23693L3.5625 8.23179L13.4505 8.23224L9.87826 4.6746C9.65812 4.4554 9.65735 4.09925 9.87655 3.8791C10.0758 3.67897 10.3883 3.66015 10.6088 3.82306L10.672 3.87739L15.2095 8.39539C15.2386 8.42428 15.2638 8.45555 15.2852 8.48858C15.2912 8.49852 15.2973 8.50869 15.3032 8.51906C15.3085 8.52795 15.3134 8.53718 15.318 8.54652C15.3243 8.5601 15.3305 8.57413 15.3361 8.58845C15.3407 8.59949 15.3445 8.61023 15.348 8.62105C15.3522 8.63447 15.3562 8.64877 15.3597 8.66329C15.3622 8.67343 15.3643 8.68319 15.3661 8.69298C15.3686 8.70755 15.3707 8.72263 15.3722 8.73789C15.3735 8.74953 15.3743 8.76106 15.3747 8.77261C15.3749 8.77961 15.375 8.78693 15.375 8.79429L15.3747 8.81608C15.3743 8.82712 15.3735 8.83815 15.3725 8.84916L15.375 8.79429C15.375 8.82979 15.3717 8.86452 15.3654 8.89819C15.364 8.90623 15.3622 8.91449 15.3603 8.92271C15.3563 8.93964 15.3517 8.95595 15.3464 8.97194C15.3438 8.97988 15.3407 8.98837 15.3375 8.99679C15.3309 9.01371 15.3238 9.02985 15.3159 9.04557C15.3122 9.05296 15.3082 9.06069 15.3039 9.06835C15.2968 9.08084 15.2896 9.09272 15.2819 9.10429C15.2765 9.11248 15.2706 9.12101 15.2643 9.1294L15.2594 9.13588C15.2443 9.15568 15.2278 9.17444 15.2102 9.19204L15.2096 9.19256L10.6721 13.7113C10.4519 13.9305 10.0958 13.9298 9.87658 13.7097C9.67729 13.5096 9.65979 13.197 9.82363 12.9771L9.87823 12.9142L13.449 9.35724L3.5625 9.35679C3.25184 9.35679 3 9.10495 3 8.79429Z",fill:s})})}),BagIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__bag",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"vuesax/bold/bag-2",children:jsxRuntimeExports.jsx("g",{id:"bag-2",children:jsxRuntimeExports.jsx("path",{id:"Vector",d:"M14.3711 6.04627C13.919 5.54693 13.2374 5.25677 12.2927 5.15555V4.64271C12.2927 3.71824 11.9013 2.82752 11.2131 2.20671C10.518 1.57241 9.6138 1.2755 8.67584 1.36322C7.06309 1.51842 5.70676 3.07719 5.70676 4.76417V5.15555C4.76205 5.25677 4.08051 5.54693 3.6284 6.04627C2.97385 6.77505 2.9941 7.74674 3.06833 8.42154L3.54068 12.1801C3.68238 13.496 4.21547 14.8455 7.11707 14.8455H10.8824C13.784 14.8455 14.3171 13.496 14.4588 12.1869L14.9312 8.41479C15.0054 7.74674 15.0189 6.77505 14.3711 6.04627ZM8.77031 2.30118C9.4451 2.24045 10.0862 2.44963 10.5855 2.90174C11.0781 3.34711 11.3548 3.98141 11.3548 4.64271V5.11506H6.64472V4.76417C6.64472 3.56304 7.63666 2.40915 8.77031 2.30118ZM6.58399 8.87365H6.57724C6.2061 8.87365 5.90245 8.56999 5.90245 8.19885C5.90245 7.82772 6.2061 7.52406 6.57724 7.52406C6.95512 7.52406 7.25878 7.82772 7.25878 8.19885C7.25878 8.56999 6.95512 8.87365 6.58399 8.87365ZM11.3075 8.87365H11.3008C10.9296 8.87365 10.626 8.56999 10.626 8.19885C10.626 7.82772 10.9296 7.52406 11.3008 7.52406C11.6787 7.52406 11.9823 7.82772 11.9823 8.19885C11.9823 8.56999 11.6787 8.87365 11.3075 8.87365Z",fill:s})})})})}),CheckIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__check",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.90625 11.1562L2.40625 7.65625L3.07812 6.98438L5.90625 9.8125L11.9062 3.8125L12.5781 4.48438L5.90625 11.1562Z",fill:s})})}),CloseIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__close",children:jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:e,height:t,children:jsxRuntimeExports.jsx("path",{d:"m11.414 10 6.293-6.293a1 1 0 1 0-1.414-1.414l-6.293 6.293-6.293-6.293a1 1 0 0 0-1.414 1.414l6.293 6.293-6.293 6.293a1 1 0 1 0 1.414 1.414l6.293-6.293 6.293 6.293a.998.998 0 0 0 1.707-.707.999.999 0 0 0-.293-.707l-6.293-6.293z",fill:s})})}),StarIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__star",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M8.68841 19.8162L8.75567 19.4179L8.44456 19.1604L2.64616 14.3604L2.64622 14.3603L2.63697 14.3529C2.02964 13.8672 2.28424 12.8955 3.04396 12.7636L11.2293 12.3989L11.6809 12.3788L11.8484 11.959L15.3475 3.18648C15.4773 2.94796 15.7259 2.79961 15.9982 2.79961C16.2692 2.79961 16.5188 2.94848 16.6491 3.18698L20.148 11.959L20.3155 12.3788L20.767 12.3989L28.9524 12.7636C29.7121 12.8955 29.9667 13.8672 29.3594 14.3529L29.3593 14.3528L29.3502 14.3604L23.5518 19.1604L23.2407 19.4179L23.308 19.8162L24.8887 29.1774C24.9836 29.8833 24.2616 30.4104 23.6226 30.1159L16.3737 25.5088L15.9983 25.2702L15.6228 25.5088L8.37397 30.1141C7.73341 30.409 7.01273 29.8817 7.1077 29.1758L8.68841 19.8162Z",stroke:s,strokeWidth:"1.4"})})}),UploadIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__upload",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.8253 11.7254C10.3773 11.7254 10.8253 12.1734 10.8253 12.7254C10.8253 13.2774 10.3773 13.7254 9.8253 13.7254H8.5813C6.42264 13.7254 4.66797 15.4801 4.66797 17.6374V24.1374C4.66797 26.2961 6.42264 28.0507 8.5813 28.0507H23.4213C25.5786 28.0507 27.3346 26.2961 27.3346 24.1374V17.6254C27.3346 15.4747 25.5853 13.7254 23.436 13.7254H22.1786C21.6266 13.7254 21.1786 13.2774 21.1786 12.7254C21.1786 12.1734 21.6266 11.7254 22.1786 11.7254H23.436C26.688 11.7254 29.3346 14.3721 29.3346 17.6254V24.1374C29.3346 27.3987 26.6813 30.0507 23.4213 30.0507H8.5813C5.3213 30.0507 2.66797 27.3987 2.66797 24.1374V17.6374C2.66797 14.3774 5.3213 11.7254 8.5813 11.7254H9.8253ZM16.7088 2.9622L20.5968 6.8662C20.9861 7.2582 20.9848 7.8902 20.5941 8.27953C20.2021 8.66887 19.5701 8.66887 19.1808 8.27687L17 6.08853L17.0008 20.7213H15.0008L15 6.08853L12.8221 8.27687C12.6274 8.4742 12.3701 8.57153 12.1141 8.57153C11.8594 8.57153 11.6034 8.4742 11.4088 8.27953C11.0181 7.8902 11.0154 7.2582 11.4061 6.8662L15.2928 2.9622C15.6674 2.58487 16.3341 2.58487 16.7088 2.9622Z",fill:s})})}),SearchIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__search",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.78283 2.16669C14.2578 2.16669 17.8978 5.80669 17.8978 10.2817C17.8978 12.393 17.0876 14.3186 15.7617 15.7638L18.3707 18.3673C18.6148 18.6114 18.6157 19.0064 18.3715 19.2506C18.2498 19.3739 18.089 19.4348 17.929 19.4348C17.7698 19.4348 17.6098 19.3739 17.4873 19.2523L14.8469 16.6192C13.4579 17.7316 11.6967 18.3975 9.78283 18.3975C5.30783 18.3975 1.66699 14.7567 1.66699 10.2817C1.66699 5.80669 5.30783 2.16669 9.78283 2.16669ZM9.78283 3.41669C5.99699 3.41669 2.91699 6.49585 2.91699 10.2817C2.91699 14.0675 5.99699 17.1475 9.78283 17.1475C13.5678 17.1475 16.6478 14.0675 16.6478 10.2817C16.6478 6.49585 13.5678 3.41669 9.78283 3.41669Z",fill:s})})}),MessageAddIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__message-add",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"vuesax/bold/message-add",children:jsxRuntimeExports.jsx("g",{id:"message-add",children:jsxRuntimeExports.jsx("path",{id:"Vector",d:"M11.1666 1.33301H5.83325C3.16659 1.33301 1.83325 2.66634 1.83325 5.33301V13.9997C1.83325 14.3663 2.13325 14.6663 2.49992 14.6663H11.1666C13.8333 14.6663 15.1666 13.333 15.1666 10.6663V5.33301C15.1666 2.66634 13.8333 1.33301 11.1666 1.33301ZM10.8333 8.49967H8.99992V10.333C8.99992 10.6063 8.77325 10.833 8.49992 10.833C8.22658 10.833 7.99992 10.6063 7.99992 10.333V8.49967H6.16658C5.89325 8.49967 5.66658 8.27301 5.66658 7.99967C5.66658 7.72634 5.89325 7.49967 6.16658 7.49967H7.99992V5.66634C7.99992 5.39301 8.22658 5.16634 8.49992 5.16634C8.77325 5.16634 8.99992 5.39301 8.99992 5.66634V7.49967H10.8333C11.1066 7.49967 11.3333 7.72634 11.3333 7.99967C11.3333 8.27301 11.1066 8.49967 10.8333 8.49967Z",fill:s})})})})}),SwapIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__swap",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Swap",children:jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Swap",children:jsxRuntimeExports.jsx("g",{id:"Swap_2",children:jsxRuntimeExports.jsx("path",{id:"Combined-Shape",d:"M11.7263 3.864C11.9795 3.864 12.1887 4.0521 12.2218 4.29616L12.2263 4.364L12.2262 12.2307L14.0904 10.359C14.2852 10.1633 14.6018 10.1626 14.7975 10.3574C14.9754 10.5345 14.9922 10.8122 14.8474 11.0083L14.7991 11.0645L12.0806 13.7956C12.0642 13.8117 12.0476 13.8263 12.03 13.8398L12.0806 13.7956C12.0561 13.8203 12.0296 13.8418 12.0017 13.8603C11.992 13.8663 11.9819 13.8725 11.9715 13.8784C11.9619 13.8842 11.9522 13.8892 11.9423 13.894C11.9325 13.8983 11.9226 13.9027 11.9125 13.9067C11.8998 13.9122 11.8866 13.9168 11.8734 13.9209C11.8656 13.9229 11.8576 13.9252 11.8495 13.9272C11.8351 13.9312 11.8206 13.9342 11.8061 13.9365C11.7993 13.9373 11.7921 13.9383 11.7849 13.9391C11.7685 13.9414 11.7522 13.9425 11.7359 13.9428C11.7327 13.9425 11.7295 13.9425 11.7263 13.9425L11.7166 13.9428C11.7003 13.9425 11.684 13.9414 11.6678 13.9395L11.7263 13.9425C11.6991 13.9425 11.6724 13.9403 11.6463 13.9362C11.6319 13.9342 11.6174 13.9312 11.6031 13.9276C11.5955 13.9253 11.5879 13.9232 11.5804 13.9209C11.566 13.9169 11.5518 13.9118 11.5378 13.9061C11.5301 13.9026 11.5227 13.8994 11.5154 13.896C11.5038 13.891 11.4923 13.8851 11.4809 13.8787C11.4707 13.8725 11.4606 13.8663 11.4508 13.8598C11.4431 13.8552 11.4355 13.8499 11.428 13.8443L11.4227 13.8398C11.4051 13.8263 11.3884 13.8117 11.3728 13.7961L11.3719 13.7956L8.65336 11.0645C8.45855 10.8688 8.45928 10.5522 8.65499 10.3574C8.83292 10.1803 9.11073 10.1648 9.30613 10.3105L9.3621 10.359L11.2262 12.232L11.2263 4.364C11.2263 4.08786 11.4502 3.864 11.7263 3.864ZM5.10736 2.05497L5.1171 2.05469C5.13339 2.055 5.14967 2.05611 5.16588 2.058L5.10736 2.05497C5.1346 2.05497 5.16133 2.05714 5.18739 2.06133C5.20164 2.06328 5.21594 2.06623 5.23012 2.0698C5.23846 2.07225 5.24696 2.07463 5.25536 2.07723C5.26849 2.08093 5.2812 2.08543 5.29374 2.09046C5.30281 2.0945 5.31199 2.09851 5.32103 2.10279C5.33176 2.10743 5.34234 2.11289 5.35274 2.11876C5.36166 2.12425 5.37048 2.12959 5.37912 2.1352C5.38801 2.14048 5.39691 2.14667 5.40565 2.15318L5.4618 2.20186L8.18032 4.93297C8.37513 5.12868 8.3744 5.44527 8.17869 5.64008C8.00077 5.81718 7.72295 5.83267 7.52755 5.68698L7.47158 5.63844L5.60692 3.76469L5.60736 11.6335C5.60736 11.9096 5.3835 12.1335 5.10736 12.1335C4.85423 12.1335 4.64503 11.9454 4.61192 11.7013L4.60736 11.6335L4.60692 3.76535L2.74329 5.63844C2.56618 5.81636 2.28845 5.83314 2.09237 5.68836L2.03618 5.64008C1.85826 5.46298 1.84148 5.18524 1.98626 4.98916L2.03455 4.93297L4.75306 2.20186L4.78251 2.17486C4.78942 2.16895 4.7965 2.16322 4.80373 2.15768L4.75306 2.20186C4.77759 2.17722 4.80405 2.15567 4.83195 2.13721C4.84168 2.13115 4.8518 2.12496 4.86214 2.11912C4.87175 2.11333 4.88152 2.10825 4.8914 2.10352C4.90117 2.0992 4.91107 2.09484 4.92114 2.09079C4.93393 2.08533 4.94704 2.0807 4.9603 2.07663C4.96836 2.07446 4.97662 2.07215 4.98496 2.07006C4.99839 2.06637 5.01197 2.06355 5.02562 2.06129C5.03383 2.06027 5.04188 2.05915 5.04999 2.05822C5.06542 2.0561 5.08126 2.05503 5.0971 2.0547C5.1006 2.055 5.10398 2.05497 5.10736 2.05497Z",fill:s})})})})})}),NoteIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__note",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsxs("g",{id:"vuesax/bold/note-2",children:[jsxRuntimeExports.jsx("path",{id:"Vector",d:"M8.95178 13.3046C9.13494 13.3473 9.15172 13.5871 8.97332 13.6466L7.91998 13.9933C5.27332 14.8466 3.87998 14.1333 3.01998 11.4866L2.16665 8.85328C1.31332 6.20661 2.01998 4.80661 4.66665 3.95328L4.67731 3.94975C5.08018 3.81633 5.48102 4.22359 5.37901 4.63553C5.37264 4.66126 5.3663 4.68718 5.35998 4.71328L4.70665 7.50661C3.97332 10.6466 5.04665 12.3799 8.18665 13.1266L8.95178 13.3046Z",fill:s}),jsxRuntimeExports.jsx("path",{id:"Vector_2",d:"M11.9467 2.14033L10.8334 1.88033C8.6067 1.35366 7.28004 1.787 6.50004 3.40033C6.30004 3.807 6.14004 4.30033 6.00671 4.867L5.35337 7.66033C4.70004 10.447 5.56004 11.8203 8.34004 12.4803L9.46004 12.747C9.8467 12.8403 10.2067 12.9003 10.54 12.927C12.62 13.127 13.7267 12.1537 14.2867 9.747L14.94 6.96033C15.5934 4.17366 14.74 2.79366 11.9467 2.14033ZM10.6934 8.887C10.6334 9.11366 10.4334 9.26033 10.2067 9.26033C10.1667 9.26033 10.1267 9.25366 10.08 9.247L8.14004 8.75366C7.87337 8.687 7.71337 8.41366 7.78004 8.147C7.84671 7.88033 8.12004 7.72033 8.38671 7.787L10.3267 8.28033C10.6 8.347 10.76 8.62033 10.6934 8.887ZM12.6467 6.63366C12.5867 6.86033 12.3867 7.007 12.16 7.007C12.12 7.007 12.08 7.00033 12.0334 6.99366L8.80004 6.17366C8.53337 6.107 8.37337 5.83366 8.44004 5.567C8.50671 5.30033 8.78004 5.14033 9.04671 5.207L12.28 6.027C12.5534 6.087 12.7134 6.36033 12.6467 6.63366Z",fill:s})]})})}),Button$1="",Button=React.forwardRef(((e,t)=>{const{className:s="",children:i,colorType:n="light",fullWidth:o=!1,elementType:r="button",link:l="",...a}=e;return"hyperlink"===r&&(null==l?void 0:l.length)?jsxRuntimeExports.jsx("a",{href:l,className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":o,ref:t,...a,children:i}):jsxRuntimeExports.jsx("button",{className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":o,ref:t,...a,children:i})})),SearchInputField$1="",SearchInputField=e=>{const{className:t="",icon:s,value:i="",withClearField:n,onChange:o,onResetField:r,fieldRef:l,...a}=e,[d,c]=React.useState(!1);return React.useEffect((()=>{c(Boolean(i))}),[i]),jsxRuntimeExports.jsxs("div",{className:`sledge__search-input-field-wrapper ${t||""}`,children:[s?jsxRuntimeExports.jsx("div",{className:"sledge__search-input-field-icon",children:s}):null,jsxRuntimeExports.jsx("input",{className:"sledge__search-input-field",value:i,onChange:e=>(e=>{o&&o({value:e.target.value})})(e),ref:l,...a}),d&&n?jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==l?void 0:l.current)&&l.current.focus(),o&&o({value:""}),r&&r()},children:jsxRuntimeExports.jsx(CloseIcon,{width:14,height:14,color:"#393d4e"})})}):null]})},SelectField$1="",ROTATE_FILTER_ARROW_ANIMATION={open:{rotate:180},closed:{rotate:0},transition:{type:"spring",duration:.2}},VISIBLE_ANIMATION={hidden:{opacity:0,scale:0},visible:e=>{const{duration:t}=e||{};return{opacity:1,scale:1,transition:{type:"spring",duration:t||.7}}}},SelectField=e=>{var t;const{className:s="",placeholder:i=null,prefixLabel:n=null,prefixSelectedLabel:o="",align:r="end",onChange:l,value:a="",options:d=[],LinkComponent:c,link:u}=e,[x,p]=React.useState(!1),m=i&&!a?i:null==(t=null==d?void 0:d.filter((({value:e})=>e===a))[0])?void 0:t.label;return jsxRuntimeExports.jsx("div",{className:`sledge__select-field-wrapper ${s||""}`,children:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs("button",{type:"button",className:"sledge__button sledge__select-field","data-button-color-type":"light","data-button-full-width":"true",children:[n?jsxRuntimeExports.jsx("span",{className:"sledge__select-field-icon",children:n}):null,jsxRuntimeExports.jsx("span",{children:(null==o?void 0:o.length)?`${o} ${m}`:m}),jsxRuntimeExports.jsx(motion.div,{initial:"closed",animate:x?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,className:"sort-trigger-icon",children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:18,height:18,color:"#000000"})})]}),content:jsxRuntimeExports.jsx("ul",{className:"sledge__select-field-option",children:null==d?void 0:d.map(((e,t)=>{const{label:s,value:i}=e,n=()=>jsxRuntimeExports.jsx("li",{onClick:()=>((e,t)=>{l&&l({label:e,value:t}),p(!1)})(s,i),...i===a&&{"data-selected":!0},children:s},t);return c?jsxRuntimeExports.jsx(c,{scroll:!1,to:null==u?void 0:u.replace("value",i),href:null==u?void 0:u.replace("value",i),children:jsxRuntimeExports.jsx(n,{})},t):jsxRuntimeExports.jsx(n,{},t)}))}),isOpen:x,setIsOpen:p,hideCloseIcon:!0,align:r,className:"sledge__select-field-option-content",withArrow:!1})})},ProductGrid$1="",addToCart=async e=>{var t,s;let i=[];if(e.map((e=>{const{id:t,quantity:s}=e;i.push({id:sanitizeDataId(t),quantity:s})})),"undefined"==typeof window||!(null==(s=null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)?void 0:s.root))return;let n=`${window.Shopify.routes.root}cart/add.js`,o={items:i};return await fetchApi({url:n,method:"POST",payload:o,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getReview=async(e,t,s)=>{const{page:i,limit:n,sort:o,keyword:r,rating:l}=t||{};let a=sanitizeDataId(e),d=s||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||""),c="?"+new URLSearchParams({[PAYLOAD_API_ALIASES.Authorization]:d,page:i||"",limit:n||"",sort:o||"",keyword:r||"",rating:l||""}).toString(),u=`${API_URL}/review/${a}${c}`;return await fetchApi({url:u,method:"GET",authorization:d,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getReviewInfo=async e=>{let t=sanitizeDataId(e),s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",i=`${API_URL}/review/info/${t}?${PAYLOAD_API_ALIASES.Authorization}=${s}`;return await fetchApi({url:i,method:"GET",authorization:s,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getProductsReviewInfo=async(e,t)=>{let s=e.map((e=>sanitizeDataId(e))),i=t||("undefined"!=typeof localStorage&&(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP))||""),n=`${API_URL}/review/info/ids/${s.join(",")}?${PAYLOAD_API_ALIASES.Authorization}=${i}`;return await fetchApi({url:n,method:"GET",authorization:i,isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getReviewMedia=async()=>{let e="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",t=`${API_URL}/review/usermedia`;return await fetchApi({url:t,method:"GET",authorization:e}).then((e=>e)).catch((()=>{}))},addReviewMedia=async e=>{let t="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=`${API_URL}/review/media`,i={files:e};return await fetchApi({url:s,method:"POST",authorization:t,payload:i,headers:{},isSimpleRequest:!1,isUploadFile:!0}).then((e=>e)).catch((()=>{}))},deleteReviewMedia=async e=>{let t="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=`${API_URL}/review/usermedia/${e}`;return await fetchApi({url:s,method:"DELETE",authorization:t}).then((e=>e)).catch((()=>{}))},addReview=async e=>{const{userFirstName:t,userLastName:s,userEmail:i,productId:n,productVariantId:o,rating:r,title:l,review:a,mediaIds:d}=e;let c="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",u=`${API_URL}/review`,x={user:JSON.stringify({name:`${t}${s?` ${s}`:""}`,email:i}),product:JSON.stringify({id:sanitizeDataId(n),variant_id:sanitizeDataId(o)}),review:JSON.stringify({rating:r,title:l,review:a,media_ids:d})};return await fetchApi({url:u,method:"POST",authorization:c,payload:x}).then((e=>e)).catch((()=>{}))},Rating=e=>{var t,s,i;const{total:n,average:o,size:r="sm",params:l,withSkeletonLoading:a=!0,withTotal:d=!0,isScrollToElementWidget:c=!0,data:u,sledgeSettings:x}=e,{productId:p}=l||{},{isRenderApp:m,triggerRenderMultipleComponent:g}=React.useContext(SledgeContext),{productReview:_}=m||{},{value:R,trigger:E}=(null==(t=null==g?void 0:g.productReview)?void 0:t.rating)||{},h=!u&&void 0===n&&void 0===o,[j,v]=React.useState(h),[T,w]=React.useState(h),[S,A]=React.useState(u||void 0!==n||void 0!==o?r&&"string"==typeof r?getSizing(r):{width:null==r?void 0:r.width,height:null==r?void 0:r.height}:{width:0,height:0}),[f,C]=React.useState((null==u?void 0:u.review_count)||n||0),[L,I]=React.useState((null==(s=null==u?void 0:u.rating)?void 0:s.average)||o||"0"),[N,O]=React.useState((null==x?void 0:x.review)||{}),[y,b]=React.useState(!0),D=usePrevious({productId:p}),{fill_color:P="#23BC45",outline_color:$="#8D9196"}=(null==(i=null==N?void 0:N.display)?void 0:i.rating)||{},U=async(e,t=!1)=>{var s;if(e!==p)return;let i,n,o,r=!1,l=0;if(u&&y)o=u,r=!0,b(!1);else{if(i=await getReviewInfo(e),!i)return;const{status:t}=i;o=i.data;const{code:s}=t;r=200===s||!1}l=(null==o?void 0:o.review_count)?o.review_count:0,n=(null==(s=null==o?void 0:o.rating)?void 0:s.average)?o.rating.average:0,r&&(C(l),I(n),w(!1),v(!1),t&&R&&E&&E(""))},W=async e=>{let t;w(!0),t=JSON.parse(e),t&&(O(t),await(async()=>{void 0!==n||void 0!==o?w(!1):U(p)})())};return React.useEffect((()=>{if(!_)return;"xs"===r?A({width:14,height:14}):"sm"===r?A({width:20,height:20}):"md"===r&&A({width:32,height:32}),Boolean(D&&(null==D?void 0:D.productId)!==p)&&v(!0),W(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||null)}),[_,p]),React.useEffect((()=>{!p||p&&R!==p||(E&&E(""),v(!0),U(R,!0))}),[p,R]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{c&&setTimeout((()=>{scrollToElement({element:document.getElementById(ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET),headerOffset:50})}),200)},"data-rating-size":r,children:j&&a?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"230px",height:"28px",color:"lighten",rounded:"md"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},id:"sledge-product-review-rating-icon-svg-store",children:[jsxRuntimeExports.jsx("symbol",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",id:"sledge-product-review-icons-rating-icon-fill",children:jsxRuntimeExports.jsx("g",{id:"favorite_major",children:jsxRuntimeExports.jsx("path",{id:"Primary fill",fillRule:"evenodd",clipRule:"evenodd",d:"M5.00009 12L1.37609 9C0.692087 8.453 0.992087 7.353 1.86009 7.229L7.00009 7L9.19509 1.497C9.34809 1.192 9.65909 1 10.0001 1C10.3411 1 10.6521 1.193 10.8051 1.497L13.0001 7L18.1401 7.229C19.0081 7.353 19.3081 8.453 18.6241 9L15.0001 12L15.9891 17.857C16.1031 18.656 15.2731 19.254 14.5521 18.893L10.0001 16L5.44809 18.892C4.72609 19.253 3.89709 18.655 4.01109 17.856L5.00009 12Z",fill:P})})}),jsxRuntimeExports.jsx("symbol",{viewBox:"0 0 33 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",id:"sledge-product-review-icons-rating-icon-line",children:jsxRuntimeExports.jsx("g",{id:"favorite_major",children:jsxRuntimeExports.jsx("path",{id:"Primary fill",d:"M9.18817 19.8162L9.25542 19.4179L8.94431 19.1604L3.14591 14.3604L3.14598 14.3603L3.13673 14.3529C2.5294 13.8672 2.784 12.8955 3.54372 12.7636L11.7291 12.3989L12.1807 12.3788L12.3481 11.959L15.8472 3.18648C15.977 2.94796 16.2257 2.79961 16.4979 2.79961C16.769 2.79961 17.0185 2.94848 17.1489 3.18698L20.6478 11.959L20.8152 12.3788L21.2668 12.3989L29.4522 12.7636C30.2119 12.8955 30.4665 13.8672 29.8592 14.3529L29.8591 14.3528L29.85 14.3604L24.0516 19.1604L23.7405 19.4179L23.8077 19.8162L25.3884 29.1774C25.4834 29.8833 24.7613 30.4104 24.1224 30.1159L16.8734 25.5088L16.498 25.2702L16.1226 25.5088L8.87373 30.1141C8.23317 30.409 7.51248 29.8817 7.60746 29.1758L9.18817 19.8162Z",stroke:$,strokeWidth:"1.4"})})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("g",{id:"sledge-product-review-icons-rating-icon",children:[jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-line",className:"sledge-product-review__rating-icon-line"}),jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon-fill",className:"sledge-product-review__rating-icon-fill"})]})})]}),!T&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((e,t)=>{let s=Math.floor(parseFloat(L)),i=String(L).includes(",")?String(L).split(","):[],n=String(L).includes(".")?String(L).split("."):[],o=i.length||n.length?i[1]||n[1]:0,r="fill-0";return e>s&&s+1===e&&(r=`fill-${o}`),reactExports.createElement("svg",{...S,viewBox:"0 0 33 33","data-product-review-rating-fill":e<=s?"full":r,key:t},jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),d?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",f,")"]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]})]})})},getSizing=e=>"xs"===e?{width:14.4,height:14.4}:"sm"===e?{width:18,height:18}:{width:28.8,height:28.8},ElementInit$1=e=>{const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),s=e.getAttribute(DATASET_ATTRIBUTE_KEY.PRODUCT_REVIEW.RATING_SIZE),i=e.getAttribute(DATASET_ATTRIBUTE_KEY.PRODUCT_REVIEW.RATING_TOTAL),n=e.getAttribute(DATASET_ATTRIBUTE_KEY.PRODUCT_REVIEW.RATING_AVERAGE),o=e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.WITH_SKELETON_LOADING);e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`)&&e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`).remove();let r=document.createElement("div");r.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET),e.appendChild(r),client.createRoot(r).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Rating,{params:{productId:t||""},withSkeletonLoading:!Boolean(o&&"false"===o),...s?{size:s}:{},...null!=i?{total:i}:{},...null!=n?{average:n}:{}})})}))},RatingInitSelector=e=>{new MutationObserver((function(e){e.forEach((function(e){Array.prototype.slice.call(e.addedNodes).forEach((function(e){if(1===e.nodeType&&e.querySelector(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)){let t=Array.from(e.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING));t.length&&t.map((e=>ElementInit$1(e)))}}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1});let t=Array.from(document.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING));!t||t&&!t.length||t.map((t=>{const s=t.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID);e&&e!==s||ElementInit$1(t)}))},WidgetHeaderAddTrigger=({isFirstLoading:e,text:t,dataSettings:s,params:i,onAfterAddReview:n})=>{var o,r,l;const{text_color:a,border_color:d,border_radius:c,padding_top:u,padding_bottom:x,padding_left:p,padding_right:m,background_color:g,font_size:_,font_weight:R,text_transform:E}=(null==(r=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:r.button_write_review)||{},{button_write_review:h}=(null==(l=null==s?void 0:s.languages)?void 0:l.widget)||{},j={...a&&{color:a},...d&&{borderColor:d},...c&&{borderRadius:c},...u&&{paddingTop:u},...x&&{paddingBottom:x},...p&&{paddingLeft:p},...m&&{paddingRight:m},...g&&{backgroundColor:g},..._&&{fontSize:_},...R&&{fontWeight:R},...E&&{textTransform:E}};return jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"lighten"}):jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"success",className:"sledge-product-review__widget-header-add-trigger",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(i,n),style:j,children:[jsxRuntimeExports.jsx(MessageAddIcon,{width:16,height:16,color:"currentColor"}),t||(h||"Add review")]})})},WidgetHeaderSort$1=({isFirstLoading:e,productReviewSort:t,dataSettings:s,setSelectedSort:i,setIsRefreshWidgetList:n})=>{var o,r;const{default_sort:l,show_sorting_options:a}=(null==(o=null==s?void 0:s.display)?void 0:o.widget)||{},[d,c]=React.useState(l||null),u=d||(null==(r=t[0])?void 0:r.value);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"lighten"}):jsxRuntimeExports.jsx(SelectField,{align:"end",prefixLabel:jsxRuntimeExports.jsx(SwapIcon,{width:16,height:16,color:"currentColor"}),prefixSelectedLabel:"Sort by",options:t.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:u,onChange:({value:e})=>(e=>{c(e),n&&n(!0),i&&i(e)})(e),link:"?page=1&sort=value"})}):null})},WidgetHeaderSummary=e=>{var t,s,i,n;const{params:o,dataSettings:r,summaryData:l,sledgeSettings:a}=e,{productId:d}=o||{},{fill_color:c,outline_color:u}=(null==(s=null==(t=null==r?void 0:r.display)?void 0:t.widget)?void 0:s.summary_bar)||{},{review_singular:x,review_plural:p}=(null==(i=null==r?void 0:r.languages)?void 0:i.widget)||{},[m,g]=React.useState(!0),[_,R]=React.useState(!0),[E,h]=React.useState(!0),[j,v]=React.useState(!l),[T,w]=React.useState(!1),[S,A]=React.useState(0|(null==l?void 0:l.review_count)),[f,C]=React.useState((null==l?void 0:l.rating)||{5:0,4:0,3:0,2:0,1:0}),[L,I]=React.useState((null==(n=null==l?void 0:l.rating)?void 0:n.average)||"0"),[N,O]=React.useState(!0),y=usePrevious({productId:d}),b=async()=>{var e;let t,s,i,n,o=!1,r=0;if(l&&N)s=l,o=!0,O(!1);else{if(t=await getReviewInfo(d),!t)return;const{status:e}=t,{code:i}=e;s=t.data,o=200===i||!1}r=(null==s?void 0:s.review_count)?s.review_count:0,i=(null==s?void 0:s.rating)?{5:s.rating[5]||0,4:s.rating[4]||0,3:s.rating[3]||0,2:s.rating[2]||0,1:s.rating[1]||0}:f,n=(null==(e=null==s?void 0:s.rating)?void 0:e.average)?s.rating.average:"0",o&&(A(r),C(i),I(n),h(!1),v(!1),g(!1),T&&R(!1))};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{v(!0),b()}),Boolean(y&&(null==y?void 0:y.productId)!==d)&&g(!0),b()}),[T,d]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:m&&!l?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"630px",height:"42px",color:"lighten",rounded:"md"}):E&&!l?null:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(motion.div,{initial:!1,animate:T?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:L}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!j&&jsxRuntimeExports.jsx(Rating,{data:l,sledgeSettings:a,average:String(L),size:"md",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[S,jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-summary-total-desc",children:S>1?p||"Reviews":x||"Review"})]}),jsxRuntimeExports.jsx(motion.div,{variants:ROTATE_FILTER_ARROW_ANIMATION,className:"summary-trigger-icon",children:jsxRuntimeExports.jsx("svg",{width:20,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),content:_?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map((e=>jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"108px",height:"22px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"128px",height:"22px",color:"lighten",rounded:"md",style:{marginLeft:"13px",marginRight:"12px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"38px",height:"22px",color:"lighten",rounded:"md"})]},e)))}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist",children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-dist-progress",children:[5,4,3,2,1].map(((e,t)=>jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-dist-progress-item",children:[jsxRuntimeExports.jsx(Rating,{data:l,sledgeSettings:a,average:e,size:"sm",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1}),jsxRuntimeExports.jsx(Progress,{value:String(f[e]),total:S,fillColor:c,outlineColor:u}),jsxRuntimeExports.jsxs("small",{children:["(",f[e],")"]})]},t)))})}),setIsOpen:w,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})},WidgetHeader$1=e=>{const[t,s]=React.useState(!e.data);return React.useEffect((()=>{s(!1)}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!t&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header",children:React.Children.count(e.children)&&React.Children.map(e.children,(t=>React.cloneElement(t,{...e})))})})};WidgetHeader$1.Sort=WidgetHeaderSort$1,WidgetHeader$1.AddTrigger=WidgetHeaderAddTrigger,WidgetHeader$1.Summary=WidgetHeaderSummary;const WidgetList$1=e=>{var t,s,i;const{isFirstLoading:n,isLoading:o,productReviewData:r,dataSettings:l,currentPage:a,setCurrentPage:d,totalPage:c,totalData:u,setIsReplaceWidgetList:x,widgetWrapperRef:p,data:m,sledgeSettings:g}=e||{},{type:_}=(null==(s=null==(t=(null==g?void 0:g.review)||l)?void 0:t.display)?void 0:s.widget)||{},R="list"===_?jsxRuntimeExports.jsx(Pagination,{currentPage:a||1,totalPage:c||1,totalResult:u||0,onChange:e=>(e=>{d&&d(e),x&&x(!0),setTimeout((()=>{scrollToElement({element:p.current,headerOffset:50})}),200)})(e)}):null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o&&!m?_&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.ReviewGrid,{count:"grid"===_?8:10,type:_,gridItemHeights:["252px","342px","196px","398px","342px","252px","398px","196px"]}),n?null:R]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-wrapper","data-layout-type":_,children:(null==(i=null==m?void 0:m.data)?void 0:i.length)||(null==r?void 0:r.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReviewWrapper,{...e,data:m}),R]}):jsxRuntimeExports.jsx(WidgetListEmpty$1,{...e})})})},WidgetListEmpty$1=e=>{var t,s;const{params:i,dataSettings:n,onAfterAddReview:o}=e||{},{title_no_result:r,text_no_result:l}=(null==(t=null==n?void 0:n.languages)?void 0:t.widget)||{};null==(s=null==n?void 0:n.languages)||s.widget;const[a,d]=React.useState(""),[c,u]=React.useState("");return React.useEffect((()=>{d(r||"No reviews for this item yet!"),u(l||'Click "write a review" button to add a review on this product')}),[]),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-product-empty",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-icon",children:jsxRuntimeExports.jsx(MessageAddIcon,{width:32,height:32,color:"#767676"})}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-title",dangerouslySetInnerHTML:{__html:a}}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-description",dangerouslySetInnerHTML:{__html:c}}),jsxRuntimeExports.jsx(WidgetHeaderAddTrigger,{...e})]})},ReviewWrapper=e=>{var t,s,i,n,o,r,l,a;let{productReviewData:d,currentPage:c,setCurrentPage:u,totalPage:x,totalData:p,dataSettings:m,setIsRefreshWidgetList:g,setIsReplaceWidgetList:_,LinkComponent:R,selectedSort:E,data:h,sledgeSettings:j}=e||{};m=(null==j?void 0:j.review)||m;const{type:v,rating_size:T,show_review_date:w}=(null==(t=null==m?void 0:m.display)?void 0:t.widget)||{},{text_color:S,border_color:A,border_radius:f,padding_top:C,padding_bottom:L,padding_left:I,padding_right:N,background_color:O,font_size:y,font_weight:b,text_transform:D}=(null==(i=null==(s=null==m?void 0:m.display)?void 0:s.widget)?void 0:i.button_load_more)||{},{text_color:P,border_color:$,border_radius:U,padding_top:W,padding_bottom:k,padding_left:M,padding_right:F,background_color:B,font_size:H,font_weight:G,text_transform:V}=(null==(o=null==(n=null==m?void 0:m.display)?void 0:n.widget)?void 0:o.verified)||{},{button_load_more:Y,verified:K}=(null==(r=null==m?void 0:m.languages)?void 0:r.widget)||{},{name:q,image:z}=(null==(a=null==(l=null==m?void 0:m.display)?void 0:l.widget)?void 0:a.replier)||{},J={...S&&{color:S},...A&&{borderColor:A},...f&&{borderRadius:f},...C&&{paddingTop:C},...L&&{paddingBottom:L},...I&&{paddingLeft:I},...N&&{paddingRight:N},...O&&{backgroundColor:O},...y&&{fontSize:y},...b&&{fontWeight:b},...D&&{textTransform:D}},Z={...P&&{color:P},...$&&{borderWidth:"1px",borderStyle:"solid",borderColor:$},...U&&{borderRadius:U},...W&&{paddingTop:W},...k&&{paddingBottom:k},...M&&{paddingLeft:M},...F&&{paddingRight:F},...B&&{backgroundColor:B},...H&&{fontSize:H},...G&&{fontWeight:G},...V&&{textTransform:V}};let Q=c||0,X=x||0;const[ee,te]=React.useState(!1),[se,ie]=React.useState(!1),ne=()=>{u&&c&&u(c+1),te(!0)};React.useEffect((()=>{ie(!(X===Q&&!ee)&&X>=Q)}),[ee]),React.useEffect((()=>{te(!1)}),[d]);const oe=()=>jsxRuntimeExports.jsx(Button,{type:"button",role:"button",colorType:"light",disabled:ee,onClick:ne,style:{...J,...ee&&{cursor:"wait"}},children:ee?"Loading...":Y||"Load More"}),re=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==d?void 0:d.length)?jsxRuntimeExports.jsx(MasonryResponsive,{columnsCountBreakPoints:{350:1,750:3,1024:4},className:"sledge-product-review__widget-review-grid",children:jsxRuntimeExports.jsx(Masonry,{gutter:"md"===currentMediaQuery()?"30px":"16px",children:d.map(((e,t)=>{var s,i;const{user:{name:n},review:{rating:o,review:r,media:l,reply:a,is_verified:d},created_at:c}=e;let u=new Intl.DateTimeFormat("en-US").format(new Date(c)),x=q?String(String(q).includes("<span>")?String(q).split("<span>")[0]:String(q)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=a[0])?void 0:s.name):null==(i=a[0])?void 0:i.name,p=q?getTextBetween({start:"<span>",end:"</span>",text:q}):"Admin";return jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetPopupDetail&&window.sledgeProductReviewWidgetPopupDetail({...e,settings:m}),children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-desc-wrapper",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-desc",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-customer",children:[jsxRuntimeExports.jsx("span",{children:n}),d?jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:K}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-column",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-rating",children:jsxRuntimeExports.jsx(Rating,{average:o,size:T,withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),w?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:u}):null]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:r.length>=250?`${r.slice(0,250)}...`:r})]}),(null==l?void 0:l.length)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:l.slice(0,4).map(((e,t)=>{const{type:s,file:i}=e;let n="image"===s?jsxRuntimeExports.jsx("img",{src:i||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy"},t):jsxRuntimeExports.jsx("video",{controls:!1,children:jsxRuntimeExports.jsx("source",{src:i})},t);return t<3?n:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-media sledge-product-review__widget-review-card-media-more-element",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-media-more",children:"More+"}),n]},t)}))}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]}),(null==a?void 0:a.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("img",{src:z||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy",className:"sledge-product-review__widget-review-card-reply-profile-image"},t),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:x}),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:p})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-reply-message",dangerouslySetInnerHTML:{__html:a[0].text}})]}):null]})},t)}))})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),se&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-button-load-more",children:R?jsxRuntimeExports.jsx(R,{scroll:!1,to:`?page=${(c||1)+1}&sort=${E}`,href:`?page=${(c||1)+1}&sort=${E}`,children:jsxRuntimeExports.jsx(oe,{})}):jsxRuntimeExports.jsx(oe,{})})]}),le=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==d?void 0:d.length)?jsxRuntimeExports.jsx(MasonryResponsive,{columnsCountBreakPoints:{350:1},className:"sledge-product-review__widget-review-grid",children:jsxRuntimeExports.jsx(Masonry,{children:d.map(((e,t)=>{var s,i;const{id:n,user:{name:o},review:{rating:r,review:l,media:a,reply:d,is_verified:c},created_at:u}=e;let x=new Intl.DateTimeFormat("en-US").format(new Date(u)),p=q?String(String(q).includes("<span>")?String(q).split("<span>")[0]:String(q)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=d[0])?void 0:s.name):null==(i=d[0])?void 0:i.name,g=q?getTextBetween({start:"<span>",end:"</span>",text:q}):"Admin";return jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetPopupDetail&&window.sledgeProductReviewWidgetPopupDetail({...e,settings:m}),children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-customer-wrapper",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-customer",children:[jsxRuntimeExports.jsx("span",{children:o}),c?jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:K}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-column",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-rating",children:jsxRuntimeExports.jsx(Rating,{average:r,size:T,withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),w?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:x}):null]})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-content",children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-desc-wrapper",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-desc",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:l.length>=350?`${l.slice(0,350)}...`:l}),(null==d?void 0:d.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("svg",{width:18,height:16,viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M0.5625 15.5C0.764999 15.5 0.955502 15.3905 1.056 15.2068L1.07175 15.1783C2.754 12.14 5.9595 10.25 9.4365 10.25H10.5V13.4375C10.5 13.6633 10.6358 13.8673 10.8435 13.9558C11.0498 14.0428 11.2928 13.9993 11.454 13.841L17.829 7.65351C17.9385 7.54776 18 7.40226 18 7.25001C18 7.09776 17.9385 6.95226 17.829 6.84651L11.454 0.659013C11.292 0.501513 11.0498 0.456513 10.8435 0.544263C10.6358 0.632763 10.5 0.836763 10.5 1.06251V4.25151C4.69275 4.35201 0 9.10701 0 14.9375C0 15.1948 0.174 15.419 0.423 15.4828C0.4695 15.4948 0.516001 15.5 0.5625 15.5ZM11.0625 9.12501H9.4365C6.3045 9.12501 3.36975 10.4968 1.3635 12.8083C2.334 8.55651 6.14625 5.37501 10.6875 5.37501H11.0625C11.373 5.37501 11.625 5.12301 11.625 4.81251V2.39226L16.6298 7.25001L11.625 12.1078V9.68751C11.625 9.37701 11.373 9.12501 11.0625 9.12501Z",fill:"#677487"})}),jsxRuntimeExports.jsx("img",{src:z||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy",className:"sledge-product-review__widget-review-card-reply-profile-image"},t),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:p}),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:Z,children:g})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-reply-message",dangerouslySetInnerHTML:{__html:d[0].text}})]}):null]})})}),(null==a?void 0:a.length)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:a.slice(0,4).map(((e,t)=>{const{type:s,file:i}=e;let n="image"===s?jsxRuntimeExports.jsx("img",{src:i||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy"},t):jsxRuntimeExports.jsx("video",{controls:!1,children:jsxRuntimeExports.jsx("source",{src:i})},t);return t<3?n:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-media sledge-product-review__widget-review-card-media-more-element",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-media-more",children:"More+"}),n]},t)}))}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]},t)}))})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})});return"list"===v?le:re},WidgetRoot$1=e=>{var t,s,i,n;const{children:o,params:r,onAfterAddReview:l,data:a,sledgeSettings:d}=e,{productId:c}=r||{},{isRenderApp:u}=React.useContext(SledgeContext),{productReview:x}=u||{},[p,m]=React.useState(!a),[g,_]=React.useState(!a),[R,E]=React.useState(!1),[h,j]=React.useState(!1),[v,T]=React.useState((null==a?void 0:a.data)||[]),[w,S]=React.useState((null==a?void 0:a.sorts)||[]),[A,f]=React.useState((null==(s=null==(t=null==d?void 0:d.display)?void 0:t.widget)?void 0:s.default_sort)||""),[C,L]=React.useState(1),[I,N]=React.useState((null==(i=null==a?void 0:a.page)?void 0:i.total_page)||0),[O,y]=React.useState((null==(n=null==a?void 0:a.page)?void 0:n.total_data)||0),[b,D]=React.useState((null==d?void 0:d.review)||{}),[P,$]=React.useState(!0),U=React.useRef(null),W=usePrevious({currentPage:C,isReplaceWidgetList:h,productId:c}),k=async(e=!1,t=!1,s)=>{var i;let n,o=10,r=A;if(_(!(!t&&!R)||!e),!e||t){let e=await M(s);const{review_per_page:n,default_sort:l}=(null==(i=null==e?void 0:e.display)?void 0:i.widget)||{};o=n||o,r=A||l,t||L(1),t&&T([]),f(r)}let l,d,u=!1,x=0,p=0,g={page:e?C:1,limit:o,sort:r};if(a&&P?($(!1),n=a):n=await getReview(c,g),!n)return;const{status:h,data:w,page:I,sorts:O}=n,{code:b}=h;u=200===b||!1,l=(null==w?void 0:w.length)?t=>(null==v?void 0:v.length)&&e?[...t,...w]:w:[],d=(null==O?void 0:O.length)?O:[],x=(null==I?void 0:I.total_page)||1,p=(null==I?void 0:I.total_data)||1,u&&(T(l),S(d),N(x),y(p),_(!1),E(!1),j(!1),m(!1))},M=async e=>{let t;if(t=JSON.parse(e),t)return D(t),t};return React.useEffect((()=>{if(!x&&!a)return;let e=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";"undefined"!=typeof window&&(window.sledgeProductReviewWidgetListUpdate=()=>{k(!1,!0,e)}),Boolean(W&&(null==W?void 0:W.productId)!==c)&&(m(!0),k(!1,!0,e)),M(e)}),[x,c]),React.useEffect((()=>{if(!x||R)return;let e=Boolean(W&&(null==W?void 0:W.currentPage)!==C),t=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";Boolean(W&&(null==W?void 0:W.isReplaceWidgetList)!==h)?k(!0,!0,t):k(e,h,t)}),[C,h,x,a]),React.useEffect((()=>{if(!x||!R)return;let e=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";k(!1,!1,e)}),[R]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-wrapper",ref:U,id:ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET,children:React.Children.count(o)&&React.Children.map(o,(e=>React.cloneElement(e,{params:r,isFirstLoading:p,isLoading:g,productReviewData:v,productReviewSort:w,selectedSort:A,currentPage:C,totalPage:I,totalData:O,dataSettings:b,setIsLoading:_,setIsRefreshWidgetList:E,setIsReplaceWidgetList:j,setSelectedSort:f,setCurrentPage:L,onAfterAddReview:l,widgetWrapperRef:U,data:P?a:null,sledgeSettings:d})))})})},Widget$1=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Widget$1.Root=WidgetRoot$1,Widget$1.Header=WidgetHeader$1,Widget$1.List=WidgetList$1;const WidgetPopupDetail=()=>{var e,t,s;const[i,n]=React.useState(!1),[o,r]=React.useState(""),[l,a]=React.useState(""),[d,c]=React.useState(""),[u,x]=React.useState(""),[p,m]=React.useState([]),[g,_]=React.useState([]),[R,E]=React.useState(""),[h,j]=React.useState(""),[v,T]=React.useState(!1),[w,S]=React.useState(""),[A,f]=React.useState({}),[C,L]=React.useState(0),[I,N]=React.useState({}),{text_color:O,border_color:y,border_radius:b,padding_top:D,padding_bottom:P,padding_left:$,padding_right:U,background_color:W,font_size:k,font_weight:M,text_transform:F}=(null==(t=null==(e=null==A?void 0:A.display)?void 0:e.widget)?void 0:t.verified)||{},{verified:B}=(null==(s=null==A?void 0:A.languages)?void 0:s.widget)||{},H={...O&&{color:O},...y&&{borderWidth:"1px",borderStyle:"solid",borderColor:y},...b&&{borderRadius:b},...D&&{paddingTop:D},...P&&{paddingBottom:P},...$&&{paddingLeft:$},...U&&{paddingRight:U},...W&&{backgroundColor:W},...k&&{fontSize:k},...M&&{fontWeight:M},...F&&{textTransform:F}},G=0===C,V=C===(null==p?void 0:p.length)-1;return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetPopupDetail=e=>{var t,s,i,o;const{user:{name:l},review:{rating:d,title:u,review:p,media:g,reply:R,is_verified:h},created_at:v,settings:w}=e,{name:A,image:C}=(null==(s=null==(t=null==w?void 0:w.display)?void 0:t.widget)?void 0:s.replier)||{};r(l),a(d),c(u),x(p),m(g),_(R),E(A?String(String(A).includes("<span>")?String(A).split("<span>")[0]:String(A)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(i=R[0])?void 0:i.name):null==(o=R[0])?void 0:o.name),j(A?getTextBetween({start:"<span>",end:"</span>",text:A}):"Admin"),T(h),S(new Intl.DateTimeFormat("en-US").format(new Date(v))),n(!0),f(w),L(0),N({name:A,image:C})})}),[]),React.useEffect((()=>{i?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[i]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:i,onOpenChange:n,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-product-review__widget-popup-detail-content",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-flex",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-image",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-close",onClick:()=>n(!1),children:jsxRuntimeExports.jsx(CloseIcon,{width:17,height:17,color:"#c9c9c9"})}),(null==p?void 0:p.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[p.map(((e,t)=>{const{type:s,file:i}=e,n={hidden:{opacity:0,visibility:"hidden"},show:{opacity:1,visibility:"visible"}};let o="image"===s?jsxRuntimeExports.jsx("img",{src:i||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy",style:n[C!==t?"hidden":"show"]}):jsxRuntimeExports.jsx("video",{controls:!0,style:n[C!==t?"hidden":"show"],children:jsxRuntimeExports.jsx("source",{src:i})});return jsxRuntimeExports.jsx(React.Fragment,{children:o},t)})),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-media-nav",children:[!G&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-prev",onClick:()=>L(C-1),children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"white"})}),!V&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-next",onClick:()=>L(C+1),children:jsxRuntimeExports.jsx(ChevronArrowRightIcon,{width:16,height:16,color:"white"})})]})]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-no-media",children:"No Media Upload"})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-heading",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-title",children:o}),v?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-verified-text",style:H,children:B}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-subheading",children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{average:l,size:"sm",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-date",children:w})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-title-description",children:d}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-description",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-message",dangerouslySetInnerHTML:{__html:u}}),(null==g?void 0:g.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-reply-wrapper",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("img",{src:(null==I?void 0:I.image)||`${API_URL}/img/blank-image.png`,alt:"sledge-review-card-image",loading:"lazy",className:"sledge-product-review__widget-review-card-reply-profile-image"}),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-reply-name",children:R}),jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-review-card-verified-text",style:H,children:h})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-message",dangerouslySetInnerHTML:{__html:g[0].text}})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]})]})]})})]})})},WidgetFormAdd=()=>{var e,t,s,i,n,o,r;const{sledgeAnonymId:l,triggerRenderMultipleComponent:a}=React.useContext(SledgeContext),{trigger:d}=(null==(e=null==a?void 0:a.productReview)?void 0:e.rating)||{},[c,u]=React.useState(!1),[x,p]=React.useState([{key:"Step_SelectRate",isDone:!0,component:Step_SelectRate},{key:"Step_WriteReview",isDone:!1,component:Step_WriteReview},{key:"Step_PersonalData",isDone:!1,component:Step_PersonalData}]),[m,g]=React.useState(x[0]),[_,R]=React.useState(!1),[E,h]=React.useState(!0),[j,v]=React.useState(null),[T,w]=React.useState(!1),[S,A]=React.useState(!1),[f,C]=React.useState(!1),[L,I]=React.useState(null),[N,O]=React.useState({}),[y,b]=React.useState({onAfterAddReview:e=>{}}),[D,P]=React.useState(""),[$,U]=React.useState(""),[W,k]=React.useState(""),[M,F]=React.useState(""),[B,H]=React.useState(""),[G,V]=React.useState(0),[Y,K]=React.useState(""),[q,z]=React.useState(""),[J,Z]=React.useState([]),[Q,X]=React.useState([]),{title_added_to_review:ee,text_added_to_review:te}=(null==(t=null==N?void 0:N.languages)?void 0:t.notification)||{},{title_confirm_add_review:se,text_confirm_add_review:ie,button_submit_confirm_add_review:ne,button_cancel_confirm_add_review:oe}=(null==(s=null==N?void 0:N.languages)?void 0:s.popup)||{},{navigation_previous:re,navigation_next:le,button_submit:ae}=(null==(i=null==N?void 0:N.languages)?void 0:i.write_review_form)||{},de=async()=>{let e;w(!0);let t=!1;if(e=await addReview({userFirstName:D,userLastName:$,userEmail:W,productId:M,productVariantId:B,rating:G,title:Y,review:q,mediaIds:J}),!e)return;const{status:{code:s}}=e;t=200===s,t?(y.onAfterAddReview("success"),setTimeout((()=>{w(!1),u(!1),g(x[0]),P(""),U(""),k(""),V(0),K(""),z(""),Z([]),X([]),ue&&ue(),"undefined"!=typeof window&&(d&&d(M),RatingInitSelector(M),window.sledgeProductReviewWidgetListUpdate&&window.sledgeProductReviewWidgetListUpdate(),window.sledgeProductReviewWidgetSummaryUpdate&&window.sledgeProductReviewWidgetSummaryUpdate(),window.sledgeToastNotification&&window.sledgeToastNotification({title:ee,message:te,type:"success",icon:jsxRuntimeExports.jsx(StarIcon,{width:40,height:40,color:"black"})}))}),500)):(y.onAfterAddReview("failed"),w(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to review",type:"failed",icon:jsxRuntimeExports.jsx(StarIcon,{width:40,height:40,color:"black"})}))},ce=()=>{const e=x.findIndex((e=>e.key===m.key));p((e=>e.map((e=>(e.key===m.key&&(e.isDone=!0),e))))),g(x[e+1])},ue=async()=>{let e,t=!1,s=[],i=[];if(e=await getReviewMedia(),!e)return;const{status:n,data:o}=e,{code:r}=n;t=200===r||!1,s=(null==o?void 0:o.ids)||[],i=(null==o?void 0:o.media)||[],t&&(Z(s),X(i),A(!1),C(!1),I(null))},xe=()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:se,message:ie,textSubmit:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(MessageAddIcon,{width:16,height:16,color:"currentColor"})," ",jsxRuntimeExports.jsx("span",{children:ne})]}),textCancel:oe,buttonSubmitType:"success",onSubmit:de||{}})};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetFormAdd=(e,t)=>{const{productId:s,productVariantId:i}=e||{};u(!0),F(s||""),H(i||""),t&&b({onAfterAddReview:t})}),(async e=>{let t;t=JSON.parse(e),t&&(O(t),await ue())})(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||null)}),[]),React.useEffect((()=>{g(x[0])}),[l]),React.useEffect((()=>{if(c)switch(null==m?void 0:m.key){case"Step_SelectRate":h(!G),v(le),R(!0);break;case"Step_WriteReview":h(!q),v(l?le:ae),R(!!l);break;case"Step_PersonalData":h(!D||!W),v(ae),R(!1)}}),[m,G,q,D,W,l,c]),React.useEffect((()=>{c?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[c]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:c,onOpenChange:u,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-product-review__widget-form-add-content",children:[(null==(n=x[0])?void 0:n.key)===(null==m?void 0:m.key)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step-close",onClick:()=>u(!1),children:jsxRuntimeExports.jsx(CloseIcon,{width:17,height:17,color:"#77757e"})}):null,jsxRuntimeExports.jsxs($d94698215c4408a7$export$be92b6f5f03c0fe9,{className:"sledge-product-review__widget-form-review FormRoot",onSubmit:e=>(e=>{e.preventDefault(),"Step_SelectRate"===(null==m?void 0:m.key)?ce():l&&"Step_WriteReview"===(null==m?void 0:m.key)?ce&&ce():xe&&xe()})(e),"data-active-step":(null==m?void 0:m.key)||"","data-has-visible-next":_,children:[(null==(o=x[0])?void 0:o.key)===(null==m?void 0:m.key)?null:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step-back",onClick:()=>{const e=x.findIndex((e=>e.key===m.key));0!==e&&(p((e=>e.map((e=>(e.key===m.key&&(e.isDone=!1),e))))),g(x[e-1]))},children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:19,height:19,color:"#393d4e"})}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step",children:(null==m?void 0:m.component)&&React.cloneElement(jsxRuntimeExports.jsx(m.component,{}),{steps:x,activeStep:m,isLoadingAddReview:T,isLoadingUploadMedia:S,isLoadingDeleteMedia:f,selectedDeleteMediaId:L,dataSettings:N,postUserFirstName:D,postUserLastName:$,postUserEmail:W,postRating:G,postReview:q,postMedia:Q,setIsDisableNextStep:h,setIsLoadingUploadMedia:A,setIsLoadingDeleteMedia:C,setSelectedDeleteMediaId:I,handleNext:ce,handleProductReviewMedia:ue,handleAddReview:de,setPostUserFirstName:P,setPostUserLastName:U,setPostUserEmail:k,setPostRating:V,setPostTitle:K,setPostReview:z,confirmAddReview:xe})}),"Step_SelectRate"===(null==(r=x[0])?void 0:r.key)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step-navigator",children:jsxRuntimeExports.jsx($d94698215c4408a7$export$2c4cf1f7b42ef78c,{asChild:!0,disabled:T||E,children:jsxRuntimeExports.jsxs(Button,{role:"button",colorType:"success",style:{...T&&{cursor:"wait"}},disabled:E,children:[T?jsxRuntimeExports.jsx(LoadingDots,{}):null,j]})})}):null]})]})]})})},Step_SelectRate=e=>{var t,s,i,n;const{postRating:o,setPostRating:r,setPostTitle:l,dataSettings:a}=e,{text_color:d,border_color:c,border_radius:u,padding_top:x,padding_bottom:p,padding_left:m,padding_right:g,background_color:_,selected_background_color:R,font_size:E,font_weight:h,text_transform:j}=(null==(s=null==(t=null==a?void 0:a.display)?void 0:t.write_review_form)?void 0:s.button_select_rating)||{},{title:v,ratings:T}=(null==(n=null==(i=null==a?void 0:a.languages)?void 0:i.write_review_form)?void 0:n.select_rating)||{},{rating_5:w,rating_4:S,rating_3:A,rating_2:f,rating_1:C}=T||{},L={...d&&{color:d},...c&&{borderColor:c},...u&&{borderRadius:u},...x&&{paddingTop:x},...p&&{paddingBottom:p},...m&&{paddingLeft:m},...g&&{paddingRight:g},...E&&{fontSize:E},...h&&{fontWeight:h},...j&&{textTransform:j}},I=[{rate:5,title:w},{rate:4,title:S},{rate:3,title:A},{rate:2,title:f},{rate:1,title:C}];return jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-title",children:v}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-select-rate-list",children:I.map(((e,t)=>jsxRuntimeExports.jsxs("button",{type:"button",className:"sledge-product-review__widget-form-select-rate-list-item "+(e.rate===o?"selected":""),onClick:()=>{return t=e.rate,s=e.title,r&&r(t),void(l&&l(s));var t,s},style:{...L,..._&&R?{backgroundColor:e.rate===o?R:_,...e.rate===o?{borderColor:R}:{}}:{}},children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{average:e.rate,size:{width:24,height:24},withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})})," ",jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-form-select-rate-text",children:e.title})]},t)))})]})},Step_WriteReview=e=>{var t;const{isLoadingUploadMedia:s,isLoadingDeleteMedia:i,selectedDeleteMediaId:n,dataSettings:o,postMedia:r,postReview:l,setIsDisableNextStep:a,setIsLoadingUploadMedia:d,setIsLoadingDeleteMedia:c,setSelectedDeleteMediaId:u,handleProductReviewMedia:x,setPostMediaIds:p,setPostMedia:m,setPostReview:g}=e,{description:_}=(null==(t=null==o?void 0:o.languages)?void 0:t.write_review_form)||{},{title:R,form_placeholder:E}=_||{},[h,j]=React.useState(!1),v=async()=>{if(!n)return;let e;c&&c(!0);let t=!1;if(e=await deleteReviewMedia(n),!e)return;const{status:s}=e,{code:i}=s;t=200===i,t?(x&&x(),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Media removed",message:"successfully removed from media",type:"success",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})})):(c&&c(!1),u&&u(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed delete to media",type:"failed",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})}))};React.useEffect((()=>{j(!1)}),[]),React.useEffect((()=>{n&&h&&(j(!1),"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Are you sure want to delete this media?",message:"This action cannot be undone. This will permanently delete this media.",textSubmit:"Delete",textCancel:"Cancel",buttonSubmitType:"danger",onSubmit:v||{}}))}),[n,h]);const T=jsxRuntimeExports.jsx("label",{htmlFor:"file-upload",className:"sledge-product-review__widget-form-upload-media-file",children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-description",children:[jsxRuntimeExports.jsx(UploadIcon,{width:32,height:32,color:"currentColor"}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-text",children:s?jsxRuntimeExports.jsx("span",{children:"Uploading..."}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:"Upload a file PNG, JPG max 5MB"}),jsxRuntimeExports.jsx("input",{id:"file-upload",name:"file-upload",type:"file",multiple:!0,onChange:e=>{e.target.files&&(async e=>{let t;d&&d(!0);let s=!1,i=[],n=[];t=await addReviewMedia(e),t||(d&&d(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to media",type:"failed",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})}));const{status:o,data:r}=t||{},{code:l}=o||{};s=200===l,i=(null==r?void 0:r.ids)||[],n=(null==r?void 0:r.media)||[],s?(p&&p(i),m&&m(n),x&&x(),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Media added",message:"successfully added to media",type:"success",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})})):(d&&d(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed add to media",type:"failed",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})}))})(e.target.files)},className:"sledge-product-review__widget-form-sr-only"})]})})]})})});return jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-title",children:R}),jsxRuntimeExports.jsx(TextAreaField,{className:"Textarea",required:!0,placeholder:E,value:l,onChange:e=>{var t;a&&a(!(null==(t=null==e?void 0:e.target)?void 0:t.value)),g&&g(e.target.value)}}),(null==r?void 0:r.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-filled",children:[r.map(((e,t)=>{const{id:s,file:o,type:r}=e;let l=i&&s==n;return jsxRuntimeExports.jsxs(motion.div,{initial:"hidden",animate:"visible",variants:VISIBLE_ANIMATION,className:"sledge-product-review__widget-form-upload-media-filled-item",children:[l?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-loading",children:"Deleting..."}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-item",onClick:()=>{j(!0),u&&u(s)},children:jsxRuntimeExports.jsx("svg",{width:25,height:20,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:"#fff",fillRule:"evenodd",clipRule:"evenodd"})})}),"image"===r?jsxRuntimeExports.jsx("img",{src:o||`${API_URL}/img/blank-image.png`,className:"sledge-product-review__widget-form-upload-media-filled-item-file",alt:"sledge-review-uploaded-image",loading:"lazy"}):jsxRuntimeExports.jsx("video",{controls:!l,className:"sledge-product-review__widget-form-upload-media-filled-item-file",children:jsxRuntimeExports.jsx("source",{src:o})})]},t)})),T]})}):T]})},Step_PersonalData=e=>{var t;const{dataSettings:s,postUserFirstName:i,postUserLastName:n,postUserEmail:o,setIsDisableNextStep:r,setPostUserFirstName:l,setPostUserLastName:a,setPostUserEmail:d}=e,{user:c}=(null==(t=null==s?void 0:s.languages)?void 0:t.write_review_form)||{},{title:u,first_name_form_placeholder:x,last_name_form_placeholder:p,email_form_placeholder:m}=c||{},g=()=>{r&&r(!i||!o)};return jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-personal-data",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-title",children:u}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-group-flex",children:[jsxRuntimeExports.jsx(InputField,{name:"userFirstName",type:"text",required:!0,placeholder:x,onChange:e=>{g(),l&&l(e.target.value)},value:i}),jsxRuntimeExports.jsx(InputField,{name:"userLastName",type:"text",placeholder:p,onChange:e=>a&&a(e.target.value),value:n})]}),jsxRuntimeExports.jsx(InputField,{name:"userEmail",type:"email",required:!0,placeholder:m,onChange:e=>{g(),d&&d(e.target.value)},value:o}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-review-description",children:["By submitting, I acknowledge the ",jsxRuntimeExports.jsx("a",{href:"#",children:"Terms of Service"})," and ",jsxRuntimeExports.jsx("a",{href:"#",children:"Privacy Policy"})," and that my review will be publicly posted and shared online"]})]})})},WidgetInitSelector$1=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_WIDGET));!element||element&&!element.length||element.map((item=>{if(item){const PRODUCT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),ON_AFTER_ADD_REVIEW=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_REVIEW);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsxs(Widget$1.Root,{params:{productId:PRODUCT_ID||"",productVariantId:PRODUCT_VARIANT_ID||""},onAfterAddReview:state=>{item&&ON_AFTER_ADD_REVIEW&&eval(ON_AFTER_ADD_REVIEW)&&eval(ON_AFTER_ADD_REVIEW)({state:state})},children:[jsxRuntimeExports.jsxs(Widget$1.Header,{children:[jsxRuntimeExports.jsx(WidgetHeader$1.Summary,{}),jsxRuntimeExports.jsx(WidgetHeader$1.AddTrigger,{}),jsxRuntimeExports.jsx(WidgetHeader$1.Sort,{})]}),jsxRuntimeExports.jsx(Widget$1.List,{})]})})}))}}))},WidgetPopupDetailInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.PRODUCT_REVIEW.ELEMENT_WIDGET_POPUP_DETAIL}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.PRODUCT_REVIEW.ELEMENT_WIDGET_POPUP_DETAIL),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(WidgetPopupDetail,{})})})))},WidgetFormAddInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.PRODUCT_REVIEW.ELEMENT_WIDGET_FORM_ADD}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.PRODUCT_REVIEW.ELEMENT_WIDGET_FORM_ADD),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(WidgetFormAdd,{})})})))},ProductReviewInitSelector=()=>{WidgetInitSelector$1(),WidgetPopupDetailInitSelector(),WidgetFormAddInitSelector(),RatingInitSelector()},ProductFilterWidget=e=>jsxRuntimeExports.jsx(SearchResultWidget,{layoutType:"product-filter",...e}),ProductFilterWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_PLP_WIDGET));!element||element&&!element.length||element.map((item=>{var _a;if(item){const QUERY_KEYWORD=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.QUERY_KEYWORD),COLLECTION_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.COLLECTION_ID),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(ProductFilterWidget,{query:{keyword:QUERY_KEYWORD||""},params:{collectionId:Number(COLLECTION_ID)||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null})})})}))}}))},SearchIconWidget=e=>{const{isRenderApp:t,isJsVersion:s}=React.useContext(SledgeContext),{instantSearch:i}=t||{},{size:n="sm",children:o,onAfterAddToCart:r,onAfterAddWishlist:l,onAfterRemoveWishlist:a,onAfterRenderProduct:d}=e||{};let c=null,u=null,x=null,p=null;React.Children.map(o,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(c=t),s&&isFunction(s)&&(u=s),i&&isFunction(i)&&(x=i),n&&isFunction(n)&&(p=n)}}));const[m,g]=React.useState({width:0,height:0});React.useEffect((()=>{i&&g("xs"===n?{width:14,height:14}:"sm"===n?{width:20,height:20}:{width:25,height:25})}),[i]);return jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup({onAfterAddToCart:r,onAfterAddWishlist:l,onAfterRemoveWishlist:a,onAfterRenderProduct:d,isJsVersion:s,productCardsComponent:c,suggestionKeywordListsComponent:u,otherIndexListsComponent:x,searchViewMoreResultComponent:p})},children:jsxRuntimeExports.jsx(SearchIcon,{...m,color:"currentColor"})})},search=async(e,t)=>{let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP)||"",i=`${INSTANT_SEARCH_ENGINE_URL}/indexes/${e}/search`;return await fetchApi({url:i,method:"POST",authorization:s,payload:t,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},multiSearch=async(e,t)=>{let s=t||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP)||""),i=`${INSTANT_SEARCH_ENGINE_URL}/multi-search`;return await fetchApi({url:i,method:"POST",authorization:s,payload:e,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},searchTrigger=async e=>{const{keyword:t,resultCount:s}=e;let i="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",n=`${API_URL}/instantsearch/statistics/search`,o={keyword:t,result_count:s};return await fetchApi({url:n,method:"POST",authorization:i,payload:o,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},productClickTrigger=async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",i=`${API_URL}/instantsearch/statistics/click`,n={product:{id:sanitizeDataId(t)}};return await fetchApi({url:i,method:"POST",authorization:s,payload:n,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},addToCartTrigger$1=async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",i=`${API_URL}/instantsearch/statistics/cart`,n={product:{id:sanitizeDataId(t)}};return await fetchApi({url:i,method:"POST",authorization:s,payload:n,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},OtherIndexLists=({listsComponent:e,name:t,items:s,isComponentJsVersion:i,showPopupComponent:n,setShowPopupComponent:o})=>{if(e){const r={name:t,items:s,showPopupComponent:n,setShowPopupComponent:o};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e({...r})}}):jsxRuntimeExports.jsx(e,{...r})})}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:t}),(null==s?void 0:s.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:s.map(((e,t)=>{const{title:s,url:i}=e;return jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx("a",{href:i,className:"sledge-instant-search__icon-widget-search-form-result-list-link",children:s})},t)}))}):jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:jsxRuntimeExports.jsxs("li",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:["No ",null==t?void 0:t.toLowerCase()," were found"]})})]})},SuggestionKeywordLists=({listsComponent:e,keywords:t,isComponentJsVersion:s=!1,showPopupComponent:i,setShowPopupComponent:n})=>{var o;if(e){const{triggerRenderMultipleComponent:r}=React.useContext(SledgeContext),{trigger:l}=(null==(o=null==r?void 0:r.instantSearch)?void 0:o.searchResult)||{},a={keywords:t,showPopupComponent:i,setShowPopupComponent:n,setRenderSearchResult:e=>{l&&l(e)}};return jsxRuntimeExports.jsx(React.Fragment,{children:s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e({...a})}}):jsxRuntimeExports.jsx(e,{...a})})}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Suggestions"}),jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__icon-widget-search-form-result-list",children:null==t?void 0:t.map(((e,t)=>jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsxs("a",{href:`${SEARCH_RESULT_URL}?q=${e}`,className:"sledge-instant-search__icon-widget-search-form-result-list-link sledge-instant-search__icon-widget-search-form-result-list-link-suggestion",children:[jsxRuntimeExports.jsx(SearchIcon,{width:12,height:12,color:"#677487"})," ",e]})},t)))})]})},SearchViewMoreResult=({component:e,keyword:t,isComponentJsVersion:s=!1,showPopupComponent:i,setShowPopupComponent:n})=>{var o;if(e){const{triggerRenderMultipleComponent:r}=React.useContext(SledgeContext),{trigger:l}=(null==(o=null==r?void 0:r.instantSearch)?void 0:o.searchResult)||{},a={keyword:t,showPopupComponent:i,setShowPopupComponent:n,setRenderSearchResult:e=>{l&&l(e)}};return jsxRuntimeExports.jsx(React.Fragment,{children:s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e({...a})}}):jsxRuntimeExports.jsx(e,{...a})})}return jsxRuntimeExports.jsx("a",{href:`${SEARCH_RESULT_URL}?q=${t}`,className:"sledge-instant-search__icon-widget-button-more",children:"View More Result"})},Global={OtherIndexLists:OtherIndexLists,SuggestionKeywordLists:SuggestionKeywordLists,SearchViewMoreResult:SearchViewMoreResult},SearchIconWidgetPopup=()=>{var e,t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,E,h,j,v;const{isRenderApp:T}=React.useContext(SledgeContext),{instantSearch:w}=T||{},[S,A]=React.useState(!0),[f,C]=React.useState(!1),[L,I]=React.useState(""),[N,O]=React.useState([]),[y,b]=React.useState([]),[D,P]=React.useState({}),[$,U]=React.useState({}),[W,k]=React.useState({}),[M,F]=React.useState(""),[B,H]=React.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),G=React.useRef(null),V=usePrevious({keyword:L}),Y=async e=>{var t,s,i,n,o,r,l,a,d,c,u,x;const{data:p,onSearch:m=!1,withFetchReviewInfo:g=!1}=e;A(!0);const{index_product:_,tabs:R,hidden_tags:E,display:h,show_out_of_stock:j}=p,v=(null==(t=null==h?void 0:h.search)?void 0:t.suggestion)||{};let T,w={queries:R.map((e=>{const{index:t}=e;let s=t.includes(_),i=[];return(null==E?void 0:E.length)&&i.push(`tags NOT IN [${E}]`),j||i.push("variants.inventory_quantity > 0"),{indexUid:t,q:L,hitsPerPage:s?6:4,filter:s?i.join(" AND "):""}}))};if(T=await multiSearch(w),!T)return;const{results:S}=T;let f=null==S?void 0:S.filter((({indexUid:e})=>null==e?void 0:e.includes(_)));m&&(null==L?void 0:L.length)&&searchTrigger({keyword:L,resultCount:(null==(s=f[0])?void 0:s.totalHits)||0});let C=(null==(i=null==S?void 0:S.filter((({indexUid:e})=>!(null==e?void 0:e.includes(_)))))?void 0:i.map((e=>{const{indexUid:t}=e,{name:s}=null==R?void 0:R.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],I=(null==f?void 0:f.length)?null==(n=f[0])?void 0:n.hits:[],N=L.length?(null==I?void 0:I.length)?"":"no_result":"zero_character",y=Boolean(!L.length&&Object.keys(v).length&&(null==(r=null==(o=v[N])?void 0:o.products)?void 0:r.active)&&(null==(d=null==(a=null==(l=v[N])?void 0:l.products)?void 0:a.list)?void 0:d.length))?null==(u=null==(c=v[N])?void 0:c.products)?void 0:u.list:I;if(g){let e=y.map((({id:e})=>e)),t=await getProductsReviewInfo(e);200===(null==(x=null==t?void 0:t.status)?void 0:x.code)&&P(null==t?void 0:t.data)}else P({});O(y),b(C),F(N),A(!1)};return React.useEffect((()=>{w&&("undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:o=(()=>{}),suggestionKeywordListsComponent:r=(()=>{}),otherIndexListsComponent:l=(()=>{}),searchViewMoreResultComponent:a=(()=>{})})=>{C(!0),H({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:o,suggestionKeywordListsComponent:r,otherIndexListsComponent:l,searchViewMoreResultComponent:a})}),(async e=>{var t;let s;if(s=JSON.parse(e),!s)return;const{display:i}=s;U(i),k(null==(t=null==i?void 0:i.search)?void 0:t.suggestion),await Y({data:s,withFetchReviewInfo:!0})})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null))}),[w]),React.useEffect((()=>{f?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[f]),React.useEffect((()=>{if(Boolean(V&&(null==V?void 0:V.keyword)!==L)){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&Y({data:e,onSearch:!0})}),500);return()=>clearTimeout(t)}}),[L]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:f,onOpenChange:C,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay"}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__popup-overlay-blur"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge-instant-search__icon-widget-popup-detail-content","data-layout-type":(null==(e=null==$?void 0:$.search)?void 0:e.layout)||"",children:[jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:20,height:20,color:"#000000"}),placeholder:"Search anything...",value:L,fieldRef:G,onChange:({value:e})=>I(e),className:"sledge-instant-search__icon-widget-search-form-field",withClearField:!0}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result",children:S?jsxRuntimeExports.jsx(ScrollArea,{children:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other sledge-instant-search__icon-widget-search-form-result-flex-item-other-skeleton",children:[0,1,2].map((e=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"md",...Boolean(e)&&{style:{marginTop:"12px"}}}),jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"140px"}},e)))})]},e)))}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:6,type:"medium"})})]})})}):jsxRuntimeExports.jsx(ScrollArea,{children:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-wrapper",children:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-other",children:[Object.keys(W).length&&(null==(s=null==(t=W[M])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=W[M])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:B.suggestionKeywordListsComponent,keywords:W[M].keywords.list,isComponentJsVersion:B.isJsVersion,showPopupComponent:f,setShowPopupComponent:C}):null,y&&y.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:B.otherIndexListsComponent,name:i,items:s,isComponentJsVersion:B.isJsVersion,showPopupComponent:f,setShowPopupComponent:C})},t)}))]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==N?void 0:N.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:N.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(r=null==$?void 0:$.search)?void 0:r.show_vendor,show_sku:null==(l=null==$?void 0:$.search)?void 0:l.show_sku,show_price:null==(a=null==$?void 0:$.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:B.isJsVersion,cards:B.productCardsComponent,onAfterAddToCart:B.onAfterAddToCart,onAfterAddWishlist:B.onAfterAddWishlist,onAfterRemoveWishlist:B.onAfterRemoveWishlist,onAfterRenderProduct:B.onAfterRenderProduct,showPopupComponent:f,setShowPopupComponent:C,dataReviews:D})}):Object.keys(W).length&&(null==(c=null==(d=W[M])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=W[M])?void 0:u.products)?void 0:x.list)?void 0:p.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-product-suggestion-no-result-text",children:[jsxRuntimeExports.jsx("span",{children:"Sorry"}),", nothing found for ",jsxRuntimeExports.jsx("span",{children:L}),". Did you mean:"]}),jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:W[M].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==$?void 0:$.search)?void 0:m.show_vendor,show_sku:null==(g=null==$?void 0:$.search)?void 0:g.show_sku,show_price:null==(_=null==$?void 0:$.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:B.isJsVersion,cards:B.productCardsComponent,onAfterAddToCart:B.onAfterAddToCart,onAfterAddWishlist:B.onAfterAddWishlist,onAfterRemoveWishlist:B.onAfterRemoveWishlist,onAfterRenderProduct:B.onAfterRenderProduct,showPopupComponent:f,setShowPopupComponent:C})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-title",children:"Products"}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-item-disabled",children:"No product were found"})]}),(null==N?void 0:N.length)||Object.keys(W).length&&(null==(E=null==(R=W[M])?void 0:R.products)?void 0:E.active)&&(null==(v=null==(j=null==(h=W[M])?void 0:h.products)?void 0:j.list)?void 0:v.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:B.searchViewMoreResultComponent,keyword:L,isComponentJsVersion:B.isJsVersion,showPopupComponent:f,setShowPopupComponent:C})}):null]})]})})})})]})]})})},SearchIconWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET));!element||element&&!element.length||element.map((item=>{var _a,_b,_c,_d;if(item){const ICON_SIZE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ICON_SIZE),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_OTHER_INDEX_LIST),SEARCH_VIEW_MORE_RESULT=null==(_d=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchIconWidget,{size:ICON_SIZE||"sm",onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{suggestionKeywordList:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,otherIndexList:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,searchViewMoreResult:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null})})})}))}}))},SearchIconWidgetPopupInitSelector=()=>{let e=document.createElement("div");e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET_POPUP),document.body.appendChild(e),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchIconWidgetPopup,{})})})))},SearchResultWidget=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,E,h,j;const{layoutType:v="default",query:T,params:w,children:S,onAfterAddToCart:A,onAfterAddWishlist:f,onAfterRemoveWishlist:C,onAfterRenderProduct:L,onAfterRenderCollection:I,onAfterRenderPage:N,onAfterRenderBlog:O,onAfterRenderArticle:y,data:b,sledgeSettings:D}=e,P=(null==T?void 0:T.keyword)?T.keyword:"q",{collectionId:$}=w||{},U="undefined"!=typeof document?new URLSearchParams(null==(t=null==document?void 0:document.location)?void 0:t.search):null,[W]=React.useState("undefined"!=typeof localStorage?JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"{}"):{}),[k,M]=React.useState(!b),[F,B]=React.useState(!b),[H,G]=React.useState(null==U?void 0:U.get(P)),[V,Y]=React.useState(null),[K,q]=React.useState(),[z,J]=React.useState(),[Z,Q]=React.useState(jsxRuntimeExports.jsx(ResultProduct,{})),[X,ee]=React.useState(!b),[te,se]=React.useState((null==(s=null==D?void 0:D.instantsearch)?void 0:s.allowed_sorts)||[]),[ie,ne]=React.useState((null==(i=null==D?void 0:D.instantsearch)?void 0:i.filters)||[]),[oe,re]=React.useState([]),[le,ae]=React.useState([]),[de,ce]=React.useState((null==(n=null==D?void 0:D.instantsearch)?void 0:n.index_product)||""),[ue,xe]=React.useState((null==(o=null==D?void 0:D.instantsearch)?void 0:o.hidden_tags)||[]),[pe,me]=React.useState((null==(r=null==D?void 0:D.instantsearch)?void 0:r.display)||{}),[ge,_e]=React.useState((null==(l=null==D?void 0:D.instantsearch)?void 0:l.colors)||[]),[Re,Ee]=React.useState((null==(a=null==D?void 0:D.instantsearch)?void 0:a.default_sort)||""),[he,je]=React.useState(null==(d=null==D?void 0:D.instantsearch)?void 0:d.show_out_of_stock),[ve,Te]=React.useState(!0),[we,Se]=React.useState({}),[Ae,fe]=React.useState(!1);let Ce=null,Le=null,Ie=null,Ne=null,Oe=null;React.Children.map(S,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,collectionCard:s,pageCard:i,blogCard:n,articleCard:o}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(Ce=t),s&&isFunction(s)&&(Le=s),i&&isFunction(i)&&(Ie=i),n&&isFunction(n)&&(Ne=n),o&&isFunction(o)&&(Oe=o)}}));const{isRenderApp:ye,isJsVersion:be,triggerRenderMultipleComponent:De}=React.useContext(SledgeContext),{instantSearch:Pe}=ye||{},{value:$e,trigger:Ue}=(null==(c=null==De?void 0:De.instantSearch)?void 0:c.searchResult)||{},We=React.useRef(null),ke=usePrevious({keyword:H}),Me=async(e,t)=>{var s;const{filters:i,index_product:n,tabs:o,hidden_tags:r,show_out_of_stock:l,display:a}=e;let d,c={queries:("product-filter"===v?o.filter((({index:e})=>null==e?void 0:e.includes(n))):o).map((e=>{const{index:s}=e;let o=!1,a=o?[]:null==i?void 0:i.map((e=>{const{collections:t,items:s}=e;return $&&(null==t?void 0:t.includes(Number($)))||(null==t?void 0:t.includes("all"))?(o=!0,null==s?void 0:s.map((({value:e})=>e))):void 0})),d=s.includes(n),c=d&&a.length,u=[];return(null==r?void 0:r.length)&&u.push(`tags NOT IN [${r}]`),l||u.push("variants.inventory_quantity > 0"),$&&u.push(`collections.id = '${$}'`),c&&ae(a[0]),{indexUid:s,q:"default"===t?"":H,hitsPerPage:1,facets:c?a[0]:[],filter:d?u.join(" AND "):""}}))};if(b&&ve?(d=b.result,Te(!1)):d=await multiSearch(c),!d)return;const{results:u}=d;if(M(!1),ee(!1),B(!1),"totalDataPerIndex"===t)re(null==o?void 0:o.map((e=>{const{index:t}=e,{totalHits:s}=(null==u?void 0:u.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetStats:e,totalHits:t}=(null==u?void 0:u.find((({indexUid:e})=>e.includes(n))))||{};Se(e),fe((null==(s=null==a?void 0:a.filter)?void 0:s.hide_when_one_value)&&t<=1)}};React.useEffect((()=>{if(!Pe)return;const e=new URLSearchParams(document.location.search);G((null==e?void 0:e.get(P))||""),(async e=>{let t,s;if(ee(!0),t=JSON.parse(e),!t)return;const{allowed_sorts:i,default_sort:n,filters:o,index_product:r,tabs:l,hidden_tags:a,display:d,colors:c,show_out_of_stock:u}=t;se((null==i?void 0:i.length)?i:[]),ne((null==o?void 0:o.length)?o:[]),ce(r),xe(a),me(d),_e(c),Ee(n),je(u),s=l.find((({index:e})=>e.includes(r))),Object.keys(s).length&&(Y(s.index),q(s.name),J(s.type)),await Me(t,"default"),"default"===v&&await Me(t,"totalDataPerIndex")})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null)}),[Pe]),React.useEffect((()=>{$e&&(Ue&&Ue(""),G($e))}),[$e]),React.useEffect((()=>{if(Boolean(ke&&(null==ke?void 0:ke.keyword)!==H)&&"default"===v){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&Me(e,"totalDataPerIndex")}),500);return()=>clearTimeout(t)}}),[H]);const Fe="default"===v?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-tab-list sledge-instant-search__result-tab-list-skeleton",children:[1,2,3,4,5].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"122px",height:"28px",rounded:"md",color:"lighten"},e)))}):null,Be=(null==(u=null==pe?void 0:pe.filter)?void 0:u.enable_on_search)&&"horizontal"===(null==(x=null==pe?void 0:pe.filter)?void 0:x.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-skeleton",children:[1,2,3,4,5,6,7].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"106px",height:"42px",rounded:"md",color:"lighten"},e)))}):null,He=(null==(p=null==pe?void 0:pe.filter)?void 0:p.enable_on_search)&&"vertical"===(null==(m=null==pe?void 0:pe.filter)?void 0:m.layout)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",justifyContent:"space-between",marginBottom:"23px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"80px",height:"28px",color:"lighten",rounded:"md"})]}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"270px",marginBottom:"11px"}}),jsxRuntimeExports.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px"},children:[1,2,3,4,5,6,7,8,9].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"34px",height:"34px",color:"lighten",rounded:"full"},e)))})]}):null,Ge=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(g=null==pe?void 0:pe.filter)?void 0:g.show_total_products)&&"vertical"===(null==(_=null==pe?void 0:pe.filter)?void 0:_.layout)?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md",style:{marginBottom:"21px"}}):null,jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:12,type:"large"})]}),Ve=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(R=null==pe?void 0:pe.filter)?void 0:R.show_total_products)&&"horizontal"===(null==(E=null==pe?void 0:pe.filter)?void 0:E.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}):null,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"lg",style:{maxWidth:"630px"}})}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"150px",height:"42px",color:"lighten",rounded:"lg"})}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"150px",height:"42px",color:"lighten",rounded:"lg"})})]})]});return jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-container",ref:We,children:[k?null:jsxRuntimeExports.jsx("div",{className:""+("default"===v&&(null==oe?void 0:oe.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===v&&(null==oe?void 0:oe.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:oe.map((e=>{const{name:t,index:s,type:i,total:n}=e;let o=V===s;return jsxRuntimeExports.jsxs("li",{onClick:e=>(e=>{const{id:t,name:s,type:i}=e;Y(t),q(s),J(i),Q(t.includes(de)?jsxRuntimeExports.jsx(ResultProduct,{}):jsxRuntimeExports.jsx(ResultCategory,{}))})({id:s,name:t,type:i}),className:""+(o?"sledge-instant-search__result-tab-list-item-active":""),children:[t,jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-tab-total",children:n||0})]},s)}))}):null}),k&&(null==v?void 0:v.length)&&!b?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Fe,Be,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(h=null==pe?void 0:pe.filter)?void 0:h.enable_on_search)&&"vertical"===(null==(j=null==pe?void 0:pe.filter)?void 0:j.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:He}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[Ve,Ge]})]})]}):React.cloneElement(Z,{isLoading:F,keyword:H,clickedTabIndexId:V,clickedTabIndexName:K,clickedTabIndexType:z,isLoadingSetting:X,allowedSorts:te,allowedFilters:ie,facets:le,defaultFacetStats:we,hideFilterWhenOneValue:Ae,hiddenTags:ue,displaySettings:pe,colorSwatches:ge,defaultSort:Re,showOutOfStock:he,query:T,params:w,isJsVersion:be,productCardsComponent:Ce,collectionCardsComponent:Le,pageCardsComponent:Ie,blogCardsComponent:Ne,articleCardsComponent:Oe,onAfterAddToCart:A,onAfterAddWishlist:f,onAfterRemoveWishlist:C,onAfterRenderProduct:L,onAfterRenderCollection:I,onAfterRenderPage:N,onAfterRenderBlog:O,onAfterRenderArticle:y,setIsLoading:B,setKeyword:G,filterHorizontalSkeleton:Be,filterVerticalSkeleton:He,productGridSkeleton:Ge,searchAndSelectOptionSkeleton:Ve,searchResultContainerRef:We,data:b,settings:W})]})},ResultProduct=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,E,h,j,v,T,w,S,A,f;const{keyword:C,clickedTabIndexId:L,isLoadingSetting:I,allowedSorts:N,allowedFilters:O,facets:y,defaultFacetStats:b,hideFilterWhenOneValue:D,hiddenTags:P,displaySettings:$,colorSwatches:U,defaultSort:W,showOutOfStock:k,query:M,params:F,isJsVersion:B,productCardsComponent:H,setKeyword:G,filterHorizontalSkeleton:V,filterVerticalSkeleton:Y,productGridSkeleton:K,searchAndSelectOptionSkeleton:q,onAfterAddToCart:z,onAfterAddWishlist:J,onAfterRemoveWishlist:Z,onAfterRenderProduct:Q,searchResultContainerRef:X,data:ee,settings:te}=e||{},se=(null==M?void 0:M.keyword)?M.keyword:"q",{collectionId:ie}=F||{},[ne,oe]=React.useState(!ee),[re,le]=React.useState(!ee),[ae,de]=React.useState(!1),[ce,ue]=React.useState(!1),[xe,pe]=React.useState(W||""),[me,ge]=React.useState(N&&Boolean(null==N?void 0:N.length)?null==(t=N.find((({value:e})=>e===W)))?void 0:t.label:""),[_e,Re]=React.useState((null==(s=null==$?void 0:$.search)?void 0:s.limit)||10),[Ee,he]=React.useState(null),[je,ve]=React.useState([]),[Te,we]=React.useState({...k?{}:{"variants.inventory_quantity":"> 0"}}),[Se,Ae]=React.useState(!1),[fe,Ce]=React.useState((null==(o=null==(n=null==(i=null==ee?void 0:ee.result)?void 0:i.results)?void 0:n[0])?void 0:o.hits)||[]),[Le,Ie]=React.useState(0),[Ne,Oe]=React.useState(1),[ye,be]=React.useState(0),[De,Pe]=React.useState((null==(a=null==(l=null==(r=null==ee?void 0:ee.result)?void 0:r.results)?void 0:l[0])?void 0:a.totalHits)||0),[$e,Ue]=React.useState([]),[We,ke]=React.useState([]),[Me,Fe]=React.useState(!1),[Be,He]=React.useState(!0),[Ge,Ve]=React.useState({}),[Ye,Ke]=React.useState(ee?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(qe=null==$?void 0:$.filter)?void 0:qe.show_total_products)?jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[De," result"," ",(null==C?void 0:C.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',C,'"']})]}):null]}):null}):null);var qe;const ze=usePrevious({keyword:C,clickedLimitId:_e,clickedFacets:Te}),{color:Je,font_size:Ze,font_weight:Qe,text_transform:Xe}=(null==(d=null==$?void 0:$.filter)?void 0:d.title)||{},{color:et,font_size:tt,font_weight:st,text_transform:it}=(null==(c=null==$?void 0:$.filter)?void 0:c.option)||{},{text_color:nt,border_color:ot,border_radius:rt,padding_top:lt,padding_bottom:at,padding_left:dt,padding_right:ct,background_color:ut,font_size:xt,font_weight:pt,text_transform:mt}=(null==(u=null==$?void 0:$.filter)?void 0:u.button)||{},gt={...Je&&{color:Je},...Ze&&{fontSize:Ze},...Qe&&{fontWeight:Qe},...Xe&&{textTransform:Xe}},_t={...et&&{color:et},...tt&&{fontSize:tt},...st&&{fontWeight:st},...it&&{textTransform:it}},Rt=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const r in i){(null==y?void 0:y.length)&&!y.includes(r)&&(n[r]=i[r])}for(const r in e)(null==(t=e[r])?void 0:t.length)&&(n[r]=e[r]);const o=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==o?void 0:o.length)?`?${o}`:""}`)},Et=()=>{Fe(!0),we({}),Ae(!Se),Rt({}),Ue([]),setTimeout((()=>{Fe(!1)}),10)},ht=(e,t,s=!1)=>{var i;Fe(!0);let n=[t],o=["variants.price"].includes(e);Te&&(s?n=[t]:(null==(i=Te[e])?void 0:i.includes(t))?n=Te[e].filter((e=>e!==t)):o?(Te[e],Te[e]===t?(n=[],Ue([])):n=t):n=Te[e]?[...Te[e],t]:[t]);let r={...Te,[e]:n};Rt(r),we(r),Ae(!Se),setTimeout((()=>{Fe(!1)}),10)},jt=async(e=!1,t=!1)=>{var s,i;if(!L)return;e&&Oe(1),le(!0);let n,o=(e=>{const t=new URLSearchParams(document.location.search),s=Object.fromEntries(t);for(const i in s)(null==y?void 0:y.length)&&y.includes(i)&&(e[i]=s[i].split(","));return Object.keys(e).length&&we(e),e})(Te),r=Object.entries(o).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0],n=["variants.inventory_quantity"].includes(i),o=["variants.price"].includes(i),r=["tags"].includes(i);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?o?`${i} >= ${e[1][0]} AND ${i} <= ${e[1][1]}`:r?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:r?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==P?void 0:P.length)&&r.push(`tags NOT IN [${P}]`),ie&&r.push(`collections.id = '${ie}'`);let l={q:C,sort:xe?[xe]:[],page:e?1:Ne,hitsPerPage:_e,facets:y,filter:r.join(" AND ")};ee&&Be?(n=null==(i=null==(s=null==ee?void 0:ee.result)?void 0:s.results)?void 0:i[0],He(!1)):n=await search(L,l),((e,t)=>{var s;if(!e)return;const{hits:i,processingTimeMs:n,totalHits:o,totalPages:r,facetDistribution:l}=e;t&&(null==C?void 0:C.length)&&searchTrigger({keyword:C,resultCount:o||0}),oe(!1),le(!1),Ce(i),Ie(n||0),be(r),Pe(o||0),Ke(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(s=null==$?void 0:$.filter)?void 0:s.show_total_products)?jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[o," result"," ",(null==C?void 0:C.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',C,'"']})]}):null]}):null})),Ve(l?Object.fromEntries(Object.entries(l).map((e=>{let t=e[0],s=[];return"variants.inventory_quantity"===t?(Object.keys(l[t]).map((e=>Boolean(Number(e))?l[t][e]:0)),s=[{name:"In Stock",value:"> 0"}]):s=Object.keys(l[t]).map((e=>({name:e,value:e,total:l[t][e]||0}))),[t,s]}))):{})})(n,t)},vt=e=>{const t=new URLSearchParams(document.location.search);t.set(se,e),G&&G(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};React.useEffect((()=>{let e=Boolean(ze&&((null==ze?void 0:ze.keyword)!==C||(null==ze?void 0:ze.clickedLimitId)!==_e||(null==ze?void 0:ze.clickedFacets)!==Te));if(Boolean(ze&&(null==ze?void 0:ze.keyword)!==C)){const e=setTimeout((()=>{jt(!0,!0)}),500);return()=>clearTimeout(e)}jt(e)}),[xe,_e,Se,C,Ne,L,ie]),React.useEffect((()=>{(()=>{var e;if(!(null==(e=null==$?void 0:$.filter)?void 0:e.enable_on_search)||D)return;let t=!1;t||null==O||O.map((e=>{const{collections:s,items:i}=e;(ie&&(null==s?void 0:s.includes(Number(ie)))||(null==s?void 0:s.includes("all")))&&(t=!0,ke(i))}))})()}),[O,Ge,De]);const Tt=({label:e,name:t,value:s,index:i})=>{var n;let o=s;return["variants.price"].includes(t)&&(o=null==s?void 0:s.join(" - ")),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-refine-selected",style:_t,children:[jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-filter-item-title-refine-list",children:[e,": ",null==(n=String(o))?void 0:n.replaceAll("_"," ")]}),jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-refine-title-clear",onClick:()=>ht(t,s),children:jsxRuntimeExports.jsx("svg",{width:12,height:12,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]},i)},wt=e=>{var t,s;const{value:i,label:n,display:o}=e;let r=null,l=Ge[i],a=null==(t=null==$?void 0:$.filter)?void 0:t.show_number_matching_product;if("slider"===o.toLowerCase()){let e=b[i]&&Object.keys(b[i]).length?b[i]:{},t=$e[0]||(null==e?void 0:e.min),s=$e[1]||(null==e?void 0:e.max);r=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[jsxRuntimeExports.jsx(Slider,{defaultValue:t===s?[s]:[t,s],...(null==e?void 0:e.min)===(null==e?void 0:e.max)?{}:{min:null==e?void 0:e.min},max:null==e?void 0:e.max,step:1,setValueCommit:e=>ht(i,e),setValueChange:e=>Ue(e)}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider-minmax",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:$e[0]||(null==e?void 0:e.min)}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:$e[1]||(null==e?void 0:e.max)})]})]})}else"checkbox"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var s;return jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Checkbox,{id:`${i}_${t}`,name:i,value:e.value,label:`${e.name}${void 0!==e.total&&a?` (${e.total})`:""}`,onClick:e=>ht(i,e.currentTarget.value),checked:Te&&(null==(s=Te[i])?void 0:s.includes(e.value)),labelStyle:_t})},t)}))}):"radio"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(RadioGroup,{id:i,name:i,onValueChange:e=>ht(i,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:Te&&(null==(s=Te[i])?void 0:s.length)?Te[i][0]:"",labelStyle:_t})}):"select"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Select,{placeholder:`Select ${n}`,name:i,onValueChange:e=>ht(i,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:_t})}):"swatch"===o.toLowerCase()&&(null==l?void 0:l.length)&&(r=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var s;let n=(null==U?void 0:U.filter((({name:t})=>null==t?void 0:t.includes(e.value)))[0])||{};return jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(ColorSwatch,{id:`${i}_${t}`,name:i,value:e.value,rgb:null==n?void 0:n.rgb,image:null==n?void 0:n.image,onClick:e=>ht(i,e.currentTarget.value),defaultChecked:Te&&(null==(s=Te[i])?void 0:s.includes(e.value))})},t)}))}));return r},St=We.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=Ge[s],r=Boolean("slider"===n.toLowerCase()?o:null==o?void 0:o.length),l=["select"].includes(n.toLowerCase())&&(null==o?void 0:o.length),a=["sledge-instant-search__result-filter-item-list"],d=wt(e);return"swatch"===n.toLowerCase()&&(null==o?void 0:o.length)&&a.push("sledge-instant-search__result-filter-item-color-swatches"),r?jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>(e=>{he(e===Ee?"":e);let t=je;if(t.includes(e)){const s=t.indexOf(e);s>-1&&t.splice(s,1)}else t.push(e);ve(t)})(s),children:[jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:gt,children:i}),jsxRuntimeExports.jsx(motion.div,{initial:!1,animate:je.includes(s)?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:15,height:15,color:"#000000"})})]}),je.includes(s)&&jsxRuntimeExports.jsx("ul",{className:a.join(" "),children:l?d:Me?null:d})]},t):null})),At=We.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=Ee===s,r=Ge[s],l=Boolean("slider"===n.toLowerCase()?r:null==r?void 0:r.length),a=["radio","select"].includes(n.toLowerCase())&&(null==r?void 0:r.length),d=["sledge-instant-search__result-filter-item-list"],c=wt(e);return"swatch"===n.toLowerCase()&&(null==r?void 0:r.length)&&d.push("sledge-instant-search__result-filter-item-color-swatches"),l?jsxRuntimeExports.jsx("div",{className:"",children:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(Button,{type:"button",onClick:()=>he(s),children:[i,jsxRuntimeExports.jsx(motion.div,{initial:"closed",animate:o?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,className:"sort-trigger-icon",children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:20,height:20,color:"#000000"})})]}),content:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-facet",children:o&&jsxRuntimeExports.jsx("ul",{className:d.join(" "),children:a?c:Me?null:c})}),withOpenState:!1,setIsOpen:e=>he(e?s:""),hideCloseIcon:!0,align:"center",className:"sledge-instant-search__filter-horizontal-facet-content",customArrow:'<svg style="transform: rotate(180deg); margin-bottom: 3px; stroke-dasharray: 0,0,36;" width="44" height="12" viewBox="0 0 44 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.2222 1.99825e-06C23.2222 11.9998 4.88979 11.9999 0.000354767 12L23.2222 12L44 12C23.2222 12 23.2222 1.99825e-06 23.2222 1.99825e-06Z" fill="white" stroke="#393d4e" stroke-width="1px" /></svg>'})},t):null}));let ft=[];Object.entries(Te).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0];if(["variants.inventory_quantity"].includes(i))return;let n=["variants.price"].includes(i),o=We.filter((({value:e})=>null==e?void 0:e.includes(i))),r=(null==o?void 0:o.length)?o[0].label:i;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?ft.push({label:r,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{ft.push({label:r,name:i,value:e})})):ft.push({label:r,name:i,value:e[1][0]})}}));const Ct=jsxRuntimeExports.jsx(Pagination,{currentPage:Ne,totalPage:ye,totalResult:De,onChange:e=>(e=>{Oe(e),setTimeout((()=>{scrollToElement({element:X.current,headerOffset:50})}),200)})(e)});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(x=null==$?void 0:$.filter)?void 0:x.enable_on_search)&&"horizontal"===(null==(p=null==$?void 0:$.filter)?void 0:p.layout)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne&&!ee?V:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:I&&!ee?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:V}):jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:At}),Boolean((null==ft?void 0:ft.length)&&(null==(m=null==$?void 0:$.filter)?void 0:m.show_refine_by_block))?jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-refine-item sledge-instant-search__result-filter-horizontal-refine-item-clear-all",onClick:Et,children:"Clear All"}),ft.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Tt({label:s,name:i,value:n,index:t})}))]}):null]})})}):null,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(g=null==$?void 0:$.filter)?void 0:g.layout,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(_=null==$?void 0:$.filter)?void 0:_.enable_on_search)&&"vertical"===(null==(R=null==$?void 0:$.filter)?void 0:R.layout)?ne?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:Y}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:I?Y:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Boolean((null==ft?void 0:ft.length)&&(null==(E=null==$?void 0:$.filter)?void 0:E.show_refine_by_block))?jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title-refine",children:[jsxRuntimeExports.jsx("strong",{className:"sledge-instant-search__result-filter-item-title-refine-heading",children:"Filter"}),jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-item-title-refine-clear",onClick:Et,children:"Clear All"})]}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:ft.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Tt({label:s,name:i,value:n,index:t})}))})]}):null,St]})}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[ne?q:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(h=null==$?void 0:$.filter)?void 0:h.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:Ye}),jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:C,onChange:({value:e})=>vt(e),onResetField:()=>vt(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-item sledge-instant-search__result-data-summary-select-field",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[jsxRuntimeExports.jsx("span",{children:"Sort by:"}),N&&Boolean(null==N?void 0:N.length)&&jsxRuntimeExports.jsx(SelectField,{align:"end",prefixLabel:jsxRuntimeExports.jsx("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M12.6296 4.34737C12.9144 4.34737 13.1497 4.55898 13.1869 4.83354L13.1921 4.90987L13.192 13.7599L15.2892 11.6543C15.5083 11.4341 15.8645 11.4333 16.0847 11.6525C16.2848 11.8517 16.3037 12.1641 16.1408 12.3847L16.0865 12.4479L13.0282 15.5204C13.0097 15.5386 12.991 15.555 12.9712 15.5701L13.0282 15.5204C13.0006 15.5482 12.9708 15.5724 12.9394 15.5932C12.9285 15.6 12.9171 15.607 12.9055 15.6135C12.8946 15.62 12.8837 15.6258 12.8725 15.6311C12.8615 15.6359 12.8504 15.6408 12.8391 15.6454C12.8247 15.6515 12.8099 15.6568 12.795 15.6613C12.7862 15.6637 12.7772 15.6662 12.7681 15.6685C12.7519 15.673 12.7357 15.6763 12.7193 15.6789C12.7116 15.6798 12.7036 15.6809 12.6955 15.6819C12.677 15.6844 12.6587 15.6857 12.6404 15.686C12.6368 15.6857 12.6332 15.6857 12.6296 15.6857L12.6186 15.686C12.6003 15.6857 12.582 15.6844 12.5637 15.6823L12.6296 15.6857C12.5989 15.6857 12.5689 15.6833 12.5396 15.6785C12.5233 15.6763 12.5071 15.673 12.4909 15.6689C12.4824 15.6663 12.4738 15.6639 12.4654 15.6614C12.4493 15.6569 12.4332 15.6512 12.4174 15.6448C12.4088 15.6408 12.4005 15.6372 12.3922 15.6333C12.3793 15.6278 12.3663 15.6211 12.3535 15.6139C12.342 15.6069 12.3307 15.6 12.3196 15.5926C12.3109 15.5875 12.3024 15.5815 12.294 15.5752L12.288 15.5701C12.2682 15.555 12.2494 15.5386 12.2318 15.5209L12.2308 15.5204L9.1725 12.4479C8.95334 12.2278 8.95416 11.8716 9.17434 11.6525C9.3745 11.4532 9.68704 11.4358 9.90687 11.5997L9.96983 11.6543L12.067 13.7614L12.0671 4.90987C12.0671 4.59921 12.3189 4.34737 12.6296 4.34737ZM5.18325 2.3122L5.19421 2.31189C5.21254 2.31224 5.23085 2.31348 5.24908 2.31562L5.18325 2.3122C5.21389 2.3122 5.24396 2.31465 5.27328 2.31937C5.28931 2.32156 5.3054 2.32487 5.32136 2.32889C5.33074 2.33164 5.3403 2.33433 5.34975 2.33725C5.36452 2.34142 5.37882 2.34648 5.39293 2.35213C5.40313 2.35668 5.41346 2.36119 5.42362 2.366C5.4357 2.37123 5.4476 2.37737 5.45931 2.38397C5.46933 2.39014 5.47926 2.39616 5.48898 2.40246C5.49898 2.40841 5.50899 2.41537 5.51882 2.42269L5.582 2.47746L8.64033 5.54996C8.85949 5.77013 8.85867 6.12629 8.63849 6.34545C8.43833 6.54469 8.12579 6.56212 7.90596 6.39822L7.843 6.34361L5.74525 4.23564L5.74575 13.088C5.74575 13.3987 5.49391 13.6505 5.18325 13.6505C4.89848 13.6505 4.66313 13.4389 4.62588 13.1644L4.62075 13.088L4.62025 4.23639L2.52367 6.34361C2.32443 6.54377 2.01197 6.56265 1.79139 6.39977L1.72817 6.34545C1.52801 6.14621 1.50914 5.83376 1.67202 5.61317L1.72633 5.54996L4.78467 2.47746L4.81779 2.44709C4.82557 2.44043 4.83353 2.43399 4.84167 2.42776L4.78467 2.47746C4.81226 2.44974 4.84202 2.42549 4.87341 2.40473C4.88436 2.39791 4.89574 2.39094 4.90738 2.38438C4.91819 2.37787 4.92917 2.37215 4.9403 2.36682C4.95128 2.36196 4.96242 2.35706 4.97375 2.35251C4.98814 2.34636 5.00289 2.34115 5.0178 2.33657C5.02687 2.33414 5.03616 2.33154 5.04555 2.32918C5.06066 2.32503 5.07593 2.32186 5.09129 2.31932C5.10053 2.31817 5.10959 2.31691 5.11871 2.31586C5.13607 2.31348 5.15388 2.31227 5.17171 2.3119C5.17564 2.31224 5.17944 2.3122 5.18325 2.3122Z",fill:"black"})}),options:N.map((e=>{const{label:t,value:s}=e;return{label:t,value:s}})),value:xe||(null==te?void 0:te.default_sort),onChange:({label:e,value:t})=>((e,t)=>{de(!1),ge(e),pe(t)})(e,t)})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(j=null==$?void 0:$.search)?void 0:j.allowed_limit)&&Boolean(null==(T=null==(v=null==$?void 0:$.search)?void 0:v.allowed_limit)?void 0:T.length)&&jsxRuntimeExports.jsx(SelectField,{align:"end",options:$.search.allowed_limit.map((e=>({label:e,value:e}))),value:_e,onChange:({value:e})=>(e=>{ue(!1),Re(e)})(e)})]})]})]}),re?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K,(null==fe?void 0:fe.length)?Ct:null]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["vertical"===(null==(w=null==$?void 0:$.filter)?void 0:w.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:Ye}),(null==fe?void 0:fe.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"large",data:fe.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(S=null==$?void 0:$.search)?void 0:S.show_vendor,show_sku:null==(A=null==$?void 0:$.search)?void 0:A.show_sku,show_price:null==(f=null==$?void 0:$.search)?void 0:f.show_price},isComponentJsVersion:B,cards:H,showOptionOutOfStock:!0,onAfterAddToCart:z,onAfterAddWishlist:J,onAfterRemoveWishlist:Z,onAfterRenderProduct:Q,dataWishlists:null==ee?void 0:ee.wishlists,dataReviews:null==ee?void 0:ee.reviews}),Ct]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})]})]})})]})},ResultCategory=e=>{const{keyword:t,clickedTabIndexId:s,clickedTabIndexName:i,clickedTabIndexType:n,isJsVersion:o,collectionCardsComponent:r,pageCardsComponent:l,blogCardsComponent:a,articleCardsComponent:d,setKeyword:c,searchResultContainerRef:u,onAfterRenderCollection:x,onAfterRenderPage:p,onAfterRenderBlog:m,onAfterRenderArticle:g}=e||{},[_,R]=React.useState(!0),[E,h]=React.useState(!0),[j,v]=React.useState(""),[T,w]=React.useState([]),[S,A]=React.useState(0),[f,C]=React.useState(1),[L,I]=React.useState(0),[N,O]=React.useState(0),[y,b]=React.useState(null),D=usePrevious({keyword:t}),P=async()=>{if(!s)return;let e;h(!0);let i={q:t,sort:j?[j]:[],page:f,hitsPerPage:12};e=await search(s,i),(e=>{if(!e)return;const{hits:s,processingTimeMs:i,totalHits:n,totalPages:o}=e;R(!1),h(!1),w(s),A(i||0),I(o),O(n||0),b(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[n," result"," ",(null==t?void 0:t.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',t,'"']})]}):null]})}))})(e)};React.useEffect((()=>{if(Boolean(D&&(null==D?void 0:D.keyword)!==t)){const e=setTimeout((()=>{P()}),500);return()=>clearTimeout(e)}P()}),[j,t,f,s]);const $=jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword sledge-instant-search__result-data-keyword-category",children:jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:`Search ${i?i.toLowerCase():""}...`,value:t,onChange:({value:e})=>c&&c(e),onResetField:()=>c&&c(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),U=jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}),W="collection"===n?jsxRuntimeExports.jsx(SkeletonLoading.CollectionGrid,{count:6}):"page"===n?jsxRuntimeExports.jsx(SkeletonLoading.PageGrid,{count:6}):"blog"===n?jsxRuntimeExports.jsx(SkeletonLoading.BlogGrid,{count:12}):"article"===n?jsxRuntimeExports.jsx(SkeletonLoading.ArticleGrid,{count:12}):null,k=()=>jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[$,U,W]}),M=()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[$,U,W]}),F=e=>"collection"===n?jsxRuntimeExports.jsx(CollectionGrid,{cards:r,onAfterRenderCollection:x,...e}):"page"===n?jsxRuntimeExports.jsx(PageGrid,{cards:l,onAfterRenderPage:p,...e}):"blog"===n?jsxRuntimeExports.jsx(BlogGrid,{cards:a,onAfterRenderBlog:m,...e}):"article"===n?jsxRuntimeExports.jsx(ArticleGrid,{cards:d,onAfterRenderArticle:g,...e}):null;return jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:_?jsxRuntimeExports.jsx(k,{}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:E?jsxRuntimeExports.jsx(M,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[$,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:y}),(null==T?void 0:T.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(F,{data:T,isComponentJsVersion:o}),jsxRuntimeExports.jsx(Pagination,{currentPage:f,totalPage:L,totalResult:N,onChange:e=>(e=>{C(e),setTimeout((()=>{scrollToElement({element:u.current,headerOffset:50})}),200)})(e)})]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})})})},ResultEmpty=e=>{const[t,s]=React.useState(""),[i,n]=React.useState("");return React.useEffect((()=>{s("No results found"),n("Your search did not match any results. <br/> Please try again")}),[]),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-empty",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-title",dangerouslySetInnerHTML:{__html:t}}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-empty-description",dangerouslySetInnerHTML:{__html:i}})]})},SearchResultWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_RESULT_WIDGET));!element||element&&!element.length||element.map((item=>{var _a,_b,_c,_d,_e;if(item){const QUERY_KEYWORD=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.QUERY_KEYWORD),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),ON_AFTER_RENDER_COLLECTION=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.ON_AFTER_RENDER_COLLECTION),ON_AFTER_RENDER_PAGE=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.ON_AFTER_RENDER_PAGE),ON_AFTER_RENDER_BLOG=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.ON_AFTER_RENDER_BLOG),ON_AFTER_RENDER_ARTICLE=item.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.ON_AFTER_RENDER_ARTICLE),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),COLLECTION_CARDS=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_COLLECTION_CARD),PAGE_CARDS=null==(_c=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_PAGE_CARD),BLOG_CARDS=null==(_d=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_BLOG_CARD),ARTICLE_CARDS=null==(_e=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_e.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_ARTICLE_CARD);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchResultWidget,{query:{keyword:QUERY_KEYWORD||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},onAfterRenderCollection:state=>{item&&ON_AFTER_RENDER_COLLECTION&&eval(ON_AFTER_RENDER_COLLECTION)&&eval(ON_AFTER_RENDER_COLLECTION)({state:state})},onAfterRenderPage:state=>{item&&ON_AFTER_RENDER_PAGE&&eval(ON_AFTER_RENDER_PAGE)&&eval(ON_AFTER_RENDER_PAGE)({state:state})},onAfterRenderBlog:state=>{item&&ON_AFTER_RENDER_BLOG&&eval(ON_AFTER_RENDER_BLOG)&&eval(ON_AFTER_RENDER_BLOG)({state:state})},onAfterRenderArticle:state=>{item&&ON_AFTER_RENDER_ARTICLE&&eval(ON_AFTER_RENDER_ARTICLE)&&eval(ON_AFTER_RENDER_ARTICLE)({state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,collectionCard:COLLECTION_CARDS?eval(COLLECTION_CARDS):null,pageCard:PAGE_CARDS?eval(PAGE_CARDS):null,blogCard:BLOG_CARDS?eval(BLOG_CARDS):null,articleCard:ARTICLE_CARDS?eval(ARTICLE_CARDS):null})})})}))}}))},SearchWidget=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,E,h,j,v;const{isRenderApp:T,isJsVersion:w}=React.useContext(SledgeContext),{instantSearch:S}=T||{},{width:A="400px",children:f,onAfterAddToCart:C,onAfterAddWishlist:L,onAfterRemoveWishlist:I,onAfterRenderProduct:N}=e;let O=null,y=null,b=null,D=null;React.Children.map(f,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,suggestionKeywordList:s,otherIndexList:i,searchViewMoreResult:n}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(O=t),s&&isFunction(s)&&(y=s),i&&isFunction(i)&&(b=i),n&&isFunction(n)&&(D=n)}}));const[P,$]=React.useState(!0),[U,W]=React.useState(""),[k,M]=React.useState([]),[F,B]=React.useState([]),[H,G]=React.useState({}),[V,Y]=React.useState({}),[K,q]=React.useState(""),z=usePrevious({keyword:U}),J=async(e,t=!1)=>{var s,i,n,o,r,l,a,d,c,u,x;if(!U.length)return;$(!0);const{index_product:p,tabs:m,hidden_tags:g,display:_,show_out_of_stock:R}=e,E=(null==(s=null==_?void 0:_.search)?void 0:s.suggestion)||{};let h,j={queries:m.map((e=>{const{index:t}=e;let s=t.includes(p),i=[];return(null==g?void 0:g.length)&&i.push(`tags NOT IN [${g}]`),R||i.push("variants.inventory_quantity > 0"),{indexUid:t,q:U,hitsPerPage:s?6:4,filter:s?i.join(" AND "):""}}))};if(h=await multiSearch(j),!h)return;const{results:v}=h;let T=null==v?void 0:v.filter((({indexUid:e})=>null==e?void 0:e.includes(p)));t&&(null==U?void 0:U.length)&&searchTrigger({keyword:U,resultCount:(null==(i=T[0])?void 0:i.totalHits)||0});let w=(null==(n=null==v?void 0:v.filter((({indexUid:e})=>!(null==e?void 0:e.includes(p)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==m?void 0:m.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],S=(null==T?void 0:T.length)?null==(o=T[0])?void 0:o.hits:[],A=U.length?(null==S?void 0:S.length)?"":"no_result":"zero_character",f=Boolean(!U.length&&Object.keys(E).length&&(null==(l=null==(r=E[A])?void 0:r.products)?void 0:l.active)&&(null==(c=null==(d=null==(a=E[A])?void 0:a.products)?void 0:d.list)?void 0:c.length));M(f?null==(x=null==(u=E[A])?void 0:u.products)?void 0:x.list:S),B(w),q(A),$(!1)};React.useEffect((()=>{S&&(async e=>{var t;if(!U.length)return;let s;if(s=JSON.parse(e),!s)return;const{display:i}=s;G(i),Y(null==(t=null==i?void 0:i.search)?void 0:t.suggestion),await J(s)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null)}),[S]),React.useEffect((()=>{if(Boolean(z&&(null==z?void 0:z.keyword)!==U)){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&J(e,!0)}),500);return()=>clearTimeout(t)}}),[U]);const Z={maxWidth:A};return jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:Z,children:[jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:U,onChange:({value:e})=>W(e),onResetField:()=>W(""),withClearField:!0}),jsxRuntimeExports.jsx(motion.div,{initial:"hidden",animate:U.length?"visible":"hidden",variants:VISIBLE_ANIMATION,className:"sledge-instant-search__widget-search-form-result",children:P?jsxRuntimeExports.jsx(ScrollArea,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other sledge-instant-search__widget-search-form-result-flex-item-other-skeleton",children:[0,1,2].map((e=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"lighten",rounded:"md",...Boolean(e)&&{style:{marginTop:"12px"}}}),jsxRuntimeExports.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"12px",marginTop:"12px"},children:[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"140px"}},e)))})]},e)))}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:6,type:"small"})})]})}):jsxRuntimeExports.jsx(ScrollArea,{isLoading:P,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-other",children:[Object.keys(V).length&&(null==(s=null==(t=V[K])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=V[K])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:y,keywords:V[K].keywords.list,isComponentJsVersion:w}):null,F.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:b,name:i,items:s,isComponentJsVersion:w})},t)}))]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-flex-item-product",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-title-product",children:"Products"}),(null==k?void 0:k.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:k.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(r=null==H?void 0:H.search)?void 0:r.show_vendor,show_sku:null==(l=null==H?void 0:H.search)?void 0:l.show_sku,show_price:null==(a=null==H?void 0:H.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:w,cards:O,onAfterAddToCart:C,onAfterAddWishlist:L,onAfterRemoveWishlist:I,onAfterRenderProduct:N})}):Object.keys(V).length&&(null==(c=null==(d=V[K])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=V[K])?void 0:u.products)?void 0:x.list)?void 0:p.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-result-product-suggestion-no-result-text",children:[jsxRuntimeExports.jsx("span",{children:"Sorry, nothing found for"})," ",jsxRuntimeExports.jsx("strong",{children:U}),". ",jsxRuntimeExports.jsx("span",{children:"Did you mean:"})]}),jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:V[K].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==H?void 0:H.search)?void 0:m.show_vendor,show_sku:null==(g=null==H?void 0:H.search)?void 0:g.show_sku,show_price:null==(_=null==H?void 0:H.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:w,cards:O,onAfterAddToCart:C,onAfterAddWishlist:L,onAfterRemoveWishlist:I,onAfterRenderProduct:N})]}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product-disabled",children:"No product were found"})]})]}),(null==k?void 0:k.length)||Object.keys(V).length&&(null==(E=null==(R=V[K])?void 0:R.products)?void 0:E.active)&&(null==(v=null==(j=null==(h=V[K])?void 0:h.products)?void 0:j.list)?void 0:v.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:D,keyword:U,isComponentJsVersion:w})}):null]})})})]})},SearchWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_WIDGET));!element||element&&!element.length||element.map((item=>{var _a,_b,_c,_d;if(item){const WIDTH_ELEMENT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.WIDTH_ELEMENT),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_c.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_OTHER_INDEX_LIST),SEARCH_VIEW_MORE_RESULT=null==(_d=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchWidget,{width:WIDTH_ELEMENT||"",onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{suggestionKeywordList:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,otherIndexList:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,searchViewMoreResult:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null})})})}))}}))},InstantSearchInitSelector=()=>{ProductFilterWidgetInitSelector(),SearchResultWidgetInitSelector(),SearchIconWidgetInitSelector(),SearchIconWidgetPopupInitSelector(),SearchWidgetInitSelector()},SledgeContext=React.createContext({apiKey:"",instantSearchApiKey:"",userId:"",userEmail:"",userFullname:"",isRenderApp:{wishlist:!1,productReview:!1,instantSearch:!1},triggerRenderMultipleComponent:{wishlist:{badge:{trigger:()=>{},value:!1}},productReview:{rating:{trigger:()=>{},value:""}},instantSearch:{searchResult:{trigger:()=>{},value:""}}},sledgeAnonymId:"",isJsVersion:!1}),CustomComponents=e=>null,BadgeFloatingFull=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,position:a="left",dataSettings:d,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},[x,p]=React.useState(!1);React.useEffect((()=>{p(s&&u)}),[s]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating sledge-wishlist__badge-floating-${a}`,children:jsxRuntimeExports.jsxs("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:[jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-floating-text",children:"My Wishlist"}),jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[jsxRuntimeExports.jsx(HeartIcon,{width:18,height:18,type:"fill",color:"#000000"}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(r?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${r?"99+":o}`||0})]})]})})},BadgeFloatingIcon=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,position:a="bottom-right",dataSettings:d,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},[x,p]=React.useState(!1);React.useEffect((()=>{p(s&&u)}),[s]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating-icon sledge-wishlist__badge-floating-${a}`,children:jsxRuntimeExports.jsx("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[jsxRuntimeExports.jsx(HeartIcon,{width:27.01,height:25.73,type:"outline",color:"#000000"}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(r?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${r?"99+":o}`||0})]})})})},BadgeHeaderMenu=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,dataSettings:a,useProxyUrl:d}=e||{},{is_required_login:c}=(null==(t=null==a?void 0:a.display)?void 0:t.global)||{},u="#000000",[x,p]=React.useState(u),[m,g]=React.useState(!1);React.useEffect((()=>{g(s&&c)}),[s]);return jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge",onClick:e=>{m&&(e.preventDefault(),e.stopPropagation()),m?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):d&&(window.location.href=l||"/")},onMouseEnter:()=>p("#F85538"),onMouseLeave:()=>p(u),children:[jsxRuntimeExports.jsx(HeartIcon,{width:20,height:20,type:"outline",color:x}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-header-menu "+(r?"sledge-wishlist__badge-fit-content":""),children:n||m?0:`${r?"99+":o}`||0})]})},getWishlist=async(e,t)=>{const{page:s,limit:i,sort:n,keyword:o,shareId:r}=e||{};let l=t||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||""),a="?"+new URLSearchParams({page:s||"",limit:i||"",sort:n||"",keyword:o||"",share_id:r||""}).toString(),d=`${API_URL}/wishlist${a}`;return await fetchApi({url:d,method:"GET",authorization:l}).then((e=>e)).catch((()=>{}))},addWishlist=async e=>{const{productId:t,productVariantId:s,productName:i,productVendor:n,productSku:o,productVariantName:r,productLink:l,productImage:a,productCurrency:d,productPrice:c}=e;let u="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",x=`${API_URL}/wishlist`,p={product:JSON.stringify({id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,vendor:n,sku:o,variant_name:r,url:l,image_url:a,currency:d,price:c})};return await fetchApi({url:x,method:"POST",authorization:u,payload:p}).then((e=>e)).catch((()=>{}))},bulkAddWishlist=async e=>{let t="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",s=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:r,productCurrency:l,productPrice:a}=e;return{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,variant_name:n,url:o,image_url:r,currency:l,price:a}})),i=`${API_URL}/wishlist/bulk`,n={products:s};return await fetchApi({url:i,method:"POST",authorization:t,payload:n,headers:{"Content-Type":"application/json"},isSimpleRequest:!1}).then((e=>e)).catch((()=>{}))},getWishlistInfo=async e=>{let t=e||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||""),s=`${API_URL}/wishlist/info`;return await fetchApi({url:s,method:"GET",authorization:t}).then((e=>e)).catch((()=>{}))},checkWishlist=async(e,t)=>{let s=sanitizeDataId(e),i=t?sanitizeDataId(t):"",n="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",o="?"+new URLSearchParams({variant_id:i}).toString(),r=`${API_URL}/wishlist/check/${s}${o}`;return await fetchApi({url:r,method:"GET",authorization:n}).then((e=>Boolean(e.data))).catch((()=>{}))},clearWishlist=async()=>{let e="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",t=`${API_URL}/wishlist/clear`;return await fetchApi({url:t,method:"DELETE",authorization:e}).then((e=>e)).catch((()=>{}))},addToCartTrigger=async e=>{const{productId:t}=e;let s="undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",i=`${API_URL}/wishlist/cart`,n={product:JSON.stringify({id:sanitizeDataId(t)})};return await fetchApi({url:i,method:"POST",authorization:s,payload:n}).then((e=>e)).catch((()=>{}))},BadgeRoot=e=>{var t;const{children:s,useProxyUrl:i=!1,data:n}=e,{isRenderApp:o,triggerRenderMultipleComponent:r}=React.useContext(SledgeContext),{wishlist:l}=o||{},{value:a,trigger:d}=(null==(t=null==r?void 0:r.wishlist)?void 0:t.badge)||{},[c,u]=React.useState((null==n?void 0:n.total_data)||0),[x,p]=React.useState(!n),[m,g]=React.useState(!n),[_,R]=React.useState(!1),[E,h]=React.useState((null==n?void 0:n.proxy_url)||""),[j,v]=React.useState({}),T=async()=>{var e,t,s;let i,n,o,r=!1;i=await getWishlistInfo(),r=200===(null==(e=null==i?void 0:i.status)?void 0:e.code)||!1,n=(null==(t=null==i?void 0:i.data)?void 0:t.total_data)?i.data.total_data:0,o=(null==(s=null==i?void 0:i.data)?void 0:s.proxy_url)||"",r&&(u(n),R(n>99),h(o),p(!1),g(!1))};return React.useEffect((()=>{l&&(async e=>{let t;t=JSON.parse(e),t&&(v(t),await T())})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null)}),[l]),React.useEffect((()=>{a&&(d&&d(!1),T())}),[a]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(s)&&React.Children.map(s,(e=>React.cloneElement(e,{isFirstLoading:x,isLoading:m,totalWishlist:c,isMaximizeTotalWishlist:_,proxyUrl:E,dataSettings:j,useProxyUrl:i})))})},Badge=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Badge.Root=BadgeRoot,Badge.HeaderMenu=BadgeHeaderMenu,Badge.FloatingFull=BadgeFloatingFull,Badge.FloatingIcon=BadgeFloatingIcon;const BadgeInitSelector=()=>{const e=localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)?JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""):null;if(!e)return;const{floating_button_type:t}=(null==e?void 0:e.launch_point)||{},s=String(t).includes("bottom");if("none"!==t)if(s){let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_ICON),document.body.appendChild(e),e){e.innerHTML="";const s=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(s&&"true"===s),children:jsxRuntimeExports.jsx(Badge.FloatingIcon,{position:t})})})}))}}else{let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_FULL),document.body.appendChild(e),e){e.innerHTML="";const s=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(s&&"true"===s),children:jsxRuntimeExports.jsx(Badge.FloatingFull,{position:t})})})}))}}else{let e=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BADGE));if(!e||e&&!e.length)return;e.map((e=>{if(e){const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`)&&e.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET}"]`).remove();let s=document.createElement("div");s.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET),e.appendChild(s),client.createRoot(s).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(t&&"true"===t),children:jsxRuntimeExports.jsx(Badge.HeaderMenu,{})})})}))}}))}},ButtonDetail=e=>{var t,s,i,n,o,r;const{params:l,onAfterAddWishlist:a,onAfterRemoveWishlist:d}=e,{productId:c,productVariantId:u}=l||{},{isRenderApp:x,triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{wishlist:g}=x||{},{trigger:_}=(null==(t=null==p?void 0:p.wishlist)?void 0:t.badge)||{},[R,E]=React.useState(!0),[h,j]=React.useState(!0),[v,T]=React.useState(!1),[w,S]=React.useState({}),[A,f]=React.useState(!1),[C,L]=React.useState(!1),{is_required_login:I}=(null==(s=null==w?void 0:w.display)?void 0:s.global)||{},{type:N,icon:O,click_again_action:y,text_color:b,border_color:D,border_radius:P,padding_top:$,padding_bottom:U,padding_left:W,padding_right:k,background_color:M,font_size:F,font_weight:B,text_transform:H}=(null==(i=null==w?void 0:w.display)?void 0:i.button_detail)||{},{show:G,location:V}=(null==(n=null==w?void 0:w.display)?void 0:n.notification)||{},{before_adding_wishlist:Y,after_adding_wishlist:K,remove_from_wishlist:q}=(null==(o=null==w?void 0:w.languages)?void 0:o.button_detail)||{},{title_added_to_wishlist:z,text_added_to_wishlist:J,title_removed_to_wishlist:Z,text_removed_to_wishlist:Q}=(null==(r=null==w?void 0:w.languages)?void 0:r.notification)||{},X={...b&&{color:b},...D&&{borderColor:D},...P&&{borderRadius:P},...$&&{paddingTop:$},...U&&{paddingBottom:U},...W&&{paddingLeft:W},...k&&{paddingRight:k},...M&&{backgroundColor:M},...F&&{fontSize:F},...B&&{fontWeight:B},...H&&{textTransform:H}},ee=async()=>{let e;e=await checkWishlist(c,u),T(e)},te=async e=>{var t;if(e.preventDefault(),e.stopPropagation(),C)return void("undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}));f(!0),T(!v);let s=await addWishlist(l);200===(null==(t=null==s?void 0:s.status)?void 0:t.code)?(f(!1),_&&_(!0),BadgeInitSelector(),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistTriggerUpdate&&window.sledgeWishlistTriggerUpdate()),ee(),v?d&&d("success"):a&&a("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&G&&window.sledgeToastNotification({title:v?Z:z,message:v?Q:J,location:V,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(v?d&&d("failed"):a&&a("failed"),f(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&G&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:V,type:"failed"}))};React.useEffect((()=>{g&&("undefined"!=typeof window&&(window.sledgeWishlistButtonDetailUpdate=()=>{ee()}),(async e=>{let t;j(!0),t=JSON.parse(e),t&&(S(t),j(!1),E(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null))}),[g]),React.useEffect((()=>{L(m&&I)}),[m]),React.useEffect((()=>{ee()}),[u]);const se=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[N&&String(N).toLowerCase().includes("icon")&&(null==O?void 0:O.length)?jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail-icon",dangerouslySetInnerHTML:{__html:O},style:{fill:b}}):null,C?Y:N&&String(N).toLowerCase().includes("text")?A?v?"Adding...":"Removing...":v&&!y?K:v?q:Y:null]});return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-detail-wrapper",children:R?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"44px",rounded:"md",color:"lighten"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:N&&String(N).toLowerCase().includes("button")?jsxRuntimeExports.jsxs(Button,{type:"button",fullWidth:!0,style:X,...A||v&&!y?{disabled:!0}:{onClick:e=>te(e)},children:[A?jsxRuntimeExports.jsx(LoadingDots,{}):null,se]}):jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__widget-button-detail",style:X,...A||v&&!y?{disabled:!0}:{onClick:e=>te(e)},children:[A?jsxRuntimeExports.jsx(LoadingDots,{}):null,se]})})})},ButtonDetailInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BUTTON_DETAIL));!element||element&&!element.length||element.map((item=>{if(item){const PRODUCT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),PRODUCT_NAME=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_NAME),PRODUCT_VENDOR=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VENDOR),PRODUCT_SKU=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_SKU),PRODUCT_VARIANT_NAME=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_NAME),PRODUCT_LINK=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_LINK),PRODUCT_IMAGE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_IMAGE),PRODUCT_CURRENCY=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_CURRENCY),PRODUCT_PRICE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_PRICE),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(ButtonDetail,{params:{productId:PRODUCT_ID||"",productVariantId:PRODUCT_VARIANT_ID||"",productName:PRODUCT_NAME||"",productVendor:PRODUCT_VENDOR||"",productSku:PRODUCT_SKU||"",productVariantName:PRODUCT_VARIANT_NAME||"",productLink:PRODUCT_LINK||"",productImage:PRODUCT_IMAGE||"",productCurrency:PRODUCT_CURRENCY||"",productPrice:PRODUCT_PRICE||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})}})})}))}}))},Trigger=e=>{var t,s,i,n;const{params:o,forceActive:r=!1,hidden:l=!1,onAfterAddWishlist:a,onAfterRemoveWishlist:d,wishlistChecked:c}=e,{productId:u,productVariantId:x}=o||{},{isRenderApp:p,triggerRenderMultipleComponent:m,sledgeAnonymId:g}=React.useContext(SledgeContext),{wishlist:_}=p||{},{trigger:R}=(null==(t=null==m?void 0:m.wishlist)?void 0:t.badge)||{},E="#767676",h="outline",j="#F85538",v="fill",T="boolean"==typeof c,w=!!T&&c,[S,A]=React.useState(w?j:E),[f,C]=React.useState(w?v:h),[L,I]=React.useState(!!c),[N,O]=React.useState(!T),[y,b]=React.useState({}),[D,P]=React.useState({onAfterAddWishlist:a,onAfterRemoveWishlist:d}),[$,U]=React.useState(!1),[W,k]=React.useState(!0),{is_required_login:M}=(null==(s=null==y?void 0:y.display)?void 0:s.global)||{},{show:F,location:B}=(null==(i=null==y?void 0:y.display)?void 0:i.notification)||{},{title_added_to_wishlist:H,text_added_to_wishlist:G,title_removed_to_wishlist:V,text_removed_to_wishlist:Y}=(null==(n=null==y?void 0:y.languages)?void 0:n.notification)||{},K=async()=>{let e;"boolean"==typeof c&&W?(e=c,k(!1)):e=await checkWishlist(u,x),I(r||e)};React.useEffect((()=>{_&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{K()}),(async e=>{let t;O(!0),t=JSON.parse(e),t&&(b(t),O(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null))}),[_]),React.useEffect((()=>{U(g&&M)}),[g]),React.useEffect((()=>{_&&K()}),[_,x]);const q=(L||r)&&!$;return React.useEffect((()=>{q?(A(j),C(v)):(A(E),C(h))}),[L]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!N&&!l&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>(async e=>{if(e.preventDefault(),e.stopPropagation(),$)return void("undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}));I(!L);let t=await addWishlist(o);const{status:s,data:i}=t||{},{code:n}=s||{};200===n?(R&&R(!0),BadgeInitSelector(),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),K(),L?D.onAfterRemoveWishlist&&D.onAfterRemoveWishlist("success"):D.onAfterAddWishlist&&D.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&F&&window.sledgeToastNotification({title:L?V:H,message:L?Y:G,location:B,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(L?D.onAfterRemoveWishlist&&D.onAfterRemoveWishlist("failed"):D.onAfterAddWishlist&&D.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&F&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:B,type:"failed",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})}))})(e),onMouseEnter:()=>{q||(A(j),C(v))},onMouseLeave:()=>{q||(A(E),C(h))},children:jsxRuntimeExports.jsx(HeartIcon,{width:16.67,height:15.83,type:f,color:S})})})})},ElementInit=item=>{item.parentNode&&item.parentNode.classList.add("sledge-wishlist__trigger-parent-element"),item.classList.add("sledge-wishlist__trigger-wrapper");const PRODUCT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),PRODUCT_NAME=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_NAME),PRODUCT_VENDOR=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VENDOR),PRODUCT_SKU=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_SKU),PRODUCT_VARIANT_NAME=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_NAME),PRODUCT_LINK=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_LINK),PRODUCT_IMAGE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_IMAGE),PRODUCT_CURRENCY=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_CURRENCY),PRODUCT_PRICE=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_PRICE),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Trigger,{params:{productId:PRODUCT_ID||"",productVariantId:PRODUCT_VARIANT_ID||"",productName:PRODUCT_NAME||"",productVendor:PRODUCT_VENDOR||"",productSku:PRODUCT_SKU||"",productVariantName:PRODUCT_VARIANT_NAME||"",productLink:PRODUCT_LINK||"",productImage:PRODUCT_IMAGE||"",productCurrency:PRODUCT_CURRENCY||"",productPrice:PRODUCT_PRICE||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})}})})}))},TriggerInitSelector=()=>{new MutationObserver((function(e){e.forEach((function(e){Array.prototype.slice.call(e.addedNodes).forEach((function(e){if(1===e.nodeType&&e.querySelector(SELECTOR.WISHLIST.ELEMENT_TRIGGER)){let t=Array.from(e.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_TRIGGER));t.length&&t.map((e=>{ElementInit(e)}))}}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1});let e=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_TRIGGER));!e||e&&!e.length||e.map((e=>{ElementInit(e)}))},WidgetHeaderClearTrigger=({buttonText:e,shareId:t,dataSettings:s,isFirstLoading:i})=>{var n,o,r,l,a;const{sledgeAnonymId:d}=React.useContext(SledgeContext),{is_required_login:c}=(null==(n=null==s?void 0:s.display)?void 0:n.global)||{},{text_color:u,border_color:x,border_radius:p,padding_top:m,padding_bottom:g,padding_left:_,padding_right:R,background_color:E,font_size:h,font_weight:j,text_transform:v}=(null==(r=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:r.button_clear_all)||{},{title_confirm_clear_all_wishlist:T,text_confirm_clear_all_wishlist:w,button_submit_confirm_clear_all_wishlist:S,button_cancel_confirm_clear_all_wishlist:A}=(null==(l=null==s?void 0:s.languages)?void 0:l.popup)||{},{button_clear_all:f}=(null==(a=null==s?void 0:s.languages)?void 0:a.widget)||{},[C,L]=React.useState(!1),I={...u&&{color:u},...x&&{borderColor:x},...p&&{borderRadius:p},...m&&{paddingTop:m},...g&&{paddingBottom:g},..._&&{paddingLeft:_},...R&&{paddingRight:R},...E&&{backgroundColor:E},...h&&{fontSize:h},...j&&{fontWeight:j},...v&&{textTransform:v}};React.useEffect((()=>{L(d&&c)}),[d]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!C&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!t&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"lighten",rounded:"md"}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"danger",onClick:()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:T,message:w,textSubmit:S,textCancel:A,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:I,children:e||(f||"Clear Wishlist")})})})})})},WidgetHeaderShareTrigger=({wishlistData:e,buttonText:t,showShareTrigger:s,shareLink:i,shareId:n,dataSettings:o,isFirstLoading:r})=>{var l,a,d,c,u,x,p;const{triggerRenderMultipleComponent:m,sledgeAnonymId:g}=React.useContext(SledgeContext),{trigger:_}=(null==(l=null==m?void 0:m.wishlist)?void 0:l.badge)||{},{is_required_login:R}=(null==(a=null==o?void 0:o.display)?void 0:a.global)||{},{text_color:E,border_color:h,border_radius:j,padding_top:v,padding_bottom:T,padding_left:w,padding_right:S,background_color:A,font_size:f,font_weight:C,text_transform:L}=(null==(c=null==(d=null==o?void 0:o.display)?void 0:d.widget)?void 0:c.button_share)||{},{title_share_wishlist:I}=(null==(u=null==o?void 0:o.languages)?void 0:u.popup)||{},{button_share:N}=(null==(x=null==o?void 0:o.languages)?void 0:x.widget)||{},{title_added_all_to_wishlist:O,text_added_all_to_wishlist:y}=(null==(p=null==o?void 0:o.languages)?void 0:p.notification)||{},[b,D]=React.useState(!1),P={...E&&{color:E},...h&&{borderColor:h},...j&&{borderRadius:j},...v&&{paddingTop:v},...T&&{paddingBottom:T},...w&&{paddingLeft:w},...S&&{paddingRight:S},...A&&{backgroundColor:A},...f&&{fontSize:f},...C&&{fontWeight:C},...L&&{textTransform:L}},[$,U]=React.useState(!1);let W='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g id="vuesax/linear/copy">\n <g id="copy">\n <path id="Vector" d="M16 12.9V17.1C16 20.6 14.6 22 11.1 22H6.9C3.4 22 2 20.6 2 17.1V12.9C2 9.4 3.4 8 6.9 8H11.1C14.6 8 16 9.4 16 12.9Z" stroke="#767676" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path id="Vector_2" d="M22 6.9V11.1C22 14.6 20.6 16 17.1 16H16V12.9C16 9.4 14.6 8 11.1 8H8V6.9C8 3.4 9.4 2 12.9 2H17.1C20.6 2 22 3.4 22 6.9Z" stroke="#767676" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </g>\n </g>\n </svg>\n ';const k=async()=>{var t;U(!0);let s=e.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:r,currency:l,price:a}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:r,productCurrency:l,productPrice:a}})),i=await bulkAddWishlist(s);200===(null==(t=null==i?void 0:i.status)?void 0:t.code)?("undefined"!=typeof window&&(_&&_(!0),BadgeInitSelector(),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:O,message:y,textCancel:"Cancel"})),U(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return React.useEffect((()=>{D(g&&R)}),[g]),new MutationObserver((function(e){e.forEach((function(e){Array.prototype.slice.call(e.addedNodes).forEach((function(e){1===e.nodeType&&e.querySelector(".sledge-wishlist__widget-box-copy")&&(()=>{let e=!0;if(document.querySelector(".sledge-wishlist__widget-box-copy")&&e){e=!1;let t=document.querySelector(".sledge-wishlist__widget-box-copy-icon");null==t||t.addEventListener("click",(()=>{var e;let s=null==(e=document.querySelector(".sledge-wishlist__widget-box-copy-content"))?void 0:e.textContent;s&&(navigator.clipboard.writeText(s),t&&(t.classList.add("active"),t.innerHTML='<svg width="20" height="20" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>',setTimeout((()=>{t&&(t.classList.remove("active"),t.innerHTML=W)}),2500)))}))}})()}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!b&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:s&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:r?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"lighten",rounded:"md"}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:jsxRuntimeExports.jsx(Button,{type:"button",style:P,...n&&!e.length||$?{disabled:!0}:{onClick:async()=>{n&&e.length?window.sledgeConfirmationPopup({title:"Are you sure want to add this to your wishlist item?",message:`This action cannot be undone. This will adding <strong>${e.length}</strong> item to your wishlist page.`,textSubmit:"Add to your wishlist",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:k||{}}):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:I,message:i?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${W}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${i}</div>\n </div>`:"",textCancel:"Cancel"})}},children:n?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:e.length}),$?jsxRuntimeExports.jsx(LoadingDots,{}):null,"Add to your wishlist"]}):t||(N||"Share Wishlist")})})})})})},WidgetHeaderSearchForm=({setIsLoading:e,setKeyword:t,keyword:s,placeholder:i,dataSettings:n})=>{var o,r;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},{search_form_placeholder:d}=(null==(r=null==n?void 0:n.languages)?void 0:r.widget)||{},[c,u]=React.useState(!1),x=React.useRef(null);return React.useEffect((()=>{u(l&&a)}),[l]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!c&&jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:i||(d||"Search product..."),value:s,fieldRef:x,onChange:({value:e})=>(e=>{t&&t(e)})(e),onResetField:()=>{var s;e&&e(!0),t&&t(""),null==(s=null==x?void 0:x.current)||s.focus()},className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-search-form",withClearField:!0})})},WidgetHeaderTitle=({text:e,dataSettings:t})=>{var s,i,n;const{color:o,font_size:r,font_weight:l,text_transform:a}=(null==(i=null==(s=null==t?void 0:t.display)?void 0:s.widget)?void 0:i.header_title)||{},{header_title:d}=(null==(n=null==t?void 0:t.languages)?void 0:n.widget)||{},c={...o&&{color:o},...r&&{fontSize:r},...l&&{fontWeight:l},...a&&{textTransform:a}};return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx("h1",{style:c,children:e||(d||"My Wishlist")})})},WidgetHeaderLimit=({limitOptions:e,selectedLimit:t,setSelectedLimit:s,setIsRefreshWidgetList:i,dataSettings:n})=>{var o;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:l}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(r&&l)}),[r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&Boolean(null==e?void 0:e.length)&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx(SelectField,{align:"end",options:e.map((e=>({label:e,value:e}))),value:t||e[0],onChange:({value:e})=>(e=>{s&&s(e),i&&i(!0)})(e)})})})})},WidgetHeaderSort=({wishlistSort:e,selectedSort:t,setSelectedSort:s,setIsRefreshWidgetList:i,dataSettings:n})=>{var o;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:l}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(r&&l)}),[r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:a?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:e&&Boolean(null==e?void 0:e.length)&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx(SelectField,{align:"end",options:e.map((e=>{const{name:t,value:s}=e;return{label:t,value:s}})),value:t,onChange:({value:e})=>(e=>{s&&s(e),i&&i(!0)})(e),placeholder:"- Select -"})})})})},WidgetHeader=({isFirstLoading:e,...t})=>jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header",children:e?jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px",width:"100%",justifyContent:"space-between"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"440px",height:"46px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"lighten",rounded:"md"})]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"26px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"lighten",rounded:"md"})]})]}):React.Children.count(t.children)&&React.Children.map(t.children,(e=>React.cloneElement(e,{...t})))});WidgetHeader.Title=WidgetHeaderTitle,WidgetHeader.SearchForm=WidgetHeaderSearchForm,WidgetHeader.ShareTrigger=WidgetHeaderShareTrigger,WidgetHeader.ClearTrigger=WidgetHeaderClearTrigger,WidgetHeader.Sort=WidgetHeaderSort,WidgetHeader.Limit=WidgetHeaderLimit;const defaultGridType="large",WidgetList=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isLoading:i,wishlistData:n,dataSettings:o,gridType:r=defaultGridType}=e||{},{is_required_login:l}=(null==(t=null==o?void 0:o.display)?void 0:t.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(s&&l)}),[s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:8,type:r}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-wrapper",children:!(null==n?void 0:n.length)||a?jsxRuntimeExports.jsx(WidgetListEmpty,{...e,isRequiredLogin:a}):jsxRuntimeExports.jsx(ProductWrapper,{...e})})})},WidgetListEmpty=e=>{var t;const{onSearch:s,keyword:i,dataSettings:n,isRequiredLogin:o}=e||{},{title_no_result:r,text_no_result:l}=(null==(t=null==n?void 0:n.languages)?void 0:t.widget)||{},[a,d]=React.useState(""),[c,u]=React.useState(""),[x,p]=React.useState(!1),[m,g]=React.useState(""),[_,R]=React.useState("");return React.useEffect((()=>{o?(d("Login required!"),u("Please login to save your wishlist across devices."),p(!0),g("Login"),R("/account/login")):s||(d(i?"No products found":r),u(i?"Your search did not match any products. <br/> Please try again":l),p(!i),g("Continue Shopping"),R("/"))}),[s,n]),jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-product-empty",children:[jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-empty-icon",children:jsxRuntimeExports.jsx(HeartIcon,{width:32,height:32,type:"outline",color:"#000000"})}),jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-empty-title",dangerouslySetInnerHTML:{__html:a}}),jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-empty-description",dangerouslySetInnerHTML:{__html:c}}),x&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-wrapper",children:jsxRuntimeExports.jsxs("a",{href:_,className:"sledge__button sledge-wishlist__widget-product-empty-button-shopping","data-button-color-type":"light",children:[jsxRuntimeExports.jsx("span",{children:m})," ",jsxRuntimeExports.jsx(ArrowRightIcon,{width:16.195,height:16.195,color:"black"})]})})]})},ProductWrapper=e=>{var t,s,i,n,o,r,l,a;const{isJsVersion:d}=React.useContext(SledgeContext),{wishlistData:c,currentPage:u,setCurrentPage:x,totalPage:p,shareId:m,dataSettings:g,gridType:_=defaultGridType,productCardsComponent:R,onAfterAddToCart:E,onAfterAddWishlist:h,onAfterRemoveWishlist:j,onAfterRenderProduct:v,dataReviews:T}=e||{},{show_add_to_cart:w,redirect_add_to_cart:S}=(null==(t=null==g?void 0:g.display)?void 0:t.widget)||{},{text_color:A,border_color:f,border_radius:C,padding_top:L,padding_bottom:I,padding_left:N,padding_right:O,background_color:y,font_size:b,font_weight:D,text_transform:P}=(null==(i=null==(s=null==g?void 0:g.display)?void 0:s.widget)?void 0:i.button_add_to_cart)||{},{color:$,font_size:U,font_weight:W,text_transform:k}=(null==(o=null==(n=null==g?void 0:g.display)?void 0:n.widget)?void 0:o.price)||{},{color:M,font_size:F,font_weight:B,text_transform:H}=(null==(l=null==(r=null==g?void 0:g.display)?void 0:r.widget)?void 0:l.product_name)||{},{button_add_to_cart:G}=(null==(a=null==g?void 0:g.languages)?void 0:a.widget)||{},V={...A&&{color:A},...f&&{borderColor:f},...C&&{borderRadius:C},...L&&{paddingTop:L},...I&&{paddingBottom:I},...N&&{paddingLeft:N},...O&&{paddingRight:O},...y&&{backgroundColor:y},...b&&{fontSize:b},...D&&{fontWeight:D},...P&&{textTransform:P}},Y={...$&&{color:$},...U&&{fontSize:U},...W&&{fontWeight:W},...k&&{textTransform:k}},K={...M&&{color:M},...F&&{fontSize:F},...B&&{fontWeight:B},...H&&{textTransform:H}};let q=u||0,z=p||0;const[J,Z]=React.useState(!1),[Q,X]=React.useState(!1);React.useEffect((()=>{X(!(z===q&&!J)&&z>=q)}),[J]),React.useEffect((()=>{Z(!1)}),[c]);let ee={};for(const te of c)ee[te.product.id]=!0;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==c?void 0:c.length)?jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"wishlist",type:_,data:c.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:r,currency:l,price:a,vendor:d,sku:c,variants:u,...x}=(null==e?void 0:e.product)||{},p=new URL(o).pathname.split("/"),m=p[p.length-1];return{product:{id:t,admin_graphql_api_id:`${SHOPIFY_GID_PRODUCT_ID}${t}`,handle:m,title:i,image:{src:r},url:o,vendor:d,currency:l,...x},variants:u}})),setting:{show_vendor:!0,show_sku:!0,show_price:!0,show_add_to_cart:w,redirect_add_to_cart:S,language_button_add_to_cart:G,display_product_name_style:K,display_price_style:Y,display_button_add_to_cart_style:V},showOptionOutOfStock:!1,triggerPropAdditional:{forceActive:!0,...m&&{hidden:!0}},isComponentJsVersion:d,cards:R,onAfterAddToCart:E,onAfterAddWishlist:h,onAfterRemoveWishlist:j,onAfterRenderProduct:v,dataReviews:T,dataWishlists:ee}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),Q&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-load-more",children:jsxRuntimeExports.jsx(Button,{type:"button",role:"button",colorType:"light",disabled:J,onClick:()=>{x&&u&&x(u+1),Z(!0)},style:{...J&&{cursor:"wait"}},children:J?"Loading...":"Load More"})})]})},WidgetRoot=e=>{var t,s;const{children:i,query:n,params:o,customRoutePage:r,onAfterAddToCart:l,onAfterAddWishlist:a,onAfterRemoveWishlist:d,onAfterRenderProduct:c,data:u,dataInfo:x,dataReviews:p,limitOptions:m=DEFAULT_LIMIT_VALUE}=e,{shareId:g="share"}=n||{},{isRenderApp:_,triggerRenderMultipleComponent:R,sledgeAnonymId:E,isJsVersion:h}=React.useContext(SledgeContext),{wishlist:j}=_||{},{trigger:v}=(null==(t=null==R?void 0:R.wishlist)?void 0:t.badge)||{},[T,w]=React.useState(!u),[S,A]=React.useState(!u),[f,C]=React.useState((null==u?void 0:u.data)||[]),[L,I]=React.useState((null==u?void 0:u.sorts)||[]),[N,O]=React.useState(!1),[y,b]=React.useState(""),[D,P]=React.useState(m[0]),[$,U]=React.useState(""),[W,k]=React.useState(1),[M,F]=React.useState((null==(s=null==u?void 0:u.page)?void 0:s.total_page)||0),[B,H]=React.useState(!1),[G,V]=React.useState(!!u),[Y,K]=React.useState(""),[q,z]=React.useState(null),[J,Z]=React.useState(""),[Q,X]=React.useState({}),[ee,te]=React.useState(!!u),se=usePrevious({keyword:$,currentPage:W}),ie=async(e=!1,t=!1)=>{var s,i,n,r;const l=new URLSearchParams(document.location.search),a=(null==o?void 0:o.shareId)?o.shareId:(null==l?void 0:l.get(g))||"";let d;A(!!N||!e),e||(k(1),C([]));let c,x,p=!1,m=0,_={page:e?W:1,limit:D,sort:y,keyword:$,shareId:a};d=u&&t?u:await getWishlist(_),p=200===(null==(s=null==d?void 0:d.status)?void 0:s.code)||!1,c=(null==(i=d.data)?void 0:i.length)?t=>(null==f?void 0:f.length)&&e?[...t,...d.data]:d.data:[],x=(null==(n=d.sorts)?void 0:n.length)?d.sorts:[],m=(null==(r=null==d?void 0:d.page)?void 0:r.total_page)||1,p&&(C(c),I(x),F(m),A(!1),O(!1))};React.useEffect((()=>{if(!j)return;let e=Boolean(se&&(null==se?void 0:se.currentPage)!==W);if(se&&(null==se?void 0:se.keyword)!==$){H(!0);const e=setTimeout((()=>{H(!1),ie()}),500);return()=>clearTimeout(e)}ie(e,!0)}),[j,$,W]),React.useEffect((()=>{j&&N&&ie()}),[N]),React.useEffect((()=>{if(!j)return;const e=new URLSearchParams(document.location.search);z((null==o?void 0:o.shareId)?o.shareId:(null==e?void 0:e.get(g))||""),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate=()=>{ie()},window.sledgeWishlistWidgetClearList=()=>{(async()=>{var e;let t;A(!0);let s=!1;t=await clearWishlist(),s=200===(null==(e=null==t?void 0:t.status)?void 0:e.code),s?(await ie(),v&&v(!0),BadgeInitSelector()):"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed clear all wishlist",type:"failed"})})()}),(async()=>{var e,t,s,i;let n;V(!1);let o,l,a,d=!1;x?(n={data:x},d=!0):(n=await getWishlistInfo(),d=200===(null==(e=null==n?void 0:n.status)?void 0:e.code)||!1),o=(null==(t=null==n?void 0:n.data)?void 0:t.proxy_url)||"",a=(null==(s=null==n?void 0:n.data)?void 0:s.share_id)||"",l=r?`${r}?${g}=${a}`:null==(i=null==n?void 0:n.data)?void 0:i.share_link,d&&(Z(o),K(window.location.origin+l),V(!0))})(),(async e=>{let t;t=JSON.parse(e),t&&X(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null),w(!1)}),[j]),React.useEffect((()=>{var e;const{is_required_login:t}=(null==(e=null==Q?void 0:Q.display)?void 0:e.global)||{};te(E&&!t)}),[E,Q]);let ne=null,oe=null;React.Children.map(i,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,wishlistWidgetAlert:s}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(ne=t),s&&isFunction(s)&&(oe=s)}}));const re=oe;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-wrapper",children:[ee&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:T?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"99.5%",height:"72px",color:"lighten",rounded:"none",style:{margin:"0 auto"}}):re?jsxRuntimeExports.jsx(React.Fragment,{children:h?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:re()}}):jsxRuntimeExports.jsx(re,{})}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-alert",children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-alert-text",children:["Please login to save your wishlist across devices."," ",jsxRuntimeExports.jsx("a",{href:"/account/login",className:"sledge-wishlist__widget-alert-link",children:"Login Here"})]})})}),React.Children.count(i)&&React.Children.map(i,(e=>React.cloneElement(e,{isLoading:S,isFirstLoading:T,wishlistData:f,wishlistSort:L,selectedSort:y,selectedLimit:D,keyword:$,currentPage:W,totalPage:M,limitOptions:m,onSearch:B,showShareTrigger:G,shareLink:Y,shareId:q,proxyUrl:J,dataSettings:Q,productCardsComponent:ne,query:n,setIsLoading:A,setIsRefreshWidgetList:O,setSelectedSort:b,setSelectedLimit:P,setKeyword:U,setCurrentPage:k,onAfterAddToCart:l,onAfterAddWishlist:a,onAfterRemoveWishlist:d,onAfterRenderProduct:c,dataReviews:p})))]})})},Widget=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Widget.Root=WidgetRoot,Widget.Header=WidgetHeader,Widget.List=WidgetList;const WidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_WIDGET));!element||element&&!element.length||element.map((item=>{var _a,_b;if(item){const SHARE_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.SHARE_ID),QUERY_SHARE_ID=item.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.QUERY_SHARE_ID),CUSTOM_ROUTE_PAGE=item.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.CUSTOM_ROUTE_PAGE),LIMIT_OPTIONS=item.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.LIMIT_OPTIONS),ON_AFTER_ADD_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=item.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),WISHLIST_WIDGET_ALERT=null==(_b=item.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.RENDER_WISHLIST_WIDGET_ALERT);item.innerHTML="",client.createRoot(item).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsxs(Widget.Root,{customRoutePage:CUSTOM_ROUTE_PAGE||"",query:{shareId:QUERY_SHARE_ID||""},params:{shareId:SHARE_ID||""},...LIMIT_OPTIONS&&String(LIMIT_OPTIONS).includes(",")?{limitOptions:String(LIMIT_OPTIONS).replaceAll(" ","").split(",")}:{},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({state:state})},children:[jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,wishlistWidgetAlert:WISHLIST_WIDGET_ALERT?eval(WISHLIST_WIDGET_ALERT):null}),jsxRuntimeExports.jsxs(Widget.Header,{children:[jsxRuntimeExports.jsx(WidgetHeader.Title,{text:"My Wishlist"}),jsxRuntimeExports.jsx(WidgetHeader.SearchForm,{placeholder:"Search product"}),jsxRuntimeExports.jsx(WidgetHeader.ClearTrigger,{buttonText:"Clear Wishlist"}),jsxRuntimeExports.jsx(WidgetHeader.ShareTrigger,{buttonText:"Share Wishlist"}),jsxRuntimeExports.jsx(WidgetHeader.Sort,{}),jsxRuntimeExports.jsx(WidgetHeader.Limit,{})]}),jsxRuntimeExports.jsx(Widget.List,{gridType:"large"})]})})}))}}))},WishlistInitSelector=()=>{BadgeInitSelector(),TriggerInitSelector(),WidgetInitSelector(),ButtonDetailInitSelector()},ProductCard=e=>{var t,s,i;const{item:n,handleAddToCart:o,clickedAddToCartId:r,setting:l,showOptionOutOfStock:a=!1,triggerPropAdditional:d,sourceApp:c=null,isComponentJsVersion:u=!1,cards:x,onAfterAddWishlist:p,onAfterRemoveWishlist:m,showPopupComponent:g,setShowPopupComponent:_,dataReviews:R,dataWishlists:E}=e,{show_vendor:h=!0,show_sku:j=!0,show_price:v=!0,show_add_to_cart:T=!0,language_button_add_to_cart:w="Add To Cart",display_product_name_style:S={},display_price_style:A={},display_button_add_to_cart_style:f={}}=l||{},{product:C,variants:L}=n||{},{id:I,title:N,image:O,url:y,vendor:b="",currency:D,handle:P}=C||{},{id:$="",admin_graphql_api_id:U="",title:W="",price:k="",sku:M=""}=(null==L?void 0:L.length)?L[0]:{},F=U||"",B=(null==L?void 0:L.length)&&Object.hasOwn(L[0],"inventory_quantity")?L[0].inventory_quantity:0,[H,G]=React.useState(F),[V,Y]=React.useState(B);let K=r==H,q=!(!(null==L?void 0:L.length)||!Object.hasOwn(L[0],"inventory_quantity"))&&(!Number(V)&&a),z=null;if(x){const e={product:{...C,variants:L.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(L[t],"inventory_quantity")&&!s}})),...R&&Object.keys(R).length?{review:{total:(null==(t=null==R?void 0:R[I])?void 0:t.review_count)?null==R?void 0:R[I].review_count:0,average:(null==(i=null==(s=null==R?void 0:R[I])?void 0:s.rating)?void 0:i.average)?null==R?void 0:R[I].rating.average:0}}:{}},showPopupComponent:g,setShowPopupComponent:_,sourceApp:c};z=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:u?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:x({...e})}}):jsxRuntimeExports.jsx(x,{...e})})}else{let e=function(){(null==L?void 0:L.length)&&(r["data-product-id"]=I,r["data-product-handle"]=P,r["data-selected-option1"]=L[0].option1,L[0].option2&&(r["data-selected-option2"]=L[0].option2),r["data-variant-id"]=L[0].admin_graphql_api_id,r["data-inventory-quantity"]=L[0].inventory_quantity)},t=function(e,t){const s=e.target.offsetParent.querySelector(`.options-button-${t}`).querySelectorAll("button"),i=()=>{s.forEach(((t,s)=>{t.classList.remove("sledge__product-variant-size-swatch-active"),e.target.className+=" sledge__product-variant-size-swatch-active"}))};if("Color"===t)s.forEach(((t,s)=>{t.classList.remove("sledge__product-variant-color-swatch-active"),e.target.className+=" sledge__product-variant-color-swatch-active"}));else i()},s=function(e,t,s){var i,n;const o=e.target.offsetParent,r=o.querySelector(`.sledge__product-grid-card-selected-option[data-product-id='${I}']`);r.attributes[`data-selected-option${s}`].value=t;const l=`[data-option-1="${r.attributes["data-selected-option1"].value}"]`,a=""+(r.attributes["data-selected-option2"]?`[data-option-2="${r.attributes["data-selected-option2"].value}"]`:""),d=o.querySelector(`select option${l}${a}`),c=d.attributes["data-graphql-id"].value,u=null==(i=d.attributes["data-image-id"])?void 0:i.value,x=null==(n=d.attributes["data-inventory-quantity"])?void 0:n.value;r.attributes["data-variant-id"].value=d.attributes["data-graphql-id"].value,r.attributes["data-inventory-quantity"].value=x,c&&G(c),x&&Y(x),u&&(o.querySelector("img.sledge__product-grid-card-image-featured-image").src=o.querySelector(`div.sledge__product-grid-card-variant-images img[id="${u}"]`).src);return{variantId:c,imageId:u}};const i=(null==C?void 0:C.options)?Object.entries(C.options):[],n=(null==C?void 0:C.images)??[],r={};e(),z=jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image",children:[jsxRuntimeExports.jsxs("a",{href:y,onClick:()=>"instant-search"===c&&productClickTrigger({productId:I}),children:[jsxRuntimeExports.jsx(Trigger,{params:{productId:I,productVariantId:$,productName:N,productVendor:b,productSku:M,productVariantName:W,productLink:y,productImage:(null==O?void 0:O.src)||`${API_URL}/img/blank-image.png`,productCurrency:D,productPrice:k},...d,onAfterAddWishlist:p,onAfterRemoveWishlist:m,wishlistChecked:null==E?void 0:E[I]}),jsxRuntimeExports.jsx("img",{src:(null==O?void 0:O.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy",className:"sledge__product-grid-card-image-featured-image"}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-variant-images",children:null==n?void 0:n.map((e=>jsxRuntimeExports.jsx("img",{decoding:"async",id:null==e?void 0:e.id,height:"270",loading:"lazy",src:null==e?void 0:e.src,alt:null==C?void 0:C.title,width:269.92,style:{aspectRatio:269.92/270}},null==e?void 0:e.id)))})]}),q?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-out-of-stock",children:"Sold out"}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[v?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:jsxRuntimeExports.jsxs("p",{style:A,children:[D,k]})}):null,h&&b?jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-badge-vendor",title:b,children:["Vendor: ",b]}):null]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(Rating,{params:{productId:I},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1,data:null==R?void 0:R[I]})}),N?jsxRuntimeExports.jsx("a",{href:y,onClick:()=>"instant-search"===c&&productClickTrigger({productId:I}),children:jsxRuntimeExports.jsx("h3",{className:"sledge__product-grid-card-product-name",style:S,children:N})}):null,jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:j&&M?jsxRuntimeExports.jsxs("div",{children:["SKU: ",M]}):null}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-variant-swatch",children:[jsxRuntimeExports.jsx("input",{type:"hidden",...r,className:"sledge__product-grid-card-selected-option"}),jsxRuntimeExports.jsx("select",{className:"variant-picker sledge__product-grid-card-variant-picker",children:null==L?void 0:L.map((e=>{const{title:t,option1:s,option2:i,position:n,id:o,admin_graphql_api_id:r,image_id:l,inventory_quantity:a}=e;let d={"data-option-1":s,"data-option-2":i,"data-inventory-quantity":a,"data-position":n,"data-id":o,"data-graphql-id":r,"data-image-id":l};return jsxRuntimeExports.jsx("option",{...d,children:t},o)}))}),null==i?void 0:i.map(((e,i)=>{const n=e[0],o=e[1];let r=o[0];return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"Default Title"!==o[0]&&jsxRuntimeExports.jsx("div",{className:`sledge__product-variant-size-swatch-flex options-button-${n}`,children:o.map(((e,o)=>{const l=`\n${r===e?"sledge__product-variant-size-swatch-active":""} sledge__product-variant-size-swatch`,a=(r===e?"sledge__product-variant-color-swatch-active":"")+" sledge__product-variant-color-swatch";return jsxRuntimeExports.jsx("button",{type:"button",className:"Color"===n?a:l,style:{backgroundColor:"Color"===n?e:null},onClick:o=>{s(o,e,i+1),t(o,n)},title:"Color"===n?null:e,children:"Color"===n?null:e},o)}))},i)})}))]})]})]}),T?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",style:{...f,...K&&{cursor:"wait"}},...K||q?{disabled:!0}:{onClick:()=>{o&&o({id:H,quantity:1})}},children:q?"Sold out":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K?jsxRuntimeExports.jsx(LoadingDots,{}):null,jsxRuntimeExports.jsx("span",{children:w||"Add To Cart"})]})})}):null]})}return jsxRuntimeExports.jsx(React.Fragment,{children:z},I)},ProductGrid=e=>{const{type:t,className:s="",data:i,setting:n,sourceApp:o=null,onAfterAddToCart:r,onAfterRenderProduct:l}=e,{redirect_add_to_cart:a=!0}=n||{},[d,c]=React.useState(null),u=async e=>{var t;const{id:s,quantity:i}=e;c(s);let n=await addToCart([{id:s,quantity:i}]);(null==(t=null==n?void 0:n.items)?void 0:t.length)?("wishlist"===o?await addToCartTrigger({productId:s}):"instant-search"===o&&await addToCartTrigger$1({productId:s}),c(null),r&&r("success"),a?window.location.href="/cart":window.sledgeToastNotification({title:"Cart added",message:"Successfully added to wishlist",type:"success",icon:jsxRuntimeExports.jsx(BagIcon,{width:40,height:40,color:"black"})})):(r&&r("failed"),setTimeout((()=>{var e;c(null),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:(null==(e=null==n?void 0:n.description)?void 0:e.length)?n.description:"failed add to cart, please try again",type:"failed",icon:jsxRuntimeExports.jsx(BagIcon,{width:40,height:40,color:"black"})})}),1e3))};return React.useEffect((()=>{l&&l("success")}),[]),jsxRuntimeExports.jsx("div",{className:`sledge__product-grid ${s}`,"data-grid-type":t,children:null==i?void 0:i.map(((t,s)=>jsxRuntimeExports.jsx(ProductCard,{item:t,handleAddToCart:u,clickedAddToCartId:d,...e},`sledge-product-card_${s}`)))})},TextAreaField$1="",TextAreaField=e=>{const{className:t="",value:s="",onChange:i,required:n,...o}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__text-area-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField FormTextArea",name:"review",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__text-area-field-control",children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("textarea",{className:"sledge__text-area-field",value:s,onChange:e=>(e=>{i&&i(e)})(e),rows:6,maxLength:1e3,required:n,...o})}),jsxRuntimeExports.jsxs("div",{className:"sledge__text-area-field-counter",children:[null==s?void 0:s.length,"/",1e3]})]}),n&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"valueMissing",children:"Required field"})]})})},InputField$1="",InputField=e=>{const{className:t="",value:s="",onChange:i,required:n,type:o,name:r="",...l}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__input-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField",name:r,children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("input",{className:"sledge__input-field",type:o,value:s,onChange:e=>(e=>{i&&i(e)})(e),...n?{required:n}:{},...l})}),n&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"valueMissing",children:"Required field"}),"email"===o&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"typeMismatch",children:"Please fill a valid email address"})]})})},CollectionGrid$1="",CollectionGrid=({className:e="",data:t,cards:s,isComponentJsVersion:i,onAfterRenderCollection:n})=>(React.useEffect((()=>{n&&n("success")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?jsxRuntimeExports.jsx("div",{className:`sledge__collection-grid ${e}`,children:t.map(((e,t)=>{const{id:n,title:o,body_html:r,url:l,image:a}=e;if(s){const n={data:e};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s({...n})}}):jsxRuntimeExports.jsx(s,{...n})},t)}return jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image-wrapper",children:jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:(null==a?void 0:a.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:o}),r?jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",dangerouslySetInnerHTML:{__html:r}}):null]})]})},t)}))}):null})),PageGrid$1="",PageGrid=({className:e="",data:t,cards:s,isComponentJsVersion:i,onAfterRenderPage:n})=>(React.useEffect((()=>{n&&n("success")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?jsxRuntimeExports.jsx("div",{className:`sledge__page-grid ${e}`,children:t.map(((e,t)=>{const{id:n,title:o,body_html:r,url:l,image:a}=e;if(s){const n={data:e};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s({...n})}}):jsxRuntimeExports.jsx(s,{...n})},t)}return jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image-wrapper",children:jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:(null==a?void 0:a.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:o}),r?jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",dangerouslySetInnerHTML:{__html:r}}):null]})]})},t)}))}):null})),BlogGrid$1="",BlogGrid=({className:e="",data:t,cards:s,isComponentJsVersion:i,onAfterRenderBlog:n})=>(React.useEffect((()=>{n&&n("success")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?jsxRuntimeExports.jsx("div",{className:`sledge__blog-grid ${e}`,children:null==t?void 0:t.map(((e,t)=>{const{id:n,title:o,created_at:r,url:l,image:a}=e;if(s){const n={data:e};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s({...n})}}):jsxRuntimeExports.jsx(s,{...n})},t)}return jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image",children:jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsx("img",{src:(null==a?void 0:a.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-title",children:o})}),r?jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-badge-vendor",children:convertDate(r)}):null]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"light",children:[jsxRuntimeExports.jsx(NoteIcon,{width:16,height:16,color:"#000000"}),jsxRuntimeExports.jsx("span",{children:"View Blog"})]})})})]},t)}))}):null})),ArticleGrid$1="",ArticleGrid=({className:e="",data:t,cards:s,isComponentJsVersion:i,onAfterRenderArticle:n})=>(React.useEffect((()=>{n&&n("success")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==t?void 0:t.length)?jsxRuntimeExports.jsx("div",{className:`sledge__article-grid ${e}`,children:null==t?void 0:t.map(((e,t)=>{const{id:n,title:o,created_at:r,summary_html:l,url:a,image:d}=e;if(s){const n={data:e};return jsxRuntimeExports.jsx(React.Fragment,{children:i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:s({...n})}}):jsxRuntimeExports.jsx(s,{...n})},t)}return jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-image",children:jsxRuntimeExports.jsx("a",{href:a,children:jsxRuntimeExports.jsx("img",{src:(null==d?void 0:d.src)||`${API_URL}/img/blank-image.png`,alt:"sledge-card-image",loading:"lazy"})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card-desc",children:[jsxRuntimeExports.jsx("a",{href:a,children:jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-title",children:o})}),r?jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-badge-vendor",children:convertDate(r)}):null,l?jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-text",dangerouslySetInnerHTML:{__html:l}}):null]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-button-wrapper",children:jsxRuntimeExports.jsx("a",{href:a,children:jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"light",children:[jsxRuntimeExports.jsx(NoteIcon,{width:16,height:16,color:"#000000"}),jsxRuntimeExports.jsx("span",{children:"View Article"})]})})})]},t)}))}):null})),Tooltip$1="",Tooltip=({children:e,content:t,withArrow:s=!0,customArrow:i="",sideOffset:n=5,alignOffset:o=0,wrapTrigger:r=!0})=>{const[l,a]=React.useState(!1);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".sledge__tooltip-arrow"))?void 0:e.parentElement;t&&(null==i?void 0:i.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=i)}),[l]),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:a,children:[jsxRuntimeExports.jsx($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:r?jsxRuntimeExports.jsx("span",{children:e}):e}),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:n,alignOffset:o,children:[t,s?jsxRuntimeExports.jsx($a093c7e1ec25a057$export$21b07c8f274aebd5,{className:"sledge__tooltip-arrow"}):null]})})]})})},ScrollArea$1="",ScrollArea=({children:e,isLoading:t=!1,className:s=""})=>jsxRuntimeExports.jsxs($57acba87d6e25586$export$be92b6f5f03c0fe9,{className:`sledge__scroll-area-root ${s}`,children:[jsxRuntimeExports.jsx($57acba87d6e25586$export$d5c6c08dc2d3ca7,{className:"sledge__scroll-area-viewport "+(t?"sledge__scroll-area-viewport-loading":""),children:e}),!t&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx($57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"vertical",children:jsxRuntimeExports.jsx($57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})}),jsxRuntimeExports.jsx($57acba87d6e25586$export$9a4e88b92edfce6b,{className:"sledge__scroll-area-scrollbar",orientation:"horizontal",children:jsxRuntimeExports.jsx($57acba87d6e25586$export$6521433ed15a34db,{className:"sledge__scroll-area-thumb"})})]})]}),SkeletonLoading$1="",SkeletonItem=({width:e,height:t,rounded:s,color:i,style:n={},className:o="",...r})=>{var l,a,d,c,u;const[x,p]=React.useState({});return React.useEffect((()=>{(async e=>{let t;t=JSON.parse(e),t&&p(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING)||null)}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==(l=null==x?void 0:x.skeleton)?void 0:l.enable)?jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item sledge__skeleton-item-animation ${o}`,style:{width:e,height:t,...(null==(d=null==(a=null==x?void 0:x.skeleton)?void 0:a.colors)?void 0:d.main_color)&&{background:null==(u=null==(c=null==x?void 0:x.skeleton)?void 0:c.colors)?void 0:u.main_color},...n},"data-skeleton-rounded":s,"data-skeleton-color":i,...r}):null})},SkeletonProductGrid=({count:e,type:t})=>{let s=[];for(let i=0;i<e;i++)s.push(jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-image sledge__skeleton-product-grid-card-image",children:[jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"32px",height:"32px",color:"darken",rounded:"sm"})}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"28px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonItem,{width:"80px",height:"28px",color:"lighten",rounded:"md"})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"134px",height:"25px",color:"lighten",rounded:"md"})}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"35px",color:"lighten",rounded:"md",style:{marginBottom:"16px"}})})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},i));return jsxRuntimeExports.jsx("div",{className:"sledge__product-grid sledge__skeleton-product-grid sledge__skeleton-pointer-events-none","data-grid-type":t,children:s})},SkeletonReviewGrid=({count:e,type:t,gridItemHeights:s=[]})=>{let i=[];for(let n=0;n<e;n++)i.push(jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"list"===t||"grid"===t&&!(null==s?void 0:s.length)?"111px":s[n],color:"lighten",rounded:"md"})},n));return jsxRuntimeExports.jsx(MasonryResponsive,{columnsCountBreakPoints:"grid"===t?{350:1,750:3,1024:4}:{350:1},className:"sledge-product-review__widget-review-grid sledge__skeleton-review-grid sledge__skeleton-pointer-events-none",children:jsxRuntimeExports.jsx(Masonry,{gutter:"30px",children:i})})},SkeletonCollectionGrid=({count:e})=>{let t=[];for(let s=0;s<e;s++)t.push(jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card",children:jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"139px",height:"32px",color:"darken",rounded:"md"})}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"238px",height:"48px",color:"darken",rounded:"md"})})]})},s));return jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid sledge__skeleton-collection-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonPageGrid=({count:e})=>{let t=[];for(let s=0;s<e;s++)t.push(jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card",children:jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"139px",height:"32px",color:"darken",rounded:"md"})}),jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"238px",height:"48px",color:"darken",rounded:"md"})})]})},s));return jsxRuntimeExports.jsx("div",{className:"sledge__page-grid sledge__skeleton-page-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonBlogGrid=({count:e})=>{let t=[];for(let s=0;s<e;s++)t.push(jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-image sledge__skeleton-blog-grid-card-image",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"26px",color:"lighten",rounded:"md",style:{marginTop:"12px",marginBottom:"16px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"72px",color:"lighten",rounded:"md"})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},s));return jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonArticleGrid=({count:e})=>{let t=[];for(let s=0;s<e;s++)t.push(jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-card-image sledge__skeleton-article-grid-card-image",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0}})}),jsxRuntimeExports.jsxs("div",{className:"sledge__article-grid-card-desc",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonItem,{width:"79px",height:"26px",color:"lighten",rounded:"md",style:{marginTop:"12px",marginBottom:"16px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"72px",color:"lighten",rounded:"md"})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__article-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md"})})]},s));return jsxRuntimeExports.jsx("div",{className:"sledge__article-grid sledge__skeleton-article-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonLoading={Item:SkeletonItem,ReviewGrid:SkeletonReviewGrid,ProductGrid:SkeletonProductGrid,CollectionGrid:SkeletonCollectionGrid,PageGrid:SkeletonPageGrid,BlogGrid:SkeletonBlogGrid,ArticleGrid:SkeletonArticleGrid},LoadingDots$1="",LoadingDots=()=>jsxRuntimeExports.jsxs("div",{className:"sledge__loading-dots",children:[jsxRuntimeExports.jsx("div",{className:"sledge__loading-icon-dot"}),jsxRuntimeExports.jsx("div",{className:"sledge__loading-icon-dot"}),jsxRuntimeExports.jsx("div",{className:"sledge__loading-icon-dot"})]});let countFetchToken=3,runApps=!1;const consoleErrorStyle="color: white; background: black; border: 1px solid white; padding: 2px 5px; border-radius: 360px;";documentReady((async()=>{var e,t,s;"undefined"!=typeof window&&(window.sledgeCommonModule={addToCartTrigger:async({sourceApp:e,productId:t})=>{var s;let i={};return"wishlist"===e?i=await addToCartTrigger({productId:t}):"instant-search"===e&&(i=await addToCartTrigger$1({productId:t})),200===(null==(s=null==i?void 0:i.status)?void 0:s.code)},productClickTrigger:async({sourceApp:e,productId:t})=>{var s;let i={};return"instant-search"===e&&(i=await productClickTrigger({productId:t})),200===(null==(s=null==i?void 0:i.status)?void 0:s.code)}});let i=document.querySelector(`script[id="${SCRIPT_EMBED_ID}"]`);const n=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.API_KEY),o=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.INSTANT_SEARCH_API_KEY),r=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_ID),l=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_EMAIL),a=null==i?void 0:i.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_FULLNAME);let d=await getToken({API_KEY:n||"",INSTANT_SEARCH_API_KEY:o||"",USER_ID:r||"",USER_EMAIL:l||"",USER_FULLNAME:a||""});for(let c=1;c<=countFetchToken;c++)if(runApps||(null==(e=null==d?void 0:d.data)?void 0:e.token))runApps=!0;else{if(console.error("%cSledge",consoleErrorStyle,`${(null==(t=null==d?void 0:d.status)?void 0:t.code)?null==(s=null==d?void 0:d.status)?void 0:s.message:d}`),c===countFetchToken)return;localStorage.removeItem(LOCAL_STORAGE_KEY.AUTH_APP),d=await getToken({API_KEY:n||"",INSTANT_SEARCH_API_KEY:o||"",USER_ID:r||"",USER_EMAIL:l||"",USER_FULLNAME:a||""})}runApps&&(ConfirmationPopupInitSelector(),InfoPopupInitSelector(),ToastNotificationInitSelector(),getSettings().then((e=>{var t,s,i,n,o,r,l,a,d;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?((null==(s=null==e?void 0:e.data)?void 0:s.general)&&localStorage.setItem(LOCAL_STORAGE_KEY.GENERAL_SETTING,JSON.stringify(null==(i=null==e?void 0:e.data)?void 0:i.general)),(null==(n=null==e?void 0:e.data)?void 0:n.wishlist)&&(localStorage.setItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING,JSON.stringify(null==(o=null==e?void 0:e.data)?void 0:o.wishlist)),WishlistInitSelector()),(null==(r=null==e?void 0:e.data)?void 0:r.review)&&(localStorage.setItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING,JSON.stringify(null==(l=null==e?void 0:e.data)?void 0:l.review)),ProductReviewInitSelector()),(null==(a=null==e?void 0:e.data)?void 0:a.instantsearch)&&(localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING,JSON.stringify(null==(d=null==e?void 0:e.data)?void 0:d.instantsearch)),InstantSearchInitSelector())):console.error("%cSledge",consoleErrorStyle,"Error app settings")})))}));
|