@sledge-app/js 0.0.60 → 0.0.62

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.
@@ -1 +1 @@
1
- import{R as React,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,r as $054eb8030ebde76e$export$f99233281efd08a0,s as $054eb8030ebde76e$export$393edc798c47379d,t as $054eb8030ebde76e$export$e19cd5f9376f8cee,u as $054eb8030ebde76e$export$d5c6c08dc2d3ca7,v as $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,w as $cb5cc270b50c6fcd$export$41fb9f06171c75f4,x as $cb5cc270b50c6fcd$export$602eac185826482c,y as $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,z as $cb5cc270b50c6fcd$export$f39c2d165cd861fe,A as $cb5cc270b50c6fcd$export$21b07c8f274aebd5,B as $67824d98245208a0$export$be92b6f5f03c0fe9,C as $67824d98245208a0$export$adb584737d712b70,D as $e698a72e93240346$export$be92b6f5f03c0fe9,E as $e698a72e93240346$export$adb584737d712b70,F as $faa2e61a3361514f$export$be92b6f5f03c0fe9,G as $faa2e61a3361514f$export$13921ac0cc260818,H as $faa2e61a3361514f$export$9a58ef0d7ad3278c,I as $faa2e61a3361514f$export$6521433ed15a34db,J as $f99a8c78507165f7$export$be92b6f5f03c0fe9,K as $f99a8c78507165f7$export$6d08773d2e66f8f2,L as $f99a8c78507165f7$export$adb584737d712b70,M as $cc7e05a45900e73f$export$6d08773d2e66f8f2,N as $cc7e05a45900e73f$export$d6e5bf9c43ea9319,O as $cc7e05a45900e73f$export$c3468e2714d175fa,P as $cc7e05a45900e73f$export$be92b6f5f03c0fe9,Q as $cc7e05a45900e73f$export$41fb9f06171c75f4,S as $cc7e05a45900e73f$export$4c8d1a57a761ef94,T as $cc7e05a45900e73f$export$f04a61298a47a40f,U as $cc7e05a45900e73f$export$602eac185826482c,V as $cc7e05a45900e73f$export$7c6e2c02157bb7d2,W as $cc7e05a45900e73f$export$2f60d3ec9ad468f2,X as $cc7e05a45900e73f$export$d5c6c08dc2d3ca7,Y as $cc7e05a45900e73f$export$bf1aedc3039c8d63,Z as reactExports,_ as motion,a0 as MasonryResponsive,a1 as Masonry,a2 as $d94698215c4408a7$export$be92b6f5f03c0fe9,a3 as $d94698215c4408a7$export$2c4cf1f7b42ef78c,a4 as $d94698215c4408a7$export$a455218a85c89869,a5 as $d94698215c4408a7$export$7a7fa4424cb20976,a6 as $d94698215c4408a7$export$f69c19e57285b83a,a7 as $a093c7e1ec25a057$export$2881499e37b75b9a,a8 as $a093c7e1ec25a057$export$be92b6f5f03c0fe9,a9 as $a093c7e1ec25a057$export$41fb9f06171c75f4,aa as $a093c7e1ec25a057$export$602eac185826482c,ab as $a093c7e1ec25a057$export$7c6e2c02157bb7d2,ac as $a093c7e1ec25a057$export$21b07c8f274aebd5,ad as $57acba87d6e25586$export$be92b6f5f03c0fe9,ae as $57acba87d6e25586$export$d5c6c08dc2d3ca7,af as $57acba87d6e25586$export$9a4e88b92edfce6b,ag as $57acba87d6e25586$export$6521433ed15a34db,ah as $57acba87d6e25586$export$ac61190d9fc311a9}from"./assets/vendor-f2befdd9.js";const root="",API_URL="https://sledge-api-preprod.offstack.io",INSTANT_SEARCH_ENGINE_URL="https://instant-search-engine.offstack.io",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"},PRODUCT_REVIEW:{RATING_SIZE:"data-rating-size",RATING_TOTAL:"data-rating-total",RATING_AVERAGE:"data-rating-average"},INSTANT_SEARCH:{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"}},LOCAL_STORAGE_KEY={ANONYM_ID:"sledge-anonym-id",AUTH_APP:"sledge-auth-app",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",EXPIRED_SETTING:"sledge-expired-setting"},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=[10,25,50,100],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/`,SHOPIFY_GID_PRODUCT_VARIANT_ID=`${SHOPIFY_GID}ProductVariant/`,PAYLOAD_API_ALIASES={Authorization:"zbNTHXQpW7OmI",Method:"Gba2Tb9Ys7JGu",GET:"JniUtw5dNfeKW",POST:"a9Dmw0qP9hvQE",PUT:"dEnOjbvTzULLK",DELETE:"pLC93Tvsu6g7H"},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)},detectInitSelector=(e,t,s)=>{let i=!1;s?e&&t():document.body.addEventListener("DOMNodeInserted",(()=>{!i&&e&&(i=!0,t())}))},getTextBetween=(e,t,s)=>{if(e&&s.includes(e)&&t&&s.includes(t)){let i=s.indexOf(e)+e.length;return s.substring(i,s.indexOf(t,i))}return s},isFunction=e=>"function"==typeof e,scrollToElement=(e,t)=>{if(e){var s=(null==e?void 0:e.getBoundingClientRect().top)+window.scrollY-t;window.scrollTo({top:s,behavior:"smooth"})}},getUnixTimestamp=(e,t)=>{let s=0;return e&&("day"===t&&(s=60*e*60*24),"hour"===t&&(s=60*e*60),"minute"===t&&(s=60*e),"second"===t&&(s=e)),Math.floor(Date.now()/1e3)+s},fetchApi=async(e,t,s,i={},n={},o=!0,l=!1)=>{var r=new Headers;o||(s&&r.append("Authorization",`Bearer ${s}`),Object.keys(n).length&&Object.keys(n).forEach((function(e){r.append(e,n[e])})));var a=new FormData;(o||l)&&(s&&o&&a.append(PAYLOAD_API_ALIASES.Authorization,s),a.append(PAYLOAD_API_ALIASES.Method,PAYLOAD_API_ALIASES[t]),Object.keys(i).length&&Object.keys(i).forEach((function(e){l&&(null==i?void 0:i.files)&&[...i.files].map((e=>{a.append("files",e,e.name)})),a.append(e,i[e])})));var d={method:o?"POST":t,redirect:"follow",headers:r,body:o||l?a:JSON.stringify(i)};return await fetch(`${e}`,d).then((e=>e.json())).then((e=>e))},getSettings=async e=>{let t=e||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING))||null,i=(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING))||null,n=(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING))||null,o=(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING))||null;if(getUnixTimestamp()<=Number(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.EXPIRED_SETTING))&&s&&i&&n&&o)return{status:{code:200},data:{general:JSON.parse(s),wishlist:JSON.parse(i),review:JSON.parse(n),instantsearch:JSON.parse(o)}};let l=`${API_URL}/app/settings`;return await fetchApi(l,"POST",t).then((e=>{var t;return 200===(null==(t=null==e?void 0:e.status)?void 0:t.code)&&"undefined"!=typeof localStorage&&localStorage.setItem(LOCAL_STORAGE_KEY.EXPIRED_SETTING,String(getUnixTimestamp(5,"minute"))),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:l}=e;let r="",a="",d=0;"undefined"!=typeof localStorage&&(r=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",a=localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",d=Number(localStorage.getItem(LOCAL_STORAGE_KEY.EXPIRED_AUTH_APP)));let c=Boolean(String(a.toLowerCase()).includes("anonymous")&&i),u=Boolean(!String(a.toLowerCase()).includes("anonymous")&&!i),x=getUnixTimestamp()<=d;if(r&&x&&!c&&!u)return{data:{token:r}};let p=`${API_URL}/app/token`,m={user:JSON.stringify({id:i||"",email:n||"",name:o||"",anonym:l||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"")})};return await fetchApi(p,"POST",t||"",m).then((e=>{const{data:t}=e||{},{anonym:i,token:n,iat:o,exp:l}=t||{};return"undefined"!=typeof localStorage&&(localStorage.setItem(LOCAL_STORAGE_KEY.ANONYM_ID,i||""),localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP,n||""),localStorage.setItem(LOCAL_STORAGE_KEY.ISSUED_AUTH_APP,o||""),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(""),[l,r]=React.useState(""),[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:l,buttonSubmitType:a,onSubmit:c})=>{u(!0),t(e),i(s),o(n),r(l),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($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",{className:"sledge__alert-dialog-button sledge__alert-dialog-button-cancel",onClick:()=>u(!1),children:l})}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$e19cd5f9376f8cee,{asChild:!0,children:jsxRuntimeExports.jsx("button",{className:`sledge__alert-dialog-button ${a}`,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(""),[l,r]=React.useState(!1);return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInfoPopup=({title:e,message:s,textCancel:n})=>{r(!0),t(e),i(s),o(n)})}),[]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:l,onOpenChange:r,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($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:()=>r(!1),children:n})}),jsxRuntimeExports.jsx("button",{className:"IconButton","aria-label":"Close",onClick:()=>r(!1),children:jsxRuntimeExports.jsx("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M1.22578 13.8248L0.175781 12.7748L5.95078 6.9998L0.175781 1.2248L1.22578 0.174805L7.00078 5.9498L12.7758 0.174805L13.8258 1.2248L8.05078 6.9998L13.8258 12.7748L12.7758 13.8248L7.00078 8.0498L1.22578 13.8248Z",fill:"currentColor"})})})]})]})})},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(""),[l,r]=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:l=null,type:a})=>{i(e),o(s),r(n),d(l),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,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:15,height:15,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":l})]})},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:l,withOpenState:r=!0,withArrow:a=!0,customArrow:d="",sideOffset:c=5,alignOffset:u=0})=>{const[x,p]=React.useState(!!r&&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,{...r&&{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 ${l||""}`,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,defaultChecked:o,labelStyle:l={},onClick:r})=>jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",defaultChecked:o,id:e,name:t,value:s,required:i,onClick:r,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:l,children:n})]}),Slider$1="",Slider=e=>{const{defaultValue:t,min:s,max:i,step:n=1,setValueCommit:o,setValueChange:l}=e,[r,a]=React.useState(t);return jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsxs($faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:t,min:s,max:i,step:n,"aria-label":"Volume",onValueCommit:e=>{o&&o(e),a(e)},onValueChange:e=>{l&&l(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:r[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="#23BC45"/></svg>',wrapTrigger:!1,children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),jsxRuntimeExports.jsx(Tooltip,{content:r[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="#23BC45"/></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:17,height:17,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:17,height:17,color:"black"})})]})},RadioGroup$1="",RadioGroup=({id:e,name:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:l})=>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:l,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:l,onClick:r})=>{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:l,id:e,name:t,value:s,required:o,onClick:r,style:a})})},Select$1="",Select=({name:e,placeholder:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:l})=>jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:e,required:s,onValueChange:l,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 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.6334 3.33398C23.9899 3.33398 27.5887 6.65342 28.0324 10.8989L28.1562 10.9003C30.5729 10.9003 33.5112 12.5053 34.5029 17.007L35.8179 27.1853C36.2896 30.4703 35.6996 33.1053 34.0612 34.9953C32.4312 36.8753 29.8512 37.8703 26.5996 37.8703H12.6862C9.11458 37.8703 6.62625 36.9953 5.07792 35.197C3.52292 33.3936 3.00292 30.6886 3.53292 27.1586L4.82625 17.1153C5.67625 12.5103 8.78458 10.9003 11.1912 10.9003C11.399 8.98444 12.2629 7.16182 13.6334 5.79565C15.2084 4.23065 17.3801 3.33398 19.5984 3.33398H19.6334ZM28.1562 13.4003H11.1912C10.4562 13.4003 7.99958 13.697 7.29458 17.5036L6.00792 27.5036C5.58958 30.3086 5.91292 32.3386 6.97125 33.567C8.01625 34.7803 9.88625 35.3703 12.6862 35.3703H26.5996C28.3462 35.3703 30.7312 35.022 32.1712 33.3586C33.3146 32.0403 33.7079 30.077 33.3412 27.522L32.0429 17.4353C31.4896 14.9503 30.0296 13.4003 28.1562 13.4003ZM24.4942 18.0405C25.1842 18.0405 25.7826 18.6005 25.7826 19.2905C25.7826 19.9805 25.2609 20.5405 24.5709 20.5405H24.4942C23.8042 20.5405 23.2442 19.9805 23.2442 19.2905C23.2442 18.6005 23.8042 18.0405 24.4942 18.0405ZM14.7774 18.0405C15.4674 18.0405 16.0657 18.6005 16.0657 19.2905C16.0657 19.9805 15.5424 20.5405 14.8524 20.5405H14.7774C14.0874 20.5405 13.5274 19.9805 13.5274 19.2905C13.5274 18.6005 14.0874 18.0405 14.7774 18.0405ZM19.6284 5.83398H19.6034C18.0351 5.83398 16.5067 6.46565 15.3984 7.56732C14.4956 8.46609 13.9051 9.64764 13.7141 10.8995L25.5129 10.9C25.0846 8.03628 22.6082 5.83398 19.6284 5.83398Z",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",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M6.22578 18.8248L5.17578 17.7748L10.9508 11.9998L5.17578 6.2248L6.22578 5.1748L12.0008 10.9498L17.7758 5.1748L18.8258 6.2248L13.0508 11.9998L18.8258 17.7748L17.7758 18.8248L12.0008 13.0498L6.22578 18.8248Z",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})})}),Button$1="",Button=React.forwardRef(((e,t)=>{const{className:s="",children:i,colorType:n="light",fullWidth:o=!1,elementType:l="button",link:r="",...a}=e;return"hyperlink"===l&&(null==r?void 0:r.length)?jsxRuntimeExports.jsx("a",{href:r,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:l,fieldRef:r,...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:r,...a}),d&&n?jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==r?void 0:r.current)&&r.current.focus(),o&&o({value:""}),l&&l()},children:jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:14,height:14,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"})})})}):null]})},SelectField$1="",SelectField=e=>{var t;const{className:s="",placeholder:i=null,prefixLabel:n=null,prefixSelectedLabel:o="",align:l="end",onChange:r,value:a="",options:d=[],LinkComponent:c,link:u}=e,[x,p]=React.useState(!1),m=(null==(t=null==d?void 0:d.filter((({value:e})=>e===a))[0])?void 0:t.label)||i;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})]}),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)=>{r&&r({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:l,className:"sledge__select-field-option-content",withArrow:!1})})},ProductGrid$1="",addToCart=async e=>{var t;let s=[];e.map((e=>{const{id:t,quantity:i}=e;s.push({id:t,quantity:i})}));let i=`${window.Shopify.routes.root}cart/add.js`,n={items:s};if(null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)return await fetchApi(i,"POST",null,n,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},getReview=async(e,t,s)=>{const{page:i,limit:n,sort:o,keyword:l,rating:r}=t||{};let a=sanitizeDataId(e),d=s||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),c="?"+new URLSearchParams({page:i||"",limit:n||"",sort:o||"",keyword:l||"",rating:r||""}).toString(),u=`${API_URL}/review/${a}${c}`;return await fetchApi(u,"GET",d).then((e=>e)).catch((()=>{}))},getReviewInfo=async e=>{let t=sanitizeDataId(e),s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),i=`${API_URL}/review/info/${t}`;return await fetchApi(i,"GET",s).then((e=>e)).catch((()=>{}))},getProductsReviewInfo=async(e,t)=>{let s=e.map((e=>sanitizeDataId(e))),i=t||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),n=`${API_URL}/review/info/ids/${s.join(",")}`;return await fetchApi(n,"GET",i).then((e=>e)).catch((()=>{}))},getReviewMedia=async()=>{let e=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),t=`${API_URL}/review/usermedia`;return await fetchApi(t,"GET",e).then((e=>e)).catch((()=>{}))},addReviewMedia=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=`${API_URL}/review/media`,i={files:e};return await fetchApi(s,"POST",t,i,{},!1,!0).then((e=>e)).catch((()=>{}))},deleteReviewMedia=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=`${API_URL}/review/usermedia/${e}`;return await fetchApi(s,"DELETE",t).then((e=>e)).catch((()=>{}))},addReview=async e=>{const{userFirstName:t,userLastName:s,userEmail:i,productId:n,productVariantId:o,rating:l,title:r,review:a,mediaIds:d}=e;let c=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:l,title:r,review:a,media_ids:d})};return await fetchApi(u,"POST",c,x).then((e=>e)).catch((()=>{}))},usePrevious=e=>{const t=React.useRef();return React.useEffect((()=>{t.current=e})),t.current},Rating=e=>{var t,s;const{total:i,average:n,size:o="md",params:l,withSkeletonLoading:r=!0,withTotal:a=!0,isScrollToElementWidget:d=!0,data:c,sledgeSettings:u}=e,{productId:x}=l||{},{isRenderApp:p,triggerRenderMultipleComponent:m}=React.useContext(SledgeContext),{productReview:g}=p||{},_=!c&&void 0===i&&void 0===n,[R,E]=React.useState(_),[h,v]=React.useState(_),[j,T]=React.useState(c||void 0!==i||void 0!==n?getSizing(o):{width:0,height:0}),[w,S]=React.useState((null==c?void 0:c.review_count)||i||0),[f,A]=React.useState((null==(t=null==c?void 0:c.rating)?void 0:t.average)||n||"0"),[C,I]=React.useState((null==u?void 0:u.review)||{}),[L,N]=React.useState(!0),O=usePrevious({productId:x}),{fill_color:y,outline_color:b}=(null==(s=null==C?void 0:C.display)?void 0:s.rating)||{},$=async(e,t=!1)=>{var s,i,n,o,l,r,a;if(e!==x)return;let d,u,p,g=!1,_=0;if(c&&L)p=c,g=!0,N(!1);else{if(d=await getReviewInfo(e),!d)return;const{status:t}=d;p=d.data;const{code:s}=t;g=200===s||!1}_=(null==p?void 0:p.review_count)?p.review_count:0,u=(null==(s=null==p?void 0:p.rating)?void 0:s.average)?p.rating.average:0,g&&(S(_),A(u),v(!1),E(!1),t&&(null==(n=null==(i=null==m?void 0:m.productReview)?void 0:i.rating)?void 0:n.value)&&(null==(l=null==(o=null==m?void 0:m.productReview)?void 0:o.rating)?void 0:l.trigger)&&(null==(a=null==(r=null==m?void 0:m.productReview)?void 0:r.rating)||a.trigger("")))},P=async e=>{let t;v(!0),t=JSON.parse(e),t&&(I(t),await(async()=>{void 0!==i||void 0!==n?v(!1):$(x)})())};return React.useEffect((()=>{if(!g)return;T("xs"===o?{width:14.4,height:14.4}:"sm"===o?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(O&&(null==O?void 0:O.productId)!==x)&&E(!0),P(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"")}),[g,x]),React.useEffect((()=>{var e,t,s,i;!x||x&&(null==(t=null==(e=null==m?void 0:m.productReview)?void 0:e.rating)?void 0:t.value)!==x||(E(!0),$(null==(i=null==(s=null==m?void 0:m.productReview)?void 0:s.rating)?void 0:i.value,!0))}),[x,m]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{d&&setTimeout((()=>{scrollToElement(document.getElementById(ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET),50)}),200)},children:R&&r?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",{id:"sledge-product-review-icons-rating-icon-fill",viewBox:"0 0 30 29",fill:y||"#23BC45",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00014 17.7L1.20174 12.9C0.107339 12.0248 0.587339 10.2648 1.97614 10.0664L10.2001 9.69998L13.7121 0.895176C13.9569 0.407176 14.4545 0.0999756 15.0001 0.0999756C15.5457 0.0999756 16.0433 0.408776 16.2881 0.895176L19.8001 9.69998L28.0241 10.0664C29.4129 10.2648 29.8929 12.0248 28.7985 12.9L23.0001 17.7L24.5825 27.0712C24.7649 28.3496 23.4369 29.3064 22.2833 28.7288L15.0001 24.1L7.71694 28.7272C6.56174 29.3048 5.23534 28.348 5.41774 27.0696L7.00014 17.7Z"})}),jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-line",viewBox:"0 0 30 29",stroke:b||"#8D9196",fill:"none",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00014 17.7L1.20174 12.9C0.107339 12.0248 0.587339 10.2648 1.97614 10.0664L10.2001 9.69998L13.7121 0.895176C13.9569 0.407176 14.4545 0.0999756 15.0001 0.0999756C15.5457 0.0999756 16.0433 0.408776 16.2881 0.895176L19.8001 9.69998L28.0241 10.0664C29.4129 10.2648 29.8929 12.0248 28.7985 12.9L23.0001 17.7L24.5825 27.0712C24.7649 28.3496 23.4369 29.3064 22.2833 28.7288L15.0001 24.1L7.71694 28.7272C6.56174 29.3048 5.23534 28.348 5.41774 27.0696L7.00014 17.7Z",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"})]})})]}),!h&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((e,t)=>{let s=Math.floor(parseFloat(f)),i=String(f).includes(",")?String(f).split(","):[],n=String(f).includes(".")?String(f).split("."):[],o=i.length||n.length?i[1]||n[1]:0,l="fill-0";return e>s&&s+1===e&&(l=`fill-${o}`),reactExports.createElement("svg",{...j,viewBox:"0 0 30 29","data-product-review-rating-fill":e<=s?"full":l,key:t},jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),a?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",w,")"]}):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 l=document.createElement("div");l.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET),e.appendChild(l),client.createRoot(l).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||""},size:s,withSkeletonLoading:!Boolean(o&&"false"===o),...null!=i?{total:i}:{},...null!=n?{average:n}:{}})})}))},RatingInitSelector=(e,t=!1)=>{let s=Array.from(document.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING));detectInitSelector(s,(()=>{s.length&&s.map((t=>{const s=t.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID);e&&e!==s||ElementInit$1(t)}))}),t),new MutationObserver((function(e){e.forEach((function(e){Array.prototype.slice.call(e.addedNodes).forEach((function(e){1===e.nodeType&&e.querySelector(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)&&(s=Array.from(e.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)),s.length&&s.map((e=>ElementInit$1(e))))}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1})},WidgetHeaderAddTrigger=({isFirstLoading:e,text:t,dataSettings:s,params:i,onAfterAddReview:n})=>{var o,l,r;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==(l=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:l.button_write_review)||{},{button_write_review:h}=(null==(r=null==s?void 0:s.languages)?void 0:r.widget)||{},v={...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",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(i,n),style:v,children:[jsxRuntimeExports.jsx("svg",{width:16,height:17,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8323 14.1264C14.1083 14.1264 14.3323 14.3504 14.3323 14.6264C14.3323 14.9024 14.1083 15.1264 13.8323 15.1264H8.99701C8.72101 15.1264 8.49701 14.9024 8.49701 14.6264C8.49701 14.3504 8.72101 14.1264 8.99701 14.1264H13.8323ZM10.7429 2.93576C10.7762 2.96176 11.8915 3.82843 11.8915 3.82843C12.2969 4.06976 12.6135 4.5011 12.7335 5.01176C12.8529 5.5171 12.7662 6.03843 12.4882 6.47909C12.4864 6.48203 12.4845 6.48494 12.4781 6.49358L12.4731 6.50025C12.4279 6.55972 12.2318 6.80776 11.2417 8.04815C11.2325 8.06441 11.2221 8.07963 11.2107 8.09443C11.1941 8.11624 11.1759 8.13628 11.1565 8.15453C11.089 8.23956 11.0176 8.3289 10.9426 8.42283L10.7907 8.61313C10.4772 9.00579 10.1053 9.47139 9.66407 10.0236L9.43764 10.3071C8.58586 11.3732 7.49499 12.7382 6.09755 14.4864C5.79155 14.8678 5.33288 15.0898 4.84021 15.0958L2.41421 15.1264H2.40755C2.17621 15.1264 1.97488 14.9678 1.92088 14.7418L1.37488 12.4278C1.26221 11.9484 1.37421 11.4538 1.68155 11.0698L7.96155 3.2151C7.96421 3.21243 7.96621 3.2091 7.96888 3.20643C8.65755 2.3831 9.90288 2.26176 10.7429 2.93576ZM7.26136 5.69133L2.46221 11.6944C2.34821 11.8371 2.30621 12.0211 2.34821 12.1978L2.80221 14.1211L4.82821 14.0958C5.02088 14.0938 5.19888 14.0078 5.31688 13.8611C5.92454 13.1008 6.68825 12.1452 7.47345 11.1627L7.75125 10.815L8.02952 10.4668C8.76591 9.54526 9.4934 8.63471 10.1021 7.87258L7.26136 5.69133ZM8.73888 3.84443L7.88603 4.91L10.7265 7.09062C11.2733 6.4058 11.633 5.95476 11.6662 5.91176C11.7755 5.73443 11.8182 5.48376 11.7609 5.24243C11.7022 4.9951 11.5482 4.78509 11.3262 4.65109C11.2789 4.61843 10.1555 3.74643 10.1209 3.71909C9.69821 3.38043 9.08155 3.4391 8.73888 3.84443Z",fill:"currentColor"})}),t||(h||"Add review")]})})},WidgetHeaderSort$1=({isFirstLoading:e,productReviewSort:t,dataSettings:s,setSelectedSort:i,setIsRefreshWidgetList:n})=>{var o,l;const{default_sort:r,show_sorting_options:a}=(null==(o=null==s?void 0:s.display)?void 0:o.widget)||{},[d,c]=React.useState(r||null),u=d||(null==(l=t[0])?void 0:l.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("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5919 9.13869C12.7359 9.13869 13.6666 10.0647 13.6666 11.2027C13.6666 12.3407 12.7359 13.2667 11.5919 13.2667C10.4473 13.2667 9.51593 12.3407 9.51593 11.2027C9.51593 10.0647 10.4473 9.13869 11.5919 9.13869ZM11.5919 10.1387C10.9986 10.1387 10.5159 10.616 10.5159 11.2027C10.5159 11.79 10.9986 12.2667 11.5919 12.2667C12.1846 12.2667 12.6666 11.79 12.6666 11.2027C12.6666 10.616 12.1846 10.1387 11.5919 10.1387ZM6.7202 10.7286C6.9962 10.7286 7.2202 10.9526 7.2202 11.2286C7.2202 11.5046 6.9962 11.7286 6.7202 11.7286H2.51953C2.24353 11.7286 2.01953 11.5046 2.01953 11.2286C2.01953 10.9526 2.24353 10.7286 2.51953 10.7286H6.7202ZM4.07533 2.66669C5.22 2.66669 6.15067 3.59335 6.15067 4.73135C6.15067 5.86935 5.22 6.79469 4.07533 6.79469C2.93133 6.79469 2 5.86935 2 4.73135C2 3.59335 2.93133 2.66669 4.07533 2.66669ZM4.07533 3.66669C3.48267 3.66669 3 4.14402 3 4.73135C3 5.31802 3.48267 5.79469 4.07533 5.79469C4.66867 5.79469 5.15067 5.31802 5.15067 4.73135C5.15067 4.14402 4.66867 3.66669 4.07533 3.66669ZM12.7941 4.26695C13.0701 4.26695 13.2941 4.49095 13.2941 4.76695C13.2941 5.04295 13.0701 5.26695 12.7941 5.26695H8.59407C8.31807 5.26695 8.09407 5.04295 8.09407 4.76695C8.09407 4.49095 8.31807 4.26695 8.59407 4.26695H12.7941Z",fill:"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})},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}}}},WidgetHeaderSummary=e=>{var t,s,i,n;const{params:o,dataSettings:l,summaryData:r,sledgeSettings:a}=e,{productId:d}=o||{},{fill_color:c,outline_color:u}=(null==(s=null==(t=null==l?void 0:l.display)?void 0:t.widget)?void 0:s.summary_bar)||{},{review_singular:x,review_plural:p}=(null==(i=null==l?void 0:l.languages)?void 0:i.widget)||{},[m,g]=React.useState(!0),[_,R]=React.useState(!0),[E,h]=React.useState(!0),[v,j]=React.useState(!r),[T,w]=React.useState(!1),[S,f]=React.useState(0|(null==r?void 0:r.review_count)),[A,C]=React.useState((null==r?void 0:r.rating)||{5:0,4:0,3:0,2:0,1:0}),[I,L]=React.useState((null==(n=null==r?void 0:r.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,l=0;if(r&&N)s=r,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}l=(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}:A,n=(null==(e=null==s?void 0:s.rating)?void 0:e.average)?s.rating.average:"0",o&&(f(l),C(i),L(n),h(!1),j(!1),g(!1),T&&R(!1))};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{j(!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&&!r?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"630px",height:"42px",color:"lighten",rounded:"md"}):E&&!r?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:I}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!v&&jsxRuntimeExports.jsx(Rating,{data:r,sledgeSettings:a,average:String(I),size:"md",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[S," ",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:r,sledgeSettings:a,average:e,size:"sm",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1}),jsxRuntimeExports.jsx(Progress,{value:String(A[e]),total:S,fillColor:c,outlineColor:u}),jsxRuntimeExports.jsxs("small",{children:["(",A[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:l,dataSettings:r,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)||r)?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(p.current,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==l?void 0:l.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReviewWrapper,{...e,data:m}),R]}):jsxRuntimeExports.jsx(WidgetListEmpty$1,{...e})})})},WidgetListEmpty$1=e=>{var t;const{dataSettings:s}=e||{},{title_no_result:i,text_no_result:n}=(null==(t=null==s?void 0:s.languages)?void 0:t.widget)||{},[o,l]=React.useState(""),[r,a]=React.useState("");return React.useEffect((()=>{l(i||"No reviews for this item yet!"),a(n||'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-title",dangerouslySetInnerHTML:{__html:o}}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-description",dangerouslySetInnerHTML:{__html:r}})]})},ReviewWrapper=e=>{var t,s,i,n,o,l,r,a;let{productReviewData:d,currentPage:c,setCurrentPage:u,totalPage:x,totalData:p,dataSettings:m,setIsRefreshWidgetList:g,setIsReplaceWidgetList:_,LinkComponent:R,selectedSort:E,data:h,sledgeSettings:v}=e||{};m=(null==v?void 0:v.review)||m;const{type:j,rating_size:T,show_review_date:w}=(null==(t=null==m?void 0:m.display)?void 0:t.widget)||{},{text_color:S,border_color:f,border_radius:A,padding_top:C,padding_bottom:I,padding_left:L,padding_right:N,background_color:O,font_size:y,font_weight:b,text_transform:$}=(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:D,border_radius:U,padding_top:W,padding_bottom:k,padding_left:M,padding_right:H,background_color:B,font_size:F,font_weight:G,text_transform:Y}=(null==(o=null==(n=null==m?void 0:m.display)?void 0:n.widget)?void 0:o.verified)||{},{button_load_more:V,verified:K}=(null==(l=null==m?void 0:m.languages)?void 0:l.widget)||{},{name:q,image:z}=(null==(a=null==(r=null==m?void 0:m.display)?void 0:r.widget)?void 0:a.replier)||{},J={...S&&{color:S},...f&&{borderColor:f},...A&&{borderRadius:A},...C&&{paddingTop:C},...I&&{paddingBottom:I},...L&&{paddingLeft:L},...N&&{paddingRight:N},...O&&{backgroundColor:O},...y&&{fontSize:y},...b&&{fontWeight:b},...$&&{textTransform:$}},Z={...P&&{color:P},...D&&{borderWidth:"1px",borderStyle:"solid",borderColor:D},...U&&{borderRadius:U},...W&&{paddingTop:W},...k&&{paddingBottom:k},...M&&{paddingLeft:M},...H&&{paddingRight:H},...B&&{backgroundColor:B},...F&&{fontSize:F},...G&&{fontWeight:G},...Y&&{textTransform:Y}};let X=c||0,Q=x||0;const[ee,te]=React.useState(!1),[se,ie]=React.useState(!1),ne=()=>{u&&c&&u(c+1),te(!0)};React.useEffect((()=>{ie(!(Q===X&&!ee)&&Q>=X)}),[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...":V||"Load More"}),le=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:"30px",children:d.map(((e,t)=>{var s,i;const{user:{name:n},review:{rating:o,review:l,media:r,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("<span>","</span>",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:l.length>=250?`${l.slice(0,250)}...`:l})]}),(null==r?void 0:r.length)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:r.slice(0,4).map(((e,t)=>{const{type:s,file:i}=e;let n="image"===s?jsxRuntimeExports.jsx("img",{src:i,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`},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||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`,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-reply-status",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,{})})]}),re=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:l,review:r,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("<span>","</span>",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:l,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:r.length>=350?`${r.slice(0,350)}...`:r}),(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||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`,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-reply-status",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,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`},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"===j?re:le},WidgetRoot$1=e=>{var t,s,i,n;const{children:o,params:l,onAfterAddReview:r,data:a,sledgeSettings:d}=e,{productId:c}=l||{},{isRenderApp:u}=React.useContext(SledgeContext),{productReview:x}=u||{},[p,m]=React.useState(!a),[g,_]=React.useState(!a),[R,E]=React.useState(!1),[h,v]=React.useState(!1),[j,T]=React.useState((null==a?void 0:a.data)||[]),[w,S]=React.useState((null==a?void 0:a.sorts)||[]),[f,A]=React.useState((null==(s=null==(t=null==d?void 0:d.display)?void 0:t.widget)?void 0:s.default_sort)||""),[C,I]=React.useState(1),[L,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,$]=React.useState((null==d?void 0:d.review)||{}),[P,D]=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,l=f;if(_(!!t||!e),!e||t){let e=await M(s);const{review_per_page:n,default_sort:r}=(null==(i=null==e?void 0:e.display)?void 0:i.widget)||{};o=n||o,l=f||r,t||I(1),T([]),A(l)}let r,d,u=!1,x=0,p=0,g={page:e?C:1,limit:o,sort:l};if(a&&P?(D(!1),n=a):n=await getReview(c,g),!n)return;const{status:R,data:h,page:w,sorts:L}=n,{code:O}=R;u=200===O||!1,r=(null==h?void 0:h.length)?t=>(null==j?void 0:j.length)&&e?[...t,...h]:h:[],d=(null==L?void 0:L.length)?L:[],x=(null==w?void 0:w.total_page)||1,p=(null==w?void 0:w.total_data)||1,u&&(T(r),S(d),N(x),y(p),_(!1),E(!1),v(!1),m(!1))},M=async e=>{let t;if(t=JSON.parse(e),t)return $(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)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(!R&&e,h,t)}),[C,R,h,x,a]),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:l,isFirstLoading:p,isLoading:g,productReviewData:j,productReviewSort:w,selectedSort:f,currentPage:C,totalPage:L,totalData:O,dataSettings:b,setIsLoading:_,setIsRefreshWidgetList:E,setIsReplaceWidgetList:v,setSelectedSort:A,setCurrentPage:I,onAfterAddReview:r,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,l]=React.useState(""),[r,a]=React.useState(""),[d,c]=React.useState(""),[u,x]=React.useState(""),[p,m]=React.useState([]),[g,_]=React.useState([]),[R,E]=React.useState(""),[h,v]=React.useState(""),[j,T]=React.useState(!1),[w,S]=React.useState(""),[f,A]=React.useState({}),[C,I]=React.useState(0),[L,N]=React.useState({}),{text_color:O,border_color:y,border_radius:b,padding_top:$,padding_bottom:P,padding_left:D,padding_right:U,background_color:W,font_size:k,font_weight:M,text_transform:H}=(null==(t=null==(e=null==f?void 0:f.display)?void 0:e.widget)?void 0:t.verified)||{},{verified:B}=(null==(s=null==f?void 0:f.languages)?void 0:s.widget)||{},F={...O&&{color:O},...y&&{borderWidth:"1px",borderStyle:"solid",borderColor:y},...b&&{borderRadius:b},...$&&{paddingTop:$},...P&&{paddingBottom:P},...D&&{paddingLeft:D},...U&&{paddingRight:U},...W&&{backgroundColor:W},...k&&{fontSize:k},...M&&{fontWeight:M},...H&&{textTransform:H}},G=0===C,Y=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:r},review:{rating:d,title:u,review:p,media:g,reply:R,is_verified:h},created_at:j,settings:w}=e,{name:f,image:C}=(null==(s=null==(t=null==w?void 0:w.display)?void 0:t.widget)?void 0:s.replier)||{};l(r),a(d),c(u),x(p),m(g),_(R),E(f?String(String(f).includes("<span>")?String(f).split("<span>")[0]:String(f)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(i=R[0])?void 0:i.name):null==(o=R[0])?void 0:o.name),v(f?getTextBetween("<span>","</span>",f):"Admin"),T(h),S(new Intl.DateTimeFormat("en-US").format(new Date(j))),n(!0),A(w),I(0),N({name:f,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("svg",{width:18,height:18,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"#A7A7A7",fillRule:"evenodd",clipRule:"evenodd"})})}),(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,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`,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:()=>I(C-1),children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"white"})}),!Y&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-next",onClick:()=>I(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}),j?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-verified-text",style:F,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:r,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==L?void 0:L.image)||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`,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-reply-status",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;const{sledgeAnonymId:n,triggerRenderMultipleComponent:o}=React.useContext(SledgeContext),[l,r]=React.useState(!1),[a,d]=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}]),[c,u]=React.useState(a[0]),[x,p]=React.useState(!1),[m,g]=React.useState(null),[_,R]=React.useState(!1),[E,h]=React.useState(!1),[v,j]=React.useState(!1),[T,w]=React.useState(null),[S,f]=React.useState({}),[A,C]=React.useState({onAfterAddReview:e=>{}}),[I,L]=React.useState(""),[N,O]=React.useState(""),[y,b]=React.useState(""),[$,P]=React.useState(""),[D,U]=React.useState(""),[W,k]=React.useState(0),[M,H]=React.useState(""),[B,F]=React.useState(""),[G,Y]=React.useState([]),[V,K]=React.useState([]),{title_added_to_review:q,text_added_to_review:z}=(null==(e=null==S?void 0:S.languages)?void 0:e.notification)||{},{title_confirm_add_review:J,text_confirm_add_review:Z,button_submit_confirm_add_review:X,button_cancel_confirm_add_review:Q}=(null==(t=null==S?void 0:S.languages)?void 0:t.popup)||{},{navigation_previous:ee,navigation_next:te,button_submit:se}=(null==(s=null==S?void 0:S.languages)?void 0:s.write_review_form)||{},ie=async()=>{let e;R(!0);let t=!1;if(e=await addReview({userFirstName:I,userLastName:N,userEmail:y,productId:$,productVariantId:D,rating:W,title:M,review:B,mediaIds:G}),!e)return;const{status:{code:s}}=e;t=200===s,t?(A.onAfterAddReview("success"),setTimeout((()=>{var e,t,s,i;R(!1),r(!1),u(a[0]),L(""),O(""),b(""),k(0),H(""),F(""),Y([]),K([]),oe&&oe(),"undefined"!=typeof window&&((null==(t=null==(e=null==o?void 0:o.productReview)?void 0:e.rating)?void 0:t.trigger)&&(null==(i=null==(s=null==o?void 0:o.productReview)?void 0:s.rating)||i.trigger($)),RatingInitSelector($,!0),window.sledgeProductReviewWidgetListUpdate&&window.sledgeProductReviewWidgetListUpdate(),window.sledgeProductReviewWidgetSummaryUpdate&&window.sledgeProductReviewWidgetSummaryUpdate(),window.sledgeToastNotification&&window.sledgeToastNotification({title:q,message:z,type:"success",icon:jsxRuntimeExports.jsx(StarIcon,{width:40,height:40,color:"black"})}))}),500)):(A.onAfterAddReview("failed"),R(!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"})}))},ne=()=>{const e=a.findIndex((e=>e.key===c.key));d((e=>e.map((e=>(e.key===c.key&&(e.isDone=!0),e))))),u(a[e+1])},oe=async()=>{let e,t=!1,s=[],i=[];if(e=await getReviewMedia(),!e)return;const{status:n,data:o}=e,{code:l}=n;t=200===l||!1,s=(null==o?void 0:o.ids)||[],i=(null==o?void 0:o.media)||[],t&&(Y(s),K(i),h(!1),j(!1),w(null))},le=()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:J,message:Z,textSubmit:X,textCancel:Q,buttonSubmitType:"success",onSubmit:ie||{}})};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetFormAdd=(e,t)=>{const{productId:s,productVariantId:i}=e||{};r(!0),P(s||""),U(i||""),t&&C({onAfterAddReview:t})}),(async e=>{let t;t=JSON.parse(e),t&&(f(t),await oe())})(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"")}),[]),React.useEffect((()=>{u(a[0])}),[n]),React.useEffect((()=>{switch(null==c?void 0:c.key){case"Step_SelectRate":p(!!W),g(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:te}),jsxRuntimeExports.jsx(ArrowRightIcon,{width:18,height:18,color:"black"})]}));break;case"Step_WriteReview":p(!0),g(n?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:te}),jsxRuntimeExports.jsx(ArrowRightIcon,{width:18,height:18,color:"black"})]}):se);break;case"Step_PersonalData":p(!0),g(se)}}),[c,W,B,I,y,n]),React.useEffect((()=>{l?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[l]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:l,onOpenChange:r,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-form-add-content",children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$be92b6f5f03c0fe9,{className:"sledge-product-review__widget-form-review FormRoot",onSubmit:e=>(e=>{e.preventDefault(),"Step_SelectRate"===(null==c?void 0:c.key)?ne():n&&"Step_WriteReview"===(null==c?void 0:c.key)?ne&&ne():le&&le()})(e),"data-active-step":(null==c?void 0:c.key)||"","data-visible-next":x,children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step",children:(null==c?void 0:c.component)&&React.cloneElement(jsxRuntimeExports.jsx(c.component,{}),{steps:a,activeStep:c,isLoadingAddReview:_,isLoadingUploadMedia:E,isLoadingDeleteMedia:v,selectedDeleteMediaId:T,dataSettings:S,postUserFirstName:I,postUserLastName:N,postUserEmail:y,postRating:W,postReview:B,postMedia:V,setIsLoadingUploadMedia:h,setIsLoadingDeleteMedia:j,setSelectedDeleteMediaId:w,handleNext:ne,handleProductReviewMedia:oe,handleAddReview:ie,setPostUserFirstName:L,setPostUserLastName:O,setPostUserEmail:b,setPostRating:k,setPostTitle:H,setPostReview:F,confirmAddReview:le})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-add-step-navigator",children:[(null==(i=a[0])?void 0:i.key)===(null==c?void 0:c.key)?jsxRuntimeExports.jsx("span",{}):jsxRuntimeExports.jsx("span",{onClick:()=>{const e=a.findIndex((e=>e.key===c.key));0!==e&&(d((e=>e.map((e=>(e.key===c.key&&(e.isDone=!1),e))))),u(a[e-1]))},children:ee}),x&&jsxRuntimeExports.jsx($d94698215c4408a7$export$2c4cf1f7b42ef78c,{asChild:!0,disabled:_,children:jsxRuntimeExports.jsx(Button,{role:"button",colorType:"light",style:{..._&&{cursor:"wait"}},children:_?"Adding...":m})})]})]})})]})})},Step_SelectRate=e=>{var t,s,i,n;const{postRating:o,setPostRating:l,setPostTitle:r,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:v}=(null==(s=null==(t=null==a?void 0:a.display)?void 0:t.write_review_form)?void 0:s.button_select_rating)||{},{title:j,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:f,rating_2:A,rating_1:C}=T||{},I={...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},...v&&{textTransform:v}},L=[{rate:5,title:w},{rate:4,title:S},{rate:3,title:f},{rate:2,title:A},{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:j}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-select-rate-list",children:L.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,l&&l(t),void(r&&r(s));var t,s},style:{...I,..._&&R?{backgroundColor:e.rate===o?R:_}:{}},children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{average:e.rate,size:"md",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:l,postReview:r,setIsLoadingUploadMedia:a,setIsLoadingDeleteMedia:d,setSelectedDeleteMediaId:c,handleNext: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,v]=React.useState(!1),j=async()=>{if(!n)return;let e;d&&d(!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"})})):(d&&d(!1),c&&c(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((()=>{v(!1)}),[]),React.useEffect((()=>{n&&h&&(v(!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:j||{}}))}),[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;a&&a(!0);let s=!1,i=[],n=[];t=await addReviewMedia(e),t||(a&&a(!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:l}=t||{},{code:r}=o||{};s=200===r,i=(null==l?void 0:l.ids)||[],n=(null==l?void 0:l.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"})})):(a&&a(!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:r,onChange:e=>g&&g(e.target.value)}),(null==l?void 0:l.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-filled",children:[l.map(((e,t)=>{const{id:s,file:o,type:l}=e;let r=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:[r?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:()=>{v(!0),c&&c(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"===l?jsxRuntimeExports.jsx("img",{src:o,className:"sledge-product-review__widget-form-upload-media-filled-item-file",alt:"sledge-review-uploaded-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`}):jsxRuntimeExports.jsx("video",{controls:!r,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,setPostUserFirstName:l,setPostUserLastName:r,setPostUserEmail:a}=e,{user:d}=(null==(t=null==s?void 0:s.languages)?void 0:t.write_review_form)||{},{title:c,first_name_form_placeholder:u,last_name_form_placeholder:x,email_form_placeholder:p}=d||{};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:c}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-group-flex",children:[jsxRuntimeExports.jsx(InputField,{name:"userFirstName",type:"text",required:!0,placeholder:u,onChange:e=>l&&l(e.target.value),value:i}),jsxRuntimeExports.jsx(InputField,{name:"userLastName",type:"text",required:!0,placeholder:x,onChange:e=>r&&r(e.target.value),value:n})]}),jsxRuntimeExports.jsx(InputField,{name:"userEmail",type:"email",required:!0,placeholder:p,onChange:e=>a&&a(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));detectInitSelector(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)({element:item,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));detectInitSelector(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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,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:l,onAfterAddWishlist:r,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:l,onAfterAddWishlist:r,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=localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP),i=`${INSTANT_SEARCH_ENGINE_URL}/indexes/${e}/search`;return await fetchApi(i,"POST",s,t,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},multiSearch=async(e,t)=>{let s=t||localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP),i=`${INSTANT_SEARCH_ENGINE_URL}/multi-search`;return await fetchApi(i,"POST",s,e,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},searchTrigger=async e=>{const{keyword:t,resultCount:s}=e;let i=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),n=`${API_URL}/instantsearch/statistics/search`,o={keyword:t,result_count:s};return await fetchApi(n,"POST",i,o,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},productClickTrigger=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),i=`${API_URL}/instantsearch/statistics/click`,n={product:{id:sanitizeDataId(t)}};return await fetchApi(i,"POST",s,n,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},addToCartTrigger$1=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),i=`${API_URL}/instantsearch/statistics/cart`,n={product:{id:sanitizeDataId(t)}};return await fetchApi(i,"POST",s,n,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},OtherIndexLists=({listsComponent:e,name:t,items:s,isComponentJsVersion:i,showPopupComponent:n,setShowPopupComponent:o})=>{const l=e?e({name:t,items:s,showPopupComponent:n,setShowPopupComponent:o}):null;return e?i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:l}}):l: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})=>{const o=e?e({keywords:t,showPopupComponent:i,setShowPopupComponent:n}):null;return e?s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}}):o: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})=>{const o=e?e({keyword:t,showPopupComponent:i,setShowPopupComponent:n}):null;return e?s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}}):o: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,l,r,a,d,c,u,x,p,m,g,_,R,E,h,v,j;const{isRenderApp:T}=React.useContext(SledgeContext),{instantSearch:w}=T||{},[S,f]=React.useState(!0),[A,C]=React.useState(!1),[I,L]=React.useState(""),[N,O]=React.useState([]),[y,b]=React.useState([]),[$,P]=React.useState({}),[D,U]=React.useState({}),[W,k]=React.useState({}),[M,H]=React.useState(""),[B,F]=React.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),G=React.useRef(null),Y=usePrevious({keyword:I}),V=async(e,t=!1,s=!1)=>{var i,n,o,l,r,a,d,c,u,x,p,m;f(!0);const{tabs:g,suffix_index_product:_,hidden_tags:R,display:E,show_out_of_stock:h}=e,v=(null==(i=null==E?void 0:E.search)?void 0:i.suggestion)||{};let j,T={queries:g.map((e=>{const{index:t}=e;let s=t.includes(_),i=[];return(null==R?void 0:R.length)&&i.push(`tags NOT IN [${R}]`),h||i.push("variants.inventory_quantity > 0"),{indexUid:t,q:I,hitsPerPage:s?6:4,filter:s?i.join(" AND "):""}}))};if(j=await multiSearch(T),!j)return;const{results:w}=j;let S=null==w?void 0:w.filter((({indexUid:e})=>null==e?void 0:e.includes(_)));t&&(null==I?void 0:I.length)&&searchTrigger({keyword:I,resultCount:(null==(n=S[0])?void 0:n.totalHits)||0});let A=(null==(o=null==w?void 0:w.filter((({indexUid:e})=>!(null==e?void 0:e.includes(_)))))?void 0:o.map((e=>{const{indexUid:t}=e,{name:s}=null==g?void 0:g.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],C=(null==S?void 0:S.length)?null==(l=S[0])?void 0:l.hits:[],L=I.length?(null==C?void 0:C.length)?"":"no_result":"zero_character",N=Boolean(!I.length&&Object.keys(v).length&&(null==(a=null==(r=v[L])?void 0:r.products)?void 0:a.active)&&(null==(u=null==(c=null==(d=v[L])?void 0:d.products)?void 0:c.list)?void 0:u.length))?null==(p=null==(x=v[L])?void 0:x.products)?void 0:p.list:C;if(s){let e=N.map((({id:e})=>e)),t=await getProductsReviewInfo(e);200===(null==(m=null==t?void 0:t.status)?void 0:m.code)&&P(null==t?void 0:t.data)}else P({});O(N),b(A),H(L),f(!1)};return React.useEffect((()=>{w&&("undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:o=(()=>{}),suggestionKeywordListsComponent:l=(()=>{}),otherIndexListsComponent:r=(()=>{}),searchViewMoreResultComponent:a=(()=>{})})=>{C(!0),F({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:o,suggestionKeywordListsComponent:l,otherIndexListsComponent:r,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 V(s,!1,!0)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""))}),[w]),React.useEffect((()=>{A?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[A]),React.useEffect((()=>{if(Boolean(Y&&(null==Y?void 0:Y.keyword)!==I)){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&V(e,!0)}),500);return()=>clearTimeout(t)}}),[I]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:A,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==D?void 0:D.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:I,fieldRef:G,onChange:({value:e})=>L(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:A,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:A,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==(l=null==D?void 0:D.search)?void 0:l.show_vendor,show_sku:null==(r=null==D?void 0:D.search)?void 0:r.show_sku,show_price:null==(a=null==D?void 0:D.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:A,setShowPopupComponent:C,dataReviews:$})}):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:I}),". 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==D?void 0:D.search)?void 0:m.show_vendor,show_sku:null==(g=null==D?void 0:D.search)?void 0:g.show_sku,show_price:null==(_=null==D?void 0:D.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:A,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==(j=null==(v=null==(h=W[M])?void 0:h.products)?void 0:v.list)?void 0:j.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:B.searchViewMoreResultComponent,keyword:I,isComponentJsVersion:B.isJsVersion,showPopupComponent:A,setShowPopupComponent:C})}):null]})]})})})})]})]})})},SearchIconWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET));detectInitSelector(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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,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,l,r,a,d,c,u,x,p,m,g,_,R,E,h;const{isRenderApp:v,isJsVersion:j}=React.useContext(SledgeContext),{instantSearch:T}=v||{},{layoutType:w="default",query:S,params:f,children:A,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,onAfterRenderProduct:N,data:O,sledgeSettings:y}=e,{keyword:b=""}=S||{},{collectionId:$}=f||{};let P=null;React.Children.map(A,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(P=t)}}));const D="undefined"!=typeof document?new URLSearchParams(null==(t=null==document?void 0:document.location)?void 0:t.search):null,[U]=React.useState("undefined"!=typeof localStorage?JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"{}"):{}),[W,k]=React.useState(!O),[M,H]=React.useState(!O),[B,F]=React.useState(null==D?void 0:D.get(b)),[G,Y]=React.useState(null),[V,K]=React.useState(),[q,z]=React.useState(jsxRuntimeExports.jsx(ResultProduct,{})),[J,Z]=React.useState(!O),[X,Q]=React.useState((null==(s=null==y?void 0:y.instantsearch)?void 0:s.allowed_sorts)||[]),[ee,te]=React.useState((null==(i=null==y?void 0:y.instantsearch)?void 0:i.filters)||[]),[se,ie]=React.useState([]),[ne,oe]=React.useState([]),[le,re]=React.useState((null==(n=null==y?void 0:y.instantsearch)?void 0:n.suffix_index_product)||""),[ae,de]=React.useState({}),[ce,ue]=React.useState((null==(o=null==y?void 0:y.instantsearch)?void 0:o.hidden_tags)||[]),[xe,pe]=React.useState((null==(l=null==y?void 0:y.instantsearch)?void 0:l.display)||{}),[me,ge]=React.useState((null==(r=null==y?void 0:y.instantsearch)?void 0:r.colors)||[]),[_e,Re]=React.useState((null==(a=null==y?void 0:y.instantsearch)?void 0:a.default_sort)||""),[Ee,he]=React.useState(null==(d=null==y?void 0:y.instantsearch)?void 0:d.show_out_of_stock),[ve,je]=React.useState(!0),Te=React.useRef(null),we=usePrevious({keyword:B}),Se=async(e,t)=>{const{filters:s,tabs:i,suffix_index_product:n,hidden_tags:o,show_out_of_stock:l}=e;let r,a={queries:("product-filter"===w?i.filter((({index:e})=>null==e?void 0:e.includes(n))):i).map((e=>{const{index:i}=e;let r=!1,a=r?[]:null==s?void 0:s.map((e=>{const{collections:t,items:s}=e;return $&&(null==t?void 0:t.includes(Number($)))||(null==t?void 0:t.includes("all"))?(r=!0,null==s?void 0:s.map((({value:e})=>e))):void 0})),d=i.includes(n),c=d&&a.length,u=[];return(null==o?void 0:o.length)&&u.push(`tags NOT IN [${o}]`),l||u.push("variants.inventory_quantity > 0"),$&&u.push(`collections.id = '${$}'`),c&&oe(a[0]),{indexUid:i,q:"default"===t?"":B,hitsPerPage:1,facets:c?a[0]:[],filter:d?u.join(" AND "):""}}))};if(O&&ve?(r=O.result,je(!1)):r=await multiSearch(a),!r)return;const{results:d}=r;if(k(!1),Z(!1),H(!1),"totalDataPerIndex"===t)ie(null==i?void 0:i.map((e=>{const{index:t}=e,{totalHits:s}=(null==d?void 0:d.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetDistribution:e,facetStats:t}=(null==d?void 0:d.find((({indexUid:e})=>e.includes(n))))||{};de(e?Object.fromEntries(Object.entries(e).map((s=>{let i=s[0],n=[];return"variants.inventory_quantity"===i?(Object.keys(e[i]).map((t=>Boolean(Number(t))?e[i][t]:0)),n=[{name:"In Stock",value:"> 0"}]):n="variants.price"===i?t[i]:Object.keys(e[i]).map((t=>({name:t,value:t,total:e[i][t]||0}))),[i,n]}))):{})}};React.useEffect((()=>{if(!T)return;const e=new URLSearchParams(document.location.search);F((null==e?void 0:e.get(b))||""),(async e=>{let t,s;if(Z(!0),t=JSON.parse(e),!t)return;const{allowed_sorts:i,default_sort:n,filters:o,tabs:l,suffix_index_product:r,hidden_tags:a,display:d,colors:c,show_out_of_stock:u}=t;Q((null==i?void 0:i.length)?i:[]),te((null==o?void 0:o.length)?o:[]),re(r),ue(a),pe(d),ge(c),Re(n),he(u),s=l.find((({index:e})=>e.includes(r))),Object.keys(s).length&&(Y(s.index),K(s.name)),await Se(t,"default"),"default"===w&&await Se(t,"totalDataPerIndex")})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"")}),[T]),React.useEffect((()=>{if(Boolean(we&&(null==we?void 0:we.keyword)!==B)&&"default"===w){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&Se(e,"totalDataPerIndex")}),500);return()=>clearTimeout(t)}}),[B]);const fe="default"===w?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,Ae=(null==(c=null==xe?void 0:xe.filter)?void 0:c.enable_on_search)&&"horizontal"===(null==(u=null==xe?void 0:xe.filter)?void 0:u.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,Ce=(null==(x=null==xe?void 0:xe.filter)?void 0:x.enable_on_search)&&"vertical"===(null==(p=null==xe?void 0:xe.filter)?void 0:p.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,Ie=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(m=null==xe?void 0:xe.filter)?void 0:m.show_total_products)&&"vertical"===(null==(g=null==xe?void 0:xe.filter)?void 0:g.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"})]}),Le=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(_=null==xe?void 0:xe.filter)?void 0:_.show_total_products)&&"horizontal"===(null==(R=null==xe?void 0:xe.filter)?void 0:R.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:Te,children:[W?null:jsxRuntimeExports.jsx("div",{className:""+("default"===w&&(null==se?void 0:se.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===w&&(null==se?void 0:se.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:se.map((e=>{const{name:t,index:s,total:i}=e;let n=G===s;return jsxRuntimeExports.jsxs("li",{onClick:e=>((e,t,s)=>{Y(e),K(t),z(e.includes(le)?jsxRuntimeExports.jsx(ResultProduct,{}):jsxRuntimeExports.jsx(ResultCategory,{}))})(s,t),className:""+(n?"sledge-instant-search__result-tab-list-item-active":""),children:[t,jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-tab-total",children:i||0})]},s)}))}):null}),W&&(null==w?void 0:w.length)&&!O?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[fe,Ae,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(E=null==xe?void 0:xe.filter)?void 0:E.enable_on_search)&&"vertical"===(null==(h=null==xe?void 0:xe.filter)?void 0:h.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:Ce}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[Le,Ie]})]})]}):React.cloneElement(q,{isLoading:M,keyword:B,clickedTabIndexId:G,clickedTabIndexName:V,isLoadingSetting:J,allowedSorts:X,allowedFilters:ee,facets:ne,searchResultFacets:ae,hiddenTags:ce,displaySettings:xe,colorSwatches:me,defaultSort:_e,showOutOfStock:Ee,query:S,params:f,isJsVersion:j,productCardsComponent:P,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,onAfterRenderProduct:N,setIsLoading:H,setKeyword:F,filterHorizontalSkeleton:Ae,filterVerticalSkeleton:Ce,productGridSkeleton:Ie,searchAndSelectOptionSkeleton:Le,searchResultContainerRef:Te,data:O,settings:U})]})},ResultProduct=e=>{var t,s,i,n,o,l,r,a,d,c,u,x,p,m,g,_,R,E,h,v,j,T,w,S,f,A;const{keyword:C,clickedTabIndexId:I,isLoadingSetting:L,allowedSorts:N,allowedFilters:O,facets:y,searchResultFacets:b,hiddenTags:$,displaySettings:P,colorSwatches:D,defaultSort:U,showOutOfStock:W,query:k,params:M,isJsVersion:H,productCardsComponent:B,setKeyword:F,filterHorizontalSkeleton:G,filterVerticalSkeleton:Y,productGridSkeleton:V,searchAndSelectOptionSkeleton:K,onAfterAddToCart:q,onAfterAddWishlist:z,onAfterRemoveWishlist:J,onAfterRenderProduct:Z,searchResultContainerRef:X,data:Q,settings:ee}=e||{},{keyword:te=""}=k||{},{collectionId:se}=M||{},[ie,ne]=React.useState(!Q),[oe,le]=React.useState(!Q),[re,ae]=React.useState(!1),[de,ce]=React.useState(!1),[ue,xe]=React.useState(U||""),[pe,me]=React.useState(N&&Boolean(null==N?void 0:N.length)?null==(t=N.find((({value:e})=>e===U)))?void 0:t.label:""),[ge,_e]=React.useState((null==(s=null==P?void 0:P.search)?void 0:s.limit)||10),[Re,Ee]=React.useState(null),[he,ve]=React.useState({...W?{}:{"variants.inventory_quantity":"> 0"}}),[je,Te]=React.useState(!1),[we,Se]=React.useState((null==(o=null==(n=null==(i=null==Q?void 0:Q.result)?void 0:i.results)?void 0:n[0])?void 0:o.hits)||[]),[fe,Ae]=React.useState(0),[Ce,Ie]=React.useState(1),[Le,Ne]=React.useState(0),[Oe,ye]=React.useState((null==(a=null==(r=null==(l=null==Q?void 0:Q.result)?void 0:l.results)?void 0:r[0])?void 0:a.totalHits)||0),[be,$e]=React.useState([]),[Pe,De]=React.useState([]),[Ue,We]=React.useState(!1),[ke,Me]=React.useState(!0),[He,Be]=React.useState(Q?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(Fe=null==P?void 0:P.filter)?void 0:Fe.show_total_products)?jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[Oe," 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 Fe;const Ge=usePrevious({keyword:C,clickedLimitId:ge,clickedFacets:he}),{color:Ye,font_size:Ve,font_weight:Ke,text_transform:qe}=(null==(d=null==P?void 0:P.filter)?void 0:d.title)||{},{color:ze,font_size:Je,font_weight:Ze,text_transform:Xe}=(null==(c=null==P?void 0:P.filter)?void 0:c.option)||{},{text_color:Qe,border_color:et,border_radius:tt,padding_top:st,padding_bottom:it,padding_left:nt,padding_right:ot,background_color:lt,font_size:rt,font_weight:at,text_transform:dt}=(null==(u=null==P?void 0:P.filter)?void 0:u.button)||{},ct={...Ye&&{color:Ye},...Ve&&{fontSize:Ve},...Ke&&{fontWeight:Ke},...qe&&{textTransform:qe}},ut={...ze&&{color:ze},...Je&&{fontSize:Je},...Ze&&{fontWeight:Ze},...Xe&&{textTransform:Xe}},xt=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const l in i){(null==y?void 0:y.length)&&!y.includes(l)&&(n[l]=i[l])}for(const l in e)(null==(t=e[l])?void 0:t.length)&&(n[l]=e[l]);const o=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==o?void 0:o.length)?`?${o}`:""}`)},pt=e=>{Ee(e===Re?"":e)},mt=()=>{We(!0),ve({}),Te(!je),xt({}),$e([]),setTimeout((()=>{We(!1)}),10)},gt=(e,t,s=!1)=>{var i;We(!0);let n=[t],o=["variants.price"].includes(e);he&&(s?n=[t]:(null==(i=he[e])?void 0:i.includes(t))?n=he[e].filter((e=>e!==t)):o?(he[e],he[e]===t?(n=[],$e([])):n=t):n=he[e]?[...he[e],t]:[t]);let l={...he,[e]:n};xt(l),ve(l),Te(!je),setTimeout((()=>{We(!1)}),10)},_t=async(e=!1,t=!1)=>{var s,i;if(!I)return;e&&Ie(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&&ve(e),e})(he),l=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),l=["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]}`:l?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:l?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==$?void 0:$.length)&&l.push(`tags NOT IN [${$}]`),se&&l.push(`collections.id = '${se}'`);let r={q:C,sort:ue?[ue]:[],page:e?1:Ce,hitsPerPage:ge,facets:y,filter:l.join(" AND ")};Q&&ke?(n=null==(i=null==(s=null==Q?void 0:Q.result)?void 0:s.results)?void 0:i[0],Me(!1)):n=await search(I,r),((e,t)=>{var s;if(!e)return;const{hits:i,processingTimeMs:n,totalHits:o,totalPages:l}=e;t&&(null==C?void 0:C.length)&&searchTrigger({keyword:C,resultCount:o||0}),ne(!1),le(!1),Se(i),Ae(n||0),Ne(l),ye(o||0),Be(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(s=null==P?void 0:P.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}))})(n,t)},Rt=e=>{const t=new URLSearchParams(document.location.search);t.set(te,e),F&&F(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};React.useEffect((()=>{let e=Boolean(Ge&&((null==Ge?void 0:Ge.keyword)!==C||(null==Ge?void 0:Ge.clickedLimitId)!==ge||(null==Ge?void 0:Ge.clickedFacets)!==he));if(Boolean(Ge&&(null==Ge?void 0:Ge.keyword)!==C)){const e=setTimeout((()=>{_t(!0,!0)}),500);return()=>clearTimeout(e)}_t(e)}),[ue,ge,je,C,Ce,I]),React.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==P?void 0:P.filter)?void 0:e.enable_on_search)||(null==(t=null==P?void 0:P.filter)?void 0:t.hide_when_one_value)&&Oe<=1)return;let s=!1;s||null==O||O.map((e=>{const{collections:t,items:i}=e;(se&&(null==t?void 0:t.includes(Number(se)))||(null==t?void 0:t.includes("all")))&&(s=!0,De(i))}))})()}),[O,b,Oe]);const Et=({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:ut,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:()=>gt(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)},ht=e=>{var t,s;const{value:i,label:n,display:o}=e;let l=null,r=b[i],a=null==(t=null==P?void 0:P.filter)?void 0:t.show_number_matching_product;return"slider"===o.toLowerCase()?l=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[jsxRuntimeExports.jsx(Slider,{defaultValue:[be[0]||(null==r?void 0:r.min),be[1]||(null==r?void 0:r.max)],min:null==r?void 0:r.min,max:null==r?void 0:r.max,step:1,setValueCommit:e=>gt(i,e),setValueChange:e=>$e(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:be[0]||(null==r?void 0:r.min)}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:be[1]||(null==r?void 0:r.max)})]})]}):"checkbox"===o.toLowerCase()&&(null==r?void 0:r.length)?l=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==r?void 0:r.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=>gt(i,e.currentTarget.value),defaultChecked:he&&(null==(s=he[i])?void 0:s.includes(e.value)),labelStyle:ut})},t)}))}):"radio"===o.toLowerCase()&&(null==r?void 0:r.length)?l=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(RadioGroup,{id:i,name:i,onValueChange:e=>gt(i,e,!0),items:null==r?void 0:r.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:he&&(null==(s=he[i])?void 0:s.length)?he[i][0]:"",labelStyle:ut})}):"select"===o.toLowerCase()&&(null==r?void 0:r.length)?l=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Select,{placeholder:`Select ${n}`,name:i,onValueChange:e=>gt(i,e,!0),items:null==r?void 0:r.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:ut})}):"swatch"===o.toLowerCase()&&(null==r?void 0:r.length)&&(l=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==r?void 0:r.map(((e,t)=>{var s;let n=(null==D?void 0:D.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=>gt(i,e.currentTarget.value),defaultChecked:he&&(null==(s=he[i])?void 0:s.includes(e.value))})},t)}))})),l},vt=Pe.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=Re===s,l=b[s],r=Boolean("slider"===n.toLowerCase()?l:null==l?void 0:l.length),a=["select"].includes(n.toLowerCase())&&(null==l?void 0:l.length),d=["sledge-instant-search__result-filter-item-list"],c=ht(e);return"swatch"===n.toLowerCase()&&(null==l?void 0:l.length)&&d.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:()=>pt(s),children:[jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:ct,children:i}),jsxRuntimeExports.jsx(motion.div,{initial:!1,animate:o?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:15,height:15,color:"#000000"})})]}),o&&jsxRuntimeExports.jsx("ul",{className:d.join(" "),children:a?c:Ue?null:c})]},t):null})),jt=Pe.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=Re===s,l=b[s],r=Boolean("slider"===n.toLowerCase()?l:null==l?void 0:l.length),a=["radio","select"].includes(n.toLowerCase())&&(null==l?void 0:l.length),d=["sledge-instant-search__result-filter-item-list"],c=ht(e);return"swatch"===n.toLowerCase()&&(null==l?void 0:l.length)&&d.push("sledge-instant-search__result-filter-item-color-swatches"),r?jsxRuntimeExports.jsx("div",{className:"",children:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(Button,{type:"button",onClick:()=>pt(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:Ue?null:c})}),withOpenState:!1,setIsOpen:e=>Ee(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 Tt=[];Object.entries(he).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=Pe.filter((({value:e})=>null==e?void 0:e.includes(i))),l=(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?Tt.push({label:l,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{Tt.push({label:l,name:i,value:e})})):Tt.push({label:l,name:i,value:e[1][0]})}}));const wt=jsxRuntimeExports.jsx(Pagination,{currentPage:Ce,totalPage:Le,totalResult:Oe,onChange:e=>(e=>{Ie(e),setTimeout((()=>{scrollToElement(X.current,50)}),200)})(e)});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(x=null==P?void 0:P.filter)?void 0:x.enable_on_search)&&"horizontal"===(null==(p=null==P?void 0:P.filter)?void 0:p.layout)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ie&&!Q?G:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:L&&!Q?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:G}):jt.every((e=>!e))?null:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:jt}),Boolean((null==Tt?void 0:Tt.length)&&(null==(m=null==P?void 0:P.filter)?void 0:m.show_refine_by_block))?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Boolean(Tt.every((e=>!e)))?null: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:mt,children:"Clear All"}),Tt.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Et({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==P?void 0:P.filter)?void 0:g.layout,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(_=null==P?void 0:P.filter)?void 0:_.enable_on_search)&&"vertical"===(null==(R=null==P?void 0:P.filter)?void 0:R.layout)?ie?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:Y}):vt.every((e=>!e))?null:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:L?Y:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Boolean((null==Tt?void 0:Tt.length)&&(null==(E=null==P?void 0:P.filter)?void 0:E.show_refine_by_block))?Boolean(Tt.every((e=>!e)))?null: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:mt,children:"Clear All"})]}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:Tt.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Et({label:s,name:i,value:n,index:t})}))})]}):null,vt]})}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[ie?K:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(h=null==P?void 0:P.filter)?void 0:h.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:He}),jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:C,onChange:({value:e})=>Rt(e),onResetField:()=>Rt(""),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:ue||(null==ee?void 0:ee.default_sort),onChange:({label:e,value:t})=>((e,t)=>{ae(!1),me(e),xe(t)})(e,t)})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(v=null==P?void 0:P.search)?void 0:v.allowed_limit)&&Boolean(null==(T=null==(j=null==P?void 0:P.search)?void 0:j.allowed_limit)?void 0:T.length)&&jsxRuntimeExports.jsx(SelectField,{align:"end",options:P.search.allowed_limit.map((e=>({label:e,value:e}))),value:ge,onChange:({value:e})=>(e=>{ce(!1),_e(e)})(e)})]})]})]}),oe?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[V,(null==we?void 0:we.length)?wt:null]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["vertical"===(null==(w=null==P?void 0:P.filter)?void 0:w.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:He}),(null==we?void 0:we.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"large",data:we.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(S=null==P?void 0:P.search)?void 0:S.show_vendor,show_sku:null==(f=null==P?void 0:P.search)?void 0:f.show_sku,show_price:null==(A=null==P?void 0:P.search)?void 0:A.show_price},isComponentJsVersion:H,cards:B,showOptionOutOfStock:!0,onAfterAddToCart:q,onAfterAddWishlist:z,onAfterRemoveWishlist:J,onAfterRenderProduct:Z,dataWishlists:null==Q?void 0:Q.wishlists,dataReviews:null==Q?void 0:Q.reviews}),wt]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})]})]})})]})},ResultCategory=e=>{var t,s,i,n;const{keyword:o,clickedTabIndexId:l,clickedTabIndexName:r,setKeyword:a,searchResultContainerRef:d}=e||{},[c,u]=React.useState(!0),[x,p]=React.useState(!0),[m,g]=React.useState(""),[_,R]=React.useState([]),[E,h]=React.useState(0),[v,j]=React.useState(1),[T,w]=React.useState(0),[S,f]=React.useState(0),[A,C]=React.useState(null),I=usePrevious({keyword:o}),L=async()=>{if(!l)return;let e;p(!0);let t={q:o,sort:m?[m]:[],page:v,hitsPerPage:12};e=await search(l,t),(e=>{if(!e)return;const{hits:t,processingTimeMs:s,totalHits:i,totalPages:n}=e;u(!1),p(!1),R(t),h(s||0),w(n),f(i||0),C(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[i," result"," ",(null==o?void 0:o.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',o,'"']})]}):null]})}))})(e)};React.useEffect((()=>{if(Boolean(I&&(null==I?void 0:I.keyword)!==o)){const e=setTimeout((()=>{L()}),500);return()=>clearTimeout(e)}L()}),[m,o,v,l]);const N=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 ${r?r.toLowerCase():""}...`,value:o,onChange:({value:e})=>a&&a(e),onResetField:()=>a&&a(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),O=jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}),y=(null==(t=String(l))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(SkeletonLoading.CollectionGrid,{count:3}):(null==(s=String(l))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(SkeletonLoading.PageGrid,{count:12}):(null==(i=String(l))?void 0:i.includes("blog"))||(null==(n=String(l))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(SkeletonLoading.BlogGrid,{count:12}):null,b=()=>jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[N,O,y]}),$=()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[N,O,y]}),P=e=>{var t,s,i,n;return(null==(t=String(l))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(CollectionGrid,{...e}):(null==(s=String(l))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(PageGrid,{...e}):(null==(i=String(l))?void 0:i.includes("blog"))||(null==(n=String(l))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(BlogGrid,{...e}):null};return jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:c?jsxRuntimeExports.jsx(b,{}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:x?jsxRuntimeExports.jsx($,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[N,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:A}),(null==_?void 0:_.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(P,{data:_.map((e=>{const{id:t,title:s,url:i}=e;return{id:t,title:s,description:`${s}${r?` ${r.toLowerCase()}`:""}`,url:i,image:""}}))}),jsxRuntimeExports.jsx(Pagination,{currentPage:v,totalPage:T,totalResult:S,onChange:e=>(e=>{j(e),setTimeout((()=>{scrollToElement(d.current,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));detectInitSelector(element,(()=>{element.length&&element.map((item=>{var _a;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),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(SearchResultWidget,{query:{keyword:QUERY_KEYWORD||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null})})})}))}}))}))},SearchWidget=e=>{var t,s,i,n,o,l,r,a,d,c,u,x,p,m,g,_,R,E,h,v,j;const{isRenderApp:T,isJsVersion:w}=React.useContext(SledgeContext),{instantSearch:S}=T||{},{width:f="400px",children:A,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,onAfterRenderProduct:N}=e;let O=null,y=null,b=null,$=null;React.Children.map(A,(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)&&($=n)}}));const[P,D]=React.useState(!0),[U,W]=React.useState(""),[k,M]=React.useState([]),[H,B]=React.useState([]),[F,G]=React.useState({}),[Y,V]=React.useState({}),[K,q]=React.useState(""),z=usePrevious({keyword:U}),J=async(e,t=!1)=>{var s,i,n,o,l,r,a,d,c,u,x;if(!U.length)return;D(!0);const{tabs:p,suffix_index_product:m,hidden_tags:g,display:_,show_out_of_stock:R}=e,E=(null==(s=null==_?void 0:_.search)?void 0:s.suggestion)||{};let h,v={queries:p.map((e=>{const{index:t}=e;let s=t.includes(m),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(v),!h)return;const{results:j}=h;let T=null==j?void 0:j.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));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==j?void 0:j.filter((({indexUid:e})=>!(null==e?void 0:e.includes(m)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==p?void 0:p.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:[],f=U.length?(null==S?void 0:S.length)?"":"no_result":"zero_character",A=Boolean(!U.length&&Object.keys(E).length&&(null==(r=null==(l=E[f])?void 0:l.products)?void 0:r.active)&&(null==(c=null==(d=null==(a=E[f])?void 0:a.products)?void 0:d.list)?void 0:c.length));M(A?null==(x=null==(u=E[f])?void 0:u.products)?void 0:x.list:S),B(w),q(f),D(!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),V(null==(t=null==i?void 0:i.search)?void 0:t.suggestion),await J(s)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"")}),[U]),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:f};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,withCorner:!1,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(Y).length&&(null==(s=null==(t=Y[K])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=Y[K])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:y,keywords:Y[K].keywords.list,isComponentJsVersion:w}):null,H.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==(l=null==F?void 0:F.search)?void 0:l.show_vendor,show_sku:null==(r=null==F?void 0:F.search)?void 0:r.show_sku,show_price:null==(a=null==F?void 0:F.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:w,cards:O,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,onAfterRenderProduct:N})}):Object.keys(Y).length&&(null==(c=null==(d=Y[K])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=Y[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:Y[K].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==F?void 0:F.search)?void 0:m.show_vendor,show_sku:null==(g=null==F?void 0:F.search)?void 0:g.show_sku,show_price:null==(_=null==F?void 0:F.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:w,cards:O,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,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(Y).length&&(null==(E=null==(R=Y[K])?void 0:R.products)?void 0:E.active)&&(null==(j=null==(v=null==(h=Y[K])?void 0:h.products)?void 0:v.list)?void 0:j.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:$,keyword:U,isComponentJsVersion:w})}):null]})})})]})},SearchWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_WIDGET));detectInitSelector(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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,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:""}}},sledgeAnonymId:"",isJsVersion:!1}),CustomComponents=e=>null,BadgeFloatingFull=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:r,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=r||"/")},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 "+(l?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${l?"99+":o}`||0})]})]})})},BadgeFloatingIcon=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:r,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=r||"/")},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 "+(l?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${l?"99+":o}`||0})]})})})},BadgeHeaderMenu=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:r,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=r||"/")},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 "+(l?"sledge-wishlist__badge-fit-content":""),children:n||m?0:`${l?"99+":o}`||0})]})},getWishlist=async(e,t)=>{const{page:s,limit:i,sort:n,keyword:o,shareId:l}=e||{};let r=t||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),a="?"+new URLSearchParams({page:s||"",limit:i||"",sort:n||"",keyword:o||"",share_id:l||""}).toString(),d=`${API_URL}/wishlist${a}`;return await fetchApi(d,"GET",r).then((e=>e)).catch((()=>{}))},addWishlist=async e=>{const{productId:t,productVariantId:s,productName:i,productVendor:n,productSku:o,productVariantName:l,productLink:r,productImage:a,productCurrency:d,productPrice:c}=e;let u=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:l,url:r,image_url:a,currency:d,price:c})};return await fetchApi(x,"POST",u,p).then((e=>e)).catch((()=>{}))},bulkAddWishlist=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:l,productCurrency:r,productPrice:a}=e;return{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,variant_name:n,url:o,image_url:l,currency:r,price:a}})),i=`${API_URL}/wishlist/bulk`,n={products:s};return await fetchApi(i,"POST",t,n,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},getWishlistInfo=async e=>{let t=e||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=`${API_URL}/wishlist/info`;return await fetchApi(s,"GET",t).then((e=>e)).catch((()=>{}))},checkWishlist=async(e,t)=>{let s=sanitizeDataId(e),i=t?sanitizeDataId(t):"",n=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",o="?"+new URLSearchParams({variant_id:i}).toString(),l=`${API_URL}/wishlist/check/${s}${o}`;return await fetchApi(l,"GET",n).then((e=>Boolean(e.data))).catch((()=>{}))},clearWishlist=async()=>{let e=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),t=`${API_URL}/wishlist/clear`;return await fetchApi(t,"DELETE",e).then((e=>e)).catch((()=>{}))},addToCartTrigger=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),i=`${API_URL}/wishlist/cart`;return await fetchApi(i,"POST",s,{product:JSON.stringify({id:sanitizeDataId(t)})}).then((e=>e)).catch((()=>{}))},BadgeRoot=e=>{const{children:t,useProxyUrl:s=!1,data:i}=e,{isRenderApp:n,triggerRenderMultipleComponent:o}=React.useContext(SledgeContext),{wishlist:l}=n||{},[r,a]=React.useState((null==i?void 0:i.total_data)||0),[d,c]=React.useState(!i),[u,x]=React.useState(!i),[p,m]=React.useState(!1),[g,_]=React.useState((null==i?void 0:i.proxy_url)||""),[R,E]=React.useState({}),h=async e=>{let t;t=JSON.parse(e),t&&(E(t),await(async()=>{var e,t,s;let i,n,o,l=!1;i=await getWishlistInfo(),l=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)||"",l&&(a(n),m(n>99),_(o),c(!1),x(!1))})())};return React.useEffect((()=>{l&&h(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||"")}),[l,o]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{isFirstLoading:d,isLoading:u,totalWishlist:r,isMaximizeTotalWishlist:p,proxyUrl:g,dataSettings:R,useProxyUrl:s})))})},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=(e=!1)=>{const t=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||"");if(!t)return;const{floating_button_type:s}=(null==t?void 0:t.launch_point)||{},i=String(s).includes("bottom");if("none"!==s)if(i){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 t=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(t&&"true"===t),children:jsxRuntimeExports.jsx(Badge.FloatingIcon,{position:s})})})}))}}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 t=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(t&&"true"===t),children:jsxRuntimeExports.jsx(Badge.FloatingFull,{position:s})})})}))}}else{let t=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BADGE));detectInitSelector(t,(()=>{t.length&&t.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,{})})})}))}}))}),e)}},ButtonDetail=e=>{var t,s,i,n,o;const{params:l,onAfterAddWishlist:r,onAfterRemoveWishlist:a}=e,{productId:d,productVariantId:c}=l||{},{isRenderApp:u,triggerRenderMultipleComponent:x,sledgeAnonymId:p}=React.useContext(SledgeContext),{wishlist:m}=u||{},[g,_]=React.useState(!0),[R,E]=React.useState(!0),[h,v]=React.useState(!1),[j,T]=React.useState({}),[w,S]=React.useState(!1),[f,A]=React.useState(!1),{is_required_login:C}=(null==(t=null==j?void 0:j.display)?void 0:t.global)||{},{type:I,icon:L,click_again_action:N,text_color:O,border_color:y,border_radius:b,padding_top:$,padding_bottom:P,padding_left:D,padding_right:U,background_color:W,font_size:k,font_weight:M,text_transform:H}=(null==(s=null==j?void 0:j.display)?void 0:s.button_detail)||{},{show:B,location:F}=(null==(i=null==j?void 0:j.display)?void 0:i.notification)||{},{before_adding_wishlist:G,after_adding_wishlist:Y,remove_from_wishlist:V}=(null==(n=null==j?void 0:j.languages)?void 0:n.button_detail)||{},{title_added_to_wishlist:K,text_added_to_wishlist:q,title_removed_to_wishlist:z,text_removed_to_wishlist:J}=(null==(o=null==j?void 0:j.languages)?void 0:o.notification)||{},Z={...O&&{color:O},...y&&{borderColor:y},...b&&{borderRadius:b},...$&&{paddingTop:$},...P&&{paddingBottom:P},...D&&{paddingLeft:D},...U&&{paddingRight:U},...W&&{backgroundColor:W},...k&&{fontSize:k},...M&&{fontWeight:M},...H&&{textTransform:H}},X=async()=>{let e;e=await checkWishlist(d,c),v(e)},Q=async e=>{var t,s,i,n,o,d,c;if(e.preventDefault(),e.stopPropagation(),f)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"}));S(!0),v(!h);let u=await addWishlist(l);200===(null==(t=null==u?void 0:u.status)?void 0:t.code)?(S(!1),(null==(i=null==(s=null==x?void 0:x.wishlist)?void 0:s.badge)?void 0:i.trigger)&&(null==(c=null==(n=null==x?void 0:x.wishlist)?void 0:n.badge)||c.trigger(!(null==(d=null==(o=null==x?void 0:x.wishlist)?void 0:o.badge)?void 0:d.value))),BadgeInitSelector(!0),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistTriggerUpdate&&window.sledgeWishlistTriggerUpdate()),X(),h?a&&a("success"):r&&r("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&B&&window.sledgeToastNotification({title:h?z:K,message:h?J:q,location:F,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(h?a&&a("failed"):r&&r("failed"),S(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&B&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:F,type:"failed"}))};React.useEffect((()=>{m&&("undefined"!=typeof window&&(window.sledgeWishlistButtonDetailUpdate=()=>{X()}),(async e=>{let t;E(!0),t=JSON.parse(e),t&&(T(t),E(!1),_(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[m]),React.useEffect((()=>{A(p&&C)}),[p]),React.useEffect((()=>{X()}),[c]);const ee=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[I&&String(I).toLowerCase().includes("icon")&&(null==L?void 0:L.length)?jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail-icon",dangerouslySetInnerHTML:{__html:L},style:{fill:O}}):null,f?G:I&&String(I).toLowerCase().includes("text")?w?h?"Adding...":"Removing...":h&&!N?Y:h?V:G:null]});return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-detail-wrapper",children:g?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"44px",rounded:"md",color:"lighten"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:I&&String(I).toLowerCase().includes("button")?jsxRuntimeExports.jsx(Button,{type:"button",fullWidth:!0,style:Z,...w||h&&!N?{disabled:!0}:{onClick:e=>Q(e)},children:ee}):jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail",style:Z,...w||h&&!N?{disabled:!0}:{onClick:e=>Q(e)},children:ee})})})},ButtonDetailInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BUTTON_DETAIL));detectInitSelector(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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})}})})}))}}))}))},Trigger=e=>{var t,s,i;const{params:n,forceActive:o=!1,hidden:l=!1,onAfterAddWishlist:r,onAfterRemoveWishlist:a,wishlistChecked:d}=e,{productId:c,productVariantId:u}=n||{},{isRenderApp:x,triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{wishlist:g}=x||{},_="#767676",R="outline",E="#F85538",h="fill",v="boolean"==typeof d,j=!!v&&d,[T,w]=React.useState(j?E:_),[S,f]=React.useState(j?h:R),[A,C]=React.useState(!!d),[I,L]=React.useState(!v),[N,O]=React.useState({}),[y,b]=React.useState({onAfterAddWishlist:r,onAfterRemoveWishlist:a}),[$,P]=React.useState(!1),[D,U]=React.useState(!0),{is_required_login:W}=(null==(t=null==N?void 0:N.display)?void 0:t.global)||{},{show:k,location:M}=(null==(s=null==N?void 0:N.display)?void 0:s.notification)||{},{title_added_to_wishlist:H,text_added_to_wishlist:B,title_removed_to_wishlist:F,text_removed_to_wishlist:G}=(null==(i=null==N?void 0:N.languages)?void 0:i.notification)||{},Y=async()=>{let e;"boolean"==typeof d&&D?(e=d,U(!1)):e=await checkWishlist(c,u),C(o||e)};React.useEffect((()=>{g&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{Y()}),(async e=>{let t;L(!0),t=JSON.parse(e),t&&(O(t),L(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[g]),React.useEffect((()=>{P(m&&W)}),[m]),React.useEffect((()=>{g&&Y()}),[g,u]);const V=(A||o)&&!$;return React.useEffect((()=>{V?(w(E),f(h)):(w(_),f(R))}),[A]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!I&&!l&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>(async e=>{var t,s,i,o,l,r;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"}));C(!A);let a=await addWishlist(n);const{status:c,data:u}=a||{},{code:x}=c||{};200===x?((null==(s=null==(t=null==p?void 0:p.wishlist)?void 0:t.badge)?void 0:s.trigger)&&"boolean"!=typeof d&&(null==(r=null==(i=null==p?void 0:p.wishlist)?void 0:i.badge)||r.trigger(!(null==(l=null==(o=null==p?void 0:p.wishlist)?void 0:o.badge)?void 0:l.value))),BadgeInitSelector(!0),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),Y(),A?y.onAfterRemoveWishlist&&y.onAfterRemoveWishlist("success"):y.onAfterAddWishlist&&y.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&k&&window.sledgeToastNotification({title:A?F:H,message:A?G:B,location:M,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(A?y.onAfterRemoveWishlist&&y.onAfterRemoveWishlist("failed"):y.onAfterAddWishlist&&y.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&k&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:M,type:"failed",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})}))})(e),onMouseEnter:()=>{V||(w(E),f(h))},onMouseLeave:()=>{V||(w(_),f(R))},children:jsxRuntimeExports.jsx(HeartIcon,{width:16.67,height:15.83,type:S,color:T})})})})},ElementInit=(item,element="")=>{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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})}})})}))},TriggerInitSelector=()=>{let e=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_TRIGGER));detectInitSelector(e,(()=>{e.length&&e.map((e=>{ElementInit(e,e)}))})),new MutationObserver((function(t){t.forEach((function(t){Array.prototype.slice.call(t.addedNodes).forEach((function(t){1===t.nodeType&&t.querySelector(SELECTOR.WISHLIST.ELEMENT_TRIGGER)&&(e=Array.from(t.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_TRIGGER)),e.length&&e.map((e=>{ElementInit(e,e)})))}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1})},WidgetHeaderClearTrigger=({buttonText:e,shareId:t,dataSettings:s,isFirstLoading:i})=>{var n,o,l,r,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:v,text_transform:j}=(null==(l=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:l.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:f}=(null==(r=null==s?void 0:s.languages)?void 0:r.popup)||{},{button_clear_all:A}=(null==(a=null==s?void 0:s.languages)?void 0:a.widget)||{},[C,I]=React.useState(!1),L={...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},...v&&{fontWeight:v},...j&&{textTransform:j}};React.useEffect((()=>{I(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:f,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:L,children:e||(A||"Clear Wishlist")})})})})})},WidgetHeaderShareTrigger=({wishlistData:e,buttonText:t,showShareTrigger:s,shareLink:i,shareId:n,dataSettings:o,isFirstLoading:l})=>{var r,a,d,c,u,x;const{triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{is_required_login:g}=(null==(r=null==o?void 0:o.display)?void 0:r.global)||{},{text_color:_,border_color:R,border_radius:E,padding_top:h,padding_bottom:v,padding_left:j,padding_right:T,background_color:w,font_size:S,font_weight:f,text_transform:A}=(null==(d=null==(a=null==o?void 0:o.display)?void 0:a.widget)?void 0:d.button_share)||{},{title_share_wishlist:C}=(null==(c=null==o?void 0:o.languages)?void 0:c.popup)||{},{button_share:I}=(null==(u=null==o?void 0:o.languages)?void 0:u.widget)||{},{title_added_all_to_wishlist:L,text_added_all_to_wishlist:N}=(null==(x=null==o?void 0:o.languages)?void 0:x.notification)||{},[O,y]=React.useState(!1),b={..._&&{color:_},...R&&{borderColor:R},...E&&{borderRadius:E},...h&&{paddingTop:h},...v&&{paddingBottom:v},...j&&{paddingLeft:j},...T&&{paddingRight:T},...w&&{backgroundColor:w},...S&&{fontSize:S},...f&&{fontWeight:f},...A&&{textTransform:A}},[$,P]=React.useState(!1);let D='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M15 17V20C15 20.2652 14.8946 20.5196 14.7071 20.7071C14.5196 20.8946 14.2652 21 14 21H4C3.73478 21 3.48043 20.8946 3.29289 20.7071C3.10536 20.5196 3 20.2652 3 20V8C3 7.73478 3.10536 7.48043 3.29289 7.29289C3.48043 7.10536 3.73478 7 4 7H7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M18 3H8C7.44772 3 7 3.44772 7 4V16C7 16.5523 7.44772 17 8 17H18C18.5523 17 19 16.5523 19 16V4C19 3.44772 18.5523 3 18 3Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>';const U=async()=>{var t,s,i,n,o,l,r;P(!0);let a=e.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:l,currency:r,price:a}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:l,productCurrency:r,productPrice:a}})),d=await bulkAddWishlist(a);200===(null==(t=null==d?void 0:d.status)?void 0:t.code)?("undefined"!=typeof window&&((null==(i=null==(s=null==p?void 0:p.wishlist)?void 0:s.badge)?void 0:i.trigger)&&(null==(r=null==(n=null==p?void 0:p.wishlist)?void 0:n.badge)||r.trigger(!(null==(l=null==(o=null==p?void 0:p.wishlist)?void 0:o.badge)?void 0:l.value))),BadgeInitSelector(),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:L,message:N,textCancel:"Cancel"})),P(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return React.useEffect((()=>{y(m&&g)}),[m]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!O&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:s&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:l?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:b,...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:U||{}}):"undefined"!=typeof window&&window.sledgeInfoPopup&&(window.sledgeInfoPopup({title:C,message:i?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${D}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${i}</div>\n </div>`:"",textCancel:"Cancel"}),(()=>{let e=!0;document.body.addEventListener("DOMNodeInserted",(()=>{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=D)}),2500)))}))}}))})())}},children:n?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:e.length}),$?"Adding...":"Add to your wishlist"]}):t||(I||"Share Wishlist")})})})})})},WidgetHeaderSearchForm=({setIsLoading:e,setKeyword:t,keyword:s,placeholder:i,dataSettings:n})=>{var o,l;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},{search_form_placeholder:d}=(null==(l=null==n?void 0:n.languages)?void 0:l.widget)||{},[c,u]=React.useState(!1),x=React.useRef(null);return React.useEffect((()=>{u(r&&a)}),[r]),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:l,font_weight:r,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},...l&&{fontSize:l},...r&&{fontWeight:r},...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=({options:e,defaultLimitOptions:t,selectedLimit:s,setSelectedLimit:i,setIsRefreshWidgetList:n,dataSettings:o})=>{var l;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:a}=(null==(l=null==o?void 0:o.display)?void 0:l.global)||{},[d,c]=React.useState(!1);let u=e||t;return React.useEffect((()=>{c(r&&a)}),[r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!d&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:u&&Boolean(null==u?void 0:u.length)&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx(SelectField,{align:"end",options:u.map((e=>({label:e,value:e}))),value:s||u[0],onChange:({value:e})=>(e=>{i&&i(e),n&&n(!0)})(e)})})})})},WidgetHeaderSort=({wishlistSort:e,selectedSort:t,setSelectedSort:s,setIsRefreshWidgetList:i,dataSettings:n})=>{var o,l;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},[d,c]=React.useState(!1);return React.useEffect((()=>{c(r&&a)}),[r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!d&&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||(null==(l=e[0])?void 0:l.value),onChange:({value:e})=>(e=>{s&&s(e),i&&i(!0)})(e)})})})})},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:l=defaultGridType}=e||{},{is_required_login:r}=(null==(t=null==o?void 0:o.display)?void 0:t.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(s&&r)}),[s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:8,type:l}):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:l,text_no_result:r}=(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":l),u(i?"Your search did not match any products. <br/> Please try again":r),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-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.jsx("a",{href:_,className:"sledge__button","data-button-color-type":"light",children:m})})]})},ProductWrapper=e=>{var t,s,i,n,o,l,r,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:v,onAfterRenderProduct:j,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:f,border_color:A,border_radius:C,padding_top:I,padding_bottom:L,padding_left:N,padding_right:O,background_color:y,font_size:b,font_weight:$,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:D,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:H,font_weight:B,text_transform:F}=(null==(r=null==(l=null==g?void 0:g.display)?void 0:l.widget)?void 0:r.product_name)||{},{button_add_to_cart:G}=(null==(a=null==g?void 0:g.languages)?void 0:a.widget)||{},Y={...f&&{color:f},...A&&{borderColor:A},...C&&{borderRadius:C},...I&&{paddingTop:I},...L&&{paddingBottom:L},...N&&{paddingLeft:N},...O&&{paddingRight:O},...y&&{backgroundColor:y},...b&&{fontSize:b},...$&&{fontWeight:$},...P&&{textTransform:P}},V={...D&&{color:D},...U&&{fontSize:U},...W&&{fontWeight:W},...k&&{textTransform:k}},K={...M&&{color:M},...H&&{fontSize:H},...B&&{fontWeight:B},...F&&{textTransform:F}};let q=u||0,z=p||0;const[J,Z]=React.useState(!1),[X,Q]=React.useState(!1);React.useEffect((()=>{Q(!(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:l,currency:r,price:a,vendor:d,sku:c}=(null==e?void 0:e.product)||{},u=new URL(o).pathname.split("/"),x=u[u.length-1];return{product:{id:t,admin_graphql_api_id:`${SHOPIFY_GID_PRODUCT_ID}${t}`,handle:x,title:i,image:{src:l},url:o,vendor:d,currency:r},variants:[{id:s,admin_graphql_api_id:`${SHOPIFY_GID_PRODUCT_VARIANT_ID}${s}`,title:n,price:a,sku:c}]}})),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:V,display_button_add_to_cart_style:Y},showOptionOutOfStock:!1,triggerPropAdditional:{forceActive:!0,...m&&{hidden:!0}},isComponentJsVersion:d,cards:R,onAfterAddToCart:E,onAfterAddWishlist:h,onAfterRemoveWishlist:v,onAfterRenderProduct:j,dataReviews:T,dataWishlists:ee}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),X&&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;const{children:s,query:i,params:n,customRoutePage:o,onAfterAddToCart:l,onAfterAddWishlist:r,onAfterRemoveWishlist:a,onAfterRenderProduct:d,data:c,dataInfo:u,dataReviews:x}=e,{shareId:p="share"}=i||{},{isRenderApp:m,triggerRenderMultipleComponent:g,sledgeAnonymId:_,isJsVersion:R}=React.useContext(SledgeContext),{wishlist:E}=m||{},[h,v]=React.useState(!c),[j,T]=React.useState(!c),[w,S]=React.useState((null==c?void 0:c.data)||[]),[f,A]=React.useState((null==c?void 0:c.sorts)||[]),[C,I]=React.useState(!1),[L,N]=React.useState(""),[O,y]=React.useState(""),[b,$]=React.useState(""),[P,D]=React.useState(1),[U,W]=React.useState((null==(t=null==c?void 0:c.page)?void 0:t.total_page)||0),[k,M]=React.useState(!1),[H,B]=React.useState(!!c),[F,G]=React.useState(""),[Y,V]=React.useState(null),[K,q]=React.useState(""),[z,J]=React.useState({}),[Z,X]=React.useState(!!c),Q=usePrevious({keyword:b,currentPage:P}),ee=DEFAULT_LIMIT_VALUE,te=async(e=!1,t=!1)=>{var s,i,o,l;const r=new URLSearchParams(document.location.search),a=(null==n?void 0:n.shareId)?n.shareId:(null==r?void 0:r.get(p))||"";let d;T(!e),e||(D(1),S([]));let u,x,m=!1,g=0,_={page:e?P:1,limit:O||ee[0],sort:L,keyword:b,shareId:a};d=c&&t?c:await getWishlist(_),m=200===(null==(s=null==d?void 0:d.status)?void 0:s.code)||!1,u=(null==(i=d.data)?void 0:i.length)?t=>(null==w?void 0:w.length)&&e?[...t,...d.data]:d.data:[],x=(null==(o=d.sorts)?void 0:o.length)?d.sorts:[],g=(null==(l=null==d?void 0:d.page)?void 0:l.total_page)||1,m&&(S(u),A(x),W(g),T(!1),I(!1))};React.useEffect((()=>{if(!E)return;let e=Boolean(Q&&(null==Q?void 0:Q.currentPage)!==P);if(Q&&(null==Q?void 0:Q.keyword)!==b){M(!0);const e=setTimeout((()=>{M(!1),te(void 0)}),500);return()=>clearTimeout(e)}te(!C&&e,!0)}),[E,b,P,C]),React.useEffect((()=>{if(!E)return;const e=new URLSearchParams(document.location.search);V((null==n?void 0:n.shareId)?n.shareId:(null==e?void 0:e.get(p))||""),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate=()=>{te()},window.sledgeWishlistWidgetClearList=()=>{(async()=>{var e,t,s,i,n,o,l;let r;T(!0);let a=!1;r=await clearWishlist(),a=200===(null==(e=null==r?void 0:r.status)?void 0:e.code),a?(await te(),(null==(s=null==(t=null==g?void 0:g.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(l=null==(i=null==g?void 0:g.wishlist)?void 0:i.badge)||l.trigger(!(null==(o=null==(n=null==g?void 0:g.wishlist)?void 0:n.badge)?void 0:o.value))),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;B(!1);let l,r,a,d=!1;u?(n={data:u},d=!0):(n=await getWishlistInfo(),d=200===(null==(e=null==n?void 0:n.status)?void 0:e.code)||!1),l=(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)||"",r=o?`${o}?${p}=${a}`:null==(i=null==n?void 0:n.data)?void 0:i.share_link,d&&(q(l),G(window.location.origin+r),B(!0))})(),(async e=>{let t;t=JSON.parse(e),t&&J(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""),v(!1)}),[E]),React.useEffect((()=>{var e;const{is_required_login:t}=(null==(e=null==z?void 0:z.display)?void 0:e.global)||{};X(_&&!t)}),[_,z]);let se=null,ie=null;React.Children.map(s,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,wishlistWidgetAlert:s}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(se=t),s&&isFunction(s)&&(ie=s)}}));const ne=ie?ie():null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-wrapper",children:[Z&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:h?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"99.5%",height:"72px",color:"lighten",rounded:"none",style:{margin:"0 auto"}}):ie?jsxRuntimeExports.jsx(React.Fragment,{children:R?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:ne}}):ne}):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(s)&&React.Children.map(s,(e=>React.cloneElement(e,{isLoading:j,isFirstLoading:h,wishlistData:w,wishlistSort:f,selectedSort:L,selectedLimit:O,keyword:b,currentPage:P,totalPage:U,defaultLimitOptions:ee,onSearch:k,showShareTrigger:H,shareLink:F,shareId:Y,proxyUrl:K,dataSettings:z,productCardsComponent:se,query:i,setIsLoading:T,setIsRefreshWidgetList:I,setSelectedSort:N,setSelectedLimit:y,setKeyword:$,setCurrentPage:D,onAfterAddToCart:l,onAfterAddWishlist:r,onAfterRemoveWishlist:a,onAfterRenderProduct:d,dataReviews:x})))]})})},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));detectInitSelector(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),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||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,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,{options:[10,25,50,100]})]}),jsxRuntimeExports.jsx(Widget.List,{gridType:"large"})]})})}))}}))}))},WishlistInitSelector=()=>{BadgeInitSelector(),TriggerInitSelector(),WidgetInitSelector(),ButtonDetailInitSelector()},ProductGrid=({type:e,className:t="",data:s,setting:i,showOptionOutOfStock:n=!1,triggerPropAdditional:o,sourceApp:l=null,isComponentJsVersion:r=!1,cards:a,onAfterAddToCart:d,onAfterAddWishlist:c,onAfterRemoveWishlist:u,onAfterRenderProduct:x,showPopupComponent:p,setShowPopupComponent:m,dataReviews:g,dataWishlists:_})=>{const{show_vendor:R=!0,show_sku:E=!0,show_price:h=!0,show_add_to_cart:v=!0,redirect_add_to_cart:j=!0,language_button_add_to_cart:T="Add To Cart",display_product_name_style:w={},display_price_style:S={},display_button_add_to_cart_style:f={}}=i||{},[A,C]=React.useState(null);return React.useEffect((()=>{x&&x("success")}),[]),jsxRuntimeExports.jsx("div",{className:`sledge__product-grid ${t}`,"data-grid-type":e,children:null==s?void 0:s.map(((e,t)=>{var s,i,x;const{product:I,variants:L}=e||{},{id:N,title:O,image:y,url:b,vendor:$="",currency:P}=I||{},{id:D="",title:U="",price:W="",sku:k=""}=(null==L?void 0:L.length)?L[0]:{};let M=A==D,H=!(!(null==L?void 0:L.length)||!Object.hasOwn(L[0],"inventory_quantity"))&&(!L[0].inventory_quantity&&n);const B=a?a({product:{...I,variants:L.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(L[t],"inventory_quantity")&&!s}})),...g&&Object.keys(g).length?{review:{total:(null==(s=null==g?void 0:g[N])?void 0:s.review_count)?null==g?void 0:g[N].review_count:0,average:(null==(x=null==(i=null==g?void 0:g[N])?void 0:i.rating)?void 0:x.average)?null==g?void 0:g[N].rating.average:0}}:{}},showPopupComponent:p,setShowPopupComponent:m}):null;return a?jsxRuntimeExports.jsx(React.Fragment,{children:r?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:B}}):B},t):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:b,onClick:()=>"instant-search"===l&&productClickTrigger({productId:N}),children:[jsxRuntimeExports.jsx(Trigger,{params:{productId:N,productVariantId:D,productName:O,productVendor:$,productSku:k,productVariantName:U,productLink:b,productImage:(null==y?void 0:y.src)||`${API_URL}/img/blank-image.png`,productCurrency:P,productPrice:W},...o,onAfterAddWishlist:c,onAfterRemoveWishlist:u,wishlistChecked:null==_?void 0:_[N]}),jsxRuntimeExports.jsx("img",{src:(null==y?void 0:y.src)||"",alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})]}),H?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:[O?jsxRuntimeExports.jsx("a",{href:b,onClick:()=>"instant-search"===l&&productClickTrigger({productId:N}),children:jsxRuntimeExports.jsx("h3",{style:w,children:O})}):null,h?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:jsxRuntimeExports.jsxs("p",{style:S,children:[P,W]})}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-text",children:[jsxRuntimeExports.jsx("div",{children:U}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:R?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Vendor: ",$]}):null}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:" | "}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:E?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["SKU: ",k]}):null})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(Rating,{params:{productId:N},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1,data:null==g?void 0:g[N]})})]})]}),v?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",style:{...f,...M&&{cursor:"wait"}},...M||H?{disabled:!0}:{onClick:()=>(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"===l?await addToCartTrigger({productId:s}):"instant-search"===l&&await addToCartTrigger$1({productId:s}),C(null),d&&d("success"),j?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"})})):(d&&d("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))})({id:D,quantity:1})},children:M?"Adding...":H?"Sold out":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[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",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.83562 1.50023C10.796 1.50023 12.4155 2.99397 12.6152 4.90442L12.6709 4.90507C13.7584 4.90507 15.0806 5.62732 15.5269 7.65307L16.1186 12.2333C16.3309 13.7116 16.0654 14.8973 15.3281 15.7478C14.5946 16.5938 13.4336 17.0416 11.9704 17.0416H5.7094C4.10215 17.0416 2.9824 16.6478 2.28565 15.8386C1.5859 15.0271 1.3519 13.8098 1.5904 12.2213L2.1724 7.70182C2.5549 5.62957 3.95365 4.90507 5.03665 4.90507C5.13014 4.04293 5.51889 3.22275 6.13562 2.60797C6.84437 1.90372 7.82162 1.50023 8.81987 1.50023H8.83562ZM12.6709 6.03007H5.03665C4.7059 6.03007 3.6004 6.16357 3.28315 7.87657L2.70415 12.3766C2.5159 13.6388 2.6614 14.5523 3.13765 15.1051C3.6079 15.6511 4.4494 15.9166 5.7094 15.9166H11.9704C12.7564 15.9166 13.8296 15.7598 14.4776 15.0113C14.9921 14.4181 15.1691 13.5346 15.0041 12.3848L14.4199 7.84582C14.1709 6.72757 13.5139 6.03007 12.6709 6.03007ZM11.023 8.11815C11.3335 8.11815 11.6027 8.37015 11.6027 8.68065C11.6027 8.99115 11.368 9.24315 11.0575 9.24315H11.023C10.7125 9.24315 10.4605 8.99115 10.4605 8.68065C10.4605 8.37015 10.7125 8.11815 11.023 8.11815ZM6.65042 8.11815C6.96092 8.11815 7.23017 8.37015 7.23017 8.68065C7.23017 8.99115 6.99467 9.24315 6.68417 9.24315H6.65042C6.33992 9.24315 6.08792 8.99115 6.08792 8.68065C6.08792 8.37015 6.33992 8.11815 6.65042 8.11815ZM8.83337 2.62522H8.82212C8.11637 2.62522 7.42862 2.90947 6.92987 3.40522C6.5236 3.80967 6.25789 4.34137 6.17193 4.90472L11.4814 4.90493C11.2887 3.61626 10.1743 2.62522 8.83337 2.62522Z",fill:"#393D4E"})}),jsxRuntimeExports.jsx("span",{children:T||"Add To Cart"})]})})}):null]},t)}))})},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:l="",...r}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__input-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField",name:l,children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("input",{className:"sledge__input-field",type:o,value:s,required:n,onChange:e=>(e=>{i&&i(e)})(e),...r})}),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})=>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:s,title:i,description:n,url:o,image:l}=e;return jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:l||`${API_URL}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})}),jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-text",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:i}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:n})]}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"success",elementType:"hyperlink",link:o,children:"Shop Now"})})]})]},t)}))}):null}),PageGrid$1="",PageGrid=({className:e="",data:t})=>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:s,title:i,description:n,url:o,image:l}=e;return jsxRuntimeExports.jsx("a",{href:o,children:jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:l||`${API_URL}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})}),jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:i}),jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:n})]})]})},t)}))}):null}),BlogGrid$1="",BlogGrid=({className:e="",data:t})=>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:s,title:i,date:n,description:o,url:l,image:r}=e;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:r||`${API_URL}/img/blank-image.png`,alt:"sledge-blog-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-title",children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsx("div",{children:i})})})}),(null==n?void 0:n.length)?jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-date",children:n}):null,jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-text",children:o})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",elementType:"hyperlink",link:l,children:"Learn More"})})]},t)}))}):null}),Tooltip$1="",Tooltip=({children:e,content:t,withArrow:s=!0,customArrow:i="",sideOffset:n=5,alignOffset:o=0,wrapTrigger:l=!0})=>{const[r,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)}),[r]),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:a,children:[jsxRuntimeExports.jsx($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:l?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="",withCorner:i=!0})=>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"})}),i&&jsxRuntimeExports.jsx($57acba87d6e25586$export$ac61190d9fc311a9,{className:"sledge__scroll-area-corner"})]})]}),SkeletonLoading$1="",SkeletonItem=({width:e,height:t,rounded:s,color:i,style:n={},className:o="",...l})=>{var r,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)||"")}),[]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:(null==(r=null==x?void 0:x.skeleton)?void 0:r.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,...l}):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:"40px",height:"40px",color:"darken",rounded:"sm"})}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md"})]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"134px",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-text",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"190px",height:"46px",color:"lighten",rounded:"md",style:{marginBottom:"16px"}})})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"117px",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.jsxs("div",{className:"sledge__collection-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"246px",height:"246px",color:"darken",rounded:"md"})}),jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-text",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"70px",color:"darken",rounded:"lg"})}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"47px",color:"darken",rounded:"md",style:{maxWidth:"357px"}})})]}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"darken",rounded:"md",style:{maxWidth:"117px"}})})]})]},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.jsxs("div",{className:"sledge__page-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"darken",rounded:"md",style:{borderTopRightRadius:0,borderBottomRightRadius:0}})}),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:"100%",height:"40px",color:"darken",rounded:"md"})}),jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"darken",rounded:"md",style:{maxWidth:"115px"}})})]})]},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.jsx("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(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md"})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"242px",marginTop:"26px",marginBottom:"12px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"80px",marginBottom:"27px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"80px",color:"lighten",rounded:"md",style:{maxWidth:"190px",marginBottom:"27px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md",style:{maxWidth:"117px"}})]})]})},s));return jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonLoading={Item:SkeletonItem,ReviewGrid:SkeletonReviewGrid,ProductGrid:SkeletonProductGrid,CollectionGrid:SkeletonCollectionGrid,PageGrid:SkeletonPageGrid,BlogGrid:SkeletonBlogGrid},consoleErrorStyle="color: white; background: black; border: 1px solid white; padding: 2px 5px; border-radius: 350px;";documentReady((()=>{let e=document.querySelector(`script[id="${SCRIPT_EMBED_ID}"]`);const t=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.API_KEY),s=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.INSTANT_SEARCH_API_KEY),i=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_ID),n=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_EMAIL),o=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_FULLNAME);getToken({API_KEY:t||"",INSTANT_SEARCH_API_KEY:s||"",USER_ID:i||"",USER_EMAIL:n||"",USER_FULLNAME:o||""}).then((e=>{var t,s,i;(null==(t=null==e?void 0:e.data)?void 0:t.token)?(ConfirmationPopupInitSelector(),InfoPopupInitSelector(),ToastNotificationInitSelector(),getSettings().then((e=>{var t,s,i,n,o,l,r,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==(l=null==e?void 0:e.data)?void 0:l.review)&&(localStorage.setItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING,JSON.stringify(null==(r=null==e?void 0:e.data)?void 0:r.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")}))):console.error("%cSledge",consoleErrorStyle,`${(null==(s=null==e?void 0:e.status)?void 0:s.code)?null==(i=null==e?void 0:e.status)?void 0:i.message:e}`)}))}));
1
+ import{R as React,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,r as $054eb8030ebde76e$export$f99233281efd08a0,s as $054eb8030ebde76e$export$393edc798c47379d,t as $054eb8030ebde76e$export$e19cd5f9376f8cee,u as $054eb8030ebde76e$export$d5c6c08dc2d3ca7,v as $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,w as $cb5cc270b50c6fcd$export$41fb9f06171c75f4,x as $cb5cc270b50c6fcd$export$602eac185826482c,y as $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,z as $cb5cc270b50c6fcd$export$f39c2d165cd861fe,A as $cb5cc270b50c6fcd$export$21b07c8f274aebd5,B as $67824d98245208a0$export$be92b6f5f03c0fe9,C as $67824d98245208a0$export$adb584737d712b70,D as $e698a72e93240346$export$be92b6f5f03c0fe9,E as $e698a72e93240346$export$adb584737d712b70,F as $faa2e61a3361514f$export$be92b6f5f03c0fe9,G as $faa2e61a3361514f$export$13921ac0cc260818,H as $faa2e61a3361514f$export$9a58ef0d7ad3278c,I as $faa2e61a3361514f$export$6521433ed15a34db,J as $f99a8c78507165f7$export$be92b6f5f03c0fe9,K as $f99a8c78507165f7$export$6d08773d2e66f8f2,L as $f99a8c78507165f7$export$adb584737d712b70,M as $cc7e05a45900e73f$export$6d08773d2e66f8f2,N as $cc7e05a45900e73f$export$d6e5bf9c43ea9319,O as $cc7e05a45900e73f$export$c3468e2714d175fa,P as $cc7e05a45900e73f$export$be92b6f5f03c0fe9,Q as $cc7e05a45900e73f$export$41fb9f06171c75f4,S as $cc7e05a45900e73f$export$4c8d1a57a761ef94,T as $cc7e05a45900e73f$export$f04a61298a47a40f,U as $cc7e05a45900e73f$export$602eac185826482c,V as $cc7e05a45900e73f$export$7c6e2c02157bb7d2,W as $cc7e05a45900e73f$export$2f60d3ec9ad468f2,X as $cc7e05a45900e73f$export$d5c6c08dc2d3ca7,Y as $cc7e05a45900e73f$export$bf1aedc3039c8d63,Z as reactExports,_ as motion,a0 as MasonryResponsive,a1 as Masonry,a2 as $d94698215c4408a7$export$be92b6f5f03c0fe9,a3 as $d94698215c4408a7$export$2c4cf1f7b42ef78c,a4 as $d94698215c4408a7$export$a455218a85c89869,a5 as $d94698215c4408a7$export$7a7fa4424cb20976,a6 as $d94698215c4408a7$export$f69c19e57285b83a,a7 as $a093c7e1ec25a057$export$2881499e37b75b9a,a8 as $a093c7e1ec25a057$export$be92b6f5f03c0fe9,a9 as $a093c7e1ec25a057$export$41fb9f06171c75f4,aa as $a093c7e1ec25a057$export$602eac185826482c,ab as $a093c7e1ec25a057$export$7c6e2c02157bb7d2,ac as $a093c7e1ec25a057$export$21b07c8f274aebd5,ad as $57acba87d6e25586$export$be92b6f5f03c0fe9,ae as $57acba87d6e25586$export$d5c6c08dc2d3ca7,af as $57acba87d6e25586$export$9a4e88b92edfce6b,ag as $57acba87d6e25586$export$6521433ed15a34db,ah as $57acba87d6e25586$export$ac61190d9fc311a9}from"./assets/vendor-f2befdd9.js";const root="",API_URL="https://sledge-api-preprod.offstack.io",INSTANT_SEARCH_ENGINE_URL="https://instant-search-engine.offstack.io",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"},PRODUCT_REVIEW:{RATING_SIZE:"data-rating-size",RATING_TOTAL:"data-rating-total",RATING_AVERAGE:"data-rating-average"},INSTANT_SEARCH:{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"}},LOCAL_STORAGE_KEY={ANONYM_ID:"sledge-anonym-id",AUTH_APP:"sledge-auth-app",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",EXPIRED_SETTING:"sledge-expired-setting"},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=[10,25,50,100],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/`,SHOPIFY_GID_PRODUCT_VARIANT_ID=`${SHOPIFY_GID}ProductVariant/`,PAYLOAD_API_ALIASES={Authorization:"zbNTHXQpW7OmI",Method:"Gba2Tb9Ys7JGu",GET:"JniUtw5dNfeKW",POST:"a9Dmw0qP9hvQE",PUT:"dEnOjbvTzULLK",DELETE:"pLC93Tvsu6g7H"},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)},detectInitSelector=(e,t,s)=>{let i=!1;s?e&&t():document.body.addEventListener("DOMNodeInserted",(()=>{!i&&e&&(i=!0,t())}))},getTextBetween=(e,t,s)=>{if(e&&s.includes(e)&&t&&s.includes(t)){let i=s.indexOf(e)+e.length;return s.substring(i,s.indexOf(t,i))}return s},isFunction=e=>"function"==typeof e,scrollToElement=(e,t)=>{if(e){var s=(null==e?void 0:e.getBoundingClientRect().top)+window.scrollY-t;window.scrollTo({top:s,behavior:"smooth"})}},getUnixTimestamp=(e,t)=>{let s=0;return e&&("day"===t&&(s=60*e*60*24),"hour"===t&&(s=60*e*60),"minute"===t&&(s=60*e),"second"===t&&(s=e)),Math.floor(Date.now()/1e3)+s},fetchApi=async(e,t,s,i={},n={},o=!0,l=!1)=>{var r=new Headers;o||(s&&r.append("Authorization",`Bearer ${s}`),Object.keys(n).length&&Object.keys(n).forEach((function(e){r.append(e,n[e])})));var a=new FormData;(o||l)&&(s&&o&&a.append(PAYLOAD_API_ALIASES.Authorization,s),a.append(PAYLOAD_API_ALIASES.Method,PAYLOAD_API_ALIASES[t]),Object.keys(i).length&&Object.keys(i).forEach((function(e){l&&(null==i?void 0:i.files)&&[...i.files].map((e=>{a.append("files",e,e.name)})),a.append(e,i[e])})));var d={method:o?"POST":t,redirect:"follow",headers:r,body:o||l?a:JSON.stringify(i)};return await fetch(`${e}`,d).then((e=>e.json())).then((e=>e))},getSettings=async e=>{let t=e||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.GENERAL_SETTING))||null,i=(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING))||null,n=(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING))||null,o=(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING))||null;if(getUnixTimestamp()<=Number(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.EXPIRED_SETTING))&&s&&i&&n&&o)return{status:{code:200},data:{general:JSON.parse(s),wishlist:JSON.parse(i),review:JSON.parse(n),instantsearch:JSON.parse(o)}};let l=`${API_URL}/app/settings`;return await fetchApi(l,"POST",t).then((e=>{var t;return 200===(null==(t=null==e?void 0:e.status)?void 0:t.code)&&"undefined"!=typeof localStorage&&localStorage.setItem(LOCAL_STORAGE_KEY.EXPIRED_SETTING,String(getUnixTimestamp(5,"minute"))),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:l}=e;let r="",a="",d=0;"undefined"!=typeof localStorage&&(r=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",a=localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",d=Number(localStorage.getItem(LOCAL_STORAGE_KEY.EXPIRED_AUTH_APP)));let c=Boolean(String(a.toLowerCase()).includes("anonymous")&&i),u=Boolean(!String(a.toLowerCase()).includes("anonymous")&&!i),x=getUnixTimestamp()<=d;if(r&&x&&!c&&!u)return{data:{token:r}};let p=`${API_URL}/app/token`,m={user:JSON.stringify({id:i||"",email:n||"",name:o||"",anonym:l||("undefined"!=typeof localStorage&&localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"")})};return await fetchApi(p,"POST",t||"",m).then((e=>{const{data:t}=e||{},{anonym:i,token:n,iat:o,exp:l}=t||{};return"undefined"!=typeof localStorage&&(localStorage.setItem(LOCAL_STORAGE_KEY.ANONYM_ID,i||""),localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP,n||""),localStorage.setItem(LOCAL_STORAGE_KEY.ISSUED_AUTH_APP,o||""),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(""),[l,r]=React.useState(""),[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:l,buttonSubmitType:a,onSubmit:c})=>{u(!0),t(e),i(s),o(n),r(l),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($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",{className:"sledge__alert-dialog-button sledge__alert-dialog-button-cancel",onClick:()=>u(!1),children:l})}),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$e19cd5f9376f8cee,{asChild:!0,children:jsxRuntimeExports.jsx("button",{className:`sledge__alert-dialog-button ${a}`,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(""),[l,r]=React.useState(!1);return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInfoPopup=({title:e,message:s,textCancel:n})=>{r(!0),t(e),i(s),o(n)})}),[]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:l,onOpenChange:r,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($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:()=>r(!1),children:n})}),jsxRuntimeExports.jsx("button",{className:"IconButton","aria-label":"Close",onClick:()=>r(!1),children:jsxRuntimeExports.jsx("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M1.22578 13.8248L0.175781 12.7748L5.95078 6.9998L0.175781 1.2248L1.22578 0.174805L7.00078 5.9498L12.7758 0.174805L13.8258 1.2248L8.05078 6.9998L13.8258 12.7748L12.7758 13.8248L7.00078 8.0498L1.22578 13.8248Z",fill:"currentColor"})})})]})]})})},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(""),[l,r]=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:l=null,type:a})=>{i(e),o(s),r(n),d(l),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,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:15,height:15,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":l})]})},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:l,withOpenState:r=!0,withArrow:a=!0,customArrow:d="",sideOffset:c=5,alignOffset:u=0})=>{const[x,p]=React.useState(!!r&&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,{...r&&{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 ${l||""}`,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,defaultChecked:o,labelStyle:l={},onClick:r})=>jsxRuntimeExports.jsxs("div",{className:"sledge__checkbox-wrapper",children:[jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__checkbox-root",defaultChecked:o,id:e,name:t,value:s,required:i,onClick:r,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:l,children:n})]}),Slider$1="",Slider=e=>{const{defaultValue:t,min:s,max:i,step:n=1,setValueCommit:o,setValueChange:l}=e,[r,a]=React.useState(t);return jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsxs($faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:t,min:s,max:i,step:n,"aria-label":"Volume",onValueCommit:e=>{o&&o(e),a(e)},onValueChange:e=>{l&&l(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:r[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="#23BC45"/></svg>',wrapTrigger:!1,children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),jsxRuntimeExports.jsx(Tooltip,{content:r[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="#23BC45"/></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:17,height:17,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:17,height:17,color:"black"})})]})},RadioGroup$1="",RadioGroup=({id:e,name:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:l})=>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:l,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:l,onClick:r})=>{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:l,id:e,name:t,value:s,required:o,onClick:r,style:a})})},Select$1="",Select=({name:e,placeholder:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:l})=>jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:e,required:s,onValueChange:l,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 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.6334 3.33398C23.9899 3.33398 27.5887 6.65342 28.0324 10.8989L28.1562 10.9003C30.5729 10.9003 33.5112 12.5053 34.5029 17.007L35.8179 27.1853C36.2896 30.4703 35.6996 33.1053 34.0612 34.9953C32.4312 36.8753 29.8512 37.8703 26.5996 37.8703H12.6862C9.11458 37.8703 6.62625 36.9953 5.07792 35.197C3.52292 33.3936 3.00292 30.6886 3.53292 27.1586L4.82625 17.1153C5.67625 12.5103 8.78458 10.9003 11.1912 10.9003C11.399 8.98444 12.2629 7.16182 13.6334 5.79565C15.2084 4.23065 17.3801 3.33398 19.5984 3.33398H19.6334ZM28.1562 13.4003H11.1912C10.4562 13.4003 7.99958 13.697 7.29458 17.5036L6.00792 27.5036C5.58958 30.3086 5.91292 32.3386 6.97125 33.567C8.01625 34.7803 9.88625 35.3703 12.6862 35.3703H26.5996C28.3462 35.3703 30.7312 35.022 32.1712 33.3586C33.3146 32.0403 33.7079 30.077 33.3412 27.522L32.0429 17.4353C31.4896 14.9503 30.0296 13.4003 28.1562 13.4003ZM24.4942 18.0405C25.1842 18.0405 25.7826 18.6005 25.7826 19.2905C25.7826 19.9805 25.2609 20.5405 24.5709 20.5405H24.4942C23.8042 20.5405 23.2442 19.9805 23.2442 19.2905C23.2442 18.6005 23.8042 18.0405 24.4942 18.0405ZM14.7774 18.0405C15.4674 18.0405 16.0657 18.6005 16.0657 19.2905C16.0657 19.9805 15.5424 20.5405 14.8524 20.5405H14.7774C14.0874 20.5405 13.5274 19.9805 13.5274 19.2905C13.5274 18.6005 14.0874 18.0405 14.7774 18.0405ZM19.6284 5.83398H19.6034C18.0351 5.83398 16.5067 6.46565 15.3984 7.56732C14.4956 8.46609 13.9051 9.64764 13.7141 10.8995L25.5129 10.9C25.0846 8.03628 22.6082 5.83398 19.6284 5.83398Z",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",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M6.22578 18.8248L5.17578 17.7748L10.9508 11.9998L5.17578 6.2248L6.22578 5.1748L12.0008 10.9498L17.7758 5.1748L18.8258 6.2248L13.0508 11.9998L18.8258 17.7748L17.7758 18.8248L12.0008 13.0498L6.22578 18.8248Z",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})})}),Button$1="",Button=React.forwardRef(((e,t)=>{const{className:s="",children:i,colorType:n="light",fullWidth:o=!1,elementType:l="button",link:r="",...a}=e;return"hyperlink"===l&&(null==r?void 0:r.length)?jsxRuntimeExports.jsx("a",{href:r,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:l,fieldRef:r,...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:r,...a}),d&&n?jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==r?void 0:r.current)&&r.current.focus(),o&&o({value:""}),l&&l()},children:jsxRuntimeExports.jsx("svg",{viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true",width:14,height:14,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"})})})}):null]})},SelectField$1="",SelectField=e=>{var t;const{className:s="",placeholder:i=null,prefixLabel:n=null,prefixSelectedLabel:o="",align:l="end",onChange:r,value:a="",options:d=[],LinkComponent:c,link:u}=e,[x,p]=React.useState(!1),m=(null==(t=null==d?void 0:d.filter((({value:e})=>e===a))[0])?void 0:t.label)||i;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})]}),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)=>{r&&r({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:l,className:"sledge__select-field-option-content",withArrow:!1})})},ProductGrid$1="",addToCart=async e=>{var t;let s=[];e.map((e=>{const{id:t,quantity:i}=e;s.push({id:t,quantity:i})}));let i=`${window.Shopify.routes.root}cart/add.js`,n={items:s};if(null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)return await fetchApi(i,"POST",null,n,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},getReview=async(e,t,s)=>{const{page:i,limit:n,sort:o,keyword:l,rating:r}=t||{};let a=sanitizeDataId(e),d=s||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),c="?"+new URLSearchParams({page:i||"",limit:n||"",sort:o||"",keyword:l||"",rating:r||""}).toString(),u=`${API_URL}/review/${a}${c}`;return await fetchApi(u,"GET",d).then((e=>e)).catch((()=>{}))},getReviewInfo=async e=>{let t=sanitizeDataId(e),s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),i=`${API_URL}/review/info/${t}`;return await fetchApi(i,"GET",s).then((e=>e)).catch((()=>{}))},getProductsReviewInfo=async(e,t)=>{let s=e.map((e=>sanitizeDataId(e))),i=t||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),n=`${API_URL}/review/info/ids/${s.join(",")}`;return await fetchApi(n,"GET",i).then((e=>e)).catch((()=>{}))},getReviewMedia=async()=>{let e=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),t=`${API_URL}/review/usermedia`;return await fetchApi(t,"GET",e).then((e=>e)).catch((()=>{}))},addReviewMedia=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=`${API_URL}/review/media`,i={files:e};return await fetchApi(s,"POST",t,i,{},!1,!0).then((e=>e)).catch((()=>{}))},deleteReviewMedia=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=`${API_URL}/review/usermedia/${e}`;return await fetchApi(s,"DELETE",t).then((e=>e)).catch((()=>{}))},addReview=async e=>{const{userFirstName:t,userLastName:s,userEmail:i,productId:n,productVariantId:o,rating:l,title:r,review:a,mediaIds:d}=e;let c=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:l,title:r,review:a,media_ids:d})};return await fetchApi(u,"POST",c,x).then((e=>e)).catch((()=>{}))},usePrevious=e=>{const t=React.useRef();return React.useEffect((()=>{t.current=e})),t.current},Rating=e=>{var t,s;const{total:i,average:n,size:o="md",params:l,withSkeletonLoading:r=!0,withTotal:a=!0,isScrollToElementWidget:d=!0,data:c,sledgeSettings:u}=e,{productId:x}=l||{},{isRenderApp:p,triggerRenderMultipleComponent:m}=React.useContext(SledgeContext),{productReview:g}=p||{},_=!c&&void 0===i&&void 0===n,[R,E]=React.useState(_),[h,v]=React.useState(_),[j,T]=React.useState(c||void 0!==i||void 0!==n?getSizing(o):{width:0,height:0}),[w,S]=React.useState((null==c?void 0:c.review_count)||i||0),[f,A]=React.useState((null==(t=null==c?void 0:c.rating)?void 0:t.average)||n||"0"),[C,I]=React.useState((null==u?void 0:u.review)||{}),[L,N]=React.useState(!0),O=usePrevious({productId:x}),{fill_color:y,outline_color:b}=(null==(s=null==C?void 0:C.display)?void 0:s.rating)||{},$=async(e,t=!1)=>{var s,i,n,o,l,r,a;if(e!==x)return;let d,u,p,g=!1,_=0;if(c&&L)p=c,g=!0,N(!1);else{if(d=await getReviewInfo(e),!d)return;const{status:t}=d;p=d.data;const{code:s}=t;g=200===s||!1}_=(null==p?void 0:p.review_count)?p.review_count:0,u=(null==(s=null==p?void 0:p.rating)?void 0:s.average)?p.rating.average:0,g&&(S(_),A(u),v(!1),E(!1),t&&(null==(n=null==(i=null==m?void 0:m.productReview)?void 0:i.rating)?void 0:n.value)&&(null==(l=null==(o=null==m?void 0:m.productReview)?void 0:o.rating)?void 0:l.trigger)&&(null==(a=null==(r=null==m?void 0:m.productReview)?void 0:r.rating)||a.trigger("")))},P=async e=>{let t;v(!0),t=JSON.parse(e),t&&(I(t),await(async()=>{void 0!==i||void 0!==n?v(!1):$(x)})())};return React.useEffect((()=>{if(!g)return;T("xs"===o?{width:14.4,height:14.4}:"sm"===o?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(O&&(null==O?void 0:O.productId)!==x)&&E(!0),P(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||null)}),[g,x]),React.useEffect((()=>{var e,t,s,i;!x||x&&(null==(t=null==(e=null==m?void 0:m.productReview)?void 0:e.rating)?void 0:t.value)!==x||(E(!0),$(null==(i=null==(s=null==m?void 0:m.productReview)?void 0:s.rating)?void 0:i.value,!0))}),[x,m]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{d&&setTimeout((()=>{scrollToElement(document.getElementById(ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET),50)}),200)},children:R&&r?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",{id:"sledge-product-review-icons-rating-icon-fill",viewBox:"0 0 30 29",fill:y||"#23BC45",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00014 17.7L1.20174 12.9C0.107339 12.0248 0.587339 10.2648 1.97614 10.0664L10.2001 9.69998L13.7121 0.895176C13.9569 0.407176 14.4545 0.0999756 15.0001 0.0999756C15.5457 0.0999756 16.0433 0.408776 16.2881 0.895176L19.8001 9.69998L28.0241 10.0664C29.4129 10.2648 29.8929 12.0248 28.7985 12.9L23.0001 17.7L24.5825 27.0712C24.7649 28.3496 23.4369 29.3064 22.2833 28.7288L15.0001 24.1L7.71694 28.7272C6.56174 29.3048 5.23534 28.348 5.41774 27.0696L7.00014 17.7Z"})}),jsxRuntimeExports.jsx("symbol",{id:"sledge-product-review-icons-rating-icon-line",viewBox:"0 0 30 29",stroke:b||"#8D9196",fill:"none",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00014 17.7L1.20174 12.9C0.107339 12.0248 0.587339 10.2648 1.97614 10.0664L10.2001 9.69998L13.7121 0.895176C13.9569 0.407176 14.4545 0.0999756 15.0001 0.0999756C15.5457 0.0999756 16.0433 0.408776 16.2881 0.895176L19.8001 9.69998L28.0241 10.0664C29.4129 10.2648 29.8929 12.0248 28.7985 12.9L23.0001 17.7L24.5825 27.0712C24.7649 28.3496 23.4369 29.3064 22.2833 28.7288L15.0001 24.1L7.71694 28.7272C6.56174 29.3048 5.23534 28.348 5.41774 27.0696L7.00014 17.7Z",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"})]})})]}),!h&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((e,t)=>{let s=Math.floor(parseFloat(f)),i=String(f).includes(",")?String(f).split(","):[],n=String(f).includes(".")?String(f).split("."):[],o=i.length||n.length?i[1]||n[1]:0,l="fill-0";return e>s&&s+1===e&&(l=`fill-${o}`),reactExports.createElement("svg",{...j,viewBox:"0 0 30 29","data-product-review-rating-fill":e<=s?"full":l,key:t},jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),a?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",w,")"]}):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 l=document.createElement("div");l.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_CONTAINER_WIDGET),e.appendChild(l),client.createRoot(l).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||""},size:s,withSkeletonLoading:!Boolean(o&&"false"===o),...null!=i?{total:i}:{},...null!=n?{average:n}:{}})})}))},RatingInitSelector=(e,t=!1)=>{let s=Array.from(document.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING));detectInitSelector(s,(()=>{s.length&&s.map((t=>{const s=t.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID);e&&e!==s||ElementInit$1(t)}))}),t),new MutationObserver((function(e){e.forEach((function(e){Array.prototype.slice.call(e.addedNodes).forEach((function(e){1===e.nodeType&&e.querySelector(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)&&(s=Array.from(e.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)),s.length&&s.map((e=>ElementInit$1(e))))}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1})},WidgetHeaderAddTrigger=({isFirstLoading:e,text:t,dataSettings:s,params:i,onAfterAddReview:n})=>{var o,l,r;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==(l=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:l.button_write_review)||{},{button_write_review:h}=(null==(r=null==s?void 0:s.languages)?void 0:r.widget)||{},v={...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",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(i,n),style:v,children:[jsxRuntimeExports.jsx("svg",{width:16,height:17,viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.8323 14.1264C14.1083 14.1264 14.3323 14.3504 14.3323 14.6264C14.3323 14.9024 14.1083 15.1264 13.8323 15.1264H8.99701C8.72101 15.1264 8.49701 14.9024 8.49701 14.6264C8.49701 14.3504 8.72101 14.1264 8.99701 14.1264H13.8323ZM10.7429 2.93576C10.7762 2.96176 11.8915 3.82843 11.8915 3.82843C12.2969 4.06976 12.6135 4.5011 12.7335 5.01176C12.8529 5.5171 12.7662 6.03843 12.4882 6.47909C12.4864 6.48203 12.4845 6.48494 12.4781 6.49358L12.4731 6.50025C12.4279 6.55972 12.2318 6.80776 11.2417 8.04815C11.2325 8.06441 11.2221 8.07963 11.2107 8.09443C11.1941 8.11624 11.1759 8.13628 11.1565 8.15453C11.089 8.23956 11.0176 8.3289 10.9426 8.42283L10.7907 8.61313C10.4772 9.00579 10.1053 9.47139 9.66407 10.0236L9.43764 10.3071C8.58586 11.3732 7.49499 12.7382 6.09755 14.4864C5.79155 14.8678 5.33288 15.0898 4.84021 15.0958L2.41421 15.1264H2.40755C2.17621 15.1264 1.97488 14.9678 1.92088 14.7418L1.37488 12.4278C1.26221 11.9484 1.37421 11.4538 1.68155 11.0698L7.96155 3.2151C7.96421 3.21243 7.96621 3.2091 7.96888 3.20643C8.65755 2.3831 9.90288 2.26176 10.7429 2.93576ZM7.26136 5.69133L2.46221 11.6944C2.34821 11.8371 2.30621 12.0211 2.34821 12.1978L2.80221 14.1211L4.82821 14.0958C5.02088 14.0938 5.19888 14.0078 5.31688 13.8611C5.92454 13.1008 6.68825 12.1452 7.47345 11.1627L7.75125 10.815L8.02952 10.4668C8.76591 9.54526 9.4934 8.63471 10.1021 7.87258L7.26136 5.69133ZM8.73888 3.84443L7.88603 4.91L10.7265 7.09062C11.2733 6.4058 11.633 5.95476 11.6662 5.91176C11.7755 5.73443 11.8182 5.48376 11.7609 5.24243C11.7022 4.9951 11.5482 4.78509 11.3262 4.65109C11.2789 4.61843 10.1555 3.74643 10.1209 3.71909C9.69821 3.38043 9.08155 3.4391 8.73888 3.84443Z",fill:"currentColor"})}),t||(h||"Add review")]})})},WidgetHeaderSort$1=({isFirstLoading:e,productReviewSort:t,dataSettings:s,setSelectedSort:i,setIsRefreshWidgetList:n})=>{var o,l;const{default_sort:r,show_sorting_options:a}=(null==(o=null==s?void 0:s.display)?void 0:o.widget)||{},[d,c]=React.useState(r||null),u=d||(null==(l=t[0])?void 0:l.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("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5919 9.13869C12.7359 9.13869 13.6666 10.0647 13.6666 11.2027C13.6666 12.3407 12.7359 13.2667 11.5919 13.2667C10.4473 13.2667 9.51593 12.3407 9.51593 11.2027C9.51593 10.0647 10.4473 9.13869 11.5919 9.13869ZM11.5919 10.1387C10.9986 10.1387 10.5159 10.616 10.5159 11.2027C10.5159 11.79 10.9986 12.2667 11.5919 12.2667C12.1846 12.2667 12.6666 11.79 12.6666 11.2027C12.6666 10.616 12.1846 10.1387 11.5919 10.1387ZM6.7202 10.7286C6.9962 10.7286 7.2202 10.9526 7.2202 11.2286C7.2202 11.5046 6.9962 11.7286 6.7202 11.7286H2.51953C2.24353 11.7286 2.01953 11.5046 2.01953 11.2286C2.01953 10.9526 2.24353 10.7286 2.51953 10.7286H6.7202ZM4.07533 2.66669C5.22 2.66669 6.15067 3.59335 6.15067 4.73135C6.15067 5.86935 5.22 6.79469 4.07533 6.79469C2.93133 6.79469 2 5.86935 2 4.73135C2 3.59335 2.93133 2.66669 4.07533 2.66669ZM4.07533 3.66669C3.48267 3.66669 3 4.14402 3 4.73135C3 5.31802 3.48267 5.79469 4.07533 5.79469C4.66867 5.79469 5.15067 5.31802 5.15067 4.73135C5.15067 4.14402 4.66867 3.66669 4.07533 3.66669ZM12.7941 4.26695C13.0701 4.26695 13.2941 4.49095 13.2941 4.76695C13.2941 5.04295 13.0701 5.26695 12.7941 5.26695H8.59407C8.31807 5.26695 8.09407 5.04295 8.09407 4.76695C8.09407 4.49095 8.31807 4.26695 8.59407 4.26695H12.7941Z",fill:"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})},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}}}},WidgetHeaderSummary=e=>{var t,s,i,n;const{params:o,dataSettings:l,summaryData:r,sledgeSettings:a}=e,{productId:d}=o||{},{fill_color:c,outline_color:u}=(null==(s=null==(t=null==l?void 0:l.display)?void 0:t.widget)?void 0:s.summary_bar)||{},{review_singular:x,review_plural:p}=(null==(i=null==l?void 0:l.languages)?void 0:i.widget)||{},[m,g]=React.useState(!0),[_,R]=React.useState(!0),[E,h]=React.useState(!0),[v,j]=React.useState(!r),[T,w]=React.useState(!1),[S,f]=React.useState(0|(null==r?void 0:r.review_count)),[A,C]=React.useState((null==r?void 0:r.rating)||{5:0,4:0,3:0,2:0,1:0}),[I,L]=React.useState((null==(n=null==r?void 0:r.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,l=0;if(r&&N)s=r,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}l=(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}:A,n=(null==(e=null==s?void 0:s.rating)?void 0:e.average)?s.rating.average:"0",o&&(f(l),C(i),L(n),h(!1),j(!1),g(!1),T&&R(!1))};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{j(!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&&!r?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"630px",height:"42px",color:"lighten",rounded:"md"}):E&&!r?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:I}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!v&&jsxRuntimeExports.jsx(Rating,{data:r,sledgeSettings:a,average:String(I),size:"md",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[S," ",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:r,sledgeSettings:a,average:e,size:"sm",withSkeletonLoading:!1,withTotal:!1,isScrollToElementWidget:!1}),jsxRuntimeExports.jsx(Progress,{value:String(A[e]),total:S,fillColor:c,outlineColor:u}),jsxRuntimeExports.jsxs("small",{children:["(",A[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:l,dataSettings:r,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)||r)?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(p.current,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==l?void 0:l.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReviewWrapper,{...e,data:m}),R]}):jsxRuntimeExports.jsx(WidgetListEmpty$1,{...e})})})},WidgetListEmpty$1=e=>{var t;const{dataSettings:s}=e||{},{title_no_result:i,text_no_result:n}=(null==(t=null==s?void 0:s.languages)?void 0:t.widget)||{},[o,l]=React.useState(""),[r,a]=React.useState("");return React.useEffect((()=>{l(i||"No reviews for this item yet!"),a(n||'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-title",dangerouslySetInnerHTML:{__html:o}}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-product-empty-description",dangerouslySetInnerHTML:{__html:r}})]})},ReviewWrapper=e=>{var t,s,i,n,o,l,r,a;let{productReviewData:d,currentPage:c,setCurrentPage:u,totalPage:x,totalData:p,dataSettings:m,setIsRefreshWidgetList:g,setIsReplaceWidgetList:_,LinkComponent:R,selectedSort:E,data:h,sledgeSettings:v}=e||{};m=(null==v?void 0:v.review)||m;const{type:j,rating_size:T,show_review_date:w}=(null==(t=null==m?void 0:m.display)?void 0:t.widget)||{},{text_color:S,border_color:f,border_radius:A,padding_top:C,padding_bottom:I,padding_left:L,padding_right:N,background_color:O,font_size:y,font_weight:b,text_transform:$}=(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:D,border_radius:U,padding_top:W,padding_bottom:k,padding_left:M,padding_right:H,background_color:B,font_size:F,font_weight:G,text_transform:Y}=(null==(o=null==(n=null==m?void 0:m.display)?void 0:n.widget)?void 0:o.verified)||{},{button_load_more:V,verified:K}=(null==(l=null==m?void 0:m.languages)?void 0:l.widget)||{},{name:q,image:z}=(null==(a=null==(r=null==m?void 0:m.display)?void 0:r.widget)?void 0:a.replier)||{},J={...S&&{color:S},...f&&{borderColor:f},...A&&{borderRadius:A},...C&&{paddingTop:C},...I&&{paddingBottom:I},...L&&{paddingLeft:L},...N&&{paddingRight:N},...O&&{backgroundColor:O},...y&&{fontSize:y},...b&&{fontWeight:b},...$&&{textTransform:$}},Z={...P&&{color:P},...D&&{borderWidth:"1px",borderStyle:"solid",borderColor:D},...U&&{borderRadius:U},...W&&{paddingTop:W},...k&&{paddingBottom:k},...M&&{paddingLeft:M},...H&&{paddingRight:H},...B&&{backgroundColor:B},...F&&{fontSize:F},...G&&{fontWeight:G},...Y&&{textTransform:Y}};let X=c||0,Q=x||0;const[ee,te]=React.useState(!1),[se,ie]=React.useState(!1),ne=()=>{u&&c&&u(c+1),te(!0)};React.useEffect((()=>{ie(!(Q===X&&!ee)&&Q>=X)}),[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...":V||"Load More"}),le=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:"30px",children:d.map(((e,t)=>{var s,i;const{user:{name:n},review:{rating:o,review:l,media:r,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("<span>","</span>",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:l.length>=250?`${l.slice(0,250)}...`:l})]}),(null==r?void 0:r.length)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:r.slice(0,4).map(((e,t)=>{const{type:s,file:i}=e;let n="image"===s?jsxRuntimeExports.jsx("img",{src:i,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`},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||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`,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-reply-status",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,{})})]}),re=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:l,review:r,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("<span>","</span>",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:l,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:r.length>=350?`${r.slice(0,350)}...`:r}),(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||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`,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-reply-status",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,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`},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"===j?re:le},WidgetRoot$1=e=>{var t,s,i,n;const{children:o,params:l,onAfterAddReview:r,data:a,sledgeSettings:d}=e,{productId:c}=l||{},{isRenderApp:u}=React.useContext(SledgeContext),{productReview:x}=u||{},[p,m]=React.useState(!a),[g,_]=React.useState(!a),[R,E]=React.useState(!1),[h,v]=React.useState(!1),[j,T]=React.useState((null==a?void 0:a.data)||[]),[w,S]=React.useState((null==a?void 0:a.sorts)||[]),[f,A]=React.useState((null==(s=null==(t=null==d?void 0:d.display)?void 0:t.widget)?void 0:s.default_sort)||""),[C,I]=React.useState(1),[L,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,$]=React.useState((null==d?void 0:d.review)||{}),[P,D]=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,l=f;if(_(!!t||!e),!e||t){let e=await M(s);const{review_per_page:n,default_sort:r}=(null==(i=null==e?void 0:e.display)?void 0:i.widget)||{};o=n||o,l=f||r,t||I(1),T([]),A(l)}let r,d,u=!1,x=0,p=0,g={page:e?C:1,limit:o,sort:l};if(a&&P?(D(!1),n=a):n=await getReview(c,g),!n)return;const{status:R,data:h,page:w,sorts:L}=n,{code:O}=R;u=200===O||!1,r=(null==h?void 0:h.length)?t=>(null==j?void 0:j.length)&&e?[...t,...h]:h:[],d=(null==L?void 0:L.length)?L:[],x=(null==w?void 0:w.total_page)||1,p=(null==w?void 0:w.total_data)||1,u&&(T(r),S(d),N(x),y(p),_(!1),E(!1),v(!1),m(!1))},M=async e=>{let t;if(t=JSON.parse(e),t)return $(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)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(!R&&e,h,t)}),[C,R,h,x,a]),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:l,isFirstLoading:p,isLoading:g,productReviewData:j,productReviewSort:w,selectedSort:f,currentPage:C,totalPage:L,totalData:O,dataSettings:b,setIsLoading:_,setIsRefreshWidgetList:E,setIsReplaceWidgetList:v,setSelectedSort:A,setCurrentPage:I,onAfterAddReview:r,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,l]=React.useState(""),[r,a]=React.useState(""),[d,c]=React.useState(""),[u,x]=React.useState(""),[p,m]=React.useState([]),[g,_]=React.useState([]),[R,E]=React.useState(""),[h,v]=React.useState(""),[j,T]=React.useState(!1),[w,S]=React.useState(""),[f,A]=React.useState({}),[C,I]=React.useState(0),[L,N]=React.useState({}),{text_color:O,border_color:y,border_radius:b,padding_top:$,padding_bottom:P,padding_left:D,padding_right:U,background_color:W,font_size:k,font_weight:M,text_transform:H}=(null==(t=null==(e=null==f?void 0:f.display)?void 0:e.widget)?void 0:t.verified)||{},{verified:B}=(null==(s=null==f?void 0:f.languages)?void 0:s.widget)||{},F={...O&&{color:O},...y&&{borderWidth:"1px",borderStyle:"solid",borderColor:y},...b&&{borderRadius:b},...$&&{paddingTop:$},...P&&{paddingBottom:P},...D&&{paddingLeft:D},...U&&{paddingRight:U},...W&&{backgroundColor:W},...k&&{fontSize:k},...M&&{fontWeight:M},...H&&{textTransform:H}},G=0===C,Y=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:r},review:{rating:d,title:u,review:p,media:g,reply:R,is_verified:h},created_at:j,settings:w}=e,{name:f,image:C}=(null==(s=null==(t=null==w?void 0:w.display)?void 0:t.widget)?void 0:s.replier)||{};l(r),a(d),c(u),x(p),m(g),_(R),E(f?String(String(f).includes("<span>")?String(f).split("<span>")[0]:String(f)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(i=R[0])?void 0:i.name):null==(o=R[0])?void 0:o.name),v(f?getTextBetween("<span>","</span>",f):"Admin"),T(h),S(new Intl.DateTimeFormat("en-US").format(new Date(j))),n(!0),A(w),I(0),N({name:f,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("svg",{width:18,height:18,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"#A7A7A7",fillRule:"evenodd",clipRule:"evenodd"})})}),(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,alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`,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:()=>I(C-1),children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"white"})}),!Y&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-next",onClick:()=>I(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}),j?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-verified-text",style:F,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:r,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==L?void 0:L.image)||"",alt:"sledge-review-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`,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-reply-status",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;const{sledgeAnonymId:n,triggerRenderMultipleComponent:o}=React.useContext(SledgeContext),[l,r]=React.useState(!1),[a,d]=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}]),[c,u]=React.useState(a[0]),[x,p]=React.useState(!1),[m,g]=React.useState(null),[_,R]=React.useState(!1),[E,h]=React.useState(!1),[v,j]=React.useState(!1),[T,w]=React.useState(null),[S,f]=React.useState({}),[A,C]=React.useState({onAfterAddReview:e=>{}}),[I,L]=React.useState(""),[N,O]=React.useState(""),[y,b]=React.useState(""),[$,P]=React.useState(""),[D,U]=React.useState(""),[W,k]=React.useState(0),[M,H]=React.useState(""),[B,F]=React.useState(""),[G,Y]=React.useState([]),[V,K]=React.useState([]),{title_added_to_review:q,text_added_to_review:z}=(null==(e=null==S?void 0:S.languages)?void 0:e.notification)||{},{title_confirm_add_review:J,text_confirm_add_review:Z,button_submit_confirm_add_review:X,button_cancel_confirm_add_review:Q}=(null==(t=null==S?void 0:S.languages)?void 0:t.popup)||{},{navigation_previous:ee,navigation_next:te,button_submit:se}=(null==(s=null==S?void 0:S.languages)?void 0:s.write_review_form)||{},ie=async()=>{let e;R(!0);let t=!1;if(e=await addReview({userFirstName:I,userLastName:N,userEmail:y,productId:$,productVariantId:D,rating:W,title:M,review:B,mediaIds:G}),!e)return;const{status:{code:s}}=e;t=200===s,t?(A.onAfterAddReview("success"),setTimeout((()=>{var e,t,s,i;R(!1),r(!1),u(a[0]),L(""),O(""),b(""),k(0),H(""),F(""),Y([]),K([]),oe&&oe(),"undefined"!=typeof window&&((null==(t=null==(e=null==o?void 0:o.productReview)?void 0:e.rating)?void 0:t.trigger)&&(null==(i=null==(s=null==o?void 0:o.productReview)?void 0:s.rating)||i.trigger($)),RatingInitSelector($,!0),window.sledgeProductReviewWidgetListUpdate&&window.sledgeProductReviewWidgetListUpdate(),window.sledgeProductReviewWidgetSummaryUpdate&&window.sledgeProductReviewWidgetSummaryUpdate(),window.sledgeToastNotification&&window.sledgeToastNotification({title:q,message:z,type:"success",icon:jsxRuntimeExports.jsx(StarIcon,{width:40,height:40,color:"black"})}))}),500)):(A.onAfterAddReview("failed"),R(!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"})}))},ne=()=>{const e=a.findIndex((e=>e.key===c.key));d((e=>e.map((e=>(e.key===c.key&&(e.isDone=!0),e))))),u(a[e+1])},oe=async()=>{let e,t=!1,s=[],i=[];if(e=await getReviewMedia(),!e)return;const{status:n,data:o}=e,{code:l}=n;t=200===l||!1,s=(null==o?void 0:o.ids)||[],i=(null==o?void 0:o.media)||[],t&&(Y(s),K(i),h(!1),j(!1),w(null))},le=()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:J,message:Z,textSubmit:X,textCancel:Q,buttonSubmitType:"success",onSubmit:ie||{}})};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetFormAdd=(e,t)=>{const{productId:s,productVariantId:i}=e||{};r(!0),P(s||""),U(i||""),t&&C({onAfterAddReview:t})}),(async e=>{let t;t=JSON.parse(e),t&&(f(t),await oe())})(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||null)}),[]),React.useEffect((()=>{u(a[0])}),[n]),React.useEffect((()=>{switch(null==c?void 0:c.key){case"Step_SelectRate":p(!!W),g(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:te}),jsxRuntimeExports.jsx(ArrowRightIcon,{width:18,height:18,color:"black"})]}));break;case"Step_WriteReview":p(!0),g(n?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:te}),jsxRuntimeExports.jsx(ArrowRightIcon,{width:18,height:18,color:"black"})]}):se);break;case"Step_PersonalData":p(!0),g(se)}}),[c,W,B,I,y,n]),React.useEffect((()=>{l?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[l]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:l,onOpenChange:r,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-form-add-content",children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$be92b6f5f03c0fe9,{className:"sledge-product-review__widget-form-review FormRoot",onSubmit:e=>(e=>{e.preventDefault(),"Step_SelectRate"===(null==c?void 0:c.key)?ne():n&&"Step_WriteReview"===(null==c?void 0:c.key)?ne&&ne():le&&le()})(e),"data-active-step":(null==c?void 0:c.key)||"","data-visible-next":x,children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step",children:(null==c?void 0:c.component)&&React.cloneElement(jsxRuntimeExports.jsx(c.component,{}),{steps:a,activeStep:c,isLoadingAddReview:_,isLoadingUploadMedia:E,isLoadingDeleteMedia:v,selectedDeleteMediaId:T,dataSettings:S,postUserFirstName:I,postUserLastName:N,postUserEmail:y,postRating:W,postReview:B,postMedia:V,setIsLoadingUploadMedia:h,setIsLoadingDeleteMedia:j,setSelectedDeleteMediaId:w,handleNext:ne,handleProductReviewMedia:oe,handleAddReview:ie,setPostUserFirstName:L,setPostUserLastName:O,setPostUserEmail:b,setPostRating:k,setPostTitle:H,setPostReview:F,confirmAddReview:le})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-add-step-navigator",children:[(null==(i=a[0])?void 0:i.key)===(null==c?void 0:c.key)?jsxRuntimeExports.jsx("span",{}):jsxRuntimeExports.jsx("span",{onClick:()=>{const e=a.findIndex((e=>e.key===c.key));0!==e&&(d((e=>e.map((e=>(e.key===c.key&&(e.isDone=!1),e))))),u(a[e-1]))},children:ee}),x&&jsxRuntimeExports.jsx($d94698215c4408a7$export$2c4cf1f7b42ef78c,{asChild:!0,disabled:_,children:jsxRuntimeExports.jsx(Button,{role:"button",colorType:"light",style:{..._&&{cursor:"wait"}},children:_?"Adding...":m})})]})]})})]})})},Step_SelectRate=e=>{var t,s,i,n;const{postRating:o,setPostRating:l,setPostTitle:r,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:v}=(null==(s=null==(t=null==a?void 0:a.display)?void 0:t.write_review_form)?void 0:s.button_select_rating)||{},{title:j,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:f,rating_2:A,rating_1:C}=T||{},I={...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},...v&&{textTransform:v}},L=[{rate:5,title:w},{rate:4,title:S},{rate:3,title:f},{rate:2,title:A},{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:j}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-select-rate-list",children:L.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,l&&l(t),void(r&&r(s));var t,s},style:{...I,..._&&R?{backgroundColor:e.rate===o?R:_}:{}},children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{average:e.rate,size:"md",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:l,postReview:r,setIsLoadingUploadMedia:a,setIsLoadingDeleteMedia:d,setSelectedDeleteMediaId:c,handleNext: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,v]=React.useState(!1),j=async()=>{if(!n)return;let e;d&&d(!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"})})):(d&&d(!1),c&&c(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((()=>{v(!1)}),[]),React.useEffect((()=>{n&&h&&(v(!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:j||{}}))}),[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;a&&a(!0);let s=!1,i=[],n=[];t=await addReviewMedia(e),t||(a&&a(!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:l}=t||{},{code:r}=o||{};s=200===r,i=(null==l?void 0:l.ids)||[],n=(null==l?void 0:l.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"})})):(a&&a(!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:r,onChange:e=>g&&g(e.target.value)}),(null==l?void 0:l.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-filled",children:[l.map(((e,t)=>{const{id:s,file:o,type:l}=e;let r=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:[r?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:()=>{v(!0),c&&c(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"===l?jsxRuntimeExports.jsx("img",{src:o,className:"sledge-product-review__widget-form-upload-media-filled-item-file",alt:"sledge-review-uploaded-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`}):jsxRuntimeExports.jsx("video",{controls:!r,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,setPostUserFirstName:l,setPostUserLastName:r,setPostUserEmail:a}=e,{user:d}=(null==(t=null==s?void 0:s.languages)?void 0:t.write_review_form)||{},{title:c,first_name_form_placeholder:u,last_name_form_placeholder:x,email_form_placeholder:p}=d||{};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:c}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-group-flex",children:[jsxRuntimeExports.jsx(InputField,{name:"userFirstName",type:"text",required:!0,placeholder:u,onChange:e=>l&&l(e.target.value),value:i}),jsxRuntimeExports.jsx(InputField,{name:"userLastName",type:"text",required:!0,placeholder:x,onChange:e=>r&&r(e.target.value),value:n})]}),jsxRuntimeExports.jsx(InputField,{name:"userEmail",type:"email",required:!0,placeholder:p,onChange:e=>a&&a(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));detectInitSelector(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)({element:item,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));detectInitSelector(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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,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:l,onAfterAddWishlist:r,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:l,onAfterAddWishlist:r,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=localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP),i=`${INSTANT_SEARCH_ENGINE_URL}/indexes/${e}/search`;return await fetchApi(i,"POST",s,t,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},multiSearch=async(e,t)=>{let s=t||localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP),i=`${INSTANT_SEARCH_ENGINE_URL}/multi-search`;return await fetchApi(i,"POST",s,e,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},searchTrigger=async e=>{const{keyword:t,resultCount:s}=e;let i=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),n=`${API_URL}/instantsearch/statistics/search`,o={keyword:t,result_count:s};return await fetchApi(n,"POST",i,o,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},productClickTrigger=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),i=`${API_URL}/instantsearch/statistics/click`,n={product:{id:sanitizeDataId(t)}};return await fetchApi(i,"POST",s,n,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},addToCartTrigger$1=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),i=`${API_URL}/instantsearch/statistics/cart`,n={product:{id:sanitizeDataId(t)}};return await fetchApi(i,"POST",s,n,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},OtherIndexLists=({listsComponent:e,name:t,items:s,isComponentJsVersion:i,showPopupComponent:n,setShowPopupComponent:o})=>{const l=e?e({name:t,items:s,showPopupComponent:n,setShowPopupComponent:o}):null;return e?i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:l}}):l: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})=>{const o=e?e({keywords:t,showPopupComponent:i,setShowPopupComponent:n}):null;return e?s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}}):o: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})=>{const o=e?e({keyword:t,showPopupComponent:i,setShowPopupComponent:n}):null;return e?s?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:o}}):o: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,l,r,a,d,c,u,x,p,m,g,_,R,E,h,v,j;const{isRenderApp:T}=React.useContext(SledgeContext),{instantSearch:w}=T||{},[S,f]=React.useState(!0),[A,C]=React.useState(!1),[I,L]=React.useState(""),[N,O]=React.useState([]),[y,b]=React.useState([]),[$,P]=React.useState({}),[D,U]=React.useState({}),[W,k]=React.useState({}),[M,H]=React.useState(""),[B,F]=React.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),G=React.useRef(null),Y=usePrevious({keyword:I}),V=async(e,t=!1,s=!1)=>{var i,n,o,l,r,a,d,c,u,x,p,m;f(!0);const{tabs:g,suffix_index_product:_,hidden_tags:R,display:E,show_out_of_stock:h}=e,v=(null==(i=null==E?void 0:E.search)?void 0:i.suggestion)||{};let j,T={queries:g.map((e=>{const{index:t}=e;let s=t.includes(_),i=[];return(null==R?void 0:R.length)&&i.push(`tags NOT IN [${R}]`),h||i.push("variants.inventory_quantity > 0"),{indexUid:t,q:I,hitsPerPage:s?6:4,filter:s?i.join(" AND "):""}}))};if(j=await multiSearch(T),!j)return;const{results:w}=j;let S=null==w?void 0:w.filter((({indexUid:e})=>null==e?void 0:e.includes(_)));t&&(null==I?void 0:I.length)&&searchTrigger({keyword:I,resultCount:(null==(n=S[0])?void 0:n.totalHits)||0});let A=(null==(o=null==w?void 0:w.filter((({indexUid:e})=>!(null==e?void 0:e.includes(_)))))?void 0:o.map((e=>{const{indexUid:t}=e,{name:s}=null==g?void 0:g.find((({index:e})=>e.includes(t)));return{...e,name:s||""}})))||[],C=(null==S?void 0:S.length)?null==(l=S[0])?void 0:l.hits:[],L=I.length?(null==C?void 0:C.length)?"":"no_result":"zero_character",N=Boolean(!I.length&&Object.keys(v).length&&(null==(a=null==(r=v[L])?void 0:r.products)?void 0:a.active)&&(null==(u=null==(c=null==(d=v[L])?void 0:d.products)?void 0:c.list)?void 0:u.length))?null==(p=null==(x=v[L])?void 0:x.products)?void 0:p.list:C;if(s){let e=N.map((({id:e})=>e)),t=await getProductsReviewInfo(e);200===(null==(m=null==t?void 0:t.status)?void 0:m.code)&&P(null==t?void 0:t.data)}else P({});O(N),b(A),H(L),f(!1)};return React.useEffect((()=>{w&&("undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:o=(()=>{}),suggestionKeywordListsComponent:l=(()=>{}),otherIndexListsComponent:r=(()=>{}),searchViewMoreResultComponent:a=(()=>{})})=>{C(!0),F({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:o,suggestionKeywordListsComponent:l,otherIndexListsComponent:r,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 V(s,!1,!0)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null))}),[w]),React.useEffect((()=>{A?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[A]),React.useEffect((()=>{if(Boolean(Y&&(null==Y?void 0:Y.keyword)!==I)){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&V(e,!0)}),500);return()=>clearTimeout(t)}}),[I]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:A,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==D?void 0:D.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:I,fieldRef:G,onChange:({value:e})=>L(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:A,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:A,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==(l=null==D?void 0:D.search)?void 0:l.show_vendor,show_sku:null==(r=null==D?void 0:D.search)?void 0:r.show_sku,show_price:null==(a=null==D?void 0:D.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:A,setShowPopupComponent:C,dataReviews:$})}):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:I}),". 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==D?void 0:D.search)?void 0:m.show_vendor,show_sku:null==(g=null==D?void 0:D.search)?void 0:g.show_sku,show_price:null==(_=null==D?void 0:D.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:A,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==(j=null==(v=null==(h=W[M])?void 0:h.products)?void 0:v.list)?void 0:j.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:B.searchViewMoreResultComponent,keyword:I,isComponentJsVersion:B.isJsVersion,showPopupComponent:A,setShowPopupComponent:C})}):null]})]})})})})]})]})})},SearchIconWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET));detectInitSelector(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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,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,l,r,a,d,c,u,x,p,m,g,_,R,E,h;const{isRenderApp:v,isJsVersion:j}=React.useContext(SledgeContext),{instantSearch:T}=v||{},{layoutType:w="default",query:S,params:f,children:A,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,onAfterRenderProduct:N,data:O,sledgeSettings:y}=e,{keyword:b=""}=S||{},{collectionId:$}=f||{};let P=null;React.Children.map(A,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(P=t)}}));const D="undefined"!=typeof document?new URLSearchParams(null==(t=null==document?void 0:document.location)?void 0:t.search):null,[U]=React.useState("undefined"!=typeof localStorage?JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"{}"):{}),[W,k]=React.useState(!O),[M,H]=React.useState(!O),[B,F]=React.useState(null==D?void 0:D.get(b)),[G,Y]=React.useState(null),[V,K]=React.useState(),[q,z]=React.useState(jsxRuntimeExports.jsx(ResultProduct,{})),[J,Z]=React.useState(!O),[X,Q]=React.useState((null==(s=null==y?void 0:y.instantsearch)?void 0:s.allowed_sorts)||[]),[ee,te]=React.useState((null==(i=null==y?void 0:y.instantsearch)?void 0:i.filters)||[]),[se,ie]=React.useState([]),[ne,oe]=React.useState([]),[le,re]=React.useState((null==(n=null==y?void 0:y.instantsearch)?void 0:n.suffix_index_product)||""),[ae,de]=React.useState({}),[ce,ue]=React.useState((null==(o=null==y?void 0:y.instantsearch)?void 0:o.hidden_tags)||[]),[xe,pe]=React.useState((null==(l=null==y?void 0:y.instantsearch)?void 0:l.display)||{}),[me,ge]=React.useState((null==(r=null==y?void 0:y.instantsearch)?void 0:r.colors)||[]),[_e,Re]=React.useState((null==(a=null==y?void 0:y.instantsearch)?void 0:a.default_sort)||""),[Ee,he]=React.useState(null==(d=null==y?void 0:y.instantsearch)?void 0:d.show_out_of_stock),[ve,je]=React.useState(!0),Te=React.useRef(null),we=usePrevious({keyword:B}),Se=async(e,t)=>{const{filters:s,tabs:i,suffix_index_product:n,hidden_tags:o,show_out_of_stock:l}=e;let r,a={queries:("product-filter"===w?i.filter((({index:e})=>null==e?void 0:e.includes(n))):i).map((e=>{const{index:i}=e;let r=!1,a=r?[]:null==s?void 0:s.map((e=>{const{collections:t,items:s}=e;return $&&(null==t?void 0:t.includes(Number($)))||(null==t?void 0:t.includes("all"))?(r=!0,null==s?void 0:s.map((({value:e})=>e))):void 0})),d=i.includes(n),c=d&&a.length,u=[];return(null==o?void 0:o.length)&&u.push(`tags NOT IN [${o}]`),l||u.push("variants.inventory_quantity > 0"),$&&u.push(`collections.id = '${$}'`),c&&oe(a[0]),{indexUid:i,q:"default"===t?"":B,hitsPerPage:1,facets:c?a[0]:[],filter:d?u.join(" AND "):""}}))};if(O&&ve?(r=O.result,je(!1)):r=await multiSearch(a),!r)return;const{results:d}=r;if(k(!1),Z(!1),H(!1),"totalDataPerIndex"===t)ie(null==i?void 0:i.map((e=>{const{index:t}=e,{totalHits:s}=(null==d?void 0:d.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetDistribution:e,facetStats:t}=(null==d?void 0:d.find((({indexUid:e})=>e.includes(n))))||{};de(e?Object.fromEntries(Object.entries(e).map((s=>{let i=s[0],n=[];return"variants.inventory_quantity"===i?(Object.keys(e[i]).map((t=>Boolean(Number(t))?e[i][t]:0)),n=[{name:"In Stock",value:"> 0"}]):n="variants.price"===i?t[i]:Object.keys(e[i]).map((t=>({name:t,value:t,total:e[i][t]||0}))),[i,n]}))):{})}};React.useEffect((()=>{if(!T)return;const e=new URLSearchParams(document.location.search);F((null==e?void 0:e.get(b))||""),(async e=>{let t,s;if(Z(!0),t=JSON.parse(e),!t)return;const{allowed_sorts:i,default_sort:n,filters:o,tabs:l,suffix_index_product:r,hidden_tags:a,display:d,colors:c,show_out_of_stock:u}=t;Q((null==i?void 0:i.length)?i:[]),te((null==o?void 0:o.length)?o:[]),re(r),ue(a),pe(d),ge(c),Re(n),he(u),s=l.find((({index:e})=>e.includes(r))),Object.keys(s).length&&(Y(s.index),K(s.name)),await Se(t,"default"),"default"===w&&await Se(t,"totalDataPerIndex")})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null)}),[T]),React.useEffect((()=>{if(Boolean(we&&(null==we?void 0:we.keyword)!==B)&&"default"===w){const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),t=setTimeout((()=>{e&&Se(e,"totalDataPerIndex")}),500);return()=>clearTimeout(t)}}),[B]);const fe="default"===w?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,Ae=(null==(c=null==xe?void 0:xe.filter)?void 0:c.enable_on_search)&&"horizontal"===(null==(u=null==xe?void 0:xe.filter)?void 0:u.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,Ce=(null==(x=null==xe?void 0:xe.filter)?void 0:x.enable_on_search)&&"vertical"===(null==(p=null==xe?void 0:xe.filter)?void 0:p.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,Ie=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(m=null==xe?void 0:xe.filter)?void 0:m.show_total_products)&&"vertical"===(null==(g=null==xe?void 0:xe.filter)?void 0:g.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"})]}),Le=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(_=null==xe?void 0:xe.filter)?void 0:_.show_total_products)&&"horizontal"===(null==(R=null==xe?void 0:xe.filter)?void 0:R.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:Te,children:[W?null:jsxRuntimeExports.jsx("div",{className:""+("default"===w&&(null==se?void 0:se.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===w&&(null==se?void 0:se.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:se.map((e=>{const{name:t,index:s,total:i}=e;let n=G===s;return jsxRuntimeExports.jsxs("li",{onClick:e=>((e,t,s)=>{Y(e),K(t),z(e.includes(le)?jsxRuntimeExports.jsx(ResultProduct,{}):jsxRuntimeExports.jsx(ResultCategory,{}))})(s,t),className:""+(n?"sledge-instant-search__result-tab-list-item-active":""),children:[t,jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-tab-total",children:i||0})]},s)}))}):null}),W&&(null==w?void 0:w.length)&&!O?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[fe,Ae,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(E=null==xe?void 0:xe.filter)?void 0:E.enable_on_search)&&"vertical"===(null==(h=null==xe?void 0:xe.filter)?void 0:h.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:Ce}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[Le,Ie]})]})]}):React.cloneElement(q,{isLoading:M,keyword:B,clickedTabIndexId:G,clickedTabIndexName:V,isLoadingSetting:J,allowedSorts:X,allowedFilters:ee,facets:ne,searchResultFacets:ae,hiddenTags:ce,displaySettings:xe,colorSwatches:me,defaultSort:_e,showOutOfStock:Ee,query:S,params:f,isJsVersion:j,productCardsComponent:P,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,onAfterRenderProduct:N,setIsLoading:H,setKeyword:F,filterHorizontalSkeleton:Ae,filterVerticalSkeleton:Ce,productGridSkeleton:Ie,searchAndSelectOptionSkeleton:Le,searchResultContainerRef:Te,data:O,settings:U})]})},ResultProduct=e=>{var t,s,i,n,o,l,r,a,d,c,u,x,p,m,g,_,R,E,h,v,j,T,w,S,f,A;const{keyword:C,clickedTabIndexId:I,isLoadingSetting:L,allowedSorts:N,allowedFilters:O,facets:y,searchResultFacets:b,hiddenTags:$,displaySettings:P,colorSwatches:D,defaultSort:U,showOutOfStock:W,query:k,params:M,isJsVersion:H,productCardsComponent:B,setKeyword:F,filterHorizontalSkeleton:G,filterVerticalSkeleton:Y,productGridSkeleton:V,searchAndSelectOptionSkeleton:K,onAfterAddToCart:q,onAfterAddWishlist:z,onAfterRemoveWishlist:J,onAfterRenderProduct:Z,searchResultContainerRef:X,data:Q,settings:ee}=e||{},{keyword:te=""}=k||{},{collectionId:se}=M||{},[ie,ne]=React.useState(!Q),[oe,le]=React.useState(!Q),[re,ae]=React.useState(!1),[de,ce]=React.useState(!1),[ue,xe]=React.useState(U||""),[pe,me]=React.useState(N&&Boolean(null==N?void 0:N.length)?null==(t=N.find((({value:e})=>e===U)))?void 0:t.label:""),[ge,_e]=React.useState((null==(s=null==P?void 0:P.search)?void 0:s.limit)||10),[Re,Ee]=React.useState(null),[he,ve]=React.useState({...W?{}:{"variants.inventory_quantity":"> 0"}}),[je,Te]=React.useState(!1),[we,Se]=React.useState((null==(o=null==(n=null==(i=null==Q?void 0:Q.result)?void 0:i.results)?void 0:n[0])?void 0:o.hits)||[]),[fe,Ae]=React.useState(0),[Ce,Ie]=React.useState(1),[Le,Ne]=React.useState(0),[Oe,ye]=React.useState((null==(a=null==(r=null==(l=null==Q?void 0:Q.result)?void 0:l.results)?void 0:r[0])?void 0:a.totalHits)||0),[be,$e]=React.useState([]),[Pe,De]=React.useState([]),[Ue,We]=React.useState(!1),[ke,Me]=React.useState(!0),[He,Be]=React.useState(Q?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(Fe=null==P?void 0:P.filter)?void 0:Fe.show_total_products)?jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[Oe," 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 Fe;const Ge=usePrevious({keyword:C,clickedLimitId:ge,clickedFacets:he}),{color:Ye,font_size:Ve,font_weight:Ke,text_transform:qe}=(null==(d=null==P?void 0:P.filter)?void 0:d.title)||{},{color:ze,font_size:Je,font_weight:Ze,text_transform:Xe}=(null==(c=null==P?void 0:P.filter)?void 0:c.option)||{},{text_color:Qe,border_color:et,border_radius:tt,padding_top:st,padding_bottom:it,padding_left:nt,padding_right:ot,background_color:lt,font_size:rt,font_weight:at,text_transform:dt}=(null==(u=null==P?void 0:P.filter)?void 0:u.button)||{},ct={...Ye&&{color:Ye},...Ve&&{fontSize:Ve},...Ke&&{fontWeight:Ke},...qe&&{textTransform:qe}},ut={...ze&&{color:ze},...Je&&{fontSize:Je},...Ze&&{fontWeight:Ze},...Xe&&{textTransform:Xe}},xt=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const l in i){(null==y?void 0:y.length)&&!y.includes(l)&&(n[l]=i[l])}for(const l in e)(null==(t=e[l])?void 0:t.length)&&(n[l]=e[l]);const o=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==o?void 0:o.length)?`?${o}`:""}`)},pt=e=>{Ee(e===Re?"":e)},mt=()=>{We(!0),ve({}),Te(!je),xt({}),$e([]),setTimeout((()=>{We(!1)}),10)},gt=(e,t,s=!1)=>{var i;We(!0);let n=[t],o=["variants.price"].includes(e);he&&(s?n=[t]:(null==(i=he[e])?void 0:i.includes(t))?n=he[e].filter((e=>e!==t)):o?(he[e],he[e]===t?(n=[],$e([])):n=t):n=he[e]?[...he[e],t]:[t]);let l={...he,[e]:n};xt(l),ve(l),Te(!je),setTimeout((()=>{We(!1)}),10)},_t=async(e=!1,t=!1)=>{var s,i;if(!I)return;e&&Ie(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&&ve(e),e})(he),l=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),l=["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]}`:l?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:l?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==$?void 0:$.length)&&l.push(`tags NOT IN [${$}]`),se&&l.push(`collections.id = '${se}'`);let r={q:C,sort:ue?[ue]:[],page:e?1:Ce,hitsPerPage:ge,facets:y,filter:l.join(" AND ")};Q&&ke?(n=null==(i=null==(s=null==Q?void 0:Q.result)?void 0:s.results)?void 0:i[0],Me(!1)):n=await search(I,r),((e,t)=>{var s;if(!e)return;const{hits:i,processingTimeMs:n,totalHits:o,totalPages:l}=e;t&&(null==C?void 0:C.length)&&searchTrigger({keyword:C,resultCount:o||0}),ne(!1),le(!1),Se(i),Ae(n||0),Ne(l),ye(o||0),Be(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(s=null==P?void 0:P.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}))})(n,t)},Rt=e=>{const t=new URLSearchParams(document.location.search);t.set(te,e),F&&F(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};React.useEffect((()=>{let e=Boolean(Ge&&((null==Ge?void 0:Ge.keyword)!==C||(null==Ge?void 0:Ge.clickedLimitId)!==ge||(null==Ge?void 0:Ge.clickedFacets)!==he));if(Boolean(Ge&&(null==Ge?void 0:Ge.keyword)!==C)){const e=setTimeout((()=>{_t(!0,!0)}),500);return()=>clearTimeout(e)}_t(e)}),[ue,ge,je,C,Ce,I]),React.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==P?void 0:P.filter)?void 0:e.enable_on_search)||(null==(t=null==P?void 0:P.filter)?void 0:t.hide_when_one_value)&&Oe<=1)return;let s=!1;s||null==O||O.map((e=>{const{collections:t,items:i}=e;(se&&(null==t?void 0:t.includes(Number(se)))||(null==t?void 0:t.includes("all")))&&(s=!0,De(i))}))})()}),[O,b,Oe]);const Et=({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:ut,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:()=>gt(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)},ht=e=>{var t,s;const{value:i,label:n,display:o}=e;let l=null,r=b[i],a=null==(t=null==P?void 0:P.filter)?void 0:t.show_number_matching_product;return"slider"===o.toLowerCase()?l=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[jsxRuntimeExports.jsx(Slider,{defaultValue:[be[0]||(null==r?void 0:r.min),be[1]||(null==r?void 0:r.max)],min:null==r?void 0:r.min,max:null==r?void 0:r.max,step:1,setValueCommit:e=>gt(i,e),setValueChange:e=>$e(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:be[0]||(null==r?void 0:r.min)}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:be[1]||(null==r?void 0:r.max)})]})]}):"checkbox"===o.toLowerCase()&&(null==r?void 0:r.length)?l=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==r?void 0:r.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=>gt(i,e.currentTarget.value),defaultChecked:he&&(null==(s=he[i])?void 0:s.includes(e.value)),labelStyle:ut})},t)}))}):"radio"===o.toLowerCase()&&(null==r?void 0:r.length)?l=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(RadioGroup,{id:i,name:i,onValueChange:e=>gt(i,e,!0),items:null==r?void 0:r.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:he&&(null==(s=he[i])?void 0:s.length)?he[i][0]:"",labelStyle:ut})}):"select"===o.toLowerCase()&&(null==r?void 0:r.length)?l=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Select,{placeholder:`Select ${n}`,name:i,onValueChange:e=>gt(i,e,!0),items:null==r?void 0:r.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:ut})}):"swatch"===o.toLowerCase()&&(null==r?void 0:r.length)&&(l=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==r?void 0:r.map(((e,t)=>{var s;let n=(null==D?void 0:D.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=>gt(i,e.currentTarget.value),defaultChecked:he&&(null==(s=he[i])?void 0:s.includes(e.value))})},t)}))})),l},vt=Pe.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=Re===s,l=b[s],r=Boolean("slider"===n.toLowerCase()?l:null==l?void 0:l.length),a=["select"].includes(n.toLowerCase())&&(null==l?void 0:l.length),d=["sledge-instant-search__result-filter-item-list"],c=ht(e);return"swatch"===n.toLowerCase()&&(null==l?void 0:l.length)&&d.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:()=>pt(s),children:[jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:ct,children:i}),jsxRuntimeExports.jsx(motion.div,{initial:!1,animate:o?"open":"closed",variants:ROTATE_FILTER_ARROW_ANIMATION,children:jsxRuntimeExports.jsx(ChevronArrowDownIcon,{width:15,height:15,color:"#000000"})})]}),o&&jsxRuntimeExports.jsx("ul",{className:d.join(" "),children:a?c:Ue?null:c})]},t):null})),jt=Pe.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=Re===s,l=b[s],r=Boolean("slider"===n.toLowerCase()?l:null==l?void 0:l.length),a=["radio","select"].includes(n.toLowerCase())&&(null==l?void 0:l.length),d=["sledge-instant-search__result-filter-item-list"],c=ht(e);return"swatch"===n.toLowerCase()&&(null==l?void 0:l.length)&&d.push("sledge-instant-search__result-filter-item-color-swatches"),r?jsxRuntimeExports.jsx("div",{className:"",children:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(Button,{type:"button",onClick:()=>pt(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:Ue?null:c})}),withOpenState:!1,setIsOpen:e=>Ee(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 Tt=[];Object.entries(he).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=Pe.filter((({value:e})=>null==e?void 0:e.includes(i))),l=(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?Tt.push({label:l,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{Tt.push({label:l,name:i,value:e})})):Tt.push({label:l,name:i,value:e[1][0]})}}));const wt=jsxRuntimeExports.jsx(Pagination,{currentPage:Ce,totalPage:Le,totalResult:Oe,onChange:e=>(e=>{Ie(e),setTimeout((()=>{scrollToElement(X.current,50)}),200)})(e)});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(x=null==P?void 0:P.filter)?void 0:x.enable_on_search)&&"horizontal"===(null==(p=null==P?void 0:P.filter)?void 0:p.layout)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ie&&!Q?G:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:L&&!Q?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:G}):jt.every((e=>!e))?null:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-horizontal-wrapper",children:[jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal",children:jt}),Boolean((null==Tt?void 0:Tt.length)&&(null==(m=null==P?void 0:P.filter)?void 0:m.show_refine_by_block))?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Boolean(Tt.every((e=>!e)))?null: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:mt,children:"Clear All"}),Tt.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Et({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==P?void 0:P.filter)?void 0:g.layout,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(_=null==P?void 0:P.filter)?void 0:_.enable_on_search)&&"vertical"===(null==(R=null==P?void 0:P.filter)?void 0:R.layout)?ie?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:Y}):vt.every((e=>!e))?null:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:L?Y:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Boolean((null==Tt?void 0:Tt.length)&&(null==(E=null==P?void 0:P.filter)?void 0:E.show_refine_by_block))?Boolean(Tt.every((e=>!e)))?null: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:mt,children:"Clear All"})]}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:Tt.map(((e,t)=>{const{label:s,name:i,value:n}=e;return Et({label:s,name:i,value:n,index:t})}))})]}):null,vt]})}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[ie?K:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(h=null==P?void 0:P.filter)?void 0:h.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:He}),jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:C,onChange:({value:e})=>Rt(e),onResetField:()=>Rt(""),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:ue||(null==ee?void 0:ee.default_sort),onChange:({label:e,value:t})=>((e,t)=>{ae(!1),me(e),xe(t)})(e,t)})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(v=null==P?void 0:P.search)?void 0:v.allowed_limit)&&Boolean(null==(T=null==(j=null==P?void 0:P.search)?void 0:j.allowed_limit)?void 0:T.length)&&jsxRuntimeExports.jsx(SelectField,{align:"end",options:P.search.allowed_limit.map((e=>({label:e,value:e}))),value:ge,onChange:({value:e})=>(e=>{ce(!1),_e(e)})(e)})]})]})]}),oe?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[V,(null==we?void 0:we.length)?wt:null]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["vertical"===(null==(w=null==P?void 0:P.filter)?void 0:w.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:He}),(null==we?void 0:we.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"large",data:we.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(S=null==P?void 0:P.search)?void 0:S.show_vendor,show_sku:null==(f=null==P?void 0:P.search)?void 0:f.show_sku,show_price:null==(A=null==P?void 0:P.search)?void 0:A.show_price},isComponentJsVersion:H,cards:B,showOptionOutOfStock:!0,onAfterAddToCart:q,onAfterAddWishlist:z,onAfterRemoveWishlist:J,onAfterRenderProduct:Z,dataWishlists:null==Q?void 0:Q.wishlists,dataReviews:null==Q?void 0:Q.reviews}),wt]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})]})]})})]})},ResultCategory=e=>{var t,s,i,n;const{keyword:o,clickedTabIndexId:l,clickedTabIndexName:r,setKeyword:a,searchResultContainerRef:d}=e||{},[c,u]=React.useState(!0),[x,p]=React.useState(!0),[m,g]=React.useState(""),[_,R]=React.useState([]),[E,h]=React.useState(0),[v,j]=React.useState(1),[T,w]=React.useState(0),[S,f]=React.useState(0),[A,C]=React.useState(null),I=usePrevious({keyword:o}),L=async()=>{if(!l)return;let e;p(!0);let t={q:o,sort:m?[m]:[],page:v,hitsPerPage:12};e=await search(l,t),(e=>{if(!e)return;const{hits:t,processingTimeMs:s,totalHits:i,totalPages:n}=e;u(!1),p(!1),R(t),h(s||0),w(n),f(i||0),C(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[i," result"," ",(null==o?void 0:o.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',o,'"']})]}):null]})}))})(e)};React.useEffect((()=>{if(Boolean(I&&(null==I?void 0:I.keyword)!==o)){const e=setTimeout((()=>{L()}),500);return()=>clearTimeout(e)}L()}),[m,o,v,l]);const N=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 ${r?r.toLowerCase():""}...`,value:o,onChange:({value:e})=>a&&a(e),onResetField:()=>a&&a(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),O=jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"lighten",rounded:"md"})}),y=(null==(t=String(l))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(SkeletonLoading.CollectionGrid,{count:3}):(null==(s=String(l))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(SkeletonLoading.PageGrid,{count:12}):(null==(i=String(l))?void 0:i.includes("blog"))||(null==(n=String(l))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(SkeletonLoading.BlogGrid,{count:12}):null,b=()=>jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[N,O,y]}),$=()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[N,O,y]}),P=e=>{var t,s,i,n;return(null==(t=String(l))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(CollectionGrid,{...e}):(null==(s=String(l))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(PageGrid,{...e}):(null==(i=String(l))?void 0:i.includes("blog"))||(null==(n=String(l))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(BlogGrid,{...e}):null};return jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:c?jsxRuntimeExports.jsx(b,{}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:x?jsxRuntimeExports.jsx($,{}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[N,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:A}),(null==_?void 0:_.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(P,{data:_.map((e=>{const{id:t,title:s,url:i}=e;return{id:t,title:s,description:`${s}${r?` ${r.toLowerCase()}`:""}`,url:i,image:""}}))}),jsxRuntimeExports.jsx(Pagination,{currentPage:v,totalPage:T,totalResult:S,onChange:e=>(e=>{j(e),setTimeout((()=>{scrollToElement(d.current,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));detectInitSelector(element,(()=>{element.length&&element.map((item=>{var _a;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),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(SearchResultWidget,{query:{keyword:QUERY_KEYWORD||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null})})})}))}}))}))},SearchWidget=e=>{var t,s,i,n,o,l,r,a,d,c,u,x,p,m,g,_,R,E,h,v,j;const{isRenderApp:T,isJsVersion:w}=React.useContext(SledgeContext),{instantSearch:S}=T||{},{width:f="400px",children:A,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,onAfterRenderProduct:N}=e;let O=null,y=null,b=null,$=null;React.Children.map(A,(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)&&($=n)}}));const[P,D]=React.useState(!0),[U,W]=React.useState(""),[k,M]=React.useState([]),[H,B]=React.useState([]),[F,G]=React.useState({}),[Y,V]=React.useState({}),[K,q]=React.useState(""),z=usePrevious({keyword:U}),J=async(e,t=!1)=>{var s,i,n,o,l,r,a,d,c,u,x;if(!U.length)return;D(!0);const{tabs:p,suffix_index_product:m,hidden_tags:g,display:_,show_out_of_stock:R}=e,E=(null==(s=null==_?void 0:_.search)?void 0:s.suggestion)||{};let h,v={queries:p.map((e=>{const{index:t}=e;let s=t.includes(m),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(v),!h)return;const{results:j}=h;let T=null==j?void 0:j.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));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==j?void 0:j.filter((({indexUid:e})=>!(null==e?void 0:e.includes(m)))))?void 0:n.map((e=>{const{indexUid:t}=e,{name:s}=null==p?void 0:p.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:[],f=U.length?(null==S?void 0:S.length)?"":"no_result":"zero_character",A=Boolean(!U.length&&Object.keys(E).length&&(null==(r=null==(l=E[f])?void 0:l.products)?void 0:r.active)&&(null==(c=null==(d=null==(a=E[f])?void 0:a.products)?void 0:d.list)?void 0:c.length));M(A?null==(x=null==(u=E[f])?void 0:u.products)?void 0:x.list:S),B(w),q(f),D(!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),V(null==(t=null==i?void 0:i.search)?void 0:t.suggestion),await J(s)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||null)}),[U]),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:f};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,withCorner:!1,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(Y).length&&(null==(s=null==(t=Y[K])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=Y[K])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:y,keywords:Y[K].keywords.list,isComponentJsVersion:w}):null,H.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==(l=null==F?void 0:F.search)?void 0:l.show_vendor,show_sku:null==(r=null==F?void 0:F.search)?void 0:r.show_sku,show_price:null==(a=null==F?void 0:F.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:w,cards:O,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,onAfterRenderProduct:N})}):Object.keys(Y).length&&(null==(c=null==(d=Y[K])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=Y[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:Y[K].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==F?void 0:F.search)?void 0:m.show_vendor,show_sku:null==(g=null==F?void 0:F.search)?void 0:g.show_sku,show_price:null==(_=null==F?void 0:F.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:w,cards:O,onAfterAddToCart:C,onAfterAddWishlist:I,onAfterRemoveWishlist:L,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(Y).length&&(null==(E=null==(R=Y[K])?void 0:R.products)?void 0:E.active)&&(null==(j=null==(v=null==(h=Y[K])?void 0:h.products)?void 0:v.list)?void 0:j.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:$,keyword:U,isComponentJsVersion:w})}):null]})})})]})},SearchWidgetInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_WIDGET));detectInitSelector(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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,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:""}}},sledgeAnonymId:"",isJsVersion:!1}),CustomComponents=e=>null,BadgeFloatingFull=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:r,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=r||"/")},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 "+(l?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${l?"99+":o}`||0})]})]})})},BadgeFloatingIcon=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:r,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=r||"/")},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 "+(l?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${l?"99+":o}`||0})]})})})},BadgeHeaderMenu=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:l,proxyUrl:r,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=r||"/")},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 "+(l?"sledge-wishlist__badge-fit-content":""),children:n||m?0:`${l?"99+":o}`||0})]})},getWishlist=async(e,t)=>{const{page:s,limit:i,sort:n,keyword:o,shareId:l}=e||{};let r=t||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),a="?"+new URLSearchParams({page:s||"",limit:i||"",sort:n||"",keyword:o||"",share_id:l||""}).toString(),d=`${API_URL}/wishlist${a}`;return await fetchApi(d,"GET",r).then((e=>e)).catch((()=>{}))},addWishlist=async e=>{const{productId:t,productVariantId:s,productName:i,productVendor:n,productSku:o,productVariantName:l,productLink:r,productImage:a,productCurrency:d,productPrice:c}=e;let u=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:l,url:r,image_url:a,currency:d,price:c})};return await fetchApi(x,"POST",u,p).then((e=>e)).catch((()=>{}))},bulkAddWishlist=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:l,productCurrency:r,productPrice:a}=e;return{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,variant_name:n,url:o,image_url:l,currency:r,price:a}})),i=`${API_URL}/wishlist/bulk`,n={products:s};return await fetchApi(i,"POST",t,n,{"Content-Type":"application/json"},!1).then((e=>e)).catch((()=>{}))},getWishlistInfo=async e=>{let t=e||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),s=`${API_URL}/wishlist/info`;return await fetchApi(s,"GET",t).then((e=>e)).catch((()=>{}))},checkWishlist=async(e,t)=>{let s=sanitizeDataId(e),i=t?sanitizeDataId(t):"",n=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP)||"",o="?"+new URLSearchParams({variant_id:i}).toString(),l=`${API_URL}/wishlist/check/${s}${o}`;return await fetchApi(l,"GET",n).then((e=>Boolean(e.data))).catch((()=>{}))},clearWishlist=async()=>{let e=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),t=`${API_URL}/wishlist/clear`;return await fetchApi(t,"DELETE",e).then((e=>e)).catch((()=>{}))},addToCartTrigger=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),i=`${API_URL}/wishlist/cart`;return await fetchApi(i,"POST",s,{product:JSON.stringify({id:sanitizeDataId(t)})}).then((e=>e)).catch((()=>{}))},BadgeRoot=e=>{const{children:t,useProxyUrl:s=!1,data:i}=e,{isRenderApp:n,triggerRenderMultipleComponent:o}=React.useContext(SledgeContext),{wishlist:l}=n||{},[r,a]=React.useState((null==i?void 0:i.total_data)||0),[d,c]=React.useState(!i),[u,x]=React.useState(!i),[p,m]=React.useState(!1),[g,_]=React.useState((null==i?void 0:i.proxy_url)||""),[R,E]=React.useState({}),h=async e=>{let t;t=JSON.parse(e),t&&(E(t),await(async()=>{var e,t,s;let i,n,o,l=!1;i=await getWishlistInfo(),l=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)||"",l&&(a(n),m(n>99),_(o),c(!1),x(!1))})())};return React.useEffect((()=>{l&&h(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null)}),[l,o]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{isFirstLoading:d,isLoading:u,totalWishlist:r,isMaximizeTotalWishlist:p,proxyUrl:g,dataSettings:R,useProxyUrl:s})))})},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=(e=!1)=>{const t=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||"");if(!t)return;const{floating_button_type:s}=(null==t?void 0:t.launch_point)||{},i=String(s).includes("bottom");if("none"!==s)if(i){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 t=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(t&&"true"===t),children:jsxRuntimeExports.jsx(Badge.FloatingIcon,{position:s})})})}))}}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 t=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(t&&"true"===t),children:jsxRuntimeExports.jsx(Badge.FloatingFull,{position:s})})})}))}}else{let t=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BADGE));detectInitSelector(t,(()=>{t.length&&t.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,{})})})}))}}))}),e)}},ButtonDetail=e=>{var t,s,i,n,o;const{params:l,onAfterAddWishlist:r,onAfterRemoveWishlist:a}=e,{productId:d,productVariantId:c}=l||{},{isRenderApp:u,triggerRenderMultipleComponent:x,sledgeAnonymId:p}=React.useContext(SledgeContext),{wishlist:m}=u||{},[g,_]=React.useState(!0),[R,E]=React.useState(!0),[h,v]=React.useState(!1),[j,T]=React.useState({}),[w,S]=React.useState(!1),[f,A]=React.useState(!1),{is_required_login:C}=(null==(t=null==j?void 0:j.display)?void 0:t.global)||{},{type:I,icon:L,click_again_action:N,text_color:O,border_color:y,border_radius:b,padding_top:$,padding_bottom:P,padding_left:D,padding_right:U,background_color:W,font_size:k,font_weight:M,text_transform:H}=(null==(s=null==j?void 0:j.display)?void 0:s.button_detail)||{},{show:B,location:F}=(null==(i=null==j?void 0:j.display)?void 0:i.notification)||{},{before_adding_wishlist:G,after_adding_wishlist:Y,remove_from_wishlist:V}=(null==(n=null==j?void 0:j.languages)?void 0:n.button_detail)||{},{title_added_to_wishlist:K,text_added_to_wishlist:q,title_removed_to_wishlist:z,text_removed_to_wishlist:J}=(null==(o=null==j?void 0:j.languages)?void 0:o.notification)||{},Z={...O&&{color:O},...y&&{borderColor:y},...b&&{borderRadius:b},...$&&{paddingTop:$},...P&&{paddingBottom:P},...D&&{paddingLeft:D},...U&&{paddingRight:U},...W&&{backgroundColor:W},...k&&{fontSize:k},...M&&{fontWeight:M},...H&&{textTransform:H}},X=async()=>{let e;e=await checkWishlist(d,c),v(e)},Q=async e=>{var t,s,i,n,o,d,c;if(e.preventDefault(),e.stopPropagation(),f)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"}));S(!0),v(!h);let u=await addWishlist(l);200===(null==(t=null==u?void 0:u.status)?void 0:t.code)?(S(!1),(null==(i=null==(s=null==x?void 0:x.wishlist)?void 0:s.badge)?void 0:i.trigger)&&(null==(c=null==(n=null==x?void 0:x.wishlist)?void 0:n.badge)||c.trigger(!(null==(d=null==(o=null==x?void 0:x.wishlist)?void 0:o.badge)?void 0:d.value))),BadgeInitSelector(!0),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistTriggerUpdate&&window.sledgeWishlistTriggerUpdate()),X(),h?a&&a("success"):r&&r("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&B&&window.sledgeToastNotification({title:h?z:K,message:h?J:q,location:F,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(h?a&&a("failed"):r&&r("failed"),S(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&B&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:F,type:"failed"}))};React.useEffect((()=>{m&&("undefined"!=typeof window&&(window.sledgeWishlistButtonDetailUpdate=()=>{X()}),(async e=>{let t;E(!0),t=JSON.parse(e),t&&(T(t),E(!1),_(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null))}),[m]),React.useEffect((()=>{A(p&&C)}),[p]),React.useEffect((()=>{X()}),[c]);const ee=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[I&&String(I).toLowerCase().includes("icon")&&(null==L?void 0:L.length)?jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail-icon",dangerouslySetInnerHTML:{__html:L},style:{fill:O}}):null,f?G:I&&String(I).toLowerCase().includes("text")?w?h?"Adding...":"Removing...":h&&!N?Y:h?V:G:null]});return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-detail-wrapper",children:g?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"44px",rounded:"md",color:"lighten"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:I&&String(I).toLowerCase().includes("button")?jsxRuntimeExports.jsx(Button,{type:"button",fullWidth:!0,style:Z,...w||h&&!N?{disabled:!0}:{onClick:e=>Q(e)},children:ee}):jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail",style:Z,...w||h&&!N?{disabled:!0}:{onClick:e=>Q(e)},children:ee})})})},ButtonDetailInitSelector=()=>{let element=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_BUTTON_DETAIL));detectInitSelector(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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})}})})}))}}))}))},Trigger=e=>{var t,s,i;const{params:n,forceActive:o=!1,hidden:l=!1,onAfterAddWishlist:r,onAfterRemoveWishlist:a,wishlistChecked:d}=e,{productId:c,productVariantId:u}=n||{},{isRenderApp:x,triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{wishlist:g}=x||{},_="#767676",R="outline",E="#F85538",h="fill",v="boolean"==typeof d,j=!!v&&d,[T,w]=React.useState(j?E:_),[S,f]=React.useState(j?h:R),[A,C]=React.useState(!!d),[I,L]=React.useState(!v),[N,O]=React.useState({}),[y,b]=React.useState({onAfterAddWishlist:r,onAfterRemoveWishlist:a}),[$,P]=React.useState(!1),[D,U]=React.useState(!0),{is_required_login:W}=(null==(t=null==N?void 0:N.display)?void 0:t.global)||{},{show:k,location:M}=(null==(s=null==N?void 0:N.display)?void 0:s.notification)||{},{title_added_to_wishlist:H,text_added_to_wishlist:B,title_removed_to_wishlist:F,text_removed_to_wishlist:G}=(null==(i=null==N?void 0:N.languages)?void 0:i.notification)||{},Y=async()=>{let e;"boolean"==typeof d&&D?(e=d,U(!1)):e=await checkWishlist(c,u),C(o||e)};React.useEffect((()=>{g&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{Y()}),(async e=>{let t;L(!0),t=JSON.parse(e),t&&(O(t),L(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null))}),[g]),React.useEffect((()=>{P(m&&W)}),[m]),React.useEffect((()=>{g&&Y()}),[g,u]);const V=(A||o)&&!$;return React.useEffect((()=>{V?(w(E),f(h)):(w(_),f(R))}),[A]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!I&&!l&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__trigger-block",children:jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__trigger",onClick:e=>(async e=>{var t,s,i,o,l,r;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"}));C(!A);let a=await addWishlist(n);const{status:c,data:u}=a||{},{code:x}=c||{};200===x?((null==(s=null==(t=null==p?void 0:p.wishlist)?void 0:t.badge)?void 0:s.trigger)&&"boolean"!=typeof d&&(null==(r=null==(i=null==p?void 0:p.wishlist)?void 0:i.badge)||r.trigger(!(null==(l=null==(o=null==p?void 0:p.wishlist)?void 0:o.badge)?void 0:l.value))),BadgeInitSelector(!0),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),Y(),A?y.onAfterRemoveWishlist&&y.onAfterRemoveWishlist("success"):y.onAfterAddWishlist&&y.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&k&&window.sledgeToastNotification({title:A?F:H,message:A?G:B,location:M,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(A?y.onAfterRemoveWishlist&&y.onAfterRemoveWishlist("failed"):y.onAfterAddWishlist&&y.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&k&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:M,type:"failed",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})}))})(e),onMouseEnter:()=>{V||(w(E),f(h))},onMouseLeave:()=>{V||(w(_),f(R))},children:jsxRuntimeExports.jsx(HeartIcon,{width:16.67,height:15.83,type:S,color:T})})})})},ElementInit=(item,element="")=>{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)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})}})})}))},TriggerInitSelector=()=>{let e=Array.from(document.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_TRIGGER));detectInitSelector(e,(()=>{e.length&&e.map((e=>{ElementInit(e,e)}))})),new MutationObserver((function(t){t.forEach((function(t){Array.prototype.slice.call(t.addedNodes).forEach((function(t){1===t.nodeType&&t.querySelector(SELECTOR.WISHLIST.ELEMENT_TRIGGER)&&(e=Array.from(t.querySelectorAll(SELECTOR.WISHLIST.ELEMENT_TRIGGER)),e.length&&e.map((e=>{ElementInit(e,e)})))}))}))})).observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1})},WidgetHeaderClearTrigger=({buttonText:e,shareId:t,dataSettings:s,isFirstLoading:i})=>{var n,o,l,r,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:v,text_transform:j}=(null==(l=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:l.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:f}=(null==(r=null==s?void 0:s.languages)?void 0:r.popup)||{},{button_clear_all:A}=(null==(a=null==s?void 0:s.languages)?void 0:a.widget)||{},[C,I]=React.useState(!1),L={...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},...v&&{fontWeight:v},...j&&{textTransform:j}};React.useEffect((()=>{I(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:f,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:L,children:e||(A||"Clear Wishlist")})})})})})},WidgetHeaderShareTrigger=({wishlistData:e,buttonText:t,showShareTrigger:s,shareLink:i,shareId:n,dataSettings:o,isFirstLoading:l})=>{var r,a,d,c,u,x;const{triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{is_required_login:g}=(null==(r=null==o?void 0:o.display)?void 0:r.global)||{},{text_color:_,border_color:R,border_radius:E,padding_top:h,padding_bottom:v,padding_left:j,padding_right:T,background_color:w,font_size:S,font_weight:f,text_transform:A}=(null==(d=null==(a=null==o?void 0:o.display)?void 0:a.widget)?void 0:d.button_share)||{},{title_share_wishlist:C}=(null==(c=null==o?void 0:o.languages)?void 0:c.popup)||{},{button_share:I}=(null==(u=null==o?void 0:o.languages)?void 0:u.widget)||{},{title_added_all_to_wishlist:L,text_added_all_to_wishlist:N}=(null==(x=null==o?void 0:o.languages)?void 0:x.notification)||{},[O,y]=React.useState(!1),b={..._&&{color:_},...R&&{borderColor:R},...E&&{borderRadius:E},...h&&{paddingTop:h},...v&&{paddingBottom:v},...j&&{paddingLeft:j},...T&&{paddingRight:T},...w&&{backgroundColor:w},...S&&{fontSize:S},...f&&{fontWeight:f},...A&&{textTransform:A}},[$,P]=React.useState(!1);let D='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M15 17V20C15 20.2652 14.8946 20.5196 14.7071 20.7071C14.5196 20.8946 14.2652 21 14 21H4C3.73478 21 3.48043 20.8946 3.29289 20.7071C3.10536 20.5196 3 20.2652 3 20V8C3 7.73478 3.10536 7.48043 3.29289 7.29289C3.48043 7.10536 3.73478 7 4 7H7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M18 3H8C7.44772 3 7 3.44772 7 4V16C7 16.5523 7.44772 17 8 17H18C18.5523 17 19 16.5523 19 16V4C19 3.44772 18.5523 3 18 3Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>';const U=async()=>{var t,s,i,n,o,l,r;P(!0);let a=e.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:l,currency:r,price:a}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:l,productCurrency:r,productPrice:a}})),d=await bulkAddWishlist(a);200===(null==(t=null==d?void 0:d.status)?void 0:t.code)?("undefined"!=typeof window&&((null==(i=null==(s=null==p?void 0:p.wishlist)?void 0:s.badge)?void 0:i.trigger)&&(null==(r=null==(n=null==p?void 0:p.wishlist)?void 0:n.badge)||r.trigger(!(null==(l=null==(o=null==p?void 0:p.wishlist)?void 0:o.badge)?void 0:l.value))),BadgeInitSelector(),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:L,message:N,textCancel:"Cancel"})),P(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return React.useEffect((()=>{y(m&&g)}),[m]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!O&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:s&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:l?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:b,...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:U||{}}):"undefined"!=typeof window&&window.sledgeInfoPopup&&(window.sledgeInfoPopup({title:C,message:i?`<div class="sledge-wishlist__widget-box-copy">\n <div class="sledge-wishlist__widget-box-copy-icon" title="Copy to clipboard">\n ${D}\n </div>\n <div class="sledge-wishlist__widget-box-copy-content">${i}</div>\n </div>`:"",textCancel:"Cancel"}),(()=>{let e=!0;document.body.addEventListener("DOMNodeInserted",(()=>{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=D)}),2500)))}))}}))})())}},children:n?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-top-right",children:e.length}),$?"Adding...":"Add to your wishlist"]}):t||(I||"Share Wishlist")})})})})})},WidgetHeaderSearchForm=({setIsLoading:e,setKeyword:t,keyword:s,placeholder:i,dataSettings:n})=>{var o,l;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},{search_form_placeholder:d}=(null==(l=null==n?void 0:n.languages)?void 0:l.widget)||{},[c,u]=React.useState(!1),x=React.useRef(null);return React.useEffect((()=>{u(r&&a)}),[r]),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:l,font_weight:r,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},...l&&{fontSize:l},...r&&{fontWeight:r},...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=({options:e,defaultLimitOptions:t,selectedLimit:s,setSelectedLimit:i,setIsRefreshWidgetList:n,dataSettings:o})=>{var l;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:a}=(null==(l=null==o?void 0:o.display)?void 0:l.global)||{},[d,c]=React.useState(!1);let u=e||t;return React.useEffect((()=>{c(r&&a)}),[r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!d&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:u&&Boolean(null==u?void 0:u.length)&&jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx(SelectField,{align:"end",options:u.map((e=>({label:e,value:e}))),value:s||u[0],onChange:({value:e})=>(e=>{i&&i(e),n&&n(!0)})(e)})})})})},WidgetHeaderSort=({wishlistSort:e,selectedSort:t,setSelectedSort:s,setIsRefreshWidgetList:i,dataSettings:n})=>{var o,l;const{sledgeAnonymId:r}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},[d,c]=React.useState(!1);return React.useEffect((()=>{c(r&&a)}),[r]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!d&&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||(null==(l=e[0])?void 0:l.value),onChange:({value:e})=>(e=>{s&&s(e),i&&i(!0)})(e)})})})})},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:l=defaultGridType}=e||{},{is_required_login:r}=(null==(t=null==o?void 0:o.display)?void 0:t.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(s&&r)}),[s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:8,type:l}):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:l,text_no_result:r}=(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":l),u(i?"Your search did not match any products. <br/> Please try again":r),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-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.jsx("a",{href:_,className:"sledge__button","data-button-color-type":"light",children:m})})]})},ProductWrapper=e=>{var t,s,i,n,o,l,r,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:v,onAfterRenderProduct:j,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:f,border_color:A,border_radius:C,padding_top:I,padding_bottom:L,padding_left:N,padding_right:O,background_color:y,font_size:b,font_weight:$,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:D,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:H,font_weight:B,text_transform:F}=(null==(r=null==(l=null==g?void 0:g.display)?void 0:l.widget)?void 0:r.product_name)||{},{button_add_to_cart:G}=(null==(a=null==g?void 0:g.languages)?void 0:a.widget)||{},Y={...f&&{color:f},...A&&{borderColor:A},...C&&{borderRadius:C},...I&&{paddingTop:I},...L&&{paddingBottom:L},...N&&{paddingLeft:N},...O&&{paddingRight:O},...y&&{backgroundColor:y},...b&&{fontSize:b},...$&&{fontWeight:$},...P&&{textTransform:P}},V={...D&&{color:D},...U&&{fontSize:U},...W&&{fontWeight:W},...k&&{textTransform:k}},K={...M&&{color:M},...H&&{fontSize:H},...B&&{fontWeight:B},...F&&{textTransform:F}};let q=u||0,z=p||0;const[J,Z]=React.useState(!1),[X,Q]=React.useState(!1);React.useEffect((()=>{Q(!(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:l,currency:r,price:a,vendor:d,sku:c}=(null==e?void 0:e.product)||{},u=new URL(o).pathname.split("/"),x=u[u.length-1];return{product:{id:t,admin_graphql_api_id:`${SHOPIFY_GID_PRODUCT_ID}${t}`,handle:x,title:i,image:{src:l},url:o,vendor:d,currency:r},variants:[{id:s,admin_graphql_api_id:`${SHOPIFY_GID_PRODUCT_VARIANT_ID}${s}`,title:n,price:a,sku:c}]}})),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:V,display_button_add_to_cart_style:Y},showOptionOutOfStock:!1,triggerPropAdditional:{forceActive:!0,...m&&{hidden:!0}},isComponentJsVersion:d,cards:R,onAfterAddToCart:E,onAfterAddWishlist:h,onAfterRemoveWishlist:v,onAfterRenderProduct:j,dataReviews:T,dataWishlists:ee}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),X&&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;const{children:s,query:i,params:n,customRoutePage:o,onAfterAddToCart:l,onAfterAddWishlist:r,onAfterRemoveWishlist:a,onAfterRenderProduct:d,data:c,dataInfo:u,dataReviews:x}=e,{shareId:p="share"}=i||{},{isRenderApp:m,triggerRenderMultipleComponent:g,sledgeAnonymId:_,isJsVersion:R}=React.useContext(SledgeContext),{wishlist:E}=m||{},[h,v]=React.useState(!c),[j,T]=React.useState(!c),[w,S]=React.useState((null==c?void 0:c.data)||[]),[f,A]=React.useState((null==c?void 0:c.sorts)||[]),[C,I]=React.useState(!1),[L,N]=React.useState(""),[O,y]=React.useState(""),[b,$]=React.useState(""),[P,D]=React.useState(1),[U,W]=React.useState((null==(t=null==c?void 0:c.page)?void 0:t.total_page)||0),[k,M]=React.useState(!1),[H,B]=React.useState(!!c),[F,G]=React.useState(""),[Y,V]=React.useState(null),[K,q]=React.useState(""),[z,J]=React.useState({}),[Z,X]=React.useState(!!c),Q=usePrevious({keyword:b,currentPage:P}),ee=DEFAULT_LIMIT_VALUE,te=async(e=!1,t=!1)=>{var s,i,o,l;const r=new URLSearchParams(document.location.search),a=(null==n?void 0:n.shareId)?n.shareId:(null==r?void 0:r.get(p))||"";let d;T(!e),e||(D(1),S([]));let u,x,m=!1,g=0,_={page:e?P:1,limit:O||ee[0],sort:L,keyword:b,shareId:a};d=c&&t?c:await getWishlist(_),m=200===(null==(s=null==d?void 0:d.status)?void 0:s.code)||!1,u=(null==(i=d.data)?void 0:i.length)?t=>(null==w?void 0:w.length)&&e?[...t,...d.data]:d.data:[],x=(null==(o=d.sorts)?void 0:o.length)?d.sorts:[],g=(null==(l=null==d?void 0:d.page)?void 0:l.total_page)||1,m&&(S(u),A(x),W(g),T(!1),I(!1))};React.useEffect((()=>{if(!E)return;let e=Boolean(Q&&(null==Q?void 0:Q.currentPage)!==P);if(Q&&(null==Q?void 0:Q.keyword)!==b){M(!0);const e=setTimeout((()=>{M(!1),te(void 0)}),500);return()=>clearTimeout(e)}te(!C&&e,!0)}),[E,b,P,C]),React.useEffect((()=>{if(!E)return;const e=new URLSearchParams(document.location.search);V((null==n?void 0:n.shareId)?n.shareId:(null==e?void 0:e.get(p))||""),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate=()=>{te()},window.sledgeWishlistWidgetClearList=()=>{(async()=>{var e,t,s,i,n,o,l;let r;T(!0);let a=!1;r=await clearWishlist(),a=200===(null==(e=null==r?void 0:r.status)?void 0:e.code),a?(await te(),(null==(s=null==(t=null==g?void 0:g.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(l=null==(i=null==g?void 0:g.wishlist)?void 0:i.badge)||l.trigger(!(null==(o=null==(n=null==g?void 0:g.wishlist)?void 0:n.badge)?void 0:o.value))),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;B(!1);let l,r,a,d=!1;u?(n={data:u},d=!0):(n=await getWishlistInfo(),d=200===(null==(e=null==n?void 0:n.status)?void 0:e.code)||!1),l=(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)||"",r=o?`${o}?${p}=${a}`:null==(i=null==n?void 0:n.data)?void 0:i.share_link,d&&(q(l),G(window.location.origin+r),B(!0))})(),(async e=>{let t;t=JSON.parse(e),t&&J(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||null),v(!1)}),[E]),React.useEffect((()=>{var e;const{is_required_login:t}=(null==(e=null==z?void 0:z.display)?void 0:e.global)||{};X(_&&!t)}),[_,z]);let se=null,ie=null;React.Children.map(s,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,wishlistWidgetAlert:s}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(se=t),s&&isFunction(s)&&(ie=s)}}));const ne=ie?ie():null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-wrapper",children:[Z&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:h?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"99.5%",height:"72px",color:"lighten",rounded:"none",style:{margin:"0 auto"}}):ie?jsxRuntimeExports.jsx(React.Fragment,{children:R?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:ne}}):ne}):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(s)&&React.Children.map(s,(e=>React.cloneElement(e,{isLoading:j,isFirstLoading:h,wishlistData:w,wishlistSort:f,selectedSort:L,selectedLimit:O,keyword:b,currentPage:P,totalPage:U,defaultLimitOptions:ee,onSearch:k,showShareTrigger:H,shareLink:F,shareId:Y,proxyUrl:K,dataSettings:z,productCardsComponent:se,query:i,setIsLoading:T,setIsRefreshWidgetList:I,setSelectedSort:N,setSelectedLimit:y,setKeyword:$,setCurrentPage:D,onAfterAddToCart:l,onAfterAddWishlist:r,onAfterRemoveWishlist:a,onAfterRenderProduct:d,dataReviews:x})))]})})},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));detectInitSelector(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),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||""},onAfterAddWishlist:state=>{item&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:item,state:state})},onAfterRemoveWishlist:state=>{item&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:item,state:state})},onAfterRenderProduct:state=>{item&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:item,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,{options:[10,25,50,100]})]}),jsxRuntimeExports.jsx(Widget.List,{gridType:"large"})]})})}))}}))}))},WishlistInitSelector=()=>{BadgeInitSelector(),TriggerInitSelector(),WidgetInitSelector(),ButtonDetailInitSelector()},ProductGrid=({type:e,className:t="",data:s,setting:i,showOptionOutOfStock:n=!1,triggerPropAdditional:o,sourceApp:l=null,isComponentJsVersion:r=!1,cards:a,onAfterAddToCart:d,onAfterAddWishlist:c,onAfterRemoveWishlist:u,onAfterRenderProduct:x,showPopupComponent:p,setShowPopupComponent:m,dataReviews:g,dataWishlists:_})=>{const{show_vendor:R=!0,show_sku:E=!0,show_price:h=!0,show_add_to_cart:v=!0,redirect_add_to_cart:j=!0,language_button_add_to_cart:T="Add To Cart",display_product_name_style:w={},display_price_style:S={},display_button_add_to_cart_style:f={}}=i||{},[A,C]=React.useState(null);return React.useEffect((()=>{x&&x("success")}),[]),jsxRuntimeExports.jsx("div",{className:`sledge__product-grid ${t}`,"data-grid-type":e,children:null==s?void 0:s.map(((e,t)=>{var s,i,x;const{product:I,variants:L}=e||{},{id:N,title:O,image:y,url:b,vendor:$="",currency:P}=I||{},{id:D="",title:U="",price:W="",sku:k=""}=(null==L?void 0:L.length)?L[0]:{};let M=A==D,H=!(!(null==L?void 0:L.length)||!Object.hasOwn(L[0],"inventory_quantity"))&&(!L[0].inventory_quantity&&n);const B=a?a({product:{...I,variants:L.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(L[t],"inventory_quantity")&&!s}})),...g&&Object.keys(g).length?{review:{total:(null==(s=null==g?void 0:g[N])?void 0:s.review_count)?null==g?void 0:g[N].review_count:0,average:(null==(x=null==(i=null==g?void 0:g[N])?void 0:i.rating)?void 0:x.average)?null==g?void 0:g[N].rating.average:0}}:{}},showPopupComponent:p,setShowPopupComponent:m}):null;return a?jsxRuntimeExports.jsx(React.Fragment,{children:r?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:B}}):B},t):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:b,onClick:()=>"instant-search"===l&&productClickTrigger({productId:N}),children:[jsxRuntimeExports.jsx(Trigger,{params:{productId:N,productVariantId:D,productName:O,productVendor:$,productSku:k,productVariantName:U,productLink:b,productImage:(null==y?void 0:y.src)||`${API_URL}/img/blank-image.png`,productCurrency:P,productPrice:W},...o,onAfterAddWishlist:c,onAfterRemoveWishlist:u,wishlistChecked:null==_?void 0:_[N]}),jsxRuntimeExports.jsx("img",{src:(null==y?void 0:y.src)||"",alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})]}),H?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:[O?jsxRuntimeExports.jsx("a",{href:b,onClick:()=>"instant-search"===l&&productClickTrigger({productId:N}),children:jsxRuntimeExports.jsx("h3",{style:w,children:O})}):null,h?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:jsxRuntimeExports.jsxs("p",{style:S,children:[P,W]})}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-text",children:[jsxRuntimeExports.jsx("div",{children:U}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:R?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Vendor: ",$]}):null}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:" | "}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:E?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["SKU: ",k]}):null})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(Rating,{params:{productId:N},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1,data:null==g?void 0:g[N]})})]})]}),v?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",style:{...f,...M&&{cursor:"wait"}},...M||H?{disabled:!0}:{onClick:()=>(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"===l?await addToCartTrigger({productId:s}):"instant-search"===l&&await addToCartTrigger$1({productId:s}),C(null),d&&d("success"),j?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"})})):(d&&d("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))})({id:D,quantity:1})},children:M?"Adding...":H?"Sold out":jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[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",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.83562 1.50023C10.796 1.50023 12.4155 2.99397 12.6152 4.90442L12.6709 4.90507C13.7584 4.90507 15.0806 5.62732 15.5269 7.65307L16.1186 12.2333C16.3309 13.7116 16.0654 14.8973 15.3281 15.7478C14.5946 16.5938 13.4336 17.0416 11.9704 17.0416H5.7094C4.10215 17.0416 2.9824 16.6478 2.28565 15.8386C1.5859 15.0271 1.3519 13.8098 1.5904 12.2213L2.1724 7.70182C2.5549 5.62957 3.95365 4.90507 5.03665 4.90507C5.13014 4.04293 5.51889 3.22275 6.13562 2.60797C6.84437 1.90372 7.82162 1.50023 8.81987 1.50023H8.83562ZM12.6709 6.03007H5.03665C4.7059 6.03007 3.6004 6.16357 3.28315 7.87657L2.70415 12.3766C2.5159 13.6388 2.6614 14.5523 3.13765 15.1051C3.6079 15.6511 4.4494 15.9166 5.7094 15.9166H11.9704C12.7564 15.9166 13.8296 15.7598 14.4776 15.0113C14.9921 14.4181 15.1691 13.5346 15.0041 12.3848L14.4199 7.84582C14.1709 6.72757 13.5139 6.03007 12.6709 6.03007ZM11.023 8.11815C11.3335 8.11815 11.6027 8.37015 11.6027 8.68065C11.6027 8.99115 11.368 9.24315 11.0575 9.24315H11.023C10.7125 9.24315 10.4605 8.99115 10.4605 8.68065C10.4605 8.37015 10.7125 8.11815 11.023 8.11815ZM6.65042 8.11815C6.96092 8.11815 7.23017 8.37015 7.23017 8.68065C7.23017 8.99115 6.99467 9.24315 6.68417 9.24315H6.65042C6.33992 9.24315 6.08792 8.99115 6.08792 8.68065C6.08792 8.37015 6.33992 8.11815 6.65042 8.11815ZM8.83337 2.62522H8.82212C8.11637 2.62522 7.42862 2.90947 6.92987 3.40522C6.5236 3.80967 6.25789 4.34137 6.17193 4.90472L11.4814 4.90493C11.2887 3.61626 10.1743 2.62522 8.83337 2.62522Z",fill:"#393D4E"})}),jsxRuntimeExports.jsx("span",{children:T||"Add To Cart"})]})})}):null]},t)}))})},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:l="",...r}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__input-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField",name:l,children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("input",{className:"sledge__input-field",type:o,value:s,required:n,onChange:e=>(e=>{i&&i(e)})(e),...r})}),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})=>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:s,title:i,description:n,url:o,image:l}=e;return jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:l||`${API_URL}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})}),jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-text",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:i}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:n})]}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"success",elementType:"hyperlink",link:o,children:"Shop Now"})})]})]},t)}))}):null}),PageGrid$1="",PageGrid=({className:e="",data:t})=>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:s,title:i,description:n,url:o,image:l}=e;return jsxRuntimeExports.jsx("a",{href:o,children:jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:jsxRuntimeExports.jsx("img",{src:l||`${API_URL}/img/blank-image.png`,alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})}),jsxRuntimeExports.jsxs("div",{className:"sledge__page-grid-card-content",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-title",children:i}),jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:n})]})]})},t)}))}):null}),BlogGrid$1="",BlogGrid=({className:e="",data:t})=>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:s,title:i,date:n,description:o,url:l,image:r}=e;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:r||`${API_URL}/img/blank-image.png`,alt:"sledge-blog-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-title",children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("a",{href:l,children:jsxRuntimeExports.jsx("div",{children:i})})})}),(null==n?void 0:n.length)?jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-date",children:n}):null,jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-card-text",children:o})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",elementType:"hyperlink",link:l,children:"Learn More"})})]},t)}))}):null}),Tooltip$1="",Tooltip=({children:e,content:t,withArrow:s=!0,customArrow:i="",sideOffset:n=5,alignOffset:o=0,wrapTrigger:l=!0})=>{const[r,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)}),[r]),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:a,children:[jsxRuntimeExports.jsx($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:l?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="",withCorner:i=!0})=>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"})}),i&&jsxRuntimeExports.jsx($57acba87d6e25586$export$ac61190d9fc311a9,{className:"sledge__scroll-area-corner"})]})]}),SkeletonLoading$1="",SkeletonItem=({width:e,height:t,rounded:s,color:i,style:n={},className:o="",...l})=>{var r,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==(r=null==x?void 0:x.skeleton)?void 0:r.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,...l}):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:"40px",height:"40px",color:"darken",rounded:"sm"})}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md"})]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-desc",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-title",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"134px",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-text",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"190px",height:"46px",color:"lighten",rounded:"md",style:{marginBottom:"16px"}})})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"117px",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.jsxs("div",{className:"sledge__collection-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-image",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"246px",height:"246px",color:"darken",rounded:"md"})}),jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge__collection-grid-card-text",children:[jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-title",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"70px",color:"darken",rounded:"lg"})}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"47px",color:"darken",rounded:"md",style:{maxWidth:"357px"}})})]}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"darken",rounded:"md",style:{maxWidth:"117px"}})})]})]},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.jsxs("div",{className:"sledge__page-grid-card",children:[jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-image",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"darken",rounded:"md",style:{borderTopRightRadius:0,borderBottomRightRadius:0}})}),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:"100%",height:"40px",color:"darken",rounded:"md"})}),jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"darken",rounded:"md",style:{maxWidth:"115px"}})})]})]},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.jsx("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(SkeletonItem,{width:"100%",height:"100%",color:"lighten",rounded:"md"})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"242px",marginTop:"26px",marginBottom:"12px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"28px",color:"lighten",rounded:"md",style:{maxWidth:"80px",marginBottom:"27px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"80px",color:"lighten",rounded:"md",style:{maxWidth:"190px",marginBottom:"27px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"lighten",rounded:"md",style:{maxWidth:"117px"}})]})]})},s));return jsxRuntimeExports.jsx("div",{className:"sledge__blog-grid sledge__skeleton-blog-grid sledge__skeleton-pointer-events-none",children:t})},SkeletonLoading={Item:SkeletonItem,ReviewGrid:SkeletonReviewGrid,ProductGrid:SkeletonProductGrid,CollectionGrid:SkeletonCollectionGrid,PageGrid:SkeletonPageGrid,BlogGrid:SkeletonBlogGrid},consoleErrorStyle="color: white; background: black; border: 1px solid white; padding: 2px 5px; border-radius: 350px;";documentReady((()=>{let e=document.querySelector(`script[id="${SCRIPT_EMBED_ID}"]`);const t=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.API_KEY),s=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.INSTANT_SEARCH_API_KEY),i=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_ID),n=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_EMAIL),o=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.USER_FULLNAME);getToken({API_KEY:t||"",INSTANT_SEARCH_API_KEY:s||"",USER_ID:i||"",USER_EMAIL:n||"",USER_FULLNAME:o||""}).then((e=>{var t,s,i;(null==(t=null==e?void 0:e.data)?void 0:t.token)?(ConfirmationPopupInitSelector(),InfoPopupInitSelector(),ToastNotificationInitSelector(),getSettings().then((e=>{var t,s,i,n,o,l,r,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==(l=null==e?void 0:e.data)?void 0:l.review)&&(localStorage.setItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING,JSON.stringify(null==(r=null==e?void 0:e.data)?void 0:r.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")}))):console.error("%cSledge",consoleErrorStyle,`${(null==(s=null==e?void 0:e.status)?void 0:s.code)?null==(i=null==e?void 0:e.status)?void 0:i.message:e}`)}))}));