@sledge-app/js 0.0.32 → 0.0.34

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-250f86b3.js";const root="",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)=>{let s=!1;document.body.addEventListener("DOMNodeInserted",(()=>{!s&&e&&(s=!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"})}},isTokenExpired=e=>{const t=JSON.parse(atob(e.split(".")[1])).exp;return Math.floor((new Date).getTime()/1e3)>=t},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"},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"},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",WISHLIST_SETTING:"sledge-wishlist-setting",PRODUCT_REVIEW_SETTING:"sledge-product-review-setting",INSTANT_SEARCH_SETTING:"sledge-instant-search-setting"},INTERNAL_SELECTOR_VALUE={ELEMENT_TOAST_NOTIFICATION:"toast-notification",ELEMENT_CONFIRMATION_POPUP:"confirmation-popup",ELEMENT_INFO_POPUP:"info-popup",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/`,getSettings=async e=>{let t=e||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`);var i={method:"GET",headers:s,redirect:"follow"};return await fetch(`${API_URL}/app/settings`,i).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getToken=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);if(t&&!isTokenExpired(t))return{data:{token:t}};const{API_KEY:s,INSTANT_SEARCH_API_KEY:i,USER_ID:n,USER_EMAIL:o,USER_FULLNAME:r,ANONYM_ID:l}=e;var a=new Headers;a.append("Authorization",`Bearer ${s||""}`),a.append("Content-Type","application/json");var d={method:"POST",headers:a,body:JSON.stringify({user:{id:n||"",email:o||"",name:r||"",anonym:l||("undefined"!=typeof localStorage&&(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID))||"")}}),redirect:"follow"};return await fetch(`${API_URL}/app/token`,d).then((e=>e.json())).then((async e=>{const{data:t}=e||{},{anonym:s,token:n}=t||{};return"undefined"!=typeof localStorage&&(null==localStorage||localStorage.setItem(LOCAL_STORAGE_KEY.ANONYM_ID,s||""),null==localStorage||localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP,n||""),null==localStorage||localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP,i||"")),e})).catch((e=>e))},Loading="",ConfirmationPopup$1="",ConfirmationPopup=()=>{const[e,t]=React.useState(""),[s,i]=React.useState(""),[n,o]=React.useState(""),[r,l]=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:r,buttonSubmitType:a,onSubmit:c})=>{u(!0),t(e),i(s),o(n),l(r),d(a),p({onSubmit:c})})}),[]),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$be92b6f5f03c0fe9,{open:c,onOpenChange:u,children:jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($905f4ae918aab1aa$export$c6fdb837b070b4ff,{className:"sledge__alert-dialog-overlay"}),jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$7c6e2c02157bb7d2,{className:"sledge__alert-dialog-content",children:[jsxRuntimeExports.jsx($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:r})}),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(""),[r,l]=React.useState(!1);return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInfoPopup=({title:e,message:s,textCancel:n})=>{l(!0),t(e),i(s),o(n)})}),[]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:r,onOpenChange:l,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__dialog-overlay"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge__dialog-content",children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0,{className:"sledge__dialog-title",dangerouslySetInnerHTML:{__html:e}}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$393edc798c47379d,{className:"sledge__dialog-description",dangerouslySetInnerHTML:{__html:s}}),jsxRuntimeExports.jsx("div",{className:"sledge__dialog-close-button",children:jsxRuntimeExports.jsx("button",{className:"sledge__dialog-button sledge__dialog-button-cancel",onClick:()=>l(!1),children:n})}),jsxRuntimeExports.jsx("button",{className:"IconButton","aria-label":"Close",onClick:()=>l(!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(""),[r,l]=React.useState(""),[a,d]=React.useState(null),[c,u]=React.useState(""),x=React.useRef(0);return React.useEffect((()=>("undefined"!=typeof window&&(window.sledgeToastNotification=({title:e,message:s,location:n="bottom-right",icon:r=null,type:a})=>{i(e),o(s),l(n),d(r),u(a),t(!1),window.clearTimeout(x.current),x.current=window.setTimeout((()=>{t(!0)}),10)}),()=>clearTimeout(x.current))),[]),jsxRuntimeExports.jsxs($054eb8030ebde76e$export$2881499e37b75b9a,{children:[jsxRuntimeExports.jsxs($054eb8030ebde76e$export$be92b6f5f03c0fe9,{className:"sledge__ToastRoot",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__ToastTitle",children:s}),jsxRuntimeExports.jsx($054eb8030ebde76e$export$393edc798c47379d,{asChild:!0,children:jsxRuntimeExports.jsx("p",{className:"sledge__ToastDescription",children:n})})]}),jsxRuntimeExports.jsx("div",{className:"sledge__toast-action-wrapper",children:jsxRuntimeExports.jsx($054eb8030ebde76e$export$e19cd5f9376f8cee,{className:"sledge__ToastAction",asChild:!0,altText:"Close notification",children:jsxRuntimeExports.jsx(Button,{colorType:"outlined-danger",children:"Dismiss"})})})]}),jsxRuntimeExports.jsx($054eb8030ebde76e$export$d5c6c08dc2d3ca7,{className:"sledge__ToastViewport","data-location":r})]})},ToastNotificationInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_TOAST_NOTIFICATION}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_TOAST_NOTIFICATION),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(ToastNotification,{})})))},Popover$1="",Popover=({trigger:e,content:t,isOpen:s,setIsOpen:i,hideCloseIcon:n,align:o,className:r,withOpenState:l=!0,withArrow:a=!0,customArrow:d="",sideOffset:c=5,alignOffset:u=0})=>{const[x,p]=React.useState(!!l&&s);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==d?void 0:d.length)&&(t.style.display="inline-flex",t.innerHTML=d)}),[x]),jsxRuntimeExports.jsxs($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{...l&&{open:s},...i&&{onOpenChange:e=>{p(e),i(e)}},children:[jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$41fb9f06171c75f4,{asChild:!0,children:e}),jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{className:`sledge__popover-content ${r||""}`,sideOffset:c,alignOffset:u,align:o,...i&&{onOpenAutoFocus:()=>i(!0),onCloseAutoFocus:()=>i(!1)},children:[t,!n&&jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$f39c2d165cd861fe,{className:"PopoverClose","aria-label":"Close",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),a?jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$21b07c8f274aebd5,{className:"PopoverArrow"}):null]})})]})},Progress$1="",Progress=({value:e,total:t,fillColor:s="",outlineColor:i=""})=>{const[n,o]=React.useState(0);return React.useEffect((()=>{const s=setTimeout((()=>o(+e/t*100)),150);return()=>clearTimeout(s)}),[]),jsxRuntimeExports.jsx($67824d98245208a0$export$be92b6f5f03c0fe9,{className:"sledge__progress",value:n,style:i?{borderWidth:"1px",borderStyle:"solid",borderColor:i}:{},children:jsxRuntimeExports.jsx($67824d98245208a0$export$adb584737d712b70,{className:"ProgressIndicator",style:{transform:`translateX(-${100-n}%)`,...s&&{backgroundColor:s}}})})},Checkbox$1="",Checkbox=({id:e,name:t,value:s,required:i,label:n,defaultChecked:o,labelStyle:r={},onClick:l})=>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:l,children:jsxRuntimeExports.jsx($e698a72e93240346$export$adb584737d712b70,{className:"sledge__checkbox-indicator",children:jsxRuntimeExports.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.72318 0.237414C10.0707 0.574491 10.0942 1.14584 9.77561 1.51356L4.40976 7.70711C4.25243 7.88871 4.03181 7.99443 3.79903 7.99979C3.56625 8.00514 3.3415 7.90965 3.17686 7.73545L0.250031 4.63868C-0.0833435 4.28595 -0.0833435 3.71406 0.250031 3.36133C0.583405 3.00859 1.12391 3.00859 1.45729 3.36133L3.75367 5.79105L8.51706 0.292899C8.83564 -0.0748211 9.37564 -0.0996624 9.72318 0.237414Z",fill:"white"})})})}),n&&jsxRuntimeExports.jsx("label",{className:"sledge__checkbox-label",htmlFor:e,style:r,children:n})]}),Slider$1="",Slider=e=>{const{defaultValue:t,min:s,max:i,step:n=1,setValueCommit:o,setValueChange:r}=e,[l,a]=React.useState(t);return jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsxs($faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:t,min:s,max:i,step:n,"aria-label":"Volume",onValueCommit:e=>{o&&o(e),a(e)},onValueChange:e=>{r&&r(e),a(e)},children:[jsxRuntimeExports.jsx($faa2e61a3361514f$export$13921ac0cc260818,{className:"sledge__SliderTrack",children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$9a58ef0d7ad3278c,{className:"sledge__SliderRange"})}),jsxRuntimeExports.jsx(Tooltip,{content:l[0],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#23BC45"/></svg>',wrapTrigger:!1,children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),jsxRuntimeExports.jsx(Tooltip,{content:l[1],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#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:r})=>jsxRuntimeExports.jsx("div",{className:"sledge__radio-group-wrapper",children:jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsx($f99a8c78507165f7$export$be92b6f5f03c0fe9,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:i,id:e,name:t,required:s,onValueChange:r,children:n.map(((t,s)=>{const{label:i,value:n}=t;return jsxRuntimeExports.jsxs("div",{className:"sledge__radio-group-item-flex",children:[jsxRuntimeExports.jsx($f99a8c78507165f7$export$6d08773d2e66f8f2,{className:"sledge__radio-group-item",value:n,id:`${e}${s}`,children:jsxRuntimeExports.jsx($f99a8c78507165f7$export$adb584737d712b70,{className:"sledge__radio-group-indicator"})}),jsxRuntimeExports.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${e}${s}`,style:o,children:i})]},s)}))})})}),ColorSwatch$1="",ColorSwatch=({id:e,name:t,value:s,rgb:i,image:n,required:o,defaultChecked:r,onClick:l})=>{const a={...(null==n?void 0:n.length)?{backgroundImage:`url(${n})`}:{backgroundColor:i}};return jsxRuntimeExports.jsx("div",{className:"sledge__color-swatch-wrapper",children:jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__color-swatch-root",defaultChecked:r,id:e,name:t,value:s,required:o,onClick:l,style:a})})},Select$1="",Select=({name:e,placeholder:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:r})=>jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:e,required:s,onValueChange:r,children:[jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$41fb9f06171c75f4,{className:"sledge__select-trigger",children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$4c8d1a57a761ef94,{placeholder:t}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$f04a61298a47a40f,{className:"sledge__select-icon",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$7c6e2c02157bb7d2,{className:"sledge__select-content",children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$2f60d3ec9ad468f2,{className:"sledge__select-scroll-button",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d5c6c08dc2d3ca7,{className:"sledge__select-viewport",children:n.map(((e,t)=>{const{label:s,value:i}=e;return jsxRuntimeExports.jsx(SelectItemComponent,{value:i,children:s},t)}))}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$bf1aedc3039c8d63,{className:"sledge__select-scroll-button",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]})})]})}),SelectItemComponent=React.forwardRef((({children:e,className:t="",...s},i)=>jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$6d08773d2e66f8f2,{className:`sledge__select-item ${t}`,...s,ref:i,children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d6e5bf9c43ea9319,{children:e}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$c3468e2714d175fa,{className:"sledge__select-item-indicator",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}))),HeartIcon=({width:e,height:t,type:s,color:i})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__heart",children:"outline"===s?jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:i,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.19515 0.86581C10.5501 0.00914308 12.3501 -0.227524 13.9051 0.27081C17.2876 1.36164 18.3376 5.04914 17.3985 7.98331C15.9493 12.5916 9.76015 16.0291 9.49765 16.1733C9.40431 16.225 9.30098 16.2508 9.19765 16.2508C9.09431 16.2508 8.99181 16.2258 8.89848 16.175C8.63765 16.0325 2.49348 12.6458 0.995979 7.98414L0.995146 7.98331C0.0551462 5.04831 1.10181 1.35998 4.48098 0.27081C6.06765 -0.242524 7.79681 -0.0166903 9.19515 0.86581ZM4.86431 1.46081C2.13015 2.34248 1.44348 5.28331 2.18598 7.60248C3.35431 11.2375 7.97015 14.1766 9.19681 14.9041C10.4276 14.1691 15.0768 11.1975 16.2076 7.60581C16.9501 5.28414 16.261 2.34331 13.5226 1.46081C12.196 1.03498 10.6485 1.29414 9.58015 2.12081C9.35681 2.29248 9.04681 2.29581 8.82181 2.12581C7.69015 1.27498 6.21181 1.02581 4.86431 1.46081ZM12.7226 3.11573C13.8585 3.48323 14.6543 4.48906 14.7518 5.67823C14.7793 6.02239 14.5235 6.32406 14.1793 6.35156C14.1618 6.35323 14.1451 6.35406 14.1276 6.35406C13.8051 6.35406 13.5318 6.10656 13.5051 5.77989C13.4501 5.09489 12.9918 4.51656 12.3393 4.30573C12.0101 4.19906 11.8301 3.84656 11.936 3.51906C12.0435 3.19073 12.3926 3.01239 12.7226 3.11573Z"})}):jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:i,children:jsxRuntimeExports.jsx("path",{d:"M5.89936 0.0838691C6.42436 0.0998355 6.9327 0.191502 7.4252 0.359002H7.47436C7.5077 0.374836 7.5327 0.392336 7.54936 0.408169C7.73353 0.467336 7.9077 0.534002 8.07436 0.625669L8.39103 0.767336C8.51603 0.834002 8.66603 0.958169 8.74936 1.009C8.8327 1.05817 8.92436 1.109 8.99936 1.1665C9.9252 0.459002 11.0494 0.0756688 12.2077 0.0838691C12.7335 0.0838691 13.2585 0.158169 13.7577 0.325669C16.8335 1.32567 17.9419 4.70067 17.016 7.65067C16.491 9.15817 15.6327 10.534 14.5085 11.6582C12.8994 13.2165 11.1335 14.5998 9.2327 15.7915L9.02436 15.9173L8.8077 15.7832C6.9002 14.5998 5.12436 13.2165 3.5002 11.6498C2.38353 10.5257 1.52436 9.15817 0.991029 7.65067C0.0493627 4.70067 1.1577 1.32567 4.26686 0.308169C4.50853 0.224836 4.7577 0.166502 5.0077 0.134002H5.1077C5.34186 0.0998355 5.57436 0.0838691 5.8077 0.0838691H5.89936ZM13.3244 2.71734C12.9827 2.59984 12.6077 2.784 12.4827 3.134C12.366 3.484 12.5494 3.86734 12.8994 3.9915C13.4335 4.1915 13.791 4.71734 13.791 5.29984V5.32567C13.7752 5.5165 13.8327 5.70067 13.9494 5.84234C14.066 5.984 14.241 6.0665 14.4244 6.084C14.766 6.07484 15.0577 5.80067 15.0827 5.44984V5.35067C15.1077 4.18317 14.4002 3.12567 13.3244 2.71734Z"})})}),ChevronArrowDownIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-down",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Arrow - Down 2",children:jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:jsxRuntimeExports.jsx("g",{id:"Arrow---Down-2",children:jsxRuntimeExports.jsx("path",{id:"Stroke-1",d:"M3.72407 6.6414C3.94596 6.41951 4.29318 6.39934 4.53786 6.58089L4.60796 6.6414L9.99935 12.0325L15.3907 6.6414C15.6126 6.41951 15.9598 6.39934 16.2045 6.58089L16.2746 6.6414C16.4965 6.86329 16.5167 7.21051 16.3351 7.45519L16.2746 7.52529L10.4413 13.3586C10.2194 13.5805 9.87218 13.6007 9.62751 13.4191L9.55741 13.3586L3.72407 7.52529C3.48 7.28121 3.48 6.88548 3.72407 6.6414Z",fill:s})})})})})}),ChevronArrowLeftIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-left",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M10.6875 2.97945C10.865 3.15697 10.8812 3.43474 10.7359 3.63048L10.6875 3.68656L6.37465 7.99967L10.6875 12.3128C10.865 12.4903 10.8812 12.7681 10.7359 12.9638L10.6875 13.0199C10.51 13.1974 10.2323 13.2135 10.0365 13.0683L9.98043 13.0199L5.31377 8.35323C5.13625 8.17572 5.12012 7.89794 5.26535 7.7022L5.31377 7.64612L9.98043 2.97945C10.1757 2.78419 10.4923 2.78419 10.6875 2.97945Z",fill:s})})}),ChevronArrowRightIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.60738 13.1302C5.42987 12.9527 5.41374 12.675 5.55897 12.4792L5.60738 12.4231L9.92027 8.11002L5.60738 3.79691C5.42987 3.6194 5.41374 3.34162 5.55897 3.14588L5.60738 3.0898C5.7849 2.91229 6.06267 2.89615 6.25841 3.04139L6.31449 3.0898L10.9812 7.75647C11.1587 7.93398 11.1748 8.21175 11.0296 8.4075L10.9812 8.46357L6.31449 13.1302C6.11923 13.3255 5.80265 13.3255 5.60738 13.1302Z",fill:s})})}),ArrowRightIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3 8.79429C3 8.50952 3.21162 8.27418 3.48617 8.23693L3.5625 8.23179L13.4505 8.23224L9.87826 4.6746C9.65812 4.4554 9.65735 4.09925 9.87655 3.8791C10.0758 3.67897 10.3883 3.66015 10.6088 3.82306L10.672 3.87739L15.2095 8.39539C15.2386 8.42428 15.2638 8.45555 15.2852 8.48858C15.2912 8.49852 15.2973 8.50869 15.3032 8.51906C15.3085 8.52795 15.3134 8.53718 15.318 8.54652C15.3243 8.5601 15.3305 8.57413 15.3361 8.58845C15.3407 8.59949 15.3445 8.61023 15.348 8.62105C15.3522 8.63447 15.3562 8.64877 15.3597 8.66329C15.3622 8.67343 15.3643 8.68319 15.3661 8.69298C15.3686 8.70755 15.3707 8.72263 15.3722 8.73789C15.3735 8.74953 15.3743 8.76106 15.3747 8.77261C15.3749 8.77961 15.375 8.78693 15.375 8.79429L15.3747 8.81608C15.3743 8.82712 15.3735 8.83815 15.3725 8.84916L15.375 8.79429C15.375 8.82979 15.3717 8.86452 15.3654 8.89819C15.364 8.90623 15.3622 8.91449 15.3603 8.92271C15.3563 8.93964 15.3517 8.95595 15.3464 8.97194C15.3438 8.97988 15.3407 8.98837 15.3375 8.99679C15.3309 9.01371 15.3238 9.02985 15.3159 9.04557C15.3122 9.05296 15.3082 9.06069 15.3039 9.06835C15.2968 9.08084 15.2896 9.09272 15.2819 9.10429C15.2765 9.11248 15.2706 9.12101 15.2643 9.1294L15.2594 9.13588C15.2443 9.15568 15.2278 9.17444 15.2102 9.19204L15.2096 9.19256L10.6721 13.7113C10.4519 13.9305 10.0958 13.9298 9.87658 13.7097C9.67729 13.5096 9.65979 13.197 9.82363 12.9771L9.87823 12.9142L13.449 9.35724L3.5625 9.35679C3.25184 9.35679 3 9.10495 3 8.79429Z",fill:s})})}),BagIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__bag",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 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:r="button",link:l="",...a}=e;return"hyperlink"===r&&(null==l?void 0:l.length)?jsxRuntimeExports.jsx("a",{href:l,className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":o,ref:t,...a,children:i}):jsxRuntimeExports.jsx("button",{className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":o,ref:t,...a,children:i})})),SearchInputField$1="",SearchInputField=e=>{const{className:t="",icon:s,value:i="",withClearField:n,onChange:o,onResetField:r,fieldRef:l,...a}=e,[d,c]=React.useState(!1);return React.useEffect((()=>{c(Boolean(i))}),[i]),jsxRuntimeExports.jsxs("div",{className:`sledge__search-input-field-wrapper ${t||""}`,children:[s?jsxRuntimeExports.jsx("div",{className:"sledge__search-input-field-icon",children:s}):null,jsxRuntimeExports.jsx("input",{className:"sledge__search-input-field",value:i,onChange:e=>(e=>{o&&o({value:e.target.value})})(e),ref:l,...a}),d&&n?jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==l?void 0:l.current)&&l.current.focus(),o&&o({value:""}),r&&r()},children:jsxRuntimeExports.jsx("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:r="end",onChange:l,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)=>{l&&l({label:e,value:t}),p(!1)})(s,i),...i===a&&{"data-selected":!0},children:s},t);return c?jsxRuntimeExports.jsx(c,{scroll:!1,to:null==u?void 0:u.replace("value",i),href:null==u?void 0:u.replace("value",i),children:jsxRuntimeExports.jsx(n,{})},t):jsxRuntimeExports.jsx(n,{},t)}))}),isOpen:x,setIsOpen:p,hideCloseIcon:!0,align:r,className:"sledge__select-field-option-content",withArrow:!1})})},ProductGrid$1="",addToCart=async e=>{var t,s=new Headers;s.append("Content-Type","application/json");let i=[];e.map((e=>{const{id:t,quantity:s}=e;i.push({id:t,quantity:s})}));var n={method:"POST",headers:s,body:JSON.stringify({items:i}),redirect:"follow"};if(null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)return await fetch(`${window.Shopify.routes.root}cart/add.js`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getReview=async(e,t,s)=>{const{page:i,limit:n,sort:o,keyword:r,rating:l}=t||{};let a=sanitizeDataId(e),d=s||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),c="?"+new URLSearchParams({page:i||"",limit:n||"",sort:o||"",keyword:r||"",rating:l||""}).toString();var u=new Headers;u.append("Authorization",`Bearer ${d}`);var x={method:"GET",headers:u,redirect:"follow"};return await fetch(`${API_URL}/review/${a}${c}`,x).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getReviewInfo=async e=>{let t=sanitizeDataId(e),s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${s}`);var n={method:"GET",headers:i,redirect:"follow"};return await fetch(`${API_URL}/review/info/${t}`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getReviewMedia=async()=>{let e=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var t=new Headers;t.append("Authorization",`Bearer ${e}`);var s={method:"GET",headers:t,redirect:"follow"};return await fetch(`${API_URL}/review/media`,s).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addReviewMedia=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`);var i=new FormData;[...e].map((e=>{i.append("files",e,e.name)}));var n={method:"POST",headers:s,body:i,redirect:"follow"};return await fetch(`${API_URL}/review/media`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},deleteReviewMedia=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`);var i={method:"DELETE",headers:s,redirect:"follow"};return await fetch(`${API_URL}/review/media/${e}`,i).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addReview=async e=>{const{userFirstName:t,userLastName:s,userEmail:i,productId:n,productVariantId:o,rating:r,title:l,review:a,mediaIds:d}=e;let c=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var u=new Headers;u.append("Authorization",`Bearer ${c}`),u.append("Content-Type","application/json");var x={method:"POST",headers:u,body:JSON.stringify({user:{name:`${t}${s?` ${s}`:""}`,email:i},product:{id:sanitizeDataId(n),variant_id:sanitizeDataId(o)},review:{rating:r,title:l,review:a,media_ids:d}}),redirect:"follow"};return await fetch(`${API_URL}/review`,x).then((e=>e.json())).then((e=>e)).catch((()=>{}))},usePrevious=e=>{const t=React.useRef();return React.useEffect((()=>{t.current=e})),t.current},Rating=e=>{var t;const{value:s,size:i="md",params:n,withSkeletonLoading:o=!0,isScrollToElementWidget:r=!0,data:l}=e,{productId:a}=n||{},{isRenderApp:d}=React.useContext(SledgeContext),[c,u]=React.useState(!0),[x,p]=React.useState(!0),[m,g]=React.useState({width:0,height:0}),[_,R]=React.useState(0),[h,E]=React.useState("0"),[j,v]=React.useState({}),w=usePrevious({productId:a}),{fill_color:T,outline_color:f}=(null==(t=null==j?void 0:j.display)?void 0:t.rating)||{},S=async()=>{s&&!n?(E(s),p(!1)):(async e=>{var t;let s,i,n,o=!1,r=0;if(l)n=l,o=!0;else{if(!e)return;if(s=await getReviewInfo(e),!s)return;const{status:t}=s;n=s.data;const{code:i}=t;o=200===i||!1}r=(null==n?void 0:n.review_count)?n.review_count:0,i=(null==(t=null==n?void 0:n.rating)?void 0:t.average)?n.rating.average:0,o&&(R(r),E(i),p(!1),u(!1))})(a)};return React.useEffect((()=>{if(!(null==d?void 0:d.productReview))return;"undefined"!=typeof window&&(window.sledgeProductReviewRatingUpdate=()=>{p(!0),S()}),g("xs"===i?{width:14.4,height:14.4}:"sm"===i?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(w&&(null==w?void 0:w.productId)!==a)&&u(!0),(async e=>{let t;p(!0),t=JSON.parse(e),t&&(v(t),await S())})(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"")}),[d]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{r&&setTimeout((()=>{scrollToElement(document.getElementById(ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET),50)}),200)},children:c&&o?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"230px",height:"28px",color:"grey-100",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:T||"#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:f||"#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"})]})})]}),!x&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((e,t)=>{let s=Math.floor(parseFloat(h)),i=String(h).includes(",")?String(h).split(","):[],n=String(h).includes(".")?String(h).split("."):[],o=i.length||n.length?i[1]||n[1]:0,r="fill-0";return e>s&&s+1===e&&(r=`fill-${o}`),reactExports.createElement("svg",{...m,viewBox:"0 0 30 29","data-product-review-rating-fill":e<=s?"full":r,key:t},jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),!s&&n?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",_,")"]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]})]})})},ElementInit$1=e=>{const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),s=e.getAttribute(DATASET_ATTRIBUTE_KEY.PRODUCT_REVIEW.RATING_SIZE);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(Rating,{params:{productId:t||""},size:s})})}))},RatingInitSelector=()=>{let e=Array.from(document.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING));detectInitSelector(e,(()=>{e.length&&e.map((e=>ElementInit$1(e)))})),new MutationObserver((function(t){t.forEach((function(t){Array.prototype.slice.call(t.addedNodes).forEach((function(t){1===t.nodeType&&t.querySelector(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)&&(e=Array.from(t.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)),e.length&&e.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,r,l;const{text_color:a,border_color:d,border_radius:c,padding_top:u,padding_bottom:x,padding_left:p,padding_right:m,background_color:g,font_size:_,font_weight:R,text_transform:h}=(null==(r=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:r.button_write_review)||{},{button_write_review:E}=(null==(l=null==s?void 0:s.languages)?void 0:l.widget)||{},j={...a&&{color:a},...d&&{borderColor:d},...c&&{borderRadius:c},...u&&{paddingTop:u},...x&&{paddingBottom:x},...p&&{paddingLeft:p},...m&&{paddingRight:m},...g&&{backgroundColor:g},..._&&{fontSize:_},...R&&{fontWeight:R},...h&&{textTransform:h}};return jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"success",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(i,n),style:j,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||(E||"Add review")]})})},WidgetHeaderSort$1=({isFirstLoading:e,productReviewSort:t,dataSettings:s,setSelectedSort:i,setIsRefreshWidgetList:n,LinkComponent:o})=>{var r,l;const{default_sort:a,show_sorting_options:d}=(null==(r=null==s?void 0:s.display)?void 0:r.widget)||{},[c,u]=React.useState(a||null),x=c||(null==(l=t[0])?void 0:l.value);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:d?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):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:x,onChange:({value:e})=>(e=>{u(e),n&&n(!0),i&&i(e)})(e),LinkComponent:o,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;const{params:n,dataSettings:o,summaryData:r}=e,{productId:l}=n||{},{fill_color:a,outline_color:d}=(null==(s=null==(t=null==o?void 0:o.display)?void 0:t.widget)?void 0:s.summary_bar)||{},{review_singular:c,review_plural:u}=(null==(i=null==o?void 0:o.languages)?void 0:i.widget)||{},[x,p]=React.useState(!0),[m,g]=React.useState(!0),[_,R]=React.useState(!0),[h,E]=React.useState(!0),[j,v]=React.useState(!1),[w,T]=React.useState(0),[f,S]=React.useState({5:0,4:0,3:0,2:0,1:0}),[A,C]=React.useState("0"),L=usePrevious({productId:l}),I=async()=>{var e;let t,s,i,n,o=!1,a=0;if(r)s=r,o=!0;else{if(t=await getReviewInfo(l),!t)return;const{status:e}=t,{code:i}=e;s=t.data,o=200===i||!1}a=(null==s?void 0:s.review_count)?s.review_count:0,i=(null==s?void 0:s.rating)?{5:s.rating[5]||0,4:s.rating[4]||0,3:s.rating[3]||0,2:s.rating[2]||0,1:s.rating[1]||0}:f,n=(null==(e=null==s?void 0:s.rating)?void 0:e.average)?s.rating.average:"0",o&&(T(a),S(i),C(n),R(!1),E(!1),p(!1),j&&g(!1))};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{E(!0),I()}),Boolean(L&&(null==L?void 0:L.productId)!==l)&&p(!0),I()}),[j,l]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:x?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"630px",height:"42px",color:"grey-100",rounded:"md",animationDuration:"5s"}):_?null:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(motion.div,{initial:!1,animate:j?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:A}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!h&&jsxRuntimeExports.jsx(Rating,{value:String(A),size:"md",withSkeletonLoading:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[w," ",w>1?u||"Reviews":c||"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:m?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:"grey-100",rounded:"md",animationDuration:"15s"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"128px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginLeft:"13px",marginRight:"12px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"38px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"42s"})]},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,{value:e,size:"sm",withSkeletonLoading:!1,isScrollToElementWidget:!1}),jsxRuntimeExports.jsx(Progress,{value:String(f[e]),total:w,fillColor:a,outlineColor:d}),jsxRuntimeExports.jsxs("small",{children:["(",f[e],")"]})]},t)))})}),setIsOpen:v,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})},WidgetHeader$1=e=>{const[t,s]=React.useState(!0);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;const{isFirstLoading:s,isLoading:i,productReviewData:n,dataSettings:o,currentPage:r,setCurrentPage:l,totalPage:a,totalData:d,setIsReplaceWidgetList:c,widgetWrapperRef:u}=e||{},{type:x}=(null==(t=null==o?void 0:o.display)?void 0:t.widget)||{},p="list"===x?jsxRuntimeExports.jsx(Pagination,{currentPage:r||1,totalPage:a||1,totalResult:d||0,onChange:e=>(e=>{l&&l(e),c&&c(!0),setTimeout((()=>{scrollToElement(u.current,50)}),200)})(e)}):null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.ReviewGrid,{count:"grid"===x?8:10,type:x,gridItemHeights:["252px","342px","196px","398px","342px","252px","398px","196px"]}),s?null:p]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-wrapper","data-layout-type":x,children:(null==n?void 0:n.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReviewWrapper,{...e}),p]}):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,r]=React.useState(""),[l,a]=React.useState("");return React.useEffect((()=>{r(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:l}})]})},ReviewWrapper=e=>{var t,s,i,n,o,r,l,a;const{productReviewData:d,currentPage:c,setCurrentPage:u,totalPage:x,totalData:p,dataSettings:m,setIsRefreshWidgetList:g,setIsReplaceWidgetList:_,LinkComponent:R,selectedSort:h,data:E}=e||{},{type:j,rating_size:v,show_review_date:w}=(null==(t=null==m?void 0:m.display)?void 0:t.widget)||{},{text_color:T,border_color:f,border_radius:S,padding_top:A,padding_bottom:C,padding_left:L,padding_right:I,background_color:N,font_size:y,font_weight:b,text_transform:O}=(null==(i=null==(s=null==m?void 0:m.display)?void 0:s.widget)?void 0:i.button_load_more)||{},{text_color:D,border_color:$,border_radius:P,padding_top:U,padding_bottom:W,padding_left:k,padding_right:M,background_color:B,font_size:F,font_weight:H,text_transform:G}=(null==(o=null==(n=null==m?void 0:m.display)?void 0:n.widget)?void 0:o.verified)||{},{button_load_more:V,verified:Y}=(null==(r=null==m?void 0:m.languages)?void 0:r.widget)||{},{name:K,image:q}=(null==(a=null==(l=null==m?void 0:m.display)?void 0:l.widget)?void 0:a.replier)||{},z={...T&&{color:T},...f&&{borderColor:f},...S&&{borderRadius:S},...A&&{paddingTop:A},...C&&{paddingBottom:C},...L&&{paddingLeft:L},...I&&{paddingRight:I},...N&&{backgroundColor:N},...y&&{fontSize:y},...b&&{fontWeight:b},...O&&{textTransform:O}},J={...D&&{color:D},...$&&{borderWidth:"1px",borderStyle:"solid",borderColor:$},...P&&{borderRadius:P},...U&&{paddingTop:U},...W&&{paddingBottom:W},...k&&{paddingLeft:k},...M&&{paddingRight:M},...B&&{backgroundColor:B},...F&&{fontSize:F},...H&&{fontWeight:H},...G&&{textTransform:G}};let Z=c||0,X=x||0;const[Q,ee]=React.useState(!1),[te,se]=React.useState(!1),ie=()=>{u&&c&&u(c+1),ee(!0)};React.useEffect((()=>{se(!(X===Z&&!Q)&&(!!(E&&X>1)||X>=Z))}),[Q]),React.useEffect((()=>{ee(!1)}),[d]);const ne=()=>jsxRuntimeExports.jsx(Button,{type:"button",role:"button",colorType:"light",disabled:Q,onClick:ie,style:{...z,...Q&&{cursor:"wait"}},children:Q?"Loading...":V||"Load More"}),oe=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:r,media:l,reply:a,is_verified:d},created_at:c}=e;let u=new Intl.DateTimeFormat("en-US").format(new Date(c)),x=K?String(String(K).includes("<span>")?String(K).split("<span>")[0]:String(K)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=a[0])?void 0:s.name):null==(i=a[0])?void 0:i.name,p=K?getTextBetween("<span>","</span>",K):"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:J,children:Y}):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,{value:o,size:v,withSkeletonLoading:!1,isScrollToElementWidget:!1})}),w?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:u}):null]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:r.length>=250?`${r.slice(0,250)}...`:r})]}),(null==l?void 0:l.length)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:l.slice(0,4).map(((e,t)=>{const{type:s,file:i}=e;let n="image"===s?jsxRuntimeExports.jsx("img",{src:i,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:q||"",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,{}),te&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-button-load-more",children:R?jsxRuntimeExports.jsx(R,{scroll:!1,to:`?page=${(c||1)+1}&sort=${h}`,href:`?page=${(c||1)+1}&sort=${h}`,children:jsxRuntimeExports.jsx(ne,{})}):jsxRuntimeExports.jsx(ne,{})})]}),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:r,review:l,media:a,reply:d,is_verified:c},created_at:u}=e;let x=new Intl.DateTimeFormat("en-US").format(new Date(u)),p=K?String(String(K).includes("<span>")?String(K).split("<span>")[0]:String(K)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=d[0])?void 0:s.name):null==(i=d[0])?void 0:i.name,g=K?getTextBetween("<span>","</span>",K):"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:J,children:Y}):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,{value:r,size:v,withSkeletonLoading:!1,isScrollToElementWidget:!1})}),w?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:x}):null]})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-content",children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-desc-wrapper",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-desc",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:l.length>=350?`${l.slice(0,350)}...`:l}),(null==d?void 0:d.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("svg",{width:18,height:16,viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M0.5625 15.5C0.764999 15.5 0.955502 15.3905 1.056 15.2068L1.07175 15.1783C2.754 12.14 5.9595 10.25 9.4365 10.25H10.5V13.4375C10.5 13.6633 10.6358 13.8673 10.8435 13.9558C11.0498 14.0428 11.2928 13.9993 11.454 13.841L17.829 7.65351C17.9385 7.54776 18 7.40226 18 7.25001C18 7.09776 17.9385 6.95226 17.829 6.84651L11.454 0.659013C11.292 0.501513 11.0498 0.456513 10.8435 0.544263C10.6358 0.632763 10.5 0.836763 10.5 1.06251V4.25151C4.69275 4.35201 0 9.10701 0 14.9375C0 15.1948 0.174 15.419 0.423 15.4828C0.4695 15.4948 0.516001 15.5 0.5625 15.5ZM11.0625 9.12501H9.4365C6.3045 9.12501 3.36975 10.4968 1.3635 12.8083C2.334 8.55651 6.14625 5.37501 10.6875 5.37501H11.0625C11.373 5.37501 11.625 5.12301 11.625 4.81251V2.39226L16.6298 7.25001L11.625 12.1078V9.68751C11.625 9.37701 11.373 9.12501 11.0625 9.12501Z",fill:"#677487"})}),jsxRuntimeExports.jsx("img",{src:q||"",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:oe},WidgetRoot$1=e=>{const{children:t,params:s,onAfterAddReview:i,data:n,LinkComponent:o}=e,{productId:r}=s||{},{isRenderApp:l}=React.useContext(SledgeContext),[a,d]=React.useState(!0),[c,u]=React.useState(!0),[x,p]=React.useState(!1),[m,g]=React.useState(!1),[_,R]=React.useState([]),[h,E]=React.useState([]),[j,v]=React.useState(""),[w,T]=React.useState(1),[f,S]=React.useState(0),[A,C]=React.useState(0),[L,I]=React.useState({}),N=React.useRef(null),y=usePrevious({currentPage:w,isReplaceWidgetList:m,productId:r}),b=async(e=!1,t=!1,s)=>{var i,o;if(n&&JSON.stringify(_)===JSON.stringify(n.data))return;let l,a=10,c=j;if(u(!!t||!e),!e||t){let e=await O(s);const{review_per_page:r,default_sort:l}=(null==(i=null==e?void 0:e.display)?void 0:i.widget)||{};a=r||a,c=j||l,t||T(n?Math.ceil((null==(o=null==n?void 0:n.data)?void 0:o.length)/a):1),R([]),v(c)}let x,m,h=!1,f=0,A=0,L={page:e?w:1,limit:a,sort:c};if(l=n||await getReview(r,L),!l)return;const{status:I,data:N,page:y,sorts:b}=l,{code:D}=I;h=200===D||!1,x=(null==N?void 0:N.length)?t=>(null==_?void 0:_.length)&&e?[...t,...N]:N:[],m=(null==b?void 0:b.length)?b:[],f=n?Math.ceil(((null==y?void 0:y.total_data)||1)/a):(null==y?void 0:y.total_page)||1,A=(null==y?void 0:y.total_data)||1,h&&(R(x),E(m),S(f),C(A),u(!1),p(!1),g(!1),d(!1))},O=async e=>{let t;if(t=JSON.parse(e),t)return I(t),t};return React.useEffect((()=>{if(!(null==l?void 0:l.productReview))return;let e=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";"undefined"!=typeof window&&(window.sledgeProductReviewWidgetListUpdate=()=>{b(!1,!1,e)}),Boolean(y&&(null==y?void 0:y.productId)!==r)&&b(!1,!1,e),O(e)}),[l,r]),React.useEffect((()=>{if(!(null==l?void 0:l.productReview))return;let e=Boolean(y&&(null==y?void 0:y.currentPage)!==w),t=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";Boolean(y&&(null==y?void 0:y.isReplaceWidgetList)!==m)?b(!0,!0,t):b(!x&&e,m,t)}),[w,x,m,l,n]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-wrapper",ref:N,id:ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET,children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{params:s,isFirstLoading:a,isLoading:c,productReviewData:_,productReviewSort:h,selectedSort:j,currentPage:w,totalPage:f,totalData:A,dataSettings:L,setIsLoading:u,setIsRefreshWidgetList:p,setIsReplaceWidgetList:g,setSelectedSort:v,setCurrentPage:T,onAfterAddReview:i,widgetWrapperRef:N,data:n,LinkComponent:o})))})})},Widget$1=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Widget$1.Root=WidgetRoot$1,Widget$1.Header=WidgetHeader$1,Widget$1.List=WidgetList$1;const WidgetPopupDetail=()=>{var e,t,s;const[i,n]=React.useState(!1),[o,r]=React.useState(""),[l,a]=React.useState(""),[d,c]=React.useState(""),[u,x]=React.useState(""),[p,m]=React.useState([]),[g,_]=React.useState([]),[R,h]=React.useState(""),[E,j]=React.useState(""),[v,w]=React.useState(!1),[T,f]=React.useState(""),[S,A]=React.useState({}),[C,L]=React.useState(0),[I,N]=React.useState({}),{text_color:y,border_color:b,border_radius:O,padding_top:D,padding_bottom:$,padding_left:P,padding_right:U,background_color:W,font_size:k,font_weight:M,text_transform:B}=(null==(t=null==(e=null==S?void 0:S.display)?void 0:e.widget)?void 0:t.verified)||{},{verified:F}=(null==(s=null==S?void 0:S.languages)?void 0:s.widget)||{},H={...y&&{color:y},...b&&{borderWidth:"1px",borderStyle:"solid",borderColor:b},...O&&{borderRadius:O},...D&&{paddingTop:D},...$&&{paddingBottom:$},...P&&{paddingLeft:P},...U&&{paddingRight:U},...W&&{backgroundColor:W},...k&&{fontSize:k},...M&&{fontWeight:M},...B&&{textTransform:B}},G=0===C,V=C===(null==p?void 0:p.length)-1;return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetPopupDetail=e=>{var t,s,i,o;const{user:{name:l},review:{rating:d,title:u,review:p,media:g,reply:R,is_verified:E},created_at:v,settings:T}=e,{name:S,image:C}=(null==(s=null==(t=null==T?void 0:T.display)?void 0:t.widget)?void 0:s.replier)||{};r(l),a(d),c(u),x(p),m(g),_(R),h(S?String(String(S).includes("<span>")?String(S).split("<span>")[0]:String(S)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(i=R[0])?void 0:i.name):null==(o=R[0])?void 0:o.name),j(S?getTextBetween("<span>","</span>",S):"Admin"),w(E),f(new Intl.DateTimeFormat("en-US").format(new Date(v))),n(!0),A(T),L(0),N({name:S,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:()=>L(C-1),children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"white"})}),!V&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-next",onClick:()=>L(C+1),children:jsxRuntimeExports.jsx(ChevronArrowRightIcon,{width:16,height:16,color:"white"})})]})]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-no-media",children:"No Media Upload"})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-heading",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-title",children:o}),v?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-verified-text",style:H,children:F}):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,{value:l,size:"sm",withSkeletonLoading:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-date",children:T})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-title-description",children:d}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-description",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-message",dangerouslySetInnerHTML:{__html:u}}),(null==g?void 0:g.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-reply-wrapper",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("img",{src:(null==I?void 0:I.image)||"",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:E})]}),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}=React.useContext(SledgeContext),[o,r]=React.useState(!1),[l,a]=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}]),[d,c]=React.useState(l[0]),[u,x]=React.useState(!1),[p,m]=React.useState(null),[g,_]=React.useState(!1),[R,h]=React.useState(!1),[E,j]=React.useState(!1),[v,w]=React.useState(null),[T,f]=React.useState({}),[S,A]=React.useState({onAfterAddReview:e=>{}}),[C,L]=React.useState(""),[I,N]=React.useState(""),[y,b]=React.useState(""),[O,D]=React.useState(""),[$,P]=React.useState(""),[U,W]=React.useState(0),[k,M]=React.useState(""),[B,F]=React.useState(""),[H,G]=React.useState([]),[V,Y]=React.useState([]),{title_added_to_review:K,text_added_to_review:q}=(null==(e=null==T?void 0:T.languages)?void 0:e.notification)||{},{title_confirm_add_review:z,text_confirm_add_review:J,button_submit_confirm_add_review:Z,button_cancel_confirm_add_review:X}=(null==(t=null==T?void 0:T.languages)?void 0:t.popup)||{},{navigation_previous:Q,navigation_next:ee,button_submit:te}=(null==(s=null==T?void 0:T.languages)?void 0:s.write_review_form)||{},se=async()=>{let e;_(!0);let t=!1;if(e=await addReview({userFirstName:C,userLastName:I,userEmail:y,productId:O,productVariantId:$,rating:U,title:k,review:B,mediaIds:H}),!e)return;const{status:{code:s}}=e;t=200===s,t?(S.onAfterAddReview("success"),setTimeout((()=>{_(!1),r(!1),c(l[0]),L(""),N(""),b(""),W(0),M(""),F(""),G([]),Y([]),ne&&ne(),"undefined"!=typeof window&&(window.sledgeProductReviewRatingUpdate&&window.sledgeProductReviewRatingUpdate(),window.sledgeProductReviewWidgetListUpdate&&window.sledgeProductReviewWidgetListUpdate(),window.sledgeProductReviewWidgetSummaryUpdate&&window.sledgeProductReviewWidgetSummaryUpdate(),window.sledgeToastNotification&&window.sledgeToastNotification({title:K,message:q,type:"success",icon:jsxRuntimeExports.jsx(StarIcon,{width:40,height:40,color:"black"})}))}),500)):(S.onAfterAddReview("failed"),_(!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"})}))},ie=()=>{const e=l.findIndex((e=>e.key===d.key));a((e=>e.map((e=>(e.key===d.key&&(e.isDone=!0),e))))),c(l[e+1])},ne=async()=>{let e,t=!1,s=[],i=[];if(e=await getReviewMedia(),!e)return;const{status:n,data:o}=e,{code:r}=n;t=200===r||!1,s=(null==o?void 0:o.ids)||[],i=(null==o?void 0:o.media)||[],t&&(G(s),Y(i),h(!1),j(!1),w(null))},oe=()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:z,message:J,textSubmit:Z,textCancel:X,buttonSubmitType:"success",onSubmit:se||{}})};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetFormAdd=(e,t)=>{const{productId:s,productVariantId:i}=e||{};r(!0),D(s||""),P(i||""),t&&A({onAfterAddReview:t})}),(async e=>{let t;t=JSON.parse(e),t&&(f(t),await ne())})(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"")}),[]),React.useEffect((()=>{c(l[0])}),[n]),React.useEffect((()=>{switch(null==d?void 0:d.key){case"Step_SelectRate":x(!!U),m(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:ee}),jsxRuntimeExports.jsx(ArrowRightIcon,{width:18,height:18,color:"black"})]}));break;case"Step_WriteReview":x(!0),m(n?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:ee}),jsxRuntimeExports.jsx(ArrowRightIcon,{width:18,height:18,color:"black"})]}):te);break;case"Step_PersonalData":x(!0),m(te)}}),[d,U,B,C,y,n]),React.useEffect((()=>{o?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[o]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:o,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==d?void 0:d.key)?ie():n&&"Step_WriteReview"===(null==d?void 0:d.key)?ie&&ie():oe&&oe()})(e),"data-active-step":(null==d?void 0:d.key)||"","data-visible-next":u,children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step",children:(null==d?void 0:d.component)&&React.cloneElement(jsxRuntimeExports.jsx(d.component,{}),{steps:l,activeStep:d,isLoadingAddReview:g,isLoadingUploadMedia:R,isLoadingDeleteMedia:E,selectedDeleteMediaId:v,dataSettings:T,postUserFirstName:C,postUserLastName:I,postUserEmail:y,postRating:U,postReview:B,postMedia:V,setIsLoadingUploadMedia:h,setIsLoadingDeleteMedia:j,setSelectedDeleteMediaId:w,handleNext:ie,handleProductReviewMedia:ne,handleAddReview:se,setPostUserFirstName:L,setPostUserLastName:N,setPostUserEmail:b,setPostRating:W,setPostTitle:M,setPostReview:F,confirmAddReview:oe})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-add-step-navigator",children:[(null==(i=l[0])?void 0:i.key)===(null==d?void 0:d.key)?jsxRuntimeExports.jsx("span",{}):jsxRuntimeExports.jsx("span",{onClick:()=>{const e=l.findIndex((e=>e.key===d.key));0!==e&&(a((e=>e.map((e=>(e.key===d.key&&(e.isDone=!1),e))))),c(l[e-1]))},children:Q}),u&&jsxRuntimeExports.jsx($d94698215c4408a7$export$2c4cf1f7b42ef78c,{asChild:!0,disabled:g,children:jsxRuntimeExports.jsx(Button,{role:"button",colorType:"light",style:{...g&&{cursor:"wait"}},children:g?"Adding...":p})})]})]})})]})})},Step_SelectRate=e=>{var t,s,i,n;const{postRating:o,setPostRating:r,setPostTitle:l,dataSettings:a}=e,{text_color:d,border_color:c,border_radius:u,padding_top:x,padding_bottom:p,padding_left:m,padding_right:g,background_color:_,selected_background_color:R,font_size:h,font_weight:E,text_transform:j}=(null==(s=null==(t=null==a?void 0:a.display)?void 0:t.write_review_form)?void 0:s.button_select_rating)||{},{title:v,ratings:w}=(null==(n=null==(i=null==a?void 0:a.languages)?void 0:i.write_review_form)?void 0:n.select_rating)||{},{rating_5:T,rating_4:f,rating_3:S,rating_2:A,rating_1:C}=w||{},L={...d&&{color:d},...c&&{borderColor:c},...u&&{borderRadius:u},...x&&{paddingTop:x},...p&&{paddingBottom:p},...m&&{paddingLeft:m},...g&&{paddingRight:g},...h&&{fontSize:h},...E&&{fontWeight:E},...j&&{textTransform:j}},I=[{rate:5,title:T},{rate:4,title:f},{rate:3,title:S},{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:v}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-select-rate-list",children:I.map(((e,t)=>jsxRuntimeExports.jsxs("button",{type:"button",className:`sledge-product-review__widget-form-select-rate-list-item ${e.rate===o&&"selected"}`,onClick:()=>{return t=e.rate,s=e.title,r&&r(t),void(l&&l(s));var t,s},style:{...L,..._&&R?{backgroundColor:e.rate===o?R:_}:{}},children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{value:e.rate,size:"md",withSkeletonLoading:!1,isScrollToElementWidget:!1})})," ",jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-form-select-rate-text",children:e.title})]},t)))})]})},Step_WriteReview=e=>{var t;const{isLoadingUploadMedia:s,isLoadingDeleteMedia:i,selectedDeleteMediaId:n,dataSettings:o,postMedia:r,postReview:l,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:h}=_||{},[E,j]=React.useState(!1),v=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((()=>{j(!1)}),[]),React.useEffect((()=>{n&&E&&(j(!1),"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Are you sure want to delete this media?",message:"This action cannot be undone. This will permanently delete this media.",textSubmit:"Delete",textCancel:"Cancel",buttonSubmitType:"danger",onSubmit:v||{}}))}),[n,E]);const w=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:r}=t||{},{code:l}=o||{};s=200===l,i=(null==r?void 0:r.ids)||[],n=(null==r?void 0:r.media)||[],s?(p&&p(i),m&&m(n),x&&x(),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Media added",message:"successfully added to media",type:"success",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})})):(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:h,value:l,onChange:e=>g&&g(e.target.value)}),(null==r?void 0:r.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-filled",children:[r.map(((e,t)=>{const{id:s,file:o,type:r}=e;let l=i&&s==n;return jsxRuntimeExports.jsxs(motion.div,{initial:"hidden",animate:"visible",variants:VISIBLE_ANIMATION,className:"sledge-product-review__widget-form-upload-media-filled-item",children:[l?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-loading",children:"Deleting..."}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-item",onClick:()=>{j(!0),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"===r?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:!l,className:"sledge-product-review__widget-form-upload-media-filled-item-file",children:jsxRuntimeExports.jsx("source",{src:o})})]},t)})),w]})}):w]})},Step_PersonalData=e=>{var t;const{dataSettings:s,postUserFirstName:i,postUserLastName:n,postUserEmail:o,setPostUserFirstName:r,setPostUserLastName:l,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=>r&&r(e.target.value),value:i}),jsxRuntimeExports.jsx(InputField,{name:"userLastName",type:"text",required:!0,placeholder:x,onChange:e=>l&&l(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=document.querySelector(SELECTOR.PRODUCT_REVIEW.ELEMENT_WIDGET);detectInitSelector(element,(()=>{if(element){const PRODUCT_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),ON_AFTER_ADD_REVIEW=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_REVIEW);element.innerHTML="",client.createRoot(element).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=>{element&&ON_AFTER_ADD_REVIEW&&eval(ON_AFTER_ADD_REVIEW)&&eval(ON_AFTER_ADD_REVIEW)({element:element,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=document.querySelector(SELECTOR.INSTANT_SEARCH.ELEMENT_PLP_WIDGET);detectInitSelector(element,(()=>{var _a;if(element){const QUERY_KEYWORD=element.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.QUERY_KEYWORD),COLLECTION_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.COLLECTION_ID),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD);client.createRoot(element).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)||""},onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null})})})}))}}))},SearchIconWidget=e=>{const{isRenderApp:t,isJsVersion:s}=React.useContext(SledgeContext),{size:i="sm",children:n,onAfterAddToCart:o,onAfterAddWishlist:r,onAfterRemoveWishlist:l,onAfterRenderProduct:a}=e||{};let d=null,c=null,u=null,x=null;React.Children.map(n,(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)&&(d=t),s&&isFunction(s)&&(c=s),i&&isFunction(i)&&(u=i),n&&isFunction(n)&&(x=n)}}));const[p,m]=React.useState({width:0,height:0});React.useEffect((()=>{(null==t?void 0:t.instantSearch)&&m("xs"===i?{width:14,height:14}:"sm"===i?{width:20,height:20}:{width:25,height:25})}),[t]);return jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup({onAfterAddToCart:o,onAfterAddWishlist:r,onAfterRemoveWishlist:l,onAfterRenderProduct:a,isJsVersion:s,productCardsComponent:d,suggestionKeywordListsComponent:c,otherIndexListsComponent:u,searchViewMoreResultComponent:x})},children:jsxRuntimeExports.jsx(SearchIcon,{...p,color:"currentColor"})})},fetchApi=async(e,t,s)=>{let i=localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP);var n=new Headers;n.append("Authorization",`Bearer ${i}`),n.append("Content-Type","application/json");var o={method:t,headers:n,redirect:"follow",...s&&{body:JSON.stringify(s)}};return await fetch(`${INSTANT_SEARCH_ENGINE_URL}${e}`,o).then((e=>e.json())).then((e=>e)).catch((()=>{}))},search=async(e,t)=>await fetchApi(`/indexes/${e}/search`,"POST",t),multiSearch=async e=>await fetchApi("/multi-search","POST",e),searchTrigger=async e=>{const{keyword:t,resultCount:s}=e;let i=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var n=new Headers;n.append("Authorization",`Bearer ${i}`),n.append("Content-Type","application/json");var o={method:"POST",headers:n,body:JSON.stringify({keyword:t,result_count:s}),redirect:"follow"};return await fetch(`${API_URL}/instantsearch/statistics/search`,o).then((e=>e.json())).then((e=>e)).catch((()=>{}))},productClickTrigger=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${s}`),i.append("Content-Type","application/json");var n={method:"POST",headers:i,body:JSON.stringify({product:{id:sanitizeDataId(t)}}),redirect:"follow"};return await fetch(`${API_URL}/instantsearch/statistics/click`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addToCartTrigger$1=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${s}`),i.append("Content-Type","application/json");var n={method:"POST",headers:i,body:JSON.stringify({product:{id:sanitizeDataId(t)}}),redirect:"follow"};return await fetch(`${API_URL}/instantsearch/statistics/cart`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},OtherIndexLists=({listsComponent:e,name:t,items:s,isComponentJsVersion:i,showPopupComponent:n,setShowPopupComponent:o})=>{const r=e?e({name:t,items:s,showPopupComponent:n,setShowPopupComponent:o}):null;return e?i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r: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,r,l,a,d,c,u,x,p,m,g,_,R,h,E,j,v;const[w,T]=React.useState(!0),[f,S]=React.useState(!1),[A,C]=React.useState(""),[L,I]=React.useState(""),[N,y]=React.useState([]),[b,O]=React.useState([]),[D,$]=React.useState([]),[P,U]=React.useState([]),[W,k]=React.useState({}),[M,B]=React.useState({}),[F,H]=React.useState(""),[G,V]=React.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),Y=React.useRef(null),K=usePrevious({keyword:A}),q=async(e,t=!1)=>{var s,i,n,o,r,l,a,d,c,u,x;if(!f)return;T(!0);const{tabs:p,suffix_index_product:m,hidden_tags:g,display:_}=e,R=(null==(s=null==_?void 0:_.search)?void 0:s.suggestion)||{};let h,E={queries:p.map((e=>{var t;const{index:s}=e;let i=s.includes(m),n=[];return(null==g?void 0:g.length)&&n.push(`tags NOT IN [${g}]`),(null==(t=null==_?void 0:_.filter)?void 0:t.show_out_of_stock)||n.push("variants.inventory_quantity > 0"),{indexUid:s,q:A,hitsPerPage:i?6:4,filter:i?n.join(" AND "):""}}))};if(h=await multiSearch(E),!h)return;const{results:j}=h;let v=null==j?void 0:j.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));t&&(null==A?void 0:A.length)&&searchTrigger({keyword:A,resultCount:(null==(i=v[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==v?void 0:v.length)?null==(o=v[0])?void 0:o.hits:[],C=A.length?(null==S?void 0:S.length)?"":"no_result":"zero_character",L=Boolean(!A.length&&Object.keys(R).length&&(null==(l=null==(r=R[C])?void 0:r.products)?void 0:l.active)&&(null==(c=null==(d=null==(a=R[C])?void 0:a.products)?void 0:d.list)?void 0:c.length));y(L?null==(x=null==(u=R[C])?void 0:u.products)?void 0:x.list:S),O(w),H(C),T(!1)};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:o=(()=>{}),suggestionKeywordListsComponent:r=(()=>{}),otherIndexListsComponent:l=(()=>{}),searchViewMoreResultComponent:a=(()=>{})})=>{S(!0),V({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:o,suggestionKeywordListsComponent:r,otherIndexListsComponent:l,searchViewMoreResultComponent:a}),setTimeout((()=>{(null==Y?void 0:Y.current)&&(Y.current.focus(),Y.current.value=A)}),500)}),(async e=>{var t;if(!f)return;let s;if(s=JSON.parse(e),!s)return;const{tabs:i,suffix_index_product:n,hidden_tags:o,display:r}=s;$(i),I(n),U(o),k(r),B(null==(t=null==r?void 0:r.search)?void 0:t.suggestion),await q(s)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),f?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[f]),React.useEffect((()=>{if(Boolean(K&&(null==K?void 0:K.keyword)!==A)){const e=setTimeout((()=>{q({tabs:D,suffix_index_product:L,hidden_tags:P,display:W},!0)}),500);return()=>clearTimeout(e)}}),[A]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:f,onOpenChange:S,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==W?void 0:W.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:A,fieldRef:Y,onChange:({value:e})=>C(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:w?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:"grey-100",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:"grey-100",rounded:"md",animationDuration:"13s",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(M).length&&(null==(s=null==(t=M[F])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=M[F])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:G.suggestionKeywordListsComponent,keywords:M[F].keywords.list,isComponentJsVersion:G.isJsVersion,showPopupComponent:f,setShowPopupComponent:S}):null,b&&b.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:G.otherIndexListsComponent,name:i,items:s,isComponentJsVersion:G.isJsVersion,showPopupComponent:f,setShowPopupComponent:S})},t)}))]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==N?void 0:N.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:N.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(r=null==W?void 0:W.search)?void 0:r.show_vendor,show_sku:null==(l=null==W?void 0:W.search)?void 0:l.show_sku,show_price:null==(a=null==W?void 0:W.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:G.isJsVersion,cards:G.productCardsComponent,onAfterAddToCart:G.onAfterAddToCart,onAfterAddWishlist:G.onAfterAddWishlist,onAfterRemoveWishlist:G.onAfterRemoveWishlist,onAfterRenderProduct:G.onAfterRenderProduct,showPopupComponent:f,setShowPopupComponent:S})}):Object.keys(M).length&&(null==(c=null==(d=M[F])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=M[F])?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:A}),". Did you mean:"]}),jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:M[F].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==W?void 0:W.search)?void 0:m.show_vendor,show_sku:null==(g=null==W?void 0:W.search)?void 0:g.show_sku,show_price:null==(_=null==W?void 0:W.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:G.isJsVersion,cards:G.productCardsComponent,onAfterAddToCart:G.onAfterAddToCart,onAfterAddWishlist:G.onAfterAddWishlist,onAfterRemoveWishlist:G.onAfterRemoveWishlist,onAfterRenderProduct:G.onAfterRenderProduct,showPopupComponent:f,setShowPopupComponent:S})]}):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(M).length&&(null==(h=null==(R=M[F])?void 0:R.products)?void 0:h.active)&&(null==(v=null==(j=null==(E=M[F])?void 0:E.products)?void 0:j.list)?void 0:v.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:G.searchViewMoreResultComponent,keyword:A,isComponentJsVersion:G.isJsVersion,showPopupComponent:f,setShowPopupComponent:S})}):null]})]})})})})]})]})})},SearchIconWidgetInitSelector=()=>{let element=document.querySelector(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET);detectInitSelector(element,(()=>{var _a,_b,_c,_d;if(element){const ICON_SIZE=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ICON_SIZE),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=element.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=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);element.innerHTML="",client.createRoot(element).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",onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{suggestionKeywordList:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,otherIndexList:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,searchViewMoreResult:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null})})})}))}}))},SearchIconWidgetPopupInitSelector=()=>{let e=document.createElement("div");e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET_POPUP),document.body.appendChild(e),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchIconWidgetPopup,{})})})))},SearchResultWidget=e=>{var t,s,i,n,o,r,l,a,d,c;const{isRenderApp:u,isJsVersion:x}=React.useContext(SledgeContext),{layoutType:p="default",query:m,params:g,children:_,onAfterAddToCart:R,onAfterAddWishlist:h,onAfterRemoveWishlist:E,onAfterRenderProduct:j}=e,{keyword:v=""}=m||{},{collectionId:w}=g||{};let T=null;React.Children.map(_,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(T=t)}}));const[f,S]=React.useState(!0),[A,C]=React.useState(!0),[L,I]=React.useState(""),[N,y]=React.useState(null),[b,O]=React.useState(),[D,$]=React.useState(jsxRuntimeExports.jsx(ResultProduct,{})),[P,U]=React.useState(!0),[W,k]=React.useState([]),[M,B]=React.useState([]),[F,H]=React.useState([]),[G,V]=React.useState([]),[Y,K]=React.useState(""),[q,z]=React.useState({}),[J,Z]=React.useState([]),[X,Q]=React.useState({}),[ee,te]=React.useState([]),[se,ie]=React.useState(""),[ne,oe]=React.useState(!1),re=React.useRef(null),le=usePrevious({keyword:L}),ae=async(e,t)=>{const{filters:s,tabs:i,suffix_index_product:n,hidden_tags:o,display:r,show_out_of_stock:l}=e;let a,d={queries:("product-filter"===p?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 w&&(null==t?void 0:t.includes(Number(w)))||(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"),w&&u.push(`collections.id = '${w}'`),c&&V(a[0]),{indexUid:i,q:"default"===t?"":L,hitsPerPage:1,facets:c?a[0]:[],filter:d?u.join(" AND "):""}}))};if(a=await multiSearch(d),!a)return;const{results:c}=a;if(S(!1),U(!1),C(!1),"totalDataPerIndex"===t)H(null==i?void 0:i.map((e=>{const{index:t}=e,{totalHits:s}=(null==c?void 0:c.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetDistribution:e,facetStats:t}=(null==c?void 0:c.find((({indexUid:e})=>e.includes(n))))||{};z(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(!(null==u?void 0:u.instantSearch))return;const e=new URLSearchParams(document.location.search);I((null==e?void 0:e.get(v))||""),(async e=>{let t,s;if(U(!0),t=JSON.parse(e),!t)return;const{allowed_sorts:i,default_sort:n,filters:o,tabs:r,suffix_index_product:l,hidden_tags:a,display:d,colors:c,show_out_of_stock:u}=t;k((null==i?void 0:i.length)?i:[]),B((null==o?void 0:o.length)?o:[]),K(l),Z(a),Q(d),te(c),ie(n),oe(u),s=r.find((({index:e})=>e.includes(l))),Object.keys(s).length&&(y(s.index),O(s.name)),await ae(t,"default"),"default"===p&&await ae(t,"totalDataPerIndex")})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"")}),[u]),React.useEffect((()=>{if(Boolean(le&&(null==le?void 0:le.keyword)!==L)&&"default"===p){const e=setTimeout((()=>{ae({filters:M,tabs:F,suffix_index_product:Y,hidden_tags:J,display:X,colors:ee,show_out_of_stock:ne},"totalDataPerIndex")}),500);return()=>clearTimeout(e)}}),[L]);const de="default"===p?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:"grey-100",animationDuration:"15s"},e)))}):null,ce=(null==(t=null==X?void 0:X.filter)?void 0:t.enable_on_search)&&"horizontal"===(null==(s=null==X?void 0:X.filter)?void 0:s.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:"grey-100",animationDuration:"13s"},e)))}):null,ue=(null==(i=null==X?void 0:X.filter)?void 0:i.enable_on_search)&&"vertical"===(null==(n=null==X?void 0:X.filter)?void 0:n.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:"grey-100",rounded:"md",animationDuration:"15s"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"})]}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",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:"grey-100",rounded:"full",animationDuration:"40s"},e)))})]}):null,xe=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(o=null==X?void 0:X.filter)?void 0:o.show_total_products)&&"vertical"===(null==(r=null==X?void 0:X.filter)?void 0:r.layout)?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"21px"}}):null,jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:12,type:"large"})]}),pe=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(l=null==X?void 0:X.filter)?void 0:l.show_total_products)&&"horizontal"===(null==(a=null==X?void 0:X.filter)?void 0:a.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:"grey-100",rounded:"md",animationDuration:"13s"})}):null,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"grey-100",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:"grey-100",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:"grey-100",rounded:"lg"})})]})]});return jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-container",ref:re,children:[f?null:jsxRuntimeExports.jsx("div",{className:""+("default"===p&&(null==F?void 0:F.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===p&&(null==F?void 0:F.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:F.map((e=>{const{name:t,index:s,total:i}=e;let n=N===s;return jsxRuntimeExports.jsxs("li",{onClick:e=>((e,t,s)=>{y(e),O(t),$(e.includes(Y)?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}),f&&(null==p?void 0:p.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[de,ce,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(d=null==X?void 0:X.filter)?void 0:d.enable_on_search)&&"vertical"===(null==(c=null==X?void 0:X.filter)?void 0:c.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:ue}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[pe,xe]})]})]}):React.cloneElement(D,{isLoading:A,keyword:L,clickedTabIndexId:N,clickedTabIndexName:b,isLoadingSetting:P,allowedSorts:W,allowedFilters:M,facets:G,searchResultFacets:q,hiddenTags:J,displaySettings:X,colorSwatches:ee,defaultSort:se,showOutOfStock:ne,query:m,params:g,isJsVersion:x,productCardsComponent:T,onAfterAddToCart:R,onAfterAddWishlist:h,onAfterRemoveWishlist:E,onAfterRenderProduct:j,setIsLoading:C,setKeyword:I,filterHorizontalSkeleton:ce,filterVerticalSkeleton:ue,productGridSkeleton:xe,searchAndSelectOptionSkeleton:pe,searchResultContainerRef:re})]})},ResultProduct=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,h,E,j;const{keyword:v,clickedTabIndexId:w,isLoadingSetting:T,allowedSorts:f,allowedFilters:S,facets:A,searchResultFacets:C,hiddenTags:L,displaySettings:I,colorSwatches:N,defaultSort:y,showOutOfStock:b,query:O,params:D,isJsVersion:$,productCardsComponent:P,setKeyword:U,filterHorizontalSkeleton:W,filterVerticalSkeleton:k,productGridSkeleton:M,searchAndSelectOptionSkeleton:B,onAfterAddToCart:F,onAfterAddWishlist:H,onAfterRemoveWishlist:G,onAfterRenderProduct:V,searchResultContainerRef:Y}=e||{},{keyword:K=""}=O||{},{collectionId:q}=D||{},[z,J]=React.useState(!0),[Z,X]=React.useState(!0),[Q,ee]=React.useState(!1),[te,se]=React.useState(!1),[ie,ne]=React.useState(y||""),[oe,re]=React.useState(f&&Boolean(null==f?void 0:f.length)?null==(t=f.find((({value:e})=>e===y)))?void 0:t.label:""),[le,ae]=React.useState((null==(s=null==I?void 0:I.search)?void 0:s.limit)||10),[de,ce]=React.useState(null),[ue,xe]=React.useState({...b?{}:{"variants.inventory_quantity":"> 0"}}),[pe,me]=React.useState(!1),[ge,_e]=React.useState([]),[Re,he]=React.useState(0),[Ee,je]=React.useState(1),[ve,we]=React.useState(0),[Te,fe]=React.useState(0),[Se,Ae]=React.useState([]),[Ce,Le]=React.useState([]),[Ie,Ne]=React.useState(!1),[ye,be]=React.useState(null),Oe=usePrevious({keyword:v,clickedLimitId:le,clickedFacets:ue}),{color:De,font_size:$e,font_weight:Pe,text_transform:Ue}=(null==(i=null==I?void 0:I.filter)?void 0:i.title)||{},{color:We,font_size:ke,font_weight:Me,text_transform:Be}=(null==(n=null==I?void 0:I.filter)?void 0:n.option)||{},{text_color:Fe,border_color:He,border_radius:Ge,padding_top:Ve,padding_bottom:Ye,padding_left:Ke,padding_right:qe,background_color:ze,font_size:Je,font_weight:Ze,text_transform:Xe}=(null==(o=null==I?void 0:I.filter)?void 0:o.button)||{},Qe={...De&&{color:De},...$e&&{fontSize:$e},...Pe&&{fontWeight:Pe},...Ue&&{textTransform:Ue}},et={...We&&{color:We},...ke&&{fontSize:ke},...Me&&{fontWeight:Me},...Be&&{textTransform:Be}},tt=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const r in i){(null==A?void 0:A.length)&&!A.includes(r)&&(n[r]=i[r])}for(const r in e)(null==(t=e[r])?void 0:t.length)&&(n[r]=e[r]);const o=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==o?void 0:o.length)?`?${o}`:""}`)},st=e=>{ce(e===de?"":e)},it=()=>{Ne(!0),xe({}),me(!pe),tt({}),Ae([]),setTimeout((()=>{Ne(!1)}),10)},nt=(e,t,s=!1)=>{var i;Ne(!0);let n=[t],o=["variants.price"].includes(e);ue&&(s?n=[t]:(null==(i=ue[e])?void 0:i.includes(t))?n=ue[e].filter((e=>e!==t)):o?(ue[e],ue[e]===t?(n=[],Ae([])):n=t):n=ue[e]?[...ue[e],t]:[t]);let r={...ue,[e]:n};tt(r),xe(r),me(!pe),setTimeout((()=>{Ne(!1)}),10)},ot=async(e=!1,t=!1)=>{if(!w)return;e&&je(1),X(!0);let s,i=(e=>{const t=new URLSearchParams(document.location.search),s=Object.fromEntries(t);for(const i in s)(null==A?void 0:A.length)&&A.includes(i)&&(e[i]=s[i].split(","));return Object.keys(e).length&&xe(e),e})(ue),n=Object.entries(i).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0],n=["variants.inventory_quantity"].includes(i),o=["variants.price"].includes(i),r=["tags"].includes(i);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?o?`${i} >= ${e[1][0]} AND ${i} <= ${e[1][1]}`:r?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:r?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==L?void 0:L.length)&&n.push(`tags NOT IN [${L}]`),q&&n.push(`collections.id = '${q}'`);let o={q:v,sort:ie?[ie]:[],page:e?1:Ee,hitsPerPage:le,facets:A,filter:n.join(" AND ")};s=await search(w,o),((e,t)=>{var s;if(!e)return;const{hits:i,processingTimeMs:n,totalHits:o,totalPages:r}=e;t&&(null==v?void 0:v.length)&&searchTrigger({keyword:v,resultCount:o||0}),J(!1),X(!1),_e(i),he(n||0),we(r),fe(o||0),be(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(s=null==I?void 0:I.filter)?void 0:s.show_total_products)?jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[o," result"," ",(null==v?void 0:v.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',v,'"']})]}):null]}):null}))})(s,t)},rt=e=>{const t=new URLSearchParams(document.location.search);t.set(K,e),U&&U(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};React.useEffect((()=>{let e=Boolean(Oe&&((null==Oe?void 0:Oe.keyword)!==v||(null==Oe?void 0:Oe.clickedLimitId)!==le||(null==Oe?void 0:Oe.clickedFacets)!==ue));if(Boolean(Oe&&(null==Oe?void 0:Oe.keyword)!==v)){const e=setTimeout((()=>{ot(!0,!0)}),500);return()=>clearTimeout(e)}ot(e)}),[ie,le,pe,v,Ee,w]),React.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==I?void 0:I.filter)?void 0:e.enable_on_search)||(null==(t=null==I?void 0:I.filter)?void 0:t.hide_when_one_value)&&Te<=1)return;let s=!1;s||null==S||S.map((e=>{const{collections:t,items:i}=e;(q&&(null==t?void 0:t.includes(Number(q)))||(null==t?void 0:t.includes("all")))&&(s=!0,Le(i))}))})()}),[S,C,Te]);const lt=({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:et,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:()=>nt(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)},at=e=>{var t,s;const{value:i,label:n,display:o}=e;let r=null,l=C[i],a=null==(t=null==I?void 0:I.filter)?void 0:t.show_number_matching_product;return"slider"===o.toLowerCase()?r=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[jsxRuntimeExports.jsx(Slider,{defaultValue:[Se[0]||(null==l?void 0:l.min),Se[1]||(null==l?void 0:l.max)],min:null==l?void 0:l.min,max:null==l?void 0:l.max,step:1,setValueCommit:e=>nt(i,e),setValueChange:e=>Ae(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:Se[0]||(null==l?void 0:l.min)}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Se[1]||(null==l?void 0:l.max)})]})]}):"checkbox"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var s;return jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Checkbox,{id:`${i}_${t}`,name:i,value:e.value,label:`${e.name}${void 0!==e.total&&a?` (${e.total})`:""}`,onClick:e=>nt(i,e.currentTarget.value),defaultChecked:ue&&(null==(s=ue[i])?void 0:s.includes(e.value)),labelStyle:et})},t)}))}):"radio"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(RadioGroup,{id:i,name:i,onValueChange:e=>nt(i,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:ue&&(null==(s=ue[i])?void 0:s.length)?ue[i][0]:"",labelStyle:et})}):"select"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Select,{placeholder:`Select ${n}`,name:i,onValueChange:e=>nt(i,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:et})}):"swatch"===o.toLowerCase()&&(null==l?void 0:l.length)&&(r=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var s;let n=(null==N?void 0:N.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=>nt(i,e.currentTarget.value),defaultChecked:ue&&(null==(s=ue[i])?void 0:s.includes(e.value))})},t)}))})),r},dt=Ce.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=de===s,r=C[s],l=Boolean("slider"===n.toLowerCase()?r:null==r?void 0:r.length),a=["select"].includes(n.toLowerCase())&&(null==r?void 0:r.length),d=["sledge-instant-search__result-filter-item-list"],c=at(e);return"swatch"===n.toLowerCase()&&(null==r?void 0:r.length)&&d.push("sledge-instant-search__result-filter-item-color-swatches"),l?jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>st(s),children:[jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:Qe,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:Ie?null:c})]},t):null})),ct=Ce.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=de===s,r=C[s],l=Boolean("slider"===n.toLowerCase()?r:null==r?void 0:r.length),a=["radio","select"].includes(n.toLowerCase())&&(null==r?void 0:r.length),d=["sledge-instant-search__result-filter-item-list"],c=at(e);return"swatch"===n.toLowerCase()&&(null==r?void 0:r.length)&&d.push("sledge-instant-search__result-filter-item-color-swatches"),l?jsxRuntimeExports.jsx("div",{className:"",children:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(Button,{type:"button",onClick:()=>st(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:Ie?null:c})}),withOpenState:!1,setIsOpen:e=>ce(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 ut=[];Object.entries(ue).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=Ce.filter((({value:e})=>null==e?void 0:e.includes(i))),r=(null==o?void 0:o.length)?o[0].label:i;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?ut.push({label:r,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{ut.push({label:r,name:i,value:e})})):ut.push({label:r,name:i,value:e[1][0]})}}));const xt=jsxRuntimeExports.jsx(Pagination,{currentPage:Ee,totalPage:ve,totalResult:Te,onChange:e=>(e=>{je(e),setTimeout((()=>{scrollToElement(Y.current,50)}),200)})(e)});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(r=null==I?void 0:I.filter)?void 0:r.enable_on_search)&&"horizontal"===(null==(l=null==I?void 0:I.filter)?void 0:l.layout)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:z?W:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:T?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:W}):ct.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:ct}),Boolean((null==ut?void 0:ut.length)&&(null==(a=null==I?void 0:I.filter)?void 0:a.show_refine_by_block))?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Boolean(ut.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:it,children:"Clear All"}),ut.map(((e,t)=>{const{label:s,name:i,value:n}=e;return lt({label:s,name:i,value:n,index:t})}))]})}):null]})})}):null,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(d=null==I?void 0:I.filter)?void 0:d.layout,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(c=null==I?void 0:I.filter)?void 0:c.enable_on_search)&&"vertical"===(null==(u=null==I?void 0:I.filter)?void 0:u.layout)?z?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:k}):dt.every((e=>!e))?null:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:T?k:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Boolean((null==ut?void 0:ut.length)&&(null==(x=null==I?void 0:I.filter)?void 0:x.show_refine_by_block))?Boolean(ut.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:it,children:"Clear All"})]}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:ut.map(((e,t)=>{const{label:s,name:i,value:n}=e;return lt({label:s,name:i,value:n,index:t})}))})]}):null,dt]})}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[z?B:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(p=null==I?void 0:I.filter)?void 0:p.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:ye}),jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:v,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:"}),f&&Boolean(null==f?void 0:f.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:f.map((e=>{const{label:t,value:s}=e;return{label:t,value:s}})),value:ie,onChange:({label:e,value:t})=>((e,t)=>{ee(!1),re(e),ne(t)})(e,t)})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(m=null==I?void 0:I.search)?void 0:m.allowed_limit)&&Boolean(null==(_=null==(g=null==I?void 0:I.search)?void 0:g.allowed_limit)?void 0:_.length)&&jsxRuntimeExports.jsx(SelectField,{align:"end",options:I.search.allowed_limit.map((e=>({label:e,value:e}))),value:le,onChange:({value:e})=>(e=>{se(!1),ae(e)})(e)})]})]})]}),Z?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[M,(null==ge?void 0:ge.length)?xt:null]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["vertical"===(null==(R=null==I?void 0:I.filter)?void 0:R.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:ye}),(null==ge?void 0:ge.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"large",data:ge.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(h=null==I?void 0:I.search)?void 0:h.show_vendor,show_sku:null==(E=null==I?void 0:I.search)?void 0:E.show_sku,show_price:null==(j=null==I?void 0:I.search)?void 0:j.show_price},isComponentJsVersion:$,cards:P,showOptionOutOfStock:!0,onAfterAddToCart:F,onAfterAddWishlist:H,onAfterRemoveWishlist:G,onAfterRenderProduct:V}),xt]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})]})]})})]})},ResultCategory=e=>{var t,s,i,n;const{keyword:o,clickedTabIndexId:r,clickedTabIndexName:l,setKeyword:a,searchResultContainerRef:d}=e||{},[c,u]=React.useState(!0),[x,p]=React.useState(!0),[m,g]=React.useState(""),[_,R]=React.useState([]),[h,E]=React.useState(0),[j,v]=React.useState(1),[w,T]=React.useState(0),[f,S]=React.useState(0),[A,C]=React.useState(null),L=usePrevious({keyword:o}),I=async()=>{if(!r)return;let e;p(!0);let t={q:o,sort:m?[m]:[],page:j,hitsPerPage:12};e=await search(r,t),(e=>{if(!e)return;const{hits:t,processingTimeMs:s,totalHits:i,totalPages:n}=e;u(!1),p(!1),R(t),E(s||0),T(n),S(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(L&&(null==L?void 0:L.keyword)!==o)){const e=setTimeout((()=>{I()}),500);return()=>clearTimeout(e)}I()}),[m,o,j,r]);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 ${l?l.toLowerCase():""}...`,value:o,onChange:({value:e})=>a&&a(e),onResetField:()=>a&&a(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),y=jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"18s"})}),b=(null==(t=String(r))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(SkeletonLoading.CollectionGrid,{count:3}):(null==(s=String(r))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(SkeletonLoading.PageGrid,{count:12}):(null==(i=String(r))?void 0:i.includes("blog"))||(null==(n=String(r))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(SkeletonLoading.BlogGrid,{count:12}):null,O=()=>jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[N,y,b]}),D=()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[N,y,b]}),$=e=>{var t,s,i,n;return(null==(t=String(r))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(CollectionGrid,{...e}):(null==(s=String(r))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(PageGrid,{...e}):(null==(i=String(r))?void 0:i.includes("blog"))||(null==(n=String(r))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(BlogGrid,{...e}):null};return jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:c?jsxRuntimeExports.jsx(O,{}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:x?jsxRuntimeExports.jsx(D,{}):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($,{data:_.map((e=>{const{id:t,title:s,url:i}=e;return{id:t,title:s,description:`${s}${l?` ${l.toLowerCase()}`:""}`,url:i,image:""}}))}),jsxRuntimeExports.jsx(Pagination,{currentPage:j,totalPage:w,totalResult:f,onChange:e=>(e=>{v(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=document.querySelector(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_RESULT_WIDGET);detectInitSelector(element,(()=>{var _a;if(element){const QUERY_KEYWORD=element.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.QUERY_KEYWORD),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD);element.innerHTML="",client.createRoot(element).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||""},onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null})})})}))}}))},SearchWidget=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,h,E,j,v;const{isRenderApp:w,isJsVersion:T}=React.useContext(SledgeContext),{width:f="400px",children:S,onAfterAddToCart:A,onAfterAddWishlist:C,onAfterRemoveWishlist:L,onAfterRenderProduct:I}=e;let N=null,y=null,b=null,O=null;React.Children.map(S,(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)&&(N=t),s&&isFunction(s)&&(y=s),i&&isFunction(i)&&(b=i),n&&isFunction(n)&&(O=n)}}));const[D,$]=React.useState(!0),[P,U]=React.useState(""),[W,k]=React.useState(""),[M,B]=React.useState([]),[F,H]=React.useState([]),[G,V]=React.useState([]),[Y,K]=React.useState([]),[q,z]=React.useState({}),[J,Z]=React.useState({}),[X,Q]=React.useState(""),ee=usePrevious({keyword:P}),te=async(e,t=!1)=>{var s,i,n,o,r,l,a,d,c,u,x;if(!P.length)return;$(!0);const{tabs:p,suffix_index_product:m,hidden_tags:g,display:_}=e,R=(null==(s=null==_?void 0:_.search)?void 0:s.suggestion)||{};let h,E={queries:p.map((e=>{var t;const{index:s}=e;let i=s.includes(m),n=[];return(null==g?void 0:g.length)&&n.push(`tags NOT IN [${g}]`),(null==(t=null==_?void 0:_.filter)?void 0:t.show_out_of_stock)||n.push("variants.inventory_quantity > 0"),{indexUid:s,q:P,hitsPerPage:i?6:4,filter:i?n.join(" AND "):""}}))};if(h=await multiSearch(E),!h)return;const{results:j}=h;let v=null==j?void 0:j.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));t&&(null==P?void 0:P.length)&&searchTrigger({keyword:P,resultCount:(null==(i=v[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||""}})))||[],T=(null==v?void 0:v.length)?null==(o=v[0])?void 0:o.hits:[],f=P.length?(null==T?void 0:T.length)?"":"no_result":"zero_character",S=Boolean(!P.length&&Object.keys(R).length&&(null==(l=null==(r=R[f])?void 0:r.products)?void 0:l.active)&&(null==(c=null==(d=null==(a=R[f])?void 0:a.products)?void 0:d.list)?void 0:c.length));B(S?null==(x=null==(u=R[f])?void 0:u.products)?void 0:x.list:T),H(w),Q(f),$(!1)};React.useEffect((()=>{(null==w?void 0:w.instantSearch)&&(async e=>{var t;if(!P.length)return;let s;if(s=JSON.parse(e),!s)return;const{tabs:i,suffix_index_product:n,hidden_tags:o,display:r}=s;V(i),k(n),K(o),z(r),Z(null==(t=null==r?void 0:r.search)?void 0:t.suggestion),await te(s)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"")}),[P]),React.useEffect((()=>{if(Boolean(ee&&(null==ee?void 0:ee.keyword)!==P)){const e=setTimeout((()=>{te({tabs:G,suffix_index_product:W,hidden_tags:Y,display:q},!0)}),500);return()=>clearTimeout(e)}}),[P]);const se={maxWidth:f};return jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:se,children:[jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:P,onChange:({value:e})=>U(e),onResetField:()=>U(""),withClearField:!0}),jsxRuntimeExports.jsx(motion.div,{initial:"hidden",animate:P.length?"visible":"hidden",variants:VISIBLE_ANIMATION,className:"sledge-instant-search__widget-search-form-result",children:D?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:"grey-100",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:"grey-100",rounded:"md",animationDuration:"13s",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:D,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(J).length&&(null==(s=null==(t=J[X])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=J[X])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:y,keywords:J[X].keywords.list,isComponentJsVersion:T}):null,F.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:b,name:i,items:s,isComponentJsVersion:T})},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==M?void 0:M.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:M.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(r=null==q?void 0:q.search)?void 0:r.show_vendor,show_sku:null==(l=null==q?void 0:q.search)?void 0:l.show_sku,show_price:null==(a=null==q?void 0:q.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:T,cards:N,onAfterAddToCart:A,onAfterAddWishlist:C,onAfterRemoveWishlist:L,onAfterRenderProduct:I})}):Object.keys(J).length&&(null==(c=null==(d=J[X])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=J[X])?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:P}),". ",jsxRuntimeExports.jsx("span",{children:"Did you mean:"})]}),jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:J[X].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==q?void 0:q.search)?void 0:m.show_vendor,show_sku:null==(g=null==q?void 0:q.search)?void 0:g.show_sku,show_price:null==(_=null==q?void 0:q.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:T,cards:N,onAfterAddToCart:A,onAfterAddWishlist:C,onAfterRemoveWishlist:L,onAfterRenderProduct:I})]}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product-disabled",children:"No product were found"})]})]}),(null==M?void 0:M.length)||Object.keys(J).length&&(null==(h=null==(R=J[X])?void 0:R.products)?void 0:h.active)&&(null==(v=null==(j=null==(E=J[X])?void 0:E.products)?void 0:j.list)?void 0:v.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:O,keyword:P,isComponentJsVersion:T})}):null]})})})]})},SearchWidgetInitSelector=()=>{let element=document.querySelector(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_WIDGET);detectInitSelector(element,(()=>{var _a,_b,_c,_d;if(element){const WIDTH_ELEMENT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.WIDTH_ELEMENT),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=element.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=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);element.innerHTML="",client.createRoot(element).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||"",onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,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:!1}}},sledgeAnonymId:"",isJsVersion:!1}),CustomComponents=e=>null,BadgeFloatingFull=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,position:a="left",dataSettings:d,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},[x,p]=React.useState(!1);React.useEffect((()=>{p(s&&u)}),[s]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating sledge-wishlist__badge-floating-${a}`,children:jsxRuntimeExports.jsxs("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:[jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-floating-text",children:"My Wishlist"}),jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[jsxRuntimeExports.jsx(HeartIcon,{width:18,height:18,type:"fill",color:"#000000"}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(r?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${r?"99+":o}`||0})]})]})})},BadgeFloatingIcon=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,position:a="bottom-right",dataSettings:d,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},[x,p]=React.useState(!1);React.useEffect((()=>{p(s&&u)}),[s]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating-icon sledge-wishlist__badge-floating-${a}`,children:jsxRuntimeExports.jsx("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[jsxRuntimeExports.jsx(HeartIcon,{width:27.01,height:25.73,type:"outline",color:"#000000"}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(r?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${r?"99+":o}`||0})]})})})},BadgeHeaderMenu=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,dataSettings:a,useProxyUrl:d}=e||{},{is_required_login:c}=(null==(t=null==a?void 0:a.display)?void 0:t.global)||{},u="#000000",[x,p]=React.useState(u),[m,g]=React.useState(!1);React.useEffect((()=>{g(s&&c)}),[s]);return jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge",onClick:e=>{m&&(e.preventDefault(),e.stopPropagation()),m?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):d&&(window.location.href=l||"/")},onMouseEnter:()=>p("#F85538"),onMouseLeave:()=>p(u),children:[jsxRuntimeExports.jsx(HeartIcon,{width:20,height:20,type:"outline",color:x}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-header-menu "+(r?"sledge-wishlist__badge-fit-content":""),children:n||m?0:`${r?"99+":o}`||0})]})},getWishlist=async(e,t)=>{const{page:s,limit:i,sort:n,keyword:o,shareId:r}=e||{};let l=t||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),a="?"+new URLSearchParams({page:s||"",limit:i||"",sort:n||"",keyword:o||"",share_id:r||""}).toString();var d=new Headers;d.append("Authorization",`Bearer ${l}`);var c={method:"GET",headers:d,redirect:"follow"};return await fetch(`${API_URL}/wishlist${a}`,c).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addWishlist=async e=>{const{productId:t,productVariantId:s,productName:i,productVendor:n,productSku:o,productVariantName:r,productLink:l,productImage:a,productCurrency:d,productPrice:c}=e;let u=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var x=new Headers;x.append("Authorization",`Bearer ${u}`),x.append("Content-Type","application/json");var p={method:"POST",headers:x,body:JSON.stringify({product:{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,vendor:n,sku:o,variant_name:r,url:l,image_url:a,currency:d,price:c}}),redirect:"follow"};return await fetch(`${API_URL}/wishlist`,p).then((e=>e.json())).then((e=>e)).catch((()=>{}))},bulkAddWishlist=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`),s.append("Content-Type","application/json");let i=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:r,productCurrency:l,productPrice:a}=e;return{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,variant_name:n,url:o,image_url:r,currency:l,price:a}}));var n={method:"POST",headers:s,body:JSON.stringify({products:i}),redirect:"follow"};return await fetch(`${API_URL}/wishlist/bulk`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getWishlistInfo=async e=>{let t=e||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`);var i={method:"GET",headers:s,redirect:"follow"};return await fetch(`${API_URL}/wishlist/info`,i).then((e=>e.json())).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();var r=new Headers;r.append("Authorization",`Bearer ${n}`);var l={method:"GET",headers:r,redirect:"follow"};return await fetch(`${API_URL}/wishlist/check/${s}${o}`,l).then((e=>e.json())).then((e=>Boolean(e.data))).catch((()=>{}))},clearWishlist=async()=>{let e=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var t=new Headers;t.append("Authorization",`Bearer ${e}`);var s={method:"DELETE",headers:t,redirect:"follow"};return await fetch(`${API_URL}/wishlist/clear`,s).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addToCartTrigger=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${s}`),i.append("Content-Type","application/json");var n={method:"POST",headers:i,body:JSON.stringify({product:{id:sanitizeDataId(t)}}),redirect:"follow"};return await fetch(`${API_URL}/wishlist/cart`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},BadgeRoot=e=>{const{children:t,useProxyUrl:s=!1,data:i}=e,{isRenderApp:n,triggerRenderMultipleComponent:o}=React.useContext(SledgeContext),[r,l]=React.useState(0),[a,d]=React.useState(!0),[c,u]=React.useState(!0),[x,p]=React.useState(!1),[m,g]=React.useState(""),[_,R]=React.useState({}),h=async e=>{var t,s,n;let o,r,a,c=!1;i&&e?(o={data:i},c=!0):(o=await getWishlistInfo(),c=200===(null==(t=null==o?void 0:o.status)?void 0:t.code)||!1),r=(null==(s=null==o?void 0:o.data)?void 0:s.total_data)?o.data.total_data:0,a=(null==(n=null==o?void 0:o.data)?void 0:n.proxy_url)||"",c&&(l(r),p(r>99),g(a),d(!1),u(!1))};return React.useEffect((()=>{(null==n?void 0:n.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate=()=>{h()}),(async e=>{let t;t=JSON.parse(e),t&&(R(t),await h(!0))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[n,o]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{isFirstLoading:a,isLoading:c,totalWishlist:r,isMaximizeTotalWishlist:x,proxyUrl:m,dataSettings:_,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=()=>{const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||"");if(!e)return;const{floating_button_type:t}=(null==e?void 0:e.launch_point)||{},s=String(t).includes("bottom");if("none"!==t)if(s){let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_ICON),document.body.appendChild(e),e){e.innerHTML="";const s=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(s&&"true"===s),children:jsxRuntimeExports.jsx(Badge.FloatingIcon,{position:t})})})}))}}else{let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_FULL),document.body.appendChild(e),e){e.innerHTML="";const s=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(s&&"true"===s),children:jsxRuntimeExports.jsx(Badge.FloatingFull,{position:t})})})}))}}else{let e=document.querySelector(SELECTOR.WISHLIST.ELEMENT_BADGE);const t=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);detectInitSelector(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(Badge.Root,{useProxyUrl:Boolean(t&&"true"===t),children:jsxRuntimeExports.jsx(Badge.HeaderMenu,{})})})})))}))}},ButtonDetail=e=>{var t,s,i,n,o;const{params:r,onAfterAddWishlist:l,onAfterRemoveWishlist:a}=e,{productId:d,productVariantId:c}=r||{},{isRenderApp:u,triggerRenderMultipleComponent:x,sledgeAnonymId:p}=React.useContext(SledgeContext),[m,g]=React.useState(!0),[_,R]=React.useState(!0),[h,E]=React.useState(!1),[j,v]=React.useState({}),[w,T]=React.useState(!1),[f,S]=React.useState(!1),{is_required_login:A}=(null==(t=null==j?void 0:j.display)?void 0:t.global)||{},{type:C,icon:L,click_again_action:I,text_color:N,border_color:y,border_radius:b,padding_top:O,padding_bottom:D,padding_left:$,padding_right:P,background_color:U,font_size:W,font_weight:k,text_transform:M}=(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:H,after_adding_wishlist:G,remove_from_wishlist:V}=(null==(n=null==j?void 0:j.languages)?void 0:n.button_detail)||{},{title_added_to_wishlist:Y,text_added_to_wishlist:K,title_removed_to_wishlist:q,text_removed_to_wishlist:z}=(null==(o=null==j?void 0:j.languages)?void 0:o.notification)||{},J={...N&&{color:N},...y&&{borderColor:y},...b&&{borderRadius:b},...O&&{paddingTop:O},...D&&{paddingBottom:D},...$&&{paddingLeft:$},...P&&{paddingRight:P},...U&&{backgroundColor:U},...W&&{fontSize:W},...k&&{fontWeight:k},...M&&{textTransform:M}},Z=async()=>{let e;e=await checkWishlist(d,c),E(e)},X=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"}));T(!0),E(!h);let u=await addWishlist(r);200===(null==(t=null==u?void 0:u.status)?void 0:t.code)?(T(!1),"undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((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))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistTriggerUpdate&&window.sledgeWishlistTriggerUpdate()),Z(),h?a&&a("success"):l&&l("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&B&&window.sledgeToastNotification({title:h?q:Y,message:h?z:K,location:F,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(h?a&&a("failed"):l&&l("failed"),T(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&B&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:F,type:"failed"}))};React.useEffect((()=>{(null==u?void 0:u.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistButtonDetailUpdate=()=>{Z()}),(async e=>{let t;R(!0),t=JSON.parse(e),t&&(v(t),R(!1),g(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[u]),React.useEffect((()=>{S(p&&A)}),[p]),React.useEffect((()=>{Z()}),[c]);const Q=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[C&&String(C).toLowerCase().includes("icon")&&(null==L?void 0:L.length)?jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail-icon",dangerouslySetInnerHTML:{__html:L},style:{fill:N}}):null,f?H:C&&String(C).toLowerCase().includes("text")?w?h?"Adding...":"Removing...":h&&!I?G:h?V:H:null]});return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-detail-wrapper",children:m?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"44px",rounded:"md",color:"grey-100"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:C&&String(C).toLowerCase().includes("button")?jsxRuntimeExports.jsx(Button,{type:"button",fullWidth:!0,style:J,...w||h&&!I?{disabled:!0}:{onClick:e=>X(e)},children:Q}):jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail",style:J,...w||h&&!I?{disabled:!0}:{onClick:e=>X(e)},children:Q})})})},ButtonDetailInitSelector=()=>{let element=document.querySelector(SELECTOR.WISHLIST.ELEMENT_BUTTON_DETAIL);detectInitSelector(element,(()=>{if(element){const PRODUCT_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),PRODUCT_NAME=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_NAME),PRODUCT_VENDOR=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VENDOR),PRODUCT_SKU=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_SKU),PRODUCT_VARIANT_NAME=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_NAME),PRODUCT_LINK=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_LINK),PRODUCT_IMAGE=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_IMAGE),PRODUCT_CURRENCY=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_CURRENCY),PRODUCT_PRICE=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_PRICE),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST);element.innerHTML="",client.createRoot(element).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=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})}})})}))}}))},Trigger=e=>{var t,s,i;const{params:n,forceActive:o=!1,hidden:r=!1,onAfterAddWishlist:l,onAfterRemoveWishlist:a,wishlistChecked:d}=e,{productId:c,productVariantId:u}=n||{},{isRenderApp:x,triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),g="#767676",_="outline",R="#F85538",h="fill",[E,j]=React.useState(g),[v,w]=React.useState(_),[T,f]=React.useState(!1),[S,A]=React.useState(!0),[C,L]=React.useState({}),[I,N]=React.useState({onAfterAddWishlist:l,onAfterRemoveWishlist:a}),[y,b]=React.useState(!1),{is_required_login:O}=(null==(t=null==C?void 0:C.display)?void 0:t.global)||{},{show:D,location:$}=(null==(s=null==C?void 0:C.display)?void 0:s.notification)||{},{title_added_to_wishlist:P,text_added_to_wishlist:U,title_removed_to_wishlist:W,text_removed_to_wishlist:k}=(null==(i=null==C?void 0:C.languages)?void 0:i.notification)||{},M=async e=>{let t;t="boolean"==typeof d&&e?d:await checkWishlist(c,u),f(o||t)};React.useEffect((()=>{(null==x?void 0:x.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{M(!0)}),(async e=>{let t;A(!0),t=JSON.parse(e),t&&(L(t),A(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[x]),React.useEffect((()=>{b(m&&O)}),[m]),React.useEffect((()=>{(null==x?void 0:x.wishlist)&&M(!0)}),[x,u]);const B=(T||o)&&!y;return React.useEffect((()=>{B?(j(R),w(h)):(j(g),w(_))}),[T]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!S&&!r&&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,r,l;if(e.preventDefault(),e.stopPropagation(),y)return void("undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}));f(!T);let a=await addWishlist(n);const{status:c,data:u}=a||{},{code:x}=c||{};200===x?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(s=null==(t=null==p?void 0:p.wishlist)?void 0:t.badge)?void 0:s.trigger)&&"boolean"!=typeof d&&(null==(l=null==(i=null==p?void 0:p.wishlist)?void 0:i.badge)||l.trigger(!(null==(r=null==(o=null==p?void 0:p.wishlist)?void 0:o.badge)?void 0:r.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),M(),T?I.onAfterRemoveWishlist&&I.onAfterRemoveWishlist("success"):I.onAfterAddWishlist&&I.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&D&&window.sledgeToastNotification({title:T?W:P,message:T?k:U,location:$,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(T?I.onAfterRemoveWishlist&&I.onAfterRemoveWishlist("failed"):I.onAfterAddWishlist&&I.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&D&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:$,type:"failed",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})}))})(e),onMouseEnter:()=>{B||(j(R),w(h))},onMouseLeave:()=>{B||(j(g),w(_))},children:jsxRuntimeExports.jsx(HeartIcon,{width:16.67,height:15.83,type:v,color:E})})})})},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,r,l,a;const{sledgeAnonymId:d}=React.useContext(SledgeContext),{is_required_login:c}=(null==(n=null==s?void 0:s.display)?void 0:n.global)||{},{text_color:u,border_color:x,border_radius:p,padding_top:m,padding_bottom:g,padding_left:_,padding_right:R,background_color:h,font_size:E,font_weight:j,text_transform:v}=(null==(r=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:r.button_clear_all)||{},{title_confirm_clear_all_wishlist:w,text_confirm_clear_all_wishlist:T,button_submit_confirm_clear_all_wishlist:f,button_cancel_confirm_clear_all_wishlist:S}=(null==(l=null==s?void 0:s.languages)?void 0:l.popup)||{},{button_clear_all:A}=(null==(a=null==s?void 0:s.languages)?void 0:a.widget)||{},[C,L]=React.useState(!1),I={...u&&{color:u},...x&&{borderColor:x},...p&&{borderRadius:p},...m&&{paddingTop:m},...g&&{paddingBottom:g},..._&&{paddingLeft:_},...R&&{paddingRight:R},...h&&{backgroundColor:h},...E&&{fontSize:E},...j&&{fontWeight:j},...v&&{textTransform:v}};React.useEffect((()=>{L(d&&c)}),[d]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!C&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!t&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"grey-100",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:w,message:T,textSubmit:f,textCancel:S,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:I,children:e||(A||"Clear Wishlist")})})})})})},WidgetHeaderShareTrigger=({wishlistData:e,buttonText:t,showShareTrigger:s,shareLink:i,shareId:n,dataSettings:o,isFirstLoading:r})=>{var l,a,d,c,u,x;const{triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{is_required_login:g}=(null==(l=null==o?void 0:o.display)?void 0:l.global)||{},{text_color:_,border_color:R,border_radius:h,padding_top:E,padding_bottom:j,padding_left:v,padding_right:w,background_color:T,font_size:f,font_weight:S,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:L}=(null==(u=null==o?void 0:o.languages)?void 0:u.widget)||{},{title_added_all_to_wishlist:I,text_added_all_to_wishlist:N}=(null==(x=null==o?void 0:o.languages)?void 0:x.notification)||{},[y,b]=React.useState(!1),O={..._&&{color:_},...R&&{borderColor:R},...h&&{borderRadius:h},...E&&{paddingTop:E},...j&&{paddingBottom:j},...v&&{paddingLeft:v},...w&&{paddingRight:w},...T&&{backgroundColor:T},...f&&{fontSize:f},...S&&{fontWeight:S},...A&&{textTransform:A}},[D,$]=React.useState(!1);let P='<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,r,l;$(!0);let a=e.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:r,currency:l,price:a}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:r,productCurrency:l,productPrice:a}})),d=await bulkAddWishlist(a);200===(null==(t=null==d?void 0:d.status)?void 0:t.code)?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(i=null==(s=null==p?void 0:p.wishlist)?void 0:s.badge)?void 0:i.trigger)&&(null==(l=null==(n=null==p?void 0:p.wishlist)?void 0:n.badge)||l.trigger(!(null==(r=null==(o=null==p?void 0:p.wishlist)?void 0:o.badge)?void 0:r.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:I,message:N,textCancel:"Cancel"})),$(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return React.useEffect((()=>{b(m&&g)}),[m]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!y&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:s&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:r?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:jsxRuntimeExports.jsx(Button,{type:"button",style:O,...n&&!e.length||D?{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 ${P}\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=P)}),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}),D?"Adding...":"Add to your wishlist"]}):t||(L||"Share Wishlist")})})})})})},WidgetHeaderSearchForm=({setIsLoading:e,setKeyword:t,keyword:s,placeholder:i,dataSettings:n})=>{var o,r;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},{search_form_placeholder:d}=(null==(r=null==n?void 0:n.languages)?void 0:r.widget)||{},[c,u]=React.useState(!1),x=React.useRef(null);return React.useEffect((()=>{u(l&&a)}),[l]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!c&&jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:i||(d||"Search product..."),value:s,fieldRef:x,onChange:({value:e})=>(e=>{t&&t(e)})(e),onResetField:()=>{var s;e&&e(!0),t&&t(""),null==(s=null==x?void 0:x.current)||s.focus()},className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-search-form",withClearField:!0})})},WidgetHeaderTitle=({text:e,dataSettings:t})=>{var s,i,n;const{color:o,font_size:r,font_weight:l,text_transform:a}=(null==(i=null==(s=null==t?void 0:t.display)?void 0:s.widget)?void 0:i.header_title)||{},{header_title:d}=(null==(n=null==t?void 0:t.languages)?void 0:n.widget)||{},c={...o&&{color:o},...r&&{fontSize:r},...l&&{fontWeight:l},...a&&{textTransform:a}};return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx("h1",{style:c,children:e||(d||"My Wishlist")})})},WidgetHeaderLimit=({options:e,defaultLimitOptions:t,selectedLimit:s,setSelectedLimit:i,setIsRefreshWidgetList:n,dataSettings:o})=>{var r;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(r=null==o?void 0:o.display)?void 0:r.global)||{},[d,c]=React.useState(!1);let u=e||t;return React.useEffect((()=>{c(l&&a)}),[l]),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,r;const{sledgeAnonymId:l}=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(l&&a)}),[l]),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==(r=e[0])?void 0:r.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:"grey-100",rounded:"md"}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"440px",height:"46px",color:"grey-100",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"grey-100",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"})]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"26px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"})]})]}):React.Children.count(t.children)&&React.Children.map(t.children,(e=>React.cloneElement(e,{...t})))});WidgetHeader.Title=WidgetHeaderTitle,WidgetHeader.SearchForm=WidgetHeaderSearchForm,WidgetHeader.ShareTrigger=WidgetHeaderShareTrigger,WidgetHeader.ClearTrigger=WidgetHeaderClearTrigger,WidgetHeader.Sort=WidgetHeaderSort,WidgetHeader.Limit=WidgetHeaderLimit;const defaultGridType="large",WidgetList=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isLoading:i,wishlistData:n,dataSettings:o,gridType:r=defaultGridType}=e||{},{is_required_login:l}=(null==(t=null==o?void 0:o.display)?void 0:t.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(s&&l)}),[s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:8,type:r}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-wrapper",children:!(null==n?void 0:n.length)||a?jsxRuntimeExports.jsx(WidgetListEmpty,{...e,isRequiredLogin:a}):jsxRuntimeExports.jsx(ProductWrapper,{...e})})})},WidgetListEmpty=e=>{var t;const{onSearch:s,keyword:i,dataSettings:n,isRequiredLogin:o}=e||{},{title_no_result:r,text_no_result:l}=(null==(t=null==n?void 0:n.languages)?void 0:t.widget)||{},[a,d]=React.useState(""),[c,u]=React.useState(""),[x,p]=React.useState(!1),[m,g]=React.useState(""),[_,R]=React.useState("");return React.useEffect((()=>{o?(d("Login required!"),u("Please login to save your wishlist across devices."),p(!0),g("Login"),R("/account/login")):s||(d(i?"No products found":r),u(i?"Your search did not match any products. <br/> Please try again":l),p(!i),g("Continue Shopping"),R("/"))}),[s,n]),jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-product-empty",children:[jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-empty-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,r,l,a;const{isJsVersion:d}=React.useContext(SledgeContext),{wishlistData:c,currentPage:u,setCurrentPage:x,totalPage:p,shareId:m,dataSettings:g,gridType:_=defaultGridType,productCardsComponent:R,onAfterAddToCart:h,onAfterAddWishlist:E,onAfterRemoveWishlist:j,onAfterRenderProduct:v,dataReviews:w}=e||{},{show_add_to_cart:T,redirect_add_to_cart:f}=(null==(t=null==g?void 0:g.display)?void 0:t.widget)||{},{text_color:S,border_color:A,border_radius:C,padding_top:L,padding_bottom:I,padding_left:N,padding_right:y,background_color:b,font_size:O,font_weight:D,text_transform:$}=(null==(i=null==(s=null==g?void 0:g.display)?void 0:s.widget)?void 0:i.button_add_to_cart)||{},{color:P,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:B,font_weight:F,text_transform:H}=(null==(l=null==(r=null==g?void 0:g.display)?void 0:r.widget)?void 0:l.product_name)||{},{button_add_to_cart:G}=(null==(a=null==g?void 0:g.languages)?void 0:a.widget)||{},V={...S&&{color:S},...A&&{borderColor:A},...C&&{borderRadius:C},...L&&{paddingTop:L},...I&&{paddingBottom:I},...N&&{paddingLeft:N},...y&&{paddingRight:y},...b&&{backgroundColor:b},...O&&{fontSize:O},...D&&{fontWeight:D},...$&&{textTransform:$}},Y={...P&&{color:P},...U&&{fontSize:U},...W&&{fontWeight:W},...k&&{textTransform:k}},K={...M&&{color:M},...B&&{fontSize:B},...F&&{fontWeight:F},...H&&{textTransform:H}};let q=u||0,z=p||0;const[J,Z]=React.useState(!1),[X,Q]=React.useState(!1);return React.useEffect((()=>{Q(!(z===q&&!J)&&z>=q)}),[J]),React.useEffect((()=>{Z(!1)}),[c]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==c?void 0:c.length)?jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"wishlist",type:_,data:c.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:r,currency:l,price:a,vendor:d,sku:c}=(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:r},url:o,vendor:d,currency:l},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:T,redirect_add_to_cart:f,language_button_add_to_cart:G,display_product_name_style:K,display_price_style:Y,display_button_add_to_cart_style:V},showOptionOutOfStock:!1,triggerPropAdditional:{forceActive:!0,...m&&{hidden:!0}},isComponentJsVersion:d,cards:R,onAfterAddToCart:h,onAfterAddWishlist:E,onAfterRemoveWishlist:j,onAfterRenderProduct:v,dataReviews:w}):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=>{const{children:t,query:s,params:i,customRoutePage:n,onAfterAddToCart:o,onAfterAddWishlist:r,onAfterRemoveWishlist:l,onAfterRenderProduct:a,data:d,dataInfo:c,dataReviews:u}=e,{shareId:x="share"}=s||{},{isRenderApp:p,triggerRenderMultipleComponent:m,sledgeAnonymId:g,isJsVersion:_}=React.useContext(SledgeContext),[R,h]=React.useState(!0),[E,j]=React.useState(!0),[v,w]=React.useState([]),[T,f]=React.useState([]),[S,A]=React.useState(!1),[C,L]=React.useState(""),[I,N]=React.useState(""),[y,b]=React.useState(""),[O,D]=React.useState(1),[$,P]=React.useState(0),[U,W]=React.useState(!1),[k,M]=React.useState(!1),[B,F]=React.useState(""),[H,G]=React.useState(null),[V,Y]=React.useState(""),[K,q]=React.useState({}),[z,J]=React.useState(!1),Z=usePrevious({keyword:y,currentPage:O}),X=DEFAULT_LIMIT_VALUE,Q=async(e=!1)=>{var t,s,n,o;const r=new URLSearchParams(document.location.search),l=(null==i?void 0:i.shareId)?i.shareId:(null==r?void 0:r.get(x))||"";let a;j(!e),e||(D(1),w([]));let c,u,p=!1,m=0,g={page:e?O:1,limit:I||X[0],sort:C,keyword:y,shareId:l};a=!d||1!==O||I||C||y?await getWishlist(g):d,p=200===(null==(t=null==a?void 0:a.status)?void 0:t.code)||!1,c=(null==(s=a.data)?void 0:s.length)?t=>(null==v?void 0:v.length)&&e?[...t,...a.data]:a.data:[],u=(null==(n=a.sorts)?void 0:n.length)?a.sorts:[],m=(null==(o=null==a?void 0:a.page)?void 0:o.total_page)||1,p&&(w(c),f(u),P(m),j(!1),A(!1))};React.useEffect((()=>{if(!(null==p?void 0:p.wishlist))return;let e=Boolean(Z&&(null==Z?void 0:Z.currentPage)!==O);if(Z&&(null==Z?void 0:Z.keyword)!==y){W(!0);const e=setTimeout((()=>{W(!1),Q()}),500);return()=>clearTimeout(e)}Q(!S&&e)}),[p,y,O,S]),React.useEffect((()=>{if(!(null==p?void 0:p.wishlist))return;const e=new URLSearchParams(document.location.search);G((null==i?void 0:i.shareId)?i.shareId:(null==e?void 0:e.get(x))||""),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate=()=>{Q()},window.sledgeWishlistWidgetClearList=()=>{(async()=>{var e,t,s,i,n,o,r;let l;j(!0);let a=!1;l=await clearWishlist(),a=200===(null==(e=null==l?void 0:l.status)?void 0:e.code),a?(await Q(),"undefined"!=typeof window&&window.sledgeWishlistBadgeUpdate&&((null==(s=null==(t=null==m?void 0:m.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(r=null==(i=null==m?void 0:m.wishlist)?void 0:i.badge)||r.trigger(!(null==(o=null==(n=null==m?void 0:m.wishlist)?void 0:n.badge)?void 0:o.value))),window.sledgeWishlistBadgeUpdate())):"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed clear all wishlist",type:"failed"})})()}),(async()=>{var e,t,s,i;let o;M(!1);let r,l,a,d=!1;c?(o={data:c},d=!0):(o=await getWishlistInfo(),d=200===(null==(e=null==o?void 0:o.status)?void 0:e.code)||!1),r=(null==(t=null==o?void 0:o.data)?void 0:t.proxy_url)||"",a=(null==(s=null==o?void 0:o.data)?void 0:s.share_id)||"",l=n?`${n}?${x}=${a}`:null==(i=null==o?void 0:o.data)?void 0:i.share_link,d&&(Y(r),F(window.location.origin+l),M(!0))})(),(async e=>{let t;t=JSON.parse(e),t&&q(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""),h(!1)}),[p]),React.useEffect((()=>{var e;const{is_required_login:t}=(null==(e=null==K?void 0:K.display)?void 0:e.global)||{};J(g&&!t)}),[g,K]);let ee=null,te=null;React.Children.map(t,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,wishlistWidgetAlert:s}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(ee=t),s&&isFunction(s)&&(te=s)}}));const se=te?te():null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-wrapper",children:[z&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:R?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"99.5%",height:"72px",color:"grey-100",rounded:"none",animationDuration:"3s",style:{margin:"0 auto"}}):te?jsxRuntimeExports.jsx(React.Fragment,{children:_?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:se}}):se}):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(t)&&React.Children.map(t,(e=>React.cloneElement(e,{isLoading:E,isFirstLoading:R,wishlistData:v,wishlistSort:T,selectedSort:C,selectedLimit:I,keyword:y,currentPage:O,totalPage:$,defaultLimitOptions:X,onSearch:U,showShareTrigger:k,shareLink:B,shareId:H,proxyUrl:V,dataSettings:K,productCardsComponent:ee,query:s,setIsLoading:j,setIsRefreshWidgetList:A,setSelectedSort:L,setSelectedLimit:N,setKeyword:b,setCurrentPage:D,onAfterAddToCart:o,onAfterAddWishlist:r,onAfterRemoveWishlist:l,onAfterRenderProduct:a,dataReviews:u})))]})})},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=document.querySelector(SELECTOR.WISHLIST.ELEMENT_WIDGET);detectInitSelector(element,(()=>{var _a,_b;if(element){const SHARE_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.SHARE_ID),QUERY_SHARE_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.QUERY_SHARE_ID),CUSTOM_ROUTE_PAGE=element.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.CUSTOM_ROUTE_PAGE),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),WISHLIST_WIDGET_ALERT=null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.RENDER_WISHLIST_WIDGET_ALERT);element.innerHTML="",client.createRoot(element).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||""},onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,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:r=null,isComponentJsVersion:l=!1,cards:a,onAfterAddToCart:d,onAfterAddWishlist:c,onAfterRemoveWishlist:u,onAfterRenderProduct:x,showPopupComponent:p,setShowPopupComponent:m,dataReviews:g})=>{const{show_vendor:_=!0,show_sku:R=!0,show_price:h=!0,show_add_to_cart:E=!0,redirect_add_to_cart:j=!0,language_button_add_to_cart:v="Add To Cart",display_product_name_style:w={},display_price_style:T={},display_button_add_to_cart_style:f={}}=i||{},[S,A]=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)=>{const{product:s,variants:i}=e||{},{id:x,title:C,image:L,url:I,vendor:N="",currency:y}=s||{},{id:b="",title:O="",price:D="",sku:$=""}=(null==i?void 0:i.length)?i[0]:{};let P=S==b,U=!(!(null==i?void 0:i.length)||!Object.hasOwn(i[0],"inventory_quantity"))&&(!i[0].inventory_quantity&&n);const W=a?a({product:{...s,variants:i.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(i[t],"inventory_quantity")&&!s}}))},showPopupComponent:p,setShowPopupComponent:m}):null;return a?jsxRuntimeExports.jsx(React.Fragment,{children:l?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:W}}):W},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:I,onClick:()=>"instant-search"===r&&productClickTrigger({productId:x}),children:[jsxRuntimeExports.jsx(Trigger,{params:{productId:x,productVariantId:b,productName:C,productVendor:N,productSku:$,productVariantName:O,productLink:I,productImage:(null==L?void 0:L.src)||`${API_URL}/img/blank-image.png`,productCurrency:y,productPrice:D},...o,onAfterAddWishlist:c,onAfterRemoveWishlist:u}),jsxRuntimeExports.jsx("img",{src:(null==L?void 0:L.src)||"",alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})]}),U?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:[C?jsxRuntimeExports.jsx("a",{href:I,onClick:()=>"instant-search"===r&&productClickTrigger({productId:x}),children:jsxRuntimeExports.jsx("h3",{style:w,children:C})}):null,h?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:jsxRuntimeExports.jsxs("p",{style:T,children:[y,D]})}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-text",children:[jsxRuntimeExports.jsx("div",{children:O}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Vendor: ",N]}):null}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:" | "}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:R?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["SKU: ",$]}):null})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(Rating,{params:{productId:x},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1,data:null==g?void 0:g[x]})})]})]}),E?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",style:{...f,...P&&{cursor:"wait"}},...P||U?{disabled:!0}:{onClick:()=>(async e=>{var t;const{id:s,quantity:i}=e;A(s);let n=await addToCart([{id:s,quantity:i}]);(null==(t=null==n?void 0:n.items)?void 0:t.length)?("wishlist"===r?await addToCartTrigger({productId:s}):"instant-search"===r&&await addToCartTrigger$1({productId:s}),A(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;A(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:b,quantity:1})},children:P?"Adding...":U?"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:v||"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:r="",...l}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__input-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField",name:r,children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("input",{className:"sledge__input-field",type:o,value:s,required:n,onChange:e=>(e=>{i&&i(e)})(e),...l})}),n&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"valueMissing",children:"Required field"}),"email"===o&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"typeMismatch",children:"Please fill a valid email address"})]})})},CollectionGrid$1="",CollectionGrid=({className:e="",data:t})=>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:r}=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:r||`${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:r}=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:r||`${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:r,image:l}=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:r,children:jsxRuntimeExports.jsx("img",{src:l||`${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:r,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:r,children:"Learn More"})})]},t)}))}):null}),Tooltip$1="",Tooltip=({children:e,content:t,withArrow:s=!0,customArrow:i="",sideOffset:n=5,alignOffset:o=0,wrapTrigger:r=!0})=>{const[l,a]=React.useState(!1);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".sledge__tooltip-arrow"))?void 0:e.parentElement;t&&(null==i?void 0:i.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=i)}),[l]),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:a,children:[jsxRuntimeExports.jsx($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:r?jsxRuntimeExports.jsx("span",{children:e}):e}),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:n,alignOffset:o,children:[t,s?jsxRuntimeExports.jsx($a093c7e1ec25a057$export$21b07c8f274aebd5,{className:"sledge__tooltip-arrow"}):null]})})]})})},ScrollArea$1="",ScrollArea=({children:e,isLoading:t=!1,className:s="",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,animationDuration:n="8s",disableAnimation:o=!1,style:r={},className:l="",...a})=>jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item ${l} ${o?"":"sledge__skeleton-item-animation"}`,style:{width:e,height:t,WebkitAnimationDuration:n,animationDuration:n,...r},"data-skeleton-rounded":s,"data-skeleton-color":i,...a}),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:"grey-300",rounded:"sm",disableAnimation:!0})}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"grey-100",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:"grey-100",rounded:"md",animationDuration:"15s"}),jsxRuntimeExports.jsx(SkeletonItem,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"20s"})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"190px",height:"46px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"16px"}})})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"117px",height:"40px",color:"grey-100",rounded:"md",animationDuration:"15s"})})]},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:"grey-100",rounded:"md",animationDuration:"list"===t?"2.5s":"8s"})},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:"grey-300",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:"grey-300",rounded:"lg"})}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"47px",color:"grey-300",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:"grey-300",rounded:"md",animationDuration:"20s",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:"grey-300",rounded:"md",animationDuration:"13s",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:"grey-300",rounded:"md",animationDuration:"6s"})}),jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"17s",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:"grey-100",rounded:"md",animationDuration:"10s"})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"242px",marginTop:"26px",marginBottom:"12px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"23s",style:{maxWidth:"80px",marginBottom:"27px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"80px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"190px",marginBottom:"27px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"grey-100",rounded:"md",animationDuration:"20s",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,r,l;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?((null==(s=null==e?void 0:e.data)?void 0:s.wishlist)&&(localStorage.setItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING,JSON.stringify(null==(i=null==e?void 0:e.data)?void 0:i.wishlist)),WishlistInitSelector()),(null==(n=null==e?void 0:e.data)?void 0:n.review)&&(localStorage.setItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING,JSON.stringify(null==(o=null==e?void 0:e.data)?void 0:o.review)),ProductReviewInitSelector()),(null==(r=null==e?void 0:e.data)?void 0:r.instantsearch)&&(localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING,JSON.stringify(null==(l=null==e?void 0:e.data)?void 0:l.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-250f86b3.js";const root="",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)=>{let s=!1;document.body.addEventListener("DOMNodeInserted",(()=>{!s&&e&&(s=!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"})}},isTokenExpired=e=>{const t=JSON.parse(atob(e.split(".")[1])).exp;return Math.floor((new Date).getTime()/1e3)>=t},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"},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"},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",WISHLIST_SETTING:"sledge-wishlist-setting",PRODUCT_REVIEW_SETTING:"sledge-product-review-setting",INSTANT_SEARCH_SETTING:"sledge-instant-search-setting"},INTERNAL_SELECTOR_VALUE={ELEMENT_TOAST_NOTIFICATION:"toast-notification",ELEMENT_CONFIRMATION_POPUP:"confirmation-popup",ELEMENT_INFO_POPUP:"info-popup",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/`,getSettings=async e=>{let t=e||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`);var i={method:"GET",headers:s,redirect:"follow"};return await fetch(`${API_URL}/app/settings`,i).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getToken=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);if(t&&!isTokenExpired(t))return{data:{token:t}};const{API_KEY:s,INSTANT_SEARCH_API_KEY:i,USER_ID:n,USER_EMAIL:o,USER_FULLNAME:r,ANONYM_ID:l}=e;var a=new Headers;a.append("Authorization",`Bearer ${s||""}`),a.append("Content-Type","application/json");var d={method:"POST",headers:a,body:JSON.stringify({user:{id:n||"",email:o||"",name:r||"",anonym:l||("undefined"!=typeof localStorage&&(null==localStorage?void 0:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID))||"")}}),redirect:"follow"};return await fetch(`${API_URL}/app/token`,d).then((e=>e.json())).then((async e=>{const{data:t}=e||{},{anonym:s,token:n}=t||{};return"undefined"!=typeof localStorage&&(null==localStorage||localStorage.setItem(LOCAL_STORAGE_KEY.ANONYM_ID,s||""),null==localStorage||localStorage.setItem(LOCAL_STORAGE_KEY.AUTH_APP,n||""),null==localStorage||localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP,i||"")),e})).catch((e=>e))},Loading="",ConfirmationPopup$1="",ConfirmationPopup=()=>{const[e,t]=React.useState(""),[s,i]=React.useState(""),[n,o]=React.useState(""),[r,l]=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:r,buttonSubmitType:a,onSubmit:c})=>{u(!0),t(e),i(s),o(n),l(r),d(a),p({onSubmit:c})})}),[]),jsxRuntimeExports.jsx($905f4ae918aab1aa$export$be92b6f5f03c0fe9,{open:c,onOpenChange:u,children:jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($905f4ae918aab1aa$export$c6fdb837b070b4ff,{className:"sledge__alert-dialog-overlay"}),jsxRuntimeExports.jsxs($905f4ae918aab1aa$export$7c6e2c02157bb7d2,{className:"sledge__alert-dialog-content",children:[jsxRuntimeExports.jsx($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:r})}),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(""),[r,l]=React.useState(!1);return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInfoPopup=({title:e,message:s,textCancel:n})=>{l(!0),t(e),i(s),o(n)})}),[]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:r,onOpenChange:l,children:jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$602eac185826482c,{children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff,{className:"sledge__dialog-overlay"}),jsxRuntimeExports.jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,{className:"sledge__dialog-content",children:[jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0,{className:"sledge__dialog-title",dangerouslySetInnerHTML:{__html:e}}),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$393edc798c47379d,{className:"sledge__dialog-description",dangerouslySetInnerHTML:{__html:s}}),jsxRuntimeExports.jsx("div",{className:"sledge__dialog-close-button",children:jsxRuntimeExports.jsx("button",{className:"sledge__dialog-button sledge__dialog-button-cancel",onClick:()=>l(!1),children:n})}),jsxRuntimeExports.jsx("button",{className:"IconButton","aria-label":"Close",onClick:()=>l(!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(""),[r,l]=React.useState(""),[a,d]=React.useState(null),[c,u]=React.useState(""),x=React.useRef(0);return React.useEffect((()=>("undefined"!=typeof window&&(window.sledgeToastNotification=({title:e,message:s,location:n="bottom-right",icon:r=null,type:a})=>{i(e),o(s),l(n),d(r),u(a),t(!1),window.clearTimeout(x.current),x.current=window.setTimeout((()=>{t(!0)}),10)}),()=>clearTimeout(x.current))),[]),jsxRuntimeExports.jsxs($054eb8030ebde76e$export$2881499e37b75b9a,{children:[jsxRuntimeExports.jsxs($054eb8030ebde76e$export$be92b6f5f03c0fe9,{className:"sledge__ToastRoot",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__ToastTitle",children:s}),jsxRuntimeExports.jsx($054eb8030ebde76e$export$393edc798c47379d,{asChild:!0,children:jsxRuntimeExports.jsx("p",{className:"sledge__ToastDescription",children:n})})]}),jsxRuntimeExports.jsx("div",{className:"sledge__toast-action-wrapper",children:jsxRuntimeExports.jsx($054eb8030ebde76e$export$e19cd5f9376f8cee,{className:"sledge__ToastAction",asChild:!0,altText:"Close notification",children:jsxRuntimeExports.jsx(Button,{colorType:"outlined-danger",children:"Dismiss"})})})]}),jsxRuntimeExports.jsx($054eb8030ebde76e$export$d5c6c08dc2d3ca7,{className:"sledge__ToastViewport","data-location":r})]})},ToastNotificationInitSelector=()=>{let e=document.querySelector(`[${SELECTOR_ATTRIBUTE_KEY}="${INTERNAL_SELECTOR_VALUE.ELEMENT_TOAST_NOTIFICATION}"]`);e||(e=document.createElement("div"),e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.ELEMENT_TOAST_NOTIFICATION),document.body.appendChild(e)),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(ToastNotification,{})})))},Popover$1="",Popover=({trigger:e,content:t,isOpen:s,setIsOpen:i,hideCloseIcon:n,align:o,className:r,withOpenState:l=!0,withArrow:a=!0,customArrow:d="",sideOffset:c=5,alignOffset:u=0})=>{const[x,p]=React.useState(!!l&&s);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".PopoverArrow"))?void 0:e.parentElement;t&&(null==d?void 0:d.length)&&(t.style.display="inline-flex",t.innerHTML=d)}),[x]),jsxRuntimeExports.jsxs($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,{...l&&{open:s},...i&&{onOpenChange:e=>{p(e),i(e)}},children:[jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$41fb9f06171c75f4,{asChild:!0,children:e}),jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,{className:`sledge__popover-content ${r||""}`,sideOffset:c,alignOffset:u,align:o,...i&&{onOpenAutoFocus:()=>i(!0),onCloseAutoFocus:()=>i(!1)},children:[t,!n&&jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$f39c2d165cd861fe,{className:"PopoverClose","aria-label":"Close",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),a?jsxRuntimeExports.jsx($cb5cc270b50c6fcd$export$21b07c8f274aebd5,{className:"PopoverArrow"}):null]})})]})},Progress$1="",Progress=({value:e,total:t,fillColor:s="",outlineColor:i=""})=>{const[n,o]=React.useState(0);return React.useEffect((()=>{const s=setTimeout((()=>o(+e/t*100)),150);return()=>clearTimeout(s)}),[]),jsxRuntimeExports.jsx($67824d98245208a0$export$be92b6f5f03c0fe9,{className:"sledge__progress",value:n,style:i?{borderWidth:"1px",borderStyle:"solid",borderColor:i}:{},children:jsxRuntimeExports.jsx($67824d98245208a0$export$adb584737d712b70,{className:"ProgressIndicator",style:{transform:`translateX(-${100-n}%)`,...s&&{backgroundColor:s}}})})},Checkbox$1="",Checkbox=({id:e,name:t,value:s,required:i,label:n,defaultChecked:o,labelStyle:r={},onClick:l})=>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:l,children:jsxRuntimeExports.jsx($e698a72e93240346$export$adb584737d712b70,{className:"sledge__checkbox-indicator",children:jsxRuntimeExports.jsx("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.72318 0.237414C10.0707 0.574491 10.0942 1.14584 9.77561 1.51356L4.40976 7.70711C4.25243 7.88871 4.03181 7.99443 3.79903 7.99979C3.56625 8.00514 3.3415 7.90965 3.17686 7.73545L0.250031 4.63868C-0.0833435 4.28595 -0.0833435 3.71406 0.250031 3.36133C0.583405 3.00859 1.12391 3.00859 1.45729 3.36133L3.75367 5.79105L8.51706 0.292899C8.83564 -0.0748211 9.37564 -0.0996624 9.72318 0.237414Z",fill:"white"})})})}),n&&jsxRuntimeExports.jsx("label",{className:"sledge__checkbox-label",htmlFor:e,style:r,children:n})]}),Slider$1="",Slider=e=>{const{defaultValue:t,min:s,max:i,step:n=1,setValueCommit:o,setValueChange:r}=e,[l,a]=React.useState(t);return jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsxs($faa2e61a3361514f$export$be92b6f5f03c0fe9,{className:"sledge__SliderRoot",defaultValue:t,min:s,max:i,step:n,"aria-label":"Volume",onValueCommit:e=>{o&&o(e),a(e)},onValueChange:e=>{r&&r(e),a(e)},children:[jsxRuntimeExports.jsx($faa2e61a3361514f$export$13921ac0cc260818,{className:"sledge__SliderTrack",children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$9a58ef0d7ad3278c,{className:"sledge__SliderRange"})}),jsxRuntimeExports.jsx(Tooltip,{content:l[0],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#23BC45"/></svg>',wrapTrigger:!1,children:jsxRuntimeExports.jsx($faa2e61a3361514f$export$6521433ed15a34db,{className:"sledge__SliderThumb"})}),jsxRuntimeExports.jsx(Tooltip,{content:l[1],customArrow:'<svg width="19" height="5" viewBox="0 0 19 5" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 4.99998C9 9.48298e-05 16.4996 1.99678e-05 18.4999 0L9 2.2985e-06L0.5 2.04891e-06C9 2.2985e-06 9 4.99998 9 4.99998Z" fill="#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:r})=>jsxRuntimeExports.jsx("div",{className:"sledge__radio-group-wrapper",children:jsxRuntimeExports.jsx("form",{children:jsxRuntimeExports.jsx($f99a8c78507165f7$export$be92b6f5f03c0fe9,{className:"sledge__radio-group-root","aria-label":"View density",defaultValue:i,id:e,name:t,required:s,onValueChange:r,children:n.map(((t,s)=>{const{label:i,value:n}=t;return jsxRuntimeExports.jsxs("div",{className:"sledge__radio-group-item-flex",children:[jsxRuntimeExports.jsx($f99a8c78507165f7$export$6d08773d2e66f8f2,{className:"sledge__radio-group-item",value:n,id:`${e}${s}`,children:jsxRuntimeExports.jsx($f99a8c78507165f7$export$adb584737d712b70,{className:"sledge__radio-group-indicator"})}),jsxRuntimeExports.jsx("label",{className:"sledge__radio-group-label",htmlFor:`${e}${s}`,style:o,children:i})]},s)}))})})}),ColorSwatch$1="",ColorSwatch=({id:e,name:t,value:s,rgb:i,image:n,required:o,defaultChecked:r,onClick:l})=>{const a={...(null==n?void 0:n.length)?{backgroundImage:`url(${n})`}:{backgroundColor:i}};return jsxRuntimeExports.jsx("div",{className:"sledge__color-swatch-wrapper",children:jsxRuntimeExports.jsx($e698a72e93240346$export$be92b6f5f03c0fe9,{className:"sledge__color-swatch-root",defaultChecked:r,id:e,name:t,value:s,required:o,onClick:l,style:a})})},Select$1="",Select=({name:e,placeholder:t,required:s,defaultValue:i,items:n,labelStyle:o={},onValueChange:r})=>jsxRuntimeExports.jsx("div",{className:"sledge__select-wrapper",children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$be92b6f5f03c0fe9,{name:e,required:s,onValueChange:r,children:[jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$41fb9f06171c75f4,{className:"sledge__select-trigger",children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$4c8d1a57a761ef94,{placeholder:t}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$f04a61298a47a40f,{className:"sledge__select-icon",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$7c6e2c02157bb7d2,{className:"sledge__select-content",children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$2f60d3ec9ad468f2,{className:"sledge__select-scroll-button",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d5c6c08dc2d3ca7,{className:"sledge__select-viewport",children:n.map(((e,t)=>{const{label:s,value:i}=e;return jsxRuntimeExports.jsx(SelectItemComponent,{value:i,children:s},t)}))}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$bf1aedc3039c8d63,{className:"sledge__select-scroll-button",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]})})]})}),SelectItemComponent=React.forwardRef((({children:e,className:t="",...s},i)=>jsxRuntimeExports.jsxs($cc7e05a45900e73f$export$6d08773d2e66f8f2,{className:`sledge__select-item ${t}`,...s,ref:i,children:[jsxRuntimeExports.jsx($cc7e05a45900e73f$export$d6e5bf9c43ea9319,{children:e}),jsxRuntimeExports.jsx($cc7e05a45900e73f$export$c3468e2714d175fa,{className:"sledge__select-item-indicator",children:jsxRuntimeExports.jsx("svg",{width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]}))),HeartIcon=({width:e,height:t,type:s,color:i})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__heart",children:"outline"===s?jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-line",viewBox:"0 0 18 17",fill:i,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.19515 0.86581C10.5501 0.00914308 12.3501 -0.227524 13.9051 0.27081C17.2876 1.36164 18.3376 5.04914 17.3985 7.98331C15.9493 12.5916 9.76015 16.0291 9.49765 16.1733C9.40431 16.225 9.30098 16.2508 9.19765 16.2508C9.09431 16.2508 8.99181 16.2258 8.89848 16.175C8.63765 16.0325 2.49348 12.6458 0.995979 7.98414L0.995146 7.98331C0.0551462 5.04831 1.10181 1.35998 4.48098 0.27081C6.06765 -0.242524 7.79681 -0.0166903 9.19515 0.86581ZM4.86431 1.46081C2.13015 2.34248 1.44348 5.28331 2.18598 7.60248C3.35431 11.2375 7.97015 14.1766 9.19681 14.9041C10.4276 14.1691 15.0768 11.1975 16.2076 7.60581C16.9501 5.28414 16.261 2.34331 13.5226 1.46081C12.196 1.03498 10.6485 1.29414 9.58015 2.12081C9.35681 2.29248 9.04681 2.29581 8.82181 2.12581C7.69015 1.27498 6.21181 1.02581 4.86431 1.46081ZM12.7226 3.11573C13.8585 3.48323 14.6543 4.48906 14.7518 5.67823C14.7793 6.02239 14.5235 6.32406 14.1793 6.35156C14.1618 6.35323 14.1451 6.35406 14.1276 6.35406C13.8051 6.35406 13.5318 6.10656 13.5051 5.77989C13.4501 5.09489 12.9918 4.51656 12.3393 4.30573C12.0101 4.19906 11.8301 3.84656 11.936 3.51906C12.0435 3.19073 12.3926 3.01239 12.7226 3.11573Z"})}):jsxRuntimeExports.jsx("svg",{width:e,height:t,id:"sledge-icon-heart-fill",viewBox:"0 0 18 17",fill:i,children:jsxRuntimeExports.jsx("path",{d:"M5.89936 0.0838691C6.42436 0.0998355 6.9327 0.191502 7.4252 0.359002H7.47436C7.5077 0.374836 7.5327 0.392336 7.54936 0.408169C7.73353 0.467336 7.9077 0.534002 8.07436 0.625669L8.39103 0.767336C8.51603 0.834002 8.66603 0.958169 8.74936 1.009C8.8327 1.05817 8.92436 1.109 8.99936 1.1665C9.9252 0.459002 11.0494 0.0756688 12.2077 0.0838691C12.7335 0.0838691 13.2585 0.158169 13.7577 0.325669C16.8335 1.32567 17.9419 4.70067 17.016 7.65067C16.491 9.15817 15.6327 10.534 14.5085 11.6582C12.8994 13.2165 11.1335 14.5998 9.2327 15.7915L9.02436 15.9173L8.8077 15.7832C6.9002 14.5998 5.12436 13.2165 3.5002 11.6498C2.38353 10.5257 1.52436 9.15817 0.991029 7.65067C0.0493627 4.70067 1.1577 1.32567 4.26686 0.308169C4.50853 0.224836 4.7577 0.166502 5.0077 0.134002H5.1077C5.34186 0.0998355 5.57436 0.0838691 5.8077 0.0838691H5.89936ZM13.3244 2.71734C12.9827 2.59984 12.6077 2.784 12.4827 3.134C12.366 3.484 12.5494 3.86734 12.8994 3.9915C13.4335 4.1915 13.791 4.71734 13.791 5.29984V5.32567C13.7752 5.5165 13.8327 5.70067 13.9494 5.84234C14.066 5.984 14.241 6.0665 14.4244 6.084C14.766 6.07484 15.0577 5.80067 15.0827 5.44984V5.35067C15.1077 4.18317 14.4002 3.12567 13.3244 2.71734Z"})})}),ChevronArrowDownIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-down",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("g",{id:"Arrow - Down 2",children:jsxRuntimeExports.jsx("g",{id:"Iconly/Light-Outline/Arrow---Down-2",children:jsxRuntimeExports.jsx("g",{id:"Arrow---Down-2",children:jsxRuntimeExports.jsx("path",{id:"Stroke-1",d:"M3.72407 6.6414C3.94596 6.41951 4.29318 6.39934 4.53786 6.58089L4.60796 6.6414L9.99935 12.0325L15.3907 6.6414C15.6126 6.41951 15.9598 6.39934 16.2045 6.58089L16.2746 6.6414C16.4965 6.86329 16.5167 7.21051 16.3351 7.45519L16.2746 7.52529L10.4413 13.3586C10.2194 13.5805 9.87218 13.6007 9.62751 13.4191L9.55741 13.3586L3.72407 7.52529C3.48 7.28121 3.48 6.88548 3.72407 6.6414Z",fill:s})})})})})}),ChevronArrowLeftIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-left",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M10.6875 2.97945C10.865 3.15697 10.8812 3.43474 10.7359 3.63048L10.6875 3.68656L6.37465 7.99967L10.6875 12.3128C10.865 12.4903 10.8812 12.7681 10.7359 12.9638L10.6875 13.0199C10.51 13.1974 10.2323 13.2135 10.0365 13.0683L9.98043 13.0199L5.31377 8.35323C5.13625 8.17572 5.12012 7.89794 5.26535 7.7022L5.31377 7.64612L9.98043 2.97945C10.1757 2.78419 10.4923 2.78419 10.6875 2.97945Z",fill:s})})}),ChevronArrowRightIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.60738 13.1302C5.42987 12.9527 5.41374 12.675 5.55897 12.4792L5.60738 12.4231L9.92027 8.11002L5.60738 3.79691C5.42987 3.6194 5.41374 3.34162 5.55897 3.14588L5.60738 3.0898C5.7849 2.91229 6.06267 2.89615 6.25841 3.04139L6.31449 3.0898L10.9812 7.75647C11.1587 7.93398 11.1748 8.21175 11.0296 8.4075L10.9812 8.46357L6.31449 13.1302C6.11923 13.3255 5.80265 13.3255 5.60738 13.1302Z",fill:s})})}),ArrowRightIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__arrow-right",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M3 8.79429C3 8.50952 3.21162 8.27418 3.48617 8.23693L3.5625 8.23179L13.4505 8.23224L9.87826 4.6746C9.65812 4.4554 9.65735 4.09925 9.87655 3.8791C10.0758 3.67897 10.3883 3.66015 10.6088 3.82306L10.672 3.87739L15.2095 8.39539C15.2386 8.42428 15.2638 8.45555 15.2852 8.48858C15.2912 8.49852 15.2973 8.50869 15.3032 8.51906C15.3085 8.52795 15.3134 8.53718 15.318 8.54652C15.3243 8.5601 15.3305 8.57413 15.3361 8.58845C15.3407 8.59949 15.3445 8.61023 15.348 8.62105C15.3522 8.63447 15.3562 8.64877 15.3597 8.66329C15.3622 8.67343 15.3643 8.68319 15.3661 8.69298C15.3686 8.70755 15.3707 8.72263 15.3722 8.73789C15.3735 8.74953 15.3743 8.76106 15.3747 8.77261C15.3749 8.77961 15.375 8.78693 15.375 8.79429L15.3747 8.81608C15.3743 8.82712 15.3735 8.83815 15.3725 8.84916L15.375 8.79429C15.375 8.82979 15.3717 8.86452 15.3654 8.89819C15.364 8.90623 15.3622 8.91449 15.3603 8.92271C15.3563 8.93964 15.3517 8.95595 15.3464 8.97194C15.3438 8.97988 15.3407 8.98837 15.3375 8.99679C15.3309 9.01371 15.3238 9.02985 15.3159 9.04557C15.3122 9.05296 15.3082 9.06069 15.3039 9.06835C15.2968 9.08084 15.2896 9.09272 15.2819 9.10429C15.2765 9.11248 15.2706 9.12101 15.2643 9.1294L15.2594 9.13588C15.2443 9.15568 15.2278 9.17444 15.2102 9.19204L15.2096 9.19256L10.6721 13.7113C10.4519 13.9305 10.0958 13.9298 9.87658 13.7097C9.67729 13.5096 9.65979 13.197 9.82363 12.9771L9.87823 12.9142L13.449 9.35724L3.5625 9.35679C3.25184 9.35679 3 9.10495 3 8.79429Z",fill:s})})}),BagIcon=({width:e,height:t,color:s})=>jsxRuntimeExports.jsx("span",{className:"sledge-icon__bag",children:jsxRuntimeExports.jsx("svg",{width:e,height:t,viewBox:"0 0 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:r="button",link:l="",...a}=e;return"hyperlink"===r&&(null==l?void 0:l.length)?jsxRuntimeExports.jsx("a",{href:l,className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":o,ref:t,...a,children:i}):jsxRuntimeExports.jsx("button",{className:`sledge__button ${s||""}`,"data-button-color-type":n,"data-button-full-width":o,ref:t,...a,children:i})})),SearchInputField$1="",SearchInputField=e=>{const{className:t="",icon:s,value:i="",withClearField:n,onChange:o,onResetField:r,fieldRef:l,...a}=e,[d,c]=React.useState(!1);return React.useEffect((()=>{c(Boolean(i))}),[i]),jsxRuntimeExports.jsxs("div",{className:`sledge__search-input-field-wrapper ${t||""}`,children:[s?jsxRuntimeExports.jsx("div",{className:"sledge__search-input-field-icon",children:s}):null,jsxRuntimeExports.jsx("input",{className:"sledge__search-input-field",value:i,onChange:e=>(e=>{o&&o({value:e.target.value})})(e),ref:l,...a}),d&&n?jsxRuntimeExports.jsx("div",{className:"sledge__clear-field-wrapper",children:jsxRuntimeExports.jsx("button",{className:"sledge__clear-field",type:"button",onClick:()=>{(null==l?void 0:l.current)&&l.current.focus(),o&&o({value:""}),r&&r()},children:jsxRuntimeExports.jsx("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:r="end",onChange:l,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)=>{l&&l({label:e,value:t}),p(!1)})(s,i),...i===a&&{"data-selected":!0},children:s},t);return c?jsxRuntimeExports.jsx(c,{scroll:!1,to:null==u?void 0:u.replace("value",i),href:null==u?void 0:u.replace("value",i),children:jsxRuntimeExports.jsx(n,{})},t):jsxRuntimeExports.jsx(n,{},t)}))}),isOpen:x,setIsOpen:p,hideCloseIcon:!0,align:r,className:"sledge__select-field-option-content",withArrow:!1})})},ProductGrid$1="",addToCart=async e=>{var t,s=new Headers;s.append("Content-Type","application/json");let i=[];e.map((e=>{const{id:t,quantity:s}=e;i.push({id:t,quantity:s})}));var n={method:"POST",headers:s,body:JSON.stringify({items:i}),redirect:"follow"};if(null==(t=null==window?void 0:window.Shopify)?void 0:t.routes)return await fetch(`${window.Shopify.routes.root}cart/add.js`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getReview=async(e,t,s)=>{const{page:i,limit:n,sort:o,keyword:r,rating:l}=t||{};let a=sanitizeDataId(e),d=s||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),c="?"+new URLSearchParams({page:i||"",limit:n||"",sort:o||"",keyword:r||"",rating:l||""}).toString();var u=new Headers;u.append("Authorization",`Bearer ${d}`);var x={method:"GET",headers:u,redirect:"follow"};return await fetch(`${API_URL}/review/${a}${c}`,x).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getReviewInfo=async e=>{let t=sanitizeDataId(e),s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${s}`);var n={method:"GET",headers:i,redirect:"follow"};return await fetch(`${API_URL}/review/info/${t}`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getReviewMedia=async()=>{let e=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var t=new Headers;t.append("Authorization",`Bearer ${e}`);var s={method:"GET",headers:t,redirect:"follow"};return await fetch(`${API_URL}/review/media`,s).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addReviewMedia=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`);var i=new FormData;[...e].map((e=>{i.append("files",e,e.name)}));var n={method:"POST",headers:s,body:i,redirect:"follow"};return await fetch(`${API_URL}/review/media`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},deleteReviewMedia=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`);var i={method:"DELETE",headers:s,redirect:"follow"};return await fetch(`${API_URL}/review/media/${e}`,i).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addReview=async e=>{const{userFirstName:t,userLastName:s,userEmail:i,productId:n,productVariantId:o,rating:r,title:l,review:a,mediaIds:d}=e;let c=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var u=new Headers;u.append("Authorization",`Bearer ${c}`),u.append("Content-Type","application/json");var x={method:"POST",headers:u,body:JSON.stringify({user:{name:`${t}${s?` ${s}`:""}`,email:i},product:{id:sanitizeDataId(n),variant_id:sanitizeDataId(o)},review:{rating:r,title:l,review:a,media_ids:d}}),redirect:"follow"};return await fetch(`${API_URL}/review`,x).then((e=>e.json())).then((e=>e)).catch((()=>{}))},usePrevious=e=>{const t=React.useRef();return React.useEffect((()=>{t.current=e})),t.current},Rating=e=>{var t;const{value:s,size:i="md",params:n,withSkeletonLoading:o=!0,isScrollToElementWidget:r=!0,data:l}=e,{productId:a}=n||{},{isRenderApp:d}=React.useContext(SledgeContext),[c,u]=React.useState(!0),[x,p]=React.useState(!0),[m,g]=React.useState({width:0,height:0}),[_,R]=React.useState(0),[h,E]=React.useState("0"),[j,v]=React.useState({}),w=usePrevious({productId:a}),{fill_color:T,outline_color:f}=(null==(t=null==j?void 0:j.display)?void 0:t.rating)||{},S=async()=>{s&&!n?(E(s),p(!1)):(async e=>{var t;let s,i,n,o=!1,r=0;if(l)n=l,o=!0;else{if(s=await getReviewInfo(e),!s)return;const{status:t}=s;n=s.data;const{code:i}=t;o=200===i||!1}r=(null==n?void 0:n.review_count)?n.review_count:0,i=(null==(t=null==n?void 0:n.rating)?void 0:t.average)?n.rating.average:0,o&&(R(r),E(i),p(!1),u(!1))})(a)};return React.useEffect((()=>{if(!(null==d?void 0:d.productReview))return;"undefined"!=typeof window&&(window.sledgeProductReviewRatingUpdate=()=>{p(!0),S()}),g("xs"===i?{width:14.4,height:14.4}:"sm"===i?{width:18,height:18}:{width:28.8,height:28.8}),Boolean(w&&(null==w?void 0:w.productId)!==a)&&u(!0),(async e=>{let t;p(!0),t=JSON.parse(e),t&&(v(t),await S())})(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"")}),[d,a]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__rating",onClick:()=>{r&&setTimeout((()=>{scrollToElement(document.getElementById(ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET),50)}),200)},children:c&&o?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"230px",height:"28px",color:"grey-100",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:T||"#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:f||"#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"})]})})]}),!x&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[[1,2,3,4,5].map(((e,t)=>{let s=Math.floor(parseFloat(h)),i=String(h).includes(",")?String(h).split(","):[],n=String(h).includes(".")?String(h).split("."):[],o=i.length||n.length?i[1]||n[1]:0,r="fill-0";return e>s&&s+1===e&&(r=`fill-${o}`),reactExports.createElement("svg",{...m,viewBox:"0 0 30 29","data-product-review-rating-fill":e<=s?"full":r,key:t},jsxRuntimeExports.jsx("use",{href:"#sledge-product-review-icons-rating-icon"}))})),!s&&n?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__rating-summary-total",children:["(",_,")"]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]})]})})},ElementInit$1=e=>{const t=e.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),s=e.getAttribute(DATASET_ATTRIBUTE_KEY.PRODUCT_REVIEW.RATING_SIZE);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(Rating,{params:{productId:t||""},size:s})})}))},RatingInitSelector=()=>{let e=Array.from(document.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING));detectInitSelector(e,(()=>{e.length&&e.map((e=>ElementInit$1(e)))})),new MutationObserver((function(t){t.forEach((function(t){Array.prototype.slice.call(t.addedNodes).forEach((function(t){1===t.nodeType&&t.querySelector(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)&&(e=Array.from(t.querySelectorAll(SELECTOR.PRODUCT_REVIEW.ELEMENT_RATING)),e.length&&e.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,r,l;const{text_color:a,border_color:d,border_radius:c,padding_top:u,padding_bottom:x,padding_left:p,padding_right:m,background_color:g,font_size:_,font_weight:R,text_transform:h}=(null==(r=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:r.button_write_review)||{},{button_write_review:E}=(null==(l=null==s?void 0:s.languages)?void 0:l.widget)||{},j={...a&&{color:a},...d&&{borderColor:d},...c&&{borderRadius:c},...u&&{paddingTop:u},...x&&{paddingBottom:x},...p&&{paddingLeft:p},...m&&{paddingRight:m},...g&&{backgroundColor:g},..._&&{fontSize:_},...R&&{fontWeight:R},...h&&{textTransform:h}};return jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):jsxRuntimeExports.jsxs(Button,{type:"button",colorType:"success",onClick:()=>"undefined"!=typeof window&&window.sledgeProductReviewWidgetFormAdd&&window.sledgeProductReviewWidgetFormAdd(i,n),style:j,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||(E||"Add review")]})})},WidgetHeaderSort$1=({isFirstLoading:e,productReviewSort:t,dataSettings:s,setSelectedSort:i,setIsRefreshWidgetList:n,LinkComponent:o})=>{var r,l;const{default_sort:a,show_sorting_options:d}=(null==(r=null==s?void 0:s.display)?void 0:r.widget)||{},[c,u]=React.useState(a||null),x=c||(null==(l=t[0])?void 0:l.value);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:d?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-header-item",children:e?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"134px",height:"42px",rounded:"lg",color:"grey-100"}):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:x,onChange:({value:e})=>(e=>{u(e),n&&n(!0),i&&i(e)})(e),LinkComponent:o,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;const{params:n,dataSettings:o,summaryData:r}=e,{productId:l}=n||{},{fill_color:a,outline_color:d}=(null==(s=null==(t=null==o?void 0:o.display)?void 0:t.widget)?void 0:s.summary_bar)||{},{review_singular:c,review_plural:u}=(null==(i=null==o?void 0:o.languages)?void 0:i.widget)||{},[x,p]=React.useState(!0),[m,g]=React.useState(!0),[_,R]=React.useState(!0),[h,E]=React.useState(!0),[j,v]=React.useState(!1),[w,T]=React.useState(0),[f,S]=React.useState({5:0,4:0,3:0,2:0,1:0}),[A,C]=React.useState("0"),L=usePrevious({productId:l}),I=async()=>{var e;let t,s,i,n,o=!1,a=0;if(r)s=r,o=!0;else{if(t=await getReviewInfo(l),!t)return;const{status:e}=t,{code:i}=e;s=t.data,o=200===i||!1}a=(null==s?void 0:s.review_count)?s.review_count:0,i=(null==s?void 0:s.rating)?{5:s.rating[5]||0,4:s.rating[4]||0,3:s.rating[3]||0,2:s.rating[2]||0,1:s.rating[1]||0}:f,n=(null==(e=null==s?void 0:s.rating)?void 0:e.average)?s.rating.average:"0",o&&(T(a),S(i),C(n),R(!1),E(!1),p(!1),j&&g(!1))};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetSummaryUpdate=()=>{E(!0),I()}),Boolean(L&&(null==L?void 0:L.productId)!==l)&&p(!0),I()}),[j,l]),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary",children:x?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"630px",height:"42px",color:"grey-100",rounded:"md",animationDuration:"5s"}):_?null:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(motion.div,{initial:!1,animate:j?"open":"closed",className:"sledge-product-review__widget-summary-trigger",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-average",children:A}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-summary-rating",children:!h&&jsxRuntimeExports.jsx(Rating,{value:String(A),size:"md",withSkeletonLoading:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-summary-total",children:[w," ",w>1?u||"Reviews":c||"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:m?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:"grey-100",rounded:"md",animationDuration:"15s"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"128px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginLeft:"13px",marginRight:"12px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"38px",height:"22px",color:"grey-100",rounded:"md",animationDuration:"42s"})]},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,{value:e,size:"sm",withSkeletonLoading:!1,isScrollToElementWidget:!1}),jsxRuntimeExports.jsx(Progress,{value:String(f[e]),total:w,fillColor:a,outlineColor:d}),jsxRuntimeExports.jsxs("small",{children:["(",f[e],")"]})]},t)))})}),setIsOpen:v,hideCloseIcon:!0,align:"end",alignOffset:-170,className:"sledge-product-review__widget-summary-content",withArrow:!1})})},WidgetHeader$1=e=>{const[t,s]=React.useState(!0);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;const{isFirstLoading:s,isLoading:i,productReviewData:n,dataSettings:o,currentPage:r,setCurrentPage:l,totalPage:a,totalData:d,setIsReplaceWidgetList:c,widgetWrapperRef:u}=e||{},{type:x}=(null==(t=null==o?void 0:o.display)?void 0:t.widget)||{},p="list"===x?jsxRuntimeExports.jsx(Pagination,{currentPage:r||1,totalPage:a||1,totalResult:d||0,onChange:e=>(e=>{l&&l(e),c&&c(!0),setTimeout((()=>{scrollToElement(u.current,50)}),200)})(e)}):null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SkeletonLoading.ReviewGrid,{count:"grid"===x?8:10,type:x,gridItemHeights:["252px","342px","196px","398px","342px","252px","398px","196px"]}),s?null:p]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-wrapper","data-layout-type":x,children:(null==n?void 0:n.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ReviewWrapper,{...e}),p]}):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,r]=React.useState(""),[l,a]=React.useState("");return React.useEffect((()=>{r(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:l}})]})},ReviewWrapper=e=>{var t,s,i,n,o,r,l,a;const{productReviewData:d,currentPage:c,setCurrentPage:u,totalPage:x,totalData:p,dataSettings:m,setIsRefreshWidgetList:g,setIsReplaceWidgetList:_,LinkComponent:R,selectedSort:h,data:E}=e||{},{type:j,rating_size:v,show_review_date:w}=(null==(t=null==m?void 0:m.display)?void 0:t.widget)||{},{text_color:T,border_color:f,border_radius:S,padding_top:A,padding_bottom:C,padding_left:L,padding_right:I,background_color:N,font_size:y,font_weight:b,text_transform:O}=(null==(i=null==(s=null==m?void 0:m.display)?void 0:s.widget)?void 0:i.button_load_more)||{},{text_color:D,border_color:$,border_radius:P,padding_top:U,padding_bottom:W,padding_left:k,padding_right:M,background_color:B,font_size:F,font_weight:H,text_transform:G}=(null==(o=null==(n=null==m?void 0:m.display)?void 0:n.widget)?void 0:o.verified)||{},{button_load_more:V,verified:Y}=(null==(r=null==m?void 0:m.languages)?void 0:r.widget)||{},{name:K,image:q}=(null==(a=null==(l=null==m?void 0:m.display)?void 0:l.widget)?void 0:a.replier)||{},z={...T&&{color:T},...f&&{borderColor:f},...S&&{borderRadius:S},...A&&{paddingTop:A},...C&&{paddingBottom:C},...L&&{paddingLeft:L},...I&&{paddingRight:I},...N&&{backgroundColor:N},...y&&{fontSize:y},...b&&{fontWeight:b},...O&&{textTransform:O}},J={...D&&{color:D},...$&&{borderWidth:"1px",borderStyle:"solid",borderColor:$},...P&&{borderRadius:P},...U&&{paddingTop:U},...W&&{paddingBottom:W},...k&&{paddingLeft:k},...M&&{paddingRight:M},...B&&{backgroundColor:B},...F&&{fontSize:F},...H&&{fontWeight:H},...G&&{textTransform:G}};let Z=c||0,X=x||0;const[Q,ee]=React.useState(!1),[te,se]=React.useState(!1),ie=()=>{u&&c&&u(c+1),ee(!0)};React.useEffect((()=>{se(!(X===Z&&!Q)&&(!!(E&&X>1)||X>=Z))}),[Q]),React.useEffect((()=>{ee(!1)}),[d]);const ne=()=>jsxRuntimeExports.jsx(Button,{type:"button",role:"button",colorType:"light",disabled:Q,onClick:ie,style:{...z,...Q&&{cursor:"wait"}},children:Q?"Loading...":V||"Load More"}),oe=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:r,media:l,reply:a,is_verified:d},created_at:c}=e;let u=new Intl.DateTimeFormat("en-US").format(new Date(c)),x=K?String(String(K).includes("<span>")?String(K).split("<span>")[0]:String(K)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=a[0])?void 0:s.name):null==(i=a[0])?void 0:i.name,p=K?getTextBetween("<span>","</span>",K):"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:J,children:Y}):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,{value:o,size:v,withSkeletonLoading:!1,isScrollToElementWidget:!1})}),w?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:u}):null]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:r.length>=250?`${r.slice(0,250)}...`:r})]}),(null==l?void 0:l.length)?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-image",children:l.slice(0,4).map(((e,t)=>{const{type:s,file:i}=e;let n="image"===s?jsxRuntimeExports.jsx("img",{src:i,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:q||"",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,{}),te&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-button-load-more",children:R?jsxRuntimeExports.jsx(R,{scroll:!1,to:`?page=${(c||1)+1}&sort=${h}`,href:`?page=${(c||1)+1}&sort=${h}`,children:jsxRuntimeExports.jsx(ne,{})}):jsxRuntimeExports.jsx(ne,{})})]}),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:r,review:l,media:a,reply:d,is_verified:c},created_at:u}=e;let x=new Intl.DateTimeFormat("en-US").format(new Date(u)),p=K?String(String(K).includes("<span>")?String(K).split("<span>")[0]:String(K)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(s=d[0])?void 0:s.name):null==(i=d[0])?void 0:i.name,g=K?getTextBetween("<span>","</span>",K):"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:J,children:Y}):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,{value:r,size:v,withSkeletonLoading:!1,isScrollToElementWidget:!1})}),w?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-date",children:x}):null]})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-content",children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-desc-wrapper",children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-desc",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-review-card-message",children:l.length>=350?`${l.slice(0,350)}...`:l}),(null==d?void 0:d.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("svg",{width:18,height:16,viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M0.5625 15.5C0.764999 15.5 0.955502 15.3905 1.056 15.2068L1.07175 15.1783C2.754 12.14 5.9595 10.25 9.4365 10.25H10.5V13.4375C10.5 13.6633 10.6358 13.8673 10.8435 13.9558C11.0498 14.0428 11.2928 13.9993 11.454 13.841L17.829 7.65351C17.9385 7.54776 18 7.40226 18 7.25001C18 7.09776 17.9385 6.95226 17.829 6.84651L11.454 0.659013C11.292 0.501513 11.0498 0.456513 10.8435 0.544263C10.6358 0.632763 10.5 0.836763 10.5 1.06251V4.25151C4.69275 4.35201 0 9.10701 0 14.9375C0 15.1948 0.174 15.419 0.423 15.4828C0.4695 15.4948 0.516001 15.5 0.5625 15.5ZM11.0625 9.12501H9.4365C6.3045 9.12501 3.36975 10.4968 1.3635 12.8083C2.334 8.55651 6.14625 5.37501 10.6875 5.37501H11.0625C11.373 5.37501 11.625 5.12301 11.625 4.81251V2.39226L16.6298 7.25001L11.625 12.1078V9.68751C11.625 9.37701 11.373 9.12501 11.0625 9.12501Z",fill:"#677487"})}),jsxRuntimeExports.jsx("img",{src:q||"",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:oe},WidgetRoot$1=e=>{const{children:t,params:s,onAfterAddReview:i,data:n,LinkComponent:o}=e,{productId:r}=s||{},{isRenderApp:l}=React.useContext(SledgeContext),[a,d]=React.useState(!0),[c,u]=React.useState(!0),[x,p]=React.useState(!1),[m,g]=React.useState(!1),[_,R]=React.useState([]),[h,E]=React.useState([]),[j,v]=React.useState(""),[w,T]=React.useState(1),[f,S]=React.useState(0),[A,C]=React.useState(0),[L,I]=React.useState({}),N=React.useRef(null),y=usePrevious({currentPage:w,isReplaceWidgetList:m,productId:r}),b=async(e=!1,t=!1,s)=>{var i,o;if(n&&JSON.stringify(_)===JSON.stringify(n.data))return;let l,a=10,c=j;if(u(!!t||!e),!e||t){let e=await O(s);const{review_per_page:r,default_sort:l}=(null==(i=null==e?void 0:e.display)?void 0:i.widget)||{};a=r||a,c=j||l,t||T(n?Math.ceil((null==(o=null==n?void 0:n.data)?void 0:o.length)/a):1),R([]),v(c)}let x,m,h=!1,f=0,A=0,L={page:e?w:1,limit:a,sort:c};if(l=n||await getReview(r,L),!l)return;const{status:I,data:N,page:y,sorts:b}=l,{code:D}=I;h=200===D||!1,x=(null==N?void 0:N.length)?t=>(null==_?void 0:_.length)&&e?[...t,...N]:N:[],m=(null==b?void 0:b.length)?b:[],f=n?Math.ceil(((null==y?void 0:y.total_data)||1)/a):(null==y?void 0:y.total_page)||1,A=(null==y?void 0:y.total_data)||1,h&&(R(x),E(m),S(f),C(A),u(!1),p(!1),g(!1),d(!1))},O=async e=>{let t;if(t=JSON.parse(e),t)return I(t),t};return React.useEffect((()=>{if(!(null==l?void 0:l.productReview))return;let e=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";"undefined"!=typeof window&&(window.sledgeProductReviewWidgetListUpdate=()=>{b(!1,!1,e)}),Boolean(y&&(null==y?void 0:y.productId)!==r)&&b(!1,!1,e),O(e)}),[l,r]),React.useEffect((()=>{if(!(null==l?void 0:l.productReview))return;let e=Boolean(y&&(null==y?void 0:y.currentPage)!==w),t=localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"";Boolean(y&&(null==y?void 0:y.isReplaceWidgetList)!==m)?b(!0,!0,t):b(!x&&e,m,t)}),[w,x,m,l,n]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-wrapper",ref:N,id:ELEMENT_ID.PRODUCT_REVIEW.ELEMENT_WIDGET,children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{params:s,isFirstLoading:a,isLoading:c,productReviewData:_,productReviewSort:h,selectedSort:j,currentPage:w,totalPage:f,totalData:A,dataSettings:L,setIsLoading:u,setIsRefreshWidgetList:p,setIsReplaceWidgetList:g,setSelectedSort:v,setCurrentPage:T,onAfterAddReview:i,widgetWrapperRef:N,data:n,LinkComponent:o})))})})},Widget$1=({children:e})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(e)&&React.Children.map(e,(e=>React.cloneElement(e,{})))});Widget$1.Root=WidgetRoot$1,Widget$1.Header=WidgetHeader$1,Widget$1.List=WidgetList$1;const WidgetPopupDetail=()=>{var e,t,s;const[i,n]=React.useState(!1),[o,r]=React.useState(""),[l,a]=React.useState(""),[d,c]=React.useState(""),[u,x]=React.useState(""),[p,m]=React.useState([]),[g,_]=React.useState([]),[R,h]=React.useState(""),[E,j]=React.useState(""),[v,w]=React.useState(!1),[T,f]=React.useState(""),[S,A]=React.useState({}),[C,L]=React.useState(0),[I,N]=React.useState({}),{text_color:y,border_color:b,border_radius:O,padding_top:D,padding_bottom:$,padding_left:P,padding_right:U,background_color:W,font_size:k,font_weight:M,text_transform:B}=(null==(t=null==(e=null==S?void 0:S.display)?void 0:e.widget)?void 0:t.verified)||{},{verified:F}=(null==(s=null==S?void 0:S.languages)?void 0:s.widget)||{},H={...y&&{color:y},...b&&{borderWidth:"1px",borderStyle:"solid",borderColor:b},...O&&{borderRadius:O},...D&&{paddingTop:D},...$&&{paddingBottom:$},...P&&{paddingLeft:P},...U&&{paddingRight:U},...W&&{backgroundColor:W},...k&&{fontSize:k},...M&&{fontWeight:M},...B&&{textTransform:B}},G=0===C,V=C===(null==p?void 0:p.length)-1;return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetPopupDetail=e=>{var t,s,i,o;const{user:{name:l},review:{rating:d,title:u,review:p,media:g,reply:R,is_verified:E},created_at:v,settings:T}=e,{name:S,image:C}=(null==(s=null==(t=null==T?void 0:T.display)?void 0:t.widget)?void 0:s.replier)||{};r(l),a(d),c(u),x(p),m(g),_(R),h(S?String(String(S).includes("<span>")?String(S).split("<span>")[0]:String(S)).replaceAll(OBJECT_DATA_STRING_KEY.STORE.NAME,null==(i=R[0])?void 0:i.name):null==(o=R[0])?void 0:o.name),j(S?getTextBetween("<span>","</span>",S):"Admin"),w(E),f(new Intl.DateTimeFormat("en-US").format(new Date(v))),n(!0),A(T),L(0),N({name:S,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:()=>L(C-1),children:jsxRuntimeExports.jsx(ChevronArrowLeftIcon,{width:16,height:16,color:"white"})}),!V&&jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-media-nav-item sledge-product-review__widget-popup-media-nav-item-next",onClick:()=>L(C+1),children:jsxRuntimeExports.jsx(ChevronArrowRightIcon,{width:16,height:16,color:"white"})})]})]}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-no-media",children:"No Media Upload"})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-heading",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-title",children:o}),v?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-verified-text",style:H,children:F}):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,{value:l,size:"sm",withSkeletonLoading:!1,isScrollToElementWidget:!1})}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-date",children:T})]}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-title-description",children:d}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-content-description",children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-popup-content-message",dangerouslySetInnerHTML:{__html:u}}),(null==g?void 0:g.length)?jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-popup-reply-wrapper",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-review-card-reply-title",children:[jsxRuntimeExports.jsx("img",{src:(null==I?void 0:I.image)||"",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:E})]}),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}=React.useContext(SledgeContext),[o,r]=React.useState(!1),[l,a]=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}]),[d,c]=React.useState(l[0]),[u,x]=React.useState(!1),[p,m]=React.useState(null),[g,_]=React.useState(!1),[R,h]=React.useState(!1),[E,j]=React.useState(!1),[v,w]=React.useState(null),[T,f]=React.useState({}),[S,A]=React.useState({onAfterAddReview:e=>{}}),[C,L]=React.useState(""),[I,N]=React.useState(""),[y,b]=React.useState(""),[O,D]=React.useState(""),[$,P]=React.useState(""),[U,W]=React.useState(0),[k,M]=React.useState(""),[B,F]=React.useState(""),[H,G]=React.useState([]),[V,Y]=React.useState([]),{title_added_to_review:K,text_added_to_review:q}=(null==(e=null==T?void 0:T.languages)?void 0:e.notification)||{},{title_confirm_add_review:z,text_confirm_add_review:J,button_submit_confirm_add_review:Z,button_cancel_confirm_add_review:X}=(null==(t=null==T?void 0:T.languages)?void 0:t.popup)||{},{navigation_previous:Q,navigation_next:ee,button_submit:te}=(null==(s=null==T?void 0:T.languages)?void 0:s.write_review_form)||{},se=async()=>{let e;_(!0);let t=!1;if(e=await addReview({userFirstName:C,userLastName:I,userEmail:y,productId:O,productVariantId:$,rating:U,title:k,review:B,mediaIds:H}),!e)return;const{status:{code:s}}=e;t=200===s,t?(S.onAfterAddReview("success"),setTimeout((()=>{_(!1),r(!1),c(l[0]),L(""),N(""),b(""),W(0),M(""),F(""),G([]),Y([]),ne&&ne(),"undefined"!=typeof window&&(window.sledgeProductReviewRatingUpdate&&window.sledgeProductReviewRatingUpdate(),window.sledgeProductReviewWidgetListUpdate&&window.sledgeProductReviewWidgetListUpdate(),window.sledgeProductReviewWidgetSummaryUpdate&&window.sledgeProductReviewWidgetSummaryUpdate(),window.sledgeToastNotification&&window.sledgeToastNotification({title:K,message:q,type:"success",icon:jsxRuntimeExports.jsx(StarIcon,{width:40,height:40,color:"black"})}))}),500)):(S.onAfterAddReview("failed"),_(!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"})}))},ie=()=>{const e=l.findIndex((e=>e.key===d.key));a((e=>e.map((e=>(e.key===d.key&&(e.isDone=!0),e))))),c(l[e+1])},ne=async()=>{let e,t=!1,s=[],i=[];if(e=await getReviewMedia(),!e)return;const{status:n,data:o}=e,{code:r}=n;t=200===r||!1,s=(null==o?void 0:o.ids)||[],i=(null==o?void 0:o.media)||[],t&&(G(s),Y(i),h(!1),j(!1),w(null))},oe=()=>{"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:z,message:J,textSubmit:Z,textCancel:X,buttonSubmitType:"success",onSubmit:se||{}})};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeProductReviewWidgetFormAdd=(e,t)=>{const{productId:s,productVariantId:i}=e||{};r(!0),D(s||""),P(i||""),t&&A({onAfterAddReview:t})}),(async e=>{let t;t=JSON.parse(e),t&&(f(t),await ne())})(localStorage.getItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING)||"")}),[]),React.useEffect((()=>{c(l[0])}),[n]),React.useEffect((()=>{switch(null==d?void 0:d.key){case"Step_SelectRate":x(!!U),m(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:ee}),jsxRuntimeExports.jsx(ArrowRightIcon,{width:18,height:18,color:"black"})]}));break;case"Step_WriteReview":x(!0),m(n?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:ee}),jsxRuntimeExports.jsx(ArrowRightIcon,{width:18,height:18,color:"black"})]}):te);break;case"Step_PersonalData":x(!0),m(te)}}),[d,U,B,C,y,n]),React.useEffect((()=>{o?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[o]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:o,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==d?void 0:d.key)?ie():n&&"Step_WriteReview"===(null==d?void 0:d.key)?ie&&ie():oe&&oe()})(e),"data-active-step":(null==d?void 0:d.key)||"","data-visible-next":u,children:[jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-add-step",children:(null==d?void 0:d.component)&&React.cloneElement(jsxRuntimeExports.jsx(d.component,{}),{steps:l,activeStep:d,isLoadingAddReview:g,isLoadingUploadMedia:R,isLoadingDeleteMedia:E,selectedDeleteMediaId:v,dataSettings:T,postUserFirstName:C,postUserLastName:I,postUserEmail:y,postRating:U,postReview:B,postMedia:V,setIsLoadingUploadMedia:h,setIsLoadingDeleteMedia:j,setSelectedDeleteMediaId:w,handleNext:ie,handleProductReviewMedia:ne,handleAddReview:se,setPostUserFirstName:L,setPostUserLastName:N,setPostUserEmail:b,setPostRating:W,setPostTitle:M,setPostReview:F,confirmAddReview:oe})}),jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-add-step-navigator",children:[(null==(i=l[0])?void 0:i.key)===(null==d?void 0:d.key)?jsxRuntimeExports.jsx("span",{}):jsxRuntimeExports.jsx("span",{onClick:()=>{const e=l.findIndex((e=>e.key===d.key));0!==e&&(a((e=>e.map((e=>(e.key===d.key&&(e.isDone=!1),e))))),c(l[e-1]))},children:Q}),u&&jsxRuntimeExports.jsx($d94698215c4408a7$export$2c4cf1f7b42ef78c,{asChild:!0,disabled:g,children:jsxRuntimeExports.jsx(Button,{role:"button",colorType:"light",style:{...g&&{cursor:"wait"}},children:g?"Adding...":p})})]})]})})]})})},Step_SelectRate=e=>{var t,s,i,n;const{postRating:o,setPostRating:r,setPostTitle:l,dataSettings:a}=e,{text_color:d,border_color:c,border_radius:u,padding_top:x,padding_bottom:p,padding_left:m,padding_right:g,background_color:_,selected_background_color:R,font_size:h,font_weight:E,text_transform:j}=(null==(s=null==(t=null==a?void 0:a.display)?void 0:t.write_review_form)?void 0:s.button_select_rating)||{},{title:v,ratings:w}=(null==(n=null==(i=null==a?void 0:a.languages)?void 0:i.write_review_form)?void 0:n.select_rating)||{},{rating_5:T,rating_4:f,rating_3:S,rating_2:A,rating_1:C}=w||{},L={...d&&{color:d},...c&&{borderColor:c},...u&&{borderRadius:u},...x&&{paddingTop:x},...p&&{paddingBottom:p},...m&&{paddingLeft:m},...g&&{paddingRight:g},...h&&{fontSize:h},...E&&{fontWeight:E},...j&&{textTransform:j}},I=[{rate:5,title:T},{rate:4,title:f},{rate:3,title:S},{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:v}),jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-select-rate-list",children:I.map(((e,t)=>jsxRuntimeExports.jsxs("button",{type:"button",className:`sledge-product-review__widget-form-select-rate-list-item ${e.rate===o&&"selected"}`,onClick:()=>{return t=e.rate,s=e.title,r&&r(t),void(l&&l(s));var t,s},style:{...L,..._&&R?{backgroundColor:e.rate===o?R:_}:{}},children:[jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{productReview:!0}},children:jsxRuntimeExports.jsx(Rating,{value:e.rate,size:"md",withSkeletonLoading:!1,isScrollToElementWidget:!1})})," ",jsxRuntimeExports.jsx("span",{className:"sledge-product-review__widget-form-select-rate-text",children:e.title})]},t)))})]})},Step_WriteReview=e=>{var t;const{isLoadingUploadMedia:s,isLoadingDeleteMedia:i,selectedDeleteMediaId:n,dataSettings:o,postMedia:r,postReview:l,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:h}=_||{},[E,j]=React.useState(!1),v=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((()=>{j(!1)}),[]),React.useEffect((()=>{n&&E&&(j(!1),"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Are you sure want to delete this media?",message:"This action cannot be undone. This will permanently delete this media.",textSubmit:"Delete",textCancel:"Cancel",buttonSubmitType:"danger",onSubmit:v||{}}))}),[n,E]);const w=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:r}=t||{},{code:l}=o||{};s=200===l,i=(null==r?void 0:r.ids)||[],n=(null==r?void 0:r.media)||[],s?(p&&p(i),m&&m(n),x&&x(),"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Media added",message:"successfully added to media",type:"success",icon:jsxRuntimeExports.jsx(UploadIcon,{width:40,height:40,color:"black"})})):(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:h,value:l,onChange:e=>g&&g(e.target.value)}),(null==r?void 0:r.length)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-product-review__widget-form-upload-media-filled",children:[r.map(((e,t)=>{const{id:s,file:o,type:r}=e;let l=i&&s==n;return jsxRuntimeExports.jsxs(motion.div,{initial:"hidden",animate:"visible",variants:VISIBLE_ANIMATION,className:"sledge-product-review__widget-form-upload-media-filled-item",children:[l?jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-loading",children:"Deleting..."}):jsxRuntimeExports.jsx("div",{className:"sledge-product-review__widget-form-upload-media-delete-item",onClick:()=>{j(!0),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"===r?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:!l,className:"sledge-product-review__widget-form-upload-media-filled-item-file",children:jsxRuntimeExports.jsx("source",{src:o})})]},t)})),w]})}):w]})},Step_PersonalData=e=>{var t;const{dataSettings:s,postUserFirstName:i,postUserLastName:n,postUserEmail:o,setPostUserFirstName:r,setPostUserLastName:l,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=>r&&r(e.target.value),value:i}),jsxRuntimeExports.jsx(InputField,{name:"userLastName",type:"text",required:!0,placeholder:x,onChange:e=>l&&l(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=document.querySelector(SELECTOR.PRODUCT_REVIEW.ELEMENT_WIDGET);detectInitSelector(element,(()=>{if(element){const PRODUCT_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),ON_AFTER_ADD_REVIEW=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_REVIEW);element.innerHTML="",client.createRoot(element).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=>{element&&ON_AFTER_ADD_REVIEW&&eval(ON_AFTER_ADD_REVIEW)&&eval(ON_AFTER_ADD_REVIEW)({element:element,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=document.querySelector(SELECTOR.INSTANT_SEARCH.ELEMENT_PLP_WIDGET);detectInitSelector(element,(()=>{var _a;if(element){const QUERY_KEYWORD=element.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.QUERY_KEYWORD),COLLECTION_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.COLLECTION_ID),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD);client.createRoot(element).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)||""},onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null})})})}))}}))},SearchIconWidget=e=>{const{isRenderApp:t,isJsVersion:s}=React.useContext(SledgeContext),{size:i="sm",children:n,onAfterAddToCart:o,onAfterAddWishlist:r,onAfterRemoveWishlist:l,onAfterRenderProduct:a}=e||{};let d=null,c=null,u=null,x=null;React.Children.map(n,(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)&&(d=t),s&&isFunction(s)&&(c=s),i&&isFunction(i)&&(u=i),n&&isFunction(n)&&(x=n)}}));const[p,m]=React.useState({width:0,height:0});React.useEffect((()=>{(null==t?void 0:t.instantSearch)&&m("xs"===i?{width:14,height:14}:"sm"===i?{width:20,height:20}:{width:25,height:25})}),[t]);return jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__icon-widget",onClick:()=>{"undefined"!=typeof window&&window.sledgeInstantSearchIconWidgetPopup&&window.sledgeInstantSearchIconWidgetPopup({onAfterAddToCart:o,onAfterAddWishlist:r,onAfterRemoveWishlist:l,onAfterRenderProduct:a,isJsVersion:s,productCardsComponent:d,suggestionKeywordListsComponent:c,otherIndexListsComponent:u,searchViewMoreResultComponent:x})},children:jsxRuntimeExports.jsx(SearchIcon,{...p,color:"currentColor"})})},fetchApi=async(e,t,s)=>{let i=localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_AUTH_APP);var n=new Headers;n.append("Authorization",`Bearer ${i}`),n.append("Content-Type","application/json");var o={method:t,headers:n,redirect:"follow",...s&&{body:JSON.stringify(s)}};return await fetch(`${INSTANT_SEARCH_ENGINE_URL}${e}`,o).then((e=>e.json())).then((e=>e)).catch((()=>{}))},search=async(e,t)=>await fetchApi(`/indexes/${e}/search`,"POST",t),multiSearch=async e=>await fetchApi("/multi-search","POST",e),searchTrigger=async e=>{const{keyword:t,resultCount:s}=e;let i=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var n=new Headers;n.append("Authorization",`Bearer ${i}`),n.append("Content-Type","application/json");var o={method:"POST",headers:n,body:JSON.stringify({keyword:t,result_count:s}),redirect:"follow"};return await fetch(`${API_URL}/instantsearch/statistics/search`,o).then((e=>e.json())).then((e=>e)).catch((()=>{}))},productClickTrigger=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${s}`),i.append("Content-Type","application/json");var n={method:"POST",headers:i,body:JSON.stringify({product:{id:sanitizeDataId(t)}}),redirect:"follow"};return await fetch(`${API_URL}/instantsearch/statistics/click`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addToCartTrigger$1=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${s}`),i.append("Content-Type","application/json");var n={method:"POST",headers:i,body:JSON.stringify({product:{id:sanitizeDataId(t)}}),redirect:"follow"};return await fetch(`${API_URL}/instantsearch/statistics/cart`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},OtherIndexLists=({listsComponent:e,name:t,items:s,isComponentJsVersion:i,showPopupComponent:n,setShowPopupComponent:o})=>{const r=e?e({name:t,items:s,showPopupComponent:n,setShowPopupComponent:o}):null;return e?i?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:r}}):r: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,r,l,a,d,c,u,x,p,m,g,_,R,h,E,j,v;const[w,T]=React.useState(!0),[f,S]=React.useState(!1),[A,C]=React.useState(""),[L,I]=React.useState(""),[N,y]=React.useState([]),[b,O]=React.useState([]),[D,$]=React.useState([]),[P,U]=React.useState([]),[W,k]=React.useState({}),[M,B]=React.useState({}),[F,H]=React.useState(""),[G,V]=React.useState({onAfterAddToCart:e=>{},onAfterAddWishlist:e=>{},onAfterRemoveWishlist:e=>{},onAfterRenderProduct:e=>{},isJsVersion:null,productCardsComponent:null,suggestionKeywordListsComponent:null,otherIndexListsComponent:null,searchViewMoreResultComponent:null}),Y=React.useRef(null),K=usePrevious({keyword:A}),q=async(e,t=!1)=>{var s,i,n,o,r,l,a,d,c,u,x;if(!f)return;T(!0);const{tabs:p,suffix_index_product:m,hidden_tags:g,display:_}=e,R=(null==(s=null==_?void 0:_.search)?void 0:s.suggestion)||{};let h,E={queries:p.map((e=>{var t;const{index:s}=e;let i=s.includes(m),n=[];return(null==g?void 0:g.length)&&n.push(`tags NOT IN [${g}]`),(null==(t=null==_?void 0:_.filter)?void 0:t.show_out_of_stock)||n.push("variants.inventory_quantity > 0"),{indexUid:s,q:A,hitsPerPage:i?6:4,filter:i?n.join(" AND "):""}}))};if(h=await multiSearch(E),!h)return;const{results:j}=h;let v=null==j?void 0:j.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));t&&(null==A?void 0:A.length)&&searchTrigger({keyword:A,resultCount:(null==(i=v[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==v?void 0:v.length)?null==(o=v[0])?void 0:o.hits:[],C=A.length?(null==S?void 0:S.length)?"":"no_result":"zero_character",L=Boolean(!A.length&&Object.keys(R).length&&(null==(l=null==(r=R[C])?void 0:r.products)?void 0:l.active)&&(null==(c=null==(d=null==(a=R[C])?void 0:a.products)?void 0:d.list)?void 0:c.length));y(L?null==(x=null==(u=R[C])?void 0:u.products)?void 0:x.list:S),O(w),H(C),T(!1)};return React.useEffect((()=>{"undefined"!=typeof window&&(window.sledgeInstantSearchIconWidgetPopup=({onAfterAddToCart:e=(()=>{}),onAfterAddWishlist:t=(()=>{}),onAfterRemoveWishlist:s=(()=>{}),onAfterRenderProduct:i=(()=>{}),isJsVersion:n=null,productCardsComponent:o=(()=>{}),suggestionKeywordListsComponent:r=(()=>{}),otherIndexListsComponent:l=(()=>{}),searchViewMoreResultComponent:a=(()=>{})})=>{S(!0),V({onAfterAddToCart:e,onAfterAddWishlist:t,onAfterRemoveWishlist:s,onAfterRenderProduct:i,isJsVersion:n,productCardsComponent:o,suggestionKeywordListsComponent:r,otherIndexListsComponent:l,searchViewMoreResultComponent:a}),setTimeout((()=>{(null==Y?void 0:Y.current)&&(Y.current.focus(),Y.current.value=A)}),500)}),(async e=>{var t;if(!f)return;let s;if(s=JSON.parse(e),!s)return;const{tabs:i,suffix_index_product:n,hidden_tags:o,display:r}=s;$(i),I(n),U(o),k(r),B(null==(t=null==r?void 0:r.search)?void 0:t.suggestion),await q(s)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||""),f?document.body.classList.add("sledge__open-popup-state"):document.body.classList.remove("sledge__open-popup-state")}),[f]),React.useEffect((()=>{if(Boolean(K&&(null==K?void 0:K.keyword)!==A)){const e=setTimeout((()=>{q({tabs:D,suffix_index_product:L,hidden_tags:P,display:W},!0)}),500);return()=>clearTimeout(e)}}),[A]),jsxRuntimeExports.jsx($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9,{open:f,onOpenChange:S,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==W?void 0:W.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:A,fieldRef:Y,onChange:({value:e})=>C(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:w?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:"grey-100",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:"grey-100",rounded:"md",animationDuration:"13s",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(M).length&&(null==(s=null==(t=M[F])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=M[F])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:G.suggestionKeywordListsComponent,keywords:M[F].keywords.list,isComponentJsVersion:G.isJsVersion,showPopupComponent:f,setShowPopupComponent:S}):null,b&&b.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:G.otherIndexListsComponent,name:i,items:s,isComponentJsVersion:G.isJsVersion,showPopupComponent:f,setShowPopupComponent:S})},t)}))]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__icon-widget-search-form-result-flex-item-product",children:[(null==N?void 0:N.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-search-form-result-product",children:jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:N.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(r=null==W?void 0:W.search)?void 0:r.show_vendor,show_sku:null==(l=null==W?void 0:W.search)?void 0:l.show_sku,show_price:null==(a=null==W?void 0:W.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:G.isJsVersion,cards:G.productCardsComponent,onAfterAddToCart:G.onAfterAddToCart,onAfterAddWishlist:G.onAfterAddWishlist,onAfterRemoveWishlist:G.onAfterRemoveWishlist,onAfterRenderProduct:G.onAfterRenderProduct,showPopupComponent:f,setShowPopupComponent:S})}):Object.keys(M).length&&(null==(c=null==(d=M[F])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=M[F])?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:A}),". Did you mean:"]}),jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"medium",data:M[F].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==W?void 0:W.search)?void 0:m.show_vendor,show_sku:null==(g=null==W?void 0:W.search)?void 0:g.show_sku,show_price:null==(_=null==W?void 0:W.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:G.isJsVersion,cards:G.productCardsComponent,onAfterAddToCart:G.onAfterAddToCart,onAfterAddWishlist:G.onAfterAddWishlist,onAfterRemoveWishlist:G.onAfterRemoveWishlist,onAfterRenderProduct:G.onAfterRenderProduct,showPopupComponent:f,setShowPopupComponent:S})]}):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(M).length&&(null==(h=null==(R=M[F])?void 0:R.products)?void 0:h.active)&&(null==(v=null==(j=null==(E=M[F])?void 0:E.products)?void 0:j.list)?void 0:v.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__icon-widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:G.searchViewMoreResultComponent,keyword:A,isComponentJsVersion:G.isJsVersion,showPopupComponent:f,setShowPopupComponent:S})}):null]})]})})})})]})]})})},SearchIconWidgetInitSelector=()=>{let element=document.querySelector(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET);detectInitSelector(element,(()=>{var _a,_b,_c,_d;if(element){const ICON_SIZE=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ICON_SIZE),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=element.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=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);element.innerHTML="",client.createRoot(element).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",onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{suggestionKeywordList:SUGGESTION_KEYWORD_LISTS?eval(SUGGESTION_KEYWORD_LISTS):null,otherIndexList:OTHER_INDEX_LISTS?eval(OTHER_INDEX_LISTS):null,productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null,searchViewMoreResult:SEARCH_VIEW_MORE_RESULT?eval(SEARCH_VIEW_MORE_RESULT):null})})})}))}}))},SearchIconWidgetPopupInitSelector=()=>{let e=document.createElement("div");e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.INSTANT_SEARCH.ELEMENT_SEARCH_ICON_WIDGET_POPUP),document.body.appendChild(e),e&&(e.innerHTML="",client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(SearchIconWidgetPopup,{})})})))},SearchResultWidget=e=>{var t,s,i,n,o,r,l,a,d,c;const{isRenderApp:u,isJsVersion:x}=React.useContext(SledgeContext),{layoutType:p="default",query:m,params:g,children:_,onAfterAddToCart:R,onAfterAddWishlist:h,onAfterRemoveWishlist:E,onAfterRenderProduct:j}=e,{keyword:v=""}=m||{},{collectionId:w}=g||{};let T=null;React.Children.map(_,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(T=t)}}));const[f,S]=React.useState(!0),[A,C]=React.useState(!0),[L,I]=React.useState(""),[N,y]=React.useState(null),[b,O]=React.useState(),[D,$]=React.useState(jsxRuntimeExports.jsx(ResultProduct,{})),[P,U]=React.useState(!0),[W,k]=React.useState([]),[M,B]=React.useState([]),[F,H]=React.useState([]),[G,V]=React.useState([]),[Y,K]=React.useState(""),[q,z]=React.useState({}),[J,Z]=React.useState([]),[X,Q]=React.useState({}),[ee,te]=React.useState([]),[se,ie]=React.useState(""),[ne,oe]=React.useState(!1),re=React.useRef(null),le=usePrevious({keyword:L}),ae=async(e,t)=>{const{filters:s,tabs:i,suffix_index_product:n,hidden_tags:o,display:r,show_out_of_stock:l}=e;let a,d={queries:("product-filter"===p?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 w&&(null==t?void 0:t.includes(Number(w)))||(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"),w&&u.push(`collections.id = '${w}'`),c&&V(a[0]),{indexUid:i,q:"default"===t?"":L,hitsPerPage:1,facets:c?a[0]:[],filter:d?u.join(" AND "):""}}))};if(a=await multiSearch(d),!a)return;const{results:c}=a;if(S(!1),U(!1),C(!1),"totalDataPerIndex"===t)H(null==i?void 0:i.map((e=>{const{index:t}=e,{totalHits:s}=(null==c?void 0:c.find((({indexUid:e})=>e===t)))||{};return{...e,total:s}})));else{const{facetDistribution:e,facetStats:t}=(null==c?void 0:c.find((({indexUid:e})=>e.includes(n))))||{};z(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(!(null==u?void 0:u.instantSearch))return;const e=new URLSearchParams(document.location.search);I((null==e?void 0:e.get(v))||""),(async e=>{let t,s;if(U(!0),t=JSON.parse(e),!t)return;const{allowed_sorts:i,default_sort:n,filters:o,tabs:r,suffix_index_product:l,hidden_tags:a,display:d,colors:c,show_out_of_stock:u}=t;k((null==i?void 0:i.length)?i:[]),B((null==o?void 0:o.length)?o:[]),K(l),Z(a),Q(d),te(c),ie(n),oe(u),s=r.find((({index:e})=>e.includes(l))),Object.keys(s).length&&(y(s.index),O(s.name)),await ae(t,"default"),"default"===p&&await ae(t,"totalDataPerIndex")})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"")}),[u]),React.useEffect((()=>{if(Boolean(le&&(null==le?void 0:le.keyword)!==L)&&"default"===p){const e=setTimeout((()=>{ae({filters:M,tabs:F,suffix_index_product:Y,hidden_tags:J,display:X,colors:ee,show_out_of_stock:ne},"totalDataPerIndex")}),500);return()=>clearTimeout(e)}}),[L]);const de="default"===p?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:"grey-100",animationDuration:"15s"},e)))}):null,ce=(null==(t=null==X?void 0:X.filter)?void 0:t.enable_on_search)&&"horizontal"===(null==(s=null==X?void 0:X.filter)?void 0:s.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:"grey-100",animationDuration:"13s"},e)))}):null,ue=(null==(i=null==X?void 0:X.filter)?void 0:i.enable_on_search)&&"vertical"===(null==(n=null==X?void 0:X.filter)?void 0:n.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:"grey-100",rounded:"md",animationDuration:"15s"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"15s"})]}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"18px"}}),[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"18px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"14px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"17px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"38px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"35px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"20px"}}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"270px",marginBottom:"12px"}}),[1,2,3].map((e=>jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"163px",marginBottom:"9px"}},e))),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"28px",color:"grey-100",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:"grey-100",rounded:"full",animationDuration:"40s"},e)))})]}):null,xe=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(o=null==X?void 0:X.filter)?void 0:o.show_total_products)&&"vertical"===(null==(r=null==X?void 0:X.filter)?void 0:r.layout)?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"21px"}}):null,jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:12,type:"large"})]}),pe=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:[(null==(l=null==X?void 0:X.filter)?void 0:l.show_total_products)&&"horizontal"===(null==(a=null==X?void 0:X.filter)?void 0:a.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:"grey-100",rounded:"md",animationDuration:"13s"})}):null,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-keyword-form",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"42px",color:"grey-100",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:"grey-100",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:"grey-100",rounded:"lg"})})]})]});return jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-container",ref:re,children:[f?null:jsxRuntimeExports.jsx("div",{className:""+("default"===p&&(null==F?void 0:F.length)?"sledge-instant-search__result-tab":"sledge-instant-search__result-tab-no-index"),children:"default"===p&&(null==F?void 0:F.length)?jsxRuntimeExports.jsx("ul",{className:"sledge-instant-search__result-tab-list",children:F.map((e=>{const{name:t,index:s,total:i}=e;let n=N===s;return jsxRuntimeExports.jsxs("li",{onClick:e=>((e,t,s)=>{y(e),O(t),$(e.includes(Y)?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}),f&&(null==p?void 0:p.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[de,ce,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-wrapper sledge-instant-search__result-wrapper-skeleton",children:[(null==(d=null==X?void 0:X.filter)?void 0:d.enable_on_search)&&"vertical"===(null==(c=null==X?void 0:X.filter)?void 0:c.layout)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:ue}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[pe,xe]})]})]}):React.cloneElement(D,{isLoading:A,keyword:L,clickedTabIndexId:N,clickedTabIndexName:b,isLoadingSetting:P,allowedSorts:W,allowedFilters:M,facets:G,searchResultFacets:q,hiddenTags:J,displaySettings:X,colorSwatches:ee,defaultSort:se,showOutOfStock:ne,query:m,params:g,isJsVersion:x,productCardsComponent:T,onAfterAddToCart:R,onAfterAddWishlist:h,onAfterRemoveWishlist:E,onAfterRenderProduct:j,setIsLoading:C,setKeyword:I,filterHorizontalSkeleton:ce,filterVerticalSkeleton:ue,productGridSkeleton:xe,searchAndSelectOptionSkeleton:pe,searchResultContainerRef:re})]})},ResultProduct=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,h,E,j;const{keyword:v,clickedTabIndexId:w,isLoadingSetting:T,allowedSorts:f,allowedFilters:S,facets:A,searchResultFacets:C,hiddenTags:L,displaySettings:I,colorSwatches:N,defaultSort:y,showOutOfStock:b,query:O,params:D,isJsVersion:$,productCardsComponent:P,setKeyword:U,filterHorizontalSkeleton:W,filterVerticalSkeleton:k,productGridSkeleton:M,searchAndSelectOptionSkeleton:B,onAfterAddToCart:F,onAfterAddWishlist:H,onAfterRemoveWishlist:G,onAfterRenderProduct:V,searchResultContainerRef:Y}=e||{},{keyword:K=""}=O||{},{collectionId:q}=D||{},[z,J]=React.useState(!0),[Z,X]=React.useState(!0),[Q,ee]=React.useState(!1),[te,se]=React.useState(!1),[ie,ne]=React.useState(y||""),[oe,re]=React.useState(f&&Boolean(null==f?void 0:f.length)?null==(t=f.find((({value:e})=>e===y)))?void 0:t.label:""),[le,ae]=React.useState((null==(s=null==I?void 0:I.search)?void 0:s.limit)||10),[de,ce]=React.useState(null),[ue,xe]=React.useState({...b?{}:{"variants.inventory_quantity":"> 0"}}),[pe,me]=React.useState(!1),[ge,_e]=React.useState([]),[Re,he]=React.useState(0),[Ee,je]=React.useState(1),[ve,we]=React.useState(0),[Te,fe]=React.useState(0),[Se,Ae]=React.useState([]),[Ce,Le]=React.useState([]),[Ie,Ne]=React.useState(!1),[ye,be]=React.useState(null),Oe=usePrevious({keyword:v,clickedLimitId:le,clickedFacets:ue}),{color:De,font_size:$e,font_weight:Pe,text_transform:Ue}=(null==(i=null==I?void 0:I.filter)?void 0:i.title)||{},{color:We,font_size:ke,font_weight:Me,text_transform:Be}=(null==(n=null==I?void 0:I.filter)?void 0:n.option)||{},{text_color:Fe,border_color:He,border_radius:Ge,padding_top:Ve,padding_bottom:Ye,padding_left:Ke,padding_right:qe,background_color:ze,font_size:Je,font_weight:Ze,text_transform:Xe}=(null==(o=null==I?void 0:I.filter)?void 0:o.button)||{},Qe={...De&&{color:De},...$e&&{fontSize:$e},...Pe&&{fontWeight:Pe},...Ue&&{textTransform:Ue}},et={...We&&{color:We},...ke&&{fontSize:ke},...Me&&{fontWeight:Me},...Be&&{textTransform:Be}},tt=e=>{var t;const s=new URLSearchParams(document.location.search),i=Object.fromEntries(s);let n={};for(const r in i){(null==A?void 0:A.length)&&!A.includes(r)&&(n[r]=i[r])}for(const r in e)(null==(t=e[r])?void 0:t.length)&&(n[r]=e[r]);const o=new URLSearchParams({...n}).toString();window.history.pushState(null,"",`${document.location.pathname}${(null==o?void 0:o.length)?`?${o}`:""}`)},st=e=>{ce(e===de?"":e)},it=()=>{Ne(!0),xe({}),me(!pe),tt({}),Ae([]),setTimeout((()=>{Ne(!1)}),10)},nt=(e,t,s=!1)=>{var i;Ne(!0);let n=[t],o=["variants.price"].includes(e);ue&&(s?n=[t]:(null==(i=ue[e])?void 0:i.includes(t))?n=ue[e].filter((e=>e!==t)):o?(ue[e],ue[e]===t?(n=[],Ae([])):n=t):n=ue[e]?[...ue[e],t]:[t]);let r={...ue,[e]:n};tt(r),xe(r),me(!pe),setTimeout((()=>{Ne(!1)}),10)},ot=async(e=!1,t=!1)=>{if(!w)return;e&&je(1),X(!0);let s,i=(e=>{const t=new URLSearchParams(document.location.search),s=Object.fromEntries(t);for(const i in s)(null==A?void 0:A.length)&&A.includes(i)&&(e[i]=s[i].split(","));return Object.keys(e).length&&xe(e),e})(ue),n=Object.entries(i).map((e=>{var t,s;if((null==e?void 0:e.length)&&e[1].length){let i=e[0],n=["variants.inventory_quantity"].includes(i),o=["variants.price"].includes(i),r=["tags"].includes(i);return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?o?`${i} >= ${e[1][0]} AND ${i} <= ${e[1][1]}`:r?`${i} IN [${e[1]}]`:null==(s=e[1])?void 0:s.map((e=>n?`${i} ${e}`:`${i} = '${e}'`)).join(" OR "):n?`${i} ${e[1]}`:r?`${i} IN [${e[1]}]`:`${i} = '${e[1]}'`}return null})).filter((e=>e));(null==L?void 0:L.length)&&n.push(`tags NOT IN [${L}]`),q&&n.push(`collections.id = '${q}'`);let o={q:v,sort:ie?[ie]:[],page:e?1:Ee,hitsPerPage:le,facets:A,filter:n.join(" AND ")};s=await search(w,o),((e,t)=>{var s;if(!e)return;const{hits:i,processingTimeMs:n,totalHits:o,totalPages:r}=e;t&&(null==v?void 0:v.length)&&searchTrigger({keyword:v,resultCount:o||0}),J(!1),X(!1),_e(i),he(n||0),we(r),fe(o||0),be(jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary-item",children:(null==(s=null==I?void 0:I.filter)?void 0:s.show_total_products)?jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text",children:[o," result"," ",(null==v?void 0:v.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["for ",jsxRuntimeExports.jsxs("span",{className:"sledge-instant-search__result-data-summary-text-keyword",children:['"',v,'"']})]}):null]}):null}))})(s,t)},rt=e=>{const t=new URLSearchParams(document.location.search);t.set(K,e),U&&U(e),window.history.pushState(null,"",`${document.location.pathname}?${t.toString()}`)};React.useEffect((()=>{let e=Boolean(Oe&&((null==Oe?void 0:Oe.keyword)!==v||(null==Oe?void 0:Oe.clickedLimitId)!==le||(null==Oe?void 0:Oe.clickedFacets)!==ue));if(Boolean(Oe&&(null==Oe?void 0:Oe.keyword)!==v)){const e=setTimeout((()=>{ot(!0,!0)}),500);return()=>clearTimeout(e)}ot(e)}),[ie,le,pe,v,Ee,w]),React.useEffect((()=>{(()=>{var e,t;if(!(null==(e=null==I?void 0:I.filter)?void 0:e.enable_on_search)||(null==(t=null==I?void 0:I.filter)?void 0:t.hide_when_one_value)&&Te<=1)return;let s=!1;s||null==S||S.map((e=>{const{collections:t,items:i}=e;(q&&(null==t?void 0:t.includes(Number(q)))||(null==t?void 0:t.includes("all")))&&(s=!0,Le(i))}))})()}),[S,C,Te]);const lt=({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:et,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:()=>nt(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)},at=e=>{var t,s;const{value:i,label:n,display:o}=e;let r=null,l=C[i],a=null==(t=null==I?void 0:I.filter)?void 0:t.show_number_matching_product;return"slider"===o.toLowerCase()?r=jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-list-slider",children:[jsxRuntimeExports.jsx(Slider,{defaultValue:[Se[0]||(null==l?void 0:l.min),Se[1]||(null==l?void 0:l.max)],min:null==l?void 0:l.min,max:null==l?void 0:l.max,step:1,setValueCommit:e=>nt(i,e),setValueChange:e=>Ae(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:Se[0]||(null==l?void 0:l.min)}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-minmax-field",children:Se[1]||(null==l?void 0:l.max)})]})]}):"checkbox"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var s;return jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Checkbox,{id:`${i}_${t}`,name:i,value:e.value,label:`${e.name}${void 0!==e.total&&a?` (${e.total})`:""}`,onClick:e=>nt(i,e.currentTarget.value),defaultChecked:ue&&(null==(s=ue[i])?void 0:s.includes(e.value)),labelStyle:et})},t)}))}):"radio"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(RadioGroup,{id:i,name:i,onValueChange:e=>nt(i,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),defaultValue:ue&&(null==(s=ue[i])?void 0:s.length)?ue[i][0]:"",labelStyle:et})}):"select"===o.toLowerCase()&&(null==l?void 0:l.length)?r=jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(Select,{placeholder:`Select ${n}`,name:i,onValueChange:e=>nt(i,e,!0),items:null==l?void 0:l.map((e=>{const{name:t,value:s,total:i}=e;return{label:`${t} ${void 0!==i&&a?` (${i})`:""}`,value:s}})),labelStyle:et})}):"swatch"===o.toLowerCase()&&(null==l?void 0:l.length)&&(r=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:null==l?void 0:l.map(((e,t)=>{var s;let n=(null==N?void 0:N.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=>nt(i,e.currentTarget.value),defaultChecked:ue&&(null==(s=ue[i])?void 0:s.includes(e.value))})},t)}))})),r},dt=Ce.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=de===s,r=C[s],l=Boolean("slider"===n.toLowerCase()?r:null==r?void 0:r.length),a=["select"].includes(n.toLowerCase())&&(null==r?void 0:r.length),d=["sledge-instant-search__result-filter-item-list"],c=at(e);return"swatch"===n.toLowerCase()&&(null==r?void 0:r.length)&&d.push("sledge-instant-search__result-filter-item-color-swatches"),l?jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item",children:[jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-filter-item-title",onClick:()=>st(s),children:[jsxRuntimeExports.jsx("span",{className:"sledge-instant-search__result-filter-title",style:Qe,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:Ie?null:c})]},t):null})),ct=Ce.map(((e,t)=>{const{value:s,label:i,display:n}=e;let o=de===s,r=C[s],l=Boolean("slider"===n.toLowerCase()?r:null==r?void 0:r.length),a=["radio","select"].includes(n.toLowerCase())&&(null==r?void 0:r.length),d=["sledge-instant-search__result-filter-item-list"],c=at(e);return"swatch"===n.toLowerCase()&&(null==r?void 0:r.length)&&d.push("sledge-instant-search__result-filter-item-color-swatches"),l?jsxRuntimeExports.jsx("div",{className:"",children:jsxRuntimeExports.jsx(Popover,{trigger:jsxRuntimeExports.jsxs(Button,{type:"button",onClick:()=>st(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:Ie?null:c})}),withOpenState:!1,setIsOpen:e=>ce(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 ut=[];Object.entries(ue).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=Ce.filter((({value:e})=>null==e?void 0:e.includes(i))),r=(null==o?void 0:o.length)?o[0].label:i;return Array.isArray(e[1])&&(null==(t=e[1])?void 0:t.length)>1?n?ut.push({label:r,name:i,value:e[1]}):null==(s=e[1])?void 0:s.map((e=>{ut.push({label:r,name:i,value:e})})):ut.push({label:r,name:i,value:e[1][0]})}}));const xt=jsxRuntimeExports.jsx(Pagination,{currentPage:Ee,totalPage:ve,totalResult:Te,onChange:e=>(e=>{je(e),setTimeout((()=>{scrollToElement(Y.current,50)}),200)})(e)});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(r=null==I?void 0:I.filter)?void 0:r.enable_on_search)&&"horizontal"===(null==(l=null==I?void 0:I.filter)?void 0:l.layout)?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:z?W:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:T?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-horizontal-loading",children:W}):ct.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:ct}),Boolean((null==ut?void 0:ut.length)&&(null==(a=null==I?void 0:I.filter)?void 0:a.show_refine_by_block))?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Boolean(ut.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:it,children:"Clear All"}),ut.map(((e,t)=>{const{label:s,name:i,value:n}=e;return lt({label:s,name:i,value:n,index:t})}))]})}):null]})})}):null,jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper","data-filter-layout":null==(d=null==I?void 0:I.filter)?void 0:d.layout,children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==(c=null==I?void 0:I.filter)?void 0:c.enable_on_search)&&"vertical"===(null==(u=null==I?void 0:I.filter)?void 0:u.layout)?z?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:k}):dt.every((e=>!e))?null:jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter",children:T?k:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Boolean((null==ut?void 0:ut.length)&&(null==(x=null==I?void 0:I.filter)?void 0:x.show_refine_by_block))?Boolean(ut.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:it,children:"Clear All"})]}),jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-filter-item-refine-selected-flex",children:ut.map(((e,t)=>{const{label:s,name:i,value:n}=e;return lt({label:s,name:i,value:n,index:t})}))})]}):null,dt]})}):null,jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data",children:[z?B:jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-keyword",children:["horizontal"===(null==(p=null==I?void 0:I.filter)?void 0:p.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-horizontal",children:ye}),jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search products...",value:v,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:"}),f&&Boolean(null==f?void 0:f.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:f.map((e=>{const{label:t,value:s}=e;return{label:t,value:s}})),value:ie,onChange:({label:e,value:t})=>((e,t)=>{ee(!1),re(e),ne(t)})(e,t)})]}),jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-summary-select-field-item",children:[jsxRuntimeExports.jsx("span",{children:"Limit:"}),(null==(m=null==I?void 0:I.search)?void 0:m.allowed_limit)&&Boolean(null==(_=null==(g=null==I?void 0:I.search)?void 0:g.allowed_limit)?void 0:_.length)&&jsxRuntimeExports.jsx(SelectField,{align:"end",options:I.search.allowed_limit.map((e=>({label:e,value:e}))),value:le,onChange:({value:e})=>(e=>{se(!1),ae(e)})(e)})]})]})]}),Z?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[M,(null==ge?void 0:ge.length)?xt:null]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["vertical"===(null==(R=null==I?void 0:I.filter)?void 0:R.layout)&&jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary sledge-instant-search__result-data-summary-filter-vertical",children:ye}),(null==ge?void 0:ge.length)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"large",data:ge.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(h=null==I?void 0:I.search)?void 0:h.show_vendor,show_sku:null==(E=null==I?void 0:I.search)?void 0:E.show_sku,show_price:null==(j=null==I?void 0:I.search)?void 0:j.show_price},isComponentJsVersion:$,cards:P,showOptionOutOfStock:!0,onAfterAddToCart:F,onAfterAddWishlist:H,onAfterRemoveWishlist:G,onAfterRenderProduct:V}),xt]}):jsxRuntimeExports.jsx(ResultEmpty,{})]})]})]})})]})},ResultCategory=e=>{var t,s,i,n;const{keyword:o,clickedTabIndexId:r,clickedTabIndexName:l,setKeyword:a,searchResultContainerRef:d}=e||{},[c,u]=React.useState(!0),[x,p]=React.useState(!0),[m,g]=React.useState(""),[_,R]=React.useState([]),[h,E]=React.useState(0),[j,v]=React.useState(1),[w,T]=React.useState(0),[f,S]=React.useState(0),[A,C]=React.useState(null),L=usePrevious({keyword:o}),I=async()=>{if(!r)return;let e;p(!0);let t={q:o,sort:m?[m]:[],page:j,hitsPerPage:12};e=await search(r,t),(e=>{if(!e)return;const{hits:t,processingTimeMs:s,totalHits:i,totalPages:n}=e;u(!1),p(!1),R(t),E(s||0),T(n),S(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(L&&(null==L?void 0:L.keyword)!==o)){const e=setTimeout((()=>{I()}),500);return()=>clearTimeout(e)}I()}),[m,o,j,r]);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 ${l?l.toLowerCase():""}...`,value:o,onChange:({value:e})=>a&&a(e),onResetField:()=>a&&a(""),className:"sledge-instant-search__result-data-keyword-form",withClearField:!0})}),y=jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-summary",children:jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"117px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"18s"})}),b=(null==(t=String(r))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(SkeletonLoading.CollectionGrid,{count:3}):(null==(s=String(r))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(SkeletonLoading.PageGrid,{count:12}):(null==(i=String(r))?void 0:i.includes("blog"))||(null==(n=String(r))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(SkeletonLoading.BlogGrid,{count:12}):null,O=()=>jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__result-data-category-wrapper",children:[N,y,b]}),D=()=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[N,y,b]}),$=e=>{var t,s,i,n;return(null==(t=String(r))?void 0:t.includes("collection"))?jsxRuntimeExports.jsx(CollectionGrid,{...e}):(null==(s=String(r))?void 0:s.includes("page"))?jsxRuntimeExports.jsx(PageGrid,{...e}):(null==(i=String(r))?void 0:i.includes("blog"))||(null==(n=String(r))?void 0:n.includes("article"))?jsxRuntimeExports.jsx(BlogGrid,{...e}):null};return jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-wrapper",children:c?jsxRuntimeExports.jsx(O,{}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__result-data-category-wrapper",children:x?jsxRuntimeExports.jsx(D,{}):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($,{data:_.map((e=>{const{id:t,title:s,url:i}=e;return{id:t,title:s,description:`${s}${l?` ${l.toLowerCase()}`:""}`,url:i,image:""}}))}),jsxRuntimeExports.jsx(Pagination,{currentPage:j,totalPage:w,totalResult:f,onChange:e=>(e=>{v(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=document.querySelector(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_RESULT_WIDGET);detectInitSelector(element,(()=>{var _a;if(element){const QUERY_KEYWORD=element.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.QUERY_KEYWORD),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD);element.innerHTML="",client.createRoot(element).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||""},onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,state:state})},children:jsxRuntimeExports.jsx(CustomComponents,{productCard:PRODUCT_CARDS?eval(PRODUCT_CARDS):null})})})}))}}))},SearchWidget=e=>{var t,s,i,n,o,r,l,a,d,c,u,x,p,m,g,_,R,h,E,j,v;const{isRenderApp:w,isJsVersion:T}=React.useContext(SledgeContext),{width:f="400px",children:S,onAfterAddToCart:A,onAfterAddWishlist:C,onAfterRemoveWishlist:L,onAfterRenderProduct:I}=e;let N=null,y=null,b=null,O=null;React.Children.map(S,(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)&&(N=t),s&&isFunction(s)&&(y=s),i&&isFunction(i)&&(b=i),n&&isFunction(n)&&(O=n)}}));const[D,$]=React.useState(!0),[P,U]=React.useState(""),[W,k]=React.useState(""),[M,B]=React.useState([]),[F,H]=React.useState([]),[G,V]=React.useState([]),[Y,K]=React.useState([]),[q,z]=React.useState({}),[J,Z]=React.useState({}),[X,Q]=React.useState(""),ee=usePrevious({keyword:P}),te=async(e,t=!1)=>{var s,i,n,o,r,l,a,d,c,u,x;if(!P.length)return;$(!0);const{tabs:p,suffix_index_product:m,hidden_tags:g,display:_}=e,R=(null==(s=null==_?void 0:_.search)?void 0:s.suggestion)||{};let h,E={queries:p.map((e=>{var t;const{index:s}=e;let i=s.includes(m),n=[];return(null==g?void 0:g.length)&&n.push(`tags NOT IN [${g}]`),(null==(t=null==_?void 0:_.filter)?void 0:t.show_out_of_stock)||n.push("variants.inventory_quantity > 0"),{indexUid:s,q:P,hitsPerPage:i?6:4,filter:i?n.join(" AND "):""}}))};if(h=await multiSearch(E),!h)return;const{results:j}=h;let v=null==j?void 0:j.filter((({indexUid:e})=>null==e?void 0:e.includes(m)));t&&(null==P?void 0:P.length)&&searchTrigger({keyword:P,resultCount:(null==(i=v[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||""}})))||[],T=(null==v?void 0:v.length)?null==(o=v[0])?void 0:o.hits:[],f=P.length?(null==T?void 0:T.length)?"":"no_result":"zero_character",S=Boolean(!P.length&&Object.keys(R).length&&(null==(l=null==(r=R[f])?void 0:r.products)?void 0:l.active)&&(null==(c=null==(d=null==(a=R[f])?void 0:a.products)?void 0:d.list)?void 0:c.length));B(S?null==(x=null==(u=R[f])?void 0:u.products)?void 0:x.list:T),H(w),Q(f),$(!1)};React.useEffect((()=>{(null==w?void 0:w.instantSearch)&&(async e=>{var t;if(!P.length)return;let s;if(s=JSON.parse(e),!s)return;const{tabs:i,suffix_index_product:n,hidden_tags:o,display:r}=s;V(i),k(n),K(o),z(r),Z(null==(t=null==r?void 0:r.search)?void 0:t.suggestion),await te(s)})(localStorage.getItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING)||"")}),[P]),React.useEffect((()=>{if(Boolean(ee&&(null==ee?void 0:ee.keyword)!==P)){const e=setTimeout((()=>{te({tabs:G,suffix_index_product:W,hidden_tags:Y,display:q},!0)}),500);return()=>clearTimeout(e)}}),[P]);const se={maxWidth:f};return jsxRuntimeExports.jsxs("div",{className:"sledge-instant-search__widget-search-form-wrapper",style:se,children:[jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:"Search anything",value:P,onChange:({value:e})=>U(e),onResetField:()=>U(""),withClearField:!0}),jsxRuntimeExports.jsx(motion.div,{initial:"hidden",animate:P.length?"visible":"hidden",variants:VISIBLE_ANIMATION,className:"sledge-instant-search__widget-search-form-result",children:D?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:"grey-100",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:"grey-100",rounded:"md",animationDuration:"13s",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:D,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(J).length&&(null==(s=null==(t=J[X])?void 0:t.keywords)?void 0:s.active)&&(null==(o=null==(n=null==(i=J[X])?void 0:i.keywords)?void 0:n.list)?void 0:o.length)?jsxRuntimeExports.jsx(Global.SuggestionKeywordLists,{listsComponent:y,keywords:J[X].keywords.list,isComponentJsVersion:T}):null,F.map(((e,t)=>{const{hits:s,name:i}=e;return jsxRuntimeExports.jsx(React.Fragment,{children:jsxRuntimeExports.jsx(Global.OtherIndexLists,{listsComponent:b,name:i,items:s,isComponentJsVersion:T})},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==M?void 0:M.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product",children:jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:M.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(r=null==q?void 0:q.search)?void 0:r.show_vendor,show_sku:null==(l=null==q?void 0:q.search)?void 0:l.show_sku,show_price:null==(a=null==q?void 0:q.search)?void 0:a.show_price},showOptionOutOfStock:!0,isComponentJsVersion:T,cards:N,onAfterAddToCart:A,onAfterAddWishlist:C,onAfterRemoveWishlist:L,onAfterRenderProduct:I})}):Object.keys(J).length&&(null==(c=null==(d=J[X])?void 0:d.products)?void 0:c.active)&&(null==(p=null==(x=null==(u=J[X])?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:P}),". ",jsxRuntimeExports.jsx("span",{children:"Did you mean:"})]}),jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"instant-search",type:"small",data:J[X].products.list.map((e=>{const{variants:t,...s}=e||{};return{product:s,variants:t}})),setting:{show_vendor:null==(m=null==q?void 0:q.search)?void 0:m.show_vendor,show_sku:null==(g=null==q?void 0:q.search)?void 0:g.show_sku,show_price:null==(_=null==q?void 0:q.search)?void 0:_.show_price},showOptionOutOfStock:!0,isComponentJsVersion:T,cards:N,onAfterAddToCart:A,onAfterAddWishlist:C,onAfterRemoveWishlist:L,onAfterRenderProduct:I})]}):jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-search-form-result-product-disabled",children:"No product were found"})]})]}),(null==M?void 0:M.length)||Object.keys(J).length&&(null==(h=null==(R=J[X])?void 0:R.products)?void 0:h.active)&&(null==(v=null==(j=null==(E=J[X])?void 0:E.products)?void 0:j.list)?void 0:v.length)?jsxRuntimeExports.jsx("div",{className:"sledge-instant-search__widget-button-more-wrapper",children:jsxRuntimeExports.jsx(Global.SearchViewMoreResult,{component:O,keyword:P,isComponentJsVersion:T})}):null]})})})]})},SearchWidgetInitSelector=()=>{let element=document.querySelector(SELECTOR.INSTANT_SEARCH.ELEMENT_SEARCH_WIDGET);detectInitSelector(element,(()=>{var _a,_b,_c,_d;if(element){const WIDTH_ELEMENT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.WIDTH_ELEMENT),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),SUGGESTION_KEYWORD_LISTS=null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SUGGESTION_KEYWORD_LIST),OTHER_INDEX_LISTS=null==(_c=element.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=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_d.getAttribute(DATASET_ATTRIBUTE_KEY.INSTANT_SEARCH.RENDER_SEARCH_VIEW_MORE_RESULT);element.innerHTML="",client.createRoot(element).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||"",onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,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:!1}}},sledgeAnonymId:"",isJsVersion:!1}),CustomComponents=e=>null,BadgeFloatingFull=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,position:a="left",dataSettings:d,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},[x,p]=React.useState(!1);React.useEffect((()=>{p(s&&u)}),[s]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating sledge-wishlist__badge-floating-${a}`,children:jsxRuntimeExports.jsxs("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:[jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-floating-text",children:"My Wishlist"}),jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[jsxRuntimeExports.jsx(HeartIcon,{width:18,height:18,type:"fill",color:"#000000"}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(r?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${r?"99+":o}`||0})]})]})})},BadgeFloatingIcon=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,position:a="bottom-right",dataSettings:d,useProxyUrl:c}=e||{},{is_required_login:u}=(null==(t=null==d?void 0:d.display)?void 0:t.global)||{},[x,p]=React.useState(!1);React.useEffect((()=>{p(s&&u)}),[s]);return jsxRuntimeExports.jsx("div",{className:`sledge-wishlist__badge-floating-icon sledge-wishlist__badge-floating-${a}`,children:jsxRuntimeExports.jsx("span",{onClick:e=>{x&&(e.preventDefault(),e.stopPropagation()),x?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):c&&(window.location.href=l||"/")},className:"sledge-wishlist__badge-floating-icon-link",children:jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge-icon",children:[jsxRuntimeExports.jsx(HeartIcon,{width:27.01,height:25.73,type:"outline",color:"#000000"}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-bottom-right "+(r?"sledge-wishlist__badge-fit-content":""),children:n||x?0:`${r?"99+":o}`||0})]})})})},BadgeHeaderMenu=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isFirstLoading:i,isLoading:n,totalWishlist:o,isMaximizeTotalWishlist:r,proxyUrl:l,dataSettings:a,useProxyUrl:d}=e||{},{is_required_login:c}=(null==(t=null==a?void 0:a.display)?void 0:t.global)||{},u="#000000",[x,p]=React.useState(u),[m,g]=React.useState(!1);React.useEffect((()=>{g(s&&c)}),[s]);return jsxRuntimeExports.jsxs("span",{className:"sledge-wishlist__badge",onClick:e=>{m&&(e.preventDefault(),e.stopPropagation()),m?"undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}):d&&(window.location.href=l||"/")},onMouseEnter:()=>p("#F85538"),onMouseLeave:()=>p(u),children:[jsxRuntimeExports.jsx(HeartIcon,{width:20,height:20,type:"outline",color:x}),!i&&jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__badge-counter sledge-wishlist__badge-counter-header-menu "+(r?"sledge-wishlist__badge-fit-content":""),children:n||m?0:`${r?"99+":o}`||0})]})},getWishlist=async(e,t)=>{const{page:s,limit:i,sort:n,keyword:o,shareId:r}=e||{};let l=t||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP),a="?"+new URLSearchParams({page:s||"",limit:i||"",sort:n||"",keyword:o||"",share_id:r||""}).toString();var d=new Headers;d.append("Authorization",`Bearer ${l}`);var c={method:"GET",headers:d,redirect:"follow"};return await fetch(`${API_URL}/wishlist${a}`,c).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addWishlist=async e=>{const{productId:t,productVariantId:s,productName:i,productVendor:n,productSku:o,productVariantName:r,productLink:l,productImage:a,productCurrency:d,productPrice:c}=e;let u=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var x=new Headers;x.append("Authorization",`Bearer ${u}`),x.append("Content-Type","application/json");var p={method:"POST",headers:x,body:JSON.stringify({product:{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,vendor:n,sku:o,variant_name:r,url:l,image_url:a,currency:d,price:c}}),redirect:"follow"};return await fetch(`${API_URL}/wishlist`,p).then((e=>e.json())).then((e=>e)).catch((()=>{}))},bulkAddWishlist=async e=>{let t=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`),s.append("Content-Type","application/json");let i=e.map((e=>{const{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:r,productCurrency:l,productPrice:a}=e;return{id:sanitizeDataId(t),variant_id:sanitizeDataId(s),name:i,variant_name:n,url:o,image_url:r,currency:l,price:a}}));var n={method:"POST",headers:s,body:JSON.stringify({products:i}),redirect:"follow"};return await fetch(`${API_URL}/wishlist/bulk`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},getWishlistInfo=async e=>{let t=e||localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var s=new Headers;s.append("Authorization",`Bearer ${t}`);var i={method:"GET",headers:s,redirect:"follow"};return await fetch(`${API_URL}/wishlist/info`,i).then((e=>e.json())).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();var r=new Headers;r.append("Authorization",`Bearer ${n}`);var l={method:"GET",headers:r,redirect:"follow"};return await fetch(`${API_URL}/wishlist/check/${s}${o}`,l).then((e=>e.json())).then((e=>Boolean(e.data))).catch((()=>{}))},clearWishlist=async()=>{let e=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var t=new Headers;t.append("Authorization",`Bearer ${e}`);var s={method:"DELETE",headers:t,redirect:"follow"};return await fetch(`${API_URL}/wishlist/clear`,s).then((e=>e.json())).then((e=>e)).catch((()=>{}))},addToCartTrigger=async e=>{const{productId:t}=e;let s=localStorage.getItem(LOCAL_STORAGE_KEY.AUTH_APP);var i=new Headers;i.append("Authorization",`Bearer ${s}`),i.append("Content-Type","application/json");var n={method:"POST",headers:i,body:JSON.stringify({product:{id:sanitizeDataId(t)}}),redirect:"follow"};return await fetch(`${API_URL}/wishlist/cart`,n).then((e=>e.json())).then((e=>e)).catch((()=>{}))},BadgeRoot=e=>{const{children:t,useProxyUrl:s=!1,data:i}=e,{isRenderApp:n,triggerRenderMultipleComponent:o}=React.useContext(SledgeContext),[r,l]=React.useState(0),[a,d]=React.useState(!0),[c,u]=React.useState(!0),[x,p]=React.useState(!1),[m,g]=React.useState(""),[_,R]=React.useState({}),h=async e=>{var t,s,n;let o,r,a,c=!1;i&&e?(o={data:i},c=!0):(o=await getWishlistInfo(),c=200===(null==(t=null==o?void 0:o.status)?void 0:t.code)||!1),r=(null==(s=null==o?void 0:o.data)?void 0:s.total_data)?o.data.total_data:0,a=(null==(n=null==o?void 0:o.data)?void 0:n.proxy_url)||"",c&&(l(r),p(r>99),g(a),d(!1),u(!1))};return React.useEffect((()=>{(null==n?void 0:n.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate=()=>{h()}),(async e=>{let t;t=JSON.parse(e),t&&(R(t),await h(!0))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[n,o]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:React.Children.count(t)&&React.Children.map(t,(e=>React.cloneElement(e,{isFirstLoading:a,isLoading:c,totalWishlist:r,isMaximizeTotalWishlist:x,proxyUrl:m,dataSettings:_,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=()=>{const e=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||"");if(!e)return;const{floating_button_type:t}=(null==e?void 0:e.launch_point)||{},s=String(t).includes("bottom");if("none"!==t)if(s){let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_ICON),document.body.appendChild(e),e){e.innerHTML="";const s=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(s&&"true"===s),children:jsxRuntimeExports.jsx(Badge.FloatingIcon,{position:t})})})}))}}else{let e=document.createElement("div");if(e.setAttribute(SELECTOR_ATTRIBUTE_KEY,INTERNAL_SELECTOR_VALUE.WISHLIST.ELEMENT_BADGE_FLOATING_FULL),document.body.appendChild(e),e){e.innerHTML="";const s=e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);client.createRoot(e).render(jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(SledgeContext.Provider,{value:{isRenderApp:{wishlist:!0,productReview:!0,instantSearch:!0},sledgeAnonymId:localStorage.getItem(LOCAL_STORAGE_KEY.ANONYM_ID)||"",isJsVersion:!0},children:jsxRuntimeExports.jsx(Badge.Root,{useProxyUrl:Boolean(s&&"true"===s),children:jsxRuntimeExports.jsx(Badge.FloatingFull,{position:t})})})}))}}else{let e=document.querySelector(SELECTOR.WISHLIST.ELEMENT_BADGE);const t=null==e?void 0:e.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.USE_PROXY_URL);detectInitSelector(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(Badge.Root,{useProxyUrl:Boolean(t&&"true"===t),children:jsxRuntimeExports.jsx(Badge.HeaderMenu,{})})})})))}))}},ButtonDetail=e=>{var t,s,i,n,o;const{params:r,onAfterAddWishlist:l,onAfterRemoveWishlist:a}=e,{productId:d,productVariantId:c}=r||{},{isRenderApp:u,triggerRenderMultipleComponent:x,sledgeAnonymId:p}=React.useContext(SledgeContext),[m,g]=React.useState(!0),[_,R]=React.useState(!0),[h,E]=React.useState(!1),[j,v]=React.useState({}),[w,T]=React.useState(!1),[f,S]=React.useState(!1),{is_required_login:A}=(null==(t=null==j?void 0:j.display)?void 0:t.global)||{},{type:C,icon:L,click_again_action:I,text_color:N,border_color:y,border_radius:b,padding_top:O,padding_bottom:D,padding_left:$,padding_right:P,background_color:U,font_size:W,font_weight:k,text_transform:M}=(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:H,after_adding_wishlist:G,remove_from_wishlist:V}=(null==(n=null==j?void 0:j.languages)?void 0:n.button_detail)||{},{title_added_to_wishlist:Y,text_added_to_wishlist:K,title_removed_to_wishlist:q,text_removed_to_wishlist:z}=(null==(o=null==j?void 0:j.languages)?void 0:o.notification)||{},J={...N&&{color:N},...y&&{borderColor:y},...b&&{borderRadius:b},...O&&{paddingTop:O},...D&&{paddingBottom:D},...$&&{paddingLeft:$},...P&&{paddingRight:P},...U&&{backgroundColor:U},...W&&{fontSize:W},...k&&{fontWeight:k},...M&&{textTransform:M}},Z=async()=>{let e;e=await checkWishlist(d,c),E(e)},X=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"}));T(!0),E(!h);let u=await addWishlist(r);200===(null==(t=null==u?void 0:u.status)?void 0:t.code)?(T(!1),"undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((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))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistTriggerUpdate&&window.sledgeWishlistTriggerUpdate()),Z(),h?a&&a("success"):l&&l("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&B&&window.sledgeToastNotification({title:h?q:Y,message:h?z:K,location:F,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(h?a&&a("failed"):l&&l("failed"),T(!1),"undefined"!=typeof window&&window.sledgeToastNotification&&B&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:F,type:"failed"}))};React.useEffect((()=>{(null==u?void 0:u.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistButtonDetailUpdate=()=>{Z()}),(async e=>{let t;R(!0),t=JSON.parse(e),t&&(v(t),R(!1),g(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[u]),React.useEffect((()=>{S(p&&A)}),[p]),React.useEffect((()=>{Z()}),[c]);const Q=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[C&&String(C).toLowerCase().includes("icon")&&(null==L?void 0:L.length)?jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail-icon",dangerouslySetInnerHTML:{__html:L},style:{fill:N}}):null,f?H:C&&String(C).toLowerCase().includes("text")?w?h?"Adding...":"Removing...":h&&!I?G:h?V:H:null]});return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-button-detail-wrapper",children:m?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"100%",height:"44px",rounded:"md",color:"grey-100"}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:C&&String(C).toLowerCase().includes("button")?jsxRuntimeExports.jsx(Button,{type:"button",fullWidth:!0,style:J,...w||h&&!I?{disabled:!0}:{onClick:e=>X(e)},children:Q}):jsxRuntimeExports.jsx("span",{className:"sledge-wishlist__widget-button-detail",style:J,...w||h&&!I?{disabled:!0}:{onClick:e=>X(e)},children:Q})})})},ButtonDetailInitSelector=()=>{let element=document.querySelector(SELECTOR.WISHLIST.ELEMENT_BUTTON_DETAIL);detectInitSelector(element,(()=>{if(element){const PRODUCT_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_ID),PRODUCT_VARIANT_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_ID),PRODUCT_NAME=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_NAME),PRODUCT_VENDOR=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VENDOR),PRODUCT_SKU=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_SKU),PRODUCT_VARIANT_NAME=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_VARIANT_NAME),PRODUCT_LINK=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_LINK),PRODUCT_IMAGE=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_IMAGE),PRODUCT_CURRENCY=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_CURRENCY),PRODUCT_PRICE=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.PRODUCT_PRICE),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST);element.innerHTML="",client.createRoot(element).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=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})}})})}))}}))},Trigger=e=>{var t,s,i;const{params:n,forceActive:o=!1,hidden:r=!1,onAfterAddWishlist:l,onAfterRemoveWishlist:a,wishlistChecked:d}=e,{productId:c,productVariantId:u}=n||{},{isRenderApp:x,triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),g="#767676",_="outline",R="#F85538",h="fill",[E,j]=React.useState(g),[v,w]=React.useState(_),[T,f]=React.useState(!1),[S,A]=React.useState(!0),[C,L]=React.useState({}),[I,N]=React.useState({onAfterAddWishlist:l,onAfterRemoveWishlist:a}),[y,b]=React.useState(!1),{is_required_login:O}=(null==(t=null==C?void 0:C.display)?void 0:t.global)||{},{show:D,location:$}=(null==(s=null==C?void 0:C.display)?void 0:s.notification)||{},{title_added_to_wishlist:P,text_added_to_wishlist:U,title_removed_to_wishlist:W,text_removed_to_wishlist:k}=(null==(i=null==C?void 0:C.languages)?void 0:i.notification)||{},M=async e=>{let t;t="boolean"==typeof d&&e?d:await checkWishlist(c,u),f(o||t)};React.useEffect((()=>{(null==x?void 0:x.wishlist)&&("undefined"!=typeof window&&(window.sledgeWishlistTriggerUpdate=()=>{M(!0)}),(async e=>{let t;A(!0),t=JSON.parse(e),t&&(L(t),A(!1))})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""))}),[x]),React.useEffect((()=>{b(m&&O)}),[m]),React.useEffect((()=>{(null==x?void 0:x.wishlist)&&M(!0)}),[x,u]);const B=(T||o)&&!y;return React.useEffect((()=>{B?(j(R),w(h)):(j(g),w(_))}),[T]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!S&&!r&&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,r,l;if(e.preventDefault(),e.stopPropagation(),y)return void("undefined"!=typeof window&&window.sledgeConfirmationPopup&&window.sledgeConfirmationPopup({title:"Login required!",message:"Please login to save your wishlist across devices.",textSubmit:"Login",textCancel:"Cancel",buttonSubmitType:"info",onSubmit:()=>window.location.href="/account/login"}));f(!T);let a=await addWishlist(n);const{status:c,data:u}=a||{},{code:x}=c||{};200===x?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(s=null==(t=null==p?void 0:p.wishlist)?void 0:t.badge)?void 0:s.trigger)&&"boolean"!=typeof d&&(null==(l=null==(i=null==p?void 0:p.wishlist)?void 0:i.badge)||l.trigger(!(null==(r=null==(o=null==p?void 0:p.wishlist)?void 0:o.badge)?void 0:r.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeWishlistWidgetListUpdate&&window.sledgeWishlistWidgetListUpdate(),window.sledgeWishlistButtonDetailUpdate&&window.sledgeWishlistButtonDetailUpdate()),M(),T?I.onAfterRemoveWishlist&&I.onAfterRemoveWishlist("success"):I.onAfterAddWishlist&&I.onAfterAddWishlist("success"),"undefined"!=typeof window&&window.sledgeToastNotification&&D&&window.sledgeToastNotification({title:T?W:P,message:T?k:U,location:$,type:"success",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})})):(T?I.onAfterRemoveWishlist&&I.onAfterRemoveWishlist("failed"):I.onAfterAddWishlist&&I.onAfterAddWishlist("failed"),"undefined"!=typeof window&&window.sledgeToastNotification&&D&&window.sledgeToastNotification({title:"Failed",message:"failed add to wishlist",location:$,type:"failed",icon:jsxRuntimeExports.jsx(HeartIcon,{width:40,height:40,color:"black",type:"outline"})}))})(e),onMouseEnter:()=>{B||(j(R),w(h))},onMouseLeave:()=>{B||(j(g),w(_))},children:jsxRuntimeExports.jsx(HeartIcon,{width:16.67,height:15.83,type:v,color:E})})})})},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,r,l,a;const{sledgeAnonymId:d}=React.useContext(SledgeContext),{is_required_login:c}=(null==(n=null==s?void 0:s.display)?void 0:n.global)||{},{text_color:u,border_color:x,border_radius:p,padding_top:m,padding_bottom:g,padding_left:_,padding_right:R,background_color:h,font_size:E,font_weight:j,text_transform:v}=(null==(r=null==(o=null==s?void 0:s.display)?void 0:o.widget)?void 0:r.button_clear_all)||{},{title_confirm_clear_all_wishlist:w,text_confirm_clear_all_wishlist:T,button_submit_confirm_clear_all_wishlist:f,button_cancel_confirm_clear_all_wishlist:S}=(null==(l=null==s?void 0:s.languages)?void 0:l.popup)||{},{button_clear_all:A}=(null==(a=null==s?void 0:s.languages)?void 0:a.widget)||{},[C,L]=React.useState(!1),I={...u&&{color:u},...x&&{borderColor:x},...p&&{borderRadius:p},...m&&{paddingTop:m},...g&&{paddingBottom:g},..._&&{paddingLeft:_},...R&&{paddingRight:R},...h&&{backgroundColor:h},...E&&{fontSize:E},...j&&{fontWeight:j},...v&&{textTransform:v}};React.useEffect((()=>{L(d&&c)}),[d]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!C&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!t&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"grey-100",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:w,message:T,textSubmit:f,textCancel:S,buttonSubmitType:"danger",onSubmit:window.sledgeWishlistWidgetClearList||{}})},style:I,children:e||(A||"Clear Wishlist")})})})})})},WidgetHeaderShareTrigger=({wishlistData:e,buttonText:t,showShareTrigger:s,shareLink:i,shareId:n,dataSettings:o,isFirstLoading:r})=>{var l,a,d,c,u,x;const{triggerRenderMultipleComponent:p,sledgeAnonymId:m}=React.useContext(SledgeContext),{is_required_login:g}=(null==(l=null==o?void 0:o.display)?void 0:l.global)||{},{text_color:_,border_color:R,border_radius:h,padding_top:E,padding_bottom:j,padding_left:v,padding_right:w,background_color:T,font_size:f,font_weight:S,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:L}=(null==(u=null==o?void 0:o.languages)?void 0:u.widget)||{},{title_added_all_to_wishlist:I,text_added_all_to_wishlist:N}=(null==(x=null==o?void 0:o.languages)?void 0:x.notification)||{},[y,b]=React.useState(!1),O={..._&&{color:_},...R&&{borderColor:R},...h&&{borderRadius:h},...E&&{paddingTop:E},...j&&{paddingBottom:j},...v&&{paddingLeft:v},...w&&{paddingRight:w},...T&&{backgroundColor:T},...f&&{fontSize:f},...S&&{fontWeight:S},...A&&{textTransform:A}},[D,$]=React.useState(!1);let P='<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,r,l;$(!0);let a=e.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:r,currency:l,price:a}=e.product;return{productId:t,productVariantId:s,productName:i,productVariantName:n,productLink:o,productImage:r,productCurrency:l,productPrice:a}})),d=await bulkAddWishlist(a);200===(null==(t=null==d?void 0:d.status)?void 0:t.code)?("undefined"!=typeof window&&(window.sledgeWishlistBadgeUpdate&&((null==(i=null==(s=null==p?void 0:p.wishlist)?void 0:s.badge)?void 0:i.trigger)&&(null==(l=null==(n=null==p?void 0:p.wishlist)?void 0:n.badge)||l.trigger(!(null==(r=null==(o=null==p?void 0:p.wishlist)?void 0:o.badge)?void 0:r.value))),window.sledgeWishlistBadgeUpdate()),window.sledgeInfoPopup&&window.sledgeInfoPopup({title:I,message:N,textCancel:"Cancel"})),$(!1)):"undefined"!=typeof window&&window.sledgeInfoPopup&&window.sledgeInfoPopup({title:"Failed",message:"Failed add to wishlist, please try again",textCancel:"Cancel"})};return React.useEffect((()=>{b(m&&g)}),[m]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!y&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:s&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:r?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-header-share-trigger",children:jsxRuntimeExports.jsx(Button,{type:"button",style:O,...n&&!e.length||D?{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 ${P}\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=P)}),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}),D?"Adding...":"Add to your wishlist"]}):t||(L||"Share Wishlist")})})})})})},WidgetHeaderSearchForm=({setIsLoading:e,setKeyword:t,keyword:s,placeholder:i,dataSettings:n})=>{var o,r;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(o=null==n?void 0:n.display)?void 0:o.global)||{},{search_form_placeholder:d}=(null==(r=null==n?void 0:n.languages)?void 0:r.widget)||{},[c,u]=React.useState(!1),x=React.useRef(null);return React.useEffect((()=>{u(l&&a)}),[l]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!c&&jsxRuntimeExports.jsx(SearchInputField,{type:"text",icon:jsxRuntimeExports.jsx(SearchIcon,{width:18,height:18,color:"#868686"}),placeholder:i||(d||"Search product..."),value:s,fieldRef:x,onChange:({value:e})=>(e=>{t&&t(e)})(e),onResetField:()=>{var s;e&&e(!0),t&&t(""),null==(s=null==x?void 0:x.current)||s.focus()},className:"sledge-wishlist__widget-header-item sledge-wishlist__widget-search-form",withClearField:!0})})},WidgetHeaderTitle=({text:e,dataSettings:t})=>{var s,i,n;const{color:o,font_size:r,font_weight:l,text_transform:a}=(null==(i=null==(s=null==t?void 0:t.display)?void 0:s.widget)?void 0:i.header_title)||{},{header_title:d}=(null==(n=null==t?void 0:t.languages)?void 0:n.widget)||{},c={...o&&{color:o},...r&&{fontSize:r},...l&&{fontWeight:l},...a&&{textTransform:a}};return jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-header-item",children:jsxRuntimeExports.jsx("h1",{style:c,children:e||(d||"My Wishlist")})})},WidgetHeaderLimit=({options:e,defaultLimitOptions:t,selectedLimit:s,setSelectedLimit:i,setIsRefreshWidgetList:n,dataSettings:o})=>{var r;const{sledgeAnonymId:l}=React.useContext(SledgeContext),{is_required_login:a}=(null==(r=null==o?void 0:o.display)?void 0:r.global)||{},[d,c]=React.useState(!1);let u=e||t;return React.useEffect((()=>{c(l&&a)}),[l]),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,r;const{sledgeAnonymId:l}=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(l&&a)}),[l]),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==(r=e[0])?void 0:r.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:"grey-100",rounded:"md"}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"440px",height:"46px",color:"grey-100",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"132px",height:"46px",color:"grey-100",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"136px",height:"46px",color:"grey-100",rounded:"md"})]}),jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"26px"},children:[jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"}),jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"190px",height:"46px",color:"grey-100",rounded:"md"})]})]}):React.Children.count(t.children)&&React.Children.map(t.children,(e=>React.cloneElement(e,{...t})))});WidgetHeader.Title=WidgetHeaderTitle,WidgetHeader.SearchForm=WidgetHeaderSearchForm,WidgetHeader.ShareTrigger=WidgetHeaderShareTrigger,WidgetHeader.ClearTrigger=WidgetHeaderClearTrigger,WidgetHeader.Sort=WidgetHeaderSort,WidgetHeader.Limit=WidgetHeaderLimit;const defaultGridType="large",WidgetList=e=>{var t;const{sledgeAnonymId:s}=React.useContext(SledgeContext),{isLoading:i,wishlistData:n,dataSettings:o,gridType:r=defaultGridType}=e||{},{is_required_login:l}=(null==(t=null==o?void 0:o.display)?void 0:t.global)||{},[a,d]=React.useState(!1);return React.useEffect((()=>{d(s&&l)}),[s]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:i?jsxRuntimeExports.jsx(SkeletonLoading.ProductGrid,{count:8,type:r}):jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-wrapper",children:!(null==n?void 0:n.length)||a?jsxRuntimeExports.jsx(WidgetListEmpty,{...e,isRequiredLogin:a}):jsxRuntimeExports.jsx(ProductWrapper,{...e})})})},WidgetListEmpty=e=>{var t;const{onSearch:s,keyword:i,dataSettings:n,isRequiredLogin:o}=e||{},{title_no_result:r,text_no_result:l}=(null==(t=null==n?void 0:n.languages)?void 0:t.widget)||{},[a,d]=React.useState(""),[c,u]=React.useState(""),[x,p]=React.useState(!1),[m,g]=React.useState(""),[_,R]=React.useState("");return React.useEffect((()=>{o?(d("Login required!"),u("Please login to save your wishlist across devices."),p(!0),g("Login"),R("/account/login")):s||(d(i?"No products found":r),u(i?"Your search did not match any products. <br/> Please try again":l),p(!i),g("Continue Shopping"),R("/"))}),[s,n]),jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-product-empty",children:[jsxRuntimeExports.jsx("div",{className:"sledge-wishlist__widget-product-empty-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,r,l,a;const{isJsVersion:d}=React.useContext(SledgeContext),{wishlistData:c,currentPage:u,setCurrentPage:x,totalPage:p,shareId:m,dataSettings:g,gridType:_=defaultGridType,productCardsComponent:R,onAfterAddToCart:h,onAfterAddWishlist:E,onAfterRemoveWishlist:j,onAfterRenderProduct:v,dataReviews:w}=e||{},{show_add_to_cart:T,redirect_add_to_cart:f}=(null==(t=null==g?void 0:g.display)?void 0:t.widget)||{},{text_color:S,border_color:A,border_radius:C,padding_top:L,padding_bottom:I,padding_left:N,padding_right:y,background_color:b,font_size:O,font_weight:D,text_transform:$}=(null==(i=null==(s=null==g?void 0:g.display)?void 0:s.widget)?void 0:i.button_add_to_cart)||{},{color:P,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:B,font_weight:F,text_transform:H}=(null==(l=null==(r=null==g?void 0:g.display)?void 0:r.widget)?void 0:l.product_name)||{},{button_add_to_cart:G}=(null==(a=null==g?void 0:g.languages)?void 0:a.widget)||{},V={...S&&{color:S},...A&&{borderColor:A},...C&&{borderRadius:C},...L&&{paddingTop:L},...I&&{paddingBottom:I},...N&&{paddingLeft:N},...y&&{paddingRight:y},...b&&{backgroundColor:b},...O&&{fontSize:O},...D&&{fontWeight:D},...$&&{textTransform:$}},Y={...P&&{color:P},...U&&{fontSize:U},...W&&{fontWeight:W},...k&&{textTransform:k}},K={...M&&{color:M},...B&&{fontSize:B},...F&&{fontWeight:F},...H&&{textTransform:H}};let q=u||0,z=p||0;const[J,Z]=React.useState(!1),[X,Q]=React.useState(!1);return React.useEffect((()=>{Q(!(z===q&&!J)&&z>=q)}),[J]),React.useEffect((()=>{Z(!1)}),[c]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[(null==c?void 0:c.length)?jsxRuntimeExports.jsx(ProductGrid,{sourceApp:"wishlist",type:_,data:c.map((e=>{const{id:t,variant_id:s,name:i,variant_name:n,url:o,image_url:r,currency:l,price:a,vendor:d,sku:c}=(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:r},url:o,vendor:d,currency:l},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:T,redirect_add_to_cart:f,language_button_add_to_cart:G,display_product_name_style:K,display_price_style:Y,display_button_add_to_cart_style:V},showOptionOutOfStock:!1,triggerPropAdditional:{forceActive:!0,...m&&{hidden:!0}},isComponentJsVersion:d,cards:R,onAfterAddToCart:h,onAfterAddWishlist:E,onAfterRemoveWishlist:j,onAfterRenderProduct:v,dataReviews:w}):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=>{const{children:t,query:s,params:i,customRoutePage:n,onAfterAddToCart:o,onAfterAddWishlist:r,onAfterRemoveWishlist:l,onAfterRenderProduct:a,data:d,dataInfo:c,dataReviews:u}=e,{shareId:x="share"}=s||{},{isRenderApp:p,triggerRenderMultipleComponent:m,sledgeAnonymId:g,isJsVersion:_}=React.useContext(SledgeContext),[R,h]=React.useState(!0),[E,j]=React.useState(!0),[v,w]=React.useState([]),[T,f]=React.useState([]),[S,A]=React.useState(!1),[C,L]=React.useState(""),[I,N]=React.useState(""),[y,b]=React.useState(""),[O,D]=React.useState(1),[$,P]=React.useState(0),[U,W]=React.useState(!1),[k,M]=React.useState(!1),[B,F]=React.useState(""),[H,G]=React.useState(null),[V,Y]=React.useState(""),[K,q]=React.useState({}),[z,J]=React.useState(!1),Z=usePrevious({keyword:y,currentPage:O}),X=DEFAULT_LIMIT_VALUE,Q=async(e=!1)=>{var t,s,n,o;const r=new URLSearchParams(document.location.search),l=(null==i?void 0:i.shareId)?i.shareId:(null==r?void 0:r.get(x))||"";let a;j(!e),e||(D(1),w([]));let c,u,p=!1,m=0,g={page:e?O:1,limit:I||X[0],sort:C,keyword:y,shareId:l};a=!d||1!==O||I||C||y?await getWishlist(g):d,p=200===(null==(t=null==a?void 0:a.status)?void 0:t.code)||!1,c=(null==(s=a.data)?void 0:s.length)?t=>(null==v?void 0:v.length)&&e?[...t,...a.data]:a.data:[],u=(null==(n=a.sorts)?void 0:n.length)?a.sorts:[],m=(null==(o=null==a?void 0:a.page)?void 0:o.total_page)||1,p&&(w(c),f(u),P(m),j(!1),A(!1))};React.useEffect((()=>{if(!(null==p?void 0:p.wishlist))return;let e=Boolean(Z&&(null==Z?void 0:Z.currentPage)!==O);if(Z&&(null==Z?void 0:Z.keyword)!==y){W(!0);const e=setTimeout((()=>{W(!1),Q()}),500);return()=>clearTimeout(e)}Q(!S&&e)}),[p,y,O,S]),React.useEffect((()=>{if(!(null==p?void 0:p.wishlist))return;const e=new URLSearchParams(document.location.search);G((null==i?void 0:i.shareId)?i.shareId:(null==e?void 0:e.get(x))||""),"undefined"!=typeof window&&(window.sledgeWishlistWidgetListUpdate=()=>{Q()},window.sledgeWishlistWidgetClearList=()=>{(async()=>{var e,t,s,i,n,o,r;let l;j(!0);let a=!1;l=await clearWishlist(),a=200===(null==(e=null==l?void 0:l.status)?void 0:e.code),a?(await Q(),"undefined"!=typeof window&&window.sledgeWishlistBadgeUpdate&&((null==(s=null==(t=null==m?void 0:m.wishlist)?void 0:t.badge)?void 0:s.trigger)&&(null==(r=null==(i=null==m?void 0:m.wishlist)?void 0:i.badge)||r.trigger(!(null==(o=null==(n=null==m?void 0:m.wishlist)?void 0:n.badge)?void 0:o.value))),window.sledgeWishlistBadgeUpdate())):"undefined"!=typeof window&&window.sledgeToastNotification&&window.sledgeToastNotification({title:"Failed",message:"failed clear all wishlist",type:"failed"})})()}),(async()=>{var e,t,s,i;let o;M(!1);let r,l,a,d=!1;c?(o={data:c},d=!0):(o=await getWishlistInfo(),d=200===(null==(e=null==o?void 0:o.status)?void 0:e.code)||!1),r=(null==(t=null==o?void 0:o.data)?void 0:t.proxy_url)||"",a=(null==(s=null==o?void 0:o.data)?void 0:s.share_id)||"",l=n?`${n}?${x}=${a}`:null==(i=null==o?void 0:o.data)?void 0:i.share_link,d&&(Y(r),F(window.location.origin+l),M(!0))})(),(async e=>{let t;t=JSON.parse(e),t&&q(t)})(localStorage.getItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING)||""),h(!1)}),[p]),React.useEffect((()=>{var e;const{is_required_login:t}=(null==(e=null==K?void 0:K.display)?void 0:e.global)||{};J(g&&!t)}),[g,K]);let ee=null,te=null;React.Children.map(t,(e=>{if(React.isValidElement(e)&&isFunction(e.type)){const{productCard:t,wishlistWidgetAlert:s}=(null==e?void 0:e.props)||{};t&&isFunction(t)&&(ee=t),s&&isFunction(s)&&(te=s)}}));const se=te?te():null;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"sledge-wishlist__widget-wrapper",children:[z&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:R?jsxRuntimeExports.jsx(SkeletonLoading.Item,{width:"99.5%",height:"72px",color:"grey-100",rounded:"none",animationDuration:"3s",style:{margin:"0 auto"}}):te?jsxRuntimeExports.jsx(React.Fragment,{children:_?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:se}}):se}):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(t)&&React.Children.map(t,(e=>React.cloneElement(e,{isLoading:E,isFirstLoading:R,wishlistData:v,wishlistSort:T,selectedSort:C,selectedLimit:I,keyword:y,currentPage:O,totalPage:$,defaultLimitOptions:X,onSearch:U,showShareTrigger:k,shareLink:B,shareId:H,proxyUrl:V,dataSettings:K,productCardsComponent:ee,query:s,setIsLoading:j,setIsRefreshWidgetList:A,setSelectedSort:L,setSelectedLimit:N,setKeyword:b,setCurrentPage:D,onAfterAddToCart:o,onAfterAddWishlist:r,onAfterRemoveWishlist:l,onAfterRenderProduct:a,dataReviews:u})))]})})},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=document.querySelector(SELECTOR.WISHLIST.ELEMENT_WIDGET);detectInitSelector(element,(()=>{var _a,_b;if(element){const SHARE_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.SHARE_ID),QUERY_SHARE_ID=element.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.QUERY_SHARE_ID),CUSTOM_ROUTE_PAGE=element.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.CUSTOM_ROUTE_PAGE),ON_AFTER_ADD_TO_CART=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_TO_CART),ON_AFTER_ADD_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_ADD_WISHLIST),ON_AFTER_REMOVE_WISHLIST=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_REMOVE_WISHLIST),ON_AFTER_RENDER_PRODUCT=element.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.ON_AFTER_RENDER_PRODUCT),PRODUCT_CARDS=null==(_a=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_a.getAttribute(DATASET_ATTRIBUTE_KEY.GLOBAL.RENDER_PRODUCT_CARD),WISHLIST_WIDGET_ALERT=null==(_b=element.querySelector(SELECTOR.GLOBAL.ELEMENT_CUSTOM_COMPONENTS))?void 0:_b.getAttribute(DATASET_ATTRIBUTE_KEY.WISHLIST.RENDER_WISHLIST_WIDGET_ALERT);element.innerHTML="",client.createRoot(element).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||""},onAfterAddToCart:state=>{element&&ON_AFTER_ADD_TO_CART&&eval(ON_AFTER_ADD_TO_CART)&&eval(ON_AFTER_ADD_TO_CART)({element:element,state:state})},onAfterAddWishlist:state=>{element&&ON_AFTER_ADD_WISHLIST&&eval(ON_AFTER_ADD_WISHLIST)&&eval(ON_AFTER_ADD_WISHLIST)({element:element,state:state})},onAfterRemoveWishlist:state=>{element&&ON_AFTER_REMOVE_WISHLIST&&eval(ON_AFTER_REMOVE_WISHLIST)&&eval(ON_AFTER_REMOVE_WISHLIST)({element:element,state:state})},onAfterRenderProduct:state=>{element&&ON_AFTER_RENDER_PRODUCT&&eval(ON_AFTER_RENDER_PRODUCT)&&eval(ON_AFTER_RENDER_PRODUCT)({element:element,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:r=null,isComponentJsVersion:l=!1,cards:a,onAfterAddToCart:d,onAfterAddWishlist:c,onAfterRemoveWishlist:u,onAfterRenderProduct:x,showPopupComponent:p,setShowPopupComponent:m,dataReviews:g})=>{const{show_vendor:_=!0,show_sku:R=!0,show_price:h=!0,show_add_to_cart:E=!0,redirect_add_to_cart:j=!0,language_button_add_to_cart:v="Add To Cart",display_product_name_style:w={},display_price_style:T={},display_button_add_to_cart_style:f={}}=i||{},[S,A]=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)=>{const{product:s,variants:i}=e||{},{id:x,title:C,image:L,url:I,vendor:N="",currency:y}=s||{},{id:b="",title:O="",price:D="",sku:$=""}=(null==i?void 0:i.length)?i[0]:{};let P=S==b,U=!(!(null==i?void 0:i.length)||!Object.hasOwn(i[0],"inventory_quantity"))&&(!i[0].inventory_quantity&&n);const W=a?a({product:{...s,variants:i.map(((e,t)=>{const{inventory_quantity:s}=e||{};return{...e,is_out_of_stock:!!Object.hasOwn(i[t],"inventory_quantity")&&!s}}))},showPopupComponent:p,setShowPopupComponent:m}):null;return a?jsxRuntimeExports.jsx(React.Fragment,{children:l?jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:W}}):W},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:I,onClick:()=>"instant-search"===r&&productClickTrigger({productId:x}),children:[jsxRuntimeExports.jsx(Trigger,{params:{productId:x,productVariantId:b,productName:C,productVendor:N,productSku:$,productVariantName:O,productLink:I,productImage:(null==L?void 0:L.src)||`${API_URL}/img/blank-image.png`,productCurrency:y,productPrice:D},...o,onAfterAddWishlist:c,onAfterRemoveWishlist:u}),jsxRuntimeExports.jsx("img",{src:(null==L?void 0:L.src)||"",alt:"sledge-product-card-image",loading:"lazy",onError:e=>e.currentTarget.src=`${API_URL}/img/blank-image.png`})]}),U?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:[C?jsxRuntimeExports.jsx("a",{href:I,onClick:()=>"instant-search"===r&&productClickTrigger({productId:x}),children:jsxRuntimeExports.jsx("h3",{style:w,children:C})}):null,h?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-price",children:jsxRuntimeExports.jsxs("p",{style:T,children:[y,D]})}):null]}),jsxRuntimeExports.jsxs("div",{className:"sledge__product-grid-card-text",children:[jsxRuntimeExports.jsx("div",{children:O}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:_?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Vendor: ",N]}):null}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:" | "}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:R?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["SKU: ",$]}):null})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-rating",children:jsxRuntimeExports.jsx(Rating,{params:{productId:x},size:"xs",withSkeletonLoading:!1,isScrollToElementWidget:!1,data:null==g?void 0:g[x]})})]})]}),E?jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(Button,{type:"button",colorType:"light",style:{...f,...P&&{cursor:"wait"}},...P||U?{disabled:!0}:{onClick:()=>(async e=>{var t;const{id:s,quantity:i}=e;A(s);let n=await addToCart([{id:s,quantity:i}]);(null==(t=null==n?void 0:n.items)?void 0:t.length)?("wishlist"===r?await addToCartTrigger({productId:s}):"instant-search"===r&&await addToCartTrigger$1({productId:s}),A(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;A(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:b,quantity:1})},children:P?"Adding...":U?"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:v||"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:r="",...l}=e;return jsxRuntimeExports.jsx("div",{className:`sledge__input-field-wrapper ${t||""}`,children:jsxRuntimeExports.jsxs($d94698215c4408a7$export$a455218a85c89869,{className:"FormField",name:r,children:[jsxRuntimeExports.jsx($d94698215c4408a7$export$7a7fa4424cb20976,{asChild:!0,children:jsxRuntimeExports.jsx("input",{className:"sledge__input-field",type:o,value:s,required:n,onChange:e=>(e=>{i&&i(e)})(e),...l})}),n&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"valueMissing",children:"Required field"}),"email"===o&&jsxRuntimeExports.jsx($d94698215c4408a7$export$f69c19e57285b83a,{className:"FormMessage",match:"typeMismatch",children:"Please fill a valid email address"})]})})},CollectionGrid$1="",CollectionGrid=({className:e="",data:t})=>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:r}=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:r||`${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:r}=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:r||`${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:r,image:l}=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:r,children:jsxRuntimeExports.jsx("img",{src:l||`${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:r,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:r,children:"Learn More"})})]},t)}))}):null}),Tooltip$1="",Tooltip=({children:e,content:t,withArrow:s=!0,customArrow:i="",sideOffset:n=5,alignOffset:o=0,wrapTrigger:r=!0})=>{const[l,a]=React.useState(!1);return React.useEffect((()=>{var e;let t=null==(e=null==document?void 0:document.querySelector(".sledge__tooltip-arrow"))?void 0:e.parentElement;t&&(null==i?void 0:i.length)&&(t.classList.add("sledge__tooltip-arrow-parent"),t.innerHTML=i)}),[l]),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$2881499e37b75b9a,{delayDuration:0,children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$be92b6f5f03c0fe9,{onOpenChange:a,children:[jsxRuntimeExports.jsx($a093c7e1ec25a057$export$41fb9f06171c75f4,{asChild:!0,children:r?jsxRuntimeExports.jsx("span",{children:e}):e}),jsxRuntimeExports.jsx($a093c7e1ec25a057$export$602eac185826482c,{children:jsxRuntimeExports.jsxs($a093c7e1ec25a057$export$7c6e2c02157bb7d2,{className:"sledge__tooltip-content",sideOffset:n,alignOffset:o,children:[t,s?jsxRuntimeExports.jsx($a093c7e1ec25a057$export$21b07c8f274aebd5,{className:"sledge__tooltip-arrow"}):null]})})]})})},ScrollArea$1="",ScrollArea=({children:e,isLoading:t=!1,className:s="",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,animationDuration:n="8s",disableAnimation:o=!1,style:r={},className:l="",...a})=>jsxRuntimeExports.jsx("div",{className:`sledge__skeleton-item ${l} ${o?"":"sledge__skeleton-item-animation"}`,style:{width:e,height:t,WebkitAnimationDuration:n,animationDuration:n,...r},"data-skeleton-rounded":s,"data-skeleton-color":i,...a}),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:"grey-300",rounded:"sm",disableAnimation:!0})}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"100%",color:"grey-100",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:"grey-100",rounded:"md",animationDuration:"15s"}),jsxRuntimeExports.jsx(SkeletonItem,{width:"80px",height:"28px",color:"grey-100",rounded:"md",animationDuration:"20s"})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-card-text",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"190px",height:"46px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{marginBottom:"16px"}})})]})]}),jsxRuntimeExports.jsx("div",{className:"sledge__product-grid-button-wrapper",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"117px",height:"40px",color:"grey-100",rounded:"md",animationDuration:"15s"})})]},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:"grey-100",rounded:"md",animationDuration:"list"===t?"2.5s":"8s"})},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:"grey-300",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:"grey-300",rounded:"lg"})}),jsxRuntimeExports.jsx("div",{className:"sledge__collection-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"47px",color:"grey-300",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:"grey-300",rounded:"md",animationDuration:"20s",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:"grey-300",rounded:"md",animationDuration:"13s",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:"grey-300",rounded:"md",animationDuration:"6s"})}),jsxRuntimeExports.jsx("div",{className:"sledge__page-grid-card-content-description",children:jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"grey-300",rounded:"md",animationDuration:"17s",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:"grey-100",rounded:"md",animationDuration:"10s"})}),jsxRuntimeExports.jsxs("div",{className:"sledge__blog-grid-card-desc",children:[jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"28px",color:"grey-100",rounded:"md",style:{maxWidth:"242px",marginTop:"26px",marginBottom:"12px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"28px",color:"grey-100",rounded:"md",animationDuration:"23s",style:{maxWidth:"80px",marginBottom:"27px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"80px",color:"grey-100",rounded:"md",animationDuration:"13s",style:{maxWidth:"190px",marginBottom:"27px"}}),jsxRuntimeExports.jsx(SkeletonItem,{width:"100%",height:"40px",color:"grey-100",rounded:"md",animationDuration:"20s",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,r,l;200===(null==(t=null==e?void 0:e.status)?void 0:t.code)?((null==(s=null==e?void 0:e.data)?void 0:s.wishlist)&&(localStorage.setItem(LOCAL_STORAGE_KEY.WISHLIST_SETTING,JSON.stringify(null==(i=null==e?void 0:e.data)?void 0:i.wishlist)),WishlistInitSelector()),(null==(n=null==e?void 0:e.data)?void 0:n.review)&&(localStorage.setItem(LOCAL_STORAGE_KEY.PRODUCT_REVIEW_SETTING,JSON.stringify(null==(o=null==e?void 0:e.data)?void 0:o.review)),ProductReviewInitSelector()),(null==(r=null==e?void 0:e.data)?void 0:r.instantsearch)&&(localStorage.setItem(LOCAL_STORAGE_KEY.INSTANT_SEARCH_SETTING,JSON.stringify(null==(l=null==e?void 0:e.data)?void 0:l.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}`)}))}));